From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 09:44:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 09:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1153.3796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8A-0001YH-0g; Thu, 01 Oct 2020 09:44:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1153.3796; Thu, 01 Oct 2020 09:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv89-0001Y9-Tr; Thu, 01 Oct 2020 09:44:05 +0000
Received: by outflank-mailman (input) for mailman id 1153;
 Thu, 01 Oct 2020 09:44:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNv88-0001Y4-Jo
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 03e68045-deab-4c87-8a1b-e3df5963eeff;
 Thu, 01 Oct 2020 09:44:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv86-0001on-Mb
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv86-0008It-LM
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNv88-0001Y4-Jo
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:04 +0000
X-Inumbo-ID: 03e68045-deab-4c87-8a1b-e3df5963eeff
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 03e68045-deab-4c87-8a1b-e3df5963eeff;
	Thu, 01 Oct 2020 09:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4xSu9PCglxeMdaqJ3RULUSVNj0iSWvlaty6XDEkSTQ8=; b=7LD1GaP5jab2dwSw6WWNgw5IJg
	9XuvPoMkR14j8kbuMntOqCOCtF5P90nV+b3FLLL2enPbzDYP3/ZdBee/NxbFZKc6lLF/ZjTMCrtz3
	djdtIAbChYGPJ452Tq9/7HAaPmTL5JALrK4iWJYzhcPwrYFZCchtuwKf4Xh9RqECLe+A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv86-0001on-Mb
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv86-0008It-LM
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] mini-os: netfront: retrieve netmask and gateway via extra function
Message-Id: <E1kNv86-0008It-LM@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 09:44:02 +0000

commit 30670e2a0a635f22b8236eb7b5c78eade244abff
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Sep 22 12:58:25 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:36:26 2020 +0000

    mini-os: netfront: retrieve netmask and gateway via extra function
    
    Commit 1b8ed31f4ce40 ("mini-os: netfront: Read netmask and gateway from
    Xenstore") modified init_netfront() to take two additional parameters.
    This broke the Xen build as init_netfront() is used in grub stubdom,
    too.
    
    So instead of tightly coupling Mini-OS and Xen build via this interface
    modification undo this change of init_netfront() and add two other
    functions for retrieving the netmask and gateway for a network device.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 include/netfront.h |  4 +++-
 lwip-net.c         |  4 +++-
 netfront.c         | 21 +++++++++++++++------
 test.c             |  2 +-
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/include/netfront.h b/include/netfront.h
index bc3080e..ec641c8 100644
--- a/include/netfront.h
+++ b/include/netfront.h
@@ -7,7 +7,9 @@ struct netfront_dev *init_netfront(char *nodename,
                                    void (*netif_rx)(unsigned char *data,
                                                     int len, void* arg),
                                    unsigned char rawmac[6],
-                                   char **ip, char **mask, char **gw);
+                                   char **ip);
+char *netfront_get_netmask(struct netfront_dev *dev);
+char *netfront_get_gateway(struct netfront_dev *dev);
 void netfront_xmit(struct netfront_dev *dev, unsigned char* data,int len);
 void shutdown_netfront(struct netfront_dev *dev);
 void suspend_netfront(void);
diff --git a/lwip-net.c b/lwip-net.c
index 80d1c8f..7e0d871 100644
--- a/lwip-net.c
+++ b/lwip-net.c
@@ -347,7 +347,9 @@ void start_networking(void)
 
   tprintk("Waiting for network.\n");
 
-  dev = init_netfront(NULL, NULL, rawmac, &ip, &netmask_str, &gw_str);
+  dev = init_netfront(NULL, NULL, rawmac, &ip);
+  netmask_str = netfront_get_netmask(dev);
+  gw_str = netfront_get_gateway(dev);
   
   if (ip) {
     ipaddr.addr = inet_addr(ip);
diff --git a/netfront.c b/netfront.c
index 205484b..9057908 100644
--- a/netfront.c
+++ b/netfront.c
@@ -65,6 +65,8 @@ struct netfront_dev {
 
     void (*netif_rx)(unsigned char* data, int len, void* arg);
     void *netif_rx_arg;
+
+    struct netfront_dev_list *ldev;
 };
 
 struct netfront_dev_list {
@@ -303,7 +305,7 @@ struct netfront_dev *init_netfront(char *_nodename,
                                    void (*thenetif_rx)(unsigned char* data,
                                                        int len, void* arg),
                                    unsigned char rawmac[6],
-                                   char **ip, char **mask, char **gw)
+                                   char **ip)
 {
     char nodename[256];
     struct netfront_dev *dev;
@@ -347,6 +349,7 @@ struct netfront_dev *init_netfront(char *_nodename,
     memset(ldev, 0, sizeof(struct netfront_dev_list));
 
     if (_init_netfront(dev, ldev->rawmac, &(ldev->ip), &(ldev->mask), &(ldev->gw))) {
+        dev->ldev = ldev;
         ldev->dev = dev;
         ldev->refcount = 1;
         ldev->next = NULL;
@@ -376,15 +379,21 @@ out:
 	}
     if (ip)
         *ip = strdup(ldev->ip);
-    if (mask)
-        *mask = strdup(ldev->mask);
-    if (gw)
-        *gw = strdup(ldev->gw);
 
 err:
     return dev;
 }
 
+char *netfront_get_netmask(struct netfront_dev *dev)
+{
+    return dev->ldev->mask ? strdup(dev->ldev->mask) : NULL;
+}
+
+char *netfront_get_gateway(struct netfront_dev *dev)
+{
+    return dev->ldev->gw ? strdup(dev->ldev->gw) : NULL;
+}
+
 static struct netfront_dev *_init_netfront(struct netfront_dev *dev,
 					   unsigned char rawmac[6],
 					   char **ip, char **mask, char **gw)
@@ -576,7 +585,7 @@ error:
 int netfront_tap_open(char *nodename) {
     struct netfront_dev *dev;
 
-    dev = init_netfront(nodename, NETIF_SELECT_RX, NULL, NULL, NULL, NULL);
+    dev = init_netfront(nodename, NETIF_SELECT_RX, NULL, NULL);
     if (!dev) {
 	printk("TAP open failed\n");
 	errno = EIO;
diff --git a/test.c b/test.c
index 2e5f7f9..42a2666 100644
--- a/test.c
+++ b/test.c
@@ -91,7 +91,7 @@ static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
 
 static void netfront_thread(void *p)
 {
-    net_dev = init_netfront(NULL, NULL, NULL, NULL, NULL, NULL);
+    net_dev = init_netfront(NULL, NULL, NULL, NULL);
     up(&net_sem);
 }
 #endif
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 09:44:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 09:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1154.3801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8K-0001ZF-3r; Thu, 01 Oct 2020 09:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1154.3801; Thu, 01 Oct 2020 09:44:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8K-0001Z7-0u; Thu, 01 Oct 2020 09:44:16 +0000
Received: by outflank-mailman (input) for mailman id 1154;
 Thu, 01 Oct 2020 09:44:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNv8H-0001Yx-V4
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3d14b020-3966-4ddd-ba47-0b662b48b48e;
 Thu, 01 Oct 2020 09:44:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8G-0001ot-Pq
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8G-0008KT-Om
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNv8H-0001Yx-V4
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:13 +0000
X-Inumbo-ID: 3d14b020-3966-4ddd-ba47-0b662b48b48e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3d14b020-3966-4ddd-ba47-0b662b48b48e;
	Thu, 01 Oct 2020 09:44:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d5zNzl5TY2ihWzlOqDcG+6g/pDtEcsMsrxyPHlrqTQI=; b=XZdRTJvZNxBnWfytwx87f0JD0B
	pa/DSsbvcUw6NIbr6UyEJuDgG1+q67sQzAWHtTr7vlG80svhFhDtIfDd2camdoNnsNUzg1A6NdE6s
	Saem81qHQFtbIuw8pUBwi2CF6UicxAQx4Rga7ftJIT9oRuh01Pqoio/njmX6rmEgym0I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8G-0001ot-Pq
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8G-0008KT-Om
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [mini-os master] mini-os: netfront: fix suspend/resume handling
Message-Id: <E1kNv8G-0008KT-Om@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 09:44:12 +0000

commit 4821876fcd2ff30bdfd77835731e9a0f1eaa33db
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Sep 22 12:58:26 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:36:35 2020 +0000

    mini-os: netfront: fix suspend/resume handling
    
    Suspend/resume handling of netfront is completely broken from the
    beginning. Commit d225f4012d69a1 ("Save/Restore Support: Add
    suspend/restore support for netfront") introduced a new structure
    netfront_dev_list referencing the real struct netfront_dev elements.
    This list is used to setup the devices when resuming again.
    
    Unfortunately the netfront_dev elements are released during suspend,
    so at resume time those references will be stale.
    
    Fix this whole mess by dropping struct netfront_dev_list again and
    link the netfront_dev elements directly into a list. When suspending
    don't free those elements.
    
    The ip-address, netmask and gateway strings can just be released when
    suspending and reread from xenstore at resume time.
    
    Fixes: d225f4012d69a1 ("Save/Restore Support: Add suspend/restore support for netfront")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 netfront.c | 162 +++++++++++++++++++++++++------------------------------------
 1 file changed, 67 insertions(+), 95 deletions(-)

diff --git a/netfront.c b/netfront.c
index 9057908..2075410 100644
--- a/netfront.c
+++ b/netfront.c
@@ -36,6 +36,8 @@ struct net_buffer {
 };
 
 struct netfront_dev {
+    int refcount;
+
     domid_t dom;
 
     unsigned short tx_freelist[NET_TX_RING_SIZE + 1];
@@ -66,27 +68,19 @@ struct netfront_dev {
     void (*netif_rx)(unsigned char* data, int len, void* arg);
     void *netif_rx_arg;
 
-    struct netfront_dev_list *ldev;
-};
-
-struct netfront_dev_list {
-    struct netfront_dev *dev;
     unsigned char rawmac[6];
     char *ip;
     char *mask;
     char *gw;
 
-    int refcount;
-
-    struct netfront_dev_list *next;
+    struct netfront_dev *next;
 };
 
-static struct netfront_dev_list *dev_list = NULL;
+static struct netfront_dev *dev_list = NULL;
 
 void init_rx_buffers(struct netfront_dev *dev);
-static struct netfront_dev *_init_netfront(struct netfront_dev *dev,
-                                           unsigned char rawmac[6], char **ip, char **mask, char **gw);
-static void _shutdown_netfront(struct netfront_dev *dev);
+static struct netfront_dev *_init_netfront(struct netfront_dev *dev);
+static int _shutdown_netfront(struct netfront_dev *dev);
 void netfront_set_rx_handler(struct netfront_dev *dev,
                              void (*thenetif_rx)(unsigned char *data, int len,
                                                  void *arg),
@@ -276,6 +270,7 @@ static void free_netfront(struct netfront_dev *dev)
     mask_evtchn(dev->evtchn);
 
     free(dev->mac);
+    free(dev->ip);
     free(dev->backend);
 
     gnttab_end_access(dev->rx_ring_ref);
@@ -309,8 +304,7 @@ struct netfront_dev *init_netfront(char *_nodename,
 {
     char nodename[256];
     struct netfront_dev *dev;
-    struct netfront_dev_list *ldev = NULL;
-    struct netfront_dev_list *list = NULL;
+    struct netfront_dev *list;
     static int netfrontends = 0;
 
     if (!_nodename)
@@ -321,10 +315,9 @@ struct netfront_dev *init_netfront(char *_nodename,
     }
 
     /* Check if the device is already initialized */
-    for (list = dev_list; list != NULL; list = list->next) {
-        if (strcmp(nodename, list->dev->nodename) == 0) {
-            list->refcount++;
-            dev = list->dev;
+    for (dev = dev_list; dev != NULL; dev = dev->next) {
+        if (strcmp(nodename, dev->nodename) == 0) {
+            dev->refcount++;
             if (thenetif_rx)
                 netfront_set_rx_handler(dev, thenetif_rx, NULL);
             goto out;
@@ -345,40 +338,34 @@ struct netfront_dev *init_netfront(char *_nodename,
     dev->netif_rx = thenetif_rx;
     dev->netif_rx_arg = NULL;
 
-    ldev = malloc(sizeof(struct netfront_dev_list));
-    memset(ldev, 0, sizeof(struct netfront_dev_list));
-
-    if (_init_netfront(dev, ldev->rawmac, &(ldev->ip), &(ldev->mask), &(ldev->gw))) {
-        dev->ldev = ldev;
-        ldev->dev = dev;
-        ldev->refcount = 1;
-        ldev->next = NULL;
+    if (_init_netfront(dev)) {
+        dev->refcount = 1;
+        dev->next = NULL;
 
         if (!dev_list) {
-            dev_list = ldev;
+            dev_list = dev;
         } else {
             for (list = dev_list; list->next != NULL; list = list->next)
                 ;
-            list->next = ldev;
-		}
+            list->next = dev;
+        }
         netfrontends++;
     } else {
-        free(ldev);
         dev = NULL;
         goto err;
     }
 
 out:
     if (rawmac) {
-        rawmac[0] = ldev->rawmac[0];
-        rawmac[1] = ldev->rawmac[1];
-        rawmac[2] = ldev->rawmac[2];
-        rawmac[3] = ldev->rawmac[3];
-        rawmac[4] = ldev->rawmac[4];
-        rawmac[5] = ldev->rawmac[5];
+        rawmac[0] = dev->rawmac[0];
+        rawmac[1] = dev->rawmac[1];
+        rawmac[2] = dev->rawmac[2];
+        rawmac[3] = dev->rawmac[3];
+        rawmac[4] = dev->rawmac[4];
+        rawmac[5] = dev->rawmac[5];
 	}
     if (ip)
-        *ip = strdup(ldev->ip);
+        *ip = strdup(dev->ip);
 
 err:
     return dev;
@@ -386,17 +373,15 @@ err:
 
 char *netfront_get_netmask(struct netfront_dev *dev)
 {
-    return dev->ldev->mask ? strdup(dev->ldev->mask) : NULL;
+    return dev->mask ? strdup(dev->mask) : NULL;
 }
 
 char *netfront_get_gateway(struct netfront_dev *dev)
 {
-    return dev->ldev->gw ? strdup(dev->ldev->gw) : NULL;
+    return dev->gw ? strdup(dev->gw) : NULL;
 }
 
-static struct netfront_dev *_init_netfront(struct netfront_dev *dev,
-					   unsigned char rawmac[6],
-					   char **ip, char **mask, char **gw)
+static struct netfront_dev *_init_netfront(struct netfront_dev *dev)
 {
     xenbus_transaction_t xbt;
     char* err = NULL;
@@ -518,6 +503,8 @@ done:
     {
         XenbusState state;
         char path[strlen(dev->backend) + strlen("/state") + 1];
+        char *p;
+
         snprintf(path, sizeof(path), "%s/state", dev->backend);
 
         xenbus_watch_path_token(XBT_NIL, path, path, &dev->events);
@@ -532,26 +519,18 @@ done:
             goto error;
         }
 
-        if (ip) {
-            char *p;
-
-            snprintf(path, sizeof(path), "%s/ip", dev->backend);
-            xenbus_read(XBT_NIL, path, ip);
-
-            if (mask) {
-                p = strchr(*ip, ' ');
-                if (p) {
-                    *p++ = '\0';
-                    *mask = p;
-
-                    if (gw) {
-                        p = strchr(p, ' ');
-                        if (p) {
-                            *p++ = '\0';
-                            *gw = p;
-                        }
-                    }
-                }
+        snprintf(path, sizeof(path), "%s/ip", dev->backend);
+        xenbus_read(XBT_NIL, path, &dev->ip);
+
+        p = strchr(dev->ip, ' ');
+        if (p) {
+            *p++ = '\0';
+            dev->mask = p;
+
+            p = strchr(p, ' ');
+            if (p) {
+                *p++ = '\0';
+                dev->gw = p;
             }
         }
     }
@@ -563,14 +542,13 @@ done:
     /* Special conversion specifier 'hh' needed for __ia64__. Without
      * this mini-os panics with 'Unaligned reference'.
      */
-    if (rawmac)
-        sscanf(dev->mac,"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-               &rawmac[0],
-               &rawmac[1],
-               &rawmac[2],
-               &rawmac[3],
-               &rawmac[4],
-               &rawmac[5]);
+    sscanf(dev->mac,"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
+           &dev->rawmac[0],
+           &dev->rawmac[1],
+           &dev->rawmac[2],
+           &dev->rawmac[3],
+           &dev->rawmac[4],
+           &dev->rawmac[5]);
 
     return dev;
 
@@ -600,38 +578,33 @@ int netfront_tap_open(char *nodename) {
 
 void shutdown_netfront(struct netfront_dev *dev)
 {
-    struct netfront_dev_list *list = NULL;
-    struct netfront_dev_list *to_del = NULL;
+    struct netfront_dev *list;
 
     /* Check this is a valid device */
-    for (list = dev_list; list != NULL; list = list->next) {
-        if (list->dev == dev)
-            break;
-    }
+    for (list = dev_list; list != NULL && list != dev; list = list->next);
 
     if (!list) {
         printk("Trying to shutdown an invalid netfront device (%p)\n", dev);
         return;
     }
 
-    list->refcount--;
-    if (list->refcount == 0) {
-        _shutdown_netfront(dev);
+    dev->refcount--;
+    if (dev->refcount == 0) {
+        if (_shutdown_netfront(dev))
+            return;
 
-        to_del = list;
-        if (to_del == dev_list) {
-            free(to_del);
-			dev_list = NULL;
+        if (dev == dev_list) {
+            dev_list = NULL;
         } else {
-            for (list = dev_list; list->next != to_del; list = list->next)
+            for (list = dev_list; list->next != dev; list = list->next)
                 ;
-            list->next = to_del->next;
-            free(to_del);
+            list->next = dev->next;
         }
+        free_netfront(dev);
     }
 }
 
-static void _shutdown_netfront(struct netfront_dev *dev)
+static int _shutdown_netfront(struct netfront_dev *dev)
 {
     char* err = NULL, *err2;
     XenbusState state;
@@ -692,24 +665,23 @@ close:
     err2 = xenbus_rm(XBT_NIL, nodename);
     free(err2);
 
-    if (!err)
-        free_netfront(dev);
+    return err ? -EBUSY : 0;
 }
 
 void suspend_netfront(void)
 {
-    struct netfront_dev_list *list;
+    struct netfront_dev *dev;
 
-    for (list = dev_list; list != NULL; list = list->next)
-        _shutdown_netfront(list->dev);
+    for (dev = dev_list; dev != NULL; dev = dev->next)
+        _shutdown_netfront(dev);
 }
 
 void resume_netfront(void)
 {
-    struct netfront_dev_list *list;
+    struct netfront_dev *dev;
 
-    for (list = dev_list; list != NULL; list = list->next)
-        _init_netfront(list->dev, NULL, NULL, NULL, NULL);
+    for (dev = dev_list; dev != NULL; dev = dev->next)
+        _init_netfront(dev);
 }
 
 void init_rx_buffers(struct netfront_dev *dev)
--
generated by git-patchbot for /home/xen/git/mini-os.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 09:44:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 09:44:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1155.3804 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8W-0001at-5U; Thu, 01 Oct 2020 09:44:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1155.3804; Thu, 01 Oct 2020 09:44:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8W-0001al-2X; Thu, 01 Oct 2020 09:44:28 +0000
Received: by outflank-mailman (input) for mailman id 1155;
 Thu, 01 Oct 2020 09:44:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNv8U-0001aY-RO
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d7e17ea8-c8a4-4537-a6d0-fdb910abaa13;
 Thu, 01 Oct 2020 09:44:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8T-0001ps-LK
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8T-0008Oc-K3
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNv8U-0001aY-RO
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:26 +0000
X-Inumbo-ID: d7e17ea8-c8a4-4537-a6d0-fdb910abaa13
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d7e17ea8-c8a4-4537-a6d0-fdb910abaa13;
	Thu, 01 Oct 2020 09:44:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AzxxXLq3dsdFJ3Mq7GULiLaukInhfwLa6LvsQ9hxTrk=; b=EUvJklJCL//C9NJQS9CxDjuxsG
	dLa1V6KJf9px09l7WSaPm52zVS1I0Ud9iZ/zgf3KefxretITXDszLhK8tjwN6A3EZhMsxwX8VM/MW
	NefjyP9GGdbvaetfMpgcIkOWNxPAwTEjI/yQXbELeAL9QDqPyBDTS25l8wJikAe0HTSM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8T-0001ps-LK
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8T-0008Oc-K3
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: provide a mechanism to define a device 'safe remove' function...
Message-Id: <E1kNv8T-0008Oc-K3@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 09:44:25 +0000

commit 6df07f9fbe1e9b65a40183f79a6171200dc877dd
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 15 15:10:06 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:32:25 2020 +0000

    libxl: provide a mechanism to define a device 'safe remove' function...
    
    ... and use it to define libxl_device_disk_safe_remove().
    
    This patch builds on the existent macro magic by using a new value of the
    'force' field in in libxl__ao_device.
    It is currently defined as an int but is used in a boolean manner where
    1 means the operation is forced and 0 means it is not (but is actually forced
    after a 10s time-out). In adding a third value, this patch re-defines 'force'
    as a struct type (libxl__force) with a single 'flag' field taking an
    enumerated value:
    
    LIBXL__FORCE_AUTO - corresponding to the old 0 value
    LIBXL__FORCE_ON   - corresponding to the old 1 value
    LIBXL__FORCE_OFF  - the new value
    
    The LIBXL_DEFINE_DEVICE_REMOVE() macro is then modified to define the
    libxl_device_<type>_remove() and libxl_device_<type>_destroy() functions,
    setting LIBXL__FORCE_AUTO and LIBXL__FORCE_ON (respectively) in the
    libxl__ao_device passed to libxl__initiate_device_generic_remove() and a
    new macro, LIBXL_DEFINE_DEVICE_SAFE_REMOVE(), is defined that sets
    LIBXL__FORCE_OFF instead. This macro is used to define the new
    libxl_device_disk_safe_remove() function.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 tools/libxl/libxl.h          | 33 +++++++++++++++++++++++++--------
 tools/libxl/libxl_device.c   |  9 +++++----
 tools/libxl/libxl_disk.c     |  4 +++-
 tools/libxl/libxl_domain.c   |  2 +-
 tools/libxl/libxl_internal.h | 30 +++++++++++++++++++++++-------
 5 files changed, 57 insertions(+), 21 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1cd6c38e83..1ea5b4f446 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -438,6 +438,12 @@
  */
 #define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
 
+/*
+ * LIBXL_HAVE_DISK_SAFE_REMOVE indicates that the
+ * libxl_device_disk_safe_remove() function is defined.
+ */
+#define LIBXL_HAVE_DISK_SAFE_REMOVE 1
+
 /*
  * libxl ABI compatibility
  *
@@ -1936,6 +1942,15 @@ void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
  *   structure is passed in are filled in with appropriate values for
  *   the device created.
  *
+ * libxl_device_<type>_destroy(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain without guest
+ *   co-operation. It is guest specific what affect this will have on
+ *   a running guest.
+ *
+ *   This function does not interact with the guest and therefore
+ *   cannot block on the guest.
+ *
  * libxl_device_<type>_remove(ctx, domid, device):
  *
  *   Removes the given device from the specified domain by performing
@@ -1943,16 +1958,14 @@ void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
  *   guest is running.
  *
  *   This method is currently synchronous and therefore can block
- *   while interacting with the guest.
- *
- * libxl_device_<type>_destroy(ctx, domid, device):
+ *   while interacting with the guest. There is a time-out of 10s on
+ *   this interaction after which libxl_device_<type>_destroy()
+ *   semantics apply.
  *
- *   Removes the given device from the specified domain without guest
- *   co-operation. It is guest specific what affect this will have on
- *   a running guest.
+ * libxl_device_<type>_safe_remove(ctx, domid, device):
  *
- *   This function does not interact with the guest and therefore
- *   cannot block on the guest.
+ *   This has the same semantics as libxl_device_<type>_remove() but,
+ *   in the event of hitting the 10s time-out, this function will fail.
  *
  * Controllers
  * -----------
@@ -2033,6 +2046,10 @@ int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_disk *disk,
                               const libxl_asyncop_how *ao_how)
                               LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_safe_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_disk *disk,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
 
 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
                                           uint32_t domid, int *num)
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 0381c5d509..e081faf9a9 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -973,7 +973,7 @@ void libxl__initiate_device_generic_remove(libxl__egc *egc,
             goto out;
         }
 
-        if (aodev->force)
+        if (aodev->force.flag == LIBXL__FORCE_ON)
             libxl__xs_path_cleanup(gc, t,
                                    libxl__device_frontend_path(gc, aodev->dev));
 
@@ -1092,9 +1092,9 @@ static void device_backend_callback(libxl__egc *egc, libxl__ev_devstate *ds,
 
     if (rc == ERROR_TIMEDOUT &&
         aodev->action == LIBXL__DEVICE_ACTION_REMOVE &&
-        !aodev->force) {
+        aodev->force.flag == LIBXL__FORCE_AUTO) {
         LOGD(DEBUG, aodev->dev->domid, "Timeout reached, initiating forced remove");
-        aodev->force = 1;
+        aodev->force.flag = LIBXL__FORCE_ON;
         libxl__initiate_device_generic_remove(egc, aodev);
         return;
     }
@@ -1319,7 +1319,8 @@ static void device_hotplug_done(libxl__egc *egc, libxl__ao_device *aodev)
     device_hotplug_clean(gc, aodev);
 
     /* Clean xenstore if it's a disconnection */
-    if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE) {
+    if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE &&
+        (aodev->force.flag == LIBXL__FORCE_ON || !aodev->rc)) {
         rc = libxl__device_destroy(gc, aodev->dev);
         if (!aodev->rc)
             aodev->rc = rc;
diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c
index ddc1eec176..de183e0fb0 100644
--- a/tools/libxl/libxl_disk.c
+++ b/tools/libxl/libxl_disk.c
@@ -1277,7 +1277,7 @@ void libxl__device_disk_local_initiate_detach(libxl__egc *egc,
         aodev->action = LIBXL__DEVICE_ACTION_REMOVE;
         aodev->dev = device;
         aodev->callback = local_device_detach_cb;
-        aodev->force = 0;
+        aodev->force.flag = LIBXL__FORCE_AUTO;
         libxl__initiate_device_generic_remove(egc, aodev);
         return;
     }
@@ -1318,10 +1318,12 @@ out:
  * libxl__add_disks
  * libxl_device_disk_remove
  * libxl_device_disk_destroy
+ * libxl_device_disk_safe_remove
  */
 LIBXL_DEFINE_DEVICE_ADD(disk)
 LIBXL_DEFINE_DEVICES_ADD(disk)
 LIBXL_DEFINE_DEVICE_REMOVE(disk)
+LIBXL_DEFINE_DEVICE_SAFE_REMOVE(disk)
 
 static int libxl_device_disk_compare(const libxl_device_disk *d1,
                                      const libxl_device_disk *d2)
diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
index 39f08a6519..5d4ec90711 100644
--- a/tools/libxl/libxl_domain.c
+++ b/tools/libxl/libxl_domain.c
@@ -1279,7 +1279,7 @@ static void dm_destroy_cb(libxl__egc *egc,
     dis->drs.ao = ao;
     dis->drs.domid = domid;
     dis->drs.callback = devices_destroy_cb;
-    dis->drs.force = 1;
+    dis->drs.force.flag = LIBXL__FORCE_ON;
     libxl__devices_destroy(egc, &dis->drs);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index e16ae9630b..1fcf85c3e2 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2730,12 +2730,20 @@ _hidden void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev);
 /* generic callback for devices that only need to set ao_complete */
 _hidden void device_addrm_aocomplete(libxl__egc *egc, libxl__ao_device *aodev);
 
+typedef struct {
+    enum {
+        LIBXL__FORCE_AUTO, /* Re-execute with FORCE_ON if op times out */
+        LIBXL__FORCE_ON,
+        LIBXL__FORCE_OFF,
+    } flag;
+} libxl__force;
+
 struct libxl__ao_device {
     /* filled in by user */
     libxl__ao *ao;
     libxl__device_action action;
     libxl__device *dev;
-    int force;
+    libxl__force force;
     libxl__device_callback *callback;
     /* return value, zeroed by user on entry, is valid on callback */
     int rc;
@@ -3787,7 +3795,7 @@ _hidden void libxl__bootloader_run(libxl__egc*, libxl__bootloader_state *st);
         aodev->action = LIBXL__DEVICE_ACTION_REMOVE;                    \
         aodev->dev = device;                                            \
         aodev->callback = device_addrm_aocomplete;                      \
-        aodev->force = f;                                               \
+        aodev->force.flag = f;                                          \
         libxl__initiate_device_##remtype##_remove(egc, aodev);          \
                                                                         \
     out:                                                                \
@@ -3862,12 +3870,20 @@ _hidden void libxl__bootloader_run(libxl__egc*, libxl__bootloader_state *st);
 
 
 #define LIBXL_DEFINE_DEVICE_REMOVE(type)                                \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, remove, 0)            \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, destroy, 1)
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, remove,               \
+                                   LIBXL__FORCE_AUTO)                   \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, destroy,              \
+                                   LIBXL__FORCE_ON)
 
 #define LIBXL_DEFINE_DEVICE_REMOVE_CUSTOM(type)                         \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, remove, 0)               \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, destroy, 1)
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, remove,                  \
+                                   LIBXL__FORCE_AUTO)                   \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, destroy,                 \
+                                   LIBXL__FORCE_ON)
+
+#define LIBXL_DEFINE_DEVICE_SAFE_REMOVE(type)                           \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, safe_remove,          \
+                                   LIBXL__FORCE_OFF)
 
 #define LIBXL_DEFINE_DEVICE_LIST(type)                                  \
     libxl_device_##type *libxl_device_##type##_list(libxl_ctx *ctx,     \
@@ -4028,7 +4044,7 @@ struct libxl__devices_remove_state {
     libxl__ao *ao;
     uint32_t domid;
     libxl__devices_remove_callback *callback;
-    int force; /* libxl_device_TYPE_destroy rather than _remove */
+    libxl__force force; /* libxl_device_TYPE_destroy rather than _remove */
     /* private */
     libxl__multidev multidev;
     int num_devices;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 09:44:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 09:44:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1156.3808 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8i-0001c9-7f; Thu, 01 Oct 2020 09:44:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1156.3808; Thu, 01 Oct 2020 09:44:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNv8i-0001c1-4E; Thu, 01 Oct 2020 09:44:40 +0000
Received: by outflank-mailman (input) for mailman id 1156;
 Thu, 01 Oct 2020 09:44:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNv8g-0001bo-1I
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 64637f37-f79f-40cc-9488-9ae4bd964db8;
 Thu, 01 Oct 2020 09:44:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8d-0001q0-QK
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNv8d-0008QJ-Na
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNv8g-0001bo-1I
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:38 +0000
X-Inumbo-ID: 64637f37-f79f-40cc-9488-9ae4bd964db8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 64637f37-f79f-40cc-9488-9ae4bd964db8;
	Thu, 01 Oct 2020 09:44:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6ilxtC+zyZpKtZ0/GvDN6o/OLuaGLzW1pOi/vtnPkRQ=; b=nr7/6oA8zjJqQli6qvIPH8YtUI
	ya7C0bjZvLNGCDnpKSE/QfM8PiEBKbcBtNReiwnWV0XXZmKqCOepAPasktJJkr/rcrjV9/hj0ESyl
	DNqR5xCvLdcnOMglGVksE+WtgYjkiKiBnrwsaV/RyR2hvgg8Rx1fJRF0MGHupyxAEPVM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8d-0001q0-QK
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNv8d-0008QJ-Na
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 09:44:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xl: implement documented '--force' option for block-detach
Message-Id: <E1kNv8d-0008QJ-Na@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 09:44:35 +0000

commit 707eb41ae2dde4636261f631224c97e9c0b16b56
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 15 15:10:07 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:32:57 2020 +0000

    xl: implement documented '--force' option for block-detach
    
    The manpage for 'xl' documents an option to force a block device to be
    released even if the domain to which it is attached does not co-operate.
    The documentation also states that, if the force flag is not specified, the
    block-detach operation should fail.
    
    Currently the force option is not implemented and a non-forced block-detach
    will auto-force after a time-out of 10s. This patch implements the force
    option and also stops auto-forcing a non-forced block-detach by calling
    libxl_device_disk_safe_remove() rather than libxl_device_disk_remove(),
    allowing the operation to fail cleanly as per the documented behaviour.
    
    NOTE: The documentation is also adjusted since the normal positioning of
          options is before compulsory parameters. It is also noted that use of
          the --force option may lead to a guest crash.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 docs/man/xl.1.pod.in   |  4 ++--
 tools/xl/xl_block.c    | 21 ++++++++++++++++-----
 tools/xl/xl_cmdtable.c |  3 ++-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 52a47a6fbd..5f7d3a7134 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -1389,7 +1389,7 @@ Note that only PV block devices are supported by block-attach.
 Requests to attach emulated devices (eg, vdev=hdc) will result in only
 the PV view being available to the guest.
 
-=item B<block-detach> I<domain-id> I<devid> [I<OPTIONS>]
+=item B<block-detach> [I<OPTIONS>] I<domain-id> I<devid>
 
 Detach a domain's virtual block device. I<devid> may be the symbolic
 name or the numeric device id given to the device by domain 0.  You
@@ -1406,7 +1406,7 @@ B<OPTIONS>
 =item B<--force>
 
 If this parameter is specified the device will be forcefully detached, which
-may cause IO errors in the domain.
+may cause IO errors in the domain and possibly a guest crash
 
 =back
 
diff --git a/tools/xl/xl_block.c b/tools/xl/xl_block.c
index acaf9b96b8..70eed431e4 100644
--- a/tools/xl/xl_block.c
+++ b/tools/xl/xl_block.c
@@ -96,12 +96,21 @@ int main_blocklist(int argc, char **argv)
 
 int main_blockdetach(int argc, char **argv)
 {
+    static struct option opts[] = {
+        {"force", 0, 0, 'f'},
+        COMMON_LONG_OPTS
+    };
     uint32_t domid;
     int opt, rc = 0;
     libxl_device_disk disk;
-
-    SWITCH_FOREACH_OPT(opt, "", NULL, "block-detach", 2) {
-        /* No options */
+    bool force = false;
+
+    SWITCH_FOREACH_OPT(opt, "f", opts, "block-detach", 2) {
+    case 'f':
+        force = true;
+        break;
+    default:
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -110,9 +119,11 @@ int main_blockdetach(int argc, char **argv)
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
     }
-    rc = libxl_device_disk_remove(ctx, domid, &disk, 0);
+    rc = !force ? libxl_device_disk_safe_remove(ctx, domid, &disk, 0) :
+        libxl_device_disk_destroy(ctx, domid, &disk, 0);
     if (rc) {
-        fprintf(stderr, "libxl_device_disk_remove failed.\n");
+        fprintf(stderr, "libxl_device_disk_%s failed.\n",
+                !force ? "safe_remove" : "destroy");
         return 1;
     }
     libxl_device_disk_dispose(&disk);
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2b8e1b321a..7da6c1b927 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -368,7 +368,8 @@ struct cmd_spec cmd_table[] = {
     { "block-detach",
       &main_blockdetach, 0, 1,
       "Destroy a domain's virtual block device",
-      "<Domain> <DevId>",
+      "[option] <Domain> <DevId>",
+      "-f, --force        do not wait for the domain to release the device"
     },
     { "vtpm-attach",
       &main_vtpmattach, 1, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 10:22:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 10:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1175.3881 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNviz-0005iW-Q6; Thu, 01 Oct 2020 10:22:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1175.3881; Thu, 01 Oct 2020 10:22:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNviz-0005iO-Mj; Thu, 01 Oct 2020 10:22:09 +0000
Received: by outflank-mailman (input) for mailman id 1175;
 Thu, 01 Oct 2020 10:22:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNviy-0005iI-QD
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ea312f69-57f6-4df4-8069-d785454e856a;
 Thu, 01 Oct 2020 10:22:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNviu-0002iK-MI
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNviu-0003kS-KQ
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNviy-0005iI-QD
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:08 +0000
X-Inumbo-ID: ea312f69-57f6-4df4-8069-d785454e856a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ea312f69-57f6-4df4-8069-d785454e856a;
	Thu, 01 Oct 2020 10:22:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pYOovcHIE9uBgXJPJFyuRnigsu2VWGME9y/9tVzcRYg=; b=QO9oPaikYmJKwv495DLCU4KPTs
	mtqJy5y/0ogS/ze9i9w5CAd6WKRtmLERg2adoJLe491OuQr43FF6z/lXDPTL3XJZfarp/jzO5qEYd
	xMJUw5Mk7Nu652lkA3pgofYPnMH8S1ZU1IDZFhEurT9Xwbfwbn6jT9gL5TEUZ9tz6Gzg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNviu-0002iK-MI
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNviu-0003kS-KQ
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 10:22:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Use LOCK ADD instead of MFENCE for smp_mb()
Message-Id: <E1kNviu-0003kS-KQ@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 10:22:04 +0000

commit de16a8fa0db7f1879442cf9cfe865eb2e9d98e6d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Sep 21 13:17:30 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Oct 1 11:14:22 2020 +0100

    x86: Use LOCK ADD instead of MFENCE for smp_mb()
    
    MFENCE is overly heavyweight for SMP semantics on WB memory, because it also
    orders weaker cached writes, and flushes the WC buffers.
    
    This technique was used as an optimisation in Java[1], and later adopted by
    Linux[2] where it was measured to have a 60% performance improvement in VirtIO
    benchmarks.
    
    The stack is used because it is hot in the L1 cache, and a -4 offset is used
    to avoid creating a false data dependency on live data.
    
    For 64bit userspace, the Red Zone needs to be considered.  Use -32 to allow
    for a reasonable quantity of Red Zone data, but still have a 50% chance of
    hitting the same cache line as %rsp.
    
    Fix up the 32 bit definitions in HVMLoader and libxc to avoid a false data
    dependency.
    
    [1] https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
    [2] https://git.kernel.org/torvalds/c/450cbdd0125cfa5d7bbf9e2a6b6961cc48d29730
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/firmware/hvmloader/util.h   | 2 +-
 tools/libs/ctrl/include/xenctrl.h | 4 ++--
 xen/include/asm-x86/system.h      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 31889de634..4f0baade0e 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -133,7 +133,7 @@ static inline void cpu_relax(void)
 #define barrier() asm volatile ( "" : : : "memory" )
 #define rmb()     barrier()
 #define wmb()     barrier()
-#define mb()      asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define mb()      asm volatile ( "lock addl $0, -4(%%esp)" ::: "memory" )
 
 /*
  * Divide a 64-bit dividend by a 32-bit divisor.
diff --git a/tools/libs/ctrl/include/xenctrl.h b/tools/libs/ctrl/include/xenctrl.h
index ba70bec9c4..3796425e1e 100644
--- a/tools/libs/ctrl/include/xenctrl.h
+++ b/tools/libs/ctrl/include/xenctrl.h
@@ -68,11 +68,11 @@
 #define xen_barrier() asm volatile ( "" : : : "memory")
 
 #if defined(__i386__)
-#define xen_mb()  asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define xen_mb()  asm volatile ( "lock addl $0, -4(%%esp)" ::: "memory" )
 #define xen_rmb() xen_barrier()
 #define xen_wmb() xen_barrier()
 #elif defined(__x86_64__)
-#define xen_mb()  asm volatile ( "mfence" : : : "memory")
+#define xen_mb()  asm volatile ( "lock addl $0, -32(%%rsp)" ::: "memory" )
 #define xen_rmb() xen_barrier()
 #define xen_wmb() xen_barrier()
 #elif defined(__arm__)
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 45c183bd10..630909965e 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -220,7 +220,7 @@ static always_inline unsigned long __xadd(
  *
  * Refer to the vendor system programming manuals for further details.
  */
-#define smp_mb()        mb()
+#define smp_mb()        asm volatile ( "lock addl $0, -4(%%rsp)" ::: "memory" )
 #define smp_rmb()       barrier()
 #define smp_wmb()       barrier()
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1280.4299 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyhu-0000iP-HG; Thu, 01 Oct 2020 13:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1280.4299; Thu, 01 Oct 2020 13:33:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyhu-0000iI-Dm; Thu, 01 Oct 2020 13:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1280;
 Thu, 01 Oct 2020 13:33:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyht-0000iD-9d
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9ed57a2f-3ded-44c5-822b-ec3682a240c6;
 Thu, 01 Oct 2020 13:33:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyhl-0006jw-Ud
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyhl-00033T-TY
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyht-0000iD-9d
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:13 +0000
X-Inumbo-ID: 9ed57a2f-3ded-44c5-822b-ec3682a240c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9ed57a2f-3ded-44c5-822b-ec3682a240c6;
	Thu, 01 Oct 2020 13:33:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j+SL7XTFcvxSLvPxn5MQ1daJylpyE8UpNqUxmHSPToE=; b=QhhyI7Vx/UICTMVwO+hR3fq9ml
	Esrq3LaT1jlkPQTQUvYbWQTmVbJt97wkqtahbFRZGVDbJnWM91EIPHc80dPRL8hqBmukILzMe+ly5
	G+HwBFOSsLBAx+t2R4qEOvOxl8xtSWF9RwGZOBm+JubwSCLUGxAM1zwY1ibFmuvQzPlg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyhl-0006jw-Ud
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyhl-00033T-TY
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: move libxenlight to tools/libs/light
Message-Id: <E1kNyhl-00033T-TY@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:05 +0000

commit 41aea82de2b581c61482aeddab151ecf3b1bca25
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:09 2020 +0200

    tools/libxl: move libxenlight to tools/libs/light
    
    Carve out all libxenlight related sources and move them to
    tools/libs/light in order to use the generic library build environment.
    
    The closely related sources for libxl-save-helper and the libxl test
    environment are being moved, too.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                                  |   31 +-
 tools/Rules.mk                              |   11 +-
 tools/configure                             |    2 +-
 tools/configure.ac                          |    2 +-
 tools/golang/xenlight/Makefile              |    2 +-
 tools/libs/Makefile                         |    1 +
 tools/libs/light/CODING_STYLE               |  330 ++
 tools/libs/light/Makefile                   |  277 ++
 tools/libs/light/check-libxl-api-rules      |   23 +
 tools/libs/light/flexarray.c                |  124 +
 tools/libs/light/flexarray.h                |   54 +
 tools/libs/light/gentest.py                 |  374 +++
 tools/libs/light/gentypes.py                |  797 +++++
 tools/libs/light/idl.py                     |  377 +++
 tools/libs/light/idl.txt                    |  214 ++
 tools/libs/light/include/libxl.h            | 2732 +++++++++++++++
 tools/libs/light/include/libxl_event.h      |  632 ++++
 tools/libs/light/include/libxl_json.h       |   96 +
 tools/libs/light/include/libxl_utils.h      |  194 ++
 tools/libs/light/include/libxl_uuid.h       |   80 +
 tools/libs/light/libxl.c                    |  831 +++++
 tools/libs/light/libxl_9pfs.c               |   52 +
 tools/libs/light/libxl_aoutils.c            |  667 ++++
 tools/libs/light/libxl_arch.h               |   96 +
 tools/libs/light/libxl_arm.c                | 1230 +++++++
 tools/libs/light/libxl_arm.h                |   48 +
 tools/libs/light/libxl_arm_acpi.c           |  413 +++
 tools/libs/light/libxl_arm_no_acpi.c        |   40 +
 tools/libs/light/libxl_bootloader.c         |  680 ++++
 tools/libs/light/libxl_checkpoint_device.c  |  278 ++
 tools/libs/light/libxl_colo.h               |  148 +
 tools/libs/light/libxl_colo_nic.c           |  316 ++
 tools/libs/light/libxl_colo_proxy.c         |  438 +++
 tools/libs/light/libxl_colo_qdisk.c         |  230 ++
 tools/libs/light/libxl_colo_restore.c       | 1093 ++++++
 tools/libs/light/libxl_colo_save.c          |  714 ++++
 tools/libs/light/libxl_console.c            |  802 +++++
 tools/libs/light/libxl_convert_callout.c    |  173 +
 tools/libs/light/libxl_cpuid.c              |  628 ++++
 tools/libs/light/libxl_cpupool.c            |  452 +++
 tools/libs/light/libxl_create.c             | 2310 +++++++++++++
 tools/libs/light/libxl_device.c             | 2090 ++++++++++++
 tools/libs/light/libxl_disk.c               | 1390 ++++++++
 tools/libs/light/libxl_dm.c                 | 3795 +++++++++++++++++++++
 tools/libs/light/libxl_dom.c                | 1469 ++++++++
 tools/libs/light/libxl_dom_save.c           |  564 ++++
 tools/libs/light/libxl_dom_suspend.c        |  677 ++++
 tools/libs/light/libxl_domain.c             | 2462 ++++++++++++++
 tools/libs/light/libxl_event.c              | 2467 ++++++++++++++
 tools/libs/light/libxl_exec.c               |  473 +++
 tools/libs/light/libxl_flask.c              |   79 +
 tools/libs/light/libxl_fork.c               |  734 ++++
 tools/libs/light/libxl_freebsd.c            |  252 ++
 tools/libs/light/libxl_genid.c              |  117 +
 tools/libs/light/libxl_internal.c           |  806 +++++
 tools/libs/light/libxl_internal.h           | 4859 +++++++++++++++++++++++++++
 tools/libs/light/libxl_json.c               | 1191 +++++++
 tools/libs/light/libxl_libfdt_compat.c      |   94 +
 tools/libs/light/libxl_libfdt_compat.h      |   90 +
 tools/libs/light/libxl_linux.c              |  375 +++
 tools/libs/light/libxl_mem.c                |  651 ++++
 tools/libs/light/libxl_netbsd.c             |  131 +
 tools/libs/light/libxl_netbuffer.c          |  532 +++
 tools/libs/light/libxl_nic.c                |  544 +++
 tools/libs/light/libxl_no_colo.c            |   62 +
 tools/libs/light/libxl_no_convert_callout.c |   35 +
 tools/libs/light/libxl_nocpuid.c            |   67 +
 tools/libs/light/libxl_nonetbuffer.c        |   54 +
 tools/libs/light/libxl_numa.c               |  535 +++
 tools/libs/light/libxl_osdeps.h             |  130 +
 tools/libs/light/libxl_paths.c              |   71 +
 tools/libs/light/libxl_pci.c                | 2508 ++++++++++++++
 tools/libs/light/libxl_psr.c                |  562 ++++
 tools/libs/light/libxl_pvcalls.c            |   37 +
 tools/libs/light/libxl_qmp.c                | 1934 +++++++++++
 tools/libs/light/libxl_remus.c              |  425 +++
 tools/libs/light/libxl_remus_disk_drbd.c    |  232 ++
 tools/libs/light/libxl_save_callout.c       |  430 +++
 tools/libs/light/libxl_save_helper.c        |  303 ++
 tools/libs/light/libxl_save_msgs_gen.pl     |  396 +++
 tools/libs/light/libxl_sched.c              |  986 ++++++
 tools/libs/light/libxl_sr_stream_format.h   |   69 +
 tools/libs/light/libxl_stream_read.c        |  977 ++++++
 tools/libs/light/libxl_stream_write.c       |  727 ++++
 tools/libs/light/libxl_test_fdevent.c       |   79 +
 tools/libs/light/libxl_test_fdevent.h       |   12 +
 tools/libs/light/libxl_test_timedereg.c     |  100 +
 tools/libs/light/libxl_test_timedereg.h     |    9 +
 tools/libs/light/libxl_tmem.c               |   76 +
 tools/libs/light/libxl_types.idl            | 1224 +++++++
 tools/libs/light/libxl_types_internal.idl   |   57 +
 tools/libs/light/libxl_usb.c                | 2158 ++++++++++++
 tools/libs/light/libxl_utils.c              | 1272 +++++++
 tools/libs/light/libxl_uuid.c               |  163 +
 tools/libs/light/libxl_vdispl.c             |  222 ++
 tools/libs/light/libxl_vkb.c                |  353 ++
 tools/libs/light/libxl_vnuma.c              |  327 ++
 tools/libs/light/libxl_vsnd.c               |  686 ++++
 tools/libs/light/libxl_vtpm.c               |  248 ++
 tools/libs/light/libxl_x86.c                |  852 +++++
 tools/libs/light/libxl_x86_acpi.c           |  252 ++
 tools/libs/light/libxl_x86_acpi.h           |   35 +
 tools/libs/light/libxl_xshelp.c             |  329 ++
 tools/libs/light/osdeps.c                   |   76 +
 tools/libs/light/test_common.c              |   57 +
 tools/libs/light/test_common.h              |   29 +
 tools/libs/light/test_fdderegrace.c         |   56 +
 tools/libs/light/test_timedereg.c           |   11 +
 tools/libs/uselibs.mk                       |    2 +
 tools/libxl/Makefile                        |  278 +-
 tools/libxl/check-libxl-api-rules           |   23 -
 tools/libxl/flexarray.c                     |  124 -
 tools/libxl/flexarray.h                     |   54 -
 tools/libxl/gentest.py                      |  374 ---
 tools/libxl/gentypes.py                     |  797 -----
 tools/libxl/idl.py                          |  377 ---
 tools/libxl/idl.txt                         |  214 --
 tools/libxl/libxl.c                         |  831 -----
 tools/libxl/libxl.h                         | 2732 ---------------
 tools/libxl/libxl_9pfs.c                    |   52 -
 tools/libxl/libxl_aoutils.c                 |  667 ----
 tools/libxl/libxl_arch.h                    |   96 -
 tools/libxl/libxl_arm.c                     | 1230 -------
 tools/libxl/libxl_arm.h                     |   48 -
 tools/libxl/libxl_arm_acpi.c                |  413 ---
 tools/libxl/libxl_arm_no_acpi.c             |   40 -
 tools/libxl/libxl_bootloader.c              |  680 ----
 tools/libxl/libxl_checkpoint_device.c       |  278 --
 tools/libxl/libxl_colo.h                    |  148 -
 tools/libxl/libxl_colo_nic.c                |  316 --
 tools/libxl/libxl_colo_proxy.c              |  438 ---
 tools/libxl/libxl_colo_qdisk.c              |  230 --
 tools/libxl/libxl_colo_restore.c            | 1093 ------
 tools/libxl/libxl_colo_save.c               |  714 ----
 tools/libxl/libxl_console.c                 |  802 -----
 tools/libxl/libxl_convert_callout.c         |  173 -
 tools/libxl/libxl_cpuid.c                   |  628 ----
 tools/libxl/libxl_cpupool.c                 |  452 ---
 tools/libxl/libxl_create.c                  | 2310 -------------
 tools/libxl/libxl_device.c                  | 2090 ------------
 tools/libxl/libxl_disk.c                    | 1390 --------
 tools/libxl/libxl_dm.c                      | 3795 ---------------------
 tools/libxl/libxl_dom.c                     | 1469 --------
 tools/libxl/libxl_dom_save.c                |  564 ----
 tools/libxl/libxl_dom_suspend.c             |  677 ----
 tools/libxl/libxl_domain.c                  | 2462 --------------
 tools/libxl/libxl_event.c                   | 2467 --------------
 tools/libxl/libxl_event.h                   |  632 ----
 tools/libxl/libxl_exec.c                    |  473 ---
 tools/libxl/libxl_flask.c                   |   79 -
 tools/libxl/libxl_fork.c                    |  734 ----
 tools/libxl/libxl_freebsd.c                 |  252 --
 tools/libxl/libxl_genid.c                   |  117 -
 tools/libxl/libxl_internal.c                |  806 -----
 tools/libxl/libxl_internal.h                | 4859 ---------------------------
 tools/libxl/libxl_json.c                    | 1191 -------
 tools/libxl/libxl_json.h                    |   96 -
 tools/libxl/libxl_libfdt_compat.c           |   94 -
 tools/libxl/libxl_libfdt_compat.h           |   90 -
 tools/libxl/libxl_linux.c                   |  375 ---
 tools/libxl/libxl_mem.c                     |  651 ----
 tools/libxl/libxl_netbsd.c                  |  131 -
 tools/libxl/libxl_netbuffer.c               |  532 ---
 tools/libxl/libxl_nic.c                     |  544 ---
 tools/libxl/libxl_no_colo.c                 |   62 -
 tools/libxl/libxl_no_convert_callout.c      |   35 -
 tools/libxl/libxl_nocpuid.c                 |   67 -
 tools/libxl/libxl_nonetbuffer.c             |   54 -
 tools/libxl/libxl_numa.c                    |  535 ---
 tools/libxl/libxl_osdeps.h                  |  130 -
 tools/libxl/libxl_paths.c                   |   71 -
 tools/libxl/libxl_pci.c                     | 2508 --------------
 tools/libxl/libxl_psr.c                     |  562 ----
 tools/libxl/libxl_pvcalls.c                 |   37 -
 tools/libxl/libxl_qmp.c                     | 1934 -----------
 tools/libxl/libxl_remus.c                   |  425 ---
 tools/libxl/libxl_remus_disk_drbd.c         |  232 --
 tools/libxl/libxl_save_callout.c            |  430 ---
 tools/libxl/libxl_save_helper.c             |  303 --
 tools/libxl/libxl_save_msgs_gen.pl          |  396 ---
 tools/libxl/libxl_sched.c                   |  986 ------
 tools/libxl/libxl_sr_stream_format.h        |   69 -
 tools/libxl/libxl_stream_read.c             |  977 ------
 tools/libxl/libxl_stream_write.c            |  727 ----
 tools/libxl/libxl_test_fdevent.c            |   79 -
 tools/libxl/libxl_test_fdevent.h            |   12 -
 tools/libxl/libxl_test_timedereg.c          |  100 -
 tools/libxl/libxl_test_timedereg.h          |    9 -
 tools/libxl/libxl_tmem.c                    |   76 -
 tools/libxl/libxl_types.idl                 | 1224 -------
 tools/libxl/libxl_types_internal.idl        |   57 -
 tools/libxl/libxl_usb.c                     | 2158 ------------
 tools/libxl/libxl_utils.c                   | 1272 -------
 tools/libxl/libxl_utils.h                   |  194 --
 tools/libxl/libxl_uuid.c                    |  163 -
 tools/libxl/libxl_uuid.h                    |   80 -
 tools/libxl/libxl_vdispl.c                  |  222 --
 tools/libxl/libxl_vkb.c                     |  353 --
 tools/libxl/libxl_vnuma.c                   |  327 --
 tools/libxl/libxl_vsnd.c                    |  686 ----
 tools/libxl/libxl_vtpm.c                    |  248 --
 tools/libxl/libxl_x86.c                     |  852 -----
 tools/libxl/libxl_x86_acpi.c                |  252 --
 tools/libxl/libxl_x86_acpi.h                |   35 -
 tools/libxl/libxl_xshelp.c                  |  329 --
 tools/libxl/osdeps.c                        |   76 -
 tools/libxl/test_common.c                   |   57 -
 tools/libxl/test_common.h                   |   29 -
 tools/libxl/test_fdderegrace.c              |   56 -
 tools/libxl/test_timedereg.c                |   11 -
 tools/ocaml/libs/xl/Makefile                |    8 +-
 211 files changed, 63046 insertions(+), 62700 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5e8c47e2db..f30550255f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,6 +128,22 @@ tools/libs/guest/xc_core.h
 tools/libs/guest/xc_core_arm.h
 tools/libs/guest/xc_core_x86.h
 tools/libs/guest/xc_private.h
+tools/libs/light/_*.[ch]
+tools/libs/light/*.pyc
+tools/libs/light/_libxl.api-for-check
+tools/libs/light/*.api-ok
+tools/libs/light/libxenlight.map
+tools/libs/light/libxl-save-helper
+tools/libs/light/dsdt*
+tools/libs/light/mk_dsdt
+tools/libs/light/ssdt*
+tools/libs/light/testidl
+tools/libs/light/testidl.c
+tools/libs/light/test_timedereg
+tools/libs/light/test_fdderegrace
+tools/libs/light/tmp.*
+tools/libs/light/xenlight.pc
+tools/libs/light/include/_*.h
 tools/libs/stat/_paths.h
 tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
@@ -216,16 +232,8 @@ tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-tools/libxl/_libxl.api-for-check
-tools/libxl/*.api-ok
 tools/libxl/*.pc
-tools/libxl/dsdt*
 tools/libxl/libxlu_cfg_y.output
-tools/libxl/mk_dsdt
-tools/libxl/ssdt*
-tools/libxl/testenum
-tools/libxl/testenum.c
-tools/libxl/tmp.*
 tools/misc/cpuperf/cpuperf-perfcntr
 tools/misc/cpuperf/cpuperf-xen
 tools/misc/xc_shadow
@@ -380,13 +388,6 @@ tools/include/xen-foreign/arm64.h
 tools/misc/xen-hptool
 tools/misc/xen-mfndump
 tools/libs/toolcore/include/_*.h
-tools/libxl/_*.[ch]
-tools/libxl/testidl
-tools/libxl/testidl.c
-tools/libxl/*.pyc
-tools/libxl/libxl-save-helper
-tools/libxl/test_timedereg
-tools/libxl/test_fdderegrace
 tools/firmware/etherboot/eb-roms.h
 tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
 tools/misc/xenhypfs
diff --git a/tools/Rules.mk b/tools/Rules.mk
index a71abb2e4f..a68dbb9de8 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,9 +15,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxenlight    = $(XEN_ROOT)/tools/libxl
-# Currently libxlutil lives in the same directory as libxenlight
-XEN_libxlutil      = $(XEN_libxenlight)
+XEN_libxlutil      = $(XEN_ROOT)/tools/libxl
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
@@ -107,6 +105,8 @@ ifeq ($(CONFIG_Linux),y)
 LDLIBS_libxenstore += -ldl
 endif
 
+CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
+
 ifeq ($(debug),y)
 # Disable optimizations
 CFLAGS += -O0 -fno-omit-frame-pointer
@@ -116,11 +116,6 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
-SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest)
-LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension)
-SHLIB_libxenlight  = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight)
-
 CFLAGS_libxlutil = -I$(XEN_libxlutil)
 SHDEPS_libxlutil = $(SHLIB_libxenlight)
 LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension)
diff --git a/tools/configure b/tools/configure
index edcdcf4f73..8a708e9baa 100755
--- a/tools/configure
+++ b/tools/configure
@@ -585,7 +585,7 @@ PACKAGE_STRING='Xen Hypervisor Tools 4.15'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
-ac_unique_file="libxl/libxl.c"
+ac_unique_file="libs/light/libxl.c"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
diff --git a/tools/configure.ac b/tools/configure.ac
index 6614a4f130..ee8ba5ff24 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -4,7 +4,7 @@
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [https://www.xen.org/])
-AC_CONFIG_SRCDIR([libxl/libxl.c])
+AC_CONFIG_SRCDIR([libs/light/libxl.c])
 AC_CONFIG_FILES([
 ../config/Tools.mk
 hotplug/FreeBSD/rc.d/xencommons
diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index b17095e64b..fd8e4893db 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -8,7 +8,7 @@ GOXL_INSTALL_DIR = $(GOCODE_DIR)/src/$(XEN_GOCODE_URL)/xenlight/
 
 GO ?= go
 
-LIBXL_SRC_DIR = ../../libxl
+LIBXL_SRC_DIR = $(XEN_ROOT)/tools/libs/light
 
 .PHONY: all
 all: build
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index e8fcd59214..c41455c604 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -15,6 +15,7 @@ SUBDIRS-y += hypfs
 SUBDIRS-y += store
 SUBDIRS-y += stat
 SUBDIRS-$(CONFIG_Linux) += vchan
+SUBDIRS-y += light
 
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE
new file mode 100644
index 0000000000..3d572f6925
--- /dev/null
+++ b/tools/libs/light/CODING_STYLE
@@ -0,0 +1,330 @@
+LIBXENLIGHT CODING STYLE
+========================
+
+
+AN APOLOGY AND WARNING
+----------------------
+
+Much of the code in libxl does not yet follow this coding style
+document in every respect.  However, new code is expected to conform.
+
+Patches to improve the style of existing code are welcome.  Please
+separate these out from functional changes.
+
+If it is not feasible to conform fully to the style while patching old
+code, without doing substantial style reengineering first, we may
+accept patches which contain nonconformant elements, provided that
+they don't make the coding style problem worse overall.
+
+In this case, the new code should conform to the prevailing style in
+the area being touched.
+
+
+MEMORY ALLOCATION
+-----------------
+
+Memory allocation for libxl-internal purposes should normally be done
+with the provided gc mechanisms; there is then no need to free.  See
+"libxl memory management" in libxl.h.
+
+
+CONVENTIONAL VARIABLE NAMES
+---------------------------
+
+The following local variable names should be used where applicable:
+
+  int rc;    /* a libxl error code - and not anything else */
+  int r;     /* the return value from a system call (or libxc call) */
+  bool ok;   /* the success return value from a boolean function */
+
+  uint32_t domid;
+  libxl__gc *gc;
+  libxl__egc *egc;
+  libxl__ao *ao;
+
+  libxl_foo_bar_state *fbs;    /* local variable */
+  libxl_foo_bar_state foo_bar; /* inside another state struct */
+
+
+CONVENIENCE MACROS
+------------------
+
+There are a number of convenience macros which shorten the program and
+avoid opportunity for mistakes.  In some cases non-use of the macros
+produces functional bugs or incorrect error handling.  Use the macros
+whenever they are applicable.  For example:
+
+ Usually, don't use:     Instead, use (see libxl_internal.h):
+  libxl__log[v]           LOG, LOGE, LOGEV
+  libxl__sprintf          GCSPRINTF
+  libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
+  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
+--------------
+
+Unless, there are good reasons to do otherwise, the following error
+handling and cleanup paradigm should be used:
+
+  * All local variables referring to resources which might need
+    cleaning up are declared at the top of the function, and
+    initialised to a sentinel value indicating "nothing allocated".
+    For example,
+            libxl_evgen_disk_eject *evg = NULL;
+            int nullfd = -1;
+
+  * If the function is to return a libxl error value, `rc' is
+    used to contain the error code, but it is NOT initialised:
+            int rc;
+
+  * There is only one error cleanup path out of the function.  It
+    starts with a label `out:'.  That error cleanup path checks for
+    each allocated resource and frees it iff necessary.  It then
+    returns rc.  For example,
+         out:
+             if (evg) libxl__evdisable_disk_eject(gc, evg);
+             if (nullfd >= 0) close(nullfd);
+             return rc;
+
+  * Function calls which might fail (ie most function calls) are
+    handled by putting the return/status value into a variable, and
+    then checking it in a separate statement:
+            char *dompath = libxl__xs_get_dompath(gc, bl->domid);
+            if (!dompath) { rc = ERROR_FAIL; goto out; }
+
+  * If a resource is freed in the main body of the function (for
+    example, in a loop), the corresponding variable has to be reset to
+    the sentinel at the point where it's freed.
+
+Whether to use the `out' path for successful returns as well as error
+returns is a matter of taste and convenience for the specific
+function.  Not reusing the out path is fine if the duplicated function
+exit code is only `CTX_UNLOCK; GC_FREE;' (or similar).
+
+If you reuse the `out' path for successful returns, there may be
+resources which are to be returned to the caller rather than freed.
+In that case you have to reset the local variable to `nothing here',
+to avoid the resource being freed on the out path.  That resetting
+should be done immediately after the resource value is stored at the
+applicable _r function parameter (or equivalent).  Do not test `rc' in
+the out section, to discover whether to free things.
+
+The uses of the single-line formatting in the examples above are
+permitted exceptions to the usual libxl code formatting rules.
+
+
+
+IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
+--------------------------------------------------
+
+Nontrivial data structures (in structs) should come with an idempotent
+_dispose function, which must free all resources associated with the
+data structure (but not free the struct itself).
+
+Such a struct should also come with an _init function which
+initialises the struct so that _dispose is a no-op.
+
+
+ASYNCHRONOUS/LONG-RUNNING OPERATIONS
+------------------------------------
+
+All long-running operations in libxl need to use the asynchronous
+operation machinery.  Consult the programmer documentation in
+libxl_internal.h for details - search for "Machinery for asynchronous
+operations".
+
+The code for asynchronous operations should be laid out in
+chronological order.  That is, where there is a chain of callback
+functions, each subsequent function should be, textually, the next
+function in the file.  This will normally involve predeclaring the
+callback functions.  Synchronous helper functions should be separated
+out into a section preceding the main callback chain.
+
+Control flow arrangements in asynchronous operations should be made as
+simple as possible, because it can otherwise be very hard to see
+through the tangle.
+
+
+When inventing a new sub-operation in asynchronous code, consider
+whether to structure it formally as a sub-operation with its own state
+structure.  (See, for example, libxl__datacopier_*.)
+
+An ao-suboperation state structure should contain, in this order:
+  * fields that the caller must fill in, and which are,
+    effectively, the parameters to the operation, including:
+      - libxl__ao *ao
+      - the callback function pointer(s), which
+        should be named callback or callback_*.
+  * shared information fields or ones used for returning information
+    to the calling operation
+  * private fields
+These sections should be clearly demarcated by comments.
+
+An asynchronous operation should normally have an idempotent stop or
+cancel function.  It should normally also have an _init function for
+its state struct, which arranges that the stop is a no-op.
+
+The permitted order of calls into your ao operation's methods must be
+documented in comments, if it is nontrivial.
+
+
+When using an ao sub-operation, you should normally:
+ * Physically include the sub-operation state struct in your
+   own state struct;
+ * Use CONTAINER_OF to find your own state struct at the start of
+   your implementations of the sub-operation callback functions;
+ * Unconditionally initialise the sub-operation's struct (with its
+   _init method) in your own _init method.
+ * Unconditionally cancel or destroy the sub-operation in your own
+   cancel or destroy method.
+
+
+FORMATTING AND NAMING
+---------------------
+
+Blatantly copied from qemu and linux with few modifications.
+
+
+1. Whitespace
+
+Of course, the most important aspect in any coding style is whitespace.
+Crusty old coders who have trouble spotting the glasses on their noses
+can tell the difference between a tab and eight spaces from a distance
+of approximately fifteen parsecs.  Many a flamewar have been fought and
+lost on this issue.
+
+Libxenlight indents are four spaces.  Tabs are never used, except in
+Makefiles where they have been irreversibly coded into the syntax.
+Spaces of course are superior to tabs because:
+
+ - You have just one way to specify whitespace, not two.  Ambiguity breeds
+   mistakes.
+ - The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
+ - Tab indents push your code to the right, making your screen seriously
+   unbalanced.
+ - Tabs will be rendered incorrectly on editors who are misconfigured not
+   to use tab stops of eight positions.
+ - Tabs are rendered badly in patches, causing off-by-one errors in almost
+   every line.
+ - It is the libxenlight coding style.
+
+Do not leave whitespace dangling off the ends of lines.
+
+
+2. Line width
+
+Lines are limited to 75 characters.
+
+Rationale:
+ - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
+   xterms and use vi in all of them.  The best way to punish them is to
+   let them keep doing it.
+ - In an 80 column terminal, some room needs to be left for > quoting
+   characters, +/- diff characters, and so on, in emails.
+ - Code and especially patches is much more readable if limited to a sane
+   line length.  Eighty is traditional.
+ - It is the libxenlight coding style.
+
+
+3. Naming
+
+C is a Spartan language, and so should your naming be.  Unlike Modula-2
+and Pascal programmers, C programmers do not use cute names like
+ThisVariableIsATemporaryCounter.  A C programmer would call that
+variable "tmp", which is much easier to write, and not the least more
+difficult to understand.
+
+HOWEVER, while mixed-case names are frowned upon, descriptive names for
+global variables are a must.  To call a global function "foo" is a
+shooting offense.
+
+GLOBAL variables (to be used only if you _really_ need them) need to
+have descriptive names, as do global functions.  If you have a function
+that counts the number of active users, you should call that
+"count_active_users()" or similar, you should _not_ call it "cntusr()".
+
+Encoding the type of a function into the name (so-called Hungarian
+notation) is brain damaged - the compiler knows the types anyway and can
+check those, and it only confuses the programmer.
+
+LOCAL variable names should be short, and to the point.  If you have
+some random integer loop counter, it should probably be called "i".
+Calling it "loop_counter" is non-productive, if there is no chance of it
+being mis-understood.  Similarly, "tmp" can be just about any type of
+variable that is used to hold a temporary value.
+
+Local variables used to store return values should have descriptive name
+like "rc" or "ret". Following the same reasoning the label used as exit
+path should be called "out".
+
+Function arguments which are used to return values to the caller
+should be suffixed `_r' or `_out'.
+
+Variables, type names and function names are
+lower_case_with_underscores.
+Type names and function names use the prefix libxl__ when internal to
+libxenlight and libxl_ when exported in libxl.h.
+Xl should avoid using libxl_ and libxl__ as prefix for its own function
+names.
+
+When wrapping standard library functions, use the prefix libxl_ to alert
+readers that they are seeing a wrapped version; otherwise avoid this prefix.
+
+Typedefs are used to eliminate the redundant 'struct' keyword.
+It is the libxenlight coding style.
+
+
+4. Statements
+
+Don't put multiple statements on a single line.
+Don't put multiple assignments on a single line either.
+Error code paths with an if statement and a goto or a return on the same
+line are allowed. Examples:
+
+    if (rc) goto out;
+    if (rc < 0) return;
+
+Libxenlight coding style is super simple.  Avoid tricky expressions.
+
+
+5. Block structure
+
+Every indented statement is braced, but blocks that contain just one
+statement may have the braces omitted.  To avoid confusion, either all
+the blocks in an if...else chain have braces, or none of them do.
+
+The opening brace is on the line that contains the control flow
+statement that introduces the new block; the closing brace is on the
+same line as the else keyword, or on a line by itself if there is no
+else keyword.  Examples:
+
+    if (a == 5) {
+        printf("a was 5.\n");
+    } else if (a == 6) {
+        printf("a was 6.\n");
+    } else {
+        printf("a was something else entirely.\n");
+    }
+
+    if (a == 5)
+        printf("a was 5.\n");
+
+An exception is the opening brace for a function; for reasons of tradition
+and clarity it comes on a line by itself:
+
+    void a_function(void)
+    {
+        do_something();
+    }
+
+Rationale: a consistent (except for functions...) bracing style reduces
+ambiguity and avoids needless churn when lines are added or removed.
+Furthermore, it is the libxenlight coding style.
+
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
new file mode 100644
index 0000000000..f58a3214e5
--- /dev/null
+++ b/tools/libs/light/Makefile
@@ -0,0 +1,277 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SRCS-y += osdeps.c
+SRCS-y += libxl_paths.c
+SRCS-y += libxl_bootloader.c
+SRCS-y += flexarray.c
+ifeq ($(CONFIG_LIBNL),y)
+SRCS-y += libxl_netbuffer.c
+else
+SRCS-y += libxl_nonetbuffer.c
+endif
+ifeq ($(CONFIG_X86),y)
+SRCS-y += libxl_convert_callout.c
+else
+SRCS-y += libxl_no_convert_callout.c
+endif
+SRCS-y += libxl_remus.c
+SRCS-y += libxl_checkpoint_device.c
+SRCS-y += libxl_remus_disk_drbd.c
+ifeq ($(CONFIG_LIBNL),y)
+SRCS-y += libxl_colo_restore.c
+SRCS-y += libxl_colo_save.c
+SRCS-y += libxl_colo_qdisk.c
+SRCS-y += libxl_colo_proxy.c
+SRCS-y += libxl_colo_nic.c
+else
+SRCS-y += libxl_no_colo.c
+endif
+
+ACPI_PATH  = $(XEN_ROOT)/tools/libacpi
+DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c
+ACPI_OBJS  = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o
+ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS))
+$(DSDT_FILES-y): acpi
+vpath build.c $(ACPI_PATH)/
+vpath static_tables.c $(ACPI_PATH)/
+
+.PHONY: acpi
+acpi:
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
+
+SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c)
+
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -I.
+
+SRCS-$(CONFIG_X86) += libxl_cpuid.c
+SRCS-$(CONFIG_X86) += libxl_x86.c
+SRCS-$(CONFIG_X86) += libxl_psr.c
+SRCS-$(CONFIG_X86) += libxl_x86_acpi.c
+SRCS-$(CONFIG_ARM) += libxl_nocpuid.c
+SRCS-$(CONFIG_ARM) += libxl_arm.c
+SRCS-$(CONFIG_ARM) += libxl_libfdt_compat.c
+ifeq ($(CONFIG_ARM_64),y)
+DSDT_FILES-y = dsdt_anycpu_arm.c
+SRCS-y += libxl_arm_acpi.c
+SRCS-y += $(DSDT_FILES-y)
+dsdt_anycpu_arm.c:
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
+else
+SRCS-$(CONFIG_ARM) += libxl_arm_no_acpi.c
+endif
+
+SRCS-OS-$(CONFIG_NetBSD) = libxl_netbsd.c
+SRCS-OS-$(CONFIG_Linux) = libxl_linux.c
+SRCS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.c
+ifeq ($(SRCS-OS-y),)
+$(error Your Operating System is not supported by libxenlight, \
+please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
+endif
+SRCS-y += $(SRCS-OS-y)
+
+SRCS-y += libxl.c
+SRCS-y += libxl_create.c
+SRCS-y += libxl_dm.c
+SRCS-y += libxl_pci.c
+SRCS-y += libxl_dom.c
+SRCS-y += libxl_exec.c
+SRCS-y += libxl_xshelp.c
+SRCS-y += libxl_device.c
+SRCS-y += libxl_internal.c
+SRCS-y += libxl_utils.c
+SRCS-y += libxl_uuid.c
+SRCS-y += libxl_json.c
+SRCS-y += libxl_aoutils.c
+SRCS-y += libxl_numa.c
+SRCS-y += libxl_vnuma.c
+SRCS-y += libxl_stream_read.c
+SRCS-y += libxl_stream_write.c
+SRCS-y += libxl_save_callout.c
+SRCS-y += _libxl_save_msgs_callout.c
+SRCS-y += libxl_qmp.c
+SRCS-y += libxl_event.c
+SRCS-y += libxl_fork.c
+SRCS-y += libxl_dom_suspend.c
+SRCS-y += libxl_dom_save.c
+SRCS-y += libxl_usb.c
+SRCS-y += libxl_vtpm.c
+SRCS-y += libxl_nic.c
+SRCS-y += libxl_disk.c
+SRCS-y += libxl_console.c
+SRCS-y += libxl_cpupool.c
+SRCS-y += libxl_mem.c
+SRCS-y += libxl_sched.c
+SRCS-y += libxl_tmem.c
+SRCS-y += libxl_9pfs.c
+SRCS-y += libxl_domain.c
+SRCS-y += libxl_vdispl.c
+SRCS-y += libxl_pvcalls.c
+SRCS-y += libxl_vsnd.c
+SRCS-y += libxl_vkb.c
+SRCS-y += libxl_genid.c
+SRCS-y += _libxl_types.c
+SRCS-y += libxl_flask.c
+SRCS-y += _libxl_types_internal.c
+
+ifeq ($(CONFIG_LIBNL),y)
+CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
+endif
+CFLAGS_LIBXL += -Wshadow
+ifeq ($(debug),y)
+CFLAGS_LIBXL += -DCONFIG_DEBUG
+endif
+
+CFLAGS += $(PTHREAD_CFLAGS)
+LDFLAGS += $(PTHREAD_LDFLAGS)
+
+LIBXL_TESTS += timedereg
+LIBXL_TESTS_PROGS = $(LIBXL_TESTS) fdderegrace
+LIBXL_TESTS_INSIDE = $(LIBXL_TESTS) fdevent
+
+# Each entry FOO in LIBXL_TESTS has two main .c files:
+#   libxl_test_FOO.c  "inside libxl" code to support the test case
+#   test_FOO.c        "outside libxl" code to exercise the test case
+# Conventionally there will also be:
+#   libxl_test_FOO.h  interface between the "inside" and "outside" parts
+# The "inside libxl" file is compiled exactly like a piece of libxl, and the
+# "outside libxl" file is compiled exactly like a piece of application
+# code.  They must share information via explicit libxl entrypoints.
+# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c
+# to use private global variables for its state.  Note that all the
+# "inside" parts are compiled into a single test library, so their
+# symbol names must be unique.
+#
+# To run these tests, either use LD_PRELOAD to get libxenlight_test.so
+# loaded, or rename it to libxenlight.so so it is the target of the
+# appropriate symlinks.
+
+LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic)
+TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o
+TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t)
+
+AUTOINCS = _libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
+AUTOSRCS = _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
+
+CLIENTS = testidl libxl-save-helper
+
+SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
+
+LIBHEADER := libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h
+
+NO_HEADERS_CHK := y
+
+include $(XEN_ROOT)/tools/libs/libs.mk
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
+LDUSELIBS-y += $(PTYFUNCS_LIBS)
+LDUSELIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS)
+LDUSELIBS-$(CONFIG_Linux) += -luuid
+LDUSELIBS-$(CONFIG_Linux) += -lrt
+LDUSELIBS-$(CONFIG_ARM) += -lfdt
+LDUSELIBS-y += $(PTHREAD_LIBS)
+LDUSELIBS-y += -lyajl
+LDUSELIBS += $(LDUSELIBS-y)
+
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
+$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
+$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
+libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools  # include libacpi/x86.h
+libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -I$(XEN_ROOT)/tools
+$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest)
+
+testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
+testidl.c: libxl_types.idl gentest.py include/libxl.h $(AUTOINCS)
+	$(PYTHON) gentest.py libxl_types.idl testidl.c.new
+	mv testidl.c.new testidl.c
+
+build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
+
+$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
+	$(PERL) $^
+	touch $@
+
+_%.api-for-check: include/%.h $(AUTOINCS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
+		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
+		>$@.new
+	mv -f $@.new $@
+
+_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
+	$(PERL) $^ --prefix=libxl >$@.new
+	$(call move-if-changed,$@.new,$@)
+
+_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \
+_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \
+		libxl_save_msgs_gen.pl
+	$(PERL) -w $< $@ >$@.new
+	$(call move-if-changed,$@.new,$@)
+
+include/libxl.h: _libxl_types.h _libxl_list.h
+include/libxl_json.h: _libxl_types_json.h
+libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h
+libxl_internal_json.h: _libxl_types_internal_json.h
+xl.h: _paths.h
+
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): include/libxl.h
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
+
+_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
+	$(eval stem = $(notdir $*))
+	$(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \
+		__libxl_type$(stem)_json.h  __libxl_type$(stem).c
+	$(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h)
+	$(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h)
+	$(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h)
+	$(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c)
+
+include/_%.h: _%.h
+	cp $< $@
+
+libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS)
+
+test_%: test_%.o test_common.o libxenlight_test.so
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
+
+libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
+	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
+
+testidl: testidl.o libxenlight.so
+	$(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
+
+install: installlocal $(LIBHEADERS)
+
+.PHONY: installlocal
+installlocal: libxl-save-helper
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
+
+uninstall: uninstalllocal
+
+.PHONY: uninstalllocal
+uninstalllocal:
+	rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
+
+clean: cleanlocal
+
+.PHONY: cleanlocal
+cleanlocal:
+	$(RM) -f _*.h *.o $(CLIENTS)
+	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
+	$(RM) -f testidl.c.new testidl.c *.api-ok
+	$(RM) -f $(TEST_PROGS)
+	$(RM) -rf __pycache__
+	$(RM) -f include/_*.h
+	$(RM) -f libxenlight.map
+	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean
diff --git a/tools/libs/light/check-libxl-api-rules b/tools/libs/light/check-libxl-api-rules
new file mode 100755
index 0000000000..18ff39ca5f
--- /dev/null
+++ b/tools/libs/light/check-libxl-api-rules
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+use strict;
+our $needed=0;
+our $speclineoffset=0;
+our $specfile;
+while (<>) {
+    if (m/^\# (\d+) \"(.*)\"$/) {
+        $speclineoffset = $1 - $. -1;
+        $specfile = $2;
+    }
+    my $file = defined($specfile) ? $specfile : $ARGV;
+    my $line = $speclineoffset + $.;
+    if (m/libxl_asyncop_how[^;]/) {
+        $needed=1;
+    }
+    if (m/LIBXL_EXTERNAL_CALLERS_ONLY/) {
+        $needed=0;
+    }
+    next unless $needed;
+    if (m/\;/) {
+        die "$file:$line:missing LIBXL_EXTERNAL_CALLERS_ONLY";
+    }
+}
diff --git a/tools/libs/light/flexarray.c b/tools/libs/light/flexarray.c
new file mode 100644
index 0000000000..fe40e762e4
--- /dev/null
+++ b/tools/libs/light/flexarray.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_internal.h"
+#include <stdarg.h>
+
+/*
+ * It is safe to store gc in the struct because:
+ * - If it an actual gc, then the flexarray should not be used after the gc
+ *   have been freed.
+ * - If it is a NOGC, then this point to a structure embedded in libxl_ctx,
+ *   therefore will survive across several libxl calls.
+ */
+
+flexarray_t *flexarray_make(libxl__gc *gc, int size, int autogrow)
+{
+    flexarray_t *array;
+
+    GCNEW(array);
+    array->size = size;
+    array->autogrow = autogrow;
+    array->count = 0;
+    array->gc = gc;
+    GCNEW_ARRAY(array->data, size);
+
+    return array;
+}
+
+void flexarray_free(flexarray_t *array)
+{
+    assert(!libxl__gc_is_real(array->gc));
+    free(array->data);
+    free(array);
+}
+
+void flexarray_grow(flexarray_t *array, int extents)
+{
+    int newsize;
+    libxl__gc *gc = array->gc;
+
+    newsize = array->size + extents;
+    GCREALLOC_ARRAY(array->data, newsize);
+    array->size += extents;
+}
+
+int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
+{
+    if (idx >= array->size) {
+        int newsize;
+        if (!array->autogrow)
+            return 1;
+        newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
+        flexarray_grow(array, newsize - array->size);
+    }
+    if ( idx + 1 > array->count )
+        array->count = idx + 1;
+    array->data[idx] = ptr;
+    return 0;
+}
+
+int flexarray_append(flexarray_t *array, void *ptr)
+{
+    return flexarray_set(array, array->count, ptr);
+}
+
+int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2)
+{
+    int rc = flexarray_append(array, ptr1);
+    if (!rc)
+        rc = flexarray_append(array, ptr2);
+    return rc;
+}
+
+int flexarray_vappend(flexarray_t *array, ...)
+{
+    va_list va;
+    void *ptr;
+    int ret;
+
+    va_start(va, array);
+    for(ret = 0; (ptr = va_arg(va, void *)); ret++) {
+        if ( flexarray_append(array, ptr) )
+            break;
+    }
+    va_end(va);
+    return ret;
+}
+
+int flexarray_get(flexarray_t *array, int idx, void **ptr)
+{
+    if (idx >= array->size)
+        return 1;
+    *ptr = array->data[idx];
+    return 0;
+}
+
+void **flexarray_contents(flexarray_t *array)
+{
+    void **data;
+    data = array->data;
+    if (!libxl__gc_is_real(array->gc))
+        free(array);
+    return data;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/light/flexarray.h b/tools/libs/light/flexarray.h
new file mode 100644
index 0000000000..a1e86475c4
--- /dev/null
+++ b/tools/libs/light/flexarray.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef FLEXARRAY_H
+#define FLEXARRAY_H
+
+struct libxl__gc;
+
+typedef struct flexarray {
+    int size;
+    int autogrow;
+    unsigned int count;
+    void **data; /* array of pointer */
+    struct libxl__gc *gc;
+} flexarray_t;
+
+/*
+ * NOGC can be used with flexarrays, but flexarray_free will need to be called
+ * to free the struct. The content of the flexarray will not be freed through
+ * flexarray_free.
+ */
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc_opt,
+                                    int size, int autogrow);
+_hidden void flexarray_free(flexarray_t *array);
+_hidden void flexarray_grow(flexarray_t *array, int extents);
+_hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
+_hidden int flexarray_append(flexarray_t *array, void *ptr);
+_hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2);
+_hidden int flexarray_vappend(flexarray_t *array, ...);
+_hidden int flexarray_get(flexarray_t *array, int index, void **ptr);
+
+_hidden void **flexarray_contents(flexarray_t *array);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/light/gentest.py b/tools/libs/light/gentest.py
new file mode 100644
index 0000000000..1cc7eebc82
--- /dev/null
+++ b/tools/libs/light/gentest.py
@@ -0,0 +1,374 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+
+import os
+import sys
+import re
+import random
+
+import idl
+
+def randomize_char(c):
+    if random.random() < 0.5:
+        return str.lower(c)
+    else:
+        return str.upper(c)
+
+def randomize_case(s):
+    r = [randomize_char(c) for c in s]
+    return "".join(r)
+
+def randomize_enum(e):
+    return random.choice([v.name for v in e.values])
+
+handcoded = ["libxl_bitmap", "libxl_key_value_list",
+             "libxl_cpuid_policy_list", "libxl_string_list"]
+
+def gen_rand_init(ty, v, indent = "    ", parent = None):
+    s = ""
+    if isinstance(ty, idl.Enumeration):
+        s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), randomize_enum(ty))
+    elif isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "%s = test_rand(8);\n" % (parent + ty.lenvar.name)
+        s += "%s = calloc(%s, sizeof(*%s));\n" % \
+            (v, parent + ty.lenvar.name, v)
+        s += "assert(%s);\n" % (v, )
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    for (i=0; i<%s; i++)\n" % (parent + ty.lenvar.name)
+        s += gen_rand_init(ty.elem_type, v+"[i]",
+                           indent + "        ", parent)
+        s += "}\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += gen_rand_init(ty.keyvar.type, parent + ty.keyvar.name, indent, parent)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) \
+     and (parent is None or ty.json_gen_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += gen_rand_init(f.type, fexpr, "", nparent)
+    elif hasattr(ty, "rand_init") and ty.rand_init is not None:
+        s += "%s(%s);\n" % (ty.rand_init,
+                            ty.pass_arg(v, isref=parent is None,
+                                        passby=idl.PASS_BY_REFERENCE))
+    elif ty.typename in ["libxl_uuid", "libxl_mac", "libxl_hwcap", "libxl_ms_vm_genid"]:
+        s += "rand_bytes((uint8_t *)%s, sizeof(*%s));\n" % (v,v)
+    elif ty.typename in ["libxl_domid", "libxl_devid"] or isinstance(ty, idl.Number):
+        s += "%s = test_rand(sizeof(%s) * 8);\n" % \
+             (ty.pass_arg(v, parent is None),
+              ty.pass_arg(v, parent is None))
+    elif ty.typename in ["bool"]:
+        s += "%s = test_rand(2);\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, test_rand(2));\n" % v
+    elif ty.typename in ["char *"]:
+        s += "%s = rand_str();\n" % v
+    elif ty.private:
+        pass
+    elif ty.typename in handcoded:
+        raise Exception("Gen for handcoded %s" % ty.typename)
+    else:
+        raise Exception("Cannot randomly init %s" % ty.typename)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+if __name__ == '__main__':
+    if len(sys.argv) < 3:
+        print("Usage: gentest.py <idl> <implementation>", file=sys.stderr)
+        sys.exit(1)
+
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
+
+    (builtins,types) = idl.parse(sys.argv[1])
+
+    impl = sys.argv[2]
+    f = open(impl, "w")
+    f.write("""
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "libxl.h"
+#include "libxl_utils.h"
+
+static int test_rand(unsigned max)
+{
+    /* We are not using rand() for its cryptographic properies. */
+    return rand() % max;
+}
+
+static char *rand_str(void)
+{
+    int i, sz = test_rand(32);
+    char *s = malloc(sz+1);
+    assert(s);
+    for (i=0; i<sz; i++)
+        s[i] = 'a' + test_rand(26);
+    s[i] = '\\0';
+    return s;
+}
+
+static void rand_bytes(uint8_t *p, size_t sz)
+{
+    int i;
+    for (i=0; i<sz; i++)
+        p[i] = test_rand(256);
+}
+
+static void libxl_bitmap_rand_init(libxl_bitmap *bitmap)
+{
+    int i;
+    bitmap->size = test_rand(16);
+    bitmap->map = calloc(bitmap->size, sizeof(*bitmap->map));
+    assert(bitmap->map);
+    libxl_for_each_bit(i, *bitmap) {
+        if (test_rand(2))
+            libxl_bitmap_set(bitmap, i);
+        else
+            libxl_bitmap_reset(bitmap, i);
+    }
+}
+
+static void libxl_key_value_list_rand_init(libxl_key_value_list *pkvl)
+{
+    int i, nr_kvp = test_rand(16);
+    libxl_key_value_list kvl = calloc(nr_kvp+1, 2*sizeof(char *));
+    assert(kvl);
+
+    for (i = 0; i<2*nr_kvp; i += 2) {
+        kvl[i] = rand_str();
+        if (test_rand(8))
+            kvl[i+1] = rand_str();
+        else
+            kvl[i+1] = NULL;
+    }
+    kvl[i] = NULL;
+    kvl[i+1] = NULL;
+    *pkvl = kvl;
+}
+
+static void libxl_cpuid_policy_list_rand_init(libxl_cpuid_policy_list *pp)
+{
+    int i, nr_policies = test_rand(16);
+    struct {
+        const char *n;
+        int w;
+    } options[] = {
+      /* A random selection from libxl_cpuid_parse_config */
+        {"maxleaf",     32},
+        {"family",       8},
+        {"model",        8},
+        {"stepping",     4},
+        {"localapicid",  8},
+        {"proccount",    8},
+        {"clflush",      8},
+        {"brandid",      8},
+        {"f16c",         1},
+        {"avx",          1},
+        {"osxsave",      1},
+        {"xsave",        1},
+        {"aes",          1},
+        {"popcnt",       1},
+        {"movbe",        1},
+        {"x2apic",       1},
+        {"sse4.2",       1},
+        {"sse4.1",       1},
+        {"dca",          1},
+        {"pdcm",         1},
+        {"procpkg",      6},
+    };
+    const int nr_options = sizeof(options)/sizeof(options[0]);
+    char buf[64];
+    libxl_cpuid_policy_list p = NULL;
+
+    for (i = 0; i < nr_policies; i++) {
+        int opt = test_rand(nr_options);
+        int val = test_rand(1<<options[opt].w);
+        snprintf(buf, 64, \"%s=%#x\", options[opt].n, val);
+        libxl_cpuid_parse_config(&p, buf);
+    }
+    *pp = p;
+}
+
+static void libxl_string_list_rand_init(libxl_string_list *p)
+{
+    int i, nr = test_rand(16);
+    libxl_string_list l = calloc(nr+1, sizeof(char *));
+    assert(l);
+
+    for (i = 0; i<nr; i++) {
+        l[i] = rand_str();
+    }
+    l[i] = NULL;
+    *p = l;
+}
+""")
+    for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
+        if ty.typename not in handcoded:
+            f.write("static void %s_rand_init(%s);\n" % \
+                    (ty.typename,
+                     ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("static void %s_rand_init(%s)\n" % \
+                    (ty.typename,
+                     ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(gen_rand_init(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
+        ty.rand_init = "%s_rand_init" % ty.typename
+
+    f.write("""
+int main(int argc, char **argv)
+{
+""")
+
+    for ty in types:
+        f.write("    %s %s_val, %s_val_new;\n" % \
+                (ty.typename, ty.typename, ty.typename))
+    f.write("""
+    int rc;
+    char *s, *new_s, *json_string;
+    xentoollog_logger_stdiostream *logger;
+    libxl_ctx *ctx;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_DETAIL, 0);
+    if (!logger) exit(1);
+
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (xentoollog_logger*)logger)) {
+        fprintf(stderr, "cannot init xl context\\n");
+        exit(1);
+    }
+""")
+    f.write("    printf(\"Testing TYPE_to/from_json()\\n\");\n")
+    f.write("    printf(\"----------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if t.json_gen_fn is not None]:
+        arg = ty.typename + "_val"
+        f.write("    %s_rand_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        if not isinstance(ty, idl.Enumeration):
+            iters = random.randrange(1,10)
+            while iters > 0:
+                f.write("    %s_init(%s_new);\n" % (ty.typename, \
+                    ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+                iters -= 1
+        f.write("    s = %s_to_json(ctx, %s);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    printf(\"%%s: %%s\\n\", \"%s\", s);\n" % ty.typename)
+        f.write("    if (s == NULL) abort();\n")
+        f.write("    rc = %s_from_json(ctx, &%s_val_new, s);\n" % \
+                (ty.typename, ty.typename))
+        f.write("    if (rc) abort();\n")
+        f.write("    new_s = %s_to_json(ctx, %s_new);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (new_s == NULL) abort();\n")
+        f.write("    if (strcmp(s, new_s)) {\n")
+        f.write("        printf(\"Huh? Regenerated string different from original string.\\n\");\n")
+        f.write("        printf(\"Regenerated string: %s\\n\", new_s);\n")
+        f.write("        abort();\n")
+        f.write("    }\n")
+        f.write("    free(s);\n")
+        f.write("    free(new_s);\n")
+        if ty.dispose_fn is not None:
+            iters = random.randrange(1,10)
+            f.write("    %s(&%s_val);\n" % (ty.dispose_fn, ty.typename))
+            while iters > 0:
+                f.write("    %s(&%s_val_new);\n" % (ty.dispose_fn, ty.typename))
+                iters -= 1
+        f.write("\n")
+
+    f.write("    printf(\"Testing TYPE_copy()\\n\");\n")
+    f.write("    printf(\"----------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if t.copy_fn is not None]:
+        f.write("    printf(\"Testing %s_copy, \");\n" % ty.typename)
+        arg = ty.typename + "_val"
+        f.write("    %s_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_rand_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_init(%s_new);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_copy(ctx, %s_new, %s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE), \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    s = %s_to_json(ctx, %s);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (s == NULL) abort();\n")
+        f.write("    new_s = %s_to_json(ctx, %s_new);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (new_s == NULL) abort();\n")
+        f.write("    if (strcmp(s, new_s)) {\n")
+        f.write("        printf(\"Huh? Deep copy for %s failed. Regenerated string different from original string.\\n\");\n" \
+                % ty.typename)
+        f.write("        printf(\"Original string: %s\\n\", s);\n")
+        f.write("        printf(\"Regenerated string: %s\\n\", new_s);\n")
+        f.write("        abort();\n")
+        f.write("    }\n")
+        f.write("    free(s);\n")
+        f.write("    free(new_s);\n")
+        if ty.dispose_fn is not None:
+            f.write("    %s(&%s_val);\n" % (ty.dispose_fn, ty.typename))
+            f.write("    %s(&%s_val_new);\n" % (ty.dispose_fn, ty.typename))
+        f.write("    printf(\"done\\n\");\n")
+        f.write("\n")
+
+    f.write("    printf(\"\\n\");\n")
+    f.write("    printf(\"Testing Enumerations\\n\");\n")
+    f.write("    printf(\"--------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
+        f.write("    printf(\"%s -- to string:\\n\");\n" % (ty.typename))
+        for v in ty.values:
+            f.write("    printf(\"\\t%s = %%d = \\\"%%s\\\"\\n\", " \
+                    "%s, %s_to_string(%s));\n" % \
+                    (v.valuename, v.name, ty.typename, v.name))
+        f.write("\n")
+
+        f.write("    printf(\"%s -- to JSON:\\n\");\n" % (ty.typename))
+        for v in ty.values:
+            f.write("    json_string = %s_to_json(ctx, %s);\n" % \
+                    (ty.typename, v.name))
+            f.write("    printf(\"\\t%s = %%d = %%s\", " \
+                    "%s, json_string);\n" %\
+                    (v.valuename, v.name))
+            f.write("    free(json_string);\n");
+            f.write("    json_string = NULL;\n");
+        f.write("\n")
+
+        f.write("    printf(\"%s -- from string:\\n\");\n" % (ty.typename))
+        for v in [v.valuename for v in ty.values] + ["AN INVALID VALUE"]:
+            n = randomize_case(v)
+            f.write("    %s_val = -1;\n" % (ty.typename))
+            f.write("    rc = %s_from_string(\"%s\", &%s_val);\n" %\
+                    (ty.typename, n, ty.typename))
+
+            f.write("    printf(\"\\t%s = \\\"%%s\\\" = %%d (rc %%d)\\n\", " \
+                    "\"%s\", %s_val, rc);\n" %\
+                    (v, n, ty.typename))
+        f.write("\n")
+
+    f.write("""
+
+    libxl_ctx_free(ctx);
+    xtl_logger_destroy((xentoollog_logger*)logger);
+
+    return 0;
+}
+""")
diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
new file mode 100644
index 0000000000..9a45e45acc
--- /dev/null
+++ b/tools/libs/light/gentypes.py
@@ -0,0 +1,797 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+
+import sys
+import re
+
+import idl
+
+def libxl_C_instance_of(ty, instancename):
+    if isinstance(ty, idl.Aggregate) and ty.typename is None:
+        if instancename is None:
+            return libxl_C_type_define(ty)
+        else:
+            return libxl_C_type_define(ty) + " " + instancename
+
+    s = ""
+    if isinstance(ty, idl.Array):
+        s += libxl_C_instance_of(ty.lenvar.type, ty.lenvar.name) + ";\n"
+
+    return s + ty.typename + " " + instancename
+
+def libxl_C_type_define(ty, indent = ""):
+    s = ""
+    if isinstance(ty, idl.Enumeration):
+        if ty.typename is None:
+            s += "enum {\n"
+        else:
+            s += "typedef enum %s {\n" % ty.typename
+
+        for v in ty.values:
+            x = "%s = %d" % (v.name, v.value)
+            x = x.replace("\n", "\n    ")
+            s += "    " + x + ",\n"
+        if ty.typename is None:
+            s += "}"
+        else:
+            s += "} %s" % ty.typename
+
+    elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
+        if ty.typename is None:
+            s += "%s {\n" % ty.kind
+        else:
+            s += "typedef %s %s {\n" % (ty.kind, ty.typename)
+
+        for f in ty.fields:
+            if isinstance(ty, idl.KeyedUnion) and f.type is None: continue
+            
+            x = libxl_C_instance_of(f.type, f.name)
+            if f.const:
+                x = "const " + x
+            x = x.replace("\n", "\n    ")
+            s += "    " + x + ";\n"
+        if ty.typename is None:
+            s += "}"
+        else:
+            s += "} %s" % ty.typename
+    else:
+        raise NotImplementedError("%s" % type(ty))
+    return s.replace("\n", "\n%s" % indent)
+
+def libxl_C_type_dispose(ty, v, indent = "    ", parent = None):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        if ty.elem_type.dispose_fn is not None:
+            s += "{\n"
+            s += "    int i;\n"
+            s += "    for (i=0; i<%s; i++)\n" % (parent + ty.lenvar.name)
+            s += libxl_C_type_dispose(ty.elem_type, v+"[i]",
+                                      indent + "        ", parent)
+        if ty.dispose_fn is not None:
+            if ty.elem_type.dispose_fn is not None:
+                s += "    "
+            s += "%s(%s);\n" % (ty.dispose_fn, ty.pass_arg(v, parent is None))
+        if ty.elem_type.dispose_fn is not None:
+            s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.dispose_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += libxl_C_type_dispose(f.type, fexpr, "", nparent)
+    else:
+        if ty.dispose_fn is not None:
+            s += "%s(%s);\n" % (ty.dispose_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_copy(ty, v, w, indent = "    ", vparent = None, wparent = None):
+    s = ""
+
+    if vparent is None:
+        s += "GC_INIT(ctx);\n";
+
+    if isinstance(ty, idl.KeyedUnion):
+        if vparent is None or wparent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "%s = %s;\n" % ((vparent + ty.keyvar.name), (wparent + ty.keyvar.name))
+        s += "switch (%s) {\n" % (wparent + ty.keyvar.name)
+        for f in ty.fields:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            (wnparent,wfexpr) = ty.member(w, f, wparent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_copy(f.type, vfexpr, wfexpr, indent + "    ",
+                                       vnparent, wnparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Array):
+        if vparent is None or wparent is None:
+            raise Exception("Array type must have a parent")
+        s += "%s = libxl__calloc(NOGC, %s, sizeof(*%s));\n" % (ty.pass_arg(v, vparent is None),
+                                                               (wparent + ty.lenvar.name),
+                                                               ty.pass_arg(w, wparent is None))
+        s += "%s = %s;\n" % ((vparent + ty.lenvar.name), (wparent + ty.lenvar.name))
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    for (i=0; i<%s; i++)\n" % (wparent + ty.lenvar.name)
+        s += libxl_C_type_copy(ty.elem_type, v+"[i]", w+"[i]",
+                               indent + "        ", vparent, wparent)
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and ((vparent is None and wparent is None) or ty.copy_fn is None):
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            (wnparent,wfexpr) = ty.member(w, f, wparent is None)
+            s += libxl_C_type_copy(f.type, vfexpr, wfexpr, "", vnparent, wnparent)
+    else:
+        if ty.copy_fn is not None:
+            s += "%s(ctx, %s, %s);\n" % (ty.copy_fn,
+                                         ty.pass_arg(v, vparent is None, passby=idl.PASS_BY_REFERENCE),
+                                         ty.pass_arg(w, wparent is None, passby=idl.PASS_BY_REFERENCE))
+
+        else:
+            s += "%s = %s;\n" % (ty.pass_arg(v, vparent is None, passby=idl.PASS_BY_VALUE),
+                                 ty.pass_arg(w, wparent is None, passby=idl.PASS_BY_VALUE))
+
+    if vparent is None:
+        s += "GC_FREE;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def libxl_C_type_do_init(ty, pass_arg, need_zero=True, indent="    "):
+    s=indent
+    if ty.init_val is not None:
+        s+= "%s = %s;\n" % (pass_arg(idl.PASS_BY_VALUE), ty.init_val)
+    elif ty.init_fn is not None:
+        s+= "%s(%s);\n" % (ty.init_fn, pass_arg(idl.PASS_BY_REFERENCE))
+    elif need_zero:
+        ptr = pass_arg(idl.PASS_BY_REFERENCE)
+        s+= "memset(%s, 0, sizeof(*%s));\n" % (ptr, ptr)
+    else:
+        s=""
+    return s
+
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                if f.type is not None:
+                    s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val is not None:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val is not None:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+    if init_val is not None:
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+    else:
+        s += "    assert(!%s);\n" % (fexpr)
+    s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_gen_map_key(f, parent, indent = ""):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (v, v)
+            s += "    if (s != yajl_gen_status_ok)\n"
+            s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_copy_deprecated(field, v, indent = "    ", vparent = None):
+    s = ""
+
+    if isinstance(field.type, idl.KeyedUnion):
+        if vparent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (vparent + field.type.keyvar.name)
+        for f in [f for f in field.type.fields if not f.const]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_copy_deprecated(f, vfexpr, indent, vnparent)
+            s+= "    break;\n"
+        s+="}\n";
+    elif isinstance(field.type, idl.Array) and field.deprecated_by:
+        raise Exception("Array type is not supported for deprecation")
+    elif isinstance(field.type, idl.Struct) and field.type.copy_fn is None:
+        for f in [f for f in field.type.fields if not f.const]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            s += libxl_C_type_copy_deprecated(f, vfexpr, "", vnparent)
+    elif field.deprecated_by is not None:
+        if field.type.check_default_fn is None:
+            raise Exception(
+"Deprecated field %s type doesn't have a default value checker" % field.name)
+        field_pass = lambda by: field.type.pass_arg(v, vparent is None,
+                                                    passby=by)
+        field_val = field_pass(idl.PASS_BY_VALUE)
+        field_ptr = field_pass(idl.PASS_BY_REFERENCE)
+        s+= "if (!%s(&p->%s) && !%s(%s))\n" % (field.type.check_default_fn,
+                                               field.deprecated_by,
+                                               field.type.check_default_fn,
+                                               field_ptr)
+        s+= "    return -EINVAL;\n"
+        s+="(void) (&p->%s == %s);\n" % (field.deprecated_by, field_ptr)
+        s+= "if (%s(&p->%s)) {\n" % (field.type.check_default_fn,
+                                     field.deprecated_by)
+        s+= "    "
+        if field.type.copy_fn is not None:
+            s+= "%s(ctx, &p->%s, %s);\n" % (field.type.copy_fn,
+                                            field.deprecated_by, field_ptr)
+        else:
+            s+= "p->%s = %s;\n" % (field.deprecated_by, field_val)
+
+        if field.type.dispose_fn is not None:
+            s+= "    %s(%s);\n" % (field.type.dispose_fn,
+                                   field.type.pass_arg(v, vparent is None))
+        s+=libxl_C_type_do_init(field.type, field_pass)
+        s+= "}\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def get_init_val(f):
+    if f.init_val is not None:
+        return f.init_val
+    elif f.type.init_val is not None:
+        return f.type.init_val
+    return None
+
+def get_default_expr(f, nparent, fexpr):
+    if isinstance(f.type, idl.Aggregate):
+        return "1 /* always generate JSON output for aggregate type */"
+
+    if isinstance(f.type, idl.Array):
+        return "%s && %s" % (fexpr, nparent + f.type.lenvar.name)
+
+    init_val = get_init_val(f)
+    if init_val is not None:
+        return "%s != %s" % (fexpr, init_val)
+
+    if f.type.check_default_fn:
+        return "!%s(&%s)" % (f.type.check_default_fn, fexpr)
+
+    return "%s" % fexpr
+
+def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
+    s = ""
+    if parent is None:
+        s += "yajl_gen_status s;\n"
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    s = yajl_gen_array_open(hand);\n"
+        s += "    if (s != yajl_gen_status_ok)\n"
+        s += "        goto out;\n"
+        s += "    for (i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += libxl_C_type_gen_json(ty.elem_type, v+"[i]",
+                                   indent + "        ", parent)
+        s += "    }\n"
+        s += "    s = yajl_gen_array_close(hand);\n"
+        s += "    if (s != yajl_gen_status_ok)\n"
+        s += "        goto out;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        s += "s = libxl__yajl_gen_enum(hand, %s_to_string(%s));\n" % (ty.typename, ty.pass_arg(v, parent is None))
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
+            else:
+                s += "    s = yajl_gen_map_open(hand);\n"
+                s += "    if (s != yajl_gen_status_ok)\n"
+                s += "        goto out;\n"
+                s += "    s = yajl_gen_map_close(hand);\n"
+                s += "    if (s != yajl_gen_status_ok)\n"
+                s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
+        s += "s = yajl_gen_map_open(hand);\n"
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            default_expr = get_default_expr(f, nparent, fexpr)
+            s += "if (%s) {\n" % default_expr
+
+            s += libxl_C_type_gen_map_key(f, nparent, "    ")
+            s += libxl_C_type_gen_json(f.type, fexpr, "    ", nparent)
+
+            s += "}\n"
+
+        s += "s = yajl_gen_map_close(hand);\n"
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    else:
+        if ty.json_gen_fn is not None:
+            s += "s = %s(hand, %s);\n" % (ty.json_gen_fn, ty.pass_arg(v, parent is None))
+            s += "if (s != yajl_gen_status_ok)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "out:\n"
+        s += "return s;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_to_json(ty, v, indent = "    "):
+    s = ""
+    gen = "(libxl__gen_json_callback)&%s_gen_json" % ty.typename
+    s += "return libxl__object_to_json(ctx, \"%s\", %s, (void *)%s);\n" % (ty.typename, gen, ty.pass_arg(v, passby=idl.PASS_BY_REFERENCE))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_parse_json(ty, w, v, indent = "    ", parent = None, discriminator = None):
+    s = ""
+    if parent is None:
+        s += "int rc = 0;\n"
+        s += "const libxl__json_object *x __attribute__((__unused__)) = o;\n"
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        lenvar = parent + ty.lenvar.name
+        s += "{\n"
+        s += "    libxl__json_object *t;\n"
+        s += "    int i;\n"
+        s += "    if (!libxl__json_object_is_array(x)) {\n"
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    %s = x->u.array->count;\n" % lenvar
+        s += "    %s = libxl__calloc(NOGC, %s, sizeof(*%s));\n" % (v, lenvar, v)
+        s += "    if (!%s && %s != 0) {\n" % (v, lenvar)
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    for (i=0; (t=libxl__json_array_get(x,i)); i++) {\n"
+        s += libxl_C_type_do_init(ty.elem_type,
+                    lambda by: ("&" if by == idl.PASS_BY_REFERENCE else "")+
+                               ("%s[i]" % v),
+                                  need_zero=False, indent=indent+"    ")
+        s += libxl_C_type_parse_json(ty.elem_type, "t", v+"[i]",
+                                     indent + "    ", parent)
+        s += "    }\n"
+        s += "    if (i != %s) {\n" % lenvar
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        s += "{\n"
+        s += "    const char *enum_str;\n"
+        s += "    if (!libxl__json_object_is_string(%s)) {\n" % w
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    enum_str = libxl__json_object_get_string(%s);\n" % w
+        s += "    rc = %s_from_string(enum_str, %s);\n" % (ty.typename, ty.pass_arg(v, parent is None, idl.PASS_BY_REFERENCE))
+        s += "    if (rc)\n"
+        s += "        goto out;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if discriminator is None:
+            raise Excpetion("KeyedUnion type must have a discriminator")
+        for f in ty.fields:
+            if f.enumname != discriminator:
+                continue
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.type is not None:
+                s += libxl_C_type_parse_json(f.type, w, fexpr, indent + "    ", nparent)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_parse_fn is None):
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            saved_var_name = "saved_%s" % f.name
+            s += "{\n"
+            s += "    const libxl__json_object *%s = x;\n" % saved_var_name
+            if isinstance(f.type, idl.KeyedUnion):
+                for x in f.type.fields:
+                    s += "    x = libxl__json_map_get(\"%s\", %s, JSON_MAP);\n" % \
+                         (f.type.keyvar.name + "." + x.name, w)
+                    s += "    if (x) {\n"
+                    (nparent, fexpr) = ty.member(v, f.type.keyvar, parent is None)
+                    s += "        %s_init_%s(%s, %s);\n" % (ty.typename, f.type.keyvar.name, v, x.enumname)
+                    (nparent,fexpr) = ty.member(v, f, parent is None)
+                    s += libxl_C_type_parse_json(f.type, "x", fexpr, "  ", nparent, x.enumname)
+                    s += "    }\n"
+            else:
+                s += "    x = libxl__json_map_get(\"%s\", %s, %s);\n" % (f.name, w, f.type.json_parse_type)
+                s += "    if (x) {\n"
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += libxl_C_type_parse_json(f.type, "x", fexpr, "        ", nparent)
+                s += "    }\n"
+            s += "    x = %s;\n" % saved_var_name
+            s += "}\n"
+    else:
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        if ty.json_parse_fn is not None:
+            s += "rc = %s(gc, %s, &%s);\n" % (ty.json_parse_fn, w, v)
+            s += "if (rc)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "out:\n"
+        s += "return rc;\n"
+
+    if s != "":
+        s = indent +s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_from_json(ty, v, w, indent = "    "):
+    s = ""
+    parse = "(libxl__json_parse_callback)&%s_parse_json" % (ty.namespace + "_" + ty.rawname)
+    s += "return libxl__object_from_json(ctx, \"%s\", %s, %s, %s);\n" % (ty.typename, parse, v, w)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_to_string(ty, e, indent = "    "):
+    s = ""
+    s += "switch(%s) {\n" % e
+    for v in ty.values:
+        s += "    case %s:\n" % (v.name)
+        s += "        return \"%s\";\n" % (v.valuename.lower())
+    s += "    default:\n "
+    s += "        return NULL;\n"
+    s += "}\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_strings(ty, indent=""):
+    s = ""
+    s += "libxl_enum_string_table %s_string_table[] = {\n" % (ty.typename)
+    for v in ty.values:
+        s += "    { .s = \"%s\", .v = %s },\n" % (v.valuename.lower(), v.name)
+    s += "    { NULL, -1 },\n"
+    s += "};\n"
+    s += "\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_from_string(ty, str, e, indent = "    "):
+    s = ""
+    s += "return libxl__enum_from_string(%s_string_table,\n" % ty.typename
+    s += "                               %s, (int *)%s);\n" % (str, e)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+
+if __name__ == '__main__':
+    if len(sys.argv) != 6:
+        print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
+        sys.exit(1)
+
+    (_, idlname, header, header_private, header_json, impl) = sys.argv
+
+    (builtins,types) = idl.parse(idlname)
+
+    print("outputting libxl type definitions to %s" % header)
+
+    f = open(header, "w")
+
+    header_define = header.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_define, header_define, " ".join(sys.argv)))
+
+    for ty in types:
+        f.write(libxl_C_type_define(ty) + ";\n")
+        if ty.dispose_fn is not None:
+            f.write("%svoid %s(%s);\n" % (ty.hidden(), ty.dispose_fn, ty.make_arg("p")))
+        if ty.copy_deprecated_fn is not None:
+            f.write("%sint %s(libxl_ctx *ctx, %s);\n" % (ty.hidden(),
+                                                         ty.copy_deprecated_fn,
+                                                         ty.make_arg("p")))
+        if ty.copy_fn is not None:
+            f.write("%svoid %s(libxl_ctx *ctx, %s, const %s);\n" % (ty.hidden(), ty.copy_fn,
+                                              ty.make_arg("dst"), ty.make_arg("src")))
+        if ty.init_fn is not None:
+            f.write("%svoid %s(%s);\n" % (ty.hidden(), ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("%svoid %s(%s, %s);\n" % (ty.hidden(), ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
+        if ty.json_gen_fn is not None:
+            f.write("%schar *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
+        if ty.json_parse_fn is not None:
+            f.write("%sint %s_from_json(libxl_ctx *ctx, %s, const char *s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        if isinstance(ty, idl.Enumeration):
+            f.write("%sconst char *%s_to_string(%s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
+            f.write("%sint %s_from_string(const char *s, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("e", passby=idl.PASS_BY_REFERENCE)))
+            f.write("%sextern libxl_enum_string_table %s_string_table[];\n" % (ty.hidden(), ty.typename))
+        f.write("\n")
+
+    f.write("""#endif /* %s */\n""" % (header_define))
+    f.close()
+
+    print("outputting libxl JSON definitions to %s" % header_json)
+
+    f = open(header_json, "w")
+
+    header_json_define = header_json.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_json_define, header_json_define, " ".join(sys.argv)))
+
+    for ty in [ty for ty in types if ty.json_gen_fn is not None]:
+        f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+
+    f.write("\n")
+    f.write("""#endif /* %s */\n""" % header_json_define)
+    f.close()
+
+    print("outputting libxl type internal definitions to %s" % header_private)
+
+    f = open(header_private, "w")
+
+    header_private_define = header_private.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_private_define, header_private_define, " ".join(sys.argv)))
+
+    for ty in [ty for ty in types if ty.json_parse_fn is not None]:
+        f.write("%sint %s_parse_json(libxl__gc *gc, const libxl__json_object *o, %s);\n" % \
+                (ty.hidden(), ty.namespace + "_" + ty.rawname,
+                 ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+
+    f.write("\n")
+    f.write("""#endif /* %s */\n""" % header_json_define)
+    f.close()
+
+    print("outputting libxl type implementations to %s" % impl)
+
+    f = open(impl, "w")
+    f.write("""
+/* DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+#include "libxl_osdeps.h"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libxl_internal.h"
+
+
+""" % " ".join(sys.argv))
+
+    for ty in [t for t in types if t.dispose_fn is not None and t.autogenerate_dispose_fn]:
+        f.write("void %s(%s)\n" % (ty.dispose_fn, ty.make_arg("p")))
+        f.write("{\n")
+        f.write("    if (!p) return;\n")
+        f.write(libxl_C_type_dispose(ty, "p"))
+        f.write("    memset(p, 0, sizeof(*p));\n")
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.copy_fn and t.autogenerate_copy_fn]:
+        f.write("void %s(libxl_ctx *ctx, %s, const %s)\n" % (ty.copy_fn,
+                                       ty.make_arg("dst", passby=idl.PASS_BY_REFERENCE),
+                                       ty.make_arg("src", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_copy(ty, "dst", "src"))
+        f.write("}\n")
+        f.write("\n")
+        
+    for ty in [t for t in types if t.copy_deprecated_fn]:
+        f.write("int %s(libxl_ctx *ctx, %s)\n" % (ty.copy_deprecated_fn,
+            ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        for field in [field for field in ty.fields if not field.const]:
+            (vnparent,vfexpr) = ty.member("p", field, True)
+            f.write(libxl_C_type_copy_deprecated(field, vfexpr,
+                                                 vparent = vnparent))
+        f.write("    return 0;\n")
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
+
+    for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
+        f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
+        f.write("{\n")
+        f.write(libxl_C_enum_to_string(ty, "e"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write(libxl_C_enum_strings(ty))
+
+        f.write("int %s_from_string(const char *s, %s *e)\n" % (ty.typename, ty.typename))
+        f.write("{\n")
+        f.write(libxl_C_enum_from_string(ty, "s", "e"))
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.json_gen_fn is not None]:
+        f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_gen_json(ty, "p"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write("char *%s_to_json(libxl_ctx *ctx, %s)\n" % (ty.typename, ty.make_arg("p")))
+        f.write("{\n")
+        f.write(libxl_C_type_to_json(ty, "p"))
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.json_parse_fn is not None]:
+        f.write("int %s_parse_json(libxl__gc *gc, const libxl__json_object *%s, %s)\n" % \
+                (ty.namespace + "_" + ty.rawname,"o",ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_parse_json(ty, "o", "p"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write("int %s_from_json(libxl_ctx *ctx, %s, const char *s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        if not isinstance(ty, idl.Enumeration):
+            f.write("    %s_init(p);\n" % ty.typename)
+        f.write(libxl_C_type_from_json(ty, "p", "s"))
+        f.write("}\n")
+        f.write("\n")
+
+    f.close()
diff --git a/tools/libs/light/idl.py b/tools/libs/light/idl.py
new file mode 100644
index 0000000000..d7367503b4
--- /dev/null
+++ b/tools/libs/light/idl.py
@@ -0,0 +1,377 @@
+from __future__ import print_function
+
+import sys
+
+PASS_BY_VALUE = 1
+PASS_BY_REFERENCE = 2
+
+DIR_NONE = 0
+DIR_IN   = 1
+DIR_OUT  = 2
+DIR_BOTH = 3
+
+_default_namespace = ""
+def namespace(s):
+    if type(s) != str:
+        raise TypeError("Require a string for the default namespace.")
+    global _default_namespace
+    _default_namespace = s
+
+def _get_default_namespace():
+    global _default_namespace
+    return _default_namespace
+
+_default_hidden = False
+def hidden(b):
+    global _default_hidden
+    _default_hidden = b
+
+def _get_default_hidden():
+    global _default_hidden
+    return _default_hidden
+
+class Type(object):
+    def __init__(self, typename, **kwargs):
+        self.namespace = kwargs.setdefault('namespace',
+                _get_default_namespace())
+        self._hidden = kwargs.setdefault('hidden', _get_default_hidden())
+        self.dir = kwargs.setdefault('dir', DIR_BOTH)
+        if self.dir not in [DIR_NONE, DIR_IN, DIR_OUT, DIR_BOTH]:
+            raise ValueError
+
+        self.passby = kwargs.setdefault('passby', PASS_BY_VALUE)
+        if self.passby not in [PASS_BY_VALUE, PASS_BY_REFERENCE]:
+            raise ValueError
+
+        self.private = kwargs.setdefault('private', False)
+
+        if typename is None: # Anonymous type
+            self.typename = None
+            self.rawname = None
+        elif self.namespace is None: # e.g. system provided types
+            self.typename = typename
+            self.rawname = typename
+        else:
+            self.typename = self.namespace + typename
+            self.rawname = typename
+
+        if self.typename is not None:
+            self.dispose_fn = kwargs.setdefault('dispose_fn', self.typename + "_dispose")
+        else:
+            self.dispose_fn = kwargs.setdefault('dispose_fn', None)
+
+        self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
+
+        if self.typename is not None:
+            self.copy_fn = kwargs.setdefault('copy_fn', self.typename + "_copy")
+        else:
+            self.copy_fn = kwargs.setdefault('copy_fn', None)
+
+        self.autogenerate_copy_fn = kwargs.setdefault('autogenerate_copy_fn', True)
+
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
+        self.check_default_fn = kwargs.setdefault('check_default_fn', None)
+        self.copy_deprecated_fn = kwargs.setdefault('copy_deprecated_fn',
+                                                    None)
+
+        if self.typename is not None and not self.private:
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
+            self.json_parse_type = kwargs.setdefault('json_parse_type', "JSON_ANY")
+            if self.namespace is not None:
+                self.json_parse_fn = kwargs.setdefault('json_parse_fn',
+                                                       self.namespace + "_" + self.rawname  + "_parse_json")
+            else:
+                self.json_parse_fn = kwargs.setdefault('json_parse_fn',
+                                                       self.typename + "_parse_json")
+        else:
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
+            self.json_parse_type = kwargs.setdefault('json_parse_type', None)
+            self.json_parse_fn = kwargs.setdefault('json_parse_fn', None)
+
+        self.autogenerate_json = kwargs.setdefault('autogenerate_json', True)
+
+    def marshal_in(self):
+        return self.dir in [DIR_IN, DIR_BOTH]
+    def marshal_out(self):
+        return self.dir in [DIR_OUT, DIR_BOTH]
+
+    def hidden(self):
+        if self._hidden:
+            return "_hidden "
+        else:
+            return ""
+
+    def make_arg(self, n, passby=None):
+        if passby is None: passby = self.passby
+
+        if passby == PASS_BY_REFERENCE:
+            return "%s *%s" % (self.typename, n)
+        else:
+            return "%s %s" % (self.typename, n)
+
+    def pass_arg(self, n, isref=None, passby=None):
+        if passby is None: passby = self.passby
+        if isref is None: isref = self.passby == PASS_BY_REFERENCE
+
+        if passby == PASS_BY_REFERENCE:
+            if isref:
+                return "%s" % (n)
+            else:
+                return "&%s" % (n)
+        else:
+            if isref:
+                return "*%s" % (n)
+            else:
+                return "%s" % (n)
+
+class Builtin(Type):
+    """Builtin type"""
+    def __init__(self, typename, **kwargs):
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('autogenerate_dispose_fn', False)
+        kwargs.setdefault('autogenerate_json', False)
+        Type.__init__(self, typename, **kwargs)
+
+class Number(Builtin):
+    def __init__(self, ctype, **kwargs):
+        kwargs.setdefault('namespace', None)
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('copy_fn', None)
+        kwargs.setdefault('signed', False)
+        kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
+        kwargs.setdefault('json_parse_type', "JSON_INTEGER")
+        # json_parse_fn might be overriden on specific type
+        kwargs.setdefault('json_parse_fn', "libxl__int_parse_json")
+        self.signed = kwargs['signed']
+        Builtin.__init__(self, ctype, **kwargs)
+
+class UInt(Number):
+    def __init__(self, w, **kwargs):
+        kwargs.setdefault('namespace', None)
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('json_parse_fn', "libxl__uint%d_parse_json" % w)
+        kwargs.setdefault('copy_fn', None)
+        Number.__init__(self, "uint%d_t" % w, **kwargs)
+
+        self.width = w
+
+class EnumerationValue(object):
+    def __init__(self, enum, value, name, **kwargs):
+        self.enum = enum
+
+        self.valuename = str.upper(name)
+        self.rawname = str.upper(enum.rawname) + "_" + self.valuename
+        self.name = str.upper(enum.value_namespace) + self.rawname
+        self.value = value
+
+class Enumeration(Type):
+    def __init__(self, typename, values, **kwargs):
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('copy_fn', None)
+        kwargs.setdefault('json_parse_type', "JSON_STRING")
+        Type.__init__(self, typename, **kwargs)
+
+        self.value_namespace = kwargs.setdefault('value_namespace',
+            self.namespace)
+
+        self.values = []
+        for v in values:
+            # (value, name)
+            (num,name) = v
+            self.values.append(EnumerationValue(self, num, name,
+                                                typename=self.rawname))
+    def lookup(self, name):
+        for v in self.values:
+            if v.valuename == str.upper(name):
+                return v
+        return ValueError
+
+class Field(object):
+    """An element of an Aggregate type"""
+    def __init__(self, type, name, **kwargs):
+        self.type = type
+        self.name = name
+        self.const = kwargs.setdefault('const', False)
+        self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.deprecated_by = kwargs.setdefault('deprecated_by', None)
+
+class Aggregate(Type):
+    """A type containing a collection of other types"""
+    def __init__(self, kind, typename, fields, **kwargs):
+        kwargs.setdefault('json_parse_type', "JSON_MAP")
+        Type.__init__(self, typename, **kwargs)
+
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
+        self.kind = kind
+
+        self.fields = []
+        for f in fields:
+            # (name, type[, {kw args}])
+            if len(f) == 2:
+                n,t = f
+                kw = {}
+            elif len(f) == 3:
+                n,t,kw = f
+            else:
+                raise ValueError
+            if n is None:
+                raise ValueError
+            self.fields.append(Field(t,n,**kw))
+
+    # Returns a tuple (stem, field-expr)
+    #
+    # field-expr is a C expression for a field "f" within the struct
+    # "v".
+    #
+    # stem is the stem common to both "f" and any other sibbling field
+    # within the "v".
+    def member(self, v, f, isref):
+        if isref:
+            deref = v + "->"
+        else:
+            deref = v + "."
+
+        if f.name is None: # Anonymous
+            return (deref, deref)
+        else:
+            return (deref, deref + f.name)
+
+class Struct(Aggregate):
+    def __init__(self, name, fields, **kwargs):
+        kwargs.setdefault('passby', PASS_BY_REFERENCE)
+        Aggregate.__init__(self, "struct", name, fields, **kwargs)
+
+    def has_fields(self):
+        return len(self.fields) != 0
+
+class Union(Aggregate):
+    def __init__(self, name, fields, **kwargs):
+        # Generally speaking some intelligence is required to free a
+        # union therefore any specific instance of this class will
+        # need to provide an explicit destructor function.
+        kwargs.setdefault('passby', PASS_BY_REFERENCE)
+        kwargs.setdefault('dispose_fn', None)
+        Aggregate.__init__(self, "union", name, fields, **kwargs)
+
+class KeyedUnion(Aggregate):
+    """A union which is keyed of another variable in the parent structure"""
+    def __init__(self, name, keyvar_type, keyvar_name, fields, **kwargs):
+        Aggregate.__init__(self, "union", name, [], **kwargs)
+
+        if not isinstance(keyvar_type, Enumeration):
+            raise ValueError
+
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
+
+        for f in fields:
+            # (name, enum, type)
+            e, ty = f
+            ev = keyvar_type.lookup(e)
+            en = ev.name
+            self.fields.append(Field(ty, e, enumname=en))
+
+#
+# Standard Types
+#
+
+void = Builtin("void *", namespace = None)
+bool = Builtin("bool", namespace = None,
+               copy_fn=None,
+               json_gen_fn = "yajl_gen_bool",
+               json_parse_type = "JSON_BOOL",
+               json_parse_fn = "libxl__bool_parse_json",
+               autogenerate_json = False)
+
+size_t = Number("size_t", namespace = None)
+
+integer = Number("int", namespace = None, signed = True)
+
+uint8 = UInt(8)
+uint16 = UInt(16)
+uint32 = UInt(32)
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
+
+string = Builtin("char *", namespace = None, copy_fn = "libxl_string_copy", dispose_fn = "free",
+                 json_gen_fn = "libxl__string_gen_json",
+                 json_parse_type = "JSON_STRING | JSON_NULL",
+                 json_parse_fn = "libxl__string_parse_json",
+                 autogenerate_json = False,
+                 check_default_fn="libxl__string_is_default")
+
+class Array(Type):
+    """An array of the same type"""
+    def __init__(self, elem_type, lenvar_name, **kwargs):
+        kwargs.setdefault('dispose_fn', 'free')
+        kwargs.setdefault('json_parse_type', 'JSON_ARRAY')
+        Type.__init__(self, namespace=elem_type.namespace, typename=elem_type.rawname + " *", **kwargs)
+
+        lv_kwargs = dict([(x.lstrip('lenvar_'),y) for (x,y) in kwargs.items() if x.startswith('lenvar_')])
+
+        self.lenvar = Field(integer, lenvar_name, **lv_kwargs)
+        self.elem_type = elem_type
+
+class OrderedDict(dict):
+    """A dictionary which remembers insertion order.
+
+       push to back on duplicate insertion"""
+
+    def __init__(self):
+        dict.__init__(self)
+        self.__ordered = []
+
+    def __setitem__(self, key, value):
+        try:
+            self.__ordered.remove(key)
+        except ValueError:
+            pass
+
+        self.__ordered.append(key)
+        dict.__setitem__(self, key, value)
+
+    def ordered_keys(self):
+        return self.__ordered
+    def ordered_values(self):
+        return [self[x] for x in self.__ordered]
+    def ordered_items(self):
+        return [(x,self[x]) for x in self.__ordered]
+
+def parse(f):
+    print("Parsing %s" % f, file=sys.stderr)
+
+    globs = {}
+    locs = OrderedDict()
+
+    for n,t in globals().items():
+        if isinstance(t, Type):
+            globs[n] = t
+        elif isinstance(t,type(object)) and issubclass(t, Type):
+            globs[n] = t
+        elif n in ['PASS_BY_REFERENCE', 'PASS_BY_VALUE',
+                   'DIR_NONE', 'DIR_IN', 'DIR_OUT', 'DIR_BOTH',
+                   'namespace', 'hidden']:
+            globs[n] = t
+
+    try:
+        exec(compile(open(f).read(), f, 'exec'), globs, locs)
+    except SyntaxError as e:
+        raise SyntaxError("Errors were found at line %d while processing %s:\n\t%s"
+                          % (e.lineno, f, e.text))
+
+    types = [t for t in locs.ordered_values() if isinstance(t,Type)]
+
+    builtins = [t for t in types if isinstance(t,Builtin)]
+    types = [t for t in types if not isinstance(t,Builtin)]
+
+    return (builtins,types)
diff --git a/tools/libs/light/idl.txt b/tools/libs/light/idl.txt
new file mode 100644
index 0000000000..7440fb3b76
--- /dev/null
+++ b/tools/libs/light/idl.txt
@@ -0,0 +1,214 @@
+libxl IDL
+---------
+
+Each type in the libxl interface is represented by an object of type
+idl.Type (or a subclass thereof). Every local variable defined by the
+.idl file must be an instance of idl.Type (e.g. you may not define
+Python functions or any other construct other than defining variables)
+
+The name of the type must be passed as the first argument to the
+constructor when defining a new type. The name given should not
+contain the initial namespace element (e.g. "libxl_"). See below for
+how to specify a namespace.
+
+The Type.typename contains the C name of the type _including_ the
+namespace element while Type.rawname is always set to the 'base' name
+of the type.
+
+The idl.Type base class has several other properties which apply to
+all types. The properties are set by passing a named parameter to the
+constructor.
+
+Type.namespace: (default: "libxl_")
+
+ The namespace in which the type resides. Usually this is "libxl_" but
+ system defined and builtin types may differ.
+
+ If the typename is not None then the namespace is prepended to the
+ type.
+ 
+Type.passby: (default: idl.PASS_BY_VALUE)
+
+ Defines the manner in which a type should be passed to C
+ functions. Valid values for this fields are:
+   idl.PASS_BY_VALUE
+   idl.PASS_BY_REFERENCE
+
+Type.dispose_fn: (default: typename + "_dispose" or None if type == None)
+
+ The name of the C function which will free all dynamically allocated
+ memory contained within this type (but not the type itself).
+
+Type.autogenerate_dispose_fn: (default: True)
+
+ Indicates if the above named Type.dispose_fn should be
+ autogenerated.
+
+Type.copy_fn: (default: typename + "_copy" or None if type == None)
+
+ The name of the C function which will deep copy all fields within
+ this type.
+
+Type.autogenerate_copy_fn: (default: True)
+
+ Indicates if the above named Type.copy_fn should be
+ autogenerated.
+
+Type.autogenerate_copy_fn
+
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
+Type.json_gen_fn: (default: typename + "_gen_json" or None if type == None)
+
+ The name of the C function which will generate a YAJL data structure
+ representing this type.
+
+Type.json_parse_fn: (default: typename + "_parse_json" or None if type == None)
+
+ The name of the C function which will parse a libxl JSON structure
+ representing this type to C type.
+
+Type.autogenerate_json: (default: True)
+
+ Indicates if the above named Type.json_*_fn should be autogenerated.
+
+Type.check_default_fn:
+
+ If it's set then calling this function shall return true if this type
+ has been set to default value (internal libxl implementation).
+
+ If this is not set, that means we can check the type against init_val
+ (if it has one) or zero to determine whether the value is default
+ value.
+
+Other simple type-Classes
+-------------------------
+
+idl.Builtin
+
+ Instances of this class represent types which are predefined within
+ the system.
+
+idl.UInt
+
+ Instances of this class represent the standard uint<N>_t types.
+
+ The <N> for a given instance must be passed to the constructor and is
+ then available in UInt.width
+
+Complex type-Classes
+--------------------
+
+idl.Enumeration
+
+  A class representing an enumeration (named integer values).
+  This class has one property besides the ones defined for the Type
+  class:
+
+  Enumeration.value_namespace: (default: namespace)
+
+    The namespace in which the values of the Enumeration (see below) reside.
+    This prefix is prepended to the name of the value.
+
+  The values are available in the list Enumeration.values. Each
+  element in the list is of type idl.EnumerationValue.
+
+  Each EnumerationValue has the following properties:
+
+    EnumerationValue.enum       Reference to containing Enumeration
+    EnumerationValue.name       The C name of this value, including
+                                    the namespace and typename of the
+                                    containing Enumeration (e.g.
+                                    "LIBXL_FOOENUM_VALUE")
+    EnumerationValue.rawname    The C name of this value, excluding
+                                    the namespace but including the
+                                    typename of the containing
+                                    Enumeration (e.g. "FOOENUM_VALUE")
+    EnumerationValue.valuename  The name of this value, excluding the
+                                    name of the containing Enumeration
+                                    and any namespace (e.g. "VALUE")
+    EnumerationValue.value      The integer value associated with this name.
+
+idl.Aggregate
+
+ Base class for type-Classes which contain a number of other types
+ (e.g. structs and unions).
+
+ The contained types are available in the list Aggregate.fields. Each
+ element in the list is of type idl.Field representing a member of the
+ aggregate.
+
+ Each field has the following properties:
+
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
+
+idl.Struct
+
+ A subclass of idl.Aggregate representing the C struct type.
+
+ Struct.kind == "struct"
+
+idl.Union
+
+ A subclass of idl.Aggregate representing the C union type.
+
+ Union.kind == "union"
+
+idl.KeyedUnion
+
+ A subclass of idl.Aggregate which represents the C union type
+ where the currently valid member of the union can be determined based
+ upon another member in the containing type. An idl.KeyedUnion must
+ always be a member of a containing idl.Aggregate type.
+
+ The KeyedUnion.keyvar contains an idl.Field, this is the member of
+ the containing type which determines the valid member of the
+ union. The idl.Field.type of the keyvar must be an Enumeration type.
+
+idl.Array
+
+  A class representing an array of similar elements. An idl.Array must
+  always be an idl.Field of a containing idl.Aggregate.
+
+  idl.Array.elem_type contains an idl.Type which is the type of each
+  element of the array.
+
+  idl.Array.len_var contains an idl.Field which is added to the parent
+  idl.Aggregate and will contain the length of the array. The field
+  MUST be named num_ARRAYNAME.
+
+Standard Types
+--------------
+
+Several standard types a predefined. They are
+
+void                    (void pointer type)
+bool
+size_t
+integer                 24 bit signed integer.
+
+uint{8,16,32,64}        uint{8,16,32,64}_t


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1281.4303 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyhz-0000j9-Lu; Thu, 01 Oct 2020 13:33:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1281.4303; Thu, 01 Oct 2020 13:33:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyhz-0000ix-Ib; Thu, 01 Oct 2020 13:33:19 +0000
Received: by outflank-mailman (input) for mailman id 1281;
 Thu, 01 Oct 2020 13:33:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyhy-0000iD-6d
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 22e09ed2-3250-4e9d-b55a-8052d27edf8c;
 Thu, 01 Oct 2020 13:33:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyhw-0006jz-2U
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyhw-00034G-0f
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyhy-0000iD-6d
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:18 +0000
X-Inumbo-ID: 22e09ed2-3250-4e9d-b55a-8052d27edf8c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 22e09ed2-3250-4e9d-b55a-8052d27edf8c;
	Thu, 01 Oct 2020 13:33:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tAsynF2Emp9uffONAwUAn6+rOU9giQNSwwInWMKLqzs=; b=Flf7urtap1mzNX/z8PWIKN6aMw
	QklYjdLHncNQzqOD/J+lzbxJ0NHq+IKh6eIQfVyN9jIp719eIgNHYAH9ibIeNqRl7KfdXgeoWDHkU
	p+lFHsnEUUguSB6Rjldk4t6Uc/Q4LoQTj0w+AamQSbFvWnSS1vGJLUSso+zfk+qoshJw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyhw-0006jz-2U
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyhw-00034G-0f
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: rename global libxlutil make variables
Message-Id: <E1kNyhw-00034G-0f@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:16 +0000

commit bc01c73018689e066e06515b26181d463a3f2a40
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:13 2020 +0200

    tools: rename global libxlutil make variables
    
    Rename *_libxlutil make variables to *_libxenutil in order to avoid
    nasty indirections when moving libxlutil under the tools/libs
    infrastructure.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/Rules.mk       | 10 +++++-----
 tools/libxl/Makefile |  4 ++--
 tools/xl/Makefile    |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index a68dbb9de8..2c26ee7927 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,7 +15,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxlutil      = $(XEN_ROOT)/tools/libxl
+XEN_libxenutil     = $(XEN_ROOT)/tools/libxl
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
@@ -116,10 +116,10 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxlutil = -I$(XEN_libxlutil)
-SHDEPS_libxlutil = $(SHLIB_libxenlight)
-LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension)
-SHLIB_libxlutil  = $(SHDEPS_libxlutil) -Wl,-rpath-link=$(XEN_libxlutil)
+CFLAGS_libxenutil = -I$(XEN_libxenutil)
+SHDEPS_libxenutil = $(SHLIB_libxenlight)
+LDLIBS_libxenutil = $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(libextension)
+SHLIB_libxenutil  = $(SHDEPS_libxenutil) -Wl,-rpath-link=$(XEN_libxenutil)
 
 CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
 
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 8ab7c9d3f0..51da1d5be4 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -42,7 +42,7 @@ PKG_CONFIG_INST := $(PKG_CONFIG)
 xlutil.pc: PKG_CONFIG_NAME = Xlutil
 xlutil.pc: PKG_CONFIG_DESC = The xl utility library for Xen hypervisor
 xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
-xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxlutil)
+xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxenutil)
 xlutil.pc: PKG_CONFIG_LIB = xlutil
 xlutil.pc: PKG_CONFIG_REQPRIV = xenlight
 $(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
@@ -55,7 +55,7 @@ PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_NAME = Xlutil
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_DESC = The xl utility library for Xen hypervisor
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
-$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxlutil)
+$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxenutil)
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_LIB = xlutil
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_REQPRIV = xenlight
 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 407dd7554c..bdf67c8464 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -13,7 +13,7 @@ CFLAGS += $(PTHREAD_CFLAGS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
 CFLAGS_XL += $(CFLAGS_libxenlight)
-CFLAGS_XL += $(CFLAGS_libxlutil)
+CFLAGS_XL += $(CFLAGS_libxenutil)
 CFLAGS_XL += -Wshadow
 
 XL_OBJS-$(CONFIG_X86) = xl_psr.o
@@ -38,7 +38,7 @@ $(XL_OBJS): _paths.h
 all: xl
 
 xl: $(XL_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxlutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1282.4307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyi8-0000kV-NL; Thu, 01 Oct 2020 13:33:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1282.4307; Thu, 01 Oct 2020 13:33:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyi8-0000kN-KC; Thu, 01 Oct 2020 13:33:28 +0000
Received: by outflank-mailman (input) for mailman id 1282;
 Thu, 01 Oct 2020 13:33:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyi7-0000k8-5c
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5a7f4e5a-430c-4897-a644-0e9eda524e14;
 Thu, 01 Oct 2020 13:33:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyi6-0006kW-5a
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyi6-00035E-4f
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyi7-0000k8-5c
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:27 +0000
X-Inumbo-ID: 5a7f4e5a-430c-4897-a644-0e9eda524e14
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5a7f4e5a-430c-4897-a644-0e9eda524e14;
	Thu, 01 Oct 2020 13:33:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LkkDwxlwObraNsibVrhgAkbAkb6WinzCB3jRpqThtvY=; b=HM9zCxqj85GvQpTDko1c2Qsstf
	iVLV/UtGb4i54f2AK0jesp+zOyFYCYd6FhlSlxQ36KYO9WZ7z989rasRqbl3y/pQgH6+zc2kPEonQ
	xxr/tTcBlYX8dlnb9yg1kf3kjrcaJFQBjSG+I0zMZ10zCpokH2vnZTwglpe/NhPD25jE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyi6-0006kW-5a
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyi6-00035E-4f
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs: add option for library names not starting with libxen
Message-Id: <E1kNyi6-00035E-4f@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:26 +0000

commit b22b9b9a1df865e1dd9e4f6950ae6be7081be010
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:15 2020 +0200

    tools/libs: add option for library names not starting with libxen
    
    libxlutil doesn't follow the standard name pattern of all other Xen
    libraries, so add another make variable which can be used to allow
    other names.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/Rules.mk     |  3 ++-
 tools/libs/libs.mk | 41 +++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2c26ee7927..75d44c4a4b 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -87,10 +87,11 @@ endif
 # $(SHLIB_libfoo)
 
 define LIB_defs
+ FILENAME_$(1) ?= xen$(1)
  XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1)
  CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude)
  SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use)))
- LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)$$(libextension)
+ LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILENAME_$(1))$$(libextension)
  SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1))
 endef
 
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 9d0ed08846..325b7b7cea 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -20,20 +20,21 @@ LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
 LIB_OBJS := $(SRCS-y:.c=.o)
 PIC_OBJS := $(SRCS-y:.c=.opic)
 
-LIB := libxen$(LIBNAME).a
+LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
+LIB := lib$(LIB_FILE_NAME).a
 ifneq ($(nosharedlibs),y)
-LIB += libxen$(LIBNAME).so
+LIB += lib$(LIB_FILE_NAME).so
 endif
 
 comma:= ,
 empty:=
 space:= $(empty) $(empty)
-PKG_CONFIG ?= xen$(LIBNAME).pc
+PKG_CONFIG ?= $(LIB_FILE_NAME).pc
 PKG_CONFIG_NAME ?= Xen$(LIBNAME)
 PKG_CONFIG_DESC ?= The $(PKG_CONFIG_NAME) library for Xen hypervisor
 PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
 PKG_CONFIG_USELIBS := $(SHLIB_libxen$(LIBNAME))
-PKG_CONFIG_LIB := xen$(LIBNAME)
+PKG_CONFIG_LIB := $(LIB_FILE_NAME)
 PKG_CONFIG_REQPRIV := $(subst $(space),$(comma),$(strip $(foreach lib,$(patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib))))
 
 ifneq ($(CONFIG_LIBXC_MINIOS),y)
@@ -45,7 +46,7 @@ endif
 
 PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
 
-LIBHEADER ?= xen$(LIBNAME).h
+LIBHEADER ?= $(LIB_FILE_NAME).h
 LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h))
 LIBHEADERSGLOB = $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(h))
 
@@ -81,36 +82,36 @@ libxen$(LIBNAME).map:
 $(LIBHEADERSGLOB): $(LIBHEADERS)
 	for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done
 
-libxen$(LIBNAME).a: $(LIB_OBJS)
+lib$(LIB_FILE_NAME).a: $(LIB_OBJS)
 	$(AR) rc $@ $^
 
-libxen$(LIBNAME).so: libxen$(LIBNAME).so.$(MAJOR)
+lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR)
 	$(SYMLINK_SHLIB) $< $@
-libxen$(LIBNAME).so.$(MAJOR): libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
+lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
-libxen$(LIBNAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxen$(LIBNAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
+lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
-	$(INSTALL_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
-	$(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
+	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) lib$(LIB_FILE_NAME).a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
 	for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done
 	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc
+	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
 	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).a
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).a
 
 .PHONY: TAGS
 TAGS:
@@ -119,7 +120,7 @@ TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
-	rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR)
+	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk
 	rm -f $(PKG_CONFIG)
 	rm -f $(LIBHEADERSGLOB)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1283.4311 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyiN-0000m4-Px; Thu, 01 Oct 2020 13:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1283.4311; Thu, 01 Oct 2020 13:33:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyiN-0000lx-MG; Thu, 01 Oct 2020 13:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1283;
 Thu, 01 Oct 2020 13:33:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyiM-0000lr-B5
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8b129f53-bfaf-4b60-8fcc-4b3f55d394a3;
 Thu, 01 Oct 2020 13:33:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyiG-0006ke-9W
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyiG-000364-8Y
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyiM-0000lr-B5
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:42 +0000
X-Inumbo-ID: 8b129f53-bfaf-4b60-8fcc-4b3f55d394a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8b129f53-bfaf-4b60-8fcc-4b3f55d394a3;
	Thu, 01 Oct 2020 13:33:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lIdenfY/ftrhR/VJuih6ClYf+UIDFgs589r8xwEut3M=; b=gQX/0/9HBD/16LfMJ2KWrgdQnH
	Pz5e10vR4mHClePrt97I4nUe9eO753KyhJ1etTBLwDc8glVMpk0XwalxriZqJ6mhK80ddOxeS37Zj
	ndDGuMsFcF6BVkJcYfm7bcKgl/425NoPvFGpFsQHiQc3PgIafXl1U/NQOlAA0pn7HQ+s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyiG-0006ke-9W
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyiG-000364-8Y
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: move libxlutil to tools/libs/util
Message-Id: <E1kNyiG-000364-8Y@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:36 +0000

commit 3ae0d316f01c08903a96f6b5b39275c67b823264
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:17 2020 +0200

    tools: move libxlutil to tools/libs/util
    
    Move the libxlutil source to tools/libs/util and delete tools/libxl.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                          |    6 +-
 tools/Makefile                      |    1 -
 tools/Rules.mk                      |    7 -
 tools/libs/Makefile                 |    1 +
 tools/libs/uselibs.mk               |    3 +
 tools/libs/util/CODING_STYLE        |  330 ++++
 tools/libs/util/Makefile            |   63 +
 tools/libs/util/include/libxlutil.h |  136 ++
 tools/libs/util/libxlu_cfg.c        |  712 +++++++++
 tools/libs/util/libxlu_cfg_i.h      |   59 +
 tools/libs/util/libxlu_cfg_l.c      | 2375 ++++++++++++++++++++++++++++
 tools/libs/util/libxlu_cfg_l.h      |  734 +++++++++
 tools/libs/util/libxlu_cfg_l.l      |  104 ++
 tools/libs/util/libxlu_cfg_y.c      | 1705 ++++++++++++++++++++
 tools/libs/util/libxlu_cfg_y.h      |   96 ++
 tools/libs/util/libxlu_cfg_y.y      |   79 +
 tools/libs/util/libxlu_disk.c       |  102 ++
 tools/libs/util/libxlu_disk_i.h     |   29 +
 tools/libs/util/libxlu_disk_l.c     | 2944 +++++++++++++++++++++++++++++++++++
 tools/libs/util/libxlu_disk_l.h     |  701 +++++++++
 tools/libs/util/libxlu_disk_l.l     |  289 ++++
 tools/libs/util/libxlu_internal.h   |   84 +
 tools/libs/util/libxlu_pci.c        |  264 ++++
 tools/libs/util/libxlu_vif.c        |  149 ++
 tools/libxl/CODING_STYLE            |  330 ----
 tools/libxl/Makefile                |  124 --
 tools/libxl/libxlu_cfg.c            |  712 ---------
 tools/libxl/libxlu_cfg_i.h          |   59 -
 tools/libxl/libxlu_cfg_l.c          | 2375 ----------------------------
 tools/libxl/libxlu_cfg_l.h          |  734 ---------
 tools/libxl/libxlu_cfg_l.l          |  104 --
 tools/libxl/libxlu_cfg_y.c          | 1705 --------------------
 tools/libxl/libxlu_cfg_y.h          |   96 --
 tools/libxl/libxlu_cfg_y.y          |   79 -
 tools/libxl/libxlu_disk.c           |  102 --
 tools/libxl/libxlu_disk_i.h         |   29 -
 tools/libxl/libxlu_disk_l.c         | 2944 -----------------------------------
 tools/libxl/libxlu_disk_l.h         |  701 ---------
 tools/libxl/libxlu_disk_l.l         |  289 ----
 tools/libxl/libxlu_internal.h       |   84 -
 tools/libxl/libxlu_pci.c            |  264 ----
 tools/libxl/libxlu_vif.c            |  149 --
 tools/libxl/libxlutil.h             |  136 --
 43 files changed, 10963 insertions(+), 11026 deletions(-)

diff --git a/.gitignore b/.gitignore
index f30550255f..188495783e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -154,6 +154,10 @@ tools/libs/store/utils.h
 tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
 tools/libs/store/include/xenstore_lib.h
+tools/libs/util/*.pc
+tools/libs/util/_paths.h
+tools/libs/util/libxlu_cfg_y.output
+tools/libs/util/libxenutil.map
 tools/libs/vchan/headers.chk
 tools/libs/vchan/libxenvchan.map
 tools/libs/vchan/xenvchan.pc
@@ -232,8 +236,6 @@ tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-tools/libxl/*.pc
-tools/libxl/libxlu_cfg_y.output
 tools/misc/cpuperf/cpuperf-perfcntr
 tools/misc/cpuperf/cpuperf-xen
 tools/misc/xc_shadow
diff --git a/tools/Makefile b/tools/Makefile
index c1eba22c0c..ed71474421 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -29,7 +29,6 @@ SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir
 endif
 
 SUBDIRS-y += xenpmd
-SUBDIRS-y += libxl
 SUBDIRS-$(CONFIG_GOLANG) += golang
 SUBDIRS-y += xl
 SUBDIRS-y += helpers
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 75d44c4a4b..f3e0078927 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,8 +15,6 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxenutil     = $(XEN_ROOT)/tools/libxl
-
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
 XENSTORE_XENSTORED ?= y
@@ -117,11 +115,6 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxenutil = -I$(XEN_libxenutil)
-SHDEPS_libxenutil = $(SHLIB_libxenlight)
-LDLIBS_libxenutil = $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(libextension)
-SHLIB_libxenutil  = $(SHDEPS_libxenutil) -Wl,-rpath-link=$(XEN_libxenutil)
-
 CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
 
 # Get gcc to generate the dependencies for us.
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index c41455c604..1afcd12e2b 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -16,6 +16,7 @@ SUBDIRS-y += store
 SUBDIRS-y += stat
 SUBDIRS-$(CONFIG_Linux) += vchan
 SUBDIRS-y += light
+SUBDIRS-y += util
 
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk
index 685f368aed..efd7a475ba 100644
--- a/tools/libs/uselibs.mk
+++ b/tools/libs/uselibs.mk
@@ -28,3 +28,6 @@ LIBS_LIBS += stat
 USELIBS_stat := ctrl store
 LIBS_LIBS += light
 USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest
+LIBS_LIBS += util
+USELIBS_util := light
+FILENAME_util := xlutil
diff --git a/tools/libs/util/CODING_STYLE b/tools/libs/util/CODING_STYLE
new file mode 100644
index 0000000000..3d572f6925
--- /dev/null
+++ b/tools/libs/util/CODING_STYLE
@@ -0,0 +1,330 @@
+LIBXENLIGHT CODING STYLE
+========================
+
+
+AN APOLOGY AND WARNING
+----------------------
+
+Much of the code in libxl does not yet follow this coding style
+document in every respect.  However, new code is expected to conform.
+
+Patches to improve the style of existing code are welcome.  Please
+separate these out from functional changes.
+
+If it is not feasible to conform fully to the style while patching old
+code, without doing substantial style reengineering first, we may
+accept patches which contain nonconformant elements, provided that
+they don't make the coding style problem worse overall.
+
+In this case, the new code should conform to the prevailing style in
+the area being touched.
+
+
+MEMORY ALLOCATION
+-----------------
+
+Memory allocation for libxl-internal purposes should normally be done
+with the provided gc mechanisms; there is then no need to free.  See
+"libxl memory management" in libxl.h.
+
+
+CONVENTIONAL VARIABLE NAMES
+---------------------------
+
+The following local variable names should be used where applicable:
+
+  int rc;    /* a libxl error code - and not anything else */
+  int r;     /* the return value from a system call (or libxc call) */
+  bool ok;   /* the success return value from a boolean function */
+
+  uint32_t domid;
+  libxl__gc *gc;
+  libxl__egc *egc;
+  libxl__ao *ao;
+
+  libxl_foo_bar_state *fbs;    /* local variable */
+  libxl_foo_bar_state foo_bar; /* inside another state struct */
+
+
+CONVENIENCE MACROS
+------------------
+
+There are a number of convenience macros which shorten the program and
+avoid opportunity for mistakes.  In some cases non-use of the macros
+produces functional bugs or incorrect error handling.  Use the macros
+whenever they are applicable.  For example:
+
+ Usually, don't use:     Instead, use (see libxl_internal.h):
+  libxl__log[v]           LOG, LOGE, LOGEV
+  libxl__sprintf          GCSPRINTF
+  libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
+  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
+--------------
+
+Unless, there are good reasons to do otherwise, the following error
+handling and cleanup paradigm should be used:
+
+  * All local variables referring to resources which might need
+    cleaning up are declared at the top of the function, and
+    initialised to a sentinel value indicating "nothing allocated".
+    For example,
+            libxl_evgen_disk_eject *evg = NULL;
+            int nullfd = -1;
+
+  * If the function is to return a libxl error value, `rc' is
+    used to contain the error code, but it is NOT initialised:
+            int rc;
+
+  * There is only one error cleanup path out of the function.  It
+    starts with a label `out:'.  That error cleanup path checks for
+    each allocated resource and frees it iff necessary.  It then
+    returns rc.  For example,
+         out:
+             if (evg) libxl__evdisable_disk_eject(gc, evg);
+             if (nullfd >= 0) close(nullfd);
+             return rc;
+
+  * Function calls which might fail (ie most function calls) are
+    handled by putting the return/status value into a variable, and
+    then checking it in a separate statement:
+            char *dompath = libxl__xs_get_dompath(gc, bl->domid);
+            if (!dompath) { rc = ERROR_FAIL; goto out; }
+
+  * If a resource is freed in the main body of the function (for
+    example, in a loop), the corresponding variable has to be reset to
+    the sentinel at the point where it's freed.
+
+Whether to use the `out' path for successful returns as well as error
+returns is a matter of taste and convenience for the specific
+function.  Not reusing the out path is fine if the duplicated function
+exit code is only `CTX_UNLOCK; GC_FREE;' (or similar).
+
+If you reuse the `out' path for successful returns, there may be
+resources which are to be returned to the caller rather than freed.
+In that case you have to reset the local variable to `nothing here',
+to avoid the resource being freed on the out path.  That resetting
+should be done immediately after the resource value is stored at the
+applicable _r function parameter (or equivalent).  Do not test `rc' in
+the out section, to discover whether to free things.
+
+The uses of the single-line formatting in the examples above are
+permitted exceptions to the usual libxl code formatting rules.
+
+
+
+IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
+--------------------------------------------------
+
+Nontrivial data structures (in structs) should come with an idempotent
+_dispose function, which must free all resources associated with the
+data structure (but not free the struct itself).
+
+Such a struct should also come with an _init function which
+initialises the struct so that _dispose is a no-op.
+
+
+ASYNCHRONOUS/LONG-RUNNING OPERATIONS
+------------------------------------
+
+All long-running operations in libxl need to use the asynchronous
+operation machinery.  Consult the programmer documentation in
+libxl_internal.h for details - search for "Machinery for asynchronous
+operations".
+
+The code for asynchronous operations should be laid out in
+chronological order.  That is, where there is a chain of callback
+functions, each subsequent function should be, textually, the next
+function in the file.  This will normally involve predeclaring the
+callback functions.  Synchronous helper functions should be separated
+out into a section preceding the main callback chain.
+
+Control flow arrangements in asynchronous operations should be made as
+simple as possible, because it can otherwise be very hard to see
+through the tangle.
+
+
+When inventing a new sub-operation in asynchronous code, consider
+whether to structure it formally as a sub-operation with its own state
+structure.  (See, for example, libxl__datacopier_*.)
+
+An ao-suboperation state structure should contain, in this order:
+  * fields that the caller must fill in, and which are,
+    effectively, the parameters to the operation, including:
+      - libxl__ao *ao
+      - the callback function pointer(s), which
+        should be named callback or callback_*.
+  * shared information fields or ones used for returning information
+    to the calling operation
+  * private fields
+These sections should be clearly demarcated by comments.
+
+An asynchronous operation should normally have an idempotent stop or
+cancel function.  It should normally also have an _init function for
+its state struct, which arranges that the stop is a no-op.
+
+The permitted order of calls into your ao operation's methods must be
+documented in comments, if it is nontrivial.
+
+
+When using an ao sub-operation, you should normally:
+ * Physically include the sub-operation state struct in your
+   own state struct;
+ * Use CONTAINER_OF to find your own state struct at the start of
+   your implementations of the sub-operation callback functions;
+ * Unconditionally initialise the sub-operation's struct (with its
+   _init method) in your own _init method.
+ * Unconditionally cancel or destroy the sub-operation in your own
+   cancel or destroy method.
+
+
+FORMATTING AND NAMING
+---------------------
+
+Blatantly copied from qemu and linux with few modifications.
+
+
+1. Whitespace
+
+Of course, the most important aspect in any coding style is whitespace.
+Crusty old coders who have trouble spotting the glasses on their noses
+can tell the difference between a tab and eight spaces from a distance
+of approximately fifteen parsecs.  Many a flamewar have been fought and
+lost on this issue.
+
+Libxenlight indents are four spaces.  Tabs are never used, except in
+Makefiles where they have been irreversibly coded into the syntax.
+Spaces of course are superior to tabs because:
+
+ - You have just one way to specify whitespace, not two.  Ambiguity breeds
+   mistakes.
+ - The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
+ - Tab indents push your code to the right, making your screen seriously
+   unbalanced.
+ - Tabs will be rendered incorrectly on editors who are misconfigured not
+   to use tab stops of eight positions.
+ - Tabs are rendered badly in patches, causing off-by-one errors in almost
+   every line.
+ - It is the libxenlight coding style.
+
+Do not leave whitespace dangling off the ends of lines.
+
+
+2. Line width
+
+Lines are limited to 75 characters.
+
+Rationale:
+ - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
+   xterms and use vi in all of them.  The best way to punish them is to
+   let them keep doing it.
+ - In an 80 column terminal, some room needs to be left for > quoting
+   characters, +/- diff characters, and so on, in emails.
+ - Code and especially patches is much more readable if limited to a sane
+   line length.  Eighty is traditional.
+ - It is the libxenlight coding style.
+
+
+3. Naming
+
+C is a Spartan language, and so should your naming be.  Unlike Modula-2
+and Pascal programmers, C programmers do not use cute names like
+ThisVariableIsATemporaryCounter.  A C programmer would call that
+variable "tmp", which is much easier to write, and not the least more
+difficult to understand.
+
+HOWEVER, while mixed-case names are frowned upon, descriptive names for
+global variables are a must.  To call a global function "foo" is a
+shooting offense.
+
+GLOBAL variables (to be used only if you _really_ need them) need to
+have descriptive names, as do global functions.  If you have a function
+that counts the number of active users, you should call that
+"count_active_users()" or similar, you should _not_ call it "cntusr()".
+
+Encoding the type of a function into the name (so-called Hungarian
+notation) is brain damaged - the compiler knows the types anyway and can
+check those, and it only confuses the programmer.
+
+LOCAL variable names should be short, and to the point.  If you have
+some random integer loop counter, it should probably be called "i".
+Calling it "loop_counter" is non-productive, if there is no chance of it
+being mis-understood.  Similarly, "tmp" can be just about any type of
+variable that is used to hold a temporary value.
+
+Local variables used to store return values should have descriptive name
+like "rc" or "ret". Following the same reasoning the label used as exit
+path should be called "out".
+
+Function arguments which are used to return values to the caller
+should be suffixed `_r' or `_out'.
+
+Variables, type names and function names are
+lower_case_with_underscores.
+Type names and function names use the prefix libxl__ when internal to
+libxenlight and libxl_ when exported in libxl.h.
+Xl should avoid using libxl_ and libxl__ as prefix for its own function
+names.
+
+When wrapping standard library functions, use the prefix libxl_ to alert
+readers that they are seeing a wrapped version; otherwise avoid this prefix.
+
+Typedefs are used to eliminate the redundant 'struct' keyword.
+It is the libxenlight coding style.
+
+
+4. Statements
+
+Don't put multiple statements on a single line.
+Don't put multiple assignments on a single line either.
+Error code paths with an if statement and a goto or a return on the same
+line are allowed. Examples:
+
+    if (rc) goto out;
+    if (rc < 0) return;
+
+Libxenlight coding style is super simple.  Avoid tricky expressions.
+
+
+5. Block structure
+
+Every indented statement is braced, but blocks that contain just one
+statement may have the braces omitted.  To avoid confusion, either all
+the blocks in an if...else chain have braces, or none of them do.
+
+The opening brace is on the line that contains the control flow
+statement that introduces the new block; the closing brace is on the
+same line as the else keyword, or on a line by itself if there is no
+else keyword.  Examples:
+
+    if (a == 5) {
+        printf("a was 5.\n");
+    } else if (a == 6) {
+        printf("a was 6.\n");
+    } else {
+        printf("a was something else entirely.\n");
+    }
+
+    if (a == 5)
+        printf("a was 5.\n");
+
+An exception is the opening brace for a function; for reasons of tradition
+and clarity it comes on a line by itself:
+
+    void a_function(void)
+    {
+        do_something();
+    }
+
+Rationale: a consistent (except for functions...) bracing style reduces
+ambiguity and avoids needless churn when lines are added or removed.
+Furthermore, it is the libxenlight coding style.
+
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
new file mode 100644
index 0000000000..0c9db8027d
--- /dev/null
+++ b/tools/libs/util/Makefile
@@ -0,0 +1,63 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SRCS-y += libxlu_cfg_y.c
+SRCS-y += libxlu_cfg_l.c
+SRCS-y += libxlu_cfg.c
+SRCS-y += libxlu_disk_l.c
+SRCS-y += libxlu_disk.c
+SRCS-y += libxlu_vif.c
+SRCS-y += libxlu_pci.c
+
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -I. $(CFLAGS_libxenctrl)
+
+CFLAGS += $(PTHREAD_CFLAGS)
+LDFLAGS += $(PTHREAD_LDFLAGS)
+
+ifeq ($(FLEX),)
+%.c %.h:: %.l
+	$(warning Flex is needed to rebuild some libxl parsers and \
+		  scanners, please install it and rerun configure)
+endif
+
+ifeq ($(BISON),)
+%.c %.h:: %.y
+	$(warning Bison is needed to rebuild some libxl parsers and \
+		  scanners, please install it and rerun configure)
+endif
+
+AUTOINCS = libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h
+AUTOSRCS = libxlu_cfg_y.c libxlu_cfg_l.c
+
+LIBHEADER := libxlutil.h
+PKG_CONFIG_NAME := Xlutil
+PKG_CONFIG_DESC := The xl utility library for Xen hypervisor
+
+NO_HEADERS_CHK := y
+
+include $(XEN_ROOT)/tools/libs/libs.mk
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenutil)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
+$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h
+
+%.c %.h:: %.y
+	@rm -f $*.[ch]
+	$(BISON) --output=$*.c $<
+
+%.c %.h:: %.l
+	@rm -f $*.[ch]
+	$(FLEX) --header-file=$*.h --outfile=$*.c $<
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+clean: cleanlocal
+
+.PHONY: cleanlocal
+cleanlocal:
+	$(RM) -f _*.h
+	$(RM) -f libxlutil.map
diff --git a/tools/libs/util/include/libxlutil.h b/tools/libs/util/include/libxlutil.h
new file mode 100644
index 0000000000..92e35c5462
--- /dev/null
+++ b/tools/libs/util/include/libxlutil.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef LIBXLUTIL_H
+#define LIBXLUTIL_H
+
+#include <stdio.h>
+
+#include "libxl.h"
+
+enum XLU_ConfigValueType {
+    XLU_STRING,
+    XLU_LIST,
+};
+
+enum XLU_Operation {
+    XLU_OP_ASSIGNMENT = 0,
+    XLU_OP_ADDITION,
+};
+
+/* Unless otherwise stated, all functions return an errno value. */
+typedef struct XLU_Config XLU_Config;
+typedef struct XLU_ConfigList XLU_ConfigList;
+typedef struct XLU_ConfigValue XLU_ConfigValue;
+
+XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);
+  /* 0 means we got ENOMEM. */
+  /* report_filename is copied; report is saved and must remain valid
+   *  until the Config is destroyed. */
+
+int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
+int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
+  /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
+   * functions.  You have to just xlu_cfg_destroy. */
+
+void xlu_cfg_destroy(XLU_Config*);
+
+
+/* All of the following print warnings to "report" if there is a problem.
+ * Return values are:
+ *   0        OK
+ *   ESRCH    not defined
+ *   EINVAL   value found but wrong format for request (prints warning unless dont_warn=true)
+ *   ERANGE   value out of range (from strtol)
+ */
+
+int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
+                       int dont_warn);
+/* free/strdup version */
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn);
+int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+                     int dont_warn);
+int xlu_cfg_get_bounded_long(const XLU_Config*, const char *n, long min,
+                             long max, long *value_r, int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
+
+int xlu_cfg_get_list(const XLU_Config*, const char *n,
+                     XLU_ConfigList **list_r /* may be 0 */,
+                     int *entries_r /* may be 0 */,
+                     int dont_warn);
+  /* there is no need to free *list_r; lifetime is that of the XLU_Config */
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                                    libxl_string_list *sl, int dont_warn);
+const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
+  /* xlu_cfg_get_listitem cannot fail, except that if entry is
+   * out of range it returns 0 (not setting errno) */
+
+enum XLU_ConfigValueType xlu_cfg_value_type(const XLU_ConfigValue *value);
+int xlu_cfg_value_get_string(const XLU_Config *cfg,  XLU_ConfigValue *value,
+                             char **value_r, int dont_warn);
+int xlu_cfg_value_get_list(const XLU_Config *cfg, XLU_ConfigValue *value,
+                           XLU_ConfigList **value_r, int dont_warn);
+XLU_ConfigValue *xlu_cfg_get_listitem2(const XLU_ConfigList *list,
+                                       int entry);
+
+/*
+ * Disk specification parsing.
+ */
+
+int xlu_disk_parse(XLU_Config *cfg, int nspecs, const char *const *specs,
+                   libxl_device_disk *disk);
+  /* disk must have been initialised.
+   *
+   * On error, returns errno value.  Bad strings cause EINVAL and
+   * print a message to cfg's report (that's all cfg is used for).
+   *
+   * Normally one would pass nspecs==1 and only specs[0].  But it is
+   * permitted to pass more strings in which case each is parsed as a
+   * string containing a collection of parameters (but they all refer
+   * to of the configuration for a single disk).
+   *
+   * nspecs==0 is permitted but since it does not specify some mandatory
+   * properties, it produces a run-time configuration error if the
+   * resulting disk struct is used with libxl.
+   */
+
+/*
+ * PCI specification parsing
+ */
+int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str);
+
+/*
+ * RDM parsing
+ */
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str);
+
+/*
+ * Vif rate parsing.
+ */
+
+int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate,
+                       libxl_device_nic *nic);
+
+#endif /* LIBXLUTIL_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
new file mode 100644
index 0000000000..874f5abfb9
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg.c
@@ -0,0 +1,712 @@
+/*
+ * libxlu_cfg.c - xl configuration file parsing: setup and helper functions
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#define _GNU_SOURCE
+
+#include <limits.h>
+
+#include "libxlu_internal.h"
+#include "libxlu_cfg_y.h"
+#include "libxlu_cfg_l.h"
+#include "libxlu_cfg_i.h"
+
+XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {
+    XLU_Config *cfg;
+
+    cfg= malloc(sizeof(*cfg));
+    if (!cfg) return 0;
+
+    cfg->report= report;
+    cfg->config_source= strdup(report_source);
+    if (!cfg->config_source) { free(cfg); return 0; }
+
+    cfg->settings= 0;
+    return cfg;
+}
+
+static int ctx_prep(CfgParseContext *ctx, XLU_Config *cfg) {
+    int e;
+
+    ctx->cfg= cfg;
+    ctx->err= 0;
+    ctx->lexerrlineno= -1;
+    ctx->likely_python= 0;
+    ctx->scanner= 0;
+
+    e= xlu__cfg_yylex_init_extra(ctx, &ctx->scanner);
+    if (e) {
+        fprintf(cfg->report,"%s: unable to create scanner: %s\n",
+                cfg->config_source, strerror(e));
+        return e;
+    }
+    return 0;
+}
+
+static void ctx_dispose(CfgParseContext *ctx) {
+    if (ctx->scanner) xlu__cfg_yylex_destroy(ctx->scanner);
+}
+
+static void parse(CfgParseContext *ctx) {
+    /* On return, ctx.err will be updated with the error status. */
+    int r;
+
+    xlu__cfg_yyset_lineno(1, ctx->scanner);
+
+    r= xlu__cfg_yyparse(ctx);
+    if (r) assert(ctx->err);
+
+    if (ctx->err && ctx->likely_python) {
+        fputs(
+ "warning: Config file looks like it contains Python code.\n"
+ "warning:  Arbitrary Python is no longer supported.\n"
+ "warning:  See https://wiki.xen.org/wiki/PythonInXlConfig\n",
+              ctx->cfg->report);
+    }
+}
+
+int xlu_cfg_readfile(XLU_Config *cfg, const char *real_filename) {
+    FILE *f = 0;
+    int e;
+
+    CfgParseContext ctx;
+    e = ctx_prep(&ctx, cfg);
+    if (e) { ctx.err= e; goto xe; }
+
+    f= fopen(real_filename, "r");
+    if (!f) {
+        ctx.err = errno;
+        fprintf(cfg->report,"%s: unable to open configuration file: %s\n",
+                real_filename, strerror(e));
+        goto xe;
+    }
+
+    xlu__cfg_yyrestart(f, ctx.scanner);
+
+    parse(&ctx);
+
+ xe:
+    ctx_dispose(&ctx);
+    if (f) fclose(f);
+
+    return ctx.err;
+}
+
+int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) {
+    int e;
+    YY_BUFFER_STATE buf= 0;
+
+    CfgParseContext ctx;
+    e= ctx_prep(&ctx, cfg);
+    if (e) { ctx.err= e; goto xe; }
+
+    buf = xlu__cfg_yy_scan_bytes(data, length, ctx.scanner);
+    if (!buf) {
+        fprintf(cfg->report,"%s: unable to allocate scanner buffer\n",
+                cfg->config_source);
+        ctx.err= ENOMEM;
+        goto xe;
+    }
+
+    parse(&ctx);
+
+ xe:
+    if (buf) xlu__cfg_yy_delete_buffer(buf, ctx.scanner);
+    ctx_dispose(&ctx);
+
+    return ctx.err;
+}
+
+void xlu__cfg_value_free(XLU_ConfigValue *value)
+{
+    int i;
+
+    if (!value) return;
+
+    switch (value->type) {
+    case XLU_STRING:
+        free(value->u.string);
+        break;
+    case XLU_LIST:
+        for (i = 0; i < value->u.list.nvalues; i++)
+            xlu__cfg_value_free(value->u.list.values[i]);
+        free(value->u.list.values);
+    }
+    free(value);
+}
+
+void xlu__cfg_set_free(XLU_ConfigSetting *set) {
+    if (!set) return;
+    free(set->name);
+    xlu__cfg_value_free(set->value);
+    free(set);
+}
+
+void xlu_cfg_destroy(XLU_Config *cfg) {
+    XLU_ConfigSetting *set, *set_next;
+
+    if (!cfg) return;
+    for (set= cfg->settings;
+         set;
+         set= set_next) {
+        set_next= set->next;
+        xlu__cfg_set_free(set);
+    }
+    free(cfg->config_source);
+    free(cfg);
+}
+
+static XLU_ConfigSetting *find(const XLU_Config *cfg, const char *n) {
+    XLU_ConfigSetting *set;
+
+    for (set= cfg->settings;
+         set;
+         set= set->next)
+        if (!strcmp(set->name, n))
+            return set;
+    return 0;
+}
+
+static int find_atom(const XLU_Config *cfg, const char *n,
+                     XLU_ConfigSetting **set_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+
+    set= find(cfg,n);
+    if (!set) return ESRCH;
+
+    if (set->value->type!=XLU_STRING) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is"
+                    " a list but should be a single value\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    *set_r= set;
+    return 0;
+}
+
+
+enum XLU_ConfigValueType xlu_cfg_value_type(const XLU_ConfigValue *value)
+{
+    return value->type;
+}
+
+int xlu_cfg_value_get_string(const XLU_Config *cfg, XLU_ConfigValue *value,
+                             char **value_r, int dont_warn)
+{
+    if (value->type != XLU_STRING) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d:%d: warning: value is not a string\n",
+                    cfg->config_source, value->loc.first_line,
+                    value->loc.first_column);
+        *value_r = NULL;
+        return EINVAL;
+    }
+
+    *value_r = value->u.string;
+    return 0;
+}
+
+int xlu_cfg_value_get_list(const XLU_Config *cfg, XLU_ConfigValue *value,
+                           XLU_ConfigList **value_r, int dont_warn)
+{
+    if (value->type != XLU_LIST) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d:%d: warning: value is not a list\n",
+                    cfg->config_source, value->loc.first_line,
+                    value->loc.first_column);
+        *value_r = NULL;
+        return EINVAL;
+    }
+
+    *value_r = &value->u.list;
+    return 0;
+}
+
+XLU_ConfigValue *xlu_cfg_get_listitem2(const XLU_ConfigList *list,
+                                       int entry)
+{
+    if (entry < 0 || entry >= list->nvalues) return NULL;
+    return list->values[entry];
+}
+
+int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
+                       const char **value_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    int e;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    *value_r= set->value->u.string;
+    return 0;
+}
+
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    int e;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    free(*value_r);
+    *value_r= strdup(set->value->u.string);
+    return 0;
+}
+
+int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n,
+                             long min, long max, long *value_r,
+                             int dont_warn) {
+    long l;
+    XLU_ConfigSetting *set;
+    int e;
+    char *ep;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    if (set->op == XLU_OP_ADDITION) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: can't use += with numbers"
+                    " for parameter `%s'\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    errno= 0; l= strtol(set->value->u.string, &ep, 0);
+    e= errno;
+    if (errno) {
+        e= errno;
+        assert(e==EINVAL || e==ERANGE);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' could not be parsed"
+                    " as a number: %s\n",
+                    cfg->config_source, set->lineno, n, strerror(e));
+        return e;
+    }
+    if (*ep || ep==set->value->u.string) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is not a valid number\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    if (l < min) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: value `%ld' is smaller than minimum bound '%ld'\n",
+                    cfg->config_source, set->lineno, l, min);
+        return EINVAL;
+    }
+    if (l > max) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: value `%ld' is greater than maximum bound '%ld'\n",
+                    cfg->config_source, set->lineno, l, max);
+        return EINVAL;
+    }
+
+    *value_r= l;
+    return 0;
+}
+
+int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
+                     long *value_r, int dont_warn) {
+    return xlu_cfg_get_bounded_long(cfg, n, LONG_MIN, LONG_MAX, value_r,
+                                    dont_warn);
+}
+
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
+
+int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
+                     XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    set= find(cfg,n);  if (!set) return ESRCH;
+    if (set->value->type!=XLU_LIST) {
+        if (!dont_warn) {
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is a single value"
+                    " but should be a list\n",
+                    cfg->config_source, set->lineno, n);
+        }
+        return EINVAL;
+    }
+    if (list_r) *list_r= &set->value->u.list;
+    if (entries_r) *entries_r= set->value->u.list.nvalues;
+    return 0;
+}
+
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                     libxl_string_list *psl, int dont_warn) {
+    int i, rc, nr;
+    XLU_ConfigList *list;
+    libxl_string_list sl;
+
+    rc = xlu_cfg_get_list(cfg, n, &list, &nr, dont_warn);
+    if (rc)  return rc;
+
+    sl = malloc(sizeof(char*)*(nr + 1));
+    if (sl == NULL) return ENOMEM;
+
+    for (i=0; i<nr; i++) {
+        const char *a = xlu_cfg_get_listitem(list, i);
+        sl[i] = a ? strdup(a) : NULL;
+    }
+
+    sl[nr] = NULL;
+
+    *psl = sl;
+    return 0;
+}
+
+const char *xlu_cfg_get_listitem(const XLU_ConfigList *list, int entry) {
+    if (entry < 0 || entry >= list->nvalues) return 0;
+    if (list->values[entry]->type != XLU_STRING) return 0;
+    return list->values[entry]->u.string;
+}
+
+
+XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx, char *atom,
+                                    YYLTYPE *loc)
+{
+    XLU_ConfigValue *value = NULL;
+
+    if (ctx->err) goto x;
+
+    value = malloc(sizeof(*value));
+    if (!value) goto xe;
+    value->type = XLU_STRING;
+    value->u.string = atom;
+    memcpy(&value->loc, loc, sizeof(*loc));
+
+    return value;
+
+ xe:
+    ctx->err= errno;
+ x:
+    free(value);
+    free(atom);
+    return NULL;
+}
+
+XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx,
+                                  XLU_ConfigValue *val,
+                                  YYLTYPE *loc)
+{
+    XLU_ConfigValue *value = NULL;
+    XLU_ConfigValue **values = NULL;
+
+    if (ctx->err) goto x;
+
+    values = malloc(sizeof(*values));
+    if (!values) goto xe;
+    values[0] = val;
+
+    value = malloc(sizeof(*value));
+    if (!value) goto xe;
+    value->type = XLU_LIST;
+    value->u.list.nvalues = !!val;
+    value->u.list.avalues = 1;
+    value->u.list.values = values;
+    memcpy(&value->loc, loc, sizeof(*loc));
+
+    return value;
+
+ xe:
+    ctx->err= errno;
+ x:
+    free(value);
+    free(values);
+    xlu__cfg_value_free(val);
+    return NULL;
+}
+
+void xlu__cfg_list_append(CfgParseContext *ctx,
+                          XLU_ConfigValue *list,
+                          XLU_ConfigValue *val)
+{
+    if (ctx->err) return;
+
+    assert(val);
+    assert(list->type == XLU_LIST);
+
+    if (list->u.list.nvalues >= list->u.list.avalues) {
+        int new_avalues;
+        XLU_ConfigValue **new_values = NULL;
+
+        if (list->u.list.avalues > INT_MAX / 100) {
+            ctx->err = ERANGE;
+            xlu__cfg_value_free(val);
+            return;
+        }
+
+        new_avalues = list->u.list.avalues * 4;
+        new_values  = realloc(list->u.list.values,
+                              sizeof(*new_values) * new_avalues);
+        if (!new_values) {
+            ctx->err = errno;
+            xlu__cfg_value_free(val);
+            return;
+        }
+
+        list->u.list.avalues = new_avalues;
+        list->u.list.values  = new_values;
+    }
+
+    list->u.list.values[list->u.list.nvalues] = val;
+    list->u.list.nvalues++;
+}
+
+static int xlu__cfg_concat_vals(CfgParseContext *ctx,
+                                XLU_ConfigValue *prev,
+                                XLU_ConfigValue *to_add)
+{
+    int r;
+
+    if (prev->type != to_add->type) {
+        xlu__cfgl_lexicalerror(ctx,
+                           "can't add [list] to \"string\" or vice versa");
+        return EINVAL;
+    }
+
+    switch (to_add->type) {
+    case XLU_STRING: {
+        char *new_string = NULL;
+
+        r = asprintf(&new_string, "%s%s", prev->u.string,
+                     to_add->u.string);
+        if (r < 0) {
+            return errno;
+        }
+        free(to_add->u.string);
+        to_add->u.string = new_string;
+        return 0;
+    }
+    case XLU_LIST: {
+        XLU_ConfigList *const prev_list = &prev->u.list;
+        XLU_ConfigList *const cur_list = &to_add->u.list;
+        int nvalues;
+
+        if (prev->u.list.nvalues > INT_MAX - to_add->u.list.nvalues) {
+            return ERANGE;
+        }
+        nvalues = prev->u.list.nvalues + to_add->u.list.nvalues;
+
+        if (nvalues >= cur_list->avalues) {
+            XLU_ConfigValue **new_vals;
+            new_vals = realloc(cur_list->values,
+                               nvalues * sizeof(*new_vals));
+            if (!new_vals) {
+                return ENOMEM;
+            }
+            cur_list->avalues = nvalues;
+            cur_list->values = new_vals;
+        }
+
+        /* make space for `prev' into `to_add' */
+        memmove(cur_list->values + prev_list->nvalues,
+                cur_list->values,
+                cur_list->nvalues * sizeof(XLU_ConfigValue *));
+        /* move values from `prev' to `to_add' as the list in `prev' will
+         * not be reachable by find(). */
+        memcpy(cur_list->values,
+               prev_list->values,
+               prev_list->nvalues * sizeof(XLU_ConfigValue *));
+        cur_list->nvalues = nvalues;
+        prev_list->nvalues = 0;
+        memset(prev_list->values, 0,
+               prev_list->nvalues * sizeof(XLU_ConfigValue *));
+        return 0;
+    }
+    default:
+        abort();
+    }
+    return -1;
+}
+
+void xlu__cfg_set_store(CfgParseContext *ctx, char *name,
+                        enum XLU_Operation op,
+                        XLU_ConfigValue *val, int lineno) {
+    XLU_ConfigSetting *set;
+    int r;
+
+    if (ctx->err) goto out;
+
+    assert(name);
+
+    if (op == XLU_OP_ADDITION) {
+        /* If we have += concatenate with previous value with same name */
+        XLU_ConfigSetting *prev_set = find(ctx->cfg, name);
+        if (prev_set) {
+            r = xlu__cfg_concat_vals(ctx, prev_set->value, val);
+            if (r) {
+                ctx->err = r;
+                goto out;
+            }
+        }
+    }
+
+    set = malloc(sizeof(*set));
+    if (!set) {
+        ctx->err = errno;
+        goto out;
+    }
+    set->name= name;
+    set->value = val;
+    set->op = op;
+    set->lineno= lineno;
+    set->next= ctx->cfg->settings;
+    ctx->cfg->settings= set;
+    return;
+out:
+    assert(ctx->err);
+    free(name);
+    xlu__cfg_value_free(val);
+}
+
+char *xlu__cfgl_strdup(CfgParseContext *ctx, const char *src) {
+    char *result;
+
+    if (ctx->err) return 0;
+    result= strdup(src);
+    if (!result) ctx->err= errno;
+    return result;
+}
+
+char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) {
+    char *result;
+    const char *p;
+    char *q;
+    int len, c, nc;
+
+    if (ctx->err) return 0;
+
+    len= strlen(src);
+    assert(len>=2 && src[0]==src[len-1]);
+
+    result= malloc(len-1);
+    if (!result) { ctx->err= errno; return 0; }
+
+    q= result;
+
+    for (p= src+1;
+         p < src+len-1;
+         ) {
+        c= *p++;
+        if (c=='\\') {
+            assert(p < src+len-1);
+            nc= *p++;
+            if (nc=='"' || nc=='\'' || nc=='\\') {
+                *q++= nc;
+            } else if (nc=='a') { *q++= '\007';
+            } else if (nc=='b') { *q++= '\010';
+            } else if (nc=='f') { *q++= '\014';
+            } else if (nc=='n') { *q++= '\n';
+            } else if (nc=='r') { *q++= '\r';
+            } else if (nc=='t') { *q++= '\t';
+            } else if (nc=='v') { *q++= '\013';
+            } else if (nc=='x') {
+
+#define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{                        \
+                char numbuf[(maxlen)+1], *ep;                                \
+                unsigned long val;                                           \
+                                                                             \
+                strncpy(numbuf,p,(maxlen));                                  \
+                numbuf[(maxlen)]= 0;                                         \
+                val= strtoul(numbuf, &ep, (base));                           \
+                if (ep <= numbuf+(minlen)) {                                 \
+                    xlu__cfgl_lexicalerror(ctx,"invalid digit after"         \
+                         " backslash " basetext "numerical character escape" \
+                         " in quoted string");                               \
+                    ctx->err= EINVAL;                                        \
+                    goto x;                                                  \
+                }                                                            \
+                p += (ep - numbuf);                                          \
+ }while(0)
+
+                p++;
+                NUMERIC_CHAR(2,2,16,"hex");
+            } else if (nc>='0' && nc<='7') {
+                NUMERIC_CHAR(1,3,10,"octal");
+            } else {
+                xlu__cfgl_lexicalerror(ctx,
+                           "invalid character after backlash in quoted string");
+                ctx->err= EINVAL;
+                goto x;
+            }
+            assert(p <= src+len-1);
+        } else {
+            *q++= c;
+        }
+    }
+
+ x:
+    *q++= 0;
+    return result;
+}
+
+void xlu__cfgl_lexicalerror(CfgParseContext *ctx, char const *msg) {
+    YYLTYPE loc;
+    loc.first_line= xlu__cfg_yyget_lineno(ctx->scanner);
+    xlu__cfg_yyerror(&loc, ctx, msg);
+    ctx->lexerrlineno= loc.first_line;
+}
+
+void xlu__cfg_yyerror(YYLTYPE *loc, CfgParseContext *ctx, char const *msg) {
+    const char *text, *newline;
+    int len, lineno;
+
+    lineno= loc->first_line;
+    if (lineno <= ctx->lexerrlineno) return;
+
+    text= xlu__cfg_yyget_text(ctx->scanner);
+    len= xlu__cfg_yyget_leng(ctx->scanner);
+    newline= "";
+    if (len>0 && text[len-1]=='\n') {
+        len--;
+        lineno--;
+        if (!len) {
+            newline= "<newline>";
+        }
+    }
+    while (len>0 && (text[len-1]=='\t' || text[len-1]==' ')) {
+        len--;
+    }
+
+    fprintf(ctx->cfg->report,
+            "%s:%d: config parsing error near %s%.*s%s%s: %s\n",
+            ctx->cfg->config_source, lineno,
+            len?"`":"", len, text, len?"'":"", newline,
+            msg);
+    if (!ctx->err) ctx->err= EINVAL;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h
new file mode 100644
index 0000000000..4217f5b28d
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg_i.h
@@ -0,0 +1,59 @@
+/*
+ * libxlu_cfg_i.h - xl configuration file parsing: parser-internal declarations
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef LIBXLU_CFG_I_H
+#define LIBXLU_CFG_I_H
+
+#include "libxlu_internal.h"
+#include "libxlu_cfg_y.h"
+
+void xlu__cfg_set_free(XLU_ConfigSetting *set);
+void xlu__cfg_set_store(CfgParseContext*, char *name,
+                        enum XLU_Operation op,
+                        XLU_ConfigValue *val, int lineno);
+XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx,
+                                    char *atom, YYLTYPE *loc);
+XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx,
+                                  XLU_ConfigValue *val,
+                                  YYLTYPE *loc);
+void xlu__cfg_list_append(CfgParseContext *ctx,
+                          XLU_ConfigValue *list,
+                          XLU_ConfigValue *val);
+void xlu__cfg_value_free(XLU_ConfigValue *value);
+char *xlu__cfgl_strdup(CfgParseContext*, const char *src);
+char *xlu__cfgl_dequote(CfgParseContext*, const char *src);
+
+void xlu__cfg_yyerror(YYLTYPE *locp, CfgParseContext*, char const *msg);
+void xlu__cfgl_lexicalerror(CfgParseContext*, char const *msg);
+
+void xlu__cfgl_likely_python(CfgParseContext *ctx);
+
+
+
+/* Why oh why does bison not declare this in its autogenerated .h ? */
+int xlu__cfg_yyparse(CfgParseContext *ctx);
+
+
+#endif /*LIBXLU_CFG_I_H*/
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg_l.c b/tools/libs/util/libxlu_cfg_l.c
new file mode 100644
index 0000000000..406b50a037
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg_l.c
@@ -0,0 +1,2375 @@
+#line 2 "libxlu_cfg_l.c"
+
+#line 4 "libxlu_cfg_l.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+#ifdef yy_create_buffer
+#define xlu__cfg_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer xlu__cfg_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define xlu__cfg_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer xlu__cfg_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define xlu__cfg_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer xlu__cfg_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define xlu__cfg_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string xlu__cfg_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define xlu__cfg_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes xlu__cfg_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define xlu__cfg_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer xlu__cfg_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define xlu__cfg_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer xlu__cfg_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define xlu__cfg_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state xlu__cfg_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define xlu__cfg_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer xlu__cfg_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define xlu__cfg_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state xlu__cfg_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define xlu__cfg_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state xlu__cfg_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define xlu__cfg_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack xlu__cfg_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define xlu__cfg_yylex_ALREADY_DEFINED
+#else
+#define yylex xlu__cfg_yylex
+#endif
+
+#ifdef yyrestart
+#define xlu__cfg_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart xlu__cfg_yyrestart
+#endif
+
+#ifdef yylex_init
+#define xlu__cfg_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init xlu__cfg_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define xlu__cfg_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra xlu__cfg_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define xlu__cfg_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy xlu__cfg_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define xlu__cfg_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug xlu__cfg_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define xlu__cfg_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug xlu__cfg_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define xlu__cfg_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra xlu__cfg_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define xlu__cfg_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra xlu__cfg_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define xlu__cfg_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in xlu__cfg_yyget_in
+#endif
+
+#ifdef yyset_in
+#define xlu__cfg_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in xlu__cfg_yyset_in
+#endif
+
+#ifdef yyget_out
+#define xlu__cfg_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out xlu__cfg_yyget_out
+#endif
+
+#ifdef yyset_out
+#define xlu__cfg_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out xlu__cfg_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define xlu__cfg_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng xlu__cfg_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define xlu__cfg_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text xlu__cfg_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define xlu__cfg_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno xlu__cfg_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define xlu__cfg_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno xlu__cfg_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define xlu__cfg_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column xlu__cfg_yyget_column
+#endif
+
+#ifdef yyset_column
+#define xlu__cfg_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column xlu__cfg_yyset_column
+#endif
+
+#ifdef yywrap
+#define xlu__cfg_yywrap_ALREADY_DEFINED
+#else
+#define yywrap xlu__cfg_yywrap
+#endif
+
+#ifdef yyget_lval
+#define xlu__cfg_yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval xlu__cfg_yyget_lval
+#endif
+
+#ifdef yyset_lval
+#define xlu__cfg_yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval xlu__cfg_yyset_lval
+#endif
+
+#ifdef yyget_lloc
+#define xlu__cfg_yyget_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc xlu__cfg_yyget_lloc
+#endif
+
+#ifdef yyset_lloc
+#define xlu__cfg_yyset_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc xlu__cfg_yyset_lloc
+#endif
+
+#ifdef yyalloc
+#define xlu__cfg_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc xlu__cfg_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define xlu__cfg_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc xlu__cfg_yyrealloc
+#endif
+
+#ifdef yyfree
+#define xlu__cfg_yyfree_ALREADY_DEFINED
+#else
+#define yyfree xlu__cfg_yyfree
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX               (~(size_t)0)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+/* begin standard C++ headers. */
+
+/* TODO: this is always defined, so inline it */
+#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
+#else
+#define yynoreturn
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an
+ *   integer in range [0..255] for use as an array index.
+ */
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+   are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+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
+    
+    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+     *       access to the local variable yy_act. Since yyless() is a macro, it would break
+     *       existing scanners that call yyless() from OUTSIDE yylex.
+     *       One obvious solution it to make yy_act a global. I tried that, and saw
+     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
+     *       normally declared as a register variable-- so it is not worth it.
+     */
+    #define  YY_LESS_LINENO(n) \
+            do { \
+                int yyl;\
+                for ( yyl = n; yyl < yyleng; ++yyl )\
+                    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) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = yyg->yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	int yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int 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
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+
+	};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+                          : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
+
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
+
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
+#define yy_new_buffer yy_create_buffer
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+#define xlu__cfg_yywrap(yyscanner) (/*CONSTCOND*/1)
+#define YY_SKIP_YYWRAP
+typedef flex_uint8_t YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yyg->yytext_ptr = yy_bp; \
+	yyg->yytext_ptr -= yyg->yy_more_len; \
+	yyleng = (int) (yy_cp - yyg->yytext_ptr); \
+	yyg->yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yyg->yy_c_buf_p = yy_cp;
+#define YY_NUM_RULES 17
+#define YY_END_OF_BUFFER 18
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static const flex_int16_t yy_accept[37] =
+    {   0,
+        0,    0,   15,   15,   18,   14,    3,   10,   14,   14,
+       14,   13,   13,    4,    2,    9,    8,    5,    6,    1,
+       15,   15,   16,    0,   12,    0,    0,   10,    0,   11,
+        0,    7,    2,    1,   15,    0
+    } ;
+
+static const YY_CHAR yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    5,    1,    1,    1,    6,    7,
+        7,    1,    8,    9,    7,   10,    1,   11,   11,   11,
+       11,   11,   11,   11,   11,   11,   11,    7,   12,    1,
+       13,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+       14,   15,   16,    1,   17,    1,   18,   18,   18,   18,
+
+       18,   18,   19,   19,   19,   19,   19,   19,   19,   19,
+       19,   19,   19,   19,   19,   19,   19,   19,   19,   18,
+       19,   19,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static const YY_CHAR yy_meta[20] =
+    {   0,
+        1,    2,    3,    1,    1,    1,    1,    1,    1,    4,
+        4,    1,    1,    1,    1,    1,    4,    4,    4
+    } ;
+
+static const flex_int16_t yy_base[43] =
+    {   0,
+        0,    0,   18,   20,   53,   59,   59,   59,   20,   42,
+       19,   59,   19,   59,   15,   59,   59,   59,   59,    0,
+        0,   59,   59,   23,   59,    0,   28,   59,   22,   59,
+        0,   59,   18,    0,    0,   59,   38,   42,   46,   50,
+       26,   54
+    } ;
+
+static const flex_int16_t yy_def[43] =
+    {   0,
+       36,    1,   37,   37,   36,   36,   36,   36,   38,   39,
+       40,   36,   36,   36,   36,   36,   36,   36,   36,   41,
+       42,   36,   36,   38,   36,   38,   39,   36,   40,   36,
+       40,   36,   36,   41,   42,    0,   36,   36,   36,   36,
+       36,   36
+    } ;
+
+static const flex_int16_t yy_nxt[79] =
+    {   0,
+        6,    7,    8,    9,   10,   11,   12,   13,   14,   12,
+       15,   16,   17,   18,    6,   19,    6,   20,   20,   22,
+       23,   22,   23,   25,   30,   33,   25,   30,   33,   34,
+       28,   32,   33,   31,   26,   33,   31,   26,   21,   21,
+       21,   21,   24,   24,   28,   24,   27,   27,   27,   27,
+       29,   29,   36,   29,   35,   36,   36,   35,    5,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36
+    } ;
+
+static const flex_int16_t yy_chk[79] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
+        3,    4,    4,    9,   11,   15,   24,   29,   33,   41,
+       27,   13,   15,   11,    9,   33,   29,   24,   37,   37,
+       37,   37,   38,   38,   10,   38,   39,   39,   39,   39,
+       40,   40,    5,   40,   42,    0,    0,   42,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36
+    } ;
+
+/* Table of booleans, true if rule could match eol. */
+static const flex_int32_t yy_rule_can_match_eol[18] =
+    {   0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,     };
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() (yyg->yy_more_flag = 1)
+#define YY_MORE_ADJ yyg->yy_more_len
+#define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "libxlu_cfg_l.l"
+/* -*- fundamental -*- */
+/*
+ * libxlu_cfg_l.l - xl configuration file parsing: lexer
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+#line 20 "libxlu_cfg_l.l"
+#include "libxlu_cfg_i.h"
+
+#define ctx ((CfgParseContext*)yyextra)
+#define YY_NO_INPUT
+
+#define GOT(x) do{                \
+    yylloc->first_line= yylineno; \
+    return (x);                   \
+  }while(0)
+
+/* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
+ * it to fail to declare these functions, which it defines.  So declare
+ * them ourselves.  Hopefully we won't have to simultaneously support
+ * a flex version which declares these differently somehow. */
+int xlu__cfg_yyget_column(yyscan_t yyscanner);
+void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
+
+#line 740 "libxlu_cfg_l.c"
+
+#line 742 "libxlu_cfg_l.c"
+
+#define INITIAL 0
+#define lexerr 1
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+    {
+
+    /* User-defined. Not touched by flex. */
+    YY_EXTRA_TYPE yyextra_r;
+
+    /* The rest are the same as the globals declared in the non-reentrant scanner. */
+    FILE *yyin_r, *yyout_r;
+    size_t yy_buffer_stack_top; /**< index of top of stack. */
+    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;
+    char *yy_c_buf_p;
+    int yy_init;
+    int yy_start;
+    int yy_did_buffer_switch_on_eof;
+    int yy_start_stack_ptr;
+    int yy_start_stack_depth;
+    int *yy_start_stack;
+    yy_state_type yy_last_accepting_state;
+    char* yy_last_accepting_cpos;
+
+    int yylineno_r;
+    int yy_flex_debug_r;
+
+    char *yytext_r;
+    int yy_more_flag;
+    int yy_more_len;
+
+    YYSTYPE * yylval_r;
+
+    YYLTYPE * yylloc_r;
+
+    }; /* end struct yyguts_t */
+
+static int yy_init_globals ( yyscan_t yyscanner );
+
+    /* This must go here because YYSTYPE and YYLTYPE are included
+     * from bison output in section 1.*/
+    #    define yylval yyg->yylval_r
+    
+    #    define yylloc yyg->yylloc_r
+    
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
+
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
+
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
+
+FILE *yyget_in ( yyscan_t yyscanner );
+
+void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
+
+			int yyget_leng ( yyscan_t yyscanner );
+
+char *yyget_text ( yyscan_t yyscanner );
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+int yyget_column  ( yyscan_t yyscanner );
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+       YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
+    
+        void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
+    
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap ( yyscan_t yyscanner );
+#else
+extern int yywrap ( yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+    
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput ( yyscan_t yyscanner );
+#else
+static int input ( yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		int n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+	yy_state_type yy_current_state;
+	char *yy_cp, *yy_bp;
+	int yy_act;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    yylval = yylval_param;
+
+    yylloc = yylloc_param;
+
+	if ( !yyg->yy_init )
+		{
+		yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yyg->yy_start )
+			yyg->yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			yyensure_buffer_stack (yyscanner);
+			YY_CURRENT_BUFFER_LVALUE =
+				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+		}
+
+		yy_load_buffer_state( yyscanner );
+		}
+
+	{
+#line 53 "libxlu_cfg_l.l"
+
+
+#line 1028 "libxlu_cfg_l.c"
+
+	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
+		{
+		yyg->yy_more_len = 0;
+		if ( yyg->yy_more_flag )
+			{
+			yyg->yy_more_len = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
+			yyg->yy_more_flag = 0;
+			}
+		yy_cp = yyg->yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yyg->yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yyg->yy_start;
+yy_match:
+		do
+			{
+			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;
+				yyg->yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 37 )
+					yy_c = yy_meta[yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+			++yy_cp;
+			}
+		while ( yy_current_state != 36 );
+		yy_cp = yyg->yy_last_accepting_cpos;
+		yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+
+		YY_DO_BEFORE_ACTION;
+
+		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+			{
+			int yyl;
+			for ( yyl = yyg->yy_more_len; yyl < yyleng; ++yyl )
+				if ( yytext[yyl] == '\n' )
+					
+    do{ yylineno++;
+        yycolumn=0;
+    }while(0)
+;
+			}
+
+do_action:	/* This label is used only to access EOF actions. */
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yyg->yy_hold_char;
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 55 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_strdup(ctx,yytext);
+                          GOT(IDENT);
+                        }
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 59 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_strdup(ctx,yytext);
+                          GOT(NUMBER);
+                        }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 64 "libxlu_cfg_l.l"
+
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 66 "libxlu_cfg_l.l"
+{ GOT(','); }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 67 "libxlu_cfg_l.l"
+{ GOT('['); }
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 68 "libxlu_cfg_l.l"
+{ GOT(']'); }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 69 "libxlu_cfg_l.l"
+{ GOT(OP_ADD); }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 70 "libxlu_cfg_l.l"
+{ GOT('='); }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 71 "libxlu_cfg_l.l"
+{ GOT(';'); }
+	YY_BREAK
+case 10:
+/* rule 10 can match eol */
+YY_RULE_SETUP
+#line 73 "libxlu_cfg_l.l"
+{ yylloc->first_line= yylineno-1; return NEWLINE; }
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 75 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_dequote(ctx,yytext);
+                          GOT(STRING);
+                        }
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 79 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_dequote(ctx,yytext);
+                          GOT(STRING);
+                        }
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 84 "libxlu_cfg_l.l"
+{
+                          ctx->likely_python= 1;
+                          BEGIN(lexerr);
+                          yymore();
+                        }
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 90 "libxlu_cfg_l.l"
+{
+                          BEGIN(lexerr);
+                          yymore();
+                        }
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 95 "libxlu_cfg_l.l"
+{
+                          xlu__cfgl_lexicalerror(ctx,"lexical error");
+                          BEGIN(0);
+                        }
+	YY_BREAK
+case 16:
+/* rule 16 can match eol */
+YY_RULE_SETUP
+#line 100 "libxlu_cfg_l.l"
+{
+                          xlu__cfgl_lexicalerror(ctx,"lexical error");
+                          BEGIN(0);
+                          GOT(NEWLINE);
+                        }
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 105 "libxlu_cfg_l.l"
+YY_FATAL_ERROR( "flex scanner jammed" );
+	YY_BREAK
+#line 1212 "libxlu_cfg_l.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(lexerr):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yyg->yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state( yyscanner );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yyg->yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yyg->yy_last_accepting_cpos;
+				yy_current_state = yyg->yy_last_accepting_state;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer( yyscanner ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yyg->yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap( yyscanner ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yyg->yy_c_buf_p =
+					yyg->yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yyg->yy_c_buf_p =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of user's declarations */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	char *source = yyg->yytext_ptr;
+	int number_to_move, i;
+	int ret_val;
+
+	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+	else
+		{
+			int 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_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;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yyrealloc( (void *) b->yy_ch_buf,
+							 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = NULL;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+						number_to_move - 1;
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	if ( yyg->yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin  , yyscanner);
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+		/* "- 2" to take care of EOB's */
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
+	}
+
+	yyg->yy_n_chars += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+	return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+	yy_state_type yy_current_state;
+	char *yy_cp;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_current_state = yyg->yy_start;
+
+	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+		{
+		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yyg->yy_last_accepting_state = yy_current_state;
+			yyg->yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 37 )
+				yy_c = yy_meta[yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+		}
+


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1284.4315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyiT-0000nF-Ud; Thu, 01 Oct 2020 13:33:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1284.4315; Thu, 01 Oct 2020 13:33:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyiT-0000n7-RB; Thu, 01 Oct 2020 13:33:49 +0000
Received: by outflank-mailman (input) for mailman id 1284;
 Thu, 01 Oct 2020 13:33:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyiT-0000my-8s
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7cf9a3b8-5eaf-4b31-84ab-9311b00713e7;
 Thu, 01 Oct 2020 13:33:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyiQ-0006ko-Dx
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyiQ-00036o-D6
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyiT-0000my-8s
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:49 +0000
X-Inumbo-ID: 7cf9a3b8-5eaf-4b31-84ab-9311b00713e7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7cf9a3b8-5eaf-4b31-84ab-9311b00713e7;
	Thu, 01 Oct 2020 13:33:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2cEhHUYQSogi/DqrkuuoEcpnUWp2D9pai2F4waUTBU=; b=FOdA1066zOVy969KPIplPiS6xK
	ooL0LFs21NbFhZ2IYmi7gG1tQP7nZ6R8l2OxLnfcRYlnX24A9jCictbjXx9k7P7Nmjou56qSRE8F/
	EkzTh/8H1horZwv8eUK+gfzxaBCDLfJ5Lw4LnWcdCz1/zwsCCPDRFCyhIIfGhrAUgcJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyiQ-0006ko-Dx
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyiQ-00036o-D6
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs: merge xenctrl_dom.h into xenguest.h
Message-Id: <E1kNyiQ-00036o-D6@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:46 +0000

commit 77a09716f251ac0e35ddd4bfda8f35fe639f432b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:42 2020 +0200

    tools/libs: merge xenctrl_dom.h into xenguest.h
    
    Today xenctrl_dom.h is part of libxenctrl as it is included by
    xc_private.c. This seems not to be needed, so merge xenctrl_dom.h into
    xenguest.h where its contents really should be.
    
    Replace all #includes of xenctrl_dom.h by xenguest.h ones or drop them
    if xenguest.h is already included.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 stubdom/grub/kexec.c                        |   2 +-
 tools/helpers/init-xenstore-domain.c        |   2 +-
 tools/libs/ctrl/Makefile                    |   2 +-
 tools/libs/ctrl/include/xenctrl_dom.h       | 455 ----------------------------
 tools/libs/ctrl/xc_private.c                |   1 -
 tools/libs/guest/include/xenguest.h         | 426 +++++++++++++++++++++++++-
 tools/libs/guest/xg_dom_arm.c               |   1 -
 tools/libs/guest/xg_dom_armzimageloader.c   |   1 -
 tools/libs/guest/xg_dom_binloader.c         |   1 -
 tools/libs/guest/xg_dom_boot.c              |   1 -
 tools/libs/guest/xg_dom_compat_linux.c      |   1 -
 tools/libs/guest/xg_dom_core.c              |   1 -
 tools/libs/guest/xg_dom_decompress.h        |   4 +-
 tools/libs/guest/xg_dom_decompress_unsafe.h |   2 -
 tools/libs/guest/xg_dom_elfloader.c         |   1 -
 tools/libs/guest/xg_dom_hvmloader.c         |   1 -
 tools/libs/guest/xg_dom_x86.c               |   1 -
 tools/libs/guest/xg_offline_page.c          |   1 -
 tools/libs/guest/xg_sr_common.h             |   1 -
 tools/libs/light/libxl_arm.c                |   1 -
 tools/libs/light/libxl_arm.h                |   2 -
 tools/libs/light/libxl_create.c             |   1 -
 tools/libs/light/libxl_dm.c                 |   1 -
 tools/libs/light/libxl_dom.c                |   1 -
 tools/libs/light/libxl_internal.h           |   1 -
 tools/libs/light/libxl_vnuma.c              |   2 -
 tools/libs/light/libxl_x86.c                |   2 -
 tools/libs/light/libxl_x86_acpi.c           |   2 -
 tools/python/xen/lowlevel/xc/xc.c           |   2 +-
 29 files changed, 430 insertions(+), 490 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 24001220a9..e9a69d2a32 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -20,7 +20,7 @@
 #include <sys/mman.h>
 
 #include <xenctrl.h>
-#include <xenctrl_dom.h>
+#include <xenguest.h>
 
 #include <kernel.h>
 #include <console.h>
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 5bdb48dc80..bcaa0e6fa9 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -8,7 +8,7 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <xenctrl.h>
-#include <xenctrl_dom.h>
+#include <xenguest.h>
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index ec93fb5b73..0071226d2a 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -49,7 +49,7 @@ CFLAGS += -include $(XEN_ROOT)/tools/config.h
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
-LIBHEADER := xenctrl.h xenctrl_compat.h xenctrl_dom.h
+LIBHEADER := xenctrl.h xenctrl_compat.h
 PKG_CONFIG := xencontrol.pc
 PKG_CONFIG_NAME := Xencontrol
 
diff --git a/tools/libs/ctrl/include/xenctrl_dom.h b/tools/libs/ctrl/include/xenctrl_dom.h
deleted file mode 100644
index 40b85b7755..0000000000
--- a/tools/libs/ctrl/include/xenctrl_dom.h
+++ /dev/null
@@ -1,455 +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/>.
- */
-
-#ifndef _XC_DOM_H
-#define _XC_DOM_H
-
-#include <xen/libelf/libelf.h>
-
-#define X86_HVM_NR_SPECIAL_PAGES    8
-#define X86_HVM_END_SPECIAL_REGION  0xff000u
-#define XG_MAX_MODULES 2
-
-/* --- typedefs and structs ---------------------------------------- */
-
-typedef uint64_t xen_vaddr_t;
-typedef uint64_t xen_paddr_t;
-
-#define PRIpfn PRI_xen_pfn
-
-struct xc_dom_seg {
-    xen_vaddr_t vstart;
-    xen_vaddr_t vend;
-    xen_pfn_t pfn;
-    xen_pfn_t pages;
-};
-
-struct xc_hvm_firmware_module {
-    uint8_t  *data;
-    uint32_t  length;
-    uint64_t  guest_addr_out;
-};
-
-struct xc_dom_mem {
-    struct xc_dom_mem *next;
-    void *ptr;
-    enum {
-        XC_DOM_MEM_TYPE_MALLOC_INTERNAL,
-        XC_DOM_MEM_TYPE_MALLOC_EXTERNAL,
-        XC_DOM_MEM_TYPE_MMAP,
-    } type;
-    size_t len;
-    unsigned char memory[0];
-};
-
-struct xc_dom_phys {
-    struct xc_dom_phys *next;
-    void *ptr;
-    xen_pfn_t first;
-    xen_pfn_t count;
-};
-
-struct xc_dom_module {
-    void *blob;
-    size_t size;
-    void *cmdline;
-    /* If seg.vstart is non zero then the module will be loaded at that
-     * address, otherwise it will automatically placed.
-     *
-     * If automatic placement is used and the module is gzip
-     * compressed then it will be decompressed as it is loaded. If the
-     * module has been explicitly placed then it is loaded as is
-     * otherwise decompressing risks undoing the manual placement.
-     */
-    struct xc_dom_seg seg;
-};
-
-struct xc_dom_image {
-    /* files */
-    void *kernel_blob;
-    size_t kernel_size;
-    unsigned int num_modules;
-    struct xc_dom_module modules[XG_MAX_MODULES];
-    void *devicetree_blob;
-    size_t devicetree_size;
-
-    size_t max_kernel_size;
-    size_t max_module_size;
-    size_t max_devicetree_size;
-
-    /* arguments and parameters */
-    char *cmdline;
-    size_t cmdline_size;
-    uint32_t f_requested[XENFEAT_NR_SUBMAPS];
-
-    /* info from (elf) kernel image */
-    struct elf_dom_parms parms;
-    char *guest_type;
-
-    /* memory layout */
-    struct xc_dom_seg kernel_seg;
-    struct xc_dom_seg p2m_seg;
-    struct xc_dom_seg pgtables_seg;
-    struct xc_dom_seg devicetree_seg;
-    struct xc_dom_seg start_info_seg;
-    xen_pfn_t start_info_pfn;
-    xen_pfn_t console_pfn;
-    xen_pfn_t xenstore_pfn;
-    xen_pfn_t shared_info_pfn;
-    xen_pfn_t bootstack_pfn;
-    xen_pfn_t pfn_alloc_end;
-    xen_vaddr_t virt_alloc_end;
-    xen_vaddr_t bsd_symtab_start;
-
-    /*
-     * initrd parameters as specified in start_info page
-     * Depending on capabilities of the booted kernel this may be a virtual
-     * address or a pfn. Type is neutral and large enough to hold a virtual
-     * address of a 64 bit kernel even with 32 bit toolstack.
-     */
-    uint64_t initrd_start;
-    uint64_t initrd_len;
-
-    unsigned int alloc_bootstack;
-    xen_vaddr_t virt_pgtab_end;
-
-    /* other state info */
-    uint32_t f_active[XENFEAT_NR_SUBMAPS];
-
-    /*
-     * pv_p2m is specific to x86 PV guests, and maps GFNs to MFNs.  It is
-     * eventually copied into guest context.
-     */
-    xen_pfn_t *pv_p2m;
-
-    /* physical memory
-     *
-     * An x86 PV guest has one or more blocks of physical RAM,
-     * consisting of total_pages starting at 0. The start address and
-     * size of each block is controlled by vNUMA structures.
-     *
-     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
-     * rambank_size[i] pages in each. The lowest RAM address
-     * (corresponding to the base of the p2m arrays above) is stored
-     * in rambase_pfn.
-     */
-    xen_pfn_t rambase_pfn;
-    xen_pfn_t total_pages;
-    xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
-    struct xc_dom_phys *phys_pages;
-#if defined (__arm__) || defined(__aarch64__)
-    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
-#endif
-
-    /* malloc memory pool */
-    struct xc_dom_mem *memblocks;
-
-    /* memory footprint stats */
-    size_t alloc_malloc;
-    size_t alloc_mem_map;
-    size_t alloc_file_map;
-    size_t alloc_domU_map;
-
-    /* misc xen domain config stuff */
-    unsigned long flags;
-    unsigned int console_evtchn;
-    unsigned int xenstore_evtchn;
-    uint32_t console_domid;
-    uint32_t xenstore_domid;
-    xen_pfn_t shared_info_mfn;
-
-    xc_interface *xch;
-    uint32_t guest_domid;
-    int claim_enabled; /* 0 by default, 1 enables it */
-
-    int xen_version;
-    xen_capabilities_info_t xen_caps;
-
-    /* kernel loader, arch hooks */
-    struct xc_dom_loader *kernel_loader;
-    void *private_loader;
-
-    /* vNUMA information */
-    xen_vmemrange_t *vmemranges;
-    unsigned int nr_vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vnodes;
-
-    /* domain type/architecture specific data */
-    void *arch_private;
-
-    /* kernel loader */
-    struct xc_dom_arch *arch_hooks;
-    /* allocate up to pfn_alloc_end */
-    int (*allocate) (struct xc_dom_image * dom);
-
-    /* Container type (HVM or PV). */
-    enum {
-        XC_DOM_PV_CONTAINER,
-        XC_DOM_HVM_CONTAINER,
-    } container_type;
-
-    /* HVM specific fields. */
-    xen_pfn_t target_pages;
-    xen_paddr_t mmio_start;
-    xen_paddr_t mmio_size;
-    xen_paddr_t lowmem_end;
-    xen_paddr_t highmem_end;
-    xen_pfn_t vga_hole_size;
-
-    /* If unset disables the setup of the IOREQ pages. */
-    bool device_model;
-
-    /* BIOS/Firmware passed to HVMLOADER */
-    struct xc_hvm_firmware_module system_firmware_module;
-
-    /* Extra ACPI tables */
-#define MAX_ACPI_MODULES        4
-    struct xc_hvm_firmware_module acpi_modules[MAX_ACPI_MODULES];
-
-    /* Extra SMBIOS structures passed to HVMLOADER */
-    struct xc_hvm_firmware_module smbios_module;
-
-#if defined(__i386__) || defined(__x86_64__)
-    struct e820entry *e820;
-    unsigned int e820_entries;
-#endif
-
-    xen_pfn_t vuart_gfn;
-
-    /* Number of vCPUs */
-    unsigned int max_vcpus;
-};
-
-/* --- pluggable kernel loader ------------------------------------- */
-
-struct xc_dom_loader {
-    char *name;
-    /* Sadly the error returns from these functions are not consistent: */
-    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
-    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
-    elf_errorstatus (*loader) (struct xc_dom_image * dom);
-
-    struct xc_dom_loader *next;
-};
-
-#define __init __attribute__ ((constructor))
-void xc_dom_register_loader(struct xc_dom_loader *loader);
-
-/* --- arch specific hooks ----------------------------------------- */
-
-struct xc_dom_arch {
-    int (*alloc_magic_pages) (struct xc_dom_image * dom);
-
-    /* pagetable setup - x86 PV only */
-    int (*alloc_pgtables) (struct xc_dom_image * dom);
-    int (*alloc_p2m_list) (struct xc_dom_image * dom);
-    int (*setup_pgtables) (struct xc_dom_image * dom);
-
-    /* arch-specific data structs setup */
-    /* in Mini-OS environment start_info might be a macro, avoid collision. */
-#undef start_info
-    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);
-    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);
-
-    char *guest_type;
-    char *native_protocol;
-    int page_shift;
-    int sizeof_pfn;
-    int p2m_base_supported;
-    int arch_private_size;
-
-    struct xc_dom_arch *next;
-};
-void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
-
-#define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
-#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
-
-/* --- main functions ---------------------------------------------- */
-
-struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
-                                     const char *cmdline, const char *features);
-void xc_dom_release_phys(struct xc_dom_image *dom);
-void xc_dom_release(struct xc_dom_image *dom);
-int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase);
-int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
-
-/* Set this larger if you have enormous modules/kernels. Note that
- * you should trust all kernels not to be maliciously large (e.g. to
- * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
- * XSA-25). You can also set the default independently for
- * modules/kernels in xc_dom_allocate() or call
- * xc_dom_{kernel,module}_max_size.
- */
-#ifndef XC_DOM_DECOMPRESS_MAX
-#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
-#endif
-
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_module_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_devicetree_max_size(struct xc_dom_image *dom, size_t sz);
-
-size_t xc_dom_check_gzip(xc_interface *xch,
-                     void *blob, size_t ziplen);
-int xc_dom_do_gunzip(xc_interface *xch,
-                     void *src, size_t srclen, void *dst, size_t dstlen);
-int xc_dom_try_gunzip(struct xc_dom_image *dom, void **blob, size_t * size);
-
-int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename);
-int xc_dom_module_file(struct xc_dom_image *dom, const char *filename,
-                       const char *cmdline);
-int xc_dom_kernel_mem(struct xc_dom_image *dom, const void *mem,
-                      size_t memsize);
-int xc_dom_module_mem(struct xc_dom_image *dom, const void *mem,
-                       size_t memsize, const char *cmdline);
-int xc_dom_devicetree_file(struct xc_dom_image *dom, const char *filename);
-int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
-                          size_t memsize);
-
-int xc_dom_parse_image(struct xc_dom_image *dom);
-int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
-int xc_dom_build_image(struct xc_dom_image *dom);
-
-int xc_dom_boot_xen_init(struct xc_dom_image *dom, xc_interface *xch,
-                         uint32_t domid);
-int xc_dom_boot_mem_init(struct xc_dom_image *dom);
-void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
-                           xen_pfn_t count);
-int xc_dom_boot_image(struct xc_dom_image *dom);
-int xc_dom_compat_check(struct xc_dom_image *dom);
-int xc_dom_gnttab_init(struct xc_dom_image *dom);
-int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
-                       bool is_hvm,
-                       xen_pfn_t console_gfn,
-                       xen_pfn_t xenstore_gfn,
-                       uint32_t console_domid,
-                       uint32_t xenstore_domid);
-bool xc_dom_translated(const struct xc_dom_image *dom);
-
-/* --- debugging bits ---------------------------------------------- */
-
-int xc_dom_loginit(xc_interface *xch);
-
-void xc_dom_printf(xc_interface *xch, const char *fmt, ...)
-     __attribute__ ((format(printf, 2, 3)));
-void xc_dom_panic_func(xc_interface *xch,
-                      const char *file, int line, xc_error_code err,
-                      const char *fmt, ...)
-    __attribute__ ((format(printf, 5, 6)));
-
-#define xc_dom_panic(xch, err, fmt, args...) \
-    xc_dom_panic_func(xch, __FILE__, __LINE__, err, fmt, ## args)
-#define xc_dom_trace(mark) \
-    xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark)
-
-void xc_dom_log_memory_footprint(struct xc_dom_image *dom);
-
-/* --- simple memory pool ------------------------------------------ */
-
-void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
-int xc_dom_register_external(struct xc_dom_image *dom, void *ptr, size_t size);
-void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
-void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size);
-char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
-
-/* --- alloc memory pool ------------------------------------------- */
-
-xen_pfn_t xc_dom_alloc_page(struct xc_dom_image *dom, char *name);
-int xc_dom_alloc_segment(struct xc_dom_image *dom,
-                         struct xc_dom_seg *seg, char *name,
-                         xen_vaddr_t start, xen_vaddr_t size);
-
-/* --- misc bits --------------------------------------------------- */
-
-void *xc_dom_pfn_to_ptr(struct xc_dom_image *dom, xen_pfn_t first,
-                        xen_pfn_t count);
-void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
-                                 xen_pfn_t count, xen_pfn_t *count_out);
-void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
-void xc_dom_unmap_all(struct xc_dom_image *dom);
-
-static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
-                                      struct xc_dom_seg *seg,
-                                      xen_pfn_t *pages_out)
-{
-    void *retval;
-
-    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
-
-    *pages_out = retval ? seg->pages : 0;
-    return retval;
-}
-
-static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
-                                      struct xc_dom_seg *seg)
-{
-    xen_pfn_t dummy;
-
-    return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
-}
-
-static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
-                                        xen_vaddr_t vaddr,
-                                        size_t *safe_region_out)
-{
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
-    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
-    xen_pfn_t safe_region_count;
-    void *ptr;
-
-    *safe_region_out = 0;
-    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
-    if ( ptr == NULL )
-        return ptr;
-    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr + offset;
-}
-
-static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
-{
-    if ( xc_dom_translated(dom) )
-        return pfn;
-
-    /* x86 PV only now. */
-    if ( pfn >= dom->total_pages )
-        return INVALID_MFN;
-
-    return dom->pv_p2m[pfn];
-}
-
-#endif /* _XC_DOM_H */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index 3fab94f9c0..d94f846686 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -18,7 +18,6 @@
  */
 
 #include "xc_private.h"
-#include "xenctrl_dom.h"
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index 4643384790..279f06345c 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -22,7 +22,7 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
-#include <xenctrl_dom.h>
+#include <xen/libelf/libelf.h>
 
 #define XC_NUMA_NO_NODE   (~0U)
 
@@ -32,6 +32,430 @@
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
 
+#define X86_HVM_NR_SPECIAL_PAGES    8
+#define X86_HVM_END_SPECIAL_REGION  0xff000u
+#define XG_MAX_MODULES 2
+
+/* --- typedefs and structs ---------------------------------------- */
+
+typedef uint64_t xen_vaddr_t;
+typedef uint64_t xen_paddr_t;
+
+#define PRIpfn PRI_xen_pfn
+
+struct xc_dom_seg {
+    xen_vaddr_t vstart;
+    xen_vaddr_t vend;
+    xen_pfn_t pfn;
+    xen_pfn_t pages;
+};
+
+struct xc_hvm_firmware_module {
+    uint8_t  *data;
+    uint32_t  length;
+    uint64_t  guest_addr_out;
+};
+
+struct xc_dom_mem {
+    struct xc_dom_mem *next;
+    void *ptr;
+    enum {
+        XC_DOM_MEM_TYPE_MALLOC_INTERNAL,
+        XC_DOM_MEM_TYPE_MALLOC_EXTERNAL,
+        XC_DOM_MEM_TYPE_MMAP,
+    } type;
+    size_t len;
+    unsigned char memory[0];
+};
+
+struct xc_dom_phys {
+    struct xc_dom_phys *next;
+    void *ptr;
+    xen_pfn_t first;
+    xen_pfn_t count;
+};
+
+struct xc_dom_module {
+    void *blob;
+    size_t size;
+    void *cmdline;
+    /* If seg.vstart is non zero then the module will be loaded at that
+     * address, otherwise it will automatically placed.
+     *
+     * If automatic placement is used and the module is gzip
+     * compressed then it will be decompressed as it is loaded. If the
+     * module has been explicitly placed then it is loaded as is
+     * otherwise decompressing risks undoing the manual placement.
+     */
+    struct xc_dom_seg seg;
+};
+
+struct xc_dom_image {
+    /* files */
+    void *kernel_blob;
+    size_t kernel_size;
+    unsigned int num_modules;
+    struct xc_dom_module modules[XG_MAX_MODULES];
+    void *devicetree_blob;
+    size_t devicetree_size;
+
+    size_t max_kernel_size;
+    size_t max_module_size;
+    size_t max_devicetree_size;
+
+    /* arguments and parameters */
+    char *cmdline;
+    size_t cmdline_size;
+    uint32_t f_requested[XENFEAT_NR_SUBMAPS];
+
+    /* info from (elf) kernel image */
+    struct elf_dom_parms parms;
+    char *guest_type;
+
+    /* memory layout */
+    struct xc_dom_seg kernel_seg;
+    struct xc_dom_seg p2m_seg;
+    struct xc_dom_seg pgtables_seg;
+    struct xc_dom_seg devicetree_seg;
+    struct xc_dom_seg start_info_seg;
+    xen_pfn_t start_info_pfn;
+    xen_pfn_t console_pfn;
+    xen_pfn_t xenstore_pfn;
+    xen_pfn_t shared_info_pfn;
+    xen_pfn_t bootstack_pfn;
+    xen_pfn_t pfn_alloc_end;
+    xen_vaddr_t virt_alloc_end;
+    xen_vaddr_t bsd_symtab_start;
+
+    /*
+     * initrd parameters as specified in start_info page
+     * Depending on capabilities of the booted kernel this may be a virtual
+     * address or a pfn. Type is neutral and large enough to hold a virtual
+     * address of a 64 bit kernel even with 32 bit toolstack.
+     */
+    uint64_t initrd_start;
+    uint64_t initrd_len;
+
+    unsigned int alloc_bootstack;
+    xen_vaddr_t virt_pgtab_end;
+
+    /* other state info */
+    uint32_t f_active[XENFEAT_NR_SUBMAPS];
+
+    /*
+     * pv_p2m is specific to x86 PV guests, and maps GFNs to MFNs.  It is
+     * eventually copied into guest context.
+     */
+    xen_pfn_t *pv_p2m;
+
+    /* physical memory
+     *
+     * An x86 PV guest has one or more blocks of physical RAM,
+     * consisting of total_pages starting at 0. The start address and
+     * size of each block is controlled by vNUMA structures.
+     *
+     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
+     * rambank_size[i] pages in each. The lowest RAM address
+     * (corresponding to the base of the p2m arrays above) is stored
+     * in rambase_pfn.
+     */
+    xen_pfn_t rambase_pfn;
+    xen_pfn_t total_pages;
+    xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
+    struct xc_dom_phys *phys_pages;
+#if defined (__arm__) || defined(__aarch64__)
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+#endif
+
+    /* malloc memory pool */
+    struct xc_dom_mem *memblocks;
+
+    /* memory footprint stats */
+    size_t alloc_malloc;
+    size_t alloc_mem_map;
+    size_t alloc_file_map;
+    size_t alloc_domU_map;
+
+    /* misc xen domain config stuff */
+    unsigned long flags;
+    unsigned int console_evtchn;
+    unsigned int xenstore_evtchn;
+    uint32_t console_domid;
+    uint32_t xenstore_domid;
+    xen_pfn_t shared_info_mfn;
+
+    xc_interface *xch;
+    uint32_t guest_domid;
+    int claim_enabled; /* 0 by default, 1 enables it */
+
+    int xen_version;
+    xen_capabilities_info_t xen_caps;
+
+    /* kernel loader, arch hooks */
+    struct xc_dom_loader *kernel_loader;
+    void *private_loader;
+
+    /* vNUMA information */
+    xen_vmemrange_t *vmemranges;
+    unsigned int nr_vmemranges;
+    unsigned int *vnode_to_pnode;
+    unsigned int nr_vnodes;
+
+    /* domain type/architecture specific data */
+    void *arch_private;
+
+    /* kernel loader */
+    struct xc_dom_arch *arch_hooks;
+    /* allocate up to pfn_alloc_end */
+    int (*allocate) (struct xc_dom_image * dom);
+
+    /* Container type (HVM or PV). */
+    enum {
+        XC_DOM_PV_CONTAINER,
+        XC_DOM_HVM_CONTAINER,
+    } container_type;
+
+    /* HVM specific fields. */
+    xen_pfn_t target_pages;
+    xen_paddr_t mmio_start;
+    xen_paddr_t mmio_size;
+    xen_paddr_t lowmem_end;
+    xen_paddr_t highmem_end;
+    xen_pfn_t vga_hole_size;
+
+    /* If unset disables the setup of the IOREQ pages. */
+    bool device_model;
+
+    /* BIOS/Firmware passed to HVMLOADER */
+    struct xc_hvm_firmware_module system_firmware_module;
+
+    /* Extra ACPI tables */
+#define MAX_ACPI_MODULES        4
+    struct xc_hvm_firmware_module acpi_modules[MAX_ACPI_MODULES];
+
+    /* Extra SMBIOS structures passed to HVMLOADER */
+    struct xc_hvm_firmware_module smbios_module;
+
+#if defined(__i386__) || defined(__x86_64__)
+    struct e820entry *e820;
+    unsigned int e820_entries;
+#endif
+
+    xen_pfn_t vuart_gfn;
+
+    /* Number of vCPUs */
+    unsigned int max_vcpus;
+};
+
+/* --- pluggable kernel loader ------------------------------------- */
+
+struct xc_dom_loader {
+    char *name;
+    /* Sadly the error returns from these functions are not consistent: */
+    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+    elf_errorstatus (*loader) (struct xc_dom_image * dom);
+
+    struct xc_dom_loader *next;
+};
+
+#define __init __attribute__ ((constructor))
+void xc_dom_register_loader(struct xc_dom_loader *loader);
+
+/* --- arch specific hooks ----------------------------------------- */
+
+struct xc_dom_arch {
+    int (*alloc_magic_pages) (struct xc_dom_image * dom);
+
+    /* pagetable setup - x86 PV only */
+    int (*alloc_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_p2m_list) (struct xc_dom_image * dom);
+    int (*setup_pgtables) (struct xc_dom_image * dom);
+
+    /* arch-specific data structs setup */
+    /* in Mini-OS environment start_info might be a macro, avoid collision. */
+#undef start_info
+    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);
+    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);
+
+    char *guest_type;
+    char *native_protocol;
+    int page_shift;
+    int sizeof_pfn;
+    int p2m_base_supported;
+    int arch_private_size;
+
+    struct xc_dom_arch *next;
+};
+void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
+
+#define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
+#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
+
+/* --- main functions ---------------------------------------------- */
+
+struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
+                                     const char *cmdline, const char *features);
+void xc_dom_release_phys(struct xc_dom_image *dom);
+void xc_dom_release(struct xc_dom_image *dom);
+int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase);
+int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
+
+/* Set this larger if you have enormous modules/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * modules/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,module}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_module_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_devicetree_max_size(struct xc_dom_image *dom, size_t sz);
+
+size_t xc_dom_check_gzip(xc_interface *xch,
+                     void *blob, size_t ziplen);
+int xc_dom_do_gunzip(xc_interface *xch,
+                     void *src, size_t srclen, void *dst, size_t dstlen);
+int xc_dom_try_gunzip(struct xc_dom_image *dom, void **blob, size_t * size);
+
+int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename);
+int xc_dom_module_file(struct xc_dom_image *dom, const char *filename,
+                       const char *cmdline);
+int xc_dom_kernel_mem(struct xc_dom_image *dom, const void *mem,
+                      size_t memsize);
+int xc_dom_module_mem(struct xc_dom_image *dom, const void *mem,
+                       size_t memsize, const char *cmdline);
+int xc_dom_devicetree_file(struct xc_dom_image *dom, const char *filename);
+int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
+                          size_t memsize);
+
+int xc_dom_parse_image(struct xc_dom_image *dom);
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
+int xc_dom_build_image(struct xc_dom_image *dom);
+
+int xc_dom_boot_xen_init(struct xc_dom_image *dom, xc_interface *xch,
+                         uint32_t domid);
+int xc_dom_boot_mem_init(struct xc_dom_image *dom);
+void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
+                           xen_pfn_t count);
+int xc_dom_boot_image(struct xc_dom_image *dom);
+int xc_dom_compat_check(struct xc_dom_image *dom);
+int xc_dom_gnttab_init(struct xc_dom_image *dom);
+int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
+                       bool is_hvm,
+                       xen_pfn_t console_gfn,
+                       xen_pfn_t xenstore_gfn,
+                       uint32_t console_domid,
+                       uint32_t xenstore_domid);
+bool xc_dom_translated(const struct xc_dom_image *dom);
+
+/* --- debugging bits ---------------------------------------------- */
+
+int xc_dom_loginit(xc_interface *xch);
+
+void xc_dom_printf(xc_interface *xch, const char *fmt, ...)
+     __attribute__ ((format(printf, 2, 3)));
+void xc_dom_panic_func(xc_interface *xch,
+                      const char *file, int line, xc_error_code err,
+                      const char *fmt, ...)
+    __attribute__ ((format(printf, 5, 6)));
+
+#define xc_dom_panic(xch, err, fmt, args...) \
+    xc_dom_panic_func(xch, __FILE__, __LINE__, err, fmt, ## args)
+#define xc_dom_trace(mark) \
+    xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark)
+
+void xc_dom_log_memory_footprint(struct xc_dom_image *dom);
+
+/* --- simple memory pool ------------------------------------------ */
+
+void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
+int xc_dom_register_external(struct xc_dom_image *dom, void *ptr, size_t size);
+void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
+void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
+                            const char *filename, size_t * size,
+                            const size_t max_size);
+char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
+
+/* --- alloc memory pool ------------------------------------------- */
+
+xen_pfn_t xc_dom_alloc_page(struct xc_dom_image *dom, char *name);
+int xc_dom_alloc_segment(struct xc_dom_image *dom,
+                         struct xc_dom_seg *seg, char *name,
+                         xen_vaddr_t start, xen_vaddr_t size);
+
+/* --- misc bits --------------------------------------------------- */
+
+void *xc_dom_pfn_to_ptr(struct xc_dom_image *dom, xen_pfn_t first,
+                        xen_pfn_t count);
+void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
+                                 xen_pfn_t count, xen_pfn_t *count_out);
+void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
+void xc_dom_unmap_all(struct xc_dom_image *dom);
+
+static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
+                                      struct xc_dom_seg *seg,
+                                      xen_pfn_t *pages_out)
+{
+    void *retval;
+
+    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
+
+    *pages_out = retval ? seg->pages : 0;
+    return retval;
+}
+
+static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
+                                      struct xc_dom_seg *seg)
+{
+    xen_pfn_t dummy;
+
+    return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
+}
+
+static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                                        xen_vaddr_t vaddr,
+                                        size_t *safe_region_out)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
+    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
+    xen_pfn_t safe_region_count;
+    void *ptr;
+
+    *safe_region_out = 0;
+    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
+    if ( ptr == NULL )
+        return ptr;
+    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
+    return ptr + offset;
+}
+
+static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
+{
+    if ( xc_dom_translated(dom) )
+        return pfn;
+
+    /* x86 PV only now. */
+    if ( pfn >= dom->total_pages )
+        return INVALID_MFN;
+
+    return dom->pv_p2m[pfn];
+}
+
 /*
  * User not using xc_suspend_* / xc_await_suspent may not want to
  * include the full libxenevtchn API here.
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 3f66f1d890..615fc109b9 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -24,7 +24,6 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #define NR_MAGIC_PAGES 4
 #define CONSOLE_PFN_OFFSET 0
diff --git a/tools/libs/guest/xg_dom_armzimageloader.c b/tools/libs/guest/xg_dom_armzimageloader.c
index 4246c8e5fa..ec42036ad2 100644
--- a/tools/libs/guest/xg_dom_armzimageloader.c
+++ b/tools/libs/guest/xg_dom_armzimageloader.c
@@ -25,7 +25,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #include <arpa/inet.h> /* XXX ntohl is not the right function... */
 
diff --git a/tools/libs/guest/xg_dom_binloader.c b/tools/libs/guest/xg_dom_binloader.c
index 870a921427..ccc23b388f 100644
--- a/tools/libs/guest/xg_dom_binloader.c
+++ b/tools/libs/guest/xg_dom_binloader.c
@@ -83,7 +83,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE_X86-1))&PAGE_MASK_X86)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK_X86)
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 1e31e92244..827f1ffccd 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -31,7 +31,6 @@
 #include <zlib.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
diff --git a/tools/libs/guest/xg_dom_compat_linux.c b/tools/libs/guest/xg_dom_compat_linux.c
index b645f0b14b..a0d9c7a04e 100644
--- a/tools/libs/guest/xg_dom_compat_linux.c
+++ b/tools/libs/guest/xg_dom_compat_linux.c
@@ -30,7 +30,6 @@
 
 #include "xenctrl.h"
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 /* ------------------------------------------------------------------------ */
 
diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index 1c91cce315..c0d4a0aa2f 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -32,7 +32,6 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "_paths.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_dom_decompress.h b/tools/libs/guest/xg_dom_decompress.h
index c5ab2e59eb..d7a45f730d 100644
--- a/tools/libs/guest/xg_dom_decompress.h
+++ b/tools/libs/guest/xg_dom_decompress.h
@@ -1,6 +1,4 @@
-#ifndef __MINIOS__
-# include "xenctrl_dom.h"
-#else
+#ifdef __MINIOS__
 # include "xg_dom_decompress_unsafe.h"
 #endif
 
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
index fb84b6add8..5dc18c896e 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ b/tools/libs/guest/xg_dom_decompress_unsafe.h
@@ -1,5 +1,3 @@
-#include "xenctrl_dom.h"
-
 typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
                           int (*fill)(void*, unsigned int),
                           int (*flush)(void*, unsigned int),
diff --git a/tools/libs/guest/xg_dom_elfloader.c b/tools/libs/guest/xg_dom_elfloader.c
index 7043c3bbba..851930f039 100644
--- a/tools/libs/guest/xg_dom_elfloader.c
+++ b/tools/libs/guest/xg_dom_elfloader.c
@@ -26,7 +26,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #define XEN_VER "xen-3.0"
diff --git a/tools/libs/guest/xg_dom_hvmloader.c b/tools/libs/guest/xg_dom_hvmloader.c
index 995a0f3dc3..f3deedec41 100644
--- a/tools/libs/guest/xg_dom_hvmloader.c
+++ b/tools/libs/guest/xg_dom_hvmloader.c
@@ -26,7 +26,6 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index 842dbcccdd..876802e2ed 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -38,7 +38,6 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xenctrl.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_offline_page.c b/tools/libs/guest/xg_offline_page.c
index 77e8889b11..d4722f0e8c 100644
--- a/tools/libs/guest/xg_offline_page.c
+++ b/tools/libs/guest/xg_offline_page.c
@@ -28,7 +28,6 @@
 #include <xc_core.h>
 
 #include "xc_private.h"
-#include "xenctrl_dom.h"
 #include "xg_private.h"
 #include "xg_save_restore.h"
 
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 13fcc47420..cc3ad1c394 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -5,7 +5,6 @@
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #include "xg_sr_stream_format.h"
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 975a4d730a..66e8a065fe 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -3,7 +3,6 @@
 #include "libxl_libfdt_compat.h"
 #include "libxl_arm.h"
 
-#include <xenctrl_dom.h>
 #include <stdbool.h>
 #include <libfdt.h>
 #include <assert.h>
diff --git a/tools/libs/light/libxl_arm.h b/tools/libs/light/libxl_arm.h
index 52c2ab5e3a..4feca217ee 100644
--- a/tools/libs/light/libxl_arm.h
+++ b/tools/libs/light/libxl_arm.h
@@ -17,8 +17,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
-
 _hidden
 int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
                         struct xc_dom_image *dom);
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 1031b75159..9a6e92b3a5 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -20,7 +20,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/e820.h>
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index fec4e0fbe5..a944181781 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -19,7 +19,6 @@
 
 #include "libxl_internal.h"
 
-#include <xenctrl_dom.h>
 #include <xen/hvm/e820.h>
 #include <sys/types.h>
 #include <pwd.h>
diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index 597a6826d1..01d989a976 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -20,7 +20,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 1fcf85c3e2..e26cda9b50 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -57,7 +57,6 @@
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xenhypfs.h>
-#include <xenctrl_dom.h>
 
 #include <xen-tools/libs.h>
 
diff --git a/tools/libs/light/libxl_vnuma.c b/tools/libs/light/libxl_vnuma.c
index c2e144ceae..d181574782 100644
--- a/tools/libs/light/libxl_vnuma.c
+++ b/tools/libs/light/libxl_vnuma.c
@@ -17,8 +17,6 @@
 #include "libxl_arch.h"
 #include <stdlib.h>
 
-#include <xenctrl_dom.h>
-
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
 {
     return b_info->num_vnuma_nodes != 0;
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 7d95506e00..6ec6c27c83 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -1,8 +1,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
-
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       struct xen_domctl_createdomain *config)
diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi.c
index 3df86c7be5..1a4e9e98de 100644
--- a/tools/libs/light/libxl_x86_acpi.c
+++ b/tools/libs/light/libxl_x86_acpi.c
@@ -18,8 +18,6 @@
 #include <xen/hvm/e820.h>
 #include "libacpi/libacpi.h"
 
-#include <xenctrl_dom.h>
-
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index ce123f0409..13a7603809 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -7,6 +7,7 @@
 #include <Python.h>
 #define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
+#include <xenguest.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -17,7 +18,6 @@
 #include <arpa/inet.h>
 
 #include <xen/elfnote.h>
-#include "xenctrl_dom.h"
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/params.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:33:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1285.4319 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyic-0000pE-1S; Thu, 01 Oct 2020 13:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1285.4319; Thu, 01 Oct 2020 13:33:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyib-0000p6-UT; Thu, 01 Oct 2020 13:33:57 +0000
Received: by outflank-mailman (input) for mailman id 1285;
 Thu, 01 Oct 2020 13:33:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyib-0000oz-CY
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7a425167-da2e-48c3-a865-5531637f89e1;
 Thu, 01 Oct 2020 13:33:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyia-0006kt-HI
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyia-000380-GJ
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyib-0000oz-CY
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:57 +0000
X-Inumbo-ID: 7a425167-da2e-48c3-a865-5531637f89e1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7a425167-da2e-48c3-a865-5531637f89e1;
	Thu, 01 Oct 2020 13:33:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QlzVY0deHsRg6dzU3bQmXQO8hCk1XyxUzsNt6it9AT4=; b=2pBFvHz7VKFOJwlw4jobYfeVW5
	LXMGARi1OZHkX0Gve6FrDV0vfa6FtEVoM2B8Zedxxc5+d2gWQV7vNR8FjhKAfnsAtVJkPmTJy2pGC
	Il8ZkH88q7vr7x32cVMBqzpc1EpvU0loQWRMNPfmdSho0DMetwChMVrY5y8/TgOjz0vs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyia-0006kt-HI
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyia-000380-GJ
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:33:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxenguest: make xc_dom_loader interface private to libxenguest
Message-Id: <E1kNyia-000380-GJ@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:33:56 +0000

commit 7f186b1996dea2992c8ed3606b38d73222293c37
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:46 2020 +0200

    tools/libxenguest: make xc_dom_loader interface private to libxenguest
    
    The pluggable kernel loader interface is used only internally of
    libxenguest, so make it private. This removes a dependency on the Xen
    internal header xen/libelf/libelf.h from xenguest.h.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/guest/include/xenguest.h | 15 ---------------
 tools/libs/guest/xg_private.h       | 13 +++++++++++++
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index 279f06345c..dba6a21643 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -247,21 +247,6 @@ struct xc_dom_image {
     unsigned int max_vcpus;
 };
 
-/* --- pluggable kernel loader ------------------------------------- */
-
-struct xc_dom_loader {
-    char *name;
-    /* Sadly the error returns from these functions are not consistent: */
-    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
-    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
-    elf_errorstatus (*loader) (struct xc_dom_image * dom);
-
-    struct xc_dom_loader *next;
-};
-
-#define __init __attribute__ ((constructor))
-void xc_dom_register_loader(struct xc_dom_loader *loader);
-
 /* --- arch specific hooks ----------------------------------------- */
 
 struct xc_dom_arch {
diff --git a/tools/libs/guest/xg_private.h b/tools/libs/guest/xg_private.h
index 0000b2b9b6..9940d554ef 100644
--- a/tools/libs/guest/xg_private.h
+++ b/tools/libs/guest/xg_private.h
@@ -41,6 +41,19 @@
 #endif
 #endif
 
+struct xc_dom_loader {
+    char *name;
+    /* Sadly the error returns from these functions are not consistent: */
+    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+    elf_errorstatus (*loader) (struct xc_dom_image * dom);
+
+    struct xc_dom_loader *next;
+};
+
+#define __init __attribute__ ((constructor))
+void xc_dom_register_loader(struct xc_dom_loader *loader);
+
 char *xc_read_image(xc_interface *xch,
                     const char *filename, unsigned long *size);
 char *xc_inflate_buffer(xc_interface *xch,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 01 13:34:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Oct 2020 13:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1286.4323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyio-0000sK-33; Thu, 01 Oct 2020 13:34:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1286.4323; Thu, 01 Oct 2020 13:34:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kNyin-0000sC-W9; Thu, 01 Oct 2020 13:34:09 +0000
Received: by outflank-mailman (input) for mailman id 1286;
 Thu, 01 Oct 2020 13:34:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kNyim-0000s2-Qw
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2b055461-cd60-4734-9e54-311656632fd5;
 Thu, 01 Oct 2020 13:34:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyik-0006lM-Ky
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kNyik-00039I-K6
 for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Vurn=DI=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kNyim-0000s2-Qw
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:08 +0000
X-Inumbo-ID: 2b055461-cd60-4734-9e54-311656632fd5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2b055461-cd60-4734-9e54-311656632fd5;
	Thu, 01 Oct 2020 13:34:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2n1txtHZNfwyBo1XATRABggX6aGPO00cbYHtQmfzS0w=; b=4z+GAUZ0SbBRCzI5AvwKLD27Jh
	ojaG1d4bFL8z+1RcOa1RQozYIwQ6hLQbrxpt5/BpE9ZgtV2wMsGikkas36lCT82ixWKf1hDOB2ENe
	XLmXesZFn2Mkpg6XRS+9slkJGA/o9FP3mlVw9p7yGq6qSYyzCvo5XLXliH07SOAo6+TU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyik-0006lM-Ky
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kNyik-00039I-K6
	for xen-changelog@lists.xenproject.org; Thu, 01 Oct 2020 13:34:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/lixenguest: hide struct elf_dom_parms layout from users
Message-Id: <E1kNyik-00039I-K6@xenbits.xenproject.org>
Date: Thu, 01 Oct 2020 13:34:06 +0000

commit bdb380e1dbdc6b76576ab6db0b8e946cc95edc1c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:48 2020 +0200

    tools/lixenguest: hide struct elf_dom_parms layout from users
    
    Don't include struct elf_dom_parms in struct xc_dom_image, but rather
    use a pointer to reference it. Together with adding accessor functions
    for the externally needed elements this enables to drop including the
    Xen private header xen/libelf/libelf.h from xenguest.h.
    
    Fixes: 7e0165c19387 ("tools/libxc: untangle libxenctrl from libxenguest")
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 stubdom/grub/kexec.c                      | 18 ++++---
 tools/libs/guest/include/xenguest.h       | 29 +++--------
 tools/libs/guest/xg_dom_arm.c             |  4 +-
 tools/libs/guest/xg_dom_armzimageloader.c |  8 +--
 tools/libs/guest/xg_dom_binloader.c       |  6 +--
 tools/libs/guest/xg_dom_boot.c            |  6 +--
 tools/libs/guest/xg_dom_core.c            | 85 ++++++++++++++++++++++++-------
 tools/libs/guest/xg_dom_elfloader.c       | 14 ++---
 tools/libs/guest/xg_dom_hvmloader.c       |  4 +-
 tools/libs/guest/xg_dom_x86.c             | 34 ++++++-------
 tools/libs/guest/xg_private.h             |  1 +
 tools/libs/light/libxl_x86_acpi.c         |  5 +-
 12 files changed, 126 insertions(+), 88 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index e9a69d2a32..3da80b5b4a 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -222,6 +222,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     char features[] = "";
     struct mmu_update *m2p_updates;
     unsigned long nr_m2p_updates;
+    uint64_t virt_base;
 
     DEBUG("booting with cmdline %s\n", cmdline);
     xc_handle = xc_interface_open(0,0,0);
@@ -294,10 +295,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
         goto out;
     }
 
+    virt_base = xc_dom_virt_base(dom);
     /* copy hypercall page */
     /* TODO: domctl instead, but requires privileges */
-    if (dom->parms.virt_hypercall != -1) {
-        pfn = PHYS_PFN(dom->parms.virt_hypercall - dom->parms.virt_base);
+    if (xc_dom_virt_hypercall(dom) != -1) {
+        pfn = PHYS_PFN(xc_dom_virt_hypercall(dom) - virt_base);
         memcpy((void *) pages[pfn], hypercall_page, PAGE_SIZE);
     }
 
@@ -313,11 +315,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     /* Move current console, xenstore and boot MFNs to the allocated place */
     do_exchange(dom, dom->console_pfn, start_info.console.domU.mfn);
     do_exchange(dom, dom->xenstore_pfn, start_info.store_mfn);
-    DEBUG("virt base at %llx\n", dom->parms.virt_base);
+    DEBUG("virt base at %llx\n", virt_base);
     DEBUG("bootstack_pfn %lx\n", dom->bootstack_pfn);
-    _boot_target = dom->parms.virt_base + PFN_PHYS(dom->bootstack_pfn);
+    _boot_target = virt_base + PFN_PHYS(dom->bootstack_pfn);
     DEBUG("_boot_target %lx\n", _boot_target);
-    do_exchange(dom, PHYS_PFN(_boot_target - dom->parms.virt_base),
+    do_exchange(dom, PHYS_PFN(_boot_target - virt_base),
             virt_to_mfn(&_boot_page));
 
     if ( dom->arch_hooks->setup_pgtables )
@@ -373,13 +375,13 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     _boot_oldpdmfn = virt_to_mfn(start_info.pt_base);
     DEBUG("boot old pd mfn %lx\n", _boot_oldpdmfn);
     DEBUG("boot pd virt %lx\n", dom->pgtables_seg.vstart);
-    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - dom->parms.virt_base)];
+    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - virt_base)];
     DEBUG("boot pd mfn %lx\n", _boot_pdmfn);
     _boot_stack = _boot_target + PAGE_SIZE;
     DEBUG("boot stack %lx\n", _boot_stack);
-    _boot_start_info = dom->parms.virt_base + PFN_PHYS(dom->start_info_pfn);
+    _boot_start_info = virt_base + PFN_PHYS(dom->start_info_pfn);
     DEBUG("boot start info %lx\n", _boot_start_info);
-    _boot_start = dom->parms.virt_entry;
+    _boot_start = xc_dom_virt_entry(dom);
     DEBUG("boot start %lx\n", _boot_start);
 
     /* Keep only useful entries */
diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index dba6a21643..a9984dbea5 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -22,8 +22,6 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
-#include <xen/libelf/libelf.h>
-
 #define XC_NUMA_NO_NODE   (~0U)
 
 #define XCFLAGS_LIVE      (1 << 0)
@@ -109,7 +107,7 @@ struct xc_dom_image {
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
 
     /* info from (elf) kernel image */
-    struct elf_dom_parms parms;
+    struct elf_dom_parms *parms;
     char *guest_type;
 
     /* memory layout */
@@ -390,6 +388,13 @@ void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
                                  xen_pfn_t count, xen_pfn_t *count_out);
 void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
 void xc_dom_unmap_all(struct xc_dom_image *dom);
+void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                          xen_vaddr_t vaddr, size_t *safe_region_out);
+uint64_t xc_dom_virt_base(struct xc_dom_image *dom);
+uint64_t xc_dom_virt_entry(struct xc_dom_image *dom);
+uint64_t xc_dom_virt_hypercall(struct xc_dom_image *dom);
+char *xc_dom_guest_os(struct xc_dom_image *dom);
+bool xc_dom_feature_get(struct xc_dom_image *dom, unsigned int nr);
 
 static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
                                       struct xc_dom_seg *seg,
@@ -411,24 +416,6 @@ static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
     return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
 }
 
-static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
-                                        xen_vaddr_t vaddr,
-                                        size_t *safe_region_out)
-{
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
-    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
-    xen_pfn_t safe_region_count;
-    void *ptr;
-
-    *safe_region_out = 0;
-    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
-    if ( ptr == NULL )
-        return ptr;
-    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr + offset;
-}
-
 static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
     if ( xc_dom_translated(dom) )
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 615fc109b9..94948d2b20 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -117,7 +117,7 @@ static int vcpu_arm32(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.pc32 = dom->parms.virt_entry;
+    ctxt->user_regs.pc32 = dom->parms->virt_entry;
 
     /* Linux boot protocol. See linux.Documentation/arm/Booting. */
     ctxt->user_regs.r0_usr = 0; /* SBZ */
@@ -161,7 +161,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.pc64 = dom->parms.virt_entry;
+    ctxt->user_regs.pc64 = dom->parms->virt_entry;
 
     /* Linux boot protocol. See linux.Documentation/arm64/booting.txt. */
     ctxt->user_regs.x0 = dom->devicetree_blob ?
diff --git a/tools/libs/guest/xg_dom_armzimageloader.c b/tools/libs/guest/xg_dom_armzimageloader.c
index ec42036ad2..6d837cefc4 100644
--- a/tools/libs/guest/xg_dom_armzimageloader.c
+++ b/tools/libs/guest/xg_dom_armzimageloader.c
@@ -111,8 +111,8 @@ static int xc_dom_parse_zimage32_kernel(struct xc_dom_image *dom)
     dom->kernel_seg.vstart = v_start;
     dom->kernel_seg.vend   = v_end;
 
-    dom->parms.virt_entry = entry_addr;
-    dom->parms.virt_base = rambase;
+    dom->parms->virt_entry = entry_addr;
+    dom->parms->virt_base = rambase;
 
     dom->guest_type = "xen-3.0-armv7l";
     DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
@@ -200,8 +200,8 @@ static int xc_dom_parse_zimage64_kernel(struct xc_dom_image *dom)
     dom->kernel_seg.vend   = v_end;
 
     /* Call the kernel at offset 0 */
-    dom->parms.virt_entry = v_start;
-    dom->parms.virt_base = rambase;
+    dom->parms->virt_entry = v_start;
+    dom->parms->virt_base = rambase;
 
     dom->guest_type = "xen-3.0-aarch64";
     DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
diff --git a/tools/libs/guest/xg_dom_binloader.c b/tools/libs/guest/xg_dom_binloader.c
index ccc23b388f..f5e3ddc5dc 100644
--- a/tools/libs/guest/xg_dom_binloader.c
+++ b/tools/libs/guest/xg_dom_binloader.c
@@ -214,8 +214,8 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
 
     dom->kernel_seg.vstart = image_info->load_addr;
     dom->kernel_seg.vend   = bss_end_addr;
-    dom->parms.virt_base   = start_addr;
-    dom->parms.virt_entry  = image_info->entry_addr;
+    dom->parms->virt_base   = start_addr;
+    dom->parms->virt_entry  = image_info->entry_addr;
 
     pae_flags = image_info->flags & XEN_MULTIBOOT_FLAG_PAE_MASK;
     switch (pae_flags >> XEN_MULTIBOOT_FLAG_PAE_SHIFT) {
@@ -237,7 +237,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  = XEN_PAE_EXTCR3;
+            dom->parms->pae  = XEN_PAE_EXTCR3;
         }
         break;
     }
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 827f1ffccd..2a002e7349 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -43,13 +43,13 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
     xen_pfn_t pfn;
     int rc;
 
-    if ( dom->parms.virt_hypercall == -1 )
+    if ( dom->parms->virt_hypercall == -1 )
         return 0;
-    pfn = (dom->parms.virt_hypercall - dom->parms.virt_base)
+    pfn = (dom->parms->virt_hypercall - dom->parms->virt_base)
         >> XC_DOM_PAGE_SHIFT(dom);
 
     DOMPRINTF("%s: vaddr=0x%" PRIx64 " pfn=0x%" PRIpfn "", __FUNCTION__,
-                  dom->parms.virt_hypercall, pfn);
+                  dom->parms->virt_hypercall, pfn);
     domctl.cmd = XEN_DOMCTL_hypercall_init;
     domctl.domain = dom->guest_domid;
     domctl.u.hypercall_init.gmfn = xc_dom_p2m(dom, pfn);
diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index c0d4a0aa2f..f846d8e1ed 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -735,6 +735,7 @@ void xc_dom_release(struct xc_dom_image *dom)
         xc_dom_unmap_all(dom);
     xc_dom_free_all(dom);
     free(dom->arch_private);
+    free(dom->parms);
     free(dom);
 }
 
@@ -753,6 +754,12 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->parms = malloc(sizeof(*dom->parms));
+    if (!dom->parms)
+        goto err;
+    memset(dom->parms, 0, sizeof(*dom->parms));
+    dom->alloc_malloc += sizeof(*dom->parms);
+
     dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
     dom->max_module_size = XC_DOM_DECOMPRESS_MAX;
     dom->max_devicetree_size = XC_DOM_DECOMPRESS_MAX;
@@ -762,12 +769,12 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     if ( features )
         elf_xen_parse_features(features, dom->f_requested, NULL);
 
-    dom->parms.virt_base = UNSET_ADDR;
-    dom->parms.virt_entry = UNSET_ADDR;
-    dom->parms.virt_hypercall = UNSET_ADDR;
-    dom->parms.virt_hv_start_low = UNSET_ADDR;
-    dom->parms.elf_paddr_offset = UNSET_ADDR;
-    dom->parms.p2m_base = UNSET_ADDR;
+    dom->parms->virt_base = UNSET_ADDR;
+    dom->parms->virt_entry = UNSET_ADDR;
+    dom->parms->virt_hypercall = UNSET_ADDR;
+    dom->parms->virt_hv_start_low = UNSET_ADDR;
+    dom->parms->elf_paddr_offset = UNSET_ADDR;
+    dom->parms->p2m_base = UNSET_ADDR;
 
     dom->flags = SIF_VIRT_P2M_4TOOLS;
 
@@ -920,8 +927,8 @@ int xc_dom_parse_image(struct xc_dom_image *dom)
     for ( i = 0; i < XENFEAT_NR_SUBMAPS; i++ )
     {
         dom->f_active[i] |= dom->f_requested[i]; /* cmd line */
-        dom->f_active[i] |= dom->parms.f_required[i]; /* kernel   */
-        if ( (dom->f_active[i] & dom->parms.f_supported[i]) !=
+        dom->f_active[i] |= dom->parms->f_required[i]; /* kernel   */
+        if ( (dom->f_active[i] & dom->parms->f_supported[i]) !=
              dom->f_active[i] )
         {
             xc_dom_panic(dom->xch, XC_INVALID_PARAM,
@@ -1142,8 +1149,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         goto err;
     }
     page_size = XC_DOM_PAGE_SIZE(dom);
-    if ( dom->parms.virt_base != UNSET_ADDR )
-        dom->virt_alloc_end = dom->parms.virt_base;
+    if ( dom->parms->virt_base != UNSET_ADDR )
+        dom->virt_alloc_end = dom->parms->virt_base;
 
     /* load kernel */
     if ( xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
@@ -1157,7 +1164,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* Don't load ramdisk / other modules now if no initial mapping required. */
     for ( mod = 0; mod < dom->num_modules; mod++ )
     {
-        unmapped_initrd = (dom->parms.unmapped_initrd &&
+        unmapped_initrd = (dom->parms->unmapped_initrd &&
                            !dom->modules[mod].seg.vstart);
 
         if ( dom->modules[mod].blob && !unmapped_initrd )
@@ -1199,10 +1206,10 @@ int xc_dom_build_image(struct xc_dom_image *dom)
 
     /* allocate other pages */
     if ( !dom->arch_hooks->p2m_base_supported ||
-         dom->parms.p2m_base >= dom->parms.virt_base ||
-         (dom->parms.p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
-        dom->parms.p2m_base = UNSET_ADDR;
-    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base == UNSET_ADDR &&
+         dom->parms->p2m_base >= dom->parms->virt_base ||
+         (dom->parms->p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
+        dom->parms->p2m_base = UNSET_ADDR;
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms->p2m_base == UNSET_ADDR &&
          dom->arch_hooks->alloc_p2m_list(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
@@ -1228,7 +1235,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
 
     for ( mod = 0; mod < dom->num_modules; mod++ )
     {
-        unmapped_initrd = (dom->parms.unmapped_initrd &&
+        unmapped_initrd = (dom->parms->unmapped_initrd &&
                            !dom->modules[mod].seg.vstart);
 
         /* Load ramdisk / other modules if no initial mapping required. */
@@ -1247,11 +1254,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* Allocate p2m list if outside of initial kernel mapping. */
-    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms->p2m_base != UNSET_ADDR )
     {
         if ( dom->arch_hooks->alloc_p2m_list(dom) != 0 )
             goto err;
-        dom->p2m_seg.vstart = dom->parms.p2m_base;
+        dom->p2m_seg.vstart = dom->parms->p2m_base;
     }
 
     return 0;
@@ -1260,6 +1267,48 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     return -1;
 }
 
+void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                          xen_vaddr_t vaddr, size_t *safe_region_out)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t page = (vaddr - dom->parms->virt_base) / page_size;
+    unsigned int offset = (vaddr - dom->parms->virt_base) % page_size;
+    xen_pfn_t safe_region_count;
+    void *ptr;
+
+    *safe_region_out = 0;
+    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
+    if ( ptr == NULL )
+        return ptr;
+    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
+    return ptr + offset;
+}
+
+uint64_t xc_dom_virt_base(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_base;
+}
+
+uint64_t xc_dom_virt_entry(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_entry;
+}
+
+uint64_t xc_dom_virt_hypercall(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_hypercall;
+}
+
+char *xc_dom_guest_os(struct xc_dom_image *dom)
+{
+    return dom->parms->guest_os;
+}
+
+bool xc_dom_feature_get(struct xc_dom_image *dom, unsigned int nr)
+{
+    return elf_xen_feature_get(nr, dom->parms->f_supported);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_dom_elfloader.c b/tools/libs/guest/xg_dom_elfloader.c
index 851930f039..06e713fe11 100644
--- a/tools/libs/guest/xg_dom_elfloader.c
+++ b/tools/libs/guest/xg_dom_elfloader.c
@@ -56,7 +56,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     uint64_t machine = elf_uval(elf, elf->ehdr, e_machine);
 
     if ( dom->container_type == XC_DOM_HVM_CONTAINER &&
-         dom->parms.phys_entry != UNSET_ADDR32 )
+         dom->parms->phys_entry != UNSET_ADDR32 )
         return "hvm-3.0-x86_32";
     if ( dom->container_type == XC_DOM_HVM_CONTAINER )
     {
@@ -69,7 +69,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     switch ( machine )
     {
     case EM_386:
-        switch ( dom->parms.pae )
+        switch ( dom->parms->pae )
         {
         case XEN_PAE_BIMODAL:
             if ( strstr(dom->xen_caps, "xen-3.0-x86_32p") )
@@ -135,7 +135,7 @@ static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
      * or else we might be trying to load a plain ELF.
      */
     elf_parse_binary(&elf);
-    rc = elf_xen_parse(&elf, &dom->parms);
+    rc = elf_xen_parse(&elf, dom->parms);
     if ( rc != 0 )
         return rc;
 
@@ -166,13 +166,13 @@ static elf_negerrnoval xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
 
     /* parse binary and get xen meta info */
     elf_parse_binary(elf);
-    if ( elf_xen_parse(elf, &dom->parms) != 0 )
+    if ( elf_xen_parse(elf, dom->parms) != 0 )
     {
         rc = -EINVAL;
         goto out;
     }
 
-    if ( elf_xen_feature_get(XENFEAT_dom0, dom->parms.f_required) )
+    if ( elf_xen_feature_get(XENFEAT_dom0, dom->parms->f_required) )
     {
         xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Kernel does not"
                      " support unprivileged (DomU) operation", __FUNCTION__);
@@ -181,8 +181,8 @@ static elf_negerrnoval xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
     }
 
     /* find kernel segment */
-    dom->kernel_seg.vstart = dom->parms.virt_kstart;
-    dom->kernel_seg.vend   = dom->parms.virt_kend;
+    dom->kernel_seg.vstart = dom->parms->virt_kstart;
+    dom->kernel_seg.vend   = dom->parms->virt_kend;
 
     dom->guest_type = xc_dom_guest_type(dom, elf);
     if ( dom->guest_type == NULL )
diff --git a/tools/libs/guest/xg_dom_hvmloader.c b/tools/libs/guest/xg_dom_hvmloader.c
index f3deedec41..ec6ebad7fd 100644
--- a/tools/libs/guest/xg_dom_hvmloader.c
+++ b/tools/libs/guest/xg_dom_hvmloader.c
@@ -73,7 +73,7 @@ static elf_negerrnoval xc_dom_probe_hvm_kernel(struct xc_dom_image *dom)
      * else we might be trying to load a PV kernel.
      */
     elf_parse_binary(&elf);
-    rc = elf_xen_parse(&elf, &dom->parms);
+    rc = elf_xen_parse(&elf, dom->parms);
     if ( rc == 0 )
         return -EINVAL;
 
@@ -227,7 +227,7 @@ static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
         goto error;
     }
 
-    dom->parms.phys_entry = elf_uval(elf, elf->ehdr, e_entry);
+    dom->parms->phys_entry = elf_uval(elf, elf->ehdr, e_entry);
 
     free(entries);
     return 0;
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index 876802e2ed..2953aeb90b 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -252,7 +252,7 @@ static int alloc_pgtables_pv(struct xc_dom_image *dom)
         try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
                                 bits_to_mask(22)); /* 4MB alignment */
 
-        if ( count_pgtables(dom, dom->parms.virt_base, try_virt_end, 0) )
+        if ( count_pgtables(dom, dom->parms->virt_base, try_virt_end, 0) )
             return -1;
 
         pages = map->area.pgtables + extra_pages;
@@ -464,7 +464,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 
     l3pfn = domx86->maps[0].lvls[2].pfn;
     l3mfn = xc_dom_p2m(dom, l3pfn);
-    if ( dom->parms.pae == XEN_PAE_YES )
+    if ( dom->parms->pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
             l3mfn = move_l3_below_4G(dom, l3pfn, l3mfn);
@@ -553,9 +553,9 @@ static int alloc_p2m_list_x86_64(struct xc_dom_image *dom)
     unsigned lvl;
 
     p2m_alloc_size = round_pg_up(p2m_alloc_size);
-    if ( dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->parms->p2m_base != UNSET_ADDR )
     {
-        from = dom->parms.p2m_base;
+        from = dom->parms->p2m_base;
         to = from + p2m_alloc_size - 1;
         if ( count_pgtables(dom, from, to, dom->pfn_alloc_end) )
             return -1;
@@ -739,7 +739,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
     dom->xenstore_pfn = special_pfn(SPECIALPAGE_XENSTORE);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
 
-    dom->parms.virt_hypercall = -1;
+    dom->parms->virt_hypercall = -1;
 
     rc = 0;
     goto out;
@@ -822,7 +822,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->pt_base = dom->pgtables_seg.vstart;
     start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
-    if ( dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->parms->p2m_base != UNSET_ADDR )
     {
         start_info->first_p2m_pfn = dom->p2m_seg.pfn;
         start_info->nr_p2m_frames = dom->p2m_seg.pages;
@@ -889,19 +889,19 @@ static int vcpu_x86_32(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.eip = dom->parms.virt_entry;
+    ctxt->user_regs.eip = dom->parms->virt_entry;
     ctxt->user_regs.esp =
-        dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
     ctxt->user_regs.esi =
-        dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
     ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->debugreg[6] = X86_DR6_DEFAULT;
     ctxt->debugreg[7] = X86_DR7_DEFAULT;
 
     ctxt->flags = VGCF_in_kernel_X86_32 | VGCF_online_X86_32;
-    if ( dom->parms.pae == XEN_PAE_EXTCR3 ||
-         dom->parms.pae == XEN_PAE_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(dom, dom->pgtables_seg.pfn);
@@ -939,11 +939,11 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.rip = dom->parms.virt_entry;
+    ctxt->user_regs.rip = dom->parms->virt_entry;
     ctxt->user_regs.rsp =
-        dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
     ctxt->user_regs.rsi =
-        dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
     ctxt->user_regs.rflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->debugreg[6] = X86_DR6_DEFAULT;
@@ -1070,7 +1070,7 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     bsp_ctx.cpu.cr0 = X86_CR0_PE | X86_CR0_ET;
 
     /* Set the IP. */
-    bsp_ctx.cpu.rip = dom->parms.phys_entry;
+    bsp_ctx.cpu.rip = dom->parms->phys_entry;
 
     bsp_ctx.cpu.dr6 = X86_DR6_DEFAULT;
     bsp_ctx.cpu.dr7 = X86_DR7_DEFAULT;
@@ -1806,8 +1806,8 @@ static int bootlate_hvm(struct xc_dom_image *dom)
     for ( i = 0; i < dom->num_modules; i++ )
     {
         struct xc_hvm_firmware_module mod;
-        uint64_t base = dom->parms.virt_base != UNSET_ADDR ?
-            dom->parms.virt_base : 0;
+        uint64_t base = dom->parms->virt_base != UNSET_ADDR ?
+            dom->parms->virt_base : 0;
 
         mod.guest_addr_out =
             dom->modules[i].seg.vstart - base;
diff --git a/tools/libs/guest/xg_private.h b/tools/libs/guest/xg_private.h
index 9940d554ef..fee3191cd4 100644
--- a/tools/libs/guest/xg_private.h
+++ b/tools/libs/guest/xg_private.h
@@ -31,6 +31,7 @@
 
 #include <xen/memory.h>
 #include <xen/elfnote.h>
+#include <xen/libelf/libelf.h>
 
 #ifndef ELFSIZE
 #include <limits.h>
diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi.c
index 1a4e9e98de..3eca1c7a9f 100644
--- a/tools/libs/light/libxl_x86_acpi.c
+++ b/tools/libs/light/libxl_x86_acpi.c
@@ -220,9 +220,8 @@ int libxl__dom_load_acpi(libxl__gc *gc,
      * and so we need to put RSDP in location that can be discovered by ACPI's
      * standard search method, in R-O BIOS memory (we chose last 64 bytes)
      */
-    if (strcmp(dom->parms.guest_os, "linux") ||
-        elf_xen_feature_get(XENFEAT_linux_rsdp_unrestricted,
-                            dom->parms.f_supported))
+    if (strcmp(xc_dom_guest_os(dom), "linux") ||
+        xc_dom_feature_get(dom, XENFEAT_linux_rsdp_unrestricted))
         dom->acpi_modules[0].guest_addr_out = ACPI_INFO_PHYSICAL_ADDRESS +
             (1 + acpi_pages_num) * libxl_ctxt.page_size;
     else
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1695.5142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEnX-0006VV-PE; Fri, 02 Oct 2020 06:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1695.5142; Fri, 02 Oct 2020 06:44:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEnX-0006VN-Lo; Fri, 02 Oct 2020 06:44:07 +0000
Received: by outflank-mailman (input) for mailman id 1695;
 Fri, 02 Oct 2020 06:44:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEnW-0006VI-Sx
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8dd4e455-209c-409a-80b7-e6f6e3d6f4ec;
 Fri, 02 Oct 2020 06:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnU-0007Uo-S1
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnU-0001w5-Q7
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEnW-0006VI-Sx
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:06 +0000
X-Inumbo-ID: 8dd4e455-209c-409a-80b7-e6f6e3d6f4ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8dd4e455-209c-409a-80b7-e6f6e3d6f4ec;
	Fri, 02 Oct 2020 06:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x6TREXy+zjPCxGvw4TjWIsi2vaS4V1mrKISF1l3aKlc=; b=0q2MaV916jbIPnAiUkM3Z/UL8r
	NmoXVysvAfPt5fjNjl3XUSzNU1JcjuOyIGks+7p+Oyf1fhdXVehFkGZys32oFrXkb98yfMYigRSfE
	1JbQfy+04K0X04eCBqZYqHF5yzk2gK7yy5EO0YcdwDTE2q/tTdmeb7A7s4DUX3zYbuAM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnU-0007Uo-S1
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnU-0001w5-Q7
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shim: fix build with PV_SHIM_EXCLUSIVE and SHADOW_PAGING
Message-Id: <E1kOEnU-0001w5-Q7@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:04 +0000

commit 23d4e0d17b764a404e1e43db04c56a714932b666
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:34:28 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:34:28 2020 +0200

    x86/shim: fix build with PV_SHIM_EXCLUSIVE and SHADOW_PAGING
    
    While there's little point in enabling both, the combination ought to at
    least build correctly. Drop the direct PV_SHIM_EXCLUSIVE conditionals
    and instead zap PG_log_dirty to zero under the right conditions, and key
    other #ifdef-s off of that.
    
    While there also expand on ded576ce07e9 ("x86/shadow: dirty VRAM
    tracking is needed for HVM only"): There was yet another is_hvm_domain()
    missing, and code touching the struct fields needs to be guarded by
    suitable #ifdef-s as well. While there also guard shadow-mode-only
    fields accordingly.
    
    Fixes: 8b5b49ceb3d9 ("x86: don't include domctl and alike in shim-exclusive builds")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/paging.c        | 10 +++++-----
 xen/arch/x86/mm/shadow/common.c |  4 +++-
 xen/arch/x86/mm/shadow/multi.c  |  6 ++++++
 xen/include/asm-x86/paging.h    | 15 ++++++++++++---
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 695372783d..8beac0e189 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -47,7 +47,7 @@
 /* Per-CPU variable for enforcing the lock ordering */
 DEFINE_PER_CPU(int, mm_lock_level);
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 
 /************************************************/
 /*              LOG DIRTY SUPPORT               */
@@ -630,7 +630,7 @@ void paging_log_dirty_init(struct domain *d, const struct log_dirty_ops *ops)
     d->arch.paging.log_dirty.ops = ops;
 }
 
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
@@ -671,7 +671,7 @@ void paging_vcpu_init(struct vcpu *v)
         shadow_vcpu_init(v);
 }
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
                   XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
                   bool_t resuming)
@@ -792,7 +792,7 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     return ret;
 }
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /* Call when destroying a domain */
 int paging_teardown(struct domain *d)
@@ -808,7 +808,7 @@ int paging_teardown(struct domain *d)
     if ( preempted )
         return -ERESTART;
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
     /* clean up log dirty resources. */
     rc = paging_free_log_dirty_bitmap(d, 0);
     if ( rc == -ERESTART )
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 7c7204fd34..6182313a0e 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2869,12 +2869,14 @@ void shadow_teardown(struct domain *d, bool *preempted)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if ( d->arch.hvm.dirty_vram )
+#ifdef CONFIG_HVM
+    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram )
     {
         xfree(d->arch.hvm.dirty_vram->sl1ma);
         xfree(d->arch.hvm.dirty_vram->dirty_bitmap);
         XFREE(d->arch.hvm.dirty_vram);
     }
+#endif
 
 out:
     paging_unlock(d);
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b205be6cdc..225082fc2f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -618,6 +618,7 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
+#ifdef CONFIG_HVM
     if ( unlikely(level == 1) && is_hvm_domain(d) )
     {
         struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
@@ -632,6 +633,7 @@ _sh_propagate(struct vcpu *v,
                 sflags &= ~_PAGE_RW;
         }
     }
+#endif
 
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) )
@@ -1050,6 +1052,7 @@ static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 {
+#ifdef CONFIG_HVM
     mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
     int flags = shadow_l1e_get_flags(new_sl1e);
     unsigned long gfn;
@@ -1074,6 +1077,7 @@ static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
             dirty_vram->sl1ma[i] = mfn_to_maddr(sl1mfn)
                 | ((unsigned long)sl1e & ~PAGE_MASK);
     }
+#endif
 }
 
 static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
@@ -1081,6 +1085,7 @@ static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 {
+#ifdef CONFIG_HVM
     mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
     int flags = shadow_l1e_get_flags(old_sl1e);
     unsigned long gfn;
@@ -1140,6 +1145,7 @@ static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
             dirty_vram->last_dirty = NOW();
         }
     }
+#endif
 }
 
 static int shadow_set_l1e(struct domain *d,
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index b803efa7b5..87ce135b8c 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -67,8 +67,12 @@
 #define PG_translate   0
 #define PG_external    0
 #endif
+#if defined(CONFIG_HVM) || !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
+#else
+#define PG_log_dirty   0
+#endif
 
 /* All paging modes. */
 #define PG_MASK (PG_refcounts | PG_log_dirty | PG_translate | PG_external)
@@ -154,7 +158,7 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
@@ -195,23 +199,28 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) ((pfn_x(pfn) >> (PAGE_SHIFT + 3 + PAGETABLE_ORDER * 2)) & \
                               (LOGDIRTY_NODE_ENTRIES-1))
 
+#ifdef CONFIG_HVM
 /* VRAM dirty tracking support */
 struct sh_dirty_vram {
     unsigned long begin_pfn;
     unsigned long end_pfn;
+#ifdef CONFIG_SHADOW_PAGING
     paddr_t *sl1ma;
     uint8_t *dirty_bitmap;
     s_time_t last_dirty;
+#endif
 };
+#endif
 
-#else /* !CONFIG_PV_SHIM_EXCLUSIVE */
+#else /* !PG_log_dirty */
 
 static inline void paging_log_dirty_init(struct domain *d,
                                          const struct log_dirty_ops *ops) {}
 static inline void paging_mark_dirty(struct domain *d, mfn_t gmfn) {}
 static inline void paging_mark_pfn_dirty(struct domain *d, pfn_t pfn) {}
+static inline bool paging_mfn_is_dirty(struct domain *d, mfn_t gmfn) { return false; }
 
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /*****************************************************************************
  * Entry points into the paging-assistance code */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1696.5146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEni-0006WG-Qr; Fri, 02 Oct 2020 06:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1696.5146; Fri, 02 Oct 2020 06:44:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEni-0006W8-Na; Fri, 02 Oct 2020 06:44:18 +0000
Received: by outflank-mailman (input) for mailman id 1696;
 Fri, 02 Oct 2020 06:44:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEnh-0006W2-Vv
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 82fff848-e46d-4dce-b8f8-52796869b722;
 Fri, 02 Oct 2020 06:44:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEne-0007Ur-Ve
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEne-0001y9-UD
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEnh-0006W2-Vv
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:18 +0000
X-Inumbo-ID: 82fff848-e46d-4dce-b8f8-52796869b722
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 82fff848-e46d-4dce-b8f8-52796869b722;
	Fri, 02 Oct 2020 06:44:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mmLJmaj8/Hb4k0hnMtqd7BnHr29wrO7h0IRS532m4c0=; b=P0u03gtIYpGqipEdVOlaCye8mN
	qh56z2yXHckq+ArBzDerWPtIZ+PCugQilkFkJDLpqcuPtA7iLwzoPr9DfgNdZ9uG18yqb3UCyyaf4
	5k6YiNX4RwXJxx7MDqeB2NZWh8GZ84VI+v44o10esZUJ43g2KC4R3ELtWt74ClTGJDCA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEne-0007Ur-Ve
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEne-0001y9-UD
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shim: adjust Kconfig defaults
Message-Id: <E1kOEne-0001y9-UD@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:14 +0000

commit 22b08b35db4aca2d2f6b31ba940cc65402b5586d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:35:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:35:31 2020 +0200

    x86/shim: adjust Kconfig defaults
    
    Just like HVM, defaulting SHADOW_PAGING and TBOOT to Yes in shim-
    exclusive mode makes no sense, as the respective code is dead there.
    
    Also adjust the shim default config file: It needs to specifiy values
    only for settings where a non-default value is wanted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Kconfig                  | 10 +++++-----
 xen/arch/x86/configs/pvshim_defconfig |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index a636a4bb1e..24868aa6ad 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -116,9 +116,9 @@ config XEN_SHSTK
 	  compatiblity can be provided via the PV Shim mechanism.
 
 config SHADOW_PAGING
-        bool "Shadow Paging"
-        default y
-        ---help---
+	bool "Shadow Paging"
+	default !PV_SHIM_EXCLUSIVE
+	---help---
 
           Shadow paging is a software alternative to hardware paging support
           (Intel EPT, AMD NPT).
@@ -165,8 +165,8 @@ config HVM_FEP
 	  If unsure, say N.
 
 config TBOOT
-	def_bool y
-	prompt "Xen tboot support" if EXPERT
+	bool "Xen tboot support" if EXPERT
+	default y if !PV_SHIM_EXCLUSIVE
 	select CRYPTO
 	---help---
 	  Allows support for Trusted Boot using the Intel(R) Trusted Execution
diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig
index 3af48d6c06..5478b991ac 100644
--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -8,12 +8,9 @@ CONFIG_NR_CPUS=32
 CONFIG_EXPERT=y
 CONFIG_SCHED_NULL=y
 # Disable features not used by the PV shim
-# CONFIG_HVM is not set
 # CONFIG_XEN_SHSTK is not set
 # CONFIG_HYPFS is not set
-# CONFIG_SHADOW_PAGING is not set
 # CONFIG_BIGMEM is not set
-# CONFIG_TBOOT is not set
 # CONFIG_KEXEC is not set
 # CONFIG_XENOPROF is not set
 # CONFIG_XSM is not set
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1697.5150 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEnq-0006YC-SG; Fri, 02 Oct 2020 06:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1697.5150; Fri, 02 Oct 2020 06:44:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEnq-0006Y4-P9; Fri, 02 Oct 2020 06:44:26 +0000
Received: by outflank-mailman (input) for mailman id 1697;
 Fri, 02 Oct 2020 06:44:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEnq-0006Xw-8Y
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 59c9231d-6f3e-4c3e-9051-98225967adf0;
 Fri, 02 Oct 2020 06:44:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnp-0007V8-3M
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnp-000200-1f
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEnq-0006Xw-8Y
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:26 +0000
X-Inumbo-ID: 59c9231d-6f3e-4c3e-9051-98225967adf0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 59c9231d-6f3e-4c3e-9051-98225967adf0;
	Fri, 02 Oct 2020 06:44:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=20Hhc2g7Kow3Wdujam44SF/iJ0b5kXQtC2TwYkkh5j8=; b=bKFbAj2J6tT+/o6KHZFZS8Zw5K
	2w0KzFvEylyCr0WWskHnNK9xH000txrgy7IxymYBHUPmEUQcJ8E4eoH7cxOnh1Li/989DzEwwChDN
	xIVuXfZYCQkaXv1dzFRd0znjFZhbFH9A0hbTAs+XYSNV3iWVYntcIbtrdUZE+Lu1nZQM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnp-0007V8-3M
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnp-000200-1f
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOEnp-000200-1f@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:25 +0000

commit 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:36:21 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:36:21 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 2412e63204..bd7894832f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -724,6 +724,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a80bcf3e42..b21c3783d3 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index fab5d30c3a..b3addbf701 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -281,6 +281,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1698.5154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEo0-0006Zi-Tv; Fri, 02 Oct 2020 06:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1698.5154; Fri, 02 Oct 2020 06:44:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEo0-0006Za-Qs; Fri, 02 Oct 2020 06:44:36 +0000
Received: by outflank-mailman (input) for mailman id 1698;
 Fri, 02 Oct 2020 06:44:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEo0-0006ZS-4T
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e431fcce-87e8-4d15-92a3-297a8a53ab9f;
 Fri, 02 Oct 2020 06:44:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnz-0007VH-6i
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEnz-00021W-5V
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEo0-0006ZS-4T
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:36 +0000
X-Inumbo-ID: e431fcce-87e8-4d15-92a3-297a8a53ab9f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e431fcce-87e8-4d15-92a3-297a8a53ab9f;
	Fri, 02 Oct 2020 06:44:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GsGwtNEQ3nQ8MWmjQCxErM6i98R7pYHD0nP3I4k2W94=; b=QOj09xoN1R/F7hTC5SbefSU6WB
	E0ve69bfCrB7NcyMpnMMAwRgi+JSGQ25oQYO/+7E5zHIJer+9jIkWbAy6Ev7aHjvhaCPsfCwl87YX
	xeej31TcFECndBP2s7grq7z/aj6jRVdCoJPZsPdNSd+pYtZG8GB+wNEZgvmrIxoSoKfI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnz-0007VH-6i
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEnz-00021W-5V
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: cut short evtchn_reset()'s loop in the common case
Message-Id: <E1kOEnz-00021W-5V@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:35 +0000

commit bb3d31e03771353ed546b0290fb3f4d8f34d962c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:37:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:37:04 2020 +0200

    evtchn: cut short evtchn_reset()'s loop in the common case
    
    The general expectation is that there are only a few open ports left
    when a domain asks its event channel configuration to be reset.
    Similarly on average half a bucket worth of event channels can be
    expected to be inactive. Try to avoid iterating over all channels, by
    utilizing usage data we're maintaining anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index bd7894832f..e365b5498f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -231,7 +231,11 @@ void evtchn_free(struct domain *d, struct evtchn *chn)
     evtchn_port_clear_pending(d, chn);
 
     if ( consumer_is_xen(chn) )
+    {
         write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+        /* Decrement ->xen_evtchns /before/ ->active_evtchns. */
+        smp_wmb();
+    }
     write_atomic(&d->active_evtchns, d->active_evtchns - 1);
 
     /* Reset binding to vcpu0 when the channel is freed. */
@@ -1069,6 +1073,19 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
+static bool has_active_evtchns(const struct domain *d)
+{
+    unsigned int xen = read_atomic(&d->xen_evtchns);
+
+    /*
+     * Read ->xen_evtchns /before/ active_evtchns, to prevent
+     * evtchn_reset() exiting its loop early.
+     */
+    smp_rmb();
+
+    return read_atomic(&d->active_evtchns) > xen;
+}
+
 int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
@@ -1093,7 +1110,7 @@ int evtchn_reset(struct domain *d, bool resuming)
     if ( !i )
         return -EBUSY;
 
-    for ( ; port_is_valid(d, i); i++ )
+    for ( ; port_is_valid(d, i) && has_active_evtchns(d); i++ )
     {
         evtchn_close(d, i, 1);
 
@@ -1332,6 +1349,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock_irqrestore(&chn->lock, flags);
 
+    /*
+     * Increment ->xen_evtchns /after/ ->active_evtchns. No explicit
+     * barrier needed due to spin-locked region just above.
+     */
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1700.5159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoC-0006bo-0w; Fri, 02 Oct 2020 06:44:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1700.5159; Fri, 02 Oct 2020 06:44:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoB-0006bd-Tp; Fri, 02 Oct 2020 06:44:47 +0000
Received: by outflank-mailman (input) for mailman id 1700;
 Fri, 02 Oct 2020 06:44:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEoA-0006bU-J9
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a22c0127-0341-48be-9f28-ba8eb19f4f66;
 Fri, 02 Oct 2020 06:44:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEo9-0007VU-OR
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEo9-00022p-8v
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEoA-0006bU-J9
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:46 +0000
X-Inumbo-ID: a22c0127-0341-48be-9f28-ba8eb19f4f66
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a22c0127-0341-48be-9f28-ba8eb19f4f66;
	Fri, 02 Oct 2020 06:44:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M/3aDMx6qwFvKZQhR/cEFJKrDIweAYl/4ArMJopROdg=; b=04B3YCw3KCPrUbVDkESsZpVDmY
	R1YJBPP7aT2D+rE8JUWhSgHfZ79uAdWg1amwpOqEAAvyLD8fzstn7id7jjmhapMyGYpb2z8jj3DV8
	sL8TMcSkX40LbVVjCRl5LU3/OWIn+9ybo5I7E+icgcPwubRlkuAfvdqE6aGE8MmpiF0k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEo9-0007VU-OR
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEo9-00022p-8v
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kOEo9-00022p-8v@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:45 +0000

commit 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:37:35 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:37:35 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:44:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:44:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1701.5164 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoM-0006dA-4P; Fri, 02 Oct 2020 06:44:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1701.5164; Fri, 02 Oct 2020 06:44:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoM-0006d2-1O; Fri, 02 Oct 2020 06:44:58 +0000
Received: by outflank-mailman (input) for mailman id 1701;
 Fri, 02 Oct 2020 06:44:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEoK-0006ct-NH
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 88448919-ed27-4686-9bb1-24658c7bad36;
 Fri, 02 Oct 2020 06:44:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEoJ-0007WG-RX
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEoJ-00025V-QX
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEoK-0006ct-NH
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:56 +0000
X-Inumbo-ID: 88448919-ed27-4686-9bb1-24658c7bad36
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 88448919-ed27-4686-9bb1-24658c7bad36;
	Fri, 02 Oct 2020 06:44:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Oi/pXC8Futut+AfF2OQAxJvqrnRuu+XC6glanGBTxGM=; b=ykjUjs+faAMqIdsQO4NYJ/5UWy
	hncdmeQVXTm8RI9BpX4SoV1/eda1U+5mJXm0lcyqxTTeA1ZnX7n/1DuiH/SIy5hxZn3jXsxLxhaSC
	jzTy+ho42GFYAvNsNpoR824izWWaD2GnZPWvIAUvGxyvd8UAFJXB7F1tEVWUiNniZleM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEoJ-0007WG-RX
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEoJ-00025V-QX
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:44:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: move FIFO-private struct declarations
Message-Id: <E1kOEoJ-00025V-QX@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:44:55 +0000

commit 661b3e4c5f6118cf328bfedcc56153b7cb691c34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:38:05 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:38:05 2020 +0200

    evtchn: move FIFO-private struct declarations
    
    There's no need to expose them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_fifo.c      | 21 +++++++++++++++++++++
 xen/include/xen/event_fifo.h | 21 ---------------------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 27ab3a1c3f..fc189152e1 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -21,6 +21,27 @@
 
 #include <public/event_channel.h>
 
+struct evtchn_fifo_queue {
+    uint32_t *head; /* points into control block */
+    uint32_t tail;
+    uint8_t priority;
+    spinlock_t lock;
+};
+
+struct evtchn_fifo_vcpu {
+    struct evtchn_fifo_control_block *control_block;
+    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
+};
+
+#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
+#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
+    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
+
+struct evtchn_fifo_domain {
+    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
+    unsigned int num_evtchns;
+};
+
 static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
                                                        unsigned int port)
 {
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
index 4115f6f527..0fec3d5316 100644
--- a/xen/include/xen/event_fifo.h
+++ b/xen/include/xen/event_fifo.h
@@ -9,27 +9,6 @@
 #ifndef __XEN_EVENT_FIFO_H__
 #define __XEN_EVENT_FIFO_H__
 
-struct evtchn_fifo_queue {
-    uint32_t *head; /* points into control block */
-    uint32_t tail;
-    uint8_t priority;
-    spinlock_t lock;
-};
-
-struct evtchn_fifo_vcpu {
-    struct evtchn_fifo_control_block *control_block;
-    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
-};
-
-#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
-#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
-    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
-
-struct evtchn_fifo_domain {
-    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
-    unsigned int num_evtchns;
-};
-
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *domain);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 06:45:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 06:45:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1702.5168 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoX-0006eV-67; Fri, 02 Oct 2020 06:45:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1702.5168; Fri, 02 Oct 2020 06:45:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOEoX-0006eM-2w; Fri, 02 Oct 2020 06:45:09 +0000
Received: by outflank-mailman (input) for mailman id 1702;
 Fri, 02 Oct 2020 06:45:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOEoV-0006eB-PP
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d332efc0-2e3f-4385-8b68-f9038d563b08;
 Fri, 02 Oct 2020 06:45:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEoT-0007Ws-Ui
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOEoT-00026O-Tn
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOEoV-0006eB-PP
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:07 +0000
X-Inumbo-ID: d332efc0-2e3f-4385-8b68-f9038d563b08
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d332efc0-2e3f-4385-8b68-f9038d563b08;
	Fri, 02 Oct 2020 06:45:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l/2pvpc8jfUA8XIPvHqk/ERvP215FKEZow+8z7wWXNk=; b=iI4mt5v5PQH8Cc0hdXoHscxHUr
	0QvsgN3Pina7VVBR4UqK0D0wFglZFkRFdKUpz/V78OQJZ30oYqF2XPt7U2ZGL1qYRSaffqpVAYtQj
	N6jdWhpG170y0Ehhk71cKG8CqdTb0NfyGiJBH3IUlPzIEk9aFeKHqnTlcC40KrPvqoG4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEoT-0007Ws-Ui
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOEoT-00026O-Tn
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 06:45:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kOEoT-00026O-Tn@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 06:45:05 +0000

commit 59b27f360e3d9dc0378c1288e67a91fa41a77158
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 08:38:50 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:38:50 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8cfa2e0b6b..c4a480fa14 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -310,6 +310,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 10:44:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1867.5670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIXo-0006aC-BJ; Fri, 02 Oct 2020 10:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1867.5670; Fri, 02 Oct 2020 10:44:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIXo-0006a2-8B; Fri, 02 Oct 2020 10:44:08 +0000
Received: by outflank-mailman (input) for mailman id 1867;
 Fri, 02 Oct 2020 10:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOIXm-0006Zg-QA
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5a91fb3c-047b-4a43-999d-f3195f7bcc38;
 Fri, 02 Oct 2020 10:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIXl-0004i0-3E
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIXl-0003su-1Y
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOIXm-0006Zg-QA
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:06 +0000
X-Inumbo-ID: 5a91fb3c-047b-4a43-999d-f3195f7bcc38
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5a91fb3c-047b-4a43-999d-f3195f7bcc38;
	Fri, 02 Oct 2020 10:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cb7pr9eneFkBaZvRU6YfWQR9h+81vULZMoiB7+HVLMg=; b=p1EZRbtvYj0zU1EqJYdp4pC/iN
	C33Ys6dpTsHkh1BlE8JqMKA37QpYBfilvsj/KNrUWPbyzNFg2WHpwMDMT2YPz4h5YuMsTPq9Bjk2e
	oqhQeJB765Zavr6dGgGVQWoMItAfaCMEBVjZGG6UKngpMMa4UsWBqPVKyulu3NG9JL8I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIXl-0004i0-3E
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIXl-0003su-1Y
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOIXl-0003su-1Y@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 10:44:05 +0000

commit c93b520a41f2787dd76bfb2e454836d1d5787505
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:34:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:34:00 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a80bcf3e42..b21c3783d3 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a314bf85ce..5513f399d5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -281,6 +281,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 10:44:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 10:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1869.5674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIXy-0006cq-D2; Fri, 02 Oct 2020 10:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1869.5674; Fri, 02 Oct 2020 10:44:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIXy-0006ci-9t; Fri, 02 Oct 2020 10:44:18 +0000
Received: by outflank-mailman (input) for mailman id 1869;
 Fri, 02 Oct 2020 10:44:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOIXx-0006cR-29
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 799cc6fc-390c-4f24-94df-6901288f89ca;
 Fri, 02 Oct 2020 10:44:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIXv-0004i9-Jw
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIXv-0003uG-Iy
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOIXx-0006cR-29
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:17 +0000
X-Inumbo-ID: 799cc6fc-390c-4f24-94df-6901288f89ca
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 799cc6fc-390c-4f24-94df-6901288f89ca;
	Fri, 02 Oct 2020 10:44:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3fbzYaXjjKgkWkgFSd2IqH2E1QhKG0iH6fx2Rc0We8c=; b=eqQFFpK912dDxpZ/M9+KPnlXSG
	ph2ONllfqhLJfMHtbFKtfwjI3mB203T4VXz5fZW2unqCUofEXUlVdtk2ED097z6BpaLWfWolyWf5I
	aWmmV+KikGLdApGMIO2O8oAEQvl8O4PMU/1g2cvp+LpFpx7P7bpujWJsJDpgUDEfB7iU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIXv-0004i9-Jw
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIXv-0003uG-Iy
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOIXv-0003uG-Iy@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 10:44:15 +0000

commit 8e7e5857a203c9d9df7733fd68768555c7e76839
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:35:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:35:11 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index e22d6160b5..2ba3ec95b4 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cf7f25cda2..794f465321 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -280,6 +280,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 10:44:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 10:44:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1870.5678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIY8-0006fi-Eo; Fri, 02 Oct 2020 10:44:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1870.5678; Fri, 02 Oct 2020 10:44:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIY8-0006fa-BP; Fri, 02 Oct 2020 10:44:28 +0000
Received: by outflank-mailman (input) for mailman id 1870;
 Fri, 02 Oct 2020 10:44:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOIY7-0006em-8D
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 340edd72-d73e-49a7-a171-19e3238297d2;
 Fri, 02 Oct 2020 10:44:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIY6-0004iP-6P
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIY6-0003vh-3t
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOIY7-0006em-8D
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:27 +0000
X-Inumbo-ID: 340edd72-d73e-49a7-a171-19e3238297d2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 340edd72-d73e-49a7-a171-19e3238297d2;
	Fri, 02 Oct 2020 10:44:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ultpprsDkR4DJO7E3nvBnunKv+O2fDXF34DMhz8Wlz0=; b=bTAtq4aFqhcEvq9elxpkQnzIEv
	fEeoRXTdR0mxDwQJfMueXLYy6jiGiGOifR90f8Ez8fl0x55zJX24CK/LYbTr+Lh1MGarzpy2NU+dt
	M7tQzIdW3SKxV3RX8RuExm4+X2gED+eUILwllctV+wuCxj0WdjFIF2rD2Qgkfg2OUwsU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIY6-0004iP-6P
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIY6-0003vh-3t
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOIY6-0003vh-3t@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 10:44:26 +0000

commit 6888017392ac25b5e588554030642affac25a95d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:36:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:36:11 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index fc9d6b5bf0..56cfbbe2d8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 640c708659..7c170f520a 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3d00c747f6..277fb66e91 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -280,6 +280,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index 93386bd7a1..32ecc0ea2a 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 10:44:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 10:44:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1872.5696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIYJ-0006jQ-Qj; Fri, 02 Oct 2020 10:44:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1872.5696; Fri, 02 Oct 2020 10:44:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIYJ-0006jH-Mq; Fri, 02 Oct 2020 10:44:39 +0000
Received: by outflank-mailman (input) for mailman id 1872;
 Fri, 02 Oct 2020 10:44:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOIYH-0006h7-O3
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 079625e7-f09c-439b-bb6d-ace4ce680438;
 Fri, 02 Oct 2020 10:44:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIYG-0004ih-PF
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIYG-0003x7-ON
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOIYH-0006h7-O3
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:37 +0000
X-Inumbo-ID: 079625e7-f09c-439b-bb6d-ace4ce680438
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 079625e7-f09c-439b-bb6d-ace4ce680438;
	Fri, 02 Oct 2020 10:44:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B5tbW73a4+/udzzZlq2yDf228Dpao2xwPSz18EM5vLI=; b=OfcmhpNH7KXzHgr8KC034CCipv
	4a9AoaHoFaKqIHBQOZkmqudCM5KWDDudFWkYkT1C/zbMi521Jmrbt26pNBF7fnGv2jFXM+pnVoBXD
	5wct+iosCJQ4U5nS+MZtHrFtkQr0Z4/MQYNZYYKBPBKJylWwmTRyTqLFz/yF+VQtJ2BQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIYG-0004ih-PF
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIYG-0003x7-ON
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOIYG-0003x7-ON@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 10:44:36 +0000

commit 3630a367854c98bbf8e747d09eeab7e68f370003
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:37:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:37:09 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a1f2af07c5..0066c8a87f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -719,6 +719,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2779819e1e..a670880106 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index a3e6108a34..8917329225 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 78bc32602e..17aa543fca 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -278,6 +278,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index bfc69f4acd..8426b36c72 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 10:44:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 10:44:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1873.5697 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIYT-0006na-Rj; Fri, 02 Oct 2020 10:44:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1873.5697; Fri, 02 Oct 2020 10:44:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOIYT-0006nT-OY; Fri, 02 Oct 2020 10:44:49 +0000
Received: by outflank-mailman (input) for mailman id 1873;
 Fri, 02 Oct 2020 10:44:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOIYS-0006n2-FR
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7531ae52-0fda-4ee3-813e-dd445fad700e;
 Fri, 02 Oct 2020 10:44:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIYR-0004ip-Bd
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOIYR-0003yi-Ab
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOIYS-0006n2-FR
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:48 +0000
X-Inumbo-ID: 7531ae52-0fda-4ee3-813e-dd445fad700e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7531ae52-0fda-4ee3-813e-dd445fad700e;
	Fri, 02 Oct 2020 10:44:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KoG/Uv9WkoXmozWM89QSWEisffre1LrA3wcAfSIc8Q4=; b=t1nCTvjxzt94HnHjoDgxy5mYaE
	hv8SYLfNLqVxEQZW6zuKJ/4JkNBnHuBaQUq9alzkN5F9VYlOhFk8rhi75q1qBQ1GzBMKRChDk6xJg
	If90Xvs1sxbeEj9GwIks+Qj9GYTCrfY4qsDjARXnjcLTch1ZnpQx9UVYL8wG2NBx0lYA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIYR-0004ip-Bd
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOIYR-0003yi-Ab
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 10:44:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kOIYR-0003yi-Ab@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 10:44:47 +0000

commit 1719f79a0efd36d15837c51982173dd1c287dced
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:38:17 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:38:17 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index b41096a65f..84d58454d2 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -726,6 +726,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2a299f7569..d0b4b097c0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index a3e6108a34..8917329225 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f01b4cfaaa..211cfb9a4b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -278,6 +278,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index bfc69f4acd..8426b36c72 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 17:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 17:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2283.6808 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOOvc-0001lf-Bx; Fri, 02 Oct 2020 17:33:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2283.6808; Fri, 02 Oct 2020 17:33:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOOvc-0001lX-8s; Fri, 02 Oct 2020 17:33:08 +0000
Received: by outflank-mailman (input) for mailman id 2283;
 Fri, 02 Oct 2020 17:33:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOOva-0001l5-K1
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 36d2445d-9ec5-42d2-b1b4-cbc5471c46bd;
 Fri, 02 Oct 2020 17:33:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOOvY-0005YD-Gp
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOOvY-0004eE-Er
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOOva-0001l5-K1
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:06 +0000
X-Inumbo-ID: 36d2445d-9ec5-42d2-b1b4-cbc5471c46bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 36d2445d-9ec5-42d2-b1b4-cbc5471c46bd;
	Fri, 02 Oct 2020 17:33:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qyOW0tEJWsGVPM3U1Mq1vrrZFfeh7kE8ovTj+DkhGXE=; b=vUEsRUTAIkDYXj+0lc1cj+7m0z
	CvIbXpLuVHEZTGRdihCiN34HDIMBXzVBFSbsSa0/92T8l6K6+jsnAZFV0zMt+Cnsr9QI0Pvv3vie1
	l0kTKTCvcBbGg8qUWTUupeF16dRlUNxv/FvGW0g2oelh9IN8wJHLZl062CnWGta39Hr8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOOvY-0005YD-Gp
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOOvY-0004eE-Er
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 17:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm,smmu: match start level of page table walk with P2M
Message-Id: <E1kOOvY-0004eE-Er@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 17:33:04 +0000

commit 9ae1197582798b394d696cff94c4d742319bdbbf
Author:     Laurentiu Tudor <laurentiu.tudor@nxp.com>
AuthorDate: Fri Oct 2 13:33:44 2020 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Oct 2 10:21:56 2020 -0700

    arm,smmu: match start level of page table walk with P2M
    
    Don't hardcode the lookup start level of the page table walk to 1
    and instead match the one used in P2M. This should fix scenarios
    involving SMMU where the start level is different than 1.
    In order for the SMMU driver to also compile on arm32 move the
    P2M_ROOT_LEVEL in the p2m header file (while at it, for
    consistency also P2M_ROOT_ORDER) and use the macro in the smmu
    driver.
    
    Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/p2m.c                 |  9 ++-------
 xen/drivers/passthrough/arm/smmu.c |  2 +-
 xen/include/asm-arm/p2m.h          | 11 +++++++++++
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index ce59f2b503..4eeb867ca1 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -17,17 +17,12 @@
 #define INVALID_VMID 0 /* VMID 0 is reserved */
 
 #ifdef CONFIG_ARM_64
-static unsigned int __read_mostly p2m_root_order;
-static unsigned int __read_mostly p2m_root_level;
-#define P2M_ROOT_ORDER    p2m_root_order
-#define P2M_ROOT_LEVEL p2m_root_level
+unsigned int __read_mostly p2m_root_order;
+unsigned int __read_mostly p2m_root_level;
 static unsigned int __read_mostly max_vmid = MAX_VMID_8_BIT;
 /* VMID is by default 8 bit width on AArch64 */
 #define MAX_VMID       max_vmid
 #else
-/* First level P2M is always 2 consecutive pages */
-#define P2M_ROOT_LEVEL 1
-#define P2M_ROOT_ORDER    1
 /* VMID is always 8 bit width on AArch32 */
 #define MAX_VMID        MAX_VMID_8_BIT
 #endif
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 06f9bda47d..b8321f5d8d 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1152,7 +1152,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
 	      (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT);
 
 	if (!stage1)
-		reg |= (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+		reg |= (2 - P2M_ROOT_LEVEL) << TTBCR_SL0_SHIFT;
 
 	writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR);
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5fdb6e8183..28ca9a838e 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -13,6 +13,17 @@
 /* Holds the bit size of IPAs in p2m tables.  */
 extern unsigned int p2m_ipa_bits;
 
+#ifdef CONFIG_ARM_64
+extern unsigned int p2m_root_order;
+extern unsigned int p2m_root_level;
+#define P2M_ROOT_ORDER    p2m_root_order
+#define P2M_ROOT_LEVEL p2m_root_level
+#else
+/* First level P2M is always 2 consecutive pages */
+#define P2M_ROOT_ORDER    1
+#define P2M_ROOT_LEVEL 1
+#endif
+
 struct domain;
 
 extern void memory_type_changed(struct domain *);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 02 18:00:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Oct 2020 18:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2293.6852 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOPLk-0004fz-DQ; Fri, 02 Oct 2020 18:00:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2293.6852; Fri, 02 Oct 2020 18:00:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kOPLk-0004fr-Aa; Fri, 02 Oct 2020 18:00:08 +0000
Received: by outflank-mailman (input) for mailman id 2293;
 Fri, 02 Oct 2020 18:00:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kOPLi-0004fm-Ov
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c90b7342-3a4c-4f23-bdfd-d9be94dd55a1;
 Fri, 02 Oct 2020 18:00:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOPLh-0006Aw-Ek
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kOPLh-0006jV-D0
 for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Nc3N=DJ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kOPLi-0004fm-Ov
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:06 +0000
X-Inumbo-ID: c90b7342-3a4c-4f23-bdfd-d9be94dd55a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c90b7342-3a4c-4f23-bdfd-d9be94dd55a1;
	Fri, 02 Oct 2020 18:00:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f0M6ngII3o5/cjj7zMBqSe6FIlxGb6gnTOjBu++o2kM=; b=PYHm40JXnYtTW+c41VNZGND3pf
	wg/8mDyrHE7FCjUXpiJWPp95gDzrvwwugo2l9EBpOg6CCSzAu5etXhQxjWgkmFDheeg2gMEqH64ST
	v01eP5g/PFkUwurTuHRDhbzSPdqQXHFjmAuwhO1CCkLg28jTIcTNaaxvTcx9ca+CycZ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOPLh-0006Aw-Ek
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kOPLh-0006jV-D0
	for xen-changelog@lists.xenproject.org; Fri, 02 Oct 2020 18:00:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy()
Message-Id: <E1kOPLh-0006jV-D0@xenbits.xenproject.org>
Date: Fri, 02 Oct 2020 18:00:05 +0000

commit 8ef6345ef557cc2c47298217635a3088eaa59893
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 18:23:42 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 2 18:57:50 2020 +0100

    tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy()
    
    OSSTest reports that libvirt is reliably regressed.
    
    The only possible option is a side effect of using libxl_defbool_val(), which
    can only be the assert() within.  Unfortunately, libvirt actually crashes in
    __vfscanf_internal() while presumably trying to render some form of error.
    
    Open code the check without the assert() to unblock staging, while we
    investigate what is going on with libvirt.  This will want reverting at some
    point in the future.
    
    Not-really-fixes: bfcc97c08c ("tools/cpuid: Plumb nested_virt down into xc_cpuid_apply_policy()" reliably breaks libvirt.)
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/light/libxl_cpuid.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 08e85dcffb..16c077cceb 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -422,7 +422,15 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 {
     bool pae = true;
     bool itsc;
-    bool nested_virt = libxl_defbool_val(info->nested_hvm);
+
+    /*
+     * Gross hack.  Using libxl_defbool_val() here causes libvirt to crash in
+     * __vfscanf_internal(), which is probably collateral damage from a side
+     * effect of the assert().
+     *
+     * Unblock things for now by opencoding without the assert.
+     */
+    bool nested_virt = info->nested_hvm.val > 0;
 
     /*
      * For PV guests, PAE is Xen-controlled (it is the 'p' that differentiates
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2790.7958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF1u-00022E-QA; Mon, 05 Oct 2020 01:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2790.7958; Mon, 05 Oct 2020 01:11:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF1u-000225-Mo; Mon, 05 Oct 2020 01:11:06 +0000
Received: by outflank-mailman (input) for mailman id 2790;
 Mon, 05 Oct 2020 01:11:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF1s-00021Z-Of
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27b72721-d975-4a3f-b8b9-7d8cc05c7307;
 Mon, 05 Oct 2020 01:11:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF1q-0005Mk-KG
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF1q-0003vA-Ga
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF1s-00021Z-Of
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:04 +0000
X-Inumbo-ID: 27b72721-d975-4a3f-b8b9-7d8cc05c7307
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27b72721-d975-4a3f-b8b9-7d8cc05c7307;
	Mon, 05 Oct 2020 01:11:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HLiY8XV9Gw32KrKowFBl+aojRpT5Rzz9gJA+LB8tdIY=; b=Eu3j1DNKi58kOyd/oQg8GT7r43
	CRohG5KW79Z+4CW4VBejPj7Tu6cii5QUIsxcOsVevOICBp2UFw4Et+iGS+X92oBlxoO4+L7kgC6Wc
	R5b2+9ijukdIYjnmUzLmnNMWYwm/0TfEcAANnqPx5P7zOkbEI8msgl8+UfNT6uPazuHY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF1q-0005Mk-KG
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF1q-0003vA-Ga
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] arm: Add Neoverse N1 processor identification
Message-Id: <E1kPF1q-0003vA-Ga@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:02 +0000

commit 6ef4daddc78d48be1990046930456e707c44d9ca
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Aug 18 14:47:38 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Sep 14 17:25:17 2020 -0700

    arm: Add Neoverse N1 processor identification
    
    Add MIDR and CPU part numbers for Neoverse N1
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 3b418b33265402aab0cb1bf2b745a25724bae2d8)
---
 xen/include/asm-arm/processor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index aa642e3ab2..3ca67f8157 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -58,6 +58,7 @@
 #define ARM_CPU_PART_CORTEX_A73     0xD09
 #define ARM_CPU_PART_CORTEX_A75     0xD0A
 #define ARM_CPU_PART_CORTEX_A76     0xD0B
+#define ARM_CPU_PART_NEOVERSE_N1    0xD0C
 
 #define MIDR_CORTEX_A12 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A12)
 #define MIDR_CORTEX_A17 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A17)
@@ -68,6 +69,7 @@
 #define MIDR_CORTEX_A73 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A73)
 #define MIDR_CORTEX_A75 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A75)
 #define MIDR_CORTEX_A76 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A76)
+#define MIDR_NEOVERSE_N1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N1)
 
 /* MPIDR Multiprocessor Affinity Register */
 #define _MPIDR_UP           (30)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2791.7962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF23-000230-RA; Mon, 05 Oct 2020 01:11:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2791.7962; Mon, 05 Oct 2020 01:11:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF23-00022s-OD; Mon, 05 Oct 2020 01:11:15 +0000
Received: by outflank-mailman (input) for mailman id 2791;
 Mon, 05 Oct 2020 01:11:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF21-00022i-ME
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ebea6d86-2d4b-48d1-9ff2-ef5bd66e3517;
 Mon, 05 Oct 2020 01:11:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF20-0005Ms-OK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF20-0003vj-Me
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF21-00022i-ME
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:13 +0000
X-Inumbo-ID: ebea6d86-2d4b-48d1-9ff2-ef5bd66e3517
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ebea6d86-2d4b-48d1-9ff2-ef5bd66e3517;
	Mon, 05 Oct 2020 01:11:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XkSUQZCBShgXLunMlIvkkSe6XmcOjHOiQSEUj7NAWsw=; b=1b3ADAglR7hLXlWTjDg72s4JqT
	z1/mb8yZoMtt2bpkn/D2nBxj5ZZm3bbETqVx2hAKRy50PWKXhsPOYyoyWUXznlJhm3/k+3JSnFnI8
	sWqGLqvpLyl7s+I0PVfjRdzkbVzH9soRISfvm8+OsCCgXOiPfODPubLONckHrIOPbxgc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF20-0005Ms-OK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF20-0003vj-Me
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Enable CPU Erratum 1165522 for Neoverse
Message-Id: <E1kPF20-0003vj-Me@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:12 +0000

commit 4a0c174c17673590711358bdf89289eedcbe2837
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Aug 18 14:47:39 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Sep 14 17:25:23 2020 -0700

    xen/arm: Enable CPU Erratum 1165522 for Neoverse
    
    Enable CPU erratum of Speculative AT on the Neoverse N1 processor
    versions r0p0 to r2p0.
    Also Fix Cortex A76 Erratum string which had a wrong errata number.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 858c0be8c2fa4125a0fa0acaa03ae730e5c7cb3c)
---
 xen/arch/arm/cpuerrata.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index da72b02442..9f7169a6a6 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -475,9 +475,15 @@ static const struct arm_cpu_capabilities arm_errata[] = {
         .matches = has_ssbd_mitigation,
     },
 #endif
+    {
+        /* Neoverse r0p0 - r2p0 */
+        .desc = "ARM erratum 1165522",
+        .capability = ARM64_WORKAROUND_AT_SPECULATE,
+        MIDR_RANGE(MIDR_NEOVERSE_N1, 0, 2 << MIDR_VARIANT_SHIFT),
+    },
     {
         /* Cortex-A76 r0p0 - r2p0 */
-        .desc = "ARM erratum 116522",
+        .desc = "ARM erratum 1165522",
         .capability = ARM64_WORKAROUND_AT_SPECULATE,
         MIDR_RANGE(MIDR_CORTEX_A76, 0, 2 << MIDR_VARIANT_SHIFT),
     },
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2792.7966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2D-00024a-Sz; Mon, 05 Oct 2020 01:11:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2792.7966; Mon, 05 Oct 2020 01:11:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2D-00024S-Ph; Mon, 05 Oct 2020 01:11:25 +0000
Received: by outflank-mailman (input) for mailman id 2792;
 Mon, 05 Oct 2020 01:11:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF2B-00024A-OK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9d31b509-c6d0-42a4-8ece-1690b2a97bcb;
 Mon, 05 Oct 2020 01:11:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2A-0005NB-T3
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2A-0003wR-QS
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF2B-00024A-OK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:23 +0000
X-Inumbo-ID: 9d31b509-c6d0-42a4-8ece-1690b2a97bcb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9d31b509-c6d0-42a4-8ece-1690b2a97bcb;
	Mon, 05 Oct 2020 01:11:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qpstwiYZio8OoUlxv59xo6LQfQSifiSS3OCe8IoO8JQ=; b=3tvbkqvxFG9/o/zUMIBZF01LO6
	BsUU2sCCEzsQBObBTfdk4fhuN5DLyjwe4Gn/yO7mH09TGLXWICDjwPhufIJ1gYq+sz4uzLQFlPNfx
	da+k2Ol9CUgrkHpmZq6okH9CUaAASYhrQVvtxqET3Z73Drql5gq/tJ96vPkYU0Oi9cDk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2A-0005NB-T3
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2A-0003wR-QS
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Update silicon-errata.txt with the Neovers AT erratum
Message-Id: <E1kPF2A-0003wR-QS@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:22 +0000

commit 4fb1ad782dd170cac7a3868e5aba583c8abe38a0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Aug 25 18:38:10 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Sep 14 17:25:30 2020 -0700

    xen/arm: Update silicon-errata.txt with the Neovers AT erratum
    
    Commit 858c0be8c2fa "xen/arm: Enable CPU Erratum 1165522 for Neoverse"
    added a new erratum but forgot to update silicon-errata.txt.
    
    Update the file accordingly to keep track of errata workaround in Xen.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    (cherry picked from commit 1814a626fb5811184eda64fe22f0055df4600211)
---
 docs/misc/arm/silicon-errata.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index 11e5a9dcec..e15d0923e9 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -51,4 +51,5 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
+| ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2793.7969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2N-000261-U0; Mon, 05 Oct 2020 01:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2793.7969; Mon, 05 Oct 2020 01:11:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2N-00025t-R9; Mon, 05 Oct 2020 01:11:35 +0000
Received: by outflank-mailman (input) for mailman id 2793;
 Mon, 05 Oct 2020 01:11:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF2L-00025h-Q2
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2d82fb8e-2d16-4668-a06a-37a30b40beeb;
 Mon, 05 Oct 2020 01:11:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2K-0005NK-W1
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2K-0003xF-VC
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF2L-00025h-Q2
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:33 +0000
X-Inumbo-ID: 2d82fb8e-2d16-4668-a06a-37a30b40beeb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2d82fb8e-2d16-4668-a06a-37a30b40beeb;
	Mon, 05 Oct 2020 01:11:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o3Rpca/NsUkFa0wmQVwxg2L2PsH/v0LcU/40VSkhF18=; b=eK3Wn6G4XDp3f9hZcv0asQm0gP
	5ah+B7qO1hPM89XejuLGwmyRybUd5+7L9McKrP4OSttSLrkgzTiikSdHfNbQnu+KOHeUwa4RYfE5b
	TTRB5UcISSbIvFOjEVdEQxT/C6pcykMoeFWxfIvB1VhnxJuZ2I6oE2p7b05N8VVylr3M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2K-0005NK-W1
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2K-0003xF-VC
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch
Message-Id: <E1kPF2K-0003xF-VC@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:32 +0000

commit bd63ab538be07e96f9b594cd927fd7c4825b4436
Author:     Wei Chen <wei.chen@arm.com>
AuthorDate: Fri Aug 28 02:34:03 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Sep 14 17:25:36 2020 -0700

    xen/arm: Missing N1/A76/A75 FP registers in vCPU context switch
    
    Xen has cpu_has_fp/cpu_has_simd to detect whether the CPU supports
    FP/SIMD or not. But currently, these two MACROs only consider value 0
    of ID_AA64PFR0_EL1.FP/SIMD as FP/SIMD features enabled. But for CPUs
    that support FP/SIMD and half-precision floating-point arithmetic, the
    ID_AA64PFR0_EL1.FP/SIMD are 1 (see Arm ARM DDI0487F.b, D13.2.64).
    For these CPUs, xen will treat them as no FP/SIMD support, the
    vfp_save/restore_state will not take effect.
    
    From the TRM documents of Cortex-A75/A76/N1, we know these CPUs support
    basic Advanced SIMD/FP and half-precision floating-point arithmetic. In
    this case, on N1/A76/A75 platforms, Xen will always miss the floating
    pointer registers save/restore. If different vCPUs are running on the
    same pCPU, the floating pointer registers will be corrupted randomly.
    
    This patch fixes Xen on these new cores.
    
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    (cherry picked from commit 968bb86d04913f52d7678a842474f2a674a8b23e)
---
 xen/include/asm-arm/cpufeature.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
index 9af5666628..6bff5ce131 100644
--- a/xen/include/asm-arm/cpufeature.h
+++ b/xen/include/asm-arm/cpufeature.h
@@ -13,8 +13,8 @@
 #define cpu_has_el2_64    (boot_cpu_feature64(el2) >= 1)
 #define cpu_has_el3_32    (boot_cpu_feature64(el3) == 2)
 #define cpu_has_el3_64    (boot_cpu_feature64(el3) >= 1)
-#define cpu_has_fp        (boot_cpu_feature64(fp) == 0)
-#define cpu_has_simd      (boot_cpu_feature64(simd) == 0)
+#define cpu_has_fp        (boot_cpu_feature64(fp) < 8)
+#define cpu_has_simd      (boot_cpu_feature64(simd) < 8)
 #define cpu_has_gicv3     (boot_cpu_feature64(gic) == 1)
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2794.7975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2X-00027J-Vx; Mon, 05 Oct 2020 01:11:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2794.7975; Mon, 05 Oct 2020 01:11:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2X-00027A-SV; Mon, 05 Oct 2020 01:11:45 +0000
Received: by outflank-mailman (input) for mailman id 2794;
 Mon, 05 Oct 2020 01:11:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF2V-00026y-UR
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8ca2e523-b01a-49c1-9599-9e9c3f22d5cb;
 Mon, 05 Oct 2020 01:11:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2V-0005Nv-2d
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2V-0003y6-1s
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF2V-00026y-UR
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
X-Inumbo-ID: 8ca2e523-b01a-49c1-9599-9e9c3f22d5cb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8ca2e523-b01a-49c1-9599-9e9c3f22d5cb;
	Mon, 05 Oct 2020 01:11:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Span04sm3KgBnPg9wS9I7sO59HZinuncGwnPC6VyTmc=; b=bx6uTOQZbpL5YA7y3pY6DTwZyP
	3haU8twWSpm205r1c7P4nGqqgvy+lTf8AuRzv2wqqd5EqXbZooVrA1f8CQsbNyS+iIwz6B1CBLd/2
	/UBNmRzwK48TCLKSrVISkzxKiWYy0uL4TljkNNCgka2crah07gIDVwbmrPZDazmiBFD8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2V-0005Nv-2d
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2V-0003y6-1s
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()
Message-Id: <E1kPF2V-0003y6-1s@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:43 +0000

commit aa1d9a7dbfe07905f0b7218bcd433a513f762eb9
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Jul 29 14:50:37 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Mon Sep 14 17:25:43 2020 -0700

    xen/arm: cmpxchg: Add missing memory barriers in __cmpxchg_mb_timeout()
    
    The function __cmpxchg_mb_timeout() was intended to have the same
    semantics as __cmpxchg_mb(). Unfortunately, the memory barriers were
    not added when first implemented.
    
    There is no known issue with the existing callers, but the barriers are
    added given this is the expected semantics in Xen.
    
    The issue was introduced by XSA-295.
    
    Backport: 4.8+
    Fixes: 86b0bc958373 ("xen/arm: cmpxchg: Provide a new helper that can timeout")
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    (cherry picked from commit d501ef90ae7f2a79130ea89acb3d6d1792972934)
---
 xen/include/asm-arm/arm32/cmpxchg.h | 8 +++++++-
 xen/include/asm-arm/arm64/cmpxchg.h | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-arm/arm32/cmpxchg.h b/xen/include/asm-arm/arm32/cmpxchg.h
index 49ca2a0d7a..0770f272ee 100644
--- a/xen/include/asm-arm/arm32/cmpxchg.h
+++ b/xen/include/asm-arm/arm32/cmpxchg.h
@@ -147,7 +147,13 @@ static always_inline bool __cmpxchg_mb_timeout(volatile void *ptr,
 					       int size,
 					       unsigned int max_try)
 {
-	return __int_cmpxchg(ptr, old, new, size, true, max_try);
+	bool ret;
+
+	smp_mb();
+	ret = __int_cmpxchg(ptr, old, new, size, true, max_try);
+	smp_mb();
+
+	return ret;
 }
 
 #define cmpxchg(ptr,o,n)						\
diff --git a/xen/include/asm-arm/arm64/cmpxchg.h b/xen/include/asm-arm/arm64/cmpxchg.h
index 5bc2e1f786..fc5c60f0bd 100644
--- a/xen/include/asm-arm/arm64/cmpxchg.h
+++ b/xen/include/asm-arm/arm64/cmpxchg.h
@@ -160,7 +160,13 @@ static always_inline bool __cmpxchg_mb_timeout(volatile void *ptr,
 					       int size,
 					       unsigned int max_try)
 {
-	return __int_cmpxchg(ptr, old, new, size, true, max_try);
+	bool ret;
+
+	smp_mb();
+	ret = __int_cmpxchg(ptr, old, new, size, true, max_try);
+	smp_mb();
+
+	return ret;
 }
 
 #define cmpxchg(ptr, o, n) \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:11:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:11:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2795.7978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2i-00028W-0m; Mon, 05 Oct 2020 01:11:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2795.7978; Mon, 05 Oct 2020 01:11:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2h-00028O-Tx; Mon, 05 Oct 2020 01:11:55 +0000
Received: by outflank-mailman (input) for mailman id 2795;
 Mon, 05 Oct 2020 01:11:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF2g-00028B-4N
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7c1b41eb-cd35-492d-8f9c-96013a312572;
 Mon, 05 Oct 2020 01:11:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2f-0005PR-6J
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2f-0003ys-4l
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF2g-00028B-4N
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:54 +0000
X-Inumbo-ID: 7c1b41eb-cd35-492d-8f9c-96013a312572
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7c1b41eb-cd35-492d-8f9c-96013a312572;
	Mon, 05 Oct 2020 01:11:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gG4RQi07G2EeOdGoUs12qPDV5G03ARWymdWDQSKpIM0=; b=p+Ob2g6nFdDv2f/OBTrQ9nc+DS
	mB4Dv+1TG5EhQsIb4HfHKeea5pxMs+ySmb5Td0FpL+61qwuH/swbD/lGzkUbDCl4ti1ekCj/V5NFi
	mUsQHizHBcQIRKQtG6TFue8Ygn+h61puJEMe4oREx2R6EOtIkWQqcdtM0eImU6yXsDHo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2f-0005PR-6J
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2f-0003ys-4l
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:11:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
Message-Id: <E1kPF2f-0003ys-4l@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:11:53 +0000

commit b98031951d19b9576a2200859bae86119c1e681c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:20:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:20:09 2020 +0200

    x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
    
    This MSR doesn't exist on AMD hardware, and switching away from the safe
    functions in the common MSR path was an erroneous change.
    
    Partially revert the change.
    
    This is XSA-333.
    
    Fixes: 4fdc932b3cc ("x86/Intel: drop another 32-bit leftover")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 9a5b3edfae..42258c6bf1 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -869,7 +869,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, *val);
+        if ( rdmsr_safe(reg, *val) )
+            break;
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1009,7 +1010,8 @@ static int write_msr(unsigned int reg, uint64_t val,
         break;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, temp);
+        if ( rdmsr_safe(reg, temp) )
+            break;
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2796.7982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2s-00029r-2S; Mon, 05 Oct 2020 01:12:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2796.7982; Mon, 05 Oct 2020 01:12:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF2r-00029j-VS; Mon, 05 Oct 2020 01:12:05 +0000
Received: by outflank-mailman (input) for mailman id 2796;
 Mon, 05 Oct 2020 01:12:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF2q-00029W-3p
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 070cd3d7-bc28-4867-9540-482d4e308e66;
 Mon, 05 Oct 2020 01:12:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2p-0005Pt-AV
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2p-0003zr-8Y
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF2q-00029W-3p
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:04 +0000
X-Inumbo-ID: 070cd3d7-bc28-4867-9540-482d4e308e66
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 070cd3d7-bc28-4867-9540-482d4e308e66;
	Mon, 05 Oct 2020 01:12:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dzW6rJeEZHLeWOxWMhUTOPy6g9u4NzC4iw/3KPolimY=; b=NUd4gzTLtmjPzcK/FJNhsBmzNk
	v78VHKqF+e+jqNYpz4W8dZ0hZ26ubv2YAB+O6b4ne3SdKcOEiRCJVqkqCvWU0D1AhTmG8kBsnneov
	+40eGlpjOIUbedj3j7JEvyPoUIBOnyTm9LKWzBTGc/yfZrrpz+qWfSIeeuB0BCSXU3qc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2p-0005Pt-AV
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2p-0003zr-8Y
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/memory: Don't skip the RCU unlock path in acquire_resource()
Message-Id: <E1kPF2p-0003zr-8Y@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:03 +0000

commit 286b3539b7e6af63c22c080c4dfe52c957e0c23f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:20:46 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:20:46 2020 +0200

    xen/memory: Don't skip the RCU unlock path in acquire_resource()
    
    In the case that an HVM Stubdomain makes an XENMEM_acquire_resource hypercall,
    the FIXME path will bypass rcu_unlock_domain() on the way out of the function.
    
    Move the check to the start of the function.  This does change the behaviour
    of the get-size path for HVM Stubdomains, but that functionality is currently
    broken and unused anyway, as well as being quite useless to entities which
    can't actually map the resource anyway.
    
    This is XSA-334.
    
    Fixes: 83fa6552ce ("common: add a new mappable resource type: XENMEM_resource_grant_table")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3c085a0cd0..b2b6a775d9 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1057,6 +1057,14 @@ static int acquire_resource(
     xen_pfn_t mfn_list[32];
     int rc;
 
+    /*
+     * FIXME: Until foreign pages inserted into the P2M are properly
+     *        reference counted, it is unsafe to allow mapping of
+     *        resource pages unless the caller is the hardware domain.
+     */
+    if ( paging_mode_translate(currd) && !is_hardware_domain(currd) )
+        return -EACCES;
+
     if ( copy_from_guest(&xmar, arg, 1) )
         return -EFAULT;
 
@@ -1113,14 +1121,6 @@ static int acquire_resource(
         xen_pfn_t gfn_list[ARRAY_SIZE(mfn_list)];
         unsigned int i;
 
-        /*
-         * FIXME: Until foreign pages inserted into the P2M are properly
-         *        reference counted, it is unsafe to allow mapping of
-         *        resource pages unless the caller is the hardware domain.
-         */
-        if ( !is_hardware_domain(currd) )
-            return -EACCES;
-
         if ( copy_from_guest(gfn_list, xmar.frame_list, xmar.nr_frames) )
             rc = -EFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2797.7985 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF32-0002C0-60; Mon, 05 Oct 2020 01:12:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2797.7985; Mon, 05 Oct 2020 01:12:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF32-0002Bt-36; Mon, 05 Oct 2020 01:12:16 +0000
Received: by outflank-mailman (input) for mailman id 2797;
 Mon, 05 Oct 2020 01:12:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF31-0002Bi-9Y
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 13fceec3-6f0d-44a8-a20a-cee14a38eff0;
 Mon, 05 Oct 2020 01:12:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2z-0005Q1-Dm
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF2z-00040a-D0
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF31-0002Bi-9Y
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:15 +0000
X-Inumbo-ID: 13fceec3-6f0d-44a8-a20a-cee14a38eff0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 13fceec3-6f0d-44a8-a20a-cee14a38eff0;
	Mon, 05 Oct 2020 01:12:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XeBK6aFvt6njPzE93dmS7dC3fKj8qso7tN2PGSbCkVs=; b=1JIRy8cVLVfQ+EElE0L1h1UPPk
	5xHzJ0PvJ4Ewa7AJt+tZLopr4S635SIYN4sq5aUq6eSfMyYqQEoH5TSIBN+iDMRp32ym/fLjdiwpr
	1EVW3ggXZK2dQ6S+NuUfGWiboKCNay8yZIAmu7aKFDEm9uo2UI1aQwa576sa1369PLGc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2z-0005Q1-Dm
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF2z-00040a-D0
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kPF2z-00040a-D0@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:13 +0000

commit 42fcdd42328f9819530f3f0350f9b851acc7c1a0
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 16:21:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:21:32 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 81 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 49 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 36380fcc92..704ac8b1bf 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -646,6 +646,8 @@ int hvm_domain_initialise(struct domain *d)
     /* need link to containing domain */
     d->arch.hvm.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index ecd25d7ad4..77b142406f 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -152,23 +152,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm.tm_lock);
+    read_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -218,7 +227,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -226,7 +235,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -234,7 +243,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -247,7 +256,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -308,7 +317,7 @@ int pt_update_irq(struct vcpu *v)
     int irq, pt_vector = -1;
     bool level;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -338,7 +347,7 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
@@ -346,7 +355,7 @@ int pt_update_irq(struct vcpu *v)
     irq = earliest_pt->irq;
     level = earliest_pt->level;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -393,7 +402,7 @@ int pt_update_irq(struct vcpu *v)
                 time_cb *cb = NULL;
                 void *cb_priv;
 
-                spin_lock(&v->arch.hvm.tm_lock);
+                pt_vcpu_lock(v);
                 /* Make sure the timer is still on the list. */
                 list_for_each_entry ( pt, &v->arch.hvm.tm_list, list )
                     if ( pt == earliest_pt )
@@ -403,7 +412,7 @@ int pt_update_irq(struct vcpu *v)
                         cb_priv = pt->priv;
                         break;
                     }
-                spin_unlock(&v->arch.hvm.tm_lock);
+                pt_vcpu_unlock(v);
 
                 if ( cb != NULL )
                     cb(v, cb_priv);
@@ -440,12 +449,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -454,7 +463,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -465,12 +474,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -489,7 +498,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -539,7 +548,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -564,30 +573,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 99169dd625..e2cdba4280 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -134,6 +134,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2798.7990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3B-0002DA-7s; Mon, 05 Oct 2020 01:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2798.7990; Mon, 05 Oct 2020 01:12:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3B-0002D3-53; Mon, 05 Oct 2020 01:12:25 +0000
Received: by outflank-mailman (input) for mailman id 2798;
 Mon, 05 Oct 2020 01:12:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3A-0002Cv-E4
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0d28f987-5ca5-4442-93e7-76cfd6e7d926;
 Mon, 05 Oct 2020 01:12:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF39-0005Q9-Gu
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF39-00041D-Fz
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3A-0002Cv-E4
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:24 +0000
X-Inumbo-ID: 0d28f987-5ca5-4442-93e7-76cfd6e7d926
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0d28f987-5ca5-4442-93e7-76cfd6e7d926;
	Mon, 05 Oct 2020 01:12:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m//XEeWcF/SC3Dg5xvgLgcxKpAH7Ym+uPqNUS8xUPsU=; b=6FjvhHBqT6J8dHcIMQcAjyoRym
	Rix0dwbrvpwz0lVDJSRTJA178YP69ES48cjEDJlejicILCcuPb8HpFjskZC8cKPsAMj0GI+YjF3eV
	ydiBRkxTe1Ggja24dWPODptBhmnwk4a91mdQvttrGm2pFrWHGYKEhrzDDkgmuCIuENWM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF39-0005Q9-Gu
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF39-00041D-Fz
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/msi: get rid of read_msi_msg
Message-Id: <E1kPF39-00041D-Fz@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:23 +0000

commit b7fcbe0150c7df1c0dc97853b46e1cf39f8d8ad9
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 16:22:08 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:22:08 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 53 +----------------------------------------------------
 1 file changed, 1 insertion(+), 52 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 54d13aecf7..2d02f8aa86 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -183,54 +183,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        uint16_t data;
-
-        msg->address_lo = pci_conf_read32(dev->sbdf,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(dev->sbdf,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -302,10 +254,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2799.7994 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3L-0002EV-9p; Mon, 05 Oct 2020 01:12:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2799.7994; Mon, 05 Oct 2020 01:12:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3L-0002EO-6d; Mon, 05 Oct 2020 01:12:35 +0000
Received: by outflank-mailman (input) for mailman id 2799;
 Mon, 05 Oct 2020 01:12:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3K-0002EH-LL
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 23a0280e-9b24-47cc-a46d-1c5028f8c67d;
 Mon, 05 Oct 2020 01:12:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3J-0005QH-Kl
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3J-00041t-J7
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3K-0002EH-LL
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:34 +0000
X-Inumbo-ID: 23a0280e-9b24-47cc-a46d-1c5028f8c67d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 23a0280e-9b24-47cc-a46d-1c5028f8c67d;
	Mon, 05 Oct 2020 01:12:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aIeCkHoNvLqR8GYfz0C+2pJsGltEYDrj501ZqN2Pjjg=; b=j61UXkztWaeNWU/YrKYnCAEHAU
	mquWJ/2IpNNkv9nB7BFsG1k4ARdBHbiBQOIB+JwrF9C7KeaEVorGlk5elsFAmWklYmNonqId+Q2YK
	5bndzBOIlC+rp20DffKhvhjTsyx96NDLl/QkEvAaNH+zvEwv1AhJBWbNEt4KOKatn4Ng=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3J-0005QH-Kl
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3J-00041t-J7
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kPF3J-00041t-J7@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:33 +0000

commit f27980a3306416a056c5f27a1ea34fb749aada2b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:22:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:22:31 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 60 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 2d02f8aa86..c919920749 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -769,16 +769,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
     unsigned int pos = pci_find_cap_offset(seg, bus, slot, func,
                                            PCI_CAP_ID_MSIX);
 
@@ -820,43 +818,45 @@ static int msix_capability_init(struct pci_dev *dev,
 
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(dev->sbdf, msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
-    {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(dev->sbdf, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->table.first = PFN_DOWN(table_paddr);
         msix->table.last = PFN_DOWN(table_paddr +
@@ -875,7 +875,18 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(msix->nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
+    }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
+        xfree(entry);
+        return -ENODATA;
     }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      (table_offset & ~PCI_MSIX_BIRMASK & ~PAGE_MASK);
 
     if ( entry )
     {
@@ -886,8 +897,15 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
+            pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
             xfree(entry);
             return idx;
         }
@@ -1076,9 +1094,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2800.7999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3V-0002Fp-C6; Mon, 05 Oct 2020 01:12:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2800.7999; Mon, 05 Oct 2020 01:12:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3V-0002Fg-8W; Mon, 05 Oct 2020 01:12:45 +0000
Received: by outflank-mailman (input) for mailman id 2800;
 Mon, 05 Oct 2020 01:12:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3U-0002FY-Ip
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c632aaa1-abbd-4ecc-bddb-f18beda80cf2;
 Mon, 05 Oct 2020 01:12:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3T-0005R7-No
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3T-00042Y-Mq
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3U-0002FY-Ip
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:44 +0000
X-Inumbo-ID: c632aaa1-abbd-4ecc-bddb-f18beda80cf2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c632aaa1-abbd-4ecc-bddb-f18beda80cf2;
	Mon, 05 Oct 2020 01:12:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ALZnbcA08RJe9Tr0tMWIfWi+9BRcbwpbMcvi/BNVJy8=; b=rbUmriYTjnGK55W0iGHVFnQQwV
	FypX8b1v81vHfd6JSmOcMbKZ3qHONRkGvfFrAGRz0GYS6ylkTZAWP8e2GOiIVubbT8O/5a6EI7cYW
	8XRLPfTqa43g5FW2ikpYI4K0nKk6eGER7GaxCue1H/NQ7m55Dr0bnprpxCvsmvxk5Scs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3T-0005R7-No
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3T-00042Y-Mq
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: relax port_is_valid()
Message-Id: <E1kPF3T-00042Y-Mq@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:43 +0000

commit ae922b9fc203cc3907b4feed5f2d50783b7c32d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:22:55 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:22:55 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index a7798f6765..ce45298377 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,8 +107,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:12:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:12:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2801.8002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3f-0002HI-EM; Mon, 05 Oct 2020 01:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2801.8002; Mon, 05 Oct 2020 01:12:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3f-0002HA-BI; Mon, 05 Oct 2020 01:12:55 +0000
Received: by outflank-mailman (input) for mailman id 2801;
 Mon, 05 Oct 2020 01:12:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3e-0002H4-SK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id faa7d949-fc88-4f33-983d-d4cf49370cbe;
 Mon, 05 Oct 2020 01:12:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3d-0005RH-Qc
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3d-00043K-Pw
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3e-0002H4-SK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:54 +0000
X-Inumbo-ID: faa7d949-fc88-4f33-983d-d4cf49370cbe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id faa7d949-fc88-4f33-983d-d4cf49370cbe;
	Mon, 05 Oct 2020 01:12:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Beo4aaMmJ5z3X9ogBh4uPnR6jzJZf/civgTfuNDzY2o=; b=G9doj4ahSJHi/XgNXmdt+dkWrY
	FJflB2Bv17OqDITKsavBY7753pscAMyC3DYQKx/y3EsiosS6X9RugtddLMBkAh3Nxh/He7i+6FvOt
	Bmbu/wfqh1dklka4fqGbXtr11C2Vih6JjE7HWjDRWTHVlOMIKxtRo8Grt0XVu/OOLrXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3d-0005RH-Qc
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3d-00043K-Pw
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:12:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Avoid double exception injection
Message-Id: <E1kPF3d-00043K-Pw@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:12:53 +0000

commit 0537543cc1f149bd2c2236a215d95a8b617ee097
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:23:35 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:23:35 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 3cd375bd48..33ac552cac 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -78,7 +78,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -349,7 +348,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 24731eeb37..5ec5522e33 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -90,7 +90,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -495,6 +494,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2802.8006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3p-0002IZ-G0; Mon, 05 Oct 2020 01:13:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2802.8006; Mon, 05 Oct 2020 01:13:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF3p-0002IN-Cs; Mon, 05 Oct 2020 01:13:05 +0000
Received: by outflank-mailman (input) for mailman id 2802;
 Mon, 05 Oct 2020 01:13:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3o-0002IG-R9
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f0f79fd5-5afc-4bb5-aae9-f28958d73549;
 Mon, 05 Oct 2020 01:13:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3n-0005Rc-UK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3n-00044L-Sq
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3o-0002IG-R9
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:04 +0000
X-Inumbo-ID: f0f79fd5-5afc-4bb5-aae9-f28958d73549
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f0f79fd5-5afc-4bb5-aae9-f28958d73549;
	Mon, 05 Oct 2020 01:13:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TAFWxsOanIYlBkAffZ63VmGzc3o7uSPDiniedrl1nrI=; b=iRQaVdFMgwYBEKFf7ij0thrSh9
	Oxgy6vCJ11aTHwRd5VGI12nymy+kOOO/sPrcGmCqTrY520L483hb7apvCrhfkNgcjr8OB9je7VD21
	txJ68ZV0K/S2xtUM7/gxMepGeXUSSES1awRoYOriezZzCWygxfzIwMTfL5uuA4mJRjT4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3n-0005Rc-UK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3n-00044L-Sq
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kPF3n-00044L-Sq@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:03 +0000

commit 5867a14ac1747d7411066d7fb2cf238658346ab0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 16:23:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:23:59 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a8d182b584..53c17bd354 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -178,6 +178,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index ce45298377..c35f4b23b6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,7 +107,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2803.8010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF40-0002KI-HM; Mon, 05 Oct 2020 01:13:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2803.8010; Mon, 05 Oct 2020 01:13:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF40-0002KA-EP; Mon, 05 Oct 2020 01:13:16 +0000
Received: by outflank-mailman (input) for mailman id 2803;
 Mon, 05 Oct 2020 01:13:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF3z-0002Jx-3g
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b2179793-9871-4201-9e4a-714e19f54feb;
 Mon, 05 Oct 2020 01:13:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3y-0005Rn-1F
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF3y-000455-0R
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF3z-0002Jx-3g
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:15 +0000
X-Inumbo-ID: b2179793-9871-4201-9e4a-714e19f54feb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b2179793-9871-4201-9e4a-714e19f54feb;
	Mon, 05 Oct 2020 01:13:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xXKSSp60agNNPPjW2kA8ETsC979a2a2VtE35pvqeqeM=; b=pl24ixjgc6ipo9y6fp+b1sDR36
	mAFqj215MN6K98RlQNI1ObqslgeIATNWHteEcjd05raAhDKX727RVRI+LdwFNxaHkNxejWYAxlmwD
	339yWBVgX1j9/VAlYPseIEXmdItl2h7Wh+TLd4TihnAIzEOp8e+fC5K/+r+Af/cLFXCk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3y-0005Rn-1F
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF3y-000455-0R
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kPF3y-000455-0R@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:14 +0000

commit e1364e05f92d6c2f12cc77f100cea584354c66cb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:24:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:24:29 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/schedule.c      | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53c17bd354..08ffe0f063 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -151,7 +151,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1396,13 +1396,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 230f440f14..2f13d92128 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -478,7 +478,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -488,7 +488,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -546,6 +546,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -562,8 +564,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index ccc20ce040..6b1ae7bf8c 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1434,7 +1434,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index c35f4b23b6..e1b299e8df 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,6 +105,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 9f7bc69293..c93c6d8bc1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -382,7 +382,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2804.8014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4A-0002LU-JA; Mon, 05 Oct 2020 01:13:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2804.8014; Mon, 05 Oct 2020 01:13:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4A-0002LL-Ft; Mon, 05 Oct 2020 01:13:26 +0000
Received: by outflank-mailman (input) for mailman id 2804;
 Mon, 05 Oct 2020 01:13:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF49-0002LD-8V
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3fc3067f-02e0-428e-a897-2ef4966d16db;
 Mon, 05 Oct 2020 01:13:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF48-0005Rt-4B
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF48-00046M-3Q
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF49-0002LD-8V
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:25 +0000
X-Inumbo-ID: 3fc3067f-02e0-428e-a897-2ef4966d16db
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3fc3067f-02e0-428e-a897-2ef4966d16db;
	Mon, 05 Oct 2020 01:13:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=huewcT+S/zXQgEcA4vUUFEe1eTIta1oyTQGYRXb0MTM=; b=atumYK7j90b4WF0Z/R9WKDvGUl
	hb0uWjC2/LvR13brwh8dwd2NbK3xVy7MshTPi/pmQdfmOyj6D+u5Xj9z1MfSSOnxtf8t8XEIb5ib5
	FhpHa8a0hRYpICfyUGOnzdXRfqaLtuwY2+7OKhefcZGAMKTkGeRZbR1bBIlg6dN6L5io=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF48-0005Rt-4B
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF48-00046M-3Q
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kPF48-00046M-3Q@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:24 +0000

commit a8122e991da70ac1ee9f88e34e003d2169a5b114
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:25:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:25:16 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 08ffe0f063..6a566917b1 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -188,6 +188,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -211,11 +213,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -258,6 +275,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -351,6 +369,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -488,7 +507,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -536,6 +555,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1011,10 +1031,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1024,7 +1044,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1033,7 +1055,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1219,10 +1241,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1238,7 +1259,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1314,6 +1338,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long, BITS_TO_LONGS(d->max_vcpus));
@@ -1340,6 +1365,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index c93c6d8bc1..caa80e9051 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -384,6 +384,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2805.8018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4K-0002Mj-KU; Mon, 05 Oct 2020 01:13:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2805.8018; Mon, 05 Oct 2020 01:13:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4K-0002Mb-HP; Mon, 05 Oct 2020 01:13:36 +0000
Received: by outflank-mailman (input) for mailman id 2805;
 Mon, 05 Oct 2020 01:13:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF4J-0002MS-ED
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2a55f2c3-a567-43dd-9565-29ef0c17c5f5;
 Mon, 05 Oct 2020 01:13:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4I-0005S0-76
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4I-00047R-6T
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF4J-0002MS-ED
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:35 +0000
X-Inumbo-ID: 2a55f2c3-a567-43dd-9565-29ef0c17c5f5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2a55f2c3-a567-43dd-9565-29ef0c17c5f5;
	Mon, 05 Oct 2020 01:13:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JaxVtPnTzN4XaJVtL2/C4H7mF+Q7QH1kae6p1g9YXAo=; b=4x5am2QHhZViCW5MvThmKa1h/V
	IPO4puGsekft1pWTCp/jmKhz8kvZXe2mj8XNgXLb1XUIMn2d5xz6QHDM/J4q3nuYJkWuiKgFgObqP
	4Akb6diFl6ll53KHlgIGsPJvKx8ukNRnJYheVgeFau3b6A8FvjuuwDLfnyujcjQ2bZRk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4I-0005S0-76
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4I-00047R-6T
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kPF4I-00047R-6T@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:34 +0000

commit 21054297bf832d8eacd73dc428f55168522b0d86
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:26:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:26:01 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6a566917b1..0e550e9c7a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -248,6 +248,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -263,14 +264,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -283,26 +284,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -312,6 +319,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -347,7 +355,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -364,7 +372,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -387,6 +395,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -424,14 +433,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -448,6 +457,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( domain_vcpu(d, vcpu) == NULL )
         return -ENOENT;
@@ -459,13 +469,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -509,6 +519,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -541,14 +552,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -569,6 +580,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -668,14 +680,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -683,9 +695,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -705,13 +717,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -746,7 +759,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1238,6 +1251,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1250,14 +1264,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1280,11 +1294,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1294,7 +1309,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2806.8022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4U-0002OH-NJ; Mon, 05 Oct 2020 01:13:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2806.8022; Mon, 05 Oct 2020 01:13:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4U-0002O9-KM; Mon, 05 Oct 2020 01:13:46 +0000
Received: by outflank-mailman (input) for mailman id 2806;
 Mon, 05 Oct 2020 01:13:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF4T-0002O1-Qt
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 76b4533e-9a37-4fca-af16-638b75a64f28;
 Mon, 05 Oct 2020 01:13:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4S-0005Sc-AA
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4S-00048b-9S
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF4T-0002O1-Qt
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:45 +0000
X-Inumbo-ID: 76b4533e-9a37-4fca-af16-638b75a64f28
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 76b4533e-9a37-4fca-af16-638b75a64f28;
	Mon, 05 Oct 2020 01:13:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mbo9zQ3jfWYpBEmm1zeKmY9FfYEA9HHduF3HVRiUzKQ=; b=qJ7wW4KTRps9yxmgUsD+v9o1Ow
	X+wM9ymDwyqdlnGri7ZuGVzMNnrg9RTgUKe+tntbTnvRYkSz0CUKVCD0JZ7ZP1tTB8XIB1X8mLRdk
	k5v42zi768NOJgR7Uw72mtOZAjgV3I9J24ttWLdC/ELOGMdZVHRRj1+UkdCx5d1XBQWE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4S-0005Sc-AA
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4S-00048b-9S
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: address races with evtchn_reset()
Message-Id: <E1kPF4S-00048b-9S@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:44 +0000

commit 43572a4cd97902ba0155b922a4d2e99fb945ec2b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:26:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:26:32 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index ed32318659..bb95583742 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2474,14 +2474,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i++];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("d%d:%3d(%c%c%c)%c",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       info->masked ? 'M' : '-',
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-',
                        i < action->nr_guests ? ',' : '\n');
             }
         }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index ac17533923..bbecbfa16f 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -660,8 +660,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0e550e9c7a..878e4250ed 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -156,8 +156,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -774,6 +775,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -784,7 +786,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -813,7 +818,9 @@ void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -823,6 +830,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -837,7 +845,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1034,12 +1044,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1449,8 +1462,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 2f13d92128..68d0c7a632 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -296,23 +296,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index 98a85233cb..5e09ede6d7 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline bool arch_virq_is_global(unsigned int virq)
     return true;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index e1b299e8df..bc9aa68650 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -133,6 +133,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -165,19 +183,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -193,38 +216,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -233,6 +285,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:13:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:13:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2807.8026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4f-0002PZ-P2; Mon, 05 Oct 2020 01:13:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2807.8026; Mon, 05 Oct 2020 01:13:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4f-0002PQ-M1; Mon, 05 Oct 2020 01:13:57 +0000
Received: by outflank-mailman (input) for mailman id 2807;
 Mon, 05 Oct 2020 01:13:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF4e-0002PF-Bx
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 819518fb-39ac-4605-b5a2-001930fdad2e;
 Mon, 05 Oct 2020 01:13:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4c-0005Sk-DA
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4c-0004A0-CV
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF4e-0002PF-Bx
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:56 +0000
X-Inumbo-ID: 819518fb-39ac-4605-b5a2-001930fdad2e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 819518fb-39ac-4605-b5a2-001930fdad2e;
	Mon, 05 Oct 2020 01:13:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i5/3OtLBoutV+HzFmZZh8AI/NzrXvOtke3bjSqDiuJE=; b=50QaXeLbCVZtuu+02IJ9SBm+oV
	/W/kyhYWJlz+USB06z7JOUUZlzfUiuJzTLsd8RaMz3ozlOWgkrwjetMmbh9B78TitbLwzuiZVofxZ
	MpvJGuqL+TM1JvlaQlUyewGskCy70HT1M6oe2SY3b1Zct4aYKN+b6aNeg5czmurJqHT0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4c-0005Sk-DA
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4c-0004A0-CV
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:13:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kPF4c-0004A0-CV@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:13:54 +0000

commit 54becf611dcc77f3f49eb8238a7c401eba7ca78b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:27:07 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:27:07 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 30b5f7f898..2ff6a79500 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -770,12 +770,14 @@ int domain_kill(struct domain *d)
             return domain_kill(d);
         d->is_dying = DOMDYING_dying;
         argo_destroy(d);
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         vnuma_destroy(d->vnuma);
         domain_set_outstanding_pages(d, 0);
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 878e4250ed..3b1fe423df 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1297,7 +1297,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1309,7 +1318,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1380,8 +1399,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1390,14 +1408,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index caa80e9051..b740cfdf9f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -136,7 +136,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d, unsigned int max_port);
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:14:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:14:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2808.8030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4o-0002Sv-R2; Mon, 05 Oct 2020 01:14:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2808.8030; Mon, 05 Oct 2020 01:14:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4o-0002Sm-Na; Mon, 05 Oct 2020 01:14:06 +0000
Received: by outflank-mailman (input) for mailman id 2808;
 Mon, 05 Oct 2020 01:14:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF4n-0002S0-Lh
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6d343832-abe5-4154-87ee-3a1c733e7f9c;
 Mon, 05 Oct 2020 01:14:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4m-0005T5-He
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4m-0004BI-FX
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF4n-0002S0-Lh
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:05 +0000
X-Inumbo-ID: 6d343832-abe5-4154-87ee-3a1c733e7f9c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6d343832-abe5-4154-87ee-3a1c733e7f9c;
	Mon, 05 Oct 2020 01:14:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ESGmZKvzOLzjrJ0mCcr4pJRnjMdxFemNU56OK+HTXZc=; b=nRqS05dUPaKwXWWoaCp7X2zqWF
	qYIEt1Fq9PJ2V/SiVUE+ot92Nr2bvMjAZTREr7CyiUYIrD0SKzuvurmTVQfvUfotxYS2OC3sZWVUW
	Qa3LZ5AlfeMQDXio4Ot+fHdr3hZQx9xSP6IfqLQZApPQm3mA+Xpzn8nZ6jrmyEqdxEY8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4m-0005T5-He
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4m-0004BI-FX
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kPF4m-0004BI-FX@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:14:04 +0000

commit b015fbe509188dca47b6c7102a934a7b9ced2a9e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:28:08 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:28:08 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2ff6a79500..e0dd88f0f4 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1214,7 +1214,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1228,7 +1228,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 03d0226039..7fe4f4a30c 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -572,12 +572,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 3b1fe423df..d2ee83bbbf 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1057,7 +1057,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1065,11 +1065,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1204,7 +1233,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1217,9 +1247,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index e313da499f..b957dc5a92 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1152,7 +1152,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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 44c549dd6b..a1949191c6 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index bc9aa68650..fa93a3684a 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -179,7 +179,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b740cfdf9f..d6e27fc4b8 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -394,6 +394,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -663,7 +665,7 @@ int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 void domain_pause_for_debugger(void);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:14:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:14:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2809.8034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4y-0002US-Ty; Mon, 05 Oct 2020 01:14:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2809.8034; Mon, 05 Oct 2020 01:14:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF4y-0002UK-QZ; Mon, 05 Oct 2020 01:14:16 +0000
Received: by outflank-mailman (input) for mailman id 2809;
 Mon, 05 Oct 2020 01:14:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF4x-0002UC-SP
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eeb28b74-2d56-437d-9092-d1a7c548b135;
 Mon, 05 Oct 2020 01:14:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4w-0005TF-LA
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF4w-0004CP-Jy
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF4x-0002UC-SP
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:15 +0000
X-Inumbo-ID: eeb28b74-2d56-437d-9092-d1a7c548b135
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eeb28b74-2d56-437d-9092-d1a7c548b135;
	Mon, 05 Oct 2020 01:14:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OvrJK7N89cftUe0/8gSdl7sLy8F9a4g1nOVrbtOmbiI=; b=yErR/Mw+hP+rv6RNSBGq6PiEF+
	CXCgFKZqs8JpIYVlQXB294RZoz4BSym/ltO1nr5wbUZNk4oUJGxAazZyhDloGfnPQi1m8d0S/BT7C
	2eNUD4h99d3ATnfVkXnIgGI9YRJBAaAd8f1reqgjg+/nf3cS+hl8OFeKrL/bii/+xCGQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4w-0005TF-LA
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF4w-0004CP-Jy
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] hvmloader: indicate ACPI tables with "ACPI data" type in e820
Message-Id: <E1kPF4w-0004CP-Jy@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:14:14 +0000

commit f63b20a213ecaa672cf40b4627eb1eea9542cb58
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Sep 22 17:40:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:40:36 2020 +0200

    hvmloader: indicate ACPI tables with "ACPI data" type in e820
    
    Guest kernel does need to know in some cases where the tables are located
    to treat these regions properly. One example is kexec process where
    the first kernel needs to pass ACPI region locations to the second
    kernel which is now a requirement in Linux after 02a3e3cdb7f12 ("x86/boot:
    Parse SRAT table and count immovable memory regions") in order for kexec
    transition to actually work.
    
    That commit introduced accesses to XSDT and SRAT while the second kernel
    is still using kexec transition tables. The transition tables do not have
    e820 "reserved" regions mapped where those tables are located currently
    in a Xen guest. Instead "ACPI data" regions are mapped with the transition
    tables that was introduced by the following commit 6bbeb276b7 ("x86/kexec:
    Add the EFI system tables and ACPI tables to the ident map").
    
    Reserve 1MB (out of 16MB currently available) right after ACPI info page for
    ACPI tables exclusively but populate this region on demand and only indicate
    populated memory as "ACPI data" since according to ACPI spec that memory is
    reclaimable by the guest if necessary. That is close to how we treat
    the same ACPI data in PVH guests. 1MB should be enough for now but could be
    later extended if required.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8efa46516c5f4cf185c8df179812c185d3c27eb6
    master date: 2020-09-09 17:56:13 +0200
---
 tools/firmware/hvmloader/config.h    |  6 +++++-
 tools/firmware/hvmloader/e820.c      | 26 ++++++++++++++++++++++----
 tools/firmware/hvmloader/hvmloader.c |  3 ++-
 tools/firmware/hvmloader/pci.c       |  1 -
 tools/firmware/hvmloader/util.c      | 29 ++++++++++++++++++++++++++++-
 tools/firmware/hvmloader/util.h      |  2 ++
 6 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index d9b4713d63..844120bc87 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -2,6 +2,7 @@
 #define __HVMLOADER_CONFIG_H__
 
 #include <stdint.h>
+#include <stdbool.h>
 
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
@@ -62,6 +63,8 @@ extern uint8_t ioapic_version;
 extern unsigned long pci_mem_start, pci_mem_end;
 extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 
+extern bool acpi_enabled;
+
 /* Memory map. */
 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
 #define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
@@ -71,7 +74,8 @@ extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 #define RESERVED_MEMBASE              0xFC000000
 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
-#define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
+#define ACPI_MEMORY_DYNAMIC_START     0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_START 0xFC100000
 #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
 /*
  * GUEST_RESERVED: Physical address space reserved for guest use.
diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 4d1c955a02..38bcf18b63 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -155,6 +155,9 @@ int build_e820_table(struct e820entry *e820,
 {
     unsigned int nr = 0, i, j;
     uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    unsigned long acpi_mem_end = acpi_enabled ?
+        ACPI_MEMORY_DYNAMIC_START + (acpi_pages_allocated() << PAGE_SHIFT) :
+        RESERVED_MEMBASE;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -198,9 +201,24 @@ int build_e820_table(struct e820entry *e820,
     e820[nr].type = E820_RESERVED;
     nr++;
 
+    /*
+     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * That should help the guest to treat it correctly later: e.g. pass to
+     * the next kernel on kexec or reclaim if necessary.
+     */
+
+    if ( acpi_enabled )
+    {
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
+        e820[nr].type = E820_ACPI;
+        nr++;
+    }
+
     /*
      * Explicitly reserve space for special pages.
-     * This space starts at RESERVED_MEMBASE an extends to cover various
+     * This space starts right after ACPI region (to avoid creating a hole that
+     * might be accidentally occupied by MMIO) and extends to cover various
      * fixed hardware mappings (e.g., LAPIC, IOAPIC, default SVGA framebuffer).
      *
      * If igd_opregion_pgbase we need to split the RESERVED region in two.
@@ -210,8 +228,8 @@ int build_e820_table(struct e820entry *e820,
     {
         uint32_t igd_opregion_base = igd_opregion_pgbase << PAGE_SHIFT;
 
-        e820[nr].addr = RESERVED_MEMBASE;
-        e820[nr].size = (uint32_t) igd_opregion_base - RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
+        e820[nr].size = igd_opregion_base - acpi_mem_end;
         e820[nr].type = E820_RESERVED;
         nr++;
 
@@ -227,7 +245,7 @@ int build_e820_table(struct e820entry *e820,
     }
     else
     {
-        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
         e820[nr].size = (uint32_t)-e820[nr].addr;
         e820[nr].type = E820_RESERVED;
         nr++;
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 598a226278..c58841e5b5 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -116,6 +116,8 @@ unsigned long scratch_start = SCRATCH_PHYSICAL_ADDRESS;
 uint32_t ioapic_base_address = 0xfec00000;
 uint8_t ioapic_version;
 
+bool acpi_enabled;
+
 static void init_hypercalls(void)
 {
     uint32_t eax, ebx, ecx, edx;
@@ -321,7 +323,6 @@ const struct hvm_modlist_entry *get_module_entry(
 int main(void)
 {
     const struct bios_config *bios;
-    int acpi_enabled;
     const struct hvm_modlist_entry *bios_module;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index dcd097a866..72f92d4450 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -28,7 +28,6 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
-#include <stdbool.h>
 
 unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START;
 unsigned long pci_mem_end = PCI_MEM_END;
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 0c3f2d24cd..7da144b0bb 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -871,10 +871,37 @@ static unsigned long acpi_v2p(struct acpi_ctxt *ctxt, void *v)
     return virt_to_phys(v);
 }
 
+static unsigned long acpi_alloc_up = ACPI_MEMORY_DYNAMIC_START - 1;
+
+unsigned long acpi_pages_allocated(void)
+{
+    return (acpi_alloc_up >> PAGE_SHIFT) -
+            ((ACPI_MEMORY_DYNAMIC_START - 1) >> PAGE_SHIFT);
+}
+
 static void *acpi_mem_alloc(struct acpi_ctxt *ctxt,
                             uint32_t size, uint32_t align)
 {
-    return mem_alloc(size, align);
+    unsigned long s, e;
+
+    /* Align to at least 16 bytes. */
+    if ( align < 16 )
+        align = 16;
+
+    s = (acpi_alloc_up + align) & ~(align - 1);
+    e = s + size - 1;
+
+    BUG_ON((e < s) || (e >= RESERVED_MEMORY_DYNAMIC_START));
+
+    while ( (acpi_alloc_up >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
+    {
+        acpi_alloc_up += PAGE_SIZE;
+        mem_hole_populate_ram(acpi_alloc_up >> PAGE_SHIFT, 1);
+    }
+
+    acpi_alloc_up = e;
+
+    return (void *)s;
 }
 
 static void acpi_mem_free(struct acpi_ctxt *ctxt,
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 7bca6418d2..31889de634 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -282,6 +282,8 @@ bool check_overlap(uint64_t start, uint64_t size,
 extern const unsigned char dsdt_anycpu_qemu_xen[], dsdt_anycpu[], dsdt_15cpu[];
 extern const int dsdt_anycpu_qemu_xen_len, dsdt_anycpu_len, dsdt_15cpu_len;
 
+unsigned long acpi_pages_allocated(void);
+
 struct acpi_config;
 void hvmloader_acpi_build_tables(struct acpi_config *config,
                                  unsigned int physical);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:14:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:14:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2810.8038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF59-0002Vm-VN; Mon, 05 Oct 2020 01:14:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2810.8038; Mon, 05 Oct 2020 01:14:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF59-0002Ve-SF; Mon, 05 Oct 2020 01:14:27 +0000
Received: by outflank-mailman (input) for mailman id 2810;
 Mon, 05 Oct 2020 01:14:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF58-0002VQ-BT
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 509ad46f-87bb-44e5-b123-297f473cb97f;
 Mon, 05 Oct 2020 01:14:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF56-0005TU-Of
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF56-0004Dh-Nv
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF58-0002VQ-BT
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:26 +0000
X-Inumbo-ID: 509ad46f-87bb-44e5-b123-297f473cb97f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 509ad46f-87bb-44e5-b123-297f473cb97f;
	Mon, 05 Oct 2020 01:14:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TRa3cXqSRKnSfRoSHexnZoRuvj1XxSND5chn0Qb64CE=; b=BlDgYMxtGKRTJc+nT6o2Q3LnHX
	LQzK1wklsy1q9SVwARGSngsEM4EUMj74RGqPbsqqhQzP/ubhUF1pFQjzJ0RATPwE3XDUXLYv+3Qoi
	CRtyo0yH2i2kcXD5oIdSS8Vthd5O5pNBvkCWQNRfe5wcjJmgzvtoE9fKLlKN5YZj42i4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF56-0005TU-Of
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF56-0004Dh-Nv
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/HVM: more consistently set I/O completion
Message-Id: <E1kPF56-0004Dh-Nv@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:14:24 +0000

commit 88f5b414ac0f8008c1e2b26f93c3d980120941f7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:40:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:40:59 2020 +0200

    x86/HVM: more consistently set I/O completion
    
    Doing this just in hvm_emulate_one_insn() is not enough.
    hvm_ud_intercept() and hvm_emulate_one_vm_event() can get invoked for
    insns requiring one or more continuations, and at least in principle
    hvm_emulate_one_mmio() could, too. Without proper setting of the field,
    handle_hvm_io_completion() will do nothing completion-wise, and in
    particular the missing re-invocation of the insn emulation paths will
    lead to emulation caching not getting disabled in due course, causing
    the ASSERT() in {svm,vmx}_vmenter_helper() to trigger.
    
    Reported-by: Don Slutz <don.slutz@gmail.com>
    
    Similar considerations go for the clearing of vio->mmio_access, which
    gets moved as well.
    
    Additionally all updating of vio->mmio_* now gets done dependent upon
    the new completion value, rather than hvm_ioreq_needs_completion()'s
    return value. This is because it is the completion chosen which controls
    what path will be taken when handling the completion, not the simple
    boolean return value. In particular, PIO completion doesn't involve
    going through the insn emulator, and hence emulator state ought to get
    cleared early (or it won't get cleared at all).
    
    The new logic, besides allowing for a caller override for the
    continuation type to be set (for VMX real mode emulation), will also
    avoid setting an MMIO completion when a simpler PIO one will do. This
    is a minor optimization only as a side effect - the behavior is strictly
    needed at least for hvm_ud_intercept(), as only memory accesses can
    successfully complete through handle_mmio(). Care of course needs to be
    taken to correctly deal with "mixed" insns (doing both MMIO and PIO at
    the same time, i.e. INS/OUTS). For this, hvmemul_validate() now latches
    whether the insn being emulated is a memory access, as this information
    is no longer easily available at the point where we want to consume it.
    
    Note that the presence of non-NULL .validate fields in the two ops
    structures in hvm_emulate_one_mmio() was really necessary even before
    the changes here: Without this, passing non-NULL as middle argument to
    hvm_emulate_init_once() is meaningless.
    
    The restrictions on when the #UD intercept gets actually enabled are why
    it was decided that this is not a security issue:
    - the "hvm_fep" option to enable its use is a debugging option only,
    - for the cross-vendor case is considered experimental, even if
      unfortunately SUPPORT.md doesn't have an explicit statement about
      this.
    The other two affected functions are
    - hvm_emulate_one_vm_event(), used for introspection,
    - hvm_emulate_one_mmio(), used for Dom0 only,
    which aren't qualifying this as needing an XSA either.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Don Slutz <don.slutz@gmail.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: b807cfe954b8d0d8852398b4c8a586d95d69a342
    master date: 2020-09-15 10:19:33 +0200
---
 xen/arch/x86/hvm/emulate.c        | 51 ++++++++++++++++++++++++++++++---------
 xen/arch/x86/hvm/hvm.c            |  2 +-
 xen/arch/x86/hvm/io.c             | 11 +--------
 xen/arch/x86/hvm/vmx/realmode.c   |  6 +----
 xen/include/asm-x86/hvm/emulate.h |  7 +++++-
 5 files changed, 49 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 637034b6a1..f4620ff044 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1603,9 +1603,11 @@ static int hvmemul_validate(
     const struct x86_emulate_state *state,
     struct x86_emulate_ctxt *ctxt)
 {
-    const struct hvm_emulate_ctxt *hvmemul_ctxt =
+    struct hvm_emulate_ctxt *hvmemul_ctxt =
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
 
+    hvmemul_ctxt->is_mem_access = x86_insn_is_mem_access(state, ctxt);
+
     return !hvmemul_ctxt->validate || hvmemul_ctxt->validate(state, ctxt)
            ? X86EMUL_OKAY : X86EMUL_UNHANDLEABLE;
 }
@@ -2516,8 +2518,14 @@ static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
     .vmfunc        = hvmemul_vmfunc,
 };
 
+/*
+ * Note that passing HVMIO_no_completion into this function serves as kind
+ * of (but not fully) an "auto select completion" indicator.  When there's
+ * no completion needed, the passed in value will be ignored in any case.
+ */
 static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
-    const struct x86_emulate_ops *ops)
+    const struct x86_emulate_ops *ops,
+    enum hvm_io_completion completion)
 {
     const struct cpu_user_regs *regs = hvmemul_ctxt->ctxt.regs;
     struct vcpu *curr = current;
@@ -2535,15 +2543,30 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
         rc = X86EMUL_RETRY;
 
     if ( !hvm_ioreq_needs_completion(&vio->io_req) )
+        completion = HVMIO_no_completion;
+    else if ( completion == HVMIO_no_completion )
+        completion = (vio->io_req.type != IOREQ_TYPE_PIO ||
+                      hvmemul_ctxt->is_mem_access) ? HVMIO_mmio_completion
+                                                   : HVMIO_pio_completion;
+
+    switch ( vio->io_completion = completion )
     {
+    case HVMIO_no_completion:
+    case HVMIO_pio_completion:
         vio->mmio_cache_count = 0;
         vio->mmio_insn_bytes = 0;
-    }
-    else
-    {
+        vio->mmio_access = (struct npfec){};
+        break;
+
+    case HVMIO_mmio_completion:
+    case HVMIO_realmode_completion:
         BUILD_BUG_ON(sizeof(vio->mmio_insn) < sizeof(hvmemul_ctxt->insn_buf));
         vio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
         memcpy(vio->mmio_insn, hvmemul_ctxt->insn_buf, vio->mmio_insn_bytes);
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
     }
 
     if ( hvmemul_ctxt->ctxt.retire.singlestep )
@@ -2584,9 +2607,10 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
 }
 
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt)
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion)
 {
-    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops);
+    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
 int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
@@ -2595,11 +2619,13 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmcfg_intercept_write,
+        .validate   = hvmemul_validate,
     };
     static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmio_ro_emulated_write,
+        .validate   = hvmemul_validate,
     };
     struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla };
     struct hvm_emulate_ctxt ctxt;
@@ -2619,8 +2645,8 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
     hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
                           guest_cpu_user_regs());
     ctxt.ctxt.data = &mmio_ro_ctxt;
-    rc = _hvm_emulate_one(&ctxt, ops);
-    switch ( rc )
+
+    switch ( rc = _hvm_emulate_one(&ctxt, ops, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
@@ -2647,7 +2673,8 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     switch ( kind )
     {
     case EMUL_KIND_NOWRITE:
-        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write);
+        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write,
+                              HVMIO_no_completion);
         break;
     case EMUL_KIND_SET_CONTEXT_INSN: {
         struct vcpu *curr = current;
@@ -2668,7 +2695,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     /* Fall-through */
     default:
         ctx.set_context = (kind == EMUL_KIND_SET_CONTEXT_DATA);
-        rc = hvm_emulate_one(&ctx);
+        rc = hvm_emulate_one(&ctx, HVMIO_no_completion);
     }
 
     switch ( rc )
@@ -2765,6 +2792,8 @@ void hvm_emulate_init_per_insn(
         hvmemul_ctxt->insn_buf_bytes = insn_bytes;
         memcpy(hvmemul_ctxt->insn_buf, insn_buf, insn_bytes);
     }
+
+    hvmemul_ctxt->is_mem_access = false;
 }
 
 void hvm_emulate_writeback(
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 704ac8b1bf..d946d16335 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3792,7 +3792,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
         return;
     }
 
-    switch ( hvm_emulate_one(&ctxt) )
+    switch ( hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 724ab44a76..3e09d9b726 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -81,20 +81,11 @@ void send_invalidate_req(void)
 bool hvm_emulate_one_insn(hvm_emulate_validate_t *validate, const char *descr)
 {
     struct hvm_emulate_ctxt ctxt;
-    struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     hvm_emulate_init_once(&ctxt, validate, guest_cpu_user_regs());
 
-    rc = hvm_emulate_one(&ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_mmio_completion;
-    else
-        vio->mmio_access = (struct npfec){};
-
-    switch ( rc )
+    switch ( rc = hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
         hvm_dump_emulation_state(XENLOG_G_WARNING, descr, &ctxt, rc);
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index bb0b4439df..b1d445923a 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -96,15 +96,11 @@ static void realmode_deliver_exception(
 void vmx_realmode_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt)
 {
     struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     perfc_incr(realmode_emulations);
 
-    rc = hvm_emulate_one(hvmemul_ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_realmode_completion;
+    rc = hvm_emulate_one(hvmemul_ctxt, HVMIO_realmode_completion);
 
     if ( rc == X86EMUL_UNHANDLEABLE )
     {
diff --git a/xen/include/asm-x86/hvm/emulate.h b/xen/include/asm-x86/hvm/emulate.h
index b39a1a0331..7d3e13d3c3 100644
--- a/xen/include/asm-x86/hvm/emulate.h
+++ b/xen/include/asm-x86/hvm/emulate.h
@@ -46,6 +46,8 @@ struct hvm_emulate_ctxt {
 
     uint32_t intr_shadow;
 
+    bool is_mem_access;
+
     bool_t set_context;
 };
 
@@ -56,11 +58,14 @@ enum emul_kind {
     EMUL_KIND_SET_CONTEXT_INSN
 };
 
+enum hvm_io_completion;
+
 bool __nonnull(1, 2) hvm_emulate_one_insn(
     hvm_emulate_validate_t *validate,
     const char *descr);
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt);
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion);
 void hvm_emulate_one_vm_event(enum emul_kind kind,
     unsigned int trapnr,
     unsigned int errcode);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 01:14:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 01:14:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2812.8041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF5J-0002Wt-0Z; Mon, 05 Oct 2020 01:14:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2812.8041; Mon, 05 Oct 2020 01:14:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPF5I-0002Wm-Tw; Mon, 05 Oct 2020 01:14:36 +0000
Received: by outflank-mailman (input) for mailman id 2812;
 Mon, 05 Oct 2020 01:14:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPF5H-0002Wd-Vl
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id de978a64-b729-4ebf-b20e-85684b91758a;
 Mon, 05 Oct 2020 01:14:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF5G-0005Tc-SX
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPF5G-0004Eg-Qy
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPF5H-0002Wd-Vl
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:36 +0000
X-Inumbo-ID: de978a64-b729-4ebf-b20e-85684b91758a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id de978a64-b729-4ebf-b20e-85684b91758a;
	Mon, 05 Oct 2020 01:14:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I0OqSj6HoCVwj/RYuqpXJp+fqT4P5/WMzvTO0vg0ujU=; b=myO19LDaqEoMzsa3t1ooPjJGq1
	UWja+OwPcqhYkutNxpDbhR89Ek+xj3dVmAzoEdCTH08TgwbiADIZNzO3inkm2pehGZ9ycKosMYccX
	86uLRIMvr6ZByQprf5CNKo+wR9N182vrpxvulWSObB3X3FSZHZ+BfRsQ9RaCFwtjz2+0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF5G-0005Tc-SX
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPF5G-0004Eg-Qy
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 01:14:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kPF5G-0004Eg-Qy@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 01:14:34 +0000

commit 8e7e5857a203c9d9df7733fd68768555c7e76839
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:35:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:35:11 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index e22d6160b5..2ba3ec95b4 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index cf7f25cda2..794f465321 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -280,6 +280,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2836.8077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIwm-00009a-NJ; Mon, 05 Oct 2020 05:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2836.8077; Mon, 05 Oct 2020 05:22:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIwm-00009U-KC; Mon, 05 Oct 2020 05:22:04 +0000
Received: by outflank-mailman (input) for mailman id 2836;
 Mon, 05 Oct 2020 05:22:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIwl-00009P-BG
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 54bc7cc0-5332-4249-93cc-4db4bc7c3a4d;
 Mon, 05 Oct 2020 05:22:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIwk-0003Tu-3y
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIwk-000311-2N
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIwl-00009P-BG
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:03 +0000
X-Inumbo-ID: 54bc7cc0-5332-4249-93cc-4db4bc7c3a4d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 54bc7cc0-5332-4249-93cc-4db4bc7c3a4d;
	Mon, 05 Oct 2020 05:22:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MKqc9GWvFbt4Fu27dy5677lhril6uluv8DrbKsykZgI=; b=wmwtiJ3o9s21Zq/AfjYB9NUb/A
	uC1Uh33xOeLBxyGYZ+owYJcHUpSAdz2gXDZ+6R868XaZEfimoLMTuL9S+NbikemUm0cLLXPTcF7vN
	mKNF+MZVxlr9jAUhb6d9Yl27aU1/P+qMyLZPdVbx370boTOTsJJ+Z6dbyVWdCGa5+fM0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIwk-0003Tu-3y
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIwk-000311-2N
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
Message-Id: <E1kPIwk-000311-2N@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:02 +0000

commit 7129b9e7264b2e992845ba84a5d871a4ef6bab8b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:15:39 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:15:39 2020 +0200

    x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
    
    This MSR doesn't exist on AMD hardware, and switching away from the safe
    functions in the common MSR path was an erroneous change.
    
    Partially revert the change.
    
    This is XSA-333.
    
    Fixes: 4fdc932b3cc ("x86/Intel: drop another 32-bit leftover")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index c23822c675..8120ded330 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -924,7 +924,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, *val);
+        if ( rdmsr_safe(reg, *val) )
+            break;
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1079,7 +1080,8 @@ static int write_msr(unsigned int reg, uint64_t val,
         break;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, temp);
+        if ( rdmsr_safe(reg, temp) )
+            break;
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2837.8081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIwy-0000BN-Oz; Mon, 05 Oct 2020 05:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2837.8081; Mon, 05 Oct 2020 05:22:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIwy-0000BE-Lr; Mon, 05 Oct 2020 05:22:16 +0000
Received: by outflank-mailman (input) for mailman id 2837;
 Mon, 05 Oct 2020 05:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIww-0000B2-Ms
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2338ec51-ce30-4787-aed7-9d4e21c17284;
 Mon, 05 Oct 2020 05:22:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIwu-0003Tx-8M
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIwu-00031m-6W
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIww-0000B2-Ms
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:14 +0000
X-Inumbo-ID: 2338ec51-ce30-4787-aed7-9d4e21c17284
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2338ec51-ce30-4787-aed7-9d4e21c17284;
	Mon, 05 Oct 2020 05:22:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DRH87LIQ5pG52FbPcW5k/+7L5DOKqk3nSePSaTmGBIc=; b=ZJo4Olg6YpWla81YG/K9nW6/Ge
	OhVg/pc7dJZoUH6G6Vh9IXaSHhQtBu9l2ftje4rBPKwBPwTMquLRFpbGOvC4eciqSxD/jAJQBOmA4
	8AgJbW3xFzyj0LN7dgDSWXgGPJB9wvOZBafMGW04bRXZf5wqyfE942QMiLh56u44vsGY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIwu-0003Tx-8M
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIwu-00031m-6W
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kPIwu-00031m-6W@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:12 +0000

commit 7bf49839ec9bbde6206bbe9ceda958948c06dcfa
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:16:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:16:12 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 77 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 47 insertions(+), 39 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index aa7d7476ed..07a412a829 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -627,6 +627,8 @@ int hvm_domain_initialise(struct domain *d)
     /* need link to containing domain */
     d->arch.hvm_domain.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm_domain.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index d5363caec7..721015ca7a 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -152,23 +152,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm_vcpu.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    read_unlock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm_vcpu.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -218,7 +227,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -226,7 +235,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -234,7 +243,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -247,7 +256,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -272,7 +281,7 @@ int pt_update_irq(struct vcpu *v)
     uint64_t max_lag;
     int irq, pt_vector = -1;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -300,14 +309,14 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -377,12 +386,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -421,7 +430,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -432,12 +441,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -455,7 +464,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    write_lock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -504,7 +513,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    write_unlock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -529,30 +538,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm_vcpu.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 0eb5ff632e..ed8de96191 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -133,6 +133,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2838.8086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIx6-0000Ci-QP; Mon, 05 Oct 2020 05:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2838.8086; Mon, 05 Oct 2020 05:22:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIx6-0000Ca-NU; Mon, 05 Oct 2020 05:22:24 +0000
Received: by outflank-mailman (input) for mailman id 2838;
 Mon, 05 Oct 2020 05:22:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIx5-0000CS-Db
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 97f76a23-e70f-4dc3-abc9-9e54f7e69c33;
 Mon, 05 Oct 2020 05:22:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIx4-0003U5-CP
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIx4-00032Y-Ab
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIx5-0000CS-Db
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:23 +0000
X-Inumbo-ID: 97f76a23-e70f-4dc3-abc9-9e54f7e69c33
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 97f76a23-e70f-4dc3-abc9-9e54f7e69c33;
	Mon, 05 Oct 2020 05:22:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RFGhdvElhYaWHQ9ya0SiJq0nJgYTNMhhjoqliIu5o/U=; b=sx7RZr0rB7IOhFDTA+39vJGzHQ
	TahzryaP2ecmSKTXMf3faP11HwUQbgLB5zf9yoAG/Bbmt/vNR4JX0VlQ2Tta3qsg9ahzGo6saUTnq
	DOliFkwUfKlI0nRv6SIfV78qEGiL6kY+ND5ZYyL90wr42QgDHt3R4Vilj6kZDe7QhrDg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIx4-0003U5-CP
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIx4-00032Y-Ab
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/msi: get rid of read_msi_msg
Message-Id: <E1kPIx4-00032Y-Ab@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:22 +0000

commit 2031bd3f421d4923679121092a414adfcea16a95
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:16:58 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:16:58 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 58 +-----------------------------------------------------
 1 file changed, 1 insertion(+), 57 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 2bec43e416..925ec710f4 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -192,59 +192,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        u16 data, seg = dev->seg;
-        u8 bus = dev->bus;
-        u8 slot = PCI_SLOT(dev->devfn);
-        u8 func = PCI_FUNC(dev->devfn);
-
-        msg->address_lo = pci_conf_read32(seg, bus, slot, func,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(seg, bus, slot, func,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -322,10 +269,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2839.8091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxG-0000E8-Sq; Mon, 05 Oct 2020 05:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2839.8091; Mon, 05 Oct 2020 05:22:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxG-0000Dz-PC; Mon, 05 Oct 2020 05:22:34 +0000
Received: by outflank-mailman (input) for mailman id 2839;
 Mon, 05 Oct 2020 05:22:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIxF-0000Dr-Hw
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c853775d-a11e-4588-af71-40a064968a8b;
 Mon, 05 Oct 2020 05:22:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxE-0003UE-FX
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxE-00033U-EX
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIxF-0000Dr-Hw
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:33 +0000
X-Inumbo-ID: c853775d-a11e-4588-af71-40a064968a8b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c853775d-a11e-4588-af71-40a064968a8b;
	Mon, 05 Oct 2020 05:22:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vnPXn/eMHLtJDvZuoJ+4x0ke4FTKATYmRXVfBO/MkAU=; b=kpw8IFedu3EXN6t1Hf6v7m7z4X
	popx9NLaINq1v9CLZ3zdS7ychyUsXRllRcT/mCQ8LsOglgWqEraM8IpepkedhtrK6/sZ32JJNYHoF
	6kaVrAeB0a2CYTy1bpWSZ/JVBaMqsogG9gvCMLO5L5aHo/c9r2AI7bCANxGZrI48atRI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxE-0003UE-FX
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxE-00033U-EX
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kPIxE-00033U-EX@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:32 +0000

commit 2fe163d70f3ae88c10f50d70a50513e395326a77
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:17:47 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:17:47 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 ++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 61 insertions(+), 36 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 925ec710f4..5e5cf83c10 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -785,16 +785,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
 
     ASSERT(pcidevs_locked());
 
@@ -832,43 +830,45 @@ static int msix_capability_init(struct pci_dev *dev,
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(seg, bus, slot, func,
                                    msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
-    {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->nr_entries = nr_entries;
         msix->table.first = PFN_DOWN(table_paddr);
@@ -889,7 +889,19 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
     }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control);
+        xfree(entry);
+        return -ENODATA;
+    }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      (table_offset & ~PCI_MSIX_BIRMASK & ~PAGE_MASK);
 
     if ( entry )
     {
@@ -900,8 +912,16 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
             pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+                             control);
             xfree(entry);
             return idx;
         }
@@ -1083,9 +1103,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2840.8094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxP-0000Fc-W6; Mon, 05 Oct 2020 05:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2840.8094; Mon, 05 Oct 2020 05:22:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxP-0000FU-St; Mon, 05 Oct 2020 05:22:43 +0000
Received: by outflank-mailman (input) for mailman id 2840;
 Mon, 05 Oct 2020 05:22:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIxP-0000FM-FT
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9a240c7f-479f-4a51-ab3e-ee695129b0da;
 Mon, 05 Oct 2020 05:22:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxO-0003UN-JK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxO-00034E-Hh
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIxP-0000FM-FT
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:43 +0000
X-Inumbo-ID: 9a240c7f-479f-4a51-ab3e-ee695129b0da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9a240c7f-479f-4a51-ab3e-ee695129b0da;
	Mon, 05 Oct 2020 05:22:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oX+Fv7h8ebKL2TS3igkZoBvdqePIkq2TODEYBz4G2vk=; b=uVy6oIOQh2vpHj3HL5cC4cf+zw
	B4WMiAojaYARlt9l0CINCfWoHHWLzhYZpfSlYiwkhADTtjdvDno5Y4YzhCtNl5079kwmikb54if/J
	oDQ0FPjb5jdh4Eq7hSwjnE/29GNUzFGk6Q2fZAd07FS5CXq+C95JDLpxgCA1ijMqld70=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxO-0003UN-JK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxO-00034E-Hh
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: relax port_is_valid()
Message-Id: <E1kPIxO-00034E-Hh@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:42 +0000

commit 7284bfab0506f3281343689d08ff4731fcbebaa6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:18:21 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:18:21 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index b8152a9831..2006ba9252 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -99,8 +99,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:22:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:22:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2841.8097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxb-0000Gw-1b; Mon, 05 Oct 2020 05:22:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2841.8097; Mon, 05 Oct 2020 05:22:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxa-0000Go-Ur; Mon, 05 Oct 2020 05:22:54 +0000
Received: by outflank-mailman (input) for mailman id 2841;
 Mon, 05 Oct 2020 05:22:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIxZ-0000Gf-KL
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4af6e550-b410-4de4-964e-07aa6184626b;
 Mon, 05 Oct 2020 05:22:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxY-0003VB-MZ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxY-00034u-LN
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIxZ-0000Gf-KL
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:53 +0000
X-Inumbo-ID: 4af6e550-b410-4de4-964e-07aa6184626b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4af6e550-b410-4de4-964e-07aa6184626b;
	Mon, 05 Oct 2020 05:22:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OkL6+wMYUtQcF6YzhyKs8O6uiz9O+L4QKr1Kz8OTGFM=; b=dVkXAGnWlaXgvGFfTHJxVS6AK6
	geYh9/2FQRQ3ixcMPcyyO7pIP3S/YRcBpH69tvYI0ep7J+BPcBFxgA8DhNP+Uie4oW8lBwVARcEw7
	aR75ZCm1PCeRCseSUfKd1CVTDSJ7KSe2x8/KxsfDf/rx2KjFbxJ3hPoHystLt9dNkduU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxY-0003VB-MZ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxY-00034u-LN
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:22:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/pv: Avoid double exception injection
Message-Id: <E1kPIxY-00034u-LN@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:22:52 +0000

commit 9703a2fd74d91e29f6f913115a98c78426854305
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:18:57 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:18:57 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index f697e05a30..123c974e33 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -80,7 +80,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -349,7 +348,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 58054edf82..ace7e65eb7 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -81,7 +81,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -513,6 +512,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2842.8103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxl-0000I9-3o; Mon, 05 Oct 2020 05:23:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2842.8103; Mon, 05 Oct 2020 05:23:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxl-0000Hz-0S; Mon, 05 Oct 2020 05:23:05 +0000
Received: by outflank-mailman (input) for mailman id 2842;
 Mon, 05 Oct 2020 05:23:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIxj-0000Hr-P9
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b8b8bf63-3ec0-4eba-92ce-ff08d4499478;
 Mon, 05 Oct 2020 05:23:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxi-0003VZ-Pf
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxi-00035g-Om
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIxj-0000Hr-P9
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:03 +0000
X-Inumbo-ID: b8b8bf63-3ec0-4eba-92ce-ff08d4499478
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b8b8bf63-3ec0-4eba-92ce-ff08d4499478;
	Mon, 05 Oct 2020 05:23:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7MEFv6ZOf7aTlOJYaA8Ce3S63pZmXKiCnSGEI2hMQRs=; b=xDbf7GhdV7vbEX+BGqsGx/+N8C
	2f/C+vvc+IG6ShQH2E2GvFECUdb5izdIMXsfcSmt3mf70ffEEBNbrpCCpsH7aR9kzpP3EeCJbZZxu
	tfKP8Yvsjs5ZAqRvDzTWgfHymi7Ee899j3P6y5KyD7iaXld+e+gvZt9+9jUT4I0Helqg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxi-0003VZ-Pf
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxi-00035g-Om
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kPIxi-00035g-Om@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:02 +0000

commit 13f60bf98fcb3b5c5c216ee2ce536897d3a925d4
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 17:19:30 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:19:30 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index c692bd2175..399dc07211 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -178,6 +178,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2006ba9252..70bd63423e 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -99,7 +99,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2843.8106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxv-0000Jt-56; Mon, 05 Oct 2020 05:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2843.8106; Mon, 05 Oct 2020 05:23:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIxv-0000Jl-25; Mon, 05 Oct 2020 05:23:15 +0000
Received: by outflank-mailman (input) for mailman id 2843;
 Mon, 05 Oct 2020 05:23:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIxu-0000Jc-1w
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 48566842-270a-4efc-86a5-571baa571fa9;
 Mon, 05 Oct 2020 05:23:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxs-0003Vj-So
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIxs-00036K-S9
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIxu-0000Jc-1w
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:14 +0000
X-Inumbo-ID: 48566842-270a-4efc-86a5-571baa571fa9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 48566842-270a-4efc-86a5-571baa571fa9;
	Mon, 05 Oct 2020 05:23:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=beibxRPdyNoLRnGzpfAGnD/JESPqMsXB14gmraNswuA=; b=CzB+OyiJQurs4kitBa3zSc7+QV
	OrQckQX2PLS19XpTEHlzMI8Q+XFy6uItYKeC7f/ejt6cuI8OZrmdGeRLkWPZoiePljBL3bimTRAKo
	z3lf2XhebACDiQH4uxSph1INPRwpQOG5/sNJOEV7stO7Qqu4wMAXe5Y8/eM+A83B7EJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxs-0003Vj-So
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIxs-00036K-S9
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kPIxs-00036K-S9@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:12 +0000

commit 6e9de083d801104f50a78f5d8e872778a776c682
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:20:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:20:23 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/schedule.c      | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 399dc07211..efbba61558 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -151,7 +151,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1393,13 +1393,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 3f4c835518..397be25015 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -477,7 +477,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -487,7 +487,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -539,6 +539,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -555,8 +557,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index dd167cce76..adc6f3a238 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1054,7 +1054,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 70bd63423e..357347369e 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -97,6 +97,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e79d5a36ca..56fe0e774d 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -343,7 +343,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2844.8110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIy5-0000LA-6U; Mon, 05 Oct 2020 05:23:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2844.8110; Mon, 05 Oct 2020 05:23:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIy5-0000L2-3b; Mon, 05 Oct 2020 05:23:25 +0000
Received: by outflank-mailman (input) for mailman id 2844;
 Mon, 05 Oct 2020 05:23:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIy4-0000Ks-2S
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d586e9dc-7710-40d4-ba5e-506666585894;
 Mon, 05 Oct 2020 05:23:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIy3-0003Vr-05
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIy2-000377-Uw
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIy4-0000Ks-2S
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:24 +0000
X-Inumbo-ID: d586e9dc-7710-40d4-ba5e-506666585894
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d586e9dc-7710-40d4-ba5e-506666585894;
	Mon, 05 Oct 2020 05:23:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wa5B2tc8NUn1Xi/2sy6NQQ5A/UTklouscIczuda/sj0=; b=gy/DrbAMNgAeBuz2/J41juNO0m
	5JUPSZ+GiyR3vBJLgFKwCqoiWJfn55hQ7FuU30jbDsDMLcfkHriuYoiKX+zOVSdROatqYwlbfzfXf
	s0Tl/XOjOMuRpVyEsGsm5+rMyhkFWJceroF0dU4QmE6QzTtQJxeJBEedqJu5EJKApJdI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIy3-0003Vr-05
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIy2-000377-Uw
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kPIy2-000377-Uw@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:22 +0000

commit cc1561a3a4e6c1b4125953703338c545ba6d14fb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:20:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:20:56 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index efbba61558..258281ea88 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -188,6 +188,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -211,11 +213,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -258,6 +275,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -351,6 +369,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -484,7 +503,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -532,6 +551,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1005,10 +1025,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1018,7 +1038,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1027,7 +1049,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1213,10 +1235,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1232,7 +1253,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1308,6 +1332,7 @@ int evtchn_init(struct domain *d)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long,
@@ -1335,6 +1360,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 56fe0e774d..a8ebfe6d95 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -345,6 +345,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2845.8114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyF-0000Mh-9h; Mon, 05 Oct 2020 05:23:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2845.8114; Mon, 05 Oct 2020 05:23:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyF-0000MY-6R; Mon, 05 Oct 2020 05:23:35 +0000
Received: by outflank-mailman (input) for mailman id 2845;
 Mon, 05 Oct 2020 05:23:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIyE-0000MP-7J
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aa4d9ee9-b1af-4575-89fd-e273049927ee;
 Mon, 05 Oct 2020 05:23:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyD-0003Vz-2s
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyD-00037j-2F
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIyE-0000MP-7J
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:34 +0000
X-Inumbo-ID: aa4d9ee9-b1af-4575-89fd-e273049927ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aa4d9ee9-b1af-4575-89fd-e273049927ee;
	Mon, 05 Oct 2020 05:23:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BvJJhB5iEmhXVB7wWUDy/YCE664GPtGJv+SsZlULw4c=; b=OMOpPm3Ll7/PBSLAgRhiAEcn3V
	cQTIODuvSM9/tNIgXeXmPfENTtuww+hikYyINnogjMUFQWX3g1JbuGbJ/5nOa4IZALiCUjj8vsu7I
	8iDv3BKF73wUTW+m0engbfpxgnYl7hzhk2pHPwwT6nG1HOH72wxR13i0auj0lf81Y0a4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyD-0003Vz-2s
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyD-00037j-2F
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kPIyD-00037j-2F@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:33 +0000

commit 3def8466383ab5abd17f1436d085348c2994722b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:21:27 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:21:27 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 258281ea88..982af9d172 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -248,6 +248,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -263,14 +264,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -283,26 +284,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -312,6 +319,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -347,7 +355,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -364,7 +372,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -387,6 +395,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -419,14 +428,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -443,6 +452,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( (vcpu < 0) || (vcpu >= d->max_vcpus) ||
          (d->vcpu[vcpu] == NULL) )
@@ -455,13 +465,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -505,6 +515,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -537,14 +548,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -565,6 +576,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -664,14 +676,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -679,9 +691,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -701,13 +713,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -742,7 +755,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1232,6 +1245,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1244,14 +1258,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1274,11 +1288,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1288,7 +1303,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2846.8118 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyQ-0000Ny-BJ; Mon, 05 Oct 2020 05:23:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2846.8118; Mon, 05 Oct 2020 05:23:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyQ-0000Nq-81; Mon, 05 Oct 2020 05:23:46 +0000
Received: by outflank-mailman (input) for mailman id 2846;
 Mon, 05 Oct 2020 05:23:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIyP-0000Ni-Ha
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0120bd5f-ea83-4141-8ada-762e1f4fa8d9;
 Mon, 05 Oct 2020 05:23:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyN-0003W9-5z
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyN-00038Q-5D
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIyP-0000Ni-Ha
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:45 +0000
X-Inumbo-ID: 0120bd5f-ea83-4141-8ada-762e1f4fa8d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0120bd5f-ea83-4141-8ada-762e1f4fa8d9;
	Mon, 05 Oct 2020 05:23:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ng6dYEE4NOuTn/ZTBjGpMD6KIiJNRoHdsbAQUqgF9Gg=; b=l4FVXXKUTVsJpBpJZ5EdJ+PNgr
	vNRPZn0/WjT+Kw0oWz2/yKQwPKUdWQcWJboQ8Q2Nrm1fNuL6itVfgpSQm0NLFJ86YRG14E2s0uVul
	1AtbGLu4yAl/1dOOke479C3CUztRjagazuLeW+OQe8uLwlU/us7CHAr4QF/w2YLLsxow=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyN-0003W9-5z
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyN-00038Q-5D
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: address races with evtchn_reset()
Message-Id: <E1kPIyN-00038Q-5D@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:43 +0000

commit 30b3f297603eebd7874ca3b5f9cbf7268b040046
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:22:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:22:00 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 3bb2f5132b..9878486073 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2324,14 +2324,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; i++ )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("%u:%3d(%c%c%c)",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       (info->masked ? 'M' : '-'));
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-');
                 if ( i != action->nr_guests )
                     printk(",");
             }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 353538447e..4b7d498c00 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -616,8 +616,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 982af9d172..753950b81a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -156,8 +156,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -770,6 +771,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -780,7 +782,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -809,7 +814,9 @@ static void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -819,6 +826,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -833,7 +841,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1028,12 +1038,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1446,8 +1459,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 397be25015..45c024739d 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -295,23 +295,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index 2f6ea54bcb..f61d2f7adb 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline bool arch_virq_is_global(unsigned int virq)
     return true;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 357347369e..26ad429520 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -125,6 +125,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -157,19 +175,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -185,38 +208,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -225,6 +277,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:23:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2847.8122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyZ-0000P6-CZ; Mon, 05 Oct 2020 05:23:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2847.8122; Mon, 05 Oct 2020 05:23:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyZ-0000Oy-9Z; Mon, 05 Oct 2020 05:23:55 +0000
Received: by outflank-mailman (input) for mailman id 2847;
 Mon, 05 Oct 2020 05:23:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIyY-0000Or-DL
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 53651faa-d134-41a3-9345-2e4de88fbe4d;
 Mon, 05 Oct 2020 05:23:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyX-0003Wi-9C
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyX-00039P-8A
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIyY-0000Or-DL
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:54 +0000
X-Inumbo-ID: 53651faa-d134-41a3-9345-2e4de88fbe4d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 53651faa-d134-41a3-9345-2e4de88fbe4d;
	Mon, 05 Oct 2020 05:23:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wTZIj9T4WL/UeaxdJ9wJ35Q3xh2n3RCTj96VETnGZdA=; b=eEiYaPh0wAI09krwZ6OHDEm4w3
	M/nsZ9mtEEfbLQapdhc4BI74pA/z+VfLKuDn9Nyflr4/AG95oclY68qOM9bjRKXktEhS1Ho3yCxCh
	LfUxgRVugt60NQy0ngxjGe6BleTvsvGX3gSaqCSmQYqbm2/BUAusEd1igR9YAMID2UfY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyX-0003Wi-9C
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyX-00039P-8A
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:23:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kPIyX-00039P-8A@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:23:53 +0000

commit 3e565a9c603daebcf50e067c07aed7f0c4b2a6e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:22:28 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:22:28 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2ddd7986c1..cacede4cf0 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -646,7 +646,6 @@ int domain_kill(struct domain *d)
         if ( d->is_dying != DOMDYING_alive )
             return domain_kill(d);
         d->is_dying = DOMDYING_dying;
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem_client);
         vnuma_destroy(d->vnuma);
@@ -654,6 +653,9 @@ int domain_kill(struct domain *d)
         d->tmem_client = NULL;
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 753950b81a..52ba2b0c0c 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1291,7 +1291,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1303,7 +1312,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1375,8 +1394,7 @@ int evtchn_init(struct domain *d)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1385,14 +1403,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index a8ebfe6d95..46958de3d1 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -135,7 +135,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d); /* from domain_create */
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:24:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:24:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2848.8126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyj-0000SF-FP; Mon, 05 Oct 2020 05:24:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2848.8126; Mon, 05 Oct 2020 05:24:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyj-0000S4-CO; Mon, 05 Oct 2020 05:24:05 +0000
Received: by outflank-mailman (input) for mailman id 2848;
 Mon, 05 Oct 2020 05:24:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIyi-0000Rw-PD
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id df983432-0007-43e6-8406-7da33e81a7ea;
 Mon, 05 Oct 2020 05:24:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyh-0003X2-CV
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyh-0003AI-Bm
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIyi-0000Rw-PD
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:04 +0000
X-Inumbo-ID: df983432-0007-43e6-8406-7da33e81a7ea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id df983432-0007-43e6-8406-7da33e81a7ea;
	Mon, 05 Oct 2020 05:24:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BjHUExhDnQ5F4brBZlg77ZYn0M5tvssHEhOBOzXHnuo=; b=YDSiOAHEtGuKDL9mL/ljOc+ZR3
	NUnx7NbZkbK/qKJb3joXIC3dlIw3Ds9Fjvqnhes1wLYOGZMZHZ9EEEUYWyMJdYeKeFyYD4O2jQ33v
	G3quM53kfxwampMbBfDN5ueI22oh6VxU+LwzFOcnHaImjztear6Xg+/tlnac3Q4tUTNU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyh-0003X2-CV
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyh-0003AI-Bm
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kPIyh-0003AI-Bm@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:24:03 +0000

commit 3263f257caf8e4465e9dca84a88fa0e68be74280
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:23:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:23:04 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index cacede4cf0..0a7f193e43 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1105,7 +1105,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1119,7 +1119,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 741d774cd1..f3b7d93a06 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -648,12 +648,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 52ba2b0c0c..a1f2af07c5 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1051,7 +1051,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1059,11 +1059,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1198,7 +1227,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1211,9 +1241,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 0ab9fa0f85..dd096b5f1e 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1121,7 +1121,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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 44c549dd6b..a1949191c6 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 26ad429520..87a4aade86 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -171,7 +171,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 46958de3d1..c0cc5d9336 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -355,6 +355,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -608,7 +610,7 @@ int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 void domain_pause_for_debugger(void);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 05:24:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 05:24:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2849.8130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyt-0000U6-H2; Mon, 05 Oct 2020 05:24:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2849.8130; Mon, 05 Oct 2020 05:24:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPIyt-0000Ty-E3; Mon, 05 Oct 2020 05:24:15 +0000
Received: by outflank-mailman (input) for mailman id 2849;
 Mon, 05 Oct 2020 05:24:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPIys-0000Tq-Jj
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 07839202-917f-47de-895c-0543b7922fcb;
 Mon, 05 Oct 2020 05:24:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyr-0003XC-Fb
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPIyr-0003B1-Eq
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPIys-0000Tq-Jj
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:14 +0000
X-Inumbo-ID: 07839202-917f-47de-895c-0543b7922fcb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 07839202-917f-47de-895c-0543b7922fcb;
	Mon, 05 Oct 2020 05:24:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bzzEBWNyM5qTxs4T58M/Sp1kFAWPPyYdYg40H/+hgeY=; b=AsLyyyRE+dcyaDtjbpFYmi952p
	FTSWiGLj9yqOJr+dA1WVodw+InfyD7Kdyzmv6pEcbeBr7oVaIuKpgv5efpppMpzIvcV4jMjawiopQ
	njhYORdBY0MvYL7MQ4T0bZ/t1rFoCUBAK+zFzvge1cWK3dRkQHvYn47ZvJBy4jBJEEfY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyr-0003XC-Fb
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPIyr-0003B1-Eq
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 05:24:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kPIyr-0003B1-Eq@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 05:24:13 +0000

commit 3630a367854c98bbf8e747d09eeab7e68f370003
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:37:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:37:09 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a1f2af07c5..0066c8a87f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -719,6 +719,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2779819e1e..a670880106 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index a3e6108a34..8917329225 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 78bc32602e..17aa543fca 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -278,6 +278,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index bfc69f4acd..8426b36c72 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2922.8344 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMri-0007bD-4S; Mon, 05 Oct 2020 09:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2922.8344; Mon, 05 Oct 2020 09:33:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMri-0007b5-1M; Mon, 05 Oct 2020 09:33:06 +0000
Received: by outflank-mailman (input) for mailman id 2922;
 Mon, 05 Oct 2020 09:33:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMrg-0007ay-Ho
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e911a415-f773-4e77-abe0-7c33a6e53c6d;
 Mon, 05 Oct 2020 09:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMre-0000n9-9V
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMre-0006E5-7i
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMrg-0007ay-Ho
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:04 +0000
X-Inumbo-ID: e911a415-f773-4e77-abe0-7c33a6e53c6d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e911a415-f773-4e77-abe0-7c33a6e53c6d;
	Mon, 05 Oct 2020 09:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UpGjRIlJUmKIe02C7lLkEpegR7PlpwqVHUKr1iR/OdI=; b=JJIk3YUNZ8Q4wzbOoIuLFMZzjq
	LVGLxVTs3NTyGYkXcAqz/FYnrrActS6Khx/gV0w7wkDEin+XVSWxNcx29KlLOGHzGwmR7cN3RrdzR
	IEM2qhwPFMUCiDUawzyZPqIXM/zbCmsCVCbMTV5BV+XzXR5AeP3OC7kSGv91vsko6hhc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMre-0000n9-9V
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMre-0006E5-7i
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
Message-Id: <E1kPMre-0006E5-7i@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:02 +0000

commit 320e7a7369245d4304ac822e67740a7ea147e7a2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:04:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:04:22 2020 +0200

    x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
    
    This MSR doesn't exist on AMD hardware, and switching away from the safe
    functions in the common MSR path was an erroneous change.
    
    Partially revert the change.
    
    This is XSA-333.
    
    Fixes: 4fdc932b3cc ("x86/Intel: drop another 32-bit leftover")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 5d4065333a..324a2334a2 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -892,7 +892,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, *val);
+        if ( rdmsr_safe(reg, *val) )
+            break;
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1030,7 +1031,8 @@ static int write_msr(unsigned int reg, uint64_t val,
         break;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, temp);
+        if ( rdmsr_safe(reg, temp) )
+            break;
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2923.8348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMrr-0007cM-63; Mon, 05 Oct 2020 09:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2923.8348; Mon, 05 Oct 2020 09:33:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMrr-0007cE-2x; Mon, 05 Oct 2020 09:33:15 +0000
Received: by outflank-mailman (input) for mailman id 2923;
 Mon, 05 Oct 2020 09:33:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMrp-0007c2-Dr
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 68f3b492-1f01-4880-8f1f-f64abc54d695;
 Mon, 05 Oct 2020 09:33:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMro-0000nC-Cd
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMro-0006O5-Bg
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMrp-0007c2-Dr
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:13 +0000
X-Inumbo-ID: 68f3b492-1f01-4880-8f1f-f64abc54d695
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 68f3b492-1f01-4880-8f1f-f64abc54d695;
	Mon, 05 Oct 2020 09:33:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VtCXdMayhlgIC0daGHpf3rY3S/1FdognSZpob577bfc=; b=IpGH94K7F9Hxm0dQ5j/1z9XoIc
	ut0uujHpW0hSWS7dmdgldqcq0FaE7KjBgEFQhNPlAPC+v+zn4A88ZgUsTnXjPslCUy6qzy4OFFB3n
	b0NGzl0rQn0NUiziXSjGD6dkuxbw/i2Bi/FZEp0hlQbg/C1mQlcF4LIaEIDLnb87+3+U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMro-0000nC-Cd
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMro-0006O5-Bg
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] xen/memory: Don't skip the RCU unlock path in acquire_resource()
Message-Id: <E1kPMro-0006O5-Bg@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:12 +0000

commit 8b8fff26f58de808deec4f51ed34069e6bf1618b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:04:58 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:04:58 2020 +0200

    xen/memory: Don't skip the RCU unlock path in acquire_resource()
    
    In the case that an HVM Stubdomain makes an XENMEM_acquire_resource hypercall,
    the FIXME path will bypass rcu_unlock_domain() on the way out of the function.
    
    Move the check to the start of the function.  This does change the behaviour
    of the get-size path for HVM Stubdomains, but that functionality is currently
    broken and unused anyway, as well as being quite useless to entities which
    can't actually map the resource anyway.
    
    This is XSA-334.
    
    Fixes: 83fa6552ce ("common: add a new mappable resource type: XENMEM_resource_grant_table")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index dbc06fb0bf..ff88ebb314 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1059,6 +1059,14 @@ static int acquire_resource(
     xen_pfn_t mfn_list[32];
     int rc;
 
+    /*
+     * FIXME: Until foreign pages inserted into the P2M are properly
+     *        reference counted, it is unsafe to allow mapping of
+     *        resource pages unless the caller is the hardware domain.
+     */
+    if ( paging_mode_translate(currd) && !is_hardware_domain(currd) )
+        return -EACCES;
+
     if ( copy_from_guest(&xmar, arg, 1) )
         return -EFAULT;
 
@@ -1115,16 +1123,6 @@ static int acquire_resource(
         xen_pfn_t gfn_list[ARRAY_SIZE(mfn_list)];
         unsigned int i;
 
-        /*
-         * FIXME: Until foreign pages inserted into the P2M are properly
-         *        reference counted, it is unsafe to allow mapping of
-         *        non-caller-owned resource pages unless the caller is
-         *        the hardware domain.
-         */
-        if ( !(xmar.flags & XENMEM_rsrc_acq_caller_owned) &&
-             !is_hardware_domain(currd) )
-            return -EACCES;
-
         if ( copy_from_guest(gfn_list, xmar.frame_list, xmar.nr_frames) )
             rc = -EFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2924.8352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMs1-0007eO-7T; Mon, 05 Oct 2020 09:33:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2924.8352; Mon, 05 Oct 2020 09:33:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMs1-0007eH-4X; Mon, 05 Oct 2020 09:33:25 +0000
Received: by outflank-mailman (input) for mailman id 2924;
 Mon, 05 Oct 2020 09:33:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMrz-0007e0-ST
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e2cca0a4-ef99-472a-bc57-0c9ccd923706;
 Mon, 05 Oct 2020 09:33:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMry-0000nK-H6
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMry-0006On-FG
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMrz-0007e0-ST
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:23 +0000
X-Inumbo-ID: e2cca0a4-ef99-472a-bc57-0c9ccd923706
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e2cca0a4-ef99-472a-bc57-0c9ccd923706;
	Mon, 05 Oct 2020 09:33:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hk5iSkmPCpnNz04cvEmdShKCNORR2TW5dbOBqsLtm6o=; b=3XnDTTk9Xx6ewoa90da8LJe/yC
	ksnSb9+cvM6125BEbWRIs8FEjXmQPXbLHH77C8qRGIhjBvWhVKtLFdnle4CjwBDHst0MvgL8V7R4V
	60Gb+AsQuNqCM/5vnMAmTAFkjguiM7DXSm+ZHxlmakgMv2h6RMa0OzkJfgNJO4runeHU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMry-0000nK-H6
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMry-0006On-FG
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kPMry-0006On-FG@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:22 +0000

commit d28c52ee2aee0297062ee86c69f60a30b659c290
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:05:39 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:05:39 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 81 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 49 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c87dfe6155..a98f7471b4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -632,6 +632,8 @@ int hvm_domain_initialise(struct domain *d)
     /* need link to containing domain */
     d->arch.hvm.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index ecd25d7ad4..77b142406f 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -152,23 +152,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm.tm_lock);
+    read_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -218,7 +227,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -226,7 +235,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -234,7 +243,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -247,7 +256,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -308,7 +317,7 @@ int pt_update_irq(struct vcpu *v)
     int irq, pt_vector = -1;
     bool level;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -338,7 +347,7 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
@@ -346,7 +355,7 @@ int pt_update_irq(struct vcpu *v)
     irq = earliest_pt->irq;
     level = earliest_pt->level;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -393,7 +402,7 @@ int pt_update_irq(struct vcpu *v)
                 time_cb *cb = NULL;
                 void *cb_priv;
 
-                spin_lock(&v->arch.hvm.tm_lock);
+                pt_vcpu_lock(v);
                 /* Make sure the timer is still on the list. */
                 list_for_each_entry ( pt, &v->arch.hvm.tm_list, list )
                     if ( pt == earliest_pt )
@@ -403,7 +412,7 @@ int pt_update_irq(struct vcpu *v)
                         cb_priv = pt->priv;
                         break;
                     }
-                spin_unlock(&v->arch.hvm.tm_lock);
+                pt_vcpu_unlock(v);
 
                 if ( cb != NULL )
                     cb(v, cb_priv);
@@ -440,12 +449,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -454,7 +463,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -465,12 +474,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -489,7 +498,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -539,7 +548,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -564,30 +573,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 99169dd625..e2cdba4280 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -134,6 +134,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2925.8356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsB-0007g9-Ai; Mon, 05 Oct 2020 09:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2925.8356; Mon, 05 Oct 2020 09:33:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsB-0007g1-7b; Mon, 05 Oct 2020 09:33:35 +0000
Received: by outflank-mailman (input) for mailman id 2925;
 Mon, 05 Oct 2020 09:33:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMs9-0007fl-H0
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9f71c829-02bd-4b1b-8cc8-ca0bae1ac103;
 Mon, 05 Oct 2020 09:33:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMs8-0000nW-KC
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMs8-0006PP-JL
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMs9-0007fl-H0
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:33 +0000
X-Inumbo-ID: 9f71c829-02bd-4b1b-8cc8-ca0bae1ac103
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9f71c829-02bd-4b1b-8cc8-ca0bae1ac103;
	Mon, 05 Oct 2020 09:33:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UP7GPhYdG9vigaXES126zro3ne50NIN0pMSlIWwJ+/E=; b=A0AG8Li1EbgAUhzouu+dSrVdNV
	AhU6Jb0smK3Beq8VKYbomnl+rE/S+lKoQ3AUaV1nTzizpFxsOEVHWMKBZSZcrOm+H4WkLXEAarn0U
	fgCRDrIKGjpzrMudosTUB0Q/6Vw6/rc9YlRcUHIpqms+PoTeLk05dfqcB1a2M7CC2XL4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMs8-0000nW-KC
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMs8-0006PP-JL
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/msi: get rid of read_msi_msg
Message-Id: <E1kPMs8-0006PP-JL@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:32 +0000

commit 76a0760f6c69f2b2c0c4239d269e21874fe56271
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:06:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:06:09 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 58 +-----------------------------------------------------
 1 file changed, 1 insertion(+), 57 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index efb4759ec5..d4958e2039 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -192,59 +192,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        u16 data, seg = dev->seg;
-        u8 bus = dev->bus;
-        u8 slot = PCI_SLOT(dev->devfn);
-        u8 func = PCI_FUNC(dev->devfn);
-
-        msg->address_lo = pci_conf_read32(seg, bus, slot, func,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(seg, bus, slot, func,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -322,10 +269,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2927.8360 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsM-0007hY-CU; Mon, 05 Oct 2020 09:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2927.8360; Mon, 05 Oct 2020 09:33:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsM-0007hR-9D; Mon, 05 Oct 2020 09:33:46 +0000
Received: by outflank-mailman (input) for mailman id 2927;
 Mon, 05 Oct 2020 09:33:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMsK-0007hI-L7
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f94136a2-9a69-45f5-9e21-fd1cfbdbab75;
 Mon, 05 Oct 2020 09:33:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsI-0000nk-N2
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsI-0006Py-ML
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMsK-0007hI-L7
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:44 +0000
X-Inumbo-ID: f94136a2-9a69-45f5-9e21-fd1cfbdbab75
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f94136a2-9a69-45f5-9e21-fd1cfbdbab75;
	Mon, 05 Oct 2020 09:33:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ENDB4xxTTiNB8xrGuzDwjzW54Pwvj603I1Qs2o6Ieg=; b=58Ob5bLcJ7WF1booPxL/oRp2SC
	pVu8tFsN2a/gj7FMlh+JaJvRwhKDedn20uz3Towtk4ojheHRRSJ21TCD1lQdzqm3kiwQcMBTbVfV3
	rUp2DWggjgpH5t0oF6LNapyGs9N9ly6/owor2OGf3cTTqG03WbDmE4lqfohDjxK8ztfc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsI-0000nk-N2
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsI-0006Py-ML
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kPMsI-0006Py-ML@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:42 +0000

commit 1dfd2e2f654fd93848767369a1705727d523b453
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:06:34 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:06:34 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 ++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 61 insertions(+), 36 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index d4958e2039..36153dc031 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -790,16 +790,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
 
     ASSERT(pcidevs_locked());
 
@@ -837,43 +835,45 @@ static int msix_capability_init(struct pci_dev *dev,
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(seg, bus, slot, func,
                                    msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
-    {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->nr_entries = nr_entries;
         msix->table.first = PFN_DOWN(table_paddr);
@@ -894,7 +894,19 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
     }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control);
+        xfree(entry);
+        return -ENODATA;
+    }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      (table_offset & ~PCI_MSIX_BIRMASK & ~PAGE_MASK);
 
     if ( entry )
     {
@@ -905,8 +917,16 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
             pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+                             control);
             xfree(entry);
             return idx;
         }
@@ -1102,9 +1122,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:33:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2928.8363 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsU-0007ik-E7; Mon, 05 Oct 2020 09:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2928.8363; Mon, 05 Oct 2020 09:33:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsU-0007id-Ay; Mon, 05 Oct 2020 09:33:54 +0000
Received: by outflank-mailman (input) for mailman id 2928;
 Mon, 05 Oct 2020 09:33:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMsT-0007iW-KC
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 808d0f29-5234-4ae6-a5b6-086002719859;
 Mon, 05 Oct 2020 09:33:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsS-0000nv-Pg
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsS-0006Qi-P3
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMsT-0007iW-KC
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:53 +0000
X-Inumbo-ID: 808d0f29-5234-4ae6-a5b6-086002719859
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 808d0f29-5234-4ae6-a5b6-086002719859;
	Mon, 05 Oct 2020 09:33:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A8qo+ZQ6RvwVmsk/nje7sdsnkMVYDHujNZUvwi1zUxQ=; b=TNvhlUt+p4oadcqZZk1aisckrM
	qM+upM2VW84NW4liLX4Iiz9AnKAutrobaVE98CrlBE/4CQ/kzt5fULeZw3jWzKFOVYl0rzNVqwIj0
	rETi3/SISnbA3Ufnyzyd5r/YvWbkYCUyBY2E9fICRKUiomoy5lNR7sP2F/LXPtGAD0l0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsS-0000nv-Pg
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsS-0006Qi-P3
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:33:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: relax port_is_valid()
Message-Id: <E1kPMsS-0006Qi-P3@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:33:52 +0000

commit b2db00754fc39971bb0ff8a60c54ae8a58c3d473
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:06:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:06:59 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index a7798f6765..ce45298377 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,8 +107,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2929.8368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsf-0007li-G9; Mon, 05 Oct 2020 09:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2929.8368; Mon, 05 Oct 2020 09:34:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsf-0007la-Cw; Mon, 05 Oct 2020 09:34:05 +0000
Received: by outflank-mailman (input) for mailman id 2929;
 Mon, 05 Oct 2020 09:34:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMse-0007lR-8c
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e71a5fdb-7935-47ce-96e5-c8f0f99267f9;
 Mon, 05 Oct 2020 09:34:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsc-0000og-Sp
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsc-0006RQ-Rv
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMse-0007lR-8c
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:04 +0000
X-Inumbo-ID: e71a5fdb-7935-47ce-96e5-c8f0f99267f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e71a5fdb-7935-47ce-96e5-c8f0f99267f9;
	Mon, 05 Oct 2020 09:34:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jV6JzW2jdXTT+gl5c7ZZC2fSTnS9kh0YLulXYtdiDpY=; b=JU+UtVQQtfBr2YQ1A5ThtiPuau
	46rKgBhmxXUASvk2px/adqaOJIzVN/ueUsFiBofxqv4vxpan1kNqKJg+rtCaexo4UKLMbZJyIb0eR
	OuHNFfqxXMHZRcupFLTATz6mLPbqR/W7wk+9bsR6bhmM0vVL6KzA1DdqZKQydqNe7cRs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsc-0000og-Sp
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsc-0006RQ-Rv
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/pv: Avoid double exception injection
Message-Id: <E1kPMsc-0006RQ-Rv@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:02 +0000

commit 3e039e12ecfdefbf3ecbc5a63052620a1fe51ad5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:07:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:07:38 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 175c2fe451..16c5a46e75 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -81,7 +81,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -352,7 +351,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index f9d64cca84..65229a1a68 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -93,7 +93,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -498,6 +497,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2930.8372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMso-0007mp-He; Mon, 05 Oct 2020 09:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2930.8372; Mon, 05 Oct 2020 09:34:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMso-0007mh-ER; Mon, 05 Oct 2020 09:34:14 +0000
Received: by outflank-mailman (input) for mailman id 2930;
 Mon, 05 Oct 2020 09:34:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMsn-0007mb-Ua
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e0555cab-9aea-4375-aace-91b7bebe6496;
 Mon, 05 Oct 2020 09:34:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsm-0000op-VT
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsm-0006S4-Us
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMsn-0007mb-Ua
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:13 +0000
X-Inumbo-ID: e0555cab-9aea-4375-aace-91b7bebe6496
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e0555cab-9aea-4375-aace-91b7bebe6496;
	Mon, 05 Oct 2020 09:34:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E9IkyZV++hCTjXJViZEiA5KSwxS0IvAm593MgiaSWu4=; b=dFXlE0uvwsyScICjK1L8nGN7eL
	xWbf09fUFYahkO7PRj2WZIOIwM3Z5d3/89oxZnDcR8k4GIshUkBY084kN55zsLEEENEPR900shQBE
	7lL/JcTchnXlxcLM64834GbkM8huKBMoqGLqjwatTXjJ4yKDgJTkJ9LNk09vedLb6O4Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsm-0000op-VT
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsm-0006S4-Us
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kPMsm-0006S4-Us@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:12 +0000

commit 253a1e64d30e09ae089a060e364a01b4d442d550
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 17:08:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:08:00 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a8d182b584..53c17bd354 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -178,6 +178,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index ce45298377..c35f4b23b6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,7 +107,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2931.8376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsz-0007pB-Kk; Mon, 05 Oct 2020 09:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2931.8376; Mon, 05 Oct 2020 09:34:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMsz-0007p1-HT; Mon, 05 Oct 2020 09:34:25 +0000
Received: by outflank-mailman (input) for mailman id 2931;
 Mon, 05 Oct 2020 09:34:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMsy-0007ou-TT
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e41fd0b2-1ab2-4c15-bcb5-384f510d35f6;
 Mon, 05 Oct 2020 09:34:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsx-0000p2-2H
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMsx-0006So-1b
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMsy-0007ou-TT
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:24 +0000
X-Inumbo-ID: e41fd0b2-1ab2-4c15-bcb5-384f510d35f6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e41fd0b2-1ab2-4c15-bcb5-384f510d35f6;
	Mon, 05 Oct 2020 09:34:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3GDVYBaCCJXERen5YKRr5KhUPl8cNSz/OVJV82XvysM=; b=V+NG8v1QMT6cxNgN2mBx6llgyz
	N28el41MU3BVzkGnZ+0HwVhbfgkijY6YjdaefQ3aRhsum5Ql2dMbSxMGcunHT5BytjMI8FiQJVuKx
	56CF/NLypmY5QefczGqg02F/P+CVpuj6tlOpVVkgP6f/rCUWeSkdXM8RHxJJ8suGYsz4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsx-0000p2-2H
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMsx-0006So-1b
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kPMsx-0006So-1b@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:23 +0000

commit b8c9776986968bd1e90835df408f8bfc60640040
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:09:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:09:25 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/schedule.c      | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53c17bd354..08ffe0f063 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -151,7 +151,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1396,13 +1396,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 230f440f14..2f13d92128 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -478,7 +478,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -488,7 +488,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -546,6 +546,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -562,8 +564,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 5f42c08076..5a09e68b9e 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1058,7 +1058,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index c35f4b23b6..e1b299e8df 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,6 +105,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index edee52dfe4..0dea5ecbf5 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -344,7 +344,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2932.8380 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMt9-0007qV-MN; Mon, 05 Oct 2020 09:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2932.8380; Mon, 05 Oct 2020 09:34:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMt9-0007qM-J8; Mon, 05 Oct 2020 09:34:35 +0000
Received: by outflank-mailman (input) for mailman id 2932;
 Mon, 05 Oct 2020 09:34:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMt8-0007qB-8i
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cbdf5a49-28a3-467d-8a6c-a55cd655ccb1;
 Mon, 05 Oct 2020 09:34:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMt7-0000p8-5D
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMt7-0006Tm-4T
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMt8-0007qB-8i
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:34 +0000
X-Inumbo-ID: cbdf5a49-28a3-467d-8a6c-a55cd655ccb1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cbdf5a49-28a3-467d-8a6c-a55cd655ccb1;
	Mon, 05 Oct 2020 09:34:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zxGY3k9OvY9DdKKyJGW3675QQ5npBmi+pOsu9Rdxx9I=; b=qBfMHHujyZneHaFASWCiNc67Sa
	fG2bz88vVZ9EBFfHN/ErIbpDeH3/5QVAsJIZFSlu6/SLEfoIwYO0gNqM40zFazoFcgow2Eb4Dnj3q
	QMScKazqoSIX8xdcUiIdx02xW760TsLtWE8H8sJqQhEvPKcpFQhh2oxpb/E7s+Oi2h1w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMt7-0000p8-5D
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMt7-0006Tm-4T
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kPMt7-0006Tm-4T@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:33 +0000

commit 9dda47cb702ccb9663aec9c78ac3fdc3d4076b1c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:09:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:09:59 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 08ffe0f063..6a566917b1 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -188,6 +188,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -211,11 +213,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -258,6 +275,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -351,6 +369,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -488,7 +507,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -536,6 +555,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1011,10 +1031,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1024,7 +1044,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1033,7 +1055,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1219,10 +1241,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1238,7 +1259,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1314,6 +1338,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long, BITS_TO_LONGS(d->max_vcpus));
@@ -1340,6 +1365,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 0dea5ecbf5..8d0c817d7d 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -346,6 +346,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2933.8384 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtJ-0007ro-Nd; Mon, 05 Oct 2020 09:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2933.8384; Mon, 05 Oct 2020 09:34:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtJ-0007rg-Kg; Mon, 05 Oct 2020 09:34:45 +0000
Received: by outflank-mailman (input) for mailman id 2933;
 Mon, 05 Oct 2020 09:34:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMtI-0007rW-Cy
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2766ddc-c3e8-4408-b309-3a858b76758b;
 Mon, 05 Oct 2020 09:34:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtH-0000pG-8G
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtH-0006Ui-7P
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMtI-0007rW-Cy
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:44 +0000
X-Inumbo-ID: a2766ddc-c3e8-4408-b309-3a858b76758b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2766ddc-c3e8-4408-b309-3a858b76758b;
	Mon, 05 Oct 2020 09:34:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6zg2sA1cURbANrWWiUoQpENQ9IL0iw/7JqW1X1ClRAs=; b=xm1ICmMPukjWRW9wXKD6s1qdtE
	U1L8jGOQUGSsOGk211CUi7MZqFQvfokGAe8MHpAmOPGDFMhsQMo+7EFrsUzl4hADMWc8jdgRDxM/2
	eiQnmrZ+7LnxylwOiljcXA3h0gszT/zjZud76FgrnMmwK2Q9OesVkuX36TPWY4CjxgbM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtH-0000pG-8G
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtH-0006Ui-7P
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kPMtH-0006Ui-7P@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:43 +0000

commit 9c2a02740f7f91543caa8fab6d2ab2bbc7c40742
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:10:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:10:32 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6a566917b1..0e550e9c7a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -248,6 +248,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -263,14 +264,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -283,26 +284,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -312,6 +319,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -347,7 +355,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -364,7 +372,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -387,6 +395,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -424,14 +433,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -448,6 +457,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( domain_vcpu(d, vcpu) == NULL )
         return -ENOENT;
@@ -459,13 +469,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -509,6 +519,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -541,14 +552,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -569,6 +580,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -668,14 +680,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -683,9 +695,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -705,13 +717,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -746,7 +759,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1238,6 +1251,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1250,14 +1264,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1280,11 +1294,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1294,7 +1309,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:34:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:34:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2934.8388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtT-0007t6-Pd; Mon, 05 Oct 2020 09:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2934.8388; Mon, 05 Oct 2020 09:34:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtT-0007sy-MG; Mon, 05 Oct 2020 09:34:55 +0000
Received: by outflank-mailman (input) for mailman id 2934;
 Mon, 05 Oct 2020 09:34:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMtS-0007sq-Q2
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d98cc07b-0508-49ae-86eb-bba70a4133be;
 Mon, 05 Oct 2020 09:34:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtR-0000pN-BQ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtR-0006XB-Af
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMtS-0007sq-Q2
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:54 +0000
X-Inumbo-ID: d98cc07b-0508-49ae-86eb-bba70a4133be
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d98cc07b-0508-49ae-86eb-bba70a4133be;
	Mon, 05 Oct 2020 09:34:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H3awSsHdGwM447fL2kcNb5vAfIrIPQRZeXX8rw53Lvs=; b=yWYA/uTAa8juZ8Mhc+XCstnqB/
	NAMHWg8WTP3H1ek+N6LQyyYk2zJBLi1FromTPju4tpkiMfuxpistGN9ya28aEZcYszG0PsDf6II4h
	W8p2PQHLHdsEnPJfJeAEA4NTKSE8UxqcGRZ6vBy7wHJnoBP+/k96Q2eIBNibaVFDaBAY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtR-0000pN-BQ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtR-0006XB-Af
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:34:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: address races with evtchn_reset()
Message-Id: <E1kPMtR-0006XB-Af@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:34:53 +0000

commit 8e25d522a3fc236c0c7a02541e8071afa031386b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:11:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:11:01 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index ade659c3c2..f49ce8cf57 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2364,14 +2364,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; i++ )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("%u:%3d(%c%c%c)",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       (info->masked ? 'M' : '-'));
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-');
                 if ( i != action->nr_guests )
                     printk(",");
             }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 1501fc0632..91d44d6f1c 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -662,8 +662,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0e550e9c7a..878e4250ed 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -156,8 +156,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -774,6 +775,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -784,7 +786,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -813,7 +818,9 @@ void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -823,6 +830,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -837,7 +845,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1034,12 +1044,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1449,8 +1462,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 2f13d92128..68d0c7a632 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -296,23 +296,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index 2f6ea54bcb..f61d2f7adb 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline bool arch_virq_is_global(unsigned int virq)
     return true;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index e1b299e8df..bc9aa68650 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -133,6 +133,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -165,19 +183,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -193,38 +216,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -233,6 +285,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:35:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2935.8392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtd-0007uV-SY; Mon, 05 Oct 2020 09:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2935.8392; Mon, 05 Oct 2020 09:35:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtd-0007uN-PR; Mon, 05 Oct 2020 09:35:05 +0000
Received: by outflank-mailman (input) for mailman id 2935;
 Mon, 05 Oct 2020 09:35:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMtc-0007uD-Eg
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eb78e522-da23-47d5-919c-b2c0d5ba8682;
 Mon, 05 Oct 2020 09:35:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtb-0000qN-EP
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtb-0006YH-Dk
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMtc-0007uD-Eg
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:04 +0000
X-Inumbo-ID: eb78e522-da23-47d5-919c-b2c0d5ba8682
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eb78e522-da23-47d5-919c-b2c0d5ba8682;
	Mon, 05 Oct 2020 09:35:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iCV/hyKVzH3IIqA1tnb/1JtonDoVs+y27l2Hsp7DkDw=; b=cKKDOpkTEIJse0aTjLsE8kWlA+
	/5x5kGqBjPlBZAZTgBCUVzm/JfBITWLZBFeYSALMMquhdL5EleqALkE+b9YGRTHvwZk13dx3/rEDE
	pf90KB9OvaTO341tZWelCiZ/BvXH2TY0nY+Rt0iejdhydDJfzTMgU+/M0MujAytfyrN0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtb-0000qN-EP
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtb-0006YH-Dk
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kPMtb-0006YH-Dk@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:35:03 +0000

commit 2aa4864b8a25f2a4b3f2647dbf75abd88e3514ad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:11:33 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:11:33 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 5f94651f11..8e44e88bc4 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -724,7 +724,6 @@ int domain_kill(struct domain *d)
             return domain_kill(d);
         d->is_dying = DOMDYING_dying;
         argo_destroy(d);
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem_client);
         vnuma_destroy(d->vnuma);
@@ -732,6 +731,9 @@ int domain_kill(struct domain *d)
         d->tmem_client = NULL;
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 878e4250ed..3b1fe423df 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1297,7 +1297,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1309,7 +1318,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1380,8 +1399,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1390,14 +1408,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 8d0c817d7d..f70d990dbb 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -136,7 +136,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d, unsigned int max_port);
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:35:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2936.8396 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtn-0007vs-UJ; Mon, 05 Oct 2020 09:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2936.8396; Mon, 05 Oct 2020 09:35:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtn-0007vj-R5; Mon, 05 Oct 2020 09:35:15 +0000
Received: by outflank-mailman (input) for mailman id 2936;
 Mon, 05 Oct 2020 09:35:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMtm-0007va-Rj
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 57c169ba-6ba7-4143-81de-9c0d15162b4c;
 Mon, 05 Oct 2020 09:35:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtl-0000qV-Hh
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtl-0006Z7-Gs
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMtm-0007va-Rj
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:14 +0000
X-Inumbo-ID: 57c169ba-6ba7-4143-81de-9c0d15162b4c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 57c169ba-6ba7-4143-81de-9c0d15162b4c;
	Mon, 05 Oct 2020 09:35:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2VzpBmdBrdcuoU4UprvRwvWKhJxj3RjhgkR0d2t6q2s=; b=p/7UkwCFNNEXKlsy5VCK5UMO1M
	yZ2LbGV+/vZKB/f/GgBsygyYTVmtqjVQt3HJvvG9tBs4y1102AfUQePzOr4r8tYnXjY8o1okw/aW8
	SBGvBXyrYfv0L4goFpcW+BsIotuemS0DeafIWgb49yyoYwsrS59W0iijc7bIcHo2qVkE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtl-0000qV-Hh
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtl-0006Z7-Gs
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kPMtl-0006Z7-Gs@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:35:13 +0000

commit cfd61e688f9f1736ff0311f49040669f04ac1ea6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:12:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:12:09 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8e44e88bc4..ce8a9c6eee 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1170,7 +1170,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1184,7 +1184,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e3c4be2b48..5eabf8d119 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -585,12 +585,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 3b1fe423df..d2ee83bbbf 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1057,7 +1057,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1065,11 +1065,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1204,7 +1233,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1217,9 +1247,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 01f142289e..d2ef00588f 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1144,7 +1144,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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 44c549dd6b..a1949191c6 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index bc9aa68650..fa93a3684a 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -179,7 +179,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index f70d990dbb..819f6ede2b 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -356,6 +356,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -628,7 +630,7 @@ int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 void domain_pause_for_debugger(void);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:35:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2937.8402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMty-0007xn-0P; Mon, 05 Oct 2020 09:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2937.8402; Mon, 05 Oct 2020 09:35:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMtx-0007xa-Sm; Mon, 05 Oct 2020 09:35:25 +0000
Received: by outflank-mailman (input) for mailman id 2937;
 Mon, 05 Oct 2020 09:35:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMtw-0007xP-PF
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2d34ddb6-98ad-4a93-9679-b79d6a42b93b;
 Mon, 05 Oct 2020 09:35:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtv-0000qc-Kd
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMtv-0006a3-Ju
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMtw-0007xP-PF
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:24 +0000
X-Inumbo-ID: 2d34ddb6-98ad-4a93-9679-b79d6a42b93b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2d34ddb6-98ad-4a93-9679-b79d6a42b93b;
	Mon, 05 Oct 2020 09:35:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yrye6iOa4aFHVCj/TTBcNhiiIwiHsXBG4UHZk4ADYjI=; b=ihjP1owTCxSz+ANvWDxHGvWYCS
	+S0jjMq+LUCuJvMS2BLeveXGERIsuWE44ej+gkwMdy6EEAuxlqEVSlKMulnuE4GqebbH5Pd4qQ1It
	/k6Nah7crAMIdlPwhTCiAkbkW/tmCjqnVOOa2kS8kUkUrlXbG7xJ8FrQAF88WuzWspAo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtv-0000qc-Kd
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMtv-0006a3-Ju
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] hvmloader: indicate ACPI tables with "ACPI data" type in e820
Message-Id: <E1kPMtv-0006a3-Ju@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:35:23 +0000

commit 0ca821f19799533f2e8b0dfce1ea4b44b686fe26
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Sep 22 17:42:07 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:42:07 2020 +0200

    hvmloader: indicate ACPI tables with "ACPI data" type in e820
    
    Guest kernel does need to know in some cases where the tables are located
    to treat these regions properly. One example is kexec process where
    the first kernel needs to pass ACPI region locations to the second
    kernel which is now a requirement in Linux after 02a3e3cdb7f12 ("x86/boot:
    Parse SRAT table and count immovable memory regions") in order for kexec
    transition to actually work.
    
    That commit introduced accesses to XSDT and SRAT while the second kernel
    is still using kexec transition tables. The transition tables do not have
    e820 "reserved" regions mapped where those tables are located currently
    in a Xen guest. Instead "ACPI data" regions are mapped with the transition
    tables that was introduced by the following commit 6bbeb276b7 ("x86/kexec:
    Add the EFI system tables and ACPI tables to the ident map").
    
    Reserve 1MB (out of 16MB currently available) right after ACPI info page for
    ACPI tables exclusively but populate this region on demand and only indicate
    populated memory as "ACPI data" since according to ACPI spec that memory is
    reclaimable by the guest if necessary. That is close to how we treat
    the same ACPI data in PVH guests. 1MB should be enough for now but could be
    later extended if required.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8efa46516c5f4cf185c8df179812c185d3c27eb6
    master date: 2020-09-09 17:56:13 +0200
---
 tools/firmware/hvmloader/config.h    |  6 +++++-
 tools/firmware/hvmloader/e820.c      | 26 ++++++++++++++++++++++----
 tools/firmware/hvmloader/hvmloader.c |  3 ++-
 tools/firmware/hvmloader/pci.c       |  1 -
 tools/firmware/hvmloader/util.c      | 29 ++++++++++++++++++++++++++++-
 tools/firmware/hvmloader/util.h      |  2 ++
 6 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index d9b4713d63..844120bc87 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -2,6 +2,7 @@
 #define __HVMLOADER_CONFIG_H__
 
 #include <stdint.h>
+#include <stdbool.h>
 
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
@@ -62,6 +63,8 @@ extern uint8_t ioapic_version;
 extern unsigned long pci_mem_start, pci_mem_end;
 extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 
+extern bool acpi_enabled;
+
 /* Memory map. */
 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
 #define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
@@ -71,7 +74,8 @@ extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 #define RESERVED_MEMBASE              0xFC000000
 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
-#define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
+#define ACPI_MEMORY_DYNAMIC_START     0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_START 0xFC100000
 #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
 /*
  * GUEST_RESERVED: Physical address space reserved for guest use.
diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 4d1c955a02..38bcf18b63 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -155,6 +155,9 @@ int build_e820_table(struct e820entry *e820,
 {
     unsigned int nr = 0, i, j;
     uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    unsigned long acpi_mem_end = acpi_enabled ?
+        ACPI_MEMORY_DYNAMIC_START + (acpi_pages_allocated() << PAGE_SHIFT) :
+        RESERVED_MEMBASE;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -198,9 +201,24 @@ int build_e820_table(struct e820entry *e820,
     e820[nr].type = E820_RESERVED;
     nr++;
 
+    /*
+     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * That should help the guest to treat it correctly later: e.g. pass to
+     * the next kernel on kexec or reclaim if necessary.
+     */
+
+    if ( acpi_enabled )
+    {
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
+        e820[nr].type = E820_ACPI;
+        nr++;
+    }
+
     /*
      * Explicitly reserve space for special pages.
-     * This space starts at RESERVED_MEMBASE an extends to cover various
+     * This space starts right after ACPI region (to avoid creating a hole that
+     * might be accidentally occupied by MMIO) and extends to cover various
      * fixed hardware mappings (e.g., LAPIC, IOAPIC, default SVGA framebuffer).
      *
      * If igd_opregion_pgbase we need to split the RESERVED region in two.
@@ -210,8 +228,8 @@ int build_e820_table(struct e820entry *e820,
     {
         uint32_t igd_opregion_base = igd_opregion_pgbase << PAGE_SHIFT;
 
-        e820[nr].addr = RESERVED_MEMBASE;
-        e820[nr].size = (uint32_t) igd_opregion_base - RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
+        e820[nr].size = igd_opregion_base - acpi_mem_end;
         e820[nr].type = E820_RESERVED;
         nr++;
 
@@ -227,7 +245,7 @@ int build_e820_table(struct e820entry *e820,
     }
     else
     {
-        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
         e820[nr].size = (uint32_t)-e820[nr].addr;
         e820[nr].type = E820_RESERVED;
         nr++;
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 598a226278..c58841e5b5 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -116,6 +116,8 @@ unsigned long scratch_start = SCRATCH_PHYSICAL_ADDRESS;
 uint32_t ioapic_base_address = 0xfec00000;
 uint8_t ioapic_version;
 
+bool acpi_enabled;
+
 static void init_hypercalls(void)
 {
     uint32_t eax, ebx, ecx, edx;
@@ -321,7 +323,6 @@ const struct hvm_modlist_entry *get_module_entry(
 int main(void)
 {
     const struct bios_config *bios;
-    int acpi_enabled;
     const struct hvm_modlist_entry *bios_module;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index dcd097a866..72f92d4450 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -28,7 +28,6 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
-#include <stdbool.h>
 
 unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START;
 unsigned long pci_mem_end = PCI_MEM_END;
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 0c3f2d24cd..7da144b0bb 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -871,10 +871,37 @@ static unsigned long acpi_v2p(struct acpi_ctxt *ctxt, void *v)
     return virt_to_phys(v);
 }
 
+static unsigned long acpi_alloc_up = ACPI_MEMORY_DYNAMIC_START - 1;
+
+unsigned long acpi_pages_allocated(void)
+{
+    return (acpi_alloc_up >> PAGE_SHIFT) -
+            ((ACPI_MEMORY_DYNAMIC_START - 1) >> PAGE_SHIFT);
+}
+
 static void *acpi_mem_alloc(struct acpi_ctxt *ctxt,
                             uint32_t size, uint32_t align)
 {
-    return mem_alloc(size, align);
+    unsigned long s, e;
+
+    /* Align to at least 16 bytes. */
+    if ( align < 16 )
+        align = 16;
+
+    s = (acpi_alloc_up + align) & ~(align - 1);
+    e = s + size - 1;
+
+    BUG_ON((e < s) || (e >= RESERVED_MEMORY_DYNAMIC_START));
+
+    while ( (acpi_alloc_up >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
+    {
+        acpi_alloc_up += PAGE_SIZE;
+        mem_hole_populate_ram(acpi_alloc_up >> PAGE_SHIFT, 1);
+    }
+
+    acpi_alloc_up = e;
+
+    return (void *)s;
 }
 
 static void acpi_mem_free(struct acpi_ctxt *ctxt,
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 7bca6418d2..31889de634 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -282,6 +282,8 @@ bool check_overlap(uint64_t start, uint64_t size,
 extern const unsigned char dsdt_anycpu_qemu_xen[], dsdt_anycpu[], dsdt_15cpu[];
 extern const int dsdt_anycpu_qemu_xen_len, dsdt_anycpu_len, dsdt_15cpu_len;
 
+unsigned long acpi_pages_allocated(void);
+
 struct acpi_config;
 void hvmloader_acpi_build_tables(struct acpi_config *config,
                                  unsigned int physical);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:35:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2938.8403 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMu8-0007z5-1A; Mon, 05 Oct 2020 09:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2938.8403; Mon, 05 Oct 2020 09:35:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMu7-0007yx-UQ; Mon, 05 Oct 2020 09:35:35 +0000
Received: by outflank-mailman (input) for mailman id 2938;
 Mon, 05 Oct 2020 09:35:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMu7-0007yn-2x
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cbd52bfb-c861-45be-8785-1606276f25bb;
 Mon, 05 Oct 2020 09:35:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMu5-0000qq-O7
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMu5-0006bE-NH
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMu7-0007yn-2x
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:35 +0000
X-Inumbo-ID: cbd52bfb-c861-45be-8785-1606276f25bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cbd52bfb-c861-45be-8785-1606276f25bb;
	Mon, 05 Oct 2020 09:35:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wxaheWHxFM9JgJ9JZSnTuZ4UOgbZFbuHMz2OFsvvu8s=; b=3kHhyTHyc6Xsx+BXuljGJzhtUW
	l2jYPF7IN5G9pNd7/N/IhKkeUAarEMEO98SY4yBiTejLxViPznLG32aGZS+1iFNMVfpslw/Lkbnsm
	Rosyej3VFxI8Dfq+OZBN+Po6I4rL0IENsf1+rBocNrb4HMAJLpOQYWQ2Sf36yhn4x8Co=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMu5-0000qq-O7
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMu5-0006bE-NH
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/HVM: more consistently set I/O completion
Message-Id: <E1kPMu5-0006bE-NH@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:35:33 +0000

commit 0186e76a62f7409804c2e4785d5a11e7f82a7c52
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:42:27 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:42:27 2020 +0200

    x86/HVM: more consistently set I/O completion
    
    Doing this just in hvm_emulate_one_insn() is not enough.
    hvm_ud_intercept() and hvm_emulate_one_vm_event() can get invoked for
    insns requiring one or more continuations, and at least in principle
    hvm_emulate_one_mmio() could, too. Without proper setting of the field,
    handle_hvm_io_completion() will do nothing completion-wise, and in
    particular the missing re-invocation of the insn emulation paths will
    lead to emulation caching not getting disabled in due course, causing
    the ASSERT() in {svm,vmx}_vmenter_helper() to trigger.
    
    Reported-by: Don Slutz <don.slutz@gmail.com>
    
    Similar considerations go for the clearing of vio->mmio_access, which
    gets moved as well.
    
    Additionally all updating of vio->mmio_* now gets done dependent upon
    the new completion value, rather than hvm_ioreq_needs_completion()'s
    return value. This is because it is the completion chosen which controls
    what path will be taken when handling the completion, not the simple
    boolean return value. In particular, PIO completion doesn't involve
    going through the insn emulator, and hence emulator state ought to get
    cleared early (or it won't get cleared at all).
    
    The new logic, besides allowing for a caller override for the
    continuation type to be set (for VMX real mode emulation), will also
    avoid setting an MMIO completion when a simpler PIO one will do. This
    is a minor optimization only as a side effect - the behavior is strictly
    needed at least for hvm_ud_intercept(), as only memory accesses can
    successfully complete through handle_mmio(). Care of course needs to be
    taken to correctly deal with "mixed" insns (doing both MMIO and PIO at
    the same time, i.e. INS/OUTS). For this, hvmemul_validate() now latches
    whether the insn being emulated is a memory access, as this information
    is no longer easily available at the point where we want to consume it.
    
    Note that the presence of non-NULL .validate fields in the two ops
    structures in hvm_emulate_one_mmio() was really necessary even before
    the changes here: Without this, passing non-NULL as middle argument to
    hvm_emulate_init_once() is meaningless.
    
    The restrictions on when the #UD intercept gets actually enabled are why
    it was decided that this is not a security issue:
    - the "hvm_fep" option to enable its use is a debugging option only,
    - for the cross-vendor case is considered experimental, even if
      unfortunately SUPPORT.md doesn't have an explicit statement about
      this.
    The other two affected functions are
    - hvm_emulate_one_vm_event(), used for introspection,
    - hvm_emulate_one_mmio(), used for Dom0 only,
    which aren't qualifying this as needing an XSA either.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Don Slutz <don.slutz@gmail.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: b807cfe954b8d0d8852398b4c8a586d95d69a342
    master date: 2020-09-15 10:19:33 +0200
---
 xen/arch/x86/hvm/emulate.c        | 51 ++++++++++++++++++++++++++++++---------
 xen/arch/x86/hvm/hvm.c            |  2 +-
 xen/arch/x86/hvm/io.c             | 11 +--------
 xen/arch/x86/hvm/vmx/realmode.c   |  6 +----
 xen/include/asm-x86/hvm/emulate.h |  7 +++++-
 5 files changed, 49 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index bfa3e1ad93..69e15c56b6 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1577,9 +1577,11 @@ static int hvmemul_validate(
     const struct x86_emulate_state *state,
     struct x86_emulate_ctxt *ctxt)
 {
-    const struct hvm_emulate_ctxt *hvmemul_ctxt =
+    struct hvm_emulate_ctxt *hvmemul_ctxt =
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
 
+    hvmemul_ctxt->is_mem_access = x86_insn_is_mem_access(state, ctxt);
+
     return !hvmemul_ctxt->validate || hvmemul_ctxt->validate(state, ctxt)
            ? X86EMUL_OKAY : X86EMUL_UNHANDLEABLE;
 }
@@ -2395,8 +2397,14 @@ static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
     .vmfunc        = hvmemul_vmfunc,
 };
 
+/*
+ * Note that passing HVMIO_no_completion into this function serves as kind
+ * of (but not fully) an "auto select completion" indicator.  When there's
+ * no completion needed, the passed in value will be ignored in any case.
+ */
 static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
-    const struct x86_emulate_ops *ops)
+    const struct x86_emulate_ops *ops,
+    enum hvm_io_completion completion)
 {
     const struct cpu_user_regs *regs = hvmemul_ctxt->ctxt.regs;
     struct vcpu *curr = current;
@@ -2414,15 +2422,30 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
         rc = X86EMUL_RETRY;
 
     if ( !hvm_ioreq_needs_completion(&vio->io_req) )
+        completion = HVMIO_no_completion;
+    else if ( completion == HVMIO_no_completion )
+        completion = (vio->io_req.type != IOREQ_TYPE_PIO ||
+                      hvmemul_ctxt->is_mem_access) ? HVMIO_mmio_completion
+                                                   : HVMIO_pio_completion;
+
+    switch ( vio->io_completion = completion )
     {
+    case HVMIO_no_completion:
+    case HVMIO_pio_completion:
         vio->mmio_cache_count = 0;
         vio->mmio_insn_bytes = 0;
-    }
-    else
-    {
+        vio->mmio_access = (struct npfec){};
+        break;
+
+    case HVMIO_mmio_completion:
+    case HVMIO_realmode_completion:
         BUILD_BUG_ON(sizeof(vio->mmio_insn) < sizeof(hvmemul_ctxt->insn_buf));
         vio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
         memcpy(vio->mmio_insn, hvmemul_ctxt->insn_buf, vio->mmio_insn_bytes);
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
     }
 
     if ( hvmemul_ctxt->ctxt.retire.singlestep )
@@ -2462,9 +2485,10 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
 }
 
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt)
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion)
 {
-    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops);
+    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
 int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
@@ -2473,12 +2497,14 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmcfg_intercept_write,
+        .validate   = hvmemul_validate,
         .cpuid      = hvmemul_cpuid,
     };
     static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmio_ro_emulated_write,
+        .validate   = hvmemul_validate,
         .cpuid      = hvmemul_cpuid,
     };
     struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla };
@@ -2499,8 +2525,8 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
     hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
                           guest_cpu_user_regs());
     ctxt.ctxt.data = &mmio_ro_ctxt;
-    rc = _hvm_emulate_one(&ctxt, ops);
-    switch ( rc )
+
+    switch ( rc = _hvm_emulate_one(&ctxt, ops, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
@@ -2527,7 +2553,8 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     switch ( kind )
     {
     case EMUL_KIND_NOWRITE:
-        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write);
+        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write,
+                              HVMIO_no_completion);
         break;
     case EMUL_KIND_SET_CONTEXT_INSN: {
         struct vcpu *curr = current;
@@ -2548,7 +2575,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     /* Fall-through */
     default:
         ctx.set_context = (kind == EMUL_KIND_SET_CONTEXT_DATA);
-        rc = hvm_emulate_one(&ctx);
+        rc = hvm_emulate_one(&ctx, HVMIO_no_completion);
     }
 
     switch ( rc )
@@ -2644,6 +2671,8 @@ void hvm_emulate_init_per_insn(
         hvmemul_ctxt->insn_buf_bytes = insn_bytes;
         memcpy(hvmemul_ctxt->insn_buf, insn_buf, insn_bytes);
     }
+
+    hvmemul_ctxt->is_mem_access = false;
 }
 
 void hvm_emulate_writeback(
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index a98f7471b4..4d170ca597 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3773,7 +3773,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
         return;
     }
 
-    switch ( hvm_emulate_one(&ctxt) )
+    switch ( hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 724ab44a76..3e09d9b726 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -81,20 +81,11 @@ void send_invalidate_req(void)
 bool hvm_emulate_one_insn(hvm_emulate_validate_t *validate, const char *descr)
 {
     struct hvm_emulate_ctxt ctxt;
-    struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     hvm_emulate_init_once(&ctxt, validate, guest_cpu_user_regs());
 
-    rc = hvm_emulate_one(&ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_mmio_completion;
-    else
-        vio->mmio_access = (struct npfec){};
-
-    switch ( rc )
+    switch ( rc = hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
         hvm_dump_emulation_state(XENLOG_G_WARNING, descr, &ctxt, rc);
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index bb0b4439df..b1d445923a 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -96,15 +96,11 @@ static void realmode_deliver_exception(
 void vmx_realmode_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt)
 {
     struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     perfc_incr(realmode_emulations);
 
-    rc = hvm_emulate_one(hvmemul_ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_realmode_completion;
+    rc = hvm_emulate_one(hvmemul_ctxt, HVMIO_realmode_completion);
 
     if ( rc == X86EMUL_UNHANDLEABLE )
     {
diff --git a/xen/include/asm-x86/hvm/emulate.h b/xen/include/asm-x86/hvm/emulate.h
index 26a01e83a4..240b39447b 100644
--- a/xen/include/asm-x86/hvm/emulate.h
+++ b/xen/include/asm-x86/hvm/emulate.h
@@ -46,6 +46,8 @@ struct hvm_emulate_ctxt {
 
     uint32_t intr_shadow;
 
+    bool is_mem_access;
+
     bool_t set_context;
 };
 
@@ -56,11 +58,14 @@ enum emul_kind {
     EMUL_KIND_SET_CONTEXT_INSN
 };
 
+enum hvm_io_completion;
+
 bool __nonnull(1, 2) hvm_emulate_one_insn(
     hvm_emulate_validate_t *validate,
     const char *descr);
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt);
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion);
 void hvm_emulate_one_vm_event(enum emul_kind kind,
     unsigned int trapnr,
     unsigned int errcode);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 09:35:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 09:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.2939.8408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMuI-00080X-45; Mon, 05 Oct 2020 09:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 2939.8408; Mon, 05 Oct 2020 09:35:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPMuI-00080Q-17; Mon, 05 Oct 2020 09:35:46 +0000
Received: by outflank-mailman (input) for mailman id 2939;
 Mon, 05 Oct 2020 09:35:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPMuG-00080C-SM
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8a1ae709-f343-46ce-9c04-733132abfb53;
 Mon, 05 Oct 2020 09:35:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMuF-0000qy-R3
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPMuF-0006cG-QU
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPMuG-00080C-SM
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:44 +0000
X-Inumbo-ID: 8a1ae709-f343-46ce-9c04-733132abfb53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8a1ae709-f343-46ce-9c04-733132abfb53;
	Mon, 05 Oct 2020 09:35:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MZgk8oP0u5JOjQQcrlNcmIrM3ByXzBRlTE3RVxOP0+M=; b=ce6XbTppkrf4EAyKSG28+R9P8b
	7EpV7tz5OgUmjMdrTF4HDsaQRRkHCIGRylJQ+MxHo8F4qsVBnsdmOzP9JaUEiqQhVdEzpyr7G9LNB
	DD/AhN30SJDOzpZnPwZ4z9avhI8vD79oZjModAz2RYYSGIzVgX+jL8jBQqWwjVJaYDEg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMuF-0000qy-R3
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPMuF-0006cG-QU
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 09:35:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kPMuF-0006cG-QU@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 09:35:43 +0000

commit 6888017392ac25b5e588554030642affac25a95d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:36:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:36:11 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index fc9d6b5bf0..56cfbbe2d8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 640c708659..7c170f520a 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 3d00c747f6..277fb66e91 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -280,6 +280,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index 93386bd7a1..32ecc0ea2a 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3019.8696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRCj-0001bl-KT; Mon, 05 Oct 2020 14:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3019.8696; Mon, 05 Oct 2020 14:11:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRCj-0001bd-Gm; Mon, 05 Oct 2020 14:11:05 +0000
Received: by outflank-mailman (input) for mailman id 3019;
 Mon, 05 Oct 2020 14:11:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRCi-0001bN-Q1
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d88a0ce7-594f-4f13-8985-dfdd2bf123d6;
 Mon, 05 Oct 2020 14:11:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRCg-0006hi-0O
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRCf-000172-Vu
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRCi-0001bN-Q1
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:04 +0000
X-Inumbo-ID: d88a0ce7-594f-4f13-8985-dfdd2bf123d6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d88a0ce7-594f-4f13-8985-dfdd2bf123d6;
	Mon, 05 Oct 2020 14:11:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5TdaCCFnI3ENdzfUKq5pZ+WSAT+6eHbjhQ63A/etPfM=; b=Hx2LjtknSwzhBqHX4PALEu0LjX
	YHFTm0kS2JnlALAe7FpwzPXLRRFi2AuENSh5xRxGZFIh7G+dj+SqK8ezlUCUU1wAvkNveyAgXKieV
	prQKOzt56+UmSnwVhJyktSl47pKydEw7LCT/qWerMKp6Sn+TV20EDAj+LIUcZ2iFvP6o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRCg-0006hi-0O
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRCf-000172-Vu
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
Message-Id: <E1kPRCf-000172-Vu@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:01 +0000

commit b04d6731eedd639e078e0f0d8147c6b156875ac3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:09:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:09:36 2020 +0200

    x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
    
    This MSR doesn't exist on AMD hardware, and switching away from the safe
    functions in the common MSR path was an erroneous change.
    
    Partially revert the change.
    
    This is XSA-333.
    
    Fixes: 4fdc932b3cc ("x86/Intel: drop another 32-bit leftover")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 7c21076dd0..85a9fd4767 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -913,7 +913,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, *val);
+        if ( rdmsr_safe(reg, *val) )
+            break;
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1053,7 +1054,8 @@ static int write_msr(unsigned int reg, uint64_t val,
         break;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, temp);
+        if ( rdmsr_safe(reg, temp) )
+            break;
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3020.8700 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRCt-0001eE-L9; Mon, 05 Oct 2020 14:11:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3020.8700; Mon, 05 Oct 2020 14:11:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRCt-0001e6-II; Mon, 05 Oct 2020 14:11:15 +0000
Received: by outflank-mailman (input) for mailman id 3020;
 Mon, 05 Oct 2020 14:11:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRCs-0001dp-5N
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5720109d-e117-4bd7-bc3f-4e1c70db78ee;
 Mon, 05 Oct 2020 14:11:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRCq-0006iY-5o
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRCq-00017b-2Z
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRCs-0001dp-5N
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:14 +0000
X-Inumbo-ID: 5720109d-e117-4bd7-bc3f-4e1c70db78ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5720109d-e117-4bd7-bc3f-4e1c70db78ee;
	Mon, 05 Oct 2020 14:11:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WQ3/EFdoTIYYP/p8+sN59reY7p4foeG+et4ZynwODrU=; b=XIwwZgIubpmrMhxpceb5wDDr2W
	wQdL1W+pBmGE8j+5JwKKvcY/vQe74TkmWrS+TFilMXPaFTj4C16yNLQM/KhXepoV0u4gq+R6rpmBU
	04wpm7tP/cGaBbr3X5WA1KOkk3wmsqF1FQVxRtMLnYeWyyDuKcc7uI3gzLYKmH5sYkbc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRCq-0006iY-5o
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRCq-00017b-2Z
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/memory: Don't skip the RCU unlock path in acquire_resource()
Message-Id: <E1kPRCq-00017b-2Z@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:12 +0000

commit 5eab5f0543e4f5fc52f7e2d823a29a6b1567fc16
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:09:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:09:59 2020 +0200

    xen/memory: Don't skip the RCU unlock path in acquire_resource()
    
    In the case that an HVM Stubdomain makes an XENMEM_acquire_resource hypercall,
    the FIXME path will bypass rcu_unlock_domain() on the way out of the function.
    
    Move the check to the start of the function.  This does change the behaviour
    of the get-size path for HVM Stubdomains, but that functionality is currently
    broken and unused anyway, as well as being quite useless to entities which
    can't actually map the resource anyway.
    
    This is XSA-334.
    
    Fixes: 83fa6552ce ("common: add a new mappable resource type: XENMEM_resource_grant_table")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 714077c1e5..1bab0e80c2 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1058,6 +1058,14 @@ static int acquire_resource(
     xen_pfn_t mfn_list[32];
     int rc;
 
+    /*
+     * FIXME: Until foreign pages inserted into the P2M are properly
+     *        reference counted, it is unsafe to allow mapping of
+     *        resource pages unless the caller is the hardware domain.
+     */
+    if ( paging_mode_translate(currd) && !is_hardware_domain(currd) )
+        return -EACCES;
+
     if ( copy_from_guest(&xmar, arg, 1) )
         return -EFAULT;
 
@@ -1114,14 +1122,6 @@ static int acquire_resource(
         xen_pfn_t gfn_list[ARRAY_SIZE(mfn_list)];
         unsigned int i;
 
-        /*
-         * FIXME: Until foreign pages inserted into the P2M are properly
-         *        reference counted, it is unsafe to allow mapping of
-         *        resource pages unless the caller is the hardware domain.
-         */
-        if ( !is_hardware_domain(currd) )
-            return -EACCES;
-
         if ( copy_from_guest(gfn_list, xmar.frame_list, xmar.nr_frames) )
             rc = -EFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3021.8704 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRD2-0001g6-NC; Mon, 05 Oct 2020 14:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3021.8704; Mon, 05 Oct 2020 14:11:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRD2-0001fy-K4; Mon, 05 Oct 2020 14:11:24 +0000
Received: by outflank-mailman (input) for mailman id 3021;
 Mon, 05 Oct 2020 14:11:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRD1-0001fn-HK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0a5bc406-ed10-49b6-9633-068991743d11;
 Mon, 05 Oct 2020 14:11:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRD0-0006is-98
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRD0-00018U-8B
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRD1-0001fn-HK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:23 +0000
X-Inumbo-ID: 0a5bc406-ed10-49b6-9633-068991743d11
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0a5bc406-ed10-49b6-9633-068991743d11;
	Mon, 05 Oct 2020 14:11:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qa34gfc4OSfE5FwIZF667TI5C8BgWooSk1+W+sbu7Pw=; b=iCNh9mLuzhSFbieig4T+9ABXAO
	zZv9+GmnvYd9cpRqIOBWkQPp03Wlp33ijPR05c0YI4Cvg8Jt3cP3Slwf8AzbGACOINe/S2x0VpurH
	L3cgKvbfKEqhpWuldv5kDCr+rRZLwArdrybDAYit8AO8RcCGWLl1/yEuy3idunOIYW6c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRD0-0006is-98
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRD0-00018U-8B
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kPRD0-00018U-8B@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:22 +0000

commit fc8200a6ad5248d8fb6b0fbf3f3dc80f29dfe0c7
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 16:10:37 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:10:37 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 81 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 49 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 5bb47583b3..f965ca3155 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -658,6 +658,8 @@ int hvm_domain_initialise(struct domain *d)
     /* need link to containing domain */
     d->arch.hvm.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 47f2c2aa64..d64467b631 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -153,23 +153,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm.tm_lock);
+    read_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -219,7 +228,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -227,7 +236,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -235,7 +244,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -248,7 +257,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -309,7 +318,7 @@ int pt_update_irq(struct vcpu *v)
     int irq, pt_vector = -1;
     bool level;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -339,7 +348,7 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
@@ -347,7 +356,7 @@ int pt_update_irq(struct vcpu *v)
     irq = earliest_pt->irq;
     level = earliest_pt->level;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -394,7 +403,7 @@ int pt_update_irq(struct vcpu *v)
                 time_cb *cb = NULL;
                 void *cb_priv;
 
-                spin_lock(&v->arch.hvm.tm_lock);
+                pt_vcpu_lock(v);
                 /* Make sure the timer is still on the list. */
                 list_for_each_entry ( pt, &v->arch.hvm.tm_list, list )
                     if ( pt == earliest_pt )
@@ -404,7 +413,7 @@ int pt_update_irq(struct vcpu *v)
                         cb_priv = pt->priv;
                         break;
                     }
-                spin_unlock(&v->arch.hvm.tm_lock);
+                pt_vcpu_unlock(v);
 
                 if ( cb != NULL )
                     cb(v, cb_priv);
@@ -441,12 +450,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -455,7 +464,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -466,12 +475,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -490,7 +499,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -540,7 +549,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -565,30 +574,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index f0e0eaec83..39d26cbda4 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -128,6 +128,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3022.8708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDC-0001iD-Oj; Mon, 05 Oct 2020 14:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3022.8708; Mon, 05 Oct 2020 14:11:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDC-0001i5-Lj; Mon, 05 Oct 2020 14:11:34 +0000
Received: by outflank-mailman (input) for mailman id 3022;
 Mon, 05 Oct 2020 14:11:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRDB-0001hy-Sg
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 772a166d-a114-4312-8e90-7027b5221f3f;
 Mon, 05 Oct 2020 14:11:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDA-0006iz-UQ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDA-00019K-BT
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRDB-0001hy-Sg
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:33 +0000
X-Inumbo-ID: 772a166d-a114-4312-8e90-7027b5221f3f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 772a166d-a114-4312-8e90-7027b5221f3f;
	Mon, 05 Oct 2020 14:11:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VbjbEe7snBefvixDk67OV3cmSwdPmzCNHqJ/ZPvyveA=; b=hJ5JdGmRflnj2OoLvFlmVLKa6V
	s9qXlpZT5DA7JAA2fDAve6/+vPmtXEG4F8mUZ3QwVgbM0M8cZGPuy1GZPmBo7ECPPScRJqLwF7wYM
	fJynCVCN2+rzI2mw4lNt8FecZN7oSyWtlxoJU9wrut9I2ZMWLdPRBtJEe7FWpKDF88ek=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDA-0006iz-UQ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDA-00019K-BT
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/msi: get rid of read_msi_msg
Message-Id: <E1kPRDA-00019K-BT@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:32 +0000

commit 5ad31525c9aeed6d3a349799fe491b5a7c678049
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 16:11:06 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:11:06 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 53 +----------------------------------------------------
 1 file changed, 1 insertion(+), 52 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 161ee60dbe..6a00bc9312 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -185,54 +185,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        uint16_t data;
-
-        msg->address_lo = pci_conf_read32(dev->sbdf,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(dev->sbdf,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -304,10 +256,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3023.8711 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDN-0001jw-QN; Mon, 05 Oct 2020 14:11:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3023.8711; Mon, 05 Oct 2020 14:11:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDN-0001jn-NM; Mon, 05 Oct 2020 14:11:45 +0000
Received: by outflank-mailman (input) for mailman id 3023;
 Mon, 05 Oct 2020 14:11:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRDM-0001je-2x
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 09d891d2-2591-403c-9e9c-53782bb17a47;
 Mon, 05 Oct 2020 14:11:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDL-0006j9-12
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDL-00019x-0K
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRDM-0001je-2x
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:44 +0000
X-Inumbo-ID: 09d891d2-2591-403c-9e9c-53782bb17a47
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 09d891d2-2591-403c-9e9c-53782bb17a47;
	Mon, 05 Oct 2020 14:11:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YfYck3xkfzuf1OR0rk1o0V15FUo91A/Fv2ffdnHGuPw=; b=pFnsPAza6YMkYIjpr3wiWrOaTJ
	wrUrthjiUB8Czf8s2OZBYHxcaZnN3u7C9/YY7+oqfhN5Og5nnLsxZIJNQ1rPGxSDIMoge+5Uwp0uC
	gt3PN3QPLFFqkOpUYrd4P8ei564uKN2OF4P2x6g/iEqn+z/rqKQP3rryA26OoVuVi1gk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDL-0006j9-12
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDL-00019x-0K
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kPRDL-00019x-0K@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:43 +0000

commit 0bc4177e6b0d7a98464913af95d3bfe4b59b7a2c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:11:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:11:38 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 60 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 6a00bc9312..c8b0e5334f 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -771,16 +771,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
     unsigned int pos = pci_find_cap_offset(seg, bus, slot, func,
                                            PCI_CAP_ID_MSIX);
 
@@ -822,43 +820,45 @@ static int msix_capability_init(struct pci_dev *dev,
 
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(dev->sbdf, msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
-    {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(dev->sbdf, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->table.first = PFN_DOWN(table_paddr);
         msix->table.last = PFN_DOWN(table_paddr +
@@ -877,7 +877,18 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(msix->nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
+    }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
+        xfree(entry);
+        return -ENODATA;
     }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      PAGE_OFFSET(table_offset & ~PCI_MSIX_BIRMASK);
 
     if ( entry )
     {
@@ -888,8 +899,15 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
+            pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
             xfree(entry);
             return idx;
         }
@@ -1078,9 +1096,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:11:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3024.8716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDX-0001lQ-Tk; Mon, 05 Oct 2020 14:11:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3024.8716; Mon, 05 Oct 2020 14:11:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDX-0001lI-Qm; Mon, 05 Oct 2020 14:11:55 +0000
Received: by outflank-mailman (input) for mailman id 3024;
 Mon, 05 Oct 2020 14:11:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRDW-0001l7-5w
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f65e4ac-b805-4e04-9085-43c493e6de87;
 Mon, 05 Oct 2020 14:11:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDV-0006kf-3o
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDV-0001As-38
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRDW-0001l7-5w
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:54 +0000
X-Inumbo-ID: 4f65e4ac-b805-4e04-9085-43c493e6de87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f65e4ac-b805-4e04-9085-43c493e6de87;
	Mon, 05 Oct 2020 14:11:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nsW9vNjy2tsR+2o9PeVL++413BDcLThO5f6LQyPHcGo=; b=6/xTFm18VbKmMB/DNMMQiHwuWI
	3g3tctMhKbf0dn9B62kZtpLUpadpdXxxotHviAU0mg9IbPzP8zIqUZMQ92+gQKxaUNBfyM1OdqD7W
	cH8u0hfj7LkLCO+M5yy8tWB6AYKUlEczrVu2ldnIrx5J1bVCTHc15R1coDINwilL0jJw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDV-0006kf-3o
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDV-0001As-38
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:11:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: relax port_is_valid()
Message-Id: <E1kPRDV-0001As-38@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:11:53 +0000

commit e417504febf4ef5cc3442ebaa00da1a5c7939b22
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:11:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:11:56 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index a7798f6765..ce45298377 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,8 +107,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3025.8720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDh-0001n4-Vv; Mon, 05 Oct 2020 14:12:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3025.8720; Mon, 05 Oct 2020 14:12:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDh-0001mw-SS; Mon, 05 Oct 2020 14:12:05 +0000
Received: by outflank-mailman (input) for mailman id 3025;
 Mon, 05 Oct 2020 14:12:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRDg-0001mm-Nb
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 79e049e7-328e-49c2-9183-76d5b0d42a58;
 Mon, 05 Oct 2020 14:12:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDf-0006lY-8A
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDf-0001Bc-6A
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRDg-0001mm-Nb
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:04 +0000
X-Inumbo-ID: 79e049e7-328e-49c2-9183-76d5b0d42a58
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 79e049e7-328e-49c2-9183-76d5b0d42a58;
	Mon, 05 Oct 2020 14:12:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3f4Lyu8c+WheuIwpM8KhPAjOYkNy77y8qSVlLkeGpTE=; b=5/WydvzSXshc1YPODgW2RlA7GD
	prQbmK7GjJJK1WpL4KeF+F2PDXgizTkh5PMkA+jlKqL0WyPWN6ZSti77EM14aCx5u4Isxvn+mqg7J
	RI1Puf0ByGjOfwIUFH6Qbxt/AWFGT5jY38nUNjv47QywklYeqC1ZfS+PljunS3Ui8YTw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDf-0006lY-8A
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDf-0001Bc-6A
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Avoid double exception injection
Message-Id: <E1kPRDf-0001Bc-6A@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:03 +0000

commit eb4a543a47df33038f4f6e915375ea898670c7dc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 16:12:44 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:12:44 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c3e62f8734..73619f57ca 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -78,7 +78,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -352,7 +351,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 1e880eb9f6..71a00e846b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -90,7 +90,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -512,6 +511,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3026.8724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDs-0001oV-1R; Mon, 05 Oct 2020 14:12:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3026.8724; Mon, 05 Oct 2020 14:12:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRDr-0001oM-UJ; Mon, 05 Oct 2020 14:12:15 +0000
Received: by outflank-mailman (input) for mailman id 3026;
 Mon, 05 Oct 2020 14:12:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRDq-0001o8-C9
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 627a2443-6bb6-44b1-a8ab-63eee9737e44;
 Mon, 05 Oct 2020 14:12:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDp-0006li-B5
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDp-0001CG-AO
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRDq-0001o8-C9
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:14 +0000
X-Inumbo-ID: 627a2443-6bb6-44b1-a8ab-63eee9737e44
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 627a2443-6bb6-44b1-a8ab-63eee9737e44;
	Mon, 05 Oct 2020 14:12:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hRjCBPebXPYJupDEWsA5ya1TWwg3bzLHlJMf7iFPSxs=; b=kHECwxWoxOJ3fWW8ATzE0YojbG
	3Lm69ZLyS/y3EUL5+Vzk40BloUQBcJeXLEVB59pAQElVPiZhlE2cPr6z6gBIwWUJ/rQyAvmEUt6O2
	YkBCql0KaDMYJfmj8OIFC4P2RKO4RA4N+t3/1pHeLVGgsoBPMn/O/suoOWhKypkIHxvs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDp-0006li-B5
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDp-0001CG-AO
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kPRDp-0001CG-AO@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:13 +0000

commit f5469067ee0260673ca1e554ff8888512a55ccfc
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 16:13:08 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:13:08 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a8d182b584..53c17bd354 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -178,6 +178,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index ce45298377..c35f4b23b6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,7 +107,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3027.8728 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRE2-0001q2-36; Mon, 05 Oct 2020 14:12:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3027.8728; Mon, 05 Oct 2020 14:12:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRE1-0001pu-WA; Mon, 05 Oct 2020 14:12:25 +0000
Received: by outflank-mailman (input) for mailman id 3027;
 Mon, 05 Oct 2020 14:12:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRE0-0001pf-I7
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 65676c36-dd2d-498e-8866-d7dd3b2c72f4;
 Mon, 05 Oct 2020 14:12:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDz-0006lr-EH
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRDz-0001ML-DV
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRE0-0001pf-I7
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:24 +0000
X-Inumbo-ID: 65676c36-dd2d-498e-8866-d7dd3b2c72f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 65676c36-dd2d-498e-8866-d7dd3b2c72f4;
	Mon, 05 Oct 2020 14:12:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=er9FaWyf7SB0sAzY4phCI23sjOvftm2b2q9bdy1NmQs=; b=ngvyXHX75eaOSuBjcXPY0dvQ/r
	vD46PfOMGchrnIZpp3XtyLLosg5Vbow3ywAfgeCEtxr1vemW3xJBcuby2IuXkvSbjqCTIXBmUsKPp
	hwnjSF41iJqN1ZsefWcEdMoRxv4HPZjyEJAIBQtmDMx8Eb6QcrMt1/w29YIQc0eS0sI8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDz-0006lr-EH
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRDz-0001ML-DV
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kPRDz-0001ML-DV@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:23 +0000

commit b8c2efbe7b3e8fa5f0b0a3679afccd1204949070
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:13:34 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:13:34 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/sched/core.c    | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53c17bd354..08ffe0f063 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -151,7 +151,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1396,13 +1396,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 230f440f14..2f13d92128 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -478,7 +478,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -488,7 +488,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -546,6 +546,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -562,8 +564,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index cb49a8bc02..ab94d2ec3a 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1428,7 +1428,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index c35f4b23b6..e1b299e8df 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,6 +105,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ac53519d7f..545f2bdcd0 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -359,7 +359,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3029.8733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREC-0001s5-5n; Mon, 05 Oct 2020 14:12:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3029.8733; Mon, 05 Oct 2020 14:12:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREC-0001rx-1R; Mon, 05 Oct 2020 14:12:36 +0000
Received: by outflank-mailman (input) for mailman id 3029;
 Mon, 05 Oct 2020 14:12:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREA-0001rq-KH
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b8efe26c-bfcb-4068-b5f3-ce315a74989f;
 Mon, 05 Oct 2020 14:12:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRE9-0006ly-HA
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRE9-0001N2-Gb
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREA-0001rq-KH
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:34 +0000
X-Inumbo-ID: b8efe26c-bfcb-4068-b5f3-ce315a74989f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b8efe26c-bfcb-4068-b5f3-ce315a74989f;
	Mon, 05 Oct 2020 14:12:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U+ZCdUoTYb6E8B6kZjr2maf9kAO3WsKde38tP9lI9gI=; b=3KlYocZsHTjA4G0pQ2sDwds/x2
	VQ0+vja6GVVsNL7R+bl2/nxHcYL4E43W1rXsFqx2+d0jHt+zQ2uclT3WYzTE8BJkf5MBP73c1+Don
	T0MFLGYJg+UJaWpi/2nEHyhLOhfUl2c7BkcZT+jVzwNsuOcWOqL96honLdHByuFK8Q+w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRE9-0006ly-HA
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRE9-0001N2-Gb
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kPRE9-0001N2-Gb@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:33 +0000

commit 9b9fc8e391b6d5afa83f90271fdbd0e13871e841
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:14:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:14:22 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 08ffe0f063..6a566917b1 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -188,6 +188,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -211,11 +213,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -258,6 +275,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -351,6 +369,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -488,7 +507,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -536,6 +555,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1011,10 +1031,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1024,7 +1044,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1033,7 +1055,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1219,10 +1241,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1238,7 +1259,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1314,6 +1338,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long, BITS_TO_LONGS(d->max_vcpus));
@@ -1340,6 +1365,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 545f2bdcd0..b9c70da4b0 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -361,6 +361,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3030.8736 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREM-0001te-7x; Mon, 05 Oct 2020 14:12:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3030.8736; Mon, 05 Oct 2020 14:12:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREM-0001tU-4n; Mon, 05 Oct 2020 14:12:46 +0000
Received: by outflank-mailman (input) for mailman id 3030;
 Mon, 05 Oct 2020 14:12:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREK-0001tJ-PJ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bafba944-2d23-45dc-8b9e-3d860b9692a1;
 Mon, 05 Oct 2020 14:12:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREJ-0006m8-K9
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREJ-0001Ni-JK
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREK-0001tJ-PJ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:44 +0000
X-Inumbo-ID: bafba944-2d23-45dc-8b9e-3d860b9692a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bafba944-2d23-45dc-8b9e-3d860b9692a1;
	Mon, 05 Oct 2020 14:12:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j4K1lqnkVhRyMz3OX6rfAthm+VEn7wM8inXmW6rSdt4=; b=yLgKNq6lLQFq8bNxgroqn9d3KX
	DuuOKz3mwNLrHSbbnOxjOYotF8K77CkIOU4ZfnkbxEIAWLqWSnlkGxPqjhN3yUzAx6k1GU0Ijxz4G
	yWUNebHpKfzCFjGFvPhqVttTcoIqwBriX6E7c8FevwSAfkJEIGs/ypBAl8IWT8fYQ/FE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREJ-0006m8-K9
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREJ-0001Ni-JK
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kPREJ-0001Ni-JK@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:43 +0000

commit 2ee270e126458471b178ca1e5d7d8d0afc48be39
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:14:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:14:56 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6a566917b1..0e550e9c7a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -248,6 +248,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -263,14 +264,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -283,26 +284,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -312,6 +319,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -347,7 +355,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -364,7 +372,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -387,6 +395,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -424,14 +433,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -448,6 +457,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( domain_vcpu(d, vcpu) == NULL )
         return -ENOENT;
@@ -459,13 +469,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -509,6 +519,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -541,14 +552,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -569,6 +580,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -668,14 +680,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -683,9 +695,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -705,13 +717,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -746,7 +759,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1238,6 +1251,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1250,14 +1264,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1280,11 +1294,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1294,7 +1309,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:12:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:12:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3031.8740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREX-0001ur-9N; Mon, 05 Oct 2020 14:12:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3031.8740; Mon, 05 Oct 2020 14:12:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREX-0001ui-6K; Mon, 05 Oct 2020 14:12:57 +0000
Received: by outflank-mailman (input) for mailman id 3031;
 Mon, 05 Oct 2020 14:12:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREV-0001uU-7A
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 590ac4cf-c793-493a-8414-6beba1af92c9;
 Mon, 05 Oct 2020 14:12:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRET-0006mM-Nj
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRET-0001OG-Ma
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREV-0001uU-7A
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:55 +0000
X-Inumbo-ID: 590ac4cf-c793-493a-8414-6beba1af92c9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 590ac4cf-c793-493a-8414-6beba1af92c9;
	Mon, 05 Oct 2020 14:12:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ixDBC3nEDV+VCk3XCxWFgyipK7OHlcnexgufXJrxctQ=; b=j4nUbGwTY3LXarhQNoWEYAK/uI
	nC1EB3mHTJw8KxuV5LNLYsf/IIw5FcWcQ9WYjqeBCpeF6eXNQ+YfbS/aLC1DIECmeCD8W+wClOUNd
	O4o/ZKEbUJU3f5OtmISOuWvr/ulp+/MwQjr43KSzO03jMLmhIU+w9b5R9us/GB9VBNqk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRET-0006mM-Nj
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRET-0001OG-Ma
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:12:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: address races with evtchn_reset()
Message-Id: <E1kPRET-0001OG-Ma@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:12:53 +0000

commit ecc6428b7ea63a24e244f747e8568c0ccc03a6f8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:15:14 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:15:14 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index a69937c840..93c4fb9a79 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2488,14 +2488,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i++];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("d%d:%3d(%c%c%c)%c",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       info->masked ? 'M' : '-',
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-',
                        i < action->nr_guests ? ',' : '\n');
             }
         }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 3a0525c209..9aef7a860a 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -660,8 +660,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0e550e9c7a..878e4250ed 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -156,8 +156,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -774,6 +775,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -784,7 +786,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -813,7 +818,9 @@ void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -823,6 +830,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -837,7 +845,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1034,12 +1044,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1449,8 +1462,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 2f13d92128..68d0c7a632 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -296,23 +296,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index 98a85233cb..5e09ede6d7 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline bool arch_virq_is_global(unsigned int virq)
     return true;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index e1b299e8df..bc9aa68650 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -133,6 +133,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -165,19 +183,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -193,38 +216,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -233,6 +285,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3032.8745 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREg-0001wA-C5; Mon, 05 Oct 2020 14:13:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3032.8745; Mon, 05 Oct 2020 14:13:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREg-0001w2-7r; Mon, 05 Oct 2020 14:13:06 +0000
Received: by outflank-mailman (input) for mailman id 3032;
 Mon, 05 Oct 2020 14:13:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREe-0001vu-QQ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 442a8aac-bcfd-4d70-8172-397b83a6de0e;
 Mon, 05 Oct 2020 14:13:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREd-0006nN-Qf
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREd-0001P4-Q1
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREe-0001vu-QQ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:04 +0000
X-Inumbo-ID: 442a8aac-bcfd-4d70-8172-397b83a6de0e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 442a8aac-bcfd-4d70-8172-397b83a6de0e;
	Mon, 05 Oct 2020 14:13:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zHyE4eKiZOJuvFJLl5hejeLLrde7VzdXyxY4P4133OA=; b=gltR36zU3T0jFybGvBzp2nn9Am
	EPkOZcU5062f/nUyJ9A1JkPnEmX5+pGotd3RrLIX7zDPq60Ik8w35IJSAFeC8/PsSaeaPWppDU/Dq
	7BeoScRwTrc0IzLR5DFfyZCD/8NsEtj1LqO5nFg6MVu5bABDEpP2PShGtMBjfOG5wAD0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREd-0006nN-Qf
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREd-0001P4-Q1
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kPREd-0001P4-Q1@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:03 +0000

commit 66cdf341428ae38f6426408a95de9830b5c9c83c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:15:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:15:59 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index e9be05f1d0..364fcbabb2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -715,12 +715,14 @@ int domain_kill(struct domain *d)
             return domain_kill(d);
         d->is_dying = DOMDYING_dying;
         argo_destroy(d);
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         vnuma_destroy(d->vnuma);
         domain_set_outstanding_pages(d, 0);
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 878e4250ed..3b1fe423df 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1297,7 +1297,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1309,7 +1318,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1380,8 +1399,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1390,14 +1408,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index b9c70da4b0..57d34b2205 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -138,7 +138,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d, unsigned int max_port);
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3033.8748 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREr-0001xh-FQ; Mon, 05 Oct 2020 14:13:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3033.8748; Mon, 05 Oct 2020 14:13:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPREr-0001xZ-B5; Mon, 05 Oct 2020 14:13:17 +0000
Received: by outflank-mailman (input) for mailman id 3033;
 Mon, 05 Oct 2020 14:13:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREp-0001xQ-Dd
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2638d9d8-b889-4e39-8515-83d00d696d5e;
 Mon, 05 Oct 2020 14:13:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREn-0006nV-Tl
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREn-0001Ph-T5
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREp-0001xQ-Dd
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:15 +0000
X-Inumbo-ID: 2638d9d8-b889-4e39-8515-83d00d696d5e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2638d9d8-b889-4e39-8515-83d00d696d5e;
	Mon, 05 Oct 2020 14:13:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k5knosOPVwz+dbpBsmcXfYBHTd/sj7DLDuKSNdl9GOA=; b=QjEvWvU4QptWQ9OJYnjsfdfj2w
	GoWbXhdiXrnLORFEDCYTmJlkmVTjWAhx+RmgTK5SBD8/jMJ1UJB8SKddAZ+ruwMcQpBfkxDRCLlGJ
	umJYh0j98ggNuOTWFbYe6c3dh4wEoRA0VSOcrCRTcugiGM1N/QTXNXiz+kJth9YHises=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREn-0006nV-Tl
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREn-0001Ph-T5
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kPREn-0001Ph-T5@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:13 +0000

commit 03019c20b516be53ba0cd393f5291974a9a6c9a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 16:16:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 16:16:52 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 364fcbabb2..a275a35c4f 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1145,7 +1145,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1159,7 +1159,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a69b3b59a8..2b25653b49 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -562,12 +562,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 3b1fe423df..d2ee83bbbf 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1057,7 +1057,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1065,11 +1065,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1204,7 +1233,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1217,9 +1247,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 59bdc28c89..f416722491 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1159,7 +1159,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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index cfb7929fef..b896d8da2a 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index bc9aa68650..fa93a3684a 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -179,7 +179,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 57d34b2205..a0d87ef9d0 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -371,6 +371,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -663,7 +665,7 @@ int domain_kill(struct domain *d);
 int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3034.8752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRF1-0001zJ-G1; Mon, 05 Oct 2020 14:13:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3034.8752; Mon, 05 Oct 2020 14:13:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRF1-0001zC-Cp; Mon, 05 Oct 2020 14:13:27 +0000
Received: by outflank-mailman (input) for mailman id 3034;
 Mon, 05 Oct 2020 14:13:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPREz-0001ya-8c
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c029b158-bd02-4fe6-aa72-4133685c987e;
 Mon, 05 Oct 2020 14:13:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREy-0006nd-0b
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPREx-0001Qo-W6
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPREz-0001ya-8c
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:25 +0000
X-Inumbo-ID: c029b158-bd02-4fe6-aa72-4133685c987e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c029b158-bd02-4fe6-aa72-4133685c987e;
	Mon, 05 Oct 2020 14:13:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OMFqYrBd72yev0XfLsUp6wvjLCQ6Kj+JpC4uQLYoMrA=; b=TD64/mkQHldZ/GXwwqGVOowrLI
	IhkYo+rNE4RQvu4yHjMO/FWQufCe5wMrqTy5yBqvKMSECKM1vLhCzSqvpU/2SYc9BUAR3hmi2uQxT
	bBSdVyNn+uVQ2MfSlegzsjgXDGyVrw7suBpcAtgp7yG3wrqpk+bxQ2jGn841MGVXTwNQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREy-0006nd-0b
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPREx-0001Qo-W6
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] hvmloader: indicate ACPI tables with "ACPI data" type in e820
Message-Id: <E1kPREx-0001Qo-W6@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:23 +0000

commit 43eceee913cc76e533233568ca9390be3d080578
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Sep 22 17:37:42 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:37:42 2020 +0200

    hvmloader: indicate ACPI tables with "ACPI data" type in e820
    
    Guest kernel does need to know in some cases where the tables are located
    to treat these regions properly. One example is kexec process where
    the first kernel needs to pass ACPI region locations to the second
    kernel which is now a requirement in Linux after 02a3e3cdb7f12 ("x86/boot:
    Parse SRAT table and count immovable memory regions") in order for kexec
    transition to actually work.
    
    That commit introduced accesses to XSDT and SRAT while the second kernel
    is still using kexec transition tables. The transition tables do not have
    e820 "reserved" regions mapped where those tables are located currently
    in a Xen guest. Instead "ACPI data" regions are mapped with the transition
    tables that was introduced by the following commit 6bbeb276b7 ("x86/kexec:
    Add the EFI system tables and ACPI tables to the ident map").
    
    Reserve 1MB (out of 16MB currently available) right after ACPI info page for
    ACPI tables exclusively but populate this region on demand and only indicate
    populated memory as "ACPI data" since according to ACPI spec that memory is
    reclaimable by the guest if necessary. That is close to how we treat
    the same ACPI data in PVH guests. 1MB should be enough for now but could be
    later extended if required.
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 8efa46516c5f4cf185c8df179812c185d3c27eb6
    master date: 2020-09-09 17:56:13 +0200
---
 tools/firmware/hvmloader/config.h    |  6 +++++-
 tools/firmware/hvmloader/e820.c      | 26 ++++++++++++++++++++++----
 tools/firmware/hvmloader/hvmloader.c |  3 ++-
 tools/firmware/hvmloader/pci.c       |  1 -
 tools/firmware/hvmloader/util.c      | 29 ++++++++++++++++++++++++++++-
 tools/firmware/hvmloader/util.h      |  2 ++
 6 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index d9b4713d63..844120bc87 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -2,6 +2,7 @@
 #define __HVMLOADER_CONFIG_H__
 
 #include <stdint.h>
+#include <stdbool.h>
 
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
@@ -62,6 +63,8 @@ extern uint8_t ioapic_version;
 extern unsigned long pci_mem_start, pci_mem_end;
 extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 
+extern bool acpi_enabled;
+
 /* Memory map. */
 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
 #define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
@@ -71,7 +74,8 @@ extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 #define RESERVED_MEMBASE              0xFC000000
 /* NB. ACPI_INFO_PHYSICAL_ADDRESS *MUST* match definition in acpi/dsdt.asl! */
 #define ACPI_INFO_PHYSICAL_ADDRESS    0xFC000000
-#define RESERVED_MEMORY_DYNAMIC_START 0xFC001000
+#define ACPI_MEMORY_DYNAMIC_START     0xFC001000
+#define RESERVED_MEMORY_DYNAMIC_START 0xFC100000
 #define RESERVED_MEMORY_DYNAMIC_END   0xFE000000
 /*
  * GUEST_RESERVED: Physical address space reserved for guest use.
diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 4d1c955a02..38bcf18b63 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -155,6 +155,9 @@ int build_e820_table(struct e820entry *e820,
 {
     unsigned int nr = 0, i, j;
     uint32_t low_mem_end = hvm_info->low_mem_pgend << PAGE_SHIFT;
+    unsigned long acpi_mem_end = acpi_enabled ?
+        ACPI_MEMORY_DYNAMIC_START + (acpi_pages_allocated() << PAGE_SHIFT) :
+        RESERVED_MEMBASE;
 
     if ( !lowmem_reserved_base )
             lowmem_reserved_base = 0xA0000;
@@ -198,9 +201,24 @@ int build_e820_table(struct e820entry *e820,
     e820[nr].type = E820_RESERVED;
     nr++;
 
+    /*
+     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * That should help the guest to treat it correctly later: e.g. pass to
+     * the next kernel on kexec or reclaim if necessary.
+     */
+
+    if ( acpi_enabled )
+    {
+        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
+        e820[nr].type = E820_ACPI;
+        nr++;
+    }
+
     /*
      * Explicitly reserve space for special pages.
-     * This space starts at RESERVED_MEMBASE an extends to cover various
+     * This space starts right after ACPI region (to avoid creating a hole that
+     * might be accidentally occupied by MMIO) and extends to cover various
      * fixed hardware mappings (e.g., LAPIC, IOAPIC, default SVGA framebuffer).
      *
      * If igd_opregion_pgbase we need to split the RESERVED region in two.
@@ -210,8 +228,8 @@ int build_e820_table(struct e820entry *e820,
     {
         uint32_t igd_opregion_base = igd_opregion_pgbase << PAGE_SHIFT;
 
-        e820[nr].addr = RESERVED_MEMBASE;
-        e820[nr].size = (uint32_t) igd_opregion_base - RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
+        e820[nr].size = igd_opregion_base - acpi_mem_end;
         e820[nr].type = E820_RESERVED;
         nr++;
 
@@ -227,7 +245,7 @@ int build_e820_table(struct e820entry *e820,
     }
     else
     {
-        e820[nr].addr = RESERVED_MEMBASE;
+        e820[nr].addr = acpi_mem_end;
         e820[nr].size = (uint32_t)-e820[nr].addr;
         e820[nr].type = E820_RESERVED;
         nr++;
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index 598a226278..c58841e5b5 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -116,6 +116,8 @@ unsigned long scratch_start = SCRATCH_PHYSICAL_ADDRESS;
 uint32_t ioapic_base_address = 0xfec00000;
 uint8_t ioapic_version;
 
+bool acpi_enabled;
+
 static void init_hypercalls(void)
 {
     uint32_t eax, ebx, ecx, edx;
@@ -321,7 +323,6 @@ const struct hvm_modlist_entry *get_module_entry(
 int main(void)
 {
     const struct bios_config *bios;
-    int acpi_enabled;
     const struct hvm_modlist_entry *bios_module;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index dcd097a866..72f92d4450 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -28,7 +28,6 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
-#include <stdbool.h>
 
 unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START;
 unsigned long pci_mem_end = PCI_MEM_END;
diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 0c3f2d24cd..7da144b0bb 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -871,10 +871,37 @@ static unsigned long acpi_v2p(struct acpi_ctxt *ctxt, void *v)
     return virt_to_phys(v);
 }
 
+static unsigned long acpi_alloc_up = ACPI_MEMORY_DYNAMIC_START - 1;
+
+unsigned long acpi_pages_allocated(void)
+{
+    return (acpi_alloc_up >> PAGE_SHIFT) -
+            ((ACPI_MEMORY_DYNAMIC_START - 1) >> PAGE_SHIFT);
+}
+
 static void *acpi_mem_alloc(struct acpi_ctxt *ctxt,
                             uint32_t size, uint32_t align)
 {
-    return mem_alloc(size, align);
+    unsigned long s, e;
+
+    /* Align to at least 16 bytes. */
+    if ( align < 16 )
+        align = 16;
+
+    s = (acpi_alloc_up + align) & ~(align - 1);
+    e = s + size - 1;
+
+    BUG_ON((e < s) || (e >= RESERVED_MEMORY_DYNAMIC_START));
+
+    while ( (acpi_alloc_up >> PAGE_SHIFT) != (e >> PAGE_SHIFT) )
+    {
+        acpi_alloc_up += PAGE_SIZE;
+        mem_hole_populate_ram(acpi_alloc_up >> PAGE_SHIFT, 1);
+    }
+
+    acpi_alloc_up = e;
+
+    return (void *)s;
 }
 
 static void acpi_mem_free(struct acpi_ctxt *ctxt,
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 7bca6418d2..31889de634 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -282,6 +282,8 @@ bool check_overlap(uint64_t start, uint64_t size,
 extern const unsigned char dsdt_anycpu_qemu_xen[], dsdt_anycpu[], dsdt_15cpu[];
 extern const int dsdt_anycpu_qemu_xen_len, dsdt_anycpu_len, dsdt_15cpu_len;
 
+unsigned long acpi_pages_allocated(void);
+
 struct acpi_config;
 void hvmloader_acpi_build_tables(struct acpi_config *config,
                                  unsigned int physical);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3035.8756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFA-00020e-He; Mon, 05 Oct 2020 14:13:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3035.8756; Mon, 05 Oct 2020 14:13:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFA-00020X-Eb; Mon, 05 Oct 2020 14:13:36 +0000
Received: by outflank-mailman (input) for mailman id 3035;
 Mon, 05 Oct 2020 14:13:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRF9-00020K-1l
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ae16e9a6-2397-4f08-9f26-589c4c4167ba;
 Mon, 05 Oct 2020 14:13:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRF8-0006nl-4y
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRF8-0001Rh-2p
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRF9-00020K-1l
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:35 +0000
X-Inumbo-ID: ae16e9a6-2397-4f08-9f26-589c4c4167ba
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ae16e9a6-2397-4f08-9f26-589c4c4167ba;
	Mon, 05 Oct 2020 14:13:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2oR6nnntGSJSxCFpyJ/v6JFKas5ByKrvaDLSZNb26nc=; b=nqgNoBziEQ9liRXeCfSF0XY8lT
	IC1o5RKFvUqkgFrrzNursC4iYf+jVFqPdFgdZWm74E+7ynoQDYBICc0r6y4SkGUxH46ixhofODrb+
	E2zOsNAKUT7FEhijHkTPTDFeDKgq0oUac79NXLS7uVQuy+7TTTVp8C6Vslc/pb6D7/GE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRF8-0006nl-4y
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRF8-0001Rh-2p
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/hypfs: fix writing of custom parameter
Message-Id: <E1kPRF8-0001Rh-2p@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:34 +0000

commit 54789343ce51ef1595010b13e092863a50cb38ee
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Sep 22 17:38:06 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:38:06 2020 +0200

    xen/hypfs: fix writing of custom parameter
    
    Today the maximum allowed data length for writing a hypfs node is
    tested in the generic hypfs_write() function. For custom runtime
    parameters this might be wrong, as the maximum allowed size is derived
    from the buffer holding the current setting, while there might be ways
    to set the parameter needing more characters than the minimal
    representation of that value.
    
    One example for this is the "ept" parameter. Its value buffer is sized
    to be able to hold the string "exec-sp=0" or "exec-sp=1", while it is
    allowed to use e.g. "no-exec-sp" or "exec-sp=yes" for setting it.
    
    Fix that by moving the length check one level down to the type
    specific write function.
    
    In order to avoid allocation of arbitrary sized buffers use a new
    MAX_PARAM_SIZE macro as an upper limit for custom writes. The value
    of MAX_PARAM_SIZE is the same as the limit in parse_params() for a
    single parameter.
    
    Fixes: a659d7cab9af ("xen: add runtime parameter access support to hypfs")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: b4e41b1750d550bf2b1ccf97ee46f4f682bdbb62
    master date: 2020-09-11 14:20:10 +0200
---
 xen/common/hypfs.c      | 11 +++++++----
 xen/common/kernel.c     |  2 +-
 xen/include/xen/param.h |  3 +++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c
index b74c228191..8e932b5cf9 100644
--- a/xen/common/hypfs.c
+++ b/xen/common/hypfs.c
@@ -297,7 +297,9 @@ int hypfs_write_leaf(struct hypfs_entry_leaf *leaf,
     int ret;
 
     ASSERT(this_cpu(hypfs_locked) == hypfs_write_locked);
-    ASSERT(ulen <= leaf->e.max_size);
+
+    if ( ulen > leaf->e.max_size )
+        return -ENOSPC;
 
     if ( leaf->e.type != XEN_HYPFS_TYPE_STRING &&
          leaf->e.type != XEN_HYPFS_TYPE_BLOB && ulen != leaf->e.size )
@@ -356,6 +358,10 @@ int hypfs_write_custom(struct hypfs_entry_leaf *leaf,
 
     ASSERT(this_cpu(hypfs_locked) == hypfs_write_locked);
 
+    /* Avoid oversized buffer allocation. */
+    if ( ulen > MAX_PARAM_SIZE )
+        return -ENOSPC;
+
     buf = xzalloc_array(char, ulen);
     if ( !buf )
         return -ENOMEM;
@@ -386,9 +392,6 @@ static int hypfs_write(struct hypfs_entry *entry,
 
     ASSERT(entry->max_size);
 
-    if ( ulen > entry->max_size )
-        return -ENOSPC;
-
     l = container_of(entry, struct hypfs_entry_leaf, e);
 
     return entry->write(l, uaddr, ulen);
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 9de07b7ac5..c3a943f077 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -57,7 +57,7 @@ static int assign_integer_param(const struct kernel_param *param, uint64_t val)
 static int parse_params(const char *cmdline, const struct kernel_param *start,
                         const struct kernel_param *end)
 {
-    char opt[128], *optval, *optkey, *q;
+    char opt[MAX_PARAM_SIZE], *optval, *optkey, *q;
     const char *p = cmdline, *key;
     const struct kernel_param *param;
     int rc, final_rc = 0;
diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h
index c2fd075dd0..67ce6edf88 100644
--- a/xen/include/xen/param.h
+++ b/xen/include/xen/param.h
@@ -26,6 +26,9 @@ struct kernel_param {
     } par;
 };
 
+/* Maximum length of a single parameter string. */
+#define MAX_PARAM_SIZE 128
+
 extern const struct kernel_param __setup_start[], __setup_end[];
 
 #define __param(att)      static const att \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3036.8759 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFU-00022G-Jc; Mon, 05 Oct 2020 14:13:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3036.8759; Mon, 05 Oct 2020 14:13:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFU-000228-Ga; Mon, 05 Oct 2020 14:13:56 +0000
Received: by outflank-mailman (input) for mailman id 3036;
 Mon, 05 Oct 2020 14:13:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRFT-00021y-Cx
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c373d694-fe4e-41a4-a754-b9615ae00463;
 Mon, 05 Oct 2020 14:13:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRFS-0006o0-BJ
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRFS-0001U1-AV
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRFT-00021y-Cx
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:55 +0000
X-Inumbo-ID: c373d694-fe4e-41a4-a754-b9615ae00463
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c373d694-fe4e-41a4-a754-b9615ae00463;
	Mon, 05 Oct 2020 14:13:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U+//SSD6w8TIVvYGXlUBkpfSZ/ZQVtrusdPNC7AxjWk=; b=DsVpE8d0of4jwWF3Z7Vo9eUtWq
	NBIaj0Ywukv7GTTFY/kLNktBapWYEjt2Vi3T2ApB2a2JEPKvFbLeYkJdm4BVj90oc26OIEKPEGHDR
	MvdbgCCgnA/bpeVPHBONH6bY8sy9+sTSAkvslfumRsyBpyzZkY78Sl5dFVOlRK5HolqY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRFS-0006o0-BJ
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRFS-0001U1-AV
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kPRFS-0001U1-AV@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:54 +0000

commit c93b520a41f2787dd76bfb2e454836d1d5787505
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:34:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:34:00 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..12f666cb79 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -723,6 +723,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a80bcf3e42..b21c3783d3 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index a314bf85ce..5513f399d5 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -281,6 +281,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Mon Oct 05 14:13:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Oct 2020 14:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3037.8764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFU-00022V-O7; Mon, 05 Oct 2020 14:13:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3037.8764; Mon, 05 Oct 2020 14:13:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPRFU-00022J-Hm; Mon, 05 Oct 2020 14:13:56 +0000
Received: by outflank-mailman (input) for mailman id 3037;
 Mon, 05 Oct 2020 14:13:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPRFU-000223-0M
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 681023fa-4c3a-4cb4-bd79-c6d7104913ef;
 Mon, 05 Oct 2020 14:13:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRFI-0006nv-86
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPRFI-0001Sf-7U
 for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=m0c8=DM=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPRFU-000223-0M
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:56 +0000
X-Inumbo-ID: 681023fa-4c3a-4cb4-bd79-c6d7104913ef
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 681023fa-4c3a-4cb4-bd79-c6d7104913ef;
	Mon, 05 Oct 2020 14:13:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S7HUGEIGnniwCSnSKaJc98tqOJECtDF7ZehnFzOMbn4=; b=dtIOKBNxQuIgCtrPcph/PdnDjo
	Onrv8o+RPEBYZQczXW3f5w6cHTPJaxZvP9VR84jzAb8thHasjW/Ake/1UVvErdsQtAwxvJubepejv
	S4DbKDKrkInJDNOdmNgkpm6ziTjmpsXBPIPLvu+6vCKNSR97vp2ctjeJHfzGw07nVMAo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRFI-0006nv-86
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPRFI-0001Sf-7U
	for xen-changelog@lists.xenproject.org; Mon, 05 Oct 2020 14:13:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/HVM: more consistently set I/O completion
Message-Id: <E1kPRFI-0001Sf-7U@xenbits.xenproject.org>
Date: Mon, 05 Oct 2020 14:13:44 +0000

commit f37a1cf023b277d0d49323bf322ce3ff0c92262d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:39:05 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:39:05 2020 +0200

    x86/HVM: more consistently set I/O completion
    
    Doing this just in hvm_emulate_one_insn() is not enough.
    hvm_ud_intercept() and hvm_emulate_one_vm_event() can get invoked for
    insns requiring one or more continuations, and at least in principle
    hvm_emulate_one_mmio() could, too. Without proper setting of the field,
    handle_hvm_io_completion() will do nothing completion-wise, and in
    particular the missing re-invocation of the insn emulation paths will
    lead to emulation caching not getting disabled in due course, causing
    the ASSERT() in {svm,vmx}_vmenter_helper() to trigger.
    
    Reported-by: Don Slutz <don.slutz@gmail.com>
    
    Similar considerations go for the clearing of vio->mmio_access, which
    gets moved as well.
    
    Additionally all updating of vio->mmio_* now gets done dependent upon
    the new completion value, rather than hvm_ioreq_needs_completion()'s
    return value. This is because it is the completion chosen which controls
    what path will be taken when handling the completion, not the simple
    boolean return value. In particular, PIO completion doesn't involve
    going through the insn emulator, and hence emulator state ought to get
    cleared early (or it won't get cleared at all).
    
    The new logic, besides allowing for a caller override for the
    continuation type to be set (for VMX real mode emulation), will also
    avoid setting an MMIO completion when a simpler PIO one will do. This
    is a minor optimization only as a side effect - the behavior is strictly
    needed at least for hvm_ud_intercept(), as only memory accesses can
    successfully complete through handle_mmio(). Care of course needs to be
    taken to correctly deal with "mixed" insns (doing both MMIO and PIO at
    the same time, i.e. INS/OUTS). For this, hvmemul_validate() now latches
    whether the insn being emulated is a memory access, as this information
    is no longer easily available at the point where we want to consume it.
    
    Note that the presence of non-NULL .validate fields in the two ops
    structures in hvm_emulate_one_mmio() was really necessary even before
    the changes here: Without this, passing non-NULL as middle argument to
    hvm_emulate_init_once() is meaningless.
    
    The restrictions on when the #UD intercept gets actually enabled are why
    it was decided that this is not a security issue:
    - the "hvm_fep" option to enable its use is a debugging option only,
    - for the cross-vendor case is considered experimental, even if
      unfortunately SUPPORT.md doesn't have an explicit statement about
      this.
    The other two affected functions are
    - hvm_emulate_one_vm_event(), used for introspection,
    - hvm_emulate_one_mmio(), used for Dom0 only,
    which aren't qualifying this as needing an XSA either.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Don Slutz <don.slutz@gmail.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    master commit: b807cfe954b8d0d8852398b4c8a586d95d69a342
    master date: 2020-09-15 10:19:33 +0200
---
 xen/arch/x86/hvm/emulate.c        | 51 ++++++++++++++++++++++++++++++---------
 xen/arch/x86/hvm/hvm.c            |  2 +-
 xen/arch/x86/hvm/io.c             | 11 +--------
 xen/arch/x86/hvm/vmx/realmode.c   |  6 +----
 xen/include/asm-x86/hvm/emulate.h |  5 +++-
 5 files changed, 47 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 8b4e73ab06..24cf85fb4f 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1683,9 +1683,11 @@ static int hvmemul_validate(
     const struct x86_emulate_state *state,
     struct x86_emulate_ctxt *ctxt)
 {
-    const struct hvm_emulate_ctxt *hvmemul_ctxt =
+    struct hvm_emulate_ctxt *hvmemul_ctxt =
         container_of(ctxt, struct hvm_emulate_ctxt, ctxt);
 
+    hvmemul_ctxt->is_mem_access = x86_insn_is_mem_access(state, ctxt);
+
     return !hvmemul_ctxt->validate || hvmemul_ctxt->validate(state, ctxt)
            ? X86EMUL_OKAY : X86EMUL_UNHANDLEABLE;
 }
@@ -2610,8 +2612,14 @@ static const struct x86_emulate_ops hvm_emulate_ops_no_write = {
     .vmfunc        = hvmemul_vmfunc,
 };
 
+/*
+ * Note that passing HVMIO_no_completion into this function serves as kind
+ * of (but not fully) an "auto select completion" indicator.  When there's
+ * no completion needed, the passed in value will be ignored in any case.
+ */
 static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
-    const struct x86_emulate_ops *ops)
+    const struct x86_emulate_ops *ops,
+    enum hvm_io_completion completion)
 {
     const struct cpu_user_regs *regs = hvmemul_ctxt->ctxt.regs;
     struct vcpu *curr = current;
@@ -2642,16 +2650,31 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
         rc = X86EMUL_RETRY;
 
     if ( !hvm_ioreq_needs_completion(&vio->io_req) )
+        completion = HVMIO_no_completion;
+    else if ( completion == HVMIO_no_completion )
+        completion = (vio->io_req.type != IOREQ_TYPE_PIO ||
+                      hvmemul_ctxt->is_mem_access) ? HVMIO_mmio_completion
+                                                   : HVMIO_pio_completion;
+
+    switch ( vio->io_completion = completion )
     {
+    case HVMIO_no_completion:
+    case HVMIO_pio_completion:
         vio->mmio_cache_count = 0;
         vio->mmio_insn_bytes = 0;
+        vio->mmio_access = (struct npfec){};
         hvmemul_cache_disable(curr);
-    }
-    else
-    {
+        break;
+
+    case HVMIO_mmio_completion:
+    case HVMIO_realmode_completion:
         BUILD_BUG_ON(sizeof(vio->mmio_insn) < sizeof(hvmemul_ctxt->insn_buf));
         vio->mmio_insn_bytes = hvmemul_ctxt->insn_buf_bytes;
         memcpy(vio->mmio_insn, hvmemul_ctxt->insn_buf, vio->mmio_insn_bytes);
+        break;
+
+    default:
+        ASSERT_UNREACHABLE();
     }
 
     if ( hvmemul_ctxt->ctxt.retire.singlestep )
@@ -2692,9 +2715,10 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
 }
 
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt)
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion)
 {
-    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops);
+    return _hvm_emulate_one(hvmemul_ctxt, &hvm_emulate_ops, completion);
 }
 
 int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
@@ -2703,11 +2727,13 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmcfg_intercept_write,
+        .validate   = hvmemul_validate,
     };
     static const struct x86_emulate_ops hvm_ro_emulate_ops_mmio = {
         .read       = x86emul_unhandleable_rw,
         .insn_fetch = hvmemul_insn_fetch,
         .write      = mmio_ro_emulated_write,
+        .validate   = hvmemul_validate,
     };
     struct mmio_ro_emulate_ctxt mmio_ro_ctxt = { .cr2 = gla };
     struct hvm_emulate_ctxt ctxt;
@@ -2727,8 +2753,8 @@ int hvm_emulate_one_mmio(unsigned long mfn, unsigned long gla)
     hvm_emulate_init_once(&ctxt, x86_insn_is_mem_write,
                           guest_cpu_user_regs());
     ctxt.ctxt.data = &mmio_ro_ctxt;
-    rc = _hvm_emulate_one(&ctxt, ops);
-    switch ( rc )
+
+    switch ( rc = _hvm_emulate_one(&ctxt, ops, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
@@ -2755,7 +2781,8 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     switch ( kind )
     {
     case EMUL_KIND_NOWRITE:
-        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write);
+        rc = _hvm_emulate_one(&ctx, &hvm_emulate_ops_no_write,
+                              HVMIO_no_completion);
         break;
     case EMUL_KIND_SET_CONTEXT_INSN: {
         struct vcpu *curr = current;
@@ -2776,7 +2803,7 @@ void hvm_emulate_one_vm_event(enum emul_kind kind, unsigned int trapnr,
     /* Fall-through */
     default:
         ctx.set_context = (kind == EMUL_KIND_SET_CONTEXT_DATA);
-        rc = hvm_emulate_one(&ctx);
+        rc = hvm_emulate_one(&ctx, HVMIO_no_completion);
     }
 
     switch ( rc )
@@ -2874,6 +2901,8 @@ void hvm_emulate_init_per_insn(
                                         pfec, NULL) == HVMTRANS_okay) ?
             sizeof(hvmemul_ctxt->insn_buf) : 0;
     }
+
+    hvmemul_ctxt->is_mem_access = false;
 }
 
 void hvm_emulate_writeback(
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f965ca3155..3001e7442b 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3812,7 +3812,7 @@ void hvm_ud_intercept(struct cpu_user_regs *regs)
         return;
     }
 
-    switch ( hvm_emulate_one(&ctxt) )
+    switch ( hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
     case X86EMUL_UNIMPLEMENTED:
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 724ab44a76..3e09d9b726 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -81,20 +81,11 @@ void send_invalidate_req(void)
 bool hvm_emulate_one_insn(hvm_emulate_validate_t *validate, const char *descr)
 {
     struct hvm_emulate_ctxt ctxt;
-    struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     hvm_emulate_init_once(&ctxt, validate, guest_cpu_user_regs());
 
-    rc = hvm_emulate_one(&ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_mmio_completion;
-    else
-        vio->mmio_access = (struct npfec){};
-
-    switch ( rc )
+    switch ( rc = hvm_emulate_one(&ctxt, HVMIO_no_completion) )
     {
     case X86EMUL_UNHANDLEABLE:
         hvm_dump_emulation_state(XENLOG_G_WARNING, descr, &ctxt, rc);
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c
index bdbd9cb921..768f01eb04 100644
--- a/xen/arch/x86/hvm/vmx/realmode.c
+++ b/xen/arch/x86/hvm/vmx/realmode.c
@@ -97,15 +97,11 @@ static void realmode_deliver_exception(
 void vmx_realmode_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt)
 {
     struct vcpu *curr = current;
-    struct hvm_vcpu_io *vio = &curr->arch.hvm.hvm_io;
     int rc;
 
     perfc_incr(realmode_emulations);
 
-    rc = hvm_emulate_one(hvmemul_ctxt);
-
-    if ( hvm_ioreq_needs_completion(&vio->io_req) )
-        vio->io_completion = HVMIO_realmode_completion;
+    rc = hvm_emulate_one(hvmemul_ctxt, HVMIO_realmode_completion);
 
     if ( rc == X86EMUL_UNHANDLEABLE )
     {
diff --git a/xen/include/asm-x86/hvm/emulate.h b/xen/include/asm-x86/hvm/emulate.h
index f40290945c..1620cc7b7a 100644
--- a/xen/include/asm-x86/hvm/emulate.h
+++ b/xen/include/asm-x86/hvm/emulate.h
@@ -48,6 +48,8 @@ struct hvm_emulate_ctxt {
 
     uint32_t intr_shadow;
 
+    bool is_mem_access;
+
     bool_t set_context;
 };
 
@@ -62,7 +64,8 @@ bool __nonnull(1, 2) hvm_emulate_one_insn(
     hvm_emulate_validate_t *validate,
     const char *descr);
 int hvm_emulate_one(
-    struct hvm_emulate_ctxt *hvmemul_ctxt);
+    struct hvm_emulate_ctxt *hvmemul_ctxt,
+    enum hvm_io_completion completion);
 void hvm_emulate_one_vm_event(enum emul_kind kind,
     unsigned int trapnr,
     unsigned int errcode);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3152.9077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHK-0000OG-H1; Tue, 06 Oct 2020 10:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3152.9077; Tue, 06 Oct 2020 10:33:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHK-0000O7-Di; Tue, 06 Oct 2020 10:33:06 +0000
Received: by outflank-mailman (input) for mailman id 3152;
 Tue, 06 Oct 2020 10:33:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkHJ-0000O2-15
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4ec80ff0-ea1d-4be6-b058-a2a546b7ace9;
 Tue, 06 Oct 2020 10:33:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHH-0001GI-97
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHH-0007Ap-76
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkHJ-0000O2-15
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:05 +0000
X-Inumbo-ID: 4ec80ff0-ea1d-4be6-b058-a2a546b7ace9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4ec80ff0-ea1d-4be6-b058-a2a546b7ace9;
	Tue, 06 Oct 2020 10:33:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ekD7q7nD4B0/6U6LN+T/dvHPzDX2S+cZyj8uIRTHs3w=; b=gbSyqdMY4RK7uP2/3PhXJCviv8
	MkIlD5+fd+Ib/yOnMHK15VFaSfIxWH3kMitcJoX2R7Edxy58+3wfa/e/VrLyGsbP6q+A6V0UM8wPG
	tjAobSqkRMHm12hY9p9OGdPc39+CiEXjC8UXJsZZohFkioyMs8mtlWCkP0+/Ct6Z8oc8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHH-0001GI-97
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHH-0007Ap-76
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: use if_changed more consistently (and correctly) for prelink*.o
Message-Id: <E1kPkHH-0007Ap-76@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:03 +0000

commit dd2cfba88c3d0e144ffec07c6b5b86e54a9d98a9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 10:19:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 10:19:38 2020 +0200

    build: use if_changed more consistently (and correctly) for prelink*.o
    
    Switch to $(call if_changed,ld) where possible; presumably not doing so
    in e321576f4047 ("xen/build: start using if_changed") right away was an
    oversight, as it did for Arm in (just) one case. It failed to add
    prelink.o to $(targets), though, causing - judging from the observed
    behavior on x86 - undue rebuilds of the final binary (because of
    prelink.o getting rebuild for $(cmd_prelink.o) being empty, in turn
    because of .prelink.o.cmd not getting read) during "make install-xen".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/Makefile |  4 +++-
 xen/arch/x86/Makefile | 18 ++++++++++--------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 51173d9712..296c5e68bb 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -95,12 +95,14 @@ prelink_lto.o: $(ALL_OBJS)
 
 # Link it with all the binary objects
 prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o
-	$(LD) $(XEN_LDFLAGS) -r -o $@ $^
+	$(call if_changed,ld)
 else
 prelink.o: $(ALL_OBJS) FORCE
 	$(call if_changed,ld)
 endif
 
+targets += prelink.o
+
 $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 74152f2a0d..9b368632fb 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -136,19 +136,21 @@ prelink_lto.o: $(ALL_OBJS)
 	$(LD_LTO) -r -o $@ $^
 
 # Link it with all the binary objects
-prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(EFI_OBJS-y)
-	$(LD) $(XEN_LDFLAGS) -r -o $@ $^
+prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(EFI_OBJS-y) FORCE
+	$(call if_changed,ld)
 
-prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o
-	$(LD) $(XEN_LDFLAGS) -r -o $@ $^
+prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o FORCE
+	$(call if_changed,ld)
 else
-prelink.o: $(ALL_OBJS) $(EFI_OBJS-y)
-	$(LD) $(XEN_LDFLAGS) -r -o $@ $^
+prelink.o: $(ALL_OBJS) $(EFI_OBJS-y) FORCE
+	$(call if_changed,ld)
 
-prelink-efi.o: $(ALL_OBJS)
-	$(LD) $(XEN_LDFLAGS) -r -o $@ $^
+prelink-efi.o: $(ALL_OBJS) FORCE
+	$(call if_changed,ld)
 endif
 
+targets += prelink.o prelink-efi.o
+
 $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3153.9081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHV-0000Ov-Ia; Tue, 06 Oct 2020 10:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3153.9081; Tue, 06 Oct 2020 10:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHV-0000On-FS; Tue, 06 Oct 2020 10:33:17 +0000
Received: by outflank-mailman (input) for mailman id 3153;
 Tue, 06 Oct 2020 10:33:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkHT-0000Oe-FK
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 65856984-3a00-476d-b6f4-1056873c1d58;
 Tue, 06 Oct 2020 10:33:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHR-0001GL-EB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHR-0007BN-BY
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkHT-0000Oe-FK
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:15 +0000
X-Inumbo-ID: 65856984-3a00-476d-b6f4-1056873c1d58
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 65856984-3a00-476d-b6f4-1056873c1d58;
	Tue, 06 Oct 2020 10:33:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V93zLZlWvez2BRAfCv/ZARrJDTrItpAXDfGH5xQYbhg=; b=qu4S8oIEIyP/KaB553g+Xaag/r
	EUiImKMPxaUzyg4FgZbn5WmX2QD/sWYzL77R2Z/AYYCT77+rDtv3G/ahctthvMr63Y6epgzUN+qbZ
	ko/pA21M0u+nWaF2tv2F7QfdEORmwIqIAkGoQ6ddj2RHgECSkofpeU+Z04Pg5U7kc3yU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHR-0001GL-EB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHR-0007BN-BY
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/iommu: convert VT-d code to use new page table allocator
Message-Id: <E1kPkHR-0007BN-BY@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:13 +0000

commit 3eef6d07d722e90624fa692cdb9b76ebb2555cce
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 22 10:20:39 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 10:20:39 2020 +0200

    x86/iommu: convert VT-d code to use new page table allocator
    
    This patch converts the VT-d code to use the new IOMMU page table allocator
    function. This allows all the free-ing code to be removed (since it is now
    handled by the general x86 code) which reduces TLB and cache thrashing as well
    as shortening the code.
    
    The scope of the mapping_lock in intel_iommu_quarantine_init() has also been
    increased slightly; it should have always covered accesses to
    'arch.vtd.pgd_maddr'.
    
    NOTE: The common IOMMU needs a slight modification to avoid scheduling the
          cleanup tasklet if the free_page_table() method is not present (since
          the tasklet will unconditionally call it).
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/iommu.c     |   6 ++-
 xen/drivers/passthrough/vtd/iommu.c | 101 +++++++++++++-----------------------
 2 files changed, 39 insertions(+), 68 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 1d644844ab..2b1db8022c 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -225,8 +225,10 @@ static void iommu_teardown(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
 
-    hd->platform_ops->teardown(d);
-    tasklet_schedule(&iommu_pt_cleanup_tasklet);
+    iommu_vcall(hd->platform_ops, teardown, d);
+
+    if ( hd->platform_ops->free_page_table )
+        tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
 
 void iommu_domain_destroy(struct domain *d)
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 94e0455a4d..607e8b5e65 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -265,10 +265,15 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
 
     addr &= (((u64)1) << addr_width) - 1;
     ASSERT(spin_is_locked(&hd->arch.mapping_lock));
-    if ( !hd->arch.vtd.pgd_maddr &&
-         (!alloc ||
-          ((hd->arch.vtd.pgd_maddr = alloc_pgtable_maddr(1, hd->node)) == 0)) )
-        goto out;
+    if ( !hd->arch.vtd.pgd_maddr )
+    {
+        struct page_info *pg;
+
+        if ( !alloc || !(pg = iommu_alloc_pgtable(domain)) )
+            goto out;
+
+        hd->arch.vtd.pgd_maddr = page_to_maddr(pg);
+    }
 
     parent = (struct dma_pte *)map_vtd_domain_page(hd->arch.vtd.pgd_maddr);
     while ( level > 1 )
@@ -279,13 +284,16 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc)
         pte_maddr = dma_pte_addr(*pte);
         if ( !pte_maddr )
         {
+            struct page_info *pg;
+
             if ( !alloc )
                 break;
 
-            pte_maddr = alloc_pgtable_maddr(1, hd->node);
-            if ( !pte_maddr )
+            pg = iommu_alloc_pgtable(domain);
+            if ( !pg )
                 break;
 
+            pte_maddr = page_to_maddr(pg);
             dma_set_pte_addr(*pte, pte_maddr);
 
             /*
@@ -675,45 +683,6 @@ static void dma_pte_clear_one(struct domain *domain, uint64_t addr,
     unmap_vtd_domain_page(page);
 }
 
-static void iommu_free_pagetable(u64 pt_maddr, int level)
-{
-    struct page_info *pg = maddr_to_page(pt_maddr);
-
-    if ( pt_maddr == 0 )
-        return;
-
-    PFN_ORDER(pg) = level;
-    spin_lock(&iommu_pt_cleanup_lock);
-    page_list_add_tail(pg, &iommu_pt_cleanup_list);
-    spin_unlock(&iommu_pt_cleanup_lock);
-}
-
-static void iommu_free_page_table(struct page_info *pg)
-{
-    unsigned int i, next_level = PFN_ORDER(pg) - 1;
-    u64 pt_maddr = page_to_maddr(pg);
-    struct dma_pte *pt_vaddr, *pte;
-
-    PFN_ORDER(pg) = 0;
-    pt_vaddr = (struct dma_pte *)map_vtd_domain_page(pt_maddr);
-
-    for ( i = 0; i < PTE_NUM; i++ )
-    {
-        pte = &pt_vaddr[i];
-        if ( !dma_pte_present(*pte) )
-            continue;
-
-        if ( next_level >= 1 )
-            iommu_free_pagetable(dma_pte_addr(*pte), next_level);
-
-        dma_clear_pte(*pte);
-        iommu_sync_cache(pte, sizeof(struct dma_pte));
-    }
-
-    unmap_vtd_domain_page(pt_vaddr);
-    free_pgtable_maddr(pt_maddr);
-}
-
 static int iommu_set_root_entry(struct vtd_iommu *iommu)
 {
     u32 sts;
@@ -1748,16 +1717,7 @@ static void iommu_domain_teardown(struct domain *d)
         xfree(mrmrr);
     }
 
-    ASSERT(is_iommu_enabled(d));
-
-    if ( iommu_use_hap_pt(d) )
-        return;
-
-    spin_lock(&hd->arch.mapping_lock);
-    iommu_free_pagetable(hd->arch.vtd.pgd_maddr,
-                         agaw_to_level(hd->arch.vtd.agaw));
     hd->arch.vtd.pgd_maddr = 0;
-    spin_unlock(&hd->arch.mapping_lock);
 }
 
 static int __must_check intel_iommu_map_page(struct domain *d, dfn_t dfn,
@@ -2669,23 +2629,28 @@ static void vtd_dump_p2m_table(struct domain *d)
 static int __init intel_iommu_quarantine_init(struct domain *d)
 {
     struct domain_iommu *hd = dom_iommu(d);
+    struct page_info *pg;
     struct dma_pte *parent;
     unsigned int agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
     unsigned int level = agaw_to_level(agaw);
-    int rc;
+    int rc = 0;
+
+    spin_lock(&hd->arch.mapping_lock);
 
     if ( hd->arch.vtd.pgd_maddr )
     {
         ASSERT_UNREACHABLE();
-        return 0;
+        goto out;
     }
 
-    spin_lock(&hd->arch.mapping_lock);
+    pg = iommu_alloc_pgtable(d);
 
-    hd->arch.vtd.pgd_maddr = alloc_pgtable_maddr(1, hd->node);
-    if ( !hd->arch.vtd.pgd_maddr )
+    rc = -ENOMEM;
+    if ( !pg )
         goto out;
 
+    hd->arch.vtd.pgd_maddr = page_to_maddr(pg);
+
     parent = map_vtd_domain_page(hd->arch.vtd.pgd_maddr);
     while ( level )
     {
@@ -2697,10 +2662,12 @@ static int __init intel_iommu_quarantine_init(struct domain *d)
          * page table pages, and the resulting allocations are always
          * zeroed.
          */
-        maddr = alloc_pgtable_maddr(1, hd->node);
-        if ( !maddr )
-            break;
+        pg = iommu_alloc_pgtable(d);
+
+        if ( !pg )
+            goto out;
 
+        maddr = page_to_maddr(pg);
         for ( offset = 0; offset < PTE_NUM; offset++ )
         {
             struct dma_pte *pte = &parent[offset];
@@ -2716,13 +2683,16 @@ static int __init intel_iommu_quarantine_init(struct domain *d)
     }
     unmap_vtd_domain_page(parent);
 
+    rc = 0;
+
  out:
     spin_unlock(&hd->arch.mapping_lock);
 
-    rc = iommu_flush_iotlb_all(d);
+    if ( !rc )
+        rc = iommu_flush_iotlb_all(d);
 
-    /* Pages leaked in failure case */
-    return level ? -ENOMEM : rc;
+    /* Pages may be leaked in failure case */
+    return rc;
 }
 
 static struct iommu_ops __initdata vtd_ops = {
@@ -2737,7 +2707,6 @@ static struct iommu_ops __initdata vtd_ops = {
     .map_page = intel_iommu_map_page,
     .unmap_page = intel_iommu_unmap_page,
     .lookup_page = intel_iommu_lookup_page,
-    .free_page_table = iommu_free_page_table,
     .reassign_device = reassign_device_ownership,
     .get_device_group_id = intel_iommu_group_id,
     .enable_x2apic = intel_iommu_enable_eim,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3154.9084 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHe-0000QA-KO; Tue, 06 Oct 2020 10:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3154.9084; Tue, 06 Oct 2020 10:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHe-0000Q2-Gz; Tue, 06 Oct 2020 10:33:26 +0000
Received: by outflank-mailman (input) for mailman id 3154;
 Tue, 06 Oct 2020 10:33:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkHd-0000Ps-7H
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5d538845-0912-4f17-b9ad-d16d0ede61d5;
 Tue, 06 Oct 2020 10:33:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHb-0001GR-HQ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHb-0007Bv-Gb
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkHd-0000Ps-7H
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:25 +0000
X-Inumbo-ID: 5d538845-0912-4f17-b9ad-d16d0ede61d5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5d538845-0912-4f17-b9ad-d16d0ede61d5;
	Tue, 06 Oct 2020 10:33:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=axnSyNfnSyFA/YbC34WwR0nfKgEBFTKEz0nU2HZu254=; b=NpjdFypLYMwiBREfmb/NAR/Y9Y
	L0coqRyoJ6WsnKT8ONurKddKb7/0jNmtoIqs3EIcxUMSDMXncJO+1cxyL6XMTrHzLD/qVvRAKjlc1
	Ywbu6xMgDAjvz/XGJQvT5evCbL8/ezHTyxHLDAKoLsO6P0ZHPCjlGYeyoWFoEiqbaOcI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHb-0001GR-HQ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHb-0007Bv-Gb
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu: remove unused iommu_ops method and tasklet
Message-Id: <E1kPkHb-0007Bv-Gb@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:23 +0000

commit b5622eb62793a826098fa0bd31787fad43ad99cc
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 22 10:21:13 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 10:21:13 2020 +0200

    iommu: remove unused iommu_ops method and tasklet
    
    The VT-d and AMD IOMMU implementations both use the general x86 IOMMU page
    table allocator and ARM always shares page tables with CPU. Hence there is no
    need to retain the free_page_table() method or the tasklet which invokes it.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c | 25 -------------------------
 xen/include/xen/iommu.h         |  2 --
 2 files changed, 27 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 2b1db8022c..660dc5deb2 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -49,10 +49,6 @@ bool_t __read_mostly amd_iommu_perdev_intremap = 1;
 
 DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb);
 
-DEFINE_SPINLOCK(iommu_pt_cleanup_lock);
-PAGE_LIST_HEAD(iommu_pt_cleanup_list);
-static struct tasklet iommu_pt_cleanup_tasklet;
-
 static int __init parse_iommu_param(const char *s)
 {
     const char *ss;
@@ -226,9 +222,6 @@ static void iommu_teardown(struct domain *d)
     struct domain_iommu *hd = dom_iommu(d);
 
     iommu_vcall(hd->platform_ops, teardown, d);
-
-    if ( hd->platform_ops->free_page_table )
-        tasklet_schedule(&iommu_pt_cleanup_tasklet);
 }
 
 void iommu_domain_destroy(struct domain *d)
@@ -368,23 +361,6 @@ int iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn,
     return iommu_call(hd->platform_ops, lookup_page, d, dfn, mfn, flags);
 }
 
-static void iommu_free_pagetables(void *unused)
-{
-    do {
-        struct page_info *pg;
-
-        spin_lock(&iommu_pt_cleanup_lock);
-        pg = page_list_remove_head(&iommu_pt_cleanup_list);
-        spin_unlock(&iommu_pt_cleanup_lock);
-        if ( !pg )
-            return;
-        iommu_vcall(iommu_get_ops(), free_page_table, pg);
-    } while ( !softirq_pending(smp_processor_id()) );
-
-    tasklet_schedule_on_cpu(&iommu_pt_cleanup_tasklet,
-                            cpumask_cycle(smp_processor_id(), &cpu_online_map));
-}
-
 int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned int page_count,
                       unsigned int flush_flags)
 {
@@ -508,7 +484,6 @@ int __init iommu_setup(void)
 #ifndef iommu_intremap
         printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis");
 #endif
-        tasklet_init(&iommu_pt_cleanup_tasklet, iommu_free_pagetables, NULL);
     }
 
     return rc;
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 3272874958..1831dc66b0 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -263,8 +263,6 @@ struct iommu_ops {
     int __must_check (*lookup_page)(struct domain *d, dfn_t dfn, mfn_t *mfn,
                                     unsigned int *flags);
 
-    void (*free_page_table)(struct page_info *);
-
 #ifdef CONFIG_X86
     int (*enable_x2apic)(void);
     void (*disable_x2apic)(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3155.9089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHn-0000Rw-Np; Tue, 06 Oct 2020 10:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3155.9089; Tue, 06 Oct 2020 10:33:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHn-0000Rn-Kl; Tue, 06 Oct 2020 10:33:35 +0000
Received: by outflank-mailman (input) for mailman id 3155;
 Tue, 06 Oct 2020 10:33:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkHm-0000Re-JB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e70f2699-f103-4d42-9e70-6ae8f75cd82b;
 Tue, 06 Oct 2020 10:33:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHl-0001Gb-NY
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHl-0007CR-Ji
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkHm-0000Re-JB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:34 +0000
X-Inumbo-ID: e70f2699-f103-4d42-9e70-6ae8f75cd82b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e70f2699-f103-4d42-9e70-6ae8f75cd82b;
	Tue, 06 Oct 2020 10:33:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vGvwDrV9TjpY3qd7yoJKfKGN8vbchBwMt8il5mssVd8=; b=tM5dDx1xmQhMOdPSKjcYagIIXY
	JOuIDmFPKG4IJ03QocfISAliY5llM1qXEq01PpWjo1rlwQYrH7BU9lk3Sc9LDkheqQGF2tvHjs2Gb
	xsnFVrgWRtEv46W0hC21zBHu5JoRhk3sbUpWzMeq/ucZDSME/h7Oe5odl7MZ9vrDZVB8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHl-0001Gb-NY
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHl-0007CR-Ji
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu: flush I/O TLB if iommu_map() or iommu_unmap() fail
Message-Id: <E1kPkHl-0007CR-Ji@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:33 +0000

commit 0229adb138d732f579e80c96a032b19e692d6796
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 22 10:21:55 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 10:21:55 2020 +0200

    iommu: flush I/O TLB if iommu_map() or iommu_unmap() fail
    
    This patch adds a full I/O TLB flush to the error paths of iommu_map() and
    iommu_unmap().
    
    Without this change callers need constructs such as:
    
    rc = iommu_map/unmap(...)
    err = iommu_flush(...)
    if ( !rc )
      rc = err;
    
    With this change, it can be simplified to:
    
    rc = iommu_map/unmap(...)
    if ( !rc )
      rc = iommu_flush(...)
    
    because, if the map or unmap fails the flush will be unnecessary. This saves
    a stack variable and generally makes the call sites tidier.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/iommu.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 660dc5deb2..eb65631d59 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -274,6 +274,13 @@ int iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
         break;
     }
 
+    /*
+     * Something went wrong so, if we were dealing with more than a single
+     * page, flush everything and clear flush flags.
+     */
+    if ( page_order && unlikely(rc) && !iommu_iotlb_flush_all(d, *flush_flags) )
+        *flush_flags = 0;
+
     return rc;
 }
 
@@ -283,14 +290,8 @@ int iommu_legacy_map(struct domain *d, dfn_t dfn, mfn_t mfn,
     unsigned int flush_flags = 0;
     int rc = iommu_map(d, dfn, mfn, page_order, flags, &flush_flags);
 
-    if ( !this_cpu(iommu_dont_flush_iotlb) )
-    {
-        int err = iommu_iotlb_flush(d, dfn, (1u << page_order),
-                                    flush_flags);
-
-        if ( !rc )
-            rc = err;
-    }
+    if ( !this_cpu(iommu_dont_flush_iotlb) && !rc )
+        rc = iommu_iotlb_flush(d, dfn, (1u << page_order), flush_flags);
 
     return rc;
 }
@@ -330,6 +331,13 @@ int iommu_unmap(struct domain *d, dfn_t dfn, unsigned int page_order,
         }
     }
 
+    /*
+     * Something went wrong so, if we were dealing with more than a single
+     * page, flush everything and clear flush flags.
+     */
+    if ( page_order && unlikely(rc) && !iommu_iotlb_flush_all(d, *flush_flags) )
+        *flush_flags = 0;
+
     return rc;
 }
 
@@ -338,14 +346,8 @@ int iommu_legacy_unmap(struct domain *d, dfn_t dfn, unsigned int page_order)
     unsigned int flush_flags = 0;
     int rc = iommu_unmap(d, dfn, page_order, &flush_flags);
 
-    if ( !this_cpu(iommu_dont_flush_iotlb) )
-    {
-        int err = iommu_iotlb_flush(d, dfn, (1u << page_order),
-                                    flush_flags);
-
-        if ( !rc )
-            rc = err;
-    }
+    if ( !this_cpu(iommu_dont_flush_iotlb) && !rc )
+        rc = iommu_iotlb_flush(d, dfn, (1u << page_order), flush_flags);
 
     return rc;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3156.9093 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHy-0000Ta-Pf; Tue, 06 Oct 2020 10:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3156.9093; Tue, 06 Oct 2020 10:33:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkHy-0000TR-MT; Tue, 06 Oct 2020 10:33:46 +0000
Received: by outflank-mailman (input) for mailman id 3156;
 Tue, 06 Oct 2020 10:33:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkHy-0000TL-8q
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f54517c0-e8e4-4582-9bb7-65c7997166f4;
 Tue, 06 Oct 2020 10:33:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHw-0001HR-H7
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkHv-0007Cw-Qi
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkHy-0000TL-8q
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:46 +0000
X-Inumbo-ID: f54517c0-e8e4-4582-9bb7-65c7997166f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f54517c0-e8e4-4582-9bb7-65c7997166f4;
	Tue, 06 Oct 2020 10:33:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5qTq4MvvfLvExuEAsDbjy7yHqrdgX3ooiYi2BOCLPYE=; b=FVIfySZOq3HOQHlbYJYy28t9mS
	Dp/CAE+six3Eov9R9Py4S1C3ErUYoYJktzzJtjtyjTEJu3ucrQoc3A8hlDjBstzUDMVACwoaoLNOq
	RofwQTI+hsY0SVw3knEs4nSf93a7CKdICEAQ2P1FCZgIlCKSlH1kFxlfriWJopVif+ak=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHw-0001HR-H7
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkHv-0007Cw-Qi
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu: make map and unmap take a page count, similar to flush
Message-Id: <E1kPkHv-0007Cw-Qi@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:43 +0000

commit 68a8aa5d7264dcb04b2c56fad24bdd5192fe5394
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 22 10:22:30 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 10:22:30 2020 +0200

    iommu: make map and unmap take a page count, similar to flush
    
    At the moment iommu_map() and iommu_unmap() take a page order rather than a
    count, whereas iommu_iotlb_flush() takes a page count rather than an order.
    This patch makes them consistent with each other, opting for a page count since
    CPU page orders are not necessarily the same as those of an IOMMU.
    
    NOTE: The 'page_count' parameter is also made an unsigned long in all the
          aforementioned functions.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <julien@xen.org>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/mm.c                        |  8 +++++---
 xen/arch/x86/mm/p2m-ept.c                |  6 +++---
 xen/arch/x86/mm/p2m-pt.c                 |  4 ++--
 xen/arch/x86/mm/p2m.c                    |  5 +++--
 xen/arch/x86/x86_64/mm.c                 |  4 ++--
 xen/common/grant_table.c                 |  6 +++---
 xen/drivers/passthrough/amd/iommu.h      |  2 +-
 xen/drivers/passthrough/amd/iommu_map.c  |  4 ++--
 xen/drivers/passthrough/arm/ipmmu-vmsa.c |  2 +-
 xen/drivers/passthrough/arm/smmu.c       |  2 +-
 xen/drivers/passthrough/iommu.c          | 35 +++++++++++++++-----------------
 xen/drivers/passthrough/vtd/iommu.c      |  4 ++--
 xen/drivers/passthrough/x86/iommu.c      |  2 +-
 xen/include/xen/iommu.h                  | 12 +++++------
 14 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2c13a2d8e7..d1cfc8fb4a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2441,7 +2441,7 @@ static int cleanup_page_mappings(struct page_info *page)
 
         if ( d && unlikely(need_iommu_pt_sync(d)) && is_pv_domain(d) )
         {
-            int rc2 = iommu_legacy_unmap(d, _dfn(mfn), PAGE_ORDER_4K);
+            int rc2 = iommu_legacy_unmap(d, _dfn(mfn), 1u << PAGE_ORDER_4K);
 
             if ( !rc )
                 rc = rc2;
@@ -2968,9 +2968,11 @@ static int _get_page_type(struct page_info *page, unsigned long type,
             mfn_t mfn = page_to_mfn(page);
 
             if ( (x & PGT_type_mask) == PGT_writable_page )
-                rc = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)), PAGE_ORDER_4K);
+                rc = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)),
+                                        1ul << PAGE_ORDER_4K);
             else
-                rc = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn, PAGE_ORDER_4K,
+                rc = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn,
+                                      1ul << PAGE_ORDER_4K,
                                       IOMMUF_readable | IOMMUF_writable);
 
             if ( unlikely(rc) )
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index b8154a7ecc..12cf38f6eb 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -843,14 +843,14 @@ out:
          need_modify_vtd_table )
     {
         if ( iommu_use_hap_pt(d) )
-            rc = iommu_iotlb_flush(d, _dfn(gfn), (1u << order),
+            rc = iommu_iotlb_flush(d, _dfn(gfn), 1ul << order,
                                    (iommu_flags ? IOMMU_FLUSHF_added : 0) |
                                    (vtd_pte_present ? IOMMU_FLUSHF_modified
                                                     : 0));
         else if ( need_iommu_pt_sync(d) )
             rc = iommu_flags ?
-                iommu_legacy_map(d, _dfn(gfn), mfn, order, iommu_flags) :
-                iommu_legacy_unmap(d, _dfn(gfn), order);
+                iommu_legacy_map(d, _dfn(gfn), mfn, 1ul << order, iommu_flags) :
+                iommu_legacy_unmap(d, _dfn(gfn), 1ul << order);
     }
 
     unmap_domain_page(table);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index badb26bc34..3af51be78e 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -679,9 +679,9 @@ p2m_pt_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
     if ( need_iommu_pt_sync(p2m->domain) &&
          (iommu_old_flags != iommu_pte_flags || old_mfn != mfn_x(mfn)) )
         rc = iommu_pte_flags
-             ? iommu_legacy_map(d, _dfn(gfn), mfn, page_order,
+             ? iommu_legacy_map(d, _dfn(gfn), mfn, 1ul << page_order,
                                 iommu_pte_flags)
-             : iommu_legacy_unmap(d, _dfn(gfn), page_order);
+             : iommu_legacy_unmap(d, _dfn(gfn), 1ul << page_order);
 
     /*
      * Free old intermediate tables if necessary.  This has to be the
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index db7bde0230..928344be30 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1352,7 +1352,8 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn_l,
     {
         if ( !is_iommu_enabled(d) )
             return 0;
-        return iommu_legacy_map(d, _dfn(gfn_l), _mfn(gfn_l), PAGE_ORDER_4K,
+        return iommu_legacy_map(d, _dfn(gfn_l), _mfn(gfn_l),
+                                1ul << PAGE_ORDER_4K,
                                 IOMMUF_readable | IOMMUF_writable);
     }
 
@@ -1443,7 +1444,7 @@ int clear_identity_p2m_entry(struct domain *d, unsigned long gfn_l)
     {
         if ( !is_iommu_enabled(d) )
             return 0;
-        return iommu_legacy_unmap(d, _dfn(gfn_l), PAGE_ORDER_4K);
+        return iommu_legacy_unmap(d, _dfn(gfn_l), 1ul << PAGE_ORDER_4K);
     }
 
     gfn_lock(p2m, gfn, 0);
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 0d1aadbfce..bce1561e1a 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -1286,7 +1286,7 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
     {
         for ( i = spfn; i < epfn; i++ )
             if ( iommu_legacy_map(hardware_domain, _dfn(i), _mfn(i),
-                                  PAGE_ORDER_4K,
+                                  1ul << PAGE_ORDER_4K,
                                   IOMMUF_readable | IOMMUF_writable) )
                 break;
         if ( i != epfn )
@@ -1294,7 +1294,7 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
             while (i-- > old_max)
                 /* If statement to satisfy __must_check. */
                 if ( iommu_legacy_unmap(hardware_domain, _dfn(i),
-                                        PAGE_ORDER_4K) )
+                                        1ul << PAGE_ORDER_4K) )
                     continue;
 
             goto destroy_m2p;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 9f0cae52c0..a5d3ed8bda 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1225,7 +1225,7 @@ map_grant_ref(
             kind = IOMMUF_readable;
         else
             kind = 0;
-        if ( kind && iommu_legacy_map(ld, _dfn(mfn_x(mfn)), mfn, 0, kind) )
+        if ( kind && iommu_legacy_map(ld, _dfn(mfn_x(mfn)), mfn, 1, kind) )
         {
             double_gt_unlock(lgt, rgt);
             rc = GNTST_general_error;
@@ -1479,9 +1479,9 @@ unmap_common(
 
         kind = mapkind(lgt, rd, op->mfn);
         if ( !kind )
-            err = iommu_legacy_unmap(ld, _dfn(mfn_x(op->mfn)), 0);
+            err = iommu_legacy_unmap(ld, _dfn(mfn_x(op->mfn)), 1);
         else if ( !(kind & MAPKIND_WRITE) )
-            err = iommu_legacy_map(ld, _dfn(mfn_x(op->mfn)), op->mfn, 0,
+            err = iommu_legacy_map(ld, _dfn(mfn_x(op->mfn)), op->mfn, 1,
                                    IOMMUF_readable);
 
         double_gt_unlock(lgt, rgt);
diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index e2d174f3b4..f1f0415469 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -231,7 +231,7 @@ int amd_iommu_reserve_domain_unity_map(struct domain *domain,
                                        paddr_t phys_addr, unsigned long size,
                                        int iw, int ir);
 int __must_check amd_iommu_flush_iotlb_pages(struct domain *d, dfn_t dfn,
-                                             unsigned int page_count,
+                                             unsigned long page_count,
                                              unsigned int flush_flags);
 int __must_check amd_iommu_flush_iotlb_all(struct domain *d);
 
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 54b991294a..0cb948d114 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -351,7 +351,7 @@ int amd_iommu_unmap_page(struct domain *d, dfn_t dfn,
     return 0;
 }
 
-static unsigned long flush_count(unsigned long dfn, unsigned int page_count,
+static unsigned long flush_count(unsigned long dfn, unsigned long page_count,
                                  unsigned int order)
 {
     unsigned long start = dfn >> order;
@@ -362,7 +362,7 @@ static unsigned long flush_count(unsigned long dfn, unsigned int page_count,
 }
 
 int amd_iommu_flush_iotlb_pages(struct domain *d, dfn_t dfn,
-                                unsigned int page_count,
+                                unsigned long page_count,
                                 unsigned int flush_flags)
 {
     unsigned long dfn_l = dfn_x(dfn);
diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
index b2a65dfaaf..346165c3fa 100644
--- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c
+++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c
@@ -945,7 +945,7 @@ static int __must_check ipmmu_iotlb_flush_all(struct domain *d)
 }
 
 static int __must_check ipmmu_iotlb_flush(struct domain *d, dfn_t dfn,
-                                          unsigned int page_count,
+                                          unsigned long page_count,
                                           unsigned int flush_flags)
 {
     ASSERT(flush_flags);
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 94662a8501..06f9bda47d 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -2534,7 +2534,7 @@ static int __must_check arm_smmu_iotlb_flush_all(struct domain *d)
 }
 
 static int __must_check arm_smmu_iotlb_flush(struct domain *d, dfn_t dfn,
-					     unsigned int page_count,
+					     unsigned long page_count,
 					     unsigned int flush_flags)
 {
 	ASSERT(flush_flags);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index eb65631d59..87f9a857bb 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -235,7 +235,7 @@ void iommu_domain_destroy(struct domain *d)
 }
 
 int iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
-              unsigned int page_order, unsigned int flags,
+              unsigned long page_count, unsigned int flags,
               unsigned int *flush_flags)
 {
     const struct domain_iommu *hd = dom_iommu(d);
@@ -245,10 +245,7 @@ int iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
     if ( !is_iommu_enabled(d) )
         return 0;
 
-    ASSERT(IS_ALIGNED(dfn_x(dfn), (1ul << page_order)));
-    ASSERT(IS_ALIGNED(mfn_x(mfn), (1ul << page_order)));
-
-    for ( i = 0; i < (1ul << page_order); i++ )
+    for ( i = 0; i < page_count; i++ )
     {
         rc = iommu_call(hd->platform_ops, map_page, d, dfn_add(dfn, i),
                         mfn_add(mfn, i), flags, flush_flags);
@@ -278,25 +275,26 @@ int iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
      * Something went wrong so, if we were dealing with more than a single
      * page, flush everything and clear flush flags.
      */
-    if ( page_order && unlikely(rc) && !iommu_iotlb_flush_all(d, *flush_flags) )
+    if ( page_count > 1 && unlikely(rc) &&
+         !iommu_iotlb_flush_all(d, *flush_flags) )
         *flush_flags = 0;
 
     return rc;
 }
 
 int iommu_legacy_map(struct domain *d, dfn_t dfn, mfn_t mfn,
-                     unsigned int page_order, unsigned int flags)
+                     unsigned long page_count, unsigned int flags)
 {
     unsigned int flush_flags = 0;
-    int rc = iommu_map(d, dfn, mfn, page_order, flags, &flush_flags);
+    int rc = iommu_map(d, dfn, mfn, page_count, flags, &flush_flags);
 
     if ( !this_cpu(iommu_dont_flush_iotlb) && !rc )
-        rc = iommu_iotlb_flush(d, dfn, (1u << page_order), flush_flags);
+        rc = iommu_iotlb_flush(d, dfn, page_count, flush_flags);
 
     return rc;
 }
 
-int iommu_unmap(struct domain *d, dfn_t dfn, unsigned int page_order,
+int iommu_unmap(struct domain *d, dfn_t dfn, unsigned long page_count,
                 unsigned int *flush_flags)
 {
     const struct domain_iommu *hd = dom_iommu(d);
@@ -306,9 +304,7 @@ int iommu_unmap(struct domain *d, dfn_t dfn, unsigned int page_order,
     if ( !is_iommu_enabled(d) )
         return 0;
 
-    ASSERT(IS_ALIGNED(dfn_x(dfn), (1ul << page_order)));
-
-    for ( i = 0; i < (1ul << page_order); i++ )
+    for ( i = 0; i < page_count; i++ )
     {
         int err = iommu_call(hd->platform_ops, unmap_page, d, dfn_add(dfn, i),
                              flush_flags);
@@ -335,19 +331,20 @@ int iommu_unmap(struct domain *d, dfn_t dfn, unsigned int page_order,
      * Something went wrong so, if we were dealing with more than a single
      * page, flush everything and clear flush flags.
      */
-    if ( page_order && unlikely(rc) && !iommu_iotlb_flush_all(d, *flush_flags) )
+    if ( page_count > 1 && unlikely(rc) &&
+         !iommu_iotlb_flush_all(d, *flush_flags) )
         *flush_flags = 0;
 
     return rc;
 }
 
-int iommu_legacy_unmap(struct domain *d, dfn_t dfn, unsigned int page_order)
+int iommu_legacy_unmap(struct domain *d, dfn_t dfn, unsigned long page_count)
 {
     unsigned int flush_flags = 0;
-    int rc = iommu_unmap(d, dfn, page_order, &flush_flags);
+    int rc = iommu_unmap(d, dfn, page_count, &flush_flags);
 
     if ( !this_cpu(iommu_dont_flush_iotlb) && !rc )
-        rc = iommu_iotlb_flush(d, dfn, (1u << page_order), flush_flags);
+        rc = iommu_iotlb_flush(d, dfn, page_count, flush_flags);
 
     return rc;
 }
@@ -363,7 +360,7 @@ int iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn,
     return iommu_call(hd->platform_ops, lookup_page, d, dfn, mfn, flags);
 }
 
-int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned int page_count,
+int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned long page_count,
                       unsigned int flush_flags)
 {
     const struct domain_iommu *hd = dom_iommu(d);
@@ -382,7 +379,7 @@ int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned int page_count,
     {
         if ( !d->is_shutting_down && printk_ratelimit() )
             printk(XENLOG_ERR
-                   "d%d: IOMMU IOTLB flush failed: %d, dfn %"PRI_dfn", page count %u flags %x\n",
+                   "d%d: IOMMU IOTLB flush failed: %d, dfn %"PRI_dfn", page count %lu flags %x\n",
                    d->domain_id, rc, dfn_x(dfn), page_count, flush_flags);
 
         if ( !is_hardware_domain(d) )
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 607e8b5e65..68cf0e535a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -584,7 +584,7 @@ static int __must_check iommu_flush_all(void)
 
 static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
                                           bool_t dma_old_pte_present,
-                                          unsigned int page_count)
+                                          unsigned long page_count)
 {
     struct domain_iommu *hd = dom_iommu(d);
     struct acpi_drhd_unit *drhd;
@@ -632,7 +632,7 @@ static int __must_check iommu_flush_iotlb(struct domain *d, dfn_t dfn,
 
 static int __must_check iommu_flush_iotlb_pages(struct domain *d,
                                                 dfn_t dfn,
-                                                unsigned int page_count,
+                                                unsigned long page_count,
                                                 unsigned int flush_flags)
 {
     ASSERT(page_count && !dfn_eq(dfn, INVALID_DFN));
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index aea07e47c4..f17b1820f4 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -244,7 +244,7 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
         else if ( paging_mode_translate(d) )
             rc = set_identity_p2m_entry(d, pfn, p2m_access_rw, 0);
         else
-            rc = iommu_map(d, _dfn(pfn), _mfn(pfn), PAGE_ORDER_4K,
+            rc = iommu_map(d, _dfn(pfn), _mfn(pfn), 1ul << PAGE_ORDER_4K,
                            IOMMUF_readable | IOMMUF_writable, &flush_flags);
 
         if ( rc )
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 1831dc66b0..13f68dc93d 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -146,23 +146,23 @@ enum
 #define IOMMU_FLUSHF_modified (1u << _IOMMU_FLUSHF_modified)
 
 int __must_check iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
-                           unsigned int page_order, unsigned int flags,
+                           unsigned long page_count, unsigned int flags,
                            unsigned int *flush_flags);
 int __must_check iommu_unmap(struct domain *d, dfn_t dfn,
-                             unsigned int page_order,
+                             unsigned long page_count,
                              unsigned int *flush_flags);
 
 int __must_check iommu_legacy_map(struct domain *d, dfn_t dfn, mfn_t mfn,
-                                  unsigned int page_order,
+                                  unsigned long page_count,
                                   unsigned int flags);
 int __must_check iommu_legacy_unmap(struct domain *d, dfn_t dfn,
-                                    unsigned int page_order);
+                                    unsigned long page_count);
 
 int __must_check iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn,
                                    unsigned int *flags);
 
 int __must_check iommu_iotlb_flush(struct domain *d, dfn_t dfn,
-                                   unsigned int page_count,
+                                   unsigned long page_count,
                                    unsigned int flush_flags);
 int __must_check iommu_iotlb_flush_all(struct domain *d,
                                        unsigned int flush_flags);
@@ -281,7 +281,7 @@ struct iommu_ops {
     void (*share_p2m)(struct domain *d);
     void (*crash_shutdown)(void);
     int __must_check (*iotlb_flush)(struct domain *d, dfn_t dfn,
-                                    unsigned int page_count,
+                                    unsigned long page_count,
                                     unsigned int flush_flags);
     int __must_check (*iotlb_flush_all)(struct domain *d);
     int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:33:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3157.9097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkI7-0000Uf-R1; Tue, 06 Oct 2020 10:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3157.9097; Tue, 06 Oct 2020 10:33:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkI7-0000UX-O5; Tue, 06 Oct 2020 10:33:55 +0000
Received: by outflank-mailman (input) for mailman id 3157;
 Tue, 06 Oct 2020 10:33:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkI7-0000UQ-Et
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fc1264a2-87d8-425d-8611-83239369e9eb;
 Tue, 06 Oct 2020 10:33:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkI6-0001HZ-K5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkI6-0007Di-JJ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkI7-0000UQ-Et
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:55 +0000
X-Inumbo-ID: fc1264a2-87d8-425d-8611-83239369e9eb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fc1264a2-87d8-425d-8611-83239369e9eb;
	Tue, 06 Oct 2020 10:33:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=huMt2ZDOExB+0y2dp3n4pHgjJh+ezrVS2obhT11AACw=; b=Nqg81coxFBx+QSTD4P2QV7qun0
	daEmlZ460XuMfd12vjgNyKZJAaSOU+3Dq84+MEAF7IMkDtU6Lq7DWDRJROGstBM7p6ilx9Od9qB4+
	sDBeJ687X9CeFhD1MDUw11oaqR0P2SE4jPmW7br0W334omTNAyKvEYPzc5Bt7nrHz/Ug=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkI6-0001HZ-K5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkI6-0007Di-JJ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:33:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
Message-Id: <E1kPkI6-0007Di-JJ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:33:54 +0000

commit e71301ecd50f2d3bd1b960bbf7dcf850d02e7e8a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 15:46:21 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:46:21 2020 +0200

    x86/pv: Handle the Intel-specific MSR_MISC_ENABLE correctly
    
    This MSR doesn't exist on AMD hardware, and switching away from the safe
    functions in the common MSR path was an erroneous change.
    
    Partially revert the change.
    
    This is XSA-333.
    
    Fixes: 4fdc932b3cc ("x86/Intel: drop another 32-bit leftover")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index d793eed401..61071ae03a 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -959,7 +959,8 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, *val);
+        if ( rdmsr_safe(reg, *val) )
+            break;
         *val = guest_misc_enable(*val);
         return X86EMUL_OKAY;
 
@@ -1102,7 +1103,8 @@ static int write_msr(unsigned int reg, uint64_t val,
         break;
 
     case MSR_IA32_MISC_ENABLE:
-        rdmsrl(reg, temp);
+        if ( rdmsr_safe(reg, temp) )
+            break;
         if ( val != guest_misc_enable(temp) )
             goto invalid;
         return X86EMUL_OKAY;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3158.9101 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkII-0000YE-UA; Tue, 06 Oct 2020 10:34:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3158.9101; Tue, 06 Oct 2020 10:34:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkII-0000Y6-R3; Tue, 06 Oct 2020 10:34:06 +0000
Received: by outflank-mailman (input) for mailman id 3158;
 Tue, 06 Oct 2020 10:34:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkIH-0000Xu-JG
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 639aaac0-3a1f-4721-b689-17a404da0f1f;
 Tue, 06 Oct 2020 10:34:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIG-0001Hw-O2
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIG-0007ET-MK
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkIH-0000Xu-JG
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:05 +0000
X-Inumbo-ID: 639aaac0-3a1f-4721-b689-17a404da0f1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 639aaac0-3a1f-4721-b689-17a404da0f1f;
	Tue, 06 Oct 2020 10:34:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uRMsJ3N17RmHE/WAxd1HbENzydtEK1Pn+7Bo7dtktkc=; b=FO6T7y9i+KttpIDeCSNwiP95h7
	QH1Imq4/lQWjuHy4YiYejKUFHBQMdKljGK10tPNRaxyU/yCxCynAsApGnWO4YWIOXrkY16wEmSg6g
	emse+NSEwXTpu/y2D6NEZaKPNI3pKVLuusd3w9aN8Ozhcb+Q1lMjOHxlvEJUjHgFN0dY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIG-0001Hw-O2
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIG-0007ET-MK
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/memory: Don't skip the RCU unlock path in acquire_resource()
Message-Id: <E1kPkIG-0007ET-MK@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:04 +0000

commit 42317dede5be4fe5be27c873f7a3f94d3bba98e0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 15:46:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:46:49 2020 +0200

    xen/memory: Don't skip the RCU unlock path in acquire_resource()
    
    In the case that an HVM Stubdomain makes an XENMEM_acquire_resource hypercall,
    the FIXME path will bypass rcu_unlock_domain() on the way out of the function.
    
    Move the check to the start of the function.  This does change the behaviour
    of the get-size path for HVM Stubdomains, but that functionality is currently
    broken and unused anyway, as well as being quite useless to entities which
    can't actually map the resource anyway.
    
    This is XSA-334.
    
    Fixes: 83fa6552ce ("common: add a new mappable resource type: XENMEM_resource_grant_table")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/memory.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 714077c1e5..1bab0e80c2 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1058,6 +1058,14 @@ static int acquire_resource(
     xen_pfn_t mfn_list[32];
     int rc;
 
+    /*
+     * FIXME: Until foreign pages inserted into the P2M are properly
+     *        reference counted, it is unsafe to allow mapping of
+     *        resource pages unless the caller is the hardware domain.
+     */
+    if ( paging_mode_translate(currd) && !is_hardware_domain(currd) )
+        return -EACCES;
+
     if ( copy_from_guest(&xmar, arg, 1) )
         return -EFAULT;
 
@@ -1114,14 +1122,6 @@ static int acquire_resource(
         xen_pfn_t gfn_list[ARRAY_SIZE(mfn_list)];
         unsigned int i;
 
-        /*
-         * FIXME: Until foreign pages inserted into the P2M are properly
-         *        reference counted, it is unsafe to allow mapping of
-         *        resource pages unless the caller is the hardware domain.
-         */
-        if ( !is_hardware_domain(currd) )
-            return -EACCES;
-
         if ( copy_from_guest(gfn_list, xmar.frame_list, xmar.nr_frames) )
             rc = -EFAULT;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3159.9105 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIS-0000ZN-W2; Tue, 06 Oct 2020 10:34:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3159.9105; Tue, 06 Oct 2020 10:34:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIS-0000ZF-Si; Tue, 06 Oct 2020 10:34:16 +0000
Received: by outflank-mailman (input) for mailman id 3159;
 Tue, 06 Oct 2020 10:34:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkIS-0000Z8-D0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ff97dba4-b592-4eeb-8fa0-133b6f15fd52;
 Tue, 06 Oct 2020 10:34:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIQ-0001I6-RA
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIQ-0007F9-QS
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkIS-0000Z8-D0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:16 +0000
X-Inumbo-ID: ff97dba4-b592-4eeb-8fa0-133b6f15fd52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ff97dba4-b592-4eeb-8fa0-133b6f15fd52;
	Tue, 06 Oct 2020 10:34:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xvGAgv3rp3T8BPS1o/A1MuwsTrDHgW+g1ipYLqoaTjg=; b=3dlF82MEBUB0dbcO5iiArUB4jV
	xRHMcF9TtR4ItD6SQmS/cBWeKjIky2JTdGmDJPzgVzuvHioIGxraHO5U8RS0BlWZCR1iuNhWjHXXI
	/Z8Qun9H49gLBPp2jV7hQR8SlzPQ13nMOKYsSvbysFfxKf/NDDbsnPJUHrfd3wzpObO0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIQ-0001I6-RA
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIQ-0007F9-QS
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kPkIQ-0007F9-QS@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:14 +0000

commit 8e76aef72820435e766c7f339ed36da33da90c40
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 15:47:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:47:19 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 81 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 49 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 32719b6d01..2dfda93e09 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -658,6 +658,8 @@ int hvm_domain_initialise(struct domain *d)
     /* need link to containing domain */
     d->arch.hvm.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index c68bbd1558..867deb4da5 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -153,23 +153,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm.tm_lock);
+    read_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -219,7 +228,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -227,7 +236,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -235,7 +244,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -248,7 +257,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -309,7 +318,7 @@ int pt_update_irq(struct vcpu *v)
     int irq, pt_vector = -1;
     bool level;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -339,7 +348,7 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
@@ -347,7 +356,7 @@ int pt_update_irq(struct vcpu *v)
     irq = earliest_pt->irq;
     level = earliest_pt->level;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -394,7 +403,7 @@ int pt_update_irq(struct vcpu *v)
                 time_cb *cb = NULL;
                 void *cb_priv;
 
-                spin_lock(&v->arch.hvm.tm_lock);
+                pt_vcpu_lock(v);
                 /* Make sure the timer is still on the list. */
                 list_for_each_entry ( pt, &v->arch.hvm.tm_list, list )
                     if ( pt == earliest_pt )
@@ -404,7 +413,7 @@ int pt_update_irq(struct vcpu *v)
                         cb_priv = pt->priv;
                         break;
                     }
-                spin_unlock(&v->arch.hvm.tm_lock);
+                pt_vcpu_unlock(v);
 
                 if ( cb != NULL )
                     cb(v, cb_priv);
@@ -441,12 +450,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -455,7 +464,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -466,12 +475,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -490,7 +499,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&v->domain->arch.hvm.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -540,7 +549,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&v->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -565,30 +574,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index f0e0eaec83..39d26cbda4 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -128,6 +128,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3160.9109 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkId-0000ah-1O; Tue, 06 Oct 2020 10:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3160.9109; Tue, 06 Oct 2020 10:34:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIc-0000aX-UP; Tue, 06 Oct 2020 10:34:26 +0000
Received: by outflank-mailman (input) for mailman id 3160;
 Tue, 06 Oct 2020 10:34:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkIc-0000aO-07
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d6dd1bf6-17fa-40b4-b5d9-9cc2842581fb;
 Tue, 06 Oct 2020 10:34:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIa-0001IM-U8
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIa-0007G1-TR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkIc-0000aO-07
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:26 +0000
X-Inumbo-ID: d6dd1bf6-17fa-40b4-b5d9-9cc2842581fb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d6dd1bf6-17fa-40b4-b5d9-9cc2842581fb;
	Tue, 06 Oct 2020 10:34:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jMsiU595BVd/Jf8zdBq0BPr7jl/sxIxp38LOOff/59Q=; b=ayq6Y350t0P9Mo4PsbIsqWr515
	q0xPAcy1H7KaRYdUDmkVMzJD7UR2SLkxVQySNBMPIuV2qcSNtwm5UHevJPS0ghbCjVLhsEvy0jLfH
	fIJ1TyxyzIoOuJaZTGlcaA9aXUEqhm/rrbrSokyEApOxnVUkD0FrawKJqgUnPvQ6rDNY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIa-0001IM-U8
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIa-0007G1-TR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msi: get rid of read_msi_msg
Message-Id: <E1kPkIa-0007G1-TR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:24 +0000

commit cb5e9730862ba0c99e81d3fbd8f65010707245e4
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 15:47:58 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:47:58 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 53 +----------------------------------------------------
 1 file changed, 1 insertion(+), 52 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 29e4351a49..9ff4beb5de 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -185,54 +185,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        uint16_t data;
-
-        msg->address_lo = pci_conf_read32(dev->sbdf,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(dev->sbdf,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(dev->sbdf, msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -304,10 +256,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3161.9114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIn-0000bw-3G; Tue, 06 Oct 2020 10:34:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3161.9114; Tue, 06 Oct 2020 10:34:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIm-0000bo-W4; Tue, 06 Oct 2020 10:34:36 +0000
Received: by outflank-mailman (input) for mailman id 3161;
 Tue, 06 Oct 2020 10:34:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkIm-0000bg-5C
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 64b0e6c2-fd69-4bd9-8757-e7c7267f860a;
 Tue, 06 Oct 2020 10:34:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIl-0001IU-0u
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIl-0007Gr-0B
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkIm-0000bg-5C
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:36 +0000
X-Inumbo-ID: 64b0e6c2-fd69-4bd9-8757-e7c7267f860a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 64b0e6c2-fd69-4bd9-8757-e7c7267f860a;
	Tue, 06 Oct 2020 10:34:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HaqNxXlzZdaBSV0XQHcbL4RcIvwNYBxI3/ORFZUPwJc=; b=6hHIF1JhdzFzBn/8Frev0yEoQ5
	8V1Y4A/cmweVAsNnnl5XFaphQjStxwBet9uKw4RKwhrQ+mrDnxQLqiljLKWT+1idQ+Q8sT5hp/5n4
	wxwdGn+gxBk0eEoFZm8sUh7WWXjaOfiQHosHgCsWWsB4JA+d/GpOJsr6b/IqGt3Klm7g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIl-0001IU-0u
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIl-0007Gr-0B
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kPkIl-0007Gr-0B@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:35 +0000

commit beb54596cfdaf15f6a86d7b1bf84ca8a0b9c6b9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:48:26 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:48:26 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 60 insertions(+), 37 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 9ff4beb5de..a899c43e8d 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -771,16 +771,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
     unsigned int pos = pci_find_cap_offset(seg, bus, slot, func,
                                            PCI_CAP_ID_MSIX);
 
@@ -822,43 +820,45 @@ static int msix_capability_init(struct pci_dev *dev,
 
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(dev->sbdf, msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
-    {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(dev->sbdf, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->table.first = PFN_DOWN(table_paddr);
         msix->table.last = PFN_DOWN(table_paddr +
@@ -877,7 +877,18 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(msix->nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
+    }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
+        xfree(entry);
+        return -ENODATA;
     }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      PAGE_OFFSET(table_offset & ~PCI_MSIX_BIRMASK);
 
     if ( entry )
     {
@@ -888,8 +899,15 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
-            pci_conf_write16(dev->sbdf, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
+            pci_conf_write16(dev->sbdf, msix_control_reg(pos), control);
             xfree(entry);
             return idx;
         }
@@ -1072,9 +1090,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3162.9117 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIx-0000dO-5z; Tue, 06 Oct 2020 10:34:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3162.9117; Tue, 06 Oct 2020 10:34:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkIx-0000dG-2o; Tue, 06 Oct 2020 10:34:47 +0000
Received: by outflank-mailman (input) for mailman id 3162;
 Tue, 06 Oct 2020 10:34:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkIv-0000d7-UM
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4edf08d9-b6e9-4365-a421-2e2fa3dd9ce3;
 Tue, 06 Oct 2020 10:34:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIv-0001J1-4d
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkIv-0007Hp-34
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkIv-0000d7-UM
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
X-Inumbo-ID: 4edf08d9-b6e9-4365-a421-2e2fa3dd9ce3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4edf08d9-b6e9-4365-a421-2e2fa3dd9ce3;
	Tue, 06 Oct 2020 10:34:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SswKFWUmmWXUixr5zPYArONcKaL1Ebm7JfLrRGyKjog=; b=TyE9FM4tFYk6ySvE34i4BYe1W7
	vYnzutaYbb1fu+TWmfALw4PGCRYYX5gaDsXsnSv9UtON33VRI/lxmfacViR3uonpFKemeBniloi1j
	vMcptNxxa9D6uBVIgqg4po6IQVke4zck7/ffuzyyvEm/joEJKkpMZiav6dJJSZ2ZqdZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIv-0001J1-4d
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkIv-0007Hp-34
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: relax port_is_valid()
Message-Id: <E1kPkIv-0007Hp-34@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:45 +0000

commit e59ce972d1280c6c55065da822e0860845582053
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:48:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:48:52 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index a7798f6765..ce45298377 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,8 +107,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:34:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:34:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3163.9121 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJ7-0000eg-7a; Tue, 06 Oct 2020 10:34:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3163.9121; Tue, 06 Oct 2020 10:34:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJ7-0000eY-4X; Tue, 06 Oct 2020 10:34:57 +0000
Received: by outflank-mailman (input) for mailman id 3163;
 Tue, 06 Oct 2020 10:34:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJ6-0000eO-DG
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9b88876a-d588-455d-82ff-980c88e77290;
 Tue, 06 Oct 2020 10:34:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJ5-0001JB-BA
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJ5-0007KH-6y
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJ6-0000eO-DG
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:56 +0000
X-Inumbo-ID: 9b88876a-d588-455d-82ff-980c88e77290
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9b88876a-d588-455d-82ff-980c88e77290;
	Tue, 06 Oct 2020 10:34:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u7Ox0+kL429dXgyrxu3j1Qti40HQbZOm7SDSIt7Nc6Y=; b=OP+SCbmxHLOpJO5u6hkl9wOWlH
	W2+2QBUr/v+fTevTkqGw18XEqkaUn7YwkrS16fiE5+xF3jPu5l8a+onKkdHaiUxkepoSyufY+vn73
	RTa6iImnsEDZcfwNEp/lXIr9BsDUlh3W9/LSuw8j4rRmWjEeajPQB971Tp0L0LLFkDeE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJ5-0001JB-BA
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJ5-0007KH-6y
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:34:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Avoid double exception injection
Message-Id: <E1kPkJ5-0007KH-6y@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:34:55 +0000

commit 910093d54fc758e7d69261b344fdc8da3a7bd81e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 15:49:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:49:19 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index c3e62f8734..73619f57ca 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -78,7 +78,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -352,7 +351,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 1e880eb9f6..71a00e846b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -90,7 +90,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -512,6 +511,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3164.9125 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJH-0000gZ-96; Tue, 06 Oct 2020 10:35:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3164.9125; Tue, 06 Oct 2020 10:35:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJH-0000gR-61; Tue, 06 Oct 2020 10:35:07 +0000
Received: by outflank-mailman (input) for mailman id 3164;
 Tue, 06 Oct 2020 10:35:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJG-0000gI-B5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9b7efe3a-abdc-49be-a524-b4b948395745;
 Tue, 06 Oct 2020 10:35:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJF-0001JZ-Ex
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJF-0007LK-Dh
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJG-0000gI-B5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:06 +0000
X-Inumbo-ID: 9b7efe3a-abdc-49be-a524-b4b948395745
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9b7efe3a-abdc-49be-a524-b4b948395745;
	Tue, 06 Oct 2020 10:35:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OY9WYMHb6HlhB7nNzR091VJ9fGg4Ay/AhJW2Ju6QaQo=; b=yp9szv8QyixRBxFKWHCD1mic9W
	Hc3UUlOrRaiETp8OhumPZgDhKqNg7UCmN8b/9asqJYY12Mkj+JcgYdf6wtP7Fb4W6aFNU507Nh0by
	Se3i6fZc0UDqF1MXVQAkaVrFmp/TH7qk8S1RmmjJNVDEj5fzg4A5V1j1zgiDiij3tkKo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJF-0001JZ-Ex
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJF-0007LK-Dh
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kPkJF-0007LK-Dh@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:05 +0000

commit 112992b05b2d2ca63f3c78eefe1cf8d192d7303a
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 15:49:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:49:40 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a8d182b584..53c17bd354 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -178,6 +178,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index ce45298377..c35f4b23b6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -107,7 +107,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3165.9129 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJR-0000hs-AN; Tue, 06 Oct 2020 10:35:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3165.9129; Tue, 06 Oct 2020 10:35:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJR-0000hk-7U; Tue, 06 Oct 2020 10:35:17 +0000
Received: by outflank-mailman (input) for mailman id 3165;
 Tue, 06 Oct 2020 10:35:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJQ-0000hb-Km
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 22d04f4e-f420-41d5-8121-a111ac40cb0d;
 Tue, 06 Oct 2020 10:35:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJP-0001Jh-IG
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJP-0007SV-HU
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJQ-0000hb-Km
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:16 +0000
X-Inumbo-ID: 22d04f4e-f420-41d5-8121-a111ac40cb0d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 22d04f4e-f420-41d5-8121-a111ac40cb0d;
	Tue, 06 Oct 2020 10:35:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OKxFyvB6irn3Y0e20+CdvIdgbcK+Y04uOMdGoD6suiE=; b=TIDHoccwrjlx4fsHbO2/T4bUOB
	piJ209FGslupWINj2h6uzW5WfCBw8oMw5KccXWvD8vtV21qxuTgeu94HWmSR5hg/4IZY5rWBBbKkf
	i5IhoaAhPTiGrzIWRzcDU70WB9Pt2yH2Cui1WRgGJ8BfmlOWmMLyyh1ezK6uX+erbuEo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJP-0001Jh-IG
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJP-0007SV-HU
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kPkJP-0007SV-HU@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:15 +0000

commit 62bcdc4edbf6d8c6e8a25544d48de22ccf75310d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:50:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:50:09 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/sched/core.c    | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53c17bd354..08ffe0f063 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -151,7 +151,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1396,13 +1396,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 230f440f14..2f13d92128 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -478,7 +478,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -488,7 +488,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -546,6 +546,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -562,8 +564,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index cb49a8bc02..ab94d2ec3a 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1428,7 +1428,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index c35f4b23b6..e1b299e8df 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,6 +105,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index e9ce43cc9a..33d716ef77 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -359,7 +359,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3166.9132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJc-0000j9-CS; Tue, 06 Oct 2020 10:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3166.9132; Tue, 06 Oct 2020 10:35:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJc-0000j2-97; Tue, 06 Oct 2020 10:35:28 +0000
Received: by outflank-mailman (input) for mailman id 3166;
 Tue, 06 Oct 2020 10:35:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJa-0000ip-OG
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c150934a-645b-461f-bdeb-6d7a44c96d99;
 Tue, 06 Oct 2020 10:35:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJZ-0001Jp-LN
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJZ-0007WO-Kf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJa-0000ip-OG
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:26 +0000
X-Inumbo-ID: c150934a-645b-461f-bdeb-6d7a44c96d99
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c150934a-645b-461f-bdeb-6d7a44c96d99;
	Tue, 06 Oct 2020 10:35:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d/RDwOiGsAvFuOxPJCHW8tVvBCxoexXWguh37zYzEq4=; b=mWPZgLjnpWV0C+Y4qEkEtE6rNH
	Z3N9Hiv7Jj4gWTP/s1ZTAoIw9P6K9uWVBV/1DTTQ3c4HCAK0LJuBwGSDQkxLvwtIg4MTWaMmPT9YU
	Q5JNIRP4xsfLNf5rjbuTcV+jFw1lF7cYFxw2dXY5B8DrEJLd4PW+pskAEJFW8bG/KbTM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJZ-0001Jp-LN
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJZ-0007WO-Kf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kPkJZ-0007WO-Kf@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:25 +0000

commit 8d385b247bca40ece40c9279391054bc98934325
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:50:55 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:50:55 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 08ffe0f063..6a566917b1 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -188,6 +188,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -211,11 +213,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -258,6 +275,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -351,6 +369,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -488,7 +507,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -536,6 +555,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1011,10 +1031,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1024,7 +1044,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1033,7 +1055,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1219,10 +1241,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1238,7 +1259,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1314,6 +1338,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long, BITS_TO_LONGS(d->max_vcpus));
@@ -1340,6 +1365,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 33d716ef77..67fdabbec3 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -361,6 +361,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3167.9137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJn-0000kZ-GI; Tue, 06 Oct 2020 10:35:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3167.9137; Tue, 06 Oct 2020 10:35:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJn-0000kR-Cu; Tue, 06 Oct 2020 10:35:39 +0000
Received: by outflank-mailman (input) for mailman id 3167;
 Tue, 06 Oct 2020 10:35:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJl-0000kI-S7
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 47a5e7be-646a-46cc-8c0d-2abd3403512b;
 Tue, 06 Oct 2020 10:35:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJj-0001K4-OM
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJj-0007XP-Nj
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJl-0000kI-S7
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:37 +0000
X-Inumbo-ID: 47a5e7be-646a-46cc-8c0d-2abd3403512b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 47a5e7be-646a-46cc-8c0d-2abd3403512b;
	Tue, 06 Oct 2020 10:35:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nnKbyGqdF+y5nztjea9h/6l7HsKbnQu96ujDJa59JZI=; b=VtnzlLhXVmQ2nzNKCH1iM9FJ/V
	1mEmahIAgjHU/I7ytxzR+M+1boOswXm5g1QEMWy9e8irCzmShQ5l4oWHkRJjjOnrrRRDStxq61vHT
	QhxkUs3aFXRvQZcA/sKpnrSVfJNFL+WV/tYNzARKZVoKlyjdXNy2b4aruqofdnxPvRzM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJj-0001K4-OM
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJj-0007XP-Nj
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kPkJj-0007XP-Nj@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:35 +0000

commit c0ddc8634845aba50774add6e4b73fdaffc82656
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:51:28 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:51:28 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 6a566917b1..0e550e9c7a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -248,6 +248,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -263,14 +264,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -283,26 +284,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -312,6 +319,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -347,7 +355,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -364,7 +372,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -387,6 +395,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -424,14 +433,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -448,6 +457,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( domain_vcpu(d, vcpu) == NULL )
         return -ENOENT;
@@ -459,13 +469,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -509,6 +519,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -541,14 +552,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -569,6 +580,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -668,14 +680,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -683,9 +695,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -705,13 +717,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -746,7 +759,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1238,6 +1251,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1250,14 +1264,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1280,11 +1294,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1294,7 +1309,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3168.9141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJw-0000ls-I0; Tue, 06 Oct 2020 10:35:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3168.9141; Tue, 06 Oct 2020 10:35:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkJw-0000lk-Ee; Tue, 06 Oct 2020 10:35:48 +0000
Received: by outflank-mailman (input) for mailman id 3168;
 Tue, 06 Oct 2020 10:35:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkJv-0000lZ-Az
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 31bc2efc-395f-465d-8168-a61922f62c5b;
 Tue, 06 Oct 2020 10:35:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJt-0001Ko-RX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkJt-0007Yi-Qk
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkJv-0000lZ-Az
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:47 +0000
X-Inumbo-ID: 31bc2efc-395f-465d-8168-a61922f62c5b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 31bc2efc-395f-465d-8168-a61922f62c5b;
	Tue, 06 Oct 2020 10:35:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UJhLcLjwsaJ3nUfskHD7wsocCfHy1lDTkCr5dB9IRuA=; b=zExOYkCc3xyGC7EcOSKeHSEHpy
	bhACy6O5+SnfQRsyqNaJhp2ZT8khdGBVWv9A5GHz9A+x1LFgd7Lc9fAsqaMIyYEjfMzkdmypW38iM
	qM7HI03dhevDwVP0zOCil9m4YdufNXacyTlHDswoBqkHAjBZVzDmjoPWxLjZZHwB/TYc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJt-0001Ko-RX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkJt-0007Yi-Qk
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: address races with evtchn_reset()
Message-Id: <E1kPkJt-0007Yi-Qk@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:45 +0000

commit e045199c7c9c5433d7f1461a741ed539a75cbfad
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:51:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:51:52 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index a69937c840..93c4fb9a79 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2488,14 +2488,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i++];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("d%d:%3d(%c%c%c)%c",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       info->masked ? 'M' : '-',
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-',
                        i < action->nr_guests ? ',' : '\n');
             }
         }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 3a0525c209..9aef7a860a 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -660,8 +660,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0e550e9c7a..878e4250ed 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -156,8 +156,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -774,6 +775,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -784,7 +786,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -813,7 +818,9 @@ void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -823,6 +830,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -837,7 +845,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1034,12 +1044,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1449,8 +1462,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 2f13d92128..68d0c7a632 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -296,23 +296,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index 98a85233cb..5e09ede6d7 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline bool arch_virq_is_global(unsigned int virq)
     return true;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index e1b299e8df..bc9aa68650 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -133,6 +133,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -165,19 +183,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -193,38 +216,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -233,6 +285,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:35:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:35:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3169.9145 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkK6-0000nF-Jp; Tue, 06 Oct 2020 10:35:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3169.9145; Tue, 06 Oct 2020 10:35:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkK6-0000n8-GR; Tue, 06 Oct 2020 10:35:58 +0000
Received: by outflank-mailman (input) for mailman id 3169;
 Tue, 06 Oct 2020 10:35:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkK4-0000mz-T2
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 73d81edb-df3e-4dec-9759-4e7087a39b8e;
 Tue, 06 Oct 2020 10:35:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkK3-0001L0-VY
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkK3-0007Zt-Tu
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkK4-0000mz-T2
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:56 +0000
X-Inumbo-ID: 73d81edb-df3e-4dec-9759-4e7087a39b8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 73d81edb-df3e-4dec-9759-4e7087a39b8e;
	Tue, 06 Oct 2020 10:35:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pjvH/ZfeAvDXP+3Q7okEm3Hl5DFIe+d9cALZVP6KzPw=; b=KIybYw5fV18JQy6FbfgXZC1nZC
	6IpE8Jsz3xiruAQdkPTeLh1pBXwfrj8K2GunDjCPXvbKCoIlH0wNnj+RJaBvNiCnvUj+1ImF09NIv
	QBTKppllWLjRinkwCsJpSOZuyjV9Htnnrtm8UrrE3EDtqHwomHDpHk77aF+wTaZSqXlc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkK3-0001L0-VY
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkK3-0007Zt-Tu
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:35:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kPkK3-0007Zt-Tu@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:35:55 +0000

commit 8fe7b5f9960f4d9ec46787af394d180c39c6b2db
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:52:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:52:36 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 61ffccde0c..216e5a1d4c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -711,12 +711,14 @@ int domain_kill(struct domain *d)
             return domain_kill(d);
         d->is_dying = DOMDYING_dying;
         argo_destroy(d);
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         vnuma_destroy(d->vnuma);
         domain_set_outstanding_pages(d, 0);
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 878e4250ed..3b1fe423df 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1297,7 +1297,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1309,7 +1318,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1380,8 +1399,7 @@ int evtchn_init(struct domain *d, unsigned int max_port)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1390,14 +1408,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 67fdabbec3..5343063d41 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -138,7 +138,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d, unsigned int max_port);
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3170.9149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKG-0000pA-NN; Tue, 06 Oct 2020 10:36:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3170.9149; Tue, 06 Oct 2020 10:36:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKG-0000p2-KQ; Tue, 06 Oct 2020 10:36:08 +0000
Received: by outflank-mailman (input) for mailman id 3170;
 Tue, 06 Oct 2020 10:36:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkKF-0000or-7M
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 94d63a00-a400-4cdc-8518-e5381f2afc31;
 Tue, 06 Oct 2020 10:36:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKE-0001LT-2X
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKE-0007bB-1t
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkKF-0000or-7M
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:07 +0000
X-Inumbo-ID: 94d63a00-a400-4cdc-8518-e5381f2afc31
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 94d63a00-a400-4cdc-8518-e5381f2afc31;
	Tue, 06 Oct 2020 10:36:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IahkCEZvLPHL3AXEbWcR32Wx7YA6mBM8+wLIAU905ws=; b=aD8/e/V6FD5szXIKhl8eVvPk+W
	cpRZBy1fXUycR66DnuJsfhAEBVb2PovkjJ2dzf3vDahfDRQ7+PdwVq2NyyZrDiOjpQyx7TchHMByL
	zZFvBL2PMnQHdBY/KQI0xJ05hqTb0BJ6LvjL/jbfhGNDqDIPHm9RVR9xOKjF0bt5owkk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKE-0001LT-2X
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKE-0007bB-1t
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kPkKE-0007bB-1t@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:06 +0000

commit 2785b2a9e04abc148e1c5259f4faee708ea356f4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 15:53:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 15:53:10 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 216e5a1d4c..8cfa2e0b6b 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1141,7 +1141,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1155,7 +1155,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 5ac6e9c5ca..af044e2eda 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -477,12 +477,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 3b1fe423df..d2ee83bbbf 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1057,7 +1057,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1065,11 +1065,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1204,7 +1233,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1217,9 +1247,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 5c5e55ebcb..791f0a2592 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1154,7 +1154,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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 246ace4d19..73c9f38ce1 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index bc9aa68650..fa93a3684a 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -179,7 +179,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 5343063d41..d8ed83f869 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -371,6 +371,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -661,7 +663,7 @@ int domain_kill(struct domain *d);
 int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3171.9152 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKQ-0000qS-Oz; Tue, 06 Oct 2020 10:36:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3171.9152; Tue, 06 Oct 2020 10:36:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKQ-0000qK-M6; Tue, 06 Oct 2020 10:36:18 +0000
Received: by outflank-mailman (input) for mailman id 3171;
 Tue, 06 Oct 2020 10:36:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkKP-0000qC-DV
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6a3c5179-d05a-4651-a6ef-6a07fbf6166e;
 Tue, 06 Oct 2020 10:36:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKO-0001La-5T
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKO-0007bx-4m
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkKP-0000qC-DV
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:17 +0000
X-Inumbo-ID: 6a3c5179-d05a-4651-a6ef-6a07fbf6166e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6a3c5179-d05a-4651-a6ef-6a07fbf6166e;
	Tue, 06 Oct 2020 10:36:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qzfw0oshN5eoZ5s/2Rm7LZSv6MKduuIBUsOiHzDgJdE=; b=xSzQkuiG1NuvGtgb62+0IT87jr
	Xzn5Dvoq4LLena4k7zVAyZYj7B54ZHEdF1mXPoXgWmnfr/5pzJjXokQLfNs4csoJByqSasKXvaD4I
	xWRhWVRYo62jCizcTUec70YdMNjcxnBdo875+7ZQ+wFv7pHz7fQ5NVKkUgIJ9ld6Y+HE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKO-0001La-5T
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKO-0007bx-4m
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT.md: Update status of Renesas IPMMU-VMSA (Arm)
Message-Id: <E1kPkKO-0007bx-4m@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:16 +0000

commit a6732807d335239fc29bd953538affc458bcc197
Author:     Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
AuthorDate: Sat Sep 19 20:21:22 2020 +0300
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Sep 23 09:16:20 2020 +0100

    SUPPORT.md: Update status of Renesas IPMMU-VMSA (Arm)
    
    Mark Renesas IPMMU-VMSA as "Supported, not security supported"
    and remove dependencies on CONFIG_EXPERT.
    
    We can't treat the IOMMU driver as "Supported" since the device
    passthrough feature is not security supported on Arm today.
    
    Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 SUPPORT.md                      | 2 +-
 xen/arch/arm/platforms/Kconfig  | 2 +-
 xen/drivers/passthrough/Kconfig | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 1479055c45..25987ec1df 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -64,7 +64,7 @@ supported in this document.
     Status, Intel VT-d: Supported
     Status, ARM SMMUv1: Supported
     Status, ARM SMMUv2: Supported
-    Status, Renesas IPMMU-VMSA: Tech Preview
+    Status, Renesas IPMMU-VMSA: Supported, not security supported
 
 ### ARM/GICv3 ITS
 
diff --git a/xen/arch/arm/platforms/Kconfig b/xen/arch/arm/platforms/Kconfig
index 4bb73190e7..c93a6b2756 100644
--- a/xen/arch/arm/platforms/Kconfig
+++ b/xen/arch/arm/platforms/Kconfig
@@ -25,7 +25,7 @@ config RCAR3
 	bool "Renesas RCar3 support"
 	depends on ARM_64
 	select HAS_SCIF
-	select IPMMU_VMSA if EXPERT
+	select IPMMU_VMSA
 	---help---
 	Enable all the required drivers for Renesas RCar3
 
diff --git a/xen/drivers/passthrough/Kconfig b/xen/drivers/passthrough/Kconfig
index 73f4ad89ec..0036007ec4 100644
--- a/xen/drivers/passthrough/Kconfig
+++ b/xen/drivers/passthrough/Kconfig
@@ -14,7 +14,7 @@ config ARM_SMMU
 	  ARM SMMU architecture.
 
 config IPMMU_VMSA
-	bool "Renesas IPMMU-VMSA found in R-Car Gen3 SoCs" if EXPERT
+	bool "Renesas IPMMU-VMSA found in R-Car Gen3 SoCs"
 	depends on ARM_64
 	---help---
 	  Support for implementations of the Renesas IPMMU-VMSA found
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3172.9157 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKa-0000rq-Qk; Tue, 06 Oct 2020 10:36:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3172.9157; Tue, 06 Oct 2020 10:36:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKa-0000ri-Nf; Tue, 06 Oct 2020 10:36:28 +0000
Received: by outflank-mailman (input) for mailman id 3172;
 Tue, 06 Oct 2020 10:36:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkKZ-0000rV-1C
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 056bc1a8-2c7d-47a0-96e9-80c1c6f1e5fa;
 Tue, 06 Oct 2020 10:36:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKY-0001Ll-8x
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKY-0007cl-7e
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkKZ-0000rV-1C
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:27 +0000
X-Inumbo-ID: 056bc1a8-2c7d-47a0-96e9-80c1c6f1e5fa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 056bc1a8-2c7d-47a0-96e9-80c1c6f1e5fa;
	Tue, 06 Oct 2020 10:36:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=flQMqzy3flu/SNQzOhkDaajZ6rQ/lmKIhjOwwNyhEdU=; b=AWaZJarV0B1bxqHLHSwWpIMsMB
	VMTgqu44+AoPYXhwt77cxhsbe0kz9mzWAwg1SWvkoHOMCtjT7Bp1C5blCUu8Cxf+cq+35ax7Cn12k
	LTUa2wcZcwoKDwNS+ZJveLQZeJJNDdZ8BMfA2miZLU9IzTq0Tq4s1IlpwU1j16jIs4DE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKY-0001Ll-8x
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKY-0007cl-7e
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: bootfdt: Ignore empty memory bank
Message-Id: <E1kPkKY-0007cl-7e@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:26 +0000

commit 5a37207df52066efefe419c677b089a654d37afc
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Fri Sep 18 18:11:16 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Sep 23 09:30:01 2020 +0100

    xen/arm: bootfdt: Ignore empty memory bank
    
    At the moment, Xen will stop processing the Device Tree if a memory
    bank is empty (size == 0).
    
    Unfortunately, some of the Device Tree (such as on Colibri imx8qxp)
    may contain such a bank. This means Xen will not be able to boot
    properly.
    
    Relax the check to just ignore the banks. FWIW this also seems to be the
    behavior adopted by Linux.
    
    Reported-by: Daniel Wagner <Daniel.Wagner2@itk-engineering.de>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/bootfdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 08fb59f4e7..dcff512648 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -163,8 +163,9 @@ static int __init process_memory_node(const void *fdt, int node,
     for ( i = 0; i < banks && mem->nr_banks < NR_MEM_BANKS; i++ )
     {
         device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+        /* Some DT may describe empty bank, ignore them */
         if ( !size )
-            return -EINVAL;
+            continue;
         mem->bank[mem->nr_banks].start = start;
         mem->bank[mem->nr_banks].size = size;
         mem->nr_banks++;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3173.9161 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKk-0000yo-SU; Tue, 06 Oct 2020 10:36:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3173.9161; Tue, 06 Oct 2020 10:36:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKk-0000yg-PM; Tue, 06 Oct 2020 10:36:38 +0000
Received: by outflank-mailman (input) for mailman id 3173;
 Tue, 06 Oct 2020 10:36:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkKj-0000sq-5t
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 49345c10-4c10-46e4-a8b5-43adedb568bd;
 Tue, 06 Oct 2020 10:36:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKi-0001Lv-Cd
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKi-0007de-BH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkKj-0000sq-5t
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:37 +0000
X-Inumbo-ID: 49345c10-4c10-46e4-a8b5-43adedb568bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 49345c10-4c10-46e4-a8b5-43adedb568bd;
	Tue, 06 Oct 2020 10:36:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f4w9EsQEYRmgTvMlannFeib7yrsF6YUd6E+VXxxkvUc=; b=RkkV6Ojoho65lw2+py04UIxvxh
	jnfcNk13Nu+1WAFE3KytDFu/7JK9vEaWFd2Ysve755DXE13qHf7FmjSz1K/deoZhOXp7AHD6KhBXd
	ECq7TWGqkkAVPYhhf9asGTl5UyrrTu56Fq155avDbdFmyH4UweNKd0YmWRO8xdn4ofHs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKi-0001Lv-Cd
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKi-0007de-BH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msi: Fold pci_conf_write16() calls in write_msi_msg()
Message-Id: <E1kPkKi-0007de-BH@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:36 +0000

commit af3c913f03b5f9eab15b168ef87cde80f9addc6e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 20:05:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Sep 24 21:02:35 2020 +0100

    x86/msi: Fold pci_conf_write16() calls in write_msi_msg()
    
    In addition, this removes the unqualified 0/1 passed to msi_data_reg()
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index a899c43e8d..5febc0ea4b 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -214,13 +214,10 @@ static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         pci_conf_write32(dev->sbdf, msi_lower_address_reg(pos),
                          msg->address_lo);
         if ( entry->msi_attrib.is_64 )
-        {
             pci_conf_write32(dev->sbdf, msi_upper_address_reg(pos),
                              msg->address_hi);
-            pci_conf_write16(dev->sbdf, msi_data_reg(pos, 1), msg->data);
-        }
-        else
-            pci_conf_write16(dev->sbdf, msi_data_reg(pos, 0), msg->data);
+        pci_conf_write16(dev->sbdf, msi_data_reg(pos, entry->msi_attrib.is_64),
+                         msg->data);
         break;
     }
     case PCI_CAP_ID_MSIX:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3174.9165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKu-000103-UJ; Tue, 06 Oct 2020 10:36:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3174.9165; Tue, 06 Oct 2020 10:36:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkKu-0000zu-R2; Tue, 06 Oct 2020 10:36:48 +0000
Received: by outflank-mailman (input) for mailman id 3174;
 Tue, 06 Oct 2020 10:36:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkKt-0000zd-5i
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0692ae25-b388-44be-a2ae-d56f17f0bef2;
 Tue, 06 Oct 2020 10:36:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKs-0001MU-FS
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkKs-0007eW-Eq
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkKt-0000zd-5i
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:47 +0000
X-Inumbo-ID: 0692ae25-b388-44be-a2ae-d56f17f0bef2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0692ae25-b388-44be-a2ae-d56f17f0bef2;
	Tue, 06 Oct 2020 10:36:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QotJhllZSzYAfh7UrMer+xRYu18AB20FrNgatrvs4ts=; b=sOkm8TrcV2KiJfP6UxZ1E82WsP
	GO6VjdMbxe3n1zbI/wknrsa0yCWDYaoYisnnykSLYuxwJhqOsnyQa68U2E6Eo9yrEZD0rqo4cmh6w
	vx4e53d3MZtVe+S1OsA/51u+jKedbQG8hCfYVp32wbx7TZrB+gBl48QESjJyIcvA0Vrw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKs-0001MU-FS
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkKs-0007eW-Eq
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kPkKs-0007eW-Eq@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:46 +0000

commit 61d4a04349895edc5a5868274b906ba61ef24f47
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jun 26 14:56:23 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Sep 24 21:02:35 2020 +0100

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 71a00e846b..44a110b9c8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -313,7 +313,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:36:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:36:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3175.9169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkL4-00011V-WF; Tue, 06 Oct 2020 10:36:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3175.9169; Tue, 06 Oct 2020 10:36:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkL4-00011F-Sf; Tue, 06 Oct 2020 10:36:58 +0000
Received: by outflank-mailman (input) for mailman id 3175;
 Tue, 06 Oct 2020 10:36:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkL3-000112-DZ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8e137f6f-0f47-456f-9670-3a2669134da7;
 Tue, 06 Oct 2020 10:36:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkL2-0001O7-IN
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkL2-0007fa-Hf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkL3-000112-DZ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:57 +0000
X-Inumbo-ID: 8e137f6f-0f47-456f-9670-3a2669134da7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8e137f6f-0f47-456f-9670-3a2669134da7;
	Tue, 06 Oct 2020 10:36:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ul4DM/2M/eXTHSJrOkEol6zJWKcGjhRjc97zLh7Pr7k=; b=qiBNxzJGrFMM3Ubx3SBT+b3qc+
	WwWhjKHxcj3F2KJMxZv1jLQlKnWFRc77WKyBm4nre5kRT4shVQ6YS2a6Mgqr+N6b4t6XQ6FzpQVqA
	AkxUuzSbjHNQVPwjhC6F+OogG/GO2smXJ15O/HeHTMc36xMZJawI/Lg2bONQKLePZRhI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkL2-0001O7-IN
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkL2-0007fa-Hf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:36:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kPkL2-0007fa-Hf@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:36:56 +0000

commit 5bcac985498ed83d89666959175ca9c9ed561ae1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 29 11:32:37 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Sep 24 21:02:35 2020 +0100

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 73619f57ca..3b2136b272 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -119,7 +119,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 44a110b9c8..000eb9722b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -182,7 +182,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -213,7 +213,7 @@ restore_all_guest:
         movq  8(%rsp), %rcx           # RIP
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3178.9184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLE-00014M-ID; Tue, 06 Oct 2020 10:37:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3178.9184; Tue, 06 Oct 2020 10:37:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLE-00014C-Ab; Tue, 06 Oct 2020 10:37:08 +0000
Received: by outflank-mailman (input) for mailman id 3178;
 Tue, 06 Oct 2020 10:37:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkLD-00013G-JR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ad5ab1fd-e146-4d81-a6f3-68ff91bd6592;
 Tue, 06 Oct 2020 10:37:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLC-0001Oc-LX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLC-0007gd-Kn
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkLD-00013G-JR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:07 +0000
X-Inumbo-ID: ad5ab1fd-e146-4d81-a6f3-68ff91bd6592
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ad5ab1fd-e146-4d81-a6f3-68ff91bd6592;
	Tue, 06 Oct 2020 10:37:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kFpf/PMZgAr2hZjIzfCHOLAkKAIvoUR1j9NidJC7LlA=; b=WvAXKgwEE3MxA1WLzh5CQ/Mrs6
	ehYQIxeruMt78GOu9aKSTciaaFEWP//PabOKSbkXaFULRXoha2OtJO3TPR/wOz70kEzNDKEgcltdE
	EXfOTWWiE/naJenTVF2ABPqkNn3wB0eNJ7eb+kRdxMFil/obnOU3b1ubek6dCmzO6Lsg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLC-0001Oc-LX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLC-0007gd-Kn
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: some easy constification
Message-Id: <E1kPkLC-0007gd-Kn@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:06 +0000

commit 643e2f3cbb3b607f3365b230f439845e9bf113b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 10:39:47 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 10:39:47 2020 +0200

    EFI: some easy constification
    
    Inspired by some of Trammell's suggestions, this harvests some low
    hanging fruit, without needing to be concerned about the definitions of
    the EFI interfaces themselves.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/efi/efi-boot.h | 7 ++++---
 xen/arch/x86/efi/efi-boot.h | 7 ++++---
 xen/common/efi/boot.c       | 6 +++---
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 6527cb0bdf..27dd0b1a94 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -420,7 +420,7 @@ static void __init efi_arch_memory_setup(void)
 
 static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
                                            CHAR16 *cmdline_options,
-                                           char *cfgfile_options)
+                                           const char *cfgfile_options)
 {
     union string name;
     char *buf;
@@ -481,8 +481,9 @@ static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
     efi_bs->FreePool(buf);
 }
 
-static void __init efi_arch_handle_module(struct file *file, const CHAR16 *name,
-                                          char *options)
+static void __init efi_arch_handle_module(const struct file *file,
+                                          const CHAR16 *name,
+                                          const char *options)
 {
     int node;
     int chosen;
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 7188c9a551..eef3f52789 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -294,7 +294,7 @@ static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *sect
 
 static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
                                            CHAR16 *cmdline_options,
-                                           char *cfgfile_options)
+                                           const char *cfgfile_options)
 {
     union string name;
 
@@ -635,8 +635,9 @@ static void __init efi_arch_memory_setup(void)
 #undef l2_4G_offset
 }
 
-static void __init efi_arch_handle_module(struct file *file, const CHAR16 *name,
-                                          char *options)
+static void __init efi_arch_handle_module(const struct file *file,
+                                          const CHAR16 *name,
+                                          const char *options)
 {
     union string local_name;
     void *ptr;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 523fda41fd..157fe0e8c5 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -120,7 +120,7 @@ static char *split_string(char *s);
 static CHAR16 *s2w(union string *str);
 static char *w2s(const union string *str);
 static bool read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
-                      struct file *file, char *options);
+                      struct file *file, const char *options);
 static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
@@ -540,7 +540,7 @@ static char * __init split_string(char *s)
 }
 
 static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
-                             struct file *file, char *options)
+                             struct file *file, const char *options)
 {
     EFI_FILE_HANDLE FileHandle = NULL;
     UINT64 size;
@@ -1101,7 +1101,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     union string section = { NULL }, name;
     bool base_video = false;
-    char *option_str;
+    const char *option_str;
     bool use_cfg_file;
 
     __set_bit(EFI_BOOT, &efi_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3179.9191 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLO-00017H-Ft; Tue, 06 Oct 2020 10:37:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3179.9191; Tue, 06 Oct 2020 10:37:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLO-000177-CX; Tue, 06 Oct 2020 10:37:18 +0000
Received: by outflank-mailman (input) for mailman id 3179;
 Tue, 06 Oct 2020 10:37:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkLN-00016v-RB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a7a39519-09b3-4195-9539-eeb02bb762fc;
 Tue, 06 Oct 2020 10:37:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLN-0001Om-30
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLM-0007hR-Nq
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkLN-00016v-RB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
X-Inumbo-ID: a7a39519-09b3-4195-9539-eeb02bb762fc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a7a39519-09b3-4195-9539-eeb02bb762fc;
	Tue, 06 Oct 2020 10:37:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yhIedVJTllwW/NodMgW9CnwlFOhqUMXrh40RvQZpsJM=; b=sYheUKfqrFV1KT7P08sqnPeh1e
	pqPGgjgr7adqn5RuMtHc0j7BQq/JIW3d8NpS3F8kE1LTUAdZ3LHVZcG97YT/QKEUEVANZdLSq+9rA
	/QLi63W2AeNtuAVBkfmDXjBVTAhkgodht5HVTp+wdOo8yAPFEkG4VBA+kZwZxazKVe0o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLN-0001Om-30
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLM-0007hR-Nq
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] common/Kconfig: sort HAS_*
Message-Id: <E1kPkLM-0007hR-Nq@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:16 +0000

commit fe41405f5ee650d3fe39105cf59193b1494cdcdc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 10:40:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 10:40:53 2020 +0200

    common/Kconfig: sort HAS_*
    
    Later additions look to have been put at the end, with MEM_ACCESS*
    somewhere in the middle. Re-sort this part of the file, in the hope that
    future additions will be made noticing the intentions here.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/Kconfig | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 15e3b79ff5..3e2cf25088 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -34,16 +34,11 @@ config HAS_EX_TABLE
 config HAS_FAST_MULTIPLY
 	bool
 
-config MEM_ACCESS_ALWAYS_ON
+config HAS_IOPORTS
 	bool
 
-config MEM_ACCESS
-	def_bool MEM_ACCESS_ALWAYS_ON
-	prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
-	---help---
-
-	  Framework to configure memory access types for guests and receive
-	  related events in userspace.
+config HAS_KEXEC
+	bool
 
 config HAS_MEM_PAGING
 	bool
@@ -51,17 +46,22 @@ config HAS_MEM_PAGING
 config HAS_PDX
 	bool
 
-config HAS_UBSAN
+config HAS_SCHED_GRANULARITY
 	bool
 
-config HAS_KEXEC
+config HAS_UBSAN
 	bool
 
-config HAS_IOPORTS
+config MEM_ACCESS_ALWAYS_ON
 	bool
 
-config HAS_SCHED_GRANULARITY
-	bool
+config MEM_ACCESS
+	def_bool MEM_ACCESS_ALWAYS_ON
+	prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
+	---help---
+
+	  Framework to configure memory access types for guests and receive
+	  related events in userspace.
 
 config NEEDS_LIBELF
 	bool
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3180.9196 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLY-0001AD-Hx; Tue, 06 Oct 2020 10:37:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3180.9196; Tue, 06 Oct 2020 10:37:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLY-0001A2-EB; Tue, 06 Oct 2020 10:37:28 +0000
Received: by outflank-mailman (input) for mailman id 3180;
 Tue, 06 Oct 2020 10:37:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkLX-00019o-Sy
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2cd58ee-8edd-4c66-b3e5-8f2219f757c2;
 Tue, 06 Oct 2020 10:37:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLX-0001Ot-5x
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLX-0007iz-5H
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkLX-00019o-Sy
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
X-Inumbo-ID: a2cd58ee-8edd-4c66-b3e5-8f2219f757c2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2cd58ee-8edd-4c66-b3e5-8f2219f757c2;
	Tue, 06 Oct 2020 10:37:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/M7LFhYupEPkQJQpNjtMHPo7lfcJkn64HjrDnjpN+Lc=; b=Bju/9CQLZj37dcF0AeIkocnaVR
	3Lj9VY1IDG25xiQoSGqWtJ9xQqGylI48ogHsMUVhH4Ci1RIPfr+IInb+dGy6LybwkSiPeT8/n0xwl
	kl8KEsLJkTfZnml5LwSTpTftZZjW58zYOaTNQJo8MUwnijrzdgZuswY4ACcVNQMQ57yA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLX-0001Ot-5x
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLX-0007iz-5H
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hpet: remove hpet_msi_read
Message-Id: <E1kPkLX-0007iz-5H@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:27 +0000

commit f9ffd20f946c0315937f85d2f124a9bc4be49473
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Sep 28 10:41:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 10:41:48 2020 +0200

    x86/hpet: remove hpet_msi_read
    
    It's dead code, even more now that read_msi_msg has been removed.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hpet.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 154c67423b..a55e68e6f7 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -268,16 +268,6 @@ static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
     return 0;
 }
 
-static void __maybe_unused
-hpet_msi_read(struct hpet_event_channel *ch, struct msi_msg *msg)
-{
-    msg->data = hpet_read32(HPET_Tn_ROUTE(ch->idx));
-    msg->address_lo = hpet_read32(HPET_Tn_ROUTE(ch->idx) + 4);
-    msg->address_hi = MSI_ADDR_BASE_HI;
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(&ch->msi, msg);
-}
-
 static unsigned int hpet_msi_startup(struct irq_desc *desc)
 {
     hpet_msi_unmask(desc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3181.9198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLj-0001CM-Ik; Tue, 06 Oct 2020 10:37:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3181.9198; Tue, 06 Oct 2020 10:37:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLj-0001CE-Fm; Tue, 06 Oct 2020 10:37:39 +0000
Received: by outflank-mailman (input) for mailman id 3181;
 Tue, 06 Oct 2020 10:37:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkLi-0001C4-O5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c062032e-7851-4cd0-aefc-bff970c35b9b;
 Tue, 06 Oct 2020 10:37:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLh-0001Pe-98
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLh-0007jt-8R
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkLi-0001C4-O5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:38 +0000
X-Inumbo-ID: c062032e-7851-4cd0-aefc-bff970c35b9b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c062032e-7851-4cd0-aefc-bff970c35b9b;
	Tue, 06 Oct 2020 10:37:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oDcUhc9frZQzJzipy1TSdsBL7vheIIP3dbCZrAV025w=; b=R0MiaexOh3cjtp+S7cWbr+JrZJ
	OFzlAk66Jb2ur1A03hVFIJPiHlEdntpoG8JXhZw9AC6rauO+81PUVcwMqugY+r8ac8Ha+VVsnwM6Y
	EpdzJ7okJMYJ5J+6EMPN1SYHqxTyFusvEsXyHdHL0U31gLlTVbDOue+olNXA1IPLs5dI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLh-0001Pe-98
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLh-0007jt-8R
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/iommu: remove code to fetch MSI message from remap table
Message-Id: <E1kPkLh-0007jt-8R@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:37 +0000

commit 28fb8cf323dd93f59a9c851c93ba9b79de8b1c4e
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Mon Sep 28 10:42:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 10:42:29 2020 +0200

    x86/iommu: remove code to fetch MSI message from remap table
    
    Remove the code to compose a MSI message based on the information from
    the MSI registers and the data in the interrupt remapping table.
    Since the removal of read_msi_msg and its user there's no longer a
    need for such code, as the last written (untranslated) MSI message is
    cached internally by Xen.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/amd/iommu.h         |  2 -
 xen/drivers/passthrough/amd/iommu_intr.c    | 41 ----------------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  1 -
 xen/drivers/passthrough/pci.c               |  7 ---
 xen/drivers/passthrough/vtd/extern.h        |  1 -
 xen/drivers/passthrough/vtd/intremap.c      | 76 -----------------------------
 xen/drivers/passthrough/vtd/iommu.c         |  1 -
 xen/include/xen/iommu.h                     |  1 -
 8 files changed, 130 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h
index f1f0415469..28a44ceb85 100644
--- a/xen/drivers/passthrough/amd/iommu.h
+++ b/xen/drivers/passthrough/amd/iommu.h
@@ -277,8 +277,6 @@ unsigned int amd_iommu_read_ioapic_from_ire(
     unsigned int apic, unsigned int reg);
 int amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg);
-void amd_iommu_read_msi_from_ire(
-    struct msi_desc *msi_desc, struct msi_msg *msg);
 int amd_setup_hpet_msi(struct msi_desc *msi_desc);
 void amd_iommu_dump_intremap_tables(unsigned char key);
 
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 0adee53fb8..d78bb209bc 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -659,47 +659,6 @@ int amd_iommu_msi_msg_update_ire(
     return rc;
 }
 
-void amd_iommu_read_msi_from_ire(
-    struct msi_desc *msi_desc, struct msi_msg *msg)
-{
-    unsigned int offset = msg->data & (INTREMAP_MAX_ENTRIES - 1);
-    const struct pci_dev *pdev = msi_desc->dev;
-    u16 bdf = pdev ? PCI_BDF2(pdev->bus, pdev->devfn) : hpet_sbdf.bdf;
-    u16 seg = pdev ? pdev->seg : hpet_sbdf.seg;
-    const struct amd_iommu *iommu = _find_iommu_for_device(seg, bdf);
-    union irte_ptr entry;
-
-    if ( IS_ERR_OR_NULL(iommu) )
-        return;
-
-    entry = get_intremap_entry(iommu, get_dma_requestor_id(seg, bdf), offset);
-
-    if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI )
-    {
-        int nr = msi_desc->msi_attrib.entry_nr;
-
-        ASSERT(!(offset & (msi_desc[-nr].msi.nvec - 1)));
-        offset |= nr;
-    }
-
-    msg->data &= ~(INTREMAP_MAX_ENTRIES - 1);
-    /* The IntType fields match for both formats. */
-    msg->data |= MASK_INSR(entry.ptr32->flds.int_type,
-                           MSI_DATA_DELIVERY_MODE_MASK);
-    if ( iommu->ctrl.ga_en )
-    {
-        msg->data |= MASK_INSR(entry.ptr128->full.vector,
-                               MSI_DATA_VECTOR_MASK);
-        msg->dest32 = get_full_dest(entry.ptr128);
-    }
-    else
-    {
-        msg->data |= MASK_INSR(entry.ptr32->flds.vector,
-                               MSI_DATA_VECTOR_MASK);
-        msg->dest32 = entry.ptr32->flds.dest;
-    }
-}
-
 int amd_iommu_free_intremap_table(
     const struct amd_iommu *iommu, struct ivrs_mappings *ivrs_mapping,
     uint16_t bdf)
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 3390c22cf3..304363f5d2 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -572,7 +572,6 @@ static const struct iommu_ops __initconstrel _iommu_ops = {
     .update_ire_from_apic = amd_iommu_ioapic_update_ire,
     .update_ire_from_msi = amd_iommu_msi_msg_update_ire,
     .read_apic_from_ire = amd_iommu_read_ioapic_from_ire,
-    .read_msi_from_ire = amd_iommu_read_msi_from_ire,
     .setup_hpet_msi = amd_setup_hpet_msi,
     .adjust_irq_affinities = iov_adjust_irq_affinities,
     .suspend = amd_iommu_suspend,
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index e54974bcb0..b035067975 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1382,13 +1382,6 @@ int iommu_update_ire_from_msi(
            ? iommu_call(&iommu_ops, update_ire_from_msi, msi_desc, msg) : 0;
 }
 
-void iommu_read_msi_from_ire(
-    struct msi_desc *msi_desc, struct msi_msg *msg)
-{
-    if ( iommu_intremap )
-        iommu_vcall(&iommu_ops, read_msi_from_ire, msi_desc, msg);
-}
-
 static int iommu_add_device(struct pci_dev *pdev)
 {
     const struct domain_iommu *hd;
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index ada3c3098c..ad6c5f907b 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -85,7 +85,6 @@ void io_apic_write_remap_rte(unsigned int apic,
 
 struct msi_desc;
 struct msi_msg;
-void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
 int msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
 
 int intel_setup_hpet_msi(struct msi_desc *);
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 0d2a9d78de..d0f70d90eb 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -532,68 +532,6 @@ static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
    }
 }
 
-static int remap_entry_to_msi_msg(
-    struct vtd_iommu *iommu, struct msi_msg *msg, unsigned int index)
-{
-    struct iremap_entry *iremap_entry = NULL, *iremap_entries;
-    struct msi_msg_remap_entry *remap_rte;
-    unsigned long flags;
-
-    remap_rte = (struct msi_msg_remap_entry *) msg;
-    index += (remap_rte->address_lo.index_15 << 15) |
-             remap_rte->address_lo.index_0_14;
-
-    if ( index >= IREMAP_ENTRY_NR )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "MSI index (%d) for remap table is invalid\n",
-                index);
-        return -EFAULT;
-    }
-
-    spin_lock_irqsave(&iommu->intremap.lock, flags);
-
-    GET_IREMAP_ENTRY(iommu->intremap.maddr, index,
-                     iremap_entries, iremap_entry);
-
-    if ( iremap_entry->val == 0 )
-    {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "MSI index (%d) has an empty entry\n",
-                index);
-        unmap_vtd_domain_page(iremap_entries);
-        spin_unlock_irqrestore(&iommu->intremap.lock, flags);
-        return -EFAULT;
-    }
-
-    msg->address_hi = MSI_ADDR_BASE_HI;
-    msg->address_lo =
-        MSI_ADDR_BASE_LO |
-        ((iremap_entry->remap.dm == 0) ?
-            MSI_ADDR_DESTMODE_PHYS:
-            MSI_ADDR_DESTMODE_LOGIC) |
-        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
-            MSI_ADDR_REDIRECTION_CPU:
-            MSI_ADDR_REDIRECTION_LOWPRI);
-    if ( x2apic_enabled )
-        msg->dest32 = iremap_entry->remap.dst;
-    else
-        msg->dest32 = (iremap_entry->remap.dst >> 8) & 0xff;
-    msg->address_lo |= MSI_ADDR_DEST_ID(msg->dest32);
-
-    msg->data =
-        MSI_DATA_TRIGGER_EDGE |
-        MSI_DATA_LEVEL_ASSERT |
-        ((iremap_entry->remap.dlm != dest_LowestPrio) ?
-            MSI_DATA_DELIVERY_FIXED:
-            MSI_DATA_DELIVERY_LOWPRI) |
-        iremap_entry->remap.vector;
-
-    unmap_vtd_domain_page(iremap_entries);
-    spin_unlock_irqrestore(&iommu->intremap.lock, flags);
-    return 0;
-}
-
 static int msi_msg_to_remap_entry(
     struct vtd_iommu *iommu, struct pci_dev *pdev,
     struct msi_desc *msi_desc, struct msi_msg *msg)
@@ -701,20 +639,6 @@ static int msi_msg_to_remap_entry(
     return 0;
 }
 
-void msi_msg_read_remap_rte(
-    struct msi_desc *msi_desc, struct msi_msg *msg)
-{
-    struct pci_dev *pdev = msi_desc->dev;
-    struct acpi_drhd_unit *drhd = NULL;
-
-    drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
-                : hpet_to_drhd(msi_desc->hpet_id);
-    if ( drhd )
-        remap_entry_to_msi_msg(drhd->iommu, msg,
-                               msi_desc->msi_attrib.type == PCI_CAP_ID_MSI
-                               ? msi_desc->msi_attrib.entry_nr : 0);
-}
-
 int msi_msg_write_remap_rte(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 68cf0e535a..f6c4021fd6 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2714,7 +2714,6 @@ static struct iommu_ops __initdata vtd_ops = {
     .update_ire_from_apic = io_apic_write_remap_rte,
     .update_ire_from_msi = msi_msg_write_remap_rte,
     .read_apic_from_ire = io_apic_read_remap_rte,
-    .read_msi_from_ire = msi_msg_read_remap_rte,
     .setup_hpet_msi = intel_setup_hpet_msi,
     .adjust_irq_affinities = adjust_vtd_irq_affinities,
     .suspend = vtd_suspend,
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 13f68dc93d..191021870f 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -194,7 +194,6 @@ struct msi_desc;
 struct msi_msg;
 
 int iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
-void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 
 #define PT_IRQ_TIME_OUT MILLISECS(8)
 #endif /* HAS_PCI */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3183.9204 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLt-0001E1-LY; Tue, 06 Oct 2020 10:37:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3183.9204; Tue, 06 Oct 2020 10:37:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkLt-0001Dt-HP; Tue, 06 Oct 2020 10:37:49 +0000
Received: by outflank-mailman (input) for mailman id 3183;
 Tue, 06 Oct 2020 10:37:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkLs-0001Dh-55
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id accf1b7d-f1dd-4957-a2b4-f89871158e8c;
 Tue, 06 Oct 2020 10:37:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLr-0001Pm-C4
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkLr-0007kv-BR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkLs-0001Dh-55
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:48 +0000
X-Inumbo-ID: accf1b7d-f1dd-4957-a2b4-f89871158e8c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id accf1b7d-f1dd-4957-a2b4-f89871158e8c;
	Tue, 06 Oct 2020 10:37:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u7GPoBVbq6PDp6QDVSJTsZZqrS8TFbeNxhdtblwA/9Y=; b=DopOJOUIFdfG381CKxQDL3zeHY
	giZX0FGKcdZorxtBwYu2v5dswP/fXD8YXZLEAwV9bKimJvKuAHdtAHqyl1Xus1dOrCdfTq3eG3L+l
	zLR4/g/IDSe/JOZGpGSCgAgKEOlQCs2MaAMMm/98dBhngzW9Hy/wguEE1ptB6UHo8mqU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLr-0001Pm-C4
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkLr-0007kv-BR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/S3: fix shadow stack resume path
Message-Id: <E1kPkLr-0007kv-BR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:47 +0000

commit 4bdbf746ac9152e70f264f87db4472707da805ce
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Mon Sep 28 10:43:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Sep 28 10:43:10 2020 +0200

    x86/S3: fix shadow stack resume path
    
    Fix the resume path to load the shadow stack pointer from saved_ssp (not
    saved_rsp), to match what suspend path does.
    
    Fixes: 633ecc4a7cb2 ("x86/S3: Save and restore Shadow Stack configuration")
    Backport: 4.14
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index a2c41c4f3f..c6b3fcc93d 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -69,7 +69,7 @@ ENTRY(s3_resume)
          * so SETSSBSY will successfully load a value useful for us, then
          * reset MSR_PL0_SSP to its usual value and pop the temporary token.
          */
-        mov     saved_rsp(%rip), %rdi
+        mov     saved_ssp(%rip), %rdi
         cmpq    $1, %rdi
         je      .L_shstk_done
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:37:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:37:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3184.9207 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkM3-0001GA-NS; Tue, 06 Oct 2020 10:37:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3184.9207; Tue, 06 Oct 2020 10:37:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkM3-0001G2-KP; Tue, 06 Oct 2020 10:37:59 +0000
Received: by outflank-mailman (input) for mailman id 3184;
 Tue, 06 Oct 2020 10:37:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkM2-0001FO-8h
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8d72268d-2807-48b2-b20b-43ee510ca730;
 Tue, 06 Oct 2020 10:37:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkM1-0001Pw-F0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkM1-0007mU-EL
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkM2-0001FO-8h
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:58 +0000
X-Inumbo-ID: 8d72268d-2807-48b2-b20b-43ee510ca730
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8d72268d-2807-48b2-b20b-43ee510ca730;
	Tue, 06 Oct 2020 10:37:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NVhAhUb2rMn3EZLzBYbWyXCEVgknNsp6Wy2ddE6l9V0=; b=QMfTFGnetZQZs+w2mB1xnyYviq
	U7+RMPauSEblx34dZnnHukHzP3nSRzLi9tOSNGFBATgZ4KxXjdPST9p5PSEw5PLvZhsnGc2QPHW6N
	55zeF8xEkMb5T39WFrUeTvuGqDPUxY3ZlKwgf7tYdx1Pf9heMEEf8FsTZCgIKh3oDsmY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkM1-0001Pw-F0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkM1-0007mU-EL
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:37:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns
Message-Id: <E1kPkM1-0007mU-EL@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:37:57 +0000

commit f6790389613cd54775ece6575013a679572b46b3
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 20:31:04 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Sep 28 18:42:54 2020 +0100

    xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns
    
    Some callers of vcpu_pause() will expect to access the latest vcpu
    context when the function returns (see XENDOMCTL_{set,get}vcpucontext}.
    
    However, the latest vCPU context can only be observed after
    v->is_running has been observed to be false.
    
    As there is no memory barrier instruction generated, a processor could
    try to speculatively access the vCPU context before it was observed.
    
    To prevent the corruption of the vCPU context, we need to insert a
    memory barrier instruction after v->is_running is observed and before
    the context is accessed. This barrier is added in sync_vcpu_execstate()
    as it seems to be the place where we expect the synchronization to
    happen.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/domain.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 9258f6d3fa..3b37f899b9 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -371,7 +371,20 @@ void sync_local_execstate(void)
 
 void sync_vcpu_execstate(struct vcpu *v)
 {
-    /* Nothing to do -- no lazy switching */
+    /*
+     * We don't support lazy switching.
+     *
+     * However the context may have been saved from a remote pCPU so we
+     * need a barrier to ensure it is observed before continuing.
+     *
+     * Per vcpu_context_saved(), the context can be observed when
+     * v->is_running is false (the caller should check it before calling
+     * this function).
+     *
+     * Note this is a full barrier to also prevent update of the context
+     * to happen before it was observed.
+     */
+    smp_mb();
 }
 
 #define NEXT_ARG(fmt, args)                                                 \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:38:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:38:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3185.9212 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMD-0001Hj-PS; Tue, 06 Oct 2020 10:38:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3185.9212; Tue, 06 Oct 2020 10:38:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMD-0001HZ-M4; Tue, 06 Oct 2020 10:38:09 +0000
Received: by outflank-mailman (input) for mailman id 3185;
 Tue, 06 Oct 2020 10:38:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkMC-0001HN-C7
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2fa5c4b0-c5d1-4034-bbd6-180f2ae598eb;
 Tue, 06 Oct 2020 10:38:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMB-0001QH-Ip
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMB-0007nd-HL
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkMC-0001HN-C7
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:08 +0000
X-Inumbo-ID: 2fa5c4b0-c5d1-4034-bbd6-180f2ae598eb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2fa5c4b0-c5d1-4034-bbd6-180f2ae598eb;
	Tue, 06 Oct 2020 10:38:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pFOnOnFcS7Uzte7Y6+HmrE5pOLWKiNgtB/8rTkKV+bI=; b=3YE+KGiEV0Ofp0UapXgHdyaJxc
	93qw/YCb0cvok2TFSwfEsHS/Lsh6z/KTQ4z6NAK9V/QhwgcVTvsbpysWdIXwpLBBSOSLwdnUxcBgs
	POjIYM7s755W60jKXhlRPvqH9DiRE00duLVnrq/LSjXKPxtA59Z1KnLncuOJiQgTKsxU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMB-0001QH-Ip
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMB-0007nd-HL
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
Message-Id: <E1kPkMB-0007nd-HL@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:07 +0000

commit 28804c0ce9fde36feec04ad7f57b2683875da8a0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Wed Sep 23 09:28:32 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Mon Sep 28 18:44:48 2020 +0100

    SUPPORT.MD: Clarify the support state for the Arm SMMUv{1, 2} drivers
    
    SMMUv{1, 2} are both marked as security supported, so we would
    technically have to issue an XSA for any IOMMU security bug.
    
    However, at the moment, device passthrough is not security supported
    on Arm and there is no plan to change that in the next few months.
    
    Therefore, mark Arm SMMUv{1, 2} as supported but not security supported.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 SUPPORT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 25987ec1df..f35943a432 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -62,8 +62,8 @@ supported in this document.
 
     Status, AMD IOMMU: Supported
     Status, Intel VT-d: Supported
-    Status, ARM SMMUv1: Supported
-    Status, ARM SMMUv2: Supported
+    Status, ARM SMMUv1: Supported, not security supported
+    Status, ARM SMMUv2: Supported, not security supported
     Status, Renesas IPMMU-VMSA: Supported, not security supported
 
 ### ARM/GICv3 ITS
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:38:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:38:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3186.9215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMN-0001Is-Qn; Tue, 06 Oct 2020 10:38:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3186.9215; Tue, 06 Oct 2020 10:38:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMN-0001Ik-Nk; Tue, 06 Oct 2020 10:38:19 +0000
Received: by outflank-mailman (input) for mailman id 3186;
 Tue, 06 Oct 2020 10:38:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkMM-0001Ia-My
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2cf89f8-a9ac-4974-bbc0-3767956bd98a;
 Tue, 06 Oct 2020 10:38:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkML-0001QP-NI
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkML-0007oJ-LR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkMM-0001Ia-My
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:18 +0000
X-Inumbo-ID: a2cf89f8-a9ac-4974-bbc0-3767956bd98a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2cf89f8-a9ac-4974-bbc0-3767956bd98a;
	Tue, 06 Oct 2020 10:38:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kZhz8BwfWZ0XSoIgV2nKq+0/oby5oyJg+3VtsspHeKc=; b=I8gsjE1m+QQo9BaTPi5UnDTzZt
	Nqhq8eAG1lO7UTa6d++1/2VCxt8PA9mJZ0PivEwEJR6JhqHzIqjlfoZt3Vw8fWi3lw+k2jk3cioVT
	anLXBsV4fvaYBZ5Y/cbb6GGBkFU/LiFDdYFc4YJELmcz4bDla69kla1MNcnhICznC35s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkML-0001QP-NI
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkML-0007oJ-LR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: introduce read_sregs() to allow storing to memory directly
Message-Id: <E1kPkML-0007oJ-LR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:17 +0000

commit 32a9ecca23b87db659c19fa5fc23c40309ba68ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:50:27 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:50:27 2020 +0200

    x86: introduce read_sregs() to allow storing to memory directly
    
    When storing all (data) segment registers in one go, prefer writing the
    selector values directly to memory (as opposed to read_sreg()).
    
    Also move the single register variant into the regs.h, dropping the
    unecessary "volatile" from the asm() (there are no hidden side effects).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c        |  5 +----
 xen/arch/x86/x86_64/traps.c  |  5 +----
 xen/include/asm-x86/regs.h   | 14 ++++++++++++++
 xen/include/asm-x86/system.h |  6 ------
 4 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index e8e91cf080..4273d272e7 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1703,10 +1703,7 @@ static void save_segments(struct vcpu *v)
 {
     struct cpu_user_regs *regs = &v->arch.user_regs;
 
-    regs->ds = read_sreg(ds);
-    regs->es = read_sreg(es);
-    regs->fs = read_sreg(fs);
-    regs->gs = read_sreg(gs);
+    read_sregs(regs);
 
     if ( !is_pv_32bit_vcpu(v) )
     {
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 93af0c5e87..fd049c5e14 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -43,10 +43,7 @@ static void read_registers(struct cpu_user_regs *regs, unsigned long crs[8])
     crs[2] = read_cr2();
     crs[3] = read_cr3();
     crs[4] = read_cr4();
-    regs->ds = read_sreg(ds);
-    regs->es = read_sreg(es);
-    regs->fs = read_sreg(fs);
-    regs->gs = read_sreg(gs);
+    read_sregs(regs);
     crs[5] = rdfsbase();
     crs[6] = rdgsbase();
     crs[7] = rdgsshadow();
diff --git a/xen/include/asm-x86/regs.h b/xen/include/asm-x86/regs.h
index dc00b854e3..8d984ea388 100644
--- a/xen/include/asm-x86/regs.h
+++ b/xen/include/asm-x86/regs.h
@@ -15,4 +15,18 @@
     (diff == 0);                                                              \
 })
 
+#define read_sreg(name) ({                           \
+    unsigned int __sel;                              \
+    asm ( "mov %%" STR(name) ",%0" : "=r" (__sel) ); \
+    __sel;                                           \
+})
+
+static inline void read_sregs(struct cpu_user_regs *regs)
+{
+    asm ( "mov %%ds, %0" : "=m" (regs->ds) );
+    asm ( "mov %%es, %0" : "=m" (regs->es) );
+    asm ( "mov %%fs, %0" : "=m" (regs->fs) );
+    asm ( "mov %%gs, %0" : "=m" (regs->gs) );
+}
+
 #endif /* __X86_REGS_H__ */
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 7e5891f3df..45c183bd10 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -5,12 +5,6 @@
 #include <xen/bitops.h>
 #include <asm/processor.h>
 
-#define read_sreg(name)                                         \
-({  unsigned int __sel;                                         \
-    asm volatile ( "mov %%" STR(name) ",%0" : "=r" (__sel) );   \
-    __sel;                                                      \
-})
-
 static inline void wbinvd(void)
 {
     asm volatile ( "wbinvd" ::: "memory" );
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:38:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:38:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3187.9219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMX-0001KT-SX; Tue, 06 Oct 2020 10:38:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3187.9219; Tue, 06 Oct 2020 10:38:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMX-0001KL-PT; Tue, 06 Oct 2020 10:38:29 +0000
Received: by outflank-mailman (input) for mailman id 3187;
 Tue, 06 Oct 2020 10:38:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkMW-0001KA-LT
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5d7ab346-eb00-48f9-88f3-53441127a233;
 Tue, 06 Oct 2020 10:38:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMV-0001QX-Sy
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMV-0007p8-Pd
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkMW-0001KA-LT
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:28 +0000
X-Inumbo-ID: 5d7ab346-eb00-48f9-88f3-53441127a233
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5d7ab346-eb00-48f9-88f3-53441127a233;
	Tue, 06 Oct 2020 10:38:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ELQP3Mm3ybceSyMwG/6z7t0Otk803MiMqBtd/CQag0=; b=6zFSeORw4hU03V4QgRcVleM+/b
	Bv5vsHoF7tEb+U2fPMMtYw9ytKJdMhPX3teEDqfOvq21kpKQ9NbAqJa1Taaq8ivM2uTCQNZlCYZ7W
	gWa/uFeURKUqZk6qHhty91em+zfcei3vzrUMNQf1OVjbWNc4TSdVBtfm38KzYCxSa/xY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMV-0001QX-Sy
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMV-0007p8-Pd
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ELF: don't open-code read_sreg()
Message-Id: <E1kPkMV-0007p8-Pd@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:27 +0000

commit 5be4ce01d0fe412230da6825f98cf08a6b4094fe
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:51:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:51:12 2020 +0200

    x86/ELF: don't open-code read_sreg()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/x86_64/elf.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/elf.h b/xen/include/asm-x86/x86_64/elf.h
index 174c9dffba..09b286422d 100644
--- a/xen/include/asm-x86/x86_64/elf.h
+++ b/xen/include/asm-x86/x86_64/elf.h
@@ -1,6 +1,8 @@
 #ifndef __X86_64_ELF_H__
 #define __X86_64_ELF_H__
 
+#include <asm/regs.h>
+
 typedef struct {
     unsigned long r15;
     unsigned long r14;
@@ -53,16 +55,16 @@ static inline void elf_core_save_regs(ELF_Gregset *core_regs,
     asm volatile("movq %%rdi,%0" : "=m"(core_regs->rdi));
     /* orig_rax not filled in for now */
     core_regs->rip = (unsigned long)elf_core_save_regs;
-    asm volatile("movl %%cs, %%eax;" :"=a"(core_regs->cs));
+    core_regs->cs = read_sreg(cs);
     asm volatile("pushfq; popq %0" :"=m"(core_regs->rflags));
     asm volatile("movq %%rsp,%0" : "=m"(core_regs->rsp));
-    asm volatile("movl %%ss, %%eax;" :"=a"(core_regs->ss));
+    core_regs->ss = read_sreg(ss);
     /* thread_fs not filled in for now */
     /* thread_gs not filled in for now */
-    asm volatile("movl %%ds, %%eax;" :"=a"(core_regs->ds));
-    asm volatile("movl %%es, %%eax;" :"=a"(core_regs->es));
-    asm volatile("movl %%fs, %%eax;" :"=a"(core_regs->fs));
-    asm volatile("movl %%gs, %%eax;" :"=a"(core_regs->gs));
+    core_regs->ds = read_sreg(ds);
+    core_regs->es = read_sreg(es);
+    core_regs->fs = read_sreg(fs);
+    core_regs->gs = read_sreg(gs);
 
     asm volatile("mov %%cr0, %0" : "=r" (tmp) : );
     xen_core_regs->cr0 = tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:38:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:38:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3188.9223 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMh-0001Lu-UN; Tue, 06 Oct 2020 10:38:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3188.9223; Tue, 06 Oct 2020 10:38:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMh-0001Lk-R7; Tue, 06 Oct 2020 10:38:39 +0000
Received: by outflank-mailman (input) for mailman id 3188;
 Tue, 06 Oct 2020 10:38:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkMg-0001LZ-PS
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f9bf19dc-1697-48e9-86fc-678851944f3a;
 Tue, 06 Oct 2020 10:38:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMg-0001R5-09
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMf-0007qJ-VF
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkMg-0001LZ-PS
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:38 +0000
X-Inumbo-ID: f9bf19dc-1697-48e9-86fc-678851944f3a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f9bf19dc-1697-48e9-86fc-678851944f3a;
	Tue, 06 Oct 2020 10:38:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AipGAcqnEN2Myl7O7AdMxM4227JuIKGU2VqEe43kJHg=; b=2t08T48yEdDtzlqrCJF76M2VcJ
	dOcNKMtskt7D53g5j0zptUOAn2XjcWUBWNRR5dwlQw79PaUR/YkmmS1oiY6Ci9U93XXEViSp3zrmB
	FAn948Wlm3QpwA1hvQdpQ2d+Nhoc/wh/Xfo3ya/8XOhuIT8xFEcCPeRfjEOgJS/4SqF8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMg-0001R5-09
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMf-0007qJ-VF
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ELF: don't store function pointer in elf_core_save_regs()
Message-Id: <E1kPkMf-0007qJ-VF@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:37 +0000

commit 1e15dcfbaef6ef5b1cdba73408be6bd9dfc27fe9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:51:54 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:51:54 2020 +0200

    x86/ELF: don't store function pointer in elf_core_save_regs()
    
    This keeps at least gcc 10 from generating a separate function instance
    in common/kexec.o alongside the inlining of the function in its sole
    caller. I also think putting the address of the actual code storing the
    registers is a better indication to consumers than that of an otherwise
    unreferenced function.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/x86_64/elf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/x86_64/elf.h b/xen/include/asm-x86/x86_64/elf.h
index 09b286422d..43c9cf3a3f 100644
--- a/xen/include/asm-x86/x86_64/elf.h
+++ b/xen/include/asm-x86/x86_64/elf.h
@@ -54,7 +54,7 @@ static inline void elf_core_save_regs(ELF_Gregset *core_regs,
     asm volatile("movq %%rsi,%0" : "=m"(core_regs->rsi));
     asm volatile("movq %%rdi,%0" : "=m"(core_regs->rdi));
     /* orig_rax not filled in for now */
-    core_regs->rip = (unsigned long)elf_core_save_regs;
+    asm ( "call 0f; 0: popq %0" : "=m" (core_regs->rip) );
     core_regs->cs = read_sreg(cs);
     asm volatile("pushfq; popq %0" :"=m"(core_regs->rflags));
     asm volatile("movq %%rsp,%0" : "=m"(core_regs->rsp));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:38:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:38:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3189.9227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMr-0001NF-W8; Tue, 06 Oct 2020 10:38:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3189.9227; Tue, 06 Oct 2020 10:38:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkMr-0001N6-T0; Tue, 06 Oct 2020 10:38:49 +0000
Received: by outflank-mailman (input) for mailman id 3189;
 Tue, 06 Oct 2020 10:38:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkMq-0001My-TX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eb1c35b3-129b-4095-9df9-43d3e47abe8b;
 Tue, 06 Oct 2020 10:38:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMq-0001RI-4h
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkMq-0007rF-2N
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkMq-0001My-TX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
X-Inumbo-ID: eb1c35b3-129b-4095-9df9-43d3e47abe8b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eb1c35b3-129b-4095-9df9-43d3e47abe8b;
	Tue, 06 Oct 2020 10:38:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jR3cS8dfZXeqgJgZ35pRTfemyJzBtMwW+R8CQ+t5WpA=; b=uayWGcADM3JImPtdQc8YlI5sgf
	wtYFMjcQ/cXNaHRuwMc7GAOdI5lLnZHFG11Nv91m7XGXasWcXOTUqaO68MH3K8YmmJnY9yUfSZak6
	//7Eeak4KwimseKhMF+XamZNK6drlGJVneiY5BzNT3MlWVi8mQW5+eVMIgDstwAF8los=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMq-0001RI-4h
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkMq-0007rF-2N
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ELF: also record FS/GS bases in elf_core_save_regs()
Message-Id: <E1kPkMq-0007rF-2N@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:48 +0000

commit c8b2488a817b3aedbb10fad72d9d41911f40eb17
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:52:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:52:32 2020 +0200

    x86/ELF: also record FS/GS bases in elf_core_save_regs()
    
    No idea why this wasn't done before.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/x86_64/elf.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/elf.h b/xen/include/asm-x86/x86_64/elf.h
index 43c9cf3a3f..f9c2789b7e 100644
--- a/xen/include/asm-x86/x86_64/elf.h
+++ b/xen/include/asm-x86/x86_64/elf.h
@@ -1,6 +1,7 @@
 #ifndef __X86_64_ELF_H__
 #define __X86_64_ELF_H__
 
+#include <asm/msr.h>
 #include <asm/regs.h>
 
 typedef struct {
@@ -59,8 +60,8 @@ static inline void elf_core_save_regs(ELF_Gregset *core_regs,
     asm volatile("pushfq; popq %0" :"=m"(core_regs->rflags));
     asm volatile("movq %%rsp,%0" : "=m"(core_regs->rsp));
     core_regs->ss = read_sreg(ss);
-    /* thread_fs not filled in for now */
-    /* thread_gs not filled in for now */
+    rdmsrl(MSR_FS_BASE, core_regs->thread_fs);
+    rdmsrl(MSR_GS_BASE, core_regs->thread_gs);
     core_regs->ds = read_sreg(ds);
     core_regs->es = read_sreg(es);
     core_regs->fs = read_sreg(fs);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3190.9230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkN2-0001Qf-25; Tue, 06 Oct 2020 10:39:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3190.9230; Tue, 06 Oct 2020 10:39:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkN1-0001QX-Ul; Tue, 06 Oct 2020 10:38:59 +0000
Received: by outflank-mailman (input) for mailman id 3190;
 Tue, 06 Oct 2020 10:38:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkN1-0001P3-2T
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 490b8c4f-2def-4054-89d7-8e66b95748d0;
 Tue, 06 Oct 2020 10:38:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkN0-0001RQ-8A
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkN0-0007rr-72
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkN1-0001P3-2T
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:59 +0000
X-Inumbo-ID: 490b8c4f-2def-4054-89d7-8e66b95748d0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 490b8c4f-2def-4054-89d7-8e66b95748d0;
	Tue, 06 Oct 2020 10:38:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3gOl7fq8rCXN9ZQw3ccPzKHivchoigqEJsSqi96HWmM=; b=guVf0uiSpw7DobkorS/c4h+TXY
	IP3rHFWQhYNZlr6uN3sgRJL3vN0ESyuxparwQeD02LXDbbQEd2QopTn3/+L9TkltXIFNJln95HwZw
	pyqhqZTJ+3WIrt/wEWDZFcfBsGrQ+yTDU7bgRjJM183AlK3gD92398BqyIYEBU4JqBH4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkN0-0001RQ-8A
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkN0-0007rr-72
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:38:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ELF: eliminate pointless local variable from elf_core_save_regs()
Message-Id: <E1kPkN0-0007rr-72@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:38:58 +0000

commit 7c6084c1f37dff3fcc4edbf080d16dec676f55fb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:53:13 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:53:13 2020 +0200

    x86/ELF: eliminate pointless local variable from elf_core_save_regs()
    
    We can just as well specify the CRn structure fields directly in the
    asm()s, just like done for all other ones.
    
    Also drop the unecessary "volatile" from the asm()-s: There are no
    relevant hidden side effects.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/x86_64/elf.h | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/elf.h b/xen/include/asm-x86/x86_64/elf.h
index f9c2789b7e..0d5fce515a 100644
--- a/xen/include/asm-x86/x86_64/elf.h
+++ b/xen/include/asm-x86/x86_64/elf.h
@@ -37,8 +37,6 @@ typedef struct {
 static inline void elf_core_save_regs(ELF_Gregset *core_regs, 
                                       crash_xen_core_t *xen_core_regs)
 {
-    unsigned long tmp;
-
     asm volatile("movq %%r15,%0" : "=m"(core_regs->r15));
     asm volatile("movq %%r14,%0" : "=m"(core_regs->r14));
     asm volatile("movq %%r13,%0" : "=m"(core_regs->r13));
@@ -67,17 +65,10 @@ static inline void elf_core_save_regs(ELF_Gregset *core_regs,
     core_regs->fs = read_sreg(fs);
     core_regs->gs = read_sreg(gs);
 
-    asm volatile("mov %%cr0, %0" : "=r" (tmp) : );
-    xen_core_regs->cr0 = tmp;
-
-    asm volatile("mov %%cr2, %0" : "=r" (tmp) : );
-    xen_core_regs->cr2 = tmp;
-
-    asm volatile("mov %%cr3, %0" : "=r" (tmp) : );
-    xen_core_regs->cr3 = tmp;
-
-    asm volatile("mov %%cr4, %0" : "=r" (tmp) : );
-    xen_core_regs->cr4 = tmp;
+    asm ( "mov %%cr0, %0" : "=r" (xen_core_regs->cr0) );
+    asm ( "mov %%cr2, %0" : "=r" (xen_core_regs->cr2) );
+    asm ( "mov %%cr3, %0" : "=r" (xen_core_regs->cr3) );
+    asm ( "mov %%cr4, %0" : "=r" (xen_core_regs->cr4) );
 }
 
 #endif /* __X86_64_ELF_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3191.9235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkND-0001SV-59; Tue, 06 Oct 2020 10:39:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3191.9235; Tue, 06 Oct 2020 10:39:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkND-0001SO-25; Tue, 06 Oct 2020 10:39:11 +0000
Received: by outflank-mailman (input) for mailman id 3191;
 Tue, 06 Oct 2020 10:39:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNB-0001S9-Er
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 20fc7b1b-2db3-4860-80a2-ebafdd39e27f;
 Tue, 06 Oct 2020 10:39:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNA-0001Rt-B1
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNA-0007tM-AQ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNB-0001S9-Er
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:09 +0000
X-Inumbo-ID: 20fc7b1b-2db3-4860-80a2-ebafdd39e27f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 20fc7b1b-2db3-4860-80a2-ebafdd39e27f;
	Tue, 06 Oct 2020 10:39:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aoU6D/aCOylEUErfBVM63strs/vLwXwe+TO8K+LuXpM=; b=tKtZ3YSn5nWF+eOMZetuzZPCt3
	wOiCXVlg3G7jjYrR8DBSnYDmKOj01RS9XTcp81XtvAduqvBGYSu0QR4KiEoB04s8OuttwVIh8p1ym
	vCvLIysgJYww1WPpwUUsK709On0bCIcfh0vaf41YnnWcJNXL/8g+PAN5xW+3SPTnr32w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNA-0001Rt-B1
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNA-0007tM-AQ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ELF: drop unnecessary volatile from asm()-s in elf_core_save_regs()
Message-Id: <E1kPkNA-0007tM-AQ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:08 +0000

commit 358d57d411ee759a5a9dbf367179a9ac37faf0b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 29 10:53:54 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 29 10:53:54 2020 +0200

    x86/ELF: drop unnecessary volatile from asm()-s in elf_core_save_regs()
    
    There are no hidden side effects here.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/x86_64/elf.h | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/xen/include/asm-x86/x86_64/elf.h b/xen/include/asm-x86/x86_64/elf.h
index 0d5fce515a..00227e0e12 100644
--- a/xen/include/asm-x86/x86_64/elf.h
+++ b/xen/include/asm-x86/x86_64/elf.h
@@ -37,26 +37,27 @@ typedef struct {
 static inline void elf_core_save_regs(ELF_Gregset *core_regs, 
                                       crash_xen_core_t *xen_core_regs)
 {
-    asm volatile("movq %%r15,%0" : "=m"(core_regs->r15));
-    asm volatile("movq %%r14,%0" : "=m"(core_regs->r14));
-    asm volatile("movq %%r13,%0" : "=m"(core_regs->r13));
-    asm volatile("movq %%r12,%0" : "=m"(core_regs->r12));
-    asm volatile("movq %%rbp,%0" : "=m"(core_regs->rbp));
-    asm volatile("movq %%rbx,%0" : "=m"(core_regs->rbx));
-    asm volatile("movq %%r11,%0" : "=m"(core_regs->r11));
-    asm volatile("movq %%r10,%0" : "=m"(core_regs->r10));
-    asm volatile("movq %%r9,%0" : "=m"(core_regs->r9));
-    asm volatile("movq %%r8,%0" : "=m"(core_regs->r8));
-    asm volatile("movq %%rax,%0" : "=m"(core_regs->rax));
-    asm volatile("movq %%rcx,%0" : "=m"(core_regs->rcx));
-    asm volatile("movq %%rdx,%0" : "=m"(core_regs->rdx));
-    asm volatile("movq %%rsi,%0" : "=m"(core_regs->rsi));
-    asm volatile("movq %%rdi,%0" : "=m"(core_regs->rdi));
+    asm ( "movq %%r15, %0" : "=m" (core_regs->r15) );
+    asm ( "movq %%r14, %0" : "=m" (core_regs->r14) );
+    asm ( "movq %%r13, %0" : "=m" (core_regs->r13) );
+    asm ( "movq %%r12, %0" : "=m" (core_regs->r12) );
+    asm ( "movq %%rbp, %0" : "=m" (core_regs->rbp) );
+    asm ( "movq %%rbx, %0" : "=m" (core_regs->rbx) );
+    asm ( "movq %%r11, %0" : "=m" (core_regs->r11) );
+    asm ( "movq %%r10, %0" : "=m" (core_regs->r10) );
+    asm ( "movq %%r9, %0" : "=m" (core_regs->r9) );
+    asm ( "movq %%r8, %0" : "=m" (core_regs->r8) );
+    asm ( "movq %%rax, %0" : "=m" (core_regs->rax) );
+    asm ( "movq %%rcx, %0" : "=m" (core_regs->rcx) );
+    asm ( "movq %%rdx, %0" : "=m" (core_regs->rdx) );
+    asm ( "movq %%rsi, %0" : "=m" (core_regs->rsi) );
+    asm ( "movq %%rdi, %0" : "=m" (core_regs->rdi) );
+
     /* orig_rax not filled in for now */
     asm ( "call 0f; 0: popq %0" : "=m" (core_regs->rip) );
     core_regs->cs = read_sreg(cs);
-    asm volatile("pushfq; popq %0" :"=m"(core_regs->rflags));
-    asm volatile("movq %%rsp,%0" : "=m"(core_regs->rsp));
+    asm ( "pushfq; popq %0" : "=m" (core_regs->rflags) );
+    asm ( "movq %%rsp, %0" : "=m" (core_regs->rsp) );
     core_regs->ss = read_sreg(ss);
     rdmsrl(MSR_FS_BASE, core_regs->thread_fs);
     rdmsrl(MSR_GS_BASE, core_regs->thread_gs);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3193.9238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNN-0001Tt-6p; Tue, 06 Oct 2020 10:39:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3193.9238; Tue, 06 Oct 2020 10:39:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNN-0001Tl-3h; Tue, 06 Oct 2020 10:39:21 +0000
Received: by outflank-mailman (input) for mailman id 3193;
 Tue, 06 Oct 2020 10:39:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNL-0001Ta-L4
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7b3a7860-2172-44f2-8a5a-34ada9f707f7;
 Tue, 06 Oct 2020 10:39:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNK-0001SB-F0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNK-0007uH-Dt
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNL-0001Ta-L4
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:19 +0000
X-Inumbo-ID: 7b3a7860-2172-44f2-8a5a-34ada9f707f7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7b3a7860-2172-44f2-8a5a-34ada9f707f7;
	Tue, 06 Oct 2020 10:39:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2OcmysHx6eafZLNxm6426nYy3PhoTVvxA4HYpxtxGI=; b=wRBz9o4uQb0XXHMzcAiTr6YTWn
	4l9VCYuar2xne6URhT9hh/0rUkAUk7nxzUIZ4kEyfyRsvwYFPKIS5xIqdDjlwt+gh2Pc2/k0I1I60
	UQafLUAKK1MLXB3NctJtY+N32sVXGO6+Oy3phn3pxQQdjf50QFp/qisf4ZU0wZxNj2gE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNK-0001SB-F0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNK-0007uH-Dt
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/asm: Rename FS/GS base helpers
Message-Id: <E1kPkNK-0007uH-Dt@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:18 +0000

commit b18b8801d0457881282b9dde46ca1100bd5e6476
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 11 16:05:06 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Sep 29 13:46:13 2020 +0100

    x86/asm: Rename FS/GS base helpers
    
    They are currently named after the FSGSBASE instructions, but are not thin
    wrappers around said instructions, and therefore do not accurately reflect the
    logic they perform, especially when it comes to functioning safely in non
    FSGSBASE context.
    
    Rename them to {read,write}_{fs,gs}_base() to avoid confusion.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/domain.c             | 10 +++++-----
 xen/arch/x86/hvm/vmx/vmx.c        |  8 ++++----
 xen/arch/x86/pv/domain.c          |  2 +-
 xen/arch/x86/pv/emul-priv-op.c    | 14 +++++++-------
 xen/arch/x86/pv/misc-hypercalls.c |  8 ++++----
 xen/arch/x86/x86_64/traps.c       |  6 +++---
 xen/include/asm-x86/msr.h         | 12 ++++++------
 7 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4273d272e7..1cc85f4ab9 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1581,9 +1581,9 @@ static void load_segments(struct vcpu *n)
 
     if ( !fs_gs_done && !compat )
     {
-        wrfsbase(n->arch.pv.fs_base);
-        wrgsshadow(n->arch.pv.gs_base_kernel);
-        wrgsbase(n->arch.pv.gs_base_user);
+        write_fs_base(n->arch.pv.fs_base);
+        write_gs_shadow(n->arch.pv.gs_base_kernel);
+        write_gs_base(n->arch.pv.gs_base_user);
 
         /* If in kernel mode then switch the GS bases around. */
         if ( (n->arch.flags & TF_kernel_mode) )
@@ -1707,9 +1707,9 @@ static void save_segments(struct vcpu *v)
 
     if ( !is_pv_32bit_vcpu(v) )
     {
-        unsigned long gs_base = rdgsbase();
+        unsigned long gs_base = read_gs_base();
 
-        v->arch.pv.fs_base = rdfsbase();
+        v->arch.pv.fs_base = read_fs_base();
         if ( v->arch.flags & TF_kernel_mode )
             v->arch.pv.gs_base_kernel = gs_base;
         else
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 998f33fb03..95d109f962 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -512,12 +512,12 @@ static void vmx_save_guest_msrs(struct vcpu *v)
      * We cannot cache SHADOW_GS_BASE while the VCPU runs, as it can
      * be updated at any time via SWAPGS, which we cannot trap.
      */
-    v->arch.hvm.vmx.shadow_gs = rdgsshadow();
+    v->arch.hvm.vmx.shadow_gs = read_gs_shadow();
 }
 
 static void vmx_restore_guest_msrs(struct vcpu *v)
 {
-    wrgsshadow(v->arch.hvm.vmx.shadow_gs);
+    write_gs_shadow(v->arch.hvm.vmx.shadow_gs);
     wrmsrl(MSR_STAR,           v->arch.hvm.vmx.star);
     wrmsrl(MSR_LSTAR,          v->arch.hvm.vmx.lstar);
     wrmsrl(MSR_SYSCALL_MASK,   v->arch.hvm.vmx.sfmask);
@@ -2958,7 +2958,7 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
         break;
 
     case MSR_SHADOW_GS_BASE:
-        *msr_content = rdgsshadow();
+        *msr_content = read_gs_shadow();
         break;
 
     case MSR_STAR:
@@ -3182,7 +3182,7 @@ static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         else if ( msr == MSR_GS_BASE )
             __vmwrite(GUEST_GS_BASE, msr_content);
         else
-            wrgsshadow(msr_content);
+            write_gs_shadow(msr_content);
 
         break;
 
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 44e4ea2582..663e76c773 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -452,7 +452,7 @@ void toggle_guest_mode(struct vcpu *v)
      * Update the cached value of the GS base about to become inactive, as a
      * subsequent context switch won't bother re-reading it.
      */
-    gs_base = rdgsbase();
+    gs_base = read_gs_base();
     if ( v->arch.flags & TF_kernel_mode )
         v->arch.pv.gs_base_kernel = gs_base;
     else
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 61071ae03a..6be72efb5e 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -540,10 +540,10 @@ static int read_segment(enum x86_segment seg,
             reg->base = 0;
             break;
         case x86_seg_fs:
-            reg->base = rdfsbase();
+            reg->base = read_fs_base();
             break;
         case x86_seg_gs:
-            reg->base = rdgsbase();
+            reg->base = read_gs_base();
             break;
         }
 
@@ -900,13 +900,13 @@ static int read_msr(unsigned int reg, uint64_t *val,
     case MSR_FS_BASE:
         if ( is_pv_32bit_domain(currd) )
             break;
-        *val = rdfsbase();
+        *val = read_fs_base();
         return X86EMUL_OKAY;
 
     case MSR_GS_BASE:
         if ( is_pv_32bit_domain(currd) )
             break;
-        *val = rdgsbase();
+        *val = read_gs_base();
         return X86EMUL_OKAY;
 
     case MSR_SHADOW_GS_BASE:
@@ -1024,19 +1024,19 @@ static int write_msr(unsigned int reg, uint64_t val,
     case MSR_FS_BASE:
         if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
             break;
-        wrfsbase(val);
+        write_fs_base(val);
         return X86EMUL_OKAY;
 
     case MSR_GS_BASE:
         if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
             break;
-        wrgsbase(val);
+        write_gs_base(val);
         return X86EMUL_OKAY;
 
     case MSR_SHADOW_GS_BASE:
         if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
             break;
-        wrgsshadow(val);
+        write_gs_shadow(val);
         curr->arch.pv.gs_base_user = val;
         return X86EMUL_OKAY;
 
diff --git a/xen/arch/x86/pv/misc-hypercalls.c b/xen/arch/x86/pv/misc-hypercalls.c
index b353972e3d..3a4e4aa460 100644
--- a/xen/arch/x86/pv/misc-hypercalls.c
+++ b/xen/arch/x86/pv/misc-hypercalls.c
@@ -192,7 +192,7 @@ long do_set_segment_base(unsigned int which, unsigned long base)
     {
     case SEGBASE_FS:
         if ( is_canonical_address(base) )
-            wrfsbase(base);
+            write_fs_base(base);
         else
             ret = -EINVAL;
         break;
@@ -200,7 +200,7 @@ long do_set_segment_base(unsigned int which, unsigned long base)
     case SEGBASE_GS_USER:
         if ( is_canonical_address(base) )
         {
-            wrgsshadow(base);
+            write_gs_shadow(base);
             v->arch.pv.gs_base_user = base;
         }
         else
@@ -209,7 +209,7 @@ long do_set_segment_base(unsigned int which, unsigned long base)
 
     case SEGBASE_GS_KERNEL:
         if ( is_canonical_address(base) )
-            wrgsbase(base);
+            write_gs_base(base);
         else
             ret = -EINVAL;
         break;
@@ -258,7 +258,7 @@ long do_set_segment_base(unsigned int which, unsigned long base)
                        : [flat] "r" (FLAT_USER_DS32) );
 
         /* Update the cache of the inactive base, as read from the GDT/LDT. */
-        v->arch.pv.gs_base_user = rdgsbase();
+        v->arch.pv.gs_base_user = read_gs_base();
 
         asm volatile ( safe_swapgs );
         break;
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index fd049c5e14..b1ef40a846 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -44,9 +44,9 @@ static void read_registers(struct cpu_user_regs *regs, unsigned long crs[8])
     crs[3] = read_cr3();
     crs[4] = read_cr4();
     read_sregs(regs);
-    crs[5] = rdfsbase();
-    crs[6] = rdgsbase();
-    crs[7] = rdgsshadow();
+    crs[5] = read_fs_base();
+    crs[6] = read_gs_base();
+    crs[7] = read_gs_shadow();
 }
 
 static void _show_registers(
diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index 5c44c79600..5e141ac5a5 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -156,7 +156,7 @@ static inline unsigned long __rdgsbase(void)
     return base;
 }
 
-static inline unsigned long rdfsbase(void)
+static inline unsigned long read_fs_base(void)
 {
     unsigned long base;
 
@@ -168,7 +168,7 @@ static inline unsigned long rdfsbase(void)
     return base;
 }
 
-static inline unsigned long rdgsbase(void)
+static inline unsigned long read_gs_base(void)
 {
     unsigned long base;
 
@@ -180,7 +180,7 @@ static inline unsigned long rdgsbase(void)
     return base;
 }
 
-static inline unsigned long rdgsshadow(void)
+static inline unsigned long read_gs_shadow(void)
 {
     unsigned long base;
 
@@ -196,7 +196,7 @@ static inline unsigned long rdgsshadow(void)
     return base;
 }
 
-static inline void wrfsbase(unsigned long base)
+static inline void write_fs_base(unsigned long base)
 {
     if ( read_cr4() & X86_CR4_FSGSBASE )
 #ifdef HAVE_AS_FSGSBASE
@@ -208,7 +208,7 @@ static inline void wrfsbase(unsigned long base)
         wrmsrl(MSR_FS_BASE, base);
 }
 
-static inline void wrgsbase(unsigned long base)
+static inline void write_gs_base(unsigned long base)
 {
     if ( read_cr4() & X86_CR4_FSGSBASE )
 #ifdef HAVE_AS_FSGSBASE
@@ -220,7 +220,7 @@ static inline void wrgsbase(unsigned long base)
         wrmsrl(MSR_GS_BASE, base);
 }
 
-static inline void wrgsshadow(unsigned long base)
+static inline void write_gs_shadow(unsigned long base)
 {
     if ( read_cr4() & X86_CR4_FSGSBASE )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3194.9245 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNX-0001VI-8r; Tue, 06 Oct 2020 10:39:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3194.9245; Tue, 06 Oct 2020 10:39:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNX-0001V6-5D; Tue, 06 Oct 2020 10:39:31 +0000
Received: by outflank-mailman (input) for mailman id 3194;
 Tue, 06 Oct 2020 10:39:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNV-0001Uw-ET
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5e34b34a-272a-452c-ba57-ab546d821309;
 Tue, 06 Oct 2020 10:39:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNU-0001SK-Hy
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNU-0007v9-HH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNV-0001Uw-ET
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:29 +0000
X-Inumbo-ID: 5e34b34a-272a-452c-ba57-ab546d821309
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5e34b34a-272a-452c-ba57-ab546d821309;
	Tue, 06 Oct 2020 10:39:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JU3cwV7UCtAkV05/UIgHLZWCSTL6o2CFbHIiWjoxx9s=; b=kYzQTAwHY0EtEgmMc8myfraxGq
	1qmxH28y/nng9ofYP6J4Kelv18rigMCUu+XW+QtbPQykuM1bUgykdUn6TUbu4T6P6ZF0ehAb+jK6l
	UF13u0B3wq7ZQZF9cpqC74pq9sw9++Qq0AOrk+fVWRf2cPbDwKjGxRCZ6I5cIyN9O444=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNU-0001SK-Hy
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNU-0007v9-HH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/asm: Split __wr{fs,gs}base() out of write_{fs,gs}_base()
Message-Id: <E1kPkNU-0007v9-HH@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:28 +0000

commit ecc9553a12cb14537c851bca43a9f55f23eb6bf0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 11 16:05:06 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Sep 29 13:46:13 2020 +0100

    x86/asm: Split __wr{fs,gs}base() out of write_{fs,gs}_base()
    
    To match the read side which is already split out.  A future change will want
    to use them.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/msr.h | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/xen/include/asm-x86/msr.h b/xen/include/asm-x86/msr.h
index 5e141ac5a5..16f95e7344 100644
--- a/xen/include/asm-x86/msr.h
+++ b/xen/include/asm-x86/msr.h
@@ -156,6 +156,24 @@ static inline unsigned long __rdgsbase(void)
     return base;
 }
 
+static inline void __wrfsbase(unsigned long base)
+{
+#ifdef HAVE_AS_FSGSBASE
+    asm volatile ( "wrfsbase %0" :: "r" (base) );
+#else
+    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
+#endif
+}
+
+static inline void __wrgsbase(unsigned long base)
+{
+#ifdef HAVE_AS_FSGSBASE
+    asm volatile ( "wrgsbase %0" :: "r" (base) );
+#else
+    asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
+#endif
+}
+
 static inline unsigned long read_fs_base(void)
 {
     unsigned long base;
@@ -199,11 +217,7 @@ static inline unsigned long read_gs_shadow(void)
 static inline void write_fs_base(unsigned long base)
 {
     if ( read_cr4() & X86_CR4_FSGSBASE )
-#ifdef HAVE_AS_FSGSBASE
-        asm volatile ( "wrfsbase %0" :: "r" (base) );
-#else
-        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd0" :: "a" (base) );
-#endif
+        __wrfsbase(base);
     else
         wrmsrl(MSR_FS_BASE, base);
 }
@@ -211,11 +225,7 @@ static inline void write_fs_base(unsigned long base)
 static inline void write_gs_base(unsigned long base)
 {
     if ( read_cr4() & X86_CR4_FSGSBASE )
-#ifdef HAVE_AS_FSGSBASE
-        asm volatile ( "wrgsbase %0" :: "r" (base) );
-#else
-        asm volatile ( ".byte 0xf3, 0x48, 0x0f, 0xae, 0xd8" :: "a" (base) );
-#endif
+        __wrgsbase(base);
     else
         wrmsrl(MSR_GS_BASE, base);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3195.9247 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNh-0001Wh-9y; Tue, 06 Oct 2020 10:39:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3195.9247; Tue, 06 Oct 2020 10:39:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNh-0001Wa-6t; Tue, 06 Oct 2020 10:39:41 +0000
Received: by outflank-mailman (input) for mailman id 3195;
 Tue, 06 Oct 2020 10:39:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNf-0001WM-Oi
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e372f985-b379-4de6-8bb1-94d42a634c00;
 Tue, 06 Oct 2020 10:39:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNe-0001T8-L0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNe-0007vl-KQ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNf-0001WM-Oi
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:39 +0000
X-Inumbo-ID: e372f985-b379-4de6-8bb1-94d42a634c00
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e372f985-b379-4de6-8bb1-94d42a634c00;
	Tue, 06 Oct 2020 10:39:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Js4cE9p9WSWMpcGgtLd9mj76SPP3OwZUpS01NTfvOS8=; b=CEzsmceoAkNI+OK4Zs0uXvMXrM
	HP54Cbkiq+M5hTWaHnVZzZQn3t4/I7KqImCgHcvFzaC7eRntjs1r3bG7f1Jc+6HxSkq6pm7dh4h+C
	+ecza90wdln97srlrqHBfdXsdYDsctuhd/xzmnCmurLsEQTN7iTfOOHCRq9/tEdL36Vw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNe-0001T8-L0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNe-0007vl-KQ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Optimise prefetching in svm_load_segs()
Message-Id: <E1kPkNe-0007vl-KQ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:38 +0000

commit fca8d65d94939e05f7eff147358e58ffeb424e6e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 8 18:53:25 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Sep 29 13:46:13 2020 +0100

    x86/pv: Optimise prefetching in svm_load_segs()
    
    Split into two functions.  Passing a load of zeros in results in unnecessary
    caller setup code.
    
    Update the prefetching comment to note that the main point is the TLB fill.
    
    Reorder the writes in svm_load_segs() to access the VMCB fields in ascending
    order, which gets better next-line prefetch behaviour out of hardware.  Update
    the prefetch instruction to match.
    
    The net delta is:
    
      add/remove: 1/0 grow/shrink: 0/2 up/down: 38/-39 (-1)
      Function                                     old     new   delta
      svm_load_segs_prefetch                         -      38     +38
      __context_switch                             967     951     -16
      svm_load_segs                                291     268     -23
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c             |  2 +-
 xen/arch/x86/hvm/svm/svm.c        | 43 ++++++++++++++++++++-------------------
 xen/include/asm-x86/hvm/svm/svm.h |  5 +++--
 3 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 1cc85f4ab9..5ce11cebf8 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1925,7 +1925,7 @@ static void __context_switch(void)
     /* Prefetch the VMCB if we expect to use it later in the context switch */
     if ( cpu_has_svm && is_pv_domain(nd) && !is_pv_32bit_domain(nd) &&
          !is_idle_domain(nd) )
-        svm_load_segs(0, 0, 0, 0, 0);
+        svm_load_segs_prefetch();
 #endif
 
     if ( need_full_gdt(nd) && !per_cpu(full_gdt_loaded, cpu) )
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index fa9fca94e2..9b65445577 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1520,6 +1520,19 @@ static void svm_init_erratum_383(const struct cpuinfo_x86 *c)
 }
 
 #ifdef CONFIG_PV
+void svm_load_segs_prefetch(void)
+{
+    const struct vmcb_struct *vmcb = this_cpu(host_vmcb_va);
+
+    if ( vmcb )
+        /*
+         * The main reason for this prefetch is for the TLB fill.  Use the
+         * opportunity to fetch the lowest address used, to get the best
+         * behaviour out of hardware's next-line prefetcher.
+         */
+        prefetchw(&vmcb->fs);
+}
+
 bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
                    unsigned long fs_base, unsigned long gs_base,
                    unsigned long gs_shadow)
@@ -1530,17 +1543,15 @@ bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
     if ( unlikely(!vmcb) )
         return false;
 
-    if ( !ldt_base )
-    {
-        /*
-         * The actual structure field used here was arbitrarily chosen.
-         * Empirically it doesn't seem to matter much which element is used,
-         * and a clear explanation of the otherwise poor performance has not
-         * been found/provided so far.
-         */
-        prefetchw(&vmcb->ldtr);
-        return true;
-    }
+    vmcb->fs.sel = 0;
+    vmcb->fs.attr = 0;
+    vmcb->fs.limit = 0;
+    vmcb->fs.base = fs_base;
+
+    vmcb->gs.sel = 0;
+    vmcb->gs.attr = 0;
+    vmcb->gs.limit = 0;
+    vmcb->gs.base = gs_base;
 
     if ( likely(!ldt_ents) )
         memset(&vmcb->ldtr, 0, sizeof(vmcb->ldtr));
@@ -1558,16 +1569,6 @@ bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
         vmcb->ldtr.base = ldt_base;
     }
 
-    vmcb->fs.sel = 0;
-    vmcb->fs.attr = 0;
-    vmcb->fs.limit = 0;
-    vmcb->fs.base = fs_base;
-
-    vmcb->gs.sel = 0;
-    vmcb->gs.attr = 0;
-    vmcb->gs.limit = 0;
-    vmcb->gs.base = gs_base;
-
     vmcb->kerngsbase = gs_shadow;
 
     svm_vmload_pa(per_cpu(host_vmcb, cpu));
diff --git a/xen/include/asm-x86/hvm/svm/svm.h b/xen/include/asm-x86/hvm/svm/svm.h
index 2310878e41..faeca40174 100644
--- a/xen/include/asm-x86/hvm/svm/svm.h
+++ b/xen/include/asm-x86/hvm/svm/svm.h
@@ -50,12 +50,13 @@ void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
 void svm_update_guest_cr(struct vcpu *, unsigned int cr, unsigned int flags);
 
 /*
- * PV context switch helper. Calls with zero ldt_base request a prefetch of
- * the VMCB area to be loaded from, instead of an actual load of state.
+ * PV context switch helpers.  Prefetching the VMCB area itself has been shown
+ * to be useful for performance.
  *
  * Must only be used for NUL FS/GS, as the segment attributes/limits are not
  * read from the GDT/LDT.
  */
+void svm_load_segs_prefetch(void);
 bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
                    unsigned long fs_base, unsigned long gs_base,
                    unsigned long gs_shadow);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:39:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:39:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3196.9250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNr-0001Xv-CR; Tue, 06 Oct 2020 10:39:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3196.9250; Tue, 06 Oct 2020 10:39:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkNr-0001Xn-8h; Tue, 06 Oct 2020 10:39:51 +0000
Received: by outflank-mailman (input) for mailman id 3196;
 Tue, 06 Oct 2020 10:39:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNp-0001Xc-Kf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b0944f3a-6725-46d8-b46a-8a5881179f74;
 Tue, 06 Oct 2020 10:39:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNo-0001TF-Nt
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNo-0007wP-NG
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNp-0001Xc-Kf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:49 +0000
X-Inumbo-ID: b0944f3a-6725-46d8-b46a-8a5881179f74
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b0944f3a-6725-46d8-b46a-8a5881179f74;
	Tue, 06 Oct 2020 10:39:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i6xXWAj3JPZbunAIavgdSHtllG/v6G9Q1tWZh7pt9Qc=; b=fQq2+w13iumqXm+nlC4lkyrejl
	9Wqj1FH1ANK7ViyQKC2KvLTHKQWYGpXWPUGUwU7lxXq5yoEnVOTCe3hiYfO5Yr+L21jcoD6xt3HfB
	yzn4LQaX3NJ44745tAg3g91HxtVMImhKb/VHQ0o/Mh1O9MREM7E/BPAe8KL5GzhkLWZg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNo-0001TF-Nt
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNo-0007wP-NG
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Optimise to the segment context switching paths
Message-Id: <E1kPkNo-0007wP-NG@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:48 +0000

commit cbe69ba3e8e0499fac73cb91caebb8732e08f577
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 11 16:05:06 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Sep 29 13:46:13 2020 +0100

    x86/pv: Optimise to the segment context switching paths
    
    Opencode the fs/gs helpers, as the optimiser is unable to rearrange the logic
    down to a single X86_CR4_FSGSBASE check.  This removes several jumps and
    creates bigger basic blocks.
    
    In load_segments(), optimise GS base handling substantially.  The call to
    svm_load_segs() already needs gsb/gss the correct way around, so hoist the
    logic for the later path to use it as well.  Swapping the inputs in GPRs is
    far more efficient than using SWAPGS.
    
    Previously, there was optionally one SWAPGS from the user/kernel mode check,
    two SWAPGS's in write_gs_shadow() and two WRGSBASE's.  Updates to GS (4 or 5
    here) in quick succession stall all contemporary pipelines repeatedly.  (Intel
    Core/Xeon pipelines have segment register renaming[1], so can continue to
    speculatively execute with one GS update in flight.  Other pipelines cannot
    have two updates in flight concurrently, and must stall dispatch of the second
    until the first has retired.)
    
    Rewrite the logic to have exactly two WRGSBASEs and one SWAPGS, which removes
    two stalles all contemporary processors.
    
    Although modest, the resulting delta is:
    
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-106 (-106)
      Function                                     old     new   delta
      paravirt_ctxt_switch_from                    235     198     -37
      context_switch                              3582    3513     -69
    
    in a common path.
    
    [1] https://software.intel.com/security-software-guidance/insights/deep-dive-intel-analysis-speculative-behavior-swapgs-and-segment-registers
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain.c | 59 ++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 42 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5ce11cebf8..7e16d49bfd 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1537,6 +1537,7 @@ arch_do_vcpu_op(
 static void load_segments(struct vcpu *n)
 {
     struct cpu_user_regs *uregs = &n->arch.user_regs;
+    unsigned long gsb = 0, gss = 0;
     bool compat = is_pv_32bit_vcpu(n);
     bool all_segs_okay = true, fs_gs_done = false;
 
@@ -1556,18 +1557,25 @@ static void load_segments(struct vcpu *n)
                    : [ok] "+r" (all_segs_okay)          \
                    : [_val] "rm" (val) )
 
-#ifdef CONFIG_HVM
-    if ( cpu_has_svm && !compat && (uregs->fs | uregs->gs) <= 3 )
+    if ( !compat )
     {
-        unsigned long gsb = n->arch.flags & TF_kernel_mode
-            ? n->arch.pv.gs_base_kernel : n->arch.pv.gs_base_user;
-        unsigned long gss = n->arch.flags & TF_kernel_mode
-            ? n->arch.pv.gs_base_user : n->arch.pv.gs_base_kernel;
+        gsb = n->arch.pv.gs_base_kernel;
+        gss = n->arch.pv.gs_base_user;
 
-        fs_gs_done = svm_load_segs(n->arch.pv.ldt_ents, LDT_VIRT_START(n),
-                                   n->arch.pv.fs_base, gsb, gss);
-    }
+        /*
+         * Figure out which way around gsb/gss want to be.  gsb needs to be
+         * the active context, and gss needs to be the inactive context.
+         */
+        if ( !(n->arch.flags & TF_kernel_mode) )
+            SWAP(gsb, gss);
+
+#ifdef CONFIG_HVM
+        if ( cpu_has_svm && (uregs->fs | uregs->gs) <= 3 )
+            fs_gs_done = svm_load_segs(n->arch.pv.ldt_ents, LDT_VIRT_START(n),
+                                       n->arch.pv.fs_base, gsb, gss);
 #endif
+    }
+
     if ( !fs_gs_done )
     {
         load_LDT(n);
@@ -1581,13 +1589,19 @@ static void load_segments(struct vcpu *n)
 
     if ( !fs_gs_done && !compat )
     {
-        write_fs_base(n->arch.pv.fs_base);
-        write_gs_shadow(n->arch.pv.gs_base_kernel);
-        write_gs_base(n->arch.pv.gs_base_user);
-
-        /* If in kernel mode then switch the GS bases around. */
-        if ( (n->arch.flags & TF_kernel_mode) )
+        if ( read_cr4() & X86_CR4_FSGSBASE )
+        {
+            __wrgsbase(gss);
+            __wrfsbase(n->arch.pv.fs_base);
             asm volatile ( "swapgs" );
+            __wrgsbase(gsb);
+        }
+        else
+        {
+            wrmsrl(MSR_FS_BASE, n->arch.pv.fs_base);
+            wrmsrl(MSR_GS_BASE, gsb);
+            wrmsrl(MSR_SHADOW_GS_BASE, gss);
+        }
     }
 
     if ( unlikely(!all_segs_okay) )
@@ -1707,9 +1721,20 @@ static void save_segments(struct vcpu *v)
 
     if ( !is_pv_32bit_vcpu(v) )
     {
-        unsigned long gs_base = read_gs_base();
+        unsigned long fs_base, gs_base;
+
+        if ( read_cr4() & X86_CR4_FSGSBASE )
+        {
+            fs_base = __rdfsbase();
+            gs_base = __rdgsbase();
+        }
+        else
+        {
+            rdmsrl(MSR_FS_BASE, fs_base);
+            rdmsrl(MSR_GS_BASE, gs_base);
+        }
 
-        v->arch.pv.fs_base = read_fs_base();
+        v->arch.pv.fs_base = fs_base;
         if ( v->arch.flags & TF_kernel_mode )
             v->arch.pv.gs_base_kernel = gs_base;
         else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3197.9255 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkO1-0001Zv-FT; Tue, 06 Oct 2020 10:40:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3197.9255; Tue, 06 Oct 2020 10:40:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkO1-0001Zn-CO; Tue, 06 Oct 2020 10:40:01 +0000
Received: by outflank-mailman (input) for mailman id 3197;
 Tue, 06 Oct 2020 10:39:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkNz-0001Zb-Nn
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1f91ce95-fe75-4880-b92d-9231d6387e21;
 Tue, 06 Oct 2020 10:39:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNy-0001TI-RD
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkNy-0007yn-Q6
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkNz-0001Zb-Nn
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:59 +0000
X-Inumbo-ID: 1f91ce95-fe75-4880-b92d-9231d6387e21
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1f91ce95-fe75-4880-b92d-9231d6387e21;
	Tue, 06 Oct 2020 10:39:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I7Ar7RkBDBsWmYI2k+kAsJ9jL6Sf821w+7ZP7T3if1o=; b=N1bm4vJPLt2MdiRgCLsiGVwPbh
	/1H7fMrNfC7BnV5cwjDUDteQ8kIoqyKQ2VCWgVLvaZyJa/0U36BkjHrQkTQuezOsFcHHfrEz61Gkv
	1fFNHAsgPW+AKZEG8RKJ3l+nPnoR+8eCgVMdYoCLeYWbBJ+XcN/Fce7jrjTm0KPdPC8w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNy-0001TI-RD
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkNy-0007yn-Q6
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:39:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Simplify emulation for the 64bit base MSRs
Message-Id: <E1kPkNy-0007yn-Q6@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:39:58 +0000

commit 5dba8c2f23049aa68b777a9e7e9f76c12dd00012
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Sep 4 15:25:09 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Sep 29 13:46:13 2020 +0100

    x86/pv: Simplify emulation for the 64bit base MSRs
    
    is_pv_32bit_domain() is an expensive predicate, but isn't used for speculative
    safety in this case.  Swap to checking the Long Mode bit in the CPUID policy,
    which is the architecturally correct behaviour.
    
    is_canonical_address() is currently moderately simple, but it will become more
    complicated when 5-level support is added.  Rearrange write_msr() to collapse
    the common checks.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 6be72efb5e..7cc16d6eda 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -877,6 +877,7 @@ static int read_msr(unsigned int reg, uint64_t *val,
 {
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
+    const struct cpuid_policy *cp = currd->arch.cpuid;
     bool vpmu_msr = false;
     int ret;
 
@@ -898,19 +899,19 @@ static int read_msr(unsigned int reg, uint64_t *val,
         return X86EMUL_OKAY;
 
     case MSR_FS_BASE:
-        if ( is_pv_32bit_domain(currd) )
+        if ( !cp->extd.lm )
             break;
         *val = read_fs_base();
         return X86EMUL_OKAY;
 
     case MSR_GS_BASE:
-        if ( is_pv_32bit_domain(currd) )
+        if ( !cp->extd.lm )
             break;
         *val = read_gs_base();
         return X86EMUL_OKAY;
 
     case MSR_SHADOW_GS_BASE:
-        if ( is_pv_32bit_domain(currd) )
+        if ( !cp->extd.lm )
             break;
         *val = curr->arch.pv.gs_base_user;
         return X86EMUL_OKAY;
@@ -1006,6 +1007,7 @@ static int write_msr(unsigned int reg, uint64_t val,
 {
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
+    const struct cpuid_policy *cp = currd->arch.cpuid;
     bool vpmu_msr = false;
     int ret;
 
@@ -1022,22 +1024,22 @@ static int write_msr(unsigned int reg, uint64_t val,
         uint64_t temp;
 
     case MSR_FS_BASE:
-        if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
-            break;
-        write_fs_base(val);
-        return X86EMUL_OKAY;
-
     case MSR_GS_BASE:
-        if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
-            break;
-        write_gs_base(val);
-        return X86EMUL_OKAY;
-
     case MSR_SHADOW_GS_BASE:
-        if ( is_pv_32bit_domain(currd) || !is_canonical_address(val) )
+        if ( !cp->extd.lm || !is_canonical_address(val) )
             break;
-        write_gs_shadow(val);
-        curr->arch.pv.gs_base_user = val;
+
+        if ( reg == MSR_FS_BASE )
+            write_fs_base(val);
+        else if ( reg == MSR_GS_BASE )
+            write_gs_base(val);
+        else if ( reg == MSR_SHADOW_GS_BASE )
+        {
+            write_gs_shadow(val);
+            curr->arch.pv.gs_base_user = val;
+        }
+        else
+            ASSERT_UNREACHABLE();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3198.9259 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOB-0002G1-HF; Tue, 06 Oct 2020 10:40:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3198.9259; Tue, 06 Oct 2020 10:40:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOB-0002Fu-E3; Tue, 06 Oct 2020 10:40:11 +0000
Received: by outflank-mailman (input) for mailman id 3198;
 Tue, 06 Oct 2020 10:40:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkO9-0002Fi-Lo
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b79f8a9b-76c3-4863-ae28-b5b472e4c973;
 Tue, 06 Oct 2020 10:40:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkO8-0001Tc-UL
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkO8-00080L-Ta
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkO9-0002Fi-Lo
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:09 +0000
X-Inumbo-ID: b79f8a9b-76c3-4863-ae28-b5b472e4c973
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b79f8a9b-76c3-4863-ae28-b5b472e4c973;
	Tue, 06 Oct 2020 10:40:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LJ9H9fFgcWtSN1Zp5DcOGjAWHaRZUJLSmIckO0VkAcM=; b=0SYBTIEM8FLw1NQK+pOoMEdQsO
	ZXEN+dZXzyNc6ZjRuhbojPQQcvh+quU44KZ0yaDn3MHWMqpH1ELsewIO188duMv4/n0uKhDC6csr7
	wmzgLQ+5zpWcT/wVL5H0FiNEiHqtyQ9Y/rBvjcdyBSzac8UwqXnpKtV2tqXab8xE3r6Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkO8-0001Tc-UL
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkO8-00080L-Ta
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: refuse EVTCHNOP_status for Xen-bound event channels
Message-Id: <E1kPkO8-00080L-Ta@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:08 +0000

commit f60ab5337f968e2f10c639ab59db7afb0fe4f7c3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 09:10:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 09:10:01 2020 +0200

    evtchn: refuse EVTCHNOP_status for Xen-bound event channels
    
    Callers have no business knowing the state of the Xen end of an event
    channel.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <Paul@xen.org>
---
 xen/common/event_channel.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index d2ee83bbbf..49cb318b81 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -933,6 +933,11 @@ int evtchn_status(evtchn_status_t *status)
     }
 
     chn = evtchn_from_port(d, port);
+    if ( consumer_is_xen(chn) )
+    {
+        rc = -EACCES;
+        goto out;
+    }
 
     rc = xsm_evtchn_status(XSM_TARGET, d, chn);
     if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3199.9263 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOL-0002HQ-Ik; Tue, 06 Oct 2020 10:40:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3199.9263; Tue, 06 Oct 2020 10:40:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOL-0002HI-Fo; Tue, 06 Oct 2020 10:40:21 +0000
Received: by outflank-mailman (input) for mailman id 3199;
 Tue, 06 Oct 2020 10:40:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkOJ-0002H6-V0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 246f4198-4e21-4ea6-ab33-90ab825bf093;
 Tue, 06 Oct 2020 10:40:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOJ-0001Tj-13
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOJ-00081p-0P
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkOJ-0002H6-V0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
X-Inumbo-ID: 246f4198-4e21-4ea6-ab33-90ab825bf093
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 246f4198-4e21-4ea6-ab33-90ab825bf093;
	Tue, 06 Oct 2020 10:40:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tNRzsI8qA/MUdvwdLSSoezvp91G1EUHU+JERjhO+8L8=; b=doNGTX5MAJLAsFLI47n2lGnLkQ
	+LV/DQdsemeaMwhilB7g7sJrvPUq8OGmvHu5Hn2WZJM5Aq10jB2E6aET8hX0lXrEyy6Ivy0Q20slh
	USqRFfASAvShoVJn3nWsRiiBVIuwmj3Yfkifc+uMyQWXmpNzKM8u01rAnuzkJXifBYB0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOJ-0001Tj-13
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOJ-00081p-0P
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn/sched: reject poll requests for unusable ports
Message-Id: <E1kPkOJ-00081p-0P@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:19 +0000

commit d4bfa0c78f48e6562667f8e9c898a548be633d77
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 09:10:46 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 09:10:46 2020 +0200

    evtchn/sched: reject poll requests for unusable ports
    
    Before and after XSA-342 there has been an asymmetry in how not really
    usable ports get treated in do_poll(): Ones beyond a certain boundary
    (max_evtchns originally, valid_evtchns subsequently) did get refused
    with -EINVAL, while lower ones were accepted despite there potentially
    being no way to wake the vCPU again from its polling state. Arrange to
    also honor evtchn_usable() output in the decision.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/common/sched/core.c | 12 ++++++------
 xen/include/xen/event.h | 32 +++++++++++++++++++-------------
 2 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ab94d2ec3a..ed973e90ec 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1427,13 +1427,13 @@ static long do_poll(struct sched_poll *sched_poll)
         if ( __copy_from_guest_offset(&port, sched_poll->ports, i, 1) )
             goto out;
 
-        rc = -EINVAL;
-        if ( !port_is_valid(d, port) )
-            goto out;
-
-        rc = 0;
-        if ( evtchn_port_is_pending(d, port) )
+        rc = evtchn_port_poll(d, port);
+        if ( rc )
+        {
+            if ( rc > 0 )
+                rc = 0;
             goto out;
+        }
     }
 
     if ( sched_poll->nr_ports == 1 )
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index fa93a3684a..509d3ae861 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -240,19 +240,6 @@ static inline bool evtchn_is_pending(const struct domain *d,
     return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
-{
-    struct evtchn *evtchn = evtchn_from_port(d, port);
-    bool rc;
-    unsigned long flags;
-
-    spin_lock_irqsave(&evtchn->lock, flags);
-    rc = evtchn_is_pending(d, evtchn);
-    spin_unlock_irqrestore(&evtchn->lock, flags);
-
-    return rc;
-}
-
 static inline bool evtchn_is_masked(const struct domain *d,
                                     const struct evtchn *evtchn)
 {
@@ -279,6 +266,25 @@ static inline bool evtchn_is_busy(const struct domain *d,
            d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
+/* Returns negative errno, zero for not pending, or positive for pending. */
+static inline int evtchn_port_poll(struct domain *d, evtchn_port_t port)
+{
+    int rc = -EINVAL;
+
+    if ( port_is_valid(d, port) )
+    {
+        struct evtchn *evtchn = evtchn_from_port(d, port);
+        unsigned long flags;
+
+        spin_lock_irqsave(&evtchn->lock, flags);
+        if ( evtchn_usable(evtchn) )
+            rc = evtchn_is_pending(d, evtchn);
+        spin_unlock_irqrestore(&evtchn->lock, flags);
+    }
+
+    return rc;
+}
+
 static inline int evtchn_port_set_priority(struct domain *d,
                                            struct evtchn *evtchn,
                                            unsigned int priority)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3200.9267 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOV-0002Ii-Kn; Tue, 06 Oct 2020 10:40:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3200.9267; Tue, 06 Oct 2020 10:40:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOV-0002Ib-HJ; Tue, 06 Oct 2020 10:40:31 +0000
Received: by outflank-mailman (input) for mailman id 3200;
 Tue, 06 Oct 2020 10:40:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkOT-0002IP-Vm
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3b08408c-38d5-4b30-8693-33d8c5942119;
 Tue, 06 Oct 2020 10:40:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOT-0001Tz-4L
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOT-00082f-3T
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkOT-0002IP-Vm
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:30 +0000
X-Inumbo-ID: 3b08408c-38d5-4b30-8693-33d8c5942119
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3b08408c-38d5-4b30-8693-33d8c5942119;
	Tue, 06 Oct 2020 10:40:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LZeZPmtGGmZVUMAKPpwX8gjy+W7R0prTz+hhYcWTMMs=; b=s5zBu9AF7ZaEm1CbwcM6bMx6go
	fdzb6C4IGHZQgoeZ8GCRmrc1rE+9cMsJblN1ea2j3lsJdpEqM8WSIXI7ceBWjWJ1ekZvgXHXYIosB
	8EKHRWZHkeQeAFkyAbYABA10na/WnsNTMG5VQtPVmGUpTyAnJ97jVIYBu2nq9rTNclbY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOT-0001Tz-4L
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOT-00082f-3T
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: don't bypass unlinking pIRQ when closing port
Message-Id: <E1kPkOT-00082f-3T@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:29 +0000

commit e301a706eb679a0246cf98324958deb3781c886a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 09:11:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 09:11:48 2020 +0200

    evtchn: don't bypass unlinking pIRQ when closing port
    
    There's no other path causing a terminal unlink_pirq_port() to be called
    (evtchn_bind_vcpu() relinks it right away) and hence _if_ pirq can
    indeed be NULL when closing the port, list corruption would occur when
    bypassing the unlink (unless the structure never gets linked again). As
    we can't come here after evtchn_destroy() anymore, (late) domain
    destruction also isn't a reason for a possible exception, and hence the
    only alternative looks to be that the check was pointless in the first
    place. While I haven't observed the case, from code inspection I'm far
    from sure I can exclude this being possible, so it feels more safe to
    re-arrange the code instead.
    
    Fixes: c24536b636f2 ("replace d->nr_pirqs sized arrays with radix tree")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/common/event_channel.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 49cb318b81..161cbb77d2 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -614,17 +614,18 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     case ECS_PIRQ: {
         struct pirq *pirq = pirq_info(d1, chn1->u.pirq.irq);
 
-        if ( !pirq )
-            break;
-        if ( !is_hvm_domain(d1) )
-            pirq_guest_unbind(d1, pirq);
-        pirq->evtchn = 0;
-        pirq_cleanup_check(pirq, d1);
-        unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]);
+        if ( pirq )
+        {
+            if ( !is_hvm_domain(d1) )
+                pirq_guest_unbind(d1, pirq);
+            pirq->evtchn = 0;
+            pirq_cleanup_check(pirq, d1);
 #ifdef CONFIG_X86
-        if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 )
-            unmap_domain_pirq_emuirq(d1, pirq->pirq);
+            if ( is_hvm_domain(d1) && domain_pirq_to_irq(d1, pirq->pirq) > 0 )
+                unmap_domain_pirq_emuirq(d1, pirq->pirq);
 #endif
+        }
+        unlink_pirq_port(chn1, d1->vcpu[chn1->notify_vcpu_id]);
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3201.9271 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOf-0002K5-MB; Tue, 06 Oct 2020 10:40:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3201.9271; Tue, 06 Oct 2020 10:40:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOf-0002Jx-JA; Tue, 06 Oct 2020 10:40:41 +0000
Received: by outflank-mailman (input) for mailman id 3201;
 Tue, 06 Oct 2020 10:40:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkOe-0002Jn-6X
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9ea77cf8-6b1b-42a1-ac0e-a930a34c8a54;
 Tue, 06 Oct 2020 10:40:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOd-0001UY-7M
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOd-00083e-6d
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkOe-0002Jn-6X
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:40 +0000
X-Inumbo-ID: 9ea77cf8-6b1b-42a1-ac0e-a930a34c8a54
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9ea77cf8-6b1b-42a1-ac0e-a930a34c8a54;
	Tue, 06 Oct 2020 10:40:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aTTVoE7YRqYBRcK8VGTcTiJQ13kcXvjB8vq5z1Qs+6s=; b=nlKvNYHCmaMnSxOtUzs41PLVDG
	mgPbRFq//U7FS0FK0zpKgnPLMieyAJqBa8aWjzlUeOjH34fBwp1d3dpHqDvMjtPnTvNe17ozN7IZU
	FgxPk7H5VXQTThhrDvNUGcvRAVc95MFqIkzSOl5A4sAbOCp1LvCaoEV2SRpsDEG6FpKs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOd-0001UY-7M
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOd-00083e-6d
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: ECS_CLOSED => ECS_FREE
Message-Id: <E1kPkOd-00083e-6d@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:39 +0000

commit d72d6153be68f45e8f1c1b9e025cbfa625bbef6d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Sep 30 09:12:21 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 09:12:21 2020 +0200

    evtchn: ECS_CLOSED => ECS_FREE
    
    There's no ECS_CLOSED; correct a comment naming it.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/common/event_channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 161cbb77d2..2412e63204 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -668,7 +668,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
              * We can only get here if the port was closed and re-bound after
              * unlocking d1 but before locking d2 above. We could retry but
              * it is easier to return the same error as if we had seen the
-             * port in ECS_CLOSED. It must have passed through that state for
+             * port in ECS_FREE. It must have passed through that state for
              * us to end up here, so it's a valid error to return.
              */
             rc = -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:40:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:40:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3202.9277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOp-0002LV-P0; Tue, 06 Oct 2020 10:40:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3202.9277; Tue, 06 Oct 2020 10:40:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOp-0002LM-L3; Tue, 06 Oct 2020 10:40:51 +0000
Received: by outflank-mailman (input) for mailman id 3202;
 Tue, 06 Oct 2020 10:40:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkOo-0002LA-3u
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d6873d17-3f5e-460a-b14b-006e903a68c9;
 Tue, 06 Oct 2020 10:40:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOn-0001Ug-AH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOn-00084B-9b
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkOo-0002LA-3u
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:50 +0000
X-Inumbo-ID: d6873d17-3f5e-460a-b14b-006e903a68c9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d6873d17-3f5e-460a-b14b-006e903a68c9;
	Tue, 06 Oct 2020 10:40:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ybJQvuiu1my0MQjz1rYWA1qCph/fTWNJ8ebWEJbCz98=; b=Ag9vPvp8byOttoR5G96VyAmL16
	M3nXovUEpcArSalRatvY7gHsV/lU+E1GfjCWs7yUjzBQuRCtXmzD1iCsVHfhiw2LA24JGwrwc9hMV
	Vifrj+oRs6GgbmFSGlmsnGMEA8gEApqsKhuc2qQKtxfC9JktSPZVy/AO1IOeHfbTV3vY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOn-0001Ug-AH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOn-00084B-9b
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] efi/boot: wrap PrintStr/PrintErr to allow const CHAR16* arguments
Message-Id: <E1kPkOn-00084B-9b@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:49 +0000

commit c73952831f0fc63a984e0d07dff1d20f8617b81f
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Wed Sep 30 09:14:18 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Sep 30 09:14:18 2020 +0200

    efi/boot: wrap PrintStr/PrintErr to allow const CHAR16* arguments
    
    This patch wraps the EFI OutputString() method so that they can be
    called with const arguments.  The OutputString method does not modify
    its argument, although the prototype is missing const, so it is necssary
    to cast away the const when calling it.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 157fe0e8c5..8123523194 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -150,10 +150,17 @@ static struct file __initdata cfg;
 static struct file __initdata kernel;
 static struct file __initdata ramdisk;
 static struct file __initdata xsm;
-static CHAR16 __initdata newline[] = L"\r\n";
+static const CHAR16 __initconst newline[] = L"\r\n";
 
-#define PrintStr(s) StdOut->OutputString(StdOut, s)
-#define PrintErr(s) StdErr->OutputString(StdErr, s)
+static void __init PrintStr(const CHAR16 *s)
+{
+    StdOut->OutputString(StdOut, (CHAR16 *)s );
+}
+
+static void __init PrintErr(const CHAR16 *s)
+{
+    StdErr->OutputString(StdErr, (CHAR16 *)s );
+}
 
 /*
  * Include architecture specific implementation here, which references the
@@ -274,7 +281,7 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
-        PrintStr((CHAR16 *)str);
+        PrintStr(str);
     PrintStr(newline);
 
     if ( !efi_bs )
@@ -315,7 +322,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
 
     StdOut = StdErr;
-    PrintErr((CHAR16 *)mesg);
+    PrintErr(mesg);
     PrintErr(L": ");
 
     if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
@@ -545,7 +552,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     EFI_FILE_HANDLE FileHandle = NULL;
     UINT64 size;
     EFI_STATUS ret;
-    CHAR16 *what = NULL;
+    const CHAR16 *what = NULL;
 
     if ( !name )
         PrintErrMesg(L"No filename", EFI_OUT_OF_RESOURCES);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3203.9278 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOz-0002NP-PT; Tue, 06 Oct 2020 10:41:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3203.9278; Tue, 06 Oct 2020 10:41:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkOz-0002NI-MZ; Tue, 06 Oct 2020 10:41:01 +0000
Received: by outflank-mailman (input) for mailman id 3203;
 Tue, 06 Oct 2020 10:41:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkOy-0002N8-5e
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 52255b0c-4f23-4bc4-8c70-38114e70b2bf;
 Tue, 06 Oct 2020 10:40:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOx-0001Up-D2
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkOx-00084u-CR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkOy-0002N8-5e
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:00 +0000
X-Inumbo-ID: 52255b0c-4f23-4bc4-8c70-38114e70b2bf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 52255b0c-4f23-4bc4-8c70-38114e70b2bf;
	Tue, 06 Oct 2020 10:40:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JpW2x94fq4Ygs69QTsQ8h47tyjeu5g6JZL1/GPpzgHo=; b=BMjEwin9M+2o0XtIG9eqfoXnSi
	GtNRoi7NQPFd/Mah1LYNVnpZCvgPCTEfk3PH1fpkjo7f3AWL9ExMTAkaBo0HOrVcL48C/S3Vu/Vfb
	EegOLlvBP6eFibcH8LsfeDi20rSXSLt12IYrY4A+4bPnzXsDXEYKSX76NBcUlshvU6Tw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOx-0001Up-D2
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkOx-00084u-CR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:40:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxc: report malloc errors in writev_exact
Message-Id: <E1kPkOx-00084u-CR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:40:59 +0000

commit 0d8d289af7a679c028462c4ed5d98586f9ef9648
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Wed Sep 23 08:48:40 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Sep 30 15:06:38 2020 +0000

    tools/libxc: report malloc errors in writev_exact
    
    The caller of writev_exact should be notified about malloc errors
    when dealing with partial writes.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/ctrl/xc_private.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index 8af96b1b7e..3fab94f9c0 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -721,6 +721,7 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt)
                     if ( !local_iov )
                     {
                         saved_errno = ENOMEM;
+                        rc = -1;
                         goto out;
                     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3204.9282 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkP8-0002Ow-So; Tue, 06 Oct 2020 10:41:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3204.9282; Tue, 06 Oct 2020 10:41:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkP8-0002Oo-PY; Tue, 06 Oct 2020 10:41:10 +0000
Received: by outflank-mailman (input) for mailman id 3204;
 Tue, 06 Oct 2020 10:41:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkP8-0002Oe-8D
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 03663853-adfc-44e8-83a1-f014b76311ee;
 Tue, 06 Oct 2020 10:41:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkP7-0001VE-Fm
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkP7-00085s-F9
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkP8-0002Oe-8D
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:10 +0000
X-Inumbo-ID: 03663853-adfc-44e8-83a1-f014b76311ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 03663853-adfc-44e8-83a1-f014b76311ee;
	Tue, 06 Oct 2020 10:41:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NRYB/ORUh5UNubIlc6UKxZXUo6xLVak71dsTBxzl5nk=; b=0DPn5A4TYeT0uf9F8/0+EeLZJT
	UUwo7sgPA+1seSLtLuj+o2kYPcGS+u9EMFOyBwxUqfoK/50nI1hdMnnd8Gu/Bha3x0PlU6tH3sZM6
	bBSMJ9of0VsI1HHN8nwE46+5jPquIhyr8yJSUC6YarCFx87AMC1q5DCfUNDJcoZezeBU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkP7-0001VE-Fm
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkP7-00085s-F9
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: Fix configure of upstream QEMU
Message-Id: <E1kPkP7-00085s-F9@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:09 +0000

commit 27de84d3ae462bd8311c8267c642ec95afdcf47c
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Wed Sep 23 12:03:23 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Sep 30 15:08:17 2020 +0000

    tools: Fix configure of upstream QEMU
    
    QEMU as recently switch its build system to use meson and the
    ./configure step with meson is more restrictive that the step used to
    be, most installation path wants to be within prefix, otherwise we
    have this error message:
    
        ERROR: The value of the 'datadir' option is '/usr/share/qemu-xen' which must be a subdir of the prefix '/usr/lib/xen'.
    
    In order to workaround the limitation, we will set prefix to the same
    one as for the rest of Xen installation, and set all the other paths.
    
    For reference, a thread in qemu-devel:
        "configure with datadir outside of --prefix fails with meson"
        https://lore.kernel.org/qemu-devel/20200918133012.GH2024@perard.uk.xensource.com/t/
    
    And an issue in meson:
        "artificial limitation of directories (forced to be in prefix)"
        https://github.com/mesonbuild/meson/issues/2561
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Paul Durrant <paul@xen.org>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index ea69675cca..c1eba22c0c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -237,7 +237,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
 		$$enable_trace_backend \
-		--prefix=$(LIBEXEC) \
+		--prefix=$(prefix) \
 		--libdir=$(LIBEXEC_LIB) \
 		--includedir=$(LIBEXEC_INC) \
 		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
@@ -249,6 +249,10 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=$(localstatedir) \
+		--docdir=$(LIBEXEC)/share/doc \
+		--mandir=$(LIBEXEC)/share/man \
+		--libexecdir=$(LIBEXEC)/libexec \
+		--firmwarepath=$(LIBEXEC)/share/qemu-firmware \
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3205.9287 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPI-0002QN-UR; Tue, 06 Oct 2020 10:41:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3205.9287; Tue, 06 Oct 2020 10:41:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPI-0002QB-RA; Tue, 06 Oct 2020 10:41:20 +0000
Received: by outflank-mailman (input) for mailman id 3205;
 Tue, 06 Oct 2020 10:41:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkPI-0002Q3-EB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c84cc52c-371c-41ae-9b9a-029ce07cf1f5;
 Tue, 06 Oct 2020 10:41:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPH-0001Va-Ik
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPH-00086O-I4
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkPI-0002Q3-EB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:20 +0000
X-Inumbo-ID: c84cc52c-371c-41ae-9b9a-029ce07cf1f5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c84cc52c-371c-41ae-9b9a-029ce07cf1f5;
	Tue, 06 Oct 2020 10:41:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A5ZYWtcv1XouZQktysYHcKnr2W3F2ntHDrcNiYQIgdc=; b=46mVeP3vJ8UKzF2apqz6Ero5m5
	rlOA+fb/JjSKRuZ4uVQtua7w5b4BE1oMskHtOns1VfPySjrQbrfdofJG7TmufYzsewCIAxnHDXzHw
	p2B7vkyElGqPMa+4L8AaLo4q+Wx5XP378gneb7i4juSWp2+g0k6taGd6u1LvoMTeqO5o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPH-0001Va-Ik
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPH-00086O-I4
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxc/bitops: increase potential size of bitmaps
Message-Id: <E1kPkPH-00086O-I4@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:19 +0000

commit 50a5215f30e964a6f16165ab57925ca39f31a849
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Thu Sep 24 20:08:43 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Sep 30 15:10:26 2020 +0000

    libxc/bitops: increase potential size of bitmaps
    
    If the bitmap is used to represent domU pages, the amount of memory is
    limited to 8TB due to the 32bit value. Adjust the code to use 64bit
    values as input. All callers already use some form of 64bit as input,
    so no further adjustment is required.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/ctrl/xc_bitops.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/libs/ctrl/xc_bitops.h b/tools/libs/ctrl/xc_bitops.h
index 0951e8267d..3d3a09772a 100644
--- a/tools/libs/ctrl/xc_bitops.h
+++ b/tools/libs/ctrl/xc_bitops.h
@@ -14,52 +14,52 @@
 #define BITMAP_SHIFT(_nr) ((_nr) % 8)
 
 /* calculate required space for number of bytes needed to hold nr_bits */
-static inline int bitmap_size(int nr_bits)
+static inline unsigned long bitmap_size(unsigned long nr_bits)
 {
     return (nr_bits + 7) / 8;
 }
 
-static inline void *bitmap_alloc(int nr_bits)
+static inline void *bitmap_alloc(unsigned long nr_bits)
 {
     return calloc(1, bitmap_size(nr_bits));
 }
 
-static inline void bitmap_set(void *addr, int nr_bits)
+static inline void bitmap_set(void *addr, unsigned long nr_bits)
 {
     memset(addr, 0xff, bitmap_size(nr_bits));
 }
 
-static inline void bitmap_clear(void *addr, int nr_bits)
+static inline void bitmap_clear(void *addr, unsigned long nr_bits)
 {
     memset(addr, 0, bitmap_size(nr_bits));
 }
 
-static inline int test_bit(int nr, const void *_addr)
+static inline int test_bit(unsigned long nr, const void *_addr)
 {
     const char *addr = _addr;
     return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1;
 }
 
-static inline void clear_bit(int nr, void *_addr)
+static inline void clear_bit(unsigned long nr, void *_addr)
 {
     char *addr = _addr;
     BITMAP_ENTRY(nr, addr) &= ~(1UL << BITMAP_SHIFT(nr));
 }
 
-static inline void set_bit(int nr, void *_addr)
+static inline void set_bit(unsigned long nr, void *_addr)
 {
     char *addr = _addr;
     BITMAP_ENTRY(nr, addr) |= (1UL << BITMAP_SHIFT(nr));
 }
 
-static inline int test_and_clear_bit(int nr, void *addr)
+static inline int test_and_clear_bit(unsigned long nr, void *addr)
 {
     int oldbit = test_bit(nr, addr);
     clear_bit(nr, addr);
     return oldbit;
 }
 
-static inline int test_and_set_bit(int nr, void *addr)
+static inline int test_and_set_bit(unsigned long nr, void *addr)
 {
     int oldbit = test_bit(nr, addr);
     set_bit(nr, addr);
@@ -67,11 +67,11 @@ static inline int test_and_set_bit(int nr, void *addr)
 }
 
 static inline void bitmap_or(void *_dst, const void *_other,
-                             int nr_bits)
+                             unsigned long nr_bits)
 {
     char *dst = _dst;
     const char *other = _other;
-    int i;
+    unsigned long i;
     for ( i = 0; i < bitmap_size(nr_bits); ++i )
         dst[i] |= other[i];
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3206.9291 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPT-0002Rh-Vt; Tue, 06 Oct 2020 10:41:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3206.9291; Tue, 06 Oct 2020 10:41:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPT-0002RZ-Sm; Tue, 06 Oct 2020 10:41:31 +0000
Received: by outflank-mailman (input) for mailman id 3206;
 Tue, 06 Oct 2020 10:41:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkPS-0002RM-Ko
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a30b4ab2-311d-44f0-9c6d-7c11e1b6daae;
 Tue, 06 Oct 2020 10:41:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPR-0001Vo-N0
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPR-000874-L5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkPS-0002RM-Ko
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:30 +0000
X-Inumbo-ID: a30b4ab2-311d-44f0-9c6d-7c11e1b6daae
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a30b4ab2-311d-44f0-9c6d-7c11e1b6daae;
	Tue, 06 Oct 2020 10:41:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gQD0If5NVwNkFDD0wAzTXwhj4paDCem/fh+I+RPoPsA=; b=STn66Sd9PhQZ28jF4oMfxfPU5+
	QMuc2Nd2fQG9RCMnyH8Wu6PdGmIcRKIPSU5/aI/0W7VGhwmvf9x48tNo49lvJLNZVkjN/We0Fetqa
	9mrjB1sJvDObEUqol6qTdky7cKymlCLs3x9fLIThxyBnZf8uqNK0UeORZEzwtz3C5kFU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPR-0001Vo-N0
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPR-000874-L5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/cpuid: Plumb nested_virt down into xc_cpuid_apply_policy()
Message-Id: <E1kPkPR-000874-L5@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:29 +0000

commit bfcc97c08c2258316d1cd92c23a441d97ad6ff4e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 14:48:52 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Sep 30 15:18:08 2020 +0000

    tools/cpuid: Plumb nested_virt down into xc_cpuid_apply_policy()
    
    Nested Virt is the final special case in legacy CPUID handling.  Pass the
    (poorly named) nested_hvm setting down into xc_cpuid_apply_policy() to break
    the semantic dependency on HVM_PARAM_NESTEDHVM.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/ctrl/include/xenctrl.h |  4 ++--
 tools/libs/guest/xg_cpuid_x86.c   | 14 +++++---------
 tools/libxl/libxl_cpuid.c         |  3 ++-
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/tools/libs/ctrl/include/xenctrl.h b/tools/libs/ctrl/include/xenctrl.h
index 73e9535fc8..ba70bec9c4 100644
--- a/tools/libs/ctrl/include/xenctrl.h
+++ b/tools/libs/ctrl/include/xenctrl.h
@@ -1826,7 +1826,7 @@ struct xc_xend_cpuid {
  * cases, and the generated policy must be compatible with a 4.13.
  *
  * Either pass a full new @featureset (and @nr_features), or adjust individual
- * features (@pae, @itsc).
+ * features (@pae, @itsc, @nested_virt).
  *
  * Then (optionally) apply legacy XEND overrides (@xend) to the result.
  */
@@ -1834,7 +1834,7 @@ int xc_cpuid_apply_policy(xc_interface *xch,
                           uint32_t domid, bool restore,
                           const uint32_t *featureset,
                           unsigned int nr_features, bool pae, bool itsc,
-                          const struct xc_xend_cpuid *xend);
+                          bool nested_virt, const struct xc_xend_cpuid *xend);
 int xc_mca_op(xc_interface *xch, struct xen_mc *mc);
 int xc_mca_op_inject_v2(xc_interface *xch, unsigned int flags,
                         xc_cpumap_t cpumap, unsigned int nr_cpus);
diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index dc50106975..aae6931a11 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -427,7 +427,7 @@ static int xc_cpuid_xend_policy(
 
 int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
                           const uint32_t *featureset, unsigned int nr_features,
-                          bool pae, bool itsc,
+                          bool pae, bool itsc, bool nested_virt,
                           const struct xc_xend_cpuid *xend)
 {
     int rc;
@@ -559,7 +559,11 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
         p->extd.itsc = itsc;
 
         if ( di.hvm )
+        {
             p->basic.pae = pae;
+            p->basic.vmx = nested_virt;
+            p->extd.svm = nested_virt;
+        }
     }
 
     if ( !di.hvm )
@@ -625,14 +629,6 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
             }
             break;
         }
-
-        /*
-         * These settings are necessary to cause earlier HVM_PARAM_NESTEDHVM
-         * to be reflected correctly in CPUID.  Xen will discard these bits if
-         * configuration hasn't been set for the domain.
-         */
-        p->basic.vmx = true;
-        p->extd.svm = true;
     }
 
     rc = x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves);
diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index f54eb83a90..08e85dcffb 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -422,6 +422,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 {
     bool pae = true;
     bool itsc;
+    bool nested_virt = libxl_defbool_val(info->nested_hvm);
 
     /*
      * For PV guests, PAE is Xen-controlled (it is the 'p' that differentiates
@@ -452,7 +453,7 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
             info->tsc_mode == LIBXL_TSC_MODE_ALWAYS_EMULATE);
 
     xc_cpuid_apply_policy(ctx->xch, domid, restore, NULL, 0,
-                          pae, itsc, info->cpuid);
+                          pae, itsc, nested_virt, info->cpuid);
 }
 
 static const char *input_names[2] = { "leaf", "subleaf" };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3207.9296 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPe-0002Sw-1Z; Tue, 06 Oct 2020 10:41:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3207.9296; Tue, 06 Oct 2020 10:41:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPd-0002Sm-UP; Tue, 06 Oct 2020 10:41:41 +0000
Received: by outflank-mailman (input) for mailman id 3207;
 Tue, 06 Oct 2020 10:41:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkPc-0002Sd-Nr
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 90e8b600-aefa-45b4-bbc4-17e1fc18724c;
 Tue, 06 Oct 2020 10:41:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPb-0001Wa-Pq
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPb-00087o-PE
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkPc-0002Sd-Nr
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:40 +0000
X-Inumbo-ID: 90e8b600-aefa-45b4-bbc4-17e1fc18724c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 90e8b600-aefa-45b4-bbc4-17e1fc18724c;
	Tue, 06 Oct 2020 10:41:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MYFl3KT05yC3Fc7PsXQFfOGjrjhTPd8JRYi7Nwvbwyk=; b=0V57WD38ny9kypA/cS/7aiS8da
	o8b7bKfEcR8IGHO/bCD7Ohpldz0lypScxg23INfKfesEL/tvj5U8GYNe7XZ9xAmAulb/gLIh8or1n
	28MqXjIyzz240RafmPOX11r1H3n1yatQx0vC4L9vGQfnR8OlE/wHccXqmdYcx042PJpA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPb-0001Wa-Pq
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPb-00087o-PE
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: set maximum number of grants needed
Message-Id: <E1kPkPb-00087o-PE@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:39 +0000

commit 11852c7bb070a18c3708b4c001772a23e7d4fc27
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Sep 24 16:36:48 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Sep 30 15:34:50 2020 +0000

    tools/xenstore: set maximum number of grants needed
    
    When running as a stubdom Xenstore should set the maximum number of
    grants needed via a call of xengnttab_set_max_grants(), as otherwise
    the number of domains which can be supported will be 128 only (the
    default number of grants supported by Mini-OS).
    
    We use one grant per domain so the theoretical maximum number is
    DOMID_FIRST_RESERVED.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/xenstore/xenstored_domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 06359503f0..0d5495745b 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -631,6 +631,12 @@ void domain_init(void)
 	if (*xgt_handle == NULL)
 		barf_perror("Failed to open connection to gnttab");
 
+	/*
+	 * Allow max number of domains for mappings. We allow one grant per
+	 * domain so the theoretical maximum is DOMID_FIRST_RESERVED.
+	 */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);
+
 	talloc_set_destructor(xgt_handle, close_xgt_handle);
 
 	xce_handle = xenevtchn_open(NULL, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:41:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:41:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3208.9299 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPo-0002UF-2h; Tue, 06 Oct 2020 10:41:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3208.9299; Tue, 06 Oct 2020 10:41:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPn-0002U7-Vx; Tue, 06 Oct 2020 10:41:51 +0000
Received: by outflank-mailman (input) for mailman id 3208;
 Tue, 06 Oct 2020 10:41:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkPn-0002Tz-Je
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c8cbee6c-d36c-4b4c-ac2a-08e529608f39;
 Tue, 06 Oct 2020 10:41:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPl-0001Wi-TM
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPl-00088M-Se
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkPn-0002Tz-Je
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:51 +0000
X-Inumbo-ID: c8cbee6c-d36c-4b4c-ac2a-08e529608f39
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c8cbee6c-d36c-4b4c-ac2a-08e529608f39;
	Tue, 06 Oct 2020 10:41:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8R8AxavQTPFHY0udvwDrOFiWa3nokDPkh6Zym6AX6Qc=; b=wgudEdEnPMvceM2T3U0xZoLRxI
	z95jblSxOB75jWvLm2iwQHZ4oDgt7VF6pvXA1kZXn4JHaM8eIWRRJcgPR8Nz8keSpVs9GI9Ccd54t
	WZsgrsslLw17muZLs58gRKPtlkC6eXBEEvuWTIXZ7iR39L4t5wPrIqlzq9Zshvvu3M8o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPl-0001Wi-TM
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPl-00088M-Se
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: provide a mechanism to define a device 'safe remove' function...
Message-Id: <E1kPkPl-00088M-Se@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:49 +0000

commit 6df07f9fbe1e9b65a40183f79a6171200dc877dd
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 15 15:10:06 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:32:25 2020 +0000

    libxl: provide a mechanism to define a device 'safe remove' function...
    
    ... and use it to define libxl_device_disk_safe_remove().
    
    This patch builds on the existent macro magic by using a new value of the
    'force' field in in libxl__ao_device.
    It is currently defined as an int but is used in a boolean manner where
    1 means the operation is forced and 0 means it is not (but is actually forced
    after a 10s time-out). In adding a third value, this patch re-defines 'force'
    as a struct type (libxl__force) with a single 'flag' field taking an
    enumerated value:
    
    LIBXL__FORCE_AUTO - corresponding to the old 0 value
    LIBXL__FORCE_ON   - corresponding to the old 1 value
    LIBXL__FORCE_OFF  - the new value
    
    The LIBXL_DEFINE_DEVICE_REMOVE() macro is then modified to define the
    libxl_device_<type>_remove() and libxl_device_<type>_destroy() functions,
    setting LIBXL__FORCE_AUTO and LIBXL__FORCE_ON (respectively) in the
    libxl__ao_device passed to libxl__initiate_device_generic_remove() and a
    new macro, LIBXL_DEFINE_DEVICE_SAFE_REMOVE(), is defined that sets
    LIBXL__FORCE_OFF instead. This macro is used to define the new
    libxl_device_disk_safe_remove() function.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 tools/libxl/libxl.h          | 33 +++++++++++++++++++++++++--------
 tools/libxl/libxl_device.c   |  9 +++++----
 tools/libxl/libxl_disk.c     |  4 +++-
 tools/libxl/libxl_domain.c   |  2 +-
 tools/libxl/libxl_internal.h | 30 +++++++++++++++++++++++-------
 5 files changed, 57 insertions(+), 21 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 1cd6c38e83..1ea5b4f446 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -438,6 +438,12 @@
  */
 #define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
 
+/*
+ * LIBXL_HAVE_DISK_SAFE_REMOVE indicates that the
+ * libxl_device_disk_safe_remove() function is defined.
+ */
+#define LIBXL_HAVE_DISK_SAFE_REMOVE 1
+
 /*
  * libxl ABI compatibility
  *
@@ -1936,6 +1942,15 @@ void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
  *   structure is passed in are filled in with appropriate values for
  *   the device created.
  *
+ * libxl_device_<type>_destroy(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain without guest
+ *   co-operation. It is guest specific what affect this will have on
+ *   a running guest.
+ *
+ *   This function does not interact with the guest and therefore
+ *   cannot block on the guest.
+ *
  * libxl_device_<type>_remove(ctx, domid, device):
  *
  *   Removes the given device from the specified domain by performing
@@ -1943,16 +1958,14 @@ void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
  *   guest is running.
  *
  *   This method is currently synchronous and therefore can block
- *   while interacting with the guest.
- *
- * libxl_device_<type>_destroy(ctx, domid, device):
+ *   while interacting with the guest. There is a time-out of 10s on
+ *   this interaction after which libxl_device_<type>_destroy()
+ *   semantics apply.
  *
- *   Removes the given device from the specified domain without guest
- *   co-operation. It is guest specific what affect this will have on
- *   a running guest.
+ * libxl_device_<type>_safe_remove(ctx, domid, device):
  *
- *   This function does not interact with the guest and therefore
- *   cannot block on the guest.
+ *   This has the same semantics as libxl_device_<type>_remove() but,
+ *   in the event of hitting the 10s time-out, this function will fail.
  *
  * Controllers
  * -----------
@@ -2033,6 +2046,10 @@ int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
                               libxl_device_disk *disk,
                               const libxl_asyncop_how *ao_how)
                               LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_safe_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_disk *disk,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
 
 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
                                           uint32_t domid, int *num)
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 0381c5d509..e081faf9a9 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -973,7 +973,7 @@ void libxl__initiate_device_generic_remove(libxl__egc *egc,
             goto out;
         }
 
-        if (aodev->force)
+        if (aodev->force.flag == LIBXL__FORCE_ON)
             libxl__xs_path_cleanup(gc, t,
                                    libxl__device_frontend_path(gc, aodev->dev));
 
@@ -1092,9 +1092,9 @@ static void device_backend_callback(libxl__egc *egc, libxl__ev_devstate *ds,
 
     if (rc == ERROR_TIMEDOUT &&
         aodev->action == LIBXL__DEVICE_ACTION_REMOVE &&
-        !aodev->force) {
+        aodev->force.flag == LIBXL__FORCE_AUTO) {
         LOGD(DEBUG, aodev->dev->domid, "Timeout reached, initiating forced remove");
-        aodev->force = 1;
+        aodev->force.flag = LIBXL__FORCE_ON;
         libxl__initiate_device_generic_remove(egc, aodev);
         return;
     }
@@ -1319,7 +1319,8 @@ static void device_hotplug_done(libxl__egc *egc, libxl__ao_device *aodev)
     device_hotplug_clean(gc, aodev);
 
     /* Clean xenstore if it's a disconnection */
-    if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE) {
+    if (aodev->action == LIBXL__DEVICE_ACTION_REMOVE &&
+        (aodev->force.flag == LIBXL__FORCE_ON || !aodev->rc)) {
         rc = libxl__device_destroy(gc, aodev->dev);
         if (!aodev->rc)
             aodev->rc = rc;
diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c
index ddc1eec176..de183e0fb0 100644
--- a/tools/libxl/libxl_disk.c
+++ b/tools/libxl/libxl_disk.c
@@ -1277,7 +1277,7 @@ void libxl__device_disk_local_initiate_detach(libxl__egc *egc,
         aodev->action = LIBXL__DEVICE_ACTION_REMOVE;
         aodev->dev = device;
         aodev->callback = local_device_detach_cb;
-        aodev->force = 0;
+        aodev->force.flag = LIBXL__FORCE_AUTO;
         libxl__initiate_device_generic_remove(egc, aodev);
         return;
     }
@@ -1318,10 +1318,12 @@ out:
  * libxl__add_disks
  * libxl_device_disk_remove
  * libxl_device_disk_destroy
+ * libxl_device_disk_safe_remove
  */
 LIBXL_DEFINE_DEVICE_ADD(disk)
 LIBXL_DEFINE_DEVICES_ADD(disk)
 LIBXL_DEFINE_DEVICE_REMOVE(disk)
+LIBXL_DEFINE_DEVICE_SAFE_REMOVE(disk)
 
 static int libxl_device_disk_compare(const libxl_device_disk *d1,
                                      const libxl_device_disk *d2)
diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
index 39f08a6519..5d4ec90711 100644
--- a/tools/libxl/libxl_domain.c
+++ b/tools/libxl/libxl_domain.c
@@ -1279,7 +1279,7 @@ static void dm_destroy_cb(libxl__egc *egc,
     dis->drs.ao = ao;
     dis->drs.domid = domid;
     dis->drs.callback = devices_destroy_cb;
-    dis->drs.force = 1;
+    dis->drs.force.flag = LIBXL__FORCE_ON;
     libxl__devices_destroy(egc, &dis->drs);
 }
 
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index e16ae9630b..1fcf85c3e2 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2730,12 +2730,20 @@ _hidden void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev);
 /* generic callback for devices that only need to set ao_complete */
 _hidden void device_addrm_aocomplete(libxl__egc *egc, libxl__ao_device *aodev);
 
+typedef struct {
+    enum {
+        LIBXL__FORCE_AUTO, /* Re-execute with FORCE_ON if op times out */
+        LIBXL__FORCE_ON,
+        LIBXL__FORCE_OFF,
+    } flag;
+} libxl__force;
+
 struct libxl__ao_device {
     /* filled in by user */
     libxl__ao *ao;
     libxl__device_action action;
     libxl__device *dev;
-    int force;
+    libxl__force force;
     libxl__device_callback *callback;
     /* return value, zeroed by user on entry, is valid on callback */
     int rc;
@@ -3787,7 +3795,7 @@ _hidden void libxl__bootloader_run(libxl__egc*, libxl__bootloader_state *st);
         aodev->action = LIBXL__DEVICE_ACTION_REMOVE;                    \
         aodev->dev = device;                                            \
         aodev->callback = device_addrm_aocomplete;                      \
-        aodev->force = f;                                               \
+        aodev->force.flag = f;                                          \
         libxl__initiate_device_##remtype##_remove(egc, aodev);          \
                                                                         \
     out:                                                                \
@@ -3862,12 +3870,20 @@ _hidden void libxl__bootloader_run(libxl__egc*, libxl__bootloader_state *st);
 
 
 #define LIBXL_DEFINE_DEVICE_REMOVE(type)                                \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, remove, 0)            \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, destroy, 1)
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, remove,               \
+                                   LIBXL__FORCE_AUTO)                   \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, destroy,              \
+                                   LIBXL__FORCE_ON)
 
 #define LIBXL_DEFINE_DEVICE_REMOVE_CUSTOM(type)                         \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, remove, 0)               \
-    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, destroy, 1)
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, remove,                  \
+                                   LIBXL__FORCE_AUTO)                   \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, type, destroy,                 \
+                                   LIBXL__FORCE_ON)
+
+#define LIBXL_DEFINE_DEVICE_SAFE_REMOVE(type)                           \
+    LIBXL_DEFINE_DEVICE_REMOVE_EXT(type, generic, safe_remove,          \
+                                   LIBXL__FORCE_OFF)
 
 #define LIBXL_DEFINE_DEVICE_LIST(type)                                  \
     libxl_device_##type *libxl_device_##type##_list(libxl_ctx *ctx,     \
@@ -4028,7 +4044,7 @@ struct libxl__devices_remove_state {
     libxl__ao *ao;
     uint32_t domid;
     libxl__devices_remove_callback *callback;
-    int force; /* libxl_device_TYPE_destroy rather than _remove */
+    libxl__force force; /* libxl_device_TYPE_destroy rather than _remove */
     /* private */
     libxl__multidev multidev;
     int num_devices;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3209.9303 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPy-0002W4-6H; Tue, 06 Oct 2020 10:42:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3209.9303; Tue, 06 Oct 2020 10:42:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkPy-0002Vw-2r; Tue, 06 Oct 2020 10:42:02 +0000
Received: by outflank-mailman (input) for mailman id 3209;
 Tue, 06 Oct 2020 10:42:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkPw-0002Vn-Uz
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 40276371-c19b-4449-9bfa-487157cde2f9;
 Tue, 06 Oct 2020 10:42:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPw-0001YJ-0w
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkPv-000892-Vf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkPw-0002Vn-Uz
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:00 +0000
X-Inumbo-ID: 40276371-c19b-4449-9bfa-487157cde2f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 40276371-c19b-4449-9bfa-487157cde2f9;
	Tue, 06 Oct 2020 10:42:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LYMFUpPFjcxaWETL+DoQlyG21OkY9NB/JlZletMt6ak=; b=DrxVlhbvhk/nLyLnfu1BzB1jve
	4xfBw9HiEocJqcjBB8INIxyMRqUJO+SFaMZgELZ0HeskOyPtlOjo/IEb2Uv0gGd+qyvo3Nn0Pw6Lh
	MzDRjI5CO8HeWE5U4WdEmltS7OcN5vHze4+PsAHD04WGMVeRe7ux3yFw479RhATuAlWU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPw-0001YJ-0w
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkPv-000892-Vf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:41:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xl: implement documented '--force' option for block-detach
Message-Id: <E1kPkPv-000892-Vf@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:41:59 +0000

commit 707eb41ae2dde4636261f631224c97e9c0b16b56
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Tue Sep 15 15:10:07 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 1 09:32:57 2020 +0000

    xl: implement documented '--force' option for block-detach
    
    The manpage for 'xl' documents an option to force a block device to be
    released even if the domain to which it is attached does not co-operate.
    The documentation also states that, if the force flag is not specified, the
    block-detach operation should fail.
    
    Currently the force option is not implemented and a non-forced block-detach
    will auto-force after a time-out of 10s. This patch implements the force
    option and also stops auto-forcing a non-forced block-detach by calling
    libxl_device_disk_safe_remove() rather than libxl_device_disk_remove(),
    allowing the operation to fail cleanly as per the documented behaviour.
    
    NOTE: The documentation is also adjusted since the normal positioning of
          options is before compulsory parameters. It is also noted that use of
          the --force option may lead to a guest crash.
    
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 docs/man/xl.1.pod.in   |  4 ++--
 tools/xl/xl_block.c    | 21 ++++++++++++++++-----
 tools/xl/xl_cmdtable.c |  3 ++-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 52a47a6fbd..5f7d3a7134 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -1389,7 +1389,7 @@ Note that only PV block devices are supported by block-attach.
 Requests to attach emulated devices (eg, vdev=hdc) will result in only
 the PV view being available to the guest.
 
-=item B<block-detach> I<domain-id> I<devid> [I<OPTIONS>]
+=item B<block-detach> [I<OPTIONS>] I<domain-id> I<devid>
 
 Detach a domain's virtual block device. I<devid> may be the symbolic
 name or the numeric device id given to the device by domain 0.  You
@@ -1406,7 +1406,7 @@ B<OPTIONS>
 =item B<--force>
 
 If this parameter is specified the device will be forcefully detached, which
-may cause IO errors in the domain.
+may cause IO errors in the domain and possibly a guest crash
 
 =back
 
diff --git a/tools/xl/xl_block.c b/tools/xl/xl_block.c
index acaf9b96b8..70eed431e4 100644
--- a/tools/xl/xl_block.c
+++ b/tools/xl/xl_block.c
@@ -96,12 +96,21 @@ int main_blocklist(int argc, char **argv)
 
 int main_blockdetach(int argc, char **argv)
 {
+    static struct option opts[] = {
+        {"force", 0, 0, 'f'},
+        COMMON_LONG_OPTS
+    };
     uint32_t domid;
     int opt, rc = 0;
     libxl_device_disk disk;
-
-    SWITCH_FOREACH_OPT(opt, "", NULL, "block-detach", 2) {
-        /* No options */
+    bool force = false;
+
+    SWITCH_FOREACH_OPT(opt, "f", opts, "block-detach", 2) {
+    case 'f':
+        force = true;
+        break;
+    default:
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -110,9 +119,11 @@ int main_blockdetach(int argc, char **argv)
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
     }
-    rc = libxl_device_disk_remove(ctx, domid, &disk, 0);
+    rc = !force ? libxl_device_disk_safe_remove(ctx, domid, &disk, 0) :
+        libxl_device_disk_destroy(ctx, domid, &disk, 0);
     if (rc) {
-        fprintf(stderr, "libxl_device_disk_remove failed.\n");
+        fprintf(stderr, "libxl_device_disk_%s failed.\n",
+                !force ? "safe_remove" : "destroy");
         return 1;
     }
     libxl_device_disk_dispose(&disk);
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2b8e1b321a..7da6c1b927 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -368,7 +368,8 @@ struct cmd_spec cmd_table[] = {
     { "block-detach",
       &main_blockdetach, 0, 1,
       "Destroy a domain's virtual block device",
-      "<Domain> <DevId>",
+      "[option] <Domain> <DevId>",
+      "-f, --force        do not wait for the domain to release the device"
     },
     { "vtpm-attach",
       &main_vtpmattach, 1, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3210.9307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQ8-0002XM-8E; Tue, 06 Oct 2020 10:42:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3210.9307; Tue, 06 Oct 2020 10:42:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQ8-0002XD-4r; Tue, 06 Oct 2020 10:42:12 +0000
Received: by outflank-mailman (input) for mailman id 3210;
 Tue, 06 Oct 2020 10:42:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQ7-0002X4-5w
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 36219802-9bec-488b-8d1b-e9163ce9806d;
 Tue, 06 Oct 2020 10:42:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQ6-0001Yd-42
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQ6-00089h-3M
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQ7-0002X4-5w
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:11 +0000
X-Inumbo-ID: 36219802-9bec-488b-8d1b-e9163ce9806d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 36219802-9bec-488b-8d1b-e9163ce9806d;
	Tue, 06 Oct 2020 10:42:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WemtbJaKH6OEHnsP1E3xHriC6d9ubCGU87vMtSD+zts=; b=exDeiLBFr4/i7/AMZs7q3KUBjZ
	ypwKeEfpsHKaEi5wCjSQNa/raEvqfR3fqvG+qxDBnwb/ERwWYFifk4oIX6l5IvMrlUgmP5G6Wihnu
	V8nqZglrzVM+kf4EAAczqHta3E7fUQ9AaXK1Ww7N1IojrkeIPEbpYkQ8Yz5LOx1RaG08=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQ6-0001Yd-42
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQ6-00089h-3M
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Use LOCK ADD instead of MFENCE for smp_mb()
Message-Id: <E1kPkQ6-00089h-3M@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:42:10 +0000

commit de16a8fa0db7f1879442cf9cfe865eb2e9d98e6d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Sep 21 13:17:30 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Oct 1 11:14:22 2020 +0100

    x86: Use LOCK ADD instead of MFENCE for smp_mb()
    
    MFENCE is overly heavyweight for SMP semantics on WB memory, because it also
    orders weaker cached writes, and flushes the WC buffers.
    
    This technique was used as an optimisation in Java[1], and later adopted by
    Linux[2] where it was measured to have a 60% performance improvement in VirtIO
    benchmarks.
    
    The stack is used because it is hot in the L1 cache, and a -4 offset is used
    to avoid creating a false data dependency on live data.
    
    For 64bit userspace, the Red Zone needs to be considered.  Use -32 to allow
    for a reasonable quantity of Red Zone data, but still have a 50% chance of
    hitting the same cache line as %rsp.
    
    Fix up the 32 bit definitions in HVMLoader and libxc to avoid a false data
    dependency.
    
    [1] https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
    [2] https://git.kernel.org/torvalds/c/450cbdd0125cfa5d7bbf9e2a6b6961cc48d29730
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/firmware/hvmloader/util.h   | 2 +-
 tools/libs/ctrl/include/xenctrl.h | 4 ++--
 xen/include/asm-x86/system.h      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 31889de634..4f0baade0e 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -133,7 +133,7 @@ static inline void cpu_relax(void)
 #define barrier() asm volatile ( "" : : : "memory" )
 #define rmb()     barrier()
 #define wmb()     barrier()
-#define mb()      asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define mb()      asm volatile ( "lock addl $0, -4(%%esp)" ::: "memory" )
 
 /*
  * Divide a 64-bit dividend by a 32-bit divisor.
diff --git a/tools/libs/ctrl/include/xenctrl.h b/tools/libs/ctrl/include/xenctrl.h
index ba70bec9c4..3796425e1e 100644
--- a/tools/libs/ctrl/include/xenctrl.h
+++ b/tools/libs/ctrl/include/xenctrl.h
@@ -68,11 +68,11 @@
 #define xen_barrier() asm volatile ( "" : : : "memory")
 
 #if defined(__i386__)
-#define xen_mb()  asm volatile ( "lock; addl $0,0(%%esp)" : : : "memory" )
+#define xen_mb()  asm volatile ( "lock addl $0, -4(%%esp)" ::: "memory" )
 #define xen_rmb() xen_barrier()
 #define xen_wmb() xen_barrier()
 #elif defined(__x86_64__)
-#define xen_mb()  asm volatile ( "mfence" : : : "memory")
+#define xen_mb()  asm volatile ( "lock addl $0, -32(%%rsp)" ::: "memory" )
 #define xen_rmb() xen_barrier()
 #define xen_wmb() xen_barrier()
 #elif defined(__arm__)
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 45c183bd10..630909965e 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -220,7 +220,7 @@ static always_inline unsigned long __xadd(
  *
  * Refer to the vendor system programming manuals for further details.
  */
-#define smp_mb()        mb()
+#define smp_mb()        asm volatile ( "lock addl $0, -4(%%rsp)" ::: "memory" )
 #define smp_rmb()       barrier()
 #define smp_wmb()       barrier()
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3211.9312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQQ-0002Yp-Al; Tue, 06 Oct 2020 10:42:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3211.9312; Tue, 06 Oct 2020 10:42:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQQ-0002Yi-6s; Tue, 06 Oct 2020 10:42:30 +0000
Received: by outflank-mailman (input) for mailman id 3211;
 Tue, 06 Oct 2020 10:42:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQP-0002Yb-2V
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f7d4c06-132e-406b-8c92-a7881016a271;
 Tue, 06 Oct 2020 10:42:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQG-0001Yn-Bd
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQG-0008AE-Ar
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQP-0002Yb-2V
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:29 +0000
X-Inumbo-ID: 4f7d4c06-132e-406b-8c92-a7881016a271
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f7d4c06-132e-406b-8c92-a7881016a271;
	Tue, 06 Oct 2020 10:42:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j+SL7XTFcvxSLvPxn5MQ1daJylpyE8UpNqUxmHSPToE=; b=MZsyem6/UBfePluCST9inEEYOY
	4BCZhQR0H6tDZCI56pwM9T1sAva3EjGnVIBPZoLbXF1Ov67Ed/x/2eSt++I1vYLFBLYUgo6A0zfUz
	Mg+WEd5ieog5sjHy3/NCo1V39leSLb3tB5uYmyWwwEegJd20860meYqBrR8YkjH6oDp0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQG-0001Yn-Bd
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQG-0008AE-Ar
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: move libxenlight to tools/libs/light
Message-Id: <E1kPkQG-0008AE-Ar@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:42:20 +0000

commit 41aea82de2b581c61482aeddab151ecf3b1bca25
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:09 2020 +0200

    tools/libxl: move libxenlight to tools/libs/light
    
    Carve out all libxenlight related sources and move them to
    tools/libs/light in order to use the generic library build environment.
    
    The closely related sources for libxl-save-helper and the libxl test
    environment are being moved, too.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                                  |   31 +-
 tools/Rules.mk                              |   11 +-
 tools/configure                             |    2 +-
 tools/configure.ac                          |    2 +-
 tools/golang/xenlight/Makefile              |    2 +-
 tools/libs/Makefile                         |    1 +
 tools/libs/light/CODING_STYLE               |  330 ++
 tools/libs/light/Makefile                   |  277 ++
 tools/libs/light/check-libxl-api-rules      |   23 +
 tools/libs/light/flexarray.c                |  124 +
 tools/libs/light/flexarray.h                |   54 +
 tools/libs/light/gentest.py                 |  374 +++
 tools/libs/light/gentypes.py                |  797 +++++
 tools/libs/light/idl.py                     |  377 +++
 tools/libs/light/idl.txt                    |  214 ++
 tools/libs/light/include/libxl.h            | 2732 +++++++++++++++
 tools/libs/light/include/libxl_event.h      |  632 ++++
 tools/libs/light/include/libxl_json.h       |   96 +
 tools/libs/light/include/libxl_utils.h      |  194 ++
 tools/libs/light/include/libxl_uuid.h       |   80 +
 tools/libs/light/libxl.c                    |  831 +++++
 tools/libs/light/libxl_9pfs.c               |   52 +
 tools/libs/light/libxl_aoutils.c            |  667 ++++
 tools/libs/light/libxl_arch.h               |   96 +
 tools/libs/light/libxl_arm.c                | 1230 +++++++
 tools/libs/light/libxl_arm.h                |   48 +
 tools/libs/light/libxl_arm_acpi.c           |  413 +++
 tools/libs/light/libxl_arm_no_acpi.c        |   40 +
 tools/libs/light/libxl_bootloader.c         |  680 ++++
 tools/libs/light/libxl_checkpoint_device.c  |  278 ++
 tools/libs/light/libxl_colo.h               |  148 +
 tools/libs/light/libxl_colo_nic.c           |  316 ++
 tools/libs/light/libxl_colo_proxy.c         |  438 +++
 tools/libs/light/libxl_colo_qdisk.c         |  230 ++
 tools/libs/light/libxl_colo_restore.c       | 1093 ++++++
 tools/libs/light/libxl_colo_save.c          |  714 ++++
 tools/libs/light/libxl_console.c            |  802 +++++
 tools/libs/light/libxl_convert_callout.c    |  173 +
 tools/libs/light/libxl_cpuid.c              |  628 ++++
 tools/libs/light/libxl_cpupool.c            |  452 +++
 tools/libs/light/libxl_create.c             | 2310 +++++++++++++
 tools/libs/light/libxl_device.c             | 2090 ++++++++++++
 tools/libs/light/libxl_disk.c               | 1390 ++++++++
 tools/libs/light/libxl_dm.c                 | 3795 +++++++++++++++++++++
 tools/libs/light/libxl_dom.c                | 1469 ++++++++
 tools/libs/light/libxl_dom_save.c           |  564 ++++
 tools/libs/light/libxl_dom_suspend.c        |  677 ++++
 tools/libs/light/libxl_domain.c             | 2462 ++++++++++++++
 tools/libs/light/libxl_event.c              | 2467 ++++++++++++++
 tools/libs/light/libxl_exec.c               |  473 +++
 tools/libs/light/libxl_flask.c              |   79 +
 tools/libs/light/libxl_fork.c               |  734 ++++
 tools/libs/light/libxl_freebsd.c            |  252 ++
 tools/libs/light/libxl_genid.c              |  117 +
 tools/libs/light/libxl_internal.c           |  806 +++++
 tools/libs/light/libxl_internal.h           | 4859 +++++++++++++++++++++++++++
 tools/libs/light/libxl_json.c               | 1191 +++++++
 tools/libs/light/libxl_libfdt_compat.c      |   94 +
 tools/libs/light/libxl_libfdt_compat.h      |   90 +
 tools/libs/light/libxl_linux.c              |  375 +++
 tools/libs/light/libxl_mem.c                |  651 ++++
 tools/libs/light/libxl_netbsd.c             |  131 +
 tools/libs/light/libxl_netbuffer.c          |  532 +++
 tools/libs/light/libxl_nic.c                |  544 +++
 tools/libs/light/libxl_no_colo.c            |   62 +
 tools/libs/light/libxl_no_convert_callout.c |   35 +
 tools/libs/light/libxl_nocpuid.c            |   67 +
 tools/libs/light/libxl_nonetbuffer.c        |   54 +
 tools/libs/light/libxl_numa.c               |  535 +++
 tools/libs/light/libxl_osdeps.h             |  130 +
 tools/libs/light/libxl_paths.c              |   71 +
 tools/libs/light/libxl_pci.c                | 2508 ++++++++++++++
 tools/libs/light/libxl_psr.c                |  562 ++++
 tools/libs/light/libxl_pvcalls.c            |   37 +
 tools/libs/light/libxl_qmp.c                | 1934 +++++++++++
 tools/libs/light/libxl_remus.c              |  425 +++
 tools/libs/light/libxl_remus_disk_drbd.c    |  232 ++
 tools/libs/light/libxl_save_callout.c       |  430 +++
 tools/libs/light/libxl_save_helper.c        |  303 ++
 tools/libs/light/libxl_save_msgs_gen.pl     |  396 +++
 tools/libs/light/libxl_sched.c              |  986 ++++++
 tools/libs/light/libxl_sr_stream_format.h   |   69 +
 tools/libs/light/libxl_stream_read.c        |  977 ++++++
 tools/libs/light/libxl_stream_write.c       |  727 ++++
 tools/libs/light/libxl_test_fdevent.c       |   79 +
 tools/libs/light/libxl_test_fdevent.h       |   12 +
 tools/libs/light/libxl_test_timedereg.c     |  100 +
 tools/libs/light/libxl_test_timedereg.h     |    9 +
 tools/libs/light/libxl_tmem.c               |   76 +
 tools/libs/light/libxl_types.idl            | 1224 +++++++
 tools/libs/light/libxl_types_internal.idl   |   57 +
 tools/libs/light/libxl_usb.c                | 2158 ++++++++++++
 tools/libs/light/libxl_utils.c              | 1272 +++++++
 tools/libs/light/libxl_uuid.c               |  163 +
 tools/libs/light/libxl_vdispl.c             |  222 ++
 tools/libs/light/libxl_vkb.c                |  353 ++
 tools/libs/light/libxl_vnuma.c              |  327 ++
 tools/libs/light/libxl_vsnd.c               |  686 ++++
 tools/libs/light/libxl_vtpm.c               |  248 ++
 tools/libs/light/libxl_x86.c                |  852 +++++
 tools/libs/light/libxl_x86_acpi.c           |  252 ++
 tools/libs/light/libxl_x86_acpi.h           |   35 +
 tools/libs/light/libxl_xshelp.c             |  329 ++
 tools/libs/light/osdeps.c                   |   76 +
 tools/libs/light/test_common.c              |   57 +
 tools/libs/light/test_common.h              |   29 +
 tools/libs/light/test_fdderegrace.c         |   56 +
 tools/libs/light/test_timedereg.c           |   11 +
 tools/libs/uselibs.mk                       |    2 +
 tools/libxl/Makefile                        |  278 +-
 tools/libxl/check-libxl-api-rules           |   23 -
 tools/libxl/flexarray.c                     |  124 -
 tools/libxl/flexarray.h                     |   54 -
 tools/libxl/gentest.py                      |  374 ---
 tools/libxl/gentypes.py                     |  797 -----
 tools/libxl/idl.py                          |  377 ---
 tools/libxl/idl.txt                         |  214 --
 tools/libxl/libxl.c                         |  831 -----
 tools/libxl/libxl.h                         | 2732 ---------------
 tools/libxl/libxl_9pfs.c                    |   52 -
 tools/libxl/libxl_aoutils.c                 |  667 ----
 tools/libxl/libxl_arch.h                    |   96 -
 tools/libxl/libxl_arm.c                     | 1230 -------
 tools/libxl/libxl_arm.h                     |   48 -
 tools/libxl/libxl_arm_acpi.c                |  413 ---
 tools/libxl/libxl_arm_no_acpi.c             |   40 -
 tools/libxl/libxl_bootloader.c              |  680 ----
 tools/libxl/libxl_checkpoint_device.c       |  278 --
 tools/libxl/libxl_colo.h                    |  148 -
 tools/libxl/libxl_colo_nic.c                |  316 --
 tools/libxl/libxl_colo_proxy.c              |  438 ---
 tools/libxl/libxl_colo_qdisk.c              |  230 --
 tools/libxl/libxl_colo_restore.c            | 1093 ------
 tools/libxl/libxl_colo_save.c               |  714 ----
 tools/libxl/libxl_console.c                 |  802 -----
 tools/libxl/libxl_convert_callout.c         |  173 -
 tools/libxl/libxl_cpuid.c                   |  628 ----
 tools/libxl/libxl_cpupool.c                 |  452 ---
 tools/libxl/libxl_create.c                  | 2310 -------------
 tools/libxl/libxl_device.c                  | 2090 ------------
 tools/libxl/libxl_disk.c                    | 1390 --------
 tools/libxl/libxl_dm.c                      | 3795 ---------------------
 tools/libxl/libxl_dom.c                     | 1469 --------
 tools/libxl/libxl_dom_save.c                |  564 ----
 tools/libxl/libxl_dom_suspend.c             |  677 ----
 tools/libxl/libxl_domain.c                  | 2462 --------------
 tools/libxl/libxl_event.c                   | 2467 --------------
 tools/libxl/libxl_event.h                   |  632 ----
 tools/libxl/libxl_exec.c                    |  473 ---
 tools/libxl/libxl_flask.c                   |   79 -
 tools/libxl/libxl_fork.c                    |  734 ----
 tools/libxl/libxl_freebsd.c                 |  252 --
 tools/libxl/libxl_genid.c                   |  117 -
 tools/libxl/libxl_internal.c                |  806 -----
 tools/libxl/libxl_internal.h                | 4859 ---------------------------
 tools/libxl/libxl_json.c                    | 1191 -------
 tools/libxl/libxl_json.h                    |   96 -
 tools/libxl/libxl_libfdt_compat.c           |   94 -
 tools/libxl/libxl_libfdt_compat.h           |   90 -
 tools/libxl/libxl_linux.c                   |  375 ---
 tools/libxl/libxl_mem.c                     |  651 ----
 tools/libxl/libxl_netbsd.c                  |  131 -
 tools/libxl/libxl_netbuffer.c               |  532 ---
 tools/libxl/libxl_nic.c                     |  544 ---
 tools/libxl/libxl_no_colo.c                 |   62 -
 tools/libxl/libxl_no_convert_callout.c      |   35 -
 tools/libxl/libxl_nocpuid.c                 |   67 -
 tools/libxl/libxl_nonetbuffer.c             |   54 -
 tools/libxl/libxl_numa.c                    |  535 ---
 tools/libxl/libxl_osdeps.h                  |  130 -
 tools/libxl/libxl_paths.c                   |   71 -
 tools/libxl/libxl_pci.c                     | 2508 --------------
 tools/libxl/libxl_psr.c                     |  562 ----
 tools/libxl/libxl_pvcalls.c                 |   37 -
 tools/libxl/libxl_qmp.c                     | 1934 -----------
 tools/libxl/libxl_remus.c                   |  425 ---
 tools/libxl/libxl_remus_disk_drbd.c         |  232 --
 tools/libxl/libxl_save_callout.c            |  430 ---
 tools/libxl/libxl_save_helper.c             |  303 --
 tools/libxl/libxl_save_msgs_gen.pl          |  396 ---
 tools/libxl/libxl_sched.c                   |  986 ------
 tools/libxl/libxl_sr_stream_format.h        |   69 -
 tools/libxl/libxl_stream_read.c             |  977 ------
 tools/libxl/libxl_stream_write.c            |  727 ----
 tools/libxl/libxl_test_fdevent.c            |   79 -
 tools/libxl/libxl_test_fdevent.h            |   12 -
 tools/libxl/libxl_test_timedereg.c          |  100 -
 tools/libxl/libxl_test_timedereg.h          |    9 -
 tools/libxl/libxl_tmem.c                    |   76 -
 tools/libxl/libxl_types.idl                 | 1224 -------
 tools/libxl/libxl_types_internal.idl        |   57 -
 tools/libxl/libxl_usb.c                     | 2158 ------------
 tools/libxl/libxl_utils.c                   | 1272 -------
 tools/libxl/libxl_utils.h                   |  194 --
 tools/libxl/libxl_uuid.c                    |  163 -
 tools/libxl/libxl_uuid.h                    |   80 -
 tools/libxl/libxl_vdispl.c                  |  222 --
 tools/libxl/libxl_vkb.c                     |  353 --
 tools/libxl/libxl_vnuma.c                   |  327 --
 tools/libxl/libxl_vsnd.c                    |  686 ----
 tools/libxl/libxl_vtpm.c                    |  248 --
 tools/libxl/libxl_x86.c                     |  852 -----
 tools/libxl/libxl_x86_acpi.c                |  252 --
 tools/libxl/libxl_x86_acpi.h                |   35 -
 tools/libxl/libxl_xshelp.c                  |  329 --
 tools/libxl/osdeps.c                        |   76 -
 tools/libxl/test_common.c                   |   57 -
 tools/libxl/test_common.h                   |   29 -
 tools/libxl/test_fdderegrace.c              |   56 -
 tools/libxl/test_timedereg.c                |   11 -
 tools/ocaml/libs/xl/Makefile                |    8 +-
 211 files changed, 63046 insertions(+), 62700 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5e8c47e2db..f30550255f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -128,6 +128,22 @@ tools/libs/guest/xc_core.h
 tools/libs/guest/xc_core_arm.h
 tools/libs/guest/xc_core_x86.h
 tools/libs/guest/xc_private.h
+tools/libs/light/_*.[ch]
+tools/libs/light/*.pyc
+tools/libs/light/_libxl.api-for-check
+tools/libs/light/*.api-ok
+tools/libs/light/libxenlight.map
+tools/libs/light/libxl-save-helper
+tools/libs/light/dsdt*
+tools/libs/light/mk_dsdt
+tools/libs/light/ssdt*
+tools/libs/light/testidl
+tools/libs/light/testidl.c
+tools/libs/light/test_timedereg
+tools/libs/light/test_fdderegrace
+tools/libs/light/tmp.*
+tools/libs/light/xenlight.pc
+tools/libs/light/include/_*.h
 tools/libs/stat/_paths.h
 tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
@@ -216,16 +232,8 @@ tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-tools/libxl/_libxl.api-for-check
-tools/libxl/*.api-ok
 tools/libxl/*.pc
-tools/libxl/dsdt*
 tools/libxl/libxlu_cfg_y.output
-tools/libxl/mk_dsdt
-tools/libxl/ssdt*
-tools/libxl/testenum
-tools/libxl/testenum.c
-tools/libxl/tmp.*
 tools/misc/cpuperf/cpuperf-perfcntr
 tools/misc/cpuperf/cpuperf-xen
 tools/misc/xc_shadow
@@ -380,13 +388,6 @@ tools/include/xen-foreign/arm64.h
 tools/misc/xen-hptool
 tools/misc/xen-mfndump
 tools/libs/toolcore/include/_*.h
-tools/libxl/_*.[ch]
-tools/libxl/testidl
-tools/libxl/testidl.c
-tools/libxl/*.pyc
-tools/libxl/libxl-save-helper
-tools/libxl/test_timedereg
-tools/libxl/test_fdderegrace
 tools/firmware/etherboot/eb-roms.h
 tools/firmware/etherboot/gpxe-git-snapshot.tar.gz
 tools/misc/xenhypfs
diff --git a/tools/Rules.mk b/tools/Rules.mk
index a71abb2e4f..a68dbb9de8 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,9 +15,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxenlight    = $(XEN_ROOT)/tools/libxl
-# Currently libxlutil lives in the same directory as libxenlight
-XEN_libxlutil      = $(XEN_libxenlight)
+XEN_libxlutil      = $(XEN_ROOT)/tools/libxl
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
@@ -107,6 +105,8 @@ ifeq ($(CONFIG_Linux),y)
 LDLIBS_libxenstore += -ldl
 endif
 
+CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
+
 ifeq ($(debug),y)
 # Disable optimizations
 CFLAGS += -O0 -fno-omit-frame-pointer
@@ -116,11 +116,6 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
-SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest)
-LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension)
-SHLIB_libxenlight  = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight)
-
 CFLAGS_libxlutil = -I$(XEN_libxlutil)
 SHDEPS_libxlutil = $(SHLIB_libxenlight)
 LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension)
diff --git a/tools/configure b/tools/configure
index edcdcf4f73..8a708e9baa 100755
--- a/tools/configure
+++ b/tools/configure
@@ -585,7 +585,7 @@ PACKAGE_STRING='Xen Hypervisor Tools 4.15'
 PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='https://www.xen.org/'
 
-ac_unique_file="libxl/libxl.c"
+ac_unique_file="libs/light/libxl.c"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
diff --git a/tools/configure.ac b/tools/configure.ac
index 6614a4f130..ee8ba5ff24 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -4,7 +4,7 @@
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [https://www.xen.org/])
-AC_CONFIG_SRCDIR([libxl/libxl.c])
+AC_CONFIG_SRCDIR([libs/light/libxl.c])
 AC_CONFIG_FILES([
 ../config/Tools.mk
 hotplug/FreeBSD/rc.d/xencommons
diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index b17095e64b..fd8e4893db 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -8,7 +8,7 @@ GOXL_INSTALL_DIR = $(GOCODE_DIR)/src/$(XEN_GOCODE_URL)/xenlight/
 
 GO ?= go
 
-LIBXL_SRC_DIR = ../../libxl
+LIBXL_SRC_DIR = $(XEN_ROOT)/tools/libs/light
 
 .PHONY: all
 all: build
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index e8fcd59214..c41455c604 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -15,6 +15,7 @@ SUBDIRS-y += hypfs
 SUBDIRS-y += store
 SUBDIRS-y += stat
 SUBDIRS-$(CONFIG_Linux) += vchan
+SUBDIRS-y += light
 
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE
new file mode 100644
index 0000000000..3d572f6925
--- /dev/null
+++ b/tools/libs/light/CODING_STYLE
@@ -0,0 +1,330 @@
+LIBXENLIGHT CODING STYLE
+========================
+
+
+AN APOLOGY AND WARNING
+----------------------
+
+Much of the code in libxl does not yet follow this coding style
+document in every respect.  However, new code is expected to conform.
+
+Patches to improve the style of existing code are welcome.  Please
+separate these out from functional changes.
+
+If it is not feasible to conform fully to the style while patching old
+code, without doing substantial style reengineering first, we may
+accept patches which contain nonconformant elements, provided that
+they don't make the coding style problem worse overall.
+
+In this case, the new code should conform to the prevailing style in
+the area being touched.
+
+
+MEMORY ALLOCATION
+-----------------
+
+Memory allocation for libxl-internal purposes should normally be done
+with the provided gc mechanisms; there is then no need to free.  See
+"libxl memory management" in libxl.h.
+
+
+CONVENTIONAL VARIABLE NAMES
+---------------------------
+
+The following local variable names should be used where applicable:
+
+  int rc;    /* a libxl error code - and not anything else */
+  int r;     /* the return value from a system call (or libxc call) */
+  bool ok;   /* the success return value from a boolean function */
+
+  uint32_t domid;
+  libxl__gc *gc;
+  libxl__egc *egc;
+  libxl__ao *ao;
+
+  libxl_foo_bar_state *fbs;    /* local variable */
+  libxl_foo_bar_state foo_bar; /* inside another state struct */
+
+
+CONVENIENCE MACROS
+------------------
+
+There are a number of convenience macros which shorten the program and
+avoid opportunity for mistakes.  In some cases non-use of the macros
+produces functional bugs or incorrect error handling.  Use the macros
+whenever they are applicable.  For example:
+
+ Usually, don't use:     Instead, use (see libxl_internal.h):
+  libxl__log[v]           LOG, LOGE, LOGEV
+  libxl__sprintf          GCSPRINTF
+  libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
+  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
+--------------
+
+Unless, there are good reasons to do otherwise, the following error
+handling and cleanup paradigm should be used:
+
+  * All local variables referring to resources which might need
+    cleaning up are declared at the top of the function, and
+    initialised to a sentinel value indicating "nothing allocated".
+    For example,
+            libxl_evgen_disk_eject *evg = NULL;
+            int nullfd = -1;
+
+  * If the function is to return a libxl error value, `rc' is
+    used to contain the error code, but it is NOT initialised:
+            int rc;
+
+  * There is only one error cleanup path out of the function.  It
+    starts with a label `out:'.  That error cleanup path checks for
+    each allocated resource and frees it iff necessary.  It then
+    returns rc.  For example,
+         out:
+             if (evg) libxl__evdisable_disk_eject(gc, evg);
+             if (nullfd >= 0) close(nullfd);
+             return rc;
+
+  * Function calls which might fail (ie most function calls) are
+    handled by putting the return/status value into a variable, and
+    then checking it in a separate statement:
+            char *dompath = libxl__xs_get_dompath(gc, bl->domid);
+            if (!dompath) { rc = ERROR_FAIL; goto out; }
+
+  * If a resource is freed in the main body of the function (for
+    example, in a loop), the corresponding variable has to be reset to
+    the sentinel at the point where it's freed.
+
+Whether to use the `out' path for successful returns as well as error
+returns is a matter of taste and convenience for the specific
+function.  Not reusing the out path is fine if the duplicated function
+exit code is only `CTX_UNLOCK; GC_FREE;' (or similar).
+
+If you reuse the `out' path for successful returns, there may be
+resources which are to be returned to the caller rather than freed.
+In that case you have to reset the local variable to `nothing here',
+to avoid the resource being freed on the out path.  That resetting
+should be done immediately after the resource value is stored at the
+applicable _r function parameter (or equivalent).  Do not test `rc' in
+the out section, to discover whether to free things.
+
+The uses of the single-line formatting in the examples above are
+permitted exceptions to the usual libxl code formatting rules.
+
+
+
+IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
+--------------------------------------------------
+
+Nontrivial data structures (in structs) should come with an idempotent
+_dispose function, which must free all resources associated with the
+data structure (but not free the struct itself).
+
+Such a struct should also come with an _init function which
+initialises the struct so that _dispose is a no-op.
+
+
+ASYNCHRONOUS/LONG-RUNNING OPERATIONS
+------------------------------------
+
+All long-running operations in libxl need to use the asynchronous
+operation machinery.  Consult the programmer documentation in
+libxl_internal.h for details - search for "Machinery for asynchronous
+operations".
+
+The code for asynchronous operations should be laid out in
+chronological order.  That is, where there is a chain of callback
+functions, each subsequent function should be, textually, the next
+function in the file.  This will normally involve predeclaring the
+callback functions.  Synchronous helper functions should be separated
+out into a section preceding the main callback chain.
+
+Control flow arrangements in asynchronous operations should be made as
+simple as possible, because it can otherwise be very hard to see
+through the tangle.
+
+
+When inventing a new sub-operation in asynchronous code, consider
+whether to structure it formally as a sub-operation with its own state
+structure.  (See, for example, libxl__datacopier_*.)
+
+An ao-suboperation state structure should contain, in this order:
+  * fields that the caller must fill in, and which are,
+    effectively, the parameters to the operation, including:
+      - libxl__ao *ao
+      - the callback function pointer(s), which
+        should be named callback or callback_*.
+  * shared information fields or ones used for returning information
+    to the calling operation
+  * private fields
+These sections should be clearly demarcated by comments.
+
+An asynchronous operation should normally have an idempotent stop or
+cancel function.  It should normally also have an _init function for
+its state struct, which arranges that the stop is a no-op.
+
+The permitted order of calls into your ao operation's methods must be
+documented in comments, if it is nontrivial.
+
+
+When using an ao sub-operation, you should normally:
+ * Physically include the sub-operation state struct in your
+   own state struct;
+ * Use CONTAINER_OF to find your own state struct at the start of
+   your implementations of the sub-operation callback functions;
+ * Unconditionally initialise the sub-operation's struct (with its
+   _init method) in your own _init method.
+ * Unconditionally cancel or destroy the sub-operation in your own
+   cancel or destroy method.
+
+
+FORMATTING AND NAMING
+---------------------
+
+Blatantly copied from qemu and linux with few modifications.
+
+
+1. Whitespace
+
+Of course, the most important aspect in any coding style is whitespace.
+Crusty old coders who have trouble spotting the glasses on their noses
+can tell the difference between a tab and eight spaces from a distance
+of approximately fifteen parsecs.  Many a flamewar have been fought and
+lost on this issue.
+
+Libxenlight indents are four spaces.  Tabs are never used, except in
+Makefiles where they have been irreversibly coded into the syntax.
+Spaces of course are superior to tabs because:
+
+ - You have just one way to specify whitespace, not two.  Ambiguity breeds
+   mistakes.
+ - The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
+ - Tab indents push your code to the right, making your screen seriously
+   unbalanced.
+ - Tabs will be rendered incorrectly on editors who are misconfigured not
+   to use tab stops of eight positions.
+ - Tabs are rendered badly in patches, causing off-by-one errors in almost
+   every line.
+ - It is the libxenlight coding style.
+
+Do not leave whitespace dangling off the ends of lines.
+
+
+2. Line width
+
+Lines are limited to 75 characters.
+
+Rationale:
+ - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
+   xterms and use vi in all of them.  The best way to punish them is to
+   let them keep doing it.
+ - In an 80 column terminal, some room needs to be left for > quoting
+   characters, +/- diff characters, and so on, in emails.
+ - Code and especially patches is much more readable if limited to a sane
+   line length.  Eighty is traditional.
+ - It is the libxenlight coding style.
+
+
+3. Naming
+
+C is a Spartan language, and so should your naming be.  Unlike Modula-2
+and Pascal programmers, C programmers do not use cute names like
+ThisVariableIsATemporaryCounter.  A C programmer would call that
+variable "tmp", which is much easier to write, and not the least more
+difficult to understand.
+
+HOWEVER, while mixed-case names are frowned upon, descriptive names for
+global variables are a must.  To call a global function "foo" is a
+shooting offense.
+
+GLOBAL variables (to be used only if you _really_ need them) need to
+have descriptive names, as do global functions.  If you have a function
+that counts the number of active users, you should call that
+"count_active_users()" or similar, you should _not_ call it "cntusr()".
+
+Encoding the type of a function into the name (so-called Hungarian
+notation) is brain damaged - the compiler knows the types anyway and can
+check those, and it only confuses the programmer.
+
+LOCAL variable names should be short, and to the point.  If you have
+some random integer loop counter, it should probably be called "i".
+Calling it "loop_counter" is non-productive, if there is no chance of it
+being mis-understood.  Similarly, "tmp" can be just about any type of
+variable that is used to hold a temporary value.
+
+Local variables used to store return values should have descriptive name
+like "rc" or "ret". Following the same reasoning the label used as exit
+path should be called "out".
+
+Function arguments which are used to return values to the caller
+should be suffixed `_r' or `_out'.
+
+Variables, type names and function names are
+lower_case_with_underscores.
+Type names and function names use the prefix libxl__ when internal to
+libxenlight and libxl_ when exported in libxl.h.
+Xl should avoid using libxl_ and libxl__ as prefix for its own function
+names.
+
+When wrapping standard library functions, use the prefix libxl_ to alert
+readers that they are seeing a wrapped version; otherwise avoid this prefix.
+
+Typedefs are used to eliminate the redundant 'struct' keyword.
+It is the libxenlight coding style.
+
+
+4. Statements
+
+Don't put multiple statements on a single line.
+Don't put multiple assignments on a single line either.
+Error code paths with an if statement and a goto or a return on the same
+line are allowed. Examples:
+
+    if (rc) goto out;
+    if (rc < 0) return;
+
+Libxenlight coding style is super simple.  Avoid tricky expressions.
+
+
+5. Block structure
+
+Every indented statement is braced, but blocks that contain just one
+statement may have the braces omitted.  To avoid confusion, either all
+the blocks in an if...else chain have braces, or none of them do.
+
+The opening brace is on the line that contains the control flow
+statement that introduces the new block; the closing brace is on the
+same line as the else keyword, or on a line by itself if there is no
+else keyword.  Examples:
+
+    if (a == 5) {
+        printf("a was 5.\n");
+    } else if (a == 6) {
+        printf("a was 6.\n");
+    } else {
+        printf("a was something else entirely.\n");
+    }
+
+    if (a == 5)
+        printf("a was 5.\n");
+
+An exception is the opening brace for a function; for reasons of tradition
+and clarity it comes on a line by itself:
+
+    void a_function(void)
+    {
+        do_something();
+    }
+
+Rationale: a consistent (except for functions...) bracing style reduces
+ambiguity and avoids needless churn when lines are added or removed.
+Furthermore, it is the libxenlight coding style.
+
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
new file mode 100644
index 0000000000..f58a3214e5
--- /dev/null
+++ b/tools/libs/light/Makefile
@@ -0,0 +1,277 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SRCS-y += osdeps.c
+SRCS-y += libxl_paths.c
+SRCS-y += libxl_bootloader.c
+SRCS-y += flexarray.c
+ifeq ($(CONFIG_LIBNL),y)
+SRCS-y += libxl_netbuffer.c
+else
+SRCS-y += libxl_nonetbuffer.c
+endif
+ifeq ($(CONFIG_X86),y)
+SRCS-y += libxl_convert_callout.c
+else
+SRCS-y += libxl_no_convert_callout.c
+endif
+SRCS-y += libxl_remus.c
+SRCS-y += libxl_checkpoint_device.c
+SRCS-y += libxl_remus_disk_drbd.c
+ifeq ($(CONFIG_LIBNL),y)
+SRCS-y += libxl_colo_restore.c
+SRCS-y += libxl_colo_save.c
+SRCS-y += libxl_colo_qdisk.c
+SRCS-y += libxl_colo_proxy.c
+SRCS-y += libxl_colo_nic.c
+else
+SRCS-y += libxl_no_colo.c
+endif
+
+ACPI_PATH  = $(XEN_ROOT)/tools/libacpi
+DSDT_FILES-$(CONFIG_X86) = dsdt_pvh.c
+ACPI_OBJS  = $(patsubst %.c,%.o,$(DSDT_FILES-y)) build.o static_tables.o
+ACPI_PIC_OBJS = $(patsubst %.o,%.opic,$(ACPI_OBJS))
+$(DSDT_FILES-y): acpi
+vpath build.c $(ACPI_PATH)/
+vpath static_tables.c $(ACPI_PATH)/
+
+.PHONY: acpi
+acpi:
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
+
+SRCS-$(CONFIG_X86) += $(ACPI_OBJS:.o=.c)
+
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -I.
+
+SRCS-$(CONFIG_X86) += libxl_cpuid.c
+SRCS-$(CONFIG_X86) += libxl_x86.c
+SRCS-$(CONFIG_X86) += libxl_psr.c
+SRCS-$(CONFIG_X86) += libxl_x86_acpi.c
+SRCS-$(CONFIG_ARM) += libxl_nocpuid.c
+SRCS-$(CONFIG_ARM) += libxl_arm.c
+SRCS-$(CONFIG_ARM) += libxl_libfdt_compat.c
+ifeq ($(CONFIG_ARM_64),y)
+DSDT_FILES-y = dsdt_anycpu_arm.c
+SRCS-y += libxl_arm_acpi.c
+SRCS-y += $(DSDT_FILES-y)
+dsdt_anycpu_arm.c:
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) DSDT_FILES="$(DSDT_FILES-y)"
+else
+SRCS-$(CONFIG_ARM) += libxl_arm_no_acpi.c
+endif
+
+SRCS-OS-$(CONFIG_NetBSD) = libxl_netbsd.c
+SRCS-OS-$(CONFIG_Linux) = libxl_linux.c
+SRCS-OS-$(CONFIG_FreeBSD) = libxl_freebsd.c
+ifeq ($(SRCS-OS-y),)
+$(error Your Operating System is not supported by libxenlight, \
+please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
+endif
+SRCS-y += $(SRCS-OS-y)
+
+SRCS-y += libxl.c
+SRCS-y += libxl_create.c
+SRCS-y += libxl_dm.c
+SRCS-y += libxl_pci.c
+SRCS-y += libxl_dom.c
+SRCS-y += libxl_exec.c
+SRCS-y += libxl_xshelp.c
+SRCS-y += libxl_device.c
+SRCS-y += libxl_internal.c
+SRCS-y += libxl_utils.c
+SRCS-y += libxl_uuid.c
+SRCS-y += libxl_json.c
+SRCS-y += libxl_aoutils.c
+SRCS-y += libxl_numa.c
+SRCS-y += libxl_vnuma.c
+SRCS-y += libxl_stream_read.c
+SRCS-y += libxl_stream_write.c
+SRCS-y += libxl_save_callout.c
+SRCS-y += _libxl_save_msgs_callout.c
+SRCS-y += libxl_qmp.c
+SRCS-y += libxl_event.c
+SRCS-y += libxl_fork.c
+SRCS-y += libxl_dom_suspend.c
+SRCS-y += libxl_dom_save.c
+SRCS-y += libxl_usb.c
+SRCS-y += libxl_vtpm.c
+SRCS-y += libxl_nic.c
+SRCS-y += libxl_disk.c
+SRCS-y += libxl_console.c
+SRCS-y += libxl_cpupool.c
+SRCS-y += libxl_mem.c
+SRCS-y += libxl_sched.c
+SRCS-y += libxl_tmem.c
+SRCS-y += libxl_9pfs.c
+SRCS-y += libxl_domain.c
+SRCS-y += libxl_vdispl.c
+SRCS-y += libxl_pvcalls.c
+SRCS-y += libxl_vsnd.c
+SRCS-y += libxl_vkb.c
+SRCS-y += libxl_genid.c
+SRCS-y += _libxl_types.c
+SRCS-y += libxl_flask.c
+SRCS-y += _libxl_types_internal.c
+
+ifeq ($(CONFIG_LIBNL),y)
+CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
+endif
+CFLAGS_LIBXL += -Wshadow
+ifeq ($(debug),y)
+CFLAGS_LIBXL += -DCONFIG_DEBUG
+endif
+
+CFLAGS += $(PTHREAD_CFLAGS)
+LDFLAGS += $(PTHREAD_LDFLAGS)
+
+LIBXL_TESTS += timedereg
+LIBXL_TESTS_PROGS = $(LIBXL_TESTS) fdderegrace
+LIBXL_TESTS_INSIDE = $(LIBXL_TESTS) fdevent
+
+# Each entry FOO in LIBXL_TESTS has two main .c files:
+#   libxl_test_FOO.c  "inside libxl" code to support the test case
+#   test_FOO.c        "outside libxl" code to exercise the test case
+# Conventionally there will also be:
+#   libxl_test_FOO.h  interface between the "inside" and "outside" parts
+# The "inside libxl" file is compiled exactly like a piece of libxl, and the
+# "outside libxl" file is compiled exactly like a piece of application
+# code.  They must share information via explicit libxl entrypoints.
+# Unlike proper parts of libxl, it is permissible for libxl_test_FOO.c
+# to use private global variables for its state.  Note that all the
+# "inside" parts are compiled into a single test library, so their
+# symbol names must be unique.
+#
+# To run these tests, either use LD_PRELOAD to get libxenlight_test.so
+# loaded, or rename it to libxenlight.so so it is the target of the
+# appropriate symlinks.
+
+LIBXL_TEST_OBJS += $(foreach t, $(LIBXL_TESTS_INSIDE),libxl_test_$t.opic)
+TEST_PROG_OBJS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t.o) test_common.o
+TEST_PROGS += $(foreach t, $(LIBXL_TESTS_PROGS),test_$t)
+
+AUTOINCS = _libxl_list.h _paths.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
+AUTOSRCS = _libxl_save_msgs_callout.c _libxl_save_msgs_helper.c
+
+CLIENTS = testidl libxl-save-helper
+
+SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
+
+LIBHEADER := libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h
+
+NO_HEADERS_CHK := y
+
+include $(XEN_ROOT)/tools/libs/libs.mk
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
+LDUSELIBS-y += $(PTYFUNCS_LIBS)
+LDUSELIBS-$(CONFIG_LIBNL) += $(LIBNL3_LIBS)
+LDUSELIBS-$(CONFIG_Linux) += -luuid
+LDUSELIBS-$(CONFIG_Linux) += -lrt
+LDUSELIBS-$(CONFIG_ARM) += -lfdt
+LDUSELIBS-y += $(PTHREAD_LIBS)
+LDUSELIBS-y += -lyajl
+LDUSELIBS += $(LDUSELIBS-y)
+
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
+$(ACPI_OBJS) $(ACPI_PIC_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/libxl_x86_acpi.h\"
+$(TEST_PROG_OBJS) _libxl.api-for-check: CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxentoolcore)
+libxl_dom.o libxl_dom.opic: CFLAGS += -I$(XEN_ROOT)/tools  # include libacpi/x86.h
+libxl_x86_acpi.o libxl_x86_acpi.opic: CFLAGS += -I$(XEN_ROOT)/tools
+$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest)
+
+testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
+testidl.c: libxl_types.idl gentest.py include/libxl.h $(AUTOINCS)
+	$(PYTHON) gentest.py libxl_types.idl testidl.c.new
+	mv testidl.c.new testidl.c
+
+build: $(CLIENTS) $(TEST_PROGS) $(AUTOSRCS) $(AUTOINCS)
+
+$(LIB_OBJS) $(PIC_OBJS) $(SAVE_HELPER_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS): $(AUTOINCS) libxl.api-ok
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
+	$(PERL) $^
+	touch $@
+
+_%.api-for-check: include/%.h $(AUTOINCS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
+		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
+		>$@.new
+	mv -f $@.new $@
+
+_libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
+	$(PERL) $^ --prefix=libxl >$@.new
+	$(call move-if-changed,$@.new,$@)
+
+_libxl_save_msgs_helper.c _libxl_save_msgs_callout.c \
+_libxl_save_msgs_helper.h _libxl_save_msgs_callout.h: \
+		libxl_save_msgs_gen.pl
+	$(PERL) -w $< $@ >$@.new
+	$(call move-if-changed,$@.new,$@)
+
+include/libxl.h: _libxl_types.h _libxl_list.h
+include/libxl_json.h: _libxl_types_json.h
+libxl_internal.h: _libxl_types_internal.h _libxl_types_private.h _libxl_types_internal_private.h _paths.h
+libxl_internal_json.h: _libxl_types_internal_json.h
+xl.h: _paths.h
+
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS) $(TEST_PROG_OBJS) $(SAVE_HELPER_OBJS): include/libxl.h
+$(LIB_OBJS) $(PIC_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h
+
+_libxl_type%.h _libxl_type%_json.h _libxl_type%_private.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py
+	$(eval stem = $(notdir $*))
+	$(PYTHON) gentypes.py libxl_type$(stem).idl __libxl_type$(stem).h __libxl_type$(stem)_private.h \
+		__libxl_type$(stem)_json.h  __libxl_type$(stem).c
+	$(call move-if-changed,__libxl_type$(stem).h,_libxl_type$(stem).h)
+	$(call move-if-changed,__libxl_type$(stem)_private.h,_libxl_type$(stem)_private.h)
+	$(call move-if-changed,__libxl_type$(stem)_json.h,_libxl_type$(stem)_json.h)
+	$(call move-if-changed,__libxl_type$(stem).c,_libxl_type$(stem).c)
+
+include/_%.h: _%.h
+	cp $< $@
+
+libxenlight_test.so: $(PIC_OBJS) $(LIBXL_TEST_OBJS)
+	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDUSELIBS) $(APPEND_LDFLAGS)
+
+test_%: test_%.o test_common.o libxenlight_test.so
+	$(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) -lyajl $(APPEND_LDFLAGS)
+
+libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
+	$(CC) $(LDFLAGS) -o $@ $(SAVE_HELPER_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
+
+testidl: testidl.o libxenlight.so
+	$(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
+
+install: installlocal $(LIBHEADERS)
+
+.PHONY: installlocal
+installlocal: libxl-save-helper
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
+
+uninstall: uninstalllocal
+
+.PHONY: uninstalllocal
+uninstalllocal:
+	rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
+
+clean: cleanlocal
+
+.PHONY: cleanlocal
+cleanlocal:
+	$(RM) -f _*.h *.o $(CLIENTS)
+	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
+	$(RM) -f testidl.c.new testidl.c *.api-ok
+	$(RM) -f $(TEST_PROGS)
+	$(RM) -rf __pycache__
+	$(RM) -f include/_*.h
+	$(RM) -f libxenlight.map
+	$(RM) -f $(AUTOSRCS) $(AUTOINCS)
+	$(MAKE) -C $(ACPI_PATH) ACPI_BUILD_DIR=$(CURDIR) clean
diff --git a/tools/libs/light/check-libxl-api-rules b/tools/libs/light/check-libxl-api-rules
new file mode 100755
index 0000000000..18ff39ca5f
--- /dev/null
+++ b/tools/libs/light/check-libxl-api-rules
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+use strict;
+our $needed=0;
+our $speclineoffset=0;
+our $specfile;
+while (<>) {
+    if (m/^\# (\d+) \"(.*)\"$/) {
+        $speclineoffset = $1 - $. -1;
+        $specfile = $2;
+    }
+    my $file = defined($specfile) ? $specfile : $ARGV;
+    my $line = $speclineoffset + $.;
+    if (m/libxl_asyncop_how[^;]/) {
+        $needed=1;
+    }
+    if (m/LIBXL_EXTERNAL_CALLERS_ONLY/) {
+        $needed=0;
+    }
+    next unless $needed;
+    if (m/\;/) {
+        die "$file:$line:missing LIBXL_EXTERNAL_CALLERS_ONLY";
+    }
+}
diff --git a/tools/libs/light/flexarray.c b/tools/libs/light/flexarray.c
new file mode 100644
index 0000000000..fe40e762e4
--- /dev/null
+++ b/tools/libs/light/flexarray.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_internal.h"
+#include <stdarg.h>
+
+/*
+ * It is safe to store gc in the struct because:
+ * - If it an actual gc, then the flexarray should not be used after the gc
+ *   have been freed.
+ * - If it is a NOGC, then this point to a structure embedded in libxl_ctx,
+ *   therefore will survive across several libxl calls.
+ */
+
+flexarray_t *flexarray_make(libxl__gc *gc, int size, int autogrow)
+{
+    flexarray_t *array;
+
+    GCNEW(array);
+    array->size = size;
+    array->autogrow = autogrow;
+    array->count = 0;
+    array->gc = gc;
+    GCNEW_ARRAY(array->data, size);
+
+    return array;
+}
+
+void flexarray_free(flexarray_t *array)
+{
+    assert(!libxl__gc_is_real(array->gc));
+    free(array->data);
+    free(array);
+}
+
+void flexarray_grow(flexarray_t *array, int extents)
+{
+    int newsize;
+    libxl__gc *gc = array->gc;
+
+    newsize = array->size + extents;
+    GCREALLOC_ARRAY(array->data, newsize);
+    array->size += extents;
+}
+
+int flexarray_set(flexarray_t *array, unsigned int idx, void *ptr)
+{
+    if (idx >= array->size) {
+        int newsize;
+        if (!array->autogrow)
+            return 1;
+        newsize = (array->size * 2 < idx) ? idx + 1 : array->size * 2;
+        flexarray_grow(array, newsize - array->size);
+    }
+    if ( idx + 1 > array->count )
+        array->count = idx + 1;
+    array->data[idx] = ptr;
+    return 0;
+}
+
+int flexarray_append(flexarray_t *array, void *ptr)
+{
+    return flexarray_set(array, array->count, ptr);
+}
+
+int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2)
+{
+    int rc = flexarray_append(array, ptr1);
+    if (!rc)
+        rc = flexarray_append(array, ptr2);
+    return rc;
+}
+
+int flexarray_vappend(flexarray_t *array, ...)
+{
+    va_list va;
+    void *ptr;
+    int ret;
+
+    va_start(va, array);
+    for(ret = 0; (ptr = va_arg(va, void *)); ret++) {
+        if ( flexarray_append(array, ptr) )
+            break;
+    }
+    va_end(va);
+    return ret;
+}
+
+int flexarray_get(flexarray_t *array, int idx, void **ptr)
+{
+    if (idx >= array->size)
+        return 1;
+    *ptr = array->data[idx];
+    return 0;
+}
+
+void **flexarray_contents(flexarray_t *array)
+{
+    void **data;
+    data = array->data;
+    if (!libxl__gc_is_real(array->gc))
+        free(array);
+    return data;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/light/flexarray.h b/tools/libs/light/flexarray.h
new file mode 100644
index 0000000000..a1e86475c4
--- /dev/null
+++ b/tools/libs/light/flexarray.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef FLEXARRAY_H
+#define FLEXARRAY_H
+
+struct libxl__gc;
+
+typedef struct flexarray {
+    int size;
+    int autogrow;
+    unsigned int count;
+    void **data; /* array of pointer */
+    struct libxl__gc *gc;
+} flexarray_t;
+
+/*
+ * NOGC can be used with flexarrays, but flexarray_free will need to be called
+ * to free the struct. The content of the flexarray will not be freed through
+ * flexarray_free.
+ */
+_hidden flexarray_t *flexarray_make(struct libxl__gc *gc_opt,
+                                    int size, int autogrow);
+_hidden void flexarray_free(flexarray_t *array);
+_hidden void flexarray_grow(flexarray_t *array, int extents);
+_hidden int flexarray_set(flexarray_t *array, unsigned int index, void *ptr);
+_hidden int flexarray_append(flexarray_t *array, void *ptr);
+_hidden int flexarray_append_pair(flexarray_t *array, void *ptr1, void *ptr2);
+_hidden int flexarray_vappend(flexarray_t *array, ...);
+_hidden int flexarray_get(flexarray_t *array, int index, void **ptr);
+
+_hidden void **flexarray_contents(flexarray_t *array);
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/light/gentest.py b/tools/libs/light/gentest.py
new file mode 100644
index 0000000000..1cc7eebc82
--- /dev/null
+++ b/tools/libs/light/gentest.py
@@ -0,0 +1,374 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+
+import os
+import sys
+import re
+import random
+
+import idl
+
+def randomize_char(c):
+    if random.random() < 0.5:
+        return str.lower(c)
+    else:
+        return str.upper(c)
+
+def randomize_case(s):
+    r = [randomize_char(c) for c in s]
+    return "".join(r)
+
+def randomize_enum(e):
+    return random.choice([v.name for v in e.values])
+
+handcoded = ["libxl_bitmap", "libxl_key_value_list",
+             "libxl_cpuid_policy_list", "libxl_string_list"]
+
+def gen_rand_init(ty, v, indent = "    ", parent = None):
+    s = ""
+    if isinstance(ty, idl.Enumeration):
+        s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), randomize_enum(ty))
+    elif isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "%s = test_rand(8);\n" % (parent + ty.lenvar.name)
+        s += "%s = calloc(%s, sizeof(*%s));\n" % \
+            (v, parent + ty.lenvar.name, v)
+        s += "assert(%s);\n" % (v, )
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    for (i=0; i<%s; i++)\n" % (parent + ty.lenvar.name)
+        s += gen_rand_init(ty.elem_type, v+"[i]",
+                           indent + "        ", parent)
+        s += "}\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += gen_rand_init(ty.keyvar.type, parent + ty.keyvar.name, indent, parent)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += gen_rand_init(f.type, fexpr, indent + "    ", nparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) \
+     and (parent is None or ty.json_gen_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += gen_rand_init(f.type, fexpr, "", nparent)
+    elif hasattr(ty, "rand_init") and ty.rand_init is not None:
+        s += "%s(%s);\n" % (ty.rand_init,
+                            ty.pass_arg(v, isref=parent is None,
+                                        passby=idl.PASS_BY_REFERENCE))
+    elif ty.typename in ["libxl_uuid", "libxl_mac", "libxl_hwcap", "libxl_ms_vm_genid"]:
+        s += "rand_bytes((uint8_t *)%s, sizeof(*%s));\n" % (v,v)
+    elif ty.typename in ["libxl_domid", "libxl_devid"] or isinstance(ty, idl.Number):
+        s += "%s = test_rand(sizeof(%s) * 8);\n" % \
+             (ty.pass_arg(v, parent is None),
+              ty.pass_arg(v, parent is None))
+    elif ty.typename in ["bool"]:
+        s += "%s = test_rand(2);\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, test_rand(2));\n" % v
+    elif ty.typename in ["char *"]:
+        s += "%s = rand_str();\n" % v
+    elif ty.private:
+        pass
+    elif ty.typename in handcoded:
+        raise Exception("Gen for handcoded %s" % ty.typename)
+    else:
+        raise Exception("Cannot randomly init %s" % ty.typename)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+if __name__ == '__main__':
+    if len(sys.argv) < 3:
+        print("Usage: gentest.py <idl> <implementation>", file=sys.stderr)
+        sys.exit(1)
+
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
+
+    (builtins,types) = idl.parse(sys.argv[1])
+
+    impl = sys.argv[2]
+    f = open(impl, "w")
+    f.write("""
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "libxl.h"
+#include "libxl_utils.h"
+
+static int test_rand(unsigned max)
+{
+    /* We are not using rand() for its cryptographic properies. */
+    return rand() % max;
+}
+
+static char *rand_str(void)
+{
+    int i, sz = test_rand(32);
+    char *s = malloc(sz+1);
+    assert(s);
+    for (i=0; i<sz; i++)
+        s[i] = 'a' + test_rand(26);
+    s[i] = '\\0';
+    return s;
+}
+
+static void rand_bytes(uint8_t *p, size_t sz)
+{
+    int i;
+    for (i=0; i<sz; i++)
+        p[i] = test_rand(256);
+}
+
+static void libxl_bitmap_rand_init(libxl_bitmap *bitmap)
+{
+    int i;
+    bitmap->size = test_rand(16);
+    bitmap->map = calloc(bitmap->size, sizeof(*bitmap->map));
+    assert(bitmap->map);
+    libxl_for_each_bit(i, *bitmap) {
+        if (test_rand(2))
+            libxl_bitmap_set(bitmap, i);
+        else
+            libxl_bitmap_reset(bitmap, i);
+    }
+}
+
+static void libxl_key_value_list_rand_init(libxl_key_value_list *pkvl)
+{
+    int i, nr_kvp = test_rand(16);
+    libxl_key_value_list kvl = calloc(nr_kvp+1, 2*sizeof(char *));
+    assert(kvl);
+
+    for (i = 0; i<2*nr_kvp; i += 2) {
+        kvl[i] = rand_str();
+        if (test_rand(8))
+            kvl[i+1] = rand_str();
+        else
+            kvl[i+1] = NULL;
+    }
+    kvl[i] = NULL;
+    kvl[i+1] = NULL;
+    *pkvl = kvl;
+}
+
+static void libxl_cpuid_policy_list_rand_init(libxl_cpuid_policy_list *pp)
+{
+    int i, nr_policies = test_rand(16);
+    struct {
+        const char *n;
+        int w;
+    } options[] = {
+      /* A random selection from libxl_cpuid_parse_config */
+        {"maxleaf",     32},
+        {"family",       8},
+        {"model",        8},
+        {"stepping",     4},
+        {"localapicid",  8},
+        {"proccount",    8},
+        {"clflush",      8},
+        {"brandid",      8},
+        {"f16c",         1},
+        {"avx",          1},
+        {"osxsave",      1},
+        {"xsave",        1},
+        {"aes",          1},
+        {"popcnt",       1},
+        {"movbe",        1},
+        {"x2apic",       1},
+        {"sse4.2",       1},
+        {"sse4.1",       1},
+        {"dca",          1},
+        {"pdcm",         1},
+        {"procpkg",      6},
+    };
+    const int nr_options = sizeof(options)/sizeof(options[0]);
+    char buf[64];
+    libxl_cpuid_policy_list p = NULL;
+
+    for (i = 0; i < nr_policies; i++) {
+        int opt = test_rand(nr_options);
+        int val = test_rand(1<<options[opt].w);
+        snprintf(buf, 64, \"%s=%#x\", options[opt].n, val);
+        libxl_cpuid_parse_config(&p, buf);
+    }
+    *pp = p;
+}
+
+static void libxl_string_list_rand_init(libxl_string_list *p)
+{
+    int i, nr = test_rand(16);
+    libxl_string_list l = calloc(nr+1, sizeof(char *));
+    assert(l);
+
+    for (i = 0; i<nr; i++) {
+        l[i] = rand_str();
+    }
+    l[i] = NULL;
+    *p = l;
+}
+""")
+    for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
+        if ty.typename not in handcoded:
+            f.write("static void %s_rand_init(%s);\n" % \
+                    (ty.typename,
+                     ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("static void %s_rand_init(%s)\n" % \
+                    (ty.typename,
+                     ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+            f.write("{\n")
+            f.write(gen_rand_init(ty, "p"))
+            f.write("}\n")
+            f.write("\n")
+        ty.rand_init = "%s_rand_init" % ty.typename
+
+    f.write("""
+int main(int argc, char **argv)
+{
+""")
+
+    for ty in types:
+        f.write("    %s %s_val, %s_val_new;\n" % \
+                (ty.typename, ty.typename, ty.typename))
+    f.write("""
+    int rc;
+    char *s, *new_s, *json_string;
+    xentoollog_logger_stdiostream *logger;
+    libxl_ctx *ctx;
+
+    logger = xtl_createlogger_stdiostream(stderr, XTL_DETAIL, 0);
+    if (!logger) exit(1);
+
+    if (libxl_ctx_alloc(&ctx, LIBXL_VERSION, 0, (xentoollog_logger*)logger)) {
+        fprintf(stderr, "cannot init xl context\\n");
+        exit(1);
+    }
+""")
+    f.write("    printf(\"Testing TYPE_to/from_json()\\n\");\n")
+    f.write("    printf(\"----------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if t.json_gen_fn is not None]:
+        arg = ty.typename + "_val"
+        f.write("    %s_rand_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        if not isinstance(ty, idl.Enumeration):
+            iters = random.randrange(1,10)
+            while iters > 0:
+                f.write("    %s_init(%s_new);\n" % (ty.typename, \
+                    ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+                iters -= 1
+        f.write("    s = %s_to_json(ctx, %s);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    printf(\"%%s: %%s\\n\", \"%s\", s);\n" % ty.typename)
+        f.write("    if (s == NULL) abort();\n")
+        f.write("    rc = %s_from_json(ctx, &%s_val_new, s);\n" % \
+                (ty.typename, ty.typename))
+        f.write("    if (rc) abort();\n")
+        f.write("    new_s = %s_to_json(ctx, %s_new);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (new_s == NULL) abort();\n")
+        f.write("    if (strcmp(s, new_s)) {\n")
+        f.write("        printf(\"Huh? Regenerated string different from original string.\\n\");\n")
+        f.write("        printf(\"Regenerated string: %s\\n\", new_s);\n")
+        f.write("        abort();\n")
+        f.write("    }\n")
+        f.write("    free(s);\n")
+        f.write("    free(new_s);\n")
+        if ty.dispose_fn is not None:
+            iters = random.randrange(1,10)
+            f.write("    %s(&%s_val);\n" % (ty.dispose_fn, ty.typename))
+            while iters > 0:
+                f.write("    %s(&%s_val_new);\n" % (ty.dispose_fn, ty.typename))
+                iters -= 1
+        f.write("\n")
+
+    f.write("    printf(\"Testing TYPE_copy()\\n\");\n")
+    f.write("    printf(\"----------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if t.copy_fn is not None]:
+        f.write("    printf(\"Testing %s_copy, \");\n" % ty.typename)
+        arg = ty.typename + "_val"
+        f.write("    %s_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_rand_init(%s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_init(%s_new);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    %s_copy(ctx, %s_new, %s);\n" % (ty.typename, \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE), \
+            ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
+        f.write("    s = %s_to_json(ctx, %s);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (s == NULL) abort();\n")
+        f.write("    new_s = %s_to_json(ctx, %s_new);\n" % \
+                (ty.typename, ty.pass_arg(arg, isref=False)))
+        f.write("    if (new_s == NULL) abort();\n")
+        f.write("    if (strcmp(s, new_s)) {\n")
+        f.write("        printf(\"Huh? Deep copy for %s failed. Regenerated string different from original string.\\n\");\n" \
+                % ty.typename)
+        f.write("        printf(\"Original string: %s\\n\", s);\n")
+        f.write("        printf(\"Regenerated string: %s\\n\", new_s);\n")
+        f.write("        abort();\n")
+        f.write("    }\n")
+        f.write("    free(s);\n")
+        f.write("    free(new_s);\n")
+        if ty.dispose_fn is not None:
+            f.write("    %s(&%s_val);\n" % (ty.dispose_fn, ty.typename))
+            f.write("    %s(&%s_val_new);\n" % (ty.dispose_fn, ty.typename))
+        f.write("    printf(\"done\\n\");\n")
+        f.write("\n")
+
+    f.write("    printf(\"\\n\");\n")
+    f.write("    printf(\"Testing Enumerations\\n\");\n")
+    f.write("    printf(\"--------------------\\n\");\n")
+    f.write("    printf(\"\\n\");\n")
+    for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
+        f.write("    printf(\"%s -- to string:\\n\");\n" % (ty.typename))
+        for v in ty.values:
+            f.write("    printf(\"\\t%s = %%d = \\\"%%s\\\"\\n\", " \
+                    "%s, %s_to_string(%s));\n" % \
+                    (v.valuename, v.name, ty.typename, v.name))
+        f.write("\n")
+
+        f.write("    printf(\"%s -- to JSON:\\n\");\n" % (ty.typename))
+        for v in ty.values:
+            f.write("    json_string = %s_to_json(ctx, %s);\n" % \
+                    (ty.typename, v.name))
+            f.write("    printf(\"\\t%s = %%d = %%s\", " \
+                    "%s, json_string);\n" %\
+                    (v.valuename, v.name))
+            f.write("    free(json_string);\n");
+            f.write("    json_string = NULL;\n");
+        f.write("\n")
+
+        f.write("    printf(\"%s -- from string:\\n\");\n" % (ty.typename))
+        for v in [v.valuename for v in ty.values] + ["AN INVALID VALUE"]:
+            n = randomize_case(v)
+            f.write("    %s_val = -1;\n" % (ty.typename))
+            f.write("    rc = %s_from_string(\"%s\", &%s_val);\n" %\
+                    (ty.typename, n, ty.typename))
+
+            f.write("    printf(\"\\t%s = \\\"%%s\\\" = %%d (rc %%d)\\n\", " \
+                    "\"%s\", %s_val, rc);\n" %\
+                    (v, n, ty.typename))
+        f.write("\n")
+
+    f.write("""
+
+    libxl_ctx_free(ctx);
+    xtl_logger_destroy((xentoollog_logger*)logger);
+
+    return 0;
+}
+""")
diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py
new file mode 100644
index 0000000000..9a45e45acc
--- /dev/null
+++ b/tools/libs/light/gentypes.py
@@ -0,0 +1,797 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+
+import sys
+import re
+
+import idl
+
+def libxl_C_instance_of(ty, instancename):
+    if isinstance(ty, idl.Aggregate) and ty.typename is None:
+        if instancename is None:
+            return libxl_C_type_define(ty)
+        else:
+            return libxl_C_type_define(ty) + " " + instancename
+
+    s = ""
+    if isinstance(ty, idl.Array):
+        s += libxl_C_instance_of(ty.lenvar.type, ty.lenvar.name) + ";\n"
+
+    return s + ty.typename + " " + instancename
+
+def libxl_C_type_define(ty, indent = ""):
+    s = ""
+    if isinstance(ty, idl.Enumeration):
+        if ty.typename is None:
+            s += "enum {\n"
+        else:
+            s += "typedef enum %s {\n" % ty.typename
+
+        for v in ty.values:
+            x = "%s = %d" % (v.name, v.value)
+            x = x.replace("\n", "\n    ")
+            s += "    " + x + ",\n"
+        if ty.typename is None:
+            s += "}"
+        else:
+            s += "} %s" % ty.typename
+
+    elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
+        if ty.typename is None:
+            s += "%s {\n" % ty.kind
+        else:
+            s += "typedef %s %s {\n" % (ty.kind, ty.typename)
+
+        for f in ty.fields:
+            if isinstance(ty, idl.KeyedUnion) and f.type is None: continue
+            
+            x = libxl_C_instance_of(f.type, f.name)
+            if f.const:
+                x = "const " + x
+            x = x.replace("\n", "\n    ")
+            s += "    " + x + ";\n"
+        if ty.typename is None:
+            s += "}"
+        else:
+            s += "} %s" % ty.typename
+    else:
+        raise NotImplementedError("%s" % type(ty))
+    return s.replace("\n", "\n%s" % indent)
+
+def libxl_C_type_dispose(ty, v, indent = "    ", parent = None):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_dispose(f.type, fexpr, indent + "    ", nparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        if ty.elem_type.dispose_fn is not None:
+            s += "{\n"
+            s += "    int i;\n"
+            s += "    for (i=0; i<%s; i++)\n" % (parent + ty.lenvar.name)
+            s += libxl_C_type_dispose(ty.elem_type, v+"[i]",
+                                      indent + "        ", parent)
+        if ty.dispose_fn is not None:
+            if ty.elem_type.dispose_fn is not None:
+                s += "    "
+            s += "%s(%s);\n" % (ty.dispose_fn, ty.pass_arg(v, parent is None))
+        if ty.elem_type.dispose_fn is not None:
+            s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.dispose_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += libxl_C_type_dispose(f.type, fexpr, "", nparent)
+    else:
+        if ty.dispose_fn is not None:
+            s += "%s(%s);\n" % (ty.dispose_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_copy(ty, v, w, indent = "    ", vparent = None, wparent = None):
+    s = ""
+
+    if vparent is None:
+        s += "GC_INIT(ctx);\n";
+
+    if isinstance(ty, idl.KeyedUnion):
+        if vparent is None or wparent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "%s = %s;\n" % ((vparent + ty.keyvar.name), (wparent + ty.keyvar.name))
+        s += "switch (%s) {\n" % (wparent + ty.keyvar.name)
+        for f in ty.fields:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            (wnparent,wfexpr) = ty.member(w, f, wparent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_copy(f.type, vfexpr, wfexpr, indent + "    ",
+                                       vnparent, wnparent)
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Array):
+        if vparent is None or wparent is None:
+            raise Exception("Array type must have a parent")
+        s += "%s = libxl__calloc(NOGC, %s, sizeof(*%s));\n" % (ty.pass_arg(v, vparent is None),
+                                                               (wparent + ty.lenvar.name),
+                                                               ty.pass_arg(w, wparent is None))
+        s += "%s = %s;\n" % ((vparent + ty.lenvar.name), (wparent + ty.lenvar.name))
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    for (i=0; i<%s; i++)\n" % (wparent + ty.lenvar.name)
+        s += libxl_C_type_copy(ty.elem_type, v+"[i]", w+"[i]",
+                               indent + "        ", vparent, wparent)
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and ((vparent is None and wparent is None) or ty.copy_fn is None):
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            (wnparent,wfexpr) = ty.member(w, f, wparent is None)
+            s += libxl_C_type_copy(f.type, vfexpr, wfexpr, "", vnparent, wnparent)
+    else:
+        if ty.copy_fn is not None:
+            s += "%s(ctx, %s, %s);\n" % (ty.copy_fn,
+                                         ty.pass_arg(v, vparent is None, passby=idl.PASS_BY_REFERENCE),
+                                         ty.pass_arg(w, wparent is None, passby=idl.PASS_BY_REFERENCE))
+
+        else:
+            s += "%s = %s;\n" % (ty.pass_arg(v, vparent is None, passby=idl.PASS_BY_VALUE),
+                                 ty.pass_arg(w, wparent is None, passby=idl.PASS_BY_VALUE))
+
+    if vparent is None:
+        s += "GC_FREE;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def libxl_C_type_do_init(ty, pass_arg, need_zero=True, indent="    "):
+    s=indent
+    if ty.init_val is not None:
+        s+= "%s = %s;\n" % (pass_arg(idl.PASS_BY_VALUE), ty.init_val)
+    elif ty.init_fn is not None:
+        s+= "%s(%s);\n" % (ty.init_fn, pass_arg(idl.PASS_BY_REFERENCE))
+    elif need_zero:
+        ptr = pass_arg(idl.PASS_BY_REFERENCE)
+        s+= "memset(%s, 0, sizeof(*%s));\n" % (ptr, ptr)
+    else:
+        s=""
+    return s
+
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                if f.type is not None:
+                    s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val is not None:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val is not None:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+    if init_val is not None:
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+    else:
+        s += "    assert(!%s);\n" % (fexpr)
+    s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_gen_map_key(f, parent, indent = ""):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (v, v)
+            s += "    if (s != yajl_gen_status_ok)\n"
+            s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_copy_deprecated(field, v, indent = "    ", vparent = None):
+    s = ""
+
+    if isinstance(field.type, idl.KeyedUnion):
+        if vparent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (vparent + field.type.keyvar.name)
+        for f in [f for f in field.type.fields if not f.const]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_copy_deprecated(f, vfexpr, indent, vnparent)
+            s+= "    break;\n"
+        s+="}\n";
+    elif isinstance(field.type, idl.Array) and field.deprecated_by:
+        raise Exception("Array type is not supported for deprecation")
+    elif isinstance(field.type, idl.Struct) and field.type.copy_fn is None:
+        for f in [f for f in field.type.fields if not f.const]:
+            (vnparent,vfexpr) = ty.member(v, f, vparent is None)
+            s += libxl_C_type_copy_deprecated(f, vfexpr, "", vnparent)
+    elif field.deprecated_by is not None:
+        if field.type.check_default_fn is None:
+            raise Exception(
+"Deprecated field %s type doesn't have a default value checker" % field.name)
+        field_pass = lambda by: field.type.pass_arg(v, vparent is None,
+                                                    passby=by)
+        field_val = field_pass(idl.PASS_BY_VALUE)
+        field_ptr = field_pass(idl.PASS_BY_REFERENCE)
+        s+= "if (!%s(&p->%s) && !%s(%s))\n" % (field.type.check_default_fn,
+                                               field.deprecated_by,
+                                               field.type.check_default_fn,
+                                               field_ptr)
+        s+= "    return -EINVAL;\n"
+        s+="(void) (&p->%s == %s);\n" % (field.deprecated_by, field_ptr)
+        s+= "if (%s(&p->%s)) {\n" % (field.type.check_default_fn,
+                                     field.deprecated_by)
+        s+= "    "
+        if field.type.copy_fn is not None:
+            s+= "%s(ctx, &p->%s, %s);\n" % (field.type.copy_fn,
+                                            field.deprecated_by, field_ptr)
+        else:
+            s+= "p->%s = %s;\n" % (field.deprecated_by, field_val)
+
+        if field.type.dispose_fn is not None:
+            s+= "    %s(%s);\n" % (field.type.dispose_fn,
+                                   field.type.pass_arg(v, vparent is None))
+        s+=libxl_C_type_do_init(field.type, field_pass)
+        s+= "}\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def get_init_val(f):
+    if f.init_val is not None:
+        return f.init_val
+    elif f.type.init_val is not None:
+        return f.type.init_val
+    return None
+
+def get_default_expr(f, nparent, fexpr):
+    if isinstance(f.type, idl.Aggregate):
+        return "1 /* always generate JSON output for aggregate type */"
+
+    if isinstance(f.type, idl.Array):
+        return "%s && %s" % (fexpr, nparent + f.type.lenvar.name)
+
+    init_val = get_init_val(f)
+    if init_val is not None:
+        return "%s != %s" % (fexpr, init_val)
+
+    if f.type.check_default_fn:
+        return "!%s(&%s)" % (f.type.check_default_fn, fexpr)
+
+    return "%s" % fexpr
+
+def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
+    s = ""
+    if parent is None:
+        s += "yajl_gen_status s;\n"
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        s += "{\n"
+        s += "    int i;\n"
+        s += "    s = yajl_gen_array_open(hand);\n"
+        s += "    if (s != yajl_gen_status_ok)\n"
+        s += "        goto out;\n"
+        s += "    for (i=0; i<%s; i++) {\n" % (parent + ty.lenvar.name)
+        s += libxl_C_type_gen_json(ty.elem_type, v+"[i]",
+                                   indent + "        ", parent)
+        s += "    }\n"
+        s += "    s = yajl_gen_array_close(hand);\n"
+        s += "    if (s != yajl_gen_status_ok)\n"
+        s += "        goto out;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        s += "s = libxl__yajl_gen_enum(hand, %s_to_string(%s));\n" % (ty.typename, ty.pass_arg(v, parent is None))
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+        for f in ty.fields:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            s += "case %s:\n" % f.enumname
+            if f.type is not None:
+                s += libxl_C_type_gen_json(f.type, fexpr, indent + "    ", nparent)
+            else:
+                s += "    s = yajl_gen_map_open(hand);\n"
+                s += "    if (s != yajl_gen_status_ok)\n"
+                s += "        goto out;\n"
+                s += "    s = yajl_gen_map_close(hand);\n"
+                s += "    if (s != yajl_gen_status_ok)\n"
+                s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
+        s += "s = yajl_gen_map_open(hand);\n"
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            default_expr = get_default_expr(f, nparent, fexpr)
+            s += "if (%s) {\n" % default_expr
+
+            s += libxl_C_type_gen_map_key(f, nparent, "    ")
+            s += libxl_C_type_gen_json(f.type, fexpr, "    ", nparent)
+
+            s += "}\n"
+
+        s += "s = yajl_gen_map_close(hand);\n"
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    else:
+        if ty.json_gen_fn is not None:
+            s += "s = %s(hand, %s);\n" % (ty.json_gen_fn, ty.pass_arg(v, parent is None))
+            s += "if (s != yajl_gen_status_ok)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "out:\n"
+        s += "return s;\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_to_json(ty, v, indent = "    "):
+    s = ""
+    gen = "(libxl__gen_json_callback)&%s_gen_json" % ty.typename
+    s += "return libxl__object_to_json(ctx, \"%s\", %s, (void *)%s);\n" % (ty.typename, gen, ty.pass_arg(v, passby=idl.PASS_BY_REFERENCE))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_parse_json(ty, w, v, indent = "    ", parent = None, discriminator = None):
+    s = ""
+    if parent is None:
+        s += "int rc = 0;\n"
+        s += "const libxl__json_object *x __attribute__((__unused__)) = o;\n"
+
+    if isinstance(ty, idl.Array):
+        if parent is None:
+            raise Exception("Array type must have a parent")
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        lenvar = parent + ty.lenvar.name
+        s += "{\n"
+        s += "    libxl__json_object *t;\n"
+        s += "    int i;\n"
+        s += "    if (!libxl__json_object_is_array(x)) {\n"
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    %s = x->u.array->count;\n" % lenvar
+        s += "    %s = libxl__calloc(NOGC, %s, sizeof(*%s));\n" % (v, lenvar, v)
+        s += "    if (!%s && %s != 0) {\n" % (v, lenvar)
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    for (i=0; (t=libxl__json_array_get(x,i)); i++) {\n"
+        s += libxl_C_type_do_init(ty.elem_type,
+                    lambda by: ("&" if by == idl.PASS_BY_REFERENCE else "")+
+                               ("%s[i]" % v),
+                                  need_zero=False, indent=indent+"    ")
+        s += libxl_C_type_parse_json(ty.elem_type, "t", v+"[i]",
+                                     indent + "    ", parent)
+        s += "    }\n"
+        s += "    if (i != %s) {\n" % lenvar
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "}\n"
+    elif isinstance(ty, idl.Enumeration):
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        s += "{\n"
+        s += "    const char *enum_str;\n"
+        s += "    if (!libxl__json_object_is_string(%s)) {\n" % w
+        s += "        rc = -1;\n"
+        s += "        goto out;\n"
+        s += "    }\n"
+        s += "    enum_str = libxl__json_object_get_string(%s);\n" % w
+        s += "    rc = %s_from_string(enum_str, %s);\n" % (ty.typename, ty.pass_arg(v, parent is None, idl.PASS_BY_REFERENCE))
+        s += "    if (rc)\n"
+        s += "        goto out;\n"
+        s += "}\n"
+    elif isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if discriminator is None:
+            raise Excpetion("KeyedUnion type must have a discriminator")
+        for f in ty.fields:
+            if f.enumname != discriminator:
+                continue
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.type is not None:
+                s += libxl_C_type_parse_json(f.type, w, fexpr, indent + "    ", nparent)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_parse_fn is None):
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
+            saved_var_name = "saved_%s" % f.name
+            s += "{\n"
+            s += "    const libxl__json_object *%s = x;\n" % saved_var_name
+            if isinstance(f.type, idl.KeyedUnion):
+                for x in f.type.fields:
+                    s += "    x = libxl__json_map_get(\"%s\", %s, JSON_MAP);\n" % \
+                         (f.type.keyvar.name + "." + x.name, w)
+                    s += "    if (x) {\n"
+                    (nparent, fexpr) = ty.member(v, f.type.keyvar, parent is None)
+                    s += "        %s_init_%s(%s, %s);\n" % (ty.typename, f.type.keyvar.name, v, x.enumname)
+                    (nparent,fexpr) = ty.member(v, f, parent is None)
+                    s += libxl_C_type_parse_json(f.type, "x", fexpr, "  ", nparent, x.enumname)
+                    s += "    }\n"
+            else:
+                s += "    x = libxl__json_map_get(\"%s\", %s, %s);\n" % (f.name, w, f.type.json_parse_type)
+                s += "    if (x) {\n"
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += libxl_C_type_parse_json(f.type, "x", fexpr, "        ", nparent)
+                s += "    }\n"
+            s += "    x = %s;\n" % saved_var_name
+            s += "}\n"
+    else:
+        if discriminator is not None:
+            raise Exception("Only KeyedUnion can have discriminator")
+        if ty.json_parse_fn is not None:
+            s += "rc = %s(gc, %s, &%s);\n" % (ty.json_parse_fn, w, v)
+            s += "if (rc)\n"
+            s += "    goto out;\n"
+
+    if parent is None:
+        s += "out:\n"
+        s += "return rc;\n"
+
+    if s != "":
+        s = indent +s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_from_json(ty, v, w, indent = "    "):
+    s = ""
+    parse = "(libxl__json_parse_callback)&%s_parse_json" % (ty.namespace + "_" + ty.rawname)
+    s += "return libxl__object_from_json(ctx, \"%s\", %s, %s, %s);\n" % (ty.typename, parse, v, w)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_to_string(ty, e, indent = "    "):
+    s = ""
+    s += "switch(%s) {\n" % e
+    for v in ty.values:
+        s += "    case %s:\n" % (v.name)
+        s += "        return \"%s\";\n" % (v.valuename.lower())
+    s += "    default:\n "
+    s += "        return NULL;\n"
+    s += "}\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_strings(ty, indent=""):
+    s = ""
+    s += "libxl_enum_string_table %s_string_table[] = {\n" % (ty.typename)
+    for v in ty.values:
+        s += "    { .s = \"%s\", .v = %s },\n" % (v.valuename.lower(), v.name)
+    s += "    { NULL, -1 },\n"
+    s += "};\n"
+    s += "\n"
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_enum_from_string(ty, str, e, indent = "    "):
+    s = ""
+    s += "return libxl__enum_from_string(%s_string_table,\n" % ty.typename
+    s += "                               %s, (int *)%s);\n" % (str, e)
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+
+if __name__ == '__main__':
+    if len(sys.argv) != 6:
+        print("Usage: gentypes.py <idl> <header> <header-private> <header-json> <implementation>", file=sys.stderr)
+        sys.exit(1)
+
+    (_, idlname, header, header_private, header_json, impl) = sys.argv
+
+    (builtins,types) = idl.parse(idlname)
+
+    print("outputting libxl type definitions to %s" % header)
+
+    f = open(header, "w")
+
+    header_define = header.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_define, header_define, " ".join(sys.argv)))
+
+    for ty in types:
+        f.write(libxl_C_type_define(ty) + ";\n")
+        if ty.dispose_fn is not None:
+            f.write("%svoid %s(%s);\n" % (ty.hidden(), ty.dispose_fn, ty.make_arg("p")))
+        if ty.copy_deprecated_fn is not None:
+            f.write("%sint %s(libxl_ctx *ctx, %s);\n" % (ty.hidden(),
+                                                         ty.copy_deprecated_fn,
+                                                         ty.make_arg("p")))
+        if ty.copy_fn is not None:
+            f.write("%svoid %s(libxl_ctx *ctx, %s, const %s);\n" % (ty.hidden(), ty.copy_fn,
+                                              ty.make_arg("dst"), ty.make_arg("src")))
+        if ty.init_fn is not None:
+            f.write("%svoid %s(%s);\n" % (ty.hidden(), ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("%svoid %s(%s, %s);\n" % (ty.hidden(), ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
+        if ty.json_gen_fn is not None:
+            f.write("%schar *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
+        if ty.json_parse_fn is not None:
+            f.write("%sint %s_from_json(libxl_ctx *ctx, %s, const char *s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        if isinstance(ty, idl.Enumeration):
+            f.write("%sconst char *%s_to_string(%s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
+            f.write("%sint %s_from_string(const char *s, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("e", passby=idl.PASS_BY_REFERENCE)))
+            f.write("%sextern libxl_enum_string_table %s_string_table[];\n" % (ty.hidden(), ty.typename))
+        f.write("\n")
+
+    f.write("""#endif /* %s */\n""" % (header_define))
+    f.close()
+
+    print("outputting libxl JSON definitions to %s" % header_json)
+
+    f = open(header_json, "w")
+
+    header_json_define = header_json.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_json_define, header_json_define, " ".join(sys.argv)))
+
+    for ty in [ty for ty in types if ty.json_gen_fn is not None]:
+        f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+
+    f.write("\n")
+    f.write("""#endif /* %s */\n""" % header_json_define)
+    f.close()
+
+    print("outputting libxl type internal definitions to %s" % header_private)
+
+    f = open(header_private, "w")
+
+    header_private_define = header_private.upper().replace('.','_')
+    f.write("""#ifndef %s
+#define %s
+
+/*
+ * DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+""" % (header_private_define, header_private_define, " ".join(sys.argv)))
+
+    for ty in [ty for ty in types if ty.json_parse_fn is not None]:
+        f.write("%sint %s_parse_json(libxl__gc *gc, const libxl__json_object *o, %s);\n" % \
+                (ty.hidden(), ty.namespace + "_" + ty.rawname,
+                 ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+
+    f.write("\n")
+    f.write("""#endif /* %s */\n""" % header_json_define)
+    f.close()
+
+    print("outputting libxl type implementations to %s" % impl)
+
+    f = open(impl, "w")
+    f.write("""
+/* DO NOT EDIT.
+ *
+ * This file is autogenerated by
+ * "%s"
+ */
+
+#include "libxl_osdeps.h"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libxl_internal.h"
+
+
+""" % " ".join(sys.argv))
+
+    for ty in [t for t in types if t.dispose_fn is not None and t.autogenerate_dispose_fn]:
+        f.write("void %s(%s)\n" % (ty.dispose_fn, ty.make_arg("p")))
+        f.write("{\n")
+        f.write("    if (!p) return;\n")
+        f.write(libxl_C_type_dispose(ty, "p"))
+        f.write("    memset(p, 0, sizeof(*p));\n")
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.copy_fn and t.autogenerate_copy_fn]:
+        f.write("void %s(libxl_ctx *ctx, %s, const %s)\n" % (ty.copy_fn,
+                                       ty.make_arg("dst", passby=idl.PASS_BY_REFERENCE),
+                                       ty.make_arg("src", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_copy(ty, "dst", "src"))
+        f.write("}\n")
+        f.write("\n")
+        
+    for ty in [t for t in types if t.copy_deprecated_fn]:
+        f.write("int %s(libxl_ctx *ctx, %s)\n" % (ty.copy_deprecated_fn,
+            ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        for field in [field for field in ty.fields if not field.const]:
+            (vnparent,vfexpr) = ty.member("p", field, True)
+            f.write(libxl_C_type_copy_deprecated(field, vfexpr,
+                                                 vparent = vnparent))
+        f.write("    return 0;\n")
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
+
+    for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
+        f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
+        f.write("{\n")
+        f.write(libxl_C_enum_to_string(ty, "e"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write(libxl_C_enum_strings(ty))
+
+        f.write("int %s_from_string(const char *s, %s *e)\n" % (ty.typename, ty.typename))
+        f.write("{\n")
+        f.write(libxl_C_enum_from_string(ty, "s", "e"))
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.json_gen_fn is not None]:
+        f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_gen_json(ty, "p"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write("char *%s_to_json(libxl_ctx *ctx, %s)\n" % (ty.typename, ty.make_arg("p")))
+        f.write("{\n")
+        f.write(libxl_C_type_to_json(ty, "p"))
+        f.write("}\n")
+        f.write("\n")
+
+    for ty in [t for t in types if t.json_parse_fn is not None]:
+        f.write("int %s_parse_json(libxl__gc *gc, const libxl__json_object *%s, %s)\n" % \
+                (ty.namespace + "_" + ty.rawname,"o",ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        f.write(libxl_C_type_parse_json(ty, "o", "p"))
+        f.write("}\n")
+        f.write("\n")
+
+        f.write("int %s_from_json(libxl_ctx *ctx, %s, const char *s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
+        f.write("{\n")
+        if not isinstance(ty, idl.Enumeration):
+            f.write("    %s_init(p);\n" % ty.typename)
+        f.write(libxl_C_type_from_json(ty, "p", "s"))
+        f.write("}\n")
+        f.write("\n")
+
+    f.close()
diff --git a/tools/libs/light/idl.py b/tools/libs/light/idl.py
new file mode 100644
index 0000000000..d7367503b4
--- /dev/null
+++ b/tools/libs/light/idl.py
@@ -0,0 +1,377 @@
+from __future__ import print_function
+
+import sys
+
+PASS_BY_VALUE = 1
+PASS_BY_REFERENCE = 2
+
+DIR_NONE = 0
+DIR_IN   = 1
+DIR_OUT  = 2
+DIR_BOTH = 3
+
+_default_namespace = ""
+def namespace(s):
+    if type(s) != str:
+        raise TypeError("Require a string for the default namespace.")
+    global _default_namespace
+    _default_namespace = s
+
+def _get_default_namespace():
+    global _default_namespace
+    return _default_namespace
+
+_default_hidden = False
+def hidden(b):
+    global _default_hidden
+    _default_hidden = b
+
+def _get_default_hidden():
+    global _default_hidden
+    return _default_hidden
+
+class Type(object):
+    def __init__(self, typename, **kwargs):
+        self.namespace = kwargs.setdefault('namespace',
+                _get_default_namespace())
+        self._hidden = kwargs.setdefault('hidden', _get_default_hidden())
+        self.dir = kwargs.setdefault('dir', DIR_BOTH)
+        if self.dir not in [DIR_NONE, DIR_IN, DIR_OUT, DIR_BOTH]:
+            raise ValueError
+
+        self.passby = kwargs.setdefault('passby', PASS_BY_VALUE)
+        if self.passby not in [PASS_BY_VALUE, PASS_BY_REFERENCE]:
+            raise ValueError
+
+        self.private = kwargs.setdefault('private', False)
+
+        if typename is None: # Anonymous type
+            self.typename = None
+            self.rawname = None
+        elif self.namespace is None: # e.g. system provided types
+            self.typename = typename
+            self.rawname = typename
+        else:
+            self.typename = self.namespace + typename
+            self.rawname = typename
+
+        if self.typename is not None:
+            self.dispose_fn = kwargs.setdefault('dispose_fn', self.typename + "_dispose")
+        else:
+            self.dispose_fn = kwargs.setdefault('dispose_fn', None)
+
+        self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
+
+        if self.typename is not None:
+            self.copy_fn = kwargs.setdefault('copy_fn', self.typename + "_copy")
+        else:
+            self.copy_fn = kwargs.setdefault('copy_fn', None)
+
+        self.autogenerate_copy_fn = kwargs.setdefault('autogenerate_copy_fn', True)
+
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
+        self.check_default_fn = kwargs.setdefault('check_default_fn', None)
+        self.copy_deprecated_fn = kwargs.setdefault('copy_deprecated_fn',
+                                                    None)
+
+        if self.typename is not None and not self.private:
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
+            self.json_parse_type = kwargs.setdefault('json_parse_type', "JSON_ANY")
+            if self.namespace is not None:
+                self.json_parse_fn = kwargs.setdefault('json_parse_fn',
+                                                       self.namespace + "_" + self.rawname  + "_parse_json")
+            else:
+                self.json_parse_fn = kwargs.setdefault('json_parse_fn',
+                                                       self.typename + "_parse_json")
+        else:
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
+            self.json_parse_type = kwargs.setdefault('json_parse_type', None)
+            self.json_parse_fn = kwargs.setdefault('json_parse_fn', None)
+
+        self.autogenerate_json = kwargs.setdefault('autogenerate_json', True)
+
+    def marshal_in(self):
+        return self.dir in [DIR_IN, DIR_BOTH]
+    def marshal_out(self):
+        return self.dir in [DIR_OUT, DIR_BOTH]
+
+    def hidden(self):
+        if self._hidden:
+            return "_hidden "
+        else:
+            return ""
+
+    def make_arg(self, n, passby=None):
+        if passby is None: passby = self.passby
+
+        if passby == PASS_BY_REFERENCE:
+            return "%s *%s" % (self.typename, n)
+        else:
+            return "%s %s" % (self.typename, n)
+
+    def pass_arg(self, n, isref=None, passby=None):
+        if passby is None: passby = self.passby
+        if isref is None: isref = self.passby == PASS_BY_REFERENCE
+
+        if passby == PASS_BY_REFERENCE:
+            if isref:
+                return "%s" % (n)
+            else:
+                return "&%s" % (n)
+        else:
+            if isref:
+                return "*%s" % (n)
+            else:
+                return "%s" % (n)
+
+class Builtin(Type):
+    """Builtin type"""
+    def __init__(self, typename, **kwargs):
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('autogenerate_dispose_fn', False)
+        kwargs.setdefault('autogenerate_json', False)
+        Type.__init__(self, typename, **kwargs)
+
+class Number(Builtin):
+    def __init__(self, ctype, **kwargs):
+        kwargs.setdefault('namespace', None)
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('copy_fn', None)
+        kwargs.setdefault('signed', False)
+        kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
+        kwargs.setdefault('json_parse_type', "JSON_INTEGER")
+        # json_parse_fn might be overriden on specific type
+        kwargs.setdefault('json_parse_fn', "libxl__int_parse_json")
+        self.signed = kwargs['signed']
+        Builtin.__init__(self, ctype, **kwargs)
+
+class UInt(Number):
+    def __init__(self, w, **kwargs):
+        kwargs.setdefault('namespace', None)
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('json_parse_fn', "libxl__uint%d_parse_json" % w)
+        kwargs.setdefault('copy_fn', None)
+        Number.__init__(self, "uint%d_t" % w, **kwargs)
+
+        self.width = w
+
+class EnumerationValue(object):
+    def __init__(self, enum, value, name, **kwargs):
+        self.enum = enum
+
+        self.valuename = str.upper(name)
+        self.rawname = str.upper(enum.rawname) + "_" + self.valuename
+        self.name = str.upper(enum.value_namespace) + self.rawname
+        self.value = value
+
+class Enumeration(Type):
+    def __init__(self, typename, values, **kwargs):
+        kwargs.setdefault('dispose_fn', None)
+        kwargs.setdefault('copy_fn', None)
+        kwargs.setdefault('json_parse_type', "JSON_STRING")
+        Type.__init__(self, typename, **kwargs)
+
+        self.value_namespace = kwargs.setdefault('value_namespace',
+            self.namespace)
+
+        self.values = []
+        for v in values:
+            # (value, name)
+            (num,name) = v
+            self.values.append(EnumerationValue(self, num, name,
+                                                typename=self.rawname))
+    def lookup(self, name):
+        for v in self.values:
+            if v.valuename == str.upper(name):
+                return v
+        return ValueError
+
+class Field(object):
+    """An element of an Aggregate type"""
+    def __init__(self, type, name, **kwargs):
+        self.type = type
+        self.name = name
+        self.const = kwargs.setdefault('const', False)
+        self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.deprecated_by = kwargs.setdefault('deprecated_by', None)
+
+class Aggregate(Type):
+    """A type containing a collection of other types"""
+    def __init__(self, kind, typename, fields, **kwargs):
+        kwargs.setdefault('json_parse_type', "JSON_MAP")
+        Type.__init__(self, typename, **kwargs)
+
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
+        self.kind = kind
+
+        self.fields = []
+        for f in fields:
+            # (name, type[, {kw args}])
+            if len(f) == 2:
+                n,t = f
+                kw = {}
+            elif len(f) == 3:
+                n,t,kw = f
+            else:
+                raise ValueError
+            if n is None:
+                raise ValueError
+            self.fields.append(Field(t,n,**kw))
+
+    # Returns a tuple (stem, field-expr)
+    #
+    # field-expr is a C expression for a field "f" within the struct
+    # "v".
+    #
+    # stem is the stem common to both "f" and any other sibbling field
+    # within the "v".
+    def member(self, v, f, isref):
+        if isref:
+            deref = v + "->"
+        else:
+            deref = v + "."
+
+        if f.name is None: # Anonymous
+            return (deref, deref)
+        else:
+            return (deref, deref + f.name)
+
+class Struct(Aggregate):
+    def __init__(self, name, fields, **kwargs):
+        kwargs.setdefault('passby', PASS_BY_REFERENCE)
+        Aggregate.__init__(self, "struct", name, fields, **kwargs)
+
+    def has_fields(self):
+        return len(self.fields) != 0
+
+class Union(Aggregate):
+    def __init__(self, name, fields, **kwargs):
+        # Generally speaking some intelligence is required to free a
+        # union therefore any specific instance of this class will
+        # need to provide an explicit destructor function.
+        kwargs.setdefault('passby', PASS_BY_REFERENCE)
+        kwargs.setdefault('dispose_fn', None)
+        Aggregate.__init__(self, "union", name, fields, **kwargs)
+
+class KeyedUnion(Aggregate):
+    """A union which is keyed of another variable in the parent structure"""
+    def __init__(self, name, keyvar_type, keyvar_name, fields, **kwargs):
+        Aggregate.__init__(self, "union", name, [], **kwargs)
+
+        if not isinstance(keyvar_type, Enumeration):
+            raise ValueError
+
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
+
+        for f in fields:
+            # (name, enum, type)
+            e, ty = f
+            ev = keyvar_type.lookup(e)
+            en = ev.name
+            self.fields.append(Field(ty, e, enumname=en))
+
+#
+# Standard Types
+#
+
+void = Builtin("void *", namespace = None)
+bool = Builtin("bool", namespace = None,
+               copy_fn=None,
+               json_gen_fn = "yajl_gen_bool",
+               json_parse_type = "JSON_BOOL",
+               json_parse_fn = "libxl__bool_parse_json",
+               autogenerate_json = False)
+
+size_t = Number("size_t", namespace = None)
+
+integer = Number("int", namespace = None, signed = True)
+
+uint8 = UInt(8)
+uint16 = UInt(16)
+uint32 = UInt(32)
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
+
+string = Builtin("char *", namespace = None, copy_fn = "libxl_string_copy", dispose_fn = "free",
+                 json_gen_fn = "libxl__string_gen_json",
+                 json_parse_type = "JSON_STRING | JSON_NULL",
+                 json_parse_fn = "libxl__string_parse_json",
+                 autogenerate_json = False,
+                 check_default_fn="libxl__string_is_default")
+
+class Array(Type):
+    """An array of the same type"""
+    def __init__(self, elem_type, lenvar_name, **kwargs):
+        kwargs.setdefault('dispose_fn', 'free')
+        kwargs.setdefault('json_parse_type', 'JSON_ARRAY')
+        Type.__init__(self, namespace=elem_type.namespace, typename=elem_type.rawname + " *", **kwargs)
+
+        lv_kwargs = dict([(x.lstrip('lenvar_'),y) for (x,y) in kwargs.items() if x.startswith('lenvar_')])
+
+        self.lenvar = Field(integer, lenvar_name, **lv_kwargs)
+        self.elem_type = elem_type
+
+class OrderedDict(dict):
+    """A dictionary which remembers insertion order.
+
+       push to back on duplicate insertion"""
+
+    def __init__(self):
+        dict.__init__(self)
+        self.__ordered = []
+
+    def __setitem__(self, key, value):
+        try:
+            self.__ordered.remove(key)
+        except ValueError:
+            pass
+
+        self.__ordered.append(key)
+        dict.__setitem__(self, key, value)
+
+    def ordered_keys(self):
+        return self.__ordered
+    def ordered_values(self):
+        return [self[x] for x in self.__ordered]
+    def ordered_items(self):
+        return [(x,self[x]) for x in self.__ordered]
+
+def parse(f):
+    print("Parsing %s" % f, file=sys.stderr)
+
+    globs = {}
+    locs = OrderedDict()
+
+    for n,t in globals().items():
+        if isinstance(t, Type):
+            globs[n] = t
+        elif isinstance(t,type(object)) and issubclass(t, Type):
+            globs[n] = t
+        elif n in ['PASS_BY_REFERENCE', 'PASS_BY_VALUE',
+                   'DIR_NONE', 'DIR_IN', 'DIR_OUT', 'DIR_BOTH',
+                   'namespace', 'hidden']:
+            globs[n] = t
+
+    try:
+        exec(compile(open(f).read(), f, 'exec'), globs, locs)
+    except SyntaxError as e:
+        raise SyntaxError("Errors were found at line %d while processing %s:\n\t%s"
+                          % (e.lineno, f, e.text))
+
+    types = [t for t in locs.ordered_values() if isinstance(t,Type)]
+
+    builtins = [t for t in types if isinstance(t,Builtin)]
+    types = [t for t in types if not isinstance(t,Builtin)]
+
+    return (builtins,types)
diff --git a/tools/libs/light/idl.txt b/tools/libs/light/idl.txt
new file mode 100644
index 0000000000..7440fb3b76
--- /dev/null
+++ b/tools/libs/light/idl.txt
@@ -0,0 +1,214 @@
+libxl IDL
+---------
+
+Each type in the libxl interface is represented by an object of type
+idl.Type (or a subclass thereof). Every local variable defined by the
+.idl file must be an instance of idl.Type (e.g. you may not define
+Python functions or any other construct other than defining variables)
+
+The name of the type must be passed as the first argument to the
+constructor when defining a new type. The name given should not
+contain the initial namespace element (e.g. "libxl_"). See below for
+how to specify a namespace.
+
+The Type.typename contains the C name of the type _including_ the
+namespace element while Type.rawname is always set to the 'base' name
+of the type.
+
+The idl.Type base class has several other properties which apply to
+all types. The properties are set by passing a named parameter to the
+constructor.
+
+Type.namespace: (default: "libxl_")
+
+ The namespace in which the type resides. Usually this is "libxl_" but
+ system defined and builtin types may differ.
+
+ If the typename is not None then the namespace is prepended to the
+ type.
+ 
+Type.passby: (default: idl.PASS_BY_VALUE)
+
+ Defines the manner in which a type should be passed to C
+ functions. Valid values for this fields are:
+   idl.PASS_BY_VALUE
+   idl.PASS_BY_REFERENCE
+
+Type.dispose_fn: (default: typename + "_dispose" or None if type == None)
+
+ The name of the C function which will free all dynamically allocated
+ memory contained within this type (but not the type itself).
+
+Type.autogenerate_dispose_fn: (default: True)
+
+ Indicates if the above named Type.dispose_fn should be
+ autogenerated.
+
+Type.copy_fn: (default: typename + "_copy" or None if type == None)
+
+ The name of the C function which will deep copy all fields within
+ this type.
+
+Type.autogenerate_copy_fn: (default: True)
+
+ Indicates if the above named Type.copy_fn should be
+ autogenerated.
+
+Type.autogenerate_copy_fn
+
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
+Type.json_gen_fn: (default: typename + "_gen_json" or None if type == None)
+
+ The name of the C function which will generate a YAJL data structure
+ representing this type.
+
+Type.json_parse_fn: (default: typename + "_parse_json" or None if type == None)
+
+ The name of the C function which will parse a libxl JSON structure
+ representing this type to C type.
+
+Type.autogenerate_json: (default: True)
+
+ Indicates if the above named Type.json_*_fn should be autogenerated.
+
+Type.check_default_fn:
+
+ If it's set then calling this function shall return true if this type
+ has been set to default value (internal libxl implementation).
+
+ If this is not set, that means we can check the type against init_val
+ (if it has one) or zero to determine whether the value is default
+ value.
+
+Other simple type-Classes
+-------------------------
+
+idl.Builtin
+
+ Instances of this class represent types which are predefined within
+ the system.
+
+idl.UInt
+
+ Instances of this class represent the standard uint<N>_t types.
+
+ The <N> for a given instance must be passed to the constructor and is
+ then available in UInt.width
+
+Complex type-Classes
+--------------------
+
+idl.Enumeration
+
+  A class representing an enumeration (named integer values).
+  This class has one property besides the ones defined for the Type
+  class:
+
+  Enumeration.value_namespace: (default: namespace)
+
+    The namespace in which the values of the Enumeration (see below) reside.
+    This prefix is prepended to the name of the value.
+
+  The values are available in the list Enumeration.values. Each
+  element in the list is of type idl.EnumerationValue.
+
+  Each EnumerationValue has the following properties:
+
+    EnumerationValue.enum       Reference to containing Enumeration
+    EnumerationValue.name       The C name of this value, including
+                                    the namespace and typename of the
+                                    containing Enumeration (e.g.
+                                    "LIBXL_FOOENUM_VALUE")
+    EnumerationValue.rawname    The C name of this value, excluding
+                                    the namespace but including the
+                                    typename of the containing
+                                    Enumeration (e.g. "FOOENUM_VALUE")
+    EnumerationValue.valuename  The name of this value, excluding the
+                                    name of the containing Enumeration
+                                    and any namespace (e.g. "VALUE")
+    EnumerationValue.value      The integer value associated with this name.
+
+idl.Aggregate
+
+ Base class for type-Classes which contain a number of other types
+ (e.g. structs and unions).
+
+ The contained types are available in the list Aggregate.fields. Each
+ element in the list is of type idl.Field representing a member of the
+ aggregate.
+
+ Each field has the following properties:
+
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
+
+idl.Struct
+
+ A subclass of idl.Aggregate representing the C struct type.
+
+ Struct.kind == "struct"
+
+idl.Union
+
+ A subclass of idl.Aggregate representing the C union type.
+
+ Union.kind == "union"
+
+idl.KeyedUnion
+
+ A subclass of idl.Aggregate which represents the C union type
+ where the currently valid member of the union can be determined based
+ upon another member in the containing type. An idl.KeyedUnion must
+ always be a member of a containing idl.Aggregate type.
+
+ The KeyedUnion.keyvar contains an idl.Field, this is the member of
+ the containing type which determines the valid member of the
+ union. The idl.Field.type of the keyvar must be an Enumeration type.
+
+idl.Array
+
+  A class representing an array of similar elements. An idl.Array must
+  always be an idl.Field of a containing idl.Aggregate.
+
+  idl.Array.elem_type contains an idl.Type which is the type of each
+  element of the array.
+
+  idl.Array.len_var contains an idl.Field which is added to the parent
+  idl.Aggregate and will contain the length of the array. The field
+  MUST be named num_ARRAYNAME.
+
+Standard Types
+--------------
+
+Several standard types a predefined. They are
+
+void                    (void pointer type)
+bool
+size_t
+integer                 24 bit signed integer.
+
+uint{8,16,32,64}        uint{8,16,32,64}_t


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3212.9315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQS-0002Zm-Dt; Tue, 06 Oct 2020 10:42:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3212.9315; Tue, 06 Oct 2020 10:42:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQS-0002Zf-At; Tue, 06 Oct 2020 10:42:32 +0000
Received: by outflank-mailman (input) for mailman id 3212;
 Tue, 06 Oct 2020 10:42:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQR-0002ZL-BH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 53eebc69-1087-41fb-8d0b-0608c5dbde1f;
 Tue, 06 Oct 2020 10:42:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQQ-0001Yq-Ew
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQQ-0008At-E1
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQR-0002ZL-BH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:31 +0000
X-Inumbo-ID: 53eebc69-1087-41fb-8d0b-0608c5dbde1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 53eebc69-1087-41fb-8d0b-0608c5dbde1f;
	Tue, 06 Oct 2020 10:42:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1Xt20JSqI97Sq7scAZAgI25q9F5pEozlwpG3xCN02Bs=; b=ezyWr5Fvv+YBUW5EEotzTf1sq1
	9fl5lZLNG55cwH1SLGPG0rW8DsiOsY1+G7ZLX4si0r9EO7ZPcAduU8J7C3N9YoT+UJwwvgv9zMEjP
	HyqDeBHpzW7M1SrtM4xVN5KJOwb0aKn+2nETSlfmQstOwvz6WAZydLh9YEJtfYwynbuU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQQ-0001Yq-Ew
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQQ-0008At-E1
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: rename global libxlutil make variables
Message-Id: <E1kPkQQ-0008At-E1@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:42:30 +0000

commit bc01c73018689e066e06515b26181d463a3f2a40
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:13 2020 +0200

    tools: rename global libxlutil make variables
    
    Rename *_libxlutil make variables to *_libxenutil in order to avoid
    nasty indirections when moving libxlutil under the tools/libs
    infrastructure.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/Rules.mk       | 10 +++++-----
 tools/libxl/Makefile |  4 ++--
 tools/xl/Makefile    |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index a68dbb9de8..2c26ee7927 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,7 +15,7 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxlutil      = $(XEN_ROOT)/tools/libxl
+XEN_libxenutil     = $(XEN_ROOT)/tools/libxl
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
@@ -116,10 +116,10 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxlutil = -I$(XEN_libxlutil)
-SHDEPS_libxlutil = $(SHLIB_libxenlight)
-LDLIBS_libxlutil = $(SHDEPS_libxlutil) $(XEN_libxlutil)/libxlutil$(libextension)
-SHLIB_libxlutil  = $(SHDEPS_libxlutil) -Wl,-rpath-link=$(XEN_libxlutil)
+CFLAGS_libxenutil = -I$(XEN_libxenutil)
+SHDEPS_libxenutil = $(SHLIB_libxenlight)
+LDLIBS_libxenutil = $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(libextension)
+SHLIB_libxenutil  = $(SHDEPS_libxenutil) -Wl,-rpath-link=$(XEN_libxenutil)
 
 CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
 
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 8ab7c9d3f0..51da1d5be4 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -42,7 +42,7 @@ PKG_CONFIG_INST := $(PKG_CONFIG)
 xlutil.pc: PKG_CONFIG_NAME = Xlutil
 xlutil.pc: PKG_CONFIG_DESC = The xl utility library for Xen hypervisor
 xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
-xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxlutil)
+xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxenutil)
 xlutil.pc: PKG_CONFIG_LIB = xlutil
 xlutil.pc: PKG_CONFIG_REQPRIV = xenlight
 $(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
@@ -55,7 +55,7 @@ PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_NAME = Xlutil
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_DESC = The xl utility library for Xen hypervisor
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
-$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxlutil)
+$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_USELIBS = $(SHLIB_libxenutil)
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_LIB = xlutil
 $(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_REQPRIV = xenlight
 $(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
diff --git a/tools/xl/Makefile b/tools/xl/Makefile
index 407dd7554c..bdf67c8464 100644
--- a/tools/xl/Makefile
+++ b/tools/xl/Makefile
@@ -13,7 +13,7 @@ CFLAGS += $(PTHREAD_CFLAGS)
 LDFLAGS += $(PTHREAD_LDFLAGS)
 
 CFLAGS_XL += $(CFLAGS_libxenlight)
-CFLAGS_XL += $(CFLAGS_libxlutil)
+CFLAGS_XL += $(CFLAGS_libxenutil)
 CFLAGS_XL += -Wshadow
 
 XL_OBJS-$(CONFIG_X86) = xl_psr.o
@@ -38,7 +38,7 @@ $(XL_OBJS): _paths.h
 all: xl
 
 xl: $(XL_OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxlutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) $(LDLIBS_libxenutil) $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: all
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3213.9319 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQc-0002b9-G8; Tue, 06 Oct 2020 10:42:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3213.9319; Tue, 06 Oct 2020 10:42:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQc-0002b1-Cu; Tue, 06 Oct 2020 10:42:42 +0000
Received: by outflank-mailman (input) for mailman id 3213;
 Tue, 06 Oct 2020 10:42:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQb-0002aq-HH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0efe0102-e100-453d-b51f-eac6d1d8dda7;
 Tue, 06 Oct 2020 10:42:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQa-0001ZP-Hq
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQa-0008BX-HB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQb-0002aq-HH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:41 +0000
X-Inumbo-ID: 0efe0102-e100-453d-b51f-eac6d1d8dda7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0efe0102-e100-453d-b51f-eac6d1d8dda7;
	Tue, 06 Oct 2020 10:42:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Has3w3fx/sdEV9yuRofDgn+MwF8uNTVe6lTt04elmV8=; b=nddrYXBfwj5rDYvmse2LmMQagX
	Lq2kXO214BboXOhtSySfzaX4EJ0p7UHa3lnzWrXFDsJhsqyFw6ScgUNK6F8fWdgNNfBya6AJVMP9K
	6nPnWi5J0oeoIbdsBMJm5nE0UiW+qk9xcsAQRXLMGPkwU2KrGcQYG3ba/IUsbGjHSXgw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQa-0001ZP-Hq
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQa-0008BX-HB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs: add option for library names not starting with libxen
Message-Id: <E1kPkQa-0008BX-HB@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:42:40 +0000

commit b22b9b9a1df865e1dd9e4f6950ae6be7081be010
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:15 2020 +0200

    tools/libs: add option for library names not starting with libxen
    
    libxlutil doesn't follow the standard name pattern of all other Xen
    libraries, so add another make variable which can be used to allow
    other names.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/Rules.mk     |  3 ++-
 tools/libs/libs.mk | 41 +++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 2c26ee7927..75d44c4a4b 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -87,10 +87,11 @@ endif
 # $(SHLIB_libfoo)
 
 define LIB_defs
+ FILENAME_$(1) ?= xen$(1)
  XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1)
  CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude)
  SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use)))
- LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)$$(libextension)
+ LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILENAME_$(1))$$(libextension)
  SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1))
 endef
 
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 9d0ed08846..325b7b7cea 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -20,20 +20,21 @@ LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
 LIB_OBJS := $(SRCS-y:.c=.o)
 PIC_OBJS := $(SRCS-y:.c=.opic)
 
-LIB := libxen$(LIBNAME).a
+LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
+LIB := lib$(LIB_FILE_NAME).a
 ifneq ($(nosharedlibs),y)
-LIB += libxen$(LIBNAME).so
+LIB += lib$(LIB_FILE_NAME).so
 endif
 
 comma:= ,
 empty:=
 space:= $(empty) $(empty)
-PKG_CONFIG ?= xen$(LIBNAME).pc
+PKG_CONFIG ?= $(LIB_FILE_NAME).pc
 PKG_CONFIG_NAME ?= Xen$(LIBNAME)
 PKG_CONFIG_DESC ?= The $(PKG_CONFIG_NAME) library for Xen hypervisor
 PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
 PKG_CONFIG_USELIBS := $(SHLIB_libxen$(LIBNAME))
-PKG_CONFIG_LIB := xen$(LIBNAME)
+PKG_CONFIG_LIB := $(LIB_FILE_NAME)
 PKG_CONFIG_REQPRIV := $(subst $(space),$(comma),$(strip $(foreach lib,$(patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib))))
 
 ifneq ($(CONFIG_LIBXC_MINIOS),y)
@@ -45,7 +46,7 @@ endif
 
 PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
 
-LIBHEADER ?= xen$(LIBNAME).h
+LIBHEADER ?= $(LIB_FILE_NAME).h
 LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h))
 LIBHEADERSGLOB = $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(h))
 
@@ -81,36 +82,36 @@ libxen$(LIBNAME).map:
 $(LIBHEADERSGLOB): $(LIBHEADERS)
 	for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done
 
-libxen$(LIBNAME).a: $(LIB_OBJS)
+lib$(LIB_FILE_NAME).a: $(LIB_OBJS)
 	$(AR) rc $@ $^
 
-libxen$(LIBNAME).so: libxen$(LIBNAME).so.$(MAJOR)
+lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR)
 	$(SYMLINK_SHLIB) $< $@
-libxen$(LIBNAME).so.$(MAJOR): libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
+lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
-libxen$(LIBNAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxen$(LIBNAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
+lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
-	$(INSTALL_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
-	$(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
+	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) lib$(LIB_FILE_NAME).a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
 	for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done
 	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc
+	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
 	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).a
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).a
 
 .PHONY: TAGS
 TAGS:
@@ -119,7 +120,7 @@ TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
-	rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR)
+	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk
 	rm -f $(PKG_CONFIG)
 	rm -f $(LIBHEADERSGLOB)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:42:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:42:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3214.9323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQr-0002cg-I6; Tue, 06 Oct 2020 10:42:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3214.9323; Tue, 06 Oct 2020 10:42:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQr-0002cZ-Em; Tue, 06 Oct 2020 10:42:57 +0000
Received: by outflank-mailman (input) for mailman id 3214;
 Tue, 06 Oct 2020 10:42:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQq-0002cR-FD
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1b880cdb-c6d8-4212-9316-9a934164f29f;
 Tue, 06 Oct 2020 10:42:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQk-0001Ze-La
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQk-0008C6-Ks
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQq-0002cR-FD
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:56 +0000
X-Inumbo-ID: 1b880cdb-c6d8-4212-9316-9a934164f29f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1b880cdb-c6d8-4212-9316-9a934164f29f;
	Tue, 06 Oct 2020 10:42:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lIdenfY/ftrhR/VJuih6ClYf+UIDFgs589r8xwEut3M=; b=Yn6rlIowc+dd1J6h7e6CWTDnS0
	oTPFr6JIo3PMHFPBRHLvKGyv3Xybb0kwsiV2K5QccCyxbEqz3VxZl1rmWPKoYng+m/lNKwTRFedyg
	WZFR0BofbH4uDUN1gK69oBdRpbW0quVp3h22LlOePItZOS4eF3gparlvHeMsIRf0oOIo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQk-0001Ze-La
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQk-0008C6-Ks
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:42:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: move libxlutil to tools/libs/util
Message-Id: <E1kPkQk-0008C6-Ks@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:42:50 +0000

commit 3ae0d316f01c08903a96f6b5b39275c67b823264
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 23 06:57:20 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:26:17 2020 +0200

    tools: move libxlutil to tools/libs/util
    
    Move the libxlutil source to tools/libs/util and delete tools/libxl.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                          |    6 +-
 tools/Makefile                      |    1 -
 tools/Rules.mk                      |    7 -
 tools/libs/Makefile                 |    1 +
 tools/libs/uselibs.mk               |    3 +
 tools/libs/util/CODING_STYLE        |  330 ++++
 tools/libs/util/Makefile            |   63 +
 tools/libs/util/include/libxlutil.h |  136 ++
 tools/libs/util/libxlu_cfg.c        |  712 +++++++++
 tools/libs/util/libxlu_cfg_i.h      |   59 +
 tools/libs/util/libxlu_cfg_l.c      | 2375 ++++++++++++++++++++++++++++
 tools/libs/util/libxlu_cfg_l.h      |  734 +++++++++
 tools/libs/util/libxlu_cfg_l.l      |  104 ++
 tools/libs/util/libxlu_cfg_y.c      | 1705 ++++++++++++++++++++
 tools/libs/util/libxlu_cfg_y.h      |   96 ++
 tools/libs/util/libxlu_cfg_y.y      |   79 +
 tools/libs/util/libxlu_disk.c       |  102 ++
 tools/libs/util/libxlu_disk_i.h     |   29 +
 tools/libs/util/libxlu_disk_l.c     | 2944 +++++++++++++++++++++++++++++++++++
 tools/libs/util/libxlu_disk_l.h     |  701 +++++++++
 tools/libs/util/libxlu_disk_l.l     |  289 ++++
 tools/libs/util/libxlu_internal.h   |   84 +
 tools/libs/util/libxlu_pci.c        |  264 ++++
 tools/libs/util/libxlu_vif.c        |  149 ++
 tools/libxl/CODING_STYLE            |  330 ----
 tools/libxl/Makefile                |  124 --
 tools/libxl/libxlu_cfg.c            |  712 ---------
 tools/libxl/libxlu_cfg_i.h          |   59 -
 tools/libxl/libxlu_cfg_l.c          | 2375 ----------------------------
 tools/libxl/libxlu_cfg_l.h          |  734 ---------
 tools/libxl/libxlu_cfg_l.l          |  104 --
 tools/libxl/libxlu_cfg_y.c          | 1705 --------------------
 tools/libxl/libxlu_cfg_y.h          |   96 --
 tools/libxl/libxlu_cfg_y.y          |   79 -
 tools/libxl/libxlu_disk.c           |  102 --
 tools/libxl/libxlu_disk_i.h         |   29 -
 tools/libxl/libxlu_disk_l.c         | 2944 -----------------------------------
 tools/libxl/libxlu_disk_l.h         |  701 ---------
 tools/libxl/libxlu_disk_l.l         |  289 ----
 tools/libxl/libxlu_internal.h       |   84 -
 tools/libxl/libxlu_pci.c            |  264 ----
 tools/libxl/libxlu_vif.c            |  149 --
 tools/libxl/libxlutil.h             |  136 --
 43 files changed, 10963 insertions(+), 11026 deletions(-)

diff --git a/.gitignore b/.gitignore
index f30550255f..188495783e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -154,6 +154,10 @@ tools/libs/store/utils.h
 tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
 tools/libs/store/include/xenstore_lib.h
+tools/libs/util/*.pc
+tools/libs/util/_paths.h
+tools/libs/util/libxlu_cfg_y.output
+tools/libs/util/libxenutil.map
 tools/libs/vchan/headers.chk
 tools/libs/vchan/libxenvchan.map
 tools/libs/vchan/xenvchan.pc
@@ -232,8 +236,6 @@ tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
-tools/libxl/*.pc
-tools/libxl/libxlu_cfg_y.output
 tools/misc/cpuperf/cpuperf-perfcntr
 tools/misc/cpuperf/cpuperf-xen
 tools/misc/xc_shadow
diff --git a/tools/Makefile b/tools/Makefile
index c1eba22c0c..ed71474421 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -29,7 +29,6 @@ SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir
 endif
 
 SUBDIRS-y += xenpmd
-SUBDIRS-y += libxl
 SUBDIRS-$(CONFIG_GOLANG) += golang
 SUBDIRS-y += xl
 SUBDIRS-y += helpers
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 75d44c4a4b..f3e0078927 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -15,8 +15,6 @@ XEN_INCLUDE        = $(XEN_ROOT)/tools/include
 
 include $(XEN_ROOT)/tools/libs/uselibs.mk
 
-XEN_libxenutil     = $(XEN_ROOT)/tools/libxl
-
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
 XENSTORE_XENSTORED ?= y
@@ -117,11 +115,6 @@ else
 CFLAGS += -O2 -fomit-frame-pointer
 endif
 
-CFLAGS_libxenutil = -I$(XEN_libxenutil)
-SHDEPS_libxenutil = $(SHLIB_libxenlight)
-LDLIBS_libxenutil = $(SHDEPS_libxenutil) $(XEN_libxenutil)/libxlutil$(libextension)
-SHLIB_libxenutil  = $(SHDEPS_libxenutil) -Wl,-rpath-link=$(XEN_libxenutil)
-
 CFLAGS += -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__
 
 # Get gcc to generate the dependencies for us.
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index c41455c604..1afcd12e2b 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -16,6 +16,7 @@ SUBDIRS-y += store
 SUBDIRS-y += stat
 SUBDIRS-$(CONFIG_Linux) += vchan
 SUBDIRS-y += light
+SUBDIRS-y += util
 
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk
index 685f368aed..efd7a475ba 100644
--- a/tools/libs/uselibs.mk
+++ b/tools/libs/uselibs.mk
@@ -28,3 +28,6 @@ LIBS_LIBS += stat
 USELIBS_stat := ctrl store
 LIBS_LIBS += light
 USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest
+LIBS_LIBS += util
+USELIBS_util := light
+FILENAME_util := xlutil
diff --git a/tools/libs/util/CODING_STYLE b/tools/libs/util/CODING_STYLE
new file mode 100644
index 0000000000..3d572f6925
--- /dev/null
+++ b/tools/libs/util/CODING_STYLE
@@ -0,0 +1,330 @@
+LIBXENLIGHT CODING STYLE
+========================
+
+
+AN APOLOGY AND WARNING
+----------------------
+
+Much of the code in libxl does not yet follow this coding style
+document in every respect.  However, new code is expected to conform.
+
+Patches to improve the style of existing code are welcome.  Please
+separate these out from functional changes.
+
+If it is not feasible to conform fully to the style while patching old
+code, without doing substantial style reengineering first, we may
+accept patches which contain nonconformant elements, provided that
+they don't make the coding style problem worse overall.
+
+In this case, the new code should conform to the prevailing style in
+the area being touched.
+
+
+MEMORY ALLOCATION
+-----------------
+
+Memory allocation for libxl-internal purposes should normally be done
+with the provided gc mechanisms; there is then no need to free.  See
+"libxl memory management" in libxl.h.
+
+
+CONVENTIONAL VARIABLE NAMES
+---------------------------
+
+The following local variable names should be used where applicable:
+
+  int rc;    /* a libxl error code - and not anything else */
+  int r;     /* the return value from a system call (or libxc call) */
+  bool ok;   /* the success return value from a boolean function */
+
+  uint32_t domid;
+  libxl__gc *gc;
+  libxl__egc *egc;
+  libxl__ao *ao;
+
+  libxl_foo_bar_state *fbs;    /* local variable */
+  libxl_foo_bar_state foo_bar; /* inside another state struct */
+
+
+CONVENIENCE MACROS
+------------------
+
+There are a number of convenience macros which shorten the program and
+avoid opportunity for mistakes.  In some cases non-use of the macros
+produces functional bugs or incorrect error handling.  Use the macros
+whenever they are applicable.  For example:
+
+ Usually, don't use:     Instead, use (see libxl_internal.h):
+  libxl__log[v]           LOG, LOGE, LOGEV
+  libxl__sprintf          GCSPRINTF
+  libxl__*alloc et al.    GCNEW, GCNEW_ARRAY, GCREALLOC_ARRAY
+  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
+--------------
+
+Unless, there are good reasons to do otherwise, the following error
+handling and cleanup paradigm should be used:
+
+  * All local variables referring to resources which might need
+    cleaning up are declared at the top of the function, and
+    initialised to a sentinel value indicating "nothing allocated".
+    For example,
+            libxl_evgen_disk_eject *evg = NULL;
+            int nullfd = -1;
+
+  * If the function is to return a libxl error value, `rc' is
+    used to contain the error code, but it is NOT initialised:
+            int rc;
+
+  * There is only one error cleanup path out of the function.  It
+    starts with a label `out:'.  That error cleanup path checks for
+    each allocated resource and frees it iff necessary.  It then
+    returns rc.  For example,
+         out:
+             if (evg) libxl__evdisable_disk_eject(gc, evg);
+             if (nullfd >= 0) close(nullfd);
+             return rc;
+
+  * Function calls which might fail (ie most function calls) are
+    handled by putting the return/status value into a variable, and
+    then checking it in a separate statement:
+            char *dompath = libxl__xs_get_dompath(gc, bl->domid);
+            if (!dompath) { rc = ERROR_FAIL; goto out; }
+
+  * If a resource is freed in the main body of the function (for
+    example, in a loop), the corresponding variable has to be reset to
+    the sentinel at the point where it's freed.
+
+Whether to use the `out' path for successful returns as well as error
+returns is a matter of taste and convenience for the specific
+function.  Not reusing the out path is fine if the duplicated function
+exit code is only `CTX_UNLOCK; GC_FREE;' (or similar).
+
+If you reuse the `out' path for successful returns, there may be
+resources which are to be returned to the caller rather than freed.
+In that case you have to reset the local variable to `nothing here',
+to avoid the resource being freed on the out path.  That resetting
+should be done immediately after the resource value is stored at the
+applicable _r function parameter (or equivalent).  Do not test `rc' in
+the out section, to discover whether to free things.
+
+The uses of the single-line formatting in the examples above are
+permitted exceptions to the usual libxl code formatting rules.
+
+
+
+IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
+--------------------------------------------------
+
+Nontrivial data structures (in structs) should come with an idempotent
+_dispose function, which must free all resources associated with the
+data structure (but not free the struct itself).
+
+Such a struct should also come with an _init function which
+initialises the struct so that _dispose is a no-op.
+
+
+ASYNCHRONOUS/LONG-RUNNING OPERATIONS
+------------------------------------
+
+All long-running operations in libxl need to use the asynchronous
+operation machinery.  Consult the programmer documentation in
+libxl_internal.h for details - search for "Machinery for asynchronous
+operations".
+
+The code for asynchronous operations should be laid out in
+chronological order.  That is, where there is a chain of callback
+functions, each subsequent function should be, textually, the next
+function in the file.  This will normally involve predeclaring the
+callback functions.  Synchronous helper functions should be separated
+out into a section preceding the main callback chain.
+
+Control flow arrangements in asynchronous operations should be made as
+simple as possible, because it can otherwise be very hard to see
+through the tangle.
+
+
+When inventing a new sub-operation in asynchronous code, consider
+whether to structure it formally as a sub-operation with its own state
+structure.  (See, for example, libxl__datacopier_*.)
+
+An ao-suboperation state structure should contain, in this order:
+  * fields that the caller must fill in, and which are,
+    effectively, the parameters to the operation, including:
+      - libxl__ao *ao
+      - the callback function pointer(s), which
+        should be named callback or callback_*.
+  * shared information fields or ones used for returning information
+    to the calling operation
+  * private fields
+These sections should be clearly demarcated by comments.
+
+An asynchronous operation should normally have an idempotent stop or
+cancel function.  It should normally also have an _init function for
+its state struct, which arranges that the stop is a no-op.
+
+The permitted order of calls into your ao operation's methods must be
+documented in comments, if it is nontrivial.
+
+
+When using an ao sub-operation, you should normally:
+ * Physically include the sub-operation state struct in your
+   own state struct;
+ * Use CONTAINER_OF to find your own state struct at the start of
+   your implementations of the sub-operation callback functions;
+ * Unconditionally initialise the sub-operation's struct (with its
+   _init method) in your own _init method.
+ * Unconditionally cancel or destroy the sub-operation in your own
+   cancel or destroy method.
+
+
+FORMATTING AND NAMING
+---------------------
+
+Blatantly copied from qemu and linux with few modifications.
+
+
+1. Whitespace
+
+Of course, the most important aspect in any coding style is whitespace.
+Crusty old coders who have trouble spotting the glasses on their noses
+can tell the difference between a tab and eight spaces from a distance
+of approximately fifteen parsecs.  Many a flamewar have been fought and
+lost on this issue.
+
+Libxenlight indents are four spaces.  Tabs are never used, except in
+Makefiles where they have been irreversibly coded into the syntax.
+Spaces of course are superior to tabs because:
+
+ - You have just one way to specify whitespace, not two.  Ambiguity breeds
+   mistakes.
+ - The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
+ - Tab indents push your code to the right, making your screen seriously
+   unbalanced.
+ - Tabs will be rendered incorrectly on editors who are misconfigured not
+   to use tab stops of eight positions.
+ - Tabs are rendered badly in patches, causing off-by-one errors in almost
+   every line.
+ - It is the libxenlight coding style.
+
+Do not leave whitespace dangling off the ends of lines.
+
+
+2. Line width
+
+Lines are limited to 75 characters.
+
+Rationale:
+ - Some people like to tile their 24" screens with a 6x4 matrix of 80x24
+   xterms and use vi in all of them.  The best way to punish them is to
+   let them keep doing it.
+ - In an 80 column terminal, some room needs to be left for > quoting
+   characters, +/- diff characters, and so on, in emails.
+ - Code and especially patches is much more readable if limited to a sane
+   line length.  Eighty is traditional.
+ - It is the libxenlight coding style.
+
+
+3. Naming
+
+C is a Spartan language, and so should your naming be.  Unlike Modula-2
+and Pascal programmers, C programmers do not use cute names like
+ThisVariableIsATemporaryCounter.  A C programmer would call that
+variable "tmp", which is much easier to write, and not the least more
+difficult to understand.
+
+HOWEVER, while mixed-case names are frowned upon, descriptive names for
+global variables are a must.  To call a global function "foo" is a
+shooting offense.
+
+GLOBAL variables (to be used only if you _really_ need them) need to
+have descriptive names, as do global functions.  If you have a function
+that counts the number of active users, you should call that
+"count_active_users()" or similar, you should _not_ call it "cntusr()".
+
+Encoding the type of a function into the name (so-called Hungarian
+notation) is brain damaged - the compiler knows the types anyway and can
+check those, and it only confuses the programmer.
+
+LOCAL variable names should be short, and to the point.  If you have
+some random integer loop counter, it should probably be called "i".
+Calling it "loop_counter" is non-productive, if there is no chance of it
+being mis-understood.  Similarly, "tmp" can be just about any type of
+variable that is used to hold a temporary value.
+
+Local variables used to store return values should have descriptive name
+like "rc" or "ret". Following the same reasoning the label used as exit
+path should be called "out".
+
+Function arguments which are used to return values to the caller
+should be suffixed `_r' or `_out'.
+
+Variables, type names and function names are
+lower_case_with_underscores.
+Type names and function names use the prefix libxl__ when internal to
+libxenlight and libxl_ when exported in libxl.h.
+Xl should avoid using libxl_ and libxl__ as prefix for its own function
+names.
+
+When wrapping standard library functions, use the prefix libxl_ to alert
+readers that they are seeing a wrapped version; otherwise avoid this prefix.
+
+Typedefs are used to eliminate the redundant 'struct' keyword.
+It is the libxenlight coding style.
+
+
+4. Statements
+
+Don't put multiple statements on a single line.
+Don't put multiple assignments on a single line either.
+Error code paths with an if statement and a goto or a return on the same
+line are allowed. Examples:
+
+    if (rc) goto out;
+    if (rc < 0) return;
+
+Libxenlight coding style is super simple.  Avoid tricky expressions.
+
+
+5. Block structure
+
+Every indented statement is braced, but blocks that contain just one
+statement may have the braces omitted.  To avoid confusion, either all
+the blocks in an if...else chain have braces, or none of them do.
+
+The opening brace is on the line that contains the control flow
+statement that introduces the new block; the closing brace is on the
+same line as the else keyword, or on a line by itself if there is no
+else keyword.  Examples:
+
+    if (a == 5) {
+        printf("a was 5.\n");
+    } else if (a == 6) {
+        printf("a was 6.\n");
+    } else {
+        printf("a was something else entirely.\n");
+    }
+
+    if (a == 5)
+        printf("a was 5.\n");
+
+An exception is the opening brace for a function; for reasons of tradition
+and clarity it comes on a line by itself:
+
+    void a_function(void)
+    {
+        do_something();
+    }
+
+Rationale: a consistent (except for functions...) bracing style reduces
+ambiguity and avoids needless churn when lines are added or removed.
+Furthermore, it is the libxenlight coding style.
+
diff --git a/tools/libs/util/Makefile b/tools/libs/util/Makefile
new file mode 100644
index 0000000000..0c9db8027d
--- /dev/null
+++ b/tools/libs/util/Makefile
@@ -0,0 +1,63 @@
+XEN_ROOT = $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SRCS-y += libxlu_cfg_y.c
+SRCS-y += libxlu_cfg_l.c
+SRCS-y += libxlu_cfg.c
+SRCS-y += libxlu_disk_l.c
+SRCS-y += libxlu_disk.c
+SRCS-y += libxlu_vif.c
+SRCS-y += libxlu_pci.c
+
+CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+	-Wno-declaration-after-statement -Wformat-nonliteral
+CFLAGS += -I. $(CFLAGS_libxenctrl)
+
+CFLAGS += $(PTHREAD_CFLAGS)
+LDFLAGS += $(PTHREAD_LDFLAGS)
+
+ifeq ($(FLEX),)
+%.c %.h:: %.l
+	$(warning Flex is needed to rebuild some libxl parsers and \
+		  scanners, please install it and rerun configure)
+endif
+
+ifeq ($(BISON),)
+%.c %.h:: %.y
+	$(warning Bison is needed to rebuild some libxl parsers and \
+		  scanners, please install it and rerun configure)
+endif
+
+AUTOINCS = libxlu_cfg_y.h libxlu_cfg_l.h libxlu_disk_l.h
+AUTOSRCS = libxlu_cfg_y.c libxlu_cfg_l.c
+
+LIBHEADER := libxlutil.h
+PKG_CONFIG_NAME := Xlutil
+PKG_CONFIG_DESC := The xl utility library for Xen hypervisor
+
+NO_HEADERS_CHK := y
+
+include $(XEN_ROOT)/tools/libs/libs.mk
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenutil)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
+$(LIB_OBJS) $(PIC_OBJS): $(AUTOINCS) _paths.h
+
+%.c %.h:: %.y
+	@rm -f $*.[ch]
+	$(BISON) --output=$*.c $<
+
+%.c %.h:: %.l
+	@rm -f $*.[ch]
+	$(FLEX) --header-file=$*.h --outfile=$*.c $<
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+clean: cleanlocal
+
+.PHONY: cleanlocal
+cleanlocal:
+	$(RM) -f _*.h
+	$(RM) -f libxlutil.map
diff --git a/tools/libs/util/include/libxlutil.h b/tools/libs/util/include/libxlutil.h
new file mode 100644
index 0000000000..92e35c5462
--- /dev/null
+++ b/tools/libs/util/include/libxlutil.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef LIBXLUTIL_H
+#define LIBXLUTIL_H
+
+#include <stdio.h>
+
+#include "libxl.h"
+
+enum XLU_ConfigValueType {
+    XLU_STRING,
+    XLU_LIST,
+};
+
+enum XLU_Operation {
+    XLU_OP_ASSIGNMENT = 0,
+    XLU_OP_ADDITION,
+};
+
+/* Unless otherwise stated, all functions return an errno value. */
+typedef struct XLU_Config XLU_Config;
+typedef struct XLU_ConfigList XLU_ConfigList;
+typedef struct XLU_ConfigValue XLU_ConfigValue;
+
+XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);
+  /* 0 means we got ENOMEM. */
+  /* report_filename is copied; report is saved and must remain valid
+   *  until the Config is destroyed. */
+
+int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
+int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
+  /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
+   * functions.  You have to just xlu_cfg_destroy. */
+
+void xlu_cfg_destroy(XLU_Config*);
+
+
+/* All of the following print warnings to "report" if there is a problem.
+ * Return values are:
+ *   0        OK
+ *   ESRCH    not defined
+ *   EINVAL   value found but wrong format for request (prints warning unless dont_warn=true)
+ *   ERANGE   value out of range (from strtol)
+ */
+
+int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
+                       int dont_warn);
+/* free/strdup version */
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn);
+int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+                     int dont_warn);
+int xlu_cfg_get_bounded_long(const XLU_Config*, const char *n, long min,
+                             long max, long *value_r, int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
+
+int xlu_cfg_get_list(const XLU_Config*, const char *n,
+                     XLU_ConfigList **list_r /* may be 0 */,
+                     int *entries_r /* may be 0 */,
+                     int dont_warn);
+  /* there is no need to free *list_r; lifetime is that of the XLU_Config */
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                                    libxl_string_list *sl, int dont_warn);
+const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
+  /* xlu_cfg_get_listitem cannot fail, except that if entry is
+   * out of range it returns 0 (not setting errno) */
+
+enum XLU_ConfigValueType xlu_cfg_value_type(const XLU_ConfigValue *value);
+int xlu_cfg_value_get_string(const XLU_Config *cfg,  XLU_ConfigValue *value,
+                             char **value_r, int dont_warn);
+int xlu_cfg_value_get_list(const XLU_Config *cfg, XLU_ConfigValue *value,
+                           XLU_ConfigList **value_r, int dont_warn);
+XLU_ConfigValue *xlu_cfg_get_listitem2(const XLU_ConfigList *list,
+                                       int entry);
+
+/*
+ * Disk specification parsing.
+ */
+
+int xlu_disk_parse(XLU_Config *cfg, int nspecs, const char *const *specs,
+                   libxl_device_disk *disk);
+  /* disk must have been initialised.
+   *
+   * On error, returns errno value.  Bad strings cause EINVAL and
+   * print a message to cfg's report (that's all cfg is used for).
+   *
+   * Normally one would pass nspecs==1 and only specs[0].  But it is
+   * permitted to pass more strings in which case each is parsed as a
+   * string containing a collection of parameters (but they all refer
+   * to of the configuration for a single disk).
+   *
+   * nspecs==0 is permitted but since it does not specify some mandatory
+   * properties, it produces a run-time configuration error if the
+   * resulting disk struct is used with libxl.
+   */
+
+/*
+ * PCI specification parsing
+ */
+int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str);
+
+/*
+ * RDM parsing
+ */
+int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str);
+
+/*
+ * Vif rate parsing.
+ */
+
+int xlu_vif_parse_rate(XLU_Config *cfg, const char *rate,
+                       libxl_device_nic *nic);
+
+#endif /* LIBXLUTIL_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg.c b/tools/libs/util/libxlu_cfg.c
new file mode 100644
index 0000000000..874f5abfb9
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg.c
@@ -0,0 +1,712 @@
+/*
+ * libxlu_cfg.c - xl configuration file parsing: setup and helper functions
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#define _GNU_SOURCE
+
+#include <limits.h>
+
+#include "libxlu_internal.h"
+#include "libxlu_cfg_y.h"
+#include "libxlu_cfg_l.h"
+#include "libxlu_cfg_i.h"
+
+XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {
+    XLU_Config *cfg;
+
+    cfg= malloc(sizeof(*cfg));
+    if (!cfg) return 0;
+
+    cfg->report= report;
+    cfg->config_source= strdup(report_source);
+    if (!cfg->config_source) { free(cfg); return 0; }
+
+    cfg->settings= 0;
+    return cfg;
+}
+
+static int ctx_prep(CfgParseContext *ctx, XLU_Config *cfg) {
+    int e;
+
+    ctx->cfg= cfg;
+    ctx->err= 0;
+    ctx->lexerrlineno= -1;
+    ctx->likely_python= 0;
+    ctx->scanner= 0;
+
+    e= xlu__cfg_yylex_init_extra(ctx, &ctx->scanner);
+    if (e) {
+        fprintf(cfg->report,"%s: unable to create scanner: %s\n",
+                cfg->config_source, strerror(e));
+        return e;
+    }
+    return 0;
+}
+
+static void ctx_dispose(CfgParseContext *ctx) {
+    if (ctx->scanner) xlu__cfg_yylex_destroy(ctx->scanner);
+}
+
+static void parse(CfgParseContext *ctx) {
+    /* On return, ctx.err will be updated with the error status. */
+    int r;
+
+    xlu__cfg_yyset_lineno(1, ctx->scanner);
+
+    r= xlu__cfg_yyparse(ctx);
+    if (r) assert(ctx->err);
+
+    if (ctx->err && ctx->likely_python) {
+        fputs(
+ "warning: Config file looks like it contains Python code.\n"
+ "warning:  Arbitrary Python is no longer supported.\n"
+ "warning:  See https://wiki.xen.org/wiki/PythonInXlConfig\n",
+              ctx->cfg->report);
+    }
+}
+
+int xlu_cfg_readfile(XLU_Config *cfg, const char *real_filename) {
+    FILE *f = 0;
+    int e;
+
+    CfgParseContext ctx;
+    e = ctx_prep(&ctx, cfg);
+    if (e) { ctx.err= e; goto xe; }
+
+    f= fopen(real_filename, "r");
+    if (!f) {
+        ctx.err = errno;
+        fprintf(cfg->report,"%s: unable to open configuration file: %s\n",
+                real_filename, strerror(e));
+        goto xe;
+    }
+
+    xlu__cfg_yyrestart(f, ctx.scanner);
+
+    parse(&ctx);
+
+ xe:
+    ctx_dispose(&ctx);
+    if (f) fclose(f);
+
+    return ctx.err;
+}
+
+int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) {
+    int e;
+    YY_BUFFER_STATE buf= 0;
+
+    CfgParseContext ctx;
+    e= ctx_prep(&ctx, cfg);
+    if (e) { ctx.err= e; goto xe; }
+
+    buf = xlu__cfg_yy_scan_bytes(data, length, ctx.scanner);
+    if (!buf) {
+        fprintf(cfg->report,"%s: unable to allocate scanner buffer\n",
+                cfg->config_source);
+        ctx.err= ENOMEM;
+        goto xe;
+    }
+
+    parse(&ctx);
+
+ xe:
+    if (buf) xlu__cfg_yy_delete_buffer(buf, ctx.scanner);
+    ctx_dispose(&ctx);
+
+    return ctx.err;
+}
+
+void xlu__cfg_value_free(XLU_ConfigValue *value)
+{
+    int i;
+
+    if (!value) return;
+
+    switch (value->type) {
+    case XLU_STRING:
+        free(value->u.string);
+        break;
+    case XLU_LIST:
+        for (i = 0; i < value->u.list.nvalues; i++)
+            xlu__cfg_value_free(value->u.list.values[i]);
+        free(value->u.list.values);
+    }
+    free(value);
+}
+
+void xlu__cfg_set_free(XLU_ConfigSetting *set) {
+    if (!set) return;
+    free(set->name);
+    xlu__cfg_value_free(set->value);
+    free(set);
+}
+
+void xlu_cfg_destroy(XLU_Config *cfg) {
+    XLU_ConfigSetting *set, *set_next;
+
+    if (!cfg) return;
+    for (set= cfg->settings;
+         set;
+         set= set_next) {
+        set_next= set->next;
+        xlu__cfg_set_free(set);
+    }
+    free(cfg->config_source);
+    free(cfg);
+}
+
+static XLU_ConfigSetting *find(const XLU_Config *cfg, const char *n) {
+    XLU_ConfigSetting *set;
+
+    for (set= cfg->settings;
+         set;
+         set= set->next)
+        if (!strcmp(set->name, n))
+            return set;
+    return 0;
+}
+
+static int find_atom(const XLU_Config *cfg, const char *n,
+                     XLU_ConfigSetting **set_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+
+    set= find(cfg,n);
+    if (!set) return ESRCH;
+
+    if (set->value->type!=XLU_STRING) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is"
+                    " a list but should be a single value\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    *set_r= set;
+    return 0;
+}
+
+
+enum XLU_ConfigValueType xlu_cfg_value_type(const XLU_ConfigValue *value)
+{
+    return value->type;
+}
+
+int xlu_cfg_value_get_string(const XLU_Config *cfg, XLU_ConfigValue *value,
+                             char **value_r, int dont_warn)
+{
+    if (value->type != XLU_STRING) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d:%d: warning: value is not a string\n",
+                    cfg->config_source, value->loc.first_line,
+                    value->loc.first_column);
+        *value_r = NULL;
+        return EINVAL;
+    }
+
+    *value_r = value->u.string;
+    return 0;
+}
+
+int xlu_cfg_value_get_list(const XLU_Config *cfg, XLU_ConfigValue *value,
+                           XLU_ConfigList **value_r, int dont_warn)
+{
+    if (value->type != XLU_LIST) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d:%d: warning: value is not a list\n",
+                    cfg->config_source, value->loc.first_line,
+                    value->loc.first_column);
+        *value_r = NULL;
+        return EINVAL;
+    }
+
+    *value_r = &value->u.list;
+    return 0;
+}
+
+XLU_ConfigValue *xlu_cfg_get_listitem2(const XLU_ConfigList *list,
+                                       int entry)
+{
+    if (entry < 0 || entry >= list->nvalues) return NULL;
+    return list->values[entry];
+}
+
+int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
+                       const char **value_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    int e;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    *value_r= set->value->u.string;
+    return 0;
+}
+
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    int e;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    free(*value_r);
+    *value_r= strdup(set->value->u.string);
+    return 0;
+}
+
+int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n,
+                             long min, long max, long *value_r,
+                             int dont_warn) {
+    long l;
+    XLU_ConfigSetting *set;
+    int e;
+    char *ep;
+
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
+    if (set->op == XLU_OP_ADDITION) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: can't use += with numbers"
+                    " for parameter `%s'\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    errno= 0; l= strtol(set->value->u.string, &ep, 0);
+    e= errno;
+    if (errno) {
+        e= errno;
+        assert(e==EINVAL || e==ERANGE);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' could not be parsed"
+                    " as a number: %s\n",
+                    cfg->config_source, set->lineno, n, strerror(e));
+        return e;
+    }
+    if (*ep || ep==set->value->u.string) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is not a valid number\n",
+                    cfg->config_source, set->lineno, n);
+        return EINVAL;
+    }
+    if (l < min) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: value `%ld' is smaller than minimum bound '%ld'\n",
+                    cfg->config_source, set->lineno, l, min);
+        return EINVAL;
+    }
+    if (l > max) {
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: value `%ld' is greater than maximum bound '%ld'\n",
+                    cfg->config_source, set->lineno, l, max);
+        return EINVAL;
+    }
+
+    *value_r= l;
+    return 0;
+}
+
+int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
+                     long *value_r, int dont_warn) {
+    return xlu_cfg_get_bounded_long(cfg, n, LONG_MIN, LONG_MAX, value_r,
+                                    dont_warn);
+}
+
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
+
+int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
+                     XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
+    XLU_ConfigSetting *set;
+    set= find(cfg,n);  if (!set) return ESRCH;
+    if (set->value->type!=XLU_LIST) {
+        if (!dont_warn) {
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is a single value"
+                    " but should be a list\n",
+                    cfg->config_source, set->lineno, n);
+        }
+        return EINVAL;
+    }
+    if (list_r) *list_r= &set->value->u.list;
+    if (entries_r) *entries_r= set->value->u.list.nvalues;
+    return 0;
+}
+
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                     libxl_string_list *psl, int dont_warn) {
+    int i, rc, nr;
+    XLU_ConfigList *list;
+    libxl_string_list sl;
+
+    rc = xlu_cfg_get_list(cfg, n, &list, &nr, dont_warn);
+    if (rc)  return rc;
+
+    sl = malloc(sizeof(char*)*(nr + 1));
+    if (sl == NULL) return ENOMEM;
+
+    for (i=0; i<nr; i++) {
+        const char *a = xlu_cfg_get_listitem(list, i);
+        sl[i] = a ? strdup(a) : NULL;
+    }
+
+    sl[nr] = NULL;
+
+    *psl = sl;
+    return 0;
+}
+
+const char *xlu_cfg_get_listitem(const XLU_ConfigList *list, int entry) {
+    if (entry < 0 || entry >= list->nvalues) return 0;
+    if (list->values[entry]->type != XLU_STRING) return 0;
+    return list->values[entry]->u.string;
+}
+
+
+XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx, char *atom,
+                                    YYLTYPE *loc)
+{
+    XLU_ConfigValue *value = NULL;
+
+    if (ctx->err) goto x;
+
+    value = malloc(sizeof(*value));
+    if (!value) goto xe;
+    value->type = XLU_STRING;
+    value->u.string = atom;
+    memcpy(&value->loc, loc, sizeof(*loc));
+
+    return value;
+
+ xe:
+    ctx->err= errno;
+ x:
+    free(value);
+    free(atom);
+    return NULL;
+}
+
+XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx,
+                                  XLU_ConfigValue *val,
+                                  YYLTYPE *loc)
+{
+    XLU_ConfigValue *value = NULL;
+    XLU_ConfigValue **values = NULL;
+
+    if (ctx->err) goto x;
+
+    values = malloc(sizeof(*values));
+    if (!values) goto xe;
+    values[0] = val;
+
+    value = malloc(sizeof(*value));
+    if (!value) goto xe;
+    value->type = XLU_LIST;
+    value->u.list.nvalues = !!val;
+    value->u.list.avalues = 1;
+    value->u.list.values = values;
+    memcpy(&value->loc, loc, sizeof(*loc));
+
+    return value;
+
+ xe:
+    ctx->err= errno;
+ x:
+    free(value);
+    free(values);
+    xlu__cfg_value_free(val);
+    return NULL;
+}
+
+void xlu__cfg_list_append(CfgParseContext *ctx,
+                          XLU_ConfigValue *list,
+                          XLU_ConfigValue *val)
+{
+    if (ctx->err) return;
+
+    assert(val);
+    assert(list->type == XLU_LIST);
+
+    if (list->u.list.nvalues >= list->u.list.avalues) {
+        int new_avalues;
+        XLU_ConfigValue **new_values = NULL;
+
+        if (list->u.list.avalues > INT_MAX / 100) {
+            ctx->err = ERANGE;
+            xlu__cfg_value_free(val);
+            return;
+        }
+
+        new_avalues = list->u.list.avalues * 4;
+        new_values  = realloc(list->u.list.values,
+                              sizeof(*new_values) * new_avalues);
+        if (!new_values) {
+            ctx->err = errno;
+            xlu__cfg_value_free(val);
+            return;
+        }
+
+        list->u.list.avalues = new_avalues;
+        list->u.list.values  = new_values;
+    }
+
+    list->u.list.values[list->u.list.nvalues] = val;
+    list->u.list.nvalues++;
+}
+
+static int xlu__cfg_concat_vals(CfgParseContext *ctx,
+                                XLU_ConfigValue *prev,
+                                XLU_ConfigValue *to_add)
+{
+    int r;
+
+    if (prev->type != to_add->type) {
+        xlu__cfgl_lexicalerror(ctx,
+                           "can't add [list] to \"string\" or vice versa");
+        return EINVAL;
+    }
+
+    switch (to_add->type) {
+    case XLU_STRING: {
+        char *new_string = NULL;
+
+        r = asprintf(&new_string, "%s%s", prev->u.string,
+                     to_add->u.string);
+        if (r < 0) {
+            return errno;
+        }
+        free(to_add->u.string);
+        to_add->u.string = new_string;
+        return 0;
+    }
+    case XLU_LIST: {
+        XLU_ConfigList *const prev_list = &prev->u.list;
+        XLU_ConfigList *const cur_list = &to_add->u.list;
+        int nvalues;
+
+        if (prev->u.list.nvalues > INT_MAX - to_add->u.list.nvalues) {
+            return ERANGE;
+        }
+        nvalues = prev->u.list.nvalues + to_add->u.list.nvalues;
+
+        if (nvalues >= cur_list->avalues) {
+            XLU_ConfigValue **new_vals;
+            new_vals = realloc(cur_list->values,
+                               nvalues * sizeof(*new_vals));
+            if (!new_vals) {
+                return ENOMEM;
+            }
+            cur_list->avalues = nvalues;
+            cur_list->values = new_vals;
+        }
+
+        /* make space for `prev' into `to_add' */
+        memmove(cur_list->values + prev_list->nvalues,
+                cur_list->values,
+                cur_list->nvalues * sizeof(XLU_ConfigValue *));
+        /* move values from `prev' to `to_add' as the list in `prev' will
+         * not be reachable by find(). */
+        memcpy(cur_list->values,
+               prev_list->values,
+               prev_list->nvalues * sizeof(XLU_ConfigValue *));
+        cur_list->nvalues = nvalues;
+        prev_list->nvalues = 0;
+        memset(prev_list->values, 0,
+               prev_list->nvalues * sizeof(XLU_ConfigValue *));
+        return 0;
+    }
+    default:
+        abort();
+    }
+    return -1;
+}
+
+void xlu__cfg_set_store(CfgParseContext *ctx, char *name,
+                        enum XLU_Operation op,
+                        XLU_ConfigValue *val, int lineno) {
+    XLU_ConfigSetting *set;
+    int r;
+
+    if (ctx->err) goto out;
+
+    assert(name);
+
+    if (op == XLU_OP_ADDITION) {
+        /* If we have += concatenate with previous value with same name */
+        XLU_ConfigSetting *prev_set = find(ctx->cfg, name);
+        if (prev_set) {
+            r = xlu__cfg_concat_vals(ctx, prev_set->value, val);
+            if (r) {
+                ctx->err = r;
+                goto out;
+            }
+        }
+    }
+
+    set = malloc(sizeof(*set));
+    if (!set) {
+        ctx->err = errno;
+        goto out;
+    }
+    set->name= name;
+    set->value = val;
+    set->op = op;
+    set->lineno= lineno;
+    set->next= ctx->cfg->settings;
+    ctx->cfg->settings= set;
+    return;
+out:
+    assert(ctx->err);
+    free(name);
+    xlu__cfg_value_free(val);
+}
+
+char *xlu__cfgl_strdup(CfgParseContext *ctx, const char *src) {
+    char *result;
+
+    if (ctx->err) return 0;
+    result= strdup(src);
+    if (!result) ctx->err= errno;
+    return result;
+}
+
+char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) {
+    char *result;
+    const char *p;
+    char *q;
+    int len, c, nc;
+
+    if (ctx->err) return 0;
+
+    len= strlen(src);
+    assert(len>=2 && src[0]==src[len-1]);
+
+    result= malloc(len-1);
+    if (!result) { ctx->err= errno; return 0; }
+
+    q= result;
+
+    for (p= src+1;
+         p < src+len-1;
+         ) {
+        c= *p++;
+        if (c=='\\') {
+            assert(p < src+len-1);
+            nc= *p++;
+            if (nc=='"' || nc=='\'' || nc=='\\') {
+                *q++= nc;
+            } else if (nc=='a') { *q++= '\007';
+            } else if (nc=='b') { *q++= '\010';
+            } else if (nc=='f') { *q++= '\014';
+            } else if (nc=='n') { *q++= '\n';
+            } else if (nc=='r') { *q++= '\r';
+            } else if (nc=='t') { *q++= '\t';
+            } else if (nc=='v') { *q++= '\013';
+            } else if (nc=='x') {
+
+#define NUMERIC_CHAR(minlen,maxlen,base,basetext) do{                        \
+                char numbuf[(maxlen)+1], *ep;                                \
+                unsigned long val;                                           \
+                                                                             \
+                strncpy(numbuf,p,(maxlen));                                  \
+                numbuf[(maxlen)]= 0;                                         \
+                val= strtoul(numbuf, &ep, (base));                           \
+                if (ep <= numbuf+(minlen)) {                                 \
+                    xlu__cfgl_lexicalerror(ctx,"invalid digit after"         \
+                         " backslash " basetext "numerical character escape" \
+                         " in quoted string");                               \
+                    ctx->err= EINVAL;                                        \
+                    goto x;                                                  \
+                }                                                            \
+                p += (ep - numbuf);                                          \
+ }while(0)
+
+                p++;
+                NUMERIC_CHAR(2,2,16,"hex");
+            } else if (nc>='0' && nc<='7') {
+                NUMERIC_CHAR(1,3,10,"octal");
+            } else {
+                xlu__cfgl_lexicalerror(ctx,
+                           "invalid character after backlash in quoted string");
+                ctx->err= EINVAL;
+                goto x;
+            }
+            assert(p <= src+len-1);
+        } else {
+            *q++= c;
+        }
+    }
+
+ x:
+    *q++= 0;
+    return result;
+}
+
+void xlu__cfgl_lexicalerror(CfgParseContext *ctx, char const *msg) {
+    YYLTYPE loc;
+    loc.first_line= xlu__cfg_yyget_lineno(ctx->scanner);
+    xlu__cfg_yyerror(&loc, ctx, msg);
+    ctx->lexerrlineno= loc.first_line;
+}
+
+void xlu__cfg_yyerror(YYLTYPE *loc, CfgParseContext *ctx, char const *msg) {
+    const char *text, *newline;
+    int len, lineno;
+
+    lineno= loc->first_line;
+    if (lineno <= ctx->lexerrlineno) return;
+
+    text= xlu__cfg_yyget_text(ctx->scanner);
+    len= xlu__cfg_yyget_leng(ctx->scanner);
+    newline= "";
+    if (len>0 && text[len-1]=='\n') {
+        len--;
+        lineno--;
+        if (!len) {
+            newline= "<newline>";
+        }
+    }
+    while (len>0 && (text[len-1]=='\t' || text[len-1]==' ')) {
+        len--;
+    }
+
+    fprintf(ctx->cfg->report,
+            "%s:%d: config parsing error near %s%.*s%s%s: %s\n",
+            ctx->cfg->config_source, lineno,
+            len?"`":"", len, text, len?"'":"", newline,
+            msg);
+    if (!ctx->err) ctx->err= EINVAL;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg_i.h b/tools/libs/util/libxlu_cfg_i.h
new file mode 100644
index 0000000000..4217f5b28d
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg_i.h
@@ -0,0 +1,59 @@
+/*
+ * libxlu_cfg_i.h - xl configuration file parsing: parser-internal declarations
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#ifndef LIBXLU_CFG_I_H
+#define LIBXLU_CFG_I_H
+
+#include "libxlu_internal.h"
+#include "libxlu_cfg_y.h"
+
+void xlu__cfg_set_free(XLU_ConfigSetting *set);
+void xlu__cfg_set_store(CfgParseContext*, char *name,
+                        enum XLU_Operation op,
+                        XLU_ConfigValue *val, int lineno);
+XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx,
+                                    char *atom, YYLTYPE *loc);
+XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx,
+                                  XLU_ConfigValue *val,
+                                  YYLTYPE *loc);
+void xlu__cfg_list_append(CfgParseContext *ctx,
+                          XLU_ConfigValue *list,
+                          XLU_ConfigValue *val);
+void xlu__cfg_value_free(XLU_ConfigValue *value);
+char *xlu__cfgl_strdup(CfgParseContext*, const char *src);
+char *xlu__cfgl_dequote(CfgParseContext*, const char *src);
+
+void xlu__cfg_yyerror(YYLTYPE *locp, CfgParseContext*, char const *msg);
+void xlu__cfgl_lexicalerror(CfgParseContext*, char const *msg);
+
+void xlu__cfgl_likely_python(CfgParseContext *ctx);
+
+
+
+/* Why oh why does bison not declare this in its autogenerated .h ? */
+int xlu__cfg_yyparse(CfgParseContext *ctx);
+
+
+#endif /*LIBXLU_CFG_I_H*/
+
+/*
+ * Local variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libs/util/libxlu_cfg_l.c b/tools/libs/util/libxlu_cfg_l.c
new file mode 100644
index 0000000000..406b50a037
--- /dev/null
+++ b/tools/libs/util/libxlu_cfg_l.c
@@ -0,0 +1,2375 @@
+#line 2 "libxlu_cfg_l.c"
+
+#line 4 "libxlu_cfg_l.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+#ifdef yy_create_buffer
+#define xlu__cfg_yy_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer xlu__cfg_yy_create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define xlu__cfg_yy_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer xlu__cfg_yy_delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define xlu__cfg_yy_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer xlu__cfg_yy_scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define xlu__cfg_yy_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string xlu__cfg_yy_scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define xlu__cfg_yy_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes xlu__cfg_yy_scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define xlu__cfg_yy_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer xlu__cfg_yy_init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define xlu__cfg_yy_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer xlu__cfg_yy_flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define xlu__cfg_yy_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state xlu__cfg_yy_load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define xlu__cfg_yy_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer xlu__cfg_yy_switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define xlu__cfg_yypush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state xlu__cfg_yypush_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define xlu__cfg_yypop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state xlu__cfg_yypop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define xlu__cfg_yyensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack xlu__cfg_yyensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define xlu__cfg_yylex_ALREADY_DEFINED
+#else
+#define yylex xlu__cfg_yylex
+#endif
+
+#ifdef yyrestart
+#define xlu__cfg_yyrestart_ALREADY_DEFINED
+#else
+#define yyrestart xlu__cfg_yyrestart
+#endif
+
+#ifdef yylex_init
+#define xlu__cfg_yylex_init_ALREADY_DEFINED
+#else
+#define yylex_init xlu__cfg_yylex_init
+#endif
+
+#ifdef yylex_init_extra
+#define xlu__cfg_yylex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra xlu__cfg_yylex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define xlu__cfg_yylex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy xlu__cfg_yylex_destroy
+#endif
+
+#ifdef yyget_debug
+#define xlu__cfg_yyget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug xlu__cfg_yyget_debug
+#endif
+
+#ifdef yyset_debug
+#define xlu__cfg_yyset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug xlu__cfg_yyset_debug
+#endif
+
+#ifdef yyget_extra
+#define xlu__cfg_yyget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra xlu__cfg_yyget_extra
+#endif
+
+#ifdef yyset_extra
+#define xlu__cfg_yyset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra xlu__cfg_yyset_extra
+#endif
+
+#ifdef yyget_in
+#define xlu__cfg_yyget_in_ALREADY_DEFINED
+#else
+#define yyget_in xlu__cfg_yyget_in
+#endif
+
+#ifdef yyset_in
+#define xlu__cfg_yyset_in_ALREADY_DEFINED
+#else
+#define yyset_in xlu__cfg_yyset_in
+#endif
+
+#ifdef yyget_out
+#define xlu__cfg_yyget_out_ALREADY_DEFINED
+#else
+#define yyget_out xlu__cfg_yyget_out
+#endif
+
+#ifdef yyset_out
+#define xlu__cfg_yyset_out_ALREADY_DEFINED
+#else
+#define yyset_out xlu__cfg_yyset_out
+#endif
+
+#ifdef yyget_leng
+#define xlu__cfg_yyget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng xlu__cfg_yyget_leng
+#endif
+
+#ifdef yyget_text
+#define xlu__cfg_yyget_text_ALREADY_DEFINED
+#else
+#define yyget_text xlu__cfg_yyget_text
+#endif
+
+#ifdef yyget_lineno
+#define xlu__cfg_yyget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno xlu__cfg_yyget_lineno
+#endif
+
+#ifdef yyset_lineno
+#define xlu__cfg_yyset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno xlu__cfg_yyset_lineno
+#endif
+
+#ifdef yyget_column
+#define xlu__cfg_yyget_column_ALREADY_DEFINED
+#else
+#define yyget_column xlu__cfg_yyget_column
+#endif
+
+#ifdef yyset_column
+#define xlu__cfg_yyset_column_ALREADY_DEFINED
+#else
+#define yyset_column xlu__cfg_yyset_column
+#endif
+
+#ifdef yywrap
+#define xlu__cfg_yywrap_ALREADY_DEFINED
+#else
+#define yywrap xlu__cfg_yywrap
+#endif
+
+#ifdef yyget_lval
+#define xlu__cfg_yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval xlu__cfg_yyget_lval
+#endif
+
+#ifdef yyset_lval
+#define xlu__cfg_yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval xlu__cfg_yyset_lval
+#endif
+
+#ifdef yyget_lloc
+#define xlu__cfg_yyget_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc xlu__cfg_yyget_lloc
+#endif
+
+#ifdef yyset_lloc
+#define xlu__cfg_yyset_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc xlu__cfg_yyset_lloc
+#endif
+
+#ifdef yyalloc
+#define xlu__cfg_yyalloc_ALREADY_DEFINED
+#else
+#define yyalloc xlu__cfg_yyalloc
+#endif
+
+#ifdef yyrealloc
+#define xlu__cfg_yyrealloc_ALREADY_DEFINED
+#else
+#define yyrealloc xlu__cfg_yyrealloc
+#endif
+
+#ifdef yyfree
+#define xlu__cfg_yyfree_ALREADY_DEFINED
+#else
+#define yyfree xlu__cfg_yyfree
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX               (~(size_t)0)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+/* begin standard C++ headers. */
+
+/* TODO: this is always defined, so inline it */
+#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
+#else
+#define yynoreturn
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an
+ *   integer in range [0..255] for use as an array index.
+ */
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+   are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+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
+    
+    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+     *       access to the local variable yy_act. Since yyless() is a macro, it would break
+     *       existing scanners that call yyless() from OUTSIDE yylex.
+     *       One obvious solution it to make yy_act a global. I tried that, and saw
+     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
+     *       normally declared as a register variable-- so it is not worth it.
+     */
+    #define  YY_LESS_LINENO(n) \
+            do { \
+                int yyl;\
+                for ( yyl = n; yyl < yyleng; ++yyl )\
+                    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) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = yyg->yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	int yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int 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
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+
+	};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+                          : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
+
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
+
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
+#define yy_new_buffer yy_create_buffer
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+#define xlu__cfg_yywrap(yyscanner) (/*CONSTCOND*/1)
+#define YY_SKIP_YYWRAP
+typedef flex_uint8_t YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yyg->yytext_ptr = yy_bp; \
+	yyg->yytext_ptr -= yyg->yy_more_len; \
+	yyleng = (int) (yy_cp - yyg->yytext_ptr); \
+	yyg->yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yyg->yy_c_buf_p = yy_cp;
+#define YY_NUM_RULES 17
+#define YY_END_OF_BUFFER 18
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static const flex_int16_t yy_accept[37] =
+    {   0,
+        0,    0,   15,   15,   18,   14,    3,   10,   14,   14,
+       14,   13,   13,    4,    2,    9,    8,    5,    6,    1,
+       15,   15,   16,    0,   12,    0,    0,   10,    0,   11,
+        0,    7,    2,    1,   15,    0
+    } ;
+
+static const YY_CHAR yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    5,    1,    1,    1,    6,    7,
+        7,    1,    8,    9,    7,   10,    1,   11,   11,   11,
+       11,   11,   11,   11,   11,   11,   11,    7,   12,    1,
+       13,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+       14,   15,   16,    1,   17,    1,   18,   18,   18,   18,
+
+       18,   18,   19,   19,   19,   19,   19,   19,   19,   19,
+       19,   19,   19,   19,   19,   19,   19,   19,   19,   18,
+       19,   19,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static const YY_CHAR yy_meta[20] =
+    {   0,
+        1,    2,    3,    1,    1,    1,    1,    1,    1,    4,
+        4,    1,    1,    1,    1,    1,    4,    4,    4
+    } ;
+
+static const flex_int16_t yy_base[43] =
+    {   0,
+        0,    0,   18,   20,   53,   59,   59,   59,   20,   42,
+       19,   59,   19,   59,   15,   59,   59,   59,   59,    0,
+        0,   59,   59,   23,   59,    0,   28,   59,   22,   59,
+        0,   59,   18,    0,    0,   59,   38,   42,   46,   50,
+       26,   54
+    } ;
+
+static const flex_int16_t yy_def[43] =
+    {   0,
+       36,    1,   37,   37,   36,   36,   36,   36,   38,   39,
+       40,   36,   36,   36,   36,   36,   36,   36,   36,   41,
+       42,   36,   36,   38,   36,   38,   39,   36,   40,   36,
+       40,   36,   36,   41,   42,    0,   36,   36,   36,   36,
+       36,   36
+    } ;
+
+static const flex_int16_t yy_nxt[79] =
+    {   0,
+        6,    7,    8,    9,   10,   11,   12,   13,   14,   12,
+       15,   16,   17,   18,    6,   19,    6,   20,   20,   22,
+       23,   22,   23,   25,   30,   33,   25,   30,   33,   34,
+       28,   32,   33,   31,   26,   33,   31,   26,   21,   21,
+       21,   21,   24,   24,   28,   24,   27,   27,   27,   27,
+       29,   29,   36,   29,   35,   36,   36,   35,    5,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36
+    } ;
+
+static const flex_int16_t yy_chk[79] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    3,
+        3,    4,    4,    9,   11,   15,   24,   29,   33,   41,
+       27,   13,   15,   11,    9,   33,   29,   24,   37,   37,
+       37,   37,   38,   38,   10,   38,   39,   39,   39,   39,
+       40,   40,    5,   40,   42,    0,    0,   42,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36
+    } ;
+
+/* Table of booleans, true if rule could match eol. */
+static const flex_int32_t yy_rule_can_match_eol[18] =
+    {   0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,     };
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() (yyg->yy_more_flag = 1)
+#define YY_MORE_ADJ yyg->yy_more_len
+#define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "libxlu_cfg_l.l"
+/* -*- fundamental -*- */
+/*
+ * libxlu_cfg_l.l - xl configuration file parsing: lexer
+ *
+ * Copyright (C) 2010      Citrix Ltd.
+ * Author Ian Jackson <ian.jackson@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+#line 20 "libxlu_cfg_l.l"
+#include "libxlu_cfg_i.h"
+
+#define ctx ((CfgParseContext*)yyextra)
+#define YY_NO_INPUT
+
+#define GOT(x) do{                \
+    yylloc->first_line= yylineno; \
+    return (x);                   \
+  }while(0)
+
+/* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
+ * it to fail to declare these functions, which it defines.  So declare
+ * them ourselves.  Hopefully we won't have to simultaneously support
+ * a flex version which declares these differently somehow. */
+int xlu__cfg_yyget_column(yyscan_t yyscanner);
+void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
+
+#line 740 "libxlu_cfg_l.c"
+
+#line 742 "libxlu_cfg_l.c"
+
+#define INITIAL 0
+#define lexerr 1
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+    {
+
+    /* User-defined. Not touched by flex. */
+    YY_EXTRA_TYPE yyextra_r;
+
+    /* The rest are the same as the globals declared in the non-reentrant scanner. */
+    FILE *yyin_r, *yyout_r;
+    size_t yy_buffer_stack_top; /**< index of top of stack. */
+    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;
+    char *yy_c_buf_p;
+    int yy_init;
+    int yy_start;
+    int yy_did_buffer_switch_on_eof;
+    int yy_start_stack_ptr;
+    int yy_start_stack_depth;
+    int *yy_start_stack;
+    yy_state_type yy_last_accepting_state;
+    char* yy_last_accepting_cpos;
+
+    int yylineno_r;
+    int yy_flex_debug_r;
+
+    char *yytext_r;
+    int yy_more_flag;
+    int yy_more_len;
+
+    YYSTYPE * yylval_r;
+
+    YYLTYPE * yylloc_r;
+
+    }; /* end struct yyguts_t */
+
+static int yy_init_globals ( yyscan_t yyscanner );
+
+    /* This must go here because YYSTYPE and YYLTYPE are included
+     * from bison output in section 1.*/
+    #    define yylval yyg->yylval_r
+    
+    #    define yylloc yyg->yylloc_r
+    
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
+
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
+
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
+
+FILE *yyget_in ( yyscan_t yyscanner );
+
+void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
+
+			int yyget_leng ( yyscan_t yyscanner );
+
+char *yyget_text ( yyscan_t yyscanner );
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+int yyget_column  ( yyscan_t yyscanner );
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+       YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
+    
+        void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
+    
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap ( yyscan_t yyscanner );
+#else
+extern int yywrap ( yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+    
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput ( yyscan_t yyscanner );
+#else
+static int input ( yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		int n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+	yy_state_type yy_current_state;
+	char *yy_cp, *yy_bp;
+	int yy_act;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    yylval = yylval_param;
+
+    yylloc = yylloc_param;
+
+	if ( !yyg->yy_init )
+		{
+		yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yyg->yy_start )
+			yyg->yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			yyensure_buffer_stack (yyscanner);
+			YY_CURRENT_BUFFER_LVALUE =
+				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+		}
+
+		yy_load_buffer_state( yyscanner );
+		}
+
+	{
+#line 53 "libxlu_cfg_l.l"
+
+
+#line 1028 "libxlu_cfg_l.c"
+
+	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
+		{
+		yyg->yy_more_len = 0;
+		if ( yyg->yy_more_flag )
+			{
+			yyg->yy_more_len = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
+			yyg->yy_more_flag = 0;
+			}
+		yy_cp = yyg->yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yyg->yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yyg->yy_start;
+yy_match:
+		do
+			{
+			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;
+				yyg->yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 37 )
+					yy_c = yy_meta[yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+			++yy_cp;
+			}
+		while ( yy_current_state != 36 );
+		yy_cp = yyg->yy_last_accepting_cpos;
+		yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+
+		YY_DO_BEFORE_ACTION;
+
+		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+			{
+			int yyl;
+			for ( yyl = yyg->yy_more_len; yyl < yyleng; ++yyl )
+				if ( yytext[yyl] == '\n' )
+					
+    do{ yylineno++;
+        yycolumn=0;
+    }while(0)
+;
+			}
+
+do_action:	/* This label is used only to access EOF actions. */
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yyg->yy_hold_char;
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 55 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_strdup(ctx,yytext);
+                          GOT(IDENT);
+                        }
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 59 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_strdup(ctx,yytext);
+                          GOT(NUMBER);
+                        }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 64 "libxlu_cfg_l.l"
+
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 66 "libxlu_cfg_l.l"
+{ GOT(','); }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 67 "libxlu_cfg_l.l"
+{ GOT('['); }
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 68 "libxlu_cfg_l.l"
+{ GOT(']'); }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 69 "libxlu_cfg_l.l"
+{ GOT(OP_ADD); }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 70 "libxlu_cfg_l.l"
+{ GOT('='); }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 71 "libxlu_cfg_l.l"
+{ GOT(';'); }
+	YY_BREAK
+case 10:
+/* rule 10 can match eol */
+YY_RULE_SETUP
+#line 73 "libxlu_cfg_l.l"
+{ yylloc->first_line= yylineno-1; return NEWLINE; }
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 75 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_dequote(ctx,yytext);
+                          GOT(STRING);
+                        }
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 79 "libxlu_cfg_l.l"
+{
+                          yylval->string= xlu__cfgl_dequote(ctx,yytext);
+                          GOT(STRING);
+                        }
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 84 "libxlu_cfg_l.l"
+{
+                          ctx->likely_python= 1;
+                          BEGIN(lexerr);
+                          yymore();
+                        }
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 90 "libxlu_cfg_l.l"
+{
+                          BEGIN(lexerr);
+                          yymore();
+                        }
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 95 "libxlu_cfg_l.l"
+{
+                          xlu__cfgl_lexicalerror(ctx,"lexical error");
+                          BEGIN(0);
+                        }
+	YY_BREAK
+case 16:
+/* rule 16 can match eol */
+YY_RULE_SETUP
+#line 100 "libxlu_cfg_l.l"
+{
+                          xlu__cfgl_lexicalerror(ctx,"lexical error");
+                          BEGIN(0);
+                          GOT(NEWLINE);
+                        }
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 105 "libxlu_cfg_l.l"
+YY_FATAL_ERROR( "flex scanner jammed" );
+	YY_BREAK
+#line 1212 "libxlu_cfg_l.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(lexerr):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yyg->yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state( yyscanner );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yyg->yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yyg->yy_last_accepting_cpos;
+				yy_current_state = yyg->yy_last_accepting_state;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer( yyscanner ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yyg->yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap( yyscanner ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yyg->yy_c_buf_p =
+					yyg->yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yyg->yy_c_buf_p =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of user's declarations */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	char *source = yyg->yytext_ptr;
+	int number_to_move, i;
+	int ret_val;
+
+	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+	else
+		{
+			int 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_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;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yyrealloc( (void *) b->yy_ch_buf,
+							 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = NULL;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+						number_to_move - 1;
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	if ( yyg->yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin  , yyscanner);
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+		/* "- 2" to take care of EOB's */
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
+	}
+
+	yyg->yy_n_chars += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+	return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+	yy_state_type yy_current_state;
+	char *yy_cp;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_current_state = yyg->yy_start;
+
+	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+		{
+		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yyg->yy_last_accepting_state = yy_current_state;
+			yyg->yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 37 )
+				yy_c = yy_meta[yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+		}
+


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3215.9327 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQy-0002eX-Lm; Tue, 06 Oct 2020 10:43:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3215.9327; Tue, 06 Oct 2020 10:43:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkQy-0002eQ-In; Tue, 06 Oct 2020 10:43:04 +0000
Received: by outflank-mailman (input) for mailman id 3215;
 Tue, 06 Oct 2020 10:43:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkQx-0002eK-FZ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee2a5555-e1d4-4c61-ab8a-509f7d5931ba;
 Tue, 06 Oct 2020 10:43:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQu-0001Zh-Pw
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkQu-0008Cl-PI
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkQx-0002eK-FZ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:03 +0000
X-Inumbo-ID: ee2a5555-e1d4-4c61-ab8a-509f7d5931ba
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee2a5555-e1d4-4c61-ab8a-509f7d5931ba;
	Tue, 06 Oct 2020 10:43:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vm8jTexZEgG5EOUFba5ZJgG4qcJiWdkOTU/lUO5Ar1c=; b=pSaSMHAApXIwDmyfjfjCzTUrT9
	QRtJRCMwcx8eChNhUjmGHMR3Gm+e3AxMLnFkk5PzqsXk0wNNx1J1Y5yhRb/Dxdemt+lBwR9KacgVn
	qjlpuhQocmZ8E6HduVz65krRN7aqLVU86Ainx9vLmlkE29PZMOU9tUbZq4CnctUipKEM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQu-0001Zh-Pw
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkQu-0008Cl-PI
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs: merge xenctrl_dom.h into xenguest.h
Message-Id: <E1kPkQu-0008Cl-PI@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:00 +0000

commit 77a09716f251ac0e35ddd4bfda8f35fe639f432b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:42 2020 +0200

    tools/libs: merge xenctrl_dom.h into xenguest.h
    
    Today xenctrl_dom.h is part of libxenctrl as it is included by
    xc_private.c. This seems not to be needed, so merge xenctrl_dom.h into
    xenguest.h where its contents really should be.
    
    Replace all #includes of xenctrl_dom.h by xenguest.h ones or drop them
    if xenguest.h is already included.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 stubdom/grub/kexec.c                        |   2 +-
 tools/helpers/init-xenstore-domain.c        |   2 +-
 tools/libs/ctrl/Makefile                    |   2 +-
 tools/libs/ctrl/include/xenctrl_dom.h       | 455 ----------------------------
 tools/libs/ctrl/xc_private.c                |   1 -
 tools/libs/guest/include/xenguest.h         | 426 +++++++++++++++++++++++++-
 tools/libs/guest/xg_dom_arm.c               |   1 -
 tools/libs/guest/xg_dom_armzimageloader.c   |   1 -
 tools/libs/guest/xg_dom_binloader.c         |   1 -
 tools/libs/guest/xg_dom_boot.c              |   1 -
 tools/libs/guest/xg_dom_compat_linux.c      |   1 -
 tools/libs/guest/xg_dom_core.c              |   1 -
 tools/libs/guest/xg_dom_decompress.h        |   4 +-
 tools/libs/guest/xg_dom_decompress_unsafe.h |   2 -
 tools/libs/guest/xg_dom_elfloader.c         |   1 -
 tools/libs/guest/xg_dom_hvmloader.c         |   1 -
 tools/libs/guest/xg_dom_x86.c               |   1 -
 tools/libs/guest/xg_offline_page.c          |   1 -
 tools/libs/guest/xg_sr_common.h             |   1 -
 tools/libs/light/libxl_arm.c                |   1 -
 tools/libs/light/libxl_arm.h                |   2 -
 tools/libs/light/libxl_create.c             |   1 -
 tools/libs/light/libxl_dm.c                 |   1 -
 tools/libs/light/libxl_dom.c                |   1 -
 tools/libs/light/libxl_internal.h           |   1 -
 tools/libs/light/libxl_vnuma.c              |   2 -
 tools/libs/light/libxl_x86.c                |   2 -
 tools/libs/light/libxl_x86_acpi.c           |   2 -
 tools/python/xen/lowlevel/xc/xc.c           |   2 +-
 29 files changed, 430 insertions(+), 490 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index 24001220a9..e9a69d2a32 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -20,7 +20,7 @@
 #include <sys/mman.h>
 
 #include <xenctrl.h>
-#include <xenctrl_dom.h>
+#include <xenguest.h>
 
 #include <kernel.h>
 #include <console.h>
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 5bdb48dc80..bcaa0e6fa9 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -8,7 +8,7 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <xenctrl.h>
-#include <xenctrl_dom.h>
+#include <xenguest.h>
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
diff --git a/tools/libs/ctrl/Makefile b/tools/libs/ctrl/Makefile
index ec93fb5b73..0071226d2a 100644
--- a/tools/libs/ctrl/Makefile
+++ b/tools/libs/ctrl/Makefile
@@ -49,7 +49,7 @@ CFLAGS += -include $(XEN_ROOT)/tools/config.h
 # Needed for posix_fadvise64() in xc_linux.c
 CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE
 
-LIBHEADER := xenctrl.h xenctrl_compat.h xenctrl_dom.h
+LIBHEADER := xenctrl.h xenctrl_compat.h
 PKG_CONFIG := xencontrol.pc
 PKG_CONFIG_NAME := Xencontrol
 
diff --git a/tools/libs/ctrl/include/xenctrl_dom.h b/tools/libs/ctrl/include/xenctrl_dom.h
deleted file mode 100644
index 40b85b7755..0000000000
--- a/tools/libs/ctrl/include/xenctrl_dom.h
+++ /dev/null
@@ -1,455 +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/>.
- */
-
-#ifndef _XC_DOM_H
-#define _XC_DOM_H
-
-#include <xen/libelf/libelf.h>
-
-#define X86_HVM_NR_SPECIAL_PAGES    8
-#define X86_HVM_END_SPECIAL_REGION  0xff000u
-#define XG_MAX_MODULES 2
-
-/* --- typedefs and structs ---------------------------------------- */
-
-typedef uint64_t xen_vaddr_t;
-typedef uint64_t xen_paddr_t;
-
-#define PRIpfn PRI_xen_pfn
-
-struct xc_dom_seg {
-    xen_vaddr_t vstart;
-    xen_vaddr_t vend;
-    xen_pfn_t pfn;
-    xen_pfn_t pages;
-};
-
-struct xc_hvm_firmware_module {
-    uint8_t  *data;
-    uint32_t  length;
-    uint64_t  guest_addr_out;
-};
-
-struct xc_dom_mem {
-    struct xc_dom_mem *next;
-    void *ptr;
-    enum {
-        XC_DOM_MEM_TYPE_MALLOC_INTERNAL,
-        XC_DOM_MEM_TYPE_MALLOC_EXTERNAL,
-        XC_DOM_MEM_TYPE_MMAP,
-    } type;
-    size_t len;
-    unsigned char memory[0];
-};
-
-struct xc_dom_phys {
-    struct xc_dom_phys *next;
-    void *ptr;
-    xen_pfn_t first;
-    xen_pfn_t count;
-};
-
-struct xc_dom_module {
-    void *blob;
-    size_t size;
-    void *cmdline;
-    /* If seg.vstart is non zero then the module will be loaded at that
-     * address, otherwise it will automatically placed.
-     *
-     * If automatic placement is used and the module is gzip
-     * compressed then it will be decompressed as it is loaded. If the
-     * module has been explicitly placed then it is loaded as is
-     * otherwise decompressing risks undoing the manual placement.
-     */
-    struct xc_dom_seg seg;
-};
-
-struct xc_dom_image {
-    /* files */
-    void *kernel_blob;
-    size_t kernel_size;
-    unsigned int num_modules;
-    struct xc_dom_module modules[XG_MAX_MODULES];
-    void *devicetree_blob;
-    size_t devicetree_size;
-
-    size_t max_kernel_size;
-    size_t max_module_size;
-    size_t max_devicetree_size;
-
-    /* arguments and parameters */
-    char *cmdline;
-    size_t cmdline_size;
-    uint32_t f_requested[XENFEAT_NR_SUBMAPS];
-
-    /* info from (elf) kernel image */
-    struct elf_dom_parms parms;
-    char *guest_type;
-
-    /* memory layout */
-    struct xc_dom_seg kernel_seg;
-    struct xc_dom_seg p2m_seg;
-    struct xc_dom_seg pgtables_seg;
-    struct xc_dom_seg devicetree_seg;
-    struct xc_dom_seg start_info_seg;
-    xen_pfn_t start_info_pfn;
-    xen_pfn_t console_pfn;
-    xen_pfn_t xenstore_pfn;
-    xen_pfn_t shared_info_pfn;
-    xen_pfn_t bootstack_pfn;
-    xen_pfn_t pfn_alloc_end;
-    xen_vaddr_t virt_alloc_end;
-    xen_vaddr_t bsd_symtab_start;
-
-    /*
-     * initrd parameters as specified in start_info page
-     * Depending on capabilities of the booted kernel this may be a virtual
-     * address or a pfn. Type is neutral and large enough to hold a virtual
-     * address of a 64 bit kernel even with 32 bit toolstack.
-     */
-    uint64_t initrd_start;
-    uint64_t initrd_len;
-
-    unsigned int alloc_bootstack;
-    xen_vaddr_t virt_pgtab_end;
-
-    /* other state info */
-    uint32_t f_active[XENFEAT_NR_SUBMAPS];
-
-    /*
-     * pv_p2m is specific to x86 PV guests, and maps GFNs to MFNs.  It is
-     * eventually copied into guest context.
-     */
-    xen_pfn_t *pv_p2m;
-
-    /* physical memory
-     *
-     * An x86 PV guest has one or more blocks of physical RAM,
-     * consisting of total_pages starting at 0. The start address and
-     * size of each block is controlled by vNUMA structures.
-     *
-     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
-     * rambank_size[i] pages in each. The lowest RAM address
-     * (corresponding to the base of the p2m arrays above) is stored
-     * in rambase_pfn.
-     */
-    xen_pfn_t rambase_pfn;
-    xen_pfn_t total_pages;
-    xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
-    struct xc_dom_phys *phys_pages;
-#if defined (__arm__) || defined(__aarch64__)
-    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
-#endif
-
-    /* malloc memory pool */
-    struct xc_dom_mem *memblocks;
-
-    /* memory footprint stats */
-    size_t alloc_malloc;
-    size_t alloc_mem_map;
-    size_t alloc_file_map;
-    size_t alloc_domU_map;
-
-    /* misc xen domain config stuff */
-    unsigned long flags;
-    unsigned int console_evtchn;
-    unsigned int xenstore_evtchn;
-    uint32_t console_domid;
-    uint32_t xenstore_domid;
-    xen_pfn_t shared_info_mfn;
-
-    xc_interface *xch;
-    uint32_t guest_domid;
-    int claim_enabled; /* 0 by default, 1 enables it */
-
-    int xen_version;
-    xen_capabilities_info_t xen_caps;
-
-    /* kernel loader, arch hooks */
-    struct xc_dom_loader *kernel_loader;
-    void *private_loader;
-
-    /* vNUMA information */
-    xen_vmemrange_t *vmemranges;
-    unsigned int nr_vmemranges;
-    unsigned int *vnode_to_pnode;
-    unsigned int nr_vnodes;
-
-    /* domain type/architecture specific data */
-    void *arch_private;
-
-    /* kernel loader */
-    struct xc_dom_arch *arch_hooks;
-    /* allocate up to pfn_alloc_end */
-    int (*allocate) (struct xc_dom_image * dom);
-
-    /* Container type (HVM or PV). */
-    enum {
-        XC_DOM_PV_CONTAINER,
-        XC_DOM_HVM_CONTAINER,
-    } container_type;
-
-    /* HVM specific fields. */
-    xen_pfn_t target_pages;
-    xen_paddr_t mmio_start;
-    xen_paddr_t mmio_size;
-    xen_paddr_t lowmem_end;
-    xen_paddr_t highmem_end;
-    xen_pfn_t vga_hole_size;
-
-    /* If unset disables the setup of the IOREQ pages. */
-    bool device_model;
-
-    /* BIOS/Firmware passed to HVMLOADER */
-    struct xc_hvm_firmware_module system_firmware_module;
-
-    /* Extra ACPI tables */
-#define MAX_ACPI_MODULES        4
-    struct xc_hvm_firmware_module acpi_modules[MAX_ACPI_MODULES];
-
-    /* Extra SMBIOS structures passed to HVMLOADER */
-    struct xc_hvm_firmware_module smbios_module;
-
-#if defined(__i386__) || defined(__x86_64__)
-    struct e820entry *e820;
-    unsigned int e820_entries;
-#endif
-
-    xen_pfn_t vuart_gfn;
-
-    /* Number of vCPUs */
-    unsigned int max_vcpus;
-};
-
-/* --- pluggable kernel loader ------------------------------------- */
-
-struct xc_dom_loader {
-    char *name;
-    /* Sadly the error returns from these functions are not consistent: */
-    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
-    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
-    elf_errorstatus (*loader) (struct xc_dom_image * dom);
-
-    struct xc_dom_loader *next;
-};
-
-#define __init __attribute__ ((constructor))
-void xc_dom_register_loader(struct xc_dom_loader *loader);
-
-/* --- arch specific hooks ----------------------------------------- */
-
-struct xc_dom_arch {
-    int (*alloc_magic_pages) (struct xc_dom_image * dom);
-
-    /* pagetable setup - x86 PV only */
-    int (*alloc_pgtables) (struct xc_dom_image * dom);
-    int (*alloc_p2m_list) (struct xc_dom_image * dom);
-    int (*setup_pgtables) (struct xc_dom_image * dom);
-
-    /* arch-specific data structs setup */
-    /* in Mini-OS environment start_info might be a macro, avoid collision. */
-#undef start_info
-    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);
-    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);
-
-    char *guest_type;
-    char *native_protocol;
-    int page_shift;
-    int sizeof_pfn;
-    int p2m_base_supported;
-    int arch_private_size;
-
-    struct xc_dom_arch *next;
-};
-void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
-
-#define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
-#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
-
-/* --- main functions ---------------------------------------------- */
-
-struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
-                                     const char *cmdline, const char *features);
-void xc_dom_release_phys(struct xc_dom_image *dom);
-void xc_dom_release(struct xc_dom_image *dom);
-int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase);
-int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
-
-/* Set this larger if you have enormous modules/kernels. Note that
- * you should trust all kernels not to be maliciously large (e.g. to
- * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
- * XSA-25). You can also set the default independently for
- * modules/kernels in xc_dom_allocate() or call
- * xc_dom_{kernel,module}_max_size.
- */
-#ifndef XC_DOM_DECOMPRESS_MAX
-#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
-#endif
-
-int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
-int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_module_max_size(struct xc_dom_image *dom, size_t sz);
-
-int xc_dom_devicetree_max_size(struct xc_dom_image *dom, size_t sz);
-
-size_t xc_dom_check_gzip(xc_interface *xch,
-                     void *blob, size_t ziplen);
-int xc_dom_do_gunzip(xc_interface *xch,
-                     void *src, size_t srclen, void *dst, size_t dstlen);
-int xc_dom_try_gunzip(struct xc_dom_image *dom, void **blob, size_t * size);
-
-int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename);
-int xc_dom_module_file(struct xc_dom_image *dom, const char *filename,
-                       const char *cmdline);
-int xc_dom_kernel_mem(struct xc_dom_image *dom, const void *mem,
-                      size_t memsize);
-int xc_dom_module_mem(struct xc_dom_image *dom, const void *mem,
-                       size_t memsize, const char *cmdline);
-int xc_dom_devicetree_file(struct xc_dom_image *dom, const char *filename);
-int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
-                          size_t memsize);
-
-int xc_dom_parse_image(struct xc_dom_image *dom);
-int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
-int xc_dom_build_image(struct xc_dom_image *dom);
-
-int xc_dom_boot_xen_init(struct xc_dom_image *dom, xc_interface *xch,
-                         uint32_t domid);
-int xc_dom_boot_mem_init(struct xc_dom_image *dom);
-void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
-                           xen_pfn_t count);
-int xc_dom_boot_image(struct xc_dom_image *dom);
-int xc_dom_compat_check(struct xc_dom_image *dom);
-int xc_dom_gnttab_init(struct xc_dom_image *dom);
-int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
-                       bool is_hvm,
-                       xen_pfn_t console_gfn,
-                       xen_pfn_t xenstore_gfn,
-                       uint32_t console_domid,
-                       uint32_t xenstore_domid);
-bool xc_dom_translated(const struct xc_dom_image *dom);
-
-/* --- debugging bits ---------------------------------------------- */
-
-int xc_dom_loginit(xc_interface *xch);
-
-void xc_dom_printf(xc_interface *xch, const char *fmt, ...)
-     __attribute__ ((format(printf, 2, 3)));
-void xc_dom_panic_func(xc_interface *xch,
-                      const char *file, int line, xc_error_code err,
-                      const char *fmt, ...)
-    __attribute__ ((format(printf, 5, 6)));
-
-#define xc_dom_panic(xch, err, fmt, args...) \
-    xc_dom_panic_func(xch, __FILE__, __LINE__, err, fmt, ## args)
-#define xc_dom_trace(mark) \
-    xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark)
-
-void xc_dom_log_memory_footprint(struct xc_dom_image *dom);
-
-/* --- simple memory pool ------------------------------------------ */
-
-void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
-int xc_dom_register_external(struct xc_dom_image *dom, void *ptr, size_t size);
-void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
-void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
-                            const char *filename, size_t * size,
-                            const size_t max_size);
-char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
-
-/* --- alloc memory pool ------------------------------------------- */
-
-xen_pfn_t xc_dom_alloc_page(struct xc_dom_image *dom, char *name);
-int xc_dom_alloc_segment(struct xc_dom_image *dom,
-                         struct xc_dom_seg *seg, char *name,
-                         xen_vaddr_t start, xen_vaddr_t size);
-
-/* --- misc bits --------------------------------------------------- */
-
-void *xc_dom_pfn_to_ptr(struct xc_dom_image *dom, xen_pfn_t first,
-                        xen_pfn_t count);
-void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
-                                 xen_pfn_t count, xen_pfn_t *count_out);
-void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
-void xc_dom_unmap_all(struct xc_dom_image *dom);
-
-static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
-                                      struct xc_dom_seg *seg,
-                                      xen_pfn_t *pages_out)
-{
-    void *retval;
-
-    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
-
-    *pages_out = retval ? seg->pages : 0;
-    return retval;
-}
-
-static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
-                                      struct xc_dom_seg *seg)
-{
-    xen_pfn_t dummy;
-
-    return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
-}
-
-static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
-                                        xen_vaddr_t vaddr,
-                                        size_t *safe_region_out)
-{
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
-    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
-    xen_pfn_t safe_region_count;
-    void *ptr;
-
-    *safe_region_out = 0;
-    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
-    if ( ptr == NULL )
-        return ptr;
-    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr + offset;
-}
-
-static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
-{
-    if ( xc_dom_translated(dom) )
-        return pfn;
-
-    /* x86 PV only now. */
-    if ( pfn >= dom->total_pages )
-        return INVALID_MFN;
-
-    return dom->pv_p2m[pfn];
-}
-
-#endif /* _XC_DOM_H */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index 3fab94f9c0..d94f846686 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -18,7 +18,6 @@
  */
 
 #include "xc_private.h"
-#include "xenctrl_dom.h"
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index 4643384790..279f06345c 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -22,7 +22,7 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
-#include <xenctrl_dom.h>
+#include <xen/libelf/libelf.h>
 
 #define XC_NUMA_NO_NODE   (~0U)
 
@@ -32,6 +32,430 @@
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
 
+#define X86_HVM_NR_SPECIAL_PAGES    8
+#define X86_HVM_END_SPECIAL_REGION  0xff000u
+#define XG_MAX_MODULES 2
+
+/* --- typedefs and structs ---------------------------------------- */
+
+typedef uint64_t xen_vaddr_t;
+typedef uint64_t xen_paddr_t;
+
+#define PRIpfn PRI_xen_pfn
+
+struct xc_dom_seg {
+    xen_vaddr_t vstart;
+    xen_vaddr_t vend;
+    xen_pfn_t pfn;
+    xen_pfn_t pages;
+};
+
+struct xc_hvm_firmware_module {
+    uint8_t  *data;
+    uint32_t  length;
+    uint64_t  guest_addr_out;
+};
+
+struct xc_dom_mem {
+    struct xc_dom_mem *next;
+    void *ptr;
+    enum {
+        XC_DOM_MEM_TYPE_MALLOC_INTERNAL,
+        XC_DOM_MEM_TYPE_MALLOC_EXTERNAL,
+        XC_DOM_MEM_TYPE_MMAP,
+    } type;
+    size_t len;
+    unsigned char memory[0];
+};
+
+struct xc_dom_phys {
+    struct xc_dom_phys *next;
+    void *ptr;
+    xen_pfn_t first;
+    xen_pfn_t count;
+};
+
+struct xc_dom_module {
+    void *blob;
+    size_t size;
+    void *cmdline;
+    /* If seg.vstart is non zero then the module will be loaded at that
+     * address, otherwise it will automatically placed.
+     *
+     * If automatic placement is used and the module is gzip
+     * compressed then it will be decompressed as it is loaded. If the
+     * module has been explicitly placed then it is loaded as is
+     * otherwise decompressing risks undoing the manual placement.
+     */
+    struct xc_dom_seg seg;
+};
+
+struct xc_dom_image {
+    /* files */
+    void *kernel_blob;
+    size_t kernel_size;
+    unsigned int num_modules;
+    struct xc_dom_module modules[XG_MAX_MODULES];
+    void *devicetree_blob;
+    size_t devicetree_size;
+
+    size_t max_kernel_size;
+    size_t max_module_size;
+    size_t max_devicetree_size;
+
+    /* arguments and parameters */
+    char *cmdline;
+    size_t cmdline_size;
+    uint32_t f_requested[XENFEAT_NR_SUBMAPS];
+
+    /* info from (elf) kernel image */
+    struct elf_dom_parms parms;
+    char *guest_type;
+
+    /* memory layout */
+    struct xc_dom_seg kernel_seg;
+    struct xc_dom_seg p2m_seg;
+    struct xc_dom_seg pgtables_seg;
+    struct xc_dom_seg devicetree_seg;
+    struct xc_dom_seg start_info_seg;
+    xen_pfn_t start_info_pfn;
+    xen_pfn_t console_pfn;
+    xen_pfn_t xenstore_pfn;
+    xen_pfn_t shared_info_pfn;
+    xen_pfn_t bootstack_pfn;
+    xen_pfn_t pfn_alloc_end;
+    xen_vaddr_t virt_alloc_end;
+    xen_vaddr_t bsd_symtab_start;
+
+    /*
+     * initrd parameters as specified in start_info page
+     * Depending on capabilities of the booted kernel this may be a virtual
+     * address or a pfn. Type is neutral and large enough to hold a virtual
+     * address of a 64 bit kernel even with 32 bit toolstack.
+     */
+    uint64_t initrd_start;
+    uint64_t initrd_len;
+
+    unsigned int alloc_bootstack;
+    xen_vaddr_t virt_pgtab_end;
+
+    /* other state info */
+    uint32_t f_active[XENFEAT_NR_SUBMAPS];
+
+    /*
+     * pv_p2m is specific to x86 PV guests, and maps GFNs to MFNs.  It is
+     * eventually copied into guest context.
+     */
+    xen_pfn_t *pv_p2m;
+
+    /* physical memory
+     *
+     * An x86 PV guest has one or more blocks of physical RAM,
+     * consisting of total_pages starting at 0. The start address and
+     * size of each block is controlled by vNUMA structures.
+     *
+     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
+     * rambank_size[i] pages in each. The lowest RAM address
+     * (corresponding to the base of the p2m arrays above) is stored
+     * in rambase_pfn.
+     */
+    xen_pfn_t rambase_pfn;
+    xen_pfn_t total_pages;
+    xen_pfn_t p2m_size;         /* number of pfns covered by p2m */
+    struct xc_dom_phys *phys_pages;
+#if defined (__arm__) || defined(__aarch64__)
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+#endif
+
+    /* malloc memory pool */
+    struct xc_dom_mem *memblocks;
+
+    /* memory footprint stats */
+    size_t alloc_malloc;
+    size_t alloc_mem_map;
+    size_t alloc_file_map;
+    size_t alloc_domU_map;
+
+    /* misc xen domain config stuff */
+    unsigned long flags;
+    unsigned int console_evtchn;
+    unsigned int xenstore_evtchn;
+    uint32_t console_domid;
+    uint32_t xenstore_domid;
+    xen_pfn_t shared_info_mfn;
+
+    xc_interface *xch;
+    uint32_t guest_domid;
+    int claim_enabled; /* 0 by default, 1 enables it */
+
+    int xen_version;
+    xen_capabilities_info_t xen_caps;
+
+    /* kernel loader, arch hooks */
+    struct xc_dom_loader *kernel_loader;
+    void *private_loader;
+
+    /* vNUMA information */
+    xen_vmemrange_t *vmemranges;
+    unsigned int nr_vmemranges;
+    unsigned int *vnode_to_pnode;
+    unsigned int nr_vnodes;
+
+    /* domain type/architecture specific data */
+    void *arch_private;
+
+    /* kernel loader */
+    struct xc_dom_arch *arch_hooks;
+    /* allocate up to pfn_alloc_end */
+    int (*allocate) (struct xc_dom_image * dom);
+
+    /* Container type (HVM or PV). */
+    enum {
+        XC_DOM_PV_CONTAINER,
+        XC_DOM_HVM_CONTAINER,
+    } container_type;
+
+    /* HVM specific fields. */
+    xen_pfn_t target_pages;
+    xen_paddr_t mmio_start;
+    xen_paddr_t mmio_size;
+    xen_paddr_t lowmem_end;
+    xen_paddr_t highmem_end;
+    xen_pfn_t vga_hole_size;
+
+    /* If unset disables the setup of the IOREQ pages. */
+    bool device_model;
+
+    /* BIOS/Firmware passed to HVMLOADER */
+    struct xc_hvm_firmware_module system_firmware_module;
+
+    /* Extra ACPI tables */
+#define MAX_ACPI_MODULES        4
+    struct xc_hvm_firmware_module acpi_modules[MAX_ACPI_MODULES];
+
+    /* Extra SMBIOS structures passed to HVMLOADER */
+    struct xc_hvm_firmware_module smbios_module;
+
+#if defined(__i386__) || defined(__x86_64__)
+    struct e820entry *e820;
+    unsigned int e820_entries;
+#endif
+
+    xen_pfn_t vuart_gfn;
+
+    /* Number of vCPUs */
+    unsigned int max_vcpus;
+};
+
+/* --- pluggable kernel loader ------------------------------------- */
+
+struct xc_dom_loader {
+    char *name;
+    /* Sadly the error returns from these functions are not consistent: */
+    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+    elf_errorstatus (*loader) (struct xc_dom_image * dom);
+
+    struct xc_dom_loader *next;
+};
+
+#define __init __attribute__ ((constructor))
+void xc_dom_register_loader(struct xc_dom_loader *loader);
+
+/* --- arch specific hooks ----------------------------------------- */
+
+struct xc_dom_arch {
+    int (*alloc_magic_pages) (struct xc_dom_image * dom);
+
+    /* pagetable setup - x86 PV only */
+    int (*alloc_pgtables) (struct xc_dom_image * dom);
+    int (*alloc_p2m_list) (struct xc_dom_image * dom);
+    int (*setup_pgtables) (struct xc_dom_image * dom);
+
+    /* arch-specific data structs setup */
+    /* in Mini-OS environment start_info might be a macro, avoid collision. */
+#undef start_info
+    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);
+    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);
+
+    char *guest_type;
+    char *native_protocol;
+    int page_shift;
+    int sizeof_pfn;
+    int p2m_base_supported;
+    int arch_private_size;
+
+    struct xc_dom_arch *next;
+};
+void xc_dom_register_arch_hooks(struct xc_dom_arch *hooks);
+
+#define XC_DOM_PAGE_SHIFT(dom)  ((dom)->arch_hooks->page_shift)
+#define XC_DOM_PAGE_SIZE(dom)   (1LL << (dom)->arch_hooks->page_shift)
+
+/* --- main functions ---------------------------------------------- */
+
+struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
+                                     const char *cmdline, const char *features);
+void xc_dom_release_phys(struct xc_dom_image *dom);
+void xc_dom_release(struct xc_dom_image *dom);
+int xc_dom_rambase_init(struct xc_dom_image *dom, uint64_t rambase);
+int xc_dom_mem_init(struct xc_dom_image *dom, unsigned int mem_mb);
+
+/* Set this larger if you have enormous modules/kernels. Note that
+ * you should trust all kernels not to be maliciously large (e.g. to
+ * exhaust all dom0 memory) if you do this (see CVE-2012-4544 /
+ * XSA-25). You can also set the default independently for
+ * modules/kernels in xc_dom_allocate() or call
+ * xc_dom_{kernel,module}_max_size.
+ */
+#ifndef XC_DOM_DECOMPRESS_MAX
+#define XC_DOM_DECOMPRESS_MAX (1024*1024*1024) /* 1GB */
+#endif
+
+int xc_dom_kernel_check_size(struct xc_dom_image *dom, size_t sz);
+int xc_dom_kernel_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_module_max_size(struct xc_dom_image *dom, size_t sz);
+
+int xc_dom_devicetree_max_size(struct xc_dom_image *dom, size_t sz);
+
+size_t xc_dom_check_gzip(xc_interface *xch,
+                     void *blob, size_t ziplen);
+int xc_dom_do_gunzip(xc_interface *xch,
+                     void *src, size_t srclen, void *dst, size_t dstlen);
+int xc_dom_try_gunzip(struct xc_dom_image *dom, void **blob, size_t * size);
+
+int xc_dom_kernel_file(struct xc_dom_image *dom, const char *filename);
+int xc_dom_module_file(struct xc_dom_image *dom, const char *filename,
+                       const char *cmdline);
+int xc_dom_kernel_mem(struct xc_dom_image *dom, const void *mem,
+                      size_t memsize);
+int xc_dom_module_mem(struct xc_dom_image *dom, const void *mem,
+                       size_t memsize, const char *cmdline);
+int xc_dom_devicetree_file(struct xc_dom_image *dom, const char *filename);
+int xc_dom_devicetree_mem(struct xc_dom_image *dom, const void *mem,
+                          size_t memsize);
+
+int xc_dom_parse_image(struct xc_dom_image *dom);
+int xc_dom_set_arch_hooks(struct xc_dom_image *dom);
+int xc_dom_build_image(struct xc_dom_image *dom);
+
+int xc_dom_boot_xen_init(struct xc_dom_image *dom, xc_interface *xch,
+                         uint32_t domid);
+int xc_dom_boot_mem_init(struct xc_dom_image *dom);
+void *xc_dom_boot_domU_map(struct xc_dom_image *dom, xen_pfn_t pfn,
+                           xen_pfn_t count);
+int xc_dom_boot_image(struct xc_dom_image *dom);
+int xc_dom_compat_check(struct xc_dom_image *dom);
+int xc_dom_gnttab_init(struct xc_dom_image *dom);
+int xc_dom_gnttab_seed(xc_interface *xch, uint32_t guest_domid,
+                       bool is_hvm,
+                       xen_pfn_t console_gfn,
+                       xen_pfn_t xenstore_gfn,
+                       uint32_t console_domid,
+                       uint32_t xenstore_domid);
+bool xc_dom_translated(const struct xc_dom_image *dom);
+
+/* --- debugging bits ---------------------------------------------- */
+
+int xc_dom_loginit(xc_interface *xch);
+
+void xc_dom_printf(xc_interface *xch, const char *fmt, ...)
+     __attribute__ ((format(printf, 2, 3)));
+void xc_dom_panic_func(xc_interface *xch,
+                      const char *file, int line, xc_error_code err,
+                      const char *fmt, ...)
+    __attribute__ ((format(printf, 5, 6)));
+
+#define xc_dom_panic(xch, err, fmt, args...) \
+    xc_dom_panic_func(xch, __FILE__, __LINE__, err, fmt, ## args)
+#define xc_dom_trace(mark) \
+    xc_dom_printf("%s:%d: trace %s\n", __FILE__, __LINE__, mark)
+
+void xc_dom_log_memory_footprint(struct xc_dom_image *dom);
+
+/* --- simple memory pool ------------------------------------------ */
+
+void *xc_dom_malloc(struct xc_dom_image *dom, size_t size);
+int xc_dom_register_external(struct xc_dom_image *dom, void *ptr, size_t size);
+void *xc_dom_malloc_page_aligned(struct xc_dom_image *dom, size_t size);
+void *xc_dom_malloc_filemap(struct xc_dom_image *dom,
+                            const char *filename, size_t * size,
+                            const size_t max_size);
+char *xc_dom_strdup(struct xc_dom_image *dom, const char *str);
+
+/* --- alloc memory pool ------------------------------------------- */
+
+xen_pfn_t xc_dom_alloc_page(struct xc_dom_image *dom, char *name);
+int xc_dom_alloc_segment(struct xc_dom_image *dom,
+                         struct xc_dom_seg *seg, char *name,
+                         xen_vaddr_t start, xen_vaddr_t size);
+
+/* --- misc bits --------------------------------------------------- */
+
+void *xc_dom_pfn_to_ptr(struct xc_dom_image *dom, xen_pfn_t first,
+                        xen_pfn_t count);
+void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
+                                 xen_pfn_t count, xen_pfn_t *count_out);
+void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
+void xc_dom_unmap_all(struct xc_dom_image *dom);
+
+static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
+                                      struct xc_dom_seg *seg,
+                                      xen_pfn_t *pages_out)
+{
+    void *retval;
+
+    retval = xc_dom_pfn_to_ptr(dom, seg->pfn, seg->pages);
+
+    *pages_out = retval ? seg->pages : 0;
+    return retval;
+}
+
+static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
+                                      struct xc_dom_seg *seg)
+{
+    xen_pfn_t dummy;
+
+    return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
+}
+
+static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                                        xen_vaddr_t vaddr,
+                                        size_t *safe_region_out)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
+    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
+    xen_pfn_t safe_region_count;
+    void *ptr;
+
+    *safe_region_out = 0;
+    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
+    if ( ptr == NULL )
+        return ptr;
+    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
+    return ptr + offset;
+}
+
+static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
+{
+    if ( xc_dom_translated(dom) )
+        return pfn;
+
+    /* x86 PV only now. */
+    if ( pfn >= dom->total_pages )
+        return INVALID_MFN;
+
+    return dom->pv_p2m[pfn];
+}
+
 /*
  * User not using xc_suspend_* / xc_await_suspent may not want to
  * include the full libxenevtchn API here.
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 3f66f1d890..615fc109b9 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -24,7 +24,6 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #define NR_MAGIC_PAGES 4
 #define CONSOLE_PFN_OFFSET 0
diff --git a/tools/libs/guest/xg_dom_armzimageloader.c b/tools/libs/guest/xg_dom_armzimageloader.c
index 4246c8e5fa..ec42036ad2 100644
--- a/tools/libs/guest/xg_dom_armzimageloader.c
+++ b/tools/libs/guest/xg_dom_armzimageloader.c
@@ -25,7 +25,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #include <arpa/inet.h> /* XXX ntohl is not the right function... */
 
diff --git a/tools/libs/guest/xg_dom_binloader.c b/tools/libs/guest/xg_dom_binloader.c
index 870a921427..ccc23b388f 100644
--- a/tools/libs/guest/xg_dom_binloader.c
+++ b/tools/libs/guest/xg_dom_binloader.c
@@ -83,7 +83,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE_X86-1))&PAGE_MASK_X86)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK_X86)
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 1e31e92244..827f1ffccd 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -31,7 +31,6 @@
 #include <zlib.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
diff --git a/tools/libs/guest/xg_dom_compat_linux.c b/tools/libs/guest/xg_dom_compat_linux.c
index b645f0b14b..a0d9c7a04e 100644
--- a/tools/libs/guest/xg_dom_compat_linux.c
+++ b/tools/libs/guest/xg_dom_compat_linux.c
@@ -30,7 +30,6 @@
 
 #include "xenctrl.h"
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 
 /* ------------------------------------------------------------------------ */
 
diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index 1c91cce315..c0d4a0aa2f 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -32,7 +32,6 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "_paths.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_dom_decompress.h b/tools/libs/guest/xg_dom_decompress.h
index c5ab2e59eb..d7a45f730d 100644
--- a/tools/libs/guest/xg_dom_decompress.h
+++ b/tools/libs/guest/xg_dom_decompress.h
@@ -1,6 +1,4 @@
-#ifndef __MINIOS__
-# include "xenctrl_dom.h"
-#else
+#ifdef __MINIOS__
 # include "xg_dom_decompress_unsafe.h"
 #endif
 
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
index fb84b6add8..5dc18c896e 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ b/tools/libs/guest/xg_dom_decompress_unsafe.h
@@ -1,5 +1,3 @@
-#include "xenctrl_dom.h"
-
 typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
                           int (*fill)(void*, unsigned int),
                           int (*flush)(void*, unsigned int),
diff --git a/tools/libs/guest/xg_dom_elfloader.c b/tools/libs/guest/xg_dom_elfloader.c
index 7043c3bbba..851930f039 100644
--- a/tools/libs/guest/xg_dom_elfloader.c
+++ b/tools/libs/guest/xg_dom_elfloader.c
@@ -26,7 +26,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #define XEN_VER "xen-3.0"
diff --git a/tools/libs/guest/xg_dom_hvmloader.c b/tools/libs/guest/xg_dom_hvmloader.c
index 995a0f3dc3..f3deedec41 100644
--- a/tools/libs/guest/xg_dom_hvmloader.c
+++ b/tools/libs/guest/xg_dom_hvmloader.c
@@ -26,7 +26,6 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index 842dbcccdd..876802e2ed 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -38,7 +38,6 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xenctrl_dom.h"
 #include "xenctrl.h"
 
 /* ------------------------------------------------------------------------ */
diff --git a/tools/libs/guest/xg_offline_page.c b/tools/libs/guest/xg_offline_page.c
index 77e8889b11..d4722f0e8c 100644
--- a/tools/libs/guest/xg_offline_page.c
+++ b/tools/libs/guest/xg_offline_page.c
@@ -28,7 +28,6 @@
 #include <xc_core.h>
 
 #include "xc_private.h"
-#include "xenctrl_dom.h"
 #include "xg_private.h"
 #include "xg_save_restore.h"
 
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 13fcc47420..cc3ad1c394 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -5,7 +5,6 @@
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
-#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #include "xg_sr_stream_format.h"
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 975a4d730a..66e8a065fe 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -3,7 +3,6 @@
 #include "libxl_libfdt_compat.h"
 #include "libxl_arm.h"
 
-#include <xenctrl_dom.h>
 #include <stdbool.h>
 #include <libfdt.h>
 #include <assert.h>
diff --git a/tools/libs/light/libxl_arm.h b/tools/libs/light/libxl_arm.h
index 52c2ab5e3a..4feca217ee 100644
--- a/tools/libs/light/libxl_arm.h
+++ b/tools/libs/light/libxl_arm.h
@@ -17,8 +17,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
-
 _hidden
 int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
                         struct xc_dom_image *dom);
diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 1031b75159..9a6e92b3a5 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -20,7 +20,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/e820.h>
diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index fec4e0fbe5..a944181781 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -19,7 +19,6 @@
 
 #include "libxl_internal.h"
 
-#include <xenctrl_dom.h>
 #include <xen/hvm/e820.h>
 #include <sys/types.h>
 #include <pwd.h>
diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index 597a6826d1..01d989a976 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -20,7 +20,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 1fcf85c3e2..e26cda9b50 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -57,7 +57,6 @@
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xenhypfs.h>
-#include <xenctrl_dom.h>
 
 #include <xen-tools/libs.h>
 
diff --git a/tools/libs/light/libxl_vnuma.c b/tools/libs/light/libxl_vnuma.c
index c2e144ceae..d181574782 100644
--- a/tools/libs/light/libxl_vnuma.c
+++ b/tools/libs/light/libxl_vnuma.c
@@ -17,8 +17,6 @@
 #include "libxl_arch.h"
 #include <stdlib.h>
 
-#include <xenctrl_dom.h>
-
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
 {
     return b_info->num_vnuma_nodes != 0;
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 7d95506e00..6ec6c27c83 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -1,8 +1,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xenctrl_dom.h>
-
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
                                       struct xen_domctl_createdomain *config)
diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi.c
index 3df86c7be5..1a4e9e98de 100644
--- a/tools/libs/light/libxl_x86_acpi.c
+++ b/tools/libs/light/libxl_x86_acpi.c
@@ -18,8 +18,6 @@
 #include <xen/hvm/e820.h>
 #include "libacpi/libacpi.h"
 
-#include <xenctrl_dom.h>
-
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
 
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index ce123f0409..13a7603809 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -7,6 +7,7 @@
 #include <Python.h>
 #define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
+#include <xenguest.h>
 #include <fcntl.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -17,7 +18,6 @@
 #include <arpa/inet.h>
 
 #include <xen/elfnote.h>
-#include "xenctrl_dom.h"
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/params.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3216.9331 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkR7-0002fu-PE; Tue, 06 Oct 2020 10:43:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3216.9331; Tue, 06 Oct 2020 10:43:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkR7-0002fm-MH; Tue, 06 Oct 2020 10:43:13 +0000
Received: by outflank-mailman (input) for mailman id 3216;
 Tue, 06 Oct 2020 10:43:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkR5-0002fX-RH
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5d3cd93d-ec06-44b3-9761-505b301c82bb;
 Tue, 06 Oct 2020 10:43:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkR4-0001a0-Tx
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkR4-0008Df-SI
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkR5-0002fX-RH
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:11 +0000
X-Inumbo-ID: 5d3cd93d-ec06-44b3-9761-505b301c82bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5d3cd93d-ec06-44b3-9761-505b301c82bb;
	Tue, 06 Oct 2020 10:43:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uoaCUplBJvvf3bNeLAwP5v+4eyybDQrWJJlugS7rr8A=; b=wc5M3Up1d5Q2i4FvVRHUPwZaK6
	Bx4onPwF2VdlRwHsTvK3Dbm+HrI3S2vJAUg+/LzJHjcWNY8Z1EM8bBMQMAdoEE1F7M6A5LKYceDZN
	AY7ybdCKKaMUf/thWc7Ght1MduNXN1KYgai8BhaJQuFkS36KBpiW1gaxD7E9n4aCj6sI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkR4-0001a0-Tx
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkR4-0008Df-SI
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxenguest: make xc_dom_loader interface private to libxenguest
Message-Id: <E1kPkR4-0008Df-SI@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:10 +0000

commit 7f186b1996dea2992c8ed3606b38d73222293c37
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:46 2020 +0200

    tools/libxenguest: make xc_dom_loader interface private to libxenguest
    
    The pluggable kernel loader interface is used only internally of
    libxenguest, so make it private. This removes a dependency on the Xen
    internal header xen/libelf/libelf.h from xenguest.h.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/guest/include/xenguest.h | 15 ---------------
 tools/libs/guest/xg_private.h       | 13 +++++++++++++
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index 279f06345c..dba6a21643 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -247,21 +247,6 @@ struct xc_dom_image {
     unsigned int max_vcpus;
 };
 
-/* --- pluggable kernel loader ------------------------------------- */
-
-struct xc_dom_loader {
-    char *name;
-    /* Sadly the error returns from these functions are not consistent: */
-    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
-    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
-    elf_errorstatus (*loader) (struct xc_dom_image * dom);
-
-    struct xc_dom_loader *next;
-};
-
-#define __init __attribute__ ((constructor))
-void xc_dom_register_loader(struct xc_dom_loader *loader);
-
 /* --- arch specific hooks ----------------------------------------- */
 
 struct xc_dom_arch {
diff --git a/tools/libs/guest/xg_private.h b/tools/libs/guest/xg_private.h
index 0000b2b9b6..9940d554ef 100644
--- a/tools/libs/guest/xg_private.h
+++ b/tools/libs/guest/xg_private.h
@@ -41,6 +41,19 @@
 #endif
 #endif
 
+struct xc_dom_loader {
+    char *name;
+    /* Sadly the error returns from these functions are not consistent: */
+    elf_negerrnoval (*probe) (struct xc_dom_image * dom);
+    elf_negerrnoval (*parser) (struct xc_dom_image * dom);
+    elf_errorstatus (*loader) (struct xc_dom_image * dom);
+
+    struct xc_dom_loader *next;
+};
+
+#define __init __attribute__ ((constructor))
+void xc_dom_register_loader(struct xc_dom_loader *loader);
+
 char *xc_read_image(xc_interface *xch,
                     const char *filename, unsigned long *size);
 char *xc_inflate_buffer(xc_interface *xch,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3217.9334 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRH-0002hC-Qx; Tue, 06 Oct 2020 10:43:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3217.9334; Tue, 06 Oct 2020 10:43:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRH-0002h4-Nv; Tue, 06 Oct 2020 10:43:23 +0000
Received: by outflank-mailman (input) for mailman id 3217;
 Tue, 06 Oct 2020 10:43:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkRG-0002gx-Px
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b5c5765a-974c-4706-8275-9432b7b27f41;
 Tue, 06 Oct 2020 10:43:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRF-0001a7-11
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRF-0008Ed-0M
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkRG-0002gx-Px
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:22 +0000
X-Inumbo-ID: b5c5765a-974c-4706-8275-9432b7b27f41
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b5c5765a-974c-4706-8275-9432b7b27f41;
	Tue, 06 Oct 2020 10:43:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mNZGyCyonYWpMZbJCuQ7bGIimMaGX/x3aixiniDYruw=; b=oxzov+ASmks7DstCe9pEXp5dFC
	9m2LCxushkkcMdhIzffG+W2T9yYrUFO5BMF9yYz8uRE16K0kR5xjuYa9NMgdGW4XB8D7M7cf80cuV
	maccyG+GJQgWx/1P6ddXNa8tYG3dcdYgwPNfZA2k+fvprdhOQQKwwNmvGvV52U1ea6A0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRF-0001a7-11
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRF-0008Ed-0M
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/lixenguest: hide struct elf_dom_parms layout from users
Message-Id: <E1kPkRF-0008Ed-0M@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:21 +0000

commit bdb380e1dbdc6b76576ab6db0b8e946cc95edc1c
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu Oct 1 12:57:43 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Thu Oct 1 13:58:48 2020 +0200

    tools/lixenguest: hide struct elf_dom_parms layout from users
    
    Don't include struct elf_dom_parms in struct xc_dom_image, but rather
    use a pointer to reference it. Together with adding accessor functions
    for the externally needed elements this enables to drop including the
    Xen private header xen/libelf/libelf.h from xenguest.h.
    
    Fixes: 7e0165c19387 ("tools/libxc: untangle libxenctrl from libxenguest")
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 stubdom/grub/kexec.c                      | 18 ++++---
 tools/libs/guest/include/xenguest.h       | 29 +++--------
 tools/libs/guest/xg_dom_arm.c             |  4 +-
 tools/libs/guest/xg_dom_armzimageloader.c |  8 +--
 tools/libs/guest/xg_dom_binloader.c       |  6 +--
 tools/libs/guest/xg_dom_boot.c            |  6 +--
 tools/libs/guest/xg_dom_core.c            | 85 ++++++++++++++++++++++++-------
 tools/libs/guest/xg_dom_elfloader.c       | 14 ++---
 tools/libs/guest/xg_dom_hvmloader.c       |  4 +-
 tools/libs/guest/xg_dom_x86.c             | 34 ++++++-------
 tools/libs/guest/xg_private.h             |  1 +
 tools/libs/light/libxl_x86_acpi.c         |  5 +-
 12 files changed, 126 insertions(+), 88 deletions(-)

diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index e9a69d2a32..3da80b5b4a 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -222,6 +222,7 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     char features[] = "";
     struct mmu_update *m2p_updates;
     unsigned long nr_m2p_updates;
+    uint64_t virt_base;
 
     DEBUG("booting with cmdline %s\n", cmdline);
     xc_handle = xc_interface_open(0,0,0);
@@ -294,10 +295,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
         goto out;
     }
 
+    virt_base = xc_dom_virt_base(dom);
     /* copy hypercall page */
     /* TODO: domctl instead, but requires privileges */
-    if (dom->parms.virt_hypercall != -1) {
-        pfn = PHYS_PFN(dom->parms.virt_hypercall - dom->parms.virt_base);
+    if (xc_dom_virt_hypercall(dom) != -1) {
+        pfn = PHYS_PFN(xc_dom_virt_hypercall(dom) - virt_base);
         memcpy((void *) pages[pfn], hypercall_page, PAGE_SIZE);
     }
 
@@ -313,11 +315,11 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     /* Move current console, xenstore and boot MFNs to the allocated place */
     do_exchange(dom, dom->console_pfn, start_info.console.domU.mfn);
     do_exchange(dom, dom->xenstore_pfn, start_info.store_mfn);
-    DEBUG("virt base at %llx\n", dom->parms.virt_base);
+    DEBUG("virt base at %llx\n", virt_base);
     DEBUG("bootstack_pfn %lx\n", dom->bootstack_pfn);
-    _boot_target = dom->parms.virt_base + PFN_PHYS(dom->bootstack_pfn);
+    _boot_target = virt_base + PFN_PHYS(dom->bootstack_pfn);
     DEBUG("_boot_target %lx\n", _boot_target);
-    do_exchange(dom, PHYS_PFN(_boot_target - dom->parms.virt_base),
+    do_exchange(dom, PHYS_PFN(_boot_target - virt_base),
             virt_to_mfn(&_boot_page));
 
     if ( dom->arch_hooks->setup_pgtables )
@@ -373,13 +375,13 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     _boot_oldpdmfn = virt_to_mfn(start_info.pt_base);
     DEBUG("boot old pd mfn %lx\n", _boot_oldpdmfn);
     DEBUG("boot pd virt %lx\n", dom->pgtables_seg.vstart);
-    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - dom->parms.virt_base)];
+    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - virt_base)];
     DEBUG("boot pd mfn %lx\n", _boot_pdmfn);
     _boot_stack = _boot_target + PAGE_SIZE;
     DEBUG("boot stack %lx\n", _boot_stack);
-    _boot_start_info = dom->parms.virt_base + PFN_PHYS(dom->start_info_pfn);
+    _boot_start_info = virt_base + PFN_PHYS(dom->start_info_pfn);
     DEBUG("boot start info %lx\n", _boot_start_info);
-    _boot_start = dom->parms.virt_entry;
+    _boot_start = xc_dom_virt_entry(dom);
     DEBUG("boot start %lx\n", _boot_start);
 
     /* Keep only useful entries */
diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index dba6a21643..a9984dbea5 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -22,8 +22,6 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
-#include <xen/libelf/libelf.h>
-
 #define XC_NUMA_NO_NODE   (~0U)
 
 #define XCFLAGS_LIVE      (1 << 0)
@@ -109,7 +107,7 @@ struct xc_dom_image {
     uint32_t f_requested[XENFEAT_NR_SUBMAPS];
 
     /* info from (elf) kernel image */
-    struct elf_dom_parms parms;
+    struct elf_dom_parms *parms;
     char *guest_type;
 
     /* memory layout */
@@ -390,6 +388,13 @@ void *xc_dom_pfn_to_ptr_retcount(struct xc_dom_image *dom, xen_pfn_t first,
                                  xen_pfn_t count, xen_pfn_t *count_out);
 void xc_dom_unmap_one(struct xc_dom_image *dom, xen_pfn_t pfn);
 void xc_dom_unmap_all(struct xc_dom_image *dom);
+void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                          xen_vaddr_t vaddr, size_t *safe_region_out);
+uint64_t xc_dom_virt_base(struct xc_dom_image *dom);
+uint64_t xc_dom_virt_entry(struct xc_dom_image *dom);
+uint64_t xc_dom_virt_hypercall(struct xc_dom_image *dom);
+char *xc_dom_guest_os(struct xc_dom_image *dom);
+bool xc_dom_feature_get(struct xc_dom_image *dom, unsigned int nr);
 
 static inline void *xc_dom_seg_to_ptr_pages(struct xc_dom_image *dom,
                                       struct xc_dom_seg *seg,
@@ -411,24 +416,6 @@ static inline void *xc_dom_seg_to_ptr(struct xc_dom_image *dom,
     return xc_dom_seg_to_ptr_pages(dom, seg, &dummy);
 }
 
-static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
-                                        xen_vaddr_t vaddr,
-                                        size_t *safe_region_out)
-{
-    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
-    xen_pfn_t page = (vaddr - dom->parms.virt_base) / page_size;
-    unsigned int offset = (vaddr - dom->parms.virt_base) % page_size;
-    xen_pfn_t safe_region_count;
-    void *ptr;
-
-    *safe_region_out = 0;
-    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
-    if ( ptr == NULL )
-        return ptr;
-    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
-    return ptr + offset;
-}
-
 static inline xen_pfn_t xc_dom_p2m(struct xc_dom_image *dom, xen_pfn_t pfn)
 {
     if ( xc_dom_translated(dom) )
diff --git a/tools/libs/guest/xg_dom_arm.c b/tools/libs/guest/xg_dom_arm.c
index 615fc109b9..94948d2b20 100644
--- a/tools/libs/guest/xg_dom_arm.c
+++ b/tools/libs/guest/xg_dom_arm.c
@@ -117,7 +117,7 @@ static int vcpu_arm32(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.pc32 = dom->parms.virt_entry;
+    ctxt->user_regs.pc32 = dom->parms->virt_entry;
 
     /* Linux boot protocol. See linux.Documentation/arm/Booting. */
     ctxt->user_regs.r0_usr = 0; /* SBZ */
@@ -161,7 +161,7 @@ static int vcpu_arm64(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.pc64 = dom->parms.virt_entry;
+    ctxt->user_regs.pc64 = dom->parms->virt_entry;
 
     /* Linux boot protocol. See linux.Documentation/arm64/booting.txt. */
     ctxt->user_regs.x0 = dom->devicetree_blob ?
diff --git a/tools/libs/guest/xg_dom_armzimageloader.c b/tools/libs/guest/xg_dom_armzimageloader.c
index ec42036ad2..6d837cefc4 100644
--- a/tools/libs/guest/xg_dom_armzimageloader.c
+++ b/tools/libs/guest/xg_dom_armzimageloader.c
@@ -111,8 +111,8 @@ static int xc_dom_parse_zimage32_kernel(struct xc_dom_image *dom)
     dom->kernel_seg.vstart = v_start;
     dom->kernel_seg.vend   = v_end;
 
-    dom->parms.virt_entry = entry_addr;
-    dom->parms.virt_base = rambase;
+    dom->parms->virt_entry = entry_addr;
+    dom->parms->virt_base = rambase;
 
     dom->guest_type = "xen-3.0-armv7l";
     DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
@@ -200,8 +200,8 @@ static int xc_dom_parse_zimage64_kernel(struct xc_dom_image *dom)
     dom->kernel_seg.vend   = v_end;
 
     /* Call the kernel at offset 0 */
-    dom->parms.virt_entry = v_start;
-    dom->parms.virt_base = rambase;
+    dom->parms->virt_entry = v_start;
+    dom->parms->virt_base = rambase;
 
     dom->guest_type = "xen-3.0-aarch64";
     DOMPRINTF("%s: %s: 0x%" PRIx64 " -> 0x%" PRIx64 "",
diff --git a/tools/libs/guest/xg_dom_binloader.c b/tools/libs/guest/xg_dom_binloader.c
index ccc23b388f..f5e3ddc5dc 100644
--- a/tools/libs/guest/xg_dom_binloader.c
+++ b/tools/libs/guest/xg_dom_binloader.c
@@ -214,8 +214,8 @@ static int xc_dom_parse_bin_kernel(struct xc_dom_image *dom)
 
     dom->kernel_seg.vstart = image_info->load_addr;
     dom->kernel_seg.vend   = bss_end_addr;
-    dom->parms.virt_base   = start_addr;
-    dom->parms.virt_entry  = image_info->entry_addr;
+    dom->parms->virt_base   = start_addr;
+    dom->parms->virt_entry  = image_info->entry_addr;
 
     pae_flags = image_info->flags & XEN_MULTIBOOT_FLAG_PAE_MASK;
     switch (pae_flags >> XEN_MULTIBOOT_FLAG_PAE_SHIFT) {
@@ -237,7 +237,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  = XEN_PAE_EXTCR3;
+            dom->parms->pae  = XEN_PAE_EXTCR3;
         }
         break;
     }
diff --git a/tools/libs/guest/xg_dom_boot.c b/tools/libs/guest/xg_dom_boot.c
index 827f1ffccd..2a002e7349 100644
--- a/tools/libs/guest/xg_dom_boot.c
+++ b/tools/libs/guest/xg_dom_boot.c
@@ -43,13 +43,13 @@ static int setup_hypercall_page(struct xc_dom_image *dom)
     xen_pfn_t pfn;
     int rc;
 
-    if ( dom->parms.virt_hypercall == -1 )
+    if ( dom->parms->virt_hypercall == -1 )
         return 0;
-    pfn = (dom->parms.virt_hypercall - dom->parms.virt_base)
+    pfn = (dom->parms->virt_hypercall - dom->parms->virt_base)
         >> XC_DOM_PAGE_SHIFT(dom);
 
     DOMPRINTF("%s: vaddr=0x%" PRIx64 " pfn=0x%" PRIpfn "", __FUNCTION__,
-                  dom->parms.virt_hypercall, pfn);
+                  dom->parms->virt_hypercall, pfn);
     domctl.cmd = XEN_DOMCTL_hypercall_init;
     domctl.domain = dom->guest_domid;
     domctl.u.hypercall_init.gmfn = xc_dom_p2m(dom, pfn);
diff --git a/tools/libs/guest/xg_dom_core.c b/tools/libs/guest/xg_dom_core.c
index c0d4a0aa2f..f846d8e1ed 100644
--- a/tools/libs/guest/xg_dom_core.c
+++ b/tools/libs/guest/xg_dom_core.c
@@ -735,6 +735,7 @@ void xc_dom_release(struct xc_dom_image *dom)
         xc_dom_unmap_all(dom);
     xc_dom_free_all(dom);
     free(dom->arch_private);
+    free(dom->parms);
     free(dom);
 }
 
@@ -753,6 +754,12 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     memset(dom, 0, sizeof(*dom));
     dom->xch = xch;
 
+    dom->parms = malloc(sizeof(*dom->parms));
+    if (!dom->parms)
+        goto err;
+    memset(dom->parms, 0, sizeof(*dom->parms));
+    dom->alloc_malloc += sizeof(*dom->parms);
+
     dom->max_kernel_size = XC_DOM_DECOMPRESS_MAX;
     dom->max_module_size = XC_DOM_DECOMPRESS_MAX;
     dom->max_devicetree_size = XC_DOM_DECOMPRESS_MAX;
@@ -762,12 +769,12 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     if ( features )
         elf_xen_parse_features(features, dom->f_requested, NULL);
 
-    dom->parms.virt_base = UNSET_ADDR;
-    dom->parms.virt_entry = UNSET_ADDR;
-    dom->parms.virt_hypercall = UNSET_ADDR;
-    dom->parms.virt_hv_start_low = UNSET_ADDR;
-    dom->parms.elf_paddr_offset = UNSET_ADDR;
-    dom->parms.p2m_base = UNSET_ADDR;
+    dom->parms->virt_base = UNSET_ADDR;
+    dom->parms->virt_entry = UNSET_ADDR;
+    dom->parms->virt_hypercall = UNSET_ADDR;
+    dom->parms->virt_hv_start_low = UNSET_ADDR;
+    dom->parms->elf_paddr_offset = UNSET_ADDR;
+    dom->parms->p2m_base = UNSET_ADDR;
 
     dom->flags = SIF_VIRT_P2M_4TOOLS;
 
@@ -920,8 +927,8 @@ int xc_dom_parse_image(struct xc_dom_image *dom)
     for ( i = 0; i < XENFEAT_NR_SUBMAPS; i++ )
     {
         dom->f_active[i] |= dom->f_requested[i]; /* cmd line */
-        dom->f_active[i] |= dom->parms.f_required[i]; /* kernel   */
-        if ( (dom->f_active[i] & dom->parms.f_supported[i]) !=
+        dom->f_active[i] |= dom->parms->f_required[i]; /* kernel   */
+        if ( (dom->f_active[i] & dom->parms->f_supported[i]) !=
              dom->f_active[i] )
         {
             xc_dom_panic(dom->xch, XC_INVALID_PARAM,
@@ -1142,8 +1149,8 @@ int xc_dom_build_image(struct xc_dom_image *dom)
         goto err;
     }
     page_size = XC_DOM_PAGE_SIZE(dom);
-    if ( dom->parms.virt_base != UNSET_ADDR )
-        dom->virt_alloc_end = dom->parms.virt_base;
+    if ( dom->parms->virt_base != UNSET_ADDR )
+        dom->virt_alloc_end = dom->parms->virt_base;
 
     /* load kernel */
     if ( xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
@@ -1157,7 +1164,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     /* Don't load ramdisk / other modules now if no initial mapping required. */
     for ( mod = 0; mod < dom->num_modules; mod++ )
     {
-        unmapped_initrd = (dom->parms.unmapped_initrd &&
+        unmapped_initrd = (dom->parms->unmapped_initrd &&
                            !dom->modules[mod].seg.vstart);
 
         if ( dom->modules[mod].blob && !unmapped_initrd )
@@ -1199,10 +1206,10 @@ int xc_dom_build_image(struct xc_dom_image *dom)
 
     /* allocate other pages */
     if ( !dom->arch_hooks->p2m_base_supported ||
-         dom->parms.p2m_base >= dom->parms.virt_base ||
-         (dom->parms.p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
-        dom->parms.p2m_base = UNSET_ADDR;
-    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base == UNSET_ADDR &&
+         dom->parms->p2m_base >= dom->parms->virt_base ||
+         (dom->parms->p2m_base & (XC_DOM_PAGE_SIZE(dom) - 1)) )
+        dom->parms->p2m_base = UNSET_ADDR;
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms->p2m_base == UNSET_ADDR &&
          dom->arch_hooks->alloc_p2m_list(dom) != 0 )
         goto err;
     if ( dom->arch_hooks->alloc_magic_pages(dom) != 0 )
@@ -1228,7 +1235,7 @@ int xc_dom_build_image(struct xc_dom_image *dom)
 
     for ( mod = 0; mod < dom->num_modules; mod++ )
     {
-        unmapped_initrd = (dom->parms.unmapped_initrd &&
+        unmapped_initrd = (dom->parms->unmapped_initrd &&
                            !dom->modules[mod].seg.vstart);
 
         /* Load ramdisk / other modules if no initial mapping required. */
@@ -1247,11 +1254,11 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     }
 
     /* Allocate p2m list if outside of initial kernel mapping. */
-    if ( dom->arch_hooks->alloc_p2m_list && dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->arch_hooks->alloc_p2m_list && dom->parms->p2m_base != UNSET_ADDR )
     {
         if ( dom->arch_hooks->alloc_p2m_list(dom) != 0 )
             goto err;
-        dom->p2m_seg.vstart = dom->parms.p2m_base;
+        dom->p2m_seg.vstart = dom->parms->p2m_base;
     }
 
     return 0;
@@ -1260,6 +1267,48 @@ int xc_dom_build_image(struct xc_dom_image *dom)
     return -1;
 }
 
+void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
+                          xen_vaddr_t vaddr, size_t *safe_region_out)
+{
+    unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+    xen_pfn_t page = (vaddr - dom->parms->virt_base) / page_size;
+    unsigned int offset = (vaddr - dom->parms->virt_base) % page_size;
+    xen_pfn_t safe_region_count;
+    void *ptr;
+
+    *safe_region_out = 0;
+    ptr = xc_dom_pfn_to_ptr_retcount(dom, page, 0, &safe_region_count);
+    if ( ptr == NULL )
+        return ptr;
+    *safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
+    return ptr + offset;
+}
+
+uint64_t xc_dom_virt_base(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_base;
+}
+
+uint64_t xc_dom_virt_entry(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_entry;
+}
+
+uint64_t xc_dom_virt_hypercall(struct xc_dom_image *dom)
+{
+    return dom->parms->virt_hypercall;
+}
+
+char *xc_dom_guest_os(struct xc_dom_image *dom)
+{
+    return dom->parms->guest_os;
+}
+
+bool xc_dom_feature_get(struct xc_dom_image *dom, unsigned int nr)
+{
+    return elf_xen_feature_get(nr, dom->parms->f_supported);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/guest/xg_dom_elfloader.c b/tools/libs/guest/xg_dom_elfloader.c
index 851930f039..06e713fe11 100644
--- a/tools/libs/guest/xg_dom_elfloader.c
+++ b/tools/libs/guest/xg_dom_elfloader.c
@@ -56,7 +56,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     uint64_t machine = elf_uval(elf, elf->ehdr, e_machine);
 
     if ( dom->container_type == XC_DOM_HVM_CONTAINER &&
-         dom->parms.phys_entry != UNSET_ADDR32 )
+         dom->parms->phys_entry != UNSET_ADDR32 )
         return "hvm-3.0-x86_32";
     if ( dom->container_type == XC_DOM_HVM_CONTAINER )
     {
@@ -69,7 +69,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom,
     switch ( machine )
     {
     case EM_386:
-        switch ( dom->parms.pae )
+        switch ( dom->parms->pae )
         {
         case XEN_PAE_BIMODAL:
             if ( strstr(dom->xen_caps, "xen-3.0-x86_32p") )
@@ -135,7 +135,7 @@ static elf_negerrnoval xc_dom_probe_elf_kernel(struct xc_dom_image *dom)
      * or else we might be trying to load a plain ELF.
      */
     elf_parse_binary(&elf);
-    rc = elf_xen_parse(&elf, &dom->parms);
+    rc = elf_xen_parse(&elf, dom->parms);
     if ( rc != 0 )
         return rc;
 
@@ -166,13 +166,13 @@ static elf_negerrnoval xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
 
     /* parse binary and get xen meta info */
     elf_parse_binary(elf);
-    if ( elf_xen_parse(elf, &dom->parms) != 0 )
+    if ( elf_xen_parse(elf, dom->parms) != 0 )
     {
         rc = -EINVAL;
         goto out;
     }
 
-    if ( elf_xen_feature_get(XENFEAT_dom0, dom->parms.f_required) )
+    if ( elf_xen_feature_get(XENFEAT_dom0, dom->parms->f_required) )
     {
         xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: Kernel does not"
                      " support unprivileged (DomU) operation", __FUNCTION__);
@@ -181,8 +181,8 @@ static elf_negerrnoval xc_dom_parse_elf_kernel(struct xc_dom_image *dom)
     }
 
     /* find kernel segment */
-    dom->kernel_seg.vstart = dom->parms.virt_kstart;
-    dom->kernel_seg.vend   = dom->parms.virt_kend;
+    dom->kernel_seg.vstart = dom->parms->virt_kstart;
+    dom->kernel_seg.vend   = dom->parms->virt_kend;
 
     dom->guest_type = xc_dom_guest_type(dom, elf);
     if ( dom->guest_type == NULL )
diff --git a/tools/libs/guest/xg_dom_hvmloader.c b/tools/libs/guest/xg_dom_hvmloader.c
index f3deedec41..ec6ebad7fd 100644
--- a/tools/libs/guest/xg_dom_hvmloader.c
+++ b/tools/libs/guest/xg_dom_hvmloader.c
@@ -73,7 +73,7 @@ static elf_negerrnoval xc_dom_probe_hvm_kernel(struct xc_dom_image *dom)
      * else we might be trying to load a PV kernel.
      */
     elf_parse_binary(&elf);
-    rc = elf_xen_parse(&elf, &dom->parms);
+    rc = elf_xen_parse(&elf, dom->parms);
     if ( rc == 0 )
         return -EINVAL;
 
@@ -227,7 +227,7 @@ static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
         goto error;
     }
 
-    dom->parms.phys_entry = elf_uval(elf, elf->ehdr, e_entry);
+    dom->parms->phys_entry = elf_uval(elf, elf->ehdr, e_entry);
 
     free(entries);
     return 0;
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index 876802e2ed..2953aeb90b 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -252,7 +252,7 @@ static int alloc_pgtables_pv(struct xc_dom_image *dom)
         try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
                                 bits_to_mask(22)); /* 4MB alignment */
 
-        if ( count_pgtables(dom, dom->parms.virt_base, try_virt_end, 0) )
+        if ( count_pgtables(dom, dom->parms->virt_base, try_virt_end, 0) )
             return -1;
 
         pages = map->area.pgtables + extra_pages;
@@ -464,7 +464,7 @@ static int setup_pgtables_x86_32_pae(struct xc_dom_image *dom)
 
     l3pfn = domx86->maps[0].lvls[2].pfn;
     l3mfn = xc_dom_p2m(dom, l3pfn);
-    if ( dom->parms.pae == XEN_PAE_YES )
+    if ( dom->parms->pae == XEN_PAE_YES )
     {
         if ( l3mfn >= 0x100000 )
             l3mfn = move_l3_below_4G(dom, l3pfn, l3mfn);
@@ -553,9 +553,9 @@ static int alloc_p2m_list_x86_64(struct xc_dom_image *dom)
     unsigned lvl;
 
     p2m_alloc_size = round_pg_up(p2m_alloc_size);
-    if ( dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->parms->p2m_base != UNSET_ADDR )
     {
-        from = dom->parms.p2m_base;
+        from = dom->parms->p2m_base;
         to = from + p2m_alloc_size - 1;
         if ( count_pgtables(dom, from, to, dom->pfn_alloc_end) )
             return -1;
@@ -739,7 +739,7 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
     dom->xenstore_pfn = special_pfn(SPECIALPAGE_XENSTORE);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
 
-    dom->parms.virt_hypercall = -1;
+    dom->parms->virt_hypercall = -1;
 
     rc = 0;
     goto out;
@@ -822,7 +822,7 @@ static int start_info_x86_64(struct xc_dom_image *dom)
     start_info->pt_base = dom->pgtables_seg.vstart;
     start_info->nr_pt_frames = domx86->maps[0].area.pgtables;
     start_info->mfn_list = dom->p2m_seg.vstart;
-    if ( dom->parms.p2m_base != UNSET_ADDR )
+    if ( dom->parms->p2m_base != UNSET_ADDR )
     {
         start_info->first_p2m_pfn = dom->p2m_seg.pfn;
         start_info->nr_p2m_frames = dom->p2m_seg.pages;
@@ -889,19 +889,19 @@ static int vcpu_x86_32(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.eip = dom->parms.virt_entry;
+    ctxt->user_regs.eip = dom->parms->virt_entry;
     ctxt->user_regs.esp =
-        dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
     ctxt->user_regs.esi =
-        dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
     ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->debugreg[6] = X86_DR6_DEFAULT;
     ctxt->debugreg[7] = X86_DR7_DEFAULT;
 
     ctxt->flags = VGCF_in_kernel_X86_32 | VGCF_online_X86_32;
-    if ( dom->parms.pae == XEN_PAE_EXTCR3 ||
-         dom->parms.pae == XEN_PAE_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(dom, dom->pgtables_seg.pfn);
@@ -939,11 +939,11 @@ static int vcpu_x86_64(struct xc_dom_image *dom)
     /* clear everything */
     memset(ctxt, 0, sizeof(*ctxt));
 
-    ctxt->user_regs.rip = dom->parms.virt_entry;
+    ctxt->user_regs.rip = dom->parms->virt_entry;
     ctxt->user_regs.rsp =
-        dom->parms.virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->bootstack_pfn + 1) * PAGE_SIZE_X86;
     ctxt->user_regs.rsi =
-        dom->parms.virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
+        dom->parms->virt_base + (dom->start_info_pfn) * PAGE_SIZE_X86;
     ctxt->user_regs.rflags = 1 << 9; /* Interrupt Enable */
 
     ctxt->debugreg[6] = X86_DR6_DEFAULT;
@@ -1070,7 +1070,7 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     bsp_ctx.cpu.cr0 = X86_CR0_PE | X86_CR0_ET;
 
     /* Set the IP. */
-    bsp_ctx.cpu.rip = dom->parms.phys_entry;
+    bsp_ctx.cpu.rip = dom->parms->phys_entry;
 
     bsp_ctx.cpu.dr6 = X86_DR6_DEFAULT;
     bsp_ctx.cpu.dr7 = X86_DR7_DEFAULT;
@@ -1806,8 +1806,8 @@ static int bootlate_hvm(struct xc_dom_image *dom)
     for ( i = 0; i < dom->num_modules; i++ )
     {
         struct xc_hvm_firmware_module mod;
-        uint64_t base = dom->parms.virt_base != UNSET_ADDR ?
-            dom->parms.virt_base : 0;
+        uint64_t base = dom->parms->virt_base != UNSET_ADDR ?
+            dom->parms->virt_base : 0;
 
         mod.guest_addr_out =
             dom->modules[i].seg.vstart - base;
diff --git a/tools/libs/guest/xg_private.h b/tools/libs/guest/xg_private.h
index 9940d554ef..fee3191cd4 100644
--- a/tools/libs/guest/xg_private.h
+++ b/tools/libs/guest/xg_private.h
@@ -31,6 +31,7 @@
 
 #include <xen/memory.h>
 #include <xen/elfnote.h>
+#include <xen/libelf/libelf.h>
 
 #ifndef ELFSIZE
 #include <limits.h>
diff --git a/tools/libs/light/libxl_x86_acpi.c b/tools/libs/light/libxl_x86_acpi.c
index 1a4e9e98de..3eca1c7a9f 100644
--- a/tools/libs/light/libxl_x86_acpi.c
+++ b/tools/libs/light/libxl_x86_acpi.c
@@ -220,9 +220,8 @@ int libxl__dom_load_acpi(libxl__gc *gc,
      * and so we need to put RSDP in location that can be discovered by ACPI's
      * standard search method, in R-O BIOS memory (we chose last 64 bytes)
      */
-    if (strcmp(dom->parms.guest_os, "linux") ||
-        elf_xen_feature_get(XENFEAT_linux_rsdp_unrestricted,
-                            dom->parms.f_supported))
+    if (strcmp(xc_dom_guest_os(dom), "linux") ||
+        xc_dom_feature_get(dom, XENFEAT_linux_rsdp_unrestricted))
         dom->acpi_modules[0].guest_addr_out = ACPI_INFO_PHYSICAL_ADDRESS +
             (1 + acpi_pages_num) * libxl_ctxt.page_size;
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3218.9339 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRR-0002io-UY; Tue, 06 Oct 2020 10:43:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3218.9339; Tue, 06 Oct 2020 10:43:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRR-0002id-R9; Tue, 06 Oct 2020 10:43:33 +0000
Received: by outflank-mailman (input) for mailman id 3218;
 Tue, 06 Oct 2020 10:43:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkRQ-0002iQ-Bw
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8d0d3371-224c-4536-978f-12520ffd7f3b;
 Tue, 06 Oct 2020 10:43:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRP-0001aE-4Y
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRP-0008Fd-3k
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkRQ-0002iQ-Bw
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:32 +0000
X-Inumbo-ID: 8d0d3371-224c-4536-978f-12520ffd7f3b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8d0d3371-224c-4536-978f-12520ffd7f3b;
	Tue, 06 Oct 2020 10:43:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QyTlxgEPC1HLGfsGgNKGs/LxkvqD8KT1a/epU97Wf/w=; b=zz7VjwKFy4JfgXWkgCclghy1E5
	KfP7+RlNz8J5zZunHRX4a9/TVPrYhnpQW6OFsjcwQFM/F6I6VsDlTqV2dElHNopiG1Luf4WBSAFLJ
	mBYgcqgIyZd11Uw7j9DzVqYC9wLiONvTZ9bNSL3vY+PIxGa6X9eRUe5HAJpcsAObBnEo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRP-0001aE-4Y
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRP-0008Fd-3k
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shim: fix build with PV_SHIM_EXCLUSIVE and SHADOW_PAGING
Message-Id: <E1kPkRP-0008Fd-3k@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:31 +0000

commit 23d4e0d17b764a404e1e43db04c56a714932b666
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:34:28 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:34:28 2020 +0200

    x86/shim: fix build with PV_SHIM_EXCLUSIVE and SHADOW_PAGING
    
    While there's little point in enabling both, the combination ought to at
    least build correctly. Drop the direct PV_SHIM_EXCLUSIVE conditionals
    and instead zap PG_log_dirty to zero under the right conditions, and key
    other #ifdef-s off of that.
    
    While there also expand on ded576ce07e9 ("x86/shadow: dirty VRAM
    tracking is needed for HVM only"): There was yet another is_hvm_domain()
    missing, and code touching the struct fields needs to be guarded by
    suitable #ifdef-s as well. While there also guard shadow-mode-only
    fields accordingly.
    
    Fixes: 8b5b49ceb3d9 ("x86: don't include domctl and alike in shim-exclusive builds")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/paging.c        | 10 +++++-----
 xen/arch/x86/mm/shadow/common.c |  4 +++-
 xen/arch/x86/mm/shadow/multi.c  |  6 ++++++
 xen/include/asm-x86/paging.h    | 15 ++++++++++++---
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 695372783d..8beac0e189 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -47,7 +47,7 @@
 /* Per-CPU variable for enforcing the lock ordering */
 DEFINE_PER_CPU(int, mm_lock_level);
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 
 /************************************************/
 /*              LOG DIRTY SUPPORT               */
@@ -630,7 +630,7 @@ void paging_log_dirty_init(struct domain *d, const struct log_dirty_ops *ops)
     d->arch.paging.log_dirty.ops = ops;
 }
 
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /************************************************/
 /*           CODE FOR PAGING SUPPORT            */
@@ -671,7 +671,7 @@ void paging_vcpu_init(struct vcpu *v)
         shadow_vcpu_init(v);
 }
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 int paging_domctl(struct domain *d, struct xen_domctl_shadow_op *sc,
                   XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl,
                   bool_t resuming)
@@ -792,7 +792,7 @@ long paging_domctl_continuation(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     return ret;
 }
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /* Call when destroying a domain */
 int paging_teardown(struct domain *d)
@@ -808,7 +808,7 @@ int paging_teardown(struct domain *d)
     if ( preempted )
         return -ERESTART;
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
     /* clean up log dirty resources. */
     rc = paging_free_log_dirty_bitmap(d, 0);
     if ( rc == -ERESTART )
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 7c7204fd34..6182313a0e 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2869,12 +2869,14 @@ void shadow_teardown(struct domain *d, bool *preempted)
      * calls now that we've torn down the bitmap */
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    if ( d->arch.hvm.dirty_vram )
+#ifdef CONFIG_HVM
+    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram )
     {
         xfree(d->arch.hvm.dirty_vram->sl1ma);
         xfree(d->arch.hvm.dirty_vram->dirty_bitmap);
         XFREE(d->arch.hvm.dirty_vram);
     }
+#endif
 
 out:
     paging_unlock(d);
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b205be6cdc..225082fc2f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -618,6 +618,7 @@ _sh_propagate(struct vcpu *v,
         }
     }
 
+#ifdef CONFIG_HVM
     if ( unlikely(level == 1) && is_hvm_domain(d) )
     {
         struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
@@ -632,6 +633,7 @@ _sh_propagate(struct vcpu *v,
                 sflags &= ~_PAGE_RW;
         }
     }
+#endif
 
     /* Read-only memory */
     if ( p2m_is_readonly(p2mt) )
@@ -1050,6 +1052,7 @@ static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 {
+#ifdef CONFIG_HVM
     mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
     int flags = shadow_l1e_get_flags(new_sl1e);
     unsigned long gfn;
@@ -1074,6 +1077,7 @@ static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
             dirty_vram->sl1ma[i] = mfn_to_maddr(sl1mfn)
                 | ((unsigned long)sl1e & ~PAGE_MASK);
     }
+#endif
 }
 
 static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
@@ -1081,6 +1085,7 @@ static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
                                        mfn_t sl1mfn,
                                        struct domain *d)
 {
+#ifdef CONFIG_HVM
     mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
     int flags = shadow_l1e_get_flags(old_sl1e);
     unsigned long gfn;
@@ -1140,6 +1145,7 @@ static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
             dirty_vram->last_dirty = NOW();
         }
     }
+#endif
 }
 
 static int shadow_set_l1e(struct domain *d,
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index b803efa7b5..87ce135b8c 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -67,8 +67,12 @@
 #define PG_translate   0
 #define PG_external    0
 #endif
+#if defined(CONFIG_HVM) || !defined(CONFIG_PV_SHIM_EXCLUSIVE)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
+#else
+#define PG_log_dirty   0
+#endif
 
 /* All paging modes. */
 #define PG_MASK (PG_refcounts | PG_log_dirty | PG_translate | PG_external)
@@ -154,7 +158,7 @@ struct paging_mode {
 /*****************************************************************************
  * Log dirty code */
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if PG_log_dirty
 
 /* get the dirty bitmap for a specific range of pfns */
 void paging_log_dirty_range(struct domain *d,
@@ -195,23 +199,28 @@ int paging_mfn_is_dirty(struct domain *d, mfn_t gmfn);
 #define L4_LOGDIRTY_IDX(pfn) ((pfn_x(pfn) >> (PAGE_SHIFT + 3 + PAGETABLE_ORDER * 2)) & \
                               (LOGDIRTY_NODE_ENTRIES-1))
 
+#ifdef CONFIG_HVM
 /* VRAM dirty tracking support */
 struct sh_dirty_vram {
     unsigned long begin_pfn;
     unsigned long end_pfn;
+#ifdef CONFIG_SHADOW_PAGING
     paddr_t *sl1ma;
     uint8_t *dirty_bitmap;
     s_time_t last_dirty;
+#endif
 };
+#endif
 
-#else /* !CONFIG_PV_SHIM_EXCLUSIVE */
+#else /* !PG_log_dirty */
 
 static inline void paging_log_dirty_init(struct domain *d,
                                          const struct log_dirty_ops *ops) {}
 static inline void paging_mark_dirty(struct domain *d, mfn_t gmfn) {}
 static inline void paging_mark_pfn_dirty(struct domain *d, pfn_t pfn) {}
+static inline bool paging_mfn_is_dirty(struct domain *d, mfn_t gmfn) { return false; }
 
-#endif /* CONFIG_PV_SHIM_EXCLUSIVE */
+#endif /* PG_log_dirty */
 
 /*****************************************************************************
  * Entry points into the paging-assistance code */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3219.9343 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRb-0002kK-W1; Tue, 06 Oct 2020 10:43:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3219.9343; Tue, 06 Oct 2020 10:43:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRb-0002kC-Sh; Tue, 06 Oct 2020 10:43:43 +0000
Received: by outflank-mailman (input) for mailman id 3219;
 Tue, 06 Oct 2020 10:43:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkRZ-0002jy-VZ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 024d8873-d97d-4a49-9325-d133156e7e96;
 Tue, 06 Oct 2020 10:43:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRZ-0001b5-7R
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRZ-0008Gs-6l
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkRZ-0002jy-VZ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
X-Inumbo-ID: 024d8873-d97d-4a49-9325-d133156e7e96
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 024d8873-d97d-4a49-9325-d133156e7e96;
	Tue, 06 Oct 2020 10:43:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ydajFPaTUxYmnrYs0I2u6dxxhTMlPa9nk0rH5sNpp9g=; b=VB/uJf61utOOnZ1NQEMVBkuk0D
	tTjpRANKF97JJ6/6okeClFdJmF5oovqyDnIbdUgZtCK+JlrcE5UA3y6hFk5Q6uP6VNcGckpNCd3yt
	VSsucMkS9jMUXqfP4bXYdUUniPMeGagly69gMNXZg23fLTlE/Tyjr4RpTlBNN1ZvQJeA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRZ-0001b5-7R
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRZ-0008Gs-6l
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shim: adjust Kconfig defaults
Message-Id: <E1kPkRZ-0008Gs-6l@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:41 +0000

commit 22b08b35db4aca2d2f6b31ba940cc65402b5586d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:35:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:35:31 2020 +0200

    x86/shim: adjust Kconfig defaults
    
    Just like HVM, defaulting SHADOW_PAGING and TBOOT to Yes in shim-
    exclusive mode makes no sense, as the respective code is dead there.
    
    Also adjust the shim default config file: It needs to specifiy values
    only for settings where a non-default value is wanted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Kconfig                  | 10 +++++-----
 xen/arch/x86/configs/pvshim_defconfig |  3 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index a636a4bb1e..24868aa6ad 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -116,9 +116,9 @@ config XEN_SHSTK
 	  compatiblity can be provided via the PV Shim mechanism.
 
 config SHADOW_PAGING
-        bool "Shadow Paging"
-        default y
-        ---help---
+	bool "Shadow Paging"
+	default !PV_SHIM_EXCLUSIVE
+	---help---
 
           Shadow paging is a software alternative to hardware paging support
           (Intel EPT, AMD NPT).
@@ -165,8 +165,8 @@ config HVM_FEP
 	  If unsure, say N.
 
 config TBOOT
-	def_bool y
-	prompt "Xen tboot support" if EXPERT
+	bool "Xen tboot support" if EXPERT
+	default y if !PV_SHIM_EXCLUSIVE
 	select CRYPTO
 	---help---
 	  Allows support for Trusted Boot using the Intel(R) Trusted Execution
diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig
index 3af48d6c06..5478b991ac 100644
--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -8,12 +8,9 @@ CONFIG_NR_CPUS=32
 CONFIG_EXPERT=y
 CONFIG_SCHED_NULL=y
 # Disable features not used by the PV shim
-# CONFIG_HVM is not set
 # CONFIG_XEN_SHSTK is not set
 # CONFIG_HYPFS is not set
-# CONFIG_SHADOW_PAGING is not set
 # CONFIG_BIGMEM is not set
-# CONFIG_TBOOT is not set
 # CONFIG_KEXEC is not set
 # CONFIG_XENOPROF is not set
 # CONFIG_XSM is not set
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:43:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:43:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3220.9347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRm-0002la-11; Tue, 06 Oct 2020 10:43:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3220.9347; Tue, 06 Oct 2020 10:43:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRl-0002lS-UM; Tue, 06 Oct 2020 10:43:53 +0000
Received: by outflank-mailman (input) for mailman id 3220;
 Tue, 06 Oct 2020 10:43:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkRk-0002lL-Fi
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e11480cb-c3d4-4bee-b1a4-5a5559f032ea;
 Tue, 06 Oct 2020 10:43:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRj-0001bE-BB
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRj-0008ID-A5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkRk-0002lL-Fi
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:52 +0000
X-Inumbo-ID: e11480cb-c3d4-4bee-b1a4-5a5559f032ea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e11480cb-c3d4-4bee-b1a4-5a5559f032ea;
	Tue, 06 Oct 2020 10:43:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QgwIwXTZEXX82dRw1YEnA15nr62Dk/rajirzWgGYHPI=; b=4TuW8bMiALp2YXj7s4LrPRowzL
	KKqGFSRtyrJJ7172N0MC6OhPOj7S9gJemL3dKCIKdIJxIXkaZXZ9QOOuGJwFS4Zu8SgSx/0N/dT38
	DYPDtovw3K7Gvp+/zB1fRKSTTb6Ky+zJCNo0Rko48BDYdMnmqfzG5Uqbg5h35pczLvck=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRj-0001bE-BB
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRj-0008ID-A5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:43:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kPkRj-0008ID-A5@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:43:51 +0000

commit 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:36:21 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:36:21 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 2412e63204..bd7894832f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -724,6 +724,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index a80bcf3e42..b21c3783d3 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 87ea38b7a0..2dfa1f4295 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index fab5d30c3a..b3addbf701 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -281,6 +281,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index c14bd07a2b..722919b762 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -91,6 +91,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3221.9350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRw-0002oo-2i; Tue, 06 Oct 2020 10:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3221.9350; Tue, 06 Oct 2020 10:44:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkRv-0002og-Vy; Tue, 06 Oct 2020 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 3221;
 Tue, 06 Oct 2020 10:44:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkRu-0002oT-IL
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f89a0176-5654-4a21-a72e-14c8724ed439;
 Tue, 06 Oct 2020 10:44:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRt-0001bY-FC
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkRt-0008JO-DX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkRu-0002oT-IL
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:02 +0000
X-Inumbo-ID: f89a0176-5654-4a21-a72e-14c8724ed439
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f89a0176-5654-4a21-a72e-14c8724ed439;
	Tue, 06 Oct 2020 10:44:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nojBw0oe8g2ZKcgLn7/Pquv1kec8U9Xi3H5NQrHOu+4=; b=6oUIOkhz7DZuAnWwxF19w5nrKR
	nmvEN2bQTbP2kQWCt8IhzGSbNm3jxZXD8g5FOA7F2vKOteTGN5+Nz0CKxY7DJs3bREV7Ef3f4WyK0
	KYDlHSnEfOBV7mIBUCcwY5eQ0KTlvlwe4yJdJ6rqw2PBohzjLtT2GtrXQRRiCSOJxAHE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRt-0001bY-FC
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkRt-0008JO-DX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: cut short evtchn_reset()'s loop in the common case
Message-Id: <E1kPkRt-0008JO-DX@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:01 +0000

commit bb3d31e03771353ed546b0290fb3f4d8f34d962c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:37:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:37:04 2020 +0200

    evtchn: cut short evtchn_reset()'s loop in the common case
    
    The general expectation is that there are only a few open ports left
    when a domain asks its event channel configuration to be reset.
    Similarly on average half a bucket worth of event channels can be
    expected to be inactive. Try to avoid iterating over all channels, by
    utilizing usage data we're maintaining anyway.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index bd7894832f..e365b5498f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -231,7 +231,11 @@ void evtchn_free(struct domain *d, struct evtchn *chn)
     evtchn_port_clear_pending(d, chn);
 
     if ( consumer_is_xen(chn) )
+    {
         write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+        /* Decrement ->xen_evtchns /before/ ->active_evtchns. */
+        smp_wmb();
+    }
     write_atomic(&d->active_evtchns, d->active_evtchns - 1);
 
     /* Reset binding to vcpu0 when the channel is freed. */
@@ -1069,6 +1073,19 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
+static bool has_active_evtchns(const struct domain *d)
+{
+    unsigned int xen = read_atomic(&d->xen_evtchns);
+
+    /*
+     * Read ->xen_evtchns /before/ active_evtchns, to prevent
+     * evtchn_reset() exiting its loop early.
+     */
+    smp_rmb();
+
+    return read_atomic(&d->active_evtchns) > xen;
+}
+
 int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
@@ -1093,7 +1110,7 @@ int evtchn_reset(struct domain *d, bool resuming)
     if ( !i )
         return -EBUSY;
 
-    for ( ; port_is_valid(d, i); i++ )
+    for ( ; port_is_valid(d, i) && has_active_evtchns(d); i++ )
     {
         evtchn_close(d, i, 1);
 
@@ -1332,6 +1349,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock_irqrestore(&chn->lock, flags);
 
+    /*
+     * Increment ->xen_evtchns /after/ ->active_evtchns. No explicit
+     * barrier needed due to spin-locked region just above.
+     */
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
  out:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3222.9357 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkS6-0002qG-60; Tue, 06 Oct 2020 10:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3222.9357; Tue, 06 Oct 2020 10:44:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkS6-0002q6-1Q; Tue, 06 Oct 2020 10:44:14 +0000
Received: by outflank-mailman (input) for mailman id 3222;
 Tue, 06 Oct 2020 10:44:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkS4-0002pu-FU
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ecc23008-b1d6-431b-8dd9-24430308ca4f;
 Tue, 06 Oct 2020 10:44:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkS3-0001bm-I7
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkS3-0008L1-HU
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkS4-0002pu-FU
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:12 +0000
X-Inumbo-ID: ecc23008-b1d6-431b-8dd9-24430308ca4f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ecc23008-b1d6-431b-8dd9-24430308ca4f;
	Tue, 06 Oct 2020 10:44:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uRRJKgeq/nu6osRpnADa0Xe7s7fTeO9dMMIcIp8Ig6w=; b=v5YH9QqcB5+hiCeWGJbohQj4i6
	q3JkJr6jxWoGAuPhnu7c06F142GrH/XUJnJmoWIMA5bSVVIYE7E4A1IIZh1jCATyTM5NLTaIMn9bn
	pVJKSNYZUtTLQD6J18GOw5ZneyAKjcH5cJ+e0TgS0uI+U51+tDBbozMLR5MqRl3kfDo4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkS3-0001bm-I7
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkS3-0008L1-HU
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kPkS3-0008L1-HU@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:11 +0000

commit 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:37:35 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:37:35 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3223.9359 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSG-0002rp-8M; Tue, 06 Oct 2020 10:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3223.9359; Tue, 06 Oct 2020 10:44:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSG-0002rh-5L; Tue, 06 Oct 2020 10:44:24 +0000
Received: by outflank-mailman (input) for mailman id 3223;
 Tue, 06 Oct 2020 10:44:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkSE-0002rW-V6
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 83b5d56c-b06d-41b0-82e8-71df140ec3fe;
 Tue, 06 Oct 2020 10:44:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSD-0001c4-MA
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSD-0008M8-KS
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkSE-0002rW-V6
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:22 +0000
X-Inumbo-ID: 83b5d56c-b06d-41b0-82e8-71df140ec3fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 83b5d56c-b06d-41b0-82e8-71df140ec3fe;
	Tue, 06 Oct 2020 10:44:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TYq9VLBpzqjQDhRQkBEIqOteD/TECl7z/q5E7RRC+eg=; b=DOMjVNDvSpqvMclvYQAfTBdOJF
	jaGlYP11tVVGldRtoYJX00DRXFxBVK3cqfuOEJqN0xnqZWXNmqGjjHnUChK/HsVAWCYyBs2XDfG1i
	6cGgSDBg0Gp2nCJ82cWQH6rVW5LgPFTexKT0gpKZG9hm75V0SDKzRBLUwBHextjKu024=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSD-0001c4-MA
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSD-0008M8-KS
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: move FIFO-private struct declarations
Message-Id: <E1kPkSD-0008M8-KS@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:21 +0000

commit 661b3e4c5f6118cf328bfedcc56153b7cb691c34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 08:38:05 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:38:05 2020 +0200

    evtchn: move FIFO-private struct declarations
    
    There's no need to expose them.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_fifo.c      | 21 +++++++++++++++++++++
 xen/include/xen/event_fifo.h | 21 ---------------------
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 27ab3a1c3f..fc189152e1 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -21,6 +21,27 @@
 
 #include <public/event_channel.h>
 
+struct evtchn_fifo_queue {
+    uint32_t *head; /* points into control block */
+    uint32_t tail;
+    uint8_t priority;
+    spinlock_t lock;
+};
+
+struct evtchn_fifo_vcpu {
+    struct evtchn_fifo_control_block *control_block;
+    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
+};
+
+#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
+#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
+    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
+
+struct evtchn_fifo_domain {
+    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
+    unsigned int num_evtchns;
+};
+
 static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
                                                        unsigned int port)
 {
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
index 4115f6f527..0fec3d5316 100644
--- a/xen/include/xen/event_fifo.h
+++ b/xen/include/xen/event_fifo.h
@@ -9,27 +9,6 @@
 #ifndef __XEN_EVENT_FIFO_H__
 #define __XEN_EVENT_FIFO_H__
 
-struct evtchn_fifo_queue {
-    uint32_t *head; /* points into control block */
-    uint32_t tail;
-    uint8_t priority;
-    spinlock_t lock;
-};
-
-struct evtchn_fifo_vcpu {
-    struct evtchn_fifo_control_block *control_block;
-    struct evtchn_fifo_queue queue[EVTCHN_FIFO_MAX_QUEUES];
-};
-
-#define EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (PAGE_SIZE / sizeof(event_word_t))
-#define EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES \
-    (EVTCHN_FIFO_NR_CHANNELS / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE)
-
-struct evtchn_fifo_domain {
-    event_word_t *event_array[EVTCHN_FIFO_MAX_EVENT_ARRAY_PAGES];
-    unsigned int num_evtchns;
-};
-
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *domain);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3224.9363 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSQ-0002sx-9z; Tue, 06 Oct 2020 10:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3224.9363; Tue, 06 Oct 2020 10:44:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSQ-0002sp-6x; Tue, 06 Oct 2020 10:44:34 +0000
Received: by outflank-mailman (input) for mailman id 3224;
 Tue, 06 Oct 2020 10:44:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkSO-0002sg-IZ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f82e7022-5a7f-4cc3-b928-4697790c7f2b;
 Tue, 06 Oct 2020 10:44:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSN-0001cA-Pv
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSN-0008N7-OJ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkSO-0002sg-IZ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:32 +0000
X-Inumbo-ID: f82e7022-5a7f-4cc3-b928-4697790c7f2b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f82e7022-5a7f-4cc3-b928-4697790c7f2b;
	Tue, 06 Oct 2020 10:44:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dV1jNzllUAJIsLj5k3B8VjqbOciRhLJhYYVtorNubuQ=; b=q5uL4FVDBQQVBw0ScvU6zYaiVS
	iQruHvfB6cwslH+jbwj8vhAra1h+2+7psGhNr+HndL/32wFs7UR86ejZUzCxFN0iR5/40TxcXaHf4
	P0im+RWPgJJ3qEVxIJnCk8A+hagMJwiwR5riXon3KQ6Nwp9DYX2/rQsY8TZY0S3BtEuA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSN-0001cA-Pv
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSN-0008N7-OJ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kPkSN-0008N7-OJ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:31 +0000

commit 59b27f360e3d9dc0378c1288e67a91fa41a77158
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Oct 2 08:38:50 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 08:38:50 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8cfa2e0b6b..c4a480fa14 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -310,6 +310,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3225.9367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSa-0002uP-Bf; Tue, 06 Oct 2020 10:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3225.9367; Tue, 06 Oct 2020 10:44:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSa-0002uE-8T; Tue, 06 Oct 2020 10:44:44 +0000
Received: by outflank-mailman (input) for mailman id 3225;
 Tue, 06 Oct 2020 10:44:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkSY-0002u3-S1
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a6a58249-eef8-4a8e-9f7e-661afb043a20;
 Tue, 06 Oct 2020 10:44:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSX-0001cl-TE
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSX-0008O6-SX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkSY-0002u3-S1
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:42 +0000
X-Inumbo-ID: a6a58249-eef8-4a8e-9f7e-661afb043a20
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a6a58249-eef8-4a8e-9f7e-661afb043a20;
	Tue, 06 Oct 2020 10:44:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c2ww6N+7CCEZ6Jqhb/mmaV3StHcm3W2qjimExDpFnAk=; b=OTOasEUdI6rFDA9/ZeymXsvAp1
	jxXfZvSQAHQnAjzI7d6uLNu2YqmCt16DufxHyvfXudYrpC+TCGvDSCW/0xUTNOg8VwmRgRdIsCueK
	SyzIemI42iLrwpvO9GFWdJaMvf6cI8pWAFT75h28t/QMiyZb1xHPmbBElLwAAfessHXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSX-0001cl-TE
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSX-0008O6-SX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm,smmu: match start level of page table walk with P2M
Message-Id: <E1kPkSX-0008O6-SX@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:41 +0000

commit 9ae1197582798b394d696cff94c4d742319bdbbf
Author:     Laurentiu Tudor <laurentiu.tudor@nxp.com>
AuthorDate: Fri Oct 2 13:33:44 2020 +0300
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Fri Oct 2 10:21:56 2020 -0700

    arm,smmu: match start level of page table walk with P2M
    
    Don't hardcode the lookup start level of the page table walk to 1
    and instead match the one used in P2M. This should fix scenarios
    involving SMMU where the start level is different than 1.
    In order for the SMMU driver to also compile on arm32 move the
    P2M_ROOT_LEVEL in the p2m header file (while at it, for
    consistency also P2M_ROOT_ORDER) and use the macro in the smmu
    driver.
    
    Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/p2m.c                 |  9 ++-------
 xen/drivers/passthrough/arm/smmu.c |  2 +-
 xen/include/asm-arm/p2m.h          | 11 +++++++++++
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index ce59f2b503..4eeb867ca1 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -17,17 +17,12 @@
 #define INVALID_VMID 0 /* VMID 0 is reserved */
 
 #ifdef CONFIG_ARM_64
-static unsigned int __read_mostly p2m_root_order;
-static unsigned int __read_mostly p2m_root_level;
-#define P2M_ROOT_ORDER    p2m_root_order
-#define P2M_ROOT_LEVEL p2m_root_level
+unsigned int __read_mostly p2m_root_order;
+unsigned int __read_mostly p2m_root_level;
 static unsigned int __read_mostly max_vmid = MAX_VMID_8_BIT;
 /* VMID is by default 8 bit width on AArch64 */
 #define MAX_VMID       max_vmid
 #else
-/* First level P2M is always 2 consecutive pages */
-#define P2M_ROOT_LEVEL 1
-#define P2M_ROOT_ORDER    1
 /* VMID is always 8 bit width on AArch32 */
 #define MAX_VMID        MAX_VMID_8_BIT
 #endif
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 06f9bda47d..b8321f5d8d 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1152,7 +1152,7 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
 	      (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT);
 
 	if (!stage1)
-		reg |= (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+		reg |= (2 - P2M_ROOT_LEVEL) << TTBCR_SL0_SHIFT;
 
 	writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR);
 
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 5fdb6e8183..28ca9a838e 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -13,6 +13,17 @@
 /* Holds the bit size of IPAs in p2m tables.  */
 extern unsigned int p2m_ipa_bits;
 
+#ifdef CONFIG_ARM_64
+extern unsigned int p2m_root_order;
+extern unsigned int p2m_root_level;
+#define P2M_ROOT_ORDER    p2m_root_order
+#define P2M_ROOT_LEVEL p2m_root_level
+#else
+/* First level P2M is always 2 consecutive pages */
+#define P2M_ROOT_ORDER    1
+#define P2M_ROOT_LEVEL 1
+#endif
+
 struct domain;
 
 extern void memory_type_changed(struct domain *);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 10:44:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 10:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3226.9370 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSk-0002vc-DA; Tue, 06 Oct 2020 10:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3226.9370; Tue, 06 Oct 2020 10:44:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPkSk-0002vV-9w; Tue, 06 Oct 2020 10:44:54 +0000
Received: by outflank-mailman (input) for mailman id 3226;
 Tue, 06 Oct 2020 10:44:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPkSi-0002vJ-QO
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 09fccf95-3358-40a2-abf3-6a0815e9c98f;
 Tue, 06 Oct 2020 10:44:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSh-0001cw-W4
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPkSh-0008QX-VR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPkSi-0002vJ-QO
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:52 +0000
X-Inumbo-ID: 09fccf95-3358-40a2-abf3-6a0815e9c98f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 09fccf95-3358-40a2-abf3-6a0815e9c98f;
	Tue, 06 Oct 2020 10:44:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c9CLekwuAAXsl+my4l8AH+l3WcrLHImAFGOT4xpL5EA=; b=CKso6xLW5FI4rXVGHbWJf21Hu2
	C0RNWza4LMDTaf/FmTzmhY5xAujnZvSZCZNC1X8wZl7qCldnjP8xHoUAaD6ypuTqBMw7RcYw+g++c
	p570/gU+16HHqS0uu4ecIdJYMHOWorOBXxv6DQ948592H5O+nB6+wqtM86l1TEXJA3Ms=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSh-0001cw-W4
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPkSh-0008QX-VR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 10:44:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy()
Message-Id: <E1kPkSh-0008QX-VR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 10:44:51 +0000

commit 8ef6345ef557cc2c47298217635a3088eaa59893
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 18:23:42 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 2 18:57:50 2020 +0100

    tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy()
    
    OSSTest reports that libvirt is reliably regressed.
    
    The only possible option is a side effect of using libxl_defbool_val(), which
    can only be the assert() within.  Unfortunately, libvirt actually crashes in
    __vfscanf_internal() while presumably trying to render some form of error.
    
    Open code the check without the assert() to unblock staging, while we
    investigate what is going on with libvirt.  This will want reverting at some
    point in the future.
    
    Not-really-fixes: bfcc97c08c ("tools/cpuid: Plumb nested_virt down into xc_cpuid_apply_policy()" reliably breaks libvirt.)
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/light/libxl_cpuid.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 08e85dcffb..16c077cceb 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -422,7 +422,15 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
 {
     bool pae = true;
     bool itsc;
-    bool nested_virt = libxl_defbool_val(info->nested_hvm);
+
+    /*
+     * Gross hack.  Using libxl_defbool_val() here causes libvirt to crash in
+     * __vfscanf_internal(), which is probably collateral damage from a side
+     * effect of the assert().
+     *
+     * Unblock things for now by opencoding without the assert.
+     */
+    bool nested_virt = info->nested_hvm.val > 0;
 
     /*
      * For PV guests, PAE is Xen-controlled (it is the 'p' that differentiates
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3228.9377 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDP-0007d1-OD; Tue, 06 Oct 2020 11:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3228.9377; Tue, 06 Oct 2020 11:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDP-0007ct-LA; Tue, 06 Oct 2020 11:33:07 +0000
Received: by outflank-mailman (input) for mailman id 3228;
 Tue, 06 Oct 2020 11:33:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlDN-0007co-VL
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8fa50b56-e8f3-44b3-b2e7-60e59d5a513d;
 Tue, 06 Oct 2020 11:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDM-0002c5-Qf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDM-0003eI-PJ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlDN-0007co-VL
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:06 +0000
X-Inumbo-ID: 8fa50b56-e8f3-44b3-b2e7-60e59d5a513d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8fa50b56-e8f3-44b3-b2e7-60e59d5a513d;
	Tue, 06 Oct 2020 11:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jkgSB5Rl/6Ae5sqYDu7526VyNQrMWdPmqfUT+b5PIps=; b=LhdXZUCizDokbgnOoL09rMDcoi
	aHQIqKoYWwBrw8KDydwe6LJbQqisSjflHk4BgZHekHbqVVHciKQ9sm7upv8+pirjafakEl1BYW++G
	QzuFEVl6/3asK9fon2ou0OTo1kKZQruSzYSAYWWp61Wom5i9BYX+/LqoLHvbkGiZxqCs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDM-0002c5-Qf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDM-0003eI-PJ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Simplify DOMCTL_CDF_ flags handling in libxl__domain_make()
Message-Id: <E1kPlDM-0003eI-PJ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:04 +0000

commit 346b11561906840e29ca82d5569a51f6668d3a6a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 18:39:08 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    tools/libxl: Simplify DOMCTL_CDF_ flags handling in libxl__domain_make()
    
    The use of the ternary operator serves only to obfuscate the code.  Rewrite it
    in more simple terms, avoiding the need to conditionally OR zero into the
    flags.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_create.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 9a6e92b3a5..df31a42124 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -611,10 +611,12 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
         if (info->type != LIBXL_DOMAIN_TYPE_PV) {
             create.flags |= XEN_DOMCTL_CDF_hvm;
-            create.flags |=
-                libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
-            create.flags |=
-                libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+
+            if ( libxl_defbool_val(info->hap) )
+                create.flags |= XEN_DOMCTL_CDF_hap;
+
+            if ( !libxl_defbool_val(info->oos) )
+                create.flags |= XEN_DOMCTL_CDF_oos_off;
         }
 
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3229.9381 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDZ-0007dl-Pu; Tue, 06 Oct 2020 11:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3229.9381; Tue, 06 Oct 2020 11:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDZ-0007dd-Mj; Tue, 06 Oct 2020 11:33:17 +0000
Received: by outflank-mailman (input) for mailman id 3229;
 Tue, 06 Oct 2020 11:33:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlDZ-0007dY-5k
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4edd44c2-36e3-476e-8dbb-e2aab339295c;
 Tue, 06 Oct 2020 11:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDW-0002c8-Tv
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDW-0003fB-T6
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlDZ-0007dY-5k
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:17 +0000
X-Inumbo-ID: 4edd44c2-36e3-476e-8dbb-e2aab339295c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4edd44c2-36e3-476e-8dbb-e2aab339295c;
	Tue, 06 Oct 2020 11:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=znnuEeCwDEBbDLRzVHDczanQZK31PFtC4XPekwwfuXg=; b=omk7d/X6Et979OXRutDrKL1M0/
	kjpVfCQI8FDPawtssJyf+1eX5bcr/kwncu9HmDn5P2nl0DvgoixX4Sy6mWKG/RzwOx+slwsV7o+Ml
	8m6yeFM8wvLS3JdqTeFRdPpudmSn9MGHIpIns5DpSsc/WgTqbx+u3x4dMGf+cq2zXFAI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDW-0002c8-Tv
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDW-0003fB-T6
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/domctl: Simplify DOMCTL_CDF_ checking logic
Message-Id: <E1kPlDW-0003fB-T6@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:14 +0000

commit 45264e0669c0874c9058f7c7de24d5c45a425664
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:56:35 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/domctl: Simplify DOMCTL_CDF_ checking logic
    
    Introduce some local variables to make the resulting logic easier to follow.
    Join the two IOMMU checks in sanitise_domain_config().  Tweak some of the
    terminology for better accuracy.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/domain.c |  7 ++++---
 xen/common/domain.c   | 45 +++++++++++++++++++++++++++------------------
 2 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7e16d49bfd..d8f9be132c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -629,6 +629,7 @@ void arch_vcpu_destroy(struct vcpu *v)
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
+    bool hap = config->flags & XEN_DOMCTL_CDF_hap;
     unsigned int max_vcpus;
 
     if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -653,13 +654,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( (config->flags & XEN_DOMCTL_CDF_hap) && !hvm_hap_supported() )
+    if ( hap && !hvm_hap_supported() )
     {
-        dprintk(XENLOG_INFO, "HAP requested but not supported\n");
+        dprintk(XENLOG_INFO, "HAP requested but not available\n");
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) )
+    if ( !hvm )
         /*
          * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
          * for HVM guests.
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c4a480fa14..a877eacc09 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -299,6 +299,10 @@ static void _domain_destroy(struct domain *d)
 
 static int sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
+    bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
+    bool hap = config->flags & XEN_DOMCTL_CDF_hap;
+    bool iommu = config->flags & XEN_DOMCTL_CDF_iommu;
+
     if ( config->flags & ~(XEN_DOMCTL_CDF_hvm |
                            XEN_DOMCTL_CDF_hap |
                            XEN_DOMCTL_CDF_s3_integrity |
@@ -310,36 +314,41 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
-    {
-        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
-        return -EINVAL;
-    }
-
-    if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
-    {
-        dprintk(XENLOG_INFO,
-                "IOMMU options specified but IOMMU not enabled\n");
-        return -EINVAL;
-    }
-
     if ( config->max_vcpus < 1 )
     {
         dprintk(XENLOG_INFO, "No vCPUS\n");
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) &&
-         (config->flags & XEN_DOMCTL_CDF_hap) )
+    if ( hap && !hvm )
     {
         dprintk(XENLOG_INFO, "HAP requested for non-HVM guest\n");
         return -EINVAL;
     }
 
-    if ( (config->flags & XEN_DOMCTL_CDF_iommu) && !iommu_enabled )
+    if ( iommu )
     {
-        dprintk(XENLOG_INFO, "IOMMU is not enabled\n");
-        return -EINVAL;
+        if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+        {
+            dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n",
+                    config->iommu_opts);
+            return -EINVAL;
+        }
+
+        if ( !iommu_enabled )
+        {
+            dprintk(XENLOG_INFO, "IOMMU requested but not available\n");
+            return -EINVAL;
+        }
+    }
+    else
+    {
+        if ( config->iommu_opts )
+        {
+            dprintk(XENLOG_INFO,
+                    "IOMMU options specified but IOMMU not requested\n");
+            return -EINVAL;
+        }
     }
 
     return arch_sanitise_domain_config(config);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3230.9385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDi-0007en-RL; Tue, 06 Oct 2020 11:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3230.9385; Tue, 06 Oct 2020 11:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDi-0007ef-OK; Tue, 06 Oct 2020 11:33:26 +0000
Received: by outflank-mailman (input) for mailman id 3230;
 Tue, 06 Oct 2020 11:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlDi-0007eY-Ac
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b4086150-7560-432e-b306-4c163ea32940;
 Tue, 06 Oct 2020 11:33:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDh-0002cH-1Y
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDh-0003fd-08
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlDi-0007eY-Ac
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:26 +0000
X-Inumbo-ID: b4086150-7560-432e-b306-4c163ea32940
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b4086150-7560-432e-b306-4c163ea32940;
	Tue, 06 Oct 2020 11:33:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sfhHvreD3J48HG5TiCQ4v/GNuer3LU4kO3sVnEmSytI=; b=y4frc5zlR9i70whk6WhLtxiVsb
	VcfKnUBBqtZ1I0lxiOdaTjZUY8IXtpHS8CClDexWI19h3eqc8Nh+xDCqKWi9oM8rN3YjG9jNe0BUx
	MOZiPFVy54sbfElrh0+d48G8ikF5PZ4zcyHdZrlNi1kWCsmZXWN5aBft7vjYixfpoYXc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDh-0002cH-1Y
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDh-0003fd-08
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/domctl: Introduce and use XEN_DOMCTL_CDF_nested_virt
Message-Id: <E1kPlDh-0003fd-08@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:25 +0000

commit dbe399b174e471c97d63a3e3f2c00cd8c753106c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 28 14:30:14 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/domctl: Introduce and use XEN_DOMCTL_CDF_nested_virt
    
    Like other major areas of functionality, nested virt (or not) needs to be
    known at domain creation time for sensible CPUID handling, and wants to be
    known this early for sensible infrastructure handling in Xen.
    
    Introduce XEN_DOMCTL_CDF_nested_virt and modify libxl to set it appropriately
    when creating domains.  There is no need to adjust the ARM logic to reject the
    use of this new flag.
    
    No functional change yet.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
---
 tools/libs/light/libxl_create.c |  3 +++
 tools/ocaml/libs/xc/xenctrl.ml  |  1 +
 tools/ocaml/libs/xc/xenctrl.mli |  1 +
 xen/arch/x86/domain.c           |  7 +++++++
 xen/common/domain.c             | 11 +++++------
 xen/include/public/domctl.h     |  4 +++-
 6 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index df31a42124..321a13e519 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -617,6 +617,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
             if ( !libxl_defbool_val(info->oos) )
                 create.flags |= XEN_DOMCTL_CDF_oos_off;
+
+            if ( libxl_defbool_val(b_info->nested_hvm) )
+                create.flags |= XEN_DOMCTL_CDF_nested_virt;
         }
 
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 497ded7ce2..e878699b0a 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -64,6 +64,7 @@ type domain_create_flag =
 	| CDF_OOS_OFF
 	| CDF_XS_DOMAIN
 	| CDF_IOMMU
+	| CDF_NESTED_VIRT
 
 type domain_create_iommu_opts =
 	| IOMMU_NO_SHAREPT
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index f7f6ec570d..e64907df8e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -57,6 +57,7 @@ type domain_create_flag =
   | CDF_OOS_OFF
   | CDF_XS_DOMAIN
   | CDF_IOMMU
+  | CDF_NESTED_VIRT
 
 type domain_create_iommu_opts =
   | IOMMU_NO_SHAREPT
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d8f9be132c..5454f94d18 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -630,6 +630,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
     bool hap = config->flags & XEN_DOMCTL_CDF_hap;
+    bool nested_virt = config->flags & XEN_DOMCTL_CDF_nested_virt;
     unsigned int max_vcpus;
 
     if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -667,6 +668,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
          */
         config->flags |= XEN_DOMCTL_CDF_oos_off;
 
+    if ( nested_virt && !hap )
+    {
+        dprintk(XENLOG_INFO, "Nested virt not supported without HAP\n");
+        return -EINVAL;
+    }
+
     return 0;
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index a877eacc09..f748806a45 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -303,12 +303,11 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
     bool hap = config->flags & XEN_DOMCTL_CDF_hap;
     bool iommu = config->flags & XEN_DOMCTL_CDF_iommu;
 
-    if ( config->flags & ~(XEN_DOMCTL_CDF_hvm |
-                           XEN_DOMCTL_CDF_hap |
-                           XEN_DOMCTL_CDF_s3_integrity |
-                           XEN_DOMCTL_CDF_oos_off |
-                           XEN_DOMCTL_CDF_xs_domain |
-                           XEN_DOMCTL_CDF_iommu) )
+    if ( config->flags &
+         ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
+           XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off |
+           XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu |
+           XEN_DOMCTL_CDF_nested_virt) )
     {
         dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags);
         return -EINVAL;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 791f0a2592..666aeb71bf 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -68,9 +68,11 @@ struct xen_domctl_createdomain {
  /* Should this domain be permitted to use the IOMMU? */
 #define _XEN_DOMCTL_CDF_iommu         5
 #define XEN_DOMCTL_CDF_iommu          (1U<<_XEN_DOMCTL_CDF_iommu)
+#define _XEN_DOMCTL_CDF_nested_virt   6
+#define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
 
 /* Max XEN_DOMCTL_CDF_* constant.  Used for ABI checking. */
-#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_iommu
+#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_nested_virt
 
     uint32_t flags;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3231.9388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDs-0007gc-UC; Tue, 06 Oct 2020 11:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3231.9388; Tue, 06 Oct 2020 11:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlDs-0007gU-RF; Tue, 06 Oct 2020 11:33:36 +0000
Received: by outflank-mailman (input) for mailman id 3231;
 Tue, 06 Oct 2020 11:33:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlDs-0007gL-6k
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e76315c7-f431-4075-aa7f-5b8ef78c6db2;
 Tue, 06 Oct 2020 11:33:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDr-0002cS-4z
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlDr-0003g7-40
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlDs-0007gL-6k
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:36 +0000
X-Inumbo-ID: e76315c7-f431-4075-aa7f-5b8ef78c6db2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e76315c7-f431-4075-aa7f-5b8ef78c6db2;
	Tue, 06 Oct 2020 11:33:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FSFt97JuwL0YUJrZ+I9WwWxbOke6COA9Kw5d7UohRKc=; b=M1y6hfEeo9WF5j/9VcI/+IeFEu
	60+1a8VN0c6PgAjXNncsqz3sPafiAU2cSwTSPSx1Hgh83ymQsIRinpI2tVHkCqwQUh10+chQbweoP
	9OXLjrzIzP9UBg2VluMbQekqqMCHMrWIhkcTpN1lDAOkol2xRqBqsMeP05VcNFKlst1U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDr-0002cS-4z
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlDr-0003g7-40
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM
Message-Id: <E1kPlDr-0003g7-40@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:35 +0000

commit f5bdb4aaa165c6fe1d2c42e1d67619e7d8217cdd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM
    
    With XEN_DOMCTL_CDF_nested_virt now passed properly to domain_create(),
    reimplement nestedhvm_enabled() to use the property which is fixed for the
    lifetime of the domain.
    
    This makes the call to nestedhvm_vcpu_initialise() from hvm_vcpu_initialise()
    no longer dead.  It became logically dead with the Xend => XL transition, as
    they initialise HVM_PARAM_NESTEDHVM in opposite orders with respect to
    XEN_DOMCTL_max_vcpus.
    
    There is one opencoded user of nestedhvm_enabled() in HVM_PARAM_ALTP2M's
    safety check.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_x86.c        |  5 -----
 xen/arch/x86/hvm/hvm.c              | 33 ++++-----------------------------
 xen/include/asm-x86/hvm/nestedhvm.h |  5 ++---
 xen/include/public/hvm/params.h     |  4 +---
 4 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 6ec6c27c83..e18274cc10 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -426,11 +426,6 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
             LOG(ERROR, "Couldn't set HVM_PARAM_TIMER_MODE");
             goto out;
         }
-        if (xc_hvm_param_set(xch, domid, HVM_PARAM_NESTEDHVM,
-                             libxl_defbool_val(info->nested_hvm))) {
-            LOG(ERROR, "Couldn't set HVM_PARAM_NESTEDHVM");
-            goto out;
-        }
         if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, altp2m)) {
             LOG(ERROR, "Couldn't set HVM_PARAM_ALTP2M");
             goto out;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2dfda93e09..101a739952 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4086,6 +4086,7 @@ static int hvm_allow_set_param(struct domain *d,
     case HVM_PARAM_MEMORY_EVENT_CR3:
     case HVM_PARAM_MEMORY_EVENT_CR4:
     case HVM_PARAM_MEMORY_EVENT_INT3:
+    case HVM_PARAM_NESTEDHVM:
     case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
     case HVM_PARAM_BUFIOREQ_EVTCHN:
     case HVM_PARAM_MEMORY_EVENT_MSR:
@@ -4204,39 +4205,12 @@ static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value)
     case HVM_PARAM_ACPI_IOPORTS_LOCATION:
         rc = pmtimer_change_ioport(d, value);
         break;
-    case HVM_PARAM_NESTEDHVM:
-        rc = xsm_hvm_param_nested(XSM_PRIV, d);
-        if ( rc )
-            break;
-        if ( value > 1 )
-            rc = -EINVAL;
-        /*
-         * Remove the check below once we have
-         * shadow-on-shadow.
-         */
-        if ( !paging_mode_hap(d) && value )
-            rc = -EINVAL;
-        if ( value &&
-             d->arch.hvm.params[HVM_PARAM_ALTP2M] )
-            rc = -EINVAL;
-        /* Set up NHVM state for any vcpus that are already up. */
-        if ( value &&
-             !d->arch.hvm.params[HVM_PARAM_NESTEDHVM] )
-            for_each_vcpu(d, v)
-                if ( rc == 0 )
-                    rc = nestedhvm_vcpu_initialise(v);
-        if ( !value || rc )
-            for_each_vcpu(d, v)
-                nestedhvm_vcpu_destroy(v);
-        break;
     case HVM_PARAM_ALTP2M:
         rc = xsm_hvm_param_altp2mhvm(XSM_PRIV, d);
         if ( rc )
             break;
-        if ( value > XEN_ALTP2M_limited )
-            rc = -EINVAL;
-        if ( value &&
-             d->arch.hvm.params[HVM_PARAM_NESTEDHVM] )
+        if ( (value > XEN_ALTP2M_limited) ||
+             (value && nestedhvm_enabled(d)) )
             rc = -EINVAL;
         break;
     case HVM_PARAM_TRIPLE_FAULT_REASON:
@@ -4390,6 +4364,7 @@ static int hvm_allow_get_param(struct domain *d,
     case HVM_PARAM_MEMORY_EVENT_CR3:
     case HVM_PARAM_MEMORY_EVENT_CR4:
     case HVM_PARAM_MEMORY_EVENT_INT3:
+    case HVM_PARAM_NESTEDHVM:
     case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
     case HVM_PARAM_BUFIOREQ_EVTCHN:
     case HVM_PARAM_MEMORY_EVENT_MSR:
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index d9784a2e0b..d263925786 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -34,10 +34,9 @@ enum nestedhvm_vmexits {
 };
 
 /* Nested HVM on/off per domain */
-static always_inline bool nestedhvm_enabled(const struct domain *d)
+static inline bool nestedhvm_enabled(const struct domain *d)
 {
-    return is_hvm_domain(d) && d->arch.hvm.params &&
-        d->arch.hvm.params[HVM_PARAM_NESTEDHVM];
+    return IS_ENABLED(CONFIG_HVM) && (d->options & XEN_DOMCTL_CDF_nested_virt);
 }
 
 /* Nested VCPU */
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 0a91bfa749..0e3fdca096 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -34,6 +34,7 @@
 #define HVM_PARAM_MEMORY_EVENT_CR3          21
 #define HVM_PARAM_MEMORY_EVENT_CR4          22
 #define HVM_PARAM_MEMORY_EVENT_INT3         23
+#define HVM_PARAM_NESTEDHVM                 24
 #define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP  25
 #define HVM_PARAM_BUFIOREQ_EVTCHN           26
 #define HVM_PARAM_MEMORY_EVENT_MSR          30
@@ -232,9 +233,6 @@
  */
 #define HVM_PARAM_ACPI_IOPORTS_LOCATION 19
 
-/* 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_MONITOR_RING_PFN  28
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3232.9392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlE3-0007iF-Vt; Tue, 06 Oct 2020 11:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3232.9392; Tue, 06 Oct 2020 11:33:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlE3-0007i7-Sz; Tue, 06 Oct 2020 11:33:47 +0000
Received: by outflank-mailman (input) for mailman id 3232;
 Tue, 06 Oct 2020 11:33:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlE2-0007hv-Uj
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0d619765-0f7c-4aa4-aeff-c9a7308c7254;
 Tue, 06 Oct 2020 11:33:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlE1-0002dH-9j
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlE1-0003gh-7P
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlE2-0007hv-Uj
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:46 +0000
X-Inumbo-ID: 0d619765-0f7c-4aa4-aeff-c9a7308c7254
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0d619765-0f7c-4aa4-aeff-c9a7308c7254;
	Tue, 06 Oct 2020 11:33:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=miJ4W/TgWs0qPi9ZmeEQ+ozz2tvU5cESqSFqVC+vdfI=; b=O+RMHizjOQW6dkEXli1nVegigg
	MkLrcDM5ZbbBKB9EMOVBHc4Y4VBzWGHD5IdLBK4JqhQnD/5esIXaD5IQ1H5yS80F4idWPlIzlJy6l
	xMYnX4ty12aKFwTotjzi4VuaU/AX7pcrbHR9d+QqXa2GicU8qNg27AWxG8/FKz1HiVLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlE1-0002dH-9j
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlE1-0003gh-7P
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/xsm: Drop xsm_hvm_param_nested()
Message-Id: <E1kPlE1-0003gh-7P@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:45 +0000

commit 3600118a52e75e10800806fdd05eba13adc87347
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/xsm: Drop xsm_hvm_param_nested()
    
    The sole caller has been removed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/flask/policy/modules/xen.if   | 2 +-
 xen/include/xsm/dummy.h             | 6 ------
 xen/include/xsm/xsm.h               | 6 ------
 xen/xsm/dummy.c                     | 1 -
 xen/xsm/flask/hooks.c               | 6 ------
 xen/xsm/flask/policy/access_vectors | 2 --
 6 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/tools/flask/policy/modules/xen.if b/tools/flask/policy/modules/xen.if
index 8eb2293a52..5e2aa472b6 100644
--- a/tools/flask/policy/modules/xen.if
+++ b/tools/flask/policy/modules/xen.if
@@ -59,7 +59,7 @@ define(`create_domain_common', `
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op updatemp };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { getparam hvmctl sethvmc
-			setparam nested altp2mhvm altp2mhvm_op dm };
+			setparam altp2mhvm altp2mhvm_op dm };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 2368acebed..7ae3c40eb5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,12 +551,6 @@ static XSM_INLINE int xsm_hvm_control(XSM_DEFAULT_ARG struct domain *d, unsigned
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, d);
-}
-
 static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b21c3783d3..358ec13ba8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -137,7 +137,6 @@ struct xsm_operations {
 
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_control) (struct domain *d, unsigned long op);
-    int (*hvm_param_nested) (struct domain *d);
     int (*hvm_param_altp2mhvm) (struct domain *d);
     int (*hvm_altp2mhvm_op) (struct domain *d, uint64_t mode, uint32_t op);
     int (*get_vnumainfo) (struct domain *d);
@@ -565,11 +564,6 @@ static inline int xsm_hvm_control(xsm_default_t def, struct domain *d, unsigned
     return xsm_ops->hvm_control(d, op);
 }
 
-static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
-{
-    return xsm_ops->hvm_param_nested(d);
-}
-
 static inline int xsm_hvm_param_altp2mhvm (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_param_altp2mhvm(d);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index d4cce68089..9e09512144 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -106,7 +106,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hypfs_op);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_control);
-    set_to_dummy_if_null(ops, hvm_param_nested);
     set_to_dummy_if_null(ops, hvm_param_altp2mhvm);
     set_to_dummy_if_null(ops, hvm_altp2mhvm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b3addbf701..de050cc9fe 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1218,11 +1218,6 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_param_nested(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
-}
-
 static int flask_hvm_param_altp2mhvm(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
@@ -1826,7 +1821,6 @@ static struct xsm_operations flask_ops = {
     .hypfs_op = flask_hypfs_op,
     .hvm_param = flask_hvm_param,
     .hvm_control = flask_hvm_param,
-    .hvm_param_nested = flask_hvm_param_nested,
     .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
     .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index fde5162c7e..1aa0bb501c 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -272,8 +272,6 @@ class hvm
 #  source = domain whose memory is being shared
 #  target = client domain
     share_mem
-# HVMOP_set_param setting HVM_PARAM_NESTEDHVM
-    nested
 # HVMOP_set_param setting HVM_PARAM_ALTP2MHVM
     altp2mhvm
 # HVMOP_altp2m_set_domain_state HVMOP_altp2m_get_domain_state
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:33:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3233.9397 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlED-0007jK-1j; Tue, 06 Oct 2020 11:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3233.9397; Tue, 06 Oct 2020 11:33:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEC-0007jC-Uf; Tue, 06 Oct 2020 11:33:56 +0000
Received: by outflank-mailman (input) for mailman id 3233;
 Tue, 06 Oct 2020 11:33:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlEC-0007j5-FW
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 21f265a6-2d72-4912-b5b5-0355fd612e49;
 Tue, 06 Oct 2020 11:33:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEB-0002dN-DS
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEB-0003hR-CX
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlEC-0007j5-FW
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:56 +0000
X-Inumbo-ID: 21f265a6-2d72-4912-b5b5-0355fd612e49
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 21f265a6-2d72-4912-b5b5-0355fd612e49;
	Tue, 06 Oct 2020 11:33:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RT7+Aw2EneRIyQ3VnfWQk339IiORxa8GUPwbtrr7JdY=; b=MFU+NoomD9QdKdHwNU0XMytHv+
	PqWE1kWaiad1ly7MCeoRuo5ZJXHOnnuVyH5r9jl/P5CaxM0kyHc0hKXIP0zuOIPCzmgmrTIQnsHCJ
	XB5DazSlc/w1BLrhxZiloAi/5x6V+hfbuQa2+FF+5eZEgX1TFsFUISC5W0ihoC7XXxRw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEB-0002dN-DS
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEB-0003hR-CX
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:33:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Drop restore boolean from hvm_cr4_guest_valid_bits()
Message-Id: <E1kPlEB-0003hR-CX@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:33:55 +0000

commit 345fd6d01e6730ea9024ae3b98e1832c35b34a28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/hvm: Drop restore boolean from hvm_cr4_guest_valid_bits()
    
    Previously, migration was reordered so the CPUID data was available before
    register state.  nestedhvm_enabled() has recently been made accurate for the
    entire lifetime of the domain.
    
    Therefore, we can drop the bodge in hvm_cr4_guest_valid_bits() which existed
    previously to tolerate a guests' CR4 being set/restored before
    HVM_PARAM_NESTEDHVM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/domain.c       | 2 +-
 xen/arch/x86/hvm/hvm.c          | 8 ++++----
 xen/arch/x86/hvm/svm/svmdebug.c | 6 ++++--
 xen/arch/x86/hvm/vmx/vmx.c      | 2 +-
 xen/arch/x86/hvm/vmx/vvmx.c     | 2 +-
 xen/include/asm-x86/hvm/hvm.h   | 2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 8e3375265c..0ce132b308 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -275,7 +275,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
     if ( v->arch.hvm.guest_efer & EFER_LME )
         v->arch.hvm.guest_efer |= EFER_LMA;
 
-    if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d, false) )
+    if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d) )
     {
         gprintk(XENLOG_ERR, "Bad CR4 value: %#016lx\n",
                 v->arch.hvm.guest_cr[4]);
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 101a739952..54e32e4fe8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -972,14 +972,14 @@ const char *hvm_efer_valid(const struct vcpu *v, uint64_t value,
         X86_CR0_CD | X86_CR0_PG)))
 
 /* These bits in CR4 can be set by the guest. */
-unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restore)
+unsigned long hvm_cr4_guest_valid_bits(const struct domain *d)
 {
     const struct cpuid_policy *p = d->arch.cpuid;
     bool mce, vmxe;
 
     /* Logic broken out simply to aid readability below. */
     mce  = p->basic.mce || p->basic.mca;
-    vmxe = p->basic.vmx && (restore || nestedhvm_enabled(d));
+    vmxe = p->basic.vmx && nestedhvm_enabled(d);
 
     return ((p->basic.vme     ? X86_CR4_VME | X86_CR4_PVI : 0) |
             (p->basic.tsc     ? X86_CR4_TSD               : 0) |
@@ -1033,7 +1033,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d, true) )
+    if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -2425,7 +2425,7 @@ int hvm_set_cr4(unsigned long value, bool may_defer)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & ~hvm_cr4_guest_valid_bits(v->domain, false) )
+    if ( value & ~hvm_cr4_guest_valid_bits(v->domain) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c
index ba26b6a80b..f450391df4 100644
--- a/xen/arch/x86/hvm/svm/svmdebug.c
+++ b/xen/arch/x86/hvm/svm/svmdebug.c
@@ -106,6 +106,7 @@ bool svm_vmcb_isvalid(const char *from, const struct vmcb_struct *vmcb,
     unsigned long cr0 = vmcb_get_cr0(vmcb);
     unsigned long cr3 = vmcb_get_cr3(vmcb);
     unsigned long cr4 = vmcb_get_cr4(vmcb);
+    unsigned long valid;
     uint64_t efer = vmcb_get_efer(vmcb);
 
 #define PRINTF(fmt, args...) do { \
@@ -130,9 +131,10 @@ bool svm_vmcb_isvalid(const char *from, const struct vmcb_struct *vmcb,
            (cr3 >> v->domain->arch.cpuid->extd.maxphysaddr))) )
         PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", cr3);
 
-    if ( cr4 & ~hvm_cr4_guest_valid_bits(v->domain, false) )
+    valid = hvm_cr4_guest_valid_bits(v->domain);
+    if ( cr4 & ~valid )
         PRINTF("CR4: invalid bits are set (%#"PRIx64", valid: %#"PRIx64")\n",
-               cr4, hvm_cr4_guest_valid_bits(v->domain, false));
+               cr4, valid);
 
     if ( vmcb_get_dr6(vmcb) >> 32 )
         PRINTF("DR6: bits [63:32] are not zero (%#"PRIx64")\n",
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 95d109f962..86b8916a5d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1529,7 +1529,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr,
              */
             v->arch.hvm.vmx.cr4_host_mask =
                 (HVM_CR4_HOST_MASK | X86_CR4_PKE |
-                 ~hvm_cr4_guest_valid_bits(v->domain, false));
+                 ~hvm_cr4_guest_valid_bits(v->domain));
 
             v->arch.hvm.vmx.cr4_host_mask |= v->arch.hvm.vmx.vmx_realmode ?
                                              X86_CR4_VME : 0;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 1e51689ef3..3a37e9ebea 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2323,7 +2323,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        data = hvm_cr4_guest_valid_bits(d, false);
+        data = hvm_cr4_guest_valid_bits(d);
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index be0d8b0a4d..334bd573b9 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -334,7 +334,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 /* Check CR4/EFER values */
 const char *hvm_efer_valid(const struct vcpu *v, uint64_t value,
                            signed int cr0_pg);
-unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restore);
+unsigned long hvm_cr4_guest_valid_bits(const struct domain *d);
 
 int hvm_copy_context_and_params(struct domain *src, struct domain *dst);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:34:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3234.9400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEN-0007mc-2z; Tue, 06 Oct 2020 11:34:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3234.9400; Tue, 06 Oct 2020 11:34:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEN-0007mT-05; Tue, 06 Oct 2020 11:34:07 +0000
Received: by outflank-mailman (input) for mailman id 3234;
 Tue, 06 Oct 2020 11:34:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlEM-0007mM-CE
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 095de63c-cce0-414f-89be-4a5da2a9b66f;
 Tue, 06 Oct 2020 11:34:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEL-0002dm-Gv
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEL-0003iC-Fg
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlEM-0007mM-CE
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:06 +0000
X-Inumbo-ID: 095de63c-cce0-414f-89be-4a5da2a9b66f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 095de63c-cce0-414f-89be-4a5da2a9b66f;
	Tue, 06 Oct 2020 11:34:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F8D3PUPNItS8QfX3T4UaM7XhMQCpkQlvTu+UlgBmfw4=; b=VPz2HDhjav3TZH7zizhXOm97ci
	0Zrq1w1tNCu4Uj5UHseAJV5lNF2itbCsFBaU88H3wQjetEzlpBhVfL3sEZEa4VcG5u7easshkFQcw
	7Ilf5CNksS6QDv8+NtnYOpjtVypZdRuVZX+JTmGSVW1rG7kf3Fd6QvRVwtoAuaYeLhFg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEL-0002dm-Gv
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEL-0003iC-Fg
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpuid: Move VMX/SVM out of the default policy
Message-Id: <E1kPlEL-0003iC-Fg@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:34:05 +0000

commit 35679b221ee731a957f180051ede70ef49bb4fe0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Sep 30 10:17:33 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/cpuid: Move VMX/SVM out of the default policy
    
    Nested virt is still experimental, and requires explicitly opting in to at
    domain create time.  The VMX/SVM features should not be visible by default.
    
    Also correct them from all HVM guests, to just HAP-enabled guests.  This has
    been the restriction for SVM right from the outset (c/s e006a0e0aaa), while
    VMX was first introduced supporting shadow mode (c/s 9122c69c8d3) but later
    adjusted to HAP-only (c/s 77751ed79e3).
    
    There is deliberately no adjustment to xc_cpuid_apply_policy() for pre-4.14
    migration compatibility.  The migration stream doesn't contain the required
    architectural state for either VMX/SVM, and a nested virt VM which migrates
    will explode in weird and wonderful ways.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/public/arch-x86/cpufeatureset.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index abd18722ee..ef7cca334d 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -127,7 +127,7 @@ XEN_CPUFEATURE(PCLMULQDQ,     1*32+ 1) /*A  Carry-less multiplication */
 XEN_CPUFEATURE(DTES64,        1*32+ 2) /*   64-bit Debug Store */
 XEN_CPUFEATURE(MONITOR,       1*32+ 3) /*   Monitor/Mwait support */
 XEN_CPUFEATURE(DSCPL,         1*32+ 4) /*   CPL Qualified Debug Store */
-XEN_CPUFEATURE(VMX,           1*32+ 5) /*S  Virtual Machine Extensions */
+XEN_CPUFEATURE(VMX,           1*32+ 5) /*h  Virtual Machine Extensions */
 XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
 XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
 XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
@@ -166,7 +166,7 @@ XEN_CPUFEATURE(3DNOW,         2*32+31) /*A  3DNow! */
 /* AMD-defined CPU features, CPUID level 0x80000001.ecx, word 3 */
 XEN_CPUFEATURE(LAHF_LM,       3*32+ 0) /*A  LAHF/SAHF in long mode */
 XEN_CPUFEATURE(CMP_LEGACY,    3*32+ 1) /*!A If yes HyperThreading not valid */
-XEN_CPUFEATURE(SVM,           3*32+ 2) /*S  Secure virtual machine */
+XEN_CPUFEATURE(SVM,           3*32+ 2) /*h  Secure virtual machine */
 XEN_CPUFEATURE(EXTAPIC,       3*32+ 3) /*   Extended APIC space */
 XEN_CPUFEATURE(CR8_LEGACY,    3*32+ 4) /*S  CR8 in 32-bit mode */
 XEN_CPUFEATURE(ABM,           3*32+ 5) /*A  Advanced bit manipulation */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:34:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3235.9405 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEY-0007np-4i; Tue, 06 Oct 2020 11:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3235.9405; Tue, 06 Oct 2020 11:34:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEY-0007nh-1i; Tue, 06 Oct 2020 11:34:18 +0000
Received: by outflank-mailman (input) for mailman id 3235;
 Tue, 06 Oct 2020 11:34:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlEW-0007nb-W5
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e1e39650-6d0c-45d8-9952-1ed3cdecd3fe;
 Tue, 06 Oct 2020 11:34:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEV-0002dw-KP
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEV-0003j1-JR
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlEW-0007nb-W5
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:17 +0000
X-Inumbo-ID: e1e39650-6d0c-45d8-9952-1ed3cdecd3fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e1e39650-6d0c-45d8-9952-1ed3cdecd3fe;
	Tue, 06 Oct 2020 11:34:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F0czNgABi8XSfoP4IKE1/pJP8JKraF5ygj7RXFpwJ74=; b=VwJM2GX6ygSPcxFVDT40i7PwDa
	qmQklu75Ra23b+CvcfgBofb+Q9pr/Y9FG1oDWSYHbthV61Rimr/Ppt0FyWUNp4Uw4BCnrCHTF24Dr
	jt9dfAG9U/busiBtqhJn0aAriCwqzzhK0BTkPNoEDc7R4cSiN2bFa4Vm+IKDDSZd7VDQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEV-0002dw-KP
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEV-0003j1-JR
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: {paging, sh}_{cmpxchg, write}_guest_entry() cannot fault
Message-Id: <E1kPlEV-0003j1-JR@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:34:15 +0000

commit 1bc30c076a7f1678166934c080e1bf94b2c189af
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 13:57:51 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/mm: {paging, sh}_{cmpxchg, write}_guest_entry() cannot fault
    
    As of 2d0557c5cbeb ("x86: Fold page_info lock into type_info") we
    haven't been updating guest page table entries through linear page
    tables anymore. All updates have been using domain mappings since then.
    Drop the use of guest/user access helpers there, and hence also the
    boolean return values of the involved functions.
    
    update_intpte(), otoh, gets its boolean return type retained for now,
    as we may want to bound the CMPXCHG retry loop, indicating failure to
    the caller instead when the retry threshold got exceeded.
    
    With this {,__}cmpxchg_user() become unused, so they too get dropped.
    (In fact, dropping them was the motivation of making the change.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c                   |  8 +++----
 xen/arch/x86/mm/shadow/private.h    |  4 ++--
 xen/arch/x86/mm/shadow/pv.c         | 24 +++++++--------------
 xen/arch/x86/pv/mm.h                | 13 ++---------
 xen/arch/x86/pv/ro-page-fault.c     |  7 +++---
 xen/include/asm-x86/paging.h        | 21 +++++++++---------
 xen/include/asm-x86/x86_64/system.h | 43 -------------------------------------
 7 files changed, 30 insertions(+), 90 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d1cfc8fb4a..8c8f054186 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4033,8 +4033,8 @@ long do_mmu_update(
 
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
-                    if ( paging_write_guest_entry(v, va, req.val, mfn) )
-                        rc = 0;
+                    paging_write_guest_entry(v, va, req.val, mfn);
+                    rc = 0;
                     break;
                 }
                 page_unlock(page);
@@ -4044,9 +4044,9 @@ long do_mmu_update(
             else if ( get_page_type(page, PGT_writable_page) )
             {
                 perfc_incr(writable_mmu_updates);
-                if ( paging_write_guest_entry(v, va, req.val, mfn) )
-                    rc = 0;
+                paging_write_guest_entry(v, va, req.val, mfn);
                 put_page_type(page);
+                rc = 0;
             }
 
             put_page(page);
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 0a8927f49e..fd72f4afb0 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -396,9 +396,9 @@ int shadow_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
                            unsigned int level);
 
 /* Functions that atomically write PV guest PT entries */
-bool sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
+void sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
                           mfn_t gmfn);
-bool sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
+void sh_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.
diff --git a/xen/arch/x86/mm/shadow/pv.c b/xen/arch/x86/mm/shadow/pv.c
index 25dca1eb25..ac779afce1 100644
--- a/xen/arch/x86/mm/shadow/pv.c
+++ b/xen/arch/x86/mm/shadow/pv.c
@@ -26,43 +26,35 @@
 
 /*
  * Write a new value into the guest pagetable, and update the shadows
- * appropriately.  Returns false if we page-faulted, true for success.
+ * appropriately.
  */
-bool
+void
 sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 {
-    unsigned 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));
+    write_atomic(p, 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 false if we page-faulted, true if not.
+ * appropriately.
  * N.B. caller should check the value of "old" to see if the cmpxchg itself
  * was successful.
  */
-bool
+void
 sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
                        intpte_t new, mfn_t gmfn)
 {
-    bool failed;
-    intpte_t t = *old;
+    intpte_t t;
 
     paging_lock(v->domain);
-    failed = cmpxchg_user(p, t, new);
+    t = cmpxchg(p, *old, new);
     if ( t == *old )
         sh_validate_guest_entry(v, gmfn, p, sizeof(new));
     *old = t;
     paging_unlock(v->domain);
-
-    return !failed;
 }
 
 /*
diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
index a1bd473b29..f537e58a8d 100644
--- a/xen/arch/x86/pv/mm.h
+++ b/xen/arch/x86/pv/mm.h
@@ -43,9 +43,7 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
 
 #ifndef PTE_UPDATE_WITH_CMPXCHG
     if ( !preserve_ad )
-    {
-        rv = paging_write_guest_entry(v, p, new, mfn);
-    }
+        paging_write_guest_entry(v, p, new, mfn);
     else
 #endif
     {
@@ -58,14 +56,7 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
             if ( preserve_ad )
                 _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
 
-            rv = paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
-            if ( unlikely(rv == 0) )
-            {
-                gdprintk(XENLOG_WARNING,
-                         "Failed to update %" PRIpte " -> %" PRIpte
-                         ": saw %" PRIpte "\n", old, _new, t);
-                break;
-            }
+            paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
 
             if ( t == old )
                 break;
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 556ee7ca11..8468f9e9bb 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -168,10 +168,9 @@ static int ptwr_emulated_update(unsigned long addr, intpte_t *p_old,
     if ( p_old )
     {
         ol1e = l1e_from_intpte(old);
-        if ( !paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e),
-                                         &old, l1e_get_intpte(nl1e), mfn) )
-            ret = X86EMUL_UNHANDLEABLE;
-        else if ( l1e_get_intpte(ol1e) == old )
+        paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), &old,
+                                   l1e_get_intpte(nl1e), mfn);
+        if ( l1e_get_intpte(ol1e) == old )
             ret = X86EMUL_OKAY;
         else
         {
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 87ce135b8c..4a26f30c81 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -100,9 +100,9 @@ struct shadow_paging_mode {
 #ifdef CONFIG_SHADOW_PAGING
     void          (*detach_old_tables     )(struct vcpu *v);
 #ifdef CONFIG_PV
-    bool          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
+    void          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
                                             intpte_t new, mfn_t gmfn);
-    bool          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
+    void          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
                                             intpte_t *old, intpte_t new,
                                             mfn_t gmfn);
 #endif
@@ -333,15 +333,15 @@ static inline void paging_update_paging_modes(struct vcpu *v)
  * paging-assistance state appropriately.  Returns false if we page-faulted,
  * true for success.
  */
-static inline bool paging_write_guest_entry(
+static inline void paging_write_guest_entry(
     struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        return paging_get_hostmode(v)->shadow.write_guest_entry(v, p, new,
-                                                                gmfn);
+        paging_get_hostmode(v)->shadow.write_guest_entry(v, p, new, gmfn);
+    else
 #endif
-    return !__copy_to_user(p, &new, sizeof(new));
+        write_atomic(p, new);
 }
 
 
@@ -351,15 +351,16 @@ static inline bool paging_write_guest_entry(
  * true if not.  N.B. caller should check the value of "old" to see if the
  * cmpxchg itself was successful.
  */
-static inline bool paging_cmpxchg_guest_entry(
+static inline void paging_cmpxchg_guest_entry(
     struct vcpu *v, intpte_t *p, intpte_t *old, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        return paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
-                                                                  new, gmfn);
+        paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
+                                                           new, gmfn);
+    else
 #endif
-    return !cmpxchg_user(p, *old, new);
+        *old = cmpxchg(p, *old, new);
 }
 
 #endif /* CONFIG_PV */
diff --git a/xen/include/asm-x86/x86_64/system.h b/xen/include/asm-x86/x86_64/system.h
index f471859c19..e94371cf20 100644
--- a/xen/include/asm-x86/x86_64/system.h
+++ b/xen/include/asm-x86/x86_64/system.h
@@ -59,47 +59,4 @@ static always_inline __uint128_t cmpxchg16b_local_(
     __cmpxchg16b(_p, (void *)(o), (void *)(n));            \
 })
 
-/*
- * This function causes value _o to be changed to _n at location _p.
- * If this access causes a fault then we return 1, otherwise we return 0.
- * If no fault occurs then _o is updated to the value we saw at _p. If this
- * is the same as the initial value of _o then _n is written to location _p.
- */
-#define __cmpxchg_user(_p, _o, _n, _oppre, _regtype)                    \
-    stac();                                                             \
-    asm volatile (                                                      \
-        "1: lock cmpxchg %"_oppre"[new], %[ptr]\n"                      \
-        "2:\n"                                                          \
-        ".section .fixup,\"ax\"\n"                                      \
-        "3:     movl $1, %[rc]\n"                                       \
-        "       jmp 2b\n"                                               \
-        ".previous\n"                                                   \
-        _ASM_EXTABLE(1b, 3b)                                            \
-        : "+a" (_o), [rc] "=r" (_rc),                                   \
-          [ptr] "+m" (*(volatile typeof(*(_p)) *)(_p))                  \
-        : [new] _regtype (_n), "[rc]" (0)                               \
-        : "memory");                                                    \
-    clac()
-
-#define cmpxchg_user(_p, _o, _n)                                        \
-({                                                                      \
-    int _rc;                                                            \
-    switch ( sizeof(*(_p)) )                                            \
-    {                                                                   \
-    case 1:                                                             \
-        __cmpxchg_user(_p, _o, _n, "b", "q");                           \
-        break;                                                          \
-    case 2:                                                             \
-        __cmpxchg_user(_p, _o, _n, "w", "r");                           \
-        break;                                                          \
-    case 4:                                                             \
-        __cmpxchg_user(_p, _o, _n, "k", "r");                           \
-        break;                                                          \
-    case 8:                                                             \
-        __cmpxchg_user(_p, _o, _n, "q", "r");                           \
-        break;                                                          \
-    }                                                                   \
-    _rc;                                                                \
-})
-
 #endif /* __X86_64_SYSTEM_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:34:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3236.9409 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEi-0007pD-83; Tue, 06 Oct 2020 11:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3236.9409; Tue, 06 Oct 2020 11:34:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEi-0007p5-4y; Tue, 06 Oct 2020 11:34:28 +0000
Received: by outflank-mailman (input) for mailman id 3236;
 Tue, 06 Oct 2020 11:34:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlEg-0007ov-UI
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8630110a-7486-4947-8f2d-8d00a72e5bfc;
 Tue, 06 Oct 2020 11:34:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEf-0002eA-NV
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEf-0003jn-Mh
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlEg-0007ov-UI
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:26 +0000
X-Inumbo-ID: 8630110a-7486-4947-8f2d-8d00a72e5bfc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8630110a-7486-4947-8f2d-8d00a72e5bfc;
	Tue, 06 Oct 2020 11:34:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a4YB770/YH3wP4Q25QPEA8Fb9Cb3FN0YqpqU1yzXX3Q=; b=4wkJ/Z75/Id+5PcBIU+q/2aMG2
	U54YamOBMexri1PHLKbui+CTzz0Kx2J1QRSsVa+b7n4WfqfgBoFdJQ7YEGTQz4ZvIbAO8hpevqSGJ
	xsRRrS8uA1oQ7LcTSyBOpbTSu/FHOfPW/mrlfgOjGkcinct61dIKJV5utfpe3uGf6uSI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEf-0002eA-NV
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEf-0003jn-Mh
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: remove some indirection from {paging,sh}_cmpxchg_guest_entry()
Message-Id: <E1kPlEf-0003jn-Mh@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:34:25 +0000

commit 30bfa535fa9de47c47d0655e502eaf23724f837b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 13:58:14 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/mm: remove some indirection from {paging,sh}_cmpxchg_guest_entry()
    
    Make the functions more similar to cmpxchg() in that they now take an
    integral "old" input and return the value read.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/private.h |  4 ++--
 xen/arch/x86/mm/shadow/pv.c      | 16 ++++++++--------
 xen/arch/x86/pv/mm.h             |  6 ++----
 xen/arch/x86/pv/ro-page-fault.c  |  4 ++--
 xen/include/asm-x86/paging.h     | 15 +++++++--------
 5 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index fd72f4afb0..992461d4bc 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -398,8 +398,8 @@ int shadow_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
 /* Functions that atomically write PV guest PT entries */
 void sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
                           mfn_t gmfn);
-void sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
-                            intpte_t new, mfn_t gmfn);
+intpte_t sh_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/pv.c b/xen/arch/x86/mm/shadow/pv.c
index ac779afce1..f51f980f26 100644
--- a/xen/arch/x86/mm/shadow/pv.c
+++ b/xen/arch/x86/mm/shadow/pv.c
@@ -39,22 +39,22 @@ sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 
 /*
  * Cmpxchg a new value into the guest pagetable, and update the shadows
- * appropriately.
- * N.B. caller should check the value of "old" to see if the cmpxchg itself
- * was successful.
+ * appropriately.  Returns the previous entry found, which the caller is
+ * expected to check to see if the cmpxchg was successful.
  */
-void
-sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
+intpte_t
+sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t old,
                        intpte_t new, mfn_t gmfn)
 {
     intpte_t t;
 
     paging_lock(v->domain);
-    t = cmpxchg(p, *old, new);
-    if ( t == *old )
+    t = cmpxchg(p, old, new);
+    if ( t == old )
         sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    *old = t;
     paging_unlock(v->domain);
+
+    return t;
 }
 
 /*
diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
index f537e58a8d..b1b66e46c8 100644
--- a/xen/arch/x86/pv/mm.h
+++ b/xen/arch/x86/pv/mm.h
@@ -47,16 +47,14 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
     else
 #endif
     {
-        intpte_t t = old;
-
         for ( ; ; )
         {
-            intpte_t _new = new;
+            intpte_t _new = new, t;
 
             if ( preserve_ad )
                 _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
 
-            paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
+            t = paging_cmpxchg_guest_entry(v, p, old, _new, mfn);
 
             if ( t == old )
                 break;
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 8468f9e9bb..7f6fbc92fb 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -168,8 +168,8 @@ static int ptwr_emulated_update(unsigned long addr, intpte_t *p_old,
     if ( p_old )
     {
         ol1e = l1e_from_intpte(old);
-        paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), &old,
-                                   l1e_get_intpte(nl1e), mfn);
+        old = paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), old,
+                                         l1e_get_intpte(nl1e), mfn);
         if ( l1e_get_intpte(ol1e) == old )
             ret = X86EMUL_OKAY;
         else
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 4a26f30c81..61534da538 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -102,8 +102,8 @@ struct shadow_paging_mode {
 #ifdef CONFIG_PV
     void          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
                                             intpte_t new, mfn_t gmfn);
-    void          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
-                                            intpte_t *old, intpte_t new,
+    intpte_t      (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
+                                            intpte_t old, intpte_t new,
                                             mfn_t gmfn);
 #endif
 #ifdef CONFIG_HVM
@@ -351,16 +351,15 @@ static inline void paging_write_guest_entry(
  * true if not.  N.B. caller should check the value of "old" to see if the
  * cmpxchg itself was successful.
  */
-static inline void paging_cmpxchg_guest_entry(
-    struct vcpu *v, intpte_t *p, intpte_t *old, intpte_t new, mfn_t gmfn)
+static inline intpte_t paging_cmpxchg_guest_entry(
+    struct vcpu *v, intpte_t *p, intpte_t old, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
-                                                           new, gmfn);
-    else
+        return paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
+                                                                  new, gmfn);
 #endif
-        *old = cmpxchg(p, *old, new);
+    return cmpxchg(p, old, new);
 }
 
 #endif /* CONFIG_PV */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:34:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3237.9413 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEr-0007qQ-A2; Tue, 06 Oct 2020 11:34:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3237.9413; Tue, 06 Oct 2020 11:34:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlEr-0007qI-6Z; Tue, 06 Oct 2020 11:34:37 +0000
Received: by outflank-mailman (input) for mailman id 3237;
 Tue, 06 Oct 2020 11:34:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlEq-0007qA-Jn
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e615d80b-587e-4be0-89fb-fac4b8d787ae;
 Tue, 06 Oct 2020 11:34:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEp-0002eI-QK
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEp-0003kh-Pf
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlEq-0007qA-Jn
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:36 +0000
X-Inumbo-ID: e615d80b-587e-4be0-89fb-fac4b8d787ae
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e615d80b-587e-4be0-89fb-fac4b8d787ae;
	Tue, 06 Oct 2020 11:34:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mFJTSwli/OnepbYoOrvbOpvSg3PZ3xPaWNN45V4hQfw=; b=rXt6Z2lRVdQbECmGu6rToC9/bb
	xVn0W/W+wHYYR6yqVkOjJ6xRP2UqpgR70+YHqZ9axmOKg9H0TAMYho6pSMmYiiu5SSGAv8JYgUZp0
	Eqxyqw8rb/S3PTv8Y/dSppEgQeeH8MXuo8mIUqJxoB3Oe0Jmc4qJfY/1sC184h7KJMms=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEp-0002eI-QK
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEp-0003kh-Pf
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/S3: Restore CR4 earlier during resume
Message-Id: <E1kPlEp-0003kh-Pf@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:34:35 +0000

commit 7f66c0dc41ae5f770c614e516810eb1f336e2470
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 18:49:32 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/S3: Restore CR4 earlier during resume
    
    c/s 4304ff420e5 "x86/S3: Drop {save,restore}_rest_processor_state()
    completely" moved CR4 restoration up into C, to account for the fact that MCE
    was explicitly handled later.
    
    However, time_resume() ends up making an EFI Runtime Service call, and EFI
    explodes without OSFXSR, presumably when trying to spill %xmm registers onto
    the stack.
    
    Given this codepath, and the potential for other issues of a similar kind (TLB
    flushing vs INVPCID, HVM logic vs VMXE, etc), restore CR4 in asm before
    entering C.
    
    Ignore the previous MCE special case, because its not actually necessary.  The
    handler is already suitably configured from before suspend.
    
    Fixes: 4304ff420e5 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/acpi/power.c       | 3 ---
 xen/arch/x86/acpi/wakeup_prot.S | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 4fb1e7a148..7f162a4df9 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -276,9 +276,6 @@ static int enter_state(u32 state)
 
     mcheck_init(&boot_cpu_data, false);
 
-    /* Restore CR4 from cached value, now MCE is set up. */
-    write_cr4(read_cr4());
-
     printk(XENLOG_INFO "Finishing wakeup from ACPI S%d state.\n", state);
 
     if ( (state == ACPI_STATE_S3) && error )
diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index c6b3fcc93d..15052c300f 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -1,3 +1,4 @@
+#include <asm/asm_defns.h>
 #include <asm/msr-index.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -110,6 +111,11 @@ ENTRY(s3_resume)
 
         call    load_system_tables
 
+        /* Restore CR4 from the cpuinfo block. */
+        GET_STACK_END(bx)
+        mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
+        mov     %rax, %cr4
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 06 11:34:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Oct 2020 11:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3238.9417 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlF2-0007rr-BG; Tue, 06 Oct 2020 11:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3238.9417; Tue, 06 Oct 2020 11:34:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kPlF2-0007rj-8L; Tue, 06 Oct 2020 11:34:48 +0000
Received: by outflank-mailman (input) for mailman id 3238;
 Tue, 06 Oct 2020 11:34:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kPlF0-0007ra-Nc
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e863914b-0547-4fe1-8e7a-a7a1c6860531;
 Tue, 06 Oct 2020 11:34:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEz-0002er-Sy
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kPlEz-0003le-SJ
 for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=sof6=DN=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kPlF0-0007ra-Nc
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:46 +0000
X-Inumbo-ID: e863914b-0547-4fe1-8e7a-a7a1c6860531
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e863914b-0547-4fe1-8e7a-a7a1c6860531;
	Tue, 06 Oct 2020 11:34:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fEM2VFmK1T7mrhe06jR2azAR/Em6JHn+NOInhuh4KDY=; b=kNO9B57H/+84qIpmCjkylBapt9
	jR2Y5iwnRF1l520I82Yx+B/YIFbwEk/CWuONuVw2a8OGDkGWbNSikaxpFS6AgyR4ZOOUSnvXk+T9j
	Uw8HwXWha7mrdnr5bzBtl6aoDqAjdKUD/DeR00SGMkt+PezqrpnUdzZTT5oOFGvsRocU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEz-0002er-Sy
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kPlEz-0003le-SJ
	for xen-changelog@lists.xenproject.org; Tue, 06 Oct 2020 11:34:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vpic: also execute dpci callback for non-specific EOI
Message-Id: <E1kPlEz-0003le-SJ@xenbits.xenproject.org>
Date: Tue, 06 Oct 2020 11:34:45 +0000

commit 93508595d588afe9dca087f95200effb7cedc81f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Aug 20 17:16:27 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/vpic: also execute dpci callback for non-specific EOI
    
    Currently the dpci EOI callback is only executed for specific EOIs.
    This is wrong as non-specific EOIs will also clear the ISR bit and
    thus end the interrupt. Re-arrange the code a bit so that the common
    EOI handling path can be shared between all EOI modes.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index feb1db2ee3..3cf12581e9 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -249,15 +249,15 @@ static void vpic_ioport_write(
                 if ( priority == VPIC_PRIO_NONE )
                     break;
                 pin = (priority + vpic->priority_add) & 7;
-                vpic->isr &= ~(1 << pin);
-                if ( cmd == 5 )
-                    vpic->priority_add = (pin + 1) & 7;
-                break;
+                goto common_eoi;
+
             case 3: /* Specific EOI                */
             case 7: /* Specific EOI & Rotate       */
                 pin = val & 7;
+
+            common_eoi:
                 vpic->isr &= ~(1 << pin);
-                if ( cmd == 7 )
+                if ( cmd == 7 || cmd == 5 )
                     vpic->priority_add = (pin + 1) & 7;
                 /* Release lock and EOI the physical interrupt (if any). */
                 vpic_update_int_output(vpic);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 11:11:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 11:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3441.9906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQ7Lh-0000zX-As; Wed, 07 Oct 2020 11:11:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3441.9906; Wed, 07 Oct 2020 11:11:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQ7Lh-0000zM-77; Wed, 07 Oct 2020 11:11:09 +0000
Received: by outflank-mailman (input) for mailman id 3441;
 Wed, 07 Oct 2020 11:11:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQ7Lf-0000z8-HU
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 080c175c-8b62-417a-bf45-0f2f85a6c176;
 Wed, 07 Oct 2020 11:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQ7Lc-0001wv-QA
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQ7Lc-0006cP-OM
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQ7Lf-0000z8-HU
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:07 +0000
X-Inumbo-ID: 080c175c-8b62-417a-bf45-0f2f85a6c176
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 080c175c-8b62-417a-bf45-0f2f85a6c176;
	Wed, 07 Oct 2020 11:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2nqubKpQjD2NTOHEoUG3Z9fqlFRIi3L9EUw2BN01KEU=; b=oK1pJv/h2Dz1d4gsM5faDnvGh5
	6qpD375lBKBwNn0FGLmeadIIpnILlD7RqoRynv4WIr7WDC8jAEoI+LDnESatJHbVvynY8my/K0CIJ
	sR3E7Nlla6jJc4N2URS8njT5u4bYxgx4rr9AP89NAwQI+tHJ3k00O8t29BhlOa9HReK0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQ7Lc-0001wv-QA
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQ7Lc-0006cP-OM
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 11:11:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: always use BASEDIR for xen sub-directory
Message-Id: <E1kQ7Lc-0006cP-OM@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 11:11:04 +0000

commit e4e64408f5c755da3bf7bfd78e70ad9f6c448376
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Fri Oct 2 11:42:09 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Oct 7 11:09:22 2020 +0000

    build: always use BASEDIR for xen sub-directory
    
    Modify Makefiles using $(XEN_ROOT)/xen to use $(BASEDIR) instead.
    
    This is removing the dependency to xen subdirectory preventing using a
    wrong configuration file when xen subdirectory is duplicated for
    compilation tests.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 4 ++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index b3b60a1ba2..083f62acb6 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index 408d69c99e..f1229b9bc8 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -3,6 +3,6 @@ include $(XEN_ROOT)/Config.mk
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
+	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 065f4b8471..799321ec4d 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(XEN_ROOT)/xen
+srctree := $(BASEDIR)
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 50bec20a1e..637159ad82 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 15:11:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 15:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3551.10163 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQB60-00024j-AC; Wed, 07 Oct 2020 15:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3551.10163; Wed, 07 Oct 2020 15:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQB60-00024b-7F; Wed, 07 Oct 2020 15:11:12 +0000
Received: by outflank-mailman (input) for mailman id 3551;
 Wed, 07 Oct 2020 15:11:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQB5y-00024W-Cb
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fa413413-34e2-4408-9b04-18c973777b36;
 Wed, 07 Oct 2020 15:11:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQB5w-00071H-Bd
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQB5w-0008AV-8L
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQB5y-00024W-Cb
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:10 +0000
X-Inumbo-ID: fa413413-34e2-4408-9b04-18c973777b36
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fa413413-34e2-4408-9b04-18c973777b36;
	Wed, 07 Oct 2020 15:11:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LpjdKk9DooN502Awmr9N74oiqsRDW1NkvnB+x40QwBA=; b=uaSpUeVsJr7sOtCotTGyZvhHNV
	ZZ+TzFmrfwqGj02K7D5VgIbhFQ7IYIFokck+82tJ6F4f/ZOroYvB/cHEAHs7noMr0PlMXrz+2NHlc
	rOOVOMz0Mi1zMkbTd7xNOdKcGo4UfwRGCS8xrJYMUypyMAS/hhsbRrhiir82bieydow0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQB5w-00071H-Bd
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQB5w-0008AV-8L
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 15:11:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Revert "build: always use BASEDIR for xen sub-directory"
Message-Id: <E1kQB5w-0008AV-8L@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 15:11:08 +0000

commit 7a519f8bda6f3505a4c1fbf277f002aa0c12ab9a
Author:     Wei Liu <wl@xen.org>
AuthorDate: Wed Oct 7 14:59:51 2020 +0000
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Oct 7 14:59:51 2020 +0000

    Revert "build: always use BASEDIR for xen sub-directory"
    
    This reverts commit e4e64408f5c755da3bf7bfd78e70ad9f6c448376.
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 4 ++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index 083f62acb6..b3b60a1ba2 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(BASEDIR)/tools/binfile
-	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(XEN_ROOT)/xen/tools/binfile
+	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index f1229b9bc8..408d69c99e 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -3,6 +3,6 @@ include $(XEN_ROOT)/Config.mk
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
-	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
+	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 799321ec4d..065f4b8471 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(BASEDIR)
+srctree := $(XEN_ROOT)/xen
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 637159ad82..50bec20a1e 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(BASEDIR)/tools/binfile
-	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
+	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3591.10275 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJJ-0000Z7-Mv; Wed, 07 Oct 2020 17:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3591.10275; Wed, 07 Oct 2020 17:33:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJJ-0000Yz-Jv; Wed, 07 Oct 2020 17:33:05 +0000
Received: by outflank-mailman (input) for mailman id 3591;
 Wed, 07 Oct 2020 17:33:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDJI-0000Yu-LS
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9ac49b36-62c7-4de0-8a52-9b8baba1e338;
 Wed, 07 Oct 2020 17:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJG-000280-I0
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJG-0004ta-Dh
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDJI-0000Yu-LS
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:04 +0000
X-Inumbo-ID: 9ac49b36-62c7-4de0-8a52-9b8baba1e338
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9ac49b36-62c7-4de0-8a52-9b8baba1e338;
	Wed, 07 Oct 2020 17:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QqTYpEVa2GEMONHoZyuVxldO5neBXNiDuR0sqemGw7I=; b=mb9UH6BMVxlhitw8Yxf9ZBvAq6
	Uvvgg+HA8zTK5BpxTWheA8fwPj+6JXrxllBMX2cEtqG0XGGsfKjhPDfh6VexRXghzzCRGXsWSXWdD
	y2j+w87TivTE/T1QPzh42VCc47ohJfIzLTMEchATLdt9gN4xwr+juKOBQ0bqsdfwMx4E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJG-000280-I0
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJG-0004ta-Dh
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Simplify DOMCTL_CDF_ flags handling in libxl__domain_make()
Message-Id: <E1kQDJG-0004ta-Dh@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:02 +0000

commit 346b11561906840e29ca82d5569a51f6668d3a6a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 18:39:08 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    tools/libxl: Simplify DOMCTL_CDF_ flags handling in libxl__domain_make()
    
    The use of the ternary operator serves only to obfuscate the code.  Rewrite it
    in more simple terms, avoiding the need to conditionally OR zero into the
    flags.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_create.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index 9a6e92b3a5..df31a42124 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -611,10 +611,12 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
         if (info->type != LIBXL_DOMAIN_TYPE_PV) {
             create.flags |= XEN_DOMCTL_CDF_hvm;
-            create.flags |=
-                libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
-            create.flags |=
-                libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
+
+            if ( libxl_defbool_val(info->hap) )
+                create.flags |= XEN_DOMCTL_CDF_hap;
+
+            if ( !libxl_defbool_val(info->oos) )
+                create.flags |= XEN_DOMCTL_CDF_oos_off;
         }
 
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3592.10279 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJT-0000Zr-OV; Wed, 07 Oct 2020 17:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3592.10279; Wed, 07 Oct 2020 17:33:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJT-0000Zj-LV; Wed, 07 Oct 2020 17:33:15 +0000
Received: by outflank-mailman (input) for mailman id 3592;
 Wed, 07 Oct 2020 17:33:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDJS-0000Zd-6o
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1dadabd6-da61-484d-93eb-6a97222c13ec;
 Wed, 07 Oct 2020 17:33:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJQ-000284-LL
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJQ-0004uP-KP
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDJS-0000Zd-6o
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:14 +0000
X-Inumbo-ID: 1dadabd6-da61-484d-93eb-6a97222c13ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1dadabd6-da61-484d-93eb-6a97222c13ec;
	Wed, 07 Oct 2020 17:33:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PBK5/VqmO3LgJahX1+3DKCiNBKB6xY6yvig/cIP4BSU=; b=StgQCtCbBKLoab1tz2rXVPrbjU
	H0v8ZtXG82JDm5wXlo+QzC9seH9VVsdyd107CgWVYEZx2joZ4+uRKXy1EJ1F7luMvGeG4TsdDcAup
	JSPHPPcD2Zj1UNbZELMBy+J00gmnSh7Ev2AiWy3EN8qx2zHgYXM1waSmHagDXZrJUccg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJQ-000284-LL
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJQ-0004uP-KP
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domctl: Simplify DOMCTL_CDF_ checking logic
Message-Id: <E1kQDJQ-0004uP-KP@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:12 +0000

commit 45264e0669c0874c9058f7c7de24d5c45a425664
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:56:35 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/domctl: Simplify DOMCTL_CDF_ checking logic
    
    Introduce some local variables to make the resulting logic easier to follow.
    Join the two IOMMU checks in sanitise_domain_config().  Tweak some of the
    terminology for better accuracy.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/domain.c |  7 ++++---
 xen/common/domain.c   | 45 +++++++++++++++++++++++++++------------------
 2 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 7e16d49bfd..d8f9be132c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -629,6 +629,7 @@ void arch_vcpu_destroy(struct vcpu *v)
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
+    bool hap = config->flags & XEN_DOMCTL_CDF_hap;
     unsigned int max_vcpus;
 
     if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -653,13 +654,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( (config->flags & XEN_DOMCTL_CDF_hap) && !hvm_hap_supported() )
+    if ( hap && !hvm_hap_supported() )
     {
-        dprintk(XENLOG_INFO, "HAP requested but not supported\n");
+        dprintk(XENLOG_INFO, "HAP requested but not available\n");
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) )
+    if ( !hvm )
         /*
          * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
          * for HVM guests.
diff --git a/xen/common/domain.c b/xen/common/domain.c
index c4a480fa14..a877eacc09 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -299,6 +299,10 @@ static void _domain_destroy(struct domain *d)
 
 static int sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
+    bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
+    bool hap = config->flags & XEN_DOMCTL_CDF_hap;
+    bool iommu = config->flags & XEN_DOMCTL_CDF_iommu;
+
     if ( config->flags & ~(XEN_DOMCTL_CDF_hvm |
                            XEN_DOMCTL_CDF_hap |
                            XEN_DOMCTL_CDF_s3_integrity |
@@ -310,36 +314,41 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
-    {
-        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
-        return -EINVAL;
-    }
-
-    if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
-    {
-        dprintk(XENLOG_INFO,
-                "IOMMU options specified but IOMMU not enabled\n");
-        return -EINVAL;
-    }
-
     if ( config->max_vcpus < 1 )
     {
         dprintk(XENLOG_INFO, "No vCPUS\n");
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) &&
-         (config->flags & XEN_DOMCTL_CDF_hap) )
+    if ( hap && !hvm )
     {
         dprintk(XENLOG_INFO, "HAP requested for non-HVM guest\n");
         return -EINVAL;
     }
 
-    if ( (config->flags & XEN_DOMCTL_CDF_iommu) && !iommu_enabled )
+    if ( iommu )
     {
-        dprintk(XENLOG_INFO, "IOMMU is not enabled\n");
-        return -EINVAL;
+        if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+        {
+            dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n",
+                    config->iommu_opts);
+            return -EINVAL;
+        }
+
+        if ( !iommu_enabled )
+        {
+            dprintk(XENLOG_INFO, "IOMMU requested but not available\n");
+            return -EINVAL;
+        }
+    }
+    else
+    {
+        if ( config->iommu_opts )
+        {
+            dprintk(XENLOG_INFO,
+                    "IOMMU options specified but IOMMU not requested\n");
+            return -EINVAL;
+        }
     }
 
     return arch_sanitise_domain_config(config);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3593.10283 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJc-0000bC-QG; Wed, 07 Oct 2020 17:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3593.10283; Wed, 07 Oct 2020 17:33:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJc-0000b4-N3; Wed, 07 Oct 2020 17:33:24 +0000
Received: by outflank-mailman (input) for mailman id 3593;
 Wed, 07 Oct 2020 17:33:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDJb-0000av-Oq
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 112583f3-b332-42db-9cac-5553b8b80819;
 Wed, 07 Oct 2020 17:33:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJa-00028D-P9
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJa-0004v3-Nu
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDJb-0000av-Oq
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:23 +0000
X-Inumbo-ID: 112583f3-b332-42db-9cac-5553b8b80819
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 112583f3-b332-42db-9cac-5553b8b80819;
	Wed, 07 Oct 2020 17:33:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7tEex+g8/B2motx61a7bXPyHsxYloOYYYzSuQ9oa4t4=; b=2zY/4NgErROKwy/qrwp0BrYgzD
	LqSf600rXYtVMgr0Mq3c4ZU3McGNMw/kWsy0dtvdM0jbVKIhiO9O7aITpz5JWes8sJitVV8z8hyyt
	jYrezavOgODNLLvnbTX40O2HvqdosVobZZnWXtr/6MC3/KI5p+LytqK7Ge886Eb7b12Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJa-00028D-P9
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJa-0004v3-Nu
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domctl: Introduce and use XEN_DOMCTL_CDF_nested_virt
Message-Id: <E1kQDJa-0004v3-Nu@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:22 +0000

commit dbe399b174e471c97d63a3e3f2c00cd8c753106c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Aug 28 14:30:14 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/domctl: Introduce and use XEN_DOMCTL_CDF_nested_virt
    
    Like other major areas of functionality, nested virt (or not) needs to be
    known at domain creation time for sensible CPUID handling, and wants to be
    known this early for sensible infrastructure handling in Xen.
    
    Introduce XEN_DOMCTL_CDF_nested_virt and modify libxl to set it appropriately
    when creating domains.  There is no need to adjust the ARM logic to reject the
    use of this new flag.
    
    No functional change yet.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
---
 tools/libs/light/libxl_create.c |  3 +++
 tools/ocaml/libs/xc/xenctrl.ml  |  1 +
 tools/ocaml/libs/xc/xenctrl.mli |  1 +
 xen/arch/x86/domain.c           |  7 +++++++
 xen/common/domain.c             | 11 +++++------
 xen/include/public/domctl.h     |  4 +++-
 6 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index df31a42124..321a13e519 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -617,6 +617,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
 
             if ( !libxl_defbool_val(info->oos) )
                 create.flags |= XEN_DOMCTL_CDF_oos_off;
+
+            if ( libxl_defbool_val(b_info->nested_hvm) )
+                create.flags |= XEN_DOMCTL_CDF_nested_virt;
         }
 
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 497ded7ce2..e878699b0a 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -64,6 +64,7 @@ type domain_create_flag =
 	| CDF_OOS_OFF
 	| CDF_XS_DOMAIN
 	| CDF_IOMMU
+	| CDF_NESTED_VIRT
 
 type domain_create_iommu_opts =
 	| IOMMU_NO_SHAREPT
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index f7f6ec570d..e64907df8e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -57,6 +57,7 @@ type domain_create_flag =
   | CDF_OOS_OFF
   | CDF_XS_DOMAIN
   | CDF_IOMMU
+  | CDF_NESTED_VIRT
 
 type domain_create_iommu_opts =
   | IOMMU_NO_SHAREPT
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d8f9be132c..5454f94d18 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -630,6 +630,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
     bool hap = config->flags & XEN_DOMCTL_CDF_hap;
+    bool nested_virt = config->flags & XEN_DOMCTL_CDF_nested_virt;
     unsigned int max_vcpus;
 
     if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -667,6 +668,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
          */
         config->flags |= XEN_DOMCTL_CDF_oos_off;
 
+    if ( nested_virt && !hap )
+    {
+        dprintk(XENLOG_INFO, "Nested virt not supported without HAP\n");
+        return -EINVAL;
+    }
+
     return 0;
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index a877eacc09..f748806a45 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -303,12 +303,11 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
     bool hap = config->flags & XEN_DOMCTL_CDF_hap;
     bool iommu = config->flags & XEN_DOMCTL_CDF_iommu;
 
-    if ( config->flags & ~(XEN_DOMCTL_CDF_hvm |
-                           XEN_DOMCTL_CDF_hap |
-                           XEN_DOMCTL_CDF_s3_integrity |
-                           XEN_DOMCTL_CDF_oos_off |
-                           XEN_DOMCTL_CDF_xs_domain |
-                           XEN_DOMCTL_CDF_iommu) )
+    if ( config->flags &
+         ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
+           XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off |
+           XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu |
+           XEN_DOMCTL_CDF_nested_virt) )
     {
         dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags);
         return -EINVAL;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 791f0a2592..666aeb71bf 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -68,9 +68,11 @@ struct xen_domctl_createdomain {
  /* Should this domain be permitted to use the IOMMU? */
 #define _XEN_DOMCTL_CDF_iommu         5
 #define XEN_DOMCTL_CDF_iommu          (1U<<_XEN_DOMCTL_CDF_iommu)
+#define _XEN_DOMCTL_CDF_nested_virt   6
+#define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
 
 /* Max XEN_DOMCTL_CDF_* constant.  Used for ABI checking. */
-#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_iommu
+#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_nested_virt
 
     uint32_t flags;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3594.10287 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJn-0000ct-SN; Wed, 07 Oct 2020 17:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3594.10287; Wed, 07 Oct 2020 17:33:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJn-0000cl-On; Wed, 07 Oct 2020 17:33:35 +0000
Received: by outflank-mailman (input) for mailman id 3594;
 Wed, 07 Oct 2020 17:33:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDJm-0000cb-94
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c4aa2843-9ae0-4a5c-b569-9a1ea2c0eb9c;
 Wed, 07 Oct 2020 17:33:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJk-00028o-TK
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJk-0004vb-Rc
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDJm-0000cb-94
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:34 +0000
X-Inumbo-ID: c4aa2843-9ae0-4a5c-b569-9a1ea2c0eb9c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c4aa2843-9ae0-4a5c-b569-9a1ea2c0eb9c;
	Wed, 07 Oct 2020 17:33:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AerXkH+pOJCMjov54+uaD3b7xANMf1v6oVY7+lf0h1Y=; b=6Ognn27c/4zx2JEBSQEaJ4o1Gb
	4ojo5KPv6FaS1b7IYWS0KQ8nb/7mqqSfP6X1iouTwiTZy7CtPAne3yLoqdKZBOgpB07zMxTWXXmIy
	8SSkqj60CAKFGRYp5UhiLWljlts4e7sXLf5AUO4iiNJ9kwleoBreIqCjlMYR8lCBTHYM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJk-00028o-TK
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJk-0004vb-Rc
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM
Message-Id: <E1kQDJk-0004vb-Rc@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:32 +0000

commit f5bdb4aaa165c6fe1d2c42e1d67619e7d8217cdd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/hvm: Obsolete the use of HVM_PARAM_NESTEDHVM
    
    With XEN_DOMCTL_CDF_nested_virt now passed properly to domain_create(),
    reimplement nestedhvm_enabled() to use the property which is fixed for the
    lifetime of the domain.
    
    This makes the call to nestedhvm_vcpu_initialise() from hvm_vcpu_initialise()
    no longer dead.  It became logically dead with the Xend => XL transition, as
    they initialise HVM_PARAM_NESTEDHVM in opposite orders with respect to
    XEN_DOMCTL_max_vcpus.
    
    There is one opencoded user of nestedhvm_enabled() in HVM_PARAM_ALTP2M's
    safety check.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_x86.c        |  5 -----
 xen/arch/x86/hvm/hvm.c              | 33 ++++-----------------------------
 xen/include/asm-x86/hvm/nestedhvm.h |  5 ++---
 xen/include/public/hvm/params.h     |  4 +---
 4 files changed, 7 insertions(+), 40 deletions(-)

diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 6ec6c27c83..e18274cc10 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -426,11 +426,6 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
             LOG(ERROR, "Couldn't set HVM_PARAM_TIMER_MODE");
             goto out;
         }
-        if (xc_hvm_param_set(xch, domid, HVM_PARAM_NESTEDHVM,
-                             libxl_defbool_val(info->nested_hvm))) {
-            LOG(ERROR, "Couldn't set HVM_PARAM_NESTEDHVM");
-            goto out;
-        }
         if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, altp2m)) {
             LOG(ERROR, "Couldn't set HVM_PARAM_ALTP2M");
             goto out;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 2dfda93e09..101a739952 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4086,6 +4086,7 @@ static int hvm_allow_set_param(struct domain *d,
     case HVM_PARAM_MEMORY_EVENT_CR3:
     case HVM_PARAM_MEMORY_EVENT_CR4:
     case HVM_PARAM_MEMORY_EVENT_INT3:
+    case HVM_PARAM_NESTEDHVM:
     case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
     case HVM_PARAM_BUFIOREQ_EVTCHN:
     case HVM_PARAM_MEMORY_EVENT_MSR:
@@ -4204,39 +4205,12 @@ static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value)
     case HVM_PARAM_ACPI_IOPORTS_LOCATION:
         rc = pmtimer_change_ioport(d, value);
         break;
-    case HVM_PARAM_NESTEDHVM:
-        rc = xsm_hvm_param_nested(XSM_PRIV, d);
-        if ( rc )
-            break;
-        if ( value > 1 )
-            rc = -EINVAL;
-        /*
-         * Remove the check below once we have
-         * shadow-on-shadow.
-         */
-        if ( !paging_mode_hap(d) && value )
-            rc = -EINVAL;
-        if ( value &&
-             d->arch.hvm.params[HVM_PARAM_ALTP2M] )
-            rc = -EINVAL;
-        /* Set up NHVM state for any vcpus that are already up. */
-        if ( value &&
-             !d->arch.hvm.params[HVM_PARAM_NESTEDHVM] )
-            for_each_vcpu(d, v)
-                if ( rc == 0 )
-                    rc = nestedhvm_vcpu_initialise(v);
-        if ( !value || rc )
-            for_each_vcpu(d, v)
-                nestedhvm_vcpu_destroy(v);
-        break;
     case HVM_PARAM_ALTP2M:
         rc = xsm_hvm_param_altp2mhvm(XSM_PRIV, d);
         if ( rc )
             break;
-        if ( value > XEN_ALTP2M_limited )
-            rc = -EINVAL;
-        if ( value &&
-             d->arch.hvm.params[HVM_PARAM_NESTEDHVM] )
+        if ( (value > XEN_ALTP2M_limited) ||
+             (value && nestedhvm_enabled(d)) )
             rc = -EINVAL;
         break;
     case HVM_PARAM_TRIPLE_FAULT_REASON:
@@ -4390,6 +4364,7 @@ static int hvm_allow_get_param(struct domain *d,
     case HVM_PARAM_MEMORY_EVENT_CR3:
     case HVM_PARAM_MEMORY_EVENT_CR4:
     case HVM_PARAM_MEMORY_EVENT_INT3:
+    case HVM_PARAM_NESTEDHVM:
     case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP:
     case HVM_PARAM_BUFIOREQ_EVTCHN:
     case HVM_PARAM_MEMORY_EVENT_MSR:
diff --git a/xen/include/asm-x86/hvm/nestedhvm.h b/xen/include/asm-x86/hvm/nestedhvm.h
index d9784a2e0b..d263925786 100644
--- a/xen/include/asm-x86/hvm/nestedhvm.h
+++ b/xen/include/asm-x86/hvm/nestedhvm.h
@@ -34,10 +34,9 @@ enum nestedhvm_vmexits {
 };
 
 /* Nested HVM on/off per domain */
-static always_inline bool nestedhvm_enabled(const struct domain *d)
+static inline bool nestedhvm_enabled(const struct domain *d)
 {
-    return is_hvm_domain(d) && d->arch.hvm.params &&
-        d->arch.hvm.params[HVM_PARAM_NESTEDHVM];
+    return IS_ENABLED(CONFIG_HVM) && (d->options & XEN_DOMCTL_CDF_nested_virt);
 }
 
 /* Nested VCPU */
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 0a91bfa749..0e3fdca096 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -34,6 +34,7 @@
 #define HVM_PARAM_MEMORY_EVENT_CR3          21
 #define HVM_PARAM_MEMORY_EVENT_CR4          22
 #define HVM_PARAM_MEMORY_EVENT_INT3         23
+#define HVM_PARAM_NESTEDHVM                 24
 #define HVM_PARAM_MEMORY_EVENT_SINGLE_STEP  25
 #define HVM_PARAM_BUFIOREQ_EVTCHN           26
 #define HVM_PARAM_MEMORY_EVENT_MSR          30
@@ -232,9 +233,6 @@
  */
 #define HVM_PARAM_ACPI_IOPORTS_LOCATION 19
 
-/* 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_MONITOR_RING_PFN  28
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3595.10291 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJx-0000eG-Vi; Wed, 07 Oct 2020 17:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3595.10291; Wed, 07 Oct 2020 17:33:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDJx-0000e8-Sg; Wed, 07 Oct 2020 17:33:45 +0000
Received: by outflank-mailman (input) for mailman id 3595;
 Wed, 07 Oct 2020 17:33:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDJw-0000dx-1t
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 62cdc06e-ea94-435e-9ca0-d51a62eb9bc1;
 Wed, 07 Oct 2020 17:33:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJv-00028z-0O
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDJu-0004wI-Vl
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDJw-0000dx-1t
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:44 +0000
X-Inumbo-ID: 62cdc06e-ea94-435e-9ca0-d51a62eb9bc1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 62cdc06e-ea94-435e-9ca0-d51a62eb9bc1;
	Wed, 07 Oct 2020 17:33:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hVYlKLONEP7Q1PCXnCC8g+sBfubB30qu1KinKKT4Wr8=; b=o8A8ypHA9hKmc0M1kpzs6ZGZmp
	mAFVTs5aBiF623RhQCvyA7glNAFt4jZely9+RuqcLJiHCDw+KASyZshLA/qpoqqe2Nr/tgdAAgGlo
	FBZzZJLS4M9wl03wSqgNXi+qAGv+lZ2gGCSqQ48PkiOSoTnTPdY2H2JjQ8/IJAuWkb80=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJv-00028z-0O
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDJu-0004wI-Vl
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/xsm: Drop xsm_hvm_param_nested()
Message-Id: <E1kQDJu-0004wI-Vl@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:42 +0000

commit 3600118a52e75e10800806fdd05eba13adc87347
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    xen/xsm: Drop xsm_hvm_param_nested()
    
    The sole caller has been removed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/flask/policy/modules/xen.if   | 2 +-
 xen/include/xsm/dummy.h             | 6 ------
 xen/include/xsm/xsm.h               | 6 ------
 xen/xsm/dummy.c                     | 1 -
 xen/xsm/flask/hooks.c               | 6 ------
 xen/xsm/flask/policy/access_vectors | 2 --
 6 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/tools/flask/policy/modules/xen.if b/tools/flask/policy/modules/xen.if
index 8eb2293a52..5e2aa472b6 100644
--- a/tools/flask/policy/modules/xen.if
+++ b/tools/flask/policy/modules/xen.if
@@ -59,7 +59,7 @@ define(`create_domain_common', `
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op updatemp };
 	allow $1 $2:grant setup;
 	allow $1 $2:hvm { getparam hvmctl sethvmc
-			setparam nested altp2mhvm altp2mhvm_op dm };
+			setparam altp2mhvm altp2mhvm_op dm };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 2368acebed..7ae3c40eb5 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -551,12 +551,6 @@ static XSM_INLINE int xsm_hvm_control(XSM_DEFAULT_ARG struct domain *d, unsigned
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, d);
-}
-
 static XSM_INLINE int xsm_hvm_param_altp2mhvm(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index b21c3783d3..358ec13ba8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -137,7 +137,6 @@ struct xsm_operations {
 
     int (*hvm_param) (struct domain *d, unsigned long op);
     int (*hvm_control) (struct domain *d, unsigned long op);
-    int (*hvm_param_nested) (struct domain *d);
     int (*hvm_param_altp2mhvm) (struct domain *d);
     int (*hvm_altp2mhvm_op) (struct domain *d, uint64_t mode, uint32_t op);
     int (*get_vnumainfo) (struct domain *d);
@@ -565,11 +564,6 @@ static inline int xsm_hvm_control(xsm_default_t def, struct domain *d, unsigned
     return xsm_ops->hvm_control(d, op);
 }
 
-static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
-{
-    return xsm_ops->hvm_param_nested(d);
-}
-
 static inline int xsm_hvm_param_altp2mhvm (xsm_default_t def, struct domain *d)
 {
     return xsm_ops->hvm_param_altp2mhvm(d);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index d4cce68089..9e09512144 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -106,7 +106,6 @@ void __init xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hypfs_op);
     set_to_dummy_if_null(ops, hvm_param);
     set_to_dummy_if_null(ops, hvm_control);
-    set_to_dummy_if_null(ops, hvm_param_nested);
     set_to_dummy_if_null(ops, hvm_param_altp2mhvm);
     set_to_dummy_if_null(ops, hvm_altp2mhvm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index b3addbf701..de050cc9fe 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1218,11 +1218,6 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
-static int flask_hvm_param_nested(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
-}
-
 static int flask_hvm_param_altp2mhvm(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
@@ -1826,7 +1821,6 @@ static struct xsm_operations flask_ops = {
     .hypfs_op = flask_hypfs_op,
     .hvm_param = flask_hvm_param,
     .hvm_control = flask_hvm_param,
-    .hvm_param_nested = flask_hvm_param_nested,
     .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
     .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index fde5162c7e..1aa0bb501c 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -272,8 +272,6 @@ class hvm
 #  source = domain whose memory is being shared
 #  target = client domain
     share_mem
-# HVMOP_set_param setting HVM_PARAM_NESTEDHVM
-    nested
 # HVMOP_set_param setting HVM_PARAM_ALTP2MHVM
     altp2mhvm
 # HVMOP_altp2m_set_domain_state HVMOP_altp2m_get_domain_state
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:33:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:33:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3596.10295 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDK8-0000gB-11; Wed, 07 Oct 2020 17:33:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3596.10295; Wed, 07 Oct 2020 17:33:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDK7-0000g3-UL; Wed, 07 Oct 2020 17:33:55 +0000
Received: by outflank-mailman (input) for mailman id 3596;
 Wed, 07 Oct 2020 17:33:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDK6-0000fr-8w
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bfa4278a-5b79-400a-85c1-b0dabcb69fbf;
 Wed, 07 Oct 2020 17:33:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDK5-000297-4V
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDK5-0004x7-30
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDK6-0000fr-8w
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:54 +0000
X-Inumbo-ID: bfa4278a-5b79-400a-85c1-b0dabcb69fbf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bfa4278a-5b79-400a-85c1-b0dabcb69fbf;
	Wed, 07 Oct 2020 17:33:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3r3HwHtY0BRY5TFJnGP7vGuaNk3GcyvYWbJm2oY9olE=; b=qPseH9CHx80ZUp3rwCLq27gCDP
	zRLtxnAkciNjQgrwz/K1a+9dDfVPtJ2UklGjJVOvrhN0S0qzmVk17S+IJf02DRWTdJomuj8N2f7xD
	N5rymAjlP0hlmdry1J8WokGkg3sWjwkNtu4t7Uv0c/2kaR46JtM/dxK/ZMmkCJRW3aBg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDK5-000297-4V
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDK5-0004x7-30
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:33:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Drop restore boolean from hvm_cr4_guest_valid_bits()
Message-Id: <E1kQDK5-0004x7-30@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:33:53 +0000

commit 345fd6d01e6730ea9024ae3b98e1832c35b34a28
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 29 16:51:07 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/hvm: Drop restore boolean from hvm_cr4_guest_valid_bits()
    
    Previously, migration was reordered so the CPUID data was available before
    register state.  nestedhvm_enabled() has recently been made accurate for the
    entire lifetime of the domain.
    
    Therefore, we can drop the bodge in hvm_cr4_guest_valid_bits() which existed
    previously to tolerate a guests' CR4 being set/restored before
    HVM_PARAM_NESTEDHVM.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/domain.c       | 2 +-
 xen/arch/x86/hvm/hvm.c          | 8 ++++----
 xen/arch/x86/hvm/svm/svmdebug.c | 6 ++++--
 xen/arch/x86/hvm/vmx/vmx.c      | 2 +-
 xen/arch/x86/hvm/vmx/vvmx.c     | 2 +-
 xen/include/asm-x86/hvm/hvm.h   | 2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 8e3375265c..0ce132b308 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -275,7 +275,7 @@ int arch_set_info_hvm_guest(struct vcpu *v, const vcpu_hvm_context_t *ctx)
     if ( v->arch.hvm.guest_efer & EFER_LME )
         v->arch.hvm.guest_efer |= EFER_LMA;
 
-    if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d, false) )
+    if ( v->arch.hvm.guest_cr[4] & ~hvm_cr4_guest_valid_bits(d) )
     {
         gprintk(XENLOG_ERR, "Bad CR4 value: %#016lx\n",
                 v->arch.hvm.guest_cr[4]);
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 101a739952..54e32e4fe8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -972,14 +972,14 @@ const char *hvm_efer_valid(const struct vcpu *v, uint64_t value,
         X86_CR0_CD | X86_CR0_PG)))
 
 /* These bits in CR4 can be set by the guest. */
-unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restore)
+unsigned long hvm_cr4_guest_valid_bits(const struct domain *d)
 {
     const struct cpuid_policy *p = d->arch.cpuid;
     bool mce, vmxe;
 
     /* Logic broken out simply to aid readability below. */
     mce  = p->basic.mce || p->basic.mca;
-    vmxe = p->basic.vmx && (restore || nestedhvm_enabled(d));
+    vmxe = p->basic.vmx && nestedhvm_enabled(d);
 
     return ((p->basic.vme     ? X86_CR4_VME | X86_CR4_PVI : 0) |
             (p->basic.tsc     ? X86_CR4_TSD               : 0) |
@@ -1033,7 +1033,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d, true) )
+    if ( ctxt.cr4 & ~hvm_cr4_guest_valid_bits(d) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -2425,7 +2425,7 @@ int hvm_set_cr4(unsigned long value, bool may_defer)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & ~hvm_cr4_guest_valid_bits(v->domain, false) )
+    if ( value & ~hvm_cr4_guest_valid_bits(v->domain) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c
index ba26b6a80b..f450391df4 100644
--- a/xen/arch/x86/hvm/svm/svmdebug.c
+++ b/xen/arch/x86/hvm/svm/svmdebug.c
@@ -106,6 +106,7 @@ bool svm_vmcb_isvalid(const char *from, const struct vmcb_struct *vmcb,
     unsigned long cr0 = vmcb_get_cr0(vmcb);
     unsigned long cr3 = vmcb_get_cr3(vmcb);
     unsigned long cr4 = vmcb_get_cr4(vmcb);
+    unsigned long valid;
     uint64_t efer = vmcb_get_efer(vmcb);
 
 #define PRINTF(fmt, args...) do { \
@@ -130,9 +131,10 @@ bool svm_vmcb_isvalid(const char *from, const struct vmcb_struct *vmcb,
            (cr3 >> v->domain->arch.cpuid->extd.maxphysaddr))) )
         PRINTF("CR3: MBZ bits are set (%#"PRIx64")\n", cr3);
 
-    if ( cr4 & ~hvm_cr4_guest_valid_bits(v->domain, false) )
+    valid = hvm_cr4_guest_valid_bits(v->domain);
+    if ( cr4 & ~valid )
         PRINTF("CR4: invalid bits are set (%#"PRIx64", valid: %#"PRIx64")\n",
-               cr4, hvm_cr4_guest_valid_bits(v->domain, false));
+               cr4, valid);
 
     if ( vmcb_get_dr6(vmcb) >> 32 )
         PRINTF("DR6: bits [63:32] are not zero (%#"PRIx64")\n",
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 95d109f962..86b8916a5d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1529,7 +1529,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr,
              */
             v->arch.hvm.vmx.cr4_host_mask =
                 (HVM_CR4_HOST_MASK | X86_CR4_PKE |
-                 ~hvm_cr4_guest_valid_bits(v->domain, false));
+                 ~hvm_cr4_guest_valid_bits(v->domain));
 
             v->arch.hvm.vmx.cr4_host_mask |= v->arch.hvm.vmx.vmx_realmode ?
                                              X86_CR4_VME : 0;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 1e51689ef3..3a37e9ebea 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -2323,7 +2323,7 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
         data = X86_CR4_VMXE;
         break;
     case MSR_IA32_VMX_CR4_FIXED1:
-        data = hvm_cr4_guest_valid_bits(d, false);
+        data = hvm_cr4_guest_valid_bits(d);
         break;
     case MSR_IA32_VMX_MISC:
         /* Do not support CR3-target feature now */
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index be0d8b0a4d..334bd573b9 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -334,7 +334,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 /* Check CR4/EFER values */
 const char *hvm_efer_valid(const struct vcpu *v, uint64_t value,
                            signed int cr0_pg);
-unsigned long hvm_cr4_guest_valid_bits(const struct domain *d, bool restore);
+unsigned long hvm_cr4_guest_valid_bits(const struct domain *d);
 
 int hvm_copy_context_and_params(struct domain *src, struct domain *dst);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:34:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:34:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3597.10298 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKI-0000in-2n; Wed, 07 Oct 2020 17:34:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3597.10298; Wed, 07 Oct 2020 17:34:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKH-0000ig-W8; Wed, 07 Oct 2020 17:34:05 +0000
Received: by outflank-mailman (input) for mailman id 3597;
 Wed, 07 Oct 2020 17:34:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDKG-0000iV-2Y
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 70942d12-74c5-48dd-8a8e-e6c3d3d113c6;
 Wed, 07 Oct 2020 17:34:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKF-00029S-7Y
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKF-0004xs-6m
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDKG-0000iV-2Y
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:04 +0000
X-Inumbo-ID: 70942d12-74c5-48dd-8a8e-e6c3d3d113c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 70942d12-74c5-48dd-8a8e-e6c3d3d113c6;
	Wed, 07 Oct 2020 17:34:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Rir51wOxODzP888FnKOoKSMXhzN0zNZZ+3v/xDS04I4=; b=j6JcLo9DCJnmyWsG6qj8V41ChZ
	jtg/0b37UxUwTq5QBPpUM2nUEF2RvBJci2u7sGaBS/zWF9DAhYOwGZ1KvmArRBeQGlGKMJ0tSF+0I
	cWWPIi/gtIX4pl0o2WJMSL5/y1/K9ABXkrF7Z51CyR1r4GCr+rROrkjGkjqML4QsJGxQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKF-00029S-7Y
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKF-0004xs-6m
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuid: Move VMX/SVM out of the default policy
Message-Id: <E1kQDKF-0004xs-6m@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:34:03 +0000

commit 35679b221ee731a957f180051ede70ef49bb4fe0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Sep 30 10:17:33 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/cpuid: Move VMX/SVM out of the default policy
    
    Nested virt is still experimental, and requires explicitly opting in to at
    domain create time.  The VMX/SVM features should not be visible by default.
    
    Also correct them from all HVM guests, to just HAP-enabled guests.  This has
    been the restriction for SVM right from the outset (c/s e006a0e0aaa), while
    VMX was first introduced supporting shadow mode (c/s 9122c69c8d3) but later
    adjusted to HAP-only (c/s 77751ed79e3).
    
    There is deliberately no adjustment to xc_cpuid_apply_policy() for pre-4.14
    migration compatibility.  The migration stream doesn't contain the required
    architectural state for either VMX/SVM, and a nested virt VM which migrates
    will explode in weird and wonderful ways.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/public/arch-x86/cpufeatureset.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index abd18722ee..ef7cca334d 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -127,7 +127,7 @@ XEN_CPUFEATURE(PCLMULQDQ,     1*32+ 1) /*A  Carry-less multiplication */
 XEN_CPUFEATURE(DTES64,        1*32+ 2) /*   64-bit Debug Store */
 XEN_CPUFEATURE(MONITOR,       1*32+ 3) /*   Monitor/Mwait support */
 XEN_CPUFEATURE(DSCPL,         1*32+ 4) /*   CPL Qualified Debug Store */
-XEN_CPUFEATURE(VMX,           1*32+ 5) /*S  Virtual Machine Extensions */
+XEN_CPUFEATURE(VMX,           1*32+ 5) /*h  Virtual Machine Extensions */
 XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
 XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
 XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
@@ -166,7 +166,7 @@ XEN_CPUFEATURE(3DNOW,         2*32+31) /*A  3DNow! */
 /* AMD-defined CPU features, CPUID level 0x80000001.ecx, word 3 */
 XEN_CPUFEATURE(LAHF_LM,       3*32+ 0) /*A  LAHF/SAHF in long mode */
 XEN_CPUFEATURE(CMP_LEGACY,    3*32+ 1) /*!A If yes HyperThreading not valid */
-XEN_CPUFEATURE(SVM,           3*32+ 2) /*S  Secure virtual machine */
+XEN_CPUFEATURE(SVM,           3*32+ 2) /*h  Secure virtual machine */
 XEN_CPUFEATURE(EXTAPIC,       3*32+ 3) /*   Extended APIC space */
 XEN_CPUFEATURE(CR8_LEGACY,    3*32+ 4) /*S  CR8 in 32-bit mode */
 XEN_CPUFEATURE(ABM,           3*32+ 5) /*A  Advanced bit manipulation */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:34:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:34:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3598.10302 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKS-0000kD-5F; Wed, 07 Oct 2020 17:34:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3598.10302; Wed, 07 Oct 2020 17:34:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKS-0000k3-1S; Wed, 07 Oct 2020 17:34:16 +0000
Received: by outflank-mailman (input) for mailman id 3598;
 Wed, 07 Oct 2020 17:34:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDKQ-0000jr-Lw
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3b483d24-657d-4a94-b8a7-b154e7355dfa;
 Wed, 07 Oct 2020 17:34:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKP-00029h-C0
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKP-0004yu-A4
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDKQ-0000jr-Lw
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:14 +0000
X-Inumbo-ID: 3b483d24-657d-4a94-b8a7-b154e7355dfa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3b483d24-657d-4a94-b8a7-b154e7355dfa;
	Wed, 07 Oct 2020 17:34:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YnOGe7Pa9h2LDiShfM2ApCOXiojSzPv2JvH7kt/0u8A=; b=LNlVogP884X1+pNXn+nGUhmFbi
	9TLiAwxVs/WmLolV6ngXN1L3nFuqqudLCNXMqQxMfNb6fzTRD9h+eeTDlLHkWigmRtltXa3FSYQW+
	GoiBBk/S1NHI+idcdmo/evo9sAaVC33faIaWz7HG8pqNWfXROP6+PphymmtGrf4WgI7g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKP-00029h-C0
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKP-0004yu-A4
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: {paging, sh}_{cmpxchg, write}_guest_entry() cannot fault
Message-Id: <E1kQDKP-0004yu-A4@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:34:13 +0000

commit 1bc30c076a7f1678166934c080e1bf94b2c189af
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 13:57:51 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/mm: {paging, sh}_{cmpxchg, write}_guest_entry() cannot fault
    
    As of 2d0557c5cbeb ("x86: Fold page_info lock into type_info") we
    haven't been updating guest page table entries through linear page
    tables anymore. All updates have been using domain mappings since then.
    Drop the use of guest/user access helpers there, and hence also the
    boolean return values of the involved functions.
    
    update_intpte(), otoh, gets its boolean return type retained for now,
    as we may want to bound the CMPXCHG retry loop, indicating failure to
    the caller instead when the retry threshold got exceeded.
    
    With this {,__}cmpxchg_user() become unused, so they too get dropped.
    (In fact, dropping them was the motivation of making the change.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c                   |  8 +++----
 xen/arch/x86/mm/shadow/private.h    |  4 ++--
 xen/arch/x86/mm/shadow/pv.c         | 24 +++++++--------------
 xen/arch/x86/pv/mm.h                | 13 ++---------
 xen/arch/x86/pv/ro-page-fault.c     |  7 +++---
 xen/include/asm-x86/paging.h        | 21 +++++++++---------
 xen/include/asm-x86/x86_64/system.h | 43 -------------------------------------
 7 files changed, 30 insertions(+), 90 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d1cfc8fb4a..8c8f054186 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4033,8 +4033,8 @@ long do_mmu_update(
 
                 case PGT_writable_page:
                     perfc_incr(writable_mmu_updates);
-                    if ( paging_write_guest_entry(v, va, req.val, mfn) )
-                        rc = 0;
+                    paging_write_guest_entry(v, va, req.val, mfn);
+                    rc = 0;
                     break;
                 }
                 page_unlock(page);
@@ -4044,9 +4044,9 @@ long do_mmu_update(
             else if ( get_page_type(page, PGT_writable_page) )
             {
                 perfc_incr(writable_mmu_updates);
-                if ( paging_write_guest_entry(v, va, req.val, mfn) )
-                    rc = 0;
+                paging_write_guest_entry(v, va, req.val, mfn);
                 put_page_type(page);
+                rc = 0;
             }
 
             put_page(page);
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 0a8927f49e..fd72f4afb0 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -396,9 +396,9 @@ int shadow_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
                            unsigned int level);
 
 /* Functions that atomically write PV guest PT entries */
-bool sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
+void sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
                           mfn_t gmfn);
-bool sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
+void sh_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.
diff --git a/xen/arch/x86/mm/shadow/pv.c b/xen/arch/x86/mm/shadow/pv.c
index 25dca1eb25..ac779afce1 100644
--- a/xen/arch/x86/mm/shadow/pv.c
+++ b/xen/arch/x86/mm/shadow/pv.c
@@ -26,43 +26,35 @@
 
 /*
  * Write a new value into the guest pagetable, and update the shadows
- * appropriately.  Returns false if we page-faulted, true for success.
+ * appropriately.
  */
-bool
+void
 sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 {
-    unsigned 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));
+    write_atomic(p, 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 false if we page-faulted, true if not.
+ * appropriately.
  * N.B. caller should check the value of "old" to see if the cmpxchg itself
  * was successful.
  */
-bool
+void
 sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
                        intpte_t new, mfn_t gmfn)
 {
-    bool failed;
-    intpte_t t = *old;
+    intpte_t t;
 
     paging_lock(v->domain);
-    failed = cmpxchg_user(p, t, new);
+    t = cmpxchg(p, *old, new);
     if ( t == *old )
         sh_validate_guest_entry(v, gmfn, p, sizeof(new));
     *old = t;
     paging_unlock(v->domain);
-
-    return !failed;
 }
 
 /*
diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
index a1bd473b29..f537e58a8d 100644
--- a/xen/arch/x86/pv/mm.h
+++ b/xen/arch/x86/pv/mm.h
@@ -43,9 +43,7 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
 
 #ifndef PTE_UPDATE_WITH_CMPXCHG
     if ( !preserve_ad )
-    {
-        rv = paging_write_guest_entry(v, p, new, mfn);
-    }
+        paging_write_guest_entry(v, p, new, mfn);
     else
 #endif
     {
@@ -58,14 +56,7 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
             if ( preserve_ad )
                 _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
 
-            rv = paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
-            if ( unlikely(rv == 0) )
-            {
-                gdprintk(XENLOG_WARNING,
-                         "Failed to update %" PRIpte " -> %" PRIpte
-                         ": saw %" PRIpte "\n", old, _new, t);
-                break;
-            }
+            paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
 
             if ( t == old )
                 break;
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 556ee7ca11..8468f9e9bb 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -168,10 +168,9 @@ static int ptwr_emulated_update(unsigned long addr, intpte_t *p_old,
     if ( p_old )
     {
         ol1e = l1e_from_intpte(old);
-        if ( !paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e),
-                                         &old, l1e_get_intpte(nl1e), mfn) )
-            ret = X86EMUL_UNHANDLEABLE;
-        else if ( l1e_get_intpte(ol1e) == old )
+        paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), &old,
+                                   l1e_get_intpte(nl1e), mfn);
+        if ( l1e_get_intpte(ol1e) == old )
             ret = X86EMUL_OKAY;
         else
         {
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 87ce135b8c..4a26f30c81 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -100,9 +100,9 @@ struct shadow_paging_mode {
 #ifdef CONFIG_SHADOW_PAGING
     void          (*detach_old_tables     )(struct vcpu *v);
 #ifdef CONFIG_PV
-    bool          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
+    void          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
                                             intpte_t new, mfn_t gmfn);
-    bool          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
+    void          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
                                             intpte_t *old, intpte_t new,
                                             mfn_t gmfn);
 #endif
@@ -333,15 +333,15 @@ static inline void paging_update_paging_modes(struct vcpu *v)
  * paging-assistance state appropriately.  Returns false if we page-faulted,
  * true for success.
  */
-static inline bool paging_write_guest_entry(
+static inline void paging_write_guest_entry(
     struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        return paging_get_hostmode(v)->shadow.write_guest_entry(v, p, new,
-                                                                gmfn);
+        paging_get_hostmode(v)->shadow.write_guest_entry(v, p, new, gmfn);
+    else
 #endif
-    return !__copy_to_user(p, &new, sizeof(new));
+        write_atomic(p, new);
 }
 
 
@@ -351,15 +351,16 @@ static inline bool paging_write_guest_entry(
  * true if not.  N.B. caller should check the value of "old" to see if the
  * cmpxchg itself was successful.
  */
-static inline bool paging_cmpxchg_guest_entry(
+static inline void paging_cmpxchg_guest_entry(
     struct vcpu *v, intpte_t *p, intpte_t *old, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        return paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
-                                                                  new, gmfn);
+        paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
+                                                           new, gmfn);
+    else
 #endif
-    return !cmpxchg_user(p, *old, new);
+        *old = cmpxchg(p, *old, new);
 }
 
 #endif /* CONFIG_PV */
diff --git a/xen/include/asm-x86/x86_64/system.h b/xen/include/asm-x86/x86_64/system.h
index f471859c19..e94371cf20 100644
--- a/xen/include/asm-x86/x86_64/system.h
+++ b/xen/include/asm-x86/x86_64/system.h
@@ -59,47 +59,4 @@ static always_inline __uint128_t cmpxchg16b_local_(
     __cmpxchg16b(_p, (void *)(o), (void *)(n));            \
 })
 
-/*
- * This function causes value _o to be changed to _n at location _p.
- * If this access causes a fault then we return 1, otherwise we return 0.
- * If no fault occurs then _o is updated to the value we saw at _p. If this
- * is the same as the initial value of _o then _n is written to location _p.
- */
-#define __cmpxchg_user(_p, _o, _n, _oppre, _regtype)                    \
-    stac();                                                             \
-    asm volatile (                                                      \
-        "1: lock cmpxchg %"_oppre"[new], %[ptr]\n"                      \
-        "2:\n"                                                          \
-        ".section .fixup,\"ax\"\n"                                      \
-        "3:     movl $1, %[rc]\n"                                       \
-        "       jmp 2b\n"                                               \
-        ".previous\n"                                                   \
-        _ASM_EXTABLE(1b, 3b)                                            \
-        : "+a" (_o), [rc] "=r" (_rc),                                   \
-          [ptr] "+m" (*(volatile typeof(*(_p)) *)(_p))                  \
-        : [new] _regtype (_n), "[rc]" (0)                               \
-        : "memory");                                                    \
-    clac()
-
-#define cmpxchg_user(_p, _o, _n)                                        \
-({                                                                      \
-    int _rc;                                                            \
-    switch ( sizeof(*(_p)) )                                            \
-    {                                                                   \
-    case 1:                                                             \
-        __cmpxchg_user(_p, _o, _n, "b", "q");                           \
-        break;                                                          \
-    case 2:                                                             \
-        __cmpxchg_user(_p, _o, _n, "w", "r");                           \
-        break;                                                          \
-    case 4:                                                             \
-        __cmpxchg_user(_p, _o, _n, "k", "r");                           \
-        break;                                                          \
-    case 8:                                                             \
-        __cmpxchg_user(_p, _o, _n, "q", "r");                           \
-        break;                                                          \
-    }                                                                   \
-    _rc;                                                                \
-})
-
 #endif /* __X86_64_SYSTEM_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:34:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:34:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3599.10307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKc-0000lS-7v; Wed, 07 Oct 2020 17:34:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3599.10307; Wed, 07 Oct 2020 17:34:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKc-0000lK-4t; Wed, 07 Oct 2020 17:34:26 +0000
Received: by outflank-mailman (input) for mailman id 3599;
 Wed, 07 Oct 2020 17:34:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDKa-0000lA-Mj
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b4a72bd4-0b6d-411d-b89c-7def2ddf21f9;
 Wed, 07 Oct 2020 17:34:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKZ-00029v-FK
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKZ-0004zo-EQ
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDKa-0000lA-Mj
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:24 +0000
X-Inumbo-ID: b4a72bd4-0b6d-411d-b89c-7def2ddf21f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b4a72bd4-0b6d-411d-b89c-7def2ddf21f9;
	Wed, 07 Oct 2020 17:34:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z6J8PbGkYDcJqSEBy2XvZh97IxWmT6JBN7bxmyoCV7c=; b=gHR241GcKYZvU/p3SXEhuz9eN0
	Lad/cxx2SE7UQuxMluFU0w6xPoJskc9xs31fQF+h7ui0JebDy+k7r/GzlKH0C/yYtrdhCCIUevv63
	CDiLhHGNckNzptn82qeh40FFzXmkM0ULHF476q01+udZoQYox66dRb1Tfje1xkEarP8c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKZ-00029v-FK
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKZ-0004zo-EQ
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: remove some indirection from {paging,sh}_cmpxchg_guest_entry()
Message-Id: <E1kQDKZ-0004zo-EQ@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:34:23 +0000

commit 30bfa535fa9de47c47d0655e502eaf23724f837b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Sep 28 13:58:14 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/mm: remove some indirection from {paging,sh}_cmpxchg_guest_entry()
    
    Make the functions more similar to cmpxchg() in that they now take an
    integral "old" input and return the value read.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/private.h |  4 ++--
 xen/arch/x86/mm/shadow/pv.c      | 16 ++++++++--------
 xen/arch/x86/pv/mm.h             |  6 ++----
 xen/arch/x86/pv/ro-page-fault.c  |  4 ++--
 xen/include/asm-x86/paging.h     | 15 +++++++--------
 5 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index fd72f4afb0..992461d4bc 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -398,8 +398,8 @@ int shadow_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
 /* Functions that atomically write PV guest PT entries */
 void sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new,
                           mfn_t gmfn);
-void sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
-                            intpte_t new, mfn_t gmfn);
+intpte_t sh_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/pv.c b/xen/arch/x86/mm/shadow/pv.c
index ac779afce1..f51f980f26 100644
--- a/xen/arch/x86/mm/shadow/pv.c
+++ b/xen/arch/x86/mm/shadow/pv.c
@@ -39,22 +39,22 @@ sh_write_guest_entry(struct vcpu *v, intpte_t *p, intpte_t new, mfn_t gmfn)
 
 /*
  * Cmpxchg a new value into the guest pagetable, and update the shadows
- * appropriately.
- * N.B. caller should check the value of "old" to see if the cmpxchg itself
- * was successful.
+ * appropriately.  Returns the previous entry found, which the caller is
+ * expected to check to see if the cmpxchg was successful.
  */
-void
-sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t *old,
+intpte_t
+sh_cmpxchg_guest_entry(struct vcpu *v, intpte_t *p, intpte_t old,
                        intpte_t new, mfn_t gmfn)
 {
     intpte_t t;
 
     paging_lock(v->domain);
-    t = cmpxchg(p, *old, new);
-    if ( t == *old )
+    t = cmpxchg(p, old, new);
+    if ( t == old )
         sh_validate_guest_entry(v, gmfn, p, sizeof(new));
-    *old = t;
     paging_unlock(v->domain);
+
+    return t;
 }
 
 /*
diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
index f537e58a8d..b1b66e46c8 100644
--- a/xen/arch/x86/pv/mm.h
+++ b/xen/arch/x86/pv/mm.h
@@ -47,16 +47,14 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
     else
 #endif
     {
-        intpte_t t = old;
-
         for ( ; ; )
         {
-            intpte_t _new = new;
+            intpte_t _new = new, t;
 
             if ( preserve_ad )
                 _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
 
-            paging_cmpxchg_guest_entry(v, p, &t, _new, mfn);
+            t = paging_cmpxchg_guest_entry(v, p, old, _new, mfn);
 
             if ( t == old )
                 break;
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 8468f9e9bb..7f6fbc92fb 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -168,8 +168,8 @@ static int ptwr_emulated_update(unsigned long addr, intpte_t *p_old,
     if ( p_old )
     {
         ol1e = l1e_from_intpte(old);
-        paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), &old,
-                                   l1e_get_intpte(nl1e), mfn);
+        old = paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), old,
+                                         l1e_get_intpte(nl1e), mfn);
         if ( l1e_get_intpte(ol1e) == old )
             ret = X86EMUL_OKAY;
         else
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 4a26f30c81..61534da538 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -102,8 +102,8 @@ struct shadow_paging_mode {
 #ifdef CONFIG_PV
     void          (*write_guest_entry     )(struct vcpu *v, intpte_t *p,
                                             intpte_t new, mfn_t gmfn);
-    void          (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
-                                            intpte_t *old, intpte_t new,
+    intpte_t      (*cmpxchg_guest_entry   )(struct vcpu *v, intpte_t *p,
+                                            intpte_t old, intpte_t new,
                                             mfn_t gmfn);
 #endif
 #ifdef CONFIG_HVM
@@ -351,16 +351,15 @@ static inline void paging_write_guest_entry(
  * true if not.  N.B. caller should check the value of "old" to see if the
  * cmpxchg itself was successful.
  */
-static inline void paging_cmpxchg_guest_entry(
-    struct vcpu *v, intpte_t *p, intpte_t *old, intpte_t new, mfn_t gmfn)
+static inline intpte_t paging_cmpxchg_guest_entry(
+    struct vcpu *v, intpte_t *p, intpte_t old, intpte_t new, mfn_t gmfn)
 {
 #ifdef CONFIG_SHADOW_PAGING
     if ( unlikely(paging_mode_shadow(v->domain)) && paging_get_hostmode(v) )
-        paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
-                                                           new, gmfn);
-    else
+        return paging_get_hostmode(v)->shadow.cmpxchg_guest_entry(v, p, old,
+                                                                  new, gmfn);
 #endif
-        *old = cmpxchg(p, *old, new);
+    return cmpxchg(p, old, new);
 }
 
 #endif /* CONFIG_PV */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:34:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3600.10310 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKm-0000mq-9E; Wed, 07 Oct 2020 17:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3600.10310; Wed, 07 Oct 2020 17:34:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKm-0000mi-6L; Wed, 07 Oct 2020 17:34:36 +0000
Received: by outflank-mailman (input) for mailman id 3600;
 Wed, 07 Oct 2020 17:34:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDKk-0000mY-Cq
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 517e9cee-4cac-435d-8a62-416d072c91e9;
 Wed, 07 Oct 2020 17:34:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKj-0002Ah-IJ
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKj-00050i-HT
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDKk-0000mY-Cq
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:34 +0000
X-Inumbo-ID: 517e9cee-4cac-435d-8a62-416d072c91e9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 517e9cee-4cac-435d-8a62-416d072c91e9;
	Wed, 07 Oct 2020 17:34:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3A9O8lRflxrmj3zKokZpoKJ55J9dISw8kJDjOjJN1hg=; b=OTMta/r5iKRXkxJtqy0PpRzsKn
	F4wZkCX58FEJuI2lIbq0ASo4y4/QWLY7Jgs2hn16H037BK1xk9IwTL1hBNTP1+Bd3oeAW3yE8zadV
	Ta7vYNgEh/7Keyii08ZJYj/DOASfLtQS0kmn4HilWPxWK6LCm70DUQc+fyRPa5zUVrKU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKj-0002Ah-IJ
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKj-00050i-HT
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/S3: Restore CR4 earlier during resume
Message-Id: <E1kQDKj-00050i-HT@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:34:33 +0000

commit 7f66c0dc41ae5f770c614e516810eb1f336e2470
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 18:49:32 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/S3: Restore CR4 earlier during resume
    
    c/s 4304ff420e5 "x86/S3: Drop {save,restore}_rest_processor_state()
    completely" moved CR4 restoration up into C, to account for the fact that MCE
    was explicitly handled later.
    
    However, time_resume() ends up making an EFI Runtime Service call, and EFI
    explodes without OSFXSR, presumably when trying to spill %xmm registers onto
    the stack.
    
    Given this codepath, and the potential for other issues of a similar kind (TLB
    flushing vs INVPCID, HVM logic vs VMXE, etc), restore CR4 in asm before
    entering C.
    
    Ignore the previous MCE special case, because its not actually necessary.  The
    handler is already suitably configured from before suspend.
    
    Fixes: 4304ff420e5 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/acpi/power.c       | 3 ---
 xen/arch/x86/acpi/wakeup_prot.S | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 4fb1e7a148..7f162a4df9 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -276,9 +276,6 @@ static int enter_state(u32 state)
 
     mcheck_init(&boot_cpu_data, false);
 
-    /* Restore CR4 from cached value, now MCE is set up. */
-    write_cr4(read_cr4());
-
     printk(XENLOG_INFO "Finishing wakeup from ACPI S%d state.\n", state);
 
     if ( (state == ACPI_STATE_S3) && error )
diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index c6b3fcc93d..15052c300f 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -1,3 +1,4 @@
+#include <asm/asm_defns.h>
 #include <asm/msr-index.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -110,6 +111,11 @@ ENTRY(s3_resume)
 
         call    load_system_tables
 
+        /* Restore CR4 from the cpuinfo block. */
+        GET_STACK_END(bx)
+        mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
+        mov     %rax, %cr4
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Oct 07 17:34:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Oct 2020 17:34:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.3601.10315 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKw-0000o8-Au; Wed, 07 Oct 2020 17:34:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 3601.10315; Wed, 07 Oct 2020 17:34:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQDKw-0000o0-7o; Wed, 07 Oct 2020 17:34:46 +0000
Received: by outflank-mailman (input) for mailman id 3601;
 Wed, 07 Oct 2020 17:34:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQDKu-0000no-JO
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d75919b2-83b2-4456-b0a6-ea1f84ceb03e;
 Wed, 07 Oct 2020 17:34:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKt-0002Ar-LJ
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQDKt-00051f-KP
 for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ObQi=DO=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQDKu-0000no-JO
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:44 +0000
X-Inumbo-ID: d75919b2-83b2-4456-b0a6-ea1f84ceb03e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d75919b2-83b2-4456-b0a6-ea1f84ceb03e;
	Wed, 07 Oct 2020 17:34:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2u6wxJP/YyUFtHbyV9zy31/5/hPTXV5SPg8bYYMzdd4=; b=f1MUrn4l1OJZ37THoyuvyMxlqM
	EnkNiTfFCXECk79z4RGoOVgg07i9W8D9H12sX1RRQysIAOlGKP6ZI77W6VoThj0ykhbA26ctXEf5I
	gCaP91HMlfemJTFD08IbNcbhOtHn0DIiO9nYGC2mxB60TGlD3w1LTj6835N+w6aVsrGw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKt-0002Ar-LJ
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQDKt-00051f-KP
	for xen-changelog@lists.xenproject.org; Wed, 07 Oct 2020 17:34:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vpic: also execute dpci callback for non-specific EOI
Message-Id: <E1kQDKt-00051f-KP@xenbits.xenproject.org>
Date: Wed, 07 Oct 2020 17:34:43 +0000

commit 93508595d588afe9dca087f95200effb7cedc81f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Aug 20 17:16:27 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 6 12:28:37 2020 +0100

    x86/vpic: also execute dpci callback for non-specific EOI
    
    Currently the dpci EOI callback is only executed for specific EOIs.
    This is wrong as non-specific EOIs will also clear the ISR bit and
    thus end the interrupt. Re-arrange the code a bit so that the common
    EOI handling path can be shared between all EOI modes.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vpic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vpic.c b/xen/arch/x86/hvm/vpic.c
index feb1db2ee3..3cf12581e9 100644
--- a/xen/arch/x86/hvm/vpic.c
+++ b/xen/arch/x86/hvm/vpic.c
@@ -249,15 +249,15 @@ static void vpic_ioport_write(
                 if ( priority == VPIC_PRIO_NONE )
                     break;
                 pin = (priority + vpic->priority_add) & 7;
-                vpic->isr &= ~(1 << pin);
-                if ( cmd == 5 )
-                    vpic->priority_add = (pin + 1) & 7;
-                break;
+                goto common_eoi;
+
             case 3: /* Specific EOI                */
             case 7: /* Specific EOI & Rotate       */
                 pin = val & 7;
+
+            common_eoi:
                 vpic->isr &= ~(1 << pin);
-                if ( cmd == 7 )
+                if ( cmd == 7 || cmd == 5 )
                     vpic->priority_add = (pin + 1) & 7;
                 /* Release lock and EOI the physical interrupt (if any). */
                 vpic_update_int_output(vpic);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4467.11639 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVRs-0004A9-7x; Thu, 08 Oct 2020 12:55:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4467.11639; Thu, 08 Oct 2020 12:55:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVRs-00049z-4X; Thu, 08 Oct 2020 12:55:08 +0000
Received: by outflank-mailman (input) for mailman id 4467;
 Thu, 08 Oct 2020 12:55:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVRr-00049r-6a
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 270d3772-b730-4773-b14c-0a821ae3ab3c;
 Thu, 08 Oct 2020 12:55:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVRp-00044z-RX
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVRp-0004Tr-Q8
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVRr-00049r-6a
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:07 +0000
X-Inumbo-ID: 270d3772-b730-4773-b14c-0a821ae3ab3c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 270d3772-b730-4773-b14c-0a821ae3ab3c;
	Thu, 08 Oct 2020 12:55:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t24W42AK95sOzVRKAfYg9NiTFfPiyrZig9hJ6tqNDWI=; b=SZwgM7Zp4tVtpweApNg30bWUWW
	0sEZYwyunNbJePVC5zQjUb3aANbV6mXDDimWOuPkWgRIJE9ZNw+5OdjNfl2+iuttzaJ3beK5Wg9mF
	VYZj4VakcxPkDJx7WSERLPkL5aSL8hgT8oiNTsLVbO1QRiIC+vdd5rOxPVOF17eYY6nU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVRp-00044z-RX
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVRp-0004Tr-Q8
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstore: remove socket-only option from xenstore client
Message-Id: <E1kQVRp-0004Tr-Q8@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:05 +0000

commit c65687ed16d2289ec91036ec2862a4b4bd34ea4f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:37 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:50 2020 +0000

    tools/xenstore: remove socket-only option from xenstore client
    
    The Xenstore access commands (xenstore-*) have the possibility to limit
    connection to Xenstore to a local socket (option "-s"). This is an
    option making no sense at all, as either there is only a socket, so
    the option would be a nop, or there is no socket at all (in case
    Xenstore is running in a stubdom or the client is called in a domU),
    so specifying the option would just lead to failure.
    
    So drop that option completely.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 docs/man/xenstore-chmod.1.pod    | 4 ----
 docs/man/xenstore-ls.1.pod       | 4 ----
 docs/man/xenstore-read.1.pod     | 4 ----
 docs/man/xenstore-write.1.pod    | 4 ----
 tools/xenstore/xenstore_client.c | 8 ++------
 5 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/docs/man/xenstore-chmod.1.pod b/docs/man/xenstore-chmod.1.pod
index d76f34723d..d221f5dffc 100644
--- a/docs/man/xenstore-chmod.1.pod
+++ b/docs/man/xenstore-chmod.1.pod
@@ -46,10 +46,6 @@ write, and set permissions).
 
 Apply the permissions to the key and all its I<children>.
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-u>
 
 Apply the permissions to the key and all its I<parents>.
diff --git a/docs/man/xenstore-ls.1.pod b/docs/man/xenstore-ls.1.pod
index 8dac931e94..a9f8b32653 100644
--- a/docs/man/xenstore-ls.1.pod
+++ b/docs/man/xenstore-ls.1.pod
@@ -50,10 +50,6 @@ I<and> the permissions for any domain not explicitly listed in
 subsequent entries.  The key owner always has full access (read,
 write, and set permissions).
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =back
 
 =head1 BUGS
diff --git a/docs/man/xenstore-read.1.pod b/docs/man/xenstore-read.1.pod
index f5a7bb7e46..c7768cbbe5 100644
--- a/docs/man/xenstore-read.1.pod
+++ b/docs/man/xenstore-read.1.pod
@@ -16,10 +16,6 @@ Read values of one or more Xenstore I<PATH>s.
 
 Prefix value with key name.
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-R>
 
 Read raw value, skip escaping non-printable characters (\x..).
diff --git a/docs/man/xenstore-write.1.pod b/docs/man/xenstore-write.1.pod
index d1b011236a..a0b1bca333 100644
--- a/docs/man/xenstore-write.1.pod
+++ b/docs/man/xenstore-write.1.pod
@@ -13,10 +13,6 @@ provided to write them at once - in one Xenstore transaction.
 
 =over
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-R>
 
 Write raw value, skip parsing escaped characters (\x..).
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index ae7ed3eb9e..8015bfe5be 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -530,7 +530,7 @@ main(int argc, char **argv)
 {
     struct xs_handle *xsh;
     xs_transaction_t xth = XBT_NULL;
-    int ret = 0, socket = 0;
+    int ret = 0;
     int prefix = 0;
     int tidy = 0;
     int upto = 0;
@@ -565,7 +565,6 @@ main(int argc, char **argv)
 	static struct option long_options[] = {
 	    {"help",    0, 0, 'h'},
 	    {"flat",    0, 0, 'f'}, /* MODE_ls */
-	    {"socket",  0, 0, 's'},
 	    {"prefix",  0, 0, 'p'}, /* MODE_read || MODE_list || MODE_ls */
 	    {"tidy",    0, 0, 't'}, /* MODE_rm */
 	    {"upto",    0, 0, 'u'}, /* MODE_chmod */
@@ -593,9 +592,6 @@ main(int argc, char **argv)
 		usage(mode, switch_argv, argv[0]);
 	    }
             break;
-        case 's':
-            socket = 1;
-            break;
 	case 'p':
 	    if ( mode == MODE_read || mode == MODE_list || mode == MODE_ls )
 		prefix = 1;
@@ -675,7 +671,7 @@ main(int argc, char **argv)
 	    max_width = ws.ws_col - 2;
     }
 
-    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
+    xsh = xs_open(0);
     if (xsh == NULL) err(1, "xs_open");
 
 again:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4468.11643 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVS2-0004BT-9f; Thu, 08 Oct 2020 12:55:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4468.11643; Thu, 08 Oct 2020 12:55:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVS2-0004BM-6I; Thu, 08 Oct 2020 12:55:18 +0000
Received: by outflank-mailman (input) for mailman id 4468;
 Thu, 08 Oct 2020 12:55:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVS0-0004B9-SC
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7e5d4631-f930-42b7-96a5-ac037f064046;
 Thu, 08 Oct 2020 12:55:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVRz-000452-WF
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVRz-0004UT-Tn
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVS0-0004B9-SC
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:16 +0000
X-Inumbo-ID: 7e5d4631-f930-42b7-96a5-ac037f064046
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7e5d4631-f930-42b7-96a5-ac037f064046;
	Thu, 08 Oct 2020 12:55:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AD/l+fUOh8yAuQG9ulkuuaORs+9rGgyRbZJhZSxW4pk=; b=4QI7PeQnzTZR9lS1e39FA3QKPN
	GYpTqOQ9UoRj5CyV20bgIub0IY9AMfo584++NxZRHN+IJi+CPsHjlOlr8ckMOxrvsuE8uYj5ISJsw
	0F5SkRCF4Rq8pZnRwAeWsCxV4KxrQsTGQm51ZNgWv0mIklGwlK37kSxC/PZnOc1Pp6BA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVRz-000452-WF
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVRz-0004UT-Tn
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/store: ignore XS_OPEN_SOCKETONLY flag
Message-Id: <E1kQVRz-0004UT-Tn@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:15 +0000

commit fa06cb8c38832aafe597d719040ba1d216e367b8
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:38 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:54 2020 +0000

    tools/libs/store: ignore XS_OPEN_SOCKETONLY flag
    
    When opening the connection to Xenstore via xs_open() it makes no
    sense to limit the connection to the socket based one. So just ignore
    the XS_OPEN_SOCKETONLY flag.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 2 --
 tools/libs/store/xs.c               | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index 25b31881c8..cbc7206a0f 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -66,8 +66,6 @@ typedef uint32_t xs_transaction_t;
  * * Connections made with xs_open(0) (which might be shared page or
  *   socket based) are only guaranteed to work in the parent after
  *   fork.
- * * Connections made with xs_open(XS_OPEN_SOCKETONLY) will be usable
- *   in either the parent or the child after fork, but not both.
  * * xs_daemon_open*() and xs_domain_open() are deprecated synonyms
  *   for xs_open(0).
  * * XS_OPEN_READONLY has no bearing on any of this.
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index aa1d24b8b9..320734416f 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -319,7 +319,7 @@ struct xs_handle *xs_open(unsigned long flags)
 	else
 		xsh = get_handle(xs_daemon_socket());
 
-	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
+	if (!xsh)
 		xsh = get_handle(xs_domain_dev());
 
 	if (xsh && (flags & XS_UNWATCH_FILTER))
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4469.11646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSD-0004Dr-Ap; Thu, 08 Oct 2020 12:55:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4469.11646; Thu, 08 Oct 2020 12:55:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSD-0004Dj-7y; Thu, 08 Oct 2020 12:55:29 +0000
Received: by outflank-mailman (input) for mailman id 4469;
 Thu, 08 Oct 2020 12:55:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVSB-0004DX-Mc
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e0ffece6-05fd-4a33-afff-84110d14831b;
 Thu, 08 Oct 2020 12:55:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSA-00045B-4i
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSA-0004V9-29
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVSB-0004DX-Mc
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:27 +0000
X-Inumbo-ID: e0ffece6-05fd-4a33-afff-84110d14831b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e0ffece6-05fd-4a33-afff-84110d14831b;
	Thu, 08 Oct 2020 12:55:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sLjgEy72veThtH7ODN2TnfxpYvdgjFhrjG8iduhdxXk=; b=x5w4hc61TqSgJsaj8h8sicGR89
	nezlj6YWUV/XpcCYbCf5SFRSgV/RXzohk5gyj5C5ga3fRv+QASYmgZhYMbyOOeafDg66lfcCpJ41d
	+Kj4hMjBLQFh2R6MyuKaXxQeYTrIZyPeYOZzvTf3Du+l9SndTQJf/s9iY/P6if6U6vD0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSA-00045B-4i
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSA-0004V9-29
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/store: drop read-only functionality
Message-Id: <E1kQVSA-0004V9-29@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:26 +0000

commit 5144222bcd4b6653c15ce699780322dca5c02ea3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:39 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:57 2020 +0000

    tools/libs/store: drop read-only functionality
    
    Today it is possible to open the connection in read-only mode via
    xs_daemon_open_readonly(). This is working only with Xenstore running
    as a daemon in the same domain as the user. Additionally it doesn't
    add any security as accessing the socket used for that functionality
    requires the same privileges as the socket used for full Xenstore
    access.
    
    So just drop the read-only semantics in all cases, leaving the
    interface existing only for compatibility reasons. This in turn
    requires to just ignore the XS_OPEN_READONLY flag.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 8 --------
 tools/libs/store/xs.c               | 7 ++-----
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index cbc7206a0f..158e69ef83 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -60,15 +60,12 @@ typedef uint32_t xs_transaction_t;
 /* Open a connection to the xs daemon.
  * Attempts to make a connection over the socket interface,
  * and if it fails, then over the  xenbus interface.
- * Mode 0 specifies read-write access, XS_OPEN_READONLY for
- * read-only access.
  *
  * * Connections made with xs_open(0) (which might be shared page or
  *   socket based) are only guaranteed to work in the parent after
  *   fork.
  * * xs_daemon_open*() and xs_domain_open() are deprecated synonyms
  *   for xs_open(0).
- * * XS_OPEN_READONLY has no bearing on any of this.
  *
  * Returns a handle or NULL.
  */
@@ -83,11 +80,6 @@ void xs_close(struct xs_handle *xsh /* NULL ok */);
  */
 struct xs_handle *xs_daemon_open(void);
 struct xs_handle *xs_domain_open(void);
-
-/* Connect to the xs daemon (readonly for non-root clients).
- * Returns a handle or NULL.
- * Deprecated, please use xs_open(XS_OPEN_READONLY) instead
- */
 struct xs_handle *xs_daemon_open_readonly(void);
 
 /* Close the connection to the xs daemon.
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index 320734416f..4ac73ec317 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -302,7 +302,7 @@ struct xs_handle *xs_daemon_open(void)
 
 struct xs_handle *xs_daemon_open_readonly(void)
 {
-	return xs_open(XS_OPEN_READONLY);
+	return xs_open(0);
 }
 
 struct xs_handle *xs_domain_open(void)
@@ -314,10 +314,7 @@ struct xs_handle *xs_open(unsigned long flags)
 {
 	struct xs_handle *xsh = NULL;
 
-	if (flags & XS_OPEN_READONLY)
-		xsh = get_handle(xs_daemon_socket_ro());
-	else
-		xsh = get_handle(xs_daemon_socket());
+	xsh = get_handle(xs_daemon_socket());
 
 	if (!xsh)
 		xsh = get_handle(xs_domain_dev());
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4472.11651 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSM-0004FX-Cx; Thu, 08 Oct 2020 12:55:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4472.11651; Thu, 08 Oct 2020 12:55:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSM-0004FP-9T; Thu, 08 Oct 2020 12:55:38 +0000
Received: by outflank-mailman (input) for mailman id 4472;
 Thu, 08 Oct 2020 12:55:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVSL-0004FD-FY
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 295b702c-ac97-43cb-9c35-6f24e07a4c9a;
 Thu, 08 Oct 2020 12:55:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSK-00045U-85
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSK-0004W4-7L
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVSL-0004FD-FY
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:37 +0000
X-Inumbo-ID: 295b702c-ac97-43cb-9c35-6f24e07a4c9a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 295b702c-ac97-43cb-9c35-6f24e07a4c9a;
	Thu, 08 Oct 2020 12:55:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WDOWHVXlgOYvuAWgpNLd7ALc5VqcDhA9jONb/Q7Wpeg=; b=RRGLtateaWSgxnlQH36FzJ4c26
	Rb2xZwo067e06xb75B/K4oizl1YNSs1LlnYGDzWZohEYczEirSzw2LSimXhdOu0fb4SIFPDLqcnj7
	w+E+OhyMXVNd8rXHb/L+DpwZxQpbapIsfZy6QkP4Jr7tbGOMK8GYiGbQ9kE89uZ88fXo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSK-00045U-85
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSK-0004W4-7L
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: drop all deprecated usages of xs_*_open() and friends in tools
Message-Id: <E1kQVSK-0004W4-7L@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:36 +0000

commit 90c9f9f4ddd55e11be0506bff10c6237507c6e0d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:40 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:59 2020 +0000

    tools: drop all deprecated usages of xs_*_open() and friends in tools
    
    Switch all usages of xs_daemon_open*() and xs_domain_open() to use
    xs_open() instead. While at it switch xs_daemon_close() users to
    xs_close().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/console/client/main.c             |  2 +-
 tools/console/daemon/utils.c            |  4 ++--
 tools/libs/light/libxl.c                |  6 ++----
 tools/libs/light/libxl_exec.c           |  6 +++---
 tools/libs/light/libxl_fork.c           |  2 +-
 tools/libs/stat/xenstat.c               |  4 ++--
 tools/libs/vchan/init.c                 | 10 ++++------
 tools/misc/xen-lowmemd.c                |  4 ++--
 tools/python/xen/lowlevel/xs/xs.c       |  6 +++---
 tools/tests/mce-test/tools/xen-mceinj.c |  4 ++--
 tools/xenbackendd/xenbackendd.c         |  4 ++--
 tools/xenpmd/xenpmd.c                   |  6 +++---
 12 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f92ad3d8cf..088be28dff 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -398,7 +398,7 @@ int main(int argc, char **argv)
 		exit(EINVAL);
 	}
 
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		err(errno, "Could not contact XenStore");
 	}
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 97d7798b33..f9dd8a60c5 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -104,7 +104,7 @@ void daemonize(const char *pidfile)
 bool xen_setup(void)
 {
 	
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		dolog(LOG_ERR,
 		      "Failed to contact xenstore (%m).  Is it running?");
@@ -131,7 +131,7 @@ bool xen_setup(void)
 
  out:
 	if (xs)
-		xs_daemon_close(xs);
+		xs_close(xs);
 	if (xc)
 		xc_interface_close(xc);
 	return false;
diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c
index 621acc88f3..d2a87157a2 100644
--- a/tools/libs/light/libxl.c
+++ b/tools/libs/light/libxl.c
@@ -103,9 +103,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
         rc = ERROR_FAIL; goto out;
     }
 
-    ctx->xsh = xs_daemon_open();
-    if (!ctx->xsh)
-        ctx->xsh = xs_domain_open();
+    ctx->xsh = xs_open(0);
     if (!ctx->xsh) {
         LOGEV(ERROR, errno, "cannot connect to xenstore");
         rc = ERROR_FAIL; goto out;
@@ -171,7 +169,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
 
     if (ctx->xch) xc_interface_close(ctx->xch);
     libxl_version_info_dispose(&ctx->version_info);
-    if (ctx->xsh) xs_daemon_close(ctx->xsh);
+    if (ctx->xsh) xs_close(ctx->xsh);
     if (ctx->xce) xenevtchn_close(ctx->xce);
 
     libxl__poller_put(ctx, ctx->poller_app);
diff --git a/tools/libs/light/libxl_exec.c b/tools/libs/light/libxl_exec.c
index 47c9c8f1ba..a8b949b193 100644
--- a/tools/libs/light/libxl_exec.c
+++ b/tools/libs/light/libxl_exec.c
@@ -178,7 +178,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
     unsigned int num;
     char **l = NULL;
 
-    xsh = xs_daemon_open();
+    xsh = xs_open(0);
     if (xsh == NULL) {
         LOG(ERROR, "Unable to open xenstore connection");
         goto err;
@@ -206,7 +206,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
 
         free(p);
         xs_unwatch(xsh, path, path);
-        xs_daemon_close(xsh);
+        xs_close(xsh);
         return rc;
 again:
         free(p);
@@ -226,7 +226,7 @@ again:
     LOG(ERROR, "%s not ready", what);
 
     xs_unwatch(xsh, path, path);
-    xs_daemon_close(xsh);
+    xs_close(xsh);
 err:
     return -1;
 }
diff --git a/tools/libs/light/libxl_fork.c b/tools/libs/light/libxl_fork.c
index 9a4709b9a4..5d47dceb8a 100644
--- a/tools/libs/light/libxl_fork.c
+++ b/tools/libs/light/libxl_fork.c
@@ -663,7 +663,7 @@ int libxl__ev_child_xenstore_reopen(libxl__gc *gc, const char *what) {
     int rc;
 
     assert(!CTX->xsh);
-    CTX->xsh = xs_daemon_open();
+    CTX->xsh = xs_open(0);
     if (!CTX->xsh) {
         LOGE(ERROR, "%s: xenstore reopen failed", what);
         rc = ERROR_FAIL;  goto out;
diff --git a/tools/libs/stat/xenstat.c b/tools/libs/stat/xenstat.c
index 6f93d4e982..e49689aa2d 100644
--- a/tools/libs/stat/xenstat.c
+++ b/tools/libs/stat/xenstat.c
@@ -107,7 +107,7 @@ xenstat_handle *xenstat_init(void)
 		return NULL;
 	}
 
-	handle->xshandle = xs_daemon_open_readonly(); /* open handle to xenstore*/
+	handle->xshandle = xs_open(0); /* open handle to xenstore*/
 	if (handle->xshandle == NULL) {
 		perror("unable to open xenstore");
 		xc_interface_close(handle->xc_handle);
@@ -125,7 +125,7 @@ void xenstat_uninit(xenstat_handle * handle)
 		for (i = 0; i < NUM_COLLECTORS; i++)
 			collectors[i].uninit(handle);
 		xc_interface_close(handle->xc_handle);
-		xs_daemon_close(handle->xshandle);
+		xs_close(handle->xshandle);
 		free(handle->priv);
 		free(handle);
 	}
diff --git a/tools/libs/vchan/init.c b/tools/libs/vchan/init.c
index ad4b64fbe3..c8510e6ce9 100644
--- a/tools/libs/vchan/init.c
+++ b/tools/libs/vchan/init.c
@@ -251,7 +251,7 @@ static int init_xs_srv(struct libxenvchan *ctrl, int domain, const char* xs_base
 	char ref[16];
 	char* domid_str = NULL;
 	xs_transaction_t xs_trans = XBT_NULL;
-	xs = xs_domain_open();
+	xs = xs_open(0);
 	if (!xs)
 		goto fail;
 	domid_str = xs_read(xs, 0, "domid", NULL);
@@ -293,7 +293,7 @@ retry_transaction:
 	}
  fail_xs_open:
 	free(domid_str);
-	xs_daemon_close(xs);
+	xs_close(xs);
  fail:
 	return ret;
 }
@@ -408,9 +408,7 @@ struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
 	ctrl->write.order = ctrl->read.order = 0;
 	ctrl->is_server = 0;
 
-	xs = xs_daemon_open();
-	if (!xs)
-		xs = xs_domain_open();
+	xs = xs_open(0);
 	if (!xs)
 		goto fail;
 
@@ -452,7 +450,7 @@ struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
 
  out:
 	if (xs)
-		xs_daemon_close(xs);
+		xs_close(xs);
 	return ctrl;
  fail:
 	libxenvchan_close(ctrl);
diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c
index 79ad34cb4a..a3a2741242 100644
--- a/tools/misc/xen-lowmemd.c
+++ b/tools/misc/xen-lowmemd.c
@@ -24,7 +24,7 @@ void cleanup(void)
     if (xch)
         xc_interface_close(xch);
     if (xs_handle)
-        xs_daemon_close(xs_handle);
+        xs_close(xs_handle);
 }
 
 /* Never shrink dom0 below 1 GiB */
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
         return 2;
     }
 
-    xs_handle = xs_daemon_open();
+    xs_handle = xs_open(0);
     if (xs_handle == NULL)
     {
         perror("Failed to open xenstore connection");
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
index b7d4b6ef5d..0dad7fa5f2 100644
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -791,7 +791,7 @@ static PyObject *xspy_close(XsHandle *self)
         PySequence_SetItem(self->watches, i, Py_None);
     }
 
-    xs_daemon_close(xh);
+    xs_close(xh);
     self->xh = NULL;
 
     Py_INCREF(Py_None);
@@ -985,7 +985,7 @@ xshandle_init(XsHandle *self, PyObject *args, PyObject *kwds)
                                      &readonly))
         goto fail;
 
-    self->xh = (readonly ? xs_daemon_open_readonly() : xs_daemon_open());
+    self->xh = xs_open(0);
     if (!self->xh)
         goto fail;
 
@@ -999,7 +999,7 @@ xshandle_init(XsHandle *self, PyObject *args, PyObject *kwds)
 static void xshandle_dealloc(XsHandle *self)
 {
     if (self->xh) {
-        xs_daemon_close(self->xh);
+        xs_close(self->xh);
         self->xh = NULL;
     }
 
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index 380e42190c..1187d01e5f 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -411,13 +411,13 @@ static long xs_get_dom_mem(int domid)
     unsigned int plen;
     struct xs_handle *xs;
 
-    xs = xs_daemon_open();
+    xs = xs_open(0);
     if (!xs)
         return -1;
 
     sprintf(path, "/local/domain/%d/memory/target", domid);
     memstr = xs_read(xs, XBT_NULL, path, &plen);
-    xs_daemon_close(xs);
+    xs_close(xs);
 
     if (!memstr || !plen)
         return -1;
diff --git a/tools/xenbackendd/xenbackendd.c b/tools/xenbackendd/xenbackendd.c
index b6d92984e0..21884af772 100644
--- a/tools/xenbackendd/xenbackendd.c
+++ b/tools/xenbackendd/xenbackendd.c
@@ -122,7 +122,7 @@ usage(void)
 static int
 xen_setup(void)
 {
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		dolog(LOG_ERR,
 		    "Failed to contact xenstore (%s).  Is it running?",
@@ -138,7 +138,7 @@ xen_setup(void)
 
  out:
 	if (xs) {
-		xs_daemon_close(xs);
+		xs_close(xs);
 		xs = NULL;
 	}
 	return -1;
diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
index 1c801caa71..35fd1c931a 100644
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -502,18 +502,18 @@ int main(int argc, char *argv[])
 #ifndef RUN_STANDALONE
     daemonize();
 #endif
-    xs = (struct xs_handle *)xs_daemon_open();
+    xs = xs_open(0);
     if ( xs == NULL ) 
         return -1;
 
     if ( write_one_time_battery_info() == 0 ) 
     {
-        xs_daemon_close(xs);
+        xs_close(xs);
         return -1;
     }
 
     wait_for_and_update_battery_status_request();
-    xs_daemon_close(xs);
+    xs_close(xs);
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4474.11656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSW-0004HN-Fe; Thu, 08 Oct 2020 12:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4474.11656; Thu, 08 Oct 2020 12:55:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSW-0004HF-BA; Thu, 08 Oct 2020 12:55:48 +0000
Received: by outflank-mailman (input) for mailman id 4474;
 Thu, 08 Oct 2020 12:55:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVSV-0004H5-Ej
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f4c535b5-ad74-4459-9ff1-51eac2dbcf43;
 Thu, 08 Oct 2020 12:55:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSU-00045e-BJ
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSU-0004Wx-Ab
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVSV-0004H5-Ej
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:47 +0000
X-Inumbo-ID: f4c535b5-ad74-4459-9ff1-51eac2dbcf43
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f4c535b5-ad74-4459-9ff1-51eac2dbcf43;
	Thu, 08 Oct 2020 12:55:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VyaMaonUkAFHzVT+ARxGQpuh17MN6dc8VXcR1ocy9eY=; b=4zH07piwE6+nJNtBCrShF5F1tm
	gyIBkU94AjsXm0DccJr/k49WzRgztYIY9+5I5adODEjtfJq6j9lX0Pi+WDYc6lq6kD0JVPuKQUDTF
	iLBlRGrWe3SHVB8FzYDghOuJf8+4E2d4ClWkPqPX5kPClXwM6fjplibGTLoaL1vkWeuE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSU-00045e-BJ
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSU-0004Wx-Ab
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstore: drop creation of read-only socket in xenstored
Message-Id: <E1kQVSU-0004Wx-Ab@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:46 +0000

commit 1d246c721d44729c2e335e3be9979f5005016319
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:41 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:48:02 2020 +0000

    tools/xenstore: drop creation of read-only socket in xenstored
    
    With xs_daemon_open_readonly() now no longer using the read-only socket
    the creation of that socket can be dropped.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/xenstore/xenstored_core.c   | 55 ++++++++-------------------------------
 tools/xenstore/xenstored_core.h   |  3 ---
 tools/xenstore/xenstored_domain.c |  4 +--
 tools/xenstore/xs_lib.c           |  8 +-----
 4 files changed, 14 insertions(+), 56 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9700772d40..b4be374d3f 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -71,7 +71,6 @@ static unsigned int current_array_size;
 static unsigned int nr_fds;
 
 static int sock = -1;
-static int ro_sock = -1;
 
 static bool verbose = false;
 LIST_HEAD(connections);
@@ -311,8 +310,7 @@ fail:
 	return -1;
 }
 
-static void initialize_fds(int *p_sock_pollfd_idx, int *p_ro_sock_pollfd_idx,
-			   int *ptimeout)
+static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 {
 	struct connection *conn;
 	struct wrl_timestampt now;
@@ -325,8 +323,6 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *p_ro_sock_pollfd_idx,
 
 	if (sock != -1)
 		*p_sock_pollfd_idx = set_fd(sock, POLLIN|POLLPRI);
-	if (ro_sock != -1)
-		*p_ro_sock_pollfd_idx = set_fd(ro_sock, POLLIN|POLLPRI);
 	if (reopen_log_pipe[0] != -1)
 		reopen_log_pipe0_pollfd_idx =
 			set_fd(reopen_log_pipe[0], POLLIN|POLLPRI);
@@ -472,9 +468,6 @@ static enum xs_perm_type perm_for_conn(struct connection *conn,
 	unsigned int i;
 	enum xs_perm_type mask = XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER;
 
-	if (!conn->can_write)
-		mask &= ~XS_PERM_WRITE;
-
 	/* Owners and tools get it all... */
 	if (!domain_is_unprivileged(conn) || perms[0].id == conn->id
                 || (conn->target && perms[0].id == conn->target->id))
@@ -1422,7 +1415,6 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 	new->pollfd_idx = -1;
 	new->write = write;
 	new->read = read;
-	new->can_write = true;
 	new->transaction_started = 0;
 	INIT_LIST_HEAD(&new->out_list);
 	INIT_LIST_HEAD(&new->watches);
@@ -1435,7 +1427,7 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 }
 
 #ifdef NO_SOCKETS
-static void accept_connection(int sock, bool canwrite)
+static void accept_connection(int sock)
 {
 }
 #else
@@ -1477,7 +1469,7 @@ static int readfd(struct connection *conn, void *data, unsigned int len)
 	return rc;
 }
 
-static void accept_connection(int sock, bool canwrite)
+static void accept_connection(int sock)
 {
 	int fd;
 	struct connection *conn;
@@ -1487,10 +1479,9 @@ static void accept_connection(int sock, bool canwrite)
 		return;
 
 	conn = new_connection(writefd, readfd);
-	if (conn) {
+	if (conn)
 		conn->fd = fd;
-		conn->can_write = canwrite;
-	} else
+	else
 		close(fd);
 }
 #endif
@@ -1794,28 +1785,21 @@ static void destroy_fds(void)
 {
 	if (sock >= 0)
 		close(sock);
-	if (ro_sock >= 0)
-		close(ro_sock);
 }
 
 static void init_sockets(void)
 {
 	struct sockaddr_un addr;
 	const char *soc_str = xs_daemon_socket();
-	const char *soc_str_ro = xs_daemon_socket_ro();
 
 	/* Create sockets for them to listen to. */
 	atexit(destroy_fds);
 	sock = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (sock < 0)
 		barf_perror("Could not create socket");
-	ro_sock = socket(PF_UNIX, SOCK_STREAM, 0);
-	if (ro_sock < 0)
-		barf_perror("Could not create socket");
 
 	/* FIXME: Be more sophisticated, don't mug running daemon. */
 	unlink(soc_str);
-	unlink(soc_str_ro);
 
 	addr.sun_family = AF_UNIX;
 
@@ -1825,17 +1809,10 @@ static void init_sockets(void)
 	if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
 		barf_perror("Could not bind socket to %s", soc_str);
 
-	if(strlen(soc_str_ro) >= sizeof(addr.sun_path))
-		barf_perror("socket string '%s' too long", soc_str_ro);
-	strcpy(addr.sun_path, soc_str_ro);
-	if (bind(ro_sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s", soc_str_ro);
-
-	if (chmod(soc_str, 0600) != 0
-	    || chmod(soc_str_ro, 0660) != 0)
+	if (chmod(soc_str, 0600) != 0)
 		barf_perror("Could not chmod sockets");
 
-	if (listen(sock, 1) != 0 || listen(ro_sock, 1) != 0)
+	if (listen(sock, 1) != 0)
 		barf_perror("Could not listen on sockets");
 }
 #endif
@@ -1893,7 +1870,7 @@ int priv_domid = 0;
 int main(int argc, char *argv[])
 {
 	int opt;
-	int sock_pollfd_idx = -1, ro_sock_pollfd_idx = -1;
+	int sock_pollfd_idx = -1;
 	bool dofork = true;
 	bool outputpid = false;
 	bool no_domain_init = false;
@@ -2010,7 +1987,7 @@ int main(int argc, char *argv[])
 		tracefile = talloc_strdup(NULL, tracefile);
 
 	/* Get ready to listen to the tools. */
-	initialize_fds(&sock_pollfd_idx, &ro_sock_pollfd_idx, &timeout);
+	initialize_fds(&sock_pollfd_idx, &timeout);
 
 	/* Tell the kernel we're up and running. */
 	xenbus_notify_running();
@@ -2051,21 +2028,11 @@ int main(int argc, char *argv[])
 				barf_perror("sock poll failed");
 				break;
 			} else if (fds[sock_pollfd_idx].revents & POLLIN) {
-				accept_connection(sock, true);
+				accept_connection(sock);
 				sock_pollfd_idx = -1;
 			}
 		}
 
-		if (ro_sock_pollfd_idx != -1) {
-			if (fds[ro_sock_pollfd_idx].revents & ~POLLIN) {
-				barf_perror("ro sock poll failed");
-				break;
-			} else if (fds[ro_sock_pollfd_idx].revents & POLLIN) {
-				accept_connection(ro_sock, false);
-				ro_sock_pollfd_idx = -1;
-			}
-		}
-
 		if (xce_pollfd_idx != -1) {
 			if (fds[xce_pollfd_idx].revents & ~POLLIN) {
 				barf_perror("xce_handle poll failed");
@@ -2128,7 +2095,7 @@ int main(int argc, char *argv[])
 			}
 		}
 
-		initialize_fds(&sock_pollfd_idx, &ro_sock_pollfd_idx, &timeout);
+		initialize_fds(&sock_pollfd_idx, &timeout);
 	}
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index c4c32bc88f..1df6ad94ab 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -77,9 +77,6 @@ struct connection
 	/* Who am I? 0 for socket connections. */
 	unsigned int id;
 
-	/* Is this a read-only connection? */
-	bool can_write;
-
 	/* Buffered incoming data. */
 	struct buffered_data *in;
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 0d5495745b..a2f144f6dd 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -372,7 +372,7 @@ int do_introduce(struct connection *conn, struct buffered_data *in)
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
 		return EINVAL;
 
-	if (domain_is_unprivileged(conn) || !conn->can_write)
+	if (domain_is_unprivileged(conn))
 		return EACCES;
 
 	domid = atoi(vec[0]);
@@ -438,7 +438,7 @@ int do_set_target(struct connection *conn, struct buffered_data *in)
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
 		return EINVAL;
 
-	if (domain_is_unprivileged(conn) || !conn->can_write)
+	if (domain_is_unprivileged(conn))
 		return EACCES;
 
 	domid = atoi(vec[0]);
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index 3e43f8809d..9f1dc6d559 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -63,13 +63,7 @@ const char *xs_daemon_socket(void)
 
 const char *xs_daemon_socket_ro(void)
 {
-	static char buf[PATH_MAX];
-	const char *s = xs_daemon_path();
-	if (s == NULL)
-		return NULL;
-	if (snprintf(buf, sizeof(buf), "%s_ro", s) >= PATH_MAX)
-		return NULL;
-	return buf;
+	return xs_daemon_path();
 }
 
 const char *xs_domain_dev(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 12:55:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 12:55:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4476.11659 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSh-0004JD-IZ; Thu, 08 Oct 2020 12:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4476.11659; Thu, 08 Oct 2020 12:55:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVSh-0004J4-FC; Thu, 08 Oct 2020 12:55:59 +0000
Received: by outflank-mailman (input) for mailman id 4476;
 Thu, 08 Oct 2020 12:55:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVSf-0004It-TA
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e33d5a5c-a87a-4c7e-9dc0-4227c4314a60;
 Thu, 08 Oct 2020 12:55:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSe-00045p-EK
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVSe-0004Xi-DY
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVSf-0004It-TA
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:57 +0000
X-Inumbo-ID: e33d5a5c-a87a-4c7e-9dc0-4227c4314a60
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e33d5a5c-a87a-4c7e-9dc0-4227c4314a60;
	Thu, 08 Oct 2020 12:55:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rLkBZxsZoIC/4bWKOZh+IACJBuEYkHiu8qDUokO1VO8=; b=tDE33LUP+c+z3+tgRrnTJoUYdI
	vgfB0cmka0ZHAmP3XmglsztXapWtvjl8RPESUTmW52EVSI2pxevNkY1O6jr/9ZeRp2So5J/NOzncp
	rNMHuPYA6L9e4i4YTuVtLhE5+f1pdcc8nfLjxukwo/hel3CRf3PRoT7ILIWAnstyQd1o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSe-00045p-EK
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVSe-0004Xi-DY
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 12:55:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/ocaml/xenstored: drop the creation of the RO socket
Message-Id: <E1kQVSe-0004Xi-DY@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 12:55:56 +0000

commit a06d3feea3b7e8b6a83b39221a2f289e89157cbc
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Oct 2 17:06:32 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:54:00 2020 +0000

    tools/ocaml/xenstored: drop the creation of the RO socket
    
    The readonly flag was propagated but ignored, so this was essentially
    equivalent to a RW socket.
    
    C xenstored is dropping the RO socket too, so drop it from oxenstored too.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/ocaml/xenstored/connections.ml |  2 +-
 tools/ocaml/xenstored/define.ml      |  1 -
 tools/ocaml/xenstored/xenstored.ml   | 15 ++++++---------
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index f02ef6b526..f2c4318c88 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -31,7 +31,7 @@ let create () = {
 	watches = Trie.create ()
 }
 
-let add_anonymous cons fd _can_write =
+let add_anonymous cons fd =
 	let xbcon = Xenbus.Xb.open_fd fd in
 	let con = Connection.create xbcon None in
 	Hashtbl.add cons.anonymous (Xenbus.Xb.get_fd xbcon) con
diff --git a/tools/ocaml/xenstored/define.ml b/tools/ocaml/xenstored/define.ml
index 2965c08534..ea9e1b7620 100644
--- a/tools/ocaml/xenstored/define.ml
+++ b/tools/ocaml/xenstored/define.ml
@@ -18,7 +18,6 @@ let xenstored_major = 1
 let xenstored_minor = 0
 
 let xs_daemon_socket = Paths.xen_run_stored ^ "/socket"
-let xs_daemon_socket_ro = Paths.xen_run_stored ^ "/socket_ro"
 
 let default_config_dir = Paths.xen_config_dir
 
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 5b96f1852a..7e7824761b 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -242,12 +242,11 @@ let _ =
 		()
 	);
 
-	let rw_sock, ro_sock =
+	let rw_sock =
 		if cf.disable_socket then
-			None, None
+			None
 		else
-			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket),
-			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket_ro)
+			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket)
 		in
 
 	if cf.daemonize then
@@ -320,15 +319,14 @@ let _ =
 
 	let spec_fds =
 		(match rw_sock with None -> [] | Some x -> [ x ]) @
-		(match ro_sock with None -> [] | Some x -> [ x ]) @
 		(if cf.domain_init then [ Event.fd eventchn ] else [])
 		in
 
 	let process_special_fds rset =
-		let accept_connection can_write fd =
+		let accept_connection fd =
 			let (cfd, _addr) = Unix.accept fd in
 			debug "new connection through socket";
-			Connections.add_anonymous cons cfd can_write
+			Connections.add_anonymous cons cfd
 		and handle_eventchn _fd =
 			let port = Event.pending eventchn in
 			debug "pending port %d" (Xeneventchn.to_int port);
@@ -348,8 +346,7 @@ let _ =
 			if List.mem fd set then
 				fct fd in
 
-		maybe (fun fd -> do_if_set fd rset (accept_connection true)) rw_sock;
-		maybe (fun fd -> do_if_set fd rset (accept_connection false)) ro_sock;
+		maybe (fun fd -> do_if_set fd rset accept_connection) rw_sock;
 		do_if_set (Event.fd eventchn) rset (handle_eventchn)
 	in
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 13:00:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 13:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4483.11675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVWj-0005G8-5O; Thu, 08 Oct 2020 13:00:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4483.11675; Thu, 08 Oct 2020 13:00:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQVWj-0005G0-2L; Thu, 08 Oct 2020 13:00:09 +0000
Received: by outflank-mailman (input) for mailman id 4483;
 Thu, 08 Oct 2020 13:00:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQVWh-0005Ci-1v
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 694d3c7f-c132-4ca9-a97a-e89a32472f35;
 Thu, 08 Oct 2020 13:00:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVWf-0004En-Uc
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQVWf-000571-TX
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQVWh-0005Ci-1v
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:07 +0000
X-Inumbo-ID: 694d3c7f-c132-4ca9-a97a-e89a32472f35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 694d3c7f-c132-4ca9-a97a-e89a32472f35;
	Thu, 08 Oct 2020 13:00:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bI3AjLmby6HKKGKJBhenF/hr+zDpwL/J0BuaUVr87Uo=; b=fK0ctlCjwmuZz/GBbiY84Hr92D
	QMTerCNuc8V0C3kB6GzL30VARzv0+s1Vy9goRX7vRrKPnhoxhZJrgrE/GYNVC/L40MDu/WhyACBL/
	hbgkW33kDuqWqde6HazHdFgCDPLCU0cwAXVGTXJxQLJ4yN13U+QFFytQc8QnXvOWMdl0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVWf-0004En-Uc
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQVWf-000571-TX
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 13:00:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tool/libs/light: Fix libxenlight gcc warning
Message-Id: <E1kQVWf-000571-TX@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 13:00:05 +0000

commit 0241809bf838875615797f52af34222e5ab8e98f
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 14:57:02 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:56:03 2020 +0000

    tool/libs/light: Fix libxenlight gcc warning
    
    Fix gcc10 compilation warning about uninitialized variable by setting
    it to 0.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_mem.c b/tools/libs/light/libxl_mem.c
index e52a9624ea..c739d00f39 100644
--- a/tools/libs/light/libxl_mem.c
+++ b/tools/libs/light/libxl_mem.c
@@ -562,7 +562,7 @@ out:
 
 int libxl_get_free_memory_0x040700(libxl_ctx *ctx, uint32_t *memkb)
 {
-    uint64_t my_memkb;
+    uint64_t my_memkb = 0;
     int rc;
 
     rc = libxl_get_free_memory(ctx, &my_memkb);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4635.12273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdhl-0007EN-MM; Thu, 08 Oct 2020 21:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4635.12273; Thu, 08 Oct 2020 21:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdhl-0007EF-JP; Thu, 08 Oct 2020 21:44:05 +0000
Received: by outflank-mailman (input) for mailman id 4635;
 Thu, 08 Oct 2020 21:44:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdhk-0007E9-D0
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 83a9614e-c094-4f89-9a74-fad72e79d2f7;
 Thu, 08 Oct 2020 21:44:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdhi-0007eV-7f
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdhi-00054V-6I
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdhk-0007E9-D0
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:04 +0000
X-Inumbo-ID: 83a9614e-c094-4f89-9a74-fad72e79d2f7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 83a9614e-c094-4f89-9a74-fad72e79d2f7;
	Thu, 08 Oct 2020 21:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ax/63I2/+HfIfXQM0b2dtBmuOaJ11h0xi6+HiMbzWD0=; b=g1o65Xsy7IETMyGBAzHfSGiyBS
	XvlB8uoVd6lxnX6bHkLagupdZK7dW0HXx9KWDi9EHlm+Ax5fBwt+hWM6GzXDFgZ3r6RIEKJRJSpx4
	qaxdMxJhTcnfOaAOrHLY0AQu9pe3ifuqFHY5uxHjqozMtixQOHYMJoikXCXwiPUoLFMw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdhi-0007eV-7f
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdhi-00054V-6I
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/vpt: fix race when migrating timers between vCPUs
Message-Id: <E1kQdhi-00054V-6I@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:02 +0000

commit 4218b74d878574ac7724af4dbeeb3298c4053e90
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:27:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:27:52 2020 +0200

    x86/vpt: fix race when migrating timers between vCPUs
    
    The current vPT code will migrate the emulated timers between vCPUs
    (change the pt->vcpu field) while just holding the destination lock,
    either from create_periodic_time or pt_adjust_global_vcpu_target if
    the global target is adjusted. Changing the periodic_timer vCPU field
    in this way creates a race where a third party could grab the lock in
    the unlocked region of pt_adjust_global_vcpu_target (or before
    create_periodic_time performs the vcpu change) and then release the
    lock from a different vCPU, creating a locking imbalance.
    
    Introduce a per-domain rwlock in order to protect periodic_time
    migration between vCPU lists. Taking the lock in read mode prevents
    any timer from being migrated to a different vCPU, while taking it in
    write mode allows performing migration of timers across vCPUs. The
    per-vcpu locks are still used to protect all the other fields from the
    periodic_timer struct.
    
    Note that such migration shouldn't happen frequently, and hence
    there's no performance drop as a result of such locking.
    
    This is XSA-336.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Tested-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |  2 ++
 xen/arch/x86/hvm/vpt.c        | 77 +++++++++++++++++++++----------------------
 xen/include/asm-x86/hvm/vpt.h |  7 ++++
 3 files changed, 47 insertions(+), 39 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 698ab63340..91a997c946 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -614,6 +614,8 @@ int hvm_domain_initialise(struct domain *d, unsigned long domcr_flags,
     /* need link to containing domain */
     d->arch.hvm_domain.pl_time->domain = d;
 
+    rwlock_init(&d->arch.hvm_domain.pl_time->pt_migrate);
+
     /* Set the default IO Bitmap. */
     if ( is_hardware_domain(d) )
     {
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 04e3c2e15b..5b83ca53b0 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -152,23 +152,32 @@ static int pt_irq_masked(struct periodic_time *pt)
     return 1;
 }
 
-static void pt_lock(struct periodic_time *pt)
+static void pt_vcpu_lock(struct vcpu *v)
 {
-    struct vcpu *v;
+    read_lock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
+    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+}
 
-    for ( ; ; )
-    {
-        v = pt->vcpu;
-        spin_lock(&v->arch.hvm_vcpu.tm_lock);
-        if ( likely(pt->vcpu == v) )
-            break;
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
-    }
+static void pt_vcpu_unlock(struct vcpu *v)
+{
+    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    read_unlock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
+}
+
+static void pt_lock(struct periodic_time *pt)
+{
+    /*
+     * We cannot use pt_vcpu_lock here, because we need to acquire the
+     * per-domain lock first and then (re-)fetch the value of pt->vcpu, or
+     * else we might be using a stale value of pt->vcpu.
+     */
+    read_lock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
+    spin_lock(&pt->vcpu->arch.hvm_vcpu.tm_lock);
 }
 
 static void pt_unlock(struct periodic_time *pt)
 {
-    spin_unlock(&pt->vcpu->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(pt->vcpu);
 }
 
 static void pt_process_missed_ticks(struct periodic_time *pt)
@@ -218,7 +227,7 @@ void pt_save_timer(struct vcpu *v)
     if ( v->pause_flags & VPF_blocked )
         return;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         if ( !pt->do_not_freeze )
@@ -226,7 +235,7 @@ void pt_save_timer(struct vcpu *v)
 
     pt_freeze_time(v);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void pt_restore_timer(struct vcpu *v)
@@ -234,7 +243,7 @@ void pt_restore_timer(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
     {
@@ -247,7 +256,7 @@ void pt_restore_timer(struct vcpu *v)
 
     pt_thaw_time(v);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 static void pt_timer_fn(void *data)
@@ -272,7 +281,7 @@ int pt_update_irq(struct vcpu *v)
     uint64_t max_lag;
     int irq, pt_vector = -1;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     earliest_pt = NULL;
     max_lag = -1ULL;
@@ -300,14 +309,14 @@ int pt_update_irq(struct vcpu *v)
 
     if ( earliest_pt == NULL )
     {
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+        pt_vcpu_unlock(v);
         return -1;
     }
 
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 
     switch ( earliest_pt->source )
     {
@@ -377,12 +386,12 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     if ( intack.source == hvm_intsrc_vector )
         return;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     pt = is_pt_irq(v, intack);
     if ( pt == NULL )
     {
-        spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+        pt_vcpu_unlock(v);
         return;
     }
 
@@ -421,7 +430,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
     cb = pt->cb;
     cb_priv = pt->priv;
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 
     if ( cb != NULL )
         cb(v, cb_priv);
@@ -432,12 +441,12 @@ void pt_migrate(struct vcpu *v)
     struct list_head *head = &v->arch.hvm_vcpu.tm_list;
     struct periodic_time *pt;
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_lock(v);
 
     list_for_each_entry ( pt, head, list )
         migrate_timer(&pt->timer, v->processor);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    pt_vcpu_unlock(v);
 }
 
 void create_periodic_time(
@@ -455,7 +464,7 @@ void create_periodic_time(
 
     destroy_periodic_time(pt);
 
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    write_lock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
 
     pt->pending_intr_nr = 0;
     pt->do_not_freeze = 0;
@@ -504,7 +513,7 @@ void create_periodic_time(
     init_timer(&pt->timer, pt_timer_fn, pt, v->processor);
     set_timer(&pt->timer, pt->scheduled);
 
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    write_unlock(&v->domain->arch.hvm_domain.pl_time->pt_migrate);
 }
 
 void destroy_periodic_time(struct periodic_time *pt)
@@ -529,30 +538,20 @@ void destroy_periodic_time(struct periodic_time *pt)
 
 static void pt_adjust_vcpu(struct periodic_time *pt, struct vcpu *v)
 {
-    int on_list;
-
     ASSERT(pt->source == PTSRC_isa || pt->source == PTSRC_ioapic);
 
     if ( pt->vcpu == NULL )
         return;
 
-    pt_lock(pt);
-    on_list = pt->on_list;
-    if ( pt->on_list )
-        list_del(&pt->list);
-    pt->on_list = 0;
-    pt_unlock(pt);
-
-    spin_lock(&v->arch.hvm_vcpu.tm_lock);
+    write_lock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
     pt->vcpu = v;
-    if ( on_list )
+    if ( pt->on_list )
     {
-        pt->on_list = 1;
+        list_del(&pt->list);
         list_add(&pt->list, &v->arch.hvm_vcpu.tm_list);
-
         migrate_timer(&pt->timer, v->processor);
     }
-    spin_unlock(&v->arch.hvm_vcpu.tm_lock);
+    write_unlock(&pt->vcpu->domain->arch.hvm_domain.pl_time->pt_migrate);
 }
 
 void pt_adjust_global_vcpu_target(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 0eb5ff632e..ed8de96191 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -133,6 +133,13 @@ struct pl_time {    /* platform time */
     struct RTCState  vrtc;
     struct HPETState vhpet;
     struct PMTState  vpmt;
+    /*
+     * rwlock to prevent periodic_time vCPU migration. Take the lock in read
+     * mode in order to prevent the vcpu field of periodic_time from changing.
+     * Lock must be taken in write mode when changes to the vcpu field are
+     * performed, as it allows exclusive access to all the timers of a domain.
+     */
+    rwlock_t pt_migrate;
     /* guest_time = Xen sys time + stime_offset */
     int64_t stime_offset;
     /* Ensures monotonicity in appropriate timer modes. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4636.12277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdht-0007FI-Nr; Thu, 08 Oct 2020 21:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4636.12277; Thu, 08 Oct 2020 21:44:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdht-0007FA-Kq; Thu, 08 Oct 2020 21:44:13 +0000
Received: by outflank-mailman (input) for mailman id 4636;
 Thu, 08 Oct 2020 21:44:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdht-0007F4-AG
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b261c3a3-fdcd-44ba-be55-80830b1b182d;
 Thu, 08 Oct 2020 21:44:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdhs-0007eb-CL
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdhs-00055h-9r
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdht-0007F4-AG
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:13 +0000
X-Inumbo-ID: b261c3a3-fdcd-44ba-be55-80830b1b182d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b261c3a3-fdcd-44ba-be55-80830b1b182d;
	Thu, 08 Oct 2020 21:44:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D4QdhuHbL8bLAzDLkbvMMwlIBqjCDvJMVCl3OIOVP2w=; b=EZVXZqUH8m8ykIFm0GWWYcaM/G
	zMduWV+IUJFA1qMVGrJn8liR4aPKaidE4FTlxjfKyljJHuBynZ/Io19YCxtvqFb7pNrgHWX36q9ga
	wpWyuFHkPRxRVTbWv0TLCG16VLVgl27SHVWdz+Y/QG0cNMrGBA/xiYA7Q8eqxJclj/W4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdhs-0007eb-CL
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdhs-00055h-9r
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/msi: get rid of read_msi_msg
Message-Id: <E1kQdhs-00055h-9r@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:12 +0000

commit 3d14937f4a6f1906f4883a59959ee5ba8aa2f388
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Sep 22 17:28:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:28:49 2020 +0200

    x86/msi: get rid of read_msi_msg
    
    It's safer and faster to just use the cached last written
    (untranslated) MSI message stored in msi_desc for the single user that
    calls read_msi_msg.
    
    This also prevents relying on the data read from the device MSI
    registers in order to figure out the index into the IOMMU interrupt
    remapping table, which is not safe.
    
    This is part of XSA-337.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c | 58 +-----------------------------------------------------
 1 file changed, 1 insertion(+), 57 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 475881ed89..8c5fac1f69 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -191,59 +191,6 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
                 MSI_DATA_VECTOR(vector);
 }
 
-static bool read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
-{
-    switch ( entry->msi_attrib.type )
-    {
-    case PCI_CAP_ID_MSI:
-    {
-        struct pci_dev *dev = entry->dev;
-        int pos = entry->msi_attrib.pos;
-        u16 data, seg = dev->seg;
-        u8 bus = dev->bus;
-        u8 slot = PCI_SLOT(dev->devfn);
-        u8 func = PCI_FUNC(dev->devfn);
-
-        msg->address_lo = pci_conf_read32(seg, bus, slot, func,
-                                          msi_lower_address_reg(pos));
-        if ( entry->msi_attrib.is_64 )
-        {
-            msg->address_hi = pci_conf_read32(seg, bus, slot, func,
-                                              msi_upper_address_reg(pos));
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 1));
-        }
-        else
-        {
-            msg->address_hi = 0;
-            data = pci_conf_read16(seg, bus, slot, func,
-                                   msi_data_reg(pos, 0));
-        }
-        msg->data = data;
-        break;
-    }
-    case PCI_CAP_ID_MSIX:
-    {
-        void __iomem *base = entry->mask_base;
-
-        if ( unlikely(!msix_memory_decoded(entry->dev,
-                                           entry->msi_attrib.pos)) )
-            return false;
-        msg->address_lo = readl(base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-        msg->address_hi = readl(base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-        msg->data = readl(base + PCI_MSIX_ENTRY_DATA_OFFSET);
-        break;
-    }
-    default:
-        BUG();
-    }
-
-    if ( iommu_intremap )
-        iommu_read_msi_from_ire(entry, msg);
-
-    return true;
-}
-
 static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
@@ -321,10 +268,7 @@ void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 
     ASSERT(spin_is_locked(&desc->lock));
 
-    memset(&msg, 0, sizeof(msg));
-    if ( !read_msi_msg(msi_desc, &msg) )
-        return;
-
+    msg = msi_desc->msg;
     msg.data &= ~MSI_DATA_VECTOR_MASK;
     msg.data |= MSI_DATA_VECTOR(desc->arch.vector);
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4637.12281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdi4-0007Gz-PW; Thu, 08 Oct 2020 21:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4637.12281; Thu, 08 Oct 2020 21:44:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdi4-0007Gr-MW; Thu, 08 Oct 2020 21:44:24 +0000
Received: by outflank-mailman (input) for mailman id 4637;
 Thu, 08 Oct 2020 21:44:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdi3-0007Gj-JZ
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1c778365-26b7-4dd3-b19c-6ecf140dd078;
 Thu, 08 Oct 2020 21:44:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdi2-0007fN-GL
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdi2-00056m-EP
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdi3-0007Gj-JZ
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:23 +0000
X-Inumbo-ID: 1c778365-26b7-4dd3-b19c-6ecf140dd078
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1c778365-26b7-4dd3-b19c-6ecf140dd078;
	Thu, 08 Oct 2020 21:44:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7lR623gl7dhLW1szp/tYbPgDO+XEqItWIlTkX+khmJQ=; b=wqK32sgO6l4vPKeugYzek1CrgD
	nBCZbZMmFcRobur69ksG4c2PEnM1X4OeKIbmTtNZov2bpka36IwEHZhka7eXpKd2TxGITGPxOP6ES
	p+9T9s1cU3NifvUt/dp6XShxh7mNay7PxVakQyYDYKcvSGEK1tSyMRtrsGUXFLAP8fpI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdi2-0007fN-GL
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdi2-00056m-EP
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/MSI-X: restrict reading of table/PBA bases from BARs
Message-Id: <E1kQdi2-00056m-EP@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:22 +0000

commit 635ae1244a2a9f7a6b10ccec76fca58ac5ec2bc3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:29:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:29:19 2020 +0200

    x86/MSI-X: restrict reading of table/PBA bases from BARs
    
    When assigned to less trusted or un-trusted guests, devices may change
    state behind our backs (they may e.g. get reset by means we may not know
    about). Therefore we should avoid reading BARs from hardware once a
    device is no longer owned by Dom0. Furthermore when we can't read a BAR,
    or when we read zero, we shouldn't instead use the caller provided
    address unless that caller can be trusted.
    
    Re-arrange the logic in msix_capability_init() such that only Dom0 (and
    only if the device isn't DomU-owned yet) or calls through
    PHYSDEVOP_prepare_msix will actually result in the reading of the
    respective BAR register(s). Additionally do so only as long as in-use
    table entries are known (note that invocation of PHYSDEVOP_prepare_msix
    counts as a "pseudo" entry). In all other uses the value already
    recorded will get used instead.
    
    Clear the recorded values in _pci_cleanup_msix() as well as on the one
    affected error path. (Adjust this error path to also avoid blindly
    disabling MSI-X when it was enabled on entry to the function.)
    
    While moving around variable declarations (in many cases to reduce their
    scopes), also adjust some of their types.
    
    This is part of XSA-337.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 97 ++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 61 insertions(+), 36 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 8c5fac1f69..77fde75df7 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -785,16 +785,14 @@ static int msix_capability_init(struct pci_dev *dev,
 {
     struct arch_msix *msix = dev->msix;
     struct msi_desc *entry = NULL;
-    int vf;
     u16 control;
     u64 table_paddr;
     u32 table_offset;
-    u8 bir, pbus, pslot, pfunc;
     u16 seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
     u8 func = PCI_FUNC(dev->devfn);
-    bool maskall = msix->host_maskall;
+    bool maskall = msix->host_maskall, zap_on_error = false;
 
     ASSERT(pcidevs_locked());
 
@@ -832,43 +830,45 @@ static int msix_capability_init(struct pci_dev *dev,
     /* Locate MSI-X table region */
     table_offset = pci_conf_read32(seg, bus, slot, func,
                                    msix_table_offset_reg(pos));
-    bir = (u8)(table_offset & PCI_MSIX_BIRMASK);
-    table_offset &= ~PCI_MSIX_BIRMASK;
-
-    if ( !dev->info.is_virtfn )
-    {
-        pbus = bus;
-        pslot = slot;
-        pfunc = func;
-        vf = -1;
-    }
-    else
+    if ( !msix->used_entries &&
+         (!msi ||
+          (is_hardware_domain(current->domain) &&
+           (dev->domain == current->domain || dev->domain == dom_io))) )
     {
-        pbus = dev->info.physfn.bus;
-        pslot = PCI_SLOT(dev->info.physfn.devfn);
-        pfunc = PCI_FUNC(dev->info.physfn.devfn);
-        vf = PCI_BDF2(dev->bus, dev->devfn);
-    }
+        unsigned int bir = table_offset & PCI_MSIX_BIRMASK, pbus, pslot, pfunc;
+        int vf;
+        paddr_t pba_paddr;
+        unsigned int pba_offset;
 
-    table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
-    WARN_ON(msi && msi->table_base != table_paddr);
-    if ( !table_paddr )
-    {
-        if ( !msi || !msi->table_base )
+        if ( !dev->info.is_virtfn )
         {
-            pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
-            xfree(entry);
-            return -ENXIO;
+            pbus = bus;
+            pslot = slot;
+            pfunc = func;
+            vf = -1;
+        }
+        else
+        {
+            pbus = dev->info.physfn.bus;
+            pslot = PCI_SLOT(dev->info.physfn.devfn);
+            pfunc = PCI_FUNC(dev->info.physfn.devfn);
+            vf = PCI_BDF2(dev->bus, dev->devfn);
         }
-        table_paddr = msi->table_base;
-    }
-    table_paddr += table_offset;
 
-    if ( !msix->used_entries )
-    {
-        u64 pba_paddr;
-        u32 pba_offset;
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        WARN_ON(msi && msi->table_base != table_paddr);
+        if ( !table_paddr )
+        {
+            if ( !msi || !msi->table_base )
+            {
+                pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                                 control & ~PCI_MSIX_FLAGS_ENABLE);
+                xfree(entry);
+                return -ENXIO;
+            }
+            table_paddr = msi->table_base;
+        }
+        table_paddr += table_offset & ~PCI_MSIX_BIRMASK;
 
         msix->nr_entries = nr_entries;
         msix->table.first = PFN_DOWN(table_paddr);
@@ -889,7 +889,19 @@ static int msix_capability_init(struct pci_dev *dev,
                                   BITS_TO_LONGS(nr_entries) - 1);
         WARN_ON(rangeset_overlaps_range(mmio_ro_ranges, msix->pba.first,
                                         msix->pba.last));
+
+        zap_on_error = true;
     }
+    else if ( !msix->table.first )
+    {
+        pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
+                         control);
+        xfree(entry);
+        return -ENODATA;
+    }
+    else
+        table_paddr = (msix->table.first << PAGE_SHIFT) +
+                      (table_offset & ~PCI_MSIX_BIRMASK & ~PAGE_MASK);
 
     if ( entry )
     {
@@ -900,8 +912,16 @@ static int msix_capability_init(struct pci_dev *dev,
 
         if ( idx < 0 )
         {
+            if ( zap_on_error )
+            {
+                msix->table.first = 0;
+                msix->pba.first = 0;
+
+                control &= ~PCI_MSIX_FLAGS_ENABLE;
+            }
+
             pci_conf_write16(seg, bus, slot, func, msix_control_reg(pos),
-                             control & ~PCI_MSIX_FLAGS_ENABLE);
+                             control);
             xfree(entry);
             return idx;
         }
@@ -1085,9 +1105,14 @@ static void _pci_cleanup_msix(struct arch_msix *msix)
         if ( rangeset_remove_range(mmio_ro_ranges, msix->table.first,
                                    msix->table.last) )
             WARN();
+        msix->table.first = 0;
+        msix->table.last = 0;
+
         if ( rangeset_remove_range(mmio_ro_ranges, msix->pba.first,
                                    msix->pba.last) )
             WARN();
+        msix->pba.first = 0;
+        msix->pba.last = 0;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4638.12285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiE-0007JH-ST; Thu, 08 Oct 2020 21:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4638.12285; Thu, 08 Oct 2020 21:44:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiE-0007J8-PN; Thu, 08 Oct 2020 21:44:34 +0000
Received: by outflank-mailman (input) for mailman id 4638;
 Thu, 08 Oct 2020 21:44:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdiD-0007J1-Ev
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 888a1cfc-59f7-488e-8d03-af73dd50c75e;
 Thu, 08 Oct 2020 21:44:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiC-0007fV-JF
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiC-00057s-IP
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdiD-0007J1-Ev
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:33 +0000
X-Inumbo-ID: 888a1cfc-59f7-488e-8d03-af73dd50c75e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 888a1cfc-59f7-488e-8d03-af73dd50c75e;
	Thu, 08 Oct 2020 21:44:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KSWvmjUpDgE771JwV5Ux7VaAX5PE8ZIh61PuYPba9k8=; b=TIAyzbVyrBX1fOcfVf2KqCU7rP
	3b2E11ebtT4hy/Lqe1izKMQcDSjt5UUnzjskzqHHgo64GL5WF7RTdlBX9+3MvSp1w+ex3FohKuUIB
	xUXoHkGLK/Ofv++UjdWIS+IjWUh+JqlVyPEtvqd7t4oJBD/59g10Ks7UpABvagKmQDp4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiC-0007fV-JF
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiC-00057s-IP
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: relax port_is_valid()
Message-Id: <E1kQdiC-00057s-IP@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:32 +0000

commit f85223f4af24ba11a575d599a2ca7adb238d4046
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:30:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:30:04 2020 +0200

    evtchn: relax port_is_valid()
    
    To avoid ports potentially becoming invalid behind the back of certain
    other functions (due to ->max_evtchn shrinking) because of
    - a guest invoking evtchn_reset() and from a 2nd vCPU opening new
      channels in parallel (see also XSA-343),
    - alloc_unbound_xen_event_channel() produced channels living above the
      2-level range (see also XSA-342),
    drop the max_evtchns check from port_is_valid(). For a port for which
    the function once returned "true", the returned value may not turn into
    "false" later on. The function's result may only depend on bounds which
    can only ever grow (which is the case for d->valid_evtchns).
    
    This also eliminates a false sense of safety, utilized by some of the
    users (see again XSA-343): Without a suitable lock held, d->max_evtchns
    may change at any time, and hence deducing that certain other operations
    are safe when port_is_valid() returned true is not legitimate. The
    opportunities to abuse this may get widened by the change here
    (depending on guest and host configuration), but will be taken care of
    by the other XSA.
    
    This is XSA-338.
    
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/event.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index b8152a9831..2006ba9252 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -99,8 +99,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    if ( p >= d->max_evtchns )
-        return 0;
     return p < read_atomic(&d->valid_evtchns);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4639.12289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiO-0007Ko-U8; Thu, 08 Oct 2020 21:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4639.12289; Thu, 08 Oct 2020 21:44:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiO-0007Ke-Qw; Thu, 08 Oct 2020 21:44:44 +0000
Received: by outflank-mailman (input) for mailman id 4639;
 Thu, 08 Oct 2020 21:44:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdiN-0007KU-Ja
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b4316c80-fcec-422d-94e2-e55b5d1598d0;
 Thu, 08 Oct 2020 21:44:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiM-0007fd-MG
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiM-000593-LR
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdiN-0007KU-Ja
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:43 +0000
X-Inumbo-ID: b4316c80-fcec-422d-94e2-e55b5d1598d0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b4316c80-fcec-422d-94e2-e55b5d1598d0;
	Thu, 08 Oct 2020 21:44:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lsrVZjwIdZlXtDaLQayc53kuvih/S4mYsmQrCTtD4as=; b=ggadJp4GMrsL0QNUca7K8Y+qGz
	22QKSiy6lUSIpVyJJtUEjiKbD72eWvMOiLVFOgDbHP7Awr4/mlGpu1OdWf81Cxxnt1mibnAZewyNb
	SBLb+1dtkddGq8+i5xxDolOsnAidZ4u7WkcXHlluIAtPaEZdUpGzO+IduiMTLUv1FWew=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiM-0007fd-MG
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiM-000593-LR
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/pv: Avoid double exception injection
Message-Id: <E1kQdiM-000593-LR@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:42 +0000

commit 540254011fa30ee43783f7850cf3d24d9477ca0d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Sep 22 17:31:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:31:31 2020 +0200

    x86/pv: Avoid double exception injection
    
    There is at least one path (SYSENTER with NT set, Xen converts to #GP) which
    ends up injecting the #GP fault twice, first in compat_sysenter(), and then a
    second time in compat_test_all_events(), due to the stale TBF_EXCEPTION left
    in TRAPBOUNCE_flags.
    
    The guest kernel sees the second fault first, which is a kernel level #GP
    pointing at the head of the #GP handler, and is therefore a userspace
    trigger-able DoS.
    
    This particular bug has bitten us several times before, so rearrange
    {compat_,}create_bounce_frame() to clobber TRAPBOUNCE on success, rather than
    leaving this task to one area of code which isn't used uniformly.
    
    Other scenarios which might result in a double injection (e.g. two calls
    directly to compat_create_bounce_frame) will now crash the guest, which is far
    more obvious than letting the kernel run with corrupt state.
    
    This is XSA-339
    
    Fixes: fdac9515607b ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/compat/entry.S | 7 ++++++-
 xen/arch/x86/x86_64/entry.S        | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 1c4cd795d2..2d0bc3a778 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -80,7 +80,6 @@ compat_process_softirqs:
         sti
 .Lcompat_bounce_exception:
         call  compat_create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   compat_test_all_events
 
 	ALIGN
@@ -357,7 +356,13 @@ __UNLIKELY_END(compat_bounce_null_selector)
         movl  %eax,UREGS_cs+8(%rsp)
         movl  TRAPBOUNCE_eip(%rdx),%eax
         movl  %eax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %ax,  TRAPBOUNCE_cs(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
+
 .section .fixup,"ax"
 .Lfx13:
         xorl  %edi,%edi
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c163c31a60..5a35402341 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -81,7 +81,6 @@ process_softirqs:
         sti
 .Lbounce_exception:
         call  create_bounce_frame
-        movb  $0, TRAPBOUNCE_flags(%rdx)
         jmp   test_all_events
 
         ALIGN
@@ -509,6 +508,11 @@ UNLIKELY_START(z, create_bounce_frame_bad_bounce_ip)
         jmp   asm_domain_crash_synchronous  /* Does not return */
 __UNLIKELY_END(create_bounce_frame_bad_bounce_ip)
         movq  %rax,UREGS_rip+8(%rsp)
+
+        /* Trapbounce complete.  Clobber state to avoid an erroneous second injection. */
+        xor   %eax, %eax
+        mov   %rax, TRAPBOUNCE_eip(%rdx)
+        mov   %al,  TRAPBOUNCE_flags(%rdx)
         ret
 
         .pushsection .fixup, "ax", @progbits
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:44:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4640.12293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiY-0007MA-Va; Thu, 08 Oct 2020 21:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4640.12293; Thu, 08 Oct 2020 21:44:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdiY-0007M2-SW; Thu, 08 Oct 2020 21:44:54 +0000
Received: by outflank-mailman (input) for mailman id 4640;
 Thu, 08 Oct 2020 21:44:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdiY-0007Lu-ES
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ec3cfd30-2640-447c-a289-36e444388d5a;
 Thu, 08 Oct 2020 21:44:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiX-0007fl-3g
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdiW-0005Br-OP
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdiY-0007Lu-ES
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:54 +0000
X-Inumbo-ID: ec3cfd30-2640-447c-a289-36e444388d5a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ec3cfd30-2640-447c-a289-36e444388d5a;
	Thu, 08 Oct 2020 21:44:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YGM/ygXKd8sNhkiRUrtO4+57sm83IMfVG/vGMXTfqAw=; b=TTfPNa8MHzxKp2RAnqtRfI6cJI
	gIaxYncmj6FSqwXDrqxZHlcWrGZKYPz7UdgS8x3tMvDfwnxrnht2Cf3K/kjs0kIXpA7WjgnUWjvfm
	sx2cWvd6XQl1sM/ylMXIVsgsmsXGi/dx6FYbrnfgb5NjxXrOh12IHP2FVNtjfKZ9DwTg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiX-0007fl-3g
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdiW-0005Br-OP
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:44:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] xen/evtchn: Add missing barriers when accessing/allocating an event channel
Message-Id: <E1kQdiW-0005Br-OP@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:44:52 +0000

commit baf80b695da1ac6ad455535ddf9030fc288513ec
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Tue Sep 22 17:32:42 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:32:42 2020 +0200

    xen/evtchn: Add missing barriers when accessing/allocating an event channel
    
    While the allocation of a bucket is always performed with the per-domain
    lock, the bucket may be accessed without the lock taken (for instance, see
    evtchn_send()).
    
    Instead such sites relies on port_is_valid() to return a non-zero value
    when the port has a struct evtchn associated to it. The function will
    mostly check whether the port is less than d->valid_evtchns as all the
    buckets/event channels should be allocated up to that point.
    
    Unfortunately a compiler is free to re-order the assignment in
    evtchn_allocate_port() so it would be possible to have d->valid_evtchns
    updated before the new bucket has finish to allocate.
    
    Additionally on Arm, even if this was compiled "correctly", the
    processor can still re-order the memory access.
    
    Add a write memory barrier in the allocation side and a read memory
    barrier when the port is valid to prevent any re-ordering issue.
    
    This is XSA-340.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/event_channel.c |  7 +++++++
 xen/include/xen/event.h    | 12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 07ef45a140..82e42c7e32 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -185,6 +185,13 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
             return -ENOMEM;
         bucket_from_port(d, port) = chn;
 
+        /*
+         * d->valid_evtchns is used to check whether the bucket can be
+         * accessed without the per-domain lock. Therefore,
+         * d->valid_evtchns should be seen *after* the new bucket has
+         * been setup.
+         */
+        smp_wmb();
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 2006ba9252..70bd63423e 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -99,7 +99,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
-    return p < read_atomic(&d->valid_evtchns);
+    if ( p >= read_atomic(&d->valid_evtchns) )
+        return false;
+
+    /*
+     * The caller will usually access the event channel afterwards and
+     * may be done without taking the per-domain lock. The barrier is
+     * going in pair the smp_wmb() barrier in evtchn_allocate_port().
+     */
+    smp_rmb();
+
+    return true;
 }
 
 static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4642.12296 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdij-0007Nf-11; Thu, 08 Oct 2020 21:45:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4642.12296; Thu, 08 Oct 2020 21:45:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdii-0007NY-U9; Thu, 08 Oct 2020 21:45:04 +0000
Received: by outflank-mailman (input) for mailman id 4642;
 Thu, 08 Oct 2020 21:45:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdii-0007NQ-9u
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f3cc4fed-a761-4672-8fd1-4b8081f857cb;
 Thu, 08 Oct 2020 21:45:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdih-0007gN-78
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdih-0005DQ-6D
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdii-0007NQ-9u
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:04 +0000
X-Inumbo-ID: f3cc4fed-a761-4672-8fd1-4b8081f857cb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f3cc4fed-a761-4672-8fd1-4b8081f857cb;
	Thu, 08 Oct 2020 21:45:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SwtxdOGSuwzcjadzBdHdCb1M5IfzjJIAsWPf46rUnjk=; b=12+0XOf3FTjpLN+clM6MSr0q3v
	XEa4Wm1wGYzQZn0jHtO2k9w5h7EJZd7yO3AkhbsKzQrVkvVqKsq6sMwylpIHkJGtMdhTwvab8prWg
	4tIYiYI0ez3hiIwvaLY6PoEdqs6VK5vXd9uK2KR+NSiP1KmNBLPMpLbicnv6yjVep7lc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdih-0007gN-78
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdih-0005DQ-6D
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn/x86: enforce correct upper limit for 32-bit guests
Message-Id: <E1kQdih-0005DQ-6D@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:03 +0000

commit 8fac37e162bf8c146031583ddc2e7b6bda145f98
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:33:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:33:25 2020 +0200

    evtchn/x86: enforce correct upper limit for 32-bit guests
    
    The recording of d->max_evtchns in evtchn_2l_init(), in particular with
    the limited set of callers of the function, is insufficient. Neither for
    PV nor for HVM guests the bitness is known at domain_create() time, yet
    the upper bound in 2-level mode depends upon guest bitness. Recording
    too high a limit "allows" x86 32-bit domains to open not properly usable
    event channels, management of which (inside Xen) would then result in
    corruption of the shared info and vCPU info structures.
    
    Keep the upper limit dynamic for the 2-level case, introducing a helper
    function to retrieve the effective limit. This helper is now supposed to
    be private to the event channel code. The used in do_poll() and
    domain_dump_evtchn_info() weren't consistent with port uses elsewhere
    and hence get switched to port_is_valid().
    
    Furthermore FIFO mode's setup_ports() gets adjusted to loop only up to
    the prior ABI limit, rather than all the way up to the new one.
    
    Finally a word on the change to do_poll(): Accessing ->max_evtchns
    without holding a suitable lock was never safe, as it as well as
    ->evtchn_port_ops may change behind do_poll()'s back. Using
    port_is_valid() instead widens some the window for potential abuse,
    until we've dealt with the race altogether (see XSA-343).
    
    This is XSA-342.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Fixes: 48974e6ce52e ("evtchn: use a per-domain variable for the max number of event channels")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_2l.c      | 1 -
 xen/common/event_channel.c | 6 ++----
 xen/common/event_fifo.c    | 9 +++++----
 xen/common/schedule.c      | 2 +-
 xen/include/xen/event.h    | 6 ++++++
 xen/include/xen/sched.h    | 1 -
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index e1dbb860f4..a229d35271 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -103,7 +103,6 @@ static const struct evtchn_port_ops evtchn_port_ops_2l =
 void evtchn_2l_init(struct domain *d)
 {
     d->evtchn_port_ops = &evtchn_port_ops_2l;
-    d->max_evtchns = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 }
 
 /*
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 82e42c7e32..916fe19ec5 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -158,7 +158,7 @@ static void free_evtchn_bucket(struct domain *d, struct evtchn *bucket)
 
 int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 {
-    if ( port > d->max_evtchn_port || port >= d->max_evtchns )
+    if ( port > d->max_evtchn_port || port >= max_evtchns(d) )
         return -ENOSPC;
 
     if ( port_is_valid(d, port) )
@@ -1401,13 +1401,11 @@ static void domain_dump_evtchn_info(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    for ( port = 1; port < d->max_evtchns; ++port )
+    for ( port = 1; port_is_valid(d, port); ++port )
     {
         const struct evtchn *chn;
         char *ssid;
 
-        if ( !port_is_valid(d, port) )
-            continue;
         chn = evtchn_from_port(d, port);
         if ( chn->state == ECS_FREE )
             continue;
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 3f4c835518..397be25015 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -477,7 +477,7 @@ static void cleanup_event_array(struct domain *d)
     d->evtchn_fifo = NULL;
 }
 
-static void setup_ports(struct domain *d)
+static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 {
     unsigned int port;
 
@@ -487,7 +487,7 @@ static void setup_ports(struct domain *d)
      * - save its pending state.
      * - set default priority.
      */
-    for ( port = 1; port < d->max_evtchns; port++ )
+    for ( port = 1; port < prev_evtchns; port++ )
     {
         struct evtchn *evtchn;
 
@@ -539,6 +539,8 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
     if ( !d->evtchn_fifo )
     {
         struct vcpu *vcb;
+        /* Latch the value before it changes during setup_event_array(). */
+        unsigned int prev_evtchns = max_evtchns(d);
 
         for_each_vcpu ( d, vcb ) {
             rc = setup_control_block(vcb);
@@ -555,8 +557,7 @@ int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
             goto error;
 
         d->evtchn_port_ops = &evtchn_port_ops_fifo;
-        d->max_evtchns = EVTCHN_FIFO_NR_CHANNELS;
-        setup_ports(d);
+        setup_ports(d, prev_evtchns);
     }
     else
         rc = map_control_block(v, gfn, offset);
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index f21c3e5a64..820126d82e 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -1002,7 +1002,7 @@ static long do_poll(struct sched_poll *sched_poll)
             goto out;
 
         rc = -EINVAL;
-        if ( port >= d->max_evtchns )
+        if ( !port_is_valid(d, port) )
             goto out;
 
         rc = 0;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 70bd63423e..357347369e 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -97,6 +97,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index eaa83dc97e..fb52bd1ab5 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -336,7 +336,6 @@ struct domain
     /* Event channel information. */
     struct evtchn   *evtchn;                         /* first bucket only */
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
-    unsigned int     max_evtchns;     /* number supported by ABI */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
     spinlock_t       event_lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4645.12301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdit-0007P7-2l; Thu, 08 Oct 2020 21:45:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4645.12301; Thu, 08 Oct 2020 21:45:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdis-0007Oz-Vn; Thu, 08 Oct 2020 21:45:14 +0000
Received: by outflank-mailman (input) for mailman id 4645;
 Thu, 08 Oct 2020 21:45:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdis-0007Op-Er
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b776a9d3-3b92-418b-a77a-738d32c45cb6;
 Thu, 08 Oct 2020 21:45:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdir-0007gZ-A6
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdir-0005EO-9O
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdis-0007Op-Er
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:14 +0000
X-Inumbo-ID: b776a9d3-3b92-418b-a77a-738d32c45cb6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b776a9d3-3b92-418b-a77a-738d32c45cb6;
	Thu, 08 Oct 2020 21:45:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IVV60nphDXf7TIS2OIB/DkoUTDnyB7z6jfCXYXJ6N90=; b=oLe9g2vwZiUVVUPHF3JSz/WKK+
	pWOa/rcJ0zZU0QcenDgiSwKZky+TnWNWntTbtsYjlAMd6MnQuC6Iu0XNwlp2Jb9fqxQDdm5ZMI6OJ
	oRkTyiM+dvFztoJsGKuqp50nLDTc2GhlC0NQFOEcMEWyR6K5yBn7Zrm/FtnKfsdP0Jn0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdir-0007gZ-A6
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdir-0005EO-9O
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: evtchn_reset() shouldn't succeed with still-open ports
Message-Id: <E1kQdir-0005EO-9O@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:13 +0000

commit 7f0793a428cf6f38495e4e728b0346220250e57c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:33:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:33:56 2020 +0200

    evtchn: evtchn_reset() shouldn't succeed with still-open ports
    
    While the function closes all ports, it does so without holding any
    lock, and hence racing requests may be issued causing new ports to get
    opened. This would have been problematic in particular if such a newly
    opened port had a port number above the new implementation limit (i.e.
    when switching from FIFO to 2-level) after the reset, as prior to
    "evtchn: relax port_is_valid()" this could have led to e.g.
    evtchn_close()'s "BUG_ON(!port_is_valid(d2, port2))" to trigger.
    
    Introduce a counter of active ports and check that it's (still) no
    larger then the number of Xen internally used ones after obtaining the
    necessary lock in evtchn_reset().
    
    As to the access model of the new {active,xen}_evtchns fields - while
    all writes get done using write_atomic(), reads ought to use
    read_atomic() only when outside of a suitably locked region.
    
    Note that as of now evtchn_bind_virq() and evtchn_bind_ipi() don't have
    a need to call check_free_port().
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 39 +++++++++++++++++++++++++++++++++------
 xen/include/xen/sched.h    | 10 ++++++++++
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 916fe19ec5..f1aa3dbc5f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -195,6 +195,8 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
         write_atomic(&d->valid_evtchns, d->valid_evtchns + EVTCHNS_PER_BUCKET);
     }
 
+    write_atomic(&d->active_evtchns, d->active_evtchns + 1);
+
     return 0;
 }
 
@@ -218,11 +220,26 @@ static int get_free_port(struct domain *d)
     return -ENOSPC;
 }
 
+/*
+ * Check whether a port is still marked free, and if so update the domain
+ * counter accordingly.  To be used on function exit paths.
+ */
+static void check_free_port(struct domain *d, evtchn_port_t port)
+{
+    if ( port_is_valid(d, port) &&
+         evtchn_from_port(d, port)->state == ECS_FREE )
+        write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+}
+
 void evtchn_free(struct domain *d, struct evtchn *chn)
 {
     /* Clear pending event to avoid unexpected behavior on re-bind. */
     evtchn_port_clear_pending(d, chn);
 
+    if ( consumer_is_xen(chn) )
+        write_atomic(&d->xen_evtchns, d->xen_evtchns - 1);
+    write_atomic(&d->active_evtchns, d->active_evtchns - 1);
+
     /* Reset binding to vcpu0 when the channel is freed. */
     chn->state          = ECS_FREE;
     chn->notify_vcpu_id = 0;
@@ -265,6 +282,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     alloc->port = port;
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
     rcu_unlock_domain(d);
 
@@ -358,6 +376,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     bind->local_port = lport;
 
  out:
+    check_free_port(ld, lport);
     spin_unlock(&ld->event_lock);
     if ( ld != rd )
         spin_unlock(&rd->event_lock);
@@ -491,7 +510,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct domain *d = current->domain;
     struct vcpu   *v = d->vcpu[0];
     struct pirq   *info;
-    int            port, pirq = bind->pirq;
+    int            port = 0, pirq = bind->pirq;
     long           rc;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
@@ -539,6 +558,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     arch_evtchn_bind_pirq(d, pirq);
 
  out:
+    check_free_port(d, port);
     spin_unlock(&d->event_lock);
 
     return rc;
@@ -1013,10 +1033,10 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-
 int evtchn_reset(struct domain *d)
 {
     unsigned int i;
+    int rc = 0;
 
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
@@ -1026,7 +1046,9 @@ int evtchn_reset(struct domain *d)
 
     spin_lock(&d->event_lock);
 
-    if ( d->evtchn_fifo )
+    if ( d->active_evtchns > d->xen_evtchns )
+        rc = -EAGAIN;
+    else if ( d->evtchn_fifo )
     {
         /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
@@ -1035,7 +1057,7 @@ int evtchn_reset(struct domain *d)
 
     spin_unlock(&d->event_lock);
 
-    return 0;
+    return rc;
 }
 
 static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
@@ -1221,10 +1243,9 @@ int alloc_unbound_xen_event_channel(
 
     spin_lock(&ld->event_lock);
 
-    rc = get_free_port(ld);
+    port = rc = get_free_port(ld);
     if ( rc < 0 )
         goto out;
-    port = rc;
     chn = evtchn_from_port(ld, port);
 
     rc = xsm_evtchn_unbound(XSM_TARGET, ld, chn, remote_domid);
@@ -1240,7 +1261,10 @@ int alloc_unbound_xen_event_channel(
 
     spin_unlock(&chn->lock);
 
+    write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
+
  out:
+    check_free_port(ld, port);
     spin_unlock(&ld->event_lock);
 
     return rc < 0 ? rc : port;
@@ -1316,6 +1340,7 @@ int evtchn_init(struct domain *d)
         return -EINVAL;
     }
     evtchn_from_port(d, 0)->state = ECS_RESERVED;
+    write_atomic(&d->active_evtchns, 0);
 
 #if MAX_VIRT_CPUS > BITS_PER_LONG
     d->poll_mask = xzalloc_array(unsigned long,
@@ -1343,6 +1368,8 @@ void evtchn_destroy(struct domain *d)
     for ( i = 0; port_is_valid(d, i); i++ )
         evtchn_close(d, i, 0);
 
+    ASSERT(!d->active_evtchns);
+
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index fb52bd1ab5..f919b6b97a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -338,6 +338,16 @@ struct domain
     struct evtchn  **evtchn_group[NR_EVTCHN_GROUPS]; /* all other buckets */
     unsigned int     max_evtchn_port; /* max permitted port number */
     unsigned int     valid_evtchns;   /* number of allocated event channels */
+    /*
+     * Number of in-use event channels.  Writers should use write_atomic().
+     * Readers need to use read_atomic() only when not holding event_lock.
+     */
+    unsigned int     active_evtchns;
+    /*
+     * Number of event channels used internally by Xen (not subject to
+     * EVTCHNOP_reset).  Read/write access like for active_evtchns.
+     */
+    unsigned int     xen_evtchns;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4648.12305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdj5-0007R7-5h; Thu, 08 Oct 2020 21:45:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4648.12305; Thu, 08 Oct 2020 21:45:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdj5-0007Qz-2a; Thu, 08 Oct 2020 21:45:27 +0000
Received: by outflank-mailman (input) for mailman id 4648;
 Thu, 08 Oct 2020 21:45:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdj3-0007Qe-R9
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3bad7e7a-0921-4da1-9b86-7b411d6a3435;
 Thu, 08 Oct 2020 21:45:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdj1-0007hK-DF
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdj1-0005FB-CK
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdj3-0007Qe-R9
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:25 +0000
X-Inumbo-ID: 3bad7e7a-0921-4da1-9b86-7b411d6a3435
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3bad7e7a-0921-4da1-9b86-7b411d6a3435;
	Thu, 08 Oct 2020 21:45:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=csmm4GqxINyqtG9d8akqXqH9I/jMpEbxqYZZO/vkOVE=; b=VvhJb0nmLA9922UO3Qjrz5JBfK
	O/KNlakYn4BII+P322O9sCYQc/o53jYmffoq+hU8MkU8/ndeu7RgD0TGgtqlyf+1h5I2ZRfWOuSne
	OVVJAjKRHSQcgoxQRhZzld+RCLNbHPH41M8aicUiJrMbCPA/cTPIfnlCkPpCoZpyvsXY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdj1-0007hK-DF
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdj1-0005FB-CK
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: convert per-channel lock to be IRQ-safe
Message-Id: <E1kQdj1-0005FB-CK@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:23 +0000

commit e081568d86b8a9dd09b34c8339f039b2bb78206b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:34:30 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:34:30 2020 +0200

    evtchn: convert per-channel lock to be IRQ-safe
    
    ... in order for send_guest_{global,vcpu}_virq() to be able to make use
    of it.
    
    This is part of XSA-343.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/event_channel.c | 73 ++++++++++++++++++++++++++++------------------
 1 file changed, 44 insertions(+), 29 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index f1aa3dbc5f..cc0c90c7ee 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -255,6 +255,7 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     int            port;
     domid_t        dom = alloc->dom;
     long           rc;
+    unsigned long  flags;
 
     d = rcu_lock_domain_by_any_id(dom);
     if ( d == NULL )
@@ -270,14 +271,14 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
         chn->u.unbound.remote_domid = current->domain->domain_id;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     alloc->port = port;
 
@@ -290,26 +291,32 @@ static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
 }
 
 
-static void double_evtchn_lock(struct evtchn *lchn, struct evtchn *rchn)
+static unsigned long double_evtchn_lock(struct evtchn *lchn,
+                                        struct evtchn *rchn)
 {
-    if ( lchn < rchn )
+    unsigned long flags;
+
+    if ( lchn <= rchn )
     {
-        spin_lock(&lchn->lock);
-        spin_lock(&rchn->lock);
+        spin_lock_irqsave(&lchn->lock, flags);
+        if ( lchn != rchn )
+            spin_lock(&rchn->lock);
     }
     else
     {
-        if ( lchn != rchn )
-            spin_lock(&rchn->lock);
+        spin_lock_irqsave(&rchn->lock, flags);
         spin_lock(&lchn->lock);
     }
+
+    return flags;
 }
 
-static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn)
+static void double_evtchn_unlock(struct evtchn *lchn, struct evtchn *rchn,
+                                 unsigned long flags)
 {
-    spin_unlock(&lchn->lock);
     if ( lchn != rchn )
-        spin_unlock(&rchn->lock);
+        spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&rchn->lock, flags);
 }
 
 static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
@@ -319,6 +326,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     int            lport, rport = bind->remote_port;
     domid_t        rdom = bind->remote_dom;
     long           rc;
+    unsigned long  flags;
 
     if ( rdom == DOMID_SELF )
         rdom = current->domain->domain_id;
@@ -354,7 +362,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
-    double_evtchn_lock(lchn, rchn);
+    flags = double_evtchn_lock(lchn, rchn);
 
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = rport;
@@ -371,7 +379,7 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
      */
     evtchn_port_set_pending(ld, lchn->notify_vcpu_id, lchn);
 
-    double_evtchn_unlock(lchn, rchn);
+    double_evtchn_unlock(lchn, rchn, flags);
 
     bind->local_port = lport;
 
@@ -394,6 +402,7 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
     struct domain *d = current->domain;
     int            virq = bind->virq, vcpu = bind->vcpu;
     int            rc = 0;
+    unsigned long  flags;
 
     if ( (virq < 0) || (virq >= ARRAY_SIZE(v->virq_to_evtchn)) )
         return -EINVAL;
@@ -426,14 +435,14 @@ int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     v->virq_to_evtchn[virq] = bind->port = port;
 
@@ -450,6 +459,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
     struct domain *d = current->domain;
     int            port, vcpu = bind->vcpu;
     long           rc = 0;
+    unsigned long  flags;
 
     if ( (vcpu < 0) || (vcpu >= d->max_vcpus) ||
          (d->vcpu[vcpu] == NULL) )
@@ -462,13 +472,13 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
 
     chn = evtchn_from_port(d, port);
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -512,6 +522,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     struct pirq   *info;
     int            port = 0, pirq = bind->pirq;
     long           rc;
+    unsigned long  flags;
 
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
@@ -544,14 +555,14 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
     evtchn_port_init(d, chn);
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     bind->port = port;
 
@@ -572,6 +583,7 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
     struct evtchn *chn1, *chn2;
     int            port2;
     long           rc = 0;
+    unsigned long  flags;
 
  again:
     spin_lock(&d1->event_lock);
@@ -671,14 +683,14 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG_ON(chn2->state != ECS_INTERDOMAIN);
         BUG_ON(chn2->u.interdomain.remote_dom != d1);
 
-        double_evtchn_lock(chn1, chn2);
+        flags = double_evtchn_lock(chn1, chn2);
 
         evtchn_free(d1, chn1);
 
         chn2->state = ECS_UNBOUND;
         chn2->u.unbound.remote_domid = d1->domain_id;
 
-        double_evtchn_unlock(chn1, chn2);
+        double_evtchn_unlock(chn1, chn2, flags);
 
         goto out;
 
@@ -686,9 +698,9 @@ int evtchn_close(struct domain *d1, int port1, bool guest)
         BUG();
     }
 
-    spin_lock(&chn1->lock);
+    spin_lock_irqsave(&chn1->lock, flags);
     evtchn_free(d1, chn1);
-    spin_unlock(&chn1->lock);
+    spin_unlock_irqrestore(&chn1->lock, flags);
 
  out:
     if ( d2 != NULL )
@@ -708,13 +720,14 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     struct evtchn *lchn, *rchn;
     struct domain *rd;
     int            rport, ret = 0;
+    unsigned long  flags;
 
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     /* Guest cannot send via a Xen-attached event channel. */
     if ( unlikely(consumer_is_xen(lchn)) )
@@ -749,7 +762,7 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     }
 
 out:
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 
     return ret;
 }
@@ -1240,6 +1253,7 @@ int alloc_unbound_xen_event_channel(
 {
     struct evtchn *chn;
     int            port, rc;
+    unsigned long  flags;
 
     spin_lock(&ld->event_lock);
 
@@ -1252,14 +1266,14 @@ int alloc_unbound_xen_event_channel(
     if ( rc )
         goto out;
 
-    spin_lock(&chn->lock);
+    spin_lock_irqsave(&chn->lock, flags);
 
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = lvcpu;
     chn->u.unbound.remote_domid = remote_domid;
 
-    spin_unlock(&chn->lock);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     write_atomic(&ld->xen_evtchns, ld->xen_evtchns + 1);
 
@@ -1282,11 +1296,12 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
 {
     struct evtchn *lchn, *rchn;
     struct domain *rd;
+    unsigned long flags;
 
     ASSERT(port_is_valid(ld, lport));
     lchn = evtchn_from_port(ld, lport);
 
-    spin_lock(&lchn->lock);
+    spin_lock_irqsave(&lchn->lock, flags);
 
     if ( likely(lchn->state == ECS_INTERDOMAIN) )
     {
@@ -1296,7 +1311,7 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
         evtchn_port_set_pending(rd, rchn->notify_vcpu_id, rchn);
     }
 
-    spin_unlock(&lchn->lock);
+    spin_unlock_irqrestore(&lchn->lock, flags);
 }
 
 void evtchn_check_pollers(struct domain *d, unsigned int port)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4653.12308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjE-0007Su-72; Thu, 08 Oct 2020 21:45:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4653.12308; Thu, 08 Oct 2020 21:45:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjE-0007Sn-49; Thu, 08 Oct 2020 21:45:36 +0000
Received: by outflank-mailman (input) for mailman id 4653;
 Thu, 08 Oct 2020 21:45:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdjD-0007Sc-1a
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 560b6dc4-0377-4a9b-b2da-0012f187da91;
 Thu, 08 Oct 2020 21:45:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjB-0007hY-Gh
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjB-0005Fw-Fj
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdjD-0007Sc-1a
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:35 +0000
X-Inumbo-ID: 560b6dc4-0377-4a9b-b2da-0012f187da91
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 560b6dc4-0377-4a9b-b2da-0012f187da91;
	Thu, 08 Oct 2020 21:45:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yG8HOjQngch5qGk0JBfma7Z05cmtG8sGgR6SI5elJR0=; b=fFPX8zzZaR7WFGZtfwz5euXvdT
	6r7xPmgGQ/ySUqy0x2dMR8F9K4FLDHoEkUj7lve3OrekkLLXGZkCLHMqXxgXnJElxEkiyIG9gCHUI
	5BtXbH2YJip0zTj9Ej+8dZ08bgSW+i6s8Re2Yd8QZBZ3jjmkma64EGQ6pSB5Ixzg51xc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjB-0007hY-Gh
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjB-0005Fw-Fj
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: address races with evtchn_reset()
Message-Id: <E1kQdjB-0005Fw-Fj@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:33 +0000

commit 83b7f04a4b59d578660d2dd9ca33ef8192019b42
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:34:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:34:52 2020 +0200

    evtchn: address races with evtchn_reset()
    
    Neither d->evtchn_port_ops nor max_evtchns(d) may be used in an entirely
    lock-less manner, as both may change by a racing evtchn_reset(). In the
    common case, at least one of the domain's event lock or the per-channel
    lock needs to be held. In the specific case of the inter-domain sending
    by evtchn_send() and notify_via_xen_event_channel() holding the other
    side's per-channel lock is sufficient, as the channel can't change state
    without both per-channel locks held. Without such a channel changing
    state, evtchn_reset() can't complete successfully.
    
    Lock-free accesses continue to be permitted for the shim (calling some
    otherwise internal event channel functions), as this happens while the
    domain is in effectively single-threaded mode. Special care also needs
    taking for the shim's marking of in-use ports as ECS_RESERVED (allowing
    use of such ports in the shim case is okay because switching into and
    hence also out of FIFO mode is impossihble there).
    
    As a side effect, certain operations on Xen bound event channels which
    were mistakenly permitted so far (e.g. unmask or poll) will be refused
    now.
    
    This is part of XSA-343.
    
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/x86/irq.c          | 18 +++++++---
 xen/arch/x86/pv/shim.c      |  3 ++
 xen/common/event_2l.c       |  8 +++--
 xen/common/event_channel.c  | 23 ++++++++++---
 xen/common/event_fifo.c     | 15 ++++----
 xen/include/asm-x86/event.h |  6 ++++
 xen/include/xen/event.h     | 84 +++++++++++++++++++++++++++++++++++++--------
 7 files changed, 125 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 0d5253009f..01a678b5e2 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2323,14 +2323,24 @@ static void dump_irqs(unsigned char key)
 
             for ( i = 0; i < action->nr_guests; i++ )
             {
+                struct evtchn *evtchn;
+                unsigned int pending = 2, masked = 2;
+
                 d = action->guest[i];
                 pirq = domain_irq_to_pirq(d, irq);
                 info = pirq_info(d, pirq);
+                evtchn = evtchn_from_port(d, info->evtchn);
+                local_irq_disable();
+                if ( spin_trylock(&evtchn->lock) )
+                {
+                    pending = evtchn_is_pending(d, evtchn);
+                    masked = evtchn_is_masked(d, evtchn);
+                    spin_unlock(&evtchn->lock);
+                }
+                local_irq_enable();
                 printk("%u:%3d(%c%c%c)",
-                       d->domain_id, pirq,
-                       evtchn_port_is_pending(d, info->evtchn) ? 'P' : '-',
-                       evtchn_port_is_masked(d, info->evtchn) ? 'M' : '-',
-                       (info->masked ? 'M' : '-'));
+                       d->domain_id, pirq, "-P?"[pending],
+                       "-M?"[masked], info->masked ? 'M' : '-');
                 if ( i != action->nr_guests )
                     printk(",");
             }
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index eb1ee7d3c4..973b2c31e4 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -603,8 +603,11 @@ void pv_shim_inject_evtchn(unsigned int port)
     if ( port_is_valid(guest, port) )
     {
         struct evtchn *chn = evtchn_from_port(guest, port);
+        unsigned long flags;
 
+        spin_lock_irqsave(&chn->lock, flags);
         evtchn_port_set_pending(guest, chn->notify_vcpu_id, chn);
+        spin_unlock_irqrestore(&chn->lock, flags);
     }
 }
 
diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index a229d35271..083d04be3c 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -63,8 +63,10 @@ static void evtchn_2l_unmask(struct domain *d, struct evtchn *evtchn)
     }
 }
 
-static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_pending(const struct domain *d,
+                                 const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
@@ -72,8 +74,10 @@ static bool evtchn_2l_is_pending(const struct domain *d, evtchn_port_t port)
             guest_test_bit(d, port, &shared_info(d, evtchn_pending)));
 }
 
-static bool evtchn_2l_is_masked(const struct domain *d, evtchn_port_t port)
+static bool evtchn_2l_is_masked(const struct domain *d,
+                                const struct evtchn *evtchn)
 {
+    evtchn_port_t port = evtchn->port;
     unsigned int max_ports = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
 
     ASSERT(port < max_ports);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index cc0c90c7ee..9bc9a61a0e 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -163,8 +163,9 @@ int evtchn_allocate_port(struct domain *d, evtchn_port_t port)
 
     if ( port_is_valid(d, port) )
     {
-        if ( evtchn_from_port(d, port)->state != ECS_FREE ||
-             evtchn_port_is_busy(d, port) )
+        const struct evtchn *chn = evtchn_from_port(d, port);
+
+        if ( chn->state != ECS_FREE || evtchn_is_busy(d, chn) )
             return -EBUSY;
     }
     else
@@ -777,6 +778,7 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
     unsigned long flags;
     int port;
     struct domain *d;
+    struct evtchn *chn;
 
     ASSERT(!virq_is_global(virq));
 
@@ -787,7 +789,10 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
         goto out;
 
     d = v->domain;
-    evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port));
+    chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
+    evtchn_port_set_pending(d, v->vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -816,7 +821,9 @@ static void send_guest_global_virq(struct domain *d, uint32_t virq)
         goto out;
 
     chn = evtchn_from_port(d, port);
+    spin_lock(&chn->lock);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock(&chn->lock);
 
  out:
     spin_unlock_irqrestore(&v->virq_lock, flags);
@@ -826,6 +833,7 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
+    unsigned long flags;
 
     /*
      * PV guests: It should not be possible to race with __evtchn_close(). The
@@ -840,7 +848,9 @@ void send_guest_pirq(struct domain *d, const struct pirq *pirq)
     }
 
     chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
     evtchn_port_set_pending(d, chn->notify_vcpu_id, chn);
+    spin_unlock_irqrestore(&chn->lock, flags);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
@@ -1036,12 +1046,15 @@ int evtchn_unmask(unsigned int port)
 {
     struct domain *d = current->domain;
     struct evtchn *evtchn;
+    unsigned long flags;
 
     if ( unlikely(!port_is_valid(d, port)) )
         return -EINVAL;
 
     evtchn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&evtchn->lock, flags);
     evtchn_port_unmask(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
 
     return 0;
 }
@@ -1454,8 +1467,8 @@ static void domain_dump_evtchn_info(struct domain *d)
 
         printk("    %4u [%d/%d/",
                port,
-               evtchn_port_is_pending(d, port),
-               evtchn_port_is_masked(d, port));
+               evtchn_is_pending(d, chn),
+               evtchn_is_masked(d, chn));
         evtchn_port_print_state(d, chn);
         printk("]: s=%d n=%d x=%d",
                chn->state, chn->notify_vcpu_id, chn->xen_consumer);
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 397be25015..45c024739d 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -295,23 +295,26 @@ static void evtchn_fifo_unmask(struct domain *d, struct evtchn *evtchn)
         evtchn_fifo_set_pending(v, evtchn);
 }
 
-static bool evtchn_fifo_is_pending(const struct domain *d, evtchn_port_t port)
+static bool evtchn_fifo_is_pending(const struct domain *d,
+                                   const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_PENDING, word);
 }
 
-static bool_t evtchn_fifo_is_masked(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return !word || guest_test_bit(d, EVTCHN_FIFO_MASKED, word);
 }
 
-static bool_t evtchn_fifo_is_busy(const struct domain *d, evtchn_port_t port)
+static bool_t evtchn_fifo_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
-    const event_word_t *word = evtchn_fifo_word_from_port(d, port);
+    const event_word_t *word = evtchn_fifo_word_from_port(d, evtchn->port);
 
     return word && guest_test_bit(d, EVTCHN_FIFO_LINKED, word);
 }
diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h
index a91599d0ec..717c1fd2e6 100644
--- a/xen/include/asm-x86/event.h
+++ b/xen/include/asm-x86/event.h
@@ -47,4 +47,10 @@ static inline int arch_virq_is_global(uint32_t virq)
     return 1;
 }
 
+#ifdef CONFIG_PV_SHIM
+# include <asm/pv/shim.h>
+# define arch_evtchn_is_special(chn) \
+             (pv_shim && (chn)->port && (chn)->state == ECS_RESERVED)
+#endif
+
 #endif
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 357347369e..26ad429520 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -125,6 +125,24 @@ static inline struct evtchn *evtchn_from_port(struct domain *d, unsigned int p)
     return bucket_from_port(d, p) + (p % EVTCHNS_PER_BUCKET);
 }
 
+/*
+ * "usable" as in "by a guest", i.e. Xen consumed channels are assumed to be
+ * taken care of separately where used for Xen's internal purposes.
+ */
+static bool evtchn_usable(const struct evtchn *evtchn)
+{
+    if ( evtchn->xen_consumer )
+        return false;
+
+#ifdef arch_evtchn_is_special
+    if ( arch_evtchn_is_special(evtchn) )
+        return true;
+#endif
+
+    BUILD_BUG_ON(ECS_FREE > ECS_RESERVED);
+    return evtchn->state > ECS_RESERVED;
+}
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
@@ -157,19 +175,24 @@ int evtchn_reset(struct domain *d);
 
 /*
  * Low-level event channel port ops.
+ *
+ * All hooks have to be called with a lock held which prevents the channel
+ * from changing state. This may be the domain event lock, the per-channel
+ * lock, or in the case of sending interdomain events also the other side's
+ * per-channel lock. Exceptions apply in certain cases for the PV shim.
  */
 struct evtchn_port_ops {
     void (*init)(struct domain *d, struct evtchn *evtchn);
     void (*set_pending)(struct vcpu *v, struct evtchn *evtchn);
     void (*clear_pending)(struct domain *d, struct evtchn *evtchn);
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
-    bool (*is_pending)(const struct domain *d, evtchn_port_t port);
-    bool (*is_masked)(const struct domain *d, evtchn_port_t port);
+    bool (*is_pending)(const struct domain *d, const struct evtchn *evtchn);
+    bool (*is_masked)(const struct domain *d, const struct evtchn *evtchn);
     /*
      * Is the port unavailable because it's still being cleaned up
      * after being closed?
      */
-    bool (*is_busy)(const struct domain *d, evtchn_port_t port);
+    bool (*is_busy)(const struct domain *d, const struct evtchn *evtchn);
     int (*set_priority)(struct domain *d, struct evtchn *evtchn,
                         unsigned int priority);
     void (*print_state)(struct domain *d, const struct evtchn *evtchn);
@@ -185,38 +208,67 @@ static inline void evtchn_port_set_pending(struct domain *d,
                                            unsigned int vcpu_id,
                                            struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->set_pending(d->vcpu[vcpu_id], evtchn);
 }
 
 static inline void evtchn_port_clear_pending(struct domain *d,
                                              struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->clear_pending(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
 static inline void evtchn_port_unmask(struct domain *d,
                                       struct evtchn *evtchn)
 {
-    d->evtchn_port_ops->unmask(d, evtchn);
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
 }
 
-static inline bool evtchn_port_is_pending(const struct domain *d,
-                                          evtchn_port_t port)
+static inline bool evtchn_is_pending(const struct domain *d,
+                                     const struct evtchn *evtchn)
 {
-    return d->evtchn_port_ops->is_pending(d, port);
+    return evtchn_usable(evtchn) && d->evtchn_port_ops->is_pending(d, evtchn);
 }
 
-static inline bool evtchn_port_is_masked(const struct domain *d,
-                                         evtchn_port_t port)
+static inline bool evtchn_port_is_pending(struct domain *d, evtchn_port_t port)
 {
-    return d->evtchn_port_ops->is_masked(d, port);
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_pending(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
+}
+
+static inline bool evtchn_is_masked(const struct domain *d,
+                                    const struct evtchn *evtchn)
+{
+    return !evtchn_usable(evtchn) || d->evtchn_port_ops->is_masked(d, evtchn);
+}
+
+static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
+{
+    struct evtchn *evtchn = evtchn_from_port(d, port);
+    bool rc;
+    unsigned long flags;
+
+    spin_lock_irqsave(&evtchn->lock, flags);
+    rc = evtchn_is_masked(d, evtchn);
+    spin_unlock_irqrestore(&evtchn->lock, flags);
+
+    return rc;
 }
 
-static inline bool evtchn_port_is_busy(const struct domain *d,
-                                       evtchn_port_t port)
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
 {
     return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, port);
+           d->evtchn_port_ops->is_busy(d, evtchn);
 }
 
 static inline int evtchn_port_set_priority(struct domain *d,
@@ -225,6 +277,8 @@ static inline int evtchn_port_set_priority(struct domain *d,
 {
     if ( !d->evtchn_port_ops->set_priority )
         return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
     return d->evtchn_port_ops->set_priority(d, evtchn, priority);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4655.12312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjN-0007UN-8b; Thu, 08 Oct 2020 21:45:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4655.12312; Thu, 08 Oct 2020 21:45:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjN-0007UF-5k; Thu, 08 Oct 2020 21:45:45 +0000
Received: by outflank-mailman (input) for mailman id 4655;
 Thu, 08 Oct 2020 21:45:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdjM-0007U1-Gt
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d6602961-3b76-4687-80dd-31331aa23f54;
 Thu, 08 Oct 2020 21:45:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjL-0007hi-Jg
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjL-0005Gg-Ix
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdjM-0007U1-Gt
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:44 +0000
X-Inumbo-ID: d6602961-3b76-4687-80dd-31331aa23f54
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d6602961-3b76-4687-80dd-31331aa23f54;
	Thu, 08 Oct 2020 21:45:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=usblRAf8Tp/dDI2uDm5qcq/mhXGBs6Q+zwuG2dIAcio=; b=O2csPW2VCFcEVjhB2eIsbo4jgF
	I3UVZ9OzGcuatdsGQzHx/VIfxscy4UICo7JWgHZzp1OyHUtU39Nwnk5DrD92G51xCAVW2R74fEWjm
	mmw2pr6PEZ21smVzXuu6TFZTeYZXuIHWV9uq/W6U8WzJ//YsMFnu91Zr4JKJgDKv3UbQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjL-0007hi-Jg
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjL-0005Gg-Ix
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: arrange for preemption in evtchn_destroy()
Message-Id: <E1kQdjL-0005Gg-Ix@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:43 +0000

commit f2befb6839818f1dbb2e2f5e3a8075bcaf563778
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:35:15 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:35:15 2020 +0200

    evtchn: arrange for preemption in evtchn_destroy()
    
    Especially closing of fully established interdomain channels can take
    quite some time, due to the locking involved. Therefore we shouldn't
    assume we can clean up still active ports all in one go. Besides adding
    the necessary preemption check, also avoid pointlessly starting from
    (or now really ending at) 0; 1 is the lowest numbered port which may
    need closing.
    
    Since we're now reducing ->valid_evtchns, free_xen_event_channel(),
    and (at least to be on the safe side) notify_via_xen_event_channel()
    need to cope with attempts to close / unbind from / send through already
    closed (and no longer valid, as per port_is_valid()) ports.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c        |  4 +++-
 xen/common/event_channel.c | 43 ++++++++++++++++++++++++++++++++++++++-----
 xen/include/xen/sched.h    |  2 +-
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 15529d768b..8833261357 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -626,7 +626,6 @@ int domain_kill(struct domain *d)
         domain_pause(d);
         d->is_dying = DOMDYING_dying;
         spin_barrier(&d->domain_lock);
-        evtchn_destroy(d);
         gnttab_release_mappings(d);
         tmem_destroy(d->tmem_client);
         vnuma_destroy(d->vnuma);
@@ -634,6 +633,9 @@ int domain_kill(struct domain *d)
         d->tmem_client = NULL;
         /* fallthrough */
     case DOMDYING_dying:
+        rc = evtchn_destroy(d);
+        if ( rc )
+            break;
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
             break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 9bc9a61a0e..aca5e85c59 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1299,7 +1299,16 @@ int alloc_unbound_xen_event_channel(
 
 void free_xen_event_channel(struct domain *d, int port)
 {
-    BUG_ON(!port_is_valid(d, port));
+    if ( !port_is_valid(d, port) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        BUG_ON(!d->is_dying);
+        return;
+    }
 
     evtchn_close(d, port, 0);
 }
@@ -1311,7 +1320,17 @@ void notify_via_xen_event_channel(struct domain *ld, int lport)
     struct domain *rd;
     unsigned long flags;
 
-    ASSERT(port_is_valid(ld, lport));
+    if ( !port_is_valid(ld, lport) )
+    {
+        /*
+         * Make sure ->is_dying is read /after/ ->valid_evtchns, pairing
+         * with the spin_barrier() and BUG_ON() in evtchn_destroy().
+         */
+        smp_rmb();
+        ASSERT(ld->is_dying);
+        return;
+    }
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
@@ -1383,8 +1402,7 @@ int evtchn_init(struct domain *d)
     return 0;
 }
 
-
-void evtchn_destroy(struct domain *d)
+int evtchn_destroy(struct domain *d)
 {
     unsigned int i;
 
@@ -1393,14 +1411,29 @@ void evtchn_destroy(struct domain *d)
     spin_barrier(&d->event_lock);
 
     /* Close all existing event channels. */
-    for ( i = 0; port_is_valid(d, i); i++ )
+    for ( i = d->valid_evtchns; --i; )
+    {
         evtchn_close(d, i, 0);
 
+        /*
+         * Avoid preempting when called from domain_create()'s error path,
+         * and don't check too often (choice of frequency is arbitrary).
+         */
+        if ( i && !(i & 0x3f) && d->is_dying != DOMDYING_dead &&
+             hypercall_preempt_check() )
+        {
+            write_atomic(&d->valid_evtchns, i);
+            return -ERESTART;
+        }
+    }
+
     ASSERT(!d->active_evtchns);
 
     clear_global_virq_handlers(d);
 
     evtchn_fifo_destroy(d);
+
+    return 0;
 }
 
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index f919b6b97a..707e655ecc 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -134,7 +134,7 @@ struct evtchn
 } __attribute__((aligned(64)));
 
 int  evtchn_init(struct domain *d); /* from domain_create */
-void evtchn_destroy(struct domain *d); /* from domain_kill */
+int  evtchn_destroy(struct domain *d); /* from domain_kill */
 void evtchn_destroy_final(struct domain *d); /* from complete_domain_destroy */
 
 struct waitqueue_vcpu;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:45:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4657.12317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjY-0007WJ-Bq; Thu, 08 Oct 2020 21:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4657.12317; Thu, 08 Oct 2020 21:45:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdjY-0007WB-8a; Thu, 08 Oct 2020 21:45:56 +0000
Received: by outflank-mailman (input) for mailman id 4657;
 Thu, 08 Oct 2020 21:45:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdjW-0007Vx-Qw
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2c43b9c-cb15-42c7-b138-0cef38b16d46;
 Thu, 08 Oct 2020 21:45:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjV-0007hs-Mk
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjV-0005HO-M2
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdjW-0007Vx-Qw
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:54 +0000
X-Inumbo-ID: a2c43b9c-cb15-42c7-b138-0cef38b16d46
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2c43b9c-cb15-42c7-b138-0cef38b16d46;
	Thu, 08 Oct 2020 21:45:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=agnWR9q41FFGfNl1H+cV+Fv0jIZoo6EUXi/eQqILxqU=; b=AaX4paJ+0DN11HAf9WUGk94cMA
	9YulUHPbUO144i93+SK1EFPATD8Kb7gGYlUrgUQO96cSYsdSp+zpLMsoeJihsIvSN64Bet744QUwA
	QkUd6QMkeJTKfN6QZ6EYDBcgVmRIpjEWKk3wn6c0Wtu9w1cR2+Ts/HLIoMq7/ZgQgx90=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjV-0007hs-Mk
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjV-0005HO-M2
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:45:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn: arrange for preemption in evtchn_reset()
Message-Id: <E1kQdjV-0005HO-M2@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:45:53 +0000

commit f58caa40cd8c2a3dbed705d90b6a22facc281afb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Sep 22 17:35:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Sep 22 17:35:56 2020 +0200

    evtchn: arrange for preemption in evtchn_reset()
    
    Like for evtchn_destroy() looping over all possible event channels to
    close them can take a significant amount of time. Unlike done there, we
    can't alter domain properties (i.e. d->valid_evtchns) here. Borrow, in a
    lightweight form, the paging domctl continuation concept, redirecting
    the continuations to different sub-ops. Just like there this is to be
    able to allow for predictable overall results of the involved sub-ops:
    Racing requests should either complete or be refused.
    
    Note that a domain can't interfere with an already started (by a remote
    domain) reset, due to being paused. It can prevent a remote reset from
    happening by leaving a reset unfinished, but that's only going to affect
    itself.
    
    This is part of XSA-344.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/domain.c                |  4 ++--
 xen/common/domctl.c                | 12 ++++++++++-
 xen/common/event_channel.c         | 42 ++++++++++++++++++++++++++++++++++----
 xen/include/public/domctl.h        |  5 ++++-
 xen/include/public/event_channel.h |  3 +++
 xen/include/xen/event.h            |  2 +-
 xen/include/xen/sched.h            |  4 +++-
 7 files changed, 62 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8833261357..b187fbb220 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1086,7 +1086,7 @@ void domain_unpause_except_self(struct domain *d)
         domain_unpause(d);
 }
 
-int domain_soft_reset(struct domain *d)
+int domain_soft_reset(struct domain *d, bool resuming)
 {
     struct vcpu *v;
     int rc;
@@ -1100,7 +1100,7 @@ int domain_soft_reset(struct domain *d)
         }
     spin_unlock(&d->shutdown_lock);
 
-    rc = evtchn_reset(d);
+    rc = evtchn_reset(d, resuming);
     if ( rc )
         return rc;
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index a70f4b46f8..f66fbbc110 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -666,12 +666,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
 
     case XEN_DOMCTL_soft_reset:
+    case XEN_DOMCTL_soft_reset_cont:
         if ( d == current->domain ) /* no domain_pause() */
         {
             ret = -EINVAL;
             break;
         }
-        ret = domain_soft_reset(d);
+        ret = domain_soft_reset(d, op->cmd == XEN_DOMCTL_soft_reset_cont);
+        if ( ret == -ERESTART )
+        {
+            op->cmd = XEN_DOMCTL_soft_reset_cont;
+            if ( !__copy_field_to_guest(u_domctl, op, cmd) )
+                ret = hypercall_create_continuation(__HYPERVISOR_domctl,
+                                                    "h", u_domctl);
+            else
+                ret = -EFAULT;
+        }
         break;
 
     case XEN_DOMCTL_destroydomain:
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index aca5e85c59..b41096a65f 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1059,7 +1059,7 @@ int evtchn_unmask(unsigned int port)
     return 0;
 }
 
-int evtchn_reset(struct domain *d)
+int evtchn_reset(struct domain *d, bool resuming)
 {
     unsigned int i;
     int rc = 0;
@@ -1067,11 +1067,40 @@ int evtchn_reset(struct domain *d)
     if ( d != current->domain && !d->controller_pause_count )
         return -EINVAL;
 
-    for ( i = 0; port_is_valid(d, i); i++ )
+    spin_lock(&d->event_lock);
+
+    /*
+     * If we are resuming, then start where we stopped. Otherwise, check
+     * that a reset operation is not already in progress, and if none is,
+     * record that this is now the case.
+     */
+    i = resuming ? d->next_evtchn : !d->next_evtchn;
+    if ( i > d->next_evtchn )
+        d->next_evtchn = i;
+
+    spin_unlock(&d->event_lock);
+
+    if ( !i )
+        return -EBUSY;
+
+    for ( ; port_is_valid(d, i); i++ )
+    {
         evtchn_close(d, i, 1);
 
+        /* NB: Choice of frequency is arbitrary. */
+        if ( !(i & 0x3f) && hypercall_preempt_check() )
+        {
+            spin_lock(&d->event_lock);
+            d->next_evtchn = i;
+            spin_unlock(&d->event_lock);
+            return -ERESTART;
+        }
+    }
+
     spin_lock(&d->event_lock);
 
+    d->next_evtchn = 0;
+
     if ( d->active_evtchns > d->xen_evtchns )
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
@@ -1206,7 +1235,8 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
-    case EVTCHNOP_reset: {
+    case EVTCHNOP_reset:
+    case EVTCHNOP_reset_cont: {
         struct evtchn_reset reset;
         struct domain *d;
 
@@ -1219,9 +1249,13 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d);
         if ( !rc )
-            rc = evtchn_reset(d);
+            rc = evtchn_reset(d, cmd == EVTCHNOP_reset_cont);
 
         rcu_unlock_domain(d);
+
+        if ( rc == -ERESTART )
+            rc = hypercall_create_continuation(__HYPERVISOR_event_channel_op,
+                                               "ih", EVTCHNOP_reset_cont, arg);
         break;
     }
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 463f8cc420..1ad0a2353e 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1130,7 +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 /* Obsolete IA64 only */
+#ifdef __XEN__
+/* #define XEN_DOMCTL_arch_setup                 23 Obsolete IA64 only */
+#define XEN_DOMCTL_soft_reset_cont               23
+#endif
 #define XEN_DOMCTL_settimeoffset                 24
 #define XEN_DOMCTL_getvcpuaffinity               25
 #define XEN_DOMCTL_real_mode_area                26 /* Obsolete PPC only */
diff --git a/xen/include/public/event_channel.h b/xen/include/public/event_channel.h
index 44c549dd6b..a1949191c6 100644
--- a/xen/include/public/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -74,6 +74,9 @@
 #define EVTCHNOP_init_control    11
 #define EVTCHNOP_expand_array    12
 #define EVTCHNOP_set_priority    13
+#ifdef __XEN__
+#define EVTCHNOP_reset_cont      14
+#endif
 /* ` } */
 
 typedef uint32_t evtchn_port_t;
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 26ad429520..87a4aade86 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -171,7 +171,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port);
 void evtchn_2l_init(struct domain *d);
 
 /* Close all event channels and reset to 2-level ABI. */
-int evtchn_reset(struct domain *d);
+int evtchn_reset(struct domain *d, bool resuming);
 
 /*
  * Low-level event channel port ops.
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 707e655ecc..0a13b81c21 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -348,6 +348,8 @@ struct domain
      * EVTCHNOP_reset).  Read/write access like for active_evtchns.
      */
     unsigned int     xen_evtchns;
+    /* Port to resume from in evtchn_reset(), when in a continuation. */
+    unsigned int     next_evtchn;
     spinlock_t       event_lock;
     const struct evtchn_port_ops *evtchn_port_ops;
     struct evtchn_fifo_domain *evtchn_fifo;
@@ -616,7 +618,7 @@ int domain_shutdown(struct domain *d, u8 reason);
 void domain_resume(struct domain *d);
 void domain_pause_for_debugger(void);
 
-int domain_soft_reset(struct domain *d);
+int domain_soft_reset(struct domain *d, bool resuming);
 
 int vcpu_start_shutdown_deferral(struct vcpu *v);
 void vcpu_end_shutdown_deferral(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Thu Oct 08 21:46:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Oct 2020 21:46:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4659.12320 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdji-0007Xa-DO; Thu, 08 Oct 2020 21:46:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4659.12320; Thu, 08 Oct 2020 21:46:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQdji-0007XS-AL; Thu, 08 Oct 2020 21:46:06 +0000
Received: by outflank-mailman (input) for mailman id 4659;
 Thu, 08 Oct 2020 21:46:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQdjh-0007XJ-19
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id be556d7f-e5fe-4b8c-8a7c-c49dcca0bbb6;
 Thu, 08 Oct 2020 21:46:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjf-0007iD-TM
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQdjf-0005IL-P9
 for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=C8tB=DP=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQdjh-0007XJ-19
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:05 +0000
X-Inumbo-ID: be556d7f-e5fe-4b8c-8a7c-c49dcca0bbb6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id be556d7f-e5fe-4b8c-8a7c-c49dcca0bbb6;
	Thu, 08 Oct 2020 21:46:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GGa5g7eCF4EljhBbZSUx8Bv84YAzA/lpw7Wr+A2JmxI=; b=4HD9p0Ozz5N72c5qr2gTGg7mhv
	3IaidJH4CzxCes57nXkPNeqQYoAOl+AAL4LfbnYDOSjyXjWDwRXwDwmB9cBtCPdMGKrGbupATTc71
	IvBDLGXaFCcjdEmCUXMNbzn4f1ctlHupMAsyvaIc9nAjogdQGogqYscVC6XSOOW+SLCU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjf-0007iD-TM
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQdjf-0005IL-P9
	for xen-changelog@lists.xenproject.org; Thu, 08 Oct 2020 21:46:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] evtchn/Flask: pre-allocate node on send path
Message-Id: <E1kQdjf-0005IL-P9@xenbits.xenproject.org>
Date: Thu, 08 Oct 2020 21:46:03 +0000

commit 1719f79a0efd36d15837c51982173dd1c287dced
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:38:17 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 2 12:38:17 2020 +0200

    evtchn/Flask: pre-allocate node on send path
    
    xmalloc() & Co may not be called with IRQs off, or else check_lock()
    will have its assertion trigger about locks getting acquired
    inconsistently. Re-arranging the locking in evtchn_send() doesn't seem
    very reasonable, especially since the per-channel lock was introduced to
    avoid acquiring the per-domain event lock on the send paths. Issue a
    second call to xsm_evtchn_send() instead, before acquiring the lock, to
    give XSM / Flask a chance to pre-allocate whatever it may need.
    
    As these nodes are used merely for caching earlier decisions' results,
    allocate just one node in AVC code despite two potentially being needed.
    Things will merely be not as performant if a second allocation was
    wanted, just like when the pre-allocation fails.
    
    Fixes: c0ddc8634845 ("evtchn: convert per-channel lock to be IRQ-safe")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
    master commit: 52e1fc47abc3a0123d2b5bb7e9172e84fd571851
    master date: 2020-10-02 08:36:21 +0200
---
 xen/common/event_channel.c  |  6 ++++
 xen/include/xsm/xsm.h       |  1 +
 xen/xsm/flask/avc.c         | 78 +++++++++++++++++++++++++++++++++++++++++----
 xen/xsm/flask/hooks.c       | 10 ++++++
 xen/xsm/flask/include/avc.h |  2 ++
 5 files changed, 90 insertions(+), 7 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index b41096a65f..84d58454d2 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -726,6 +726,12 @@ int evtchn_send(struct domain *ld, unsigned int lport)
     if ( !port_is_valid(ld, lport) )
         return -EINVAL;
 
+    /*
+     * As the call further down needs to avoid allocations (due to running
+     * with IRQs off), give XSM a chance to pre-allocate if needed.
+     */
+    xsm_evtchn_send(XSM_HOOK, ld, NULL);
+
     lchn = evtchn_from_port(ld, lport);
 
     spin_lock_irqsave(&lchn->lock, flags);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2a299f7569..d0b4b097c0 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -59,6 +59,7 @@ struct xsm_operations {
     int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1,
                                         struct domain *d2, struct evtchn *chn2);
     void (*evtchn_close_post) (struct evtchn *chn);
+    /* Note: Next hook may be called with 'chn' set to NULL. See call site. */
     int (*evtchn_send) (struct domain *d, struct evtchn *chn);
     int (*evtchn_status) (struct domain *d, struct evtchn *chn);
     int (*evtchn_reset) (struct domain *d1, struct domain *d2);
diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index a3e6108a34..8917329225 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -24,7 +24,9 @@
 #include <xen/prefetch.h>
 #include <xen/kernel.h>
 #include <xen/sched.h>
+#include <xen/cpu.h>
 #include <xen/init.h>
+#include <xen/percpu.h>
 #include <xen/rcupdate.h>
 #include <asm/atomic.h>
 #include <asm/current.h>
@@ -341,17 +343,79 @@ static inline int avc_reclaim_node(void)
     return ecx;
 }
 
+static struct avc_node *new_node(void)
+{
+    struct avc_node *node = xzalloc(struct avc_node);
+
+    if ( node )
+    {
+        INIT_RCU_HEAD(&node->rhead);
+        INIT_HLIST_NODE(&node->list);
+        avc_cache_stats_incr(allocations);
+    }
+
+    return node;
+}
+
+/*
+ * avc_has_perm_noaudit() may consume up to two nodes, which we may not be
+ * able to obtain from the allocator at that point. Since the is merely
+ * about caching earlier decisions, allow for (just) one pre-allocated node.
+ */
+static DEFINE_PER_CPU(struct avc_node *, prealloc_node);
+
+void avc_prealloc(void)
+{
+    struct avc_node **prealloc = &this_cpu(prealloc_node);
+
+    if ( !*prealloc )
+        *prealloc = new_node();
+}
+
+static int cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    struct avc_node **prealloc = &per_cpu(prealloc_node, cpu);
+
+    if ( action == CPU_DEAD && *prealloc )
+    {
+        xfree(*prealloc);
+        *prealloc = NULL;
+        avc_cache_stats_incr(frees);
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+    .priority = 99
+};
+
+static int __init cpu_nfb_init(void)
+{
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+__initcall(cpu_nfb_init);
+
 static struct avc_node *avc_alloc_node(void)
 {
-    struct avc_node *node;
+    struct avc_node *node, **prealloc = &this_cpu(prealloc_node);
 
-    node = xzalloc(struct avc_node);
-    if (!node)
-        goto out;
+    node = *prealloc;
+    *prealloc = NULL;
 
-    INIT_RCU_HEAD(&node->rhead);
-    INIT_HLIST_NODE(&node->list);
-    avc_cache_stats_incr(allocations);
+    if ( !node )
+    {
+        /* Must not call xmalloc() & Co with IRQs off. */
+        if ( !local_irq_is_enabled() )
+            goto out;
+        node = new_node();
+        if ( !node )
+            goto out;
+    }
 
     atomic_inc(&avc_cache.active_nodes);
     if ( atomic_read(&avc_cache.active_nodes) > avc_cache_threshold )
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index f01b4cfaaa..211cfb9a4b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -278,6 +278,16 @@ static int flask_evtchn_send(struct domain *d, struct evtchn *chn)
 {
     int rc;
 
+    /*
+     * When called with non-NULL chn, memory allocation may not be permitted.
+     * Allow AVC to preallocate nodes as necessary upon early notification.
+     */
+    if ( !chn )
+    {
+        avc_prealloc();
+        return 0;
+    }
+
     switch ( chn->state )
     {
     case ECS_INTERDOMAIN:
diff --git a/xen/xsm/flask/include/avc.h b/xen/xsm/flask/include/avc.h
index bfc69f4acd..8426b36c72 100644
--- a/xen/xsm/flask/include/avc.h
+++ b/xen/xsm/flask/include/avc.h
@@ -90,6 +90,8 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, u16 tclass, u32 requested,
 int avc_has_perm(u32 ssid, u32 tsid, u16 tclass, u32 requested,
                                              struct avc_audit_data *auditdata);
 
+void avc_prealloc(void);
+
 /* Exported to selinuxfs */
 struct xen_flask_hash_stats;
 int avc_get_hash_stats(struct xen_flask_hash_stats *arg);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 01:22:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 01:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4677.12375 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQh6l-0003kC-Kc; Fri, 09 Oct 2020 01:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4677.12375; Fri, 09 Oct 2020 01:22:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQh6l-0003k4-Hd; Fri, 09 Oct 2020 01:22:07 +0000
Received: by outflank-mailman (input) for mailman id 4677;
 Fri, 09 Oct 2020 01:22:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQh6k-0003jz-TL
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 76093fa5-958e-466e-b86b-70e792bc4a77;
 Fri, 09 Oct 2020 01:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQh6i-0004kj-UD
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQh6i-0003ga-SK
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQh6k-0003jz-TL
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:06 +0000
X-Inumbo-ID: 76093fa5-958e-466e-b86b-70e792bc4a77
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 76093fa5-958e-466e-b86b-70e792bc4a77;
	Fri, 09 Oct 2020 01:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qFlZK9IBpclbbNy3+ks7KZU1iR6bBGnLi8/GTwVfaFY=; b=wBi7tgv4Epz4pg3/ey+c5Jewbl
	RnrhRpDnxsCGZ9nJvxa+rjLbgAVXlY03FHfPBuzyMcj69EzcB9ipO/mSW8vrPJcpis1NFXoOuy3VH
	z4n4LaI8NqSBDpHxpQjx0wc1WcUROhKJ7UbnSkTHRl3NqBUDts9K5F+S53/QeSXud2W0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQh6i-0004kj-UD
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQh6i-0003ga-SK
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 01:22:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/rpi4: implement watchdog-based reset
Message-Id: <E1kQh6i-0003ga-SK@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 01:22:04 +0000

commit 25849c8b16f2a5b7fcd0a823e80a5f1b590291f9
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Fri Oct 2 13:47:17 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Thu Oct 8 18:16:20 2020 -0700

    xen/rpi4: implement watchdog-based reset
    
    The preferred method to reboot RPi4 is PSCI. If it is not available,
    touching the watchdog is required to be able to reboot the board.
    
    The implementation is based on
    drivers/watchdog/bcm2835_wdt.c:__bcm2835_restart in Linux v5.9-rc7.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Tested-by: Roman Shaposhnik <roman@zededa.com>
    CC: roman@zededa.com
---
 xen/arch/arm/platforms/brcm-raspberry-pi.c | 61 ++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c
index f5ae58a7d5..811b40b1a6 100644
--- a/xen/arch/arm/platforms/brcm-raspberry-pi.c
+++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c
@@ -17,6 +17,10 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/delay.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
 #include <asm/platform.h>
 
 static const char *const rpi4_dt_compat[] __initconst =
@@ -37,12 +41,69 @@ static const struct dt_device_match rpi4_blacklist_dev[] __initconst =
      * The aux peripheral also shares a page with the aux UART.
      */
     DT_MATCH_COMPATIBLE("brcm,bcm2835-aux"),
+    /* Special device used for rebooting */
+    DT_MATCH_COMPATIBLE("brcm,bcm2835-pm"),
     { /* sentinel */ },
 };
 
+
+#define PM_PASSWORD                 0x5a000000
+#define PM_RSTC                     0x1c
+#define PM_WDOG                     0x24
+#define PM_RSTC_WRCFG_FULL_RESET    0x00000020
+#define PM_RSTC_WRCFG_CLR           0xffffffcf
+
+static void __iomem *rpi4_map_watchdog(void)
+{
+    void __iomem *base;
+    struct dt_device_node *node;
+    paddr_t start, len;
+    int ret;
+
+    node = dt_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm");
+    if ( !node )
+        return NULL;
+
+    ret = dt_device_get_address(node, 0, &start, &len);
+    if ( ret )
+    {
+        printk("Cannot read watchdog register address\n");
+        return NULL;
+    }
+
+    base = ioremap_nocache(start & PAGE_MASK, PAGE_SIZE);
+    if ( !base )
+    {
+        printk("Unable to map watchdog register!\n");
+        return NULL;
+    }
+
+    return base;
+}
+
+static void rpi4_reset(void)
+{
+    uint32_t val;
+    void __iomem *base = rpi4_map_watchdog();
+
+    if ( !base )
+        return;
+
+    /* use a timeout of 10 ticks (~150us) */
+    writel(10 | PM_PASSWORD, base + PM_WDOG);
+    val = readl(base + PM_RSTC);
+    val &= PM_RSTC_WRCFG_CLR;
+    val |= PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
+    writel(val, base + PM_RSTC);
+
+    /* No sleeping, possibly atomic. */
+    mdelay(1);
+}
+
 PLATFORM_START(rpi4, "Raspberry Pi 4")
     .compatible     = rpi4_dt_compat,
     .blacklist_dev  = rpi4_blacklist_dev,
+    .reset = rpi4_reset,
     .dma_bitsize    = 30,
 PLATFORM_END
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 13:55:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 13:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4776.12576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQsrS-0006go-7g; Fri, 09 Oct 2020 13:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4776.12576; Fri, 09 Oct 2020 13:55:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQsrS-0006gh-4d; Fri, 09 Oct 2020 13:55:06 +0000
Received: by outflank-mailman (input) for mailman id 4776;
 Fri, 09 Oct 2020 13:55:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQsrR-0006gc-5H
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 189fe73c-23ac-4f2a-bcdf-a3a7cb0de07f;
 Fri, 09 Oct 2020 13:55:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQsrO-000502-H0
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQsrO-0003Od-Fj
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQsrR-0006gc-5H
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:05 +0000
X-Inumbo-ID: 189fe73c-23ac-4f2a-bcdf-a3a7cb0de07f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 189fe73c-23ac-4f2a-bcdf-a3a7cb0de07f;
	Fri, 09 Oct 2020 13:55:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3xqDbEbiNPFC4vzrx5wui/Xm2BvL1h/ld5sjSRuge6E=; b=0LW3txK5OgK4HtgUwXWcgx5/CC
	/USHcp9icnEpzqvrOthenJSeF2tdBTqqujt/kacMf49pEMp5ZuMYYsJ0OecQ4kdu1I5EGa+xZ6m99
	36ZRFiHdbPF2247ofdyOFSE6sK2AC/csVuSjHe1gLDCpnlFhPG9yjvlc28Ta4iTg3p/U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQsrO-000502-H0
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQsrO-0003Od-Fj
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: always use BASEDIR for xen sub-directory
Message-Id: <E1kQsrO-0003Od-Fj@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 13:55:02 +0000

commit e4e64408f5c755da3bf7bfd78e70ad9f6c448376
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Fri Oct 2 11:42:09 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Oct 7 11:09:22 2020 +0000

    build: always use BASEDIR for xen sub-directory
    
    Modify Makefiles using $(XEN_ROOT)/xen to use $(BASEDIR) instead.
    
    This is removing the dependency to xen subdirectory preventing using a
    wrong configuration file when xen subdirectory is duplicated for
    compilation tests.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 4 ++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index b3b60a1ba2..083f62acb6 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index 408d69c99e..f1229b9bc8 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -3,6 +3,6 @@ include $(XEN_ROOT)/Config.mk
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
+	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 065f4b8471..799321ec4d 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(XEN_ROOT)/xen
+srctree := $(BASEDIR)
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 50bec20a1e..637159ad82 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 13:55:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 13:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4777.12580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQsrb-0006hV-9d; Fri, 09 Oct 2020 13:55:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4777.12580; Fri, 09 Oct 2020 13:55:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQsrb-0006hN-6X; Fri, 09 Oct 2020 13:55:15 +0000
Received: by outflank-mailman (input) for mailman id 4777;
 Fri, 09 Oct 2020 13:55:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQsrZ-0006hI-L6
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eca36c82-8541-4d2c-91ee-79017821db33;
 Fri, 09 Oct 2020 13:55:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQsrY-000505-LE
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQsrY-0003Pr-JG
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQsrZ-0006hI-L6
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:13 +0000
X-Inumbo-ID: eca36c82-8541-4d2c-91ee-79017821db33
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eca36c82-8541-4d2c-91ee-79017821db33;
	Fri, 09 Oct 2020 13:55:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XgC0QAYpLkn4a6bRoXdJBInRK8y00VeTOjWnaZc9/x0=; b=3i6mw4wXoaxW3xc8kyU+9oFBgl
	SsG1jwvUJBTKtbXb1A/vfQEjjO81washmNZkHBl/MIzLKAlNuoLjIS0F+cPIX9VC8fZTB9GcOcBuP
	dq7Hmc8sP79Y+rhTHWYsRT1CE2nr7DLSddbB8v/D4twyKTdBYIKAPaR++vFtIm+nD8wU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQsrY-000505-LE
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQsrY-0003Pr-JG
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 13:55:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Revert "build: always use BASEDIR for xen sub-directory"
Message-Id: <E1kQsrY-0003Pr-JG@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 13:55:12 +0000

commit 7a519f8bda6f3505a4c1fbf277f002aa0c12ab9a
Author:     Wei Liu <wl@xen.org>
AuthorDate: Wed Oct 7 14:59:51 2020 +0000
Commit:     Wei Liu <wl@xen.org>
CommitDate: Wed Oct 7 14:59:51 2020 +0000

    Revert "build: always use BASEDIR for xen sub-directory"
    
    This reverts commit e4e64408f5c755da3bf7bfd78e70ad9f6c448376.
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 4 ++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index 083f62acb6..b3b60a1ba2 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(BASEDIR)/tools/binfile
-	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(XEN_ROOT)/xen/tools/binfile
+	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index f1229b9bc8..408d69c99e 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -3,6 +3,6 @@ include $(XEN_ROOT)/Config.mk
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
-	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
+	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 799321ec4d..065f4b8471 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(BASEDIR)
+srctree := $(XEN_ROOT)/xen
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 637159ad82..50bec20a1e 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(BASEDIR)/tools/binfile
-	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
+	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4975.12780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw5n-0003Bw-Kc; Fri, 09 Oct 2020 17:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4975.12780; Fri, 09 Oct 2020 17:22:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw5n-0003Bp-Hl; Fri, 09 Oct 2020 17:22:07 +0000
Received: by outflank-mailman (input) for mailman id 4975;
 Fri, 09 Oct 2020 17:22:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw5m-0003Bk-Cw
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f5f8bef0-cd2f-4993-abb8-36719b222564;
 Fri, 09 Oct 2020 17:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw5l-0001VR-3a
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw5l-0007YZ-0L
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw5m-0003Bk-Cw
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:06 +0000
X-Inumbo-ID: f5f8bef0-cd2f-4993-abb8-36719b222564
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f5f8bef0-cd2f-4993-abb8-36719b222564;
	Fri, 09 Oct 2020 17:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FZtRsFthwlaX9wo2PE0Ap3dDYQaFLurkgDBVIwKjsHs=; b=SuOS/BFCTW7vSRzr0Jgt8/yAX9
	T0vqjychjqYC1FVnamI17DMdrz4h77tT0HQqoHCWRT2Qrpzcc+Be9xnyQKTXbd8aCP4ANFxsd816O
	mvrrhD2tGfUGcJFLGSJOtVlPgdPpmv86g6mcIru/AU8iFMRJ9sdLiCwtNUpIQu+taqzo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw5l-0001VR-3a
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw5l-0007YZ-0L
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: Correct error message in check_segment()
Message-Id: <E1kQw5l-0007YZ-0L@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:05 +0000

commit 8d255609930bed04c6436974bd895be9a405d0c1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 12:20:44 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/hvm: Correct error message in check_segment()
    
    The error message is wrong (given AMD's older interpretation of what a NUL
    segment should contain, attribute wise), and actively unhelpful because you
    only get it in response to a hypercall where the one piece of information you
    cannot provide is the segment selector.
    
    Fix the message to talk about segment attributes, rather than the selector.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 0ce132b308..10e30175a1 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -39,7 +39,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
     {
         if ( seg != x86_seg_ds && seg != x86_seg_es )
         {
-            gprintk(XENLOG_ERR, "Null selector provided for CS, SS or TR\n");
+            gprintk(XENLOG_ERR, "Null segment attributes for CS, SS or TR\n");
             return -EINVAL;
         }
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4976.12784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw5x-0003Ct-MV; Fri, 09 Oct 2020 17:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4976.12784; Fri, 09 Oct 2020 17:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw5x-0003Cl-JX; Fri, 09 Oct 2020 17:22:17 +0000
Received: by outflank-mailman (input) for mailman id 4976;
 Fri, 09 Oct 2020 17:22:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw5w-0003Cb-7n
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fb1393f2-5d9b-49d2-8736-99fc8102c56e;
 Fri, 09 Oct 2020 17:22:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw5v-0001VX-85
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw5v-0007Zi-5o
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw5w-0003Cb-7n
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:16 +0000
X-Inumbo-ID: fb1393f2-5d9b-49d2-8736-99fc8102c56e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fb1393f2-5d9b-49d2-8736-99fc8102c56e;
	Fri, 09 Oct 2020 17:22:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h9lqLi9546LEAV/LhFOLRlaLcP9l09hMwdPBNcUrIvM=; b=n4En/M166CAyNRuVifh4yjtCSE
	JOq59i/QPQR0lG7nlPm3QcAdSfuhV+NUzFduI/JMyQvxLy9P8BvDldciCtTyhgLLCNcGjq//AEZHy
	a1t6SKi+wxjB1hDnWX5mpNVox8TI/VqkluWqHP7It4aXw0CquWV0pnmbmsoLIMc+5pfo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw5v-0001VX-85
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw5v-0007Zi-5o
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode: Trivial further cleanup
Message-Id: <E1kQw5v-0007Zi-5o@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:15 +0000

commit afef39241b66df7d5fd66b07dc13350370a4991a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 1 15:51:08 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/ucode: Trivial further cleanup
    
     * Drop unused include in private.h.
     * Used explicit width integers for Intel header fields.
     * Adjust comment to better describe the extended header.
     * Drop unnecessary __packed attribute for AMD header.
     * Fix types and style.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  8 ++++----
 xen/arch/x86/cpu/microcode/intel.c   | 34 +++++++++++++++++-----------------
 xen/arch/x86/cpu/microcode/private.h |  2 --
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index cd532321e8..e80f7cd3e4 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -24,7 +24,7 @@
 
 #define pr_debug(x...) ((void)0)
 
-struct __packed equiv_cpu_entry {
+struct equiv_cpu_entry {
     uint32_t installed_cpu;
     uint32_t fixed_errata_mask;
     uint32_t fixed_errata_compare;
@@ -102,7 +102,7 @@ static void collect_cpu_info(void)
              smp_processor_id(), csig->rev);
 }
 
-static bool_t verify_patch_size(uint32_t patch_size)
+static bool verify_patch_size(uint32_t patch_size)
 {
     uint32_t max_size;
 
@@ -113,7 +113,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F17H_MPB_MAX_SIZE 3200
 #define F19H_MPB_MAX_SIZE 4800
 
-    switch (boot_cpu_data.x86)
+    switch ( boot_cpu_data.x86 )
     {
     case 0x14:
         max_size = F14H_MPB_MAX_SIZE;
@@ -135,7 +135,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         break;
     }
 
-    return (patch_size <= max_size);
+    return patch_size <= max_size;
 }
 
 static bool check_final_patch_levels(const struct cpu_signature *sig)
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index d031196d4c..d9bb1bc10e 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -32,38 +32,38 @@
 #define pr_debug(x...) ((void)0)
 
 struct microcode_patch {
-    unsigned int hdrver;
-    unsigned int rev;
+    uint32_t hdrver;
+    uint32_t rev;
     uint16_t year;
     uint8_t  day;
     uint8_t  month;
-    unsigned int sig;
-    unsigned int cksum;
-    unsigned int ldrver;
+    uint32_t sig;
+    uint32_t cksum;
+    uint32_t ldrver;
 
     /*
      * Microcode for the Pentium Pro and II had all further fields in the
      * header reserved, had a fixed datasize of 2000 and totalsize of 2048,
      * and didn't use platform flags despite the availability of the MSR.
      */
-    unsigned int pf;
-    unsigned int datasize;
-    unsigned int totalsize;
-    unsigned int reserved[3];
+    uint32_t pf;
+    uint32_t datasize;
+    uint32_t totalsize;
+    uint32_t reserved[3];
 
     /* Microcode payload.  Format is propriety and encrypted. */
     uint8_t data[];
-};
 
-/* microcode format is extended from prescott processors */
+    /* Extended header (iff totalsize > datasize, P4 Prescott and later) */
+};
 struct extended_sigtable {
-    unsigned int count;
-    unsigned int cksum;
-    unsigned int reserved[3];
+    uint32_t count;
+    uint32_t cksum;
+    uint32_t rsvd[3];
     struct {
-        unsigned int sig;
-        unsigned int pf;
-        unsigned int cksum;
+        uint32_t sig;
+        uint32_t pf;
+        uint32_t cksum;
     } sigs[];
 };
 
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index c00ba590d1..9a15cdc879 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -1,8 +1,6 @@
 #ifndef ASM_X86_MICROCODE_PRIVATE_H
 #define ASM_X86_MICROCODE_PRIVATE_H
 
-#include <xen/types.h>
-
 #include <asm/microcode.h>
 
 enum microcode_match_result {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4977.12788 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw68-0003ET-O7; Fri, 09 Oct 2020 17:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4977.12788; Fri, 09 Oct 2020 17:22:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw68-0003EM-LF; Fri, 09 Oct 2020 17:22:28 +0000
Received: by outflank-mailman (input) for mailman id 4977;
 Fri, 09 Oct 2020 17:22:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw66-0003E8-Vh
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 18970bbd-bf68-4818-a25a-db264f0e69cd;
 Fri, 09 Oct 2020 17:22:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw65-0001Ve-Bq
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw65-0007am-AM
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw66-0003E8-Vh
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:27 +0000
X-Inumbo-ID: 18970bbd-bf68-4818-a25a-db264f0e69cd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 18970bbd-bf68-4818-a25a-db264f0e69cd;
	Fri, 09 Oct 2020 17:22:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MnNKWRsUFzsPQg7ZI6d5sUVkLJEyMg45vbYX0mM2QgA=; b=1U+o14wVstGGcBbdHy7lJjyGgM
	wjGeQ0CRUiuVIQ+uiyuyNhSxc6UFI/YKS8mBy1Kb04G9It0TPKamz5DK9hDP4XvCspIAyRk0j7r3j
	ui1uaOa7+jFnBXVRzJ+7HvqZY6dIjWApFpSIKyaInXzGmQWYoo0Fj7TIZDNHqImX6Hzw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw65-0001Ve-Bq
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw65-0007am-AM
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] efi/boot.c: add file.need_to_free
Message-Id: <E1kQw65-0007am-AM@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:25 +0000

commit 04be2c3a067899a3860fc2c7bc7a1599502ed1c5
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:19 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi/boot.c: add file.need_to_free
    
    The config file, kernel, initrd, etc should only be freed if they
    are allocated with the UEFI allocator.  On x86 the ucode, and on
    ARM the dtb, are also marked as need_to_free when allocated or
    expanded.
    
    This also fixes a memory leak in ARM fdt_increase_size() if there
    is an error in building the new device tree.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/efi/efi-boot.h | 11 +++++++++--
 xen/arch/x86/efi/efi-boot.h |  2 +-
 xen/common/efi/boot.c       | 10 ++++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 27dd0b1a94..c6200fda0e 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -314,7 +314,10 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
     if ( fdt_size )
     {
         if ( fdt_open_into(dtbfile.ptr, new_fdt, pages * EFI_PAGE_SIZE) )
+        {
+            efi_bs->FreePages(fdt_addr, pages);
             return NULL;
+        }
     }
     else
     {
@@ -326,7 +329,10 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
          * system table that is passed in the FDT.
          */
         if ( fdt_create_empty_tree(new_fdt, pages * EFI_PAGE_SIZE) )
+        {
+            efi_bs->FreePages(fdt_addr, pages);
             return NULL;
+        }
     }
 
     /*
@@ -335,12 +341,13 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
      * code will free it.  If the original FDT came from a configuration
      * table, we don't own that memory and can't free it.
      */
-    if ( dtbfile.size )
+    if ( dtbfile.need_to_free )
         efi_bs->FreePages(dtbfile.addr, PFN_UP(dtbfile.size));
 
     /* Update 'file' info for new memory so we clean it up on error exits */
     dtbfile.addr = fdt_addr;
     dtbfile.size = pages * EFI_PAGE_SIZE;
+    dtbfile.need_to_free = true;
     return new_fdt;
 }
 
@@ -546,7 +553,7 @@ static void __init efi_arch_cpu(void)
 
 static void __init efi_arch_blexit(void)
 {
-    if ( dtbfile.addr && dtbfile.size )
+    if ( dtbfile.need_to_free )
         efi_bs->FreePages(dtbfile.addr, PFN_UP(dtbfile.size));
     if ( memmap )
         efi_bs->FreePool(memmap);
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index eef3f52789..1025000afd 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -689,7 +689,7 @@ static void __init efi_arch_cpu(void)
 
 static void __init efi_arch_blexit(void)
 {
-    if ( ucode.addr )
+    if ( ucode.need_to_free )
         efi_bs->FreePages(ucode.addr, PFN_UP(ucode.size));
 }
 
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8123523194..9d6dc8ff4f 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -102,6 +102,7 @@ union string {
 
 struct file {
     UINTN size;
+    bool need_to_free;
     union {
         EFI_PHYSICAL_ADDRESS addr;
         char *str;
@@ -287,13 +288,13 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.addr )
+    if ( cfg.need_to_free )
         efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-    if ( kernel.addr )
+    if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
-    if ( ramdisk.addr )
+    if ( ramdisk.need_to_free )
         efi_bs->FreePages(ramdisk.addr, PFN_UP(ramdisk.size));
-    if ( xsm.addr )
+    if ( xsm.need_to_free )
         efi_bs->FreePages(xsm.addr, PFN_UP(xsm.size));
 
     efi_arch_blexit();
@@ -588,6 +589,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     }
     else
     {
+        file->need_to_free = true;
         file->size = size;
         if ( file != &cfg )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4979.12791 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6H-0003Fg-Q7; Fri, 09 Oct 2020 17:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4979.12791; Fri, 09 Oct 2020 17:22:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6H-0003FZ-Mr; Fri, 09 Oct 2020 17:22:37 +0000
Received: by outflank-mailman (input) for mailman id 4979;
 Fri, 09 Oct 2020 17:22:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw6G-0003FS-Aj
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e10926ad-f1e7-4457-a29d-f8cfcba2e249;
 Fri, 09 Oct 2020 17:22:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6F-0001Vm-F5
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6F-0007cI-E4
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw6G-0003FS-Aj
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:36 +0000
X-Inumbo-ID: e10926ad-f1e7-4457-a29d-f8cfcba2e249
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e10926ad-f1e7-4457-a29d-f8cfcba2e249;
	Fri, 09 Oct 2020 17:22:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i+iWVUgTead0kpWuPdMpr47a7RLu9576Y4123DBOr2M=; b=MyBxVLJsw8sQOnSaas20/Gdq5P
	BTnHdnzE2O3nc51vvUseEYJQ7WNGmyA3KeHfpjHel08vAW3+SEyTCBQcewUOgWY6Oz4oxqUmp4Nt7
	J7AbT3xANy3hFcHmTRwfxryCouVdnb/HjKcaoFpqqeobUBI4YX3Py2MhDH23k87OI/vc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6F-0001Vm-F5
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6F-0007cI-E4
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] efi/boot.c: add handle_file_info()
Message-Id: <E1kQw6F-0007cI-E4@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:35 +0000

commit 4dced5df761e36fa2561f6f0f6563b3580d95e7f
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:20 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi/boot.c: add handle_file_info()
    
    Add a separate function to display the address ranges used by
    the files and call `efi_arch_handle_module()` on the modules.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9d6dc8ff4f..bd629eb658 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -547,6 +547,22 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
+static void __init handle_file_info(const CHAR16 *name,
+                                    const struct file *file, const char *options)
+{
+    if ( file == &cfg )
+        return;
+
+    PrintStr(name);
+    PrintStr(L": ");
+    DisplayUint(file->addr, 2 * sizeof(file->addr));
+    PrintStr(L"-");
+    DisplayUint(file->addr + file->size, 2 * sizeof(file->addr));
+    PrintStr(newline);
+
+    efi_arch_handle_module(file, name, options);
+}
+
 static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                              struct file *file, const char *options)
 {
@@ -591,16 +607,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     {
         file->need_to_free = true;
         file->size = size;
-        if ( file != &cfg )
-        {
-            PrintStr(name);
-            PrintStr(L": ");
-            DisplayUint(file->addr, 2 * sizeof(file->addr));
-            PrintStr(L"-");
-            DisplayUint(file->addr + size, 2 * sizeof(file->addr));
-            PrintStr(newline);
-            efi_arch_handle_module(file, name, options);
-        }
+        handle_file_info(name, file, options);
 
         ret = FileHandle->Read(FileHandle, &file->size, file->str);
         if ( !EFI_ERROR(ret) && file->size != size )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4981.12797 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6S-0003HN-U7; Fri, 09 Oct 2020 17:22:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4981.12797; Fri, 09 Oct 2020 17:22:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6S-0003HB-Qd; Fri, 09 Oct 2020 17:22:48 +0000
Received: by outflank-mailman (input) for mailman id 4981;
 Fri, 09 Oct 2020 17:22:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw6R-0003H3-FM
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 695f1073-6027-49cf-b7a8-9d40293bb2a1;
 Fri, 09 Oct 2020 17:22:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6P-0001Vw-Ib
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6P-0007dW-HZ
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw6R-0003H3-FM
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:47 +0000
X-Inumbo-ID: 695f1073-6027-49cf-b7a8-9d40293bb2a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 695f1073-6027-49cf-b7a8-9d40293bb2a1;
	Fri, 09 Oct 2020 17:22:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IaodKeK5jWbIoNIhh78HXK9rJRl9fJVjv1F3uLT+vzs=; b=WY/klhClFWdSk742zPgc8AWQ3v
	9eA8a+Vdg90fB68FNSvHteW+Nu6/Rd9N9stAZFEKcgph5iYfQZes7RmPNbNJCBI7ZpSa35r1ZiAPI
	ocDk+R5wW6k43lC2nzCBl/gD70kYUdx26nDJVB3yTQxWq3uO0TbSL2SCVTKvvyTvrRe8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6P-0001Vw-Ib
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6P-0007dW-HZ
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] efi: Enable booting unified hypervisor/kernel/initrd images
Message-Id: <E1kQw6P-0007dW-HZ@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:45 +0000

commit 8a71d50ed40bfa78c37722dc11995ac2563662c3
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:21 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi: Enable booting unified hypervisor/kernel/initrd images
    
    This patch adds support for bundling the xen.efi hypervisor, the xen.cfg
    configuration file, the Linux kernel and initrd, as well as the XSM,
    and architectural specific files into a single "unified" EFI executable.
    This allows an administrator to update the components independently
    without requiring rebuilding xen, as well as to replace the components
    in an existing image.
    
    The resulting EFI executable can be invoked directly from the UEFI Boot
    Manager, removing the need to use a separate loader like grub as well
    as removing dependencies on local filesystem access.  And since it is
    a single file, it can be signed and validated by UEFI Secure Boot without
    requring the shim protocol.
    
    It is inspired by systemd-boot's unified kernel technique and borrows the
    function to locate PE sections from systemd's LGPL'ed code.  During EFI
    boot, Xen looks at its own loaded image to locate the PE sections for
    the Xen configuration (`.config`), dom0 kernel (`.kernel`), dom0 initrd
    (`.ramdisk`), and XSM config (`.xsm`), which are included after building
    xen.efi using objcopy to add named sections for each input file.
    
    For x86, the CPU ucode can be included in a section named `.ucode`,
    which is loaded in the efi_arch_cfg_file_late() stage of the boot process.
    
    On ARM systems the Device Tree can be included in a section named
    `.dtb`, which is loaded during the efi_arch_cfg_file_early() stage of
    the boot process.
    
    Note that the system will fall back to loading files from disk if
    the named sections do not exist. This allows distributions to continue
    with the status quo if they want a signed kernel + config, while still
    allowing a user provided initrd (which is how the shim protocol currently
    works as well).
    
    This patch also adds constness to the section parameter of
    efi_arch_cfg_file_early() and efi_arch_cfg_file_late(),
    changes pe_find_section() to use a const CHAR16 section name,
    and adds pe_name_compare() to match section names.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    [Fix ARM build by including pe.init.o]
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .gitignore                  |   1 +
 docs/misc/efi.pandoc        |  49 ++++++++++++++
 xen/arch/arm/efi/Makefile   |   2 +-
 xen/arch/arm/efi/efi-boot.h |  25 +++++---
 xen/arch/x86/efi/Makefile   |   2 +-
 xen/arch/x86/efi/efi-boot.h |  11 +++-
 xen/common/efi/boot.c       |  62 +++++++++++++-----
 xen/common/efi/efi.h        |   3 +
 xen/common/efi/pe.c         | 152 ++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 278 insertions(+), 29 deletions(-)

diff --git a/.gitignore b/.gitignore
index 188495783e..f6865c9cd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -327,6 +327,7 @@ xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/ebmalloc.c
 xen/arch/*/efi/efi.h
+xen/arch/*/efi/pe.c
 xen/arch/*/efi/runtime.c
 xen/common/config_data.S
 xen/common/config.gz
diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc
index 23c1a2732d..ac3cd58cae 100644
--- a/docs/misc/efi.pandoc
+++ b/docs/misc/efi.pandoc
@@ -116,3 +116,52 @@ Filenames must be specified relative to the location of the EFI binary.
 
 Extra options to be passed to Xen can also be specified on the command line,
 following a `--` separator option.
+
+## Unified Xen kernel image
+
+The "Unified" kernel image can be generated by adding additional
+sections to the Xen EFI executable with objcopy, similar to how
+[systemd-boot uses the stub to add them to the Linux kernel](https://wiki.archlinux.org/index.php/systemd-boot#Preparing_a_unified_kernel_image)
+
+The sections for the xen configuration file, the dom0 kernel, dom0 initrd,
+XSM and CPU microcode should be added after the Xen `.pad` section, the
+ending address of which can be located with:
+
+```
+objdump -h xen.efi \
+	| perl -ane '/\.pad/ && printf "0x%016x\n", hex($F[2]) + hex($F[3])'
+```
+
+For all the examples the `.pad` section ended at 0xffff82d041000000.
+All the sections are optional (`.config`, `.kernel`, `.ramdisk`, `.xsm`,
+`.ucode` (x86) and `.dtb` (ARM)) and the order does not matter.
+The virtual addresses do not need to be contiguous, although they should not
+be overlapping and should all be greater than the last virtual address of the
+hypervisor components.
+
+```
+objcopy \
+	--add-section .config=xen.cfg \
+	--change-section-vma .config=0xffff82d041000000
+	--add-section .ucode=ucode.bin \
+	--change-section-vma .ucode=0xffff82d041010000 \
+	--add-section .xsm=xsm.cfg \
+	--change-section-vma .xsm=0xffff82d041080000 \
+	--add-section .kernel=vmlinux \
+	--change-section-vma .kernel=0xffff82d041100000 \
+	--add-section .ramdisk=initrd.img \
+	--change-section-vma .ramdisk=0xffff82d042000000 \
+	xen.efi \
+	xen.unified.efi
+```
+
+The unified executable can be signed with sbsigntool to make
+it usable with UEFI secure boot:
+
+```
+sbsign \
+	--key signing.key \
+	--cert cert.pem \
+	--output xen.signed.efi \
+	xen.unified.efi
+```
diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
index 662892babd..1b1ed06fed 100644
--- a/xen/arch/arm/efi/Makefile
+++ b/xen/arch/arm/efi/Makefile
@@ -1,4 +1,4 @@
 CFLAGS-y += -fshort-wchar
 
-obj-y += boot.init.o ebmalloc.o runtime.o
+obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o
 obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index c6200fda0e..f64a6604af 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -382,27 +382,36 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     efi_xen_start(fdt, fdt_totalsize(fdt));
 }
 
-static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
+                                           EFI_FILE_HANDLE dir_handle,
+                                           const char *section)
 {
     union string name;
 
     /*
      * The DTB must be processed before any other entries in the configuration
-     * file, as the DTB is updated as modules are loaded.
+     * file, as the DTB is updated as modules are loaded.  Prefer the one
+     * stored as a PE section in a unified image, and fall back to a file
+     * on disk if the section is not present.
      */
-    name.s = get_value(&cfg, section, "dtb");
-    if ( name.s )
+    if ( !read_section(image, L"dtb", &dtbfile, NULL) )
     {
-        split_string(name.s);
-        read_file(dir_handle, s2w(&name), &dtbfile, NULL);
-        efi_bs->FreePool(name.w);
+        name.s = get_value(&cfg, section, "dtb");
+        if ( name.s )
+        {
+            split_string(name.s);
+            read_file(dir_handle, s2w(&name), &dtbfile, NULL);
+            efi_bs->FreePool(name.w);
+        }
     }
     fdt = fdt_increase_size(&dtbfile, cfg.size + EFI_PAGE_SIZE);
     if ( !fdt )
         blexit(L"Unable to create new FDT");
 }
 
-static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
+                                          EFI_FILE_HANDLE dir_handle,
+                                          const char *section)
 {
 }
 
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 770438a029..e857c0f2cc 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -8,7 +8,7 @@ cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
 
 boot.init.o: buildid.o
 
-EFIOBJ := boot.init.o ebmalloc.o compat.o runtime.o
+EFIOBJ := boot.init.o pe.init.o ebmalloc.o compat.o runtime.o
 
 $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4)
 $(EFIOBJ): CFLAGS-stack-boundary := $(cflags-stack-boundary)
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 1025000afd..2541ba1f32 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -272,14 +272,21 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     unreachable();
 }
 
-static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
+                                           EFI_FILE_HANDLE dir_handle,
+                                           const char *section)
 {
 }
 
-static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
+                                          EFI_FILE_HANDLE dir_handle,
+                                          const char *section)
 {
     union string name;
 
+    if ( read_section(image, L"ucode", &ucode, NULL) )
+        return;
+
     name.s = get_value(&cfg, section, "ucode");
     if ( !name.s )
         name.s = get_value(&cfg, "global", "ucode");
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index bd629eb658..bacd551bb5 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -122,6 +122,8 @@ static CHAR16 *s2w(union string *str);
 static char *w2s(const union string *str);
 static bool read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                       struct file *file, const char *options);
+static bool read_section(const EFI_LOADED_IMAGE *image, const CHAR16 *name,
+                         struct file *file, const char *options);
 static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
@@ -631,6 +633,20 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     return true;
 }
 
+static bool __init read_section(const EFI_LOADED_IMAGE *image,
+                                const CHAR16 *name, struct file *file,
+                                const char *options)
+{
+    file->ptr = pe_find_section(image->ImageBase, image->ImageSize,
+                                name, &file->size);
+    if ( !file->ptr )
+        return false;
+
+    handle_file_info(name, file, options);
+
+    return true;
+}
+
 static void __init pre_parse(const struct file *cfg)
 {
     char *ptr = cfg->str, *end = ptr + cfg->size;
@@ -1216,7 +1232,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         dir_handle = get_parent_handle(loaded_image, &file_name);
 
         /* Read and parse the config file. */
-        if ( !cfg_file_name )
+        if ( read_section(loaded_image, L"config", &cfg, NULL) )
+            PrintStr(L"Using builtin config file\r\n");
+        else if ( !cfg_file_name )
         {
             CHAR16 *tail;
 
@@ -1266,29 +1284,39 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         if ( !name.s )
             blexit(L"No Dom0 kernel image specified.");
 
-        efi_arch_cfg_file_early(dir_handle, section.s);
+        efi_arch_cfg_file_early(loaded_image, dir_handle, section.s);
 
         option_str = split_string(name.s);
-        read_file(dir_handle, s2w(&name), &kernel, option_str);
-        efi_bs->FreePool(name.w);
-
-        if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
-                        (void **)&shim_lock)) &&
-             (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
-            PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
-        name.s = get_value(&cfg, section.s, "ramdisk");
-        if ( name.s )
+        if ( !read_section(loaded_image, L"kernel", &kernel, option_str) )
         {
-            read_file(dir_handle, s2w(&name), &ramdisk, NULL);
+            read_file(dir_handle, s2w(&name), &kernel, option_str);
             efi_bs->FreePool(name.w);
+
+            if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
+                            (void **)&shim_lock)) &&
+                 (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+                PrintErrMesg(L"Dom0 kernel image could not be verified", status);
         }
 
-        name.s = get_value(&cfg, section.s, "xsm");
-        if ( name.s )
+        if ( !read_section(loaded_image, L"ramdisk", &ramdisk, NULL) )
         {
-            read_file(dir_handle, s2w(&name), &xsm, NULL);
-            efi_bs->FreePool(name.w);
+            name.s = get_value(&cfg, section.s, "ramdisk");
+            if ( name.s )
+            {
+                read_file(dir_handle, s2w(&name), &ramdisk, NULL);
+                efi_bs->FreePool(name.w);
+            }
+        }
+
+        if ( !read_section(loaded_image, L"xsm", &xsm, NULL) )
+        {
+            name.s = get_value(&cfg, section.s, "xsm");
+            if ( name.s )
+            {
+                read_file(dir_handle, s2w(&name), &xsm, NULL);
+                efi_bs->FreePool(name.w);
+            }
         }
 
         /*
@@ -1324,7 +1352,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
             }
         }
 
-        efi_arch_cfg_file_late(dir_handle, section.s);
+        efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
         efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
         cfg.addr = 0;
diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index 4845d84913..663a8b5000 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -47,3 +47,6 @@ const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN n);
 /* EFI boot allocator. */
 void *ebmalloc(size_t size);
 void free_ebmalloc_unused_mem(void);
+
+const void *pe_find_section(const void *image_base, const size_t image_size,
+                            const CHAR16 *section_name, UINTN *size_out);
diff --git a/xen/common/efi/pe.c b/xen/common/efi/pe.c
new file mode 100644
index 0000000000..a84992df9a
--- /dev/null
+++ b/xen/common/efi/pe.c
@@ -0,0 +1,152 @@
+/*
+ * xen/common/efi/pe.c
+ *
+ * PE executable header parser.
+ *
+ * Derived from https://github.com/systemd/systemd/blob/master/src/boot/efi/pe.c
+ * commit 07d5ed536ec0a76b08229c7a80b910cb9acaf6b1
+ *
+ * Copyright (C) 2015 Kay Sievers <kay@vrfy.org>
+ * Copyright (C) 2020 Trammell Hudson <hudson@trmm.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
+ * Lesser General Public License for more details.
+ */
+
+
+#include "efi.h"
+
+struct DosFileHeader {
+    UINT8   Magic[2];
+    UINT16  LastSize;
+    UINT16  nBlocks;
+    UINT16  nReloc;
+    UINT16  HdrSize;
+    UINT16  MinAlloc;
+    UINT16  MaxAlloc;
+    UINT16  ss;
+    UINT16  sp;
+    UINT16  Checksum;
+    UINT16  ip;
+    UINT16  cs;
+    UINT16  RelocPos;
+    UINT16  nOverlay;
+    UINT16  reserved[4];
+    UINT16  OEMId;
+    UINT16  OEMInfo;
+    UINT16  reserved2[10];
+    UINT32  ExeHeader;
+};
+
+#if defined(__arm__) || defined (__aarch64__)
+#define PE_HEADER_MACHINE 0xaa64
+#elif defined(__x86_64__)
+#define PE_HEADER_MACHINE 0x8664
+#else
+#error "Unknown architecture"
+#endif
+
+struct PeFileHeader {
+    UINT16  Machine;
+    UINT16  NumberOfSections;
+    UINT32  TimeDateStamp;
+    UINT32  PointerToSymbolTable;
+    UINT32  NumberOfSymbols;
+    UINT16  SizeOfOptionalHeader;
+    UINT16  Characteristics;
+};
+
+struct PeHeader {
+    UINT8   Magic[4];
+    struct PeFileHeader FileHeader;
+};
+
+struct PeSectionHeader {
+    CHAR8   Name[8];
+    UINT32  VirtualSize;
+    UINT32  VirtualAddress;
+    UINT32  SizeOfRawData;
+    UINT32  PointerToRawData;
+    UINT32  PointerToRelocations;
+    UINT32  PointerToLinenumbers;
+    UINT16  NumberOfRelocations;
+    UINT16  NumberOfLinenumbers;
+    UINT32  Characteristics;
+};
+
+static bool __init pe_name_compare(const struct PeSectionHeader *sect,
+                                   const CHAR16 *name)
+{
+    size_t i;
+
+    if ( sect->Name[0] != '.' )
+        return false;
+
+    for ( i = 1; i < sizeof(sect->Name); i++ )
+    {
+        const char c = sect->Name[i];
+
+        if ( c != name[i - 1] )
+            return false;
+        if ( c == '\0' )
+            return true;
+    }
+
+    return name[i - 1] == L'\0';
+}
+
+const void *__init pe_find_section(const void *image, const UINTN image_size,
+                                   const CHAR16 *section_name, UINTN *size_out)
+{
+    const struct DosFileHeader *dos = image;
+    const struct PeHeader *pe;
+    const struct PeSectionHeader *sect;
+    UINTN offset, i;
+
+    if ( image_size < sizeof(*dos) ||
+         memcmp(dos->Magic, "MZ", 2) != 0 )
+        return NULL;
+
+    offset = dos->ExeHeader;
+    pe = image + offset;
+
+    offset += sizeof(*pe);
+    if ( image_size < offset ||
+         memcmp(pe->Magic, "PE\0\0", 4) != 0 )
+        return NULL;
+
+    if ( pe->FileHeader.Machine != PE_HEADER_MACHINE )
+        return NULL;
+
+    offset += pe->FileHeader.SizeOfOptionalHeader;
+
+    for ( i = 0; i < pe->FileHeader.NumberOfSections; i++ )
+    {
+        sect = image + offset;
+        if ( image_size < offset + sizeof(*sect) )
+            return NULL;
+
+        if ( !pe_name_compare(sect, section_name) )
+        {
+            offset += sizeof(*sect);
+            continue;
+        }
+
+        if ( image_size < sect->VirtualSize + sect->VirtualAddress )
+            blexit(L"PE invalid section size + address");
+
+        if ( size_out )
+            *size_out = sect->VirtualSize;
+
+        return image + sect->VirtualAddress;
+    }
+
+    return NULL;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 09 17:22:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Oct 2020 17:22:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.4983.12800 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6d-0003Ib-VS; Fri, 09 Oct 2020 17:22:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 4983.12800; Fri, 09 Oct 2020 17:22:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kQw6d-0003IS-SP; Fri, 09 Oct 2020 17:22:59 +0000
Received: by outflank-mailman (input) for mailman id 4983;
 Fri, 09 Oct 2020 17:22:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kQw6b-0003IE-Vp
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2dd3b95-ad94-4d2c-bd22-648c6b7fbc8e;
 Fri, 09 Oct 2020 17:22:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6b-0001WV-7s
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kQw6Z-0007eV-Kz
 for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=y7qi=DQ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kQw6b-0003IE-Vp
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:58 +0000
X-Inumbo-ID: a2dd3b95-ad94-4d2c-bd22-648c6b7fbc8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2dd3b95-ad94-4d2c-bd22-648c6b7fbc8e;
	Fri, 09 Oct 2020 17:22:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7KXOBBQKyKHsM+ZdDvgD4Y0O5LTqGKwRlDcd/UpFxQQ=; b=rdejEUL8tx72Vok+fzjQCVAGti
	lQPKvLyPG4i+fU7hHKLqQ1QwPiw71Ca6NWdDROsGaKtaC3yn8KhaIuV2lUDPVAs/1zb7fFdLXngtg
	KJNyGPAdU1sxQ35fCghWeIFPIhNkhjqZemI7LHwpyaPoQwEL2tnRV5EWiddjfGim0Wa8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6b-0001WV-7s
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kQw6Z-0007eV-Kz
	for xen-changelog@lists.xenproject.org; Fri, 09 Oct 2020 17:22:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kQw6Z-0007eV-Kz@xenbits.xenproject.org>
Date: Fri, 09 Oct 2020 17:22:55 +0000

commit 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:30:34 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 4e3861eb7d..59660a8af4 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1625,6 +1625,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5284.13834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yM-0000Us-3v; Sat, 10 Oct 2020 03:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5284.13834; Sat, 10 Oct 2020 03:55:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yM-0000Uk-0g; Sat, 10 Oct 2020 03:55:06 +0000
Received: by outflank-mailman (input) for mailman id 5284;
 Sat, 10 Oct 2020 03:55:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5yK-0000Uf-Kv
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 65d79dfb-9714-4381-8bb5-43b48e9034af;
 Sat, 10 Oct 2020 03:55:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yI-00081C-8B
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yI-00061j-5Q
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5yK-0000Uf-Kv
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:04 +0000
X-Inumbo-ID: 65d79dfb-9714-4381-8bb5-43b48e9034af
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 65d79dfb-9714-4381-8bb5-43b48e9034af;
	Sat, 10 Oct 2020 03:55:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/RMH7DDRIWFntQIBVIakm62cefAUE2OHwJFxTzR3IrU=; b=bcUdkTE/y71Sx1NnrwGcG3WsZB
	smug9jTTkdG+stJIIMNg1W770/gRe11W6bZMp/j1oqzCRja/CYTnl5rHV6ZgsfYTXW+Wdh0l6WRNK
	ZNEYONE2D6y9gxxH5uKndIe1kQXt+awZ7GC5eY9nhb9L2/0Sl+0z9iUBuWVG0SQQtgN4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yI-00081C-8B
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yI-00061j-5Q
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: remove socket-only option from xenstore client
Message-Id: <E1kR5yI-00061j-5Q@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:02 +0000

commit c65687ed16d2289ec91036ec2862a4b4bd34ea4f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:37 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:50 2020 +0000

    tools/xenstore: remove socket-only option from xenstore client
    
    The Xenstore access commands (xenstore-*) have the possibility to limit
    connection to Xenstore to a local socket (option "-s"). This is an
    option making no sense at all, as either there is only a socket, so
    the option would be a nop, or there is no socket at all (in case
    Xenstore is running in a stubdom or the client is called in a domU),
    so specifying the option would just lead to failure.
    
    So drop that option completely.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 docs/man/xenstore-chmod.1.pod    | 4 ----
 docs/man/xenstore-ls.1.pod       | 4 ----
 docs/man/xenstore-read.1.pod     | 4 ----
 docs/man/xenstore-write.1.pod    | 4 ----
 tools/xenstore/xenstore_client.c | 8 ++------
 5 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/docs/man/xenstore-chmod.1.pod b/docs/man/xenstore-chmod.1.pod
index d76f34723d..d221f5dffc 100644
--- a/docs/man/xenstore-chmod.1.pod
+++ b/docs/man/xenstore-chmod.1.pod
@@ -46,10 +46,6 @@ write, and set permissions).
 
 Apply the permissions to the key and all its I<children>.
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-u>
 
 Apply the permissions to the key and all its I<parents>.
diff --git a/docs/man/xenstore-ls.1.pod b/docs/man/xenstore-ls.1.pod
index 8dac931e94..a9f8b32653 100644
--- a/docs/man/xenstore-ls.1.pod
+++ b/docs/man/xenstore-ls.1.pod
@@ -50,10 +50,6 @@ I<and> the permissions for any domain not explicitly listed in
 subsequent entries.  The key owner always has full access (read,
 write, and set permissions).
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =back
 
 =head1 BUGS
diff --git a/docs/man/xenstore-read.1.pod b/docs/man/xenstore-read.1.pod
index f5a7bb7e46..c7768cbbe5 100644
--- a/docs/man/xenstore-read.1.pod
+++ b/docs/man/xenstore-read.1.pod
@@ -16,10 +16,6 @@ Read values of one or more Xenstore I<PATH>s.
 
 Prefix value with key name.
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-R>
 
 Read raw value, skip escaping non-printable characters (\x..).
diff --git a/docs/man/xenstore-write.1.pod b/docs/man/xenstore-write.1.pod
index d1b011236a..a0b1bca333 100644
--- a/docs/man/xenstore-write.1.pod
+++ b/docs/man/xenstore-write.1.pod
@@ -13,10 +13,6 @@ provided to write them at once - in one Xenstore transaction.
 
 =over
 
-=item B<-s>
-
-Connect to the Xenstore daemon using a local socket only.
-
 =item B<-R>
 
 Write raw value, skip parsing escaped characters (\x..).
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index ae7ed3eb9e..8015bfe5be 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -530,7 +530,7 @@ main(int argc, char **argv)
 {
     struct xs_handle *xsh;
     xs_transaction_t xth = XBT_NULL;
-    int ret = 0, socket = 0;
+    int ret = 0;
     int prefix = 0;
     int tidy = 0;
     int upto = 0;
@@ -565,7 +565,6 @@ main(int argc, char **argv)
 	static struct option long_options[] = {
 	    {"help",    0, 0, 'h'},
 	    {"flat",    0, 0, 'f'}, /* MODE_ls */
-	    {"socket",  0, 0, 's'},
 	    {"prefix",  0, 0, 'p'}, /* MODE_read || MODE_list || MODE_ls */
 	    {"tidy",    0, 0, 't'}, /* MODE_rm */
 	    {"upto",    0, 0, 'u'}, /* MODE_chmod */
@@ -593,9 +592,6 @@ main(int argc, char **argv)
 		usage(mode, switch_argv, argv[0]);
 	    }
             break;
-        case 's':
-            socket = 1;
-            break;
 	case 'p':
 	    if ( mode == MODE_read || mode == MODE_list || mode == MODE_ls )
 		prefix = 1;
@@ -675,7 +671,7 @@ main(int argc, char **argv)
 	    max_width = ws.ws_col - 2;
     }
 
-    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
+    xsh = xs_open(0);
     if (xsh == NULL) err(1, "xs_open");
 
 again:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5285.13839 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yU-0000Vl-74; Sat, 10 Oct 2020 03:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5285.13839; Sat, 10 Oct 2020 03:55:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yU-0000Vd-47; Sat, 10 Oct 2020 03:55:14 +0000
Received: by outflank-mailman (input) for mailman id 5285;
 Sat, 10 Oct 2020 03:55:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5yT-0000VX-Bq
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 95bfd34c-a1b7-4d63-bf59-4e065b1a7089;
 Sat, 10 Oct 2020 03:55:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yS-00081g-Bs
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yS-00062X-AY
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5yT-0000VX-Bq
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:13 +0000
X-Inumbo-ID: 95bfd34c-a1b7-4d63-bf59-4e065b1a7089
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 95bfd34c-a1b7-4d63-bf59-4e065b1a7089;
	Sat, 10 Oct 2020 03:55:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GNCoE8+flmJ63BdT06mTXpl22j3rZF3vreNN60pMPgY=; b=SbSMwLxAzOkNazEUesfo2ThOH/
	Dyi7tf1MMyq1qYGnXqTRrBhiBcU3jFr+KDyz6XmOP7JYaAZ6V8gVolYngR45WKzDfy5xdHs4O3YQv
	/9TG0feBgKDTX5df/H0WD7CZ1dBuaPnQJo6ftfunR9a/fprTMb/w+DiGb4fkKDi3HirE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yS-00081g-Bs
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yS-00062X-AY
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/store: ignore XS_OPEN_SOCKETONLY flag
Message-Id: <E1kR5yS-00062X-AY@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:12 +0000

commit fa06cb8c38832aafe597d719040ba1d216e367b8
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:38 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:54 2020 +0000

    tools/libs/store: ignore XS_OPEN_SOCKETONLY flag
    
    When opening the connection to Xenstore via xs_open() it makes no
    sense to limit the connection to the socket based one. So just ignore
    the XS_OPEN_SOCKETONLY flag.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 2 --
 tools/libs/store/xs.c               | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index 25b31881c8..cbc7206a0f 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -66,8 +66,6 @@ typedef uint32_t xs_transaction_t;
  * * Connections made with xs_open(0) (which might be shared page or
  *   socket based) are only guaranteed to work in the parent after
  *   fork.
- * * Connections made with xs_open(XS_OPEN_SOCKETONLY) will be usable
- *   in either the parent or the child after fork, but not both.
  * * xs_daemon_open*() and xs_domain_open() are deprecated synonyms
  *   for xs_open(0).
  * * XS_OPEN_READONLY has no bearing on any of this.
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index aa1d24b8b9..320734416f 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -319,7 +319,7 @@ struct xs_handle *xs_open(unsigned long flags)
 	else
 		xsh = get_handle(xs_daemon_socket());
 
-	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
+	if (!xsh)
 		xsh = get_handle(xs_domain_dev());
 
 	if (xsh && (flags & XS_UNWATCH_FILTER))
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5286.13843 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yf-0000Y4-8i; Sat, 10 Oct 2020 03:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5286.13843; Sat, 10 Oct 2020 03:55:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yf-0000Xv-5k; Sat, 10 Oct 2020 03:55:25 +0000
Received: by outflank-mailman (input) for mailman id 5286;
 Sat, 10 Oct 2020 03:55:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5ye-0000Xl-1E
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e5049155-f73f-4bb8-a14a-5862d07c480a;
 Sat, 10 Oct 2020 03:55:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yc-00081m-GY
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yc-00063J-E4
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5ye-0000Xl-1E
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:24 +0000
X-Inumbo-ID: e5049155-f73f-4bb8-a14a-5862d07c480a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e5049155-f73f-4bb8-a14a-5862d07c480a;
	Sat, 10 Oct 2020 03:55:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fiQ4H3pFO28qSamEr4XY+YMW3bzLoupYv1wNra11S8c=; b=VcAiPs+SA5DZobfJWzByIeFCQw
	LEVb5sivBGv9tRcCkfiG7xfn6UC6JHnG8vZFn3OLMm6NH36OqJRi0AK+24ZYAKXKciEjCtDavLeD6
	KMyBdaeiFh/m21z8C96MitdobKFOwytpOVfLBLIp+twQtb/PfikpMXKWzvtRVmcGM0DU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yc-00081m-GY
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yc-00063J-E4
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/store: drop read-only functionality
Message-Id: <E1kR5yc-00063J-E4@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:22 +0000

commit 5144222bcd4b6653c15ce699780322dca5c02ea3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:39 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:57 2020 +0000

    tools/libs/store: drop read-only functionality
    
    Today it is possible to open the connection in read-only mode via
    xs_daemon_open_readonly(). This is working only with Xenstore running
    as a daemon in the same domain as the user. Additionally it doesn't
    add any security as accessing the socket used for that functionality
    requires the same privileges as the socket used for full Xenstore
    access.
    
    So just drop the read-only semantics in all cases, leaving the
    interface existing only for compatibility reasons. This in turn
    requires to just ignore the XS_OPEN_READONLY flag.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 8 --------
 tools/libs/store/xs.c               | 7 ++-----
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index cbc7206a0f..158e69ef83 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -60,15 +60,12 @@ typedef uint32_t xs_transaction_t;
 /* Open a connection to the xs daemon.
  * Attempts to make a connection over the socket interface,
  * and if it fails, then over the  xenbus interface.
- * Mode 0 specifies read-write access, XS_OPEN_READONLY for
- * read-only access.
  *
  * * Connections made with xs_open(0) (which might be shared page or
  *   socket based) are only guaranteed to work in the parent after
  *   fork.
  * * xs_daemon_open*() and xs_domain_open() are deprecated synonyms
  *   for xs_open(0).
- * * XS_OPEN_READONLY has no bearing on any of this.
  *
  * Returns a handle or NULL.
  */
@@ -83,11 +80,6 @@ void xs_close(struct xs_handle *xsh /* NULL ok */);
  */
 struct xs_handle *xs_daemon_open(void);
 struct xs_handle *xs_domain_open(void);
-
-/* Connect to the xs daemon (readonly for non-root clients).
- * Returns a handle or NULL.
- * Deprecated, please use xs_open(XS_OPEN_READONLY) instead
- */
 struct xs_handle *xs_daemon_open_readonly(void);
 
 /* Close the connection to the xs daemon.
diff --git a/tools/libs/store/xs.c b/tools/libs/store/xs.c
index 320734416f..4ac73ec317 100644
--- a/tools/libs/store/xs.c
+++ b/tools/libs/store/xs.c
@@ -302,7 +302,7 @@ struct xs_handle *xs_daemon_open(void)
 
 struct xs_handle *xs_daemon_open_readonly(void)
 {
-	return xs_open(XS_OPEN_READONLY);
+	return xs_open(0);
 }
 
 struct xs_handle *xs_domain_open(void)
@@ -314,10 +314,7 @@ struct xs_handle *xs_open(unsigned long flags)
 {
 	struct xs_handle *xsh = NULL;
 
-	if (flags & XS_OPEN_READONLY)
-		xsh = get_handle(xs_daemon_socket_ro());
-	else
-		xsh = get_handle(xs_daemon_socket());
+	xsh = get_handle(xs_daemon_socket());
 
 	if (!xsh)
 		xsh = get_handle(xs_domain_dev());
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5290.13847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yp-0000ZZ-AW; Sat, 10 Oct 2020 03:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5290.13847; Sat, 10 Oct 2020 03:55:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5yp-0000ZR-7Q; Sat, 10 Oct 2020 03:55:35 +0000
Received: by outflank-mailman (input) for mailman id 5290;
 Sat, 10 Oct 2020 03:55:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5yn-0000Xl-Uf
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a9aa68d9-bee7-43c7-b5da-7ac1532f0ba5;
 Sat, 10 Oct 2020 03:55:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5ym-000823-Jv
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5ym-00064A-J1
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5yn-0000Xl-Uf
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:33 +0000
X-Inumbo-ID: a9aa68d9-bee7-43c7-b5da-7ac1532f0ba5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a9aa68d9-bee7-43c7-b5da-7ac1532f0ba5;
	Sat, 10 Oct 2020 03:55:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sHgR/TSRm0Iu+NuL5cHjlqOuInSwglUQvHSrw7hepuU=; b=cydBkY0GFj/vufIeiM6FyOLd+g
	Um3VLyLP3TRfDv+fly8M6w+BJjUJ9u4omisf1NUp4fWPLrf9THRKn6e+9+bpTdRiOfizaVZNcgZGx
	e8zVEtPN77EiMZG6fes+dBkMEVncJg2sHBHiHtquUtzBkdg0V1zB5DyljKOzQm1kwrAw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5ym-000823-Jv
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5ym-00064A-J1
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: drop all deprecated usages of xs_*_open() and friends in tools
Message-Id: <E1kR5ym-00064A-J1@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:32 +0000

commit 90c9f9f4ddd55e11be0506bff10c6237507c6e0d
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:40 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:47:59 2020 +0000

    tools: drop all deprecated usages of xs_*_open() and friends in tools
    
    Switch all usages of xs_daemon_open*() and xs_domain_open() to use
    xs_open() instead. While at it switch xs_daemon_close() users to
    xs_close().
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/console/client/main.c             |  2 +-
 tools/console/daemon/utils.c            |  4 ++--
 tools/libs/light/libxl.c                |  6 ++----
 tools/libs/light/libxl_exec.c           |  6 +++---
 tools/libs/light/libxl_fork.c           |  2 +-
 tools/libs/stat/xenstat.c               |  4 ++--
 tools/libs/vchan/init.c                 | 10 ++++------
 tools/misc/xen-lowmemd.c                |  4 ++--
 tools/python/xen/lowlevel/xs/xs.c       |  6 +++---
 tools/tests/mce-test/tools/xen-mceinj.c |  4 ++--
 tools/xenbackendd/xenbackendd.c         |  4 ++--
 tools/xenpmd/xenpmd.c                   |  6 +++---
 12 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index f92ad3d8cf..088be28dff 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -398,7 +398,7 @@ int main(int argc, char **argv)
 		exit(EINVAL);
 	}
 
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		err(errno, "Could not contact XenStore");
 	}
diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c
index 97d7798b33..f9dd8a60c5 100644
--- a/tools/console/daemon/utils.c
+++ b/tools/console/daemon/utils.c
@@ -104,7 +104,7 @@ void daemonize(const char *pidfile)
 bool xen_setup(void)
 {
 	
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		dolog(LOG_ERR,
 		      "Failed to contact xenstore (%m).  Is it running?");
@@ -131,7 +131,7 @@ bool xen_setup(void)
 
  out:
 	if (xs)
-		xs_daemon_close(xs);
+		xs_close(xs);
 	if (xc)
 		xc_interface_close(xc);
 	return false;
diff --git a/tools/libs/light/libxl.c b/tools/libs/light/libxl.c
index 621acc88f3..d2a87157a2 100644
--- a/tools/libs/light/libxl.c
+++ b/tools/libs/light/libxl.c
@@ -103,9 +103,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version,
         rc = ERROR_FAIL; goto out;
     }
 
-    ctx->xsh = xs_daemon_open();
-    if (!ctx->xsh)
-        ctx->xsh = xs_domain_open();
+    ctx->xsh = xs_open(0);
     if (!ctx->xsh) {
         LOGEV(ERROR, errno, "cannot connect to xenstore");
         rc = ERROR_FAIL; goto out;
@@ -171,7 +169,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
 
     if (ctx->xch) xc_interface_close(ctx->xch);
     libxl_version_info_dispose(&ctx->version_info);
-    if (ctx->xsh) xs_daemon_close(ctx->xsh);
+    if (ctx->xsh) xs_close(ctx->xsh);
     if (ctx->xce) xenevtchn_close(ctx->xce);
 
     libxl__poller_put(ctx, ctx->poller_app);
diff --git a/tools/libs/light/libxl_exec.c b/tools/libs/light/libxl_exec.c
index 47c9c8f1ba..a8b949b193 100644
--- a/tools/libs/light/libxl_exec.c
+++ b/tools/libs/light/libxl_exec.c
@@ -178,7 +178,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
     unsigned int num;
     char **l = NULL;
 
-    xsh = xs_daemon_open();
+    xsh = xs_open(0);
     if (xsh == NULL) {
         LOG(ERROR, "Unable to open xenstore connection");
         goto err;
@@ -206,7 +206,7 @@ int libxl__xenstore_child_wait_deprecated(libxl__gc *gc,
 
         free(p);
         xs_unwatch(xsh, path, path);
-        xs_daemon_close(xsh);
+        xs_close(xsh);
         return rc;
 again:
         free(p);
@@ -226,7 +226,7 @@ again:
     LOG(ERROR, "%s not ready", what);
 
     xs_unwatch(xsh, path, path);
-    xs_daemon_close(xsh);
+    xs_close(xsh);
 err:
     return -1;
 }
diff --git a/tools/libs/light/libxl_fork.c b/tools/libs/light/libxl_fork.c
index 9a4709b9a4..5d47dceb8a 100644
--- a/tools/libs/light/libxl_fork.c
+++ b/tools/libs/light/libxl_fork.c
@@ -663,7 +663,7 @@ int libxl__ev_child_xenstore_reopen(libxl__gc *gc, const char *what) {
     int rc;
 
     assert(!CTX->xsh);
-    CTX->xsh = xs_daemon_open();
+    CTX->xsh = xs_open(0);
     if (!CTX->xsh) {
         LOGE(ERROR, "%s: xenstore reopen failed", what);
         rc = ERROR_FAIL;  goto out;
diff --git a/tools/libs/stat/xenstat.c b/tools/libs/stat/xenstat.c
index 6f93d4e982..e49689aa2d 100644
--- a/tools/libs/stat/xenstat.c
+++ b/tools/libs/stat/xenstat.c
@@ -107,7 +107,7 @@ xenstat_handle *xenstat_init(void)
 		return NULL;
 	}
 
-	handle->xshandle = xs_daemon_open_readonly(); /* open handle to xenstore*/
+	handle->xshandle = xs_open(0); /* open handle to xenstore*/
 	if (handle->xshandle == NULL) {
 		perror("unable to open xenstore");
 		xc_interface_close(handle->xc_handle);
@@ -125,7 +125,7 @@ void xenstat_uninit(xenstat_handle * handle)
 		for (i = 0; i < NUM_COLLECTORS; i++)
 			collectors[i].uninit(handle);
 		xc_interface_close(handle->xc_handle);
-		xs_daemon_close(handle->xshandle);
+		xs_close(handle->xshandle);
 		free(handle->priv);
 		free(handle);
 	}
diff --git a/tools/libs/vchan/init.c b/tools/libs/vchan/init.c
index ad4b64fbe3..c8510e6ce9 100644
--- a/tools/libs/vchan/init.c
+++ b/tools/libs/vchan/init.c
@@ -251,7 +251,7 @@ static int init_xs_srv(struct libxenvchan *ctrl, int domain, const char* xs_base
 	char ref[16];
 	char* domid_str = NULL;
 	xs_transaction_t xs_trans = XBT_NULL;
-	xs = xs_domain_open();
+	xs = xs_open(0);
 	if (!xs)
 		goto fail;
 	domid_str = xs_read(xs, 0, "domid", NULL);
@@ -293,7 +293,7 @@ retry_transaction:
 	}
  fail_xs_open:
 	free(domid_str);
-	xs_daemon_close(xs);
+	xs_close(xs);
  fail:
 	return ret;
 }
@@ -408,9 +408,7 @@ struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
 	ctrl->write.order = ctrl->read.order = 0;
 	ctrl->is_server = 0;
 
-	xs = xs_daemon_open();
-	if (!xs)
-		xs = xs_domain_open();
+	xs = xs_open(0);
 	if (!xs)
 		goto fail;
 
@@ -452,7 +450,7 @@ struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
 
  out:
 	if (xs)
-		xs_daemon_close(xs);
+		xs_close(xs);
 	return ctrl;
  fail:
 	libxenvchan_close(ctrl);
diff --git a/tools/misc/xen-lowmemd.c b/tools/misc/xen-lowmemd.c
index 79ad34cb4a..a3a2741242 100644
--- a/tools/misc/xen-lowmemd.c
+++ b/tools/misc/xen-lowmemd.c
@@ -24,7 +24,7 @@ void cleanup(void)
     if (xch)
         xc_interface_close(xch);
     if (xs_handle)
-        xs_daemon_close(xs_handle);
+        xs_close(xs_handle);
 }
 
 /* Never shrink dom0 below 1 GiB */
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
         return 2;
     }
 
-    xs_handle = xs_daemon_open();
+    xs_handle = xs_open(0);
     if (xs_handle == NULL)
     {
         perror("Failed to open xenstore connection");
diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c
index b7d4b6ef5d..0dad7fa5f2 100644
--- a/tools/python/xen/lowlevel/xs/xs.c
+++ b/tools/python/xen/lowlevel/xs/xs.c
@@ -791,7 +791,7 @@ static PyObject *xspy_close(XsHandle *self)
         PySequence_SetItem(self->watches, i, Py_None);
     }
 
-    xs_daemon_close(xh);
+    xs_close(xh);
     self->xh = NULL;
 
     Py_INCREF(Py_None);
@@ -985,7 +985,7 @@ xshandle_init(XsHandle *self, PyObject *args, PyObject *kwds)
                                      &readonly))
         goto fail;
 
-    self->xh = (readonly ? xs_daemon_open_readonly() : xs_daemon_open());
+    self->xh = xs_open(0);
     if (!self->xh)
         goto fail;
 
@@ -999,7 +999,7 @@ xshandle_init(XsHandle *self, PyObject *args, PyObject *kwds)
 static void xshandle_dealloc(XsHandle *self)
 {
     if (self->xh) {
-        xs_daemon_close(self->xh);
+        xs_close(self->xh);
         self->xh = NULL;
     }
 
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index 380e42190c..1187d01e5f 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -411,13 +411,13 @@ static long xs_get_dom_mem(int domid)
     unsigned int plen;
     struct xs_handle *xs;
 
-    xs = xs_daemon_open();
+    xs = xs_open(0);
     if (!xs)
         return -1;
 
     sprintf(path, "/local/domain/%d/memory/target", domid);
     memstr = xs_read(xs, XBT_NULL, path, &plen);
-    xs_daemon_close(xs);
+    xs_close(xs);
 
     if (!memstr || !plen)
         return -1;
diff --git a/tools/xenbackendd/xenbackendd.c b/tools/xenbackendd/xenbackendd.c
index b6d92984e0..21884af772 100644
--- a/tools/xenbackendd/xenbackendd.c
+++ b/tools/xenbackendd/xenbackendd.c
@@ -122,7 +122,7 @@ usage(void)
 static int
 xen_setup(void)
 {
-	xs = xs_daemon_open();
+	xs = xs_open(0);
 	if (xs == NULL) {
 		dolog(LOG_ERR,
 		    "Failed to contact xenstore (%s).  Is it running?",
@@ -138,7 +138,7 @@ xen_setup(void)
 
  out:
 	if (xs) {
-		xs_daemon_close(xs);
+		xs_close(xs);
 		xs = NULL;
 	}
 	return -1;
diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
index 1c801caa71..35fd1c931a 100644
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -502,18 +502,18 @@ int main(int argc, char *argv[])
 #ifndef RUN_STANDALONE
     daemonize();
 #endif
-    xs = (struct xs_handle *)xs_daemon_open();
+    xs = xs_open(0);
     if ( xs == NULL ) 
         return -1;
 
     if ( write_one_time_battery_info() == 0 ) 
     {
-        xs_daemon_close(xs);
+        xs_close(xs);
         return -1;
     }
 
     wait_for_and_update_battery_status_request();
-    xs_daemon_close(xs);
+    xs_close(xs);
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5292.13851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5z1-0000b4-Cw; Sat, 10 Oct 2020 03:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5292.13851; Sat, 10 Oct 2020 03:55:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5z1-0000aw-9I; Sat, 10 Oct 2020 03:55:47 +0000
Received: by outflank-mailman (input) for mailman id 5292;
 Sat, 10 Oct 2020 03:55:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5z0-0000ap-Cz
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 66dd4821-8719-445d-bf1a-761f94d2f90f;
 Sat, 10 Oct 2020 03:55:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yw-00082C-NL
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5yw-000650-MH
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5z0-0000ap-Cz
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:46 +0000
X-Inumbo-ID: 66dd4821-8719-445d-bf1a-761f94d2f90f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 66dd4821-8719-445d-bf1a-761f94d2f90f;
	Sat, 10 Oct 2020 03:55:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1dIQgeUJscj9i9gGAgnjbpIN0HYPjt1dm4pVd88V4iM=; b=FptkB2Fp6UZbddYuRErTANor4C
	vg8rZ7jThT3nwmvksSdLBfJmOMFGcwmDuc57TERkaGOTE6unDIbTxgpyahTAT4jZ62GcG+zKRf3Qe
	eJTzKSoZY8wiQNVc3uL5naj/+kZe4j7ijAJx0IhQPGsPWJ/j/aqLxv8mdLUZhN4enU5A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yw-00082C-NL
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5yw-000650-MH
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstore: drop creation of read-only socket in xenstored
Message-Id: <E1kR5yw-000650-MH@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:42 +0000

commit 1d246c721d44729c2e335e3be9979f5005016319
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 2 17:41:41 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:48:02 2020 +0000

    tools/xenstore: drop creation of read-only socket in xenstored
    
    With xs_daemon_open_readonly() now no longer using the read-only socket
    the creation of that socket can be dropped.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/xenstore/xenstored_core.c   | 55 ++++++++-------------------------------
 tools/xenstore/xenstored_core.h   |  3 ---
 tools/xenstore/xenstored_domain.c |  4 +--
 tools/xenstore/xs_lib.c           |  8 +-----
 4 files changed, 14 insertions(+), 56 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9700772d40..b4be374d3f 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -71,7 +71,6 @@ static unsigned int current_array_size;
 static unsigned int nr_fds;
 
 static int sock = -1;
-static int ro_sock = -1;
 
 static bool verbose = false;
 LIST_HEAD(connections);
@@ -311,8 +310,7 @@ fail:
 	return -1;
 }
 
-static void initialize_fds(int *p_sock_pollfd_idx, int *p_ro_sock_pollfd_idx,
-			   int *ptimeout)
+static void initialize_fds(int *p_sock_pollfd_idx, int *ptimeout)
 {
 	struct connection *conn;
 	struct wrl_timestampt now;
@@ -325,8 +323,6 @@ static void initialize_fds(int *p_sock_pollfd_idx, int *p_ro_sock_pollfd_idx,
 
 	if (sock != -1)
 		*p_sock_pollfd_idx = set_fd(sock, POLLIN|POLLPRI);
-	if (ro_sock != -1)
-		*p_ro_sock_pollfd_idx = set_fd(ro_sock, POLLIN|POLLPRI);
 	if (reopen_log_pipe[0] != -1)
 		reopen_log_pipe0_pollfd_idx =
 			set_fd(reopen_log_pipe[0], POLLIN|POLLPRI);
@@ -472,9 +468,6 @@ static enum xs_perm_type perm_for_conn(struct connection *conn,
 	unsigned int i;
 	enum xs_perm_type mask = XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER;
 
-	if (!conn->can_write)
-		mask &= ~XS_PERM_WRITE;
-
 	/* Owners and tools get it all... */
 	if (!domain_is_unprivileged(conn) || perms[0].id == conn->id
                 || (conn->target && perms[0].id == conn->target->id))
@@ -1422,7 +1415,6 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 	new->pollfd_idx = -1;
 	new->write = write;
 	new->read = read;
-	new->can_write = true;
 	new->transaction_started = 0;
 	INIT_LIST_HEAD(&new->out_list);
 	INIT_LIST_HEAD(&new->watches);
@@ -1435,7 +1427,7 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 }
 
 #ifdef NO_SOCKETS
-static void accept_connection(int sock, bool canwrite)
+static void accept_connection(int sock)
 {
 }
 #else
@@ -1477,7 +1469,7 @@ static int readfd(struct connection *conn, void *data, unsigned int len)
 	return rc;
 }
 
-static void accept_connection(int sock, bool canwrite)
+static void accept_connection(int sock)
 {
 	int fd;
 	struct connection *conn;
@@ -1487,10 +1479,9 @@ static void accept_connection(int sock, bool canwrite)
 		return;
 
 	conn = new_connection(writefd, readfd);
-	if (conn) {
+	if (conn)
 		conn->fd = fd;
-		conn->can_write = canwrite;
-	} else
+	else
 		close(fd);
 }
 #endif
@@ -1794,28 +1785,21 @@ static void destroy_fds(void)
 {
 	if (sock >= 0)
 		close(sock);
-	if (ro_sock >= 0)
-		close(ro_sock);
 }
 
 static void init_sockets(void)
 {
 	struct sockaddr_un addr;
 	const char *soc_str = xs_daemon_socket();
-	const char *soc_str_ro = xs_daemon_socket_ro();
 
 	/* Create sockets for them to listen to. */
 	atexit(destroy_fds);
 	sock = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (sock < 0)
 		barf_perror("Could not create socket");
-	ro_sock = socket(PF_UNIX, SOCK_STREAM, 0);
-	if (ro_sock < 0)
-		barf_perror("Could not create socket");
 
 	/* FIXME: Be more sophisticated, don't mug running daemon. */
 	unlink(soc_str);
-	unlink(soc_str_ro);
 
 	addr.sun_family = AF_UNIX;
 
@@ -1825,17 +1809,10 @@ static void init_sockets(void)
 	if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
 		barf_perror("Could not bind socket to %s", soc_str);
 
-	if(strlen(soc_str_ro) >= sizeof(addr.sun_path))
-		barf_perror("socket string '%s' too long", soc_str_ro);
-	strcpy(addr.sun_path, soc_str_ro);
-	if (bind(ro_sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-		barf_perror("Could not bind socket to %s", soc_str_ro);
-
-	if (chmod(soc_str, 0600) != 0
-	    || chmod(soc_str_ro, 0660) != 0)
+	if (chmod(soc_str, 0600) != 0)
 		barf_perror("Could not chmod sockets");
 
-	if (listen(sock, 1) != 0 || listen(ro_sock, 1) != 0)
+	if (listen(sock, 1) != 0)
 		barf_perror("Could not listen on sockets");
 }
 #endif
@@ -1893,7 +1870,7 @@ int priv_domid = 0;
 int main(int argc, char *argv[])
 {
 	int opt;
-	int sock_pollfd_idx = -1, ro_sock_pollfd_idx = -1;
+	int sock_pollfd_idx = -1;
 	bool dofork = true;
 	bool outputpid = false;
 	bool no_domain_init = false;
@@ -2010,7 +1987,7 @@ int main(int argc, char *argv[])
 		tracefile = talloc_strdup(NULL, tracefile);
 
 	/* Get ready to listen to the tools. */
-	initialize_fds(&sock_pollfd_idx, &ro_sock_pollfd_idx, &timeout);
+	initialize_fds(&sock_pollfd_idx, &timeout);
 
 	/* Tell the kernel we're up and running. */
 	xenbus_notify_running();
@@ -2051,21 +2028,11 @@ int main(int argc, char *argv[])
 				barf_perror("sock poll failed");
 				break;
 			} else if (fds[sock_pollfd_idx].revents & POLLIN) {
-				accept_connection(sock, true);
+				accept_connection(sock);
 				sock_pollfd_idx = -1;
 			}
 		}
 
-		if (ro_sock_pollfd_idx != -1) {
-			if (fds[ro_sock_pollfd_idx].revents & ~POLLIN) {
-				barf_perror("ro sock poll failed");
-				break;
-			} else if (fds[ro_sock_pollfd_idx].revents & POLLIN) {
-				accept_connection(ro_sock, false);
-				ro_sock_pollfd_idx = -1;
-			}
-		}
-
 		if (xce_pollfd_idx != -1) {
 			if (fds[xce_pollfd_idx].revents & ~POLLIN) {
 				barf_perror("xce_handle poll failed");
@@ -2128,7 +2095,7 @@ int main(int argc, char *argv[])
 			}
 		}
 
-		initialize_fds(&sock_pollfd_idx, &ro_sock_pollfd_idx, &timeout);
+		initialize_fds(&sock_pollfd_idx, &timeout);
 	}
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index c4c32bc88f..1df6ad94ab 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -77,9 +77,6 @@ struct connection
 	/* Who am I? 0 for socket connections. */
 	unsigned int id;
 
-	/* Is this a read-only connection? */
-	bool can_write;
-
 	/* Buffered incoming data. */
 	struct buffered_data *in;
 
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index 0d5495745b..a2f144f6dd 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -372,7 +372,7 @@ int do_introduce(struct connection *conn, struct buffered_data *in)
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
 		return EINVAL;
 
-	if (domain_is_unprivileged(conn) || !conn->can_write)
+	if (domain_is_unprivileged(conn))
 		return EACCES;
 
 	domid = atoi(vec[0]);
@@ -438,7 +438,7 @@ int do_set_target(struct connection *conn, struct buffered_data *in)
 	if (get_strings(in, vec, ARRAY_SIZE(vec)) < ARRAY_SIZE(vec))
 		return EINVAL;
 
-	if (domain_is_unprivileged(conn) || !conn->can_write)
+	if (domain_is_unprivileged(conn))
 		return EACCES;
 
 	domid = atoi(vec[0]);
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index 3e43f8809d..9f1dc6d559 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -63,13 +63,7 @@ const char *xs_daemon_socket(void)
 
 const char *xs_daemon_socket_ro(void)
 {
-	static char buf[PATH_MAX];
-	const char *s = xs_daemon_path();
-	if (s == NULL)
-		return NULL;
-	if (snprintf(buf, sizeof(buf), "%s_ro", s) >= PATH_MAX)
-		return NULL;
-	return buf;
+	return xs_daemon_path();
 }
 
 const char *xs_domain_dev(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:55:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5294.13854 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5z9-0000cT-FB; Sat, 10 Oct 2020 03:55:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5294.13854; Sat, 10 Oct 2020 03:55:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5z9-0000cM-CE; Sat, 10 Oct 2020 03:55:55 +0000
Received: by outflank-mailman (input) for mailman id 5294;
 Sat, 10 Oct 2020 03:55:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5z7-0000cD-Si
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eaae8d7f-f9fc-4892-9aba-3cacf780de67;
 Sat, 10 Oct 2020 03:55:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5z6-00082N-QT
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5z6-00065t-PY
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5z7-0000cD-Si
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:53 +0000
X-Inumbo-ID: eaae8d7f-f9fc-4892-9aba-3cacf780de67
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eaae8d7f-f9fc-4892-9aba-3cacf780de67;
	Sat, 10 Oct 2020 03:55:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rqksIsmBZrU6YhHFZpPisEjaU3PHegAu+ocYuFxjrO0=; b=TFiN/6pY6KzJxpRmmqUy4HaRMx
	Q4zclv+QpXvi4bhuk8n+Pp8mVf4l74Akh9B0E4IFcjknJ/4j9NbrrqeBDzjuPyVAG7pWwi6tIb3A/
	NLwLpGoVEKpbAd5eypCcELbKkGT9XcLdy/9iMxlL44asTgdwRFPSnQAcdzMcu0+igAuY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5z6-00082N-QT
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5z6-00065t-PY
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:55:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/ocaml/xenstored: drop the creation of the RO socket
Message-Id: <E1kR5z6-00065t-PY@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:55:52 +0000

commit a06d3feea3b7e8b6a83b39221a2f289e89157cbc
Author:     Edwin Török <edvin.torok@citrix.com>
AuthorDate: Fri Oct 2 17:06:32 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:54:00 2020 +0000

    tools/ocaml/xenstored: drop the creation of the RO socket
    
    The readonly flag was propagated but ignored, so this was essentially
    equivalent to a RW socket.
    
    C xenstored is dropping the RO socket too, so drop it from oxenstored too.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/ocaml/xenstored/connections.ml |  2 +-
 tools/ocaml/xenstored/define.ml      |  1 -
 tools/ocaml/xenstored/xenstored.ml   | 15 ++++++---------
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/tools/ocaml/xenstored/connections.ml b/tools/ocaml/xenstored/connections.ml
index f02ef6b526..f2c4318c88 100644
--- a/tools/ocaml/xenstored/connections.ml
+++ b/tools/ocaml/xenstored/connections.ml
@@ -31,7 +31,7 @@ let create () = {
 	watches = Trie.create ()
 }
 
-let add_anonymous cons fd _can_write =
+let add_anonymous cons fd =
 	let xbcon = Xenbus.Xb.open_fd fd in
 	let con = Connection.create xbcon None in
 	Hashtbl.add cons.anonymous (Xenbus.Xb.get_fd xbcon) con
diff --git a/tools/ocaml/xenstored/define.ml b/tools/ocaml/xenstored/define.ml
index 2965c08534..ea9e1b7620 100644
--- a/tools/ocaml/xenstored/define.ml
+++ b/tools/ocaml/xenstored/define.ml
@@ -18,7 +18,6 @@ let xenstored_major = 1
 let xenstored_minor = 0
 
 let xs_daemon_socket = Paths.xen_run_stored ^ "/socket"
-let xs_daemon_socket_ro = Paths.xen_run_stored ^ "/socket_ro"
 
 let default_config_dir = Paths.xen_config_dir
 
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 5b96f1852a..7e7824761b 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -242,12 +242,11 @@ let _ =
 		()
 	);
 
-	let rw_sock, ro_sock =
+	let rw_sock =
 		if cf.disable_socket then
-			None, None
+			None
 		else
-			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket),
-			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket_ro)
+			Some (Unix.handle_unix_error Utils.create_unix_socket Define.xs_daemon_socket)
 		in
 
 	if cf.daemonize then
@@ -320,15 +319,14 @@ let _ =
 
 	let spec_fds =
 		(match rw_sock with None -> [] | Some x -> [ x ]) @
-		(match ro_sock with None -> [] | Some x -> [ x ]) @
 		(if cf.domain_init then [ Event.fd eventchn ] else [])
 		in
 
 	let process_special_fds rset =
-		let accept_connection can_write fd =
+		let accept_connection fd =
 			let (cfd, _addr) = Unix.accept fd in
 			debug "new connection through socket";
-			Connections.add_anonymous cons cfd can_write
+			Connections.add_anonymous cons cfd
 		and handle_eventchn _fd =
 			let port = Event.pending eventchn in
 			debug "pending port %d" (Xeneventchn.to_int port);
@@ -348,8 +346,7 @@ let _ =
 			if List.mem fd set then
 				fct fd in
 
-		maybe (fun fd -> do_if_set fd rset (accept_connection true)) rw_sock;
-		maybe (fun fd -> do_if_set fd rset (accept_connection false)) ro_sock;
+		maybe (fun fd -> do_if_set fd rset accept_connection) rw_sock;
 		do_if_set (Event.fd eventchn) rset (handle_eventchn)
 	in
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:56:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5295.13859 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5zJ-0000dt-HC; Sat, 10 Oct 2020 03:56:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5295.13859; Sat, 10 Oct 2020 03:56:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5zJ-0000dl-Dt; Sat, 10 Oct 2020 03:56:05 +0000
Received: by outflank-mailman (input) for mailman id 5295;
 Sat, 10 Oct 2020 03:56:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5zH-0000dW-La
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6ae2ecb0-9449-462d-98c7-2a34de73f72b;
 Sat, 10 Oct 2020 03:56:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5zG-00082m-To
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5zG-00066p-Sd
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5zH-0000dW-La
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:03 +0000
X-Inumbo-ID: 6ae2ecb0-9449-462d-98c7-2a34de73f72b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6ae2ecb0-9449-462d-98c7-2a34de73f72b;
	Sat, 10 Oct 2020 03:56:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/5xQ8xlaZ6TP8T13Vb0v9/oYYWKHc/CO4qGC4D+L+/k=; b=Ykj++odNjGZj9yZwAiJL1Md5Lr
	Ew0tHeTMk3wiE4TuXeLKzyVctpmgp1q+r9zccAXd/TlNmcaCy+Np4hHOMlmngO5Nx8W53YE2HaYIM
	w3TxqhdZUTM1MAUfEJarPKvC9ae55s9EpvThAIsAHp/u05A/3OwFG8Ed7UiGJUcwX5kM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5zG-00082m-To
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5zG-00066p-Sd
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tool/libs/light: Fix libxenlight gcc warning
Message-Id: <E1kR5zG-00066p-Sd@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:56:02 +0000

commit 0241809bf838875615797f52af34222e5ab8e98f
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 14:57:02 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Thu Oct 8 12:56:03 2020 +0000

    tool/libs/light: Fix libxenlight gcc warning
    
    Fix gcc10 compilation warning about uninitialized variable by setting
    it to 0.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_mem.c b/tools/libs/light/libxl_mem.c
index e52a9624ea..c739d00f39 100644
--- a/tools/libs/light/libxl_mem.c
+++ b/tools/libs/light/libxl_mem.c
@@ -562,7 +562,7 @@ out:
 
 int libxl_get_free_memory_0x040700(libxl_ctx *ctx, uint32_t *memkb)
 {
-    uint64_t my_memkb;
+    uint64_t my_memkb = 0;
     int rc;
 
     rc = libxl_get_free_memory(ctx, &my_memkb);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 10 03:56:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Oct 2020 03:56:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5299.13863 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5zT-0000fQ-IT; Sat, 10 Oct 2020 03:56:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5299.13863; Sat, 10 Oct 2020 03:56:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kR5zT-0000fI-FQ; Sat, 10 Oct 2020 03:56:15 +0000
Received: by outflank-mailman (input) for mailman id 5299;
 Sat, 10 Oct 2020 03:56:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kR5zR-0000f7-TU
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id faea2146-26a6-46a1-80a3-9e68ce99f602;
 Sat, 10 Oct 2020 03:56:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5zR-00083b-1G
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kR5zQ-00067h-Vr
 for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=DXby=DR=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kR5zR-0000f7-TU
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:13 +0000
X-Inumbo-ID: faea2146-26a6-46a1-80a3-9e68ce99f602
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id faea2146-26a6-46a1-80a3-9e68ce99f602;
	Sat, 10 Oct 2020 03:56:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o3c8DTG/QXJQ1i2wtr3mTqOvAh2Ru+eIngvFRY2skXE=; b=LUwasfE6nE5iTPL+UQDZpH6i/o
	pXwOnF/phrYobWa/mnI0nxDaqynw3IjJpMlEPJDIM4kQH97MVKRhd6MOhbJ4reIJmQRdchfHBTP4x
	OzzHv/18oyYOT70ofF0Ma7tMu7tJUAQHbmoea6gcMIxoV3tmJteT2ajRzRQripi2vQAs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5zR-00083b-1G
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kR5zQ-00067h-Vr
	for xen-changelog@lists.xenproject.org; Sat, 10 Oct 2020 03:56:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/rpi4: implement watchdog-based reset
Message-Id: <E1kR5zQ-00067h-Vr@xenbits.xenproject.org>
Date: Sat, 10 Oct 2020 03:56:12 +0000

commit 25849c8b16f2a5b7fcd0a823e80a5f1b590291f9
Author:     Stefano Stabellini <sstabellini@kernel.org>
AuthorDate: Fri Oct 2 13:47:17 2020 -0700
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Thu Oct 8 18:16:20 2020 -0700

    xen/rpi4: implement watchdog-based reset
    
    The preferred method to reboot RPi4 is PSCI. If it is not available,
    touching the watchdog is required to be able to reboot the board.
    
    The implementation is based on
    drivers/watchdog/bcm2835_wdt.c:__bcm2835_restart in Linux v5.9-rc7.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Tested-by: Roman Shaposhnik <roman@zededa.com>
    CC: roman@zededa.com
---
 xen/arch/arm/platforms/brcm-raspberry-pi.c | 61 ++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c
index f5ae58a7d5..811b40b1a6 100644
--- a/xen/arch/arm/platforms/brcm-raspberry-pi.c
+++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c
@@ -17,6 +17,10 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/delay.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <asm/io.h>
 #include <asm/platform.h>
 
 static const char *const rpi4_dt_compat[] __initconst =
@@ -37,12 +41,69 @@ static const struct dt_device_match rpi4_blacklist_dev[] __initconst =
      * The aux peripheral also shares a page with the aux UART.
      */
     DT_MATCH_COMPATIBLE("brcm,bcm2835-aux"),
+    /* Special device used for rebooting */
+    DT_MATCH_COMPATIBLE("brcm,bcm2835-pm"),
     { /* sentinel */ },
 };
 
+
+#define PM_PASSWORD                 0x5a000000
+#define PM_RSTC                     0x1c
+#define PM_WDOG                     0x24
+#define PM_RSTC_WRCFG_FULL_RESET    0x00000020
+#define PM_RSTC_WRCFG_CLR           0xffffffcf
+
+static void __iomem *rpi4_map_watchdog(void)
+{
+    void __iomem *base;
+    struct dt_device_node *node;
+    paddr_t start, len;
+    int ret;
+
+    node = dt_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm");
+    if ( !node )
+        return NULL;
+
+    ret = dt_device_get_address(node, 0, &start, &len);
+    if ( ret )
+    {
+        printk("Cannot read watchdog register address\n");
+        return NULL;
+    }
+
+    base = ioremap_nocache(start & PAGE_MASK, PAGE_SIZE);
+    if ( !base )
+    {
+        printk("Unable to map watchdog register!\n");
+        return NULL;
+    }
+
+    return base;
+}
+
+static void rpi4_reset(void)
+{
+    uint32_t val;
+    void __iomem *base = rpi4_map_watchdog();
+
+    if ( !base )
+        return;
+
+    /* use a timeout of 10 ticks (~150us) */
+    writel(10 | PM_PASSWORD, base + PM_WDOG);
+    val = readl(base + PM_RSTC);
+    val &= PM_RSTC_WRCFG_CLR;
+    val |= PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
+    writel(val, base + PM_RSTC);
+
+    /* No sleeping, possibly atomic. */
+    mdelay(1);
+}
+
 PLATFORM_START(rpi4, "Raspberry Pi 4")
     .compatible     = rpi4_dt_compat,
     .blacklist_dev  = rpi4_blacklist_dev,
+    .reset = rpi4_reset,
     .dma_bitsize    = 30,
 PLATFORM_END
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 11 21:00:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2020 21:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5729.14853 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kRiRr-0004oc-IS; Sun, 11 Oct 2020 21:00:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5729.14853; Sun, 11 Oct 2020 21:00:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kRiRr-0004oU-FH; Sun, 11 Oct 2020 21:00:07 +0000
Received: by outflank-mailman (input) for mailman id 5729;
 Sun, 11 Oct 2020 21:00:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YEa6=DS=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kRiRr-0004oP-4I
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7d99bf4e-47c2-4749-bd80-772719eabbee;
 Sun, 11 Oct 2020 21:00:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kRiRp-0004Iu-K9
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kRiRp-0001Ct-JB
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YEa6=DS=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kRiRr-0004oP-4I
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:07 +0000
X-Inumbo-ID: 7d99bf4e-47c2-4749-bd80-772719eabbee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7d99bf4e-47c2-4749-bd80-772719eabbee;
	Sun, 11 Oct 2020 21:00:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rNAdtijidZ+B1JAKNfxZzkimDeNTSJkBS0LOutiQUKA=; b=mfbZKjUDPCLOBSSIxI0LxSVMbM
	CB1BZ09TCeEiwrPqPOgY7sObUIYoWTi3C10lB45gtFc2cXlRPcAkXkg9TA93W4bmI0E0ZBTJIN20s
	uluZFKQQ42nSBGyKWq2jozsdx6PalakTJQE6zteR46IZBv2pOXQRo9pDsGcy6fpHZMow=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kRiRp-0004Iu-K9
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kRiRp-0001Ct-JB
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: only query VNC when enabled
Message-Id: <E1kRiRp-0001Ct-JB@xenbits.xenproject.org>
Date: Sun, 11 Oct 2020 21:00:05 +0000

commit 1b810a9d5a39230e76073b1a753cd2c34ded65fc
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Thu Oct 1 19:53:37 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Sun Oct 11 20:59:16 2020 +0000

    libxl: only query VNC when enabled
    
    QEMU without VNC support (configure --disable-vnc) will return an error
    when VNC is queried over QMP since it does not recognize the QMP
    command.  This will cause libxl to fail starting the domain even if VNC
    is not enabled.  Therefore only query QEMU for VNC support when using
    VNC, so a VNC-less QEMU will function in this configuration.
    
    'goto out' jumps to the call to device_model_postconfig_done(), the
    final callback after the chain of vnc queries.  This bypasses all the
    QMP VNC queries.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_dm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index a944181781..d1ff35dda3 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -3140,6 +3140,7 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
 {
     EGC_GC;
     libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
+    const libxl_vnc_info *vnc = libxl__dm_vnc(dmss->guest_config);
     const libxl__json_object *item = NULL;
     const libxl__json_object *o = NULL;
     int i = 0;
@@ -3197,6 +3198,9 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
         if (rc) goto out;
     }
 
+    if (!vnc)
+        goto out;
+
     qmp->callback = device_model_postconfig_vnc;
     rc = libxl__ev_qmp_send(egc, qmp, "query-vnc", NULL);
     if (rc) goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sun Oct 11 21:00:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Oct 2020 21:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.5730.14857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kRiS6-0004py-KC; Sun, 11 Oct 2020 21:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 5730.14857; Sun, 11 Oct 2020 21:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kRiS6-0004pr-HA; Sun, 11 Oct 2020 21:00:22 +0000
Received: by outflank-mailman (input) for mailman id 5730;
 Sun, 11 Oct 2020 21:00:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YEa6=DS=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kRiS6-0004pi-4K
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5aa2d014-a31a-4756-a698-141e9ff8cce5;
 Sun, 11 Oct 2020 21:00:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kRiRz-0004JO-O4
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kRiRz-0001E3-MM
 for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YEa6=DS=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kRiS6-0004pi-4K
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:22 +0000
X-Inumbo-ID: 5aa2d014-a31a-4756-a698-141e9ff8cce5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5aa2d014-a31a-4756-a698-141e9ff8cce5;
	Sun, 11 Oct 2020 21:00:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xirMYUgixCP6MgAGMC42bFF8XexuaA6b9urM/05d6eQ=; b=SdOSsrL1D4U4D8JXmCr3UGOZot
	Q6V7ks/L8HahcKNAFuFkpO6hAIIhoZtrxmGRx/M3VcPE44VtbzmNaE3Dom1jmLyLkrzpWcJsN5IwJ
	drx1A95jieqTwutnjNTkqsGE8V+3lg/PnybW2ovm3e8/7Jh1CYWnPcBEZBh95xQ7/W9E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kRiRz-0004JO-O4
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kRiRz-0001E3-MM
	for xen-changelog@lists.xenproject.org; Sun, 11 Oct 2020 21:00:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/store: add disclaimer to header file regarding ignored options
Message-Id: <E1kRiRz-0001E3-MM@xenbits.xenproject.org>
Date: Sun, 11 Oct 2020 21:00:15 +0000

commit 534b3d09958fdc4df64872c2ab19feb4b1eebc5a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 11 14:24:01 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Sun Oct 11 20:59:51 2020 +0000

    tools/libs/store: add disclaimer to header file regarding ignored options
    
    Add a disclaimer to the libxenstore header file that all of the open
    flags (socket only connection, read only connection) are ignored.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index 158e69ef83..2b3f69fb61 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -23,6 +23,7 @@
 
 #define XBT_NULL 0
 
+/* Following open flags are deprecated and ignored! */
 #define XS_OPEN_READONLY	(1UL<<0)
 #define XS_OPEN_SOCKETONLY      (1UL<<1)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 13 13:44:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Oct 2020 13:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6210.16490 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSKb2-00057l-IH; Tue, 13 Oct 2020 13:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6210.16490; Tue, 13 Oct 2020 13:44:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSKb2-00057d-F4; Tue, 13 Oct 2020 13:44:08 +0000
Received: by outflank-mailman (input) for mailman id 6210;
 Tue, 13 Oct 2020 13:44:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSKb1-00057W-Ln
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b0fcaa27-34fa-4100-b5c0-231bce6ec91a;
 Tue, 13 Oct 2020 13:44:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSKaz-00065c-Ka
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSKaz-0000wL-HO
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSKb1-00057W-Ln
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:07 +0000
X-Inumbo-ID: b0fcaa27-34fa-4100-b5c0-231bce6ec91a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b0fcaa27-34fa-4100-b5c0-231bce6ec91a;
	Tue, 13 Oct 2020 13:44:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WnZeygxu2j0/wA48YxkVIv5lF5K8O42VhHP+UwQhirg=; b=G/4I7lQPtgjx//saluFpIK2L2h
	OMCPHJnFWpAXv+zH62THjy8VTe9rjemTwgZGlhxax4/RuvcjVlk+DVhUotkw0TQnnZz71iSMIj3ty
	a2aVNSbQ/cMfBCNYA4hd5q+J1DeaSq46yhWm0m5zLvG+o43cSQZ9+lYpL0SVKFTS+4kk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSKaz-00065c-Ka
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSKaz-0000wL-HO
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] golang/xenlight: do not hard code libxl dir in gengotypes.py
Message-Id: <E1kSKaz-0000wL-HO@xenbits.xenproject.org>
Date: Tue, 13 Oct 2020 13:44:05 +0000

commit c60f9e4360ec857bb0164387378e12ae8e66e189
Author:     Nick Rosbrook <rosbrookn@gmail.com>
AuthorDate: Sun Oct 11 19:31:24 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 13:30:53 2020 +0000

    golang/xenlight: do not hard code libxl dir in gengotypes.py
    
    Currently, in order to 'import idl' in gengotypes.py, we derive the path
    of the libxl source directory from the XEN_ROOT environment variable, and
    append that to sys.path so python can see idl.py. Since the the recent move of
    libxl to tools/libs/light, this hard coding breaks the build.
    
    Instead, check for the environment variable LIBXL_SRC_DIR, but move this
    check to a try-except block (with empty except). This simply makes the
    real error more visible, and does not strictly require that
    LIBXL_SRC_DIR is used. Finally, update the Makefile to set LIBXL_SRC_DIR
    rather than XEN_ROOT when calling gengotypes.py.
    
    Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/golang/xenlight/Makefile      | 2 +-
 tools/golang/xenlight/gengotypes.py | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index fd8e4893db..e394ef9b2b 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -16,7 +16,7 @@ all: build
 GOXL_GEN_FILES = types.gen.go helpers.gen.go
 
 %.gen.go: gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl $(LIBXL_SRC_DIR)/idl.py
-	XEN_ROOT=$(XEN_ROOT) $(PYTHON) gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl
+	LIBXL_SRC_DIR=$(LIBXL_SRC_DIR) $(PYTHON) gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl
 
 # Go will do its own dependency checking, and not actuall go through
 # with the build if none of the input files have changed.
diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
index ebec938224..4ac181ae47 100644
--- a/tools/golang/xenlight/gengotypes.py
+++ b/tools/golang/xenlight/gengotypes.py
@@ -3,7 +3,14 @@
 import os
 import sys
 
-sys.path.append('{0}/tools/libxl'.format(os.environ['XEN_ROOT']))
+try:
+    sys.path.append(os.environ['LIBXL_SRC_DIR'])
+except:
+    # If we get here, then we expect the 'import idl'
+    # expression to fail. That error is more informative,
+    # so let it happen.
+    pass
+
 import idl
 
 # Go versions of some builtin types.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 13 13:44:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Oct 2020 13:44:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6211.16494 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSKbB-00058P-Jh; Tue, 13 Oct 2020 13:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6211.16494; Tue, 13 Oct 2020 13:44:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSKbB-00058H-Gf; Tue, 13 Oct 2020 13:44:17 +0000
Received: by outflank-mailman (input) for mailman id 6211;
 Tue, 13 Oct 2020 13:44:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSKbA-000589-O9
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7b057c89-5584-43db-b7e4-efc5613febe8;
 Tue, 13 Oct 2020 13:44:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSKb9-00065i-O1
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSKb9-0000xT-N8
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSKbA-000589-O9
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:16 +0000
X-Inumbo-ID: 7b057c89-5584-43db-b7e4-efc5613febe8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7b057c89-5584-43db-b7e4-efc5613febe8;
	Tue, 13 Oct 2020 13:44:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=net0SaLyAxOvmFTPnIkuFkDrhFjEViNMpF+GXpNvNEM=; b=Qe81shgLWBb6I4JBCdH/qwrZMa
	X9k+dz2IsrLEEORK8v9ALxSmqTKZB1gcLTfsUyG3Wo4gkL/HK7maRvWfMx21/PJE1s8zq372IVeYc
	MMdIihpq3UIAkXb69+w1or+9nTtNhx8g0XfpTOG/TCpszgr8p7UnlMSdTvET+q3HDVnw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSKb9-00065i-O1
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSKb9-0000xT-N8
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 13:44:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] golang/xenlight: standardize generated code comment
Message-Id: <E1kSKb9-0000xT-N8@xenbits.xenproject.org>
Date: Tue, 13 Oct 2020 13:44:15 +0000

commit a95f31376ba4ae911536c647e1a583d144ccab73
Author:     Nick Rosbrook <rosbrookn@gmail.com>
AuthorDate: Sun Oct 11 19:31:25 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 13:31:06 2020 +0000

    golang/xenlight: standardize generated code comment
    
    There is a standard format for generated Go code header comments, as set
    by [1]. Modify gengotypes.py to follow this standard, and use the
    additional
    
      // source: <IDL file basename>
    
    convention used by protoc-gen-go.
    
    This change is motivated by the fact that since 41aea82de2, the comment
    would include the absolute path to libxl_types.idl, therefore creating
    unintended diffs when generating code across different machines. This
    approach fixes that problem.
    
    [1] https://github.com/golang/go/issues/13560
    
    Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/golang/xenlight/gengotypes.py  | 10 ++++------
 tools/golang/xenlight/helpers.gen.go |  7 ++-----
 tools/golang/xenlight/types.gen.go   |  7 ++-----
 3 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
index 4ac181ae47..3e40c3d5dc 100644
--- a/tools/golang/xenlight/gengotypes.py
+++ b/tools/golang/xenlight/gengotypes.py
@@ -731,13 +731,11 @@ if __name__ == '__main__':
         name = b.typename
         builtin_type_names[name] = xenlight_golang_fmt_name(name)
 
-    header_comment="""// DO NOT EDIT.
-//
-// This file is generated by:
-// {0}
-//
+    header_comment="""// Code generated by {}. DO NOT EDIT.
+// source: {}
 
-""".format(' '.join(sys.argv))
+""".format(os.path.basename(sys.argv[0]),
+           ' '.join([os.path.basename(a) for a in sys.argv[1:]]))
 
     xenlight_golang_generate_types(types=types,
                                    comment=header_comment)
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index 152c7e8e6b..c8605994e7 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1,8 +1,5 @@
-// DO NOT EDIT.
-//
-// This file is generated by:
-// gengotypes.py ../../libxl/libxl_types.idl
-//
+// Code generated by gengotypes.py. DO NOT EDIT.
+// source: libxl_types.idl
 
 package xenlight
 
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 663c1e86b4..b4c5df0f2c 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -1,8 +1,5 @@
-// DO NOT EDIT.
-//
-// This file is generated by:
-// gengotypes.py ../../libxl/libxl_types.idl
-//
+// Code generated by gengotypes.py. DO NOT EDIT.
+// source: libxl_types.idl
 
 package xenlight
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 13 15:11:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Oct 2020 15:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6274.16726 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSLxF-0006TJ-1k; Tue, 13 Oct 2020 15:11:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6274.16726; Tue, 13 Oct 2020 15:11:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSLxE-0006TB-V0; Tue, 13 Oct 2020 15:11:08 +0000
Received: by outflank-mailman (input) for mailman id 6274;
 Tue, 13 Oct 2020 15:11:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSLxD-0006T6-RK
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 493d4fed-e929-4cd8-8abf-e31017897fd1;
 Tue, 13 Oct 2020 15:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSLxA-00081A-QC
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSLxA-00005Z-OK
 for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=ku4O=DU=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSLxD-0006T6-RK
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:07 +0000
X-Inumbo-ID: 493d4fed-e929-4cd8-8abf-e31017897fd1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 493d4fed-e929-4cd8-8abf-e31017897fd1;
	Tue, 13 Oct 2020 15:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FuXGWLg5CRM9AgJjDWQrS1m/DAW2AGulKkRWlCoQysc=; b=Cyzt9kOIyAbN9q5L3bwamuayMA
	jAQlCv8rNBcC6xj/B6qOSdlQyiN24p/c/4m3EdQqsuuM2wZT9bUb1MObhztkH23OvKrLQFl6nlI+n
	gP44mQMYuqaxohzL0D0fqNp6V4siEScvzF+7eFWWEcjbxNBkJOcuiGL4g920fE7aeEoU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSLxA-00081A-QC
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSLxA-00005Z-OK
	for xen-changelog@lists.xenproject.org; Tue, 13 Oct 2020 15:11:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: always use BASEDIR for xen sub-directory
Message-Id: <E1kSLxA-00005Z-OK@xenbits.xenproject.org>
Date: Tue, 13 Oct 2020 15:11:04 +0000

commit 9e5a9d0e6886f521453a63a2854ff6d06fa0d028
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 15:57:51 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 14:49:35 2020 +0000

    build: always use BASEDIR for xen sub-directory
    
    Modify Makefiles using $(XEN_ROOT)/xen to use $(BASEDIR) instead.
    
    This is removing the dependency to xen subdirectory preventing using a
    wrong configuration file when xen subdirectory is duplicated for
    compilation tests.
    
    BASEDIR is set in xen/lib/x86/Makefile as this Makefile is directly
    called from the tools build and install process and BASEDIR is not set
    there.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 6 ++++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index b3b60a1ba2..083f62acb6 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index 408d69c99e..c3b9ebe961 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -1,8 +1,10 @@
 include $(XEN_ROOT)/Config.mk
 
+BASEDIR = $(XEN_ROOT)/xen
+
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
+	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 065f4b8471..799321ec4d 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(XEN_ROOT)/xen
+srctree := $(BASEDIR)
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 50bec20a1e..637159ad82 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6715.17663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnF-0006e0-1g; Wed, 14 Oct 2020 12:22:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6715.17663; Wed, 14 Oct 2020 12:22:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnE-0006ds-Uq; Wed, 14 Oct 2020 12:22:08 +0000
Received: by outflank-mailman (input) for mailman id 6715;
 Wed, 14 Oct 2020 12:22:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfnC-0006dj-Uy
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4b90cd64-7542-4705-a624-8003257c389f;
 Wed, 14 Oct 2020 12:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnA-0003yE-Se
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnA-00004z-RY
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfnC-0006dj-Uy
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:07 +0000
X-Inumbo-ID: 4b90cd64-7542-4705-a624-8003257c389f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4b90cd64-7542-4705-a624-8003257c389f;
	Wed, 14 Oct 2020 12:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hyno4y1aU8jp961BrwSGCLp48ozHd/Q//FIkBcO5eyA=; b=nKl8auvH5NyCnBK0/a5rFpRiiR
	FEj+4LXsCkGuofA7xRe6NGrwElw875i8Fu9kcUiP6+NIMpPTTZyT7kOGuded0pY7nrT3UQxdyCV/l
	4TCjwz9D2rrR3zvlVcyFO39evezRbaNIy+8PlWBfhw+o1NuigQQk25T+aK6K0tmnjzo0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnA-0003yE-Se
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnA-00004z-RY
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: adjust population of acpi/
Message-Id: <E1kSfnA-00004z-RY@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:04 +0000

commit 8ea798eb4b04c868e7358cd392958d6d482a4947
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:00 2020 +0200

    tools/include: adjust population of acpi/
    
    Limit what gets exposed - in particular cpufreq/ and apei.h are
    hypervisor private headers which the tool stack building shouldn't see
    or use. Also don't pass -f to ln, to allow noticing name collisions
    right away.
    
    Additionally acpi/ also has been in need of deleting at the start of
    the rule, or alternatively the respective ln would have needed to also
    be passed -n.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 3d0192fbad..35623cd70a 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -16,15 +16,16 @@ XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
 xen/.dir: $(XEN_PUBLIC_INCLUDES) $(XEN_LIB_X86_INCLUDES)
-	@rm -rf xen
-	mkdir -p xen/libelf
+	@rm -rf xen acpi
+	mkdir -p xen/libelf acpi
 	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
 	ln -sf $(XEN_PUBLIC_INCLUDES) xen
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
 	ln -sf ../xen-sys/$(XEN_OS) xen/sys
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
-	ln -sf $(XEN_ROOT)/xen/include/acpi acpi
+	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
+	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
 ifeq ($(CONFIG_X86),y)
 	ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
 	mkdir -p xen/lib/x86
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6716.17667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnO-0006f3-3Y; Wed, 14 Oct 2020 12:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6716.17667; Wed, 14 Oct 2020 12:22:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnO-0006eu-0A; Wed, 14 Oct 2020 12:22:18 +0000
Received: by outflank-mailman (input) for mailman id 6716;
 Wed, 14 Oct 2020 12:22:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfnM-0006em-Ac
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1b8e4067-121e-454a-89a6-34108aab1849;
 Wed, 14 Oct 2020 12:22:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnL-0003yi-0P
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnK-00005h-Uq
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfnM-0006em-Ac
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:16 +0000
X-Inumbo-ID: 1b8e4067-121e-454a-89a6-34108aab1849
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1b8e4067-121e-454a-89a6-34108aab1849;
	Wed, 14 Oct 2020 12:22:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DRl6X4bYCCdQ7ZAAw+2iOGKkV3fqEtl2dlGNtT19UN0=; b=0CH1dOmC+FB7nKMSQsmT19ZMWY
	FZLP+XN/EVC+4LGr9HzKlTmD5/raXqK6cBDMAO1BwrrlnfBs9QF8mzlmZnCOpQZRkjQiGJ1+eCmxp
	qyABGKGLoj66JZVIYFJrIFzp6CDSbsxa+plx1GEnIAzi+ljjWtZ1hh1WL5Q1ojx9Bwus=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnL-0003yi-0P
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnK-00005h-Uq
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: fix (drop) dependencies of when to populate xen/
Message-Id: <E1kSfnK-00005h-Uq@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:14 +0000

commit 47654a0d7320cf5011db7d4d19e0463ea1b2ce32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:25 2020 +0200

    tools/include: fix (drop) dependencies of when to populate xen/
    
    Making the population of xen/ depend on the time stamps of a subset of
    the headers put there is error prone. The creation of a few dozen
    symlinks doesn't take a meaningful amount of time (compared to the
    overall building of tools/), and hence - to be on the safe side - should
    simply be done always. Convert the goal to a phony one and drop its
    dependencies, effectively taking further what 8d8d7d6b3dc1 ("tools: fix
    linking hypervisor includes to tools include directory") had already
    attempted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 35623cd70a..ca4464bcc5 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -4,8 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
-.PHONY: all all-y build
-all build: all-y xen-foreign xen/.dir xen-xsm/.dir
+.PHONY: all all-y build xen-dir
+all build: all-y xen-foreign xen-dir xen-xsm/.dir
 all-y:
 
 .PHONY: xen-foreign
@@ -15,7 +15,7 @@ xen-foreign:
 XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
-xen/.dir: $(XEN_PUBLIC_INCLUDES) $(XEN_LIB_X86_INCLUDES)
+xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
 	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
@@ -33,9 +33,8 @@ ifeq ($(CONFIG_X86),y)
 		ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; \
 	done
 endif
-	touch $@
 
-all-$(CONFIG_X86): xen/.dir
+all-$(CONFIG_X86): xen-dir
 	$(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT) PYTHON=$(PYTHON)
 
 # Not xen/xsm as that clashes with link to
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6717.17670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnY-0006gU-4T; Wed, 14 Oct 2020 12:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6717.17670; Wed, 14 Oct 2020 12:22:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnY-0006gM-1c; Wed, 14 Oct 2020 12:22:28 +0000
Received: by outflank-mailman (input) for mailman id 6717;
 Wed, 14 Oct 2020 12:22:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfnW-0006g7-76
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27ebd636-aa50-49e3-94bf-49eb6d94b57c;
 Wed, 14 Oct 2020 12:22:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnV-0003yx-3V
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnV-000068-2Y
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfnW-0006g7-76
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:26 +0000
X-Inumbo-ID: 27ebd636-aa50-49e3-94bf-49eb6d94b57c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27ebd636-aa50-49e3-94bf-49eb6d94b57c;
	Wed, 14 Oct 2020 12:22:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CIyqCr82Wmw0soPTqJtKSKUw+WooOPTxyGjFBf1Obn8=; b=z0zZxXZZyCNgneQJtJEZGg2JGk
	um28QyB8sLZkOPHsRcyEAxNyQgD9eTP0oIEMfnjRubg+W1xS31GUwvcr3yTYP/9J2Z2KGitkduWXa
	9PFLzxjbRd/PPq76WHCv5g+AnifB9SnSq2/cFbLKuoG8zv0rHN1difxAm7/GabilwNig=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnV-0003yx-3V
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnV-000068-2Y
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: adjust population of public headers into xen/
Message-Id: <E1kSfnV-000068-2Y@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:25 +0000

commit edc8d9136bf3854d6b37f782d124273216fb7ffd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:43 2020 +0200

    tools/include: adjust population of public headers into xen/
    
    Use a wildcard also for the subdirectories, drop XEN_PUBLIC_INCLUDES for
    having a single use only, and don't pass -f to ln to allow noticing name
    collisions right away, and add trailing slashes to ln's destination.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index ca4464bcc5..ebd5317169 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -12,15 +12,14 @@ all-y:
 xen-foreign:
 	$(MAKE) -C xen-foreign
 
-XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
 xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
-	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
-	ln -sf $(XEN_PUBLIC_INCLUDES) xen
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
+	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
+	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
+	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
 	ln -sf ../xen-sys/$(XEN_OS) xen/sys
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6718.17675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnh-0006iI-61; Wed, 14 Oct 2020 12:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6718.17675; Wed, 14 Oct 2020 12:22:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnh-0006i9-30; Wed, 14 Oct 2020 12:22:37 +0000
Received: by outflank-mailman (input) for mailman id 6718;
 Wed, 14 Oct 2020 12:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfng-0006i3-43
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7c8c8704-7913-4250-89aa-d16bddafe297;
 Wed, 14 Oct 2020 12:22:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnf-000408-6s
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnf-00008P-5Y
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfng-0006i3-43
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:36 +0000
X-Inumbo-ID: 7c8c8704-7913-4250-89aa-d16bddafe297
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7c8c8704-7913-4250-89aa-d16bddafe297;
	Wed, 14 Oct 2020 12:22:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1KZcuT9JUpx++DV0wLqS9boTrv3HJdeN9NPCEvbdiu0=; b=6AkQc6FhwYSxMLa5BSmlQs1bHL
	lxkG8DuDxTJervz9Z8xruj2wOor+WthrLQg18GpOmH+2/kGI7PpX8tKgyIrJoltGfSJ2rPRakTPI4
	qrGJvUuJV2qqOfeAsL06xZ/m+dJR4c1icXvguzTi0SY1xdgzJa0LuLYzskYk80014km4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnf-000408-6s
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnf-00008P-5Y
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: properly install Arm public headers
Message-Id: <E1kSfnf-00008P-5Y@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:35 +0000

commit 3d77849197c3b51d51067c2fbb4b34435e271a0a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:03 2020 +0200

    tools/include: properly install Arm public headers
    
    When smccc.h was added, adjustment of the install rule was missed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index ebd5317169..e7b4efcbfd 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -60,10 +60,7 @@ install: all
 	$(INSTALL_DATA) xen/*.h $(DESTDIR)$(includedir)/xen
 	$(INSTALL_DATA) xen/arch-x86/*.h $(DESTDIR)$(includedir)/xen/arch-x86
 	$(INSTALL_DATA) xen/arch-x86/hvm/*.h $(DESTDIR)$(includedir)/xen/arch-x86/hvm
-
-# 	xen/arch-arm doesn't contains headers for now. Uncommented the line
-# 	as soon as a new header is added
-#	$(INSTALL_DATA) xen/arch-arm/*.h $(DESTDIR)$(includedir)/xen/arch-arm
+	$(INSTALL_DATA) xen/arch-arm/*.h $(DESTDIR)$(includedir)/xen/arch-arm
 	$(INSTALL_DATA) xen/arch-arm/hvm/*.h $(DESTDIR)$(includedir)/xen/arch-arm/hvm
 	$(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(includedir)/xen/foreign
 	$(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(includedir)/xen/hvm
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6719.17679 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnr-0006jj-7V; Wed, 14 Oct 2020 12:22:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6719.17679; Wed, 14 Oct 2020 12:22:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfnr-0006jb-4Y; Wed, 14 Oct 2020 12:22:47 +0000
Received: by outflank-mailman (input) for mailman id 6719;
 Wed, 14 Oct 2020 12:22:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfnq-0006jV-RW
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3b3eadb8-8896-49d2-aea0-273ea41276bf;
 Wed, 14 Oct 2020 12:22:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnq-00040m-1L
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfnp-00009W-94
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfnq-0006jV-RW
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
X-Inumbo-ID: 3b3eadb8-8896-49d2-aea0-273ea41276bf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3b3eadb8-8896-49d2-aea0-273ea41276bf;
	Wed, 14 Oct 2020 12:22:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4n+40d8ExRwLW5BSM39KXnlZzrhUdXGgmHXcMPr7Rmw=; b=vyUEBd8EazroaQDt1i7cSkq6Tc
	gp5cbJlSMdWSg1KVgFGHMzAslRN/q4VNXulXAvnSUmU2wWpQGbDe1lFjQh3gtdloa1Uto6svIeT7w
	OoUK4MG7mU58Pv4M0BowNlopSGOn9e+gWjCl8OkzwmENdyDeRqlN3kDljEfRjLr+V83M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnq-00040m-1L
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfnp-00009W-94
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: adjust x86-specific population of xen/
Message-Id: <E1kSfnp-00009W-94@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:45 +0000

commit c02fd5b1a4011c87bc7580fa338ffe9ce84cdc5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:20 2020 +0200

    tools/include: adjust x86-specific population of xen/
    
    There's no need to use a shell loop construct here - ln's destination
    can be specified as just the intended directory, as we don't mean to
    change the names of any of the files. Also drop XEN_LIB_X86_INCLUDES for
    having a single use only, and don't pass -f to ln, to allow noticing
    name collisions right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index e7b4efcbfd..4db2d93887 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -12,8 +12,6 @@ all-y:
 xen-foreign:
 	$(MAKE) -C xen-foreign
 
-XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
-
 xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
@@ -26,11 +24,10 @@ xen-dir:
 	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
 	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
 ifeq ($(CONFIG_X86),y)
-	ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
+	ln -s $(XEN_ROOT)/xen/include/asm-x86 xen/asm
 	mkdir -p xen/lib/x86
-	for f in $(patsubst $(XEN_ROOT)/xen/include/xen/lib/x86/%,%,$(XEN_LIB_X86_INCLUDES)); do \
-		ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; \
-	done
+	ln -s $(filter-out %autogen.h,$(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h)) xen/lib/x86/
+	ln -s $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile xen/lib/x86/
 endif
 
 all-$(CONFIG_X86): xen-dir
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:22:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:22:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6720.17683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfo2-0006mk-9h; Wed, 14 Oct 2020 12:22:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6720.17683; Wed, 14 Oct 2020 12:22:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfo2-0006ma-6K; Wed, 14 Oct 2020 12:22:58 +0000
Received: by outflank-mailman (input) for mailman id 6720;
 Wed, 14 Oct 2020 12:22:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfo1-0006lh-E4
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9ec81187-a323-41f4-a169-7536a0e76d44;
 Wed, 14 Oct 2020 12:22:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfo0-00040y-4e
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfo0-0000AR-3O
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfo1-0006lh-E4
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:57 +0000
X-Inumbo-ID: 9ec81187-a323-41f4-a169-7536a0e76d44
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9ec81187-a323-41f4-a169-7536a0e76d44;
	Wed, 14 Oct 2020 12:22:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7NgYuTgJHAkVHbJpe7vHql2PVWWpnpEs4D/4E6/VTS8=; b=IDxmOQdNocusR5mfGIGmCBbAGD
	5M28RuVAsZVl8EHMMn6sYuMuTTz1sDNTz26IhZMtHsCMJU28ED4+KsUWuyOfZGMl5HG2BgPQKnE2c
	PC1RD1nYq8tVHBUpYZ2hTgcCj9ruEq9sxIczI3B2cfBZDmpC1zNBXMC5USigmfefRDPs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfo0-00040y-4e
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfo0-0000AR-3O
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:22:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/include: drop remaining -f from ln invocations
Message-Id: <E1kSfo0-0000AR-3O@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:22:56 +0000

commit 01d687c9cd70443617a885ba715d501455964567
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:40 2020 +0200

    tools/include: drop remaining -f from ln invocations
    
    This is once again to allow noticing name collisions right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4db2d93887..4d4313b60d 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -18,8 +18,8 @@ xen-dir:
 	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
-	ln -sf ../xen-sys/$(XEN_OS) xen/sys
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
+	ln -s ../xen-sys/$(XEN_OS) xen/sys
+	ln -s $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
 	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
 	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6721.17687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoC-0006nq-B3; Wed, 14 Oct 2020 12:23:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6721.17687; Wed, 14 Oct 2020 12:23:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoC-0006nj-7x; Wed, 14 Oct 2020 12:23:08 +0000
Received: by outflank-mailman (input) for mailman id 6721;
 Wed, 14 Oct 2020 12:23:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfoB-0006nZ-4F
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id efb36bd1-c9db-4be3-bcfb-35a0bff0643f;
 Wed, 14 Oct 2020 12:23:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoA-00041M-8U
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoA-0000BJ-6w
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfoB-0006nZ-4F
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:07 +0000
X-Inumbo-ID: efb36bd1-c9db-4be3-bcfb-35a0bff0643f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id efb36bd1-c9db-4be3-bcfb-35a0bff0643f;
	Wed, 14 Oct 2020 12:23:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zUiAEqji0Immdv1CKqd1BvU78RA7q1qEf+KceSfAUNQ=; b=6mg/mJhbo/QLkWkOmVX+p5Cf+V
	tWCKXDORMbDH8UGQmc/YDGs8IF7eFte1A2kxHq3N7xkvQfKLBPFFhHKMgALJ3VpYWLPtekgfLWvH1
	/XWPYdFBiF6tapXv+l1aBtitoEwkx7EfX2ZQKUxtgwadl7V3MSDWkRoubyeoKDOdNciU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoA-00041M-8U
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoA-0000BJ-6w
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kSfoA-0000BJ-6w@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:06 +0000

commit 6a34e67c118408ebdd62bfa7be76598ca040f170
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:03:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:03:38 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5454f94d18..1b894d0124 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -569,6 +569,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -594,9 +597,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6722.17691 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoM-0006pH-Cl; Wed, 14 Oct 2020 12:23:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6722.17691; Wed, 14 Oct 2020 12:23:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoM-0006p6-9c; Wed, 14 Oct 2020 12:23:18 +0000
Received: by outflank-mailman (input) for mailman id 6722;
 Wed, 14 Oct 2020 12:23:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfoL-0006ox-8N
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5a89c68b-c422-44a5-8f59-d6a2873d2542;
 Wed, 14 Oct 2020 12:23:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoK-000428-BP
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoK-0000Bs-Ab
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfoL-0006ox-8N
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:17 +0000
X-Inumbo-ID: 5a89c68b-c422-44a5-8f59-d6a2873d2542
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5a89c68b-c422-44a5-8f59-d6a2873d2542;
	Wed, 14 Oct 2020 12:23:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gCxLM0d+q5reRwtKDB/E+uwyFB28DxFr/0kZi3EIcn8=; b=c1ypoYmzBOkCBqcX+isj74EbVE
	rptQc6g0gwQI5//O3ECewbcVGWt4+86g0rjihJnyfNU8u9uDigxPUwXIER1AOFmBDCzsbp8fiIvGd
	t5qu2EMJsvVT2Gyk5UM8AfuhxRJwWbtr/AfICZ0yEigHYKu/Bd3rQLcnkSRRBFW60fbw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoK-000428-BP
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoK-0000Bs-Ab
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/vLAPIC: vlapic_init() runs only once for a vCPU
Message-Id: <E1kSfoK-0000Bs-Ab@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:16 +0000

commit 875248527906e6e98812d3ff844bcccbdd594768
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:05:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:05:10 2020 +0200

    x86/vLAPIC: vlapic_init() runs only once for a vCPU
    
    Hence there's no need to guard allocation / mapping by checks whether
    the same action has been done before. I assume this was a transient
    change which should have been undone before 509529e99148 ("x86 hvm: Xen
    interface and implementation for virtual S3") got committed.
    
    While touching this code, drop the pretty useless dprintk()-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 59660a8af4..5e21fb4937 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1610,27 +1610,17 @@ int vlapic_init(struct vcpu *v)
 
     vlapic->pt.source = PTSRC_lapic;
 
-    if (vlapic->regs_page == NULL)
-    {
-        vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
-        if ( vlapic->regs_page == NULL )
-        {
-            dprintk(XENLOG_ERR, "alloc vlapic regs error: %d/%d\n",
-                    v->domain->domain_id, v->vcpu_id);
-            return -ENOMEM;
-        }
-    }
-    if (vlapic->regs == NULL) 
+    vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
+    if ( !vlapic->regs_page )
+        return -ENOMEM;
+
+    vlapic->regs = __map_domain_page_global(vlapic->regs_page);
+    if ( vlapic->regs == NULL )
     {
-        vlapic->regs = __map_domain_page_global(vlapic->regs_page);
-        if ( vlapic->regs == NULL )
-        {
-            free_domheap_page(vlapic->regs_page);
-            dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
-                    v->domain->domain_id, v->vcpu_id);
-            return -ENOMEM;
-        }
+        free_domheap_page(vlapic->regs_page);
+        return -ENOMEM;
     }
+
     clear_page(vlapic->regs);
 
     vlapic_reset(vlapic);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6723.17695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoW-0006qi-FR; Wed, 14 Oct 2020 12:23:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6723.17695; Wed, 14 Oct 2020 12:23:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoW-0006qa-CX; Wed, 14 Oct 2020 12:23:28 +0000
Received: by outflank-mailman (input) for mailman id 6723;
 Wed, 14 Oct 2020 12:23:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfoV-0006qO-5j
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 94534e30-6de8-4ab2-b7ad-1ebcb6774f2b;
 Wed, 14 Oct 2020 12:23:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoU-00042I-ER
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoU-0000Cc-DX
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfoV-0006qO-5j
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:27 +0000
X-Inumbo-ID: 94534e30-6de8-4ab2-b7ad-1ebcb6774f2b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 94534e30-6de8-4ab2-b7ad-1ebcb6774f2b;
	Wed, 14 Oct 2020 12:23:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4hd5TjjG0JRq4dYmS+JABqYqThAO3xWVufCCGrGrfvQ=; b=RmZmA8WBMXItnhf4QSK3UXAdkn
	whd1JUqpQU29ypOuMhH4D3W/+tEL3LhAAKhMnpdbzPzos523h0AHWvM8+Ajm1Pjj0UqrEWbO5WZMd
	8lt7yuSGASkp3ni7Mz5mxkpcAUbGtNLldl0V+VEG5WDtK6RNfNqsiM1XrR5WUquG3INQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoU-00042I-ER
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoU-0000Cc-DX
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/msr: handle IA32_THERM_STATUS
Message-Id: <E1kSfoU-0000Cc-DX@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:26 +0000

commit 628055822452f8678c18193835fdc1e2c20d4d14
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 14 14:10:08 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:10:08 2020 +0200

    x86/msr: handle IA32_THERM_STATUS
    
    Windows 8 will attempt to read MSR_IA32_THERM_STATUS and panic if a
    #GP fault is injected as a result:
    
    vmx.c:3035:d8v0 RDMSR 0x0000019c unimplemented
    d8v0 VIRIDIAN CRASH: 3b c0000096 fffff8061de31651 fffff4088a613720 0
    
    So handle the MSR and return 0 instead.
    
    Note that this is done on the generic MSR handler, and PV guest will
    also get 0 back when trying to read the MSR. There doesn't seem to be
    much value in handling the MSR for HVM guests only.
    
    Fixes: 84e848fd7a1 ('x86/hvm: disallow access to unknown MSRs')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 81b34fb212..9c69ef8792 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -242,6 +242,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             goto gp_fault;
         break;
 
+    case MSR_IA32_THERM_STATUS:
+        if ( cp->x86_vendor != X86_VENDOR_INTEL )
+            goto gp_fault;
+        *val = 0;
+        break;
+
     case MSR_X2APIC_FIRST ... MSR_X2APIC_LAST:
         if ( !is_hvm_domain(d) || v != curr )
             goto gp_fault;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6726.17701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoh-0006su-IT; Wed, 14 Oct 2020 12:23:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6726.17701; Wed, 14 Oct 2020 12:23:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoh-0006sm-Eh; Wed, 14 Oct 2020 12:23:39 +0000
Received: by outflank-mailman (input) for mailman id 6726;
 Wed, 14 Oct 2020 12:23:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfog-0006s5-S6
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 281bc82a-9a0b-4f8e-8472-014dea35c95c;
 Wed, 14 Oct 2020 12:23:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoe-00042U-HZ
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoe-0000DH-Gd
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfog-0006s5-S6
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:38 +0000
X-Inumbo-ID: 281bc82a-9a0b-4f8e-8472-014dea35c95c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 281bc82a-9a0b-4f8e-8472-014dea35c95c;
	Wed, 14 Oct 2020 12:23:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CvJKLHltpOsSdhtLsVoMkORIdVVHRpxpU/ZuuKLL60M=; b=6ZOCdT0fatoTiLpRhKg3L1UP09
	3liKkD3cURNdXWF93Dy1xMYVsFSfReGGIR5hlpXr0Az30Mf5ZuOIgPRsY341JGxfadkeNiH+avFz6
	RCd0OOxK+dDe0CmLZNLinoJ6QiXkGgBjOgdST02leYgqmmgIrxfWqrlU51aEn2foYt2Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoe-00042U-HZ
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoe-0000DH-Gd
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] drop xen/hash.h
Message-Id: <E1kSfoe-0000DH-Gd@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:36 +0000

commit f14a4226bf07d008934fca84f78e86eab95c3adb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:10:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:10:49 2020 +0200

    drop xen/hash.h
    
    It has no users and hasn't been touched in 10 years.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/hash.h | 58 --------------------------------------------------
 1 file changed, 58 deletions(-)

diff --git a/xen/include/xen/hash.h b/xen/include/xen/hash.h
deleted file mode 100644
index 0658c8b619..0000000000
--- a/xen/include/xen/hash.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _XEN_HASH_H
-#define _XEN_HASH_H
-/* Fast hashing routine for a long.
-   (C) 2002 William Lee Irwin III, IBM */
-
-/*
- * Knuth recommends primes in approximately golden ratio to the maximum
- * integer representable by a machine word for multiplicative hashing.
- * Chuck Lever verified the effectiveness of this technique:
- * http://www.citi.umich.edu/techreports/reports/citi-tr-00-1.pdf
- *
- * These primes are chosen to be bit-sparse, that is operations on
- * them can use shifts and additions instead of multiplications for
- * machines where multiplications are slow.
- */
-#if BITS_PER_LONG == 32
-/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e370001UL
-#elif BITS_PER_LONG == 64
-/*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL
-#else
-#error Define GOLDEN_RATIO_PRIME for your wordsize.
-#endif
-
-static inline unsigned long hash_long(unsigned long val, unsigned int bits)
-{
-    unsigned long hash = val;
-
-#if BITS_PER_LONG == 64
-    /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
-    unsigned long n = hash;
-    n <<= 18;
-    hash -= n;
-    n <<= 33;
-    hash -= n;
-    n <<= 3;
-    hash += n;
-    n <<= 3;
-    hash -= n;
-    n <<= 4;
-    hash += n;
-    n <<= 2;
-    hash += n;
-#else
-    /* On some cpus multiply is faster, on others gcc will do shifts */
-    hash *= GOLDEN_RATIO_PRIME;
-#endif
-
-    /* High bits are more random, so use them. */
-    return hash >> (BITS_PER_LONG - bits);
-}
- 
-static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
-{
-    return hash_long((unsigned long)ptr, bits);
-}
-#endif /* _XEN_HASH_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6727.17705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoq-0006u3-JG; Wed, 14 Oct 2020 12:23:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6727.17705; Wed, 14 Oct 2020 12:23:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfoq-0006tv-GM; Wed, 14 Oct 2020 12:23:48 +0000
Received: by outflank-mailman (input) for mailman id 6727;
 Wed, 14 Oct 2020 12:23:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfop-0006tp-HF
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0afe4b84-8415-4a55-a7c4-7a02f304d340;
 Wed, 14 Oct 2020 12:23:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoo-00042h-Kh
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoo-0000Dz-Js
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfop-0006tp-HF
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:47 +0000
X-Inumbo-ID: 0afe4b84-8415-4a55-a7c4-7a02f304d340
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0afe4b84-8415-4a55-a7c4-7a02f304d340;
	Wed, 14 Oct 2020 12:23:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ICm9Q3MVqBC4eV9JflRSq3dDgM6g7yBHbTYjtfQrCS0=; b=p3vXevgDSo47zfNpaU7eBbg2Bq
	kfQg6f8hhxAMFPsS7ZdZLM+nVgfHmyAfJWtO8jhX3g2rFbRm7B8BM+wVU3cWTDpwYxGp9ZYxFWbPe
	xXpgyUvzorZwE36trFrYWGTZ9ADMxqjWBjW0RDYjrKYgjiTt0p0UgHcqzGvrLz1PN2G4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoo-00042h-Kh
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoo-0000Dz-Js
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] kexec: some #include adjustments
Message-Id: <E1kSfoo-0000Dz-Js@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:46 +0000

commit e3daad6283659794f4d70508fee23a340e42a93e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:11:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:11:49 2020 +0200

    kexec: some #include adjustments
    
    In the context of working on x86's elf_core_save_regs() I noticed there
    were far more source files getting rebuilt than I would have expected.
    While the main offender looks to have been fixmap.h including kexec.h,
    also drop use of elfcore.h from kexec.h.
    
    While adjusting machine_kexec.c also replace use of guest_access.h by
    domain_page.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/machine_kexec.c | 3 ++-
 xen/common/kexec.c           | 1 +
 xen/include/asm-x86/fixmap.h | 1 -
 xen/include/xen/elfcore.h    | 2 +-
 xen/include/xen/kexec.h      | 3 +--
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c
index b70d5a6a86..08ec9fd43b 100644
--- a/xen/arch/x86/machine_kexec.c
+++ b/xen/arch/x86/machine_kexec.c
@@ -16,8 +16,9 @@
  */
 
 #include <xen/types.h>
+#include <xen/domain_page.h>
+#include <xen/elfstructs.h>
 #include <xen/kexec.h>
-#include <xen/guest_access.h>
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
 #include <asm/page.h>
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 9af7de4df3..52cdc4ebc3 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -10,6 +10,7 @@
 #include <xen/lib.h>
 #include <xen/acpi.h>
 #include <xen/ctype.h>
+#include <xen/elfcore.h>
 #include <xen/errno.h>
 #include <xen/guest_access.h>
 #include <xen/param.h>
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 8330097a74..83b2b7634d 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -21,7 +21,6 @@
 
 #include <xen/acpi.h>
 #include <xen/pfn.h>
-#include <xen/kexec.h>
 #include <asm/apicdef.h>
 #include <asm/msi.h>
 #include <acpi/apei.h>
diff --git a/xen/include/xen/elfcore.h b/xen/include/xen/elfcore.h
index 4ad477d5b8..0d78033424 100644
--- a/xen/include/xen/elfcore.h
+++ b/xen/include/xen/elfcore.h
@@ -56,7 +56,7 @@ typedef struct
     int pr_fpvalid;              /* True if math co-processor being used.  */
 } ELF_Prstatus;
 
-typedef struct {
+typedef struct crash_xen_info {
     unsigned long xen_major_version;
     unsigned long xen_minor_version;
     unsigned long xen_extra_version;
diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h
index e235339c85..e85ba16405 100644
--- a/xen/include/xen/kexec.h
+++ b/xen/include/xen/kexec.h
@@ -5,7 +5,6 @@
 
 #include <public/kexec.h>
 
-#include <xen/elfcore.h>
 #include <xen/kimage.h>
 
 typedef struct xen_kexec_reserve {
@@ -51,7 +50,7 @@ void machine_reboot_kexec(struct kexec_image *image);
 void machine_kexec(struct kexec_image *image);
 void kexec_crash(void);
 void kexec_crash_save_cpu(void);
-crash_xen_info_t *kexec_crash_save_info(void);
+struct crash_xen_info *kexec_crash_save_info(void);
 void machine_crash_shutdown(void);
 int machine_kexec_get(xen_kexec_range_t *range);
 int machine_kexec_get_xen(xen_kexec_range_t *range);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 12:23:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 12:23:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6728.17709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfp0-0006vS-L0; Wed, 14 Oct 2020 12:23:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6728.17709; Wed, 14 Oct 2020 12:23:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSfp0-0006vK-Hw; Wed, 14 Oct 2020 12:23:58 +0000
Received: by outflank-mailman (input) for mailman id 6728;
 Wed, 14 Oct 2020 12:23:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSfoz-0006v7-Oe
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e91bb434-e67d-4c89-ae56-2fb113df4a07;
 Wed, 14 Oct 2020 12:23:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoy-00042v-RR
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSfoy-0000Ea-Mn
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSfoz-0006v7-Oe
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:57 +0000
X-Inumbo-ID: e91bb434-e67d-4c89-ae56-2fb113df4a07
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e91bb434-e67d-4c89-ae56-2fb113df4a07;
	Wed, 14 Oct 2020 12:23:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+aL9cRtUIaOrD/Mexs9s4Y9NjY95f9CjfcHSF9YHhFM=; b=nFvjddFbAdx04YSy728Vlbidca
	omx1nOwOXDjEiGBsCbwWHUEN4KGyqzZEvPN56rE15/W9pjpbGDdDdK9LvvH9NLD1bG3gX/gVZDwNZ
	FQyVIx+r5UaOAdiY2hkarjuD/miUissFslLRm8nUVlCIKRrazmThDGczfGjIF+2k9CGE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoy-00042v-RR
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSfoy-0000Ea-Mn
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 12:23:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI/Arm64: don't clobber DTB pointer
Message-Id: <E1kSfoy-0000Ea-Mn@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 12:23:56 +0000

commit 884ef07f4f66b9d12fc4811047db95ba649db85c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:13:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:13:16 2020 +0200

    EFI/Arm64: don't clobber DTB pointer
    
    read_section() needs to be more careful: efi_arch_use_config_file()
    may have found a DTB file (but without modules), and there may be no DTB
    specified in the EFI config file. In this case the pointer to the blob
    must not be overwritten with NULL when no ".dtb" section is present
    either.
    
    Fixes: 8a71d50ed40b ("efi: Enable booting unified hypervisor/kernel/initrd images")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/efi/boot.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index bacd551bb5..eb1ef91ba4 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -637,11 +637,14 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
                                 const CHAR16 *name, struct file *file,
                                 const char *options)
 {
-    file->ptr = pe_find_section(image->ImageBase, image->ImageSize,
-                                name, &file->size);
-    if ( !file->ptr )
+    const void *ptr = pe_find_section(image->ImageBase, image->ImageSize,
+                                      name, &file->size);
+
+    if ( !ptr )
         return false;
 
+    file->ptr = ptr;
+
     handle_file_info(name, file, options);
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 14 17:11:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Oct 2020 17:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.6919.18090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSkIw-0001dW-Li; Wed, 14 Oct 2020 17:11:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 6919.18090; Wed, 14 Oct 2020 17:11:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kSkIw-0001dN-Ig; Wed, 14 Oct 2020 17:11:10 +0000
Received: by outflank-mailman (input) for mailman id 6919;
 Wed, 14 Oct 2020 17:11:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kSkIv-0001dH-8N
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a6e0d2f3-e791-40ae-978b-066bcb8f316c;
 Wed, 14 Oct 2020 17:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSkIr-0002AG-Bu
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kSkIr-0008N6-Ay
 for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=82dG=DV=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kSkIv-0001dH-8N
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:09 +0000
X-Inumbo-ID: a6e0d2f3-e791-40ae-978b-066bcb8f316c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a6e0d2f3-e791-40ae-978b-066bcb8f316c;
	Wed, 14 Oct 2020 17:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gat8hYPHNg1BOxFr/whSjKIHjfROILxuU1IEFG0+g2w=; b=CVSp8BFU4f9++d+CxB+oljAWAB
	5W16GU1F7nkm3xr0o1pN2h1LCgj40on7fG8/AQQvcnW29FZnSHX7CLkhWEkijLSX/RNRCD8FyD9NI
	o/LCItwSpJr5jdBqVBjus7P6ySCFawTSnT/DB0BM5YIuQ5/lELtkBJIcQeuEfK7DqvL0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSkIr-0002AG-Bu
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kSkIr-0008N6-Ay
	for xen-changelog@lists.xenproject.org; Wed, 14 Oct 2020 17:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1kSkIr-0008N6-Ay@xenbits.xenproject.org>
Date: Wed, 14 Oct 2020 17:11:05 +0000

commit f776e5fb3ee699745f6442ec8c47d0fa647e0575
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Oct 14 18:02:50 2020 +0100

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 3b37f899b9..18cafcdda7 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 15 10:33:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Oct 2020 10:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7238.18872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT0ZH-0005rR-GX; Thu, 15 Oct 2020 10:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7238.18872; Thu, 15 Oct 2020 10:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT0ZH-0005rJ-D3; Thu, 15 Oct 2020 10:33:07 +0000
Received: by outflank-mailman (input) for mailman id 7238;
 Thu, 15 Oct 2020 10:33:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kT0ZG-0005qm-8K
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4fe1ca87-79b0-471a-a783-14b6d074aa2c;
 Thu, 15 Oct 2020 10:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT0ZE-0001Es-TR
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT0ZE-00079t-Rj
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kT0ZG-0005qm-8K
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:06 +0000
X-Inumbo-ID: 4fe1ca87-79b0-471a-a783-14b6d074aa2c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4fe1ca87-79b0-471a-a783-14b6d074aa2c;
	Thu, 15 Oct 2020 10:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+wZfsko8Ro/Wlx7MhbPQogu8zWXXmFZuZbSx7Itchh4=; b=MxLPnRL5HgXX4+tMWdUhKbNLMk
	EMgzpk4PM2i+Zxu2Hg/Ue1yn6xWhoCNWfTOt7ZFooNotD8P958eC+PnFlfMxFtDQmCqXPpfQ0HH1A
	Rhd7kMXqVi3qs/C3srqYE0iGHSHXWebMdwDnhLfTWAm08cZ/EJ5Q5Nck28v2hdi3PMnA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT0ZE-0001Es-TR
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT0ZE-00079t-Rj
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kT0ZE-00079t-Rj@xenbits.xenproject.org>
Date: Thu, 15 Oct 2020 10:33:04 +0000

commit 44ac57af81ff8097e228895738b911ca819bda19
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Thu Oct 15 12:29:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 12:29:11 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8add13d698..f0c6ff9d52 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -554,6 +554,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -904,6 +926,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -958,6 +985,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 15 10:33:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Oct 2020 10:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7246.18877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT0Zb-0005su-Ik; Thu, 15 Oct 2020 10:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7246.18877; Thu, 15 Oct 2020 10:33:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT0Zb-0005sl-FF; Thu, 15 Oct 2020 10:33:27 +0000
Received: by outflank-mailman (input) for mailman id 7246;
 Thu, 15 Oct 2020 10:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kT0Za-0005qm-4j
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 994d71df-234b-44f0-aa03-ea8c37095ae4;
 Thu, 15 Oct 2020 10:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT0ZP-0001Ev-18
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT0ZO-0007AL-Vl
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kT0Za-0005qm-4j
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:26 +0000
X-Inumbo-ID: 994d71df-234b-44f0-aa03-ea8c37095ae4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 994d71df-234b-44f0-aa03-ea8c37095ae4;
	Thu, 15 Oct 2020 10:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gnTJXolCYKm3X7MLUj08yeTFkBQohF+xjqMgpG8HQE8=; b=cr18OW1BuzDLiBXvoLsaiJyJao
	q44k+TfSw2bkCRj8sPMX/Kgt0bhgaD4QzantsxwORaSAd/3jwzcYAosroPonk0sgFfYr9MXSTNyyS
	Wg0fZ0dBkKePvuiYM/1Yz3h4Q5KIROQ/GcmrpFp37jDV0918ehcTUWjrL93Bv5J3/vJA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT0ZP-0001Ev-18
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT0ZO-0007AL-Vl
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 10:33:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: further "need_to_free" adjustments
Message-Id: <E1kT0ZO-0007AL-Vl@xenbits.xenproject.org>
Date: Thu, 15 Oct 2020 10:33:14 +0000

commit a8a85f03c826bea045e345fa405f187049d63584
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 15 12:30:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 12:30:01 2020 +0200

    EFI: further "need_to_free" adjustments
    
    When processing "chain" directives, the previously loaded config file
    gets freed. This needs to be recorded accordingly such that no error
    path would try to free the same block of memory a 2nd time.
    
    Furthermore, neither .addr nor .size being zero has any meaning towards
    the need to free an allocated chunk anymore. Drop (from read_file()) and
    replace (in Arm's efi_arch_use_config_file(), to sensibly retain the
    comment) respective assignments.
    
    Fixes: 04be2c3a0678 ("efi/boot.c: add file.need_to_free")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/efi/efi-boot.h |  2 +-
 xen/common/efi/boot.c       | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index f64a6604af..cf9c37153f 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -591,7 +591,7 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
 
     fdt = lookup_fdt_config_table(SystemTable);
     dtbfile.ptr = fdt;
-    dtbfile.size = 0;  /* Config table memory can't be freed, so set size to 0 */
+    dtbfile.need_to_free = false; /* Config table memory can't be freed. */
     if ( !fdt || fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") < 0 )
     {
         /*
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index eb1ef91ba4..63e289ab85 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -601,10 +601,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                                     PFN_UP(size), &file->addr);
     }
     if ( EFI_ERROR(ret) )
-    {
-        file->addr = 0;
         what = what ?: L"Allocation";
-    }
     else
     {
         file->need_to_free = true;
@@ -1271,8 +1268,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.addr = 0;
+            if ( cfg.need_to_free )
+            {
+                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+                cfg.need_to_free = false;
+            }
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 15 14:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Oct 2020 14:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7441.19432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT4UB-0006wx-MK; Thu, 15 Oct 2020 14:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7441.19432; Thu, 15 Oct 2020 14:44:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT4UB-0006wp-JE; Thu, 15 Oct 2020 14:44:07 +0000
Received: by outflank-mailman (input) for mailman id 7441;
 Thu, 15 Oct 2020 14:44:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kT4UA-0006wk-CH
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 25c5a449-2989-4e8c-9983-8a1e84da483a;
 Thu, 15 Oct 2020 14:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT4U9-0006gP-7t
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT4U9-0007f6-6U
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kT4UA-0006wk-CH
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:06 +0000
X-Inumbo-ID: 25c5a449-2989-4e8c-9983-8a1e84da483a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 25c5a449-2989-4e8c-9983-8a1e84da483a;
	Thu, 15 Oct 2020 14:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NfAOnOLR/IYSeq2xaWzJFPL9damHREYCyfRZ5pNg5ow=; b=eBROHdWsfbxypukVR4gG1bsVoZ
	YzW+R1Xi/t2ftZcSapAIrxVoOBHeGamcFG4Qsrif9Ihhi/kts90NhtxcVcJvSu1LkynCmzaejX5Hg
	yhNDDm8u8/OE4EYtFUm/GaRLKOMwxjaG0zhbnQIulrfXed2OpSKlh75mzBcnk3JnuUzo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT4U9-0006gP-7t
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT4U9-0007f6-6U
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 14:44:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: print update firmware only once
Message-Id: <E1kT4U9-0007f6-6U@xenbits.xenproject.org>
Date: Thu, 15 Oct 2020 14:44:05 +0000

commit 27addcca155744a18e908f2d6306f107b0a133de
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 12:05:44 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Oct 15 15:33:17 2020 +0100

    xen/arm: print update firmware only once
    
    Fix enable_smccc_arch_workaround_1 to only print the warning asking to
    update the firmware once.
    
    Fixes: 976319fa3de7 ("xen/arm64: Kill PSCI_GET_VERSION as a variant-2 workaround")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/cpuerrata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 6c09017515..0c63dfa779 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -187,7 +187,7 @@ warn:
         ASSERT(system_state < SYS_STATE_active);
         warning_add("No support for ARM_SMCCC_ARCH_WORKAROUND_1.\n"
                     "Please update your firmware.\n");
-        warned = false;
+        warned = true;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 15 15:22:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Oct 2020 15:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7495.19598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT54y-0003N9-7I; Thu, 15 Oct 2020 15:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7495.19598; Thu, 15 Oct 2020 15:22:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kT54y-0003N1-4H; Thu, 15 Oct 2020 15:22:08 +0000
Received: by outflank-mailman (input) for mailman id 7495;
 Thu, 15 Oct 2020 15:22:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kT54w-0003Mw-GD
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3912b9b0-429c-4a1b-b059-5163ebb37967;
 Thu, 15 Oct 2020 15:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT54u-0007Wj-PS
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kT54u-0002oX-Mp
 for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zdlp=DW=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kT54w-0003Mw-GD
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:06 +0000
X-Inumbo-ID: 3912b9b0-429c-4a1b-b059-5163ebb37967
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3912b9b0-429c-4a1b-b059-5163ebb37967;
	Thu, 15 Oct 2020 15:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bgzgspi68chu1+9vIjfE59DqpXBGn93d3fHp6yg6e1I=; b=ReenDHfOZkGE8Jz4aKCAiY3gN+
	gRwnxRzu86mzVYJU9QA/ABQXnHtykpiOIKrPs5lRw4kNtKozkRIGfc7Stmgd23Cw4Ol8DW4n9IWkx
	CbW430BV0erzmnGjQVDxsNQ0NEkY7UalCBkVFaR917/4yHB1qucCEhli6MP9BvTKmqCc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT54u-0007Wj-PS
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kT54u-0002oX-Mp
	for xen-changelog@lists.xenproject.org; Thu, 15 Oct 2020 15:22:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/gdbsx: drop stray recursion into tools/include/
Message-Id: <E1kT54u-0002oX-Mp@xenbits.xenproject.org>
Date: Thu, 15 Oct 2020 15:22:04 +0000

commit 6ee2e66674f36b6d27a95f4ddf27226905cc63a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 15 17:18:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 17:18:25 2020 +0200

    tools/gdbsx: drop stray recursion into tools/include/
    
    Doing so isn't appropriate here - this gets done very early in the build
    process. If the directory is mean to to be buildable on its own,
    different arrangements would be needed.
    
    The issue has become more pronounced by 47654a0d7320 ("tools/include:
    fix (drop) dependencies of when to populate xen/"), but was there before
    afaict.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/debugger/gdbsx/xg/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/debugger/gdbsx/xg/Makefile b/tools/debugger/gdbsx/xg/Makefile
index 6a8937b8f9..acdcddf0d5 100644
--- a/tools/debugger/gdbsx/xg/Makefile
+++ b/tools/debugger/gdbsx/xg/Makefile
@@ -12,7 +12,7 @@ CFLAGS += $(CFLAGS_xeninclude)
 all: build
 
 .PHONY: build
-build: xen-headers xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
+build: xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
 # build: mk-symlinks xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
 # build: mk-symlinks xg_all.a
 
@@ -21,9 +21,6 @@ xg_all.a: $(XG_OBJS) Makefile $(XG_HDRS)
 #	$(LD) -b elf32-i386 $(LDFLAGS) -r -o $@ $^
 #	$(CC) -m32 -c -o $@ $^
 
-xen-headers:
-	$(MAKE) -C ../../../include
-
 # xg_main.o: xg_main.c Makefile $(XG_HDRS)
 #$(CC) -c $(CFLAGS) -o $@ $<
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7906.20883 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdf-000875-Bq; Fri, 16 Oct 2020 11:11:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7906.20883; Fri, 16 Oct 2020 11:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdf-00086x-8x; Fri, 16 Oct 2020 11:11:11 +0000
Received: by outflank-mailman (input) for mailman id 7906;
 Fri, 16 Oct 2020 11:11:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNde-00086r-1U
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 01b7a3d1-dbb6-45d9-a760-ab7e6cec46b5;
 Fri, 16 Oct 2020 11:11:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdZ-00021D-VV
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdZ-0001am-TY
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNde-00086r-1U
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:10 +0000
X-Inumbo-ID: 01b7a3d1-dbb6-45d9-a760-ab7e6cec46b5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 01b7a3d1-dbb6-45d9-a760-ab7e6cec46b5;
	Fri, 16 Oct 2020 11:11:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4mAadnbsriDwRG0qf3f4qj/9EDxJWB5HBRZMtYDpO4Y=; b=kc3gy6S5k7bLjPq9ieWuo+KJHM
	6N69CX1joSzyfJV7zxLUkevkAX8hj4BSV7g/HvCIZtFy90B9dW1tGJDl6T1+6pmp3GGwA2TTUs+Yp
	iGwC7KtTT4N8LO8Wy4hUeT0VgyNe/aLG0LcNMD6dMpciJ6FdySarR//DCnY0kt1X3III=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdZ-00021D-VV
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdZ-0001am-TY
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hostmem: don't use mbind() if host-nodes is empty
Message-Id: <E1kTNdZ-0001am-TY@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:05 +0000

commit 9e6e3ba30984267be4721022f579fb168d43c8a4
Author:     Igor Mammedov <imammedo@redhat.com>
AuthorDate: Thu Apr 30 11:46:06 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:30 2020 -0500

    hostmem: don't use mbind() if host-nodes is empty
    
    Since 5.0 QEMU uses hostmem backend for allocating main guest RAM.
    The backend however calls mbind() which is typically NOP
    in case of default policy/absent host-nodes bitmap.
    However when runing in container with black-listed mbind()
    syscall, QEMU fails to start with error
     "cannot bind memory to host NUMA nodes: Operation not permitted"
    even when user hasn't provided host-nodes to pin to explictly
    (which is the case with -m option)
    
    To fix issue, call mbind() only in case when user has provided
    host-nodes explicitly (i.e. host_nodes bitmap is not empty).
    That should allow to run QEMU in containers with black-listed
    mbind() without memory pinning. If QEMU provided memory-pinning
    is required user still has to white-list mbind() in container
    configuration.
    
    Reported-by: Manuel Hohmann <mhohmann@physnet.uni-hamburg.de>
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Message-Id: <20200430154606.6421-1-imammedo@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    (cherry picked from commit 70b6d525dfb51d5e523d568d1139fc051bc223c5)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 backends/hostmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index 327f9eebc3..0efd7b7bd6 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -383,8 +383,10 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
         assert(sizeof(backend->host_nodes) >=
                BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long));
         assert(maxnode <= MAX_NODES);
-        if (mbind(ptr, sz, backend->policy,
-                  maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) {
+
+        if (maxnode &&
+            mbind(ptr, sz, backend->policy, backend->host_nodes, maxnode + 1,
+                  flags)) {
             if (backend->policy != MPOL_DEFAULT || errno != ENOSYS) {
                 error_setg_errno(errp, errno,
                                  "cannot bind memory to host NUMA nodes");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7907.20887 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdm-00087r-DH; Fri, 16 Oct 2020 11:11:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7907.20887; Fri, 16 Oct 2020 11:11:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdm-00087j-AG; Fri, 16 Oct 2020 11:11:18 +0000
Received: by outflank-mailman (input) for mailman id 7907;
 Fri, 16 Oct 2020 11:11:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNdl-00087Q-0q
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2f4817f0-ad1e-4ffa-b1ba-648a3712c0a8;
 Fri, 16 Oct 2020 11:11:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdk-00021J-4t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdk-0001bE-1f
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNdl-00087Q-0q
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:17 +0000
X-Inumbo-ID: 2f4817f0-ad1e-4ffa-b1ba-648a3712c0a8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2f4817f0-ad1e-4ffa-b1ba-648a3712c0a8;
	Fri, 16 Oct 2020 11:11:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mnY33uCmlqRAtNUBnpoqy25ebu7Su/LqQ7BznqQ3SK4=; b=hzegte4nOel181qS7cMsvwu6dm
	gFDknOxb4eniE3/IQRfcZipIFlINfD0hIF3IebZKNORzo5sSWskXqoFgjahYAJCWV7j2um9jmzhfO
	EwM1XHK465r5s+CBpwoF0S0iNalTlykb1VGO8T6GYse5dMD5oPt0CaxJy1X0fB+OowG4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdk-00021J-4t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdk-0001bE-1f
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*
Message-Id: <E1kTNdk-0001bE-1f@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:16 +0000

commit 352259fef83f689b8a8c436a24093e6ede167288
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Wed May 13 09:32:43 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:37 2020 -0500

    target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*
    
    Must clear the tail for AdvSIMD when SVE is enabled.
    
    Fixes: ca40a6e6e39
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200513163245.17915-15-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    (cherry picked from commit 525d9b6d42844e187211d25b69be8b378785bc24)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/arm/vec_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
index 8017bd88c4..5ce111b286 100644
--- a/target/arm/vec_helper.c
+++ b/target/arm/vec_helper.c
@@ -737,6 +737,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \
             d[i + j] = TYPE##_mul(n[i + j], mm, stat);                     \
         }                                                                  \
     }                                                                      \
+    clear_tail(d, oprsz, simd_maxsz(desc));                                \
 }
 
 DO_MUL_IDX(gvec_fmul_idx_h, float16, H2)
@@ -761,6 +762,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va,                  \
                                      mm, a[i + j], 0, stat);               \
         }                                                                  \
     }                                                                      \
+    clear_tail(d, oprsz, simd_maxsz(desc));                                \
 }
 
 DO_FMLA_IDX(gvec_fmla_idx_h, float16, H2)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7908.20891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdw-00089A-Ey; Fri, 16 Oct 2020 11:11:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7908.20891; Fri, 16 Oct 2020 11:11:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNdw-000890-Bh; Fri, 16 Oct 2020 11:11:28 +0000
Received: by outflank-mailman (input) for mailman id 7908;
 Fri, 16 Oct 2020 11:11:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNdv-00088r-72
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5e16ef2c-fafd-4dbd-8786-233462080d53;
 Fri, 16 Oct 2020 11:11:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdu-00021W-AL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNdu-0001bp-7H
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNdv-00088r-72
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:27 +0000
X-Inumbo-ID: 5e16ef2c-fafd-4dbd-8786-233462080d53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5e16ef2c-fafd-4dbd-8786-233462080d53;
	Fri, 16 Oct 2020 11:11:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LBmOb8w0ZZMXU9WsZznhSV+ZXLfnzXqGhhTaqSbggm4=; b=OkN6xAat0beKRSfUNKZCQ3voZZ
	hNFZePUrOaJejNz1246ls8B3u5AAUpL6x3hth2RnQ6a5lAIk2ecPe1jmAN/i8s+kUTosG9I30F1j7
	aNsxZVCkQXmzGo0J4Nb7bs41pUeyjJU6mOEs7aH6vTppas2hzv3fGHhXv3lBRN6tAKjs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdu-00021W-AL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNdu-0001bp-7H
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] qemu-nbd: Close inherited stderr
Message-Id: <E1kTNdu-0001bp-7H@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:26 +0000

commit bdac9aabd92bd8e6d070cbc83e46272e86f63dc5
Author:     Raphael Pour <raphael.pour@hetzner.com>
AuthorDate: Fri May 15 08:36:07 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:45 2020 -0500

    qemu-nbd: Close inherited stderr
    
    Close inherited stderr of the parent if fork_process is false.
    Otherwise no one will close it. (introduced by e6df58a5)
    
    This only affected 'qemu-nbd -c /dev/nbd0'.
    
    Signed-off-by: Raphael Pour <raphael.pour@hetzner.com>
    Message-Id: <d8ddc993-9816-836e-a3de-c6edab9d9c49@hetzner.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: Enhance commit message]
    Signed-off-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit 0eaf453ebf6788885fbb5d40426b154ef8805407)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qemu-nbd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 4aa005004e..306e44fb0a 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -916,7 +916,11 @@ int main(int argc, char **argv)
         } else if (pid == 0) {
             close(stderr_fd[0]);
 
-            old_stderr = dup(STDERR_FILENO);
+            /* Remember parent's stderr if we will be restoring it. */
+            if (fork_process) {
+                old_stderr = dup(STDERR_FILENO);
+            }
+
             ret = qemu_daemon(1, 0);
 
             /* Temporarily redirect stderr to the parent's pipe...  */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7909.20895 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNe6-0008AR-GK; Fri, 16 Oct 2020 11:11:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7909.20895; Fri, 16 Oct 2020 11:11:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNe6-0008AI-DA; Fri, 16 Oct 2020 11:11:38 +0000
Received: by outflank-mailman (input) for mailman id 7909;
 Fri, 16 Oct 2020 11:11:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNe5-0008AB-A8
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 62cadb3b-90f0-4081-935c-14d362c1a53e;
 Fri, 16 Oct 2020 11:11:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNe4-000227-DO
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNe4-0001cb-Cg
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNe5-0008AB-A8
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:37 +0000
X-Inumbo-ID: 62cadb3b-90f0-4081-935c-14d362c1a53e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 62cadb3b-90f0-4081-935c-14d362c1a53e;
	Fri, 16 Oct 2020 11:11:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H/0D5fBpB0/CsVIJjzIKy94y+r4/QD9fBvrDElu+E6k=; b=HyZd5F2xQ6EhGDKN9lDdDLunQO
	DzLCR0KMuUgSPqZ8l35/jt1HoS0Vp2J4rb4AzeU+TNPULuxuyb3e61CGk79extJ3vhbA4ELm8+n6g
	Yyj6kfMcM448nwgwk6Ad0CfHWGIqxnlOXFeR0kDjekkfC+Y2v/g+Bzm6hof2+IrOiB54=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNe4-000227-DO
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNe4-0001cb-Cg
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] 9p: Lock directory streams with a CoMutex
Message-Id: <E1kTNe4-0001cb-Cg@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:36 +0000

commit 250322bfbdec098699b414422008aa8ae65f7d4d
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Mon May 25 10:38:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:51 2020 -0500

    9p: Lock directory streams with a CoMutex
    
    Locking was introduced in QEMU 2.7 to address the deprecation of
    readdir_r(3) in glibc 2.24. It turns out that the frontend code is
    the worst place to handle a critical section with a pthread mutex:
    the code runs in a coroutine on behalf of the QEMU mainloop and then
    yields control, waiting for the fsdev backend to process the request
    in a worker thread. If the client resends another readdir request for
    the same fid before the previous one finally unlocked the mutex, we're
    deadlocked.
    
    This never bit us because the linux client serializes readdir requests
    for the same fid, but it is quite easy to demonstrate with a custom
    client.
    
    A good solution could be to narrow the critical section in the worker
    thread code and to return a copy of the dirent to the frontend, but
    this causes quite some changes in both 9p.c and codir.c. So, instead
    of that, in order for people to easily backport the fix to older QEMU
    versions, let's simply use a CoMutex since all the users for this
    sit in coroutines.
    
    Fixes: 7cde47d4a89d ("9p: add locking to V9fsDir")
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <158981894794.109297.3530035833368944254.stgit@bahia.lan>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit ed463454efd0ac3042ff772bfe1b1d846dc281a5)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index b8f72a3bd9..c381fe091a 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -197,22 +197,22 @@ typedef struct V9fsXattr
 
 typedef struct V9fsDir {
     DIR *stream;
-    QemuMutex readdir_mutex;
+    CoMutex readdir_mutex;
 } V9fsDir;
 
 static inline void v9fs_readdir_lock(V9fsDir *dir)
 {
-    qemu_mutex_lock(&dir->readdir_mutex);
+    qemu_co_mutex_lock(&dir->readdir_mutex);
 }
 
 static inline void v9fs_readdir_unlock(V9fsDir *dir)
 {
-    qemu_mutex_unlock(&dir->readdir_mutex);
+    qemu_co_mutex_unlock(&dir->readdir_mutex);
 }
 
 static inline void v9fs_readdir_init(V9fsDir *dir)
 {
-    qemu_mutex_init(&dir->readdir_mutex);
+    qemu_co_mutex_init(&dir->readdir_mutex);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7910.20899 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeG-0008CC-HU; Fri, 16 Oct 2020 11:11:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7910.20899; Fri, 16 Oct 2020 11:11:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeG-0008C4-Ed; Fri, 16 Oct 2020 11:11:48 +0000
Received: by outflank-mailman (input) for mailman id 7910;
 Fri, 16 Oct 2020 11:11:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNeF-0008Bw-95
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 493d2ced-8642-48d7-956c-209c52f57ada;
 Fri, 16 Oct 2020 11:11:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeE-00022H-Gm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeE-0001dF-Fl
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNeF-0008Bw-95
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:47 +0000
X-Inumbo-ID: 493d2ced-8642-48d7-956c-209c52f57ada
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 493d2ced-8642-48d7-956c-209c52f57ada;
	Fri, 16 Oct 2020 11:11:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UUVXC/nR44666ix8RNxf3f8ZoT63qEzdSTP83SqpVLs=; b=LRaNj3fdGemxCdPVsViyX9Pok+
	kLWWEBqNYyaSVAMk01sxbktlMCHI7kDqbOfRK0mdB8lEC9AOFM35qPrRCS16N/s9WyOtBVBTpokNr
	J53+j5FWVMQ51stlBs9wlzfwzUDF/oFZHpmcGJW5JtMswjMmPs2L5468ECTSAIhVme1w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeE-00022H-Gm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeE-0001dF-Fl
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] net: Do not include a newline in the id of -nic devices
Message-Id: <E1kTNeE-0001dF-Fl@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:46 +0000

commit c6414cb18315e4d043b6756faf9766fb0d8488bb
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon May 18 09:43:52 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:57 2020 -0500

    net: Do not include a newline in the id of -nic devices
    
    The '\n' sneaked in by accident here, an "id" string should really
    not contain a newline character at the end.
    
    Fixes: 78cd6f7bf6b ('net: Add a new convenience option "--nic" ...')
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200518074352.23125-1-thuth@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    (cherry picked from commit 0561dfac082becdd9e89110249a27b309b62aa9f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 38778e831d..cbeeeadff8 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1506,7 +1506,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
     /* Create an ID if the user did not specify one */
     nd_id = g_strdup(qemu_opts_id(opts));
     if (!nd_id) {
-        nd_id = g_strdup_printf("__org.qemu.nic%i\n", idx);
+        nd_id = g_strdup_printf("__org.qemu.nic%i", idx);
         qemu_opts_set_id(opts, nd_id);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:11:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:11:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7911.20902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeR-0008DM-JA; Fri, 16 Oct 2020 11:11:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7911.20902; Fri, 16 Oct 2020 11:11:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeR-0008DD-G4; Fri, 16 Oct 2020 11:11:59 +0000
Received: by outflank-mailman (input) for mailman id 7911;
 Fri, 16 Oct 2020 11:11:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNeP-0008D4-Qe
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bf4b2edc-6feb-4f4c-8c73-ed7284fe5e35;
 Fri, 16 Oct 2020 11:11:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeO-00022T-K5
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeO-0001e8-JC
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNeP-0008D4-Qe
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:57 +0000
X-Inumbo-ID: bf4b2edc-6feb-4f4c-8c73-ed7284fe5e35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bf4b2edc-6feb-4f4c-8c73-ed7284fe5e35;
	Fri, 16 Oct 2020 11:11:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U4RwpvgcdAW504LfLqvpAYfSSoJg9y9PC59dVz7jAXc=; b=XeM4ZkDbcxxLtIOmAMpIwup/qK
	gT2VkU1ka+hX3h/uqFZnbOfzO3cfxFCm4PSczKFvhp+pCHBOUomSY36OUYLy3QWzyL04sPWOu8RKj
	005AIwgYO1VSvCSD24OUa17J4wrtigd+JOepEKEy25gVA3bV11ZHgKw7aG7jZIxRdltU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeO-00022T-K5
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeO-0001e8-JC
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:11:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] nbd/server: Avoid long error message assertions CVE-2020-10761
Message-Id: <E1kTNeO-0001e8-JC@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:11:56 +0000

commit d48973dc26f9f852eb32b89ae33db717d192df5c
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 8 13:26:37 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:03 2020 -0500

    nbd/server: Avoid long error message assertions CVE-2020-10761
    
    Ever since commit 36683283 (v2.8), the server code asserts that error
    strings sent to the client are well-formed per the protocol by not
    exceeding the maximum string length of 4096.  At the time the server
    first started sending error messages, the assertion could not be
    triggered, because messages were completely under our control.
    However, over the years, we have added latent scenarios where a client
    could trigger the server to attempt an error message that would
    include the client's information if it passed other checks first:
    
    - requesting NBD_OPT_INFO/GO on an export name that is not present
      (commit 0cfae925 in v2.12 echoes the name)
    
    - requesting NBD_OPT_LIST/SET_META_CONTEXT on an export name that is
      not present (commit e7b1948d in v2.12 echoes the name)
    
    At the time, those were still safe because we flagged names larger
    than 256 bytes with a different message; but that changed in commit
    93676c88 (v4.2) when we raised the name limit to 4096 to match the NBD
    string limit.  (That commit also failed to change the magic number
    4096 in nbd_negotiate_send_rep_err to the just-introduced named
    constant.)  So with that commit, long client names appended to server
    text can now trigger the assertion, and thus be used as a denial of
    service attack against a server.  As a mitigating factor, if the
    server requires TLS, the client cannot trigger the problematic paths
    unless it first supplies TLS credentials, and such trusted clients are
    less likely to try to intentionally crash the server.
    
    We may later want to further sanitize the user-supplied strings we
    place into our error messages, such as scrubbing out control
    characters, but that is less important to the CVE fix, so it can be a
    later patch to the new nbd_sanitize_name.
    
    Consideration was given to changing the assertion in
    nbd_negotiate_send_rep_verr to instead merely log a server error and
    truncate the message, to avoid leaving a latent path that could
    trigger a future CVE DoS on any new error message.  However, this
    merely complicates the code for something that is already (correctly)
    flagging coding errors, and now that we are aware of the long message
    pitfall, we are less likely to introduce such errors in the future,
    which would make such error handling dead code.
    
    Reported-by: Xueqiang Wei <xuwei@redhat.com>
    CC: qemu-stable@nongnu.org
    Fixes: https://bugzilla.redhat.com/1843684 CVE-2020-10761
    Fixes: 93676c88d7
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200610163741.3745251-2-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    (cherry picked from commit 5c4fe018c025740fef4a0a4421e8162db0c3eefd)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 nbd/server.c               | 23 ++++++++++++++++++++---
 tests/qemu-iotests/143     |  4 ++++
 tests/qemu-iotests/143.out |  2 ++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 02b1ed0801..20754e9ebc 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -217,7 +217,7 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
 
     msg = g_strdup_vprintf(fmt, va);
     len = strlen(msg);
-    assert(len < 4096);
+    assert(len < NBD_MAX_STRING_SIZE);
     trace_nbd_negotiate_send_rep_err(msg);
     ret = nbd_negotiate_send_rep_len(client, type, len, errp);
     if (ret < 0) {
@@ -231,6 +231,19 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
     return 0;
 }
 
+/*
+ * Return a malloc'd copy of @name suitable for use in an error reply.
+ */
+static char *
+nbd_sanitize_name(const char *name)
+{
+    if (strnlen(name, 80) < 80) {
+        return g_strdup(name);
+    }
+    /* XXX Should we also try to sanitize any control characters? */
+    return g_strdup_printf("%.80s...", name);
+}
+
 /* Send an error reply.
  * Return -errno on error, 0 on success. */
 static int GCC_FMT_ATTR(4, 5)
@@ -595,9 +608,11 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
 
     exp = nbd_export_find(name);
     if (!exp) {
+        g_autofree char *sane_name = nbd_sanitize_name(name);
+
         return nbd_negotiate_send_rep_err(client, NBD_REP_ERR_UNKNOWN,
                                           errp, "export '%s' not present",
-                                          name);
+                                          sane_name);
     }
 
     /* Don't bother sending NBD_INFO_NAME unless client requested it */
@@ -995,8 +1010,10 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
 
     meta->exp = nbd_export_find(export_name);
     if (meta->exp == NULL) {
+        g_autofree char *sane_name = nbd_sanitize_name(export_name);
+
         return nbd_opt_drop(client, NBD_REP_ERR_UNKNOWN, errp,
-                            "export '%s' not present", export_name);
+                            "export '%s' not present", sane_name);
     }
 
     ret = nbd_opt_read(client, &nb_queries, sizeof(nb_queries), errp);
diff --git a/tests/qemu-iotests/143 b/tests/qemu-iotests/143
index f649b36195..d2349903b1 100755
--- a/tests/qemu-iotests/143
+++ b/tests/qemu-iotests/143
@@ -58,6 +58,10 @@ _send_qemu_cmd $QEMU_HANDLE \
 $QEMU_IO_PROG -f raw -c quit \
     "nbd+unix:///no_such_export?socket=$SOCK_DIR/nbd" 2>&1 \
     | _filter_qemu_io | _filter_nbd
+# Likewise, with longest possible name permitted in NBD protocol
+$QEMU_IO_PROG -f raw -c quit \
+    "nbd+unix:///$(printf %4096d 1 | tr ' ' a)?socket=$SOCK_DIR/nbd" 2>&1 \
+    | _filter_qemu_io | _filter_nbd | sed 's/aaaa*aa/aa--aa/'
 
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'quit' }" \
diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out
index 1f4001c601..fc9c0a761f 100644
--- a/tests/qemu-iotests/143.out
+++ b/tests/qemu-iotests/143.out
@@ -5,6 +5,8 @@ QA output created by 143
 {"return": {}}
 qemu-io: can't open device nbd+unix:///no_such_export?socket=SOCK_DIR/nbd: Requested export not available
 server reported: export 'no_such_export' not present
+qemu-io: can't open device nbd+unix:///aa--aa1?socket=SOCK_DIR/nbd: Requested export not available
+server reported: export 'aa--aa...' not present
 { 'execute': 'quit' }
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7912.20907 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeb-0008Eb-Ln; Fri, 16 Oct 2020 11:12:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7912.20907; Fri, 16 Oct 2020 11:12:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeb-0008ET-Ip; Fri, 16 Oct 2020 11:12:09 +0000
Received: by outflank-mailman (input) for mailman id 7912;
 Fri, 16 Oct 2020 11:12:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNea-0008EL-AF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0a1dfc2b-ffab-4d11-a1ad-708fe6aad557;
 Fri, 16 Oct 2020 11:12:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeY-00022r-NK
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNeY-0001ez-MS
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNea-0008EL-AF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:08 +0000
X-Inumbo-ID: 0a1dfc2b-ffab-4d11-a1ad-708fe6aad557
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0a1dfc2b-ffab-4d11-a1ad-708fe6aad557;
	Fri, 16 Oct 2020 11:12:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1bsyUOID8baxoFs9yNsXPst3yLwMApAMMnuMolzweNM=; b=ELP6zKrzrf/9YMn5xVGBrby8NS
	ZgxmXdO5lsuxVfy18mMvYkfox0AZsj8HY7t9Oy+LLz+B6Z4uZYiwFBsUdMrkSjgO+/P4EyzAzW8C3
	TIlmLTy19YXhBDqO+z1B/KIa9iqg62d8wT4BMzy3p3j1uCpVSO/nYkJS3d/riwnmv4Vs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeY-00022r-NK
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNeY-0001ez-MS
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: fix free page hinting without an iothread
Message-Id: <E1kTNeY-0001ez-MS@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:06 +0000

commit 99458fbb5649f16a8a5a61774d4e9b9bf13d2d50
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:37 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:10 2020 -0500

    virtio-balloon: fix free page hinting without an iothread
    
    In case we don't have an iothread, we mark the feature as abscent but
    still add the queue. 'free_page_bh' remains set to NULL.
    
    qemu-system-i386 \
            -M microvm \
            -nographic \
            -device virtio-balloon-device,free-page-hint=true \
            -nographic \
            -display none \
            -monitor none \
            -serial none \
            -qtest stdio
    
    Doing a "write 0xc0000e30 0x24
    0x030000000300000003000000030000000300000003000000030000000300000003000000"
    
    We will trigger a SEGFAULT. Let's move the check and bail out.
    
    While at it, move the static initializations to instance_init().
    free_page_report_status and block_iothread are implicitly set to the
    right values (0/false) already, so drop the initialization.
    
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-2-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 12fc8903a8ee09fb5f642de82699a0b211e1b5a7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a4729f7fc9..ef499e1b3b 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -789,6 +789,13 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_FREE_PAGE_HINT) &&
+        !s->iothread) {
+        error_setg(errp, "'free-page-hint' requires 'iothread' to be set");
+        virtio_cleanup(vdev);
+        return;
+    }
+
     s->ivq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
     s->dvq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
     s->svq = virtio_add_queue(vdev, 128, virtio_balloon_receive_stats);
@@ -797,24 +804,11 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
-        s->free_page_report_cmd_id =
-                           VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-        s->free_page_report_notify.notify =
-                                       virtio_balloon_free_page_report_notify;
         precopy_add_notifier(&s->free_page_report_notify);
-        if (s->iothread) {
-            object_ref(OBJECT(s->iothread));
-            s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
-                                       virtio_ballloon_get_free_page_hints, s);
-            qemu_mutex_init(&s->free_page_lock);
-            qemu_cond_init(&s->free_page_cond);
-            s->block_iothread = false;
-        } else {
-            /* Simply disable this feature if the iothread wasn't created. */
-            s->host_features &= ~(1 << VIRTIO_BALLOON_F_FREE_PAGE_HINT);
-            virtio_error(vdev, "iothread is missing");
-        }
+
+        object_ref(OBJECT(s->iothread));
+        s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
+                                     virtio_ballloon_get_free_page_hints, s);
     }
     reset_stats(s);
 }
@@ -892,6 +886,11 @@ static void virtio_balloon_instance_init(Object *obj)
 {
     VirtIOBalloon *s = VIRTIO_BALLOON(obj);
 
+    qemu_mutex_init(&s->free_page_lock);
+    qemu_cond_init(&s->free_page_cond);
+    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s, NULL);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7913.20911 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNel-0008Fl-NT; Fri, 16 Oct 2020 11:12:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7913.20911; Fri, 16 Oct 2020 11:12:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNel-0008Fe-KP; Fri, 16 Oct 2020 11:12:19 +0000
Received: by outflank-mailman (input) for mailman id 7913;
 Fri, 16 Oct 2020 11:12:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNek-0008FT-Ap
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 99c524d2-765f-42dc-b873-74fe6088cf6f;
 Fri, 16 Oct 2020 11:12:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNei-000231-QM
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNei-0001fZ-Pg
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNek-0008FT-Ap
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:18 +0000
X-Inumbo-ID: 99c524d2-765f-42dc-b873-74fe6088cf6f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 99c524d2-765f-42dc-b873-74fe6088cf6f;
	Fri, 16 Oct 2020 11:12:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9Yr33Q25BYZVxGj1SkguyXmDs8FCtwPX51NKskROqGY=; b=XWITl1h8S6dvM1Lr0gnDs7ds2C
	p3NVQTLM7pI+WUqT1RrqjKTdQmXTYtBohMO164tg2uW6jh4YQuH4TVZzvXgXMSCITAhlFF8F8w9oV
	tif5j9Qctu71Sqnb704yLPKB/l+zRsLgBTBUBc1f+/UKKTCv4nNS8eJKoB+RdZ05d4eQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNei-000231-QM
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNei-0001fZ-Pg
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: fix free page hinting check on unrealize
Message-Id: <E1kTNei-0001fZ-Pg@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:16 +0000

commit 945d9273c8234dcc2f301059fe294df5e722b055
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:38 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:15 2020 -0500

    virtio-balloon: fix free page hinting check on unrealize
    
    Checking against guest features is wrong. We allocated data structures
    based on host features. We can rely on "free_page_bh" as an indicator
    whether to un-do stuff instead.
    
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-3-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 49b01711b8eb3796c6904c7f85d2431572cfe54f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index ef499e1b3b..3e3b5ff0f8 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -818,7 +818,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOBalloon *s = VIRTIO_BALLOON(dev);
 
-    if (virtio_balloon_free_page_support(s)) {
+    if (s->free_page_bh) {
         qemu_bh_delete(s->free_page_bh);
         virtio_balloon_free_page_stop(s);
         precopy_remove_notifier(&s->free_page_report_notify);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7915.20918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeu-0008HY-Qf; Fri, 16 Oct 2020 11:12:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7915.20918; Fri, 16 Oct 2020 11:12:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNeu-0008HO-NL; Fri, 16 Oct 2020 11:12:28 +0000
Received: by outflank-mailman (input) for mailman id 7915;
 Fri, 16 Oct 2020 11:12:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNet-0008HF-Lj
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9a4ca5c6-ac41-4447-b85d-cdc5fe657a94;
 Fri, 16 Oct 2020 11:12:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNes-00023G-Tq
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNes-0001gD-Sh
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNet-0008HF-Lj
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:27 +0000
X-Inumbo-ID: 9a4ca5c6-ac41-4447-b85d-cdc5fe657a94
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9a4ca5c6-ac41-4447-b85d-cdc5fe657a94;
	Fri, 16 Oct 2020 11:12:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XtNCwaMby0Vt1ehW6mankR7Caua1v1q8TbudnkgJcgY=; b=6rDgqDg6EW+43m79NDFUB1xrPB
	etniQyrNhxg65D+fAGghspO0gM56hUlszZq4jq01RT8snqArf0BkM2kvChe4jn7Y1CAzUhG4ci2wV
	cYfreTHT6RjChcshQUFl7Wq0ZsB0TkRpGj1gHu3A/q5x0L8TPypar+AsDJ3OJ1hJSci4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNes-00023G-Tq
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNes-0001gD-Sh
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: unref the iothread when unrealizing
Message-Id: <E1kTNes-0001gD-Sh@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:26 +0000

commit d1cba8ca6039a31c7b75e308cb0b1f3522050aa9
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:39 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:21 2020 -0500

    virtio-balloon: unref the iothread when unrealizing
    
    We took a reference when realizing, so let's drop that reference when
    unrealizing.
    
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-4-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 105aef9c9479786d27c1c45c9b0b1fa03dc46be3)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 3e3b5ff0f8..e20f90dad4 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -820,6 +820,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
 
     if (s->free_page_bh) {
         qemu_bh_delete(s->free_page_bh);
+        object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
         precopy_remove_notifier(&s->free_page_report_notify);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7916.20921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNf4-0008J3-SM; Fri, 16 Oct 2020 11:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7916.20921; Fri, 16 Oct 2020 11:12:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNf4-0008Iv-Ow; Fri, 16 Oct 2020 11:12:38 +0000
Received: by outflank-mailman (input) for mailman id 7916;
 Fri, 16 Oct 2020 11:12:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNf4-0008Ip-8l
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8bc1ef10-3cfb-4c49-be5e-b2cb83dd8400;
 Fri, 16 Oct 2020 11:12:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNf3-00025c-0p
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNf3-0001iK-0D
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNf4-0008Ip-8l
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:38 +0000
X-Inumbo-ID: 8bc1ef10-3cfb-4c49-be5e-b2cb83dd8400
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8bc1ef10-3cfb-4c49-be5e-b2cb83dd8400;
	Fri, 16 Oct 2020 11:12:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6jV6y5KCpkFSa9+pCsHbCAjDUcyxf9lHdDOTLWzDQG8=; b=CkvPYDy3Xz27yteu+EhMdkTdSO
	razR/tknrZ2hWU/xbl1JKnI2TOpAVEi2OCLDwDWzE71wDxF8Ge6Itwmdl3cc6tsCiS2OtepQS3fjU
	vgMOZDYIbV/W2xbjvhi5FyN8iG/ml1t1kp5a1AC2oTOPPxq/KVVMMmxrpG2VHVGGEa7U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNf3-00025c-0p
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNf3-0001iK-0D
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] block: Call attention to truncation of long NBD exports
Message-Id: <E1kTNf3-0001iK-0D@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:37 +0000

commit 4cc0a28a6ed7b7746ea074c4ef60e39212fe1f11
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 8 13:26:38 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:27 2020 -0500

    block: Call attention to truncation of long NBD exports
    
    Commit 93676c88 relaxed our NBD client code to request export names up
    to the NBD protocol maximum of 4096 bytes without NUL terminator, even
    though the block layer can't store anything longer than 4096 bytes
    including NUL terminator for display to the user.  Since this means
    there are some export names where we have to truncate things, we can
    at least try to make the truncation a bit more obvious for the user.
    Note that in spite of the truncated display name, we can still
    communicate with an NBD server using such a long export name; this was
    deemed nicer than refusing to even connect to such a server (since the
    server may not be under our control, and since determining our actual
    length limits gets tricky when nbd://host:port/export and
    nbd+unix:///export?socket=/path are themselves variable-length
    expansions beyond the export name but count towards the block layer
    name length).
    
    Reported-by: Xueqiang Wei <xuwei@redhat.com>
    Fixes: https://bugzilla.redhat.com/1843684
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200610163741.3745251-3-eblake@redhat.com>
    (cherry picked from commit 5c86bdf1208916ece0b87e1151c9b48ee54faa3e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block.c     |  7 +++++--
 block/nbd.c | 21 +++++++++++++--------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/block.c b/block.c
index 2e3905c99e..e7e0a92536 100644
--- a/block.c
+++ b/block.c
@@ -6710,8 +6710,11 @@ void bdrv_refresh_filename(BlockDriverState *bs)
         pstrcpy(bs->filename, sizeof(bs->filename), bs->exact_filename);
     } else {
         QString *json = qobject_to_json(QOBJECT(bs->full_open_options));
-        snprintf(bs->filename, sizeof(bs->filename), "json:%s",
-                 qstring_get_str(json));
+        if (snprintf(bs->filename, sizeof(bs->filename), "json:%s",
+                     qstring_get_str(json)) >= sizeof(bs->filename)) {
+            /* Give user a hint if we truncated things. */
+            strcpy(bs->filename + sizeof(bs->filename) - 4, "...");
+        }
         qobject_unref(json);
     }
 }
diff --git a/block/nbd.c b/block/nbd.c
index 2160859f64..bfc0be6af6 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1986,6 +1986,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
 {
     BDRVNBDState *s = bs->opaque;
     const char *host = NULL, *port = NULL, *path = NULL;
+    size_t len = 0;
 
     if (s->saddr->type == SOCKET_ADDRESS_TYPE_INET) {
         const InetSocketAddress *inet = &s->saddr->u.inet;
@@ -1998,17 +1999,21 @@ static void nbd_refresh_filename(BlockDriverState *bs)
     } /* else can't represent as pseudo-filename */
 
     if (path && s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd+unix:///%s?socket=%s", s->export, path);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd+unix:///%s?socket=%s", s->export, path);
     } else if (path && !s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd+unix://?socket=%s", path);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd+unix://?socket=%s", path);
     } else if (host && s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd://%s:%s/%s", host, port, s->export);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd://%s:%s/%s", host, port, s->export);
     } else if (host && !s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd://%s:%s", host, port);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd://%s:%s", host, port);
+    }
+    if (len > sizeof(bs->exact_filename)) {
+        /* Name is too long to represent exactly, so leave it empty. */
+        bs->exact_filename[0] = '\0';
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7917.20925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfE-0008Ko-Tb; Fri, 16 Oct 2020 11:12:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7917.20925; Fri, 16 Oct 2020 11:12:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfE-0008Ki-Qb; Fri, 16 Oct 2020 11:12:48 +0000
Received: by outflank-mailman (input) for mailman id 7917;
 Fri, 16 Oct 2020 11:12:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNfE-0008Kb-2v
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 666ed04f-ae1c-4aac-b5fd-337027d771ef;
 Fri, 16 Oct 2020 11:12:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfD-00025o-4P
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfD-0001im-31
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNfE-0008Kb-2v
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:48 +0000
X-Inumbo-ID: 666ed04f-ae1c-4aac-b5fd-337027d771ef
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 666ed04f-ae1c-4aac-b5fd-337027d771ef;
	Fri, 16 Oct 2020 11:12:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fHgVv3N1z/3WFUerOpdX91NX0CqfbExseB4H8jGsAaQ=; b=weCxNk79W1Qekq6q3iUFbXs1hP
	SrKlvWnGV2+jPzmOvFd7LZ/MYpfieU87yVqkHsV94V9CUN3lvduQ9Thhd6srXmjms/1h6J+KMphEW
	ELCS4WD959Yv/SZcPsKT9wHI2xB87AJjNEgCZS80/y9ArKA6/62EI2tJGFF7E9NmfQkg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfD-00025o-4P
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfD-0001im-31
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] 9pfs: local: ignore O_NOATIME if we don't have permissions
Message-Id: <E1kTNfD-0001im-31@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:47 +0000

commit e37ba5c637cf55d2f25713f6bcf51052bb2089d6
Author:     Omar Sandoval <osandov@fb.com>
AuthorDate: Thu May 14 08:06:43 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:33 2020 -0500

    9pfs: local: ignore O_NOATIME if we don't have permissions
    
    QEMU's local 9pfs server passes through O_NOATIME from the client. If
    the QEMU process doesn't have permissions to use O_NOATIME (namely, it
    does not own the file nor have the CAP_FOWNER capability), the open will
    fail. This causes issues when from the client's point of view, it
    believes it has permissions to use O_NOATIME (e.g., a process running as
    root in the virtual machine). Additionally, overlayfs on Linux opens
    files on the lower layer using O_NOATIME, so in this case a 9pfs mount
    can't be used as a lower layer for overlayfs (cf.
    https://github.com/osandov/drgn/blob/dabfe1971951701da13863dbe6d8a1d172ad9650/vmtest/onoatimehack.c
    and https://github.com/NixOS/nixpkgs/issues/54509).
    
    Luckily, O_NOATIME is effectively a hint, and is often ignored by, e.g.,
    network filesystems. open(2) notes that O_NOATIME "may not be effective
    on all filesystems. One example is NFS, where the server maintains the
    access time." This means that we can honor it when possible but fall
    back to ignoring it.
    
    Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: Omar Sandoval <osandov@fb.com>
    Message-Id: <e9bee604e8df528584693a4ec474ded6295ce8ad.1587149256.git.osandov@fb.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit a5804fcf7b22fc7d1f9ec794dd284c7d504bd16b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p-util.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
index 79ed6b233e..546f46dc7d 100644
--- a/hw/9pfs/9p-util.h
+++ b/hw/9pfs/9p-util.h
@@ -37,9 +37,22 @@ static inline int openat_file(int dirfd, const char *name, int flags,
 {
     int fd, serrno, ret;
 
+again:
     fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
                 mode);
     if (fd == -1) {
+        if (errno == EPERM && (flags & O_NOATIME)) {
+            /*
+             * The client passed O_NOATIME but we lack permissions to honor it.
+             * Rather than failing the open, fall back without O_NOATIME. This
+             * doesn't break the semantics on the client side, as the Linux
+             * open(2) man page notes that O_NOATIME "may not be effective on
+             * all filesystems". In particular, NFS and other network
+             * filesystems ignore it entirely.
+             */
+            flags &= ~O_NOATIME;
+            goto again;
+        }
         return -1;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:12:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:12:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7918.20928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfO-0008Nj-VQ; Fri, 16 Oct 2020 11:12:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7918.20928; Fri, 16 Oct 2020 11:12:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfO-0008Ne-S9; Fri, 16 Oct 2020 11:12:58 +0000
Received: by outflank-mailman (input) for mailman id 7918;
 Fri, 16 Oct 2020 11:12:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNfN-0008NJ-V1
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c41a1a3-0c05-45b5-8a1f-12e92a9b20f7;
 Fri, 16 Oct 2020 11:12:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfN-00025v-7Y
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfN-0001jO-6p
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNfN-0008NJ-V1
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
X-Inumbo-ID: 2c41a1a3-0c05-45b5-8a1f-12e92a9b20f7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c41a1a3-0c05-45b5-8a1f-12e92a9b20f7;
	Fri, 16 Oct 2020 11:12:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l69ICAHlKpOhZmlzBWaeQbr6bb+wXlkfblvYtrS+wUY=; b=TivsYAAg99EjHgp3d6dRUvqVWc
	+lZalcEQPN+UAmeaJau61MD3WuYhOTsvEVGWouZJq0n6EEhZ2KzUwjEngGPwUEpKonNUiAGpJTNlX
	FOAhZs6Cdz4LYh1aGps2eiLVLPdMqJBPs6r4snHFvPuODtZLrKN3K2TA+xJFa41QSCSo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfN-00025v-7Y
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfN-0001jO-6p
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:12:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] 9pfs: include linux/limits.h for XATTR_SIZE_MAX
Message-Id: <E1kTNfN-0001jO-6p@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:12:57 +0000

commit 5bfdf41d7c12335fd44645cdfa2eb04eb0d15b5b
Author:     Dan Robertson <dan@dlrobertson.com>
AuthorDate: Mon May 25 10:38:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:38 2020 -0500

    9pfs: include linux/limits.h for XATTR_SIZE_MAX
    
    linux/limits.h should be included for the XATTR_SIZE_MAX definition used
    by v9fs_xattrcreate.
    
    Fixes: 3b79ef2cf488 ("9pfs: limit xattr size in xattrcreate")
    Signed-off-by: Dan Robertson <dan@dlrobertson.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200515203015.7090-2-dan@dlrobertson.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 03556ea920b23c466ce7c1283199033de33ee671)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 9e046f7acb..3301e82eb6 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -28,6 +28,7 @@
 #include "sysemu/qtest.h"
 #include "qemu/xxhash.h"
 #include <math.h>
+#include <linux/limits.h>
 
 int open_fd_hw;
 int total_open_fd;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:13:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:13:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7919.20933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfa-0008PB-1j; Fri, 16 Oct 2020 11:13:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7919.20933; Fri, 16 Oct 2020 11:13:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfZ-0008P3-V7; Fri, 16 Oct 2020 11:13:09 +0000
Received: by outflank-mailman (input) for mailman id 7919;
 Fri, 16 Oct 2020 11:13:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNfZ-0008Ox-BR
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b3078c5f-69a6-4d5f-aa5b-11e4cee754bc;
 Fri, 16 Oct 2020 11:13:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfX-00026I-Ae
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfX-0001k1-9n
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNfZ-0008Ox-BR
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:09 +0000
X-Inumbo-ID: b3078c5f-69a6-4d5f-aa5b-11e4cee754bc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b3078c5f-69a6-4d5f-aa5b-11e4cee754bc;
	Fri, 16 Oct 2020 11:13:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wtxOjtI1sa8m+acW2ScbPc7N4qsZrGdoRO9KZUmeb+Q=; b=YRYUiuc5xik06JMDowpfwko+xN
	YmPeorHtj9L3nostUnvCW6n0MwAm8B23CQ8nNztkC9xe7covIc/lbkVjv3J0US1v7ZOrrEMsmg9G6
	qY8rBLSeRPGpfN4+I60FS8gRxrx1JYlHkyOE8ccl09JmkzQon6afx30oY+5wvHzBUFpw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfX-00026I-Ae
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfX-0001k1-9n
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] xen-9pfs: Fix log messages of reply errors
Message-Id: <E1kTNfX-0001k1-9n@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:07 +0000

commit f56a86ad8d5954f21e1f11634a9df1f3d2856152
Author:     Christian Schoenebeck <qemu_oss@crudebyte.com>
AuthorDate: Thu May 14 08:06:43 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:10:58 2020 -0500

    xen-9pfs: Fix log messages of reply errors
    
    If delivery of some 9pfs response fails for some reason, log the
    error message by mentioning the 9P protocol reply type, not by
    client's request type. The latter could be misleading that the
    error occurred already when handling the request input.
    
    Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Message-Id: <ad0e5a9b6abde52502aa40b30661d29aebe1590a.1589132512.git.qemu_oss@crudebyte.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 9bbb7e0fe081efff2e41f8517c256b72a284fe9b)
    *prereq for cf45183b718
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/xen-9p-backend.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 18fe5b7c92..f04caabfe5 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -137,7 +137,8 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
     ret = v9fs_iov_vmarshal(in_sg, num, offset, 0, fmt, ap);
     if (ret < 0) {
         xen_pv_printf(&xen_9pfs->xendev, 0,
-                      "Failed to encode VirtFS request type %d\n", pdu->id + 1);
+                      "Failed to encode VirtFS reply type %d\n",
+                      pdu->id + 1);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
@@ -201,9 +202,9 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
 
     buf_size = iov_size(ring->sg, num);
     if (buf_size  < P9_IOHDRSZ) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
-                "needs %zu bytes, buffer has %zu, less than minimum\n",
-                pdu->id, *size, buf_size);
+        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs "
+                      "%zu bytes, buffer has %zu, less than minimum\n",
+                      pdu->id + 1, *size, buf_size);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:13:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7920.20936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfj-0008RP-3C; Fri, 16 Oct 2020 11:13:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7920.20936; Fri, 16 Oct 2020 11:13:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNfj-0008RI-0O; Fri, 16 Oct 2020 11:13:19 +0000
Received: by outflank-mailman (input) for mailman id 7920;
 Fri, 16 Oct 2020 11:13:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNfi-0008RB-IB
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c0db3354-c91a-408e-b9d9-2fdf5c9fb438;
 Fri, 16 Oct 2020 11:13:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfh-00026Q-E2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfh-0001kc-DH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNfi-0008RB-IB
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:18 +0000
X-Inumbo-ID: c0db3354-c91a-408e-b9d9-2fdf5c9fb438
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c0db3354-c91a-408e-b9d9-2fdf5c9fb438;
	Fri, 16 Oct 2020 11:13:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bGtacksQ0TnmW4nHORL/QAKQO6Y3s+ZaJ+//PFUEX1w=; b=TcX1aE0ef0yTkUfjSFZ7OgXv58
	JGNFTW1KqHHy4bSsue9PHncUMH6wkzgAtfou753JgGM3QuYnahx0yNeBckPoLk52vMHECh5FnHBpf
	Tg4aKfyw8NSkPUwgnzegicCG6DkGV5npIWtvtJRemF16jZnQr3DSWQbW9WgMMCWlmOqs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfh-00026Q-E2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfh-0001kc-DH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] Revert "9p: init_in_iov_from_pdu can truncate the size"
Message-Id: <E1kTNfh-0001kc-DH@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:17 +0000

commit b38d9cada46ba6229ed6c87bf777cecb24af0c6b
Author:     Stefano Stabellini <stefano.stabellini@xilinx.com>
AuthorDate: Thu May 21 12:26:25 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:14 2020 -0500

    Revert "9p: init_in_iov_from_pdu can truncate the size"
    
    This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7.
    It causes https://bugs.launchpad.net/bugs/1877688.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200521192627.15259-1-sstabellini@kernel.org>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit cf45183b718f02b1369e18c795dc51bc1821245d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.c               | 33 +++++++++++----------------------
 hw/9pfs/9p.h               |  2 +-
 hw/9pfs/virtio-9p-device.c | 11 ++++-------
 hw/9pfs/xen-9p-backend.c   | 15 ++++++---------
 4 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 3301e82eb6..1b729af6e8 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2103,29 +2103,22 @@ out_nofid:
  * with qemu_iovec_destroy().
  */
 static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
-                                    size_t skip, size_t *size,
+                                    size_t skip, size_t size,
                                     bool is_write)
 {
     QEMUIOVector elem;
     struct iovec *iov;
     unsigned int niov;
-    size_t alloc_size = *size + skip;
 
     if (is_write) {
-        pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, alloc_size);
+        pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, size + skip);
     } else {
-        pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, &alloc_size);
-    }
-
-    if (alloc_size < skip) {
-        *size = 0;
-    } else {
-        *size = alloc_size - skip;
+        pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, size + skip);
     }
 
     qemu_iovec_init_external(&elem, iov, niov);
     qemu_iovec_init(qiov, niov);
-    qemu_iovec_concat(qiov, &elem, skip, *size);
+    qemu_iovec_concat(qiov, &elem, skip, size);
 }
 
 static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
@@ -2133,14 +2126,15 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
 {
     ssize_t err;
     size_t offset = 7;
-    size_t read_count;
+    uint64_t read_count;
     QEMUIOVector qiov_full;
 
     if (fidp->fs.xattr.len < off) {
         read_count = 0;
-    } else if (fidp->fs.xattr.len - off < max_count) {
-        read_count = fidp->fs.xattr.len - off;
     } else {
+        read_count = fidp->fs.xattr.len - off;
+    }
+    if (read_count > max_count) {
         read_count = max_count;
     }
     err = pdu_marshal(pdu, offset, "d", read_count);
@@ -2149,7 +2143,7 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
     }
     offset += err;
 
-    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &read_count, false);
+    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, read_count, false);
     err = v9fs_pack(qiov_full.iov, qiov_full.niov, 0,
                     ((char *)fidp->fs.xattr.value) + off,
                     read_count);
@@ -2278,11 +2272,9 @@ static void coroutine_fn v9fs_read(void *opaque)
         QEMUIOVector qiov_full;
         QEMUIOVector qiov;
         int32_t len;
-        size_t size = max_count;
 
-        v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, &size, false);
+        v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, max_count, false);
         qemu_iovec_init(&qiov, qiov_full.niov);
-        max_count = size;
         do {
             qemu_iovec_reset(&qiov);
             qemu_iovec_concat(&qiov, &qiov_full, count, qiov_full.size - count);
@@ -2533,7 +2525,6 @@ static void coroutine_fn v9fs_write(void *opaque)
     int32_t len = 0;
     int32_t total = 0;
     size_t offset = 7;
-    size_t size;
     V9fsFidState *fidp;
     V9fsPDU *pdu = opaque;
     V9fsState *s = pdu->s;
@@ -2546,9 +2537,7 @@ static void coroutine_fn v9fs_write(void *opaque)
         return;
     }
     offset += err;
-    size = count;
-    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &size, true);
-    count = size;
+    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true);
     trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov);
 
     fidp = get_fid(pdu, fid);
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index c381fe091a..656527beb9 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -436,7 +436,7 @@ struct V9fsTransport {
     ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
                                   va_list ap);
     void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t *size);
+                                        unsigned int *pniov, size_t size);
     void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
                                          unsigned int *pniov, size_t size);
     void        (*push_and_notify)(V9fsPDU *pdu);
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 536447a355..f821236356 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -147,22 +147,19 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
 }
 
 static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t *size)
+                                        unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
     VirtQueueElement *elem = v->elems[pdu->idx];
     size_t buf_size = iov_size(elem->in_sg, elem->in_num);
 
-    if (buf_size < P9_IOHDRSZ) {
+    if (buf_size < size) {
         VirtIODevice *vdev = VIRTIO_DEVICE(v);
 
         virtio_error(vdev,
-                     "VirtFS reply type %d needs %zu bytes, buffer has %zu, less than minimum",
-                     pdu->id + 1, *size, buf_size);
-    }
-    if (buf_size < *size) {
-        *size = buf_size;
+                     "VirtFS reply type %d needs %zu bytes, buffer has %zu",
+                     pdu->id + 1, size, buf_size);
     }
 
     *piov = elem->in_sg;
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index f04caabfe5..fc197f6c8a 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -188,7 +188,7 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
 static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
                                           struct iovec **piov,
                                           unsigned int *pniov,
-                                          size_t *size)
+                                          size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -198,19 +198,16 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
     g_free(ring->sg);
 
     ring->sg = g_new0(struct iovec, 2);
-    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, *size);
+    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
 
     buf_size = iov_size(ring->sg, num);
-    if (buf_size  < P9_IOHDRSZ) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs "
-                      "%zu bytes, buffer has %zu, less than minimum\n",
-                      pdu->id + 1, *size, buf_size);
+    if (buf_size  < size) {
+        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
+                "needs %zu bytes, buffer has %zu\n", pdu->id, size,
+                buf_size);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
-    if (buf_size  < *size) {
-        *size = buf_size;
-    }
 
     *piov = ring->sg;
     *pniov = num;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:13:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:13:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7921.20940 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNft-0008Sq-5B; Fri, 16 Oct 2020 11:13:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7921.20940; Fri, 16 Oct 2020 11:13:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNft-0008Sh-23; Fri, 16 Oct 2020 11:13:29 +0000
Received: by outflank-mailman (input) for mailman id 7921;
 Fri, 16 Oct 2020 11:13:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNfs-0008SZ-CM
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 15f9c4c9-9e82-40ce-8de9-6680e5f83345;
 Fri, 16 Oct 2020 11:13:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfr-00026a-Gs
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNfr-0001l5-GI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNfs-0008SZ-CM
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:28 +0000
X-Inumbo-ID: 15f9c4c9-9e82-40ce-8de9-6680e5f83345
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 15f9c4c9-9e82-40ce-8de9-6680e5f83345;
	Fri, 16 Oct 2020 11:13:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q5zbAWEC+iPja0dYNiAt98wVXWh8rbJc/CBjcDADeFI=; b=mYkbf5l8p3aOHmPwv7hnX1wOK5
	ZNcuycDbyHkDcAioUr6z8GJHPUG7NpmTNZTdb5tzoqy1AZYZ2nl/dapDWILIYi/aS1UWOEHZQi/Lq
	u2WJbtlgT+w4K5reIPI9dI/WdqrVKu86X7clCVpH3STtrxAJ9ZOHnQQucz9BUxv5oKsE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfr-00026a-Gs
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNfr-0001l5-GI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] xen/9pfs: yield when there isn't enough room on the ring
Message-Id: <E1kTNfr-0001l5-GI@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:27 +0000

commit cb84d9d353d40dbcd02fd8ff2c83971ecac0e65b
Author:     Stefano Stabellini <stefano.stabellini@xilinx.com>
AuthorDate: Thu May 21 12:26:26 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:22 2020 -0500

    xen/9pfs: yield when there isn't enough room on the ring
    
    Instead of truncating replies, which is problematic, wait until the
    client reads more data and frees bytes on the reply ring.
    
    Do that by calling qemu_coroutine_yield(). The corresponding
    qemu_coroutine_enter_if_inactive() is called from xen_9pfs_bh upon
    receiving the next notification from the client.
    
    We need to be careful to avoid races in case xen_9pfs_bh and the
    coroutine are both active at the same time. In xen_9pfs_bh, wait until
    either the critical section is over (ring->co == NULL) or until the
    coroutine becomes inactive (qemu_coroutine_yield() was called) before
    continuing. Then, simply wake up the coroutine if it is inactive.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200521192627.15259-2-sstabellini@kernel.org>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit a4c4d462729466c4756bac8a0a8d77eb63b21ef7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/xen-9p-backend.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index fc197f6c8a..3c84c86ab8 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -37,6 +37,7 @@ typedef struct Xen9pfsRing {
 
     struct iovec *sg;
     QEMUBH *bh;
+    Coroutine *co;
 
     /* local copies, so that we can read/write PDU data directly from
      * the ring */
@@ -198,16 +199,20 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
     g_free(ring->sg);
 
     ring->sg = g_new0(struct iovec, 2);
-    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
+    ring->co = qemu_coroutine_self();
+    /* make sure other threads see ring->co changes before continuing */
+    smp_wmb();
 
+again:
+    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
     buf_size = iov_size(ring->sg, num);
     if (buf_size  < size) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
-                "needs %zu bytes, buffer has %zu\n", pdu->id, size,
-                buf_size);
-        xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
-        xen_9pfs_disconnect(&xen_9pfs->xendev);
+        qemu_coroutine_yield();
+        goto again;
     }
+    ring->co = NULL;
+    /* make sure other threads see ring->co changes before continuing */
+    smp_wmb();
 
     *piov = ring->sg;
     *pniov = num;
@@ -292,6 +297,20 @@ static int xen_9pfs_receive(Xen9pfsRing *ring)
 static void xen_9pfs_bh(void *opaque)
 {
     Xen9pfsRing *ring = opaque;
+    bool wait;
+
+again:
+    wait = ring->co != NULL && qemu_coroutine_entered(ring->co);
+    /* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
+    smp_rmb();
+    if (wait) {
+        cpu_relax();
+        goto again;
+    }
+
+    if (ring->co != NULL) {
+        qemu_coroutine_enter_if_inactive(ring->co);
+    }
     xen_9pfs_receive(ring);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:13:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:13:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7922.20945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNg4-0008U8-6x; Fri, 16 Oct 2020 11:13:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7922.20945; Fri, 16 Oct 2020 11:13:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNg4-0008Tz-3e; Fri, 16 Oct 2020 11:13:40 +0000
Received: by outflank-mailman (input) for mailman id 7922;
 Fri, 16 Oct 2020 11:13:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNg2-0008Tp-UF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 333e09f0-bcd4-4738-9332-809a535c4ee7;
 Fri, 16 Oct 2020 11:13:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNg1-000278-K1
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNg1-0001ll-JG
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNg2-0008Tp-UF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:38 +0000
X-Inumbo-ID: 333e09f0-bcd4-4738-9332-809a535c4ee7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 333e09f0-bcd4-4738-9332-809a535c4ee7;
	Fri, 16 Oct 2020 11:13:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dOoLsGoFdZiG+DmjWY/FtJPoBpjUwDJlcsb/qpjhEn4=; b=MGqlypiLgvXNxpGF2WDY+Ipcz+
	zgY29a5OuTyzBey5xQml0dyk2iM/0FvgWDU7EcjdAyFAjM2S6sN9Xt1ErdIvadABmtXHgdmR6CvDm
	jZ0JKAvUO8trWpXrBtOQFgZ8w/bGI1HZjO7sjwl25/b8Dm2C6yTKX1NY263KZdFm9M94=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNg1-000278-K1
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNg1-0001ll-JG
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] ati-vga: check mm_index before recursive call (CVE-2020-13800)
Message-Id: <E1kTNg1-0001ll-JG@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:37 +0000

commit 387a3ac89d5cc821c4064295122dc3183b6aca69
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jun 4 14:38:30 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:52 2020 -0500

    ati-vga: check mm_index before recursive call (CVE-2020-13800)
    
    While accessing VGA registers via ati_mm_read/write routines,
    a guest may set 's->regs.mm_index' such that it leads to infinite
    recursion. Check mm_index value to avoid such recursion. Log an
    error message for wrong values.
    
    Reported-by: Ren Ding <rding@gatech.edu>
    Reported-by: Hanqing Zhao <hanqing@gatech.edu>
    Reported-by: Yi Ren <c4tren@gmail.com>
    Message-id: 20200604090830.33885-1-ppandit@redhat.com
    Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
    Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit a98610c429d52db0937c1e48659428929835c455)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/display/ati.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/display/ati.c b/hw/display/ati.c
index 58ec8291d4..9228f1b242 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -285,8 +285,11 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
             if (idx <= s->vga.vram_size - size) {
                 val = ldn_le_p(s->vga.vram_ptr + idx, size);
             }
-        } else {
+        } else if (s->regs.mm_index > MM_DATA + 3) {
             val = ati_mm_read(s, s->regs.mm_index + addr - MM_DATA, size);
+        } else {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                "ati_mm_read: mm_index too small: %u\n", s->regs.mm_index);
         }
         break;
     case BIOS_0_SCRATCH ... BUS_CNTL - 1:
@@ -520,8 +523,11 @@ static void ati_mm_write(void *opaque, hwaddr addr,
             if (idx <= s->vga.vram_size - size) {
                 stn_le_p(s->vga.vram_ptr + idx, size, data);
             }
-        } else {
+        } else if (s->regs.mm_index > MM_DATA + 3) {
             ati_mm_write(s, s->regs.mm_index + addr - MM_DATA, data, size);
+        } else {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                "ati_mm_write: mm_index too small: %u\n", s->regs.mm_index);
         }
         break;
     case BIOS_0_SCRATCH ... BUS_CNTL - 1:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:13:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:13:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7923.20949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgE-0008W0-98; Fri, 16 Oct 2020 11:13:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7923.20949; Fri, 16 Oct 2020 11:13:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgE-0008Vs-5C; Fri, 16 Oct 2020 11:13:50 +0000
Received: by outflank-mailman (input) for mailman id 7923;
 Fri, 16 Oct 2020 11:13:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNgC-0008Vi-Rm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d4bcf697-b1a4-432b-a06a-9332c4b2046b;
 Fri, 16 Oct 2020 11:13:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgB-00027L-Sa
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgB-0001mq-ML
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNgC-0008Vi-Rm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:48 +0000
X-Inumbo-ID: d4bcf697-b1a4-432b-a06a-9332c4b2046b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d4bcf697-b1a4-432b-a06a-9332c4b2046b;
	Fri, 16 Oct 2020 11:13:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FO3Lqy4AVcaYUtGpFaL9gCrpULo71b5GanXSI7ulqLU=; b=y5fVIOM/SPrI6coOBv5jKAbIKs
	iph7FlcR9YQyLkfZp8hZmhunYNznuP5biLXcyHdCoWXZz32hqOFjwZHiOlem0TdouRyT0yayAE7r9
	1D48NlFh/YQhmtFXATwEzgvRJupIyXBjRN+uZN+bm6vpXQAtIjvXg8TmCbnr6uYJywmk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgB-00027L-Sa
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgB-0001mq-ML
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] es1370: check total frame count against current frame
Message-Id: <E1kTNgB-0001mq-ML@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:47 +0000

commit dd506af071328eae57995eacc4aa4128c5f6d8c8
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Fri May 15 01:36:08 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:59 2020 -0500

    es1370: check total frame count against current frame
    
    A guest user may set channel frame count via es1370_write()
    such that, in es1370_transfer_audio(), total frame count
    'size' is lesser than the number of frames that are processed
    'cnt'.
    
        int cnt = d->frame_cnt >> 16;
        int size = d->frame_cnt & 0xffff;
    
    if (size < cnt), it results in incorrect calculations leading
    to OOB access issue(s). Add check to avoid it.
    
    Reported-by: Ren Ding <rding@gatech.edu>
    Reported-by: Hanqing Zhao <hanqing@gatech.edu>
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Message-id: 20200514200608.1744203-1-ppandit@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 369ff955a8497988d079c4e3fa1e93c2570c1c69)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/audio/es1370.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 89c4dabcd4..5f8a83ff56 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -643,6 +643,9 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     int csc_bytes = (csc + 1) << d->shift;
     int cnt = d->frame_cnt >> 16;
     int size = d->frame_cnt & 0xffff;
+    if (size < cnt) {
+        return;
+    }
     int left = ((size - cnt + 1) << 2) + d->leftover;
     int transferred = 0;
     int temp = MIN (max, MIN (left, csc_bytes));
@@ -651,7 +654,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     addr += (cnt << 2) + d->leftover;
 
     if (index == ADC_CHANNEL) {
-        while (temp) {
+        while (temp > 0) {
             int acquired, to_copy;
 
             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
@@ -669,7 +672,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     else {
         SWVoiceOut *voice = s->dac_voice[index];
 
-        while (temp) {
+        while (temp > 0) {
             int copied, to_copy;
 
             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7924.20952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgO-00005o-CV; Fri, 16 Oct 2020 11:14:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7924.20952; Fri, 16 Oct 2020 11:14:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgO-00005e-9Z; Fri, 16 Oct 2020 11:14:00 +0000
Received: by outflank-mailman (input) for mailman id 7924;
 Fri, 16 Oct 2020 11:13:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNgN-00005V-I4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5197532c-6108-4b68-854e-baf560e16fbc;
 Fri, 16 Oct 2020 11:13:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgL-00027S-VU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgL-0001np-Ut
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNgN-00005V-I4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:59 +0000
X-Inumbo-ID: 5197532c-6108-4b68-854e-baf560e16fbc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5197532c-6108-4b68-854e-baf560e16fbc;
	Fri, 16 Oct 2020 11:13:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3jmpy3Ky4AZVlIX1M9Jq2goKuOyMoC8xPz7MmYw7F8Y=; b=nenzP6VRvxE0gJZg4Rfx/OfqRl
	z76DpJMYN6m80r7EU6JvbgD1klCNn9x7ECKznpChR9CxUISlpWxbeGMDtNpyhWK34URxczmvKkdz9
	pxWEBjGxGSq6O2aYgjv92my+WwYr7DWRkTuG7FP0UiDuyGZXiGmAo9cMJAhMiOVxmuWA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgL-00027S-VU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgL-0001np-Ut
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:13:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] Fix tulip breakage
Message-Id: <E1kTNgL-0001np-Ut@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:13:57 +0000

commit d723a57acd985cf5c9fdf8a2761d1ca53a3179c0
Author:     Helge Deller <deller@gmx.de>
AuthorDate: Sun Apr 26 12:55:39 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:12:04 2020 -0500

    Fix tulip breakage
    
    The tulip network driver in a qemu-system-hppa emulation is broken in
    the sense that bigger network packages aren't received any longer and
    thus even running e.g. "apt update" inside the VM fails.
    
    The breakage was introduced by commit 8ffb7265af ("check frame size and
    r/w data length") which added checks to prevent accesses outside of the
    rx/tx buffers.
    
    But the new checks were implemented wrong. The variable rx_frame_len
    counts backwards, from rx_frame_size down to zero, and the variable len
    is never bigger than rx_frame_len, so accesses just can't happen and the
    checks are unnecessary.
    On the contrary the checks now prevented bigger packages to be moved
    into the rx buffers.
    
    This patch reverts the wrong checks and were sucessfully tested with a
    qemu-system-hppa emulation.
    
    Fixes: 8ffb7265af ("check frame size and r/w data length")
    Buglink: https://bugs.launchpad.net/bugs/1874539
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit d9b69640391618045949f7c500b87fc129f862ed)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/tulip.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/net/tulip.c b/hw/net/tulip.c
index 1295f51d07..44db56447c 100644
--- a/hw/net/tulip.c
+++ b/hw/net/tulip.c
@@ -171,9 +171,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
             len = s->rx_frame_len;
         }
 
-        if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
-            return;
-        }
         pci_dma_write(&s->dev, desc->buf_addr1, s->rx_frame +
             (s->rx_frame_size - s->rx_frame_len), len);
         s->rx_frame_len -= len;
@@ -186,9 +183,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
             len = s->rx_frame_len;
         }
 
-        if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
-            return;
-        }
         pci_dma_write(&s->dev, desc->buf_addr2, s->rx_frame +
             (s->rx_frame_size - s->rx_frame_len), len);
         s->rx_frame_len -= len;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7925.20957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgY-00007H-Du; Fri, 16 Oct 2020 11:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7925.20957; Fri, 16 Oct 2020 11:14:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgY-000079-B2; Fri, 16 Oct 2020 11:14:10 +0000
Received: by outflank-mailman (input) for mailman id 7925;
 Fri, 16 Oct 2020 11:14:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNgW-00006p-SW
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3c85edf3-4dd2-4190-a5a6-b93bdc44ae55;
 Fri, 16 Oct 2020 11:14:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgW-00027u-2y
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgW-0001p3-1U
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNgW-00006p-SW
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
X-Inumbo-ID: 3c85edf3-4dd2-4190-a5a6-b93bdc44ae55
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3c85edf3-4dd2-4190-a5a6-b93bdc44ae55;
	Fri, 16 Oct 2020 11:14:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kcqeYITYdQC/BYQDimzI8BYhNgw+Qj7w/tQGe3ourTs=; b=KjmCj/xo99dnr0ii7db0W8p+PP
	oghg6h7JlvZAw3zYsOgLODhIkS5e5r5XyN3XS9tFKKaOUNAjJLZnTnoPcXHIGsufYJG/uN6FUsDoi
	kQqVg+8I/WfLL13QEbfmrqyd0zGCExITZS7a5FuJgvrN1Xz41ATSFhoUoaYyvf4xpcxo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgW-00027u-2y
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgW-0001p3-1U
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] iotests/283: Use consistent size for source and target
Message-Id: <E1kTNgW-0001p3-1U@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:08 +0000

commit 73a01bc9b0351b45ba06c327d5c54025a9aaa0b7
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Apr 30 16:27:52 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:12:11 2020 -0500

    iotests/283: Use consistent size for source and target
    
    The test case forgot to specify the null-co size for the target node.
    When adding a check to backup that both sizes match, this would fail
    because of the size mismatch and not the behaviour that the test really
    wanted to test.
    
    Fixes: a541fcc27c98b96da187c7d4573f3270f3ddd283
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200430142755.315494-2-kwolf@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 813cc2545b82409fd504509f0ba2e96fab6edb9e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qemu-iotests/283     | 6 +++++-
 tests/qemu-iotests/283.out | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283
index 55b7cff953..44de76effe 100644
--- a/tests/qemu-iotests/283
+++ b/tests/qemu-iotests/283
@@ -72,7 +72,11 @@ to check that crash is fixed :)
 vm = iotests.VM()
 vm.launch()
 
-vm.qmp_log('blockdev-add', **{'node-name': 'target', 'driver': 'null-co'})
+vm.qmp_log('blockdev-add', **{
+    'node-name': 'target',
+    'driver': 'null-co',
+    'size': size,
+})
 
 vm.qmp_log('blockdev-add', **{
     'node-name': 'source',
diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out
index daaf5828c1..d8cff22cc1 100644
--- a/tests/qemu-iotests/283.out
+++ b/tests/qemu-iotests/283.out
@@ -1,4 +1,4 @@
-{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target"}}
+{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target", "size": 1048576}}
 {"return": {}}
 {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": {"driver": "null-co", "node-name": "base", "size": 1048576}, "node-name": "source"}}
 {"return": {}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7926.20961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgi-00008g-Fj; Fri, 16 Oct 2020 11:14:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7926.20961; Fri, 16 Oct 2020 11:14:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgi-00008X-CX; Fri, 16 Oct 2020 11:14:20 +0000
Received: by outflank-mailman (input) for mailman id 7926;
 Fri, 16 Oct 2020 11:14:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNgh-00008K-6X
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fa22536c-f767-4c43-b2aa-5c9d29d25e2b;
 Fri, 16 Oct 2020 11:14:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgg-000282-6H
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgg-0001qK-5Y
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNgh-00008K-6X
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:19 +0000
X-Inumbo-ID: fa22536c-f767-4c43-b2aa-5c9d29d25e2b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fa22536c-f767-4c43-b2aa-5c9d29d25e2b;
	Fri, 16 Oct 2020 11:14:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WBQPzPQi1641Ynr8kwqkAsXTmwZLBCsYapkpx9j03II=; b=bkweTJkRUF6zukGTtV+EMKw3ar
	hTxp5unD6cXm4s6ZyS4bPvPVjjsbIzrUDohNm4uBhnUIcrcpxNLMSwQgNmvYlCVcEsZGDpEvXeqaJ
	kpjv5CrMa3NotkQKxP/eHEhPKv8Z1S71StNqQj/YkrVHsBDBMeo1Um7jYYtgxMGjdnXA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgg-000282-6H
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgg-0001qK-5Y
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtiofsd: add --rlimit-nofile=NUM option
Message-Id: <E1kTNgg-0001qK-5Y@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:18 +0000

commit a637ea0c5298af9e10f5cfe659dc9093d4d7bc9c
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Fri May 1 15:06:43 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 20:18:23 2020 -0500

    virtiofsd: add --rlimit-nofile=NUM option
    
    Make it possible to specify the RLIMIT_NOFILE on the command-line.
    Users running multiple virtiofsd processes should allocate a certain
    number to each process so that the system-wide limit can never be
    exhausted.
    
    When this option is set to 0 the rlimit is left at its current value.
    This is useful when a management tool wants to configure the rlimit
    itself.
    
    The default behavior remains unchanged: try to set the limit to
    1,000,000 file descriptors if the current rlimit is lower.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200501140644.220940-2-stefanha@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 6dbb716877728ce4eb51619885ef6ef4ada9565f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/fuse_lowlevel.h  |  1 +
 tools/virtiofsd/helper.c         | 23 +++++++++++++++++++++++
 tools/virtiofsd/passthrough_ll.c | 22 ++++++++--------------
 3 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
index 8f6d705b5c..562fd5241e 100644
--- a/tools/virtiofsd/fuse_lowlevel.h
+++ b/tools/virtiofsd/fuse_lowlevel.h
@@ -1777,6 +1777,7 @@ struct fuse_cmdline_opts {
     int syslog;
     int log_level;
     unsigned int max_idle_threads;
+    unsigned long rlimit_nofile;
 };
 
 /**
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 819c2bc13c..dc59f38af0 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -23,6 +23,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/param.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 #include <unistd.h>
 
 #define FUSE_HELPER_OPT(t, p)                       \
@@ -53,6 +55,7 @@ static const struct fuse_opt fuse_helper_opts[] = {
     FUSE_HELPER_OPT("subtype=", nodefault_subtype),
     FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP),
     FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads),
+    FUSE_HELPER_OPT("--rlimit-nofile=%lu", rlimit_nofile),
     FUSE_HELPER_OPT("--syslog", syslog),
     FUSE_HELPER_OPT_VALUE("log_level=debug", log_level, FUSE_LOG_DEBUG),
     FUSE_HELPER_OPT_VALUE("log_level=info", log_level, FUSE_LOG_INFO),
@@ -171,6 +174,9 @@ void fuse_cmdline_help(void)
            "                               default: no_writeback\n"
            "    -o xattr|no_xattr          enable/disable xattr\n"
            "                               default: no_xattr\n"
+           "    --rlimit-nofile=<num>      set maximum number of file descriptors\n"
+           "                               (0 leaves rlimit unchanged)\n"
+           "                               default: 1,000,000 if the current rlimit is lower\n"
            );
 }
 
@@ -191,11 +197,28 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
     }
 }
 
+static unsigned long get_default_rlimit_nofile(void)
+{
+    rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */
+    struct rlimit rlim;
+
+    if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
+        fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
+        exit(1);
+    }
+
+    if (rlim.rlim_cur >= max_fds) {
+        return 0; /* we have more fds available than required! */
+    }
+    return max_fds;
+}
+
 int fuse_parse_cmdline(struct fuse_args *args, struct fuse_cmdline_opts *opts)
 {
     memset(opts, 0, sizeof(struct fuse_cmdline_opts));
 
     opts->max_idle_threads = 10;
+    opts->rlimit_nofile = get_default_rlimit_nofile();
     opts->foreground = 1;
 
     if (fuse_opt_parse(args, opts, fuse_helper_opts, fuse_helper_opt_proc) ==
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 4c35c95b25..f7b9c1d20c 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -2707,24 +2707,18 @@ static void setup_sandbox(struct lo_data *lo, struct fuse_session *se,
     setup_seccomp(enable_syslog);
 }
 
-/* Raise the maximum number of open file descriptors */
-static void setup_nofile_rlimit(void)
+/* Set the maximum number of open file descriptors */
+static void setup_nofile_rlimit(unsigned long rlimit_nofile)
 {
-    const rlim_t max_fds = 1000000;
-    struct rlimit rlim;
-
-    if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
-        fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
-        exit(1);
-    }
+    struct rlimit rlim = {
+        .rlim_cur = rlimit_nofile,
+        .rlim_max = rlimit_nofile,
+    };
 
-    if (rlim.rlim_cur >= max_fds) {
+    if (rlimit_nofile == 0) {
         return; /* nothing to do */
     }
 
-    rlim.rlim_cur = max_fds;
-    rlim.rlim_max = max_fds;
-
     if (setrlimit(RLIMIT_NOFILE, &rlim) < 0) {
         /* Ignore SELinux denials */
         if (errno == EPERM) {
@@ -2977,7 +2971,7 @@ int main(int argc, char *argv[])
 
     fuse_daemonize(opts.foreground);
 
-    setup_nofile_rlimit();
+    setup_nofile_rlimit(opts.rlimit_nofile);
 
     /* Must be before sandbox since it wants /proc */
     setup_capng();
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7927.20965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgt-0000A2-Gv; Fri, 16 Oct 2020 11:14:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7927.20965; Fri, 16 Oct 2020 11:14:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNgt-00009u-E2; Fri, 16 Oct 2020 11:14:31 +0000
Received: by outflank-mailman (input) for mailman id 7927;
 Fri, 16 Oct 2020 11:14:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNgr-00009j-R2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 56d597c5-adbc-48b6-860d-c377a0b829f1;
 Fri, 16 Oct 2020 11:14:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgq-00028p-98
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNgq-0001rJ-8W
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNgr-00009j-R2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:29 +0000
X-Inumbo-ID: 56d597c5-adbc-48b6-860d-c377a0b829f1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 56d597c5-adbc-48b6-860d-c377a0b829f1;
	Fri, 16 Oct 2020 11:14:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4HiFykUwyjyMi726GRKZvxmPi4MdJjPXJPoX5iNczDE=; b=q3KhG1LGKgAkkhq/ax2eMItNUs
	A4pa1ur0e9nBftcNUxYoyV950MoWLRfYY67oikLRzLFNDULd/nUcUaeN28lKM9ql7822wA/ctPsn5
	V6rkfAUppg8/ZaJ75LZ+OmcxfuYHHt2OKJ/H1S7+GzvS7A4VR3CdORXx4tfaMZhTbc0w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgq-00028p-98
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNgq-0001rJ-8W
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)
Message-Id: <E1kTNgq-0001rJ-8W@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:28 +0000

commit c1abbd0f047e81ea5441baa586c5e3e9901318aa
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Fri May 1 15:06:44 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 20:18:30 2020 -0500

    virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)
    
    The system-wide fs.file-max sysctl value determines how many files can
    be open.  It defaults to a value calculated based on the machine's RAM
    size.  Previously virtiofsd would try to set RLIMIT_NOFILE to 1,000,000
    and this allowed the FUSE client to exhaust the number of open files
    system-wide on Linux hosts with less than 10 GB of RAM!
    
    Take fs.file-max into account when choosing the default RLIMIT_NOFILE
    value.
    
    Fixes: CVE-2020-10717
    Reported-by: Yuval Avrahami <yavrahami@paloaltonetworks.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200501140644.220940-3-stefanha@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 8c1d353d107b4fc344e27f2f08ea7fa25de2eea2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/helper.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index dc59f38af0..00a1ef666a 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -176,7 +176,8 @@ void fuse_cmdline_help(void)
            "                               default: no_xattr\n"
            "    --rlimit-nofile=<num>      set maximum number of file descriptors\n"
            "                               (0 leaves rlimit unchanged)\n"
-           "                               default: 1,000,000 if the current rlimit is lower\n"
+           "                               default: min(1000000, fs.file-max - 16384)\n"
+           "                                        if the current rlimit is lower\n"
            );
 }
 
@@ -199,9 +200,32 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
 
 static unsigned long get_default_rlimit_nofile(void)
 {
+    g_autofree gchar *file_max_str = NULL;
+    const rlim_t reserved_fds = 16384; /* leave at least this many fds free */
     rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */
+    rlim_t file_max;
     struct rlimit rlim;
 
+    /*
+     * Reduce max_fds below the system-wide maximum, if necessary.  This
+     * ensures there are fds available for other processes so we don't
+     * cause resource exhaustion.
+     */
+    if (!g_file_get_contents("/proc/sys/fs/file-max", &file_max_str,
+                             NULL, NULL)) {
+        fuse_log(FUSE_LOG_ERR, "can't read /proc/sys/fs/file-max\n");
+        exit(1);
+    }
+    file_max = g_ascii_strtoull(file_max_str, NULL, 10);
+    if (file_max < 2 * reserved_fds) {
+        fuse_log(FUSE_LOG_ERR,
+                 "The fs.file-max sysctl is too low (%lu) to allow a "
+                 "reasonable number of open files.\n",
+                 (unsigned long)file_max);
+        exit(1);
+    }
+    max_fds = MIN(file_max - reserved_fds, max_fds);
+
     if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
         fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
         exit(1);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7928.20969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNh2-0000BO-Id; Fri, 16 Oct 2020 11:14:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7928.20969; Fri, 16 Oct 2020 11:14:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNh2-0000BE-FV; Fri, 16 Oct 2020 11:14:40 +0000
Received: by outflank-mailman (input) for mailman id 7928;
 Fri, 16 Oct 2020 11:14:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNh1-0000B5-50
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e37422d5-464e-41e6-955e-40e508c8add0;
 Fri, 16 Oct 2020 11:14:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNh0-00028w-C6
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNh0-0001sL-BL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNh1-0000B5-50
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:39 +0000
X-Inumbo-ID: e37422d5-464e-41e6-955e-40e508c8add0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e37422d5-464e-41e6-955e-40e508c8add0;
	Fri, 16 Oct 2020 11:14:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dmXp0PsgP99I5TmDCnBeWB+UXY6hNNFxCZANgVz5u6Q=; b=OlATG0bBvbud3PqA6fVapilHxH
	QIoVCZszeMkMvSi1G9MmHIFGr79PEiFpzziKvlxhYLwuywP1vSeDAMf+U2ZqCXyPguR38Iame5Vl+
	3bSCqyNOfDq3qFmsFYHpgqQ+a2LR+TgLycUhZ0P3a1u4Qxzfmvdd/vTCckPLZf3Kmqxc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNh0-00028w-C6
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNh0-0001sL-BL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
Message-Id: <E1kTNh0-0001sL-BL@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:38 +0000

commit 521898ac31a76c930bf8f213d8cdb0233da7a9ff
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Mon May 11 12:04:53 2020 +0800
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 21:03:02 2020 -0500

    net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
    
    The sender of packet will be checked in the qemu_net_queue_purge() but
    we use NetClientState not its peer when trying to purge the incoming
    queue in qemu_flush_or_purge_packets(). This will trigger the assert
    in virtio_net_reset since we can't pass the sender check:
    
    hw/net/virtio-net.c:533: void virtio_net_reset(VirtIODevice *): Assertion
    `!virtio_net_get_subqueue(nc)->async_tx.elem' failed.
    #9 0x55a33fa31b78 in virtio_net_reset hw/net/virtio-net.c:533:13
    #10 0x55a33fc88412 in virtio_reset hw/virtio/virtio.c:1919:9
    #11 0x55a341d82764 in virtio_bus_reset hw/virtio/virtio-bus.c:95:9
    #12 0x55a341dba2de in virtio_pci_reset hw/virtio/virtio-pci.c:1824:5
    #13 0x55a341db3e02 in virtio_pci_common_write hw/virtio/virtio-pci.c:1252:13
    #14 0x55a33f62117b in memory_region_write_accessor memory.c:496:5
    #15 0x55a33f6205e4 in access_with_adjusted_size memory.c:557:18
    #16 0x55a33f61e177 in memory_region_dispatch_write memory.c:1488:16
    
    Reproducer:
    https://www.mail-archive.com/qemu-devel@nongnu.org/msg701914.html
    
    Fix by using the peer.
    
    Reported-by: "Alexander Bulekov" <alxndr@bu.edu>
    Acked-by: Alexander Bulekov <alxndr@bu.edu>
    Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop")
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit 5fe19fb81839ea42b592b409f725349cf3c73551)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index cbeeeadff8..4c62b10acd 100644
--- a/net/net.c
+++ b/net/net.c
@@ -610,7 +610,7 @@ void qemu_flush_or_purge_queued_packets(NetClientState *nc, bool purge)
         qemu_notify_event();
     } else if (purge) {
         /* Unable to empty the queue, purge remaining packets */
-        qemu_net_queue_purge(nc->incoming_queue, nc);
+        qemu_net_queue_purge(nc->incoming_queue, nc->peer);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:14:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:14:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7929.20973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhC-0000DO-L2; Fri, 16 Oct 2020 11:14:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7929.20973; Fri, 16 Oct 2020 11:14:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhC-0000DE-H9; Fri, 16 Oct 2020 11:14:50 +0000
Received: by outflank-mailman (input) for mailman id 7929;
 Fri, 16 Oct 2020 11:14:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhB-0000D4-C4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9dddd48a-6dde-4c1b-ae26-4fd2231dd69d;
 Fri, 16 Oct 2020 11:14:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhA-000294-Fl
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhA-0001tc-Eu
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhB-0000D4-C4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:49 +0000
X-Inumbo-ID: 9dddd48a-6dde-4c1b-ae26-4fd2231dd69d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9dddd48a-6dde-4c1b-ae26-4fd2231dd69d;
	Fri, 16 Oct 2020 11:14:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9AyE2Dv75DLBOMnfVYN7z7RbOXfjedJU/Ribo4Z64Us=; b=oqpXlC0Obp8TPpBDQF60xMBJd/
	3CNky1EWNauN/XlsffUa6Kzzpwz3bMJOdU9jOvAMVgVOB5E/Zh2ddWD+7HPOIsHN1nZ7Bpji4PLl4
	2TRBcLP98m79E//gp+mL8qAopMuexKjghcAqKo/lb71k/RC9+6fiZpbbN/JwrrlRoMfA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhA-000294-Fl
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhA-0001tc-Eu
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] KVM: x86: believe what KVM says about WAITPKG
Message-Id: <E1kTNhA-0001tc-Eu@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:48 +0000

commit 458ae56d22a78d84135fd5dfe8e837be83d74ce9
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 30 09:49:27 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:29:24 2020 -0500

    KVM: x86: believe what KVM says about WAITPKG
    
    Currently, QEMU is overriding KVM_GET_SUPPORTED_CPUID's answer for
    the WAITPKG bit depending on the "-overcommit cpu-pm" setting.  This is a
    bad idea because it does not even check if the host supports it, but it
    can be done in x86_cpu_realizefn just like we do for the MONITOR bit.
    
    This patch moves it there, while making it conditional on host
    support for the related UMWAIT MSR.
    
    Cc: qemu-stable@nongnu.org
    Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit e1e43813e7908b063938a3d01f172f88f6190c80)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/i386/cpu.c      |  3 +++
 target/i386/kvm.c      | 11 +++++------
 target/i386/kvm_i386.h |  1 +
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 90ffc5f3b1..471db0724f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6491,6 +6491,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
             host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx,
                        &cpu->mwait.ecx, &cpu->mwait.edx);
             env->features[FEAT_1_ECX] |= CPUID_EXT_MONITOR;
+            if (kvm_enabled() && kvm_has_waitpkg()) {
+                env->features[FEAT_7_0_ECX] |= CPUID_7_0_ECX_WAITPKG;
+            }
         }
         if (kvm_enabled() && cpu->ucode_rev == 0) {
             cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state,
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 4901c6dd74..f9c873bcad 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -407,12 +407,6 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
         if (host_tsx_blacklisted()) {
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
         }
-    } else if (function == 7 && index == 0 && reg == R_ECX) {
-        if (enable_cpu_pm) {
-            ret |= CPUID_7_0_ECX_WAITPKG;
-        } else {
-            ret &= ~CPUID_7_0_ECX_WAITPKG;
-        }
     } else if (function == 7 && index == 0 && reg == R_EDX) {
         /*
          * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts.
@@ -4678,3 +4672,8 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
 {
     abort();
 }
+
+bool kvm_has_waitpkg(void)
+{
+    return has_msr_umwait;
+}
diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h
index 00bde7acaf..064b8798a2 100644
--- a/target/i386/kvm_i386.h
+++ b/target/i386/kvm_i386.h
@@ -44,6 +44,7 @@ void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
 
 bool kvm_enable_x2apic(void);
 bool kvm_has_x2apic_api(void);
+bool kvm_has_waitpkg(void);
 
 bool kvm_hv_vpindex_settable(void);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7930.20977 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhM-0000En-Nv; Fri, 16 Oct 2020 11:15:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7930.20977; Fri, 16 Oct 2020 11:15:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhM-0000Ef-Kv; Fri, 16 Oct 2020 11:15:00 +0000
Received: by outflank-mailman (input) for mailman id 7930;
 Fri, 16 Oct 2020 11:14:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhL-0000EX-Hk
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2505a9fa-335e-4f66-984c-9d600b21846e;
 Fri, 16 Oct 2020 11:14:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhK-00029E-MV
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhK-0001uu-I4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhL-0000EX-Hk
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:59 +0000
X-Inumbo-ID: 2505a9fa-335e-4f66-984c-9d600b21846e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2505a9fa-335e-4f66-984c-9d600b21846e;
	Fri, 16 Oct 2020 11:14:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QUB+A6YuMuje2xHaIhhISyRaQ8+vODv3TIN9WURiHaA=; b=cDqphkBhUbauoAflM6ENdqvvgP
	fuOys7bHDsEZBU9lejwh56s7cuEfsJWZ+gSG2ed9jMKsrTxEUoOR5TDRrwB+ixCuJMw2llo3viMY4
	ltt0fZbSTjUYK1iJb1LchcytHn1lnIH4bR5LgscEe2St9L3Kcgn9qjz3b5eUL7t+fSzQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhK-00029E-MV
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhK-0001uu-I4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:14:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] aio-posix: don't duplicate fd handler deletion in fdmon_io_uring_destroy()
Message-Id: <E1kTNhK-0001uu-I4@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:14:58 +0000

commit 5145f2471caa4ef58e200e151f736e633a5fb1ac
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon May 11 19:36:29 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:30:07 2020 -0500

    aio-posix: don't duplicate fd handler deletion in fdmon_io_uring_destroy()
    
    The io_uring file descriptor monitoring implementation has an internal
    list of fd handlers that are pending submission to io_uring.
    fdmon_io_uring_destroy() deletes all fd handlers on the list.
    
    Don't delete fd handlers directly in fdmon_io_uring_destroy() for two
    reasons:
    1. This duplicates the aio-posix.c AioHandler deletion code and could
       become outdated if the struct changes.
    2. Only handlers with the FDMON_IO_URING_REMOVE flag set are safe to
       remove. If the flag is not set then something still has a pointer to
       the fd handler. Let aio-posix.c and its user worry about that. In
       practice this isn't an issue because fdmon_io_uring_destroy() is only
       called when shutting down so all users have removed their fd
       handlers, but the next patch will need this!
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
    Message-id: 20200511183630.279750-2-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    (cherry picked from commit de137e44f75d9868f5b548638081850f6ac771f2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 util/aio-posix.c      |  1 +
 util/fdmon-io_uring.c | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/util/aio-posix.c b/util/aio-posix.c
index c3613d299e..8af334ab19 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -679,6 +679,7 @@ void aio_context_destroy(AioContext *ctx)
 {
     fdmon_io_uring_destroy(ctx);
     fdmon_epoll_disable(ctx);
+    aio_free_deleted_handlers(ctx);
 }
 
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c
index d5a80ed6fb..1d14177df0 100644
--- a/util/fdmon-io_uring.c
+++ b/util/fdmon-io_uring.c
@@ -342,11 +342,18 @@ void fdmon_io_uring_destroy(AioContext *ctx)
 
         io_uring_queue_exit(&ctx->fdmon_io_uring);
 
-        /* No need to submit these anymore, just free them. */
+        /* Move handlers due to be removed onto the deleted list */
         while ((node = QSLIST_FIRST_RCU(&ctx->submit_list))) {
+            unsigned flags = atomic_fetch_and(&node->flags,
+                    ~(FDMON_IO_URING_PENDING |
+                      FDMON_IO_URING_ADD |
+                      FDMON_IO_URING_REMOVE));
+
+            if (flags & FDMON_IO_URING_REMOVE) {
+                QLIST_INSERT_HEAD_RCU(&ctx->deleted_aio_handlers, node, node_deleted);
+            }
+
             QSLIST_REMOVE_HEAD_RCU(&ctx->submit_list, node_submitted);
-            QLIST_REMOVE(node, node);
-            g_free(node);
         }
 
         ctx->fdmon_ops = &fdmon_poll_ops;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7931.20981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhW-0000G3-PQ; Fri, 16 Oct 2020 11:15:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7931.20981; Fri, 16 Oct 2020 11:15:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhW-0000Fw-MW; Fri, 16 Oct 2020 11:15:10 +0000
Received: by outflank-mailman (input) for mailman id 7931;
 Fri, 16 Oct 2020 11:15:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhV-0000Fq-LQ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b0f7e691-e423-474e-85a6-24bff0fa801f;
 Fri, 16 Oct 2020 11:15:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhU-00029m-PX
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhU-0001wH-Ov
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhV-0000Fq-LQ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:09 +0000
X-Inumbo-ID: b0f7e691-e423-474e-85a6-24bff0fa801f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b0f7e691-e423-474e-85a6-24bff0fa801f;
	Fri, 16 Oct 2020 11:15:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C9nnd+9nQ3zXkdLoWKzh1TB11+J+2WtsRhqM0m4gLlU=; b=s6wlVmPxiwSyYaJyu1UNKgG/O7
	vAHZUoF1RggWcxQGzpmH1sgAnx6ZgQ5+MrmVon2joJDyQu6ll4WelmtClAOgDx2q1W7cbQPDUTrbD
	MOd21aw16SN3C5Vg8+wo+JmLL+ESzboqHPVzHC4Dj3FaM7729YLbeCuA0drgrY+ElPLc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhU-00029m-PX
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhU-0001wH-Ov
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] aio-posix: disable fdmon-io_uring when GSource is used
Message-Id: <E1kTNhU-0001wH-Ov@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:08 +0000

commit dcc935873b688a789744ec0a2d0d1b3570d18a6c
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon May 11 19:36:30 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:30:13 2020 -0500

    aio-posix: disable fdmon-io_uring when GSource is used
    
    The glib event loop does not call fdmon_io_uring_wait() so fd handlers
    waiting to be submitted build up in the list. There is no benefit is
    using io_uring when the glib GSource is being used, so disable it
    instead of implementing a more complex fix.
    
    This fixes a memory leak where AioHandlers would build up and increasing
    amounts of CPU time were spent iterating them in aio_pending(). The
    symptom is that guests become slow when QEMU is built with io_uring
    support.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1877716
    Fixes: 73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf ("aio-posix: add io_uring fd monitoring implementation")
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
    Message-id: 20200511183630.279750-3-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    (cherry picked from commit ba607ca8bff4d2c2062902f8355657c865ac7c29)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/block/aio.h |  3 +++
 util/aio-posix.c    | 12 ++++++++++++
 util/aio-win32.c    |  4 ++++
 util/async.c        |  1 +
 4 files changed, 20 insertions(+)

diff --git a/include/block/aio.h b/include/block/aio.h
index 62ed954344..b2f703fa3f 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -701,6 +701,9 @@ void aio_context_setup(AioContext *ctx);
  */
 void aio_context_destroy(AioContext *ctx);
 
+/* Used internally, do not call outside AioContext code */
+void aio_context_use_g_source(AioContext *ctx);
+
 /**
  * aio_context_set_poll_params:
  * @ctx: the aio context
diff --git a/util/aio-posix.c b/util/aio-posix.c
index 8af334ab19..1b2a3af65b 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -682,6 +682,18 @@ void aio_context_destroy(AioContext *ctx)
     aio_free_deleted_handlers(ctx);
 }
 
+void aio_context_use_g_source(AioContext *ctx)
+{
+    /*
+     * Disable io_uring when the glib main loop is used because it doesn't
+     * support mixed glib/aio_poll() usage. It relies on aio_poll() being
+     * called regularly so that changes to the monitored file descriptors are
+     * submitted, otherwise a list of pending fd handlers builds up.
+     */
+    fdmon_io_uring_destroy(ctx);
+    aio_free_deleted_handlers(ctx);
+}
+
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {
diff --git a/util/aio-win32.c b/util/aio-win32.c
index 729d533faf..953c56ab48 100644
--- a/util/aio-win32.c
+++ b/util/aio-win32.c
@@ -414,6 +414,10 @@ void aio_context_destroy(AioContext *ctx)
 {
 }
 
+void aio_context_use_g_source(AioContext *ctx)
+{
+}
+
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {
diff --git a/util/async.c b/util/async.c
index 3165a28f2f..1319eee3bc 100644
--- a/util/async.c
+++ b/util/async.c
@@ -362,6 +362,7 @@ static GSourceFuncs aio_source_funcs = {
 
 GSource *aio_get_g_source(AioContext *ctx)
 {
+    aio_context_use_g_source(ctx);
     g_source_ref(&ctx->source);
     return &ctx->source;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7933.20986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhg-0000Hg-RN; Fri, 16 Oct 2020 11:15:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7933.20986; Fri, 16 Oct 2020 11:15:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhg-0000HS-Nv; Fri, 16 Oct 2020 11:15:20 +0000
Received: by outflank-mailman (input) for mailman id 7933;
 Fri, 16 Oct 2020 11:15:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhf-0000HG-Q9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 81ab7ae2-8253-4872-ab4b-8ee2e36d16a3;
 Fri, 16 Oct 2020 11:15:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhe-00029u-TJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhe-0001xJ-Rr
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhf-0000HG-Q9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:19 +0000
X-Inumbo-ID: 81ab7ae2-8253-4872-ab4b-8ee2e36d16a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 81ab7ae2-8253-4872-ab4b-8ee2e36d16a3;
	Fri, 16 Oct 2020 11:15:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TUwvOBN90I0uIfi0aLu0Yy7QEa4cCVv9CL4QAlSdPRY=; b=xR6sB/fz+SXfCCJ2G+habYl66U
	bNvL9mFWj4jts3CasmfPaKfxH56b9B1tTrPwaizItZhvyb/ypi9DfonbCgquEx2yUeOzXYkY50Z9n
	SDwEB1v4snzRhFrso0BTVZRB+3QWtwq4woAGr5P9C28L27T7vpph9tRrqpmdLEbv3+5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhe-00029u-TJ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhe-0001xJ-Rr
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] linux-user/strace.list: fix epoll_create{,1} -strace output
Message-Id: <E1kTNhe-0001xJ-Rr@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:18 +0000

commit 160546b81ec54a08153305e40db7e524723904ab
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: Thu Apr 16 18:59:57 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:31:34 2020 -0500

    linux-user/strace.list: fix epoll_create{,1} -strace output
    
    Fix syscall name and parameters priinter.
    
    Before the change:
    
    ```
    $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    ...
    1274697 %s(%d)(2097152,274903156744,274903156760,274905840712,274877908880,274903235616) = 3
    1274697 exit_group(0)
    ```
    
    After the change:
    
    ```
    $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    ...
    1273719 epoll_create1(2097152) = 3
    1273719 exit_group(0)
    ```
    
    Fixes: 9cbc0578cb6 ("Improve output of various syscalls")
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    CC: Riku Voipio <riku.voipio@iki.fi>
    CC: Laurent Vivier <laurent@vivier.eu>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200416175957.1274882-1-slyfox@gentoo.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    (cherry picked from commit fd568660b7ae9b9e45cbb616acc91ae4c065c32d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 linux-user/strace.list | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/strace.list b/linux-user/strace.list
index d49a1e92a8..9281c0a758 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -125,10 +125,10 @@
 { TARGET_NR_dup3, "dup3" , "%s(%d,%d,%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_create
-{ TARGET_NR_epoll_create, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create, "epoll_create", "%s(%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_create1
-{ TARGET_NR_epoll_create1, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create1, "epoll_create1", "%s(%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_ctl
 { TARGET_NR_epoll_ctl, "epoll_ctl" , NULL, NULL, NULL },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7934.20989 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhq-0000In-Sl; Fri, 16 Oct 2020 11:15:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7934.20989; Fri, 16 Oct 2020 11:15:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNhq-0000Ig-PS; Fri, 16 Oct 2020 11:15:30 +0000
Received: by outflank-mailman (input) for mailman id 7934;
 Fri, 16 Oct 2020 11:15:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhp-0000IX-PL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id df9d0806-87c5-4f72-9690-94670d175f45;
 Fri, 16 Oct 2020 11:15:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNho-0002Ac-W9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNho-0001y9-VZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhp-0000IX-PL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:29 +0000
X-Inumbo-ID: df9d0806-87c5-4f72-9690-94670d175f45
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id df9d0806-87c5-4f72-9690-94670d175f45;
	Fri, 16 Oct 2020 11:15:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+no0wBfDQ6CAthIU5S9p5iBKoJ6m2h2WA1yeVHMGYMs=; b=nGHx0noyI4DZAtzdoGDmPH4kc9
	+z1RHKsAi1WBWbMBIuZk++ur8C/5bGEwEh+OIXtH/bzFV3/lWf7OjZPfuab+StK5pEp1qInsTXyJz
	2eiJv9XX5Rj0FYU7X8tY6m2r/VjMAmO1RqdQN374sg9w7ipTFkpvZt9f7UUxytGtzqrc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNho-0002Ac-W9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNho-0001y9-VZ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] libqos: usb-hcd-ehci: use 32-bit write for config register
Message-Id: <E1kTNho-0001y9-VZ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:28 +0000

commit e399bb1bf1da5619087abd65e482995c4a8d15cd
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 23 12:18:24 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    libqos: usb-hcd-ehci: use 32-bit write for config register
    
    The memory region ops have min_access_size == 4 so obey it.
    
    Tested-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 89ed83d8b23c11d250c290593cad3ca839d5b053)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/usb-hcd-ehci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/usb-hcd-ehci-test.c b/tests/qtest/usb-hcd-ehci-test.c
index 5251d539e9..c51e8bb223 100644
--- a/tests/qtest/usb-hcd-ehci-test.c
+++ b/tests/qtest/usb-hcd-ehci-test.c
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
 static void pci_ehci_config(void)
 {
     /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
 }
 
 static void pci_uhci_port_2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7935.20992 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNi0-0000K9-UA; Fri, 16 Oct 2020 11:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7935.20992; Fri, 16 Oct 2020 11:15:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNi0-0000K1-R7; Fri, 16 Oct 2020 11:15:40 +0000
Received: by outflank-mailman (input) for mailman id 7935;
 Fri, 16 Oct 2020 11:15:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNhz-0000Jq-Pb
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c13655ce-e64c-4920-886c-75bfd72b611c;
 Fri, 16 Oct 2020 11:15:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhz-0002Ak-2n
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNhz-0001yk-27
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNhz-0000Jq-Pb
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
X-Inumbo-ID: c13655ce-e64c-4920-886c-75bfd72b611c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c13655ce-e64c-4920-886c-75bfd72b611c;
	Fri, 16 Oct 2020 11:15:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mbcw8RjZ2rIdEmgtSSNBWOFP2TKw6uZCpmLp3rr9nwo=; b=ErhfysSC3KuHVLu9daCvIKatk7
	8QWW7j6rUeaRla2sPb9R2K/TFP1/f1vVfr/P5OV7qsrRpDJR19FecYTdLn+r3cG7YptApOuasIjWy
	Pf0gQ0DbQLMEmkWkCa1oUldX1kmN6AZquKZhi315+Lx4YyApXOsHwbK6lvTJNQFe/oVo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhz-0002Ak-2n
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNhz-0001yk-27
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] libqos: pci-pc: use 32-bit write for EJ register
Message-Id: <E1kTNhz-0001yk-27@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:39 +0000

commit 68d84b133d3a3611f304a2e93f07690dd141dbd5
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 23 12:17:59 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    libqos: pci-pc: use 32-bit write for EJ register
    
    The memory region ops have min_access_size == 4 so obey it.
    
    Tested-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 4b7c06837ae0b1ff56473202a42e7e386f53d6db)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/libqos/pci-pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c
index 0bc591d1da..3bb2eb3ba8 100644
--- a/tests/qtest/libqos/pci-pc.c
+++ b/tests/qtest/libqos/pci-pc.c
@@ -186,7 +186,7 @@ void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t slot)
     g_assert(!qdict_haskey(response, "error"));
     qobject_unref(response);
 
-    qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot);
+    qtest_outl(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot);
 
     qtest_qmp_eventwait(qts, "DEVICE_DELETED");
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:15:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:15:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7936.20997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiB-0000M0-Vh; Fri, 16 Oct 2020 11:15:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7936.20997; Fri, 16 Oct 2020 11:15:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiB-0000Ls-Sh; Fri, 16 Oct 2020 11:15:51 +0000
Received: by outflank-mailman (input) for mailman id 7936;
 Fri, 16 Oct 2020 11:15:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNiA-0000Lk-At
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 404c5d93-ea3e-4c6f-a5bc-5c98428310c8;
 Fri, 16 Oct 2020 11:15:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNi9-0002As-60
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNi9-0001zI-5H
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNiA-0000Lk-At
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:50 +0000
X-Inumbo-ID: 404c5d93-ea3e-4c6f-a5bc-5c98428310c8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 404c5d93-ea3e-4c6f-a5bc-5c98428310c8;
	Fri, 16 Oct 2020 11:15:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7nBfRb8X6MjSYLaqz5oXUzcBIFNiCtIgBKpDsUKJwIk=; b=muQUjbU43Kntu35kXbBT+4Ogp+
	PnCArqjuK4FSlBsFSusJezAw5VGh3DxXCeW910ufTo+y+W8CTSbD8ovIPRPKSkJfrpVng0yr7ytiI
	mJ8f81NIhdPt5/6/6EG4NGh8pVo/EGBM9liok+oGDk4Sx9PYUgzJheKfgSZTs12VmzMI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNi9-0002As-60
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNi9-0001zI-5H
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"
Message-Id: <E1kTNi9-0001zI-5H@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:49 +0000

commit b14cd263ad87a4c3a83308f093841d247eb711f1
Author:     Michael S. Tsirkin <mst@redhat.com>
AuthorDate: Wed Jun 10 09:47:49 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"
    
    Memory API documentation documents valid .min_access_size and .max_access_size
    fields and explains that any access outside these boundaries is blocked.
    
    This is what devices seem to assume.
    
    However this is not what the implementation does: it simply
    ignores the boundaries unless there's an "accepts" callback.
    
    Naturally, this breaks a bunch of devices.
    
    Revert to the documented behaviour.
    
    Devices that want to allow any access can just drop the valid field,
    or add the impl field to have accesses converted to appropriate
    length.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Richard Henderson <rth@twiddle.net>
    Fixes: CVE-2020-13754
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1842363
    Fixes: a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid")
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Message-Id: <20200610134731.1514409-1-mst@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 5d971f9e672507210e77d020d89e0e89165c8fc9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 memory.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/memory.c b/memory.c
index 601b749906..e31aed6446 100644
--- a/memory.c
+++ b/memory.c
@@ -1352,35 +1352,24 @@ bool memory_region_access_valid(MemoryRegion *mr,
                                 bool is_write,
                                 MemTxAttrs attrs)
 {
-    int access_size_min, access_size_max;
-    int access_size, i;
-
-    if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
+    if (mr->ops->valid.accepts
+        && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
         return false;
     }
 
-    if (!mr->ops->valid.accepts) {
-        return true;
-    }
-
-    access_size_min = mr->ops->valid.min_access_size;
-    if (!mr->ops->valid.min_access_size) {
-        access_size_min = 1;
+    if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
+        return false;
     }
 
-    access_size_max = mr->ops->valid.max_access_size;
+    /* Treat zero as compatibility all valid */
     if (!mr->ops->valid.max_access_size) {
-        access_size_max = 4;
+        return true;
     }
 
-    access_size = MAX(MIN(size, access_size_max), access_size_min);
-    for (i = 0; i < size; i += access_size) {
-        if (!mr->ops->valid.accepts(mr->opaque, addr + i, access_size,
-                                    is_write, attrs)) {
-            return false;
-        }
+    if (size > mr->ops->valid.max_access_size
+        || size < mr->ops->valid.min_access_size) {
+        return false;
     }
-
     return true;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7937.21001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiM-0000NW-1Y; Fri, 16 Oct 2020 11:16:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7937.21001; Fri, 16 Oct 2020 11:16:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiL-0000NN-UF; Fri, 16 Oct 2020 11:16:01 +0000
Received: by outflank-mailman (input) for mailman id 7937;
 Fri, 16 Oct 2020 11:16:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNiJ-0000Mv-Vg
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7ccab0ce-bce0-46a0-9fae-4d86cc5860f3;
 Fri, 16 Oct 2020 11:15:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNiJ-0002Ay-97
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNiJ-0001zu-8V
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNiJ-0000Mv-Vg
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:00 +0000
X-Inumbo-ID: 7ccab0ce-bce0-46a0-9fae-4d86cc5860f3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7ccab0ce-bce0-46a0-9fae-4d86cc5860f3;
	Fri, 16 Oct 2020 11:15:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vb9MqjCYd7aqOOx3/1o8mpDjgvmNyBcEexQ9L5FLckA=; b=Cikw1SORU5hfAOlZza3ZWO3x12
	s5FC4T4hVSL+RDLMm26Hdy+f8tOMVehiQANFBuvh6eJ42Nppid7avSL+vDN1Ecm5SacrXFw8z0RxC
	PAb2j5db6sSkiiwTlVcrbo30vCNps4tWLnEBLh98AedW2ohUmOy7Hu3BHBnjuqsN6RsI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNiJ-0002Ay-97
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNiJ-0001zu-8V
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:15:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/riscv: Allow 64 bit access to SiFive CLINT
Message-Id: <E1kTNiJ-0001zu-8V@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:15:59 +0000

commit 182be029628068dc7739b496df63f073f2aa8ae3
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Tue Jun 30 13:12:11 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    hw/riscv: Allow 64 bit access to SiFive CLINT
    
    Commit 5d971f9e672507210e77d020d89e0e89165c8fc9
    "memory: Revert "memory: accept mismatching sizes in
    memory_region_access_valid"" broke most RISC-V boards as they do 64 bit
    accesses to the CLINT and QEMU would trigger a fault. Fix this failure
    by allowing 8 byte accesses.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: LIU Zhiwei<zhiwei_liu@c-sky.com>
    Message-Id: <122b78825b077e4dfd39b444d3a46fe894a7804c.1593547870.git.alistair.francis@wdc.com>
    (cherry picked from commit 70b78d4e71494c90d2ccb40381336bc9b9a22f79)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/riscv/sifive_clint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c
index e933d35092..a2a4b7d752 100644
--- a/hw/riscv/sifive_clint.c
+++ b/hw/riscv/sifive_clint.c
@@ -180,7 +180,7 @@ static const MemoryRegionOps sifive_clint_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 4,
-        .max_access_size = 4
+        .max_access_size = 8
     }
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7938.21005 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiW-0000Or-4i; Fri, 16 Oct 2020 11:16:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7938.21005; Fri, 16 Oct 2020 11:16:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiW-0000Oj-1n; Fri, 16 Oct 2020 11:16:12 +0000
Received: by outflank-mailman (input) for mailman id 7938;
 Fri, 16 Oct 2020 11:16:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNiU-0000Oa-K2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a3c2d3ae-747a-4e63-aafa-5eb9af5e4687;
 Fri, 16 Oct 2020 11:16:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNiT-0002BN-Hm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNiT-00020v-GL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNiU-0000Oa-K2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:10 +0000
X-Inumbo-ID: a3c2d3ae-747a-4e63-aafa-5eb9af5e4687
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a3c2d3ae-747a-4e63-aafa-5eb9af5e4687;
	Fri, 16 Oct 2020 11:16:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HWnMzC7+hIhag5P2XHPdNOltsE9ypYgypERV8EtjrDM=; b=Lk2y+LWioLohlbFABFOFxQccTL
	/j/3vNZ07/H45eLcoS85ePZY69BrWzdSyP21Jd35ye87C1WEGegv6oR8xymxUow9QnVkT9c/1KGdo
	qLh9p+KpsyyLUh0IO6Mt7uLup2QFwwVjy6HJ7mf1q6WIS/2AyMocUE5UCWR8W0t13oCE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNiT-0002BN-Hm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNiT-00020v-GL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] xhci: fix valid.max_access_size to access address registers
Message-Id: <E1kTNiT-00020v-GL@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:16:09 +0000

commit 782e94132aa7a3672fa5138837d91b48d6aee5dd
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 21 10:33:22 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    xhci: fix valid.max_access_size to access address registers
    
    QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
    64-bit mode access in "runtime" and "operational" MemoryRegionOps.
    
    Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.
    
    XHCI specs:
    "If the xHC supports 64-bit addressing (AC64 = ‘1’), then software
    should write 64-bit registers using only Qword accesses.  If a
    system is incapable of issuing Qword accesses, then writes to the
    64-bit address fields shall be performed using 2 Dword accesses;
    low Dword-first, high-Dword second.  If the xHC supports 32-bit
    addressing (AC64 = ‘0’), then the high Dword of registers containing
    64-bit address fields are unused and software should write addresses
    using only Dword accesses"
    
    The problem has been detected with SLOF, as linux kernel always accesses
    registers using 32-bit access even if AC64 is set and revealed by
    5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    
    Suggested-by: Alexey Kardashevskiy <aik@au1.ibm.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-id: 20200721083322.90651-1-lvivier@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 8e67fda2dd6202ccec093fda561107ba14830a17)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/hcd-xhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index b330e36fe6..67a18fe2b6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = {
     .read = xhci_oper_read,
     .write = xhci_oper_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
@@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = {
     .read = xhci_runtime_read,
     .write = xhci_runtime_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7939.21009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNig-0000Q6-6G; Fri, 16 Oct 2020 11:16:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7939.21009; Fri, 16 Oct 2020 11:16:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNig-0000Py-3D; Fri, 16 Oct 2020 11:16:22 +0000
Received: by outflank-mailman (input) for mailman id 7939;
 Fri, 16 Oct 2020 11:16:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNie-0000Pn-Iu
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 818e07af-7e9c-476c-b873-b29e68d7bc1a;
 Fri, 16 Oct 2020 11:16:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNid-0002Be-Ln
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNid-00021j-Jy
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNie-0000Pn-Iu
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:20 +0000
X-Inumbo-ID: 818e07af-7e9c-476c-b873-b29e68d7bc1a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 818e07af-7e9c-476c-b873-b29e68d7bc1a;
	Fri, 16 Oct 2020 11:16:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H0Mo1vB2BT7WZCv1zPJ9CwrLWI1hGci9ofAxEP4UstE=; b=xVSeNgVoVr7qFHtvg/cOvFqyVZ
	NKFVYJ/0N5lXOze7pCBDlIYcFgLjSzo/SwIh7x/B7/qdqre2uztoh9Yp8uJeBvUV2YdvvjenEXKuC
	a96bKMQ6TgfeMVBQXA2wL44pxaedbDqivLqF584nwn26RKX8Fb8tBYyRu7WlfxnfLzFc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNid-0002Be-Ln
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNid-00021j-Jy
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] acpi: accept byte and word access to core ACPI registers
Message-Id: <E1kTNid-00021j-Jy@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:16:19 +0000

commit 974b857df6e9dd69c709b20159f07b09f3f6254e
Author:     Michael Tokarev <mjt@tls.msk.ru>
AuthorDate: Mon Jul 20 19:06:27 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    acpi: accept byte and word access to core ACPI registers
    
    All ISA registers should be accessible as bytes, words or dwords
    (if wide enough).  Fix the access constraints for acpi-pm-evt,
    acpi-pm-tmr & acpi-cnt registers.
    
    Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Fixes: afafe4bbe0 (apci: switch cnt to memory api)
    Fixes: 77d58b1e47 (apci: switch timer to memory api)
    Fixes: b5a7c024d2 (apci: switch evt to memory api)
    Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
    Buglink: https://bugs.debian.org/964793
    BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
    BugLink: https://bugs.launchpad.net/bugs/1886318
    Reported-By: Simon John <git@the-jedi.co.uk>
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit dba04c3488c4699f5afe96f66e448b1d447cf3fb)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/acpi/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 45cbed49ab..d85052c34a 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -461,7 +461,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_evt_ops = {
     .read = acpi_pm_evt_read,
     .write = acpi_pm_evt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -530,7 +531,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_tmr_ops = {
     .read = acpi_pm_tmr_read,
     .write = acpi_pm_tmr_write,
-    .valid.min_access_size = 4,
+    .impl.min_access_size = 4,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -602,7 +604,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_cnt_ops = {
     .read = acpi_pm_cnt_read,
     .write = acpi_pm_cnt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7940.21013 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiq-0000RP-7b; Fri, 16 Oct 2020 11:16:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7940.21013; Fri, 16 Oct 2020 11:16:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNiq-0000RD-4i; Fri, 16 Oct 2020 11:16:32 +0000
Received: by outflank-mailman (input) for mailman id 7940;
 Fri, 16 Oct 2020 11:16:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNio-0000R2-Rf
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7f82a13a-2ddf-49ec-9f43-faa1ef080c52;
 Fri, 16 Oct 2020 11:16:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNin-0002CQ-Q0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNin-00022R-O5
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNio-0000R2-Rf
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:30 +0000
X-Inumbo-ID: 7f82a13a-2ddf-49ec-9f43-faa1ef080c52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7f82a13a-2ddf-49ec-9f43-faa1ef080c52;
	Fri, 16 Oct 2020 11:16:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jm3pXfcgGQxPFB7u6U8aj+9bTmkEfT6MWHy8FsdLxgM=; b=mf0a6RV1nn5ZdUPp+4DScsUtb9
	8Bm9qKegRxcqBP78aTAXE8wkfYvc4NeZKCM9jzyemhoS4c7tOCk1Hni1As4j7xLEzmZ6VjkBLWEjJ
	QvQ5Hu/FlPnhwR6y2ShxGFqe4+RS0T9vSvvB8O2Gbpti3M0JTOmPObYNOwjah+lIXSLY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNin-0002CQ-Q0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNin-00022R-O5
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/display/artist: Unbreak size mismatch memory accesses
Message-Id: <E1kTNin-00022R-O5@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:16:29 +0000

commit 045849b0785d5cf3359ea03f3445a55836b0d7a8
Author:     Helge Deller <deller@gmx.de>
AuthorDate: Sat Aug 8 22:29:01 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/display/artist: Unbreak size mismatch memory accesses
    
    Commit 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes
    in memory_region_access_valid") broke the artist driver in a way that
    the dtwm window manager on HP-UX rendered wrong.
    
    Fixes: 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Signed-off-by: Sven Schnelle <svens@stackframe.org>
    Signed-off-by: Helge Deller <deller@gmx.de>
    (cherry picked from commit e0cf02ce680f11893aca9642e76d6ae68b9375af)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/display/artist.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/display/artist.c b/hw/display/artist.c
index 753dbb9a77..d7bce918b8 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -1199,20 +1199,16 @@ static const MemoryRegionOps artist_reg_ops = {
     .read = artist_reg_read,
     .write = artist_reg_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
-    .valid = {
-        .min_access_size = 1,
-        .max_access_size = 4,
-    },
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 4,
 };
 
 static const MemoryRegionOps artist_vram_ops = {
     .read = artist_vram_read,
     .write = artist_vram_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
-    .valid = {
-        .min_access_size = 1,
-        .max_access_size = 4,
-    },
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 4,
 };
 
 static void artist_draw_cursor(ARTISTState *s)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7941.21017 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNj0-0000Sg-98; Fri, 16 Oct 2020 11:16:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7941.21017; Fri, 16 Oct 2020 11:16:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNj0-0000SZ-6C; Fri, 16 Oct 2020 11:16:42 +0000
Received: by outflank-mailman (input) for mailman id 7941;
 Fri, 16 Oct 2020 11:16:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNiy-0000SN-Rt
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 058ff06a-896b-45b2-a4aa-f1d65b8519ff;
 Fri, 16 Oct 2020 11:16:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNix-0002Cb-T8
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNix-000238-SM
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNiy-0000SN-Rt
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:40 +0000
X-Inumbo-ID: 058ff06a-896b-45b2-a4aa-f1d65b8519ff
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 058ff06a-896b-45b2-a4aa-f1d65b8519ff;
	Fri, 16 Oct 2020 11:16:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TET9MErZbbZGshsmNNH02ZTnBKITmPrGrQ964P1VhaU=; b=F0K71tOPNF8eDke4RaN3Ciwcus
	SkM+4aEaMJVbWV15Dgh7ODU34LUC7psqPGGQTPrbDb/KHRDtzcy8XdQ/rakfuMCxTO6nDioolaXcB
	PLkwCFY2+W3sK2pic2fbmtX7b2FvP2JzIiQXyFcBqvL5O06gL98ncChXQJmtOW1uF96E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNix-0002Cb-T8
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNix-000238-SM
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/net/e1000e: Do not abort() on invalid PSRCTL register value
Message-Id: <E1kTNix-000238-SM@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:16:39 +0000

commit 0fd3972e1cd424b750b3eeb2baf5686cbaa20d8a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon May 25 14:23:30 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/net/e1000e: Do not abort() on invalid PSRCTL register value
    
    libFuzzer found using 'qemu-system-i386 -M q35':
    
    qemu: hardware error: e1000e: PSRCTL.BSIZE0 cannot be zero
    CPU #0:
    EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000663
    ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
    EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
    ES =0000 00000000 0000ffff 00009300
    CS =f000 ffff0000 0000ffff 00009b00
    SS =0000 00000000 0000ffff 00009300
    DS =0000 00000000 0000ffff 00009300
    FS =0000 00000000 0000ffff 00009300
    GS =0000 00000000 0000ffff 00009300
    LDT=0000 00000000 0000ffff 00008200
    TR =0000 00000000 0000ffff 00008b00
    GDT=     00000000 0000ffff
    IDT=     00000000 0000ffff
    CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
    DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
    DR6=ffff0ff0 DR7=00000400
    EFER=0000000000000000
    FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
    FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
    FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
    FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
    FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
    XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
    XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
    XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
    XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000
    ==1988== ERROR: libFuzzer: deadly signal
        #6 0x7fae4d3ea894 in __GI_abort (/lib64/libc.so.6+0x22894)
        #7 0x563f4cc59a1d in hw_error (qemu-fuzz-i386+0xe8ca1d)
        #8 0x563f4d7c93f2 in e1000e_set_psrctl (qemu-fuzz-i386+0x19fc3f2)
        #9 0x563f4d7b798f in e1000e_core_write (qemu-fuzz-i386+0x19ea98f)
        #10 0x563f4d7afc46 in e1000e_mmio_write (qemu-fuzz-i386+0x19e2c46)
        #11 0x563f4cc9a0a7 in memory_region_write_accessor (qemu-fuzz-i386+0xecd0a7)
        #12 0x563f4cc99c13 in access_with_adjusted_size (qemu-fuzz-i386+0xeccc13)
        #13 0x563f4cc987b4 in memory_region_dispatch_write (qemu-fuzz-i386+0xecb7b4)
    
    It simply sent the following 2 I/O command to the e1000e
    PCI BAR #2 I/O region:
    
      writew 0x0100 0x0c00 # RCTL =   E1000_RCTL_DTYP_MASK
      writeb 0x2170 0x00   # PSRCTL = 0
    
    2813 static void
    2814 e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
    2815 {
    2816     if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
    2817
    2818         if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
    2819             hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
    2820         }
    
    Instead of calling hw_error() which abort the process (it is
    meant for CPU fatal error condition, not for device logging),
    log the invalid request with qemu_log_mask(LOG_GUEST_ERROR)
    and return, ignoring the request.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit fda43b1204aecd1db158b3255c591d227fbdd629)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/e1000e_core.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index d5676871fa..bcd186cac5 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -34,9 +34,9 @@
 */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "net/net.h"
 #include "net/tap.h"
-#include "hw/hw.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 #include "sysemu/runstate.h"
@@ -2816,11 +2816,15 @@ e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
     if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
 
         if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
-            hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "e1000e: PSRCTL.BSIZE0 cannot be zero");
+            return;
         }
 
         if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) {
-            hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero");
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "e1000e: PSRCTL.BSIZE1 cannot be zero");
+            return;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:16:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:16:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7942.21020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjA-0000UH-Ae; Fri, 16 Oct 2020 11:16:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7942.21020; Fri, 16 Oct 2020 11:16:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjA-0000UA-7p; Fri, 16 Oct 2020 11:16:52 +0000
Received: by outflank-mailman (input) for mailman id 7942;
 Fri, 16 Oct 2020 11:16:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNj8-0000Tx-SG
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 41c23fd8-5b57-4ae4-bd7c-4e64e2100f1d;
 Fri, 16 Oct 2020 11:16:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNj8-0002Cj-01
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNj7-00023f-VU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNj8-0000Tx-SG
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:50 +0000
X-Inumbo-ID: 41c23fd8-5b57-4ae4-bd7c-4e64e2100f1d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 41c23fd8-5b57-4ae4-bd7c-4e64e2100f1d;
	Fri, 16 Oct 2020 11:16:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1EvxLebWH00m1x1Kk7mJ2jAvRvBTRz1ywsvt3VomOjA=; b=4i4qr2DXcCJt2pmhfUpQNr24iQ
	2mF9zOaBBBWjflTMkOz9aov/XgrwyK2f0FF0yUcIkqEx4GcytKKLpVHlJsovr3y5Ku3xs+AzkSWm7
	1GArMjI1QWO5gpwevQfLjcn+Sy6Co2E3sVIJDLaSiaF1ZAru+IkKEvXeSKwigB/yzr5o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNj8-0002Cj-01
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNj7-00023f-VU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:16:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtiofsd: Whitelist fchmod
Message-Id: <E1kTNj7-00023f-VU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:16:49 +0000

commit 0aad2a52555643126970b2cb1bef37e7a2d5d7ac
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Mon Jun 8 11:31:11 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtiofsd: Whitelist fchmod
    
    lo_setattr() invokes fchmod() in a rarely used code path, so it should
    be whitelisted or virtiofsd will crash with EBADSYS.
    
    Said code path can be triggered for example as follows:
    
    On the host, in the shared directory, create a file with the sticky bit
    set and a security.capability xattr:
    (1) # touch foo
    (2) # chmod u+s foo
    (3) # setcap '' foo
    
    Then in the guest let some process truncate that file after it has
    dropped all of its capabilities (at least CAP_FSETID):
    
    int main(int argc, char *argv[])
    {
        capng_setpid(getpid());
        capng_clear(CAPNG_SELECT_BOTH);
        capng_updatev(CAPNG_ADD, CAPNG_PERMITTED | CAPNG_EFFECTIVE, 0);
        capng_apply(CAPNG_SELECT_BOTH);
    
        ftruncate(open(argv[1], O_RDWR), 0);
    }
    
    This will cause the guest kernel to drop the sticky bit (i.e. perform a
    mode change) as part of the truncate (where FATTR_FH is set), and that
    will cause virtiofsd to invoke fchmod() instead of fchmodat().
    
    (A similar configuration exists further below with futimens() vs.
    utimensat(), but the former is not a syscall but just a wrapper for the
    latter, so no further whitelisting is required.)
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1842667
    Reported-by: Qian Cai <caiqian@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200608093111.14942-1-mreitz@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 63659fe74e76f5c5285466f0c5cfbdca65b3688e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/seccomp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virtiofsd/seccomp.c b/tools/virtiofsd/seccomp.c
index bd9e7b083c..3b1522acdd 100644
--- a/tools/virtiofsd/seccomp.c
+++ b/tools/virtiofsd/seccomp.c
@@ -42,6 +42,7 @@ static const int syscall_whitelist[] = {
     SCMP_SYS(exit_group),
     SCMP_SYS(fallocate),
     SCMP_SYS(fchdir),
+    SCMP_SYS(fchmod),
     SCMP_SYS(fchmodat),
     SCMP_SYS(fchownat),
     SCMP_SYS(fcntl),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7943.21027 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjL-0000Vk-Dh; Fri, 16 Oct 2020 11:17:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7943.21027; Fri, 16 Oct 2020 11:17:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjL-0000Va-9S; Fri, 16 Oct 2020 11:17:03 +0000
Received: by outflank-mailman (input) for mailman id 7943;
 Fri, 16 Oct 2020 11:17:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNjJ-0000VR-K0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9f80cdc4-16f3-439e-96db-0ccf12438ab6;
 Fri, 16 Oct 2020 11:17:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjI-0002Cq-3Y
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjI-00024H-2G
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNjJ-0000VR-K0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:01 +0000
X-Inumbo-ID: 9f80cdc4-16f3-439e-96db-0ccf12438ab6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9f80cdc4-16f3-439e-96db-0ccf12438ab6;
	Fri, 16 Oct 2020 11:17:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wM9Ildnn0cWNOfBUXc+GO+oFWCDNlMZzWD9gck5b268=; b=Vc0TyjxPa3U/hW9umPRcsQlpTy
	7ONo8iboB+p2k1NOmLzsi3NKUEcNyiGuRw2rcq9vpUAREYZLfD4ERsqJ7xhfNheCaHVLwe63qPcft
	PiU2xM/fmodNOsdszjpx9PXDyirzKbw7vrA6mZ2iByZsKM+ua0IOOKTLHqeJowcjX9Eg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjI-0002Cq-3Y
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjI-00024H-2G
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/audio/gus: Fix registers 32-bit access
Message-Id: <E1kTNjI-00024H-2G@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:00 +0000

commit 7a1f17a51e091507f7a645db6720fc8d832d7c3c
Author:     Allan Peramaki <aperamak@pp1.inet.fi>
AuthorDate: Thu Jun 18 12:36:23 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/audio/gus: Fix registers 32-bit access
    
    Fix audio on software that accesses DRAM above 64k via register
    peek/poke and some cases when more than 16 voices are used.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 135f5ae1974c ("audio: GUSsample is int16_t")
    Signed-off-by: Allan Peramaki <aperamak@pp1.inet.fi>
    Tested-by: Volker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20200618103623.6031-1-philmd@redhat.com
    Message-Id: <20200615201757.16868-1-aperamak@pp1.inet.fi>
    [PMD: Removed unrelated style changes]
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 586803455b3fa44d949ecd42cd9c87e5a6287aef)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/audio/gusemu_hal.c   | 2 +-
 hw/audio/gusemu_mixer.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c
index ae40ca341c..5b9a14ee21 100644
--- a/hw/audio/gusemu_hal.c
+++ b/hw/audio/gusemu_hal.c
@@ -32,7 +32,7 @@
 
 #define GUSregb(position) (*            (gusptr+(position)))
 #define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
-#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
+#define GUSregd(position) (*(uint32_t *)(gusptr + (position)))
 
 /* size given in bytes */
 unsigned int gus_read(GUSEmuState * state, int port, int size)
diff --git a/hw/audio/gusemu_mixer.c b/hw/audio/gusemu_mixer.c
index 00b9861b92..56300de77e 100644
--- a/hw/audio/gusemu_mixer.c
+++ b/hw/audio/gusemu_mixer.c
@@ -28,7 +28,7 @@
 
 #define GUSregb(position)  (*            (gusptr+(position)))
 #define GUSregw(position)  (*(uint16_t *) (gusptr+(position)))
-#define GUSregd(position)  (*(uint16_t *)(gusptr+(position)))
+#define GUSregd(position)  (*(uint32_t *)(gusptr + (position)))
 
 #define GUSvoice(position) (*(uint16_t *)(voiceptr+(position)))
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7944.21029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjT-0000Wz-G0; Fri, 16 Oct 2020 11:17:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7944.21029; Fri, 16 Oct 2020 11:17:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjT-0000Wr-D7; Fri, 16 Oct 2020 11:17:11 +0000
Received: by outflank-mailman (input) for mailman id 7944;
 Fri, 16 Oct 2020 11:17:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNjT-0000Wl-1v
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 86aa1ae2-6461-4943-aafa-1c9c8cff1ab0;
 Fri, 16 Oct 2020 11:17:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjS-0002DE-6h
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjS-00025A-62
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNjT-0000Wl-1v
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:11 +0000
X-Inumbo-ID: 86aa1ae2-6461-4943-aafa-1c9c8cff1ab0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 86aa1ae2-6461-4943-aafa-1c9c8cff1ab0;
	Fri, 16 Oct 2020 11:17:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v8D87Qtsl30gwsMWkW5+nnxGw6e17SS3KSqFwbCJkdg=; b=DZfOytHL/SKePkMbVhENSyTrRl
	mG0OFp+J3i2XFeGWLG6WIheVUl9bA/0ZNVIbDQ3fzYWg5bxahiwdGn1iLYIjBN2yE70qM1qtpEek6
	ZIGlTny6K8Ssg1506X5AhzL2FP27wJpyZQXHjUU65zHp6uzdu1mp1Y6NP9Khyo7votcc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjS-0002DE-6h
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjS-00025A-62
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] net/virtio: Fix failover_replug_primary() return value regression
Message-Id: <E1kTNjS-00025A-62@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:10 +0000

commit b17b3c209b182c00a93e1987e4c1078275d162ce
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jun 30 11:03:26 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    net/virtio: Fix failover_replug_primary() return value regression
    
    Commit 150ab54aa6 "net/virtio: fix re-plugging of primary device"
    fixed failover_replug_primary() to return false on failure.  Commit
    5a0948d36c "net/virtio: Fix failover error handling crash bugs" broke
    it again for hotplug_handler_plug() failure.  Unbreak it.
    
    Commit 5a0948d36c4cbc1c5534afac6fee99de55245d12
    
    Fixes: 5a0948d36c4cbc1c5534afac6fee99de55245d12
    Cc: Jens Freimann <jfreimann@redhat.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Jens Freimann <jfreimann@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Message-Id: <20200630090351.1247703-2-armbru@redhat.com>
    (cherry picked from commit ca72efccbe33373810341a0d8a10f5698b8fbc87)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index a46e3b37a7..e7e2c2acdb 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2828,7 +2828,7 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
         if (err) {
             goto out;
         }
-        hotplug_handler_plug(hotplug_ctrl, n->primary_dev, errp);
+        hotplug_handler_plug(hotplug_ctrl, n->primary_dev, &err);
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7945.21033 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNje-0000YI-Hc; Fri, 16 Oct 2020 11:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7945.21033; Fri, 16 Oct 2020 11:17:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNje-0000YA-Eh; Fri, 16 Oct 2020 11:17:22 +0000
Received: by outflank-mailman (input) for mailman id 7945;
 Fri, 16 Oct 2020 11:17:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNjd-0000Y4-RJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 80916a5e-ccbe-4217-8001-4f4a35a62191;
 Fri, 16 Oct 2020 11:17:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjc-0002DQ-Aq
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjc-00025u-9I
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNjd-0000Y4-RJ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:21 +0000
X-Inumbo-ID: 80916a5e-ccbe-4217-8001-4f4a35a62191
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 80916a5e-ccbe-4217-8001-4f4a35a62191;
	Fri, 16 Oct 2020 11:17:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CGhp5uamCf7Pu3aKyjunyY0YIff8m/Do1puF1/8b3K8=; b=1iFVhFeEbZiunKneCe3L2H9i0C
	qYqkmTaTWrD4mNJNZg02+aLcqbLWHwnTpbEKg97T1JvamEMoOHxLXGNz18AeUBQmNKJdLNpx7iMCc
	sDuAKmIUDxllquTIGFofCsw8PjTFI2Qt/ZxHCigwGqCAvzO8YSVAPOfl24tk6rZLmseU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjc-0002DQ-Aq
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjc-00025u-9I
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] error: Use error_reportf_err() where appropriate
Message-Id: <E1kTNjc-00025u-9I@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:20 +0000

commit 558905635b5fedc96c0c3ea9c5ec9bd7d5faf1c9
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue May 5 12:19:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    error: Use error_reportf_err() where appropriate
    
    Replace
    
        error_report("...: %s", ..., error_get_pretty(err));
    
    by
    
        error_reportf_err(err, "...: ", ...);
    
    One of the replaced messages lacked a colon.  Add it.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200505101908.6207-6-armbru@redhat.com>
    (cherry picked from commit 5217f1887a8041c51495fbd5d3f767d96a242000)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 chardev/char-socket.c | 5 +++--
 hw/sd/pxa2xx_mmci.c   | 4 ++--
 hw/sd/sd.c            | 4 ++--
 hw/usb/dev-mtp.c      | 9 +++++----
 qemu-nbd.c            | 7 +++----
 scsi/qemu-pr-helper.c | 4 ++--
 6 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 185fe38dda..e5ee685f8c 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -138,8 +138,9 @@ static void check_report_connect_error(Chardev *chr,
     SocketChardev *s = SOCKET_CHARDEV(chr);
 
     if (!s->connect_err_reported) {
-        error_report("Unable to connect character device %s: %s",
-                     chr->label, error_get_pretty(err));
+        error_reportf_err(err,
+                          "Unable to connect character device %s: ",
+                          chr->label);
         s->connect_err_reported = true;
     }
     qemu_chr_socket_restart_timer(chr);
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index 8f9ab0ec16..f9c50ddda5 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -497,12 +497,12 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
     carddev = qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk, &err);
     if (err) {
-        error_report("failed to init SD card: %s", error_get_pretty(err));
+        error_reportf_err(err, "failed to init SD card: ");
         return NULL;
     }
     object_property_set_bool(OBJECT(carddev), true, "realized", &err);
     if (err) {
-        error_report("failed to init SD card: %s", error_get_pretty(err));
+        error_reportf_err(err, "failed to init SD card: ");
         return NULL;
     }
 
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 71a9af09ab..3c06a0ac6d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -703,13 +703,13 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
     dev = DEVICE(obj);
     qdev_prop_set_drive(dev, "drive", blk, &err);
     if (err) {
-        error_report("sd_init failed: %s", error_get_pretty(err));
+        error_reportf_err(err, "sd_init failed: ");
         return NULL;
     }
     qdev_prop_set_bit(dev, "spi", is_spi);
     object_property_set_bool(obj, true, "realized", &err);
     if (err) {
-        error_report("sd_init failed: %s", error_get_pretty(err));
+        error_reportf_err(err, "sd_init failed: ");
         return NULL;
     }
 
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 20717f026b..168428156b 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -631,8 +631,9 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
         int64_t id = qemu_file_monitor_add_watch(s->file_monitor, o->path, NULL,
                                                  file_monitor_event, s, &err);
         if (id == -1) {
-            error_report("usb-mtp: failed to add watch for %s: %s", o->path,
-                         error_get_pretty(err));
+            error_reportf_err(err,
+                              "usb-mtp: failed to add watch for %s: ",
+                              o->path);
             error_free(err);
         } else {
             trace_usb_mtp_file_monitor_event(s->dev.addr, o->path,
@@ -1276,8 +1277,8 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
 
         s->file_monitor = qemu_file_monitor_new(&err);
         if (err) {
-            error_report("usb-mtp: file monitoring init failed: %s",
-                         error_get_pretty(err));
+            error_reportf_err(err,
+                              "usb-mtp: file monitoring init failed: ");
             error_free(err);
         } else {
             QTAILQ_INIT(&s->events);
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 306e44fb0a..d2657b8db5 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -856,8 +856,7 @@ int main(int argc, char **argv)
         }
         tlscreds = nbd_get_tls_creds(tlscredsid, list, &local_err);
         if (local_err) {
-            error_report("Failed to get TLS creds %s",
-                         error_get_pretty(local_err));
+            error_reportf_err(local_err, "Failed to get TLS creds: ");
             exit(EXIT_FAILURE);
         }
     } else {
@@ -983,8 +982,8 @@ int main(int argc, char **argv)
                                              &local_err);
             if (sioc == NULL) {
                 object_unref(OBJECT(server));
-                error_report("Failed to use socket activation: %s",
-                             error_get_pretty(local_err));
+                error_reportf_err(local_err,
+                                  "Failed to use socket activation: ");
                 exit(EXIT_FAILURE);
             }
             qio_net_listener_add(server, sioc);
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index 181ed4a186..57ad830d54 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -1030,8 +1030,8 @@ int main(int argc, char **argv)
         server_ioc = qio_channel_socket_new_fd(FIRST_SOCKET_ACTIVATION_FD,
                                                &local_err);
         if (server_ioc == NULL) {
-            error_report("Failed to use socket activation: %s",
-                         error_get_pretty(local_err));
+            error_reportf_err(local_err,
+                              "Failed to use socket activation: ");
             exit(EXIT_FAILURE);
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7946.21037 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjo-0000ZZ-JM; Fri, 16 Oct 2020 11:17:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7946.21037; Fri, 16 Oct 2020 11:17:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjo-0000ZS-GK; Fri, 16 Oct 2020 11:17:32 +0000
Received: by outflank-mailman (input) for mailman id 7946;
 Fri, 16 Oct 2020 11:17:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNjn-0000ZG-7O
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 253dc1dd-29c3-4576-b539-016f4efc7045;
 Fri, 16 Oct 2020 11:17:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjm-0002Dz-E0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjm-00026U-DP
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNjn-0000ZG-7O
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:31 +0000
X-Inumbo-ID: 253dc1dd-29c3-4576-b539-016f4efc7045
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 253dc1dd-29c3-4576-b539-016f4efc7045;
	Fri, 16 Oct 2020 11:17:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TjIye30Lqsq1WWMX0+CpJIrQM0ttU/ZiMIkf1UgDPSw=; b=lRwJZVdRiL8R+WkIgcq5HazsfX
	uwHWLb0Q+IfJL6QAj0fCjxPm1UBC/lzssUl+9qrWwwzKbv+AiUsQDISsGZTQqustN7uJ0EXKpXcGv
	CIeIymsP26f9MdyKJK2ecjWho7YGagvgxI185TR3wEySYVJECGT/4p/iorUADx8RZtPw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjm-0002Dz-E0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjm-00026U-DP
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] usb/dev-mtp: Fix Error double free after inotify failure
Message-Id: <E1kTNjm-00026U-DP@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:30 +0000

commit b3e49baa79908d7e1c35df3814435dda72d85267
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jun 30 11:03:31 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    usb/dev-mtp: Fix Error double free after inotify failure
    
    error_report_err() frees its first argument.  Freeing it again is
    wrong.  Don't.
    
    Fixes: 47287c27d0c367a89f7b2851e23a7f8b2d499dd6
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200630090351.1247703-7-armbru@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    (cherry picked from commit 562a558647be6fe43e60f8bf3601e5b6122c0599)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/dev-mtp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 168428156b..15a2243101 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -634,7 +634,6 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
             error_reportf_err(err,
                               "usb-mtp: failed to add watch for %s: ",
                               o->path);
-            error_free(err);
         } else {
             trace_usb_mtp_file_monitor_event(s->dev.addr, o->path,
                                              "Watch Added");
@@ -1279,7 +1278,6 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
         if (err) {
             error_reportf_err(err,
                               "usb-mtp: file monitoring init failed: ");
-            error_free(err);
         } else {
             QTAILQ_INIT(&s->events);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7947.21040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjy-0000bf-LJ; Fri, 16 Oct 2020 11:17:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7947.21040; Fri, 16 Oct 2020 11:17:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNjy-0000bY-IQ; Fri, 16 Oct 2020 11:17:42 +0000
Received: by outflank-mailman (input) for mailman id 7947;
 Fri, 16 Oct 2020 11:17:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNjx-0000al-9v
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a92c514f-1f47-478d-bda2-446ad22a2e84;
 Fri, 16 Oct 2020 11:17:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjw-0002Fe-Gy
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNjw-00028e-GO
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNjx-0000al-9v
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:41 +0000
X-Inumbo-ID: a92c514f-1f47-478d-bda2-446ad22a2e84
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a92c514f-1f47-478d-bda2-446ad22a2e84;
	Fri, 16 Oct 2020 11:17:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8VPmCsP/vDsUuEb4RsSt5hpJ3S8nZpgKahCS3K2SJcM=; b=HB9WFjgXu9XwmMeFkdH+lg2g92
	hTypGFe3fPY8qF+1xHCB6kNpOAFvp/+1MY/IYwmgb2APY0EhZKyGSfY+hc36b3TbxGOYHs4QZ/rD9
	1y8PheK1pjgfcPYRTsOFgBbBNx2X+QYWQwmVy5Qg9gD6CQkYj69mXItsUOh/Cbi4NzUw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjw-0002Fe-Gy
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNjw-00028e-GO
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] nbd: Avoid off-by-one in long export name truncation
Message-Id: <E1kTNjw-00028e-GO@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:40 +0000

commit 9380cb9de20b1554162eea9eb0e80209464ace50
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 22 16:03:55 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    nbd: Avoid off-by-one in long export name truncation
    
    When snprintf returns the same value as the buffer size, the final
    byte was truncated to ensure a NUL terminator.  Fortunately, such long
    export names are unusual enough, with no real impact other than what
    is displayed to the user.
    
    Fixes: 5c86bdf12089
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200622210355.414941-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    (cherry picked from commit 00d69986da83a74f6f5731c80f8dd09fde95d19a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index bfc0be6af6..bf3fbebfa0 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -2011,7 +2011,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
         len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
                        "nbd://%s:%s", host, port);
     }
-    if (len > sizeof(bs->exact_filename)) {
+    if (len >= sizeof(bs->exact_filename)) {
         /* Name is too long to represent exactly, so leave it empty. */
         bs->exact_filename[0] = '\0';
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:17:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:17:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7948.21045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNk8-0000cy-Mh; Fri, 16 Oct 2020 11:17:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7948.21045; Fri, 16 Oct 2020 11:17:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNk8-0000cq-Jr; Fri, 16 Oct 2020 11:17:52 +0000
Received: by outflank-mailman (input) for mailman id 7948;
 Fri, 16 Oct 2020 11:17:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNk7-0000cd-Di
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a5495342-1b66-4e77-b83a-40f22a5a3e32;
 Fri, 16 Oct 2020 11:17:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNk6-0002Fo-K0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNk6-00029J-JI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNk7-0000cd-Di
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:51 +0000
X-Inumbo-ID: a5495342-1b66-4e77-b83a-40f22a5a3e32
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a5495342-1b66-4e77-b83a-40f22a5a3e32;
	Fri, 16 Oct 2020 11:17:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H21hFCzSeaW5xwoCDLlNtYTSHABwLKyW77qZmfOqq2I=; b=DQbfYyipIfXnsIknA7QVKVOnTR
	G9exnIYAlLS/om9DUqC36wi3T9fCF0/+WkkQa8Kedyt4XB4KXhOZqXt7EUKoxVCbCK5S1biEnYP3q
	qdxGB+gKdJC/lFWCR2TXDSgNB7YJkcp/2QWwXIOm6hNuQ6MuI27FLVtTycyN3/7YFM9Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNk6-0002Fo-K0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNk6-00029J-JI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:17:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] chardev/tcp: Fix error message double free error
Message-Id: <E1kTNk6-00029J-JI@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:17:50 +0000

commit 54e74a45a58912dd7705d53e965e9092a0631aa5
Author:     lichun <lichun@ruijie.com.cn>
AuthorDate: Mon Jun 22 05:30:17 2020 +0800
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    chardev/tcp: Fix error message double free error
    
    Errors are already freed by error_report_err, so we only need to call
    error_free when that function is not called.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: lichun <lichun@ruijie.com.cn>
    Message-Id: <20200621213017.17978-1-lichun@ruijie.com.cn>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Commit message improved, cc: qemu-stable]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    (cherry picked from commit ed4e0d2ef140aef255d67eec30767e5fcd949f58)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 chardev/char-socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index e5ee685f8c..58917870cd 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -142,6 +142,8 @@ static void check_report_connect_error(Chardev *chr,
                           "Unable to connect character device %s: ",
                           chr->label);
         s->connect_err_reported = true;
+    } else {
+        error_free(err);
     }
     qemu_chr_socket_restart_timer(chr);
 }
@@ -1083,7 +1085,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
     if (qio_task_propagate_error(task, &err)) {
         tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED);
         check_report_connect_error(chr, err);
-        error_free(err);
         goto cleanup;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7949.21048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkI-0000fk-ON; Fri, 16 Oct 2020 11:18:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7949.21048; Fri, 16 Oct 2020 11:18:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkI-0000fb-LL; Fri, 16 Oct 2020 11:18:02 +0000
Received: by outflank-mailman (input) for mailman id 7949;
 Fri, 16 Oct 2020 11:18:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNkI-0000fT-3Z
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 47458b69-7dd1-44e2-957f-05a7f754d076;
 Fri, 16 Oct 2020 11:18:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkG-0002Fv-N5
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkG-0002JK-MJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNkI-0000fT-3Z
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:02 +0000
X-Inumbo-ID: 47458b69-7dd1-44e2-957f-05a7f754d076
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 47458b69-7dd1-44e2-957f-05a7f754d076;
	Fri, 16 Oct 2020 11:18:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OSxu98j5rh04QQwEPQLfpBWmhwAu6D/cBrFl+Xt5aHA=; b=1tNZpf/0pSLt+iCrwgtsDl/ASC
	f3bP0vfvkTTQskaPNf0Yiy+aBPWX2lnvYyBG1A7UT39kinnJHMWy5t5AwOH6JaE+w5R6V6Unx5vrl
	t924YQPFnNhJQ72QLj8XSOLq6ZIZ9WgV036us3I/6N8GPOpqB2krk23s2rbvabUpYIeM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkG-0002Fv-N5
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkG-0002JK-MJ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] qga: fix assert regression on guest-shutdown
Message-Id: <E1kTNkG-0002JK-MJ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:00 +0000

commit a799013e71b56cee2d375fa34893dd9f4e8c3248
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Thu Jun 4 11:44:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qga: fix assert regression on guest-shutdown
    
    Since commit 781f2b3d1e ("qga: process_event() simplification"),
    send_response() is called unconditionally, but will assert when "rsp" is
    NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as
    "guest-shutdown".
    
    Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35
    Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit 844bd70b5652f30bbace89499f513e3fbbb6457a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index f0e454f28d..3febf3b0fd 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp)
     QString *payload_qstr, *response_qstr;
     GIOStatus status;
 
-    g_assert(rsp && s->channel);
+    g_assert(s->channel);
+
+    if (!rsp) {
+        return 0;
+    }
 
     payload_qstr = qobject_to_json(QOBJECT(rsp));
     if (!payload_qstr) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7950.21052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkS-0000gy-Q3; Fri, 16 Oct 2020 11:18:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7950.21052; Fri, 16 Oct 2020 11:18:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkS-0000gq-Ms; Fri, 16 Oct 2020 11:18:12 +0000
Received: by outflank-mailman (input) for mailman id 7950;
 Fri, 16 Oct 2020 11:18:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNkR-0000gh-Py
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 233e31d1-3d29-468a-b8c5-366a8c24a777;
 Fri, 16 Oct 2020 11:18:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkQ-0002GG-QA
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkQ-0002Jx-PU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNkR-0000gh-Py
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:11 +0000
X-Inumbo-ID: 233e31d1-3d29-468a-b8c5-366a8c24a777
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 233e31d1-3d29-468a-b8c5-366a8c24a777;
	Fri, 16 Oct 2020 11:18:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RgKcqgdHgXYEAQ8VHSjQ72zpJs1SdF+TuUd64YhwyqE=; b=sotxf9PVSNCoC2ytXcsGcIriXg
	SLZxgaxljp7tCdFXqUNk8/9IdSX1V/AFiLldfTaw0tfWtbu8FJAX9VJOHEoC3NtpLGP1gG7bVtEAJ
	ueNzZN7/C/t6A/GPXUwagd7B1UdARNgp6VZplstLTYEpIX7N8kQp47l5lFV39RiOdtMU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkQ-0002GG-QA
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkQ-0002Jx-PU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] util: Introduce qemu_get_host_name()
Message-Id: <E1kTNkQ-0002Jx-PU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:10 +0000

commit ad1169e23ce05aee2304eb737a1b4d51f3ea9e7e
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    util: Introduce qemu_get_host_name()
    
    This function offers operating system agnostic way to fetch host
    name. It is implemented for both POSIX-like and Windows systems.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit e47f4765afcab2b78dfa5b0115abf64d1d49a5d3)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/qemu/osdep.h | 10 ++++++++++
 util/oslib-posix.c   | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c   | 13 +++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 20f5c5f197..1866cab3c5 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -607,4 +607,14 @@ static inline void qemu_reset_optind(void)
 #endif
 }
 
+/**
+ * qemu_get_host_name:
+ * @errp: Error object
+ *
+ * Operating system agnostic way of querying host name.
+ *
+ * Returns allocated hostname (caller should free), NULL on failure.
+ */
+char *qemu_get_host_name(Error **errp);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 062236a1ab..e58fbc8e00 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -752,3 +752,38 @@ void sigaction_invoke(struct sigaction *action,
     }
     action->sa_sigaction(info->ssi_signo, &si, NULL);
 }
+
+#ifndef HOST_NAME_MAX
+# ifdef _POSIX_HOST_NAME_MAX
+#  define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+# else
+#  define HOST_NAME_MAX 255
+# endif
+#endif
+
+char *qemu_get_host_name(Error **errp)
+{
+    long len = -1;
+    g_autofree char *hostname = NULL;
+
+#ifdef _SC_HOST_NAME_MAX
+    len = sysconf(_SC_HOST_NAME_MAX);
+#endif /* _SC_HOST_NAME_MAX */
+
+    if (len < 0) {
+        len = HOST_NAME_MAX;
+    }
+
+    /* Unfortunately, gethostname() below does not guarantee a
+     * NULL terminated string. Therefore, allocate one byte more
+     * to be sure. */
+    hostname = g_new0(char, len + 1);
+
+    if (gethostname(hostname, len) < 0) {
+        error_setg_errno(errp, errno,
+                         "cannot get hostname");
+        return NULL;
+    }
+
+    return g_steal_pointer(&hostname);
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index e9b14ab178..3b49d27297 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -808,3 +808,16 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
     }
     return true;
 }
+
+char *qemu_get_host_name(Error **errp)
+{
+    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD size = G_N_ELEMENTS(tmp);
+
+    if (GetComputerNameW(tmp, &size) == 0) {
+        error_setg_win32(errp, GetLastError(), "failed close handle");
+        return NULL;
+    }
+
+    return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7951.21058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkd-0000iW-UF; Fri, 16 Oct 2020 11:18:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7951.21058; Fri, 16 Oct 2020 11:18:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkd-0000iO-Qe; Fri, 16 Oct 2020 11:18:23 +0000
Received: by outflank-mailman (input) for mailman id 7951;
 Fri, 16 Oct 2020 11:18:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNkc-0000iF-Ki
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d2b632fc-a04a-4537-8f77-3f3499cd4643;
 Fri, 16 Oct 2020 11:18:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNka-0002GQ-TN
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNka-0002KY-SW
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNkc-0000iF-Ki
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:22 +0000
X-Inumbo-ID: d2b632fc-a04a-4537-8f77-3f3499cd4643
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d2b632fc-a04a-4537-8f77-3f3499cd4643;
	Fri, 16 Oct 2020 11:18:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8whxWSmSInxBsFDgsjfwbMFmLJ84kYQoPDewUz3OVYQ=; b=eLp24ptTitoMI9tZMfURzzdW6H
	hna8pNXjpc08/IPoGY+Rog+qkXFfSAxLKiD/3BYOW+uzbSfyOrSnwt2WG4x9qYp3gncUbtQrGsC+P
	xxZ+wnG9mZvANMms2Hr+6+BghRKb0p2YD4SQxVhk1f+VMDlS6v+wQQpv6Mo/3tIHJ1FE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNka-0002GQ-TN
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNka-0002KY-SW
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] qga: Use qemu_get_host_name() instead of g_get_host_name()
Message-Id: <E1kTNka-0002KY-SW@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:20 +0000

commit 3ddb01cd149f9d2064f8ce2dff6a75b2e18b3cd2
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qga: Use qemu_get_host_name() instead of g_get_host_name()
    
    Problem with g_get_host_name() is that on the first call it saves
    the hostname into a global variable and from then on, every
    subsequent call returns the saved hostname. Even if the hostname
    changes. This doesn't play nicely with guest agent, because if
    the hostname is acquired before the guest is set up (e.g. on the
    first boot, or before DHCP) we will report old, invalid hostname.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/qga/commands.c b/qga/commands.c
index efc8b90281..d3fec807c1 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -515,11 +515,20 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
 GuestHostName *qmp_guest_get_host_name(Error **errp)
 {
     GuestHostName *result = NULL;
-    gchar const *hostname = g_get_host_name();
-    if (hostname != NULL) {
-        result = g_new0(GuestHostName, 1);
-        result->host_name = g_strdup(hostname);
+    g_autofree char *hostname = qemu_get_host_name(errp);
+
+    /*
+     * We want to avoid using g_get_host_name() because that
+     * caches the result and we wouldn't reflect changes in the
+     * host name.
+     */
+
+    if (!hostname) {
+        hostname = g_strdup("localhost");
     }
+
+    result = g_new0(GuestHostName, 1);
+    result->host_name = g_steal_pointer(&hostname);
     return result;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7952.21061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkm-0000jk-V7; Fri, 16 Oct 2020 11:18:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7952.21061; Fri, 16 Oct 2020 11:18:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkm-0000jc-S4; Fri, 16 Oct 2020 11:18:32 +0000
Received: by outflank-mailman (input) for mailman id 7952;
 Fri, 16 Oct 2020 11:18:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNkl-0000jV-TE
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 270474eb-ba2d-400c-bc36-baaf8b7863e0;
 Fri, 16 Oct 2020 11:18:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkl-0002I5-0t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkk-0002Lr-Vb
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNkl-0000jV-TE
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:31 +0000
X-Inumbo-ID: 270474eb-ba2d-400c-bc36-baaf8b7863e0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 270474eb-ba2d-400c-bc36-baaf8b7863e0;
	Fri, 16 Oct 2020 11:18:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gDxTezBYuf18DIpaw3H924dpAIoJVR8qKp33uBsjsyg=; b=dpb7bakTZ/bYJn0fK/4/i03SMC
	fJRMHEliVawOhskdjsxhvnJp1Ro3/iPRZbGYPn58H+AFZhDPal2hKrQ0Owlsv3pkLSLsIq8/AiW8X
	zqJGE2LAaBUYxr+xIu3+/y9hwpJi2z9psTFTATfwFeOy2OKGn5S/lSzXFFsPRkTgkCr8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkl-0002I5-0t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkk-0002Lr-Vb
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] docs/orangepi: Add instructions for resizing SD image to power of two
Message-Id: <E1kTNkk-0002Lr-Vb@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:30 +0000

commit acb988e20cf1ae07f7926dea557bb27080a418d4
Author:     Niek Linnenbank <nieklinnenbank@gmail.com>
AuthorDate: Sun Jul 12 20:37:08 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    docs/orangepi: Add instructions for resizing SD image to power of two
    
    SD cards need to have a size of a power of two.
    Update the Orange Pi machine documentation to include
    instructions for resizing downloaded images using the
    qemu-img command.
    
    Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200712183708.15450-1-nieklinnenbank@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    (cherry picked from commit 1c2329b5d644bad16e888d095e2021ad682201d9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 docs/system/arm/orangepi.rst | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst
index c41adad488..6f23907fb6 100644
--- a/docs/system/arm/orangepi.rst
+++ b/docs/system/arm/orangepi.rst
@@ -127,6 +127,16 @@ can be downloaded from:
 Alternatively, you can also choose to build you own image with buildroot
 using the orangepi_pc_defconfig. Also see https://buildroot.org for more information.
 
+When using an image as an SD card, it must be resized to a power of two. This can be
+done with the qemu-img command. It is recommended to only increase the image size
+instead of shrinking it to a power of two, to avoid loss of data. For example,
+to prepare a downloaded Armbian image, first extract it and then increase
+its size to one gigabyte as follows:
+
+.. code-block:: bash
+
+  $ qemu-img resize Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img 1G
+
 You can choose to attach the selected image either as an SD card or as USB mass storage.
 For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd
 argument and provide the proper root= kernel parameter:
@@ -213,12 +223,12 @@ Next, unzip the NetBSD image and write the U-Boot binary including SPL using:
   $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc
 
 Finally, before starting the machine the SD image must be extended such
-that the NetBSD kernel will not conclude the NetBSD partition is larger than
-the emulated SD card:
+that the size of the SD image is a power of two and that the NetBSD kernel
+will not conclude the NetBSD partition is larger than the emulated SD card:
 
 .. code-block:: bash
 
-  $ dd if=/dev/zero bs=1M count=64 >> armv7.img
+  $ qemu-img resize armv7.img 2G
 
 Start the machine using the following command:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7953.21065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkx-0000lK-0J; Fri, 16 Oct 2020 11:18:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7953.21065; Fri, 16 Oct 2020 11:18:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNkw-0000lC-Te; Fri, 16 Oct 2020 11:18:42 +0000
Received: by outflank-mailman (input) for mailman id 7953;
 Fri, 16 Oct 2020 11:18:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNkw-0000kd-0L
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0a58569c-4dd4-49ac-a0a1-893c03f16acc;
 Fri, 16 Oct 2020 11:18:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkv-0002IB-4t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNkv-0002Ml-3F
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNkw-0000kd-0L
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:42 +0000
X-Inumbo-ID: 0a58569c-4dd4-49ac-a0a1-893c03f16acc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0a58569c-4dd4-49ac-a0a1-893c03f16acc;
	Fri, 16 Oct 2020 11:18:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o2sIFFpu8xeCNcZzDZ1/h4rKn0m1dgc3Trv0W0bqL3g=; b=EA1gVGxfYlpj6LNAyqHtAdh+be
	+mprqZkqIa82OLL39KYLrx92e6uRl14K6okAHJjSW9szvQTLP23t2mh1eg+nAY2eU/mcYm4DaUGQj
	YFlJZogVHlpiyyWUc40Pv7dsBYg18etwVwQR1sn/fHVoTVzEdi5kuiQG8+h6HueNeFNs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkv-0002IB-4t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNkv-0002Ml-3F
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
Message-Id: <E1kTNkv-0002Ml-3F@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:41 +0000

commit 7b41093d14a02770af49cf472088e8a9d9ff9001
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:45:33 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
    
    Avocado tags are handy to automatically select tests matching
    the tags. Since these tests use a SD card, tag them.
    
    We can run all the tests using a SD card at once with:
    
      $ avocado --show=app run -t u-boot tests/acceptance/
      $ AVOCADO_ALLOW_LARGE_STORAGE=ok \
        avocado --show=app \
          run -t device:sd tests/acceptance/
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
       (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd: PASS (19.56 s)
       (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic: PASS (49.97 s)
       (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: PASS (20.06 s)
      RESULTS    : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
      JOB TIME   : 90.02 s
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-4-f4bug@amsat.org>
    (cherry picked from commit b7dcbf1395da960ec3c313300dc0030674de8cd1)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index f825cd9ef5..d864d22ca8 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -583,6 +583,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
@@ -632,6 +633,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
 
         # This test download a 196MB compressed image and expand it to 932MB...
@@ -673,6 +675,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         # This test download a 304MB compressed image and expand it to 1.3GB...
         deb_url = ('http://snapshot.debian.org/archive/debian/'
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:18:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:18:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7954.21069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNl8-0000mi-2C; Fri, 16 Oct 2020 11:18:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7954.21069; Fri, 16 Oct 2020 11:18:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNl7-0000mY-VD; Fri, 16 Oct 2020 11:18:53 +0000
Received: by outflank-mailman (input) for mailman id 7954;
 Fri, 16 Oct 2020 11:18:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNl6-0000mK-Gt
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9302dc12-41c6-465b-9990-0943ff1f84ea;
 Fri, 16 Oct 2020 11:18:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNl5-0002IO-8Q
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNl5-0002NK-7C
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNl6-0000mK-Gt
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:52 +0000
X-Inumbo-ID: 9302dc12-41c6-465b-9990-0943ff1f84ea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9302dc12-41c6-465b-9990-0943ff1f84ea;
	Fri, 16 Oct 2020 11:18:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xjw+0hkY9v0W/0nluNCiT46KmIPfrtbRC9SA1aR9Dig=; b=Olhl37oM/NyRctrsYtOnMNGCta
	lfckoCwNUG0xRpvPc3g0wiXd4TrZdkdECM7JgaQxmPvoa7vl13OnNXKV+eUhK4D/2W+Rb6jnDL+4S
	Jg2mFPMsBoCbw3wTodVCxPe7YmLwmxhO6XiFvUcSXVxHR0gIG9GcVDV37c+mAdnJEE7k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNl5-0002IO-8Q
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNl5-0002NK-7C
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:18:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests/acceptance: allow console interaction with specific VMs
Message-Id: <E1kTNl5-0002NK-7C@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:18:51 +0000

commit f756254e0aca5e29bb3216ab052cd28e6ee46c2b
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:04:39 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: allow console interaction with specific VMs
    
    Console interaction in avocado scripts was possible only with single
    default VM.
    This patch modifies the function parameters to allow passing a specific
    VM as a parameter to interact with it.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Reviewed-by: Willian Rampazzo <willianr@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073587933.20809.5122618715976660635.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit a5ba86d423c2b071894d86c60487f2317c7ffb60)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 59e7b4f763..77d1c1d9ff 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -69,13 +69,15 @@ def pick_default_qemu_bin(arch=None):
 
 
 def _console_interaction(test, success_message, failure_message,
-                         send_string, keep_sending=False):
+                         send_string, keep_sending=False, vm=None):
     assert not keep_sending or send_string
-    console = test.vm.console_socket.makefile()
+    if vm is None:
+        vm = test.vm
+    console = vm.console_socket.makefile()
     console_logger = logging.getLogger('console')
     while True:
         if send_string:
-            test.vm.console_socket.sendall(send_string.encode())
+            vm.console_socket.sendall(send_string.encode())
             if not keep_sending:
                 send_string = None # send only once
         msg = console.readline().strip()
@@ -115,7 +117,8 @@ def interrupt_interactive_console_until_pattern(test, success_message,
     _console_interaction(test, success_message, failure_message,
                          interrupt_string, True)
 
-def wait_for_console_pattern(test, success_message, failure_message=None):
+def wait_for_console_pattern(test, success_message, failure_message=None,
+                             vm=None):
     """
     Waits for messages to appear on the console, while logging the content
 
@@ -125,7 +128,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None):
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
     """
-    _console_interaction(test, success_message, failure_message, None)
+    _console_interaction(test, success_message, failure_message, None, vm=vm)
 
 def exec_command_and_wait_for_pattern(test, command,
                                       success_message, failure_message=None):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7955.21073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlI-0000nq-3k; Fri, 16 Oct 2020 11:19:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7955.21073; Fri, 16 Oct 2020 11:19:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlI-0000nk-0T; Fri, 16 Oct 2020 11:19:04 +0000
Received: by outflank-mailman (input) for mailman id 7955;
 Fri, 16 Oct 2020 11:19:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNlG-0000nc-TW
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 720f050b-0ebd-46cd-807a-5cce5d67c148;
 Fri, 16 Oct 2020 11:19:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlF-0002IW-Cm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlF-0002Nq-Ar
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNlG-0000nc-TW
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:02 +0000
X-Inumbo-ID: 720f050b-0ebd-46cd-807a-5cce5d67c148
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 720f050b-0ebd-46cd-807a-5cce5d67c148;
	Fri, 16 Oct 2020 11:19:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qRJhCInLsBAEhglnVqu/bsFQ141knt4RwNrEABIUpiU=; b=CRLUJjFR0taOm6M/F7WODz1lKm
	qLZCUXGRAf2Ii3RAmJJ/ZuyVS/zMRlSOdprZVMYxPQVhmUEGlx0FLjso46isjFtxHkLxqQSSUUCAy
	965zVkC5F1wUWrT3owdLo3gq4BysQIifCfIJsHe2JVsyBi8FP1PAbNJZC/ozutJaOPLY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlF-0002IW-Cm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlF-0002Nq-Ar
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests/acceptance: refactor boot_linux to allow code reuse
Message-Id: <E1kTNlF-0002Nq-Ar@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:01 +0000

commit 5bdcc0f3ed96effbff61b08ea55699c2cebae5e5
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:05:31 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: refactor boot_linux to allow code reuse
    
    This patch moves image downloading functions to the separate class to allow
    reusing them from record/replay tests.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073593167.20809.17582679291556188984.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit 1c80c87c8c2489e4318c93c844aa29bc1d014146)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux.py | 49 +++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
index 075a386300..3aa57e88b0 100644
--- a/tests/acceptance/boot_linux.py
+++ b/tests/acceptance/boot_linux.py
@@ -26,22 +26,8 @@ KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
 TCG_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "TCG"
 
 
-class BootLinux(Test):
-    """
-    Boots a Linux system, checking for a successful initialization
-    """
-
-    timeout = 900
-    chksum = None
-
-    def setUp(self):
-        super(BootLinux, self).setUp()
-        self.vm.add_args('-smp', '2')
-        self.vm.add_args('-m', '1024')
-        self.prepare_boot()
-        self.prepare_cloudinit()
-
-    def prepare_boot(self):
+class BootLinuxBase(Test):
+    def download_boot(self):
         self.log.debug('Looking for and selecting a qemu-img binary to be '
                        'used to create the bootable snapshot image')
         # If qemu-img has been built, use it, otherwise the system wide one
@@ -60,17 +46,17 @@ class BootLinux(Test):
         if image_arch == 'ppc64':
             image_arch = 'ppc64le'
         try:
-            self.boot = vmimage.get(
+            boot = vmimage.get(
                 'fedora', arch=image_arch, version='31',
                 checksum=self.chksum,
                 algorithm='sha256',
                 cache_dir=self.cache_dirs[0],
                 snapshot_dir=self.workdir)
-            self.vm.add_args('-drive', 'file=%s' % self.boot.path)
         except:
             self.cancel('Failed to download/prepare boot image')
+        return boot.path
 
-    def prepare_cloudinit(self):
+    def download_cloudinit(self):
         self.log.info('Preparing cloudinit image')
         try:
             cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
@@ -81,9 +67,32 @@ class BootLinux(Test):
                           # QEMU's hard coded usermode router address
                           phone_home_host='10.0.2.2',
                           phone_home_port=self.phone_home_port)
-            self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
         except Exception:
             self.cancel('Failed to prepared cloudinit image')
+        return cloudinit_iso
+
+class BootLinux(BootLinuxBase):
+    """
+    Boots a Linux system, checking for a successful initialization
+    """
+
+    timeout = 900
+    chksum = None
+
+    def setUp(self):
+        super(BootLinux, self).setUp()
+        self.vm.add_args('-smp', '2')
+        self.vm.add_args('-m', '1024')
+        self.prepare_boot()
+        self.prepare_cloudinit()
+
+    def prepare_boot(self):
+        path = self.download_boot()
+        self.vm.add_args('-drive', 'file=%s' % path)
+
+    def prepare_cloudinit(self):
+        cloudinit_iso = self.download_cloudinit()
+        self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
 
     def launch_and_wait(self):
         self.vm.set_console()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7956.21077 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlR-0000p6-4s; Fri, 16 Oct 2020 11:19:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7956.21077; Fri, 16 Oct 2020 11:19:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlR-0000oy-1y; Fri, 16 Oct 2020 11:19:13 +0000
Received: by outflank-mailman (input) for mailman id 7956;
 Fri, 16 Oct 2020 11:19:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNlQ-0000op-CB
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1322a94f-50bc-49a4-b5ec-79251cf5dfe6;
 Fri, 16 Oct 2020 11:19:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlP-0002Iu-Fj
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlP-0002OT-F6
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNlQ-0000op-CB
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:12 +0000
X-Inumbo-ID: 1322a94f-50bc-49a4-b5ec-79251cf5dfe6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1322a94f-50bc-49a4-b5ec-79251cf5dfe6;
	Fri, 16 Oct 2020 11:19:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YPAjKHNw/dVoBOmD/B7HYvMGfIWKS74GuvWyrfBIMs0=; b=W2cfyz/dqCVMyvliYGJrP2eurS
	7o3CkkQ6S5+haW6+RbbAaREISwn2evS/rMuoCZgmeohiTIx+Teyen8jQ/yWa77MQjSMKw/tdW2DVz
	Atw3r13nxB5kjnzh1slwd+Wcg76tbgwRru8H3W9eVSyYRbm5zFlHEnDPj3I2RgCx7+pg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlP-0002Iu-Fj
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlP-0002OT-F6
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests/acceptance: refactor boot_linux_console test to allow code reuse
Message-Id: <E1kTNlP-0002OT-F6@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:11 +0000

commit bc67d011c3a6a60fdaf790a72ab51bab263c7e9e
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:04:44 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: refactor boot_linux_console test to allow code reuse
    
    This patch splits code in BootLinuxConsole class into two different
    classes to allow reusing it by record/replay tests.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit 12121c496fcc609e23033c4a36399b54f98bcd56)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index d864d22ca8..e4204d8f09 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,19 +28,13 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
-class BootLinuxConsole(Test):
-    """
-    Boots a Linux kernel and checks that the console is operational and the
-    kernel command line is properly passed from QEMU to the kernel
-    """
-
-    timeout = 90
-
+class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
-    def wait_for_console_pattern(self, success_message):
+    def wait_for_console_pattern(self, success_message, vm=None):
         wait_for_console_pattern(self, success_message,
-                                 failure_message='Kernel panic - not syncing')
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
 
     def extract_from_deb(self, deb, path):
         """
@@ -79,6 +73,13 @@ class BootLinuxConsole(Test):
         os.chdir(cwd)
         return os.path.normpath(os.path.join(self.workdir, path))
 
+class BootLinuxConsole(LinuxKernelTest):
+    """
+    Boots a Linux kernel and checks that the console is operational and the
+    kernel command line is properly passed from QEMU to the kernel
+    """
+    timeout = 90
+
     def test_x86_64_pc(self):
         """
         :avocado: tags=arch:x86_64
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7957.21081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlc-0000qe-7m; Fri, 16 Oct 2020 11:19:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7957.21081; Fri, 16 Oct 2020 11:19:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlc-0000qW-4q; Fri, 16 Oct 2020 11:19:24 +0000
Received: by outflank-mailman (input) for mailman id 7957;
 Fri, 16 Oct 2020 11:19:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNla-0000qN-Lb
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4dd0f2c5-bce9-4046-b3c5-b16737c83ed9;
 Fri, 16 Oct 2020 11:19:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlZ-0002J4-Ja
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlZ-0002PQ-I2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNla-0000qN-Lb
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:22 +0000
X-Inumbo-ID: 4dd0f2c5-bce9-4046-b3c5-b16737c83ed9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4dd0f2c5-bce9-4046-b3c5-b16737c83ed9;
	Fri, 16 Oct 2020 11:19:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7TWuIdaBDWX8P/VSOFCnX5ShrLx9FlEqADN+hNdzw8o=; b=EbZd45FXSWCpAD0PfjoRwOhDkl
	jNdeubOEPj+TtQ8wqvFRHAdoy+TFPcWVC3GiuGn7fJ8c/mwLRDOZ9L3DNx9ekkrwozXhvXTniMZVD
	OUa8ioVryvM905/Z62TtxkLb1QlDnxoFx8IfPE+7WfBaX4IzXX2YImouw0NMtw2bIXhc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlZ-0002J4-Ja
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlZ-0002PQ-I2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests/acceptance/boot_linux: Expand SD card image to power of 2
Message-Id: <E1kTNlZ-0002PQ-I2@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:21 +0000

commit b6f4d5bf209542ee9521d36bd891ad630e7c80b4
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 15:05:27 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance/boot_linux: Expand SD card image to power of 2
    
    In few commits we won't allow SD card images with invalid size
    (not aligned to a power of 2). Prepare the tests: add the
    pow2ceil() and image_pow2ceil_expand() methods and resize the
    images (expanding) of the tests using SD cards.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-5-f4bug@amsat.org>
    (cherry picked from commit 6a289a5ba3383e17fb47029720425bef42e424d7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index e4204d8f09..db901c1348 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,6 +28,22 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
+"""
+Round up to next power of 2
+"""
+def pow2ceil(x):
+    return 1 if x == 0 else 2**(x - 1).bit_length()
+
+"""
+Expand file size to next power of 2
+"""
+def image_pow2ceil_expand(path):
+        size = os.path.getsize(path)
+        size_aligned = pow2ceil(size)
+        if size != size_aligned:
+            with open(path, 'ab+') as fd:
+                fd.truncate(size_aligned)
+
 class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
@@ -600,6 +616,7 @@ class BootLinuxConsole(LinuxKernelTest):
         rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
         rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
         archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
+        image_pow2ceil_expand(rootfs_path)
 
         self.vm.set_console()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -637,7 +654,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=device:sd
         """
 
-        # This test download a 196MB compressed image and expand it to 932MB...
+        # This test download a 196MB compressed image and expand it to 1GB
         image_url = ('https://dl.armbian.com/orangepipc/archive/'
                      'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
         image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
@@ -645,6 +662,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
         image_path = os.path.join(self.workdir, image_name)
         process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
+        image_pow2ceil_expand(image_path)
 
         self.vm.set_console()
         self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
@@ -678,7 +696,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=machine:orangepi-pc
         :avocado: tags=device:sd
         """
-        # This test download a 304MB compressed image and expand it to 1.3GB...
+        # This test download a 304MB compressed image and expand it to 2GB
         deb_url = ('http://snapshot.debian.org/archive/debian/'
                    '20200108T145233Z/pool/main/u/u-boot/'
                    'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
@@ -695,8 +713,9 @@ class BootLinuxConsole(LinuxKernelTest):
         image_hash = '2babb29d36d8360adcb39c09e31060945259917a'
         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
         image_path = os.path.join(self.workdir, 'armv7.img')
-        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
         archive.gzip_uncompress(image_path_gz, image_path)
+        image_pow2ceil_expand(image_path)
+        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
 
         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
         with open(uboot_path, 'rb') as f_in:
@@ -704,12 +723,6 @@ class BootLinuxConsole(LinuxKernelTest):
                 f_out.seek(8 * 1024)
                 shutil.copyfileobj(f_in, f_out)
 
-                # Extend image, to avoid that NetBSD thinks the partition
-                # inside the image is larger than device size itself
-                f_out.seek(0, 2)
-                f_out.seek(64 * 1024 * 1024, 1)
-                f_out.write(bytearray([0x00]))
-
         self.vm.set_console()
         self.vm.add_args('-nic', 'user',
                          '-drive', image_drive_args,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7958.21085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlm-0000rv-9f; Fri, 16 Oct 2020 11:19:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7958.21085; Fri, 16 Oct 2020 11:19:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlm-0000rm-6O; Fri, 16 Oct 2020 11:19:34 +0000
Received: by outflank-mailman (input) for mailman id 7958;
 Fri, 16 Oct 2020 11:19:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNlk-0000ra-Ev
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 488cfd1b-c62e-45be-83be-b3e270f9b423;
 Fri, 16 Oct 2020 11:19:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlj-0002Jf-MZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlj-0002Px-Lr
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNlk-0000ra-Ev
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:32 +0000
X-Inumbo-ID: 488cfd1b-c62e-45be-83be-b3e270f9b423
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 488cfd1b-c62e-45be-83be-b3e270f9b423;
	Fri, 16 Oct 2020 11:19:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UizDsbKO1XywzBRZRBHPCHgge3tRMpmaZcgIITMs9yI=; b=dQb/xykhW5J66tW9BSR3yswNQy
	ZwDB6uSl2+xwLZsY3U1el1bthLZTNjYWKSZljNnR0XxjtGMmXBHFx9OqM/MMx16/xRak3XlRyRT8P
	axzkNx7qv8lmFPEA3tQxtlZ6s4yL1OhoBuxNsOLgpXmFqmjt3uOcRo9gst8IHqEvTt74=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlj-0002Jf-MZ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlj-0002Px-Lr
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
Message-Id: <E1kTNlj-0002Px-Lr@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:31 +0000

commit 557980ba70dba65bde208b03b902f419921b307a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Wed Jun 3 19:59:16 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
    
    Only SCSD cards support Class 6 (Block Oriented Write Protection)
    commands.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.14 Command Functional Difference in Card Capacity Types
    
      * Write Protected Group
    
      SDHC and SDXC do not support write-protected groups. Issuing
      CMD28, CMD29 and CMD30 generates the ILLEGAL_COMMAND error.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-7-f4bug@amsat.org>
    (cherry picked from commit 9157dd597d293ab7f599f4d96c3fe8a6e07c633d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3c06a0ac6d..da39590f58 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -905,6 +905,11 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
         sd->multi_blk_cnt = 0;
     }
 
+    if (sd_cmd_class[req.cmd] == 6 && FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
+        /* Only Standard Capacity cards support class 6 commands */
+        return sd_illegal;
+    }
+
     switch (req.cmd) {
     /* Basic commands (Class 0 and Class 1) */
     case 0:	/* CMD0:   GO_IDLE_STATE */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7959.21088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlw-0000tp-Av; Fri, 16 Oct 2020 11:19:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7959.21088; Fri, 16 Oct 2020 11:19:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNlw-0000tg-7z; Fri, 16 Oct 2020 11:19:44 +0000
Received: by outflank-mailman (input) for mailman id 7959;
 Fri, 16 Oct 2020 11:19:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNlu-0000tT-K9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4c925c5f-961b-4c62-99ca-03a60ef222c6;
 Fri, 16 Oct 2020 11:19:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlt-0002Jn-PW
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNlt-0002QR-Oo
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNlu-0000tT-K9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:42 +0000
X-Inumbo-ID: 4c925c5f-961b-4c62-99ca-03a60ef222c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4c925c5f-961b-4c62-99ca-03a60ef222c6;
	Fri, 16 Oct 2020 11:19:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vK5UAC073nIVRskvuBwEuqkXcMaU2So1c/Xzw0l+idE=; b=bVU469iSciXktSBgcuBBcHvJCO
	gCvtFtB55JpZvdbV0RKubM6gUbdrU6r8n9lXkd4Wq/QLxcNeQGudy1NbNJK1+VtyOPEu/bAqRVcP4
	hGjWvfqHhIX2mLstZVpOhwHH3pXiROMeDMBstBfrgPU8cMeOzVY5ZpVSAu0Og2X0Lqu0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlt-0002Jn-PW
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNlt-0002QR-Oo
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/sd/sdcard: Simplify realize() a bit
Message-Id: <E1kTNlt-0002QR-Oo@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:41 +0000

commit 6a34f7752f05efbd0f26ea87f9e022469b4ac0d2
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jun 5 22:28:51 2018 -0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Simplify realize() a bit
    
    We don't need to check if sd->blk is set twice.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-18-f4bug@amsat.org>
    (cherry picked from commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index da39590f58..04258f1816 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2090,12 +2090,12 @@ static void sd_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (sd->blk && blk_is_read_only(sd->blk)) {
-        error_setg(errp, "Cannot use read-only drive as SD card");
-        return;
-    }
-
     if (sd->blk) {
+        if (blk_is_read_only(sd->blk)) {
+            error_setg(errp, "Cannot use read-only drive as SD card");
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:19:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7960.21094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNm6-0000v0-Ct; Fri, 16 Oct 2020 11:19:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7960.21094; Fri, 16 Oct 2020 11:19:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNm6-0000uu-9U; Fri, 16 Oct 2020 11:19:54 +0000
Received: by outflank-mailman (input) for mailman id 7960;
 Fri, 16 Oct 2020 11:19:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNm4-0000ui-V8
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c6669e76-1052-4fe1-ab8c-35a2b0145912;
 Fri, 16 Oct 2020 11:19:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNm3-0002Ju-SS
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNm3-0002R8-Rm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNm4-0000ui-V8
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:52 +0000
X-Inumbo-ID: c6669e76-1052-4fe1-ab8c-35a2b0145912
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c6669e76-1052-4fe1-ab8c-35a2b0145912;
	Fri, 16 Oct 2020 11:19:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TBF7UhxCV49rYNLqAaa2J+4F62/Tghz2KaBigJfyEKs=; b=lj0hZ+EfgEoAuaPWUAfIfjKTSW
	lEw4DAaox/FuAdrT1aG1lq2dsA0aonhVg/aMOGHERneS2St1HBnzrKzS7ZaSPy1f5Ty+i56JgKZrf
	CljzSJf5FcXlTpUWtxE+VJN3hvekHuakkA/Np3RWdwL8aJvaSsiKMUlyiZu6cn4gGPn0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNm3-0002Ju-SS
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNm3-0002R8-Rm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:19:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/sd/sdcard: Do not allow invalid SD card sizes
Message-Id: <E1kTNm3-0002R8-Rm@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:19:51 +0000

commit e569ca39faf9dcd34fb7f0911ab1a3f7c3ffc0df
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 13:02:34 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Do not allow invalid SD card sizes
    
    QEMU allows to create SD card with unrealistic sizes. This could
    work, but some guests (at least Linux) consider sizes that are not
    a power of 2 as a firmware bug and fix the card size to the next
    power of 2.
    
    While the possibility to use small SD card images has been seen as
    a feature, it became a bug with CVE-2020-13253, where the guest is
    able to do OOB read/write accesses past the image size end.
    
    In a pair of commits we will fix CVE-2020-13253 as:
    
        Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        WP_VIOLATION errors are not modified: the error bit is set, we
        stay in receive-data state, wait for a stop command. All further
        data transfer is ignored. See the check on sd->card_status at the
        beginning of sd_read_data() and sd_write_data().
    
    While this is the correct behavior, in case QEMU create smaller SD
    cards, guests still try to access past the image size end, and QEMU
    considers this is an invalid address, thus "all further data transfer
    is ignored". This is wrong and make the guest looping until
    eventually timeouts.
    
    Fix by not allowing invalid SD card sizes (suggesting the expected
    size as a hint):
    
      $ qemu-system-arm -M orangepi-pc -drive file=rootfs.ext2,if=sd,format=raw
      qemu-system-arm: Invalid SD card size: 60 MiB
      SD card size has to be a power of 2, e.g. 64 MiB.
      You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
      (note that this will lose data if you make the image smaller than it currently is).
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200713183209.26308-8-f4bug@amsat.org>
    (cherry picked from commit a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 04258f1816..c34435ede4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "qemu/cutils.h"
 #include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "sysemu/block-backend.h"
@@ -2091,11 +2092,35 @@ static void sd_realize(DeviceState *dev, Error **errp)
     }
 
     if (sd->blk) {
+        int64_t blk_size;
+
         if (blk_is_read_only(sd->blk)) {
             error_setg(errp, "Cannot use read-only drive as SD card");
             return;
         }
 
+        blk_size = blk_getlength(sd->blk);
+        if (blk_size > 0 && !is_power_of_2(blk_size)) {
+            int64_t blk_size_aligned = pow2ceil(blk_size);
+            char *blk_size_str;
+
+            blk_size_str = size_to_str(blk_size);
+            error_setg(errp, "Invalid SD card size: %s", blk_size_str);
+            g_free(blk_size_str);
+
+            blk_size_str = size_to_str(blk_size_aligned);
+            error_append_hint(errp,
+                              "SD card size has to be a power of 2, e.g. %s.\n"
+                              "You can resize disk images with"
+                              " 'qemu-img resize <imagefile> <new-size>'\n"
+                              "(note that this will lose data if you make the"
+                              " image smaller than it currently is).\n",
+                              blk_size_str);
+            g_free(blk_size_str);
+
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7961.21097 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmG-0001JI-EC; Fri, 16 Oct 2020 11:20:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7961.21097; Fri, 16 Oct 2020 11:20:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmG-0001J8-Ax; Fri, 16 Oct 2020 11:20:04 +0000
Received: by outflank-mailman (input) for mailman id 7961;
 Fri, 16 Oct 2020 11:20:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNmE-00019X-Tb
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 03481fb9-ab95-4f4e-8bf1-474cffc0e45f;
 Fri, 16 Oct 2020 11:20:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmD-0002KF-Vf
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmD-0002Rx-Uu
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNmE-00019X-Tb
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:02 +0000
X-Inumbo-ID: 03481fb9-ab95-4f4e-8bf1-474cffc0e45f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 03481fb9-ab95-4f4e-8bf1-474cffc0e45f;
	Fri, 16 Oct 2020 11:20:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1YE95aKWv2U4n1jBXivxbNa50M6RhsmfhZcxxFeLtS0=; b=Bu0u9R+IblyEvbhpUJ0/xQ5SFe
	zljvl5vA0Skl/b9kzbXV7weyVGJJXd8uq2VXYHNXlvSIEvjQQTQ5Z0UfQHsa2Maf7444h74RMm40O
	FslIs4gRTAqePHSqAOmA796+00cmeyjNbq2PAUegek6qQHCFxEK0tGqigzRN4pClzFBQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmD-0002KF-Vf
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmD-0002Rx-Uu
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/sd/sdcard: Update coding style to make checkpatch.pl happy
Message-Id: <E1kTNmD-0002Rx-Uu@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:01 +0000

commit c8966bff5f45a09bc335686bef7b1aa4722c3e4f
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:27:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Update coding style to make checkpatch.pl happy
    
    To make the next commit easier to review, clean this code first.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200630133912.9428-3-f4bug@amsat.org>
    (cherry picked from commit 794d68de2f021a6d3874df41d6bbe8590ec05207)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index c34435ede4..b927f7966d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1160,8 +1160,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1176,8 +1177,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1222,12 +1224,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
@@ -1246,12 +1251,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7962.21102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmQ-0001cT-GL; Fri, 16 Oct 2020 11:20:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7962.21102; Fri, 16 Oct 2020 11:20:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmQ-0001cL-Ca; Fri, 16 Oct 2020 11:20:14 +0000
Received: by outflank-mailman (input) for mailman id 7962;
 Fri, 16 Oct 2020 11:20:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNmO-0001c7-W9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 43594257-22bc-4aad-ad34-c3ca83a5dc5a;
 Fri, 16 Oct 2020 11:20:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmO-0002KN-2U
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmO-0002TF-1s
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNmO-0001c7-W9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:13 +0000
X-Inumbo-ID: 43594257-22bc-4aad-ad34-c3ca83a5dc5a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 43594257-22bc-4aad-ad34-c3ca83a5dc5a;
	Fri, 16 Oct 2020 11:20:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OvlbXgYom883wph3mP6GbAvsvYvgHFVM7dl0naRajjM=; b=F6LK8dRioBmwHsQeRYMPlvHDu9
	CvsNggITRLI7I5JdpJYXDBgrz4NG4mx4KuJCO3nJDTbAdK12L4tr6MPf8w5AVOFMDW0NzAxcC8kTK
	Alh/AhRJoecZ4A0F/3OEE4D/255at8WbN5p9DpMO2d5YDMoJ62d9dwOy6RwXJq/ACUU4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmO-0002KN-2U
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmO-0002TF-1s
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
Message-Id: <E1kTNmO-0002TF-1s@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:12 +0000

commit d7fab184e98bc0d482b0203fd3333da972b7ca5f
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jun 4 19:22:29 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
    
    Only move the state machine to ReceivingData if there is no
    pending error. This avoids later OOB access while processing
    commands queued.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.3 Data Read
    
      Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
      4.3.4 Data Write
    
      Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
    WP_VIOLATION errors are not modified: the error bit is set, we
    stay in receive-data state, wait for a stop command. All further
    data transfer is ignored. See the check on sd->card_status at the
    beginning of sd_read_data() and sd_write_data().
    
    Fixes: CVE-2020-13253
    Cc: qemu-stable@nongnu.org
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880822
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-6-f4bug@amsat.org>
    (cherry picked from commit 790762e5487114341cccc5bffcec4cb3c022c3cd)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index b927f7966d..837fe9053d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1156,13 +1156,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 17:	/* CMD17:  READ_SINGLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1173,13 +1175,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 18:	/* CMD18:  READ_MULTIPLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1219,14 +1223,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
@@ -1246,14 +1253,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7963.21105 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNma-0001dx-Ia; Fri, 16 Oct 2020 11:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7963.21105; Fri, 16 Oct 2020 11:20:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNma-0001dp-FR; Fri, 16 Oct 2020 11:20:24 +0000
Received: by outflank-mailman (input) for mailman id 7963;
 Fri, 16 Oct 2020 11:20:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNmY-0001dg-UT
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2f66198d-fdee-4f75-af60-1ff2e87341a7;
 Fri, 16 Oct 2020 11:20:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmY-0002Kb-5S
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmY-0002Tn-4o
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNmY-0001dg-UT
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
X-Inumbo-ID: 2f66198d-fdee-4f75-af60-1ff2e87341a7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2f66198d-fdee-4f75-af60-1ff2e87341a7;
	Fri, 16 Oct 2020 11:20:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0VndqFqI0Z1ifacQ1m6AXRU+9875i3mmJ3O6aLqoLPk=; b=UKhmzVrLzhOeHYtGb5O93QLoSU
	FFwtM8/mtihJnfZf1Mxtxp2b6T9xYnyW5w6JWo/FnNJ+ogetlLRGrRME0OkxUqoryFol8qC79wEes
	Wv+S1CYEF2HwWrRngC94XUDTciaUVsVDgoXC6CEOaX8+RroqkWhzNbpLQ6JzbRpcn4gQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmY-0002Kb-5S
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmY-0002Tn-4o
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] target/hppa: Free some temps in do_sub
Message-Id: <E1kTNmY-0002Tn-4o@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:22 +0000

commit 2f783fb4591fa244447547d226daed643820e2ef
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:35:00 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    target/hppa: Free some temps in do_sub
    
    Two temps allocated but not freed.  Do enough subtractions
    within a single TB and one can run out of temps entirely.
    
    Fixes: b2167459ae ("target-hppa: Implement basic arithmetic")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880287
    Tested-by: Sven Schnelle <svens@stackframe.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org>
    (cherry picked from commit 79826f99feb7222b7804058f0b4ace9ee0546361)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/hppa/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..4bd22d4820 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1,
     save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb);
     save_gpr(ctx, rt, dest);
     tcg_temp_free(dest);
+    tcg_temp_free(cb);
+    tcg_temp_free(cb_msb);
 
     /* Install the new nullification.  */
     cond_free(&ctx->null_cond);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7965.21110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNml-0001fg-L5; Fri, 16 Oct 2020 11:20:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7965.21110; Fri, 16 Oct 2020 11:20:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNml-0001fY-IE; Fri, 16 Oct 2020 11:20:35 +0000
Received: by outflank-mailman (input) for mailman id 7965;
 Fri, 16 Oct 2020 11:20:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNmj-0001el-KQ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ea43ac8d-c781-44bd-8aa5-ea2511f26e6f;
 Fri, 16 Oct 2020 11:20:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmi-0002LR-8R
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNmi-0002UL-7k
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNmj-0001el-KQ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:33 +0000
X-Inumbo-ID: ea43ac8d-c781-44bd-8aa5-ea2511f26e6f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ea43ac8d-c781-44bd-8aa5-ea2511f26e6f;
	Fri, 16 Oct 2020 11:20:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Og8eZeo3vnjEChwOGAC2mz5sUa75vkMeXf7zpCcwgUk=; b=MVSe0UztJJ/2FTC59iYCqQO6i3
	H2qtjS30klxeblzl1ugIH/oBtlDikco+LPCqALzcuoLqT5pKCgyhMteFC7gC/B0+KRDXedFEydTm4
	VKi20iytYWP0ILbV4I7ub09cxxRaKfFDsOnbyNjKooITfBOmL63hxD3Q4Goz90JXrB/o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmi-0002LR-8R
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNmi-0002UL-7k
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tpm: tpm_spapr: Exit on TPM backend failures
Message-Id: <E1kTNmi-0002UL-7k@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:32 +0000

commit 42e9a42083bdb253f32766038fa64063d6351b5e
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:24 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tpm: tpm_spapr: Exit on TPM backend failures
    
    Exit on TPM backend failures in the same way as the TPM CRB and TIS device
    models do. With this change we now get an error report when the backend
    did not start up properly:
    
    error: internal error: qemu unexpectedly closed the monitor:
    2020-07-07T12:49:28.333928Z qemu-system-ppc64: tpm-emulator: \
      TPM result for CMD_INIT: 0x101 operation failed
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-2-stefanb@linux.vnet.ibm.com
    (cherry picked from commit f8b332a1ff107dc014a52eaf9bf547995205f18a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/tpm/tpm_spapr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index ce65eb2e45..b67aafb24e 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
                             TPM_SPAPR_BUFFER_MAX);
 
     tpm_backend_reset(s->be_driver);
-    tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
+
+    if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
+        exit(1);
+    }
 }
 
 static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7966.21114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmu-0001hK-Mc; Fri, 16 Oct 2020 11:20:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7966.21114; Fri, 16 Oct 2020 11:20:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNmu-0001hE-Jb; Fri, 16 Oct 2020 11:20:44 +0000
Received: by outflank-mailman (input) for mailman id 7966;
 Fri, 16 Oct 2020 11:20:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNmt-0001h4-5t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2e5e2f69-d5d0-45fe-adc5-e1f490ea58db;
 Fri, 16 Oct 2020 11:20:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNms-0002LZ-BF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNms-0002Ut-Ac
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNmt-0001h4-5t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:43 +0000
X-Inumbo-ID: 2e5e2f69-d5d0-45fe-adc5-e1f490ea58db
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2e5e2f69-d5d0-45fe-adc5-e1f490ea58db;
	Fri, 16 Oct 2020 11:20:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YAI7TZw1K+h5H0FaAwrPecFnU+h2uWvj9EeC6SkOjF4=; b=TCc6XtW0eJrpKdxixD7JNjVUxQ
	io2UqDXmGZKGnoyFMvmIbbiFDyTe/3QBv3JsU2eMmr0FMadioQ/wXElfVVkSfBJklEqul8xvTkZUt
	LcOjwFaz4Ss2HZYiKC/gcdMBtgGayqNFpdtfhtRfTPw4J1s2P2Nu0aFMq0KOr48Es8i8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNms-0002LZ-BF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNms-0002Ut-Ac
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] tests: tpm: Skip over pcrUpdateCounter byte in result comparison
Message-Id: <E1kTNms-0002Ut-Ac@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:42 +0000

commit d2581f25ec28666b5c6e6ffa4adbffde33181387
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:25 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests: tpm: Skip over pcrUpdateCounter byte in result comparison
    
    The TPM 2 code in libtpms was fixed to handle the PCR 'TCB group' according
    to the PCClient profile. The change of the PCRs belonging to the 'TCB group'
    now affects the pcrUpdateCounter in the TPM2_PCRRead() responses where its
    value is now different (typically lower by '1') than what it was before. To
    not fail the tests, we skip the comparison of the 14th byte, which
    represents the pcrUpdateCounter.
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-3-stefanb@linux.vnet.ibm.com
    (cherry picked from commit df8a7568932e4c3c930fdfeb228dd72b4bb71a1f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/tpm-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index 34efae8f18..58a9593745 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
 
     tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
 
-    g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
+    /* skip pcrUpdateCounter (14th byte) in comparison */
+    g_assert(exp_resp_size >= 15);
+    g_assert_cmpmem(buffer, 13, exp_resp, 13);
+    g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
+                    &exp_resp[14], exp_resp_size - 14);
 }
 
 bool tpm_util_swtpm_has_tpm2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:20:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:20:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7967.21118 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNn4-0001ic-Nw; Fri, 16 Oct 2020 11:20:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7967.21118; Fri, 16 Oct 2020 11:20:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNn4-0001iU-L8; Fri, 16 Oct 2020 11:20:54 +0000
Received: by outflank-mailman (input) for mailman id 7967;
 Fri, 16 Oct 2020 11:20:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNn3-0001iK-Al
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7954d41b-bd99-4b18-aed9-9a054127346f;
 Fri, 16 Oct 2020 11:20:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNn2-0002Lg-EY
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNn2-0002VV-DY
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNn3-0001iK-Al
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:53 +0000
X-Inumbo-ID: 7954d41b-bd99-4b18-aed9-9a054127346f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7954d41b-bd99-4b18-aed9-9a054127346f;
	Fri, 16 Oct 2020 11:20:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H+dHhPaYpCLCP/AI2IPT+oIfzYlvlUog3bt+B5txJLY=; b=AtkmCqlyra7gmS4Xm0L8lr4F4a
	EKYuCIQAzS1IFOsS+mCA4IDmcfe50xy7Hc6w3zx8Z3t3MF2dLYfJNgpB1FXiEg5exLbWi1U0QXFkk
	hutH5LwdQl5vLcbsPQqLfi9yyE6qpvtyTNiPv47s3L19ir9n3PqXF95Od+iBWdLK6D+E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNn2-0002Lg-EY
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNn2-0002VV-DY
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:20:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] qdev: Fix device_add DRIVER,help to print to monitor
Message-Id: <E1kTNn2-0002VV-DY@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:20:52 +0000

commit c16fd8a2bbf54a1d4fc599f6e88f69b8bbeecc28
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:58 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qdev: Fix device_add DRIVER,help to print to monitor
    
    Help on device properties gets printed to stdout instead of the
    monitor.  If you have the monitor anywhere else, no help for you.
    Broken when commit e1043d674d "qdev: use object_property_help()"
    accidentally switched from qemu_printf() to printf().  Switch right
    back.
    
    Fixes: e1043d674d792ff64aebae1a3eafc08b38a8a085
    Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-2-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 029afc4e76041e1a320530d97f99122a1b3d5da2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 9833b33549..6bf6339ff5 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -299,7 +299,7 @@ int qdev_device_help(QemuOpts *opts)
     }
     g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0);
     for (i = 0; i < array->len; i++) {
-        printf("%s\n", (char *)array->pdata[i]);
+        qemu_printf("%s\n", (char *)array->pdata[i]);
     }
     g_ptr_array_set_free_func(array, g_free);
     g_ptr_array_free(array, true);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7968.21123 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnE-0001jp-Pn; Fri, 16 Oct 2020 11:21:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7968.21123; Fri, 16 Oct 2020 11:21:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnE-0001jg-Mc; Fri, 16 Oct 2020 11:21:04 +0000
Received: by outflank-mailman (input) for mailman id 7968;
 Fri, 16 Oct 2020 11:21:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNnD-0001jW-DF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ff7ca16-e3b3-4b93-a01c-518d4fe3a897;
 Fri, 16 Oct 2020 11:21:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnC-0002M3-He
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnC-0002WG-Gw
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNnD-0001jW-DF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:03 +0000
X-Inumbo-ID: 6ff7ca16-e3b3-4b93-a01c-518d4fe3a897
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ff7ca16-e3b3-4b93-a01c-518d4fe3a897;
	Fri, 16 Oct 2020 11:21:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DnORldgSScikOM/YyGW8/nSQrh0cbWRoWUhyPIDTLAg=; b=GbkvGsqWMvvnV6oSIgp8dSYUnm
	IyP9Q+gHCedQRXs6zi+DwhEqhOkRcoOyGQLhYkIqe1v7ovdKOGKYkV06u9DVkWFCitfbMDbakSb4I
	5kijEX/CgOWMA7t54GC5UFyFD+9zbbwxZgcqgQJynAICXt3iBZTNIGdHbLAPJNrWs+s0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnC-0002M3-He
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnC-0002WG-Gw
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: Prevent guest from starting a report when we didn't request one
Message-Id: <E1kTNnC-0002WG-Gw@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:02 +0000

commit 67808fda375e3a795ae84f3fb19b540f954fa96a
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:15 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Prevent guest from starting a report when we didn't request one
    
    Based on code review it appears possible for the driver to force the device
    out of a stopped state when hinting by repeating the last ID it was
    provided.
    
    Prevent this by only allowing a transition to the start state when we are
    in the requested state. This way the driver is only allowed to send one
    descriptor that will transition the device into the start state. All others
    will leave it in the stop state once it has finished.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175115.21935.99563.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 20a4da0f23078deeff5ea6d1e12f47d968d7c3c9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index e20f90dad4..a30a0c7bfa 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -466,7 +466,8 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (id == dev->free_page_report_cmd_id) {
+        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
+            id == dev->free_page_report_cmd_id) {
             dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
         } else {
             /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7969.21127 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnP-0001l4-R5; Fri, 16 Oct 2020 11:21:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7969.21127; Fri, 16 Oct 2020 11:21:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnP-0001kw-OD; Fri, 16 Oct 2020 11:21:15 +0000
Received: by outflank-mailman (input) for mailman id 7969;
 Fri, 16 Oct 2020 11:21:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNnO-0001km-96
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2f8e0eaa-14a6-4b10-a022-c8bade5e95a3;
 Fri, 16 Oct 2020 11:21:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnM-0002MH-Kh
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnM-0002Wt-K1
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNnO-0001km-96
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:14 +0000
X-Inumbo-ID: 2f8e0eaa-14a6-4b10-a022-c8bade5e95a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2f8e0eaa-14a6-4b10-a022-c8bade5e95a3;
	Fri, 16 Oct 2020 11:21:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6mWHNAKJzblgDgSi91pwYCbDHB9gtIyZLuiFyXmgbQI=; b=uNCh/OMT4OBUkkyBmBOatKIJ5U
	N/aQ2G3canjiDeYNKDKdWIX8r7HgycTqqtTszTwSGBAXwJAFz54+gd5rI7KYgiF2dTn7MW3138HVl
	USlAUQDFjuER9EB5bhEKKFOd+QvJStGpNJA8/xVbZCg6W1klcano+O6ptTk8Z3chpjlw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnM-0002MH-Kh
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnM-0002Wt-K1
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: Add locking to prevent possible race when starting hinting
Message-Id: <E1kTNnM-0002Wt-K1@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:12 +0000

commit 7eb63fccf4cc533249bde484daba6e40264d74f9
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:22 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Add locking to prevent possible race when starting hinting
    
    There is already locking in place when we are stopping free page hinting
    but there is not similar protections in place when we start. I can only
    assume this was overlooked as in most cases the page hinting should not be
    occurring when we are starting the hinting, however there is still a chance
    we could be processing hints by the time we get back around to restarting
    the hinting so we are better off making sure to protect the state with the
    mutex lock rather than just updating the value with no protections.
    
    Based on feedback from Peter Maydell this issue had also been spotted by
    Coverity: CID 1430269
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 1a83e0b9c492a0eaeacd6fbb858fc81d04ab9c3e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a30a0c7bfa..d6e31de1d9 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -532,6 +532,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
         return;
     }
 
+    qemu_mutex_lock(&s->free_page_lock);
+
     if (s->free_page_report_cmd_id == UINT_MAX) {
         s->free_page_report_cmd_id =
                        VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
@@ -540,6 +542,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
     }
 
     s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    qemu_mutex_unlock(&s->free_page_lock);
+
     virtio_notify_config(vdev);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7970.21131 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnY-0001mG-TN; Fri, 16 Oct 2020 11:21:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7970.21131; Fri, 16 Oct 2020 11:21:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnY-0001m8-Pf; Fri, 16 Oct 2020 11:21:24 +0000
Received: by outflank-mailman (input) for mailman id 7970;
 Fri, 16 Oct 2020 11:21:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNnX-0001lx-J6
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f4e010d1-6c7d-4be5-b547-81527c712b2e;
 Fri, 16 Oct 2020 11:21:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnW-0002MU-NW
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnW-0002Xe-Mr
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNnX-0001lx-J6
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:23 +0000
X-Inumbo-ID: f4e010d1-6c7d-4be5-b547-81527c712b2e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f4e010d1-6c7d-4be5-b547-81527c712b2e;
	Fri, 16 Oct 2020 11:21:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zyPkmRXRG3RPObeMKRYEzKIVKWXmcnbzyg7MJ52JeGg=; b=mylfVgQ8CnfilKEMhyRmPs+Zp8
	Qh7Ht9uM54vgwDvtuJOB4k2HVAbpKdwjKJFxMlySlco0UwFFGLpYiEvyTYkccx7LOyEQAw0U+fG+r
	hVn4XNIcbCVs6dF9eV5hfbxd7AxLQkR7JMIB33vj80AiPMy53Xl/4BZ4lrh6gk/gRIv4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnW-0002MU-NW
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnW-0002Xe-Mr
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: always indicate S_DONE when migration fails
Message-Id: <E1kTNnW-0002Xe-Mr@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:22 +0000

commit 6261aa4ff5e705a0f5ddd15c53d7b7051bace46d
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Mon Jun 29 10:06:15 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: always indicate S_DONE when migration fails
    
    If something goes wrong during precopy, before stopping the VM, we will
    never send a S_DONE indication to the VM, resulting in the hinted pages
    not getting released to be used by the guest OS (e.g., Linux).
    
    Easy to reproduce:
    1. Start migration (e.g., HMP "migrate -d 'exec:gzip -c > STATEFILE.gz'")
    2. Cancel migration (e.g., HMP "migrate_cancel")
    3. Oberve in the guest (e.g., cat /proc/meminfo) that there is basically
       no free memory left.
    
    While at it, add similar locking to virtio_balloon_free_page_done() as
    done in virtio_balloon_free_page_stop. Locking is still weird, but that
    has to be sorted out separately.
    
    There is nothing to do in the PRECOPY_NOTIFY_COMPLETE case. Add some
    comments regarding S_DONE handling.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200629080615.26022-1-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit dd8eeb9671fc881e613008bd20035b85fe45383d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index d6e31de1d9..6c75db123e 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -572,8 +572,13 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
-    virtio_notify_config(vdev);
+    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+        /* See virtio_balloon_free_page_stop() */
+        qemu_mutex_lock(&s->free_page_lock);
+        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        qemu_mutex_unlock(&s->free_page_lock);
+        virtio_notify_config(vdev);
+    }
 }
 
 static int
@@ -597,17 +602,26 @@ virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
     case PRECOPY_NOTIFY_SETUP:
         precopy_enable_free_page_optimization();
         break;
-    case PRECOPY_NOTIFY_COMPLETE:
-    case PRECOPY_NOTIFY_CLEANUP:
     case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC:
         virtio_balloon_free_page_stop(dev);
         break;
     case PRECOPY_NOTIFY_AFTER_BITMAP_SYNC:
         if (vdev->vm_running) {
             virtio_balloon_free_page_start(dev);
-        } else {
-            virtio_balloon_free_page_done(dev);
+            break;
         }
+        /*
+         * Set S_DONE before migrating the vmstate, so the guest will reuse
+         * all hinted pages once running on the destination. Fall through.
+         */
+    case PRECOPY_NOTIFY_CLEANUP:
+        /*
+         * Especially, if something goes wrong during precopy or if migration
+         * is canceled, we have to properly communicate S_DONE to the VM.
+         */
+        virtio_balloon_free_page_done(dev);
+        break;
+    case PRECOPY_NOTIFY_COMPLETE:
         break;
     default:
         virtio_error(vdev, "%s: %d reason unknown", __func__, pnd->reason);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7971.21135 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnk-0001no-W4; Fri, 16 Oct 2020 11:21:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7971.21135; Fri, 16 Oct 2020 11:21:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnk-0001ng-Sz; Fri, 16 Oct 2020 11:21:36 +0000
Received: by outflank-mailman (input) for mailman id 7971;
 Fri, 16 Oct 2020 11:21:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNnj-0001nX-9L
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fbd921d4-1e28-49d5-ab3f-4b2a09e7d517;
 Fri, 16 Oct 2020 11:21:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNng-0002N3-R1
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNng-0002YC-QI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNnj-0001nX-9L
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:35 +0000
X-Inumbo-ID: fbd921d4-1e28-49d5-ab3f-4b2a09e7d517
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fbd921d4-1e28-49d5-ab3f-4b2a09e7d517;
	Fri, 16 Oct 2020 11:21:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bWbaBk494uM8Yj+Ukw2AYvTKxcLcUtHCc2FE3LQFn8E=; b=56ISCM+B2Qb/0oVVB4xiWr0lm+
	sjlUgDAg96927agAEwtESqnMxatL1uBv6/SyitFd/gRzc6+RgudQCXh/Nhz5KkHMn+WLnBMP1UAQl
	apX+GTwIpf//ZK1kWbf1HhYEKx3LXgtdtdPDUPlQp0u40FJCihKYtaw722HredioxWLI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNng-0002N3-R1
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNng-0002YC-QI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] linux-headers: update against Linux 5.7-rc3
Message-Id: <E1kTNng-0002YC-QI@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:32 +0000

commit 595c40575bf500ff20d508d90fa69caf27e3454d
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Mon Apr 27 12:24:14 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    linux-headers: update against Linux 5.7-rc3
    
    commit 6a8b55ed4056ea5559ebe4f6a4b247f627870d4c
    
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com> # virtio/vhost parts
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200427102415.10915-3-cohuck@redhat.com>
    (cherry picked from commit dc6f8d458a4ccc360723993f31d310d06469f55f)
    *dep for 3219b42f02
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/standard-headers/linux/ethtool.h           |  10 +-
 include/standard-headers/linux/input-event-codes.h |   5 +-
 include/standard-headers/linux/pci_regs.h          |   2 +
 include/standard-headers/linux/vhost_types.h       |   8 ++
 include/standard-headers/linux/virtio_balloon.h    |  12 ++-
 include/standard-headers/linux/virtio_ids.h        |   1 +
 include/standard-headers/linux/virtio_net.h        | 102 ++++++++++++++++++++-
 linux-headers/COPYING                              |   2 +
 linux-headers/asm-x86/kvm.h                        |   1 +
 linux-headers/asm-x86/unistd_32.h                  |   1 +
 linux-headers/asm-x86/unistd_64.h                  |   1 +
 linux-headers/asm-x86/unistd_x32.h                 |   1 +
 linux-headers/linux/kvm.h                          |  47 +++++++++-
 linux-headers/linux/mman.h                         |   5 +-
 linux-headers/linux/userfaultfd.h                  |  40 ++++++--
 linux-headers/linux/vfio.h                         |  37 ++++++++
 linux-headers/linux/vhost.h                        |  24 +++++
 17 files changed, 280 insertions(+), 19 deletions(-)

diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h
index 8adf3b018b..1200890c86 100644
--- a/include/standard-headers/linux/ethtool.h
+++ b/include/standard-headers/linux/ethtool.h
@@ -596,6 +596,9 @@ struct ethtool_pauseparam {
  * @ETH_SS_LINK_MODES: link mode names
  * @ETH_SS_MSG_CLASSES: debug message class names
  * @ETH_SS_WOL_MODES: wake-on-lan modes
+ * @ETH_SS_SOF_TIMESTAMPING: SOF_TIMESTAMPING_* flags
+ * @ETH_SS_TS_TX_TYPES: timestamping Tx types
+ * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
  */
 enum ethtool_stringset {
 	ETH_SS_TEST		= 0,
@@ -610,6 +613,9 @@ enum ethtool_stringset {
 	ETH_SS_LINK_MODES,
 	ETH_SS_MSG_CLASSES,
 	ETH_SS_WOL_MODES,
+	ETH_SS_SOF_TIMESTAMPING,
+	ETH_SS_TS_TX_TYPES,
+	ETH_SS_TS_RX_FILTERS,
 
 	/* add new constants above here */
 	ETH_SS_COUNT
@@ -1330,6 +1336,7 @@ enum ethtool_fec_config_bits {
 	ETHTOOL_FEC_OFF_BIT,
 	ETHTOOL_FEC_RS_BIT,
 	ETHTOOL_FEC_BASER_BIT,
+	ETHTOOL_FEC_LLRS_BIT,
 };
 
 #define ETHTOOL_FEC_NONE		(1 << ETHTOOL_FEC_NONE_BIT)
@@ -1337,6 +1344,7 @@ enum ethtool_fec_config_bits {
 #define ETHTOOL_FEC_OFF			(1 << ETHTOOL_FEC_OFF_BIT)
 #define ETHTOOL_FEC_RS			(1 << ETHTOOL_FEC_RS_BIT)
 #define ETHTOOL_FEC_BASER		(1 << ETHTOOL_FEC_BASER_BIT)
+#define ETHTOOL_FEC_LLRS		(1 << ETHTOOL_FEC_LLRS_BIT)
 
 /* CMDs currently supported */
 #define ETHTOOL_GSET		0x00000001 /* DEPRECATED, Get settings.
@@ -1521,7 +1529,7 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
 	ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT	 = 72,
 	ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT	 = 73,
-
+	ETHTOOL_LINK_MODE_FEC_LLRS_BIT			 = 74,
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
 };
diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h
index b484c25289..ebf72c1031 100644
--- a/include/standard-headers/linux/input-event-codes.h
+++ b/include/standard-headers/linux/input-event-codes.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
 /*
  * Input event codes
  *
@@ -652,6 +652,9 @@
 /* Electronic privacy screen control */
 #define KEY_PRIVACY_SCREEN_TOGGLE	0x279
 
+/* Select an area of screen to be copied */
+#define KEY_SELECTIVE_SCREENSHOT	0x27a
+
 /*
  * Some keyboards have keys which do not have a defined meaning, these keys
  * are intended to be programmed / bound to macros by the user. For most
diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h
index 5437690483..f9701410d3 100644
--- a/include/standard-headers/linux/pci_regs.h
+++ b/include/standard-headers/linux/pci_regs.h
@@ -605,6 +605,7 @@
 #define  PCI_EXP_SLTCTL_PWR_OFF        0x0400 /* Power Off */
 #define  PCI_EXP_SLTCTL_EIC	0x0800	/* Electromechanical Interlock Control */
 #define  PCI_EXP_SLTCTL_DLLSCE	0x1000	/* Data Link Layer State Changed Enable */
+#define  PCI_EXP_SLTCTL_IBPD_DISABLE	0x4000 /* In-band PD disable */
 #define PCI_EXP_SLTSTA		26	/* Slot Status */
 #define  PCI_EXP_SLTSTA_ABP	0x0001	/* Attention Button Pressed */
 #define  PCI_EXP_SLTSTA_PFD	0x0002	/* Power Fault Detected */
@@ -680,6 +681,7 @@
 #define PCI_EXP_LNKSTA2		50	/* Link Status 2 */
 #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2	52	/* v2 endpoints with link end here */
 #define PCI_EXP_SLTCAP2		52	/* Slot Capabilities 2 */
+#define  PCI_EXP_SLTCAP2_IBPD	0x00000001 /* In-band PD Disable Supported */
 #define PCI_EXP_SLTCTL2		56	/* Slot Control 2 */
 #define PCI_EXP_SLTSTA2		58	/* Slot Status 2 */
 
diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-headers/linux/vhost_types.h
index 5351fe172d..a678d8fbaa 100644
--- a/include/standard-headers/linux/vhost_types.h
+++ b/include/standard-headers/linux/vhost_types.h
@@ -119,6 +119,14 @@ struct vhost_scsi_target {
 	unsigned short reserved;
 };
 
+/* VHOST_VDPA specific definitions */
+
+struct vhost_vdpa_config {
+	uint32_t off;
+	uint32_t len;
+	uint8_t buf[0];
+};
+
 /* Feature bits */
 /* Log all write descriptors. Can be changed while device is active. */
 #define VHOST_F_LOG_ALL 26
diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h
index 9375ca2a70..f343bfefd8 100644
--- a/include/standard-headers/linux/virtio_balloon.h
+++ b/include/standard-headers/linux/virtio_balloon.h
@@ -36,6 +36,7 @@
 #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM	2 /* Deflate balloon on OOM */
 #define VIRTIO_BALLOON_F_FREE_PAGE_HINT	3 /* VQ to report free pages */
 #define VIRTIO_BALLOON_F_PAGE_POISON	4 /* Guest is using page poisoning */
+#define VIRTIO_BALLOON_F_REPORTING	5 /* Page reporting virtqueue */
 
 /* Size of a PFN in the balloon interface. */
 #define VIRTIO_BALLOON_PFN_SHIFT 12
@@ -47,8 +48,15 @@ struct virtio_balloon_config {
 	uint32_t num_pages;
 	/* Number of pages we've actually got in balloon. */
 	uint32_t actual;
-	/* Free page report command id, readonly by guest */
-	uint32_t free_page_report_cmd_id;
+	/*
+	 * Free page hint command id, readonly by guest.
+	 * Was previously named free_page_report_cmd_id so we
+	 * need to carry that name for legacy support.
+	 */
+	union {
+		uint32_t free_page_hint_cmd_id;
+		uint32_t free_page_report_cmd_id;	/* deprecated */
+	};
 	/* Stores PAGE_POISON if page poisoning is in use */
 	uint32_t poison_val;
 };
diff --git a/include/standard-headers/linux/virtio_ids.h b/include/standard-headers/linux/virtio_ids.h
index 585e07b273..ecc27a1740 100644
--- a/include/standard-headers/linux/virtio_ids.h
+++ b/include/standard-headers/linux/virtio_ids.h
@@ -46,5 +46,6 @@
 #define VIRTIO_ID_IOMMU        23 /* virtio IOMMU */
 #define VIRTIO_ID_FS           26 /* virtio filesystem */
 #define VIRTIO_ID_PMEM         27 /* virtio pmem */
+#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */
 
 #endif /* _LINUX_VIRTIO_IDS_H */
diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h
index 260c3681d7..a90f79e1b1 100644
--- a/include/standard-headers/linux/virtio_net.h
+++ b/include/standard-headers/linux/virtio_net.h
@@ -57,6 +57,9 @@
 					 * Steering */
 #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
 
+#define VIRTIO_NET_F_HASH_REPORT  57	/* Supports hash report */
+#define VIRTIO_NET_F_RSS	  60	/* Supports RSS RX steering */
+#define VIRTIO_NET_F_RSC_EXT	  61	/* extended coalescing info */
 #define VIRTIO_NET_F_STANDBY	  62	/* Act as standby for another device
 					 * with the same MAC.
 					 */
@@ -69,6 +72,17 @@
 #define VIRTIO_NET_S_LINK_UP	1	/* Link is up */
 #define VIRTIO_NET_S_ANNOUNCE	2	/* Announcement is needed */
 
+/* supported/enabled hash types */
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv4          (1 << 0)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4         (1 << 1)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4         (1 << 2)
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv6          (1 << 3)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6         (1 << 4)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6         (1 << 5)
+#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX         (1 << 6)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX        (1 << 7)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX        (1 << 8)
+
 struct virtio_net_config {
 	/* The config defining mac address (if VIRTIO_NET_F_MAC) */
 	uint8_t mac[ETH_ALEN];
@@ -92,6 +106,12 @@ struct virtio_net_config {
 	 * Any other value stands for unknown.
 	 */
 	uint8_t duplex;
+	/* maximum size of RSS key */
+	uint8_t rss_max_key_size;
+	/* maximum number of indirection table entries */
+	uint16_t rss_max_indirection_table_length;
+	/* bitmask of supported VIRTIO_NET_RSS_HASH_ types */
+	uint32_t supported_hash_types;
 } QEMU_PACKED;
 
 /*
@@ -104,6 +124,7 @@ struct virtio_net_config {
 struct virtio_net_hdr_v1 {
 #define VIRTIO_NET_HDR_F_NEEDS_CSUM	1	/* Use csum_start, csum_offset */
 #define VIRTIO_NET_HDR_F_DATA_VALID	2	/* Csum is valid */
+#define VIRTIO_NET_HDR_F_RSC_INFO	4	/* rsc info in csum_ fields */
 	uint8_t flags;
 #define VIRTIO_NET_HDR_GSO_NONE		0	/* Not a GSO frame */
 #define VIRTIO_NET_HDR_GSO_TCPV4	1	/* GSO frame, IPv4 TCP (TSO) */
@@ -113,11 +134,46 @@ struct virtio_net_hdr_v1 {
 	uint8_t gso_type;
 	__virtio16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
 	__virtio16 gso_size;	/* Bytes to append to hdr_len per frame */
-	__virtio16 csum_start;	/* Position to start checksumming from */
-	__virtio16 csum_offset;	/* Offset after that to place checksum */
+	union {
+		struct {
+			__virtio16 csum_start;
+			__virtio16 csum_offset;
+		};
+		/* Checksum calculation */
+		struct {
+			/* Position to start checksumming from */
+			__virtio16 start;
+			/* Offset after that to place checksum */
+			__virtio16 offset;
+		} csum;
+		/* Receive Segment Coalescing */
+		struct {
+			/* Number of coalesced segments */
+			uint16_t segments;
+			/* Number of duplicated acks */
+			uint16_t dup_acks;
+		} rsc;
+	};
 	__virtio16 num_buffers;	/* Number of merged rx buffers */
 };
 
+struct virtio_net_hdr_v1_hash {
+	struct virtio_net_hdr_v1 hdr;
+	uint32_t hash_value;
+#define VIRTIO_NET_HASH_REPORT_NONE            0
+#define VIRTIO_NET_HASH_REPORT_IPv4            1
+#define VIRTIO_NET_HASH_REPORT_TCPv4           2
+#define VIRTIO_NET_HASH_REPORT_UDPv4           3
+#define VIRTIO_NET_HASH_REPORT_IPv6            4
+#define VIRTIO_NET_HASH_REPORT_TCPv6           5
+#define VIRTIO_NET_HASH_REPORT_UDPv6           6
+#define VIRTIO_NET_HASH_REPORT_IPv6_EX         7
+#define VIRTIO_NET_HASH_REPORT_TCPv6_EX        8
+#define VIRTIO_NET_HASH_REPORT_UDPv6_EX        9
+	uint16_t hash_report;
+	uint16_t padding;
+};
+
 #ifndef VIRTIO_NET_NO_LEGACY
 /* This header comes first in the scatter-gather list.
  * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
@@ -228,7 +284,9 @@ struct virtio_net_ctrl_mac {
 
 /*
  * Control Receive Flow Steering
- *
+ */
+#define VIRTIO_NET_CTRL_MQ   4
+/*
  * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
  * enables Receive Flow Steering, specifying the number of the transmit and
  * receive queues that will be used. After the command is consumed and acked by
@@ -241,11 +299,47 @@ struct virtio_net_ctrl_mq {
 	__virtio16 virtqueue_pairs;
 };
 
-#define VIRTIO_NET_CTRL_MQ   4
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN        1
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX        0x8000
 
+/*
+ * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as
+ * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures
+ * the receive steering to use a hash calculated for incoming packet
+ * to decide on receive virtqueue to place the packet. The command
+ * also provides parameters to calculate a hash and receive virtqueue.
+ */
+struct virtio_net_rss_config {
+	uint32_t hash_types;
+	uint16_t indirection_table_mask;
+	uint16_t unclassified_queue;
+	uint16_t indirection_table[1/* + indirection_table_mask */];
+	uint16_t max_tx_vq;
+	uint8_t hash_key_length;
+	uint8_t hash_key_data[/* hash_key_length */];
+};
+
+ #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
+
+/*
+ * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device
+ * to include in the virtio header of the packet the value of the
+ * calculated hash and the report type of hash. It also provides
+ * parameters for hash calculation. The command requires feature
+ * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the
+ * layout of virtio header as defined in virtio_net_hdr_v1_hash.
+ */
+struct virtio_net_hash_config {
+	uint32_t hash_types;
+	/* for compatibility with virtio_net_rss_config */
+	uint16_t reserved[4];
+	uint8_t hash_key_length;
+	uint8_t hash_key_data[/* hash_key_length */];
+};
+
+ #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG         2
+
 /*
  * Control network offloads
  *
diff --git a/linux-headers/COPYING b/linux-headers/COPYING
index da4cb28feb..a635a38ef9 100644
--- a/linux-headers/COPYING
+++ b/linux-headers/COPYING
@@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see:
 	Documentation/process/license-rules.rst
 
 for more details.
+
+All contributions to the Linux Kernel are subject to this COPYING file.
diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
index 503d3f42da..3f3f780c8c 100644
--- a/linux-headers/asm-x86/kvm.h
+++ b/linux-headers/asm-x86/kvm.h
@@ -390,6 +390,7 @@ struct kvm_sync_regs {
 #define KVM_STATE_NESTED_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_RUN_PENDING	0x00000002
 #define KVM_STATE_NESTED_EVMCS		0x00000004
+#define KVM_STATE_NESTED_MTF_PENDING	0x00000008
 
 #define KVM_STATE_NESTED_SMM_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_SMM_VMXON	0x00000002
diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h
index f6e06fcfbd..1e6c1a5867 100644
--- a/linux-headers/asm-x86/unistd_32.h
+++ b/linux-headers/asm-x86/unistd_32.h
@@ -429,4 +429,5 @@
 #define __NR_openat2 437
 #define __NR_pidfd_getfd 438
 
+
 #endif /* _ASM_X86_UNISTD_32_H */
diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h
index 924f826d2d..6daf0aecb2 100644
--- a/linux-headers/asm-x86/unistd_64.h
+++ b/linux-headers/asm-x86/unistd_64.h
@@ -351,4 +351,5 @@
 #define __NR_openat2 437
 #define __NR_pidfd_getfd 438
 
+
 #endif /* _ASM_X86_UNISTD_64_H */
diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h
index 010307757b..e3f17ef370 100644
--- a/linux-headers/asm-x86/unistd_x32.h
+++ b/linux-headers/asm-x86/unistd_x32.h
@@ -340,4 +340,5 @@
 #define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
 #define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
 
+
 #endif /* _ASM_X86_UNISTD_X32_H */
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 265099100e..9804495a46 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -474,12 +474,17 @@ struct kvm_s390_mem_op {
 	__u32 size;		/* amount of bytes */
 	__u32 op;		/* type of operation */
 	__u64 buf;		/* buffer in userspace */
-	__u8 ar;		/* the access register number */
-	__u8 reserved[31];	/* should be set to 0 */
+	union {
+		__u8 ar;	/* the access register number */
+		__u32 sida_offset; /* offset into the sida */
+		__u8 reserved[32]; /* should be set to 0 */
+	};
 };
 /* types for kvm_s390_mem_op->op */
 #define KVM_S390_MEMOP_LOGICAL_READ	0
 #define KVM_S390_MEMOP_LOGICAL_WRITE	1
+#define KVM_S390_MEMOP_SIDA_READ	2
+#define KVM_S390_MEMOP_SIDA_WRITE	3
 /* flags for kvm_s390_mem_op->flags */
 #define KVM_S390_MEMOP_F_CHECK_ONLY		(1ULL << 0)
 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION	(1ULL << 1)
@@ -1010,6 +1015,8 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_ARM_NISV_TO_USER 177
 #define KVM_CAP_ARM_INJECT_EXT_DABT 178
 #define KVM_CAP_S390_VCPU_RESETS 179
+#define KVM_CAP_S390_PROTECTED 180
+#define KVM_CAP_PPC_SECURE_GUEST 181
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -1478,6 +1485,39 @@ struct kvm_enc_region {
 #define KVM_S390_NORMAL_RESET	_IO(KVMIO,   0xc3)
 #define KVM_S390_CLEAR_RESET	_IO(KVMIO,   0xc4)
 
+struct kvm_s390_pv_sec_parm {
+	__u64 origin;
+	__u64 length;
+};
+
+struct kvm_s390_pv_unp {
+	__u64 addr;
+	__u64 size;
+	__u64 tweak;
+};
+
+enum pv_cmd_id {
+	KVM_PV_ENABLE,
+	KVM_PV_DISABLE,
+	KVM_PV_SET_SEC_PARMS,
+	KVM_PV_UNPACK,
+	KVM_PV_VERIFY,
+	KVM_PV_PREP_RESET,
+	KVM_PV_UNSHARE_ALL,
+};
+
+struct kvm_pv_cmd {
+	__u32 cmd;	/* Command to be executed */
+	__u16 rc;	/* Ultravisor return code */
+	__u16 rrc;	/* Ultravisor return reason code */
+	__u64 data;	/* Data or address */
+	__u32 flags;    /* flags for future extensions. Must be 0 for now */
+	__u32 reserved[3];
+};
+
+/* Available with KVM_CAP_S390_PROTECTED */
+#define KVM_S390_PV_COMMAND		_IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
+
 /* Secure Encrypted Virtualization command */
 enum sev_cmd_id {
 	/* Guest initialization commands */
@@ -1628,4 +1668,7 @@ struct kvm_hyperv_eventfd {
 #define KVM_HYPERV_CONN_ID_MASK		0x00ffffff
 #define KVM_HYPERV_EVENTFD_DEASSIGN	(1 << 0)
 
+#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE    (1 << 0)
+#define KVM_DIRTY_LOG_INITIALLY_SET            (1 << 1)
+
 #endif /* __LINUX_KVM_H */
diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h
index 1f6e2cd89c..51ea363759 100644
--- a/linux-headers/linux/mman.h
+++ b/linux-headers/linux/mman.h
@@ -5,8 +5,9 @@
 #include <asm/mman.h>
 #include <asm-generic/hugetlb_encode.h>
 
-#define MREMAP_MAYMOVE	1
-#define MREMAP_FIXED	2
+#define MREMAP_MAYMOVE		1
+#define MREMAP_FIXED		2
+#define MREMAP_DONTUNMAP	4
 
 #define OVERCOMMIT_GUESS		0
 #define OVERCOMMIT_ALWAYS		1
diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h
index ce78878d12..8d3996eb82 100644
--- a/linux-headers/linux/userfaultfd.h
+++ b/linux-headers/linux/userfaultfd.h
@@ -19,7 +19,8 @@
  * means the userland is reading).
  */
 #define UFFD_API ((__u64)0xAA)
-#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK |		\
+#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP |	\
+			   UFFD_FEATURE_EVENT_FORK |		\
 			   UFFD_FEATURE_EVENT_REMAP |		\
 			   UFFD_FEATURE_EVENT_REMOVE |	\
 			   UFFD_FEATURE_EVENT_UNMAP |		\
@@ -34,7 +35,8 @@
 #define UFFD_API_RANGE_IOCTLS			\
 	((__u64)1 << _UFFDIO_WAKE |		\
 	 (__u64)1 << _UFFDIO_COPY |		\
-	 (__u64)1 << _UFFDIO_ZEROPAGE)
+	 (__u64)1 << _UFFDIO_ZEROPAGE |		\
+	 (__u64)1 << _UFFDIO_WRITEPROTECT)
 #define UFFD_API_RANGE_IOCTLS_BASIC		\
 	((__u64)1 << _UFFDIO_WAKE |		\
 	 (__u64)1 << _UFFDIO_COPY)
@@ -52,6 +54,7 @@
 #define _UFFDIO_WAKE			(0x02)
 #define _UFFDIO_COPY			(0x03)
 #define _UFFDIO_ZEROPAGE		(0x04)
+#define _UFFDIO_WRITEPROTECT		(0x06)
 #define _UFFDIO_API			(0x3F)
 
 /* userfaultfd ioctl ids */
@@ -68,6 +71,8 @@
 				      struct uffdio_copy)
 #define UFFDIO_ZEROPAGE		_IOWR(UFFDIO, _UFFDIO_ZEROPAGE,	\
 				      struct uffdio_zeropage)
+#define UFFDIO_WRITEPROTECT	_IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
+				      struct uffdio_writeprotect)
 
 /* read() structure */
 struct uffd_msg {
@@ -203,13 +208,14 @@ struct uffdio_copy {
 	__u64 dst;
 	__u64 src;
 	__u64 len;
+#define UFFDIO_COPY_MODE_DONTWAKE		((__u64)1<<0)
 	/*
-	 * There will be a wrprotection flag later that allows to map
-	 * pages wrprotected on the fly. And such a flag will be
-	 * available if the wrprotection ioctl are implemented for the
-	 * range according to the uffdio_register.ioctls.
+	 * UFFDIO_COPY_MODE_WP will map the page write protected on
+	 * the fly.  UFFDIO_COPY_MODE_WP is available only if the
+	 * write protected ioctl is implemented for the range
+	 * according to the uffdio_register.ioctls.
 	 */
-#define UFFDIO_COPY_MODE_DONTWAKE		((__u64)1<<0)
+#define UFFDIO_COPY_MODE_WP			((__u64)1<<1)
 	__u64 mode;
 
 	/*
@@ -231,4 +237,24 @@ struct uffdio_zeropage {
 	__s64 zeropage;
 };
 
+struct uffdio_writeprotect {
+	struct uffdio_range range;
+/*
+ * UFFDIO_WRITEPROTECT_MODE_WP: set the flag to write protect a range,
+ * unset the flag to undo protection of a range which was previously
+ * write protected.
+ *
+ * UFFDIO_WRITEPROTECT_MODE_DONTWAKE: set the flag to avoid waking up
+ * any wait thread after the operation succeeds.
+ *
+ * NOTE: Write protecting a region (WP=1) is unrelated to page faults,
+ * therefore DONTWAKE flag is meaningless with WP=1.  Removing write
+ * protection (WP=0) in response to a page fault wakes the faulting
+ * task unless DONTWAKE is set.
+ */
+#define UFFDIO_WRITEPROTECT_MODE_WP		((__u64)1<<0)
+#define UFFDIO_WRITEPROTECT_MODE_DONTWAKE	((__u64)1<<1)
+	__u64 mode;
+};
+
 #endif /* _LINUX_USERFAULTFD_H */
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index fb10370d29..a41c452865 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -707,6 +707,43 @@ struct vfio_device_ioeventfd {
 
 #define VFIO_DEVICE_IOEVENTFD		_IO(VFIO_TYPE, VFIO_BASE + 16)
 
+/**
+ * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,
+ *			       struct vfio_device_feature)
+ *
+ * Get, set, or probe feature data of the device.  The feature is selected
+ * using the FEATURE_MASK portion of the flags field.  Support for a feature
+ * can be probed by setting both the FEATURE_MASK and PROBE bits.  A probe
+ * may optionally include the GET and/or SET bits to determine read vs write
+ * access of the feature respectively.  Probing a feature will return success
+ * if the feature is supported and all of the optionally indicated GET/SET
+ * methods are supported.  The format of the data portion of the structure is
+ * specific to the given feature.  The data portion is not required for
+ * probing.  GET and SET are mutually exclusive, except for use with PROBE.
+ *
+ * Return 0 on success, -errno on failure.
+ */
+struct vfio_device_feature {
+	__u32	argsz;
+	__u32	flags;
+#define VFIO_DEVICE_FEATURE_MASK	(0xffff) /* 16-bit feature index */
+#define VFIO_DEVICE_FEATURE_GET		(1 << 16) /* Get feature into data[] */
+#define VFIO_DEVICE_FEATURE_SET		(1 << 17) /* Set feature from data[] */
+#define VFIO_DEVICE_FEATURE_PROBE	(1 << 18) /* Probe feature support */
+	__u8	data[];
+};
+
+#define VFIO_DEVICE_FEATURE		_IO(VFIO_TYPE, VFIO_BASE + 17)
+
+/*
+ * Provide support for setting a PCI VF Token, which is used as a shared
+ * secret between PF and VF drivers.  This feature may only be set on a
+ * PCI SR-IOV PF when SR-IOV is enabled on the PF and there are no existing
+ * open VFs.  Data provided when setting this feature is a 16-byte array
+ * (__u8 b[16]), representing a UUID.
+ */
+#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN	(0)
+
 /* -------- API for Type1 VFIO IOMMU -------- */
 
 /**
diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
index 40d028eed6..9fe72e4b13 100644
--- a/linux-headers/linux/vhost.h
+++ b/linux-headers/linux/vhost.h
@@ -116,4 +116,28 @@
 #define VHOST_VSOCK_SET_GUEST_CID	_IOW(VHOST_VIRTIO, 0x60, __u64)
 #define VHOST_VSOCK_SET_RUNNING		_IOW(VHOST_VIRTIO, 0x61, int)
 
+/* VHOST_VDPA specific defines */
+
+/* Get the device id. The device ids follow the same definition of
+ * the device id defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_DEVICE_ID	_IOR(VHOST_VIRTIO, 0x70, __u32)
+/* Get and set the status. The status bits follow the same definition
+ * of the device status defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_STATUS		_IOR(VHOST_VIRTIO, 0x71, __u8)
+#define VHOST_VDPA_SET_STATUS		_IOW(VHOST_VIRTIO, 0x72, __u8)
+/* Get and set the device config. The device config follows the same
+ * definition of the device config defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_CONFIG		_IOR(VHOST_VIRTIO, 0x73, \
+					     struct vhost_vdpa_config)
+#define VHOST_VDPA_SET_CONFIG		_IOW(VHOST_VIRTIO, 0x74, \
+					     struct vhost_vdpa_config)
+/* Enable/disable the ring. */
+#define VHOST_VDPA_SET_VRING_ENABLE	_IOW(VHOST_VIRTIO, 0x75, \
+					     struct vhost_vring_state)
+/* Get the max ring size. */
+#define VHOST_VDPA_GET_VRING_NUM	_IOR(VHOST_VIRTIO, 0x76, __u16)
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7972.21140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnu-0001pn-2V; Fri, 16 Oct 2020 11:21:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7972.21140; Fri, 16 Oct 2020 11:21:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNnt-0001pa-UX; Fri, 16 Oct 2020 11:21:45 +0000
Received: by outflank-mailman (input) for mailman id 7972;
 Fri, 16 Oct 2020 11:21:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNns-0001pP-A3
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fc533b60-f54f-4ce6-a1b7-6946e944e0a5;
 Fri, 16 Oct 2020 11:21:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnq-0002NC-UO
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNnq-0002Yf-TJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNns-0001pP-A3
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:44 +0000
X-Inumbo-ID: fc533b60-f54f-4ce6-a1b7-6946e944e0a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fc533b60-f54f-4ce6-a1b7-6946e944e0a5;
	Fri, 16 Oct 2020 11:21:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1IQxMlOQiTaLwlyLYWx0tnhXFpowHtleljMFzi2usiE=; b=EqvLeFht8hU4HiEzskkRT8pdm4
	LldtYcJWkCdiWppWGipi2FYo7Wbq3lE23nKeyJ6+L25OOrv812lhu+nV3pmr1xOk3wqaQJ2OnDpdr
	Bw19Eru0YnsZpgxHt1Vi9zGChd4pK/zJ8OYc8JWS8DdAEV6PtwdRhavO7Gc5uq+mF7+I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnq-0002NC-UO
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNnq-0002Yf-TJ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-balloon: Replace free page hinting references to 'report' with 'hint'
Message-Id: <E1kTNnq-0002Yf-TJ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:42 +0000

commit 7c4c30e764e2e177fefe241a0f8559b02def9089
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:28 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Replace free page hinting references to 'report' with 'hint'
    
    Recently a feature named Free Page Reporting was added to the virtio
    balloon. In order to avoid any confusion we should drop the use of the word
    'report' when referring to Free Page Hinting. So what this patch does is go
    through and replace all instances of 'report' with 'hint" when we are
    referring to free page hinting.
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175128.21935.93927.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 3219b42f025d4d7a9c463235e9f937ab38067de3)
     Conflicts:
            hw/virtio/virtio-balloon.c
            include/hw/virtio/virtio-balloon.h
    *drop context deps on 91b867191d and 7483cbbaf8
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c         | 76 +++++++++++++++++++-------------------
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 6c75db123e..035d4e0665 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -466,22 +466,22 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
-            id == dev->free_page_report_cmd_id) {
-            dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED &&
+            id == dev->free_page_hint_cmd_id) {
+            dev->free_page_hint_status = FREE_PAGE_HINT_S_START;
         } else {
             /*
              * Stop the optimization only when it has started. This
              * avoids a stale stop sign for the previous command.
              */
-            if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
-                dev->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+            if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
+                dev->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
             }
         }
     }
 
     if (elem->in_num) {
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
             qemu_guest_free_page_hint(elem->in_sg[0].iov_base,
                                       elem->in_sg[0].iov_len);
         }
@@ -507,11 +507,11 @@ static void virtio_ballloon_get_free_page_hints(void *opaque)
         qemu_mutex_unlock(&dev->free_page_lock);
         virtio_notify(vdev, vq);
       /*
-       * Start to poll the vq once the reporting started. Otherwise, continue
+       * Start to poll the vq once the hinting started. Otherwise, continue
        * only when there are entries on the vq, which need to be given back.
        */
     } while (continue_to_get_hints ||
-             dev->free_page_report_status == FREE_PAGE_REPORT_S_START);
+             dev->free_page_hint_status == FREE_PAGE_HINT_S_START);
     virtio_queue_set_notification(vq, 1);
 }
 
@@ -534,14 +534,14 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
 
     qemu_mutex_lock(&s->free_page_lock);
 
-    if (s->free_page_report_cmd_id == UINT_MAX) {
-        s->free_page_report_cmd_id =
-                       VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    if (s->free_page_hint_cmd_id == UINT_MAX) {
+        s->free_page_hint_cmd_id =
+                       VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
     } else {
-        s->free_page_report_cmd_id++;
+        s->free_page_hint_cmd_id++;
     }
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    s->free_page_hint_status = FREE_PAGE_HINT_S_REQUESTED;
     qemu_mutex_unlock(&s->free_page_lock);
 
     virtio_notify_config(vdev);
@@ -551,18 +551,18 @@ static void virtio_balloon_free_page_stop(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_STOP) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_STOP) {
         /*
          * The lock also guarantees us that the
          * virtio_ballloon_get_free_page_hints exits after the
-         * free_page_report_status is set to S_STOP.
+         * free_page_hint_status is set to S_STOP.
          */
         qemu_mutex_lock(&s->free_page_lock);
         /*
-         * The guest hasn't done the reporting, so host sends a notification
-         * to the guest to actively stop the reporting.
+         * The guest isn't done hinting, so send a notification
+         * to the guest to actively stop the hinting.
          */
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
@@ -572,20 +572,20 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_DONE) {
         /* See virtio_balloon_free_page_stop() */
         qemu_mutex_lock(&s->free_page_lock);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_DONE;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
 }
 
 static int
-virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
+virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data)
 {
     VirtIOBalloon *dev = container_of(n, VirtIOBalloon,
-                                      free_page_report_notify);
+                                      free_page_hint_notify);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     PrecopyNotifyData *pnd = data;
 
@@ -643,7 +643,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon *s)
     if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         return offsetof(struct virtio_balloon_config, poison_val);
     }
-    return offsetof(struct virtio_balloon_config, free_page_report_cmd_id);
+    return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id);
 }
 
 static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
@@ -654,14 +654,14 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
     config.num_pages = cpu_to_le32(dev->num_pages);
     config.actual = cpu_to_le32(dev->actual);
 
-    if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED) {
-        config.free_page_report_cmd_id =
-                       cpu_to_le32(dev->free_page_report_cmd_id);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_STOP) {
-        config.free_page_report_cmd_id =
+    if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED) {
+        config.free_page_hint_cmd_id =
+                       cpu_to_le32(dev->free_page_hint_cmd_id);
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_STOP) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) {
-        config.free_page_report_cmd_id =
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_DONE) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE);
     }
 
@@ -762,14 +762,14 @@ static int virtio_balloon_post_load_device(void *opaque, int version_id)
     return 0;
 }
 
-static const VMStateDescription vmstate_virtio_balloon_free_page_report = {
+static const VMStateDescription vmstate_virtio_balloon_free_page_hint = {
     .name = "virtio-balloon-device/free-page-report",
     .version_id = 1,
     .minimum_version_id = 1,
     .needed = virtio_balloon_free_page_support,
     .fields = (VMStateField[]) {
-        VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon),
-        VMSTATE_UINT32(free_page_report_status, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -785,7 +785,7 @@ static const VMStateDescription vmstate_virtio_balloon_device = {
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * []) {
-        &vmstate_virtio_balloon_free_page_report,
+        &vmstate_virtio_balloon_free_page_hint,
         NULL
     }
 };
@@ -823,7 +823,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        precopy_add_notifier(&s->free_page_report_notify);
+        precopy_add_notifier(&s->free_page_hint_notify);
 
         object_ref(OBJECT(s->iothread));
         s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
@@ -841,7 +841,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
         qemu_bh_delete(s->free_page_bh);
         object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
-        precopy_remove_notifier(&s->free_page_report_notify);
+        precopy_remove_notifier(&s->free_page_hint_notify);
     }
     balloon_stats_destroy_timer(s);
     qemu_remove_balloon_handler(s);
@@ -908,8 +908,8 @@ static void virtio_balloon_instance_init(Object *obj)
 
     qemu_mutex_init(&s->free_page_lock);
     qemu_cond_init(&s->free_page_cond);
-    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+    s->free_page_hint_cmd_id = VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
+    s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify;
 
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s, NULL);
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index d1c968d237..108cff97e7 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -23,7 +23,7 @@
 #define VIRTIO_BALLOON(obj) \
         OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
 
-#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000
+#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000
 
 typedef struct virtio_balloon_stat VirtIOBalloonStat;
 
@@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern {
        uint64_t val;
 } VirtIOBalloonStatModern;
 
-enum virtio_balloon_free_page_report_status {
-    FREE_PAGE_REPORT_S_STOP = 0,
-    FREE_PAGE_REPORT_S_REQUESTED = 1,
-    FREE_PAGE_REPORT_S_START = 2,
-    FREE_PAGE_REPORT_S_DONE = 3,
+enum virtio_balloon_free_page_hint_status {
+    FREE_PAGE_HINT_S_STOP = 0,
+    FREE_PAGE_HINT_S_REQUESTED = 1,
+    FREE_PAGE_HINT_S_START = 2,
+    FREE_PAGE_HINT_S_DONE = 3,
 };
 
 typedef struct VirtIOBalloon {
     VirtIODevice parent_obj;
     VirtQueue *ivq, *dvq, *svq, *free_page_vq;
-    uint32_t free_page_report_status;
+    uint32_t free_page_hint_status;
     uint32_t num_pages;
     uint32_t actual;
-    uint32_t free_page_report_cmd_id;
+    uint32_t free_page_hint_cmd_id;
     uint64_t stats[VIRTIO_BALLOON_S_NR];
     VirtQueueElement *stats_vq_elem;
     size_t stats_vq_offset;
@@ -55,7 +55,7 @@ typedef struct VirtIOBalloon {
     QEMUBH *free_page_bh;
     /*
      * Lock to synchronize threads to access the free page reporting related
-     * fields (e.g. free_page_report_status).
+     * fields (e.g. free_page_hint_status).
      */
     QemuMutex free_page_lock;
     QemuCond  free_page_cond;
@@ -64,7 +64,7 @@ typedef struct VirtIOBalloon {
      * stopped.
      */
     bool block_iothread;
-    NotifierWithReturn free_page_report_notify;
+    NotifierWithReturn free_page_hint_notify;
     int64_t stats_last_update;
     int64_t stats_poll_interval;
     uint32_t host_features;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:21:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:21:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7975.21158 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNo3-0001tO-HQ; Fri, 16 Oct 2020 11:21:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7975.21158; Fri, 16 Oct 2020 11:21:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNo3-0001tF-EA; Fri, 16 Oct 2020 11:21:55 +0000
Received: by outflank-mailman (input) for mailman id 7975;
 Fri, 16 Oct 2020 11:21:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNo1-0001sq-UD
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 54d1c3b1-895b-48cd-ad4f-4db134afdce8;
 Fri, 16 Oct 2020 11:21:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNo1-0002NO-1a
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNo1-0002ZG-0e
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNo1-0001sq-UD
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
X-Inumbo-ID: 54d1c3b1-895b-48cd-ad4f-4db134afdce8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 54d1c3b1-895b-48cd-ad4f-4db134afdce8;
	Fri, 16 Oct 2020 11:21:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jGH7UsCQ5ZRd9092SN91UdomOtsJpapRucwND8TwCTw=; b=NUEGETWJm0LFwI/6cBl2BZ6csQ
	sBhw1dP7ICXZQyERkHUhZHKvwxRzpHdmIXLEgbiMZ1J7zIIqsIO6Vz3qp8zmj4DbjzqXXjLQPmKag
	UWLKKaXIXXfVXJgnOBoVXSpf6Mdv/Uy/abwUJJIjWEePOZYmakYSmttw6lm6eno8ZxN8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNo1-0002NO-1a
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNo1-0002ZG-0e
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:21:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] intel_iommu: Use correct shift for 256 bits qi descriptor
Message-Id: <E1kTNo1-0002ZG-0e@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:21:53 +0000

commit 58c523563dc3146ca4326e20af924abf0b90e9c3
Author:     Liu Yi L <yi.l.liu@intel.com>
AuthorDate: Sat Jul 4 01:07:15 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    intel_iommu: Use correct shift for 256 bits qi descriptor
    
    In chapter 10.4.23 of VT-d spec 3.0, Descriptor Width bit was introduced
    in VTD_IQA_REG. Software could set this bit to tell VT-d the QI descriptor
    from software would be 256 bits. Accordingly, the VTD_IQH_QH_SHIFT should
    be 5 when descriptor size is 256 bits.
    
    This patch adds the DW bit check when deciding the shift used to update
    VTD_IQH_REG.
    
    Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
    Message-Id: <1593850035-35483-1-git-send-email-yi.l.liu@intel.com>
    Reviewed-by: Peter Xu <peterx@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit a4544c45e109ceee87ee8c19baff28be3890d788)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/i386/intel_iommu.c          | 7 ++++++-
 hw/i386/intel_iommu_internal.h | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index df7ad254ac..8703a2da42 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2549,6 +2549,11 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)
 /* Try to fetch and process more Invalidation Descriptors */
 static void vtd_fetch_inv_desc(IntelIOMMUState *s)
 {
+    int qi_shift;
+
+    /* Refer to 10.4.23 of VT-d spec 3.0 */
+    qi_shift = s->iq_dw ? VTD_IQH_QH_SHIFT_5 : VTD_IQH_QH_SHIFT_4;
+
     trace_vtd_inv_qi_fetch();
 
     if (s->iq_tail >= s->iq_size) {
@@ -2567,7 +2572,7 @@ static void vtd_fetch_inv_desc(IntelIOMMUState *s)
         }
         /* Must update the IQH_REG in time */
         vtd_set_quad_raw(s, DMAR_IQH_REG,
-                         (((uint64_t)(s->iq_head)) << VTD_IQH_QH_SHIFT) &
+                         (((uint64_t)(s->iq_head)) << qi_shift) &
                          VTD_IQH_QH_MASK);
     }
 }
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 862033ebe6..3d5487fe2c 100644
--- a/hw/i386/intel_iommu_internal.h
+++ b/hw/i386/intel_iommu_internal.h
@@ -230,7 +230,8 @@
 #define VTD_IQA_DW_MASK             0x800
 
 /* IQH_REG */
-#define VTD_IQH_QH_SHIFT            4
+#define VTD_IQH_QH_SHIFT_4          4
+#define VTD_IQH_QH_SHIFT_5          5
 #define VTD_IQH_QH_MASK             0x7fff0ULL
 
 /* ICS_REG */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7976.21161 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoD-0001wy-J1; Fri, 16 Oct 2020 11:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7976.21161; Fri, 16 Oct 2020 11:22:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoD-0001wq-Fl; Fri, 16 Oct 2020 11:22:05 +0000
Received: by outflank-mailman (input) for mailman id 7976;
 Fri, 16 Oct 2020 11:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNoC-0001wY-DI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d051e5d0-101a-41e4-914d-a18492b5ae2d;
 Fri, 16 Oct 2020 11:22:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoB-0002Np-4a
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoB-0002aJ-3t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNoC-0001wY-DI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:04 +0000
X-Inumbo-ID: d051e5d0-101a-41e4-914d-a18492b5ae2d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d051e5d0-101a-41e4-914d-a18492b5ae2d;
	Fri, 16 Oct 2020 11:22:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8rsEb7tFa4JNvAR2mOCTapGSwooNwGecJnRE57KnVF4=; b=0yWuT2gUqKnCue3Kbn7MkzMrAV
	CdvxXU55YnY8W6yEf8xo7TYACLu+SANMILES3tr3pGPNwP9s4AXDyynIlm0AsIbS0W2UOWLC1mHH+
	IW201rSG/a4FqpRwNyX+MmZxuDlxPWVTz8VA23pjr0/49D3pTS95TcIK69D1ECT5vOCA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoB-0002Np-4a
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoB-0002aJ-3t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
Message-Id: <E1kTNoB-0002aJ-3t@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:03 +0000

commit d8f0b2bbf4a1ab473c658a56ef5bf3ea57c3c384
Author:     Andrew Melnychenko <andrew@daynix.com>
AuthorDate: Mon Jul 6 14:21:23 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
    
    There is an issue when callback may be called with invalid vdev.
    It happens on unplug when vdev already deleted and VirtIOPciProxy is not.
    So now, callbacks accept proxy device, and vdev retrieved from it.
    Technically memio callbacks should be removed during the flatview update,
    but memoryregions remain til PCI device(and it's address space) completely deleted.
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1716352
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Message-Id: <20200706112123.971087-1-andrew@daynix.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit ccec7e9603f446fe75c6c563ba335c00cfda6a06)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-pci.c | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4cb784389c..b37ae65fe4 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1317,11 +1317,12 @@ static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
-    VirtIOPCIProxy *proxy = VIRTIO_PCI(DEVICE(vdev)->parent_bus->parent);
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = addr / virtio_pci_queue_mem_mult(proxy);
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1329,10 +1330,12 @@ static void virtio_pci_notify_write(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write_pio(void *opaque, hwaddr addr,
                                         uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = val;
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1356,9 +1359,14 @@ static void virtio_pci_isr_write(void *opaque, hwaddr addr,
 static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
                                        unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     uint64_t val = 0;
 
+    if (vdev == NULL) {
+        return val;
+    }
+
     switch (size) {
     case 1:
         val = virtio_config_modern_readb(vdev, addr);
@@ -1376,7 +1384,13 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
 static void virtio_pci_device_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
+    if (vdev == NULL) {
+        return;
+    }
+
     switch (size) {
     case 1:
         virtio_config_modern_writeb(vdev, addr, val);
@@ -1453,19 +1467,19 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
 
     memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
                           &device_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-device",
                           proxy->device.size);
 
     memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
                           &notify_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify",
                           proxy->notify.size);
 
     memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy),
                           &notify_pio_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify-pio",
                           proxy->notify_pio.size);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7978.21166 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoN-0001zq-L7; Fri, 16 Oct 2020 11:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7978.21166; Fri, 16 Oct 2020 11:22:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoN-0001zh-HR; Fri, 16 Oct 2020 11:22:15 +0000
Received: by outflank-mailman (input) for mailman id 7978;
 Fri, 16 Oct 2020 11:22:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNoM-0001zJ-4J
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2a1e16de-d02c-4295-9023-8894e6f51a4a;
 Fri, 16 Oct 2020 11:22:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoL-0002Nw-8J
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoL-0002am-6q
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNoM-0001zJ-4J
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:14 +0000
X-Inumbo-ID: 2a1e16de-d02c-4295-9023-8894e6f51a4a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2a1e16de-d02c-4295-9023-8894e6f51a4a;
	Fri, 16 Oct 2020 11:22:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NKVcKagOIPugnHhscTj3oXHNlr2Hae3JVI1VmGjg3yk=; b=IfU+xdLJAPfNE0rsMIiURThb3j
	b7sZece9jAH+uGXb8thFvUcGvme9l15na3H7b9RLXzSEW7aqS++i87lmPNBZFWFRpKcT9u8Fu34aS
	Lt2JF+kfrBTh2788pz7i70ApPVsKe8HTuz01HXa8UU3WIWKrpBaqEn7W4YAwP+df4YDA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoL-0002Nw-8J
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoL-0002am-6q
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] libvhost-user: Report descriptor index on panic
Message-Id: <E1kTNoL-0002am-6q@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:13 +0000

commit eca194d43ca4524d0f3552d7b91b15c145649b33
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    libvhost-user: Report descriptor index on panic
    
    We want to report the index of the descriptor,
    not its pointer.
    
    Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171935.18535-1-philmd@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 8fe9805c73c277dc2feeaa83de73d6a58bf23f39)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 3bca996c62..301f6d68b3 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -1867,7 +1867,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
 
     /* If their number is silly, that's a fatal mistake. */
     if (*head >= vq->vring.num) {
-        vu_panic(dev, "Guest says index %u is available", head);
+        vu_panic(dev, "Guest says index %u is available", *head);
         return false;
     }
 
@@ -1926,7 +1926,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
     smp_wmb();
 
     if (*next >= max) {
-        vu_panic(dev, "Desc next is %u", next);
+        vu_panic(dev, "Desc next is %u", *next);
         return VIRTQUEUE_READ_DESC_ERROR;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7979.21169 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoX-00021T-Ly; Fri, 16 Oct 2020 11:22:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7979.21169; Fri, 16 Oct 2020 11:22:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoX-00021L-J2; Fri, 16 Oct 2020 11:22:25 +0000
Received: by outflank-mailman (input) for mailman id 7979;
 Fri, 16 Oct 2020 11:22:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNoW-000218-5u
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eb8b27b8-36b6-4b4a-85dd-b6f0bb802907;
 Fri, 16 Oct 2020 11:22:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoV-0002O8-CV
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoV-0002bf-As
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNoW-000218-5u
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:24 +0000
X-Inumbo-ID: eb8b27b8-36b6-4b4a-85dd-b6f0bb802907
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eb8b27b8-36b6-4b4a-85dd-b6f0bb802907;
	Fri, 16 Oct 2020 11:22:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4KELzcvo5lnKff57DdVNJpEaFqWwwJwpGAwnQ3MuXRw=; b=CJfCnYSE6to/4/6JZYOmQ8Ws9o
	8xTAP8jqlLDVy1VeWYViNq4OyB66F4o5XW9I6s23nUM+tOdzDrYRcKEEgQ+wYczFPGuPWOdO3kae9
	g20ER4GGjlyCUpY3v5DLpSKV9VrQ0DzUtntnWkEC2OPtr5kYb9Ula/Y5nH1j/lPcByfs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoV-0002O8-CV
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoV-0002bf-As
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] Update OpenBIOS images to 7f28286f built from submodule.
Message-Id: <E1kTNoV-0002bf-As@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:23 +0000

commit b52a91816ea6a277fca83e8881fb0c5475f19156
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Mon Jul 27 09:15:42 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Cc: qemu-stable@nongnu.org
    (cherry picked from commit 54414d0fb11314ede939ec80238787c5b2079f4e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index 1c9ab09af7..def6d4cf63 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index 2ba8660dde..67b8b83d98 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index 99420eb815..dfa1f10bbc 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 7e5b89e429..7f28286f5c 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 7e5b89e4295063d8eba55b9c8ce8bc681c2d129a
+Subproject commit 7f28286f5cb1ca682e3ba0a8706d8884f12bc49e
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7980.21173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoh-00022s-Nl; Fri, 16 Oct 2020 11:22:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7980.21173; Fri, 16 Oct 2020 11:22:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNoh-00022k-KY; Fri, 16 Oct 2020 11:22:35 +0000
Received: by outflank-mailman (input) for mailman id 7980;
 Fri, 16 Oct 2020 11:22:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNog-00022X-8O
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f41c519d-31d0-446d-98bf-227e6ae55776;
 Fri, 16 Oct 2020 11:22:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNof-0002Ow-Fm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNof-0002cB-Es
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNog-00022X-8O
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:34 +0000
X-Inumbo-ID: f41c519d-31d0-446d-98bf-227e6ae55776
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f41c519d-31d0-446d-98bf-227e6ae55776;
	Fri, 16 Oct 2020 11:22:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aYtY/Y6VqbjIbuCqqoO9BdGj44H5BrnEKYnMYLK48V8=; b=JLK6tvsHGiEGF0c/RMX/P8NK7D
	0c8WqFA+xgFo8Ajk6MRXS3uG8YM2r0NG5bGU5HOB31mp3NhSJFeGvW3yRbKSwrRcLLDgjfVSZgLlK
	NS7F5Vl8pRossFAi2w/iF6y+/Xus2W/GK2bUA5xXJbPl2xFLWgPpdEQCDrgdFXnDAupY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNof-0002Ow-Fm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNof-0002cB-Es
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
Message-Id: <E1kTNof-0002cB-Es@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:33 +0000

commit 08550a9940fc9b07a8f7ff7e2c7b47eb825b87d3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:22 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
    
    Using the _locked version of bdrv_enable_dirty_bitmap to bypass locking
    is wrong as we do not already own the mutex.  Moreover, the adjacent
    call to bdrv_dirty_bitmap_enable_successor grabs the mutex.
    
    Fixes: 58f72b965e9e1q
    Cc: qemu-stable@nongnu.org # v3.0
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-8-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit e6ce5e92248be5547daaee3eb6cd226e9820cf7b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 migration/block-dirty-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 7eafface61..16f1793ee3 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -498,7 +498,7 @@ void dirty_bitmap_mig_before_vm_start(void)
         DirtyBitmapLoadBitmapState *b = item->data;
 
         if (b->migrated) {
-            bdrv_enable_dirty_bitmap_locked(b->bitmap);
+            bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7981.21177 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNos-00024r-PA; Fri, 16 Oct 2020 11:22:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7981.21177; Fri, 16 Oct 2020 11:22:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNos-00024j-M7; Fri, 16 Oct 2020 11:22:46 +0000
Received: by outflank-mailman (input) for mailman id 7981;
 Fri, 16 Oct 2020 11:22:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNor-00024U-1t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 42da94db-c2e2-49d1-9559-b515ae4a54da;
 Fri, 16 Oct 2020 11:22:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNop-0002Qb-Jh
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNop-0002eK-ID
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNor-00024U-1t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:45 +0000
X-Inumbo-ID: 42da94db-c2e2-49d1-9559-b515ae4a54da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 42da94db-c2e2-49d1-9559-b515ae4a54da;
	Fri, 16 Oct 2020 11:22:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NtEbntbvPpyFK5112CQ1UN9cVmHGed59+4Bw+3i8jcI=; b=0Ci5i24rfI5maV30Qu6I6W2r+q
	pexqRZJOBzCHBbQk9WC2+lTNJOYs5SZOsWPGYbPZ49z02MikHHsf22EOvwXN3F7Mn59t8a76VuQ4L
	gsEcKlJlOwCRI+yW2zV1/Hw5y3KRF0syQd8djHPPPIiUDJsdU3Gu3mfqlZ7n4cdVTs+A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNop-0002Qb-Jh
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNop-0002eK-ID
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] block: Fix bdrv_aligned_p*v() for qiov_offset != 0
Message-Id: <E1kTNop-0002eK-ID@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:43 +0000

commit dcf682dd135e41150b8f1918d7902e2305d19e1a
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:04 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Since these functions take a @qiov_offset, they must always take it into
    account when working with @qiov.  There are a couple of places where
    they do not, but they should.
    
    Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c
           ("block/io: bdrv_aligned_preadv: use and support qiov_offset")
    Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d
           ("block/io: bdrv_aligned_pwritev: use and support qiov_offset")
    Reported-by: Claudio Fontana <cfontana@suse.de>
    Reported-by: Bruce Rogers <brogers@suse.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-2-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    Tested-by: Bruce Rogers <brogers@suse.com>
    (cherry picked from commit 134b7dec6ec2d90616d7986afb3b3b7ca7a4c383)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/io.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/io.c b/block/io.c
index aba67f66b9..496c813dd8 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1501,12 +1501,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
             assert(num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, qiov, bytes - bytes_remaining, 0);
+                                     num, qiov,
+                                     qiov_offset + bytes - bytes_remaining, 0);
             max_bytes -= num;
         } else {
             num = bytes_remaining;
-            ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
-                                    bytes_remaining);
+            ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining,
+                                    0, bytes_remaining);
         }
         if (ret < 0) {
             goto out;
@@ -2009,7 +2010,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
             }
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, qiov, bytes - bytes_remaining,
+                                      num, qiov,
+                                      qiov_offset + bytes - bytes_remaining,
                                       local_flags);
             if (ret < 0) {
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:22:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:22:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7982.21180 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNp1-00026A-Qc; Fri, 16 Oct 2020 11:22:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7982.21180; Fri, 16 Oct 2020 11:22:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNp1-000262-Nf; Fri, 16 Oct 2020 11:22:55 +0000
Received: by outflank-mailman (input) for mailman id 7982;
 Fri, 16 Oct 2020 11:22:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNp0-00025u-Li
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 36f2e4c2-0b8c-4c32-817f-adcf03c097d0;
 Fri, 16 Oct 2020 11:22:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoz-0002Qm-Mf
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNoz-0002ex-M0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNp0-00025u-Li
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:54 +0000
X-Inumbo-ID: 36f2e4c2-0b8c-4c32-817f-adcf03c097d0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 36f2e4c2-0b8c-4c32-817f-adcf03c097d0;
	Fri, 16 Oct 2020 11:22:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hdPilx+hEDJDBC2taVyKcsH9BiVCs41kZloX0AdEquk=; b=S9CWb8jFg44ENk2viIputeiQnQ
	LK8SAywQok8khMS3a6LnVvzUkLARd3xxbhftDfu0mHJjz98YgWFVm/yNsnAW15Es9GKXIZDeysnfT
	bF9vdARylX/rVFt8suHldIoxGPqqb8jHLO8k8SdS5cr9MNu3BMRNw3j7DTRhOu1SYwsU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoz-0002Qm-Mf
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNoz-0002ex-M0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:22:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] iotests/028: Add test for cross-base-EOF reads
Message-Id: <E1kTNoz-0002ex-M0@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:22:53 +0000

commit 921352867bc67b2e6bc6fa2e5538b04aadd78caf
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:05 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    iotests/028: Add test for cross-base-EOF reads
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-3-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    (cherry picked from commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 2 files changed, 30 insertions(+)

diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 797dae5350..1e52986b74 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 
 _check_test_img
 
+echo
+echo '=== Reading across backing EOF in one operation ==='
+echo
+
+# Use a cluster boundary as the base end here
+base_size=$((3 * 1024 * 1024 * 1024))
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $base_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
+
+# Write 16 times 42 at the end of the base image
+$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \
+    | _filter_qemu_io
+
+# Read 32 bytes across the base EOF from the top;
+# should be 16 times 0x2a, then 16 times 0x00
+$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \
+    | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 37aed84436..51ae06d38f 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728
 read 512/512 bytes at offset 3221258752
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
+
+=== Reading across backing EOF in one operation ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+wrote 16/16 bytes at offset 3221225456
+16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+bffffff0:  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ................
+c0000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+read 32/32 bytes at offset 3221225456
+32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7983.21185 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpB-00029Q-Tg; Fri, 16 Oct 2020 11:23:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7983.21185; Fri, 16 Oct 2020 11:23:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpB-00029I-Qf; Fri, 16 Oct 2020 11:23:05 +0000
Received: by outflank-mailman (input) for mailman id 7983;
 Fri, 16 Oct 2020 11:23:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpA-000295-OG
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e4a8a1b-8c7b-4957-9a20-7ff2cfa02479;
 Fri, 16 Oct 2020 11:23:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNp9-0002R8-Q6
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNp9-0002fh-P0
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpA-000295-OG
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:04 +0000
X-Inumbo-ID: 6e4a8a1b-8c7b-4957-9a20-7ff2cfa02479
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e4a8a1b-8c7b-4957-9a20-7ff2cfa02479;
	Fri, 16 Oct 2020 11:23:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=25L6+TgRs8GX0tOJvHh1LEisi80EABnQ3TBZcJGaHgk=; b=H9T01A8lJHoiVzDc1VT180ZqFw
	ea3nLO5Omih7TXZ8RRhDkJbOM0AWaElNZyvBUTr00g2bXw+4JWBxwhiV77idmryu3xL1yYDlp55nl
	jLDxBryWb92uNfsyQKXQvkjDvr9pUzP7mYy89rX/BKnXlCuc7ALlqCX3p2mwuVR7Ljc4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNp9-0002R8-Q6
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNp9-0002fh-P0
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] nbd: Fix large trim/zero requests
Message-Id: <E1kTNp9-0002fh-P0@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:03 +0000

commit b57df52546762549aec6591f5f38523111702fa9
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Wed Jul 22 16:22:31 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    nbd: Fix large trim/zero requests
    
    Although qemu as NBD client limits requests to <2G, the NBD protocol
    allows clients to send requests almost all the way up to 4G.  But
    because our block layer is not yet 64-bit clean, we accidentally wrap
    such requests into a negative size, and fail with EIO instead of
    performing the intended operation.
    
    The bug is visible in modern systems with something as simple as:
    
    $ qemu-img create -f qcow2 /tmp/image.img 5G
    $ sudo qemu-nbd --connect=/dev/nbd0 /tmp/image.img
    $ sudo blkdiscard /dev/nbd0
    
    or with user-space only:
    
    $ truncate --size=3G file
    $ qemu-nbd -f raw file
    $ nbdsh -u nbd://localhost:10809 -c 'h.trim(3*1024*1024*1024,0)'
    
    Although both blk_co_pdiscard and blk_pwrite_zeroes currently return 0
    on success, this is also a good time to fix our code to a more robust
    paradigm that treats all non-negative values as success.
    
    Alas, our iotests do not currently make it easy to add external
    dependencies on blkdiscard or nbdsh, so we have to rely on manual
    testing for now.
    
    This patch can be reverted when we later improve the overall block
    layer to be 64-bit clean, but for now, a minimal fix was deemed less
    risky prior to release.
    
    CC: qemu-stable@nongnu.org
    Fixes: 1f4d6d18ed
    Fixes: 1c6c4bb7f0
    Fixes: https://github.com/systemd/systemd/issues/16242
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200722212231.535072-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: rework success tests to use >=0]
    (cherry picked from commit 890cbccb089db9e646cc1baea3be9dc060e3917b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 nbd/server.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 20754e9ebc..0918173c1b 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2365,8 +2365,17 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
         if (request->flags & NBD_CMD_FLAG_FAST_ZERO) {
             flags |= BDRV_REQ_NO_FALLBACK;
         }
-        ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
-                                request->len, flags);
+        ret = 0;
+        /* FIXME simplify this when blk_pwrite_zeroes switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
+                                    len, flags);
+            request->len -= len;
+            request->from += len;
+        }
         return nbd_send_generic_reply(client, request->handle, ret,
                                       "writing to file failed", errp);
 
@@ -2380,9 +2389,18 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
                                       "flush failed", errp);
 
     case NBD_CMD_TRIM:
-        ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
-                              request->len);
-        if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) {
+        ret = 0;
+        /* FIXME simplify this when blk_co_pdiscard switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
+                                  len);
+            request->len -= len;
+            request->from += len;
+        }
+        if (ret >= 0 && request->flags & NBD_CMD_FLAG_FUA) {
             ret = blk_co_flush(exp->blk);
         }
         return nbd_send_generic_reply(client, request->handle, ret,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7984.21189 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpL-0002B4-VN; Fri, 16 Oct 2020 11:23:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7984.21189; Fri, 16 Oct 2020 11:23:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpL-0002Aw-S7; Fri, 16 Oct 2020 11:23:15 +0000
Received: by outflank-mailman (input) for mailman id 7984;
 Fri, 16 Oct 2020 11:23:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpK-0002Ap-Po
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cc887c67-3a22-404f-9952-939445651df3;
 Fri, 16 Oct 2020 11:23:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpJ-0002RF-TF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpJ-0002gX-ST
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpK-0002Ap-Po
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:14 +0000
X-Inumbo-ID: cc887c67-3a22-404f-9952-939445651df3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cc887c67-3a22-404f-9952-939445651df3;
	Fri, 16 Oct 2020 11:23:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OpwwMVh2Nc7E8+OBTFq2Jt9q7umWiq/R2UVNwco6rrw=; b=mJCSPHJjEAGEhat6T2qzNAgBoE
	o8+IB9IvmqHZLzotcmQk3HO+GgJ6iR6mI2uk2TkG9ZxVqTCcmKZmBDo9Ssop9E/3w6YxBWDEUgzuH
	BbquszqkF20iC4zP2ZwbLaZqnZOQJD9JYoBk+wnlyyi8IjJ6WWKWymGs0jRSNyfOxtjc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpJ-0002RF-TF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpJ-0002gX-ST
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-net: align RSC fields with updated virtio-net header
Message-Id: <E1kTNpJ-0002gX-ST@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:13 +0000

commit 5e817ece11e8fff09f1635dc9667175ef2234c28
Author:     Yuri Benditovich <yuri.benditovich@daynix.com>
AuthorDate: Fri May 8 15:59:34 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    virtio-net: align RSC fields with updated virtio-net header
    
    Removal of duplicated RSC definitions. Changing names of the
    fields to ones defined in the Linux header.
    
    Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit dd3d85e89123c907be7628957457af3d03e3b85b)
     Conflicts:
            hw/net/virtio-net.c
    *drop context dep. on 590790297c0
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/virtio-net.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index e7e2c2acdb..6cb1448310 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -77,25 +77,6 @@
    tso/gso/gro 'off'. */
 #define VIRTIO_NET_RSC_DEFAULT_INTERVAL 300000
 
-/* temporary until standard header include it */
-#if !defined(VIRTIO_NET_HDR_F_RSC_INFO)
-
-#define VIRTIO_NET_HDR_F_RSC_INFO  4 /* rsc_ext data in csum_ fields */
-#define VIRTIO_NET_F_RSC_EXT       61
-
-static inline __virtio16 *virtio_net_rsc_ext_num_packets(
-    struct virtio_net_hdr *hdr)
-{
-    return &hdr->csum_start;
-}
-
-static inline __virtio16 *virtio_net_rsc_ext_num_dupacks(
-    struct virtio_net_hdr *hdr)
-{
-    return &hdr->csum_offset;
-}
-
-#endif
 
 static VirtIOFeature feature_sizes[] = {
     {.flags = 1ULL << VIRTIO_NET_F_MAC,
@@ -1539,15 +1520,15 @@ static size_t virtio_net_rsc_drain_seg(VirtioNetRscChain *chain,
                                        VirtioNetRscSeg *seg)
 {
     int ret;
-    struct virtio_net_hdr *h;
+    struct virtio_net_hdr_v1 *h;
 
-    h = (struct virtio_net_hdr *)seg->buf;
+    h = (struct virtio_net_hdr_v1 *)seg->buf;
     h->flags = 0;
     h->gso_type = VIRTIO_NET_HDR_GSO_NONE;
 
     if (seg->is_coalesced) {
-        *virtio_net_rsc_ext_num_packets(h) = seg->packets;
-        *virtio_net_rsc_ext_num_dupacks(h) = seg->dup_ack;
+        h->rsc.segments = seg->packets;
+        h->rsc.dup_acks = seg->dup_ack;
         h->flags = VIRTIO_NET_HDR_F_RSC_INFO;
         if (chain->proto == ETH_P_IP) {
             h->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7985.21193 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpW-0002Da-0R; Fri, 16 Oct 2020 11:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7985.21193; Fri, 16 Oct 2020 11:23:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpV-0002DS-To; Fri, 16 Oct 2020 11:23:25 +0000
Received: by outflank-mailman (input) for mailman id 7985;
 Fri, 16 Oct 2020 11:23:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpU-0002DK-RX
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 77f5eafc-7e27-49f4-becc-91705a983379;
 Fri, 16 Oct 2020 11:23:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpT-0002RP-WB
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpT-0002hB-VV
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpU-0002DK-RX
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:24 +0000
X-Inumbo-ID: 77f5eafc-7e27-49f4-becc-91705a983379
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 77f5eafc-7e27-49f4-becc-91705a983379;
	Fri, 16 Oct 2020 11:23:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1a4P6UoFpTw3n00eyFXIyPx+iFcfEMC9yG0y2VUkjtA=; b=y3npjGAGpbIa465+qiH5pR10yc
	Yp4y4bQ+34Ex5uhXvXX6366tAJEH4ruqjomy2FvC4q9H3WNPkZ0BCyN8v6O+LIRo4977Xu4YLhynQ
	NNF/rFHV92S4aShbORko9yYYWVImT8lu8n3NaIDP90VJE3sFsCFsaB1QezbiDDFWSNNw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpT-0002RP-WB
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpT-0002hB-VV
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] hw/arm/sbsa-ref: fix typo breaking PCIe IRQs
Message-Id: <E1kTNpT-0002hB-VV@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:23 +0000

commit a575af07b8009bc51a311274c15846697b7d5f7c
Author:     Graeme Gregory <graeme@nuviainc.com>
AuthorDate: Fri Aug 28 10:02:43 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    hw/arm/sbsa-ref: fix typo breaking PCIe IRQs
    
    Fixing a typo in a previous patch that translated an "i" to a 1
    and therefore breaking the allocation of PCIe interrupts. This was
    discovered when virtio-net-pci devices ceased to function correctly.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
    Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200821083853.356490-1-graeme@nuviainc.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    (cherry picked from commit 870f0051b4ada9a361f7454f833432ae8c06c095)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 8409ba853d..0b32084dc0 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -555,7 +555,7 @@ static void create_pcie(SBSAMachineState *sms)
 
     for (i = 0; i < GPEX_NUM_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
         gpex_set_irq_num(GPEX_HOST(dev), i, irq + i);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7986.21197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpg-0002F5-2R; Fri, 16 Oct 2020 11:23:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7986.21197; Fri, 16 Oct 2020 11:23:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpf-0002Ev-VN; Fri, 16 Oct 2020 11:23:35 +0000
Received: by outflank-mailman (input) for mailman id 7986;
 Fri, 16 Oct 2020 11:23:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpe-0002El-Sz
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8add33ab-8651-41e3-b3f9-20600623b5fe;
 Fri, 16 Oct 2020 11:23:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpe-0002Rx-2o
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpe-0002hn-2D
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpe-0002El-Sz
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
X-Inumbo-ID: 8add33ab-8651-41e3-b3f9-20600623b5fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8add33ab-8651-41e3-b3f9-20600623b5fe;
	Fri, 16 Oct 2020 11:23:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GMQVOZ6S10ToSCIasDDWkE7A6b9sMBtsV+8WP0NQBgM=; b=sJqob2tu8LfVYwYsrsCYLr0egC
	WhUwUhxd3QnayqM+3HLXEPSQPcerg4BWKrUVI5f9M9a1KxBtowdYhly1w7C1H+5TRtY7c8wfiM22W
	0oI6oHJWZWHdYDyJf2C0lJxfRH40tYPy6z/6aWxMfcRKviZcln+0m8oyScKUJwYrCfz0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpe-0002Rx-2o
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpe-0002hn-2D
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] usb: fix setup_len init (CVE-2020-14364)
Message-Id: <E1kTNpe-0002hn-2D@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:34 +0000

commit f243bb4b0d6dab7da3ae8490e0f46054bae93816
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Aug 25 07:36:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    usb: fix setup_len init (CVE-2020-14364)
    
    Store calculated setup_len in a local variable, verify it, and only
    write it to the struct (USBDevice->setup_len) in case it passed the
    sanity checks.
    
    This prevents other code (do_token_{in,out} functions specifically)
    from working with invalid USBDevice->setup_len values and overrunning
    the USBDevice->setup_buf[] buffer.
    
    Fixes: CVE-2020-14364
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Tested-by: Gonglei <arei.gonglei@huawei.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-id: 20200825053636.29648-1-kraxel@redhat.com
    (cherry picked from commit b946434f2659a182afc17e155be6791ebfb302eb)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/core.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/hw/usb/core.c b/hw/usb/core.c
index 5abd128b6b..5234dcc73f 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
 static void do_token_setup(USBDevice *s, USBPacket *p)
 {
     int request, value, index;
+    unsigned int setup_len;
 
     if (p->iov.size != 8) {
         p->status = USB_RET_STALL;
@@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p)
     usb_packet_copy(p, s->setup_buf, p->iov.size);
     s->setup_index = 0;
     p->actual_length = 0;
-    s->setup_len   = (s->setup_buf[7] << 8) | s->setup_buf[6];
-    if (s->setup_len > sizeof(s->data_buf)) {
+    setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+    if (setup_len > sizeof(s->data_buf)) {
         fprintf(stderr,
                 "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
-                s->setup_len, sizeof(s->data_buf));
+                setup_len, sizeof(s->data_buf));
         p->status = USB_RET_STALL;
         return;
     }
+    s->setup_len = setup_len;
 
     request = (s->setup_buf[0] << 8) | s->setup_buf[1];
     value   = (s->setup_buf[3] << 8) | s->setup_buf[2];
@@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p)
 static void do_parameter(USBDevice *s, USBPacket *p)
 {
     int i, request, value, index;
+    unsigned int setup_len;
 
     for (i = 0; i < 8; i++) {
         s->setup_buf[i] = p->parameter >> (i*8);
     }
 
     s->setup_state = SETUP_STATE_PARAM;
-    s->setup_len   = (s->setup_buf[7] << 8) | s->setup_buf[6];
     s->setup_index = 0;
 
     request = (s->setup_buf[0] << 8) | s->setup_buf[1];
     value   = (s->setup_buf[3] << 8) | s->setup_buf[2];
     index   = (s->setup_buf[5] << 8) | s->setup_buf[4];
 
-    if (s->setup_len > sizeof(s->data_buf)) {
+    setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+    if (setup_len > sizeof(s->data_buf)) {
         fprintf(stderr,
                 "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
-                s->setup_len, sizeof(s->data_buf));
+                setup_len, sizeof(s->data_buf));
         p->status = USB_RET_STALL;
         return;
     }
+    s->setup_len = setup_len;
 
     if (p->pid == USB_TOKEN_OUT) {
         usb_packet_copy(p, s->data_buf, s->setup_len);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7987.21201 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpq-0002H5-3c; Fri, 16 Oct 2020 11:23:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7987.21201; Fri, 16 Oct 2020 11:23:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNpq-0002Gw-0d; Fri, 16 Oct 2020 11:23:46 +0000
Received: by outflank-mailman (input) for mailman id 7987;
 Fri, 16 Oct 2020 11:23:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpp-0002Gl-1N
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e7fcaa1b-9f15-4777-b9dd-47b35fc85288;
 Fri, 16 Oct 2020 11:23:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpo-0002S6-5w
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpo-0002iR-56
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpp-0002Gl-1N
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:45 +0000
X-Inumbo-ID: e7fcaa1b-9f15-4777-b9dd-47b35fc85288
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e7fcaa1b-9f15-4777-b9dd-47b35fc85288;
	Fri, 16 Oct 2020 11:23:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dlfyZYnBh09ze8xksYXjYeK/IPKSxR/Up+tn/s86Bhc=; b=Mt28XqVWX1vzWnVKXAg3Fo3TPh
	BqYZFdliQqgckADsZFRymwP2LAIH8264dCGetfF2DmFDpBpbA9GQEPBrA6fQDsVnVfHwDj+8920Xy
	99vAyR2XBeG9eMKgCbxy1q6uk72QCxC1Y/GEeQRbbAri1wLWxk9aimuOzCnKrTDL5W2g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpo-0002S6-5w
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpo-0002iR-56
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] 9p: null terminate fs driver options list
Message-Id: <E1kTNpo-0002iR-56@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:44 +0000

commit f2fd6555c71e0c67c907e2c3d808a4f52acd972f
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jul 9 23:28:48 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    9p: null terminate fs driver options list
    
    NULL terminate fs driver options' list, validate_opt() looks for
    a null entry to terminate the loop.
    
    Fixes: aee7f3ecd8b7 ("fsdev: Error out when unsupported option is passed")
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-Id: <20200709175848.650400-1-ppandit@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 353b5a91ccf2789b85967d19a8795816b8865562)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index a9e069c0c7..3da64e9f72 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {
             "throttling.iops-read-max-length",
             "throttling.iops-write-max-length",
             "throttling.iops-size",
+            NULL
         },
     },
     {
@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = {
         .ops = &synth_ops,
         .opts = (const char * []) {
             COMMON_FS_DRIVER_OPTIONS,
+            NULL
         },
     },
     {
@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = {
             "socket",
             "sock_fd",
             "writeout",
+            NULL
         },
     },
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:23:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:23:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7988.21204 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNq1-0002IS-5j; Fri, 16 Oct 2020 11:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7988.21204; Fri, 16 Oct 2020 11:23:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNq1-0002IK-2L; Fri, 16 Oct 2020 11:23:57 +0000
Received: by outflank-mailman (input) for mailman id 7988;
 Fri, 16 Oct 2020 11:23:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNpz-0002IB-Ec
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ccb7cabb-0bf6-49b1-bd12-c0d11b00a9e3;
 Fri, 16 Oct 2020 11:23:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpy-0002SR-8w
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNpy-0002ix-8J
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNpz-0002IB-Ec
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:55 +0000
X-Inumbo-ID: ccb7cabb-0bf6-49b1-bd12-c0d11b00a9e3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ccb7cabb-0bf6-49b1-bd12-c0d11b00a9e3;
	Fri, 16 Oct 2020 11:23:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mj5his6ByID3l78B79LPTOwFIdsCHsGuZbgtzE35zE4=; b=TcdtYtnKpsawVqjIsLlb5iyW0x
	3tRBNQoG5O9nP7JDO6F0+EFHPKgRPmU6kaDB1Lsm4wrHUJtCEtDkqnj2np9woXyEo7zPb5ab25+aZ
	U4/F7CwBQ55FuPxLF0NBAEMYD/Y4x42LyaeSgoRvj0PrCL1XPhnqsG4q1D3kKdjwQ+tg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpy-0002SR-8w
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNpy-0002ix-8J
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:23:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] nvram: Exit QEMU if NVRAM cannot contain all -prom-env data
Message-Id: <E1kTNpy-0002ix-8J@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:23:54 +0000

commit ebf5b3946e49bc10eef1234753f3fac3ac14d3e5
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Fri Aug 14 01:12:19 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Sep 10 13:09:51 2020 -0500

    nvram: Exit QEMU if NVRAM cannot contain all -prom-env data
    
    Since commit 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to
    support the -prom-env parameter"), pseries machines can pre-initialize
    the "system" partition in the NVRAM with the data passed to all -prom-env
    parameters on the QEMU command line.
    
    In this case it is assumed that all the data fits in 64 KiB, but the user
    can easily pass more and crash QEMU:
    
    $ qemu-system-ppc64 -M pseries $(for ((x=0;x<128;x++)); do \
      echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
      done) # this requires ~128 Kib
    malloc(): corrupted top size
    Aborted (core dumped)
    
    This happens because we don't check if all the prom-env data fits in
    the NVRAM and chrp_nvram_set_var() happily memcpy() it passed the
    buffer.
    
    This crash affects basically all ppc/ppc64 machine types that use -prom-env:
    - pseries (all versions)
    - g3beige
    - mac99
    
    and also sparc/sparc64 machine types:
    - LX
    - SPARCClassic
    - SPARCbook
    - SS-10
    - SS-20
    - SS-4
    - SS-5
    - SS-600MP
    - Voyager
    - sun4u
    - sun4v
    
    Add a max_len argument to chrp_nvram_create_system_partition() so that
    it can check the available size before writing to memory.
    
    Since NVRAM is populated at machine init, it seems reasonable to consider
    this error as fatal. So, instead of reporting an error when we detect that
    the NVRAM is too small and adapt all machine types to handle it, we simply
    exit QEMU in all cases. This is still better than crashing. If someone
    wants another behavior, I guess this can be reworked later.
    
    Tested with:
    
    $ yes q | \
      (for arch in ppc ppc64 sparc sparc64; do \
           echo == $arch ==; \
           qemu=${arch}-softmmu/qemu-system-$arch; \
           for mach in $($qemu -M help | awk '! /^Supported/ { print $1 }'); do \
               echo $mach; \
               $qemu -M $mach -monitor stdio -nodefaults -nographic \
               $(for ((x=0;x<128;x++)); do \
                     echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
                 done) >/dev/null; \
            done; echo; \
       done)
    
    Without the patch, affected machine types cause QEMU to report some
    memory corruption and crash:
    
    malloc(): corrupted top size
    
    free(): invalid size
    
    *** stack smashing detected ***: terminated
    
    With the patch, QEMU prints the following message and exits:
    
    NVRAM is too small. Try to pass less data to -prom-env
    
    It seems that the conditions for the crash have always existed, but it
    affects pseries, the machine type I care for, since commit 61f20b9dc5b7
    only.
    
    Fixes: 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to support the -prom-env parameter")
    RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1867739
    Reported-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159736033937.350502.12402444542194031035.stgit@bahia.lan>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    (cherry picked from commit 37035df51eaabb8d26b71da75b88a1c6727de8fa)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/nvram/chrp_nvram.c         | 24 +++++++++++++++++++++---
 hw/nvram/mac_nvram.c          |  2 +-
 hw/nvram/spapr_nvram.c        |  3 ++-
 hw/sparc/sun4m.c              |  2 +-
 hw/sparc64/sun4u.c            |  2 +-
 include/hw/nvram/chrp_nvram.h |  3 ++-
 6 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/hw/nvram/chrp_nvram.c b/hw/nvram/chrp_nvram.c
index d969f26704..d4d10a7c03 100644
--- a/hw/nvram/chrp_nvram.c
+++ b/hw/nvram/chrp_nvram.c
@@ -21,14 +21,21 @@
 
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
+#include "qemu/error-report.h"
 #include "hw/nvram/chrp_nvram.h"
 #include "sysemu/sysemu.h"
 
-static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
+static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str,
+                              int max_len)
 {
     int len;
 
     len = strlen(str) + 1;
+
+    if (max_len < len) {
+        return -1;
+    }
+
     memcpy(&nvram[addr], str, len);
 
     return addr + len;
@@ -38,19 +45,26 @@ static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
  * Create a "system partition", used for the Open Firmware
  * environment variables.
  */
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len)
 {
     ChrpNvramPartHdr *part_header;
     unsigned int i;
     int end;
 
+    if (max_len < sizeof(*part_header)) {
+        goto fail;
+    }
+
     part_header = (ChrpNvramPartHdr *)data;
     part_header->signature = CHRP_NVPART_SYSTEM;
     pstrcpy(part_header->name, sizeof(part_header->name), "system");
 
     end = sizeof(ChrpNvramPartHdr);
     for (i = 0; i < nb_prom_envs; i++) {
-        end = chrp_nvram_set_var(data, end, prom_envs[i]);
+        end = chrp_nvram_set_var(data, end, prom_envs[i], max_len - end);
+        if (end == -1) {
+            goto fail;
+        }
     }
 
     /* End marker */
@@ -65,6 +79,10 @@ int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
     chrp_nvram_finish_partition(part_header, end);
 
     return end;
+
+fail:
+    error_report("NVRAM is too small. Try to pass less data to -prom-env");
+    exit(EXIT_FAILURE);
 }
 
 /**
diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c
index 2e8a1e3812..1c44ee19e1 100644
--- a/hw/nvram/mac_nvram.c
+++ b/hw/nvram/mac_nvram.c
@@ -152,7 +152,7 @@ static void pmac_format_nvram_partition_of(MacIONVRAMState *nvr, int off,
 
     /* OpenBIOS nvram variables partition */
     sysp_end = chrp_nvram_create_system_partition(&nvr->data[off],
-                                                  DEF_SYSTEM_SIZE) + off;
+                                                  DEF_SYSTEM_SIZE, len) + off;
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&nvr->data[sysp_end], len - sysp_end);
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index 15d08281d4..386513499f 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -188,7 +188,8 @@ static void spapr_nvram_realize(SpaprVioDevice *dev, Error **errp)
         }
     } else if (nb_prom_envs > 0) {
         /* Create a system partition to pass the -prom-env variables */
-        chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4);
+        chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4,
+                                           nvram->size);
         chrp_nvram_create_free_partition(&nvram->buf[MIN_NVRAM_SIZE / 4],
                                          nvram->size - MIN_NVRAM_SIZE / 4);
     }
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 36ee1a0a3d..fa77e2a5e2 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -142,7 +142,7 @@ static void nvram_init(Nvram *nvram, uint8_t *macaddr,
     memset(image, '\0', sizeof(image));
 
     /* OpenBIOS nvram variables partition */
-    sysp_end = chrp_nvram_create_system_partition(image, 0);
+    sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 6abfcb30f8..9dcb9a4bc8 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -136,7 +136,7 @@ static int sun4u_NVRAM_set_params(Nvram *nvram, uint16_t NVRAM_size,
     memset(image, '\0', sizeof(image));
 
     /* OpenBIOS nvram variables partition */
-    sysp_end = chrp_nvram_create_system_partition(image, 0);
+    sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/include/hw/nvram/chrp_nvram.h b/include/hw/nvram/chrp_nvram.h
index 09941a9be4..4a0f5c21b8 100644
--- a/include/hw/nvram/chrp_nvram.h
+++ b/include/hw/nvram/chrp_nvram.h
@@ -50,7 +50,8 @@ chrp_nvram_finish_partition(ChrpNvramPartHdr *header, uint32_t size)
     header->checksum = sum & 0xff;
 }
 
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len);
+/* chrp_nvram_create_system_partition() failure is fatal */
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len);
 int chrp_nvram_create_free_partition(uint8_t *data, int len);
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:24:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:24:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7989.21209 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqB-0002KC-8l; Fri, 16 Oct 2020 11:24:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7989.21209; Fri, 16 Oct 2020 11:24:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqB-0002K4-5q; Fri, 16 Oct 2020 11:24:07 +0000
Received: by outflank-mailman (input) for mailman id 7989;
 Fri, 16 Oct 2020 11:24:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNq9-0002Jo-EF
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 88a936f0-ec63-4fe0-85b5-f5c822eeaf3f;
 Fri, 16 Oct 2020 11:24:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNq8-0002T8-Bt
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNq8-0002jl-BD
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNq9-0002Jo-EF
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:05 +0000
X-Inumbo-ID: 88a936f0-ec63-4fe0-85b5-f5c822eeaf3f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 88a936f0-ec63-4fe0-85b5-f5c822eeaf3f;
	Fri, 16 Oct 2020 11:24:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1R9jDTbpMg79aWqZ9+uHltMfGSRZgiSTmDvSPVf3TfQ=; b=ycllL7scn02y0mLhrUkueH6dDi
	Hnfa58yShih4T+tY0I1YnqaKgYn96LBuF1kdKa1pJOTyw484LyT8SXQz4aLxcfXGtBnG6yWiVDkb2
	MJY9yo24SMJlXjXInM5sHuU3736oPAmdsjQBCGy3XL79wMmT5PCmHkxIyZRFY8QBelPI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNq8-0002T8-Bt
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNq8-0002jl-BD
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] virtio-ccw: fix virtio_set_ind_atomic
Message-Id: <E1kTNq8-0002jl-BD@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:24:04 +0000

commit b8fdfa9d6388823d66b22039b9dfb61fc7a8f401
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Tue Jun 16 06:50:34 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Sep 10 13:09:51 2020 -0500

    virtio-ccw: fix virtio_set_ind_atomic
    
    The atomic_cmpxchg() loop is broken because we occasionally end up with
    old and _old having different values (a legit compiler can generate code
    that accessed *ind_addr again to pick up a value for _old instead of
    using the value of old that was already fetched according to the
    rules of the abstract machine). This means the underlying CS instruction
    may use a different old (_old) than the one we intended to use if
    atomic_cmpxchg() performed the xchg part.
    
    Let us use volatile to force the rules of the abstract machine for
    accesses to *ind_addr. Let us also rewrite the loop so, we that the
    new old is used to compute the new desired value if the xchg part
    is not performed.
    
    Fixes: 7e7494627f ("s390x/virtio-ccw: Adapter interrupt support.")
    Reported-by: Andre Wild <Andre.Wild1@ibm.com>
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Message-Id: <20200616045035.51641-2-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    (cherry picked from commit 1a8242f7c3f53341dd66253b142ecd06ce1d2a97)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/s390x/virtio-ccw.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 64f928fc7d..9d4e80ccfd 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -786,9 +786,10 @@ static inline VirtioCcwDevice *to_virtio_ccw_dev_fast(DeviceState *d)
 static uint8_t virtio_set_ind_atomic(SubchDev *sch, uint64_t ind_loc,
                                      uint8_t to_be_set)
 {
-    uint8_t ind_old, ind_new;
+    uint8_t expected, actual;
     hwaddr len = 1;
-    uint8_t *ind_addr;
+    /* avoid  multiple fetches */
+    uint8_t volatile *ind_addr;
 
     ind_addr = cpu_physical_memory_map(ind_loc, &len, true);
     if (!ind_addr) {
@@ -796,14 +797,15 @@ static uint8_t virtio_set_ind_atomic(SubchDev *sch, uint64_t ind_loc,
                      __func__, sch->cssid, sch->ssid, sch->schid);
         return -1;
     }
+    actual = *ind_addr;
     do {
-        ind_old = *ind_addr;
-        ind_new = ind_old | to_be_set;
-    } while (atomic_cmpxchg(ind_addr, ind_old, ind_new) != ind_old);
-    trace_virtio_ccw_set_ind(ind_loc, ind_old, ind_new);
-    cpu_physical_memory_unmap(ind_addr, len, 1, len);
+        expected = actual;
+        actual = atomic_cmpxchg(ind_addr, expected, expected | to_be_set);
+    } while (actual != expected);
+    trace_virtio_ccw_set_ind(ind_loc, actual, actual | to_be_set);
+    cpu_physical_memory_unmap((void *)ind_addr, len, 1, len);
 
-    return ind_old;
+    return actual;
 }
 
 static void virtio_ccw_notify(DeviceState *d, uint16_t vector)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:24:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:24:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7990.21213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqL-0002LN-AL; Fri, 16 Oct 2020 11:24:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7990.21213; Fri, 16 Oct 2020 11:24:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqL-0002LF-7L; Fri, 16 Oct 2020 11:24:17 +0000
Received: by outflank-mailman (input) for mailman id 7990;
 Fri, 16 Oct 2020 11:24:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNqJ-0002L5-P9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 81cef87a-5910-4f38-9f88-6c290aeb8f44;
 Fri, 16 Oct 2020 11:24:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqI-0002TN-Fg
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqI-0002kL-E4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNqJ-0002L5-P9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:15 +0000
X-Inumbo-ID: 81cef87a-5910-4f38-9f88-6c290aeb8f44
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 81cef87a-5910-4f38-9f88-6c290aeb8f44;
	Fri, 16 Oct 2020 11:24:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O7banSQWoVzpzuq0HLg70oYYGInlOMcEA/CTQJ3s64k=; b=hjHdvGf1CCYfsbBBCakvZbBwJr
	4YVzz2X/XriblN6hziO8mcNX0DRA/2XQ7PzZlid2eidzfM8UaG5gzOfPxer79MeeAZgspl1wMihC6
	9D76SuTC3gt12ybjipa/OTWqLAghqDY3ovw7BVQzmrmqNQFMA8GV8QDcDEbABFFkXaAU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqI-0002TN-Fg
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqI-0002kL-E4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] riscv: sifive_test: Allow 16-bit writes to memory region
Message-Id: <E1kTNqI-0002kL-E4@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:24:14 +0000

commit 5c49f7ee3b98316850de6a33952a4ac47701c118
Author:     Nathan Chancellor <natechancellor@gmail.com>
AuthorDate: Mon Aug 31 22:58:23 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Sep 14 21:28:53 2020 -0500

    riscv: sifive_test: Allow 16-bit writes to memory region
    
    When shutting down the machine running a mainline Linux kernel, the
    following error happens:
    
    $ build/riscv64-softmmu/qemu-system-riscv64 -bios default -M virt \
        -display none -initrd rootfs.cpio -kernel Image -m 512m \
        -nodefaults -serial mon:stdio
    ...
    Requesting system poweroff
    [    4.999630] reboot: Power down
    sbi_trap_error: hart0: trap handler failed (error -2)
    sbi_trap_error: hart0: mcause=0x0000000000000007 mtval=0x0000000000100000
    sbi_trap_error: hart0: mepc=0x000000008000d4cc mstatus=0x0000000000001822
    sbi_trap_error: hart0: ra=0x000000008000999e sp=0x0000000080015c78
    sbi_trap_error: hart0: gp=0xffffffe000e76610 tp=0xffffffe0081b89c0
    sbi_trap_error: hart0: s0=0x0000000080015c88 s1=0x0000000000000040
    sbi_trap_error: hart0: a0=0x0000000000000000 a1=0x0000000080004024
    sbi_trap_error: hart0: a2=0x0000000080004024 a3=0x0000000080004024
    sbi_trap_error: hart0: a4=0x0000000000100000 a5=0x0000000000005555
    sbi_trap_error: hart0: a6=0x0000000000004024 a7=0x0000000080011158
    sbi_trap_error: hart0: s2=0x0000000000000000 s3=0x0000000080016000
    sbi_trap_error: hart0: s4=0x0000000000000000 s5=0x0000000000000000
    sbi_trap_error: hart0: s6=0x0000000000000001 s7=0x0000000000000000
    sbi_trap_error: hart0: s8=0x0000000000000000 s9=0x0000000000000000
    sbi_trap_error: hart0: s10=0x0000000000000000 s11=0x0000000000000008
    sbi_trap_error: hart0: t0=0x0000000000000000 t1=0x0000000000000000
    sbi_trap_error: hart0: t2=0x0000000000000000 t3=0x0000000000000000
    sbi_trap_error: hart0: t4=0x0000000000000000 t5=0x0000000000000000
    sbi_trap_error: hart0: t6=0x0000000000000000
    
    The kernel does a 16-bit write when powering off the machine, which
    was allowed before commit 5d971f9e67 ("memory: Revert "memory: accept
    mismatching sizes in memory_region_access_valid""). Make min_access_size
    match reality so that the machine can shut down properly now.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 88a07990fa ("SiFive RISC-V Test Finisher")
    Fixes: 5d971f9e67 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200901055822.2721209-1-natechancellor@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    (cherry picked from commit ab3d207fe89bc0c63739db19e177af49179aa457)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/riscv/sifive_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_test.c b/hw/riscv/sifive_test.c
index 339195c6ff..1d57a15747 100644
--- a/hw/riscv/sifive_test.c
+++ b/hw/riscv/sifive_test.c
@@ -58,7 +58,7 @@ static const MemoryRegionOps sifive_test_ops = {
     .write = sifive_test_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
     .valid = {
-        .min_access_size = 4,
+        .min_access_size = 2,
         .max_access_size = 4
     }
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:24:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:24:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7992.21217 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqV-0002Mi-Bn; Fri, 16 Oct 2020 11:24:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7992.21217; Fri, 16 Oct 2020 11:24:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqV-0002Ma-8p; Fri, 16 Oct 2020 11:24:27 +0000
Received: by outflank-mailman (input) for mailman id 7992;
 Fri, 16 Oct 2020 11:24:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNqT-0002MM-8A
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e2712861-b6ab-4d75-90ce-a9fc14d28540;
 Fri, 16 Oct 2020 11:24:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqS-0002Ta-J2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqS-0002kv-Hv
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNqT-0002MM-8A
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:25 +0000
X-Inumbo-ID: e2712861-b6ab-4d75-90ce-a9fc14d28540
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e2712861-b6ab-4d75-90ce-a9fc14d28540;
	Fri, 16 Oct 2020 11:24:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a3Rk2DJfIhwiMGDNX3u2F4OJ2C71ufF4BJnzjuSY5vo=; b=F2JVtDmctAWiIpGPz4JL0B1i7M
	7gQjZhjpSab6fg/r5NilrWEonAKolfqbK706+CobXmEQD5j6Tn9yOS3AsL/9Rn3R4k+xl54YR5TJH
	ndGTVPpmPloo9NhHRnZ/8nr9hcH0xk0cVqJN92CdgHMyfyS0JgT84pv+Wdk2ShV1PWjQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqS-0002Ta-J2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqS-0002kv-Hv
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] Update version for 5.0.1 release
Message-Id: <E1kTNqS-0002kv-Hv@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:24:24 +0000

commit 386b2a5767f7642521cd07930c681ec8a6057e60
Author:     Michael Roth <mdroth@linux.vnet.ibm.com>
AuthorDate: Tue Sep 15 11:27:07 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Sep 15 11:27:07 2020 -0500

    Update version for 5.0.1 release
    
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 0062ac9718..6b244dcd69 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.0
+5.0.1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:24:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:24:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7993.21221 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqf-0002O0-DO; Fri, 16 Oct 2020 11:24:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7993.21221; Fri, 16 Oct 2020 11:24:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNqf-0002Ns-AH; Fri, 16 Oct 2020 11:24:37 +0000
Received: by outflank-mailman (input) for mailman id 7993;
 Fri, 16 Oct 2020 11:24:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNqd-0002Ni-PL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id add6b28e-3f6a-4681-aa9f-4f9bae4c5c85;
 Fri, 16 Oct 2020 11:24:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqc-0002UR-Pp
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNqc-0002lP-OL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNqd-0002Ni-PL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:35 +0000
X-Inumbo-ID: add6b28e-3f6a-4681-aa9f-4f9bae4c5c85
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id add6b28e-3f6a-4681-aa9f-4f9bae4c5c85;
	Fri, 16 Oct 2020 11:24:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/2OtZzBT6z5TAug5LYIgAKMSQOltH5g6K8OYGofmg3M=; b=CUbET6GN021A1SROk+LTgvE9yI
	+AzyBe9B1O0hZyV0xZgNzCg7gOcHgtUtZNMQoFtWAkEhWtYOPRh9dQYyQ7szJzjM73piApfVI7cxf
	dDydrNMJGGOGM+g3/kC1sudnkiBY0sxwI7fXRBvHugr3U2g1E8tfLpQr65CzB9DYV8Y0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqc-0002UR-Pp
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNqc-0002lP-OL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:24:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging-4.14] Merge tag 'v5.0.1' into staging-4.14
Message-Id: <E1kTNqc-0002lP-OL@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:24:34 +0000

commit e6a4cbe48cfca6adbe4e7acdf7e405c8315facaa
Merge: ea6d3cd1ed79d824e605a70c3626bc437c386260 386b2a5767f7642521cd07930c681ec8a6057e60
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Oct 16 11:53:28 2020 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Oct 16 11:53:28 2020 +0100

    Merge tag 'v5.0.1' into staging-4.14
    
    5.0.1

 VERSION                                            |   2 +-
 backends/hostmem.c                                 |   6 +-
 block.c                                            |   7 +-
 block/io.c                                         |  10 +-
 block/nbd.c                                        |  21 ++--
 chardev/char-socket.c                              |   8 +-
 contrib/libvhost-user/libvhost-user.c              |   4 +-
 docs/system/arm/orangepi.rst                       |  16 ++-
 fsdev/qemu-fsdev.c                                 |   3 +
 hw/9pfs/9p-util.h                                  |  13 ++
 hw/9pfs/9p.c                                       |  34 ++----
 hw/9pfs/9p.h                                       |  10 +-
 hw/9pfs/virtio-9p-device.c                         |  11 +-
 hw/9pfs/xen-9p-backend.c                           |  41 +++++--
 hw/acpi/core.c                                     |   9 +-
 hw/arm/sbsa-ref.c                                  |   2 +-
 hw/audio/es1370.c                                  |   7 +-
 hw/audio/gusemu_hal.c                              |   2 +-
 hw/audio/gusemu_mixer.c                            |   2 +-
 hw/display/artist.c                                |  12 +-
 hw/display/ati.c                                   |  10 +-
 hw/i386/intel_iommu.c                              |   7 +-
 hw/i386/intel_iommu_internal.h                     |   3 +-
 hw/net/e1000e_core.c                               |  10 +-
 hw/net/tulip.c                                     |   6 -
 hw/net/virtio-net.c                                |  29 +----
 hw/nvram/chrp_nvram.c                              |  24 +++-
 hw/nvram/mac_nvram.c                               |   2 +-
 hw/nvram/spapr_nvram.c                             |   3 +-
 hw/riscv/sifive_clint.c                            |   2 +-
 hw/riscv/sifive_test.c                             |   2 +-
 hw/s390x/virtio-ccw.c                              |  18 +--
 hw/sd/pxa2xx_mmci.c                                |   4 +-
 hw/sd/sd.c                                         |  90 ++++++++++----
 hw/sparc/sun4m.c                                   |   2 +-
 hw/sparc64/sun4u.c                                 |   2 +-
 hw/tpm/tpm_spapr.c                                 |   5 +-
 hw/usb/core.c                                      |  16 ++-
 hw/usb/dev-mtp.c                                   |  11 +-
 hw/usb/hcd-xhci.c                                  |   4 +-
 hw/virtio/virtio-balloon.c                         | 133 ++++++++++++---------
 hw/virtio/virtio-pci.c                             |  34 ++++--
 include/block/aio.h                                |   3 +
 include/hw/nvram/chrp_nvram.h                      |   3 +-
 include/hw/virtio/virtio-balloon.h                 |  20 ++--
 include/qemu/osdep.h                               |  10 ++
 include/standard-headers/linux/ethtool.h           |  10 +-
 include/standard-headers/linux/input-event-codes.h |   5 +-
 include/standard-headers/linux/pci_regs.h          |   2 +
 include/standard-headers/linux/vhost_types.h       |   8 ++
 include/standard-headers/linux/virtio_balloon.h    |  12 +-
 include/standard-headers/linux/virtio_ids.h        |   1 +
 include/standard-headers/linux/virtio_net.h        | 102 +++++++++++++++-
 linux-headers/COPYING                              |   2 +
 linux-headers/asm-x86/kvm.h                        |   1 +
 linux-headers/asm-x86/unistd_32.h                  |   1 +
 linux-headers/asm-x86/unistd_64.h                  |   1 +
 linux-headers/asm-x86/unistd_x32.h                 |   1 +
 linux-headers/linux/kvm.h                          |  47 +++++++-
 linux-headers/linux/mman.h                         |   5 +-
 linux-headers/linux/userfaultfd.h                  |  40 +++++--
 linux-headers/linux/vfio.h                         |  37 ++++++
 linux-headers/linux/vhost.h                        |  24 ++++
 linux-user/strace.list                             |   4 +-
 memory.c                                           |  29 ++---
 migration/block-dirty-bitmap.c                     |   2 +-
 nbd/server.c                                       |  51 ++++++--
 net/net.c                                          |   4 +-
 pc-bios/openbios-ppc                               | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32                           | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64                           | Bin 1593408 -> 1593408 bytes
 qdev-monitor.c                                     |   2 +-
 qemu-nbd.c                                         |  13 +-
 qga/commands.c                                     |  17 ++-
 qga/main.c                                         |   6 +-
 roms/openbios                                      |   2 +-
 scsi/qemu-pr-helper.c                              |   4 +-
 target/arm/vec_helper.c                            |   2 +
 target/hppa/translate.c                            |   2 +
 target/i386/cpu.c                                  |   3 +
 target/i386/kvm.c                                  |  11 +-
 target/i386/kvm_i386.h                             |   1 +
 tests/acceptance/avocado_qemu/__init__.py          |  13 +-
 tests/acceptance/boot_linux.py                     |  49 ++++----
 tests/acceptance/boot_linux_console.py             |  55 ++++++---
 tests/qemu-iotests/028                             |  19 +++
 tests/qemu-iotests/028.out                         |  11 ++
 tests/qemu-iotests/143                             |   4 +
 tests/qemu-iotests/143.out                         |   2 +
 tests/qemu-iotests/283                             |   6 +-
 tests/qemu-iotests/283.out                         |   2 +-
 tests/qtest/libqos/pci-pc.c                        |   2 +-
 tests/qtest/tpm-util.c                             |   6 +-
 tests/qtest/usb-hcd-ehci-test.c                    |   2 +-
 tools/virtiofsd/fuse_lowlevel.h                    |   1 +
 tools/virtiofsd/helper.c                           |  47 ++++++++
 tools/virtiofsd/passthrough_ll.c                   |  22 ++--
 tools/virtiofsd/seccomp.c                          |   1 +
 util/aio-posix.c                                   |  13 ++
 util/aio-win32.c                                   |   4 +
 util/async.c                                       |   1 +
 util/fdmon-io_uring.c                              |  13 +-
 util/oslib-posix.c                                 |  35 ++++++
 util/oslib-win32.c                                 |  13 ++
 104 files changed, 1051 insertions(+), 395 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.7999.21249 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNyq-0003Rc-Fh; Fri, 16 Oct 2020 11:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 7999.21249; Fri, 16 Oct 2020 11:33:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNyq-0003RV-Ct; Fri, 16 Oct 2020 11:33:04 +0000
Received: by outflank-mailman (input) for mailman id 7999;
 Fri, 16 Oct 2020 11:33:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNyp-0003RP-Pp
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fa556474-f6b1-4e8e-977b-cce00511193f;
 Fri, 16 Oct 2020 11:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNyo-0002fY-Hj
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNyo-0003Hl-FI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNyp-0003RP-Pp
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:03 +0000
X-Inumbo-ID: fa556474-f6b1-4e8e-977b-cce00511193f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fa556474-f6b1-4e8e-977b-cce00511193f;
	Fri, 16 Oct 2020 11:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QGjQ+ZvkljXILyBpQKZvnB6nL++C1RshHnTwvmg0UYo=; b=4oPQh3g5P36/MUwWIkn6Vb9uxG
	u3BU8wxEJT+NLAHYEw6jXZf1vBnL0D9uqUoI5jLHOqYo3n8p6kADjoy93OZlUv0X8RTHHyqiDkXAx
	g9wJmIhJqKok8E9wN/hqHBOcUujagru/Cn6RloD47N2BjmJ1+J5m2Qkm6ICjaNf+100k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNyo-0002fY-Hj
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNyo-0003Hl-FI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: Correct error message in check_segment()
Message-Id: <E1kTNyo-0003Hl-FI@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:02 +0000

commit 8d255609930bed04c6436974bd895be9a405d0c1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Oct 2 12:20:44 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/hvm: Correct error message in check_segment()
    
    The error message is wrong (given AMD's older interpretation of what a NUL
    segment should contain, attribute wise), and actively unhelpful because you
    only get it in response to a hypercall where the one piece of information you
    cannot provide is the segment selector.
    
    Fix the message to talk about segment attributes, rather than the selector.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/domain.c b/xen/arch/x86/hvm/domain.c
index 0ce132b308..10e30175a1 100644
--- a/xen/arch/x86/hvm/domain.c
+++ b/xen/arch/x86/hvm/domain.c
@@ -39,7 +39,7 @@ static int check_segment(struct segment_register *reg, enum x86_segment seg)
     {
         if ( seg != x86_seg_ds && seg != x86_seg_es )
         {
-            gprintk(XENLOG_ERR, "Null selector provided for CS, SS or TR\n");
+            gprintk(XENLOG_ERR, "Null segment attributes for CS, SS or TR\n");
             return -EINVAL;
         }
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8000.21253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNz1-0003TH-Hb; Fri, 16 Oct 2020 11:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8000.21253; Fri, 16 Oct 2020 11:33:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNz1-0003T9-EX; Fri, 16 Oct 2020 11:33:15 +0000
Received: by outflank-mailman (input) for mailman id 8000;
 Fri, 16 Oct 2020 11:33:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNyz-0003SQ-T9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1d1fa103-dd25-47c7-a1b4-6faf300af21e;
 Fri, 16 Oct 2020 11:33:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNyy-0002fe-L4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNyy-0003IL-Jw
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNyz-0003SQ-T9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:13 +0000
X-Inumbo-ID: 1d1fa103-dd25-47c7-a1b4-6faf300af21e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1d1fa103-dd25-47c7-a1b4-6faf300af21e;
	Fri, 16 Oct 2020 11:33:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c1ns/NEhw/NrNM5tWzejZCAeuTy9CWbN7Olx0sw8bXk=; b=VJ2ZATqNt2NQjQxk+vFysP04cI
	ZyuyPDxIkkdt2Owezzcbtjww0OY6SeZ7g5/P4ZdnBomdSWIF7DmJ6ldkqsvqrrfWDRx8RK08X3i2n
	GuP6XR26NF7KygYavom6ymPaIzwRlj4EM+/xVULv7ja5Ijwp4hWwMrnOs4vAlB2ARWJ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNyy-0002fe-L4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNyy-0003IL-Jw
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode: Trivial further cleanup
Message-Id: <E1kTNyy-0003IL-Jw@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:12 +0000

commit afef39241b66df7d5fd66b07dc13350370a4991a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 1 15:51:08 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/ucode: Trivial further cleanup
    
     * Drop unused include in private.h.
     * Used explicit width integers for Intel header fields.
     * Adjust comment to better describe the extended header.
     * Drop unnecessary __packed attribute for AMD header.
     * Fix types and style.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c     |  8 ++++----
 xen/arch/x86/cpu/microcode/intel.c   | 34 +++++++++++++++++-----------------
 xen/arch/x86/cpu/microcode/private.h |  2 --
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index cd532321e8..e80f7cd3e4 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -24,7 +24,7 @@
 
 #define pr_debug(x...) ((void)0)
 
-struct __packed equiv_cpu_entry {
+struct equiv_cpu_entry {
     uint32_t installed_cpu;
     uint32_t fixed_errata_mask;
     uint32_t fixed_errata_compare;
@@ -102,7 +102,7 @@ static void collect_cpu_info(void)
              smp_processor_id(), csig->rev);
 }
 
-static bool_t verify_patch_size(uint32_t patch_size)
+static bool verify_patch_size(uint32_t patch_size)
 {
     uint32_t max_size;
 
@@ -113,7 +113,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
 #define F17H_MPB_MAX_SIZE 3200
 #define F19H_MPB_MAX_SIZE 4800
 
-    switch (boot_cpu_data.x86)
+    switch ( boot_cpu_data.x86 )
     {
     case 0x14:
         max_size = F14H_MPB_MAX_SIZE;
@@ -135,7 +135,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         break;
     }
 
-    return (patch_size <= max_size);
+    return patch_size <= max_size;
 }
 
 static bool check_final_patch_levels(const struct cpu_signature *sig)
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index d031196d4c..d9bb1bc10e 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -32,38 +32,38 @@
 #define pr_debug(x...) ((void)0)
 
 struct microcode_patch {
-    unsigned int hdrver;
-    unsigned int rev;
+    uint32_t hdrver;
+    uint32_t rev;
     uint16_t year;
     uint8_t  day;
     uint8_t  month;
-    unsigned int sig;
-    unsigned int cksum;
-    unsigned int ldrver;
+    uint32_t sig;
+    uint32_t cksum;
+    uint32_t ldrver;
 
     /*
      * Microcode for the Pentium Pro and II had all further fields in the
      * header reserved, had a fixed datasize of 2000 and totalsize of 2048,
      * and didn't use platform flags despite the availability of the MSR.
      */
-    unsigned int pf;
-    unsigned int datasize;
-    unsigned int totalsize;
-    unsigned int reserved[3];
+    uint32_t pf;
+    uint32_t datasize;
+    uint32_t totalsize;
+    uint32_t reserved[3];
 
     /* Microcode payload.  Format is propriety and encrypted. */
     uint8_t data[];
-};
 
-/* microcode format is extended from prescott processors */
+    /* Extended header (iff totalsize > datasize, P4 Prescott and later) */
+};
 struct extended_sigtable {
-    unsigned int count;
-    unsigned int cksum;
-    unsigned int reserved[3];
+    uint32_t count;
+    uint32_t cksum;
+    uint32_t rsvd[3];
     struct {
-        unsigned int sig;
-        unsigned int pf;
-        unsigned int cksum;
+        uint32_t sig;
+        uint32_t pf;
+        uint32_t cksum;
     } sigs[];
 };
 
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index c00ba590d1..9a15cdc879 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -1,8 +1,6 @@
 #ifndef ASM_X86_MICROCODE_PRIVATE_H
 #define ASM_X86_MICROCODE_PRIVATE_H
 
-#include <xen/types.h>
-
 #include <asm/microcode.h>
 
 enum microcode_match_result {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8001.21257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzA-0003VZ-KH; Fri, 16 Oct 2020 11:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8001.21257; Fri, 16 Oct 2020 11:33:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzA-0003VS-HO; Fri, 16 Oct 2020 11:33:24 +0000
Received: by outflank-mailman (input) for mailman id 8001;
 Fri, 16 Oct 2020 11:33:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNz9-0003VL-RU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bd851a63-7b65-476e-b3e4-192b8c39f0ec;
 Fri, 16 Oct 2020 11:33:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNz8-0002fm-OI
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNz8-0003Iv-NQ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNz9-0003VL-RU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:23 +0000
X-Inumbo-ID: bd851a63-7b65-476e-b3e4-192b8c39f0ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bd851a63-7b65-476e-b3e4-192b8c39f0ec;
	Fri, 16 Oct 2020 11:33:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p/08n09sWkCimQBCALh0Imk+NNffG8e1uMW9ArZIF1U=; b=vL6gj2kMjubAzvuQkYI1C1lB43
	mD7mhX0mDwgKGSFTaENBze9QLoIH/gfiF8o3ADcBqJRwE3NQQw6fISetd6oIfSaSBBLFuCUfuHgTN
	+HY/RqD/Q/ISPNHH0TIY5u9+Wvq6LRLV07LGJg9N8l3lSHNo6x6TR1u3SYMb6Z5nXYH0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNz8-0002fm-OI
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNz8-0003Iv-NQ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] efi/boot.c: add file.need_to_free
Message-Id: <E1kTNz8-0003Iv-NQ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:22 +0000

commit 04be2c3a067899a3860fc2c7bc7a1599502ed1c5
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:19 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi/boot.c: add file.need_to_free
    
    The config file, kernel, initrd, etc should only be freed if they
    are allocated with the UEFI allocator.  On x86 the ucode, and on
    ARM the dtb, are also marked as need_to_free when allocated or
    expanded.
    
    This also fixes a memory leak in ARM fdt_increase_size() if there
    is an error in building the new device tree.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/efi/efi-boot.h | 11 +++++++++--
 xen/arch/x86/efi/efi-boot.h |  2 +-
 xen/common/efi/boot.c       | 10 ++++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 27dd0b1a94..c6200fda0e 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -314,7 +314,10 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
     if ( fdt_size )
     {
         if ( fdt_open_into(dtbfile.ptr, new_fdt, pages * EFI_PAGE_SIZE) )
+        {
+            efi_bs->FreePages(fdt_addr, pages);
             return NULL;
+        }
     }
     else
     {
@@ -326,7 +329,10 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
          * system table that is passed in the FDT.
          */
         if ( fdt_create_empty_tree(new_fdt, pages * EFI_PAGE_SIZE) )
+        {
+            efi_bs->FreePages(fdt_addr, pages);
             return NULL;
+        }
     }
 
     /*
@@ -335,12 +341,13 @@ static void __init *fdt_increase_size(struct file *fdtfile, int add_size)
      * code will free it.  If the original FDT came from a configuration
      * table, we don't own that memory and can't free it.
      */
-    if ( dtbfile.size )
+    if ( dtbfile.need_to_free )
         efi_bs->FreePages(dtbfile.addr, PFN_UP(dtbfile.size));
 
     /* Update 'file' info for new memory so we clean it up on error exits */
     dtbfile.addr = fdt_addr;
     dtbfile.size = pages * EFI_PAGE_SIZE;
+    dtbfile.need_to_free = true;
     return new_fdt;
 }
 
@@ -546,7 +553,7 @@ static void __init efi_arch_cpu(void)
 
 static void __init efi_arch_blexit(void)
 {
-    if ( dtbfile.addr && dtbfile.size )
+    if ( dtbfile.need_to_free )
         efi_bs->FreePages(dtbfile.addr, PFN_UP(dtbfile.size));
     if ( memmap )
         efi_bs->FreePool(memmap);
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index eef3f52789..1025000afd 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -689,7 +689,7 @@ static void __init efi_arch_cpu(void)
 
 static void __init efi_arch_blexit(void)
 {
-    if ( ucode.addr )
+    if ( ucode.need_to_free )
         efi_bs->FreePages(ucode.addr, PFN_UP(ucode.size));
 }
 
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8123523194..9d6dc8ff4f 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -102,6 +102,7 @@ union string {
 
 struct file {
     UINTN size;
+    bool need_to_free;
     union {
         EFI_PHYSICAL_ADDRESS addr;
         char *str;
@@ -287,13 +288,13 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.addr )
+    if ( cfg.need_to_free )
         efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-    if ( kernel.addr )
+    if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
-    if ( ramdisk.addr )
+    if ( ramdisk.need_to_free )
         efi_bs->FreePages(ramdisk.addr, PFN_UP(ramdisk.size));
-    if ( xsm.addr )
+    if ( xsm.need_to_free )
         efi_bs->FreePages(xsm.addr, PFN_UP(xsm.size));
 
     efi_arch_blexit();
@@ -588,6 +589,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     }
     else
     {
+        file->need_to_free = true;
         file->size = size;
         if ( file != &cfg )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8003.21261 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzK-0003X2-ME; Fri, 16 Oct 2020 11:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8003.21261; Fri, 16 Oct 2020 11:33:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzK-0003Wu-J2; Fri, 16 Oct 2020 11:33:34 +0000
Received: by outflank-mailman (input) for mailman id 8003;
 Fri, 16 Oct 2020 11:33:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNzJ-0003Wm-ME
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id afb38db6-22ce-4c5c-9480-38a8610117be;
 Fri, 16 Oct 2020 11:33:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzI-0002gP-SA
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzI-0003JY-QU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNzJ-0003Wm-ME
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:33 +0000
X-Inumbo-ID: afb38db6-22ce-4c5c-9480-38a8610117be
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id afb38db6-22ce-4c5c-9480-38a8610117be;
	Fri, 16 Oct 2020 11:33:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kzSNzKgG9owFxOU5p+RD1uMc9kOdagAgO3TiTXR5eng=; b=qwp4+UZXCLGm1biWXRXjLMbsY0
	yx4ouelxdM4QcUOT71Oc4fdyn4xAgvSbs9AtC91Y/vpdfRYR0VO4rPsrDJDEsRu/Cqf4YasUFKnFs
	0+OnCPVrsqbmQ5ZRZq3ZQga0aj/EurBiqWLcpUJUvn/E8QKDfr8ggFtGW5Px3O3R3E5Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzI-0002gP-SA
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzI-0003JY-QU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] efi/boot.c: add handle_file_info()
Message-Id: <E1kTNzI-0003JY-QU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:32 +0000

commit 4dced5df761e36fa2561f6f0f6563b3580d95e7f
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:20 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi/boot.c: add handle_file_info()
    
    Add a separate function to display the address ranges used by
    the files and call `efi_arch_handle_module()` on the modules.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/efi/boot.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9d6dc8ff4f..bd629eb658 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -547,6 +547,22 @@ static char * __init split_string(char *s)
     return NULL;
 }
 
+static void __init handle_file_info(const CHAR16 *name,
+                                    const struct file *file, const char *options)
+{
+    if ( file == &cfg )
+        return;
+
+    PrintStr(name);
+    PrintStr(L": ");
+    DisplayUint(file->addr, 2 * sizeof(file->addr));
+    PrintStr(L"-");
+    DisplayUint(file->addr + file->size, 2 * sizeof(file->addr));
+    PrintStr(newline);
+
+    efi_arch_handle_module(file, name, options);
+}
+
 static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                              struct file *file, const char *options)
 {
@@ -591,16 +607,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     {
         file->need_to_free = true;
         file->size = size;
-        if ( file != &cfg )
-        {
-            PrintStr(name);
-            PrintStr(L": ");
-            DisplayUint(file->addr, 2 * sizeof(file->addr));
-            PrintStr(L"-");
-            DisplayUint(file->addr + size, 2 * sizeof(file->addr));
-            PrintStr(newline);
-            efi_arch_handle_module(file, name, options);
-        }
+        handle_file_info(name, file, options);
 
         ret = FileHandle->Read(FileHandle, &file->size, file->str);
         if ( !EFI_ERROR(ret) && file->size != size )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8004.21265 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzV-0003Yo-Nv; Fri, 16 Oct 2020 11:33:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8004.21265; Fri, 16 Oct 2020 11:33:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzV-0003Yg-Ki; Fri, 16 Oct 2020 11:33:45 +0000
Received: by outflank-mailman (input) for mailman id 8004;
 Fri, 16 Oct 2020 11:33:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNzU-0003Ya-K4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 45d903ac-f636-41d6-b7e1-58b508d895b2;
 Fri, 16 Oct 2020 11:33:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzT-0002gX-0D
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzS-0003KG-UY
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNzU-0003Ya-K4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:44 +0000
X-Inumbo-ID: 45d903ac-f636-41d6-b7e1-58b508d895b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 45d903ac-f636-41d6-b7e1-58b508d895b2;
	Fri, 16 Oct 2020 11:33:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QGKUb5G5QHh2haM6hNbRTTOi5mQWxzVsuFmHbjoe6ms=; b=5IBwydraQ7bFpit5uia/AJh7Z5
	a8/6R1unV9roVTc1lvFYEl5bMncFeIj3VUxa6/fNCrAHfRYENpu372ImMvnvO2jvFf5sCP4fakwv4
	n3kifAiINWf4xb4BBtK5r9mQ//DcHjcBk63sMQozLSOmfRTlJu0LkMLcqzL6L0ycidZc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzT-0002gX-0D
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzS-0003KG-UY
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] efi: Enable booting unified hypervisor/kernel/initrd images
Message-Id: <E1kTNzS-0003KG-UY@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:42 +0000

commit 8a71d50ed40bfa78c37722dc11995ac2563662c3
Author:     Trammell Hudson <hudson@trmm.net>
AuthorDate: Fri Oct 2 07:18:21 2020 -0400
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    efi: Enable booting unified hypervisor/kernel/initrd images
    
    This patch adds support for bundling the xen.efi hypervisor, the xen.cfg
    configuration file, the Linux kernel and initrd, as well as the XSM,
    and architectural specific files into a single "unified" EFI executable.
    This allows an administrator to update the components independently
    without requiring rebuilding xen, as well as to replace the components
    in an existing image.
    
    The resulting EFI executable can be invoked directly from the UEFI Boot
    Manager, removing the need to use a separate loader like grub as well
    as removing dependencies on local filesystem access.  And since it is
    a single file, it can be signed and validated by UEFI Secure Boot without
    requring the shim protocol.
    
    It is inspired by systemd-boot's unified kernel technique and borrows the
    function to locate PE sections from systemd's LGPL'ed code.  During EFI
    boot, Xen looks at its own loaded image to locate the PE sections for
    the Xen configuration (`.config`), dom0 kernel (`.kernel`), dom0 initrd
    (`.ramdisk`), and XSM config (`.xsm`), which are included after building
    xen.efi using objcopy to add named sections for each input file.
    
    For x86, the CPU ucode can be included in a section named `.ucode`,
    which is loaded in the efi_arch_cfg_file_late() stage of the boot process.
    
    On ARM systems the Device Tree can be included in a section named
    `.dtb`, which is loaded during the efi_arch_cfg_file_early() stage of
    the boot process.
    
    Note that the system will fall back to loading files from disk if
    the named sections do not exist. This allows distributions to continue
    with the status quo if they want a signed kernel + config, while still
    allowing a user provided initrd (which is how the shim protocol currently
    works as well).
    
    This patch also adds constness to the section parameter of
    efi_arch_cfg_file_early() and efi_arch_cfg_file_late(),
    changes pe_find_section() to use a const CHAR16 section name,
    and adds pe_name_compare() to match section names.
    
    Signed-off-by: Trammell Hudson <hudson@trmm.net>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    [Fix ARM build by including pe.init.o]
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .gitignore                  |   1 +
 docs/misc/efi.pandoc        |  49 ++++++++++++++
 xen/arch/arm/efi/Makefile   |   2 +-
 xen/arch/arm/efi/efi-boot.h |  25 +++++---
 xen/arch/x86/efi/Makefile   |   2 +-
 xen/arch/x86/efi/efi-boot.h |  11 +++-
 xen/common/efi/boot.c       |  62 +++++++++++++-----
 xen/common/efi/efi.h        |   3 +
 xen/common/efi/pe.c         | 152 ++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 278 insertions(+), 29 deletions(-)

diff --git a/.gitignore b/.gitignore
index 188495783e..f6865c9cd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -327,6 +327,7 @@ xen/arch/*/efi/boot.c
 xen/arch/*/efi/compat.c
 xen/arch/*/efi/ebmalloc.c
 xen/arch/*/efi/efi.h
+xen/arch/*/efi/pe.c
 xen/arch/*/efi/runtime.c
 xen/common/config_data.S
 xen/common/config.gz
diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc
index 23c1a2732d..ac3cd58cae 100644
--- a/docs/misc/efi.pandoc
+++ b/docs/misc/efi.pandoc
@@ -116,3 +116,52 @@ Filenames must be specified relative to the location of the EFI binary.
 
 Extra options to be passed to Xen can also be specified on the command line,
 following a `--` separator option.
+
+## Unified Xen kernel image
+
+The "Unified" kernel image can be generated by adding additional
+sections to the Xen EFI executable with objcopy, similar to how
+[systemd-boot uses the stub to add them to the Linux kernel](https://wiki.archlinux.org/index.php/systemd-boot#Preparing_a_unified_kernel_image)
+
+The sections for the xen configuration file, the dom0 kernel, dom0 initrd,
+XSM and CPU microcode should be added after the Xen `.pad` section, the
+ending address of which can be located with:
+
+```
+objdump -h xen.efi \
+	| perl -ane '/\.pad/ && printf "0x%016x\n", hex($F[2]) + hex($F[3])'
+```
+
+For all the examples the `.pad` section ended at 0xffff82d041000000.
+All the sections are optional (`.config`, `.kernel`, `.ramdisk`, `.xsm`,
+`.ucode` (x86) and `.dtb` (ARM)) and the order does not matter.
+The virtual addresses do not need to be contiguous, although they should not
+be overlapping and should all be greater than the last virtual address of the
+hypervisor components.
+
+```
+objcopy \
+	--add-section .config=xen.cfg \
+	--change-section-vma .config=0xffff82d041000000
+	--add-section .ucode=ucode.bin \
+	--change-section-vma .ucode=0xffff82d041010000 \
+	--add-section .xsm=xsm.cfg \
+	--change-section-vma .xsm=0xffff82d041080000 \
+	--add-section .kernel=vmlinux \
+	--change-section-vma .kernel=0xffff82d041100000 \
+	--add-section .ramdisk=initrd.img \
+	--change-section-vma .ramdisk=0xffff82d042000000 \
+	xen.efi \
+	xen.unified.efi
+```
+
+The unified executable can be signed with sbsigntool to make
+it usable with UEFI secure boot:
+
+```
+sbsign \
+	--key signing.key \
+	--cert cert.pem \
+	--output xen.signed.efi \
+	xen.unified.efi
+```
diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile
index 662892babd..1b1ed06fed 100644
--- a/xen/arch/arm/efi/Makefile
+++ b/xen/arch/arm/efi/Makefile
@@ -1,4 +1,4 @@
 CFLAGS-y += -fshort-wchar
 
-obj-y += boot.init.o ebmalloc.o runtime.o
+obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o
 obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index c6200fda0e..f64a6604af 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -382,27 +382,36 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     efi_xen_start(fdt, fdt_totalsize(fdt));
 }
 
-static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
+                                           EFI_FILE_HANDLE dir_handle,
+                                           const char *section)
 {
     union string name;
 
     /*
      * The DTB must be processed before any other entries in the configuration
-     * file, as the DTB is updated as modules are loaded.
+     * file, as the DTB is updated as modules are loaded.  Prefer the one
+     * stored as a PE section in a unified image, and fall back to a file
+     * on disk if the section is not present.
      */
-    name.s = get_value(&cfg, section, "dtb");
-    if ( name.s )
+    if ( !read_section(image, L"dtb", &dtbfile, NULL) )
     {
-        split_string(name.s);
-        read_file(dir_handle, s2w(&name), &dtbfile, NULL);
-        efi_bs->FreePool(name.w);
+        name.s = get_value(&cfg, section, "dtb");
+        if ( name.s )
+        {
+            split_string(name.s);
+            read_file(dir_handle, s2w(&name), &dtbfile, NULL);
+            efi_bs->FreePool(name.w);
+        }
     }
     fdt = fdt_increase_size(&dtbfile, cfg.size + EFI_PAGE_SIZE);
     if ( !fdt )
         blexit(L"Unable to create new FDT");
 }
 
-static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
+                                          EFI_FILE_HANDLE dir_handle,
+                                          const char *section)
 {
 }
 
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 770438a029..e857c0f2cc 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -8,7 +8,7 @@ cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
 
 boot.init.o: buildid.o
 
-EFIOBJ := boot.init.o ebmalloc.o compat.o runtime.o
+EFIOBJ := boot.init.o pe.init.o ebmalloc.o compat.o runtime.o
 
 $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4)
 $(EFIOBJ): CFLAGS-stack-boundary := $(cflags-stack-boundary)
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 1025000afd..2541ba1f32 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -272,14 +272,21 @@ static void __init noreturn efi_arch_post_exit_boot(void)
     unreachable();
 }
 
-static void __init efi_arch_cfg_file_early(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
+                                           EFI_FILE_HANDLE dir_handle,
+                                           const char *section)
 {
 }
 
-static void __init efi_arch_cfg_file_late(EFI_FILE_HANDLE dir_handle, char *section)
+static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
+                                          EFI_FILE_HANDLE dir_handle,
+                                          const char *section)
 {
     union string name;
 
+    if ( read_section(image, L"ucode", &ucode, NULL) )
+        return;
+
     name.s = get_value(&cfg, section, "ucode");
     if ( !name.s )
         name.s = get_value(&cfg, "global", "ucode");
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index bd629eb658..bacd551bb5 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -122,6 +122,8 @@ static CHAR16 *s2w(union string *str);
 static char *w2s(const union string *str);
 static bool read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                       struct file *file, const char *options);
+static bool read_section(const EFI_LOADED_IMAGE *image, const CHAR16 *name,
+                         struct file *file, const char *options);
 static size_t wstrlen(const CHAR16 * s);
 static int set_color(u32 mask, int bpp, u8 *pos, u8 *sz);
 static bool match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
@@ -631,6 +633,20 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     return true;
 }
 
+static bool __init read_section(const EFI_LOADED_IMAGE *image,
+                                const CHAR16 *name, struct file *file,
+                                const char *options)
+{
+    file->ptr = pe_find_section(image->ImageBase, image->ImageSize,
+                                name, &file->size);
+    if ( !file->ptr )
+        return false;
+
+    handle_file_info(name, file, options);
+
+    return true;
+}
+
 static void __init pre_parse(const struct file *cfg)
 {
     char *ptr = cfg->str, *end = ptr + cfg->size;
@@ -1216,7 +1232,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         dir_handle = get_parent_handle(loaded_image, &file_name);
 
         /* Read and parse the config file. */
-        if ( !cfg_file_name )
+        if ( read_section(loaded_image, L"config", &cfg, NULL) )
+            PrintStr(L"Using builtin config file\r\n");
+        else if ( !cfg_file_name )
         {
             CHAR16 *tail;
 
@@ -1266,29 +1284,39 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         if ( !name.s )
             blexit(L"No Dom0 kernel image specified.");
 
-        efi_arch_cfg_file_early(dir_handle, section.s);
+        efi_arch_cfg_file_early(loaded_image, dir_handle, section.s);
 
         option_str = split_string(name.s);
-        read_file(dir_handle, s2w(&name), &kernel, option_str);
-        efi_bs->FreePool(name.w);
-
-        if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
-                        (void **)&shim_lock)) &&
-             (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
-            PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
-        name.s = get_value(&cfg, section.s, "ramdisk");
-        if ( name.s )
+        if ( !read_section(loaded_image, L"kernel", &kernel, option_str) )
         {
-            read_file(dir_handle, s2w(&name), &ramdisk, NULL);
+            read_file(dir_handle, s2w(&name), &kernel, option_str);
             efi_bs->FreePool(name.w);
+
+            if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
+                            (void **)&shim_lock)) &&
+                 (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+                PrintErrMesg(L"Dom0 kernel image could not be verified", status);
         }
 
-        name.s = get_value(&cfg, section.s, "xsm");
-        if ( name.s )
+        if ( !read_section(loaded_image, L"ramdisk", &ramdisk, NULL) )
         {
-            read_file(dir_handle, s2w(&name), &xsm, NULL);
-            efi_bs->FreePool(name.w);
+            name.s = get_value(&cfg, section.s, "ramdisk");
+            if ( name.s )
+            {
+                read_file(dir_handle, s2w(&name), &ramdisk, NULL);
+                efi_bs->FreePool(name.w);
+            }
+        }
+
+        if ( !read_section(loaded_image, L"xsm", &xsm, NULL) )
+        {
+            name.s = get_value(&cfg, section.s, "xsm");
+            if ( name.s )
+            {
+                read_file(dir_handle, s2w(&name), &xsm, NULL);
+                efi_bs->FreePool(name.w);
+            }
         }
 
         /*
@@ -1324,7 +1352,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
             }
         }
 
-        efi_arch_cfg_file_late(dir_handle, section.s);
+        efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
         efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
         cfg.addr = 0;
diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index 4845d84913..663a8b5000 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -47,3 +47,6 @@ const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN n);
 /* EFI boot allocator. */
 void *ebmalloc(size_t size);
 void free_ebmalloc_unused_mem(void);
+
+const void *pe_find_section(const void *image_base, const size_t image_size,
+                            const CHAR16 *section_name, UINTN *size_out);
diff --git a/xen/common/efi/pe.c b/xen/common/efi/pe.c
new file mode 100644
index 0000000000..a84992df9a
--- /dev/null
+++ b/xen/common/efi/pe.c
@@ -0,0 +1,152 @@
+/*
+ * xen/common/efi/pe.c
+ *
+ * PE executable header parser.
+ *
+ * Derived from https://github.com/systemd/systemd/blob/master/src/boot/efi/pe.c
+ * commit 07d5ed536ec0a76b08229c7a80b910cb9acaf6b1
+ *
+ * Copyright (C) 2015 Kay Sievers <kay@vrfy.org>
+ * Copyright (C) 2020 Trammell Hudson <hudson@trmm.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
+ * Lesser General Public License for more details.
+ */
+
+
+#include "efi.h"
+
+struct DosFileHeader {
+    UINT8   Magic[2];
+    UINT16  LastSize;
+    UINT16  nBlocks;
+    UINT16  nReloc;
+    UINT16  HdrSize;
+    UINT16  MinAlloc;
+    UINT16  MaxAlloc;
+    UINT16  ss;
+    UINT16  sp;
+    UINT16  Checksum;
+    UINT16  ip;
+    UINT16  cs;
+    UINT16  RelocPos;
+    UINT16  nOverlay;
+    UINT16  reserved[4];
+    UINT16  OEMId;
+    UINT16  OEMInfo;
+    UINT16  reserved2[10];
+    UINT32  ExeHeader;
+};
+
+#if defined(__arm__) || defined (__aarch64__)
+#define PE_HEADER_MACHINE 0xaa64
+#elif defined(__x86_64__)
+#define PE_HEADER_MACHINE 0x8664
+#else
+#error "Unknown architecture"
+#endif
+
+struct PeFileHeader {
+    UINT16  Machine;
+    UINT16  NumberOfSections;
+    UINT32  TimeDateStamp;
+    UINT32  PointerToSymbolTable;
+    UINT32  NumberOfSymbols;
+    UINT16  SizeOfOptionalHeader;
+    UINT16  Characteristics;
+};
+
+struct PeHeader {
+    UINT8   Magic[4];
+    struct PeFileHeader FileHeader;
+};
+
+struct PeSectionHeader {
+    CHAR8   Name[8];
+    UINT32  VirtualSize;
+    UINT32  VirtualAddress;
+    UINT32  SizeOfRawData;
+    UINT32  PointerToRawData;
+    UINT32  PointerToRelocations;
+    UINT32  PointerToLinenumbers;
+    UINT16  NumberOfRelocations;
+    UINT16  NumberOfLinenumbers;
+    UINT32  Characteristics;
+};
+
+static bool __init pe_name_compare(const struct PeSectionHeader *sect,
+                                   const CHAR16 *name)
+{
+    size_t i;
+
+    if ( sect->Name[0] != '.' )
+        return false;
+
+    for ( i = 1; i < sizeof(sect->Name); i++ )
+    {
+        const char c = sect->Name[i];
+
+        if ( c != name[i - 1] )
+            return false;
+        if ( c == '\0' )
+            return true;
+    }
+
+    return name[i - 1] == L'\0';
+}
+
+const void *__init pe_find_section(const void *image, const UINTN image_size,
+                                   const CHAR16 *section_name, UINTN *size_out)
+{
+    const struct DosFileHeader *dos = image;
+    const struct PeHeader *pe;
+    const struct PeSectionHeader *sect;
+    UINTN offset, i;
+
+    if ( image_size < sizeof(*dos) ||
+         memcmp(dos->Magic, "MZ", 2) != 0 )
+        return NULL;
+
+    offset = dos->ExeHeader;
+    pe = image + offset;
+
+    offset += sizeof(*pe);
+    if ( image_size < offset ||
+         memcmp(pe->Magic, "PE\0\0", 4) != 0 )
+        return NULL;
+
+    if ( pe->FileHeader.Machine != PE_HEADER_MACHINE )
+        return NULL;
+
+    offset += pe->FileHeader.SizeOfOptionalHeader;
+
+    for ( i = 0; i < pe->FileHeader.NumberOfSections; i++ )
+    {
+        sect = image + offset;
+        if ( image_size < offset + sizeof(*sect) )
+            return NULL;
+
+        if ( !pe_name_compare(sect, section_name) )
+        {
+            offset += sizeof(*sect);
+            continue;
+        }
+
+        if ( image_size < sect->VirtualSize + sect->VirtualAddress )
+            blexit(L"PE invalid section size + address");
+
+        if ( size_out )
+            *size_out = sect->VirtualSize;
+
+        return image + sect->VirtualAddress;
+    }
+
+    return NULL;
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:33:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8005.21268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzf-0003a8-QO; Fri, 16 Oct 2020 11:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8005.21268; Fri, 16 Oct 2020 11:33:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzf-0003Zz-NW; Fri, 16 Oct 2020 11:33:55 +0000
Received: by outflank-mailman (input) for mailman id 8005;
 Fri, 16 Oct 2020 11:33:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNze-0003Zo-Ah
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 51b201e8-69e5-482b-bc5f-7e0aaf0fa3a9;
 Fri, 16 Oct 2020 11:33:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzd-0002gl-3H
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzd-0003Km-2U
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNze-0003Zo-Ah
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:54 +0000
X-Inumbo-ID: 51b201e8-69e5-482b-bc5f-7e0aaf0fa3a9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 51b201e8-69e5-482b-bc5f-7e0aaf0fa3a9;
	Fri, 16 Oct 2020 11:33:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4+7wyBuWDBIvH5yYs27pm5Oglw2bnBb+M+cwi4F+pzY=; b=ezsDqv48YHQWkiMLxlkbO+BCPv
	fGv0q4nCJS1YRRIbF60+5qGXzkamfIRAGJ4lMjYZ7+7F34f6j35fFQ260EBBsIjvY/dvYNGOor/P+
	XFmAfQvltHFKcINVCEvfU+z45HJR4iHN+Y0NTclvcDH/QVh/qUVwqqpcO9CCvC8uwVlw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzd-0002gl-3H
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzd-0003Km-2U
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:33:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kTNzd-0003Km-2U@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:33:53 +0000

commit 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 2 12:30:34 2020 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 9 17:20:11 2020 +0100

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 4e3861eb7d..59660a8af4 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1625,6 +1625,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8006.21273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzo-0003bQ-Rx; Fri, 16 Oct 2020 11:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8006.21273; Fri, 16 Oct 2020 11:34:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzo-0003bI-Oy; Fri, 16 Oct 2020 11:34:04 +0000
Received: by outflank-mailman (input) for mailman id 8006;
 Fri, 16 Oct 2020 11:34:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNzo-0003bC-0G
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4a41c54c-4360-4c70-97ce-cbfbe142fb8e;
 Fri, 16 Oct 2020 11:34:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzn-0002h9-6O
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzn-0003LV-5Y
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNzo-0003bC-0G
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:04 +0000
X-Inumbo-ID: 4a41c54c-4360-4c70-97ce-cbfbe142fb8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4a41c54c-4360-4c70-97ce-cbfbe142fb8e;
	Fri, 16 Oct 2020 11:34:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kCH+9Ui144ejkVoQEBsJ0rD6S40HT/ovB7jQB6av/h0=; b=x0V42gUrN1Aha0eh+Kju+yOqTm
	mwF0SWNy2kHeouMdhxH3lzAA/kDvdPe0lVaimt3a/GcQK7J/on4oc+5WMqifR2/UgNSP2hgtpvcEM
	MaoGgKq4dDAmrr1gKl1nMVAdfSxcs/EwDwExNWYanqzpTlSs1u63ngqfpj77Mnk4LpBA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzn-0002h9-6O
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzn-0003LV-5Y
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: only query VNC when enabled
Message-Id: <E1kTNzn-0003LV-5Y@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:03 +0000

commit 1b810a9d5a39230e76073b1a753cd2c34ded65fc
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Thu Oct 1 19:53:37 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Sun Oct 11 20:59:16 2020 +0000

    libxl: only query VNC when enabled
    
    QEMU without VNC support (configure --disable-vnc) will return an error
    when VNC is queried over QMP since it does not recognize the QMP
    command.  This will cause libxl to fail starting the domain even if VNC
    is not enabled.  Therefore only query QEMU for VNC support when using
    VNC, so a VNC-less QEMU will function in this configuration.
    
    'goto out' jumps to the call to device_model_postconfig_done(), the
    final callback after the chain of vnc queries.  This bypasses all the
    QMP VNC queries.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/light/libxl_dm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index a944181781..d1ff35dda3 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -3140,6 +3140,7 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
 {
     EGC_GC;
     libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
+    const libxl_vnc_info *vnc = libxl__dm_vnc(dmss->guest_config);
     const libxl__json_object *item = NULL;
     const libxl__json_object *o = NULL;
     int i = 0;
@@ -3197,6 +3198,9 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
         if (rc) goto out;
     }
 
+    if (!vnc)
+        goto out;
+
     qmp->callback = device_model_postconfig_vnc;
     rc = libxl__ev_qmp_send(egc, qmp, "query-vnc", NULL);
     if (rc) goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8007.21277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzz-0003co-TZ; Fri, 16 Oct 2020 11:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8007.21277; Fri, 16 Oct 2020 11:34:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTNzz-0003cg-QZ; Fri, 16 Oct 2020 11:34:15 +0000
Received: by outflank-mailman (input) for mailman id 8007;
 Fri, 16 Oct 2020 11:34:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTNzy-0003cW-2b
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ba56f89f-2f26-4963-bd27-80707f55a45f;
 Fri, 16 Oct 2020 11:34:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzx-0002hL-9M
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTNzx-0003Lx-8b
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTNzy-0003cW-2b
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:14 +0000
X-Inumbo-ID: ba56f89f-2f26-4963-bd27-80707f55a45f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ba56f89f-2f26-4963-bd27-80707f55a45f;
	Fri, 16 Oct 2020 11:34:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hH+kYTkn6kadzW4y8eW3scdOxCmPDBjFhQGZdz4+Hx4=; b=3tnr1XtPE7Q8HzTZF1pxYk/KbK
	CANprTL0XYcdz9pmUm3TdVw4aoZEOP0V1G78y0tyF8YFOI2Hil6fzBgys444xW/fwe98r0VlDItdW
	XLusd1HOcwBPCJQJ/lCAqjaCFPbLY8a2WZbr25b18xoWxDRFjiGKu0ZZ4NlMexssAvCk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzx-0002hL-9M
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTNzx-0003Lx-8b
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/store: add disclaimer to header file regarding ignored options
Message-Id: <E1kTNzx-0003Lx-8b@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:13 +0000

commit 534b3d09958fdc4df64872c2ab19feb4b1eebc5a
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 11 14:24:01 2020 +0200
Commit:     Wei Liu <wl@xen.org>
CommitDate: Sun Oct 11 20:59:51 2020 +0000

    tools/libs/store: add disclaimer to header file regarding ignored options
    
    Add a disclaimer to the libxenstore header file that all of the open
    flags (socket only connection, read only connection) are ignored.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/store/include/xenstore.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libs/store/include/xenstore.h b/tools/libs/store/include/xenstore.h
index 158e69ef83..2b3f69fb61 100644
--- a/tools/libs/store/include/xenstore.h
+++ b/tools/libs/store/include/xenstore.h
@@ -23,6 +23,7 @@
 
 #define XBT_NULL 0
 
+/* Following open flags are deprecated and ignored! */
 #define XS_OPEN_READONLY	(1UL<<0)
 #define XS_OPEN_SOCKETONLY      (1UL<<1)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8008.21281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO09-0003e6-Uy; Fri, 16 Oct 2020 11:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8008.21281; Fri, 16 Oct 2020 11:34:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO09-0003dy-S4; Fri, 16 Oct 2020 11:34:25 +0000
Received: by outflank-mailman (input) for mailman id 8008;
 Fri, 16 Oct 2020 11:34:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO08-0003dm-CG
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 643d5314-8bb2-4d2b-9320-8f042db0b482;
 Fri, 16 Oct 2020 11:34:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO07-0002hY-DA
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO07-0003Mp-BU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO08-0003dm-CG
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:24 +0000
X-Inumbo-ID: 643d5314-8bb2-4d2b-9320-8f042db0b482
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 643d5314-8bb2-4d2b-9320-8f042db0b482;
	Fri, 16 Oct 2020 11:34:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h71Fm4iT6Bfb5rX2NQO7sHAEbzSqrC7F9xRDJV/vxUg=; b=cTlt3yJbEPplWRIo8kxdEfcLDB
	jA7DiV/Sc27VLl4TN9XluBGrxstNWjya0HOpI8mQiR+MZOYBAZPoK4/UZfuPsR0UqhpKvOSGRDVqz
	hff7t0g5ZUggl01qWswvaesA66YHzakCDoBhGW/DYN1+q5+YRWB4g7yVx8TJZJalYMK4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO07-0002hY-DA
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO07-0003Mp-BU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] golang/xenlight: do not hard code libxl dir in gengotypes.py
Message-Id: <E1kTO07-0003Mp-BU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:23 +0000

commit c60f9e4360ec857bb0164387378e12ae8e66e189
Author:     Nick Rosbrook <rosbrookn@gmail.com>
AuthorDate: Sun Oct 11 19:31:24 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 13:30:53 2020 +0000

    golang/xenlight: do not hard code libxl dir in gengotypes.py
    
    Currently, in order to 'import idl' in gengotypes.py, we derive the path
    of the libxl source directory from the XEN_ROOT environment variable, and
    append that to sys.path so python can see idl.py. Since the the recent move of
    libxl to tools/libs/light, this hard coding breaks the build.
    
    Instead, check for the environment variable LIBXL_SRC_DIR, but move this
    check to a try-except block (with empty except). This simply makes the
    real error more visible, and does not strictly require that
    LIBXL_SRC_DIR is used. Finally, update the Makefile to set LIBXL_SRC_DIR
    rather than XEN_ROOT when calling gengotypes.py.
    
    Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/golang/xenlight/Makefile      | 2 +-
 tools/golang/xenlight/gengotypes.py | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index fd8e4893db..e394ef9b2b 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -16,7 +16,7 @@ all: build
 GOXL_GEN_FILES = types.gen.go helpers.gen.go
 
 %.gen.go: gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl $(LIBXL_SRC_DIR)/idl.py
-	XEN_ROOT=$(XEN_ROOT) $(PYTHON) gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl
+	LIBXL_SRC_DIR=$(LIBXL_SRC_DIR) $(PYTHON) gengotypes.py $(LIBXL_SRC_DIR)/libxl_types.idl
 
 # Go will do its own dependency checking, and not actuall go through
 # with the build if none of the input files have changed.
diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
index ebec938224..4ac181ae47 100644
--- a/tools/golang/xenlight/gengotypes.py
+++ b/tools/golang/xenlight/gengotypes.py
@@ -3,7 +3,14 @@
 import os
 import sys
 
-sys.path.append('{0}/tools/libxl'.format(os.environ['XEN_ROOT']))
+try:
+    sys.path.append(os.environ['LIBXL_SRC_DIR'])
+except:
+    # If we get here, then we expect the 'import idl'
+    # expression to fail. That error is more informative,
+    # so let it happen.
+    pass
+
 import idl
 
 # Go versions of some builtin types.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8009.21285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0K-0003fL-0O; Fri, 16 Oct 2020 11:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8009.21285; Fri, 16 Oct 2020 11:34:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0J-0003fD-TZ; Fri, 16 Oct 2020 11:34:35 +0000
Received: by outflank-mailman (input) for mailman id 8009;
 Fri, 16 Oct 2020 11:34:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO0I-0003f2-BY
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c516bfd4-5b66-40d8-9c5d-5f8c63695a61;
 Fri, 16 Oct 2020 11:34:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0H-0002iK-GJ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0H-0003NX-FU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO0I-0003f2-BY
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:34 +0000
X-Inumbo-ID: c516bfd4-5b66-40d8-9c5d-5f8c63695a61
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c516bfd4-5b66-40d8-9c5d-5f8c63695a61;
	Fri, 16 Oct 2020 11:34:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BhZd5qDl5eYktQLuq3FPAwEFyB+AbRRS8R1xFiBAmw8=; b=pMoe4EfFMj4o1v0YXzDNcv22CF
	Pb2AxsefAJjIR5+Ir7wNv4XCpnXc4ht5ZDk7JyUgCTmwQQ9wqeZlhxC0SXy50Cmv3Y4xE3Unm6dd3
	60ZWMKaGqh8AJDEogMr96POtBsrvmBg7OsmfF3wz15t1y3HeVUbnXJAmdAk77l4cohdo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0H-0002iK-GJ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0H-0003NX-FU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] golang/xenlight: standardize generated code comment
Message-Id: <E1kTO0H-0003NX-FU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:33 +0000

commit a95f31376ba4ae911536c647e1a583d144ccab73
Author:     Nick Rosbrook <rosbrookn@gmail.com>
AuthorDate: Sun Oct 11 19:31:25 2020 -0400
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 13:31:06 2020 +0000

    golang/xenlight: standardize generated code comment
    
    There is a standard format for generated Go code header comments, as set
    by [1]. Modify gengotypes.py to follow this standard, and use the
    additional
    
      // source: <IDL file basename>
    
    convention used by protoc-gen-go.
    
    This change is motivated by the fact that since 41aea82de2, the comment
    would include the absolute path to libxl_types.idl, therefore creating
    unintended diffs when generating code across different machines. This
    approach fixes that problem.
    
    [1] https://github.com/golang/go/issues/13560
    
    Signed-off-by: Nick Rosbrook <rosbrookn@ainfosec.com>
    Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
 tools/golang/xenlight/gengotypes.py  | 10 ++++------
 tools/golang/xenlight/helpers.gen.go |  7 ++-----
 tools/golang/xenlight/types.gen.go   |  7 ++-----
 3 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/tools/golang/xenlight/gengotypes.py b/tools/golang/xenlight/gengotypes.py
index 4ac181ae47..3e40c3d5dc 100644
--- a/tools/golang/xenlight/gengotypes.py
+++ b/tools/golang/xenlight/gengotypes.py
@@ -731,13 +731,11 @@ if __name__ == '__main__':
         name = b.typename
         builtin_type_names[name] = xenlight_golang_fmt_name(name)
 
-    header_comment="""// DO NOT EDIT.
-//
-// This file is generated by:
-// {0}
-//
+    header_comment="""// Code generated by {}. DO NOT EDIT.
+// source: {}
 
-""".format(' '.join(sys.argv))
+""".format(os.path.basename(sys.argv[0]),
+           ' '.join([os.path.basename(a) for a in sys.argv[1:]]))
 
     xenlight_golang_generate_types(types=types,
                                    comment=header_comment)
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go
index 152c7e8e6b..c8605994e7 100644
--- a/tools/golang/xenlight/helpers.gen.go
+++ b/tools/golang/xenlight/helpers.gen.go
@@ -1,8 +1,5 @@
-// DO NOT EDIT.
-//
-// This file is generated by:
-// gengotypes.py ../../libxl/libxl_types.idl
-//
+// Code generated by gengotypes.py. DO NOT EDIT.
+// source: libxl_types.idl
 
 package xenlight
 
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/types.gen.go
index 663c1e86b4..b4c5df0f2c 100644
--- a/tools/golang/xenlight/types.gen.go
+++ b/tools/golang/xenlight/types.gen.go
@@ -1,8 +1,5 @@
-// DO NOT EDIT.
-//
-// This file is generated by:
-// gengotypes.py ../../libxl/libxl_types.idl
-//
+// Code generated by gengotypes.py. DO NOT EDIT.
+// source: libxl_types.idl
 
 package xenlight
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8010.21289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0U-0003hC-1g; Fri, 16 Oct 2020 11:34:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8010.21289; Fri, 16 Oct 2020 11:34:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0T-0003h5-V8; Fri, 16 Oct 2020 11:34:45 +0000
Received: by outflank-mailman (input) for mailman id 8010;
 Fri, 16 Oct 2020 11:34:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO0S-0003go-FU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bf861ba5-30a2-46d2-9b2f-58fc42ff536c;
 Fri, 16 Oct 2020 11:34:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0R-0002iS-JH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0R-0003OR-IX
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO0S-0003go-FU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:44 +0000
X-Inumbo-ID: bf861ba5-30a2-46d2-9b2f-58fc42ff536c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bf861ba5-30a2-46d2-9b2f-58fc42ff536c;
	Fri, 16 Oct 2020 11:34:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gs8fGJs8N1+pxu8Cu+rNN7l9gXl/AzK+zqxDNmsq+6k=; b=GIak5WaO4SUO/SSzL9McJ6CWe8
	ZWW1y6ONYtrbqWTn7g6537CWJ7hmngkmmPmG1wsWa+k2YwMbd8uV7J9Ylt2DtZgzr9m/cUS/qe2XW
	krKY8MU1PWDhc6P98B+hw+LnZjfhzpEzSH8B0vQ7V+fASBvz/WxwY+E0a1ULsrX+jdMU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0R-0002iS-JH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0R-0003OR-IX
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: always use BASEDIR for xen sub-directory
Message-Id: <E1kTO0R-0003OR-IX@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:43 +0000

commit 9e5a9d0e6886f521453a63a2854ff6d06fa0d028
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 15:57:51 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Tue Oct 13 14:49:35 2020 +0000

    build: always use BASEDIR for xen sub-directory
    
    Modify Makefiles using $(XEN_ROOT)/xen to use $(BASEDIR) instead.
    
    This is removing the dependency to xen subdirectory preventing using a
    wrong configuration file when xen subdirectory is duplicated for
    compilation tests.
    
    BASEDIR is set in xen/lib/x86/Makefile as this Makefile is directly
    called from the tools build and install process and BASEDIR is not set
    there.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 xen/common/Makefile                | 6 +++---
 xen/include/xen/lib/x86/Makefile   | 6 ++++--
 xen/tools/kconfig/Makefile.kconfig | 2 +-
 xen/xsm/flask/Makefile             | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index b3b60a1ba2..083f62acb6 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -78,14 +78,14 @@ obj-$(CONFIG_UBSAN) += ubsan/
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
 
-CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(XEN_ROOT)/xen/)$(KCONFIG_CONFIG)
+CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(BASEDIR)/)$(KCONFIG_CONFIG)
 config.gz: $(CONF_FILE)
 	gzip -c $< >$@
 
 config_data.o: config.gz
 
-config_data.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile $@ config.gz xen_config_data
+config_data.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile $@ config.gz xen_config_data
 
 clean::
 	rm -f config_data.S config.gz 2>/dev/null
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
index 408d69c99e..c3b9ebe961 100644
--- a/xen/include/xen/lib/x86/Makefile
+++ b/xen/include/xen/lib/x86/Makefile
@@ -1,8 +1,10 @@
 include $(XEN_ROOT)/Config.mk
 
+BASEDIR = $(XEN_ROOT)/xen
+
 .PHONY: all
 all: cpuid-autogen.h
 
-cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-	$(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py
+	$(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig
index 065f4b8471..799321ec4d 100644
--- a/xen/tools/kconfig/Makefile.kconfig
+++ b/xen/tools/kconfig/Makefile.kconfig
@@ -9,7 +9,7 @@ Q :=
 kecho := :
 
 # eventually you'll want to do out of tree builds
-srctree := $(XEN_ROOT)/xen
+srctree := $(BASEDIR)
 objtree := $(srctree)
 src := tools/kconfig
 obj := $(src)
diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
index 50bec20a1e..637159ad82 100644
--- a/xen/xsm/flask/Makefile
+++ b/xen/xsm/flask/Makefile
@@ -35,8 +35,8 @@ $(subst include/,%/,$(AV_H_FILES)): $(AV_H_DEPEND) $(mkaccess) FORCE
 obj-bin-$(CONFIG_XSM_FLASK_POLICY) += flask-policy.o
 flask-policy.o: policy.bin
 
-flask-policy.S: $(XEN_ROOT)/xen/tools/binfile
-	$(SHELL) $(XEN_ROOT)/xen/tools/binfile -i $@ policy.bin xsm_flask_init_policy
+flask-policy.S: $(BASEDIR)/tools/binfile
+	$(SHELL) $(BASEDIR)/tools/binfile -i $@ policy.bin xsm_flask_init_policy
 
 FLASK_BUILD_DIR := $(CURDIR)
 POLICY_SRC := $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:34:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:34:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8012.21307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0e-0003m5-Ga; Fri, 16 Oct 2020 11:34:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8012.21307; Fri, 16 Oct 2020 11:34:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0e-0003lw-C0; Fri, 16 Oct 2020 11:34:56 +0000
Received: by outflank-mailman (input) for mailman id 8012;
 Fri, 16 Oct 2020 11:34:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO0c-0003lK-Ej
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 14998cfb-18ee-4389-bbe2-b07cf4c50d29;
 Fri, 16 Oct 2020 11:34:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0b-0002ia-MK
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0b-0003Po-LU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO0c-0003lK-Ej
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:54 +0000
X-Inumbo-ID: 14998cfb-18ee-4389-bbe2-b07cf4c50d29
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 14998cfb-18ee-4389-bbe2-b07cf4c50d29;
	Fri, 16 Oct 2020 11:34:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fP+aCkwKc4SwTiTxPauKasou1tzA5nIALS6CKF624qM=; b=WHGNu2uHmjtpPbCRH9QE4t+jgu
	7Y2uO6Z2yIT0aK7BVuzVH3W5h+ecesm+8l5fbmvLH8MFjOoHvOOZ379ewb3hQ/0WFftEfXgpns5kI
	OEuWPM/gO8UrB2lskNsVmRRwmzv6YgxN5rWvd4VwfW2t5M/4+tYdzOEtDg01WOEuPC7E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0b-0002ia-MK
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0b-0003Po-LU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:34:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: adjust population of acpi/
Message-Id: <E1kTO0b-0003Po-LU@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:34:53 +0000

commit 8ea798eb4b04c868e7358cd392958d6d482a4947
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:00 2020 +0200

    tools/include: adjust population of acpi/
    
    Limit what gets exposed - in particular cpufreq/ and apei.h are
    hypervisor private headers which the tool stack building shouldn't see
    or use. Also don't pass -f to ln, to allow noticing name collisions
    right away.
    
    Additionally acpi/ also has been in need of deleting at the start of
    the rule, or alternatively the respective ln would have needed to also
    be passed -n.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 3d0192fbad..35623cd70a 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -16,15 +16,16 @@ XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
 xen/.dir: $(XEN_PUBLIC_INCLUDES) $(XEN_LIB_X86_INCLUDES)
-	@rm -rf xen
-	mkdir -p xen/libelf
+	@rm -rf xen acpi
+	mkdir -p xen/libelf acpi
 	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
 	ln -sf $(XEN_PUBLIC_INCLUDES) xen
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
 	ln -sf ../xen-sys/$(XEN_OS) xen/sys
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
-	ln -sf $(XEN_ROOT)/xen/include/acpi acpi
+	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
+	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
 ifeq ($(CONFIG_X86),y)
 	ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
 	mkdir -p xen/lib/x86
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8013.21309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0n-0003ov-IG; Fri, 16 Oct 2020 11:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8013.21309; Fri, 16 Oct 2020 11:35:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0n-0003on-FE; Fri, 16 Oct 2020 11:35:05 +0000
Received: by outflank-mailman (input) for mailman id 8013;
 Fri, 16 Oct 2020 11:35:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO0m-0003od-Iv
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 83214cb8-8cc2-4c72-a101-a0e4771ed2cc;
 Fri, 16 Oct 2020 11:35:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0l-0002is-PV
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0l-0003R2-OT
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO0m-0003od-Iv
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:04 +0000
X-Inumbo-ID: 83214cb8-8cc2-4c72-a101-a0e4771ed2cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 83214cb8-8cc2-4c72-a101-a0e4771ed2cc;
	Fri, 16 Oct 2020 11:35:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s9EP3b1vQcfV+pAex+eegA38KuWkPPbLxUs6wnbxYpo=; b=4bGUKmNeHFvppdvVV2tGlgNjmP
	EIWEQ4ZRxKgN20igbNwum+FGr6P8b7sAfWyQ241hVyMMFvkcbOKkHGQGydL9AYDfJgG3o3Ml+094r
	x+y1UNGgruNM6asKGoUPVmPnbHeQ1L8bi5NMbx4UqJBQf4Anw+exF3JOvpVlA3vBo02Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0l-0002is-PV
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0l-0003R2-OT
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: fix (drop) dependencies of when to populate xen/
Message-Id: <E1kTO0l-0003R2-OT@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:03 +0000

commit 47654a0d7320cf5011db7d4d19e0463ea1b2ce32
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:25 2020 +0200

    tools/include: fix (drop) dependencies of when to populate xen/
    
    Making the population of xen/ depend on the time stamps of a subset of
    the headers put there is error prone. The creation of a few dozen
    symlinks doesn't take a meaningful amount of time (compared to the
    overall building of tools/), and hence - to be on the safe side - should
    simply be done always. Convert the goal to a phony one and drop its
    dependencies, effectively taking further what 8d8d7d6b3dc1 ("tools: fix
    linking hypervisor includes to tools include directory") had already
    attempted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 35623cd70a..ca4464bcc5 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -4,8 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
-.PHONY: all all-y build
-all build: all-y xen-foreign xen/.dir xen-xsm/.dir
+.PHONY: all all-y build xen-dir
+all build: all-y xen-foreign xen-dir xen-xsm/.dir
 all-y:
 
 .PHONY: xen-foreign
@@ -15,7 +15,7 @@ xen-foreign:
 XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
-xen/.dir: $(XEN_PUBLIC_INCLUDES) $(XEN_LIB_X86_INCLUDES)
+xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
 	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
@@ -33,9 +33,8 @@ ifeq ($(CONFIG_X86),y)
 		ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; \
 	done
 endif
-	touch $@
 
-all-$(CONFIG_X86): xen/.dir
+all-$(CONFIG_X86): xen-dir
 	$(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT) PYTHON=$(PYTHON)
 
 # Not xen/xsm as that clashes with link to
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8014.21313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0y-0003r3-Jn; Fri, 16 Oct 2020 11:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8014.21313; Fri, 16 Oct 2020 11:35:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO0y-0003qu-Gj; Fri, 16 Oct 2020 11:35:16 +0000
Received: by outflank-mailman (input) for mailman id 8014;
 Fri, 16 Oct 2020 11:35:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO0x-0003qm-R4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d7d0080f-342e-4226-8938-03cd01c09301;
 Fri, 16 Oct 2020 11:35:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0v-0002iv-SQ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO0v-0003S8-Ri
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO0x-0003qm-R4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:15 +0000
X-Inumbo-ID: d7d0080f-342e-4226-8938-03cd01c09301
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d7d0080f-342e-4226-8938-03cd01c09301;
	Fri, 16 Oct 2020 11:35:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xwhfKspbaFz9Q4TvFXwHnqrpFJPb1RzWUoh4dNziiB4=; b=FhZ5+HKRxEtQGy6EPGNW+W5x74
	QxGobZFKmzQ59wTFPBdzulehahZ40s5dThWqVvzwtib83zQalywnALP8oiAkOuDl0n9W+BtZXXAlc
	qzh2hdVSGkVo5VtLXqW5dRpq89XWxaUx56I75bKk7RQf0TCZjmIkP7Dk7y2H9NokL8KI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0v-0002iv-SQ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO0v-0003S8-Ri
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: adjust population of public headers into xen/
Message-Id: <E1kTO0v-0003S8-Ri@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:13 +0000

commit edc8d9136bf3854d6b37f782d124273216fb7ffd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:01:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:01:43 2020 +0200

    tools/include: adjust population of public headers into xen/
    
    Use a wildcard also for the subdirectories, drop XEN_PUBLIC_INCLUDES for
    having a single use only, and don't pass -f to ln to allow noticing name
    collisions right away, and add trailing slashes to ln's destination.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index ca4464bcc5..ebd5317169 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -12,15 +12,14 @@ all-y:
 xen-foreign:
 	$(MAKE) -C xen-foreign
 
-XEN_PUBLIC_INCLUDES = $(wildcard $(XEN_ROOT)/xen/include/public/*.h)
 XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
 
 xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
-	ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
-	ln -sf $(XEN_PUBLIC_INCLUDES) xen
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
+	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
+	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
+	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
 	ln -sf ../xen-sys/$(XEN_OS) xen/sys
 	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8015.21317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO18-0003si-Ld; Fri, 16 Oct 2020 11:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8015.21317; Fri, 16 Oct 2020 11:35:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO18-0003sa-IR; Fri, 16 Oct 2020 11:35:26 +0000
Received: by outflank-mailman (input) for mailman id 8015;
 Fri, 16 Oct 2020 11:35:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO17-0003sO-JH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1f2a5e1f-5faf-492b-baf3-c3d84e3d5411;
 Fri, 16 Oct 2020 11:35:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO15-0002j4-VU
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO15-0003TD-Uj
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO17-0003sO-JH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:25 +0000
X-Inumbo-ID: 1f2a5e1f-5faf-492b-baf3-c3d84e3d5411
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1f2a5e1f-5faf-492b-baf3-c3d84e3d5411;
	Fri, 16 Oct 2020 11:35:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IfhqHa2ysIs6v8R+Iw4yJY8qsGxEe7jB51esuePUJl0=; b=MaAs6Pws0u6cSHTMGqZLUyc1Oq
	JDy5j3uE9waCu5EwUZ1J4I1rXoP+VuyquP96yjJ5aKdL/MiuDPwPHLVXZ9gxfe610B7jQVMcBhAn8
	tFbWCYnz6EnSeTdPlpEWqQdinzd9VfPVE1DhquTyn1uoW7Kq1eidX7L6ilgDGeM5nOZA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO15-0002j4-VU
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO15-0003TD-Uj
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: properly install Arm public headers
Message-Id: <E1kTO15-0003TD-Uj@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:23 +0000

commit 3d77849197c3b51d51067c2fbb4b34435e271a0a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:03 2020 +0200

    tools/include: properly install Arm public headers
    
    When smccc.h was added, adjustment of the install rule was missed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index ebd5317169..e7b4efcbfd 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -60,10 +60,7 @@ install: all
 	$(INSTALL_DATA) xen/*.h $(DESTDIR)$(includedir)/xen
 	$(INSTALL_DATA) xen/arch-x86/*.h $(DESTDIR)$(includedir)/xen/arch-x86
 	$(INSTALL_DATA) xen/arch-x86/hvm/*.h $(DESTDIR)$(includedir)/xen/arch-x86/hvm
-
-# 	xen/arch-arm doesn't contains headers for now. Uncommented the line
-# 	as soon as a new header is added
-#	$(INSTALL_DATA) xen/arch-arm/*.h $(DESTDIR)$(includedir)/xen/arch-arm
+	$(INSTALL_DATA) xen/arch-arm/*.h $(DESTDIR)$(includedir)/xen/arch-arm
 	$(INSTALL_DATA) xen/arch-arm/hvm/*.h $(DESTDIR)$(includedir)/xen/arch-arm/hvm
 	$(INSTALL_DATA) xen/foreign/*.h $(DESTDIR)$(includedir)/xen/foreign
 	$(INSTALL_DATA) xen/hvm/*.h $(DESTDIR)$(includedir)/xen/hvm
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8016.21321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1H-0003uD-Mn; Fri, 16 Oct 2020 11:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8016.21321; Fri, 16 Oct 2020 11:35:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1H-0003u5-Jv; Fri, 16 Oct 2020 11:35:35 +0000
Received: by outflank-mailman (input) for mailman id 8016;
 Fri, 16 Oct 2020 11:35:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO1G-0003tu-U9
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8d8cf634-e445-470e-9a2b-c06111085140;
 Fri, 16 Oct 2020 11:35:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1G-0002jb-2D
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1G-0003U7-1T
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO1G-0003tu-U9
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
X-Inumbo-ID: 8d8cf634-e445-470e-9a2b-c06111085140
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8d8cf634-e445-470e-9a2b-c06111085140;
	Fri, 16 Oct 2020 11:35:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8PLt0aQzET7DaHnQq/FxEBrwq18nrZ+hnXtgoaqWtbk=; b=WiQf92gGMcnze7TI3JKJjAP4js
	8lPL6PDZH+SOp/rnYH3hWrhBynUr0RHk9afF8zDhzUZXgiJH88YjAJzK0lJ21/UisOcZaLVrzvYJw
	RZozzxPiVRAQjpGqLfKLVbzacSAou/dZ+6DEPbv68yrnfmAqN/yZEA6lIUGF7caL85tg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1G-0002jb-2D
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1G-0003U7-1T
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: adjust x86-specific population of xen/
Message-Id: <E1kTO1G-0003U7-1T@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:34 +0000

commit c02fd5b1a4011c87bc7580fa338ffe9ce84cdc5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:20 2020 +0200

    tools/include: adjust x86-specific population of xen/
    
    There's no need to use a shell loop construct here - ln's destination
    can be specified as just the intended directory, as we don't mean to
    change the names of any of the files. Also drop XEN_LIB_X86_INCLUDES for
    having a single use only, and don't pass -f to ln, to allow noticing
    name collisions right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index e7b4efcbfd..4db2d93887 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -12,8 +12,6 @@ all-y:
 xen-foreign:
 	$(MAKE) -C xen-foreign
 
-XEN_LIB_X86_INCLUDES = $(filter-out %autogen.h, $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))
-
 xen-dir:
 	@rm -rf xen acpi
 	mkdir -p xen/libelf acpi
@@ -26,11 +24,10 @@ xen-dir:
 	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
 	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
 ifeq ($(CONFIG_X86),y)
-	ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
+	ln -s $(XEN_ROOT)/xen/include/asm-x86 xen/asm
 	mkdir -p xen/lib/x86
-	for f in $(patsubst $(XEN_ROOT)/xen/include/xen/lib/x86/%,%,$(XEN_LIB_X86_INCLUDES)); do \
-		ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; \
-	done
+	ln -s $(filter-out %autogen.h,$(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h)) xen/lib/x86/
+	ln -s $(XEN_ROOT)/xen/include/xen/lib/x86/Makefile xen/lib/x86/
 endif
 
 all-$(CONFIG_X86): xen-dir
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8018.21325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1R-0003wH-Om; Fri, 16 Oct 2020 11:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8018.21325; Fri, 16 Oct 2020 11:35:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1R-0003w9-LW; Fri, 16 Oct 2020 11:35:45 +0000
Received: by outflank-mailman (input) for mailman id 8018;
 Fri, 16 Oct 2020 11:35:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO1R-0003w1-3n
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6fa68fbd-61bb-4ebe-a5c3-1abeaa2f21e2;
 Fri, 16 Oct 2020 11:35:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1Q-0002je-7R
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1Q-0003VY-4M
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO1R-0003w1-3n
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:45 +0000
X-Inumbo-ID: 6fa68fbd-61bb-4ebe-a5c3-1abeaa2f21e2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6fa68fbd-61bb-4ebe-a5c3-1abeaa2f21e2;
	Fri, 16 Oct 2020 11:35:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ePGmyYxYICLEfojEG3/nk2Ex9LPbQPMEhXmF5Is+huE=; b=jzbJBu6gxrIIeu1sUybpsdFzwH
	7ALR8LGhZnvZa3wGsc6hVdCEOrGvYR1EbjuDk42SBA4rp3DRDRABq+car/p1P0jBVTvN1rMPt4dfb
	vhPdFk2LgU59DBo3usGZzRvZet+Yg4V2K9djsczCedkbfdY1xe+Y6DjtvrNYhb69OUO4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1Q-0002je-7R
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1Q-0003VY-4M
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/include: drop remaining -f from ln invocations
Message-Id: <E1kTO1Q-0003VY-4M@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:44 +0000

commit 01d687c9cd70443617a885ba715d501455964567
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:02:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:02:40 2020 +0200

    tools/include: drop remaining -f from ln invocations
    
    This is once again to allow noticing name collisions right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/include/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4db2d93887..4d4313b60d 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -18,8 +18,8 @@ xen-dir:
 	ln -s $(XEN_ROOT)/xen/include/public/COPYING xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*.h xen/
 	ln -s $(XEN_ROOT)/xen/include/public/*/ xen/
-	ln -sf ../xen-sys/$(XEN_OS) xen/sys
-	ln -sf $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
+	ln -s ../xen-sys/$(XEN_OS) xen/sys
+	ln -s $(addprefix $(XEN_ROOT)/xen/include/xen/,libelf.h elfstructs.h) xen/libelf/
 	ln -s ../xen-foreign xen/foreign
 	ln -s $(XEN_ROOT)/xen/include/acpi/platform acpi/
 	ln -s $(XEN_ROOT)/xen/include/acpi/ac*.h acpi/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:35:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:35:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8019.21329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1b-0003xh-QO; Fri, 16 Oct 2020 11:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8019.21329; Fri, 16 Oct 2020 11:35:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1b-0003xY-N8; Fri, 16 Oct 2020 11:35:55 +0000
Received: by outflank-mailman (input) for mailman id 8019;
 Fri, 16 Oct 2020 11:35:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO1b-0003xP-7t
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9e0223cf-a7cd-4e68-a1b4-c547bf88d548;
 Fri, 16 Oct 2020 11:35:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1a-0002jm-Ad
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1a-0003WZ-9p
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO1b-0003xP-7t
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:55 +0000
X-Inumbo-ID: 9e0223cf-a7cd-4e68-a1b4-c547bf88d548
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9e0223cf-a7cd-4e68-a1b4-c547bf88d548;
	Fri, 16 Oct 2020 11:35:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hj0VskfXhpx/rYwqgreTPPVExdTjxUbaLDH5vgQ3o6E=; b=TtTYW2VAx/deYADaHPH2mzLh2Z
	9Ek9Q68OStKRXJAvyjGHbIrCauxag05DYpvOigXCAAIoSeS+FA3qMuUM0y9nAvTTZ01p9JTBdakcC
	5ofNQMg9BjNf0bOrn8V8VXaFCNVJWUPBmkGziIiThoPr3uOHpY6WFk8kFDLnbzaTVDEY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1a-0002jm-Ad
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1a-0003WZ-9p
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:35:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kTO1a-0003WZ-9p@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:35:54 +0000

commit 6a34e67c118408ebdd62bfa7be76598ca040f170
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:03:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:03:38 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 5454f94d18..1b894d0124 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -569,6 +569,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -594,9 +597,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8020.21333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1l-0003yr-Rm; Fri, 16 Oct 2020 11:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8020.21333; Fri, 16 Oct 2020 11:36:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1l-0003yj-Ob; Fri, 16 Oct 2020 11:36:05 +0000
Received: by outflank-mailman (input) for mailman id 8020;
 Fri, 16 Oct 2020 11:36:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO1l-0003yb-9g
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a329915f-0eb4-4ca6-a09d-aad47e920370;
 Fri, 16 Oct 2020 11:36:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1k-0002kB-F4
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1k-0003Xl-Cx
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO1l-0003yb-9g
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:05 +0000
X-Inumbo-ID: a329915f-0eb4-4ca6-a09d-aad47e920370
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a329915f-0eb4-4ca6-a09d-aad47e920370;
	Fri, 16 Oct 2020 11:36:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DcOZfQQvCcnmcDOA6AC4q3URcK/kh30jbD/n9LbnSa8=; b=AOioKLpNcqQtAzh8HVQ4zSEXr6
	2k3wZlW5+oiNJHjuPi5YvCg3KymebuaI0JE+pZtksLQVPRKMJe5u2G0RT1FpHVF8WIczSbuaSk1LU
	2//XzI3oYoeNp47BHWlYBbeFLCPPUbiYaGzqMiAryKNM7EFANMu2UFpTYb0vXrxKdDgg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1k-0002kB-F4
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1k-0003Xl-Cx
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/vLAPIC: vlapic_init() runs only once for a vCPU
Message-Id: <E1kTO1k-0003Xl-Cx@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:04 +0000

commit 875248527906e6e98812d3ff844bcccbdd594768
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:05:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:05:10 2020 +0200

    x86/vLAPIC: vlapic_init() runs only once for a vCPU
    
    Hence there's no need to guard allocation / mapping by checks whether
    the same action has been done before. I assume this was a transient
    change which should have been undone before 509529e99148 ("x86 hvm: Xen
    interface and implementation for virtual S3") got committed.
    
    While touching this code, drop the pretty useless dprintk()-s.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/vlapic.c | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 59660a8af4..5e21fb4937 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1610,27 +1610,17 @@ int vlapic_init(struct vcpu *v)
 
     vlapic->pt.source = PTSRC_lapic;
 
-    if (vlapic->regs_page == NULL)
-    {
-        vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
-        if ( vlapic->regs_page == NULL )
-        {
-            dprintk(XENLOG_ERR, "alloc vlapic regs error: %d/%d\n",
-                    v->domain->domain_id, v->vcpu_id);
-            return -ENOMEM;
-        }
-    }
-    if (vlapic->regs == NULL) 
+    vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
+    if ( !vlapic->regs_page )
+        return -ENOMEM;
+
+    vlapic->regs = __map_domain_page_global(vlapic->regs_page);
+    if ( vlapic->regs == NULL )
     {
-        vlapic->regs = __map_domain_page_global(vlapic->regs_page);
-        if ( vlapic->regs == NULL )
-        {
-            free_domheap_page(vlapic->regs_page);
-            dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
-                    v->domain->domain_id, v->vcpu_id);
-            return -ENOMEM;
-        }
+        free_domheap_page(vlapic->regs_page);
+        return -ENOMEM;
     }
+
     clear_page(vlapic->regs);
 
     vlapic_reset(vlapic);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8021.21337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1w-00040L-Sv; Fri, 16 Oct 2020 11:36:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8021.21337; Fri, 16 Oct 2020 11:36:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO1w-00040E-Q6; Fri, 16 Oct 2020 11:36:16 +0000
Received: by outflank-mailman (input) for mailman id 8021;
 Fri, 16 Oct 2020 11:36:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO1v-000403-Jm
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ade175c3-116b-45a1-9f25-65519f5009c0;
 Fri, 16 Oct 2020 11:36:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1u-0002kJ-IH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO1u-0003Yh-HH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO1v-000403-Jm
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:15 +0000
X-Inumbo-ID: ade175c3-116b-45a1-9f25-65519f5009c0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ade175c3-116b-45a1-9f25-65519f5009c0;
	Fri, 16 Oct 2020 11:36:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zrIJHMtUXL82XKACGMe8gAynO31/CvXlIb41oFGo7zk=; b=5zsEsPxSVD+r5vKDMexkBKtdT6
	HDOwHjSSgfMbjfQvBteev4bxZIsCXRH4DI8+W1oExrYu7onxUXxRKa49acqK3wXZHC4Yf3zUKKs4c
	7FFp8zrQVdJNKYlNb1x2w9W+IpINMIj9PkUsQgbBKGvp2b5/PeUBsTXd33fDQd5JWdOw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1u-0002kJ-IH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO1u-0003Yh-HH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/msr: handle IA32_THERM_STATUS
Message-Id: <E1kTO1u-0003Yh-HH@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:14 +0000

commit 628055822452f8678c18193835fdc1e2c20d4d14
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Oct 14 14:10:08 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:10:08 2020 +0200

    x86/msr: handle IA32_THERM_STATUS
    
    Windows 8 will attempt to read MSR_IA32_THERM_STATUS and panic if a
    #GP fault is injected as a result:
    
    vmx.c:3035:d8v0 RDMSR 0x0000019c unimplemented
    d8v0 VIRIDIAN CRASH: 3b c0000096 fffff8061de31651 fffff4088a613720 0
    
    So handle the MSR and return 0 instead.
    
    Note that this is done on the generic MSR handler, and PV guest will
    also get 0 back when trying to read the MSR. There doesn't seem to be
    much value in handling the MSR for HVM guests only.
    
    Fixes: 84e848fd7a1 ('x86/hvm: disallow access to unknown MSRs')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 81b34fb212..9c69ef8792 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -242,6 +242,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             goto gp_fault;
         break;
 
+    case MSR_IA32_THERM_STATUS:
+        if ( cp->x86_vendor != X86_VENDOR_INTEL )
+            goto gp_fault;
+        *val = 0;
+        break;
+
     case MSR_X2APIC_FIRST ... MSR_X2APIC_LAST:
         if ( !is_hvm_domain(d) || v != curr )
             goto gp_fault;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8022.21341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO26-00041j-Vs; Fri, 16 Oct 2020 11:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8022.21341; Fri, 16 Oct 2020 11:36:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO26-00041c-Sv; Fri, 16 Oct 2020 11:36:26 +0000
Received: by outflank-mailman (input) for mailman id 8022;
 Fri, 16 Oct 2020 11:36:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO26-00041T-2b
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 05ef0ffb-d3fc-4514-ae84-67732d097f8a;
 Fri, 16 Oct 2020 11:36:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO24-0002kW-M2
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO24-0003Zj-KO
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO26-00041T-2b
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:26 +0000
X-Inumbo-ID: 05ef0ffb-d3fc-4514-ae84-67732d097f8a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 05ef0ffb-d3fc-4514-ae84-67732d097f8a;
	Fri, 16 Oct 2020 11:36:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X1cp5IbmxteR8H8ZlboBixu8vOLKc2z8CVD60WoX6Ko=; b=ZRxeW7obXs67B6EhBUxJ8JB3Fv
	N0wZBiGrRxy8hAnXngwCkppmzfyLSks5yu147H8yXLJy0j+xFQFDuIQkB+NqHFcxpUGIfBklWzd4I
	/hbV9elKVmYeJnN7xu8lUzhsos4k8NPpx847+YETIBkwbw4d8NcHqEHzL7x9TdaSPul0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO24-0002kW-M2
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO24-0003Zj-KO
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] drop xen/hash.h
Message-Id: <E1kTO24-0003Zj-KO@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:24 +0000

commit f14a4226bf07d008934fca84f78e86eab95c3adb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:10:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:10:49 2020 +0200

    drop xen/hash.h
    
    It has no users and hasn't been touched in 10 years.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/xen/hash.h | 58 --------------------------------------------------
 1 file changed, 58 deletions(-)

diff --git a/xen/include/xen/hash.h b/xen/include/xen/hash.h
deleted file mode 100644
index 0658c8b619..0000000000
--- a/xen/include/xen/hash.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _XEN_HASH_H
-#define _XEN_HASH_H
-/* Fast hashing routine for a long.
-   (C) 2002 William Lee Irwin III, IBM */
-
-/*
- * Knuth recommends primes in approximately golden ratio to the maximum
- * integer representable by a machine word for multiplicative hashing.
- * Chuck Lever verified the effectiveness of this technique:
- * http://www.citi.umich.edu/techreports/reports/citi-tr-00-1.pdf
- *
- * These primes are chosen to be bit-sparse, that is operations on
- * them can use shifts and additions instead of multiplications for
- * machines where multiplications are slow.
- */
-#if BITS_PER_LONG == 32
-/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e370001UL
-#elif BITS_PER_LONG == 64
-/*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL
-#else
-#error Define GOLDEN_RATIO_PRIME for your wordsize.
-#endif
-
-static inline unsigned long hash_long(unsigned long val, unsigned int bits)
-{
-    unsigned long hash = val;
-
-#if BITS_PER_LONG == 64
-    /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
-    unsigned long n = hash;
-    n <<= 18;
-    hash -= n;
-    n <<= 33;
-    hash -= n;
-    n <<= 3;
-    hash += n;
-    n <<= 3;
-    hash -= n;
-    n <<= 4;
-    hash += n;
-    n <<= 2;
-    hash += n;
-#else
-    /* On some cpus multiply is faster, on others gcc will do shifts */
-    hash *= GOLDEN_RATIO_PRIME;
-#endif
-
-    /* High bits are more random, so use them. */
-    return hash >> (BITS_PER_LONG - bits);
-}
- 
-static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
-{
-    return hash_long((unsigned long)ptr, bits);
-}
-#endif /* _XEN_HASH_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8023.21345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2H-00043J-1V; Fri, 16 Oct 2020 11:36:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8023.21345; Fri, 16 Oct 2020 11:36:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2G-00043B-Us; Fri, 16 Oct 2020 11:36:36 +0000
Received: by outflank-mailman (input) for mailman id 8023;
 Fri, 16 Oct 2020 11:36:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO2F-00042u-LE
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bae9aba2-7bad-4384-9bf2-3c9945070f58;
 Fri, 16 Oct 2020 11:36:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2E-0002lI-PB
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2E-0003aT-OO
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO2F-00042u-LE
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:35 +0000
X-Inumbo-ID: bae9aba2-7bad-4384-9bf2-3c9945070f58
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bae9aba2-7bad-4384-9bf2-3c9945070f58;
	Fri, 16 Oct 2020 11:36:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Sdd/VS/XM0JgibRyRH+e+15SZ+JuJKWi8IAz/tZPyuw=; b=gB0BRx4/IvJ0Y+659hN5BQtb/U
	HYJPgcn91RPyPpbI7cvzFRI3jGJtN5W8Pf3MA/9acK3zB9xS6J5HLdl9UjA0GMo+Sdxv7IPvF4VG5
	vaDVCUI4MAn0CEsayYuvE+0q/80TuNmfKepGamTe/8E2Uz797b7tyJdmzne3acL1l7Kc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2E-0002lI-PB
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2E-0003aT-OO
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] kexec: some #include adjustments
Message-Id: <E1kTO2E-0003aT-OO@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:34 +0000

commit e3daad6283659794f4d70508fee23a340e42a93e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:11:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:11:49 2020 +0200

    kexec: some #include adjustments
    
    In the context of working on x86's elf_core_save_regs() I noticed there
    were far more source files getting rebuilt than I would have expected.
    While the main offender looks to have been fixmap.h including kexec.h,
    also drop use of elfcore.h from kexec.h.
    
    While adjusting machine_kexec.c also replace use of guest_access.h by
    domain_page.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/machine_kexec.c | 3 ++-
 xen/common/kexec.c           | 1 +
 xen/include/asm-x86/fixmap.h | 1 -
 xen/include/xen/elfcore.h    | 2 +-
 xen/include/xen/kexec.h      | 3 +--
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c
index b70d5a6a86..08ec9fd43b 100644
--- a/xen/arch/x86/machine_kexec.c
+++ b/xen/arch/x86/machine_kexec.c
@@ -16,8 +16,9 @@
  */
 
 #include <xen/types.h>
+#include <xen/domain_page.h>
+#include <xen/elfstructs.h>
 #include <xen/kexec.h>
-#include <xen/guest_access.h>
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
 #include <asm/page.h>
diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 9af7de4df3..52cdc4ebc3 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -10,6 +10,7 @@
 #include <xen/lib.h>
 #include <xen/acpi.h>
 #include <xen/ctype.h>
+#include <xen/elfcore.h>
 #include <xen/errno.h>
 #include <xen/guest_access.h>
 #include <xen/param.h>
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 8330097a74..83b2b7634d 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -21,7 +21,6 @@
 
 #include <xen/acpi.h>
 #include <xen/pfn.h>
-#include <xen/kexec.h>
 #include <asm/apicdef.h>
 #include <asm/msi.h>
 #include <acpi/apei.h>
diff --git a/xen/include/xen/elfcore.h b/xen/include/xen/elfcore.h
index 4ad477d5b8..0d78033424 100644
--- a/xen/include/xen/elfcore.h
+++ b/xen/include/xen/elfcore.h
@@ -56,7 +56,7 @@ typedef struct
     int pr_fpvalid;              /* True if math co-processor being used.  */
 } ELF_Prstatus;
 
-typedef struct {
+typedef struct crash_xen_info {
     unsigned long xen_major_version;
     unsigned long xen_minor_version;
     unsigned long xen_extra_version;
diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h
index e235339c85..e85ba16405 100644
--- a/xen/include/xen/kexec.h
+++ b/xen/include/xen/kexec.h
@@ -5,7 +5,6 @@
 
 #include <public/kexec.h>
 
-#include <xen/elfcore.h>
 #include <xen/kimage.h>
 
 typedef struct xen_kexec_reserve {
@@ -51,7 +50,7 @@ void machine_reboot_kexec(struct kexec_image *image);
 void machine_kexec(struct kexec_image *image);
 void kexec_crash(void);
 void kexec_crash_save_cpu(void);
-crash_xen_info_t *kexec_crash_save_info(void);
+struct crash_xen_info *kexec_crash_save_info(void);
 void machine_crash_shutdown(void);
 int machine_kexec_get(xen_kexec_range_t *range);
 int machine_kexec_get_xen(xen_kexec_range_t *range);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8024.21349 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2R-00045x-34; Fri, 16 Oct 2020 11:36:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8024.21349; Fri, 16 Oct 2020 11:36:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2R-00045p-09; Fri, 16 Oct 2020 11:36:47 +0000
Received: by outflank-mailman (input) for mailman id 8024;
 Fri, 16 Oct 2020 11:36:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO2P-00045c-LK
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7b76ee65-a21e-49bd-afb2-66f9cf54c0ed;
 Fri, 16 Oct 2020 11:36:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2O-0002lT-Sb
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2O-0003bu-RR
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO2P-00045c-LK
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:45 +0000
X-Inumbo-ID: 7b76ee65-a21e-49bd-afb2-66f9cf54c0ed
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7b76ee65-a21e-49bd-afb2-66f9cf54c0ed;
	Fri, 16 Oct 2020 11:36:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dfp1KUQzj8ut1Yr7VQzfF5eo3oMSgWv8IwBndmNrtcs=; b=Oy51xAf1efAO/BkI9A13X/0XqC
	JX4aix3hEjn6g3OuuAJs0liQGDI4iU4WoX0RmyZi3JsvCDUukPDMMUa0oNZQ5QKSalhzRSv16wQXc
	XElhW3B8aolt0fUf1J5XqrmIs8RO5VjgPPUNA0P7D2dxDdoH9J5nXDmeAsVmLDZsl/6o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2O-0002lT-Sb
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2O-0003bu-RR
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI/Arm64: don't clobber DTB pointer
Message-Id: <E1kTO2O-0003bu-RR@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:44 +0000

commit 884ef07f4f66b9d12fc4811047db95ba649db85c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Oct 14 14:13:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Oct 14 14:13:16 2020 +0200

    EFI/Arm64: don't clobber DTB pointer
    
    read_section() needs to be more careful: efi_arch_use_config_file()
    may have found a DTB file (but without modules), and there may be no DTB
    specified in the EFI config file. In this case the pointer to the blob
    must not be overwritten with NULL when no ".dtb" section is present
    either.
    
    Fixes: 8a71d50ed40b ("efi: Enable booting unified hypervisor/kernel/initrd images")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/efi/boot.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index bacd551bb5..eb1ef91ba4 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -637,11 +637,14 @@ static bool __init read_section(const EFI_LOADED_IMAGE *image,
                                 const CHAR16 *name, struct file *file,
                                 const char *options)
 {
-    file->ptr = pe_find_section(image->ImageBase, image->ImageSize,
-                                name, &file->size);
-    if ( !file->ptr )
+    const void *ptr = pe_find_section(image->ImageBase, image->ImageSize,
+                                      name, &file->size);
+
+    if ( !ptr )
         return false;
 
+    file->ptr = ptr;
+
     handle_file_info(name, file, options);
 
     return true;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:36:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:36:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8025.21354 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2b-00047e-5J; Fri, 16 Oct 2020 11:36:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8025.21354; Fri, 16 Oct 2020 11:36:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2b-00047T-1f; Fri, 16 Oct 2020 11:36:57 +0000
Received: by outflank-mailman (input) for mailman id 8025;
 Fri, 16 Oct 2020 11:36:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO2Z-00047D-Ry
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 69b2e5f7-3f74-42c3-808c-a8b3aebbea0c;
 Fri, 16 Oct 2020 11:36:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2Y-0002lb-Vf
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2Y-0003d7-Ux
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO2Z-00047D-Ry
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:55 +0000
X-Inumbo-ID: 69b2e5f7-3f74-42c3-808c-a8b3aebbea0c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 69b2e5f7-3f74-42c3-808c-a8b3aebbea0c;
	Fri, 16 Oct 2020 11:36:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZtLEPwt/zWQ/r4/Hep5eC+7y9t/DksxlTc6AtBMqMGo=; b=ptkE54D6ekBEllcysqzguu/Rkw
	3fhrBiNH09sHbq7EM3nNQsLozs2sAdSYX5d9aowtUSSmSJZUNsUsqZ6wORU/WuOysQfpV/hXKA1og
	gLFx6XUOGFmoWU+iQBwxhFnt3BHaEirxohqJOP5w81whPYLmTvl8CIj10Q+Sc/6qd7MM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2Y-0002lb-Vf
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2Y-0003d7-Ux
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:36:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Document the erratum #853709 related to Cortex A72
Message-Id: <E1kTO2Y-0003d7-Ux@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:36:54 +0000

commit f776e5fb3ee699745f6442ec8c47d0fa647e0575
Author:     Michal Orzel <michal.orzel@arm.com>
AuthorDate: Wed Oct 14 12:05:41 2020 +0200
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Wed Oct 14 18:02:50 2020 +0100

    xen/arm: Document the erratum #853709 related to Cortex A72
    
    The Cortex-A72 erratum #853709 is the same as the Cortex-A57
    erratum #852523. As the latter is already workaround, we only
    need to update the documentation.
    
    Signed-off-by: Michal Orzel <michal.orzel@arm.com>
    [julieng: Reworded the commit message]
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 docs/misc/arm/silicon-errata.txt | 1 +
 xen/arch/arm/domain.c            | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/silicon-errata.txt b/docs/misc/arm/silicon-errata.txt
index e15d0923e9..1f18a9df58 100644
--- a/docs/misc/arm/silicon-errata.txt
+++ b/docs/misc/arm/silicon-errata.txt
@@ -50,6 +50,7 @@ stable hypervisors.
 | ARM            | Cortex-A57      | #834220         | ARM64_ERRATUM_834220    |
 | ARM            | Cortex-A57      | #1319537        | N/A                     |
 | ARM            | Cortex-A72      | #1319367        | N/A                     |
+| ARM            | Cortex-A72      | #853709         | N/A                     |
 | ARM            | Cortex-A76      | #1165522        | N/A                     |
 | ARM            | Neoverse-N1     | #1165522        | N/A
 | ARM            | MMU-500         | #842869         | N/A                     |
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 3b37f899b9..18cafcdda7 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -216,7 +216,8 @@ static void ctxt_switch_to(struct vcpu *n)
     WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
 
     /*
-     * Erratum #852523: DACR32_EL2 must be restored before one of the
+     * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
+     * DACR32_EL2 must be restored before one of the
      * following sysregs: SCTLR_EL1, TCR_EL1, TTBR0_EL1, TTBR1_EL1 or
      * CONTEXTIDR_EL1.
      */
@@ -245,7 +246,8 @@ static void ctxt_switch_to(struct vcpu *n)
 
     /*
      * This write to sysreg CONTEXTIDR_EL1 ensures we don't hit erratum
-     * #852523. I.e DACR32_EL2 is not correctly synchronized.
+     * #852523 (Cortex-A57) or #853709 (Cortex-A72).
+     * I.e DACR32_EL2 is not correctly synchronized.
      */
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
     WRITE_SYSREG(n->arch.tpidr_el0, TPIDR_EL0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:37:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8026.21357 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2l-00048o-6d; Fri, 16 Oct 2020 11:37:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8026.21357; Fri, 16 Oct 2020 11:37:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2l-00048f-3W; Fri, 16 Oct 2020 11:37:07 +0000
Received: by outflank-mailman (input) for mailman id 8026;
 Fri, 16 Oct 2020 11:37:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO2k-00048Z-8T
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c0c36c6e-b6d6-4f63-a36a-fe4ce87c560c;
 Fri, 16 Oct 2020 11:37:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2j-0002lw-2F
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2j-0003e9-1c
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO2k-00048Z-8T
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:06 +0000
X-Inumbo-ID: c0c36c6e-b6d6-4f63-a36a-fe4ce87c560c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c0c36c6e-b6d6-4f63-a36a-fe4ce87c560c;
	Fri, 16 Oct 2020 11:37:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vunQ3Uj+vub0qt8sC05dToqlclKsEL8N12fGd3uO0pE=; b=LhOpBvV8Z1oMLMiqb7o9bV5Dah
	QN98ereZLK+UFUtywpovtjzrQdiuGrpcAu6shDCURUzI3AL/gZA4ARpI8vl5l3ioQFsvYmKcG/2WU
	wo5Fnh+/H+R6redNec+7CwtdMxrab+aprc4afFaryTatSev7ibOgVPsvJJ+UnAKLV5mo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2j-0002lw-2F
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2j-0003e9-1c
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kTO2j-0003e9-1c@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:05 +0000

commit 44ac57af81ff8097e228895738b911ca819bda19
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Thu Oct 15 12:29:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 12:29:11 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8add13d698..f0c6ff9d52 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -554,6 +554,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -904,6 +926,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -958,6 +985,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:37:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:37:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8027.21361 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2v-0004AE-8A; Fri, 16 Oct 2020 11:37:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8027.21361; Fri, 16 Oct 2020 11:37:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO2v-0004A6-53; Fri, 16 Oct 2020 11:37:17 +0000
Received: by outflank-mailman (input) for mailman id 8027;
 Fri, 16 Oct 2020 11:37:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO2u-00049v-2s
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d50af71c-ba51-4bcd-80f4-549b2d99d53f;
 Fri, 16 Oct 2020 11:37:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2t-0002mA-5T
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO2t-0003fk-4j
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO2u-00049v-2s
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:16 +0000
X-Inumbo-ID: d50af71c-ba51-4bcd-80f4-549b2d99d53f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d50af71c-ba51-4bcd-80f4-549b2d99d53f;
	Fri, 16 Oct 2020 11:37:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=geBVyHW+M66A23Pw7SpKhXfl6z3SULqTEHMq4na9w7I=; b=SbvGX/M2soJZM49oZLSd2b1nvY
	jdGiWtII5mf3ulXun+3hFw9KfQh85ZXjYN7cOgCQ4u5TD3DlpupKSz/S0rLt2oXV1qLGZGgFeoIcD
	U9twF5S9AStvBhAwen5Dl6FX1hVcQJtrb0ictp1MMTrix1Cw74pkYOf0RdiCO+3HY3NE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2t-0002mA-5T
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO2t-0003fk-4j
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: further "need_to_free" adjustments
Message-Id: <E1kTO2t-0003fk-4j@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:15 +0000

commit a8a85f03c826bea045e345fa405f187049d63584
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 15 12:30:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 12:30:01 2020 +0200

    EFI: further "need_to_free" adjustments
    
    When processing "chain" directives, the previously loaded config file
    gets freed. This needs to be recorded accordingly such that no error
    path would try to free the same block of memory a 2nd time.
    
    Furthermore, neither .addr nor .size being zero has any meaning towards
    the need to free an allocated chunk anymore. Drop (from read_file()) and
    replace (in Arm's efi_arch_use_config_file(), to sensibly retain the
    comment) respective assignments.
    
    Fixes: 04be2c3a0678 ("efi/boot.c: add file.need_to_free")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/efi/efi-boot.h |  2 +-
 xen/common/efi/boot.c       | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index f64a6604af..cf9c37153f 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -591,7 +591,7 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
 
     fdt = lookup_fdt_config_table(SystemTable);
     dtbfile.ptr = fdt;
-    dtbfile.size = 0;  /* Config table memory can't be freed, so set size to 0 */
+    dtbfile.need_to_free = false; /* Config table memory can't be freed. */
     if ( !fdt || fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") < 0 )
     {
         /*
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index eb1ef91ba4..63e289ab85 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -601,10 +601,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
                                     PFN_UP(size), &file->addr);
     }
     if ( EFI_ERROR(ret) )
-    {
-        file->addr = 0;
         what = what ?: L"Allocation";
-    }
     else
     {
         file->need_to_free = true;
@@ -1271,8 +1268,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.addr = 0;
+            if ( cfg.need_to_free )
+            {
+                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+                cfg.need_to_free = false;
+            }
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:37:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:37:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8030.21377 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3A-0004DY-IO; Fri, 16 Oct 2020 11:37:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8030.21377; Fri, 16 Oct 2020 11:37:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3A-0004DQ-Ea; Fri, 16 Oct 2020 11:37:32 +0000
Received: by outflank-mailman (input) for mailman id 8030;
 Fri, 16 Oct 2020 11:37:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO38-0004BB-OL
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 97b7e4fc-6a32-4a6b-b88c-732b8b7a52d6;
 Fri, 16 Oct 2020 11:37:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO33-0002mL-8M
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO33-0003gk-7d
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO38-0004BB-OL
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:30 +0000
X-Inumbo-ID: 97b7e4fc-6a32-4a6b-b88c-732b8b7a52d6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 97b7e4fc-6a32-4a6b-b88c-732b8b7a52d6;
	Fri, 16 Oct 2020 11:37:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fAbXcLMc/o3WcmTW/GsEkhdKsIcrDb4PXN75eHKjMY8=; b=M+7Or/h30gAf51mHCpaE75SmlF
	iUONEFzK4hK+gUPb4IhvFXcB4kevv/yBcouYUnv2wUJi+FhYG4eK/OzOIrjro6hH/Ql8lzPuGP+bN
	WTnjnzPzCk2KsF/+vi3GXsUkiBTFIZm+BX7jqEvNg518ER/DM8onNlDe71PAtjqPsTwE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO33-0002mL-8M
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO33-0003gk-7d
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: print update firmware only once
Message-Id: <E1kTO33-0003gk-7d@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:25 +0000

commit 27addcca155744a18e908f2d6306f107b0a133de
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 12:05:44 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Oct 15 15:33:17 2020 +0100

    xen/arm: print update firmware only once
    
    Fix enable_smccc_arch_workaround_1 to only print the warning asking to
    update the firmware once.
    
    Fixes: 976319fa3de7 ("xen/arm64: Kill PSCI_GET_VERSION as a variant-2 workaround")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/cpuerrata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 6c09017515..0c63dfa779 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -187,7 +187,7 @@ warn:
         ASSERT(system_state < SYS_STATE_active);
         warning_add("No support for ARM_SMCCC_ARCH_WORKAROUND_1.\n"
                     "Please update your firmware.\n");
-        warned = false;
+        warned = true;
     }
 
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:37:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:37:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8031.21381 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3F-0004Fb-Ki; Fri, 16 Oct 2020 11:37:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8031.21381; Fri, 16 Oct 2020 11:37:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3F-0004FT-HN; Fri, 16 Oct 2020 11:37:37 +0000
Received: by outflank-mailman (input) for mailman id 8031;
 Fri, 16 Oct 2020 11:37:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO3E-0004Ew-55
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fe9b55b4-cd20-4c1e-9812-39e0872a062f;
 Fri, 16 Oct 2020 11:37:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3D-0002oH-BE
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3D-0003jZ-Ab
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO3E-0004Ew-55
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:36 +0000
X-Inumbo-ID: fe9b55b4-cd20-4c1e-9812-39e0872a062f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fe9b55b4-cd20-4c1e-9812-39e0872a062f;
	Fri, 16 Oct 2020 11:37:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UcN9NCvVGxWJd3Eo6C+faYOvxvl0kLWFvbdYMnanfsY=; b=PrCzeT8Pc8QysFAr2lADaiBa6a
	r4/yl0jMMypVYTbec5CXzRjU9vWIvo2qrr9pkktnWU/LQOXYSnLxU8RYjz/R4jXDgnrECec/KXePi
	jpoD04DbnnzN2y2tBZbzIzfdYL9Tp67ZoySMq9PizVtRwH8m5pp0WjXvlMfj219WPifA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3D-0002oH-BE
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3D-0003jZ-Ab
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/gdbsx: drop stray recursion into tools/include/
Message-Id: <E1kTO3D-0003jZ-Ab@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:35 +0000

commit 6ee2e66674f36b6d27a95f4ddf27226905cc63a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 15 17:18:25 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 15 17:18:25 2020 +0200

    tools/gdbsx: drop stray recursion into tools/include/
    
    Doing so isn't appropriate here - this gets done very early in the build
    process. If the directory is mean to to be buildable on its own,
    different arrangements would be needed.
    
    The issue has become more pronounced by 47654a0d7320 ("tools/include:
    fix (drop) dependencies of when to populate xen/"), but was there before
    afaict.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/debugger/gdbsx/xg/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/debugger/gdbsx/xg/Makefile b/tools/debugger/gdbsx/xg/Makefile
index 6a8937b8f9..acdcddf0d5 100644
--- a/tools/debugger/gdbsx/xg/Makefile
+++ b/tools/debugger/gdbsx/xg/Makefile
@@ -12,7 +12,7 @@ CFLAGS += $(CFLAGS_xeninclude)
 all: build
 
 .PHONY: build
-build: xen-headers xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
+build: xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
 # build: mk-symlinks xg_all.a $(XG_HDRS) $(XG_OBJS) Makefile
 # build: mk-symlinks xg_all.a
 
@@ -21,9 +21,6 @@ xg_all.a: $(XG_OBJS) Makefile $(XG_HDRS)
 #	$(LD) -b elf32-i386 $(LDFLAGS) -r -o $@ $^
 #	$(CC) -m32 -c -o $@ $^
 
-xen-headers:
-	$(MAKE) -C ../../../include
-
 # xg_main.o: xg_main.c Makefile $(XG_HDRS)
 #$(CC) -c $(CFLAGS) -o $@ $<
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:37:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:37:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8032.21385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3T-0004JZ-MC; Fri, 16 Oct 2020 11:37:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8032.21385; Fri, 16 Oct 2020 11:37:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3T-0004JT-J4; Fri, 16 Oct 2020 11:37:51 +0000
Received: by outflank-mailman (input) for mailman id 8032;
 Fri, 16 Oct 2020 11:37:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO3R-0004JE-LP
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 71db9a58-824d-4b05-96f2-305010dbb8fe;
 Fri, 16 Oct 2020 11:37:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3Q-0002oi-OB
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3Q-0003tX-NZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO3R-0004JE-LP
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:49 +0000
X-Inumbo-ID: 71db9a58-824d-4b05-96f2-305010dbb8fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 71db9a58-824d-4b05-96f2-305010dbb8fe;
	Fri, 16 Oct 2020 11:37:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p6/fmZ9lskJl5/bKpz7JwRes0SOLTVJ6gJEZ/NMrPKA=; b=Brp3/C51mDlCfFbjWcAvzg2P/k
	Wp0f1WHrZ3+gpUIoazLqnIioEr4QP2LoCKj4QG7M9/Nnna2EJlySTXG+wWy9Zy8gMtPf4VL83MqtY
	y/3fkShN4JRbJKmnt9nvw5H9pHmX8J2AbCVf8f8QbjzLvgXstgqMS1a0le7HbwMnfAg4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3Q-0002oi-OB
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3Q-0003tX-NZ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/traps: 'Fix' safety of read_registers() in #DF path
Message-Id: <E1kTO3Q-0003tX-NZ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:48 +0000

commit 6065a05adf152a556fb9f11a5218c89e41b62893
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 13:24:31 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:55:33 2020 +0100

    x86/traps: 'Fix' safety of read_registers() in #DF path
    
    All interrupts and exceptions pass a struct cpu_user_regs up into C.  This
    contains the legacy vm86 fields from 32bit days, which are beyond the
    hardware-pushed frame.
    
    Accessing these fields is generally illegal, as they are logically out of
    bounds for anything other than an interrupt/exception hitting ring1/3 code.
    
    show_registers() unconditionally reads these fields, but the content is
    discarded before use.  This is benign right now, as all parts of the stack are
    readable, including the guard pages.
    
    However, read_registers() in the #DF handler writes to these fields as part of
    preparing the state dump, and being IST, hits the adjacent stack frame.
    
    This has been broken forever, but c/s 6001660473 "x86/shstk: Rework the stack
    layout to support shadow stacks" repositioned the #DF stack to be adjacent to
    the guard page, which turns this OoB write into a fatal pagefault:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) CPU:    4
      (XEN) RIP:    e008:[<ffff82d04031fd4f>] traps.c#read_registers+0x29/0xc1
      (XEN) RFLAGS: 0000000000050086   CONTEXT: hypervisor (d1v0)
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d04031fd4f>] R traps.c#read_registers+0x29/0xc1
      (XEN)    [<ffff82d0403207b3>] F do_double_fault+0x3d/0x7e
      (XEN)    [<ffff82d04039acd7>] F double_fault+0x107/0x110
      (XEN)
      (XEN) Pagetable walk from ffff830236f6d008:
      (XEN)  L4[0x106] = 80000000bfa9b063 ffffffffffffffff
      (XEN)  L3[0x008] = 0000000236ffd063 ffffffffffffffff
      (XEN)  L2[0x1b7] = 0000000236ffc063 ffffffffffffffff
      (XEN)  L1[0x16d] = 8000000236f6d161 ffffffffffffffff
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 4:
      (XEN) FATAL PAGE FAULT
      (XEN) [error_code=0003]
      (XEN) Faulting linear address: ffff830236f6d008
      (XEN) ****************************************
      (XEN)
    
    and rendering the main #DF analysis broken.
    
    The proper fix is to delete cpu_user_regs.es and later, so no
    interrupt/exception path can access OoB, but this needs disentangling from the
    PV ABI first.
    
    Not-really-fixes: 6001660473 ("x86/shstk: Rework the stack layout to support shadow stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index da74172776..a684519a20 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -770,7 +770,13 @@ void load_system_tables(void)
 	tss->ist[IST_MCE - 1] = stack_top + (1 + IST_MCE) * PAGE_SIZE;
 	tss->ist[IST_NMI - 1] = stack_top + (1 + IST_NMI) * PAGE_SIZE;
 	tss->ist[IST_DB  - 1] = stack_top + (1 + IST_DB)  * PAGE_SIZE;
-	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE;
+	/*
+	 * Gross bodge.  The #DF handler uses the vm86 fields of cpu_user_regs
+	 * beyond the hardware frame.  Adjust the stack entrypoint so this
+	 * doesn't manifest as an OoB write which hits the guard page.
+	 */
+	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE -
+		(sizeof(struct cpu_user_regs) - offsetof(struct cpu_user_regs, es));
 	tss->bitmap = IOBMP_INVALID_OFFSET;
 
 	/* All other stack pointers poisioned. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:38:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:38:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8033.21389 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3d-0004N1-Nm; Fri, 16 Oct 2020 11:38:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8033.21389; Fri, 16 Oct 2020 11:38:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3d-0004Ms-Kc; Fri, 16 Oct 2020 11:38:01 +0000
Received: by outflank-mailman (input) for mailman id 8033;
 Fri, 16 Oct 2020 11:38:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO3c-0004MV-33
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 99b7bc61-2038-493d-b79c-83db67eaa4b3;
 Fri, 16 Oct 2020 11:37:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3a-0002op-Qx
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3a-0003uX-QH
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO3c-0004MV-33
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:00 +0000
X-Inumbo-ID: 99b7bc61-2038-493d-b79c-83db67eaa4b3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 99b7bc61-2038-493d-b79c-83db67eaa4b3;
	Fri, 16 Oct 2020 11:37:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3Ykfj69OXyEaIpPC4FVz4q+TOD8A5voYeBkYs8pcYqw=; b=DBUhz6IhvYgFgrGAbywt76OTjf
	4bmyLy9OYFdBqGAkV352WperZtYAY/yQ0L4kWc9i4bHTnB3apHKdaPXUlX95HRzjHEMjV9903LEBs
	+d6fofCqdKLMtcELW95bsaCuECJ0T49GJa4WFj0L/RKePgFObyT+aOxsEQrANBxfkQBI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3a-0002op-Qx
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3a-0003uX-QH
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:37:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/ucode/intel: Improve description for gathering the microcode revision
Message-Id: <E1kTO3a-0003uX-QH@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:37:58 +0000

commit 04182d8b795dcdabf4f3873d3f5c78b67cbc04b0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 14:58:45 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:55:33 2020 +0100

    x86/ucode/intel: Improve description for gathering the microcode revision
    
    Obtaining the microcode revision on Intel CPUs is complicated for backwards
    compatibility reasons.  Update apply_microcode() to use a slightly more
    efficient CPUID invocation, now that the documentation has been updated to
    confirm that any CPUID instruction is fine, not just CPUID.1
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/microcode/intel.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index d9bb1bc10e..72c07fcd1d 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -126,13 +126,16 @@ static void collect_cpu_info(void)
     rdmsrl(MSR_IA32_PLATFORM_ID, msr_content);
     csig->pf = 1 << ((msr_content >> 50) & 7);
 
-    wrmsrl(MSR_IA32_UCODE_REV, 0x0ULL);
-    /* As documented in the SDM: Do a CPUID 1 here */
+    /*
+     * Obtaining the microcode version involves writing 0 to the "read only"
+     * UCODE_REV MSR, executing any CPUID instruction, after which a nonzero
+     * revision should appear.
+     */
+    wrmsrl(MSR_IA32_UCODE_REV, 0);
     csig->sig = cpuid_eax(1);
-
-    /* get the current revision from MSR 0x8B */
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
-    csig->rev = (uint32_t)(msr_content >> 32);
+    csig->rev = msr_content >> 32;
+
     pr_debug("microcode: collect_cpu_info : sig=%#x, pf=%#x, rev=%#x\n",
              csig->sig, csig->pf, csig->rev);
 }
@@ -270,14 +273,15 @@ static int apply_microcode(const struct microcode_patch *patch)
 
     wbinvd();
 
-    /* write microcode via MSR 0x79 */
     wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)patch->data);
-    wrmsrl(MSR_IA32_UCODE_REV, 0x0ULL);
 
-    /* As documented in the SDM: Do a CPUID 1 here */
-    cpuid_eax(1);
-
-    /* get the current revision from MSR 0x8B */
+    /*
+     * Obtaining the microcode version involves writing 0 to the "read only"
+     * UCODE_REV MSR, executing any CPUID instruction, after which a nonzero
+     * revision should appear.
+     */
+    wrmsrl(MSR_IA32_UCODE_REV, 0);
+    cpuid_eax(0);
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
     sig->rev = rev = msr_content >> 32;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 11:38:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 11:38:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8035.21392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3n-0004Ok-Oy; Fri, 16 Oct 2020 11:38:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8035.21392; Fri, 16 Oct 2020 11:38:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTO3n-0004Oc-M3; Fri, 16 Oct 2020 11:38:11 +0000
Received: by outflank-mailman (input) for mailman id 8035;
 Fri, 16 Oct 2020 11:38:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTO3l-0004ON-Ng
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2080186b-e211-4bbc-a051-d0ed457f302f;
 Fri, 16 Oct 2020 11:38:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3k-0002pC-Up
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTO3k-0003vm-T7
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTO3l-0004ON-Ng
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:09 +0000
X-Inumbo-ID: 2080186b-e211-4bbc-a051-d0ed457f302f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2080186b-e211-4bbc-a051-d0ed457f302f;
	Fri, 16 Oct 2020 11:38:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xQ2hTkbqtaQI5iJ4c6geiymtqDgTz/9NGfG44fyEOBo=; b=tCnnlkDUSbP/HtZZ8NXo/1es2Y
	Wx61aBlqbxHXD+9+8iouSeCEDl0zob3pLJ+/9apYZrHM9pxiX4j7nMBNLGXCZdil6FCyuq6cbTDuf
	xYOv18Wzz0hjlaaG3sInBHMXathpUVD6iZ5JW1YWAYDxmI+ElR+r141+n2rHuMXsfAow=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3k-0002pC-Up
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTO3k-0003vm-T7
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 11:38:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
Message-Id: <E1kTO3k-0003vm-T7@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 11:38:08 +0000

commit a7952a320c1e202a218702bfdb14f75132f04894
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 5 12:46:30 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:56:59 2020 +0100

    x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
    
    cpu_smpboot_alloc() is designed to be idempotent with respect to partially
    initialised state.  This occurs for S3 and CPU parking, where enough state to
    handle NMIs/#MCs needs to remain valid for the entire lifetime of Xen, even
    when we otherwise want to offline the CPU.
    
    For simplicity between various configuration, Xen always uses shadow stack
    mappings (Read-only + Dirty) for the guard page, irrespective of whether
    CET-SS is enabled.
    
    Unfortunately, the CET-SS changes in memguard_guard_stack() broke idempotency
    by first writing out the supervisor shadow stack tokens with plain writes,
    then changing the mapping to being read-only.
    
    This ordering is strictly necessary to configure the BSP, which cannot have
    the supervisor tokens be written with WRSS.
    
    Instead of calling memguard_guard_stack() unconditionally, call it only when
    actually allocating a new stack.  Xenheap allocates are guaranteed to be
    writeable, and the net result is idempotency WRT configuring stack_base[].
    
    Fixes: 91d26ed304f ("x86/shstk: Create shadow stacks")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/smpboot.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 5708573c41..67e727cebd 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -997,16 +997,18 @@ static int cpu_smpboot_alloc(unsigned int cpu)
         memflags = MEMF_node(node);
 
     if ( stack_base[cpu] == NULL )
+    {
         stack_base[cpu] = alloc_xenheap_pages(STACK_ORDER, memflags);
-    if ( stack_base[cpu] == NULL )
-        goto out;
+        if ( !stack_base[cpu] )
+            goto out;
+
+        memguard_guard_stack(stack_base[cpu]);
+    }
 
     info = get_cpu_info_from_stack((unsigned long)stack_base[cpu]);
     info->processor_id = cpu;
     info->per_cpu_offset = __per_cpu_offset[cpu];
 
-    memguard_guard_stack(stack_base[cpu]);
-
     gdt = per_cpu(gdt, cpu) ?: alloc_xenheap_pages(0, memflags);
     if ( gdt == NULL )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 13:44:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 13:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8095.21573 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ1g-0000IF-7t; Fri, 16 Oct 2020 13:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8095.21573; Fri, 16 Oct 2020 13:44:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ1g-0000I7-4M; Fri, 16 Oct 2020 13:44:08 +0000
Received: by outflank-mailman (input) for mailman id 8095;
 Fri, 16 Oct 2020 13:44:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTQ1e-0000Hh-Kf
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 946b3487-aa49-4f4e-9079-302b0a0d7b5c;
 Fri, 16 Oct 2020 13:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1d-0005TD-5U
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1d-00050M-4G
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTQ1e-0000Hh-Kf
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:06 +0000
X-Inumbo-ID: 946b3487-aa49-4f4e-9079-302b0a0d7b5c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 946b3487-aa49-4f4e-9079-302b0a0d7b5c;
	Fri, 16 Oct 2020 13:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FpRho5q1zWx+K2m3f7N6Mijlc8GAHd47zJyPN1WTgNM=; b=KMwwlIRAbwOJkyBwSKWr9JzZJT
	fQycTMa+t8pVtBHEuqFT+RNZVBaRv57i6J8TX4MW3WfrFkCsgTnwpJTfWvVnalRGlY2a+GabG7mJa
	4Djppmso0n7llgtn6bzo1OHJPzgVJVbZC9ayPEXYhp+v/CuHEOdcyiL/BYeLxpAT6MiE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1d-0005TD-5U
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1d-00050M-4G
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/stat: use memcpy instead of strncpy in getBridge
Message-Id: <E1kTQ1d-00050M-4G@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 13:44:05 +0000

commit 40fe714ca4245a9716264fcb3ee8df42c3650cf6
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 14:57:01 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:23:34 2020 +0000

    tools/libs/stat: use memcpy instead of strncpy in getBridge
    
    Use memcpy in getBridge to prevent gcc warnings about truncated
    strings. We know that we might truncate it, so the gcc warning
    here is wrong.
    Revert previous change changing buffer sizes as bigger buffers
    are not needed.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/stat/xenstat_linux.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index d2ee6fda64..e0d242e1bc 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <regex.h>
+#include <xen-tools/libs.h>
 
 #include "xenstat_priv.h"
 
@@ -78,8 +79,14 @@ static void getBridge(char *excludeName, char *result, size_t resultLen)
 				sprintf(tmp, "/sys/class/net/%s/bridge", de->d_name);
 
 				if (access(tmp, F_OK) == 0) {
-					strncpy(result, de->d_name, resultLen);
-					result[resultLen - 1] = 0;
+					/*
+					 * Do not use strncpy to prevent compiler warning with
+					 * gcc >= 10.0
+					 * If de->d_name is longer then resultLen we truncate it
+					 */
+					memset(result, 0, resultLen);
+					memcpy(result, de->d_name, MIN(strnlen(de->d_name,
+									NAME_MAX),resultLen - 1));
 				}
 		}
 	}
@@ -264,7 +271,7 @@ int xenstat_collect_networks(xenstat_node * node)
 {
 	/* Helper variables for parseNetDevLine() function defined above */
 	int i;
-	char line[512] = { 0 }, iface[16] = { 0 }, devBridge[256] = { 0 }, devNoBridge[257] = { 0 };
+	char line[512] = { 0 }, iface[16] = { 0 }, devBridge[16] = { 0 }, devNoBridge[17] = { 0 };
 	unsigned long long rxBytes, rxPackets, rxErrs, rxDrops, txBytes, txPackets, txErrs, txDrops;
 
 	struct priv_data *priv = get_priv_data(node->handle);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 13:44:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 13:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8096.21580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ1q-0000L5-9u; Fri, 16 Oct 2020 13:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8096.21580; Fri, 16 Oct 2020 13:44:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ1q-0000Kt-5t; Fri, 16 Oct 2020 13:44:18 +0000
Received: by outflank-mailman (input) for mailman id 8096;
 Fri, 16 Oct 2020 13:44:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTQ1o-0000KP-5X
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f468ad47-c7a1-4919-b8a0-c0c9c35d5b97;
 Fri, 16 Oct 2020 13:44:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1n-0005TM-8P
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1n-00051Q-7Z
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTQ1o-0000KP-5X
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:16 +0000
X-Inumbo-ID: f468ad47-c7a1-4919-b8a0-c0c9c35d5b97
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f468ad47-c7a1-4919-b8a0-c0c9c35d5b97;
	Fri, 16 Oct 2020 13:44:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jLmbUaXXDd+KTfE7OWA8zc9LOM0ehIslFCO2MtgMHAo=; b=X+3lp1i/Gpu3xqdX+JzbF3oOWt
	kSiP6I3YSH2BW/cFr7HYHLbEhk+Tr77HNk8POiBrEXKxgSqwktCXfuR6KeGvOdwhDUZy6Nz+Z02al
	ii8Wf+kDmr+u25ZO24VNBnNgXVK0R9Gas8m77ZfLMYHqXruFyqNyfexmCqHlyyqm5G4g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1n-0005TM-8P
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1n-00051Q-7Z
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/python: Pass linker to Python build process
Message-Id: <E1kTQ1n-00051Q-7Z@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 13:44:15 +0000

commit 17d192e0238d6c714e9f04593b59597b7090be38
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Sun Oct 11 18:11:39 2020 -0700
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:25:35 2020 +0000

    tools/python: Pass linker to Python build process
    
    Unexpectedly the environment variable which needs to be passed is
    $LDSHARED and not $LD.  Otherwise Python may find the build `ld` instead
    of the host `ld`.
    
    Replace $(LDFLAGS) with $(SHLIB_LDFLAGS) as Python needs shared objects
    it can load at runtime, not executables.
    
    This uses $(CC) instead of $(LD) since Python distutils appends $CFLAGS
    to $LDFLAGS which breaks many linkers.
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/pygrub/Makefile | 9 +++++----
 tools/python/Makefile | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 3063c4998f..37b2146214 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -3,20 +3,21 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
-PY_LDFLAGS = $(LDFLAGS) $(APPEND_LDFLAGS)
+PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
 .PHONY: all
 all: build
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)/$(bindir)
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
-		setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
+		LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
+		--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
 		 --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force
 	set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
 	             "`readlink -f $(DESTDIR)/$(bindir)`" != \
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 8dc755d6e8..5e555acf1c 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -5,19 +5,20 @@ include $(XEN_ROOT)/tools/Rules.mk
 all: build
 
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
-PY_LDFLAGS = $(LDFLAGS) $(APPEND_LDFLAGS)
+PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install:
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
-		setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
+		LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
+		--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
 		--root="$(DESTDIR)" --force
 
 	$(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream $(DESTDIR)$(LIBEXEC_BIN)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 16 13:44:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Oct 2020 13:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8100.21582 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ26-0000PC-Ae; Fri, 16 Oct 2020 13:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8100.21582; Fri, 16 Oct 2020 13:44:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTQ26-0000P4-7f; Fri, 16 Oct 2020 13:44:34 +0000
Received: by outflank-mailman (input) for mailman id 8100;
 Fri, 16 Oct 2020 13:44:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTQ24-0000Mb-8D
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8ded7833-7010-4d8e-84d1-2ac82f8de315;
 Fri, 16 Oct 2020 13:44:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1x-0005TV-BS
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTQ1x-00052T-AZ
 for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=gtIu=DX=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTQ24-0000Mb-8D
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:32 +0000
X-Inumbo-ID: 8ded7833-7010-4d8e-84d1-2ac82f8de315
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8ded7833-7010-4d8e-84d1-2ac82f8de315;
	Fri, 16 Oct 2020 13:44:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8vc8x78yohyWvkJYHwWQI2SCuom6B1ukT35tw0mv3pU=; b=Z53+j+EXZZVhMBOYlPpbmakkpy
	Wxm4w29NUpXkDITh3c0ujrV8TUTDt3fi/KqH+YKmjjvS7Tj4/isu1frw81QDLE4BvCViy0Fde7kb4
	p/aiNH1nGGe7V697BFT+r45b3wCyawXXEwbQuEr2g/1wybyFcn821/5doVcnp8XIWoKE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1x-0005TV-BS
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTQ1x-00052T-AZ
	for xen-changelog@lists.xenproject.org; Fri, 16 Oct 2020 13:44:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenpmd: Fix gcc10 snprintf warning
Message-Id: <E1kTQ1x-00052T-AZ@xenbits.xenproject.org>
Date: Fri, 16 Oct 2020 13:44:25 +0000

commit 0dfddb2116e3757f77a691a3fe335173088d69dc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Thu Oct 15 10:16:09 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:28:55 2020 +0000

    tools/xenpmd: Fix gcc10 snprintf warning
    
    Add a check for snprintf return code and ignore the entry if we get an
    error. This should in fact never happen and is more a trick to make gcc
    happy and prevent compilation errors.
    
    This is solving the following gcc warning when compiling for arm32 host
    platforms with optimization activated:
    xenpmd.c:92:37: error: '%s' directive output may be truncated writing
    between 4 and 2147483645 bytes into a region of size 271
    [-Werror=format-truncation=]
    
    This is also solving the following Debian bug:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970802
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/xenpmd/xenpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
index 35fd1c931a..12b82cf43e 100644
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -102,6 +102,7 @@ FILE *get_next_battery_file(DIR *battery_dir,
     FILE *file = 0;
     struct dirent *dir_entries;
     char file_name[284];
+    int ret;
     
     do 
     {
@@ -111,11 +112,15 @@ FILE *get_next_battery_file(DIR *battery_dir,
         if ( strlen(dir_entries->d_name) < 4 )
             continue;
         if ( battery_info_type == BIF ) 
-            snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
+            ret = snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
                      dir_entries->d_name);
         else 
-            snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
+            ret = snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
                      dir_entries->d_name);
+        /* This should not happen but is needed to pass gcc checks */
+        if (ret < 0)
+            continue;
+        file_name[sizeof(file_name) - 1] = '\0';
         file = fopen(file_name, "r");
     } while ( !file );
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8313.22132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn5y-0006uC-I2; Sat, 17 Oct 2020 14:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8313.22132; Sat, 17 Oct 2020 14:22:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn5y-0006u4-Ej; Sat, 17 Oct 2020 14:22:06 +0000
Received: by outflank-mailman (input) for mailman id 8313;
 Sat, 17 Oct 2020 14:22:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn5x-0006tz-Jb
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e8c88ad4-f0c1-48b8-8f88-b389a51c5dea;
 Sat, 17 Oct 2020 14:22:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn5v-0005FV-U5
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn5v-00059j-Sc
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn5x-0006tz-Jb
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:05 +0000
X-Inumbo-ID: e8c88ad4-f0c1-48b8-8f88-b389a51c5dea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e8c88ad4-f0c1-48b8-8f88-b389a51c5dea;
	Sat, 17 Oct 2020 14:22:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y8dO44YtfwW0jasfSc4m78fX2deyA0WdDOsXJOZoLl0=; b=QwwbXD5fO7YLQdqx0cdbGfcltR
	XzJRCo4xjCLtAXc8EV+JAmdBYLlBQ1hSYe9V6a+q9rl4sxPeoImG0thMHGyE+BpzAchFFqsGUViM3
	QCOy90RoPXD7CeSEmhUq5z+THdeZalfY26U/zrc3Y5ntbcYt5+0BgTIzMEEiRTWlZb88=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn5v-0005FV-U5
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn5v-00059j-Sc
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hostmem: don't use mbind() if host-nodes is empty
Message-Id: <E1kTn5v-00059j-Sc@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:03 +0000

commit 9e6e3ba30984267be4721022f579fb168d43c8a4
Author:     Igor Mammedov <imammedo@redhat.com>
AuthorDate: Thu Apr 30 11:46:06 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:30 2020 -0500

    hostmem: don't use mbind() if host-nodes is empty
    
    Since 5.0 QEMU uses hostmem backend for allocating main guest RAM.
    The backend however calls mbind() which is typically NOP
    in case of default policy/absent host-nodes bitmap.
    However when runing in container with black-listed mbind()
    syscall, QEMU fails to start with error
     "cannot bind memory to host NUMA nodes: Operation not permitted"
    even when user hasn't provided host-nodes to pin to explictly
    (which is the case with -m option)
    
    To fix issue, call mbind() only in case when user has provided
    host-nodes explicitly (i.e. host_nodes bitmap is not empty).
    That should allow to run QEMU in containers with black-listed
    mbind() without memory pinning. If QEMU provided memory-pinning
    is required user still has to white-list mbind() in container
    configuration.
    
    Reported-by: Manuel Hohmann <mhohmann@physnet.uni-hamburg.de>
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Message-Id: <20200430154606.6421-1-imammedo@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    (cherry picked from commit 70b6d525dfb51d5e523d568d1139fc051bc223c5)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 backends/hostmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index 327f9eebc3..0efd7b7bd6 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -383,8 +383,10 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
         assert(sizeof(backend->host_nodes) >=
                BITS_TO_LONGS(MAX_NODES + 1) * sizeof(unsigned long));
         assert(maxnode <= MAX_NODES);
-        if (mbind(ptr, sz, backend->policy,
-                  maxnode ? backend->host_nodes : NULL, maxnode + 1, flags)) {
+
+        if (maxnode &&
+            mbind(ptr, sz, backend->policy, backend->host_nodes, maxnode + 1,
+                  flags)) {
             if (backend->policy != MPOL_DEFAULT || errno != ENOSYS) {
                 error_setg_errno(errp, errno,
                                  "cannot bind memory to host NUMA nodes");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8314.22136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn68-0006uz-JF; Sat, 17 Oct 2020 14:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8314.22136; Sat, 17 Oct 2020 14:22:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn68-0006ur-GI; Sat, 17 Oct 2020 14:22:16 +0000
Received: by outflank-mailman (input) for mailman id 8314;
 Sat, 17 Oct 2020 14:22:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn67-0006uj-Kg
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d67b3ff8-fd62-4e54-8d8f-e6bc57ec581e;
 Sat, 17 Oct 2020 14:22:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn66-0005Fz-24
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn66-0005AI-0I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn67-0006uj-Kg
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:15 +0000
X-Inumbo-ID: d67b3ff8-fd62-4e54-8d8f-e6bc57ec581e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d67b3ff8-fd62-4e54-8d8f-e6bc57ec581e;
	Sat, 17 Oct 2020 14:22:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t2/xsYftNQgo9TvWXpAEOlrR8kn8ODpdpowyS6VzH7Q=; b=viCKr0jSZIbKYyVT92GbjpYZFI
	XAE1o3vwKCzh9ObVhgKaSdUbBzUeXuNJp2eb9+mjfR+dFizcJha21eQXRQ/zbzCubbQdlyIQWotyv
	wEz36+6Q40yQ3Dc4spVKQq80Uuf3As/9C93vKkO8LZMHIUX+FEYIDLcxtQDBEFnYaqAE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn66-0005Fz-24
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn66-0005AI-0I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*
Message-Id: <E1kTn66-0005AI-0I@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:14 +0000

commit 352259fef83f689b8a8c436a24093e6ede167288
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Wed May 13 09:32:43 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:37 2020 -0500

    target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*
    
    Must clear the tail for AdvSIMD when SVE is enabled.
    
    Fixes: ca40a6e6e39
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200513163245.17915-15-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    (cherry picked from commit 525d9b6d42844e187211d25b69be8b378785bc24)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/arm/vec_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
index 8017bd88c4..5ce111b286 100644
--- a/target/arm/vec_helper.c
+++ b/target/arm/vec_helper.c
@@ -737,6 +737,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \
             d[i + j] = TYPE##_mul(n[i + j], mm, stat);                     \
         }                                                                  \
     }                                                                      \
+    clear_tail(d, oprsz, simd_maxsz(desc));                                \
 }
 
 DO_MUL_IDX(gvec_fmul_idx_h, float16, H2)
@@ -761,6 +762,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va,                  \
                                      mm, a[i + j], 0, stat);               \
         }                                                                  \
     }                                                                      \
+    clear_tail(d, oprsz, simd_maxsz(desc));                                \
 }
 
 DO_FMLA_IDX(gvec_fmla_idx_h, float16, H2)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8315.22140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6H-0006x4-Kp; Sat, 17 Oct 2020 14:22:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8315.22140; Sat, 17 Oct 2020 14:22:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6H-0006ww-Hl; Sat, 17 Oct 2020 14:22:25 +0000
Received: by outflank-mailman (input) for mailman id 8315;
 Sat, 17 Oct 2020 14:22:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn6H-0006wo-0a
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a708223c-49a4-4945-915b-78826900dbf9;
 Sat, 17 Oct 2020 14:22:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6G-0005G9-61
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6G-0005Ap-4e
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn6H-0006wo-0a
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:25 +0000
X-Inumbo-ID: a708223c-49a4-4945-915b-78826900dbf9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a708223c-49a4-4945-915b-78826900dbf9;
	Sat, 17 Oct 2020 14:22:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DUlV+vxbE2dI/PSMif4RxAx+gflRW77peZtqq+WlH/E=; b=BIdNhURKOHwl/EayeC19g9ySBa
	ZhcXbwAXrwwHVzUKzTmuoBRCU4JbTiOcxU/7bURScuYPiOIznoOBlp+kW2li+aKRWRIv7/wWBoILY
	A+2S0CrRcuWdCNs8JMYSMBAcVjKuw7eI09EZNzdvtg7QZ1+XXf91npIaWjKvPQ1sIpOk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6G-0005G9-61
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6G-0005Ap-4e
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] qemu-nbd: Close inherited stderr
Message-Id: <E1kTn6G-0005Ap-4e@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:24 +0000

commit bdac9aabd92bd8e6d070cbc83e46272e86f63dc5
Author:     Raphael Pour <raphael.pour@hetzner.com>
AuthorDate: Fri May 15 08:36:07 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:45 2020 -0500

    qemu-nbd: Close inherited stderr
    
    Close inherited stderr of the parent if fork_process is false.
    Otherwise no one will close it. (introduced by e6df58a5)
    
    This only affected 'qemu-nbd -c /dev/nbd0'.
    
    Signed-off-by: Raphael Pour <raphael.pour@hetzner.com>
    Message-Id: <d8ddc993-9816-836e-a3de-c6edab9d9c49@hetzner.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: Enhance commit message]
    Signed-off-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit 0eaf453ebf6788885fbb5d40426b154ef8805407)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qemu-nbd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 4aa005004e..306e44fb0a 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -916,7 +916,11 @@ int main(int argc, char **argv)
         } else if (pid == 0) {
             close(stderr_fd[0]);
 
-            old_stderr = dup(STDERR_FILENO);
+            /* Remember parent's stderr if we will be restoring it. */
+            if (fork_process) {
+                old_stderr = dup(STDERR_FILENO);
+            }
+
             ret = qemu_daemon(1, 0);
 
             /* Temporarily redirect stderr to the parent's pipe...  */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8316.22143 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6S-0006z9-MY; Sat, 17 Oct 2020 14:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8316.22143; Sat, 17 Oct 2020 14:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6S-0006z1-JO; Sat, 17 Oct 2020 14:22:36 +0000
Received: by outflank-mailman (input) for mailman id 8316;
 Sat, 17 Oct 2020 14:22:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn6R-0006yS-6c
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 57e8dacf-0ee3-4e5f-8112-bf289f2124ed;
 Sat, 17 Oct 2020 14:22:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6Q-0005GL-9J
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6Q-0005Bs-8U
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn6R-0006yS-6c
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:35 +0000
X-Inumbo-ID: 57e8dacf-0ee3-4e5f-8112-bf289f2124ed
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 57e8dacf-0ee3-4e5f-8112-bf289f2124ed;
	Sat, 17 Oct 2020 14:22:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N4LuvFNOQX0QyMCiE35JvIoI2gNQIIN34u+yh32JQ2A=; b=jmvbgmahbrwE+vZF4IMx8O3bBY
	3lTnJmdknReEgYVlujRdLwxXN2O83j/PekXZso8aPlRRNSchl9PFMEJTVToOUq7ejF4M19Un9Oyq7
	b5En8y3Fd+bktGzNbSBbnw6B4eHJv4xkOf/LTDG8poXCjFXVGH2s5AqEcB85pRbtoJdk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6Q-0005GL-9J
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6Q-0005Bs-8U
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] 9p: Lock directory streams with a CoMutex
Message-Id: <E1kTn6Q-0005Bs-8U@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:34 +0000

commit 250322bfbdec098699b414422008aa8ae65f7d4d
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Mon May 25 10:38:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:51 2020 -0500

    9p: Lock directory streams with a CoMutex
    
    Locking was introduced in QEMU 2.7 to address the deprecation of
    readdir_r(3) in glibc 2.24. It turns out that the frontend code is
    the worst place to handle a critical section with a pthread mutex:
    the code runs in a coroutine on behalf of the QEMU mainloop and then
    yields control, waiting for the fsdev backend to process the request
    in a worker thread. If the client resends another readdir request for
    the same fid before the previous one finally unlocked the mutex, we're
    deadlocked.
    
    This never bit us because the linux client serializes readdir requests
    for the same fid, but it is quite easy to demonstrate with a custom
    client.
    
    A good solution could be to narrow the critical section in the worker
    thread code and to return a copy of the dirent to the frontend, but
    this causes quite some changes in both 9p.c and codir.c. So, instead
    of that, in order for people to easily backport the fix to older QEMU
    versions, let's simply use a CoMutex since all the users for this
    sit in coroutines.
    
    Fixes: 7cde47d4a89d ("9p: add locking to V9fsDir")
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <158981894794.109297.3530035833368944254.stgit@bahia.lan>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit ed463454efd0ac3042ff772bfe1b1d846dc281a5)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index b8f72a3bd9..c381fe091a 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -197,22 +197,22 @@ typedef struct V9fsXattr
 
 typedef struct V9fsDir {
     DIR *stream;
-    QemuMutex readdir_mutex;
+    CoMutex readdir_mutex;
 } V9fsDir;
 
 static inline void v9fs_readdir_lock(V9fsDir *dir)
 {
-    qemu_mutex_lock(&dir->readdir_mutex);
+    qemu_co_mutex_lock(&dir->readdir_mutex);
 }
 
 static inline void v9fs_readdir_unlock(V9fsDir *dir)
 {
-    qemu_mutex_unlock(&dir->readdir_mutex);
+    qemu_co_mutex_unlock(&dir->readdir_mutex);
 }
 
 static inline void v9fs_readdir_init(V9fsDir *dir)
 {
-    qemu_mutex_init(&dir->readdir_mutex);
+    qemu_co_mutex_init(&dir->readdir_mutex);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8317.22148 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6c-00070P-Nx; Sat, 17 Oct 2020 14:22:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8317.22148; Sat, 17 Oct 2020 14:22:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6c-00070H-Kx; Sat, 17 Oct 2020 14:22:46 +0000
Received: by outflank-mailman (input) for mailman id 8317;
 Sat, 17 Oct 2020 14:22:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn6b-000707-E0
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 89444bff-ba41-4a0c-a09d-44cd891b106e;
 Sat, 17 Oct 2020 14:22:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6a-0005I2-Jh
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6a-0005DT-Cu
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn6b-000707-E0
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:45 +0000
X-Inumbo-ID: 89444bff-ba41-4a0c-a09d-44cd891b106e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 89444bff-ba41-4a0c-a09d-44cd891b106e;
	Sat, 17 Oct 2020 14:22:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7CrV2iDeC/eX1l1WD303+QxuOGVAaCoD+fyU1tbR1Mg=; b=RRRsVwMm4nV6YjiBIbB21LMh/a
	br5ODMtTL6YYbCH5f0Ggx9GwtR9iN2JLiVG5RWPGKMYmXNLcozcN/jNdaMg2u8EyZavENHtjh/has
	uxpGDJxmkSK5so+mOGM3pjScBujQzk87mGHYUk2h2k+p78ztcGsH59XiOMDY6OCFmx2Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6a-0005I2-Jh
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6a-0005DT-Cu
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] net: Do not include a newline in the id of -nic devices
Message-Id: <E1kTn6a-0005DT-Cu@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:44 +0000

commit c6414cb18315e4d043b6756faf9766fb0d8488bb
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon May 18 09:43:52 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:55:57 2020 -0500

    net: Do not include a newline in the id of -nic devices
    
    The '\n' sneaked in by accident here, an "id" string should really
    not contain a newline character at the end.
    
    Fixes: 78cd6f7bf6b ('net: Add a new convenience option "--nic" ...')
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200518074352.23125-1-thuth@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    (cherry picked from commit 0561dfac082becdd9e89110249a27b309b62aa9f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 38778e831d..cbeeeadff8 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1506,7 +1506,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
     /* Create an ID if the user did not specify one */
     nd_id = g_strdup(qemu_opts_id(opts));
     if (!nd_id) {
-        nd_id = g_strdup_printf("__org.qemu.nic%i\n", idx);
+        nd_id = g_strdup_printf("__org.qemu.nic%i", idx);
         qemu_opts_set_id(opts, nd_id);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:22:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:22:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8318.22152 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6m-00071n-Pq; Sat, 17 Oct 2020 14:22:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8318.22152; Sat, 17 Oct 2020 14:22:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6m-00071f-MZ; Sat, 17 Oct 2020 14:22:56 +0000
Received: by outflank-mailman (input) for mailman id 8318;
 Sat, 17 Oct 2020 14:22:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn6l-00071V-Ta
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 29d7224b-ebe2-4dd7-92c3-23137d1b605c;
 Sat, 17 Oct 2020 14:22:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6k-0005IA-Mz
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6k-0005E4-M9
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn6l-00071V-Ta
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:55 +0000
X-Inumbo-ID: 29d7224b-ebe2-4dd7-92c3-23137d1b605c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 29d7224b-ebe2-4dd7-92c3-23137d1b605c;
	Sat, 17 Oct 2020 14:22:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dYUDLroenZWYaV8Cb7PYLv4yj9B2o3eUmnpVwT5laSQ=; b=mypFk/zo5vmBE++0EWc1JMmL9N
	WZppGyYlyU2+oRipfo5lLatgthUvyPnLwZ/unCNWMqPHJP7gDcj/oxN29AJ8MrQcH73N8esFu8gXS
	o7WGjRyduX5NrwXxj1cw29HkZMsurZgqTAjL8aet1+bo9d0q/iWtVgmwYj6irTEM57YE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6k-0005IA-Mz
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6k-0005E4-M9
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:22:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] nbd/server: Avoid long error message assertions CVE-2020-10761
Message-Id: <E1kTn6k-0005E4-M9@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:22:54 +0000

commit d48973dc26f9f852eb32b89ae33db717d192df5c
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 8 13:26:37 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:03 2020 -0500

    nbd/server: Avoid long error message assertions CVE-2020-10761
    
    Ever since commit 36683283 (v2.8), the server code asserts that error
    strings sent to the client are well-formed per the protocol by not
    exceeding the maximum string length of 4096.  At the time the server
    first started sending error messages, the assertion could not be
    triggered, because messages were completely under our control.
    However, over the years, we have added latent scenarios where a client
    could trigger the server to attempt an error message that would
    include the client's information if it passed other checks first:
    
    - requesting NBD_OPT_INFO/GO on an export name that is not present
      (commit 0cfae925 in v2.12 echoes the name)
    
    - requesting NBD_OPT_LIST/SET_META_CONTEXT on an export name that is
      not present (commit e7b1948d in v2.12 echoes the name)
    
    At the time, those were still safe because we flagged names larger
    than 256 bytes with a different message; but that changed in commit
    93676c88 (v4.2) when we raised the name limit to 4096 to match the NBD
    string limit.  (That commit also failed to change the magic number
    4096 in nbd_negotiate_send_rep_err to the just-introduced named
    constant.)  So with that commit, long client names appended to server
    text can now trigger the assertion, and thus be used as a denial of
    service attack against a server.  As a mitigating factor, if the
    server requires TLS, the client cannot trigger the problematic paths
    unless it first supplies TLS credentials, and such trusted clients are
    less likely to try to intentionally crash the server.
    
    We may later want to further sanitize the user-supplied strings we
    place into our error messages, such as scrubbing out control
    characters, but that is less important to the CVE fix, so it can be a
    later patch to the new nbd_sanitize_name.
    
    Consideration was given to changing the assertion in
    nbd_negotiate_send_rep_verr to instead merely log a server error and
    truncate the message, to avoid leaving a latent path that could
    trigger a future CVE DoS on any new error message.  However, this
    merely complicates the code for something that is already (correctly)
    flagging coding errors, and now that we are aware of the long message
    pitfall, we are less likely to introduce such errors in the future,
    which would make such error handling dead code.
    
    Reported-by: Xueqiang Wei <xuwei@redhat.com>
    CC: qemu-stable@nongnu.org
    Fixes: https://bugzilla.redhat.com/1843684 CVE-2020-10761
    Fixes: 93676c88d7
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200610163741.3745251-2-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    (cherry picked from commit 5c4fe018c025740fef4a0a4421e8162db0c3eefd)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 nbd/server.c               | 23 ++++++++++++++++++++---
 tests/qemu-iotests/143     |  4 ++++
 tests/qemu-iotests/143.out |  2 ++
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 02b1ed0801..20754e9ebc 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -217,7 +217,7 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
 
     msg = g_strdup_vprintf(fmt, va);
     len = strlen(msg);
-    assert(len < 4096);
+    assert(len < NBD_MAX_STRING_SIZE);
     trace_nbd_negotiate_send_rep_err(msg);
     ret = nbd_negotiate_send_rep_len(client, type, len, errp);
     if (ret < 0) {
@@ -231,6 +231,19 @@ nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
     return 0;
 }
 
+/*
+ * Return a malloc'd copy of @name suitable for use in an error reply.
+ */
+static char *
+nbd_sanitize_name(const char *name)
+{
+    if (strnlen(name, 80) < 80) {
+        return g_strdup(name);
+    }
+    /* XXX Should we also try to sanitize any control characters? */
+    return g_strdup_printf("%.80s...", name);
+}
+
 /* Send an error reply.
  * Return -errno on error, 0 on success. */
 static int GCC_FMT_ATTR(4, 5)
@@ -595,9 +608,11 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
 
     exp = nbd_export_find(name);
     if (!exp) {
+        g_autofree char *sane_name = nbd_sanitize_name(name);
+
         return nbd_negotiate_send_rep_err(client, NBD_REP_ERR_UNKNOWN,
                                           errp, "export '%s' not present",
-                                          name);
+                                          sane_name);
     }
 
     /* Don't bother sending NBD_INFO_NAME unless client requested it */
@@ -995,8 +1010,10 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
 
     meta->exp = nbd_export_find(export_name);
     if (meta->exp == NULL) {
+        g_autofree char *sane_name = nbd_sanitize_name(export_name);
+
         return nbd_opt_drop(client, NBD_REP_ERR_UNKNOWN, errp,
-                            "export '%s' not present", export_name);
+                            "export '%s' not present", sane_name);
     }
 
     ret = nbd_opt_read(client, &nb_queries, sizeof(nb_queries), errp);
diff --git a/tests/qemu-iotests/143 b/tests/qemu-iotests/143
index f649b36195..d2349903b1 100755
--- a/tests/qemu-iotests/143
+++ b/tests/qemu-iotests/143
@@ -58,6 +58,10 @@ _send_qemu_cmd $QEMU_HANDLE \
 $QEMU_IO_PROG -f raw -c quit \
     "nbd+unix:///no_such_export?socket=$SOCK_DIR/nbd" 2>&1 \
     | _filter_qemu_io | _filter_nbd
+# Likewise, with longest possible name permitted in NBD protocol
+$QEMU_IO_PROG -f raw -c quit \
+    "nbd+unix:///$(printf %4096d 1 | tr ' ' a)?socket=$SOCK_DIR/nbd" 2>&1 \
+    | _filter_qemu_io | _filter_nbd | sed 's/aaaa*aa/aa--aa/'
 
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'quit' }" \
diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out
index 1f4001c601..fc9c0a761f 100644
--- a/tests/qemu-iotests/143.out
+++ b/tests/qemu-iotests/143.out
@@ -5,6 +5,8 @@ QA output created by 143
 {"return": {}}
 qemu-io: can't open device nbd+unix:///no_such_export?socket=SOCK_DIR/nbd: Requested export not available
 server reported: export 'no_such_export' not present
+qemu-io: can't open device nbd+unix:///aa--aa1?socket=SOCK_DIR/nbd: Requested export not available
+server reported: export 'aa--aa...' not present
 { 'execute': 'quit' }
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8319.22156 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6w-00074o-Ss; Sat, 17 Oct 2020 14:23:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8319.22156; Sat, 17 Oct 2020 14:23:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn6w-00074g-PV; Sat, 17 Oct 2020 14:23:06 +0000
Received: by outflank-mailman (input) for mailman id 8319;
 Sat, 17 Oct 2020 14:23:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn6v-00074X-Oy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3aee8564-4241-47d4-b651-40f7f19ad5b9;
 Sat, 17 Oct 2020 14:23:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6u-0005IY-QO
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn6u-0005Eq-PW
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn6v-00074X-Oy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:05 +0000
X-Inumbo-ID: 3aee8564-4241-47d4-b651-40f7f19ad5b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3aee8564-4241-47d4-b651-40f7f19ad5b9;
	Sat, 17 Oct 2020 14:23:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7Garp8NhkISrNkF8mK7BKv1AH+cCcKaYMbs13mKQsVE=; b=rLgAg8lOID+JzNDcJgM3GNCiRv
	7hDPRS8ch/yN5PG4dRknibOoXG882PeQBNuNfxbDPdvkog8s/mWhn2KQHSdyrzRX20Zp5tgY98MZy
	bl9B4Qjnf3vCGkoy58YWYFVR1jLPMGm0FTsGGUgWV/2FraQ+JJft45m90nnuMgqLJyY8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6u-0005IY-QO
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn6u-0005Eq-PW
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: fix free page hinting without an iothread
Message-Id: <E1kTn6u-0005Eq-PW@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:04 +0000

commit 99458fbb5649f16a8a5a61774d4e9b9bf13d2d50
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:37 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:10 2020 -0500

    virtio-balloon: fix free page hinting without an iothread
    
    In case we don't have an iothread, we mark the feature as abscent but
    still add the queue. 'free_page_bh' remains set to NULL.
    
    qemu-system-i386 \
            -M microvm \
            -nographic \
            -device virtio-balloon-device,free-page-hint=true \
            -nographic \
            -display none \
            -monitor none \
            -serial none \
            -qtest stdio
    
    Doing a "write 0xc0000e30 0x24
    0x030000000300000003000000030000000300000003000000030000000300000003000000"
    
    We will trigger a SEGFAULT. Let's move the check and bail out.
    
    While at it, move the static initializations to instance_init().
    free_page_report_status and block_iothread are implicitly set to the
    right values (0/false) already, so drop the initialization.
    
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-2-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 12fc8903a8ee09fb5f642de82699a0b211e1b5a7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a4729f7fc9..ef499e1b3b 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -789,6 +789,13 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_FREE_PAGE_HINT) &&
+        !s->iothread) {
+        error_setg(errp, "'free-page-hint' requires 'iothread' to be set");
+        virtio_cleanup(vdev);
+        return;
+    }
+
     s->ivq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
     s->dvq = virtio_add_queue(vdev, 128, virtio_balloon_handle_output);
     s->svq = virtio_add_queue(vdev, 128, virtio_balloon_receive_stats);
@@ -797,24 +804,11 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
-        s->free_page_report_cmd_id =
-                           VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-        s->free_page_report_notify.notify =
-                                       virtio_balloon_free_page_report_notify;
         precopy_add_notifier(&s->free_page_report_notify);
-        if (s->iothread) {
-            object_ref(OBJECT(s->iothread));
-            s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
-                                       virtio_ballloon_get_free_page_hints, s);
-            qemu_mutex_init(&s->free_page_lock);
-            qemu_cond_init(&s->free_page_cond);
-            s->block_iothread = false;
-        } else {
-            /* Simply disable this feature if the iothread wasn't created. */
-            s->host_features &= ~(1 << VIRTIO_BALLOON_F_FREE_PAGE_HINT);
-            virtio_error(vdev, "iothread is missing");
-        }
+
+        object_ref(OBJECT(s->iothread));
+        s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
+                                     virtio_ballloon_get_free_page_hints, s);
     }
     reset_stats(s);
 }
@@ -892,6 +886,11 @@ static void virtio_balloon_instance_init(Object *obj)
 {
     VirtIOBalloon *s = VIRTIO_BALLOON(obj);
 
+    qemu_mutex_init(&s->free_page_lock);
+    qemu_cond_init(&s->free_page_cond);
+    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s, NULL);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8320.22160 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn76-00076X-Tx; Sat, 17 Oct 2020 14:23:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8320.22160; Sat, 17 Oct 2020 14:23:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn76-00076P-RA; Sat, 17 Oct 2020 14:23:16 +0000
Received: by outflank-mailman (input) for mailman id 8320;
 Sat, 17 Oct 2020 14:23:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn75-00076G-U6
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8aead3f0-3570-41f8-801a-75eab1a1a91b;
 Sat, 17 Oct 2020 14:23:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn74-0005JK-Ti
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn74-0005FW-Sl
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn75-00076G-U6
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:15 +0000
X-Inumbo-ID: 8aead3f0-3570-41f8-801a-75eab1a1a91b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8aead3f0-3570-41f8-801a-75eab1a1a91b;
	Sat, 17 Oct 2020 14:23:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9+eexImDR5U39aTfemUYhQNPKXlsJP9C/OLk2JizhHg=; b=3aRY+FFAvNtOHi6HRRCFl1PPjw
	2eYLWevtgXMcehfqGOjUQNfBOU2WtVdnpzHPiXxJtgBMAYWfiH/H0xl7iGsS+ij713MSWEcAOJify
	PVa4AKzRPhPUV9YJqXAongU0q90pLISN5qPZHB9urJGy7hIiT6KbYthza50tOTZEArwA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn74-0005JK-Ti
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn74-0005FW-Sl
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: fix free page hinting check on unrealize
Message-Id: <E1kTn74-0005FW-Sl@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:14 +0000

commit 945d9273c8234dcc2f301059fe294df5e722b055
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:38 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:15 2020 -0500

    virtio-balloon: fix free page hinting check on unrealize
    
    Checking against guest features is wrong. We allocated data structures
    based on host features. We can rely on "free_page_bh" as an indicator
    whether to un-do stuff instead.
    
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-3-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 49b01711b8eb3796c6904c7f85d2431572cfe54f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index ef499e1b3b..3e3b5ff0f8 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -818,7 +818,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOBalloon *s = VIRTIO_BALLOON(dev);
 
-    if (virtio_balloon_free_page_support(s)) {
+    if (s->free_page_bh) {
         qemu_bh_delete(s->free_page_bh);
         virtio_balloon_free_page_stop(s);
         precopy_remove_notifier(&s->free_page_report_notify);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8321.22164 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7G-00078H-Vj; Sat, 17 Oct 2020 14:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8321.22164; Sat, 17 Oct 2020 14:23:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7G-000789-Sf; Sat, 17 Oct 2020 14:23:26 +0000
Received: by outflank-mailman (input) for mailman id 8321;
 Sat, 17 Oct 2020 14:23:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn7F-00077u-Oq
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27f692fe-a48c-4d17-8c51-2ab88390eb2c;
 Sat, 17 Oct 2020 14:23:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7F-0005JR-0X
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7E-0005G1-Vy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn7F-00077u-Oq
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:25 +0000
X-Inumbo-ID: 27f692fe-a48c-4d17-8c51-2ab88390eb2c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27f692fe-a48c-4d17-8c51-2ab88390eb2c;
	Sat, 17 Oct 2020 14:23:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GcX9vwWFHzHGKiSIyRESeQspC/FG9deSpCBsUHMFiRE=; b=3B+aIRQ0mZI/48Lhsi7jVPSWmZ
	/5083B3KuPMYhYy0XvDgxblfXxKvKo4ZsDH9r+3406ZXI5+Q1J1Gj71KSV2aGq21VuXlSqgue0l9N
	X9XTaNFK6m2CCWkBlKn5R1ux6KmrbdlzJy7IColwApIb9py4gVfXZLiRLSiVhWAI1zp0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7F-0005JR-0X
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7E-0005G1-Vy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: unref the iothread when unrealizing
Message-Id: <E1kTn7E-0005G1-Vy@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:24 +0000

commit d1cba8ca6039a31c7b75e308cb0b1f3522050aa9
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Wed May 20 12:04:39 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:21 2020 -0500

    virtio-balloon: unref the iothread when unrealizing
    
    We took a reference when realizing, so let's drop that reference when
    unrealizing.
    
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Cc: qemu-stable@nongnu.org
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200520100439.19872-4-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 105aef9c9479786d27c1c45c9b0b1fa03dc46be3)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 3e3b5ff0f8..e20f90dad4 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -820,6 +820,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
 
     if (s->free_page_bh) {
         qemu_bh_delete(s->free_page_bh);
+        object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
         precopy_remove_notifier(&s->free_page_report_notify);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8322.22168 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7R-00079d-0q; Sat, 17 Oct 2020 14:23:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8322.22168; Sat, 17 Oct 2020 14:23:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7Q-00079V-UB; Sat, 17 Oct 2020 14:23:36 +0000
Received: by outflank-mailman (input) for mailman id 8322;
 Sat, 17 Oct 2020 14:23:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn7Q-00079L-5I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 539a8358-34a2-41d4-a083-c22e0ef7d229;
 Sat, 17 Oct 2020 14:23:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7P-0005JY-41
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7P-0005Gc-3I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn7Q-00079L-5I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:36 +0000
X-Inumbo-ID: 539a8358-34a2-41d4-a083-c22e0ef7d229
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 539a8358-34a2-41d4-a083-c22e0ef7d229;
	Sat, 17 Oct 2020 14:23:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1CYcUIRQSZn4unX6VtxG74JIsQY+cka3b/KqPI3TqAo=; b=X4WZYIQul9KMPLzz0+HGHe6Gsk
	J9da61q0mijAcJxZDLHxbbsnZbryyMD/XWhPhnCsJMC2iDCNXOywnP/6B7yDZiB9QlOKRVLLKEA01
	68/XAjFkVfzh4ll1JSi+LPms84CMY3Yyb68XsTzkOX6jYfSmS3IWivhJZXeYXIWqxzNo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7P-0005JY-41
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7P-0005Gc-3I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] block: Call attention to truncation of long NBD exports
Message-Id: <E1kTn7P-0005Gc-3I@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:35 +0000

commit 4cc0a28a6ed7b7746ea074c4ef60e39212fe1f11
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 8 13:26:38 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:27 2020 -0500

    block: Call attention to truncation of long NBD exports
    
    Commit 93676c88 relaxed our NBD client code to request export names up
    to the NBD protocol maximum of 4096 bytes without NUL terminator, even
    though the block layer can't store anything longer than 4096 bytes
    including NUL terminator for display to the user.  Since this means
    there are some export names where we have to truncate things, we can
    at least try to make the truncation a bit more obvious for the user.
    Note that in spite of the truncated display name, we can still
    communicate with an NBD server using such a long export name; this was
    deemed nicer than refusing to even connect to such a server (since the
    server may not be under our control, and since determining our actual
    length limits gets tricky when nbd://host:port/export and
    nbd+unix:///export?socket=/path are themselves variable-length
    expansions beyond the export name but count towards the block layer
    name length).
    
    Reported-by: Xueqiang Wei <xuwei@redhat.com>
    Fixes: https://bugzilla.redhat.com/1843684
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200610163741.3745251-3-eblake@redhat.com>
    (cherry picked from commit 5c86bdf1208916ece0b87e1151c9b48ee54faa3e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block.c     |  7 +++++--
 block/nbd.c | 21 +++++++++++++--------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/block.c b/block.c
index 2e3905c99e..e7e0a92536 100644
--- a/block.c
+++ b/block.c
@@ -6710,8 +6710,11 @@ void bdrv_refresh_filename(BlockDriverState *bs)
         pstrcpy(bs->filename, sizeof(bs->filename), bs->exact_filename);
     } else {
         QString *json = qobject_to_json(QOBJECT(bs->full_open_options));
-        snprintf(bs->filename, sizeof(bs->filename), "json:%s",
-                 qstring_get_str(json));
+        if (snprintf(bs->filename, sizeof(bs->filename), "json:%s",
+                     qstring_get_str(json)) >= sizeof(bs->filename)) {
+            /* Give user a hint if we truncated things. */
+            strcpy(bs->filename + sizeof(bs->filename) - 4, "...");
+        }
         qobject_unref(json);
     }
 }
diff --git a/block/nbd.c b/block/nbd.c
index 2160859f64..bfc0be6af6 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1986,6 +1986,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
 {
     BDRVNBDState *s = bs->opaque;
     const char *host = NULL, *port = NULL, *path = NULL;
+    size_t len = 0;
 
     if (s->saddr->type == SOCKET_ADDRESS_TYPE_INET) {
         const InetSocketAddress *inet = &s->saddr->u.inet;
@@ -1998,17 +1999,21 @@ static void nbd_refresh_filename(BlockDriverState *bs)
     } /* else can't represent as pseudo-filename */
 
     if (path && s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd+unix:///%s?socket=%s", s->export, path);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd+unix:///%s?socket=%s", s->export, path);
     } else if (path && !s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd+unix://?socket=%s", path);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd+unix://?socket=%s", path);
     } else if (host && s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd://%s:%s/%s", host, port, s->export);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd://%s:%s/%s", host, port, s->export);
     } else if (host && !s->export) {
-        snprintf(bs->exact_filename, sizeof(bs->exact_filename),
-                 "nbd://%s:%s", host, port);
+        len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
+                       "nbd://%s:%s", host, port);
+    }
+    if (len > sizeof(bs->exact_filename)) {
+        /* Name is too long to represent exactly, so leave it empty. */
+        bs->exact_filename[0] = '\0';
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8324.22171 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7c-0007B2-2c; Sat, 17 Oct 2020 14:23:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8324.22171; Sat, 17 Oct 2020 14:23:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7b-0007Au-Vt; Sat, 17 Oct 2020 14:23:47 +0000
Received: by outflank-mailman (input) for mailman id 8324;
 Sat, 17 Oct 2020 14:23:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn7a-0007Ad-At
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 94dcc060-8fc0-4a0c-acb3-c519c115cf03;
 Sat, 17 Oct 2020 14:23:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7Z-0005Jh-7M
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7Z-0005HI-6U
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn7a-0007Ad-At
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:46 +0000
X-Inumbo-ID: 94dcc060-8fc0-4a0c-acb3-c519c115cf03
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 94dcc060-8fc0-4a0c-acb3-c519c115cf03;
	Sat, 17 Oct 2020 14:23:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gD2VqImqA/G6vLd7jkTpmnAKyiqWw186Fy5Gh7cQ1OM=; b=6bQayo/mHxiYYEtzoj2HbIipo9
	7XAgc3XcHh6q5yo3vUbD9FbiF4MUWcC4CtAzgAlF6K0hJC0YuBaPVBofPQaJ2nBGrk8Q1quIPgU6E
	ZhJuIGf7PQ/0YFcsftMXeO14WOQiBIETw7W9NKtYSKO4STw6M1F1LodGgeKHbuNWEdsU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7Z-0005Jh-7M
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7Z-0005HI-6U
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] 9pfs: local: ignore O_NOATIME if we don't have permissions
Message-Id: <E1kTn7Z-0005HI-6U@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:45 +0000

commit e37ba5c637cf55d2f25713f6bcf51052bb2089d6
Author:     Omar Sandoval <osandov@fb.com>
AuthorDate: Thu May 14 08:06:43 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:33 2020 -0500

    9pfs: local: ignore O_NOATIME if we don't have permissions
    
    QEMU's local 9pfs server passes through O_NOATIME from the client. If
    the QEMU process doesn't have permissions to use O_NOATIME (namely, it
    does not own the file nor have the CAP_FOWNER capability), the open will
    fail. This causes issues when from the client's point of view, it
    believes it has permissions to use O_NOATIME (e.g., a process running as
    root in the virtual machine). Additionally, overlayfs on Linux opens
    files on the lower layer using O_NOATIME, so in this case a 9pfs mount
    can't be used as a lower layer for overlayfs (cf.
    https://github.com/osandov/drgn/blob/dabfe1971951701da13863dbe6d8a1d172ad9650/vmtest/onoatimehack.c
    and https://github.com/NixOS/nixpkgs/issues/54509).
    
    Luckily, O_NOATIME is effectively a hint, and is often ignored by, e.g.,
    network filesystems. open(2) notes that O_NOATIME "may not be effective
    on all filesystems. One example is NFS, where the server maintains the
    access time." This means that we can honor it when possible but fall
    back to ignoring it.
    
    Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Signed-off-by: Omar Sandoval <osandov@fb.com>
    Message-Id: <e9bee604e8df528584693a4ec474ded6295ce8ad.1587149256.git.osandov@fb.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit a5804fcf7b22fc7d1f9ec794dd284c7d504bd16b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p-util.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/9pfs/9p-util.h b/hw/9pfs/9p-util.h
index 79ed6b233e..546f46dc7d 100644
--- a/hw/9pfs/9p-util.h
+++ b/hw/9pfs/9p-util.h
@@ -37,9 +37,22 @@ static inline int openat_file(int dirfd, const char *name, int flags,
 {
     int fd, serrno, ret;
 
+again:
     fd = openat(dirfd, name, flags | O_NOFOLLOW | O_NOCTTY | O_NONBLOCK,
                 mode);
     if (fd == -1) {
+        if (errno == EPERM && (flags & O_NOATIME)) {
+            /*
+             * The client passed O_NOATIME but we lack permissions to honor it.
+             * Rather than failing the open, fall back without O_NOATIME. This
+             * doesn't break the semantics on the client side, as the Linux
+             * open(2) man page notes that O_NOATIME "may not be effective on
+             * all filesystems". In particular, NFS and other network
+             * filesystems ignore it entirely.
+             */
+            flags &= ~O_NOATIME;
+            goto again;
+        }
         return -1;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:23:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:23:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8325.22175 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7l-0007CB-4M; Sat, 17 Oct 2020 14:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8325.22175; Sat, 17 Oct 2020 14:23:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7l-0007C3-1D; Sat, 17 Oct 2020 14:23:57 +0000
Received: by outflank-mailman (input) for mailman id 8325;
 Sat, 17 Oct 2020 14:23:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn7k-0007Bv-6S
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7c4d4a7c-c64e-45a0-a53a-331adf4b3155;
 Sat, 17 Oct 2020 14:23:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7j-0005Jy-Db
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7j-0005Hs-9q
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn7k-0007Bv-6S
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:56 +0000
X-Inumbo-ID: 7c4d4a7c-c64e-45a0-a53a-331adf4b3155
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7c4d4a7c-c64e-45a0-a53a-331adf4b3155;
	Sat, 17 Oct 2020 14:23:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WDUiAV9cMdU3tH+hn9OHBOQwSOFwfEfIaw2s7CgA6FI=; b=eDcDBEVQAMIqpVYKb+oOZ2HGzT
	nXQkDf5b8kJnA1VpCRLfAI5xWRFQ3ld6WE7bsZ58mWHCrFi87V2YrVvGs9YK1BO+PWy3xaZSjBLBe
	j0k1PrKD48juJ7B1Liak5zaaX/UVK2DfOA5Q+mnHAVvgjmD5760mZgqYJAyBz3NIpG2I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7j-0005Jy-Db
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7j-0005Hs-9q
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:23:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] 9pfs: include linux/limits.h for XATTR_SIZE_MAX
Message-Id: <E1kTn7j-0005Hs-9q@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:23:55 +0000

commit 5bfdf41d7c12335fd44645cdfa2eb04eb0d15b5b
Author:     Dan Robertson <dan@dlrobertson.com>
AuthorDate: Mon May 25 10:38:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 18:56:38 2020 -0500

    9pfs: include linux/limits.h for XATTR_SIZE_MAX
    
    linux/limits.h should be included for the XATTR_SIZE_MAX definition used
    by v9fs_xattrcreate.
    
    Fixes: 3b79ef2cf488 ("9pfs: limit xattr size in xattrcreate")
    Signed-off-by: Dan Robertson <dan@dlrobertson.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200515203015.7090-2-dan@dlrobertson.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 03556ea920b23c466ce7c1283199033de33ee671)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 9e046f7acb..3301e82eb6 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -28,6 +28,7 @@
 #include "sysemu/qtest.h"
 #include "qemu/xxhash.h"
 #include <math.h>
+#include <linux/limits.h>
 
 int open_fd_hw;
 int total_open_fd;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8326.22182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7w-0007Dm-8C; Sat, 17 Oct 2020 14:24:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8326.22182; Sat, 17 Oct 2020 14:24:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn7w-0007De-44; Sat, 17 Oct 2020 14:24:08 +0000
Received: by outflank-mailman (input) for mailman id 8326;
 Sat, 17 Oct 2020 14:24:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn7u-0007DV-S0
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 334d9158-ff5e-480c-8eca-f877c0fbf4ad;
 Sat, 17 Oct 2020 14:24:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7t-0005KL-GY
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn7t-0005IZ-Ft
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn7u-0007DV-S0
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:06 +0000
X-Inumbo-ID: 334d9158-ff5e-480c-8eca-f877c0fbf4ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 334d9158-ff5e-480c-8eca-f877c0fbf4ad;
	Sat, 17 Oct 2020 14:24:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6VaBLo2bQv1yykhpYvYcg2wM1mviOkuB4XdJiH1h4J8=; b=Tg35+tOx8E9HgZTVWOi07kqMH5
	iFtMeZGULt2oE/beHG7Eu+ajYXgBSCw9n6cNsv/dfcdTdkOaA5V8G+VRjVVmxrhAQoeQOCeAIEjak
	8pf2YDQHKIfAZXLXVXYt/djpKf5hQuBFqK1BKUv5xgOAUn//2cWjoB+JKbcN9gLmU91g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7t-0005KL-GY
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn7t-0005IZ-Ft
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] xen-9pfs: Fix log messages of reply errors
Message-Id: <E1kTn7t-0005IZ-Ft@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:05 +0000

commit f56a86ad8d5954f21e1f11634a9df1f3d2856152
Author:     Christian Schoenebeck <qemu_oss@crudebyte.com>
AuthorDate: Thu May 14 08:06:43 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:10:58 2020 -0500

    xen-9pfs: Fix log messages of reply errors
    
    If delivery of some 9pfs response fails for some reason, log the
    error message by mentioning the 9P protocol reply type, not by
    client's request type. The latter could be misleading that the
    error occurred already when handling the request input.
    
    Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Message-Id: <ad0e5a9b6abde52502aa40b30661d29aebe1590a.1589132512.git.qemu_oss@crudebyte.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 9bbb7e0fe081efff2e41f8517c256b72a284fe9b)
    *prereq for cf45183b718
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/xen-9p-backend.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 18fe5b7c92..f04caabfe5 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -137,7 +137,8 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
     ret = v9fs_iov_vmarshal(in_sg, num, offset, 0, fmt, ap);
     if (ret < 0) {
         xen_pv_printf(&xen_9pfs->xendev, 0,
-                      "Failed to encode VirtFS request type %d\n", pdu->id + 1);
+                      "Failed to encode VirtFS reply type %d\n",
+                      pdu->id + 1);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
@@ -201,9 +202,9 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
 
     buf_size = iov_size(ring->sg, num);
     if (buf_size  < P9_IOHDRSZ) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
-                "needs %zu bytes, buffer has %zu, less than minimum\n",
-                pdu->id, *size, buf_size);
+        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs "
+                      "%zu bytes, buffer has %zu, less than minimum\n",
+                      pdu->id + 1, *size, buf_size);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8327.22184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn86-0007F2-8u; Sat, 17 Oct 2020 14:24:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8327.22184; Sat, 17 Oct 2020 14:24:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn86-0007Eu-5c; Sat, 17 Oct 2020 14:24:18 +0000
Received: by outflank-mailman (input) for mailman id 8327;
 Sat, 17 Oct 2020 14:24:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn84-0007El-OM
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8acb70b0-5271-4616-9f58-befd4b871470;
 Sat, 17 Oct 2020 14:24:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn83-0005Kx-Jm
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn83-0005J1-J8
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn84-0007El-OM
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:16 +0000
X-Inumbo-ID: 8acb70b0-5271-4616-9f58-befd4b871470
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8acb70b0-5271-4616-9f58-befd4b871470;
	Sat, 17 Oct 2020 14:24:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sF3MdWr2cClUowq47iXdGw5CA8NXOBzR/iOqf61CRu8=; b=n1OtTtazGTz7VnxxdpFlPrpinv
	6bM0TwgZ0GGVFVDkUon8A4jLJlLTq/D2+lXGVdXbjaUf1KXP7mvSb6bhmBd3o6vhSoGmDeRH2cBgX
	CMt3zaMa+ZfVHEu+AyPs6ZFnp8TTkKHB2kdpWpLozGDauLsQttmW249wIlsC/BA9j0PE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn83-0005Kx-Jm
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn83-0005J1-J8
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] Revert "9p: init_in_iov_from_pdu can truncate the size"
Message-Id: <E1kTn83-0005J1-J8@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:15 +0000

commit b38d9cada46ba6229ed6c87bf777cecb24af0c6b
Author:     Stefano Stabellini <stefano.stabellini@xilinx.com>
AuthorDate: Thu May 21 12:26:25 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:14 2020 -0500

    Revert "9p: init_in_iov_from_pdu can truncate the size"
    
    This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7.
    It causes https://bugs.launchpad.net/bugs/1877688.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200521192627.15259-1-sstabellini@kernel.org>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit cf45183b718f02b1369e18c795dc51bc1821245d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/9p.c               | 33 +++++++++++----------------------
 hw/9pfs/9p.h               |  2 +-
 hw/9pfs/virtio-9p-device.c | 11 ++++-------
 hw/9pfs/xen-9p-backend.c   | 15 ++++++---------
 4 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 3301e82eb6..1b729af6e8 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2103,29 +2103,22 @@ out_nofid:
  * with qemu_iovec_destroy().
  */
 static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
-                                    size_t skip, size_t *size,
+                                    size_t skip, size_t size,
                                     bool is_write)
 {
     QEMUIOVector elem;
     struct iovec *iov;
     unsigned int niov;
-    size_t alloc_size = *size + skip;
 
     if (is_write) {
-        pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, alloc_size);
+        pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, size + skip);
     } else {
-        pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, &alloc_size);
-    }
-
-    if (alloc_size < skip) {
-        *size = 0;
-    } else {
-        *size = alloc_size - skip;
+        pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, size + skip);
     }
 
     qemu_iovec_init_external(&elem, iov, niov);
     qemu_iovec_init(qiov, niov);
-    qemu_iovec_concat(qiov, &elem, skip, *size);
+    qemu_iovec_concat(qiov, &elem, skip, size);
 }
 
 static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
@@ -2133,14 +2126,15 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
 {
     ssize_t err;
     size_t offset = 7;
-    size_t read_count;
+    uint64_t read_count;
     QEMUIOVector qiov_full;
 
     if (fidp->fs.xattr.len < off) {
         read_count = 0;
-    } else if (fidp->fs.xattr.len - off < max_count) {
-        read_count = fidp->fs.xattr.len - off;
     } else {
+        read_count = fidp->fs.xattr.len - off;
+    }
+    if (read_count > max_count) {
         read_count = max_count;
     }
     err = pdu_marshal(pdu, offset, "d", read_count);
@@ -2149,7 +2143,7 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
     }
     offset += err;
 
-    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &read_count, false);
+    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, read_count, false);
     err = v9fs_pack(qiov_full.iov, qiov_full.niov, 0,
                     ((char *)fidp->fs.xattr.value) + off,
                     read_count);
@@ -2278,11 +2272,9 @@ static void coroutine_fn v9fs_read(void *opaque)
         QEMUIOVector qiov_full;
         QEMUIOVector qiov;
         int32_t len;
-        size_t size = max_count;
 
-        v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, &size, false);
+        v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, max_count, false);
         qemu_iovec_init(&qiov, qiov_full.niov);
-        max_count = size;
         do {
             qemu_iovec_reset(&qiov);
             qemu_iovec_concat(&qiov, &qiov_full, count, qiov_full.size - count);
@@ -2533,7 +2525,6 @@ static void coroutine_fn v9fs_write(void *opaque)
     int32_t len = 0;
     int32_t total = 0;
     size_t offset = 7;
-    size_t size;
     V9fsFidState *fidp;
     V9fsPDU *pdu = opaque;
     V9fsState *s = pdu->s;
@@ -2546,9 +2537,7 @@ static void coroutine_fn v9fs_write(void *opaque)
         return;
     }
     offset += err;
-    size = count;
-    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &size, true);
-    count = size;
+    v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true);
     trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov);
 
     fidp = get_fid(pdu, fid);
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index c381fe091a..656527beb9 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -436,7 +436,7 @@ struct V9fsTransport {
     ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
                                   va_list ap);
     void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t *size);
+                                        unsigned int *pniov, size_t size);
     void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
                                          unsigned int *pniov, size_t size);
     void        (*push_and_notify)(V9fsPDU *pdu);
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 536447a355..f821236356 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -147,22 +147,19 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
 }
 
 static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t *size)
+                                        unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
     VirtQueueElement *elem = v->elems[pdu->idx];
     size_t buf_size = iov_size(elem->in_sg, elem->in_num);
 
-    if (buf_size < P9_IOHDRSZ) {
+    if (buf_size < size) {
         VirtIODevice *vdev = VIRTIO_DEVICE(v);
 
         virtio_error(vdev,
-                     "VirtFS reply type %d needs %zu bytes, buffer has %zu, less than minimum",
-                     pdu->id + 1, *size, buf_size);
-    }
-    if (buf_size < *size) {
-        *size = buf_size;
+                     "VirtFS reply type %d needs %zu bytes, buffer has %zu",
+                     pdu->id + 1, size, buf_size);
     }
 
     *piov = elem->in_sg;
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index f04caabfe5..fc197f6c8a 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -188,7 +188,7 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
 static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
                                           struct iovec **piov,
                                           unsigned int *pniov,
-                                          size_t *size)
+                                          size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -198,19 +198,16 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
     g_free(ring->sg);
 
     ring->sg = g_new0(struct iovec, 2);
-    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, *size);
+    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
 
     buf_size = iov_size(ring->sg, num);
-    if (buf_size  < P9_IOHDRSZ) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs "
-                      "%zu bytes, buffer has %zu, less than minimum\n",
-                      pdu->id + 1, *size, buf_size);
+    if (buf_size  < size) {
+        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
+                "needs %zu bytes, buffer has %zu\n", pdu->id, size,
+                buf_size);
         xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
         xen_9pfs_disconnect(&xen_9pfs->xendev);
     }
-    if (buf_size  < *size) {
-        *size = buf_size;
-    }
 
     *piov = ring->sg;
     *pniov = num;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8328.22188 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8G-0007Gp-A7; Sat, 17 Oct 2020 14:24:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8328.22188; Sat, 17 Oct 2020 14:24:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8G-0007Gh-74; Sat, 17 Oct 2020 14:24:28 +0000
Received: by outflank-mailman (input) for mailman id 8328;
 Sat, 17 Oct 2020 14:24:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn8E-0007GY-ID
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 97f2c87a-0dae-4a28-bc53-202b82551b3b;
 Sat, 17 Oct 2020 14:24:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8D-0005L7-N5
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8D-0005Jb-M5
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn8E-0007GY-ID
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:26 +0000
X-Inumbo-ID: 97f2c87a-0dae-4a28-bc53-202b82551b3b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 97f2c87a-0dae-4a28-bc53-202b82551b3b;
	Sat, 17 Oct 2020 14:24:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yg3EaaXsZIF8jUafbazJUdIs3WhbMD4UGP+oiBFCUJY=; b=WJADZEOFuwl/5CTxHtA9E0wn6M
	RAaROsOF0wyqFpXdwgBsb/uSTtqayasf9K54/rxa0iAABho1GGlLcu0LeewotkAg1ytv57SvImq07
	tfxeOWmVVNMsOCOl4egDr8Q+rBUdF8i7NgDkBFqJh2LXAEB/rHxC0/I+Yexrp4NW4vPI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8D-0005L7-N5
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8D-0005Jb-M5
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] xen/9pfs: yield when there isn't enough room on the ring
Message-Id: <E1kTn8D-0005Jb-M5@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:25 +0000

commit cb84d9d353d40dbcd02fd8ff2c83971ecac0e65b
Author:     Stefano Stabellini <stefano.stabellini@xilinx.com>
AuthorDate: Thu May 21 12:26:26 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:22 2020 -0500

    xen/9pfs: yield when there isn't enough room on the ring
    
    Instead of truncating replies, which is problematic, wait until the
    client reads more data and frees bytes on the reply ring.
    
    Do that by calling qemu_coroutine_yield(). The corresponding
    qemu_coroutine_enter_if_inactive() is called from xen_9pfs_bh upon
    receiving the next notification from the client.
    
    We need to be careful to avoid races in case xen_9pfs_bh and the
    coroutine are both active at the same time. In xen_9pfs_bh, wait until
    either the critical section is over (ring->co == NULL) or until the
    coroutine becomes inactive (qemu_coroutine_yield() was called) before
    continuing. Then, simply wake up the coroutine if it is inactive.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
    Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
    Message-Id: <20200521192627.15259-2-sstabellini@kernel.org>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit a4c4d462729466c4756bac8a0a8d77eb63b21ef7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/xen-9p-backend.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index fc197f6c8a..3c84c86ab8 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -37,6 +37,7 @@ typedef struct Xen9pfsRing {
 
     struct iovec *sg;
     QEMUBH *bh;
+    Coroutine *co;
 
     /* local copies, so that we can read/write PDU data directly from
      * the ring */
@@ -198,16 +199,20 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
     g_free(ring->sg);
 
     ring->sg = g_new0(struct iovec, 2);
-    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
+    ring->co = qemu_coroutine_self();
+    /* make sure other threads see ring->co changes before continuing */
+    smp_wmb();
 
+again:
+    xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size);
     buf_size = iov_size(ring->sg, num);
     if (buf_size  < size) {
-        xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d"
-                "needs %zu bytes, buffer has %zu\n", pdu->id, size,
-                buf_size);
-        xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing);
-        xen_9pfs_disconnect(&xen_9pfs->xendev);
+        qemu_coroutine_yield();
+        goto again;
     }
+    ring->co = NULL;
+    /* make sure other threads see ring->co changes before continuing */
+    smp_wmb();
 
     *piov = ring->sg;
     *pniov = num;
@@ -292,6 +297,20 @@ static int xen_9pfs_receive(Xen9pfsRing *ring)
 static void xen_9pfs_bh(void *opaque)
 {
     Xen9pfsRing *ring = opaque;
+    bool wait;
+
+again:
+    wait = ring->co != NULL && qemu_coroutine_entered(ring->co);
+    /* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
+    smp_rmb();
+    if (wait) {
+        cpu_relax();
+        goto again;
+    }
+
+    if (ring->co != NULL) {
+        qemu_coroutine_enter_if_inactive(ring->co);
+    }
     xen_9pfs_receive(ring);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8329.22192 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8Q-0007I6-CN; Sat, 17 Oct 2020 14:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8329.22192; Sat, 17 Oct 2020 14:24:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8Q-0007Hz-8h; Sat, 17 Oct 2020 14:24:38 +0000
Received: by outflank-mailman (input) for mailman id 8329;
 Sat, 17 Oct 2020 14:24:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn8O-0007Hm-Pk
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 40daec45-8c97-45bf-8aba-6990e8e56e9e;
 Sat, 17 Oct 2020 14:24:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8N-0005LG-QK
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8N-0005K7-PS
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn8O-0007Hm-Pk
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:36 +0000
X-Inumbo-ID: 40daec45-8c97-45bf-8aba-6990e8e56e9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 40daec45-8c97-45bf-8aba-6990e8e56e9e;
	Sat, 17 Oct 2020 14:24:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FZAINX5qdRSfE35VdTk9ebHx/4u31fI0TItGxNXZ4qc=; b=m1qrjCI5MtNQRx8L4qJKk6LXYy
	IMeWwdt3N+AcgxOIVKntWJNgxtAYTjWi9ks2MFI/ypeiwaUWw7Wnf8zrfcqdjj7rqJcE9kTyQjtHh
	8nmmzkQJ7FXTZUVC/xGAmFz+f6Pngd4PIvQqAW/Wl7b93+oZWxwA4UFRL1FDWk0fuhCk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8N-0005LG-QK
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8N-0005K7-PS
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] ati-vga: check mm_index before recursive call (CVE-2020-13800)
Message-Id: <E1kTn8N-0005K7-PS@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:35 +0000

commit 387a3ac89d5cc821c4064295122dc3183b6aca69
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jun 4 14:38:30 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:52 2020 -0500

    ati-vga: check mm_index before recursive call (CVE-2020-13800)
    
    While accessing VGA registers via ati_mm_read/write routines,
    a guest may set 's->regs.mm_index' such that it leads to infinite
    recursion. Check mm_index value to avoid such recursion. Log an
    error message for wrong values.
    
    Reported-by: Ren Ding <rding@gatech.edu>
    Reported-by: Hanqing Zhao <hanqing@gatech.edu>
    Reported-by: Yi Ren <c4tren@gmail.com>
    Message-id: 20200604090830.33885-1-ppandit@redhat.com
    Suggested-by: BALATON Zoltan <balaton@eik.bme.hu>
    Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit a98610c429d52db0937c1e48659428929835c455)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/display/ati.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/display/ati.c b/hw/display/ati.c
index 58ec8291d4..9228f1b242 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -285,8 +285,11 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
             if (idx <= s->vga.vram_size - size) {
                 val = ldn_le_p(s->vga.vram_ptr + idx, size);
             }
-        } else {
+        } else if (s->regs.mm_index > MM_DATA + 3) {
             val = ati_mm_read(s, s->regs.mm_index + addr - MM_DATA, size);
+        } else {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                "ati_mm_read: mm_index too small: %u\n", s->regs.mm_index);
         }
         break;
     case BIOS_0_SCRATCH ... BUS_CNTL - 1:
@@ -520,8 +523,11 @@ static void ati_mm_write(void *opaque, hwaddr addr,
             if (idx <= s->vga.vram_size - size) {
                 stn_le_p(s->vga.vram_ptr + idx, size, data);
             }
-        } else {
+        } else if (s->regs.mm_index > MM_DATA + 3) {
             ati_mm_write(s, s->regs.mm_index + addr - MM_DATA, data, size);
+        } else {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                "ati_mm_write: mm_index too small: %u\n", s->regs.mm_index);
         }
         break;
     case BIOS_0_SCRATCH ... BUS_CNTL - 1:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8330.22196 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8a-0007JI-Eg; Sat, 17 Oct 2020 14:24:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8330.22196; Sat, 17 Oct 2020 14:24:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8a-0007JA-B2; Sat, 17 Oct 2020 14:24:48 +0000
Received: by outflank-mailman (input) for mailman id 8330;
 Sat, 17 Oct 2020 14:24:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn8Y-0007Iz-Me
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4e205223-6340-4eb0-960c-ea2819109212;
 Sat, 17 Oct 2020 14:24:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8X-0005LQ-TG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8X-0005Ks-Sd
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn8Y-0007Iz-Me
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:46 +0000
X-Inumbo-ID: 4e205223-6340-4eb0-960c-ea2819109212
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4e205223-6340-4eb0-960c-ea2819109212;
	Sat, 17 Oct 2020 14:24:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VJDo/3ww5DF0THFioX1Gl+T4OKh00jgD7H5gMngittA=; b=pHkz4QzQe9Tbjle9SZCKnFUAi2
	EKHej9/vEfRAsKu/R9JDtV05TeKB3x+KzUqxxZlcXcdxF6UPVfja8H1j5bOTsu0WWxGkY+kFlq6sO
	DiH3rM6lhuUYrX1h1HtTjYTJqC0qNrACORPKxQMSHNtwp2u5LeiQUwhA8YW6UVakDz5o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8X-0005LQ-TG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8X-0005Ks-Sd
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] es1370: check total frame count against current frame
Message-Id: <E1kTn8X-0005Ks-Sd@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:45 +0000

commit dd506af071328eae57995eacc4aa4128c5f6d8c8
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Fri May 15 01:36:08 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:11:59 2020 -0500

    es1370: check total frame count against current frame
    
    A guest user may set channel frame count via es1370_write()
    such that, in es1370_transfer_audio(), total frame count
    'size' is lesser than the number of frames that are processed
    'cnt'.
    
        int cnt = d->frame_cnt >> 16;
        int size = d->frame_cnt & 0xffff;
    
    if (size < cnt), it results in incorrect calculations leading
    to OOB access issue(s). Add check to avoid it.
    
    Reported-by: Ren Ding <rding@gatech.edu>
    Reported-by: Hanqing Zhao <hanqing@gatech.edu>
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Message-id: 20200514200608.1744203-1-ppandit@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 369ff955a8497988d079c4e3fa1e93c2570c1c69)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/audio/es1370.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 89c4dabcd4..5f8a83ff56 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -643,6 +643,9 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     int csc_bytes = (csc + 1) << d->shift;
     int cnt = d->frame_cnt >> 16;
     int size = d->frame_cnt & 0xffff;
+    if (size < cnt) {
+        return;
+    }
     int left = ((size - cnt + 1) << 2) + d->leftover;
     int transferred = 0;
     int temp = MIN (max, MIN (left, csc_bytes));
@@ -651,7 +654,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     addr += (cnt << 2) + d->leftover;
 
     if (index == ADC_CHANNEL) {
-        while (temp) {
+        while (temp > 0) {
             int acquired, to_copy;
 
             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
@@ -669,7 +672,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     else {
         SWVoiceOut *voice = s->dac_voice[index];
 
-        while (temp) {
+        while (temp > 0) {
             int copied, to_copy;
 
             to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:24:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:24:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8331.22200 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8l-0007Kr-Hw; Sat, 17 Oct 2020 14:24:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8331.22200; Sat, 17 Oct 2020 14:24:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8l-0007Kk-Ex; Sat, 17 Oct 2020 14:24:59 +0000
Received: by outflank-mailman (input) for mailman id 8331;
 Sat, 17 Oct 2020 14:24:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn8j-0007KY-LH
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2ccc7b4c-d210-4414-b47a-114a1a681feb;
 Sat, 17 Oct 2020 14:24:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8i-0005LY-00
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8h-0005LR-Vc
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn8j-0007KY-LH
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:57 +0000
X-Inumbo-ID: 2ccc7b4c-d210-4414-b47a-114a1a681feb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2ccc7b4c-d210-4414-b47a-114a1a681feb;
	Sat, 17 Oct 2020 14:24:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hbX/duwgbflp/NSZf562tHp1ZmUdEbV+1sJVTRThOcM=; b=Y7HYpcMdphtSZpbLwsnzzbLXys
	32DecTiLHP1Eyq9HyQ8BgBbMoDXKhOBkeSdvBiNCPK0uQAK1SeVeH5pVKGAsU5lCTcDOcBd2YKVdb
	uEYPw0JKTIEjC3h9vOhMQWEKOFOgFPU1ky9ErofBg5qLFrfmLbIGGwKxEhkiSMoFaJt4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8i-0005LY-00
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8h-0005LR-Vc
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:24:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] Fix tulip breakage
Message-Id: <E1kTn8h-0005LR-Vc@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:24:55 +0000

commit d723a57acd985cf5c9fdf8a2761d1ca53a3179c0
Author:     Helge Deller <deller@gmx.de>
AuthorDate: Sun Apr 26 12:55:39 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:12:04 2020 -0500

    Fix tulip breakage
    
    The tulip network driver in a qemu-system-hppa emulation is broken in
    the sense that bigger network packages aren't received any longer and
    thus even running e.g. "apt update" inside the VM fails.
    
    The breakage was introduced by commit 8ffb7265af ("check frame size and
    r/w data length") which added checks to prevent accesses outside of the
    rx/tx buffers.
    
    But the new checks were implemented wrong. The variable rx_frame_len
    counts backwards, from rx_frame_size down to zero, and the variable len
    is never bigger than rx_frame_len, so accesses just can't happen and the
    checks are unnecessary.
    On the contrary the checks now prevented bigger packages to be moved
    into the rx buffers.
    
    This patch reverts the wrong checks and were sucessfully tested with a
    qemu-system-hppa emulation.
    
    Fixes: 8ffb7265af ("check frame size and r/w data length")
    Buglink: https://bugs.launchpad.net/bugs/1874539
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit d9b69640391618045949f7c500b87fc129f862ed)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/tulip.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/net/tulip.c b/hw/net/tulip.c
index 1295f51d07..44db56447c 100644
--- a/hw/net/tulip.c
+++ b/hw/net/tulip.c
@@ -171,9 +171,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
             len = s->rx_frame_len;
         }
 
-        if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
-            return;
-        }
         pci_dma_write(&s->dev, desc->buf_addr1, s->rx_frame +
             (s->rx_frame_size - s->rx_frame_len), len);
         s->rx_frame_len -= len;
@@ -186,9 +183,6 @@ static void tulip_copy_rx_bytes(TULIPState *s, struct tulip_descriptor *desc)
             len = s->rx_frame_len;
         }
 
-        if (s->rx_frame_len + len > sizeof(s->rx_frame)) {
-            return;
-        }
         pci_dma_write(&s->dev, desc->buf_addr2, s->rx_frame +
             (s->rx_frame_size - s->rx_frame_len), len);
         s->rx_frame_len -= len;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8332.22204 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8u-0007M0-JN; Sat, 17 Oct 2020 14:25:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8332.22204; Sat, 17 Oct 2020 14:25:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn8u-0007Ls-GU; Sat, 17 Oct 2020 14:25:08 +0000
Received: by outflank-mailman (input) for mailman id 8332;
 Sat, 17 Oct 2020 14:25:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn8t-0007Lk-2l
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f36fd3f3-422d-47d4-a7ac-27fa07a981e7;
 Sat, 17 Oct 2020 14:25:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8s-0005Lt-8E
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn8s-0005MF-2R
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn8t-0007Lk-2l
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:07 +0000
X-Inumbo-ID: f36fd3f3-422d-47d4-a7ac-27fa07a981e7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f36fd3f3-422d-47d4-a7ac-27fa07a981e7;
	Sat, 17 Oct 2020 14:25:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BhtChVJB16QNNJc4CEAD4GckZV0+jJS/xOn+zkEfnk8=; b=zk4Ayb/P5t2lmPpKTSr4wOb4Ru
	9omdSU9nnEvwlxPpDthzXodF+d4kMfqJaP4DwXFd4SiW68/kRQ5BEbOAF7AFSyWD6zrolkWYDEbGH
	9jTXiBijfIWFDkg4xVcUuvltEtBWyZ/aKCGSdwegvyolaltkXIYH2DpxwVLhdqgaOD18=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8s-0005Lt-8E
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn8s-0005MF-2R
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] iotests/283: Use consistent size for source and target
Message-Id: <E1kTn8s-0005MF-2R@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:06 +0000

commit 73a01bc9b0351b45ba06c327d5c54025a9aaa0b7
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Apr 30 16:27:52 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 19:12:11 2020 -0500

    iotests/283: Use consistent size for source and target
    
    The test case forgot to specify the null-co size for the target node.
    When adding a check to backup that both sizes match, this would fail
    because of the size mismatch and not the behaviour that the test really
    wanted to test.
    
    Fixes: a541fcc27c98b96da187c7d4573f3270f3ddd283
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200430142755.315494-2-kwolf@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 813cc2545b82409fd504509f0ba2e96fab6edb9e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qemu-iotests/283     | 6 +++++-
 tests/qemu-iotests/283.out | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283
index 55b7cff953..44de76effe 100644
--- a/tests/qemu-iotests/283
+++ b/tests/qemu-iotests/283
@@ -72,7 +72,11 @@ to check that crash is fixed :)
 vm = iotests.VM()
 vm.launch()
 
-vm.qmp_log('blockdev-add', **{'node-name': 'target', 'driver': 'null-co'})
+vm.qmp_log('blockdev-add', **{
+    'node-name': 'target',
+    'driver': 'null-co',
+    'size': size,
+})
 
 vm.qmp_log('blockdev-add', **{
     'node-name': 'source',
diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out
index daaf5828c1..d8cff22cc1 100644
--- a/tests/qemu-iotests/283.out
+++ b/tests/qemu-iotests/283.out
@@ -1,4 +1,4 @@
-{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target"}}
+{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "target", "size": 1048576}}
 {"return": {}}
 {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": {"driver": "null-co", "node-name": "base", "size": 1048576}, "node-name": "source"}}
 {"return": {}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8333.22208 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn94-0007NQ-LG; Sat, 17 Oct 2020 14:25:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8333.22208; Sat, 17 Oct 2020 14:25:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn94-0007NI-I6; Sat, 17 Oct 2020 14:25:18 +0000
Received: by outflank-mailman (input) for mailman id 8333;
 Sat, 17 Oct 2020 14:25:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn93-0007N8-DX
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e4ee794d-b168-409f-9ab3-a0566c654f2f;
 Sat, 17 Oct 2020 14:25:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn92-0005Mf-Bd
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn92-0005Mz-Ap
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn93-0007N8-DX
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:17 +0000
X-Inumbo-ID: e4ee794d-b168-409f-9ab3-a0566c654f2f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e4ee794d-b168-409f-9ab3-a0566c654f2f;
	Sat, 17 Oct 2020 14:25:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YgAPIxDq3D65iKFNScL6ypM4sx09xXyQAfCkj7TgoRA=; b=PXqlK/dETZ18dxl5rB1c+cjpcb
	taBc79WYV8MmLSkrLcImWnbBEoZ6lwxuB+0tpBw4mwCF8Gc/w7olzshkWH1SEiZdJk+t0FPXJ93Kb
	1Sl9qVSI2ypnmTQXEUS4HWTfKGwTD5tENKBCG6obgMpJrrGfeMNBL0tYoqiYHQzEoeo4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn92-0005Mf-Bd
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn92-0005Mz-Ap
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtiofsd: add --rlimit-nofile=NUM option
Message-Id: <E1kTn92-0005Mz-Ap@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:16 +0000

commit a637ea0c5298af9e10f5cfe659dc9093d4d7bc9c
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Fri May 1 15:06:43 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 20:18:23 2020 -0500

    virtiofsd: add --rlimit-nofile=NUM option
    
    Make it possible to specify the RLIMIT_NOFILE on the command-line.
    Users running multiple virtiofsd processes should allocate a certain
    number to each process so that the system-wide limit can never be
    exhausted.
    
    When this option is set to 0 the rlimit is left at its current value.
    This is useful when a management tool wants to configure the rlimit
    itself.
    
    The default behavior remains unchanged: try to set the limit to
    1,000,000 file descriptors if the current rlimit is lower.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200501140644.220940-2-stefanha@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 6dbb716877728ce4eb51619885ef6ef4ada9565f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/fuse_lowlevel.h  |  1 +
 tools/virtiofsd/helper.c         | 23 +++++++++++++++++++++++
 tools/virtiofsd/passthrough_ll.c | 22 ++++++++--------------
 3 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowlevel.h
index 8f6d705b5c..562fd5241e 100644
--- a/tools/virtiofsd/fuse_lowlevel.h
+++ b/tools/virtiofsd/fuse_lowlevel.h
@@ -1777,6 +1777,7 @@ struct fuse_cmdline_opts {
     int syslog;
     int log_level;
     unsigned int max_idle_threads;
+    unsigned long rlimit_nofile;
 };
 
 /**
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index 819c2bc13c..dc59f38af0 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -23,6 +23,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/param.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 #include <unistd.h>
 
 #define FUSE_HELPER_OPT(t, p)                       \
@@ -53,6 +55,7 @@ static const struct fuse_opt fuse_helper_opts[] = {
     FUSE_HELPER_OPT("subtype=", nodefault_subtype),
     FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP),
     FUSE_HELPER_OPT("max_idle_threads=%u", max_idle_threads),
+    FUSE_HELPER_OPT("--rlimit-nofile=%lu", rlimit_nofile),
     FUSE_HELPER_OPT("--syslog", syslog),
     FUSE_HELPER_OPT_VALUE("log_level=debug", log_level, FUSE_LOG_DEBUG),
     FUSE_HELPER_OPT_VALUE("log_level=info", log_level, FUSE_LOG_INFO),
@@ -171,6 +174,9 @@ void fuse_cmdline_help(void)
            "                               default: no_writeback\n"
            "    -o xattr|no_xattr          enable/disable xattr\n"
            "                               default: no_xattr\n"
+           "    --rlimit-nofile=<num>      set maximum number of file descriptors\n"
+           "                               (0 leaves rlimit unchanged)\n"
+           "                               default: 1,000,000 if the current rlimit is lower\n"
            );
 }
 
@@ -191,11 +197,28 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
     }
 }
 
+static unsigned long get_default_rlimit_nofile(void)
+{
+    rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */
+    struct rlimit rlim;
+
+    if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
+        fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
+        exit(1);
+    }
+
+    if (rlim.rlim_cur >= max_fds) {
+        return 0; /* we have more fds available than required! */
+    }
+    return max_fds;
+}
+
 int fuse_parse_cmdline(struct fuse_args *args, struct fuse_cmdline_opts *opts)
 {
     memset(opts, 0, sizeof(struct fuse_cmdline_opts));
 
     opts->max_idle_threads = 10;
+    opts->rlimit_nofile = get_default_rlimit_nofile();
     opts->foreground = 1;
 
     if (fuse_opt_parse(args, opts, fuse_helper_opts, fuse_helper_opt_proc) ==
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 4c35c95b25..f7b9c1d20c 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -2707,24 +2707,18 @@ static void setup_sandbox(struct lo_data *lo, struct fuse_session *se,
     setup_seccomp(enable_syslog);
 }
 
-/* Raise the maximum number of open file descriptors */
-static void setup_nofile_rlimit(void)
+/* Set the maximum number of open file descriptors */
+static void setup_nofile_rlimit(unsigned long rlimit_nofile)
 {
-    const rlim_t max_fds = 1000000;
-    struct rlimit rlim;
-
-    if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
-        fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
-        exit(1);
-    }
+    struct rlimit rlim = {
+        .rlim_cur = rlimit_nofile,
+        .rlim_max = rlimit_nofile,
+    };
 
-    if (rlim.rlim_cur >= max_fds) {
+    if (rlimit_nofile == 0) {
         return; /* nothing to do */
     }
 
-    rlim.rlim_cur = max_fds;
-    rlim.rlim_max = max_fds;
-
     if (setrlimit(RLIMIT_NOFILE, &rlim) < 0) {
         /* Ignore SELinux denials */
         if (errno == EPERM) {
@@ -2977,7 +2971,7 @@ int main(int argc, char *argv[])
 
     fuse_daemonize(opts.foreground);
 
-    setup_nofile_rlimit();
+    setup_nofile_rlimit(opts.rlimit_nofile);
 
     /* Must be before sandbox since it wants /proc */
     setup_capng();
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8334.22212 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9F-0007PB-Ns; Sat, 17 Oct 2020 14:25:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8334.22212; Sat, 17 Oct 2020 14:25:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9F-0007P2-Jq; Sat, 17 Oct 2020 14:25:29 +0000
Received: by outflank-mailman (input) for mailman id 8334;
 Sat, 17 Oct 2020 14:25:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn9D-0007Op-Kp
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c2103d4b-2806-4279-badf-39b7e5062873;
 Sat, 17 Oct 2020 14:25:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9C-0005Mw-Es
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9C-0005Nd-E2
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn9D-0007Op-Kp
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:27 +0000
X-Inumbo-ID: c2103d4b-2806-4279-badf-39b7e5062873
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c2103d4b-2806-4279-badf-39b7e5062873;
	Sat, 17 Oct 2020 14:25:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c9/FKHz0gcU5Sn/VyaF0iaTX9ce4EjwHKBnlOSeJk7A=; b=b/npDrMj++QW7c9wJ2DQ0HjU8c
	6aGsq2Zkt3FspYKytewDiZGZIrJaVLO5qP9sHPkfZa6jJZ2fipF5Jh4vHkl5qSMFdVOiPWE7L1/TI
	9tanrIHEahu89k6aVwHYqyJZXPKFI4Wl+ATkK9P5F3lsAlbNOwaGTR78Xfumn4rIKzbo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9C-0005Mw-Es
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9C-0005Nd-E2
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)
Message-Id: <E1kTn9C-0005Nd-E2@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:26 +0000

commit c1abbd0f047e81ea5441baa586c5e3e9901318aa
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Fri May 1 15:06:44 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 20:18:30 2020 -0500

    virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)
    
    The system-wide fs.file-max sysctl value determines how many files can
    be open.  It defaults to a value calculated based on the machine's RAM
    size.  Previously virtiofsd would try to set RLIMIT_NOFILE to 1,000,000
    and this allowed the FUSE client to exhaust the number of open files
    system-wide on Linux hosts with less than 10 GB of RAM!
    
    Take fs.file-max into account when choosing the default RLIMIT_NOFILE
    value.
    
    Fixes: CVE-2020-10717
    Reported-by: Yuval Avrahami <yavrahami@paloaltonetworks.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200501140644.220940-3-stefanha@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 8c1d353d107b4fc344e27f2f08ea7fa25de2eea2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/helper.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index dc59f38af0..00a1ef666a 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -176,7 +176,8 @@ void fuse_cmdline_help(void)
            "                               default: no_xattr\n"
            "    --rlimit-nofile=<num>      set maximum number of file descriptors\n"
            "                               (0 leaves rlimit unchanged)\n"
-           "                               default: 1,000,000 if the current rlimit is lower\n"
+           "                               default: min(1000000, fs.file-max - 16384)\n"
+           "                                        if the current rlimit is lower\n"
            );
 }
 
@@ -199,9 +200,32 @@ static int fuse_helper_opt_proc(void *data, const char *arg, int key,
 
 static unsigned long get_default_rlimit_nofile(void)
 {
+    g_autofree gchar *file_max_str = NULL;
+    const rlim_t reserved_fds = 16384; /* leave at least this many fds free */
     rlim_t max_fds = 1000000; /* our default RLIMIT_NOFILE target */
+    rlim_t file_max;
     struct rlimit rlim;
 
+    /*
+     * Reduce max_fds below the system-wide maximum, if necessary.  This
+     * ensures there are fds available for other processes so we don't
+     * cause resource exhaustion.
+     */
+    if (!g_file_get_contents("/proc/sys/fs/file-max", &file_max_str,
+                             NULL, NULL)) {
+        fuse_log(FUSE_LOG_ERR, "can't read /proc/sys/fs/file-max\n");
+        exit(1);
+    }
+    file_max = g_ascii_strtoull(file_max_str, NULL, 10);
+    if (file_max < 2 * reserved_fds) {
+        fuse_log(FUSE_LOG_ERR,
+                 "The fs.file-max sysctl is too low (%lu) to allow a "
+                 "reasonable number of open files.\n",
+                 (unsigned long)file_max);
+        exit(1);
+    }
+    max_fds = MIN(file_max - reserved_fds, max_fds);
+
     if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
         fuse_log(FUSE_LOG_ERR, "getrlimit(RLIMIT_NOFILE): %m\n");
         exit(1);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8335.22216 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9P-0007QJ-OY; Sat, 17 Oct 2020 14:25:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8335.22216; Sat, 17 Oct 2020 14:25:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9P-0007QC-LO; Sat, 17 Oct 2020 14:25:39 +0000
Received: by outflank-mailman (input) for mailman id 8335;
 Sat, 17 Oct 2020 14:25:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn9N-0007Q3-Hh
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e71d34a1-22bc-4d0e-a11c-0ba22ed69b96;
 Sat, 17 Oct 2020 14:25:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9M-0005N2-IV
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9M-0005O9-H3
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn9N-0007Q3-Hh
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:37 +0000
X-Inumbo-ID: e71d34a1-22bc-4d0e-a11c-0ba22ed69b96
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e71d34a1-22bc-4d0e-a11c-0ba22ed69b96;
	Sat, 17 Oct 2020 14:25:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PsYYC+eSlyAe5ML4TioUPLfc5j8xr7tjYfki3pkX/us=; b=DWZ+CFpDGn0qx/+ZMyGfSom/u5
	I5Tcn4i6pxqoafn3ULEfR9yS5yCjrBm4LD3Ebh5K/6VtbQIbBq01vLImn3RAz4BGqORMYe+C0WwUi
	pK2z7BrOc/hLo9zjOxoHcZXcxcgHkr5UlTYcrZqDcAjiDcXkclqxz5dAxKSdOL1Dc8gc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9M-0005N2-IV
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9M-0005O9-H3
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
Message-Id: <E1kTn9M-0005O9-H3@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:36 +0000

commit 521898ac31a76c930bf8f213d8cdb0233da7a9ff
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Mon May 11 12:04:53 2020 +0800
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Aug 24 21:03:02 2020 -0500

    net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
    
    The sender of packet will be checked in the qemu_net_queue_purge() but
    we use NetClientState not its peer when trying to purge the incoming
    queue in qemu_flush_or_purge_packets(). This will trigger the assert
    in virtio_net_reset since we can't pass the sender check:
    
    hw/net/virtio-net.c:533: void virtio_net_reset(VirtIODevice *): Assertion
    `!virtio_net_get_subqueue(nc)->async_tx.elem' failed.
    #9 0x55a33fa31b78 in virtio_net_reset hw/net/virtio-net.c:533:13
    #10 0x55a33fc88412 in virtio_reset hw/virtio/virtio.c:1919:9
    #11 0x55a341d82764 in virtio_bus_reset hw/virtio/virtio-bus.c:95:9
    #12 0x55a341dba2de in virtio_pci_reset hw/virtio/virtio-pci.c:1824:5
    #13 0x55a341db3e02 in virtio_pci_common_write hw/virtio/virtio-pci.c:1252:13
    #14 0x55a33f62117b in memory_region_write_accessor memory.c:496:5
    #15 0x55a33f6205e4 in access_with_adjusted_size memory.c:557:18
    #16 0x55a33f61e177 in memory_region_dispatch_write memory.c:1488:16
    
    Reproducer:
    https://www.mail-archive.com/qemu-devel@nongnu.org/msg701914.html
    
    Fix by using the peer.
    
    Reported-by: "Alexander Bulekov" <alxndr@bu.edu>
    Acked-by: Alexander Bulekov <alxndr@bu.edu>
    Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop")
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit 5fe19fb81839ea42b592b409f725349cf3c73551)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index cbeeeadff8..4c62b10acd 100644
--- a/net/net.c
+++ b/net/net.c
@@ -610,7 +610,7 @@ void qemu_flush_or_purge_queued_packets(NetClientState *nc, bool purge)
         qemu_notify_event();
     } else if (purge) {
         /* Unable to empty the queue, purge remaining packets */
-        qemu_net_queue_purge(nc->incoming_queue, nc);
+        qemu_net_queue_purge(nc->incoming_queue, nc->peer);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8336.22220 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9Y-0007Ra-Ps; Sat, 17 Oct 2020 14:25:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8336.22220; Sat, 17 Oct 2020 14:25:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9Y-0007RS-N5; Sat, 17 Oct 2020 14:25:48 +0000
Received: by outflank-mailman (input) for mailman id 8336;
 Sat, 17 Oct 2020 14:25:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn9X-0007RK-GA
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ef40d519-dda8-4d2c-8dc2-2055c004e4b9;
 Sat, 17 Oct 2020 14:25:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9W-0005NA-M7
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9W-0005Ol-LN
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn9X-0007RK-GA
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:47 +0000
X-Inumbo-ID: ef40d519-dda8-4d2c-8dc2-2055c004e4b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ef40d519-dda8-4d2c-8dc2-2055c004e4b9;
	Sat, 17 Oct 2020 14:25:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ojSFfUkXQSzkoc1WgNl8SUwvyQJiIbfvtMbZSZgAf+M=; b=k0wA8E4BBQ02mKGn/AWPz0V43O
	XMDaurhCrpjvmqnJ5Z2XabsQy0fGPXvMY9xa98WHSt518Xydz4SX4kT05jE4kmNtNgpfZrHUpLsEK
	BQdJfNW8jd/2ynJJ/7SgHRwIdjAlsFuwL5yQpid2+CcOyZBi1+QIfnYjLqx0vDNVoBl4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9W-0005NA-M7
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9W-0005Ol-LN
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] KVM: x86: believe what KVM says about WAITPKG
Message-Id: <E1kTn9W-0005Ol-LN@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:46 +0000

commit 458ae56d22a78d84135fd5dfe8e837be83d74ce9
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 30 09:49:27 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:29:24 2020 -0500

    KVM: x86: believe what KVM says about WAITPKG
    
    Currently, QEMU is overriding KVM_GET_SUPPORTED_CPUID's answer for
    the WAITPKG bit depending on the "-overcommit cpu-pm" setting.  This is a
    bad idea because it does not even check if the host supports it, but it
    can be done in x86_cpu_realizefn just like we do for the MONITOR bit.
    
    This patch moves it there, while making it conditional on host
    support for the related UMWAIT MSR.
    
    Cc: qemu-stable@nongnu.org
    Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit e1e43813e7908b063938a3d01f172f88f6190c80)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/i386/cpu.c      |  3 +++
 target/i386/kvm.c      | 11 +++++------
 target/i386/kvm_i386.h |  1 +
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 90ffc5f3b1..471db0724f 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6491,6 +6491,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
             host_cpuid(5, 0, &cpu->mwait.eax, &cpu->mwait.ebx,
                        &cpu->mwait.ecx, &cpu->mwait.edx);
             env->features[FEAT_1_ECX] |= CPUID_EXT_MONITOR;
+            if (kvm_enabled() && kvm_has_waitpkg()) {
+                env->features[FEAT_7_0_ECX] |= CPUID_7_0_ECX_WAITPKG;
+            }
         }
         if (kvm_enabled() && cpu->ucode_rev == 0) {
             cpu->ucode_rev = kvm_arch_get_supported_msr_feature(kvm_state,
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 4901c6dd74..f9c873bcad 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -407,12 +407,6 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
         if (host_tsx_blacklisted()) {
             ret &= ~(CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_HLE);
         }
-    } else if (function == 7 && index == 0 && reg == R_ECX) {
-        if (enable_cpu_pm) {
-            ret |= CPUID_7_0_ECX_WAITPKG;
-        } else {
-            ret &= ~CPUID_7_0_ECX_WAITPKG;
-        }
     } else if (function == 7 && index == 0 && reg == R_EDX) {
         /*
          * Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts.
@@ -4678,3 +4672,8 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
 {
     abort();
 }
+
+bool kvm_has_waitpkg(void)
+{
+    return has_msr_umwait;
+}
diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h
index 00bde7acaf..064b8798a2 100644
--- a/target/i386/kvm_i386.h
+++ b/target/i386/kvm_i386.h
@@ -44,6 +44,7 @@ void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
 
 bool kvm_enable_x2apic(void);
 bool kvm_has_x2apic_api(void);
+bool kvm_has_waitpkg(void);
 
 bool kvm_hv_vpindex_settable(void);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:25:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:25:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8337.22224 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9i-0007T7-T4; Sat, 17 Oct 2020 14:25:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8337.22224; Sat, 17 Oct 2020 14:25:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9i-0007Sz-Q1; Sat, 17 Oct 2020 14:25:58 +0000
Received: by outflank-mailman (input) for mailman id 8337;
 Sat, 17 Oct 2020 14:25:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn9h-0007Sn-MD
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5ede4d7d-77d7-4e21-8686-9a292f1e0c05;
 Sat, 17 Oct 2020 14:25:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9g-0005NH-PC
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9g-0005PF-OU
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn9h-0007Sn-MD
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:57 +0000
X-Inumbo-ID: 5ede4d7d-77d7-4e21-8686-9a292f1e0c05
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5ede4d7d-77d7-4e21-8686-9a292f1e0c05;
	Sat, 17 Oct 2020 14:25:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZurRvx3tq8orUnoiVNJ/RTHteW8nG9kUsWkSM27UgU4=; b=W2JH9V//S1/PKipfH5k8tcT+9h
	Kv/Ub/OG5KAX1whNp18ng2sWmECDaTWyki2iBvwvOuaPOafRe4MOwMY41CTfJqR1eabSbcHDEUuF/
	sYePm+hs5U6t+A1DFokfMcWMQx4VRbdAWCh60Nem8bvdnW3MWYeRZ5CJPqYBEh4I2sco=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9g-0005NH-PC
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9g-0005PF-OU
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:25:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] aio-posix: don't duplicate fd handler deletion in fdmon_io_uring_destroy()
Message-Id: <E1kTn9g-0005PF-OU@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:25:56 +0000

commit 5145f2471caa4ef58e200e151f736e633a5fb1ac
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon May 11 19:36:29 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:30:07 2020 -0500

    aio-posix: don't duplicate fd handler deletion in fdmon_io_uring_destroy()
    
    The io_uring file descriptor monitoring implementation has an internal
    list of fd handlers that are pending submission to io_uring.
    fdmon_io_uring_destroy() deletes all fd handlers on the list.
    
    Don't delete fd handlers directly in fdmon_io_uring_destroy() for two
    reasons:
    1. This duplicates the aio-posix.c AioHandler deletion code and could
       become outdated if the struct changes.
    2. Only handlers with the FDMON_IO_URING_REMOVE flag set are safe to
       remove. If the flag is not set then something still has a pointer to
       the fd handler. Let aio-posix.c and its user worry about that. In
       practice this isn't an issue because fdmon_io_uring_destroy() is only
       called when shutting down so all users have removed their fd
       handlers, but the next patch will need this!
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
    Message-id: 20200511183630.279750-2-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    (cherry picked from commit de137e44f75d9868f5b548638081850f6ac771f2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 util/aio-posix.c      |  1 +
 util/fdmon-io_uring.c | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/util/aio-posix.c b/util/aio-posix.c
index c3613d299e..8af334ab19 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -679,6 +679,7 @@ void aio_context_destroy(AioContext *ctx)
 {
     fdmon_io_uring_destroy(ctx);
     fdmon_epoll_disable(ctx);
+    aio_free_deleted_handlers(ctx);
 }
 
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c
index d5a80ed6fb..1d14177df0 100644
--- a/util/fdmon-io_uring.c
+++ b/util/fdmon-io_uring.c
@@ -342,11 +342,18 @@ void fdmon_io_uring_destroy(AioContext *ctx)
 
         io_uring_queue_exit(&ctx->fdmon_io_uring);
 
-        /* No need to submit these anymore, just free them. */
+        /* Move handlers due to be removed onto the deleted list */
         while ((node = QSLIST_FIRST_RCU(&ctx->submit_list))) {
+            unsigned flags = atomic_fetch_and(&node->flags,
+                    ~(FDMON_IO_URING_PENDING |
+                      FDMON_IO_URING_ADD |
+                      FDMON_IO_URING_REMOVE));
+
+            if (flags & FDMON_IO_URING_REMOVE) {
+                QLIST_INSERT_HEAD_RCU(&ctx->deleted_aio_handlers, node, node_deleted);
+            }
+
             QSLIST_REMOVE_HEAD_RCU(&ctx->submit_list, node_submitted);
-            QLIST_REMOVE(node, node);
-            g_free(node);
         }
 
         ctx->fdmon_ops = &fdmon_poll_ops;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8338.22228 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9s-0007UN-Ut; Sat, 17 Oct 2020 14:26:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8338.22228; Sat, 17 Oct 2020 14:26:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTn9s-0007UD-Ri; Sat, 17 Oct 2020 14:26:08 +0000
Received: by outflank-mailman (input) for mailman id 8338;
 Sat, 17 Oct 2020 14:26:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTn9r-0007U3-O2
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cb34221c-1de6-4a23-a071-76d3dc635e1c;
 Sat, 17 Oct 2020 14:26:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9q-0005Nb-SP
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTn9q-0005Q8-Rm
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTn9r-0007U3-O2
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:07 +0000
X-Inumbo-ID: cb34221c-1de6-4a23-a071-76d3dc635e1c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cb34221c-1de6-4a23-a071-76d3dc635e1c;
	Sat, 17 Oct 2020 14:26:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+wcTBImOGg0jWz0y+gL0SNv3w6k2Ufj5L2jS2PR3WAo=; b=1wqrGwgTHuwbjUDR7Axsm9/3sR
	bGYGtj4yAdOL/z3/hrJphMK5MFu4xT1L0FxWQPdYK2DQ5l+OzfEsOi4tkUaaNMut0nu28jzPegHUX
	kp7AInwrxizeS7YHfPw+IbPIfDKMALGY6uM93ngpdVuoeVqQcgbPL+jt1gH4M3unTcgo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9q-0005Nb-SP
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTn9q-0005Q8-Rm
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] aio-posix: disable fdmon-io_uring when GSource is used
Message-Id: <E1kTn9q-0005Q8-Rm@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:06 +0000

commit dcc935873b688a789744ec0a2d0d1b3570d18a6c
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon May 11 19:36:30 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:30:13 2020 -0500

    aio-posix: disable fdmon-io_uring when GSource is used
    
    The glib event loop does not call fdmon_io_uring_wait() so fd handlers
    waiting to be submitted build up in the list. There is no benefit is
    using io_uring when the glib GSource is being used, so disable it
    instead of implementing a more complex fix.
    
    This fixes a memory leak where AioHandlers would build up and increasing
    amounts of CPU time were spent iterating them in aio_pending(). The
    symptom is that guests become slow when QEMU is built with io_uring
    support.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1877716
    Fixes: 73fd282e7b6dd4e4ea1c3bbb3d302c8db51e4ccf ("aio-posix: add io_uring fd monitoring implementation")
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
    Message-id: 20200511183630.279750-3-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    (cherry picked from commit ba607ca8bff4d2c2062902f8355657c865ac7c29)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/block/aio.h |  3 +++
 util/aio-posix.c    | 12 ++++++++++++
 util/aio-win32.c    |  4 ++++
 util/async.c        |  1 +
 4 files changed, 20 insertions(+)

diff --git a/include/block/aio.h b/include/block/aio.h
index 62ed954344..b2f703fa3f 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -701,6 +701,9 @@ void aio_context_setup(AioContext *ctx);
  */
 void aio_context_destroy(AioContext *ctx);
 
+/* Used internally, do not call outside AioContext code */
+void aio_context_use_g_source(AioContext *ctx);
+
 /**
  * aio_context_set_poll_params:
  * @ctx: the aio context
diff --git a/util/aio-posix.c b/util/aio-posix.c
index 8af334ab19..1b2a3af65b 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -682,6 +682,18 @@ void aio_context_destroy(AioContext *ctx)
     aio_free_deleted_handlers(ctx);
 }
 
+void aio_context_use_g_source(AioContext *ctx)
+{
+    /*
+     * Disable io_uring when the glib main loop is used because it doesn't
+     * support mixed glib/aio_poll() usage. It relies on aio_poll() being
+     * called regularly so that changes to the monitored file descriptors are
+     * submitted, otherwise a list of pending fd handlers builds up.
+     */
+    fdmon_io_uring_destroy(ctx);
+    aio_free_deleted_handlers(ctx);
+}
+
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {
diff --git a/util/aio-win32.c b/util/aio-win32.c
index 729d533faf..953c56ab48 100644
--- a/util/aio-win32.c
+++ b/util/aio-win32.c
@@ -414,6 +414,10 @@ void aio_context_destroy(AioContext *ctx)
 {
 }
 
+void aio_context_use_g_source(AioContext *ctx)
+{
+}
+
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {
diff --git a/util/async.c b/util/async.c
index 3165a28f2f..1319eee3bc 100644
--- a/util/async.c
+++ b/util/async.c
@@ -362,6 +362,7 @@ static GSourceFuncs aio_source_funcs = {
 
 GSource *aio_get_g_source(AioContext *ctx)
 {
+    aio_context_use_g_source(ctx);
     g_source_ref(&ctx->source);
     return &ctx->source;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8339.22232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnA2-0007Vc-WA; Sat, 17 Oct 2020 14:26:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8339.22232; Sat, 17 Oct 2020 14:26:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnA2-0007VU-TG; Sat, 17 Oct 2020 14:26:18 +0000
Received: by outflank-mailman (input) for mailman id 8339;
 Sat, 17 Oct 2020 14:26:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnA1-0007VL-OT
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 557fb03d-d387-4ab8-9831-3437fd4afe61;
 Sat, 17 Oct 2020 14:26:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnA0-0005O9-W8
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnA0-0005Qt-Ue
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnA1-0007VL-OT
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:17 +0000
X-Inumbo-ID: 557fb03d-d387-4ab8-9831-3437fd4afe61
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 557fb03d-d387-4ab8-9831-3437fd4afe61;
	Sat, 17 Oct 2020 14:26:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DllIPQjcRF04PIrd6xdnt3YijUV5fkQQIDZ4l/4ssno=; b=DHJSBHV4qaRExv6ht7W5kbyOWz
	0t3t3mAfblPJRaZAHKKPjsUxpVBlZuFnovNu2ckGyK3cnapPK1Dy71DzIOkLu2FrkLI5KVa+TOFOD
	0+/ba3qCo0o1ZmovoeGJYlKN+ZE4M/mCmTnsPYxKSRJJKi/y4qo6JfqpQEhkvTnm63ZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnA0-0005O9-W8
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnA0-0005Qt-Ue
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] linux-user/strace.list: fix epoll_create{,1} -strace output
Message-Id: <E1kTnA0-0005Qt-Ue@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:16 +0000

commit 160546b81ec54a08153305e40db7e524723904ab
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: Thu Apr 16 18:59:57 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Aug 25 14:31:34 2020 -0500

    linux-user/strace.list: fix epoll_create{,1} -strace output
    
    Fix syscall name and parameters priinter.
    
    Before the change:
    
    ```
    $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    ...
    1274697 %s(%d)(2097152,274903156744,274903156760,274905840712,274877908880,274903235616) = 3
    1274697 exit_group(0)
    ```
    
    After the change:
    
    ```
    $ alpha-linux-user/qemu-alpha -strace -L /usr/alpha-unknown-linux-gnu/ /tmp/a
    ...
    1273719 epoll_create1(2097152) = 3
    1273719 exit_group(0)
    ```
    
    Fixes: 9cbc0578cb6 ("Improve output of various syscalls")
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    CC: Riku Voipio <riku.voipio@iki.fi>
    CC: Laurent Vivier <laurent@vivier.eu>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200416175957.1274882-1-slyfox@gentoo.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    (cherry picked from commit fd568660b7ae9b9e45cbb616acc91ae4c065c32d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 linux-user/strace.list | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/strace.list b/linux-user/strace.list
index d49a1e92a8..9281c0a758 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -125,10 +125,10 @@
 { TARGET_NR_dup3, "dup3" , "%s(%d,%d,%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_create
-{ TARGET_NR_epoll_create, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create, "epoll_create", "%s(%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_create1
-{ TARGET_NR_epoll_create1, "%s(%d)", NULL, NULL, NULL },
+{ TARGET_NR_epoll_create1, "epoll_create1", "%s(%d)", NULL, NULL },
 #endif
 #ifdef TARGET_NR_epoll_ctl
 { TARGET_NR_epoll_ctl, "epoll_ctl" , NULL, NULL, NULL },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8340.22236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAD-0007XZ-1S; Sat, 17 Oct 2020 14:26:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8340.22236; Sat, 17 Oct 2020 14:26:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAC-0007XR-Ui; Sat, 17 Oct 2020 14:26:28 +0000
Received: by outflank-mailman (input) for mailman id 8340;
 Sat, 17 Oct 2020 14:26:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnAB-0007XH-R6
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 54501ff6-04ce-404d-89ce-a2ab69176a05;
 Sat, 17 Oct 2020 14:26:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAB-0005OO-2q
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAB-0005RT-2C
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnAB-0007XH-R6
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
X-Inumbo-ID: 54501ff6-04ce-404d-89ce-a2ab69176a05
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 54501ff6-04ce-404d-89ce-a2ab69176a05;
	Sat, 17 Oct 2020 14:26:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=djpe1rZ7hTs7DTam35AxXPVTL14KgEVmW2wXUNf08/M=; b=3IkTVCnFS8PKPWJUTRJsfdfhgR
	a1Oj+NhnJRW0t8GSAzCwe3A33yRB1/jE547JI6CKbLYrD+1bOaBVIwjFWo2LFGG+gvcCyAxN+KbQ0
	8ag8bwGo5SqzchfXYmy9tmUIiCK42/Nm1HVbBkpkOtsigihba36bM6dBKqZwJsTUUnOI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAB-0005OO-2q
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAB-0005RT-2C
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] libqos: usb-hcd-ehci: use 32-bit write for config register
Message-Id: <E1kTnAB-0005RT-2C@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:27 +0000

commit e399bb1bf1da5619087abd65e482995c4a8d15cd
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 23 12:18:24 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    libqos: usb-hcd-ehci: use 32-bit write for config register
    
    The memory region ops have min_access_size == 4 so obey it.
    
    Tested-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 89ed83d8b23c11d250c290593cad3ca839d5b053)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/usb-hcd-ehci-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/usb-hcd-ehci-test.c b/tests/qtest/usb-hcd-ehci-test.c
index 5251d539e9..c51e8bb223 100644
--- a/tests/qtest/usb-hcd-ehci-test.c
+++ b/tests/qtest/usb-hcd-ehci-test.c
@@ -96,7 +96,7 @@ static void pci_ehci_port_1(void)
 static void pci_ehci_config(void)
 {
     /* hands over all ports from companion uhci to ehci */
-    qpci_io_writew(ehci1.dev, ehci1.bar, 0x60, 1);
+    qpci_io_writel(ehci1.dev, ehci1.bar, 0x60, 1);
 }
 
 static void pci_uhci_port_2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8341.22240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAN-0007Yo-3K; Sat, 17 Oct 2020 14:26:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8341.22240; Sat, 17 Oct 2020 14:26:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAN-0007Yg-0B; Sat, 17 Oct 2020 14:26:39 +0000
Received: by outflank-mailman (input) for mailman id 8341;
 Sat, 17 Oct 2020 14:26:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnAL-0007YW-UR
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 27fbac67-545b-4296-a961-4998254018ad;
 Sat, 17 Oct 2020 14:26:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAL-0005OX-6D
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAL-0005Rz-57
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnAL-0007YW-UR
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
X-Inumbo-ID: 27fbac67-545b-4296-a961-4998254018ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 27fbac67-545b-4296-a961-4998254018ad;
	Sat, 17 Oct 2020 14:26:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LaET4rzGpv5ZwjmD9JawTasV1zLCkl8CpQ7G9fxJHWk=; b=rDVz6Jr1ziJl9U9sRMUhJVsCZB
	Cfs95mKkm3Tpfr6gl9t25yQ99GnT86M4QrT5Iv4cZ2Dr3rR5F+pxVvU82Y/oMgAb3IK2sox/BEEU/
	MCGexPwiikw7jhGjJlXZA2kJ4EJV4eVAl/Vj9wifzdLpcZt5xKb68GBBEwr5Ppqu8n3Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAL-0005OX-6D
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAL-0005Rz-57
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] libqos: pci-pc: use 32-bit write for EJ register
Message-Id: <E1kTnAL-0005Rz-57@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:37 +0000

commit 68d84b133d3a3611f304a2e93f07690dd141dbd5
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Tue Jun 23 12:17:59 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    libqos: pci-pc: use 32-bit write for EJ register
    
    The memory region ops have min_access_size == 4 so obey it.
    
    Tested-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 4b7c06837ae0b1ff56473202a42e7e386f53d6db)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/libqos/pci-pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c
index 0bc591d1da..3bb2eb3ba8 100644
--- a/tests/qtest/libqos/pci-pc.c
+++ b/tests/qtest/libqos/pci-pc.c
@@ -186,7 +186,7 @@ void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t slot)
     g_assert(!qdict_haskey(response, "error"));
     qobject_unref(response);
 
-    qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot);
+    qtest_outl(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot);
 
     qtest_qmp_eventwait(qts, "DEVICE_DELETED");
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8342.22244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAX-0007a4-4p; Sat, 17 Oct 2020 14:26:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8342.22244; Sat, 17 Oct 2020 14:26:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAX-0007Zw-1i; Sat, 17 Oct 2020 14:26:49 +0000
Received: by outflank-mailman (input) for mailman id 8342;
 Sat, 17 Oct 2020 14:26:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnAW-0007Zm-4F
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a00cf203-307a-40ce-aac1-4125f81e0079;
 Sat, 17 Oct 2020 14:26:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAV-0005Oh-9I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAV-0005SR-8b
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnAW-0007Zm-4F
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:48 +0000
X-Inumbo-ID: a00cf203-307a-40ce-aac1-4125f81e0079
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a00cf203-307a-40ce-aac1-4125f81e0079;
	Sat, 17 Oct 2020 14:26:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tkxDRMKk8T8j8+QsTOgqgb+FhahLIPee5sqzmxKkZ1A=; b=Lqsmf2GbljT+yszhJQLvR9yT/s
	8l8Oqrbk0vAzmHdMJvfhsB59A1UyQ7ssUI8H0NR6UmmnfOXr35Yrrg1ioGCel24poFfilnYUbgle8
	vEn6toST79t8OIDpJaH4Ap5p9fKwQoYHk+CUWUYnSs3LsFqB0pKHID9vwr/hZyBvPw0k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAV-0005Oh-9I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAV-0005SR-8b
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"
Message-Id: <E1kTnAV-0005SR-8b@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:47 +0000

commit b14cd263ad87a4c3a83308f093841d247eb711f1
Author:     Michael S. Tsirkin <mst@redhat.com>
AuthorDate: Wed Jun 10 09:47:49 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"
    
    Memory API documentation documents valid .min_access_size and .max_access_size
    fields and explains that any access outside these boundaries is blocked.
    
    This is what devices seem to assume.
    
    However this is not what the implementation does: it simply
    ignores the boundaries unless there's an "accepts" callback.
    
    Naturally, this breaks a bunch of devices.
    
    Revert to the documented behaviour.
    
    Devices that want to allow any access can just drop the valid field,
    or add the impl field to have accesses converted to appropriate
    length.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Richard Henderson <rth@twiddle.net>
    Fixes: CVE-2020-13754
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1842363
    Fixes: a014ed07bd5a ("memory: accept mismatching sizes in memory_region_access_valid")
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Message-Id: <20200610134731.1514409-1-mst@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    (cherry picked from commit 5d971f9e672507210e77d020d89e0e89165c8fc9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 memory.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/memory.c b/memory.c
index 601b749906..e31aed6446 100644
--- a/memory.c
+++ b/memory.c
@@ -1352,35 +1352,24 @@ bool memory_region_access_valid(MemoryRegion *mr,
                                 bool is_write,
                                 MemTxAttrs attrs)
 {
-    int access_size_min, access_size_max;
-    int access_size, i;
-
-    if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
+    if (mr->ops->valid.accepts
+        && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
         return false;
     }
 
-    if (!mr->ops->valid.accepts) {
-        return true;
-    }
-
-    access_size_min = mr->ops->valid.min_access_size;
-    if (!mr->ops->valid.min_access_size) {
-        access_size_min = 1;
+    if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
+        return false;
     }
 
-    access_size_max = mr->ops->valid.max_access_size;
+    /* Treat zero as compatibility all valid */
     if (!mr->ops->valid.max_access_size) {
-        access_size_max = 4;
+        return true;
     }
 
-    access_size = MAX(MIN(size, access_size_max), access_size_min);
-    for (i = 0; i < size; i += access_size) {
-        if (!mr->ops->valid.accepts(mr->opaque, addr + i, access_size,
-                                    is_write, attrs)) {
-            return false;
-        }
+    if (size > mr->ops->valid.max_access_size
+        || size < mr->ops->valid.min_access_size) {
+        return false;
     }
-
     return true;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:26:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:26:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8343.22248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAh-0007bM-7A; Sat, 17 Oct 2020 14:26:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8343.22248; Sat, 17 Oct 2020 14:26:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAh-0007bE-3M; Sat, 17 Oct 2020 14:26:59 +0000
Received: by outflank-mailman (input) for mailman id 8343;
 Sat, 17 Oct 2020 14:26:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnAg-0007b5-6C
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 53750f6c-dcf9-4de1-9d48-a2aa4637f392;
 Sat, 17 Oct 2020 14:26:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAf-0005Op-Co
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAf-0005T2-Bg
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnAg-0007b5-6C
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:58 +0000
X-Inumbo-ID: 53750f6c-dcf9-4de1-9d48-a2aa4637f392
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 53750f6c-dcf9-4de1-9d48-a2aa4637f392;
	Sat, 17 Oct 2020 14:26:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=spzMzZJB87G1fNYOx1Hf2M1VC03C9O8wZsO/u/OMb1Q=; b=qQa7XzVoLiiVeKvuPmBMDvTHua
	mS//ZMjf1Y7sHGepeDq5iRRp75d1S3zKhqtGCofb6q57W3lhhxPPvzseRrWr8CKj6vrexacrb1sV8
	GSP2WWXaXAHLi7wgCFNwVZI4q8lIxiCu9vFTRJLb128VkTlsYNyz24bMOYMY1sxK+K60=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAf-0005Op-Co
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAf-0005T2-Bg
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:26:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/riscv: Allow 64 bit access to SiFive CLINT
Message-Id: <E1kTnAf-0005T2-Bg@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:26:57 +0000

commit 182be029628068dc7739b496df63f073f2aa8ae3
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Tue Jun 30 13:12:11 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    hw/riscv: Allow 64 bit access to SiFive CLINT
    
    Commit 5d971f9e672507210e77d020d89e0e89165c8fc9
    "memory: Revert "memory: accept mismatching sizes in
    memory_region_access_valid"" broke most RISC-V boards as they do 64 bit
    accesses to the CLINT and QEMU would trigger a fault. Fix this failure
    by allowing 8 byte accesses.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: LIU Zhiwei<zhiwei_liu@c-sky.com>
    Message-Id: <122b78825b077e4dfd39b444d3a46fe894a7804c.1593547870.git.alistair.francis@wdc.com>
    (cherry picked from commit 70b78d4e71494c90d2ccb40381336bc9b9a22f79)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/riscv/sifive_clint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_clint.c b/hw/riscv/sifive_clint.c
index e933d35092..a2a4b7d752 100644
--- a/hw/riscv/sifive_clint.c
+++ b/hw/riscv/sifive_clint.c
@@ -180,7 +180,7 @@ static const MemoryRegionOps sifive_clint_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
     .valid = {
         .min_access_size = 4,
-        .max_access_size = 4
+        .max_access_size = 8
     }
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:27:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:27:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8344.22252 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAs-0007co-9O; Sat, 17 Oct 2020 14:27:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8344.22252; Sat, 17 Oct 2020 14:27:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnAs-0007cg-6N; Sat, 17 Oct 2020 14:27:10 +0000
Received: by outflank-mailman (input) for mailman id 8344;
 Sat, 17 Oct 2020 14:27:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnAq-0007cV-Jx
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 32371756-5c51-404e-932d-e87d3ab43443;
 Sat, 17 Oct 2020 14:27:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAp-0005PC-G1
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAp-0005Ti-FN
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnAq-0007cV-Jx
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:08 +0000
X-Inumbo-ID: 32371756-5c51-404e-932d-e87d3ab43443
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 32371756-5c51-404e-932d-e87d3ab43443;
	Sat, 17 Oct 2020 14:27:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gLMwVywlI+1KaEZgn76OmwD36dyPA2mAX5YxwD/yR50=; b=IOg6CuSDwkPmVrxmH4Q/BuV1Wc
	tzzBG9voov2+4at9vluMogoJiNy69PwBBYxQkLLrl+MVv30WA0Mc+ZYEY2kCqwJDu83Td3SFt7jUx
	RJ7bD1ht6ZWREYJaJk+zCJ67sCOd35lvDVjsCKLNp/0qrWF5KW7ZesEziP7qqd8cfRvk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAp-0005PC-G1
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAp-0005Ti-FN
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] xhci: fix valid.max_access_size to access address registers
Message-Id: <E1kTnAp-0005Ti-FN@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:07 +0000

commit 782e94132aa7a3672fa5138837d91b48d6aee5dd
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 21 10:33:22 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    xhci: fix valid.max_access_size to access address registers
    
    QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
    64-bit mode access in "runtime" and "operational" MemoryRegionOps.
    
    Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.
    
    XHCI specs:
    "If the xHC supports 64-bit addressing (AC64 = ‘1’), then software
    should write 64-bit registers using only Qword accesses.  If a
    system is incapable of issuing Qword accesses, then writes to the
    64-bit address fields shall be performed using 2 Dword accesses;
    low Dword-first, high-Dword second.  If the xHC supports 32-bit
    addressing (AC64 = ‘0’), then the high Dword of registers containing
    64-bit address fields are unused and software should write addresses
    using only Dword accesses"
    
    The problem has been detected with SLOF, as linux kernel always accesses
    registers using 32-bit access even if AC64 is set and revealed by
    5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    
    Suggested-by: Alexey Kardashevskiy <aik@au1.ibm.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-id: 20200721083322.90651-1-lvivier@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 8e67fda2dd6202ccec093fda561107ba14830a17)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/hcd-xhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index b330e36fe6..67a18fe2b6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = {
     .read = xhci_oper_read,
     .write = xhci_oper_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
@@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = {
     .read = xhci_runtime_read,
     .write = xhci_runtime_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:27:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:27:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8345.22256 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnB1-0007dz-Ap; Sat, 17 Oct 2020 14:27:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8345.22256; Sat, 17 Oct 2020 14:27:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnB1-0007dr-7s; Sat, 17 Oct 2020 14:27:19 +0000
Received: by outflank-mailman (input) for mailman id 8345;
 Sat, 17 Oct 2020 14:27:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnB0-0007dj-H9
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27636df8-4c2d-4a8b-b0fa-b7e7bda7faed;
 Sat, 17 Oct 2020 14:27:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAz-0005Py-Jy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnAz-0005UG-IQ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnB0-0007dj-H9
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:18 +0000
X-Inumbo-ID: 27636df8-4c2d-4a8b-b0fa-b7e7bda7faed
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27636df8-4c2d-4a8b-b0fa-b7e7bda7faed;
	Sat, 17 Oct 2020 14:27:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PPaxDLpxPBv6lwcrE6XrxegtIeIC4+7A/H8pBACgcb8=; b=Z2JyOgQJRUAEfvsu3iBqnkNuz0
	PTg3y8RIEW6mPVHcqEV398e1Ms3txSpui7+MgYe3Is52nXmWq0G2CL8hzGv6Hl/++cwnZI8kL6yT9
	bsHzmMBaC5laLXI576X7dC4VVjwLtiWXakc/Bv+0hMPpurMg07U74CGgczLDFbnljcsU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAz-0005Py-Jy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnAz-0005UG-IQ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] acpi: accept byte and word access to core ACPI registers
Message-Id: <E1kTnAz-0005UG-IQ@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:17 +0000

commit 974b857df6e9dd69c709b20159f07b09f3f6254e
Author:     Michael Tokarev <mjt@tls.msk.ru>
AuthorDate: Mon Jul 20 19:06:27 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Aug 27 00:03:16 2020 -0500

    acpi: accept byte and word access to core ACPI registers
    
    All ISA registers should be accessible as bytes, words or dwords
    (if wide enough).  Fix the access constraints for acpi-pm-evt,
    acpi-pm-tmr & acpi-cnt registers.
    
    Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Fixes: afafe4bbe0 (apci: switch cnt to memory api)
    Fixes: 77d58b1e47 (apci: switch timer to memory api)
    Fixes: b5a7c024d2 (apci: switch evt to memory api)
    Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
    Buglink: https://bugs.debian.org/964793
    BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
    BugLink: https://bugs.launchpad.net/bugs/1886318
    Reported-By: Simon John <git@the-jedi.co.uk>
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit dba04c3488c4699f5afe96f66e448b1d447cf3fb)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/acpi/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 45cbed49ab..d85052c34a 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -461,7 +461,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_evt_ops = {
     .read = acpi_pm_evt_read,
     .write = acpi_pm_evt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -530,7 +531,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_tmr_ops = {
     .read = acpi_pm_tmr_read,
     .write = acpi_pm_tmr_write,
-    .valid.min_access_size = 4,
+    .impl.min_access_size = 4,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -602,7 +604,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_cnt_ops = {
     .read = acpi_pm_cnt_read,
     .write = acpi_pm_cnt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:27:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8346.22260 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBC-0007fk-CU; Sat, 17 Oct 2020 14:27:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8346.22260; Sat, 17 Oct 2020 14:27:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBC-0007fc-9P; Sat, 17 Oct 2020 14:27:30 +0000
Received: by outflank-mailman (input) for mailman id 8346;
 Sat, 17 Oct 2020 14:27:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBB-0007fU-B7
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 73a5fd03-ed2d-4d70-93fc-b78f66e8f27d;
 Sat, 17 Oct 2020 14:27:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnB9-0005Q7-S2
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnB9-0005Uk-MF
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBB-0007fU-B7
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:29 +0000
X-Inumbo-ID: 73a5fd03-ed2d-4d70-93fc-b78f66e8f27d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 73a5fd03-ed2d-4d70-93fc-b78f66e8f27d;
	Sat, 17 Oct 2020 14:27:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+C360eYE6FpU6f2oXYUNCp7+kxE6CMimJ3i/IH0EzUk=; b=YhoAzxT4/iwFFaehIpsbVJVwWo
	ZPPFiv+I2jh9r2WjajKDFjOo36qB2AeoNbmerd4dvKWHq2tWbURucOGBI6Rqa9VvHsN+QszIK36jy
	wkg/Q1h6t7tSezHZgHj0YKG8ZkQ1WxY5Ju94zlWiKWBGyUu4wP5Abae4ZeqykedJwS8o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnB9-0005Q7-S2
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnB9-0005Uk-MF
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/display/artist: Unbreak size mismatch memory accesses
Message-Id: <E1kTnB9-0005Uk-MF@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:27 +0000

commit 045849b0785d5cf3359ea03f3445a55836b0d7a8
Author:     Helge Deller <deller@gmx.de>
AuthorDate: Sat Aug 8 22:29:01 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/display/artist: Unbreak size mismatch memory accesses
    
    Commit 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes
    in memory_region_access_valid") broke the artist driver in a way that
    the dtwm window manager on HP-UX rendered wrong.
    
    Fixes: 5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Signed-off-by: Sven Schnelle <svens@stackframe.org>
    Signed-off-by: Helge Deller <deller@gmx.de>
    (cherry picked from commit e0cf02ce680f11893aca9642e76d6ae68b9375af)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/display/artist.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/display/artist.c b/hw/display/artist.c
index 753dbb9a77..d7bce918b8 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -1199,20 +1199,16 @@ static const MemoryRegionOps artist_reg_ops = {
     .read = artist_reg_read,
     .write = artist_reg_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
-    .valid = {
-        .min_access_size = 1,
-        .max_access_size = 4,
-    },
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 4,
 };
 
 static const MemoryRegionOps artist_vram_ops = {
     .read = artist_vram_read,
     .write = artist_vram_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
-    .valid = {
-        .min_access_size = 1,
-        .max_access_size = 4,
-    },
+    .impl.min_access_size = 1,
+    .impl.max_access_size = 4,
 };
 
 static void artist_draw_cursor(ARTISTState *s)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:27:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:27:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8347.22264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBM-0007h6-Dy; Sat, 17 Oct 2020 14:27:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8347.22264; Sat, 17 Oct 2020 14:27:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBM-0007gy-B2; Sat, 17 Oct 2020 14:27:40 +0000
Received: by outflank-mailman (input) for mailman id 8347;
 Sat, 17 Oct 2020 14:27:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBK-0007gm-SC
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b193685f-1c90-4a88-b6c9-205e7d7545ef;
 Sat, 17 Oct 2020 14:27:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBJ-0005Rm-VE
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBJ-0005Wt-UQ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBK-0007gm-SC
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:38 +0000
X-Inumbo-ID: b193685f-1c90-4a88-b6c9-205e7d7545ef
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b193685f-1c90-4a88-b6c9-205e7d7545ef;
	Sat, 17 Oct 2020 14:27:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CMUA5OvEd9311LqcA1tDnyNdFYqB71CbnRB4x+kp0FM=; b=XDo6LDiHIdYC4jyyVICBnRXeEL
	tm8LXDxC2/kBCn/O1JpuwD7m2Rl86NVdTYgHgxRe4Whf8bMDpsPgJu9lBfJcmPC3kKf/UO+pxAewz
	0Kylo/P86cWLTk2y9gPkh2Prb9FVBEbe78K9AHJpTS7oPc9g1kYoXJJMFTflYFc4t20k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBJ-0005Rm-VE
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBJ-0005Wt-UQ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/net/e1000e: Do not abort() on invalid PSRCTL register value
Message-Id: <E1kTnBJ-0005Wt-UQ@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:37 +0000

commit 0fd3972e1cd424b750b3eeb2baf5686cbaa20d8a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon May 25 14:23:30 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/net/e1000e: Do not abort() on invalid PSRCTL register value
    
    libFuzzer found using 'qemu-system-i386 -M q35':
    
    qemu: hardware error: e1000e: PSRCTL.BSIZE0 cannot be zero
    CPU #0:
    EAX=00000000 EBX=00000000 ECX=00000000 EDX=00000663
    ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
    EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
    ES =0000 00000000 0000ffff 00009300
    CS =f000 ffff0000 0000ffff 00009b00
    SS =0000 00000000 0000ffff 00009300
    DS =0000 00000000 0000ffff 00009300
    FS =0000 00000000 0000ffff 00009300
    GS =0000 00000000 0000ffff 00009300
    LDT=0000 00000000 0000ffff 00008200
    TR =0000 00000000 0000ffff 00008b00
    GDT=     00000000 0000ffff
    IDT=     00000000 0000ffff
    CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
    DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
    DR6=ffff0ff0 DR7=00000400
    EFER=0000000000000000
    FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
    FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
    FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
    FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
    FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
    XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
    XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
    XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
    XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000
    ==1988== ERROR: libFuzzer: deadly signal
        #6 0x7fae4d3ea894 in __GI_abort (/lib64/libc.so.6+0x22894)
        #7 0x563f4cc59a1d in hw_error (qemu-fuzz-i386+0xe8ca1d)
        #8 0x563f4d7c93f2 in e1000e_set_psrctl (qemu-fuzz-i386+0x19fc3f2)
        #9 0x563f4d7b798f in e1000e_core_write (qemu-fuzz-i386+0x19ea98f)
        #10 0x563f4d7afc46 in e1000e_mmio_write (qemu-fuzz-i386+0x19e2c46)
        #11 0x563f4cc9a0a7 in memory_region_write_accessor (qemu-fuzz-i386+0xecd0a7)
        #12 0x563f4cc99c13 in access_with_adjusted_size (qemu-fuzz-i386+0xeccc13)
        #13 0x563f4cc987b4 in memory_region_dispatch_write (qemu-fuzz-i386+0xecb7b4)
    
    It simply sent the following 2 I/O command to the e1000e
    PCI BAR #2 I/O region:
    
      writew 0x0100 0x0c00 # RCTL =   E1000_RCTL_DTYP_MASK
      writeb 0x2170 0x00   # PSRCTL = 0
    
    2813 static void
    2814 e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
    2815 {
    2816     if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
    2817
    2818         if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
    2819             hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
    2820         }
    
    Instead of calling hw_error() which abort the process (it is
    meant for CPU fatal error condition, not for device logging),
    log the invalid request with qemu_log_mask(LOG_GUEST_ERROR)
    and return, ignoring the request.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit fda43b1204aecd1db158b3255c591d227fbdd629)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/e1000e_core.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index d5676871fa..bcd186cac5 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -34,9 +34,9 @@
 */
 
 #include "qemu/osdep.h"
+#include "qemu/log.h"
 #include "net/net.h"
 #include "net/tap.h"
-#include "hw/hw.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 #include "sysemu/runstate.h"
@@ -2816,11 +2816,15 @@ e1000e_set_psrctl(E1000ECore *core, int index, uint32_t val)
     if (core->mac[RCTL] & E1000_RCTL_DTYP_MASK) {
 
         if ((val & E1000_PSRCTL_BSIZE0_MASK) == 0) {
-            hw_error("e1000e: PSRCTL.BSIZE0 cannot be zero");
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "e1000e: PSRCTL.BSIZE0 cannot be zero");
+            return;
         }
 
         if ((val & E1000_PSRCTL_BSIZE1_MASK) == 0) {
-            hw_error("e1000e: PSRCTL.BSIZE1 cannot be zero");
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "e1000e: PSRCTL.BSIZE1 cannot be zero");
+            return;
         }
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:27:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:27:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8348.22268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBW-0007iH-Fb; Sat, 17 Oct 2020 14:27:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8348.22268; Sat, 17 Oct 2020 14:27:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBW-0007i9-CZ; Sat, 17 Oct 2020 14:27:50 +0000
Received: by outflank-mailman (input) for mailman id 8348;
 Sat, 17 Oct 2020 14:27:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBU-0007hz-Sn
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 986af503-f5c0-465e-9b50-f274672546bb;
 Sat, 17 Oct 2020 14:27:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBU-0005Ru-2I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBU-0005XN-1B
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBU-0007hz-Sn
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
X-Inumbo-ID: 986af503-f5c0-465e-9b50-f274672546bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 986af503-f5c0-465e-9b50-f274672546bb;
	Sat, 17 Oct 2020 14:27:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1EQlKjQMJMFHERMHptpW5p1424x/RAYqx38glmkT2/4=; b=e3vo2s4X2fM/pMCD3+TVYHTuNy
	oYd4sxhzj8CB0nVixUkOzQnR+/t+chuk3jlJFapqsNE2OO3UZXjUYgN61rMAuru5AWBGuM1hNFoXp
	kV5SRN3S71vt/EYzU/6Bt4SVJ7SIGS4DRpmxdEhcKCmXVPDtw+W/4O1Fa978BthAk3ag=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBU-0005Ru-2I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBU-0005XN-1B
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtiofsd: Whitelist fchmod
Message-Id: <E1kTnBU-0005XN-1B@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:48 +0000

commit 0aad2a52555643126970b2cb1bef37e7a2d5d7ac
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Mon Jun 8 11:31:11 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtiofsd: Whitelist fchmod
    
    lo_setattr() invokes fchmod() in a rarely used code path, so it should
    be whitelisted or virtiofsd will crash with EBADSYS.
    
    Said code path can be triggered for example as follows:
    
    On the host, in the shared directory, create a file with the sticky bit
    set and a security.capability xattr:
    (1) # touch foo
    (2) # chmod u+s foo
    (3) # setcap '' foo
    
    Then in the guest let some process truncate that file after it has
    dropped all of its capabilities (at least CAP_FSETID):
    
    int main(int argc, char *argv[])
    {
        capng_setpid(getpid());
        capng_clear(CAPNG_SELECT_BOTH);
        capng_updatev(CAPNG_ADD, CAPNG_PERMITTED | CAPNG_EFFECTIVE, 0);
        capng_apply(CAPNG_SELECT_BOTH);
    
        ftruncate(open(argv[1], O_RDWR), 0);
    }
    
    This will cause the guest kernel to drop the sticky bit (i.e. perform a
    mode change) as part of the truncate (where FATTR_FH is set), and that
    will cause virtiofsd to invoke fchmod() instead of fchmodat().
    
    (A similar configuration exists further below with futimens() vs.
    utimensat(), but the former is not a syscall but just a wrapper for the
    latter, so no further whitelisting is required.)
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1842667
    Reported-by: Qian Cai <caiqian@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200608093111.14942-1-mreitz@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 63659fe74e76f5c5285466f0c5cfbdca65b3688e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tools/virtiofsd/seccomp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virtiofsd/seccomp.c b/tools/virtiofsd/seccomp.c
index bd9e7b083c..3b1522acdd 100644
--- a/tools/virtiofsd/seccomp.c
+++ b/tools/virtiofsd/seccomp.c
@@ -42,6 +42,7 @@ static const int syscall_whitelist[] = {
     SCMP_SYS(exit_group),
     SCMP_SYS(fallocate),
     SCMP_SYS(fchdir),
+    SCMP_SYS(fchmod),
     SCMP_SYS(fchmodat),
     SCMP_SYS(fchownat),
     SCMP_SYS(fcntl),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8349.22273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBg-0007lI-I1; Sat, 17 Oct 2020 14:28:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8349.22273; Sat, 17 Oct 2020 14:28:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBg-0007lA-E9; Sat, 17 Oct 2020 14:28:00 +0000
Received: by outflank-mailman (input) for mailman id 8349;
 Sat, 17 Oct 2020 14:27:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBf-0007kz-5H
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 503a9671-db37-45e5-89d4-22a7f09ee3ac;
 Sat, 17 Oct 2020 14:27:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBe-0005S4-6C
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBe-0005Y7-4e
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBf-0007kz-5H
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:59 +0000
X-Inumbo-ID: 503a9671-db37-45e5-89d4-22a7f09ee3ac
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 503a9671-db37-45e5-89d4-22a7f09ee3ac;
	Sat, 17 Oct 2020 14:27:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b7906/3I0AMQwz8OonZBNKxkuzY5LA9dNkhvOpb21X8=; b=XgDPvjpVhu+/K5Qm3taBq9HxiL
	efIthuvhfna2dMbahHPFNpJhQtAAzbX1PSvxPYHg5bLMAXAuP7SYoHbiYIz7J+QoLJf525VOXkRHW
	w3qhXx0hwcROvp+c+8FIgaRj9VKFR6sLCtAtFzOc7to9uUYanD7E+pxs2DprlhTwOb58=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBe-0005S4-6C
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBe-0005Y7-4e
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:27:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/audio/gus: Fix registers 32-bit access
Message-Id: <E1kTnBe-0005Y7-4e@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:27:58 +0000

commit 7a1f17a51e091507f7a645db6720fc8d832d7c3c
Author:     Allan Peramaki <aperamak@pp1.inet.fi>
AuthorDate: Thu Jun 18 12:36:23 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/audio/gus: Fix registers 32-bit access
    
    Fix audio on software that accesses DRAM above 64k via register
    peek/poke and some cases when more than 16 voices are used.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 135f5ae1974c ("audio: GUSsample is int16_t")
    Signed-off-by: Allan Peramaki <aperamak@pp1.inet.fi>
    Tested-by: Volker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20200618103623.6031-1-philmd@redhat.com
    Message-Id: <20200615201757.16868-1-aperamak@pp1.inet.fi>
    [PMD: Removed unrelated style changes]
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    (cherry picked from commit 586803455b3fa44d949ecd42cd9c87e5a6287aef)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/audio/gusemu_hal.c   | 2 +-
 hw/audio/gusemu_mixer.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c
index ae40ca341c..5b9a14ee21 100644
--- a/hw/audio/gusemu_hal.c
+++ b/hw/audio/gusemu_hal.c
@@ -32,7 +32,7 @@
 
 #define GUSregb(position) (*            (gusptr+(position)))
 #define GUSregw(position) (*(uint16_t *) (gusptr+(position)))
-#define GUSregd(position) (*(uint16_t *)(gusptr+(position)))
+#define GUSregd(position) (*(uint32_t *)(gusptr + (position)))
 
 /* size given in bytes */
 unsigned int gus_read(GUSEmuState * state, int port, int size)
diff --git a/hw/audio/gusemu_mixer.c b/hw/audio/gusemu_mixer.c
index 00b9861b92..56300de77e 100644
--- a/hw/audio/gusemu_mixer.c
+++ b/hw/audio/gusemu_mixer.c
@@ -28,7 +28,7 @@
 
 #define GUSregb(position)  (*            (gusptr+(position)))
 #define GUSregw(position)  (*(uint16_t *) (gusptr+(position)))
-#define GUSregd(position)  (*(uint16_t *)(gusptr+(position)))
+#define GUSregd(position)  (*(uint32_t *)(gusptr + (position)))
 
 #define GUSvoice(position) (*(uint16_t *)(voiceptr+(position)))
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8350.22276 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBq-0007mn-KV; Sat, 17 Oct 2020 14:28:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8350.22276; Sat, 17 Oct 2020 14:28:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnBq-0007mf-HZ; Sat, 17 Oct 2020 14:28:10 +0000
Received: by outflank-mailman (input) for mailman id 8350;
 Sat, 17 Oct 2020 14:28:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBp-0007mV-7w
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee1a1a4c-7304-4dbf-8437-184fc7feebc0;
 Sat, 17 Oct 2020 14:28:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBo-0005SO-AJ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBo-0005Yu-8c
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBp-0007mV-7w
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:09 +0000
X-Inumbo-ID: ee1a1a4c-7304-4dbf-8437-184fc7feebc0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee1a1a4c-7304-4dbf-8437-184fc7feebc0;
	Sat, 17 Oct 2020 14:28:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OOHJmm9jmS3NiLVdbjBDl2wOCAEZ1mMrypJE6pJiZsw=; b=rAJiKpFudZBi5h0dMQZPS/rff6
	QPJGI6eOJtL3JpMwO6IXgrwhe5bwA+DvHltCxbEJbRr47jd1XV3qfMFLrNGfxq3pAokK8yN6JXI0I
	5rLmF9yW7OuW9XdufY7CiXz8QpW2CsxRD63ihV1k5NXsl4n9BzCqJ+/NdEVIlOZEej3M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBo-0005SO-AJ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBo-0005Yu-8c
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] net/virtio: Fix failover_replug_primary() return value regression
Message-Id: <E1kTnBo-0005Yu-8c@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:08 +0000

commit b17b3c209b182c00a93e1987e4c1078275d162ce
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jun 30 11:03:26 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    net/virtio: Fix failover_replug_primary() return value regression
    
    Commit 150ab54aa6 "net/virtio: fix re-plugging of primary device"
    fixed failover_replug_primary() to return false on failure.  Commit
    5a0948d36c "net/virtio: Fix failover error handling crash bugs" broke
    it again for hotplug_handler_plug() failure.  Unbreak it.
    
    Commit 5a0948d36c4cbc1c5534afac6fee99de55245d12
    
    Fixes: 5a0948d36c4cbc1c5534afac6fee99de55245d12
    Cc: Jens Freimann <jfreimann@redhat.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Jens Freimann <jfreimann@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Message-Id: <20200630090351.1247703-2-armbru@redhat.com>
    (cherry picked from commit ca72efccbe33373810341a0d8a10f5698b8fbc87)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index a46e3b37a7..e7e2c2acdb 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -2828,7 +2828,7 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
         if (err) {
             goto out;
         }
-        hotplug_handler_plug(hotplug_ctrl, n->primary_dev, errp);
+        hotplug_handler_plug(hotplug_ctrl, n->primary_dev, &err);
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8351.22280 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnC0-0007o3-MM; Sat, 17 Oct 2020 14:28:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8351.22280; Sat, 17 Oct 2020 14:28:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnC0-0007nu-J6; Sat, 17 Oct 2020 14:28:20 +0000
Received: by outflank-mailman (input) for mailman id 8351;
 Sat, 17 Oct 2020 14:28:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnBz-0007nk-H1
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5078d30a-e380-4a8b-aca9-01f131f3c208;
 Sat, 17 Oct 2020 14:28:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBy-0005Sx-DZ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnBy-0005ZU-Cs
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnBz-0007nk-H1
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:19 +0000
X-Inumbo-ID: 5078d30a-e380-4a8b-aca9-01f131f3c208
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5078d30a-e380-4a8b-aca9-01f131f3c208;
	Sat, 17 Oct 2020 14:28:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qa6d5Ubs4zN+/Fv0+kAN4kjUxfgoigAbTJ4Gob387gY=; b=s7/xWGsJ0J5CzfITMjFhp7w6z5
	otjR4Y+MvJqH+FB3gnBya0eGrQ/HG10iYAcEXxsRetVscTfSSwAvX7k2hxxOG05nZZQHYV4OmezmN
	gCZtUznG/VdlB3s6ly++dWhMj+kNwUJWo8sxKs+enLAsdaBTXrhWV+nZLAdP8Jip/9fo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBy-0005Sx-DZ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnBy-0005ZU-Cs
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] error: Use error_reportf_err() where appropriate
Message-Id: <E1kTnBy-0005ZU-Cs@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:18 +0000

commit 558905635b5fedc96c0c3ea9c5ec9bd7d5faf1c9
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue May 5 12:19:03 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    error: Use error_reportf_err() where appropriate
    
    Replace
    
        error_report("...: %s", ..., error_get_pretty(err));
    
    by
    
        error_reportf_err(err, "...: ", ...);
    
    One of the replaced messages lacked a colon.  Add it.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200505101908.6207-6-armbru@redhat.com>
    (cherry picked from commit 5217f1887a8041c51495fbd5d3f767d96a242000)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 chardev/char-socket.c | 5 +++--
 hw/sd/pxa2xx_mmci.c   | 4 ++--
 hw/sd/sd.c            | 4 ++--
 hw/usb/dev-mtp.c      | 9 +++++----
 qemu-nbd.c            | 7 +++----
 scsi/qemu-pr-helper.c | 4 ++--
 6 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 185fe38dda..e5ee685f8c 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -138,8 +138,9 @@ static void check_report_connect_error(Chardev *chr,
     SocketChardev *s = SOCKET_CHARDEV(chr);
 
     if (!s->connect_err_reported) {
-        error_report("Unable to connect character device %s: %s",
-                     chr->label, error_get_pretty(err));
+        error_reportf_err(err,
+                          "Unable to connect character device %s: ",
+                          chr->label);
         s->connect_err_reported = true;
     }
     qemu_chr_socket_restart_timer(chr);
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index 8f9ab0ec16..f9c50ddda5 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -497,12 +497,12 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
     carddev = qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk, &err);
     if (err) {
-        error_report("failed to init SD card: %s", error_get_pretty(err));
+        error_reportf_err(err, "failed to init SD card: ");
         return NULL;
     }
     object_property_set_bool(OBJECT(carddev), true, "realized", &err);
     if (err) {
-        error_report("failed to init SD card: %s", error_get_pretty(err));
+        error_reportf_err(err, "failed to init SD card: ");
         return NULL;
     }
 
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 71a9af09ab..3c06a0ac6d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -703,13 +703,13 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
     dev = DEVICE(obj);
     qdev_prop_set_drive(dev, "drive", blk, &err);
     if (err) {
-        error_report("sd_init failed: %s", error_get_pretty(err));
+        error_reportf_err(err, "sd_init failed: ");
         return NULL;
     }
     qdev_prop_set_bit(dev, "spi", is_spi);
     object_property_set_bool(obj, true, "realized", &err);
     if (err) {
-        error_report("sd_init failed: %s", error_get_pretty(err));
+        error_reportf_err(err, "sd_init failed: ");
         return NULL;
     }
 
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 20717f026b..168428156b 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -631,8 +631,9 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
         int64_t id = qemu_file_monitor_add_watch(s->file_monitor, o->path, NULL,
                                                  file_monitor_event, s, &err);
         if (id == -1) {
-            error_report("usb-mtp: failed to add watch for %s: %s", o->path,
-                         error_get_pretty(err));
+            error_reportf_err(err,
+                              "usb-mtp: failed to add watch for %s: ",
+                              o->path);
             error_free(err);
         } else {
             trace_usb_mtp_file_monitor_event(s->dev.addr, o->path,
@@ -1276,8 +1277,8 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
 
         s->file_monitor = qemu_file_monitor_new(&err);
         if (err) {
-            error_report("usb-mtp: file monitoring init failed: %s",
-                         error_get_pretty(err));
+            error_reportf_err(err,
+                              "usb-mtp: file monitoring init failed: ");
             error_free(err);
         } else {
             QTAILQ_INIT(&s->events);
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 306e44fb0a..d2657b8db5 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -856,8 +856,7 @@ int main(int argc, char **argv)
         }
         tlscreds = nbd_get_tls_creds(tlscredsid, list, &local_err);
         if (local_err) {
-            error_report("Failed to get TLS creds %s",
-                         error_get_pretty(local_err));
+            error_reportf_err(local_err, "Failed to get TLS creds: ");
             exit(EXIT_FAILURE);
         }
     } else {
@@ -983,8 +982,8 @@ int main(int argc, char **argv)
                                              &local_err);
             if (sioc == NULL) {
                 object_unref(OBJECT(server));
-                error_report("Failed to use socket activation: %s",
-                             error_get_pretty(local_err));
+                error_reportf_err(local_err,
+                                  "Failed to use socket activation: ");
                 exit(EXIT_FAILURE);
             }
             qio_net_listener_add(server, sioc);
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index 181ed4a186..57ad830d54 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -1030,8 +1030,8 @@ int main(int argc, char **argv)
         server_ioc = qio_channel_socket_new_fd(FIRST_SOCKET_ACTIVATION_FD,
                                                &local_err);
         if (server_ioc == NULL) {
-            error_report("Failed to use socket activation: %s",
-                         error_get_pretty(local_err));
+            error_reportf_err(local_err,
+                              "Failed to use socket activation: ");
             exit(EXIT_FAILURE);
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8352.22284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCA-0007po-Nn; Sat, 17 Oct 2020 14:28:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8352.22284; Sat, 17 Oct 2020 14:28:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCA-0007pg-Ka; Sat, 17 Oct 2020 14:28:30 +0000
Received: by outflank-mailman (input) for mailman id 8352;
 Sat, 17 Oct 2020 14:28:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnC9-0007pZ-AB
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d863ba74-8661-44f9-a248-1eca044f6343;
 Sat, 17 Oct 2020 14:28:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnC8-0005T5-Gg
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnC8-0005a5-Fr
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnC9-0007pZ-AB
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:29 +0000
X-Inumbo-ID: d863ba74-8661-44f9-a248-1eca044f6343
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d863ba74-8661-44f9-a248-1eca044f6343;
	Sat, 17 Oct 2020 14:28:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G0OGNWjw7U4IzKEmP+cm0VvCM2g+2VhWml9y4umFLyM=; b=iT4Y8+KdK6rDxMAO5GzIFg2By6
	krvlqqMW2rK8tdDPUN+Zs+VbWAaVUSCb/P05ojv1lT8kn+ilhn/T0AjvVLRn4vKbhMCmS/PUJ0ZYf
	0ZDRpsDzvBSK1qITc3SvLi5elxQt0++W8NnsoA+dTxexK3O5srWpOfBOT93bsmb7648k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnC8-0005T5-Gg
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnC8-0005a5-Fr
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] usb/dev-mtp: Fix Error double free after inotify failure
Message-Id: <E1kTnC8-0005a5-Fr@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:28 +0000

commit b3e49baa79908d7e1c35df3814435dda72d85267
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jun 30 11:03:31 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    usb/dev-mtp: Fix Error double free after inotify failure
    
    error_report_err() frees its first argument.  Freeing it again is
    wrong.  Don't.
    
    Fixes: 47287c27d0c367a89f7b2851e23a7f8b2d499dd6
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200630090351.1247703-7-armbru@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    (cherry picked from commit 562a558647be6fe43e60f8bf3601e5b6122c0599)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/dev-mtp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 168428156b..15a2243101 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -634,7 +634,6 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
             error_reportf_err(err,
                               "usb-mtp: failed to add watch for %s: ",
                               o->path);
-            error_free(err);
         } else {
             trace_usb_mtp_file_monitor_event(s->dev.addr, o->path,
                                              "Watch Added");
@@ -1279,7 +1278,6 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
         if (err) {
             error_reportf_err(err,
                               "usb-mtp: file monitoring init failed: ");
-            error_free(err);
         } else {
             QTAILQ_INIT(&s->events);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8353.22288 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCK-0007r8-PK; Sat, 17 Oct 2020 14:28:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8353.22288; Sat, 17 Oct 2020 14:28:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCK-0007r0-ME; Sat, 17 Oct 2020 14:28:40 +0000
Received: by outflank-mailman (input) for mailman id 8353;
 Sat, 17 Oct 2020 14:28:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnCJ-0007qr-GG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e7d342ae-0f43-4a80-a518-2092ac695d4c;
 Sat, 17 Oct 2020 14:28:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCI-0005TD-Ly
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCI-0005am-Iy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnCJ-0007qr-GG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:39 +0000
X-Inumbo-ID: e7d342ae-0f43-4a80-a518-2092ac695d4c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e7d342ae-0f43-4a80-a518-2092ac695d4c;
	Sat, 17 Oct 2020 14:28:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uNbmHRKjkyalkh/VsUDlIc9REyeylHEHaa944KVoGlA=; b=vHrl/sZ3RBfcDrfPgXev8WiFAQ
	OpuPm9v7h6BfWFqyEYB3fsn3x8eciib4szrFFrlumkUMVEHb0w02ygytL0jGqkBL3rhgGkpRXIdBl
	LofBt4FdRIa0f4sT7j2od0N/Nn4dldZipiYfhv4twLasQ2LEgmbnJqQaiCAcz7pSxu/8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCI-0005TD-Ly
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCI-0005am-Iy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] nbd: Avoid off-by-one in long export name truncation
Message-Id: <E1kTnCI-0005am-Iy@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:38 +0000

commit 9380cb9de20b1554162eea9eb0e80209464ace50
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 22 16:03:55 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    nbd: Avoid off-by-one in long export name truncation
    
    When snprintf returns the same value as the buffer size, the final
    byte was truncated to ensure a NUL terminator.  Fortunately, such long
    export names are unusual enough, with no real impact other than what
    is displayed to the user.
    
    Fixes: 5c86bdf12089
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200622210355.414941-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    (cherry picked from commit 00d69986da83a74f6f5731c80f8dd09fde95d19a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index bfc0be6af6..bf3fbebfa0 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -2011,7 +2011,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
         len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
                        "nbd://%s:%s", host, port);
     }
-    if (len > sizeof(bs->exact_filename)) {
+    if (len >= sizeof(bs->exact_filename)) {
         /* Name is too long to represent exactly, so leave it empty. */
         bs->exact_filename[0] = '\0';
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:28:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:28:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8354.22291 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCU-0007sS-R4; Sat, 17 Oct 2020 14:28:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8354.22291; Sat, 17 Oct 2020 14:28:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCU-0007sJ-Np; Sat, 17 Oct 2020 14:28:50 +0000
Received: by outflank-mailman (input) for mailman id 8354;
 Sat, 17 Oct 2020 14:28:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnCT-0007sB-NN
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 39439209-2936-4214-9cd4-9083cfc7d373;
 Sat, 17 Oct 2020 14:28:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCS-0005TO-PG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCS-0005bM-OE
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnCT-0007sB-NN
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:49 +0000
X-Inumbo-ID: 39439209-2936-4214-9cd4-9083cfc7d373
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 39439209-2936-4214-9cd4-9083cfc7d373;
	Sat, 17 Oct 2020 14:28:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YDNEl6jT7svgxmyPGqiW/7kY0wiPX4ua1wEfEbi4e7U=; b=GgfaDel6l/K9jDT3kkMmbGdylh
	h0szASDPjbxImc65hOKSFO2pQvnC12mi8V/h9L6bdvTsropp6oqCZE0h1sAxPstF0RQeoS2fZOnF3
	NyBhVQk9LTFND9C23dS0vNekOtq1KKMJFn6enuhGpYH2rv9R7pGlJgkcCIPSdppdCT5Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCS-0005TO-PG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCS-0005bM-OE
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] chardev/tcp: Fix error message double free error
Message-Id: <E1kTnCS-0005bM-OE@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:48 +0000

commit 54e74a45a58912dd7705d53e965e9092a0631aa5
Author:     lichun <lichun@ruijie.com.cn>
AuthorDate: Mon Jun 22 05:30:17 2020 +0800
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    chardev/tcp: Fix error message double free error
    
    Errors are already freed by error_report_err, so we only need to call
    error_free when that function is not called.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: lichun <lichun@ruijie.com.cn>
    Message-Id: <20200621213017.17978-1-lichun@ruijie.com.cn>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Commit message improved, cc: qemu-stable]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    (cherry picked from commit ed4e0d2ef140aef255d67eec30767e5fcd949f58)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 chardev/char-socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index e5ee685f8c..58917870cd 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -142,6 +142,8 @@ static void check_report_connect_error(Chardev *chr,
                           "Unable to connect character device %s: ",
                           chr->label);
         s->connect_err_reported = true;
+    } else {
+        error_free(err);
     }
     qemu_chr_socket_restart_timer(chr);
 }
@@ -1083,7 +1085,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
     if (qio_task_propagate_error(task, &err)) {
         tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED);
         check_report_connect_error(chr, err);
-        error_free(err);
         goto cleanup;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8355.22297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCe-0007tp-So; Sat, 17 Oct 2020 14:29:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8355.22297; Sat, 17 Oct 2020 14:29:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCe-0007tg-PM; Sat, 17 Oct 2020 14:29:00 +0000
Received: by outflank-mailman (input) for mailman id 8355;
 Sat, 17 Oct 2020 14:28:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnCd-0007tS-Lt
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2088cf09-4b36-4040-8160-495b453b367a;
 Sat, 17 Oct 2020 14:28:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCc-0005TY-U4
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCc-0005c4-Rf
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnCd-0007tS-Lt
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:59 +0000
X-Inumbo-ID: 2088cf09-4b36-4040-8160-495b453b367a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2088cf09-4b36-4040-8160-495b453b367a;
	Sat, 17 Oct 2020 14:28:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8l8nUFAj94kyKPAx+k2JN8Qh1lgwxuZoYBifJKS6zYs=; b=Oy4ZmFmyOR26pZ2UKeNadx4OJ5
	2FwPSnY8egvrzf03IRpPaBjt5gOHHuklLXO9paRTdedOitQvbElx4Z3DDhQ6OLQY97nGh0sjuaAZC
	ktM2r2jYcnYSx2jEQfVbVIsuRFwGfcrPwH/WjjcnqcXWgwht0jjDZIgbxVmv8FsXajW4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCc-0005TY-U4
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCc-0005c4-Rf
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:28:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] qga: fix assert regression on guest-shutdown
Message-Id: <E1kTnCc-0005c4-Rf@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:28:58 +0000

commit a799013e71b56cee2d375fa34893dd9f4e8c3248
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Thu Jun 4 11:44:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qga: fix assert regression on guest-shutdown
    
    Since commit 781f2b3d1e ("qga: process_event() simplification"),
    send_response() is called unconditionally, but will assert when "rsp" is
    NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as
    "guest-shutdown".
    
    Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35
    Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit 844bd70b5652f30bbace89499f513e3fbbb6457a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index f0e454f28d..3febf3b0fd 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp)
     QString *payload_qstr, *response_qstr;
     GIOStatus status;
 
-    g_assert(rsp && s->channel);
+    g_assert(s->channel);
+
+    if (!rsp) {
+        return 0;
+    }
 
     payload_qstr = qobject_to_json(QOBJECT(rsp));
     if (!payload_qstr) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8356.22300 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCo-0007v3-Tt; Sat, 17 Oct 2020 14:29:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8356.22300; Sat, 17 Oct 2020 14:29:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCo-0007uv-Qy; Sat, 17 Oct 2020 14:29:10 +0000
Received: by outflank-mailman (input) for mailman id 8356;
 Sat, 17 Oct 2020 14:29:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnCn-0007ui-Sy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0afb77f-2c2a-4d98-a1d1-3b8c024d14a1;
 Sat, 17 Oct 2020 14:29:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCn-0005Ty-0m
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCn-0005cn-0B
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnCn-0007ui-Sy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
X-Inumbo-ID: f0afb77f-2c2a-4d98-a1d1-3b8c024d14a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0afb77f-2c2a-4d98-a1d1-3b8c024d14a1;
	Sat, 17 Oct 2020 14:29:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JugMsw2wQWq+Z3w8fjFw6CqIVFHM6F8YVKGrahd5z58=; b=D8cF4qbCpp+31dnfuz36OXziFK
	BVM672JjF+yM35YYC476qNzdXKntnuEEppgEtmWOVo3LH3Ntqv8M5W6lurG6/V6f8t/FaQbR7ehlt
	wwAoDtAMCRP1DReSwPTuyflqZPBiI2xy5iSXdbj8PKvb1KO96ePCeEGsW3c6bmaq3ofI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCn-0005Ty-0m
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCn-0005cn-0B
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] util: Introduce qemu_get_host_name()
Message-Id: <E1kTnCn-0005cn-0B@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:09 +0000

commit ad1169e23ce05aee2304eb737a1b4d51f3ea9e7e
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    util: Introduce qemu_get_host_name()
    
    This function offers operating system agnostic way to fetch host
    name. It is implemented for both POSIX-like and Windows systems.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit e47f4765afcab2b78dfa5b0115abf64d1d49a5d3)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/qemu/osdep.h | 10 ++++++++++
 util/oslib-posix.c   | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c   | 13 +++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 20f5c5f197..1866cab3c5 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -607,4 +607,14 @@ static inline void qemu_reset_optind(void)
 #endif
 }
 
+/**
+ * qemu_get_host_name:
+ * @errp: Error object
+ *
+ * Operating system agnostic way of querying host name.
+ *
+ * Returns allocated hostname (caller should free), NULL on failure.
+ */
+char *qemu_get_host_name(Error **errp);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 062236a1ab..e58fbc8e00 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -752,3 +752,38 @@ void sigaction_invoke(struct sigaction *action,
     }
     action->sa_sigaction(info->ssi_signo, &si, NULL);
 }
+
+#ifndef HOST_NAME_MAX
+# ifdef _POSIX_HOST_NAME_MAX
+#  define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+# else
+#  define HOST_NAME_MAX 255
+# endif
+#endif
+
+char *qemu_get_host_name(Error **errp)
+{
+    long len = -1;
+    g_autofree char *hostname = NULL;
+
+#ifdef _SC_HOST_NAME_MAX
+    len = sysconf(_SC_HOST_NAME_MAX);
+#endif /* _SC_HOST_NAME_MAX */
+
+    if (len < 0) {
+        len = HOST_NAME_MAX;
+    }
+
+    /* Unfortunately, gethostname() below does not guarantee a
+     * NULL terminated string. Therefore, allocate one byte more
+     * to be sure. */
+    hostname = g_new0(char, len + 1);
+
+    if (gethostname(hostname, len) < 0) {
+        error_setg_errno(errp, errno,
+                         "cannot get hostname");
+        return NULL;
+    }
+
+    return g_steal_pointer(&hostname);
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index e9b14ab178..3b49d27297 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -808,3 +808,16 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
     }
     return true;
 }
+
+char *qemu_get_host_name(Error **errp)
+{
+    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD size = G_N_ELEMENTS(tmp);
+
+    if (GetComputerNameW(tmp, &size) == 0) {
+        error_setg_win32(errp, GetLastError(), "failed close handle");
+        return NULL;
+    }
+
+    return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8357.22304 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnD0-0007wX-0k; Sat, 17 Oct 2020 14:29:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8357.22304; Sat, 17 Oct 2020 14:29:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnCz-0007wP-Tw; Sat, 17 Oct 2020 14:29:21 +0000
Received: by outflank-mailman (input) for mailman id 8357;
 Sat, 17 Oct 2020 14:29:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnCy-0007wD-0N
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4e188655-e9a7-48f7-90ca-f4239abde5fb;
 Sat, 17 Oct 2020 14:29:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCx-0005Uk-40
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnCx-0005dN-35
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnCy-0007wD-0N
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:20 +0000
X-Inumbo-ID: 4e188655-e9a7-48f7-90ca-f4239abde5fb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4e188655-e9a7-48f7-90ca-f4239abde5fb;
	Sat, 17 Oct 2020 14:29:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pk7MjHO6Q9h9SIx7rABiWWftHOWMzRknP37M3buejWE=; b=VPYWowBFYNt4S4k7wWv3SMnL3a
	UZUgXk01zIeGd5nRM5XfSI3hu2nl9jOzATW6jpf85v4IfVfn6kaK+e76Z8Hl5TPoMMrfc7LZDCGBt
	bv59Q8+o09Yoh0bCYdOTkEjlUBhxJEXDniqcsrMDb2Ycbiucwy0RnXwX97OJD3sAR62k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCx-0005Uk-40
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnCx-0005dN-35
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] qga: Use qemu_get_host_name() instead of g_get_host_name()
Message-Id: <E1kTnCx-0005dN-35@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:19 +0000

commit 3ddb01cd149f9d2064f8ce2dff6a75b2e18b3cd2
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qga: Use qemu_get_host_name() instead of g_get_host_name()
    
    Problem with g_get_host_name() is that on the first call it saves
    the hostname into a global variable and from then on, every
    subsequent call returns the saved hostname. Even if the hostname
    changes. This doesn't play nicely with guest agent, because if
    the hostname is acquired before the guest is set up (e.g. on the
    first boot, or before DHCP) we will report old, invalid hostname.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    (cherry picked from commit 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/qga/commands.c b/qga/commands.c
index efc8b90281..d3fec807c1 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -515,11 +515,20 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
 GuestHostName *qmp_guest_get_host_name(Error **errp)
 {
     GuestHostName *result = NULL;
-    gchar const *hostname = g_get_host_name();
-    if (hostname != NULL) {
-        result = g_new0(GuestHostName, 1);
-        result->host_name = g_strdup(hostname);
+    g_autofree char *hostname = qemu_get_host_name(errp);
+
+    /*
+     * We want to avoid using g_get_host_name() because that
+     * caches the result and we wouldn't reflect changes in the
+     * host name.
+     */
+
+    if (!hostname) {
+        hostname = g_strdup("localhost");
     }
+
+    result = g_new0(GuestHostName, 1);
+    result->host_name = g_steal_pointer(&hostname);
     return result;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8358.22307 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDA-0007yC-2M; Sat, 17 Oct 2020 14:29:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8358.22307; Sat, 17 Oct 2020 14:29:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnD9-0007y3-VU; Sat, 17 Oct 2020 14:29:31 +0000
Received: by outflank-mailman (input) for mailman id 8358;
 Sat, 17 Oct 2020 14:29:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnD8-0007xr-3K
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 39d249cd-78a8-43a4-8818-b9c91b798275;
 Sat, 17 Oct 2020 14:29:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnD7-0005Uu-70
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnD7-0005dx-6K
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnD8-0007xr-3K
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:30 +0000
X-Inumbo-ID: 39d249cd-78a8-43a4-8818-b9c91b798275
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 39d249cd-78a8-43a4-8818-b9c91b798275;
	Sat, 17 Oct 2020 14:29:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bCCh64XasMUjymXuZy6ukYAs7M796/W9bp/G9wtRcwo=; b=cLpJJpJxvUqAnSDSs5G2+NY6nd
	u3egocnHS/PQFKhtGIvjzneln5DI+wNP6gOdidBFCp6npfOA8crHPO7PssUyWoaINajQeccrjnJxn
	FGn1VpFWhsKr09E7R3dACcgX+2W9v/QLolsEcnt0QE5foruv78juVgsHO8ZcLmT+2ROc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnD7-0005Uu-70
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnD7-0005dx-6K
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] docs/orangepi: Add instructions for resizing SD image to power of two
Message-Id: <E1kTnD7-0005dx-6K@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:29 +0000

commit acb988e20cf1ae07f7926dea557bb27080a418d4
Author:     Niek Linnenbank <nieklinnenbank@gmail.com>
AuthorDate: Sun Jul 12 20:37:08 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    docs/orangepi: Add instructions for resizing SD image to power of two
    
    SD cards need to have a size of a power of two.
    Update the Orange Pi machine documentation to include
    instructions for resizing downloaded images using the
    qemu-img command.
    
    Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200712183708.15450-1-nieklinnenbank@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    (cherry picked from commit 1c2329b5d644bad16e888d095e2021ad682201d9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 docs/system/arm/orangepi.rst | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst
index c41adad488..6f23907fb6 100644
--- a/docs/system/arm/orangepi.rst
+++ b/docs/system/arm/orangepi.rst
@@ -127,6 +127,16 @@ can be downloaded from:
 Alternatively, you can also choose to build you own image with buildroot
 using the orangepi_pc_defconfig. Also see https://buildroot.org for more information.
 
+When using an image as an SD card, it must be resized to a power of two. This can be
+done with the qemu-img command. It is recommended to only increase the image size
+instead of shrinking it to a power of two, to avoid loss of data. For example,
+to prepare a downloaded Armbian image, first extract it and then increase
+its size to one gigabyte as follows:
+
+.. code-block:: bash
+
+  $ qemu-img resize Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img 1G
+
 You can choose to attach the selected image either as an SD card or as USB mass storage.
 For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd
 argument and provide the proper root= kernel parameter:
@@ -213,12 +223,12 @@ Next, unzip the NetBSD image and write the U-Boot binary including SPL using:
   $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc
 
 Finally, before starting the machine the SD image must be extended such
-that the NetBSD kernel will not conclude the NetBSD partition is larger than
-the emulated SD card:
+that the size of the SD image is a power of two and that the NetBSD kernel
+will not conclude the NetBSD partition is larger than the emulated SD card:
 
 .. code-block:: bash
 
-  $ dd if=/dev/zero bs=1M count=64 >> armv7.img
+  $ qemu-img resize armv7.img 2G
 
 Start the machine using the following command:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8359.22312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDK-0007zL-3d; Sat, 17 Oct 2020 14:29:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8359.22312; Sat, 17 Oct 2020 14:29:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDK-0007zD-0g; Sat, 17 Oct 2020 14:29:42 +0000
Received: by outflank-mailman (input) for mailman id 8359;
 Sat, 17 Oct 2020 14:29:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnDI-0007z2-9F
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b708e488-49f7-4671-83d2-15c1407f331e;
 Sat, 17 Oct 2020 14:29:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDH-0005V3-AB
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDH-0005eh-9O
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnDI-0007z2-9F
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:40 +0000
X-Inumbo-ID: b708e488-49f7-4671-83d2-15c1407f331e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b708e488-49f7-4671-83d2-15c1407f331e;
	Sat, 17 Oct 2020 14:29:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0ITrU1mf6wosbN8l34eqdoRRuj9L2SW0KNyO776YO3U=; b=4nWbZF9o1Q3Z7DIrJRyIuLvqEB
	2ZN+5y4K1V/617bbpmdZ96mdkUEZYaV5n61E8jvmfNAlOC/iQPHYZTwLTX28mS8DKs2t9hTJuwkGW
	4J8rC1iNo/C0VLf8NFt6LyAZ0/0EXc0nWZN25TtlF72MmFvMzBmAgEekA8S1Xc/e8MJE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDH-0005V3-AB
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDH-0005eh-9O
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
Message-Id: <E1kTnDH-0005eh-9O@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:39 +0000

commit 7b41093d14a02770af49cf472088e8a9d9ff9001
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:45:33 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
    
    Avocado tags are handy to automatically select tests matching
    the tags. Since these tests use a SD card, tag them.
    
    We can run all the tests using a SD card at once with:
    
      $ avocado --show=app run -t u-boot tests/acceptance/
      $ AVOCADO_ALLOW_LARGE_STORAGE=ok \
        avocado --show=app \
          run -t device:sd tests/acceptance/
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
       (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd: PASS (19.56 s)
       (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic: PASS (49.97 s)
       (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: PASS (20.06 s)
      RESULTS    : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
      JOB TIME   : 90.02 s
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-4-f4bug@amsat.org>
    (cherry picked from commit b7dcbf1395da960ec3c313300dc0030674de8cd1)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index f825cd9ef5..d864d22ca8 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -583,6 +583,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
@@ -632,6 +633,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
 
         # This test download a 196MB compressed image and expand it to 932MB...
@@ -673,6 +675,7 @@ class BootLinuxConsole(Test):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         # This test download a 304MB compressed image and expand it to 1.3GB...
         deb_url = ('http://snapshot.debian.org/archive/debian/'
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:29:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:29:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8360.22316 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDU-00080b-4y; Sat, 17 Oct 2020 14:29:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8360.22316; Sat, 17 Oct 2020 14:29:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDU-00080T-25; Sat, 17 Oct 2020 14:29:52 +0000
Received: by outflank-mailman (input) for mailman id 8360;
 Sat, 17 Oct 2020 14:29:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnDS-00080J-7S
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6b35a701-9b2d-40c7-9fe2-92e9b213ea6f;
 Sat, 17 Oct 2020 14:29:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDR-0005VB-D0
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDR-0005fQ-CQ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnDS-00080J-7S
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:50 +0000
X-Inumbo-ID: 6b35a701-9b2d-40c7-9fe2-92e9b213ea6f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6b35a701-9b2d-40c7-9fe2-92e9b213ea6f;
	Sat, 17 Oct 2020 14:29:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pX4sgiBeMMw8uK/f+dEE7N/XegnVueuqhbw7neC86qQ=; b=cNX1x7m69dej+5mNOBX1FBvplp
	SuXZKVZYSXwHsaFa2t6hylkDQdI9YG6mKJroQwI62IlgbLkJF01m5ixTJGJTEzk2IvwYZkG9lwXF9
	6vmxmIB0Lkbr9bnMpExMN6UHq5OWk/XCYFUh23shwoRABIrM/ot1KMBfdss2lQFYljCI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDR-0005VB-D0
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDR-0005fQ-CQ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests/acceptance: allow console interaction with specific VMs
Message-Id: <E1kTnDR-0005fQ-CQ@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:49 +0000

commit f756254e0aca5e29bb3216ab052cd28e6ee46c2b
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:04:39 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: allow console interaction with specific VMs
    
    Console interaction in avocado scripts was possible only with single
    default VM.
    This patch modifies the function parameters to allow passing a specific
    VM as a parameter to interact with it.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Reviewed-by: Willian Rampazzo <willianr@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073587933.20809.5122618715976660635.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit a5ba86d423c2b071894d86c60487f2317c7ffb60)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 59e7b4f763..77d1c1d9ff 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -69,13 +69,15 @@ def pick_default_qemu_bin(arch=None):
 
 
 def _console_interaction(test, success_message, failure_message,
-                         send_string, keep_sending=False):
+                         send_string, keep_sending=False, vm=None):
     assert not keep_sending or send_string
-    console = test.vm.console_socket.makefile()
+    if vm is None:
+        vm = test.vm
+    console = vm.console_socket.makefile()
     console_logger = logging.getLogger('console')
     while True:
         if send_string:
-            test.vm.console_socket.sendall(send_string.encode())
+            vm.console_socket.sendall(send_string.encode())
             if not keep_sending:
                 send_string = None # send only once
         msg = console.readline().strip()
@@ -115,7 +117,8 @@ def interrupt_interactive_console_until_pattern(test, success_message,
     _console_interaction(test, success_message, failure_message,
                          interrupt_string, True)
 
-def wait_for_console_pattern(test, success_message, failure_message=None):
+def wait_for_console_pattern(test, success_message, failure_message=None,
+                             vm=None):
     """
     Waits for messages to appear on the console, while logging the content
 
@@ -125,7 +128,7 @@ def wait_for_console_pattern(test, success_message, failure_message=None):
     :param success_message: if this message appears, test succeeds
     :param failure_message: if this message appears, test fails
     """
-    _console_interaction(test, success_message, failure_message, None)
+    _console_interaction(test, success_message, failure_message, None, vm=vm)
 
 def exec_command_and_wait_for_pattern(test, command,
                                       success_message, failure_message=None):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8361.22320 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDe-00088l-6s; Sat, 17 Oct 2020 14:30:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8361.22320; Sat, 17 Oct 2020 14:30:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDe-00088O-3Y; Sat, 17 Oct 2020 14:30:02 +0000
Received: by outflank-mailman (input) for mailman id 8361;
 Sat, 17 Oct 2020 14:30:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnDc-00081a-EP
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1391f23e-8e2e-49dc-a63b-7f0685e5f986;
 Sat, 17 Oct 2020 14:29:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDb-0005VJ-Fo
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDb-0005fy-FA
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnDc-00081a-EP
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:00 +0000
X-Inumbo-ID: 1391f23e-8e2e-49dc-a63b-7f0685e5f986
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1391f23e-8e2e-49dc-a63b-7f0685e5f986;
	Sat, 17 Oct 2020 14:29:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Kj2d4VDJxW1nPs2rhXr9gSPC8nc1anLmkdLFB7Lmsd8=; b=klCG2pk057LnNL5rCJ5E0K3aQa
	0TqaBE8EyQ8UGjbnD1B4V9SGpse1avmgbGP0zTcJdQvJW3Bs27JJcbbwu/SB3eRH5iVfdpCHOUPTh
	0+kUlOCTihZPAka7GRoIsP6WYcf4Vx4+QoIZw3ZQuludnOKpGPJpnFkstp1ydUscfxWU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDb-0005VJ-Fo
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDb-0005fy-FA
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:29:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests/acceptance: refactor boot_linux to allow code reuse
Message-Id: <E1kTnDb-0005fy-FA@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:29:59 +0000

commit 5bdcc0f3ed96effbff61b08ea55699c2cebae5e5
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:05:31 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: refactor boot_linux to allow code reuse
    
    This patch moves image downloading functions to the separate class to allow
    reusing them from record/replay tests.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073593167.20809.17582679291556188984.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit 1c80c87c8c2489e4318c93c844aa29bc1d014146)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux.py | 49 +++++++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
index 075a386300..3aa57e88b0 100644
--- a/tests/acceptance/boot_linux.py
+++ b/tests/acceptance/boot_linux.py
@@ -26,22 +26,8 @@ KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
 TCG_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "TCG"
 
 
-class BootLinux(Test):
-    """
-    Boots a Linux system, checking for a successful initialization
-    """
-
-    timeout = 900
-    chksum = None
-
-    def setUp(self):
-        super(BootLinux, self).setUp()
-        self.vm.add_args('-smp', '2')
-        self.vm.add_args('-m', '1024')
-        self.prepare_boot()
-        self.prepare_cloudinit()
-
-    def prepare_boot(self):
+class BootLinuxBase(Test):
+    def download_boot(self):
         self.log.debug('Looking for and selecting a qemu-img binary to be '
                        'used to create the bootable snapshot image')
         # If qemu-img has been built, use it, otherwise the system wide one
@@ -60,17 +46,17 @@ class BootLinux(Test):
         if image_arch == 'ppc64':
             image_arch = 'ppc64le'
         try:
-            self.boot = vmimage.get(
+            boot = vmimage.get(
                 'fedora', arch=image_arch, version='31',
                 checksum=self.chksum,
                 algorithm='sha256',
                 cache_dir=self.cache_dirs[0],
                 snapshot_dir=self.workdir)
-            self.vm.add_args('-drive', 'file=%s' % self.boot.path)
         except:
             self.cancel('Failed to download/prepare boot image')
+        return boot.path
 
-    def prepare_cloudinit(self):
+    def download_cloudinit(self):
         self.log.info('Preparing cloudinit image')
         try:
             cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso')
@@ -81,9 +67,32 @@ class BootLinux(Test):
                           # QEMU's hard coded usermode router address
                           phone_home_host='10.0.2.2',
                           phone_home_port=self.phone_home_port)
-            self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
         except Exception:
             self.cancel('Failed to prepared cloudinit image')
+        return cloudinit_iso
+
+class BootLinux(BootLinuxBase):
+    """
+    Boots a Linux system, checking for a successful initialization
+    """
+
+    timeout = 900
+    chksum = None
+
+    def setUp(self):
+        super(BootLinux, self).setUp()
+        self.vm.add_args('-smp', '2')
+        self.vm.add_args('-m', '1024')
+        self.prepare_boot()
+        self.prepare_cloudinit()
+
+    def prepare_boot(self):
+        path = self.download_boot()
+        self.vm.add_args('-drive', 'file=%s' % path)
+
+    def prepare_cloudinit(self):
+        cloudinit_iso = self.download_cloudinit()
+        self.vm.add_args('-drive', 'file=%s,format=raw' % cloudinit_iso)
 
     def launch_and_wait(self):
         self.vm.set_console()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8362.22325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDo-0000H7-94; Sat, 17 Oct 2020 14:30:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8362.22325; Sat, 17 Oct 2020 14:30:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDo-0000Gz-52; Sat, 17 Oct 2020 14:30:12 +0000
Received: by outflank-mailman (input) for mailman id 8362;
 Sat, 17 Oct 2020 14:30:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnDm-0000Go-LH
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6e794bf7-3405-4b32-a68e-0a17c1ff0f0f;
 Sat, 17 Oct 2020 14:30:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDl-0005Vr-J2
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDl-0005gk-IH
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnDm-0000Go-LH
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:10 +0000
X-Inumbo-ID: 6e794bf7-3405-4b32-a68e-0a17c1ff0f0f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6e794bf7-3405-4b32-a68e-0a17c1ff0f0f;
	Sat, 17 Oct 2020 14:30:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Oi5bhgiwMOG/mJdBAu6p6bmWGkrWjlJasHOADohoFLU=; b=tGygI9RuX5gNRev7ffzAeY0SZI
	qswYvrhOQD9eQ3h8TgSm/AxoxnpWB3RLgi2K3xI92n6g6023aFQzvYH8edFEqr27KcuzzDxKu44Yd
	sD/hpBEF9ZriWN3gi/JfcmkDcuPzDKf+3UX4JsOmsArhxe5mheh+oaEj4D/2Qinn/NIw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDl-0005Vr-J2
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDl-0005gk-IH
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests/acceptance: refactor boot_linux_console test to allow code reuse
Message-Id: <E1kTnDl-0005gk-IH@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:30:09 +0000

commit bc67d011c3a6a60fdaf790a72ab51bab263c7e9e
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
AuthorDate: Fri May 29 10:04:44 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: refactor boot_linux_console test to allow code reuse
    
    This patch splits code in BootLinuxConsole class into two different
    classes to allow reusing it by record/replay tests.
    
    Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    (cherry picked from commit 12121c496fcc609e23033c4a36399b54f98bcd56)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index d864d22ca8..e4204d8f09 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,19 +28,13 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
-class BootLinuxConsole(Test):
-    """
-    Boots a Linux kernel and checks that the console is operational and the
-    kernel command line is properly passed from QEMU to the kernel
-    """
-
-    timeout = 90
-
+class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
-    def wait_for_console_pattern(self, success_message):
+    def wait_for_console_pattern(self, success_message, vm=None):
         wait_for_console_pattern(self, success_message,
-                                 failure_message='Kernel panic - not syncing')
+                                 failure_message='Kernel panic - not syncing',
+                                 vm=vm)
 
     def extract_from_deb(self, deb, path):
         """
@@ -79,6 +73,13 @@ class BootLinuxConsole(Test):
         os.chdir(cwd)
         return os.path.normpath(os.path.join(self.workdir, path))
 
+class BootLinuxConsole(LinuxKernelTest):
+    """
+    Boots a Linux kernel and checks that the console is operational and the
+    kernel command line is properly passed from QEMU to the kernel
+    """
+    timeout = 90
+
     def test_x86_64_pc(self):
         """
         :avocado: tags=arch:x86_64
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8363.22328 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDy-0000Il-BC; Sat, 17 Oct 2020 14:30:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8363.22328; Sat, 17 Oct 2020 14:30:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnDy-0000Ib-8D; Sat, 17 Oct 2020 14:30:22 +0000
Received: by outflank-mailman (input) for mailman id 8363;
 Sat, 17 Oct 2020 14:30:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnDw-0000IS-SG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d54b54c3-fccd-45a1-bb62-ee9956c738d1;
 Sat, 17 Oct 2020 14:30:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDv-0005WP-MG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnDv-0005hI-LT
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnDw-0000IS-SG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:20 +0000
X-Inumbo-ID: d54b54c3-fccd-45a1-bb62-ee9956c738d1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d54b54c3-fccd-45a1-bb62-ee9956c738d1;
	Sat, 17 Oct 2020 14:30:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yIL8J2DqkZxkDFy+b/udvelDXFh2Ow6/HecWDaA9fV4=; b=47JBDcn6GS3LDNVDKemENuuoUg
	nM3q5gkafyQmW0VJPyEfedysckJwxqW+HEJZOuOIyRq4rkHK8AD35RifvXaKwW2vM8i0zOJ0eL45k
	8diZ/1t/msAndhc16WArkVVRcXsC3q0VKqE/M5ypKe72xO3xSiOwVBLQ30s0/7LXniKI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDv-0005WP-MG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnDv-0005hI-LT
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests/acceptance/boot_linux: Expand SD card image to power of 2
Message-Id: <E1kTnDv-0005hI-LT@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:30:19 +0000

commit b6f4d5bf209542ee9521d36bd891ad630e7c80b4
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 15:05:27 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance/boot_linux: Expand SD card image to power of 2
    
    In few commits we won't allow SD card images with invalid size
    (not aligned to a power of 2). Prepare the tests: add the
    pow2ceil() and image_pow2ceil_expand() methods and resize the
    images (expanding) of the tests using SD cards.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-5-f4bug@amsat.org>
    (cherry picked from commit 6a289a5ba3383e17fb47029720425bef42e424d7)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/acceptance/boot_linux_console.py | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index e4204d8f09..db901c1348 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,6 +28,22 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
+"""
+Round up to next power of 2
+"""
+def pow2ceil(x):
+    return 1 if x == 0 else 2**(x - 1).bit_length()
+
+"""
+Expand file size to next power of 2
+"""
+def image_pow2ceil_expand(path):
+        size = os.path.getsize(path)
+        size_aligned = pow2ceil(size)
+        if size != size_aligned:
+            with open(path, 'ab+') as fd:
+                fd.truncate(size_aligned)
+
 class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
@@ -600,6 +616,7 @@ class BootLinuxConsole(LinuxKernelTest):
         rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
         rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
         archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
+        image_pow2ceil_expand(rootfs_path)
 
         self.vm.set_console()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -637,7 +654,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=device:sd
         """
 
-        # This test download a 196MB compressed image and expand it to 932MB...
+        # This test download a 196MB compressed image and expand it to 1GB
         image_url = ('https://dl.armbian.com/orangepipc/archive/'
                      'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
         image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
@@ -645,6 +662,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
         image_path = os.path.join(self.workdir, image_name)
         process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
+        image_pow2ceil_expand(image_path)
 
         self.vm.set_console()
         self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
@@ -678,7 +696,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=machine:orangepi-pc
         :avocado: tags=device:sd
         """
-        # This test download a 304MB compressed image and expand it to 1.3GB...
+        # This test download a 304MB compressed image and expand it to 2GB
         deb_url = ('http://snapshot.debian.org/archive/debian/'
                    '20200108T145233Z/pool/main/u/u-boot/'
                    'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
@@ -695,8 +713,9 @@ class BootLinuxConsole(LinuxKernelTest):
         image_hash = '2babb29d36d8360adcb39c09e31060945259917a'
         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
         image_path = os.path.join(self.workdir, 'armv7.img')
-        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
         archive.gzip_uncompress(image_path_gz, image_path)
+        image_pow2ceil_expand(image_path)
+        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
 
         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
         with open(uboot_path, 'rb') as f_in:
@@ -704,12 +723,6 @@ class BootLinuxConsole(LinuxKernelTest):
                 f_out.seek(8 * 1024)
                 shutil.copyfileobj(f_in, f_out)
 
-                # Extend image, to avoid that NetBSD thinks the partition
-                # inside the image is larger than device size itself
-                f_out.seek(0, 2)
-                f_out.seek(64 * 1024 * 1024, 1)
-                f_out.write(bytearray([0x00]))
-
         self.vm.set_console()
         self.vm.add_args('-nic', 'user',
                          '-drive', image_drive_args,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8364.22332 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnE8-0000Kb-Cj; Sat, 17 Oct 2020 14:30:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8364.22332; Sat, 17 Oct 2020 14:30:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnE8-0000KT-9n; Sat, 17 Oct 2020 14:30:32 +0000
Received: by outflank-mailman (input) for mailman id 8364;
 Sat, 17 Oct 2020 14:30:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnE6-0000KL-OJ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6a533909-ba21-420d-8e0f-07b066c7e54a;
 Sat, 17 Oct 2020 14:30:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnE5-0005Wg-PE
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnE5-0005hk-Ob
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnE6-0000KL-OJ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:30 +0000
X-Inumbo-ID: 6a533909-ba21-420d-8e0f-07b066c7e54a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6a533909-ba21-420d-8e0f-07b066c7e54a;
	Sat, 17 Oct 2020 14:30:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hQeHARtSC+wYFSNbDKu5/Jd0xmwqqpz9RTNvCfYfoPc=; b=MIJSM4QCkazCh7zAwW0Y2oSE6b
	AalIKUdeJ6Z3MxIW35Oz1ny8bR0f02UfeFrZxC0GrKl2cdB7m7LBkOqbpOZgF8Hr6DVBKLBbysh+P
	OE2nRR0nMnSlm9xA0PF6ZrFLyet7Zi3Ypry1WOIKWNkzm1FKEIZMhlQnhgqbnNlLRvUQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnE5-0005Wg-PE
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnE5-0005hk-Ob
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
Message-Id: <E1kTnE5-0005hk-Ob@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:30:29 +0000

commit 557980ba70dba65bde208b03b902f419921b307a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Wed Jun 3 19:59:16 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
    
    Only SCSD cards support Class 6 (Block Oriented Write Protection)
    commands.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.14 Command Functional Difference in Card Capacity Types
    
      * Write Protected Group
    
      SDHC and SDXC do not support write-protected groups. Issuing
      CMD28, CMD29 and CMD30 generates the ILLEGAL_COMMAND error.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-7-f4bug@amsat.org>
    (cherry picked from commit 9157dd597d293ab7f599f4d96c3fe8a6e07c633d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3c06a0ac6d..da39590f58 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -905,6 +905,11 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
         sd->multi_blk_cnt = 0;
     }
 
+    if (sd_cmd_class[req.cmd] == 6 && FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
+        /* Only Standard Capacity cards support class 6 commands */
+        return sd_illegal;
+    }
+
     switch (req.cmd) {
     /* Basic commands (Class 0 and Class 1) */
     case 0:	/* CMD0:   GO_IDLE_STATE */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8366.22336 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEI-0000Lw-EU; Sat, 17 Oct 2020 14:30:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8366.22336; Sat, 17 Oct 2020 14:30:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEI-0000Lo-BK; Sat, 17 Oct 2020 14:30:42 +0000
Received: by outflank-mailman (input) for mailman id 8366;
 Sat, 17 Oct 2020 14:30:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnEG-0000Le-JS
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f3b094c0-4a12-404f-83cb-b39e96822761;
 Sat, 17 Oct 2020 14:30:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEF-0005Wn-TC
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEF-0005iI-Rc
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnEG-0000Le-JS
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:40 +0000
X-Inumbo-ID: f3b094c0-4a12-404f-83cb-b39e96822761
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f3b094c0-4a12-404f-83cb-b39e96822761;
	Sat, 17 Oct 2020 14:30:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xhvow3v9bgvfACYBLb3Jbpy8qbs+1tjlcqGw9AwZrUo=; b=IUVDLjiMg2KgFXGl7V9zB2+O3Q
	QP2sakjwoEAivgMMCicY6sPKPv7aPBFCL2V3JTgcFG/tfZDVKgbIwyH9MngQT2HhvhI713m5mWYGq
	mGRCWXcUQLT/YfEOt4BLydcY323l1/JUWQfi7MooxYJifsHM1FlAJrRn1ebauO+4fny0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEF-0005Wn-TC
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEF-0005iI-Rc
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/sd/sdcard: Simplify realize() a bit
Message-Id: <E1kTnEF-0005iI-Rc@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:30:39 +0000

commit 6a34f7752f05efbd0f26ea87f9e022469b4ac0d2
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jun 5 22:28:51 2018 -0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Simplify realize() a bit
    
    We don't need to check if sd->blk is set twice.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-18-f4bug@amsat.org>
    (cherry picked from commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index da39590f58..04258f1816 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2090,12 +2090,12 @@ static void sd_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (sd->blk && blk_is_read_only(sd->blk)) {
-        error_setg(errp, "Cannot use read-only drive as SD card");
-        return;
-    }
-
     if (sd->blk) {
+        if (blk_is_read_only(sd->blk)) {
+            error_setg(errp, "Cannot use read-only drive as SD card");
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:30:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:30:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8367.22339 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnER-0000NQ-Fq; Sat, 17 Oct 2020 14:30:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8367.22339; Sat, 17 Oct 2020 14:30:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnER-0000NJ-Cp; Sat, 17 Oct 2020 14:30:51 +0000
Received: by outflank-mailman (input) for mailman id 8367;
 Sat, 17 Oct 2020 14:30:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnEQ-0000ND-Vx
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d17aae00-5d8b-43ec-a013-fec01001c5b9;
 Sat, 17 Oct 2020 14:30:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEQ-0005Wu-2D
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEP-0005im-Va
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnEQ-0000ND-Vx
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:51 +0000
X-Inumbo-ID: d17aae00-5d8b-43ec-a013-fec01001c5b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d17aae00-5d8b-43ec-a013-fec01001c5b9;
	Sat, 17 Oct 2020 14:30:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V9Lt6gVnhnw2SAAQ1W9pJiQmOdeaUUwf3JuzRwoCX/Q=; b=3ea+tNsnNH6CiFRo/tJXJQ7ReV
	TB/EeWbdQgjDNJQ5tkW3SdwSMQ+jsA6imfs1JbN0F9G7tkvUN0x/VSBeAuG7MT35tZGlFos6Ert5x
	zce56DndGLx8PJBVgVyqwo8aplY7q+gspILKT2xdDMONiVIHVw2tJjaNeaoCJOkdWPJk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEQ-0005Wu-2D
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEP-0005im-Va
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:30:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/sd/sdcard: Do not allow invalid SD card sizes
Message-Id: <E1kTnEP-0005im-Va@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:30:49 +0000

commit e569ca39faf9dcd34fb7f0911ab1a3f7c3ffc0df
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 13:02:34 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Do not allow invalid SD card sizes
    
    QEMU allows to create SD card with unrealistic sizes. This could
    work, but some guests (at least Linux) consider sizes that are not
    a power of 2 as a firmware bug and fix the card size to the next
    power of 2.
    
    While the possibility to use small SD card images has been seen as
    a feature, it became a bug with CVE-2020-13253, where the guest is
    able to do OOB read/write accesses past the image size end.
    
    In a pair of commits we will fix CVE-2020-13253 as:
    
        Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        WP_VIOLATION errors are not modified: the error bit is set, we
        stay in receive-data state, wait for a stop command. All further
        data transfer is ignored. See the check on sd->card_status at the
        beginning of sd_read_data() and sd_write_data().
    
    While this is the correct behavior, in case QEMU create smaller SD
    cards, guests still try to access past the image size end, and QEMU
    considers this is an invalid address, thus "all further data transfer
    is ignored". This is wrong and make the guest looping until
    eventually timeouts.
    
    Fix by not allowing invalid SD card sizes (suggesting the expected
    size as a hint):
    
      $ qemu-system-arm -M orangepi-pc -drive file=rootfs.ext2,if=sd,format=raw
      qemu-system-arm: Invalid SD card size: 60 MiB
      SD card size has to be a power of 2, e.g. 64 MiB.
      You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
      (note that this will lose data if you make the image smaller than it currently is).
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200713183209.26308-8-f4bug@amsat.org>
    (cherry picked from commit a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 04258f1816..c34435ede4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "qemu/cutils.h"
 #include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "sysemu/block-backend.h"
@@ -2091,11 +2092,35 @@ static void sd_realize(DeviceState *dev, Error **errp)
     }
 
     if (sd->blk) {
+        int64_t blk_size;
+
         if (blk_is_read_only(sd->blk)) {
             error_setg(errp, "Cannot use read-only drive as SD card");
             return;
         }
 
+        blk_size = blk_getlength(sd->blk);
+        if (blk_size > 0 && !is_power_of_2(blk_size)) {
+            int64_t blk_size_aligned = pow2ceil(blk_size);
+            char *blk_size_str;
+
+            blk_size_str = size_to_str(blk_size);
+            error_setg(errp, "Invalid SD card size: %s", blk_size_str);
+            g_free(blk_size_str);
+
+            blk_size_str = size_to_str(blk_size_aligned);
+            error_append_hint(errp,
+                              "SD card size has to be a power of 2, e.g. %s.\n"
+                              "You can resize disk images with"
+                              " 'qemu-img resize <imagefile> <new-size>'\n"
+                              "(note that this will lose data if you make the"
+                              " image smaller than it currently is).\n",
+                              blk_size_str);
+            g_free(blk_size_str);
+
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8368.22344 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEb-0000Oi-HV; Sat, 17 Oct 2020 14:31:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8368.22344; Sat, 17 Oct 2020 14:31:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEb-0000Oa-EX; Sat, 17 Oct 2020 14:31:01 +0000
Received: by outflank-mailman (input) for mailman id 8368;
 Sat, 17 Oct 2020 14:31:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnEa-0000OT-Vn
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2d2cc9f6-6b3b-4ded-aaa7-94d33d35678b;
 Sat, 17 Oct 2020 14:31:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEa-0005X4-5I
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEa-0005jO-4f
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnEa-0000OT-Vn
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:01 +0000
X-Inumbo-ID: 2d2cc9f6-6b3b-4ded-aaa7-94d33d35678b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2d2cc9f6-6b3b-4ded-aaa7-94d33d35678b;
	Sat, 17 Oct 2020 14:31:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oz5WA+DwFAZOXwzpzjMdynfBOW/lexv/U6gSMGbyyD8=; b=eKFtbR5jDuFwYiYBKfwO4R/gMl
	HJ7FFmN7+Hgh6GR7OA7cpaJ5WaC5IkjvbpK43ZOWjXVByjzJL98JpQU1dr9e8mekEDccTWnTNoI5r
	qFgFjUNCZvBiNGu4p0mtWkp1fWo8TZYztS9fmDZfNARJV7f6PMfC13cFNeHqwojgO7ms=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEa-0005X4-5I
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEa-0005jO-4f
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/sd/sdcard: Update coding style to make checkpatch.pl happy
Message-Id: <E1kTnEa-0005jO-4f@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:00 +0000

commit c8966bff5f45a09bc335686bef7b1aa4722c3e4f
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:27:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Update coding style to make checkpatch.pl happy
    
    To make the next commit easier to review, clean this code first.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200630133912.9428-3-f4bug@amsat.org>
    (cherry picked from commit 794d68de2f021a6d3874df41d6bbe8590ec05207)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index c34435ede4..b927f7966d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1160,8 +1160,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1176,8 +1177,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1222,12 +1224,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
@@ -1246,12 +1251,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8369.22349 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEl-0000Pu-K3; Sat, 17 Oct 2020 14:31:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8369.22349; Sat, 17 Oct 2020 14:31:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEl-0000Pm-G4; Sat, 17 Oct 2020 14:31:11 +0000
Received: by outflank-mailman (input) for mailman id 8369;
 Sat, 17 Oct 2020 14:31:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnEl-0000Pg-5x
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f94956e4-1868-409d-baa5-ebda7e947952;
 Sat, 17 Oct 2020 14:31:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEk-0005XP-8H
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEk-0005kD-7c
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnEl-0000Pg-5x
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:11 +0000
X-Inumbo-ID: f94956e4-1868-409d-baa5-ebda7e947952
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f94956e4-1868-409d-baa5-ebda7e947952;
	Sat, 17 Oct 2020 14:31:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+4bCz25uBNxVKWmL7esnDBo45UQoLhENVQI3ZNCGk1g=; b=dJmwMIo4k0p35V5/BniuF/ieQO
	YuKrtdWACLcRUorviBf0cwEXvd0ieHO/rGipwfPcfS8D8nES0g4TxM5XhQoiiSBN9ZRAEmn94A/zS
	2v6Ac8t3n0DjoDYe3MRBpIbB1ZQcljP6VU37YTr1oBI6pz3+mSSwI5ptYTyilgBhK13o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEk-0005XP-8H
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEk-0005kD-7c
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
Message-Id: <E1kTnEk-0005kD-7c@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:10 +0000

commit d7fab184e98bc0d482b0203fd3333da972b7ca5f
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jun 4 19:22:29 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
    
    Only move the state machine to ReceivingData if there is no
    pending error. This avoids later OOB access while processing
    commands queued.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.3 Data Read
    
      Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
      4.3.4 Data Write
    
      Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
    WP_VIOLATION errors are not modified: the error bit is set, we
    stay in receive-data state, wait for a stop command. All further
    data transfer is ignored. See the check on sd->card_status at the
    beginning of sd_read_data() and sd_write_data().
    
    Fixes: CVE-2020-13253
    Cc: qemu-stable@nongnu.org
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880822
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-6-f4bug@amsat.org>
    (cherry picked from commit 790762e5487114341cccc5bffcec4cb3c022c3cd)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/sd/sd.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index b927f7966d..837fe9053d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1156,13 +1156,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 17:	/* CMD17:  READ_SINGLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1173,13 +1175,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 18:	/* CMD18:  READ_MULTIPLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1219,14 +1223,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
@@ -1246,14 +1253,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8370.22352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEv-0000RQ-Ly; Sat, 17 Oct 2020 14:31:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8370.22352; Sat, 17 Oct 2020 14:31:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnEv-0000RE-J2; Sat, 17 Oct 2020 14:31:21 +0000
Received: by outflank-mailman (input) for mailman id 8370;
 Sat, 17 Oct 2020 14:31:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnEv-0000R8-3Y
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d3be9c7e-dc59-4fb9-9527-3adc8c1bb320;
 Sat, 17 Oct 2020 14:31:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEu-0005YG-BQ
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnEu-0005l4-Ag
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnEv-0000R8-3Y
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:21 +0000
X-Inumbo-ID: d3be9c7e-dc59-4fb9-9527-3adc8c1bb320
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d3be9c7e-dc59-4fb9-9527-3adc8c1bb320;
	Sat, 17 Oct 2020 14:31:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ivKTmtEiRJdLuFK4gsasMJtmafOhyN/e2fXd8cPHul8=; b=mfKJrxHaoAKwQpHcnWLvVkf6jJ
	kQ89jjEB1d8GIs7xQdwLVMjyu0FW7SzySKadefQqB7kzQkaX3foC5de0lGt5sTjrVql92T69Jg0Ln
	ZKsXJJk+UiPtEL+egh76/wpGmLmUbquGrK1Qf6LjRLZYC2zTV+4nUodTnTmz7SQbVVSY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEu-0005YG-BQ
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnEu-0005l4-Ag
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] target/hppa: Free some temps in do_sub
Message-Id: <E1kTnEu-0005l4-Ag@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:20 +0000

commit 2f783fb4591fa244447547d226daed643820e2ef
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:35:00 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    target/hppa: Free some temps in do_sub
    
    Two temps allocated but not freed.  Do enough subtractions
    within a single TB and one can run out of temps entirely.
    
    Fixes: b2167459ae ("target-hppa: Implement basic arithmetic")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880287
    Tested-by: Sven Schnelle <svens@stackframe.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org>
    (cherry picked from commit 79826f99feb7222b7804058f0b4ace9ee0546361)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/hppa/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..4bd22d4820 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1,
     save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb);
     save_gpr(ctx, rt, dest);
     tcg_temp_free(dest);
+    tcg_temp_free(cb);
+    tcg_temp_free(cb_msb);
 
     /* Install the new nullification.  */
     cond_free(&ctx->null_cond);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8371.22356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnF5-0000T8-Nr; Sat, 17 Oct 2020 14:31:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8371.22356; Sat, 17 Oct 2020 14:31:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnF5-0000Sy-Kf; Sat, 17 Oct 2020 14:31:31 +0000
Received: by outflank-mailman (input) for mailman id 8371;
 Sat, 17 Oct 2020 14:31:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnF5-0000Sp-6b
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 591c4aec-4c27-4aac-9116-9321f2c12ed7;
 Sat, 17 Oct 2020 14:31:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnF4-0005YN-EG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnF4-0005le-De
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnF5-0000Sp-6b
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:31 +0000
X-Inumbo-ID: 591c4aec-4c27-4aac-9116-9321f2c12ed7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 591c4aec-4c27-4aac-9116-9321f2c12ed7;
	Sat, 17 Oct 2020 14:31:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=85kFuN3KrJmzu7b5kPjo2DIn9l0g1zUmb5kPFWhErPE=; b=Xbh/aI/58+8CxaesipuCuZkDQM
	Q7h2pmwMDsz8nqRUyU7J+dXFUcXSauQ42GUIXTWASW7+jV1eNmMCVyZRRItEvdC62fpWzYa+HVGbo
	EPos+u8wc4pwkqAeqAFMJYAu+5sPFPrkSFyih1IBbEdLtAA5uRSdAgLjJBvy/telxopA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnF4-0005YN-EG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnF4-0005le-De
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tpm: tpm_spapr: Exit on TPM backend failures
Message-Id: <E1kTnF4-0005le-De@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:30 +0000

commit 42e9a42083bdb253f32766038fa64063d6351b5e
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:24 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tpm: tpm_spapr: Exit on TPM backend failures
    
    Exit on TPM backend failures in the same way as the TPM CRB and TIS device
    models do. With this change we now get an error report when the backend
    did not start up properly:
    
    error: internal error: qemu unexpectedly closed the monitor:
    2020-07-07T12:49:28.333928Z qemu-system-ppc64: tpm-emulator: \
      TPM result for CMD_INIT: 0x101 operation failed
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-2-stefanb@linux.vnet.ibm.com
    (cherry picked from commit f8b332a1ff107dc014a52eaf9bf547995205f18a)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/tpm/tpm_spapr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index ce65eb2e45..b67aafb24e 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
                             TPM_SPAPR_BUFFER_MAX);
 
     tpm_backend_reset(s->be_driver);
-    tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
+
+    if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
+        exit(1);
+    }
 }
 
 static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8372.22360 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFG-0000UU-P7; Sat, 17 Oct 2020 14:31:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8372.22360; Sat, 17 Oct 2020 14:31:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFG-0000UM-MF; Sat, 17 Oct 2020 14:31:42 +0000
Received: by outflank-mailman (input) for mailman id 8372;
 Sat, 17 Oct 2020 14:31:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnFF-0000UE-Ag
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2ad45c2e-6ab0-4f90-af1f-0c17656ae802;
 Sat, 17 Oct 2020 14:31:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFE-0005YY-Hf
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFE-0005mC-GV
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnFF-0000UE-Ag
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:41 +0000
X-Inumbo-ID: 2ad45c2e-6ab0-4f90-af1f-0c17656ae802
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2ad45c2e-6ab0-4f90-af1f-0c17656ae802;
	Sat, 17 Oct 2020 14:31:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wP69L6nFaPoipQ98WBGct+9i5MH/lOS/pqPsW8muwFI=; b=pRKX9SYKH7HkV2hmC0yhNKNCen
	DIZNNlu+5/gizzDbIOv1rWrEZB1zulrgrWXHNp8ocHswtYg4fIc5ZZC8T1xWGJKa/6st5bp4fsIq4
	9vrI2aBHsqqZ8NnAsjQiDHZ5aVj+nexGG8lNJACwYgjq5oHxwiwnHWqlMKxY1BXPJBvw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFE-0005YY-Hf
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFE-0005mC-GV
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] tests: tpm: Skip over pcrUpdateCounter byte in result comparison
Message-Id: <E1kTnFE-0005mC-GV@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:40 +0000

commit d2581f25ec28666b5c6e6ffa4adbffde33181387
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:25 2020 -0400
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests: tpm: Skip over pcrUpdateCounter byte in result comparison
    
    The TPM 2 code in libtpms was fixed to handle the PCR 'TCB group' according
    to the PCClient profile. The change of the PCRs belonging to the 'TCB group'
    now affects the pcrUpdateCounter in the TPM2_PCRRead() responses where its
    value is now different (typically lower by '1') than what it was before. To
    not fail the tests, we skip the comparison of the 14th byte, which
    represents the pcrUpdateCounter.
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-3-stefanb@linux.vnet.ibm.com
    (cherry picked from commit df8a7568932e4c3c930fdfeb228dd72b4bb71a1f)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qtest/tpm-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index 34efae8f18..58a9593745 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
 
     tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
 
-    g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
+    /* skip pcrUpdateCounter (14th byte) in comparison */
+    g_assert(exp_resp_size >= 15);
+    g_assert_cmpmem(buffer, 13, exp_resp, 13);
+    g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
+                    &exp_resp[14], exp_resp_size - 14);
 }
 
 bool tpm_util_swtpm_has_tpm2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:31:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:31:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8373.22364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFQ-0000Vi-R2; Sat, 17 Oct 2020 14:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8373.22364; Sat, 17 Oct 2020 14:31:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFQ-0000Va-Nl; Sat, 17 Oct 2020 14:31:52 +0000
Received: by outflank-mailman (input) for mailman id 8373;
 Sat, 17 Oct 2020 14:31:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnFP-0000VQ-Et
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1a15a770-84be-4c05-af93-922582c46d9b;
 Sat, 17 Oct 2020 14:31:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFO-0005Yg-Kh
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFO-0005ms-Jw
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnFP-0000VQ-Et
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:51 +0000
X-Inumbo-ID: 1a15a770-84be-4c05-af93-922582c46d9b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1a15a770-84be-4c05-af93-922582c46d9b;
	Sat, 17 Oct 2020 14:31:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hOLmOaj8POz2mJZvFwIj+k62aHPUSUUghVzKLLW+cXE=; b=WDNMgv6nWrkUVu9SZS5KmPD2LF
	r+1wA6h2GmLtq/C0dJQmK5oo4siKX+CR1rSEKh1sqQxyEgbTxQ6G3OV7pNJ3+vyjxKeRG1NXF2e5b
	/Ivro6o86fj/BlDZyY4MZExDq+Q9csvvQPAC1B7Hmtvebj/YIEppK1+fDcEAYNGVRwtw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFO-0005Yg-Kh
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFO-0005ms-Jw
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:31:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] qdev: Fix device_add DRIVER,help to print to monitor
Message-Id: <E1kTnFO-0005ms-Jw@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:31:50 +0000

commit c16fd8a2bbf54a1d4fc599f6e88f69b8bbeecc28
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:58 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    qdev: Fix device_add DRIVER,help to print to monitor
    
    Help on device properties gets printed to stdout instead of the
    monitor.  If you have the monitor anywhere else, no help for you.
    Broken when commit e1043d674d "qdev: use object_property_help()"
    accidentally switched from qemu_printf() to printf().  Switch right
    back.
    
    Fixes: e1043d674d792ff64aebae1a3eafc08b38a8a085
    Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-2-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    (cherry picked from commit 029afc4e76041e1a320530d97f99122a1b3d5da2)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 9833b33549..6bf6339ff5 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -299,7 +299,7 @@ int qdev_device_help(QemuOpts *opts)
     }
     g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0);
     for (i = 0; i < array->len; i++) {
-        printf("%s\n", (char *)array->pdata[i]);
+        qemu_printf("%s\n", (char *)array->pdata[i]);
     }
     g_ptr_array_set_free_func(array, g_free);
     g_ptr_array_free(array, true);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8374.22368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFa-0000X1-SN; Sat, 17 Oct 2020 14:32:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8374.22368; Sat, 17 Oct 2020 14:32:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFa-0000Wt-PL; Sat, 17 Oct 2020 14:32:02 +0000
Received: by outflank-mailman (input) for mailman id 8374;
 Sat, 17 Oct 2020 14:32:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnFa-0000Wl-3J
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 871470d4-fd65-4b4e-9500-8f5a93b20839;
 Sat, 17 Oct 2020 14:32:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFZ-0005Yq-93
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFY-0005nT-Mx
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnFa-0000Wl-3J
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:02 +0000
X-Inumbo-ID: 871470d4-fd65-4b4e-9500-8f5a93b20839
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 871470d4-fd65-4b4e-9500-8f5a93b20839;
	Sat, 17 Oct 2020 14:32:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/D5LcKzJnoD9IjXPFXO/4uvcYM23B19KNnSFH7Hwfm4=; b=5K4ttLE1nBpkfZMyzCqQsVXJiX
	KHp8R5Km1NBIcxh6S5fSgtDATaVbOru+EA2f6sX2sdC/z/m/G9m4fdLWdDM4sWX3jXWLPnzFYrkJE
	Bv1qooQU+5uHrrwk1+8L5G7Sur14iZgln7ACAPZG2/kYyX1wsjb+N6YlhvF8shwlMwyA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFZ-0005Yq-93
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFY-0005nT-Mx
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: Prevent guest from starting a report when we didn't request one
Message-Id: <E1kTnFY-0005nT-Mx@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:00 +0000

commit 67808fda375e3a795ae84f3fb19b540f954fa96a
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:15 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Prevent guest from starting a report when we didn't request one
    
    Based on code review it appears possible for the driver to force the device
    out of a stopped state when hinting by repeating the last ID it was
    provided.
    
    Prevent this by only allowing a transition to the start state when we are
    in the requested state. This way the driver is only allowed to send one
    descriptor that will transition the device into the start state. All others
    will leave it in the stop state once it has finished.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175115.21935.99563.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 20a4da0f23078deeff5ea6d1e12f47d968d7c3c9)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index e20f90dad4..a30a0c7bfa 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -466,7 +466,8 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (id == dev->free_page_report_cmd_id) {
+        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
+            id == dev->free_page_report_cmd_id) {
             dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
         } else {
             /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8375.22371 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFl-0000YH-Tx; Sat, 17 Oct 2020 14:32:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8375.22371; Sat, 17 Oct 2020 14:32:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFl-0000YA-Qw; Sat, 17 Oct 2020 14:32:13 +0000
Received: by outflank-mailman (input) for mailman id 8375;
 Sat, 17 Oct 2020 14:32:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnFk-0000Y3-PE
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0e07aa77-573b-4474-8c7c-d117b6178987;
 Sat, 17 Oct 2020 14:32:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFj-0005ZB-C7
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFj-0005oR-BU
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnFk-0000Y3-PE
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:12 +0000
X-Inumbo-ID: 0e07aa77-573b-4474-8c7c-d117b6178987
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0e07aa77-573b-4474-8c7c-d117b6178987;
	Sat, 17 Oct 2020 14:32:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FINnlDx0/PBUrbvqZBbXBs+D04VfpLbnRC7+6mtUSh4=; b=siZLgTq5HjdwdNsLfLwBODvXvi
	O/f0A8Twpy6sWxLjEmwfaKTWj/RMBHZJt30mlOIlAllW7Pat5XBZhlFE/VzHNtDnmGUFezH9FfEw0
	T/QMQ/nnyM7UzfZlodxEeNJ5EVAQaFmF7FpiHxnGt0tAgS0mIaUy6CaRPARwLGPTJss4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFj-0005ZB-C7
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFj-0005oR-BU
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: Add locking to prevent possible race when starting hinting
Message-Id: <E1kTnFj-0005oR-BU@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:11 +0000

commit 7eb63fccf4cc533249bde484daba6e40264d74f9
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:22 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Add locking to prevent possible race when starting hinting
    
    There is already locking in place when we are stopping free page hinting
    but there is not similar protections in place when we start. I can only
    assume this was overlooked as in most cases the page hinting should not be
    occurring when we are starting the hinting, however there is still a chance
    we could be processing hints by the time we get back around to restarting
    the hinting so we are better off making sure to protect the state with the
    mutex lock rather than just updating the value with no protections.
    
    Based on feedback from Peter Maydell this issue had also been spotted by
    Coverity: CID 1430269
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 1a83e0b9c492a0eaeacd6fbb858fc81d04ab9c3e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index a30a0c7bfa..d6e31de1d9 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -532,6 +532,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
         return;
     }
 
+    qemu_mutex_lock(&s->free_page_lock);
+
     if (s->free_page_report_cmd_id == UINT_MAX) {
         s->free_page_report_cmd_id =
                        VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
@@ -540,6 +542,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
     }
 
     s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    qemu_mutex_unlock(&s->free_page_lock);
+
     virtio_notify_config(vdev);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8376.22376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFv-0000ZO-VU; Sat, 17 Oct 2020 14:32:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8376.22376; Sat, 17 Oct 2020 14:32:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnFv-0000ZG-SN; Sat, 17 Oct 2020 14:32:23 +0000
Received: by outflank-mailman (input) for mailman id 8376;
 Sat, 17 Oct 2020 14:32:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnFu-0000Z7-HY
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 84cd1195-ba98-4126-b089-11541811cdc3;
 Sat, 17 Oct 2020 14:32:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFt-0005Zm-F2
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnFt-0005p3-ER
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnFu-0000Z7-HY
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:22 +0000
X-Inumbo-ID: 84cd1195-ba98-4126-b089-11541811cdc3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 84cd1195-ba98-4126-b089-11541811cdc3;
	Sat, 17 Oct 2020 14:32:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0Rfu1WJAPcMNYVS/oIl/xkrgIQ+zAzUxdkZlqrs4XzQ=; b=C/B5FH1qhB2XGICp9SfzAIVmXS
	I3ZhgidIkLZZgMi19MlBs+2TEnEsoLAy5JrFctkldMuVfiFzfKxwjS7PQ0h4gpL2rziHJeMJ6Lqfh
	vZnPk+YuEPuUZ8/2WjB3uaag6tTo8wpubYnBrpoHeWUsahSZo16iSHhmaL2cx23rxV4o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFt-0005Zm-F2
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnFt-0005p3-ER
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: always indicate S_DONE when migration fails
Message-Id: <E1kTnFt-0005p3-ER@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:21 +0000

commit 6261aa4ff5e705a0f5ddd15c53d7b7051bace46d
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Mon Jun 29 10:06:15 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: always indicate S_DONE when migration fails
    
    If something goes wrong during precopy, before stopping the VM, we will
    never send a S_DONE indication to the VM, resulting in the hinted pages
    not getting released to be used by the guest OS (e.g., Linux).
    
    Easy to reproduce:
    1. Start migration (e.g., HMP "migrate -d 'exec:gzip -c > STATEFILE.gz'")
    2. Cancel migration (e.g., HMP "migrate_cancel")
    3. Oberve in the guest (e.g., cat /proc/meminfo) that there is basically
       no free memory left.
    
    While at it, add similar locking to virtio_balloon_free_page_done() as
    done in virtio_balloon_free_page_stop. Locking is still weird, but that
    has to be sorted out separately.
    
    There is nothing to do in the PRECOPY_NOTIFY_COMPLETE case. Add some
    comments regarding S_DONE handling.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Cc: Wei Wang <wei.w.wang@intel.com>
    Cc: Alexander Duyck <alexander.duyck@gmail.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200629080615.26022-1-david@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit dd8eeb9671fc881e613008bd20035b85fe45383d)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index d6e31de1d9..6c75db123e 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -572,8 +572,13 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
-    virtio_notify_config(vdev);
+    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+        /* See virtio_balloon_free_page_stop() */
+        qemu_mutex_lock(&s->free_page_lock);
+        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        qemu_mutex_unlock(&s->free_page_lock);
+        virtio_notify_config(vdev);
+    }
 }
 
 static int
@@ -597,17 +602,26 @@ virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
     case PRECOPY_NOTIFY_SETUP:
         precopy_enable_free_page_optimization();
         break;
-    case PRECOPY_NOTIFY_COMPLETE:
-    case PRECOPY_NOTIFY_CLEANUP:
     case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC:
         virtio_balloon_free_page_stop(dev);
         break;
     case PRECOPY_NOTIFY_AFTER_BITMAP_SYNC:
         if (vdev->vm_running) {
             virtio_balloon_free_page_start(dev);
-        } else {
-            virtio_balloon_free_page_done(dev);
+            break;
         }
+        /*
+         * Set S_DONE before migrating the vmstate, so the guest will reuse
+         * all hinted pages once running on the destination. Fall through.
+         */
+    case PRECOPY_NOTIFY_CLEANUP:
+        /*
+         * Especially, if something goes wrong during precopy or if migration
+         * is canceled, we have to properly communicate S_DONE to the VM.
+         */
+        virtio_balloon_free_page_done(dev);
+        break;
+    case PRECOPY_NOTIFY_COMPLETE:
         break;
     default:
         virtio_error(vdev, "%s: %d reason unknown", __func__, pnd->reason);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8377.22379 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnG7-0000bh-1z; Sat, 17 Oct 2020 14:32:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8377.22379; Sat, 17 Oct 2020 14:32:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnG6-0000bZ-VB; Sat, 17 Oct 2020 14:32:34 +0000
Received: by outflank-mailman (input) for mailman id 8377;
 Sat, 17 Oct 2020 14:32:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnG5-0000bQ-ON
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b3ba4891-378b-45e0-a611-6e98187a3bf9;
 Sat, 17 Oct 2020 14:32:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnG3-0005Zw-Il
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnG3-0005pZ-I3
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnG5-0000bQ-ON
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:33 +0000
X-Inumbo-ID: b3ba4891-378b-45e0-a611-6e98187a3bf9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b3ba4891-378b-45e0-a611-6e98187a3bf9;
	Sat, 17 Oct 2020 14:32:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H1Sh32JYLMnaQiIeyRxbD/pUeNcrW0IOBCRtpRdsAMk=; b=D7CkSuPNQPfCuQBnjq7G38VVRC
	MdkRtBskubH2sLH9WUuUGEJlR58Lo0fgNhfe8yVaAllVsUSpe6JhA36oOEpvW7zTSZIz2v+gDfdeL
	8P2uDUZ7Hya3vkFTj2bXSoGd4iqAUwq34HTcASXhBt/4957mZ3paU9GMbqAFpzuq6cHY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnG3-0005Zw-Il
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnG3-0005pZ-I3
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] linux-headers: update against Linux 5.7-rc3
Message-Id: <E1kTnG3-0005pZ-I3@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:31 +0000

commit 595c40575bf500ff20d508d90fa69caf27e3454d
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Mon Apr 27 12:24:14 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    linux-headers: update against Linux 5.7-rc3
    
    commit 6a8b55ed4056ea5559ebe4f6a4b247f627870d4c
    
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com> # virtio/vhost parts
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200427102415.10915-3-cohuck@redhat.com>
    (cherry picked from commit dc6f8d458a4ccc360723993f31d310d06469f55f)
    *dep for 3219b42f02
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/standard-headers/linux/ethtool.h           |  10 +-
 include/standard-headers/linux/input-event-codes.h |   5 +-
 include/standard-headers/linux/pci_regs.h          |   2 +
 include/standard-headers/linux/vhost_types.h       |   8 ++
 include/standard-headers/linux/virtio_balloon.h    |  12 ++-
 include/standard-headers/linux/virtio_ids.h        |   1 +
 include/standard-headers/linux/virtio_net.h        | 102 ++++++++++++++++++++-
 linux-headers/COPYING                              |   2 +
 linux-headers/asm-x86/kvm.h                        |   1 +
 linux-headers/asm-x86/unistd_32.h                  |   1 +
 linux-headers/asm-x86/unistd_64.h                  |   1 +
 linux-headers/asm-x86/unistd_x32.h                 |   1 +
 linux-headers/linux/kvm.h                          |  47 +++++++++-
 linux-headers/linux/mman.h                         |   5 +-
 linux-headers/linux/userfaultfd.h                  |  40 ++++++--
 linux-headers/linux/vfio.h                         |  37 ++++++++
 linux-headers/linux/vhost.h                        |  24 +++++
 17 files changed, 280 insertions(+), 19 deletions(-)

diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h
index 8adf3b018b..1200890c86 100644
--- a/include/standard-headers/linux/ethtool.h
+++ b/include/standard-headers/linux/ethtool.h
@@ -596,6 +596,9 @@ struct ethtool_pauseparam {
  * @ETH_SS_LINK_MODES: link mode names
  * @ETH_SS_MSG_CLASSES: debug message class names
  * @ETH_SS_WOL_MODES: wake-on-lan modes
+ * @ETH_SS_SOF_TIMESTAMPING: SOF_TIMESTAMPING_* flags
+ * @ETH_SS_TS_TX_TYPES: timestamping Tx types
+ * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
  */
 enum ethtool_stringset {
 	ETH_SS_TEST		= 0,
@@ -610,6 +613,9 @@ enum ethtool_stringset {
 	ETH_SS_LINK_MODES,
 	ETH_SS_MSG_CLASSES,
 	ETH_SS_WOL_MODES,
+	ETH_SS_SOF_TIMESTAMPING,
+	ETH_SS_TS_TX_TYPES,
+	ETH_SS_TS_RX_FILTERS,
 
 	/* add new constants above here */
 	ETH_SS_COUNT
@@ -1330,6 +1336,7 @@ enum ethtool_fec_config_bits {
 	ETHTOOL_FEC_OFF_BIT,
 	ETHTOOL_FEC_RS_BIT,
 	ETHTOOL_FEC_BASER_BIT,
+	ETHTOOL_FEC_LLRS_BIT,
 };
 
 #define ETHTOOL_FEC_NONE		(1 << ETHTOOL_FEC_NONE_BIT)
@@ -1337,6 +1344,7 @@ enum ethtool_fec_config_bits {
 #define ETHTOOL_FEC_OFF			(1 << ETHTOOL_FEC_OFF_BIT)
 #define ETHTOOL_FEC_RS			(1 << ETHTOOL_FEC_RS_BIT)
 #define ETHTOOL_FEC_BASER		(1 << ETHTOOL_FEC_BASER_BIT)
+#define ETHTOOL_FEC_LLRS		(1 << ETHTOOL_FEC_LLRS_BIT)
 
 /* CMDs currently supported */
 #define ETHTOOL_GSET		0x00000001 /* DEPRECATED, Get settings.
@@ -1521,7 +1529,7 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71,
 	ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT	 = 72,
 	ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT	 = 73,
-
+	ETHTOOL_LINK_MODE_FEC_LLRS_BIT			 = 74,
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
 };
diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h
index b484c25289..ebf72c1031 100644
--- a/include/standard-headers/linux/input-event-codes.h
+++ b/include/standard-headers/linux/input-event-codes.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
 /*
  * Input event codes
  *
@@ -652,6 +652,9 @@
 /* Electronic privacy screen control */
 #define KEY_PRIVACY_SCREEN_TOGGLE	0x279
 
+/* Select an area of screen to be copied */
+#define KEY_SELECTIVE_SCREENSHOT	0x27a
+
 /*
  * Some keyboards have keys which do not have a defined meaning, these keys
  * are intended to be programmed / bound to macros by the user. For most
diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h
index 5437690483..f9701410d3 100644
--- a/include/standard-headers/linux/pci_regs.h
+++ b/include/standard-headers/linux/pci_regs.h
@@ -605,6 +605,7 @@
 #define  PCI_EXP_SLTCTL_PWR_OFF        0x0400 /* Power Off */
 #define  PCI_EXP_SLTCTL_EIC	0x0800	/* Electromechanical Interlock Control */
 #define  PCI_EXP_SLTCTL_DLLSCE	0x1000	/* Data Link Layer State Changed Enable */
+#define  PCI_EXP_SLTCTL_IBPD_DISABLE	0x4000 /* In-band PD disable */
 #define PCI_EXP_SLTSTA		26	/* Slot Status */
 #define  PCI_EXP_SLTSTA_ABP	0x0001	/* Attention Button Pressed */
 #define  PCI_EXP_SLTSTA_PFD	0x0002	/* Power Fault Detected */
@@ -680,6 +681,7 @@
 #define PCI_EXP_LNKSTA2		50	/* Link Status 2 */
 #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2	52	/* v2 endpoints with link end here */
 #define PCI_EXP_SLTCAP2		52	/* Slot Capabilities 2 */
+#define  PCI_EXP_SLTCAP2_IBPD	0x00000001 /* In-band PD Disable Supported */
 #define PCI_EXP_SLTCTL2		56	/* Slot Control 2 */
 #define PCI_EXP_SLTSTA2		58	/* Slot Status 2 */
 
diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-headers/linux/vhost_types.h
index 5351fe172d..a678d8fbaa 100644
--- a/include/standard-headers/linux/vhost_types.h
+++ b/include/standard-headers/linux/vhost_types.h
@@ -119,6 +119,14 @@ struct vhost_scsi_target {
 	unsigned short reserved;
 };
 
+/* VHOST_VDPA specific definitions */
+
+struct vhost_vdpa_config {
+	uint32_t off;
+	uint32_t len;
+	uint8_t buf[0];
+};
+
 /* Feature bits */
 /* Log all write descriptors. Can be changed while device is active. */
 #define VHOST_F_LOG_ALL 26
diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h
index 9375ca2a70..f343bfefd8 100644
--- a/include/standard-headers/linux/virtio_balloon.h
+++ b/include/standard-headers/linux/virtio_balloon.h
@@ -36,6 +36,7 @@
 #define VIRTIO_BALLOON_F_DEFLATE_ON_OOM	2 /* Deflate balloon on OOM */
 #define VIRTIO_BALLOON_F_FREE_PAGE_HINT	3 /* VQ to report free pages */
 #define VIRTIO_BALLOON_F_PAGE_POISON	4 /* Guest is using page poisoning */
+#define VIRTIO_BALLOON_F_REPORTING	5 /* Page reporting virtqueue */
 
 /* Size of a PFN in the balloon interface. */
 #define VIRTIO_BALLOON_PFN_SHIFT 12
@@ -47,8 +48,15 @@ struct virtio_balloon_config {
 	uint32_t num_pages;
 	/* Number of pages we've actually got in balloon. */
 	uint32_t actual;
-	/* Free page report command id, readonly by guest */
-	uint32_t free_page_report_cmd_id;
+	/*
+	 * Free page hint command id, readonly by guest.
+	 * Was previously named free_page_report_cmd_id so we
+	 * need to carry that name for legacy support.
+	 */
+	union {
+		uint32_t free_page_hint_cmd_id;
+		uint32_t free_page_report_cmd_id;	/* deprecated */
+	};
 	/* Stores PAGE_POISON if page poisoning is in use */
 	uint32_t poison_val;
 };
diff --git a/include/standard-headers/linux/virtio_ids.h b/include/standard-headers/linux/virtio_ids.h
index 585e07b273..ecc27a1740 100644
--- a/include/standard-headers/linux/virtio_ids.h
+++ b/include/standard-headers/linux/virtio_ids.h
@@ -46,5 +46,6 @@
 #define VIRTIO_ID_IOMMU        23 /* virtio IOMMU */
 #define VIRTIO_ID_FS           26 /* virtio filesystem */
 #define VIRTIO_ID_PMEM         27 /* virtio pmem */
+#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */
 
 #endif /* _LINUX_VIRTIO_IDS_H */
diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h
index 260c3681d7..a90f79e1b1 100644
--- a/include/standard-headers/linux/virtio_net.h
+++ b/include/standard-headers/linux/virtio_net.h
@@ -57,6 +57,9 @@
 					 * Steering */
 #define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
 
+#define VIRTIO_NET_F_HASH_REPORT  57	/* Supports hash report */
+#define VIRTIO_NET_F_RSS	  60	/* Supports RSS RX steering */
+#define VIRTIO_NET_F_RSC_EXT	  61	/* extended coalescing info */
 #define VIRTIO_NET_F_STANDBY	  62	/* Act as standby for another device
 					 * with the same MAC.
 					 */
@@ -69,6 +72,17 @@
 #define VIRTIO_NET_S_LINK_UP	1	/* Link is up */
 #define VIRTIO_NET_S_ANNOUNCE	2	/* Announcement is needed */
 
+/* supported/enabled hash types */
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv4          (1 << 0)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4         (1 << 1)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4         (1 << 2)
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv6          (1 << 3)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6         (1 << 4)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6         (1 << 5)
+#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX         (1 << 6)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX        (1 << 7)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX        (1 << 8)
+
 struct virtio_net_config {
 	/* The config defining mac address (if VIRTIO_NET_F_MAC) */
 	uint8_t mac[ETH_ALEN];
@@ -92,6 +106,12 @@ struct virtio_net_config {
 	 * Any other value stands for unknown.
 	 */
 	uint8_t duplex;
+	/* maximum size of RSS key */
+	uint8_t rss_max_key_size;
+	/* maximum number of indirection table entries */
+	uint16_t rss_max_indirection_table_length;
+	/* bitmask of supported VIRTIO_NET_RSS_HASH_ types */
+	uint32_t supported_hash_types;
 } QEMU_PACKED;
 
 /*
@@ -104,6 +124,7 @@ struct virtio_net_config {
 struct virtio_net_hdr_v1 {
 #define VIRTIO_NET_HDR_F_NEEDS_CSUM	1	/* Use csum_start, csum_offset */
 #define VIRTIO_NET_HDR_F_DATA_VALID	2	/* Csum is valid */
+#define VIRTIO_NET_HDR_F_RSC_INFO	4	/* rsc info in csum_ fields */
 	uint8_t flags;
 #define VIRTIO_NET_HDR_GSO_NONE		0	/* Not a GSO frame */
 #define VIRTIO_NET_HDR_GSO_TCPV4	1	/* GSO frame, IPv4 TCP (TSO) */
@@ -113,11 +134,46 @@ struct virtio_net_hdr_v1 {
 	uint8_t gso_type;
 	__virtio16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
 	__virtio16 gso_size;	/* Bytes to append to hdr_len per frame */
-	__virtio16 csum_start;	/* Position to start checksumming from */
-	__virtio16 csum_offset;	/* Offset after that to place checksum */
+	union {
+		struct {
+			__virtio16 csum_start;
+			__virtio16 csum_offset;
+		};
+		/* Checksum calculation */
+		struct {
+			/* Position to start checksumming from */
+			__virtio16 start;
+			/* Offset after that to place checksum */
+			__virtio16 offset;
+		} csum;
+		/* Receive Segment Coalescing */
+		struct {
+			/* Number of coalesced segments */
+			uint16_t segments;
+			/* Number of duplicated acks */
+			uint16_t dup_acks;
+		} rsc;
+	};
 	__virtio16 num_buffers;	/* Number of merged rx buffers */
 };
 
+struct virtio_net_hdr_v1_hash {
+	struct virtio_net_hdr_v1 hdr;
+	uint32_t hash_value;
+#define VIRTIO_NET_HASH_REPORT_NONE            0
+#define VIRTIO_NET_HASH_REPORT_IPv4            1
+#define VIRTIO_NET_HASH_REPORT_TCPv4           2
+#define VIRTIO_NET_HASH_REPORT_UDPv4           3
+#define VIRTIO_NET_HASH_REPORT_IPv6            4
+#define VIRTIO_NET_HASH_REPORT_TCPv6           5
+#define VIRTIO_NET_HASH_REPORT_UDPv6           6
+#define VIRTIO_NET_HASH_REPORT_IPv6_EX         7
+#define VIRTIO_NET_HASH_REPORT_TCPv6_EX        8
+#define VIRTIO_NET_HASH_REPORT_UDPv6_EX        9
+	uint16_t hash_report;
+	uint16_t padding;
+};
+
 #ifndef VIRTIO_NET_NO_LEGACY
 /* This header comes first in the scatter-gather list.
  * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
@@ -228,7 +284,9 @@ struct virtio_net_ctrl_mac {
 
 /*
  * Control Receive Flow Steering
- *
+ */
+#define VIRTIO_NET_CTRL_MQ   4
+/*
  * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
  * enables Receive Flow Steering, specifying the number of the transmit and
  * receive queues that will be used. After the command is consumed and acked by
@@ -241,11 +299,47 @@ struct virtio_net_ctrl_mq {
 	__virtio16 virtqueue_pairs;
 };
 
-#define VIRTIO_NET_CTRL_MQ   4
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN        1
  #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX        0x8000
 
+/*
+ * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as
+ * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures
+ * the receive steering to use a hash calculated for incoming packet
+ * to decide on receive virtqueue to place the packet. The command
+ * also provides parameters to calculate a hash and receive virtqueue.
+ */
+struct virtio_net_rss_config {
+	uint32_t hash_types;
+	uint16_t indirection_table_mask;
+	uint16_t unclassified_queue;
+	uint16_t indirection_table[1/* + indirection_table_mask */];
+	uint16_t max_tx_vq;
+	uint8_t hash_key_length;
+	uint8_t hash_key_data[/* hash_key_length */];
+};
+
+ #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
+
+/*
+ * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device
+ * to include in the virtio header of the packet the value of the
+ * calculated hash and the report type of hash. It also provides
+ * parameters for hash calculation. The command requires feature
+ * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the
+ * layout of virtio header as defined in virtio_net_hdr_v1_hash.
+ */
+struct virtio_net_hash_config {
+	uint32_t hash_types;
+	/* for compatibility with virtio_net_rss_config */
+	uint16_t reserved[4];
+	uint8_t hash_key_length;
+	uint8_t hash_key_data[/* hash_key_length */];
+};
+
+ #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG         2
+
 /*
  * Control network offloads
  *
diff --git a/linux-headers/COPYING b/linux-headers/COPYING
index da4cb28feb..a635a38ef9 100644
--- a/linux-headers/COPYING
+++ b/linux-headers/COPYING
@@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see:
 	Documentation/process/license-rules.rst
 
 for more details.
+
+All contributions to the Linux Kernel are subject to this COPYING file.
diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
index 503d3f42da..3f3f780c8c 100644
--- a/linux-headers/asm-x86/kvm.h
+++ b/linux-headers/asm-x86/kvm.h
@@ -390,6 +390,7 @@ struct kvm_sync_regs {
 #define KVM_STATE_NESTED_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_RUN_PENDING	0x00000002
 #define KVM_STATE_NESTED_EVMCS		0x00000004
+#define KVM_STATE_NESTED_MTF_PENDING	0x00000008
 
 #define KVM_STATE_NESTED_SMM_GUEST_MODE	0x00000001
 #define KVM_STATE_NESTED_SMM_VMXON	0x00000002
diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h
index f6e06fcfbd..1e6c1a5867 100644
--- a/linux-headers/asm-x86/unistd_32.h
+++ b/linux-headers/asm-x86/unistd_32.h
@@ -429,4 +429,5 @@
 #define __NR_openat2 437
 #define __NR_pidfd_getfd 438
 
+
 #endif /* _ASM_X86_UNISTD_32_H */
diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h
index 924f826d2d..6daf0aecb2 100644
--- a/linux-headers/asm-x86/unistd_64.h
+++ b/linux-headers/asm-x86/unistd_64.h
@@ -351,4 +351,5 @@
 #define __NR_openat2 437
 #define __NR_pidfd_getfd 438
 
+
 #endif /* _ASM_X86_UNISTD_64_H */
diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h
index 010307757b..e3f17ef370 100644
--- a/linux-headers/asm-x86/unistd_x32.h
+++ b/linux-headers/asm-x86/unistd_x32.h
@@ -340,4 +340,5 @@
 #define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
 #define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
 
+
 #endif /* _ASM_X86_UNISTD_X32_H */
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 265099100e..9804495a46 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -474,12 +474,17 @@ struct kvm_s390_mem_op {
 	__u32 size;		/* amount of bytes */
 	__u32 op;		/* type of operation */
 	__u64 buf;		/* buffer in userspace */
-	__u8 ar;		/* the access register number */
-	__u8 reserved[31];	/* should be set to 0 */
+	union {
+		__u8 ar;	/* the access register number */
+		__u32 sida_offset; /* offset into the sida */
+		__u8 reserved[32]; /* should be set to 0 */
+	};
 };
 /* types for kvm_s390_mem_op->op */
 #define KVM_S390_MEMOP_LOGICAL_READ	0
 #define KVM_S390_MEMOP_LOGICAL_WRITE	1
+#define KVM_S390_MEMOP_SIDA_READ	2
+#define KVM_S390_MEMOP_SIDA_WRITE	3
 /* flags for kvm_s390_mem_op->flags */
 #define KVM_S390_MEMOP_F_CHECK_ONLY		(1ULL << 0)
 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION	(1ULL << 1)
@@ -1010,6 +1015,8 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_ARM_NISV_TO_USER 177
 #define KVM_CAP_ARM_INJECT_EXT_DABT 178
 #define KVM_CAP_S390_VCPU_RESETS 179
+#define KVM_CAP_S390_PROTECTED 180
+#define KVM_CAP_PPC_SECURE_GUEST 181
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -1478,6 +1485,39 @@ struct kvm_enc_region {
 #define KVM_S390_NORMAL_RESET	_IO(KVMIO,   0xc3)
 #define KVM_S390_CLEAR_RESET	_IO(KVMIO,   0xc4)
 
+struct kvm_s390_pv_sec_parm {
+	__u64 origin;
+	__u64 length;
+};
+
+struct kvm_s390_pv_unp {
+	__u64 addr;
+	__u64 size;
+	__u64 tweak;
+};
+
+enum pv_cmd_id {
+	KVM_PV_ENABLE,
+	KVM_PV_DISABLE,
+	KVM_PV_SET_SEC_PARMS,
+	KVM_PV_UNPACK,
+	KVM_PV_VERIFY,
+	KVM_PV_PREP_RESET,
+	KVM_PV_UNSHARE_ALL,
+};
+
+struct kvm_pv_cmd {
+	__u32 cmd;	/* Command to be executed */
+	__u16 rc;	/* Ultravisor return code */
+	__u16 rrc;	/* Ultravisor return reason code */
+	__u64 data;	/* Data or address */
+	__u32 flags;    /* flags for future extensions. Must be 0 for now */
+	__u32 reserved[3];
+};
+
+/* Available with KVM_CAP_S390_PROTECTED */
+#define KVM_S390_PV_COMMAND		_IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
+
 /* Secure Encrypted Virtualization command */
 enum sev_cmd_id {
 	/* Guest initialization commands */
@@ -1628,4 +1668,7 @@ struct kvm_hyperv_eventfd {
 #define KVM_HYPERV_CONN_ID_MASK		0x00ffffff
 #define KVM_HYPERV_EVENTFD_DEASSIGN	(1 << 0)
 
+#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE    (1 << 0)
+#define KVM_DIRTY_LOG_INITIALLY_SET            (1 << 1)
+
 #endif /* __LINUX_KVM_H */
diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h
index 1f6e2cd89c..51ea363759 100644
--- a/linux-headers/linux/mman.h
+++ b/linux-headers/linux/mman.h
@@ -5,8 +5,9 @@
 #include <asm/mman.h>
 #include <asm-generic/hugetlb_encode.h>
 
-#define MREMAP_MAYMOVE	1
-#define MREMAP_FIXED	2
+#define MREMAP_MAYMOVE		1
+#define MREMAP_FIXED		2
+#define MREMAP_DONTUNMAP	4
 
 #define OVERCOMMIT_GUESS		0
 #define OVERCOMMIT_ALWAYS		1
diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h
index ce78878d12..8d3996eb82 100644
--- a/linux-headers/linux/userfaultfd.h
+++ b/linux-headers/linux/userfaultfd.h
@@ -19,7 +19,8 @@
  * means the userland is reading).
  */
 #define UFFD_API ((__u64)0xAA)
-#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK |		\
+#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP |	\
+			   UFFD_FEATURE_EVENT_FORK |		\
 			   UFFD_FEATURE_EVENT_REMAP |		\
 			   UFFD_FEATURE_EVENT_REMOVE |	\
 			   UFFD_FEATURE_EVENT_UNMAP |		\
@@ -34,7 +35,8 @@
 #define UFFD_API_RANGE_IOCTLS			\
 	((__u64)1 << _UFFDIO_WAKE |		\
 	 (__u64)1 << _UFFDIO_COPY |		\
-	 (__u64)1 << _UFFDIO_ZEROPAGE)
+	 (__u64)1 << _UFFDIO_ZEROPAGE |		\
+	 (__u64)1 << _UFFDIO_WRITEPROTECT)
 #define UFFD_API_RANGE_IOCTLS_BASIC		\
 	((__u64)1 << _UFFDIO_WAKE |		\
 	 (__u64)1 << _UFFDIO_COPY)
@@ -52,6 +54,7 @@
 #define _UFFDIO_WAKE			(0x02)
 #define _UFFDIO_COPY			(0x03)
 #define _UFFDIO_ZEROPAGE		(0x04)
+#define _UFFDIO_WRITEPROTECT		(0x06)
 #define _UFFDIO_API			(0x3F)
 
 /* userfaultfd ioctl ids */
@@ -68,6 +71,8 @@
 				      struct uffdio_copy)
 #define UFFDIO_ZEROPAGE		_IOWR(UFFDIO, _UFFDIO_ZEROPAGE,	\
 				      struct uffdio_zeropage)
+#define UFFDIO_WRITEPROTECT	_IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
+				      struct uffdio_writeprotect)
 
 /* read() structure */
 struct uffd_msg {
@@ -203,13 +208,14 @@ struct uffdio_copy {
 	__u64 dst;
 	__u64 src;
 	__u64 len;
+#define UFFDIO_COPY_MODE_DONTWAKE		((__u64)1<<0)
 	/*
-	 * There will be a wrprotection flag later that allows to map
-	 * pages wrprotected on the fly. And such a flag will be
-	 * available if the wrprotection ioctl are implemented for the
-	 * range according to the uffdio_register.ioctls.
+	 * UFFDIO_COPY_MODE_WP will map the page write protected on
+	 * the fly.  UFFDIO_COPY_MODE_WP is available only if the
+	 * write protected ioctl is implemented for the range
+	 * according to the uffdio_register.ioctls.
 	 */
-#define UFFDIO_COPY_MODE_DONTWAKE		((__u64)1<<0)
+#define UFFDIO_COPY_MODE_WP			((__u64)1<<1)
 	__u64 mode;
 
 	/*
@@ -231,4 +237,24 @@ struct uffdio_zeropage {
 	__s64 zeropage;
 };
 
+struct uffdio_writeprotect {
+	struct uffdio_range range;
+/*
+ * UFFDIO_WRITEPROTECT_MODE_WP: set the flag to write protect a range,
+ * unset the flag to undo protection of a range which was previously
+ * write protected.
+ *
+ * UFFDIO_WRITEPROTECT_MODE_DONTWAKE: set the flag to avoid waking up
+ * any wait thread after the operation succeeds.
+ *
+ * NOTE: Write protecting a region (WP=1) is unrelated to page faults,
+ * therefore DONTWAKE flag is meaningless with WP=1.  Removing write
+ * protection (WP=0) in response to a page fault wakes the faulting
+ * task unless DONTWAKE is set.
+ */
+#define UFFDIO_WRITEPROTECT_MODE_WP		((__u64)1<<0)
+#define UFFDIO_WRITEPROTECT_MODE_DONTWAKE	((__u64)1<<1)
+	__u64 mode;
+};
+
 #endif /* _LINUX_USERFAULTFD_H */
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index fb10370d29..a41c452865 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -707,6 +707,43 @@ struct vfio_device_ioeventfd {
 
 #define VFIO_DEVICE_IOEVENTFD		_IO(VFIO_TYPE, VFIO_BASE + 16)
 
+/**
+ * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,
+ *			       struct vfio_device_feature)
+ *
+ * Get, set, or probe feature data of the device.  The feature is selected
+ * using the FEATURE_MASK portion of the flags field.  Support for a feature
+ * can be probed by setting both the FEATURE_MASK and PROBE bits.  A probe
+ * may optionally include the GET and/or SET bits to determine read vs write
+ * access of the feature respectively.  Probing a feature will return success
+ * if the feature is supported and all of the optionally indicated GET/SET
+ * methods are supported.  The format of the data portion of the structure is
+ * specific to the given feature.  The data portion is not required for
+ * probing.  GET and SET are mutually exclusive, except for use with PROBE.
+ *
+ * Return 0 on success, -errno on failure.
+ */
+struct vfio_device_feature {
+	__u32	argsz;
+	__u32	flags;
+#define VFIO_DEVICE_FEATURE_MASK	(0xffff) /* 16-bit feature index */
+#define VFIO_DEVICE_FEATURE_GET		(1 << 16) /* Get feature into data[] */
+#define VFIO_DEVICE_FEATURE_SET		(1 << 17) /* Set feature from data[] */
+#define VFIO_DEVICE_FEATURE_PROBE	(1 << 18) /* Probe feature support */
+	__u8	data[];
+};
+
+#define VFIO_DEVICE_FEATURE		_IO(VFIO_TYPE, VFIO_BASE + 17)
+
+/*
+ * Provide support for setting a PCI VF Token, which is used as a shared
+ * secret between PF and VF drivers.  This feature may only be set on a
+ * PCI SR-IOV PF when SR-IOV is enabled on the PF and there are no existing
+ * open VFs.  Data provided when setting this feature is a 16-byte array
+ * (__u8 b[16]), representing a UUID.
+ */
+#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN	(0)
+
 /* -------- API for Type1 VFIO IOMMU -------- */
 
 /**
diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
index 40d028eed6..9fe72e4b13 100644
--- a/linux-headers/linux/vhost.h
+++ b/linux-headers/linux/vhost.h
@@ -116,4 +116,28 @@
 #define VHOST_VSOCK_SET_GUEST_CID	_IOW(VHOST_VIRTIO, 0x60, __u64)
 #define VHOST_VSOCK_SET_RUNNING		_IOW(VHOST_VIRTIO, 0x61, int)
 
+/* VHOST_VDPA specific defines */
+
+/* Get the device id. The device ids follow the same definition of
+ * the device id defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_DEVICE_ID	_IOR(VHOST_VIRTIO, 0x70, __u32)
+/* Get and set the status. The status bits follow the same definition
+ * of the device status defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_STATUS		_IOR(VHOST_VIRTIO, 0x71, __u8)
+#define VHOST_VDPA_SET_STATUS		_IOW(VHOST_VIRTIO, 0x72, __u8)
+/* Get and set the device config. The device config follows the same
+ * definition of the device config defined in virtio-spec.
+ */
+#define VHOST_VDPA_GET_CONFIG		_IOR(VHOST_VIRTIO, 0x73, \
+					     struct vhost_vdpa_config)
+#define VHOST_VDPA_SET_CONFIG		_IOW(VHOST_VIRTIO, 0x74, \
+					     struct vhost_vdpa_config)
+/* Enable/disable the ring. */
+#define VHOST_VDPA_SET_VRING_ENABLE	_IOW(VHOST_VIRTIO, 0x75, \
+					     struct vhost_vring_state)
+/* Get the max ring size. */
+#define VHOST_VDPA_GET_VRING_NUM	_IOR(VHOST_VIRTIO, 0x76, __u16)
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8378.22385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGG-0000cl-4L; Sat, 17 Oct 2020 14:32:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8378.22385; Sat, 17 Oct 2020 14:32:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGG-0000cd-0W; Sat, 17 Oct 2020 14:32:44 +0000
Received: by outflank-mailman (input) for mailman id 8378;
 Sat, 17 Oct 2020 14:32:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnGF-0000cW-04
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c06e5438-5228-40a5-9649-f33c90521f7c;
 Sat, 17 Oct 2020 14:32:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGD-0005bZ-Lp
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGD-0005rk-LA
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnGF-0000cW-04
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:43 +0000
X-Inumbo-ID: c06e5438-5228-40a5-9649-f33c90521f7c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c06e5438-5228-40a5-9649-f33c90521f7c;
	Sat, 17 Oct 2020 14:32:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZpMl/WD3QXZD3C/O0RXpswiCFMKPg992X/PJtoXvqwE=; b=VjiYLUCc21ipsQ0e4h18sGwxzD
	WhjQyngc+O8W6lDcYTwXhGCs5CxCQC/QBOGlS/r+Fv35Kz/0JbNwyzJ0/ZUab9e3fCPDjxLg8EGPa
	6naQfrhke/DURa8mjk2ATWTWWYUJyd0clKijcl56ArJBwqupInttFKrseksRNyCIwOHA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGD-0005bZ-Lp
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGD-0005rk-LA
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-balloon: Replace free page hinting references to 'report' with 'hint'
Message-Id: <E1kTnGD-0005rk-LA@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:41 +0000

commit 7c4c30e764e2e177fefe241a0f8559b02def9089
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:28 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    virtio-balloon: Replace free page hinting references to 'report' with 'hint'
    
    Recently a feature named Free Page Reporting was added to the virtio
    balloon. In order to avoid any confusion we should drop the use of the word
    'report' when referring to Free Page Hinting. So what this patch does is go
    through and replace all instances of 'report' with 'hint" when we are
    referring to free page hinting.
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175128.21935.93927.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 3219b42f025d4d7a9c463235e9f937ab38067de3)
     Conflicts:
            hw/virtio/virtio-balloon.c
            include/hw/virtio/virtio-balloon.h
    *drop context deps on 91b867191d and 7483cbbaf8
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-balloon.c         | 76 +++++++++++++++++++-------------------
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 6c75db123e..035d4e0665 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -466,22 +466,22 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
-            id == dev->free_page_report_cmd_id) {
-            dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED &&
+            id == dev->free_page_hint_cmd_id) {
+            dev->free_page_hint_status = FREE_PAGE_HINT_S_START;
         } else {
             /*
              * Stop the optimization only when it has started. This
              * avoids a stale stop sign for the previous command.
              */
-            if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
-                dev->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+            if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
+                dev->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
             }
         }
     }
 
     if (elem->in_num) {
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
             qemu_guest_free_page_hint(elem->in_sg[0].iov_base,
                                       elem->in_sg[0].iov_len);
         }
@@ -507,11 +507,11 @@ static void virtio_ballloon_get_free_page_hints(void *opaque)
         qemu_mutex_unlock(&dev->free_page_lock);
         virtio_notify(vdev, vq);
       /*
-       * Start to poll the vq once the reporting started. Otherwise, continue
+       * Start to poll the vq once the hinting started. Otherwise, continue
        * only when there are entries on the vq, which need to be given back.
        */
     } while (continue_to_get_hints ||
-             dev->free_page_report_status == FREE_PAGE_REPORT_S_START);
+             dev->free_page_hint_status == FREE_PAGE_HINT_S_START);
     virtio_queue_set_notification(vq, 1);
 }
 
@@ -534,14 +534,14 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
 
     qemu_mutex_lock(&s->free_page_lock);
 
-    if (s->free_page_report_cmd_id == UINT_MAX) {
-        s->free_page_report_cmd_id =
-                       VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    if (s->free_page_hint_cmd_id == UINT_MAX) {
+        s->free_page_hint_cmd_id =
+                       VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
     } else {
-        s->free_page_report_cmd_id++;
+        s->free_page_hint_cmd_id++;
     }
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    s->free_page_hint_status = FREE_PAGE_HINT_S_REQUESTED;
     qemu_mutex_unlock(&s->free_page_lock);
 
     virtio_notify_config(vdev);
@@ -551,18 +551,18 @@ static void virtio_balloon_free_page_stop(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_STOP) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_STOP) {
         /*
          * The lock also guarantees us that the
          * virtio_ballloon_get_free_page_hints exits after the
-         * free_page_report_status is set to S_STOP.
+         * free_page_hint_status is set to S_STOP.
          */
         qemu_mutex_lock(&s->free_page_lock);
         /*
-         * The guest hasn't done the reporting, so host sends a notification
-         * to the guest to actively stop the reporting.
+         * The guest isn't done hinting, so send a notification
+         * to the guest to actively stop the hinting.
          */
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
@@ -572,20 +572,20 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_DONE) {
         /* See virtio_balloon_free_page_stop() */
         qemu_mutex_lock(&s->free_page_lock);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_DONE;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
 }
 
 static int
-virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
+virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data)
 {
     VirtIOBalloon *dev = container_of(n, VirtIOBalloon,
-                                      free_page_report_notify);
+                                      free_page_hint_notify);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     PrecopyNotifyData *pnd = data;
 
@@ -643,7 +643,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon *s)
     if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         return offsetof(struct virtio_balloon_config, poison_val);
     }
-    return offsetof(struct virtio_balloon_config, free_page_report_cmd_id);
+    return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id);
 }
 
 static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
@@ -654,14 +654,14 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
     config.num_pages = cpu_to_le32(dev->num_pages);
     config.actual = cpu_to_le32(dev->actual);
 
-    if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED) {
-        config.free_page_report_cmd_id =
-                       cpu_to_le32(dev->free_page_report_cmd_id);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_STOP) {
-        config.free_page_report_cmd_id =
+    if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED) {
+        config.free_page_hint_cmd_id =
+                       cpu_to_le32(dev->free_page_hint_cmd_id);
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_STOP) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) {
-        config.free_page_report_cmd_id =
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_DONE) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE);
     }
 
@@ -762,14 +762,14 @@ static int virtio_balloon_post_load_device(void *opaque, int version_id)
     return 0;
 }
 
-static const VMStateDescription vmstate_virtio_balloon_free_page_report = {
+static const VMStateDescription vmstate_virtio_balloon_free_page_hint = {
     .name = "virtio-balloon-device/free-page-report",
     .version_id = 1,
     .minimum_version_id = 1,
     .needed = virtio_balloon_free_page_support,
     .fields = (VMStateField[]) {
-        VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon),
-        VMSTATE_UINT32(free_page_report_status, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -785,7 +785,7 @@ static const VMStateDescription vmstate_virtio_balloon_device = {
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * []) {
-        &vmstate_virtio_balloon_free_page_report,
+        &vmstate_virtio_balloon_free_page_hint,
         NULL
     }
 };
@@ -823,7 +823,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        precopy_add_notifier(&s->free_page_report_notify);
+        precopy_add_notifier(&s->free_page_hint_notify);
 
         object_ref(OBJECT(s->iothread));
         s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
@@ -841,7 +841,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp)
         qemu_bh_delete(s->free_page_bh);
         object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
-        precopy_remove_notifier(&s->free_page_report_notify);
+        precopy_remove_notifier(&s->free_page_hint_notify);
     }
     balloon_stats_destroy_timer(s);
     qemu_remove_balloon_handler(s);
@@ -908,8 +908,8 @@ static void virtio_balloon_instance_init(Object *obj)
 
     qemu_mutex_init(&s->free_page_lock);
     qemu_cond_init(&s->free_page_cond);
-    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+    s->free_page_hint_cmd_id = VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
+    s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify;
 
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s, NULL);
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index d1c968d237..108cff97e7 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -23,7 +23,7 @@
 #define VIRTIO_BALLOON(obj) \
         OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
 
-#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000
+#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000
 
 typedef struct virtio_balloon_stat VirtIOBalloonStat;
 
@@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern {
        uint64_t val;
 } VirtIOBalloonStatModern;
 
-enum virtio_balloon_free_page_report_status {
-    FREE_PAGE_REPORT_S_STOP = 0,
-    FREE_PAGE_REPORT_S_REQUESTED = 1,
-    FREE_PAGE_REPORT_S_START = 2,
-    FREE_PAGE_REPORT_S_DONE = 3,
+enum virtio_balloon_free_page_hint_status {
+    FREE_PAGE_HINT_S_STOP = 0,
+    FREE_PAGE_HINT_S_REQUESTED = 1,
+    FREE_PAGE_HINT_S_START = 2,
+    FREE_PAGE_HINT_S_DONE = 3,
 };
 
 typedef struct VirtIOBalloon {
     VirtIODevice parent_obj;
     VirtQueue *ivq, *dvq, *svq, *free_page_vq;
-    uint32_t free_page_report_status;
+    uint32_t free_page_hint_status;
     uint32_t num_pages;
     uint32_t actual;
-    uint32_t free_page_report_cmd_id;
+    uint32_t free_page_hint_cmd_id;
     uint64_t stats[VIRTIO_BALLOON_S_NR];
     VirtQueueElement *stats_vq_elem;
     size_t stats_vq_offset;
@@ -55,7 +55,7 @@ typedef struct VirtIOBalloon {
     QEMUBH *free_page_bh;
     /*
      * Lock to synchronize threads to access the free page reporting related
-     * fields (e.g. free_page_report_status).
+     * fields (e.g. free_page_hint_status).
      */
     QemuMutex free_page_lock;
     QemuCond  free_page_cond;
@@ -64,7 +64,7 @@ typedef struct VirtIOBalloon {
      * stopped.
      */
     bool block_iothread;
-    NotifierWithReturn free_page_report_notify;
+    NotifierWithReturn free_page_hint_notify;
     int64_t stats_last_update;
     int64_t stats_poll_interval;
     uint32_t host_features;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:32:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:32:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8379.22387 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGQ-0000eT-6O; Sat, 17 Oct 2020 14:32:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8379.22387; Sat, 17 Oct 2020 14:32:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGQ-0000eL-3Z; Sat, 17 Oct 2020 14:32:54 +0000
Received: by outflank-mailman (input) for mailman id 8379;
 Sat, 17 Oct 2020 14:32:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnGO-0000e9-LO
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6b402c0c-76f0-47ff-b6b2-98c92de4f3d3;
 Sat, 17 Oct 2020 14:32:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGN-0005bh-Oq
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGN-0005sH-OG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnGO-0000e9-LO
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:52 +0000
X-Inumbo-ID: 6b402c0c-76f0-47ff-b6b2-98c92de4f3d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6b402c0c-76f0-47ff-b6b2-98c92de4f3d3;
	Sat, 17 Oct 2020 14:32:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lwcVqn0uoOl5aTU+6skmQbvIUEVk5HQ5dnJsN7S5syg=; b=4hC7jvrnaV1Nma1pBz/aCU2wGp
	CgkKBeB5RGWNJ6g5HWM5zqtMFlhB6o9ziLg4uyA2JhzsiKj7Kz5o5JA2kfkrrpXIfsmisukhWx8ps
	dRIOyjWeVyx9Eq/T75Je1Wb1AY5Sd6JcYNFqFrQaLyfjHwfwf8Qqcqzpe2kLXXXwOwGQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGN-0005bh-Oq
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGN-0005sH-OG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:32:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] intel_iommu: Use correct shift for 256 bits qi descriptor
Message-Id: <E1kTnGN-0005sH-OG@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:32:51 +0000

commit 58c523563dc3146ca4326e20af924abf0b90e9c3
Author:     Liu Yi L <yi.l.liu@intel.com>
AuthorDate: Sat Jul 4 01:07:15 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    intel_iommu: Use correct shift for 256 bits qi descriptor
    
    In chapter 10.4.23 of VT-d spec 3.0, Descriptor Width bit was introduced
    in VTD_IQA_REG. Software could set this bit to tell VT-d the QI descriptor
    from software would be 256 bits. Accordingly, the VTD_IQH_QH_SHIFT should
    be 5 when descriptor size is 256 bits.
    
    This patch adds the DW bit check when deciding the shift used to update
    VTD_IQH_REG.
    
    Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
    Message-Id: <1593850035-35483-1-git-send-email-yi.l.liu@intel.com>
    Reviewed-by: Peter Xu <peterx@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit a4544c45e109ceee87ee8c19baff28be3890d788)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/i386/intel_iommu.c          | 7 ++++++-
 hw/i386/intel_iommu_internal.h | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index df7ad254ac..8703a2da42 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2549,6 +2549,11 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)
 /* Try to fetch and process more Invalidation Descriptors */
 static void vtd_fetch_inv_desc(IntelIOMMUState *s)
 {
+    int qi_shift;
+
+    /* Refer to 10.4.23 of VT-d spec 3.0 */
+    qi_shift = s->iq_dw ? VTD_IQH_QH_SHIFT_5 : VTD_IQH_QH_SHIFT_4;
+
     trace_vtd_inv_qi_fetch();
 
     if (s->iq_tail >= s->iq_size) {
@@ -2567,7 +2572,7 @@ static void vtd_fetch_inv_desc(IntelIOMMUState *s)
         }
         /* Must update the IQH_REG in time */
         vtd_set_quad_raw(s, DMAR_IQH_REG,
-                         (((uint64_t)(s->iq_head)) << VTD_IQH_QH_SHIFT) &
+                         (((uint64_t)(s->iq_head)) << qi_shift) &
                          VTD_IQH_QH_MASK);
     }
 }
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 862033ebe6..3d5487fe2c 100644
--- a/hw/i386/intel_iommu_internal.h
+++ b/hw/i386/intel_iommu_internal.h
@@ -230,7 +230,8 @@
 #define VTD_IQA_DW_MASK             0x800
 
 /* IQH_REG */
-#define VTD_IQH_QH_SHIFT            4
+#define VTD_IQH_QH_SHIFT_4          4
+#define VTD_IQH_QH_SHIFT_5          5
 #define VTD_IQH_QH_MASK             0x7fff0ULL
 
 /* ICS_REG */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8380.22391 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGa-0000hM-7w; Sat, 17 Oct 2020 14:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8380.22391; Sat, 17 Oct 2020 14:33:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGa-0000hE-53; Sat, 17 Oct 2020 14:33:04 +0000
Received: by outflank-mailman (input) for mailman id 8380;
 Sat, 17 Oct 2020 14:33:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnGZ-0000h4-2a
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b6bdca91-9e11-407e-af54-fc1b32f8abf6;
 Sat, 17 Oct 2020 14:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGX-0005c7-SH
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGX-0005tC-RS
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnGZ-0000h4-2a
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:03 +0000
X-Inumbo-ID: b6bdca91-9e11-407e-af54-fc1b32f8abf6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b6bdca91-9e11-407e-af54-fc1b32f8abf6;
	Sat, 17 Oct 2020 14:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eA9q24iM0XmnHDudr/TWKibrXny3YQVY5hszLz0NzQg=; b=gYc1x4cJP2SmQEgUto7artUUf0
	2ycVTEETrZdpwbxfrHAZH5DNLeAejpQm1632oufGjLdxbNonF1CM5JpLYas7I2mMlbEghcWFDjbHC
	EiwEIeeBoGoQNeWzmoWUrQrs6672HxyqpXShD2fcuK2UcUbGExJsfnNP7CDxSM0J0Ibc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGX-0005c7-SH
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGX-0005tC-RS
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
Message-Id: <E1kTnGX-0005tC-RS@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:01 +0000

commit d8f0b2bbf4a1ab473c658a56ef5bf3ea57c3c384
Author:     Andrew Melnychenko <andrew@daynix.com>
AuthorDate: Mon Jul 6 14:21:23 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
    
    There is an issue when callback may be called with invalid vdev.
    It happens on unplug when vdev already deleted and VirtIOPciProxy is not.
    So now, callbacks accept proxy device, and vdev retrieved from it.
    Technically memio callbacks should be removed during the flatview update,
    but memoryregions remain til PCI device(and it's address space) completely deleted.
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1716352
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Message-Id: <20200706112123.971087-1-andrew@daynix.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit ccec7e9603f446fe75c6c563ba335c00cfda6a06)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-pci.c | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4cb784389c..b37ae65fe4 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1317,11 +1317,12 @@ static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
-    VirtIOPCIProxy *proxy = VIRTIO_PCI(DEVICE(vdev)->parent_bus->parent);
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = addr / virtio_pci_queue_mem_mult(proxy);
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1329,10 +1330,12 @@ static void virtio_pci_notify_write(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write_pio(void *opaque, hwaddr addr,
                                         uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = val;
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1356,9 +1359,14 @@ static void virtio_pci_isr_write(void *opaque, hwaddr addr,
 static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
                                        unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     uint64_t val = 0;
 
+    if (vdev == NULL) {
+        return val;
+    }
+
     switch (size) {
     case 1:
         val = virtio_config_modern_readb(vdev, addr);
@@ -1376,7 +1384,13 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
 static void virtio_pci_device_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
+    if (vdev == NULL) {
+        return;
+    }
+
     switch (size) {
     case 1:
         virtio_config_modern_writeb(vdev, addr, val);
@@ -1453,19 +1467,19 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
 
     memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
                           &device_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-device",
                           proxy->device.size);
 
     memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
                           &notify_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify",
                           proxy->notify.size);
 
     memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy),
                           &notify_pio_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify-pio",
                           proxy->notify_pio.size);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8381.22396 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGk-0000iZ-9Y; Sat, 17 Oct 2020 14:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8381.22396; Sat, 17 Oct 2020 14:33:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGk-0000iR-6Y; Sat, 17 Oct 2020 14:33:14 +0000
Received: by outflank-mailman (input) for mailman id 8381;
 Sat, 17 Oct 2020 14:33:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnGi-0000iF-Qz
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id de3ec250-b8f5-43d5-ae53-c0bfeab05790;
 Sat, 17 Oct 2020 14:33:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGh-0005ct-VS
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGh-0005tm-Ue
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnGi-0000iF-Qz
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:12 +0000
X-Inumbo-ID: de3ec250-b8f5-43d5-ae53-c0bfeab05790
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id de3ec250-b8f5-43d5-ae53-c0bfeab05790;
	Sat, 17 Oct 2020 14:33:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4271asGlWQrodvetK+5nSa3iaRYovNFXzJvNVMeTizs=; b=rrfOJNeWejr96aZ4cHKBxxwjFk
	NAoK4Y2taZ2pGNo6sUTcqQaj25c3J2pGPlhbXxusCT+PNaiS4ggiFM9ktu+4MgNvzCzntd4lMpyGe
	e96tjJkYQjwwP5WAaWqWdYIKj4EZ6bnDn9RbEQgwvo4r/VIzZOB2B/rq5raiz89iyPXM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGh-0005ct-VS
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGh-0005tm-Ue
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] libvhost-user: Report descriptor index on panic
Message-Id: <E1kTnGh-0005tm-Ue@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:11 +0000

commit eca194d43ca4524d0f3552d7b91b15c145649b33
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    libvhost-user: Report descriptor index on panic
    
    We want to report the index of the descriptor,
    not its pointer.
    
    Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171935.18535-1-philmd@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 8fe9805c73c277dc2feeaa83de73d6a58bf23f39)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 3bca996c62..301f6d68b3 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -1867,7 +1867,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
 
     /* If their number is silly, that's a fatal mistake. */
     if (*head >= vq->vring.num) {
-        vu_panic(dev, "Guest says index %u is available", head);
+        vu_panic(dev, "Guest says index %u is available", *head);
         return false;
     }
 
@@ -1926,7 +1926,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
     smp_wmb();
 
     if (*next >= max) {
-        vu_panic(dev, "Desc next is %u", next);
+        vu_panic(dev, "Desc next is %u", *next);
         return VIRTQUEUE_READ_DESC_ERROR;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8382.22400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGu-0000lu-BU; Sat, 17 Oct 2020 14:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8382.22400; Sat, 17 Oct 2020 14:33:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnGu-0000la-8A; Sat, 17 Oct 2020 14:33:24 +0000
Received: by outflank-mailman (input) for mailman id 8382;
 Sat, 17 Oct 2020 14:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnGs-0000lP-Qm
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fe593f5c-8229-404a-ba72-d01f919adb67;
 Sat, 17 Oct 2020 14:33:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGs-0005d1-2Y
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnGs-0005uO-1s
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnGs-0000lP-Qm
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
X-Inumbo-ID: fe593f5c-8229-404a-ba72-d01f919adb67
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fe593f5c-8229-404a-ba72-d01f919adb67;
	Sat, 17 Oct 2020 14:33:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gWsPRg1N0SslbQxqn8cQe4PXHe8Bj2aPiL0IGZ6s7so=; b=C/gjJ+DmebTevnG44vTKEtj6kB
	wj7SfzAQJpHo7RSsQouaDG6T1YTCF88CYSCaLd//WrFfrcvVnWDeL27//l0wXmu6YSVk5IwzU7Kv9
	EAdTpV+9rJ/uRkMykK+O4Hb2aY4RRd8VBpaDD4Ft38cqWr9IqMt3wrCTK4g6ivFehbgA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGs-0005d1-2Y
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnGs-0005uO-1s
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] Update OpenBIOS images to 7f28286f built from submodule.
Message-Id: <E1kTnGs-0005uO-1s@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:22 +0000

commit b52a91816ea6a277fca83e8881fb0c5475f19156
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Mon Jul 27 09:15:42 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Cc: qemu-stable@nongnu.org
    (cherry picked from commit 54414d0fb11314ede939ec80238787c5b2079f4e)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index 1c9ab09af7..def6d4cf63 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index 2ba8660dde..67b8b83d98 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index 99420eb815..dfa1f10bbc 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 7e5b89e429..7f28286f5c 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 7e5b89e4295063d8eba55b9c8ce8bc681c2d129a
+Subproject commit 7f28286f5cb1ca682e3ba0a8706d8884f12bc49e
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8383.22404 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnH4-0000nV-Ci; Sat, 17 Oct 2020 14:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8383.22404; Sat, 17 Oct 2020 14:33:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnH4-0000nN-9b; Sat, 17 Oct 2020 14:33:34 +0000
Received: by outflank-mailman (input) for mailman id 8383;
 Sat, 17 Oct 2020 14:33:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnH3-0000nD-1q
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3bd2f6d3-3e36-4c98-8c0f-3c9731fa5772;
 Sat, 17 Oct 2020 14:33:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnH2-0005d9-5t
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnH2-0005v2-4o
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnH3-0000nD-1q
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:33 +0000
X-Inumbo-ID: 3bd2f6d3-3e36-4c98-8c0f-3c9731fa5772
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3bd2f6d3-3e36-4c98-8c0f-3c9731fa5772;
	Sat, 17 Oct 2020 14:33:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HD1BKELjYlDDKOiv+lKZA51XW7nEIAE3sAXiLXhcygw=; b=Qqp5HIFJutfKkn4H6nozcpCknq
	2w+Pf0kzQHG/bLZa8DAI9Sx78GfLQVS2YBAPEEH/EfaGKo6xC+xiR48Kx24gtVaBMFV2J7DWy2at+
	MncLynAo9vSDe/RyygE8uTe7LfviYThgO4lkofe1SsXt44UBlwY8QGr9H1AYCRh9Upp0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnH2-0005d9-5t
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnH2-0005v2-4o
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
Message-Id: <E1kTnH2-0005v2-4o@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:32 +0000

commit 08550a9940fc9b07a8f7ff7e2c7b47eb825b87d3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:22 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
    
    Using the _locked version of bdrv_enable_dirty_bitmap to bypass locking
    is wrong as we do not already own the mutex.  Moreover, the adjacent
    call to bdrv_dirty_bitmap_enable_successor grabs the mutex.
    
    Fixes: 58f72b965e9e1q
    Cc: qemu-stable@nongnu.org # v3.0
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-8-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit e6ce5e92248be5547daaee3eb6cd226e9820cf7b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 migration/block-dirty-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 7eafface61..16f1793ee3 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -498,7 +498,7 @@ void dirty_bitmap_mig_before_vm_start(void)
         DirtyBitmapLoadBitmapState *b = item->data;
 
         if (b->migrated) {
-            bdrv_enable_dirty_bitmap_locked(b->bitmap);
+            bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8384.22408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHE-0000oi-ER; Sat, 17 Oct 2020 14:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8384.22408; Sat, 17 Oct 2020 14:33:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHE-0000oa-BA; Sat, 17 Oct 2020 14:33:44 +0000
Received: by outflank-mailman (input) for mailman id 8384;
 Sat, 17 Oct 2020 14:33:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnHD-0000oR-7C
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7ebea8f2-f21f-46d7-a7b0-5447ef46f69a;
 Sat, 17 Oct 2020 14:33:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHC-0005dI-9A
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHC-0005ve-8M
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnHD-0000oR-7C
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:43 +0000
X-Inumbo-ID: 7ebea8f2-f21f-46d7-a7b0-5447ef46f69a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7ebea8f2-f21f-46d7-a7b0-5447ef46f69a;
	Sat, 17 Oct 2020 14:33:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nu3WpWxa1ancwm58eBu7oDeeyPmeGPnXOR4rATg0qUk=; b=x1UaCWkgd8RDIzm1OBksDHZLS1
	5XHSuAfXRPvvV1tShgpjxTzOxvOX8RsDRuxNxH0XQ8YTcFfHjv9zgKbGgOcPLxV5MQ/SceyWPm+E6
	j7zwUzAwJTmeWOjEdDeA9Cty+31zT9j7LEREKsP1Ker/7gC4w5hl5+hIhXsrhSKWFzGA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHC-0005dI-9A
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHC-0005ve-8M
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] block: Fix bdrv_aligned_p*v() for qiov_offset != 0
Message-Id: <E1kTnHC-0005ve-8M@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:42 +0000

commit dcf682dd135e41150b8f1918d7902e2305d19e1a
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:04 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Since these functions take a @qiov_offset, they must always take it into
    account when working with @qiov.  There are a couple of places where
    they do not, but they should.
    
    Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c
           ("block/io: bdrv_aligned_preadv: use and support qiov_offset")
    Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d
           ("block/io: bdrv_aligned_pwritev: use and support qiov_offset")
    Reported-by: Claudio Fontana <cfontana@suse.de>
    Reported-by: Bruce Rogers <brogers@suse.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-2-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    Tested-by: Bruce Rogers <brogers@suse.com>
    (cherry picked from commit 134b7dec6ec2d90616d7986afb3b3b7ca7a4c383)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/io.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/io.c b/block/io.c
index aba67f66b9..496c813dd8 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1501,12 +1501,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
             assert(num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, qiov, bytes - bytes_remaining, 0);
+                                     num, qiov,
+                                     qiov_offset + bytes - bytes_remaining, 0);
             max_bytes -= num;
         } else {
             num = bytes_remaining;
-            ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
-                                    bytes_remaining);
+            ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining,
+                                    0, bytes_remaining);
         }
         if (ret < 0) {
             goto out;
@@ -2009,7 +2010,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
             }
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, qiov, bytes - bytes_remaining,
+                                      num, qiov,
+                                      qiov_offset + bytes - bytes_remaining,
                                       local_flags);
             if (ret < 0) {
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:33:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8385.22411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHO-0000q1-Fs; Sat, 17 Oct 2020 14:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8385.22411; Sat, 17 Oct 2020 14:33:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHO-0000pt-Cr; Sat, 17 Oct 2020 14:33:54 +0000
Received: by outflank-mailman (input) for mailman id 8385;
 Sat, 17 Oct 2020 14:33:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnHN-0000pj-8H
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 751f8b53-e139-41da-affc-6243e2e051b5;
 Sat, 17 Oct 2020 14:33:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHM-0005dU-DG
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHM-0005wE-Bi
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnHN-0000pj-8H
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:53 +0000
X-Inumbo-ID: 751f8b53-e139-41da-affc-6243e2e051b5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 751f8b53-e139-41da-affc-6243e2e051b5;
	Sat, 17 Oct 2020 14:33:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9vaHLlzFDkU4eQN9jBtAObZOEiyItdDlvRRTDLzgunk=; b=QkVhJkCWEH0Gaq+gCp5XSuNqEz
	Pnnsgwo8/ZqJXeVZSbXcytV++xNhHlNNukgYb5N6LE+2fDVYrXGkLj5FXWH1RJUNsGCS+Yo/KlTS3
	VQ/33FYZBkVlYxDB/6iH8/caqP66AMwrKlENsS3ss/GMdXYSSmB9M0LPZkR/Dc6yIEDU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHM-0005dU-DG
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHM-0005wE-Bi
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:33:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] iotests/028: Add test for cross-base-EOF reads
Message-Id: <E1kTnHM-0005wE-Bi@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:33:52 +0000

commit 921352867bc67b2e6bc6fa2e5538b04aadd78caf
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:05 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    iotests/028: Add test for cross-base-EOF reads
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-3-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    (cherry picked from commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 2 files changed, 30 insertions(+)

diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 797dae5350..1e52986b74 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 
 _check_test_img
 
+echo
+echo '=== Reading across backing EOF in one operation ==='
+echo
+
+# Use a cluster boundary as the base end here
+base_size=$((3 * 1024 * 1024 * 1024))
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $base_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
+
+# Write 16 times 42 at the end of the base image
+$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \
+    | _filter_qemu_io
+
+# Read 32 bytes across the base EOF from the top;
+# should be 16 times 0x2a, then 16 times 0x00
+$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \
+    | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 37aed84436..51ae06d38f 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728
 read 512/512 bytes at offset 3221258752
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
+
+=== Reading across backing EOF in one operation ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+wrote 16/16 bytes at offset 3221225456
+16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+bffffff0:  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ................
+c0000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+read 32/32 bytes at offset 3221225456
+32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8386.22415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHZ-0000rW-IU; Sat, 17 Oct 2020 14:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8386.22415; Sat, 17 Oct 2020 14:34:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHZ-0000rO-Fc; Sat, 17 Oct 2020 14:34:05 +0000
Received: by outflank-mailman (input) for mailman id 8386;
 Sat, 17 Oct 2020 14:34:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnHX-0000rC-Pr
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8879eef0-0fa3-4a6e-bd72-823e9e36abb7;
 Sat, 17 Oct 2020 14:34:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHW-0005dp-GO
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHW-0005xD-Fg
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnHX-0000rC-Pr
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:03 +0000
X-Inumbo-ID: 8879eef0-0fa3-4a6e-bd72-823e9e36abb7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8879eef0-0fa3-4a6e-bd72-823e9e36abb7;
	Sat, 17 Oct 2020 14:34:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8O2FtDa8PoQsv5FD3COEOj+10L8kp0iJfg0nBQRS4lg=; b=Hfn38r5A5N5B0gnEsmcPA1XvH0
	hQ5seRcnL5KDXXfYsJ7iiSgTUnMF8oz4uA3OnfUqsNVWUXhIlR3TzCssXzMeNgbteeNSAr//RpTs9
	qDiXmSgHWcWj1qBbfc29c66TzJBcE1Mkumh4Ep30msc/f65wanBN6aiokmy3UuMjL4No=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHW-0005dp-GO
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHW-0005xD-Fg
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] nbd: Fix large trim/zero requests
Message-Id: <E1kTnHW-0005xD-Fg@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:02 +0000

commit b57df52546762549aec6591f5f38523111702fa9
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Wed Jul 22 16:22:31 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    nbd: Fix large trim/zero requests
    
    Although qemu as NBD client limits requests to <2G, the NBD protocol
    allows clients to send requests almost all the way up to 4G.  But
    because our block layer is not yet 64-bit clean, we accidentally wrap
    such requests into a negative size, and fail with EIO instead of
    performing the intended operation.
    
    The bug is visible in modern systems with something as simple as:
    
    $ qemu-img create -f qcow2 /tmp/image.img 5G
    $ sudo qemu-nbd --connect=/dev/nbd0 /tmp/image.img
    $ sudo blkdiscard /dev/nbd0
    
    or with user-space only:
    
    $ truncate --size=3G file
    $ qemu-nbd -f raw file
    $ nbdsh -u nbd://localhost:10809 -c 'h.trim(3*1024*1024*1024,0)'
    
    Although both blk_co_pdiscard and blk_pwrite_zeroes currently return 0
    on success, this is also a good time to fix our code to a more robust
    paradigm that treats all non-negative values as success.
    
    Alas, our iotests do not currently make it easy to add external
    dependencies on blkdiscard or nbdsh, so we have to rely on manual
    testing for now.
    
    This patch can be reverted when we later improve the overall block
    layer to be 64-bit clean, but for now, a minimal fix was deemed less
    risky prior to release.
    
    CC: qemu-stable@nongnu.org
    Fixes: 1f4d6d18ed
    Fixes: 1c6c4bb7f0
    Fixes: https://github.com/systemd/systemd/issues/16242
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200722212231.535072-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: rework success tests to use >=0]
    (cherry picked from commit 890cbccb089db9e646cc1baea3be9dc060e3917b)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 nbd/server.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 20754e9ebc..0918173c1b 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2365,8 +2365,17 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
         if (request->flags & NBD_CMD_FLAG_FAST_ZERO) {
             flags |= BDRV_REQ_NO_FALLBACK;
         }
-        ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
-                                request->len, flags);
+        ret = 0;
+        /* FIXME simplify this when blk_pwrite_zeroes switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
+                                    len, flags);
+            request->len -= len;
+            request->from += len;
+        }
         return nbd_send_generic_reply(client, request->handle, ret,
                                       "writing to file failed", errp);
 
@@ -2380,9 +2389,18 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
                                       "flush failed", errp);
 
     case NBD_CMD_TRIM:
-        ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
-                              request->len);
-        if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) {
+        ret = 0;
+        /* FIXME simplify this when blk_co_pdiscard switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
+                                  len);
+            request->len -= len;
+            request->from += len;
+        }
+        if (ret >= 0 && request->flags & NBD_CMD_FLAG_FUA) {
             ret = blk_co_flush(exp->blk);
         }
         return nbd_send_generic_reply(client, request->handle, ret,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8387.22420 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHi-0000sc-KN; Sat, 17 Oct 2020 14:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8387.22420; Sat, 17 Oct 2020 14:34:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHi-0000sU-HB; Sat, 17 Oct 2020 14:34:14 +0000
Received: by outflank-mailman (input) for mailman id 8387;
 Sat, 17 Oct 2020 14:34:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnHh-0000sO-IY
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 86ca9eea-c86d-4064-8682-f2544574fe07;
 Sat, 17 Oct 2020 14:34:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHg-0005eP-JX
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHg-0005xl-Iq
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnHh-0000sO-IY
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:13 +0000
X-Inumbo-ID: 86ca9eea-c86d-4064-8682-f2544574fe07
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 86ca9eea-c86d-4064-8682-f2544574fe07;
	Sat, 17 Oct 2020 14:34:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/sjHjoJgyVldQxJnjPNRV5EDFs2wWlbmjwveb9eMqWg=; b=jGfREm5pQRdkS72GAQM2ie8wIT
	Ei1RHWnf7/iXw1m+nZfK80SZLcm6pfBU4XWpcujsDy8N7ksUDob+Yx78pmuh3I3u9ad6wC1Qo4zyU
	SHsOAJW3dueelYftsCU9noUPo8mv3Z++tk98BAVS6qQARtA3ez9n6fMWdYbWJ+4wnzuY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHg-0005eP-JX
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHg-0005xl-Iq
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-net: align RSC fields with updated virtio-net header
Message-Id: <E1kTnHg-0005xl-Iq@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:12 +0000

commit 5e817ece11e8fff09f1635dc9667175ef2234c28
Author:     Yuri Benditovich <yuri.benditovich@daynix.com>
AuthorDate: Fri May 8 15:59:34 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    virtio-net: align RSC fields with updated virtio-net header
    
    Removal of duplicated RSC definitions. Changing names of the
    fields to ones defined in the Linux header.
    
    Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
    (cherry picked from commit dd3d85e89123c907be7628957457af3d03e3b85b)
     Conflicts:
            hw/net/virtio-net.c
    *drop context dep. on 590790297c0
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/virtio-net.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index e7e2c2acdb..6cb1448310 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -77,25 +77,6 @@
    tso/gso/gro 'off'. */
 #define VIRTIO_NET_RSC_DEFAULT_INTERVAL 300000
 
-/* temporary until standard header include it */
-#if !defined(VIRTIO_NET_HDR_F_RSC_INFO)
-
-#define VIRTIO_NET_HDR_F_RSC_INFO  4 /* rsc_ext data in csum_ fields */
-#define VIRTIO_NET_F_RSC_EXT       61
-
-static inline __virtio16 *virtio_net_rsc_ext_num_packets(
-    struct virtio_net_hdr *hdr)
-{
-    return &hdr->csum_start;
-}
-
-static inline __virtio16 *virtio_net_rsc_ext_num_dupacks(
-    struct virtio_net_hdr *hdr)
-{
-    return &hdr->csum_offset;
-}
-
-#endif
 
 static VirtIOFeature feature_sizes[] = {
     {.flags = 1ULL << VIRTIO_NET_F_MAC,
@@ -1539,15 +1520,15 @@ static size_t virtio_net_rsc_drain_seg(VirtioNetRscChain *chain,
                                        VirtioNetRscSeg *seg)
 {
     int ret;
-    struct virtio_net_hdr *h;
+    struct virtio_net_hdr_v1 *h;
 
-    h = (struct virtio_net_hdr *)seg->buf;
+    h = (struct virtio_net_hdr_v1 *)seg->buf;
     h->flags = 0;
     h->gso_type = VIRTIO_NET_HDR_GSO_NONE;
 
     if (seg->is_coalesced) {
-        *virtio_net_rsc_ext_num_packets(h) = seg->packets;
-        *virtio_net_rsc_ext_num_dupacks(h) = seg->dup_ack;
+        h->rsc.segments = seg->packets;
+        h->rsc.dup_acks = seg->dup_ack;
         h->flags = VIRTIO_NET_HDR_F_RSC_INFO;
         if (chain->proto == ETH_P_IP) {
             h->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8388.22424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHs-0000uh-Lu; Sat, 17 Oct 2020 14:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8388.22424; Sat, 17 Oct 2020 14:34:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnHs-0000uX-Ii; Sat, 17 Oct 2020 14:34:24 +0000
Received: by outflank-mailman (input) for mailman id 8388;
 Sat, 17 Oct 2020 14:34:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnHr-0000th-Gy
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9345306c-f2fb-4ef5-add6-55183ff5876d;
 Sat, 17 Oct 2020 14:34:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHq-0005eW-Mb
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnHq-0005yf-Lr
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnHr-0000th-Gy
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:23 +0000
X-Inumbo-ID: 9345306c-f2fb-4ef5-add6-55183ff5876d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9345306c-f2fb-4ef5-add6-55183ff5876d;
	Sat, 17 Oct 2020 14:34:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MCCKcaBldlYE+ALNq3s4oeNnSHcRmQpUyt8PFDoFMjM=; b=VQKAiQSweIY9xp3kxQsLqRi4Wk
	bwpHfSK9DXD9hgtcpEjHwgcWHniQaktq1kKX90oEzsJxI03IyKeLMNGjLV2w0GaHNxorwLa/A411s
	nGb6H+kUPandyZaCL8oyJAgy9lC3m25G/FxDi+GQFE8cFA0ThyAt3QImFiXFe5JN1sFU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHq-0005eW-Mb
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnHq-0005yf-Lr
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] hw/arm/sbsa-ref: fix typo breaking PCIe IRQs
Message-Id: <E1kTnHq-0005yf-Lr@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:22 +0000

commit a575af07b8009bc51a311274c15846697b7d5f7c
Author:     Graeme Gregory <graeme@nuviainc.com>
AuthorDate: Fri Aug 28 10:02:43 2020 +0100
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    hw/arm/sbsa-ref: fix typo breaking PCIe IRQs
    
    Fixing a typo in a previous patch that translated an "i" to a 1
    and therefore breaking the allocation of PCIe interrupts. This was
    discovered when virtio-net-pci devices ceased to function correctly.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
    Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200821083853.356490-1-graeme@nuviainc.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    (cherry picked from commit 870f0051b4ada9a361f7454f833432ae8c06c095)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/arm/sbsa-ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 8409ba853d..0b32084dc0 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -555,7 +555,7 @@ static void create_pcie(SBSAMachineState *sms)
 
     for (i = 0; i < GPEX_NUM_IRQS; i++) {
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
-                           qdev_get_gpio_in(sms->gic, irq + 1));
+                           qdev_get_gpio_in(sms->gic, irq + i));
         gpex_set_irq_num(GPEX_HOST(dev), i, irq + i);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8389.22428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnI3-0000vv-NJ; Sat, 17 Oct 2020 14:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8389.22428; Sat, 17 Oct 2020 14:34:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnI3-0000vn-KD; Sat, 17 Oct 2020 14:34:35 +0000
Received: by outflank-mailman (input) for mailman id 8389;
 Sat, 17 Oct 2020 14:34:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnI1-0000vb-NP
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f448ee34-05e3-46c8-b2a0-ef846a6aeb3f;
 Sat, 17 Oct 2020 14:34:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnI0-0005ei-Q3
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnI0-0005zR-Op
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnI1-0000vb-NP
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:33 +0000
X-Inumbo-ID: f448ee34-05e3-46c8-b2a0-ef846a6aeb3f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f448ee34-05e3-46c8-b2a0-ef846a6aeb3f;
	Sat, 17 Oct 2020 14:34:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ij5cwkjjXixkWOMqOeihcdYviNcAYZQM2ASxHDE96V0=; b=08Ynk+JADmCYRQWwbUEqOk8JUV
	BvDAu2jI2WojqPYycHF2GnSBKuOhFXzfAthQqwuQF1nvY3fU6kD3f3G+PPW1x7dY8p8eY5U7giszN
	gKMHaB6bMqxNCCl3FBGr5xrdVNK8YirUb0XsZEizrg32MwWXRbedNW1FpmvEvK20ZLvE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnI0-0005ei-Q3
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnI0-0005zR-Op
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] usb: fix setup_len init (CVE-2020-14364)
Message-Id: <E1kTnI0-0005zR-Op@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:32 +0000

commit f243bb4b0d6dab7da3ae8490e0f46054bae93816
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Tue Aug 25 07:36:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    usb: fix setup_len init (CVE-2020-14364)
    
    Store calculated setup_len in a local variable, verify it, and only
    write it to the struct (USBDevice->setup_len) in case it passed the
    sanity checks.
    
    This prevents other code (do_token_{in,out} functions specifically)
    from working with invalid USBDevice->setup_len values and overrunning
    the USBDevice->setup_buf[] buffer.
    
    Fixes: CVE-2020-14364
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Tested-by: Gonglei <arei.gonglei@huawei.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-id: 20200825053636.29648-1-kraxel@redhat.com
    (cherry picked from commit b946434f2659a182afc17e155be6791ebfb302eb)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/core.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/hw/usb/core.c b/hw/usb/core.c
index 5abd128b6b..5234dcc73f 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -129,6 +129,7 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
 static void do_token_setup(USBDevice *s, USBPacket *p)
 {
     int request, value, index;
+    unsigned int setup_len;
 
     if (p->iov.size != 8) {
         p->status = USB_RET_STALL;
@@ -138,14 +139,15 @@ static void do_token_setup(USBDevice *s, USBPacket *p)
     usb_packet_copy(p, s->setup_buf, p->iov.size);
     s->setup_index = 0;
     p->actual_length = 0;
-    s->setup_len   = (s->setup_buf[7] << 8) | s->setup_buf[6];
-    if (s->setup_len > sizeof(s->data_buf)) {
+    setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+    if (setup_len > sizeof(s->data_buf)) {
         fprintf(stderr,
                 "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
-                s->setup_len, sizeof(s->data_buf));
+                setup_len, sizeof(s->data_buf));
         p->status = USB_RET_STALL;
         return;
     }
+    s->setup_len = setup_len;
 
     request = (s->setup_buf[0] << 8) | s->setup_buf[1];
     value   = (s->setup_buf[3] << 8) | s->setup_buf[2];
@@ -259,26 +261,28 @@ static void do_token_out(USBDevice *s, USBPacket *p)
 static void do_parameter(USBDevice *s, USBPacket *p)
 {
     int i, request, value, index;
+    unsigned int setup_len;
 
     for (i = 0; i < 8; i++) {
         s->setup_buf[i] = p->parameter >> (i*8);
     }
 
     s->setup_state = SETUP_STATE_PARAM;
-    s->setup_len   = (s->setup_buf[7] << 8) | s->setup_buf[6];
     s->setup_index = 0;
 
     request = (s->setup_buf[0] << 8) | s->setup_buf[1];
     value   = (s->setup_buf[3] << 8) | s->setup_buf[2];
     index   = (s->setup_buf[5] << 8) | s->setup_buf[4];
 
-    if (s->setup_len > sizeof(s->data_buf)) {
+    setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6];
+    if (setup_len > sizeof(s->data_buf)) {
         fprintf(stderr,
                 "usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n",
-                s->setup_len, sizeof(s->data_buf));
+                setup_len, sizeof(s->data_buf));
         p->status = USB_RET_STALL;
         return;
     }
+    s->setup_len = setup_len;
 
     if (p->pid == USB_TOKEN_OUT) {
         usb_packet_copy(p, s->data_buf, s->setup_len);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8390.22431 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnID-0000xB-Oe; Sat, 17 Oct 2020 14:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8390.22431; Sat, 17 Oct 2020 14:34:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnID-0000x3-Ll; Sat, 17 Oct 2020 14:34:45 +0000
Received: by outflank-mailman (input) for mailman id 8390;
 Sat, 17 Oct 2020 14:34:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnIB-0000wo-Ul
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 721e2a55-1a09-4faa-ac6d-6dcb1938bb16;
 Sat, 17 Oct 2020 14:34:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIA-0005eq-TU
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIA-00060J-SP
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnIB-0000wo-Ul
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:44 +0000
X-Inumbo-ID: 721e2a55-1a09-4faa-ac6d-6dcb1938bb16
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 721e2a55-1a09-4faa-ac6d-6dcb1938bb16;
	Sat, 17 Oct 2020 14:34:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mGtawcl3jCthqN37zzG/8XixkPWH0kxrv4GOBJq4CqI=; b=1nCEaOhsiCVYqzgNAWmX/qIlxm
	5xqXomGFeLFMTq+8lBYoFA5cPpGKP/OtbiXT+jk6InyeFXr/PJQ1oVFNIp+v61FxZYV0RD69wwz5k
	xUfUZSxMzT5gXvP32bSF/lOpoAhzo5g3EcUqbgzBSd+fSuFFBvLqU8GWYtjzJjackNs4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIA-0005eq-TU
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIA-00060J-SP
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] 9p: null terminate fs driver options list
Message-Id: <E1kTnIA-00060J-SP@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:42 +0000

commit f2fd6555c71e0c67c907e2c3d808a4f52acd972f
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jul 9 23:28:48 2020 +0530
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Wed Sep 9 18:51:39 2020 -0500

    9p: null terminate fs driver options list
    
    NULL terminate fs driver options' list, validate_opt() looks for
    a null entry to terminate the loop.
    
    Fixes: aee7f3ecd8b7 ("fsdev: Error out when unsupported option is passed")
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-Id: <20200709175848.650400-1-ppandit@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    (cherry picked from commit 353b5a91ccf2789b85967d19a8795816b8865562)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index a9e069c0c7..3da64e9f72 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {
             "throttling.iops-read-max-length",
             "throttling.iops-write-max-length",
             "throttling.iops-size",
+            NULL
         },
     },
     {
@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = {
         .ops = &synth_ops,
         .opts = (const char * []) {
             COMMON_FS_DRIVER_OPTIONS,
+            NULL
         },
     },
     {
@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = {
             "socket",
             "sock_fd",
             "writeout",
+            NULL
         },
     },
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:34:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:34:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8391.22437 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIN-0000yL-RF; Sat, 17 Oct 2020 14:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8391.22437; Sat, 17 Oct 2020 14:34:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIN-0000yD-NI; Sat, 17 Oct 2020 14:34:55 +0000
Received: by outflank-mailman (input) for mailman id 8391;
 Sat, 17 Oct 2020 14:34:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnIM-0000y3-AM
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4ab81387-c196-4686-b03c-6b44f97ba0e0;
 Sat, 17 Oct 2020 14:34:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIL-0005f0-1J
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIK-00061I-W0
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnIM-0000y3-AM
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:54 +0000
X-Inumbo-ID: 4ab81387-c196-4686-b03c-6b44f97ba0e0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4ab81387-c196-4686-b03c-6b44f97ba0e0;
	Sat, 17 Oct 2020 14:34:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z7zjq+mOmQ7LxN+OlKtZJTs0HP3WyItT83eCstDegts=; b=EBSjS9XA8d3/OHAmL85qybkhzd
	Pn5aaXat5girknsxKvStlo2PzCxmLdFU/wMvwxc7q0RpY5kgMC2OOsJlnc31C0PHq4Adf24CsBtgf
	Tnq8x48+X8lBSgGRnJXv4hoCfYuVTAAfJ4tQrXu17jJD4sjV/HhNhBfVwBWby+/mb64M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIL-0005f0-1J
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIK-00061I-W0
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:34:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] nvram: Exit QEMU if NVRAM cannot contain all -prom-env data
Message-Id: <E1kTnIK-00061I-W0@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:34:52 +0000

commit ebf5b3946e49bc10eef1234753f3fac3ac14d3e5
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Fri Aug 14 01:12:19 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Sep 10 13:09:51 2020 -0500

    nvram: Exit QEMU if NVRAM cannot contain all -prom-env data
    
    Since commit 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to
    support the -prom-env parameter"), pseries machines can pre-initialize
    the "system" partition in the NVRAM with the data passed to all -prom-env
    parameters on the QEMU command line.
    
    In this case it is assumed that all the data fits in 64 KiB, but the user
    can easily pass more and crash QEMU:
    
    $ qemu-system-ppc64 -M pseries $(for ((x=0;x<128;x++)); do \
      echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
      done) # this requires ~128 Kib
    malloc(): corrupted top size
    Aborted (core dumped)
    
    This happens because we don't check if all the prom-env data fits in
    the NVRAM and chrp_nvram_set_var() happily memcpy() it passed the
    buffer.
    
    This crash affects basically all ppc/ppc64 machine types that use -prom-env:
    - pseries (all versions)
    - g3beige
    - mac99
    
    and also sparc/sparc64 machine types:
    - LX
    - SPARCClassic
    - SPARCbook
    - SS-10
    - SS-20
    - SS-4
    - SS-5
    - SS-600MP
    - Voyager
    - sun4u
    - sun4v
    
    Add a max_len argument to chrp_nvram_create_system_partition() so that
    it can check the available size before writing to memory.
    
    Since NVRAM is populated at machine init, it seems reasonable to consider
    this error as fatal. So, instead of reporting an error when we detect that
    the NVRAM is too small and adapt all machine types to handle it, we simply
    exit QEMU in all cases. This is still better than crashing. If someone
    wants another behavior, I guess this can be reworked later.
    
    Tested with:
    
    $ yes q | \
      (for arch in ppc ppc64 sparc sparc64; do \
           echo == $arch ==; \
           qemu=${arch}-softmmu/qemu-system-$arch; \
           for mach in $($qemu -M help | awk '! /^Supported/ { print $1 }'); do \
               echo $mach; \
               $qemu -M $mach -monitor stdio -nodefaults -nographic \
               $(for ((x=0;x<128;x++)); do \
                     echo -n " -prom-env " ; printf "%0.sx" {1..1024}; \
                 done) >/dev/null; \
            done; echo; \
       done)
    
    Without the patch, affected machine types cause QEMU to report some
    memory corruption and crash:
    
    malloc(): corrupted top size
    
    free(): invalid size
    
    *** stack smashing detected ***: terminated
    
    With the patch, QEMU prints the following message and exits:
    
    NVRAM is too small. Try to pass less data to -prom-env
    
    It seems that the conditions for the crash have always existed, but it
    affects pseries, the machine type I care for, since commit 61f20b9dc5b7
    only.
    
    Fixes: 61f20b9dc5b7 ("spapr_nvram: Pre-initialize the NVRAM to support the -prom-env parameter")
    RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1867739
    Reported-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159736033937.350502.12402444542194031035.stgit@bahia.lan>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    (cherry picked from commit 37035df51eaabb8d26b71da75b88a1c6727de8fa)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/nvram/chrp_nvram.c         | 24 +++++++++++++++++++++---
 hw/nvram/mac_nvram.c          |  2 +-
 hw/nvram/spapr_nvram.c        |  3 ++-
 hw/sparc/sun4m.c              |  2 +-
 hw/sparc64/sun4u.c            |  2 +-
 include/hw/nvram/chrp_nvram.h |  3 ++-
 6 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/hw/nvram/chrp_nvram.c b/hw/nvram/chrp_nvram.c
index d969f26704..d4d10a7c03 100644
--- a/hw/nvram/chrp_nvram.c
+++ b/hw/nvram/chrp_nvram.c
@@ -21,14 +21,21 @@
 
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
+#include "qemu/error-report.h"
 #include "hw/nvram/chrp_nvram.h"
 #include "sysemu/sysemu.h"
 
-static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
+static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str,
+                              int max_len)
 {
     int len;
 
     len = strlen(str) + 1;
+
+    if (max_len < len) {
+        return -1;
+    }
+
     memcpy(&nvram[addr], str, len);
 
     return addr + len;
@@ -38,19 +45,26 @@ static int chrp_nvram_set_var(uint8_t *nvram, int addr, const char *str)
  * Create a "system partition", used for the Open Firmware
  * environment variables.
  */
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len)
 {
     ChrpNvramPartHdr *part_header;
     unsigned int i;
     int end;
 
+    if (max_len < sizeof(*part_header)) {
+        goto fail;
+    }
+
     part_header = (ChrpNvramPartHdr *)data;
     part_header->signature = CHRP_NVPART_SYSTEM;
     pstrcpy(part_header->name, sizeof(part_header->name), "system");
 
     end = sizeof(ChrpNvramPartHdr);
     for (i = 0; i < nb_prom_envs; i++) {
-        end = chrp_nvram_set_var(data, end, prom_envs[i]);
+        end = chrp_nvram_set_var(data, end, prom_envs[i], max_len - end);
+        if (end == -1) {
+            goto fail;
+        }
     }
 
     /* End marker */
@@ -65,6 +79,10 @@ int chrp_nvram_create_system_partition(uint8_t *data, int min_len)
     chrp_nvram_finish_partition(part_header, end);
 
     return end;
+
+fail:
+    error_report("NVRAM is too small. Try to pass less data to -prom-env");
+    exit(EXIT_FAILURE);
 }
 
 /**
diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c
index 2e8a1e3812..1c44ee19e1 100644
--- a/hw/nvram/mac_nvram.c
+++ b/hw/nvram/mac_nvram.c
@@ -152,7 +152,7 @@ static void pmac_format_nvram_partition_of(MacIONVRAMState *nvr, int off,
 
     /* OpenBIOS nvram variables partition */
     sysp_end = chrp_nvram_create_system_partition(&nvr->data[off],
-                                                  DEF_SYSTEM_SIZE) + off;
+                                                  DEF_SYSTEM_SIZE, len) + off;
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&nvr->data[sysp_end], len - sysp_end);
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index 15d08281d4..386513499f 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -188,7 +188,8 @@ static void spapr_nvram_realize(SpaprVioDevice *dev, Error **errp)
         }
     } else if (nb_prom_envs > 0) {
         /* Create a system partition to pass the -prom-env variables */
-        chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4);
+        chrp_nvram_create_system_partition(nvram->buf, MIN_NVRAM_SIZE / 4,
+                                           nvram->size);
         chrp_nvram_create_free_partition(&nvram->buf[MIN_NVRAM_SIZE / 4],
                                          nvram->size - MIN_NVRAM_SIZE / 4);
     }
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 36ee1a0a3d..fa77e2a5e2 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -142,7 +142,7 @@ static void nvram_init(Nvram *nvram, uint8_t *macaddr,
     memset(image, '\0', sizeof(image));
 
     /* OpenBIOS nvram variables partition */
-    sysp_end = chrp_nvram_create_system_partition(image, 0);
+    sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 6abfcb30f8..9dcb9a4bc8 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -136,7 +136,7 @@ static int sun4u_NVRAM_set_params(Nvram *nvram, uint16_t NVRAM_size,
     memset(image, '\0', sizeof(image));
 
     /* OpenBIOS nvram variables partition */
-    sysp_end = chrp_nvram_create_system_partition(image, 0);
+    sysp_end = chrp_nvram_create_system_partition(image, 0, 0x1fd0);
 
     /* Free space partition */
     chrp_nvram_create_free_partition(&image[sysp_end], 0x1fd0 - sysp_end);
diff --git a/include/hw/nvram/chrp_nvram.h b/include/hw/nvram/chrp_nvram.h
index 09941a9be4..4a0f5c21b8 100644
--- a/include/hw/nvram/chrp_nvram.h
+++ b/include/hw/nvram/chrp_nvram.h
@@ -50,7 +50,8 @@ chrp_nvram_finish_partition(ChrpNvramPartHdr *header, uint32_t size)
     header->checksum = sum & 0xff;
 }
 
-int chrp_nvram_create_system_partition(uint8_t *data, int min_len);
+/* chrp_nvram_create_system_partition() failure is fatal */
+int chrp_nvram_create_system_partition(uint8_t *data, int min_len, int max_len);
 int chrp_nvram_create_free_partition(uint8_t *data, int len);
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:35:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8392.22440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIX-0000zm-Tm; Sat, 17 Oct 2020 14:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8392.22440; Sat, 17 Oct 2020 14:35:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIX-0000ze-Qm; Sat, 17 Oct 2020 14:35:05 +0000
Received: by outflank-mailman (input) for mailman id 8392;
 Sat, 17 Oct 2020 14:35:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnIW-0000zV-16
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aff728d5-ff24-4421-ac0e-bbf2cebe35b6;
 Sat, 17 Oct 2020 14:35:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIV-0005fJ-57
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIV-00062X-3e
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnIW-0000zV-16
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:04 +0000
X-Inumbo-ID: aff728d5-ff24-4421-ac0e-bbf2cebe35b6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aff728d5-ff24-4421-ac0e-bbf2cebe35b6;
	Sat, 17 Oct 2020 14:35:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dgRfpVr50cQvgsdeeavDKrVC0qavsEWXoYIgJI36whQ=; b=3QoyhoUVLhVy5V9Shqjdz0qZbV
	1DQfIa4iVWPrM2ddExFAdidJ3+sxZbpulppiR1Hdy2kYi3VjGLZ31urmuK5PWIF4dJiQ282LrZp8U
	7XoxxHk4pLiGekaVKyj3kRinp2EV+I+/X1HYmtF3AxratRzlY5SwV0XhJI/mJka3gf9c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIV-0005fJ-57
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIV-00062X-3e
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] virtio-ccw: fix virtio_set_ind_atomic
Message-Id: <E1kTnIV-00062X-3e@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:35:03 +0000

commit b8fdfa9d6388823d66b22039b9dfb61fc7a8f401
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Tue Jun 16 06:50:34 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Thu Sep 10 13:09:51 2020 -0500

    virtio-ccw: fix virtio_set_ind_atomic
    
    The atomic_cmpxchg() loop is broken because we occasionally end up with
    old and _old having different values (a legit compiler can generate code
    that accessed *ind_addr again to pick up a value for _old instead of
    using the value of old that was already fetched according to the
    rules of the abstract machine). This means the underlying CS instruction
    may use a different old (_old) than the one we intended to use if
    atomic_cmpxchg() performed the xchg part.
    
    Let us use volatile to force the rules of the abstract machine for
    accesses to *ind_addr. Let us also rewrite the loop so, we that the
    new old is used to compute the new desired value if the xchg part
    is not performed.
    
    Fixes: 7e7494627f ("s390x/virtio-ccw: Adapter interrupt support.")
    Reported-by: Andre Wild <Andre.Wild1@ibm.com>
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Message-Id: <20200616045035.51641-2-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    (cherry picked from commit 1a8242f7c3f53341dd66253b142ecd06ce1d2a97)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/s390x/virtio-ccw.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 64f928fc7d..9d4e80ccfd 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -786,9 +786,10 @@ static inline VirtioCcwDevice *to_virtio_ccw_dev_fast(DeviceState *d)
 static uint8_t virtio_set_ind_atomic(SubchDev *sch, uint64_t ind_loc,
                                      uint8_t to_be_set)
 {
-    uint8_t ind_old, ind_new;
+    uint8_t expected, actual;
     hwaddr len = 1;
-    uint8_t *ind_addr;
+    /* avoid  multiple fetches */
+    uint8_t volatile *ind_addr;
 
     ind_addr = cpu_physical_memory_map(ind_loc, &len, true);
     if (!ind_addr) {
@@ -796,14 +797,15 @@ static uint8_t virtio_set_ind_atomic(SubchDev *sch, uint64_t ind_loc,
                      __func__, sch->cssid, sch->ssid, sch->schid);
         return -1;
     }
+    actual = *ind_addr;
     do {
-        ind_old = *ind_addr;
-        ind_new = ind_old | to_be_set;
-    } while (atomic_cmpxchg(ind_addr, ind_old, ind_new) != ind_old);
-    trace_virtio_ccw_set_ind(ind_loc, ind_old, ind_new);
-    cpu_physical_memory_unmap(ind_addr, len, 1, len);
+        expected = actual;
+        actual = atomic_cmpxchg(ind_addr, expected, expected | to_be_set);
+    } while (actual != expected);
+    trace_virtio_ccw_set_ind(ind_loc, actual, actual | to_be_set);
+    cpu_physical_memory_unmap((void *)ind_addr, len, 1, len);
 
-    return ind_old;
+    return actual;
 }
 
 static void virtio_ccw_notify(DeviceState *d, uint16_t vector)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:35:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8393.22444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIh-00011C-VL; Sat, 17 Oct 2020 14:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8393.22444; Sat, 17 Oct 2020 14:35:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIh-000114-SN; Sat, 17 Oct 2020 14:35:15 +0000
Received: by outflank-mailman (input) for mailman id 8393;
 Sat, 17 Oct 2020 14:35:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnIg-00010l-3N
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id efa26c23-d586-4176-b02e-973c87bc86bc;
 Sat, 17 Oct 2020 14:35:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIf-0005g4-8q
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIf-00063R-7M
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnIg-00010l-3N
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:14 +0000
X-Inumbo-ID: efa26c23-d586-4176-b02e-973c87bc86bc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id efa26c23-d586-4176-b02e-973c87bc86bc;
	Sat, 17 Oct 2020 14:35:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NFb+vak6+OaXgrm6r4edsqbuqSDdrg61mskBlHFY9iY=; b=xRpMYe/CPZ8LIyeAqzl9SB1KjB
	OjQ/YZg1xT5jdkFo9BKGnCR5/C9YHph5OrLxqox3rs4ebR4pWtBH++ljplvgOnVZVPuWzDRjHpe6L
	ht9QuJPBuxB0siZT8YACjWZFVnmGys5eFQjkDQzNbuJ7B+ENWZeUloUQHI6BDnWZugfY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIf-0005g4-8q
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIf-00063R-7M
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] riscv: sifive_test: Allow 16-bit writes to memory region
Message-Id: <E1kTnIf-00063R-7M@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:35:13 +0000

commit 5c49f7ee3b98316850de6a33952a4ac47701c118
Author:     Nathan Chancellor <natechancellor@gmail.com>
AuthorDate: Mon Aug 31 22:58:23 2020 -0700
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Sep 14 21:28:53 2020 -0500

    riscv: sifive_test: Allow 16-bit writes to memory region
    
    When shutting down the machine running a mainline Linux kernel, the
    following error happens:
    
    $ build/riscv64-softmmu/qemu-system-riscv64 -bios default -M virt \
        -display none -initrd rootfs.cpio -kernel Image -m 512m \
        -nodefaults -serial mon:stdio
    ...
    Requesting system poweroff
    [    4.999630] reboot: Power down
    sbi_trap_error: hart0: trap handler failed (error -2)
    sbi_trap_error: hart0: mcause=0x0000000000000007 mtval=0x0000000000100000
    sbi_trap_error: hart0: mepc=0x000000008000d4cc mstatus=0x0000000000001822
    sbi_trap_error: hart0: ra=0x000000008000999e sp=0x0000000080015c78
    sbi_trap_error: hart0: gp=0xffffffe000e76610 tp=0xffffffe0081b89c0
    sbi_trap_error: hart0: s0=0x0000000080015c88 s1=0x0000000000000040
    sbi_trap_error: hart0: a0=0x0000000000000000 a1=0x0000000080004024
    sbi_trap_error: hart0: a2=0x0000000080004024 a3=0x0000000080004024
    sbi_trap_error: hart0: a4=0x0000000000100000 a5=0x0000000000005555
    sbi_trap_error: hart0: a6=0x0000000000004024 a7=0x0000000080011158
    sbi_trap_error: hart0: s2=0x0000000000000000 s3=0x0000000080016000
    sbi_trap_error: hart0: s4=0x0000000000000000 s5=0x0000000000000000
    sbi_trap_error: hart0: s6=0x0000000000000001 s7=0x0000000000000000
    sbi_trap_error: hart0: s8=0x0000000000000000 s9=0x0000000000000000
    sbi_trap_error: hart0: s10=0x0000000000000000 s11=0x0000000000000008
    sbi_trap_error: hart0: t0=0x0000000000000000 t1=0x0000000000000000
    sbi_trap_error: hart0: t2=0x0000000000000000 t3=0x0000000000000000
    sbi_trap_error: hart0: t4=0x0000000000000000 t5=0x0000000000000000
    sbi_trap_error: hart0: t6=0x0000000000000000
    
    The kernel does a 16-bit write when powering off the machine, which
    was allowed before commit 5d971f9e67 ("memory: Revert "memory: accept
    mismatching sizes in memory_region_access_valid""). Make min_access_size
    match reality so that the machine can shut down properly now.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 88a07990fa ("SiFive RISC-V Test Finisher")
    Fixes: 5d971f9e67 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200901055822.2721209-1-natechancellor@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    (cherry picked from commit ab3d207fe89bc0c63739db19e177af49179aa457)
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/riscv/sifive_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_test.c b/hw/riscv/sifive_test.c
index 339195c6ff..1d57a15747 100644
--- a/hw/riscv/sifive_test.c
+++ b/hw/riscv/sifive_test.c
@@ -58,7 +58,7 @@ static const MemoryRegionOps sifive_test_ops = {
     .write = sifive_test_write,
     .endianness = DEVICE_NATIVE_ENDIAN,
     .valid = {
-        .min_access_size = 4,
+        .min_access_size = 2,
         .max_access_size = 4
     }
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:35:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8394.22447 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIs-00012r-0i; Sat, 17 Oct 2020 14:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8394.22447; Sat, 17 Oct 2020 14:35:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnIr-00012j-U5; Sat, 17 Oct 2020 14:35:25 +0000
Received: by outflank-mailman (input) for mailman id 8394;
 Sat, 17 Oct 2020 14:35:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnIq-000125-2l
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 382c6b21-5e92-42f8-bd11-8772613fe826;
 Sat, 17 Oct 2020 14:35:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIp-0005gH-Bi
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIp-00064b-B4
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnIq-000125-2l
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:24 +0000
X-Inumbo-ID: 382c6b21-5e92-42f8-bd11-8772613fe826
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 382c6b21-5e92-42f8-bd11-8772613fe826;
	Sat, 17 Oct 2020 14:35:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GX3b8K7sOl7GBJ9dUlFzGIH9TLY/LoEfsgl3Xm4EEok=; b=1CRfMvUHYhbC7ADIP6iyovAR/H
	BGkZcxvmgbvZ0IX8GbdYk5hvSo5WhV/pr34Vs8araWbrLLC6rRVtUyym49KZ42Pu4K1GGJeAQqPRz
	2QSQttedwg8mOm46n89+Cg7up7ZX0AA6oTpReW/ItEcclGzfncZ4R4HtaFueDuJMqFWU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIp-0005gH-Bi
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIp-00064b-B4
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] Update version for 5.0.1 release
Message-Id: <E1kTnIp-00064b-B4@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:35:23 +0000

commit 386b2a5767f7642521cd07930c681ec8a6057e60
Author:     Michael Roth <mdroth@linux.vnet.ibm.com>
AuthorDate: Tue Sep 15 11:27:07 2020 -0500
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Tue Sep 15 11:27:07 2020 -0500

    Update version for 5.0.1 release
    
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 0062ac9718..6b244dcd69 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.0
+5.0.1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sat Oct 17 14:35:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Oct 2020 14:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8395.22452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnJ2-000147-2U; Sat, 17 Oct 2020 14:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8395.22452; Sat, 17 Oct 2020 14:35:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kTnJ1-00013z-Vf; Sat, 17 Oct 2020 14:35:35 +0000
Received: by outflank-mailman (input) for mailman id 8395;
 Sat, 17 Oct 2020 14:35:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kTnJ0-00013p-LS
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7331c55c-adbb-4bc7-a9ab-f08593a411ad;
 Sat, 17 Oct 2020 14:35:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIz-0005gU-Ny
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kTnIz-00065T-HY
 for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=yQVw=DY=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kTnJ0-00013p-LS
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:34 +0000
X-Inumbo-ID: 7331c55c-adbb-4bc7-a9ab-f08593a411ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7331c55c-adbb-4bc7-a9ab-f08593a411ad;
	Sat, 17 Oct 2020 14:35:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gMLdOvPlebGCFqqn5b9Thuc8EH1SITH1K49uJ68yL8M=; b=VkXxWYyErW6Sy9P0gebros6rPa
	Tt25qHTCu+XSQOfbrtmisW0/Mm0tYNSMEYW7pvNkAlgKNii+gtaatCqrqPLTIfAm7jUPzyARrOAHK
	vEillSU5pv+VJKtvN5iddC3jNR4XoBtDa54MtJXAMooLIG1mh6kQpYaYMF8f9NxgmROU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIz-0005gU-Ny
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kTnIz-00065T-HY
	for xen-changelog@lists.xenproject.org; Sat, 17 Oct 2020 14:35:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen stable-4.14] Merge tag 'v5.0.1' into staging-4.14
Message-Id: <E1kTnIz-00065T-HY@xenbits.xenproject.org>
Date: Sat, 17 Oct 2020 14:35:33 +0000

commit e6a4cbe48cfca6adbe4e7acdf7e405c8315facaa
Merge: ea6d3cd1ed79d824e605a70c3626bc437c386260 386b2a5767f7642521cd07930c681ec8a6057e60
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Oct 16 11:53:28 2020 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Oct 16 11:53:28 2020 +0100

    Merge tag 'v5.0.1' into staging-4.14
    
    5.0.1

 VERSION                                            |   2 +-
 backends/hostmem.c                                 |   6 +-
 block.c                                            |   7 +-
 block/io.c                                         |  10 +-
 block/nbd.c                                        |  21 ++--
 chardev/char-socket.c                              |   8 +-
 contrib/libvhost-user/libvhost-user.c              |   4 +-
 docs/system/arm/orangepi.rst                       |  16 ++-
 fsdev/qemu-fsdev.c                                 |   3 +
 hw/9pfs/9p-util.h                                  |  13 ++
 hw/9pfs/9p.c                                       |  34 ++----
 hw/9pfs/9p.h                                       |  10 +-
 hw/9pfs/virtio-9p-device.c                         |  11 +-
 hw/9pfs/xen-9p-backend.c                           |  41 +++++--
 hw/acpi/core.c                                     |   9 +-
 hw/arm/sbsa-ref.c                                  |   2 +-
 hw/audio/es1370.c                                  |   7 +-
 hw/audio/gusemu_hal.c                              |   2 +-
 hw/audio/gusemu_mixer.c                            |   2 +-
 hw/display/artist.c                                |  12 +-
 hw/display/ati.c                                   |  10 +-
 hw/i386/intel_iommu.c                              |   7 +-
 hw/i386/intel_iommu_internal.h                     |   3 +-
 hw/net/e1000e_core.c                               |  10 +-
 hw/net/tulip.c                                     |   6 -
 hw/net/virtio-net.c                                |  29 +----
 hw/nvram/chrp_nvram.c                              |  24 +++-
 hw/nvram/mac_nvram.c                               |   2 +-
 hw/nvram/spapr_nvram.c                             |   3 +-
 hw/riscv/sifive_clint.c                            |   2 +-
 hw/riscv/sifive_test.c                             |   2 +-
 hw/s390x/virtio-ccw.c                              |  18 +--
 hw/sd/pxa2xx_mmci.c                                |   4 +-
 hw/sd/sd.c                                         |  90 ++++++++++----
 hw/sparc/sun4m.c                                   |   2 +-
 hw/sparc64/sun4u.c                                 |   2 +-
 hw/tpm/tpm_spapr.c                                 |   5 +-
 hw/usb/core.c                                      |  16 ++-
 hw/usb/dev-mtp.c                                   |  11 +-
 hw/usb/hcd-xhci.c                                  |   4 +-
 hw/virtio/virtio-balloon.c                         | 133 ++++++++++++---------
 hw/virtio/virtio-pci.c                             |  34 ++++--
 include/block/aio.h                                |   3 +
 include/hw/nvram/chrp_nvram.h                      |   3 +-
 include/hw/virtio/virtio-balloon.h                 |  20 ++--
 include/qemu/osdep.h                               |  10 ++
 include/standard-headers/linux/ethtool.h           |  10 +-
 include/standard-headers/linux/input-event-codes.h |   5 +-
 include/standard-headers/linux/pci_regs.h          |   2 +
 include/standard-headers/linux/vhost_types.h       |   8 ++
 include/standard-headers/linux/virtio_balloon.h    |  12 +-
 include/standard-headers/linux/virtio_ids.h        |   1 +
 include/standard-headers/linux/virtio_net.h        | 102 +++++++++++++++-
 linux-headers/COPYING                              |   2 +
 linux-headers/asm-x86/kvm.h                        |   1 +
 linux-headers/asm-x86/unistd_32.h                  |   1 +
 linux-headers/asm-x86/unistd_64.h                  |   1 +
 linux-headers/asm-x86/unistd_x32.h                 |   1 +
 linux-headers/linux/kvm.h                          |  47 +++++++-
 linux-headers/linux/mman.h                         |   5 +-
 linux-headers/linux/userfaultfd.h                  |  40 +++++--
 linux-headers/linux/vfio.h                         |  37 ++++++
 linux-headers/linux/vhost.h                        |  24 ++++
 linux-user/strace.list                             |   4 +-
 memory.c                                           |  29 ++---
 migration/block-dirty-bitmap.c                     |   2 +-
 nbd/server.c                                       |  51 ++++++--
 net/net.c                                          |   4 +-
 pc-bios/openbios-ppc                               | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32                           | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64                           | Bin 1593408 -> 1593408 bytes
 qdev-monitor.c                                     |   2 +-
 qemu-nbd.c                                         |  13 +-
 qga/commands.c                                     |  17 ++-
 qga/main.c                                         |   6 +-
 roms/openbios                                      |   2 +-
 scsi/qemu-pr-helper.c                              |   4 +-
 target/arm/vec_helper.c                            |   2 +
 target/hppa/translate.c                            |   2 +
 target/i386/cpu.c                                  |   3 +
 target/i386/kvm.c                                  |  11 +-
 target/i386/kvm_i386.h                             |   1 +
 tests/acceptance/avocado_qemu/__init__.py          |  13 +-
 tests/acceptance/boot_linux.py                     |  49 ++++----
 tests/acceptance/boot_linux_console.py             |  55 ++++++---
 tests/qemu-iotests/028                             |  19 +++
 tests/qemu-iotests/028.out                         |  11 ++
 tests/qemu-iotests/143                             |   4 +
 tests/qemu-iotests/143.out                         |   2 +
 tests/qemu-iotests/283                             |   6 +-
 tests/qemu-iotests/283.out                         |   2 +-
 tests/qtest/libqos/pci-pc.c                        |   2 +-
 tests/qtest/tpm-util.c                             |   6 +-
 tests/qtest/usb-hcd-ehci-test.c                    |   2 +-
 tools/virtiofsd/fuse_lowlevel.h                    |   1 +
 tools/virtiofsd/helper.c                           |  47 ++++++++
 tools/virtiofsd/passthrough_ll.c                   |  22 ++--
 tools/virtiofsd/seccomp.c                          |   1 +
 util/aio-posix.c                                   |  13 ++
 util/aio-win32.c                                   |   4 +
 util/async.c                                       |   1 +
 util/fdmon-io_uring.c                              |  13 +-
 util/oslib-posix.c                                 |  35 ++++++
 util/oslib-win32.c                                 |  13 ++
 104 files changed, 1051 insertions(+), 395 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8530.22760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9up-0001Ye-GM; Sun, 18 Oct 2020 14:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8530.22760; Sun, 18 Oct 2020 14:44:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9up-0001YW-DE; Sun, 18 Oct 2020 14:44:07 +0000
Received: by outflank-mailman (input) for mailman id 8530;
 Sun, 18 Oct 2020 14:44:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9un-0001YR-NJ
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3c71d397-1d3b-4fc7-a778-20e8782e2077;
 Sun, 18 Oct 2020 14:44:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9uk-0004iU-HV
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9uk-0001f5-Et
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9un-0001YR-NJ
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:05 +0000
X-Inumbo-ID: 3c71d397-1d3b-4fc7-a778-20e8782e2077
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3c71d397-1d3b-4fc7-a778-20e8782e2077;
	Sun, 18 Oct 2020 14:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=faYMI6faLiSFlL5FquACWh6+X6/lilmXPOWOMXdY8u8=; b=0rU+Q4hN9u4v9o0qM5QPfLJv/u
	2nVx0OpDfY5oBgpgWie2H7ky191uuSiDwW8l78awLgCVehV8EexOURdHiMRGTCXYnh50EkZOhD2Ab
	v0eh2ekGqAAiyfLdlcqCLqiCDA5X14+spOnLeBuArnsgpAHLfVqezcd/W8xl1xu2FDd0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9uk-0004iU-HV
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9uk-0001f5-Et
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/traps: 'Fix' safety of read_registers() in #DF path
Message-Id: <E1kU9uk-0001f5-Et@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:02 +0000

commit 6065a05adf152a556fb9f11a5218c89e41b62893
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 13:24:31 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:55:33 2020 +0100

    x86/traps: 'Fix' safety of read_registers() in #DF path
    
    All interrupts and exceptions pass a struct cpu_user_regs up into C.  This
    contains the legacy vm86 fields from 32bit days, which are beyond the
    hardware-pushed frame.
    
    Accessing these fields is generally illegal, as they are logically out of
    bounds for anything other than an interrupt/exception hitting ring1/3 code.
    
    show_registers() unconditionally reads these fields, but the content is
    discarded before use.  This is benign right now, as all parts of the stack are
    readable, including the guard pages.
    
    However, read_registers() in the #DF handler writes to these fields as part of
    preparing the state dump, and being IST, hits the adjacent stack frame.
    
    This has been broken forever, but c/s 6001660473 "x86/shstk: Rework the stack
    layout to support shadow stacks" repositioned the #DF stack to be adjacent to
    the guard page, which turns this OoB write into a fatal pagefault:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) CPU:    4
      (XEN) RIP:    e008:[<ffff82d04031fd4f>] traps.c#read_registers+0x29/0xc1
      (XEN) RFLAGS: 0000000000050086   CONTEXT: hypervisor (d1v0)
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d04031fd4f>] R traps.c#read_registers+0x29/0xc1
      (XEN)    [<ffff82d0403207b3>] F do_double_fault+0x3d/0x7e
      (XEN)    [<ffff82d04039acd7>] F double_fault+0x107/0x110
      (XEN)
      (XEN) Pagetable walk from ffff830236f6d008:
      (XEN)  L4[0x106] = 80000000bfa9b063 ffffffffffffffff
      (XEN)  L3[0x008] = 0000000236ffd063 ffffffffffffffff
      (XEN)  L2[0x1b7] = 0000000236ffc063 ffffffffffffffff
      (XEN)  L1[0x16d] = 8000000236f6d161 ffffffffffffffff
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 4:
      (XEN) FATAL PAGE FAULT
      (XEN) [error_code=0003]
      (XEN) Faulting linear address: ffff830236f6d008
      (XEN) ****************************************
      (XEN)
    
    and rendering the main #DF analysis broken.
    
    The proper fix is to delete cpu_user_regs.es and later, so no
    interrupt/exception path can access OoB, but this needs disentangling from the
    PV ABI first.
    
    Not-really-fixes: 6001660473 ("x86/shstk: Rework the stack layout to support shadow stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index da74172776..a684519a20 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -770,7 +770,13 @@ void load_system_tables(void)
 	tss->ist[IST_MCE - 1] = stack_top + (1 + IST_MCE) * PAGE_SIZE;
 	tss->ist[IST_NMI - 1] = stack_top + (1 + IST_NMI) * PAGE_SIZE;
 	tss->ist[IST_DB  - 1] = stack_top + (1 + IST_DB)  * PAGE_SIZE;
-	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE;
+	/*
+	 * Gross bodge.  The #DF handler uses the vm86 fields of cpu_user_regs
+	 * beyond the hardware frame.  Adjust the stack entrypoint so this
+	 * doesn't manifest as an OoB write which hits the guard page.
+	 */
+	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE -
+		(sizeof(struct cpu_user_regs) - offsetof(struct cpu_user_regs, es));
 	tss->bitmap = IOBMP_INVALID_OFFSET;
 
 	/* All other stack pointers poisioned. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8531.22764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9ux-0001ZJ-Hp; Sun, 18 Oct 2020 14:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8531.22764; Sun, 18 Oct 2020 14:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9ux-0001ZB-Eu; Sun, 18 Oct 2020 14:44:15 +0000
Received: by outflank-mailman (input) for mailman id 8531;
 Sun, 18 Oct 2020 14:44:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9uv-0001Ys-T9
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2da76061-4063-4376-99f0-1dea7db85808;
 Sun, 18 Oct 2020 14:44:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9uu-0004ia-N2
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9uu-0001g3-Jt
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9uv-0001Ys-T9
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:13 +0000
X-Inumbo-ID: 2da76061-4063-4376-99f0-1dea7db85808
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2da76061-4063-4376-99f0-1dea7db85808;
	Sun, 18 Oct 2020 14:44:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GkhL/qVxAcp6piQX7X4LEWCVwzBOzDHPAoVRjthPtaE=; b=SK9HxV3S9HEhWdl8P6jMl1gnlH
	ihbibdhfRcNKl13c6XZ9h7sC3Ln6uUzsiTW1EvYbQcaU2Tsb74nDRC5ciMYJuWg6njFZ3Czo75m1m
	fMomQXTKua7qItsoXIPl/5q0zpKJ5OrYSMP+aEQgaA2pUwTjHZfNHFrrwSGMjcjZEwGI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9uu-0004ia-N2
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9uu-0001g3-Jt
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/ucode/intel: Improve description for gathering the microcode revision
Message-Id: <E1kU9uu-0001g3-Jt@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:12 +0000

commit 04182d8b795dcdabf4f3873d3f5c78b67cbc04b0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 12 14:58:45 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:55:33 2020 +0100

    x86/ucode/intel: Improve description for gathering the microcode revision
    
    Obtaining the microcode revision on Intel CPUs is complicated for backwards
    compatibility reasons.  Update apply_microcode() to use a slightly more
    efficient CPUID invocation, now that the documentation has been updated to
    confirm that any CPUID instruction is fine, not just CPUID.1
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/cpu/microcode/intel.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index d9bb1bc10e..72c07fcd1d 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -126,13 +126,16 @@ static void collect_cpu_info(void)
     rdmsrl(MSR_IA32_PLATFORM_ID, msr_content);
     csig->pf = 1 << ((msr_content >> 50) & 7);
 
-    wrmsrl(MSR_IA32_UCODE_REV, 0x0ULL);
-    /* As documented in the SDM: Do a CPUID 1 here */
+    /*
+     * Obtaining the microcode version involves writing 0 to the "read only"
+     * UCODE_REV MSR, executing any CPUID instruction, after which a nonzero
+     * revision should appear.
+     */
+    wrmsrl(MSR_IA32_UCODE_REV, 0);
     csig->sig = cpuid_eax(1);
-
-    /* get the current revision from MSR 0x8B */
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
-    csig->rev = (uint32_t)(msr_content >> 32);
+    csig->rev = msr_content >> 32;
+
     pr_debug("microcode: collect_cpu_info : sig=%#x, pf=%#x, rev=%#x\n",
              csig->sig, csig->pf, csig->rev);
 }
@@ -270,14 +273,15 @@ static int apply_microcode(const struct microcode_patch *patch)
 
     wbinvd();
 
-    /* write microcode via MSR 0x79 */
     wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)patch->data);
-    wrmsrl(MSR_IA32_UCODE_REV, 0x0ULL);
 
-    /* As documented in the SDM: Do a CPUID 1 here */
-    cpuid_eax(1);
-
-    /* get the current revision from MSR 0x8B */
+    /*
+     * Obtaining the microcode version involves writing 0 to the "read only"
+     * UCODE_REV MSR, executing any CPUID instruction, after which a nonzero
+     * revision should appear.
+     */
+    wrmsrl(MSR_IA32_UCODE_REV, 0);
+    cpuid_eax(0);
     rdmsrl(MSR_IA32_UCODE_REV, msr_content);
     sig->rev = rev = msr_content >> 32;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8532.22768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9v7-0001aX-JN; Sun, 18 Oct 2020 14:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8532.22768; Sun, 18 Oct 2020 14:44:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9v7-0001aP-GS; Sun, 18 Oct 2020 14:44:25 +0000
Received: by outflank-mailman (input) for mailman id 8532;
 Sun, 18 Oct 2020 14:44:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9v6-0001aD-2u
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 14863972-dc6c-4bdc-a42a-edbf76e67cbb;
 Sun, 18 Oct 2020 14:44:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9v4-0004ik-QF
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9v4-0001hD-P9
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9v6-0001aD-2u
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:24 +0000
X-Inumbo-ID: 14863972-dc6c-4bdc-a42a-edbf76e67cbb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 14863972-dc6c-4bdc-a42a-edbf76e67cbb;
	Sun, 18 Oct 2020 14:44:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eXTvnjTpcNeSrEAVUXjIlAfiesULVPF5b1lLFF1cpOU=; b=Qs7DmNTM/E1v9LfuZNTyq17ne7
	cpiX6P6d1kOx6/wEqsdHLRpr8VoKJD+ZBn6gW8pXs0QPieEjwr4B1j4KzWycTcv+SuajiwvGMH4Ra
	0jiTxEMDEVEi7yNBeHttnBuWi1kbGErmi40hKhwBdWGGV0glZdaTMGmvE1buk+O+McUY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9v4-0004ik-QF
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9v4-0001hD-P9
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
Message-Id: <E1kU9v4-0001hD-P9@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:22 +0000

commit a7952a320c1e202a218702bfdb14f75132f04894
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 5 12:46:30 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Oct 16 11:56:59 2020 +0100

    x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
    
    cpu_smpboot_alloc() is designed to be idempotent with respect to partially
    initialised state.  This occurs for S3 and CPU parking, where enough state to
    handle NMIs/#MCs needs to remain valid for the entire lifetime of Xen, even
    when we otherwise want to offline the CPU.
    
    For simplicity between various configuration, Xen always uses shadow stack
    mappings (Read-only + Dirty) for the guard page, irrespective of whether
    CET-SS is enabled.
    
    Unfortunately, the CET-SS changes in memguard_guard_stack() broke idempotency
    by first writing out the supervisor shadow stack tokens with plain writes,
    then changing the mapping to being read-only.
    
    This ordering is strictly necessary to configure the BSP, which cannot have
    the supervisor tokens be written with WRSS.
    
    Instead of calling memguard_guard_stack() unconditionally, call it only when
    actually allocating a new stack.  Xenheap allocates are guaranteed to be
    writeable, and the net result is idempotency WRT configuring stack_base[].
    
    Fixes: 91d26ed304f ("x86/shstk: Create shadow stacks")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/smpboot.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 5708573c41..67e727cebd 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -997,16 +997,18 @@ static int cpu_smpboot_alloc(unsigned int cpu)
         memflags = MEMF_node(node);
 
     if ( stack_base[cpu] == NULL )
+    {
         stack_base[cpu] = alloc_xenheap_pages(STACK_ORDER, memflags);
-    if ( stack_base[cpu] == NULL )
-        goto out;
+        if ( !stack_base[cpu] )
+            goto out;
+
+        memguard_guard_stack(stack_base[cpu]);
+    }
 
     info = get_cpu_info_from_stack((unsigned long)stack_base[cpu]);
     info->processor_id = cpu;
     info->per_cpu_offset = __per_cpu_offset[cpu];
 
-    memguard_guard_stack(stack_base[cpu]);
-
     gdt = per_cpu(gdt, cpu) ?: alloc_xenheap_pages(0, memflags);
     if ( gdt == NULL )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8533.22772 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vH-0001c7-Km; Sun, 18 Oct 2020 14:44:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8533.22772; Sun, 18 Oct 2020 14:44:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vH-0001bz-Hy; Sun, 18 Oct 2020 14:44:35 +0000
Received: by outflank-mailman (input) for mailman id 8533;
 Sun, 18 Oct 2020 14:44:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9vG-0001bo-Cu
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 63a94916-6679-4855-b91d-e7157b2f7e76;
 Sun, 18 Oct 2020 14:44:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vE-0004iu-Th
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vE-0001iB-SG
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9vG-0001bo-Cu
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:34 +0000
X-Inumbo-ID: 63a94916-6679-4855-b91d-e7157b2f7e76
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 63a94916-6679-4855-b91d-e7157b2f7e76;
	Sun, 18 Oct 2020 14:44:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=J+inDF6N3jPHtwYZMNb05K+jKSrbJhUwfhJibzmYCMM=; b=OjLc4IQefSFRkjJUfzvPVcL1rK
	/ZFtU4jX0KOn0tYPkyfOppL4WT3gvG19g9KZObttwF9RiNIhSAgrCI20HL8FUaBshk/l68FHL4UvK
	r2D1oOIUqmxplMX5jMq7TN/ozFJd2wi78QS7NbmbtQv9oh2sYgcB2AF8EPVvWNrT8WtU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vE-0004iu-Th
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vE-0001iB-SG
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/stat: use memcpy instead of strncpy in getBridge
Message-Id: <E1kU9vE-0001iB-SG@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:32 +0000

commit 40fe714ca4245a9716264fcb3ee8df42c3650cf6
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Oct 7 14:57:01 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:23:34 2020 +0000

    tools/libs/stat: use memcpy instead of strncpy in getBridge
    
    Use memcpy in getBridge to prevent gcc warnings about truncated
    strings. We know that we might truncate it, so the gcc warning
    here is wrong.
    Revert previous change changing buffer sizes as bigger buffers
    are not needed.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/stat/xenstat_linux.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/libs/stat/xenstat_linux.c b/tools/libs/stat/xenstat_linux.c
index d2ee6fda64..e0d242e1bc 100644
--- a/tools/libs/stat/xenstat_linux.c
+++ b/tools/libs/stat/xenstat_linux.c
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <regex.h>
+#include <xen-tools/libs.h>
 
 #include "xenstat_priv.h"
 
@@ -78,8 +79,14 @@ static void getBridge(char *excludeName, char *result, size_t resultLen)
 				sprintf(tmp, "/sys/class/net/%s/bridge", de->d_name);
 
 				if (access(tmp, F_OK) == 0) {
-					strncpy(result, de->d_name, resultLen);
-					result[resultLen - 1] = 0;
+					/*
+					 * Do not use strncpy to prevent compiler warning with
+					 * gcc >= 10.0
+					 * If de->d_name is longer then resultLen we truncate it
+					 */
+					memset(result, 0, resultLen);
+					memcpy(result, de->d_name, MIN(strnlen(de->d_name,
+									NAME_MAX),resultLen - 1));
 				}
 		}
 	}
@@ -264,7 +271,7 @@ int xenstat_collect_networks(xenstat_node * node)
 {
 	/* Helper variables for parseNetDevLine() function defined above */
 	int i;
-	char line[512] = { 0 }, iface[16] = { 0 }, devBridge[256] = { 0 }, devNoBridge[257] = { 0 };
+	char line[512] = { 0 }, iface[16] = { 0 }, devBridge[16] = { 0 }, devNoBridge[17] = { 0 };
 	unsigned long long rxBytes, rxPackets, rxErrs, rxDrops, txBytes, txPackets, txErrs, txDrops;
 
 	struct priv_data *priv = get_priv_data(node->handle);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8534.22775 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vR-0001da-MS; Sun, 18 Oct 2020 14:44:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8534.22775; Sun, 18 Oct 2020 14:44:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vR-0001dS-JW; Sun, 18 Oct 2020 14:44:45 +0000
Received: by outflank-mailman (input) for mailman id 8534;
 Sun, 18 Oct 2020 14:44:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9vP-0001dG-U4
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e7e0974d-276b-479a-b7c6-3eca6031840a;
 Sun, 18 Oct 2020 14:44:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vP-0004j4-0J
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vO-0001jH-Vg
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9vP-0001dG-U4
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:43 +0000
X-Inumbo-ID: e7e0974d-276b-479a-b7c6-3eca6031840a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e7e0974d-276b-479a-b7c6-3eca6031840a;
	Sun, 18 Oct 2020 14:44:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t3nz+N5faPx7zyd2IIIwoyM17jjmqqK0qqE69NHEVxc=; b=BfKaQUXOfmfVNUoqVdd5kJur7B
	EEIZU4rtn1y4ouP6uQNpuQRNwFKQ/q9ockiiFQttFB0xbkzux3CQD+3JoJwKhKReERVkReJoo4ypt
	BFmM/Tsv4VxFRcKXCADdjBA4VsCdNt5YFDnpxTRWYOa70MiHbEbA0QIAO+L2eBLJ5aoo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vP-0004j4-0J
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vO-0001jH-Vg
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/python: Pass linker to Python build process
Message-Id: <E1kU9vO-0001jH-Vg@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:42 +0000

commit 17d192e0238d6c714e9f04593b59597b7090be38
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Sun Oct 11 18:11:39 2020 -0700
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:25:35 2020 +0000

    tools/python: Pass linker to Python build process
    
    Unexpectedly the environment variable which needs to be passed is
    $LDSHARED and not $LD.  Otherwise Python may find the build `ld` instead
    of the host `ld`.
    
    Replace $(LDFLAGS) with $(SHLIB_LDFLAGS) as Python needs shared objects
    it can load at runtime, not executables.
    
    This uses $(CC) instead of $(LD) since Python distutils appends $CFLAGS
    to $LDFLAGS which breaks many linkers.
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/pygrub/Makefile | 9 +++++----
 tools/python/Makefile | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 3063c4998f..37b2146214 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -3,20 +3,21 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
-PY_LDFLAGS = $(LDFLAGS) $(APPEND_LDFLAGS)
+PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
 .PHONY: all
 all: build
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)/$(bindir)
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
-		setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
+		LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
+		--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
 		 --root="$(DESTDIR)" --install-scripts=$(LIBEXEC_BIN) --force
 	set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
 	             "`readlink -f $(DESTDIR)/$(bindir)`" != \
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 8dc755d6e8..5e555acf1c 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -5,19 +5,20 @@ include $(XEN_ROOT)/tools/Rules.mk
 all: build
 
 PY_CFLAGS = $(CFLAGS) $(PY_NOOPT_CFLAGS)
-PY_LDFLAGS = $(LDFLAGS) $(APPEND_LDFLAGS)
+PY_LDFLAGS = $(SHLIB_LDFLAGS) $(APPEND_LDFLAGS)
 INSTALL_LOG = build/installed_files.txt
 
 .PHONY: build
 build:
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install:
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 
-	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
-		setup.py install --record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
+	CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDSHARED="$(CC)" \
+		LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) setup.py install \
+		--record $(INSTALL_LOG) $(PYTHON_PREFIX_ARG) \
 		--root="$(DESTDIR)" --force
 
 	$(INSTALL_PYTHON_PROG) scripts/convert-legacy-stream $(DESTDIR)$(LIBEXEC_BIN)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun Oct 18 14:44:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Oct 2020 14:44:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8535.22780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vb-0001ep-P4; Sun, 18 Oct 2020 14:44:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8535.22780; Sun, 18 Oct 2020 14:44:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kU9vb-0001eh-L6; Sun, 18 Oct 2020 14:44:55 +0000
Received: by outflank-mailman (input) for mailman id 8535;
 Sun, 18 Oct 2020 14:44:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kU9vZ-0001eW-UO
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8e322728-d25b-409f-8ea5-c118f9b45391;
 Sun, 18 Oct 2020 14:44:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vZ-0004jd-3l
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kU9vZ-0001kT-2R
 for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Ke8H=DZ=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kU9vZ-0001eW-UO
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
X-Inumbo-ID: 8e322728-d25b-409f-8ea5-c118f9b45391
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8e322728-d25b-409f-8ea5-c118f9b45391;
	Sun, 18 Oct 2020 14:44:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lbwSCXwKMCqNJ0C31QgDnaOXnEWfcwCAblIopcq/CzQ=; b=YK+HaKCAKxLQofzYkQa0eOciiH
	cNLLB51mHlGAfLjaCxtQp6P1VKl0t8prMbfJn85OuKL/xy7Y6ov8XyYg2dIDJtZGkPqtkKUtAQsuG
	tiOTOxdY4VUNggpvFkjRrY/dCDkivbW4z03vUqTkgK0RAerj7dUzVu8nPtRGrCLJQVSw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vZ-0004jd-3l
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kU9vZ-0001kT-2R
	for xen-changelog@lists.xenproject.org; Sun, 18 Oct 2020 14:44:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenpmd: Fix gcc10 snprintf warning
Message-Id: <E1kU9vZ-0001kT-2R@xenbits.xenproject.org>
Date: Sun, 18 Oct 2020 14:44:53 +0000

commit 0dfddb2116e3757f77a691a3fe335173088d69dc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Thu Oct 15 10:16:09 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Fri Oct 16 13:28:55 2020 +0000

    tools/xenpmd: Fix gcc10 snprintf warning
    
    Add a check for snprintf return code and ignore the entry if we get an
    error. This should in fact never happen and is more a trick to make gcc
    happy and prevent compilation errors.
    
    This is solving the following gcc warning when compiling for arm32 host
    platforms with optimization activated:
    xenpmd.c:92:37: error: '%s' directive output may be truncated writing
    between 4 and 2147483645 bytes into a region of size 271
    [-Werror=format-truncation=]
    
    This is also solving the following Debian bug:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970802
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/xenpmd/xenpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/xenpmd/xenpmd.c b/tools/xenpmd/xenpmd.c
index 35fd1c931a..12b82cf43e 100644
--- a/tools/xenpmd/xenpmd.c
+++ b/tools/xenpmd/xenpmd.c
@@ -102,6 +102,7 @@ FILE *get_next_battery_file(DIR *battery_dir,
     FILE *file = 0;
     struct dirent *dir_entries;
     char file_name[284];
+    int ret;
     
     do 
     {
@@ -111,11 +112,15 @@ FILE *get_next_battery_file(DIR *battery_dir,
         if ( strlen(dir_entries->d_name) < 4 )
             continue;
         if ( battery_info_type == BIF ) 
-            snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
+            ret = snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
                      dir_entries->d_name);
         else 
-            snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
+            ret = snprintf(file_name, sizeof(file_name), BATTERY_STATE_FILE_PATH,
                      dir_entries->d_name);
+        /* This should not happen but is needed to pass gcc checks */
+        if (ret < 0)
+            continue;
+        file_name[sizeof(file_name) - 1] = '\0';
         file = fopen(file_name, "r");
     } while ( !file );
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 07:00:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 07:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8932.24042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUlcu-0001gj-Bn; Tue, 20 Oct 2020 07:00:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8932.24042; Tue, 20 Oct 2020 07:00:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUlcu-0001gF-8W; Tue, 20 Oct 2020 07:00:08 +0000
Received: by outflank-mailman (input) for mailman id 8932;
 Tue, 20 Oct 2020 07:00:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUlct-0001eK-75
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7c6ffc94-230d-4288-8d5c-9afa9e81dee7;
 Tue, 20 Oct 2020 07:00:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUlcr-0002sA-Nl
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUlcr-0006Rw-LQ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUlct-0001eK-75
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:07 +0000
X-Inumbo-ID: 7c6ffc94-230d-4288-8d5c-9afa9e81dee7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7c6ffc94-230d-4288-8d5c-9afa9e81dee7;
	Tue, 20 Oct 2020 07:00:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2uV4FWpqZKHOstMjAoG+XOg/iqPPedyxRPhYKb7tfuk=; b=QbiRnQk0LiVdouSTuaepoMo7/G
	9Ek8vvtJzICIg9+nAnqb2C9j0M2NH9D0iKaSBcXSvnNNNJH/OLEbv8E2AjI+XW0eAO1fxjDEwF5gD
	8oiQtPhfpCejaAQwLffA1gU1igfhstN1vgAeO8keo63dQRLdU1QWcxcJKfC+n7Ewfpvo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUlcr-0002sA-Nl
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUlcr-0006Rw-LQ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: free unused boot mem in at least some cases
Message-Id: <E1kUlcr-0006Rw-LQ@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 07:00:05 +0000

commit 25467bb5d121735af4969834a62bca752a7bfe10
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:52:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:52:53 2020 +0200

    EFI: free unused boot mem in at least some cases
    
    Address at least the primary reason why 52bba67f8b87 ("efi/boot: Don't
    free ebmalloc area at all") was put in place: Make xen_in_range() aware
    of the freed range. This is in particular relevant for EFI-enabled
    builds not actually running on EFI, as the entire range will be unused
    in this case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/efi/stub.c   |  8 ++++++++
 xen/arch/x86/setup.c      | 26 +++++++++++++++++++++++---
 xen/arch/x86/tboot.c      | 12 ++++++++++++
 xen/common/efi/ebmalloc.c | 32 +++++++++++++++++++++++++++-----
 xen/include/xen/efi.h     |  1 +
 5 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c
index c578bffc71..9984932626 100644
--- a/xen/arch/x86/efi/stub.c
+++ b/xen/arch/x86/efi/stub.c
@@ -52,6 +52,14 @@ bool efi_enabled(unsigned int feature)
 
 void __init efi_init_memory(void) { }
 
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
+{
+    /* FIXME: Simplify once the call here with two NULLs goes away. */
+    if ( start || end )
+        *start = *end = (unsigned long)_end;
+    return false;
+}
+
 void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { }
 
 bool efi_rs_using_pgtables(void)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 4b15e067fa..44c04e2735 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -830,6 +830,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     module_t *mod;
     unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
     int i, j, e820_warn = 0, bytes = 0;
+    unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
     int ret;
     struct ns16550_defaults ns16550 = {
@@ -1145,7 +1146,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
         /*
          * This needs to remain in sync with xen_in_range() and the
-         * respective reserve_e820_ram() invocation below.
+         * respective reserve_e820_ram() invocation below. No need to
+         * query efi_boot_mem_unused() here, though.
          */
         mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
         mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
@@ -1417,8 +1419,18 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( !xen_phys_start )
         panic("Not enough memory to relocate Xen\n");
 
+    /* FIXME: Putting a hole in .bss would shatter the large page mapping. */
+    if ( using_2M_mapping() )
+        efi_boot_mem_unused(NULL, NULL);
+
     /* This needs to remain in sync with xen_in_range(). */
-    reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
+    if ( efi_boot_mem_unused(&eb_start, &eb_end) )
+    {
+        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
+        reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
+    }
+    else
+        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
 
     /* Late kexec reservation (dynamic start address). */
     kexec_reserve_area(&boot_e820);
@@ -1979,7 +1991,7 @@ int __hwdom_init xen_in_range(unsigned long mfn)
     paddr_t start, end;
     int i;
 
-    enum { region_s3, region_ro, region_rw, nr_regions };
+    enum { region_s3, region_ro, region_rw, region_bss, nr_regions };
     static struct {
         paddr_t s, e;
     } xen_regions[nr_regions] __hwdom_initdata;
@@ -2004,6 +2016,14 @@ int __hwdom_init xen_in_range(unsigned long mfn)
         /* hypervisor .data + .bss */
         xen_regions[region_rw].s = __pa(&__2M_rwdata_start);
         xen_regions[region_rw].e = __pa(&__2M_rwdata_end);
+        if ( efi_boot_mem_unused(&start, &end) )
+        {
+            ASSERT(__pa(start) >= xen_regions[region_rw].s);
+            ASSERT(__pa(end) <= xen_regions[region_rw].e);
+            xen_regions[region_rw].e = __pa(start);
+            xen_regions[region_bss].s = __pa(end);
+            xen_regions[region_bss].e = __pa(&__2M_rwdata_end);
+        }
     }
 
     start = (paddr_t)mfn << PAGE_SHIFT;
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index e66b0940c4..aadcce591f 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -1,3 +1,4 @@
+#include <xen/efi.h>
 #include <xen/init.h>
 #include <xen/types.h>
 #include <xen/lib.h>
@@ -364,6 +365,8 @@ void tboot_shutdown(uint32_t shutdown_type)
     /* if this is S3 then set regions to MAC */
     if ( shutdown_type == TB_SHUTDOWN_S3 )
     {
+        unsigned long s, e;
+
         /*
          * Xen regions for tboot to MAC. This needs to remain in sync with
          * xen_in_range().
@@ -378,6 +381,15 @@ void tboot_shutdown(uint32_t shutdown_type)
         /* hypervisor .data + .bss */
         g_tboot_shared->mac_regions[2].start = (uint64_t)__pa(&__2M_rwdata_start);
         g_tboot_shared->mac_regions[2].size = __2M_rwdata_end - __2M_rwdata_start;
+        if ( efi_boot_mem_unused(&s, &e) )
+        {
+            g_tboot_shared->mac_regions[2].size =
+                s - (unsigned long)__2M_rwdata_start;
+            g_tboot_shared->mac_regions[3].start = __pa(e);
+            g_tboot_shared->mac_regions[3].size =
+                (unsigned long)__2M_rwdata_end - e;
+            g_tboot_shared->num_mac_regions = 4;
+        }
 
         /*
          * MAC domains and other Xen memory
diff --git a/xen/common/efi/ebmalloc.c b/xen/common/efi/ebmalloc.c
index c65dbd946f..e19b496ab4 100644
--- a/xen/common/efi/ebmalloc.c
+++ b/xen/common/efi/ebmalloc.c
@@ -1,5 +1,6 @@
 #include "efi.h"
 #include <xen/init.h>
+#include <xen/mm.h>
 
 #ifdef CONFIG_ARM
 /*
@@ -21,7 +22,7 @@
 
 static char __section(".bss.page_aligned") __aligned(PAGE_SIZE)
     ebmalloc_mem[EBMALLOC_SIZE];
-static unsigned long __initdata ebmalloc_allocated;
+static unsigned long __read_mostly ebmalloc_allocated;
 
 /* EFI boot allocator. */
 void __init *ebmalloc(size_t size)
@@ -36,17 +37,38 @@ void __init *ebmalloc(size_t size)
     return ptr;
 }
 
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
+{
+    /* FIXME: Drop once the call here with two NULLs goes away. */
+    if ( !start && !end )
+    {
+        ebmalloc_allocated = sizeof(ebmalloc_mem);
+        return false;
+    }
+
+    *start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated);
+    *end = (unsigned long)ebmalloc_mem + sizeof(ebmalloc_mem);
+
+    return *start < *end;
+}
+
 void __init free_ebmalloc_unused_mem(void)
 {
-#if 0 /* FIXME: Putting a hole in the BSS breaks the IOMMU mappings for dom0. */
     unsigned long start, end;
 
-    start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated);
-    end = (unsigned long)ebmalloc_mem + sizeof(ebmalloc_mem);
+    if ( !efi_boot_mem_unused(&start, &end) )
+        return;
 
     destroy_xen_mappings(start, end);
+
+#ifdef CONFIG_X86
+    /*
+     * By reserving the space early in the E820 map, it gets freed way before
+     * we make it here. Don't free the range a 2nd time.
+     */
+#else
     init_xenheap_pages(__pa(start), __pa(end));
+#endif
 
     printk(XENLOG_INFO "Freed %lukB unused BSS memory\n", (end - start) >> 10);
-#endif
 }
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 44b7d3ec3a..94a7e547f9 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -33,6 +33,7 @@ struct compat_pf_efi_runtime_call;
 
 bool efi_enabled(unsigned int feature);
 void efi_init_memory(void);
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end);
 bool efi_rs_using_pgtables(void);
 unsigned long efi_get_time(void);
 void efi_halt_system(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 07:00:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 07:00:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8933.24047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUld4-0001jE-DN; Tue, 20 Oct 2020 07:00:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8933.24047; Tue, 20 Oct 2020 07:00:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUld4-0001j6-A4; Tue, 20 Oct 2020 07:00:18 +0000
Received: by outflank-mailman (input) for mailman id 8933;
 Tue, 20 Oct 2020 07:00:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUld2-0001iw-Pz
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 15e26442-0e04-4500-a8ca-9a55d3e82c51;
 Tue, 20 Oct 2020 07:00:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUld1-0002sJ-TR
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUld1-0007Fe-Py
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUld2-0001iw-Pz
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:16 +0000
X-Inumbo-ID: 15e26442-0e04-4500-a8ca-9a55d3e82c51
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 15e26442-0e04-4500-a8ca-9a55d3e82c51;
	Tue, 20 Oct 2020 07:00:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZhuVeBKltRbROGCvyHubXugE8RfoY3tyVb2EKxZ1wm8=; b=NLtOX8iu5QusBHKYK5lmwkeUPo
	OmAi6bv2lv/6Vr0QrbjKhydCrKmMiAGBdfVjBfiFO3cR0eTQSUSdp2pA0YVrSdKUNI5j7yDxg0ZTF
	ro0GhGjVUN8j+vXztoOOgm4AdsPWOPvyhbo+H4Hxqshppw4sVy3etlIlGIw/TlA0nIlw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUld1-0002sJ-TR
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUld1-0007Fe-Py
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen-detect: make CPUID fallback CPUID-faulting aware
Message-Id: <E1kUld1-0007Fe-Py@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 07:00:15 +0000

commit 7b36d16d21ae70a1eaabe577b7e4b42ed0f1a7d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:53:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:53:53 2020 +0200

    xen-detect: make CPUID fallback CPUID-faulting aware
    
    Relying on presence / absence of hypervisor leaves in raw / escaped
    CPUID output cannot be used to tell apart PV and HVM on CPUID faulting
    capable hardware. Utilize a PV-only feature flag to avoid false positive
    HVM detection.
    
    While at it also short circuit the main detection loop: For PV, only
    the base group of leaves can possibly hold hypervisor information.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/misc/xen-detect.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/misc/xen-detect.c b/tools/misc/xen-detect.c
index fd187a4be6..eac9e46a35 100644
--- a/tools/misc/xen-detect.c
+++ b/tools/misc/xen-detect.c
@@ -83,11 +83,31 @@ static int check_for_xen(int pv_context)
 
         if ( !strcmp("XenVMMXenVMM", signature) && (regs[0] >= (base + 2)) )
             goto found;
+
+        /* Higher base addresses are possible only with HVM. */
+        if ( pv_context )
+            break;
     }
 
     return 0;
 
  found:
+    /*
+     * On CPUID faulting capable hardware even un-escaped CPUID will return
+     * the hypervisor leaves. Need to further distinguish modes.
+     */
+    if ( !pv_context )
+    {
+        /*
+         * XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD is a PV-only feature
+         * pre-dating CPUID faulting support in Xen. Hence we can use it to
+         * tell whether we shouldn't report "success" to our caller here.
+         */
+        cpuid(base + 2, regs, 0);
+        if ( regs[2] & (1u << 0) )
+            return 0;
+    }
+
     cpuid(base + 1, regs, pv_context);
     if ( regs[0] )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 07:00:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 07:00:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8934.24051 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUldF-0001ki-EZ; Tue, 20 Oct 2020 07:00:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8934.24051; Tue, 20 Oct 2020 07:00:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUldF-0001ka-Bc; Tue, 20 Oct 2020 07:00:29 +0000
Received: by outflank-mailman (input) for mailman id 8934;
 Tue, 20 Oct 2020 07:00:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUldE-0001kS-1g
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eba802a8-419d-41f6-9f1d-d665ece6657a;
 Tue, 20 Oct 2020 07:00:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUldC-0002sd-0u
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUldB-0007GO-VW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUldE-0001kS-1g
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:28 +0000
X-Inumbo-ID: eba802a8-419d-41f6-9f1d-d665ece6657a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eba802a8-419d-41f6-9f1d-d665ece6657a;
	Tue, 20 Oct 2020 07:00:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1j/2JpYObOFsyr5Jen4MK7mC97AmgKC5JjMl26nbp0Y=; b=Yj9NErlmeSFkAXr//QT1A41hzY
	zrJDkWcvFO+5qcLGoc1NNg8LyCk5m5UgV6s4uCVj91w8Lxg5RNnnT2cfrj3HixVoUxJlbEvd6N8KE
	oyyhF2kRlYHglPHltIuD5euXgfkTiM9wFiULBiwIiIvH5qjTVmNveEr9gWQIUrWvfMQA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUldC-0002sd-0u
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUldB-0007GO-VW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kUldB-0007GO-VW@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 07:00:25 +0000

commit de6d188a519f9e3b7a1acc7784adf4c243865f9a
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 08:54:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:54:23 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 07:00:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 07:00:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.8935.24055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUldO-0001lt-Fw; Tue, 20 Oct 2020 07:00:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 8935.24055; Tue, 20 Oct 2020 07:00:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUldO-0001ll-D6; Tue, 20 Oct 2020 07:00:38 +0000
Received: by outflank-mailman (input) for mailman id 8935;
 Tue, 20 Oct 2020 07:00:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUldN-0001ld-0E
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id acbb1b6e-73f6-4b39-a4db-cf59e54bc129;
 Tue, 20 Oct 2020 07:00:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUldM-0002sk-4C
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUldM-0007H6-3N
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUldN-0001ld-0E
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:37 +0000
X-Inumbo-ID: acbb1b6e-73f6-4b39-a4db-cf59e54bc129
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id acbb1b6e-73f6-4b39-a4db-cf59e54bc129;
	Tue, 20 Oct 2020 07:00:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EfjeUgSQglnWckc8cUAgcE3HLQJtBQmNg4OfOnKzX5k=; b=ju70CWr2sbbuCNGhOaNLvzM4fe
	eG0ALtv3XkpyJETDRjTrzWxmBvtnTxcSriC0c5dkWE1/hd31AG5dzaQNDrMu5SUZm9hBtsXDNzuei
	qBrTuKg7zTql//GPg5zM6rdLy2PMAkgSOo11Fn8kSMETVDQkfrFDHI1KsMNWhcPHrc6c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUldM-0002sk-4C
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUldM-0007H6-3N
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 07:00:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] SVM: avoid VMSAVE in ctxt-switch-to
Message-Id: <E1kUldM-0007H6-3N@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 07:00:36 +0000

commit a7f0831e58bf4681d710e9a029644b6fa07b7cb0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:54:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:54:59 2020 +0200

    SVM: avoid VMSAVE in ctxt-switch-to
    
    Of the state saved by the insn and reloaded by the corresponding VMLOAD
    - TR and syscall state are invariant while having Xen's state loaded,
    - sysenter is unused altogether by Xen,
    - FS, GS, and LDTR are not used by Xen and get suitably set in PV
      context switch code.
    Note that state is suitably populated in _svm_cpu_up(); a minimal
    respective assertion gets added.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c | 3 ++-
 xen/include/asm-x86/desc.h | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 9b65445577..cfea5b5523 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -984,7 +984,6 @@ static void svm_ctxt_switch_to(struct vcpu *v)
 
     svm_restore_dr(v);
 
-    svm_vmsave_pa(per_cpu(host_vmcb, cpu));
     vmcb->cleanbits.raw = 0;
     svm_tsc_ratio_load(v);
 
@@ -1609,6 +1608,8 @@ static int _svm_cpu_up(bool bsp)
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
 
+    /* Minimal checking that enough CPU setup was done by now. */
+    ASSERT(str() == TSS_SELECTOR);
     svm_vmsave_pa(per_cpu(host_vmcb, cpu));
 
     return 0;
diff --git a/xen/include/asm-x86/desc.h b/xen/include/asm-x86/desc.h
index 24db3e9510..dfa643925f 100644
--- a/xen/include/asm-x86/desc.h
+++ b/xen/include/asm-x86/desc.h
@@ -236,6 +236,15 @@ static inline void ltr(unsigned int sel)
     __asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
 }
 
+static inline unsigned int str(void)
+{
+    unsigned int sel;
+
+    __asm__ ( "str %0" : "=r" (sel) );
+
+    return sel;
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ARCH_DESC_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9509.24928 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqp9-0006dz-FX; Tue, 20 Oct 2020 12:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9509.24928; Tue, 20 Oct 2020 12:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqp9-0006dr-Ca; Tue, 20 Oct 2020 12:33:07 +0000
Received: by outflank-mailman (input) for mailman id 9509;
 Tue, 20 Oct 2020 12:33:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqp8-0006dm-Co
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 07a1a7c3-48fc-430f-9f2e-e88cb9d5373c;
 Tue, 20 Oct 2020 12:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqp7-000258-8b
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqp7-0005Yp-4k
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqp8-0006dm-Co
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:06 +0000
X-Inumbo-ID: 07a1a7c3-48fc-430f-9f2e-e88cb9d5373c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 07a1a7c3-48fc-430f-9f2e-e88cb9d5373c;
	Tue, 20 Oct 2020 12:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1o7nACoIlZJj5ydPxqE22fjAXzTTSAVRydfv0pO9xXQ=; b=IlmjxwdrE+Fz8IeyriV6d+sCTA
	ekOeUXRXJObQWb/1QYpsDqGTmwAWypGtjqshOYv5wbdyIgNAHnNSsZS7cBrLOS9wyyjt34G5Q6t/I
	1XIiInu2beEl4syEK7DQwp7NCDt56td92j0hEzidffRe4NZ5MxcbnJ7WHwT0ULEIVgso=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqp7-000258-8b
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqp7-0005Yp-4k
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUqp7-0005Yp-4k@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:05 +0000

commit 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sat Jan 11 21:57:41 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:19:31 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8c8f054186..0495b6891a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -275,7 +275,7 @@ static l4_pgentry_t __read_mostly split_l4e;
  * Originally cloned from share_xen_page_with_guest(), just to avoid setting
  * PGC_xen_heap on non-heap (typically) MMIO pages. Other pieces got dropped
  * simply because they're not needed in this context.
- */ 
+ */
 static void __init assign_io_page(struct page_info *page)
 {
     set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), INVALID_M2P_ENTRY);
@@ -5079,6 +5079,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5099,7 +5100,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5189,7 +5191,7 @@ int map_pages_to_xen(
 
             l2t = alloc_xen_pagetable();
             if ( l2t == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
@@ -5218,7 +5220,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5262,7 +5264,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5290,7 +5292,7 @@ int map_pages_to_xen(
 
                 l1t = alloc_xen_pagetable();
                 if ( l1t == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
@@ -5436,7 +5438,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9510.24931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpJ-0006fS-Gz; Tue, 20 Oct 2020 12:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9510.24931; Tue, 20 Oct 2020 12:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpJ-0006fL-E9; Tue, 20 Oct 2020 12:33:17 +0000
Received: by outflank-mailman (input) for mailman id 9510;
 Tue, 20 Oct 2020 12:33:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqpI-0006f9-7X
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d836c105-05bd-45af-ae52-d49781eeada9;
 Tue, 20 Oct 2020 12:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpH-00025E-C1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpH-0005Za-B8
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqpI-0006f9-7X
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:16 +0000
X-Inumbo-ID: d836c105-05bd-45af-ae52-d49781eeada9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d836c105-05bd-45af-ae52-d49781eeada9;
	Tue, 20 Oct 2020 12:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rcL6TtCRjxaLA2liecRl6ZDJGNmEUzCFWHWeXZhUyu8=; b=WBll7Dt0c0Oc51pJkgLXxGtgHb
	vgDieD+MMGjeRmmgL9Me/axwejw1SFiWHK4y7lPVGaGC/p28nEeA5N1G6VYmtjxaKYIKZPZl2RQFO
	BsWY961xQiCwv8/wCEFaMtSlgFqrWEd2kvZBC4JAVa+sd1m1nP/M4Wsq0S6EGhz/0Pww=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpH-00025E-C1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpH-0005Za-B8
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUqpH-0005Za-B8@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:15 +0000

commit b733f8a8b8db83f2d438cab3adb38b387cecfce0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sat Jan 11 21:57:42 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:19:55 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0495b6891a..1b8202852e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5468,6 +5468,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5511,7 +5512,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             l2t = alloc_xen_pagetable();
             if ( !l2t )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5568,7 +5570,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 l1t = alloc_xen_pagetable();
                 if ( !l1t )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5701,7 +5704,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9511.24936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpU-0006iY-Ih; Tue, 20 Oct 2020 12:33:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9511.24936; Tue, 20 Oct 2020 12:33:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpU-0006iQ-Fj; Tue, 20 Oct 2020 12:33:28 +0000
Received: by outflank-mailman (input) for mailman id 9511;
 Tue, 20 Oct 2020 12:33:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqpT-0006hz-1C
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 37377db9-4769-4d43-8eb8-7438e8dad799;
 Tue, 20 Oct 2020 12:33:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpR-00025M-FY
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpR-0005aH-ET
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqpT-0006hz-1C
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:27 +0000
X-Inumbo-ID: 37377db9-4769-4d43-8eb8-7438e8dad799
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 37377db9-4769-4d43-8eb8-7438e8dad799;
	Tue, 20 Oct 2020 12:33:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2VsGXdbJES2+VqGQiu6lkLg0NBXsG8Dc38jR3TeVo0=; b=t+kCFsQHY3Cl14hbV01CbreYJq
	MmgOvLst23iHheLNqZZtQJu5IMhc0BDPyRdFSPeKF4iQkL3ywc78vV7/vtm6D/7qoxi8wDizbaMzv
	rPhpS4G/dAEVDiod0YkBteQvcYf+b/F9N0gUW0RO6y2bFSiTsn7GHu+R3I2Zfw+mzzL4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpR-00025M-FY
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpR-0005aH-ET
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUqpR-0005aH-ET@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:25 +0000

commit 1ce75e99d75907aaffae05fcf658a833802bce49
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Sat Jan 11 21:57:43 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:20:19 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1b8202852e..3da62af1a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2083,6 +2083,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5069,6 +5113,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5080,6 +5141,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5095,13 +5157,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5441,6 +5510,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5469,6 +5539,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5477,11 +5548,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5707,9 +5789,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9512.24940 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpd-0006kk-KA; Tue, 20 Oct 2020 12:33:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9512.24940; Tue, 20 Oct 2020 12:33:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpd-0006kc-HD; Tue, 20 Oct 2020 12:33:37 +0000
Received: by outflank-mailman (input) for mailman id 9512;
 Tue, 20 Oct 2020 12:33:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqpc-0006kS-Ec
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 68556ddb-4cfe-4e31-b01b-be803ddedc1c;
 Tue, 20 Oct 2020 12:33:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpb-00025U-IV
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpb-0005aq-Hm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqpc-0006kS-Ec
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:36 +0000
X-Inumbo-ID: 68556ddb-4cfe-4e31-b01b-be803ddedc1c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 68556ddb-4cfe-4e31-b01b-be803ddedc1c;
	Tue, 20 Oct 2020 12:33:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eLM+9TY+wxpvlMq36nC7TFn6AB3yGtTUIBEwaKw6S3o=; b=uv63BbNw9XoZKdUF8e4qvdx6We
	isZ8knD9IvTUgsC1+SEZjaCTBkb0qO1yEzCGVJmIVM+CzTTdUV+vOGCdqiGvAzvhMXJd7tdWIjsuS
	S64c4xEPl+ruh+Uowr6NsE+OklK7uyI2Vt7D80mH1t/aXhZJrGv0FyWZcAVhlOsDrIec=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpb-00025U-IV
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpb-0005aq-Hm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUqpb-0005aq-Hm@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:35 +0000

commit dea460d86957bf1425a8a1572626099ac3f165a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:21:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:21:09 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1bab0e80c2..5f4be59761 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -293,6 +293,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -379,8 +380,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9514.24944 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpt-0006nw-M4; Tue, 20 Oct 2020 12:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9514.24944; Tue, 20 Oct 2020 12:33:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpt-0006no-J1; Tue, 20 Oct 2020 12:33:53 +0000
Received: by outflank-mailman (input) for mailman id 9514;
 Tue, 20 Oct 2020 12:33:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqpr-0006nL-UW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2ae3caef-3be6-4c83-a6b4-507fed8b07f0;
 Tue, 20 Oct 2020 12:33:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpl-00025f-Mi
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpl-0005bV-LD
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqpr-0006nL-UW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:51 +0000
X-Inumbo-ID: 2ae3caef-3be6-4c83-a6b4-507fed8b07f0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2ae3caef-3be6-4c83-a6b4-507fed8b07f0;
	Tue, 20 Oct 2020 12:33:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=r3HvmlTOZT204O11WHp+IwWSVpbdOQTaRKR6OnVrAuI=; b=wf0k1BFbHdyoZ0QkcLFIUaUgaW
	imgwOZrEEVHELcAVTQze8eAg56fBK/f61Ck2ms/De2W4tzJsDRa2AUsjfSe5Lq+F7NaTuG1E8gm29
	p0J0pcEDZ6sibBdTTXY7bRsOT1/PlEUWHsB4h097H4vfalrGqGBtsQ0vWAGZovTJIjOg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpl-00025f-Mi
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpl-0005bV-LD
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUqpl-0005bV-LD@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:45 +0000

commit 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:21:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:21:32 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b4763d9a3d..9c4b26bf07 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3da62af1a5..918ee2bbe3 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4541,7 +4541,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4625,9 +4625,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 5f4be59761..7075e233aa 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -815,13 +815,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -836,7 +835,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -848,8 +850,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -859,6 +865,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -867,6 +874,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -880,6 +896,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -891,6 +909,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -903,8 +934,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 4536a62940..f7975b2df0 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -592,8 +592,22 @@ void scrub_one_page(struct page_info *);
     page_list_del(pg, page_to_list(d, pg))
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:33:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9515.24948 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpy-0006p8-Ps; Tue, 20 Oct 2020 12:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9515.24948; Tue, 20 Oct 2020 12:33:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqpy-0006oz-Mk; Tue, 20 Oct 2020 12:33:58 +0000
Received: by outflank-mailman (input) for mailman id 9515;
 Tue, 20 Oct 2020 12:33:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqpw-0006nL-Uh
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6b819b80-2a5e-4afa-aaf2-c651e2ad1664;
 Tue, 20 Oct 2020 12:33:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpv-00025m-QX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqpv-0005cA-PB
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqpw-0006nL-Uh
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:56 +0000
X-Inumbo-ID: 6b819b80-2a5e-4afa-aaf2-c651e2ad1664
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6b819b80-2a5e-4afa-aaf2-c651e2ad1664;
	Tue, 20 Oct 2020 12:33:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4X8RJuUdwctfZ0s8V2yDbnugXvezeEXNJieCxGISvsE=; b=5Xc0m4b04CXjVZE5nQcD7LaSa9
	oc9TLPb8vtYt5YdPn6lMRAJNN3iqoV4i+woCKkH4TAqSaavbf8J/3P1o7FnVQfYBVemQPTMzCr9QM
	IlNu23od1LU9U5v4qXAcbs3I9qebAHsL1Ed72OJUsp1rTLGNC1/qKjA5hiqV/ooLrtPw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpv-00025m-QX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqpv-0005cA-PB
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:33:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kUqpv-0005cA-PB@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:33:55 +0000

commit 73f62c7380edf07469581a3049aba98abd63b275
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:22:26 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:22:26 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu-defs.h    | 31 ++++++++++++++++-------------
 xen/drivers/passthrough/amd/iommu_map.c     | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  4 ++--
 3 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 15eedfb678..56f385f270 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -451,20 +451,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 0cb948d114..050eca838b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -34,7 +34,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -48,7 +48,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -83,7 +83,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -174,7 +174,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -448,7 +448,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.amd.root_table )
     {
@@ -479,7 +479,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 304363f5d2..e5f8762c5c 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -495,7 +495,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -511,7 +511,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:34:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9516.24951 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqq8-0006qd-R9; Tue, 20 Oct 2020 12:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9516.24951; Tue, 20 Oct 2020 12:34:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqq8-0006qW-OD; Tue, 20 Oct 2020 12:34:08 +0000
Received: by outflank-mailman (input) for mailman id 9516;
 Tue, 20 Oct 2020 12:34:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqq7-0006qI-0V
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7d151b8a-f63d-4614-99e4-012b8945ebad;
 Tue, 20 Oct 2020 12:34:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqq5-00026b-Ti
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqq5-0005d3-Sq
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqq7-0006qI-0V
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:07 +0000
X-Inumbo-ID: 7d151b8a-f63d-4614-99e4-012b8945ebad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7d151b8a-f63d-4614-99e4-012b8945ebad;
	Tue, 20 Oct 2020 12:34:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h/jX5hUY5IwUG/6+SpAZcTce58oUIm0SqnQjuE33PAw=; b=C9dodBOWVCH5VWa7UPtTAbOCVr
	qc6r3lRsBoad50zdSfExq2lw0DQuZB6sS2bQXGNCTbVHzmowvT/CZM8hPB2pln0OROh+whEuR5Q5Z
	SYxlHHFZLZzQlzTZjH0vByOtAP6aZDJKsvSX734j8FqvGSeBmXIil0ci6uLGHEonUZ2w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqq5-00026b-Ti
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqq5-0005d3-Sq
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUqq5-0005d3-Sq@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:34:05 +0000

commit 3b055121c5410e2c3105d6d06aa24ca0d58868cd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:22:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:22:52 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 050eca838b..480cd41c58 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -53,26 +53,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:34:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9517.24955 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqqI-0006sY-Sm; Tue, 20 Oct 2020 12:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9517.24955; Tue, 20 Oct 2020 12:34:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUqqI-0006sR-Ps; Tue, 20 Oct 2020 12:34:18 +0000
Received: by outflank-mailman (input) for mailman id 9517;
 Tue, 20 Oct 2020 12:34:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUqqG-0006sG-Ui
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee21cc86-2dc4-486c-b658-d7dd8033d54c;
 Tue, 20 Oct 2020 12:34:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqqG-00026o-0f
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUqqF-0005dx-W4
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUqqG-0006sG-Ui
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:16 +0000
X-Inumbo-ID: ee21cc86-2dc4-486c-b658-d7dd8033d54c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee21cc86-2dc4-486c-b658-d7dd8033d54c;
	Tue, 20 Oct 2020 12:34:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lBNzPvdMHApNDjDtFIEkQ043o8pevA7cmfd7Dw4T3YY=; b=0xZiqZ5VvAa7b7ZtZ67KJwnXA6
	ydJ+Uaas2upPxSvKUnUNpHrEbLC2jz3wjEeHF8rbUCQyrC9CWsvp1XxYX8dTfJS3IDXmJCg4wlvm/
	IEZMrxp0YCyUGH2Zeh/3jrCYsoN/faBWrh8ds7HJ/wyJqRL+zq8lh//KJcPbe4g1VNqI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqqG-00026o-0f
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUqqF-0005dx-W4
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:34:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUqqF-0005dx-W4@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:34:15 +0000

commit 0514a3a25fb9ebff5d75cc8f00a9229385300858
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:23:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:23:12 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 480cd41c58..17418d39b3 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -103,11 +103,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -130,6 +137,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index e5f8762c5c..64c1fca7b5 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -117,7 +117,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9535.24984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAT-0000UO-3q; Tue, 20 Oct 2020 12:55:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9535.24984; Tue, 20 Oct 2020 12:55:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAT-0000UG-0u; Tue, 20 Oct 2020 12:55:09 +0000
Received: by outflank-mailman (input) for mailman id 9535;
 Tue, 20 Oct 2020 12:55:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrAR-0000UB-El
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 631e8ad8-39c5-460a-bf03-44c3414a2437;
 Tue, 20 Oct 2020 12:55:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAP-0002XG-Tg
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAP-0007Tc-SW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrAR-0000UB-El
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:07 +0000
X-Inumbo-ID: 631e8ad8-39c5-460a-bf03-44c3414a2437
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 631e8ad8-39c5-460a-bf03-44c3414a2437;
	Tue, 20 Oct 2020 12:55:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QGNVLbEcBI58PaJVZsZJB23BcIMKbODnMNqaUFiJPUE=; b=i7L/gv9POrJsMd4XniDTMCjEix
	uI54Nuf5Cvvky89TIWDfrMBtYBhcEhOOIJdsv9y9wzm/qb8g5RuR2t2spygRe6lYoqyT2JncwNZa7
	NgBbg7SyVTO1pOYhZGnnX7PwnGGJcHvTOqnT1ST5kgjI1piG4pFEZWnu6gBaZokaqbqs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAP-0002XG-Tg
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAP-0007Tc-SW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUrAP-0007Tc-SW@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:05 +0000

commit b4271092f29ab105b53e026a243310926b59c076
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:37:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:37:10 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 82bc676553..03f6e6aa62 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5088,6 +5088,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5108,7 +5109,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5198,7 +5200,7 @@ int map_pages_to_xen(
 
             l2t = alloc_xen_pagetable();
             if ( l2t == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
@@ -5227,7 +5229,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5271,7 +5273,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5299,7 +5301,7 @@ int map_pages_to_xen(
 
                 l1t = alloc_xen_pagetable();
                 if ( l1t == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
@@ -5445,7 +5447,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9536.24987 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAc-0000Vq-57; Tue, 20 Oct 2020 12:55:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9536.24987; Tue, 20 Oct 2020 12:55:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAc-0000Vi-2N; Tue, 20 Oct 2020 12:55:18 +0000
Received: by outflank-mailman (input) for mailman id 9536;
 Tue, 20 Oct 2020 12:55:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrAa-0000VZ-Sz
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b008b61e-b89c-47c9-b6db-522f49f0da20;
 Tue, 20 Oct 2020 12:55:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAa-0002XM-1s
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAa-0007UL-00
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrAa-0000VZ-Sz
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
X-Inumbo-ID: b008b61e-b89c-47c9-b6db-522f49f0da20
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b008b61e-b89c-47c9-b6db-522f49f0da20;
	Tue, 20 Oct 2020 12:55:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4rOXXRWq54POIzau86emiqhltjI4TlM22KHYsvUb8so=; b=vixOLhVWtq9S6pRUVvr2ZSjAzR
	129MCh6W+oXjcds+fMvVojPXjU6t+yEGTRZ9FCnoj+HrCzfDVZQ/qGVFml8jd1BSAVLbgAO4nGJg3
	Xx3yRq8hjkXvo8x5GcO2s+Ge8wVBYhBQH/h0ycd+Mc9RwkDlxgRlbtHVHHaYVcLthuhA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAa-0002XM-1s
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAa-0007UL-00
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUrAa-0007UL-00@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:16 +0000

commit 809a70b161ca0adaed0ef198e2b86e846f9de442
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:37:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:37:31 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 03f6e6aa62..2468347a45 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5477,6 +5477,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5520,7 +5521,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             l2t = alloc_xen_pagetable();
             if ( !l2t )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5577,7 +5579,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 l1t = alloc_xen_pagetable();
                 if ( !l1t )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5710,7 +5713,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9537.24992 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAn-0000XS-7V; Tue, 20 Oct 2020 12:55:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9537.24992; Tue, 20 Oct 2020 12:55:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAn-0000XI-3w; Tue, 20 Oct 2020 12:55:29 +0000
Received: by outflank-mailman (input) for mailman id 9537;
 Tue, 20 Oct 2020 12:55:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrAl-0000X6-Bv
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b3ede4ce-6c08-49f6-b9f3-fd7b24a3846d;
 Tue, 20 Oct 2020 12:55:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAk-0002Xc-5P
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAk-0007VS-4L
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrAl-0000X6-Bv
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:27 +0000
X-Inumbo-ID: b3ede4ce-6c08-49f6-b9f3-fd7b24a3846d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b3ede4ce-6c08-49f6-b9f3-fd7b24a3846d;
	Tue, 20 Oct 2020 12:55:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=097GiYg0KD9cdjOUFUrFEwpO69V8HTL0ZM47vsXqu/M=; b=LWpQNg3j/DYgOr8mdOtJbEwvg5
	TzDeZEPdg2UrKjEmzUxjfCwQn2hKvXeRX0++TuADJbZ6UDlJQ4R8g4QDVaoYXHjNWBLOtabL2cIft
	9dWnJmsW0ssRerg4efgNxFI9pmxpAy43q120xT2OG+eqQ3h8kFBP0O9ty2a+kTvUbPXM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAk-0002Xc-5P
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAk-0007VS-4L
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUrAk-0007VS-4L@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:26 +0000

commit 9e757fcdbb758ae2d0459bcaabc8ff6cf505a43d
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 14:38:05 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:05 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2468347a45..9c55b2b9e3 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2088,6 +2088,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5078,6 +5122,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5089,6 +5150,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5104,13 +5166,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5450,6 +5519,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5478,6 +5548,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5486,11 +5557,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5716,9 +5798,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9538.24996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAw-0000Yg-AR; Tue, 20 Oct 2020 12:55:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9538.24996; Tue, 20 Oct 2020 12:55:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrAw-0000YZ-7X; Tue, 20 Oct 2020 12:55:38 +0000
Received: by outflank-mailman (input) for mailman id 9538;
 Tue, 20 Oct 2020 12:55:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrAv-0000YS-6J
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8b414a62-ab7a-424f-a077-09ba70cfa317;
 Tue, 20 Oct 2020 12:55:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAu-0002Xm-9W
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrAu-0007Wf-7s
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrAv-0000YS-6J
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:37 +0000
X-Inumbo-ID: 8b414a62-ab7a-424f-a077-09ba70cfa317
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8b414a62-ab7a-424f-a077-09ba70cfa317;
	Tue, 20 Oct 2020 12:55:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=972dAlKg1/0KjCGTmZjFkRjsF/24E1xlYTcxMQ3jTFo=; b=1oncrPWCJz++rSbeh8j9FTvHbL
	eIq1cWKZLvOFau1tVLW6WVnE7yvLFtX8MNINUMHqGn7mgUd51/GYxn1aZJ6nAvU2DZw1ve5Afiptl
	tVRTgcx/vsXCaRFCfK2AkmLTsbA5eW0STGhOAx2TTGAveAHym/wN6Qq3v9uwHCP2AfM8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAu-0002Xm-9W
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrAu-0007Wf-7s
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUrAu-0007Wf-7s@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:36 +0000

commit 79f17015e7f45e51de87dda7ff9d6fac104e1cc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:38:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:22 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1bab0e80c2..5f4be59761 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -293,6 +293,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -379,8 +380,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9539.24999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrB7-0000a2-C2; Tue, 20 Oct 2020 12:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9539.24999; Tue, 20 Oct 2020 12:55:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrB7-0000Zv-9H; Tue, 20 Oct 2020 12:55:49 +0000
Received: by outflank-mailman (input) for mailman id 9539;
 Tue, 20 Oct 2020 12:55:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrB5-0000Zj-IZ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ef4ed6c7-bcaa-4658-b35c-c06bafcb7c10;
 Tue, 20 Oct 2020 12:55:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrB4-0002Xw-DY
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrB4-0007XH-CA
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrB5-0000Zj-IZ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:47 +0000
X-Inumbo-ID: ef4ed6c7-bcaa-4658-b35c-c06bafcb7c10
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ef4ed6c7-bcaa-4658-b35c-c06bafcb7c10;
	Tue, 20 Oct 2020 12:55:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fz14+aIyD1EJ3wKbIV8X0CNVye3eDy2UkbR6mPuo8tY=; b=V5GFB/05ESaKqXtW9tD9mLDAQp
	y3hiH4GKRq5TJZR8PuhWMeymu1zE/eFnVNWYsiE/90GZUBMuZO2n4X5RY8u5480aQO6ju47+HrIjV
	ETj6of+FFzQBauanQDL476hhqW2HcCfq5orEbNU+jB9fYLXNIbNRiF6GwZmM86BonoOM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrB4-0002Xw-DY
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrB4-0007XH-CA
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUrB4-0007XH-CA@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:46 +0000

commit 94c157f2e3eaf036e04ba5e7186b6f1d5671fa93
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:38:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:53 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 9e2ff7c800..4aba9015b9 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c55b2b9e3..3cb6fabdae 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4550,7 +4550,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4634,9 +4634,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 5f4be59761..7075e233aa 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -815,13 +815,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -836,7 +835,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -848,8 +850,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -859,6 +865,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -867,6 +874,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -880,6 +896,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -891,6 +909,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -903,8 +934,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 1061765bcd..864552b72f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -592,8 +592,22 @@ void scrub_one_page(struct page_info *);
     page_list_del(pg, page_to_list(d, pg))
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:55:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:55:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9540.25004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBH-0000bK-Dx; Tue, 20 Oct 2020 12:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9540.25004; Tue, 20 Oct 2020 12:55:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBH-0000bC-Aq; Tue, 20 Oct 2020 12:55:59 +0000
Received: by outflank-mailman (input) for mailman id 9540;
 Tue, 20 Oct 2020 12:55:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrBF-0000b0-Qi
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ff64e4c6-bae0-4e7e-a155-68a02609f5f0;
 Tue, 20 Oct 2020 12:55:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBE-0002Y3-Gv
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBE-0007Y4-Fx
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrBF-0000b0-Qi
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:57 +0000
X-Inumbo-ID: ff64e4c6-bae0-4e7e-a155-68a02609f5f0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ff64e4c6-bae0-4e7e-a155-68a02609f5f0;
	Tue, 20 Oct 2020 12:55:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sbo+l+DSgGA5y/HMGtcLEcgTlhUJ+4ApldKtru8GzVs=; b=oi2YUFau5EN98/Pb497KDx8ftP
	aveUtluItH4LN6Dm4rTFIwvI39XflBPVymUhsIbVW0nq7VPQJ6XxUirfVPkeb+s4wzpAMoFM+SXxM
	txcPFOqTe9ZnSofGmynZm9wl4xDtDz+2yH9Iom1NJeZMjnphvHnkUe3aw09Lbj2Qqmlg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBE-0002Y3-Gv
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBE-0007Y4-Fx
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:55:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kUrBE-0007Y4-Fx@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:55:56 +0000

commit 7339975f552c99f74c73ee37073bac01a81825be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:22 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 73f62c7380edf07469581a3049aba98abd63b275
    master date: 2020-10-20 14:22:26 +0200
---
 xen/drivers/passthrough/amd/iommu-defs.h    | 31 ++++++++++++++++-------------
 xen/drivers/passthrough/amd/iommu_map.c     | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  8 ++++----
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 15eedfb678..56f385f270 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -451,20 +451,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 93e96cd69c..d6334300ff 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -34,7 +34,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -48,7 +48,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -83,7 +83,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -174,7 +174,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -448,7 +448,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.root_table )
     {
@@ -479,7 +479,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 8d6309cc8c..a23027875b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -387,7 +387,7 @@ static void deallocate_next_page_table(struct page_info *pg, int level)
 
 static void deallocate_page_table(struct page_info *pg)
 {
-    struct amd_iommu_pte *table_vaddr;
+    union amd_iommu_pte *table_vaddr;
     unsigned int index, level = PFN_ORDER(pg);
 
     PFN_ORDER(pg) = 0;
@@ -402,7 +402,7 @@ static void deallocate_page_table(struct page_info *pg)
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( pde->mfn && pde->next_level && pde->pr )
         {
@@ -554,7 +554,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -570,7 +570,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9541.25008 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBR-0000cc-Fb; Tue, 20 Oct 2020 12:56:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9541.25008; Tue, 20 Oct 2020 12:56:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBR-0000cT-CR; Tue, 20 Oct 2020 12:56:09 +0000
Received: by outflank-mailman (input) for mailman id 9541;
 Tue, 20 Oct 2020 12:56:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrBP-0000cH-Ib
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5dcf90d7-29ab-46c0-9439-97ad7d78e5be;
 Tue, 20 Oct 2020 12:56:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBO-0002Yp-Ke
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBO-0007Ze-JD
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrBP-0000cH-Ib
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:07 +0000
X-Inumbo-ID: 5dcf90d7-29ab-46c0-9439-97ad7d78e5be
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5dcf90d7-29ab-46c0-9439-97ad7d78e5be;
	Tue, 20 Oct 2020 12:56:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HM1jjXwx2/0ZN4arMqUE4GU/pjl361G6hSCYkP0C7H0=; b=AIUsEFfhk8ZIuLFZBzEgS9kCLl
	/CO/WDBhEPG7EbHfgGEdhWGauWEfTAoBZ1hJUQV0NPm0cmV81nIJwJ1/J3RdueQg/T03LZhvYB+I7
	XZUfaT8CkCwCTzkH5ATpyGaQFQgNZ9n/+IJxAYpKIXhqxqnK6kfOHG9bPsonTp5g0aJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBO-0002Yp-Ke
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBO-0007Ze-JD
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUrBO-0007Ze-JD@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:06 +0000

commit f7ab0c1a8ce47d6362134cc99354874bcad2fc12
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:41 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:41 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index d6334300ff..0f29b0b648 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -53,26 +53,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9542.25012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBb-0000eY-HC; Tue, 20 Oct 2020 12:56:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9542.25012; Tue, 20 Oct 2020 12:56:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBb-0000eQ-E1; Tue, 20 Oct 2020 12:56:19 +0000
Received: by outflank-mailman (input) for mailman id 9542;
 Tue, 20 Oct 2020 12:56:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrBZ-0000eF-KR
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c3308cfd-fb3a-43e7-b9e2-bbb9f7f99b09;
 Tue, 20 Oct 2020 12:56:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBY-0002Yw-OX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBY-0007b0-Mu
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrBZ-0000eF-KR
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:17 +0000
X-Inumbo-ID: c3308cfd-fb3a-43e7-b9e2-bbb9f7f99b09
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c3308cfd-fb3a-43e7-b9e2-bbb9f7f99b09;
	Tue, 20 Oct 2020 12:56:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=P3K41WpSuG+S8fmcoCWXgS1rFbXrRRiNvMP8rpNOtx0=; b=i6tlz+A5u4Li1QNDs70BFj+cVs
	p58tSAaAKmvEYJsHihwQGUPfwzGCXzWYlyjmAGG8U6J4uwREkSQYB3YQGx1nLV0m+jx9NXL6cC3VV
	hnBHFceZsiDO7DmgRwmUgJoQ65eRdMBT0EMtsSNiKSQl+RvsG19kfVg9E2LvtVEBPjAI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBY-0002Yw-OX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBY-0007b0-Mu
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUrBY-0007b0-Mu@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:16 +0000

commit a279fcbb4f1a9c623dcb0a8f5d86c6a4123cf741
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:56 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 0f29b0b648..8924daef9b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -103,11 +103,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -130,6 +137,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index a23027875b..abf9395437 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -117,7 +117,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9543.25016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBk-0000fx-KM; Tue, 20 Oct 2020 12:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9543.25016; Tue, 20 Oct 2020 12:56:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBk-0000fp-HV; Tue, 20 Oct 2020 12:56:28 +0000
Received: by outflank-mailman (input) for mailman id 9543;
 Tue, 20 Oct 2020 12:56:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrBk-0000fi-8e
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 54528de0-7885-4eda-a568-e9c0b9ddf7ac;
 Tue, 20 Oct 2020 12:56:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBi-0002Z9-Rc
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBi-0007cJ-Qv
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrBk-0000fi-8e
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:28 +0000
X-Inumbo-ID: 54528de0-7885-4eda-a568-e9c0b9ddf7ac
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 54528de0-7885-4eda-a568-e9c0b9ddf7ac;
	Tue, 20 Oct 2020 12:56:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7jbktcHXZ65O4SW7cI+ElnSAQV7sRckYgsYECN0B4rY=; b=OJfr6zXpfwShVuVmeerBPLN67y
	IPFxTe8rMS1rpWxT6ujUx+B34TlEneTj2X9W7JS4TDYnMziwKkky+hkQJGHNckZZuWCSVzlIS3rnf
	Ds67jauIu5haKNo5xag9eAImH+THEI1DY/uqIkqTp3JC7tfN/kMwh1P9Opsw9EvHdcnQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBi-0002Z9-Rc
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBi-0007cJ-Qv
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kUrBi-0007cJ-Qv@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:26 +0000

commit 0974e0085d6de5ae2b60c831e04c07dd1f0f9ba2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:41:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:41:04 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 73619f57ca..3b2136b272 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -119,7 +119,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 71a00e846b..7510212956 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -182,7 +182,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -213,7 +213,7 @@ restore_all_guest:
         movq  8(%rsp), %rcx           # RIP
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9544.25020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBu-0000hK-M5; Tue, 20 Oct 2020 12:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9544.25020; Tue, 20 Oct 2020 12:56:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrBu-0000hC-J1; Tue, 20 Oct 2020 12:56:38 +0000
Received: by outflank-mailman (input) for mailman id 9544;
 Tue, 20 Oct 2020 12:56:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrBt-0000h4-Mt
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6706925e-c972-4a38-9060-54591a5040e5;
 Tue, 20 Oct 2020 12:56:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBs-0002ZG-Ul
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrBs-0007dE-Ts
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrBt-0000h4-Mt
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:37 +0000
X-Inumbo-ID: 6706925e-c972-4a38-9060-54591a5040e5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6706925e-c972-4a38-9060-54591a5040e5;
	Tue, 20 Oct 2020 12:56:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EBoRtCsPTWDIkfyasaCURshD0bkI7u0Q1HGj+W8aTDg=; b=mqWu9ldRRr6GvimU6BiWqPdoM6
	4/DtSQU6mwcXunqY93EKLx4lueYasxa2o/+2hPX5vGyoX0KxEPhzkrzXL07Nu0XH1wkOB79zMFMyU
	KEL5DnLdgVGgh0YPk2j+7DI6KSL9Cte6aaLndb+qr4Eca99O8G8PlQUstKxnp0Sp3rtU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBs-0002ZG-Ul
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrBs-0007dE-Ts
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kUrBs-0007dE-Ts@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:36 +0000

commit 64c39517b5d2c2f324b87e7d663b184fca528d39
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:41:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:41:48 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 7510212956..000eb9722b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -313,7 +313,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9545.25024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrC4-0000ia-Ne; Tue, 20 Oct 2020 12:56:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9545.25024; Tue, 20 Oct 2020 12:56:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrC4-0000iS-Kl; Tue, 20 Oct 2020 12:56:48 +0000
Received: by outflank-mailman (input) for mailman id 9545;
 Tue, 20 Oct 2020 12:56:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrC3-0000iJ-QW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c1757466-2502-4874-a692-27b778b0d0dc;
 Tue, 20 Oct 2020 12:56:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrC3-0002ZT-25
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrC3-0007dv-12
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrC3-0000iJ-QW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
X-Inumbo-ID: c1757466-2502-4874-a692-27b778b0d0dc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c1757466-2502-4874-a692-27b778b0d0dc;
	Tue, 20 Oct 2020 12:56:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6x3ngF64gOBt47ozYd3HVPNRq8HZYCjR4YIVQNCItpo=; b=0nBP/yqyExKbOy9o4wYa2Pa8xc
	9JBYX2nIm4ajT+G7Oco2agbQHLCUsh+WkNb1cjSF7Ch/7x9ipczvOW2NjYo3ln7U/hB+CxSX5V4NH
	jOL/erzNHK8N8JcJ/iE0bHXpIha6tPRxAWcfQANsl18OGuNQK1rcj17owR1QrzDmgBwY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrC3-0002ZT-25
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrC3-0007dv-12
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/S3: fix shadow stack resume path
Message-Id: <E1kUrC3-0007dv-12@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:47 +0000

commit 0521dc918eb196b6479da35a4d0311d829fb0aca
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Oct 20 14:42:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:42:16 2020 +0200

    x86/S3: fix shadow stack resume path
    
    Fix the resume path to load the shadow stack pointer from saved_ssp (not
    saved_rsp), to match what suspend path does.
    
    Fixes: 633ecc4a7cb2 ("x86/S3: Save and restore Shadow Stack configuration")
    Backport: 4.14
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bdbf746ac9152e70f264f87db4472707da805ce
    master date: 2020-09-28 10:43:10 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index a2c41c4f3f..c6b3fcc93d 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -69,7 +69,7 @@ ENTRY(s3_resume)
          * so SETSSBSY will successfully load a value useful for us, then
          * reset MSR_PL0_SSP to its usual value and pop the temporary token.
          */
-        mov     saved_rsp(%rip), %rdi
+        mov     saved_ssp(%rip), %rdi
         cmpq    $1, %rdi
         je      .L_shstk_done
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:56:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9547.25028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCE-0000js-PJ; Tue, 20 Oct 2020 12:56:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9547.25028; Tue, 20 Oct 2020 12:56:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCE-0000jk-MC; Tue, 20 Oct 2020 12:56:58 +0000
Received: by outflank-mailman (input) for mailman id 9547;
 Tue, 20 Oct 2020 12:56:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrCD-0000jb-TX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 77641599-035d-4fa4-a116-c2e21c329d9e;
 Tue, 20 Oct 2020 12:56:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCD-0002Zb-5W
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCD-0007f3-4a
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrCD-0000jb-TX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
X-Inumbo-ID: 77641599-035d-4fa4-a116-c2e21c329d9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 77641599-035d-4fa4-a116-c2e21c329d9e;
	Tue, 20 Oct 2020 12:56:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZqJLJkFc1RvUOI9IX19Vh9Dd2s0ikAbet18Syjekgdg=; b=NohzDOwgWV0HyZudz2OOJWpYcv
	ltYDb2hx7/9rDbswYFgNhDVzUtMYlYQTKrs8LThoWFggso8CsvtyxqV+6gLUAAgWqkuU2BhvckkwG
	xDRB2I/OozgSx43oxb+Sa0FoaHmX9QBVjavx/c/dsUEnaAXxfKCTA0CdfLywiwToxEbU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCD-0002Zb-5W
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCD-0007f3-4a
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:56:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kUrCD-0007f3-4a@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:56:57 +0000

commit 8d148003fdf7bd9e28137e6683ef46902af39146
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:42:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:42:52 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:57:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9549.25031 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCO-0000lG-Qe; Tue, 20 Oct 2020 12:57:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9549.25031; Tue, 20 Oct 2020 12:57:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCO-0000l9-Nj; Tue, 20 Oct 2020 12:57:08 +0000
Received: by outflank-mailman (input) for mailman id 9549;
 Tue, 20 Oct 2020 12:57:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrCN-0000jb-VZ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a1dfa965-804c-4dc3-8bf3-e6163684ede3;
 Tue, 20 Oct 2020 12:57:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCN-0002ab-9B
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCN-0007g7-8L
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrCN-0000jb-VZ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:08 +0000
X-Inumbo-ID: a1dfa965-804c-4dc3-8bf3-e6163684ede3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a1dfa965-804c-4dc3-8bf3-e6163684ede3;
	Tue, 20 Oct 2020 12:57:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bgzp+ocG/gTcDfVWO8sWjnbdHNbMqgbkhm3pwp+N4YM=; b=C032KUHUdPhZtPpWNBsCsLWpp3
	AHG+GGS+o1p7VT7N7+QZ/pcpVoP38tMZd4qk8vZ5yN11QSSo8RIP6VTHExgmkX48kvAp3AYo9/UuS
	imTwJjpFs0l5zeGVrs4VSrK0tVTVZzgszTjmS1SkApWM2h7hYXlN0pUuALYrnLSSDMZ0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCN-0002ab-9B
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCN-0007g7-8L
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kUrCN-0007g7-8L@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:07 +0000

commit 829dbe2cfb84b05f278de93d83dff2473f543789
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 20 14:43:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:43:16 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 59b27f360e3d9dc0378c1288e67a91fa41a77158
    master date: 2020-10-02 08:38:50 +0200
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index a275a35c4f..7bacf7cfed 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -310,6 +310,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:57:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:57:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9550.25036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCY-0000mz-SU; Tue, 20 Oct 2020 12:57:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9550.25036; Tue, 20 Oct 2020 12:57:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCY-0000mr-PU; Tue, 20 Oct 2020 12:57:18 +0000
Received: by outflank-mailman (input) for mailman id 9550;
 Tue, 20 Oct 2020 12:57:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrCY-0000mj-62
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id db3c43ed-23ad-4367-b761-08f27cdf8b79;
 Tue, 20 Oct 2020 12:57:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCX-0002an-CT
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCX-0007hK-Bp
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrCY-0000mj-62
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:18 +0000
X-Inumbo-ID: db3c43ed-23ad-4367-b761-08f27cdf8b79
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id db3c43ed-23ad-4367-b761-08f27cdf8b79;
	Tue, 20 Oct 2020 12:57:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V+mvwk1nRpwqXjTTl0bxUlDwXAuGTJUKr2gPnFK+oU4=; b=n5sgvDTtoEx/+8ZOWK+ebVq99H
	pFfuwnXkmTBUmViCvFSR0UeREnZ0dIldrs/tZkZuxJ/cXqDU1P9m6vtFwewLlyqfeJ3tlHz+j8Aal
	Vy3E+2LINi++LrgGUjj54Len/3HdcdmDAubjqKvEx7HKpvTq6Yky65q1nWo35y7Cy4wE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCX-0002an-CT
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCX-0007hK-Bp
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/S3: Restore CR4 earlier during resume
Message-Id: <E1kUrCX-0007hK-Bp@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:17 +0000

commit 9c1cc643ac3651950ec054a41c970e3fc6ee6da6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:43:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:43:40 2020 +0200

    x86/S3: Restore CR4 earlier during resume
    
    c/s 4304ff420e5 "x86/S3: Drop {save,restore}_rest_processor_state()
    completely" moved CR4 restoration up into C, to account for the fact that MCE
    was explicitly handled later.
    
    However, time_resume() ends up making an EFI Runtime Service call, and EFI
    explodes without OSFXSR, presumably when trying to spill %xmm registers onto
    the stack.
    
    Given this codepath, and the potential for other issues of a similar kind (TLB
    flushing vs INVPCID, HVM logic vs VMXE, etc), restore CR4 in asm before
    entering C.
    
    Ignore the previous MCE special case, because its not actually necessary.  The
    handler is already suitably configured from before suspend.
    
    Fixes: 4304ff420e5 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 7f66c0dc41ae5f770c614e516810eb1f336e2470
    master date: 2020-10-06 12:28:37 +0100
---
 xen/arch/x86/acpi/power.c       | 3 ---
 xen/arch/x86/acpi/wakeup_prot.S | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 4fb1e7a148..7f162a4df9 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -276,9 +276,6 @@ static int enter_state(u32 state)
 
     mcheck_init(&boot_cpu_data, false);
 
-    /* Restore CR4 from cached value, now MCE is set up. */
-    write_cr4(read_cr4());
-
     printk(XENLOG_INFO "Finishing wakeup from ACPI S%d state.\n", state);
 
     if ( (state == ACPI_STATE_S3) && error )
diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index c6b3fcc93d..15052c300f 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -1,3 +1,4 @@
+#include <asm/asm_defns.h>
 #include <asm/msr-index.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -110,6 +111,11 @@ ENTRY(s3_resume)
 
         call    load_system_tables
 
+        /* Restore CR4 from the cpuinfo block. */
+        GET_STACK_END(bx)
+        mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
+        mov     %rax, %cr4
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:57:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:57:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9551.25041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCi-0000oG-UF; Tue, 20 Oct 2020 12:57:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9551.25041; Tue, 20 Oct 2020 12:57:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCi-0000o6-Qx; Tue, 20 Oct 2020 12:57:28 +0000
Received: by outflank-mailman (input) for mailman id 9551;
 Tue, 20 Oct 2020 12:57:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrCi-0000o0-DL
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f612d09b-cd71-4ad6-ba11-aba0ecf88351;
 Tue, 20 Oct 2020 12:57:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCh-0002ax-G3
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCh-0007hx-Em
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrCi-0000o0-DL
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:28 +0000
X-Inumbo-ID: f612d09b-cd71-4ad6-ba11-aba0ecf88351
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f612d09b-cd71-4ad6-ba11-aba0ecf88351;
	Tue, 20 Oct 2020 12:57:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZRiOPv63X5L/UTpNSHRknkxPXWbS3VCU8000QUwonEE=; b=MDhoKq7I1svWiizeC2tOKI5EFv
	qeHbTxvyCBZg33LhNYfcoPY2PX8Hyt7YBstcNZUoj471MYRmnIcf3Zkgg5VjKfaC4VyFnzZnTXLB+
	eIp+X204O4jlGrmIxRwG9KYP894I27VPz+0b8wprfsKVGfJtkkXMXZKZTT/YSl0T2VcA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCh-0002ax-G3
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCh-0007hx-Em
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kUrCh-0007hx-Em@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:27 +0000

commit e9365151919c3b3ecdde6b43d31ad1e230c3342e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:44:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:02 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 7b5c633033..30007a999e 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1629,6 +1629,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:57:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:57:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9552.25044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCs-0000pc-Vb; Tue, 20 Oct 2020 12:57:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9552.25044; Tue, 20 Oct 2020 12:57:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrCs-0000pU-SQ; Tue, 20 Oct 2020 12:57:38 +0000
Received: by outflank-mailman (input) for mailman id 9552;
 Tue, 20 Oct 2020 12:57:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrCs-0000pK-CW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0ddbbd25-816d-4e14-9572-f3a1e3be968a;
 Tue, 20 Oct 2020 12:57:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCr-0002cZ-JX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrCr-0007kA-Ij
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrCs-0000pK-CW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:38 +0000
X-Inumbo-ID: 0ddbbd25-816d-4e14-9572-f3a1e3be968a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0ddbbd25-816d-4e14-9572-f3a1e3be968a;
	Tue, 20 Oct 2020 12:57:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rcoOMb4uOFxID5wAbTlcuzSfTpCk0IlRy08CSfN8ZMg=; b=a/46hR6AGlnwtvs+7+kfaLQTgP
	zxLf+tn0qTMI55ShyyQkXpiYcMXeZ4cTYS/EoWKFs+f0AiYFWmgLPEbiVb+urtRKNOnqo6TQ2tYs8
	x/W+LPiGzOjayNatZVskaRmgwOvgA89lZcsTaEkVKVOPNlhtxXmVGFrDWKgH+bdLJNgw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCr-0002cZ-JX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrCr-0007kA-Ij
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kUrCr-0007kA-Ij@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:37 +0000

commit b081a5f14ccfe7609be63495efe8cb8c39cfb447
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:44:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:36 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b1c8644945..c830d1225c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -402,6 +402,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -427,9 +430,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:57:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9553.25048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrD4-0000r7-2N; Tue, 20 Oct 2020 12:57:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9553.25048; Tue, 20 Oct 2020 12:57:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrD3-0000qz-VY; Tue, 20 Oct 2020 12:57:49 +0000
Received: by outflank-mailman (input) for mailman id 9553;
 Tue, 20 Oct 2020 12:57:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrD2-0000qr-L9
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 88a46d35-0c50-4145-852c-e4cb2949ff49;
 Tue, 20 Oct 2020 12:57:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrD1-0002ch-Mi
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrD1-0007kv-Lu
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrD2-0000qr-L9
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:48 +0000
X-Inumbo-ID: 88a46d35-0c50-4145-852c-e4cb2949ff49
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 88a46d35-0c50-4145-852c-e4cb2949ff49;
	Tue, 20 Oct 2020 12:57:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DplKWptIUkBDDLmJukDkDnFVNh3UmjzmccBQh1HaTpU=; b=Epi0mSAxPO8t75eCt8le9ZiHBO
	QS1+06khrJ7GdZSbbbwSLRz6WEpEb+bBNGWzRcuw9t538uvT+g9O9L0OzoHtdZTz7SS0XD6hThiCf
	F7ecVWpjFFgaVb7oxZnso1fzEssHfoFf6GHuycDWN3ews8FlesVOyvhvyTTAakHXVLxs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrD1-0002ch-Mi
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrD1-0007kv-Lu
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kUrD1-0007kv-Lu@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:47 +0000

commit d2ba323eaae06416728267344b55d345d1bd3b9b
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 14:44:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:59 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 52eab81bf8..015bf83887 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -554,6 +554,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -907,6 +929,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -961,6 +988,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9554.25052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDE-0000tw-3w; Tue, 20 Oct 2020 12:58:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9554.25052; Tue, 20 Oct 2020 12:58:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDE-0000to-0x; Tue, 20 Oct 2020 12:58:00 +0000
Received: by outflank-mailman (input) for mailman id 9554;
 Tue, 20 Oct 2020 12:57:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrDC-0000te-NH
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9be74a24-78c8-4bb1-8e48-22b4a0ac2685;
 Tue, 20 Oct 2020 12:57:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDB-0002cp-PX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDB-0007ld-Os
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrDC-0000te-NH
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:58 +0000
X-Inumbo-ID: 9be74a24-78c8-4bb1-8e48-22b4a0ac2685
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9be74a24-78c8-4bb1-8e48-22b4a0ac2685;
	Tue, 20 Oct 2020 12:57:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vr85j6FjsSGyPWQ4VnZRZ5HbAgCv3w8TsHuTcr2yP00=; b=sxoAcKGaNiFMtXcPFRV1uTuxH+
	wgdyNEmJ6isFJTeaI7Am+lmWMzoyxiiq1UbJDXKqgAmgwH5hHXYGES2bmuDp/AXNBd6QK6QRgy1My
	G/3wYoj6OnQi7xDTUssBbZkE18lW2r+nSYN4yURcgFfUVuN+1+mX1CiX4KgzgViN1RyQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDB-0002cp-PX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDB-0007ld-Os
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:57:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/traps: 'Fix' safety of read_registers() in #DF path
Message-Id: <E1kUrDB-0007ld-Os@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:57:57 +0000

commit 4ba3fb0b4dd0089755a212b673932a8787fb8029
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:45:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:45:31 2020 +0200

    x86/traps: 'Fix' safety of read_registers() in #DF path
    
    All interrupts and exceptions pass a struct cpu_user_regs up into C.  This
    contains the legacy vm86 fields from 32bit days, which are beyond the
    hardware-pushed frame.
    
    Accessing these fields is generally illegal, as they are logically out of
    bounds for anything other than an interrupt/exception hitting ring1/3 code.
    
    show_registers() unconditionally reads these fields, but the content is
    discarded before use.  This is benign right now, as all parts of the stack are
    readable, including the guard pages.
    
    However, read_registers() in the #DF handler writes to these fields as part of
    preparing the state dump, and being IST, hits the adjacent stack frame.
    
    This has been broken forever, but c/s 6001660473 "x86/shstk: Rework the stack
    layout to support shadow stacks" repositioned the #DF stack to be adjacent to
    the guard page, which turns this OoB write into a fatal pagefault:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) CPU:    4
      (XEN) RIP:    e008:[<ffff82d04031fd4f>] traps.c#read_registers+0x29/0xc1
      (XEN) RFLAGS: 0000000000050086   CONTEXT: hypervisor (d1v0)
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d04031fd4f>] R traps.c#read_registers+0x29/0xc1
      (XEN)    [<ffff82d0403207b3>] F do_double_fault+0x3d/0x7e
      (XEN)    [<ffff82d04039acd7>] F double_fault+0x107/0x110
      (XEN)
      (XEN) Pagetable walk from ffff830236f6d008:
      (XEN)  L4[0x106] = 80000000bfa9b063 ffffffffffffffff
      (XEN)  L3[0x008] = 0000000236ffd063 ffffffffffffffff
      (XEN)  L2[0x1b7] = 0000000236ffc063 ffffffffffffffff
      (XEN)  L1[0x16d] = 8000000236f6d161 ffffffffffffffff
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 4:
      (XEN) FATAL PAGE FAULT
      (XEN) [error_code=0003]
      (XEN) Faulting linear address: ffff830236f6d008
      (XEN) ****************************************
      (XEN)
    
    and rendering the main #DF analysis broken.
    
    The proper fix is to delete cpu_user_regs.es and later, so no
    interrupt/exception path can access OoB, but this needs disentangling from the
    PV ABI first.
    
    Not-really-fixes: 6001660473 ("x86/shstk: Rework the stack layout to support shadow stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6065a05adf152a556fb9f11a5218c89e41b62893
    master date: 2020-10-16 11:55:33 +0100
---
 xen/arch/x86/cpu/common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index da74172776..a684519a20 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -770,7 +770,13 @@ void load_system_tables(void)
 	tss->ist[IST_MCE - 1] = stack_top + (1 + IST_MCE) * PAGE_SIZE;
 	tss->ist[IST_NMI - 1] = stack_top + (1 + IST_NMI) * PAGE_SIZE;
 	tss->ist[IST_DB  - 1] = stack_top + (1 + IST_DB)  * PAGE_SIZE;
-	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE;
+	/*
+	 * Gross bodge.  The #DF handler uses the vm86 fields of cpu_user_regs
+	 * beyond the hardware frame.  Adjust the stack entrypoint so this
+	 * doesn't manifest as an OoB write which hits the guard page.
+	 */
+	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE -
+		(sizeof(struct cpu_user_regs) - offsetof(struct cpu_user_regs, es));
 	tss->bitmap = IOBMP_INVALID_OFFSET;
 
 	/* All other stack pointers poisioned. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9555.25056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDO-0000vB-5p; Tue, 20 Oct 2020 12:58:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9555.25056; Tue, 20 Oct 2020 12:58:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDO-0000v3-2Y; Tue, 20 Oct 2020 12:58:10 +0000
Received: by outflank-mailman (input) for mailman id 9555;
 Tue, 20 Oct 2020 12:58:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrDM-0000us-N5
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cd2006b5-72eb-4bb9-bc86-28cfaba128c4;
 Tue, 20 Oct 2020 12:58:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDL-0002db-ST
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDL-0007mK-Rl
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrDM-0000us-N5
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:08 +0000
X-Inumbo-ID: cd2006b5-72eb-4bb9-bc86-28cfaba128c4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cd2006b5-72eb-4bb9-bc86-28cfaba128c4;
	Tue, 20 Oct 2020 12:58:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YPYA6u0iMXvc9LVRHNwvzBXhdSpSUg5lFBUy9IHRsB0=; b=gnJJKuDx4/36qktBN2N5bstf2h
	1JcS77Bg6pnfwHSi374J86Nz7M5l6icbXfD2pRe7+Nk5vinecDNbPR4EeRuLOpThvrvSa4e4p+9ta
	ROh0xSHBdg5JBSFHhkaoySAd3E9W5Kzy4FKUaBA4qffN7IhnPXhRThutd3MA8AyG4Tl0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDL-0002db-ST
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDL-0007mK-Rl
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
Message-Id: <E1kUrDL-0007mK-Rl@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:07 +0000

commit ee47e8e8d9248678d1f638c6b6ec6174dbc9117b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:45:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:45:56 2020 +0200

    x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
    
    cpu_smpboot_alloc() is designed to be idempotent with respect to partially
    initialised state.  This occurs for S3 and CPU parking, where enough state to
    handle NMIs/#MCs needs to remain valid for the entire lifetime of Xen, even
    when we otherwise want to offline the CPU.
    
    For simplicity between various configuration, Xen always uses shadow stack
    mappings (Read-only + Dirty) for the guard page, irrespective of whether
    CET-SS is enabled.
    
    Unfortunately, the CET-SS changes in memguard_guard_stack() broke idempotency
    by first writing out the supervisor shadow stack tokens with plain writes,
    then changing the mapping to being read-only.
    
    This ordering is strictly necessary to configure the BSP, which cannot have
    the supervisor tokens be written with WRSS.
    
    Instead of calling memguard_guard_stack() unconditionally, call it only when
    actually allocating a new stack.  Xenheap allocates are guaranteed to be
    writeable, and the net result is idempotency WRT configuring stack_base[].
    
    Fixes: 91d26ed304f ("x86/shstk: Create shadow stacks")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a7952a320c1e202a218702bfdb14f75132f04894
    master date: 2020-10-16 11:56:59 +0100
---
 xen/arch/x86/smpboot.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 5708573c41..67e727cebd 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -997,16 +997,18 @@ static int cpu_smpboot_alloc(unsigned int cpu)
         memflags = MEMF_node(node);
 
     if ( stack_base[cpu] == NULL )
+    {
         stack_base[cpu] = alloc_xenheap_pages(STACK_ORDER, memflags);
-    if ( stack_base[cpu] == NULL )
-        goto out;
+        if ( !stack_base[cpu] )
+            goto out;
+
+        memguard_guard_stack(stack_base[cpu]);
+    }
 
     info = get_cpu_info_from_stack((unsigned long)stack_base[cpu]);
     info->processor_id = cpu;
     info->per_cpu_offset = __per_cpu_offset[cpu];
 
-    memguard_guard_stack(stack_base[cpu]);
-
     gdt = per_cpu(gdt, cpu) ?: alloc_xenheap_pages(0, memflags);
     if ( gdt == NULL )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9556.25060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDY-0000x9-72; Tue, 20 Oct 2020 12:58:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9556.25060; Tue, 20 Oct 2020 12:58:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDY-0000x2-43; Tue, 20 Oct 2020 12:58:20 +0000
Received: by outflank-mailman (input) for mailman id 9556;
 Tue, 20 Oct 2020 12:58:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrDX-0000wr-1F
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 46dfb761-dfcd-446e-af75-97907b7be894;
 Tue, 20 Oct 2020 12:58:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDV-0002dj-VN
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDV-0007my-Ud
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrDX-0000wr-1F
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:19 +0000
X-Inumbo-ID: 46dfb761-dfcd-446e-af75-97907b7be894
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 46dfb761-dfcd-446e-af75-97907b7be894;
	Tue, 20 Oct 2020 12:58:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TMqV2JD1BoHCCLjvF8sN4318xJi7MXkxpVKXAkSM48U=; b=LHIqFN6ZiGYFvSyTiGPHvrIAco
	uk+wfTGE64p6wxsIGViAtmbrJRGc7p6bCSqgrg0EFS0bM9Zp/SV/ZfUoZJRY1t25BNTD9yD0y0n8O
	da71KhwQdyqYp8FJVqsJFn8LBt9EmUUXrrG5fwsYHKZyZvE12uuElErK+9vYNagoLhvo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDV-0002dj-VN
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDV-0007my-Ud
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kUrDV-0007my-Ud@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:17 +0000

commit 7b1e587f25c2dda38236e48aae81729798f10663
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 14:46:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:46:20 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9557.25064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDj-0000yT-8o; Tue, 20 Oct 2020 12:58:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9557.25064; Tue, 20 Oct 2020 12:58:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDj-0000yL-5v; Tue, 20 Oct 2020 12:58:31 +0000
Received: by outflank-mailman (input) for mailman id 9557;
 Tue, 20 Oct 2020 12:58:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrDh-0000yA-U0
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 66251432-1100-43ca-8306-49e8279286fc;
 Tue, 20 Oct 2020 12:58:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDg-0002dr-VH
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDg-0007pg-Ub
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrDh-0000yA-U0
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:29 +0000
X-Inumbo-ID: 66251432-1100-43ca-8306-49e8279286fc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 66251432-1100-43ca-8306-49e8279286fc;
	Tue, 20 Oct 2020 12:58:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bLQ7U85fM+SRdgiN7E+wXW2ixJ/KvrrUbOiMu2+wGlw=; b=DS0H+/x1ygLyleqaHz4EVRcESe
	YsOhANqnaZl1DerdRz7pijX/s+gtLueKAZSH1eCjK5AzJlwyMArTyxS92zGYzoiV4wgUOLZVivvDG
	CglDZRfeM7ZhYOjxESiRwh54kJcBYhuV/ntgE4h8Hics+ILSn6IvFGNsRNRwMMI3+j/M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDg-0002dr-VH
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDg-0007pg-Ub
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUrDg-0007pg-Ub@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:28 +0000

commit a2c0c91b3ee265a710ba2d5cfc3b0fc90930ed0b
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:50:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:01 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 30dffb68e8..133a393875 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5187,6 +5187,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5207,7 +5208,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5295,7 +5297,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5324,7 +5326,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5367,7 +5369,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5394,7 +5396,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5538,7 +5540,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9558.25068 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDt-0000ze-AL; Tue, 20 Oct 2020 12:58:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9558.25068; Tue, 20 Oct 2020 12:58:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrDt-0000zX-7P; Tue, 20 Oct 2020 12:58:41 +0000
Received: by outflank-mailman (input) for mailman id 9558;
 Tue, 20 Oct 2020 12:58:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrDr-0000zO-Sp
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id abe0c5ed-ae6c-4e5f-8507-8f071ad8d41a;
 Tue, 20 Oct 2020 12:58:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDr-0002dz-2h
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrDr-0007qL-1T
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrDr-0000zO-Sp
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
X-Inumbo-ID: abe0c5ed-ae6c-4e5f-8507-8f071ad8d41a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id abe0c5ed-ae6c-4e5f-8507-8f071ad8d41a;
	Tue, 20 Oct 2020 12:58:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eDMeeyW2ajwW4bdv+lPGfs7ij3YGz8ItPBdYqJzX48w=; b=M5LKBdm13toAtEuIiiR1/Qzn7N
	BWSmP2gTHMlt2E2+o2GbCK/h8P8jsk1N9C6lsXE8lItsSQxvH0k2V1KMA0CLVEygd5qxzti7QiJfr
	3senhpgxY5TDtuMEuGooYok/OJdr6Kt6UtCaYHKRlC/lOpF/fz1/ju24ZBW+T/MRiY5E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDr-0002dz-2h
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrDr-0007qL-1T
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUrDr-0007qL-1T@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:39 +0000

commit 7f5d6760b6e5e710846c50b5c2dbdd094872d3bc
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:50:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:24 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 133a393875..af726d3274 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5570,6 +5570,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5611,7 +5612,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5666,7 +5668,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5795,7 +5798,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:58:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:58:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9559.25072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrE3-00011A-Db; Tue, 20 Oct 2020 12:58:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9559.25072; Tue, 20 Oct 2020 12:58:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrE3-000112-AZ; Tue, 20 Oct 2020 12:58:51 +0000
Received: by outflank-mailman (input) for mailman id 9559;
 Tue, 20 Oct 2020 12:58:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrE2-00010u-DO
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 61dbf9c6-7ac2-47e7-ba21-3be6a8d7acee;
 Tue, 20 Oct 2020 12:58:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrE1-0002eA-6q
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrE1-0007r3-5H
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrE2-00010u-DO
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:50 +0000
X-Inumbo-ID: 61dbf9c6-7ac2-47e7-ba21-3be6a8d7acee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 61dbf9c6-7ac2-47e7-ba21-3be6a8d7acee;
	Tue, 20 Oct 2020 12:58:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AyTr2m5YQzpRMfYkK+H3VI32ZkDmWs1RaBMxdsCeuio=; b=M364OxmUyjkIHoYy90cqcISymr
	q0q5lq0hLdknog6umRQ8QP8f+mWWb6a1GyW5crFDykYfxNtMHbe62eZoWHf4jUWqONgWD5MJuddAH
	IPEmaCNbHie3+rarS7l+5OnfbIK7uc5q/4jz15QoRw6V7eFG12tVpzNkp+7032h6irO4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrE1-0002eA-6q
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrE1-0007r3-5H
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUrE1-0007r3-5H@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:49 +0000

commit 98ec9711e5263350e19753edde6f922535e41744
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 14:50:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:43 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index af726d3274..d6a0761f43 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2167,6 +2167,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5177,6 +5221,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5188,6 +5249,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5203,13 +5265,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5543,6 +5612,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5571,6 +5641,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5579,11 +5650,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5801,9 +5883,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9560.25076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrED-00012R-F8; Tue, 20 Oct 2020 12:59:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9560.25076; Tue, 20 Oct 2020 12:59:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrED-00012I-C8; Tue, 20 Oct 2020 12:59:01 +0000
Received: by outflank-mailman (input) for mailman id 9560;
 Tue, 20 Oct 2020 12:59:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrEC-000127-Es
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a3a50048-a477-429f-9698-ead66d97dac2;
 Tue, 20 Oct 2020 12:58:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEB-0002eK-Ld
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEB-0007rf-94
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrEC-000127-Es
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:00 +0000
X-Inumbo-ID: a3a50048-a477-429f-9698-ead66d97dac2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a3a50048-a477-429f-9698-ead66d97dac2;
	Tue, 20 Oct 2020 12:58:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=W0ojeyD+aKGOAL4f/n3qPOvrrANukim657rbo7CD9u0=; b=rWb7on5u66FQDjI/4I3yzlqW85
	2m6UgpEBJqvSGmZ01DNaoFj712vWs1CNt4KynYp4NE7AtDgRcABexiAgrM0wHcO832Gqj1u2I6qV6
	SwC1W6cJqy8tBFqeoi3EqH05sgkNs2TdAc8W+hOOJASSHsh8wM2yJc7yPBrWFiDF7rBY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEB-0002eK-Ld
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEB-0007rf-94
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:58:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUrEB-0007rf-94@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:58:59 +0000

commit 6e237b616091a573c1c3bef63a5d02f1d0ad0916
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:51:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:51:02 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index b2b6a775d9..9430c10474 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -292,6 +292,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -378,8 +379,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9561.25080 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEO-00013i-Gc; Tue, 20 Oct 2020 12:59:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9561.25080; Tue, 20 Oct 2020 12:59:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEO-00013a-Df; Tue, 20 Oct 2020 12:59:12 +0000
Received: by outflank-mailman (input) for mailman id 9561;
 Tue, 20 Oct 2020 12:59:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrEM-00013Q-Rm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 837d61eb-a458-4e36-88f0-4967a0134c38;
 Tue, 20 Oct 2020 12:59:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEL-0002fM-P1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEL-0007sV-OK
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrEM-00013Q-Rm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:10 +0000
X-Inumbo-ID: 837d61eb-a458-4e36-88f0-4967a0134c38
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 837d61eb-a458-4e36-88f0-4967a0134c38;
	Tue, 20 Oct 2020 12:59:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o1dtxeE0AXqu/RXzxowakaI2NZHBhc5ntsAk5MYp/h4=; b=G4V6W25W8PyYTK1RTUWImgLLoO
	S0aTXYJnHHHUuxPWB2et5Octx6/0/1+/Bf0zN6eeO7uj7oMhIFurz/AXl5fQtV79gTNo4D42DiF+X
	kzBbQ1wXUC16foeLilVxMET0cUSM5RWvHIX+SvY/r8G5KnZ2NQoatoWRnjy1EZZoKe5E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEL-0002fM-P1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEL-0007sV-OK
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUrEL-0007sV-OK@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:59:09 +0000

commit 745652fec903701ff160c6def509c01c8a668d4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:51:27 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:51:27 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 4d6c971f37..774cf62272 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d6a0761f43..407340e5f5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4668,7 +4668,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4752,9 +4752,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9430c10474..031ed6ecbe 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -814,13 +814,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -835,7 +834,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -847,8 +849,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -858,6 +864,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -866,6 +873,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -879,6 +895,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -890,6 +908,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -902,8 +933,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 8d0ddfb60c..e21b457bd1 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -588,8 +588,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9562.25085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEY-00015L-Ip; Tue, 20 Oct 2020 12:59:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9562.25085; Tue, 20 Oct 2020 12:59:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEY-00015D-FD; Tue, 20 Oct 2020 12:59:22 +0000
Received: by outflank-mailman (input) for mailman id 9562;
 Tue, 20 Oct 2020 12:59:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrEW-000153-Se
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b7acab89-43a4-4e0d-bd96-7271a5de4557;
 Tue, 20 Oct 2020 12:59:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEV-0002fS-S3
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEV-0007tD-RQ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrEW-000153-Se
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:20 +0000
X-Inumbo-ID: b7acab89-43a4-4e0d-bd96-7271a5de4557
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b7acab89-43a4-4e0d-bd96-7271a5de4557;
	Tue, 20 Oct 2020 12:59:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cswnS+KqKX7fOF7EbIpRm4qaz5/86/6Z+I4OMdZ52aU=; b=TrgbDZ8gOCi3XcBlT14FphoPeI
	rH0XZEax/peoaeZs2j1L8g0KRKa4B9/w9qzUDeCR8UZFzvQr0/P5XjFjzTEXHU1it806VpYXDA6VU
	Sx4A9jq0FU83ehxOfdfPm9uh/i8GiUIXCs+BXwUHo7xKMKd03tVwmm0MZtLoOMqiJpvs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEV-0002fS-S3
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEV-0007tD-RQ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kUrEV-0007tD-RQ@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:59:19 +0000

commit 1c86c830303fe18b8e2ca305ce44152147e8a8f9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:03 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 73f62c7380edf07469581a3049aba98abd63b275
    master date: 2020-10-20 14:22:26 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c      | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c  |  8 +++----
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h | 31 +++++++++++++++-------------
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 5be27fe9f8..a039038113 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -38,7 +38,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -52,7 +52,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -87,7 +87,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -178,7 +178,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -458,7 +458,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.root_table )
     {
@@ -489,7 +489,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index fd12858578..5851cc5b18 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -390,7 +390,7 @@ static void deallocate_next_page_table(struct page_info *pg, int level)
 
 static void deallocate_page_table(struct page_info *pg)
 {
-    struct amd_iommu_pte *table_vaddr;
+    union amd_iommu_pte *table_vaddr;
     unsigned int index, level = PFN_ORDER(pg);
 
     PFN_ORDER(pg) = 0;
@@ -405,7 +405,7 @@ static void deallocate_page_table(struct page_info *pg)
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( pde->mfn && pde->next_level && pde->pr )
         {
@@ -557,7 +557,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -573,7 +573,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
index 78368f16d9..6049507a30 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
@@ -465,20 +465,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9563.25088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEi-00016t-MG; Tue, 20 Oct 2020 12:59:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9563.25088; Tue, 20 Oct 2020 12:59:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEi-00016i-J4; Tue, 20 Oct 2020 12:59:32 +0000
Received: by outflank-mailman (input) for mailman id 9563;
 Tue, 20 Oct 2020 12:59:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrEg-00016W-TG
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ffd89b71-1b1b-4150-9f17-f20aa7d1d6bd;
 Tue, 20 Oct 2020 12:59:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEf-0002fa-V1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEf-0007u7-UH
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrEg-00016W-TG
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:30 +0000
X-Inumbo-ID: ffd89b71-1b1b-4150-9f17-f20aa7d1d6bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ffd89b71-1b1b-4150-9f17-f20aa7d1d6bd;
	Tue, 20 Oct 2020 12:59:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pVk9v/cjaxOZFmtTuPFRc/C6aJ0OweKaS3vaBKZRFjA=; b=cLRFV2UswrpDZ7Rf5iaeRsn/3H
	jS2rBj/VFfZSR2q5ldIKrejlmkHIpruw1gSFNSfbnfelMD00ZTKn06+iF2icQ64GzYR8XEMgJ+Tx4
	V+vrGTPSXmJnl7UwVGEAxTYGgdG1iML6g5smYOUIhkVLTCHaWTW5hZZmXxWJugEBLXGw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEf-0002fa-V1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEf-0007u7-UH
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUrEf-0007u7-UH@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:59:29 +0000

commit 3009e4d6b46c365e553c67499c45459cf1955f51
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:23 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index a039038113..7f8971c73c 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -45,7 +45,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -57,26 +57,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9564.25092 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEs-000187-Nd; Tue, 20 Oct 2020 12:59:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9564.25092; Tue, 20 Oct 2020 12:59:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrEs-00017z-KW; Tue, 20 Oct 2020 12:59:42 +0000
Received: by outflank-mailman (input) for mailman id 9564;
 Tue, 20 Oct 2020 12:59:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrEr-00017m-0G
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bd3c81ec-4924-4612-a3a9-3069a39fd17d;
 Tue, 20 Oct 2020 12:59:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEq-0002fj-1k
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrEq-0007uf-10
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrEr-00017m-0G
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:41 +0000
X-Inumbo-ID: bd3c81ec-4924-4612-a3a9-3069a39fd17d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bd3c81ec-4924-4612-a3a9-3069a39fd17d;
	Tue, 20 Oct 2020 12:59:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gRTfmr9w6e1p7gXqlxfMeq4Vb37G1cGhwl/OmwYjYyw=; b=Z+FB666XmJHrlRtQTB/+BUxY9T
	zPvJlyI/pWv9SxM5a4g6mLDlUHciAO6L1STfNjv2jR8Y5R9xTvfQCeLE7HCGP5yUqElsoEp9xdjjW
	gBLCaZSFXqOMEdlANsu3zjqrqvjlfRt141rq0yN1DItmp6kx9WLrtfWZACQhHQXD+Z5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEq-0002fj-1k
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrEq-0007uf-10
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUrEq-0007uf-10@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:59:40 +0000

commit e891c288ccf966a5822a6dd2dbf1342273a18d6e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:43 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 7f8971c73c..85b8df9abd 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -107,11 +107,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -134,6 +141,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 5851cc5b18..46b1d367ec 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -120,7 +120,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 12:59:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 12:59:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9565.25096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrF2-00019P-P7; Tue, 20 Oct 2020 12:59:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9565.25096; Tue, 20 Oct 2020 12:59:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrF2-00019H-Lv; Tue, 20 Oct 2020 12:59:52 +0000
Received: by outflank-mailman (input) for mailman id 9565;
 Tue, 20 Oct 2020 12:59:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrF0-000194-Ud
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b49d53a6-2828-4e2f-8af0-53aa8bff75ee;
 Tue, 20 Oct 2020 12:59:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrF0-0002fr-4g
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrF0-0007vL-3x
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrF0-000194-Ud
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
X-Inumbo-ID: b49d53a6-2828-4e2f-8af0-53aa8bff75ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b49d53a6-2828-4e2f-8af0-53aa8bff75ee;
	Tue, 20 Oct 2020 12:59:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zaupiYHGGqovh+5N0IXm/goa6/LndO9qOdrvh0W9sEk=; b=mI18E4G1p0NfmqaLJ6Z7tvVUyZ
	e86zETTvMq1G59DsRAhHbTRMmCS9rNKoo4xzqcYgaQPbBGeD5KgTtgGpRS0QP+Jk2m53vtTkQXplj
	UOYXSW5NfJrAacYeksPtTSEnvKowlhSYMIxdtW5Qlr2vbyUZ6PnzxEocCSxTkCnsW+2c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrF0-0002fr-4g
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrF0-0007vL-3x
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 12:59:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kUrF0-0007vL-3x@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 12:59:50 +0000

commit ff1fd42f0de4f399f3b98903c99d6ec549039eb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:53:30 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:53:30 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 33ac552cac..9059c2ef6e 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -119,7 +119,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5ec5522e33..7850546749 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -182,7 +182,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -202,7 +202,7 @@ restore_all_guest:
         ALIGN
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9566.25099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFC-0001KX-Qk; Tue, 20 Oct 2020 13:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9566.25099; Tue, 20 Oct 2020 13:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFC-0001KD-NS; Tue, 20 Oct 2020 13:00:02 +0000
Received: by outflank-mailman (input) for mailman id 9566;
 Tue, 20 Oct 2020 13:00:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrFB-0001AO-D7
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f1b69359-64c7-4898-bf8b-77a6fb7d9426;
 Tue, 20 Oct 2020 13:00:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFA-0002fz-7b
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFA-0007vo-6t
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrFB-0001AO-D7
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:01 +0000
X-Inumbo-ID: f1b69359-64c7-4898-bf8b-77a6fb7d9426
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f1b69359-64c7-4898-bf8b-77a6fb7d9426;
	Tue, 20 Oct 2020 13:00:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hcjZsIgHq5DBGsfytJEkBhfJCp470w5wr6+JHSNCCuQ=; b=sTGBZPY5tdwYT6RnqJBggmQTcG
	uTEP8lwV1XoaOw1i6mweyyQx19z53sOSwnCUIxJgZbHKcvcdztp51/WHo0y/s6O8o+RAsVxYoQcrk
	IR5SKoBL4D+rv55DRaXsP3moS8WS8KnNIBI9EvzuFGH6hTrAL7IwcyQAKY7jp1aeTxI0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFA-0002fz-7b
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFA-0007vo-6t
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kUrFA-0007vo-6t@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:00 +0000

commit 055a5d540b8a9f40be71fd52eacb39f0b3acf7b7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:54:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:54:12 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 7850546749..6a5f8aaec3 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -296,7 +296,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9567.25104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFN-0001tJ-SP; Tue, 20 Oct 2020 13:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9567.25104; Tue, 20 Oct 2020 13:00:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFN-0001tB-PA; Tue, 20 Oct 2020 13:00:13 +0000
Received: by outflank-mailman (input) for mailman id 9567;
 Tue, 20 Oct 2020 13:00:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrFL-0001sL-Tr
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ac4005ad-f8b5-4047-a8cc-0767a7528341;
 Tue, 20 Oct 2020 13:00:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFK-0002it-GW
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFK-0007y4-9x
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrFL-0001sL-Tr
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:11 +0000
X-Inumbo-ID: ac4005ad-f8b5-4047-a8cc-0767a7528341
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ac4005ad-f8b5-4047-a8cc-0767a7528341;
	Tue, 20 Oct 2020 13:00:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5VvJ4S98uJSgwsB2XzhBTy7S+NaM7ss6PwjfscIdUWU=; b=rR94rk31RwP7DzBWKv/T6hjxpa
	T29v1zn+OsPZL+DOwrVvXXkVBg1a8CDLQ2nF8jH0TNTNztKzKGpz1uEtIUDGQDbvtg5Qa/i4Y1Cfe
	nD2izl11RsKvNWbh/JhQUTGhkGtzGmtlRmPqQbrzvNxiymurGFas/pihanEcNuS0x8pw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFK-0002it-GW
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFK-0007y4-9x
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kUrFK-0007y4-9x@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:10 +0000

commit ca95985a648824a9df941c25e567cd1beee7c5f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:54:44 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:54:44 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9568.25108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFW-0001uU-TY; Tue, 20 Oct 2020 13:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9568.25108; Tue, 20 Oct 2020 13:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFW-0001uM-Qe; Tue, 20 Oct 2020 13:00:22 +0000
Received: by outflank-mailman (input) for mailman id 9568;
 Tue, 20 Oct 2020 13:00:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrFV-0001uF-Di
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f17055db-e2b1-450d-9ca6-1ceda08085e2;
 Tue, 20 Oct 2020 13:00:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFU-0002j4-KP
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFU-0007ym-J1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrFV-0001uF-Di
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:21 +0000
X-Inumbo-ID: f17055db-e2b1-450d-9ca6-1ceda08085e2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f17055db-e2b1-450d-9ca6-1ceda08085e2;
	Tue, 20 Oct 2020 13:00:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IVG1yQNBLbSWpSPHGAD+IdzrzMM/jpFUojMoIbgnjeo=; b=kmb7Kx/lt32fjvcL9K37tgyqbR
	O8qZQqlLDOr7Q4QYZFoDgRcOJEa8Jmjs0zNtOT1iJfAqZqjA0BSCtTTza4iaDyFplK24SzQMKG2fH
	5MQQl99qeYK8IXaRM7a5r7kt8mYyWYgcLoxoTQuxEBSwYWBZNQPOjEjd6iioVs/QlpXQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFU-0002j4-KP
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFU-0007ym-J1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kUrFU-0007ym-J1@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:20 +0000

commit fa9e1f73bfc0033f21d3e53f3a366b9121141763
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 20 14:55:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:55:11 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 59b27f360e3d9dc0378c1288e67a91fa41a77158
    master date: 2020-10-02 08:38:50 +0200
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index e0dd88f0f4..ee9c604118 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -298,6 +298,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9569.25113 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFg-0001vz-Vz; Tue, 20 Oct 2020 13:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9569.25113; Tue, 20 Oct 2020 13:00:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFg-0001vp-SG; Tue, 20 Oct 2020 13:00:32 +0000
Received: by outflank-mailman (input) for mailman id 9569;
 Tue, 20 Oct 2020 13:00:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrFf-0001va-JN
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id feeac0ad-8ea2-4fd4-acdd-9483a694f772;
 Tue, 20 Oct 2020 13:00:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFe-0002jL-NT
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFe-0007zR-Mm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrFf-0001va-JN
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:31 +0000
X-Inumbo-ID: feeac0ad-8ea2-4fd4-acdd-9483a694f772
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id feeac0ad-8ea2-4fd4-acdd-9483a694f772;
	Tue, 20 Oct 2020 13:00:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VKbUXCh9NFixmy48oiw40mcQpgF0Bas/TIWJw2nzeUE=; b=h4BCLEX1/I9pmjpgHNXB9cRl3s
	OXUjp565LKJMWHgbZshnHIpko8k1TQEyo0jZ6vkVbobqq4mwyqS4J0OVcQF578706ySz/n5y51Z3Y
	MKpE8rAFNU2RenN5VDjKZel9qIpYuA6wKoRjtDFLylNHRkK+vUDKJlfVpneXnCoZR2fw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFe-0002jL-NT
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFe-0007zR-Mm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kUrFe-0007zR-Mm@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:30 +0000

commit c32e9be04a16d3c4a97bf034f2cb1eb1318927ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:55:39 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:55:39 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 9b8afb72e8..4eb0883293 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1626,6 +1626,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9570.25116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFr-0001xQ-2E; Tue, 20 Oct 2020 13:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9570.25116; Tue, 20 Oct 2020 13:00:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrFq-0001xI-VR; Tue, 20 Oct 2020 13:00:42 +0000
Received: by outflank-mailman (input) for mailman id 9570;
 Tue, 20 Oct 2020 13:00:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrFp-0001x9-Jl
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7aec4f09-8d05-4728-a622-c516515d893d;
 Tue, 20 Oct 2020 13:00:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFo-0002jT-Qd
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFo-00080K-Ps
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrFp-0001x9-Jl
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:41 +0000
X-Inumbo-ID: 7aec4f09-8d05-4728-a622-c516515d893d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7aec4f09-8d05-4728-a622-c516515d893d;
	Tue, 20 Oct 2020 13:00:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tFgdHQtgOHRX2yvZB7xc26u3xsQNjtB+OWNKZpWwqVQ=; b=A6YdX1kSAZd6IoeTMuzy9vqqdg
	7v0Guex5zP2ohSbZDijK0nAvNE34KpeFb6FtMRNs0ehdjf1RJ0srYR+BfQL8DuoSd3rFE/6fHAJwu
	NWUcKKBTnVXEvDRjIWxTadijUYL8prZ5vW57EKemlgLf12zrmU08VdkegzHzXi74ZmT4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFo-0002jT-Qd
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFo-00080K-Ps
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kUrFo-00080K-Ps@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:40 +0000

commit 82a28743dac04d1ecccd7bcb20b1ef696b67c9a5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:56:07 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:56:07 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4b5ad0fd17..135c6d5b82 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -402,6 +402,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -427,9 +430,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:00:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9571.25120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrG2-0001yh-3t; Tue, 20 Oct 2020 13:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9571.25120; Tue, 20 Oct 2020 13:00:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrG2-0001ya-0r; Tue, 20 Oct 2020 13:00:54 +0000
Received: by outflank-mailman (input) for mailman id 9571;
 Tue, 20 Oct 2020 13:00:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrG0-0001yQ-8l
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a38b2136-806c-44ec-9b2c-5800ee8f5e10;
 Tue, 20 Oct 2020 13:00:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFy-0002je-Vf
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrFy-00080u-St
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrG0-0001yQ-8l
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:52 +0000
X-Inumbo-ID: a38b2136-806c-44ec-9b2c-5800ee8f5e10
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a38b2136-806c-44ec-9b2c-5800ee8f5e10;
	Tue, 20 Oct 2020 13:00:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HqBVyRRjlTgqXaYrhwf6PjlJbp8GwpOyrS4FYc6dLA4=; b=nYTMIJ5rQr8rRZ8FCeg2x5SvlN
	mkDVqCnYgDFm4MhxnVuypHmMYTiHckfcfPu8ehiq74pPbz66qhNK+/7J9qHG7EKglvzSNmFzVUD0X
	CleqK+YFqMtuaI57D0qbuDjkxFH0TEVaUslrSfpwMnQRqVTkT2+e0IbFUGiSy4V+o4So=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFy-0002je-Vf
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrFy-00080u-St
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:00:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kUrFy-00080u-St@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:00:50 +0000

commit b05fe1533b5be6c85e3d32d184ff1e131b1705d9
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 14:56:34 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:56:34 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d0736d4502..9214693546 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -553,6 +553,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -906,6 +928,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -960,6 +987,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:01:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9572.25124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrGC-0001zx-5P; Tue, 20 Oct 2020 13:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9572.25124; Tue, 20 Oct 2020 13:01:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrGC-0001zq-2R; Tue, 20 Oct 2020 13:01:04 +0000
Received: by outflank-mailman (input) for mailman id 9572;
 Tue, 20 Oct 2020 13:01:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrGA-0001ze-9G
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 88bbd510-3812-4923-960f-32885f126cb2;
 Tue, 20 Oct 2020 13:01:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrG9-0002jk-2o
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrG9-00081c-1c
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrGA-0001ze-9G
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:02 +0000
X-Inumbo-ID: 88bbd510-3812-4923-960f-32885f126cb2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 88bbd510-3812-4923-960f-32885f126cb2;
	Tue, 20 Oct 2020 13:01:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AAIiysrHCXFIHxjIz8l8Em3OGROyQpdg1b0SSd0L1h4=; b=bR+HpTqUA0ZhGbfc9+MQnjPhR+
	9qSzsj2DwYzdTzwwDtRis9Obx4bZDYq4Z7HKJTwC6P5UtN3gAYx2gP9UNLLLrqhCSqsviamlRH5HD
	nZSs312Swha37bYq5VfWO4dX2P1wx7Duf7ea/RNeFm6pLSxgGkBuKy/hLwmmlHRAhuuU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrG9-0002jk-2o
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrG9-00081c-1c
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:01:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kUrG9-00081c-1c@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:01:01 +0000

commit dc38c1103cfdc643860e10c1b9e925dac83332dc
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 14:57:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:57:03 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9587.25128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrPw-0002u8-VR; Tue, 20 Oct 2020 13:11:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9587.25128; Tue, 20 Oct 2020 13:11:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrPw-0002tx-SJ; Tue, 20 Oct 2020 13:11:08 +0000
Received: by outflank-mailman (input) for mailman id 9587;
 Tue, 20 Oct 2020 13:11:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrPw-0002ts-52
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b22e1a1f-d645-45dd-95a9-78c13677009a;
 Tue, 20 Oct 2020 13:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrPt-0002xK-Jm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrPt-0000ZR-HX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrPw-0002ts-52
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:08 +0000
X-Inumbo-ID: b22e1a1f-d645-45dd-95a9-78c13677009a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b22e1a1f-d645-45dd-95a9-78c13677009a;
	Tue, 20 Oct 2020 13:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EUYwhyaBCWfaBjxwYYeNSKHdyKk2DPdQb4WaGtvW4Ow=; b=KtHy4c9v1MUiaKgkqmqFI+o5L+
	CkWv/w9vCAC4qIZCmkrqA3dMX8dPEDCn3spHqc8dpNxATcpvzPBpH5m108L/s16C3We9YafzwZT5a
	cS0lCucLiSFM30tAkO5+gx2s3ndkuF3elfHZip8iPWcHv+qrP+tYkZB1V/sup7f8yjrQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrPt-0002xK-Jm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrPt-0000ZR-HX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUrPt-0000ZR-HX@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:05 +0000

commit 03926de91c2e92ded7cfea227aee17486d745225
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:01:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:19 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b4c90bd054..0e540f143b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5227,6 +5227,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5247,7 +5248,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5335,7 +5337,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5364,7 +5366,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5407,7 +5409,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5434,7 +5436,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5578,7 +5580,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9588.25132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQ5-0002vH-0g; Tue, 20 Oct 2020 13:11:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9588.25132; Tue, 20 Oct 2020 13:11:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQ4-0002v6-Tk; Tue, 20 Oct 2020 13:11:16 +0000
Received: by outflank-mailman (input) for mailman id 9588;
 Tue, 20 Oct 2020 13:11:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQ4-0002us-Ie
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b158b760-496f-4b0e-a06b-4ad2cb2ab0be;
 Tue, 20 Oct 2020 13:11:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQ3-0002xN-Nm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQ3-0000aD-ML
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQ4-0002us-Ie
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:16 +0000
X-Inumbo-ID: b158b760-496f-4b0e-a06b-4ad2cb2ab0be
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b158b760-496f-4b0e-a06b-4ad2cb2ab0be;
	Tue, 20 Oct 2020 13:11:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T3C9uo6PkWYhEzPD8frH/BaMIzI7z3Wrti/hMdG+9a0=; b=e9YpG74/eUkq4inAutmcvhhdtc
	60hdxHBBFdes+NREy5nHQIMz3U6T4U4KJWCZL9Rqm2Os/4n4R3zmd5SO6FoaJGxsjdCHJrBQk+0Rn
	aQKPyWSMQj3e/4X8irrrVfin/IIQGFXs7b5HB03dKAw+bo+IVF5ei11tMQFZ6IR6RNi4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQ3-0002xN-Nm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQ3-0000aD-ML
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUrQ3-0000aD-ML@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:15 +0000

commit 1cec2531fbb221abf533187153ca0676155f34d5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:01:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:38 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0e540f143b..bff2689e60 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5610,6 +5610,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5651,7 +5652,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5706,7 +5708,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5835,7 +5838,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9589.25136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQG-0002wm-2A; Tue, 20 Oct 2020 13:11:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9589.25136; Tue, 20 Oct 2020 13:11:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQF-0002we-VK; Tue, 20 Oct 2020 13:11:27 +0000
Received: by outflank-mailman (input) for mailman id 9589;
 Tue, 20 Oct 2020 13:11:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQF-0002wT-1i
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2baf0aec-3336-421e-8d54-dc9b62bfa262;
 Tue, 20 Oct 2020 13:11:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQD-0002xf-Re
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQD-0000ay-QE
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQF-0002wT-1i
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:27 +0000
X-Inumbo-ID: 2baf0aec-3336-421e-8d54-dc9b62bfa262
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2baf0aec-3336-421e-8d54-dc9b62bfa262;
	Tue, 20 Oct 2020 13:11:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UfN/jkSLwGaHKy97waaQFOvN4UaQrdF23wVnsUMVg8U=; b=ZJBb8SNflVUqTjHBoWz6OZZR7r
	M/+eeOWNdJntdqwfuOAnyHn1HYG4wAblpe8/LziTKcqMM+lRn6rJicP6vdRU7KzYRMQD7117YfK/e
	1cR3k+oWzLuWiztPkvz8CzGXM5hDhStzh9KeNsZV4opO/0ln8t5Tmyun5EwCPmYUNCo8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQD-0002xf-Re
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQD-0000ay-QE
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUrQD-0000ay-QE@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:25 +0000

commit e461318da32774df4d6b7c1337a70d731833f00b
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:01:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:56 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bff2689e60..d6ba8c4bb4 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2197,6 +2197,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5217,6 +5261,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5228,6 +5289,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5243,13 +5305,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5583,6 +5652,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5611,6 +5681,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5619,11 +5690,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5841,9 +5923,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9590.25140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQQ-0002yS-4o; Tue, 20 Oct 2020 13:11:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9590.25140; Tue, 20 Oct 2020 13:11:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQQ-0002yK-1s; Tue, 20 Oct 2020 13:11:38 +0000
Received: by outflank-mailman (input) for mailman id 9590;
 Tue, 20 Oct 2020 13:11:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQO-0002y8-Qq
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id da4f3eed-3dff-403f-8d50-b6b88d0ceb6e;
 Tue, 20 Oct 2020 13:11:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQN-0002xn-V1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQN-0000bs-Tm
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQO-0002y8-Qq
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:36 +0000
X-Inumbo-ID: da4f3eed-3dff-403f-8d50-b6b88d0ceb6e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id da4f3eed-3dff-403f-8d50-b6b88d0ceb6e;
	Tue, 20 Oct 2020 13:11:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KTI8JW8pJCZPMCp7hxIOf0QEXcRlEP2x/mVeVO8ryBI=; b=qUaNKhEf5tOlGiQvn955uCz2JK
	EyafILkPePsUJ5G51qs3jU8akBO+4HkrsK7jVWrFtE8CuqfmQC4SyuWnxLmWD7hYU+1m02wOObvp6
	8gqvQbobn6f6bezEvVJ3gLIl6VLouav6E6m1RN5uMz0Ef0v9iU3KjNBCgkFMdIR/FsX0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQN-0002xn-V1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQN-0000bs-Tm
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUrQN-0000bs-Tm@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:35 +0000

commit 37f45de9083eea558437c6175884d31642671d7d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:02:14 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:02:14 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ff88ebb314..212b293bd8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -300,6 +300,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -386,8 +387,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9591.25144 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQb-0002zo-6G; Tue, 20 Oct 2020 13:11:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9591.25144; Tue, 20 Oct 2020 13:11:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQb-0002zg-3N; Tue, 20 Oct 2020 13:11:49 +0000
Received: by outflank-mailman (input) for mailman id 9591;
 Tue, 20 Oct 2020 13:11:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQa-0002za-B1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id dc4bb986-f213-4631-916b-eaa9889b98d3;
 Tue, 20 Oct 2020 13:11:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQY-0002xy-2Z
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQY-0000cf-1Q
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQa-0002za-B1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:48 +0000
X-Inumbo-ID: dc4bb986-f213-4631-916b-eaa9889b98d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id dc4bb986-f213-4631-916b-eaa9889b98d3;
	Tue, 20 Oct 2020 13:11:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B6h7BzzSGH4R7OcdczEahvb6MB7o+Fr7+3oWpfCvwtM=; b=6EuiXesDAUJ3q0C4vMvfP8siIE
	nPBdbpX8733F+bfC/3vzP9h6rLmQLKdvxShDmhThET8L2bdrmhOuAcNv4/vMnRVRl9DJztm2isjy8
	wDr1I7n5WhHYCZO7GQXdX2M0R6y+lWTlN/iQ5U40q8lLcYMvE6lwSzxslPoPbaujG8a0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQY-0002xy-2Z
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQY-0000cf-1Q
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUrQY-0000cf-1Q@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:46 +0000

commit b402e2a14bdc70b5e40a597c0bf14af0ab6354b5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:02:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:02:36 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ffe940fbed..de6009e54b 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1211,7 +1211,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1284,10 +1284,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d6ba8c4bb4..e7b8f4ee4b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4704,7 +4704,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4791,9 +4791,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 212b293bd8..b352a30af6 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -824,11 +824,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -843,7 +842,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( has_iommu_pt(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -855,8 +857,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -866,6 +872,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( has_iommu_pt(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -874,6 +881,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -887,6 +903,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( xatpb->size < extent )
         return -EILSEQ;
 
@@ -895,6 +913,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -907,8 +938,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index e971147234..d60f17db7a 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -583,8 +583,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:11:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:11:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9592.25148 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQk-00030x-7g; Tue, 20 Oct 2020 13:11:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9592.25148; Tue, 20 Oct 2020 13:11:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQk-00030p-4r; Tue, 20 Oct 2020 13:11:58 +0000
Received: by outflank-mailman (input) for mailman id 9592;
 Tue, 20 Oct 2020 13:11:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQj-00030h-LA
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 14986f35-4502-474d-be08-37fe6afa2fde;
 Tue, 20 Oct 2020 13:11:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQi-0002y6-5N
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQi-0000dX-4h
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQj-00030h-LA
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:57 +0000
X-Inumbo-ID: 14986f35-4502-474d-be08-37fe6afa2fde
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 14986f35-4502-474d-be08-37fe6afa2fde;
	Tue, 20 Oct 2020 13:11:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QyWDfiSvX7wiTx9ntqDgThhYke4AZhv23CHEqrvv9N4=; b=EiUfdxokHODR2MJtopsiZbIq2J
	OE3GwmA7/5SH5st9ynrsIJAcNGMwjmFcvBNQYmdE6Sgsc2yRElZ+H3f76IKeyuuNpjKPyqpKwjHxe
	TlUXuSf7915e5g1tkCn7k4GSluAP+eK17hwUqAziduf7rWbXZz06boJSoBk0ntkj3kcU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQi-0002y6-5N
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQi-0000dX-4h
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:11:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUrQi-0000dX-4h@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:11:56 +0000

commit 97f9defe9610adc44dd65a2e21d788e053641183
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:03:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:03:04 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE word by word allows the IOMMU to see a partially
    updated entry. Construct the new entry fully in a local variable and
    then write the new entry by a single insn.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 8f0ec3dc8e..98993aa0ce 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -49,7 +49,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                          IOMMU_PTE_PRESENT_SHIFT) ?
                                          IOMMU_FLUSHF_modified : 0;
 
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 
     return flush_flags;
@@ -60,7 +60,7 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
-    uint64_t maddr_next;
+    uint64_t maddr_next, full;
     uint32_t addr_lo, addr_hi, entry;
     bool old_present;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
@@ -119,7 +119,7 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
     if ( next_level == 0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, 0,
@@ -131,7 +131,9 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9593.25152 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQu-00032F-9n; Tue, 20 Oct 2020 13:12:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9593.25152; Tue, 20 Oct 2020 13:12:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrQu-000327-6Q; Tue, 20 Oct 2020 13:12:08 +0000
Received: by outflank-mailman (input) for mailman id 9593;
 Tue, 20 Oct 2020 13:12:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrQt-000321-No
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1573434c-9168-4949-bbcf-2bf35f6d1fbc;
 Tue, 20 Oct 2020 13:12:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQs-0002yw-8h
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrQs-0000ej-7d
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrQt-000321-No
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:07 +0000
X-Inumbo-ID: 1573434c-9168-4949-bbcf-2bf35f6d1fbc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1573434c-9168-4949-bbcf-2bf35f6d1fbc;
	Tue, 20 Oct 2020 13:12:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xB5JC4yfLJIiNBoFMBvcbBanzQTtmueqA7oka69Mvic=; b=WOumuP55013oDjMexzCJLSFlJB
	Tr2R9OZq0LouHZOK77A1hHxaZ1lo3XtknPB0cFiXp+ssMcOa1/np8+L/eET/6pAMSBrXAmE4ba/ui
	y4q0e8l6H+D2KIiDitJbJ036XKnFGbdwUxlPV2nOs/gOx1BTg7jbmJsdcWZJpU99xyKA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQs-0002yw-8h
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrQs-0000ej-7d
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUrQs-0000ej-7d@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:06 +0000

commit 14b0a080c19949a6af6e9c5af295427e98a2974b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:03:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:03:24 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 98993aa0ce..da7ca7a41e 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -162,7 +162,22 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                                    uint16_t domain_id, uint8_t paging_mode,
                                    uint8_t valid)
 {
-    uint32_t addr_hi, addr_lo, entry;
+    uint32_t addr_hi, addr_lo, entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -181,8 +196,9 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -195,7 +211,7 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(uint32_t *dte, uint8_t i)
@@ -226,6 +242,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                          IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32(addr_lo >> 6, 0,
                          IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -243,7 +260,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(uint32_t *dte,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9594.25157 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrR4-00034B-Bh; Tue, 20 Oct 2020 13:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9594.25157; Tue, 20 Oct 2020 13:12:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrR4-000343-8B; Tue, 20 Oct 2020 13:12:18 +0000
Received: by outflank-mailman (input) for mailman id 9594;
 Tue, 20 Oct 2020 13:12:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrR3-00033v-HC
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9d8fce12-0475-449d-8ede-71d34422ca04;
 Tue, 20 Oct 2020 13:12:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrR2-0002z6-CM
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrR2-0000fQ-Ax
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrR3-00033v-HC
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:17 +0000
X-Inumbo-ID: 9d8fce12-0475-449d-8ede-71d34422ca04
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9d8fce12-0475-449d-8ede-71d34422ca04;
	Tue, 20 Oct 2020 13:12:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nMHYqgXbYX0MP9Fed+8h/4363IKoPt5yCkcj7mkVrsA=; b=eYfFg0M39F09Gj3+lVL1HVBYXQ
	JGmCadpvJ8woVatEqr/5UKc0sjgTG2lvxs9nnXTmwgmcDwJTvOoVMpW/182laf0coujYB4H5C/7pD
	AkSdzHRbswTw+PbXzJbvzbSAJBuHZSvwDYglbSs62pMoT6z59/QbFXrp4aIH07k10BhE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrR2-0002z6-CM
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrR2-0000fQ-Ax
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kUrR2-0000fQ-Ax@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:16 +0000

commit 1833c60701cb6577e260c636e9ce47b70043d2e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 15:04:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:04:00 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 16c5a46e75..538bf39751 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -122,7 +122,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 65229a1a68..bb6577513a 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -185,7 +185,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -205,7 +205,7 @@ restore_all_guest:
         ALIGN
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9595.25160 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRE-00035g-EJ; Tue, 20 Oct 2020 13:12:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9595.25160; Tue, 20 Oct 2020 13:12:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRE-00035X-BA; Tue, 20 Oct 2020 13:12:28 +0000
Received: by outflank-mailman (input) for mailman id 9595;
 Tue, 20 Oct 2020 13:12:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrRD-00035O-9o
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 601098bc-e73d-4965-8c2d-27657a31348b;
 Tue, 20 Oct 2020 13:12:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRC-0002zG-F9
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRC-0000gY-EX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrRD-00035O-9o
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:27 +0000
X-Inumbo-ID: 601098bc-e73d-4965-8c2d-27657a31348b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 601098bc-e73d-4965-8c2d-27657a31348b;
	Tue, 20 Oct 2020 13:12:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XO3/0wVw8ACBhi0lGnDkWsrePw84htGL+qaw4/U5nFI=; b=VUuy0lnBjCVVoaICBL5tWnH44B
	HK8qx8xARvuB16E2o7a0ehO+sdJPIxkK6Gm5yzmodG+JG2+AEyvUEO1miQs582vLYYk0oacnHDFvZ
	oyo0ewPXQNoYngnQFIMSdcDOq6jA4r8v4iyYq3A8jFrnhXooWOdwVMuRPvmWx+9aKU8A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRC-0002zG-F9
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRC-0000gY-EX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kUrRC-0000gY-EX@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:26 +0000

commit 68ff540de173b3747cdb115dbf5030e645ceabcc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 15:04:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:04:32 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index bb6577513a..4f8b58af56 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -299,7 +299,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9596.25165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRO-000376-GL; Tue, 20 Oct 2020 13:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9596.25165; Tue, 20 Oct 2020 13:12:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRO-00036x-Cm; Tue, 20 Oct 2020 13:12:38 +0000
Received: by outflank-mailman (input) for mailman id 9596;
 Tue, 20 Oct 2020 13:12:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrRN-00036h-DD
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cf25b772-211d-49a2-87c7-4d898be8a278;
 Tue, 20 Oct 2020 13:12:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRM-00030u-I7
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRM-0000ih-HI
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrRN-00036h-DD
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:37 +0000
X-Inumbo-ID: cf25b772-211d-49a2-87c7-4d898be8a278
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cf25b772-211d-49a2-87c7-4d898be8a278;
	Tue, 20 Oct 2020 13:12:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z03ASTFn0sJuSk4lC3nbKzmiXt0KV8nWQYcIM8aQ2iE=; b=BBiGTSEsJCCgL3OZCsSM0N3zyY
	ebf9JciIhS4XKB4JVisF9mtW7XJLP/kncJi5gX0d3M6hVH4C1Fjs7c+KYuDFbwzSdBNuZzeENNyR8
	aryBNqfgvwK8z8AjKXO3d3YuZS8ta7pG2T5f4SX/EJEI9BnxsbPDUD36L1PCwEU2bSWU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRM-00030u-I7
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRM-0000ih-HI
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kUrRM-0000ih-HI@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:36 +0000

commit a9382052b8407ebbaba156da340fdf5511f2fb7c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:02 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9597.25167 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRZ-00038N-HB; Tue, 20 Oct 2020 13:12:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9597.25167; Tue, 20 Oct 2020 13:12:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRZ-00038F-EK; Tue, 20 Oct 2020 13:12:49 +0000
Received: by outflank-mailman (input) for mailman id 9597;
 Tue, 20 Oct 2020 13:12:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrRX-000385-TC
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1bfe76d1-bfff-4fdc-82f7-981e2c58c16c;
 Tue, 20 Oct 2020 13:12:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRW-000312-L5
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRW-0000jv-KH
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrRX-000385-TC
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:47 +0000
X-Inumbo-ID: 1bfe76d1-bfff-4fdc-82f7-981e2c58c16c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1bfe76d1-bfff-4fdc-82f7-981e2c58c16c;
	Tue, 20 Oct 2020 13:12:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vNeUY5H8u8zTUg8zuAIrAmB/J3tK1OvDnlf/3qeMC2Y=; b=2BgHIZku1inVXsEXtjbJQC4A07
	YGPu7Jfz6kdKUO/OvMTm56t45XNxq6rtgwQg7MmrsqZ0z8thmfb3aD2PNid6UGC/Y7mHxltVZ9+Yp
	1EYN3O8zWij4Bwo/2KWEtTh3rIIeiGjkcNGrk3Xg4aDdU4yRXscQVa6oBl5cohRaRTrE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRW-000312-L5
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRW-0000jv-KH
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kUrRW-0000jv-KH@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:46 +0000

commit 7488b405b4b35540d99e938975fb8f10079b652b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:29 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index f12fe976cd..393255d555 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1608,6 +1608,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:12:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:12:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9598.25172 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRi-0003BA-Iz; Tue, 20 Oct 2020 13:12:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9598.25172; Tue, 20 Oct 2020 13:12:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRi-0003B2-Fs; Tue, 20 Oct 2020 13:12:58 +0000
Received: by outflank-mailman (input) for mailman id 9598;
 Tue, 20 Oct 2020 13:12:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrRh-0003AA-Ia
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1574ef66-a555-4fa7-b9c3-a1241ffbfa87;
 Tue, 20 Oct 2020 13:12:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRg-000318-Nw
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRg-0000ku-NG
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrRh-0003AA-Ia
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:57 +0000
X-Inumbo-ID: 1574ef66-a555-4fa7-b9c3-a1241ffbfa87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1574ef66-a555-4fa7-b9c3-a1241ffbfa87;
	Tue, 20 Oct 2020 13:12:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JFI2w+STOBSYCqK+WKZCYtHxPbfLgcvK/9QLLVggbgY=; b=VK7qL4CczGZzfw9d6E/tHLTnMg
	Md1jlLaprgt9PoJyjNuWDELdkIRiWeOIaxyygUi4ZVlf2H7q8x1B+4lM3VgoeyJ993xjAIdr18Nkk
	CjJ3raJQ7pfpoGBxCUfrTlk+RONmUAheU7UoikbJQodgLOHOVNq4ey1IC0/FCU3QgF1s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRg-000318-Nw
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRg-0000ku-NG
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:12:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kUrRg-0000ku-NG@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:12:56 +0000

commit f49fff9072dff199a4e76ed27a3bd0b384b55e37
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:57 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:57 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 019dc57459..d5ebfbb83a 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -359,6 +359,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -384,9 +387,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:13:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:13:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9599.25176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRs-0003CZ-KA; Tue, 20 Oct 2020 13:13:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9599.25176; Tue, 20 Oct 2020 13:13:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrRs-0003CR-HM; Tue, 20 Oct 2020 13:13:08 +0000
Received: by outflank-mailman (input) for mailman id 9599;
 Tue, 20 Oct 2020 13:13:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrRr-0003CJ-Tn
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2e5d1dcd-7a6f-4796-b5ca-bc1dca131f6c;
 Tue, 20 Oct 2020 13:13:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRq-000329-R4
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrRq-0000lo-QE
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrRr-0003CJ-Tn
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:07 +0000
X-Inumbo-ID: 2e5d1dcd-7a6f-4796-b5ca-bc1dca131f6c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2e5d1dcd-7a6f-4796-b5ca-bc1dca131f6c;
	Tue, 20 Oct 2020 13:13:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ztr+g0HCMEEZ1P0dsEjlNAczcqucgrF4b2B683GFFNg=; b=DHIOe/M/hrjG3z3neZwCFaHVq1
	a34rCkMjGnGeI5m/RBOYh7h8r57Avg7ijGBfMVG9fiUIDsmnqjMy4t+u1Yw/+NZzNfTPbHa81rlk+
	aJQvkD21pTOBOlyeSiE+gfiVAWElr0ziFrxAKZwll8REHMLBnVUHhvxTkpgaEyYsEGAg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRq-000329-R4
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrRq-0000lo-QE
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kUrRq-0000lo-QE@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:13:06 +0000

commit 5d49509a662be575602c4cf4ae564d2f9d4991fe
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 15:06:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:06:24 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index bf058777fd..856901f1ae 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -553,6 +553,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -900,6 +922,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -954,6 +981,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:13:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:13:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9600.25179 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrS2-0003HZ-Lt; Tue, 20 Oct 2020 13:13:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9600.25179; Tue, 20 Oct 2020 13:13:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrS2-0003HR-Is; Tue, 20 Oct 2020 13:13:18 +0000
Received: by outflank-mailman (input) for mailman id 9600;
 Tue, 20 Oct 2020 13:13:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrS1-0003HJ-Qk
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id caa8ef6b-f9c1-476d-af73-05fe233f9cce;
 Tue, 20 Oct 2020 13:13:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrS0-00032G-U0
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrS0-0000me-TD
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrS1-0003HJ-Qk
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:17 +0000
X-Inumbo-ID: caa8ef6b-f9c1-476d-af73-05fe233f9cce
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id caa8ef6b-f9c1-476d-af73-05fe233f9cce;
	Tue, 20 Oct 2020 13:13:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wHVZS0D2tYq5+Xq1Yqw57pFIjoV13AGYKn9/EEP7kf8=; b=xZz9DG6RL20SLpWcM58ZfTAoCf
	YNIqSDWhK/NBI8ylaiD41ipUScPRpH/9hdJ9+fitVJrVYLjRWmQhcJyqHANM270kOmqZb9lUprOKl
	GWQO4WTzE9PnRtrd8Fxn5C/WfR2UaxL8eAwA1zIAnNxbBHiCDslgMt3Xra6gDY4p+wdo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrS0-00032G-U0
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrS0-0000me-TD
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:13:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kUrS0-0000me-TD@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:13:16 +0000

commit 0108b011e133915a8ebd33636811d8c141b6e9f3
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 15:06:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:06:49 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9603.25184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUraZ-00044u-AO; Tue, 20 Oct 2020 13:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9603.25184; Tue, 20 Oct 2020 13:22:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUraZ-00044m-7E; Tue, 20 Oct 2020 13:22:07 +0000
Received: by outflank-mailman (input) for mailman id 9603;
 Tue, 20 Oct 2020 13:22:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUraY-00044h-0o
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f8ab7bbc-3d48-4bdf-953b-980663c6e8cd;
 Tue, 20 Oct 2020 13:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUraX-0003C1-4s
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUraX-0001aI-2j
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUraY-00044h-0o
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:06 +0000
X-Inumbo-ID: f8ab7bbc-3d48-4bdf-953b-980663c6e8cd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f8ab7bbc-3d48-4bdf-953b-980663c6e8cd;
	Tue, 20 Oct 2020 13:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KGV3/34j4Yr0UeVfHjN3t5oUZtfVjKMmgsjW8zLhYeI=; b=MPASY+qKs9w6fw3KF9qeIfA6ZE
	FAN3rtRxHRzLm23XT+Z9cGYAfIrua6iqYLIidKKVJzSFfGJPtU8GPAuZRiPaaz3jaaRnW07lEUCik
	O+Bv5FH0qnjI6etdk5ca5Z2HTQF5qOvbDHBBeKeO29gXiJ5X9/YBCj1df7jDG+dmDGrI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUraX-0003C1-4s
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUraX-0001aI-2j
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUraX-0001aI-2j@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:05 +0000

commit ad7d04055ea50177bcfdc471ad3bb6e819ec60e0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:14:13 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:13 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 626768a950..79a3fac3cc 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5194,6 +5194,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5214,7 +5215,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5302,7 +5304,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5331,7 +5333,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5374,7 +5376,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5401,7 +5403,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5545,7 +5547,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9606.25188 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUraj-00047g-GG; Tue, 20 Oct 2020 13:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9606.25188; Tue, 20 Oct 2020 13:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUraj-00047Y-DO; Tue, 20 Oct 2020 13:22:17 +0000
Received: by outflank-mailman (input) for mailman id 9606;
 Tue, 20 Oct 2020 13:22:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrai-00047Q-Fh
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d6484a93-6d15-4ec7-95ae-e705f49cc1e2;
 Tue, 20 Oct 2020 13:22:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrah-0003C9-8u
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrah-0001b1-7F
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrai-00047Q-Fh
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:16 +0000
X-Inumbo-ID: d6484a93-6d15-4ec7-95ae-e705f49cc1e2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d6484a93-6d15-4ec7-95ae-e705f49cc1e2;
	Tue, 20 Oct 2020 13:22:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tWYCH9cKsLe/++yK396DtvqiQT63RGDH5git0M9s+oc=; b=XobqXOuEvk3suUqY8/gjzz1Ixf
	uEZPk8U5w3+WU2tsNP37WeV7MuPrT68HzwscRnkqVLq7zx7w6ShoazgAJ3M/zP1kKjl1o5uX/ltwe
	SU3/NqAZTmXb6fLWqsRK/oSmHyveLx/80yP1mQ1JK6dcq6HyvbrFn3/ggMk7aJmLkIjU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrah-0003C9-8u
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrah-0001b1-7F
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUrah-0001b1-7F@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:15 +0000

commit f5ec9f287d00af28b2939c0f628c25c31ebefd18
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:14:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:38 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 79a3fac3cc..8ed3ecacbe 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5577,6 +5577,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5618,7 +5619,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5673,7 +5675,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5802,7 +5805,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9607.25192 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrau-00049G-I3; Tue, 20 Oct 2020 13:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9607.25192; Tue, 20 Oct 2020 13:22:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrau-000498-Ez; Tue, 20 Oct 2020 13:22:28 +0000
Received: by outflank-mailman (input) for mailman id 9607;
 Tue, 20 Oct 2020 13:22:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUras-00048w-La
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 59276e20-15e1-4f2c-b888-d153bcef25c1;
 Tue, 20 Oct 2020 13:22:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrar-0003CK-C9
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrar-0001bh-BI
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUras-00048w-La
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:26 +0000
X-Inumbo-ID: 59276e20-15e1-4f2c-b888-d153bcef25c1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 59276e20-15e1-4f2c-b888-d153bcef25c1;
	Tue, 20 Oct 2020 13:22:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uikrr49R+WKaNMpeglrLcjTTua3IoKFFYQwENaMHM/k=; b=pjBiggbot29Pr22jksPrpgdoci
	w/zAKcDPlR/ACIoGSNxlrsSoSfzVIEE1FgERVR0UJYY01dbw+ZiSsqgBihwlAMe1CCF62cA3qUWVd
	eDyLne83IRrXuQsFX/iMt1RwDO8eBFoFQX9M64BVgKas+lYCqUTMOjQK+0eSJrE1TV0o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrar-0003CK-C9
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrar-0001bh-BI
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUrar-0001bh-BI@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:25 +0000

commit 7912bbe636ef5c9db61c193182c7937a820b7c2b
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:14:58 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:58 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8ed3ecacbe..4ff24de73d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2153,6 +2153,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 /*
  * PTE flags that a guest may change without re-validating the PTE.
  * All other bits affect translation, caching, or Xen's safety.
@@ -5184,6 +5228,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5195,6 +5256,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5210,13 +5272,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5550,6 +5619,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5578,6 +5648,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5586,11 +5657,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5808,9 +5890,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9608.25196 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrb4-0004Aa-K3; Tue, 20 Oct 2020 13:22:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9608.25196; Tue, 20 Oct 2020 13:22:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrb4-0004AS-GZ; Tue, 20 Oct 2020 13:22:38 +0000
Received: by outflank-mailman (input) for mailman id 9608;
 Tue, 20 Oct 2020 13:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrb2-0004AB-OJ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6d6000fe-78d1-4f62-83cf-7caf1bd9b674;
 Tue, 20 Oct 2020 13:22:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrb1-0003Ds-FF
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrb1-0001dd-ET
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrb2-0004AB-OJ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:36 +0000
X-Inumbo-ID: 6d6000fe-78d1-4f62-83cf-7caf1bd9b674
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6d6000fe-78d1-4f62-83cf-7caf1bd9b674;
	Tue, 20 Oct 2020 13:22:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rmFlIip1v+93OdR56mv5wAPA2WZsUIPLg19l3ocRTco=; b=a8QrIQyIB98z6LpeJvhLnLZwuS
	Fr+gItdA/RnNVOMRpbfm/RE2rqjHAROPsT4Dmfuc+rYDi8LDVMAt/MZuof+Rs5m+7FojgGuNgUsiE
	eY6hlP3boNIVBYFUJetNvIsywT/J3k63p+nunazSdqOfTBBDAn//jevxCJM9eiiXdPzA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrb1-0003Ds-FF
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrb1-0001dd-ET
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUrb1-0001dd-ET@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:35 +0000

commit 490c517168bc1cb72c43a02a1ff48bbc25934ffa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:15:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:15:16 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 312a8ec91c..0ae60378f4 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -298,7 +298,10 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+#ifdef CONFIG_HAS_PASSTHROUGH
+    bool *dont_flush_p, dont_flush;
     int rc;
+#endif
 
 #ifdef CONFIG_X86
     mfn = get_gfn_query(d, gmfn, &p2mt);
@@ -376,8 +379,22 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+#endif
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    *dont_flush_p = dont_flush;
+#endif
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9609.25199 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbE-0004Bt-Li; Tue, 20 Oct 2020 13:22:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9609.25199; Tue, 20 Oct 2020 13:22:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbE-0004Bl-Ie; Tue, 20 Oct 2020 13:22:48 +0000
Received: by outflank-mailman (input) for mailman id 9609;
 Tue, 20 Oct 2020 13:22:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrbC-0004BW-Nu
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5a672817-e0e2-43f1-a118-412519778779;
 Tue, 20 Oct 2020 13:22:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbB-0003E6-Ie
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbB-0001eE-Ht
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrbC-0004BW-Nu
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:46 +0000
X-Inumbo-ID: 5a672817-e0e2-43f1-a118-412519778779
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5a672817-e0e2-43f1-a118-412519778779;
	Tue, 20 Oct 2020 13:22:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aZSODceRnuMr8SFtMAPrg5om93t9yU3OW4sjtsFQpHQ=; b=Z3hy8LiISJe0uRpbqX3zR/ms+y
	hNpcYEEelKHU4xKpqPIbjKSVIFdVVz0kmU/v8tvVyRc9WN3Bq2OTqILxaxOafyip4sYLiiQEJFmFV
	GTwcSCrNdhZEDmwRTAJf/zmY2UkN4yQnT+HqrQuSdJTH1pla6AGzFm0bCCBbrde4mw3M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbB-0003E6-Ie
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbB-0001eE-Ht
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUrbB-0001eE-Ht@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:45 +0000

commit 4f35f7fa29a0f87dcfdbd3f1a43dbd08b072ac4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:16:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:16:22 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6450850457..99201ac615 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1222,7 +1222,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1294,10 +1294,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4ff24de73d..5ca5c8c9a2 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4678,7 +4678,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4765,9 +4765,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 0ae60378f4..a4cf496f24 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -811,11 +811,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -831,7 +830,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
 #ifdef CONFIG_HAS_PASSTHROUGH
     if ( need_iommu(d) )
+    {
         this_cpu(iommu_dont_flush_iotlb) = 1;
+        extra.ppage = &pages[0];
+    }
 #endif
 
     while ( xatp->size > done )
@@ -844,8 +846,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -856,6 +862,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( need_iommu(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -863,6 +870,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, xatp->gpfn - done, done);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -876,6 +892,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( xatpb->size < extent )
         return -EILSEQ;
 
@@ -884,6 +902,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -896,8 +927,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 24654e8e22..38002714de 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -577,8 +577,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:22:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:22:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9610.25203 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbN-0004En-Pm; Tue, 20 Oct 2020 13:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9610.25203; Tue, 20 Oct 2020 13:22:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbN-0004EW-MS; Tue, 20 Oct 2020 13:22:57 +0000
Received: by outflank-mailman (input) for mailman id 9610;
 Tue, 20 Oct 2020 13:22:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrbM-0004D8-Ep
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 112c80bd-e4d8-4acf-98b9-83a8a41b0d6d;
 Tue, 20 Oct 2020 13:22:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbL-0003EE-Lr
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbL-0001f1-L1
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrbM-0004D8-Ep
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:56 +0000
X-Inumbo-ID: 112c80bd-e4d8-4acf-98b9-83a8a41b0d6d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 112c80bd-e4d8-4acf-98b9-83a8a41b0d6d;
	Tue, 20 Oct 2020 13:22:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=keLKRCUyOf4N8QjkRXU3leItZPe0JVeWIKvAmAjvCP4=; b=LIJwoW0sUvrjpMtzJoS1p79S7q
	LtrquxNzHq87iaFHlj2sruMWFTRWjch3RdN0NsFrM8FVVu4uVqlx4Q9eqIkTulVZYLYZaKgIfAN6z
	OnXaKtl0lqvgM4fmn5njX+rOl0/gdBkSRsn0YkKomklTCL6KuSmBa0afGz+10qpf3h/Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbL-0003EE-Lr
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbL-0001f1-L1
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:22:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUrbL-0001f1-L1@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:22:55 +0000

commit 7739ffda81784853ca6b0156331f5d1923303fa7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:16:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:16:49 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index aa382dbabd..56b4337e5b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static void clear_iommu_pte_present(unsigned long l1_mfn, unsigned long gfn)
 
     table = map_domain_page(_mfn(l1_mfn));
     pte = table + pfn_to_pde_idx(gfn, IOMMU_PAGING_MODE_LEVEL_1);
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 }
 
@@ -49,7 +49,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
                                     unsigned int next_level,
                                     bool_t iw, bool_t ir)
 {
-    uint64_t addr_lo, addr_hi, maddr_next;
+    uint64_t addr_lo, addr_hi, maddr_next, full;
     u32 entry;
     bool need_flush = false, old_present;
 
@@ -106,7 +106,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
@@ -118,7 +118,9 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return need_flush;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9611.25208 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbY-0004GM-SH; Tue, 20 Oct 2020 13:23:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9611.25208; Tue, 20 Oct 2020 13:23:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbY-0004GE-Oq; Tue, 20 Oct 2020 13:23:08 +0000
Received: by outflank-mailman (input) for mailman id 9611;
 Tue, 20 Oct 2020 13:23:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrbW-0004G2-Pj
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 10f10528-2a7a-4f2a-b8c3-304b58960105;
 Tue, 20 Oct 2020 13:23:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbV-0003FI-PJ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbV-0001fp-OI
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrbW-0004G2-Pj
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:06 +0000
X-Inumbo-ID: 10f10528-2a7a-4f2a-b8c3-304b58960105
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 10f10528-2a7a-4f2a-b8c3-304b58960105;
	Tue, 20 Oct 2020 13:23:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u+HrXf5Q5pbS/2PCI9bff77OksJaJnNz9CLj4XZbJNA=; b=iV1TDPexx0zXJJ9eeUh5oQucF7
	dCHQk6d4c99E7Wn2g+IfFcbv/qspTjHTRH7UGkXfAhQEIh3DoqULj4P0oz1ureY6+jQBu+9LTYBEG
	DC+fAExVZd9hQsiQQORMKSRvSTsygIjsOAg7MXbApWS2kfCbUBwqBN7qG2xyDIH0fedc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbV-0003FI-PJ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbV-0001fp-OI
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUrbV-0001fp-OI@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:05 +0000

commit 63199dfd3a0418f1677c6ccd7fe05b123af4610a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:17:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:17:11 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 56b4337e5b..24d027e7d1 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -147,7 +147,22 @@ void amd_iommu_set_root_page_table(
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid)
 {
     u64 addr_hi, addr_lo;
-    u32 entry;
+    u32 entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -166,8 +181,9 @@ void amd_iommu_set_root_page_table(
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -180,7 +196,7 @@ void amd_iommu_set_root_page_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(u32 *dte, u8 i)
@@ -212,6 +228,7 @@ void __init amd_iommu_set_intremap_table(
                         IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                         IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32((u32)addr_lo >> 6, 0,
                         IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -229,7 +246,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9612.25212 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbj-0004IM-To; Tue, 20 Oct 2020 13:23:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9612.25212; Tue, 20 Oct 2020 13:23:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbj-0004IE-Qc; Tue, 20 Oct 2020 13:23:19 +0000
Received: by outflank-mailman (input) for mailman id 9612;
 Tue, 20 Oct 2020 13:23:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrbh-0004Hz-Pj
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a4aae1f0-2aca-48cf-9451-1d00d5c30a38;
 Tue, 20 Oct 2020 13:23:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbg-0003FQ-O7
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbg-0001hj-NL
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrbh-0004Hz-Pj
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:17 +0000
X-Inumbo-ID: a4aae1f0-2aca-48cf-9451-1d00d5c30a38
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a4aae1f0-2aca-48cf-9451-1d00d5c30a38;
	Tue, 20 Oct 2020 13:23:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VlfNlWczdWjJlfMwtZ1e+dfiQzHusssHQ3VFYdOw3g4=; b=1f1HeCp8j5zFblcIkbarM/NGD9
	BK+GaLHpJ0398qUqTxq/ci5kpz9q4ookm3oRu3mmoKq7tkypYSS18ok8m4gZ1U43y0n34gmRkmrce
	0L12ioYzWEsmuP1oGUiQE7mFLhW7wWS6vhtaKI/JxFAScQmH0c9Z5U36dMy9wrCV0UrQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbg-0003FQ-O7
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbg-0001hj-NL
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kUrbg-0001hj-NL@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:16 +0000

commit 07ad8ff3b84771257b36545af8192171eabbd8ac
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:19:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:19:23 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fd734ff947..f6df0a41f1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5112,6 +5112,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5132,7 +5133,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5218,7 +5220,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5247,7 +5249,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5289,7 +5291,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5315,7 +5317,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5458,7 +5460,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long mfn,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9613.25217 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbt-0004Jb-Vg; Tue, 20 Oct 2020 13:23:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9613.25217; Tue, 20 Oct 2020 13:23:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrbt-0004JR-SC; Tue, 20 Oct 2020 13:23:29 +0000
Received: by outflank-mailman (input) for mailman id 9613;
 Tue, 20 Oct 2020 13:23:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrbr-0004J9-RN
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a812da32-0754-403c-a59f-a56cd53b614a;
 Tue, 20 Oct 2020 13:23:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbq-0003Fa-SC
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrbq-0001iq-QZ
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrbr-0004J9-RN
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:27 +0000
X-Inumbo-ID: a812da32-0754-403c-a59f-a56cd53b614a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a812da32-0754-403c-a59f-a56cd53b614a;
	Tue, 20 Oct 2020 13:23:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=exZw64swJkU9NCWcxvuvTFXrlqO/ZtWy3RuHcegx+B8=; b=zObZd5+E1p1iAUQI7BA04siLE2
	R4taQ4MColOmgOg/Ja/YHtKMx8njjj295XPuPCJRGiBQKyBjLS8EwFcENdXPDZd4S3CKCYWx2z67a
	spddOtCTRDZX1+o2acpen/kIOmqjYXK9lrF5wUHy3HuA1uImj56pfOC3bCW50AJasPns=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbq-0003Fa-SC
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrbq-0001iq-QZ
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kUrbq-0001iq-QZ@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:26 +0000

commit c334b87cef3d923002705838d843ae604650d8c1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:19:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:19:48 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f6df0a41f1..e644685cab 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5491,6 +5491,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5532,7 +5533,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5587,7 +5589,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5716,7 +5719,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9614.25219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrc4-0004Ku-0u; Tue, 20 Oct 2020 13:23:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9614.25219; Tue, 20 Oct 2020 13:23:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrc3-0004Km-Tg; Tue, 20 Oct 2020 13:23:39 +0000
Received: by outflank-mailman (input) for mailman id 9614;
 Tue, 20 Oct 2020 13:23:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrc2-0004KZ-5U
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 69aa629a-d166-465e-a777-86f55c719315;
 Tue, 20 Oct 2020 13:23:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrc0-0003Fg-Ve
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrc0-0001ju-Uf
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrc2-0004KZ-5U
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:38 +0000
X-Inumbo-ID: 69aa629a-d166-465e-a777-86f55c719315
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 69aa629a-d166-465e-a777-86f55c719315;
	Tue, 20 Oct 2020 13:23:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zXbNNedzq6XyDiCh/3XTgGohFscEhCNjfBGuaWtsDjs=; b=xUiNABKZ0g5hk3a+4evfRlKdo6
	sC+p21/RvcakgMEeCylGfLBct3AVpKMHZ05uEKzayO8hVtWAnf1CWO7+cQsUQRB4Gw4clRC+SDjig
	6D6BHy8cF+KS5J+Enro7N/j/p5/OJ8kj9GfPzEg/3O/kqQNbHrUKWRc0bUlv3UcGYUTk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrc0-0003Fg-Ve
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrc0-0001ju-Uf
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kUrc0-0001ju-Uf@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:36 +0000

commit 75a05daf1ddfc0057bd9eeedfd1d872bb47faeda
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:20:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:10 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e644685cab..faa7df30c1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2132,6 +2132,50 @@ void page_unlock(struct page_info *page)
     } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 /*
  * PTE flags that a guest may change without re-validating the PTE.
  * All other bits affect translation, caching, or Xen's safety.
@@ -5102,6 +5146,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     unsigned long mfn,
@@ -5113,6 +5174,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5128,13 +5190,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5463,6 +5532,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5492,6 +5562,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5500,11 +5571,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5722,9 +5804,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9615.25224 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcE-0004MI-3o; Tue, 20 Oct 2020 13:23:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9615.25224; Tue, 20 Oct 2020 13:23:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcE-0004M9-0e; Tue, 20 Oct 2020 13:23:50 +0000
Received: by outflank-mailman (input) for mailman id 9615;
 Tue, 20 Oct 2020 13:23:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrcB-0004Lw-Ti
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ac953f8f-a274-406b-a414-5806d8d8f27e;
 Tue, 20 Oct 2020 13:23:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcB-0003Fs-2G
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcB-0001l7-1f
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrcB-0004Lw-Ti
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
X-Inumbo-ID: ac953f8f-a274-406b-a414-5806d8d8f27e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ac953f8f-a274-406b-a414-5806d8d8f27e;
	Tue, 20 Oct 2020 13:23:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yf+B7HHBwMQRWy4rvG9jKHvMBd6/Db2XR+rBZxr+h58=; b=KJChYYgh05Eupj8/BJAM8NTqdu
	h09m3BSdDPbDWMYc8agYxaOp7RCSV9pmZpsCeZ8LHIgDSK3zVHgmvSjOu1VmzX33o5qvnN29DHW8R
	eQs2MzFyuGKelezenvDye2welN5sDAhOQQ0KYokHowjKzfojItF8W/4DDpWoir4Vyp90=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcB-0003Fs-2G
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcB-0001l7-1f
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kUrcB-0001l7-1f@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:47 +0000

commit 6f012ec24294993d59bac9b9caae7d3c4dae347d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:20:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:31 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 8aaecb4495..e177941925 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -284,7 +284,10 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+#ifdef CONFIG_HAS_PASSTHROUGH
+    bool *dont_flush_p, dont_flush;
     int rc;
+#endif
 
 #ifdef CONFIG_X86
     mfn = get_gfn_query(d, gmfn, &p2mt);
@@ -359,8 +362,22 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+#endif
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    *dont_flush_p = dont_flush;
+#endif
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:23:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:23:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9616.25228 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcN-0004NZ-5A; Tue, 20 Oct 2020 13:23:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9616.25228; Tue, 20 Oct 2020 13:23:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcN-0004NR-29; Tue, 20 Oct 2020 13:23:59 +0000
Received: by outflank-mailman (input) for mailman id 9616;
 Tue, 20 Oct 2020 13:23:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrcM-0004NI-8J
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5c244dfe-4fe1-424a-865e-1c161dda600a;
 Tue, 20 Oct 2020 13:23:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcL-0003G4-6f
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcL-0001lr-4v
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrcM-0004NI-8J
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:58 +0000
X-Inumbo-ID: 5c244dfe-4fe1-424a-865e-1c161dda600a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5c244dfe-4fe1-424a-865e-1c161dda600a;
	Tue, 20 Oct 2020 13:23:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nu9VmMiv3/cMiNrShYNXj+oKzpxTOm8xV5vtut0i9/M=; b=GjoUhxvVAcIW3OAJunQv1e32IO
	A2yOMngOI7YyewqtWGGPkX7WIOFxhFZOJ1mvgDIF+7i0xA1jmR873oMS/R1udeLpyrPJI22YFbda1
	9s5GWRaLbkiROjnDNw2bUkWLy/gMyVpvo1VnTHlWDJM3ufM84/EkufYFLRVJQHt6RbFc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcL-0003G4-6f
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcL-0001lr-4v
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:23:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kUrcL-0001lr-4v@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:23:57 +0000

commit d73e9720545d6acb376bd7c2b1b1d7c92aec6e30
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:20:54 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:54 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 43 ++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 65 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index cbc0e7c739..7599a32127 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1225,7 +1225,7 @@ void share_xen_page_with_privileged_guests(
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1297,10 +1297,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index faa7df30c1..7090be7b4a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4633,7 +4633,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4723,9 +4723,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e177941925..08fc9252a3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -768,11 +768,10 @@ static int xenmem_add_to_physmap(struct domain *d,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -788,7 +787,10 @@ static int xenmem_add_to_physmap(struct domain *d,
 
 #ifdef CONFIG_HAS_PASSTHROUGH
     if ( need_iommu(d) )
+    {
         this_cpu(iommu_dont_flush_iotlb) = 1;
+        extra.ppage = &pages[0];
+    }
 #endif
 
     while ( xatp->size > done )
@@ -801,8 +803,12 @@ static int xenmem_add_to_physmap(struct domain *d,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -813,6 +819,7 @@ static int xenmem_add_to_physmap(struct domain *d,
     if ( need_iommu(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -820,6 +827,15 @@ static int xenmem_add_to_physmap(struct domain *d,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, xatp->gpfn - done, done);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -835,6 +851,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
 {
     unsigned int done = 0;
     int rc;
+    union add_to_physmap_extra extra = {};
 
     if ( xatpb->size < start )
         return -EILSEQ;
@@ -849,6 +866,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_okay(xatpb->errs, xatpb->size) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > done )
     {
         xen_ulong_t idx;
@@ -866,8 +896,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
             goto out;
         }
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, 0, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index fdcb90841a..4c41e6a69f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -583,8 +583,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 /* Return 0 on success, or negative on error. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:24:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:24:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9617.25231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcX-0004Pa-6T; Tue, 20 Oct 2020 13:24:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9617.25231; Tue, 20 Oct 2020 13:24:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrcX-0004PS-3g; Tue, 20 Oct 2020 13:24:09 +0000
Received: by outflank-mailman (input) for mailman id 9617;
 Tue, 20 Oct 2020 13:24:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrcW-0004PK-Qh
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9e14c952-c738-4fab-83bc-46047f944283;
 Tue, 20 Oct 2020 13:24:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcV-0003Gs-9h
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcV-0001mU-8u
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrcW-0004PK-Qh
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:08 +0000
X-Inumbo-ID: 9e14c952-c738-4fab-83bc-46047f944283
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9e14c952-c738-4fab-83bc-46047f944283;
	Tue, 20 Oct 2020 13:24:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pd6nNNBC2MMCq8D+ECZIzpYV8lOSLrhZD5m/fdHXsYw=; b=0o6dir4Gy99ARqiKpfksPrb6L+
	15JDE+/SAJ8f2HEkhsxFMCKUTDzNca+TMTE2+9i8kXjbUtn5oaoLtlSIOyukLc1OFZq++P9ehjhhP
	I0Td0JGJZ/9tG1ur7Ed+/DcIDcqcxSjvwG4dMS6KsNRBya6MMqxE4g1yEU8C1XNC2wLg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcV-0003Gs-9h
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcV-0001mU-8u
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kUrcV-0001mU-8u@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:24:07 +0000

commit 56f8da75e1d42047549da304afb20bd72d572c84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:21:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:21:19 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 85ce9405cf..3c29788d9a 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static void clear_iommu_pte_present(unsigned long l1_mfn, unsigned long gfn)
 
     table = map_domain_page(_mfn(l1_mfn));
     pte = table + pfn_to_pde_idx(gfn, IOMMU_PAGING_MODE_LEVEL_1);
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 }
 
@@ -49,7 +49,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
                                     unsigned int next_level,
                                     bool_t iw, bool_t ir)
 {
-    uint64_t addr_lo, addr_hi, maddr_next;
+    uint64_t addr_lo, addr_hi, maddr_next, full;
     u32 entry;
     bool need_flush = false, old_present;
 
@@ -106,7 +106,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
@@ -118,7 +118,9 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return need_flush;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 13:24:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 13:24:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9619.25236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrch-0004SK-8h; Tue, 20 Oct 2020 13:24:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9619.25236; Tue, 20 Oct 2020 13:24:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUrch-0004SD-5K; Tue, 20 Oct 2020 13:24:19 +0000
Received: by outflank-mailman (input) for mailman id 9619;
 Tue, 20 Oct 2020 13:24:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUrcg-0004PK-Ph
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 423ec61f-0f00-458f-9bf5-d8412993af92;
 Tue, 20 Oct 2020 13:24:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcf-0003H2-Ct
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUrcf-0001nC-C0
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUrcg-0004PK-Ph
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:18 +0000
X-Inumbo-ID: 423ec61f-0f00-458f-9bf5-d8412993af92
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 423ec61f-0f00-458f-9bf5-d8412993af92;
	Tue, 20 Oct 2020 13:24:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+laguxv/2Jt40ASs2mBct0MRB5/cKMN1VXZCYmymTYg=; b=vJTO04Rc2N2o2YZ8MNNywKbAB/
	oR0Z6JskA2wiD3PdouoZ5JEq7ebTy15OJxN7QUJuR3QWE70e5VP7Tl8dM2MZlFldaA+9xlqQg7uW7
	It4qt7Iu0+j8WO4pNhGQEobAKC75CazWdfXqoER6RmSPeaQbs8A3M7BSjl3nNiA6cLDM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcf-0003H2-Ct
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUrcf-0001nC-C0
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 13:24:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kUrcf-0001nC-C0@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 13:24:17 +0000

commit 71da63bbb83af8c8c537f3731dda7dc2d2fd31ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:21:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:21:40 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 3c29788d9a..f0bc1dd3af 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -147,7 +147,22 @@ void amd_iommu_set_root_page_table(
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid)
 {
     u64 addr_hi, addr_lo;
-    u32 entry;
+    u32 entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -166,8 +181,9 @@ void amd_iommu_set_root_page_table(
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -180,7 +196,7 @@ void amd_iommu_set_root_page_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(u32 *dte, u8 i)
@@ -212,6 +228,7 @@ void __init amd_iommu_set_intremap_table(
                         IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                         IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32((u32)addr_lo >> 6, 0,
                         IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -229,7 +246,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 20:33:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 20:33:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9779.25776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUyJi-0005aG-S4; Tue, 20 Oct 2020 20:33:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9779.25776; Tue, 20 Oct 2020 20:33:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUyJi-0005a8-PH; Tue, 20 Oct 2020 20:33:10 +0000
Received: by outflank-mailman (input) for mailman id 9779;
 Tue, 20 Oct 2020 20:33:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUyJh-0005a2-Ne
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 78c3057c-0fd7-4b8d-8a95-a86aefdbd419;
 Tue, 20 Oct 2020 20:33:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUyJd-0004QE-VX
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUyJd-0002l4-T5
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUyJh-0005a2-Ne
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:09 +0000
X-Inumbo-ID: 78c3057c-0fd7-4b8d-8a95-a86aefdbd419
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 78c3057c-0fd7-4b8d-8a95-a86aefdbd419;
	Tue, 20 Oct 2020 20:33:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SfpWUyICKF1IqnkOd8JR+AwYUuvsUKUYIWZ8L/m69rU=; b=Dw0Pjzl5wGpUjZZgIQ5/obvlX3
	JnmgmKNXAcE8eFbZC7nP6A+bwH9X/j74C7oNX0FeXx8Cw6AKEcD+QpulJ0SxEvKacD6HavgHjcKc9
	7H0eDTZlhws1xCPdDQCd+87KWsW2BR0hhKcz/WiWpyiRi99XidfMvi0+FCMh7pc2erU4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUyJd-0004QE-VX
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUyJd-0002l4-T5
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: optee: don't print warning about "wrong" RPC buffer
Message-Id: <E1kUyJd-0002l4-T5@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 20:33:05 +0000

commit aace5466996e743a087153ad3f9d8fcf11a76c56
Author:     Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
AuthorDate: Mon Oct 5 09:12:32 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Oct 20 13:20:28 2020 -0700

    arm: optee: don't print warning about "wrong" RPC buffer
    
    The OP-TEE mediator tracks the cookie value of the last buffer which was
    requested by OP-TEE. This tracked value serves one important purpose: if
    OP-TEE wants to request another buffer, we know that it finished
    importing the previous one and we can free the page list associated with
    it.
    
    Also, we had a false premise that OP_TEE frees requested buffers in
    reversed order. So we checked rpc_data_cookie during handling of the
    OPTEE_RPC_CMD_SHM_FREE call and printed a warning if the cookie of the
    buffer which is requested to be freed differs from the last allocated
    one.
    
    During testing of RPMB FS services I discovered that RPMB code frees
    request and response buffers in the same order is it allocated them. And
    this is perfectly fine, actually.
    
    So, we are removing mentioned warning message in Xen, as it is perfectly
    normal to free buffers in arbitrary order.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [stefano: fix grammar]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/arch/arm/tee/optee.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 8a39fe33b0..ee85359742 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -1127,25 +1127,7 @@ static int handle_rpc_return(struct optee_domain *ctx,
          */
         if ( shm_rpc->xen_arg->cmd == OPTEE_RPC_CMD_SHM_FREE )
         {
-            uint64_t cookie = shm_rpc->xen_arg->params[0].u.value.b;
-
-            free_optee_shm_buf(ctx, cookie);
-
-            /*
-             * OP-TEE asks to free the buffer, but this is not the same
-             * buffer we previously allocated for it. While nothing
-             * prevents OP-TEE from asking this, it is the strange
-             * situation. This may or may not be caused by a bug in
-             * OP-TEE or mediator. But is better to print warning.
-             */
-            if ( call->rpc_data_cookie && call->rpc_data_cookie != cookie )
-            {
-                gprintk(XENLOG_ERR,
-                        "Saved RPC cookie does not corresponds to OP-TEE's (%"PRIx64" != %"PRIx64")\n",
-                        call->rpc_data_cookie, cookie);
-
-                WARN();
-            }
+            free_optee_shm_buf(ctx, shm_rpc->xen_arg->params[0].u.value.b);
             call->rpc_data_cookie = 0;
         }
         unmap_domain_page(shm_rpc->xen_arg);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 20 20:33:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Oct 2020 20:33:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9780.25780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUyJq-0005eE-Us; Tue, 20 Oct 2020 20:33:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9780.25780; Tue, 20 Oct 2020 20:33:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kUyJq-0005e7-S0; Tue, 20 Oct 2020 20:33:18 +0000
Received: by outflank-mailman (input) for mailman id 9780;
 Tue, 20 Oct 2020 20:33:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kUyJp-0005dq-Hb
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3a822f6e-6b62-4617-a1f8-9579fe299587;
 Tue, 20 Oct 2020 20:33:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUyJo-0004QH-3n
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kUyJo-0002lw-1P
 for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=VKmR=D3=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kUyJp-0005dq-Hb
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:17 +0000
X-Inumbo-ID: 3a822f6e-6b62-4617-a1f8-9579fe299587
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3a822f6e-6b62-4617-a1f8-9579fe299587;
	Tue, 20 Oct 2020 20:33:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NY7DkzcK+YggZpBqluOqkQ7C0HCAeaNtqYjNn+Oxckk=; b=vwN4shVko0CMQ5qvICc+bi0BxQ
	5EnvzyB24PbgsMnKAG1i2JUhxWIx089wsyzT8oRD7q1MSanQZY8Tu8avfnPNojmgUJV84QcMRBb6W
	Llr71dZS7S1v0M0y3X5HTXqH5hAb8CsvTQnYLM/rtTMHQ2b/Xub/3TgYfv5s6dF07Uy4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUyJo-0004QH-3n
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kUyJo-0002lw-1P
	for xen-changelog@lists.xenproject.org; Tue, 20 Oct 2020 20:33:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Print message if reset did not work
Message-Id: <E1kUyJo-0002lw-1P@xenbits.xenproject.org>
Date: Tue, 20 Oct 2020 20:33:16 +0000

commit 3b49791e4cc2f38dd84bf331b75217adaef636e3
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Fri Oct 16 14:58:47 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Oct 20 13:20:31 2020 -0700

    xen/arm: Print message if reset did not work
    
    If for some reason the hardware reset is not working, print a message to
    the user every 5 seconds to warn him that the system did not reset
    properly and Xen is still looping.
    
    The message is printed infinitely so that someone connecting to a serial
    console with no history would see the message coming after 5 seconds.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [stefano: remove second '!']
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/arch/arm/shutdown.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index b32f07ec0e..3dc6819d56 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -36,6 +36,7 @@ void machine_halt(void)
 void machine_restart(unsigned int delay_millisecs)
 {
     int timeout = 10;
+    unsigned long count = 0;
 
     watchdog_disable();
     console_start_sync();
@@ -59,6 +60,9 @@ void machine_restart(unsigned int delay_millisecs)
     {
         platform_reset();
         mdelay(100);
+        if ( (count % 50) == 0 )
+            printk(XENLOG_ERR "Xen: Platform reset did not work properly!\n");
+        count++;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9964.26289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5E-0004PL-E0; Wed, 21 Oct 2020 10:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9964.26289; Wed, 21 Oct 2020 10:11:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5E-0004PD-B4; Wed, 21 Oct 2020 10:11:04 +0000
Received: by outflank-mailman (input) for mailman id 9964;
 Wed, 21 Oct 2020 10:11:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB5D-0004P8-7z
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5881e368-a8ff-4e80-861d-c03c814a0413;
 Wed, 21 Oct 2020 10:11:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5C-00028O-2G
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5C-0007YK-0W
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB5D-0004P8-7z
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:03 +0000
X-Inumbo-ID: 5881e368-a8ff-4e80-861d-c03c814a0413
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5881e368-a8ff-4e80-861d-c03c814a0413;
	Wed, 21 Oct 2020 10:11:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HkDDZ/WraxlTYGV12jqq9+CCpqV0qc2V/ae2kcXyw6g=; b=caS47TNeHZAxCKmS2CALMSjFub
	67zMmJgoRXQt1bGGGzpCXh1sSRy3Rid5x2Yk07NJNMzFIeGL9zrkMOhdDvI00L2xfFGTFPltktLKR
	SCRa5NL1PN0c35mOJNFN3uWe6NTXZenqLQcfXpkndlEflAjN+oiMyTsMDOw2XWvvTBQ0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5C-00028O-2G
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5C-0007YK-0W
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kVB5C-0007YK-0W@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:02 +0000

commit 07ad8ff3b84771257b36545af8192171eabbd8ac
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:19:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:19:23 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index fd734ff947..f6df0a41f1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5112,6 +5112,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5132,7 +5133,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5218,7 +5220,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5247,7 +5249,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5289,7 +5291,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5315,7 +5317,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5458,7 +5460,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long mfn,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9965.26293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5O-0004QR-Ff; Wed, 21 Oct 2020 10:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9965.26293; Wed, 21 Oct 2020 10:11:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5O-0004QJ-Ch; Wed, 21 Oct 2020 10:11:14 +0000
Received: by outflank-mailman (input) for mailman id 9965;
 Wed, 21 Oct 2020 10:11:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB5O-0004QD-1L
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f44e08bf-9355-4dad-bd32-c14f5c63e94b;
 Wed, 21 Oct 2020 10:11:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5M-00028R-H7
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5M-0007Z4-4k
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB5O-0004QD-1L
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:14 +0000
X-Inumbo-ID: f44e08bf-9355-4dad-bd32-c14f5c63e94b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f44e08bf-9355-4dad-bd32-c14f5c63e94b;
	Wed, 21 Oct 2020 10:11:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JPfd7pxQsidbm4ijE+nGzNTeEJzO+6no5szsNvLdTaY=; b=K00aEGszmDRkdc/DZ48NiFEHYe
	Hm2/er8a2WqVei3CqIxEvpxp7rU8R5e1/saqG6zATbPHS/bmhhieGdgOsSjiRdSTsVVV+EG3bQnQ+
	lqho7odenmxG3ufSmPKyg0KjJK1lDW7GwgN7ccA4XZZsItAoVQgGMvUIqbboqxrEQnAM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5M-00028R-H7
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5M-0007Z4-4k
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kVB5M-0007Z4-4k@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:12 +0000

commit c334b87cef3d923002705838d843ae604650d8c1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:19:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:19:48 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f6df0a41f1..e644685cab 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5491,6 +5491,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5532,7 +5533,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5587,7 +5589,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5716,7 +5719,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9966.26297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5Y-0004S7-HY; Wed, 21 Oct 2020 10:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9966.26297; Wed, 21 Oct 2020 10:11:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5Y-0004S0-EF; Wed, 21 Oct 2020 10:11:24 +0000
Received: by outflank-mailman (input) for mailman id 9966;
 Wed, 21 Oct 2020 10:11:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB5Y-0004Rs-0i
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c856cf48-a1fe-4b70-936f-c4b504acbc96;
 Wed, 21 Oct 2020 10:11:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5W-00028c-KU
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5W-0007Zv-JT
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB5Y-0004Rs-0i
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:24 +0000
X-Inumbo-ID: c856cf48-a1fe-4b70-936f-c4b504acbc96
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c856cf48-a1fe-4b70-936f-c4b504acbc96;
	Wed, 21 Oct 2020 10:11:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Pe+fGTfbRz0FP0uDk+AFkpAJYoJXkILICbmp+Tu3YI0=; b=FFHX9o8tQDDMWhW1zO66ZZceiF
	GQ/h1Igh9JCQtLtdvx0ljWM9HSj7oGlZJy84NU2RPBM3eO5tulQT2hS7nBKmmjuGvhYBKSnj9icJB
	ma12xEqRwCEnacGsbgiDc4IKDBZL6zWd+OgEhIHrqYeTH8Uf6BN6vrDeFwREGcYwvOBg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5W-00028c-KU
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5W-0007Zv-JT
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kVB5W-0007Zv-JT@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:22 +0000

commit 75a05daf1ddfc0057bd9eeedfd1d872bb47faeda
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:20:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:10 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e644685cab..faa7df30c1 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2132,6 +2132,50 @@ void page_unlock(struct page_info *page)
     } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 /*
  * PTE flags that a guest may change without re-validating the PTE.
  * All other bits affect translation, caching, or Xen's safety.
@@ -5102,6 +5146,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     unsigned long mfn,
@@ -5113,6 +5174,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5128,13 +5190,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5463,6 +5532,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5492,6 +5562,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5500,11 +5571,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5722,9 +5804,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9967.26300 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5i-0004Te-J8; Wed, 21 Oct 2020 10:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9967.26300; Wed, 21 Oct 2020 10:11:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5i-0004TW-G5; Wed, 21 Oct 2020 10:11:34 +0000
Received: by outflank-mailman (input) for mailman id 9967;
 Wed, 21 Oct 2020 10:11:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB5h-0004TK-IO
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8b1d80ce-e6cc-4de8-b0a7-0dc86d07b68e;
 Wed, 21 Oct 2020 10:11:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5g-00028j-P4
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5g-0007aj-Mc
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB5h-0004TK-IO
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:33 +0000
X-Inumbo-ID: 8b1d80ce-e6cc-4de8-b0a7-0dc86d07b68e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8b1d80ce-e6cc-4de8-b0a7-0dc86d07b68e;
	Wed, 21 Oct 2020 10:11:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gQRCjUkOi+5bndE0PfI1QwNGbzz8nOW7K6lTyyHrhfg=; b=X8sQ1NRMwdHqTONZ93sJF3y2Bm
	AEC4PUovD2jNizpkYa7zadmO82aZJurK4vyjCh9ixrB/zJoC8bA/ZMUkOBFTuVZYAr9F9EFLCdOnW
	WdsQ3Qr9WQPngsTTEetb66NUY94JpWMZIOxpNVjovLG72JHJj4J+4AnIOMEPzKsSIfjE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5g-00028j-P4
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5g-0007aj-Mc
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kVB5g-0007aj-Mc@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:32 +0000

commit 6f012ec24294993d59bac9b9caae7d3c4dae347d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:20:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:31 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 8aaecb4495..e177941925 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -284,7 +284,10 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+#ifdef CONFIG_HAS_PASSTHROUGH
+    bool *dont_flush_p, dont_flush;
     int rc;
+#endif
 
 #ifdef CONFIG_X86
     mfn = get_gfn_query(d, gmfn, &p2mt);
@@ -359,8 +362,22 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+#endif
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    *dont_flush_p = dont_flush;
+#endif
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9968.26305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5s-0004VM-ME; Wed, 21 Oct 2020 10:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9968.26305; Wed, 21 Oct 2020 10:11:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB5s-0004VE-Iv; Wed, 21 Oct 2020 10:11:44 +0000
Received: by outflank-mailman (input) for mailman id 9968;
 Wed, 21 Oct 2020 10:11:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB5s-0004V4-0d
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b99f3f6d-be9a-4ea8-88c3-977487827aad;
 Wed, 21 Oct 2020 10:11:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5q-00029c-Sc
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB5q-0007bP-Rj
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB5s-0004V4-0d
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:44 +0000
X-Inumbo-ID: b99f3f6d-be9a-4ea8-88c3-977487827aad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b99f3f6d-be9a-4ea8-88c3-977487827aad;
	Wed, 21 Oct 2020 10:11:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JNuaAWd9MuQmYrwcc2MnK6zY+JyNyjDtQmadVTmyjCk=; b=ZuL5JCZDXejInJhyCijyNiM64t
	q4suUi2lRbc82lwBoSIVt0rFrWlHvVwW7XG8NkoBlPLkAH1z1oZ7hX/xSNy3rCLhzMddpwdJY8FF4
	tZneG3fj70JITc5u1keC4TPWvIY4uJBcq+1QSXeY+m18kjXBK0odhzR9PKHVt3mtqpWY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5q-00029c-Sc
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB5q-0007bP-Rj
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kVB5q-0007bP-Rj@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:42 +0000

commit d73e9720545d6acb376bd7c2b1b1d7c92aec6e30
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:20:54 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:20:54 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 43 ++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 65 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index cbc0e7c739..7599a32127 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1225,7 +1225,7 @@ void share_xen_page_with_privileged_guests(
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1297,10 +1297,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index faa7df30c1..7090be7b4a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4633,7 +4633,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4723,9 +4723,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn, we took a ref of the gfn at the top */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn || space == XENMAPSPACE_gmfn_range )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index e177941925..08fc9252a3 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -768,11 +768,10 @@ static int xenmem_add_to_physmap(struct domain *d,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -788,7 +787,10 @@ static int xenmem_add_to_physmap(struct domain *d,
 
 #ifdef CONFIG_HAS_PASSTHROUGH
     if ( need_iommu(d) )
+    {
         this_cpu(iommu_dont_flush_iotlb) = 1;
+        extra.ppage = &pages[0];
+    }
 #endif
 
     while ( xatp->size > done )
@@ -801,8 +803,12 @@ static int xenmem_add_to_physmap(struct domain *d,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -813,6 +819,7 @@ static int xenmem_add_to_physmap(struct domain *d,
     if ( need_iommu(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -820,6 +827,15 @@ static int xenmem_add_to_physmap(struct domain *d,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, xatp->gpfn - done, done);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -835,6 +851,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
 {
     unsigned int done = 0;
     int rc;
+    union add_to_physmap_extra extra = {};
 
     if ( xatpb->size < start )
         return -EILSEQ;
@@ -849,6 +866,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_okay(xatpb->errs, xatpb->size) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > done )
     {
         xen_ulong_t idx;
@@ -866,8 +896,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
             goto out;
         }
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, 0, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index fdcb90841a..4c41e6a69f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -583,8 +583,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 /* Return 0 on success, or negative on error. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:11:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9969.26310 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB62-0004XH-OE; Wed, 21 Oct 2020 10:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9969.26310; Wed, 21 Oct 2020 10:11:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB62-0004X1-KW; Wed, 21 Oct 2020 10:11:54 +0000
Received: by outflank-mailman (input) for mailman id 9969;
 Wed, 21 Oct 2020 10:11:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB61-0004Wu-J6
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2e662500-9205-4650-931b-9544021ca00f;
 Wed, 21 Oct 2020 10:11:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB60-00029o-Vd
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB60-0007cD-Uo
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB61-0004Wu-J6
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:53 +0000
X-Inumbo-ID: 2e662500-9205-4650-931b-9544021ca00f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2e662500-9205-4650-931b-9544021ca00f;
	Wed, 21 Oct 2020 10:11:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vnvRs1+RiQcjVgO0mPJW6f3GW9jAVBIbH91EEalyoFA=; b=3MLtWjMsRDSSzvS9SJPOF0EdHB
	avMBsEJn+ugQsQes1gU3g3IN4+7gzR7KK58XZ8k4rx2eFUFZocGupGQDNG8vmmJcuvuCB9eHiGN5H
	sELULh+dmVc7Sq1ATW6hMMnjdqv9oP777qosnj4uirMCXckPVhv9L3MCdKVZkOmGCLF0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB60-00029o-Vd
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB60-0007cD-Uo
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:11:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kVB60-0007cD-Uo@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:11:52 +0000

commit 56f8da75e1d42047549da304afb20bd72d572c84
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:21:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:21:19 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 85ce9405cf..3c29788d9a 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static void clear_iommu_pte_present(unsigned long l1_mfn, unsigned long gfn)
 
     table = map_domain_page(_mfn(l1_mfn));
     pte = table + pfn_to_pde_idx(gfn, IOMMU_PAGING_MODE_LEVEL_1);
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 }
 
@@ -49,7 +49,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
                                     unsigned int next_level,
                                     bool_t iw, bool_t ir)
 {
-    uint64_t addr_lo, addr_hi, maddr_next;
+    uint64_t addr_lo, addr_hi, maddr_next, full;
     u32 entry;
     bool need_flush = false, old_present;
 
@@ -106,7 +106,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
@@ -118,7 +118,9 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return need_flush;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 10:12:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 10:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.9971.26312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB6C-0004Yl-PM; Wed, 21 Oct 2020 10:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 9971.26312; Wed, 21 Oct 2020 10:12:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVB6C-0004Yd-MC; Wed, 21 Oct 2020 10:12:04 +0000
Received: by outflank-mailman (input) for mailman id 9971;
 Wed, 21 Oct 2020 10:12:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVB6B-0004YV-My
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 94a7d95f-0b8e-4805-9298-9cb282bf3472;
 Wed, 21 Oct 2020 10:12:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB6B-0002AF-2K
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVB6B-0007d5-1R
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVB6B-0004YV-My
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
X-Inumbo-ID: 94a7d95f-0b8e-4805-9298-9cb282bf3472
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 94a7d95f-0b8e-4805-9298-9cb282bf3472;
	Wed, 21 Oct 2020 10:12:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pDi+u2fVkMYXqTKf6nRRyT8g3fXuV9P/oVxwill1948=; b=a3xeGpp3YyDdj/9QW+/I0EQTer
	yiEXXaPaS0urC8bAyIFIHNK492PuZPvyine9xwzNfQKmlb40q0+ZQ3121wTfu/axq+VeQYymUdkfk
	W1c6QFeT4EDuVRmu2gxLQJgrnJTxdp94wBsALWalTPVHsBJhklUeOPr3PBki3DKPSNvw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB6B-0002AF-2K
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVB6B-0007d5-1R
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 10:12:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kVB6B-0007d5-1R@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 10:12:03 +0000

commit 71da63bbb83af8c8c537f3731dda7dc2d2fd31ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:21:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:21:40 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 3c29788d9a..f0bc1dd3af 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -147,7 +147,22 @@ void amd_iommu_set_root_page_table(
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid)
 {
     u64 addr_hi, addr_lo;
-    u32 entry;
+    u32 entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -166,8 +181,9 @@ void amd_iommu_set_root_page_table(
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -180,7 +196,7 @@ void amd_iommu_set_root_page_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(u32 *dte, u8 i)
@@ -212,6 +228,7 @@ void __init amd_iommu_set_intremap_table(
                         IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                         IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32((u32)addr_lo >> 6, 0,
                         IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -229,7 +246,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10066.26512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDip-0004bH-8t; Wed, 21 Oct 2020 13:00:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10066.26512; Wed, 21 Oct 2020 13:00:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDip-0004b5-5T; Wed, 21 Oct 2020 13:00:07 +0000
Received: by outflank-mailman (input) for mailman id 10066;
 Wed, 21 Oct 2020 13:00:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDin-0004QE-CK
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 30f38318-c0d5-43e4-9068-6e9b60eebedd;
 Wed, 21 Oct 2020 13:00:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDil-0005gh-0L
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDik-0003Qj-VB
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDin-0004QE-CK
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:05 +0000
X-Inumbo-ID: 30f38318-c0d5-43e4-9068-6e9b60eebedd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 30f38318-c0d5-43e4-9068-6e9b60eebedd;
	Wed, 21 Oct 2020 13:00:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gsncLMZxd8zBP2OOB57Jx6iemfnsBCdUGsUI+iUsETQ=; b=Z6sTsDcmv18tPtdu9ePa13BDnH
	E/wKjykVDzLiyx6/BpO/lSk6L9hrOhZBpzquxuNRRe4PHjo6deRYuoxTATGinw+8hzUVHmp8y8Os/
	NnRb66DpnkCDBJe9kKyALEv4ZEcj28fOv9HZ9Rl8MwXccz++wxZ0H/ZpgFFj5Gdi6w1A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDil-0005gh-0L
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDik-0003Qj-VB
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kVDik-0003Qj-VB@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:02 +0000

commit ad7d04055ea50177bcfdc471ad3bb6e819ec60e0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:14:13 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:13 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 626768a950..79a3fac3cc 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5194,6 +5194,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5214,7 +5215,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5302,7 +5304,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5331,7 +5333,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5374,7 +5376,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5401,7 +5403,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5545,7 +5547,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10067.26516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDiy-0004fq-AK; Wed, 21 Oct 2020 13:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10067.26516; Wed, 21 Oct 2020 13:00:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDiy-0004ff-77; Wed, 21 Oct 2020 13:00:16 +0000
Received: by outflank-mailman (input) for mailman id 10067;
 Wed, 21 Oct 2020 13:00:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDiw-0004fV-IZ
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0b1fe4d7-e20c-4ee5-afe7-115426b5c596;
 Wed, 21 Oct 2020 13:00:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDiv-0005gm-3l
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDiv-0003Sb-2s
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDiw-0004fV-IZ
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:14 +0000
X-Inumbo-ID: 0b1fe4d7-e20c-4ee5-afe7-115426b5c596
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0b1fe4d7-e20c-4ee5-afe7-115426b5c596;
	Wed, 21 Oct 2020 13:00:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NBGAEYpFImcH4MS/4wl6nBWTspH3sbQ+dBNkV5QMtS8=; b=k1Orj3fzat4Ktfr1sFmmebnZAQ
	JPIUXgAxFPW3FFI5N/qaeHAzMyd3WpQ67oBus6vc15XzOom+jleK9v0xl2NASgmpEZggHie/SGFs3
	E2bzehSCpCNBDs+4NN07UX15YKU8HkLw81FIkgehDjuk5nTMLKqwCzH6jTOtbeyz9OqI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDiv-0005gm-3l
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDiv-0003Sb-2s
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kVDiv-0003Sb-2s@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:13 +0000

commit f5ec9f287d00af28b2939c0f628c25c31ebefd18
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:14:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:38 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 79a3fac3cc..8ed3ecacbe 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5577,6 +5577,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5618,7 +5619,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5673,7 +5675,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5802,7 +5805,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10068.26520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDj8-0004h6-Be; Wed, 21 Oct 2020 13:00:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10068.26520; Wed, 21 Oct 2020 13:00:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDj8-0004gy-8Z; Wed, 21 Oct 2020 13:00:26 +0000
Received: by outflank-mailman (input) for mailman id 10068;
 Wed, 21 Oct 2020 13:00:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDj6-0004gn-Q5
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a9f2fb5e-fbc8-4ca2-99d6-e2e58f27bdbf;
 Wed, 21 Oct 2020 13:00:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDj5-0005h0-84
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDj5-0003TT-6H
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDj6-0004gn-Q5
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:24 +0000
X-Inumbo-ID: a9f2fb5e-fbc8-4ca2-99d6-e2e58f27bdbf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a9f2fb5e-fbc8-4ca2-99d6-e2e58f27bdbf;
	Wed, 21 Oct 2020 13:00:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ajkzLCdjeeOkAZ581zo29Tq7cCu6zmOHheZV0DphXQQ=; b=QMPiJf3Sw+angX2TRNFP34FE5V
	i1Wie7OQquAlPdddznZR9xjtef72u10RWiUebpdVlzHO7ULlCtAqPfChW3kyKziMVDEV9alMGzX11
	tq5rpwn/gABv/YjjQ5yu60ddUWgKZ+1z6KeKlAd7jAGWM5nLNviIJYeVxI2gTNCbxbKw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDj5-0005h0-84
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDj5-0003TT-6H
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kVDj5-0003TT-6H@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:23 +0000

commit 7912bbe636ef5c9db61c193182c7937a820b7c2b
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:14:58 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:14:58 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8ed3ecacbe..4ff24de73d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2153,6 +2153,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 /*
  * PTE flags that a guest may change without re-validating the PTE.
  * All other bits affect translation, caching, or Xen's safety.
@@ -5184,6 +5228,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5195,6 +5256,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5210,13 +5272,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5550,6 +5619,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5578,6 +5648,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5586,11 +5657,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5808,9 +5890,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10069.26524 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjH-0004iD-D9; Wed, 21 Oct 2020 13:00:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10069.26524; Wed, 21 Oct 2020 13:00:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjH-0004i5-AA; Wed, 21 Oct 2020 13:00:35 +0000
Received: by outflank-mailman (input) for mailman id 10069;
 Wed, 21 Oct 2020 13:00:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDjG-0004hx-9P
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 93f31a8f-06ef-4e20-bef6-c7dd43798f74;
 Wed, 21 Oct 2020 13:00:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjF-0005hA-CD
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjF-0003US-AH
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDjG-0004hx-9P
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:34 +0000
X-Inumbo-ID: 93f31a8f-06ef-4e20-bef6-c7dd43798f74
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 93f31a8f-06ef-4e20-bef6-c7dd43798f74;
	Wed, 21 Oct 2020 13:00:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B+k9MOmK5oja+ed0NwqhK/I2Lov668vxfxO9cr5kDiI=; b=3/yOIrF4qZDPMBJyPd6UAqg2ju
	28H1E2r00ffRTUSOEC8MGioqmxZ8ODibTL0dy479J60XGtJBtUHCVFB1Y6+1XgmjYzkF4hsARqf7r
	5OS+SPwv+gtnOIUH5vN6/9Cs59eolM/1Lh8xeq0EqinLiX38rKaSPDXCosXRew/OVguk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjF-0005hA-CD
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjF-0003US-AH
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kVDjF-0003US-AH@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:33 +0000

commit 490c517168bc1cb72c43a02a1ff48bbc25934ffa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:15:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:15:16 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 312a8ec91c..0ae60378f4 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -298,7 +298,10 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+#ifdef CONFIG_HAS_PASSTHROUGH
+    bool *dont_flush_p, dont_flush;
     int rc;
+#endif
 
 #ifdef CONFIG_X86
     mfn = get_gfn_query(d, gmfn, &p2mt);
@@ -376,8 +379,22 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+#endif
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+#ifdef CONFIG_HAS_PASSTHROUGH
+    *dont_flush_p = dont_flush;
+#endif
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10070.26530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjS-0004ju-Gn; Wed, 21 Oct 2020 13:00:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10070.26530; Wed, 21 Oct 2020 13:00:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjS-0004je-Bq; Wed, 21 Oct 2020 13:00:46 +0000
Received: by outflank-mailman (input) for mailman id 10070;
 Wed, 21 Oct 2020 13:00:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDjQ-0004jS-Ti
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6c839d6b-3e92-471f-b33a-e003afbae976;
 Wed, 21 Oct 2020 13:00:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjP-0005hk-PW
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjP-0003VS-Eu
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDjQ-0004jS-Ti
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:44 +0000
X-Inumbo-ID: 6c839d6b-3e92-471f-b33a-e003afbae976
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6c839d6b-3e92-471f-b33a-e003afbae976;
	Wed, 21 Oct 2020 13:00:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DvccHNNTMdRJt9rpXQcYHmJNJKlxlbgunHRDQlfwXlw=; b=1HDjJNnStGdM+gQno+JKNEWyAs
	pyuNR/Lk6hMDBNZLYT2B76b8r5ptujR8RGeVrkBTjydhvvFRrbF9ntav//Lib4Wxxa3l4MSY1yNpu
	dbrZK3pMhiht+WJKfgKXuZecyX6JZQ7DHb4su3raNFab8Qt3nQXnIlySaB6vlS+ORKa4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjP-0005hk-PW
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjP-0003VS-Eu
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kVDjP-0003VS-Eu@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:43 +0000

commit 4f35f7fa29a0f87dcfdbd3f1a43dbd08b072ac4e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:16:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:16:22 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6450850457..99201ac615 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1222,7 +1222,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1294,10 +1294,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4ff24de73d..5ca5c8c9a2 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4678,7 +4678,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4765,9 +4765,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 0ae60378f4..a4cf496f24 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -811,11 +811,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -831,7 +830,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
 #ifdef CONFIG_HAS_PASSTHROUGH
     if ( need_iommu(d) )
+    {
         this_cpu(iommu_dont_flush_iotlb) = 1;
+        extra.ppage = &pages[0];
+    }
 #endif
 
     while ( xatp->size > done )
@@ -844,8 +846,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -856,6 +862,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( need_iommu(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -863,6 +870,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, xatp->gpfn - done, done);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -876,6 +892,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( xatpb->size < extent )
         return -EILSEQ;
 
@@ -884,6 +902,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -896,8 +927,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 24654e8e22..38002714de 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -577,8 +577,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:00:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:00:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10071.26532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjc-0004lq-Hf; Wed, 21 Oct 2020 13:00:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10071.26532; Wed, 21 Oct 2020 13:00:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjc-0004li-Em; Wed, 21 Oct 2020 13:00:56 +0000
Received: by outflank-mailman (input) for mailman id 10071;
 Wed, 21 Oct 2020 13:00:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDja-0004lZ-Pq
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fd875f55-74e1-4c8d-958d-eed83f6c51de;
 Wed, 21 Oct 2020 13:00:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjZ-0005hr-TX
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjZ-0003WI-Rq
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDja-0004lZ-Pq
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:54 +0000
X-Inumbo-ID: fd875f55-74e1-4c8d-958d-eed83f6c51de
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fd875f55-74e1-4c8d-958d-eed83f6c51de;
	Wed, 21 Oct 2020 13:00:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m7R3JfqjlORQg72RPVU1GB5Em0Ayq7vIf53p3EQelyk=; b=C8Sobygmrh1AET8tPqmry9g8rR
	DD8bVjwI/Gmsd7+vE36PE07J4NoZkN4noAwlvRvJ7jZWPU6802u7rvYaOBk/UGRA72rrLBnFkE9rf
	ZUBMVIOVyp66eXXanmWu/gAh5tvqMCxxOpiOKvAyuH1JAmYCPucdmsO3mq0V6BFbvKPM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjZ-0005hr-TX
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjZ-0003WI-Rq
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:00:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kVDjZ-0003WI-Rq@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:00:53 +0000

commit 7739ffda81784853ca6b0156331f5d1923303fa7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:16:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:16:49 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index aa382dbabd..56b4337e5b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static void clear_iommu_pte_present(unsigned long l1_mfn, unsigned long gfn)
 
     table = map_domain_page(_mfn(l1_mfn));
     pte = table + pfn_to_pde_idx(gfn, IOMMU_PAGING_MODE_LEVEL_1);
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 }
 
@@ -49,7 +49,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
                                     unsigned int next_level,
                                     bool_t iw, bool_t ir)
 {
-    uint64_t addr_lo, addr_hi, maddr_next;
+    uint64_t addr_lo, addr_hi, maddr_next, full;
     u32 entry;
     bool need_flush = false, old_present;
 
@@ -106,7 +106,7 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     if ( next_level == IOMMU_PAGING_MODE_LEVEL_0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
@@ -118,7 +118,9 @@ static bool_t set_iommu_pde_present(u32 *pde, unsigned long next_mfn,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return need_flush;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 13:01:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 13:01:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10072.26536 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjn-0004nH-JS; Wed, 21 Oct 2020 13:01:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10072.26536; Wed, 21 Oct 2020 13:01:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVDjn-0004n9-GJ; Wed, 21 Oct 2020 13:01:07 +0000
Received: by outflank-mailman (input) for mailman id 10072;
 Wed, 21 Oct 2020 13:01:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVDjm-0004n0-BL
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b9a869cb-6793-4cae-94ff-e646fc15c1d3;
 Wed, 21 Oct 2020 13:01:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjk-0005iG-0E
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVDjj-0003XZ-Vl
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVDjm-0004n0-BL
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:06 +0000
X-Inumbo-ID: b9a869cb-6793-4cae-94ff-e646fc15c1d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b9a869cb-6793-4cae-94ff-e646fc15c1d3;
	Wed, 21 Oct 2020 13:01:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+99v++Lgnd09QmP95Ar7c79lKxe/UWqN6NVikOT/xEs=; b=K1AIhvwjck7oMp50l8OX6GxgWK
	ammxvW4Ylj7m8zoxbGEj9e+QPFGRXKjJyPl7kZQ/Vy8RpPtOLYWPQHwHxRblFWhEpKn/hUUme7nEU
	lvjFJ8cqqKLqQlI9Q/pPooSFGgWu9lrUfI2eSz5HgMUEODlXktv/078CKCJmSezs18/c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjk-0005iG-0E
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVDjj-0003XZ-Vl
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 13:01:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kVDjj-0003XZ-Vl@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 13:01:03 +0000

commit 63199dfd3a0418f1677c6ccd7fe05b123af4610a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:17:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:17:11 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 56b4337e5b..24d027e7d1 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -147,7 +147,22 @@ void amd_iommu_set_root_page_table(
     u32 *dte, u64 root_ptr, u16 domain_id, u8 paging_mode, u8 valid)
 {
     u64 addr_hi, addr_lo;
-    u32 entry;
+    u32 entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -166,8 +181,9 @@ void amd_iommu_set_root_page_table(
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32((u32)addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -180,7 +196,7 @@ void amd_iommu_set_root_page_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(u32 *dte, u8 i)
@@ -212,6 +228,7 @@ void __init amd_iommu_set_intremap_table(
                         IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                         IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32((u32)addr_lo >> 6, 0,
                         IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -229,7 +246,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10119.26732 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOD-0002V1-Vr; Wed, 21 Oct 2020 16:55:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10119.26732; Wed, 21 Oct 2020 16:55:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOD-0002Ut-T4; Wed, 21 Oct 2020 16:55:05 +0000
Received: by outflank-mailman (input) for mailman id 10119;
 Wed, 21 Oct 2020 16:55:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHOC-0002Un-KI
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f91da0c2-2781-4892-898d-d7c30b8f362b;
 Wed, 21 Oct 2020 16:55:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOA-0002cD-RR
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOA-0001KY-Pz
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHOC-0002Un-KI
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:04 +0000
X-Inumbo-ID: f91da0c2-2781-4892-898d-d7c30b8f362b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f91da0c2-2781-4892-898d-d7c30b8f362b;
	Wed, 21 Oct 2020 16:55:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=avVzP9tedfivF/NxXMlJLg3PwsoyANasWfe0TmH+i2o=; b=PcT4wcigq2VLi4pxs8Ujl69VvS
	JbsLRJKdJocJE94NeUbtKDX/S5/L2zYD1QwztnVsNBz0eMvWyhToIgga9J1ZOYWTNP4Vz8whUuds4
	56RFIdGltOmYqI5yigqX9QFSlfcmAWWMF2hph2AG1FeGvV7nGxmOvuIfOutoNR10KLlQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOA-0002cD-RR
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOA-0001KY-Pz
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kVHOA-0001KY-Pz@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:02 +0000

commit 03926de91c2e92ded7cfea227aee17486d745225
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:01:19 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:19 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b4c90bd054..0e540f143b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5227,6 +5227,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5247,7 +5248,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5335,7 +5337,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5364,7 +5366,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5407,7 +5409,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5434,7 +5436,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5578,7 +5580,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10121.26735 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOO-0002WA-19; Wed, 21 Oct 2020 16:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10121.26735; Wed, 21 Oct 2020 16:55:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHON-0002W2-UZ; Wed, 21 Oct 2020 16:55:15 +0000
Received: by outflank-mailman (input) for mailman id 10121;
 Wed, 21 Oct 2020 16:55:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHOM-0002Vu-T0
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cebb8857-6bca-4a07-8a2d-575e1f4933f1;
 Wed, 21 Oct 2020 16:55:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOL-0002cP-Vh
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOK-0001Lg-Tx
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHOM-0002Vu-T0
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:14 +0000
X-Inumbo-ID: cebb8857-6bca-4a07-8a2d-575e1f4933f1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cebb8857-6bca-4a07-8a2d-575e1f4933f1;
	Wed, 21 Oct 2020 16:55:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kk+V7tbtn0Ly093M0ldqQ7sbcxeUqR4q/W4uV0Xrk/4=; b=dpLHAcqYPWmJjS/HwAp5Ja8zGQ
	hXPiglCF+my7xmAqf296EpQs5UaN0JZZpCv3cM0Rry0t32tT7zq892SnyVW/p/Ubr3k50ETYqd8Uf
	tM/PNYXXH4n/ecBeVfXB5W2ZtoZNWSyeM3lFHNFTluYMGO7yKJMzrmKTjai03Aqho6/4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOL-0002cP-Vh
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOK-0001Lg-Tx
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kVHOK-0001Lg-Tx@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:12 +0000

commit 1cec2531fbb221abf533187153ca0676155f34d5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 15:01:38 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:38 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0e540f143b..bff2689e60 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5610,6 +5610,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5651,7 +5652,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5706,7 +5708,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5835,7 +5838,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10122.26740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOY-0002Xk-38; Wed, 21 Oct 2020 16:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10122.26740; Wed, 21 Oct 2020 16:55:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOX-0002Xa-WB; Wed, 21 Oct 2020 16:55:25 +0000
Received: by outflank-mailman (input) for mailman id 10122;
 Wed, 21 Oct 2020 16:55:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHOX-0002XP-7N
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d1a77208-d549-4bca-85dc-96c025fccd51;
 Wed, 21 Oct 2020 16:55:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOW-0002cc-2l
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOW-0001MW-1s
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHOX-0002XP-7N
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:25 +0000
X-Inumbo-ID: d1a77208-d549-4bca-85dc-96c025fccd51
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d1a77208-d549-4bca-85dc-96c025fccd51;
	Wed, 21 Oct 2020 16:55:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dxHNc71UQUM/3QYUoMOhyZvXCrA6O/JXUhuvOhfhQs0=; b=3FQP8Wqz/F4ZCWiFKBi34bfwzl
	Nno+h6/xI9kRxu4BQJKT8WU1levDCHFTNGjeLyCY5/YC14/zGn8NydlRZx6z2BfDHlmJDv+2oCmFH
	fHSz51rCGjcF+EG27aqeooZpTXi9rDwxsuadILqTyBRo0/JrdKfkQcFcNwfkf8gh+fPA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOW-0002cc-2l
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOW-0001MW-1s
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kVHOW-0001MW-1s@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:24 +0000

commit e461318da32774df4d6b7c1337a70d731833f00b
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 15:01:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:01:56 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bff2689e60..d6ba8c4bb4 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2197,6 +2197,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5217,6 +5261,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5228,6 +5289,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5243,13 +5305,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5583,6 +5652,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5611,6 +5681,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5619,11 +5690,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5841,9 +5923,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10123.26743 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOi-0002Z8-5q; Wed, 21 Oct 2020 16:55:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10123.26743; Wed, 21 Oct 2020 16:55:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOi-0002Z0-2m; Wed, 21 Oct 2020 16:55:36 +0000
Received: by outflank-mailman (input) for mailman id 10123;
 Wed, 21 Oct 2020 16:55:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHOh-0002Ys-2x
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 41ea6a33-6a2b-4d37-b123-d0a21425780c;
 Wed, 21 Oct 2020 16:55:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOg-0002cp-6v
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOg-0001Ne-5A
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHOh-0002Ys-2x
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:35 +0000
X-Inumbo-ID: 41ea6a33-6a2b-4d37-b123-d0a21425780c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 41ea6a33-6a2b-4d37-b123-d0a21425780c;
	Wed, 21 Oct 2020 16:55:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cbYmZH483tJUvTPZRdy0GTjKoqtLuoB0686faNnXwPg=; b=lvULh8Fe4vqijFIowgIx+cFkpW
	u/kLFXvnqhpTTU9LyMaFjICEjQBcVRzb7zuMiPclmqSK4UdAKhii4NMmhUqJfTOMAqndLWyeBZlD6
	ptA6UwuuvSTh8nxDRdG3nq+AG7k+dNKxCIns9NeVV8R+dcldjhdm24T4uFDlbKpwUpO4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOg-0002cp-6v
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOg-0001Ne-5A
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kVHOg-0001Ne-5A@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:34 +0000

commit 37f45de9083eea558437c6175884d31642671d7d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:02:14 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:02:14 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index ff88ebb314..212b293bd8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -300,6 +300,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -386,8 +387,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10124.26748 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOt-0002al-7f; Wed, 21 Oct 2020 16:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10124.26748; Wed, 21 Oct 2020 16:55:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHOt-0002ad-4U; Wed, 21 Oct 2020 16:55:47 +0000
Received: by outflank-mailman (input) for mailman id 10124;
 Wed, 21 Oct 2020 16:55:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHOr-0002aR-N2
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7cf0d70a-a49c-463c-a532-29251da44b84;
 Wed, 21 Oct 2020 16:55:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOq-0002d0-AQ
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHOq-0001OL-9Y
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHOr-0002aR-N2
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:45 +0000
X-Inumbo-ID: 7cf0d70a-a49c-463c-a532-29251da44b84
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7cf0d70a-a49c-463c-a532-29251da44b84;
	Wed, 21 Oct 2020 16:55:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=saDVpcYhZ7FX/kG/UHeKJY3MX4JUFE0OaaVfFEzmxNk=; b=OuSXenyNgbDahF38TYKLImAD39
	uKD7nDWubQqAckQhbA2OE0ANrs6r4r7lleI/q7eJf9F1o/mBnRSSccFzCUgue6bUoDQy343/0Rgbi
	jnCM1L3iUlGVHgXMkRE6/CH51kZGTQeavDOAchfV2eU0CyjSIRk1VOZLwpe+zvA5SiOw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOq-0002d0-AQ
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHOq-0001OL-9Y
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kVHOq-0001OL-9Y@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:44 +0000

commit b402e2a14bdc70b5e40a597c0bf14af0ab6354b5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:02:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:02:36 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ffe940fbed..de6009e54b 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1211,7 +1211,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1284,10 +1284,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d6ba8c4bb4..e7b8f4ee4b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4704,7 +4704,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4791,9 +4791,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 212b293bd8..b352a30af6 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -824,11 +824,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -843,7 +842,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( has_iommu_pt(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -855,8 +857,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -866,6 +872,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( has_iommu_pt(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -874,6 +881,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -887,6 +903,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( xatpb->size < extent )
         return -EILSEQ;
 
@@ -895,6 +913,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -907,8 +938,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index e971147234..d60f17db7a 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -583,8 +583,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:55:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:55:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10125.26753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHP2-0002cN-9c; Wed, 21 Oct 2020 16:55:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10125.26753; Wed, 21 Oct 2020 16:55:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHP2-0002cE-66; Wed, 21 Oct 2020 16:55:56 +0000
Received: by outflank-mailman (input) for mailman id 10125;
 Wed, 21 Oct 2020 16:55:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHP1-0002bg-BR
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a5bfcd75-ef4e-40c4-8ec2-a7029eea9c83;
 Wed, 21 Oct 2020 16:55:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHP0-0002do-DP
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHP0-0001PP-Ce
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHP1-0002bg-BR
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:55 +0000
X-Inumbo-ID: a5bfcd75-ef4e-40c4-8ec2-a7029eea9c83
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a5bfcd75-ef4e-40c4-8ec2-a7029eea9c83;
	Wed, 21 Oct 2020 16:55:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=amJUgv+dzSh3D81hlsjmBPdMW9zidG5nhUevb6LgdBE=; b=u9gzHc/5BsSxg/7cbhVH0jFcO3
	o8xUBHBfqk0gjqEmwE34N+4BU5Pi/Yvy9+VJGd2gagf3r1nChiyp4KWOiV9ZtdUO1/xM8WqaGNx8z
	4E9jYWqrSQhdFj8bgmlzIHD23TZQzNpZI/HSGQg9/dQ5NPkrW9spydTKvkoELQEmUl6U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHP0-0002do-DP
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHP0-0001PP-Ce
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:55:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kVHP0-0001PP-Ce@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:55:54 +0000

commit 97f9defe9610adc44dd65a2e21d788e053641183
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:03:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:03:04 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE word by word allows the IOMMU to see a partially
    updated entry. Construct the new entry fully in a local variable and
    then write the new entry by a single insn.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 8f0ec3dc8e..98993aa0ce 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -49,7 +49,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                          IOMMU_PTE_PRESENT_SHIFT) ?
                                          IOMMU_FLUSHF_modified : 0;
 
-    *pte = 0;
+    write_atomic(pte, 0);
     unmap_domain_page(table);
 
     return flush_flags;
@@ -60,7 +60,7 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
-    uint64_t maddr_next;
+    uint64_t maddr_next, full;
     uint32_t addr_lo, addr_hi, entry;
     bool old_present;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
@@ -119,7 +119,7 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
     if ( next_level == 0 )
         set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                              IOMMU_PTE_FC_MASK, IOMMU_PTE_FC_SHIFT, &entry);
-    pde[1] = entry;
+    full = (uint64_t)entry << 32;
 
     /* mark next level as 'present' */
     set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, 0,
@@ -131,7 +131,9 @@ static unsigned int set_iommu_pde_present(uint32_t *pde,
     set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
                          IOMMU_PDE_PRESENT_MASK,
                          IOMMU_PDE_PRESENT_SHIFT, &entry);
-    pde[0] = entry;
+    full |= entry;
+
+    write_atomic((uint64_t *)pde, full);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10126.26756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPC-0002di-Ak; Wed, 21 Oct 2020 16:56:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10126.26756; Wed, 21 Oct 2020 16:56:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPC-0002da-7i; Wed, 21 Oct 2020 16:56:06 +0000
Received: by outflank-mailman (input) for mailman id 10126;
 Wed, 21 Oct 2020 16:56:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHPB-0002dT-EI
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2441ec1e-2ccf-4539-9226-a38f2230cd6e;
 Wed, 21 Oct 2020 16:56:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPA-0002e9-Gb
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPA-0001Qo-Fe
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHPB-0002dT-EI
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:05 +0000
X-Inumbo-ID: 2441ec1e-2ccf-4539-9226-a38f2230cd6e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2441ec1e-2ccf-4539-9226-a38f2230cd6e;
	Wed, 21 Oct 2020 16:56:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Hczq0xfBHgGtkRaq1hl5AowvmhRcD0SzjSGCe66T8ic=; b=2Nk3bW1KrWNfEuyeHVBx8+YBLC
	Y/CO9cdIQ1/Aaxzbkj+KVhcPrC0PmDrOzQw857RwEeQVWuhse6EDEzJ/rR3j84qnsCWa/SumEPEu5
	YIQJbjHiI+BpK2SurrxCWZ5udn1vW30ALI32CxN+TqFj8tVq7VY9bkC8GYtCnJmptaR0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPA-0002e9-Gb
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPA-0001Qo-Fe
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kVHPA-0001Qo-Fe@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:04 +0000

commit 14b0a080c19949a6af6e9c5af295427e98a2974b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:03:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:03:24 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 98993aa0ce..da7ca7a41e 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -162,7 +162,22 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                                    uint16_t domain_id, uint8_t paging_mode,
                                    uint8_t valid)
 {
-    uint32_t addr_hi, addr_lo, entry;
+    uint32_t addr_hi, addr_lo, entry, dte0 = dte[0];
+
+    if ( valid ||
+         get_field_from_reg_u32(dte0, IOMMU_DEV_TABLE_VALID_MASK,
+                                IOMMU_DEV_TABLE_VALID_SHIFT) )
+    {
+        set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, dte0,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_MASK,
+                             IOMMU_DEV_TABLE_TRANSLATION_VALID_SHIFT, &dte0);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, dte0,
+                             IOMMU_DEV_TABLE_VALID_MASK,
+                             IOMMU_DEV_TABLE_VALID_SHIFT, &dte0);
+        dte[0] = dte0;
+        smp_wmb();
+    }
+
     set_field_in_reg_u32(domain_id, 0,
                          IOMMU_DEV_TABLE_DOMAIN_ID_MASK,
                          IOMMU_DEV_TABLE_DOMAIN_ID_SHIFT, &entry);
@@ -181,8 +196,9 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_MASK,
                          IOMMU_DEV_TABLE_IO_READ_PERMISSION_SHIFT, &entry);
     dte[1] = entry;
+    smp_wmb();
 
-    set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, 0,
+    set_field_in_reg_u32(addr_lo >> PAGE_SHIFT, dte0,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK,
                          IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT, &entry);
     set_field_in_reg_u32(paging_mode, entry,
@@ -195,7 +211,7 @@ void amd_iommu_set_root_page_table(uint32_t *dte, uint64_t root_ptr,
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_VALID_MASK,
                          IOMMU_DEV_TABLE_VALID_SHIFT, &entry);
-    dte[0] = entry;
+    write_atomic(&dte[0], entry);
 }
 
 void iommu_dte_set_iotlb(uint32_t *dte, uint8_t i)
@@ -226,6 +242,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_DEV_TABLE_INT_CONTROL_MASK,
                          IOMMU_DEV_TABLE_INT_CONTROL_SHIFT, &entry);
     dte[5] = entry;
+    smp_wmb();
 
     set_field_in_reg_u32(addr_lo >> 6, 0,
                          IOMMU_DEV_TABLE_INT_TABLE_PTR_LOW_MASK,
@@ -243,7 +260,7 @@ void __init amd_iommu_set_intremap_table(
                          IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_DEV_TABLE_INT_VALID_MASK,
                          IOMMU_DEV_TABLE_INT_VALID_SHIFT, &entry);
-    dte[4] = entry;
+    write_atomic(&dte[4], entry);
 }
 
 void __init iommu_dte_add_device_entry(uint32_t *dte,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10127.26760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPM-0002f2-D9; Wed, 21 Oct 2020 16:56:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10127.26760; Wed, 21 Oct 2020 16:56:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPM-0002eu-9J; Wed, 21 Oct 2020 16:56:16 +0000
Received: by outflank-mailman (input) for mailman id 10127;
 Wed, 21 Oct 2020 16:56:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHPL-0002ek-HL
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ab91ef31-a2f1-45f5-963a-4fa3ce9b337f;
 Wed, 21 Oct 2020 16:56:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPK-0002eH-Jb
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPK-0001S2-Iv
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHPL-0002ek-HL
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:15 +0000
X-Inumbo-ID: ab91ef31-a2f1-45f5-963a-4fa3ce9b337f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ab91ef31-a2f1-45f5-963a-4fa3ce9b337f;
	Wed, 21 Oct 2020 16:56:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=og+KVCLdgHWi4QoWyn+g0hweXzorO9WFczRccOnSNSY=; b=mqWwX84K9TQlt0l0B685nI/X7V
	nicdzptfFxMb38udv/3laV9yTeaiZhMsTNA6tbnL7M7CUd8bJO66bFMuFGPRE5WWH673ld48rkLyO
	yFiTE7SGGM8JQ+jAAxukgo2Je4EfmBv/Kx8gUrCNbOum/NCWYv1GjUmRq8hN+JOf/xtY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPK-0002eH-Jb
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPK-0001S2-Iv
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kVHPK-0001S2-Iv@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:14 +0000

commit 1833c60701cb6577e260c636e9ce47b70043d2e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 15:04:00 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:04:00 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 16c5a46e75..538bf39751 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -122,7 +122,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 65229a1a68..bb6577513a 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -185,7 +185,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -205,7 +205,7 @@ restore_all_guest:
         ALIGN
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10128.26764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPY-0002gY-GH; Wed, 21 Oct 2020 16:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10128.26764; Wed, 21 Oct 2020 16:56:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPY-0002gP-DM; Wed, 21 Oct 2020 16:56:28 +0000
Received: by outflank-mailman (input) for mailman id 10128;
 Wed, 21 Oct 2020 16:56:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHPW-0002gG-M1
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 098d7ad6-ecfc-4853-86d9-f3dcafdcda22;
 Wed, 21 Oct 2020 16:56:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPV-0002eU-Sj
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPU-0001T4-Lo
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHPW-0002gG-M1
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:26 +0000
X-Inumbo-ID: 098d7ad6-ecfc-4853-86d9-f3dcafdcda22
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 098d7ad6-ecfc-4853-86d9-f3dcafdcda22;
	Wed, 21 Oct 2020 16:56:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=imrSw0n08sd42fmX6K7FY7wvtsDpI6PT3IG/W9CtijY=; b=11bBVRZULNnz6U2U/xekvff/CA
	CxkBG+hFcQtnxl5+ElNH5MIW0MOqVpR7pfPAzZyj0MAIli2uMU23V2sSC9HcT1zApV8YN8sQ7w6Rh
	Z4Ir65EKaXjpGh40m+8sZzjs+tyN2g8pZ9/U0Mhrh0vJYu5A7vcyNRyYDdF947cQ2u+0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPV-0002eU-Sj
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPU-0001T4-Lo
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kVHPU-0001T4-Lo@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:24 +0000

commit 68ff540de173b3747cdb115dbf5030e645ceabcc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 15:04:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:04:32 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index bb6577513a..4f8b58af56 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -299,7 +299,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10129.26768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPi-0002hx-II; Wed, 21 Oct 2020 16:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10129.26768; Wed, 21 Oct 2020 16:56:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPi-0002hn-F0; Wed, 21 Oct 2020 16:56:38 +0000
Received: by outflank-mailman (input) for mailman id 10129;
 Wed, 21 Oct 2020 16:56:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHPg-0002hX-Op
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3744c16d-7be1-4535-b19e-9136bbdeb136;
 Wed, 21 Oct 2020 16:56:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPg-0002ec-01
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPf-0001U1-Uz
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHPg-0002hX-Op
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:36 +0000
X-Inumbo-ID: 3744c16d-7be1-4535-b19e-9136bbdeb136
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3744c16d-7be1-4535-b19e-9136bbdeb136;
	Wed, 21 Oct 2020 16:56:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JeTUarZjVv5QdgjX2ITPCt059ux8Vft1HuBH56ycUFo=; b=2aVt15J7uZDI3uaZJwDAEFj7Px
	bVvUDAS57MooDV/KEJUQ11euXuXTP+R9Eruct7jFQ6sPNZiIZ51PcBF8SxYsQyR1FoArEF0OHYHeC
	rKlXE99ORBY58r7Td6qjDFocVYd0hOYIy8EjJ3s5IeE672dnsGFB8S2fDWpRUlbbkYPE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPg-0002ec-01
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPf-0001U1-Uz
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kVHPf-0001U1-Uz@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:35 +0000

commit a9382052b8407ebbaba156da340fdf5511f2fb7c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:02 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10130.26772 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPs-0002jD-JZ; Wed, 21 Oct 2020 16:56:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10130.26772; Wed, 21 Oct 2020 16:56:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHPs-0002j5-GX; Wed, 21 Oct 2020 16:56:48 +0000
Received: by outflank-mailman (input) for mailman id 10130;
 Wed, 21 Oct 2020 16:56:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHPr-0002iv-Hv
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 37a0d715-ccb8-401f-a48c-b2ea7691b9a9;
 Wed, 21 Oct 2020 16:56:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPq-0002en-32
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHPq-0001Us-2N
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHPr-0002iv-Hv
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:47 +0000
X-Inumbo-ID: 37a0d715-ccb8-401f-a48c-b2ea7691b9a9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 37a0d715-ccb8-401f-a48c-b2ea7691b9a9;
	Wed, 21 Oct 2020 16:56:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cODoMwU2ay5GBu3JRT8atMjhU/JAhog0mxNBBdYIE38=; b=VDTBPkSLswjd2JhDYpJJ50mhbm
	Pmyv530ii3i815FzCT4IGjaW3wn7yk+FP3+YSXIt7/nqFMOouZ1uP0pXU8uZAutZtstpM1Fb2WX33
	YOEZGUTXl1KkCka0sV3U6M+CMYPCmRbv7gs4IS4A4ULgvmkQdvGM91g914hX2Ffpfj00=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPq-0002en-32
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHPq-0001Us-2N
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kVHPq-0001Us-2N@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:46 +0000

commit 7488b405b4b35540d99e938975fb8f10079b652b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:29 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index f12fe976cd..393255d555 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1608,6 +1608,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:56:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10131.26776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQ2-0002l8-LS; Wed, 21 Oct 2020 16:56:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10131.26776; Wed, 21 Oct 2020 16:56:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQ2-0002l0-IG; Wed, 21 Oct 2020 16:56:58 +0000
Received: by outflank-mailman (input) for mailman id 10131;
 Wed, 21 Oct 2020 16:56:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHQ1-0002ko-4O
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a21c707f-03b5-4e11-a80d-58ef1e7828f2;
 Wed, 21 Oct 2020 16:56:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQ0-0002fM-65
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQ0-0001Vo-5L
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHQ1-0002ko-4O
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:57 +0000
X-Inumbo-ID: a21c707f-03b5-4e11-a80d-58ef1e7828f2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a21c707f-03b5-4e11-a80d-58ef1e7828f2;
	Wed, 21 Oct 2020 16:56:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6pop9EJANjz/naXZ2dNvpaQciCF6v/AwF0PH2LW5f5M=; b=6Fs95qEopWNum6ee3w9zKgO5Vs
	UXrtGFABpnFCPv5GC8cx8RdLxqhjIHMP35PLeo8Nwu25KSfTV9izozH0u2370i6ePSNag6fQFLuzj
	Ex/hZPwD2hJeUvIW/4zU962uEaKMdb+EiFHRPS1WLNwAgECmYlHNOihuy0v4Lvy+0aX8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQ0-0002fM-65
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQ0-0001Vo-5L
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:56:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kVHQ0-0001Vo-5L@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:56:56 +0000

commit f49fff9072dff199a4e76ed27a3bd0b384b55e37
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 15:05:57 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:05:57 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 019dc57459..d5ebfbb83a 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -359,6 +359,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -384,9 +387,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:57:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10132.26780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQC-0002mI-Me; Wed, 21 Oct 2020 16:57:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10132.26780; Wed, 21 Oct 2020 16:57:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQC-0002mA-Jl; Wed, 21 Oct 2020 16:57:08 +0000
Received: by outflank-mailman (input) for mailman id 10132;
 Wed, 21 Oct 2020 16:57:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHQB-0002m1-KE
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a835bc23-ef96-41c6-826c-76af18b52be3;
 Wed, 21 Oct 2020 16:57:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQA-0002fh-9E
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQA-0001Wi-8J
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHQB-0002m1-KE
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:07 +0000
X-Inumbo-ID: a835bc23-ef96-41c6-826c-76af18b52be3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a835bc23-ef96-41c6-826c-76af18b52be3;
	Wed, 21 Oct 2020 16:57:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MMEnboBCKjou8vRV1ZhBeCEqig85QPR7rLs2vgoPDcg=; b=QO0AMjTqxfehT12Ae8w0+MaJkT
	SQdNsJQzS0pqJetY/7ViPSY2mQlJ2stEky1RWmhFTvdJ7lacgSbkYcVd/hTjBfuiBoPY8R7kzN5t0
	50DRV4U56mpJ2lYjj0fR7SwYI/oVmEZjS3sEBd7ZvdB0PHb+zQD7ZuAq5zeIiTSIkFqM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQA-0002fh-9E
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQA-0001Wi-8J
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kVHQA-0001Wi-8J@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:57:06 +0000

commit 5d49509a662be575602c4cf4ae564d2f9d4991fe
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 15:06:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:06:24 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index bf058777fd..856901f1ae 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -553,6 +553,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -900,6 +922,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -954,6 +981,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Wed Oct 21 16:57:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Oct 2020 16:57:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10133.26784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQM-0002ng-O9; Wed, 21 Oct 2020 16:57:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10133.26784; Wed, 21 Oct 2020 16:57:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVHQM-0002nY-LD; Wed, 21 Oct 2020 16:57:18 +0000
Received: by outflank-mailman (input) for mailman id 10133;
 Wed, 21 Oct 2020 16:57:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVHQL-0002nL-Bu
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7d664848-b5c8-4d2d-b460-8a3021ca56fc;
 Wed, 21 Oct 2020 16:57:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQK-0002fq-CE
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVHQK-0001Xf-BS
 for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=a0p+=D4=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVHQL-0002nL-Bu
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:17 +0000
X-Inumbo-ID: 7d664848-b5c8-4d2d-b460-8a3021ca56fc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7d664848-b5c8-4d2d-b460-8a3021ca56fc;
	Wed, 21 Oct 2020 16:57:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ir4Up4K9AbXJyT6nIsZWh0VsBMsZO00hV1Jvbbf0Obk=; b=lBxOUEv36W2GnAWbLoobcWbOvs
	kFmdtkIAfzq4N1OpKwGgYS97ztvVdPW/+dvJl0VOdH9bGPR8aGMp8NfL+mJl8nLsGVy9Jz/Slt1GF
	6+12ozpDhZ+z8U3YXzWBDfwXOZr+yi8AQso9y2vsHLTy9f5pUWi+XGuQb+Qxf0hq8wLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQK-0002fq-CE
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVHQK-0001Xf-BS
	for xen-changelog@lists.xenproject.org; Wed, 21 Oct 2020 16:57:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.12] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kVHQK-0001Xf-BS@xenbits.xenproject.org>
Date: Wed, 21 Oct 2020 16:57:16 +0000

commit 0108b011e133915a8ebd33636811d8c141b6e9f3
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 15:06:49 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 15:06:49 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.12


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10332.27473 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjT-0000XW-1S; Thu, 22 Oct 2020 10:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10332.27473; Thu, 22 Oct 2020 10:22:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjS-0000XI-Tf; Thu, 22 Oct 2020 10:22:06 +0000
Received: by outflank-mailman (input) for mailman id 10332;
 Thu, 22 Oct 2020 10:22:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXjR-0000XB-4v
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6b2c3afe-2e21-47b3-ba87-22b8bf96c66b;
 Thu, 22 Oct 2020 10:22:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXjO-0005CK-W2
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXjO-0005Vr-UL
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXjR-0000XB-4v
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:05 +0000
X-Inumbo-ID: 6b2c3afe-2e21-47b3-ba87-22b8bf96c66b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6b2c3afe-2e21-47b3-ba87-22b8bf96c66b;
	Thu, 22 Oct 2020 10:22:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+9JmFZCrakZ/Mo+pAhvtGhxKF0H1mEo6Q+5QOq8VsQw=; b=1KE8oEUR2qu7AOuOc0SnXvnUtr
	MHh9rMtUyyTXqMWgaM5RfbhHTGxugDq4EvsgZ6uFOBpr5TnIu8aHbereNXKYreEbqzqxLSxuGTrfZ
	oggjoG+Fa9g6Q4ZnS1mla4frkAyGRi6pUlFano2QV7tMG4tFkcv5IHjytLJa8FCY5t5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXjO-0005CK-W2
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXjO-0005Vr-UL
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kVXjO-0005Vr-UL@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:02 +0000

commit a2c0c91b3ee265a710ba2d5cfc3b0fc90930ed0b
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:50:01 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:01 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 30dffb68e8..133a393875 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5187,6 +5187,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5207,7 +5208,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5295,7 +5297,7 @@ int map_pages_to_xen(
 
             pl2e = alloc_xen_pagetable();
             if ( pl2e == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
@@ -5324,7 +5326,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5367,7 +5369,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5394,7 +5396,7 @@ int map_pages_to_xen(
 
                 pl1e = alloc_xen_pagetable();
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
@@ -5538,7 +5540,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10333.27476 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjd-0000Yr-3s; Thu, 22 Oct 2020 10:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10333.27476; Thu, 22 Oct 2020 10:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjd-0000Yh-0g; Thu, 22 Oct 2020 10:22:17 +0000
Received: by outflank-mailman (input) for mailman id 10333;
 Thu, 22 Oct 2020 10:22:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXjb-0000YR-BL
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6feb9eed-afb0-49f8-8b2f-5465fd266467;
 Thu, 22 Oct 2020 10:22:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXja-0005CN-6l
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXjZ-0005Wh-2I
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXjb-0000YR-BL
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:15 +0000
X-Inumbo-ID: 6feb9eed-afb0-49f8-8b2f-5465fd266467
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6feb9eed-afb0-49f8-8b2f-5465fd266467;
	Thu, 22 Oct 2020 10:22:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zWh7DUHMoUArmJzzJmsMpwYql7fZVGvFvAIoL6rLQ90=; b=kYpdyA0fQ6fei+g/jzgArjjS9S
	o2BwNpVgSo8kDR4j9u67SPl9rDkwJfN9RWbaXGww4e5mlzIL3kIDZsmwN5aKGzavyuwo96tdBBICx
	a/30dQ0IdGej0Nb+WFL3reYwhM/Q20T4WU2/YZTjwbgOeVqGYQxrfyiD62GtEgYz6/WU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXja-0005CN-6l
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXjZ-0005Wh-2I
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kVXjZ-0005Wh-2I@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:13 +0000

commit 7f5d6760b6e5e710846c50b5c2dbdd094872d3bc
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:50:24 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:24 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 133a393875..af726d3274 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5570,6 +5570,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5611,7 +5612,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             pl2e = alloc_xen_pagetable();
             if ( !pl2e )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(pl2e + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5666,7 +5668,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 pl1e = alloc_xen_pagetable();
                 if ( !pl1e )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5795,7 +5798,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10334.27480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjn-0000b1-54; Thu, 22 Oct 2020 10:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10334.27480; Thu, 22 Oct 2020 10:22:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjn-0000at-2B; Thu, 22 Oct 2020 10:22:27 +0000
Received: by outflank-mailman (input) for mailman id 10334;
 Thu, 22 Oct 2020 10:22:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXjl-0000ad-Fc
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 49d04d38-20f7-4808-8eda-dc2f5d3adb62;
 Thu, 22 Oct 2020 10:22:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXjk-0005DG-A3
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXjk-0005XR-94
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXjl-0000ad-Fc
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:25 +0000
X-Inumbo-ID: 49d04d38-20f7-4808-8eda-dc2f5d3adb62
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 49d04d38-20f7-4808-8eda-dc2f5d3adb62;
	Thu, 22 Oct 2020 10:22:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BJgcNoa4d4Hch7ydtoLuEIBWXypJesSwUH8gF0YEt4I=; b=1kqmBHwRRp348V3DHXbZhoqQdt
	CPuhjIsC7cf6QazjyvW9zZDGZ4d/TO40wEY3kSzm4Y5lChVy1oW4cpjJaTNmG5FyGK4HB9rzZF4fx
	joAkTRESsLQK8/YEbhxnfGl1jxdYdzaGq9BhLlQXpyUXQZ3wc702CC8dhOQYD0PAelWc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXjk-0005DG-A3
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXjk-0005XR-94
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kVXjk-0005XR-94@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:24 +0000

commit 98ec9711e5263350e19753edde6f922535e41744
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 14:50:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:50:43 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index af726d3274..d6a0761f43 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2167,6 +2167,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5177,6 +5221,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5188,6 +5249,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5203,13 +5265,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5543,6 +5612,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5571,6 +5641,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_RW|_PAGE_PRESENT)
@@ -5579,11 +5650,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5801,9 +5883,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10335.27484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjy-0000cd-6c; Thu, 22 Oct 2020 10:22:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10335.27484; Thu, 22 Oct 2020 10:22:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXjy-0000cV-3f; Thu, 22 Oct 2020 10:22:38 +0000
Received: by outflank-mailman (input) for mailman id 10335;
 Thu, 22 Oct 2020 10:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXjw-0000cH-8o
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96a36a1a-5340-4f90-af47-baa02f42dad0;
 Thu, 22 Oct 2020 10:22:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXju-0005E9-DY
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXju-0005Z4-CE
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXjw-0000cH-8o
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:36 +0000
X-Inumbo-ID: 96a36a1a-5340-4f90-af47-baa02f42dad0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96a36a1a-5340-4f90-af47-baa02f42dad0;
	Thu, 22 Oct 2020 10:22:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QlVWNayuzclteJQvhvS5aVDj3VzRJvTQStHEGmZsUBE=; b=iPp26v3y8z/t5UwHPMs6/kzo1c
	zHx8dN7kiMF7CqwISDRtfr71Bjs0+2315uiDTQvT34iF5NbVRvIgUkoy6mmIUw5IqfISkaH1TvbfW
	/DrBxbgph22c95lVflOO7C4PTU63zwPCobqNL3uzuiY0h0qEUJTCD+diVn/bcuO45Kio=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXju-0005E9-DY
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXju-0005Z4-CE
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kVXju-0005Z4-CE@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:34 +0000

commit 6e237b616091a573c1c3bef63a5d02f1d0ad0916
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:51:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:51:02 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index b2b6a775d9..9430c10474 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -292,6 +292,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -378,8 +379,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10336.27488 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXk7-0000e1-99; Thu, 22 Oct 2020 10:22:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10336.27488; Thu, 22 Oct 2020 10:22:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXk7-0000dt-56; Thu, 22 Oct 2020 10:22:47 +0000
Received: by outflank-mailman (input) for mailman id 10336;
 Thu, 22 Oct 2020 10:22:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXk5-0000di-LV
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cde3d595-30d4-4a5c-a88b-b7a3637c64fd;
 Thu, 22 Oct 2020 10:22:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXk4-0005F1-H8
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXk4-0005b9-GI
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXk5-0000di-LV
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:45 +0000
X-Inumbo-ID: cde3d595-30d4-4a5c-a88b-b7a3637c64fd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cde3d595-30d4-4a5c-a88b-b7a3637c64fd;
	Thu, 22 Oct 2020 10:22:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jFAackZLkVTQxbbK74+S7cWmMS4g8cLlow23wHOTKeo=; b=TaLs29fEcgf2Kfh8eH0agDzJSG
	EHfCGvDCQcXHXQsz7YV09Sf9V/ZpnhANvjBnNFNQLA6KSIKvD2VRlkVqJn6r4/P3oX9LT0P87XJJV
	+5P9AeUnIcfgdhsuHk97tm9Ap72TEix2ZelccHst6YRd2j9DlxOKjnvNsy9xlxxAtIf4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXk4-0005F1-H8
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXk4-0005b9-GI
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kVXk4-0005b9-GI@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:44 +0000

commit 745652fec903701ff160c6def509c01c8a668d4b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:51:27 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:51:27 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 4d6c971f37..774cf62272 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d6a0761f43..407340e5f5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4668,7 +4668,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4752,9 +4752,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9430c10474..031ed6ecbe 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -814,13 +814,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -835,7 +834,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -847,8 +849,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -858,6 +864,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -866,6 +873,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -879,6 +895,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -890,6 +908,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -902,8 +933,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 8d0ddfb60c..e21b457bd1 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -588,8 +588,22 @@ void scrub_one_page(struct page_info *);
                       &(d)->xenpage_list : &(d)->page_list)
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:22:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:22:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10339.27497 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkI-0000iC-E4; Thu, 22 Oct 2020 10:22:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10339.27497; Thu, 22 Oct 2020 10:22:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkI-0000i2-AL; Thu, 22 Oct 2020 10:22:58 +0000
Received: by outflank-mailman (input) for mailman id 10339;
 Thu, 22 Oct 2020 10:22:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXkH-0000fp-RL
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ae87685e-5d7c-40a8-a508-4fefd838b5f3;
 Thu, 22 Oct 2020 10:22:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkE-0005FI-KW
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkE-0005c3-JX
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXkH-0000fp-RL
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:57 +0000
X-Inumbo-ID: ae87685e-5d7c-40a8-a508-4fefd838b5f3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ae87685e-5d7c-40a8-a508-4fefd838b5f3;
	Thu, 22 Oct 2020 10:22:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O8MNgiHv70zbhdGPZeUGSAta/wH8WqP98eX70aD0zdI=; b=CluA9an+lBF0WuvZos9PACj7r2
	qpuQf8XK1q6Mg36hy6lO5+q21MwGeYyAtHrUA+S+GvNUlf89HwJ0pKIC8hsWMvkLHfpwF2E49mqsg
	iXzUm49hn3lW4TnBdN5oNA1O/De2V8kY5W8Z2GVD6EMu3XNnXEhsdqIdnDx59tkIbsIE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkE-0005FI-KW
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkE-0005c3-JX
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:22:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kVXkE-0005c3-JX@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:22:54 +0000

commit 1c86c830303fe18b8e2ca305ce44152147e8a8f9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:03 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 73f62c7380edf07469581a3049aba98abd63b275
    master date: 2020-10-20 14:22:26 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c      | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c  |  8 +++----
 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h | 31 +++++++++++++++-------------
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 5be27fe9f8..a039038113 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -38,7 +38,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -52,7 +52,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -87,7 +87,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -178,7 +178,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -458,7 +458,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.root_table )
     {
@@ -489,7 +489,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index fd12858578..5851cc5b18 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -390,7 +390,7 @@ static void deallocate_next_page_table(struct page_info *pg, int level)
 
 static void deallocate_page_table(struct page_info *pg)
 {
-    struct amd_iommu_pte *table_vaddr;
+    union amd_iommu_pte *table_vaddr;
     unsigned int index, level = PFN_ORDER(pg);
 
     PFN_ORDER(pg) = 0;
@@ -405,7 +405,7 @@ static void deallocate_page_table(struct page_info *pg)
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( pde->mfn && pde->next_level && pde->pr )
         {
@@ -557,7 +557,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -573,7 +573,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
index 78368f16d9..6049507a30 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
@@ -465,20 +465,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10341.27502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkQ-0000jZ-FW; Thu, 22 Oct 2020 10:23:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10341.27502; Thu, 22 Oct 2020 10:23:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkQ-0000jR-Bx; Thu, 22 Oct 2020 10:23:06 +0000
Received: by outflank-mailman (input) for mailman id 10341;
 Thu, 22 Oct 2020 10:23:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXkP-0000jI-M9
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1d5d3888-8510-4be3-b686-bf3bcb263bcd;
 Thu, 22 Oct 2020 10:23:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkO-0005Fj-Nv
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkO-0005d2-Mm
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXkP-0000jI-M9
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:05 +0000
X-Inumbo-ID: 1d5d3888-8510-4be3-b686-bf3bcb263bcd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1d5d3888-8510-4be3-b686-bf3bcb263bcd;
	Thu, 22 Oct 2020 10:23:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pJv3vKgilGE6ug21cMQBu8clWZ18kSPx71Fg2J0SdZs=; b=gLGwuBL0R5vmeh0YZlG4W69UxC
	ETUqgglL9FzGRVsosGY10d+gESlNjb2dNTsSN6i52JNeRNIQ3r3IQBCWfSy0tdy7HWHq8WzCrOzMZ
	QwP5k8Bd1MV4ZacYbJVbou7ANB702tm5h+G54jDdmf08AwetoFkmk1gGWi3DCeGQOYJg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkO-0005Fj-Nv
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkO-0005d2-Mm
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kVXkO-0005d2-Mm@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:04 +0000

commit 3009e4d6b46c365e553c67499c45459cf1955f51
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:23 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index a039038113..7f8971c73c 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -45,7 +45,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -57,26 +57,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10342.27505 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXka-0000qX-GW; Thu, 22 Oct 2020 10:23:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10342.27505; Thu, 22 Oct 2020 10:23:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXka-0000qP-De; Thu, 22 Oct 2020 10:23:16 +0000
Received: by outflank-mailman (input) for mailman id 10342;
 Thu, 22 Oct 2020 10:23:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXkZ-0000mz-Mf
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f2bf3d80-c083-4a78-9418-1af68b7d6498;
 Thu, 22 Oct 2020 10:23:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkY-0005Fs-Qx
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkY-0005dq-Q0
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXkZ-0000mz-Mf
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:15 +0000
X-Inumbo-ID: f2bf3d80-c083-4a78-9418-1af68b7d6498
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f2bf3d80-c083-4a78-9418-1af68b7d6498;
	Thu, 22 Oct 2020 10:23:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TMZWLqIOPnWAr8URSUXnUWYciaGK5rP8hxP/kGvN6g8=; b=oHfw/eOx2wNbRZO77zSwaozqg5
	DUY0YGnc/iQd6MpDAWoCc+eoCeyCzeet6GijRPdc/OHd3clFbHrqWscuzIBidNjo4e0IzcE2GVXna
	KYALL/lVgpkw0+wX/IyGptjHsO57Kh/3wExJyoyYybrwcy7kKorSn03bVBltrIaVy95A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkY-0005Fs-Qx
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkY-0005dq-Q0
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kVXkY-0005dq-Q0@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:14 +0000

commit e891c288ccf966a5822a6dd2dbf1342273a18d6e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:52:43 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:52:43 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 7f8971c73c..85b8df9abd 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -107,11 +107,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -134,6 +141,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 5851cc5b18..46b1d367ec 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -120,7 +120,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10343.27510 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkk-0000sX-II; Thu, 22 Oct 2020 10:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10343.27510; Thu, 22 Oct 2020 10:23:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXkk-0000sO-FF; Thu, 22 Oct 2020 10:23:26 +0000
Received: by outflank-mailman (input) for mailman id 10343;
 Thu, 22 Oct 2020 10:23:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXkj-0000sH-Tt
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id df7381b3-a63e-4a68-8f70-6f866a405c2a;
 Thu, 22 Oct 2020 10:23:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkj-0005GW-2A
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXki-0005ec-TE
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXkj-0000sH-Tt
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
X-Inumbo-ID: df7381b3-a63e-4a68-8f70-6f866a405c2a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id df7381b3-a63e-4a68-8f70-6f866a405c2a;
	Thu, 22 Oct 2020 10:23:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4NhuqGyE62JJQ3BvC29GiJ7JZ9iz9qI5PwpwnA3XLwg=; b=3hSinP8C0uK2ZipZLbhw9Fa7CU
	c0dHrkMP1JyNSROobFH6qUOJ4tqIRsSQmv0vIr0zV1yMD7753AZpYiwwJq3j7ZPBr9ANDEYTbedSW
	9Ngk6bmVDz00avoH1TZfMTXqCblWaRPEJLmqOaX7YZ6/XgXfszhyVE3gQPnOMf0+P+Gk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkj-0005GW-2A
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXki-0005ec-TE
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kVXki-0005ec-TE@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:24 +0000

commit ff1fd42f0de4f399f3b98903c99d6ec549039eb7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:53:30 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:53:30 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 33ac552cac..9059c2ef6e 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -119,7 +119,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 5ec5522e33..7850546749 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -182,7 +182,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -202,7 +202,7 @@ restore_all_guest:
         ALIGN
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10344.27514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXku-0000tp-Jl; Thu, 22 Oct 2020 10:23:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10344.27514; Thu, 22 Oct 2020 10:23:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXku-0000th-Gl; Thu, 22 Oct 2020 10:23:36 +0000
Received: by outflank-mailman (input) for mailman id 10344;
 Thu, 22 Oct 2020 10:23:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXkt-0000tc-Vp
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 742c1d50-9f1a-494d-ad9f-9f053d7e7d35;
 Thu, 22 Oct 2020 10:23:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkt-0005Gj-58
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXkt-0005fU-4N
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXkt-0000tc-Vp
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:36 +0000
X-Inumbo-ID: 742c1d50-9f1a-494d-ad9f-9f053d7e7d35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 742c1d50-9f1a-494d-ad9f-9f053d7e7d35;
	Thu, 22 Oct 2020 10:23:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=icIxNxhi/Y2SIWGMIAcjLRJRzZ9mdAK+tVVzF6OxJhs=; b=bz1K1bSsl2YbFY4kX+Rgbw9Py0
	FjfWfSdE0IC3gG7A9vL8M/cioS8Y2adq8+LzCZCaQADB/4dO1W1DbT+uU2su75LczfqhP0h1eQuz/
	KWWm3sL0cBo5j0dvbdwzFoE57mJ8wm2LMIjQMwJY+OzkhJGVQ1yBZzllV0R+Lnx9TemE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkt-0005Gj-58
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXkt-0005fU-4N
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kVXkt-0005fU-4N@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:35 +0000

commit 055a5d540b8a9f40be71fd52eacb39f0b3acf7b7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:54:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:54:12 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 7850546749..6a5f8aaec3 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -296,7 +296,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10345.27518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXl4-0000v8-LG; Thu, 22 Oct 2020 10:23:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10345.27518; Thu, 22 Oct 2020 10:23:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXl4-0000uz-IK; Thu, 22 Oct 2020 10:23:46 +0000
Received: by outflank-mailman (input) for mailman id 10345;
 Thu, 22 Oct 2020 10:23:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXl4-0000us-2a
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0b97901-60ad-4387-bb21-eddbef2eb162;
 Thu, 22 Oct 2020 10:23:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXl3-0005Gs-7j
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXl3-0005gM-79
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXl4-0000us-2a
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:46 +0000
X-Inumbo-ID: f0b97901-60ad-4387-bb21-eddbef2eb162
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0b97901-60ad-4387-bb21-eddbef2eb162;
	Thu, 22 Oct 2020 10:23:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TSkROf5sci9AzLP5SCN6Lxlir6Le37aI53k2nbdTuLs=; b=5UtP6MgTi2i7R0tUxpVmSRgH/2
	SZ9kkOuZs8Y+epWhy4CuFv/v7j496mH0+dyWzXxaTaNdT9wz7128dGUWHgNNaCINf/tAVua8BC/rg
	vOVDiLvQl1Y5k0dqph07Iu/6c+8QWf91V98FyedEBg+5ePO4lkNxHpoavLgSslihw7yY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXl3-0005Gs-7j
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXl3-0005gM-79
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kVXl3-0005gM-79@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:45 +0000

commit ca95985a648824a9df941c25e567cd1beee7c5f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:54:44 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:54:44 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:23:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:23:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10346.27521 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlF-0000wi-ON; Thu, 22 Oct 2020 10:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10346.27521; Thu, 22 Oct 2020 10:23:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlF-0000wa-LF; Thu, 22 Oct 2020 10:23:57 +0000
Received: by outflank-mailman (input) for mailman id 10346;
 Thu, 22 Oct 2020 10:23:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXlF-0000wU-0s
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 92fd8272-46ed-4bb5-8eb0-38b6ecd22f26;
 Thu, 22 Oct 2020 10:23:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlD-0005H8-BW
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlD-0005hA-9y
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXlF-0000wU-0s
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:57 +0000
X-Inumbo-ID: 92fd8272-46ed-4bb5-8eb0-38b6ecd22f26
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 92fd8272-46ed-4bb5-8eb0-38b6ecd22f26;
	Thu, 22 Oct 2020 10:23:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cu/+fOiQsLG77q73kOtdqVhbTgpINKL922XHt2HJew0=; b=5wHqTMlO/HXya4IiywP3teybc2
	3TYJUUlbNPt/hKt9nhcOhNMbfiKHCBIvHcRLAqgnn7hwlDjRfFxdsYLzcdA0/j8TnHODfcimqsJsM
	0Dt8pNIEpRIdVbim+bAfcLwFQOHf/57bAPabo589jy/OncC8kvJF5OZoiGcVFe+7JDBs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlD-0005H8-BW
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlD-0005hA-9y
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:23:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kVXlD-0005hA-9y@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:23:55 +0000

commit fa9e1f73bfc0033f21d3e53f3a366b9121141763
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 20 14:55:11 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:55:11 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 59b27f360e3d9dc0378c1288e67a91fa41a77158
    master date: 2020-10-02 08:38:50 +0200
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index e0dd88f0f4..ee9c604118 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -298,6 +298,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:24:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:24:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10347.27525 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlO-0000xz-Po; Thu, 22 Oct 2020 10:24:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10347.27525; Thu, 22 Oct 2020 10:24:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlO-0000xr-Mp; Thu, 22 Oct 2020 10:24:06 +0000
Received: by outflank-mailman (input) for mailman id 10347;
 Thu, 22 Oct 2020 10:24:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXlO-0000xj-7I
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8182ed87-2032-4af5-ad56-2cc3c69be6cf;
 Thu, 22 Oct 2020 10:24:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlN-0005HT-EM
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlN-0005i1-Dh
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXlO-0000xj-7I
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:06 +0000
X-Inumbo-ID: 8182ed87-2032-4af5-ad56-2cc3c69be6cf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8182ed87-2032-4af5-ad56-2cc3c69be6cf;
	Thu, 22 Oct 2020 10:24:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=R4Y3mEiNP5H9o+NitSSdqj/QZEY+v+oFq9nQTv6nRfs=; b=Q9gkuT+yUSZVw11TIyxw0ltXE3
	mVrisDRSeOmM4H0r3IOs8Mrrokx6mCStqrNd1OIUyiTxXM8mAZaI5uwrflQPeOoRwrmjlmdWXQW9S
	8aL1KZPb0I4TBSsy5RrJzWq3ndAhIu9/tTH1As99MPb+4AbuIgUv/2uata+K4ucZAU28=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlN-0005HT-EM
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlN-0005i1-Dh
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kVXlN-0005i1-Dh@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:24:05 +0000

commit c32e9be04a16d3c4a97bf034f2cb1eb1318927ff
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:55:39 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:55:39 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 9b8afb72e8..4eb0883293 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1626,6 +1626,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:24:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:24:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10348.27530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlZ-0000zN-RM; Thu, 22 Oct 2020 10:24:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10348.27530; Thu, 22 Oct 2020 10:24:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlZ-0000zF-OQ; Thu, 22 Oct 2020 10:24:17 +0000
Received: by outflank-mailman (input) for mailman id 10348;
 Thu, 22 Oct 2020 10:24:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXlZ-0000z9-34
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d5abf9ce-b2fd-4bba-b7a6-ec9aed3bceec;
 Thu, 22 Oct 2020 10:24:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlX-0005He-HR
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlX-0005ip-GW
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXlZ-0000z9-34
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:17 +0000
X-Inumbo-ID: d5abf9ce-b2fd-4bba-b7a6-ec9aed3bceec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d5abf9ce-b2fd-4bba-b7a6-ec9aed3bceec;
	Thu, 22 Oct 2020 10:24:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ay6aiXe5yt+gN1aRPqmmb15H9wwf86fnN2US6QOyV3M=; b=xLcaYVOb0cfev2LdGsah0ggXnz
	wALoOPtn0IWB9DUw6Qj9ixEkM0Q188H9r5TqSjcbK8n0/EMRdYm3BzE18FU9jOsbjyYGmsKygCUNk
	muohlRUtf0aY0o15UeL7XCB6ZYVvWJ06w12I9tVwZg6MM8oqnV428qxy/WGhXTImKIrI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlX-0005He-HR
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlX-0005ip-GW
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kVXlX-0005ip-GW@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:24:15 +0000

commit 82a28743dac04d1ecccd7bcb20b1ef696b67c9a5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:56:07 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:56:07 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4b5ad0fd17..135c6d5b82 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -402,6 +402,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -427,9 +430,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:24:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:24:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10349.27533 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlj-000112-Sy; Thu, 22 Oct 2020 10:24:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10349.27533; Thu, 22 Oct 2020 10:24:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlj-00010t-Q1; Thu, 22 Oct 2020 10:24:27 +0000
Received: by outflank-mailman (input) for mailman id 10349;
 Thu, 22 Oct 2020 10:24:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXli-00010i-Lh
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 04b71a14-8077-4c74-83f4-a29e520d031b;
 Thu, 22 Oct 2020 10:24:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlh-0005IR-KH
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlh-0005jc-JW
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXli-00010i-Lh
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:26 +0000
X-Inumbo-ID: 04b71a14-8077-4c74-83f4-a29e520d031b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 04b71a14-8077-4c74-83f4-a29e520d031b;
	Thu, 22 Oct 2020 10:24:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uqwck5LHg8gvXdPZWhicIxcGJbFJuQCNqYfLhqHJY60=; b=k/a6PHyA6FSh/hwWQ8ZEapZot6
	6XZus3aeT0GJBPpkVlKmXVCefermPEYJgK/aY5Sm42EN5yGFUJiykYFmtaGmd3yvvInL5J9aKn7P1
	do01QcU8o+RJhHt/GgZeHNGe3aB8lEhIJJywjSd5HctI6cctFE1ujQxGS9slkfGAVX08=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlh-0005IR-KH
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlh-0005jc-JW
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kVXlh-0005jc-JW@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:24:25 +0000

commit b05fe1533b5be6c85e3d32d184ff1e131b1705d9
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 14:56:34 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:56:34 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d0736d4502..9214693546 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -553,6 +553,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -906,6 +928,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -960,6 +987,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 10:24:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 10:24:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10350.27538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlt-00012K-Ua; Thu, 22 Oct 2020 10:24:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10350.27538; Thu, 22 Oct 2020 10:24:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVXlt-00012C-Ra; Thu, 22 Oct 2020 10:24:37 +0000
Received: by outflank-mailman (input) for mailman id 10350;
 Thu, 22 Oct 2020 10:24:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVXls-000123-Oe
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 24b35e4c-919e-4cce-be9d-f5fb7fb88460;
 Thu, 22 Oct 2020 10:24:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlr-0005Ia-TX
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVXlr-0005ku-MR
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVXls-000123-Oe
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:36 +0000
X-Inumbo-ID: 24b35e4c-919e-4cce-be9d-f5fb7fb88460
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 24b35e4c-919e-4cce-be9d-f5fb7fb88460;
	Thu, 22 Oct 2020 10:24:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3b4HK4ovg89wlsaL3t7wSnMJZy7L3HPjmPYh7XoHsNY=; b=RXbJFJzRQwO4ksXTf2jqOM5nXt
	LxCNEFPjH3sIOZBX1xUschUl4QzTzrjA5HmooUkKj4Ah1I/YcQnvhEATpQzEeFwLTGusoa62wLOHw
	Wrki1Kbo87eNgez/AOSIgY7M3L56yDhbubJjW2Fw3znfBo/ucbneUF1alAQf9Csbo36s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlr-0005Ia-TX
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVXlr-0005ku-MR
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 10:24:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kVXlr-0005ku-MR@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 10:24:35 +0000

commit dc38c1103cfdc643860e10c1b9e925dac83332dc
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 14:57:03 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:57:03 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10488.27877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVboz-0002bf-6z; Thu, 22 Oct 2020 14:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10488.27877; Thu, 22 Oct 2020 14:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVboz-0002bX-47; Thu, 22 Oct 2020 14:44:05 +0000
Received: by outflank-mailman (input) for mailman id 10488;
 Thu, 22 Oct 2020 14:44:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbox-0002bS-Sg
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cb793a10-a713-4670-a7d7-8119280458c8;
 Thu, 22 Oct 2020 14:44:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbow-0002IG-Ge
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbow-0004HD-FQ
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbox-0002bS-Sg
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:03 +0000
X-Inumbo-ID: cb793a10-a713-4670-a7d7-8119280458c8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cb793a10-a713-4670-a7d7-8119280458c8;
	Thu, 22 Oct 2020 14:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=53egVzrpIAzNP0YGPoyALMwDPMs0TPiTE5bGNMsH0YY=; b=KsgzLxNiKpCDN51cnN9FqPuWnk
	3p/wRfLXcm0nr9PU686bmFyyaNLNkglT8ZLPzpisfgKWXqZ9cN+OJOFqglGoSv+/bDlaxTMaj0qDY
	1a5W4r1vwtz+udF2/3kQvg1Q0RBcQGGHsePa8ilRS/IfNRP4lEpdEH+TTE88+IN8Afu8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbow-0002IG-Ge
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbow-0004HD-FQ
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kVbow-0004HD-FQ@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:02 +0000

commit b4271092f29ab105b53e026a243310926b59c076
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:37:10 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:37:10 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
    master date: 2020-10-20 14:19:31 +0200
---
 xen/arch/x86/mm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 82bc676553..03f6e6aa62 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5088,6 +5088,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5108,7 +5109,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5198,7 +5200,7 @@ int map_pages_to_xen(
 
             l2t = alloc_xen_pagetable();
             if ( l2t == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
@@ -5227,7 +5229,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5271,7 +5273,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5299,7 +5301,7 @@ int map_pages_to_xen(
 
                 l1t = alloc_xen_pagetable();
                 if ( l1t == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
@@ -5445,7 +5447,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10490.27880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbp9-0002ci-8O; Thu, 22 Oct 2020 14:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10490.27880; Thu, 22 Oct 2020 14:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbp9-0002ca-5b; Thu, 22 Oct 2020 14:44:15 +0000
Received: by outflank-mailman (input) for mailman id 10490;
 Thu, 22 Oct 2020 14:44:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbp7-0002cP-HN
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c9a3418a-342e-45c8-9ccd-51896f28536f;
 Thu, 22 Oct 2020 14:44:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbp6-0002IS-M9
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbp6-0004IQ-Jh
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbp7-0002cP-HN
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:13 +0000
X-Inumbo-ID: c9a3418a-342e-45c8-9ccd-51896f28536f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c9a3418a-342e-45c8-9ccd-51896f28536f;
	Thu, 22 Oct 2020 14:44:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RGiBcPEV0XMM82LIIpAStF3tKAHsKxijOCDYqsnuhn0=; b=3Dxj1v+sxLrrtoaiPnGTeTO8Vy
	TKCCVxy0oZYeJkfwZKzuklRNJVVSezU/O7Af/ZkPCLbVDLIOJR+WQLvnwJkwNaWVZK2ctqtE47CXJ
	6WPHpad8VfMAhSvyQj3sH9EWbHr5qRGUfEzsaNUeLC/N6f9sJatnr3lkMBMK9utWz+Dk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbp6-0002IS-M9
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbp6-0004IQ-Jh
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kVbp6-0004IQ-Jh@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:12 +0000

commit 809a70b161ca0adaed0ef198e2b86e846f9de442
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Oct 20 14:37:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:37:31 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: b733f8a8b8db83f2d438cab3adb38b387cecfce0
    master date: 2020-10-20 14:19:55 +0200
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 03f6e6aa62..2468347a45 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5477,6 +5477,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5520,7 +5521,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             l2t = alloc_xen_pagetable();
             if ( !l2t )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5577,7 +5579,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 l1t = alloc_xen_pagetable();
                 if ( !l1t )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5710,7 +5713,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10492.27885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpJ-0002eM-AB; Thu, 22 Oct 2020 14:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10492.27885; Thu, 22 Oct 2020 14:44:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpJ-0002eE-79; Thu, 22 Oct 2020 14:44:25 +0000
Received: by outflank-mailman (input) for mailman id 10492;
 Thu, 22 Oct 2020 14:44:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbpI-0002e3-18
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ad70a06d-4e55-4422-9741-e1a0daa84b7e;
 Thu, 22 Oct 2020 14:44:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpG-0002JE-Ql
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpG-0004Jc-Ow
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbpI-0002e3-18
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:24 +0000
X-Inumbo-ID: ad70a06d-4e55-4422-9741-e1a0daa84b7e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ad70a06d-4e55-4422-9741-e1a0daa84b7e;
	Thu, 22 Oct 2020 14:44:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c9TaCKzKnIZ2y+mmm1PBQa2izTzKpQoPZaAVHYvA6/Q=; b=pm9zCjnJLuou+Cj/LzwhUl50co
	ZQHT7TGhB0UudA5LU/8WaqbnlXBUAZBbpYosnb2cA+oI+HtbHGfGpRACsLc1zqXeGPLloq/9649hw
	F4jPlycM1LGlxQZwHvIl0ewWRw5aA9Mu4L+erLfQ4YFM1qOC4tTD0rccFTArpid2GERQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpG-0002JE-Ql
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpG-0004Jc-Ow
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kVbpG-0004Jc-Ow@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:22 +0000

commit 9e757fcdbb758ae2d0459bcaabc8ff6cf505a43d
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Tue Oct 20 14:38:05 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:05 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 1ce75e99d75907aaffae05fcf658a833802bce49
    master date: 2020-10-20 14:20:19 +0200
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2468347a45..9c55b2b9e3 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2088,6 +2088,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5078,6 +5122,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5089,6 +5150,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5104,13 +5166,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5450,6 +5519,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5478,6 +5548,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5486,11 +5557,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5716,9 +5798,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10493.27889 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpT-0002g4-Bm; Thu, 22 Oct 2020 14:44:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10493.27889; Thu, 22 Oct 2020 14:44:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpT-0002fw-8j; Thu, 22 Oct 2020 14:44:35 +0000
Received: by outflank-mailman (input) for mailman id 10493;
 Thu, 22 Oct 2020 14:44:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbpR-0002fm-RL
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9e35fd6b-9ab6-4c78-bf5c-d622475f104a;
 Thu, 22 Oct 2020 14:44:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpQ-0002JM-UU
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpQ-0004L3-TL
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbpR-0002fm-RL
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:33 +0000
X-Inumbo-ID: 9e35fd6b-9ab6-4c78-bf5c-d622475f104a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9e35fd6b-9ab6-4c78-bf5c-d622475f104a;
	Thu, 22 Oct 2020 14:44:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nI9lgvLTD4R3T77FqAOH/JXkeFtttXT8hc6yIqxqhQ0=; b=lkEKJSueWU6Vi8LBBBoOFKvqF0
	b5ZQoHYJjOGRV4xkMP7SUh4QNbkzCH3SqUEUgm+ukkQuOjte7PpTNAAxuCb2vlIQq50KOcuMVxfQd
	P19Qee1dz0xeyyj5ErtCfNQO9887wmu31yDOA5hFuPJ2bVBiXA81CDXOmbgdSNftq1Zs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpQ-0002JM-UU
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpQ-0004L3-TL
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kVbpQ-0004L3-TL@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:32 +0000

commit 79f17015e7f45e51de87dda7ff9d6fac104e1cc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:38:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:22 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: dea460d86957bf1425a8a1572626099ac3f165a8
    master date: 2020-10-20 14:21:09 +0200
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1bab0e80c2..5f4be59761 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -293,6 +293,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -379,8 +380,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10495.27897 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpd-0002hp-Gr; Thu, 22 Oct 2020 14:44:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10495.27897; Thu, 22 Oct 2020 14:44:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpd-0002hd-Bd; Thu, 22 Oct 2020 14:44:45 +0000
Received: by outflank-mailman (input) for mailman id 10495;
 Thu, 22 Oct 2020 14:44:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbpc-0002hF-76
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b4c401aa-62a6-4839-8aab-dd151fa8f9f9;
 Thu, 22 Oct 2020 14:44:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpb-0002JY-2C
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpb-0004MI-1B
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbpc-0002hF-76
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:44 +0000
X-Inumbo-ID: b4c401aa-62a6-4839-8aab-dd151fa8f9f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b4c401aa-62a6-4839-8aab-dd151fa8f9f9;
	Thu, 22 Oct 2020 14:44:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qx2+7EpRUXq5+SS42DQxdkCZcmKEHYBmAcApCV4pE8w=; b=Vs/MVcNIBsw55BDQziUjJOD/q3
	6wxdPCWbfdP9ZKrZ5vifJhEorLDcOZ1upR3qM9gCG/Ex6hmVTbNt+rFl4g02te2JseEBRxV8NoeHj
	IDlhSKYtwg5ey62sCQeu954P94bGPDXjE4LlafDxaVcKFSdyFB1zeoHuU9izUMicnSt8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpb-0002JY-2C
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpb-0004MI-1B
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kVbpb-0004MI-1B@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:43 +0000

commit 94c157f2e3eaf036e04ba5e7186b6f1d5671fa93
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:38:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:38:53 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
    master date: 2020-10-20 14:21:32 +0200
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 9e2ff7c800..4aba9015b9 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9c55b2b9e3..3cb6fabdae 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4550,7 +4550,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4634,9 +4634,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 5f4be59761..7075e233aa 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -815,13 +815,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -836,7 +835,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -848,8 +850,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -859,6 +865,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -867,6 +874,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -880,6 +896,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -891,6 +909,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -903,8 +934,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 1061765bcd..864552b72f 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -592,8 +592,22 @@ void scrub_one_page(struct page_info *);
     page_list_del(pg, page_to_list(d, pg))
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:44:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:44:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10496.27900 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpo-0002kM-Im; Thu, 22 Oct 2020 14:44:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10496.27900; Thu, 22 Oct 2020 14:44:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpo-0002kE-Fn; Thu, 22 Oct 2020 14:44:56 +0000
Received: by outflank-mailman (input) for mailman id 10496;
 Thu, 22 Oct 2020 14:44:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbpm-0002js-FS
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c751f06c-a825-4d83-95a2-00f4c3714c9d;
 Thu, 22 Oct 2020 14:44:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpl-0002Jk-5b
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpl-0004Nf-4l
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbpm-0002js-FS
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:54 +0000
X-Inumbo-ID: c751f06c-a825-4d83-95a2-00f4c3714c9d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c751f06c-a825-4d83-95a2-00f4c3714c9d;
	Thu, 22 Oct 2020 14:44:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zI4ktAJkkZZU5Bm4GnnXDQl7ovHIXG/DaqLIdxu5hVY=; b=LIKTAebBwZZnYmlX66+NVvLBHO
	iJElD/Mse75mwHcSD3JPcjqFvdePVM34vS2AHWJ8Yc1B6qvLn9xXWHfnEXGqiZSb+AVXalgCRk8Se
	NHSqLZTL4aLyyzuls+V9IWWV+8VAFgeTF1OXYDVUDM+pw+vt4a0NDH78bPD0CFxiNwOM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpl-0002Jk-5b
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpl-0004Nf-4l
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:44:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kVbpl-0004Nf-4l@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:44:53 +0000

commit 7339975f552c99f74c73ee37073bac01a81825be
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:22 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:22 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 73f62c7380edf07469581a3049aba98abd63b275
    master date: 2020-10-20 14:22:26 +0200
---
 xen/drivers/passthrough/amd/iommu-defs.h    | 31 ++++++++++++++++-------------
 xen/drivers/passthrough/amd/iommu_map.c     | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  8 ++++----
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 15eedfb678..56f385f270 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -451,20 +451,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 93e96cd69c..d6334300ff 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -34,7 +34,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -48,7 +48,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -83,7 +83,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -174,7 +174,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -448,7 +448,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.root_table )
     {
@@ -479,7 +479,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 8d6309cc8c..a23027875b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -387,7 +387,7 @@ static void deallocate_next_page_table(struct page_info *pg, int level)
 
 static void deallocate_page_table(struct page_info *pg)
 {
-    struct amd_iommu_pte *table_vaddr;
+    union amd_iommu_pte *table_vaddr;
     unsigned int index, level = PFN_ORDER(pg);
 
     PFN_ORDER(pg) = 0;
@@ -402,7 +402,7 @@ static void deallocate_page_table(struct page_info *pg)
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( pde->mfn && pde->next_level && pde->pr )
         {
@@ -554,7 +554,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -570,7 +570,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10497.27904 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpy-0002lj-KR; Thu, 22 Oct 2020 14:45:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10497.27904; Thu, 22 Oct 2020 14:45:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbpy-0002lb-HH; Thu, 22 Oct 2020 14:45:06 +0000
Received: by outflank-mailman (input) for mailman id 10497;
 Thu, 22 Oct 2020 14:45:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbpw-0002lQ-Uq
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 93e051ef-0043-402f-8b9c-b554aac8ffad;
 Thu, 22 Oct 2020 14:45:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpv-0002KH-9M
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbpv-0004Pa-8G
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbpw-0002lQ-Uq
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:04 +0000
X-Inumbo-ID: 93e051ef-0043-402f-8b9c-b554aac8ffad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 93e051ef-0043-402f-8b9c-b554aac8ffad;
	Thu, 22 Oct 2020 14:45:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dTCwJxE3WlRufwy/obhWK6jpeWGm68yvwYWTXsUl4nE=; b=Bt4QkzBc/DhZbFTG9Jl8DnJuPI
	3yd1R34RX+S25xfu4wFXx+J1Ts33AbPPtTPFGij8cF0EyVjvxnQHanMMz6cp2jc7ZYViemfc7ocv+
	GJaadRVyjZXTBZxIPkaPnSlTwpAoLi71vd/Kk5VEP5AlPSoEv38Zgipd2KkXjsQjtzrI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpv-0002KH-9M
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbpv-0004Pa-8G
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kVbpv-0004Pa-8G@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:03 +0000

commit f7ab0c1a8ce47d6362134cc99354874bcad2fc12
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:41 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:41 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 3b055121c5410e2c3105d6d06aa24ca0d58868cd
    master date: 2020-10-20 14:22:52 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index d6334300ff..0f29b0b648 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -53,26 +53,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10498.27910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbq7-0002nB-M7; Thu, 22 Oct 2020 14:45:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10498.27910; Thu, 22 Oct 2020 14:45:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbq7-0002n0-Ik; Thu, 22 Oct 2020 14:45:15 +0000
Received: by outflank-mailman (input) for mailman id 10498;
 Thu, 22 Oct 2020 14:45:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbq6-0002mr-A3
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ed9d5cdd-1b3c-4aed-b76a-43a484b5c166;
 Thu, 22 Oct 2020 14:45:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbq5-0002KO-Dm
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbq5-0004Qx-C4
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbq6-0002mr-A3
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:14 +0000
X-Inumbo-ID: ed9d5cdd-1b3c-4aed-b76a-43a484b5c166
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ed9d5cdd-1b3c-4aed-b76a-43a484b5c166;
	Thu, 22 Oct 2020 14:45:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=td9U3/9kE683ZVs0As7fBvVtCqnmLDjDVk0nQSL7ljo=; b=TFg2Evj81unhyOJ+Lv3+63mIA7
	sN6LQz9mUn2V3lXIGEz2RwdNyEnUzCnRDwf4lEvnpqWhrN+qLroLEvWpFGIVUorPQGWgo2prlf7Sy
	jUMBv5fC7y0jzAirouG800OK4fuvv5E2dL/RHYnZ0AUPf9NW5IvAJdS52Tb5VMTqNRIg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbq5-0002KO-Dm
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbq5-0004Qx-C4
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kVbq5-0004Qx-C4@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:13 +0000

commit a279fcbb4f1a9c623dcb0a8f5d86c6a4123cf741
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:39:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:39:56 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
    master date: 2020-10-20 14:23:12 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 0f29b0b648..8924daef9b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -103,11 +103,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -130,6 +137,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index a23027875b..abf9395437 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -117,7 +117,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10500.27913 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqH-0002oc-NQ; Thu, 22 Oct 2020 14:45:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10500.27913; Thu, 22 Oct 2020 14:45:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqH-0002oU-KD; Thu, 22 Oct 2020 14:45:25 +0000
Received: by outflank-mailman (input) for mailman id 10500;
 Thu, 22 Oct 2020 14:45:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbqG-0002oG-Aa
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 66a6b803-6fa1-427f-b9f1-5e7ceb8b15b1;
 Thu, 22 Oct 2020 14:45:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqF-0002L3-Gy
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqF-0004SG-GF
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbqG-0002oG-Aa
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:24 +0000
X-Inumbo-ID: 66a6b803-6fa1-427f-b9f1-5e7ceb8b15b1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 66a6b803-6fa1-427f-b9f1-5e7ceb8b15b1;
	Thu, 22 Oct 2020 14:45:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1KnWPnRUoR3HZQ4tuY3vg7pi45yxGyV+gKJIFAWAkVA=; b=qw69cFJOCbiQvGp8P6XhY8W7u2
	/QZQsRzAb+fTNpam3JNq0UwmRf1wZBMl+La3idYDJAppNrazhPx5yGQdzDb7VEtCMIW9AwuZXp/G2
	xZLRGARXNfStcxWBTVPqF74Xe64sJuDEhOFrsORjYpubTr8LixLw2sHat/BARb5pfloU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqF-0002L3-Gy
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqF-0004SG-GF
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Don't clobber NT on return-to-guest
Message-Id: <E1kVbqF-0004SG-GF@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:23 +0000

commit 0974e0085d6de5ae2b60c831e04c07dd1f0f9ba2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:41:04 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:41:04 2020 +0200

    x86/pv: Don't clobber NT on return-to-guest
    
    A 64bit IRET can restore NT - the faulting case is when NT is set in the live
    flags.  This change had an unintended consequence of causing the NT flag to
    spontaneously disappear from guest context whenever a interrupt/exception
    occurred.
    
    In combination with a SYSENTER which sets both TF and NT, Xen's handling of
    the #DB exceptions clears NT before it is even recorded suitably in the guest
    kernel's view of what userspace was doing.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 5bcac985498ed83d89666959175ca9c9ed561ae1
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 xen/arch/x86/x86_64/entry.S        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 73619f57ca..3b2136b272 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -119,7 +119,7 @@ compat_process_trap:
 /* %rbx: struct vcpu, interrupts disabled */
 ENTRY(compat_restore_all_guest)
         ASSERT_INTERRUPTS_DISABLED
-        mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
+        mov   $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11d
         and   UREGS_eflags(%rsp),%r11d
 
 .macro alt_cr4_pv32
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 71a00e846b..7510212956 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -182,7 +182,7 @@ restore_all_guest:
         jz    iret_exit_to_guest
 
         movq  24(%rsp),%r11           # RFLAGS
-        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
+        andq  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), %r11
         orq   $X86_EFLAGS_IF,%r11
 
         /* Don't use SYSRET path if the return address is not canonical. */
@@ -213,7 +213,7 @@ restore_all_guest:
         movq  8(%rsp), %rcx           # RIP
 /* No special register assumptions. */
 iret_exit_to_guest:
-        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
+        andl  $~(X86_EFLAGS_IOPL | X86_EFLAGS_VM), 24(%rsp)
         orl   $X86_EFLAGS_IF,24(%rsp)
         addq  $8,%rsp
 .Lft0:  iretq
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10502.27917 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqS-0002qh-P3; Thu, 22 Oct 2020 14:45:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10502.27917; Thu, 22 Oct 2020 14:45:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqS-0002qY-Lu; Thu, 22 Oct 2020 14:45:36 +0000
Received: by outflank-mailman (input) for mailman id 10502;
 Thu, 22 Oct 2020 14:45:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbqQ-0002qM-QC
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c91a973a-5bfc-4cc1-9b1c-ed7f3555e2fa;
 Thu, 22 Oct 2020 14:45:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqP-0002LE-Kn
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqP-0004TU-Jf
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbqQ-0002qM-QC
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:34 +0000
X-Inumbo-ID: c91a973a-5bfc-4cc1-9b1c-ed7f3555e2fa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c91a973a-5bfc-4cc1-9b1c-ed7f3555e2fa;
	Thu, 22 Oct 2020 14:45:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ili3eUaZ7TSPWGstDtLBprTrVCHvQ15DQlgCz0sWtBc=; b=qvEXhDzYqbofZLCScvPze5j9br
	LkYcTYr7Sw/n4/+ad+/8Dy+9wblrtxg953lSK7cVI1leExGAkDrCDwQESQ3M2sChZkbAvfuRVtSh8
	UhCQK2xLDBMsV7UwBWKJCEn+Ay2jY+LIsjzJQooEZevSxNWxNoDvtWZAH5/KGFbgl/68=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqP-0002LE-Kn
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqP-0004TU-Jf
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Don't deliver #GP for a SYSENTER with NT set
Message-Id: <E1kVbqP-0004TU-Jf@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:33 +0000

commit 64c39517b5d2c2f324b87e7d663b184fca528d39
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:41:48 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:41:48 2020 +0200

    x86/pv: Don't deliver #GP for a SYSENTER with NT set
    
    It is a matter of guest kernel policy what to do with offending userspace, and
    terminating said userspace may not be the action chosen.
    
    Linux explicitly tolerates this case.
    
    Reported-by: Andy Lutomirski <luto@kernel.org>
    Fixes: fdac951560 ("x86: clear EFLAGS.NT in SYSENTER entry path")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 61d4a04349895edc5a5868274b906ba61ef24f47
    master date: 2020-09-24 21:02:35 +0100
---
 xen/arch/x86/x86_64/entry.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 7510212956..000eb9722b 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -313,7 +313,6 @@ UNLIKELY_START(nz, sysenter_nt_set)
         pushfq
         andl  $~X86_EFLAGS_NT,(%rsp)
         popfq
-        xorl  %eax,%eax
 UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10503.27921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqc-0002rw-RI; Thu, 22 Oct 2020 14:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10503.27921; Thu, 22 Oct 2020 14:45:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqc-0002ro-NT; Thu, 22 Oct 2020 14:45:46 +0000
Received: by outflank-mailman (input) for mailman id 10503;
 Thu, 22 Oct 2020 14:45:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbqa-0002rb-Lh
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b9c7c983-d42a-4176-99a7-966c838c5b5b;
 Thu, 22 Oct 2020 14:45:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqZ-0002LK-OT
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqZ-0004US-NY
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbqa-0002rb-Lh
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:44 +0000
X-Inumbo-ID: b9c7c983-d42a-4176-99a7-966c838c5b5b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b9c7c983-d42a-4176-99a7-966c838c5b5b;
	Thu, 22 Oct 2020 14:45:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gC73cw+NKp3NThmFEMuByXdpT6Ab3gPRuoSjVv0IJDs=; b=AR58DEtVXu5K91z9OSR0muVC60
	7G0BNhkBStViiEe6CmD8XyAaXJt48miapnDjsgpB6SbOYMkAo4ZigX2Qww8x2cM1iM1T7T8p51cOU
	6U5/AxYDDSbzS/HUHxIoc2404OSg+2nztEJAO9qH+bnvoFEKO1nlZgwn+B68Vna3U50M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqZ-0002LK-OT
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqZ-0004US-NY
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/S3: fix shadow stack resume path
Message-Id: <E1kVbqZ-0004US-NY@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:43 +0000

commit 0521dc918eb196b6479da35a4d0311d829fb0aca
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Tue Oct 20 14:42:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:42:16 2020 +0200

    x86/S3: fix shadow stack resume path
    
    Fix the resume path to load the shadow stack pointer from saved_ssp (not
    saved_rsp), to match what suspend path does.
    
    Fixes: 633ecc4a7cb2 ("x86/S3: Save and restore Shadow Stack configuration")
    Backport: 4.14
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4bdbf746ac9152e70f264f87db4472707da805ce
    master date: 2020-09-28 10:43:10 +0200
---
 xen/arch/x86/acpi/wakeup_prot.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index a2c41c4f3f..c6b3fcc93d 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -69,7 +69,7 @@ ENTRY(s3_resume)
          * so SETSSBSY will successfully load a value useful for us, then
          * reset MSR_PL0_SSP to its usual value and pop the temporary token.
          */
-        mov     saved_rsp(%rip), %rdi
+        mov     saved_ssp(%rip), %rdi
         cmpq    $1, %rdi
         je      .L_shstk_done
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:45:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10505.27924 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbql-0002tV-Tg; Thu, 22 Oct 2020 14:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10505.27924; Thu, 22 Oct 2020 14:45:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbql-0002tN-Qg; Thu, 22 Oct 2020 14:45:55 +0000
Received: by outflank-mailman (input) for mailman id 10505;
 Thu, 22 Oct 2020 14:45:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbqk-0002tE-R2
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3267a20f-f64d-414a-82a9-d6a7bc5c5f42;
 Thu, 22 Oct 2020 14:45:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqj-0002LS-Rp
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqj-0004VO-R0
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbqk-0002tE-R2
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:54 +0000
X-Inumbo-ID: 3267a20f-f64d-414a-82a9-d6a7bc5c5f42
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3267a20f-f64d-414a-82a9-d6a7bc5c5f42;
	Thu, 22 Oct 2020 14:45:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LJgNaVlxYnOBmdm/vZQqQSBoVmxYv2qnNqgbGFq04h4=; b=RdQ1c2zbBDYrOz+mSxd7OGRtyi
	mTOjcxhHs55HHLmwkYU74K3Qhbd0RGxHyinGiB32vVf7QMo5R9hIRyTH5jTnIVgukszh69shwAFzW
	1z/TAV653RPztt3gT89J/kMs72VXPVYIzp0V3IXgr4jE0nkDZg7HUTFPnGJebffmp7qs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqj-0002LS-Rp
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqj-0004VO-R0
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:45:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] evtchn/fifo: use stable fields when recording "last queue" information
Message-Id: <E1kVbqj-0004VO-R0@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:45:53 +0000

commit 8d148003fdf7bd9e28137e6683ef46902af39146
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:42:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:42:52 2020 +0200

    evtchn/fifo: use stable fields when recording "last queue" information
    
    Both evtchn->priority and evtchn->notify_vcpu_id could change behind the
    back of evtchn_fifo_set_pending(), as for it - in the case of
    interdomain channels - only the remote side's per-channel lock is held.
    Neither the queue's priority nor the vCPU's vcpu_id fields have similar
    properties, so they seem better suited for the purpose. In particular
    they reflect the respective evtchn fields' values at the time they were
    used to determine queue and vCPU.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    master commit: 6f6f07b64cbe90e54f8e62b4d6f2404cf5306536
    master date: 2020-10-02 08:37:35 +0200
---
 xen/common/event_fifo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 68d0c7a632..27ab3a1c3f 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -225,8 +225,8 @@ static void evtchn_fifo_set_pending(struct vcpu *v, struct evtchn *evtchn)
         /* Moved to a different queue? */
         if ( old_q != q )
         {
-            evtchn->last_vcpu_id = evtchn->notify_vcpu_id;
-            evtchn->last_priority = evtchn->priority;
+            evtchn->last_vcpu_id = v->vcpu_id;
+            evtchn->last_priority = q->priority;
 
             spin_unlock_irqrestore(&old_q->lock, flags);
             spin_lock_irqsave(&q->lock, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10506.27929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqv-0002up-VN; Thu, 22 Oct 2020 14:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10506.27929; Thu, 22 Oct 2020 14:46:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbqv-0002uh-SD; Thu, 22 Oct 2020 14:46:05 +0000
Received: by outflank-mailman (input) for mailman id 10506;
 Thu, 22 Oct 2020 14:46:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbqv-0002uU-0I
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e174a1c5-7e20-463b-9206-beb8013525ed;
 Thu, 22 Oct 2020 14:46:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqt-0002Lm-VH
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbqt-0004WU-UI
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbqv-0002uU-0I
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:05 +0000
X-Inumbo-ID: e174a1c5-7e20-463b-9206-beb8013525ed
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e174a1c5-7e20-463b-9206-beb8013525ed;
	Thu, 22 Oct 2020 14:46:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vsttxQGi9LY5jyIMUAijLUPyUvPTc09YxP29fSvL5xo=; b=gzT6NJQKdpAJGKAygolu649+LI
	q4/tJOfP49olaWr6JWNeERrTQ0YP0Tz5Rmsxehvp/rQXol3HyVWBXNsq/rPjm7qGWBUrWcm7MtVaW
	L0d9JblT6gjhowVjpv7vpBAz7vV5abVlNWKlJ+OMTA2XxSgmJ1xZKve51mn3cbeLrvpU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqt-0002Lm-VH
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbqt-0004WU-UI
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] xen/domain: check IOMMU options doesn't contain unknown bits set
Message-Id: <E1kVbqt-0004WU-UI@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:03 +0000

commit 829dbe2cfb84b05f278de93d83dff2473f543789
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Oct 20 14:43:16 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:43:16 2020 +0200

    xen/domain: check IOMMU options doesn't contain unknown bits set
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 59b27f360e3d9dc0378c1288e67a91fa41a77158
    master date: 2020-10-02 08:38:50 +0200
---
 xen/common/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index a275a35c4f..7bacf7cfed 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -310,6 +310,12 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
+    {
+        dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n", config->iommu_opts);
+        return -EINVAL;
+    }
+
     if ( !(config->flags & XEN_DOMCTL_CDF_iommu) && config->iommu_opts )
     {
         dprintk(XENLOG_INFO,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10507.27933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbr6-0002w0-0W; Thu, 22 Oct 2020 14:46:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10507.27933; Thu, 22 Oct 2020 14:46:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbr5-0002vs-Tn; Thu, 22 Oct 2020 14:46:15 +0000
Received: by outflank-mailman (input) for mailman id 10507;
 Thu, 22 Oct 2020 14:46:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbr4-0002vg-UM
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bed30c51-ea6a-4e44-886a-7104b6ac3687;
 Thu, 22 Oct 2020 14:46:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbr4-0002Lw-21
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbr4-0004XT-1K
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbr4-0002vg-UM
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
X-Inumbo-ID: bed30c51-ea6a-4e44-886a-7104b6ac3687
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bed30c51-ea6a-4e44-886a-7104b6ac3687;
	Thu, 22 Oct 2020 14:46:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m+40pcKm76viiCPj16HKCOZgG1YEs95M4BzGFp5eNmE=; b=NJi8E5EmbxqMu+5uAD4OBKAJhz
	2s+39fWw76fqv3sMx4B3IFoGlSvvKMJce5nCtmrUfdezCEeFv1s/6uQxR0pCnVRL+10Mfw7Ruvi5W
	FQ8ZXN5ZTjSf6pmeY3p/v+hIw6QgrYbCKPPN2KjVXu7OI0FkFWEVdmN+z8B4YOQPNY8I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbr4-0002Lw-21
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbr4-0004XT-1K
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/S3: Restore CR4 earlier during resume
Message-Id: <E1kVbr4-0004XT-1K@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:14 +0000

commit 9c1cc643ac3651950ec054a41c970e3fc6ee6da6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:43:40 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:43:40 2020 +0200

    x86/S3: Restore CR4 earlier during resume
    
    c/s 4304ff420e5 "x86/S3: Drop {save,restore}_rest_processor_state()
    completely" moved CR4 restoration up into C, to account for the fact that MCE
    was explicitly handled later.
    
    However, time_resume() ends up making an EFI Runtime Service call, and EFI
    explodes without OSFXSR, presumably when trying to spill %xmm registers onto
    the stack.
    
    Given this codepath, and the potential for other issues of a similar kind (TLB
    flushing vs INVPCID, HVM logic vs VMXE, etc), restore CR4 in asm before
    entering C.
    
    Ignore the previous MCE special case, because its not actually necessary.  The
    handler is already suitably configured from before suspend.
    
    Fixes: 4304ff420e5 ("x86/S3: Drop {save,restore}_rest_processor_state() completely")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    master commit: 7f66c0dc41ae5f770c614e516810eb1f336e2470
    master date: 2020-10-06 12:28:37 +0100
---
 xen/arch/x86/acpi/power.c       | 3 ---
 xen/arch/x86/acpi/wakeup_prot.S | 6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 4fb1e7a148..7f162a4df9 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -276,9 +276,6 @@ static int enter_state(u32 state)
 
     mcheck_init(&boot_cpu_data, false);
 
-    /* Restore CR4 from cached value, now MCE is set up. */
-    write_cr4(read_cr4());
-
     printk(XENLOG_INFO "Finishing wakeup from ACPI S%d state.\n", state);
 
     if ( (state == ACPI_STATE_S3) && error )
diff --git a/xen/arch/x86/acpi/wakeup_prot.S b/xen/arch/x86/acpi/wakeup_prot.S
index c6b3fcc93d..15052c300f 100644
--- a/xen/arch/x86/acpi/wakeup_prot.S
+++ b/xen/arch/x86/acpi/wakeup_prot.S
@@ -1,3 +1,4 @@
+#include <asm/asm_defns.h>
 #include <asm/msr-index.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -110,6 +111,11 @@ ENTRY(s3_resume)
 
         call    load_system_tables
 
+        /* Restore CR4 from the cpuinfo block. */
+        GET_STACK_END(bx)
+        mov     STACK_CPUINFO_FIELD(cr4)(%rbx), %rax
+        mov     %rax, %cr4
+
 .Lsuspend_err:
         pop     %r15
         pop     %r14
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10508.27937 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrG-0002xI-27; Thu, 22 Oct 2020 14:46:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10508.27937; Thu, 22 Oct 2020 14:46:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrF-0002xA-VY; Thu, 22 Oct 2020 14:46:25 +0000
Received: by outflank-mailman (input) for mailman id 10508;
 Thu, 22 Oct 2020 14:46:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbrF-0002wy-0x
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a21786d3-81f5-4fb4-847c-769322cfa78f;
 Thu, 22 Oct 2020 14:46:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrE-0002Mn-6I
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrE-0004YW-4O
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbrF-0002wy-0x
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:25 +0000
X-Inumbo-ID: a21786d3-81f5-4fb4-847c-769322cfa78f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a21786d3-81f5-4fb4-847c-769322cfa78f;
	Thu, 22 Oct 2020 14:46:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zo+WbXbaArGI1hBB1Ef2e5Te1CGVGLNdtQ3GUv42kAs=; b=dJP2oWfk3umZvTi++gTwmDoLO0
	Ce+DfivLU8fZB0/lkXPXf/68FLE7kf3cIU7ddEH6SCYWjp2GBa4usm1S+gXXLBBK+x0CquPNX2F1j
	DiIGns8Ha9f+5lCbtt+LFU2yvt/UUZU/EHr5vPIYg9fG1wmkhBRRpdszIFXm6o/epleA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrE-0002Mn-6I
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrE-0004YW-4O
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/vLAPIC: don't leak regs page from vlapic_init() upon error
Message-Id: <E1kVbrE-0004YW-4O@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:24 +0000

commit e9365151919c3b3ecdde6b43d31ad1e230c3342e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:44:02 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:02 2020 +0200

    x86/vLAPIC: don't leak regs page from vlapic_init() upon error
    
    Fixes: 8a981e0bf25e ("Make map_domain_page_global fail")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a62dee9ceff3056c7e0bd9632bac39bee2a51b3
    master date: 2020-10-09 17:20:11 +0100
---
 xen/arch/x86/hvm/vlapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 7b5c633033..30007a999e 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1629,6 +1629,7 @@ int vlapic_init(struct vcpu *v)
         vlapic->regs = __map_domain_page_global(vlapic->regs_page);
         if ( vlapic->regs == NULL )
         {
+            free_domheap_page(vlapic->regs_page);
             dprintk(XENLOG_ERR, "map vlapic regs error: %d/%d\n",
                     v->domain->domain_id, v->vcpu_id);
             return -ENOMEM;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10509.27941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrQ-0002zB-3e; Thu, 22 Oct 2020 14:46:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10509.27941; Thu, 22 Oct 2020 14:46:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrQ-0002z3-0k; Thu, 22 Oct 2020 14:46:36 +0000
Received: by outflank-mailman (input) for mailman id 10509;
 Thu, 22 Oct 2020 14:46:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbrP-0002yu-Am
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c4e1886c-d04d-4a95-90d4-9c0ddf7a9f5e;
 Thu, 22 Oct 2020 14:46:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrO-0002Mz-9d
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrO-0004ZN-8k
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbrP-0002yu-Am
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:35 +0000
X-Inumbo-ID: c4e1886c-d04d-4a95-90d4-9c0ddf7a9f5e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c4e1886c-d04d-4a95-90d4-9c0ddf7a9f5e;
	Thu, 22 Oct 2020 14:46:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8cZ2j5nNiv0oIBK87laMKsrqyGayKAhvP1WeBFDEqTE=; b=h7sJPSXMbPkJNbynH19v3ddPJa
	tfj5Q1y8pMOTcS2C4GNrOxu4w/06Z4tLaaIHWFFygpPcZ4IrYfGw1s6eZ8vOiJ/Khw/ls3Syum54I
	uiDaKWiu+r0EtaADp7v23aOBQ3dK0G3eB2f6EJu0L4sUXTfmqOymy//9T7NQ50bMERZ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrO-0002Mz-9d
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrO-0004ZN-8k
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86: fix resource leaks on arch_vcpu_create() error path
Message-Id: <E1kVbrO-0004ZN-8k@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:34 +0000

commit b081a5f14ccfe7609be63495efe8cb8c39cfb447
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:44:36 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:36 2020 +0200

    x86: fix resource leaks on arch_vcpu_create() error path
    
    {hvm,pv}_vcpu_initialise() have always kind of been meant to be the
    final possible source of errors in arch_vcpu_create(), hence not
    requiring any unrolling of what they've done on the error path. (Of
    course this may change once the various involved paths all have become
    idempotent.)
    
    But even beyond this aspect I think it is more logical to do policy
    initialization ahead of the calling of these two functions, as they may
    in principle want to access it.
    
    Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
    master date: 2020-10-14 14:03:38 +0200
---
 xen/arch/x86/domain.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b1c8644945..c830d1225c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -402,6 +402,9 @@ int arch_vcpu_create(struct vcpu *v)
         vmce_init_vcpu(v);
 
         arch_vcpu_regs_init(v);
+
+        if ( (rc = init_vcpu_msr_policy(v)) )
+            goto fail;
     }
     else if ( (rc = xstate_alloc_save_area(v)) != 0 )
         return rc;
@@ -427,9 +430,6 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        if ( (rc = init_vcpu_msr_policy(v)) )
-            goto fail;
-
         cpuid_policy_updated(v);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10510.27945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbra-00030W-5O; Thu, 22 Oct 2020 14:46:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10510.27945; Thu, 22 Oct 2020 14:46:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbra-00030M-2E; Thu, 22 Oct 2020 14:46:46 +0000
Received: by outflank-mailman (input) for mailman id 10510;
 Thu, 22 Oct 2020 14:46:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbrZ-00030C-DP
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6f73489e-86da-451d-a0e7-cdc14eac59c6;
 Thu, 22 Oct 2020 14:46:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrY-0002N9-Ch
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrY-0004aC-Bw
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbrZ-00030C-DP
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:45 +0000
X-Inumbo-ID: 6f73489e-86da-451d-a0e7-cdc14eac59c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6f73489e-86da-451d-a0e7-cdc14eac59c6;
	Thu, 22 Oct 2020 14:46:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Zeo7kWvqB7CaP689qkEJE0DQVFbWiX+PGxNB4P5oC1s=; b=MYWd4Np4cPGQmZSAML4iHuS1K3
	kQkcK0oGTHFDJuztialEDlDCZTpdsCXPXHE/NztOgZ9PEe1pol4V4MoPs7ulZgEeH/gO+xJUisbap
	dkDsQJK4bOHeQ2FSms5UdO6befuhUDAqt3JlCRNO2wSPuH+IvRMg4SZ84GPA4zfRmsso=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrY-0002N9-Ch
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrY-0004aC-Bw
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/mwait-idle: customize IceLake server support
Message-Id: <E1kVbrY-0004aC-Bw@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:44 +0000

commit d2ba323eaae06416728267344b55d345d1bd3b9b
Author:     Chen Yu <yu.c.chen@intel.com>
AuthorDate: Tue Oct 20 14:44:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:44:59 2020 +0200

    x86/mwait-idle: customize IceLake server support
    
    On ICX platform, the C1E auto-promotion is enabled by default.
    As a result, the CPU might fall into C1E more offen than previous
    platforms. So disable C1E auto-promotion and expose C1E as a separate
    idle state.
    
    Beside C1 and C1E, the exit latency of C6 was measured
    by a dedicated tool. However the exit latency(41us) exposed
    by _CST is much smaller than the one we measured(128us). This
    is probably due to the _CST uses the exit latency when woken
    up from PC0+C6, rather than PC6+C6 when C6 was measured. Choose
    the latter as we need the longest latency in theory.
    
    Signed-off-by: Chen Yu <yu.c.chen@intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    [Linux commit a472ad2bcea479ba068880125d7273fc95c14b70]
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 44ac57af81ff8097e228895738b911ca819bda19
    master date: 2020-10-15 12:29:11 +0200
---
 xen/arch/x86/cpu/mwait-idle.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 52eab81bf8..015bf83887 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -554,6 +554,28 @@ static const struct cpuidle_state skx_cstates[] = {
 	{}
 };
 
+static const struct cpuidle_state icx_cstates[] = {
+       {
+               .name = "C1-ICX",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 1,
+               .target_residency = 1,
+       },
+       {
+               .name = "C1E-ICX",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 4,
+               .target_residency = 4,
+       },
+       {
+               .name = "C6-ICX",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 128,
+               .target_residency = 384,
+       },
+       {}
+};
+
 static const struct cpuidle_state atom_cstates[] = {
 	{
 		.name = "C1E-ATM",
@@ -907,6 +929,11 @@ static const struct idle_cpu idle_cpu_skx = {
 	.disable_promotion_to_c1e = 1,
 };
 
+static const struct idle_cpu idle_cpu_icx = {
+       .state_table = icx_cstates,
+       .disable_promotion_to_c1e = 1,
+};
+
 static const struct idle_cpu idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.disable_promotion_to_c1e = 1,
@@ -961,6 +988,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconstrel = {
 	ICPU(0x8e, skl),
 	ICPU(0x9e, skl),
 	ICPU(0x55, skx),
+	ICPU(0x6a, icx),
 	ICPU(0x57, knl),
 	ICPU(0x85, knl),
 	ICPU(0x5c, bxt),
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:46:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:46:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10511.27949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrk-00031d-6r; Thu, 22 Oct 2020 14:46:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10511.27949; Thu, 22 Oct 2020 14:46:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrk-00031V-3j; Thu, 22 Oct 2020 14:46:56 +0000
Received: by outflank-mailman (input) for mailman id 10511;
 Thu, 22 Oct 2020 14:46:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbrj-00031N-Du
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8cafc1ef-7108-47de-aa04-1e9bb1dcf093;
 Thu, 22 Oct 2020 14:46:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbri-0002NF-Fs
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbri-0004at-F0
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbrj-00031N-Du
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:55 +0000
X-Inumbo-ID: 8cafc1ef-7108-47de-aa04-1e9bb1dcf093
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8cafc1ef-7108-47de-aa04-1e9bb1dcf093;
	Thu, 22 Oct 2020 14:46:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yOlBqq70rblpjj+sIqx20LIYGUFyRoP9Ch9jJjN6OqA=; b=ZlU6qc1dyQjTLFjJOI9xMNUVg2
	FslKqttO06b07ZpARctkOLI3Kc+eRQ883HEeaeF5JdfJeh+UQGPD0tLrD6ovCOC8sQAfWOC4sQsrz
	Br4GyOJhJ60OLJpcRj8OuqY7+hYH/Yw5Zt2ufAl93kFgzR2LnmjRwsc79a467vsyeg5A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbri-0002NF-Fs
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbri-0004at-F0
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:46:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/traps: 'Fix' safety of read_registers() in #DF path
Message-Id: <E1kVbri-0004at-F0@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:46:54 +0000

commit 4ba3fb0b4dd0089755a212b673932a8787fb8029
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:45:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:45:31 2020 +0200

    x86/traps: 'Fix' safety of read_registers() in #DF path
    
    All interrupts and exceptions pass a struct cpu_user_regs up into C.  This
    contains the legacy vm86 fields from 32bit days, which are beyond the
    hardware-pushed frame.
    
    Accessing these fields is generally illegal, as they are logically out of
    bounds for anything other than an interrupt/exception hitting ring1/3 code.
    
    show_registers() unconditionally reads these fields, but the content is
    discarded before use.  This is benign right now, as all parts of the stack are
    readable, including the guard pages.
    
    However, read_registers() in the #DF handler writes to these fields as part of
    preparing the state dump, and being IST, hits the adjacent stack frame.
    
    This has been broken forever, but c/s 6001660473 "x86/shstk: Rework the stack
    layout to support shadow stacks" repositioned the #DF stack to be adjacent to
    the guard page, which turns this OoB write into a fatal pagefault:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) ----[ Xen-4.15-unstable  x86_64  debug=y   Tainted:  C   ]----
      (XEN) CPU:    4
      (XEN) RIP:    e008:[<ffff82d04031fd4f>] traps.c#read_registers+0x29/0xc1
      (XEN) RFLAGS: 0000000000050086   CONTEXT: hypervisor (d1v0)
      ...
      (XEN) Xen call trace:
      (XEN)    [<ffff82d04031fd4f>] R traps.c#read_registers+0x29/0xc1
      (XEN)    [<ffff82d0403207b3>] F do_double_fault+0x3d/0x7e
      (XEN)    [<ffff82d04039acd7>] F double_fault+0x107/0x110
      (XEN)
      (XEN) Pagetable walk from ffff830236f6d008:
      (XEN)  L4[0x106] = 80000000bfa9b063 ffffffffffffffff
      (XEN)  L3[0x008] = 0000000236ffd063 ffffffffffffffff
      (XEN)  L2[0x1b7] = 0000000236ffc063 ffffffffffffffff
      (XEN)  L1[0x16d] = 8000000236f6d161 ffffffffffffffff
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 4:
      (XEN) FATAL PAGE FAULT
      (XEN) [error_code=0003]
      (XEN) Faulting linear address: ffff830236f6d008
      (XEN) ****************************************
      (XEN)
    
    and rendering the main #DF analysis broken.
    
    The proper fix is to delete cpu_user_regs.es and later, so no
    interrupt/exception path can access OoB, but this needs disentangling from the
    PV ABI first.
    
    Not-really-fixes: 6001660473 ("x86/shstk: Rework the stack layout to support shadow stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6065a05adf152a556fb9f11a5218c89e41b62893
    master date: 2020-10-16 11:55:33 +0100
---
 xen/arch/x86/cpu/common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index da74172776..a684519a20 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -770,7 +770,13 @@ void load_system_tables(void)
 	tss->ist[IST_MCE - 1] = stack_top + (1 + IST_MCE) * PAGE_SIZE;
 	tss->ist[IST_NMI - 1] = stack_top + (1 + IST_NMI) * PAGE_SIZE;
 	tss->ist[IST_DB  - 1] = stack_top + (1 + IST_DB)  * PAGE_SIZE;
-	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE;
+	/*
+	 * Gross bodge.  The #DF handler uses the vm86 fields of cpu_user_regs
+	 * beyond the hardware frame.  Adjust the stack entrypoint so this
+	 * doesn't manifest as an OoB write which hits the guard page.
+	 */
+	tss->ist[IST_DF  - 1] = stack_top + (1 + IST_DF)  * PAGE_SIZE -
+		(sizeof(struct cpu_user_regs) - offsetof(struct cpu_user_regs, es));
 	tss->bitmap = IOBMP_INVALID_OFFSET;
 
 	/* All other stack pointers poisioned. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:47:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:47:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10512.27953 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrv-00033G-9D; Thu, 22 Oct 2020 14:47:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10512.27953; Thu, 22 Oct 2020 14:47:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbrv-000338-6N; Thu, 22 Oct 2020 14:47:07 +0000
Received: by outflank-mailman (input) for mailman id 10512;
 Thu, 22 Oct 2020 14:47:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbru-00032y-2l
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f48fa328-46c9-40bc-a7ed-adea1389eb3e;
 Thu, 22 Oct 2020 14:47:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrs-0002Ne-Jg
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbrs-0004bo-IU
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbru-00032y-2l
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:06 +0000
X-Inumbo-ID: f48fa328-46c9-40bc-a7ed-adea1389eb3e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f48fa328-46c9-40bc-a7ed-adea1389eb3e;
	Thu, 22 Oct 2020 14:47:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zIVMcIcMv4l9TuomZw0dDmE3hn4/8NKZqZS7yotfH48=; b=rqTd4FxGR2y6uvVKSZFMPbs+BI
	Ab9ymScCH2XC9uFGQ+jH4vF7a5WbtOwoyWkkNhK+pZpuIZtfw9s3V7GbDaIf6YAjf2ltRw+XKmcSh
	qMVgjcqCTUhv9IdTpg81iz4g/WoRaF52DsafJbLqJ9i8/OG9X+rFhX12k7xjGdHNekEU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrs-0002Ne-Jg
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbrs-0004bo-IU
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
Message-Id: <E1kVbrs-0004bo-IU@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:47:04 +0000

commit ee47e8e8d9248678d1f638c6b6ec6174dbc9117b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Oct 20 14:45:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:45:56 2020 +0200

    x86/smpboot: Don't unconditionally call memguard_guard_stack() in cpu_smpboot_alloc()
    
    cpu_smpboot_alloc() is designed to be idempotent with respect to partially
    initialised state.  This occurs for S3 and CPU parking, where enough state to
    handle NMIs/#MCs needs to remain valid for the entire lifetime of Xen, even
    when we otherwise want to offline the CPU.
    
    For simplicity between various configuration, Xen always uses shadow stack
    mappings (Read-only + Dirty) for the guard page, irrespective of whether
    CET-SS is enabled.
    
    Unfortunately, the CET-SS changes in memguard_guard_stack() broke idempotency
    by first writing out the supervisor shadow stack tokens with plain writes,
    then changing the mapping to being read-only.
    
    This ordering is strictly necessary to configure the BSP, which cannot have
    the supervisor tokens be written with WRSS.
    
    Instead of calling memguard_guard_stack() unconditionally, call it only when
    actually allocating a new stack.  Xenheap allocates are guaranteed to be
    writeable, and the net result is idempotency WRT configuring stack_base[].
    
    Fixes: 91d26ed304f ("x86/shstk: Create shadow stacks")
    Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: a7952a320c1e202a218702bfdb14f75132f04894
    master date: 2020-10-16 11:56:59 +0100
---
 xen/arch/x86/smpboot.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 5708573c41..67e727cebd 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -997,16 +997,18 @@ static int cpu_smpboot_alloc(unsigned int cpu)
         memflags = MEMF_node(node);
 
     if ( stack_base[cpu] == NULL )
+    {
         stack_base[cpu] = alloc_xenheap_pages(STACK_ORDER, memflags);
-    if ( stack_base[cpu] == NULL )
-        goto out;
+        if ( !stack_base[cpu] )
+            goto out;
+
+        memguard_guard_stack(stack_base[cpu]);
+    }
 
     info = get_cpu_info_from_stack((unsigned long)stack_base[cpu]);
     info->processor_id = cpu;
     info->per_cpu_offset = __per_cpu_offset[cpu];
 
-    memguard_guard_stack(stack_base[cpu]);
-
     gdt = per_cpu(gdt, cpu) ?: alloc_xenheap_pages(0, memflags);
     if ( gdt == NULL )
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 14:47:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 14:47:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10513.27957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbs5-00034a-B6; Thu, 22 Oct 2020 14:47:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10513.27957; Thu, 22 Oct 2020 14:47:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVbs5-00034Q-7r; Thu, 22 Oct 2020 14:47:17 +0000
Received: by outflank-mailman (input) for mailman id 10513;
 Thu, 22 Oct 2020 14:47:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVbs4-00034G-2s
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cc768bcd-10da-4e31-92d5-175685afe8a5;
 Thu, 22 Oct 2020 14:47:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbs2-0002Nk-Mr
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVbs2-0004d3-M3
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVbs4-00034G-2s
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:16 +0000
X-Inumbo-ID: cc768bcd-10da-4e31-92d5-175685afe8a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cc768bcd-10da-4e31-92d5-175685afe8a5;
	Thu, 22 Oct 2020 14:47:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rGmM7Zo9ErJxJlDNdpY0IjiSgHC7TlT/0mr9mcF45hw=; b=aZREvWZYm1xa4GD50lK40Wqbke
	/JKcX0fVk4jeeHBD1dxc4KVmfwIX1Pau28lzA+zJjiOv+WmuxofaoTg3Q3aH9G+CecZoL1TkupsDf
	flsw2L+kTnXTVvMrriKOPexfQvb/UN/8rCmhH+pOUUwnETHzAEgnzcQXDqxfkcIFKO+8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbs2-0002Nk-Mr
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVbs2-0004d3-M3
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 14:47:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kVbs2-0004d3-M3@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 14:47:14 +0000

commit 7b1e587f25c2dda38236e48aae81729798f10663
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 14:46:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:46:20 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: de6d188a519f9e3b7a1acc7784adf4c243865f9a
    master date: 2020-10-20 08:54:23 +0200
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 22 18:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Oct 2020 18:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10636.28378 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVfZI-0004GV-2S; Thu, 22 Oct 2020 18:44:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10636.28378; Thu, 22 Oct 2020 18:44:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVfZH-0004GN-VW; Thu, 22 Oct 2020 18:44:07 +0000
Received: by outflank-mailman (input) for mailman id 10636;
 Thu, 22 Oct 2020 18:44:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVfZF-0004GF-Rq
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id edc7c543-8a85-47ed-a5b2-f2934cc30abe;
 Thu, 22 Oct 2020 18:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVfZE-0007vE-SB
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVfZE-0006JV-QI
 for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Hfqi=D5=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVfZF-0004GF-Rq
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:05 +0000
X-Inumbo-ID: edc7c543-8a85-47ed-a5b2-f2934cc30abe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id edc7c543-8a85-47ed-a5b2-f2934cc30abe;
	Thu, 22 Oct 2020 18:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tn/vthH+4kEmy351SaOAgoip37H2W7HfUsSLnPZopxA=; b=wNZDKr4FkXiUMCkxYHZOaBetq6
	PM3TnXLGPgsBWsv2p4WvWqiiUklf2joJ0aqm+oUmCi5iaw6UCT8hZpzTxjPoXcUXorNGRXiD9fPv9
	UgCXKZA9O83JhMv2LByambi4b6eJPeor1kIW4ly5BRUWWXntfJWCm84X3E57z5/2mKQM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVfZE-0007vE-SB
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVfZE-0006JV-QI
	for xen-changelog@lists.xenproject.org; Thu, 22 Oct 2020 18:44:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: acpi: Don't fail if SPCR table is absent
Message-Id: <E1kVfZE-0006JV-QI@xenbits.xenproject.org>
Date: Thu, 22 Oct 2020 18:44:04 +0000

commit 861f0c110976fa8879b7bf63d9478b6be83d4ab6
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Wed Oct 21 15:12:53 2020 -0700
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Oct 22 19:41:51 2020 +0100

    xen/arm: acpi: Don't fail if SPCR table is absent
    
    Absence of a SPCR table likely means the console is a framebuffer.  In
    such case acpi_iomem_deny_access() should NOT fail.
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/acpi/domain_build.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 1b1cfabb00..bbdc90f92c 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -42,17 +42,18 @@ static int __init acpi_iomem_deny_access(struct domain *d)
     status = acpi_get_table(ACPI_SIG_SPCR, 0,
                             (struct acpi_table_header **)&spcr);
 
-    if ( ACPI_FAILURE(status) )
+    if ( ACPI_SUCCESS(status) )
     {
-        printk("Failed to get SPCR table\n");
-        return -EINVAL;
+        mfn = spcr->serial_port.address >> PAGE_SHIFT;
+        /* Deny MMIO access for UART */
+        rc = iomem_deny_access(d, mfn, mfn + 1);
+        if ( rc )
+            return rc;
+    }
+    else
+    {
+        printk("Failed to get SPCR table, Xen console may be unavailable\n");
     }
-
-    mfn = spcr->serial_port.address >> PAGE_SHIFT;
-    /* Deny MMIO access for UART */
-    rc = iomem_deny_access(d, mfn, mfn + 1);
-    if ( rc )
-        return rc;
 
     /* Deny MMIO access for GIC regions */
     return gic_iomem_deny_access(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10756.28664 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsKu-0004Yl-EE; Fri, 23 Oct 2020 08:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10756.28664; Fri, 23 Oct 2020 08:22:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsKu-0004Ye-BD; Fri, 23 Oct 2020 08:22:08 +0000
Received: by outflank-mailman (input) for mailman id 10756;
 Fri, 23 Oct 2020 08:22:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsKt-0004YX-BJ
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e7e0efdf-390f-4880-be9c-0cf25c831269;
 Fri, 23 Oct 2020 08:22:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsKs-0005wO-5F
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsKs-0005Ir-35
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsKt-0004YX-BJ
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:07 +0000
X-Inumbo-ID: e7e0efdf-390f-4880-be9c-0cf25c831269
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e7e0efdf-390f-4880-be9c-0cf25c831269;
	Fri, 23 Oct 2020 08:22:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3dX9zXVlSxWXQTFYjW1yTSp4H3V2uvqfwxqhk2KHBuA=; b=gVGB22tczTgHfsoEKZZBg//sz1
	TZC3qe08P+GClfyMkGSH8SEqcnSwCURDo2znp37BmBPMsaxmGItz0RrW8owskI1VL9F9GgtJzvAyt
	AzoK9LIm0cXPZejnuaaVIso/jglxn06c84znFp/9TXEkq2uI5G/UayvBshqb73+fY1K4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsKs-0005wO-5F
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsKs-0005Ir-35
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn
Message-Id: <E1kVsKs-0005Ir-35@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:06 +0000

commit ba45ae4d7f3a93ee7297d24bb03a564146d321c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:05:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:05:29 2020 +0200

    x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn
    
    In this case up to now we've been freeing the page (through
    guest_remove_page(), with the actual free typically happening at the
    put_page() later in the function), but then failing the call on the
    subsequent GFN consistency check. However, in my opinion such a request
    should complete as an "expensive" no-op (leaving aside the potential
    unsharing of the page).
    
    This points out that f33d653f46f5 ("x86: replace bad ASSERT() in
    xenmem_add_to_physmap_one()" would really have needed an XSA, despite
    its description claiming otherwise, as in release builds we then put in
    place a P2M entry referencing the about to be freed page.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 918ee2bbe3..6d2262a3f0 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4599,7 +4599,7 @@ int xenmem_add_to_physmap_one(
         if ( is_special_page(mfn_to_page(prev_mfn)) )
             /* Special pages are simply unhooked from this phys slot. */
             rc = guest_physmap_remove_page(d, gpfn, prev_mfn, PAGE_ORDER_4K);
-        else
+        else if ( !mfn_eq(mfn, prev_mfn) )
             /* Normal domain memory is freed, to avoid leaking memory. */
             rc = guest_remove_page(d, gfn_x(gpfn));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10757.28667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsL4-0004Zj-Fu; Fri, 23 Oct 2020 08:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10757.28667; Fri, 23 Oct 2020 08:22:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsL4-0004Zc-D2; Fri, 23 Oct 2020 08:22:18 +0000
Received: by outflank-mailman (input) for mailman id 10757;
 Fri, 23 Oct 2020 08:22:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsL3-0004ZT-7D
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6c7d934a-803d-4be4-a1dc-2e9feca95691;
 Fri, 23 Oct 2020 08:22:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsL2-0005wT-AD
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsL2-0005Jg-7d
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsL3-0004ZT-7D
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:17 +0000
X-Inumbo-ID: 6c7d934a-803d-4be4-a1dc-2e9feca95691
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6c7d934a-803d-4be4-a1dc-2e9feca95691;
	Fri, 23 Oct 2020 08:22:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ICwrC+iCJ6+l5prv9MLEoWHR27JW6YlW7y1zQt3o8yE=; b=B7M/1Am/hTiUzclsh4gb0pMmeA
	7fL8dIFcWFYZzqK/wBGKK72UQcHmfCSGj1HkTNHUCedYT/nIpXYSmjdHKf42qMxpATploEtP3ye/d
	TaTsnuKprcww6RlVyI9m8JoChkGTgVtm2CvbblRu6RlV1Ywh5euyHBaCLaaxSxp2jL5I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsL2-0005wT-AD
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsL2-0005Jg-7d
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: avoid playing with directmap when self-snoop can be relied upon
Message-Id: <E1kVsL2-0005Jg-7d@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:16 +0000

commit f9c53bd9eeff5d93e63665d67265dd27155e905e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:06:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:06:20 2020 +0200

    x86/mm: avoid playing with directmap when self-snoop can be relied upon
    
    The set of systems affected by XSA-345 would have been smaller is we had
    this in place already: When the processor is capable of dealing with
    mismatched cacheability, there's no extra work we need to carry out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6d2262a3f0..b2f35b3e7d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -795,6 +795,9 @@ static int update_xen_mappings(unsigned long mfn, unsigned int cacheattr)
     unsigned long xen_va =
         XEN_VIRT_START + ((mfn - PFN_DOWN(xen_phys_start)) << PAGE_SHIFT);
 
+    if ( boot_cpu_has(X86_FEATURE_XEN_SELFSNOOP) )
+        return 0;
+
     if ( unlikely(alias) && cacheattr )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, 0);
     if ( !err )
@@ -802,6 +805,7 @@ static int update_xen_mappings(unsigned long mfn, unsigned int cacheattr)
                      PAGE_HYPERVISOR | cacheattr_to_pte_flags(cacheattr));
     if ( unlikely(alias) && !cacheattr && !err )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, PAGE_HYPERVISOR);
+
     return err;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10758.28672 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLE-0004b5-He; Fri, 23 Oct 2020 08:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10758.28672; Fri, 23 Oct 2020 08:22:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLE-0004ax-Eh; Fri, 23 Oct 2020 08:22:28 +0000
Received: by outflank-mailman (input) for mailman id 10758;
 Fri, 23 Oct 2020 08:22:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsLD-0004am-8k
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b4446cfc-ebb6-410a-ac1b-095c7e71b3e9;
 Fri, 23 Oct 2020 08:22:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLC-0005wi-De
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLC-0005KY-Cm
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsLD-0004am-8k
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:27 +0000
X-Inumbo-ID: b4446cfc-ebb6-410a-ac1b-095c7e71b3e9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b4446cfc-ebb6-410a-ac1b-095c7e71b3e9;
	Fri, 23 Oct 2020 08:22:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cgbQiq36XZhooXy8AdB1LsXHSO1J0XXbHi8ymqfjhjQ=; b=Hh59XzjWmqanHL9UE6z6uWxmqd
	bPjfXG+ydMnXmWE+jf0VG1CZ619NtI1ObEg3/p+ZFkAYOJJu+w3gx2YVFDFVng6h8/Il5JfzwWuG2
	FoN9jhb5JDTDIdUJVaOMMU0Oi6/x81ZyrPnkwgSTk0zIFfwK8xKAp4ZoRPLSZJ9fV+f8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLC-0005wi-De
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLC-0005KY-Cm
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] IOMMU/EPT: avoid double flushing in shared page table case
Message-Id: <E1kVsLC-0005KY-Cm@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:26 +0000

commit 83432adeb82122e392a3bfc2a8818d25ca9e69ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:06:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:06:53 2020 +0200

    IOMMU/EPT: avoid double flushing in shared page table case
    
    While the flush coalescing optimization has been helping the non-shared
    case, it has actually lead to double flushes in the shared case (which
    ought to be the more common one nowadays at least): Once from
    *_set_entry() and a second time up the call tree from wherever the
    overriding flag gets played with. In alignment with XSA-346 suppress
    flushing in this case.
    
    Similarly avoid excessive setting of IOMMU_FLUSHF_added on the batched
    flushes: "idx" hasn't been added a new mapping for.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/mm/p2m-ept.c | 2 +-
 xen/common/memory.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 12cf38f6eb..476458b1e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -842,7 +842,7 @@ out:
     if ( rc == 0 && p2m_is_hostp2m(p2m) &&
          need_modify_vtd_table )
     {
-        if ( iommu_use_hap_pt(d) )
+        if ( iommu_use_hap_pt(d) && !this_cpu(iommu_dont_flush_iotlb) )
             rc = iommu_iotlb_flush(d, _dfn(gfn), 1ul << order,
                                    (iommu_flags ? IOMMU_FLUSHF_added : 0) |
                                    (vtd_pte_present ? IOMMU_FLUSHF_modified
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7075e233aa..df85b550a1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -870,7 +870,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
         ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
-                                IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
+                                IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10759.28675 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLO-0004ci-Jr; Fri, 23 Oct 2020 08:22:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10759.28675; Fri, 23 Oct 2020 08:22:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLO-0004cZ-GH; Fri, 23 Oct 2020 08:22:38 +0000
Received: by outflank-mailman (input) for mailman id 10759;
 Fri, 23 Oct 2020 08:22:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsLN-0004cQ-Qz
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a687a3c9-ba37-4ff4-b6c5-fac9d5b2a767;
 Fri, 23 Oct 2020 08:22:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLM-0005yL-Gs
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLM-0005Ms-Fs
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsLN-0004cQ-Qz
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:37 +0000
X-Inumbo-ID: a687a3c9-ba37-4ff4-b6c5-fac9d5b2a767
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a687a3c9-ba37-4ff4-b6c5-fac9d5b2a767;
	Fri, 23 Oct 2020 08:22:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=irpiIbF7e+v+D9miSmBgQ1rrO/GsZO1rjiTiuUwTqjY=; b=7AaTyvdyA+/LhAXlyZjxR0Girt
	LO9NDkgGsvx5P1gX+jJNgzv5VuuBNs1O6tz0FuUNattM46REyQUDOMBsvSwbixl1OfPVbvK5N/9vW
	i883kMCxzKGkbd5VgxCrCOQQM3AKnpGiqNVbnDYLCzkPRj3ziujrA+CNDw85dsekoqd4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLM-0005yL-Gs
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLM-0005Ms-Fs
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: avoid race in get_xen_consumer()
Message-Id: <E1kVsLM-0005Ms-Fs@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:36 +0000

commit dcbd1d8ae527f3632eb9a2804ad03e0451918b62
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:07:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:07:56 2020 +0200

    evtchn: avoid race in get_xen_consumer()
    
    There's no global lock around the updating of this global piece of data.
    Make use of cmpxchgptr() to avoid two entities racing with their
    updates.
    
    While touching the functionality, mark xen_consumers[] read-mostly (or
    else the if() condition could use the result of cmpxchgptr(), writing to
    the slot unconditionally).
    
    The use of cmpxchgptr() here points out (by way of clang warning about
    it) that its original use of const was slightly wrong. Adjust the
    placement, or else undefined behavior of const qualifying a function
    type will result.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_channel.c   |  6 ++++--
 xen/include/asm-x86/system.h |  7 -------
 xen/include/xen/lib.h        | 11 +++++++++++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index e365b5498f..091afa8bf5 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -57,7 +57,8 @@
  * with a pointer, we stash them dynamically in a small lookup array which
  * can be indexed by a small integer.
  */
-static xen_event_channel_notification_t xen_consumers[NR_XEN_CONSUMERS];
+static xen_event_channel_notification_t __read_mostly
+    xen_consumers[NR_XEN_CONSUMERS];
 
 /* Default notification action: wake up from wait_on_xen_event_channel(). */
 static void default_xen_notification_fn(struct vcpu *v, unsigned int port)
@@ -80,8 +81,9 @@ static uint8_t get_xen_consumer(xen_event_channel_notification_t fn)
 
     for ( i = 0; i < ARRAY_SIZE(xen_consumers); i++ )
     {
+        /* Use cmpxchgptr() in lieu of a global lock. */
         if ( xen_consumers[i] == NULL )
-            xen_consumers[i] = fn;
+            cmpxchgptr(&xen_consumers[i], NULL, fn);
         if ( xen_consumers[i] == fn )
             break;
     }
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 630909965e..65e63de69a 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -148,13 +148,6 @@ static always_inline unsigned long cmpxchg_local_(
     return prev;
 }
 
-#define cmpxchgptr(ptr,o,n) ({                                          \
-    const __typeof__(**(ptr)) *__o = (o);                               \
-    __typeof__(**(ptr)) *__n = (n);                                     \
-    ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)__o,            \
-                                   (unsigned long)__n,sizeof(*(ptr)))); \
-})
-
 /*
  * Undefined symbol to cause link failure if a wrong size is used with
  * arch_fetch_and_add().
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 076bcfb67d..1983bd6b86 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -178,6 +178,17 @@ unsigned long long parse_size_and_unit(const char *s, const char **ps);
 
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
+/*
+ * A slightly more typesafe variant of cmpxchg() when the entities dealt with
+ * are pointers.
+ */
+#define cmpxchgptr(ptr, o, n) ({                                        \
+    __typeof__(**(ptr)) *const o_ = (o);                                \
+    __typeof__(**(ptr)) *n_ = (n);                                      \
+    ((__typeof__(*(ptr)))__cmpxchg(ptr, (unsigned long)o_,              \
+                                   (unsigned long)n_, sizeof(*(ptr)))); \
+})
+
 #define TAINT_SYNC_CONSOLE              (1u << 0)
 #define TAINT_MACHINE_CHECK             (1u << 1)
 #define TAINT_ERROR_INJECT              (1u << 2)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10760.28679 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLY-0004eJ-MK; Fri, 23 Oct 2020 08:22:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10760.28679; Fri, 23 Oct 2020 08:22:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLY-0004eB-JQ; Fri, 23 Oct 2020 08:22:48 +0000
Received: by outflank-mailman (input) for mailman id 10760;
 Fri, 23 Oct 2020 08:22:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsLX-0004e3-P2
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fdbd74ce-a990-478a-a187-84af1eebdef9;
 Fri, 23 Oct 2020 08:22:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLW-0005yT-KZ
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLW-0005Nn-JQ
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsLX-0004e3-P2
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:47 +0000
X-Inumbo-ID: fdbd74ce-a990-478a-a187-84af1eebdef9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fdbd74ce-a990-478a-a187-84af1eebdef9;
	Fri, 23 Oct 2020 08:22:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gvDRTbXFV+xJdFwqFANq+sCyHyFimwM+MoqcfCg0r/s=; b=5X/LjKiRmxWlnA8ZGfDdagpVAn
	yNvFWj8H2e3bQbWIqRGnW2uB55qZObI+a3c+gtIn25Za2P8BEDg4NQRwQfKyXj4cUed+FSdmiBkLc
	a4O3XesqAkTDrVMyv0ofEkTXMPsxzPbm2laNSHUJ8R6VshYCScp6vJwrCXMBqLtUZjGI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLW-0005yT-KZ
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLW-0005Nn-JQ
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: replace FIFO-specific header by generic private one
Message-Id: <E1kVsLW-0005Nn-JQ@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:46 +0000

commit 5bc84281a902eeea0d8f2eb8297790174cab6ac8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:09:55 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:09:55 2020 +0200

    evtchn: replace FIFO-specific header by generic private one
    
    Having a FIFO specific header is not (or at least no longer) warranted
    with just three function declarations left there. Introduce a private
    header instead, moving there some further items from xen/event.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_2l.c        |  3 ++-
 xen/common/event_channel.c   |  4 +--
 xen/common/event_channel.h   | 63 ++++++++++++++++++++++++++++++++++++++++++++
 xen/common/event_fifo.c      |  4 +--
 xen/include/xen/event.h      | 39 ---------------------------
 xen/include/xen/event_fifo.h | 26 ------------------
 6 files changed, 69 insertions(+), 70 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index 083d04be3c..7424320e52 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -7,11 +7,12 @@
  * Version 2 or later.  See the file COPYING for more details.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
 
 #include <asm/guest_atomics.h>
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 091afa8bf5..8578af5f6b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -14,17 +14,17 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
 #include <xen/irq.h>
 #include <xen/iocap.h>
 #include <xen/compat.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
-#include <xen/event_fifo.h>
 #include <asm/current.h>
 
 #include <public/xen.h>
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
new file mode 100644
index 0000000000..45219ca67c
--- /dev/null
+++ b/xen/common/event_channel.h
@@ -0,0 +1,63 @@
+/* Event channel handling private header. */
+
+#include <xen/event.h>
+
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_busy &&
+           d->evtchn_port_ops->is_busy(d, evtchn);
+}
+
+static inline void evtchn_port_unmask(struct domain *d,
+                                      struct evtchn *evtchn)
+{
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
+}
+
+static inline int evtchn_port_set_priority(struct domain *d,
+                                           struct evtchn *evtchn,
+                                           unsigned int priority)
+{
+    if ( !d->evtchn_port_ops->set_priority )
+        return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
+    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
+}
+
+static inline void evtchn_port_print_state(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->print_state(d, evtchn);
+}
+
+/* 2-level */
+
+void evtchn_2l_init(struct domain *d);
+
+/* FIFO */
+
+struct evtchn_init_control;
+struct evtchn_expand_array;
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
+void evtchn_fifo_destroy(struct domain *d);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index fc189152e1..c6e58d2a1a 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -7,12 +7,12 @@
  * Version 2 or later.  See the file COPYING for more details.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
-#include <xen/event_fifo.h>
 #include <xen/paging.h>
 #include <xen/mm.h>
 #include <xen/domain_page.h>
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 509d3ae861..6df989b51b 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,12 +105,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
-static inline unsigned int max_evtchns(const struct domain *d)
-{
-    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
-                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
-}
-
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
@@ -176,8 +170,6 @@ static bool evtchn_usable(const struct evtchn *evtchn)
 
 void evtchn_check_pollers(struct domain *d, unsigned int port);
 
-void evtchn_2l_init(struct domain *d);
-
 /* Close all event channels and reset to 2-level ABI. */
 int evtchn_reset(struct domain *d, bool resuming);
 
@@ -227,13 +219,6 @@ static inline void evtchn_port_clear_pending(struct domain *d,
         d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
-static inline void evtchn_port_unmask(struct domain *d,
-                                      struct evtchn *evtchn)
-{
-    if ( evtchn_usable(evtchn) )
-        d->evtchn_port_ops->unmask(d, evtchn);
-}
-
 static inline bool evtchn_is_pending(const struct domain *d,
                                      const struct evtchn *evtchn)
 {
@@ -259,13 +244,6 @@ static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
     return rc;
 }
 
-static inline bool evtchn_is_busy(const struct domain *d,
-                                  const struct evtchn *evtchn)
-{
-    return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, evtchn);
-}
-
 /* Returns negative errno, zero for not pending, or positive for pending. */
 static inline int evtchn_port_poll(struct domain *d, evtchn_port_t port)
 {
@@ -285,21 +263,4 @@ static inline int evtchn_port_poll(struct domain *d, evtchn_port_t port)
     return rc;
 }
 
-static inline int evtchn_port_set_priority(struct domain *d,
-                                           struct evtchn *evtchn,
-                                           unsigned int priority)
-{
-    if ( !d->evtchn_port_ops->set_priority )
-        return -ENOSYS;
-    if ( !evtchn_usable(evtchn) )
-        return -EACCES;
-    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
-}
-
-static inline void evtchn_port_print_state(struct domain *d,
-                                           const struct evtchn *evtchn)
-{
-    d->evtchn_port_ops->print_state(d, evtchn);
-}
-
 #endif /* __XEN_EVENT_H__ */
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
deleted file mode 100644
index 0fec3d5316..0000000000
--- a/xen/include/xen/event_fifo.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * FIFO-based event channel ABI.
- *
- * Copyright (C) 2013 Citrix Systems R&D Ltd.
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2 or later.  See the file COPYING for more details.
- */
-#ifndef __XEN_EVENT_FIFO_H__
-#define __XEN_EVENT_FIFO_H__
-
-int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
-int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
-void evtchn_fifo_destroy(struct domain *domain);
-
-#endif /* __XEN_EVENT_FIFO_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:22:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:22:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10761.28683 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLi-0004hg-Nv; Fri, 23 Oct 2020 08:22:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10761.28683; Fri, 23 Oct 2020 08:22:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLi-0004hZ-L6; Fri, 23 Oct 2020 08:22:58 +0000
Received: by outflank-mailman (input) for mailman id 10761;
 Fri, 23 Oct 2020 08:22:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsLh-0004gc-Bw
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6721573d-5017-421d-84d7-7fa033f67658;
 Fri, 23 Oct 2020 08:22:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLg-0005zD-O5
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLg-0005Oq-Mp
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsLh-0004gc-Bw
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:57 +0000
X-Inumbo-ID: 6721573d-5017-421d-84d7-7fa033f67658
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6721573d-5017-421d-84d7-7fa033f67658;
	Fri, 23 Oct 2020 08:22:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z2kwZhc0nYejdBCDiJnkqAocRl8mjrQtzbHB885O78Q=; b=IRIXf/47gth9ayfnj2tJBq9pSn
	+c5CLCkHOS7gRo6Wavv1je/TwxpxEFDiGT8wkZuAUNszVpbaBslaUj7fub7se7dY1Jb51JUa6ENAR
	4CxkSnoWnq7keSdx+yemdPDEH7pLIsf/X0kTS2X4LueTs8EpuwIi4FEfMDCccy5dhc2I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLg-0005zD-O5
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLg-0005Oq-Mp
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:22:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: rename and adjust guest_enabled_event()
Message-Id: <E1kVsLg-0005Oq-Mp@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:22:56 +0000

commit 451a9098608976ec164307a80eef40a2186fd5b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:11:46 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:11:46 2020 +0200

    evtchn: rename and adjust guest_enabled_event()
    
    The function isn't about an "event" in general, but about a vIRQ. The
    function also failed to honor global vIRQ-s, instead assuming the caller
    would pass vCPU 0 in such a case.
    
    While at it also adjust the
    - types the function uses,
    - single user to make use of domain_vcpu().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mcheck/vmce.h |  6 +++---
 xen/common/event_channel.c     | 10 ++++++++--
 xen/include/xen/event.h        |  4 ++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.h b/xen/arch/x86/cpu/mcheck/vmce.h
index 2797e00275..2e9b32a9bd 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.h
+++ b/xen/arch/x86/cpu/mcheck/vmce.h
@@ -5,9 +5,9 @@
 
 int vmce_init(struct cpuinfo_x86 *c);
 
-#define dom0_vmce_enabled() (hardware_domain && hardware_domain->max_vcpus \
-        && hardware_domain->vcpu[0] \
-        && guest_enabled_event(hardware_domain->vcpu[0], VIRQ_MCA))
+#define dom0_vmce_enabled() \
+    (hardware_domain && \
+     evtchn_virq_enabled(domain_vcpu(hardware_domain, 0), VIRQ_MCA))
 
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 8578af5f6b..37d0b75384 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -778,9 +778,15 @@ out:
     return ret;
 }
 
-int guest_enabled_event(struct vcpu *v, uint32_t virq)
+bool evtchn_virq_enabled(const struct vcpu *v, unsigned int virq)
 {
-    return ((v != NULL) && (v->virq_to_evtchn[virq] != 0));
+    if ( !v )
+        return false;
+
+    if ( virq_is_global(virq) && v->vcpu_id )
+        v = domain_vcpu(v->domain, 0);
+
+    return v->virq_to_evtchn[virq];
 }
 
 void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6df989b51b..2ed4be78f6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -85,8 +85,8 @@ int alloc_unbound_xen_event_channel(
     xen_event_channel_notification_t notification_fn);
 void free_xen_event_channel(struct domain *d, int port);
 
-/* Query if event channel is in use by the guest */
-int guest_enabled_event(struct vcpu *v, uint32_t virq);
+/* Query whether a vIRQ is in use by the guest. */
+bool evtchn_virq_enabled(const struct vcpu *v, unsigned int virq);
 
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:23:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:23:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10762.28687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLs-0004j6-Pl; Fri, 23 Oct 2020 08:23:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10762.28687; Fri, 23 Oct 2020 08:23:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsLs-0004iy-Mm; Fri, 23 Oct 2020 08:23:08 +0000
Received: by outflank-mailman (input) for mailman id 10762;
 Fri, 23 Oct 2020 08:23:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsLr-0004io-Q3
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ada6d0c7-fc0d-4d0f-9728-f3cdea908b81;
 Fri, 23 Oct 2020 08:23:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLr-0005za-4l
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsLq-0005Ph-QH
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsLr-0004io-Q3
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
X-Inumbo-ID: ada6d0c7-fc0d-4d0f-9728-f3cdea908b81
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ada6d0c7-fc0d-4d0f-9728-f3cdea908b81;
	Fri, 23 Oct 2020 08:23:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qyfrAV6Hvk76WRD/QWxk+y/8ux/SX5KpfHKz86et9+Y=; b=Hzw66dORV7BF4VTf5NvKXv7JyR
	XnD6WpupbH4+4i/wNaHUmDBQz0AHtJ2KHC6j5hhjhBG6kqh4TAGbS7v8x1uh5BUm3Szm1LCjvRrMt
	FN4L6SF53ea7Fr4+qEiKUWgMrfHh99mO2nPW9bmNjKpo+JKJr8poheJWdDNyLa7HTTmg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLr-0005za-4l
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsLq-0005Ph-QH
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] evtchn: let evtchn_set_priority() acquire the per-channel lock
Message-Id: <E1kVsLq-0005Ph-QH@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:23:06 +0000

commit b76c3a1b878b1897b7166a46a8cb341ef6dfa854
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:12:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:12:31 2020 +0200

    evtchn: let evtchn_set_priority() acquire the per-channel lock
    
    Some lock wants to be held to make sure the port doesn't change state,
    but there's no point holding the per-domain event lock here. Switch to
    using the finer grained per-channel lock instead (albeit as a downside
    for the time being this requires disabling interrupts for a short
    period of time).
    
    FAOD this doesn't guarantee anything towards in particular
    evtchn_fifo_set_pending(), as for interdomain channels that function
    would be called with the remote side's per-channel lock held.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_channel.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37d0b75384..cd4a2c0501 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1154,20 +1154,17 @@ static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
 {
     struct domain *d = current->domain;
     unsigned int port = set_priority->port;
+    struct evtchn *chn;
     long ret;
-
-    spin_lock(&d->event_lock);
+    unsigned long flags;
 
     if ( !port_is_valid(d, port) )
-    {
-        spin_unlock(&d->event_lock);
         return -EINVAL;
-    }
 
-    ret = evtchn_port_set_priority(d, evtchn_from_port(d, port),
-                                   set_priority->priority);
-
-    spin_unlock(&d->event_lock);
+    chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
+    ret = evtchn_port_set_priority(d, chn, set_priority->priority);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:23:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:23:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10763.28692 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsM3-0004qL-RX; Fri, 23 Oct 2020 08:23:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10763.28692; Fri, 23 Oct 2020 08:23:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsM3-0004qD-OQ; Fri, 23 Oct 2020 08:23:19 +0000
Received: by outflank-mailman (input) for mailman id 10763;
 Fri, 23 Oct 2020 08:23:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsM2-0004q3-3T
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d9344f31-8480-4d40-a0d8-099434519bd2;
 Fri, 23 Oct 2020 08:23:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsM1-0005zh-7l
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsM1-0005Qf-73
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsM2-0004q3-3T
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:18 +0000
X-Inumbo-ID: d9344f31-8480-4d40-a0d8-099434519bd2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d9344f31-8480-4d40-a0d8-099434519bd2;
	Fri, 23 Oct 2020 08:23:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y1Ev7ErlkhTPtL0WDe5kZCza63Lfzqu5o6s4j7mQ9rc=; b=gCv5ZYb9iO19RGTLk7d4O1JoEn
	WUMdUeFecjjsFdFotxT+pRpI3YY5vD7QP1kIg1KitvobbbMgcMhP9PYRUflQMfYvo4G8dmywBNzOg
	XIoA9MUWPFG9tFWDbVByIeh5rECb6tuoff1H1OODLliW229Pr8R/lAST8rAITQ8eBCCY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsM1-0005zh-7l
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsM1-0005Qf-73
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] pci: cleanup MSI interrupts before removing device from IOMMU
Message-Id: <E1kVsM1-0005Qf-73@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:23:17 +0000

commit 710f62cc826bb8c7ead99f9d6b6b269e39ff3e98
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Oct 23 10:13:14 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:13:14 2020 +0200

    pci: cleanup MSI interrupts before removing device from IOMMU
    
    Doing the MSI cleanup after removing the device from the IOMMU leads
    to the following panic on AMD hardware:
    
    Assertion 'table.ptr && (index < intremap_table_entries(table.ptr, iommu))' failed at iommu_intr.c:172
    ----[ Xen-4.13.1-10.0.3-d  x86_64  debug=y   Not tainted ]----
    CPU:    3
    RIP:    e008:[<ffff82d08026ae3c>] drivers/passthrough/amd/iommu_intr.c#get_intremap_entry+0x52/0x7b
    [...]
    Xen call trace:
       [<ffff82d08026ae3c>] R drivers/passthrough/amd/iommu_intr.c#get_intremap_entry+0x52/0x7b
       [<ffff82d08026af25>] F drivers/passthrough/amd/iommu_intr.c#update_intremap_entry_from_msi_msg+0xc0/0x342
       [<ffff82d08026ba65>] F amd_iommu_msi_msg_update_ire+0x98/0x129
       [<ffff82d08025dd36>] F iommu_update_ire_from_msi+0x1e/0x21
       [<ffff82d080286862>] F msi_free_irq+0x55/0x1a0
       [<ffff82d080286f25>] F pci_cleanup_msi+0x8c/0xb0
       [<ffff82d08025cf52>] F pci_remove_device+0x1af/0x2da
       [<ffff82d0802a42d1>] F do_physdev_op+0xd18/0x1187
       [<ffff82d080383925>] F pv_hypercall+0x1f5/0x567
       [<ffff82d08038a432>] F lstar_enter+0x112/0x120
    
    That's because the call to iommu_remove_device on AMD hardware will
    remove the per-device interrupt remapping table, and hence the call to
    pci_cleanup_msi done afterwards will find a null intremap table and
    crash.
    
    Reorder the calls so that MSI interrupts are torn down before removing
    the device from the IOMMU.
    
    Fixes: d7cfeb7c13ed ("AMD/IOMMU: don't blindly allocate interrupt remapping tables")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index b035067975..2a3bce1462 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -834,10 +834,10 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
         if ( pdev->bus == bus && pdev->devfn == devfn )
         {
+            pci_cleanup_msi(pdev);
             ret = iommu_remove_device(pdev);
             if ( pdev->domain )
                 list_del(&pdev->domain_list);
-            pci_cleanup_msi(pdev);
             printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
             free_pdev(pseg, pdev);
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 08:23:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 08:23:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10764.28696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsMC-0004rS-T4; Fri, 23 Oct 2020 08:23:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10764.28696; Fri, 23 Oct 2020 08:23:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVsMC-0004rK-Q5; Fri, 23 Oct 2020 08:23:28 +0000
Received: by outflank-mailman (input) for mailman id 10764;
 Fri, 23 Oct 2020 08:23:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVsMB-0004rE-Ua
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1c95c37e-05ae-46dc-abee-84a030b30d80;
 Fri, 23 Oct 2020 08:23:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsMB-0005zs-Ag
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVsMB-0005RW-9y
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVsMB-0004rE-Ua
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
X-Inumbo-ID: 1c95c37e-05ae-46dc-abee-84a030b30d80
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1c95c37e-05ae-46dc-abee-84a030b30d80;
	Fri, 23 Oct 2020 08:23:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rPW3JsRuJca7Sr5y/4ZLcfgbxYM/WQYr52WvKFQRieA=; b=nS7OAS4zo7o9FFXXCSgSie0t5/
	zcng6uADVXxLUkRV4BznM813hqzoAUoog4WwkPn2UnqnjWM7E9JIBjoR94j4LrbrdIC2TPi9jtIkH
	SBXQfxQ6h5vscqiUbFfZhEzfzKb7Xydxr2fUY2u5TJhc/9HKC5YtHb0aPMCXMCvmu1Bo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsMB-0005zs-Ag
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVsMB-0005RW-9y
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 08:23:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: increase FPU save area in test harness/fuzzer
Message-Id: <E1kVsMB-0005RW-9y@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 08:23:27 +0000

commit 6ca70821b59849ad97c3fadc47e63c1a4af1a78c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:13:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:13:53 2020 +0200

    x86emul: increase FPU save area in test harness/fuzzer
    
    Running them on a system (or emulator) with AMX support requires this
    to be quite a bit larger than 8k, to avoid triggering the assert() in
    emul_test_init(). Bump all the way up to 16k right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/x86-emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/x86-emulate.c b/tools/tests/x86_emulator/x86-emulate.c
index 572989078a..fb34933e82 100644
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -33,7 +33,7 @@
 uint32_t mxcsr_mask = 0x0000ffbf;
 struct cpuid_policy cp;
 
-static char fpu_save_area[4096] __attribute__((__aligned__((64))));
+static char fpu_save_area[0x4000] __attribute__((__aligned__((64))));
 static bool use_xsave;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 13:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 13:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10992.29178 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxBs-0004qk-0K; Fri, 23 Oct 2020 13:33:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10992.29178; Fri, 23 Oct 2020 13:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxBr-0004qc-TU; Fri, 23 Oct 2020 13:33:07 +0000
Received: by outflank-mailman (input) for mailman id 10992;
 Fri, 23 Oct 2020 13:33:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVxBr-0004qX-4b
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ae30e8af-4316-40ec-938c-0b1e04f953c2;
 Fri, 23 Oct 2020 13:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxBp-00045A-9Y
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxBp-0006FC-7e
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVxBr-0004qX-4b
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:07 +0000
X-Inumbo-ID: ae30e8af-4316-40ec-938c-0b1e04f953c2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ae30e8af-4316-40ec-938c-0b1e04f953c2;
	Fri, 23 Oct 2020 13:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zvfr99KCEchgXhwqlpUIZxHhHiBpCiNLX6RrqoTtFkw=; b=gqwvn0uaj6uL5Tg7MHymfW+Kpc
	KYIUBr1aEn0Y5hSkYr6gdY7AnqwOhLZ2Wi1FFQ95LpJgJfvE3cyQco+UuE7x2qv1VwylFwV1DZJjf
	uKZqDy/Kfzzii9G5h1kcu6kPc7kfwKAMgRfJRjIvG4GU5RNqK0Yvs6QONgchHztflEvQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxBp-00045A-9Y
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxBp-0006FC-7e
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] maintainers: fix libxl paths
Message-Id: <E1kVxBp-0006FC-7e@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 13:33:05 +0000

commit 032a96e5ef38f96eccfebbf8a0dbd83dc7beb625
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 9 13:59:43 2020 +0200
Commit:     Ian Jackson <ian.jackson@eu.citrix.com>
CommitDate: Fri Oct 23 14:29:53 2020 +0100

    maintainers: fix libxl paths
    
    Fix the paths of libxl in the MAINTAINERS file.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 26c5382075..482407b049 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -357,7 +357,8 @@ M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 M:	Anthony PERARD <anthony.perard@citrix.com>
 S:	Supported
-F:	tools/libxl/
+F:	tools/libs/guest/
+F:	tools/libs/light/
 F:	tools/xl/
 
 LIVEPATCH
@@ -428,9 +429,9 @@ M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 M:	Yang Hongyang <imhy.yang@gmail.com>
 S:	Maintained
 F:	docs/README.remus
-F:	tools/libxl/libxl_remus_*
-F:	tools/libxl/libxl_netbuffer.c
-F:	tools/libxl/libxl_nonetbuffer.c
+F:	tools/libs/light/libxl_remus_*
+F:	tools/libs/light/libxl_netbuffer.c
+F:	tools/libs/light/libxl_nonetbuffer.c
 F:	tools/hotplug/Linux/remus-netbuf-setup
 F:	tools/hotplug/Linux/block-drbd-probe
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 13:33:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 13:33:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.10993.29181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxC2-0004xn-1z; Fri, 23 Oct 2020 13:33:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 10993.29181; Fri, 23 Oct 2020 13:33:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxC1-0004xf-VC; Fri, 23 Oct 2020 13:33:17 +0000
Received: by outflank-mailman (input) for mailman id 10993;
 Fri, 23 Oct 2020 13:33:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVxC0-0004xZ-QM
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8d00de7f-6902-4c46-a140-130ceac04159;
 Fri, 23 Oct 2020 13:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxBz-00045D-Dp
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxBz-0006Fs-Bi
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVxC0-0004xZ-QM
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:16 +0000
X-Inumbo-ID: 8d00de7f-6902-4c46-a140-130ceac04159
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8d00de7f-6902-4c46-a140-130ceac04159;
	Fri, 23 Oct 2020 13:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PFpG9O387nQ7+dxxkUQIP8OAT7AO39UswWSxzyvpmwI=; b=OYMRMb4oIZSU6OQfYXtbDsZ1D4
	q8ZcAXHsHfzKcq0UsdOMP7KePFsy2vaVsUlQ8n51m+hk9FEsScQwKLDT3H05h97yMHpN91+RiTAT3
	UwDbolN4qpws0SeaJPH8DiHAUK/dWue12x1uLYmBfJrDSpf1sZL1xN3PgWAI+owaFRaw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxBz-00045D-Dp
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxBz-0006Fs-Bi
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 13:33:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] maintainers: remove unreachable remus maintainer
Message-Id: <E1kVxBz-0006Fs-Bi@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 13:33:15 +0000

commit 70cf8e9acada638f68c1c597d7580500d9f21c91
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 9 13:59:44 2020 +0200
Commit:     Ian Jackson <ian.jackson@eu.citrix.com>
CommitDate: Fri Oct 23 14:29:58 2020 +0100

    maintainers: remove unreachable remus maintainer
    
    The mails for Yang Hongyang are bouncing, remove him from MAINTAINERS
    file.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 482407b049..dab38a6a14 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -426,7 +426,6 @@ T:	git https://xenbits.xenproject.org/git-http/qemu-xen.git
 
 REMUS
 M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
-M:	Yang Hongyang <imhy.yang@gmail.com>
 S:	Maintained
 F:	docs/README.remus
 F:	tools/libs/light/libxl_remus_*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:11:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11006.29213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxmi-0000S0-Er; Fri, 23 Oct 2020 14:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11006.29213; Fri, 23 Oct 2020 14:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxmi-0000Rt-Bs; Fri, 23 Oct 2020 14:11:12 +0000
Received: by outflank-mailman (input) for mailman id 11006;
 Fri, 23 Oct 2020 14:11:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVxmg-0000Ro-Lw
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bc8514ea-8023-44d3-80b5-53b5cd43abad;
 Fri, 23 Oct 2020 14:11:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmc-0004vB-Me
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmc-0000tx-LM
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVxmg-0000Ro-Lw
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:10 +0000
X-Inumbo-ID: bc8514ea-8023-44d3-80b5-53b5cd43abad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bc8514ea-8023-44d3-80b5-53b5cd43abad;
	Fri, 23 Oct 2020 14:11:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vu/fQmmwzZ7YFCLnoVHsaaKDJxCgwWu1uJ1l5sqvTp8=; b=L3weO1+fx/HkoRBtoFxFswjFh2
	vAackHKXG1wanLsc3EV+SvEFSO0tCFWy4X9Rbvrcv+8Atgxp4bMQMyJyvVq1ZOldL7uy3Lmh41qTq
	DNe0gM5abCpPiLIJGOlnoqWEFm/mL/v4H9O/3VabMotuaHZNdke+xCnrlY7SRlouQXsM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmc-0004vB-Me
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmc-0000tx-LM
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/init-xenstore-domain: add logging
Message-Id: <E1kVxmc-0000tx-LM@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:11:06 +0000

commit 56c1aca6a2bc013f45e7af2fa88605a693402770
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:53:09 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:52 2020 +0200

    tools/init-xenstore-domain: add logging
    
    Add a possibility to do logging in init-xenstore-domain: use -v[...]
    for selecting the log-level as in xl, log to stderr.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/init-xenstore-domain.c | 51 ++++++++++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index bcaa0e6fa9..2a7d3c9599 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -10,6 +10,7 @@
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xenstore.h>
+#include <xentoollog.h>
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
 #include <xen/io/xenbus.h>
@@ -36,6 +37,7 @@ static struct option options[] = {
     { "param", 1, NULL, 'p' },
     { "name", 1, NULL, 'n' },
     { "maxmem", 1, NULL, 'M' },
+    { "verbose", 0, NULL, 'v' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -57,7 +59,8 @@ static void usage(void)
 "  --maxmem <max size>        maximum memory size in the format:\n"
 "                             <MB val>|<a>/<b>|<MB val>:<a>/<b>\n"
 "                             (an absolute value in MB, a fraction a/b of\n"
-"                             the host memory, or the maximum of both)\n");
+"                             the host memory, or the maximum of both)\n"
+"  -v[v[v]]                   verbosity of domain building\n");
 }
 
 static int build(xc_interface *xch)
@@ -349,8 +352,10 @@ int main(int argc, char** argv)
     char buf[16], be_path[64], fe_path[64];
     int rv, fd;
     char *maxmem_str = NULL;
+    xentoollog_level minmsglevel = XTL_PROGRESS;
+    xentoollog_logger *logger = NULL;
 
-    while ( (opt = getopt_long(argc, argv, "", options, NULL)) != -1 )
+    while ( (opt = getopt_long(argc, argv, "v", options, NULL)) != -1 )
     {
         switch ( opt )
         {
@@ -375,6 +380,10 @@ int main(int argc, char** argv)
         case 'M':
             maxmem_str = optarg;
             break;
+        case 'v':
+            if ( minmsglevel )
+                minmsglevel--;
+            break;
         default:
             usage();
             return 2;
@@ -387,11 +396,15 @@ int main(int argc, char** argv)
         return 2;
     }
 
-    xch = xc_interface_open(NULL, NULL, 0);
+    logger = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr,
+                                                               minmsglevel, 0);
+
+    xch = xc_interface_open(logger, logger, 0);
     if ( !xch )
     {
         fprintf(stderr, "xc_interface_open() failed\n");
-        return 1;
+        rv = 1;
+        goto out;
     }
 
     if ( maxmem_str )
@@ -400,7 +413,8 @@ int main(int argc, char** argv)
         if ( maxmem < 0 )
         {
             xc_interface_close(xch);
-            return 1;
+            rv = 1;
+            goto out;
         }
     }
 
@@ -414,17 +428,24 @@ int main(int argc, char** argv)
     xc_interface_close(xch);
 
     if ( rv )
-        return 1;
+    {
+        rv = 1;
+        goto out;
+    }
 
     rv = gen_stub_json_config(domid, NULL);
     if ( rv )
-        return 3;
+    {
+        rv = 3;
+        goto out;
+    }
 
     xsh = xs_open(0);
     if ( !xsh )
     {
         fprintf(stderr, "xs_open() failed.\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
     snprintf(buf, 16, "%d", domid);
     do_xs_write(xsh, "/tool/xenstored/domid", buf);
@@ -460,7 +481,8 @@ int main(int argc, char** argv)
     if ( fd < 0 )
     {
         fprintf(stderr, "Creating " XEN_RUN_DIR "/xenstored.pid failed\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
     rv = snprintf(buf, 16, "domid:%d\n", domid);
     rv = write(fd, buf, rv);
@@ -469,10 +491,17 @@ int main(int argc, char** argv)
     {
         fprintf(stderr,
                 "Writing domid to " XEN_RUN_DIR "/xenstored.pid failed\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
 
-    return 0;
+    rv = 0;
+
+ out:
+    if ( logger )
+        xtl_logger_destroy(logger);
+
+    return rv;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:11:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:11:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11007.29217 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxmq-0000Sr-Gd; Fri, 23 Oct 2020 14:11:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11007.29217; Fri, 23 Oct 2020 14:11:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxmq-0000Sj-DW; Fri, 23 Oct 2020 14:11:20 +0000
Received: by outflank-mailman (input) for mailman id 11007;
 Fri, 23 Oct 2020 14:11:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVxmo-0000Sa-F7
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 52a9daf5-fc43-47cc-b099-903903f56443;
 Fri, 23 Oct 2020 14:11:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmm-0004vE-Tf
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmm-0000uw-Qa
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVxmo-0000Sa-F7
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:18 +0000
X-Inumbo-ID: 52a9daf5-fc43-47cc-b099-903903f56443
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 52a9daf5-fc43-47cc-b099-903903f56443;
	Fri, 23 Oct 2020 14:11:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Pu+l/AQcXqTFYryEIgTpVaKGpiox0tGkAKG5Q1wbdkk=; b=vDtC1DshpgrSGqHf5+xsFXbWNO
	PTWPfmRo2VMgc3my2T8KWEJOK3YilLJ73bmfpnzjri0hMgsHr+8PA3NlpWEzt7Rgx9Yuor/6F2Bm5
	pEBEUXNHe768R+WA+jaUFQylc9ToybTCtnQrvk/n5fx6CE7YrcQ1xylon5qQHxawpgQs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmm-0004vE-Tf
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmm-0000uw-Qa
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/init-xenstore-domain: support xenstore pvh stubdom
Message-Id: <E1kVxmm-0000uw-Qa@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:11:16 +0000

commit f89955449c5a47ff688e91873bbce4c3670ed9fe
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:53:10 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:54 2020 +0200

    tools/init-xenstore-domain: support xenstore pvh stubdom
    
    Instead of creating the xenstore-stubdom domain first and parsing the
    kernel later do it the other way round. This enables to probe for the
    domain type supported by the xenstore-stubdom and to support both, pv
    and pvh type stubdoms.
    
    Try to parse the stubdom image first for PV support, if this fails use
    HVM. Then create the domain with the appropriate type selected.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/init-xenstore-domain.c | 119 +++++++++++++++++++++++++----------
 1 file changed, 85 insertions(+), 34 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 2a7d3c9599..6836002f0b 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -18,6 +18,10 @@
 #include "init-dom-json.h"
 #include "_paths.h"
 
+#define LAPIC_BASE_ADDRESS  0xfee00000UL
+#define MB(x)               ((uint64_t)x << 20)
+#define GB(x)               ((uint64_t)x << 30)
+
 static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
@@ -69,6 +73,8 @@ static int build(xc_interface *xch)
     int rv, xs_fd;
     struct xc_dom_image *dom = NULL;
     int limit_kb = (maxmem ? : (memory + 1)) * 1024;
+    uint64_t mem_size = MB(memory);
+    struct e820entry e820[3];
     struct xen_domctl_createdomain config = {
         .ssidref = SECINITSID_DOMU,
         .flags = XEN_DOMCTL_CDF_xs_domain,
@@ -101,6 +107,66 @@ static int build(xc_interface *xch)
         }
     }
 
+    dom = xc_dom_allocate(xch, NULL, NULL);
+    if ( !dom )
+    {
+        fprintf(stderr, "xc_dom_allocate failed\n");
+        rv = -1;
+        goto err;
+    }
+
+    rv = xc_dom_kernel_file(dom, kernel);
+    if ( rv )
+    {
+        fprintf(stderr, "xc_dom_kernel_file failed\n");
+        goto err;
+    }
+
+    if ( ramdisk )
+    {
+        rv = xc_dom_module_file(dom, ramdisk, NULL);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_dom_module_file failed\n");
+            goto err;
+        }
+    }
+
+    dom->container_type = XC_DOM_HVM_CONTAINER;
+    rv = xc_dom_parse_image(dom);
+    if ( rv )
+    {
+        dom->container_type = XC_DOM_PV_CONTAINER;
+        rv = xc_dom_parse_image(dom);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_dom_parse_image failed\n");
+            goto err;
+        }
+    }
+    else
+    {
+        config.flags |= XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap;
+        config.arch.emulation_flags = XEN_X86_EMU_LAPIC;
+        dom->target_pages = mem_size >> XC_PAGE_SHIFT;
+        dom->mmio_size = GB(4) - LAPIC_BASE_ADDRESS;
+        dom->lowmem_end = (mem_size > LAPIC_BASE_ADDRESS) ?
+                          LAPIC_BASE_ADDRESS : mem_size;
+        dom->highmem_end = (mem_size > LAPIC_BASE_ADDRESS) ?
+                           GB(4) + mem_size - LAPIC_BASE_ADDRESS : 0;
+        dom->mmio_start = LAPIC_BASE_ADDRESS;
+        dom->max_vcpus = 1;
+        e820[0].addr = 0;
+        e820[0].size = dom->lowmem_end;
+        e820[0].type = E820_RAM;
+        e820[1].addr = LAPIC_BASE_ADDRESS;
+        e820[1].size = dom->mmio_size;
+        e820[1].type = E820_RESERVED;
+        e820[2].addr = GB(4);
+        e820[2].size = dom->highmem_end - GB(4);
+        e820[2].type = E820_RAM;
+    }
+
     rv = xc_domain_create(xch, &domid, &config);
     if ( rv )
     {
@@ -125,11 +191,15 @@ static int build(xc_interface *xch)
         fprintf(stderr, "xc_evtchn_alloc_unbound failed\n");
         goto err;
     }
-    rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-    if ( rv )
+
+    if ( dom->container_type == XC_DOM_PV_CONTAINER )
     {
-        fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
-        goto err;
+        rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
+            goto err;
+        }
     }
 
     rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
@@ -144,45 +214,16 @@ static int build(xc_interface *xch)
     else
         snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
-    dom = xc_dom_allocate(xch, cmdline, NULL);
-    if ( !dom )
-    {
-        fprintf(stderr, "xc_dom_allocate failed\n");
-        goto err;
-    }
-    dom->container_type = XC_DOM_PV_CONTAINER;
+    dom->cmdline = xc_dom_strdup(dom, cmdline);
     dom->xenstore_domid = domid;
     dom->console_evtchn = console_evtchn;
 
-    rv = xc_dom_kernel_file(dom, kernel);
-    if ( rv )
-    {
-        fprintf(stderr, "xc_dom_kernel_file failed\n");
-        goto err;
-    }
-
-    if ( ramdisk )
-    {
-        rv = xc_dom_module_file(dom, ramdisk, NULL);
-        if ( rv )
-        {
-            fprintf(stderr, "xc_dom_module_file failed\n");
-            goto err;
-        }
-    }
-
     rv = xc_dom_boot_xen_init(dom, xch, domid);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_boot_xen_init failed\n");
         goto err;
     }
-    rv = xc_dom_parse_image(dom);
-    if ( rv )
-    {
-        fprintf(stderr, "xc_dom_parse_image failed\n");
-        goto err;
-    }
     rv = xc_dom_mem_init(dom, memory);
     if ( rv )
     {
@@ -195,6 +236,16 @@ static int build(xc_interface *xch)
         fprintf(stderr, "xc_dom_boot_mem_init failed\n");
         goto err;
     }
+    if ( dom->container_type == XC_DOM_HVM_CONTAINER )
+    {
+        rv = xc_domain_set_memory_map(xch, domid, e820,
+                                      dom->highmem_end ? 3 : 2);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_domain_set_memory_map failed\n");
+            goto err;
+        }
+    }
     rv = xc_dom_build_image(dom);
     if ( rv )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:11:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11008.29221 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxn0-0000U9-J5; Fri, 23 Oct 2020 14:11:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11008.29221; Fri, 23 Oct 2020 14:11:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVxn0-0000U0-F9; Fri, 23 Oct 2020 14:11:30 +0000
Received: by outflank-mailman (input) for mailman id 11008;
 Fri, 23 Oct 2020 14:11:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVxmy-0000To-QY
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 02849cf3-2bc2-4ed0-a81d-147e5fa7e3c6;
 Fri, 23 Oct 2020 14:11:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmx-0004vP-2f
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVxmx-0000vl-0f
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVxmy-0000To-QY
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:28 +0000
X-Inumbo-ID: 02849cf3-2bc2-4ed0-a81d-147e5fa7e3c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 02849cf3-2bc2-4ed0-a81d-147e5fa7e3c6;
	Fri, 23 Oct 2020 14:11:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rkmJGpueK+h/8aOPLp/vzCS4Vkaszk7M1PEJ73RxK0Q=; b=6vEP+DeBu3u5mCPM480O5i6CII
	bgHpk1K5kZ3BTUI3WolOykL8ElrWJQMF4779nrytMv1vVs8KEXUWU3xHYpNEzRd4ATA9lonDtoaOL
	gRWeykhHNdxlFkfhLf1tt5nFmU0ctUGkBawj+8cxYcTXdz1sduWnN3nIh+/QeObHoqY4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmx-0004vP-2f
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVxmx-0000vl-0f
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:11:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] stubdom: add xenstore pvh stubdom
Message-Id: <E1kVxmx-0000vl-0f@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:11:27 +0000

commit 154137dfdba334348887baf0be9693c407f7cef3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Oct 7 08:50:03 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:56 2020 +0200

    stubdom: add xenstore pvh stubdom
    
    Add a PVH xenstore stubdom in order to support a Xenstore stubdom on
    a hypervisor built without PV-support.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                     |  1 +
 stubdom/Makefile               | 31 ++++++++++++++++++++++++++--
 stubdom/configure              | 47 ++++++++++++++++++++++++++++++++++++++++++
 stubdom/configure.ac           |  1 +
 stubdom/xenstorepvh-minios.cfg | 10 +++++++++
 5 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index f6865c9cd8..b30a779f9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,6 +91,7 @@ stubdom/stubdompath.sh
 stubdom/tpm_emulator-*
 stubdom/vtpm/vtpm_manager.h
 stubdom/xenstore
+stubdom/xenstorepvh
 stubdom/zlib-*
 tools/*/build/lib*/*.py
 tools/autom4te.cache/
diff --git a/stubdom/Makefile b/stubdom/Makefile
index fb9617fa14..90d9ffcd9f 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -367,7 +367,10 @@ $(foreach lib,$(STUB_LIBS),$(eval $(call BUILD_lib,$(lib))))
 xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
 	$(do_links)
 
-LINK_DIRS := xenstore $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir))
+xenstorepvh/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
+	$(do_links)
+
+LINK_DIRS := xenstore xenstorepvh $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir))
 LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp)
 
 mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS)
@@ -486,6 +489,17 @@ xenstore-minios-config.mk: $(CURDIR)/xenstore-minios.cfg
 xenstore: $(CROSS_ROOT) xenstore-minios-config.mk
 	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
 
+#############
+# xenstorepvh
+#############
+
+xenstorepvh-minios-config.mk: $(CURDIR)/xenstorepvh-minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
+.PHONY: xenstorepvh
+xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
+
 ########
 # minios
 ########
@@ -519,6 +533,10 @@ pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
 xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxenguest xenstore
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
 
+.PHONY: xenstorepvh-stubdom
+xenstorepvh-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstorepvh libxenguest xenstorepvh
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstorepvh-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstorepvh/xenstored.a
+
 #########
 # install
 #########
@@ -548,6 +566,10 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
 
+install-xenstorepvh: xenstorepvh-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstorepvh/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstorepvh-stubdom.gz"
+
 install-vtpm: vtpm-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
@@ -581,6 +603,9 @@ uninstall-grub:
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
+uninstall-xenstorepvh:
+	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstorepvh-stubdom.gz
+
 uninstall-vtpm:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz
 
@@ -600,6 +625,7 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
@@ -612,6 +638,7 @@ clean:
 	rm -fr pkg-config
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
+	-[ ! -d xenstorepvh ] || $(MAKE) DESTDIR= -C xenstorepvh clean
 
 # clean the cross-compilation result
 .PHONY: crossclean
@@ -620,7 +647,7 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libs-$(XEN_TARGET_ARCH)
-	rm -fr ioemu xenstore
+	rm -fr ioemu xenstore xenstorepvh
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr openssl-$(XEN_TARGET_ARCH)
diff --git a/stubdom/configure b/stubdom/configure
index 3668203db8..903414589b 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,6 +630,7 @@ WGET
 CMAKE
 extfiles
 debug
+xenstorepvh
 xenstore
 grub
 caml
@@ -689,6 +690,7 @@ enable_c_stubdom
 enable_caml_stubdom
 enable_pv_grub
 enable_xenstore_stubdom
+enable_xenstore_pvh_stubdom
 enable_vtpm_stubdom
 enable_vtpmmgr_stubdom
 enable_qemu_traditional
@@ -1344,6 +1346,9 @@ Optional Features:
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
+  --disable-xenstorepvh-stubdom
+                          Build and install xenstorepvh-stubdom (default is
+                          ENABLED)
   --enable-vtpm-stubdom   Build and install vtpm-stubdom
   --enable-vtpmmgr-stubdom
                           Build and install vtpmmgr-stubdom
@@ -2178,6 +2183,48 @@ fi
 
 
 
+# Check whether --enable-xenstorepvh-stubdom was given.
+if test "${enable_xenstore_pvh_stubdom+set}" = set; then :
+  enableval=$enable_xenstore_pvh_stubdom;
+
+if test "x$enableval" = "xyes"; then :
+
+
+xenstorepvh=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS xenstorepvh"
+STUBDOM_BUILD="$STUBDOM_BUILD xenstorepvh-stubdom"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-xenstorepvh"
+STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-xenstorepvh"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
+xenstorepvh=n
+
+
+fi
+
+fi
+
+
+else
+
+
+xenstorepvh=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS xenstorepvh"
+STUBDOM_BUILD="$STUBDOM_BUILD xenstorepvh-stubdom"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-xenstorepvh"
+STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-xenstorepvh"
+
+
+fi
+
+
+
+
 # Check whether --enable-vtpm-stubdom was given.
 if test "${enable_vtpm_stubdom+set}" = set; then :
   enableval=$enable_vtpm_stubdom;
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index a2d514c021..bd6f765929 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -23,6 +23,7 @@ AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
 AX_STUBDOM_DEFAULT_DISABLE([caml-stubdom], [caml])
 AX_STUBDOM_DEFAULT_ENABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
+AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
 AX_STUBDOM_CONDITIONAL([vtpmmgr-stubdom], [vtpmmgr])
 
diff --git a/stubdom/xenstorepvh-minios.cfg b/stubdom/xenstorepvh-minios.cfg
new file mode 100644
index 0000000000..6af51f5753
--- /dev/null
+++ b/stubdom/xenstorepvh-minios.cfg
@@ -0,0 +1,10 @@
+CONFIG_PARAVIRT=n
+CONFIG_BLKFRONT=n
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=n
+CONFIG_LWIP=n
+CONFIG_BALLOON=y
+XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:55:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:55:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11054.29305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTK-0005BY-NR; Fri, 23 Oct 2020 14:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11054.29305; Fri, 23 Oct 2020 14:55:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTK-0005BQ-Jt; Fri, 23 Oct 2020 14:55:14 +0000
Received: by outflank-mailman (input) for mailman id 11054;
 Fri, 23 Oct 2020 14:55:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVyTJ-0005BE-1z
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 31e5b878-bf00-40e7-976a-85e8893b333a;
 Fri, 23 Oct 2020 14:55:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTB-0005rs-Is
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTB-0004C6-Hy
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVyTJ-0005BE-1z
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:13 +0000
X-Inumbo-ID: 31e5b878-bf00-40e7-976a-85e8893b333a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 31e5b878-bf00-40e7-976a-85e8893b333a;
	Fri, 23 Oct 2020 14:55:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fwKSiTTW+rpJhA7M/6+qvm5PuPiCaKcJe3Dcwze2yAc=; b=TgbM3J/REcHIZNN5hWYW4df2/H
	U1Gkj7GwXVWotw6ZjyZgzB5x4Cp2UhTM0QE/ast9FqcHpPhsbSfxCM80lhrKiHQIJlWUU7pn3hH/X
	BBKLYaqOoiiXLlXCoY+5YkYgK4UnxhapXOPI8RVK3QSPM/XvlUG2BXBzksBVJJbZj/VU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTB-0005rs-Is
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTB-0004C6-Hy
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs: move official headers to common directory
Message-Id: <E1kVyTB-0004C6-Hy@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:55:05 +0000

commit 4664034cdc720a52913bc26358240bb9d3798527
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:50:51 2020 +0100

    tools/libs: move official headers to common directory
    
    Instead of each library having an own include directory move the
    official headers to tools/include instead. This will drop the need to
    link those headers to tools/include and there is no need any longer
    to have library-specific include paths when building Xen.
    
    While at it remove setting of the unused variable
    PKG_CONFIG_CFLAGS_LOCAL in libs/*/Makefile.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .gitignore                                         |    5 +-
 stubdom/mini-os.mk                                 |    2 +-
 tools/Rules.mk                                     |    5 +-
 tools/include/Makefile                             |    6 +
 tools/include/libxenvchan.h                        |  176 ++
 tools/include/libxl.h                              | 2732 ++++++++++++++++++++
 tools/include/libxl_event.h                        |  632 +++++
 tools/include/libxl_json.h                         |   96 +
 tools/include/libxl_utils.h                        |  194 ++
 tools/include/libxl_uuid.h                         |   80 +
 tools/include/libxlutil.h                          |  136 +
 tools/include/xencall.h                            |  143 +
 tools/include/xenctrl.h                            | 2666 +++++++++++++++++++
 tools/include/xenctrl_compat.h                     |  183 ++
 tools/include/xendevicemodel.h                     |  378 +++
 tools/include/xenevtchn.h                          |  174 ++
 tools/include/xenforeignmemory.h                   |  192 ++
 tools/include/xengnttab.h                          |  470 ++++
 tools/include/xenguest.h                           |  723 ++++++
 tools/include/xenhypfs.h                           |   95 +
 tools/include/xenstat.h                            |  197 ++
 tools/include/xenstore-compat/xs.h                 |    2 +
 tools/include/xenstore-compat/xs_lib.h             |    2 +
 tools/include/xenstore.h                           |  281 ++
 tools/include/xenstore_lib.h                       |   94 +
 tools/include/xentoolcore.h                        |   88 +
 tools/include/xentoolcore_internal.h               |  158 ++
 tools/include/xentoollog.h                         |  146 ++
 tools/libs/call/Makefile                           |    3 -
 tools/libs/call/include/xencall.h                  |  143 -
 tools/libs/ctrl/Makefile                           |    3 -
 tools/libs/ctrl/include/xenctrl.h                  | 2666 -------------------
 tools/libs/ctrl/include/xenctrl_compat.h           |  183 --
 tools/libs/devicemodel/Makefile                    |    3 -
 tools/libs/devicemodel/include/xendevicemodel.h    |  378 ---
 tools/libs/evtchn/Makefile                         |    2 -
 tools/libs/evtchn/include/xenevtchn.h              |  174 --
 tools/libs/foreignmemory/Makefile                  |    3 -
 .../libs/foreignmemory/include/xenforeignmemory.h  |  192 --
 tools/libs/gnttab/Makefile                         |    3 -
 tools/libs/gnttab/include/xengnttab.h              |  470 ----
 tools/libs/guest/Makefile                          |    3 -
 tools/libs/guest/include/xenguest.h                |  723 ------
 tools/libs/hypfs/Makefile                          |    3 -
 tools/libs/hypfs/include/xenhypfs.h                |   95 -
 tools/libs/libs.mk                                 |   10 +-
 tools/libs/light/Makefile                          |   28 +-
 tools/libs/light/include/libxl.h                   | 2732 --------------------
 tools/libs/light/include/libxl_event.h             |  632 -----
 tools/libs/light/include/libxl_json.h              |   96 -
 tools/libs/light/include/libxl_utils.h             |  194 --
 tools/libs/light/include/libxl_uuid.h              |   80 -
 tools/libs/stat/Makefile                           |    2 -
 tools/libs/stat/include/xenstat.h                  |  197 --
 tools/libs/store/Makefile                          |   11 +-
 tools/libs/store/include/compat/xs.h               |    2 -
 tools/libs/store/include/compat/xs_lib.h           |    2 -
 tools/libs/store/include/xenstore.h                |  281 --
 tools/libs/toolcore/Makefile                       |    9 +-
 tools/libs/toolcore/include/xentoolcore.h          |   88 -
 tools/libs/toolcore/include/xentoolcore_internal.h |  158 --
 tools/libs/toollog/Makefile                        |    2 -
 tools/libs/toollog/include/xentoollog.h            |  146 --
 tools/libs/util/Makefile                           |    3 -
 tools/libs/util/include/libxlutil.h                |  136 -
 tools/libs/vchan/Makefile                          |    3 -
 tools/libs/vchan/include/libxenvchan.h             |  176 --
 tools/ocaml/libs/xentoollog/Makefile               |    2 +-
 tools/ocaml/libs/xentoollog/genlevels.py           |    2 +-
 tools/xenstore/xenstore_lib.h                      |   94 -
 70 files changed, 10074 insertions(+), 10115 deletions(-)

diff --git a/.gitignore b/.gitignore
index b30a779f9f..b169d78ed7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,7 +144,6 @@ tools/libs/light/test_timedereg
 tools/libs/light/test_fdderegrace
 tools/libs/light/tmp.*
 tools/libs/light/xenlight.pc
-tools/libs/light/include/_*.h
 tools/libs/stat/_paths.h
 tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
@@ -154,7 +153,6 @@ tools/libs/store/list.h
 tools/libs/store/utils.h
 tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
-tools/libs/store/include/xenstore_lib.h
 tools/libs/util/*.pc
 tools/libs/util/_paths.h
 tools/libs/util/libxlu_cfg_y.output
@@ -232,7 +230,8 @@ tools/hotplug/Linux/xendomains
 tools/hotplug/NetBSD/rc.d/xencommons
 tools/hotplug/NetBSD/rc.d/xendriverdomain
 tools/include/acpi
-tools/include/*.h
+tools/include/_libxl*.h
+tools/include/_xentoolcore_list.h
 tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk
index 420e9a8771..7e4968e026 100644
--- a/stubdom/mini-os.mk
+++ b/stubdom/mini-os.mk
@@ -5,7 +5,7 @@
 # XEN_ROOT
 # MINIOS_TARGET_ARCH
 
-XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/libs/store/include
+XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/include
 TOOLCORE_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore
 TOOLLOG_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog
 EVTCHN_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn
diff --git a/tools/Rules.mk b/tools/Rules.mk
index f3e0078927..f61da81f4a 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -87,7 +87,7 @@ endif
 define LIB_defs
  FILENAME_$(1) ?= xen$(1)
  XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1)
- CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude)
+ CFLAGS_libxen$(1) = $$(CFLAGS_xeninclude)
  SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use)))
  LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILENAME_$(1))$$(libextension)
  SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1))
@@ -97,8 +97,7 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib))))
 
 # code which compiles against libxenctrl get __XEN_TOOLS__ and
 # therefore sees the unstable hypercall interfaces.
-CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__
-CFLAGS_libxenguest += $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory)
+CFLAGS_libxenctrl += -D__XEN_TOOLS__
 
 ifeq ($(CONFIG_Linux),y)
 LDLIBS_libxenstore += -ldl
diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4d4313b60d..4d4ec5f974 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -1,6 +1,12 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+# Caution: some tools/libs/*/Makefile generate header files directly in
+# tools/include, and they do the [un]install actions for those, too.
+# In case other headers need to be built cwin tools/include this should be
+# taken into account, i.e. there should be no rules added here for generating
+# any tools/include/*.h files.
+
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
diff --git a/tools/include/libxenvchan.h b/tools/include/libxenvchan.h
new file mode 100644
index 0000000000..d6010b145d
--- /dev/null
+++ b/tools/include/libxenvchan.h
@@ -0,0 +1,176 @@
+/**
+ * @file
+ * @section AUTHORS
+ *
+ * Copyright (C) 2010  Rafal Wojtczuk  <rafal@invisiblethingslab.com>
+ *
+ *  Authors:
+ *       Rafal Wojtczuk  <rafal@invisiblethingslab.com>
+ *       Daniel De Graaf <dgdegra@tycho.nsa.gov>
+ *
+ * @section LICENSE
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @section DESCRIPTION
+ *
+ *  Originally borrowed from the Qubes OS Project, http://www.qubes-os.org,
+ *  this code has been substantially rewritten to use the gntdev and gntalloc
+ *  devices instead of raw MFNs and map_foreign_range.
+ *
+ *  This is a library for inter-domain communication.  A standard Xen ring
+ *  buffer is used, with a datagram-based interface built on top.  The grant
+ *  reference and event channels are shared in XenStore under the path
+ *  /local/domain/<srv-id>/data/vchan/<cli-id>/<port>/{ring-ref,event-channel}
+ *
+ *  The ring.h macros define an asymmetric interface to a shared data structure
+ *  that assumes all rings reside in a single contiguous memory space. This is
+ *  not suitable for vchan because the interface to the ring is symmetric except
+ *  for the setup. Unlike the producer-consumer rings defined in ring.h, the
+ *  size of the rings used in vchan are determined at execution time instead of
+ *  compile time, so the macros in ring.h cannot be used to access the rings.
+ */
+
+#include <xen/io/libxenvchan.h>
+#include <xen/xen.h>
+#include <xen/sys/evtchn.h>
+#include <xenevtchn.h>
+#include <xengnttab.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+struct xentoollog_logger;
+
+struct libxenvchan_ring {
+	/* Pointer into the shared page. Offsets into buffer. */
+	struct ring_shared* shr;
+	/* ring data; may be its own shared page(s) depending on order */
+	void* buffer;
+	/**
+	 * The size of the ring is (1 << order); offsets wrap around when they
+	 * exceed this. This copy is required because we can't trust the order
+	 * in the shared page to remain constant.
+	 */
+	int order;
+};
+
+/**
+ * struct libxenvchan: control structure passed to all library calls
+ */
+struct libxenvchan {
+	/* Mapping handle for shared ring page */
+	union {
+		xengntshr_handle *gntshr; /* for server */
+		xengnttab_handle *gnttab; /* for client */
+	};
+	/* Pointer to shared ring page */
+	struct vchan_interface *ring;
+	/* event channel interface */
+	xenevtchn_handle *event;
+	uint32_t event_port;
+	/* informative flags: are we acting as server? */
+	int is_server:1;
+	/* true if server remains active when client closes (allows reconnection) */
+	int server_persist:1;
+	/* true if operations should block instead of returning 0 */
+	int blocking:1;
+	/* communication rings */
+	struct libxenvchan_ring read, write;
+};
+
+/**
+ * Set up a vchan, including granting pages
+ * @param logger Logger for libxc errors
+ * @param domain The peer domain that will be connecting
+ * @param xs_path Base xenstore path for storing ring/event data
+ * @param send_min The minimum size (in bytes) of the send ring (left)
+ * @param recv_min The minimum size (in bytes) of the receive ring (right)
+ * @return The structure, or NULL in case of an error
+ */
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t read_min, size_t write_min);
+/**
+ * Connect to an existing vchan. Note: you can reconnect to an existing vchan
+ * safely, however no locking is performed, so you must prevent multiple clients
+ * from connecting to a single server.
+ *
+ * @param logger Logger for libxc errors
+ * @param domain The peer domain to connect to
+ * @param xs_path Base xenstore path for storing ring/event data
+ * @return The structure, or NULL in case of an error
+ */
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path);
+/**
+ * Close a vchan. This deallocates the vchan and attempts to free its
+ * resources. The other side is notified of the close, but can still read any
+ * data pending prior to the close.
+ */
+void libxenvchan_close(struct libxenvchan *ctrl);
+
+/**
+ * Packet-based receive: always reads exactly $size bytes.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data that was read
+ * @param size Size of the buffer and amount of data to read
+ * @return -1 on error, 0 if nonblocking and insufficient data is available, or $size
+ */
+int libxenvchan_recv(struct libxenvchan *ctrl, void *data, size_t size);
+/**
+ * Stream-based receive: reads as much data as possible.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data that was read
+ * @param size Size of the buffer
+ * @return -1 on error, otherwise the amount of data read (which may be zero if
+ *         the vchan is nonblocking)
+ */
+int libxenvchan_read(struct libxenvchan *ctrl, void *data, size_t size);
+/**
+ * Packet-based send: send entire buffer if possible
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data to send
+ * @param size Size of the buffer and amount of data to send
+ * @return -1 on error, 0 if nonblocking and insufficient space is available, or $size
+ */
+int libxenvchan_send(struct libxenvchan *ctrl, const void *data, size_t size);
+/**
+ * Stream-based send: send as much data as possible.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data to send
+ * @param size Size of the buffer
+ * @return -1 on error, otherwise the amount of data sent (which may be zero if
+ *         the vchan is nonblocking)
+ */
+int libxenvchan_write(struct libxenvchan *ctrl, const void *data, size_t size);
+/**
+ * Waits for reads or writes to unblock, or for a close
+ */
+int libxenvchan_wait(struct libxenvchan *ctrl);
+/**
+ * Returns the event file descriptor for this vchan. When this FD is readable,
+ * libxenvchan_wait() will not block, and the state of the vchan has changed since
+ * the last invocation of libxenvchan_wait().
+ */
+int libxenvchan_fd_for_select(struct libxenvchan *ctrl);
+/**
+ * Query the state of the vchan shared page:
+ *  return 0 when one side has called libxenvchan_close() or crashed
+ *  return 1 when both sides are open
+ *  return 2 [server only] when no client has yet connected
+ */
+int libxenvchan_is_open(struct libxenvchan* ctrl);
+/** Amount of data ready to read, in bytes */
+int libxenvchan_data_ready(struct libxenvchan *ctrl);
+/** Amount of data it is possible to send without blocking */
+int libxenvchan_buffer_space(struct libxenvchan *ctrl);
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
new file mode 100644
index 0000000000..1ea5b4f446
--- /dev/null
+++ b/tools/include/libxl.h
@@ -0,0 +1,2732 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+/*
+ * libxl API compatibility
+ *
+ * From Xen 4.2 onwards the API of libxl will be maintained in a
+ * stable manner. This means that it should be possible to write an
+ * application against the API provided by libxl in Xen 4.2 and expect
+ * that it will continue to compile against future versions of Xen
+ * without source modification.
+ *
+ * In order to make such compatibility possible it is required that
+ * application which want to be exposed to a particular API #define
+ * LIBXL_API_VERSION before including libxl.h or any other libxl
+ * header. The syntax of the LIBXL_API_VERSION is:
+ *    0xVVSSEE
+ * where ($(XEN_xxx) from xen/Makefile):
+ *   VV is the Xen major release number, $(XEN_VERSION)
+ *   SS is the Xen sub version number, $(XEN_SUBVERSION)
+ *   EE is the Xen extra version digit, first numeric part of
+ *     $(XEN_EXTRAVERSION) not including the leading "."
+ * For example the first stable API version, supported by Xen 4.2.0,
+ * is 0x040200.
+ *
+ * Lack of LIBXL_API_VERSION means "the latest" which will
+ * change. Specifying an unknown LIBXL_API_VERSION will result in a
+ * compile time error.
+ *
+ * Identical versions of the libxl API will represented by the version
+ * containing the earliest instance of that API. e.g. if 4.2.0 and
+ * 4.3.0 contain an identical libxl API then only LIBXL_API_VERSION
+ * 0x040200 will be valid.
+ *
+ * We will try especially hard to avoid changing the API during a
+ * stable series, i.e. it should be unusual for the last byte of
+ * LIBXL_API_VERSION to be non-zero.
+ *
+ * In the event that a change is required which cannot be made
+ * backwards compatible in this manner a #define of the form
+ * LIBXL_HAVE_<interface> will always be added in order to make it
+ * possible to write applications which build against any version of
+ * libxl. Such changes are expected to be exceptional and used as a
+ * last resort. The barrier for backporting such a change to a stable
+ * branch will be very high.
+ *
+ * These guarantees apply only to stable releases of Xen. When an
+ * incompatible change is made in the unstable tree then
+ * LIBXL_API_VERSION will be bumped to the next expected stable
+ * release number on the first such change only. Applications which
+ * want to support building against Xen unstable are expected to track
+ * API changes in that tree until it is released as a stable release.
+ *
+ * API compatibility will be maintained for all versions of Xen using
+ * the same $(XEN_VERSION) (e.g. throughout a major release).
+ */
+
+/* LIBXL_HAVE_PHYSINFO_CAP_PV
+ *
+ * If this is defined, libxl_physinfo has a "cap_pv" field.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_PV 1
+
+/* LIBXL_HAVE_CONSOLE_NOTIFY_FD
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take a notify_fd parameter. That
+ * parameter will be used to notify the caller that the console is connected.
+ */
+#define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
+
+/* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
+ *
+ * If this is defined, the copy functions have constified src parameter and the
+ * length functions accept constified parameter.
+ */
+#define LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS 1
+
+/* LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO
+ *
+ * If this is defined, libxl_domain_need_memory no longer modifies
+ * the b_info paseed in.
+ */
+#define LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO 1
+
+/* LIBXL_HAVE_VNUMA
+ *
+ * If this is defined the type libxl_vnode_info exists, and a
+ * field 'vnuma_nodes' is present in libxl_domain_build_info.
+ */
+#define LIBXL_HAVE_VNUMA 1
+
+/* LIBXL_HAVE_USERDATA_UNLINK
+ *
+ * If it is defined, libxl has a library function called
+ * libxl_userdata_unlink.
+ */
+#define LIBXL_HAVE_USERDATA_UNLINK 1
+
+/* LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID
+ *
+ * If this is defined, libxl has a library function called
+ * libxl_cpupool_qualifier_to_cpupoolid, which takes in a CPU pool
+ * qualifier in the form of number or string, then returns the ID of
+ * that CPU pool.
+ */
+#define LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID 1
+
+/* LIBXL_HAVE_CPUPOOL_ADD_REM_CPUMAP
+ *
+ * If this is defined, libxl has two library functions called
+ * libxl_cpupool_cpuadd_cpumap and libxl_cpupool_cpuremove_cpumap,
+ * which allow to add to or remove from a cpupool all the cpus
+ * specified in a bitmap.
+ */
+#define LIBXL_HAVE_CPUPOOL_ADD_REM_CPUMAP 1
+
+/*
+ *
+ * LIBXL_HAVE_BITMAP_AND_OR
+ *
+ * If this is defined, libxl has two library functions, libxl_bitmap_and
+ * and libxl_bitmap_or to compute the logical and and or of two bitmaps
+ */
+#define LIBXL_HAVE_BITMAP_AND_OR 1
+
+/*
+ * LIBXL_HAVE_FIRMWARE_PASSTHROUGH indicates the feature for
+ * passing in SMBIOS and ACPI firmware to HVM guests is present
+ * in the library.
+ */
+#define LIBXL_HAVE_FIRMWARE_PASSTHROUGH 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_NODEAFFINITY indicates that a 'nodemap' field
+ * (of libxl_bitmap type) is present in libxl_domain_build_info,
+ * containing the node-affinity for the domain.
+ */
+#define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
+
+/*
+ * LIBXL_HAVE_PVUSB indicates functions for plugging in USB devices
+ * through pvusb -- both hotplug and at domain creation time..
+ */
+#define LIBXL_HAVE_PVUSB 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE indicates that the
+ * libxl_vendor_device field is present in the hvm sections of
+ * libxl_domain_build_info. This field tells libxl which
+ * flavour of xen-pvdevice to enable in QEMU.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE 1
+
+/*
+ * The libxl_domain_build_info has the event_channels field.
+ */
+#define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
+
+/*
+ * libxl_domain_build_info has the u.hvm.ms_vm_genid field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MS_VM_GENID 1
+
+/*
+ * LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY indicates that a 'cpumap_soft'
+ * field (of libxl_bitmap type) is present in libxl_vcpuinfo,
+ * containing the soft affinity of a vcpu.
+ */
+#define LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY 1
+
+/*
+ * LIBXL_HAVE_SET_VCPUAFFINITY_FORCE indicates that the
+ * libxl_set_vcpuaffinity_force() library call is available.
+ */
+#define LIBXL_HAVE_SET_VCPUAFFINITY_FORCE 1
+
+/*
+ * LIBXL_HAVE_DEVICE_DISK_DIRECT_IO_SAFE indicates that a
+ * 'direct_io_safe' field (of boolean type) is present in
+ * libxl_device_disk.
+ */
+#define LIBXL_HAVE_DEVICE_DISK_DIRECT_IO_SAFE 1
+
+/*
+ * The libxl_device_disk has the discard_enable field.
+ */
+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_IOMEM_START_GFN indicates that it is possible
+ * to specify the start guest frame number used to map a range of I/O
+ * memory machine frame numbers via the 'gfn' field (of type uint64)
+ * of the 'iomem' structure. An array of iomem structures is embedded
+ * in libxl_domain_build_info and used to map the indicated memory
+ * ranges during domain build.
+ */
+#define LIBXL_HAVE_BUILDINFO_IOMEM_START_GFN 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS indicates that the RTDS real time scheduler
+ * is available. A 'budget' field added in libxl_domain_sched_params.
+ */
+#define LIBXL_HAVE_SCHED_RTDS 1
+
+/*
+ * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler
+ * is available.
+ */
+#define LIBXL_HAVE_SCHED_NULL 1
+
+/*
+ * libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps
+ * of the specified width.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE 1
+#define LIBXL_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE_WIDTH 64
+
+/*
+ * libxl_domain_build_info has the u.hvm.mmio_hole_memkb field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1
+
+/*
+ * libxl_domain_info returns ERROR_DOMAIN_NOTFOUND if the domain
+ * is not present, instead of ERROR_INVAL.
+ */
+#define LIBXL_HAVE_ERROR_DOMAIN_NOTFOUND 1
+
+/*
+ * libxl_domain_build_info has device_tree and libxl_device_dtdev
+ * exists. This mean Device Tree passthrough is supported for ARM
+ */
+#define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
+
+/*
+ * libxl_domain_build_info has device_model_user to specify the user to
+ * run the device model with. See docs/misc/qemu-deprivilege.txt.
+ */
+#define LIBXL_HAVE_DEVICE_MODEL_USER 1
+
+/*
+ * libxl_vcpu_sched_params is used to store per-vcpu params.
+ */
+#define LIBXL_HAVE_VCPU_SCHED_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS indicates RTDS scheduler
+ * now supports per-vcpu settings.
+ */
+#define LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA indicates RTDS scheduler
+ * now supports per-vcpu extratime settings.
+ */
+#define LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA 1
+
+/*
+ * libxl_domain_build_info has the arm.gic_version field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
+
+/*
+ * libxl_domain_build_info has the arch_arm.tee field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 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_HAVE_APIC_ASSIST indicates that the 'apic_assist' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_APIC_ASSIST 1
+
+/*
+ * LIBXL_HAVE_BUILD_ID means that libxl_version_info has the extra
+ * field for the hypervisor build_id.
+ */
+#define LIBXL_HAVE_BUILD_ID 1
+
+/*
+ * LIBXL_HAVE_QEMU_MONITOR_COMMAND indiactes the availability of the
+ * libxl_qemu_monitor_command() function.
+ */
+#define LIBXL_HAVE_QEMU_MONITOR_COMMAND 1
+
+/*
+ * LIBXL_HAVE_SCHED_CREDIT2_PARAMS indicates the existance of a
+ * libxl_sched_credit2_params structure, containing Credit2 scheduler
+ * wide parameters (i.e., the ratelimiting value).
+ */
+#define LIBXL_HAVE_SCHED_CREDIT2_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY indicates that there is a field
+ * in libxl_sched_credit_params called vcpu_migr_delay_us which controls
+ * the resistance of the vCPUs of the cpupool to migrations among pCPUs.
+ */
+#define LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_CRASH_CTL indicates that the 'crash_ctl' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_CRASH_CTL 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_SYNIC indicates that the 'synic' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_SYNIC 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_STIMER indicates that the 'stimer' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_STIMER 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_HCALL_IPI indicates that the 'hcall_ipi' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_HCALL_IPI 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE indicates that
+ * libxl_domain_build_info has the u.hvm.acpi_laptop_slate field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1
+
+/*
+ * LIBXL_HAVE_P9S indicates that the p9 field in IDL has been changed to p9s
+ */
+#define LIBXL_HAVE_P9S 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_ARM_VUART indicates that the toolstack supports virtual UART
+ * for ARM.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARM_VUART 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_GRANT_LIMITS indicates that libxl_domain_build_info
+ * has the max_grant_frames and max_maptrack_frames fields.
+ */
+#define LIBXL_HAVE_BUILDINFO_GRANT_LIMITS 1
+
+#define LIBXL_MAX_GRANT_DEFAULT (~(uint32_t)0)
+#define LIBXL_MAX_GRANT_FRAMES_DEFAULT 32 /* deprecated */
+#define LIBXL_MAX_MAPTRACK_FRAMES_DEFAULT 1024 /* deprecated */
+/*
+ * LIBXL_HAVE_BUILDINFO_GRANT_DEFAULT indicates that the default
+ * values of max_grant_frames and max_maptrack_frames fields in
+ * libxl_domain_build_info are the special sentinel value
+ * LIBXL_MAX_GRANT_DEFAULT rather than the fixed values above.
+ * This means to use the hypervisor's default.
+ */
+#define LIBXL_HAVE_BUILDINFO_GRANT_DEFAULT 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_* indicates that libxl_domain_build_info has
+ * the field represented by the '*'. The original position of those
+ * fields is:
+ *  - u.hvm.timer_mode
+ *  - u.hvm.apic
+ *  - u.hvm.nested_hvm
+ *  - u.pv.bootloader
+ *  - u.pv.bootloader_args
+ */
+#define LIBXL_HAVE_BUILDINFO_TIMER_MODE 1
+#define LIBXL_HAVE_BUILDINFO_APIC 1
+#define LIBXL_HAVE_BUILDINFO_NESTED_HVM 1
+#define LIBXL_HAVE_BUILDINFO_BOOTLOADER 1
+#define LIBXL_HAVE_BUILDINFO_BOOTLOADER_ARGS 1
+
+/*
+ * LIBXL_HAVE_EXTENDED_VKB indicates that libxl_device_vkb has extended fields:
+ *  - unique_id;
+ *  - feature_disable_keyboard;
+ *  - feature_disable_pointer;
+ *  - feature_abs_pointer;
+ *  - feature_raw_pointer;
+ *  - feature_multi_touch;
+ *  - width;
+ *  - height;
+ *  - multi_touch_width;
+ *  - multi_touch_height;
+ *  - multi_touch_num_contacts.
+ */
+#define LIBXL_HAVE_EXTENDED_VKB 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_CAP_HAP_SHADOW indicates that libxl_physinfo has
+ * cap_hap and cap_shadow fields reflecting the hardware and Xen availability
+ * of Hardware Assisted, and Shadow paging support.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_HAP_SHADOW 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_CAP_IOMMU_HAP_PT_SHARE indicates that libxl_physinfo
+ * has a cap_iommu_hap_pt_share field that indicates whether the hardware
+ * supports sharing the IOMMU and HAP page tables.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_IOMMU_HAP_PT_SHARE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_IOMMU_MEMKB indicates thate libxl_domain_build_info
+ * has an iommu_memkb field which should be set with the amount of memory
+ * overhead needed by the domain for populating IOMMU page tables.
+ */
+#define LIBXL_HAVE_BUILDINFO_IOMMU_MEMKB 1
+
+/*
+ * LIBXL_HAVE_CREATEINFO_PASSTHROUGH indicates that
+ * libxl_domain_create_info has a passthrough field (which is a
+ * libxl_passthrough enumeration) that indicates whether device pass-
+ * through is enabled for the domain and, if so, whether the IOMMU and
+ * HAP page tables may be shared or not.
+ */
+#define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
+
+/*
+ * LIBXL_HAVE_DISK_SAFE_REMOVE indicates that the
+ * libxl_device_disk_safe_remove() function is defined.
+ */
+#define LIBXL_HAVE_DISK_SAFE_REMOVE 1
+
+/*
+ * libxl ABI compatibility
+ *
+ * The only guarantee which libxl makes regarding ABI compatibility
+ * across releases is that the SONAME will always be bumped whenever
+ * the ABI is changed in an incompatible way.
+ *
+ * This applies within stable branches as well as
+ * development branches. It is possible that a new stable release of
+ * Xen may require a rebuild of applications using the
+ * library. However per the API compatibility gaurantees such a
+ * rebuild should not normally require any source level changes.
+ *
+ * As with the API compatiblity the SONAME will only be bumped for the
+ * first ABI incompatible change in a development branch.
+ */
+
+/*
+ * libxl memory management
+ *
+ * From the point of view of the application (ie, libxl's caller),
+ * struct libxl_ctx* is threadsafe, and all returned allocated
+ * structures are obtained from malloc(), and must be freed by the
+ * caller either directly or by calling an appropriate free function
+ * provided by libxl.  Ie the application does not get automatic
+ * assistance from libxl in managing these allocations.
+ *
+ * Specific details are in the header comments which should be found
+ * in libxl.h or libxlutil.h, next to the relevant function
+ * declarations.
+ *
+ * Internally, libxl has a garbage collection scheme which allows much libxl
+ * code to allocate strings etc. for internal use without needing to
+ * free them.  These are called "temporary allocations".
+ *
+ * The pool for these temporary allocations, along with any other
+ * thread-specific data which is private to libxl but shared between
+ * libxl functions (such as the current xenstore transaction), is
+ * stored in the "gc context" which is a special enhanced context
+ * structure allocated automatically by convenience macros at every
+ * entry to libxl.
+ *
+ * Every libxl function falls into one of these categories:
+ *
+ * 1. Public functions (declared in libxl.h, libxlutil.h), which may
+ *    be called by libxl applications.  If a public function returns
+ *    any allocated object to its caller, that object must have come
+ *    from malloc.
+ *
+ *    The definitions of public functions MUST use the gc context
+ *    initialisation macros (or do the equivalent work themselves).
+ *    These macros will ensure that all temporary allocations will be
+ *    automatically freed before the function returns to its caller.
+ *
+ *    A public function may be called from within libxl; the call
+ *    context initialisation macros will make sure that the internal
+ *    caller's context is reused (eg, so that the same xenstore
+ *    transaction is used).  But in-libxl callers of libxl public
+ *    functions should note that any libxl public function may cause
+ *    recursively reentry into libxl via the application's event
+ *    callback hook.
+ *
+ *    Public functions have names like libxl_foobar.
+ *
+ * 2. Private functions, which may not be called by libxl
+ *    applications; they are not declared in libxl.h or libxlutil.h
+ *    and they may not be called other than by other libxl functions.
+ *
+ *    Private functions should not use the gc context initialisation
+ *    macros.
+ *
+ *    Private functions have names like libxl__foobar (NB, two underscores).
+ *    Also the declaration of such functions must be preceeded by the _hidden
+ *    macro.
+ *
+ * Allocations made by a libxl function fall into one of the following
+ * categories (where "object" includes any memory allocation):
+ *
+ * (a) Objects which are not returned to the function's caller.
+ *     These should be allocated from the temporary pool.
+ *
+ * (b) Objects which are intended for return to the calling
+ *     application.  This includes all allocated objects returned by
+ *     any public function.
+ *
+ *     It may also include objects allocated by an internal function
+ *     specifically for eventual return by the function's external
+ *     callers, but this situation should be clearly documented in
+ *     comments.
+ *
+ *     These should be allocated from malloc() et al. and comments
+ *     near the function declaration should explain the memory
+ *     ownership.  If a simple free() by the application is not
+ *     sufficient, a suitable public freeing function should be
+ *     provided.
+ *
+ * (c) Internal objects whose size and/or lifetime dictate explicit
+ *     memory management within libxl.  This includes objects which
+ *     will be embedded in opaque structures which will be returned to
+ *     the libxl caller (more generally, any internal object whose
+ *     lifetime exceeds the libxl entrypoint which creates it) and
+ *     objects which are so large or numerous that explicit memory
+ *     management is required.
+ *
+ *     These should be allocated from malloc() et al., and freed
+ *     explicitly at the appropriate point.  The situation should be
+ *     documented in comments.
+ *
+ * (d) Objects which are allocated by internal-only functions and
+ *     returned to the function's (therefore, internal) caller but are
+ *     strictly for internal use by other parts of libxl.  These
+ *     should be allocated from the temporary pool.
+ *
+ *     Where a function's primary purpose is to return such an object,
+ *     it should have a libxl__gc * as it's first argument.
+ *
+ *     Note that there are two ways to change an allocation from this
+ *     category to the "public" category. Either the implementation
+ *     is kept internal and a wrapper function duplicates all memory
+ *     allocations so that they are suitable for return to external
+ *     callers or the implementation uses plain malloc() et al calls
+ *     and an internal wrapper adds the relevant pointers to the gc.
+ *     The latter method is preferred for obvious performance reasons.
+ *
+ * No temporary objects allocated from the pool may be explicitly freed.
+ * Therefore public functions which initialize a libxl__gc MUST call
+ * libxl__free_all() before returning.
+ *
+ * Memory allocation failures are not handled gracefully.  If malloc
+ * (or realloc) fails, libxl will cause the entire process to print
+ * a message to stderr and exit with status 255.
+ */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * IDL-generated libxl types should be used as follows: the user must
+ * always call the "init" function before using a type, even if the
+ * variable is simply being passed by reference as an out parameter
+ * to a libxl function.  The user must always calls "dispose" exactly
+ * once afterwards, to clean up, regardless of whether operations on
+ * this object succeeded or failed.  See the xl code for examples.
+ *
+ * "init" and "dispose" are idempotent.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ *
+ * char *libxl_<type>_to_json(instance *p)
+ *
+ *    Generates a JSON object from "p" in the form of a NULL terminated
+ *    string.
+ *
+ * <type *> libxl_<type>_from_json(const char *json)
+ * int      libxl_<type>_from_json(const char *json)
+ *
+ *    Parses "json" and returns:
+ *
+ *    an int value, if <type> is enumeration type. The value is the enum value
+ *    representing the respective string in "json".
+ *
+ *    an instance of <type>, if <type> is aggregate type. The returned
+ *    instance has its fields filled in by the parser according to "json".
+ *
+ *    If the parsing fails, caller cannot rely on the value / instance
+ *    returned.
+ */
+#ifndef LIBXL_H
+#define LIBXL_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <sys/wait.h> /* for pid_t */
+
+#include <xentoollog.h>
+
+typedef struct libxl__ctx libxl_ctx;
+
+#include <libxl_uuid.h>
+#include <_libxl_list.h>
+
+/* API compatibility. */
+#ifdef LIBXL_API_VERSION
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
+    LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
+    LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+#error Unknown LIBXL_API_VERSION
+#endif
+#endif
+
+/* LIBXL_HAVE_RETRIEVE_DOMAIN_CONFIGURATION
+ *
+ * If this is defined we have libxl_retrieve_domain_configuration which
+ * returns the current configuration of a domain, which can be used to
+ * rebuild a domain.
+ */
+#define LIBXL_HAVE_RETRIEVE_DOMAIN_CONFIGURATION 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain two arrays of libxl_bitmap-s, with all the necessary information
+ * to set the hard affinity (vcpu_hard_affinity) and the soft affinity
+ * (vcpu_soft_affinity) of the VCPUs.
+ *
+ * Note that, if the vcpu_hard_affinity array is used, libxl will ignore
+ * the content of the cpumap field of libxl_domain_build_info. That is to
+ * say, if the array is allocated and used by the caller, it is it and
+ * only it that determines the hard affinity of the domain's VCPUs.
+ *
+ * The number of libxl_bitmap-s in the arrays should be equal to the
+ * maximum number of VCPUs of the domain. If there only are N elements in
+ * an array, with N smaller the the maximum number of VCPUs, the hard or
+ * soft affinity (depending on which array we are talking about) will be
+ * set only for the first N VCPUs. The other VCPUs will just have affinity,
+ * both hard and soft, with all the host PCPUs.
+ * Each bitmap should be big enough to accommodate the maximum number of
+ * PCPUs of the host.
+ */
+#define LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_VKB_DEVICE
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain a boolean hvm.vkb_device which instructs libxl whether to include
+ * a vkbd at build time or not.
+ */
+#define LIBXL_HAVE_BUILDINFO_VKB_DEVICE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_USBVERSION
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbversion, a integer type that contains a USB
+ * controller version to specify on the qemu upstream command-line.
+ *
+ * If it is set, callers may use hvm.usbversion to specify if the usb
+ * controller is usb1, usb2 or usb3.
+ *
+ * If this is not defined, the hvm.usbversion field does not exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBVERSION 1
+
+/*
+ * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ *
+ * If this is defined, libxl_device_* structures containing a backend_domid
+ * field also contain a backend_domname field.  If backend_domname is set, it is
+ * resolved to a domain ID when the device is used and takes precedence over the
+ * backend_domid field.
+ *
+ * If this is not defined, the backend_domname field does not exist.
+ */
+#define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
+
+/*
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ *
+ * This argument was erroneously "const" in the 4.2 release despite
+ * the requirement for the callback to free the event.
+ */
+#if LIBXL_API_VERSION != 0x040200
+#define LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG 1
+#endif
+
+/*
+ * LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
+ *
+ * The return value of libxl_basename is malloc'ed but the erroneously
+ * marked as "const" in releases before 4.5.
+ */
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
+#endif
+
+/*
+ * LIBXL_HAVE_PHYSINFO_OUTSTANDING_PAGES
+ *
+ * If this is defined, libxl_physinfo structure will contain an uint64 field
+ * called outstanding_pages, containing the number of pages claimed but not
+ * yet allocated for all domains.
+ */
+#define LIBXL_HAVE_PHYSINFO_OUTSTANDING_PAGES 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_MAX_POSSIBLE_MFN
+ *
+ * If this is defined, libxl_physinfo structure will contain an uint64 field
+ * called max_possible_mfn, containing the highest possible mfn on this host,
+ * possibly taking memory hotplug into account.
+ */
+#define LIBXL_HAVE_PHYSINFO_MAX_POSSIBLE_MFN 1
+
+/*
+ * LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
+ *
+ * If this is defined, libxl_dominfo will contain a MemKB type field called
+ * outstanding_memkb, containing the amount of claimed but not yet allocated
+ * memory for a specific domain.
+ */
+#define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
+
+/*
+ * LIBXL_HAVE_DOMINFO_NEVER_STOP
+ *
+ * If this is defined, libxl_dominfo will contain a flag called never_stop
+ * indicating that the specific domain should never be stopped by the
+ * toolstack.
+ */
+#define LIBXL_HAVE_DOMINFO_NEVER_STOP 1
+
+/*
+ * LIBXL_HAVE_QXL
+ *
+ * If defined, then the libxl_vga_interface_type will contain another value:
+ * "QXL". This value define if qxl vga is supported.
+ *
+ * If this is not defined, the qxl vga support is missed.
+ */
+#define LIBXL_HAVE_QXL 1
+
+/*
+ * LIBXL_HAVE_SPICE_VDAGENT
+ *
+ * If defined, then the libxl_spice_info structure will contain a boolean type:
+ * vdagent and clipboard_sharing. These values define if Spice vdagent and
+ * clipboard sharing are enabled.
+ *
+ * If this is not defined, the Spice vdagent support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_VDAGENT 1
+
+/*
+ * LIBXL_HAVE_SPICE_USBREDIRECTION
+ *
+ * If defined, then the libxl_spice_info structure will contain an integer type
+ * field: usbredirection. This value defines if Spice usbredirection is enabled
+ * and with how much channels.
+ *
+ * If this is not defined, the Spice usbredirection support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
+
+/*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
+/*
+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: streaming_video. This value defines what Spice streaming video setting
+ * is used.
+ *
+ * If this is not defined, the Spice streaming video setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+
+/*
+ * LIBXL_HAVE_HVM_HDTYPE
+ *
+ * If defined, then the u.hvm structure will contain a enum type
+ * hdtype.
+ */
+#define LIBXL_HAVE_HVM_HDTYPE 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API has changed to
+ * include a params structure.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API includes the
+ * send_back_fd param. This is used only with COLO, for the libxl migration
+ * back channel; other callers should pass -1.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD 1
+
+/*
+ * LIBXL_HAVE_DRIVER_DOMAIN_CREATION 1
+ *
+ * If this is defined, libxl_domain_create_info contains a driver_domain
+ * field that can be used to tell libxl that the domain that is going
+ * to be created is a driver domain, so the necessary actions are taken.
+ */
+#define LIBXL_HAVE_DRIVER_DOMAIN_CREATION 1
+
+/*
+ * LIBXL_HAVE_SIGCHLD_SELECTIVE_REAP
+ *
+ * If this is defined:
+ *
+ * Firstly, the enum libxl_sigchld_owner (in libxl_event.h) has the
+ * value libxl_sigchld_owner_libxl_always_selective_reap which may be
+ * passed to libxl_childproc_setmode in hooks->chldmode.
+ *
+ * Secondly, the function libxl_childproc_sigchld_occurred exists.
+ */
+#define LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP 1
+
+/*
+ * LIBXL_HAVE_SIGCHLD_SHARING
+ *
+ * If this is defined, it is permissible for multiple libxl ctxs
+ * to simultaneously "own" SIGCHLD.  See "Subprocess handling"
+ * in libxl_event.h.
+ */
+#define LIBXL_HAVE_SIGCHLD_SHARING 1
+
+/*
+ * LIBXL_HAVE_NO_SUSPEND_RESUME
+ *
+ * Is this is defined then the platform has no support for saving,
+ * restoring or migrating a domain. In this case the related functions
+ * should be expected to return failure. That is:
+ *  - libxl_domain_suspend
+ *  - libxl_domain_resume
+ *  - libxl_domain_remus_start
+ */
+#if defined(__arm__) || defined(__aarch64__)
+#define LIBXL_HAVE_NO_SUSPEND_RESUME 1
+#endif
+
+/*
+ * LIBXL_HAVE_DOMAIN_SUSPEND_ONLY
+ *
+ * If this is defined, function libxl_domains_suspend_only() is available.
+ */
+
+#define LIBXL_HAVE_DOMAIN_SUSPEND_ONLY 1
+
+/*
+ * LIBXL_HAVE_DEVICE_PCI_SEIZE
+ *
+ * If this is defined, then the libxl_device_pci struct will contain
+ * the "seize" boolean field.  If this field is set, libxl_pci_add will
+ * check to see if the device is currently assigned to pciback, and if not,
+ * it will attempt to do so (unbinding the device from the existing driver).
+ */
+#define LIBXL_HAVE_DEVICE_PCI_SEIZE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_KERNEL
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain 'kernel', 'ramdisk', 'cmdline' fields. 'kernel' is a string
+ * to indicate kernel image location, 'ramdisk' is a string to indicate
+ * ramdisk location, 'cmdline' is a string to indicate the paramters which
+ * would be appended to kernel image.
+ *
+ * Both PV guest and HVM guest can use these fields for direct kernel boot.
+ * But for compatibility reason, u.pv.kernel, u.pv.ramdisk and u.pv.cmdline
+ * still exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_KERNEL 1
+
+/*
+ * LIBXL_HAVE_DEVICE_CHANNEL
+ *
+ * If this is defined, then the libxl_device_channel struct exists
+ * and channels can be attached to a domain. Channels manifest as consoles
+ * with names, see docs/misc/console.txt.
+ */
+#define LIBXL_HAVE_DEVICE_CHANNEL 1
+
+/*
+ * LIBXL_HAVE_AO_ABORT indicates the availability of libxl_ao_abort
+ */
+#define LIBXL_HAVE_AO_ABORT 1
+
+/* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
+ * called from within libxl itself. Callers outside libxl, who
+ * do not #include libxl_internal.h, are fine. */
+#ifndef LIBXL_EXTERNAL_CALLERS_ONLY
+#define LIBXL_EXTERNAL_CALLERS_ONLY /* disappears for callers outside libxl */
+#endif
+
+/*
+ *  LIBXL_HAVE_UUID_COPY_CTX_PARAM
+ *
+ * If this is defined, libxl_uuid_copy has changed to take a libxl_ctx
+ * structure.
+ */
+#define LIBXL_HAVE_UUID_COPY_CTX_PARAM 1
+
+/*
+ * LIBXL_HAVE_SSID_LABEL
+ *
+ * If this is defined, then libxl IDL contains string of XSM security
+ * label in all XSM related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_SSID_LABEL 1
+
+/*
+ * LIBXL_HAVE_CPUPOOL_NAME
+ *
+ * If this is defined, then libxl IDL contains string of CPU pool
+ * name in all CPU pool related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_CPUPOOL_NAME 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_SERIAL_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.serial_list, a libxl_string_list type that contains
+ * a list of serial ports to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.serial or
+ * hvm.serial_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.serial.  Note
+ * that this means only one serial port can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_SERIAL_LIST 1
+
+/*
+ * LIBXL_HAVE_ALTP2M
+ * If this is defined, then libxl supports alternate p2m functionality.
+ */
+#define LIBXL_HAVE_ALTP2M 1
+
+/*
+ * LIBXL_HAVE_REMUS
+ * If this is defined, then libxl supports remus.
+ */
+#define LIBXL_HAVE_REMUS 1
+
+/*
+ * LIBXL_HAVE_COLO_USERSPACE_PROXY
+ * If this is defined, then libxl supports COLO userspace proxy.
+ */
+#define LIBXL_HAVE_COLO_USERSPACE_PROXY 1
+
+typedef uint8_t libxl_mac[6];
+#define LIBXL_MAC_FMT "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"
+#define LIBXL_MAC_FMTLEN ((2*6)+5) /* 6 hex bytes plus 5 colons */
+#define LIBXL_MAC_BYTES(mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
+void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, const libxl_mac *src);
+
+#if defined(__i386__) || defined(__x86_64__)
+/*
+ * LIBXL_HAVE_PSR_CMT
+ *
+ * If this is defined, the Cache Monitoring Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CMT 1
+
+/*
+ * LIBXL_HAVE_PSR_MBM
+ *
+ * If this is defined, the Memory Bandwidth Monitoring feature is supported.
+ */
+#define LIBXL_HAVE_PSR_MBM 1
+
+/*
+ * LIBXL_HAVE_PSR_CAT
+ *
+ * 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
+
+/*
+ * LIBXL_HAVE_PSR_L2_CAT
+ *
+ * If this is defined, the L2 Cache Allocation Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_L2_CAT 1
+
+/*
+ * LIBXL_HAVE_PSR_GENERIC
+ *
+ * If this is defined, the Memory Bandwidth Allocation feature is supported.
+ * The following public functions are available:
+ *   libxl_psr_{set/get}_val
+ *   libxl_psr_get_hw_info
+ *   libxl_psr_hw_info_list_free
+ */
+#define LIBXL_HAVE_PSR_GENERIC 1
+
+/*
+ * LIBXL_HAVE_MCA_CAPS
+ *
+ * If this is defined, setting MCA capabilities for HVM domain is supported.
+ */
+#define LIBXL_HAVE_MCA_CAPS 1
+#endif
+
+/*
+ * LIBXL_HAVE_PCITOPOLOGY
+ *
+ * If this is defined, then interface to query hypervisor about PCI device
+ * topology is available.
+ */
+#define LIBXL_HAVE_PCITOPOLOGY 1
+
+/*
+ * LIBXL_HAVE_SOCKET_BITMAP
+ *
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
+ */
+#define LIBXL_HAVE_SOCKET_BITMAP 1
+
+/*
+ * LIBXL_HAVE_SRM_V2
+ *
+ * If this is defined, then the libxl_domain_create_restore() interface takes
+ * a "stream_version" parameter and supports a value of 2.
+ *
+ * libxl_domain_suspend() will produce a v2 stream.
+ */
+#define LIBXL_HAVE_SRM_V2 1
+
+/*
+ * LIBXL_HAVE_SRM_V1
+ *
+ * In the case that LIBXL_HAVE_SRM_V2 is set, LIBXL_HAVE_SRM_V1
+ * indicates that libxl_domain_create_restore() can handle a "stream_version"
+ * parameter of 1, and convert the stream format automatically.
+ */
+#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
+
+/*
+ * LIBXL_HAVE_CHECKPOINTED_STREAM
+ *
+ * If this is defined, then libxl_checkpointed_stream exists.
+ */
+#define LIBXL_HAVE_CHECKPOINTED_STREAM 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_SYSTEM_FIRMWARE
+ *
+ * libxl_domain_build_info has u.hvm.system_firmware field which can be use
+ * to provide a different firmware blob (like SeaBIOS or OVMF).
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_SYSTEM_FIRMWARE
+
+/*
+ * ERROR_REMUS_XXX error code only exists from Xen 4.5, Xen 4.6 and it
+ * is changed to ERROR_CHECKPOINT_XXX in Xen 4.7
+ */
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION >= 0x040500 \
+                               && LIBXL_API_VERSION < 0x040700
+#define ERROR_REMUS_DEVOPS_DOES_NOT_MATCH \
+        ERROR_CHECKPOINT_DEVOPS_DOES_NOT_MATCH
+#define ERROR_REMUS_DEVICE_NOT_SUPPORTED \
+        ERROR_CHECKPOINT_DEVICE_NOT_SUPPORTED
+#endif
+
+/*
+ * LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN
+ *
+ * In the case that LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN is set the
+ * libxl_vga_interface_type enumeration type contains a
+ * LIBXL_VGA_INTERFACE_TYPE_UNKNOWN identifier. This is used to signal
+ * that a libxl_vga_interface_type type has not been initialized yet.
+ */
+#define LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN 1
+
+/*
+ * LIBXL_HAVE_BYTEARRAY_UUID
+ *
+ * If this is defined, the internal member of libxl_uuid is defined
+ * as a 16 byte array that contains the UUID in big endian format.
+ * Also, the same structure layout is used across all OSes.
+ */
+#define LIBXL_HAVE_BYTEARRAY_UUID 1
+
+/*
+ * LIBXL_HAVE_MEMKB_64BITS
+ *
+ * If this is defined libxl_set_memory_target(), libxl_domain_setmaxmem()
+ * and libxl_wait_for_free_memory()  will take a 64 bit value for the memory
+ * size parameter.
+ * From Xen 4.8 on libxl_get_memory_target(), libxl_domain_need_memory() and
+ * libxl_get_free_memory() return the memory size in a 64 bit value, too.
+ */
+#define LIBXL_HAVE_MEMKB_64BITS 1
+
+/*
+ * LIBXL_HAVE_QED
+ *
+ * If this is defined QED disk formats can be used for both HVM and PV guests.
+ */
+#define LIBXL_HAVE_QED 1
+
+/*
+ * LIBXL_HAVE_SET_PARAMETERS
+ *
+ * If this is defined setting hypervisor parameters is supported.
+ */
+#define LIBXL_HAVE_SET_PARAMETERS 1
+
+/*
+ * LIBXL_HAVE_PV_SHIM
+ *
+ * If this is defined, libxl_domain_build_info's pvh type information
+ * contains members pvshim, pvshim_path, pvshim_cmdline, pvshim_extra.
+ */
+#define LIBXL_HAVE_PV_SHIM 1
+
+/*
+ * LIBXL_HAVE_PVCALLS
+ *
+ * If this is defined, libxl supports creating pvcalls interfaces.
+ */
+#define LIBXL_HAVE_PVCALLS 1
+
+/*
+ * LIBXL_HAVE_FN_USING_QMP_ASYNC
+ *
+ * This define indicates that some function's API has changed and have an
+ * extra parameter "ao_how" which means that the function can be executed
+ * asynchronously. Those functions are:
+ *   libxl_domain_pause()
+ *   libxl_domain_unpause()
+ *   libxl_send_trigger()
+ *   libxl_set_vcpuonline()
+ *   libxl_retrieve_domain_configuration()
+ *   libxl_qemu_monitor_command()
+ *   libxl_domain_shutdown()
+ *   libxl_domain_reboot()
+ */
+#define LIBXL_HAVE_FN_USING_QMP_ASYNC 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONFIG
+ *
+ * If this is set, libxl_domain_need_memory takes a
+ * libxl_domain_config* (non-const) and uint32_t domid_for_logging
+ * (instead of a const libxl_domain_build_info*).
+ *
+ * If this is set, there is no need to call
+ * libxl_get_required_shadow_memory and instead the caller should
+ * simply leave shadow_memkb set to LIBXL_MEMKB_DEFAULT and allow
+ * libxl to fill in a suitable default in the usual way.
+ */
+#define LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONFIG
+
+/*
+ * LIBXL_HAVE_CREATEINFO_DOMID
+ *
+ * libxl_domain_create_new() and libxl_domain_create_restore() will use
+ * a domid specified in libxl_domain_create_info.
+ */
+#define LIBXL_HAVE_CREATEINFO_DOMID
+
+/*
+ * LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+ *
+ * libxl_domain_create_info contains a boolean 'xend_suspend_evtchn_compat'
+ * value to control creation of the xenstore path for a domain's suspend
+ * event channel.
+ */
+#define LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+
+typedef char **libxl_string_list;
+void libxl_string_list_dispose(libxl_string_list *sl);
+int libxl_string_list_length(const libxl_string_list *sl);
+void libxl_string_list_copy(libxl_ctx *ctx, libxl_string_list *dst,
+                            const libxl_string_list *src);
+
+typedef char **libxl_key_value_list;
+void libxl_key_value_list_dispose(libxl_key_value_list *kvl);
+int libxl_key_value_list_length(const libxl_key_value_list *kvl);
+void libxl_key_value_list_copy(libxl_ctx *ctx,
+                               libxl_key_value_list *dst,
+                               const libxl_key_value_list *src);
+
+typedef uint32_t libxl_hwcap[8];
+void libxl_hwcap_copy(libxl_ctx *ctx, libxl_hwcap *dst, const libxl_hwcap *src);
+
+typedef uint64_t libxl_ev_user;
+
+typedef struct {
+    uint32_t size;          /* number of bytes in map */
+    uint8_t *map;
+} libxl_bitmap;
+void libxl_bitmap_init(libxl_bitmap *map);
+void libxl_bitmap_dispose(libxl_bitmap *map);
+
+/*
+ * libxl_cpuid_policy is opaque in the libxl ABI.  Users of both libxl and
+ * libxc may not make assumptions about xc_xend_cpuid.
+ */
+typedef struct xc_xend_cpuid libxl_cpuid_policy;
+typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
+int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l);
+void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
+                                  libxl_cpuid_policy_list *dst,
+                                  const libxl_cpuid_policy_list *src);
+
+#define LIBXL_PCI_FUNC_ALL (~0U)
+
+typedef uint32_t libxl_domid;
+typedef int libxl_devid;
+
+/*
+ * Formatting Enumerations.
+ *
+ * Each enumeration type libxl_E declares an associated lookup table
+ * libxl_E_string_table and a lookup function libxl_E_from_string.
+ */
+typedef struct {
+    const char *s;
+    int v;
+} libxl_enum_string_table;
+
+struct libxl_event;
+typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
+
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
+#define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
+
+/*
+ * We'd like to set a memory boundary to determine if we need to check
+ * any overlap with reserved device memory.
+ */
+#define LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT (2048 * 1024)
+
+#define LIBXL_MS_VM_GENID_LEN 16
+typedef struct {
+    uint8_t bytes[LIBXL_MS_VM_GENID_LEN];
+} libxl_ms_vm_genid;
+
+#include "_libxl_types.h"
+
+const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
+
+/*
+ * Some libxl operations can take a long time.  These functions take a
+ * parameter to control their concurrency:
+ *     libxl_asyncop_how *ao_how
+ *
+ * If ao_how==NULL, the function will be synchronous.
+ *
+ * If ao_how!=NULL, the function will set the operation going, and if
+ * this is successful will return 0.  In this case the zero error
+ * response does NOT mean that the operation was successful; it just
+ * means that it has been successfully started.  It will finish later,
+ * perhaps with an error.
+ *
+ * If ao_how->callback!=NULL, the callback will be called when the
+ * operation completes.  The same rules as for libxl_event_hooks
+ * apply, including the reentrancy rules and the possibility of
+ * "disaster", except that libxl calls ao_how->callback instead of
+ * libxl_event_hooks.event_occurs.  (See libxl_event.h.)
+ *
+ * If ao_how->callback==NULL, a libxl_event will be generated which
+ * can be obtained from libxl_event_wait or libxl_event_check.  The
+ * event will have type OPERATION_COMPLETE (which is not used
+ * elsewhere).
+ *
+ * Note that it is possible for an asynchronous operation which is to
+ * result in a callback to complete during its initiating function
+ * call.  In this case the initiating function will return 0
+ * indicating the at the operation is "in progress", even though by
+ * the time it returns the operation is complete and the callback has
+ * already happened.
+ *
+ * The application must set and use ao_how->for_event (which will be
+ * copied into libxl_event.for_user) or ao_how->for_callback (passed
+ * to the callback) to determine which operation finished, and it must
+ * of course check the rc value for errors.
+ *
+ * *ao_how does not need to remain valid after the initiating function
+ * returns. All other parameters must remain valid for the lifetime of
+ * the asynchronous operation, unless otherwise specified.
+ *
+ * Callbacks may occur on any thread in which the application calls
+ * libxl.
+ */
+
+typedef struct {
+    void (*callback)(libxl_ctx *ctx, int rc, void *for_callback);
+    union {
+        libxl_ev_user for_event; /* used if callback==NULL */
+        void *for_callback; /* passed to callback */
+    } u;
+} libxl_asyncop_how;
+
+/*
+ * Some more complex asynchronous operations can report intermediate
+ * progress.  How this is to be reported is controlled, for each
+ * function, by a parameter
+ *    libxl_asyncprogress_how *aop_FOO_how;
+ * for each kind of progress FOO supported by that function.  Each
+ * such kind of progress is associated with an event type.
+ *
+ * The function description will document whether, when, and how
+ * many times, the intermediate progress will be reported, and
+ * what the corresponding event type(s) are.
+ *
+ * If aop_FOO_how==NULL, intermediate progress reports are discarded.
+ *
+ * If aop_FOO_how->callback==NULL, intermediate progress reports
+ * generate libxl events which can be obtained from libxl_event_wait
+ * or libxl_event_check.
+ *
+ * If aop_FOO_how->callback!=NULL, libxl will report intermediate
+ * progress by calling callback(ctx, &event, for_callback).
+ *
+ * The rules for these events are otherwise the same as those for
+ * ordinary events.  The reentrancy and threading rules for the
+ * callback are the same as those for ao completion callbacks.
+ *
+ * Note that the callback, if provided, is responsible for freeing
+ * the event.
+ *
+ * If callbacks are requested, they will be made, and returned, before
+ * the long-running libxl operation is considered finished (so if the
+ * long-running libxl operation was invoked with ao_how==NULL then any
+ * callbacks will occur strictly before the long-running operation
+ * returns).  However, the callbacks may occur on any thread.
+ *
+ * In general, otherwise, no promises are made about the relative
+ * order of callbacks in a multithreaded program.  In particular
+ * different callbacks relating to the same long-running operation may
+ * be delivered out of order.
+ */
+
+typedef struct {
+    void (*callback)(libxl_ctx *ctx, libxl_event*, void *for_callback);
+    libxl_ev_user for_event; /* always used */
+    void *for_callback; /* passed to callback */
+} libxl_asyncprogress_how;
+
+/*
+ * It is sometimes possible to abort an asynchronous operation.
+ *
+ * libxl_ao_abort searches for an ongoing asynchronous operation whose
+ * ao_how is identical to *how, and tries to abort it.  The return
+ * values from libxl_ao_abort are as follows:
+ *
+ *  0
+ *
+ *     The operation was found, and attempts are being made to cut it
+ *     short.  However, it may still take some time to stop.  It is
+ *     also possible that the operation will nevertheless complete
+ *     successfully.
+ *
+ *  ERROR_NOTFOUND
+ *
+ *      No matching ongoing operation was found.  This might happen
+ *      for an actual operation if the operation has already completed
+ *      (perhaps on another thread).  The call to libxl_ao_abort has
+ *      had no effect.
+ *
+ *  ERROR_ABORTED
+ *
+ *     The operation has already been the subject of at least one
+ *     call to libxl_ao_abort.
+ *
+ * If the operation was indeed cut short due to the abort request, it
+ * will complete, at some point in the future, with ERROR_ABORTED.  In
+ * that case, depending on the operation it have performed some of the
+ * work in question and left the operation half-done.  Consult the
+ * documentation for individual operations.
+ *
+ * Note that an aborted operation might still fail for other reasons
+ * even after the abort was requested.
+ *
+ * If your application is multithreaded you must not reuse an
+ * ao_how->for_event or ao_how->for_callback value (with a particular
+ * ao_how->callback) unless you are sure that none of your other
+ * threads are going to abort the previous operation using that
+ * value; otherwise you risk aborting the wrong operation if the
+ * intended target of the abort request completes in the meantime.
+ *
+ * It is possible to abort even an operation which is being performed
+ * synchronously, but since in that case how==NULL you had better only
+ * have one such operation, because it is not possible to tell them
+ * apart (and libxl_ao_abort will abort only the first one it finds).
+ * (And, if you want to do this, obviously the abort would have to be
+ * requested on a different thread.)
+ */
+int libxl_ao_abort(libxl_ctx *ctx, const libxl_asyncop_how *how)
+                   LIBXL_EXTERNAL_CALLERS_ONLY;
+
+
+#define LIBXL_VERSION 0
+
+/* context functions */
+int libxl_ctx_alloc(libxl_ctx **pctx, int version,
+                    unsigned flags /* none currently defined */,
+                    xentoollog_logger *lg);
+int libxl_ctx_free(libxl_ctx *ctx /* 0 is OK */);
+
+/* domain related functions */
+
+#define INVALID_DOMID ~0
+#define RANDOM_DOMID (INVALID_DOMID - 1)
+
+/* If the result is ERROR_ABORTED, the domain may or may not exist
+ * (in a half-created state).  *domid will be valid and will be the
+ * domain id, or INVALID_DOMID, as appropriate */
+
+int libxl_domain_create_new(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;
+int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
+                                uint32_t *domid, int restore_fd,
+                                int send_back_fd,
+                                const libxl_domain_restore_params *params,
+                                const libxl_asyncop_how *ao_how,
+                                const libxl_asyncprogress_how *aop_console_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040400
+
+static inline int libxl_domain_create_restore_0x040200(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    libxl_domain_restore_params params;
+    int ret;
+
+    libxl_domain_restore_params_init(&params);
+
+    ret = libxl_domain_create_restore(
+        ctx, d_config, domid, restore_fd, -1, &params, ao_how, aop_console_how);
+
+    libxl_domain_restore_params_dispose(&params);
+    return ret;
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040200
+
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION >= 0x040400 \
+                                 && LIBXL_API_VERSION < 0x040700
+
+static inline int libxl_domain_create_restore_0x040400(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_domain_restore_params *params,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    return libxl_domain_create_restore(ctx, d_config, domid, restore_fd,
+                                       -1, params, ao_how, aop_console_how);
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040400
+
+#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.
+   */
+
+void libxl_domain_config_init(libxl_domain_config *d_config);
+void libxl_domain_config_dispose(libxl_domain_config *d_config);
+
+/*
+ * Retrieve domain configuration and filled it in d_config. The
+ * returned configuration can be used to rebuild a domain. It only
+ * works with DomU.
+ */
+int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
+                                        libxl_domain_config *d_config,
+                                        const libxl_asyncop_how *ao_how)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_retrieve_domain_configuration_0x041200(
+    libxl_ctx *ctx, uint32_t domid, libxl_domain_config *d_config)
+{
+    return libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL);
+}
+#define libxl_retrieve_domain_configuration \
+    libxl_retrieve_domain_configuration_0x041200
+#endif
+
+int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd,
+                         int flags, /* LIBXL_SUSPEND_* */
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#define LIBXL_SUSPEND_DEBUG 1
+#define LIBXL_SUSPEND_LIVE 2
+
+/*
+ * Only suspend domain, do not save its state to file, do not destroy it.
+ * Suspended domain can be resumed with libxl_domain_resume()
+ */
+int libxl_domain_suspend_only(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* @param suspend_cancel [from xenctrl.h:xc_domain_resume( @param fast )]
+ *   If this parameter is true, use co-operative resume. The guest
+ *   must support this.
+ */
+int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
+                        const libxl_asyncop_how *ao_how)
+                        LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * This function doesn't return unless something has gone wrong with
+ * the replication to the secondary. If this function returns then the
+ * caller should resume the (primary) domain.
+ */
+int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
+                             uint32_t domid, int send_fd, int recv_fd,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_reboot(libxl_ctx *ctx, uint32_t domid,
+                        const libxl_asyncop_how *ao_how)
+                        LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_domain_shutdown_0x041200(libxl_ctx *ctx,
+                                                 uint32_t domid)
+{
+    return libxl_domain_shutdown(ctx, domid, NULL);
+}
+#define libxl_domain_shutdown libxl_domain_shutdown_0x041200
+static inline int libxl_domain_reboot_0x041200(libxl_ctx *ctx,
+                                               uint32_t domid)
+{
+    return libxl_domain_reboot(ctx, domid, NULL);
+}
+#define libxl_domain_reboot libxl_domain_reboot_0x041200
+#endif
+
+int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_info *info, const char *name_suffix, libxl_uuid new_uuid);
+
+/* get max. number of cpus supported by hypervisor */
+int libxl_get_max_cpus(libxl_ctx *ctx);
+
+/* get the actual number of currently online cpus on the host */
+int libxl_get_online_cpus(libxl_ctx *ctx);
+  /* Beware that no locking or serialization is provided by libxl,
+   * so the information can be outdated as far as the function
+   * returns. If there are other entities in the system capable
+   * of onlining/offlining CPUs, it is up to the application
+   * to guarantee consistency, if that is important. */
+
+/* get max. number of NUMA nodes supported by hypervisor */
+int libxl_get_max_nodes(libxl_ctx *ctx);
+
+int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
+                        const char *old_name, const char *new_name);
+
+  /* if old_name is NULL, any old name is OK; otherwise we check
+   * transactionally that the domain has the old old name; if
+   * trans is not 0 we use caller's transaction and caller must do retries */
+
+int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_domain_pause_0x041200(
+    libxl_ctx *ctx, uint32_t domid)
+{
+    return libxl_domain_pause(ctx, domid, NULL);
+}
+static inline int libxl_domain_unpause_0x041200(
+    libxl_ctx *ctx, uint32_t domid)
+{
+    return libxl_domain_unpause(ctx, domid, NULL);
+}
+#define libxl_domain_pause libxl_domain_pause_0x041200
+#define libxl_domain_unpause libxl_domain_unpause_0x041200
+#endif
+
+
+int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
+                           const char *filename,
+                           const libxl_asyncop_how *ao_how)
+                           LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t target_memkb);
+int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, int64_t target_memkb, int relative, int enforce);
+int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint64_t *out_target);
+int libxl_get_memory_target_0x040700(libxl_ctx *ctx, uint32_t domid,
+                                     uint32_t *out_target)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * WARNING
+ * This memory management API is unstable even in Xen 4.2.
+ * It has a numer of deficiencies and we intend to replace it.
+ *
+ * The semantics of these functions should not be relied on to be very
+ * coherent or stable.  We will however endeavour to keep working
+ * existing programs which use them in roughly the same way as libxl.
+ */
+/* how much free memory in the system a domain needs to be built */
+int libxl_domain_need_memory(libxl_ctx *ctx,
+                             libxl_domain_config *config
+                             /* ^ will be partially defaulted */,
+                             uint32_t domid_for_logging /* INVALID_DOMID ok */,
+                             uint64_t *need_memkb);
+int libxl_domain_need_memory_0x041200(libxl_ctx *ctx,
+                                      const libxl_domain_build_info *b_info_in,
+                                      uint64_t *need_memkb);
+int libxl_domain_need_memory_0x040700(libxl_ctx *ctx,
+                                      const libxl_domain_build_info *b_info_in,
+                                      uint32_t *need_memkb)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+/* how much free memory is available in the system */
+int libxl_get_free_memory(libxl_ctx *ctx, uint64_t *memkb);
+int libxl_get_free_memory_0x040700(libxl_ctx *ctx, uint32_t *memkb)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+/* wait for a given amount of memory to be free in the system */
+int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint64_t memory_kb, int wait_secs);
+/*
+ * Wait for the memory target of a domain to be reached. Does not
+ * decrement wait_secs if the domain is making progress toward reaching
+ * the target. If the domain is not making progress, wait_secs is
+ * decremented. If the timeout expires before the target is reached, the
+ * function returns ERROR_FAIL.
+ *
+ * Older versions of this function (Xen 4.5 and older), decremented
+ * wait_secs even if the domain was making progress, resulting in far
+ * lower overall wait times. To make sure that your calling routine
+ * works with new and old implementations of the function, pass enough
+ * time for the guest to reach its target as an argument.
+ */
+int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
+#define libxl_get_memory_target libxl_get_memory_target_0x040700
+#define libxl_domain_need_memory libxl_domain_need_memory_0x040700
+#define libxl_get_free_memory libxl_get_free_memory_0x040700
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+#define libxl_domain_need_memory libxl_domain_need_memory_0x041200
+#endif
+
+int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
+
+/*
+ * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
+ * the caller that it has connected to the guest console.
+ */
+int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
+                       libxl_console_type type, int notify_fd);
+/* libxl_primary_console_exec finds the domid and console number
+ * corresponding to the primary console of the given vm, then calls
+ * libxl_console_exec with the right arguments (domid might be different
+ * if the guest is using stubdoms).
+ * This function can be called after creating the device model, in
+ * case of HVM guests, and before libxl_run_bootloader in case of PV
+ * guests using pygrub.
+ * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
+ * the caller that it has connected to the guest console.
+ */
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
+                               int notify_fd);
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
+
+static inline int libxl_console_exec_0x040700(libxl_ctx *ctx,
+                                              uint32_t domid, int cons_num,
+                                              libxl_console_type type)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, -1);
+}
+#define libxl_console_exec libxl_console_exec_0x040700
+
+static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
+                                                      uint32_t domid_vm)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, -1);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x040700
+
+#endif
+
+/* libxl_console_get_tty retrieves the specified domain's console tty path
+ * and stores it in path. Caller is responsible for freeing the memory.
+ */
+int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
+                          libxl_console_type type, char **path);
+
+/* libxl_primary_console_get_tty retrieves the specified domain's primary
+ * console tty path and stores it in path. Caller is responsible for freeing
+ * the memory.
+ */
+int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm, char **path);
+
+/* May be called with info_r == NULL to check for domain's existence.
+ * Returns ERROR_DOMAIN_NOTFOUND if domain does not exist (used to return
+ * ERROR_INVAL for this scenario). */
+int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
+                      uint32_t domid);
+
+/* These functions each return (on success) an array of elements,
+ * and the length via the int* out parameter.  These arrays and
+ * their contents come from malloc, and must be freed with the
+ * corresponding libxl_THING_list_free function.
+ */
+libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain_out);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nb_domain);
+
+libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool_out);
+void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nb_pool);
+
+libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nb_vm);
+
+#define LIBXL_CPUTOPOLOGY_INVALID_ENTRY (~(uint32_t)0)
+libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_out);
+void libxl_cputopology_list_free(libxl_cputopology *, int nb_cpu);
+
+#define LIBXL_PCITOPOLOGY_INVALID_ENTRY (~(uint32_t)0)
+libxl_pcitopology *libxl_get_pci_topology(libxl_ctx *ctx, int *num_devs);
+void libxl_pcitopology_list_free(libxl_pcitopology *, int num_devs);
+
+#define LIBXL_NUMAINFO_INVALID_ENTRY (~(uint32_t)0)
+libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr);
+void libxl_numainfo_list_free(libxl_numainfo *, int nr);
+
+libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
+                                int *nb_vcpu, int *nr_cpus_out);
+void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
+
+/*
+ * Devices
+ * =======
+ *
+ * Each device is represented by a libxl_device_<TYPE> data structure
+ * which is defined via the IDL. In addition some devices have an
+ * additional data type libxl_device_<TYPE>_getinfo which contains
+ * further runtime information about the device.
+ *
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
+ *
+ * Querying
+ * --------
+ *
+ * libxl_device_<type>_list(ctx, domid, nr):
+ *
+ *   Returns an array of libxl_device_<type> length nr representing
+ *   the devices attached to the specified domain.
+ *
+ * libxl_device_<type>_getinfo(ctx, domid, device, info):
+ *
+ *   Initialises info with details of the given device which must be
+ *   attached to the specified domain.
+ *
+ * Creation / Control
+ * ------------------
+ *
+ * libxl_device_<type>_add(ctx, domid, device):
+ *
+ *   Adds the given device to the specified domain. This can be called
+ *   while the guest is running (hotplug) or before boot (coldplug).
+ *
+ *   This function only sets up the device but does not wait for the
+ *   domain to connect to the device and therefore cannot block on the
+ *   guest.
+ *
+ *   device is an in/out parameter:  fields left unspecified when the
+ *   structure is passed in are filled in with appropriate values for
+ *   the device created.
+ *
+ * libxl_device_<type>_destroy(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain without guest
+ *   co-operation. It is guest specific what affect this will have on
+ *   a running guest.
+ *
+ *   This function does not interact with the guest and therefore
+ *   cannot block on the guest.
+ *
+ * libxl_device_<type>_remove(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain by performing
+ *   an orderly unplug with guest co-operation. This requires that the
+ *   guest is running.
+ *
+ *   This method is currently synchronous and therefore can block
+ *   while interacting with the guest. There is a time-out of 10s on
+ *   this interaction after which libxl_device_<type>_destroy()
+ *   semantics apply.
+ *
+ * libxl_device_<type>_safe_remove(ctx, domid, device):
+ *
+ *   This has the same semantics as libxl_device_<type>_remove() but,
+ *   in the event of hitting the 10s time-out, this function will fail.
+ *
+ * Controllers
+ * -----------
+ *
+ * Most devices are treated individually.  Some classes of device,
+ * however, like USB or SCSI, inherently have the need to have a
+ * hierarchy of different levels, with lower-level devices "attached"
+ * to higher-level ones.  USB for instance has "controllers" at the
+ * top, which have buses, on which are devices, which consist of
+ * multiple interfaces.  SCSI has "hosts" at the top, then buses,
+ * targets, and LUNs.
+ *
+ * In that case, for each <class>, there will be a set of functions
+ * and types for each <level>.  For example, for <class>=usb, there
+ * may be <levels> ctrl (controller) and dev (device), with ctrl being
+ * level 0.
+ *
+ * libxl_device_<class><level0>_<function> will act more or
+ * less like top-level non-bus devices: they will either create or
+ * accept a libxl_devid which will be unique within the
+ * <class><level0> libxl_devid namespace.
+ *
+ * Lower-level devices must have a unique way to be identified.  One
+ * way to do this would be to name it via the name of the next level
+ * up plus an index; for instance, <ctrl devid, port number>.  Another
+ * way would be to have another devid namespace for that level.  This
+ * identifier will be used for queries and removals.
+ *
+ * Lower-level devices will include in their
+ * libxl_device_<class><level> struct a field referring to the unique
+ * index of the level above.  For instance, libxl_device_usbdev might
+ * contain the controller devid.
+ *
+ * In the case where there are multiple different ways to implement a
+ * given device -- for instance, one which is fully PV and one which
+ * uses an emulator -- the controller will contain a field which
+ * specifies what type of implementation is used.  The implementations
+ * of individual devices will be known by the controller to which they
+ * are attached.
+ *
+ * If libxl_device_<class><level>_add receives an empty reference to
+ * the level above, it may return an error.  Or it may (but is not
+ * required to) automatically choose a suitable device in the level
+ * above to which to attach the new device at this level.  It may also
+ * (but is not required to) automatically create a new device at the
+ * level above if no suitable devices exist.  Each class should
+ * document its behavior.
+ *
+ * libxl_device_<class><level>_list will list all devices of <class>
+ * at <level> in the domain.  For example, libxl_device_usbctrl_list
+ * will list all usb controllers; libxl_class_usbdev_list will list
+ * all usb devices across all controllers.
+ *
+ * For each class, the domain config file will contain a single list
+ * for each level.  libxl will first iterate through the list of
+ * top-level devices, then iterate through each level down in turn,
+ * adding devices to devices in the level above.  For instance, there
+ * will be one list for all usb controllers, and one list for all usb
+ * devices.
+ *
+ * If libxl_device_<class><level>_add automatically creates
+ * higher-level devices as necessary, then it is permissible for the
+ * higher-level lists to be empty and the device list to have devices
+ * with the field containing a reference to the higher level device
+ * uninitialized.
+ */
+
+/* Disks */
+int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid,
+                          libxl_device_disk *disk,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_disk *disk,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_disk *disk,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_safe_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_disk *disk,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_disk_list_free(libxl_device_disk* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_disk *disk, libxl_diskinfo *diskinfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Insert a CD-ROM device. A device corresponding to disk must already
+ * be attached to the guest.
+ */
+int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * USB
+ *
+ * For each device removed or added, one of these protocols is available:
+ * - PV (i.e., PVUSB)
+ * - DEVICEMODEL (i.e, qemu)
+ *
+ * PV is available for either PV or HVM domains.  DEVICEMODEL is only
+ * available for HVM domains.  The caller can additionally specify
+ * "AUTO", in which case the library will try to determine the best
+ * protocol automatically.
+ *
+ * At the moment, the only protocol implemented is PV.
+ *
+ * One can add/remove USB controllers to/from guest, and attach/detach USB
+ * devices to/from USB controllers.
+ *
+ * To add USB controllers and USB devices, one can adding USB controllers
+ * first and then attaching USB devices to some USB controller, or adding
+ * USB devices to guest directly, it will automatically create a USB
+ * controller for USB devices to attach.
+ *
+ * To remove USB controllers or USB devices, one can remove USB devices
+ * under USB controller one by one and then remove USB controller, or
+ * remove USB controller directly, it will remove all USB devices under
+ * it automatically.
+ *
+ */
+/* USB Controllers*/
+int libxl_device_usbctrl_add(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_usbctrl *usbctrl,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbctrl_remove(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_usbctrl *usbctrl,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbctrl_destroy(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_usbctrl *usbctrl,
+                                 const libxl_asyncop_how *ao_how)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_usbctrl *libxl_device_usbctrl_list(libxl_ctx *ctx,
+                                                uint32_t domid, int *num);
+
+void libxl_device_usbctrl_list_free(libxl_device_usbctrl *list, int nr);
+
+
+int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 const libxl_device_usbctrl *usbctrl,
+                                 libxl_usbctrlinfo *usbctrlinfo);
+
+/* USB Devices */
+
+int libxl_device_usbdev_add(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_usbdev *usbdev,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbdev_remove(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_usbdev *usbdev,
+                               const libxl_asyncop_how *ao_how)
+                               LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_usbdev *
+libxl_device_usbdev_list(libxl_ctx *ctx, uint32_t domid, int *num);
+
+void libxl_device_usbdev_list_free(libxl_device_usbdev *list, int nr);
+
+/* Network Interfaces */
+int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_nic *nic,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_nic *nic,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
+                             const libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Virtual Channels
+ * Channels manifest as consoles with names, see docs/misc/channels.txt
+ */
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num);
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 const libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo);
+
+/* Virtual TPMs */
+int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vtpm *vtpm,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vtpm_list_free(libxl_device_vtpm*, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Virtual displays */
+int libxl_device_vdispl_add(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vdispl *displ,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_remove(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_vdispl *vdispl,
+                               const libxl_asyncop_how *ao_how)
+                               LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_destroy(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_vdispl *vdispl,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vdispl *libxl_device_vdispl_list(libxl_ctx *ctx,
+                                              uint32_t domid, int *num)
+                                              LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vdispl_list_free(libxl_device_vdispl* list, int num)
+                                   LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                const libxl_device_vdispl *vdispl,
+                                libxl_vdisplinfo *vdisplinfo)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Virtual sounds */
+int libxl_device_vsnd_add(libxl_ctx *ctx, uint32_t domid,
+                          libxl_device_vsnd *vsnd,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_remove(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vsnd *vsnd,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vsnd *vsnd,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vsnd *libxl_device_vsnd_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vsnd_list_free(libxl_device_vsnd* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_vsnd *vsnd,
+                              libxl_vsndinfo *vsndlinfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Keyboard */
+int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vkb *vkb,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vkb *vkb,
+                             const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vkb *libxl_device_vkb_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vkb_list_free(libxl_device_vkb* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_getinfo(libxl_ctx *ctx, uint32_t domid,
+                             const libxl_device_vkb *vkb,
+                             libxl_vkbinfo *vkbinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Framebuffer */
+int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vfb *vfb,
+                            const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vfb *vfb,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* 9pfs */
+int libxl_device_p9_remove(libxl_ctx *ctx, uint32_t domid,
+                           libxl_device_p9 *p9,
+                           const libxl_asyncop_how *ao_how)
+                           LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_p9_destroy(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_p9 *p9,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* pvcalls interface */
+int libxl_device_pvcallsif_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_pvcallsif *pvcallsif,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pvcallsif_destroy(libxl_ctx *ctx, uint32_t domid,
+                                   libxl_device_pvcallsif *pvcallsif,
+                                   const libxl_asyncop_how *ao_how)
+                                   LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* PCI Passthrough */
+int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid,
+                         libxl_device_pci *pcidev,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_pci *pcidev,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_pci *pcidev,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid,
+                                        int *num);
+
+/*
+ * Turns the current process into a backend device service daemon
+ * for a driver domain.
+ *
+ * From a libxl API point of view, this starts a long-running
+ * operation.  That operation consists of "being a driver domain"
+ * and never completes.
+ *
+ * Attempting to abort this operation is not advisable; proper
+ * shutdown of the driver domain task is not supported.
+ */
+int libxl_device_events_handler(libxl_ctx *ctx,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Functions related to making devices assignable -- that is, bound to
+ * the pciback driver, ready to be given to a guest via
+ * libxl_pci_device_add.
+ *
+ * - ..._add() will unbind the device from its current driver (if
+ * already bound) and re-bind it to pciback; at that point it will be
+ * ready to be assigned to a VM.  If rebind is set, it will store the
+ * path to the old driver in xenstore so that it can be handed back to
+ * dom0 on restore.
+ *
+ * - ..._remove() will unbind the device from pciback, and if
+ * rebind is non-zero, attempt to assign it back to the driver
+ * from whence it came.
+ *
+ * - ..._list() will return a list of the PCI devices available to be
+ * assigned.
+ *
+ * add and remove are idempotent: if the device in question is already
+ * added or is not bound, the functions will emit a warning but return
+ * SUCCESS.
+ */
+int libxl_device_pci_assignable_add(libxl_ctx *ctx, libxl_device_pci *pcidev, int rebind);
+int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *pcidev, int rebind);
+libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num);
+
+/* CPUID handling */
+int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
+int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
+                                  const char* str);
+#if LIBXL_API_VERSION < 0x041400
+/*
+ * Dropped from the API in Xen 4.14.  At the time of writing, these functions
+ * don't appear to ever have had external callers.
+ *
+ * These have always been used internally during domain construction, and
+ * can't easily be used externally because of their implicit parameters in
+ * other pieces of global state.
+ *
+ * Furthermore, an API user can't usefully determine whether they get
+ * libxl_cpuid (the real implementation) or libxl_nocpuid (no-op stubs).
+ *
+ * The internal behaviour of these functions also needs to change.  Therefore
+ * for simplicitly, provide the no-op stubs.  Yes technically this is an API
+ * change in some cases for existing software, but there is 0 of that in
+ * practice.
+ */
+static inline void libxl_cpuid_apply_policy(libxl_ctx *ctx __attribute__((unused)),
+                                            uint32_t domid __attribute__((unused)))
+{}
+static inline void libxl_cpuid_set(libxl_ctx *ctx __attribute__((unused)),
+                                   uint32_t domid __attribute__((unused)),
+                                   libxl_cpuid_policy_list cpuid __attribute__((unused)))
+{}
+#endif
+
+/*
+ * Functions for allowing users of libxl to store private data
+ * relating to a domain.  The data is an opaque sequence of bytes and
+ * is not interpreted or used by libxl.
+ *
+ * Data is indexed by the userdata userid, which is a short printable
+ * ASCII string.  The following list is a registry of userdata userids
+ * (the registry may be updated by posting a patch to xen-devel):
+ *
+ *  userid        Data contents
+ *  "xl"          domain config file in xl format, Unix line endings
+ *  "libvirt-xml" domain config file in libvirt XML format.  See
+ *                http://libvirt.org/formatdomain.html
+ *  "domain-userdata-lock"  lock file to protect domain userdata in libxl.
+ *                          It's a per-domain lock. Applications should
+ *                          not touch this file.
+ *  "libxl-json"  libxl_domain_config object in JSON format, generated
+ *                by libxl. Applications should not access this file
+ *                directly. This file is protected by domain-userdata-lock
+ *                for against Read-Modify-Write operation and domain
+ *                destruction.
+ *
+ * libxl does not enforce the registration of userdata userids or the
+ * semantics of the data.  For specifications of the data formats
+ * see the code or documentation for the libxl caller in question.
+ */
+int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
+                              const char *userdata_userid,
+                              const uint8_t *data, int datalen)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+  /* If datalen==0, data is not used and the user data for
+   * that domain and userdata_userid is deleted. */
+int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
+                                 const char *userdata_userid,
+                                 uint8_t **data_r, int *datalen_r)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+  /* On successful return, *data_r is from malloc.
+   * If there is no data for that domain and userdata_userid,
+   * *data_r and *datalen_r will be set to 0.
+   * data_r and datalen_r may be 0.
+   * On error return, *data_r and *datalen_r are undefined.
+   */
+int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
+                          const char *userdata_userid);
+
+
+int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
+int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
+                           const libxl_bitmap *cpumap_hard,
+                           const libxl_bitmap *cpumap_soft);
+int libxl_set_vcpuaffinity_force(libxl_ctx *ctx, uint32_t domid,
+                                 uint32_t vcpuid,
+                                 const libxl_bitmap *cpumap_hard,
+                                 const libxl_bitmap *cpumap_soft);
+int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
+                               unsigned int max_vcpus,
+                               const libxl_bitmap *cpumap_hard,
+                               const libxl_bitmap *cpumap_soft);
+
+#if defined (LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
+
+#define libxl_set_vcpuaffinity(ctx, domid, vcpuid, map) \
+    libxl_set_vcpuaffinity((ctx), (domid), (vcpuid), (map), NULL)
+#define libxl_set_vcpuaffinity_all(ctx, domid, max_vcpus, map) \
+    libxl_set_vcpuaffinity_all((ctx), (domid), (max_vcpus), (map), NULL)
+
+#endif
+
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid,
+                         libxl_bitmap *cpumap,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_set_vcpuonline_0x041200(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                libxl_bitmap *cpumap)
+{
+    return libxl_set_vcpuonline(ctx, domid, cpumap, NULL);
+}
+#define libxl_set_vcpuonline libxl_set_vcpuonline_0x041200
+#endif
+
+/* A return value less than 0 should be interpreted as a libxl_error, while a
+ * return value greater than or equal to 0 should be interpreted as a
+ * libxl_scheduler. */
+int libxl_get_scheduler(libxl_ctx *ctx);
+
+/* Per-scheduler parameters */
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit2_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                   libxl_sched_credit2_params *scinfo);
+int libxl_sched_credit2_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                   libxl_sched_credit2_params *scinfo);
+
+/* Scheduler Per-domain parameters */
+
+#define LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT    -1
+#define LIBXL_DOMAIN_SCHED_PARAM_CAP_DEFAULT       -1
+#define LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT    -1
+#define LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT     -1
+#define LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT   -1
+#define LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT -1
+#define LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT    -1
+
+/* Per-VCPU parameters */
+#define LIBXL_SCHED_PARAM_VCPU_INDEX_DEFAULT   -1
+
+/* Get the per-domain scheduling parameters.
+ * For schedulers that support per-vcpu settings (e.g., RTDS),
+ * calling *_domain_get functions will get default scheduling
+ * parameters.
+ */
+int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_domain_sched_params *params);
+
+/* Set the per-domain scheduling parameters.
+ * For schedulers that support per-vcpu settings (e.g., RTDS),
+ * calling *_domain_set functions will set all vcpus with the same
+ * scheduling parameters.
+ */
+int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
+                                  const libxl_domain_sched_params *params);
+
+/* Get the per-vcpu scheduling parameters */
+int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid,
+                                libxl_vcpu_sched_params *params);
+
+/* Get the per-vcpu scheduling parameters of all vcpus of a domain */
+int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, uint32_t domid,
+                                    libxl_vcpu_sched_params *params);
+
+/* Set the per-vcpu scheduling parameters */
+int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid,
+                                const libxl_vcpu_sched_params *params);
+
+/* Set the per-vcpu scheduling parameters of all vcpus of a domain */
+int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, uint32_t domid,
+                                    const libxl_vcpu_sched_params *params);
+
+int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
+                       libxl_trigger trigger, uint32_t vcpuid,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_send_trigger_0x041200(
+    libxl_ctx *ctx, uint32_t domid, libxl_trigger trigger, uint32_t vcpuid)
+{
+    return libxl_send_trigger(ctx, domid, trigger, vcpuid, NULL);
+}
+#define libxl_send_trigger libxl_send_trigger_0x041200
+#endif
+int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
+int libxl_send_debug_keys(libxl_ctx *ctx, char *keys);
+int libxl_set_parameters(libxl_ctx *ctx, char *params);
+
+typedef struct libxl__xen_console_reader libxl_xen_console_reader;
+
+libxl_xen_console_reader *
+    libxl_xen_console_read_start(libxl_ctx *ctx, int clear);
+int libxl_xen_console_read_line(libxl_ctx *ctx,
+                                libxl_xen_console_reader *cr,
+                                char **line_r);
+void libxl_xen_console_read_finish(libxl_ctx *ctx,
+                                   libxl_xen_console_reader *cr);
+
+uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid);
+
+char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long);
+int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid);
+int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid);
+int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name,
+                   uint32_t set);
+int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid, char* uuid,
+                           int auth);
+int libxl_tmem_freeable(libxl_ctx *ctx);
+
+int libxl_get_freecpus(libxl_ctx *ctx, libxl_bitmap *cpumap);
+
+/*
+ * Set poolid to LIBXL_CPUOOL_POOLID_ANY to have Xen choose a
+ * free poolid for you.
+ */
+#define LIBXL_CPUPOOL_POOLID_ANY 0xFFFFFFFF
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
+                         libxl_bitmap cpumap, libxl_uuid *uuid,
+                         uint32_t *poolid);
+int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
+int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid);
+int libxl_cpupool_cpuadd(libxl_ctx *ctx, uint32_t poolid, int cpu);
+int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
+int libxl_cpupool_cpuadd_cpumap(libxl_ctx *ctx, uint32_t poolid,
+                                const libxl_bitmap *cpumap);
+int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
+int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
+int libxl_cpupool_cpuremove_cpumap(libxl_ctx *ctx, uint32_t poolid,
+                                   const libxl_bitmap *cpumap);
+int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
+int libxl_cpupool_info(libxl_ctx *ctx, libxl_cpupoolinfo *info, uint32_t poolid);
+
+int libxl_domid_valid_guest(uint32_t domid);
+
+int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
+                               uint32_t *ssidref);
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf,
+                               size_t *len);
+int libxl_flask_getenforce(libxl_ctx *ctx);
+int libxl_flask_setenforce(libxl_ctx *ctx, int mode);
+int libxl_flask_loadpolicy(libxl_ctx *ctx, void *policy, uint32_t size);
+
+int libxl_ms_vm_genid_generate(libxl_ctx *ctx, libxl_ms_vm_genid *id);
+bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
+void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
+                            const libxl_ms_vm_genid *src);
+
+#if defined(__i386__) || defined(__x86_64__)
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_enabled(libxl_ctx *ctx);
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid);
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx,
+                                    uint32_t socketid,
+                                    uint32_t *l3_cache_size);
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx,
+                                      uint32_t domid,
+                                      uint32_t socketid,
+                                      uint32_t *l3_cache_occupancy);
+
+int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type);
+int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
+                             uint32_t domid,
+                             libxl_psr_cmt_type type,
+                             uint64_t scope,
+                             uint64_t *sample_r,
+                             uint64_t *tsc_r);


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:55:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11055.29308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTR-0005CZ-Qn; Fri, 23 Oct 2020 14:55:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11055.29308; Fri, 23 Oct 2020 14:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTR-0005CS-Ny; Fri, 23 Oct 2020 14:55:21 +0000
Received: by outflank-mailman (input) for mailman id 11055;
 Fri, 23 Oct 2020 14:55:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVyTP-0005CA-Vo
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 375728c3-b529-4027-9765-ea396b829f87;
 Fri, 23 Oct 2020 14:55:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTL-0005rv-Mh
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTL-0004Cu-LL
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVyTP-0005CA-Vo
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:20 +0000
X-Inumbo-ID: 375728c3-b529-4027-9765-ea396b829f87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 375728c3-b529-4027-9765-ea396b829f87;
	Fri, 23 Oct 2020 14:55:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eG7/7NJwthFeeEypbQv2OnJXasEsS/EoslFV4ABXOJs=; b=LUY94WTbV0jyVQkOVqmfhL1C2v
	QvrVkGKZHDXtM1ILYVm/uDCD4k6Vpry6kEF5Xdw67zxOm2JHoNYcAjPiUjFuheMd4a/zj8QtZqT7x
	CLbWTo8MbQgFG1/S9KXTSlbaOi/V/LaJx+2XVp0sTAcTT9h41xmDnB4QoF1XngJm8Opw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTL-0005rv-Mh
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTL-0004Cu-LL
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/guest: don't use symbolic links for xenctrl headers
Message-Id: <E1kVyTL-0004Cu-LL@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:55:15 +0000

commit 588756db020e73e6f5e4407bbf78fbd53f15b731
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:51:01 2020 +0100

    tools/libs/guest: don't use symbolic links for xenctrl headers
    
    Instead of using symbolic links for accessing the xenctrl private
    headers use an include path instead.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/guest/Makefile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 5b4ad313cc..1c729040b3 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -6,11 +6,6 @@ ifeq ($(CONFIG_LIBXC_MINIOS),y)
 override CONFIG_MIGRATE := n
 endif
 
-LINK_FILES := xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bitops.h
-
-$(LINK_FILES):
-	ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@
-
 SRCS-y += xg_private.c
 SRCS-y += xg_domain.c
 SRCS-y += xg_suspend.c
@@ -29,6 +24,8 @@ else
 SRCS-y += xg_nomigrate.c
 endif
 
+CFLAGS += -I$(XEN_libxenctrl)
+
 vpath %.c ../../../xen/common/libelf
 CFLAGS += -I../../../xen/common/libelf
 
@@ -111,8 +108,6 @@ $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-$(LIB_OBJS) $(PIC_OBJS): $(LINK_FILES)
-
 .PHONY: cleanlocal
 cleanlocal:
 	rm -f libxenguest.map
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 14:55:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 14:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11056.29313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTX-0005DV-SJ; Fri, 23 Oct 2020 14:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11056.29313; Fri, 23 Oct 2020 14:55:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVyTX-0005DN-PU; Fri, 23 Oct 2020 14:55:27 +0000
Received: by outflank-mailman (input) for mailman id 11056;
 Fri, 23 Oct 2020 14:55:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVyTW-0005DG-Q8
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f6d35917-4992-4c48-9873-6b237956470d;
 Fri, 23 Oct 2020 14:55:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTV-0005sA-Q5
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVyTV-0004Do-Os
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVyTW-0005DG-Q8
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:26 +0000
X-Inumbo-ID: f6d35917-4992-4c48-9873-6b237956470d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f6d35917-4992-4c48-9873-6b237956470d;
	Fri, 23 Oct 2020 14:55:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Qaw7WYyuyJiyboJMzb3jo5f0aLSod8rH1D4GV71GVFw=; b=ZH+nXFz3YeZ5kVMCTKSMbf0l+f
	XXz6LBKp/N1iiep4M858XbCmDyzetHrzsnFL4j5fBXyCRUfRHNxAmDi/98CBJLd8vxL1ieWFxDUXP
	cwgpoRhYAdcUs/8V+VXjCWs26xfETgRjzLo8k54x4keeXs8oHFbuL6QAtNfIGzMRk+8Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTV-0005sA-Q5
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVyTV-0004Do-Os
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 14:55:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs/store: don't use symbolic links for external files
Message-Id: <E1kVyTV-0004Do-Os@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 14:55:25 +0000

commit 9af5e2b31b4e6f3892b4614ecd0a619af5d64d7e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:51:06 2020 +0100

    tools/libs/store: don't use symbolic links for external files
    
    Instead of using symbolic links to include files from xenstored use
    the vpath directive and an include path.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/store/Makefile | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 930e763de9..bc89b9cd70 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -21,12 +21,8 @@ CFLAGS += $(CFLAGS_libxentoolcore)
 CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
-LINK_FILES = xs_lib.c list.h utils.h
-
-$(LIB_OBJS): $(LINK_FILES)
-
-$(LINK_FILES):
-	ln -sf $(XEN_ROOT)/tools/xenstore/$@ $@
+vpath xs_lib.c $(XEN_ROOT)/tools/xenstore
+CFLAGS += -I $(XEN_ROOT)/tools/xenstore
 
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 16:11:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 16:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11144.29529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVzem-0006f7-Hx; Fri, 23 Oct 2020 16:11:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11144.29529; Fri, 23 Oct 2020 16:11:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVzem-0006ez-En; Fri, 23 Oct 2020 16:11:08 +0000
Received: by outflank-mailman (input) for mailman id 11144;
 Fri, 23 Oct 2020 16:11:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVzel-0006et-5l
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a06a3794-a144-4b81-b41e-121598469e68;
 Fri, 23 Oct 2020 16:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVzej-00082P-Kc
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVzej-000227-Jb
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVzel-0006et-5l
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:07 +0000
X-Inumbo-ID: a06a3794-a144-4b81-b41e-121598469e68
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a06a3794-a144-4b81-b41e-121598469e68;
	Fri, 23 Oct 2020 16:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fZG7vTb1jdGBxTBSl5r15V7hHwv8crMwehFR39JDMsI=; b=MPXlDDIAxnQQPj+qHZ45I8FmfT
	cn+V4QCjgAXDu7QMlt10wZQvZ6wt6579N7IGkoBhfK6DO+Hoxg1qquf/WSvtQE4AY69vLToh4B1St
	fnxFn15ftQf5cTLuzlZuXxSvXPcD3V18FmtDQw13BNe5VkvGmDY8Zn7H0oovlZqDku5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVzej-00082P-Kc
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVzej-000227-Jb
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: fix PINSRW and adjust other {,V}PINSR*
Message-Id: <E1kVzej-000227-Jb@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 16:11:05 +0000

commit 06f0598b41f23c9e4cf7d8c5a05b282de92f3a35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 18:03:18 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 18:03:18 2020 +0200

    x86emul: fix PINSRW and adjust other {,V}PINSR*
    
    The use of simd_packed_int together with no further update to op_bytes
    has lead to wrong signaling of #GP(0) for PINSRW without a 16-byte
    aligned memory operand. Use simd_none instead and override it after
    general decoding with simd_other, like is done for the B/D/Q siblings.
    
    While benign, for consistency also use DstImplicit instead of DstReg
    in x86_decode_twobyte().
    
    PINSR{B,D,Q} also had a stray (redundant) get_fpu() invocation, which
    gets dropped.
    
    For further consistency also
    - use src.bytes instead of op_bytes in relevant memcpy() invocations,
    - avoid the pointless updating of op_bytes (all we care about later is
      that the value be less than 16).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 41883ad6d8..fd70551bc2 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -362,7 +362,7 @@ static const struct twobyte_table {
     [0xc1] = { DstMem|SrcReg|ModRM },
     [0xc2] = { DstImplicit|SrcImmByte|ModRM, simd_any_fp, d8s_vl },
     [0xc3] = { DstMem|SrcReg|ModRM|Mov },
-    [0xc4] = { DstReg|SrcImmByte|ModRM, simd_packed_int, 1 },
+    [0xc4] = { DstImplicit|SrcImmByte|ModRM, simd_none, 1 },
     [0xc5] = { DstReg|SrcImmByte|ModRM|Mov },
     [0xc6] = { DstImplicit|SrcImmByte|ModRM, simd_packed_fp, d8s_vl },
     [0xc7] = { ImplicitOps|ModRM },
@@ -2786,7 +2786,7 @@ x86_decode_twobyte(
         /* fall through */
     case X86EMUL_OPC_VEX_66(0, 0xc4): /* vpinsrw */
     case X86EMUL_OPC_EVEX_66(0, 0xc4): /* vpinsrw */
-        state->desc = DstReg | SrcMem16;
+        state->desc = DstImplicit | SrcMem16;
         break;
 
     case 0xf0:
@@ -8589,6 +8589,7 @@ x86_emulate(
         generate_exception_if(vex.l, EXC_UD);
         memcpy(mmvalp, &src.val, 2);
         ea.type = OP_MEM;
+        state->simd_size = simd_other;
         goto simd_0f_int_imm8;
 
 #ifndef X86EMUL_NO_SIMD
@@ -8603,9 +8604,8 @@ x86_emulate(
             host_and_vcpu_must_have(avx512bw);
         if ( !mode_64bit() )
             evex.w = 0;
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto avx512f_imm8_no_sae;
@@ -10774,10 +10774,8 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f3a, 0x20): /* pinsrb $imm8,r32/m8,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0x22): /* pinsr{d,q} $imm8,r/m,xmm */
         host_and_vcpu_must_have(sse4_1);
-        get_fpu(X86EMUL_FPU_xmm);
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto simd_0f3a_common;
@@ -10787,9 +10785,8 @@ x86_emulate(
         generate_exception_if(vex.l, EXC_UD);
         if ( !mode_64bit() )
             vex.w = 0;
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto simd_0f_int_imm8;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 23 16:22:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Oct 2020 16:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11156.29557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVzpP-0007qn-Sf; Fri, 23 Oct 2020 16:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11156.29557; Fri, 23 Oct 2020 16:22:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kVzpP-0007qf-PW; Fri, 23 Oct 2020 16:22:07 +0000
Received: by outflank-mailman (input) for mailman id 11156;
 Fri, 23 Oct 2020 16:22:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kVzpO-0007qa-87
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 12cc4dc0-fa3a-4385-a10a-e5fcb953857d;
 Fri, 23 Oct 2020 16:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVzpN-0008GA-3G
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kVzpN-0002zm-0g
 for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=X7yl=D6=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kVzpO-0007qa-87
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:06 +0000
X-Inumbo-ID: 12cc4dc0-fa3a-4385-a10a-e5fcb953857d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 12cc4dc0-fa3a-4385-a10a-e5fcb953857d;
	Fri, 23 Oct 2020 16:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PCHH2du3BXEr0+lSSviWjyjw1tX7XEA1VZ1nEW07Bgk=; b=r5JEsn30f3nJmhchYFS/yYlgL6
	RtnQ3vY/5pmniwCKTXaP9+U4IPh3mL/6yhWUJfvQ4sL+G2oTiWvXosI9rGW/kZXoM4n7rS0hBeCHS
	oEPgZ0+aGKOnhWctR0s4kA1h8+CwdGtOQajyfWdgnqa8D5Br+sHGjVqXrBwhSy7bSovA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVzpN-0008GA-3G
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kVzpN-0002zm-0g
	for xen-changelog@lists.xenproject.org; Fri, 23 Oct 2020 16:22:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] SUPPORT: Add linux device model stubdom to Toolstack
Message-Id: <E1kVzpN-0002zm-0g@xenbits.xenproject.org>
Date: Fri, 23 Oct 2020 16:22:05 +0000

commit 4ddd6499d999a7d08cabfda5b0262e473dd5beed
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Sun May 24 22:55:06 2020 -0400
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 23 17:14:08 2020 +0100

    SUPPORT: Add linux device model stubdom to Toolstack
    
    Add qemu-xen linux device model stubdomain to the Toolstack section as a
    Tech Preview.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 SUPPORT.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index f35943a432..5fbe5fc444 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -167,6 +167,12 @@ Go (golang) bindings for libxl
 
     Status: Experimental
 
+### Linux device model stubdomains
+
+Support for running qemu-xen device model in a linux stubdomain.
+
+    Status: Tech Preview
+
 ## Toolstack/3rd party
 
 ### libvirt driver for xl
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11481.30459 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOK-0000lf-8C; Sat, 24 Oct 2020 07:55:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11481.30459; Sat, 24 Oct 2020 07:55:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOK-0000lX-58; Sat, 24 Oct 2020 07:55:08 +0000
Received: by outflank-mailman (input) for mailman id 11481;
 Sat, 24 Oct 2020 07:55:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEOI-0000kt-Ms
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 01129ea3-a6b0-4482-8e13-f5c968a51f1d;
 Sat, 24 Oct 2020 07:55:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOE-00085u-Nb
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOE-0004aa-LN
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEOI-0000kt-Ms
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:06 +0000
X-Inumbo-ID: 01129ea3-a6b0-4482-8e13-f5c968a51f1d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 01129ea3-a6b0-4482-8e13-f5c968a51f1d;
	Sat, 24 Oct 2020 07:55:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=96mruJPtbLn3lbs08TamrMTOv7gBz7qskh0J/taLqtg=; b=J+y0PAfhNtnvTI6qlrnu404QxJ
	j6BoRTy1y2tXe4l/vo46C3PnyHDx+Xi9MBwgNdjnfeCnrx6O6o8i0WVDVadfRqs7xGAj+RhkjVjih
	Orqufp63xOS6x4c0God1WTUL/io1y3AHH9eSePr/i89lNW8uRcUUOtgDv9gNWiK5qWjY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOE-00085u-Nb
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOE-0004aa-LN
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: free unused boot mem in at least some cases
Message-Id: <E1kWEOE-0004aa-LN@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:02 +0000

commit 25467bb5d121735af4969834a62bca752a7bfe10
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:52:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:52:53 2020 +0200

    EFI: free unused boot mem in at least some cases
    
    Address at least the primary reason why 52bba67f8b87 ("efi/boot: Don't
    free ebmalloc area at all") was put in place: Make xen_in_range() aware
    of the freed range. This is in particular relevant for EFI-enabled
    builds not actually running on EFI, as the entire range will be unused
    in this case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/efi/stub.c   |  8 ++++++++
 xen/arch/x86/setup.c      | 26 +++++++++++++++++++++++---
 xen/arch/x86/tboot.c      | 12 ++++++++++++
 xen/common/efi/ebmalloc.c | 32 +++++++++++++++++++++++++++-----
 xen/include/xen/efi.h     |  1 +
 5 files changed, 71 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c
index c578bffc71..9984932626 100644
--- a/xen/arch/x86/efi/stub.c
+++ b/xen/arch/x86/efi/stub.c
@@ -52,6 +52,14 @@ bool efi_enabled(unsigned int feature)
 
 void __init efi_init_memory(void) { }
 
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
+{
+    /* FIXME: Simplify once the call here with two NULLs goes away. */
+    if ( start || end )
+        *start = *end = (unsigned long)_end;
+    return false;
+}
+
 void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { }
 
 bool efi_rs_using_pgtables(void)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 4b15e067fa..44c04e2735 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -830,6 +830,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     module_t *mod;
     unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
     int i, j, e820_warn = 0, bytes = 0;
+    unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
     int ret;
     struct ns16550_defaults ns16550 = {
@@ -1145,7 +1146,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
         /*
          * This needs to remain in sync with xen_in_range() and the
-         * respective reserve_e820_ram() invocation below.
+         * respective reserve_e820_ram() invocation below. No need to
+         * query efi_boot_mem_unused() here, though.
          */
         mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
         mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
@@ -1417,8 +1419,18 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( !xen_phys_start )
         panic("Not enough memory to relocate Xen\n");
 
+    /* FIXME: Putting a hole in .bss would shatter the large page mapping. */
+    if ( using_2M_mapping() )
+        efi_boot_mem_unused(NULL, NULL);
+
     /* This needs to remain in sync with xen_in_range(). */
-    reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
+    if ( efi_boot_mem_unused(&eb_start, &eb_end) )
+    {
+        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
+        reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
+    }
+    else
+        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
 
     /* Late kexec reservation (dynamic start address). */
     kexec_reserve_area(&boot_e820);
@@ -1979,7 +1991,7 @@ int __hwdom_init xen_in_range(unsigned long mfn)
     paddr_t start, end;
     int i;
 
-    enum { region_s3, region_ro, region_rw, nr_regions };
+    enum { region_s3, region_ro, region_rw, region_bss, nr_regions };
     static struct {
         paddr_t s, e;
     } xen_regions[nr_regions] __hwdom_initdata;
@@ -2004,6 +2016,14 @@ int __hwdom_init xen_in_range(unsigned long mfn)
         /* hypervisor .data + .bss */
         xen_regions[region_rw].s = __pa(&__2M_rwdata_start);
         xen_regions[region_rw].e = __pa(&__2M_rwdata_end);
+        if ( efi_boot_mem_unused(&start, &end) )
+        {
+            ASSERT(__pa(start) >= xen_regions[region_rw].s);
+            ASSERT(__pa(end) <= xen_regions[region_rw].e);
+            xen_regions[region_rw].e = __pa(start);
+            xen_regions[region_bss].s = __pa(end);
+            xen_regions[region_bss].e = __pa(&__2M_rwdata_end);
+        }
     }
 
     start = (paddr_t)mfn << PAGE_SHIFT;
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index e66b0940c4..aadcce591f 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -1,3 +1,4 @@
+#include <xen/efi.h>
 #include <xen/init.h>
 #include <xen/types.h>
 #include <xen/lib.h>
@@ -364,6 +365,8 @@ void tboot_shutdown(uint32_t shutdown_type)
     /* if this is S3 then set regions to MAC */
     if ( shutdown_type == TB_SHUTDOWN_S3 )
     {
+        unsigned long s, e;
+
         /*
          * Xen regions for tboot to MAC. This needs to remain in sync with
          * xen_in_range().
@@ -378,6 +381,15 @@ void tboot_shutdown(uint32_t shutdown_type)
         /* hypervisor .data + .bss */
         g_tboot_shared->mac_regions[2].start = (uint64_t)__pa(&__2M_rwdata_start);
         g_tboot_shared->mac_regions[2].size = __2M_rwdata_end - __2M_rwdata_start;
+        if ( efi_boot_mem_unused(&s, &e) )
+        {
+            g_tboot_shared->mac_regions[2].size =
+                s - (unsigned long)__2M_rwdata_start;
+            g_tboot_shared->mac_regions[3].start = __pa(e);
+            g_tboot_shared->mac_regions[3].size =
+                (unsigned long)__2M_rwdata_end - e;
+            g_tboot_shared->num_mac_regions = 4;
+        }
 
         /*
          * MAC domains and other Xen memory
diff --git a/xen/common/efi/ebmalloc.c b/xen/common/efi/ebmalloc.c
index c65dbd946f..e19b496ab4 100644
--- a/xen/common/efi/ebmalloc.c
+++ b/xen/common/efi/ebmalloc.c
@@ -1,5 +1,6 @@
 #include "efi.h"
 #include <xen/init.h>
+#include <xen/mm.h>
 
 #ifdef CONFIG_ARM
 /*
@@ -21,7 +22,7 @@
 
 static char __section(".bss.page_aligned") __aligned(PAGE_SIZE)
     ebmalloc_mem[EBMALLOC_SIZE];
-static unsigned long __initdata ebmalloc_allocated;
+static unsigned long __read_mostly ebmalloc_allocated;
 
 /* EFI boot allocator. */
 void __init *ebmalloc(size_t size)
@@ -36,17 +37,38 @@ void __init *ebmalloc(size_t size)
     return ptr;
 }
 
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
+{
+    /* FIXME: Drop once the call here with two NULLs goes away. */
+    if ( !start && !end )
+    {
+        ebmalloc_allocated = sizeof(ebmalloc_mem);
+        return false;
+    }
+
+    *start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated);
+    *end = (unsigned long)ebmalloc_mem + sizeof(ebmalloc_mem);
+
+    return *start < *end;
+}
+
 void __init free_ebmalloc_unused_mem(void)
 {
-#if 0 /* FIXME: Putting a hole in the BSS breaks the IOMMU mappings for dom0. */
     unsigned long start, end;
 
-    start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated);
-    end = (unsigned long)ebmalloc_mem + sizeof(ebmalloc_mem);
+    if ( !efi_boot_mem_unused(&start, &end) )
+        return;
 
     destroy_xen_mappings(start, end);
+
+#ifdef CONFIG_X86
+    /*
+     * By reserving the space early in the E820 map, it gets freed way before
+     * we make it here. Don't free the range a 2nd time.
+     */
+#else
     init_xenheap_pages(__pa(start), __pa(end));
+#endif
 
     printk(XENLOG_INFO "Freed %lukB unused BSS memory\n", (end - start) >> 10);
-#endif
 }
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 44b7d3ec3a..94a7e547f9 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -33,6 +33,7 @@ struct compat_pf_efi_runtime_call;
 
 bool efi_enabled(unsigned int feature);
 void efi_init_memory(void);
+bool efi_boot_mem_unused(unsigned long *start, unsigned long *end);
 bool efi_rs_using_pgtables(void);
 unsigned long efi_get_time(void);
 void efi_halt_system(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11482.30462 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOR-0000mw-9v; Sat, 24 Oct 2020 07:55:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11482.30462; Sat, 24 Oct 2020 07:55:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOR-0000mo-6m; Sat, 24 Oct 2020 07:55:15 +0000
Received: by outflank-mailman (input) for mailman id 11482;
 Sat, 24 Oct 2020 07:55:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEOP-0000mT-Md
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 664c16d6-e4d0-4ee8-86e3-c1e72bff778b;
 Sat, 24 Oct 2020 07:55:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOO-00085x-SP
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOO-0004bG-QJ
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEOP-0000mT-Md
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:13 +0000
X-Inumbo-ID: 664c16d6-e4d0-4ee8-86e3-c1e72bff778b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 664c16d6-e4d0-4ee8-86e3-c1e72bff778b;
	Sat, 24 Oct 2020 07:55:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZWo0idJvUcpaSIQPk7PHdG97TLMjDumOqatt1V1+Ytk=; b=hwYLQAI8uPXp0ZQ4RtDStbM3FZ
	C5FfQgqtRfsENTM0445Pu/xEeh+PKiNASuhfXwfkRQ2i6WrxQu6ghD/wCuZrpTPn5Spa7CEXIUAsd
	3QjGv4RjmKcMmW+RpIhhUjX//ubeZ5mdSHzjhwxTgsHX1YvERK6OR1KrpMdELQVFHizU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOO-00085x-SP
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOO-0004bG-QJ
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen-detect: make CPUID fallback CPUID-faulting aware
Message-Id: <E1kWEOO-0004bG-QJ@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:12 +0000

commit 7b36d16d21ae70a1eaabe577b7e4b42ed0f1a7d1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:53:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:53:53 2020 +0200

    xen-detect: make CPUID fallback CPUID-faulting aware
    
    Relying on presence / absence of hypervisor leaves in raw / escaped
    CPUID output cannot be used to tell apart PV and HVM on CPUID faulting
    capable hardware. Utilize a PV-only feature flag to avoid false positive
    HVM detection.
    
    While at it also short circuit the main detection loop: For PV, only
    the base group of leaves can possibly hold hypervisor information.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/misc/xen-detect.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/misc/xen-detect.c b/tools/misc/xen-detect.c
index fd187a4be6..eac9e46a35 100644
--- a/tools/misc/xen-detect.c
+++ b/tools/misc/xen-detect.c
@@ -83,11 +83,31 @@ static int check_for_xen(int pv_context)
 
         if ( !strcmp("XenVMMXenVMM", signature) && (regs[0] >= (base + 2)) )
             goto found;
+
+        /* Higher base addresses are possible only with HVM. */
+        if ( pv_context )
+            break;
     }
 
     return 0;
 
  found:
+    /*
+     * On CPUID faulting capable hardware even un-escaped CPUID will return
+     * the hypervisor leaves. Need to further distinguish modes.
+     */
+    if ( !pv_context )
+    {
+        /*
+         * XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD is a PV-only feature
+         * pre-dating CPUID faulting support in Xen. Hence we can use it to
+         * tell whether we shouldn't report "success" to our caller here.
+         */
+        cpuid(base + 2, regs, 0);
+        if ( regs[2] & (1u << 0) )
+            return 0;
+    }
+
     cpuid(base + 1, regs, pv_context);
     if ( regs[0] )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11484.30467 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOb-0000oo-D4; Sat, 24 Oct 2020 07:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11484.30467; Sat, 24 Oct 2020 07:55:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOb-0000og-9u; Sat, 24 Oct 2020 07:55:25 +0000
Received: by outflank-mailman (input) for mailman id 11484;
 Sat, 24 Oct 2020 07:55:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEOZ-0000oW-TR
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 19d3d676-0ea7-4bbf-8b6a-b227f9948972;
 Sat, 24 Oct 2020 07:55:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOZ-00086B-0U
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOY-0004bu-Uq
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEOZ-0000oW-TR
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:23 +0000
X-Inumbo-ID: 19d3d676-0ea7-4bbf-8b6a-b227f9948972
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 19d3d676-0ea7-4bbf-8b6a-b227f9948972;
	Sat, 24 Oct 2020 07:55:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8rfb56GbgzaA4y2O9FS5Ik+DhIssiBjEu7NW/mBjVI4=; b=6ojjM9DL9kq4xZhPfWp+qmaj63
	0bwHVVMLzjXngKwlqDqPeZE/96AGcLIBl98Bacb3hV6Q7Na4XPj3bpHTE9CTDyupb3vjaiuci2BZN
	HhG1xj++qPprPRsrEkdfAMLE2InseZMxN0xtlDuNO+geXj+PvebEhOhnCjGOUnBzc1F8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOZ-00086B-0U
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOY-0004bu-Uq
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
Message-Id: <E1kWEOY-0004bu-Uq@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:22 +0000

commit de6d188a519f9e3b7a1acc7784adf4c243865f9a
Author:     Igor Druzhinin <igor.druzhinin@citrix.com>
AuthorDate: Tue Oct 20 08:54:23 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:54:23 2020 +0200

    hvmloader: flip "ACPI data" to "ACPI NVS" type for ACPI table region
    
    ACPI specification contains statements describing memory marked with regular
    "ACPI data" type as reclaimable by the guest. Although the guest shouldn't
    really do it if it wants kexec or similar functionality to work, there
    could still be ambiguities in treating these regions as potentially regular
    RAM.
    
    One such example is SeaBIOS which currently reports "ACPI data" regions as
    RAM to the guest in its e801 call. Which it might have the right to do as any
    user of this is expected to be ACPI unaware. But a QEMU bootloader later seems
    to ignore that fact and is instead using e801 to find a place for initrd which
    causes the tables to be erased. While arguably QEMU bootloader or SeaBIOS need
    to be fixed / improved here, that is just one example of the potential problems
    from using a reclaimable memory type.
    
    Flip the type to "ACPI NVS" which doesn't have this ambiguity in it and is
    described by the spec as non-reclaimable (so cannot ever be treated like RAM).
    
    Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/firmware/hvmloader/e820.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/e820.c b/tools/firmware/hvmloader/e820.c
index 38bcf18b63..c490a0bc79 100644
--- a/tools/firmware/hvmloader/e820.c
+++ b/tools/firmware/hvmloader/e820.c
@@ -202,16 +202,21 @@ int build_e820_table(struct e820entry *e820,
     nr++;
 
     /*
-     * Mark populated reserved memory that contains ACPI tables as ACPI data.
+     * Mark populated reserved memory that contains ACPI tables as ACPI NVS.
      * That should help the guest to treat it correctly later: e.g. pass to
-     * the next kernel on kexec or reclaim if necessary.
+     * the next kernel on kexec.
+     *
+     * Using NVS type instead of a regular one helps to prevent potential
+     * space reuse by an ACPI unaware / buggy bootloader, option ROM, etc.
+     * before an ACPI OS takes control. This is possible due to the fact that
+     * ACPI NVS memory is explicitly described as non-reclaimable in ACPI spec.
      */
 
     if ( acpi_enabled )
     {
         e820[nr].addr = RESERVED_MEMBASE;
         e820[nr].size = acpi_mem_end - RESERVED_MEMBASE;
-        e820[nr].type = E820_ACPI;
+        e820[nr].type = E820_NVS;
         nr++;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11485.30472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOn-0000qw-FI; Sat, 24 Oct 2020 07:55:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11485.30472; Sat, 24 Oct 2020 07:55:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOn-0000qn-Be; Sat, 24 Oct 2020 07:55:37 +0000
Received: by outflank-mailman (input) for mailman id 11485;
 Sat, 24 Oct 2020 07:55:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEOm-0000qg-Tq
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 47b0cff1-efe3-4534-af40-8dd286bf3248;
 Sat, 24 Oct 2020 07:55:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOj-000872-4O
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOj-0004cg-38
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEOm-0000qg-Tq
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:36 +0000
X-Inumbo-ID: 47b0cff1-efe3-4534-af40-8dd286bf3248
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 47b0cff1-efe3-4534-af40-8dd286bf3248;
	Sat, 24 Oct 2020 07:55:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=stoTRLAlblH8u3bm/NzYk60jUMSx4ai/jXFivyUw39A=; b=nE82T/U933butAfNM+xfAhJJvu
	1Trl2HGWXP0UdQdyomW2lMR6QNqfgON/mNu68n/f65thgCtZgqDVlB0BDLT6maRE20eTQyYDI5PCQ
	PjVqmYK6pXEk8hMjAj3LNVeskrYEhux1+E+Upj8kqxJrNvlBmn7mcYOxBtzCLUilVBUM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOj-000872-4O
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOj-0004cg-38
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SVM: avoid VMSAVE in ctxt-switch-to
Message-Id: <E1kWEOj-0004cg-38@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:33 +0000

commit a7f0831e58bf4681d710e9a029644b6fa07b7cb0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 08:54:59 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 08:54:59 2020 +0200

    SVM: avoid VMSAVE in ctxt-switch-to
    
    Of the state saved by the insn and reloaded by the corresponding VMLOAD
    - TR and syscall state are invariant while having Xen's state loaded,
    - sysenter is unused altogether by Xen,
    - FS, GS, and LDTR are not used by Xen and get suitably set in PV
      context switch code.
    Note that state is suitably populated in _svm_cpu_up(); a minimal
    respective assertion gets added.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/svm.c | 3 ++-
 xen/include/asm-x86/desc.h | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 9b65445577..cfea5b5523 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -984,7 +984,6 @@ static void svm_ctxt_switch_to(struct vcpu *v)
 
     svm_restore_dr(v);
 
-    svm_vmsave_pa(per_cpu(host_vmcb, cpu));
     vmcb->cleanbits.raw = 0;
     svm_tsc_ratio_load(v);
 
@@ -1609,6 +1608,8 @@ static int _svm_cpu_up(bool bsp)
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
 
+    /* Minimal checking that enough CPU setup was done by now. */
+    ASSERT(str() == TSS_SELECTOR);
     svm_vmsave_pa(per_cpu(host_vmcb, cpu));
 
     return 0;
diff --git a/xen/include/asm-x86/desc.h b/xen/include/asm-x86/desc.h
index 24db3e9510..dfa643925f 100644
--- a/xen/include/asm-x86/desc.h
+++ b/xen/include/asm-x86/desc.h
@@ -236,6 +236,15 @@ static inline void ltr(unsigned int sel)
     __asm__ __volatile__ ( "ltr %w0" :: "rm" (sel) : "memory" );
 }
 
+static inline unsigned int str(void)
+{
+    unsigned int sel;
+
+    __asm__ ( "str %0" : "=r" (sel) );
+
+    return sel;
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ARCH_DESC_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11486.30474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOv-0000s4-GE; Sat, 24 Oct 2020 07:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11486.30474; Sat, 24 Oct 2020 07:55:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEOv-0000rv-DE; Sat, 24 Oct 2020 07:55:45 +0000
Received: by outflank-mailman (input) for mailman id 11486;
 Sat, 24 Oct 2020 07:55:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEOu-0000rk-69
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c7deff48-413f-4b5f-900a-a9db41349213;
 Sat, 24 Oct 2020 07:55:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOt-00087A-87
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEOt-0004dI-7C
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEOu-0000rk-69
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:44 +0000
X-Inumbo-ID: c7deff48-413f-4b5f-900a-a9db41349213
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c7deff48-413f-4b5f-900a-a9db41349213;
	Sat, 24 Oct 2020 07:55:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1DZsCzV90/y9bgE8ZQYpluzKLUrHSQayzRs6Bn1oKXM=; b=SotQu+0HjWHOwpP8ldOcTRIgAj
	Pa+/ybV/reHYkpgkVibeGDOGkf6cyWJmch3by7ZuZQPt2dcaR6AmdxTWSp5XFaT7YRBnXHQKv1MZ8
	9hg6uLAmUohl0RvZkTDEJBlnhbuyECzaP6ShkM5cwr63p68Hx9AVGcuyO+30mOP6TxQ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOt-00087A-87
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEOt-0004dI-7C
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: Refactor map_pages_to_xen to have only a single exit path
Message-Id: <E1kWEOt-0004dI-7C@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:43 +0000

commit 08e6c6f80b018878476adc2c4e5679d2ce5cb4b1
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sat Jan 11 21:57:41 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:19:31 2020 +0200

    x86/mm: Refactor map_pages_to_xen to have only a single exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 8c8f054186..0495b6891a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -275,7 +275,7 @@ static l4_pgentry_t __read_mostly split_l4e;
  * Originally cloned from share_xen_page_with_guest(), just to avoid setting
  * PGC_xen_heap on non-heap (typically) MMIO pages. Other pieces got dropped
  * simply because they're not needed in this context.
- */ 
+ */
 static void __init assign_io_page(struct page_info *page)
 {
     set_gpfn_from_mfn(mfn_x(page_to_mfn(page)), INVALID_M2P_ENTRY);
@@ -5079,6 +5079,7 @@ int map_pages_to_xen(
     l2_pgentry_t *pl2e, ol2e;
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
+    int rc = -ENOMEM;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5099,7 +5100,8 @@ int map_pages_to_xen(
         l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
 
         if ( !pl3e )
-            return -ENOMEM;
+            goto out;
+
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5189,7 +5191,7 @@ int map_pages_to_xen(
 
             l2t = alloc_xen_pagetable();
             if ( l2t == NULL )
-                return -ENOMEM;
+                goto out;
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
@@ -5218,7 +5220,7 @@ int map_pages_to_xen(
 
         pl2e = virt_to_xen_l2e(virt);
         if ( !pl2e )
-            return -ENOMEM;
+            goto out;
 
         if ( ((((virt >> PAGE_SHIFT) | mfn_x(mfn)) &
                ((1u << PAGETABLE_ORDER) - 1)) == 0) &&
@@ -5262,7 +5264,7 @@ int map_pages_to_xen(
             {
                 pl1e = virt_to_xen_l1e(virt);
                 if ( pl1e == NULL )
-                    return -ENOMEM;
+                    goto out;
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -5290,7 +5292,7 @@ int map_pages_to_xen(
 
                 l1t = alloc_xen_pagetable();
                 if ( l1t == NULL )
-                    return -ENOMEM;
+                    goto out;
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
@@ -5436,7 +5438,10 @@ int map_pages_to_xen(
 
 #undef flush_flags
 
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 int populate_pt_range(unsigned long virt, unsigned long nr_mfns)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:55:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11487.30479 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEP5-0000tf-I4; Sat, 24 Oct 2020 07:55:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11487.30479; Sat, 24 Oct 2020 07:55:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEP5-0000tW-Es; Sat, 24 Oct 2020 07:55:55 +0000
Received: by outflank-mailman (input) for mailman id 11487;
 Sat, 24 Oct 2020 07:55:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEP4-0000tK-6i
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b893c897-2a42-42ed-9a2a-dedcd8c20c26;
 Sat, 24 Oct 2020 07:55:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEP3-00087K-Bj
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEP3-0004dz-Aw
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEP4-0000tK-6i
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:54 +0000
X-Inumbo-ID: b893c897-2a42-42ed-9a2a-dedcd8c20c26
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b893c897-2a42-42ed-9a2a-dedcd8c20c26;
	Sat, 24 Oct 2020 07:55:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+isvgbLD1wtuZRmuWkCCrFASp60oaMsIC1qytbXN66w=; b=LbxMm/ioqLjETPHPNkm7/SSG4p
	kUcgN1YMZPcoLwYnEQ/ys1Pjyd8zEo1CPE3XOjuc+ImgqHVGkXYWzv89qrQQUVcv/cS3EtI5OK4yM
	59HGX6QT7buanOvt2YCyNJgjVcJyHQDJs0kWqEyK0Igj4VBos1mTP/hF/dSobr/9ldF0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEP3-00087K-Bj
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEP3-0004dz-Aw
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:55:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: Refactor modify_xen_mappings to have one exit path
Message-Id: <E1kWEP3-0004dz-Aw@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:55:53 +0000

commit b733f8a8b8db83f2d438cab3adb38b387cecfce0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Sat Jan 11 21:57:42 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:19:55 2020 +0200

    x86/mm: Refactor modify_xen_mappings to have one exit path
    
    We will soon need to perform clean-ups before returning.
    
    No functional change.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0495b6891a..1b8202852e 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5468,6 +5468,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     l1_pgentry_t *pl1e;
     unsigned int  i;
     unsigned long v = s;
+    int rc = -ENOMEM;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5511,7 +5512,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             /* PAGE1GB: shatter the superpage and fall through. */
             l2t = alloc_xen_pagetable();
             if ( !l2t )
-                return -ENOMEM;
+                goto out;
+
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
                           l2e_from_pfn(l3e_get_pfn(*pl3e) +
@@ -5568,7 +5570,8 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 /* PSE: shatter the superpage and try again. */
                 l1t = alloc_xen_pagetable();
                 if ( !l1t )
-                    return -ENOMEM;
+                    goto out;
+
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
@@ -5701,7 +5704,10 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     flush_area(NULL, FLUSH_TLB_GLOBAL);
 
 #undef FLAGS_MASK
-    return 0;
+    rc = 0;
+
+ out:
+    return rc;
 }
 
 #undef flush_area
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11488.30482 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPF-0000v6-JQ; Sat, 24 Oct 2020 07:56:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11488.30482; Sat, 24 Oct 2020 07:56:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPF-0000uy-GT; Sat, 24 Oct 2020 07:56:05 +0000
Received: by outflank-mailman (input) for mailman id 11488;
 Sat, 24 Oct 2020 07:56:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEPE-0000uo-NZ
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bb7fdae0-8d0f-45d1-9cac-349b3d105d16;
 Sat, 24 Oct 2020 07:56:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPD-00087e-G6
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPD-0004ez-EZ
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEPE-0000uo-NZ
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:04 +0000
X-Inumbo-ID: bb7fdae0-8d0f-45d1-9cac-349b3d105d16
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bb7fdae0-8d0f-45d1-9cac-349b3d105d16;
	Sat, 24 Oct 2020 07:56:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MS2Q/7L8k5cwXbdwIo13tPlpIt9ljyatq5iW1qdrSLY=; b=wmudZNAx7B8U/8F0bSJL20WY6h
	lZdj1YT8d5qnDwgPV+C3sXFqmmunl5Nq3p3m8/CiTALZSIOHUQ507ScOyco7DylMec2TNQ9dlnHKO
	Fr9g6mS1fGxp6Kyju6t2iRRAwuju98K35dQ6sEH/gbpB+MjWJISh2u4Mu8tCEizPu3G4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPD-00087e-G6
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPD-0004ez-EZ
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: Prevent some races in hypervisor mapping updates
Message-Id: <E1kWEPD-0004ez-EZ@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:03 +0000

commit 1ce75e99d75907aaffae05fcf658a833802bce49
Author:     Hongyan Xia <hongyxia@amazon.com>
AuthorDate: Sat Jan 11 21:57:43 2020 +0000
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:20:19 2020 +0200

    x86/mm: Prevent some races in hypervisor mapping updates
    
    map_pages_to_xen will attempt to coalesce mappings into 2MiB and 1GiB
    superpages if possible, to maximize TLB efficiency.  This means both
    replacing superpage entries with smaller entries, and replacing
    smaller entries with superpages.
    
    Unfortunately, while some potential races are handled correctly,
    others are not.  These include:
    
    1. When one processor modifies a sub-superpage mapping while another
    processor replaces the entire range with a superpage.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and
    B.
    
    * A walks the pagetables, get a pointer to L2.
    * B replaces L3[N] with a 1GiB mapping.
    * B Frees L2
    * A writes L2[M] #
    
    This is race exacerbated by the fact that virt_to_xen_l[21]e doesn't
    handle higher-level superpages properly: If you call virt_xen_to_l2e
    on a virtual address within an L3 superpage, you'll either hit a BUG()
    (most likely), or get a pointer into the middle of a data page; same
    with virt_xen_to_l1 on a virtual address within either an L3 or L2
    superpage.
    
    So take the following example:
    
    * A reads pl3e and discovers it to point to an L2.
    * B replaces L3[N] with a 1GiB mapping
    * A calls virt_to_xen_l2e() and hits the BUG_ON() #
    
    2. When two processors simultaneously try to replace a sub-superpage
    mapping with a superpage mapping.
    
    Take the following example:
    
    Suppose L3[N] points to L2.  And suppose we have two processors, A and B,
    both trying to replace L3[N] with a superpage.
    
    * A walks the pagetables, get a pointer to pl3e, and takes a copy ol3e pointing to L2.
    * B walks the pagetables, gets a pointre to pl3e, and takes a copy ol3e pointing to L2.
    * A writes the new value into L3[N]
    * B writes the new value into L3[N]
    * A recursively frees all the L1's under L2, then frees L2
    * B recursively double-frees all the L1's under L2, then double-frees L2 #
    
    Fix this by grabbing a lock for the entirety of the mapping update
    operation.
    
    Rather than grabbing map_pgdir_lock for the entire operation, however,
    repurpose the PGT_locked bit from L3's page->type_info as a lock.
    This means that rather than locking the entire address space, we
    "only" lock a single 512GiB chunk of hypervisor address space at a
    time.
    
    There was a proposal for a lock-and-reverify approach, where we walk
    the pagetables to the point where we decide what to do; then grab the
    map_pgdir_lock, re-verify the information we collected without the
    lock, and finally make the change (starting over again if anything had
    changed).  Without being able to guarantee that the L2 table wasn't
    freed, however, that means every read would need to be considered
    potentially unsafe.  Thinking carefully about that is probably
    something that wants to be done on public, not under time pressure.
    
    This is part of XSA-345.
    
    Reported-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: Hongyan Xia <hongyxia@amazon.com>
    Signed-off-by: George Dunlap <george.dunlap@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 89 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1b8202852e..3da62af1a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2083,6 +2083,50 @@ void page_unlock(struct page_info *page)
     current_locked_page_set(NULL);
 }
 
+/*
+ * L3 table locks:
+ *
+ * Used for serialization in map_pages_to_xen() and modify_xen_mappings().
+ *
+ * For Xen PT pages, the page->u.inuse.type_info is unused and it is safe to
+ * reuse the PGT_locked flag. This lock is taken only when we move down to L3
+ * tables and below, since L4 (and above, for 5-level paging) is still globally
+ * protected by map_pgdir_lock.
+ *
+ * PV MMU update hypercalls call map_pages_to_xen while holding a page's page_lock().
+ * This has two implications:
+ * - We cannot reuse reuse current_locked_page_* for debugging
+ * - To avoid the chance of deadlock, even for different pages, we
+ *   must never grab page_lock() after grabbing l3t_lock().  This
+ *   includes any page_lock()-based locks, such as
+ *   mem_sharing_page_lock().
+ *
+ * Also note that we grab the map_pgdir_lock while holding the
+ * l3t_lock(), so to avoid deadlock we must avoid grabbing them in
+ * reverse order.
+ */
+static void l3t_lock(struct page_info *page)
+{
+    unsigned long x, nx;
+
+    do {
+        while ( (x = page->u.inuse.type_info) & PGT_locked )
+            cpu_relax();
+        nx = x | PGT_locked;
+    } while ( cmpxchg(&page->u.inuse.type_info, x, nx) != x );
+}
+
+static void l3t_unlock(struct page_info *page)
+{
+    unsigned long x, nx, y = page->u.inuse.type_info;
+
+    do {
+        x = y;
+        BUG_ON(!(x & PGT_locked));
+        nx = x & ~PGT_locked;
+    } while ( (y = cmpxchg(&page->u.inuse.type_info, x, nx)) != x );
+}
+
 #ifdef CONFIG_PV
 /*
  * PTE flags that a guest may change without re-validating the PTE.
@@ -5069,6 +5113,23 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
                          flush_area_local((const void *)v, f) : \
                          flush_area_all((const void *)v, f))
 
+#define L3T_INIT(page) (page) = ZERO_BLOCK_PTR
+
+#define L3T_LOCK(page)        \
+    do {                      \
+        if ( locking )        \
+            l3t_lock(page);   \
+    } while ( false )
+
+#define L3T_UNLOCK(page)                           \
+    do {                                           \
+        if ( locking && (page) != ZERO_BLOCK_PTR ) \
+        {                                          \
+            l3t_unlock(page);                      \
+            (page) = ZERO_BLOCK_PTR;               \
+        }                                          \
+    } while ( false )
+
 int map_pages_to_xen(
     unsigned long virt,
     mfn_t mfn,
@@ -5080,6 +5141,7 @@ int map_pages_to_xen(
     l1_pgentry_t *pl1e, ol1e;
     unsigned int  i;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
 #define flush_flags(oldf) do {                 \
     unsigned int o_ = (oldf);                  \
@@ -5095,13 +5157,20 @@ int map_pages_to_xen(
     }                                          \
 } while (0)
 
+    L3T_INIT(current_l3page);
+
     while ( nr_mfns != 0 )
     {
-        l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt);
+        l3_pgentry_t *pl3e, ol3e;
 
+        L3T_UNLOCK(current_l3page);
+
+        pl3e = virt_to_xen_l3e(virt);
         if ( !pl3e )
             goto out;
 
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
         ol3e = *pl3e;
 
         if ( cpu_has_page1gb &&
@@ -5441,6 +5510,7 @@ int map_pages_to_xen(
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
@@ -5469,6 +5539,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     unsigned int  i;
     unsigned long v = s;
     int rc = -ENOMEM;
+    struct page_info *current_l3page;
 
     /* Set of valid PTE bits which may be altered. */
 #define FLAGS_MASK (_PAGE_NX|_PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_RW|_PAGE_PRESENT)
@@ -5477,11 +5548,22 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     ASSERT(IS_ALIGNED(s, PAGE_SIZE));
     ASSERT(IS_ALIGNED(e, PAGE_SIZE));
 
+    L3T_INIT(current_l3page);
+
     while ( v < e )
     {
-        l3_pgentry_t *pl3e = virt_to_xen_l3e(v);
+        l3_pgentry_t *pl3e;
+
+        L3T_UNLOCK(current_l3page);
 
-        if ( !pl3e || !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
+        pl3e = virt_to_xen_l3e(v);
+        if ( !pl3e )
+            goto out;
+
+        current_l3page = virt_to_page(pl3e);
+        L3T_LOCK(current_l3page);
+
+        if ( !(l3e_get_flags(*pl3e) & _PAGE_PRESENT) )
         {
             /* Confirm the caller isn't trying to create new mappings. */
             ASSERT(!(nf & _PAGE_PRESENT));
@@ -5707,9 +5789,13 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
     rc = 0;
 
  out:
+    L3T_UNLOCK(current_l3page);
     return rc;
 }
 
+#undef L3T_LOCK
+#undef L3T_UNLOCK
+
 #undef flush_area
 
 int destroy_xen_mappings(unsigned long s, unsigned long e)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11489.30487 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPP-0000wk-MQ; Sat, 24 Oct 2020 07:56:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11489.30487; Sat, 24 Oct 2020 07:56:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPP-0000wb-JI; Sat, 24 Oct 2020 07:56:15 +0000
Received: by outflank-mailman (input) for mailman id 11489;
 Sat, 24 Oct 2020 07:56:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEPO-0000wQ-Ea
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7a2b0bdc-7d31-4c42-85e0-0e56f5787379;
 Sat, 24 Oct 2020 07:56:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPN-00087k-Jc
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPN-0004fp-Im
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEPO-0000wQ-Ea
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:14 +0000
X-Inumbo-ID: 7a2b0bdc-7d31-4c42-85e0-0e56f5787379
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7a2b0bdc-7d31-4c42-85e0-0e56f5787379;
	Sat, 24 Oct 2020 07:56:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RbarLR0mJU8W8T+nYnHQzhNsIrbyBH/7U47ZN+eMqlU=; b=JJThJAwIhwlJ38vODveuDGcLcl
	aOb4XaqEy4wRKzo5cqGgUz9ddyPyTKop/XkB18WeWuZYaG2Jy0CT31k8P20IjY4rn9uUihXde62uG
	wyBdCriI8WHyTBiLiAzW9PGqYHrL/kPPCbEVI9U6Zbkq/Ht9X9E4RPyr1ccoyh+z6Zqg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPN-00087k-Jc
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPN-0004fp-Im
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
Message-Id: <E1kWEPN-0004fp-Im@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:13 +0000

commit dea460d86957bf1425a8a1572626099ac3f165a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:21:09 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:21:09 2020 +0200

    IOMMU: suppress "iommu_dont_flush_iotlb" when about to free a page
    
    Deferring flushes to a single, wide range one - as is done when
    handling XENMAPSPACE_gmfn_range - is okay only as long as
    pages don't get freed ahead of the eventual flush. While the only
    function setting the flag (xenmem_add_to_physmap()) suggests by its name
    that it's only mapping new entries, in reality the way
    xenmem_add_to_physmap_one() works means an unmap would happen not only
    for the page being moved (but not freed) but, if the destination GFN is
    populated, also for the page being displaced from that GFN. Collapsing
    the two flushes for this GFN into just one (end even more so deferring
    it to a batched invocation) is not correct.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1bab0e80c2..5f4be59761 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -293,6 +293,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
     p2m_type_t p2mt;
 #endif
     mfn_t mfn;
+    bool *dont_flush_p, dont_flush;
     int rc;
 
 #ifdef CONFIG_X86
@@ -379,8 +380,18 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         return -ENXIO;
     }
 
+    /*
+     * Since we're likely to free the page below, we need to suspend
+     * xenmem_add_to_physmap()'s suppressing of IOMMU TLB flushes.
+     */
+    dont_flush_p = &this_cpu(iommu_dont_flush_iotlb);
+    dont_flush = *dont_flush_p;
+    *dont_flush_p = false;
+
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
 
+    *dont_flush_p = dont_flush;
+
     /*
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
      * device must retrieve the same pfn when the hypercall populate_physmap
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11490.30491 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPZ-0000yD-Oi; Sat, 24 Oct 2020 07:56:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11490.30491; Sat, 24 Oct 2020 07:56:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPZ-0000y5-Ku; Sat, 24 Oct 2020 07:56:25 +0000
Received: by outflank-mailman (input) for mailman id 11490;
 Sat, 24 Oct 2020 07:56:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEPY-0000xw-SH
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 34a4b184-1069-4ab9-ace6-199089064788;
 Sat, 24 Oct 2020 07:56:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPX-00087x-O9
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPX-0004gU-Mb
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEPY-0000xw-SH
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:24 +0000
X-Inumbo-ID: 34a4b184-1069-4ab9-ace6-199089064788
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 34a4b184-1069-4ab9-ace6-199089064788;
	Sat, 24 Oct 2020 07:56:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8NsbldU1dO+VXF8OdggW4/cuzqmIZxp3GZ/oqAyE5kQ=; b=Ay5ux7DFwTenX9QgUVvOhudtNP
	H5slgjWNQLXnmvFwstMEqUvqCWs+Bb7hlsqIGk3cZYZl1fDwNeyu9HRXbaAsosqbpO9YvmRyGPEVc
	IYYGtlTPsMEZE0yvsWvyvPbY93kGC5e/LMlMsnBR4AvrxQkXm+aJmWXLhufiNZirXzPc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPX-00087x-O9
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPX-0004gU-Mb
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] IOMMU: hold page ref until after deferred TLB flush
Message-Id: <E1kWEPX-0004gU-Mb@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:23 +0000

commit 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:21:32 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:21:32 2020 +0200

    IOMMU: hold page ref until after deferred TLB flush
    
    When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
    flush for the "from" GFN range requires that the page remains allocated
    to the guest until the TLB flush has actually occurred. Otherwise a
    parallel hypercall to remove the page would only flush the TLB for the
    GFN it has been moved to, but not the one is was mapped at originally.
    
    This is part of XSA-346.
    
    Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
    Reported-by: Julien Grall <jgrall@amazon.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/arch/arm/mm.c    |  6 +-----
 xen/arch/x86/mm.c    | 15 +++++++++++++--
 xen/common/memory.c  | 44 +++++++++++++++++++++++++++++++++++++-------
 xen/include/xen/mm.h | 16 +++++++++++++++-
 4 files changed, 66 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index b4763d9a3d..9c4b26bf07 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1407,7 +1407,7 @@ void share_xen_page_with_guest(struct page_info *page, struct domain *d,
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gfn)
 {
@@ -1480,10 +1480,6 @@ int xenmem_add_to_physmap_one(
         break;
     }
     case XENMAPSPACE_dev_mmio:
-        /* extra should be 0. Reserved for future use. */
-        if ( extra.res0 )
-            return -EOPNOTSUPP;
-
         rc = map_dev_mmio_region(d, gfn, 1, _mfn(idx));
         return rc;
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3da62af1a5..918ee2bbe3 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4541,7 +4541,7 @@ static int handle_iomem_range(unsigned long s, unsigned long e, void *p)
 int xenmem_add_to_physmap_one(
     struct domain *d,
     unsigned int space,
-    union xen_add_to_physmap_batch_extra extra,
+    union add_to_physmap_extra extra,
     unsigned long idx,
     gfn_t gpfn)
 {
@@ -4625,9 +4625,20 @@ int xenmem_add_to_physmap_one(
         rc = guest_physmap_add_page(d, gpfn, mfn, PAGE_ORDER_4K);
 
  put_both:
-    /* In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top. */
+    /*
+     * In the XENMAPSPACE_gmfn case, we took a ref of the gfn at the top.
+     * We also may need to transfer ownership of the page reference to our
+     * caller.
+     */
     if ( space == XENMAPSPACE_gmfn )
+    {
         put_gfn(d, gfn);
+        if ( !rc && extra.ppage )
+        {
+            *extra.ppage = page;
+            page = NULL;
+        }
+    }
 
     if ( page )
         put_page(page);
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 5f4be59761..7075e233aa 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -815,13 +815,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 {
     unsigned int done = 0;
     long rc = 0;
-    union xen_add_to_physmap_batch_extra extra;
+    union add_to_physmap_extra extra = {};
+    struct page_info *pages[16];
 
     ASSERT(paging_mode_translate(d));
 
-    if ( xatp->space != XENMAPSPACE_gmfn_foreign )
-        extra.res0 = 0;
-    else
+    if ( xatp->space == XENMAPSPACE_gmfn_foreign )
         extra.foreign_domid = DOMID_INVALID;
 
     if ( xatp->space != XENMAPSPACE_gmfn_range )
@@ -836,7 +835,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     xatp->size -= start;
 
     if ( is_iommu_enabled(d) )
+    {
        this_cpu(iommu_dont_flush_iotlb) = 1;
+       extra.ppage = &pages[0];
+    }
 
     while ( xatp->size > done )
     {
@@ -848,8 +850,12 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         xatp->idx++;
         xatp->gpfn++;
 
+        if ( extra.ppage )
+            ++extra.ppage;
+
         /* Check for continuation if it's not the last iteration. */
-        if ( xatp->size > ++done && hypercall_preempt_check() )
+        if ( (++done > ARRAY_SIZE(pages) && extra.ppage) ||
+             (xatp->size > done && hypercall_preempt_check()) )
         {
             rc = start + done;
             break;
@@ -859,6 +865,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     if ( is_iommu_enabled(d) )
     {
         int ret;
+        unsigned int i;
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
@@ -867,6 +874,15 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
+        /*
+         * Now that the IOMMU TLB flush was done for the original GFN, drop
+         * the page references. The 2nd flush below is fine to make later, as
+         * whoever removes the page again from its new GFN will have to do
+         * another flush anyway.
+         */
+        for ( i = 0; i < done; ++i )
+            put_page(pages[i]);
+
         ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
@@ -880,6 +896,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                        struct xen_add_to_physmap_batch *xatpb,
                                        unsigned int extent)
 {
+    union add_to_physmap_extra extra = {};
+
     if ( unlikely(xatpb->size < extent) )
         return -EILSEQ;
 
@@ -891,6 +909,19 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
          !guest_handle_subrange_okay(xatpb->errs, extent, xatpb->size - 1) )
         return -EFAULT;
 
+    switch ( xatpb->space )
+    {
+    case XENMAPSPACE_dev_mmio:
+        /* res0 is reserved for future use. */
+        if ( xatpb->u.res0 )
+            return -EOPNOTSUPP;
+        break;
+
+    case XENMAPSPACE_gmfn_foreign:
+        extra.foreign_domid = xatpb->u.foreign_domid;
+        break;
+    }
+
     while ( xatpb->size > extent )
     {
         xen_ulong_t idx;
@@ -903,8 +934,7 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
                                                extent, 1)) )
             return -EFAULT;
 
-        rc = xenmem_add_to_physmap_one(d, xatpb->space,
-                                       xatpb->u,
+        rc = xenmem_add_to_physmap_one(d, xatpb->space, extra,
                                        idx, _gfn(gpfn));
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, extent, &rc, 1)) )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 4536a62940..f7975b2df0 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -592,8 +592,22 @@ void scrub_one_page(struct page_info *);
     page_list_del(pg, page_to_list(d, pg))
 #endif
 
+union add_to_physmap_extra {
+    /*
+     * XENMAPSPACE_gmfn: When deferring TLB flushes, a page reference needs
+     * to be kept until after the flush, so the page can't get removed from
+     * the domain (and re-used for another purpose) beforehand. By passing
+     * non-NULL, the caller of xenmem_add_to_physmap_one() indicates it wants
+     * to have ownership of such a reference transferred in the success case.
+     */
+    struct page_info **ppage;
+
+    /* XENMAPSPACE_gmfn_foreign */
+    domid_t foreign_domid;
+};
+
 int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
-                              union xen_add_to_physmap_batch_extra extra,
+                              union add_to_physmap_extra extra,
                               unsigned long idx, gfn_t gfn);
 
 int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11492.30495 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPj-00010M-Q9; Sat, 24 Oct 2020 07:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11492.30495; Sat, 24 Oct 2020 07:56:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPj-00010E-Mt; Sat, 24 Oct 2020 07:56:35 +0000
Received: by outflank-mailman (input) for mailman id 11492;
 Sat, 24 Oct 2020 07:56:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEPi-000103-S9
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fe7f1eb8-840f-4387-b7a7-94ccf031b0e0;
 Sat, 24 Oct 2020 07:56:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPh-00088V-Rt
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPh-0004hA-Qy
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEPi-000103-S9
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:34 +0000
X-Inumbo-ID: fe7f1eb8-840f-4387-b7a7-94ccf031b0e0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fe7f1eb8-840f-4387-b7a7-94ccf031b0e0;
	Sat, 24 Oct 2020 07:56:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9u7G2XNmOjBPsH4hEWKHrWQBbWwRilUJhbv097/yNlE=; b=3PJscN4JKzCM2VgSGvuv7iyTSi
	aF4qLc8AtL3jwFz3DbkNrBpBUtU+gK6fq7RcTgWiCdqVQHO1si0kYsiyN+qhYpowa3LE8m0Oe75/t
	mq1r5dblJr9zV5GHLOQirGXtsgEe+sq+UYo/Rz9Q00YJomedeoUl7u+c5roc3uHAHePE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPh-00088V-Rt
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPh-0004hA-Qy
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: convert amd_iommu_pte from struct to union
Message-Id: <E1kWEPh-0004hA-Qy@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:33 +0000

commit 73f62c7380edf07469581a3049aba98abd63b275
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:22:26 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:22:26 2020 +0200

    AMD/IOMMU: convert amd_iommu_pte from struct to union
    
    This is to add a "raw" counterpart to the bitfield equivalent. Take the
    opportunity and
     - convert fields to bool / unsigned int,
     - drop the naming of the reserved field,
     - shorten the names of the ignored ones.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu-defs.h    | 31 ++++++++++++++++-------------
 xen/drivers/passthrough/amd/iommu_map.c     | 12 +++++------
 xen/drivers/passthrough/amd/pci_amd_iommu.c |  4 ++--
 3 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu-defs.h b/xen/drivers/passthrough/amd/iommu-defs.h
index 15eedfb678..56f385f270 100644
--- a/xen/drivers/passthrough/amd/iommu-defs.h
+++ b/xen/drivers/passthrough/amd/iommu-defs.h
@@ -451,20 +451,23 @@ union amd_iommu_x2apic_control {
 #define IOMMU_PAGE_TABLE_U32_PER_ENTRY	(IOMMU_PAGE_TABLE_ENTRY_SIZE / 4)
 #define IOMMU_PAGE_TABLE_ALIGNMENT	4096
 
-struct amd_iommu_pte {
-    uint64_t pr:1;
-    uint64_t ignored0:4;
-    uint64_t a:1;
-    uint64_t d:1;
-    uint64_t ignored1:2;
-    uint64_t next_level:3;
-    uint64_t mfn:40;
-    uint64_t reserved:7;
-    uint64_t u:1;
-    uint64_t fc:1;
-    uint64_t ir:1;
-    uint64_t iw:1;
-    uint64_t ignored2:1;
+union amd_iommu_pte {
+    uint64_t raw;
+    struct {
+        bool pr:1;
+        unsigned int ign0:4;
+        bool a:1;
+        bool d:1;
+        unsigned int ign1:2;
+        unsigned int next_level:3;
+        uint64_t mfn:40;
+        unsigned int :7;
+        bool u:1;
+        bool fc:1;
+        bool ir:1;
+        bool iw:1;
+        unsigned int ign2:1;
+    };
 };
 
 /* Paging modes */
diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 0cb948d114..050eca838b 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -34,7 +34,7 @@ static unsigned int pfn_to_pde_idx(unsigned long pfn, unsigned int level)
 static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
                                             unsigned long dfn)
 {
-    struct amd_iommu_pte *table, *pte;
+    union amd_iommu_pte *table, *pte;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(l1_mfn));
@@ -48,7 +48,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pde_present(struct amd_iommu_pte *pte,
+static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned long next_mfn,
                                           unsigned int next_level, bool iw,
                                           bool ir)
@@ -83,7 +83,7 @@ static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
                                           int pde_level,
                                           bool iw, bool ir)
 {
-    struct amd_iommu_pte *table, *pde;
+    union amd_iommu_pte *table, *pde;
     unsigned int flush_flags;
 
     table = map_domain_page(_mfn(pt_mfn));
@@ -174,7 +174,7 @@ void iommu_dte_set_guest_cr3(struct amd_iommu_dte *dte, uint16_t dom_id,
 static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
                               unsigned long pt_mfn[], bool map)
 {
-    struct amd_iommu_pte *pde, *next_table_vaddr;
+    union amd_iommu_pte *pde, *next_table_vaddr;
     unsigned long  next_table_mfn;
     unsigned int level;
     struct page_info *table;
@@ -448,7 +448,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
     unsigned long end_gfn =
         1ul << (DEFAULT_DOMAIN_ADDRESS_WIDTH - PAGE_SHIFT);
     unsigned int level = amd_iommu_get_paging_mode(end_gfn);
-    struct amd_iommu_pte *table;
+    union amd_iommu_pte *table;
 
     if ( hd->arch.amd.root_table )
     {
@@ -479,7 +479,7 @@ int __init amd_iommu_quarantine_init(struct domain *d)
 
         for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
         {
-            struct amd_iommu_pte *pde = &table[i];
+            union amd_iommu_pte *pde = &table[i];
 
             /*
              * PDEs are essentially a subset of PTEs, so this function
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 304363f5d2..e5f8762c5c 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -495,7 +495,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
                                      paddr_t gpa, int indent)
 {
     paddr_t address;
-    struct amd_iommu_pte *table_vaddr;
+    const union amd_iommu_pte *table_vaddr;
     int index;
 
     if ( level < 1 )
@@ -511,7 +511,7 @@ static void amd_dump_p2m_table_level(struct page_info* pg, int level,
 
     for ( index = 0; index < PTE_PER_TABLE_SIZE; index++ )
     {
-        struct amd_iommu_pte *pde = &table_vaddr[index];
+        const union amd_iommu_pte *pde = &table_vaddr[index];
 
         if ( !(index % 2) )
             process_pending_softirqs();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11493.30499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPt-00011a-RU; Sat, 24 Oct 2020 07:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11493.30499; Sat, 24 Oct 2020 07:56:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEPt-00011T-OY; Sat, 24 Oct 2020 07:56:45 +0000
Received: by outflank-mailman (input) for mailman id 11493;
 Sat, 24 Oct 2020 07:56:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEPs-00011M-VF
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 22258ca8-57d7-4460-ab5f-261b3e3b1983;
 Sat, 24 Oct 2020 07:56:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPr-00088k-VB
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEPr-0004i0-UP
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEPs-00011M-VF
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:44 +0000
X-Inumbo-ID: 22258ca8-57d7-4460-ab5f-261b3e3b1983
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 22258ca8-57d7-4460-ab5f-261b3e3b1983;
	Sat, 24 Oct 2020 07:56:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N3MrNyBFG91SCrZAVQjfMDihvND4VNNjEEhNW15qTSk=; b=et24r7H1M6PDdgoXeV8ZNIOgw3
	JMzC6QWlfr1brt8ThOKErlyV3R5E+5HwU4a+DP4t5Hs+NdqbriTkQMINj/Q0bTzbvPoZYdqIRKdJp
	2eEwGB243xxgoH+M4N3Zr/zmRjyzMpdl2t8nW37Ihtd1gPu+SKzAYYf+KMMpSZoQXL2o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPr-00088k-VB
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEPr-0004i0-UP
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: update live PTEs atomically
Message-Id: <E1kWEPr-0004i0-UP@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:43 +0000

commit 3b055121c5410e2c3105d6d06aa24ca0d58868cd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:22:52 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:22:52 2020 +0200

    AMD/IOMMU: update live PTEs atomically
    
    Updating a live PTE bitfield by bitfield risks the compiler re-ordering
    the individual updates as well as splitting individual updates into
    multiple memory writes. Construct the new entry fully in a local
    variable, do the check to determine the flushing needs on the thus
    established new entry, and then write the new entry by a single insn.
    
    Similarly using memset() to clear a PTE is unsafe, as the order of
    writes the function does is, at least in principle, undefined.
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 050eca838b..480cd41c58 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -41,7 +41,7 @@ static unsigned int clear_iommu_pte_present(unsigned long l1_mfn,
     pte = &table[pfn_to_pde_idx(dfn, 1)];
 
     flush_flags = pte->pr ? IOMMU_FLUSHF_modified : 0;
-    memset(pte, 0, sizeof(*pte));
+    write_atomic(&pte->raw, 0);
 
     unmap_domain_page(table);
 
@@ -53,26 +53,30 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
                                           unsigned int next_level, bool iw,
                                           bool ir)
 {
+    union amd_iommu_pte new = {}, old;
     unsigned int flush_flags = IOMMU_FLUSHF_added;
 
-    if ( pte->pr &&
-         (pte->mfn != next_mfn ||
-          pte->iw != iw ||
-          pte->ir != ir ||
-          pte->next_level != next_level) )
-            flush_flags |= IOMMU_FLUSHF_modified;
-
     /*
      * FC bit should be enabled in PTE, this helps to solve potential
      * issues with ATS devices
      */
-    pte->fc = !next_level;
+    new.fc = !next_level;
+
+    new.mfn = next_mfn;
+    new.iw = iw;
+    new.ir = ir;
+    new.next_level = next_level;
+    new.pr = true;
+
+    old.raw = read_atomic(&pte->raw);
+    old.ign0 = 0;
+    old.ign1 = 0;
+    old.ign2 = 0;
+
+    if ( old.pr && old.raw != new.raw )
+        flush_flags |= IOMMU_FLUSHF_modified;
 
-    pte->mfn = next_mfn;
-    pte->iw = iw;
-    pte->ir = ir;
-    pte->next_level = next_level;
-    pte->pr = 1;
+    write_atomic(&pte->raw, new.raw);
 
     return flush_flags;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:56:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11494.30502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQ3-000131-TV; Sat, 24 Oct 2020 07:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11494.30502; Sat, 24 Oct 2020 07:56:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQ3-00012t-QN; Sat, 24 Oct 2020 07:56:55 +0000
Received: by outflank-mailman (input) for mailman id 11494;
 Sat, 24 Oct 2020 07:56:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQ2-00012k-TS
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c177a8c3-bdcd-4d45-bbb3-e78e5d7521ec;
 Sat, 24 Oct 2020 07:56:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQ2-00088u-2u
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQ2-0004ie-26
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQ2-00012k-TS
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
X-Inumbo-ID: c177a8c3-bdcd-4d45-bbb3-e78e5d7521ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c177a8c3-bdcd-4d45-bbb3-e78e5d7521ec;
	Sat, 24 Oct 2020 07:56:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RzjdXU0Dh0eZYvoSVmFIlpmlUXsWVNW47hMiE7LSr18=; b=SM9iAm+DPecOWFKNoMUAQW+1o7
	xDvxwoLHJV8mIvEIUnV6zMbdqJxNCdxGqMDOVp/V7pZFK8+0z9nQaWckuzjWjapeQPy9/vB8+EYwr
	t7LOCPmZIxUPxQlc4f3Y3/hEias9LnwaxH+ySq0yoxUMTOv4amnUJqLZhMnkgjj5vhBE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQ2-00088u-2u
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQ2-0004ie-26
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:56:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: ensure suitable ordering of DTE modifications
Message-Id: <E1kWEQ2-0004ie-26@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:56:54 +0000

commit 0514a3a25fb9ebff5d75cc8f00a9229385300858
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Oct 20 14:23:12 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Oct 20 14:23:12 2020 +0200

    AMD/IOMMU: ensure suitable ordering of DTE modifications
    
    DMA and interrupt translation should be enabled only after other
    applicable DTE fields have been written. Similarly when disabling
    translation or when moving a device between domains, translation should
    first be disabled, before other entry fields get modified. Note however
    that the "moving" aspect doesn't apply to the interrupt remapping side,
    as domain specifics are maintained in the IRTEs here, not the DTE. We
    also never disable interrupt remapping once it got enabled for a device
    (the respective argument passed is always the immutable iommu_intremap).
    
    This is part of XSA-347.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c     | 8 ++++++++
 xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 480cd41c58..17418d39b3 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -103,11 +103,18 @@ void amd_iommu_set_root_page_table(struct amd_iommu_dte *dte,
                                    uint64_t root_ptr, uint16_t domain_id,
                                    uint8_t paging_mode, bool valid)
 {
+    if ( valid || dte->v )
+    {
+        dte->tv = false;
+        dte->v = true;
+        smp_wmb();
+    }
     dte->domain_id = domain_id;
     dte->pt_root = paddr_to_pfn(root_ptr);
     dte->iw = true;
     dte->ir = true;
     dte->paging_mode = paging_mode;
+    smp_wmb();
     dte->tv = true;
     dte->v = valid;
 }
@@ -130,6 +137,7 @@ void amd_iommu_set_intremap_table(
     }
 
     dte->ig = false; /* unmapped interrupts result in i/o page faults */
+    smp_wmb();
     dte->iv = valid;
 }
 
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index e5f8762c5c..64c1fca7b5 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -117,7 +117,10 @@ static void amd_iommu_setup_domain_device(
         /* Undo what amd_iommu_disable_domain_device() may have done. */
         ivrs_dev = &get_ivrs_mappings(iommu->seg)[req_id];
         if ( dte->it_root )
+        {
             dte->int_ctl = IOMMU_DEV_TABLE_INT_CONTROL_TRANSLATED;
+            smp_wmb();
+        }
         dte->iv = iommu_intremap;
         dte->ex = ivrs_dev->dte_allow_exclusion;
         dte->sys_mgt = MASK_EXTR(ivrs_dev->device_flags, ACPI_IVHD_SYSTEM_MGMT);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11495.30507 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQE-00014d-0e; Sat, 24 Oct 2020 07:57:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11495.30507; Sat, 24 Oct 2020 07:57:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQD-00014T-Ti; Sat, 24 Oct 2020 07:57:05 +0000
Received: by outflank-mailman (input) for mailman id 11495;
 Sat, 24 Oct 2020 07:57:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQD-00014F-4F
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 611bed87-4964-4b24-add7-98e0d686ec50;
 Sat, 24 Oct 2020 07:57:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQC-00089L-6I
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQC-0004jU-5W
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQD-00014F-4F
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:05 +0000
X-Inumbo-ID: 611bed87-4964-4b24-add7-98e0d686ec50
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 611bed87-4964-4b24-add7-98e0d686ec50;
	Sat, 24 Oct 2020 07:57:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hlw50g0M05ULnR6x2G8HNE0Aj2hW/zz5D0qZC/oJttw=; b=LQue6QqH4WJnYqEUJrReqbyvIz
	JhwXxIeXHm5Q5FWbMD4nwzu2iNB8g5MkTFMMjKUdplDK6ibytGZoXRAX1NjcXHQUsncxlvyMmDS99
	qghpuJebRgaFfrb81YPIeda0kHU5+Hn3yQ0PPWjehOOWYxTpmyrWbZ1dMxnKlaInqhCs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQC-00089L-6I
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQC-0004jU-5W
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: optee: don't print warning about "wrong" RPC buffer
Message-Id: <E1kWEQC-0004jU-5W@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:04 +0000

commit aace5466996e743a087153ad3f9d8fcf11a76c56
Author:     Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
AuthorDate: Mon Oct 5 09:12:32 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Oct 20 13:20:28 2020 -0700

    arm: optee: don't print warning about "wrong" RPC buffer
    
    The OP-TEE mediator tracks the cookie value of the last buffer which was
    requested by OP-TEE. This tracked value serves one important purpose: if
    OP-TEE wants to request another buffer, we know that it finished
    importing the previous one and we can free the page list associated with
    it.
    
    Also, we had a false premise that OP_TEE frees requested buffers in
    reversed order. So we checked rpc_data_cookie during handling of the
    OPTEE_RPC_CMD_SHM_FREE call and printed a warning if the cookie of the
    buffer which is requested to be freed differs from the last allocated
    one.
    
    During testing of RPMB FS services I discovered that RPMB code frees
    request and response buffers in the same order is it allocated them. And
    this is perfectly fine, actually.
    
    So, we are removing mentioned warning message in Xen, as it is perfectly
    normal to free buffers in arbitrary order.
    
    Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [stefano: fix grammar]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/arch/arm/tee/optee.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 8a39fe33b0..ee85359742 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -1127,25 +1127,7 @@ static int handle_rpc_return(struct optee_domain *ctx,
          */
         if ( shm_rpc->xen_arg->cmd == OPTEE_RPC_CMD_SHM_FREE )
         {
-            uint64_t cookie = shm_rpc->xen_arg->params[0].u.value.b;
-
-            free_optee_shm_buf(ctx, cookie);
-
-            /*
-             * OP-TEE asks to free the buffer, but this is not the same
-             * buffer we previously allocated for it. While nothing
-             * prevents OP-TEE from asking this, it is the strange
-             * situation. This may or may not be caused by a bug in
-             * OP-TEE or mediator. But is better to print warning.
-             */
-            if ( call->rpc_data_cookie && call->rpc_data_cookie != cookie )
-            {
-                gprintk(XENLOG_ERR,
-                        "Saved RPC cookie does not corresponds to OP-TEE's (%"PRIx64" != %"PRIx64")\n",
-                        call->rpc_data_cookie, cookie);
-
-                WARN();
-            }
+            free_optee_shm_buf(ctx, shm_rpc->xen_arg->params[0].u.value.b);
             call->rpc_data_cookie = 0;
         }
         unmap_domain_page(shm_rpc->xen_arg);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11496.30511 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQP-00015z-29; Sat, 24 Oct 2020 07:57:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11496.30511; Sat, 24 Oct 2020 07:57:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQO-00015r-VO; Sat, 24 Oct 2020 07:57:16 +0000
Received: by outflank-mailman (input) for mailman id 11496;
 Sat, 24 Oct 2020 07:57:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQN-00015h-UP
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2e92966f-30c5-46f7-92fd-d02ccf3f09e2;
 Sat, 24 Oct 2020 07:57:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQM-00089Q-9l
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQM-0004kD-8t
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQN-00015h-UP
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:15 +0000
X-Inumbo-ID: 2e92966f-30c5-46f7-92fd-d02ccf3f09e2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2e92966f-30c5-46f7-92fd-d02ccf3f09e2;
	Sat, 24 Oct 2020 07:57:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=peVe4hfj9sSjCmomijiYNVQ11LFndixKNok/S9YAGsE=; b=4/vbtZ8C9UXwvOm3y7zzXIOuxi
	VtrF9GgVARhc+9FVrBWp+QmInwO0SJMULWrwlwqxYsIX2z3W0eVPf1G2RK+LMRS0VmLY2UDXQljZJ
	tMUpw6X0GHgozJW/FyDXaMeavyJKjfDqarw+o4YQsy/GEcqIilbshsNt7Dxxd3C92DNw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQM-00089Q-9l
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQM-0004kD-8t
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Print message if reset did not work
Message-Id: <E1kWEQM-0004kD-8t@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:14 +0000

commit 3b49791e4cc2f38dd84bf331b75217adaef636e3
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Fri Oct 16 14:58:47 2020 +0100
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Tue Oct 20 13:20:31 2020 -0700

    xen/arm: Print message if reset did not work
    
    If for some reason the hardware reset is not working, print a message to
    the user every 5 seconds to warn him that the system did not reset
    properly and Xen is still looping.
    
    The message is printed infinitely so that someone connecting to a serial
    console with no history would see the message coming after 5 seconds.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    [stefano: remove second '!']
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/arch/arm/shutdown.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index b32f07ec0e..3dc6819d56 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -36,6 +36,7 @@ void machine_halt(void)
 void machine_restart(unsigned int delay_millisecs)
 {
     int timeout = 10;
+    unsigned long count = 0;
 
     watchdog_disable();
     console_start_sync();
@@ -59,6 +60,9 @@ void machine_restart(unsigned int delay_millisecs)
     {
         platform_reset();
         mdelay(100);
+        if ( (count % 50) == 0 )
+            printk(XENLOG_ERR "Xen: Platform reset did not work properly!\n");
+        count++;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11497.30514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQY-000174-3d; Sat, 24 Oct 2020 07:57:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11497.30514; Sat, 24 Oct 2020 07:57:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQY-00016w-0g; Sat, 24 Oct 2020 07:57:26 +0000
Received: by outflank-mailman (input) for mailman id 11497;
 Sat, 24 Oct 2020 07:57:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQX-00016o-7n
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 15f4bccd-fbd2-439b-8f44-99bea7f7327a;
 Sat, 24 Oct 2020 07:57:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQW-00089X-D6
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQW-0004kr-CM
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQX-00016o-7n
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:25 +0000
X-Inumbo-ID: 15f4bccd-fbd2-439b-8f44-99bea7f7327a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 15f4bccd-fbd2-439b-8f44-99bea7f7327a;
	Sat, 24 Oct 2020 07:57:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f2rOcQjUQibO8z+TKO7ZMaPGOLJ5ziE/6J46pd1iiVI=; b=2cR7Dsgvp5QuFPiReMyG2XfRy/
	UnLqhcWmARkaPYab0u+dipdMLgHe4g2I7rf/4cB+HZlx4OeX2Oa/8Imtv55twoaRJn977HGtnv1sr
	tEQXfNebO8OHbm7fhbvlhCCsfoZGNFbsTwMw1i3j+8t/btvwJg13re+1PMf/C5yhqu4E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQW-00089X-D6
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQW-0004kr-CM
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: acpi: Don't fail if SPCR table is absent
Message-Id: <E1kWEQW-0004kr-CM@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:24 +0000

commit 861f0c110976fa8879b7bf63d9478b6be83d4ab6
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Wed Oct 21 15:12:53 2020 -0700
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Thu Oct 22 19:41:51 2020 +0100

    xen/arm: acpi: Don't fail if SPCR table is absent
    
    Absence of a SPCR table likely means the console is a framebuffer.  In
    such case acpi_iomem_deny_access() should NOT fail.
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/acpi/domain_build.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 1b1cfabb00..bbdc90f92c 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -42,17 +42,18 @@ static int __init acpi_iomem_deny_access(struct domain *d)
     status = acpi_get_table(ACPI_SIG_SPCR, 0,
                             (struct acpi_table_header **)&spcr);
 
-    if ( ACPI_FAILURE(status) )
+    if ( ACPI_SUCCESS(status) )
     {
-        printk("Failed to get SPCR table\n");
-        return -EINVAL;
+        mfn = spcr->serial_port.address >> PAGE_SHIFT;
+        /* Deny MMIO access for UART */
+        rc = iomem_deny_access(d, mfn, mfn + 1);
+        if ( rc )
+            return rc;
+    }
+    else
+    {
+        printk("Failed to get SPCR table, Xen console may be unavailable\n");
     }
-
-    mfn = spcr->serial_port.address >> PAGE_SHIFT;
-    /* Deny MMIO access for UART */
-    rc = iomem_deny_access(d, mfn, mfn + 1);
-    if ( rc )
-        return rc;
 
     /* Deny MMIO access for GIC regions */
     return gic_iomem_deny_access(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11498.30519 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQi-00018z-5H; Sat, 24 Oct 2020 07:57:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11498.30519; Sat, 24 Oct 2020 07:57:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQi-00018r-2C; Sat, 24 Oct 2020 07:57:36 +0000
Received: by outflank-mailman (input) for mailman id 11498;
 Sat, 24 Oct 2020 07:57:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQh-00018j-BF
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b9b00b97-1dae-44e6-80e2-e6010f393020;
 Sat, 24 Oct 2020 07:57:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQg-0008Az-Gs
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQg-0004mC-Fx
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQh-00018j-BF
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:35 +0000
X-Inumbo-ID: b9b00b97-1dae-44e6-80e2-e6010f393020
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b9b00b97-1dae-44e6-80e2-e6010f393020;
	Sat, 24 Oct 2020 07:57:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2Du2/A77ejbfr5hWDz+opQ1VZ0fnbv0RQpC1P7bICHo=; b=azE0eaJSXT5EdNrJH5Styk/M0a
	smP9KlBtloxcgr+TjPI8u9sQ9uLGHEX06PYm4el57CgZlkoG7Q1zPa6QtlEcpvcFL6dZTL7xE/Pc/
	85ZM1pGuAKjXiLv95IAI07Rl9u8xVM2kQIxx/bdQngoPIB+mtaenunqQvQLANtJneurU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQg-0008Az-Gs
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQg-0004mC-Fx
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn
Message-Id: <E1kWEQg-0004mC-Fx@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:34 +0000

commit ba45ae4d7f3a93ee7297d24bb03a564146d321c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:05:29 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:05:29 2020 +0200

    x86: XENMAPSPACE_gmfn{,_batch,_range} want to special case idx == gpfn
    
    In this case up to now we've been freeing the page (through
    guest_remove_page(), with the actual free typically happening at the
    put_page() later in the function), but then failing the call on the
    subsequent GFN consistency check. However, in my opinion such a request
    should complete as an "expensive" no-op (leaving aside the potential
    unsharing of the page).
    
    This points out that f33d653f46f5 ("x86: replace bad ASSERT() in
    xenmem_add_to_physmap_one()" would really have needed an XSA, despite
    its description claiming otherwise, as in release builds we then put in
    place a P2M entry referencing the about to be freed page.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 918ee2bbe3..6d2262a3f0 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4599,7 +4599,7 @@ int xenmem_add_to_physmap_one(
         if ( is_special_page(mfn_to_page(prev_mfn)) )
             /* Special pages are simply unhooked from this phys slot. */
             rc = guest_physmap_remove_page(d, gpfn, prev_mfn, PAGE_ORDER_4K);
-        else
+        else if ( !mfn_eq(mfn, prev_mfn) )
             /* Normal domain memory is freed, to avoid leaking memory. */
             rc = guest_remove_page(d, gfn_x(gpfn));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11499.30523 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQs-0001AO-6h; Sat, 24 Oct 2020 07:57:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11499.30523; Sat, 24 Oct 2020 07:57:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWEQs-0001AG-3g; Sat, 24 Oct 2020 07:57:46 +0000
Received: by outflank-mailman (input) for mailman id 11499;
 Sat, 24 Oct 2020 07:57:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWEQr-0001A5-E1
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5e0ed383-5f5f-42bc-96f2-630e65e85846;
 Sat, 24 Oct 2020 07:57:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQq-0008Br-KW
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWEQq-0004nU-Ji
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWEQr-0001A5-E1
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:45 +0000
X-Inumbo-ID: 5e0ed383-5f5f-42bc-96f2-630e65e85846
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5e0ed383-5f5f-42bc-96f2-630e65e85846;
	Sat, 24 Oct 2020 07:57:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5m87kjQnoj2hbifVgjjs2oA0Wq9llnehEfcSBjduhME=; b=qE3XJTkrU2w7Axs/smc9x1Llou
	cus2mPXhHfGERhQkmDBN1M1emYdIrPWG/EbFTSjd59C7MrTiI4yRvG8/aZOieCwpAwSvMDQ2gJvm9
	lg4Nt7jzujaQ3mPUwQAnVhAEtpckFaqwdJciN40ODpK4hi5WBKGZTpeIcQ6ivSaJJiis=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQq-0008Br-KW
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWEQq-0004nU-Ji
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: avoid playing with directmap when self-snoop can be relied upon
Message-Id: <E1kWEQq-0004nU-Ji@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:44 +0000

commit f9c53bd9eeff5d93e63665d67265dd27155e905e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:06:20 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:06:20 2020 +0200

    x86/mm: avoid playing with directmap when self-snoop can be relied upon
    
    The set of systems affected by XSA-345 would have been smaller is we had
    this in place already: When the processor is capable of dealing with
    mismatched cacheability, there's no extra work we need to carry out.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 6d2262a3f0..b2f35b3e7d 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -795,6 +795,9 @@ static int update_xen_mappings(unsigned long mfn, unsigned int cacheattr)
     unsigned long xen_va =
         XEN_VIRT_START + ((mfn - PFN_DOWN(xen_phys_start)) << PAGE_SHIFT);
 
+    if ( boot_cpu_has(X86_FEATURE_XEN_SELFSNOOP) )
+        return 0;
+
     if ( unlikely(alias) && cacheattr )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, 0);
     if ( !err )
@@ -802,6 +805,7 @@ static int update_xen_mappings(unsigned long mfn, unsigned int cacheattr)
                      PAGE_HYPERVISOR | cacheattr_to_pte_flags(cacheattr));
     if ( unlikely(alias) && !cacheattr && !err )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, PAGE_HYPERVISOR);
+
     return err;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:57:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:57:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11500.30527 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWER3-0001CW-8r; Sat, 24 Oct 2020 07:57:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11500.30527; Sat, 24 Oct 2020 07:57:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWER3-0001CO-5M; Sat, 24 Oct 2020 07:57:57 +0000
Received: by outflank-mailman (input) for mailman id 11500;
 Sat, 24 Oct 2020 07:57:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWER1-0001BS-HI
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 93df45fd-3a90-4297-8a25-57007c4084b2;
 Sat, 24 Oct 2020 07:57:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWER0-0008Bu-OL
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWER0-0004oE-NA
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWER1-0001BS-HI
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:55 +0000
X-Inumbo-ID: 93df45fd-3a90-4297-8a25-57007c4084b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 93df45fd-3a90-4297-8a25-57007c4084b2;
	Sat, 24 Oct 2020 07:57:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HPpUT11FBBBORpa8eLduWJT+e9rluT9g+Y08P9hf6ws=; b=s2evI9oVqRJ6MdwAIP+/kz/xLP
	vL9zwrwzKdkb9F2PEzyVzaO1OJ2YzlK5GfQb3wpgOue6sv8gG0ebgNzzkRBISEHeKy6DpOrJS4BUD
	zgidbXkU1ykVtkyQJmX/pERWEEQx/bPu5e2lBNT9cEk9lhtGRus3S/Tt1gwo2y00nf4U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWER0-0008Bu-OL
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWER0-0004oE-NA
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:57:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] IOMMU/EPT: avoid double flushing in shared page table case
Message-Id: <E1kWER0-0004oE-NA@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:57:54 +0000

commit 83432adeb82122e392a3bfc2a8818d25ca9e69ed
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:06:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:06:53 2020 +0200

    IOMMU/EPT: avoid double flushing in shared page table case
    
    While the flush coalescing optimization has been helping the non-shared
    case, it has actually lead to double flushes in the shared case (which
    ought to be the more common one nowadays at least): Once from
    *_set_entry() and a second time up the call tree from wherever the
    overriding flag gets played with. In alignment with XSA-346 suppress
    flushing in this case.
    
    Similarly avoid excessive setting of IOMMU_FLUSHF_added on the batched
    flushes: "idx" hasn't been added a new mapping for.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/arch/x86/mm/p2m-ept.c | 2 +-
 xen/common/memory.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 12cf38f6eb..476458b1e0 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -842,7 +842,7 @@ out:
     if ( rc == 0 && p2m_is_hostp2m(p2m) &&
          need_modify_vtd_table )
     {
-        if ( iommu_use_hap_pt(d) )
+        if ( iommu_use_hap_pt(d) && !this_cpu(iommu_dont_flush_iotlb) )
             rc = iommu_iotlb_flush(d, _dfn(gfn), 1ul << order,
                                    (iommu_flags ? IOMMU_FLUSHF_added : 0) |
                                    (vtd_pte_present ? IOMMU_FLUSHF_modified
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 7075e233aa..df85b550a1 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -870,7 +870,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
         ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
-                                IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
+                                IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11501.30532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERE-0001Eg-B2; Sat, 24 Oct 2020 07:58:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11501.30532; Sat, 24 Oct 2020 07:58:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERE-0001EX-6x; Sat, 24 Oct 2020 07:58:08 +0000
Received: by outflank-mailman (input) for mailman id 11501;
 Sat, 24 Oct 2020 07:58:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWERC-0001EO-Pw
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e45a6a2a-54ef-486b-9a78-0e47ae9656f0;
 Sat, 24 Oct 2020 07:58:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERA-0008CF-Sl
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERA-0004p3-RC
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWERC-0001EO-Pw
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:06 +0000
X-Inumbo-ID: e45a6a2a-54ef-486b-9a78-0e47ae9656f0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e45a6a2a-54ef-486b-9a78-0e47ae9656f0;
	Sat, 24 Oct 2020 07:58:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tXJuAlkFkjvcC6QoY6vx3lMWDoLOwncc0sxRN9TrsSA=; b=xEHVN3NVTrdAzKW6lqWpkMXazy
	KImcxivyRR0lePUe/ZM680X8V7imc2YwCxCK8rusZ2cDXoqefJ8J+PalJ+ALYvlVi8XukHYalr2XC
	6pj2FV/VDauHYiw3AMdruTC2frTf15j7joT9Qne4Zt2cvPnTkMkX+W5z9xYZXIenxNkY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERA-0008CF-Sl
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERA-0004p3-RC
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: avoid race in get_xen_consumer()
Message-Id: <E1kWERA-0004p3-RC@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:04 +0000

commit dcbd1d8ae527f3632eb9a2804ad03e0451918b62
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:07:56 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:07:56 2020 +0200

    evtchn: avoid race in get_xen_consumer()
    
    There's no global lock around the updating of this global piece of data.
    Make use of cmpxchgptr() to avoid two entities racing with their
    updates.
    
    While touching the functionality, mark xen_consumers[] read-mostly (or
    else the if() condition could use the result of cmpxchgptr(), writing to
    the slot unconditionally).
    
    The use of cmpxchgptr() here points out (by way of clang warning about
    it) that its original use of const was slightly wrong. Adjust the
    placement, or else undefined behavior of const qualifying a function
    type will result.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_channel.c   |  6 ++++--
 xen/include/asm-x86/system.h |  7 -------
 xen/include/xen/lib.h        | 11 +++++++++++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index e365b5498f..091afa8bf5 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -57,7 +57,8 @@
  * with a pointer, we stash them dynamically in a small lookup array which
  * can be indexed by a small integer.
  */
-static xen_event_channel_notification_t xen_consumers[NR_XEN_CONSUMERS];
+static xen_event_channel_notification_t __read_mostly
+    xen_consumers[NR_XEN_CONSUMERS];
 
 /* Default notification action: wake up from wait_on_xen_event_channel(). */
 static void default_xen_notification_fn(struct vcpu *v, unsigned int port)
@@ -80,8 +81,9 @@ static uint8_t get_xen_consumer(xen_event_channel_notification_t fn)
 
     for ( i = 0; i < ARRAY_SIZE(xen_consumers); i++ )
     {
+        /* Use cmpxchgptr() in lieu of a global lock. */
         if ( xen_consumers[i] == NULL )
-            xen_consumers[i] = fn;
+            cmpxchgptr(&xen_consumers[i], NULL, fn);
         if ( xen_consumers[i] == fn )
             break;
     }
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 630909965e..65e63de69a 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -148,13 +148,6 @@ static always_inline unsigned long cmpxchg_local_(
     return prev;
 }
 
-#define cmpxchgptr(ptr,o,n) ({                                          \
-    const __typeof__(**(ptr)) *__o = (o);                               \
-    __typeof__(**(ptr)) *__n = (n);                                     \
-    ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)__o,            \
-                                   (unsigned long)__n,sizeof(*(ptr)))); \
-})
-
 /*
  * Undefined symbol to cause link failure if a wrong size is used with
  * arch_fetch_and_add().
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 076bcfb67d..1983bd6b86 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -178,6 +178,17 @@ unsigned long long parse_size_and_unit(const char *s, const char **ps);
 
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
+/*
+ * A slightly more typesafe variant of cmpxchg() when the entities dealt with
+ * are pointers.
+ */
+#define cmpxchgptr(ptr, o, n) ({                                        \
+    __typeof__(**(ptr)) *const o_ = (o);                                \
+    __typeof__(**(ptr)) *n_ = (n);                                      \
+    ((__typeof__(*(ptr)))__cmpxchg(ptr, (unsigned long)o_,              \
+                                   (unsigned long)n_, sizeof(*(ptr)))); \
+})
+
 #define TAINT_SYNC_CONSOLE              (1u << 0)
 #define TAINT_MACHINE_CHECK             (1u << 1)
 #define TAINT_ERROR_INJECT              (1u << 2)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11502.30535 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERN-0001G0-D9; Sat, 24 Oct 2020 07:58:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11502.30535; Sat, 24 Oct 2020 07:58:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERN-0001Fs-AD; Sat, 24 Oct 2020 07:58:17 +0000
Received: by outflank-mailman (input) for mailman id 11502;
 Sat, 24 Oct 2020 07:58:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWERM-0001Fj-4R
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee56ca8e-a50c-4abe-b649-732fb2e8bfbe;
 Sat, 24 Oct 2020 07:58:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERL-0008CN-0F
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERK-0004pt-VS
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWERM-0001Fj-4R
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:16 +0000
X-Inumbo-ID: ee56ca8e-a50c-4abe-b649-732fb2e8bfbe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee56ca8e-a50c-4abe-b649-732fb2e8bfbe;
	Sat, 24 Oct 2020 07:58:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=scLy94o7GWpNqdHzsyo6AMDR+DKGe8VymwzkwtIrf9M=; b=I+eNIx/EBhEVH0JGsF4WVoy3nv
	RDdmxsFEEP4TB/aP03VOS33saFL7l3FZBTD8sdbffsnpwEYFQQZiubXdZve+uaka/dJLmWUFeJhJD
	G6e4AKmknyM8nLZ9ZnKBoS4Zjck6QihxX9OiIV4mLt3mRX4b1nCBQnLJczUey5I83wSM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERL-0008CN-0F
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERK-0004pt-VS
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: replace FIFO-specific header by generic private one
Message-Id: <E1kWERK-0004pt-VS@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:14 +0000

commit 5bc84281a902eeea0d8f2eb8297790174cab6ac8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:09:55 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:09:55 2020 +0200

    evtchn: replace FIFO-specific header by generic private one
    
    Having a FIFO specific header is not (or at least no longer) warranted
    with just three function declarations left there. Introduce a private
    header instead, moving there some further items from xen/event.h.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_2l.c        |  3 ++-
 xen/common/event_channel.c   |  4 +--
 xen/common/event_channel.h   | 63 ++++++++++++++++++++++++++++++++++++++++++++
 xen/common/event_fifo.c      |  4 +--
 xen/include/xen/event.h      | 39 ---------------------------
 xen/include/xen/event_fifo.h | 26 ------------------
 6 files changed, 69 insertions(+), 70 deletions(-)

diff --git a/xen/common/event_2l.c b/xen/common/event_2l.c
index 083d04be3c..7424320e52 100644
--- a/xen/common/event_2l.c
+++ b/xen/common/event_2l.c
@@ -7,11 +7,12 @@
  * Version 2 or later.  See the file COPYING for more details.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
 
 #include <asm/guest_atomics.h>
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 091afa8bf5..8578af5f6b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -14,17 +14,17 @@
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
 #include <xen/irq.h>
 #include <xen/iocap.h>
 #include <xen/compat.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
-#include <xen/event_fifo.h>
 #include <asm/current.h>
 
 #include <public/xen.h>
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
new file mode 100644
index 0000000000..45219ca67c
--- /dev/null
+++ b/xen/common/event_channel.h
@@ -0,0 +1,63 @@
+/* Event channel handling private header. */
+
+#include <xen/event.h>
+
+static inline unsigned int max_evtchns(const struct domain *d)
+{
+    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
+                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
+}
+
+static inline bool evtchn_is_busy(const struct domain *d,
+                                  const struct evtchn *evtchn)
+{
+    return d->evtchn_port_ops->is_busy &&
+           d->evtchn_port_ops->is_busy(d, evtchn);
+}
+
+static inline void evtchn_port_unmask(struct domain *d,
+                                      struct evtchn *evtchn)
+{
+    if ( evtchn_usable(evtchn) )
+        d->evtchn_port_ops->unmask(d, evtchn);
+}
+
+static inline int evtchn_port_set_priority(struct domain *d,
+                                           struct evtchn *evtchn,
+                                           unsigned int priority)
+{
+    if ( !d->evtchn_port_ops->set_priority )
+        return -ENOSYS;
+    if ( !evtchn_usable(evtchn) )
+        return -EACCES;
+    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
+}
+
+static inline void evtchn_port_print_state(struct domain *d,
+                                           const struct evtchn *evtchn)
+{
+    d->evtchn_port_ops->print_state(d, evtchn);
+}
+
+/* 2-level */
+
+void evtchn_2l_init(struct domain *d);
+
+/* FIFO */
+
+struct evtchn_init_control;
+struct evtchn_expand_array;
+
+int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
+int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
+void evtchn_fifo_destroy(struct domain *d);
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index fc189152e1..c6e58d2a1a 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -7,12 +7,12 @@
  * Version 2 or later.  See the file COPYING for more details.
  */
 
+#include "event_channel.h"
+
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/sched.h>
-#include <xen/event.h>
-#include <xen/event_fifo.h>
 #include <xen/paging.h>
 #include <xen/mm.h>
 #include <xen/domain_page.h>
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 509d3ae861..6df989b51b 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -105,12 +105,6 @@ void notify_via_xen_event_channel(struct domain *ld, int lport);
 #define bucket_from_port(d, p) \
     ((group_from_port(d, p))[((p) % EVTCHNS_PER_GROUP) / EVTCHNS_PER_BUCKET])
 
-static inline unsigned int max_evtchns(const struct domain *d)
-{
-    return d->evtchn_fifo ? EVTCHN_FIFO_NR_CHANNELS
-                          : BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
-}
-
 static inline bool_t port_is_valid(struct domain *d, unsigned int p)
 {
     if ( p >= read_atomic(&d->valid_evtchns) )
@@ -176,8 +170,6 @@ static bool evtchn_usable(const struct evtchn *evtchn)
 
 void evtchn_check_pollers(struct domain *d, unsigned int port);
 
-void evtchn_2l_init(struct domain *d);
-
 /* Close all event channels and reset to 2-level ABI. */
 int evtchn_reset(struct domain *d, bool resuming);
 
@@ -227,13 +219,6 @@ static inline void evtchn_port_clear_pending(struct domain *d,
         d->evtchn_port_ops->clear_pending(d, evtchn);
 }
 
-static inline void evtchn_port_unmask(struct domain *d,
-                                      struct evtchn *evtchn)
-{
-    if ( evtchn_usable(evtchn) )
-        d->evtchn_port_ops->unmask(d, evtchn);
-}
-
 static inline bool evtchn_is_pending(const struct domain *d,
                                      const struct evtchn *evtchn)
 {
@@ -259,13 +244,6 @@ static inline bool evtchn_port_is_masked(struct domain *d, evtchn_port_t port)
     return rc;
 }
 
-static inline bool evtchn_is_busy(const struct domain *d,
-                                  const struct evtchn *evtchn)
-{
-    return d->evtchn_port_ops->is_busy &&
-           d->evtchn_port_ops->is_busy(d, evtchn);
-}
-
 /* Returns negative errno, zero for not pending, or positive for pending. */
 static inline int evtchn_port_poll(struct domain *d, evtchn_port_t port)
 {
@@ -285,21 +263,4 @@ static inline int evtchn_port_poll(struct domain *d, evtchn_port_t port)
     return rc;
 }
 
-static inline int evtchn_port_set_priority(struct domain *d,
-                                           struct evtchn *evtchn,
-                                           unsigned int priority)
-{
-    if ( !d->evtchn_port_ops->set_priority )
-        return -ENOSYS;
-    if ( !evtchn_usable(evtchn) )
-        return -EACCES;
-    return d->evtchn_port_ops->set_priority(d, evtchn, priority);
-}
-
-static inline void evtchn_port_print_state(struct domain *d,
-                                           const struct evtchn *evtchn)
-{
-    d->evtchn_port_ops->print_state(d, evtchn);
-}
-
 #endif /* __XEN_EVENT_H__ */
diff --git a/xen/include/xen/event_fifo.h b/xen/include/xen/event_fifo.h
deleted file mode 100644
index 0fec3d5316..0000000000
--- a/xen/include/xen/event_fifo.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * FIFO-based event channel ABI.
- *
- * Copyright (C) 2013 Citrix Systems R&D Ltd.
- *
- * This source code is licensed under the GNU General Public License,
- * Version 2 or later.  See the file COPYING for more details.
- */
-#ifndef __XEN_EVENT_FIFO_H__
-#define __XEN_EVENT_FIFO_H__
-
-int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
-int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
-void evtchn_fifo_destroy(struct domain *domain);
-
-#endif /* __XEN_EVENT_FIFO_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11503.30539 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERX-0001HI-Ei; Sat, 24 Oct 2020 07:58:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11503.30539; Sat, 24 Oct 2020 07:58:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERX-0001HA-Bf; Sat, 24 Oct 2020 07:58:27 +0000
Received: by outflank-mailman (input) for mailman id 11503;
 Sat, 24 Oct 2020 07:58:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWERW-0001Gz-1r
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9d464436-c59c-4636-81fd-11d1458465f7;
 Sat, 24 Oct 2020 07:58:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERV-0008CV-3k
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERV-0004qY-2y
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWERW-0001Gz-1r
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:26 +0000
X-Inumbo-ID: 9d464436-c59c-4636-81fd-11d1458465f7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9d464436-c59c-4636-81fd-11d1458465f7;
	Sat, 24 Oct 2020 07:58:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mJdGsKoXInv8mJjLVoP6QfueYL2ManfdTaoUcrzD+sI=; b=FZVe+KbqtDD1Wed89lGYpNvmWj
	ATaNrIdzTLdXlwfOCWnycNR4gFnjbhZK+dbZX0XYgRD3TyDMoXKlejH9MQWo0Az9qMKmEoqZ/GSw3
	LAtUc6V25A/nojISV8m1hGpzEYVRNTPDYp2cZ3TkSaxcZ3GVAOZuFsFxSSTpYlHUDx88=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERV-0008CV-3k
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERV-0004qY-2y
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: rename and adjust guest_enabled_event()
Message-Id: <E1kWERV-0004qY-2y@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:25 +0000

commit 451a9098608976ec164307a80eef40a2186fd5b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:11:46 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:11:46 2020 +0200

    evtchn: rename and adjust guest_enabled_event()
    
    The function isn't about an "event" in general, but about a vIRQ. The
    function also failed to honor global vIRQ-s, instead assuming the caller
    would pass vCPU 0 in such a case.
    
    While at it also adjust the
    - types the function uses,
    - single user to make use of domain_vcpu().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mcheck/vmce.h |  6 +++---
 xen/common/event_channel.c     | 10 ++++++++--
 xen/include/xen/event.h        |  4 ++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.h b/xen/arch/x86/cpu/mcheck/vmce.h
index 2797e00275..2e9b32a9bd 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.h
+++ b/xen/arch/x86/cpu/mcheck/vmce.h
@@ -5,9 +5,9 @@
 
 int vmce_init(struct cpuinfo_x86 *c);
 
-#define dom0_vmce_enabled() (hardware_domain && hardware_domain->max_vcpus \
-        && hardware_domain->vcpu[0] \
-        && guest_enabled_event(hardware_domain->vcpu[0], VIRQ_MCA))
+#define dom0_vmce_enabled() \
+    (hardware_domain && \
+     evtchn_virq_enabled(domain_vcpu(hardware_domain, 0), VIRQ_MCA))
 
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 8578af5f6b..37d0b75384 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -778,9 +778,15 @@ out:
     return ret;
 }
 
-int guest_enabled_event(struct vcpu *v, uint32_t virq)
+bool evtchn_virq_enabled(const struct vcpu *v, unsigned int virq)
 {
-    return ((v != NULL) && (v->virq_to_evtchn[virq] != 0));
+    if ( !v )
+        return false;
+
+    if ( virq_is_global(virq) && v->vcpu_id )
+        v = domain_vcpu(v->domain, 0);
+
+    return v->virq_to_evtchn[virq];
 }
 
 void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq)
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 6df989b51b..2ed4be78f6 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -85,8 +85,8 @@ int alloc_unbound_xen_event_channel(
     xen_event_channel_notification_t notification_fn);
 void free_xen_event_channel(struct domain *d, int port);
 
-/* Query if event channel is in use by the guest */
-int guest_enabled_event(struct vcpu *v, uint32_t virq);
+/* Query whether a vIRQ is in use by the guest. */
+bool evtchn_virq_enabled(const struct vcpu *v, unsigned int virq);
 
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11504.30543 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERh-0001JK-GM; Sat, 24 Oct 2020 07:58:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11504.30543; Sat, 24 Oct 2020 07:58:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERh-0001JC-D7; Sat, 24 Oct 2020 07:58:37 +0000
Received: by outflank-mailman (input) for mailman id 11504;
 Sat, 24 Oct 2020 07:58:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWERg-0001Iz-17
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d646d3dc-1092-4292-b103-704cd651eb56;
 Sat, 24 Oct 2020 07:58:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERf-0008D4-6x
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERf-0004rL-6H
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWERg-0001Iz-17
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:36 +0000
X-Inumbo-ID: d646d3dc-1092-4292-b103-704cd651eb56
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d646d3dc-1092-4292-b103-704cd651eb56;
	Sat, 24 Oct 2020 07:58:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DtQ/+TfWn+9wSSBEwvThJlTef+7EdMgjkHkLn6S+DJs=; b=nWak/RGuagV/TQnzv+7vTM7vpO
	kv3Z869joFd0RPLqgxvDgA/sR25SfsGkJTumm9oWOBWrOjy7CHIZxs5UTGTMGhgDbGDAKNsBjP+hu
	W8pynZ53fGg/i+ZaWDekPzLUsOsEDafodpP67qJkf3fuZrGbDKOdl/3Pte1PLMS5OAvs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERf-0008D4-6x
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERf-0004rL-6H
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] evtchn: let evtchn_set_priority() acquire the per-channel lock
Message-Id: <E1kWERf-0004rL-6H@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:35 +0000

commit b76c3a1b878b1897b7166a46a8cb341ef6dfa854
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:12:31 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:12:31 2020 +0200

    evtchn: let evtchn_set_priority() acquire the per-channel lock
    
    Some lock wants to be held to make sure the port doesn't change state,
    but there's no point holding the per-domain event lock here. Switch to
    using the finer grained per-channel lock instead (albeit as a downside
    for the time being this requires disabling interrupts for a short
    period of time).
    
    FAOD this doesn't guarantee anything towards in particular
    evtchn_fifo_set_pending(), as for interdomain channels that function
    would be called with the remote side's per-channel lock held.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/event_channel.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 37d0b75384..cd4a2c0501 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1154,20 +1154,17 @@ static long evtchn_set_priority(const struct evtchn_set_priority *set_priority)
 {
     struct domain *d = current->domain;
     unsigned int port = set_priority->port;
+    struct evtchn *chn;
     long ret;
-
-    spin_lock(&d->event_lock);
+    unsigned long flags;
 
     if ( !port_is_valid(d, port) )
-    {
-        spin_unlock(&d->event_lock);
         return -EINVAL;
-    }
 
-    ret = evtchn_port_set_priority(d, evtchn_from_port(d, port),
-                                   set_priority->priority);
-
-    spin_unlock(&d->event_lock);
+    chn = evtchn_from_port(d, port);
+    spin_lock_irqsave(&chn->lock, flags);
+    ret = evtchn_port_set_priority(d, chn, set_priority->priority);
+    spin_unlock_irqrestore(&chn->lock, flags);
 
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11505.30547 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERr-0001KZ-Hm; Sat, 24 Oct 2020 07:58:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11505.30547; Sat, 24 Oct 2020 07:58:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWERr-0001KR-Ei; Sat, 24 Oct 2020 07:58:47 +0000
Received: by outflank-mailman (input) for mailman id 11505;
 Sat, 24 Oct 2020 07:58:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWERq-0001KI-3s
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f306ea05-1f7f-4a53-930c-20542c7dabde;
 Sat, 24 Oct 2020 07:58:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERp-0008DD-A9
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERp-0004s7-9L
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWERq-0001KI-3s
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:46 +0000
X-Inumbo-ID: f306ea05-1f7f-4a53-930c-20542c7dabde
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f306ea05-1f7f-4a53-930c-20542c7dabde;
	Sat, 24 Oct 2020 07:58:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7O8+BT9DFmbQKxkrdcegyARUo4bBjsDfxmoIW+2x6J4=; b=s+z2pcKFmP6U/xr4RzUukyBUve
	RgdMgatQ7j5S9CwVtMjVA2k7KYVYuSxYfD9PjpQ4Qs4E1vtfrlMq0FXsV5o+vmtpGruv6nZQRRBBF
	N9u2IlfiOkcoskq76U6ozEhYAraZGgAdDaKc/A3eQtQfCnQWElmMOZRPMYq5ruLYbXIk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERp-0008DD-A9
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERp-0004s7-9L
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] pci: cleanup MSI interrupts before removing device from IOMMU
Message-Id: <E1kWERp-0004s7-9L@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:45 +0000

commit 710f62cc826bb8c7ead99f9d6b6b269e39ff3e98
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Oct 23 10:13:14 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:13:14 2020 +0200

    pci: cleanup MSI interrupts before removing device from IOMMU
    
    Doing the MSI cleanup after removing the device from the IOMMU leads
    to the following panic on AMD hardware:
    
    Assertion 'table.ptr && (index < intremap_table_entries(table.ptr, iommu))' failed at iommu_intr.c:172
    ----[ Xen-4.13.1-10.0.3-d  x86_64  debug=y   Not tainted ]----
    CPU:    3
    RIP:    e008:[<ffff82d08026ae3c>] drivers/passthrough/amd/iommu_intr.c#get_intremap_entry+0x52/0x7b
    [...]
    Xen call trace:
       [<ffff82d08026ae3c>] R drivers/passthrough/amd/iommu_intr.c#get_intremap_entry+0x52/0x7b
       [<ffff82d08026af25>] F drivers/passthrough/amd/iommu_intr.c#update_intremap_entry_from_msi_msg+0xc0/0x342
       [<ffff82d08026ba65>] F amd_iommu_msi_msg_update_ire+0x98/0x129
       [<ffff82d08025dd36>] F iommu_update_ire_from_msi+0x1e/0x21
       [<ffff82d080286862>] F msi_free_irq+0x55/0x1a0
       [<ffff82d080286f25>] F pci_cleanup_msi+0x8c/0xb0
       [<ffff82d08025cf52>] F pci_remove_device+0x1af/0x2da
       [<ffff82d0802a42d1>] F do_physdev_op+0xd18/0x1187
       [<ffff82d080383925>] F pv_hypercall+0x1f5/0x567
       [<ffff82d08038a432>] F lstar_enter+0x112/0x120
    
    That's because the call to iommu_remove_device on AMD hardware will
    remove the per-device interrupt remapping table, and hence the call to
    pci_cleanup_msi done afterwards will find a null intremap table and
    crash.
    
    Reorder the calls so that MSI interrupts are torn down before removing
    the device from the IOMMU.
    
    Fixes: d7cfeb7c13ed ("AMD/IOMMU: don't blindly allocate interrupt remapping tables")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index b035067975..2a3bce1462 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -834,10 +834,10 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
         if ( pdev->bus == bus && pdev->devfn == devfn )
         {
+            pci_cleanup_msi(pdev);
             ret = iommu_remove_device(pdev);
             if ( pdev->domain )
                 list_del(&pdev->domain_list);
-            pci_cleanup_msi(pdev);
             printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
             free_pdev(pseg, pdev);
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 24 07:58:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Oct 2020 07:58:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.11506.30553 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWES1-0001Lr-KC; Sat, 24 Oct 2020 07:58:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 11506.30553; Sat, 24 Oct 2020 07:58:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kWES1-0001Lj-GD; Sat, 24 Oct 2020 07:58:57 +0000
Received: by outflank-mailman (input) for mailman id 11506;
 Sat, 24 Oct 2020 07:58:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kWES0-0001LX-4s
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3d097d2f-0bd6-4e36-a491-ab05c4168598;
 Sat, 24 Oct 2020 07:58:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERz-0008DP-DW
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kWERz-0004sf-Ch
 for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=xFyj=D7=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kWES0-0001LX-4s
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:56 +0000
X-Inumbo-ID: 3d097d2f-0bd6-4e36-a491-ab05c4168598
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3d097d2f-0bd6-4e36-a491-ab05c4168598;
	Sat, 24 Oct 2020 07:58:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZLo0ZGtVxSk/7MpVnTHCGN3ICKsR+FSmzGHkhyC8gXM=; b=pDGxkB+ToABg6GHqtvZXAgDLiP
	hiZPtocsOhbWoQS46iGQUvExku4yjTWcgPpwsOfTPzs8zsULmgGxLzNX/KLjpYb3TYrF4EPjdJa6i
	glk34AccaRzmgORpNrge7O3rYtreXBUEx4NoCKy/lBcOmauwbqI/LqXTW0iD2x93mVp8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERz-0008DP-DW
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kWERz-0004sf-Ch
	for xen-changelog@lists.xenproject.org; Sat, 24 Oct 2020 07:58:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: increase FPU save area in test harness/fuzzer
Message-Id: <E1kWERz-0004sf-Ch@xenbits.xenproject.org>
Date: Sat, 24 Oct 2020 07:58:55 +0000

commit 6ca70821b59849ad97c3fadc47e63c1a4af1a78c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 10:13:53 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 10:13:53 2020 +0200

    x86emul: increase FPU save area in test harness/fuzzer
    
    Running them on a system (or emulator) with AMX support requires this
    to be quite a bit larger than 8k, to avoid triggering the assert() in
    emul_test_init(). Bump all the way up to 16k right away.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/x86-emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/x86-emulate.c b/tools/tests/x86_emulator/x86-emulate.c
index 572989078a..fb34933e82 100644
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -33,7 +33,7 @@
 uint32_t mxcsr_mask = 0x0000ffbf;
 struct cpuid_policy cp;
 
-static char fpu_save_area[4096] __attribute__((__aligned__((64))));
+static char fpu_save_area[0x4000] __attribute__((__aligned__((64))));
 static bool use_xsave;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Oct 26 11:11:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Oct 2020 11:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12252.32021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX0P6-0001dm-6M; Mon, 26 Oct 2020 11:11:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12252.32021; Mon, 26 Oct 2020 11:11:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX0P6-0001de-3F; Mon, 26 Oct 2020 11:11:08 +0000
Received: by outflank-mailman (input) for mailman id 12252;
 Mon, 26 Oct 2020 11:11:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kX0P4-0001dZ-HY
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f1b789ce-d24d-426d-b929-6fcd12634db2;
 Mon, 26 Oct 2020 11:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX0P3-0001X1-4z
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX0P3-0003cx-2a
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kX0P4-0001dZ-HY
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:06 +0000
X-Inumbo-ID: f1b789ce-d24d-426d-b929-6fcd12634db2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f1b789ce-d24d-426d-b929-6fcd12634db2;
	Mon, 26 Oct 2020 11:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KeOsFbxZ1TOB1iNGyYORg5zC2ZVZhkEYeHfNSddXKVo=; b=fby+mUzdrBrHu3jsmIG7Vm3Q3L
	oTRTuE54iRWhqQNJz/xkUiWM1Q0LbtlLfX0llhwSHoldhnCLLqUhFSTcke5BK6S5InXqkJEsYd89J
	dBxjpzbKnBruarovjfnoPM0Neop0cvKMKHfBCtyHUxfpPnT6jCXHuBuOMseOcjfplNvE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX0P3-0001X1-4z
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX0P3-0003cx-2a
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 11:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/helpers: fix Arm build by excluding init-xenstore-domain
Message-Id: <E1kX0P3-0003cx-2a@xenbits.xenproject.org>
Date: Mon, 26 Oct 2020 11:11:05 +0000

commit 92abe1481c1181b95c7f91846bd1d77f37ee5c5e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 25 06:45:46 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Mon Oct 26 11:04:59 2020 +0000

    tools/helpers: fix Arm build by excluding init-xenstore-domain
    
    The support for PVH xenstore-stubdom has broken the Arm build.
    
    Xenstore stubdom isn't supported on Arm, so there is no need to build
    the init-xenstore-domain helper.
    
    Build the helper on x86 only.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/Makefile | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index f759528322..1bcc97ea8a 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -7,8 +7,10 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 PROGS += xen-init-dom0
 ifeq ($(CONFIG_Linux),y)
+ifeq ($(CONFIG_X86),y)
 PROGS += init-xenstore-domain
 endif
+endif
 
 XEN_INIT_DOM0_OBJS = xen-init-dom0.o init-dom-json.o
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
@@ -37,17 +39,11 @@ init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
-ifeq ($(CONFIG_Linux),y)
-	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
-endif
+	for i in $(PROGS); do $(INSTALL_PROG) $$i $(DESTDIR)$(LIBEXEC_BIN); done
 
 .PHONY: uninstall
 uninstall:
-ifeq ($(CONFIG_Linux),y)
-	rm -f $(DESTDIR)$(LIBEXEC_BIN)/init-xenstore-domain
-endif
-	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xen-init-dom0
+	for i in $(PROGS); do rm -f $(DESTDIR)$(LIBEXEC_BIN)/$$i; done
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 26 13:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Oct 2020 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12332.32129 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX2nB-0006py-B6; Mon, 26 Oct 2020 13:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12332.32129; Mon, 26 Oct 2020 13:44:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX2nB-0006pq-8B; Mon, 26 Oct 2020 13:44:09 +0000
Received: by outflank-mailman (input) for mailman id 12332;
 Mon, 26 Oct 2020 13:44:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kX2n9-0006pl-Nn
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 29b47615-fdf7-45df-8e8a-e242f1857faf;
 Mon, 26 Oct 2020 13:44:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX2n8-0004gg-70
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX2n8-0006aQ-4c
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kX2n9-0006pl-Nn
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:07 +0000
X-Inumbo-ID: 29b47615-fdf7-45df-8e8a-e242f1857faf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 29b47615-fdf7-45df-8e8a-e242f1857faf;
	Mon, 26 Oct 2020 13:44:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zcH0tyyP0rCT7xAJ2UcOn5o92BZLuUlZhaCpC5KEsQo=; b=fnpE87pJ3QLHoIMhEuUQvbuFuk
	axbxVhCHy/0T7Opa76EM6HhmTMt6UfhvAO5bvppuk0OSyYV6PYnQflfV0945KKuzk0j4OfWuYSiR4
	MMSoFYYTH0RllSM8Z3wU7xqe9u7H1oWoPcHHIiatBXQGjkOeTzolG3Z2kHhVjpAOxKdM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX2n8-0004gg-70
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX2n8-0006aQ-4c
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] AMD/IOMMU: correct shattering of super pages
Message-Id: <E1kX2n8-0006aQ-4c@xenbits.xenproject.org>
Date: Mon, 26 Oct 2020 13:44:06 +0000

commit 2a758376f9e2bd277b6067952517a301da87dc86
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 14:38:35 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:38:35 2020 +0100

    AMD/IOMMU: correct shattering of super pages
    
    Fill the new page table _before_ installing into a live page table
    hierarchy, as installing a blank page first risks I/O faults on
    sub-ranges of the original super page which aren't part of the range
    for which mappings are being updated.
    
    While at it also do away with mapping and unmapping the same fresh
    intermediate page table page once per entry to be written.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 50 +++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 17418d39b3..f773ab33fd 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -81,19 +81,34 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
-                                          unsigned long dfn,
-                                          unsigned long next_mfn,
-                                          int pde_level,
-                                          bool iw, bool ir)
+static unsigned int set_iommu_ptes_present(unsigned long pt_mfn,
+                                           unsigned long dfn,
+                                           unsigned long next_mfn,
+                                           unsigned int nr_ptes,
+                                           unsigned int pde_level,
+                                           bool iw, bool ir)
 {
     union amd_iommu_pte *table, *pde;
-    unsigned int flush_flags;
+    unsigned int page_sz, flush_flags = 0;
 
     table = map_domain_page(_mfn(pt_mfn));
     pde = &table[pfn_to_pde_idx(dfn, pde_level)];
+    page_sz = 1U << (PTE_PER_TABLE_SHIFT * (pde_level - 1));
+
+    if ( (void *)(pde + nr_ptes) > (void *)table + PAGE_SIZE )
+    {
+        ASSERT_UNREACHABLE();
+        return 0;
+    }
+
+    while ( nr_ptes-- )
+    {
+        flush_flags |= set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
+
+        ++pde;
+        next_mfn += page_sz;
+    }
 
-    flush_flags = set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
     unmap_domain_page(table);
 
     return flush_flags;
@@ -220,11 +235,8 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
         /* Split super page frame into smaller pieces.*/
         if ( pde->pr && !pde->next_level && next_table_mfn )
         {
-            int i;
             unsigned long mfn, pfn;
-            unsigned int page_sz;
 
-            page_sz = 1 << (PTE_PER_TABLE_SHIFT * (next_level - 1));
             pfn =  dfn & ~((1 << (PTE_PER_TABLE_SHIFT * next_level)) - 1);
             mfn = next_table_mfn;
 
@@ -238,17 +250,13 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
             }
 
             next_table_mfn = mfn_x(page_to_mfn(table));
+
+            set_iommu_ptes_present(next_table_mfn, pfn, mfn, PTE_PER_TABLE_SIZE,
+                                   next_level, true, true);
+            smp_wmb();
             set_iommu_pde_present(pde, next_table_mfn, next_level, true,
                                   true);
 
-            for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
-            {
-                set_iommu_pte_present(next_table_mfn, pfn, mfn, next_level,
-                                      true, true);
-                mfn += page_sz;
-                pfn += page_sz;
-             }
-
             amd_iommu_flush_all_pages(d);
         }
 
@@ -318,9 +326,9 @@ int amd_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn,
     }
 
     /* Install 4k mapping */
-    *flush_flags |= set_iommu_pte_present(pt_mfn[1], dfn_x(dfn), mfn_x(mfn),
-                                          1, (flags & IOMMUF_writable),
-                                          (flags & IOMMUF_readable));
+    *flush_flags |= set_iommu_ptes_present(pt_mfn[1], dfn_x(dfn), mfn_x(mfn),
+                                           1, 1, (flags & IOMMUF_writable),
+                                           (flags & IOMMUF_readable));
 
     spin_unlock(&hd->arch.mapping_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 26 13:44:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Oct 2020 13:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12333.32134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX2nK-0006qi-Ca; Mon, 26 Oct 2020 13:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12333.32134; Mon, 26 Oct 2020 13:44:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX2nK-0006qa-9e; Mon, 26 Oct 2020 13:44:18 +0000
Received: by outflank-mailman (input) for mailman id 12333;
 Mon, 26 Oct 2020 13:44:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kX2nJ-0006qR-9N
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9b99c660-3371-4e7b-8dd3-32c2c7720575;
 Mon, 26 Oct 2020 13:44:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX2nI-0004gj-CC
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX2nI-0006bq-9Q
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kX2nJ-0006qR-9N
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:17 +0000
X-Inumbo-ID: 9b99c660-3371-4e7b-8dd3-32c2c7720575
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9b99c660-3371-4e7b-8dd3-32c2c7720575;
	Mon, 26 Oct 2020 13:44:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yn4PuGhyObHT30X4nItIaUjEImuRZdP++AvqLJbq0TE=; b=nPJLNZUqHQv8g2dvxSraDFiA0i
	gviNXCfnwl3aiSrPvmLNoaRQMN+o5TZGKJaz9n/3F8VZG5k9Vz2A+8Rj7JvIlZSGmk9m1DzH4h08z
	67BF//hBmVytKFAnCLr0LaqW+08/d2nwJMefYXdsS7ZpPa5u2RQNu1BTgAgTI1AgV59w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX2nI-0004gj-CC
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX2nI-0006bq-9Q
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 13:44:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: drop dead pci_lock_*pdev() declarations
Message-Id: <E1kX2nI-0006bq-9Q@xenbits.xenproject.org>
Date: Mon, 26 Oct 2020 13:44:16 +0000

commit 20cd1be5e29577ba4c6c952cc86dfd7cfbd841b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 14:39:42 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:39:42 2020 +0100

    PCI: drop dead pci_lock_*pdev() declarations
    
    They have no definitions, and hence users, anywhere.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/pci.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 2bc4aaf453..c4d3879761 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -155,9 +155,6 @@ bool_t pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);
 int scan_pci_devices(void);
 enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn);
 int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);
-struct pci_dev *pci_lock_pdev(int seg, int bus, int devfn);
-struct pci_dev *pci_lock_domain_pdev(
-    struct domain *, int seg, int bus, int devfn);
 
 void setup_hwdom_pci_devices(struct domain *,
                             int (*)(u8 devfn, struct pci_dev *));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Oct 26 14:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Oct 2020 14:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12381.32240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX3tr-0005Ne-Mb; Mon, 26 Oct 2020 14:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12381.32240; Mon, 26 Oct 2020 14:55:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kX3tr-0005NW-JZ; Mon, 26 Oct 2020 14:55:07 +0000
Received: by outflank-mailman (input) for mailman id 12381;
 Mon, 26 Oct 2020 14:55:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kX3tq-0005NR-Hg
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e8681fbc-9c13-47cb-88f7-578a0fe15a38;
 Mon, 26 Oct 2020 14:55:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX3tp-0006Dw-D2
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kX3tp-0004MG-B8
 for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=zHi0=EB=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kX3tq-0005NR-Hg
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:06 +0000
X-Inumbo-ID: e8681fbc-9c13-47cb-88f7-578a0fe15a38
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e8681fbc-9c13-47cb-88f7-578a0fe15a38;
	Mon, 26 Oct 2020 14:55:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CzAgYA88tf93/IA4X0+Ek+sxQ82ExJGXxgJBbxMjBt8=; b=lmBBSztF5q53j/GFWGXM/978tQ
	7wYN8hsFSC7hqPdU1eT0oxgDX1ZNjNcnmIwVYAy1Jgz1ox8Ec/sY/VFjXWqQHZdT2mQY4i8hDxnEH
	GCB7TZipvnJp862Tl07aOgngn3IB2m/9wWnR7JtRqxRLaqxNUmM7VNP+ShgIPqsvV9Uo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX3tp-0006Dw-D2
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kX3tp-0004MG-B8
	for xen-changelog@lists.xenproject.org; Mon, 26 Oct 2020 14:55:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libs: let build depend on official headers
Message-Id: <E1kX3tp-0004MG-B8@xenbits.xenproject.org>
Date: Mon, 26 Oct 2020 14:55:05 +0000

commit 964781c6f162893677c50a779b7d562a299727ba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 25 11:11:29 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Mon Oct 26 14:48:52 2020 +0000

    tools/libs: let build depend on official headers
    
    The build target of a library should depend on the official headers
    of that library, too, as those might be required for building other
    tools.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 959ff91a56..b0e785b380 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -57,7 +57,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
 all: build
 
 .PHONY: build
-build: libs libxen$(LIBNAME).map
+build: libs libxen$(LIBNAME).map $(LIBHEADERS)
 
 .PHONY: libs
 libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:33:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12625.32817 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXb-0002xT-B3; Tue, 27 Oct 2020 06:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12625.32817; Tue, 27 Oct 2020 06:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXb-0002xK-7O; Tue, 27 Oct 2020 06:33:07 +0000
Received: by outflank-mailman (input) for mailman id 12625;
 Tue, 27 Oct 2020 06:33:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIXZ-0002xF-HE
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d01ab19a-44d2-436e-a208-d0c7aaa533dd;
 Tue, 27 Oct 2020 06:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXW-0006e7-NC
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXW-0006q4-Kw
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIXZ-0002xF-HE
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:05 +0000
X-Inumbo-ID: d01ab19a-44d2-436e-a208-d0c7aaa533dd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d01ab19a-44d2-436e-a208-d0c7aaa533dd;
	Tue, 27 Oct 2020 06:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZkDyhedTrr7IGTZuvwjZQ/lcogEegPn8IE/hOnc++v4=; b=TcTqdO0xZi7Rk2H8SS6kkTKH5R
	BVCHxJRJSCLw0Ko/bQ2S0TrzyZXj4WhL5UXz/5qBPHFs4melg9o1NbMORlo9THFHiOzU1cTRV1+eU
	pyOEAsaKWIRVGuNDlbPtfpUuZDUhpN67GVzVyq/VPF+wO/ZoAtxmOF5sXfpwvMpDMt08=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXW-0006e7-NC
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXW-0006q4-Kw
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] maintainers: fix libxl paths
Message-Id: <E1kXIXW-0006q4-Kw@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:02 +0000

commit 032a96e5ef38f96eccfebbf8a0dbd83dc7beb625
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 9 13:59:43 2020 +0200
Commit:     Ian Jackson <ian.jackson@eu.citrix.com>
CommitDate: Fri Oct 23 14:29:53 2020 +0100

    maintainers: fix libxl paths
    
    Fix the paths of libxl in the MAINTAINERS file.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 26c5382075..482407b049 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -357,7 +357,8 @@ M:	Ian Jackson <iwj@xenproject.org>
 M:	Wei Liu <wl@xen.org>
 M:	Anthony PERARD <anthony.perard@citrix.com>
 S:	Supported
-F:	tools/libxl/
+F:	tools/libs/guest/
+F:	tools/libs/light/
 F:	tools/xl/
 
 LIVEPATCH
@@ -428,9 +429,9 @@ M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
 M:	Yang Hongyang <imhy.yang@gmail.com>
 S:	Maintained
 F:	docs/README.remus
-F:	tools/libxl/libxl_remus_*
-F:	tools/libxl/libxl_netbuffer.c
-F:	tools/libxl/libxl_nonetbuffer.c
+F:	tools/libs/light/libxl_remus_*
+F:	tools/libs/light/libxl_netbuffer.c
+F:	tools/libs/light/libxl_nonetbuffer.c
 F:	tools/hotplug/Linux/remus-netbuf-setup
 F:	tools/hotplug/Linux/block-drbd-probe
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:33:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12626.32821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXj-0002yE-Br; Tue, 27 Oct 2020 06:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12626.32821; Tue, 27 Oct 2020 06:33:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXj-0002y6-8x; Tue, 27 Oct 2020 06:33:15 +0000
Received: by outflank-mailman (input) for mailman id 12626;
 Tue, 27 Oct 2020 06:33:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIXh-0002xs-SH
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ba10adba-16a8-487d-b9fb-acea242ce820;
 Tue, 27 Oct 2020 06:33:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXg-0006eD-SR
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXg-0006r2-Pq
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIXh-0002xs-SH
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:13 +0000
X-Inumbo-ID: ba10adba-16a8-487d-b9fb-acea242ce820
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ba10adba-16a8-487d-b9fb-acea242ce820;
	Tue, 27 Oct 2020 06:33:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wjrvCGvCPr41mmQNSqg/em5bdjtd6HAuIc0R41TK5Tw=; b=J5metUH71pdgDpcOydGaEEjDHO
	UtqteDrJrM7GjJw5Fk9mOGBNEGNRJEHFpn010Veys4CPe1Um7fzyPacge9l7LsLVFo3ar96OwPX/h
	FsldYnOdsyTfgBx3O1FXz0vEl+U2n3XdMBjc3HZl8OmPkXXJvObeP+RYexSy/EPhhd3Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXg-0006eD-SR
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXg-0006r2-Pq
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] maintainers: remove unreachable remus maintainer
Message-Id: <E1kXIXg-0006r2-Pq@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:12 +0000

commit 70cf8e9acada638f68c1c597d7580500d9f21c91
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Sep 9 13:59:44 2020 +0200
Commit:     Ian Jackson <ian.jackson@eu.citrix.com>
CommitDate: Fri Oct 23 14:29:58 2020 +0100

    maintainers: remove unreachable remus maintainer
    
    The mails for Yang Hongyang are bouncing, remove him from MAINTAINERS
    file.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 482407b049..dab38a6a14 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -426,7 +426,6 @@ T:	git https://xenbits.xenproject.org/git-http/qemu-xen.git
 
 REMUS
 M:	Shriram Rajagopalan <rshriram@cs.ubc.ca>
-M:	Yang Hongyang <imhy.yang@gmail.com>
 S:	Maintained
 F:	docs/README.remus
 F:	tools/libs/light/libxl_remus_*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:33:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12627.32825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXt-000303-DT; Tue, 27 Oct 2020 06:33:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12627.32825; Tue, 27 Oct 2020 06:33:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIXt-0002zv-AQ; Tue, 27 Oct 2020 06:33:25 +0000
Received: by outflank-mailman (input) for mailman id 12627;
 Tue, 27 Oct 2020 06:33:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIXs-0002zl-Ie
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4ecce125-b968-410c-a6e2-2c545e2759c3;
 Tue, 27 Oct 2020 06:33:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXq-0006f1-W4
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIXq-0006sB-V0
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIXs-0002zl-Ie
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:24 +0000
X-Inumbo-ID: 4ecce125-b968-410c-a6e2-2c545e2759c3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4ecce125-b968-410c-a6e2-2c545e2759c3;
	Tue, 27 Oct 2020 06:33:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vdp5NtGoX0B8dqnyf7AxnxxfhzwTY1rMK5KSprgpu+E=; b=kIL2Z4m7FCFHCIgIOxEgFyFgA/
	EYoXEs0T2kBPflFrYaU1QHuarJ2Dx6aotN+NEPi4Xulv+53uH5o8zWq6uNvs8Kt5BroThPQvnMEjp
	Ixfhjis+aZEFQ89goY3fLibna0LrbeYU9dwdEm1WyhmfI48lDHbHzzjRiL3ET+ducHF8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXq-0006f1-W4
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIXq-0006sB-V0
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/init-xenstore-domain: add logging
Message-Id: <E1kXIXq-0006sB-V0@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:22 +0000

commit 56c1aca6a2bc013f45e7af2fa88605a693402770
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:53:09 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:52 2020 +0200

    tools/init-xenstore-domain: add logging
    
    Add a possibility to do logging in init-xenstore-domain: use -v[...]
    for selecting the log-level as in xl, log to stderr.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/init-xenstore-domain.c | 51 ++++++++++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index bcaa0e6fa9..2a7d3c9599 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -10,6 +10,7 @@
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xenstore.h>
+#include <xentoollog.h>
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
 #include <xen/io/xenbus.h>
@@ -36,6 +37,7 @@ static struct option options[] = {
     { "param", 1, NULL, 'p' },
     { "name", 1, NULL, 'n' },
     { "maxmem", 1, NULL, 'M' },
+    { "verbose", 0, NULL, 'v' },
     { NULL, 0, NULL, 0 }
 };
 
@@ -57,7 +59,8 @@ static void usage(void)
 "  --maxmem <max size>        maximum memory size in the format:\n"
 "                             <MB val>|<a>/<b>|<MB val>:<a>/<b>\n"
 "                             (an absolute value in MB, a fraction a/b of\n"
-"                             the host memory, or the maximum of both)\n");
+"                             the host memory, or the maximum of both)\n"
+"  -v[v[v]]                   verbosity of domain building\n");
 }
 
 static int build(xc_interface *xch)
@@ -349,8 +352,10 @@ int main(int argc, char** argv)
     char buf[16], be_path[64], fe_path[64];
     int rv, fd;
     char *maxmem_str = NULL;
+    xentoollog_level minmsglevel = XTL_PROGRESS;
+    xentoollog_logger *logger = NULL;
 
-    while ( (opt = getopt_long(argc, argv, "", options, NULL)) != -1 )
+    while ( (opt = getopt_long(argc, argv, "v", options, NULL)) != -1 )
     {
         switch ( opt )
         {
@@ -375,6 +380,10 @@ int main(int argc, char** argv)
         case 'M':
             maxmem_str = optarg;
             break;
+        case 'v':
+            if ( minmsglevel )
+                minmsglevel--;
+            break;
         default:
             usage();
             return 2;
@@ -387,11 +396,15 @@ int main(int argc, char** argv)
         return 2;
     }
 
-    xch = xc_interface_open(NULL, NULL, 0);
+    logger = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr,
+                                                               minmsglevel, 0);
+
+    xch = xc_interface_open(logger, logger, 0);
     if ( !xch )
     {
         fprintf(stderr, "xc_interface_open() failed\n");
-        return 1;
+        rv = 1;
+        goto out;
     }
 
     if ( maxmem_str )
@@ -400,7 +413,8 @@ int main(int argc, char** argv)
         if ( maxmem < 0 )
         {
             xc_interface_close(xch);
-            return 1;
+            rv = 1;
+            goto out;
         }
     }
 
@@ -414,17 +428,24 @@ int main(int argc, char** argv)
     xc_interface_close(xch);
 
     if ( rv )
-        return 1;
+    {
+        rv = 1;
+        goto out;
+    }
 
     rv = gen_stub_json_config(domid, NULL);
     if ( rv )
-        return 3;
+    {
+        rv = 3;
+        goto out;
+    }
 
     xsh = xs_open(0);
     if ( !xsh )
     {
         fprintf(stderr, "xs_open() failed.\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
     snprintf(buf, 16, "%d", domid);
     do_xs_write(xsh, "/tool/xenstored/domid", buf);
@@ -460,7 +481,8 @@ int main(int argc, char** argv)
     if ( fd < 0 )
     {
         fprintf(stderr, "Creating " XEN_RUN_DIR "/xenstored.pid failed\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
     rv = snprintf(buf, 16, "domid:%d\n", domid);
     rv = write(fd, buf, rv);
@@ -469,10 +491,17 @@ int main(int argc, char** argv)
     {
         fprintf(stderr,
                 "Writing domid to " XEN_RUN_DIR "/xenstored.pid failed\n");
-        return 3;
+        rv = 3;
+        goto out;
     }
 
-    return 0;
+    rv = 0;
+
+ out:
+    if ( logger )
+        xtl_logger_destroy(logger);
+
+    return rv;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:33:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:33:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12628.32828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIY3-00031T-Es; Tue, 27 Oct 2020 06:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12628.32828; Tue, 27 Oct 2020 06:33:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIY3-00031L-Bv; Tue, 27 Oct 2020 06:33:35 +0000
Received: by outflank-mailman (input) for mailman id 12628;
 Tue, 27 Oct 2020 06:33:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIY2-00031B-4s
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 17480a5d-4938-41bd-864d-9c02ea9b9be5;
 Tue, 27 Oct 2020 06:33:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIY1-0006f8-3T
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIY1-0006tC-2D
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIY2-00031B-4s
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:34 +0000
X-Inumbo-ID: 17480a5d-4938-41bd-864d-9c02ea9b9be5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 17480a5d-4938-41bd-864d-9c02ea9b9be5;
	Tue, 27 Oct 2020 06:33:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rnDnThmgaFpV3YSyH6OrGjtwKIwY2VuQwCeAR2HNkYQ=; b=MdtMa9et/5234Fkbcx0ymzjoeW
	TJ4qFPYR27KnZjeWDA3vElI9yZCv5SrPnPcEK2gB9xJEAWUK1WbjpRWEaI3Rv3BKUWTHtR0kYCIdK
	0eNIkeHcXjYbvtDZ64XAY8uWAyKanlpR9Ly+rkQ+BUvOce4sRyiM/sgVHIlkqizGstRs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIY1-0006f8-3T
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIY1-0006tC-2D
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/init-xenstore-domain: support xenstore pvh stubdom
Message-Id: <E1kXIY1-0006tC-2D@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:33 +0000

commit f89955449c5a47ff688e91873bbce4c3670ed9fe
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri Oct 23 15:53:10 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:54 2020 +0200

    tools/init-xenstore-domain: support xenstore pvh stubdom
    
    Instead of creating the xenstore-stubdom domain first and parsing the
    kernel later do it the other way round. This enables to probe for the
    domain type supported by the xenstore-stubdom and to support both, pv
    and pvh type stubdoms.
    
    Try to parse the stubdom image first for PV support, if this fails use
    HVM. Then create the domain with the appropriate type selected.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/init-xenstore-domain.c | 119 +++++++++++++++++++++++++----------
 1 file changed, 85 insertions(+), 34 deletions(-)

diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 2a7d3c9599..6836002f0b 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -18,6 +18,10 @@
 #include "init-dom-json.h"
 #include "_paths.h"
 
+#define LAPIC_BASE_ADDRESS  0xfee00000UL
+#define MB(x)               ((uint64_t)x << 20)
+#define GB(x)               ((uint64_t)x << 30)
+
 static uint32_t domid = ~0;
 static char *kernel;
 static char *ramdisk;
@@ -69,6 +73,8 @@ static int build(xc_interface *xch)
     int rv, xs_fd;
     struct xc_dom_image *dom = NULL;
     int limit_kb = (maxmem ? : (memory + 1)) * 1024;
+    uint64_t mem_size = MB(memory);
+    struct e820entry e820[3];
     struct xen_domctl_createdomain config = {
         .ssidref = SECINITSID_DOMU,
         .flags = XEN_DOMCTL_CDF_xs_domain,
@@ -101,6 +107,66 @@ static int build(xc_interface *xch)
         }
     }
 
+    dom = xc_dom_allocate(xch, NULL, NULL);
+    if ( !dom )
+    {
+        fprintf(stderr, "xc_dom_allocate failed\n");
+        rv = -1;
+        goto err;
+    }
+
+    rv = xc_dom_kernel_file(dom, kernel);
+    if ( rv )
+    {
+        fprintf(stderr, "xc_dom_kernel_file failed\n");
+        goto err;
+    }
+
+    if ( ramdisk )
+    {
+        rv = xc_dom_module_file(dom, ramdisk, NULL);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_dom_module_file failed\n");
+            goto err;
+        }
+    }
+
+    dom->container_type = XC_DOM_HVM_CONTAINER;
+    rv = xc_dom_parse_image(dom);
+    if ( rv )
+    {
+        dom->container_type = XC_DOM_PV_CONTAINER;
+        rv = xc_dom_parse_image(dom);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_dom_parse_image failed\n");
+            goto err;
+        }
+    }
+    else
+    {
+        config.flags |= XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap;
+        config.arch.emulation_flags = XEN_X86_EMU_LAPIC;
+        dom->target_pages = mem_size >> XC_PAGE_SHIFT;
+        dom->mmio_size = GB(4) - LAPIC_BASE_ADDRESS;
+        dom->lowmem_end = (mem_size > LAPIC_BASE_ADDRESS) ?
+                          LAPIC_BASE_ADDRESS : mem_size;
+        dom->highmem_end = (mem_size > LAPIC_BASE_ADDRESS) ?
+                           GB(4) + mem_size - LAPIC_BASE_ADDRESS : 0;
+        dom->mmio_start = LAPIC_BASE_ADDRESS;
+        dom->max_vcpus = 1;
+        e820[0].addr = 0;
+        e820[0].size = dom->lowmem_end;
+        e820[0].type = E820_RAM;
+        e820[1].addr = LAPIC_BASE_ADDRESS;
+        e820[1].size = dom->mmio_size;
+        e820[1].type = E820_RESERVED;
+        e820[2].addr = GB(4);
+        e820[2].size = dom->highmem_end - GB(4);
+        e820[2].type = E820_RAM;
+    }
+
     rv = xc_domain_create(xch, &domid, &config);
     if ( rv )
     {
@@ -125,11 +191,15 @@ static int build(xc_interface *xch)
         fprintf(stderr, "xc_evtchn_alloc_unbound failed\n");
         goto err;
     }
-    rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
-    if ( rv )
+
+    if ( dom->container_type == XC_DOM_PV_CONTAINER )
     {
-        fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
-        goto err;
+        rv = xc_domain_set_memmap_limit(xch, domid, limit_kb);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_domain_set_memmap_limit failed\n");
+            goto err;
+        }
     }
 
     rv = ioctl(xs_fd, IOCTL_XENBUS_BACKEND_SETUP, domid);
@@ -144,45 +214,16 @@ static int build(xc_interface *xch)
     else
         snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
-    dom = xc_dom_allocate(xch, cmdline, NULL);
-    if ( !dom )
-    {
-        fprintf(stderr, "xc_dom_allocate failed\n");
-        goto err;
-    }
-    dom->container_type = XC_DOM_PV_CONTAINER;
+    dom->cmdline = xc_dom_strdup(dom, cmdline);
     dom->xenstore_domid = domid;
     dom->console_evtchn = console_evtchn;
 
-    rv = xc_dom_kernel_file(dom, kernel);
-    if ( rv )
-    {
-        fprintf(stderr, "xc_dom_kernel_file failed\n");
-        goto err;
-    }
-
-    if ( ramdisk )
-    {
-        rv = xc_dom_module_file(dom, ramdisk, NULL);
-        if ( rv )
-        {
-            fprintf(stderr, "xc_dom_module_file failed\n");
-            goto err;
-        }
-    }
-
     rv = xc_dom_boot_xen_init(dom, xch, domid);
     if ( rv )
     {
         fprintf(stderr, "xc_dom_boot_xen_init failed\n");
         goto err;
     }
-    rv = xc_dom_parse_image(dom);
-    if ( rv )
-    {
-        fprintf(stderr, "xc_dom_parse_image failed\n");
-        goto err;
-    }
     rv = xc_dom_mem_init(dom, memory);
     if ( rv )
     {
@@ -195,6 +236,16 @@ static int build(xc_interface *xch)
         fprintf(stderr, "xc_dom_boot_mem_init failed\n");
         goto err;
     }
+    if ( dom->container_type == XC_DOM_HVM_CONTAINER )
+    {
+        rv = xc_domain_set_memory_map(xch, domid, e820,
+                                      dom->highmem_end ? 3 : 2);
+        if ( rv )
+        {
+            fprintf(stderr, "xc_domain_set_memory_map failed\n");
+            goto err;
+        }
+    }
     rv = xc_dom_build_image(dom);
     if ( rv )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:33:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12629.32833 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYF-000337-IC; Tue, 27 Oct 2020 06:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12629.32833; Tue, 27 Oct 2020 06:33:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYF-00032z-Eu; Tue, 27 Oct 2020 06:33:47 +0000
Received: by outflank-mailman (input) for mailman id 12629;
 Tue, 27 Oct 2020 06:33:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIYD-00032s-Vw
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e47150f8-d7a4-4971-958c-e658571db50e;
 Tue, 27 Oct 2020 06:33:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYB-0006fH-7F
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYB-0006uA-6H
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIYD-00032s-Vw
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:46 +0000
X-Inumbo-ID: e47150f8-d7a4-4971-958c-e658571db50e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e47150f8-d7a4-4971-958c-e658571db50e;
	Tue, 27 Oct 2020 06:33:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jj5qTxS0hf+2UrVevWbrgvZ/4k2x/Lkf1kgnBVQdkfo=; b=zPH3aQ417tlITaUgsMFbtjuDT2
	1b3dOo2uwT5qhc6/uq4TcchxVW4HwGFjjBHIaPKKRP+BWO7lsqqORloHo6Cynjt7xCLbmIjPVrv+0
	2INhi8dbsNDmiUWtJ/EZ+R3bm+2fuV4Mr/CZ4kxgNh3rZCnMVuBc10v4FT3nKQ8Sf65E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYB-0006fH-7F
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYB-0006uA-6H
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] stubdom: add xenstore pvh stubdom
Message-Id: <E1kXIYB-0006uA-6H@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:43 +0000

commit 154137dfdba334348887baf0be9693c407f7cef3
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Oct 7 08:50:03 2020 +0200
Commit:     Juergen Gross <jgross@suse.com>
CommitDate: Fri Oct 23 15:56:56 2020 +0200

    stubdom: add xenstore pvh stubdom
    
    Add a PVH xenstore stubdom in order to support a Xenstore stubdom on
    a hypervisor built without PV-support.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Wei Liu <wl@xen.org>
---
 .gitignore                     |  1 +
 stubdom/Makefile               | 31 ++++++++++++++++++++++++++--
 stubdom/configure              | 47 ++++++++++++++++++++++++++++++++++++++++++
 stubdom/configure.ac           |  1 +
 stubdom/xenstorepvh-minios.cfg | 10 +++++++++
 5 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index f6865c9cd8..b30a779f9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,6 +91,7 @@ stubdom/stubdompath.sh
 stubdom/tpm_emulator-*
 stubdom/vtpm/vtpm_manager.h
 stubdom/xenstore
+stubdom/xenstorepvh
 stubdom/zlib-*
 tools/*/build/lib*/*.py
 tools/autom4te.cache/
diff --git a/stubdom/Makefile b/stubdom/Makefile
index fb9617fa14..90d9ffcd9f 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -367,7 +367,10 @@ $(foreach lib,$(STUB_LIBS),$(eval $(call BUILD_lib,$(lib))))
 xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
 	$(do_links)
 
-LINK_DIRS := xenstore $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir))
+xenstorepvh/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
+	$(do_links)
+
+LINK_DIRS := xenstore xenstorepvh $(foreach dir,$(STUB_LIBS),libs-$(XEN_TARGET_ARCH)/$(dir))
 LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp)
 
 mk-headers-$(XEN_TARGET_ARCH): $(IOEMU_LINKFARM_TARGET) $(LINK_STAMPS)
@@ -486,6 +489,17 @@ xenstore-minios-config.mk: $(CURDIR)/xenstore-minios.cfg
 xenstore: $(CROSS_ROOT) xenstore-minios-config.mk
 	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstore-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
 
+#############
+# xenstorepvh
+#############
+
+xenstorepvh-minios-config.mk: $(CURDIR)/xenstorepvh-minios.cfg
+	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
+
+.PHONY: xenstorepvh
+xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
+	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat xenstorepvh-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ xenstored.a CONFIG_STUBDOM=y
+
 ########
 # minios
 ########
@@ -519,6 +533,10 @@ pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
 xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxenguest xenstore
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstore-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstore/xenstored.a
 
+.PHONY: xenstorepvh-stubdom
+xenstorepvh-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstorepvh libxenguest xenstorepvh
+	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/xenstorepvh-minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/xenstorepvh/xenstored.a
+
 #########
 # install
 #########
@@ -548,6 +566,10 @@ install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
 
+install-xenstorepvh: xenstorepvh-stubdom
+	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstorepvh/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstorepvh-stubdom.gz"
+
 install-vtpm: vtpm-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-vtpm/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz"
@@ -581,6 +603,9 @@ uninstall-grub:
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
+uninstall-xenstorepvh:
+	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstorepvh-stubdom.gz
+
 uninstall-vtpm:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/vtpm-stubdom.gz
 
@@ -600,6 +625,7 @@ clean:
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-caml
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
+	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) DESTDIR= -C caml clean
@@ -612,6 +638,7 @@ clean:
 	rm -fr pkg-config
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
+	-[ ! -d xenstorepvh ] || $(MAKE) DESTDIR= -C xenstorepvh clean
 
 # clean the cross-compilation result
 .PHONY: crossclean
@@ -620,7 +647,7 @@ crossclean: clean
 	rm -fr newlib-$(XEN_TARGET_ARCH)
 	rm -fr zlib-$(XEN_TARGET_ARCH) pciutils-$(XEN_TARGET_ARCH)
 	rm -fr libs-$(XEN_TARGET_ARCH)
-	rm -fr ioemu xenstore
+	rm -fr ioemu xenstore xenstorepvh
 	rm -fr gmp-$(XEN_TARGET_ARCH)
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr openssl-$(XEN_TARGET_ARCH)
diff --git a/stubdom/configure b/stubdom/configure
index 3668203db8..903414589b 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,6 +630,7 @@ WGET
 CMAKE
 extfiles
 debug
+xenstorepvh
 xenstore
 grub
 caml
@@ -689,6 +690,7 @@ enable_c_stubdom
 enable_caml_stubdom
 enable_pv_grub
 enable_xenstore_stubdom
+enable_xenstore_pvh_stubdom
 enable_vtpm_stubdom
 enable_vtpmmgr_stubdom
 enable_qemu_traditional
@@ -1344,6 +1346,9 @@ Optional Features:
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
+  --disable-xenstorepvh-stubdom
+                          Build and install xenstorepvh-stubdom (default is
+                          ENABLED)
   --enable-vtpm-stubdom   Build and install vtpm-stubdom
   --enable-vtpmmgr-stubdom
                           Build and install vtpmmgr-stubdom
@@ -2178,6 +2183,48 @@ fi
 
 
 
+# Check whether --enable-xenstorepvh-stubdom was given.
+if test "${enable_xenstore_pvh_stubdom+set}" = set; then :
+  enableval=$enable_xenstore_pvh_stubdom;
+
+if test "x$enableval" = "xyes"; then :
+
+
+xenstorepvh=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS xenstorepvh"
+STUBDOM_BUILD="$STUBDOM_BUILD xenstorepvh-stubdom"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-xenstorepvh"
+STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-xenstorepvh"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
+xenstorepvh=n
+
+
+fi
+
+fi
+
+
+else
+
+
+xenstorepvh=y
+STUBDOM_TARGETS="$STUBDOM_TARGETS xenstorepvh"
+STUBDOM_BUILD="$STUBDOM_BUILD xenstorepvh-stubdom"
+STUBDOM_INSTALL="$STUBDOM_INSTALL install-xenstorepvh"
+STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-xenstorepvh"
+
+
+fi
+
+
+
+
 # Check whether --enable-vtpm-stubdom was given.
 if test "${enable_vtpm_stubdom+set}" = set; then :
   enableval=$enable_vtpm_stubdom;
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index a2d514c021..bd6f765929 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -23,6 +23,7 @@ AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
 AX_STUBDOM_DEFAULT_DISABLE([caml-stubdom], [caml])
 AX_STUBDOM_DEFAULT_ENABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
+AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
 AX_STUBDOM_CONDITIONAL([vtpmmgr-stubdom], [vtpmmgr])
 
diff --git a/stubdom/xenstorepvh-minios.cfg b/stubdom/xenstorepvh-minios.cfg
new file mode 100644
index 0000000000..6af51f5753
--- /dev/null
+++ b/stubdom/xenstorepvh-minios.cfg
@@ -0,0 +1,10 @@
+CONFIG_PARAVIRT=n
+CONFIG_BLKFRONT=n
+CONFIG_NETFRONT=n
+CONFIG_FBFRONT=n
+CONFIG_KBDFRONT=n
+CONFIG_CONSFRONT=n
+CONFIG_XENBUS=n
+CONFIG_LWIP=n
+CONFIG_BALLOON=y
+XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12630.32837 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYT-00034S-Kq; Tue, 27 Oct 2020 06:34:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12630.32837; Tue, 27 Oct 2020 06:34:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYT-00034L-Gt; Tue, 27 Oct 2020 06:34:01 +0000
Received: by outflank-mailman (input) for mailman id 12630;
 Tue, 27 Oct 2020 06:34:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIYS-00034D-Jx
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 86fec0fb-aad6-44ae-89fc-3632e6e6b8f8;
 Tue, 27 Oct 2020 06:33:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYL-0006fR-D0
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYL-0006v0-BD
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIYS-00034D-Jx
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:00 +0000
X-Inumbo-ID: 86fec0fb-aad6-44ae-89fc-3632e6e6b8f8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 86fec0fb-aad6-44ae-89fc-3632e6e6b8f8;
	Tue, 27 Oct 2020 06:33:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fwKSiTTW+rpJhA7M/6+qvm5PuPiCaKcJe3Dcwze2yAc=; b=AzgIH8QcgIUGpgl0a2alft50i6
	QHtneVB95CaeCh4CF2KVjRZer1F+lF/ZEk2LB6KYzi6sSxC7DCWSR1V0fIBdqi/0e2FCpIZsjTPaL
	R8aZogB9rkh/FoKhwJa/byKauF7Eaqr/2ZQLMKF4TQuY9SVeHXsiMBfGc9JSxiiy2u/0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYL-0006fR-D0
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYL-0006v0-BD
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:33:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs: move official headers to common directory
Message-Id: <E1kXIYL-0006v0-BD@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:33:53 +0000

commit 4664034cdc720a52913bc26358240bb9d3798527
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:50:51 2020 +0100

    tools/libs: move official headers to common directory
    
    Instead of each library having an own include directory move the
    official headers to tools/include instead. This will drop the need to
    link those headers to tools/include and there is no need any longer
    to have library-specific include paths when building Xen.
    
    While at it remove setting of the unused variable
    PKG_CONFIG_CFLAGS_LOCAL in libs/*/Makefile.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 .gitignore                                         |    5 +-
 stubdom/mini-os.mk                                 |    2 +-
 tools/Rules.mk                                     |    5 +-
 tools/include/Makefile                             |    6 +
 tools/include/libxenvchan.h                        |  176 ++
 tools/include/libxl.h                              | 2732 ++++++++++++++++++++
 tools/include/libxl_event.h                        |  632 +++++
 tools/include/libxl_json.h                         |   96 +
 tools/include/libxl_utils.h                        |  194 ++
 tools/include/libxl_uuid.h                         |   80 +
 tools/include/libxlutil.h                          |  136 +
 tools/include/xencall.h                            |  143 +
 tools/include/xenctrl.h                            | 2666 +++++++++++++++++++
 tools/include/xenctrl_compat.h                     |  183 ++
 tools/include/xendevicemodel.h                     |  378 +++
 tools/include/xenevtchn.h                          |  174 ++
 tools/include/xenforeignmemory.h                   |  192 ++
 tools/include/xengnttab.h                          |  470 ++++
 tools/include/xenguest.h                           |  723 ++++++
 tools/include/xenhypfs.h                           |   95 +
 tools/include/xenstat.h                            |  197 ++
 tools/include/xenstore-compat/xs.h                 |    2 +
 tools/include/xenstore-compat/xs_lib.h             |    2 +
 tools/include/xenstore.h                           |  281 ++
 tools/include/xenstore_lib.h                       |   94 +
 tools/include/xentoolcore.h                        |   88 +
 tools/include/xentoolcore_internal.h               |  158 ++
 tools/include/xentoollog.h                         |  146 ++
 tools/libs/call/Makefile                           |    3 -
 tools/libs/call/include/xencall.h                  |  143 -
 tools/libs/ctrl/Makefile                           |    3 -
 tools/libs/ctrl/include/xenctrl.h                  | 2666 -------------------
 tools/libs/ctrl/include/xenctrl_compat.h           |  183 --
 tools/libs/devicemodel/Makefile                    |    3 -
 tools/libs/devicemodel/include/xendevicemodel.h    |  378 ---
 tools/libs/evtchn/Makefile                         |    2 -
 tools/libs/evtchn/include/xenevtchn.h              |  174 --
 tools/libs/foreignmemory/Makefile                  |    3 -
 .../libs/foreignmemory/include/xenforeignmemory.h  |  192 --
 tools/libs/gnttab/Makefile                         |    3 -
 tools/libs/gnttab/include/xengnttab.h              |  470 ----
 tools/libs/guest/Makefile                          |    3 -
 tools/libs/guest/include/xenguest.h                |  723 ------
 tools/libs/hypfs/Makefile                          |    3 -
 tools/libs/hypfs/include/xenhypfs.h                |   95 -
 tools/libs/libs.mk                                 |   10 +-
 tools/libs/light/Makefile                          |   28 +-
 tools/libs/light/include/libxl.h                   | 2732 --------------------
 tools/libs/light/include/libxl_event.h             |  632 -----
 tools/libs/light/include/libxl_json.h              |   96 -
 tools/libs/light/include/libxl_utils.h             |  194 --
 tools/libs/light/include/libxl_uuid.h              |   80 -
 tools/libs/stat/Makefile                           |    2 -
 tools/libs/stat/include/xenstat.h                  |  197 --
 tools/libs/store/Makefile                          |   11 +-
 tools/libs/store/include/compat/xs.h               |    2 -
 tools/libs/store/include/compat/xs_lib.h           |    2 -
 tools/libs/store/include/xenstore.h                |  281 --
 tools/libs/toolcore/Makefile                       |    9 +-
 tools/libs/toolcore/include/xentoolcore.h          |   88 -
 tools/libs/toolcore/include/xentoolcore_internal.h |  158 --
 tools/libs/toollog/Makefile                        |    2 -
 tools/libs/toollog/include/xentoollog.h            |  146 --
 tools/libs/util/Makefile                           |    3 -
 tools/libs/util/include/libxlutil.h                |  136 -
 tools/libs/vchan/Makefile                          |    3 -
 tools/libs/vchan/include/libxenvchan.h             |  176 --
 tools/ocaml/libs/xentoollog/Makefile               |    2 +-
 tools/ocaml/libs/xentoollog/genlevels.py           |    2 +-
 tools/xenstore/xenstore_lib.h                      |   94 -
 70 files changed, 10074 insertions(+), 10115 deletions(-)

diff --git a/.gitignore b/.gitignore
index b30a779f9f..b169d78ed7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -144,7 +144,6 @@ tools/libs/light/test_timedereg
 tools/libs/light/test_fdderegrace
 tools/libs/light/tmp.*
 tools/libs/light/xenlight.pc
-tools/libs/light/include/_*.h
 tools/libs/stat/_paths.h
 tools/libs/stat/headers.chk
 tools/libs/stat/libxenstat.map
@@ -154,7 +153,6 @@ tools/libs/store/list.h
 tools/libs/store/utils.h
 tools/libs/store/xenstore.pc
 tools/libs/store/xs_lib.c
-tools/libs/store/include/xenstore_lib.h
 tools/libs/util/*.pc
 tools/libs/util/_paths.h
 tools/libs/util/libxlu_cfg_y.output
@@ -232,7 +230,8 @@ tools/hotplug/Linux/xendomains
 tools/hotplug/NetBSD/rc.d/xencommons
 tools/hotplug/NetBSD/rc.d/xendriverdomain
 tools/include/acpi
-tools/include/*.h
+tools/include/_libxl*.h
+tools/include/_xentoolcore_list.h
 tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
diff --git a/stubdom/mini-os.mk b/stubdom/mini-os.mk
index 420e9a8771..7e4968e026 100644
--- a/stubdom/mini-os.mk
+++ b/stubdom/mini-os.mk
@@ -5,7 +5,7 @@
 # XEN_ROOT
 # MINIOS_TARGET_ARCH
 
-XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/libs/store/include
+XENSTORE_CPPFLAGS = -isystem $(XEN_ROOT)/tools/include
 TOOLCORE_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toolcore
 TOOLLOG_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/toollog
 EVTCHN_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/evtchn
diff --git a/tools/Rules.mk b/tools/Rules.mk
index f3e0078927..f61da81f4a 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -87,7 +87,7 @@ endif
 define LIB_defs
  FILENAME_$(1) ?= xen$(1)
  XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1)
- CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude)
+ CFLAGS_libxen$(1) = $$(CFLAGS_xeninclude)
  SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use)))
  LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILENAME_$(1))$$(libextension)
  SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1))
@@ -97,8 +97,7 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib))))
 
 # code which compiles against libxenctrl get __XEN_TOOLS__ and
 # therefore sees the unstable hypercall interfaces.
-CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__
-CFLAGS_libxenguest += $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory)
+CFLAGS_libxenctrl += -D__XEN_TOOLS__
 
 ifeq ($(CONFIG_Linux),y)
 LDLIBS_libxenstore += -ldl
diff --git a/tools/include/Makefile b/tools/include/Makefile
index 4d4313b60d..4d4ec5f974 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -1,6 +1,12 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+# Caution: some tools/libs/*/Makefile generate header files directly in
+# tools/include, and they do the [un]install actions for those, too.
+# In case other headers need to be built cwin tools/include this should be
+# taken into account, i.e. there should be no rules added here for generating
+# any tools/include/*.h files.
+
 # Relative to $(XEN_ROOT)/xen/xsm/flask
 FLASK_H_DEPEND := policy/initial_sids
 
diff --git a/tools/include/libxenvchan.h b/tools/include/libxenvchan.h
new file mode 100644
index 0000000000..d6010b145d
--- /dev/null
+++ b/tools/include/libxenvchan.h
@@ -0,0 +1,176 @@
+/**
+ * @file
+ * @section AUTHORS
+ *
+ * Copyright (C) 2010  Rafal Wojtczuk  <rafal@invisiblethingslab.com>
+ *
+ *  Authors:
+ *       Rafal Wojtczuk  <rafal@invisiblethingslab.com>
+ *       Daniel De Graaf <dgdegra@tycho.nsa.gov>
+ *
+ * @section LICENSE
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @section DESCRIPTION
+ *
+ *  Originally borrowed from the Qubes OS Project, http://www.qubes-os.org,
+ *  this code has been substantially rewritten to use the gntdev and gntalloc
+ *  devices instead of raw MFNs and map_foreign_range.
+ *
+ *  This is a library for inter-domain communication.  A standard Xen ring
+ *  buffer is used, with a datagram-based interface built on top.  The grant
+ *  reference and event channels are shared in XenStore under the path
+ *  /local/domain/<srv-id>/data/vchan/<cli-id>/<port>/{ring-ref,event-channel}
+ *
+ *  The ring.h macros define an asymmetric interface to a shared data structure
+ *  that assumes all rings reside in a single contiguous memory space. This is
+ *  not suitable for vchan because the interface to the ring is symmetric except
+ *  for the setup. Unlike the producer-consumer rings defined in ring.h, the
+ *  size of the rings used in vchan are determined at execution time instead of
+ *  compile time, so the macros in ring.h cannot be used to access the rings.
+ */
+
+#include <xen/io/libxenvchan.h>
+#include <xen/xen.h>
+#include <xen/sys/evtchn.h>
+#include <xenevtchn.h>
+#include <xengnttab.h>
+
+/* Callers who don't care don't need to #include <xentoollog.h> */
+struct xentoollog_logger;
+
+struct libxenvchan_ring {
+	/* Pointer into the shared page. Offsets into buffer. */
+	struct ring_shared* shr;
+	/* ring data; may be its own shared page(s) depending on order */
+	void* buffer;
+	/**
+	 * The size of the ring is (1 << order); offsets wrap around when they
+	 * exceed this. This copy is required because we can't trust the order
+	 * in the shared page to remain constant.
+	 */
+	int order;
+};
+
+/**
+ * struct libxenvchan: control structure passed to all library calls
+ */
+struct libxenvchan {
+	/* Mapping handle for shared ring page */
+	union {
+		xengntshr_handle *gntshr; /* for server */
+		xengnttab_handle *gnttab; /* for client */
+	};
+	/* Pointer to shared ring page */
+	struct vchan_interface *ring;
+	/* event channel interface */
+	xenevtchn_handle *event;
+	uint32_t event_port;
+	/* informative flags: are we acting as server? */
+	int is_server:1;
+	/* true if server remains active when client closes (allows reconnection) */
+	int server_persist:1;
+	/* true if operations should block instead of returning 0 */
+	int blocking:1;
+	/* communication rings */
+	struct libxenvchan_ring read, write;
+};
+
+/**
+ * Set up a vchan, including granting pages
+ * @param logger Logger for libxc errors
+ * @param domain The peer domain that will be connecting
+ * @param xs_path Base xenstore path for storing ring/event data
+ * @param send_min The minimum size (in bytes) of the send ring (left)
+ * @param recv_min The minimum size (in bytes) of the receive ring (right)
+ * @return The structure, or NULL in case of an error
+ */
+struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path,
+                                            size_t read_min, size_t write_min);
+/**
+ * Connect to an existing vchan. Note: you can reconnect to an existing vchan
+ * safely, however no locking is performed, so you must prevent multiple clients
+ * from connecting to a single server.
+ *
+ * @param logger Logger for libxc errors
+ * @param domain The peer domain to connect to
+ * @param xs_path Base xenstore path for storing ring/event data
+ * @return The structure, or NULL in case of an error
+ */
+struct libxenvchan *libxenvchan_client_init(struct xentoollog_logger *logger,
+                                            int domain, const char* xs_path);
+/**
+ * Close a vchan. This deallocates the vchan and attempts to free its
+ * resources. The other side is notified of the close, but can still read any
+ * data pending prior to the close.
+ */
+void libxenvchan_close(struct libxenvchan *ctrl);
+
+/**
+ * Packet-based receive: always reads exactly $size bytes.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data that was read
+ * @param size Size of the buffer and amount of data to read
+ * @return -1 on error, 0 if nonblocking and insufficient data is available, or $size
+ */
+int libxenvchan_recv(struct libxenvchan *ctrl, void *data, size_t size);
+/**
+ * Stream-based receive: reads as much data as possible.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data that was read
+ * @param size Size of the buffer
+ * @return -1 on error, otherwise the amount of data read (which may be zero if
+ *         the vchan is nonblocking)
+ */
+int libxenvchan_read(struct libxenvchan *ctrl, void *data, size_t size);
+/**
+ * Packet-based send: send entire buffer if possible
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data to send
+ * @param size Size of the buffer and amount of data to send
+ * @return -1 on error, 0 if nonblocking and insufficient space is available, or $size
+ */
+int libxenvchan_send(struct libxenvchan *ctrl, const void *data, size_t size);
+/**
+ * Stream-based send: send as much data as possible.
+ * @param ctrl The vchan control structure
+ * @param data Buffer for data to send
+ * @param size Size of the buffer
+ * @return -1 on error, otherwise the amount of data sent (which may be zero if
+ *         the vchan is nonblocking)
+ */
+int libxenvchan_write(struct libxenvchan *ctrl, const void *data, size_t size);
+/**
+ * Waits for reads or writes to unblock, or for a close
+ */
+int libxenvchan_wait(struct libxenvchan *ctrl);
+/**
+ * Returns the event file descriptor for this vchan. When this FD is readable,
+ * libxenvchan_wait() will not block, and the state of the vchan has changed since
+ * the last invocation of libxenvchan_wait().
+ */
+int libxenvchan_fd_for_select(struct libxenvchan *ctrl);
+/**
+ * Query the state of the vchan shared page:
+ *  return 0 when one side has called libxenvchan_close() or crashed
+ *  return 1 when both sides are open
+ *  return 2 [server only] when no client has yet connected
+ */
+int libxenvchan_is_open(struct libxenvchan* ctrl);
+/** Amount of data ready to read, in bytes */
+int libxenvchan_data_ready(struct libxenvchan *ctrl);
+/** Amount of data it is possible to send without blocking */
+int libxenvchan_buffer_space(struct libxenvchan *ctrl);
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
new file mode 100644
index 0000000000..1ea5b4f446
--- /dev/null
+++ b/tools/include/libxl.h
@@ -0,0 +1,2732 @@
+/*
+ * Copyright (C) 2009      Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@eu.citrix.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+/*
+ * libxl API compatibility
+ *
+ * From Xen 4.2 onwards the API of libxl will be maintained in a
+ * stable manner. This means that it should be possible to write an
+ * application against the API provided by libxl in Xen 4.2 and expect
+ * that it will continue to compile against future versions of Xen
+ * without source modification.
+ *
+ * In order to make such compatibility possible it is required that
+ * application which want to be exposed to a particular API #define
+ * LIBXL_API_VERSION before including libxl.h or any other libxl
+ * header. The syntax of the LIBXL_API_VERSION is:
+ *    0xVVSSEE
+ * where ($(XEN_xxx) from xen/Makefile):
+ *   VV is the Xen major release number, $(XEN_VERSION)
+ *   SS is the Xen sub version number, $(XEN_SUBVERSION)
+ *   EE is the Xen extra version digit, first numeric part of
+ *     $(XEN_EXTRAVERSION) not including the leading "."
+ * For example the first stable API version, supported by Xen 4.2.0,
+ * is 0x040200.
+ *
+ * Lack of LIBXL_API_VERSION means "the latest" which will
+ * change. Specifying an unknown LIBXL_API_VERSION will result in a
+ * compile time error.
+ *
+ * Identical versions of the libxl API will represented by the version
+ * containing the earliest instance of that API. e.g. if 4.2.0 and
+ * 4.3.0 contain an identical libxl API then only LIBXL_API_VERSION
+ * 0x040200 will be valid.
+ *
+ * We will try especially hard to avoid changing the API during a
+ * stable series, i.e. it should be unusual for the last byte of
+ * LIBXL_API_VERSION to be non-zero.
+ *
+ * In the event that a change is required which cannot be made
+ * backwards compatible in this manner a #define of the form
+ * LIBXL_HAVE_<interface> will always be added in order to make it
+ * possible to write applications which build against any version of
+ * libxl. Such changes are expected to be exceptional and used as a
+ * last resort. The barrier for backporting such a change to a stable
+ * branch will be very high.
+ *
+ * These guarantees apply only to stable releases of Xen. When an
+ * incompatible change is made in the unstable tree then
+ * LIBXL_API_VERSION will be bumped to the next expected stable
+ * release number on the first such change only. Applications which
+ * want to support building against Xen unstable are expected to track
+ * API changes in that tree until it is released as a stable release.
+ *
+ * API compatibility will be maintained for all versions of Xen using
+ * the same $(XEN_VERSION) (e.g. throughout a major release).
+ */
+
+/* LIBXL_HAVE_PHYSINFO_CAP_PV
+ *
+ * If this is defined, libxl_physinfo has a "cap_pv" field.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_PV 1
+
+/* LIBXL_HAVE_CONSOLE_NOTIFY_FD
+ *
+ * If this is defined, libxl_console_exec and
+ * libxl_primary_console_exe take a notify_fd parameter. That
+ * parameter will be used to notify the caller that the console is connected.
+ */
+#define LIBXL_HAVE_CONSOLE_NOTIFY_FD 1
+
+/* LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS
+ *
+ * If this is defined, the copy functions have constified src parameter and the
+ * length functions accept constified parameter.
+ */
+#define LIBXL_HAVE_CONST_COPY_AND_LENGTH_FUNCTIONS 1
+
+/* LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO
+ *
+ * If this is defined, libxl_domain_need_memory no longer modifies
+ * the b_info paseed in.
+ */
+#define LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONST_B_INFO 1
+
+/* LIBXL_HAVE_VNUMA
+ *
+ * If this is defined the type libxl_vnode_info exists, and a
+ * field 'vnuma_nodes' is present in libxl_domain_build_info.
+ */
+#define LIBXL_HAVE_VNUMA 1
+
+/* LIBXL_HAVE_USERDATA_UNLINK
+ *
+ * If it is defined, libxl has a library function called
+ * libxl_userdata_unlink.
+ */
+#define LIBXL_HAVE_USERDATA_UNLINK 1
+
+/* LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID
+ *
+ * If this is defined, libxl has a library function called
+ * libxl_cpupool_qualifier_to_cpupoolid, which takes in a CPU pool
+ * qualifier in the form of number or string, then returns the ID of
+ * that CPU pool.
+ */
+#define LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID 1
+
+/* LIBXL_HAVE_CPUPOOL_ADD_REM_CPUMAP
+ *
+ * If this is defined, libxl has two library functions called
+ * libxl_cpupool_cpuadd_cpumap and libxl_cpupool_cpuremove_cpumap,
+ * which allow to add to or remove from a cpupool all the cpus
+ * specified in a bitmap.
+ */
+#define LIBXL_HAVE_CPUPOOL_ADD_REM_CPUMAP 1
+
+/*
+ *
+ * LIBXL_HAVE_BITMAP_AND_OR
+ *
+ * If this is defined, libxl has two library functions, libxl_bitmap_and
+ * and libxl_bitmap_or to compute the logical and and or of two bitmaps
+ */
+#define LIBXL_HAVE_BITMAP_AND_OR 1
+
+/*
+ * LIBXL_HAVE_FIRMWARE_PASSTHROUGH indicates the feature for
+ * passing in SMBIOS and ACPI firmware to HVM guests is present
+ * in the library.
+ */
+#define LIBXL_HAVE_FIRMWARE_PASSTHROUGH 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_NODEAFFINITY indicates that a 'nodemap' field
+ * (of libxl_bitmap type) is present in libxl_domain_build_info,
+ * containing the node-affinity for the domain.
+ */
+#define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
+
+/*
+ * LIBXL_HAVE_PVUSB indicates functions for plugging in USB devices
+ * through pvusb -- both hotplug and at domain creation time..
+ */
+#define LIBXL_HAVE_PVUSB 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE indicates that the
+ * libxl_vendor_device field is present in the hvm sections of
+ * libxl_domain_build_info. This field tells libxl which
+ * flavour of xen-pvdevice to enable in QEMU.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE 1
+
+/*
+ * The libxl_domain_build_info has the event_channels field.
+ */
+#define LIBXL_HAVE_BUILDINFO_EVENT_CHANNELS 1
+
+/*
+ * libxl_domain_build_info has the u.hvm.ms_vm_genid field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MS_VM_GENID 1
+
+/*
+ * LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY indicates that a 'cpumap_soft'
+ * field (of libxl_bitmap type) is present in libxl_vcpuinfo,
+ * containing the soft affinity of a vcpu.
+ */
+#define LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY 1
+
+/*
+ * LIBXL_HAVE_SET_VCPUAFFINITY_FORCE indicates that the
+ * libxl_set_vcpuaffinity_force() library call is available.
+ */
+#define LIBXL_HAVE_SET_VCPUAFFINITY_FORCE 1
+
+/*
+ * LIBXL_HAVE_DEVICE_DISK_DIRECT_IO_SAFE indicates that a
+ * 'direct_io_safe' field (of boolean type) is present in
+ * libxl_device_disk.
+ */
+#define LIBXL_HAVE_DEVICE_DISK_DIRECT_IO_SAFE 1
+
+/*
+ * The libxl_device_disk has the discard_enable field.
+ */
+#define LIBXL_HAVE_LIBXL_DEVICE_DISK_DISCARD_ENABLE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_IOMEM_START_GFN indicates that it is possible
+ * to specify the start guest frame number used to map a range of I/O
+ * memory machine frame numbers via the 'gfn' field (of type uint64)
+ * of the 'iomem' structure. An array of iomem structures is embedded
+ * in libxl_domain_build_info and used to map the indicated memory
+ * ranges during domain build.
+ */
+#define LIBXL_HAVE_BUILDINFO_IOMEM_START_GFN 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS indicates that the RTDS real time scheduler
+ * is available. A 'budget' field added in libxl_domain_sched_params.
+ */
+#define LIBXL_HAVE_SCHED_RTDS 1
+
+/*
+ * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler
+ * is available.
+ */
+#define LIBXL_HAVE_SCHED_NULL 1
+
+/*
+ * libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps
+ * of the specified width.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE 1
+#define LIBXL_BUILDINFO_HVM_VIRIDIAN_ENABLE_DISABLE_WIDTH 64
+
+/*
+ * libxl_domain_build_info has the u.hvm.mmio_hole_memkb field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1
+
+/*
+ * libxl_domain_info returns ERROR_DOMAIN_NOTFOUND if the domain
+ * is not present, instead of ERROR_INVAL.
+ */
+#define LIBXL_HAVE_ERROR_DOMAIN_NOTFOUND 1
+
+/*
+ * libxl_domain_build_info has device_tree and libxl_device_dtdev
+ * exists. This mean Device Tree passthrough is supported for ARM
+ */
+#define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
+
+/*
+ * libxl_domain_build_info has device_model_user to specify the user to
+ * run the device model with. See docs/misc/qemu-deprivilege.txt.
+ */
+#define LIBXL_HAVE_DEVICE_MODEL_USER 1
+
+/*
+ * libxl_vcpu_sched_params is used to store per-vcpu params.
+ */
+#define LIBXL_HAVE_VCPU_SCHED_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS indicates RTDS scheduler
+ * now supports per-vcpu settings.
+ */
+#define LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA indicates RTDS scheduler
+ * now supports per-vcpu extratime settings.
+ */
+#define LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA 1
+
+/*
+ * libxl_domain_build_info has the arm.gic_version field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1
+
+/*
+ * libxl_domain_build_info has the arch_arm.tee field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 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_HAVE_APIC_ASSIST indicates that the 'apic_assist' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_APIC_ASSIST 1
+
+/*
+ * LIBXL_HAVE_BUILD_ID means that libxl_version_info has the extra
+ * field for the hypervisor build_id.
+ */
+#define LIBXL_HAVE_BUILD_ID 1
+
+/*
+ * LIBXL_HAVE_QEMU_MONITOR_COMMAND indiactes the availability of the
+ * libxl_qemu_monitor_command() function.
+ */
+#define LIBXL_HAVE_QEMU_MONITOR_COMMAND 1
+
+/*
+ * LIBXL_HAVE_SCHED_CREDIT2_PARAMS indicates the existance of a
+ * libxl_sched_credit2_params structure, containing Credit2 scheduler
+ * wide parameters (i.e., the ratelimiting value).
+ */
+#define LIBXL_HAVE_SCHED_CREDIT2_PARAMS 1
+
+/*
+ * LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY indicates that there is a field
+ * in libxl_sched_credit_params called vcpu_migr_delay_us which controls
+ * the resistance of the vCPUs of the cpupool to migrations among pCPUs.
+ */
+#define LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_CRASH_CTL indicates that the 'crash_ctl' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_CRASH_CTL 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_SYNIC indicates that the 'synic' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_SYNIC 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_STIMER indicates that the 'stimer' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_STIMER 1
+
+/*
+ * LIBXL_HAVE_VIRIDIAN_HCALL_IPI indicates that the 'hcall_ipi' value
+ * is present in the viridian enlightenment enumeration.
+ */
+#define LIBXL_HAVE_VIRIDIAN_HCALL_IPI 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE indicates that
+ * libxl_domain_build_info has the u.hvm.acpi_laptop_slate field.
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1
+
+/*
+ * LIBXL_HAVE_P9S indicates that the p9 field in IDL has been changed to p9s
+ */
+#define LIBXL_HAVE_P9S 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_ARM_VUART indicates that the toolstack supports virtual UART
+ * for ARM.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARM_VUART 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_GRANT_LIMITS indicates that libxl_domain_build_info
+ * has the max_grant_frames and max_maptrack_frames fields.
+ */
+#define LIBXL_HAVE_BUILDINFO_GRANT_LIMITS 1
+
+#define LIBXL_MAX_GRANT_DEFAULT (~(uint32_t)0)
+#define LIBXL_MAX_GRANT_FRAMES_DEFAULT 32 /* deprecated */
+#define LIBXL_MAX_MAPTRACK_FRAMES_DEFAULT 1024 /* deprecated */
+/*
+ * LIBXL_HAVE_BUILDINFO_GRANT_DEFAULT indicates that the default
+ * values of max_grant_frames and max_maptrack_frames fields in
+ * libxl_domain_build_info are the special sentinel value
+ * LIBXL_MAX_GRANT_DEFAULT rather than the fixed values above.
+ * This means to use the hypervisor's default.
+ */
+#define LIBXL_HAVE_BUILDINFO_GRANT_DEFAULT 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_* indicates that libxl_domain_build_info has
+ * the field represented by the '*'. The original position of those
+ * fields is:
+ *  - u.hvm.timer_mode
+ *  - u.hvm.apic
+ *  - u.hvm.nested_hvm
+ *  - u.pv.bootloader
+ *  - u.pv.bootloader_args
+ */
+#define LIBXL_HAVE_BUILDINFO_TIMER_MODE 1
+#define LIBXL_HAVE_BUILDINFO_APIC 1
+#define LIBXL_HAVE_BUILDINFO_NESTED_HVM 1
+#define LIBXL_HAVE_BUILDINFO_BOOTLOADER 1
+#define LIBXL_HAVE_BUILDINFO_BOOTLOADER_ARGS 1
+
+/*
+ * LIBXL_HAVE_EXTENDED_VKB indicates that libxl_device_vkb has extended fields:
+ *  - unique_id;
+ *  - feature_disable_keyboard;
+ *  - feature_disable_pointer;
+ *  - feature_abs_pointer;
+ *  - feature_raw_pointer;
+ *  - feature_multi_touch;
+ *  - width;
+ *  - height;
+ *  - multi_touch_width;
+ *  - multi_touch_height;
+ *  - multi_touch_num_contacts.
+ */
+#define LIBXL_HAVE_EXTENDED_VKB 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_CAP_HAP_SHADOW indicates that libxl_physinfo has
+ * cap_hap and cap_shadow fields reflecting the hardware and Xen availability
+ * of Hardware Assisted, and Shadow paging support.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_HAP_SHADOW 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_CAP_IOMMU_HAP_PT_SHARE indicates that libxl_physinfo
+ * has a cap_iommu_hap_pt_share field that indicates whether the hardware
+ * supports sharing the IOMMU and HAP page tables.
+ */
+#define LIBXL_HAVE_PHYSINFO_CAP_IOMMU_HAP_PT_SHARE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_IOMMU_MEMKB indicates thate libxl_domain_build_info
+ * has an iommu_memkb field which should be set with the amount of memory
+ * overhead needed by the domain for populating IOMMU page tables.
+ */
+#define LIBXL_HAVE_BUILDINFO_IOMMU_MEMKB 1
+
+/*
+ * LIBXL_HAVE_CREATEINFO_PASSTHROUGH indicates that
+ * libxl_domain_create_info has a passthrough field (which is a
+ * libxl_passthrough enumeration) that indicates whether device pass-
+ * through is enabled for the domain and, if so, whether the IOMMU and
+ * HAP page tables may be shared or not.
+ */
+#define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
+
+/*
+ * LIBXL_HAVE_DISK_SAFE_REMOVE indicates that the
+ * libxl_device_disk_safe_remove() function is defined.
+ */
+#define LIBXL_HAVE_DISK_SAFE_REMOVE 1
+
+/*
+ * libxl ABI compatibility
+ *
+ * The only guarantee which libxl makes regarding ABI compatibility
+ * across releases is that the SONAME will always be bumped whenever
+ * the ABI is changed in an incompatible way.
+ *
+ * This applies within stable branches as well as
+ * development branches. It is possible that a new stable release of
+ * Xen may require a rebuild of applications using the
+ * library. However per the API compatibility gaurantees such a
+ * rebuild should not normally require any source level changes.
+ *
+ * As with the API compatiblity the SONAME will only be bumped for the
+ * first ABI incompatible change in a development branch.
+ */
+
+/*
+ * libxl memory management
+ *
+ * From the point of view of the application (ie, libxl's caller),
+ * struct libxl_ctx* is threadsafe, and all returned allocated
+ * structures are obtained from malloc(), and must be freed by the
+ * caller either directly or by calling an appropriate free function
+ * provided by libxl.  Ie the application does not get automatic
+ * assistance from libxl in managing these allocations.
+ *
+ * Specific details are in the header comments which should be found
+ * in libxl.h or libxlutil.h, next to the relevant function
+ * declarations.
+ *
+ * Internally, libxl has a garbage collection scheme which allows much libxl
+ * code to allocate strings etc. for internal use without needing to
+ * free them.  These are called "temporary allocations".
+ *
+ * The pool for these temporary allocations, along with any other
+ * thread-specific data which is private to libxl but shared between
+ * libxl functions (such as the current xenstore transaction), is
+ * stored in the "gc context" which is a special enhanced context
+ * structure allocated automatically by convenience macros at every
+ * entry to libxl.
+ *
+ * Every libxl function falls into one of these categories:
+ *
+ * 1. Public functions (declared in libxl.h, libxlutil.h), which may
+ *    be called by libxl applications.  If a public function returns
+ *    any allocated object to its caller, that object must have come
+ *    from malloc.
+ *
+ *    The definitions of public functions MUST use the gc context
+ *    initialisation macros (or do the equivalent work themselves).
+ *    These macros will ensure that all temporary allocations will be
+ *    automatically freed before the function returns to its caller.
+ *
+ *    A public function may be called from within libxl; the call
+ *    context initialisation macros will make sure that the internal
+ *    caller's context is reused (eg, so that the same xenstore
+ *    transaction is used).  But in-libxl callers of libxl public
+ *    functions should note that any libxl public function may cause
+ *    recursively reentry into libxl via the application's event
+ *    callback hook.
+ *
+ *    Public functions have names like libxl_foobar.
+ *
+ * 2. Private functions, which may not be called by libxl
+ *    applications; they are not declared in libxl.h or libxlutil.h
+ *    and they may not be called other than by other libxl functions.
+ *
+ *    Private functions should not use the gc context initialisation
+ *    macros.
+ *
+ *    Private functions have names like libxl__foobar (NB, two underscores).
+ *    Also the declaration of such functions must be preceeded by the _hidden
+ *    macro.
+ *
+ * Allocations made by a libxl function fall into one of the following
+ * categories (where "object" includes any memory allocation):
+ *
+ * (a) Objects which are not returned to the function's caller.
+ *     These should be allocated from the temporary pool.
+ *
+ * (b) Objects which are intended for return to the calling
+ *     application.  This includes all allocated objects returned by
+ *     any public function.
+ *
+ *     It may also include objects allocated by an internal function
+ *     specifically for eventual return by the function's external
+ *     callers, but this situation should be clearly documented in
+ *     comments.
+ *
+ *     These should be allocated from malloc() et al. and comments
+ *     near the function declaration should explain the memory
+ *     ownership.  If a simple free() by the application is not
+ *     sufficient, a suitable public freeing function should be
+ *     provided.
+ *
+ * (c) Internal objects whose size and/or lifetime dictate explicit
+ *     memory management within libxl.  This includes objects which
+ *     will be embedded in opaque structures which will be returned to
+ *     the libxl caller (more generally, any internal object whose
+ *     lifetime exceeds the libxl entrypoint which creates it) and
+ *     objects which are so large or numerous that explicit memory
+ *     management is required.
+ *
+ *     These should be allocated from malloc() et al., and freed
+ *     explicitly at the appropriate point.  The situation should be
+ *     documented in comments.
+ *
+ * (d) Objects which are allocated by internal-only functions and
+ *     returned to the function's (therefore, internal) caller but are
+ *     strictly for internal use by other parts of libxl.  These
+ *     should be allocated from the temporary pool.
+ *
+ *     Where a function's primary purpose is to return such an object,
+ *     it should have a libxl__gc * as it's first argument.
+ *
+ *     Note that there are two ways to change an allocation from this
+ *     category to the "public" category. Either the implementation
+ *     is kept internal and a wrapper function duplicates all memory
+ *     allocations so that they are suitable for return to external
+ *     callers or the implementation uses plain malloc() et al calls
+ *     and an internal wrapper adds the relevant pointers to the gc.
+ *     The latter method is preferred for obvious performance reasons.
+ *
+ * No temporary objects allocated from the pool may be explicitly freed.
+ * Therefore public functions which initialize a libxl__gc MUST call
+ * libxl__free_all() before returning.
+ *
+ * Memory allocation failures are not handled gracefully.  If malloc
+ * (or realloc) fails, libxl will cause the entire process to print
+ * a message to stderr and exit with status 255.
+ */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * IDL-generated libxl types should be used as follows: the user must
+ * always call the "init" function before using a type, even if the
+ * variable is simply being passed by reference as an out parameter
+ * to a libxl function.  The user must always calls "dispose" exactly
+ * once afterwards, to clean up, regardless of whether operations on
+ * this object succeeded or failed.  See the xl code for examples.
+ *
+ * "init" and "dispose" are idempotent.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ *
+ * char *libxl_<type>_to_json(instance *p)
+ *
+ *    Generates a JSON object from "p" in the form of a NULL terminated
+ *    string.
+ *
+ * <type *> libxl_<type>_from_json(const char *json)
+ * int      libxl_<type>_from_json(const char *json)
+ *
+ *    Parses "json" and returns:
+ *
+ *    an int value, if <type> is enumeration type. The value is the enum value
+ *    representing the respective string in "json".
+ *
+ *    an instance of <type>, if <type> is aggregate type. The returned
+ *    instance has its fields filled in by the parser according to "json".
+ *
+ *    If the parsing fails, caller cannot rely on the value / instance
+ *    returned.
+ */
+#ifndef LIBXL_H
+#define LIBXL_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <sys/wait.h> /* for pid_t */
+
+#include <xentoollog.h>
+
+typedef struct libxl__ctx libxl_ctx;
+
+#include <libxl_uuid.h>
+#include <_libxl_list.h>
+
+/* API compatibility. */
+#ifdef LIBXL_API_VERSION
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
+    LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500 && \
+    LIBXL_API_VERSION != 0x040700 && LIBXL_API_VERSION != 0x040800 && \
+    LIBXL_API_VERSION != 0x041300 && LIBXL_API_VERSION != 0x041400
+#error Unknown LIBXL_API_VERSION
+#endif
+#endif
+
+/* LIBXL_HAVE_RETRIEVE_DOMAIN_CONFIGURATION
+ *
+ * If this is defined we have libxl_retrieve_domain_configuration which
+ * returns the current configuration of a domain, which can be used to
+ * rebuild a domain.
+ */
+#define LIBXL_HAVE_RETRIEVE_DOMAIN_CONFIGURATION 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain two arrays of libxl_bitmap-s, with all the necessary information
+ * to set the hard affinity (vcpu_hard_affinity) and the soft affinity
+ * (vcpu_soft_affinity) of the VCPUs.
+ *
+ * Note that, if the vcpu_hard_affinity array is used, libxl will ignore
+ * the content of the cpumap field of libxl_domain_build_info. That is to
+ * say, if the array is allocated and used by the caller, it is it and
+ * only it that determines the hard affinity of the domain's VCPUs.
+ *
+ * The number of libxl_bitmap-s in the arrays should be equal to the
+ * maximum number of VCPUs of the domain. If there only are N elements in
+ * an array, with N smaller the the maximum number of VCPUs, the hard or
+ * soft affinity (depending on which array we are talking about) will be
+ * set only for the first N VCPUs. The other VCPUs will just have affinity,
+ * both hard and soft, with all the host PCPUs.
+ * Each bitmap should be big enough to accommodate the maximum number of
+ * PCPUs of the host.
+ */
+#define LIBXL_HAVE_BUILDINFO_VCPU_AFFINITY_ARRAYS 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_VKB_DEVICE
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain a boolean hvm.vkb_device which instructs libxl whether to include
+ * a vkbd at build time or not.
+ */
+#define LIBXL_HAVE_BUILDINFO_VKB_DEVICE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_USBVERSION
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbversion, a integer type that contains a USB
+ * controller version to specify on the qemu upstream command-line.
+ *
+ * If it is set, callers may use hvm.usbversion to specify if the usb
+ * controller is usb1, usb2 or usb3.
+ *
+ * If this is not defined, the hvm.usbversion field does not exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBVERSION 1
+
+/*
+ * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ *
+ * If this is defined, libxl_device_* structures containing a backend_domid
+ * field also contain a backend_domname field.  If backend_domname is set, it is
+ * resolved to a domain ID when the device is used and takes precedence over the
+ * backend_domid field.
+ *
+ * If this is not defined, the backend_domname field does not exist.
+ */
+#define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
+
+/*
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ *
+ * This argument was erroneously "const" in the 4.2 release despite
+ * the requirement for the callback to free the event.
+ */
+#if LIBXL_API_VERSION != 0x040200
+#define LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG 1
+#endif
+
+/*
+ * LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE
+ *
+ * The return value of libxl_basename is malloc'ed but the erroneously
+ * marked as "const" in releases before 4.5.
+ */
+#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500
+#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1
+#endif
+
+/*
+ * LIBXL_HAVE_PHYSINFO_OUTSTANDING_PAGES
+ *
+ * If this is defined, libxl_physinfo structure will contain an uint64 field
+ * called outstanding_pages, containing the number of pages claimed but not
+ * yet allocated for all domains.
+ */
+#define LIBXL_HAVE_PHYSINFO_OUTSTANDING_PAGES 1
+
+/*
+ * LIBXL_HAVE_PHYSINFO_MAX_POSSIBLE_MFN
+ *
+ * If this is defined, libxl_physinfo structure will contain an uint64 field
+ * called max_possible_mfn, containing the highest possible mfn on this host,
+ * possibly taking memory hotplug into account.
+ */
+#define LIBXL_HAVE_PHYSINFO_MAX_POSSIBLE_MFN 1
+
+/*
+ * LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
+ *
+ * If this is defined, libxl_dominfo will contain a MemKB type field called
+ * outstanding_memkb, containing the amount of claimed but not yet allocated
+ * memory for a specific domain.
+ */
+#define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
+
+/*
+ * LIBXL_HAVE_DOMINFO_NEVER_STOP
+ *
+ * If this is defined, libxl_dominfo will contain a flag called never_stop
+ * indicating that the specific domain should never be stopped by the
+ * toolstack.
+ */
+#define LIBXL_HAVE_DOMINFO_NEVER_STOP 1
+
+/*
+ * LIBXL_HAVE_QXL
+ *
+ * If defined, then the libxl_vga_interface_type will contain another value:
+ * "QXL". This value define if qxl vga is supported.
+ *
+ * If this is not defined, the qxl vga support is missed.
+ */
+#define LIBXL_HAVE_QXL 1
+
+/*
+ * LIBXL_HAVE_SPICE_VDAGENT
+ *
+ * If defined, then the libxl_spice_info structure will contain a boolean type:
+ * vdagent and clipboard_sharing. These values define if Spice vdagent and
+ * clipboard sharing are enabled.
+ *
+ * If this is not defined, the Spice vdagent support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_VDAGENT 1
+
+/*
+ * LIBXL_HAVE_SPICE_USBREDIRECTION
+ *
+ * If defined, then the libxl_spice_info structure will contain an integer type
+ * field: usbredirection. This value defines if Spice usbredirection is enabled
+ * and with how much channels.
+ *
+ * If this is not defined, the Spice usbredirection support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
+
+/*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
+/*
+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: streaming_video. This value defines what Spice streaming video setting
+ * is used.
+ *
+ * If this is not defined, the Spice streaming video setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+
+/*
+ * LIBXL_HAVE_HVM_HDTYPE
+ *
+ * If defined, then the u.hvm structure will contain a enum type
+ * hdtype.
+ */
+#define LIBXL_HAVE_HVM_HDTYPE 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API has changed to
+ * include a params structure.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD 1
+ *
+ * If this is defined, libxl_domain_create_restore()'s API includes the
+ * send_back_fd param. This is used only with COLO, for the libxl migration
+ * back channel; other callers should pass -1.
+ */
+#define LIBXL_HAVE_DOMAIN_CREATE_RESTORE_SEND_BACK_FD 1
+
+/*
+ * LIBXL_HAVE_DRIVER_DOMAIN_CREATION 1
+ *
+ * If this is defined, libxl_domain_create_info contains a driver_domain
+ * field that can be used to tell libxl that the domain that is going
+ * to be created is a driver domain, so the necessary actions are taken.
+ */
+#define LIBXL_HAVE_DRIVER_DOMAIN_CREATION 1
+
+/*
+ * LIBXL_HAVE_SIGCHLD_SELECTIVE_REAP
+ *
+ * If this is defined:
+ *
+ * Firstly, the enum libxl_sigchld_owner (in libxl_event.h) has the
+ * value libxl_sigchld_owner_libxl_always_selective_reap which may be
+ * passed to libxl_childproc_setmode in hooks->chldmode.
+ *
+ * Secondly, the function libxl_childproc_sigchld_occurred exists.
+ */
+#define LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP 1
+
+/*
+ * LIBXL_HAVE_SIGCHLD_SHARING
+ *
+ * If this is defined, it is permissible for multiple libxl ctxs
+ * to simultaneously "own" SIGCHLD.  See "Subprocess handling"
+ * in libxl_event.h.
+ */
+#define LIBXL_HAVE_SIGCHLD_SHARING 1
+
+/*
+ * LIBXL_HAVE_NO_SUSPEND_RESUME
+ *
+ * Is this is defined then the platform has no support for saving,
+ * restoring or migrating a domain. In this case the related functions
+ * should be expected to return failure. That is:
+ *  - libxl_domain_suspend
+ *  - libxl_domain_resume
+ *  - libxl_domain_remus_start
+ */
+#if defined(__arm__) || defined(__aarch64__)
+#define LIBXL_HAVE_NO_SUSPEND_RESUME 1
+#endif
+
+/*
+ * LIBXL_HAVE_DOMAIN_SUSPEND_ONLY
+ *
+ * If this is defined, function libxl_domains_suspend_only() is available.
+ */
+
+#define LIBXL_HAVE_DOMAIN_SUSPEND_ONLY 1
+
+/*
+ * LIBXL_HAVE_DEVICE_PCI_SEIZE
+ *
+ * If this is defined, then the libxl_device_pci struct will contain
+ * the "seize" boolean field.  If this field is set, libxl_pci_add will
+ * check to see if the device is currently assigned to pciback, and if not,
+ * it will attempt to do so (unbinding the device from the existing driver).
+ */
+#define LIBXL_HAVE_DEVICE_PCI_SEIZE 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_KERNEL
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain 'kernel', 'ramdisk', 'cmdline' fields. 'kernel' is a string
+ * to indicate kernel image location, 'ramdisk' is a string to indicate
+ * ramdisk location, 'cmdline' is a string to indicate the paramters which
+ * would be appended to kernel image.
+ *
+ * Both PV guest and HVM guest can use these fields for direct kernel boot.
+ * But for compatibility reason, u.pv.kernel, u.pv.ramdisk and u.pv.cmdline
+ * still exist.
+ */
+#define LIBXL_HAVE_BUILDINFO_KERNEL 1
+
+/*
+ * LIBXL_HAVE_DEVICE_CHANNEL
+ *
+ * If this is defined, then the libxl_device_channel struct exists
+ * and channels can be attached to a domain. Channels manifest as consoles
+ * with names, see docs/misc/console.txt.
+ */
+#define LIBXL_HAVE_DEVICE_CHANNEL 1
+
+/*
+ * LIBXL_HAVE_AO_ABORT indicates the availability of libxl_ao_abort
+ */
+#define LIBXL_HAVE_AO_ABORT 1
+
+/* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
+ * called from within libxl itself. Callers outside libxl, who
+ * do not #include libxl_internal.h, are fine. */
+#ifndef LIBXL_EXTERNAL_CALLERS_ONLY
+#define LIBXL_EXTERNAL_CALLERS_ONLY /* disappears for callers outside libxl */
+#endif
+
+/*
+ *  LIBXL_HAVE_UUID_COPY_CTX_PARAM
+ *
+ * If this is defined, libxl_uuid_copy has changed to take a libxl_ctx
+ * structure.
+ */
+#define LIBXL_HAVE_UUID_COPY_CTX_PARAM 1
+
+/*
+ * LIBXL_HAVE_SSID_LABEL
+ *
+ * If this is defined, then libxl IDL contains string of XSM security
+ * label in all XSM related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_SSID_LABEL 1
+
+/*
+ * LIBXL_HAVE_CPUPOOL_NAME
+ *
+ * If this is defined, then libxl IDL contains string of CPU pool
+ * name in all CPU pool related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_CPUPOOL_NAME 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_SERIAL_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.serial_list, a libxl_string_list type that contains
+ * a list of serial ports to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.serial or
+ * hvm.serial_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.serial.  Note
+ * that this means only one serial port can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_SERIAL_LIST 1
+
+/*
+ * LIBXL_HAVE_ALTP2M
+ * If this is defined, then libxl supports alternate p2m functionality.
+ */
+#define LIBXL_HAVE_ALTP2M 1
+
+/*
+ * LIBXL_HAVE_REMUS
+ * If this is defined, then libxl supports remus.
+ */
+#define LIBXL_HAVE_REMUS 1
+
+/*
+ * LIBXL_HAVE_COLO_USERSPACE_PROXY
+ * If this is defined, then libxl supports COLO userspace proxy.
+ */
+#define LIBXL_HAVE_COLO_USERSPACE_PROXY 1
+
+typedef uint8_t libxl_mac[6];
+#define LIBXL_MAC_FMT "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"
+#define LIBXL_MAC_FMTLEN ((2*6)+5) /* 6 hex bytes plus 5 colons */
+#define LIBXL_MAC_BYTES(mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]
+void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, const libxl_mac *src);
+
+#if defined(__i386__) || defined(__x86_64__)
+/*
+ * LIBXL_HAVE_PSR_CMT
+ *
+ * If this is defined, the Cache Monitoring Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_CMT 1
+
+/*
+ * LIBXL_HAVE_PSR_MBM
+ *
+ * If this is defined, the Memory Bandwidth Monitoring feature is supported.
+ */
+#define LIBXL_HAVE_PSR_MBM 1
+
+/*
+ * LIBXL_HAVE_PSR_CAT
+ *
+ * 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
+
+/*
+ * LIBXL_HAVE_PSR_L2_CAT
+ *
+ * If this is defined, the L2 Cache Allocation Technology feature is supported.
+ */
+#define LIBXL_HAVE_PSR_L2_CAT 1
+
+/*
+ * LIBXL_HAVE_PSR_GENERIC
+ *
+ * If this is defined, the Memory Bandwidth Allocation feature is supported.
+ * The following public functions are available:
+ *   libxl_psr_{set/get}_val
+ *   libxl_psr_get_hw_info
+ *   libxl_psr_hw_info_list_free
+ */
+#define LIBXL_HAVE_PSR_GENERIC 1
+
+/*
+ * LIBXL_HAVE_MCA_CAPS
+ *
+ * If this is defined, setting MCA capabilities for HVM domain is supported.
+ */
+#define LIBXL_HAVE_MCA_CAPS 1
+#endif
+
+/*
+ * LIBXL_HAVE_PCITOPOLOGY
+ *
+ * If this is defined, then interface to query hypervisor about PCI device
+ * topology is available.
+ */
+#define LIBXL_HAVE_PCITOPOLOGY 1
+
+/*
+ * LIBXL_HAVE_SOCKET_BITMAP
+ *
+ * If this is defined, then libxl_socket_bitmap_alloc and
+ * libxl_get_online_socketmap exist.
+ */
+#define LIBXL_HAVE_SOCKET_BITMAP 1
+
+/*
+ * LIBXL_HAVE_SRM_V2
+ *
+ * If this is defined, then the libxl_domain_create_restore() interface takes
+ * a "stream_version" parameter and supports a value of 2.
+ *
+ * libxl_domain_suspend() will produce a v2 stream.
+ */
+#define LIBXL_HAVE_SRM_V2 1
+
+/*
+ * LIBXL_HAVE_SRM_V1
+ *
+ * In the case that LIBXL_HAVE_SRM_V2 is set, LIBXL_HAVE_SRM_V1
+ * indicates that libxl_domain_create_restore() can handle a "stream_version"
+ * parameter of 1, and convert the stream format automatically.
+ */
+#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
+
+/*
+ * LIBXL_HAVE_CHECKPOINTED_STREAM
+ *
+ * If this is defined, then libxl_checkpointed_stream exists.
+ */
+#define LIBXL_HAVE_CHECKPOINTED_STREAM 1
+
+/*
+ * LIBXL_HAVE_BUILDINFO_HVM_SYSTEM_FIRMWARE
+ *
+ * libxl_domain_build_info has u.hvm.system_firmware field which can be use
+ * to provide a different firmware blob (like SeaBIOS or OVMF).
+ */
+#define LIBXL_HAVE_BUILDINFO_HVM_SYSTEM_FIRMWARE
+
+/*
+ * ERROR_REMUS_XXX error code only exists from Xen 4.5, Xen 4.6 and it
+ * is changed to ERROR_CHECKPOINT_XXX in Xen 4.7
+ */
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION >= 0x040500 \
+                               && LIBXL_API_VERSION < 0x040700
+#define ERROR_REMUS_DEVOPS_DOES_NOT_MATCH \
+        ERROR_CHECKPOINT_DEVOPS_DOES_NOT_MATCH
+#define ERROR_REMUS_DEVICE_NOT_SUPPORTED \
+        ERROR_CHECKPOINT_DEVICE_NOT_SUPPORTED
+#endif
+
+/*
+ * LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN
+ *
+ * In the case that LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN is set the
+ * libxl_vga_interface_type enumeration type contains a
+ * LIBXL_VGA_INTERFACE_TYPE_UNKNOWN identifier. This is used to signal
+ * that a libxl_vga_interface_type type has not been initialized yet.
+ */
+#define LIBXL_HAVE_VGA_INTERFACE_TYPE_UNKNOWN 1
+
+/*
+ * LIBXL_HAVE_BYTEARRAY_UUID
+ *
+ * If this is defined, the internal member of libxl_uuid is defined
+ * as a 16 byte array that contains the UUID in big endian format.
+ * Also, the same structure layout is used across all OSes.
+ */
+#define LIBXL_HAVE_BYTEARRAY_UUID 1
+
+/*
+ * LIBXL_HAVE_MEMKB_64BITS
+ *
+ * If this is defined libxl_set_memory_target(), libxl_domain_setmaxmem()
+ * and libxl_wait_for_free_memory()  will take a 64 bit value for the memory
+ * size parameter.
+ * From Xen 4.8 on libxl_get_memory_target(), libxl_domain_need_memory() and
+ * libxl_get_free_memory() return the memory size in a 64 bit value, too.
+ */
+#define LIBXL_HAVE_MEMKB_64BITS 1
+
+/*
+ * LIBXL_HAVE_QED
+ *
+ * If this is defined QED disk formats can be used for both HVM and PV guests.
+ */
+#define LIBXL_HAVE_QED 1
+
+/*
+ * LIBXL_HAVE_SET_PARAMETERS
+ *
+ * If this is defined setting hypervisor parameters is supported.
+ */
+#define LIBXL_HAVE_SET_PARAMETERS 1
+
+/*
+ * LIBXL_HAVE_PV_SHIM
+ *
+ * If this is defined, libxl_domain_build_info's pvh type information
+ * contains members pvshim, pvshim_path, pvshim_cmdline, pvshim_extra.
+ */
+#define LIBXL_HAVE_PV_SHIM 1
+
+/*
+ * LIBXL_HAVE_PVCALLS
+ *
+ * If this is defined, libxl supports creating pvcalls interfaces.
+ */
+#define LIBXL_HAVE_PVCALLS 1
+
+/*
+ * LIBXL_HAVE_FN_USING_QMP_ASYNC
+ *
+ * This define indicates that some function's API has changed and have an
+ * extra parameter "ao_how" which means that the function can be executed
+ * asynchronously. Those functions are:
+ *   libxl_domain_pause()
+ *   libxl_domain_unpause()
+ *   libxl_send_trigger()
+ *   libxl_set_vcpuonline()
+ *   libxl_retrieve_domain_configuration()
+ *   libxl_qemu_monitor_command()
+ *   libxl_domain_shutdown()
+ *   libxl_domain_reboot()
+ */
+#define LIBXL_HAVE_FN_USING_QMP_ASYNC 1
+
+/*
+ * LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONFIG
+ *
+ * If this is set, libxl_domain_need_memory takes a
+ * libxl_domain_config* (non-const) and uint32_t domid_for_logging
+ * (instead of a const libxl_domain_build_info*).
+ *
+ * If this is set, there is no need to call
+ * libxl_get_required_shadow_memory and instead the caller should
+ * simply leave shadow_memkb set to LIBXL_MEMKB_DEFAULT and allow
+ * libxl to fill in a suitable default in the usual way.
+ */
+#define LIBXL_HAVE_DOMAIN_NEED_MEMORY_CONFIG
+
+/*
+ * LIBXL_HAVE_CREATEINFO_DOMID
+ *
+ * libxl_domain_create_new() and libxl_domain_create_restore() will use
+ * a domid specified in libxl_domain_create_info.
+ */
+#define LIBXL_HAVE_CREATEINFO_DOMID
+
+/*
+ * LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+ *
+ * libxl_domain_create_info contains a boolean 'xend_suspend_evtchn_compat'
+ * value to control creation of the xenstore path for a domain's suspend
+ * event channel.
+ */
+#define LIBXL_HAVE_CREATEINFO_XEND_SUSPEND_EVTCHN_COMPAT
+
+typedef char **libxl_string_list;
+void libxl_string_list_dispose(libxl_string_list *sl);
+int libxl_string_list_length(const libxl_string_list *sl);
+void libxl_string_list_copy(libxl_ctx *ctx, libxl_string_list *dst,
+                            const libxl_string_list *src);
+
+typedef char **libxl_key_value_list;
+void libxl_key_value_list_dispose(libxl_key_value_list *kvl);
+int libxl_key_value_list_length(const libxl_key_value_list *kvl);
+void libxl_key_value_list_copy(libxl_ctx *ctx,
+                               libxl_key_value_list *dst,
+                               const libxl_key_value_list *src);
+
+typedef uint32_t libxl_hwcap[8];
+void libxl_hwcap_copy(libxl_ctx *ctx, libxl_hwcap *dst, const libxl_hwcap *src);
+
+typedef uint64_t libxl_ev_user;
+
+typedef struct {
+    uint32_t size;          /* number of bytes in map */
+    uint8_t *map;
+} libxl_bitmap;
+void libxl_bitmap_init(libxl_bitmap *map);
+void libxl_bitmap_dispose(libxl_bitmap *map);
+
+/*
+ * libxl_cpuid_policy is opaque in the libxl ABI.  Users of both libxl and
+ * libxc may not make assumptions about xc_xend_cpuid.
+ */
+typedef struct xc_xend_cpuid libxl_cpuid_policy;
+typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
+void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
+int libxl_cpuid_policy_list_length(const libxl_cpuid_policy_list *l);
+void libxl_cpuid_policy_list_copy(libxl_ctx *ctx,
+                                  libxl_cpuid_policy_list *dst,
+                                  const libxl_cpuid_policy_list *src);
+
+#define LIBXL_PCI_FUNC_ALL (~0U)
+
+typedef uint32_t libxl_domid;
+typedef int libxl_devid;
+
+/*
+ * Formatting Enumerations.
+ *
+ * Each enumeration type libxl_E declares an associated lookup table
+ * libxl_E_string_table and a lookup function libxl_E_from_string.
+ */
+typedef struct {
+    const char *s;
+    int v;
+} libxl_enum_string_table;
+
+struct libxl_event;
+typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
+
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
+#define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
+
+/*
+ * We'd like to set a memory boundary to determine if we need to check
+ * any overlap with reserved device memory.
+ */
+#define LIBXL_RDM_MEM_BOUNDARY_MEMKB_DEFAULT (2048 * 1024)
+
+#define LIBXL_MS_VM_GENID_LEN 16
+typedef struct {
+    uint8_t bytes[LIBXL_MS_VM_GENID_LEN];
+} libxl_ms_vm_genid;
+
+#include "_libxl_types.h"
+
+const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
+
+/*
+ * Some libxl operations can take a long time.  These functions take a
+ * parameter to control their concurrency:
+ *     libxl_asyncop_how *ao_how
+ *
+ * If ao_how==NULL, the function will be synchronous.
+ *
+ * If ao_how!=NULL, the function will set the operation going, and if
+ * this is successful will return 0.  In this case the zero error
+ * response does NOT mean that the operation was successful; it just
+ * means that it has been successfully started.  It will finish later,
+ * perhaps with an error.
+ *
+ * If ao_how->callback!=NULL, the callback will be called when the
+ * operation completes.  The same rules as for libxl_event_hooks
+ * apply, including the reentrancy rules and the possibility of
+ * "disaster", except that libxl calls ao_how->callback instead of
+ * libxl_event_hooks.event_occurs.  (See libxl_event.h.)
+ *
+ * If ao_how->callback==NULL, a libxl_event will be generated which
+ * can be obtained from libxl_event_wait or libxl_event_check.  The
+ * event will have type OPERATION_COMPLETE (which is not used
+ * elsewhere).
+ *
+ * Note that it is possible for an asynchronous operation which is to
+ * result in a callback to complete during its initiating function
+ * call.  In this case the initiating function will return 0
+ * indicating the at the operation is "in progress", even though by
+ * the time it returns the operation is complete and the callback has
+ * already happened.
+ *
+ * The application must set and use ao_how->for_event (which will be
+ * copied into libxl_event.for_user) or ao_how->for_callback (passed
+ * to the callback) to determine which operation finished, and it must
+ * of course check the rc value for errors.
+ *
+ * *ao_how does not need to remain valid after the initiating function
+ * returns. All other parameters must remain valid for the lifetime of
+ * the asynchronous operation, unless otherwise specified.
+ *
+ * Callbacks may occur on any thread in which the application calls
+ * libxl.
+ */
+
+typedef struct {
+    void (*callback)(libxl_ctx *ctx, int rc, void *for_callback);
+    union {
+        libxl_ev_user for_event; /* used if callback==NULL */
+        void *for_callback; /* passed to callback */
+    } u;
+} libxl_asyncop_how;
+
+/*
+ * Some more complex asynchronous operations can report intermediate
+ * progress.  How this is to be reported is controlled, for each
+ * function, by a parameter
+ *    libxl_asyncprogress_how *aop_FOO_how;
+ * for each kind of progress FOO supported by that function.  Each
+ * such kind of progress is associated with an event type.
+ *
+ * The function description will document whether, when, and how
+ * many times, the intermediate progress will be reported, and
+ * what the corresponding event type(s) are.
+ *
+ * If aop_FOO_how==NULL, intermediate progress reports are discarded.
+ *
+ * If aop_FOO_how->callback==NULL, intermediate progress reports
+ * generate libxl events which can be obtained from libxl_event_wait
+ * or libxl_event_check.
+ *
+ * If aop_FOO_how->callback!=NULL, libxl will report intermediate
+ * progress by calling callback(ctx, &event, for_callback).
+ *
+ * The rules for these events are otherwise the same as those for
+ * ordinary events.  The reentrancy and threading rules for the
+ * callback are the same as those for ao completion callbacks.
+ *
+ * Note that the callback, if provided, is responsible for freeing
+ * the event.
+ *
+ * If callbacks are requested, they will be made, and returned, before
+ * the long-running libxl operation is considered finished (so if the
+ * long-running libxl operation was invoked with ao_how==NULL then any
+ * callbacks will occur strictly before the long-running operation
+ * returns).  However, the callbacks may occur on any thread.
+ *
+ * In general, otherwise, no promises are made about the relative
+ * order of callbacks in a multithreaded program.  In particular
+ * different callbacks relating to the same long-running operation may
+ * be delivered out of order.
+ */
+
+typedef struct {
+    void (*callback)(libxl_ctx *ctx, libxl_event*, void *for_callback);
+    libxl_ev_user for_event; /* always used */
+    void *for_callback; /* passed to callback */
+} libxl_asyncprogress_how;
+
+/*
+ * It is sometimes possible to abort an asynchronous operation.
+ *
+ * libxl_ao_abort searches for an ongoing asynchronous operation whose
+ * ao_how is identical to *how, and tries to abort it.  The return
+ * values from libxl_ao_abort are as follows:
+ *
+ *  0
+ *
+ *     The operation was found, and attempts are being made to cut it
+ *     short.  However, it may still take some time to stop.  It is
+ *     also possible that the operation will nevertheless complete
+ *     successfully.
+ *
+ *  ERROR_NOTFOUND
+ *
+ *      No matching ongoing operation was found.  This might happen
+ *      for an actual operation if the operation has already completed
+ *      (perhaps on another thread).  The call to libxl_ao_abort has
+ *      had no effect.
+ *
+ *  ERROR_ABORTED
+ *
+ *     The operation has already been the subject of at least one
+ *     call to libxl_ao_abort.
+ *
+ * If the operation was indeed cut short due to the abort request, it
+ * will complete, at some point in the future, with ERROR_ABORTED.  In
+ * that case, depending on the operation it have performed some of the
+ * work in question and left the operation half-done.  Consult the
+ * documentation for individual operations.
+ *
+ * Note that an aborted operation might still fail for other reasons
+ * even after the abort was requested.
+ *
+ * If your application is multithreaded you must not reuse an
+ * ao_how->for_event or ao_how->for_callback value (with a particular
+ * ao_how->callback) unless you are sure that none of your other
+ * threads are going to abort the previous operation using that
+ * value; otherwise you risk aborting the wrong operation if the
+ * intended target of the abort request completes in the meantime.
+ *
+ * It is possible to abort even an operation which is being performed
+ * synchronously, but since in that case how==NULL you had better only
+ * have one such operation, because it is not possible to tell them
+ * apart (and libxl_ao_abort will abort only the first one it finds).
+ * (And, if you want to do this, obviously the abort would have to be
+ * requested on a different thread.)
+ */
+int libxl_ao_abort(libxl_ctx *ctx, const libxl_asyncop_how *how)
+                   LIBXL_EXTERNAL_CALLERS_ONLY;
+
+
+#define LIBXL_VERSION 0
+
+/* context functions */
+int libxl_ctx_alloc(libxl_ctx **pctx, int version,
+                    unsigned flags /* none currently defined */,
+                    xentoollog_logger *lg);
+int libxl_ctx_free(libxl_ctx *ctx /* 0 is OK */);
+
+/* domain related functions */
+
+#define INVALID_DOMID ~0
+#define RANDOM_DOMID (INVALID_DOMID - 1)
+
+/* If the result is ERROR_ABORTED, the domain may or may not exist
+ * (in a half-created state).  *domid will be valid and will be the
+ * domain id, or INVALID_DOMID, as appropriate */
+
+int libxl_domain_create_new(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;
+int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config,
+                                uint32_t *domid, int restore_fd,
+                                int send_back_fd,
+                                const libxl_domain_restore_params *params,
+                                const libxl_asyncop_how *ao_how,
+                                const libxl_asyncprogress_how *aop_console_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040400
+
+static inline int libxl_domain_create_restore_0x040200(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    libxl_domain_restore_params params;
+    int ret;
+
+    libxl_domain_restore_params_init(&params);
+
+    ret = libxl_domain_create_restore(
+        ctx, d_config, domid, restore_fd, -1, &params, ao_how, aop_console_how);
+
+    libxl_domain_restore_params_dispose(&params);
+    return ret;
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040200
+
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION >= 0x040400 \
+                                 && LIBXL_API_VERSION < 0x040700
+
+static inline int libxl_domain_create_restore_0x040400(
+    libxl_ctx *ctx, libxl_domain_config *d_config,
+    uint32_t *domid, int restore_fd,
+    const libxl_domain_restore_params *params,
+    const libxl_asyncop_how *ao_how,
+    const libxl_asyncprogress_how *aop_console_how)
+    LIBXL_EXTERNAL_CALLERS_ONLY
+{
+    return libxl_domain_create_restore(ctx, d_config, domid, restore_fd,
+                                       -1, params, ao_how, aop_console_how);
+}
+
+#define libxl_domain_create_restore libxl_domain_create_restore_0x040400
+
+#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.
+   */
+
+void libxl_domain_config_init(libxl_domain_config *d_config);
+void libxl_domain_config_dispose(libxl_domain_config *d_config);
+
+/*
+ * Retrieve domain configuration and filled it in d_config. The
+ * returned configuration can be used to rebuild a domain. It only
+ * works with DomU.
+ */
+int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
+                                        libxl_domain_config *d_config,
+                                        const libxl_asyncop_how *ao_how)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_retrieve_domain_configuration_0x041200(
+    libxl_ctx *ctx, uint32_t domid, libxl_domain_config *d_config)
+{
+    return libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL);
+}
+#define libxl_retrieve_domain_configuration \
+    libxl_retrieve_domain_configuration_0x041200
+#endif
+
+int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd,
+                         int flags, /* LIBXL_SUSPEND_* */
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#define LIBXL_SUSPEND_DEBUG 1
+#define LIBXL_SUSPEND_LIVE 2
+
+/*
+ * Only suspend domain, do not save its state to file, do not destroy it.
+ * Suspended domain can be resumed with libxl_domain_resume()
+ */
+int libxl_domain_suspend_only(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* @param suspend_cancel [from xenctrl.h:xc_domain_resume( @param fast )]
+ *   If this parameter is true, use co-operative resume. The guest
+ *   must support this.
+ */
+int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid, int suspend_cancel,
+                        const libxl_asyncop_how *ao_how)
+                        LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * This function doesn't return unless something has gone wrong with
+ * the replication to the secondary. If this function returns then the
+ * caller should resume the (primary) domain.
+ */
+int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
+                             uint32_t domid, int send_fd, int recv_fd,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_reboot(libxl_ctx *ctx, uint32_t domid,
+                        const libxl_asyncop_how *ao_how)
+                        LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_domain_shutdown_0x041200(libxl_ctx *ctx,
+                                                 uint32_t domid)
+{
+    return libxl_domain_shutdown(ctx, domid, NULL);
+}
+#define libxl_domain_shutdown libxl_domain_shutdown_0x041200
+static inline int libxl_domain_reboot_0x041200(libxl_ctx *ctx,
+                                               uint32_t domid)
+{
+    return libxl_domain_reboot(ctx, domid, NULL);
+}
+#define libxl_domain_reboot libxl_domain_reboot_0x041200
+#endif
+
+int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_info *info, const char *name_suffix, libxl_uuid new_uuid);
+
+/* get max. number of cpus supported by hypervisor */
+int libxl_get_max_cpus(libxl_ctx *ctx);
+
+/* get the actual number of currently online cpus on the host */
+int libxl_get_online_cpus(libxl_ctx *ctx);
+  /* Beware that no locking or serialization is provided by libxl,
+   * so the information can be outdated as far as the function
+   * returns. If there are other entities in the system capable
+   * of onlining/offlining CPUs, it is up to the application
+   * to guarantee consistency, if that is important. */
+
+/* get max. number of NUMA nodes supported by hypervisor */
+int libxl_get_max_nodes(libxl_ctx *ctx);
+
+int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
+                        const char *old_name, const char *new_name);
+
+  /* if old_name is NULL, any old name is OK; otherwise we check
+   * transactionally that the domain has the old old name; if
+   * trans is not 0 we use caller's transaction and caller must do retries */
+
+int libxl_domain_pause(libxl_ctx *ctx, uint32_t domid,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_domain_pause_0x041200(
+    libxl_ctx *ctx, uint32_t domid)
+{
+    return libxl_domain_pause(ctx, domid, NULL);
+}
+static inline int libxl_domain_unpause_0x041200(
+    libxl_ctx *ctx, uint32_t domid)
+{
+    return libxl_domain_unpause(ctx, domid, NULL);
+}
+#define libxl_domain_pause libxl_domain_pause_0x041200
+#define libxl_domain_unpause libxl_domain_unpause_0x041200
+#endif
+
+
+int libxl_domain_core_dump(libxl_ctx *ctx, uint32_t domid,
+                           const char *filename,
+                           const libxl_asyncop_how *ao_how)
+                           LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t target_memkb);
+int libxl_set_memory_target(libxl_ctx *ctx, uint32_t domid, int64_t target_memkb, int relative, int enforce);
+int libxl_get_memory_target(libxl_ctx *ctx, uint32_t domid, uint64_t *out_target);
+int libxl_get_memory_target_0x040700(libxl_ctx *ctx, uint32_t domid,
+                                     uint32_t *out_target)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * WARNING
+ * This memory management API is unstable even in Xen 4.2.
+ * It has a numer of deficiencies and we intend to replace it.
+ *
+ * The semantics of these functions should not be relied on to be very
+ * coherent or stable.  We will however endeavour to keep working
+ * existing programs which use them in roughly the same way as libxl.
+ */
+/* how much free memory in the system a domain needs to be built */
+int libxl_domain_need_memory(libxl_ctx *ctx,
+                             libxl_domain_config *config
+                             /* ^ will be partially defaulted */,
+                             uint32_t domid_for_logging /* INVALID_DOMID ok */,
+                             uint64_t *need_memkb);
+int libxl_domain_need_memory_0x041200(libxl_ctx *ctx,
+                                      const libxl_domain_build_info *b_info_in,
+                                      uint64_t *need_memkb);
+int libxl_domain_need_memory_0x040700(libxl_ctx *ctx,
+                                      const libxl_domain_build_info *b_info_in,
+                                      uint32_t *need_memkb)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+/* how much free memory is available in the system */
+int libxl_get_free_memory(libxl_ctx *ctx, uint64_t *memkb);
+int libxl_get_free_memory_0x040700(libxl_ctx *ctx, uint32_t *memkb)
+    LIBXL_EXTERNAL_CALLERS_ONLY;
+/* wait for a given amount of memory to be free in the system */
+int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint64_t memory_kb, int wait_secs);
+/*
+ * Wait for the memory target of a domain to be reached. Does not
+ * decrement wait_secs if the domain is making progress toward reaching
+ * the target. If the domain is not making progress, wait_secs is
+ * decremented. If the timeout expires before the target is reached, the
+ * function returns ERROR_FAIL.
+ *
+ * Older versions of this function (Xen 4.5 and older), decremented
+ * wait_secs even if the domain was making progress, resulting in far
+ * lower overall wait times. To make sure that your calling routine
+ * works with new and old implementations of the function, pass enough
+ * time for the guest to reach its target as an argument.
+ */
+int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
+#define libxl_get_memory_target libxl_get_memory_target_0x040700
+#define libxl_domain_need_memory libxl_domain_need_memory_0x040700
+#define libxl_get_free_memory libxl_get_free_memory_0x040700
+#elif defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+#define libxl_domain_need_memory libxl_domain_need_memory_0x041200
+#endif
+
+int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
+
+/*
+ * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
+ * the caller that it has connected to the guest console.
+ */
+int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num,
+                       libxl_console_type type, int notify_fd);
+/* libxl_primary_console_exec finds the domid and console number
+ * corresponding to the primary console of the given vm, then calls
+ * libxl_console_exec with the right arguments (domid might be different
+ * if the guest is using stubdoms).
+ * This function can be called after creating the device model, in
+ * case of HVM guests, and before libxl_run_bootloader in case of PV
+ * guests using pygrub.
+ * If notify_fd is not -1, xenconsole will write 0x00 to it to nofity
+ * the caller that it has connected to the guest console.
+ */
+int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm,
+                               int notify_fd);
+
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040800
+
+static inline int libxl_console_exec_0x040700(libxl_ctx *ctx,
+                                              uint32_t domid, int cons_num,
+                                              libxl_console_type type)
+{
+    return libxl_console_exec(ctx, domid, cons_num, type, -1);
+}
+#define libxl_console_exec libxl_console_exec_0x040700
+
+static inline int libxl_primary_console_exec_0x040700(libxl_ctx *ctx,
+                                                      uint32_t domid_vm)
+{
+    return libxl_primary_console_exec(ctx, domid_vm, -1);
+}
+#define libxl_primary_console_exec libxl_primary_console_exec_0x040700
+
+#endif
+
+/* libxl_console_get_tty retrieves the specified domain's console tty path
+ * and stores it in path. Caller is responsible for freeing the memory.
+ */
+int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
+                          libxl_console_type type, char **path);
+
+/* libxl_primary_console_get_tty retrieves the specified domain's primary
+ * console tty path and stores it in path. Caller is responsible for freeing
+ * the memory.
+ */
+int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm, char **path);
+
+/* May be called with info_r == NULL to check for domain's existence.
+ * Returns ERROR_DOMAIN_NOTFOUND if domain does not exist (used to return
+ * ERROR_INVAL for this scenario). */
+int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
+                      uint32_t domid);
+
+/* These functions each return (on success) an array of elements,
+ * and the length via the int* out parameter.  These arrays and
+ * their contents come from malloc, and must be freed with the
+ * corresponding libxl_THING_list_free function.
+ */
+libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain_out);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nb_domain);
+
+libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool_out);
+void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nb_pool);
+
+libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nb_vm);
+
+#define LIBXL_CPUTOPOLOGY_INVALID_ENTRY (~(uint32_t)0)
+libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_out);
+void libxl_cputopology_list_free(libxl_cputopology *, int nb_cpu);
+
+#define LIBXL_PCITOPOLOGY_INVALID_ENTRY (~(uint32_t)0)
+libxl_pcitopology *libxl_get_pci_topology(libxl_ctx *ctx, int *num_devs);
+void libxl_pcitopology_list_free(libxl_pcitopology *, int num_devs);
+
+#define LIBXL_NUMAINFO_INVALID_ENTRY (~(uint32_t)0)
+libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr);
+void libxl_numainfo_list_free(libxl_numainfo *, int nr);
+
+libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
+                                int *nb_vcpu, int *nr_cpus_out);
+void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
+
+/*
+ * Devices
+ * =======
+ *
+ * Each device is represented by a libxl_device_<TYPE> data structure
+ * which is defined via the IDL. In addition some devices have an
+ * additional data type libxl_device_<TYPE>_getinfo which contains
+ * further runtime information about the device.
+ *
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
+ *
+ * Querying
+ * --------
+ *
+ * libxl_device_<type>_list(ctx, domid, nr):
+ *
+ *   Returns an array of libxl_device_<type> length nr representing
+ *   the devices attached to the specified domain.
+ *
+ * libxl_device_<type>_getinfo(ctx, domid, device, info):
+ *
+ *   Initialises info with details of the given device which must be
+ *   attached to the specified domain.
+ *
+ * Creation / Control
+ * ------------------
+ *
+ * libxl_device_<type>_add(ctx, domid, device):
+ *
+ *   Adds the given device to the specified domain. This can be called
+ *   while the guest is running (hotplug) or before boot (coldplug).
+ *
+ *   This function only sets up the device but does not wait for the
+ *   domain to connect to the device and therefore cannot block on the
+ *   guest.
+ *
+ *   device is an in/out parameter:  fields left unspecified when the
+ *   structure is passed in are filled in with appropriate values for
+ *   the device created.
+ *
+ * libxl_device_<type>_destroy(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain without guest
+ *   co-operation. It is guest specific what affect this will have on
+ *   a running guest.
+ *
+ *   This function does not interact with the guest and therefore
+ *   cannot block on the guest.
+ *
+ * libxl_device_<type>_remove(ctx, domid, device):
+ *
+ *   Removes the given device from the specified domain by performing
+ *   an orderly unplug with guest co-operation. This requires that the
+ *   guest is running.
+ *
+ *   This method is currently synchronous and therefore can block
+ *   while interacting with the guest. There is a time-out of 10s on
+ *   this interaction after which libxl_device_<type>_destroy()
+ *   semantics apply.
+ *
+ * libxl_device_<type>_safe_remove(ctx, domid, device):
+ *
+ *   This has the same semantics as libxl_device_<type>_remove() but,
+ *   in the event of hitting the 10s time-out, this function will fail.
+ *
+ * Controllers
+ * -----------
+ *
+ * Most devices are treated individually.  Some classes of device,
+ * however, like USB or SCSI, inherently have the need to have a
+ * hierarchy of different levels, with lower-level devices "attached"
+ * to higher-level ones.  USB for instance has "controllers" at the
+ * top, which have buses, on which are devices, which consist of
+ * multiple interfaces.  SCSI has "hosts" at the top, then buses,
+ * targets, and LUNs.
+ *
+ * In that case, for each <class>, there will be a set of functions
+ * and types for each <level>.  For example, for <class>=usb, there
+ * may be <levels> ctrl (controller) and dev (device), with ctrl being
+ * level 0.
+ *
+ * libxl_device_<class><level0>_<function> will act more or
+ * less like top-level non-bus devices: they will either create or
+ * accept a libxl_devid which will be unique within the
+ * <class><level0> libxl_devid namespace.
+ *
+ * Lower-level devices must have a unique way to be identified.  One
+ * way to do this would be to name it via the name of the next level
+ * up plus an index; for instance, <ctrl devid, port number>.  Another
+ * way would be to have another devid namespace for that level.  This
+ * identifier will be used for queries and removals.
+ *
+ * Lower-level devices will include in their
+ * libxl_device_<class><level> struct a field referring to the unique
+ * index of the level above.  For instance, libxl_device_usbdev might
+ * contain the controller devid.
+ *
+ * In the case where there are multiple different ways to implement a
+ * given device -- for instance, one which is fully PV and one which
+ * uses an emulator -- the controller will contain a field which
+ * specifies what type of implementation is used.  The implementations
+ * of individual devices will be known by the controller to which they
+ * are attached.
+ *
+ * If libxl_device_<class><level>_add receives an empty reference to
+ * the level above, it may return an error.  Or it may (but is not
+ * required to) automatically choose a suitable device in the level
+ * above to which to attach the new device at this level.  It may also
+ * (but is not required to) automatically create a new device at the
+ * level above if no suitable devices exist.  Each class should
+ * document its behavior.
+ *
+ * libxl_device_<class><level>_list will list all devices of <class>
+ * at <level> in the domain.  For example, libxl_device_usbctrl_list
+ * will list all usb controllers; libxl_class_usbdev_list will list
+ * all usb devices across all controllers.
+ *
+ * For each class, the domain config file will contain a single list
+ * for each level.  libxl will first iterate through the list of
+ * top-level devices, then iterate through each level down in turn,
+ * adding devices to devices in the level above.  For instance, there
+ * will be one list for all usb controllers, and one list for all usb
+ * devices.
+ *
+ * If libxl_device_<class><level>_add automatically creates
+ * higher-level devices as necessary, then it is permissible for the
+ * higher-level lists to be empty and the device list to have devices
+ * with the field containing a reference to the higher level device
+ * uninitialized.
+ */
+
+/* Disks */
+int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid,
+                          libxl_device_disk *disk,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_disk *disk,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_disk *disk,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_safe_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_disk *disk,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_disk_list_free(libxl_device_disk* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_disk *disk, libxl_diskinfo *diskinfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Insert a CD-ROM device. A device corresponding to disk must already
+ * be attached to the guest.
+ */
+int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * USB
+ *
+ * For each device removed or added, one of these protocols is available:
+ * - PV (i.e., PVUSB)
+ * - DEVICEMODEL (i.e, qemu)
+ *
+ * PV is available for either PV or HVM domains.  DEVICEMODEL is only
+ * available for HVM domains.  The caller can additionally specify
+ * "AUTO", in which case the library will try to determine the best
+ * protocol automatically.
+ *
+ * At the moment, the only protocol implemented is PV.
+ *
+ * One can add/remove USB controllers to/from guest, and attach/detach USB
+ * devices to/from USB controllers.
+ *
+ * To add USB controllers and USB devices, one can adding USB controllers
+ * first and then attaching USB devices to some USB controller, or adding
+ * USB devices to guest directly, it will automatically create a USB
+ * controller for USB devices to attach.
+ *
+ * To remove USB controllers or USB devices, one can remove USB devices
+ * under USB controller one by one and then remove USB controller, or
+ * remove USB controller directly, it will remove all USB devices under
+ * it automatically.
+ *
+ */
+/* USB Controllers*/
+int libxl_device_usbctrl_add(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_usbctrl *usbctrl,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbctrl_remove(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_usbctrl *usbctrl,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbctrl_destroy(libxl_ctx *ctx, uint32_t domid,
+                                 libxl_device_usbctrl *usbctrl,
+                                 const libxl_asyncop_how *ao_how)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_usbctrl *libxl_device_usbctrl_list(libxl_ctx *ctx,
+                                                uint32_t domid, int *num);
+
+void libxl_device_usbctrl_list_free(libxl_device_usbctrl *list, int nr);
+
+
+int libxl_device_usbctrl_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 const libxl_device_usbctrl *usbctrl,
+                                 libxl_usbctrlinfo *usbctrlinfo);
+
+/* USB Devices */
+
+int libxl_device_usbdev_add(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_usbdev *usbdev,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+int libxl_device_usbdev_remove(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_usbdev *usbdev,
+                               const libxl_asyncop_how *ao_how)
+                               LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_usbdev *
+libxl_device_usbdev_list(libxl_ctx *ctx, uint32_t domid, int *num);
+
+void libxl_device_usbdev_list_free(libxl_device_usbdev *list, int nr);
+
+/* Network Interfaces */
+int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_nic *nic,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_nic *nic,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_nic_list_free(libxl_device_nic* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
+                             const libxl_device_nic *nic, libxl_nicinfo *nicinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Virtual Channels
+ * Channels manifest as consoles with names, see docs/misc/channels.txt
+ */
+libxl_device_channel *libxl_device_channel_list(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                int *num);
+int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                 const libxl_device_channel *channel,
+                                 libxl_channelinfo *channelinfo);
+
+/* Virtual TPMs */
+int libxl_device_vtpm_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vtpm *vtpm,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vtpm *vtpm,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vtpm *vtpm,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vtpm_list_free(libxl_device_vtpm*, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vtpm_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_vtpm *vtpm, libxl_vtpminfo *vtpminfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Virtual displays */
+int libxl_device_vdispl_add(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vdispl *displ,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_remove(libxl_ctx *ctx, uint32_t domid,
+                               libxl_device_vdispl *vdispl,
+                               const libxl_asyncop_how *ao_how)
+                               LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_destroy(libxl_ctx *ctx, uint32_t domid,
+                                libxl_device_vdispl *vdispl,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vdispl *libxl_device_vdispl_list(libxl_ctx *ctx,
+                                              uint32_t domid, int *num)
+                                              LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vdispl_list_free(libxl_device_vdispl* list, int num)
+                                   LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid,
+                                const libxl_device_vdispl *vdispl,
+                                libxl_vdisplinfo *vdisplinfo)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Virtual sounds */
+int libxl_device_vsnd_add(libxl_ctx *ctx, uint32_t domid,
+                          libxl_device_vsnd *vsnd,
+                          const libxl_asyncop_how *ao_how)
+                          LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_remove(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vsnd *vsnd,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_destroy(libxl_ctx *ctx, uint32_t domid,
+                              libxl_device_vsnd *vsnd,
+                              const libxl_asyncop_how *ao_how)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vsnd *libxl_device_vsnd_list(libxl_ctx *ctx,
+                                          uint32_t domid, int *num)
+                                          LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vsnd_list_free(libxl_device_vsnd* list, int num)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vsnd_getinfo(libxl_ctx *ctx, uint32_t domid,
+                              const libxl_device_vsnd *vsnd,
+                              libxl_vsndinfo *vsndlinfo)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Keyboard */
+int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vkb *vkb,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vkb *vkb,
+                             const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_vkb *libxl_device_vkb_list(libxl_ctx *ctx,
+                                        uint32_t domid, int *num)
+                                        LIBXL_EXTERNAL_CALLERS_ONLY;
+void libxl_device_vkb_list_free(libxl_device_vkb* list, int num)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vkb_getinfo(libxl_ctx *ctx, uint32_t domid,
+                             const libxl_device_vkb *vkb,
+                             libxl_vkbinfo *vkbinfo)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* Framebuffer */
+int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_vfb *vfb,
+                            const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_vfb *vfb,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* 9pfs */
+int libxl_device_p9_remove(libxl_ctx *ctx, uint32_t domid,
+                           libxl_device_p9 *p9,
+                           const libxl_asyncop_how *ao_how)
+                           LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_p9_destroy(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_p9 *p9,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* pvcalls interface */
+int libxl_device_pvcallsif_remove(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_device_pvcallsif *pvcallsif,
+                                  const libxl_asyncop_how *ao_how)
+                                  LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pvcallsif_destroy(libxl_ctx *ctx, uint32_t domid,
+                                   libxl_device_pvcallsif *pvcallsif,
+                                   const libxl_asyncop_how *ao_how)
+                                   LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/* PCI Passthrough */
+int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid,
+                         libxl_device_pci *pcidev,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid,
+                            libxl_device_pci *pcidev,
+                            const libxl_asyncop_how *ao_how)
+                            LIBXL_EXTERNAL_CALLERS_ONLY;
+int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid,
+                             libxl_device_pci *pcidev,
+                             const libxl_asyncop_how *ao_how)
+                             LIBXL_EXTERNAL_CALLERS_ONLY;
+
+libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid,
+                                        int *num);
+
+/*
+ * Turns the current process into a backend device service daemon
+ * for a driver domain.
+ *
+ * From a libxl API point of view, this starts a long-running
+ * operation.  That operation consists of "being a driver domain"
+ * and never completes.
+ *
+ * Attempting to abort this operation is not advisable; proper
+ * shutdown of the driver domain task is not supported.
+ */
+int libxl_device_events_handler(libxl_ctx *ctx,
+                                const libxl_asyncop_how *ao_how)
+                                LIBXL_EXTERNAL_CALLERS_ONLY;
+
+/*
+ * Functions related to making devices assignable -- that is, bound to
+ * the pciback driver, ready to be given to a guest via
+ * libxl_pci_device_add.
+ *
+ * - ..._add() will unbind the device from its current driver (if
+ * already bound) and re-bind it to pciback; at that point it will be
+ * ready to be assigned to a VM.  If rebind is set, it will store the
+ * path to the old driver in xenstore so that it can be handed back to
+ * dom0 on restore.
+ *
+ * - ..._remove() will unbind the device from pciback, and if
+ * rebind is non-zero, attempt to assign it back to the driver
+ * from whence it came.
+ *
+ * - ..._list() will return a list of the PCI devices available to be
+ * assigned.
+ *
+ * add and remove are idempotent: if the device in question is already
+ * added or is not bound, the functions will emit a warning but return
+ * SUCCESS.
+ */
+int libxl_device_pci_assignable_add(libxl_ctx *ctx, libxl_device_pci *pcidev, int rebind);
+int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *pcidev, int rebind);
+libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num);
+
+/* CPUID handling */
+int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
+int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
+                                  const char* str);
+#if LIBXL_API_VERSION < 0x041400
+/*
+ * Dropped from the API in Xen 4.14.  At the time of writing, these functions
+ * don't appear to ever have had external callers.
+ *
+ * These have always been used internally during domain construction, and
+ * can't easily be used externally because of their implicit parameters in
+ * other pieces of global state.
+ *
+ * Furthermore, an API user can't usefully determine whether they get
+ * libxl_cpuid (the real implementation) or libxl_nocpuid (no-op stubs).
+ *
+ * The internal behaviour of these functions also needs to change.  Therefore
+ * for simplicitly, provide the no-op stubs.  Yes technically this is an API
+ * change in some cases for existing software, but there is 0 of that in
+ * practice.
+ */
+static inline void libxl_cpuid_apply_policy(libxl_ctx *ctx __attribute__((unused)),
+                                            uint32_t domid __attribute__((unused)))
+{}
+static inline void libxl_cpuid_set(libxl_ctx *ctx __attribute__((unused)),
+                                   uint32_t domid __attribute__((unused)),
+                                   libxl_cpuid_policy_list cpuid __attribute__((unused)))
+{}
+#endif
+
+/*
+ * Functions for allowing users of libxl to store private data
+ * relating to a domain.  The data is an opaque sequence of bytes and
+ * is not interpreted or used by libxl.
+ *
+ * Data is indexed by the userdata userid, which is a short printable
+ * ASCII string.  The following list is a registry of userdata userids
+ * (the registry may be updated by posting a patch to xen-devel):
+ *
+ *  userid        Data contents
+ *  "xl"          domain config file in xl format, Unix line endings
+ *  "libvirt-xml" domain config file in libvirt XML format.  See
+ *                http://libvirt.org/formatdomain.html
+ *  "domain-userdata-lock"  lock file to protect domain userdata in libxl.
+ *                          It's a per-domain lock. Applications should
+ *                          not touch this file.
+ *  "libxl-json"  libxl_domain_config object in JSON format, generated
+ *                by libxl. Applications should not access this file
+ *                directly. This file is protected by domain-userdata-lock
+ *                for against Read-Modify-Write operation and domain
+ *                destruction.
+ *
+ * libxl does not enforce the registration of userdata userids or the
+ * semantics of the data.  For specifications of the data formats
+ * see the code or documentation for the libxl caller in question.
+ */
+int libxl_userdata_store(libxl_ctx *ctx, uint32_t domid,
+                              const char *userdata_userid,
+                              const uint8_t *data, int datalen)
+                              LIBXL_EXTERNAL_CALLERS_ONLY;
+  /* If datalen==0, data is not used and the user data for
+   * that domain and userdata_userid is deleted. */
+int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
+                                 const char *userdata_userid,
+                                 uint8_t **data_r, int *datalen_r)
+                                 LIBXL_EXTERNAL_CALLERS_ONLY;
+  /* On successful return, *data_r is from malloc.
+   * If there is no data for that domain and userdata_userid,
+   * *data_r and *datalen_r will be set to 0.
+   * data_r and datalen_r may be 0.
+   * On error return, *data_r and *datalen_r are undefined.
+   */
+int libxl_userdata_unlink(libxl_ctx *ctx, uint32_t domid,
+                          const char *userdata_userid);
+
+
+int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
+int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
+                           const libxl_bitmap *cpumap_hard,
+                           const libxl_bitmap *cpumap_soft);
+int libxl_set_vcpuaffinity_force(libxl_ctx *ctx, uint32_t domid,
+                                 uint32_t vcpuid,
+                                 const libxl_bitmap *cpumap_hard,
+                                 const libxl_bitmap *cpumap_soft);
+int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
+                               unsigned int max_vcpus,
+                               const libxl_bitmap *cpumap_hard,
+                               const libxl_bitmap *cpumap_soft);
+
+#if defined (LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
+
+#define libxl_set_vcpuaffinity(ctx, domid, vcpuid, map) \
+    libxl_set_vcpuaffinity((ctx), (domid), (vcpuid), (map), NULL)
+#define libxl_set_vcpuaffinity_all(ctx, domid, max_vcpus, map) \
+    libxl_set_vcpuaffinity_all((ctx), (domid), (max_vcpus), (map), NULL)
+
+#endif
+
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid,
+                         libxl_bitmap *cpumap,
+                         const libxl_asyncop_how *ao_how)
+                         LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_set_vcpuonline_0x041200(libxl_ctx *ctx,
+                                                uint32_t domid,
+                                                libxl_bitmap *cpumap)
+{
+    return libxl_set_vcpuonline(ctx, domid, cpumap, NULL);
+}
+#define libxl_set_vcpuonline libxl_set_vcpuonline_0x041200
+#endif
+
+/* A return value less than 0 should be interpreted as a libxl_error, while a
+ * return value greater than or equal to 0 should be interpreted as a
+ * libxl_scheduler. */
+int libxl_get_scheduler(libxl_ctx *ctx);
+
+/* Per-scheduler parameters */
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit2_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                   libxl_sched_credit2_params *scinfo);
+int libxl_sched_credit2_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                   libxl_sched_credit2_params *scinfo);
+
+/* Scheduler Per-domain parameters */
+
+#define LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT    -1
+#define LIBXL_DOMAIN_SCHED_PARAM_CAP_DEFAULT       -1
+#define LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT    -1
+#define LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT     -1
+#define LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT   -1
+#define LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT -1
+#define LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT    -1
+
+/* Per-VCPU parameters */
+#define LIBXL_SCHED_PARAM_VCPU_INDEX_DEFAULT   -1
+
+/* Get the per-domain scheduling parameters.
+ * For schedulers that support per-vcpu settings (e.g., RTDS),
+ * calling *_domain_get functions will get default scheduling
+ * parameters.
+ */
+int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_domain_sched_params *params);
+
+/* Set the per-domain scheduling parameters.
+ * For schedulers that support per-vcpu settings (e.g., RTDS),
+ * calling *_domain_set functions will set all vcpus with the same
+ * scheduling parameters.
+ */
+int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
+                                  const libxl_domain_sched_params *params);
+
+/* Get the per-vcpu scheduling parameters */
+int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid,
+                                libxl_vcpu_sched_params *params);
+
+/* Get the per-vcpu scheduling parameters of all vcpus of a domain */
+int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, uint32_t domid,
+                                    libxl_vcpu_sched_params *params);
+
+/* Set the per-vcpu scheduling parameters */
+int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid,
+                                const libxl_vcpu_sched_params *params);
+
+/* Set the per-vcpu scheduling parameters of all vcpus of a domain */
+int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, uint32_t domid,
+                                    const libxl_vcpu_sched_params *params);
+
+int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
+                       libxl_trigger trigger, uint32_t vcpuid,
+                       const libxl_asyncop_how *ao_how)
+                       LIBXL_EXTERNAL_CALLERS_ONLY;
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x041300
+static inline int libxl_send_trigger_0x041200(
+    libxl_ctx *ctx, uint32_t domid, libxl_trigger trigger, uint32_t vcpuid)
+{
+    return libxl_send_trigger(ctx, domid, trigger, vcpuid, NULL);
+}
+#define libxl_send_trigger libxl_send_trigger_0x041200
+#endif
+int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
+int libxl_send_debug_keys(libxl_ctx *ctx, char *keys);
+int libxl_set_parameters(libxl_ctx *ctx, char *params);
+
+typedef struct libxl__xen_console_reader libxl_xen_console_reader;
+
+libxl_xen_console_reader *
+    libxl_xen_console_read_start(libxl_ctx *ctx, int clear);
+int libxl_xen_console_read_line(libxl_ctx *ctx,
+                                libxl_xen_console_reader *cr,
+                                char **line_r);
+void libxl_xen_console_read_finish(libxl_ctx *ctx,
+                                   libxl_xen_console_reader *cr);
+
+uint32_t libxl_vm_get_start_time(libxl_ctx *ctx, uint32_t domid);
+
+char *libxl_tmem_list(libxl_ctx *ctx, uint32_t domid, int use_long);
+int libxl_tmem_freeze(libxl_ctx *ctx, uint32_t domid);
+int libxl_tmem_thaw(libxl_ctx *ctx, uint32_t domid);
+int libxl_tmem_set(libxl_ctx *ctx, uint32_t domid, char* name,
+                   uint32_t set);
+int libxl_tmem_shared_auth(libxl_ctx *ctx, uint32_t domid, char* uuid,
+                           int auth);
+int libxl_tmem_freeable(libxl_ctx *ctx);
+
+int libxl_get_freecpus(libxl_ctx *ctx, libxl_bitmap *cpumap);
+
+/*
+ * Set poolid to LIBXL_CPUOOL_POOLID_ANY to have Xen choose a
+ * free poolid for you.
+ */
+#define LIBXL_CPUPOOL_POOLID_ANY 0xFFFFFFFF
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
+                         libxl_bitmap cpumap, libxl_uuid *uuid,
+                         uint32_t *poolid);
+int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
+int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid);
+int libxl_cpupool_cpuadd(libxl_ctx *ctx, uint32_t poolid, int cpu);
+int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
+int libxl_cpupool_cpuadd_cpumap(libxl_ctx *ctx, uint32_t poolid,
+                                const libxl_bitmap *cpumap);
+int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
+int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
+int libxl_cpupool_cpuremove_cpumap(libxl_ctx *ctx, uint32_t poolid,
+                                   const libxl_bitmap *cpumap);
+int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
+int libxl_cpupool_info(libxl_ctx *ctx, libxl_cpupoolinfo *info, uint32_t poolid);
+
+int libxl_domid_valid_guest(uint32_t domid);
+
+int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
+                               uint32_t *ssidref);
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf,
+                               size_t *len);
+int libxl_flask_getenforce(libxl_ctx *ctx);
+int libxl_flask_setenforce(libxl_ctx *ctx, int mode);
+int libxl_flask_loadpolicy(libxl_ctx *ctx, void *policy, uint32_t size);
+
+int libxl_ms_vm_genid_generate(libxl_ctx *ctx, libxl_ms_vm_genid *id);
+bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
+void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
+                            const libxl_ms_vm_genid *src);
+
+#if defined(__i386__) || defined(__x86_64__)
+int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
+int libxl_psr_cmt_enabled(libxl_ctx *ctx);
+int libxl_psr_cmt_get_total_rmid(libxl_ctx *ctx, uint32_t *total_rmid);
+int libxl_psr_cmt_get_l3_cache_size(libxl_ctx *ctx,
+                                    uint32_t socketid,
+                                    uint32_t *l3_cache_size);
+int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx,
+                                      uint32_t domid,
+                                      uint32_t socketid,
+                                      uint32_t *l3_cache_occupancy);
+
+int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type);
+int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
+                             uint32_t domid,
+                             libxl_psr_cmt_type type,
+                             uint64_t scope,
+                             uint64_t *sample_r,
+                             uint64_t *tsc_r);


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12631.32841 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYY-00035Y-QS; Tue, 27 Oct 2020 06:34:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12631.32841; Tue, 27 Oct 2020 06:34:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYY-00035Q-NQ; Tue, 27 Oct 2020 06:34:06 +0000
Received: by outflank-mailman (input) for mailman id 12631;
 Tue, 27 Oct 2020 06:34:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIYW-00035H-Sr
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b00bed41-9cc8-410b-8391-6fcb26e93bcb;
 Tue, 27 Oct 2020 06:34:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYV-0006fl-HN
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYV-0006vz-Fw
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIYW-00035H-Sr
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:04 +0000
X-Inumbo-ID: b00bed41-9cc8-410b-8391-6fcb26e93bcb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b00bed41-9cc8-410b-8391-6fcb26e93bcb;
	Tue, 27 Oct 2020 06:34:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YyvVOFWreWH4to56LvVXH0MyHVRLaLwEYUddd77sphw=; b=M2z5mAsMrTLOQrMoB4aTfNd1nv
	nS7W3u7QXHbm4PO2VVZkqMih0XVNfAljBPhwF2YCjxTMO3pwd1uUr3DigspEQJ9+azYE75DdYofZA
	OLULVJt7afWT/Q7vc83wJu8BjvJiR6CRkFWjlyKeUJg1dfKxXSezqd947SeQZIFwomR4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYV-0006fl-HN
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYV-0006vz-Fw
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/guest: don't use symbolic links for xenctrl headers
Message-Id: <E1kXIYV-0006vz-Fw@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:03 +0000

commit 588756db020e73e6f5e4407bbf78fbd53f15b731
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:51:01 2020 +0100

    tools/libs/guest: don't use symbolic links for xenctrl headers
    
    Instead of using symbolic links for accessing the xenctrl private
    headers use an include path instead.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/guest/Makefile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 5b4ad313cc..1c729040b3 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -6,11 +6,6 @@ ifeq ($(CONFIG_LIBXC_MINIOS),y)
 override CONFIG_MIGRATE := n
 endif
 
-LINK_FILES := xc_private.h xc_core.h xc_core_x86.h xc_core_arm.h xc_bitops.h
-
-$(LINK_FILES):
-	ln -sf $(XEN_ROOT)/tools/libs/ctrl/$(notdir $@) $@
-
 SRCS-y += xg_private.c
 SRCS-y += xg_domain.c
 SRCS-y += xg_suspend.c
@@ -29,6 +24,8 @@ else
 SRCS-y += xg_nomigrate.c
 endif
 
+CFLAGS += -I$(XEN_libxenctrl)
+
 vpath %.c ../../../xen/common/libelf
 CFLAGS += -I../../../xen/common/libelf
 
@@ -111,8 +108,6 @@ $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-$(LIB_OBJS) $(PIC_OBJS): $(LINK_FILES)
-
 .PHONY: cleanlocal
 cleanlocal:
 	rm -f libxenguest.map
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12632.32845 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYh-00036i-Rk; Tue, 27 Oct 2020 06:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12632.32845; Tue, 27 Oct 2020 06:34:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYh-00036a-Os; Tue, 27 Oct 2020 06:34:15 +0000
Received: by outflank-mailman (input) for mailman id 12632;
 Tue, 27 Oct 2020 06:34:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIYg-00036R-Dg
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id deb037a1-fcc1-4d91-8ee6-0589cffd6d6c;
 Tue, 27 Oct 2020 06:34:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYf-0006fu-L7
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYf-0006xB-K4
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIYg-00036R-Dg
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:14 +0000
X-Inumbo-ID: deb037a1-fcc1-4d91-8ee6-0589cffd6d6c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id deb037a1-fcc1-4d91-8ee6-0589cffd6d6c;
	Tue, 27 Oct 2020 06:34:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C+X7OH3FxkLCXcaDwFKMSzCl2s86zP3HInDiX8d8D+c=; b=brBvvInq+tokkvJ6WC4c4WWl9C
	qLsQTvuD4m1VfaTrejqGuimmSdKtCe5ozqqSRdFpl7RdYTeuzbEEe5BKE2aVDgpdBGQKEksEAeQpz
	PgDkQqSWDlWJdE34alL/daZ5woqMlCgjfFDbIi9UPhLkoSsyo4H0Iwf9AeLqyaT+vEcY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYf-0006fu-L7
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYf-0006xB-K4
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs/store: don't use symbolic links for external files
Message-Id: <E1kXIYf-0006xB-K4@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:13 +0000

commit 9af5e2b31b4e6f3892b4614ecd0a619af5d64d7e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Mon Oct 19 17:27:54 2020 +0200
Commit:     Ian Jackson <iwj@xenproject.org>
CommitDate: Fri Oct 23 15:51:06 2020 +0100

    tools/libs/store: don't use symbolic links for external files
    
    Instead of using symbolic links to include files from xenstored use
    the vpath directive and an include path.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Christian Lindig <christian.lindig@citrix.com>
    Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/store/Makefile | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 930e763de9..bc89b9cd70 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -21,12 +21,8 @@ CFLAGS += $(CFLAGS_libxentoolcore)
 CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
-LINK_FILES = xs_lib.c list.h utils.h
-
-$(LIB_OBJS): $(LINK_FILES)
-
-$(LINK_FILES):
-	ln -sf $(XEN_ROOT)/tools/xenstore/$@ $@
+vpath xs_lib.c $(XEN_ROOT)/tools/xenstore
+CFLAGS += -I $(XEN_ROOT)/tools/xenstore
 
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12633.32850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYt-00039A-U1; Tue, 27 Oct 2020 06:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12633.32850; Tue, 27 Oct 2020 06:34:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIYt-00038y-Qa; Tue, 27 Oct 2020 06:34:27 +0000
Received: by outflank-mailman (input) for mailman id 12633;
 Tue, 27 Oct 2020 06:34:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIYr-00038n-UE
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ffd10184-20e6-4666-a7a1-8cc588469d35;
 Tue, 27 Oct 2020 06:34:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYp-0006gY-PN
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYp-0006yN-OU
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIYr-00038n-UE
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:25 +0000
X-Inumbo-ID: ffd10184-20e6-4666-a7a1-8cc588469d35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ffd10184-20e6-4666-a7a1-8cc588469d35;
	Tue, 27 Oct 2020 06:34:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oUyYWmTmgSBu5Lqcz+aKbAsxP8fP7lraAY2PtCU5Eaw=; b=r4B1tH+BGLfZzp2YL0N/MOyxYo
	z2FssFUc5rvNRPxhv+JDdlaWEha+R72+yuqLLBiyn+K4vP9xdICaYFQUh0HOq7nunyum3vz79IYoP
	hGBNNyfCRvxIc2s73M8az+G6DsIx9d4YS8NyO0qoEVnlfBks/XnZIxvJ8qdY18qPQf2s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYp-0006gY-PN
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYp-0006yN-OU
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: fix PINSRW and adjust other {,V}PINSR*
Message-Id: <E1kXIYp-0006yN-OU@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:23 +0000

commit 06f0598b41f23c9e4cf7d8c5a05b282de92f3a35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 23 18:03:18 2020 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 23 18:03:18 2020 +0200

    x86emul: fix PINSRW and adjust other {,V}PINSR*
    
    The use of simd_packed_int together with no further update to op_bytes
    has lead to wrong signaling of #GP(0) for PINSRW without a 16-byte
    aligned memory operand. Use simd_none instead and override it after
    general decoding with simd_other, like is done for the B/D/Q siblings.
    
    While benign, for consistency also use DstImplicit instead of DstReg
    in x86_decode_twobyte().
    
    PINSR{B,D,Q} also had a stray (redundant) get_fpu() invocation, which
    gets dropped.
    
    For further consistency also
    - use src.bytes instead of op_bytes in relevant memcpy() invocations,
    - avoid the pointless updating of op_bytes (all we care about later is
      that the value be less than 16).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 41883ad6d8..fd70551bc2 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -362,7 +362,7 @@ static const struct twobyte_table {
     [0xc1] = { DstMem|SrcReg|ModRM },
     [0xc2] = { DstImplicit|SrcImmByte|ModRM, simd_any_fp, d8s_vl },
     [0xc3] = { DstMem|SrcReg|ModRM|Mov },
-    [0xc4] = { DstReg|SrcImmByte|ModRM, simd_packed_int, 1 },
+    [0xc4] = { DstImplicit|SrcImmByte|ModRM, simd_none, 1 },
     [0xc5] = { DstReg|SrcImmByte|ModRM|Mov },
     [0xc6] = { DstImplicit|SrcImmByte|ModRM, simd_packed_fp, d8s_vl },
     [0xc7] = { ImplicitOps|ModRM },
@@ -2786,7 +2786,7 @@ x86_decode_twobyte(
         /* fall through */
     case X86EMUL_OPC_VEX_66(0, 0xc4): /* vpinsrw */
     case X86EMUL_OPC_EVEX_66(0, 0xc4): /* vpinsrw */
-        state->desc = DstReg | SrcMem16;
+        state->desc = DstImplicit | SrcMem16;
         break;
 
     case 0xf0:
@@ -8589,6 +8589,7 @@ x86_emulate(
         generate_exception_if(vex.l, EXC_UD);
         memcpy(mmvalp, &src.val, 2);
         ea.type = OP_MEM;
+        state->simd_size = simd_other;
         goto simd_0f_int_imm8;
 
 #ifndef X86EMUL_NO_SIMD
@@ -8603,9 +8604,8 @@ x86_emulate(
             host_and_vcpu_must_have(avx512bw);
         if ( !mode_64bit() )
             evex.w = 0;
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto avx512f_imm8_no_sae;
@@ -10774,10 +10774,8 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f3a, 0x20): /* pinsrb $imm8,r32/m8,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0x22): /* pinsr{d,q} $imm8,r/m,xmm */
         host_and_vcpu_must_have(sse4_1);
-        get_fpu(X86EMUL_FPU_xmm);
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto simd_0f3a_common;
@@ -10787,9 +10785,8 @@ x86_emulate(
         generate_exception_if(vex.l, EXC_UD);
         if ( !mode_64bit() )
             vex.w = 0;
-        memcpy(mmvalp, &src.val, op_bytes);
+        memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
-        op_bytes = src.bytes;
         d = SrcMem16; /* Fake for the common SIMD code below. */
         state->simd_size = simd_other;
         goto simd_0f_int_imm8;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12634.32852 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZ1-0003AG-V1; Tue, 27 Oct 2020 06:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12634.32852; Tue, 27 Oct 2020 06:34:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZ1-0003A8-SA; Tue, 27 Oct 2020 06:34:35 +0000
Received: by outflank-mailman (input) for mailman id 12634;
 Tue, 27 Oct 2020 06:34:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIZ0-00039x-KZ
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 92d5e42d-f0fa-4853-81ad-e93aabf71700;
 Tue, 27 Oct 2020 06:34:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYz-0006gj-Si
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIYz-0006zV-Rz
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIZ0-00039x-KZ
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:34 +0000
X-Inumbo-ID: 92d5e42d-f0fa-4853-81ad-e93aabf71700
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 92d5e42d-f0fa-4853-81ad-e93aabf71700;
	Tue, 27 Oct 2020 06:34:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=343MScYTLM33UJKUZA6U0RVxclnpnT7MmhNqrIT8fXk=; b=tbdhfW0Ri5Azb+GDWn4QaJQyfd
	WFEasHU9NTilaCMytVLKEjm258k0Gq2JTkgudCQp6o/N1carpVJLwvj2sDyE1A/76nV5VxC5y+Sr9
	JO0yCURAIcOegkKL/oYzZddJCgrXmpPyvLFp9yjVktJbbj7QBnfUsth7Uao/do2wPSkc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYz-0006gj-Si
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIYz-0006zV-Rz
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] SUPPORT: Add linux device model stubdom to Toolstack
Message-Id: <E1kXIYz-0006zV-Rz@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:33 +0000

commit 4ddd6499d999a7d08cabfda5b0262e473dd5beed
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Sun May 24 22:55:06 2020 -0400
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 23 17:14:08 2020 +0100

    SUPPORT: Add linux device model stubdom to Toolstack
    
    Add qemu-xen linux device model stubdomain to the Toolstack section as a
    Tech Preview.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: George Dunlap <george.dunlap@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 SUPPORT.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index f35943a432..5fbe5fc444 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -167,6 +167,12 @@ Go (golang) bindings for libxl
 
     Status: Experimental
 
+### Linux device model stubdomains
+
+Support for running qemu-xen device model in a linux stubdomain.
+
+    Status: Tech Preview
+
 ## Toolstack/3rd party
 
 ### libvirt driver for xl
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12635.32857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZD-0003Bf-0a; Tue, 27 Oct 2020 06:34:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12635.32857; Tue, 27 Oct 2020 06:34:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZC-0003BX-Tu; Tue, 27 Oct 2020 06:34:46 +0000
Received: by outflank-mailman (input) for mailman id 12635;
 Tue, 27 Oct 2020 06:34:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIZB-0003BQ-Ra
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3f4ab940-f75f-472d-8e07-82e9b0428e90;
 Tue, 27 Oct 2020 06:34:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZA-0006gr-08
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZ9-00070d-V8
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIZB-0003BQ-Ra
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:45 +0000
X-Inumbo-ID: 3f4ab940-f75f-472d-8e07-82e9b0428e90
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3f4ab940-f75f-472d-8e07-82e9b0428e90;
	Tue, 27 Oct 2020 06:34:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0D3sJ/GvzyFxd7cEhBYbqXKK8v6CBtvg+f0N8kFgF2U=; b=3P0tQpLWBpA/PiR1amhEMlMA9f
	QnDkj5JF/4eCInaneiL7ofALbsiziYwPHLN318LVTfdVx9/9SRTWc9hrFQTtSF8jN3tmynE275kKq
	MUMnwkXxh4x/qEYIczsOH0REupEER6ekJz72hyxJDEWQaAtYHfueHjMCeoXjhCoPE4C8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZA-0006gr-08
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZ9-00070d-V8
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/helpers: fix Arm build by excluding init-xenstore-domain
Message-Id: <E1kXIZ9-00070d-V8@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:43 +0000

commit 92abe1481c1181b95c7f91846bd1d77f37ee5c5e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 25 06:45:46 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Mon Oct 26 11:04:59 2020 +0000

    tools/helpers: fix Arm build by excluding init-xenstore-domain
    
    The support for PVH xenstore-stubdom has broken the Arm build.
    
    Xenstore stubdom isn't supported on Arm, so there is no need to build
    the init-xenstore-domain helper.
    
    Build the helper on x86 only.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/helpers/Makefile | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index f759528322..1bcc97ea8a 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -7,8 +7,10 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 PROGS += xen-init-dom0
 ifeq ($(CONFIG_Linux),y)
+ifeq ($(CONFIG_X86),y)
 PROGS += init-xenstore-domain
 endif
+endif
 
 XEN_INIT_DOM0_OBJS = xen-init-dom0.o init-dom-json.o
 $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
@@ -37,17 +39,11 @@ init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
-	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
-ifeq ($(CONFIG_Linux),y)
-	$(INSTALL_PROG) init-xenstore-domain $(DESTDIR)$(LIBEXEC_BIN)
-endif
+	for i in $(PROGS); do $(INSTALL_PROG) $$i $(DESTDIR)$(LIBEXEC_BIN); done
 
 .PHONY: uninstall
 uninstall:
-ifeq ($(CONFIG_Linux),y)
-	rm -f $(DESTDIR)$(LIBEXEC_BIN)/init-xenstore-domain
-endif
-	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xen-init-dom0
+	for i in $(PROGS); do rm -f $(DESTDIR)$(LIBEXEC_BIN)/$$i; done
 
 .PHONY: clean
 clean:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:34:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:34:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12636.32861 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZN-0003Dc-2M; Tue, 27 Oct 2020 06:34:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12636.32861; Tue, 27 Oct 2020 06:34:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZM-0003DU-VZ; Tue, 27 Oct 2020 06:34:56 +0000
Received: by outflank-mailman (input) for mailman id 12636;
 Tue, 27 Oct 2020 06:34:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIZL-0003DJ-0T
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 72a4653d-baa7-4fd0-ad9f-0101433ba683;
 Tue, 27 Oct 2020 06:34:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZK-0006gz-3V
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZK-00071w-2l
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIZL-0003DJ-0T
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:55 +0000
X-Inumbo-ID: 72a4653d-baa7-4fd0-ad9f-0101433ba683
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 72a4653d-baa7-4fd0-ad9f-0101433ba683;
	Tue, 27 Oct 2020 06:34:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s1e3invfRmmFRdqwdrb3IGmt1DVz9UN10U0Sa7JkjhA=; b=TDywCvOZ5KKWrM9dlmoir+PskK
	b86HM2OCU99GZUHhPg7qblGv9VFls4z3sWTsKfXfo9IuHnTBW8E/iMkOkKXZ3MGoFIENJv3tYkyrO
	UvaViuQy1m5DIYz9IV1pBDcGPJ9uyvXn+3qyZOKacWe/HhaEaKZIPQWDyhuRiJccqahQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZK-0006gz-3V
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZK-00071w-2l
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:34:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] AMD/IOMMU: correct shattering of super pages
Message-Id: <E1kXIZK-00071w-2l@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:34:54 +0000

commit 2a758376f9e2bd277b6067952517a301da87dc86
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 14:38:35 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:38:35 2020 +0100

    AMD/IOMMU: correct shattering of super pages
    
    Fill the new page table _before_ installing into a live page table
    hierarchy, as installing a blank page first risks I/O faults on
    sub-ranges of the original super page which aren't part of the range
    for which mappings are being updated.
    
    While at it also do away with mapping and unmapping the same fresh
    intermediate page table page once per entry to be written.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
---
 xen/drivers/passthrough/amd/iommu_map.c | 50 +++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 17418d39b3..f773ab33fd 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -81,19 +81,34 @@ static unsigned int set_iommu_pde_present(union amd_iommu_pte *pte,
     return flush_flags;
 }
 
-static unsigned int set_iommu_pte_present(unsigned long pt_mfn,
-                                          unsigned long dfn,
-                                          unsigned long next_mfn,
-                                          int pde_level,
-                                          bool iw, bool ir)
+static unsigned int set_iommu_ptes_present(unsigned long pt_mfn,
+                                           unsigned long dfn,
+                                           unsigned long next_mfn,
+                                           unsigned int nr_ptes,
+                                           unsigned int pde_level,
+                                           bool iw, bool ir)
 {
     union amd_iommu_pte *table, *pde;
-    unsigned int flush_flags;
+    unsigned int page_sz, flush_flags = 0;
 
     table = map_domain_page(_mfn(pt_mfn));
     pde = &table[pfn_to_pde_idx(dfn, pde_level)];
+    page_sz = 1U << (PTE_PER_TABLE_SHIFT * (pde_level - 1));
+
+    if ( (void *)(pde + nr_ptes) > (void *)table + PAGE_SIZE )
+    {
+        ASSERT_UNREACHABLE();
+        return 0;
+    }
+
+    while ( nr_ptes-- )
+    {
+        flush_flags |= set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
+
+        ++pde;
+        next_mfn += page_sz;
+    }
 
-    flush_flags = set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
     unmap_domain_page(table);
 
     return flush_flags;
@@ -220,11 +235,8 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
         /* Split super page frame into smaller pieces.*/
         if ( pde->pr && !pde->next_level && next_table_mfn )
         {
-            int i;
             unsigned long mfn, pfn;
-            unsigned int page_sz;
 
-            page_sz = 1 << (PTE_PER_TABLE_SHIFT * (next_level - 1));
             pfn =  dfn & ~((1 << (PTE_PER_TABLE_SHIFT * next_level)) - 1);
             mfn = next_table_mfn;
 
@@ -238,17 +250,13 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn,
             }
 
             next_table_mfn = mfn_x(page_to_mfn(table));
+
+            set_iommu_ptes_present(next_table_mfn, pfn, mfn, PTE_PER_TABLE_SIZE,
+                                   next_level, true, true);
+            smp_wmb();
             set_iommu_pde_present(pde, next_table_mfn, next_level, true,
                                   true);
 
-            for ( i = 0; i < PTE_PER_TABLE_SIZE; i++ )
-            {
-                set_iommu_pte_present(next_table_mfn, pfn, mfn, next_level,
-                                      true, true);
-                mfn += page_sz;
-                pfn += page_sz;
-             }
-
             amd_iommu_flush_all_pages(d);
         }
 
@@ -318,9 +326,9 @@ int amd_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn,
     }
 
     /* Install 4k mapping */
-    *flush_flags |= set_iommu_pte_present(pt_mfn[1], dfn_x(dfn), mfn_x(mfn),
-                                          1, (flags & IOMMUF_writable),
-                                          (flags & IOMMUF_readable));
+    *flush_flags |= set_iommu_ptes_present(pt_mfn[1], dfn_x(dfn), mfn_x(mfn),
+                                           1, 1, (flags & IOMMUF_writable),
+                                           (flags & IOMMUF_readable));
 
     spin_unlock(&hd->arch.mapping_lock);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:35:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12638.32865 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZX-0003Ex-5C; Tue, 27 Oct 2020 06:35:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12638.32865; Tue, 27 Oct 2020 06:35:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZX-0003Ep-0n; Tue, 27 Oct 2020 06:35:07 +0000
Received: by outflank-mailman (input) for mailman id 12638;
 Tue, 27 Oct 2020 06:35:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIZV-0003DJ-4b
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1ec41fc2-2fb8-47c3-8f06-64183dae01a9;
 Tue, 27 Oct 2020 06:35:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZU-0006hK-8G
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZU-00073L-5x
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIZV-0003DJ-4b
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:05 +0000
X-Inumbo-ID: 1ec41fc2-2fb8-47c3-8f06-64183dae01a9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1ec41fc2-2fb8-47c3-8f06-64183dae01a9;
	Tue, 27 Oct 2020 06:35:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y9c3ZdBZ7mmn87DDEzG/FB3gp0/1EThBFuyzicHD4w8=; b=p9W2FT2Q3ayNZsA4jhtSC74vK0
	58bIxDsPtfokhTOM+ry45acVXHRR6GJ+ntUXK6uZ3Z4fGWB2ymNjUwUkXiutTMQ4Dp2JVaiYwJzp4
	xTeC7E/JapgBwAVR4LChXGicaBRPEt1vJ7Mf7cKjWJUDBdFHOlSgLdPN+M7oIIGVsqB0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZU-0006hK-8G
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZU-00073L-5x
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: drop dead pci_lock_*pdev() declarations
Message-Id: <E1kXIZU-00073L-5x@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:35:04 +0000

commit 20cd1be5e29577ba4c6c952cc86dfd7cfbd841b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Oct 26 14:39:42 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Oct 26 14:39:42 2020 +0100

    PCI: drop dead pci_lock_*pdev() declarations
    
    They have no definitions, and hence users, anywhere.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/include/xen/pci.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 2bc4aaf453..c4d3879761 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -155,9 +155,6 @@ bool_t pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func);
 int scan_pci_devices(void);
 enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn);
 int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);
-struct pci_dev *pci_lock_pdev(int seg, int bus, int devfn);
-struct pci_dev *pci_lock_domain_pdev(
-    struct domain *, int seg, int bus, int devfn);
 
 void setup_hwdom_pci_devices(struct domain *,
                             int (*)(u8 devfn, struct pci_dev *));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 06:35:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 06:35:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.12640.32880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZg-0003Hr-FX; Tue, 27 Oct 2020 06:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 12640.32880; Tue, 27 Oct 2020 06:35:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXIZg-0003Hh-Cb; Tue, 27 Oct 2020 06:35:16 +0000
Received: by outflank-mailman (input) for mailman id 12640;
 Tue, 27 Oct 2020 06:35:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXIZf-0003HA-6Q
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 44ea731a-e3d3-4bf9-b72e-91ef8de9c416;
 Tue, 27 Oct 2020 06:35:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZe-0006hV-Bt
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXIZe-000756-Au
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXIZf-0003HA-6Q
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:15 +0000
X-Inumbo-ID: 44ea731a-e3d3-4bf9-b72e-91ef8de9c416
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 44ea731a-e3d3-4bf9-b72e-91ef8de9c416;
	Tue, 27 Oct 2020 06:35:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7Z1fva/Clh7nkcnGp+i99NHm7PoKRZnd5mivHn/C6tA=; b=Pa0IzKGZQpC0bIle5Tz2RqlDsR
	79J6/7M8VjELuaOcxX6xgSC8i96QOB5oCSRQZFii851M4HM40E1P1o2A0fy4j5pk5r5MQMkkcFo+1
	g/CPWGnLtjiEBtQxTFuo6PoemxKaoSRkFYFHy21qLPy/son0gB7cKRb/AjUR9jl8zb4M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZe-0006hV-Bt
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXIZe-000756-Au
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 06:35:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libs: let build depend on official headers
Message-Id: <E1kXIZe-000756-Au@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 06:35:14 +0000

commit 964781c6f162893677c50a779b7d562a299727ba
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Sun Oct 25 11:11:29 2020 +0100
Commit:     Wei Liu <wl@xen.org>
CommitDate: Mon Oct 26 14:48:52 2020 +0000

    tools/libs: let build depend on official headers
    
    The build target of a library should depend on the official headers
    of that library, too, as those might be required for building other
    tools.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wl@xen.org>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 959ff91a56..b0e785b380 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -57,7 +57,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
 all: build
 
 .PHONY: build
-build: libs libxen$(LIBNAME).map
+build: libs libxen$(LIBNAME).map $(LIBHEADERS)
 
 .PHONY: libs
 libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 17:44:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 17:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13007.33516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXT0z-00081h-Ih; Tue, 27 Oct 2020 17:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13007.33516; Tue, 27 Oct 2020 17:44:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXT0z-00081Z-FI; Tue, 27 Oct 2020 17:44:09 +0000
Received: by outflank-mailman (input) for mailman id 13007;
 Tue, 27 Oct 2020 17:44:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXT0y-00081S-6w
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b0f7a4cb-2868-442d-b02a-6f27ddbf08d1;
 Tue, 27 Oct 2020 17:44:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXT0w-00053K-60
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXT0w-0008V1-4U
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXT0y-00081S-6w
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:08 +0000
X-Inumbo-ID: b0f7a4cb-2868-442d-b02a-6f27ddbf08d1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b0f7a4cb-2868-442d-b02a-6f27ddbf08d1;
	Tue, 27 Oct 2020 17:44:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fzuBbJtCHuLSwDDM92+jV4yIg5/bTLdu3kX/2CMcrJE=; b=ubVyx3FNkpvMalbTKSLFkqxVxR
	EP60IShUav1IEpRtDAsCvEZ2XJ/RzuoRY6W8ep+9N6+fQ1X+hCXcTYAxMCW1bf2hFtw2wTHG+vNvl
	oj8dT7K9YE96EhyN52UVWJwcJr0kXXPu/nsYi2YIZwnzj03+0uLVibIsOJE+1f9KSq2o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXT0w-00053K-60
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXT0w-0008V1-4U
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXT0w-0008V1-4U@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 17:44:06 +0000

commit 055e1c3a3d95b1e753148369fbc4ba48782dd602
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:39:11 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b2f35b3e7d..38168189aa 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4188,7 +4188,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 17:44:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 17:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13008.33520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXT18-00082h-K9; Tue, 27 Oct 2020 17:44:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13008.33520; Tue, 27 Oct 2020 17:44:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXT18-00082Z-H0; Tue, 27 Oct 2020 17:44:18 +0000
Received: by outflank-mailman (input) for mailman id 13008;
 Tue, 27 Oct 2020 17:44:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXT17-00082T-Un
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9e90fdb8-4ceb-43a2-afde-de403c1aeeec;
 Tue, 27 Oct 2020 17:44:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXT16-00053N-9m
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXT16-0008WK-8k
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXT17-00082T-Un
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:17 +0000
X-Inumbo-ID: 9e90fdb8-4ceb-43a2-afde-de403c1aeeec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9e90fdb8-4ceb-43a2-afde-de403c1aeeec;
	Tue, 27 Oct 2020 17:44:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F+BBeyJNtt/Eh0eQCEsHjhG8o35xC5ibs3D8x1TVLeE=; b=nNsyOd6BlFWOLOYgYsyMJzS37j
	5G/54XChcn4d5v0U7Q7odW+JpCVWdRiEJaFQrWl8TJP6rXMPrXmF2kSgq7T4wGuO+5Z7vBJA4Zq3r
	RTS8bVxbI0FKTwPsEENXxEWBVDPrjR4sJqsMR14yfTRu3xSZCSNHB/hmtM4wzZRF2Ckc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXT16-00053N-9m
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXT16-0008WK-8k
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 17:44:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXT16-0008WK-8k@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 17:44:16 +0000

commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:39:11 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 38168189aa..5a50339284 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3891,7 +3891,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4041,6 +4042,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4048,6 +4051,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4055,6 +4060,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4063,7 +4070,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4075,7 +4082,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4177,19 +4184,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:22:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13038.33562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTbk-0003N1-Ak; Tue, 27 Oct 2020 18:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13038.33562; Tue, 27 Oct 2020 18:22:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTbk-0003Mt-7v; Tue, 27 Oct 2020 18:22:08 +0000
Received: by outflank-mailman (input) for mailman id 13038;
 Tue, 27 Oct 2020 18:22:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTbi-0003Mo-Lj
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 754f940d-875a-4dc2-9a1b-3ffa8c6d557c;
 Tue, 27 Oct 2020 18:22:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTbh-0005uN-Cg
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTbh-0003Sq-Ak
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTbi-0003Mo-Lj
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:06 +0000
X-Inumbo-ID: 754f940d-875a-4dc2-9a1b-3ffa8c6d557c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 754f940d-875a-4dc2-9a1b-3ffa8c6d557c;
	Tue, 27 Oct 2020 18:22:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uefA3YGr7PLsw7FXEGYLONKEqQ3dJv+A6zuO4vTGFZY=; b=ZYfii8niabIU1sqN8W6JeDFVS/
	GPCHrGTMaYO5cAN6Foe71uVks+PSbiqwY3ZHDuDyRapmaFXUEp+FM9gVr0FMNJqNx1VXszXtebpEA
	5aYt8JmmvhBOCRpXo16GIYrTNYICpJppuxG2zBqkJRrYeNcH0e2JXFroOz3XPk9awEP8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTbh-0005uN-Cg
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTbh-0003Sq-Ak
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXTbh-0003Sq-Ak@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:05 +0000

commit 941f69a428cd989144300519e548e346c681a1b3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:56:22 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3cb6fabdae..1caa2df0a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4193,7 +4193,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:22:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13039.33567 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTbt-0003Nw-CQ; Tue, 27 Oct 2020 18:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13039.33567; Tue, 27 Oct 2020 18:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTbt-0003No-9P; Tue, 27 Oct 2020 18:22:17 +0000
Received: by outflank-mailman (input) for mailman id 13039;
 Tue, 27 Oct 2020 18:22:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTbs-0003Ni-Ka
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9fb794f4-cd1d-4258-9e82-66354f37d0ae;
 Tue, 27 Oct 2020 18:22:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTbr-0005uS-GF
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTbr-0003Tb-FQ
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTbs-0003Ni-Ka
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:16 +0000
X-Inumbo-ID: 9fb794f4-cd1d-4258-9e82-66354f37d0ae
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9fb794f4-cd1d-4258-9e82-66354f37d0ae;
	Tue, 27 Oct 2020 18:22:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jqsp9CIB/Xi6SH1JYdP01u9ih53duUnLzWkxJWaqlOA=; b=E8fq4b0IQIToHhH+AkFDiKCTig
	TPb9yExvNuX1/hRu8iOkZ7Ak5msZCllCNb0LY2CgZxwsTeeDhqfzNJur8s7bweZrSSrTopH7wedNS
	TyswDZ4DjSfhDE1fS1fStlbSf9VmresC3/NyKU8YBue8klBtlpLxWrn1WEEUpMlYHszY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTbr-0005uS-GF
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTbr-0003Tb-FQ
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.14] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXTbr-0003Tb-FQ@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:15 +0000

commit 10bb63c203f42d931fa1fa7dbbae7ce1765cecf2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:56:22 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1caa2df0a5..61cf6a7b9b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3896,7 +3896,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4046,6 +4047,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4053,6 +4056,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4060,6 +4065,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4068,7 +4075,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4080,7 +4087,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4182,19 +4189,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.14


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:22:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13040.33571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTc4-0003PV-E1; Tue, 27 Oct 2020 18:22:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13040.33571; Tue, 27 Oct 2020 18:22:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTc4-0003PN-B8; Tue, 27 Oct 2020 18:22:28 +0000
Received: by outflank-mailman (input) for mailman id 13040;
 Tue, 27 Oct 2020 18:22:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTc3-0003PE-97
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f117f2ee-fda5-48f4-b451-03f526531dfd;
 Tue, 27 Oct 2020 18:22:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTc2-0005ue-Eq
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTc2-0003Vc-DE
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTc3-0003PE-97
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:27 +0000
X-Inumbo-ID: f117f2ee-fda5-48f4-b451-03f526531dfd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f117f2ee-fda5-48f4-b451-03f526531dfd;
	Tue, 27 Oct 2020 18:22:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EvuRL3rQoW1hsLczlkuN25WUP+Hd1PWjB7wU4OIqFcU=; b=NVg9MZVlfaDoi3dSw4ocPYSxi1
	bEDuF629gSvvK51F03gPSgTeV0TU/DWCzPFoeIWxF5M9aO96K9pDbwFtGOBYsYXMRhdkuhF5/8igq
	qXI9DUy4PkB8Xn700jWD+zDJ6ij4CB/E027M0ACbElE1zzjWwVs8+33xLhb0HGF0O2f8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTc2-0005ue-Eq
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTc2-0003Vc-DE
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXTc2-0003Vc-DE@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:26 +0000

commit c10b2931bf63a444e0917115aad348b911caa82e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:01:51 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 407340e5f5..204611ca2c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4266,7 +4266,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:22:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:22:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13041.33575 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcF-0003RB-Ha; Tue, 27 Oct 2020 18:22:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13041.33575; Tue, 27 Oct 2020 18:22:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcF-0003R2-E8; Tue, 27 Oct 2020 18:22:39 +0000
Received: by outflank-mailman (input) for mailman id 13041;
 Tue, 27 Oct 2020 18:22:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTcE-0003Qp-98
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 624e97d5-c3eb-44b8-998d-df6e42bd1379;
 Tue, 27 Oct 2020 18:22:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcC-0005wL-Je
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcC-0003YC-Hh
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTcE-0003Qp-98
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:38 +0000
X-Inumbo-ID: 624e97d5-c3eb-44b8-998d-df6e42bd1379
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 624e97d5-c3eb-44b8-998d-df6e42bd1379;
	Tue, 27 Oct 2020 18:22:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NobgUtMSEfDuskpDwSqN1n14imSiM2CsLfqEURRFZoY=; b=nMW4JhCLHLBwfEp8kYMLVuHu9t
	nf/IHYwUUBPxC3LbvqtjwMtlmkIcw1Kf6rBqDh5e7m1xccGaOT4L+7o0S/WzyDLeQLAA4mEGUU+T5
	BXRkhfmjHFmNL5RYJqvGkf7qnLsNPjD5LDKkAcYenIGJm8ao5uUAFcb/HVG5xJZ8Kmwk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcC-0005wL-Je
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcC-0003YC-Hh
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXTcC-0003YC-Hh@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:36 +0000

commit 28b78171271dbbce88bbd4cb2de3d828a51fb169
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:01:51 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 204611ca2c..e56cd4bc65 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3969,7 +3969,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4119,6 +4120,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4126,6 +4129,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4133,6 +4138,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4141,7 +4148,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4153,7 +4160,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4255,19 +4262,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:22:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:22:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13042.33579 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcP-0003T1-Il; Tue, 27 Oct 2020 18:22:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13042.33579; Tue, 27 Oct 2020 18:22:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcP-0003St-Ff; Tue, 27 Oct 2020 18:22:49 +0000
Received: by outflank-mailman (input) for mailman id 13042;
 Tue, 27 Oct 2020 18:22:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTcO-0003Sl-ES
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c8d67064-bcaf-4b20-bba1-7f5cb06efe1f;
 Tue, 27 Oct 2020 18:22:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcN-0005wu-Id
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcN-0003Zh-Gv
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTcO-0003Sl-ES
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:48 +0000
X-Inumbo-ID: c8d67064-bcaf-4b20-bba1-7f5cb06efe1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c8d67064-bcaf-4b20-bba1-7f5cb06efe1f;
	Tue, 27 Oct 2020 18:22:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HHwhNi7SwffEuq1yrIxqNNKMce5tckT7KOPdKjZ5JSg=; b=IUqr9HOAoNrubKl/qEM8dfFX1a
	BHEb4a9KGLvMSlEMu5Rwt5Yh+Z381oNtszrDRjC+5lb+j7IykIgkdhbGNTZTz1qmse6tettISRLF8
	zn6bWWcfkPVu5jgQElS/Xn4Z7DfMWfTnEc+nFy+S0zUGAEacjp1XYuSDdic9LhQOlVbY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcN-0005wu-Id
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcN-0003Zh-Gv
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXTcN-0003Zh-Gv@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:47 +0000

commit b1d6f37aa5aa9f3fc5a269b9dd21b7feb7444be0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:03:32 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index e7b8f4ee4b..86f31b334f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4301,7 +4301,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:23:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:23:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13043.33583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTca-0003W2-KQ; Tue, 27 Oct 2020 18:23:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13043.33583; Tue, 27 Oct 2020 18:23:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTca-0003Vu-HH; Tue, 27 Oct 2020 18:23:00 +0000
Received: by outflank-mailman (input) for mailman id 13043;
 Tue, 27 Oct 2020 18:22:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTcZ-0003Vi-5V
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1fa07b65-5d1f-4846-91b5-78916f28953f;
 Tue, 27 Oct 2020 18:22:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcX-0005x2-MY
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcX-0003ab-LY
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTcZ-0003Vi-5V
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:59 +0000
X-Inumbo-ID: 1fa07b65-5d1f-4846-91b5-78916f28953f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1fa07b65-5d1f-4846-91b5-78916f28953f;
	Tue, 27 Oct 2020 18:22:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aXJjaSWuqMR4ET16o/J915MMMaMDYNtICqbEG9W2x0A=; b=MWIB/AN3PS695Zll9qNqsg398/
	vEWYciwNMdLillfyRwMjhJ2SIqFF+5NYYGXcfAhHV5LH3Q/nR0UMCG5wrNnKyWphZLiKcic2xClu5
	SFnZVkYPwtMPGY3W+eYCjdj72lc+yNO5fdNQs3ES+2H13tniz/qk/KPeDNUBT3V46adg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcX-0005x2-MY
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcX-0003ab-LY
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:22:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.12] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXTcX-0003ab-LY@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:22:57 +0000

commit 4100d463dbdd95d85fabe387dd5676bed75f65f7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:04:17 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 86f31b334f..db4cfdf20b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4005,7 +4005,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4155,6 +4156,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4162,6 +4165,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4169,6 +4174,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4176,7 +4183,7 @@ long do_mmu_update(
                         if ( pagetable_get_pfn(curr->arch.guest_table) == mfn )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4188,7 +4195,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               (pagetable_get_pfn(curr->arch.guest_table_user) ==
                                mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4290,19 +4297,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.12


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:23:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:23:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13044.33587 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTck-0003XD-Ll; Tue, 27 Oct 2020 18:23:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13044.33587; Tue, 27 Oct 2020 18:23:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTck-0003X5-Iq; Tue, 27 Oct 2020 18:23:10 +0000
Received: by outflank-mailman (input) for mailman id 13044;
 Tue, 27 Oct 2020 18:23:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTck-0003Wx-1y
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e39019a9-7fa7-419d-9b22-4b5b93051745;
 Tue, 27 Oct 2020 18:23:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTci-0005xQ-NH
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTci-0003c2-Lu
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTck-0003Wx-1y
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:10 +0000
X-Inumbo-ID: e39019a9-7fa7-419d-9b22-4b5b93051745
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e39019a9-7fa7-419d-9b22-4b5b93051745;
	Tue, 27 Oct 2020 18:23:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jba+Cb7LJX5VubQU8SZ7o5tRy/AvgfBj/2S9P6zb/SQ=; b=eLoffu5MxB5QRzvS2MdSXF2JpE
	TV1tbsQpoUr1yu5Q4a4muJ3FwOMyb8goIW/G/sczHrbWkGkVMmjlnKQtDHjNiAiNoYbCXUtOgbTxG
	5McaBr5KL9Naqs0MdJFga9ol/HLkF8nUp39kfODN2FQPwJt9d9ziG70AuCtpd1zVTtw4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTci-0005xQ-NH
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTci-0003c2-Lu
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXTci-0003c2-Lu@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:23:08 +0000

commit 1d021db3c8712d25e25f078833baa160c90f260f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:06:23 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5ca5c8c9a2..129da1e648 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4279,7 +4279,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:23:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:23:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13045.33591 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcu-0003Z1-No; Tue, 27 Oct 2020 18:23:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13045.33591; Tue, 27 Oct 2020 18:23:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTcu-0003Yt-KQ; Tue, 27 Oct 2020 18:23:20 +0000
Received: by outflank-mailman (input) for mailman id 13045;
 Tue, 27 Oct 2020 18:23:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTct-0003Yj-SV
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cf30656f-3f04-4d55-a167-abc983f5ffa6;
 Tue, 27 Oct 2020 18:23:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcs-0005xa-RS
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTcs-0003cz-Q1
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTct-0003Yj-SV
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:19 +0000
X-Inumbo-ID: cf30656f-3f04-4d55-a167-abc983f5ffa6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cf30656f-3f04-4d55-a167-abc983f5ffa6;
	Tue, 27 Oct 2020 18:23:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t8wJS/8y+ftToBiEqR6DF654Vak1E8gQJapGRKh5vf0=; b=r+JA/sRmhV6sDo8usbEm442MHv
	ySiT9pLdqW/eY6f0zW/8tlEN6DZPEfJozRC2cCPwLMrZj1SNitZmsPgL9qTgpnMmvbnExZPnFLVkj
	/cvgoxUeBJ7Gs56oOAMee56kc2Lw5pVb9J0V+DQcLAk2Eu7q7rsX6xyr5WV3m3gOJhAI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcs-0005xa-RS
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTcs-0003cz-Q1
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.11] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXTcs-0003cz-Q1@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:23:18 +0000

commit e274c8bdc12eb596e55233040e8b49da27150f31
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:07:27 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 129da1e648..3528cf6b85 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3983,7 +3983,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4133,6 +4134,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4140,6 +4143,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4147,6 +4152,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv_domain.xpti )
                     {
                         bool local_in_use = false;
@@ -4154,7 +4161,7 @@ long do_mmu_update(
                         if ( pagetable_get_pfn(curr->arch.guest_table) == mfn )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4166,7 +4173,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               (pagetable_get_pfn(curr->arch.guest_table_user) ==
                                mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4268,19 +4275,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:23:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:23:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13046.33595 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTd5-0003aQ-Qg; Tue, 27 Oct 2020 18:23:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13046.33595; Tue, 27 Oct 2020 18:23:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTd5-0003aI-Nb; Tue, 27 Oct 2020 18:23:31 +0000
Received: by outflank-mailman (input) for mailman id 13046;
 Tue, 27 Oct 2020 18:23:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTd4-0003aB-Rt
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0f8bb523-36b6-457d-b7fb-2be2f041e53b;
 Tue, 27 Oct 2020 18:23:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTd3-0005xi-Q7
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTd3-0003eI-Ob
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTd4-0003aB-Rt
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:30 +0000
X-Inumbo-ID: 0f8bb523-36b6-457d-b7fb-2be2f041e53b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0f8bb523-36b6-457d-b7fb-2be2f041e53b;
	Tue, 27 Oct 2020 18:23:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=inplqFhvfkUbd2W66lGr4epYjhAmWdkP4TMiQ6Vdoxs=; b=6Lm7mYWbegXPlKLMR6lHViiyjX
	EVCJ9nfsWSCf54vfGV//vpN+//2BGIDDPFCnP4K+1BPR8xNlMzyW/PbQ7bIuCMc+aXCJhMKFAdtc9
	f5z+70sSSB9UdCVZ6sfrSOopChbWt9u9JEZL1TEBDeMT5rbjpDyijM97BveGIsQmUcfs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTd3-0005xi-Q7
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTd3-0003eI-Ob
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXTd3-0003eI-Ob@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:23:29 +0000

commit 2012db463b8b8e502f69a46dd9f3aa47b31c937f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:08:23 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7090be7b4a..2aac1cbf10 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4235,7 +4235,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->domain_dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Tue Oct 27 18:23:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Oct 2020 18:23:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13047.33599 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTdG-0003cB-Sd; Tue, 27 Oct 2020 18:23:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13047.33599; Tue, 27 Oct 2020 18:23:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXTdG-0003c3-PK; Tue, 27 Oct 2020 18:23:42 +0000
Received: by outflank-mailman (input) for mailman id 13047;
 Tue, 27 Oct 2020 18:23:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXTdF-0003bS-Fn
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 460788a7-473e-4512-bc1e-6f89793fcf1b;
 Tue, 27 Oct 2020 18:23:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTdD-0005yU-Tm
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXTdD-0003f9-Sw
 for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=tpG1=EC=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXTdF-0003bS-Fn
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:41 +0000
X-Inumbo-ID: 460788a7-473e-4512-bc1e-6f89793fcf1b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 460788a7-473e-4512-bc1e-6f89793fcf1b;
	Tue, 27 Oct 2020 18:23:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s2yvUJLp55kZBD3J9iTbga0ZZIxcKKSlnFoqa+gXXsg=; b=0tUhXHf2MIt+hHnr87AYGUIauL
	Fbwet0iHkpUaIFEeXnwlNDLygxEHtPj+U57335IoFg8u+aVFuVGL0GNWr/f5a4vkT2w0SnkT1wcy8
	tXZV+LCS6yJHoFF08XO+Jux3Lfm9SACKj1/nURrDltGyS+CYcbUZVPEhBhfFgtSDAhcw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTdD-0005yU-Tm
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXTdD-0003f9-Sw
	for xen-changelog@lists.xenproject.org; Tue, 27 Oct 2020 18:23:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.10] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXTdD-0003f9-Sw@xenbits.xenproject.org>
Date: Tue, 27 Oct 2020 18:23:39 +0000

commit 78d903e95efc5b0166b393d289a687c64016e8ef
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:10:12 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2aac1cbf10..66399a5f61 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3949,7 +3949,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4096,14 +4097,20 @@ long do_mmu_update(
                 case PGT_l2_page_table:
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && !cpu_has_no_xpti )
                     {
                         bool local_in_use = false;
@@ -4111,7 +4118,7 @@ long do_mmu_update(
                         if ( pagetable_get_pfn(curr->arch.guest_table) == mfn )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4123,7 +4130,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               (pagetable_get_pfn(curr->arch.guest_table_user) ==
                                mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
                 case PGT_writable_page:
@@ -4224,19 +4231,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->domain_dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->domain_dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->domain_dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 28 08:22:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Oct 2020 08:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13363.33954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXgib-0007pH-F4; Wed, 28 Oct 2020 08:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13363.33954; Wed, 28 Oct 2020 08:22:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXgib-0007p9-CF; Wed, 28 Oct 2020 08:22:05 +0000
Received: by outflank-mailman (input) for mailman id 13363;
 Wed, 28 Oct 2020 08:22:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXgiZ-0007p0-Og
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9a799f1f-8a5f-4384-890d-7684480cab15;
 Wed, 28 Oct 2020 08:22:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXgiY-00047r-IH
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXgiY-0004Ao-HL
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXgiZ-0007p0-Og
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:03 +0000
X-Inumbo-ID: 9a799f1f-8a5f-4384-890d-7684480cab15
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9a799f1f-8a5f-4384-890d-7684480cab15;
	Wed, 28 Oct 2020 08:22:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hIwUeAKRryXRTwUf8WgbbK/bmax3K+R8nSjOZMsNiDw=; b=jG44fq6lT41dPQUiCgT43T6HHH
	qElNVQga/9mFDyC1GKK2GZxmHAJFxpQOsLJWmmJ76oNz0dud9Zm9fCl3XY0N9BvoUfNA8gn7bL+PM
	dRYy2ilbjrInWlRCfG8w52GS/cw6uy+WpkZtwxkzE00ZBK66t2+ruVmMHyA+BVFR4MbA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXgiY-00047r-IH
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXgiY-0004Ao-HL
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXgiY-0004Ao-HL@xenbits.xenproject.org>
Date: Wed, 28 Oct 2020 08:22:02 +0000

commit 2012db463b8b8e502f69a46dd9f3aa47b31c937f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:08:23 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 7090be7b4a..2aac1cbf10 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4235,7 +4235,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->domain_dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 28 08:22:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Oct 2020 08:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13364.33958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXgin-0007qS-Gx; Wed, 28 Oct 2020 08:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13364.33958; Wed, 28 Oct 2020 08:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXgin-0007qK-Dp; Wed, 28 Oct 2020 08:22:17 +0000
Received: by outflank-mailman (input) for mailman id 13364;
 Wed, 28 Oct 2020 08:22:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXgil-0007q8-U7
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3ca311e8-1b18-465c-af07-846e87953908;
 Wed, 28 Oct 2020 08:22:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXgii-00047u-O1
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXgii-0004Bj-L9
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXgil-0007q8-U7
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:15 +0000
X-Inumbo-ID: 3ca311e8-1b18-465c-af07-846e87953908
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3ca311e8-1b18-465c-af07-846e87953908;
	Wed, 28 Oct 2020 08:22:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mttT6fW0FLtq+rucEtDk0LaACae3yTMdJwBzfIyFHIk=; b=vuwzKkb6jKxW31OhQnIKpH3fR2
	z6OnyySiqiMoG9MKbMuH9qJu/FNjmzOrp+Gz/bkqPQBSxn5TtkS/qyeeMojg5GhMhYghVZbGJkwHh
	t5B/B+HCNrk7TbKNqqJlVYiV45B/9u1yW1PcrGo7kCzY26FTkJ/yM744t3QvP7KkeKX0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXgii-00047u-O1
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXgii-0004Bj-L9
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 08:22:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.10] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXgii-0004Bj-L9@xenbits.xenproject.org>
Date: Wed, 28 Oct 2020 08:22:12 +0000

commit 78d903e95efc5b0166b393d289a687c64016e8ef
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:10:12 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2aac1cbf10..66399a5f61 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3949,7 +3949,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4096,14 +4097,20 @@ long do_mmu_update(
                 case PGT_l2_page_table:
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
                 case PGT_l3_page_table:
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
                 case PGT_l4_page_table:
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && !cpu_has_no_xpti )
                     {
                         bool local_in_use = false;
@@ -4111,7 +4118,7 @@ long do_mmu_update(
                         if ( pagetable_get_pfn(curr->arch.guest_table) == mfn )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4123,7 +4130,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               (pagetable_get_pfn(curr->arch.guest_table_user) ==
                                mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
                 case PGT_writable_page:
@@ -4224,19 +4231,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->domain_dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->domain_dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->domain_dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10


From xen-changelog-bounces@lists.xenproject.org Wed Oct 28 15:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Oct 2020 15:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13750.34500 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXnmz-0000OT-Vm; Wed, 28 Oct 2020 15:55:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13750.34500; Wed, 28 Oct 2020 15:55:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXnmz-0000OK-SR; Wed, 28 Oct 2020 15:55:05 +0000
Received: by outflank-mailman (input) for mailman id 13750;
 Wed, 28 Oct 2020 15:55:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXnmx-0000OF-VS
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8eba98fd-b808-489b-9044-e22991ae163f;
 Wed, 28 Oct 2020 15:55:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXnmw-0005C9-Lf
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXnmw-0002dM-JU
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXnmx-0000OF-VS
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:04 +0000
X-Inumbo-ID: 8eba98fd-b808-489b-9044-e22991ae163f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8eba98fd-b808-489b-9044-e22991ae163f;
	Wed, 28 Oct 2020 15:55:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3xAgs0cA342OtQhttDtOWstvs1Ic27oaZa0SrwC0hMM=; b=oThCYCYMtAcd1RbVoULSo1bQ3H
	WK24swZHpTeuMfGpHbHU1nsL75XKikhzv3o/Aj7lSQFsgv9xZnaNoJuVctJPOHQjj2iK5dMQcPNQf
	0Hx+KX7+JXtN58mcxJfcce3H1O/maSE3Lf/BUR0CGTKcV+1fZkptx1jI9Lbii5y86fbo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXnmw-0005C9-Lf
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXnmw-0002dM-JU
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXnmw-0002dM-JU@xenbits.xenproject.org>
Date: Wed, 28 Oct 2020 15:55:02 +0000

commit c10b2931bf63a444e0917115aad348b911caa82e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:01:51 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 407340e5f5..204611ca2c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4266,7 +4266,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Wed Oct 28 15:55:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Oct 2020 15:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13751.34504 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXnnA-0000Q1-0l; Wed, 28 Oct 2020 15:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13751.34504; Wed, 28 Oct 2020 15:55:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXnn9-0000Pu-U0; Wed, 28 Oct 2020 15:55:15 +0000
Received: by outflank-mailman (input) for mailman id 13751;
 Wed, 28 Oct 2020 15:55:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXnn8-0000P1-1E
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7249e734-e198-4798-a770-beec3e1b29b0;
 Wed, 28 Oct 2020 15:55:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXnn6-0005Cd-PZ
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXnn6-0002e5-OU
 for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=YYEV=ED=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXnn8-0000P1-1E
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:14 +0000
X-Inumbo-ID: 7249e734-e198-4798-a770-beec3e1b29b0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7249e734-e198-4798-a770-beec3e1b29b0;
	Wed, 28 Oct 2020 15:55:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yh7vFd/H6e5fevEkUzr5fGiTXONJGCr1k6BWKNTJNDs=; b=v7OSYshUQC7DY8Fju44l1AKmei
	ZjECSCY6g8jl+R8wG35RJLydxt6JeDBINsyB1DP4Buv8/WW067twUoRi4uWk5B5OfKVCnsjEmpQx8
	YctIZCtDmmKRXfVNlbic5PQbTf+I3+54dAEmRBxHGIa1e2gRod2jHKqTEagJYPuGOBV0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXnn6-0005Cd-PZ
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXnn6-0002e5-OU
	for xen-changelog@lists.xenproject.org; Wed, 28 Oct 2020 15:55:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXnn6-0002e5-OU@xenbits.xenproject.org>
Date: Wed, 28 Oct 2020 15:55:12 +0000

commit 28b78171271dbbce88bbd4cb2de3d828a51fb169
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:01:51 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 204611ca2c..e56cd4bc65 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3969,7 +3969,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4119,6 +4120,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4126,6 +4129,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4133,6 +4138,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4141,7 +4148,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4153,7 +4160,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4255,19 +4262,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 03:22:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 03:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13973.34847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXyVq-00088i-Jj; Thu, 29 Oct 2020 03:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13973.34847; Thu, 29 Oct 2020 03:22:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXyVq-00088Z-GS; Thu, 29 Oct 2020 03:22:06 +0000
Received: by outflank-mailman (input) for mailman id 13973;
 Thu, 29 Oct 2020 03:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXyVp-00088U-17
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id be88aae0-1c0e-43ab-8554-4d12c0c8b3c8;
 Thu, 29 Oct 2020 03:22:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXyVn-0008BK-0n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXyVm-0000CW-V0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXyVp-00088U-17
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:05 +0000
X-Inumbo-ID: be88aae0-1c0e-43ab-8554-4d12c0c8b3c8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id be88aae0-1c0e-43ab-8554-4d12c0c8b3c8;
	Thu, 29 Oct 2020 03:22:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5GZC1ipjF06vjOggNRMb8z95bWOJ/R3FMAeHi1NHTm4=; b=7Hcp6NTOmYibjFyznlTHc43tWQ
	znZCt4Ggw2fFYY0NPApI5c0jRkmFauZik0M3/C2If4Q7ZuPk//7uYiGCRuRRZeJcVZyb5iyIVybZ/
	vB1u034nYqI+CtwjAQMmY5AtLUX1BiidhubA4hF8fDniDwyQ2O4JEZA2fObljJ/Zbz8A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXyVn-0008BK-0n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXyVm-0000CW-V0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kXyVm-0000CW-V0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 03:22:02 +0000

commit 941f69a428cd989144300519e548e346c681a1b3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:56:22 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 3cb6fabdae..1caa2df0a5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4193,7 +4193,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 03:22:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 03:22:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.13974.34851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXyVz-00089Y-Kw; Thu, 29 Oct 2020 03:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 13974.34851; Thu, 29 Oct 2020 03:22:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kXyVz-00089O-Hz; Thu, 29 Oct 2020 03:22:15 +0000
Received: by outflank-mailman (input) for mailman id 13974;
 Thu, 29 Oct 2020 03:22:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kXyVy-000897-8m
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e760eae-4980-4c80-9c19-3db2dbd77374;
 Thu, 29 Oct 2020 03:22:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXyVx-0008BN-4t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kXyVx-0000D7-3n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kXyVy-000897-8m
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:14 +0000
X-Inumbo-ID: 6e760eae-4980-4c80-9c19-3db2dbd77374
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e760eae-4980-4c80-9c19-3db2dbd77374;
	Thu, 29 Oct 2020 03:22:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WEqTaZm2/ZMZQgFeE/bHrrhZOr+l/193jcNtp1TKZRI=; b=63RXnQXqX+g3DuVR8+HiSp/0tQ
	6dYXtuMdDV+4zwXoAKIg9NwgoAQQ1T36CfEHLW1fUvWV/xKqNebtzVFWUr6eeaXGbtOn6mr0FnCUF
	ICi76knK60CKWv/IGBzQlZmoZsqNSPFXYYNrv1oGiDyEVSWIcTmXiYO23iBZ3POPh1I0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXyVx-0008BN-4t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kXyVx-0000D7-3n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 03:22:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.14] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kXyVx-0000D7-3n@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 03:22:13 +0000

commit 10bb63c203f42d931fa1fa7dbbae7ce1765cecf2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:56:22 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1caa2df0a5..61cf6a7b9b 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3896,7 +3896,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4046,6 +4047,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4053,6 +4056,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4060,6 +4065,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4068,7 +4075,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4080,7 +4087,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4182,19 +4189,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.14


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 13:55:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 13:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14192.35233 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kY8OU-0006n0-7w; Thu, 29 Oct 2020 13:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14192.35233; Thu, 29 Oct 2020 13:55:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kY8OU-0006mt-53; Thu, 29 Oct 2020 13:55:10 +0000
Received: by outflank-mailman (input) for mailman id 14192;
 Thu, 29 Oct 2020 13:55:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kY8OR-0006mn-Vl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fd8b38e5-a5b7-47c4-9bdf-01c15c69d7f5;
 Thu, 29 Oct 2020 13:55:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kY8OQ-0005Xu-Dc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kY8OQ-0007He-A2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kY8OR-0006mn-Vl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:08 +0000
X-Inumbo-ID: fd8b38e5-a5b7-47c4-9bdf-01c15c69d7f5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fd8b38e5-a5b7-47c4-9bdf-01c15c69d7f5;
	Thu, 29 Oct 2020 13:55:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p99ju/OANLI87uyERYWdO00haJz8rpLdhmwsXoEwBQA=; b=Vuq4THKPYJaYKVmqLviGVbEZvG
	ibir+9kEzJr9tZ6/oO8k8M1I+OO7E2HGnS08baOtrUQzDmazkD+MbvAujM7mLoB89q+29vFGOI0Lb
	8/4jpmByhTv2U5b5GgVM89EKvGsU+MRH7FY9XPBSxo1ZtEHlJi25DlfRpAahOd1ZloBw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kY8OQ-0005Xu-Dc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kY8OQ-0007He-A2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: don't open-code l<N>e_to_mfn()
Message-Id: <E1kY8OQ-0007He-A2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 13:55:06 +0000

commit 33d2badc3a1f64d1c425f0758d4948d38a011511
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:42:37 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:42:37 2020 +0100

    x86: don't open-code l<N>e_to_mfn()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/mm/p2m-pt.c   | 8 ++++----
 xen/include/asm-x86/page.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 3af51be78e..c04a015e2c 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -779,9 +779,9 @@ pod_retry_l3:
         }
         if ( flags & _PAGE_PSE )
         {
-            mfn = _mfn(l3e_get_pfn(*l3e) +
-                       l2_table_offset(addr) * L1_PAGETABLE_ENTRIES +
-                       l1_table_offset(addr));
+            mfn = mfn_add(l3e_get_mfn(*l3e),
+                          l2_table_offset(addr) * L1_PAGETABLE_ENTRIES +
+                          l1_table_offset(addr));
             *t = p2m_recalc_type(recalc || _needs_recalc(flags),
                                  p2m_flags_to_type(flags), p2m, gfn);
             unmap_domain_page(l3e);
@@ -820,7 +820,7 @@ pod_retry_l2:
     }
     if ( flags & _PAGE_PSE )
     {
-        mfn = _mfn(l2e_get_pfn(*l2e) + l1_table_offset(addr));
+        mfn = mfn_add(l2e_get_mfn(*l2e), l1_table_offset(addr));
         *t = p2m_recalc_type(recalc || _needs_recalc(flags),
                              p2m_flags_to_type(flags), p2m, gfn);
         unmap_domain_page(l2e);
diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h
index f632affaef..7a771baf7c 100644
--- a/xen/include/asm-x86/page.h
+++ b/xen/include/asm-x86/page.h
@@ -291,7 +291,7 @@ void copy_page_sse2(void *, const void *);
 #define pfn_to_paddr(pfn)   __pfn_to_paddr(pfn)
 #define paddr_to_pfn(pa)    __paddr_to_pfn(pa)
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
-#define vmap_to_mfn(va)     _mfn(l1e_get_pfn(*virt_to_xen_l1e((unsigned long)(va))))
+#define vmap_to_mfn(va)     l1e_get_mfn(*virt_to_xen_l1e((unsigned long)(va)))
 #define vmap_to_page(va)    mfn_to_page(vmap_to_mfn(va))
 
 #endif /* !defined(__ASSEMBLY__) */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 13:55:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 13:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14193.35237 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kY8Oc-0006o0-9l; Thu, 29 Oct 2020 13:55:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14193.35237; Thu, 29 Oct 2020 13:55:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kY8Oc-0006nt-70; Thu, 29 Oct 2020 13:55:18 +0000
Received: by outflank-mailman (input) for mailman id 14193;
 Thu, 29 Oct 2020 13:55:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kY8Ob-0006nm-NG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7e4ab373-5452-47c2-b9ca-542bae1caf42;
 Thu, 29 Oct 2020 13:55:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kY8Oa-0005Xx-HJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kY8Oa-0007IK-GF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kY8Ob-0006nm-NG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:17 +0000
X-Inumbo-ID: 7e4ab373-5452-47c2-b9ca-542bae1caf42
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7e4ab373-5452-47c2-b9ca-542bae1caf42;
	Thu, 29 Oct 2020 13:55:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CeUb7qXKn9g8hvP0/0HXbAgGjBZPzFZL5ja1mhLpVoM=; b=0Im4aH/ZLXq0on+j/Rmizc/MIA
	2seaQcDM25fVcPS/FGv5IxcPgwVe52E3OgwODnGGCAyMzEtFMe+e30DZQKesw+DjDjmECZPuBe+4j
	ZPWU0PM770+H30SYo6mcPK9DBxAcxMYfvclMoWjT8HUdYxEY6AQbs+MkxCVqXxFT02vQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kY8Oa-0005Xx-HJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kY8Oa-0007IK-GF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 13:55:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: don't open-code vmap_to_mfn()
Message-Id: <E1kY8Oa-0007IK-GF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 13:55:16 +0000

commit 1fd1d4bafdf6f9f8fe5ca9b947f016a7aae92a74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Oct 29 14:44:02 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Oct 29 14:44:02 2020 +0100

    x86: don't open-code vmap_to_mfn()
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Wei Liu <wl@xen.org>
---
 xen/arch/x86/domain_page.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index b03728e18e..eac5e3304f 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -333,21 +333,14 @@ void unmap_domain_page_global(const void *ptr)
 mfn_t domain_page_map_to_mfn(const void *ptr)
 {
     unsigned long va = (unsigned long)ptr;
-    const l1_pgentry_t *pl1e;
 
     if ( va >= DIRECTMAP_VIRT_START )
         return _mfn(virt_to_mfn(ptr));
 
     if ( va >= VMAP_VIRT_START && va < VMAP_VIRT_END )
-    {
-        pl1e = virt_to_xen_l1e(va);
-        BUG_ON(!pl1e);
-    }
-    else
-    {
-        ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
-        pl1e = &__linear_l1_table[l1_linear_offset(va)];
-    }
+        return vmap_to_mfn(va);
+
+    ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
 
-    return l1e_get_mfn(*pl1e);
+    return l1e_get_mfn(__linear_l1_table[l1_linear_offset(va)]);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 17:22:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 17:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14489.35835 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYBdF-0005eV-DH; Thu, 29 Oct 2020 17:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14489.35835; Thu, 29 Oct 2020 17:22:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYBdF-0005eO-AP; Thu, 29 Oct 2020 17:22:37 +0000
Received: by outflank-mailman (input) for mailman id 14489;
 Thu, 29 Oct 2020 17:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYBdE-0005eG-JN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 30d74687-b110-4ac7-947c-80f5f3744e2f;
 Thu, 29 Oct 2020 17:22:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYBdD-00029I-Mp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYBdD-0002Dx-LL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYBdE-0005eG-JN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:36 +0000
X-Inumbo-ID: 30d74687-b110-4ac7-947c-80f5f3744e2f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 30d74687-b110-4ac7-947c-80f5f3744e2f;
	Thu, 29 Oct 2020 17:22:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9urL7caRD98HWV42civMkEd5NCea6z8daJi8fIju7nk=; b=le1kmqF10BpwtAOi4kEYV9AHZv
	Vk+mIHeNA0p7iuUefLIbzsFvOTTR73hvM7OmIHpP7ozFYJNesYC0cAWfC3deYdQzoga2BSPgaRbrR
	Cm9gC+DfzhusQ5Hj/tQ7caefO/sBGdDPmmyhq3muQk8ouacYCG55WFO64QdjwxKuGDdI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYBdD-00029I-Mp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYBdD-0002Dx-LL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:22:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Open 5.1 development tree
Message-Id: <E1kYBdD-0002Dx-LL@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 17:22:35 +0000

commit a7922a3c81f34f45b1ebc9670a7769edc4c42a43
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Apr 29 15:07:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Apr 29 15:07:10 2020 +0100

    Open 5.1 development tree
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 0062ac9718..a480698ce5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.0
+5.0.50
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 17:33:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 17:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14537.35899 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYBnx-0007Or-Mz; Thu, 29 Oct 2020 17:33:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14537.35899; Thu, 29 Oct 2020 17:33:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYBnx-0007Oj-Jd; Thu, 29 Oct 2020 17:33:41 +0000
Received: by outflank-mailman (input) for mailman id 14537;
 Thu, 29 Oct 2020 17:33:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYBnv-0007OX-Rz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f3a51da7-6323-4c28-81a6-b9ec104fec08;
 Thu, 29 Oct 2020 17:33:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYBns-0002PC-3m
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYBns-0005a1-1N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYBnv-0007OX-Rz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:40 +0000
X-Inumbo-ID: f3a51da7-6323-4c28-81a6-b9ec104fec08
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f3a51da7-6323-4c28-81a6-b9ec104fec08;
	Thu, 29 Oct 2020 17:33:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V22QTqVBxhwO2+hC9d3qF/+dckgSNyCZ9m3E9zyMCQ8=; b=4WT+LW9wcFroPs0ZmaHO5dhXCz
	es2dDTj9b1Lm1VfBG/g5WthfqTg6odE6Wl8Ochm1DBzpTI5uydZOr6U/RdOhpzbliZEoSXVOqPgG7
	4+0kOH0aGHH8huce4Syl8h0BiBUcmB22UaxCaOONNhwjFjoWsc5ztEkvx7nIUhR8pIhQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYBns-0002PC-3m
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYBns-0005a1-1N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:33:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-04-29' into staging
Message-Id: <E1kYBns-0005a1-1N@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 17:33:36 +0000

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

commit 648db19685b7030aa558a4ddbd3a8e53d8c9a062
Merge: a7922a3c81f34f45b1ebc9670a7769edc4c42a43 8ef3a4be27efccd791d05e74b7b17d918f511a76
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Apr 29 15:07:33 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Apr 29 15:07:33 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-04-29' into staging
    
    Miscellaneous patches for 2020-04-29
    
    # gpg: Signature made Wed 29 Apr 2020 07:42:52 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-misc-2020-04-29: (32 commits)
      qemu-option: pass NULL rather than 0 to the id of qemu_opts_set()
      libqos: Give get_machine_allocator() internal linkage
      fuzz: Simplify how we compute available machines and types
      Makefile: Drop unused, broken target recurse-fuzz
      smbus: Fix spd_data_generate() for number of banks > 2
      bamboo, sam460ex: Tidy up error message for unsupported RAM size
      smbus: Fix spd_data_generate() error API violation
      sam460ex: Suppress useless warning on -m 32 and -m 64
      qga: Fix qmp_guest_suspend_{disk, ram}() error handling
      qga: Fix qmp_guest_get_memory_blocks() error handling
      tests/test-logging: Fix test for -dfilter 0..0xffffffffffffffff
      migration/colo: Fix qmp_xen_colo_do_checkpoint() error handling
      io: Fix qio_channel_socket_close() error handling
      xen/pt: Fix flawed conversion to realize()
      virtio-net: Fix duplex=... and speed=... error handling
      bochs-display: Fix vgamem=SIZE error handling
      fdc: Fix fallback=auto error handling
      arm/virt: Fix virt_machine_device_plug_cb() error API violation
      cpus: Proper range-checking for -icount shift=N
      cpus: Fix configure_icount() error API violation
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Makefile                          |   1 -
 backends/cryptodev-builtin.c      |  10 +-
 block/file-posix.c                |   5 +-
 block/replication.c               |   4 +-
 block/vhdx.c                      |   8 +-
 cpus.c                            |  50 ++++++----
 dump/dump.c                       |   2 +-
 hw/arm/virt.c                     |   4 +-
 hw/block/fdc.c                    |   1 +
 hw/display/bochs-display.c        |   6 +-
 hw/i2c/smbus_eeprom.c             |  32 +-----
 hw/mips/mips_fulong2e.c           |  10 +-
 hw/net/virtio-net.c               |   7 +-
 hw/ppc/ppc4xx_devs.c              |   8 +-
 hw/ppc/sam460ex.c                 |  13 +--
 hw/riscv/sifive_u.c               |   2 +-
 hw/scsi/scsi-disk.c               |   2 +-
 hw/sd/sdhci.c                     |   2 +-
 hw/xen/xen_pt.c                   |  12 +--
 include/hw/i2c/smbus_eeprom.h     |   2 +-
 include/qemu/option.h             |   1 -
 io/channel-socket.c               |   5 +-
 migration/colo.c                  |   8 +-
 qemu-img.c                        |  87 +++++++++-------
 qga/commands-posix.c              |   3 +
 qga/commands-win32.c              |  14 +++
 softmmu/vl.c                      |  10 +-
 target/i386/cpu.c                 |  18 ++--
 target/microblaze/cpu.c           |  14 +--
 target/ppc/translate_init.inc.c   |   4 +-
 tests/qtest/fuzz/qos_fuzz.c       |  34 ++-----
 tests/qtest/libqos/qos_external.c |  68 +++++--------
 tests/qtest/libqos/qos_external.h |  10 +-
 tests/qtest/qos-test.c            |  29 ++++--
 tests/test-logging.c              |   4 +-
 tests/test-qemu-opts.c            |  46 ++++++++-
 util/qemu-option.c                | 202 +++++++++++++++++++-------------------
 37 files changed, 384 insertions(+), 354 deletions(-)

diff --git a/Makefile b/Makefile
index 8a9113e666..34275f57c9 100644
--- a/Makefile
+++ b/Makefile
@@ -582,7 +582,6 @@ $(ROM_DIRS_RULES):
 
 .PHONY: recurse-all recurse-clean recurse-install
 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
-recurse-fuzz: $(addsuffix /fuzz, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
 $(addsuffix /install, $(TARGET_DIRS)): all
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index c8ae3b9742..14316333fe 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -282,12 +282,7 @@ static int cryptodev_builtin_sym_close_session(
     CryptoDevBackendBuiltin *builtin =
                       CRYPTODEV_BACKEND_BUILTIN(backend);
 
-    if (session_id >= MAX_NUM_SESSIONS ||
-              builtin->sessions[session_id] == NULL) {
-        error_setg(errp, "Cannot find a valid session id: %" PRIu64 "",
-                      session_id);
-        return -1;
-    }
+    assert(session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]);
 
     qcrypto_cipher_free(builtin->sessions[session_id]->cipher);
     g_free(builtin->sessions[session_id]);
@@ -356,8 +351,7 @@ static void cryptodev_builtin_cleanup(
 
     for (i = 0; i < MAX_NUM_SESSIONS; i++) {
         if (builtin->sessions[i] != NULL) {
-            cryptodev_builtin_sym_close_session(
-                    backend, i, 0, errp);
+            cryptodev_builtin_sym_close_session(backend, i, 0, &error_abort);
         }
     }
 
diff --git a/block/file-posix.c b/block/file-posix.c
index 7e19bbff5f..094e3b0212 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2691,10 +2691,13 @@ static void check_cache_dropped(BlockDriverState *bs, Error **errp)
         vec_end = DIV_ROUND_UP(length, page_size);
         for (i = 0; i < vec_end; i++) {
             if (vec[i] & 0x1) {
-                error_setg(errp, "page cache still in use!");
                 break;
             }
         }
+        if (i < vec_end) {
+            error_setg(errp, "page cache still in use!");
+            break;
+        }
     }
 
     if (window) {
diff --git a/block/replication.c b/block/replication.c
index da013c2041..971f0fe266 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -172,8 +172,8 @@ static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
     if ((bs->open_flags & (BDRV_O_INACTIVE | BDRV_O_RDWR)) == BDRV_O_RDWR) {
         *nperm |= BLK_PERM_WRITE;
     }
-    *nshared = BLK_PERM_CONSISTENT_READ \
-               | BLK_PERM_WRITE \
+    *nshared = BLK_PERM_CONSISTENT_READ
+               | BLK_PERM_WRITE
                | BLK_PERM_WRITE_UNCHANGED;
     return;
 }
diff --git a/block/vhdx.c b/block/vhdx.c
index 33e57cd656..e16fdc2f2d 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -2206,20 +2206,20 @@ static QemuOptsList vhdx_create_opts = {
            .name = VHDX_BLOCK_OPT_BLOCK_SIZE,
            .type = QEMU_OPT_SIZE,
            .def_value_str = stringify(0),
-           .help = "Block Size; min 1MB, max 256MB. " \
+           .help = "Block Size; min 1MB, max 256MB. "
                    "0 means auto-calculate based on image size."
        },
        {
            .name = BLOCK_OPT_SUBFMT,
            .type = QEMU_OPT_STRING,
-           .help = "VHDX format type, can be either 'dynamic' or 'fixed'. "\
+           .help = "VHDX format type, can be either 'dynamic' or 'fixed'. "
                    "Default is 'dynamic'."
        },
        {
            .name = VHDX_BLOCK_OPT_ZERO,
            .type = QEMU_OPT_BOOL,
-           .help = "Force use of payload blocks of type 'ZERO'. "\
-                   "Non-standard, but default.  Do not set to 'off' when "\
+           .help = "Force use of payload blocks of type 'ZERO'. "
+                   "Non-standard, but default.  Do not set to 'off' when "
                    "using 'qemu-img convert' with subformat=dynamic."
        },
        { NULL }
diff --git a/cpus.c b/cpus.c
index ef441bdf62..5670c96bcf 100644
--- a/cpus.c
+++ b/cpus.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/config-file.h"
+#include "qemu/cutils.h"
 #include "migration/vmstate.h"
 #include "monitor/monitor.h"
 #include "qapi/error.h"
@@ -797,40 +798,47 @@ void cpu_ticks_init(void)
 
 void configure_icount(QemuOpts *opts, Error **errp)
 {
-    const char *option;
-    char *rem_str = NULL;
+    const char *option = qemu_opt_get(opts, "shift");
+    bool sleep = qemu_opt_get_bool(opts, "sleep", true);
+    bool align = qemu_opt_get_bool(opts, "align", false);
+    long time_shift = -1;
 
-    option = qemu_opt_get(opts, "shift");
-    if (!option) {
-        if (qemu_opt_get(opts, "align") != NULL) {
-            error_setg(errp, "Please specify shift option when using align");
-        }
+    if (!option && qemu_opt_get(opts, "align")) {
+        error_setg(errp, "Please specify shift option when using align");
         return;
     }
 
-    icount_sleep = qemu_opt_get_bool(opts, "sleep", true);
-    if (icount_sleep) {
-        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                         icount_timer_cb, NULL);
-    }
-
-    icount_align_option = qemu_opt_get_bool(opts, "align", false);
-
-    if (icount_align_option && !icount_sleep) {
+    if (align && !sleep) {
         error_setg(errp, "align=on and sleep=off are incompatible");
+        return;
     }
+
     if (strcmp(option, "auto") != 0) {
-        errno = 0;
-        timers_state.icount_time_shift = strtol(option, &rem_str, 0);
-        if (errno != 0 || *rem_str != '\0' || !strlen(option)) {
+        if (qemu_strtol(option, NULL, 0, &time_shift) < 0
+            || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
             error_setg(errp, "icount: Invalid shift value");
+            return;
         }
-        use_icount = 1;
-        return;
     } else if (icount_align_option) {
         error_setg(errp, "shift=auto and align=on are incompatible");
+        return;
     } else if (!icount_sleep) {
         error_setg(errp, "shift=auto and sleep=off are incompatible");
+        return;
+    }
+
+    icount_sleep = sleep;
+    if (icount_sleep) {
+        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
+                                         icount_timer_cb, NULL);
+    }
+
+    icount_align_option = align;
+
+    if (time_shift >= 0) {
+        timers_state.icount_time_shift = time_shift;
+        use_icount = 1;
+        return;
     }
 
     use_icount = 2;
diff --git a/dump/dump.c b/dump/dump.c
index 22ed1d3b0d..248ea06370 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1892,7 +1892,7 @@ static void dump_process(DumpState *s, Error **errp)
     result = qmp_query_dump(NULL);
     /* should never fail */
     assert(result);
-    qapi_event_send_dump_completed(result, !!local_err, (local_err ? \
+    qapi_event_send_dump_completed(result, !!local_err, (local_err ?
                                    error_get_pretty(local_err) : NULL));
     qapi_free_DumpQueryResult(result);
 
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7dc96abf72..cca5316256 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1186,7 +1186,7 @@ static void create_smmu(const VirtMachineState *vms,
     g_free(node);
 }
 
-static void create_virtio_iommu_dt_bindings(VirtMachineState *vms, Error **errp)
+static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
 {
     const char compat[] = "virtio,pci-iommu";
     uint16_t bdf = vms->virtio_iommu_bdf;
@@ -2118,7 +2118,7 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
 
         vms->iommu = VIRT_IOMMU_VIRTIO;
         vms->virtio_iommu_bdf = pci_get_bdf(pdev);
-        create_virtio_iommu_dt_bindings(vms, errp);
+        create_virtio_iommu_dt_bindings(vms);
     }
 }
 
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 33bc9e2f92..9628cc171e 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2615,6 +2615,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
 
     if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
         error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
+        return;
     }
 
     /* Fill 'command_to_handler' lookup table */
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 70eb619ef4..e763a0a72d 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -267,16 +267,18 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp)
     Object *obj = OBJECT(dev);
     int ret;
 
-    s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s);
-
     if (s->vgamem < 4 * MiB) {
         error_setg(errp, "bochs-display: video memory too small");
+        return;
     }
     if (s->vgamem > 256 * MiB) {
         error_setg(errp, "bochs-display: video memory too big");
+        return;
     }
     s->vgamem = pow2ceil(s->vgamem);
 
+    s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s);
+
     memory_region_init_ram(&s->vram, obj, "bochs-display-vram", s->vgamem,
                            &error_fatal);
     memory_region_init_io(&s->vbe, obj, &bochs_display_vbe_ops, s,
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index 5adf3b15b5..e199fc8678 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -195,8 +195,7 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,
 }
 
 /* Generate SDRAM SPD EEPROM data describing a module of type and size */
-uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size,
-                           Error **errp)
+uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size)
 {
     uint8_t *spd;
     uint8_t nbanks;
@@ -222,39 +221,18 @@ uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size,
         g_assert_not_reached();
     }
     size = ram_size >> 20; /* work in terms of megabytes */
-    if (size < 4) {
-        error_setg(errp, "SDRAM size is too small");
-        return NULL;
-    }
     sz_log2 = 31 - clz32(size);
     size = 1U << sz_log2;
-    if (ram_size > size * MiB) {
-        error_setg(errp, "SDRAM size 0x"RAM_ADDR_FMT" is not a power of 2, "
-                   "truncating to %u MB", ram_size, size);
-    }
-    if (sz_log2 < min_log2) {
-        error_setg(errp,
-                   "Memory size is too small for SDRAM type, adjusting type");
-        if (size >= 32) {
-            type = DDR;
-            min_log2 = 5;
-            max_log2 = 12;
-        } else {
-            type = SDR;
-            min_log2 = 2;
-            max_log2 = 9;
-        }
-    }
+    assert(ram_size == size * MiB);
+    assert(sz_log2 >= min_log2);
 
     nbanks = 1;
     while (sz_log2 > max_log2 && nbanks < 8) {
         sz_log2--;
-        nbanks++;
+        nbanks *= 2;
     }
 
-    if (size > (1ULL << sz_log2) * nbanks) {
-        error_setg(errp, "Memory size is too big for SDRAM, truncating");
-    }
+    assert(size == (1ULL << sz_log2) * nbanks);
 
     /* split to 2 banks if possible to avoid a bug in MIPS Malta firmware */
     if (nbanks == 1 && sz_log2 > min_log2) {
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 5040afd581..ef02d54b33 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -297,7 +297,6 @@ static void mips_fulong2e_init(MachineState *machine)
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     long bios_size;
     uint8_t *spd_data;
-    Error *err = NULL;
     int64_t kernel_entry;
     PCIBus *pci_bus;
     ISABus *isa_bus;
@@ -377,13 +376,8 @@ static void mips_fulong2e_init(MachineState *machine)
     }
 
     /* Populate SPD eeprom data */
-    spd_data = spd_data_generate(DDR, machine->ram_size, &err);
-    if (err) {
-        warn_report_err(err);
-    }
-    if (spd_data) {
-        smbus_eeprom_init_one(smbus, 0x50, spd_data);
-    }
+    spd_data = spd_data_generate(DDR, machine->ram_size);
+    smbus_eeprom_init_one(smbus, 0x50, spd_data);
 
     mc146818_rtc_init(isa_bus, 2000, NULL);
 
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index a46e3b37a7..65bb6886c7 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1526,7 +1526,7 @@ static void virtio_net_rsc_extract_unit6(VirtioNetRscChain *chain,
                                  + sizeof(struct eth_header));
     unit->ip = ip6;
     unit->ip_plen = &(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen);
-    unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)\
+    unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)
                                         + sizeof(struct ip6_header));
     unit->tcp_hdrlen = (htons(unit->tcp->th_offset_flags) & 0xF000) >> 10;
 
@@ -2947,6 +2947,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
             n->net_conf.duplex = DUPLEX_FULL;
         } else {
             error_setg(errp, "'duplex' must be 'half' or 'full'");
+            return;
         }
         n->host_features |= (1ULL << VIRTIO_NET_F_SPEED_DUPLEX);
     } else {
@@ -2955,7 +2956,9 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
 
     if (n->net_conf.speed < SPEED_UNKNOWN) {
         error_setg(errp, "'speed' must be between 0 and INT_MAX");
-    } else if (n->net_conf.speed >= 0) {
+        return;
+    }
+    if (n->net_conf.speed >= 0) {
         n->host_features |= (1ULL << VIRTIO_NET_F_SPEED_DUPLEX);
     }
 
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index 3376c43ff5..f1651e04d9 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -716,11 +716,11 @@ void ppc4xx_sdram_banks(MemoryRegion *ram, int nr_banks,
         for (i = 0; sdram_bank_sizes[i]; i++) {
             g_string_append_printf(s, "%" PRIi64 "%s",
                                    sdram_bank_sizes[i] / MiB,
-                                   sdram_bank_sizes[i + 1] ? " ," : "");
+                                   sdram_bank_sizes[i + 1] ? ", " : "");
         }
-        error_report("Max %d banks of %s MB DIMM/bank supported",
-            nr_banks, s->str);
-        error_report("Possible valid RAM size: %" PRIi64,
+        error_report("at most %d bank%s of %s MiB each supported",
+                     nr_banks, nr_banks == 1 ? "" : "s", s->str);
+        error_printf("Possible valid RAM size: %" PRIi64 " MiB \n",
             used_size ? used_size / MiB : sdram_bank_sizes[i - 1] / MiB);
 
         g_string_free(s, true);
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 898453cf30..42a8c9fb7f 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -292,7 +292,6 @@ static void sam460ex_init(MachineState *machine)
     SysBusDevice *sbdev;
     struct boot_info *boot_info;
     uint8_t *spd_data;
-    Error *err = NULL;
     int success;
 
     cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
@@ -335,14 +334,10 @@ static void sam460ex_init(MachineState *machine)
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600700, uic[0][2]);
     i2c = PPC4xx_I2C(dev)->bus;
     /* SPD EEPROM on RAM module */
-    spd_data = spd_data_generate(DDR2, ram_sizes[0], &err);
-    if (err) {
-        warn_report_err(err);
-    }
-    if (spd_data) {
-        spd_data[20] = 4; /* SO-DIMM module */
-        smbus_eeprom_init_one(i2c, 0x50, spd_data);
-    }
+    spd_data = spd_data_generate(ram_sizes[0] < 128 * MiB ? DDR : DDR2,
+                                 ram_sizes[0]);
+    spd_data[20] = 4; /* SO-DIMM module */
+    smbus_eeprom_init_one(i2c, 0x50, spd_data);
     /* RTC */
     i2c_create_slave(i2c, "m41t80", 0x68);
 
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 56351c4faa..998666c91f 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -465,7 +465,7 @@ static void riscv_sifive_u_machine_instance_init(Object *obj)
     object_property_add_bool(obj, "start-in-flash", sifive_u_get_start_in_flash,
                              sifive_u_set_start_in_flash, NULL);
     object_property_set_description(obj, "start-in-flash",
-                                    "Set on to tell QEMU's ROM to jump to " \
+                                    "Set on to tell QEMU's ROM to jump to "
                                     "flash. Otherwise QEMU will jump to DRAM",
                                     NULL);
 }
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 1c0cb63a6f..e5bcd0baf8 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -3078,7 +3078,7 @@ static const TypeInfo scsi_cd_info = {
 
 #ifdef __linux__
 static Property scsi_block_properties[] = {
-    DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),         \
+    DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),
     DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
     DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
     DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index de63ffb037..70531ad360 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1130,7 +1130,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
 
         /* Limit block size to the maximum buffer size */
         if (extract32(s->blksize, 0, 12) > s->buf_maxsz) {
-            qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than " \
+            qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than "
                           "the maximum buffer 0x%x", __func__, s->blksize,
                           s->buf_maxsz);
 
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index b91082cb8b..81d5ad8da7 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -858,8 +858,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
 
     rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
     if (rc < 0) {
-        error_setg_errno(errp, errno, "Mapping machine irq %u to"
-                         " pirq %i failed", machine_irq, pirq);
+        XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: %d)\n",
+                   machine_irq, pirq, errno);
 
         /* Disable PCI intx assertion (turn on bit10 of devctl) */
         cmd |= PCI_COMMAND_INTX_DISABLE;
@@ -880,8 +880,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
                                        PCI_SLOT(d->devfn),
                                        e_intx);
         if (rc < 0) {
-            error_setg_errno(errp, errno, "Binding of interrupt %u failed",
-                             e_intx);
+            XEN_PT_ERR(d, "Binding of interrupt %i failed! (err: %d)\n",
+                       e_intx, errno);
 
             /* Disable PCI intx assertion (turn on bit10 of devctl) */
             cmd |= PCI_COMMAND_INTX_DISABLE;
@@ -889,8 +889,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
 
             if (xen_pt_mapped_machine_irq[machine_irq] == 0) {
                 if (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq)) {
-                    error_setg_errno(errp, errno, "Unmapping of machine"
-                            " interrupt %u failed", machine_irq);
+                    XEN_PT_ERR(d, "Unmapping of machine interrupt %i failed!"
+                               " (err: %d)\n", machine_irq, errno);
                 }
             }
             s->machine_irq = 0;
diff --git a/include/hw/i2c/smbus_eeprom.h b/include/hw/i2c/smbus_eeprom.h
index 15e2151b50..68b0063ab6 100644
--- a/include/hw/i2c/smbus_eeprom.h
+++ b/include/hw/i2c/smbus_eeprom.h
@@ -31,6 +31,6 @@ void smbus_eeprom_init(I2CBus *bus, int nb_eeprom,
                        const uint8_t *eeprom_spd, int size);
 
 enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 };
-uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size, Error **errp);
+uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size);
 
 #endif
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 844587cab3..eb4097889d 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -33,7 +33,6 @@ const char *get_opt_value(const char *p, char **value);
 void parse_option_size(const char *name, const char *value,
                        uint64_t *ret, Error **errp);
 bool has_help_option(const char *param);
-bool is_valid_option_list(const char *param);
 
 enum QemuOptType {
     QEMU_OPT_STRING = 0,  /* no parsing (use string as-is)                        */
diff --git a/io/channel-socket.c b/io/channel-socket.c
index b74f5b92a0..e1b4667087 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -704,6 +704,7 @@ qio_channel_socket_close(QIOChannel *ioc,
 {
     QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
     int rc = 0;
+    Error *err = NULL;
 
     if (sioc->fd != -1) {
 #ifdef WIN32
@@ -715,8 +716,8 @@ qio_channel_socket_close(QIOChannel *ioc,
 
         if (closesocket(sioc->fd) < 0) {
             sioc->fd = -1;
-            error_setg_errno(errp, errno,
-                             "Unable to close socket");
+            error_setg_errno(&err, errno, "Unable to close socket");
+            error_propagate(errp, err);
             return -1;
         }
         sioc->fd = -1;
diff --git a/migration/colo.c b/migration/colo.c
index a54ac84f41..1b3493729b 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -263,7 +263,13 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 
 void qmp_xen_colo_do_checkpoint(Error **errp)
 {
-    replication_do_checkpoint_all(errp);
+    Error *err = NULL;
+
+    replication_do_checkpoint_all(&err);
+    if (err) {
+        error_propagate(errp, err);
+        return;
+    }
     /* Notify all filters of all NIC to do checkpoint */
     colo_notify_filters_event(COLO_EVENT_CHECKPOINT, errp);
 }
diff --git a/qemu-img.c b/qemu-img.c
index 821cbf610e..a2369766f0 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -223,6 +223,53 @@ static bool qemu_img_object_print_help(const char *type, QemuOpts *opts)
     return true;
 }
 
+/*
+ * Is @optarg safe for accumulate_options()?
+ * It is when multiple of them can be joined together separated by ','.
+ * To make that work, @optarg must not start with ',' (or else a
+ * separating ',' preceding it gets escaped), and it must not end with
+ * an odd number of ',' (or else a separating ',' following it gets
+ * escaped), or be empty (or else a separating ',' preceding it can
+ * escape a separating ',' following it).
+ * 
+ */
+static bool is_valid_option_list(const char *optarg)
+{
+    size_t len = strlen(optarg);
+    size_t i;
+
+    if (!optarg[0] || optarg[0] == ',') {
+        return false;
+    }
+
+    for (i = len; i > 0 && optarg[i - 1] == ','; i--) {
+    }
+    if ((len - i) % 2) {
+        return false;
+    }
+
+    return true;
+}
+
+static int accumulate_options(char **options, char *optarg)
+{
+    char *new_options;
+
+    if (!is_valid_option_list(optarg)) {
+        error_report("Invalid option list: %s", optarg);
+        return -1;
+    }
+
+    if (!*options) {
+        *options = g_strdup(optarg);
+    } else {
+        new_options = g_strdup_printf("%s,%s", *options, optarg);
+        g_free(*options);
+        *options = new_options;
+    }
+    return 0;
+}
+
 static QemuOptsList qemu_source_opts = {
     .name = "source",
     .implied_opt_name = "file",
@@ -482,17 +529,9 @@ static int img_create(int argc, char **argv)
             fmt = optarg;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto fail;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'q':
             quiet = true;
@@ -2127,17 +2166,9 @@ static int img_convert(int argc, char **argv)
             s.compressed = true;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto fail_getopt;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
@@ -3953,18 +3984,10 @@ static int img_amend(int argc, char **argv)
             help();
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 ret = -1;
                 goto out_no_progress;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'f':
             fmt = optarg;
@@ -4855,17 +4878,9 @@ static int img_measure(int argc, char **argv)
             out_fmt = optarg;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto out;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index a52af0315f..ae1348dc8f 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2518,6 +2518,9 @@ GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp)
         mem_blk->phys_index = strtoul(&de->d_name[6], NULL, 10);
         mem_blk->has_can_offline = true; /* lolspeak ftw */
         transfer_memory_block(mem_blk, true, NULL, &local_err);
+        if (local_err) {
+            break;
+        }
 
         entry = g_malloc0(sizeof *entry);
         entry->value = mem_blk;
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 9717a8d52d..5ba56327dd 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -1322,9 +1322,16 @@ void qmp_guest_suspend_disk(Error **errp)
 
     *mode = GUEST_SUSPEND_MODE_DISK;
     check_suspend_mode(*mode, &local_err);
+    if (local_err) {
+        goto out;
+    }
     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
+    if (local_err) {
+        goto out;
+    }
     execute_async(do_suspend, mode, &local_err);
 
+out:
     if (local_err) {
         error_propagate(errp, local_err);
         g_free(mode);
@@ -1338,9 +1345,16 @@ void qmp_guest_suspend_ram(Error **errp)
 
     *mode = GUEST_SUSPEND_MODE_RAM;
     check_suspend_mode(*mode, &local_err);
+    if (local_err) {
+        goto out;
+    }
     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
+    if (local_err) {
+        goto out;
+    }
     execute_async(do_suspend, mode, &local_err);
 
+out:
     if (local_err) {
         error_propagate(errp, local_err);
         g_free(mode);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 32c0047889..afd2615fb3 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3059,19 +3059,19 @@ void qemu_init(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_kernel:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "kernel", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "kernel", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_initrd:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "initrd", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "initrd", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_append:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "append", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "append", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_dtb:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "dtb", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "dtb", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_cdrom:
@@ -3182,7 +3182,7 @@ void qemu_init(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_bios:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "firmware", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_singlestep:
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 90ffc5f3b1..9c256ab159 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5784,9 +5784,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             host_cpuid(index, 0, eax, ebx, ecx, edx);
             break;
         }
-        *eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) | \
+        *eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) |
                (L1_ITLB_2M_ASSOC <<  8) | (L1_ITLB_2M_ENTRIES);
-        *ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) | \
+        *ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) |
                (L1_ITLB_4K_ASSOC <<  8) | (L1_ITLB_4K_ENTRIES);
         *ecx = encode_cache_cpuid80000005(env->cache_info_amd.l1d_cache);
         *edx = encode_cache_cpuid80000005(env->cache_info_amd.l1i_cache);
@@ -5797,13 +5797,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             host_cpuid(index, 0, eax, ebx, ecx, edx);
             break;
         }
-        *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) | \
-               (L2_DTLB_2M_ENTRIES << 16) | \
-               (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) | \
+        *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) |
+               (L2_DTLB_2M_ENTRIES << 16) |
+               (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) |
                (L2_ITLB_2M_ENTRIES);
-        *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) | \
-               (L2_DTLB_4K_ENTRIES << 16) | \
-               (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) | \
+        *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) |
+               (L2_DTLB_4K_ENTRIES << 16) |
+               (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) |
                (L2_ITLB_4K_ENTRIES);
         encode_cache_cpuid80000006(env->cache_info_amd.l2_cache,
                                    cpu->enable_l3_cache ?
@@ -6326,7 +6326,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
              */
             env->features[w] |=
                 x86_cpu_get_supported_feature_word(w, cpu->migratable) &
-                ~env->user_features[w] & \
+                ~env->user_features[w] &
                 ~feature_word_info[w].no_autoenable_flags;
         }
     }
diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index a2c2f271df..c9cf2364ca 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -163,14 +163,14 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
 
     qemu_init_vcpu(cs);
 
-    env->pvr.regs[0] = PVR0_USE_EXC_MASK \
-                       | PVR0_USE_ICACHE_MASK \
+    env->pvr.regs[0] = PVR0_USE_EXC_MASK
+                       | PVR0_USE_ICACHE_MASK
                        | PVR0_USE_DCACHE_MASK;
-    env->pvr.regs[2] = PVR2_D_OPB_MASK \
-                        | PVR2_D_LMB_MASK \
-                        | PVR2_I_OPB_MASK \
-                        | PVR2_I_LMB_MASK \
-                        | PVR2_FPU_EXC_MASK \
+    env->pvr.regs[2] = PVR2_D_OPB_MASK
+                        | PVR2_D_LMB_MASK
+                        | PVR2_I_OPB_MASK
+                        | PVR2_I_LMB_MASK
+                        | PVR2_FPU_EXC_MASK
                         | 0;
 
     version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION;
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index e853164a86..fd763e588e 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -5210,7 +5210,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data)
                        PPC_FLOAT_STFIWX | PPC_WAIT |
                        PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
                        PPC_64B | PPC_POPCNTB | PPC_POPCNTWD;
-    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \
+    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
                         PPC2_FP_CVT_S64;
     pcc->msr_mask = (1ull << MSR_CM) |
                     (1ull << MSR_GS) |
@@ -5258,7 +5258,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, void *data)
                        PPC_FLOAT_STFIWX | PPC_WAIT |
                        PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
                        PPC_64B | PPC_POPCNTB | PPC_POPCNTWD | PPC_ALTIVEC;
-    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \
+    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
                         PPC2_FP_CVT_S64 | PPC2_ATOMIC_ISA206;
     pcc->msr_mask = (1ull << MSR_CM) |
                     (1ull << MSR_GS) |
diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c
index af28c92866..87eadb0889 100644
--- a/tests/qtest/fuzz/qos_fuzz.c
+++ b/tests/qtest/fuzz/qos_fuzz.c
@@ -36,7 +36,6 @@
 
 #include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-qom.h"
-#include "qapi/qmp/qlist.h"
 
 
 void *fuzz_qos_obj;
@@ -45,34 +44,19 @@ QGuestAllocator *fuzz_qos_alloc;
 static const char *fuzz_target_name;
 static char **fuzz_path_vec;
 
-/*
- * Replaced the qmp commands with direct qmp_marshal calls.
- * Probably there is a better way to do this
- */
 static void qos_set_machines_devices_available(void)
 {
-    QDict *req = qdict_new();
-    QObject *response;
-    QDict *args = qdict_new();
-    QList *lst;
-
-    qmp_marshal_query_machines(NULL, &response, &error_abort);
-    lst = qobject_to(QList, response);
-    apply_to_qlist(lst, true);
-
-    qobject_unref(response);
-
+    MachineInfoList *mach_info;
+    ObjectTypeInfoList *type_info;
 
-    qdict_put_str(req, "execute", "qom-list-types");
-    qdict_put_str(args, "implements", "device");
-    qdict_put_bool(args, "abstract", true);
-    qdict_put_obj(req, "arguments", (QObject *) args);
+    mach_info = qmp_query_machines(&error_abort);
+    machines_apply_to_node(mach_info);
+    qapi_free_MachineInfoList(mach_info);
 
-    qmp_marshal_qom_list_types(args, &response, &error_abort);
-    lst = qobject_to(QList, response);
-    apply_to_qlist(lst, false);
-    qobject_unref(response);
-    qobject_unref(req);
+    type_info = qmp_qom_list_types(true, "device", true, true,
+                                   &error_abort);
+    types_apply_to_node(type_info);
+    qapi_free_ObjectTypeInfoList(type_info);
 }
 
 static char **current_path;
diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_external.c
index 398556dde0..9f5180e18d 100644
--- a/tests/qtest/libqos/qos_external.c
+++ b/tests/qtest/libqos/qos_external.c
@@ -29,66 +29,44 @@
 #include "libqos/qgraph_internal.h"
 #include "libqos/qos_external.h"
 
+static void machine_apply_to_node(const char *name)
+{
+    char *machine_name = g_strconcat(qtest_get_arch(), "/", name, NULL);
 
+    qos_graph_node_set_availability(machine_name, true);
+    g_free(machine_name);
+}
 
-void apply_to_node(const char *name, bool is_machine, bool is_abstract)
+void machines_apply_to_node(MachineInfoList *mach_info)
 {
-    char *machine_name = NULL;
-    if (is_machine) {
-        const char *arch = qtest_get_arch();
-        machine_name = g_strconcat(arch, "/", name, NULL);
-        name = machine_name;
+    MachineInfoList *tail;
+
+    for (tail = mach_info; tail; tail = tail->next) {
+        machine_apply_to_node(tail->value->name);
+        if (tail->value->alias) {
+            machine_apply_to_node(tail->value->alias);
+        }
     }
+}
+
+static void type_apply_to_node(const char *name, bool is_abstract)
+{
     qos_graph_node_set_availability(name, true);
     if (is_abstract) {
         qos_delete_cmd_line(name);
     }
-    g_free(machine_name);
 }
 
-/**
- * apply_to_qlist(): using QMP queries QEMU for a list of
- * machines and devices available, and sets the respective node
- * as true. If a node is found, also all its produced and contained
- * child are marked available.
- *
- * See qos_graph_node_set_availability() for more info
- */
-void apply_to_qlist(QList *list, bool is_machine)
+void types_apply_to_node(ObjectTypeInfoList *type_info)
 {
-    const QListEntry *p;
-    const char *name;
-    bool abstract;
-    QDict *minfo;
-    QObject *qobj;
-    QString *qstr;
-    QBool *qbool;
-
-    for (p = qlist_first(list); p; p = qlist_next(p)) {
-        minfo = qobject_to(QDict, qlist_entry_obj(p));
-        qobj = qdict_get(minfo, "name");
-        qstr = qobject_to(QString, qobj);
-        name = qstring_get_str(qstr);
-
-        qobj = qdict_get(minfo, "abstract");
-        if (qobj) {
-            qbool = qobject_to(QBool, qobj);
-            abstract = qbool_get_bool(qbool);
-        } else {
-            abstract = false;
-        }
+    ObjectTypeInfoList *tail;
 
-        apply_to_node(name, is_machine, abstract);
-        qobj = qdict_get(minfo, "alias");
-        if (qobj) {
-            qstr = qobject_to(QString, qobj);
-            name = qstring_get_str(qstr);
-            apply_to_node(name, is_machine, abstract);
-        }
+    for (tail = type_info; tail; tail = tail->next) {
+        type_apply_to_node(tail->value->name, tail->value->abstract);
     }
 }
 
-QGuestAllocator *get_machine_allocator(QOSGraphObject *obj)
+static QGuestAllocator *get_machine_allocator(QOSGraphObject *obj)
 {
     return obj->get_driver(obj, "memory");
 }
diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_external.h
index 7b44930c55..72d7f91707 100644
--- a/tests/qtest/libqos/qos_external.h
+++ b/tests/qtest/libqos/qos_external.h
@@ -18,11 +18,13 @@
 
 #ifndef QOS_EXTERNAL_H
 #define QOS_EXTERNAL_H
-#include "libqos/qgraph.h"
 
-void apply_to_node(const char *name, bool is_machine, bool is_abstract);
-void apply_to_qlist(QList *list, bool is_machine);
-QGuestAllocator *get_machine_allocator(QOSGraphObject *obj);
+#include "libqos/malloc.h"
+#include "qapi/qapi-types-machine.h"
+#include "qapi/qapi-types-qom.h"
+
+void machines_apply_to_node(MachineInfoList *mach_info);
+void types_apply_to_node(ObjectTypeInfoList *type_info);
 void *allocate_objects(QTestState *qts, char **path, QGuestAllocator **p_alloc);
 
 #endif
diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c
index ad193f43a5..3062a13557 100644
--- a/tests/qtest/qos-test.c
+++ b/tests/qtest/qos-test.c
@@ -19,11 +19,12 @@
 #include "qemu/osdep.h"
 #include <getopt.h>
 #include "libqtest-single.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qstring.h"
 #include "qemu/module.h"
-#include "qapi/qmp/qlist.h"
+#include "qapi/qobject-input-visitor.h"
+#include "qapi/qapi-visit-machine.h"
+#include "qapi/qapi-visit-qom.h"
 #include "libqos/malloc.h"
 #include "libqos/qgraph.h"
 #include "libqos/qgraph_internal.h"
@@ -51,13 +52,20 @@ static void qos_set_machines_devices_available(void)
 {
     QDict *response;
     QDict *args = qdict_new();
-    QList *list;
+    QObject *ret;
+    Visitor *v;
+    MachineInfoList *mach_info;
+    ObjectTypeInfoList *type_info;
 
     qtest_start("-machine none");
     response = qmp("{ 'execute': 'query-machines' }");
-    list = qdict_get_qlist(response, "return");
+    ret = qdict_get(response, "return");
 
-    apply_to_qlist(list, true);
+    v = qobject_input_visitor_new(ret);
+    visit_type_MachineInfoList(v, NULL, &mach_info, &error_abort);
+    visit_free(v);
+    machines_apply_to_node(mach_info);
+    qapi_free_MachineInfoList(mach_info);
 
     qobject_unref(response);
 
@@ -66,10 +74,13 @@ static void qos_set_machines_devices_available(void)
 
     response = qmp("{'execute': 'qom-list-types',"
                    " 'arguments': %p }", args);
-    g_assert(qdict_haskey(response, "return"));
-    list = qdict_get_qlist(response, "return");
+    ret = qdict_get(response, "return");
 
-    apply_to_qlist(list, false);
+    v = qobject_input_visitor_new(ret);
+    visit_type_ObjectTypeInfoList(v, NULL, &type_info, &error_abort);
+    visit_free(v);
+    types_apply_to_node(type_info);
+    qapi_free_ObjectTypeInfoList(type_info);
 
     qtest_end();
     qobject_unref(response);
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 6387e4933f..8580b82420 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -73,10 +73,10 @@ static void test_parse_range(void)
     g_assert(qemu_log_in_addr_range(UINT64_MAX));
     g_assert_false(qemu_log_in_addr_range(UINT64_MAX - 1));
 
-    qemu_set_dfilter_ranges("0..0xffffffffffffffff", &err);
+    qemu_set_dfilter_ranges("0..0xffffffffffffffff", &error_abort);
     g_assert(qemu_log_in_addr_range(0));
     g_assert(qemu_log_in_addr_range(UINT64_MAX));
- 
+
     qemu_set_dfilter_ranges("2..1", &err);
     error_free_or_abort(&err);
 
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index ef96e84aed..2a0f42a09b 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -500,10 +500,10 @@ static void test_opts_parse(void)
     g_assert(!opts);
     /* TODO Cover .merge_lists = true */
 
-    /* Buggy ID recognition */
+    /* Buggy ID recognition (fixed) */
     opts = qemu_opts_parse(&opts_list_03, "x=,,id=bar", false, &error_abort);
     g_assert_cmpuint(opts_count(opts), ==, 1);
-    g_assert_cmpstr(qemu_opts_id(opts), ==, "bar"); /* BUG */
+    g_assert(!qemu_opts_id(opts));
     g_assert_cmpstr(qemu_opt_get(opts, "x"), ==, ",id=bar");
 
     /* Anti-social ID */
@@ -728,6 +728,47 @@ static void test_opts_parse_size(void)
     qemu_opts_reset(&opts_list_02);
 }
 
+static void test_has_help_option(void)
+{
+    static const struct {
+        const char *params;
+        /* expected value of qemu_opt_has_help_opt() with implied=false */
+        bool expect;
+        /* expected value of qemu_opt_has_help_opt() with implied=true */
+        bool expect_implied;
+    } test[] = {
+        { "help", true, false },
+        { "?", true, false },
+        { "helpme", false, false },
+        { "?me", false, false },
+        { "a,help", true, true },
+        { "a,?", true, true },
+        { "a=0,help,b", true, true },
+        { "a=0,?,b", true, true },
+        { "help,b=1", true, false },
+        { "?,b=1", true, false },
+        { "a,b,,help", true, true },
+        { "a,b,,?", true, true },
+    };
+    int i;
+    QemuOpts *opts;
+
+    for (i = 0; i < ARRAY_SIZE(test); i++) {
+        g_assert_cmpint(has_help_option(test[i].params),
+                        ==, test[i].expect);
+        opts = qemu_opts_parse(&opts_list_03, test[i].params, false,
+                               &error_abort);
+        g_assert_cmpint(qemu_opt_has_help_opt(opts),
+                        ==, test[i].expect);
+        qemu_opts_del(opts);
+        opts = qemu_opts_parse(&opts_list_03, test[i].params, true,
+                               &error_abort);
+        g_assert_cmpint(qemu_opt_has_help_opt(opts),
+                        ==, test[i].expect_implied);
+        qemu_opts_del(opts);
+    }
+}
+
 static void append_verify_list_01(QemuOptDesc *desc, bool with_overlapping)
 {
     int i = 0;
@@ -990,6 +1031,7 @@ int main(int argc, char *argv[])
     g_test_add_func("/qemu-opts/opts_parse/bool", test_opts_parse_bool);
     g_test_add_func("/qemu-opts/opts_parse/number", test_opts_parse_number);
     g_test_add_func("/qemu-opts/opts_parse/size", test_opts_parse_size);
+    g_test_add_func("/qemu-opts/has_help_option", test_has_help_option);
     g_test_add_func("/qemu-opts/append_to_null", test_opts_append_to_null);
     g_test_add_func("/qemu-opts/append", test_opts_append);
     g_test_add_func("/qemu-opts/to_qdict/basic", test_opts_to_qdict_basic);
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 97172b5eaa..9542988183 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -165,48 +165,6 @@ void parse_option_size(const char *name, const char *value,
     *ret = size;
 }
 
-bool has_help_option(const char *param)
-{
-    const char *p = param;
-    bool result = false;
-
-    while (*p && !result) {
-        char *value;
-
-        p = get_opt_value(p, &value);
-        if (*p) {
-            p++;
-        }
-
-        result = is_help_option(value);
-        g_free(value);
-    }
-
-    return result;
-}
-
-bool is_valid_option_list(const char *p)
-{
-    char *value = NULL;
-    bool result = false;
-
-    while (*p) {
-        p = get_opt_value(p, &value);
-        if ((*p && !*++p) ||
-            (!*value || *value == ',')) {
-            goto out;
-        }
-
-        g_free(value);
-        value = NULL;
-    }
-
-    result = true;
-out:
-    g_free(value);
-    return result;
-}
-
 static const char *opt_type_to_string(enum QemuOptType type)
 {
     switch (type) {
@@ -539,7 +497,7 @@ int qemu_opt_unset(QemuOpts *opts, const char *name)
 }
 
 static void opt_set(QemuOpts *opts, const char *name, char *value,
-                    bool prepend, bool *invalidp, Error **errp)
+                    bool prepend, bool *help_wanted, Error **errp)
 {
     QemuOpt *opt;
     const QemuOptDesc *desc;
@@ -549,8 +507,8 @@ static void opt_set(QemuOpts *opts, const char *name, char *value,
     if (!desc && !opts_accepts_any(opts)) {
         g_free(value);
         error_setg(errp, QERR_INVALID_PARAMETER, name);
-        if (invalidp) {
-            *invalidp = true;
+        if (help_wanted && is_help_option(name)) {
+            *help_wanted = true;
         }
         return;
     }
@@ -805,61 +763,108 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
     }
 }
 
+static const char *get_opt_name_value(const char *params,
+                                      const char *firstname,
+                                      char **name, char **value)
+{
+    const char *p, *pe, *pc;
+
+    pe = strchr(params, '=');
+    pc = strchr(params, ',');
+
+    if (!pe || (pc && pc < pe)) {
+        /* found "foo,more" */
+        if (firstname) {
+            /* implicitly named first option */
+            *name = g_strdup(firstname);
+            p = get_opt_value(params, value);
+        } else {
+            /* option without value, must be a flag */
+            p = get_opt_name(params, name, ',');
+            if (strncmp(*name, "no", 2) == 0) {
+                memmove(*name, *name + 2, strlen(*name + 2) + 1);
+                *value = g_strdup("off");
+            } else {
+                *value = g_strdup("on");
+            }
+        }
+    } else {
+        /* found "foo=bar,more" */
+        p = get_opt_name(params, name, '=');
+        assert(*p == '=');
+        p++;
+        p = get_opt_value(p, value);
+    }
+
+    assert(!*p || *p == ',');
+    if (*p == ',') {
+        p++;
+    }
+    return p;
+}
+
 static void opts_do_parse(QemuOpts *opts, const char *params,
                           const char *firstname, bool prepend,
-                          bool *invalidp, Error **errp)
+                          bool *help_wanted, Error **errp)
 {
-    char *option = NULL;
-    char *value = NULL;
-    const char *p,*pe,*pc;
     Error *local_err = NULL;
+    char *option, *value;
+    const char *p;
 
-    for (p = params; *p != '\0'; p++) {
-        pe = strchr(p, '=');
-        pc = strchr(p, ',');
-        if (!pe || (pc && pc < pe)) {
-            /* found "foo,more" */
-            if (p == params && firstname) {
-                /* implicitly named first option */
-                option = g_strdup(firstname);
-                p = get_opt_value(p, &value);
-            } else {
-                /* option without value, probably a flag */
-                p = get_opt_name(p, &option, ',');
-                if (strncmp(option, "no", 2) == 0) {
-                    memmove(option, option+2, strlen(option+2)+1);
-                    value = g_strdup("off");
-                } else {
-                    value = g_strdup("on");
-                }
-            }
-        } else {
-            /* found "foo=bar,more" */
-            p = get_opt_name(p, &option, '=');
-            assert(*p == '=');
-            p++;
-            p = get_opt_value(p, &value);
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, firstname, &option, &value);
+        firstname = NULL;
+
+        if (!strcmp(option, "id")) {
+            g_free(option);
+            g_free(value);
+            continue;
         }
-        if (strcmp(option, "id") != 0) {
-            /* store and parse */
-            opt_set(opts, option, value, prepend, invalidp, &local_err);
-            value = NULL;
-            if (local_err) {
-                error_propagate(errp, local_err);
-                goto cleanup;
-            }
+
+        opt_set(opts, option, value, prepend, help_wanted, &local_err);
+        g_free(option);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            return;
         }
-        if (*p != ',') {
-            break;
+    }
+}
+
+static char *opts_parse_id(const char *params)
+{
+    const char *p;
+    char *name, *value;
+
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, NULL, &name, &value);
+        if (!strcmp(name, "id")) {
+            g_free(name);
+            return value;
         }
-        g_free(option);
+        g_free(name);
         g_free(value);
-        option = value = NULL;
     }
 
- cleanup:
-    g_free(option);
-    g_free(value);
+    return NULL;
+}
+
+bool has_help_option(const char *params)
+{
+    const char *p;
+    char *name, *value;
+    bool ret;
+
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, NULL, &name, &value);
+        ret = is_help_option(name);
+        g_free(name);
+        g_free(value);
+        if (ret) {
+            return true;
+        }
+    }
+
+    return false;
 }
 
 /**
@@ -876,23 +881,16 @@ void qemu_opts_do_parse(QemuOpts *opts, const char *params,
 
 static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
                             bool permit_abbrev, bool defaults,
-                            bool *invalidp, Error **errp)
+                            bool *help_wanted, Error **errp)
 {
     const char *firstname;
-    char *id = NULL;
-    const char *p;
+    char *id = opts_parse_id(params);
     QemuOpts *opts;
     Error *local_err = NULL;
 
     assert(!permit_abbrev || list->implied_opt_name);
     firstname = permit_abbrev ? list->implied_opt_name : NULL;
 
-    if (strncmp(params, "id=", 3) == 0) {
-        get_opt_value(params + 3, &id);
-    } else if ((p = strstr(params, ",id=")) != NULL) {
-        get_opt_value(p + 4, &id);
-    }
-
     /*
      * This code doesn't work for defaults && !list->merge_lists: when
      * params has no id=, and list has an element with !opts->id, it
@@ -908,7 +906,7 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
         return NULL;
     }
 
-    opts_do_parse(opts, params, firstname, defaults, invalidp, &local_err);
+    opts_do_parse(opts, params, firstname, defaults, help_wanted, &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
         qemu_opts_del(opts);
@@ -944,11 +942,11 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params,
 {
     Error *err = NULL;
     QemuOpts *opts;
-    bool invalidp = false;
+    bool help_wanted = false;
 
-    opts = opts_parse(list, params, permit_abbrev, false, &invalidp, &err);
+    opts = opts_parse(list, params, permit_abbrev, false, &help_wanted, &err);
     if (err) {
-        if (invalidp && has_help_option(params)) {
+        if (help_wanted) {
             qemu_opts_print_help(list, true);
             error_free(err);
         } else {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 17:44:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 17:44:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14553.35927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYByY-00007q-4X; Thu, 29 Oct 2020 17:44:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14553.35927; Thu, 29 Oct 2020 17:44:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYByY-00007i-1H; Thu, 29 Oct 2020 17:44:38 +0000
Received: by outflank-mailman (input) for mailman id 14553;
 Thu, 29 Oct 2020 17:44:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYByX-00007d-9g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 844bcab8-fba8-41ff-9b88-039ba74367cf;
 Thu, 29 Oct 2020 17:44:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYByV-0002dX-Py
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYByV-0000gE-P3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYByX-00007d-9g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:37 +0000
X-Inumbo-ID: 844bcab8-fba8-41ff-9b88-039ba74367cf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 844bcab8-fba8-41ff-9b88-039ba74367cf;
	Thu, 29 Oct 2020 17:44:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kpQaKLMfQckh9Ku5LAc9Z0jMpCTP+/eJx6ylb5zKPqg=; b=msQPRZwMXQfJr5inuQtdYqnlRA
	jgYjhfi/p0TxG92vBis16C87ie8jiycPaLgjjPQt32nDwtdEqJEmrdvxvEvb79ZK/ayhHy5oURLjq
	+yr1pvDh+GxTz1FNmMHqWaWTIDC4BO0Xr9dvKRb22YwcgeTHALsc7ql9s0IX7jSY+/s4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYByV-0002dX-Py
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYByV-0000gE-P3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:44:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/xtensa: work around missing SR definitions
Message-Id: <E1kYByV-0000gE-P3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 17:44:35 +0000

commit 59afd43daedabe672c289326a5f268f737d35252
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Tue Apr 28 15:59:08 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Thu Apr 30 04:37:36 2020 -0700

    target/xtensa: work around missing SR definitions
    
    Xtensa configuration overlays for recent releases may have special
    registers for which [rwx]sr opcodes are defined, but they are not listed
    as SR in xtensa_sysreg_name and associated functions. As a result
    generic translate_[rwx]sr* functions generate access to uninitialized
    cpu_SR causing segfault at runtime.
    Don't try to access cpu_SR for such registers, ignore writes and return
    0 for reads.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 48 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index e0beaf7abb..546d2fa2fa 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2191,7 +2191,11 @@ static void translate_rsil(DisasContext *dc, const OpcodeArg arg[],
 static void translate_rsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+    if (sr_name[par[0]]) {
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_rsr_ccount(DisasContext *dc, const OpcodeArg arg[],
@@ -2563,13 +2567,17 @@ static void translate_wrmsk_expstate(DisasContext *dc, const OpcodeArg arg[],
 static void translate_wsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
+    if (sr_name[par[0]]) {
+        tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
+    }
 }
 
 static void translate_wsr_mask(DisasContext *dc, const OpcodeArg arg[],
                                const uint32_t par[])
 {
-    tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, par[2]);
+    if (sr_name[par[0]]) {
+        tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, par[2]);
+    }
 }
 
 static void translate_wsr_acchi(DisasContext *dc, const OpcodeArg arg[],
@@ -2775,23 +2783,31 @@ static void translate_xor(DisasContext *dc, const OpcodeArg arg[],
 static void translate_xsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    TCGv_i32 tmp = tcg_temp_new_i32();
+    if (sr_name[par[0]]) {
+        TCGv_i32 tmp = tcg_temp_new_i32();
 
-    tcg_gen_mov_i32(tmp, arg[0].in);
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
-    tcg_gen_mov_i32(cpu_SR[par[0]], tmp);
-    tcg_temp_free(tmp);
+        tcg_gen_mov_i32(tmp, arg[0].in);
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+        tcg_gen_mov_i32(cpu_SR[par[0]], tmp);
+        tcg_temp_free(tmp);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_xsr_mask(DisasContext *dc, const OpcodeArg arg[],
                                const uint32_t par[])
 {
-    TCGv_i32 tmp = tcg_temp_new_i32();
+    if (sr_name[par[0]]) {
+        TCGv_i32 tmp = tcg_temp_new_i32();
 
-    tcg_gen_mov_i32(tmp, arg[0].in);
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
-    tcg_gen_andi_i32(cpu_SR[par[0]], tmp, par[2]);
-    tcg_temp_free(tmp);
+        tcg_gen_mov_i32(tmp, arg[0].in);
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+        tcg_gen_andi_i32(cpu_SR[par[0]], tmp, par[2]);
+        tcg_temp_free(tmp);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
@@ -2819,7 +2835,11 @@ static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
 { \
     TCGv_i32 tmp = tcg_temp_new_i32(); \
  \
-    tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
+    if (sr_name[par[0]]) { \
+        tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
+    } else { \
+        tcg_gen_movi_i32(tmp, 0); \
+    } \
     translate_wsr_##name(dc, arg, par); \
     tcg_gen_mov_i32(arg[0].out, tmp); \
     tcg_temp_free(tmp); \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 17:55:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 17:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14558.35943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYC9D-0001BS-6E; Thu, 29 Oct 2020 17:55:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14558.35943; Thu, 29 Oct 2020 17:55:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYC9D-0001BK-37; Thu, 29 Oct 2020 17:55:39 +0000
Received: by outflank-mailman (input) for mailman id 14558;
 Thu, 29 Oct 2020 17:55:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYC9C-0001BF-02
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 998d61cb-d677-451d-b2c0-456fa8fe2d77;
 Thu, 29 Oct 2020 17:55:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYC9A-0002uD-Nh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYC9A-000490-MF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYC9C-0001BF-02
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:38 +0000
X-Inumbo-ID: 998d61cb-d677-451d-b2c0-456fa8fe2d77
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 998d61cb-d677-451d-b2c0-456fa8fe2d77;
	Thu, 29 Oct 2020 17:55:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PbJUwvEUSyLufvbwhyaUmy7PRhxuE+uuYlNZfsls5Rs=; b=eLiPoM1AdDj2hh9u7Vm2Fg2M9g
	i6OkNlB9HQMMg2/qajXo6/bATi9PUh2n2955zy9bqXGrtaMfN93n6glNAQdTy7oCC2v7JsjDaDqYp
	ohWV8wLECpM5BqKa9U+gmpdvYseYOwcB+0/ynYkbQjRPPBupgnmcJyughupZ/rtm0pzM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYC9A-0002uD-Nh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYC9A-000490-MF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 17:55:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/xtensa: fetch HW version from configuration overlay
Message-Id: <E1kYC9A-000490-MF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 17:55:36 +0000

commit 2cc2278edf0403720397a33b0747e0aba9e6d420
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Mon May 4 04:30:45 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Sun May 17 14:52:25 2020 -0700

    target/xtensa: fetch HW version from configuration overlay
    
    Xtensa architecture has features which behavior depends on hardware
    version. Provide hardware version information to translators: add
    XtensaConfig::hw_version and use XCHAL_HW_VERSION from configuration
    overlay to initialize it.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/cpu.h          | 1 +
 target/xtensa/overlay_tool.h | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h
index 7a46dccbe1..32749378bf 100644
--- a/target/xtensa/cpu.h
+++ b/target/xtensa/cpu.h
@@ -464,6 +464,7 @@ struct XtensaConfig {
     XtensaMemory sysrom;
     XtensaMemory sysram;
 
+    unsigned hw_version;
     uint32_t configid[2];
 
     void *isa_internal;
diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h
index cab532095c..a994e69b6e 100644
--- a/target/xtensa/overlay_tool.h
+++ b/target/xtensa/overlay_tool.h
@@ -60,8 +60,9 @@
 #define XCHAL_RESET_VECTOR1_VADDR XCHAL_RESET_VECTOR_VADDR
 #endif
 
-#ifndef XCHAL_HW_MIN_VERSION
-#define XCHAL_HW_MIN_VERSION 0
+#ifndef XCHAL_HW_VERSION
+#define XCHAL_HW_VERSION (XCHAL_HW_VERSION_MAJOR * 100 \
+                          + XCHAL_HW_VERSION_MINOR)
 #endif
 
 #ifndef XCHAL_LOOP_BUFFER_SIZE
@@ -100,7 +101,7 @@
     XCHAL_OPTION(XCHAL_HAVE_FP, XTENSA_OPTION_FP_COPROCESSOR) | \
     XCHAL_OPTION(XCHAL_HAVE_RELEASE_SYNC, XTENSA_OPTION_MP_SYNCHRO) | \
     XCHAL_OPTION(XCHAL_HAVE_S32C1I, XTENSA_OPTION_CONDITIONAL_STORE) | \
-    XCHAL_OPTION(((XCHAL_HAVE_S32C1I && XCHAL_HW_MIN_VERSION >= 230000) || \
+    XCHAL_OPTION(((XCHAL_HAVE_S32C1I && XCHAL_HW_VERSION >= 230000) || \
                   XCHAL_HAVE_EXCLUSIVE), XTENSA_OPTION_ATOMCTL) | \
     XCHAL_OPTION(XCHAL_HAVE_DEPBITS, XTENSA_OPTION_DEPBITS) | \
     /* Interrupts and exceptions */ \
@@ -498,6 +499,7 @@
     }
 
 #define CONFIG_SECTION \
+    .hw_version = XCHAL_HW_VERSION, \
     .configid = { \
         XCHAL_HW_CONFIGID0, \
         XCHAL_HW_CONFIGID1, \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:00:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:00:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14559.35947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCE4-00021m-J8; Thu, 29 Oct 2020 18:00:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14559.35947; Thu, 29 Oct 2020 18:00:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCE4-00021e-GB; Thu, 29 Oct 2020 18:00:40 +0000
Received: by outflank-mailman (input) for mailman id 14559;
 Thu, 29 Oct 2020 18:00:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYCE3-00021Z-Gi
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8fbd5378-909f-40e6-8a3e-f514528f9b81;
 Thu, 29 Oct 2020 18:00:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCE1-00036K-SN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCE1-0007MY-QN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYCE3-00021Z-Gi
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:39 +0000
X-Inumbo-ID: 8fbd5378-909f-40e6-8a3e-f514528f9b81
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8fbd5378-909f-40e6-8a3e-f514528f9b81;
	Thu, 29 Oct 2020 18:00:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=McAGUQJvBs+EtRJyTh4/fXqa2Yfka5zk6WokhGRrXEQ=; b=ZiKjmBFTm7zJ4tQHu/h5P56Q3g
	tsc7LgR/MgW8aQtv1VG52VSF1DZVG/i2fyWB6MxHMbwKyf5fm8WtXl8nnukWexztdgANPLp/j6thO
	kq1+Ke3fWLRBGDjkgBUNwKsorVlemfpiIfsCqKpdhL9+QbKluR7n2omn2qQ4DuB5l/28=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCE1-00036K-SN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCE1-0007MY-QN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:00:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/xtensa: fix simcall for newer hardware
Message-Id: <E1kYCE1-0007MY-QN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:00:37 +0000

commit 62ed68e33db89584355ca4c63cd5b21dd98df636
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Mon May 4 05:15:14 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Sun May 17 14:52:25 2020 -0700

    target/xtensa: fix simcall for newer hardware
    
    After Xtensa release RE.2 simcall opcode has become nop for the
    hardware instead of illegal instruction.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 546d2fa2fa..4bc15252c8 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2367,9 +2367,10 @@ static bool test_ill_simcall(DisasContext *dc, const OpcodeArg arg[],
 #ifdef CONFIG_USER_ONLY
     bool ill = true;
 #else
-    bool ill = !semihosting_enabled();
+    /* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
+    bool ill = dc->config->hw_version <= 250002 && !semihosting_enabled();
 #endif
-    if (ill) {
+    if (ill || !semihosting_enabled()) {
         qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
     }
     return ill;
@@ -2379,7 +2380,9 @@ static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
                               const uint32_t par[])
 {
 #ifndef CONFIG_USER_ONLY
-    gen_helper_simcall(cpu_env);
+    if (semihosting_enabled()) {
+        gen_helper_simcall(cpu_env);
+    }
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:11:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:11:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14564.35957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCOX-0002vR-DH; Thu, 29 Oct 2020 18:11:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14564.35957; Thu, 29 Oct 2020 18:11:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCOX-0002vJ-AK; Thu, 29 Oct 2020 18:11:29 +0000
Received: by outflank-mailman (input) for mailman id 14564;
 Thu, 29 Oct 2020 18:11:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYCOV-0002vA-FI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d22d2fae-9fe0-4307-bab7-31f23c142c31;
 Thu, 29 Oct 2020 18:11:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCOU-0003JI-It
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCOU-0001b9-GR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYCOV-0002vA-FI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:27 +0000
X-Inumbo-ID: d22d2fae-9fe0-4307-bab7-31f23c142c31
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d22d2fae-9fe0-4307-bab7-31f23c142c31;
	Thu, 29 Oct 2020 18:11:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aXwBf4mC70uFRBzQK9Dry67qjvZQ3iAMT3Tzx8itstI=; b=UL6abI+ZDehQulXefmtDtgg0Yc
	hMSQObX6o1WOEb8hSTjtD3RYz5UKWuRa/qijroH9lLGNdiNlSmgF0hBas71SZOuh50b8+VURGE2BD
	gEQfGJOP/9BxaOMedQ4LlND55NQbvwid9W19DEdzXJukak8t0FoAcu9Py/6zStb3SBO4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCOU-0003JI-It
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCOU-0001b9-GR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:11:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/xtensa: drop gen_io_end call
Message-Id: <E1kYCOU-0001b9-GR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:11:26 +0000

commit 8a3a81478dcc592518069125a6ad271fe5511b95
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Sun Jun 21 22:26:50 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Mon Jun 22 03:38:30 2020 -0700

    target/xtensa: drop gen_io_end call
    
    Since commit
    ba3e7926691e ("icount: clean up cpu_can_io at the entry to the block")
    it has been unnecessary for target code to call gen_io_end() after an IO
    instruction in icount mode; it is sufficient to call gen_io_start()
    before it and to force the end of the TB.
    Remaining call in xtensa target translator is for the opcodes that may
    change IRQ state. All of them end current TB, so gen_io_end is not
    needed. Drop gen_io_end call from the xtensa target translator.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/xtensa/translate.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 4bc15252c8..6346b2eef0 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -595,9 +595,6 @@ static int gen_postprocess(DisasContext *dc, int slot)
             gen_io_start();
         }
         gen_helper_check_interrupts(cpu_env);
-        if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
-            gen_io_end();
-        }
     }
 #endif
     if (op_flags & XTENSA_OP_SYNC_REGISTER_WINDOW) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:22:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14568.35960 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCZI-0003oX-9Z; Thu, 29 Oct 2020 18:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14568.35960; Thu, 29 Oct 2020 18:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCZI-0003oQ-6H; Thu, 29 Oct 2020 18:22:36 +0000
Received: by outflank-mailman (input) for mailman id 14568;
 Thu, 29 Oct 2020 18:22:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYCZG-0003oL-8h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d7e17d10-bfa0-43f0-8504-57c6d6193fc2;
 Thu, 29 Oct 2020 18:22:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCZA-0003WL-A5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCZA-0004Bg-6u
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYCZG-0003oL-8h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:34 +0000
X-Inumbo-ID: d7e17d10-bfa0-43f0-8504-57c6d6193fc2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d7e17d10-bfa0-43f0-8504-57c6d6193fc2;
	Thu, 29 Oct 2020 18:22:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fqtWK5ZQwOqjKzpdx83xAO4M7tAK4Swfd8TQTRThtQA=; b=gyyTUKMagd6T9gugTAAw6vgeGa
	c02CAuO21yT8mvBCmo0xjxkMkz/LWCiT/qdXflJ2x3JQUONqAudENTUa+0qkCySTKXvyPXdpgCBZy
	sy5sV+0/peMTFJLAWw7fjsmh5hlNI7Az/uv9giTN90AkKJSR7/5MP089tYzhv3npetdI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCZA-0003WL-A5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCZA-0004Bg-6u
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:22:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/xtensa/tags/20200625-xtensa' into staging
Message-Id: <E1kYCZA-0004Bg-6u@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:22:28 +0000

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

commit 5acc270a355120ce967ca1f1eeca0abbdb9303c8
Merge: 63d211993b73ca9ac2bc618afeb61a698e9f5198 8a3a81478dcc592518069125a6ad271fe5511b95
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jun 25 21:20:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jun 25 21:20:45 2020 +0100

    Merge remote-tracking branch 'remotes/xtensa/tags/20200625-xtensa' into staging
    
    target/xtensa fixes for 5.1:
    
    - fix access to special registers missing in the core configuration;
    - fix simcall opcode behavior for new hardware;
    - drop gen_io_end call from xtensa translator.
    
    # gpg: Signature made Thu 25 Jun 2020 09:08:58 BST
    # gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
    # gpg:                issuer "jcmvbkbc@gmail.com"
    # gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
    # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
    # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
    # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
    
    * remotes/xtensa/tags/20200625-xtensa:
      target/xtensa: drop gen_io_end call
      target/xtensa: fix simcall for newer hardware
      target/xtensa: fetch HW version from configuration overlay
      target/xtensa: work around missing SR definitions
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 .cirrus.yml                                        |   12 +-
 .gitignore                                         |   17 +-
 .gitlab-ci-edk2.yml                                |   49 -
 .gitlab-ci-opensbi.yml                             |   63 -
 .gitlab-ci.d/edk2.yml                              |   49 +
 .gitlab-ci.d/opensbi.yml                           |   63 +
 .gitlab-ci.yml                                     |   67 +-
 .mailmap                                           |    6 +-
 .travis.yml                                        |   65 +-
 MAINTAINERS                                        |  165 +-
 Makefile                                           |   35 +-
 Makefile.objs                                      |    5 +-
 accel/Makefile.objs                                |    1 +
 accel/kvm/kvm-all.c                                |  139 +-
 accel/kvm/trace-events                             |    1 +
 accel/stubs/Makefile.objs                          |    1 +
 accel/stubs/xen-stub.c                             |   53 +
 accel/tcg/cputlb.c                                 |  408 +-
 accel/tcg/tcg-all.c                                |    7 +-
 accel/tcg/tcg-runtime-gvec.c                       |  144 +
 accel/tcg/tcg-runtime.h                            |   15 +
 accel/tcg/trace-events                             |    8 +-
 accel/tcg/translate-all.c                          |   71 +-
 accel/tcg/user-exec.c                              |  299 +-
 accel/xen/Makefile.objs                            |    1 +
 accel/xen/xen-all.c                                |  227 +
 arch_init.c                                        |    1 -
 audio/Makefile.objs                                |    5 +
 audio/audio.c                                      |    5 +-
 audio/audio.h                                      |    4 +-
 audio/audio_template.h                             |    2 +
 audio/jackaudio.c                                  |  670 +++
 audio/mixeng.c                                     |    9 +-
 audio/wavcapture.c                                 |    2 +-
 authz/list.c                                       |    5 +-
 authz/listfile.c                                   |    6 +-
 authz/pamacct.c                                    |    3 +-
 authz/simple.c                                     |    3 +-
 backends/Kconfig                                   |    1 +
 backends/Makefile.objs                             |    2 +-
 backends/cryptodev-vhost-user.c                    |    3 +-
 backends/cryptodev.c                               |    2 +-
 backends/dbus-vmstate.c                            |    6 +-
 backends/hostmem-file.c                            |   11 +-
 backends/hostmem-memfd.c                           |   17 +-
 backends/hostmem.c                                 |   41 +-
 backends/rng-egd.c                                 |    3 +-
 backends/rng-random.c                              |    3 +-
 backends/rng.c                                     |    3 +-
 backends/tpm.c                                     |  208 -
 backends/tpm/Kconfig                               |   14 +
 backends/tpm/Makefile.objs                         |    4 +
 backends/tpm/tpm_backend.c                         |  208 +
 backends/tpm/tpm_emulator.c                        |  997 ++++
 backends/tpm/tpm_int.h                             |   88 +
 backends/tpm/tpm_ioctl.h                           |  271 ++
 backends/tpm/tpm_passthrough.c                     |  405 ++
 backends/tpm/tpm_util.c                            |  380 ++
 backends/tpm/trace-events                          |   33 +
 backends/vhost-user.c                              |    2 +-
 block.c                                            |  643 +--
 block/Makefile.objs                                |    1 +
 block/backup-top.c                                 |   25 +-
 block/backup.c                                     |   18 +-
 block/blkdebug.c                                   |   10 +-
 block/blklogwrites.c                               |   16 +-
 block/blkreplay.c                                  |    8 +-
 block/blkverify.c                                  |   10 +-
 block/block-backend.c                              |   57 +-
 block/block-copy.c                                 |  291 +-
 block/bochs.c                                      |    7 +-
 block/cloop.c                                      |    7 +-
 block/commit.c                                     |   24 +-
 block/copy-on-read.c                               |    7 +-
 block/crypto.c                                     |   49 +-
 block/dirty-bitmap.c                               |   22 +
 block/dmg.c                                        |    7 +-
 block/file-posix.c                                 |   15 +-
 block/file-win32.c                                 |    6 +-
 block/filter-compress.c                            |    7 +-
 block/gluster.c                                    |   15 +-
 block/io.c                                         |  259 +-
 block/io_uring.c                                   |   11 +-
 block/iscsi.c                                      |    9 +-
 block/mirror.c                                     |   27 +-
 block/monitor/Makefile.objs                        |    1 +
 block/monitor/bitmap-qmp-cmds.c                    |  321 ++
 block/nbd.c                                        |   27 +-
 block/nfs.c                                        |   61 +-
 block/nvme.c                                       |    4 +-
 block/parallels.c                                  |   44 +-
 block/qcow.c                                       |   19 +-
 block/qcow2-bitmap.c                               |   44 +
 block/qcow2-cluster.c                              |    2 +-
 block/qcow2-refcount.c                             |    4 +-
 block/qcow2-snapshot.c                             |   20 +-
 block/qcow2-threads.c                              |  240 +-
 block/qcow2.c                                      |  287 +-
 block/qcow2.h                                      |   23 +-
 block/qed.c                                        |   19 +-
 block/quorum.c                                     |    8 +-
 block/raw-format.c                                 |  142 +-
 block/rbd.c                                        |    5 +-
 block/replication.c                                |   23 +-
 block/sheepdog.c                                   |   27 +-
 block/ssh.c                                        |    7 +-
 block/throttle-groups.c                            |    6 +-
 block/throttle.c                                   |    7 +-
 block/vdi.c                                        |   17 +-
 block/vhdx-log.c                                   |    2 +-
 block/vhdx.c                                       |  113 +-
 block/vmdk.c                                       |   87 +-
 block/vpc.c                                        |   17 +-
 block/vvfat.c                                      |   27 +-
 blockdev.c                                         |  354 +-
 blockjob.c                                         |   14 +-
 bootdevice.c                                       |   10 +-
 bsd-user/main.c                                    |   12 +-
 chardev/char-serial.c                              |    2 +-
 chardev/char-socket.c                              |   24 +-
 chardev/char.c                                     |   21 +-
 configure                                          |  242 +-
 contrib/libvhost-user/libvhost-user.c              |  351 +-
 contrib/libvhost-user/libvhost-user.h              |   24 +-
 contrib/vhost-user-blk/vhost-user-blk.c            |    4 +-
 cpus-common.c                                      |   49 +-
 cpus.c                                             |   40 +-
 crypto/Makefile.objs                               |    5 +-
 crypto/cipher-builtin.c                            |   10 +-
 crypto/init.c                                      |    2 +-
 crypto/random-none.c                               |   38 +
 crypto/secret.c                                    |  356 +-
 crypto/secret_common.c                             |  403 ++
 crypto/secret_keyring.c                            |  148 +
 crypto/tlscreds.c                                  |   12 +-
 crypto/tlscredsanon.c                              |    3 +-
 crypto/tlscredspsk.c                               |    6 +-
 crypto/tlscredsx509.c                              |    9 +-
 default-configs/arm-softmmu.mak                    |    1 +
 default-configs/mips64el-softmmu.mak               |    2 +-
 default-configs/riscv32-softmmu.mak                |    1 +
 default-configs/riscv64-softmmu.mak                |   11 +-
 default-configs/rx-softmmu.mak                     |    1 +
 default-configs/unicore32-softmmu.mak              |    1 +
 device_tree.c                                      |    4 +-
 disas.c                                            |   50 +-
 dma-helpers.c                                      |   22 +
 docs/devel/clocks.rst                              |  391 ++
 docs/devel/index.rst                               |    1 +
 docs/devel/loads-stores.rst                        |   39 +-
 docs/devel/migration.rst                           |   20 +
 docs/devel/qapi-code-gen.txt                       |    4 +-
 docs/devel/testing.rst                             |  107 +
 docs/interop/qcow2.txt                             |    4 +
 docs/interop/vhost-user.rst                        |   44 +
 docs/qdev-device-use.txt                           |   17 +-
 docs/specs/acpi_hest_ghes.rst                      |  110 +
 docs/specs/acpi_hw_reduced_hotplug.rst             |    3 +-
 docs/specs/index.rst                               |    1 +
 docs/specs/tpm.rst                                 |   16 +-
 docs/system/arm/aspeed.rst                         |   85 +
 docs/system/arm/integratorcp.rst                   |    4 +-
 docs/system/arm/mps2.rst                           |   29 +
 docs/system/arm/musca.rst                          |   31 +
 docs/system/arm/vexpress.rst                       |   60 +
 docs/system/deprecated.rst                         |  152 +-
 docs/system/s390x/3270.rst                         |   32 +
 docs/system/s390x/css.rst                          |   86 +
 docs/system/s390x/protvirt.rst                     |   60 +
 docs/system/s390x/vfio-ap.rst                      |    8 +-
 docs/system/s390x/vfio-ccw.rst                     |   77 +
 docs/system/target-arm.rst                         |   21 +-
 docs/system/target-mips.rst                        |    2 +-
 docs/system/target-rx.rst                          |   36 +
 docs/system/target-s390x.rst                       |    8 +
 docs/system/targets.rst                            |    1 +
 docs/tools/qemu-img.rst                            |   87 +-
 docs/xbzrle.txt                                    |    8 +-
 dtc                                                |    2 +-
 exec.c                                             |   46 +-
 fpu/softfloat-specialize.inc.c                     |   32 +-
 fpu/softfloat.c                                    | 1515 ++----
 gdb-xml/arm-m-profile.xml                          |   27 +
 gdb-xml/m68k-core.xml                              |   29 +
 gdbstub.c                                          |  119 +-
 hmp-commands-info.hx                               |    7 +-
 hmp-commands.hx                                    |   21 +-
 hw/9pfs/9p-util.h                                  |   13 +
 hw/9pfs/9p.c                                       |   38 +-
 hw/9pfs/9p.h                                       |   12 +-
 hw/9pfs/virtio-9p-device.c                         |   15 +-
 hw/9pfs/xen-9p-backend.c                           |   43 +-
 hw/Kconfig                                         |    1 +
 hw/Makefile.objs                                   |    2 +-
 hw/acpi/Kconfig                                    |    4 +
 hw/acpi/Makefile.objs                              |    5 +-
 hw/acpi/aml-build-stub.c                           |   79 +
 hw/acpi/aml-build.c                                |   64 +-
 hw/acpi/cpu.c                                      |    2 +-
 hw/acpi/generic_event_device.c                     |   79 +-
 hw/acpi/ghes.c                                     |  448 ++
 hw/acpi/ich9.c                                     |   25 +-
 hw/acpi/nvdimm.c                                   |  105 +-
 hw/acpi/pcihp.c                                    |    9 +-
 hw/acpi/piix4.c                                    |   44 +-
 hw/adc/stm32f2xx_adc.c                             |    4 +-
 hw/alpha/typhoon.c                                 |    4 +-
 hw/arm/Kconfig                                     |   14 +-
 hw/arm/allwinner-a10.c                             |   52 +-
 hw/arm/allwinner-h3.c                              |   69 +-
 hw/arm/armsse.c                                    |  174 +-
 hw/arm/armv7m.c                                    |   20 +-
 hw/arm/aspeed.c                                    |  231 +-
 hw/arm/aspeed_ast2600.c                            |  152 +-
 hw/arm/aspeed_soc.c                                |  109 +-
 hw/arm/bcm2835_peripherals.c                       |  127 +-
 hw/arm/bcm2836.c                                   |   33 +-
 hw/arm/cubieboard.c                                |   11 +-
 hw/arm/digic.c                                     |   16 +-
 hw/arm/digic_boards.c                              |    2 +-
 hw/arm/exynos4210.c                                |   50 +-
 hw/arm/exynos4_boards.c                            |   11 +-
 hw/arm/fsl-imx25.c                                 |   76 +-
 hw/arm/fsl-imx31.c                                 |   45 +-
 hw/arm/fsl-imx6.c                                  |   89 +-
 hw/arm/fsl-imx6ul.c                                |  115 +-
 hw/arm/fsl-imx7.c                                  |  135 +-
 hw/arm/highbank.c                                  |   28 +-
 hw/arm/imx25_pdk.c                                 |   12 +-
 hw/arm/integratorcp.c                              |   29 +-
 hw/arm/kzm.c                                       |    5 +-
 hw/arm/mcimx6ul-evk.c                              |   11 +-
 hw/arm/mcimx7d-sabre.c                             |   11 +-
 hw/arm/microbit.c                                  |   22 +-
 hw/arm/mps2-tz.c                                   |  102 +-
 hw/arm/mps2.c                                      |   93 +-
 hw/arm/msf2-soc.c                                  |   48 +-
 hw/arm/msf2-som.c                                  |   16 +-
 hw/arm/musca.c                                     |   60 +-
 hw/arm/musicpal.c                                  |   20 +-
 hw/arm/netduino2.c                                 |    4 +-
 hw/arm/netduinoplus2.c                             |    4 +-
 hw/arm/nrf51_soc.c                                 |   42 +-
 hw/arm/nseries.c                                   |   12 +-
 hw/arm/omap1.c                                     |   16 +-
 hw/arm/omap2.c                                     |   16 +-
 hw/arm/orangepi.c                                  |   11 +-
 hw/arm/pxa2xx.c                                    |   74 +-
 hw/arm/pxa2xx_gpio.c                               |   12 +-
 hw/arm/pxa2xx_pic.c                                |    5 +-
 hw/arm/raspi.c                                     |   15 +-
 hw/arm/realview.c                                  |   25 +-
 hw/arm/sabrelite.c                                 |   19 +-
 hw/arm/sbsa-ref.c                                  |   33 +-
 hw/arm/spitz.c                                     |    4 +-
 hw/arm/stellaris.c                                 |   12 +-
 hw/arm/stm32f205_soc.c                             |   34 +-
 hw/arm/stm32f405_soc.c                             |   66 +-
 hw/arm/strongarm.c                                 |    9 +-
 hw/arm/versatilepb.c                               |   21 +-
 hw/arm/vexpress.c                                  |   34 +-
 hw/arm/virt-acpi-build.c                           |   66 +
 hw/arm/virt.c                                      |  232 +-
 hw/arm/xilinx_zynq.c                               |  104 +-
 hw/arm/xlnx-versal-virt.c                          |   85 +-
 hw/arm/xlnx-versal.c                               |  130 +-
 hw/arm/xlnx-zcu102.c                               |   85 +-
 hw/arm/xlnx-zynqmp.c                               |  101 +-
 hw/audio/ac97.c                                    |    4 +-
 hw/audio/adlib.c                                   |    5 +-
 hw/audio/es1370.c                                  |    7 +-
 hw/audio/gus.c                                     |    8 +-
 hw/audio/gusemu_hal.c                              |    2 +-
 hw/audio/gusemu_mixer.c                            |    2 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/audio/marvell_88w8618.c                         |    2 +-
 hw/audio/pcspk.c                                   |    2 +-
 hw/block/Makefile.objs                             |    2 +-
 hw/block/block.c                                   |   40 +-
 hw/block/dataplane/virtio-blk.c                    |    8 +
 hw/block/fdc.c                                     |  214 +-
 hw/block/nand.c                                    |    6 +-
 hw/block/nvme.c                                    |  583 ++-
 hw/block/nvme.h                                    |   36 +-
 hw/block/pflash_cfi01.c                            |   83 +-
 hw/block/pflash_cfi02.c                            |   18 +-
 hw/block/swim.c                                    |    5 +-
 hw/block/trace-events                              |  176 +-
 hw/block/vhost-user-blk.c                          |   47 +-
 hw/block/virtio-blk.c                              |   43 +-
 hw/block/xen-block.c                               |   18 +-
 hw/char/Kconfig                                    |    3 +
 hw/char/Makefile.objs                              |    2 +
 hw/char/cadence_uart.c                             |   73 +-
 hw/char/exynos4210_uart.c                          |    5 +-
 hw/char/ibex_uart.c                                |  492 ++
 hw/char/mcf_uart.c                                 |    5 +-
 hw/char/parallel-isa.c                             |    5 +-
 hw/char/parallel.c                                 |   22 +
 hw/char/renesas_sci.c                              |  350 ++
 hw/char/serial-isa.c                               |   31 +-
 hw/char/serial-pci-multi.c                         |    8 +-
 hw/char/serial-pci.c                               |    7 +-
 hw/char/serial.c                                   |   16 +-
 hw/char/spapr_vty.c                                |    4 +-
 hw/char/trace-events                               |    3 +
 hw/char/virtio-console.c                           |    2 +-
 hw/char/virtio-serial-bus.c                        |    8 +-
 hw/char/xilinx_uartlite.c                          |    5 +-
 hw/core/Makefile.objs                              |    3 +-
 hw/core/bus.c                                      |   47 +-
 hw/core/clock-vmstate.c                            |   25 +
 hw/core/clock.c                                    |  130 +
 hw/core/cpu.c                                      |    7 +-
 hw/core/empty_slot.c                               |  102 -
 hw/core/generic-loader.c                           |    2 +-
 hw/core/machine-hmp-cmds.c                         |    2 +-
 hw/core/machine-qmp-cmds.c                         |   16 +-
 hw/core/machine.c                                  |   96 +-
 hw/core/numa.c                                     |    5 +
 hw/core/qdev-clock.c                               |  185 +
 hw/core/qdev-properties-system.c                   |  151 +-
 hw/core/qdev-properties.c                          |  113 +-
 hw/core/qdev.c                                     |  225 +-
 hw/core/register.c                                 |   46 +-
 hw/core/stream.c                                   |    4 +-
 hw/core/sysbus.c                                   |   27 +-
 hw/core/trace-events                               |    7 +
 hw/cpu/a15mpcore.c                                 |    5 +-
 hw/cpu/a9mpcore.c                                  |   23 +-
 hw/cpu/arm11mpcore.c                               |   18 +-
 hw/cpu/core.c                                      |    4 +-
 hw/cpu/realview_mpcore.c                           |   10 +-
 hw/cris/axis_dev88.c                               |    4 +-
 hw/display/artist.c                                |    4 +-
 hw/display/ati.c                                   |   15 +-
 hw/display/blizzard.c                              |   10 +-
 hw/display/bochs-display.c                         |    3 +-
 hw/display/cg3.c                                   |   16 +-
 hw/display/cirrus_vga.c                            |  123 +-
 hw/display/dpcd.c                                  |   20 +-
 hw/display/exynos4210_fimd.c                       |   46 +-
 hw/display/milkymist-tmu2.c                        |    4 +-
 hw/display/next-fb.c                               |    2 +-
 hw/display/omap_dss.c                              |    2 +-
 hw/display/pxa2xx_lcd.c                            |   34 +-
 hw/display/qxl.c                                   |   43 +-
 hw/display/ramfb-standalone.c                      |   12 +-
 hw/display/ramfb.c                                 |   79 +-
 hw/display/sm501.c                                 |  326 +-
 hw/display/tcx.c                                   |    4 +-
 hw/display/trace-events                            |   10 +
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |    4 +-
 hw/display/vhost-user-gpu-pci.c                    |    3 +-
 hw/display/vhost-user-gpu.c                        |    2 +-
 hw/display/vhost-user-vga.c                        |    3 +-
 hw/display/virtio-gpu-base.c                       |    2 +-
 hw/display/virtio-gpu-pci.c                        |    3 +-
 hw/display/virtio-vga.c                            |    4 +-
 hw/display/vmware_vga.c                            |   18 +-
 hw/display/xlnx_dp.c                               |   34 +-
 hw/dma/i8257.c                                     |    9 +-
 hw/dma/puv3_dma.c                                  |    9 +-
 hw/dma/pxa2xx_dma.c                                |   22 +-
 hw/dma/rc4030.c                                    |    7 +-
 hw/dma/sparc32_dma.c                               |   26 +-
 hw/dma/xilinx_axidma.c                             |   92 +-
 hw/dma/xlnx-zdma.c                                 |   32 +-
 hw/gpio/aspeed_gpio.c                              |    4 +-
 hw/gpio/pl061.c                                    |   12 +-
 hw/gpio/puv3_gpio.c                                |   15 +-
 hw/hppa/dino.c                                     |    8 +-
 hw/hppa/lasi.c                                     |    4 +-
 hw/hppa/machine.c                                  |    4 +-
 hw/hyperv/Kconfig                                  |    5 +
 hw/hyperv/Makefile.objs                            |    1 +
 hw/hyperv/hyperv.c                                 |   27 +-
 hw/hyperv/trace-events                             |   18 +
 hw/hyperv/vmbus.c                                  | 2778 +++++++++++
 hw/i2c/core.c                                      |    5 +-
 hw/i2c/imx_i2c.c                                   |    2 +-
 hw/i2c/microbit_i2c.c                              |    2 +-
 hw/i2c/mpc_i2c.c                                   |    2 +-
 hw/i2c/pm_smbus.c                                  |    1 -
 hw/i2c/smbus_eeprom.c                              |    4 +-
 hw/i2c/versatile_i2c.c                             |   38 +-
 hw/i386/Makefile.objs                              |    1 +
 hw/i386/acpi-build.c                               |  529 +--
 hw/i386/acpi-build.h                               |    3 +
 hw/i386/acpi-common.c                              |  156 +
 hw/i386/acpi-common.h                              |   15 +
 hw/i386/amd_iommu.c                                |   22 +-
 hw/i386/fw_cfg.c                                   |   28 +
 hw/i386/fw_cfg.h                                   |    1 +
 hw/i386/kvm/apic.c                                 |    2 +-
 hw/i386/microvm.c                                  |   64 +-
 hw/i386/pc.c                                       |  112 +-
 hw/i386/pc_piix.c                                  |   33 +-
 hw/i386/pc_q35.c                                   |   46 +-
 hw/i386/pc_sysfw.c                                 |   13 +-
 hw/i386/vmmouse.c                                  |   41 +-
 hw/i386/vmport.c                                   |  186 +-
 hw/i386/x86.c                                      |   64 +-
 hw/i386/xen/xen-hvm.c                              |    6 +-
 hw/i386/xen/xen_platform.c                         |    1 +
 hw/ide/ahci-allwinner.c                            |    2 +-
 hw/ide/ahci.c                                      |   19 +-
 hw/ide/core.c                                      |    6 +-
 hw/ide/isa.c                                       |    5 +-
 hw/ide/macio.c                                     |    8 +-
 hw/ide/microdrive.c                                |    3 +-
 hw/ide/pci.c                                       |   12 +-
 hw/ide/piix.c                                      |    2 +-
 hw/ide/qdev.c                                      |   19 +-
 hw/ide/sii3112.c                                   |    5 +-
 hw/input/adb-kbd.c                                 |    6 +-
 hw/input/pckbd.c                                   |   31 +
 hw/input/pxa2xx_keypad.c                           |   10 +-
 hw/input/vhost-user-input.c                        |    2 +-
 hw/input/virtio-input-hid.c                        |    2 +-
 hw/input/virtio-input-host.c                       |    2 +-
 hw/input/virtio-input.c                            |    9 +-
 hw/intc/Kconfig                                    |    3 +
 hw/intc/Makefile.objs                              |    2 +
 hw/intc/apic.c                                     |    2 +-
 hw/intc/apic_common.c                              |    6 +-
 hw/intc/arm_gicv3_kvm.c                            |    4 +-
 hw/intc/armv7m_nvic.c                              |   15 +-
 hw/intc/exynos4210_gic.c                           |    5 +-
 hw/intc/i8259_common.c                             |    5 +-
 hw/intc/ibex_plic.c                                |  261 ++
 hw/intc/ioapic.c                                   |   21 +-
 hw/intc/pnv_xive.c                                 |   10 +-
 hw/intc/puv3_intc.c                                |    9 +-
 hw/intc/realview_gic.c                             |    4 +-
 hw/intc/rx_icu.c                                   |  397 ++
 hw/intc/s390_flic.c                                |   10 +-
 hw/intc/spapr_xive.c                               |   10 +-
 hw/intc/xics.c                                     |    6 +-
 hw/intc/xive.c                                     |    4 +-
 hw/ipack/ipack.c                                   |    6 +-
 hw/ipmi/ipmi.c                                     |    3 +-
 hw/ipmi/smbus_ipmi.c                               |    2 +-
 hw/isa/apm.c                                       |   15 +-
 hw/isa/i82378.c                                    |    8 +-
 hw/isa/isa-bus.c                                   |   42 +-
 hw/isa/isa-superio.c                               |   45 +-
 hw/isa/lpc_ich9.c                                  |    8 +-
 hw/isa/piix3.c                                     |    1 +
 hw/isa/piix4.c                                     |    3 +-
 hw/isa/trace-events                                |    4 +
 hw/isa/vt82c686.c                                  |   15 +-
 hw/lm32/lm32.h                                     |   13 +-
 hw/lm32/milkymist-hw.h                             |   37 +-
 hw/m68k/mcf5206.c                                  |   14 +-
 hw/m68k/mcf5208.c                                  |   20 +-
 hw/m68k/mcf_intc.c                                 |   15 +-
 hw/m68k/next-cube.c                                |   12 +-
 hw/m68k/q800.c                                     |   39 +-
 hw/mem/Kconfig                                     |    2 +-
 hw/mem/nvdimm.c                                    |    5 +-
 hw/mem/pc-dimm.c                                   |   11 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   45 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   14 +-
 hw/microblaze/xlnx-zynqmp-pmu.c                    |   21 +-
 hw/mips/Kconfig                                    |    3 +-
 hw/mips/Makefile.objs                              |   10 +-
 hw/mips/boston.c                                   |   27 +-
 hw/mips/cps.c                                      |   20 +-
 hw/mips/fuloong2e.c                                |  400 ++
 hw/mips/gt64xxx_pci.c                              |    5 +-
 hw/mips/jazz.c                                     |  428 ++
 hw/mips/malta.c                                    | 1451 ++++++
 hw/mips/mips_fulong2e.c                            |  398 --
 hw/mips/mips_int.c                                 |   11 +-
 hw/mips/mips_jazz.c                                |  428 --
 hw/mips/mips_malta.c                               | 1458 ------
 hw/mips/mips_mipssim.c                             |  246 -
 hw/mips/mips_r4k.c                                 |  318 --
 hw/mips/mipssim.c                                  |  246 +
 hw/mips/r4k.c                                      |  318 ++
 hw/misc/Makefile.objs                              |    3 +-
 hw/misc/aspeed_scu.c                               |   11 +-
 hw/misc/aspeed_sdmc.c                              |   57 +-
 hw/misc/auxbus.c                                   |   24 +-
 hw/misc/bcm2835_mphi.c                             |  191 +
 hw/misc/edu.c                                      |    3 +-
 hw/misc/empty_slot.c                               |  108 +
 hw/misc/grlib_ahb_apb_pnp.c                        |   24 +-
 hw/misc/imx2_wdt.c                                 |   90 -
 hw/misc/imx6ul_ccm.c                               |   76 +-
 hw/misc/mac_via.c                                  |   15 +-
 hw/misc/macio/cuda.c                               |   19 +-
 hw/misc/macio/gpio.c                               |    2 +-
 hw/misc/macio/macio.c                              |   63 +-
 hw/misc/macio/pmu.c                                |   23 +-
 hw/misc/pca9552.c                                  |    2 +-
 hw/misc/puv3_pm.c                                  |    9 +-
 hw/misc/tmp105.c                                   |    2 +-
 hw/misc/tmp421.c                                   |    8 +-
 hw/misc/trace-events                               |    8 +
 hw/misc/zynq_slcr.c                                |  172 +-
 hw/net/Makefile.objs                               |    2 +
 hw/net/cadence_gem.c                               |  475 +-
 hw/net/can/can_kvaser_pci.c                        |    2 +-
 hw/net/can/can_mioe3680_pci.c                      |    4 +-
 hw/net/can/can_pcm3680_pci.c                       |    4 +-
 hw/net/e1000.c                                     |    3 +-
 hw/net/e1000e.c                                    |    2 +-
 hw/net/e1000e_core.c                               |   10 +-
 hw/net/eepro100.c                                  |    2 +-
 hw/net/etraxfs_eth.c                               |    4 +-
 hw/net/fsl_etsec/etsec.c                           |    5 +-
 hw/net/ftgmac100.c                                 |   29 +-
 hw/net/imx_fec.c                                   |  108 +-
 hw/net/lan9118.c                                   |    5 +-
 hw/net/lance.c                                     |    2 +-
 hw/net/lasi_i82596.c                               |    7 +-
 hw/net/mcf_fec.c                                   |    9 +-
 hw/net/msf2-emac.c                                 |  589 +++
 hw/net/ne2000-isa.c                                |    2 +-
 hw/net/ne2000-pci.c                                |    2 +-
 hw/net/pcnet-pci.c                                 |    2 +-
 hw/net/rtl8139.c                                   |    2 +-
 hw/net/smc91c111.c                                 |    5 +-
 hw/net/spapr_llan.c                                |    6 +-
 hw/net/sungem.c                                    |    2 +-
 hw/net/sunhme.c                                    |    2 +-
 hw/net/trace-events                                |   21 +
 hw/net/tulip.c                                     |   14 +-
 hw/net/tulip.h                                     |    2 +-
 hw/net/virtio-net.c                                |  393 +-
 hw/net/vmxnet3.c                                   |    2 +-
 hw/net/xilinx_axienet.c                            |   88 +-
 hw/nios2/10m50_devboard.c                          |   15 +-
 hw/nubus/nubus-device.c                            |    2 +-
 hw/nvram/fw_cfg.c                                  |   12 +-
 hw/nvram/mac_nvram.c                               |   19 +-
 hw/nvram/trace-events                              |    4 +
 hw/openrisc/openrisc_sim.c                         |    9 +-
 hw/pci-bridge/dec.c                                |   16 +-
 hw/pci-bridge/pci_expander_bridge.c                |    8 +-
 hw/pci-host/Kconfig                                |    5 +
 hw/pci-host/Makefile.objs                          |    2 +-
 hw/pci-host/bonito.c                               |   98 +-
 hw/pci-host/designware.c                           |    6 +-
 hw/pci-host/gpex.c                                 |    6 +-
 hw/pci-host/grackle.c                              |    2 +-
 hw/pci-host/i440fx.c                               |   19 +-
 hw/pci-host/pam.c                                  |    1 -
 hw/pci-host/pnv_phb3.c                             |   21 +-
 hw/pci-host/pnv_phb3_msi.c                         |    3 +-
 hw/pci-host/pnv_phb3_pbcq.c                        |    3 +-
 hw/pci-host/pnv_phb4.c                             |   11 +-
 hw/pci-host/pnv_phb4_pec.c                         |   11 +-
 hw/pci-host/prep.c                                 |    9 +-
 hw/pci-host/q35.c                                  |   28 +-
 hw/pci-host/sabre.c                                |   15 +-
 hw/pci-host/uninorth.c                             |    8 +-
 hw/pci-host/versatile.c                            |    9 +-
 hw/pci-host/xilinx-pcie.c                          |    6 +-
 hw/pci/msix.c                                      |    7 +
 hw/pci/pci.c                                       |   61 +-
 hw/pci/pci_bridge.c                                |    7 +-
 hw/pci/pcie.c                                      |   30 +-
 hw/pci/shpc.c                                      |    2 +-
 hw/pcmcia/pxa2xx.c                                 |    7 +-
 hw/ppc/e500.c                                      |   40 +-
 hw/ppc/mac_newworld.c                              |   53 +-
 hw/ppc/mac_oldworld.c                              |   28 +-
 hw/ppc/pnv.c                                       |  165 +-
 hw/ppc/pnv_bmc.c                                   |    7 +-
 hw/ppc/pnv_core.c                                  |    6 +-
 hw/ppc/pnv_psi.c                                   |   14 +-
 hw/ppc/ppc440_uc.c                                 |   10 +-
 hw/ppc/prep.c                                      |   41 +-
 hw/ppc/sam460ex.c                                  |    4 +-
 hw/ppc/spapr.c                                     |  131 +-
 hw/ppc/spapr_caps.c                                |   16 +-
 hw/ppc/spapr_cpu_core.c                            |   10 +-
 hw/ppc/spapr_drc.c                                 |   38 +-
 hw/ppc/spapr_hcall.c                               |  108 +-
 hw/ppc/spapr_iommu.c                               |    6 +-
 hw/ppc/spapr_irq.c                                 |    8 +-
 hw/ppc/spapr_nvdimm.c                              |   10 +-
 hw/ppc/spapr_pci.c                                 |  101 +-
 hw/ppc/spapr_rng.c                                 |    3 +-
 hw/ppc/spapr_rtc.c                                 |    2 +-
 hw/ppc/spapr_tpm_proxy.c                           |    2 +-
 hw/ppc/spapr_vio.c                                 |    4 +-
 hw/ppc/virtex_ml507.c                              |    9 +-
 hw/rdma/rdma_backend.c                             |   50 +-
 hw/rdma/rdma_rm.c                                  |    3 +-
 hw/rdma/rdma_utils.c                               |    1 +
 hw/riscv/Kconfig                                   |    9 +
 hw/riscv/Makefile.objs                             |    1 +
 hw/riscv/boot.c                                    |   58 +-
 hw/riscv/opentitan.c                               |  210 +
 hw/riscv/riscv_hart.c                              |    7 +-
 hw/riscv/sifive_clint.c                            |    5 +-
 hw/riscv/sifive_e.c                                |  121 +-
 hw/riscv/sifive_e_prci.c                           |    5 +-
 hw/riscv/sifive_gpio.c                             |   45 +-
 hw/riscv/sifive_plic.c                             |    5 +-
 hw/riscv/sifive_test.c                             |    5 +-
 hw/riscv/sifive_u.c                                |  348 +-
 hw/riscv/spike.c                                   |  252 +-
 hw/riscv/virt.c                                    |   48 +-
 hw/rtc/m48t59-isa.c                                |    7 +-
 hw/rtc/m48t59.c                                    |    5 +-
 hw/rtc/mc146818rtc.c                               |   37 +-
 hw/rtc/sun4v-rtc.c                                 |    5 +-
 hw/rx/Kconfig                                      |   10 +
 hw/rx/Makefile.objs                                |    2 +
 hw/rx/rx-gdbsim.c                                  |  198 +
 hw/rx/rx62n.c                                      |  323 ++
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/ap-bridge.c                               |    6 +-
 hw/s390x/css-bridge.c                              |   13 +-
 hw/s390x/css.c                                     |   57 +-
 hw/s390x/event-facility.c                          |   66 +-
 hw/s390x/ipl.c                                     |   59 +-
 hw/s390x/ipl.h                                     |  103 +-
 hw/s390x/pv.c                                      |  113 +
 hw/s390x/s390-ccw.c                                |   25 +-
 hw/s390x/s390-pci-bus.c                            |    8 +-
 hw/s390x/s390-skeys.c                              |    6 +-
 hw/s390x/s390-stattrib.c                           |    6 +-
 hw/s390x/s390-virtio-ccw.c                         |  186 +-
 hw/s390x/sclp.c                                    |   75 +-
 hw/s390x/tod.c                                     |    4 +-
 hw/s390x/vhost-vsock-ccw.c                         |    3 +-
 hw/s390x/virtio-ccw-9p.c                           |    3 +-
 hw/s390x/virtio-ccw-balloon.c                      |    7 +-
 hw/s390x/virtio-ccw-blk.c                          |    5 +-
 hw/s390x/virtio-ccw-crypto.c                       |    3 +-
 hw/s390x/virtio-ccw-gpu.c                          |    3 +-
 hw/s390x/virtio-ccw-input.c                        |    3 +-
 hw/s390x/virtio-ccw-net.c                          |    5 +-
 hw/s390x/virtio-ccw-rng.c                          |    3 +-
 hw/s390x/virtio-ccw-scsi.c                         |    6 +-
 hw/s390x/virtio-ccw-serial.c                       |    3 +-
 hw/s390x/virtio-ccw.c                              |    8 +-
 hw/s390x/virtio-ccw.h                              |    2 +-
 hw/scsi/esp-pci.c                                  |    1 +
 hw/scsi/lsi53c895a.c                               |    2 +-
 hw/scsi/megasas.c                                  |   44 +-
 hw/scsi/scsi-bus.c                                 |   23 +-
 hw/scsi/scsi-disk.c                                |   14 +-
 hw/scsi/spapr_vscsi.c                              |    4 +-
 hw/scsi/vhost-scsi.c                               |    4 +-
 hw/scsi/vhost-user-scsi.c                          |    5 +-
 hw/scsi/virtio-scsi.c                              |    2 +-
 hw/sd/aspeed_sdhci.c                               |    2 +-
 hw/sd/milkymist-memcard.c                          |    6 +-
 hw/sd/pxa2xx_mmci.c                                |   20 +-
 hw/sd/sd.c                                         |   44 +-
 hw/sd/sdhci-internal.h                             |    7 +-
 hw/sd/sdhci-pci.c                                  |    2 +-
 hw/sd/sdhci.c                                      |   24 +-
 hw/sd/ssi-sd.c                                     |    7 +-
 hw/semihosting/console.c                           |    1 -
 hw/sh4/r2d.c                                       |   12 +-
 hw/sh4/sh7750.c                                    |    1 +
 hw/sh4/sh_pci.c                                    |    2 +-
 hw/sparc/Kconfig                                   |    1 +
 hw/sparc/leon3.c                                   |   34 +-
 hw/sparc/sun4m.c                                   |   94 +-
 hw/sparc64/niagara.c                               |    7 +-
 hw/sparc64/sun4u.c                                 |   61 +-
 hw/ssi/aspeed_smc.c                                |    1 -
 hw/ssi/imx_spi.c                                   |    6 +-
 hw/ssi/mss-spi.c                                   |    1 -
 hw/ssi/ssi.c                                       |   43 +-
 hw/ssi/xilinx_spi.c                                |    1 -
 hw/ssi/xilinx_spips.c                              |    9 +-
 hw/timer/Kconfig                                   |    6 +
 hw/timer/Makefile.objs                             |    2 +
 hw/timer/exynos4210_mct.c                          |   16 +-
 hw/timer/nrf51_timer.c                             |   14 +-
 hw/timer/puv3_ost.c                                |    9 +-
 hw/timer/pxa2xx_timer.c                            |    1 +
 hw/timer/renesas_cmt.c                             |  283 ++
 hw/timer/renesas_tmr.c                             |  477 ++
 hw/timer/sh_timer.c                                |    3 +-
 hw/timer/stm32f2xx_timer.c                         |    1 -
 hw/timer/trace-events                              |    7 +-
 hw/tpm/Kconfig                                     |   21 +-
 hw/tpm/Makefile.objs                               |    3 -
 hw/tpm/tpm_crb.c                                   |    4 +-
 hw/tpm/tpm_emulator.c                              |  997 ----
 hw/tpm/tpm_int.h                                   |   75 -
 hw/tpm/tpm_ioctl.h                                 |  271 --
 hw/tpm/tpm_passthrough.c                           |  405 --
 hw/tpm/tpm_ppi.c                                   |    1 +
 hw/tpm/tpm_ppi.h                                   |    1 -
 hw/tpm/tpm_prop.h                                  |   31 +
 hw/tpm/tpm_spapr.c                                 |    4 +-
 hw/tpm/tpm_tis.h                                   |    1 -
 hw/tpm/tpm_tis_common.c                            |   15 +-
 hw/tpm/tpm_tis_isa.c                               |    3 +-
 hw/tpm/tpm_tis_sysbus.c                            |    5 +-
 hw/tpm/tpm_util.c                                  |  377 --
 hw/tpm/tpm_util.h                                  |   85 -
 hw/tpm/trace-events                                |   34 +-
 hw/unicore32/puv3.c                                |    2 -
 hw/usb/Kconfig                                     |    5 +
 hw/usb/Makefile.objs                               |    1 +
 hw/usb/bus.c                                       |   70 +-
 hw/usb/ccid-card-emulated.c                        |    2 +-
 hw/usb/ccid.h                                      |    2 +-
 hw/usb/dev-audio.c                                 |    2 +-
 hw/usb/dev-hid.c                                   |    2 +-
 hw/usb/dev-hub.c                                   |    2 +-
 hw/usb/dev-mtp.c                                   |    9 +-
 hw/usb/dev-network.c                               |    4 +-
 hw/usb/dev-serial.c                                |    4 +-
 hw/usb/dev-smartcard-reader.c                      |   11 +-
 hw/usb/dev-storage.c                               |   22 +-
 hw/usb/dev-uas.c                                   |    2 +-
 hw/usb/dev-wacom.c                                 |    2 +-
 hw/usb/hcd-dwc2.c                                  | 1417 ++++++
 hw/usb/hcd-dwc2.h                                  |  190 +
 hw/usb/hcd-ehci-pci.c                              |    2 +-
 hw/usb/hcd-ehci.c                                  |    2 +-
 hw/usb/hcd-ehci.h                                  |    2 +-
 hw/usb/hcd-musb.c                                  |    5 +-
 hw/usb/host-libusb.c                               |   93 +-
 hw/usb/redirect.c                                  |    4 +-
 hw/usb/trace-events                                |   51 +
 hw/usb/tusb6010.c                                  |    1 +
 hw/usb/xen-usb.c                                   |   19 +-
 hw/vfio/ap.c                                       |    2 +-
 hw/vfio/ccw.c                                      |  227 +-
 hw/vfio/display.c                                  |    4 +-
 hw/vfio/pci-quirks.c                               |   95 +-
 hw/vfio/pci.c                                      |   39 +-
 hw/vfio/platform.c                                 |    5 +-
 hw/virtio/Makefile.objs                            |    4 +-
 hw/virtio/trace-events                             |    3 +-
 hw/virtio/vhost-scsi-pci.c                         |    5 +-
 hw/virtio/vhost-user-blk-pci.c                     |    5 +-
 hw/virtio/vhost-user-fs-pci.c                      |    3 +-
 hw/virtio/vhost-user-fs.c                          |    2 +-
 hw/virtio/vhost-user-input-pci.c                   |    3 +-
 hw/virtio/vhost-user-scsi-pci.c                    |    5 +-
 hw/virtio/vhost-user-vsock-pci.c                   |   83 +
 hw/virtio/vhost-user-vsock.c                       |  181 +
 hw/virtio/vhost-user.c                             |  743 ++-
 hw/virtio/vhost-vsock-common.c                     |  258 +
 hw/virtio/vhost-vsock-pci.c                        |    3 +-
 hw/virtio/vhost-vsock.c                            |  285 +-
 hw/virtio/vhost.c                                  |   63 +-
 hw/virtio/virtio-9p-pci.c                          |    3 +-
 hw/virtio/virtio-balloon-pci.c                     |    7 +-
 hw/virtio/virtio-balloon.c                         |  143 +-
 hw/virtio/virtio-blk-pci.c                         |    5 +-
 hw/virtio/virtio-crypto-pci.c                      |    3 +-
 hw/virtio/virtio-crypto.c                          |    2 +-
 hw/virtio/virtio-input-pci.c                       |    3 +-
 hw/virtio/virtio-iommu-pci.c                       |    3 +-
 hw/virtio/virtio-iommu.c                           |    2 +-
 hw/virtio/virtio-net-pci.c                         |    5 +-
 hw/virtio/virtio-pci.c                             |   13 +-
 hw/virtio/virtio-pmem-pci.c                        |    3 +-
 hw/virtio/virtio-pmem.c                            |    2 +-
 hw/virtio/virtio-rng-pci.c                         |    3 +-
 hw/virtio/virtio-rng.c                             |    4 +-
 hw/virtio/virtio-scsi-pci.c                        |    3 +-
 hw/virtio/virtio-serial-pci.c                      |    3 +-
 hw/virtio/virtio.c                                 |   16 +-
 hw/watchdog/Kconfig                                |    3 +
 hw/watchdog/Makefile.objs                          |    1 +
 hw/watchdog/cmsdk-apb-watchdog.c                   |    1 +
 hw/watchdog/trace-events                           |    1 +
 hw/watchdog/wdt_diag288.c                          |    2 +-
 hw/watchdog/wdt_imx2.c                             |  304 ++
 hw/xen/Makefile.objs                               |    3 +-
 hw/xen/xen-bus.c                                   |   16 +-
 hw/xen/xen-common.c                                |  220 -
 hw/xen/xen-legacy-backend.c                        |    9 +-
 hw/xen/xen_pt.c                                    |   12 +-
 hw/xen/xen_pt.h                                    |    6 +-
 hw/xen/xen_pt_stub.c                               |   22 +
 hw/xtensa/virt.c                                   |    4 +-
 hw/xtensa/xtfpga.c                                 |   11 +-
 include/block/aio.h                                |    3 +
 include/block/block.h                              |   71 +-
 include/block/block_int.h                          |   88 +-
 include/block/dirty-bitmap.h                       |    2 +
 include/block/nvme.h                               |  180 +
 include/crypto/secret.h                            |   20 +-
 include/crypto/secret_common.h                     |   68 +
 include/crypto/secret_keyring.h                    |   52 +
 include/disas/disas.h                              |    2 +-
 include/exec/cpu-all.h                             |   39 +-
 include/exec/cpu-common.h                          |    3 -
 include/exec/cpu_ldst.h                            |  271 +-
 include/exec/exec-all.h                            |   47 +
 include/exec/gdbstub.h                             |   25 +-
 include/exec/log.h                                 |    4 +-
 include/exec/memory.h                              |   45 +-
 include/exec/ram_addr.h                            |    6 +-
 include/fpu/softfloat-helpers.h                    |   27 +-
 include/fpu/softfloat-macros.h                     |   24 +-
 include/fpu/softfloat-types.h                      |   28 +-
 include/fpu/softfloat.h                            |  336 +-
 include/hw/acpi/acpi-defs.h                        |   20 +-
 include/hw/acpi/aml-build.h                        |    4 +-
 include/hw/acpi/generic_event_device.h             |    5 +-
 include/hw/acpi/ghes.h                             |   74 +
 include/hw/acpi/ich9.h                             |    2 +-
 include/hw/arm/aspeed.h                            |    6 +
 include/hw/arm/aspeed_soc.h                        |    1 -
 include/hw/arm/bcm2835_peripherals.h               |    5 +-
 include/hw/arm/fsl-imx25.h                         |    5 +
 include/hw/arm/fsl-imx31.h                         |    4 +
 include/hw/arm/fsl-imx6.h                          |    2 +-
 include/hw/arm/fsl-imx6ul.h                        |    2 +-
 include/hw/arm/fsl-imx7.h                          |   23 +-
 include/hw/arm/msf2-soc.h                          |    2 +
 include/hw/arm/nrf51.h                             |    3 +-
 include/hw/arm/virt.h                              |    2 +
 include/hw/arm/xlnx-versal.h                       |   31 +-
 include/hw/audio/pcspk.h                           |    5 +-
 include/hw/block/block.h                           |   14 +-
 include/hw/block/fdc.h                             |    5 +-
 include/hw/boards.h                                |    3 +
 include/hw/char/cadence_uart.h                     |    6 +-
 include/hw/char/cmsdk-apb-uart.h                   |    4 +-
 include/hw/char/ibex_uart.h                        |  110 +
 include/hw/char/pl011.h                            |    9 +-
 include/hw/char/renesas_sci.h                      |   51 +
 include/hw/char/xilinx_uartlite.h                  |    4 +-
 include/hw/clock.h                                 |  225 +
 include/hw/core/cpu.h                              |   36 +-
 include/hw/cris/etraxfs.h                          |    4 +-
 include/hw/display/edid.h                          |    2 -
 include/hw/display/ramfb.h                         |    2 +-
 include/hw/elf_ops.h                               |   15 +-
 include/hw/empty_slot.h                            |    9 -
 include/hw/gpio/nrf51_gpio.h                       |    2 +-
 include/hw/hyperv/hyperv.h                         |    1 +
 include/hw/hyperv/vmbus-bridge.h                   |   35 +
 include/hw/hyperv/vmbus-proto.h                    |  222 +
 include/hw/hyperv/vmbus.h                          |  230 +
 include/hw/i2c/arm_sbcon_i2c.h                     |   35 +
 include/hw/i2c/microbit_i2c.h                      |    2 +-
 include/hw/i386/microvm.h                          |    2 +-
 include/hw/i386/pc.h                               |   19 +-
 include/hw/i386/vmport.h                           |   28 +
 include/hw/i386/x86.h                              |    4 -
 include/hw/ide/internal.h                          |   12 +-
 include/hw/intc/ibex_plic.h                        |   63 +
 include/hw/intc/rx_icu.h                           |   76 +
 include/hw/isa/isa.h                               |    7 +-
 include/hw/mem/nvdimm.h                            |    4 +
 include/hw/misc/aspeed_scu.h                       |    1 +
 include/hw/misc/auxbus.h                           |   18 +-
 include/hw/misc/bcm2835_mphi.h                     |   44 +
 include/hw/misc/empty_slot.h                       |   19 +
 include/hw/misc/imx2_wdt.h                         |   33 -
 include/hw/misc/unimp.h                            |    5 +-
 include/hw/net/cadence_gem.h                       |    6 +
 include/hw/net/msf2-emac.h                         |   53 +
 include/hw/net/ne2000-isa.h                        |    5 +-
 include/hw/pci/pci.h                               |    6 +-
 include/hw/ppc/pnv_psi.h                           |    2 +-
 include/hw/ppc/spapr.h                             |   11 +-
 include/hw/qdev-clock.h                            |  159 +
 include/hw/qdev-core.h                             |   31 +-
 include/hw/qdev-properties.h                       |   23 +-
 include/hw/register.h                              |    8 +
 include/hw/registerfields.h                        |   40 +-
 include/hw/riscv/boot.h                            |    7 +-
 include/hw/riscv/opentitan.h                       |   84 +
 include/hw/riscv/sifive_e.h                        |    7 +-
 include/hw/riscv/sifive_gpio.h                     |    8 +-
 include/hw/riscv/sifive_u.h                        |   32 +-
 include/hw/riscv/spike.h                           |    6 +-
 include/hw/rtc/mc146818rtc.h                       |    1 +
 include/hw/rx/rx62n.h                              |   76 +
 include/hw/s390x/css.h                             |    4 +-
 include/hw/s390x/pv.h                              |   58 +
 include/hw/s390x/s390-ccw.h                        |    3 +-
 include/hw/s390x/s390-virtio-ccw.h                 |    1 +
 include/hw/s390x/sclp.h                            |    2 +
 include/hw/scsi/scsi.h                             |    2 +-
 include/hw/sd/sdhci.h                              |    5 +
 include/hw/sh4/sh.h                                |   12 +-
 include/hw/ssi/ssi.h                               |    5 -
 include/hw/stream.h                                |    5 +-
 include/hw/sysbus.h                                |   19 +-
 include/hw/timer/cmsdk-apb-timer.h                 |    4 +-
 include/hw/timer/i8254.h                           |    9 +-
 include/hw/timer/nrf51_timer.h                     |    1 +
 include/hw/timer/renesas_cmt.h                     |   40 +
 include/hw/timer/renesas_tmr.h                     |   55 +
 include/hw/timer/tmu012.h                          |   23 +
 include/hw/usb.h                                   |   38 +-
 include/hw/usb/dwc2-regs.h                         |  899 ++++
 include/hw/usb/hcd-musb.h                          |   47 +
 include/hw/virtio/vhost-user-vsock.h               |   36 +
 include/hw/virtio/vhost-user.h                     |    1 +
 include/hw/virtio/vhost-vsock-common.h             |   47 +
 include/hw/virtio/vhost-vsock.h                    |   11 +-
 include/hw/virtio/virtio-balloon.h                 |    3 +-
 include/hw/virtio/virtio-blk.h                     |    1 +
 include/hw/virtio/virtio-net.h                     |   16 +
 include/hw/watchdog/wdt_imx2.h                     |   90 +
 include/hw/xen/xen-block.h                         |    2 +-
 include/hw/xen/xen-bus.h                           |    2 +-
 include/hw/xen/xen.h                               |   11 -
 include/io/task.h                                  |    2 -
 include/migration/vmstate.h                        |   11 +-
 include/monitor/hmp.h                              |    1 +
 include/qapi/qmp/qdict.h                           |    3 -
 include/qapi/qmp/qlist.h                           |   10 +-
 include/qapi/visitor-impl.h                        |    9 +-
 include/qapi/visitor.h                             |  192 +-
 include/qemu/lockable.h                            |    7 +-
 include/qemu/osdep.h                               |    2 +-
 include/qemu/plugin.h                              |   65 +-
 include/qemu/qemu-plugin.h                         |    3 +-
 include/qemu/rcu.h                                 |    2 +-
 include/qemu/thread.h                              |   40 +-
 include/qemu/tsan.h                                |   71 +
 include/qemu/typedefs.h                            |    3 +-
 include/qemu/uuid.h                                |   27 +
 include/qom/object.h                               |  195 +-
 include/qom/object_interfaces.h                    |   16 +
 include/qom/qom-qobject.h                          |    2 -
 include/standard-headers/asm-x86/kvm_para.h        |   17 +-
 include/standard-headers/drm/drm_fourcc.h          |  140 +-
 include/standard-headers/linux/ethtool.h           |   26 +-
 include/standard-headers/linux/input-event-codes.h |    5 +-
 include/standard-headers/linux/pci_regs.h          |    2 +
 include/standard-headers/linux/vhost_types.h       |    8 +
 include/standard-headers/linux/virtio_balloon.h    |   12 +-
 include/standard-headers/linux/virtio_ids.h        |    2 +
 include/standard-headers/linux/virtio_mem.h        |  211 +
 include/standard-headers/linux/virtio_net.h        |  102 +-
 include/standard-headers/linux/virtio_ring.h       |   48 +-
 include/sysemu/accel.h                             |    2 +
 include/sysemu/block-backend.h                     |    6 +-
 include/sysemu/blockdev.h                          |    2 +
 include/sysemu/device_tree.h                       |    5 +-
 include/sysemu/hvf.h                               |   72 +-
 include/sysemu/kvm.h                               |    7 +-
 include/sysemu/kvm_int.h                           |   12 +
 include/sysemu/sysemu.h                            |    5 +-
 include/sysemu/tcg.h                               |    2 +-
 include/sysemu/tpm.h                               |    2 +
 include/sysemu/tpm_util.h                          |   72 +
 include/sysemu/xen.h                               |   38 +
 include/tcg/tcg-op-gvec.h                          |   25 +-
 include/tcg/tcg-op.h                               |   13 +-
 include/tcg/tcg-opc.h                              |    4 +
 include/tcg/tcg.h                                  |    4 +
 include/ui/win32-kbd-hook.h                        |   14 +
 io/task.c                                          |    1 +
 iothread.c                                         |    6 +-
 linux-headers/COPYING                              |    2 +
 linux-headers/asm-arm64/mman.h                     |    8 +
 linux-headers/asm-generic/unistd.h                 |    4 +-
 linux-headers/asm-mips/unistd_n32.h                |    1 +
 linux-headers/asm-mips/unistd_n64.h                |    1 +
 linux-headers/asm-mips/unistd_o32.h                |    1 +
 linux-headers/asm-powerpc/unistd_32.h              |    1 +
 linux-headers/asm-powerpc/unistd_64.h              |    1 +
 linux-headers/asm-s390/unistd_32.h                 |    1 +
 linux-headers/asm-s390/unistd_64.h                 |    1 +
 linux-headers/asm-x86/kvm.h                        |   21 +-
 linux-headers/asm-x86/unistd.h                     |   11 +-
 linux-headers/asm-x86/unistd_32.h                  |    2 +
 linux-headers/asm-x86/unistd_64.h                  |    2 +
 linux-headers/asm-x86/unistd_x32.h                 |    2 +
 linux-headers/linux/kvm.h                          |   65 +-
 linux-headers/linux/mman.h                         |    5 +-
 linux-headers/linux/psp-sev.h                      |    2 +
 linux-headers/linux/userfaultfd.h                  |   40 +-
 linux-headers/linux/vfio.h                         |  359 ++
 linux-headers/linux/vfio_ccw.h                     |   19 +
 linux-headers/linux/vhost.h                        |   28 +
 linux-user/arm/cpu_loop.c                          |  145 +-
 linux-user/arm/signal.c                            |   15 +-
 linux-user/elfload.c                               |  548 ++-
 linux-user/flatload.c                              |    6 +
 linux-user/generic/fcntl.h                         |    4 +
 linux-user/main.c                                  |   39 +-
 linux-user/mmap.c                                  |    4 +-
 linux-user/ppc/cpu_loop.c                          |    1 +
 linux-user/qemu.h                                  |   31 +-
 linux-user/riscv/signal.c                          |    3 +-
 linux-user/strace.list                             |    4 +-
 linux-user/syscall.c                               |   52 +-
 memory.c                                           |  101 +-
 migration/block-dirty-bitmap.c                     |  130 +-
 migration/colo.c                                   |   40 +-
 migration/migration.c                              |   53 +-
 migration/migration.h                              |    4 +-
 migration/multifd.c                                |   19 +-
 migration/ram.c                                    |   84 +-
 migration/ram.h                                    |    1 +
 migration/rdma.c                                   |   11 +-
 migration/savevm.c                                 |    2 +-
 monitor/hmp-cmds.c                                 |   59 +-
 monitor/misc.c                                     |   10 +-
 monitor/monitor-internal.h                         |    2 +-
 monitor/qmp.c                                      |    5 +-
 nbd/server.c                                       |   23 +-
 net/can/can_host.c                                 |    3 +-
 net/can/can_socketcan.c                            |    3 +-
 net/colo-compare.c                                 |  297 +-
 net/colo.c                                         |    7 +
 net/colo.h                                         |    1 +
 net/dump.c                                         |    4 +-
 net/filter-buffer.c                                |    2 +-
 net/filter-mirror.c                                |   10 +-
 net/filter-rewriter.c                              |    2 +-
 net/filter.c                                       |   15 +-
 net/net.c                                          |   91 +-
 net/tap.c                                          |    3 +-
 net/trace-events                                   |    1 +
 pc-bios/openbios-ppc                               |  Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32                           |  Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64                           |  Bin 1593408 -> 1593408 bytes
 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin       |  Bin 49472 -> 49520 bytes
 pc-bios/opensbi-riscv32-virt-fw_jump.bin           |  Bin 41280 -> 49504 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin       |  Bin 53760 -> 57936 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin           |  Bin 49664 -> 57920 bytes
 plugins/api.c                                      |    4 +-
 po/sv.po                                           |   75 +
 python/qemu/.flake8                                |    2 +
 python/qemu/accel.py                               |    9 +-
 python/qemu/machine.py                             |   44 +-
 python/qemu/pylintrc                               |   58 +
 python/qemu/qmp.py                                 |   29 +-
 python/qemu/qtest.py                               |   83 +-
 qapi/audio.json                                    |   56 +-
 qapi/block-core.json                               |   39 +-
 qapi/migration.json                                |   53 +-
 qapi/misc.json                                     |    6 +-
 qapi/net.json                                      |   49 -
 qapi/qapi-dealloc-visitor.c                        |    7 -
 qapi/qapi-visit-core.c                             |   20 +-
 qapi/qobject-input-visitor.c                       |   21 +-
 qapi/sockets.json                                  |    8 +-
 qdev-monitor.c                                     |   21 +-
 qemu-img-cmds.hx                                   |   17 +-
 qemu-img.c                                         |  467 +-
 qemu-io-cmds.c                                     |    2 +-
 qemu-nbd.c                                         |   13 +-
 qemu-options.hx                                    |   22 +-
 qemu-storage-daemon.c                              |    4 +-
 qobject/qdict.c                                    |   19 -
 qobject/qjson.c                                    |  107 +-
 qobject/qlist.c                                    |   44 +-
 qom/container.c                                    |    5 +-
 qom/object.c                                       |  584 +--
 qom/object_interfaces.c                            |   39 +-
 qom/qom-hmp-cmds.c                                 |   67 +-
 qom/qom-qmp-cmds.c                                 |   24 +-
 replay/replay-internal.c                           |   15 +-
 replay/replay.c                                    |    5 +
 roms/openbios                                      |    2 +-
 roms/opensbi                                       |    2 +-
 scripts/analyze-migration.py                       |    5 -
 scripts/checkpatch.pl                              |   33 +-
 scripts/clean-includes                             |    1 +
 scripts/coverity-scan/coverity-scan.docker         |    5 +-
 scripts/coverity-scan/run-coverity-scan            |  139 +-
 scripts/decodetree.py                              |  536 ++-
 scripts/kvm/vmxcap                                 |    7 +-
 scripts/modules/module_block.py                    |   29 +-
 scripts/oss-fuzz/build.sh                          |  105 +
 scripts/qapi/commands.py                           |   60 +-
 scripts/qapi/visit.py                              |    8 +
 scripts/qemu-gdb.py                                |    4 +-
 scripts/qemugdb/__init__.py                        |    3 +-
 scripts/qemugdb/aio.py                             |    3 +-
 scripts/qemugdb/coroutine.py                       |    3 +-
 scripts/qemugdb/mtree.py                           |    4 +-
 scripts/qemugdb/tcg.py                             |    1 -
 scripts/qemugdb/timers.py                          |    1 -
 scripts/qmp/qmp                                    |    4 +-
 scripts/qmp/qmp-shell                              |    3 -
 scripts/qmp/qom-fuse                               |    4 +-
 scripts/qmp/qom-get                                |    6 +-
 scripts/qmp/qom-list                               |    6 +-
 scripts/qmp/qom-set                                |    6 +-
 scripts/qmp/qom-tree                               |    6 +-
 scripts/tracetool.py                               |    2 +-
 scripts/tracetool/__init__.py                      |    2 +-
 scripts/tracetool/backend/__init__.py              |    2 +-
 scripts/tracetool/backend/dtrace.py                |    2 +-
 scripts/tracetool/backend/log.py                   |    2 +-
 scripts/tracetool/backend/simple.py                |    2 +-
 scripts/tracetool/backend/ust.py                   |    2 +-
 scripts/tracetool/format/__init__.py               |    2 +-
 scripts/tracetool/format/c.py                      |    2 +-
 scripts/tracetool/format/d.py                      |    2 +-
 scripts/tracetool/format/h.py                      |    2 +-
 scripts/tracetool/format/stap.py                   |    2 +-
 scripts/tracetool/format/tcg_h.py                  |    2 +-
 scripts/tracetool/format/tcg_helper_c.py           |    2 +-
 scripts/tracetool/format/tcg_helper_h.py           |    2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py   |    2 +-
 scripts/tracetool/transform.py                     |    2 +-
 scripts/tracetool/vcpu.py                          |    2 +-
 scsi/pr-manager-helper.c                           |    3 +-
 scsi/qemu-pr-helper.c                              |    4 +-
 softmmu/vl.c                                       |   30 +-
 stubs/Makefile.objs                                |   52 +-
 stubs/cmos.c                                       |    7 +
 stubs/qmp_memory_device.c                          |    1 -
 stubs/ramfb.c                                      |    2 +-
 stubs/win32-kbd-hook.c                             |   18 +
 stubs/xen-common.c                                 |   13 -
 stubs/xen-hvm.c                                    |   62 -
 target/alpha/cpu-param.h                           |   15 +-
 target/arm/Makefile.objs                           |   19 +
 target/arm/cpu-param.h                             |    2 +-
 target/arm/cpu-qom.h                               |    9 +-
 target/arm/cpu.c                                   |  689 +--
 target/arm/cpu.h                                   |   56 +-
 target/arm/cpu64.c                                 |   56 +-
 target/arm/cpu_tcg.c                               |  665 +++
 target/arm/crypto_helper.c                         |  271 +-
 target/arm/gdbstub.c                               |   22 +-
 target/arm/helper-sve.h                            |   53 +-
 target/arm/helper.c                                |  234 +-
 target/arm/helper.h                                |  158 +-
 target/arm/internals.h                             |   10 +-
 target/arm/kvm.c                                   |   25 +-
 target/arm/kvm32.c                                 |   13 +-
 target/arm/kvm64.c                                 |  113 +-
 target/arm/kvm_arm.h                               |   21 +-
 target/arm/neon-dp.decode                          |  635 +++
 target/arm/neon-ls.decode                          |   52 +
 target/arm/neon-shared.decode                      |   66 +
 target/arm/neon_helper.c                           |   41 -
 target/arm/sve_helper.c                            | 2438 +++++-----
 target/arm/t32.decode                              |    4 +-
 target/arm/tlb_helper.c                            |    2 +-
 target/arm/translate-a64.c                         |  552 +--
 target/arm/translate-a64.h                         |   10 +-
 target/arm/translate-neon.inc.c                    | 4161 +++++++++++++++++
 target/arm/translate-sve.c                         |  103 +-
 target/arm/translate-vfp.inc.c                     |   13 +-
 target/arm/translate.c                             | 4912 +++++---------------
 target/arm/translate.h                             |  108 +-
 target/arm/vec_helper.c                            |  277 +-
 target/arm/vec_internal.h                          |   33 +
 target/arm/vfp_helper.c                            |   23 +-
 target/hppa/op_helper.c                            |    7 +-
 target/i386/TODO                                   |   31 -
 target/i386/cpu.c                                  |  174 +-
 target/i386/cpu.h                                  |   17 +-
 target/i386/fpu_helper.c                           |  266 +-
 target/i386/hax-all.c                              |   25 +-
 target/i386/hax-i386.h                             |    7 +-
 target/i386/hvf/hvf-i386.h                         |   37 +-
 target/i386/hvf/hvf.c                              |   30 +-
 target/i386/hvf/x86.c                              |    2 +-
 target/i386/hvf/x86.h                              |   89 +-
 target/i386/hvf/x86_decode.c                       |   25 +-
 target/i386/hvf/x86_emu.c                          |  122 +-
 target/i386/hvf/x86_flags.c                        |   81 +-
 target/i386/hvf/x86_task.c                         |   10 +-
 target/i386/hvf/x86hvf.c                           |    6 +-
 target/i386/kvm.c                                  |   70 +-
 target/i386/misc_helper.c                          |    2 +-
 target/i386/ops_sse.h                              |   65 +-
 target/i386/sev.c                                  |  274 +-
 target/i386/sev_i386.h                             |   49 -
 target/m68k/cpu.c                                  |   52 +-
 target/m68k/fpu_helper.c                           |   11 +-
 target/m68k/helper.c                               |    3 +-
 target/m68k/helper.h                               |    1 +
 target/m68k/softfloat.c                            |   70 +-
 target/m68k/translate.c                            |   17 +
 target/microblaze/cpu.c                            |   26 +-
 target/microblaze/cpu.h                            |    6 +
 target/microblaze/gdbstub.c                        |   91 +-
 target/microblaze/op_helper.c                      |    5 +-
 target/microblaze/translate.c                      |   27 +-
 target/mips/Makefile.objs                          |    2 +-
 target/mips/cpu-param.h                            |    5 +
 target/mips/cpu.h                                  |   32 +-
 target/mips/fpu_helper.c                           |  658 ++-
 target/mips/helper.h                               |   73 +-
 target/mips/internal.h                             |    3 +-
 target/mips/kvm.c                                  |  212 +
 target/mips/lmi_helper.c                           |  747 ---
 target/mips/lmmi_helper.c                          |  747 +++
 target/mips/machine.c                              |    6 +-
 target/mips/mips-defs.h                            |   51 +-
 target/mips/msa_helper.c                           | 1351 ++++--
 target/mips/translate.c                            |  215 +-
 target/mips/translate_init.inc.c                   |   95 +-
 target/openrisc/fpu_helper.c                       |    4 +-
 target/ppc/compat.c                                |   14 +-
 target/ppc/cpu.h                                   |   40 +-
 target/ppc/excp_helper.c                           |  152 +-
 target/ppc/gdbstub.c                               |    4 +-
 target/ppc/helper.h                                |    5 +-
 target/ppc/int_helper.c                            |   30 +-
 target/ppc/kvm_ppc.h                               |   22 +-
 target/ppc/mmu-radix64.c                           |  481 +-
 target/ppc/mmu-radix64.h                           |    4 +-
 target/ppc/mmu_helper.c                            |    2 +-
 target/ppc/translate.c                             |   77 +-
 target/ppc/translate/vmx-impl.inc.c                |   40 +-
 target/ppc/translate/vsx-impl.inc.c                |    2 +-
 target/ppc/translate_init.inc.c                    |   18 +-
 target/riscv/cpu.c                                 |   94 +-
 target/riscv/cpu.h                                 |   10 +-
 target/riscv/cpu_helper.c                          |  107 +-
 target/riscv/csr.c                                 |  138 +-
 target/riscv/helper.h                              |    5 +
 target/riscv/insn32.decode                         |    8 +-
 target/riscv/insn_trans/trans_privileged.inc.c     |   52 +-
 target/riscv/insn_trans/trans_rvf.inc.c            |   17 +-
 target/riscv/insn_trans/trans_rvh.inc.c            |   37 +
 target/riscv/monitor.c                             |    5 -
 target/riscv/op_helper.c                           |   30 +-
 target/riscv/pmp.c                                 |   14 +-
 target/riscv/translate.c                           |    1 +
 target/s390x/cpu.c                                 |   41 +-
 target/s390x/cpu.h                                 |    7 +-
 target/s390x/cpu_features_def.inc.h                |    3 +-
 target/s390x/cpu_models.c                          |   17 +-
 target/s390x/diag.c                                |   75 +-
 target/s390x/fpu_helper.c                          |   22 +-
 target/s390x/gen-features.c                        |    1 +
 target/s390x/helper.c                              |   11 +-
 target/s390x/helper.h                              |    4 -
 target/s390x/insn-data.def                         |    4 +-
 target/s390x/internal.h                            |   16 +-
 target/s390x/ioinst.c                              |   99 +-
 target/s390x/kvm-stub.c                            |    5 +
 target/s390x/kvm.c                                 |   83 +-
 target/s390x/kvm_s390x.h                           |    3 +
 target/s390x/mmu_helper.c                          |   14 +
 target/s390x/translate_vx.inc.c                    |  107 +-
 target/s390x/vec_fpu_helper.c                      |    2 +-
 target/s390x/vec_int_helper.c                      |   31 -
 target/sparc/fop_helper.c                          |    4 +-
 target/sparc/int32_helper.c                        |   23 +-
 target/tricore/Makefile.objs                       |    2 +-
 target/tricore/cpu.c                               |   18 +-
 target/tricore/cpu.h                               |    2 +
 target/tricore/gdbstub.c                           |  139 +
 target/tricore/helper.c                            |   13 +
 target/tricore/translate.c                         |   79 +-
 target/unicore32/helper.c                          |   70 +-
 target/unicore32/ucf64_helper.c                    |    6 +-
 target/xtensa/fpu_helper.c                         |    6 +-
 tcg/README                                         |    7 +-
 tcg/aarch64/tcg-target.h                           |    3 +
 tcg/aarch64/tcg-target.inc.c                       |   53 +-
 tcg/aarch64/tcg-target.opc.h                       |    1 +
 tcg/i386/tcg-target.h                              |    3 +
 tcg/i386/tcg-target.inc.c                          |  116 +-
 tcg/ppc/tcg-target.h                               |    3 +
 tcg/ppc/tcg-target.inc.c                           |   23 +-
 tcg/ppc/tcg-target.opc.h                           |    1 -
 tcg/tcg-op-gvec.c                                  |  376 +-
 tcg/tcg-op-vec.c                                   |   62 +-
 tcg/tcg-op.c                                       |   16 +-
 tcg/tcg.c                                          |   98 +-
 tests/Makefile.include                             |   76 +-
 tests/acceptance/avocado_qemu/__init__.py          |   13 +-
 tests/acceptance/boot_linux.py                     |   49 +-
 tests/acceptance/boot_linux_console.py             |   84 +-
 tests/acceptance/machine_arm_canona1100.py         |   35 +
 tests/acceptance/machine_rx_gdbsim.py              |   68 +
 tests/acceptance/migration.py                      |    4 +
 tests/acceptance/replay_kernel.py                  |  300 ++
 tests/benchmark-crypto-hash.c                      |   73 +-
 tests/check-qlist.c                                |   37 +-
 tests/check-qom-proplist.c                         |   70 +-
 tests/data/acpi/pc/DSDT                            |  Bin 5131 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat                   |  Bin 6455 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge                     |  Bin 6990 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp                       |  Bin 5594 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm                    |  Bin 6784 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs                    |  Bin 5203 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp                      |  Bin 6490 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem                    |  Bin 5137 -> 4940 bytes
 tests/data/acpi/pc/SRAT.dimmpxm                    |  Bin 392 -> 392 bytes
 tests/data/acpi/pc/SSDT.dimmpxm                    |  Bin 685 -> 734 bytes
 tests/data/acpi/pc/WAET                            |  Bin 0 -> 40 bytes
 tests/data/acpi/q35/DSDT                           |  Bin 7869 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat                  |  Bin 9193 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge                    |  Bin 7886 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp                      |  Bin 8332 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm                   |  Bin 9522 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt                    |  Bin 7944 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp                     |  Bin 9228 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64                    |  Bin 8999 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem                   |  Bin 7875 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis                       |  Bin 0 -> 8283 bytes
 tests/data/acpi/q35/SRAT.dimmpxm                   |  Bin 392 -> 392 bytes
 tests/data/acpi/q35/SSDT.dimmpxm                   |  Bin 685 -> 734 bytes
 tests/data/acpi/q35/TPM2.tis                       |  Bin 0 -> 76 bytes
 tests/data/acpi/q35/WAET                           |  Bin 0 -> 40 bytes
 tests/data/acpi/virt/DSDT.memhp                    |  Bin 6644 -> 6668 bytes
 tests/data/acpi/virt/NFIT.memhp                    |  Bin 0 -> 224 bytes
 tests/data/acpi/virt/SRAT.memhp                    |  Bin 186 -> 226 bytes
 tests/data/acpi/virt/SSDT.memhp                    |  Bin 0 -> 736 bytes
 tests/decode/err_pattern_group_nest1.decode        |   11 +-
 tests/decode/err_pattern_group_nest2.decode        |    6 +
 tests/decode/err_pattern_group_nest3.decode        |   14 +
 tests/decode/succ_pattern_group_nest2.decode       |   13 +
 tests/decode/succ_pattern_group_nest3.decode       |   11 +
 tests/decode/succ_pattern_group_nest4.decode       |   13 +
 tests/docker/Makefile.include                      |    8 +-
 tests/docker/docker.py                             |   19 +-
 tests/docker/dockerfiles/centos7.docker            |    2 -
 tests/docker/dockerfiles/centos8.docker            |    2 -
 .../dockerfiles/debian-arm64-test-cross.docker     |   13 +
 .../docker/dockerfiles/debian-xtensa-cross.docker  |    2 -
 tests/docker/dockerfiles/debian10.docker           |    2 -
 tests/docker/dockerfiles/debian11.docker           |   18 +
 tests/docker/dockerfiles/debian9.docker            |    2 -
 tests/docker/dockerfiles/fedora.docker             |    4 +-
 tests/docker/dockerfiles/ubuntu.docker             |    4 +-
 tests/docker/dockerfiles/ubuntu1804.docker         |    2 +-
 tests/docker/dockerfiles/ubuntu2004.docker         |   65 +
 tests/docker/test-tsan                             |   44 +
 tests/fp/fp-test.c                                 |    2 +-
 tests/guest-debug/run-test.py                      |   36 +-
 tests/migration/guestperf-batch.py                 |    2 +-
 tests/migration/guestperf-plot.py                  |    2 +-
 tests/migration/guestperf.py                       |    2 +-
 tests/migration/stress.c                           |   34 +-
 tests/plugin/Makefile                              |    3 +-
 tests/plugin/lockstep.c                            |  340 ++
 tests/plugin/mem.c                                 |    2 +-
 tests/qemu-iotests/001                             |    2 +-
 tests/qemu-iotests/030                             |   10 +-
 tests/qemu-iotests/031.out                         |   36 +-
 tests/qemu-iotests/036.out                         |    8 +-
 tests/qemu-iotests/041                             |   57 +-
 tests/qemu-iotests/041.out                         |    4 +-
 tests/qemu-iotests/049.out                         |  110 +-
 tests/qemu-iotests/052                             |    2 +-
 tests/qemu-iotests/055                             |  121 +-
 tests/qemu-iotests/055.out                         |    4 +-
 tests/qemu-iotests/059                             |    6 +-
 tests/qemu-iotests/060.out                         |    1 +
 tests/qemu-iotests/061                             |   35 +
 tests/qemu-iotests/061.out                         |   76 +-
 tests/qemu-iotests/065                             |   28 +-
 tests/qemu-iotests/080                             |    2 +-
 tests/qemu-iotests/082                             |    1 +
 tests/qemu-iotests/082.out                         |   48 +-
 tests/qemu-iotests/085.out                         |   38 +-
 tests/qemu-iotests/091                             |    2 +-
 tests/qemu-iotests/098.out                         |    8 +-
 tests/qemu-iotests/109                             |   11 +-
 tests/qemu-iotests/109.out                         |   74 +-
 tests/qemu-iotests/113                             |    4 +-
 tests/qemu-iotests/118                             |    7 +-
 tests/qemu-iotests/134                             |    2 +-
 tests/qemu-iotests/143                             |    4 +
 tests/qemu-iotests/143.out                         |    2 +
 tests/qemu-iotests/144.out                         |    4 +-
 tests/qemu-iotests/148                             |    1 +
 tests/qemu-iotests/149                             |    3 +-
 tests/qemu-iotests/153                             |    2 +-
 tests/qemu-iotests/153.out                         |   12 +-
 tests/qemu-iotests/155                             |    2 +-
 tests/qemu-iotests/172                             |   27 +-
 tests/qemu-iotests/172.out                         | 1154 +++--
 tests/qemu-iotests/178.out.qcow2                   |   18 +-
 tests/qemu-iotests/178.out.raw                     |    2 +-
 tests/qemu-iotests/182.out                         |    2 +-
 tests/qemu-iotests/185.out                         |    8 +-
 tests/qemu-iotests/188                             |    2 +-
 tests/qemu-iotests/190                             |   49 +-
 tests/qemu-iotests/190.out                         |   27 +-
 tests/qemu-iotests/194                             |   28 +-
 tests/qemu-iotests/194.out                         |   11 +
 tests/qemu-iotests/198.out                         |    2 +
 tests/qemu-iotests/202                             |    4 +-
 tests/qemu-iotests/203                             |    4 +-
 tests/qemu-iotests/206                             |    2 +-
 tests/qemu-iotests/206.out                         |    5 +
 tests/qemu-iotests/207                             |    6 +-
 tests/qemu-iotests/208                             |    2 +-
 tests/qemu-iotests/209                             |    2 +-
 tests/qemu-iotests/210                             |    6 +-
 tests/qemu-iotests/211                             |    6 +-
 tests/qemu-iotests/212                             |    6 +-
 tests/qemu-iotests/213                             |    6 +-
 tests/qemu-iotests/216                             |    4 +-
 tests/qemu-iotests/218                             |    2 +-
 tests/qemu-iotests/219                             |    2 +-
 tests/qemu-iotests/222                             |    7 +-
 tests/qemu-iotests/223                             |    6 +-
 tests/qemu-iotests/223.out                         |    3 +-
 tests/qemu-iotests/224                             |    4 +-
 tests/qemu-iotests/228                             |    6 +-
 tests/qemu-iotests/229                             |   21 +-
 tests/qemu-iotests/229.out                         |    6 +-
 tests/qemu-iotests/234                             |    4 +-
 tests/qemu-iotests/235                             |    4 +-
 tests/qemu-iotests/236                             |    2 +-
 tests/qemu-iotests/237                             |    2 +-
 tests/qemu-iotests/238                             |    2 +
 tests/qemu-iotests/242                             |    2 +-
 tests/qemu-iotests/242.out                         |    5 +
 tests/qemu-iotests/244                             |   10 +-
 tests/qemu-iotests/244.out                         |    9 +-
 tests/qemu-iotests/245                             |    1 +
 tests/qemu-iotests/245.out                         |   10 +-
 tests/qemu-iotests/246                             |    2 +-
 tests/qemu-iotests/248                             |    2 +-
 tests/qemu-iotests/254                             |    2 +-
 tests/qemu-iotests/255                             |    2 +-
 tests/qemu-iotests/255.out                         |    8 +-
 tests/qemu-iotests/256                             |    2 +-
 tests/qemu-iotests/258                             |   10 +-
 tests/qemu-iotests/260                             |    4 +-
 tests/qemu-iotests/262                             |    4 +-
 tests/qemu-iotests/264                             |    4 +-
 tests/qemu-iotests/274                             |  155 +
 tests/qemu-iotests/274.out                         |  271 ++
 tests/qemu-iotests/277                             |    2 +
 tests/qemu-iotests/280                             |    8 +-
 tests/qemu-iotests/280.out                         |    2 +-
 tests/qemu-iotests/283                             |   10 +-
 tests/qemu-iotests/283.out                         |    2 +-
 tests/qemu-iotests/287                             |  152 +
 tests/qemu-iotests/287.out                         |   67 +
 tests/qemu-iotests/291                             |  118 +
 tests/qemu-iotests/291.out                         |  113 +
 tests/qemu-iotests/292                             |   78 +
 tests/qemu-iotests/292.out                         |   24 +
 tests/qemu-iotests/297                             |   44 +
 tests/qemu-iotests/297.out                         |    3 +
 tests/qemu-iotests/check                           |    3 +
 tests/qemu-iotests/common.filter                   |    8 +-
 tests/qemu-iotests/common.rc                       |   37 +-
 tests/qemu-iotests/group                           |    5 +
 tests/qemu-iotests/iotests.py                      |  390 +-
 tests/qemu-iotests/nbd-fault-injector.py           |    5 +-
 tests/qemu-iotests/pylintrc                        |   26 +
 tests/qemu-iotests/qcow2.py                        |  220 +-
 tests/qemu-iotests/qcow2_format.py                 |  287 ++
 tests/qht-bench.c                                  |    3 +-
 tests/qtest/Makefile.include                       |    8 +-
 tests/qtest/arm-cpu-features.c                     |   38 +-
 tests/qtest/bios-tables-test-allowed-diff.h        |   18 +
 tests/qtest/bios-tables-test.c                     |   73 +-
 tests/qtest/e1000e-test.c                          |    2 +-
 tests/qtest/endianness-test.c                      |    2 +-
 tests/qtest/fuzz/Makefile.include                  |   27 +-
 tests/qtest/fuzz/fork_fuzz.ld                      |    5 +
 tests/qtest/fuzz/fuzz.c                            |   48 +-
 tests/qtest/fuzz/fuzz.h                            |    3 +
 tests/qtest/fuzz/i440fx_fuzz.c                     |   50 +-
 tests/qtest/fuzz/qos_fuzz.c                        |    2 +-
 tests/qtest/fuzz/qtest_wrappers.c                  |  252 +
 tests/qtest/fuzz/virtio_net_fuzz.c                 |    2 +
 tests/qtest/fuzz/virtio_scsi_fuzz.c                |    2 +
 tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c   |    2 +-
 tests/qtest/libqos/arm-imx25-pdk-machine.c         |    2 +-
 tests/qtest/libqos/arm-n800-machine.c              |    2 +-
 tests/qtest/libqos/arm-raspi2-machine.c            |    2 +-
 tests/qtest/libqos/arm-sabrelite-machine.c         |    2 +-
 tests/qtest/libqos/arm-smdkc210-machine.c          |    2 +-
 tests/qtest/libqos/arm-virt-machine.c              |    2 +-
 tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c    |    2 +-
 tests/qtest/libqos/e1000e.c                        |    2 +-
 tests/qtest/libqos/e1000e.h                        |    2 +-
 tests/qtest/libqos/ppc64_pseries-machine.c         |    2 +-
 tests/qtest/libqos/qgraph.c                        |    2 +-
 tests/qtest/libqos/qgraph.h                        |    2 +-
 tests/qtest/libqos/qgraph_internal.h               |    2 +-
 tests/qtest/libqos/qos_external.c                  |    2 +-
 tests/qtest/libqos/qos_external.h                  |    2 +-
 tests/qtest/libqos/sdhci.c                         |    2 +-
 tests/qtest/libqos/sdhci.h                         |    2 +-
 tests/qtest/libqos/virtio-9p.c                     |    2 +-
 tests/qtest/libqos/virtio-9p.h                     |    2 +-
 tests/qtest/libqos/virtio-balloon.c                |    2 +-
 tests/qtest/libqos/virtio-balloon.h                |    2 +-
 tests/qtest/libqos/virtio-blk.c                    |    2 +-
 tests/qtest/libqos/virtio-blk.h                    |    2 +-
 tests/qtest/libqos/virtio-net.c                    |    2 +-
 tests/qtest/libqos/virtio-net.h                    |    2 +-
 tests/qtest/libqos/virtio-rng.c                    |    2 +-
 tests/qtest/libqos/virtio-rng.h                    |    2 +-
 tests/qtest/libqos/virtio-scsi.c                   |    2 +-
 tests/qtest/libqos/virtio-scsi.h                   |    2 +-
 tests/qtest/libqos/virtio-serial.c                 |    2 +-
 tests/qtest/libqos/virtio-serial.h                 |    2 +-
 tests/qtest/libqos/x86_64_pc-machine.c             |    2 +-
 tests/qtest/machine-none-test.c                    |   14 +-
 tests/qtest/migration-test.c                       |    4 +-
 tests/qtest/qos-test.c                             |    2 +-
 tests/qtest/test-hmp.c                             |    1 +
 tests/qtest/tpm-emu.c                              |    3 +-
 tests/qtest/tpm-emu.h                              |    3 +
 tests/tcg/Makefile.target                          |   12 +-
 tests/tcg/aarch64/Makefile.softmmu-target          |    2 +-
 tests/tcg/aarch64/Makefile.target                  |   10 +-
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py        |    4 -
 tests/tcg/aarch64/gdbstub/test-sve.py              |    4 -
 tests/tcg/arm/Makefile.target                      |    4 +-
 tests/tcg/arm/commpage.c                           |   61 +
 tests/tcg/configure.sh                             |    4 +-
 tests/tcg/cris/Makefile.target                     |    1 +
 tests/tcg/i386/Makefile.target                     |    4 +
 tests/tcg/i386/test-i386-fbstp.c                   |  140 +
 tests/tcg/i386/test-i386-fisttp.c                  |  100 +
 tests/tcg/i386/test-i386-fldcst.c                  |  199 +
 tests/tcg/i386/test-i386-fp-exceptions.c           |  831 ++++
 tests/tcg/i386/test-i386-fscale.c                  |  108 +
 tests/tcg/i386/test-i386-fxam.c                    |  143 +
 tests/tcg/i386/test-i386-fxtract.c                 |  120 +
 tests/tcg/i386/test-i386-pcmpistri.c               |   33 +
 tests/tcg/i386/test-i386-pseudo-denormal.c         |   38 +
 tests/tcg/i386/test-i386-snan-convert.c            |   63 +
 tests/tcg/multiarch/Makefile.target                |   16 +
 tests/tcg/multiarch/gdbstub/sha1.py                |   85 +
 tests/tcg/multiarch/threadcount.c                  |   64 +
 tests/test-bdrv-drain.c                            |   72 +-
 tests/test-bdrv-graph-mod.c                        |   10 +-
 tests/test-block-iothread.c                        |   26 +-
 tests/test-crypto-secret.c                         |  158 +
 tests/test-io-task.c                               |    1 +
 tests/test-qdev-global-props.c                     |   13 +-
 tests/test-qobject-output-visitor.c                |   39 -
 tests/test-string-output-visitor.c                 |   19 -
 tests/test-util-sockets.c                          |   92 +
 tests/tsan/blacklist.tsan                          |   10 +
 tests/tsan/suppressions.tsan                       |   14 +
 tests/vm/Makefile.include                          |    6 +
 tests/vm/basevm.py                                 |   54 +-
 tests/vm/fedora                                    |    1 -
 tests/vm/freebsd                                   |    1 -
 tests/vm/netbsd                                    |    1 -
 tests/vm/openbsd                                   |    1 -
 tests/vm/ubuntu.i386                               |    2 +-
 tools/virtiofsd/fuse_lowlevel.h                    |    1 +
 tools/virtiofsd/helper.c                           |   47 +
 tools/virtiofsd/passthrough_ll.c                   |  277 +-
 tools/virtiofsd/seccomp.c                          |    1 +
 trace/simple.c                                     |   20 +-
 trace/simple.h                                     |    2 +-
 ui/Makefile.objs                                   |    3 +
 ui/console.c                                       |    7 +-
 ui/gtk.c                                           |  197 +-
 ui/input-barrier.c                                 |   14 +-
 ui/input-linux.c                                   |    8 +-
 ui/sdl2-input.c                                    |    3 +
 ui/sdl2.c                                          |   45 +-
 ui/spice-display.c                                 |   14 +-
 ui/trace-events                                    |    3 +
 ui/vnc.c                                           |    2 +-
 ui/win32-kbd-hook.c                                |  102 +
 util/Makefile.objs                                 |   59 +-
 util/aio-posix.c                                   |   13 +
 util/aio-win32.c                                   |    4 +
 util/async.c                                       |    1 +
 util/coroutine-ucontext.c                          |   66 +-
 util/fdmon-io_uring.c                              |   13 +-
 util/log.c                                         |    4 +-
 util/oslib-posix.c                                 |   24 +
 util/qemu-option.c                                 |   43 +-
 util/qemu-sockets.c                                |   44 +-
 util/qemu-thread-posix.c                           |    2 +
 util/qemu-timer.c                                  |   17 +-
 util/qht.c                                         |    1 +
 util/rcu.c                                         |    8 +-
 util/systemd.c                                     |    4 +-
 util/thread-pool.c                                 |    3 +-
 util/vfio-helpers.c                                |    5 +-
 1584 files changed, 65536 insertions(+), 30718 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 90645fede6..69342ae031 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -3,18 +3,18 @@ env:
 
 freebsd_12_task:
   freebsd_instance:
-    image: freebsd-12-0-release-amd64
+    image_family: freebsd-12-1
     cpu: 8
     memory: 8G
-  install_script: pkg install -y
-    bash bison curl cyrus-sasl git glib gmake gnutls gsed
+  install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y
+    bash curl cyrus-sasl git glib gmake gnutls gsed
     nettle perl5 pixman pkgconf png usbredir
   script:
     - mkdir build
     - cd build
     - ../configure || { cat config.log; exit 1; }
     - gmake -j8
-    - gmake -j8 V=1 check
+    - gmake V=1 check
 
 macos_task:
   osx_instance:
@@ -26,7 +26,7 @@ macos_task:
     - cd build
     - ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
-    - gmake check -j$(sysctl -n hw.ncpu)
+    - gmake check
 
 macos_xcode_task:
   osx_instance:
@@ -39,4 +39,4 @@ macos_xcode_task:
     - cd build
     - ../configure --cc=clang || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
-    - gmake check -j$(sysctl -n hw.ncpu)
+    - gmake check
diff --git a/.gitignore b/.gitignore
index 0c5af83aa7..90acb4347d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,18 +34,18 @@
 /qapi/qapi-builtin-types.[ch]
 /qapi/qapi-builtin-visit.[ch]
 /qapi/qapi-commands-*.[ch]
-/qapi/qapi-commands.[ch]
-/qapi/qapi-emit-events.[ch]
+**/qapi/qapi-commands.[ch]
+**/qapi/qapi-emit-events.[ch]
 /qapi/qapi-events-*.[ch]
-/qapi/qapi-events.[ch]
-/qapi/qapi-init-commands.[ch]
-/qapi/qapi-introspect.[ch]
+**/qapi/qapi-events.[ch]
+**/qapi/qapi-init-commands.[ch]
+**/qapi/qapi-introspect.[ch]
 /qapi/qapi-types-*.[ch]
-/qapi/qapi-types.[ch]
+**/qapi/qapi-types.[ch]
 /qapi/qapi-visit-*.[ch]
 !/qapi/qapi-visit-core.c
-/qapi/qapi-visit.[ch]
-/qapi/qapi-doc.texi
+**/qapi/qapi-visit.[ch]
+**/qapi/qapi-doc.texi
 /qemu-edid
 /qemu-img
 /qemu-nbd
@@ -59,6 +59,7 @@
 /qemu-keymap
 /qemu-monitor.texi
 /qemu-monitor-info.texi
+/qemu-storage-daemon
 /qemu-version.h
 /qemu-version.h.tmp
 /module_block.h
diff --git a/.gitlab-ci-edk2.yml b/.gitlab-ci-edk2.yml
deleted file mode 100644
index 088ba4b43a..0000000000
--- a/.gitlab-ci-edk2.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-docker-edk2:
- stage: build
- rules: # Only run this job when the Dockerfile is modified
- - changes:
-   - .gitlab-ci-edk2.yml
-   - .gitlab-ci.d/edk2/Dockerfile
-   when: always
- image: docker:19.03.1
- services:
- - docker:19.03.1-dind
- variables:
-  GIT_DEPTH: 3
-  IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
-  # We don't use TLS
-  DOCKER_HOST: tcp://docker:2375
-  DOCKER_TLS_CERTDIR: ""
- before_script:
- - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- script:
- - docker pull $IMAGE_TAG || true
- - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-                                        --tag $IMAGE_TAG .gitlab-ci.d/edk2
- - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- - docker push $IMAGE_TAG
-
-build-edk2:
- rules: # Only run this job when ...
- - changes: # ... roms/edk2/ is modified (submodule updated)
-   - roms/edk2/*
-   when: always
- - if: '$CI_COMMIT_REF_NAME =~ /^edk2/' # or the branch/tag starts with 'edk2'
-   when: always
- - if: '$CI_COMMIT_MESSAGE =~ /edk2/i' # or last commit description contains 'EDK2'
-   when: always
- artifacts:
-   paths: # 'artifacts.zip' will contains the following files:
-   - pc-bios/edk2*bz2
-   - pc-bios/edk2-licenses.txt
-   - edk2-stdout.log
-   - edk2-stderr.log
- image: $CI_REGISTRY_IMAGE:edk2-cross-build
- variables:
-   GIT_DEPTH: 3
- script: # Clone the required submodules and build EDK2
- - git submodule update --init roms/edk2
- - git -C roms/edk2 submodule update --init
- - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
- - echo "=== Using ${JOBS} simultaneous jobs ==="
- - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
diff --git a/.gitlab-ci-opensbi.yml b/.gitlab-ci-opensbi.yml
deleted file mode 100644
index dd051c0124..0000000000
--- a/.gitlab-ci-opensbi.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-docker-opensbi:
- stage: build
- rules: # Only run this job when the Dockerfile is modified
- - changes:
-   - .gitlab-ci-opensbi.yml
-   - .gitlab-ci.d/opensbi/Dockerfile
-   when: always
- image: docker:19.03.1
- services:
- - docker:19.03.1-dind
- variables:
-  GIT_DEPTH: 3
-  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
-  # We don't use TLS
-  DOCKER_HOST: tcp://docker:2375
-  DOCKER_TLS_CERTDIR: ""
- before_script:
- - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- script:
- - docker pull $IMAGE_TAG || true
- - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
- - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- - docker push $IMAGE_TAG
-
-build-opensbi:
- rules: # Only run this job when ...
- - changes: # ... roms/opensbi/ is modified (submodule updated)
-   - roms/opensbi/*
-   when: always
- - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
-   when: always
- - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
-   when: always
- artifacts:
-   paths: # 'artifacts.zip' will contains the following files:
-   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
-   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
-   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
-   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
-   - opensbi32-virt-stdout.log
-   - opensbi32-virt-stderr.log
-   - opensbi64-virt-stdout.log
-   - opensbi64-virt-stderr.log
-   - opensbi32-sifive_u-stdout.log
-   - opensbi32-sifive_u-stderr.log
-   - opensbi64-sifive_u-stdout.log
-   - opensbi64-sifive_u-stderr.log
- image: $CI_REGISTRY_IMAGE:opensbi-cross-build
- variables:
-   GIT_DEPTH: 3
- script: # Clone the required submodules and build OpenSBI
- - git submodule update --init roms/opensbi
- - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
- - echo "=== Using ${JOBS} simultaneous jobs ==="
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2
diff --git a/.gitlab-ci.d/edk2.yml b/.gitlab-ci.d/edk2.yml
new file mode 100644
index 0000000000..088ba4b43a
--- /dev/null
+++ b/.gitlab-ci.d/edk2.yml
@@ -0,0 +1,49 @@
+docker-edk2:
+ stage: build
+ rules: # Only run this job when the Dockerfile is modified
+ - changes:
+   - .gitlab-ci-edk2.yml
+   - .gitlab-ci.d/edk2/Dockerfile
+   when: always
+ image: docker:19.03.1
+ services:
+ - docker:19.03.1-dind
+ variables:
+  GIT_DEPTH: 3
+  IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
+  # We don't use TLS
+  DOCKER_HOST: tcp://docker:2375
+  DOCKER_TLS_CERTDIR: ""
+ before_script:
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ script:
+ - docker pull $IMAGE_TAG || true
+ - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+                                        --tag $IMAGE_TAG .gitlab-ci.d/edk2
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+ - docker push $IMAGE_TAG
+
+build-edk2:
+ rules: # Only run this job when ...
+ - changes: # ... roms/edk2/ is modified (submodule updated)
+   - roms/edk2/*
+   when: always
+ - if: '$CI_COMMIT_REF_NAME =~ /^edk2/' # or the branch/tag starts with 'edk2'
+   when: always
+ - if: '$CI_COMMIT_MESSAGE =~ /edk2/i' # or last commit description contains 'EDK2'
+   when: always
+ artifacts:
+   paths: # 'artifacts.zip' will contains the following files:
+   - pc-bios/edk2*bz2
+   - pc-bios/edk2-licenses.txt
+   - edk2-stdout.log
+   - edk2-stderr.log
+ image: $CI_REGISTRY_IMAGE:edk2-cross-build
+ variables:
+   GIT_DEPTH: 3
+ script: # Clone the required submodules and build EDK2
+ - git submodule update --init roms/edk2
+ - git -C roms/edk2 submodule update --init
+ - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
+ - echo "=== Using ${JOBS} simultaneous jobs ==="
+ - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
new file mode 100644
index 0000000000..dd051c0124
--- /dev/null
+++ b/.gitlab-ci.d/opensbi.yml
@@ -0,0 +1,63 @@
+docker-opensbi:
+ stage: build
+ rules: # Only run this job when the Dockerfile is modified
+ - changes:
+   - .gitlab-ci-opensbi.yml
+   - .gitlab-ci.d/opensbi/Dockerfile
+   when: always
+ image: docker:19.03.1
+ services:
+ - docker:19.03.1-dind
+ variables:
+  GIT_DEPTH: 3
+  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
+  # We don't use TLS
+  DOCKER_HOST: tcp://docker:2375
+  DOCKER_TLS_CERTDIR: ""
+ before_script:
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ script:
+ - docker pull $IMAGE_TAG || true
+ - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+ - docker push $IMAGE_TAG
+
+build-opensbi:
+ rules: # Only run this job when ...
+ - changes: # ... roms/opensbi/ is modified (submodule updated)
+   - roms/opensbi/*
+   when: always
+ - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
+   when: always
+ - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
+   when: always
+ artifacts:
+   paths: # 'artifacts.zip' will contains the following files:
+   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
+   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
+   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
+   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
+   - opensbi32-virt-stdout.log
+   - opensbi32-virt-stderr.log
+   - opensbi64-virt-stdout.log
+   - opensbi64-virt-stderr.log
+   - opensbi32-sifive_u-stdout.log
+   - opensbi32-sifive_u-stderr.log
+   - opensbi64-sifive_u-stdout.log
+   - opensbi64-sifive_u-stderr.log
+ image: $CI_REGISTRY_IMAGE:opensbi-cross-build
+ variables:
+   GIT_DEPTH: 3
+ script: # Clone the required submodules and build OpenSBI
+ - git submodule update --init roms/opensbi
+ - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
+ - echo "=== Using ${JOBS} simultaneous jobs ==="
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b889fb96b6..349c77aa58 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,24 @@
 include:
-  - local: '/.gitlab-ci-edk2.yml'
-  - local: '/.gitlab-ci-opensbi.yml'
+  - local: '/.gitlab-ci.d/edk2.yml'
+  - local: '/.gitlab-ci.d/opensbi.yml'
 
-before_script:
- - apt-get update -qq
- - apt-get install -y -qq flex bison libglib2.0-dev libpixman-1-dev genisoimage
+.update_apt_template: &before_script_apt
+ before_script:
+  - apt-get update -qq
+  - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make
+        genisoimage
+  - JOBS=$(expr $(nproc) + 1)
+
+.update_dnf_template: &before_script_dnf
+ before_script:
+  - dnf update -y
+  - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel
+        make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel
+  - JOBS=$(expr $(nproc) + 1)
 
 build-system1:
+ image: ubuntu:19.10
+ <<: *before_script_apt
  script:
  - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev
       libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev
@@ -15,23 +27,27 @@ build-system1:
  - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu
       cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu
       mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-system2:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq libsdl2-dev libgcrypt-dev libbrlapi-dev libaio-dev
-      libfdt-dev liblzo2-dev librdmacm-dev libibverbs-dev libibumad-dev
-      libzstd-dev
+ - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel
+       libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel
+       libzstd-devel
  - mkdir build
  - cd build
  - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu
       microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu
       sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-disabled:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
  - mkdir build
  - cd build
@@ -42,16 +58,18 @@ build-disabled:
       --disable-qom-cast-debug --disable-spice --disable-vhost-vsock
       --disable-vhost-net --disable-vhost-crypto --disable-vhost-user
       --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user"
- - make -j2
- - make -j2 check-qtest SPEED=slow
+ - make -j"$JOBS"
+ - make -j"$JOBS" check-qtest SPEED=slow
 
 build-tcg-disabled:
+ image: centos:8
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq clang libgtk-3-dev libusb-dev
+ - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel
  - mkdir build
  - cd build
  - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
- - make -j2
+ - make -j"$JOBS"
  - make check-unit
  - make check-qapi-schema
  - cd tests/qemu-iotests/
@@ -64,34 +82,39 @@ build-tcg-disabled:
             260 261 262 263 264 270 272 273 277 279
 
 build-user:
+ <<: *before_script_apt
  script:
  - mkdir build
  - cd build
  - ../configure --enable-werror --disable-system --disable-guest-agent
                --disable-capstone --disable-slirp --disable-fdt
- - make -j2
+ - make -j"$JOBS"
  - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user
 
 build-clang:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq clang libsdl2-dev libattr1-dev libcap-ng-dev
-      xfslibs-dev libiscsi-dev libnfs-dev libseccomp-dev gnutls-dev librbd-dev
+ - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel
+       libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel
  - mkdir build
  - cd build
  - ../configure --cc=clang --cxx=clang++ --enable-werror
       --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
                      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-tci:
+ image: centos:8
+ <<: *before_script_dnf
  script:
  - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
  - mkdir build
  - cd build
  - ../configure --enable-tcg-interpreter
       --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
- - make -j2
+ - make -j"$JOBS"
  - make run-tcg-tests-x86_64-softmmu
  - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
  - for tg in $TARGETS ; do
diff --git a/.mailmap b/.mailmap
index 6412067bde..926cac6bb8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -42,14 +42,18 @@ Justin Terry (VM) <juterry@microsoft.com> Justin Terry (VM) via Qemu-devel <qemu
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@mips.com>
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgtec.com>
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
-Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com> <arikalo@wavecomp.com>
+Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <arikalo@wavecomp.com>
+Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <aleksandar.rikalo@rt-rk.com>
 Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
+Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
+Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
 James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
 Leif Lindholm <leif@nuviainc.com> <leif.lindholm@linaro.org>
 Paul Burton <pburton@wavecomp.com> <paul.burton@mips.com>
 Paul Burton <pburton@wavecomp.com> <paul.burton@imgtec.com>
 Paul Burton <pburton@wavecomp.com> <paul@archlinuxmips.org>
 Philippe Mathieu-Daudé <philmd@redhat.com> <f4bug@amsat.org>
+Stefan Brankovic <stefan.brankovic@syrmia.com> <stefan.brankovic@rt-rk.com.com>
 Yongbok Kim <yongbok.kim@mips.com> <yongbok.kim@imgtec.com>
 
 # Also list preferred name forms where people have changed their
diff --git a/.travis.yml b/.travis.yml
index 2fd63eceaa..74158f741b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,9 +9,8 @@ compiler:
 cache:
   # There is one cache per branch and compiler version.
   # characteristics of each job are used to identify the cache:
-  # - OS name (currently, linux, osx, or windows)
+  # - OS name (currently only linux)
   # - OS distribution (for Linux, xenial, trusty, or precise)
-  # - macOS image name (e.g., xcode7.2)
   # - Names and values of visible environment variables set in .travis.yml or Settings panel
   timeout: 1200
   ccache: true
@@ -113,6 +112,7 @@ script:
         $(exit $BUILD_RC);
     fi
 after_script:
+  - df -h
   - if command -v ccache ; then ccache --show-stats ; fi
 
 
@@ -205,14 +205,15 @@ jobs:
     # Test with Clang for compile portability (Travis uses clang-5.0)
     - name: "Clang (user)"
       env:
-        - CONFIG="--disable-system"
+        - CONFIG="--disable-system --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
       compiler: clang
 
 
     - name: "Clang (main-softmmu)"
       env:
-        - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} "
+        - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}
+                  --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
       compiler: clang
       before_script:
@@ -222,7 +223,8 @@ jobs:
 
     - name: "Clang (other-softmmu)"
       env:
-        - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+        - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
+                  --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
       compiler: clang
 
@@ -270,31 +272,6 @@ jobs:
         - TEST_CMD=""
 
 
-    # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
-
-    - name: "OSX Xcode 10.3"
-      env:
-        - BASE_CONFIG="--disable-docs --enable-tools"
-        - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
-      os: osx
-      osx_image: xcode10.3
-      compiler: clang
-      addons:
-        homebrew:
-          packages:
-            - ccache
-            - glib
-            - pixman
-            - gnu-sed
-            - python
-          update: true
-      before_script:
-        - brew link --overwrite python
-        - export PATH="/usr/local/opt/ccache/libexec:$PATH"
-        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
-        - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
-
-
     # Python builds
     - name: "GCC Python 3.5 (x86_64-softmmu)"
       env:
@@ -316,7 +293,7 @@ jobs:
     - name: "GCC check-acceptance"
       dist: bionic
       env:
-        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
+        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
         - TEST_CMD="make check-acceptance"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance"
       after_script:
@@ -452,6 +429,7 @@ jobs:
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
+        - UNRELIABLE=true
 
     - name: "[ppc64] GCC check-tcg"
       arch: ppc64le
@@ -483,7 +461,7 @@ jobs:
           - genisoimage
       env:
         - TEST_CMD="make check check-tcg V=1"
-        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
+        - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
 
     - name: "[s390x] GCC check-tcg"
       arch: s390x
@@ -516,8 +494,8 @@ jobs:
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
+        - UNRELIABLE=true
       script:
-        - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
         - |
           if [ "$BUILD_RC" -eq 0 ] ; then
@@ -527,9 +505,10 @@ jobs:
               $(exit $BUILD_RC);
           fi
 
-    - name: "[s390x] GCC check (KVM)"
+    - name: "[s390x] Clang (disable-tcg)"
       arch: s390x
       dist: bionic
+      compiler: clang
       addons:
         apt_packages:
           - libaio-dev
@@ -553,21 +532,11 @@ jobs:
           - libusb-1.0-0-dev
           - libvdeplug-dev
           - libvte-2.91-dev
-          # Tests dependencies
-          - genisoimage
       env:
         - TEST_CMD="make check-unit"
-        - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools"
-      script:
-        - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
-        - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
-        - |
-          if [ "$BUILD_RC" -eq 0 ] ; then
-              mv pc-bios/s390-ccw/*.img pc-bios/ ;
-              ${TEST_CMD} ;
-          else
-              $(exit $BUILD_RC);
-          fi
+        - CONFIG="--disable-containers --disable-tcg --enable-kvm
+                  --disable-tools --host-cc=clang --cxx=clang++"
+        - UNRELIABLE=true
 
     # Release builds
     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
@@ -589,3 +558,5 @@ jobs:
         - mkdir -p release-build && cd release-build
         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
         - make install
+  allow_failures:
+    - env: UNRELIABLE=true
diff --git a/MAINTAINERS b/MAINTAINERS
index 8cbc1fac2b..1b40446c73 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -85,6 +85,7 @@ Architecture support
 --------------------
 S390 general architecture support
 M: Cornelia Huck <cohuck@redhat.com>
+M: Thomas Huth <thuth@redhat.com>
 S: Supported
 F: default-configs/s390x-softmmu.mak
 F: gdb-xml/s390*.xml
@@ -115,6 +116,7 @@ M: Richard Henderson <rth@twiddle.net>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: cpus.c
+F: cpus-common.c
 F: exec.c
 F: accel/tcg/
 F: accel/stubs/tcg-stub.c
@@ -184,8 +186,8 @@ F: hw/net/*i82596*
 F: include/hw/net/lasi_82596.h
 
 LM32 TCG CPUs
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: target/lm32/
 F: disas/lm32.c
 F: hw/lm32/
@@ -212,7 +214,7 @@ F: disas/microblaze.c
 MIPS TCG CPUs
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: target/mips/
 F: default-configs/*mips*
@@ -294,7 +296,7 @@ F: tests/tcg/s390x/
 L: qemu-s390x@nongnu.org
 
 SH4 TCG CPUs
-M: Aurelien Jarno <aurelien@aurel32.net>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
 S: Odd Fixes
 F: target/sh4/
 F: hw/sh4/
@@ -396,6 +398,8 @@ F: target/s390x/machine.c
 F: target/s390x/sigp.c
 F: target/s390x/cpu_features*.[ch]
 F: target/s390x/cpu_models.[ch]
+F: hw/s390x/pv.c
+F: include/hw/s390x/pv.h
 F: hw/intc/s390_flic.c
 F: hw/intc/s390_flic_kvm.c
 F: include/hw/s390x/s390_flic.h
@@ -436,6 +440,7 @@ M: Paul Durrant <paul@xen.org>
 L: xen-devel@lists.xenproject.org
 S: Supported
 F: */xen*
+F: accel/xen/*
 F: hw/9pfs/xen-9p*
 F: hw/char/xen_console.c
 F: hw/display/xenfb.c
@@ -449,6 +454,7 @@ F: hw/i386/xen/
 F: hw/pci-host/xen_igd_pt.c
 F: include/hw/block/dataplane/xen*
 F: include/hw/xen/
+F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 
 Guest CPU Cores (HAXM)
@@ -605,6 +611,7 @@ S: Odd Fixes
 F: include/hw/arm/digic.h
 F: hw/*/digic*
 F: include/hw/*/digic*
+F: tests/acceptance/machine_arm_canona1100.py
 
 Goldfish RTC
 M: Anup Patel <anup.patel@wdc.com>
@@ -629,8 +636,10 @@ S: Odd Fixes
 F: hw/arm/fsl-imx25.c
 F: hw/arm/imx25_pdk.c
 F: hw/misc/imx25_ccm.c
+F: hw/watchdog/wdt_imx2.c
 F: include/hw/arm/fsl-imx25.h
 F: include/hw/misc/imx25_ccm.h
+F: include/hw/watchdog/wdt_imx2.h
 
 i.MX31 (kzm)
 M: Peter Chubb <peter.chubb@nicta.com.au>
@@ -697,12 +706,14 @@ F: hw/misc/armsse-cpuid.c
 F: include/hw/misc/armsse-cpuid.h
 F: hw/misc/armsse-mhu.c
 F: include/hw/misc/armsse-mhu.h
+F: docs/system/arm/mps2.rst
 
 Musca
 M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/musca.c
+F: docs/system/arm/musca.rst
 
 Musicpal
 M: Jan Kiszka <jan.kiszka@web.de>
@@ -824,12 +835,14 @@ M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/vexpress.c
+F: docs/system/arm/vexpress.rst
 
 Versatile PB
 M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/*/versatile*
+F: include/hw/i2c/arm_sbcon_i2c.h
 F: hw/misc/arm_sysctl.c
 F: docs/system/arm/versatile.rst
 
@@ -919,6 +932,8 @@ F: include/hw/arm/msf2-soc.h
 F: include/hw/misc/msf2-sysreg.h
 F: include/hw/timer/mss-timer.h
 F: include/hw/ssi/mss-spi.h
+F: hw/net/msf2-emac.c
+F: include/hw/net/msf2-emac.h
 
 Emcraft M2S-FG484
 M: Subbaraya Sundeep <sundeep.lkml@gmail.com>
@@ -973,13 +988,13 @@ F: pc-bios/hppa-firmware.img
 LM32 Machines
 -------------
 EVR32 and uclinux BSP
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: hw/lm32/lm32_boards.c
 
 milkymist
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: hw/lm32/milkymist.c
 
 M68K Machines
@@ -1037,9 +1052,9 @@ MIPS Machines
 -------------
 Jazz
 M: Hervé Poussineau <hpoussin@reactos.org>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
-F: hw/mips/mips_jazz.c
+F: hw/mips/jazz.c
 F: hw/display/jazz_led.c
 F: hw/dma/rc4030.c
 
@@ -1050,7 +1065,7 @@ R: Aurelien Jarno <aurelien@aurel32.net>
 S: Maintained
 F: hw/isa/piix4.c
 F: hw/acpi/piix4.c
-F: hw/mips/mips_malta.c
+F: hw/mips/malta.c
 F: hw/mips/gt64xxx_pci.c
 F: include/hw/southbridge/piix.h
 F: tests/acceptance/linux_ssh_mips_malta.py
@@ -1058,30 +1073,32 @@ F: tests/acceptance/machine_mips_malta.py
 
 Mipssim
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Odd Fixes
-F: hw/mips/mips_mipssim.c
+F: hw/mips/mipssim.c
 F: hw/net/mipsnet.c
 
 R4000
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Obsolete
-F: hw/mips/mips_r4k.c
+F: hw/mips/r4k.c
 
-Fulong 2E
+Fuloong 2E
+M: Huacai Chen <chenhc@lemote.com>
 M: Philippe Mathieu-Daudé <f4bug@amsat.org>
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 S: Odd Fixes
-F: hw/mips/mips_fulong2e.c
+F: hw/mips/fuloong2e.c
 F: hw/isa/vt82c686.c
 F: hw/pci-host/bonito.c
 F: include/hw/isa/vt82c686.h
 
 Boston
 M: Paul Burton <pburton@wavecomp.com>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: hw/core/loader-fit.c
 F: hw/mips/boston.c
@@ -1202,7 +1219,9 @@ S: Maintained
 F: hw/ppc/pnv*
 F: hw/intc/pnv*
 F: hw/intc/xics_pnv.c
+F: hw/pci-host/pnv*
 F: include/hw/ppc/pnv*
+F: include/hw/pci-host/pnv*
 F: pc-bios/skiboot.lid
 F: tests/qtest/pnv*
 
@@ -1225,19 +1244,45 @@ F: pc-bios/canyonlands.dt[sb]
 F: pc-bios/u-boot-sam460ex-20100605.bin
 F: roms/u-boot-sam460ex
 
+RISC-V Machines
+---------------
+OpenTitan
+M: Alistair Francis <Alistair.Francis@wdc.com>
+L: qemu-riscv@nongnu.org
+S: Supported
+F: hw/riscv/opentitan.c
+F: hw/char/ibex_uart.c
+F: hw/intc/ibex_plic.c
+F: include/hw/riscv/opentitan.h
+F: include/hw/char/ibex_uart.h
+F: include/hw/intc/ibex_plic.h
+
+RX Machines
+-----------
+rx-gdbsim
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+S: Maintained
+F: docs/system/target-rx.rst
+F: hw/rx/rx-gdbsim.c
+F: tests/acceptance/machine_rx_gdbsim.py
+
 SH4 Machines
 ------------
 R2D
-M: Magnus Damm <magnus.damm@gmail.com>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
 S: Maintained
 F: hw/sh4/r2d.c
 F: hw/intc/sh_intc.c
-F: hw/timer/sh_timer.c
+F: include/hw/sh4/sh_intc.h
 
 Shix
-M: Magnus Damm <magnus.damm@gmail.com>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
 S: Odd Fixes
 F: hw/sh4/shix.c
+F: hw/intc/sh_intc.c
+F: include/hw/sh4/sh_intc.h
 
 SPARC Machines
 --------------
@@ -1508,10 +1553,19 @@ F: hw/acpi/*
 F: hw/smbios/*
 F: hw/i386/acpi-build.[hc]
 F: hw/arm/virt-acpi-build.c
-F: tests/qtest/bios-tables-test.c
+F: tests/qtest/bios-tables-test*
 F: tests/qtest/acpi-utils.[hc]
 F: tests/data/acpi/
 
+ACPI/HEST/GHES
+R: Dongjiu Geng <gengdongjiu@huawei.com>
+R: Xiang Zheng <zhengxiang9@huawei.com>
+L: qemu-arm@nongnu.org
+S: Maintained
+F: hw/acpi/ghes.c
+F: include/hw/acpi/ghes.h
+F: docs/specs/acpi_hest_ghes.rst
+
 ppc4xx
 M: David Gibson <david@gibson.dropbear.id.au>
 L: qemu-ppc@nongnu.org
@@ -1653,7 +1707,7 @@ F: include/sysemu/balloon.h
 
 virtio-9p
 M: Greg Kurz <groug@kaod.org>
-R: Christian Schoenebeck <qemu_oss@crudebyte.com>
+M: Christian Schoenebeck <qemu_oss@crudebyte.com>
 S: Odd Fixes
 F: hw/9pfs/
 X: hw/9pfs/xen-9p*
@@ -1731,7 +1785,7 @@ F: hw/virtio/virtio-crypto-pci.c
 F: include/hw/virtio/virtio-crypto.h
 
 nvme
-M: Keith Busch <keith.busch@intel.com>
+M: Keith Busch <kbusch@kernel.org>
 L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/nvme*
@@ -1832,6 +1886,13 @@ S: Maintained
 F: include/hw/misc/unimp.h
 F: hw/misc/unimp.c
 
+Empty slot
+M: Artyom Tarasenko <atar4qemu@gmail.com>
+R: Philippe Mathieu-Daudé <f4bug@amsat.org>
+S: Maintained
+F: include/hw/misc/empty_slot.h
+F: hw/misc/empty_slot.c
+
 Standard VGA
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
@@ -1916,6 +1977,26 @@ F: hw/*/*xive*
 F: include/hw/*/*xive*
 F: docs/*/*xive*
 
+Renesas peripherals
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
+S: Maintained
+F: hw/char/renesas_sci.c
+F: hw/char/sh_serial.c
+F: hw/timer/renesas_*.c
+F: hw/timer/sh_timer.c
+F: include/hw/char/renesas_sci.h
+F: include/hw/sh4/sh.h
+F: include/hw/timer/renesas_*.h
+
+Renesas RX peripherals
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+S: Maintained
+F: hw/intc/rx_icu.c
+F: hw/rx/
+F: include/hw/intc/rx_icu.h
+F: include/hw/rx/
+
 Subsystems
 ----------
 Audio
@@ -1997,19 +2078,21 @@ F: qapi/transaction.json
 T: git https://repo.or.cz/qemu/armbru.git block-next
 
 Dirty Bitmaps
-M: John Snow <jsnow@redhat.com>
-R: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
+M: Eric Blake <eblake@redhat.com>
+M: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
+R: John Snow <jsnow@redhat.com>
 L: qemu-block@nongnu.org
 S: Supported
 F: include/qemu/hbitmap.h
 F: include/block/dirty-bitmap.h
+F: block/monitor/bitmap-qmp-cmds.c
 F: block/dirty-bitmap.c
 F: block/qcow2-bitmap.c
 F: migration/block-dirty-bitmap.c
 F: util/hbitmap.c
 F: tests/test-hbitmap.c
 F: docs/interop/bitmaps.rst
-T: git https://github.com/jnsnow/qemu.git bitmaps
+T: git https://repo.or.cz/qemu/ericb.git bitmaps
 
 Character device backends
 M: Marc-André Lureau <marcandre.lureau@redhat.com>
@@ -2253,6 +2336,8 @@ R: Eduardo Habkost <ehabkost@redhat.com>
 S: Supported
 F: docs/qdev-device-use.txt
 F: hw/core/qdev*
+F: hw/core/bus.c
+F: hw/core/sysbus.c
 F: include/hw/qdev*
 F: include/monitor/qdev.h
 F: include/qom/
@@ -2287,6 +2372,7 @@ S: Maintained
 F: qtest.c
 F: accel/qtest.c
 F: tests/qtest/
+X: tests/qtest/bios-tables-test-allowed-diff.h
 
 Device Fuzzing
 M: Alexander Bulekov <alxndr@bu.edu>
@@ -2295,6 +2381,7 @@ R: Bandan Das <bsd@redhat.com>
 R: Stefan Hajnoczi <stefanha@redhat.com>
 S: Maintained
 F: tests/qtest/fuzz/
+F: scripts/oss-fuzz/
 
 Register API
 M: Alistair Francis <alistair@alistair23.me>
@@ -2311,6 +2398,12 @@ F: net/slirp.c
 F: include/net/slirp.h
 T: git https://people.debian.org/~sthibault/qemu.git slirp
 
+Streams
+M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
+S: Maintained
+F: hw/core/stream.c
+F: include/hw/stream.h
+
 Stubs
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
@@ -2338,7 +2431,7 @@ F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
 F: qapi/tpm.json
-F: backends/tpm.c
+F: backends/tpm/
 F: tests/qtest/*tpm*
 T: git https://github.com/stefanberger/qemu-tpm.git tpm-next
 
@@ -2477,6 +2570,7 @@ F: net/filter-replay.c
 F: include/sysemu/replay.h
 F: docs/replay.txt
 F: stubs/replay.c
+F: tests/acceptance/replay_kernel.py
 
 IOVA Tree
 M: Peter Xu <peterx@redhat.com>
@@ -2512,7 +2606,7 @@ F: roms/edk2
 F: roms/edk2-*
 F: tests/data/uefi-boot-images/
 F: tests/uefi-test-tools/
-F: .gitlab-ci-edk2.yml
+F: .gitlab-ci.d/edk2.yml
 F: .gitlab-ci.d/edk2/
 
 Usermode Emulation
@@ -2578,7 +2672,7 @@ F: disas/i386.c
 MIPS TCG target
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: tcg/mips/
 
@@ -2871,6 +2965,9 @@ W: https://cirrus-ci.com/github/qemu/qemu
 
 GitLab Continuous Integration
 M: Thomas Huth <thuth@redhat.com>
+M: Philippe Mathieu-Daudé <philmd@redhat.com>
+M: Alex Bennée <alex.bennee@linaro.org>
+R: Wainer dos Santos Moschetta <wainersm@redhat.com>
 S: Maintained
 F: .gitlab-ci.yml
 
@@ -2881,6 +2978,14 @@ S: Maintained
 F: tests/tcg/Makefile
 F: tests/tcg/Makefile.include
 
+Acceptance (Integration) Testing with the Avocado framework
+W: https://trello.com/b/6Qi1pxVn/avocado-qemu
+R: Cleber Rosa <crosa@redhat.com>
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
+R: Wainer dos Santos Moschetta <wainersm@redhat.com>
+S: Odd Fixes
+F: tests/acceptance/
+
 Documentation
 -------------
 Build system architecture
diff --git a/Makefile b/Makefile
index 34275f57c9..a0092153af 100644
--- a/Makefile
+++ b/Makefile
@@ -336,16 +336,16 @@ $(call set-vpath, $(SRC_PATH))
 LIBS+=-lz $(LIBS_TOOLS)
 
 vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += vhost-user-gpu$(EXESUF)
 vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
-ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
+ifeq ($(CONFIG_SOFTMMU)$(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyyy)
 HELPERS-y += virtiofsd$(EXESUF)
 vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
@@ -418,7 +418,7 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
@@ -526,13 +526,14 @@ $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
 $(TARGET_DIRS_RULES):
 	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
 
-DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+# LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib=""
 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
-DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+DTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt
 
 .PHONY: dtc/all
-dtc/all: .git-submodule-status dtc/libfdt dtc/tests
-	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
+dtc/all: .git-submodule-status dtc/libfdt
+	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
 
 dtc/%: .git-submodule-status
 	@mkdir -p $@
@@ -561,12 +562,6 @@ slirp/all: .git-submodule-status
 		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
 		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
 
-# Compatibility gunk to keep make working across the rename of targets
-# for recursion, to be removed some time after 4.1.
-subdir-dtc: dtc/all
-subdir-capstone: capstone/all
-subdir-slirp: slirp/all
-
 $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
 	$(qom-obj-y)
 
@@ -820,7 +815,6 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	rm -Rf .sdk
-	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
@@ -1252,7 +1246,16 @@ endif
 	@$(if $(TARGET_DIRS), \
 		echo 'Architecture specific targets:'; \
 		$(foreach t, $(TARGET_DIRS), \
-		$(call print-help-run,$(t)/all,Build for $(t));) \
+		$(call print-help-run,$(t)/all,Build for $(t)); \
+		$(if $(CONFIG_FUZZ), \
+			$(if $(findstring softmmu,$(t)), \
+				$(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \
+		))) \
+		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
 		echo '')
 	@$(if $(TOOLS), \
 		echo 'Tools targets:'; \
diff --git a/Makefile.objs b/Makefile.objs
index a7c967633a..98383972ee 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -13,9 +13,8 @@ chardev-obj-y = chardev/
 
 authz-obj-y = authz/
 
-block-obj-y = nbd/
+block-obj-y = block/ nbd/ scsi/
 block-obj-y += block.o blockjob.o job.o
-block-obj-y += block/ scsi/
 block-obj-y += qemu-io-cmds.o
 block-obj-$(CONFIG_REPLICATION) += replication.o
 
@@ -126,6 +125,7 @@ trace-events-subdirs =
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += backends
+trace-events-subdirs += backends/tpm
 trace-events-subdirs += crypto
 trace-events-subdirs += monitor
 ifeq ($(CONFIG_USER_ONLY),y)
@@ -151,6 +151,7 @@ trace-events-subdirs += hw/block/dataplane
 trace-events-subdirs += hw/char
 trace-events-subdirs += hw/dma
 trace-events-subdirs += hw/hppa
+trace-events-subdirs += hw/hyperv
 trace-events-subdirs += hw/i2c
 trace-events-subdirs += hw/i386
 trace-events-subdirs += hw/i386/xen
diff --git a/accel/Makefile.objs b/accel/Makefile.objs
index 17e5ac6061..ff72f0d030 100644
--- a/accel/Makefile.objs
+++ b/accel/Makefile.objs
@@ -2,4 +2,5 @@ common-obj-$(CONFIG_SOFTMMU) += accel.o
 obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o
 obj-$(CONFIG_KVM) += kvm/
 obj-$(CONFIG_TCG) += tcg/
+obj-$(CONFIG_XEN) += xen/
 obj-y += stubs/
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 439a4efe52..f24d7da783 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -44,6 +44,7 @@
 #include "qapi/visitor.h"
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-visit-common.h"
+#include "sysemu/reset.h"
 
 #include "hw/boards.h"
 
@@ -159,9 +160,59 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = {
 static NotifierList kvm_irqchip_change_notifiers =
     NOTIFIER_LIST_INITIALIZER(kvm_irqchip_change_notifiers);
 
+struct KVMResampleFd {
+    int gsi;
+    EventNotifier *resample_event;
+    QLIST_ENTRY(KVMResampleFd) node;
+};
+typedef struct KVMResampleFd KVMResampleFd;
+
+/*
+ * Only used with split irqchip where we need to do the resample fd
+ * kick for the kernel from userspace.
+ */
+static QLIST_HEAD(, KVMResampleFd) kvm_resample_fd_list =
+    QLIST_HEAD_INITIALIZER(kvm_resample_fd_list);
+
 #define kvm_slots_lock(kml)      qemu_mutex_lock(&(kml)->slots_lock)
 #define kvm_slots_unlock(kml)    qemu_mutex_unlock(&(kml)->slots_lock)
 
+static inline void kvm_resample_fd_remove(int gsi)
+{
+    KVMResampleFd *rfd;
+
+    QLIST_FOREACH(rfd, &kvm_resample_fd_list, node) {
+        if (rfd->gsi == gsi) {
+            QLIST_REMOVE(rfd, node);
+            g_free(rfd);
+            break;
+        }
+    }
+}
+
+static inline void kvm_resample_fd_insert(int gsi, EventNotifier *event)
+{
+    KVMResampleFd *rfd = g_new0(KVMResampleFd, 1);
+
+    rfd->gsi = gsi;
+    rfd->resample_event = event;
+
+    QLIST_INSERT_HEAD(&kvm_resample_fd_list, rfd, node);
+}
+
+void kvm_resample_fd_notify(int gsi)
+{
+    KVMResampleFd *rfd;
+
+    QLIST_FOREACH(rfd, &kvm_resample_fd_list, node) {
+        if (rfd->gsi == gsi) {
+            event_notifier_set(rfd->resample_event);
+            trace_kvm_resample_fd_notify(gsi);
+            return;
+        }
+    }
+}
+
 int kvm_get_max_memslots(void)
 {
     KVMState *s = KVM_STATE(current_accel());
@@ -883,6 +934,39 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension)
     return ret;
 }
 
+typedef struct HWPoisonPage {
+    ram_addr_t ram_addr;
+    QLIST_ENTRY(HWPoisonPage) list;
+} HWPoisonPage;
+
+static QLIST_HEAD(, HWPoisonPage) hwpoison_page_list =
+    QLIST_HEAD_INITIALIZER(hwpoison_page_list);
+
+static void kvm_unpoison_all(void *param)
+{
+    HWPoisonPage *page, *next_page;
+
+    QLIST_FOREACH_SAFE(page, &hwpoison_page_list, list, next_page) {
+        QLIST_REMOVE(page, list);
+        qemu_ram_remap(page->ram_addr, TARGET_PAGE_SIZE);
+        g_free(page);
+    }
+}
+
+void kvm_hwpoison_page_add(ram_addr_t ram_addr)
+{
+    HWPoisonPage *page;
+
+    QLIST_FOREACH(page, &hwpoison_page_list, list) {
+        if (page->ram_addr == ram_addr) {
+            return;
+        }
+    }
+    page = g_new(HWPoisonPage, 1);
+    page->ram_addr = ram_addr;
+    QLIST_INSERT_HEAD(&hwpoison_page_list, page, list);
+}
+
 static uint32_t adjust_ioeventfd_endianness(uint32_t val, uint32_t size)
 {
 #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
@@ -1628,9 +1712,13 @@ int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
     return kvm_update_routing_entry(s, &kroute);
 }
 
-static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int rfd, int virq,
+static int kvm_irqchip_assign_irqfd(KVMState *s, EventNotifier *event,


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:33:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14570.35965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCjY-0004hD-7j; Thu, 29 Oct 2020 18:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14570.35965; Thu, 29 Oct 2020 18:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCjY-0004h5-4b; Thu, 29 Oct 2020 18:33:12 +0000
Received: by outflank-mailman (input) for mailman id 14570;
 Thu, 29 Oct 2020 18:33:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYCjW-0004h0-Rb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bf51ef12-e173-423c-8f61-8c9299260bb9;
 Thu, 29 Oct 2020 18:33:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCjV-0003kw-Kj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCjV-00051T-J4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYCjW-0004h0-Rb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:10 +0000
X-Inumbo-ID: bf51ef12-e173-423c-8f61-8c9299260bb9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bf51ef12-e173-423c-8f61-8c9299260bb9;
	Thu, 29 Oct 2020 18:33:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y/hyHpSz03Jz51NIJxwdIesjMtNn8g8j/dUbR0qwjmk=; b=njWhkvmoK9EnTbCWfY+2f2jhJN
	s2wsgmT5SvJhbop4FYYCrRU/00sWaq/q/L0m7qHFc3CRmwtbwuOjPw46deMoIfSZrAcPD+lNZO9PA
	CcLRZt2d5sdnIF3noZ+Fcw0eJbIjN7jze9k84gNr3n7scM5WhA+rzjizehw5dH/2QhEs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCjV-0003kw-Kj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCjV-00051T-J4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:33:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Fix 051 output after qdev_init_nofail() removal
Message-Id: <E1kYCjV-00051T-J4@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:33:09 +0000

commit e11543c53fed2634146b9223112bc5c941434607
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Jun 16 17:49:49 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Wed Jun 24 10:00:04 2020 +0200

    iotests: Fix 051 output after qdev_init_nofail() removal
    
    Commit 96927c744 replaced qdev_init_nofail() call by
    isa_realize_and_unref() which has a different error
    message. Update the test output accordingly.
    
    Gitlab CI error after merging b77b5b3dc7:
    https://gitlab.com/qemu-project/qemu/-/jobs/597414772#L4375
    
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200616154949.6586-1-philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/051.pc.out | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 0ea80d35f0..da8ad87187 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -142,7 +142,7 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
 Testing: -drive if=ide
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty
+(qemu) QEMU_PROG: Device needs media, but drive is empty
 
 Testing: -drive if=virtio
 QEMU X.Y.Z monitor - type 'help' for more information
@@ -214,7 +214,7 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only
+(qemu) QEMU_PROG: Block node is read-only
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:44:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14573.35969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCuB-0005YZ-SQ; Thu, 29 Oct 2020 18:44:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14573.35969; Thu, 29 Oct 2020 18:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYCuB-0005YR-PV; Thu, 29 Oct 2020 18:44:11 +0000
Received: by outflank-mailman (input) for mailman id 14573;
 Thu, 29 Oct 2020 18:44:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYCuA-0005YM-IZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c64c062d-5525-493a-a1c8-fbb8908f2cc6;
 Thu, 29 Oct 2020 18:44:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCu9-0003xi-Jw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYCu9-00062F-Hx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYCuA-0005YM-IZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:10 +0000
X-Inumbo-ID: c64c062d-5525-493a-a1c8-fbb8908f2cc6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c64c062d-5525-493a-a1c8-fbb8908f2cc6;
	Thu, 29 Oct 2020 18:44:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0aYysNWFGP1jg2jbunH38XeE8BWXGV1vtvWIUqd6Wu0=; b=GXezrMrTCKOLTxQ6etg+PmYA+v
	PmHDPwP/7bL/KbcYT03jSyjVzdRHnXi120W/vHyYFkpD3AwrdivFwc7ceJ0FMuP7Ofcuk8EKODoXv
	TWL/V5JwbeOP2vRukJiubCF8WGxYAi3C1ZnuQU2ddigJj/8A79gH9Vv+a6uveSJWpDXg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCu9-0003xi-Jw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYCu9-00062F-Hx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:44:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: don't test qcow2.py inside 291
Message-Id: <E1kYCu9-00062F-Hx@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:44:09 +0000

commit 24b861c0386a17ea31eb824310c21118fb7be883
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Thu Jun 18 18:40:52 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Wed Jun 24 10:00:04 2020 +0200

    iotests: don't test qcow2.py inside 291
    
    820c6bee534ec3b added testing of qcow2.py into 291, and it breaks 291
    with external data file. Actually, 291 is bad place for qcow2.py
    testing, better add a separate test.
    
    For now, drop qcow2.py testing from 291 to fix the regression.
    
    Fixes: 820c6bee534ec3b
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200618154052.8629-1-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/291     |  4 ----
 tests/qemu-iotests/291.out | 33 ---------------------------------
 2 files changed, 37 deletions(-)

diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291
index 28e4fb9b4d..1e0bb76959 100755
--- a/tests/qemu-iotests/291
+++ b/tests/qemu-iotests/291
@@ -64,8 +64,6 @@ $QEMU_IO -c 'w 1M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG bitmap --disable -f $IMGFMT "$TEST_IMG" b1
 $QEMU_IMG bitmap --enable -f $IMGFMT "$TEST_IMG" b2
 $QEMU_IO -c 'w 2M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io
-echo "Check resulting qcow2 header extensions:"
-$PYTHON qcow2.py "$TEST_IMG" dump-header-exts
 
 echo
 echo "=== Bitmap preservation not possible to non-qcow2 ==="
@@ -92,8 +90,6 @@ $QEMU_IMG bitmap --merge tmp -f $IMGFMT "$TEST_IMG" b0
 $QEMU_IMG bitmap --remove --image-opts \
     driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG" tmp
 _img_info --format-specific
-echo "Check resulting qcow2 header extensions:"
-$PYTHON qcow2.py "$TEST_IMG" dump-header-exts
 
 echo
 echo "=== Check bitmap contents ==="
diff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/291.out
index 08bfaaaa6b..9f661515b4 100644
--- a/tests/qemu-iotests/291.out
+++ b/tests/qemu-iotests/291.out
@@ -14,25 +14,6 @@ wrote 1048576/1048576 bytes at offset 1048576
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1048576/1048576 bytes at offset 2097152
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Check resulting qcow2 header extensions:
-Header extension:
-magic                     0xe2792aca (Backing format)
-length                    5
-data                      'qcow2'
-
-Header extension:
-magic                     0x6803f857 (Feature table)
-length                    336
-data                      <binary>
-
-Header extension:
-magic                     0x23852875 (Bitmaps)
-length                    24
-nb_bitmaps                2
-reserved32                0
-bitmap_directory_size     0x40
-bitmap_directory_offset   0x510000
-
 
 === Bitmap preservation not possible to non-qcow2 ===
 
@@ -84,20 +65,6 @@ Format specific information:
             granularity: 65536
     refcount bits: 16
     corrupt: false
-Check resulting qcow2 header extensions:
-Header extension:
-magic                     0x6803f857 (Feature table)
-length                    336
-data                      <binary>
-
-Header extension:
-magic                     0x23852875 (Bitmaps)
-length                    24
-nb_bitmaps                3
-reserved32                0
-bitmap_directory_size     0x60
-bitmap_directory_offset   0x520000
-
 
 === Check bitmap contents ===
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 18:55:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 18:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14579.35985 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYD4w-0006WS-SN; Thu, 29 Oct 2020 18:55:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14579.35985; Thu, 29 Oct 2020 18:55:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYD4w-0006WL-OB; Thu, 29 Oct 2020 18:55:18 +0000
Received: by outflank-mailman (input) for mailman id 14579;
 Thu, 29 Oct 2020 18:55:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYD4v-0006WG-0y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9eb2f9ab-2f1a-4ff2-a868-6b459f100f6d;
 Thu, 29 Oct 2020 18:55:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYD4p-0004BT-4p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYD4p-0006zN-2n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYD4v-0006WG-0y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:17 +0000
X-Inumbo-ID: 9eb2f9ab-2f1a-4ff2-a868-6b459f100f6d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9eb2f9ab-2f1a-4ff2-a868-6b459f100f6d;
	Thu, 29 Oct 2020 18:55:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T7MIn2EmvRUhE0zuT0gT7XBmmYiFwmQFJ9sPs55U3IA=; b=2z/p5VSmdZ0S2jEKidrIp48VYp
	j93F78ZlQAtZDqCEOfKuISU4z9c3nwWv+0xN6lsb7DiSwBqeTD0VOQIhSkVpHUD4VAZzRf/vSS0re
	f08OzgiXwIv+m4e1Fjjt8d04UsUVikhg6EQFWiiCJFFvne7Em6NeM2yvOSZ/UjhmD/a0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYD4p-0004BT-4p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYD4p-0006zN-2n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 18:55:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-06-24' into staging
Message-Id: <E1kYD4p-0006zN-2n@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 18:55:11 +0000

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

commit 4abf70a661a5df3886ac9d7c19c3617fa92b922a
Merge: 6651620b92bc08cde07cb500e9a43dba7bd9b2b7 24b861c0386a17ea31eb824310c21118fb7be883
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 3 15:34:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 3 15:34:45 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-06-24' into staging
    
    Block patches:
    - Two iotest fixes
    
    # gpg: Signature made Wed 24 Jun 2020 09:00:51 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-06-24:
      iotests: don't test qcow2.py inside 291
      iotests: Fix 051 output after qdev_init_nofail() removal
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                                      |   16 +-
 Makefile                                         |   12 +-
 Makefile.objs                                    |    1 +
 accel/kvm/kvm-all.c                              |   21 +-
 accel/tcg/translate-all.c                        |    6 +-
 backends/Kconfig                                 |    1 +
 backends/Makefile.objs                           |    2 +-
 backends/tpm.c                                   |  208 ----
 backends/tpm/Kconfig                             |   14 +
 backends/tpm/Makefile.objs                       |    4 +
 backends/tpm/tpm_backend.c                       |  208 ++++
 backends/tpm/tpm_emulator.c                      |  997 +++++++++++++++
 backends/tpm/tpm_int.h                           |   88 ++
 backends/tpm/tpm_ioctl.h                         |  271 +++++
 backends/tpm/tpm_passthrough.c                   |  405 ++++++
 backends/tpm/tpm_util.c                          |  380 ++++++
 backends/tpm/trace-events                        |   33 +
 block/nvme.c                                     |  218 +++-
 block/trace-events                               |    2 +-
 blockdev.c                                       |   27 +-
 chardev/char-socket.c                            |    9 +-
 configure                                        |  108 +-
 cpus.c                                           |   15 +-
 docs/index.html.in                               |    4 +-
 docs/nvdimm.txt                                  |   10 +
 docs/qdev-device-use.txt                         |   17 +-
 docs/specs/tpm.rst                               |   16 +-
 docs/system/deprecated.rst                       |   71 +-
 exec.c                                           |   54 +-
 fpu/softfloat.c                                  |   87 +-
 hw/9pfs/9p.c                                     |    6 +-
 hw/acpi/aml-build.c                              |   51 +-
 hw/acpi/generic_event_device.c                   |   29 +
 hw/acpi/pcihp.c                                  |    3 +-
 hw/acpi/piix4.c                                  |   23 +-
 hw/arm/Kconfig                                   |    8 +-
 hw/arm/armsse.c                                  |   61 +-
 hw/arm/armv7m.c                                  |    7 +-
 hw/arm/aspeed.c                                  |   62 +-
 hw/arm/aspeed_ast2600.c                          |   35 +-
 hw/arm/aspeed_soc.c                              |   29 +-
 hw/arm/bcm2835_peripherals.c                     |   12 +-
 hw/arm/cubieboard.c                              |    2 +-
 hw/arm/exynos4210.c                              |    2 +-
 hw/arm/fsl-imx25.c                               |   12 +-
 hw/arm/fsl-imx6.c                                |   12 +-
 hw/arm/imx25_pdk.c                               |    2 +-
 hw/arm/mcimx6ul-evk.c                            |    2 +-
 hw/arm/mcimx7d-sabre.c                           |    2 +-
 hw/arm/mps2-tz.c                                 |   23 +-
 hw/arm/mps2.c                                    |   67 +-
 hw/arm/msf2-som.c                                |    4 +-
 hw/arm/nrf51_soc.c                               |    6 +-
 hw/arm/nseries.c                                 |    4 +-
 hw/arm/orangepi.c                                |    2 +-
 hw/arm/raspi.c                                   |    2 +-
 hw/arm/realview.c                                |    3 +-
 hw/arm/sabrelite.c                               |    6 +-
 hw/arm/stm32f205_soc.c                           |    2 +-
 hw/arm/stm32f405_soc.c                           |    2 +-
 hw/arm/versatilepb.c                             |    3 +-
 hw/arm/vexpress.c                                |    6 +-
 hw/arm/virt-acpi-build.c                         |   34 +
 hw/arm/virt.c                                    |  124 +-
 hw/arm/xilinx_zynq.c                             |    7 +-
 hw/arm/xlnx-versal-virt.c                        |    2 +-
 hw/arm/xlnx-zcu102.c                             |   10 +-
 hw/block/fdc.c                                   |  193 ++-
 hw/block/nand.c                                  |    2 +-
 hw/block/pflash_cfi01.c                          |    6 +-
 hw/block/pflash_cfi02.c                          |    2 +-
 hw/char/ibex_uart.c                              |    2 +-
 hw/char/virtio-serial-bus.c                      |    4 +-
 hw/core/bus.c                                    |    8 +-
 hw/core/machine.c                                |    8 +-
 hw/core/numa.c                                   |    7 +
 hw/core/qdev-properties-system.c                 |  151 ++-
 hw/core/qdev-properties.c                        |   17 +
 hw/display/ati.c                                 |   92 +-
 hw/display/ati_dbg.c                             |    1 +
 hw/display/ati_regs.h                            |    1 +
 hw/display/sm501.c                               |  157 ++-
 hw/display/trace-events                          |   12 +
 hw/display/virtio-gpu-pci.c                      |    2 +-
 hw/display/virtio-vga.c                          |    2 +-
 hw/dma/sparc32_dma.c                             |    6 +-
 hw/dma/xilinx_axidma.c                           |   12 +-
 hw/hyperv/vmbus.c                                |    3 +-
 hw/i2c/core.c                                    |   18 +-
 hw/i2c/versatile_i2c.c                           |   38 +-
 hw/i386/acpi-build.c                             |  214 +---
 hw/i386/amd_iommu.c                              |    6 +-
 hw/i386/fw_cfg.c                                 |   28 +
 hw/i386/fw_cfg.h                                 |    1 +
 hw/i386/pc.c                                     |   34 +-
 hw/i386/pc_piix.c                                |    1 +
 hw/i386/pc_q35.c                                 |    1 +
 hw/i386/x86.c                                    |    8 +-
 hw/ide/qdev.c                                    |    4 +-
 hw/input/adb-kbd.c                               |   42 +-
 hw/input/adb-mouse.c                             |   65 +-
 hw/input/adb.c                                   |  210 +++-
 hw/input/pckbd.c                                 |   31 +
 hw/input/trace-events                            |   27 +-
 hw/intc/Kconfig                                  |    3 +
 hw/intc/Makefile.objs                            |    1 +
 hw/intc/loongson_liointc.c                       |  242 ++++
 hw/isa/isa-superio.c                             |   18 +-
 hw/m68k/q800.c                                   |    3 +-
 hw/microblaze/petalogix_ml605_mmu.c              |    5 +-
 hw/mips/cps.c                                    |   35 +-
 hw/misc/mac_via.c                                |  411 ++++---
 hw/misc/macio/cuda.c                             |   60 +-
 hw/misc/macio/macio.c                            |    3 +-
 hw/misc/macio/pmu.c                              |   47 +-
 hw/misc/pca9552.c                                |  217 +++-
 hw/misc/trace-events                             |    7 +
 hw/net/virtio-net.c                              |    2 +-
 hw/net/xilinx_axienet.c                          |   12 +-
 hw/pci/pci.c                                     |    3 -
 hw/pci/pcie.c                                    |    2 +-
 hw/pci/shpc.c                                    |    2 +-
 hw/ppc/mac_newworld.c                            |    2 -
 hw/ppc/pnv.c                                     |   12 +-
 hw/ppc/spapr.c                                   |   10 +-
 hw/ppc/spapr_caps.c                              |   28 +-
 hw/ppc/spapr_drc.c                               |    4 +-
 hw/ppc/spapr_pci.c                               |    4 +-
 hw/ppc/spapr_vio.c                               |    6 +-
 hw/riscv/riscv_hart.c                            |   14 +-
 hw/riscv/sifive_u.c                              |   12 +-
 hw/s390x/ap-bridge.c                             |    2 +-
 hw/s390x/css-bridge.c                            |    2 +-
 hw/s390x/s390-pci-bus.c                          |   14 +-
 hw/scsi/megasas.c                                |   36 +-
 hw/scsi/scsi-bus.c                               |    4 +-
 hw/scsi/virtio-scsi.c                            |    4 +-
 hw/scsi/vmw_pvscsi.c                             |    2 +-
 hw/sd/milkymist-memcard.c                        |    7 +-
 hw/sd/pxa2xx_mmci.c                              |   15 +-
 hw/sd/sd.c                                       |    2 +-
 hw/sd/ssi-sd.c                                   |    3 +-
 hw/sparc64/sun4u.c                               |    9 +-
 hw/tpm/Kconfig                                   |   21 +-
 hw/tpm/Makefile.objs                             |    3 -
 hw/tpm/tpm_crb.c                                 |    4 +-
 hw/tpm/tpm_emulator.c                            |  997 ---------------
 hw/tpm/tpm_int.h                                 |   75 --
 hw/tpm/tpm_ioctl.h                               |  271 -----
 hw/tpm/tpm_passthrough.c                         |  405 ------
 hw/tpm/tpm_ppi.c                                 |    1 +
 hw/tpm/tpm_ppi.h                                 |    1 -
 hw/tpm/tpm_prop.h                                |   31 +
 hw/tpm/tpm_spapr.c                               |    4 +-
 hw/tpm/tpm_tis.h                                 |    1 -
 hw/tpm/tpm_tis_common.c                          |   11 +-
 hw/tpm/tpm_tis_isa.c                             |    3 +-
 hw/tpm/tpm_tis_sysbus.c                          |    3 +-
 hw/tpm/tpm_util.c                                |  377 ------
 hw/tpm/tpm_util.h                                |   85 --
 hw/tpm/trace-events                              |   34 +-
 hw/usb/bus.c                                     |    2 +-
 hw/usb/dev-mtp.c                                 |    2 -
 hw/usb/dev-smartcard-reader.c                    |    2 +-
 hw/usb/hcd-xhci.h                                |    2 +-
 hw/virtio/vhost-user.c                           |   12 +-
 hw/virtio/virtio-iommu-pci.c                     |    4 +-
 hw/watchdog/cmsdk-apb-watchdog.c                 |    1 +
 hw/watchdog/trace-events                         |    1 +
 hw/xen/Makefile.objs                             |    2 +-
 hw/xen/xen-bus.c                                 |    2 +-
 hw/xen/xen-legacy-backend.c                      |    2 +-
 hw/xtensa/xtfpga.c                               |    3 +-
 include/block/block.h                            |    4 +-
 include/exec/cpu-all.h                           |    8 +-
 include/exec/cpu-defs.h                          |    7 +-
 include/fpu/softfloat.h                          |    3 +
 include/hw/acpi/acpi-defs.h                      |   18 -
 include/hw/arm/aspeed.h                          |   12 +-
 include/hw/block/fdc.h                           |    5 +-
 include/hw/hyperv/vmbus-bridge.h                 |    3 +-
 include/hw/i2c/arm_sbcon_i2c.h                   |   35 +
 include/hw/i2c/i2c.h                             |    2 +
 include/hw/i386/pc.h                             |    1 -
 include/hw/input/adb.h                           |   26 +-
 include/hw/misc/mac_via.h                        |    2 +-
 include/hw/misc/macio/cuda.h                     |    4 -
 include/hw/misc/macio/pmu.h                      |    4 -
 include/hw/misc/pca9552.h                        |   16 +-
 include/hw/ppc/xive_regs.h                       |    2 +-
 include/hw/qdev-core.h                           |    5 +-
 include/hw/qdev-properties.h                     |   18 +-
 include/qemu/coroutine_int.h                     |    5 +
 include/qemu/osdep.h                             |   57 +-
 include/sysemu/blockdev.h                        |    2 +
 include/sysemu/tpm_util.h                        |   72 ++
 memory.c                                         |   29 +-
 migration/qemu-file.c                            |    2 +-
 migration/rdma.c                                 |   19 +-
 pc-bios/bios-256k.bin                            |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                                 |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin                          |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin                |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin                       |  Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin                          |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin                        |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin                              |  Bin 38912 -> 38912 bytes
 qemu-options.hx                                  |    9 +-
 qga/commands-posix.c                             |    1 +
 replay/replay.c                                  |    2 +-
 roms/config.seabios-128k                         |    3 +
 roms/seabios                                     |    2 +-
 scripts/minikconf.py                             |    6 +-
 scripts/performance/topN_callgrind.py            |  140 +++
 scripts/performance/topN_perf.py                 |  149 +++
 scripts/tracetool.py                             |    2 +-
 scripts/tracetool/__init__.py                    |    2 +-
 scripts/tracetool/backend/__init__.py            |    2 +-
 scripts/tracetool/backend/dtrace.py              |    2 +-
 scripts/tracetool/backend/log.py                 |    2 +-
 scripts/tracetool/backend/simple.py              |    2 +-
 scripts/tracetool/backend/ust.py                 |    2 +-
 scripts/tracetool/format/__init__.py             |    2 +-
 scripts/tracetool/format/c.py                    |    2 +-
 scripts/tracetool/format/d.py                    |    2 +-
 scripts/tracetool/format/h.py                    |    2 +-
 scripts/tracetool/format/stap.py                 |    2 +-
 scripts/tracetool/format/tcg_h.py                |    2 +-
 scripts/tracetool/format/tcg_helper_c.py         |    2 +-
 scripts/tracetool/format/tcg_helper_h.py         |    2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py |    2 +-
 scripts/tracetool/transform.py                   |    2 +-
 scripts/tracetool/vcpu.py                        |    2 +-
 softmmu/vl.c                                     |    8 +
 stubs/Makefile.objs                              |    1 +
 stubs/cmos.c                                     |    7 +
 target/arm/Makefile.objs                         |    1 +
 target/arm/cpu.c                                 |   83 +-
 target/arm/cpu.h                                 |   52 +-
 target/arm/cpu64.c                               |   15 +-
 target/arm/helper-a64.c                          |   96 +-
 target/arm/helper-a64.h                          |   16 +
 target/arm/helper-sve.h                          |  488 ++++++++
 target/arm/helper.c                              |  421 +++++--
 target/arm/helper.h                              |    2 +
 target/arm/internals.h                           |  153 ++-
 target/arm/kvm.c                                 |    4 +-
 target/arm/kvm64.c                               |   14 +-
 target/arm/kvm_arm.h                             |   21 +-
 target/arm/m_helper.c                            |   11 +-
 target/arm/mte_helper.c                          |  906 ++++++++++++++
 target/arm/neon-dp.decode                        |  106 ++
 target/arm/op_helper.c                           |   16 +
 target/arm/sve_helper.c                          |  614 ++++++++--
 target/arm/tlb_helper.c                          |   13 +-
 target/arm/translate-a64.c                       |  677 +++++++++--
 target/arm/translate-a64.h                       |    5 +
 target/arm/translate-neon.inc.c                  | 1191 +++++++++++++++++-
 target/arm/translate-sve.c                       | 1420 ++++++++++++++--------
 target/arm/translate-vfp.inc.c                   |    9 +-
 target/arm/translate.c                           | 1080 +---------------
 target/arm/translate.h                           |   31 +-
 target/i386/cpu.c                                |    9 +
 target/i386/fpu_helper.c                         | 1396 +++++++++++++++++++--
 target/i386/kvm.c                                |   46 +-
 target/m68k/softfloat.c                          |   83 --
 target/m68k/softfloat.h                          |    1 -
 target/mips/kvm.c                                |   26 +
 target/mips/kvm_mips.h                           |   11 +
 target/ppc/translate_init.inc.c                  |    5 -
 target/xtensa/cpu.h                              |    1 +
 target/xtensa/overlay_tool.h                     |    8 +-
 target/xtensa/translate.c                        |   60 +-
 tests/check-block-qdict.c                        |   24 +-
 tests/check-block.sh                             |   12 +-
 tests/check-qobject.c                            |    5 +-
 tests/check-qom-proplist.c                       |   14 +-
 tests/data/acpi/pc/DSDT                          |  Bin 5014 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat                 |  Bin 6338 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge                   |  Bin 6873 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp                     |  Bin 5477 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm                  |  Bin 6667 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs                  |  Bin 5086 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp                    |  Bin 6373 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem                  |  Bin 5020 -> 4940 bytes
 tests/data/acpi/q35/DSDT                         |  Bin 7752 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat                |  Bin 9076 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge                  |  Bin 7769 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp                    |  Bin 8215 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm                 |  Bin 9405 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt                  |  Bin 7827 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp                   |  Bin 9111 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64                  |  Bin 8882 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem                 |  Bin 7758 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis                     |  Bin 8357 -> 8283 bytes
 tests/qemu-iotests/172                           |   27 +-
 tests/qemu-iotests/172.out                       |  642 +++++++++-
 tests/qtest/arm-cpu-features.c                   |   38 +-
 tests/qtest/bios-tables-test-allowed-diff.h      |   18 +
 tests/qtest/bios-tables-test.c                   |    2 +-
 tests/qtest/libqos/pci-pc.c                      |    2 +-
 tests/qtest/test-x86-cpuid-compat.c              |    4 +-
 tests/qtest/tpm-emu.c                            |    2 +-
 tests/qtest/usb-hcd-ehci-test.c                  |    2 +-
 tests/tcg/i386/test-i386-f2xm1.c                 | 1140 +++++++++++++++++
 tests/tcg/i386/test-i386-fpatan.c                | 1071 ++++++++++++++++
 tests/tcg/i386/test-i386-fyl2x.c                 | 1161 ++++++++++++++++++
 tests/tcg/i386/test-i386-fyl2xp1.c               | 1156 ++++++++++++++++++
 tests/test-base64.c                              |    3 +-
 tests/test-bdrv-graph-mod.c                      |    4 +-
 tests/test-block-iothread.c                      |    3 +-
 tests/test-crypto-cipher.c                       |    8 +-
 tests/test-io-task.c                             |    4 +-
 tests/test-logging.c                             |   12 +-
 tests/test-qemu-opts.c                           |   22 +-
 tests/test-replication.c                         |  109 +-
 tests/test-string-input-visitor.c                |   33 +-
 tests/test-string-output-visitor.c               |   16 +-
 tests/test-util-filemonitor.c                    |    1 +
 trace/simple.c                                   |   20 +-
 trace/simple.h                                   |    2 +-
 ui/vnc.c                                         |    6 +-
 util/coroutine-sigaltstack.c                     |    4 +
 util/coroutine-ucontext.c                        |   28 +
 util/getauxval.c                                 |   10 +
 util/oslib-posix.c                               |   15 +
 util/qemu-timer.c                                |   32 +-
 330 files changed, 17977 insertions(+), 6506 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 51a45703b8..dec252f38b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -842,6 +842,7 @@ M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/*/versatile*
+F: include/hw/i2c/arm_sbcon_i2c.h
 F: hw/misc/arm_sysctl.c
 F: docs/system/arm/versatile.rst
 
@@ -1095,6 +1096,12 @@ F: hw/isa/vt82c686.c
 F: hw/pci-host/bonito.c
 F: include/hw/isa/vt82c686.h
 
+Loongson-3 virtual platforms
+M: Huacai Chen <chenhc@lemote.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
+S: Maintained
+F: hw/intc/loongson_liointc.c
+
 Boston
 M: Paul Burton <pburton@wavecomp.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
@@ -2430,7 +2437,7 @@ F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
 F: qapi/tpm.json
-F: backends/tpm.c
+F: backends/tpm/
 F: tests/qtest/*tpm*
 T: git https://github.com/stefanberger/qemu-tpm.git tpm-next
 
@@ -3018,3 +3025,10 @@ M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: docs/conf.py
 F: docs/*/conf.py
+
+Miscellaneous
+-------------
+Performance Tools and Tests
+M: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
+S: Maintained
+F: scripts/performance/
diff --git a/Makefile b/Makefile
index 48f23aa978..b1b8a5a6d0 100644
--- a/Makefile
+++ b/Makefile
@@ -418,7 +418,7 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
@@ -873,8 +873,9 @@ install-sphinxdocs: sphinxdocs
 install-doc: $(DOCS) install-sphinxdocs
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
 ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
@@ -892,8 +893,9 @@ ifdef CONFIG_TRACE_SYSTEMTAP
 endif
 ifneq (,$(findstring qemu-ga,$(TOOLS)))
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
-	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
 endif
 endif
diff --git a/Makefile.objs b/Makefile.objs
index 7ce2588b89..98383972ee 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -125,6 +125,7 @@ trace-events-subdirs =
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += backends
+trace-events-subdirs += backends/tpm
 trace-events-subdirs += crypto
 trace-events-subdirs += monitor
 ifeq ($(CONFIG_USER_ONLY),y)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index f24d7da783..d54a8701d8 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -101,7 +101,7 @@ struct KVMState
     bool kernel_irqchip_required;
     OnOffAuto kernel_irqchip_split;
     bool sync_mmu;
-    bool manual_dirty_log_protect;
+    uint64_t manual_dirty_log_protect;
     /* The man page (and posix) say ioctl numbers are signed int, but
      * they're not.  Linux, glibc and *BSD all treat ioctl numbers as
      * unsigned, and treating them as signed here can break things */
@@ -1995,6 +1995,7 @@ static int kvm_init(MachineState *ms)
     int ret;
     int type = 0;
     const char *kvm_type;
+    uint64_t dirty_log_manual_caps;
 
     s = KVM_STATE(ms->accelerator);
 
@@ -2120,14 +2121,20 @@ static int kvm_init(MachineState *ms)
     s->coalesced_pio = s->coalesced_mmio &&
                        kvm_check_extension(s, KVM_CAP_COALESCED_PIO);
 
-    s->manual_dirty_log_protect =
+    dirty_log_manual_caps =
         kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);
-    if (s->manual_dirty_log_protect) {
-        ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, 1);
+    dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE |
+                              KVM_DIRTY_LOG_INITIALLY_SET);
+    s->manual_dirty_log_protect = dirty_log_manual_caps;
+    if (dirty_log_manual_caps) {
+        ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0,
+                                   dirty_log_manual_caps);
         if (ret) {
-            warn_report("Trying to enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 "
-                        "but failed.  Falling back to the legacy mode. ");
-            s->manual_dirty_log_protect = false;
+            warn_report("Trying to enable capability %"PRIu64" of "
+                        "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. "
+                        "Falling back to the legacy mode. ",
+                        dirty_log_manual_caps);
+            s->manual_dirty_log_protect = 0;
         }
     }
 
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index c3d37058a1..2afa46bd2b 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2582,9 +2582,9 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
     /* This function should never be called with addresses outside the
        guest address space.  If this assert fires, it probably indicates
        a missing call to h2g_valid.  */
-#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
-    assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
-#endif
+    if (TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS) {
+        assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
+    }
 
     if (len == 0) {
         return 0;
diff --git a/backends/Kconfig b/backends/Kconfig
new file mode 100644
index 0000000000..f35abc1609
--- /dev/null
+++ b/backends/Kconfig
@@ -0,0 +1 @@
+source tpm/Kconfig
diff --git a/backends/Makefile.objs b/backends/Makefile.objs
index 28a847cd57..22d204cb48 100644
--- a/backends/Makefile.objs
+++ b/backends/Makefile.objs
@@ -1,7 +1,7 @@
 common-obj-y += rng.o rng-egd.o rng-builtin.o
 common-obj-$(CONFIG_POSIX) += rng-random.o
 
-common-obj-$(CONFIG_TPM) += tpm.o
+common-obj-$(CONFIG_TPM) += tpm/
 
 common-obj-y += hostmem.o hostmem-ram.o
 common-obj-$(CONFIG_POSIX) += hostmem-file.o
diff --git a/backends/tpm.c b/backends/tpm.c
deleted file mode 100644
index 375587e743..0000000000
--- a/backends/tpm.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * QEMU TPM Backend
- *
- * Copyright IBM, Corp. 2013
- *
- * Authors:
- *  Stefan Berger   <stefanb@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- * Based on backends/rng.c by Anthony Liguori
- */
-
-#include "qemu/osdep.h"
-#include "sysemu/tpm_backend.h"
-#include "qapi/error.h"
-#include "sysemu/tpm.h"
-#include "qemu/thread.h"
-#include "qemu/main-loop.h"
-#include "qemu/module.h"
-#include "block/thread-pool.h"
-#include "qemu/error-report.h"
-
-static void tpm_backend_request_completed(void *opaque, int ret)
-{
-    TPMBackend *s = TPM_BACKEND(opaque);
-    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
-
-    tic->request_completed(s->tpmif, ret);
-
-    /* no need for atomic, as long the BQL is taken */
-    s->cmd = NULL;
-    object_unref(OBJECT(s));
-}
-
-static int tpm_backend_worker_thread(gpointer data)
-{
-    TPMBackend *s = TPM_BACKEND(data);
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-    Error *err = NULL;
-
-    k->handle_request(s, s->cmd, &err);
-    if (err) {
-        error_report_err(err);
-        return -1;
-    }
-
-    return 0;
-}
-
-void tpm_backend_finish_sync(TPMBackend *s)
-{
-    while (s->cmd) {
-        aio_poll(qemu_get_aio_context(), true);
-    }
-}
-
-enum TpmType tpm_backend_get_type(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->type;
-}
-
-int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
-{
-    if (s->tpmif) {
-        error_setg(errp, "TPM backend '%s' is already initialized", s->id);
-        return -1;
-    }
-
-    s->tpmif = tpmif;
-    object_ref(OBJECT(tpmif));
-
-    s->had_startup_error = false;
-
-    return 0;
-}
-
-int tpm_backend_startup_tpm(TPMBackend *s, size_t buffersize)
-{
-    int res = 0;
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    /* terminate a running TPM */
-    tpm_backend_finish_sync(s);
-
-    res = k->startup_tpm ? k->startup_tpm(s, buffersize) : 0;
-
-    s->had_startup_error = (res != 0);
-
-    return res;
-}
-
-bool tpm_backend_had_startup_error(TPMBackend *s)
-{
-    return s->had_startup_error;
-}
-
-void tpm_backend_deliver_request(TPMBackend *s, TPMBackendCmd *cmd)
-{
-    ThreadPool *pool = aio_get_thread_pool(qemu_get_aio_context());
-
-    if (s->cmd != NULL) {
-        error_report("There is a TPM request pending");
-        return;
-    }
-
-    s->cmd = cmd;
-    object_ref(OBJECT(s));
-    thread_pool_submit_aio(pool, tpm_backend_worker_thread, s,
-                           tpm_backend_request_completed, s);
-}
-
-void tpm_backend_reset(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    if (k->reset) {
-        k->reset(s);
-    }
-
-    tpm_backend_finish_sync(s);
-
-    s->had_startup_error = false;
-}
-
-void tpm_backend_cancel_cmd(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    k->cancel_cmd(s);
-}
-
-bool tpm_backend_get_tpm_established_flag(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_tpm_established_flag ?
-           k->get_tpm_established_flag(s) : false;
-}
-
-int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->reset_tpm_established_flag ?
-           k->reset_tpm_established_flag(s, locty) : 0;
-}
-
-TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_tpm_version(s);
-}
-
-size_t tpm_backend_get_buffer_size(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_buffer_size(s);
-}
-
-TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
-{
-    TPMInfo *info = g_new0(TPMInfo, 1);
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
-
-    info->id = g_strdup(s->id);
-    info->model = tic->model;
-    info->options = k->get_tpm_options(s);
-
-    return info;
-}
-
-static void tpm_backend_instance_finalize(Object *obj)
-{
-    TPMBackend *s = TPM_BACKEND(obj);
-
-    object_unref(OBJECT(s->tpmif));
-    g_free(s->id);
-}
-
-static const TypeInfo tpm_backend_info = {
-    .name = TYPE_TPM_BACKEND,
-    .parent = TYPE_OBJECT,
-    .instance_size = sizeof(TPMBackend),
-    .instance_finalize = tpm_backend_instance_finalize,
-    .class_size = sizeof(TPMBackendClass),
-    .abstract = true,
-};
-
-static const TypeInfo tpm_if_info = {
-    .name = TYPE_TPM_IF,
-    .parent = TYPE_INTERFACE,
-    .class_size = sizeof(TPMIfClass),
-};
-
-static void register_types(void)
-{
-    type_register_static(&tpm_backend_info);
-    type_register_static(&tpm_if_info);
-}
-
-type_init(register_types);
diff --git a/backends/tpm/Kconfig b/backends/tpm/Kconfig
new file mode 100644
index 0000000000..5d91eb89c2
--- /dev/null
+++ b/backends/tpm/Kconfig
@@ -0,0 +1,14 @@
+config TPM_BACKEND
+    bool
+    depends on TPM
+
+config TPM_PASSTHROUGH
+    bool
+    default y
+    # FIXME: should check for x86 host as well
+    depends on TPM_BACKEND && LINUX
+
+config TPM_EMULATOR
+    bool
+    default y
+    depends on TPM_BACKEND
diff --git a/backends/tpm/Makefile.objs b/backends/tpm/Makefile.objs
new file mode 100644
index 0000000000..db2731f634
--- /dev/null
+++ b/backends/tpm/Makefile.objs
@@ -0,0 +1,4 @@
+common-obj-y += tpm_backend.o
+common-obj-y += tpm_util.o
+common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o
+common-obj-$(CONFIG_TPM_EMULATOR) += tpm_emulator.o
diff --git a/backends/tpm/tpm_backend.c b/backends/tpm/tpm_backend.c
new file mode 100644
index 0000000000..375587e743
--- /dev/null
+++ b/backends/tpm/tpm_backend.c
@@ -0,0 +1,208 @@
+/*
+ * QEMU TPM Backend
+ *
+ * Copyright IBM, Corp. 2013
+ *
+ * Authors:
+ *  Stefan Berger   <stefanb@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ * Based on backends/rng.c by Anthony Liguori
+ */
+
+#include "qemu/osdep.h"
+#include "sysemu/tpm_backend.h"
+#include "qapi/error.h"
+#include "sysemu/tpm.h"
+#include "qemu/thread.h"
+#include "qemu/main-loop.h"
+#include "qemu/module.h"
+#include "block/thread-pool.h"
+#include "qemu/error-report.h"
+
+static void tpm_backend_request_completed(void *opaque, int ret)
+{
+    TPMBackend *s = TPM_BACKEND(opaque);
+    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
+
+    tic->request_completed(s->tpmif, ret);
+
+    /* no need for atomic, as long the BQL is taken */
+    s->cmd = NULL;
+    object_unref(OBJECT(s));
+}
+
+static int tpm_backend_worker_thread(gpointer data)
+{
+    TPMBackend *s = TPM_BACKEND(data);
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+    Error *err = NULL;
+
+    k->handle_request(s, s->cmd, &err);
+    if (err) {
+        error_report_err(err);
+        return -1;
+    }
+
+    return 0;
+}
+
+void tpm_backend_finish_sync(TPMBackend *s)
+{
+    while (s->cmd) {
+        aio_poll(qemu_get_aio_context(), true);
+    }
+}
+
+enum TpmType tpm_backend_get_type(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->type;
+}
+
+int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
+{
+    if (s->tpmif) {
+        error_setg(errp, "TPM backend '%s' is already initialized", s->id);
+        return -1;
+    }
+
+    s->tpmif = tpmif;
+    object_ref(OBJECT(tpmif));
+
+    s->had_startup_error = false;
+
+    return 0;
+}
+
+int tpm_backend_startup_tpm(TPMBackend *s, size_t buffersize)
+{
+    int res = 0;
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    /* terminate a running TPM */
+    tpm_backend_finish_sync(s);
+
+    res = k->startup_tpm ? k->startup_tpm(s, buffersize) : 0;
+
+    s->had_startup_error = (res != 0);
+
+    return res;
+}
+
+bool tpm_backend_had_startup_error(TPMBackend *s)
+{
+    return s->had_startup_error;
+}
+
+void tpm_backend_deliver_request(TPMBackend *s, TPMBackendCmd *cmd)
+{
+    ThreadPool *pool = aio_get_thread_pool(qemu_get_aio_context());
+
+    if (s->cmd != NULL) {
+        error_report("There is a TPM request pending");
+        return;
+    }
+
+    s->cmd = cmd;
+    object_ref(OBJECT(s));
+    thread_pool_submit_aio(pool, tpm_backend_worker_thread, s,
+                           tpm_backend_request_completed, s);
+}
+
+void tpm_backend_reset(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    if (k->reset) {
+        k->reset(s);
+    }
+
+    tpm_backend_finish_sync(s);
+
+    s->had_startup_error = false;
+}
+
+void tpm_backend_cancel_cmd(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    k->cancel_cmd(s);
+}
+
+bool tpm_backend_get_tpm_established_flag(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_tpm_established_flag ?
+           k->get_tpm_established_flag(s) : false;
+}
+
+int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->reset_tpm_established_flag ?
+           k->reset_tpm_established_flag(s, locty) : 0;
+}
+
+TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_tpm_version(s);
+}
+
+size_t tpm_backend_get_buffer_size(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_buffer_size(s);
+}
+
+TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
+{
+    TPMInfo *info = g_new0(TPMInfo, 1);
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
+
+    info->id = g_strdup(s->id);
+    info->model = tic->model;
+    info->options = k->get_tpm_options(s);
+
+    return info;
+}
+
+static void tpm_backend_instance_finalize(Object *obj)
+{
+    TPMBackend *s = TPM_BACKEND(obj);
+
+    object_unref(OBJECT(s->tpmif));
+    g_free(s->id);
+}
+
+static const TypeInfo tpm_backend_info = {
+    .name = TYPE_TPM_BACKEND,
+    .parent = TYPE_OBJECT,
+    .instance_size = sizeof(TPMBackend),
+    .instance_finalize = tpm_backend_instance_finalize,
+    .class_size = sizeof(TPMBackendClass),
+    .abstract = true,
+};
+
+static const TypeInfo tpm_if_info = {
+    .name = TYPE_TPM_IF,
+    .parent = TYPE_INTERFACE,
+    .class_size = sizeof(TPMIfClass),
+};
+
+static void register_types(void)
+{
+    type_register_static(&tpm_backend_info);
+    type_register_static(&tpm_if_info);
+}
+
+type_init(register_types);
diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
new file mode 100644
index 0000000000..9605339f93
--- /dev/null
+++ b/backends/tpm/tpm_emulator.c
@@ -0,0 +1,997 @@
+/*
+ *  Emulator TPM driver
+ *
+ *  Copyright (c) 2017 Intel Corporation
+ *  Author: Amarnath Valluri <amarnath.valluri@intel.com>
+ *
+ *  Copyright (c) 2010 - 2013, 2018 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ *  Copyright (C) 2011 IAIK, Graz University of Technology
+ *    Author: Andreas Niederl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qemu/module.h"
+#include "qemu/sockets.h"
+#include "io/channel-socket.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "tpm_int.h"
+#include "tpm_ioctl.h"
+#include "migration/blocker.h"
+#include "migration/vmstate.h"
+#include "qapi/error.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-tpm.h"
+#include "chardev/char-fe.h"
+#include "trace.h"
+
+#define TYPE_TPM_EMULATOR "tpm-emulator"
+#define TPM_EMULATOR(obj) \
+    OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR)
+
+#define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) == (cap))
+
+/* data structures */
+
+/* blobs from the TPM; part of VM state when migrating */
+typedef struct TPMBlobBuffers {
+    uint32_t permanent_flags;
+    TPMSizedBuffer permanent;
+
+    uint32_t volatil_flags;
+    TPMSizedBuffer volatil;
+
+    uint32_t savestate_flags;
+    TPMSizedBuffer savestate;
+} TPMBlobBuffers;
+
+typedef struct TPMEmulator {
+    TPMBackend parent;
+
+    TPMEmulatorOptions *options;
+    CharBackend ctrl_chr;
+    QIOChannel *data_ioc;
+    TPMVersion tpm_version;
+    ptm_cap caps; /* capabilities of the TPM */
+    uint8_t cur_locty_number; /* last set locality */
+    Error *migration_blocker;
+
+    QemuMutex mutex;
+
+    unsigned int established_flag:1;
+    unsigned int established_flag_cached:1;
+
+    TPMBlobBuffers state_blobs;
+} TPMEmulator;
+
+struct tpm_error {
+    uint32_t tpm_result;
+    const char *string;
+};
+
+static const struct tpm_error tpm_errors[] = {
+    /* TPM 1.2 error codes */
+    { TPM_BAD_PARAMETER   , "a parameter is bad" },
+    { TPM_FAIL            , "operation failed" },
+    { TPM_KEYNOTFOUND     , "key could not be found" },
+    { TPM_BAD_PARAM_SIZE  , "bad parameter size"},
+    { TPM_ENCRYPT_ERROR   , "encryption error" },
+    { TPM_DECRYPT_ERROR   , "decryption error" },
+    { TPM_BAD_KEY_PROPERTY, "bad key property" },
+    { TPM_BAD_MODE        , "bad (encryption) mode" },
+    { TPM_BAD_VERSION     , "bad version identifier" },
+    { TPM_BAD_LOCALITY    , "bad locality" },
+    /* TPM 2 error codes */
+    { TPM_RC_FAILURE     , "operation failed" },
+    { TPM_RC_LOCALITY    , "bad locality"     },
+    { TPM_RC_INSUFFICIENT, "insufficient amount of data" },
+};
+
+static const char *tpm_emulator_strerror(uint32_t tpm_result)
+{
+    size_t i;
+
+    for (i = 0; i < ARRAY_SIZE(tpm_errors); i++) {
+        if (tpm_errors[i].tpm_result == tpm_result) {
+            return tpm_errors[i].string;
+        }
+    }
+    return "";
+}
+
+static int tpm_emulator_ctrlcmd(TPMEmulator *tpm, unsigned long cmd, void *msg,
+                                size_t msg_len_in, size_t msg_len_out)
+{
+    CharBackend *dev = &tpm->ctrl_chr;
+    uint32_t cmd_no = cpu_to_be32(cmd);
+    ssize_t n = sizeof(uint32_t) + msg_len_in;
+    uint8_t *buf = NULL;
+    int ret = -1;
+
+    qemu_mutex_lock(&tpm->mutex);
+
+    buf = g_alloca(n);
+    memcpy(buf, &cmd_no, sizeof(cmd_no));
+    memcpy(buf + sizeof(cmd_no), msg, msg_len_in);
+
+    n = qemu_chr_fe_write_all(dev, buf, n);
+    if (n <= 0) {
+        goto end;
+    }
+
+    if (msg_len_out != 0) {
+        n = qemu_chr_fe_read_all(dev, msg, msg_len_out);
+        if (n <= 0) {
+            goto end;
+        }
+    }
+
+    ret = 0;
+
+end:
+    qemu_mutex_unlock(&tpm->mutex);
+    return ret;
+}
+
+static int tpm_emulator_unix_tx_bufs(TPMEmulator *tpm_emu,
+                                     const uint8_t *in, uint32_t in_len,
+                                     uint8_t *out, uint32_t out_len,
+                                     bool *selftest_done,
+                                     Error **errp)
+{
+    ssize_t ret;
+    bool is_selftest = false;
+
+    if (selftest_done) {
+        *selftest_done = false;
+        is_selftest = tpm_util_is_selftest(in, in_len);
+    }
+
+    ret = qio_channel_write_all(tpm_emu->data_ioc, (char *)in, in_len, errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    ret = qio_channel_read_all(tpm_emu->data_ioc, (char *)out,
+              sizeof(struct tpm_resp_hdr), errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    ret = qio_channel_read_all(tpm_emu->data_ioc,
+              (char *)out + sizeof(struct tpm_resp_hdr),
+              tpm_cmd_get_size(out) - sizeof(struct tpm_resp_hdr), errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    if (is_selftest) {
+        *selftest_done = tpm_cmd_get_errcode(out) == 0;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_set_locality(TPMEmulator *tpm_emu, uint8_t locty_number,
+                                     Error **errp)
+{
+    ptm_loc loc;
+
+    if (tpm_emu->cur_locty_number == locty_number) {
+        return 0;
+    }
+
+    trace_tpm_emulator_set_locality(locty_number);
+
+    memset(&loc, 0, sizeof(loc));
+    loc.u.req.loc = locty_number;
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc,
+                             sizeof(loc), sizeof(loc)) < 0) {
+        error_setg(errp, "tpm-emulator: could not set locality : %s",
+                   strerror(errno));
+        return -1;
+    }
+
+    loc.u.resp.tpm_result = be32_to_cpu(loc.u.resp.tpm_result);
+    if (loc.u.resp.tpm_result != 0) {
+        error_setg(errp, "tpm-emulator: TPM result for set locality : 0x%x",
+                   loc.u.resp.tpm_result);
+        return -1;
+    }
+
+    tpm_emu->cur_locty_number = locty_number;
+
+    return 0;
+}
+
+static void tpm_emulator_handle_request(TPMBackend *tb, TPMBackendCmd *cmd,
+                                        Error **errp)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    trace_tpm_emulator_handle_request();
+
+    if (tpm_emulator_set_locality(tpm_emu, cmd->locty, errp) < 0 ||
+        tpm_emulator_unix_tx_bufs(tpm_emu, cmd->in, cmd->in_len,
+                                  cmd->out, cmd->out_len,
+                                  &cmd->selftest_done, errp) < 0) {
+        tpm_util_write_fatal_error_response(cmd->out, cmd->out_len);
+    }
+}
+
+static int tpm_emulator_probe_caps(TPMEmulator *tpm_emu)
+{
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_CAPABILITY,
+                             &tpm_emu->caps, 0, sizeof(tpm_emu->caps)) < 0) {
+        error_report("tpm-emulator: probing failed : %s", strerror(errno));
+        return -1;
+    }
+
+    tpm_emu->caps = be64_to_cpu(tpm_emu->caps);
+
+    trace_tpm_emulator_probe_caps(tpm_emu->caps);
+
+    return 0;
+}
+
+static int tpm_emulator_check_caps(TPMEmulator *tpm_emu)
+{
+    ptm_cap caps = 0;
+    const char *tpm = NULL;
+
+    /* check for min. required capabilities */
+    switch (tpm_emu->tpm_version) {
+    case TPM_VERSION_1_2:
+        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
+               PTM_CAP_SET_LOCALITY | PTM_CAP_SET_DATAFD | PTM_CAP_STOP |
+               PTM_CAP_SET_BUFFERSIZE;
+        tpm = "1.2";
+        break;
+    case TPM_VERSION_2_0:
+        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
+               PTM_CAP_SET_LOCALITY | PTM_CAP_RESET_TPMESTABLISHED |
+               PTM_CAP_SET_DATAFD | PTM_CAP_STOP | PTM_CAP_SET_BUFFERSIZE;
+        tpm = "2";
+        break;
+    case TPM_VERSION_UNSPEC:
+        error_report("tpm-emulator: TPM version has not been set");
+        return -1;
+    }
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, caps)) {
+        error_report("tpm-emulator: TPM does not implement minimum set of "
+                     "required capabilities for TPM %s (0x%x)", tpm, (int)caps);
+        return -1;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_stop_tpm(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_res res;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_STOP, &res, 0, sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not stop TPM: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(res);
+    if (res) {
+        error_report("tpm-emulator: TPM result for CMD_STOP: 0x%x %s", res,
+                     tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_set_buffer_size(TPMBackend *tb,
+                                        size_t wanted_size,
+                                        size_t *actual_size)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_setbuffersize psbs;
+
+    if (tpm_emulator_stop_tpm(tb) < 0) {
+        return -1;
+    }
+
+    psbs.u.req.buffersize = cpu_to_be32(wanted_size);
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_BUFFERSIZE, &psbs,
+                             sizeof(psbs.u.req), sizeof(psbs.u.resp)) < 0) {
+        error_report("tpm-emulator: Could not set buffer size: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    psbs.u.resp.tpm_result = be32_to_cpu(psbs.u.resp.tpm_result);
+    if (psbs.u.resp.tpm_result != 0) {
+        error_report("tpm-emulator: TPM result for set buffer size : 0x%x %s",
+                     psbs.u.resp.tpm_result,
+                     tpm_emulator_strerror(psbs.u.resp.tpm_result));
+        return -1;
+    }
+
+    if (actual_size) {
+        *actual_size = be32_to_cpu(psbs.u.resp.buffersize);
+    }
+
+    trace_tpm_emulator_set_buffer_size(
+            be32_to_cpu(psbs.u.resp.buffersize),
+            be32_to_cpu(psbs.u.resp.minsize),
+            be32_to_cpu(psbs.u.resp.maxsize));
+
+    return 0;
+}
+
+static int tpm_emulator_startup_tpm_resume(TPMBackend *tb, size_t buffersize,
+                                     bool is_resume)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_init init = {
+        .u.req.init_flags = 0,
+    };
+    ptm_res res;
+
+    trace_tpm_emulator_startup_tpm_resume(is_resume, buffersize);
+
+    if (buffersize != 0 &&
+        tpm_emulator_set_buffer_size(tb, buffersize, NULL) < 0) {
+        goto err_exit;
+    }
+
+    if (is_resume) {
+        init.u.req.init_flags |= cpu_to_be32(PTM_INIT_FLAG_DELETE_VOLATILE);
+    }
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init),
+                             sizeof(init)) < 0) {
+        error_report("tpm-emulator: could not send INIT: %s",
+                     strerror(errno));
+        goto err_exit;
+    }
+
+    res = be32_to_cpu(init.u.resp.tpm_result);
+    if (res) {
+        error_report("tpm-emulator: TPM result for CMD_INIT: 0x%x %s", res,
+                     tpm_emulator_strerror(res));
+        goto err_exit;
+    }
+    return 0;
+
+err_exit:
+    return -1;
+}
+
+static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
+{
+    return tpm_emulator_startup_tpm_resume(tb, buffersize, false);
+}
+
+static bool tpm_emulator_get_tpm_established_flag(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_est est;
+
+    if (tpm_emu->established_flag_cached) {
+        return tpm_emu->established_flag;
+    }
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_TPMESTABLISHED, &est,
+                             0, sizeof(est)) < 0) {
+        error_report("tpm-emulator: Could not get the TPM established flag: %s",
+                     strerror(errno));
+        return false;
+    }
+    trace_tpm_emulator_get_tpm_established_flag(est.u.resp.bit);
+
+    tpm_emu->established_flag_cached = 1;
+    tpm_emu->established_flag = (est.u.resp.bit != 0);
+
+    return tpm_emu->established_flag;
+}
+
+static int tpm_emulator_reset_tpm_established_flag(TPMBackend *tb,
+                                                   uint8_t locty)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_reset_est reset_est;
+    ptm_res res;
+
+    /* only a TPM 2.0 will support this */
+    if (tpm_emu->tpm_version != TPM_VERSION_2_0) {
+        return 0;
+    }
+
+    reset_est.u.req.loc = tpm_emu->cur_locty_number;
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_RESET_TPMESTABLISHED,
+                             &reset_est, sizeof(reset_est),
+                             sizeof(reset_est)) < 0) {
+        error_report("tpm-emulator: Could not reset the establishment bit: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(reset_est.u.resp.tpm_result);
+    if (res) {
+        error_report(
+            "tpm-emulator: TPM result for rest established flag: 0x%x %s",
+            res, tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    tpm_emu->established_flag_cached = 0;
+
+    return 0;
+}
+
+static void tpm_emulator_cancel_cmd(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_res res;
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, PTM_CAP_CANCEL_TPM_CMD)) {
+        trace_tpm_emulator_cancel_cmd_not_supt();
+        return;
+    }
+
+    /* FIXME: make the function non-blocking, or it may block a VCPU */
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_CANCEL_TPM_CMD, &res, 0,
+                             sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not cancel command: %s",
+                     strerror(errno));
+    } else if (res != 0) {
+        error_report("tpm-emulator: Failed to cancel TPM: 0x%x",
+                     be32_to_cpu(res));
+    }
+}
+
+static TPMVersion tpm_emulator_get_tpm_version(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    return tpm_emu->tpm_version;
+}
+
+static size_t tpm_emulator_get_buffer_size(TPMBackend *tb)
+{
+    size_t actual_size;
+
+    if (tpm_emulator_set_buffer_size(tb, 0, &actual_size) < 0) {
+        return 4096;
+    }
+
+    return actual_size;
+}
+
+static int tpm_emulator_block_migration(TPMEmulator *tpm_emu)
+{
+    Error *err = NULL;
+    ptm_cap caps = PTM_CAP_GET_STATEBLOB | PTM_CAP_SET_STATEBLOB |
+                   PTM_CAP_STOP;
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, caps)) {
+        error_setg(&tpm_emu->migration_blocker,
+                   "Migration disabled: TPM emulator does not support "
+                   "migration");
+        migrate_add_blocker(tpm_emu->migration_blocker, &err);
+        if (err) {
+            error_report_err(err);
+            error_free(tpm_emu->migration_blocker);
+            tpm_emu->migration_blocker = NULL;
+
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_prepare_data_fd(TPMEmulator *tpm_emu)
+{
+    ptm_res res;
+    Error *err = NULL;
+    int fds[2] = { -1, -1 };
+
+    if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
+        error_report("tpm-emulator: Failed to create socketpair");
+        return -1;
+    }
+
+    qemu_chr_fe_set_msgfds(&tpm_emu->ctrl_chr, fds + 1, 1);
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_DATAFD, &res, 0,
+                             sizeof(res)) < 0 || res != 0) {
+        error_report("tpm-emulator: Failed to send CMD_SET_DATAFD: %s",
+                     strerror(errno));
+        goto err_exit;
+    }
+
+    tpm_emu->data_ioc = QIO_CHANNEL(qio_channel_socket_new_fd(fds[0], &err));
+    if (err) {
+        error_prepend(&err, "tpm-emulator: Failed to create io channel: ");
+        error_report_err(err);
+        goto err_exit;
+    }
+
+    closesocket(fds[1]);
+
+    return 0;
+
+err_exit:
+    closesocket(fds[0]);
+    closesocket(fds[1]);
+    return -1;
+}
+
+static int tpm_emulator_handle_device_opts(TPMEmulator *tpm_emu, QemuOpts *opts)
+{
+    const char *value;
+
+    value = qemu_opt_get(opts, "chardev");
+    if (value) {
+        Error *err = NULL;
+        Chardev *dev = qemu_chr_find(value);
+
+        if (!dev) {
+            error_report("tpm-emulator: tpm chardev '%s' not found.", value);
+            goto err;
+        }
+
+        if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
+            error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
+                          value);
+            error_report_err(err);
+            goto err;
+        }
+
+        tpm_emu->options->chardev = g_strdup(value);
+    }
+
+    if (tpm_emulator_prepare_data_fd(tpm_emu) < 0) {
+        goto err;
+    }
+
+    /* FIXME: tpm_util_test_tpmdev() accepts only on socket fd, as it also used
+     * by passthrough driver, which not yet using GIOChannel.
+     */
+    if (tpm_util_test_tpmdev(QIO_CHANNEL_SOCKET(tpm_emu->data_ioc)->fd,
+                             &tpm_emu->tpm_version)) {
+        error_report("'%s' is not emulating TPM device. Error: %s",
+                      tpm_emu->options->chardev, strerror(errno));
+        goto err;
+    }
+
+    switch (tpm_emu->tpm_version) {
+    case TPM_VERSION_1_2:
+        trace_tpm_emulator_handle_device_opts_tpm12();
+        break;
+    case TPM_VERSION_2_0:
+        trace_tpm_emulator_handle_device_opts_tpm2();
+        break;
+    default:
+        trace_tpm_emulator_handle_device_opts_unspec();
+    }
+
+    if (tpm_emulator_probe_caps(tpm_emu) ||
+        tpm_emulator_check_caps(tpm_emu)) {
+        goto err;
+    }
+
+    return tpm_emulator_block_migration(tpm_emu);
+
+err:
+    trace_tpm_emulator_handle_device_opts_startup_error();
+
+    return -1;
+}
+
+static TPMBackend *tpm_emulator_create(QemuOpts *opts)
+{
+    TPMBackend *tb = TPM_BACKEND(object_new(TYPE_TPM_EMULATOR));
+
+    if (tpm_emulator_handle_device_opts(TPM_EMULATOR(tb), opts)) {
+        object_unref(OBJECT(tb));
+        return NULL;
+    }
+
+    return tb;
+}
+
+static TpmTypeOptions *tpm_emulator_get_tpm_options(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    TpmTypeOptions *options = g_new0(TpmTypeOptions, 1);
+
+    options->type = TPM_TYPE_OPTIONS_KIND_EMULATOR;
+    options->u.emulator.data = QAPI_CLONE(TPMEmulatorOptions, tpm_emu->options);
+
+    return options;
+}
+
+static const QemuOptDesc tpm_emulator_cmdline_opts[] = {
+    TPM_STANDARD_CMDLINE_OPTS,
+    {
+        .name = "chardev",
+        .type = QEMU_OPT_STRING,
+        .help = "Character device to use for out-of-band control messages",
+    },
+    { /* end of list */ },
+};
+
+/*
+ * Transfer a TPM state blob from the TPM into a provided buffer.
+ *
+ * @tpm_emu: TPMEmulator
+ * @type: the type of blob to transfer
+ * @tsb: the TPMSizeBuffer to fill with the blob
+ * @flags: the flags to return to the caller
+ */
+static int tpm_emulator_get_state_blob(TPMEmulator *tpm_emu,
+                                       uint8_t type,
+                                       TPMSizedBuffer *tsb,
+                                       uint32_t *flags)
+{
+    ptm_getstate pgs;
+    ptm_res res;
+    ssize_t n;
+    uint32_t totlength, length;
+
+    tpm_sized_buffer_reset(tsb);
+
+    pgs.u.req.state_flags = cpu_to_be32(PTM_STATE_FLAG_DECRYPTED);
+    pgs.u.req.type = cpu_to_be32(type);
+    pgs.u.req.offset = 0;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_STATEBLOB,
+                             &pgs, sizeof(pgs.u.req),
+                             offsetof(ptm_getstate, u.resp.data)) < 0) {
+        error_report("tpm-emulator: could not get state blob type %d : %s",
+                     type, strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(pgs.u.resp.tpm_result);
+    if (res != 0 && (res & 0x800) == 0) {
+        error_report("tpm-emulator: Getting the stateblob (type %d) failed "
+                     "with a TPM error 0x%x %s", type, res,
+                     tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    totlength = be32_to_cpu(pgs.u.resp.totlength);
+    length = be32_to_cpu(pgs.u.resp.length);
+    if (totlength != length) {
+        error_report("tpm-emulator: Expecting to read %u bytes "
+                     "but would get %u", totlength, length);
+        return -1;
+    }
+
+    *flags = be32_to_cpu(pgs.u.resp.state_flags);
+
+    if (totlength > 0) {
+        tsb->buffer = g_try_malloc(totlength);
+        if (!tsb->buffer) {
+            error_report("tpm-emulator: Out of memory allocating %u bytes",
+                         totlength);
+            return -1;
+        }
+
+        n = qemu_chr_fe_read_all(&tpm_emu->ctrl_chr, tsb->buffer, totlength);
+        if (n != totlength) {
+            error_report("tpm-emulator: Could not read stateblob (type %d); "
+                         "expected %u bytes, got %zd",
+                         type, totlength, n);
+            return -1;
+        }
+    }
+    tsb->size = totlength;
+
+    trace_tpm_emulator_get_state_blob(type, tsb->size, *flags);
+
+    return 0;
+}
+
+static int tpm_emulator_get_state_blobs(TPMEmulator *tpm_emu)
+{
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    if (tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_PERMANENT,
+                                    &state_blobs->permanent,
+                                    &state_blobs->permanent_flags) < 0 ||
+        tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_VOLATILE,
+                                    &state_blobs->volatil,
+                                    &state_blobs->volatil_flags) < 0 ||
+        tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_SAVESTATE,
+                                    &state_blobs->savestate,
+                                    &state_blobs->savestate_flags) < 0) {
+        goto err_exit;
+    }
+
+    return 0;
+
+ err_exit:
+    tpm_sized_buffer_reset(&state_blobs->volatil);
+    tpm_sized_buffer_reset(&state_blobs->permanent);
+    tpm_sized_buffer_reset(&state_blobs->savestate);
+
+    return -1;
+}
+
+/*
+ * Transfer a TPM state blob to the TPM emulator.
+ *
+ * @tpm_emu: TPMEmulator
+ * @type: the type of TPM state blob to transfer
+ * @tsb: TPMSizedBuffer containing the TPM state blob
+ * @flags: Flags describing the (encryption) state of the TPM state blob
+ */
+static int tpm_emulator_set_state_blob(TPMEmulator *tpm_emu,
+                                       uint32_t type,
+                                       TPMSizedBuffer *tsb,
+                                       uint32_t flags)
+{
+    ssize_t n;
+    ptm_setstate pss;
+    ptm_res tpm_result;
+
+    if (tsb->size == 0) {
+        return 0;
+    }
+
+    pss = (ptm_setstate) {
+        .u.req.state_flags = cpu_to_be32(flags),
+        .u.req.type = cpu_to_be32(type),
+        .u.req.length = cpu_to_be32(tsb->size),
+    };
+
+    /* write the header only */
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_STATEBLOB, &pss,
+                             offsetof(ptm_setstate, u.req.data), 0) < 0) {
+        error_report("tpm-emulator: could not set state blob type %d : %s",
+                     type, strerror(errno));
+        return -1;
+    }
+
+    /* now the body */
+    n = qemu_chr_fe_write_all(&tpm_emu->ctrl_chr, tsb->buffer, tsb->size);
+    if (n != tsb->size) {
+        error_report("tpm-emulator: Writing the stateblob (type %d) "
+                     "failed; could not write %u bytes, but only %zd",
+                     type, tsb->size, n);
+        return -1;
+    }
+
+    /* now get the result */
+    n = qemu_chr_fe_read_all(&tpm_emu->ctrl_chr,
+                             (uint8_t *)&pss, sizeof(pss.u.resp));
+    if (n != sizeof(pss.u.resp)) {
+        error_report("tpm-emulator: Reading response from writing stateblob "
+                     "(type %d) failed; expected %zu bytes, got %zd", type,
+                     sizeof(pss.u.resp), n);
+        return -1;
+    }
+
+    tpm_result = be32_to_cpu(pss.u.resp.tpm_result);
+    if (tpm_result != 0) {
+        error_report("tpm-emulator: Setting the stateblob (type %d) failed "
+                     "with a TPM error 0x%x %s", type, tpm_result,
+                     tpm_emulator_strerror(tpm_result));
+        return -1;
+    }
+
+    trace_tpm_emulator_set_state_blob(type, tsb->size, flags);
+
+    return 0;
+}
+
+/*
+ * Set all the TPM state blobs.
+ *
+ * Returns a negative errno code in case of error.
+ */
+static int tpm_emulator_set_state_blobs(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    trace_tpm_emulator_set_state_blobs();
+
+    if (tpm_emulator_stop_tpm(tb) < 0) {
+        trace_tpm_emulator_set_state_blobs_error("Could not stop TPM");
+        return -EIO;
+    }
+
+    if (tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_PERMANENT,
+                                    &state_blobs->permanent,
+                                    state_blobs->permanent_flags) < 0 ||
+        tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_VOLATILE,
+                                    &state_blobs->volatil,
+                                    state_blobs->volatil_flags) < 0 ||
+        tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_SAVESTATE,
+                                    &state_blobs->savestate,
+                                    state_blobs->savestate_flags) < 0) {
+        return -EIO;
+    }
+
+    trace_tpm_emulator_set_state_blobs_done();
+
+    return 0;
+}
+
+static int tpm_emulator_pre_save(void *opaque)
+{
+    TPMBackend *tb = opaque;
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    trace_tpm_emulator_pre_save();
+
+    tpm_backend_finish_sync(tb);
+
+    /* get the state blobs from the TPM */
+    return tpm_emulator_get_state_blobs(tpm_emu);
+}
+
+/*
+ * Load the TPM state blobs into the TPM.
+ *
+ * Returns negative errno codes in case of error.
+ */
+static int tpm_emulator_post_load(void *opaque, int version_id)
+{
+    TPMBackend *tb = opaque;
+    int ret;
+
+    ret = tpm_emulator_set_state_blobs(tb);
+    if (ret < 0) {
+        return ret;
+    }
+
+    if (tpm_emulator_startup_tpm_resume(tb, 0, true) < 0) {
+        return -EIO;
+    }
+
+    return 0;
+}
+
+static const VMStateDescription vmstate_tpm_emulator = {
+    .name = "tpm-emulator",
+    .version_id = 0,
+    .pre_save = tpm_emulator_pre_save,
+    .post_load = tpm_emulator_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(state_blobs.permanent_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.permanent.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.permanent.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.permanent.size),
+
+        VMSTATE_UINT32(state_blobs.volatil_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.volatil.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.volatil.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.volatil.size),
+
+        VMSTATE_UINT32(state_blobs.savestate_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.savestate.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.savestate.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.savestate.size),
+
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void tpm_emulator_inst_init(Object *obj)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(obj);
+
+    trace_tpm_emulator_inst_init();
+
+    tpm_emu->options = g_new0(TPMEmulatorOptions, 1);
+    tpm_emu->cur_locty_number = ~0;
+    qemu_mutex_init(&tpm_emu->mutex);
+
+    vmstate_register(NULL, VMSTATE_INSTANCE_ID_ANY,
+                     &vmstate_tpm_emulator, obj);
+}
+
+/*
+ * Gracefully shut down the external TPM
+ */
+static void tpm_emulator_shutdown(TPMEmulator *tpm_emu)
+{
+    ptm_res res;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SHUTDOWN, &res, 0, sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s",
+                     strerror(errno));
+    } else if (res != 0) {
+        error_report("tpm-emulator: TPM result for shutdown: 0x%x %s",
+                     be32_to_cpu(res), tpm_emulator_strerror(be32_to_cpu(res)));
+    }
+}
+
+static void tpm_emulator_inst_finalize(Object *obj)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(obj);
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    tpm_emulator_shutdown(tpm_emu);
+
+    object_unref(OBJECT(tpm_emu->data_ioc));
+
+    qemu_chr_fe_deinit(&tpm_emu->ctrl_chr, false);
+
+    qapi_free_TPMEmulatorOptions(tpm_emu->options);
+
+    if (tpm_emu->migration_blocker) {
+        migrate_del_blocker(tpm_emu->migration_blocker);
+        error_free(tpm_emu->migration_blocker);
+    }
+
+    tpm_sized_buffer_reset(&state_blobs->volatil);
+    tpm_sized_buffer_reset(&state_blobs->permanent);
+    tpm_sized_buffer_reset(&state_blobs->savestate);
+
+    qemu_mutex_destroy(&tpm_emu->mutex);
+
+    vmstate_unregister(NULL, &vmstate_tpm_emulator, obj);
+}
+
+static void tpm_emulator_class_init(ObjectClass *klass, void *data)
+{
+    TPMBackendClass *tbc = TPM_BACKEND_CLASS(klass);
+
+    tbc->type = TPM_TYPE_EMULATOR;
+    tbc->opts = tpm_emulator_cmdline_opts;
+    tbc->desc = "TPM emulator backend driver";
+    tbc->create = tpm_emulator_create;
+    tbc->startup_tpm = tpm_emulator_startup_tpm;
+    tbc->cancel_cmd = tpm_emulator_cancel_cmd;
+    tbc->get_tpm_established_flag = tpm_emulator_get_tpm_established_flag;
+    tbc->reset_tpm_established_flag = tpm_emulator_reset_tpm_established_flag;
+    tbc->get_tpm_version = tpm_emulator_get_tpm_version;
+    tbc->get_buffer_size = tpm_emulator_get_buffer_size;
+    tbc->get_tpm_options = tpm_emulator_get_tpm_options;
+
+    tbc->handle_request = tpm_emulator_handle_request;
+}
+
+static const TypeInfo tpm_emulator_info = {
+    .name = TYPE_TPM_EMULATOR,
+    .parent = TYPE_TPM_BACKEND,
+    .instance_size = sizeof(TPMEmulator),
+    .class_init = tpm_emulator_class_init,
+    .instance_init = tpm_emulator_inst_init,
+    .instance_finalize = tpm_emulator_inst_finalize,
+};
+
+static void tpm_emulator_register(void)
+{
+    type_register_static(&tpm_emulator_info);
+}
+
+type_init(tpm_emulator_register)
diff --git a/backends/tpm/tpm_int.h b/backends/tpm/tpm_int.h
new file mode 100644
index 0000000000..ba6109306e
--- /dev/null
+++ b/backends/tpm/tpm_int.h
@@ -0,0 +1,88 @@
+/*
+ * TPM configuration
+ *
+ * Copyright (C) 2011-2013 IBM Corporation
+ *
+ * Authors:
+ *  Stefan Berger    <stefanb@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef BACKENDS_TPM_INT_H
+#define BACKENDS_TPM_INT_H
+
+#include "qemu/option.h"
+#include "sysemu/tpm.h"
+
+#define TPM_STANDARD_CMDLINE_OPTS \
+    { \
+        .name = "type", \
+        .type = QEMU_OPT_STRING, \
+        .help = "Type of TPM backend", \
+    }
+
+struct tpm_req_hdr {
+    uint16_t tag;
+    uint32_t len;
+    uint32_t ordinal;
+} QEMU_PACKED;
+
+struct tpm_resp_hdr {
+    uint16_t tag;
+    uint32_t len;
+    uint32_t errcode;
+} QEMU_PACKED;
+
+#define TPM_TAG_RQU_COMMAND       0xc1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0xc2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0xc3
+
+#define TPM_TAG_RSP_COMMAND       0xc4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
+
+#define TPM_BAD_PARAMETER         3
+#define TPM_FAIL                  9
+#define TPM_KEYNOTFOUND           13
+#define TPM_BAD_PARAM_SIZE        25
+#define TPM_ENCRYPT_ERROR         32
+#define TPM_DECRYPT_ERROR         33
+#define TPM_BAD_KEY_PROPERTY      40
+#define TPM_BAD_MODE              44
+#define TPM_BAD_VERSION           46
+#define TPM_BAD_LOCALITY          61
+
+#define TPM_ORD_ContinueSelfTest  0x53
+#define TPM_ORD_GetTicks          0xf1
+#define TPM_ORD_GetCapability     0x65
+
+#define TPM_CAP_PROPERTY          0x05
+
+#define TPM_CAP_PROP_INPUT_BUFFER 0x124
+
+/* TPM2 defines */
+#define TPM2_ST_NO_SESSIONS       0x8001
+
+#define TPM2_CC_ReadClock         0x00000181
+#define TPM2_CC_GetCapability     0x0000017a
+
+#define TPM2_CAP_TPM_PROPERTIES   0x6
+
+#define TPM2_PT_MAX_COMMAND_SIZE  0x11e
+
+#define TPM_RC_INSUFFICIENT       0x9a
+#define TPM_RC_FAILURE            0x101
+#define TPM_RC_LOCALITY           0x907
+
+int tpm_util_get_buffer_size(int tpm_fd, TPMVersion tpm_version,
+                             size_t *buffersize);
+
+typedef struct TPMSizedBuffer {
+    uint32_t size;
+    uint8_t  *buffer;
+} TPMSizedBuffer;
+
+void tpm_sized_buffer_reset(TPMSizedBuffer *tsb);
+
+#endif /* BACKENDS_TPM_INT_H */
diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
new file mode 100644
index 0000000000..f5f5c553a9
--- /dev/null
+++ b/backends/tpm/tpm_ioctl.h
@@ -0,0 +1,271 @@
+/*
+ * tpm_ioctl.h
+ *
+ * (c) Copyright IBM Corporation 2014, 2015.
+ *
+ * This file is licensed under the terms of the 3-clause BSD license
+ */
+
+#ifndef TPM_IOCTL_H
+#define TPM_IOCTL_H
+
+#include <sys/uio.h>
+#include <sys/ioctl.h>
+
+/*
+ * Every response from a command involving a TPM command execution must hold
+ * the ptm_res as the first element.
+ * ptm_res corresponds to the error code of a command executed by the TPM.
+ */
+
+typedef uint32_t ptm_res;
+
+/* PTM_GET_TPMESTABLISHED: get the establishment bit */
+struct ptm_est {
+    union {
+        struct {
+            ptm_res tpm_result;
+            unsigned char bit; /* TPM established bit */
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_RESET_TPMESTABLISHED: reset establishment bit */
+struct ptm_reset_est {
+    union {
+        struct {
+            uint8_t loc; /* locality to use */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_INIT */
+struct ptm_init {
+    union {
+        struct {
+            uint32_t init_flags; /* see definitions below */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* above init_flags */
+#define PTM_INIT_FLAG_DELETE_VOLATILE (1 << 0)
+    /* delete volatile state file after reading it */
+
+/* PTM_SET_LOCALITY */
+struct ptm_loc {
+    union {
+        struct {
+            uint8_t loc; /* locality to set */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_HASH_DATA: hash given data */
+struct ptm_hdata {
+    union {
+        struct {
+            uint32_t length;
+            uint8_t data[4096];
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/*
+ * size of the TPM state blob to transfer; x86_64 can handle 8k,
+ * ppc64le only ~7k; keep the response below a 4k page size
+ */
+#define PTM_STATE_BLOB_SIZE (3 * 1024)
+
+/*
+ * The following is the data structure to get state blobs from the TPM.
+ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple reads
+ * with this ioctl and with adjusted offset are necessary. All bytes
+ * must be transferred and the transfer is done once the last byte has been
+ * returned.
+ * It is possible to use the read() interface for reading the data; however, the
+ * first bytes of the state blob will be part of the response to the ioctl(); a
+ * subsequent read() is only necessary if the total length (totlength) exceeds
+ * the number of received bytes. seek() is not supported.
+ */
+struct ptm_getstate {
+    union {
+        struct {
+            uint32_t state_flags; /* may be: PTM_STATE_FLAG_DECRYPTED */
+            uint32_t type;        /* which blob to pull */
+            uint32_t offset;      /* offset from where to read */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+            uint32_t state_flags; /* may be: PTM_STATE_FLAG_ENCRYPTED */
+            uint32_t totlength;   /* total length that will be transferred */
+            uint32_t length;      /* number of bytes in following buffer */
+            uint8_t  data[PTM_STATE_BLOB_SIZE];
+        } resp; /* response */
+    } u;
+};
+
+/* TPM state blob types */
+#define PTM_BLOB_TYPE_PERMANENT  1
+#define PTM_BLOB_TYPE_VOLATILE   2
+#define PTM_BLOB_TYPE_SAVESTATE  3
+
+/* state_flags above : */
+#define PTM_STATE_FLAG_DECRYPTED     1 /* on input:  get decrypted state */
+#define PTM_STATE_FLAG_ENCRYPTED     2 /* on output: state is encrypted */
+
+/*
+ * The following is the data structure to set state blobs in the TPM.
+ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple
+ * 'writes' using this ioctl are necessary. The last packet is indicated
+ * by the length being smaller than the PTM_STATE_BLOB_SIZE.
+ * The very first packet may have a length indicator of '0' enabling
+ * a write() with all the bytes from a buffer. If the write() interface
+ * is used, a final ioctl with a non-full buffer must be made to indicate
+ * that all data were transferred (a write with 0 bytes would not work).
+ */
+struct ptm_setstate {
+    union {
+        struct {
+            uint32_t state_flags; /* may be PTM_STATE_FLAG_ENCRYPTED */
+            uint32_t type;        /* which blob to set */
+            uint32_t length;      /* length of the data;
+                                     use 0 on the first packet to
+                                     transfer using write() */
+            uint8_t data[PTM_STATE_BLOB_SIZE];
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/*
+ * PTM_GET_CONFIG: Data structure to get runtime configuration information
+ * such as which keys are applied.
+ */
+struct ptm_getconfig {
+    union {
+        struct {
+            ptm_res tpm_result;
+            uint32_t flags;
+        } resp; /* response */
+    } u;
+};
+
+#define PTM_CONFIG_FLAG_FILE_KEY        0x1
+#define PTM_CONFIG_FLAG_MIGRATION_KEY   0x2
+
+/*
+ * PTM_SET_BUFFERSIZE: Set the buffer size to be used by the TPM.
+ * A 0 on input queries for the current buffer size. Any other
+ * number will try to set the buffer size. The returned number is
+ * the buffer size that will be used, which can be larger than the
+ * requested one, if it was below the minimum, or smaller than the
+ * requested one, if it was above the maximum.
+ */
+struct ptm_setbuffersize {
+    union {
+        struct {
+            uint32_t buffersize; /* 0 to query for current buffer size */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+            uint32_t buffersize; /* buffer size in use */
+            uint32_t minsize; /* min. supported buffer size */
+            uint32_t maxsize; /* max. supported buffer size */
+        } resp; /* response */
+    } u;
+};
+
+
+typedef uint64_t ptm_cap;
+typedef struct ptm_est ptm_est;
+typedef struct ptm_reset_est ptm_reset_est;
+typedef struct ptm_loc ptm_loc;
+typedef struct ptm_hdata ptm_hdata;
+typedef struct ptm_init ptm_init;
+typedef struct ptm_getstate ptm_getstate;
+typedef struct ptm_setstate ptm_setstate;
+typedef struct ptm_getconfig ptm_getconfig;
+typedef struct ptm_setbuffersize ptm_setbuffersize;
+
+/* capability flags returned by PTM_GET_CAPABILITY */
+#define PTM_CAP_INIT               (1)
+#define PTM_CAP_SHUTDOWN           (1 << 1)
+#define PTM_CAP_GET_TPMESTABLISHED (1 << 2)
+#define PTM_CAP_SET_LOCALITY       (1 << 3)
+#define PTM_CAP_HASHING            (1 << 4)
+#define PTM_CAP_CANCEL_TPM_CMD     (1 << 5)
+#define PTM_CAP_STORE_VOLATILE     (1 << 6)
+#define PTM_CAP_RESET_TPMESTABLISHED (1 << 7)
+#define PTM_CAP_GET_STATEBLOB      (1 << 8)
+#define PTM_CAP_SET_STATEBLOB      (1 << 9)
+#define PTM_CAP_STOP               (1 << 10)
+#define PTM_CAP_GET_CONFIG         (1 << 11)
+#define PTM_CAP_SET_DATAFD         (1 << 12)
+#define PTM_CAP_SET_BUFFERSIZE     (1 << 13)
+
+enum {
+    PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
+    PTM_INIT               = _IOWR('P', 1, ptm_init),
+    PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
+    PTM_GET_TPMESTABLISHED = _IOR('P', 3, ptm_est),
+    PTM_SET_LOCALITY       = _IOWR('P', 4, ptm_loc),
+    PTM_HASH_START         = _IOR('P', 5, ptm_res),
+    PTM_HASH_DATA          = _IOWR('P', 6, ptm_hdata),
+    PTM_HASH_END           = _IOR('P', 7, ptm_res),
+    PTM_CANCEL_TPM_CMD     = _IOR('P', 8, ptm_res),
+    PTM_STORE_VOLATILE     = _IOR('P', 9, ptm_res),
+    PTM_RESET_TPMESTABLISHED = _IOWR('P', 10, ptm_reset_est),
+    PTM_GET_STATEBLOB      = _IOWR('P', 11, ptm_getstate),
+    PTM_SET_STATEBLOB      = _IOWR('P', 12, ptm_setstate),
+    PTM_STOP               = _IOR('P', 13, ptm_res),
+    PTM_GET_CONFIG         = _IOR('P', 14, ptm_getconfig),
+    PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
+    PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
+};
+
+/*
+ * Commands used by the non-CUSE TPMs
+ *
+ * All messages container big-endian data.
+ *
+ * The return messages only contain the 'resp' part of the unions
+ * in the data structures above. Besides that the limits in the
+ * buffers above (ptm_hdata:u.req.data and ptm_get_state:u.resp.data
+ * and ptm_set_state:u.req.data) are 0xffffffff.
+ */
+enum {
+    CMD_GET_CAPABILITY = 1,
+    CMD_INIT,
+    CMD_SHUTDOWN,
+    CMD_GET_TPMESTABLISHED,
+    CMD_SET_LOCALITY,
+    CMD_HASH_START,
+    CMD_HASH_DATA,
+    CMD_HASH_END,
+    CMD_CANCEL_TPM_CMD,
+    CMD_STORE_VOLATILE,
+    CMD_RESET_TPMESTABLISHED,
+    CMD_GET_STATEBLOB,
+    CMD_SET_STATEBLOB,
+    CMD_STOP,
+    CMD_GET_CONFIG,
+    CMD_SET_DATAFD,
+    CMD_SET_BUFFERSIZE,
+};
+
+#endif /* TPM_IOCTL_H */
diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c
new file mode 100644
index 0000000000..7403807ec4
--- /dev/null
+++ b/backends/tpm/tpm_passthrough.c
@@ -0,0 +1,405 @@
+/*
+ *  passthrough TPM driver
+ *
+ *  Copyright (c) 2010 - 2013 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ *  Copyright (C) 2011 IAIK, Graz University of Technology
+ *    Author: Andreas Niederl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "qemu/error-report.h"
+#include "qemu/module.h"
+#include "qemu/sockets.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "tpm_int.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-tpm.h"
+#include "trace.h"
+
+#define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
+#define TPM_PASSTHROUGH(obj) \
+    OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
+
+/* data structures */
+struct TPMPassthruState {
+    TPMBackend parent;
+
+    TPMPassthroughOptions *options;
+    const char *tpm_dev;
+    int tpm_fd;
+    bool tpm_executing;
+    bool tpm_op_canceled;
+    int cancel_fd;
+
+    TPMVersion tpm_version;
+    size_t tpm_buffersize;
+};
+
+typedef struct TPMPassthruState TPMPassthruState;
+
+#define TPM_PASSTHROUGH_DEFAULT_DEVICE "/dev/tpm0"
+
+/* functions */
+
+static void tpm_passthrough_cancel_cmd(TPMBackend *tb);
+
+static int tpm_passthrough_unix_read(int fd, uint8_t *buf, uint32_t len)
+{
+    int ret;
+ reread:
+    ret = read(fd, buf, len);
+    if (ret < 0) {
+        if (errno != EINTR && errno != EAGAIN) {
+            return -1;
+        }
+        goto reread;
+    }
+    return ret;
+}
+
+static void tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
+                                         const uint8_t *in, uint32_t in_len,
+                                         uint8_t *out, uint32_t out_len,
+                                         bool *selftest_done, Error **errp)
+{
+    ssize_t ret;
+    bool is_selftest;
+
+    /* FIXME: protect shared variables or use other sync mechanism */
+    tpm_pt->tpm_op_canceled = false;
+    tpm_pt->tpm_executing = true;
+    *selftest_done = false;
+
+    is_selftest = tpm_util_is_selftest(in, in_len);
+
+    ret = qemu_write_full(tpm_pt->tpm_fd, in, in_len);
+    if (ret != in_len) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
+            error_setg_errno(errp, errno, "tpm_passthrough: error while "
+                             "transmitting data to TPM");
+        }
+        goto err_exit;
+    }
+
+    tpm_pt->tpm_executing = false;
+
+    ret = tpm_passthrough_unix_read(tpm_pt->tpm_fd, out, out_len);
+    if (ret < 0) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
+            error_setg_errno(errp, errno, "tpm_passthrough: error while "
+                             "reading data from TPM");
+        }
+    } else if (ret < sizeof(struct tpm_resp_hdr) ||
+               tpm_cmd_get_size(out) != ret) {
+        ret = -1;
+        error_setg_errno(errp, errno, "tpm_passthrough: received invalid "
+                     "response packet from TPM");
+    }
+
+    if (is_selftest && (ret >= sizeof(struct tpm_resp_hdr))) {
+        *selftest_done = tpm_cmd_get_errcode(out) == 0;
+    }
+
+err_exit:
+    if (ret < 0) {
+        tpm_util_write_fatal_error_response(out, out_len);
+    }
+
+    tpm_pt->tpm_executing = false;
+}
+
+static void tpm_passthrough_handle_request(TPMBackend *tb, TPMBackendCmd *cmd,
+                                           Error **errp)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    trace_tpm_passthrough_handle_request(cmd);
+
+    tpm_passthrough_unix_tx_bufs(tpm_pt, cmd->in, cmd->in_len,
+                                 cmd->out, cmd->out_len, &cmd->selftest_done,
+                                 errp);
+}
+
+static void tpm_passthrough_reset(TPMBackend *tb)
+{
+    trace_tpm_passthrough_reset();
+
+    tpm_passthrough_cancel_cmd(tb);
+}
+
+static bool tpm_passthrough_get_tpm_established_flag(TPMBackend *tb)
+{
+    return false;
+}
+
+static int tpm_passthrough_reset_tpm_established_flag(TPMBackend *tb,
+                                                      uint8_t locty)
+{
+    /* only a TPM 2.0 will support this */
+    return 0;
+}
+
+static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+    int n;
+
+    /*
+     * As of Linux 3.7 the tpm_tis driver does not properly cancel
+     * commands on all TPM manufacturers' TPMs.
+     * Only cancel if we're busy so we don't cancel someone else's
+     * command, e.g., a command executed on the host.
+     */
+    if (tpm_pt->tpm_executing) {
+        if (tpm_pt->cancel_fd >= 0) {
+            tpm_pt->tpm_op_canceled = true;
+            n = write(tpm_pt->cancel_fd, "-", 1);
+            if (n != 1) {
+                error_report("Canceling TPM command failed: %s",
+                             strerror(errno));
+            }
+        } else {
+            error_report("Cannot cancel TPM command due to missing "
+                         "TPM sysfs cancel entry");
+        }
+    }
+}
+
+static TPMVersion tpm_passthrough_get_tpm_version(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    return tpm_pt->tpm_version;
+}
+
+static size_t tpm_passthrough_get_buffer_size(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+    int ret;
+
+    ret = tpm_util_get_buffer_size(tpm_pt->tpm_fd, tpm_pt->tpm_version,
+                                   &tpm_pt->tpm_buffersize);
+    if (ret < 0) {
+        tpm_pt->tpm_buffersize = 4096;
+    }
+    return tpm_pt->tpm_buffersize;
+}
+
+/*
+ * Unless path or file descriptor set has been provided by user,
+ * determine the sysfs cancel file following kernel documentation
+ * in Documentation/ABI/stable/sysfs-class-tpm.
+ * From /dev/tpm0 create /sys/class/tpm/tpm0/device/cancel
+ * before 4.0: /sys/class/misc/tpm0/device/cancel
+ */
+static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
+{
+    int fd = -1;
+    char *dev;
+    char path[PATH_MAX];
+
+    if (tpm_pt->options->cancel_path) {
+        fd = qemu_open(tpm_pt->options->cancel_path, O_WRONLY);
+        if (fd < 0) {
+            error_report("tpm_passthrough: Could not open TPM cancel path: %s",
+                         strerror(errno));
+        }
+        return fd;
+    }
+
+    dev = strrchr(tpm_pt->tpm_dev, '/');
+    if (!dev) {
+        error_report("tpm_passthrough: Bad TPM device path %s",
+                     tpm_pt->tpm_dev);
+        return -1;
+    }
+
+    dev++;
+    if (snprintf(path, sizeof(path), "/sys/class/tpm/%s/device/cancel",
+                 dev) < sizeof(path)) {
+        fd = qemu_open(path, O_WRONLY);
+        if (fd < 0) {
+            if (snprintf(path, sizeof(path), "/sys/class/misc/%s/device/cancel",
+                         dev) < sizeof(path)) {
+                fd = qemu_open(path, O_WRONLY);
+            }
+        }
+    }
+
+    if (fd < 0) {
+        error_report("tpm_passthrough: Could not guess TPM cancel path");
+    } else {
+        tpm_pt->options->cancel_path = g_strdup(path);
+    }
+
+    return fd;
+}
+
+static int
+tpm_passthrough_handle_device_opts(TPMPassthruState *tpm_pt, QemuOpts *opts)
+{
+    const char *value;
+
+    value = qemu_opt_get(opts, "cancel-path");
+    if (value) {
+        tpm_pt->options->cancel_path = g_strdup(value);
+        tpm_pt->options->has_cancel_path = true;
+    }
+
+    value = qemu_opt_get(opts, "path");
+    if (value) {
+        tpm_pt->options->has_path = true;
+        tpm_pt->options->path = g_strdup(value);
+    }
+
+    tpm_pt->tpm_dev = value ? value : TPM_PASSTHROUGH_DEFAULT_DEVICE;
+    tpm_pt->tpm_fd = qemu_open(tpm_pt->tpm_dev, O_RDWR);
+    if (tpm_pt->tpm_fd < 0) {
+        error_report("Cannot access TPM device using '%s': %s",
+                     tpm_pt->tpm_dev, strerror(errno));
+        return -1;
+    }
+
+    if (tpm_util_test_tpmdev(tpm_pt->tpm_fd, &tpm_pt->tpm_version)) {
+        error_report("'%s' is not a TPM device.",
+                     tpm_pt->tpm_dev);
+        return -1;
+    }
+
+    tpm_pt->cancel_fd = tpm_passthrough_open_sysfs_cancel(tpm_pt);
+    if (tpm_pt->cancel_fd < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+static TPMBackend *tpm_passthrough_create(QemuOpts *opts)
+{
+    Object *obj = object_new(TYPE_TPM_PASSTHROUGH);
+
+    if (tpm_passthrough_handle_device_opts(TPM_PASSTHROUGH(obj), opts)) {
+        object_unref(obj);
+        return NULL;
+    }
+
+    return TPM_BACKEND(obj);
+}
+
+static int tpm_passthrough_startup_tpm(TPMBackend *tb, size_t buffersize)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    if (buffersize && buffersize < tpm_pt->tpm_buffersize) {
+        error_report("Requested buffer size of %zu is smaller than host TPM's "
+                     "fixed buffer size of %zu",
+                     buffersize, tpm_pt->tpm_buffersize);
+        return -1;
+    }
+
+    return 0;
+}
+
+static TpmTypeOptions *tpm_passthrough_get_tpm_options(TPMBackend *tb)
+{
+    TpmTypeOptions *options = g_new0(TpmTypeOptions, 1);
+
+    options->type = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
+    options->u.passthrough.data = QAPI_CLONE(TPMPassthroughOptions,
+                                             TPM_PASSTHROUGH(tb)->options);
+
+    return options;
+}
+
+static const QemuOptDesc tpm_passthrough_cmdline_opts[] = {
+    TPM_STANDARD_CMDLINE_OPTS,
+    {
+        .name = "cancel-path",
+        .type = QEMU_OPT_STRING,
+        .help = "Sysfs file entry for canceling TPM commands",
+    },
+    {
+        .name = "path",
+        .type = QEMU_OPT_STRING,
+        .help = "Path to TPM device on the host",
+    },
+    { /* end of list */ },
+};
+
+static void tpm_passthrough_inst_init(Object *obj)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(obj);
+
+    tpm_pt->options = g_new0(TPMPassthroughOptions, 1);
+    tpm_pt->tpm_fd = -1;
+    tpm_pt->cancel_fd = -1;
+}
+
+static void tpm_passthrough_inst_finalize(Object *obj)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(obj);
+
+    tpm_passthrough_cancel_cmd(TPM_BACKEND(obj));
+
+    if (tpm_pt->tpm_fd >= 0) {
+        qemu_close(tpm_pt->tpm_fd);
+    }
+    if (tpm_pt->cancel_fd >= 0) {
+        qemu_close(tpm_pt->cancel_fd);
+    }
+    qapi_free_TPMPassthroughOptions(tpm_pt->options);
+}
+
+static void tpm_passthrough_class_init(ObjectClass *klass, void *data)
+{
+    TPMBackendClass *tbc = TPM_BACKEND_CLASS(klass);
+
+    tbc->type = TPM_TYPE_PASSTHROUGH;
+    tbc->opts = tpm_passthrough_cmdline_opts;
+    tbc->desc = "Passthrough TPM backend driver";
+    tbc->create = tpm_passthrough_create;
+    tbc->startup_tpm = tpm_passthrough_startup_tpm;
+    tbc->reset = tpm_passthrough_reset;
+    tbc->cancel_cmd = tpm_passthrough_cancel_cmd;
+    tbc->get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag;
+    tbc->reset_tpm_established_flag =
+        tpm_passthrough_reset_tpm_established_flag;
+    tbc->get_tpm_version = tpm_passthrough_get_tpm_version;
+    tbc->get_buffer_size = tpm_passthrough_get_buffer_size;
+    tbc->get_tpm_options = tpm_passthrough_get_tpm_options;
+    tbc->handle_request = tpm_passthrough_handle_request;
+}
+
+static const TypeInfo tpm_passthrough_info = {
+    .name = TYPE_TPM_PASSTHROUGH,
+    .parent = TYPE_TPM_BACKEND,
+    .instance_size = sizeof(TPMPassthruState),
+    .class_init = tpm_passthrough_class_init,
+    .instance_init = tpm_passthrough_inst_init,
+    .instance_finalize = tpm_passthrough_inst_finalize,
+};
+
+static void tpm_passthrough_register(void)
+{
+    type_register_static(&tpm_passthrough_info);
+}
+
+type_init(tpm_passthrough_register)
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
new file mode 100644
index 0000000000..cfc7572a61
--- /dev/null
+++ b/backends/tpm/tpm_util.c
@@ -0,0 +1,380 @@
+/*
+ * TPM utility functions
+ *
+ *  Copyright (c) 2010 - 2015 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "qapi/visitor.h"
+#include "tpm_int.h"
+#include "exec/memory.h"
+#include "hw/qdev-properties.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "trace.h"
+
+/* tpm backend property */
+
+static void get_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
+                    Error **errp)
+{
+    DeviceState *dev = DEVICE(obj);
+    TPMBackend **be = qdev_get_prop_ptr(dev, opaque);
+    char *p;
+
+    p = g_strdup(*be ? (*be)->id : "");
+    visit_type_str(v, name, &p, errp);
+    g_free(p);
+}
+
+static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
+                    Error **errp)
+{
+    DeviceState *dev = DEVICE(obj);
+    Error *local_err = NULL;
+    Property *prop = opaque;
+    TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
+    char *str;
+
+    if (dev->realized) {
+        qdev_prop_set_after_realize(dev, name, errp);
+        return;
+    }
+
+    visit_type_str(v, name, &str, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+
+    s = qemu_find_tpm_be(str);
+    if (s == NULL) {
+        error_setg(errp, "Property '%s.%s' can't find value '%s'",
+                   object_get_typename(obj), prop->name, str);
+    } else if (tpm_backend_init(s, TPM_IF(obj), errp) == 0) {
+        *be = s; /* weak reference, avoid cyclic ref */
+    }
+    g_free(str);
+}
+
+static void release_tpm(Object *obj, const char *name, void *opaque)
+{
+    DeviceState *dev = DEVICE(obj);
+    Property *prop = opaque;
+    TPMBackend **be = qdev_get_prop_ptr(dev, prop);
+
+    if (*be) {
+        tpm_backend_reset(*be);
+    }
+}
+
+const PropertyInfo qdev_prop_tpm = {
+    .name  = "str",
+    .description = "ID of a tpm to use as a backend",
+    .get   = get_tpm,
+    .set   = set_tpm,
+    .release = release_tpm,
+};
+
+/*
+ * Write an error message in the given output buffer.
+ */
+void tpm_util_write_fatal_error_response(uint8_t *out, uint32_t out_len)
+{
+    if (out_len >= sizeof(struct tpm_resp_hdr)) {
+        tpm_cmd_set_tag(out, TPM_TAG_RSP_COMMAND);
+        tpm_cmd_set_size(out, sizeof(struct tpm_resp_hdr));
+        tpm_cmd_set_error(out, TPM_FAIL);
+    }
+}
+
+bool tpm_util_is_selftest(const uint8_t *in, uint32_t in_len)
+{
+    if (in_len >= sizeof(struct tpm_req_hdr)) {
+        return tpm_cmd_get_ordinal(in) == TPM_ORD_ContinueSelfTest;
+    }
+
+    return false;
+}
+
+/*
+ * Send request to a TPM device. We expect a response within one second.
+ */
+static int tpm_util_request(int fd,
+                            const void *request,
+                            size_t requestlen,
+                            void *response,
+                            size_t responselen)
+{
+    fd_set readfds;
+    int n;
+    struct timeval tv = {
+        .tv_sec = 1,
+        .tv_usec = 0,
+    };
+
+    n = write(fd, request, requestlen);
+    if (n < 0) {
+        return -errno;
+    }
+    if (n != requestlen) {
+        return -EFAULT;
+    }
+
+    FD_ZERO(&readfds);
+    FD_SET(fd, &readfds);
+
+    /* wait for a second */
+    n = select(fd + 1, &readfds, NULL, NULL, &tv);
+    if (n != 1) {
+        return -errno;
+    }
+
+    n = read(fd, response, responselen);
+    if (n < sizeof(struct tpm_resp_hdr)) {
+        return -EFAULT;
+    }
+
+    /* check the header */
+    if (tpm_cmd_get_size(response) != n) {
+        return -EMSGSIZE;
+    }
+
+    return 0;
+}
+
+/*
+ * A basic test of a TPM device. We expect a well formatted response header
+ * (error response is fine).
+ */
+static int tpm_util_test(int fd,
+                         const void *request,
+                         size_t requestlen,
+                         uint16_t *return_tag)
+{
+    char buf[1024];
+    ssize_t ret;
+
+    ret = tpm_util_request(fd, request, requestlen,
+                           buf, sizeof(buf));
+    if (ret < 0) {
+        return ret;
+    }
+
+    *return_tag = tpm_cmd_get_tag(buf);
+
+    return 0;
+}
+
+/*
+ * Probe for the TPM device in the back
+ * Returns 0 on success with the version of the probed TPM set, 1 on failure.
+ */
+int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version)
+{
+    /*
+     * Sending a TPM1.2 command to a TPM2 should return a TPM1.2
+     * header (tag = 0xc4) and error code (TPM_BADTAG = 0x1e)
+     *
+     * Sending a TPM2 command to a TPM 2 will give a TPM 2 tag in the
+     * header.
+     * Sending a TPM2 command to a TPM 1.2 will give a TPM 1.2 tag
+     * in the header and an error code.
+     */
+    const struct tpm_req_hdr test_req = {
+        .tag = cpu_to_be16(TPM_TAG_RQU_COMMAND),
+        .len = cpu_to_be32(sizeof(test_req)),
+        .ordinal = cpu_to_be32(TPM_ORD_GetTicks),
+    };
+
+    const struct tpm_req_hdr test_req_tpm2 = {
+        .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
+        .len = cpu_to_be32(sizeof(test_req_tpm2)),


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:00:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14580.35989 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYD9g-0007Jc-BE; Thu, 29 Oct 2020 19:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14580.35989; Thu, 29 Oct 2020 19:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYD9g-0007JU-89; Thu, 29 Oct 2020 19:00:12 +0000
Received: by outflank-mailman (input) for mailman id 14580;
 Thu, 29 Oct 2020 19:00:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYD9f-0007JP-3y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 73f3582c-ee65-44c1-b52e-a88535fcfccb;
 Thu, 29 Oct 2020 19:00:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYD9d-0004JP-Tc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYD9d-0007di-S3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYD9f-0007JP-3y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:11 +0000
X-Inumbo-ID: 73f3582c-ee65-44c1-b52e-a88535fcfccb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 73f3582c-ee65-44c1-b52e-a88535fcfccb;
	Thu, 29 Oct 2020 19:00:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JowdDm1baCWC9ueHEqCAHYm23VWcC/aIcImIS4l2GE8=; b=wFLcRQd1D+8RPxy3A2SGPkFYDp
	Dc1iZXL1Vi3wGkr3DH4GCLwz1P2T0TG/gQz6q5AyIIoFCG3o3pNu1GzukGvvk3OXutmDdNJatVp9a
	Q52MnS2QVQfH89j9nZx+rWwNv50A3BhnPQ6fR8QhX8rM2d5SYXTjRgoff/bxZTU2PHBc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYD9d-0004JP-Tc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYD9d-0007di-S3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:00:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
Message-Id: <E1kYD9d-0007di-S3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:00:09 +0000

commit 78318119eead6aed050d1730a6b72d1c555302d2
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Wed Jul 1 21:15:30 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:39:19 2020 +0200

    target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
    
    The result of the get_physical_address() function should be combined with the
    offset of the original page access before being returned. Otherwise the
    m68k_cpu_get_phys_page_debug() function can round to the wrong page causing
    incorrect lookups in gdbstub and various "Disassembler disagrees with
    translator over instruction decoding" warnings to appear at translation time.
    
    Fixes: 88b2fef6c3 ("target/m68k: add MC68040 MMU")
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200701201531.13828-2-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/helper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 79b0b10ea9..631eab7774 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -820,10 +820,14 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     if (env->sr & SR_S) {
         access_type |= ACCESS_SUPER;
     }
+
     if (get_physical_address(env, &phys_addr, &prot,
                              addr, access_type, &page_size) != 0) {
         return -1;
     }
+
+    addr &= TARGET_PAGE_MASK;
+    phys_addr += addr & (page_size - 1);
     return phys_addr;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:11:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14586.36004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDKI-0008Hj-DU; Thu, 29 Oct 2020 19:11:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14586.36004; Thu, 29 Oct 2020 19:11:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDKI-0008Hc-Ae; Thu, 29 Oct 2020 19:11:10 +0000
Received: by outflank-mailman (input) for mailman id 14586;
 Thu, 29 Oct 2020 19:11:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDKH-0008HX-HP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f9efe950-91ca-4a05-b079-a9e020173cf7;
 Thu, 29 Oct 2020 19:11:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDKG-0004WW-7E
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDKG-0000HC-5r
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDKH-0008HX-HP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:09 +0000
X-Inumbo-ID: f9efe950-91ca-4a05-b079-a9e020173cf7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f9efe950-91ca-4a05-b079-a9e020173cf7;
	Thu, 29 Oct 2020 19:11:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mCCjMWw9vNNrtVV426amiUaI+6LCGeYzOYAt40VGXoI=; b=t0qxKRI83S/IEcm5axLG14WECp
	U4tJtIJwNpmikd2gBthlXUtwEKE3alYNem4GJ7CXLwb0tTvaaQQ0CN0srQ2fxzLtWC9J7ZzlAAUKt
	HddIXTHkYOfXs4PZldoqvpFwhblbef2H1T6SmuXo6VMAEPP11Zcm5hefsq2txUvW/iW4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDKG-0004WW-7E
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDKG-0000HC-5r
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:11:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/m68k: consolidate physical translation offset into get_physical_address()
Message-Id: <E1kYDKG-0000HC-5r@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:11:08 +0000

commit 852002b5664bf079da05c5201dbf2345b870e5ed
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Wed Jul 1 21:15:31 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:39:57 2020 +0200

    target/m68k: consolidate physical translation offset into get_physical_address()
    
    Since all callers to get_physical_address() now apply the same page offset to
    the translation result, move the logic into get_physical_address() itself to
    avoid duplication.
    
    Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200701201531.13828-3-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/helper.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 631eab7774..3ff5765795 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -643,7 +643,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
                 /* Transparent Translation Register bit */
                 env->mmu.mmusr = M68K_MMU_T_040 | M68K_MMU_R_040;
             }
-            *physical = address & TARGET_PAGE_MASK;
+            *physical = address;
             *page_size = TARGET_PAGE_SIZE;
             return 0;
         }
@@ -771,7 +771,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
     }
     *page_size = 1 << page_bits;
     page_mask = ~(*page_size - 1);
-    *physical = next & page_mask;
+    *physical = (next & page_mask) + (address & (*page_size - 1));
 
     if (access_type & ACCESS_PTEST) {
         env->mmu.mmusr |= next & M68K_MMU_SR_MASK_040;
@@ -826,8 +826,6 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
         return -1;
     }
 
-    addr &= TARGET_PAGE_MASK;
-    phys_addr += addr & (page_size - 1);
     return phys_addr;
 }
 
@@ -891,10 +889,8 @@ bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     ret = get_physical_address(&cpu->env, &physical, &prot,
                                address, access_type, &page_size);
     if (likely(ret == 0)) {
-        address &= TARGET_PAGE_MASK;
-        physical += address & (page_size - 1);
-        tlb_set_page(cs, address, physical,
-                     prot, mmu_idx, TARGET_PAGE_SIZE);
+        tlb_set_page(cs, address & TARGET_PAGE_MASK,
+                     physical & TARGET_PAGE_MASK, prot, mmu_idx, page_size);
         return true;
     }
 
@@ -1383,9 +1379,8 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
     ret = get_physical_address(env, &physical, &prot, addr,
                                access_type, &page_size);
     if (ret == 0) {
-        addr &= TARGET_PAGE_MASK;
-        physical += addr & (page_size - 1);
-        tlb_set_page(env_cpu(env), addr, physical,
+        tlb_set_page(env_cpu(env), addr & TARGET_PAGE_MASK,
+                     physical & TARGET_PAGE_MASK,
                      prot, access_type & ACCESS_SUPER ?
                      MMU_KERNEL_IDX : MMU_USER_IDX, page_size);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:22:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14599.36036 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDUs-0000yw-Vv; Thu, 29 Oct 2020 19:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14599.36036; Thu, 29 Oct 2020 19:22:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDUs-0000yo-St; Thu, 29 Oct 2020 19:22:06 +0000
Received: by outflank-mailman (input) for mailman id 14599;
 Thu, 29 Oct 2020 19:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDUq-0000yi-Sc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 19f1902a-8ad2-4d36-b40e-c2f3a070ccd4;
 Thu, 29 Oct 2020 19:22:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDUo-0004jq-Ok
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDUo-0000ru-Mx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDUq-0000yi-Sc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:04 +0000
X-Inumbo-ID: 19f1902a-8ad2-4d36-b40e-c2f3a070ccd4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 19f1902a-8ad2-4d36-b40e-c2f3a070ccd4;
	Thu, 29 Oct 2020 19:22:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hKOOwoTk8CFOi2FiBns9TZfuMILlnodgh8rbGr5dRZc=; b=J6eM6QqLxiERslHsGazdjygq1E
	8Pl+uRAmAkmgoTE4wOnEx2xt/CNoecYz7xxPJ0q62qi9qzwRlA/zLQ4FytevQOX7yCAVp6sSt7XdM
	TguY2UcaSdiIKCzIMxy0XMuzh3VlzOsiliLFbV4Zr38SPug2LepsK9iwzwnnyt+0k5iM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDUo-0004jq-Ok
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDUo-0000ru-Mx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kYDUo-0000ru-Mx@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:22:02 +0000

commit 1d021db3c8712d25e25f078833baa160c90f260f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:06:23 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 055e1c3a3d95b1e753148369fbc4ba48782dd602)
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 5ca5c8c9a2..129da1e648 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4279,7 +4279,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:22:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:22:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14600.36041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDV1-0000zw-1b; Thu, 29 Oct 2020 19:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14600.36041; Thu, 29 Oct 2020 19:22:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDV0-0000zn-UY; Thu, 29 Oct 2020 19:22:14 +0000
Received: by outflank-mailman (input) for mailman id 14600;
 Thu, 29 Oct 2020 19:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDV0-0000ze-4d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 04acba89-4770-4930-aeb6-bd0bdb7078d5;
 Thu, 29 Oct 2020 19:22:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDUy-0004jw-TN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDUy-0000sW-RN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDV0-0000ze-4d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:14 +0000
X-Inumbo-ID: 04acba89-4770-4930-aeb6-bd0bdb7078d5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 04acba89-4770-4930-aeb6-bd0bdb7078d5;
	Thu, 29 Oct 2020 19:22:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vn91XBpH/D8Jrwl392oATTdyxMjJTbMaRWYGbWFYuEw=; b=LQSNpmX82lf6uEz5NuhJpJRjpn
	XLJDEXeXtGjYpbOK/idpwZ5SkhdaLzZezclSdEuyEHbrMn09Hbs6RR5/ZwPs8HRHJvY1u5O8HhPLW
	ma1gnkIJY7DRGZ+KpWR+tAeYkG6gKg8nAMPLMFCivQnjNqB5hfHECC3i7Fv727K3cvWg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDUy-0004jw-TN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDUy-0000sW-RN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.11] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kYDUy-0000sW-RN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:22:12 +0000

commit e274c8bdc12eb596e55233040e8b49da27150f31
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 18:07:27 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    (cherry picked from commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883)
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 129da1e648..3528cf6b85 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3983,7 +3983,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4133,6 +4134,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4140,6 +4143,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4147,6 +4152,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv_domain.xpti )
                     {
                         bool local_in_use = false;
@@ -4154,7 +4161,7 @@ long do_mmu_update(
                         if ( pagetable_get_pfn(curr->arch.guest_table) == mfn )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4166,7 +4173,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               (pagetable_get_pfn(curr->arch.guest_table_user) ==
                                mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4268,19 +4275,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.11


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:22:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:22:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14601.36044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDVH-00011m-2v; Thu, 29 Oct 2020 19:22:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14601.36044; Thu, 29 Oct 2020 19:22:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDVH-00011e-07; Thu, 29 Oct 2020 19:22:31 +0000
Received: by outflank-mailman (input) for mailman id 14601;
 Thu, 29 Oct 2020 19:22:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDVG-00011V-EJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5a64d8ae-fb51-46ef-b40b-e00f3d56e83b;
 Thu, 29 Oct 2020 19:22:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDVF-0004kA-HC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDVF-0001Hr-FP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDVG-00011V-EJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:30 +0000
X-Inumbo-ID: 5a64d8ae-fb51-46ef-b40b-e00f3d56e83b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5a64d8ae-fb51-46ef-b40b-e00f3d56e83b;
	Thu, 29 Oct 2020 19:22:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KHP9bvFEl0dtaixx0mGeT8Of25OKnNlkC4mI321bwS0=; b=NJrTQcBxpqb5/SSResy8oW0vyk
	UsT1B/K0RHkmSMZGyNGctYHt5b/OD9HZbyvL5/7fG1su0Yq+Hd0qE+t1VRdg/2I8MW11XAblDmlxn
	aytslYDpiMtCdbg1OCvDuTgeiMAanSm4QevxaIPj1d2N7XrbGy0zmZ0yJvMwGbsL5szc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDVF-0004kA-HC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDVF-0001Hr-FP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:22:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] softfloat,m68k: disable floatx80_invalid_encoding() for m68k
Message-Id: <E1kYDVF-0001Hr-FP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:22:29 +0000

commit d159dd058c7dc48a9291fde92eaae52a9f26a4d1
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jun 12 16:04:00 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:41:52 2020 +0200

    softfloat,m68k: disable floatx80_invalid_encoding() for m68k
    
    According to the comment, this definition of invalid encoding is given
    by intel developer's manual, and doesn't comply with 680x0 FPU.
    
    With m68k, the explicit integer bit can be zero in the case of:
     - zeros                (exp == 0, mantissa == 0)
     - denormalized numbers (exp == 0, mantissa != 0)
     - unnormalized numbers (exp != 0, exp < 0x7FFF)
     - infinities           (exp == 0x7FFF, mantissa == 0)
     - not-a-numbers        (exp == 0x7FFF, mantissa != 0)
    
    For infinities and NaNs, the explicit integer bit can be either one or
    zero.
    
    The IEEE 754 standard does not define a zero integer bit. Such a number
    is an unnormalized number. Hardware does not directly support
    denormalized and unnormalized numbers, but implicitly supports them by
    trapping them as unimplemented data types, allowing efficient conversion
    in software.
    
    See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL",
        "1.6 FLOATING-POINT DATA TYPES"
    
    We will implement in the m68k TCG emulator the FP_UNIMP exception to
    trap into the kernel to normalize the number. In case of linux-user,
    the number will be normalized by QEMU.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200612140400.2130118-1-laurent@vivier.eu>
---
 include/fpu/softfloat.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index ff4e2605b1..f1a19df066 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -794,7 +794,31 @@ static inline bool floatx80_unordered_quiet(floatx80 a, floatx80 b,
 *----------------------------------------------------------------------------*/
 static inline bool floatx80_invalid_encoding(floatx80 a)
 {
+#if defined(TARGET_M68K)
+    /*-------------------------------------------------------------------------
+    | With m68k, the explicit integer bit can be zero in the case of:
+    | - zeros                (exp == 0, mantissa == 0)
+    | - denormalized numbers (exp == 0, mantissa != 0)
+    | - unnormalized numbers (exp != 0, exp < 0x7FFF)
+    | - infinities           (exp == 0x7FFF, mantissa == 0)
+    | - not-a-numbers        (exp == 0x7FFF, mantissa != 0)
+    |
+    | For infinities and NaNs, the explicit integer bit can be either one or
+    | zero.
+    |
+    | The IEEE 754 standard does not define a zero integer bit. Such a number
+    | is an unnormalized number. Hardware does not directly support
+    | denormalized and unnormalized numbers, but implicitly supports them by
+    | trapping them as unimplemented data types, allowing efficient conversion
+    | in software.
+    |
+    | See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL",
+    |     "1.6 FLOATING-POINT DATA TYPES"
+    *------------------------------------------------------------------------*/
+    return false;
+#else
     return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0;
+#endif
 }
 
 #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:33:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14603.36047 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDfX-0001wM-V1; Thu, 29 Oct 2020 19:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14603.36047; Thu, 29 Oct 2020 19:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDfX-0001wE-S8; Thu, 29 Oct 2020 19:33:07 +0000
Received: by outflank-mailman (input) for mailman id 14603;
 Thu, 29 Oct 2020 19:33:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDfX-0001w9-8V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ef5a2c73-e2c4-4880-a6f8-bd5b591dfb4d;
 Thu, 29 Oct 2020 19:33:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDfV-0004yu-W0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDfV-00021n-Ua
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDfX-0001w9-8V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:07 +0000
X-Inumbo-ID: ef5a2c73-e2c4-4880-a6f8-bd5b591dfb4d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ef5a2c73-e2c4-4880-a6f8-bd5b591dfb4d;
	Thu, 29 Oct 2020 19:33:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1FAXPLGKviHDuW6IvS++0uiZQteAyLeupamAliImr6c=; b=yfTFg7ekRAJJuYHGa7l53IH5Ax
	XWoMQLO9uUtD3Fn5NvOgPVL19BMOy9Kvje4JYBL6fLSthrLzHXQF71QSFNiWQu9nb1immLYP+1ro6
	LLEG6KTClpGJIB81abzcdI0UD6L8ZL325apk+IKNcSVMiRWbg879TBGSusoNmMx1l/j0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDfV-0004yu-W0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDfV-00021n-Ua
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv: Drop stale comment in dom0_construct_pv()
Message-Id: <E1kYDfV-00021n-Ua@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:33:05 +0000

commit 26a8fa494f2f323622b6928bd15921b41818f180
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 29 12:03:43 2020 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu Oct 29 19:21:53 2020 +0000

    x86/pv: Drop stale comment in dom0_construct_pv()
    
    This comment was introduced by c/s 22a857bde9b8 in 2003, and became stale with
    c/s 99db02d50976 also in 2003.  Both of these predate the introduction of
    struct vcpu, when the processor field moved object.
    
    17 years is long enough for this comment to be mis-informing people reading
    the code.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/dom0_build.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index d79503d6a9..f7165309a2 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -616,7 +616,6 @@ int __init dom0_construct_pv(struct domain *d,
         v->arch.pv.event_callback_cs    = FLAT_COMPAT_KERNEL_CS;
     }
 
-    /* WARNING: The new domain must have its 'processor' field filled in! */
     if ( !is_pv_32bit_domain(d) )
     {
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l4_page_table;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:33:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14604.36052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDfq-0001xa-17; Thu, 29 Oct 2020 19:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14604.36052; Thu, 29 Oct 2020 19:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDfp-0001xT-U7; Thu, 29 Oct 2020 19:33:25 +0000
Received: by outflank-mailman (input) for mailman id 14604;
 Thu, 29 Oct 2020 19:33:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDfp-0001xN-BV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8d5b44b3-fab9-4db9-a911-d06ff5211a00;
 Thu, 29 Oct 2020 19:33:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDfk-0004z0-7e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDfk-0002Jk-66
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDfp-0001xN-BV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:25 +0000
X-Inumbo-ID: 8d5b44b3-fab9-4db9-a911-d06ff5211a00
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8d5b44b3-fab9-4db9-a911-d06ff5211a00;
	Thu, 29 Oct 2020 19:33:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M5/DpxINiohvVWrZDB2BURplsxEr6rYj/PbyYs5WoLs=; b=PRBi7L7OG+Zhgan6o4RQsIEdSx
	cJiVZvtqPHARv3E89OjUR0t6Pib0frJnMlUZPEd4tmEPN5onEg1lMjuoRKSfdoypunOKLiB/R1aIy
	Bmhgii0fhn4l8PSPW3D4fB/z7AkeTcXW9oKMwEpP9QK0WpCeX6AU2qK65lvMVhJw7QYU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDfk-0004z0-7e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDfk-0002Jk-66
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:33:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/vivier/tags/m68k-next-pull-request' into staging
Message-Id: <E1kYDfk-0002Jk-66@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:33:20 +0000

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

commit 48f22ad04ead83e61b4b35871ec6f6109779b791
Merge: 8796c64ecdfd34be394ea277aaaaa53df0c76996 d159dd058c7dc48a9291fde92eaae52a9f26a4d1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 8 21:38:47 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 8 21:38:47 2020 +0100

    Merge remote-tracking branch 'remotes/vivier/tags/m68k-next-pull-request' into staging
    
    m68k pull-request 20200706
    
    disable floatx80_invalid_encoding() for m68k
    fix m68k_cpu_get_phys_page_debug()
    
    # gpg: Signature made Mon 06 Jul 2020 21:05:33 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier/tags/m68k-next-pull-request:
      softfloat,m68k: disable floatx80_invalid_encoding() for m68k
      target/m68k: consolidate physical translation offset into get_physical_address()
      target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                                 |   23 +-
 accel/kvm/kvm-all.c                         |    4 +-
 balloon.c                                   |   17 -
 block.c                                     |   19 +-
 block/Makefile.objs                         |    2 +-
 block/amend.c                               |  113 +
 block/block-copy.c                          |    4 +-
 block/crypto.c                              |  207 +-
 block/crypto.h                              |   37 +
 block/file-posix.c                          |    3 -
 block/io.c                                  |    8 +-
 block/iscsi.c                               |    1 -
 block/qcow2.c                               |  350 +-
 block/qed.c                                 |   65 +-
 block/qed.h                                 |    1 -
 block/vdi.c                                 |    3 +-
 block/vhdx.c                                |    3 -
 block/vpc.c                                 |    3 +-
 block/vvfat.c                               |   67 +-
 bsd-user/main.c                             |    6 +-
 configure                                   |   40 +-
 crypto/block-luks.c                         |  416 ++-
 crypto/block.c                              |   29 +
 crypto/blockpriv.h                          |    8 +
 docs/interop/index.rst                      |    1 +
 docs/interop/vhost-user.rst                 |   24 +
 docs/interop/vhost-vdpa.rst                 |   17 +
 docs/system/deprecated.rst                  |   20 +
 docs/system/target-i386-desc.rst.inc        |   13 +-
 docs/tools/qemu-img.rst                     |    5 +-
 docs/tools/virtiofsd.rst                    |    5 +
 exec.c                                      |   52 +
 hw/arm/fsl-imx6ul.c                         |   10 +
 hw/arm/mcimx6ul-evk.c                       |    2 +
 hw/arm/pxa2xx_pic.c                         |    9 +-
 hw/arm/spitz.c                              |  505 +--
 hw/arm/virt-acpi-build.c                    |    5 +-
 hw/arm/virt.c                               |   35 +
 hw/arm/z2.c                                 |   11 +-
 hw/audio/ac97.c                             |    9 +-
 hw/audio/adlib.c                            |    8 +-
 hw/audio/cs4231a.c                          |    8 +-
 hw/audio/es1370.c                           |    9 +-
 hw/audio/gus.c                              |    8 +-
 hw/audio/intel-hda.c                        |    3 +
 hw/audio/pcspk.c                            |   26 +-
 hw/audio/sb16.c                             |    9 +-
 hw/audio/soundhw.c                          |   24 +-
 hw/core/numa.c                              |   17 +-
 hw/core/qdev-properties.c                   |   89 +
 hw/display/ads7846.c                        |    9 +-
 hw/display/bcm2835_fb.c                     |    4 +
 hw/display/ssd0323.c                        |   10 +-
 hw/gpio/zaurus.c                            |   12 +-
 hw/i386/Kconfig                             |    1 +
 hw/i386/microvm.c                           |    1 +
 hw/i386/pc.c                                |   80 +-
 hw/i386/pc_piix.c                           |    4 +-
 hw/i386/pc_q35.c                            |    4 +-
 hw/isa/i82378.c                             |    2 +-
 hw/m68k/mcf5206.c                           |   39 +-
 hw/mips/jazz.c                              |    2 +-
 hw/misc/max111x.c                           |   86 +-
 hw/net/imx_fec.c                            |   24 +-
 hw/net/trace-events                         |    4 +-
 hw/net/vhost_net-stub.c                     |   11 +
 hw/net/vhost_net.c                          |   44 +-
 hw/net/virtio-net.c                         |   19 +
 hw/riscv/sifive_clint.c                     |    2 +-
 hw/riscv/sifive_plic.c                      |   20 +-
 hw/s390x/s390-pci-bus.c                     |   16 +-
 hw/s390x/s390-virtio-ccw.c                  |   22 +-
 hw/s390x/virtio-ccw.c                       |   18 +-
 hw/sd/ssi-sd.c                              |    4 +-
 hw/ssi/ssi.c                                |    7 +-
 hw/vfio/ap.c                                |    8 +-
 hw/vfio/ccw.c                               |   11 +-
 hw/vfio/common.c                            |   53 +-
 hw/vfio/pci.c                               |    6 +-
 hw/virtio/Kconfig                           |   11 +
 hw/virtio/Makefile.objs                     |    3 +
 hw/virtio/trace-events                      |   11 +
 hw/virtio/vhost-backend.c                   |    6 +
 hw/virtio/vhost-vdpa.c                      |  475 +++
 hw/virtio/vhost.c                           |   52 +-
 hw/virtio/virtio-balloon.c                  |   36 +-
 hw/virtio/virtio-iommu-pci.c                |   11 +
 hw/virtio/virtio-iommu.c                    |  114 +-
 hw/virtio/virtio-mem-pci.c                  |  157 +
 hw/virtio/virtio-mem-pci.h                  |   34 +
 hw/virtio/virtio-mem.c                      |  873 +++++
 hw/virtio/virtio-pci.c                      |   13 +
 hw/virtio/virtio.c                          |    6 +
 include/block/block.h                       |    7 +-
 include/block/block_int.h                   |   36 +-
 include/crypto/block.h                      |   22 +
 include/exec/memory.h                       |   47 +
 include/exec/ram_addr.h                     |    5 +-
 include/exec/user/thunk.h                   |    1 +
 include/hw/arm/fsl-imx6ul.h                 |    2 +
 include/hw/arm/pxa.h                        |    1 -
 include/hw/arm/sharpsl.h                    |    3 -
 include/hw/arm/virt.h                       |    8 +
 include/hw/audio/pcspk.h                    |   12 +-
 include/hw/audio/soundhw.h                  |    2 +
 include/hw/boards.h                         |    1 +
 include/hw/i386/pc.h                        |    6 +-
 include/hw/misc/max111x.h                   |   56 +
 include/hw/net/imx_fec.h                    |    1 +
 include/hw/pci/pci.h                        |    1 +
 include/hw/qdev-properties.h                |    3 +
 include/hw/ssi/ssi.h                        |   31 +-
 include/hw/vfio/vfio-common.h               |    4 +-
 include/hw/virtio/vhost-backend.h           |   19 +-
 include/hw/virtio/vhost-vdpa.h              |   26 +
 include/hw/virtio/vhost.h                   |    7 +
 include/hw/virtio/virtio-bus.h              |    4 +
 include/hw/virtio/virtio-iommu.h            |    2 +
 include/hw/virtio/virtio-mem.h              |   86 +
 include/migration/colo.h                    |    2 +-
 include/migration/misc.h                    |    2 +
 include/net/net.h                           |    1 +
 include/net/vhost-vdpa.h                    |   22 +
 include/net/vhost_net.h                     |    5 +
 include/qemu/typedefs.h                     |    1 +
 include/sysemu/balloon.h                    |    2 -
 linux-user/ioctls.h                         |   17 +-
 linux-user/qemu.h                           |   40 +-
 linux-user/sparc/cpu_loop.c                 |    6 +-
 linux-user/strace.c                         |  435 ++-
 linux-user/strace.list                      |   40 +-
 linux-user/syscall.c                        |  136 +-
 linux-user/syscall_defs.h                   |   15 +
 linux-user/syscall_types.h                  |   33 +
 migration/migration.c                       |   15 +-
 migration/postcopy-ram.c                    |   25 +-
 migration/ram.c                             |    8 +-
 migration/rdma.c                            |   18 +-
 migration/savevm.c                          |   11 +-
 monitor/hmp-cmds.c                          |   16 +
 monitor/monitor.c                           |    1 +
 net/Makefile.objs                           |    2 +-
 net/clients.h                               |    2 +
 net/net.c                                   |   10 +
 net/vhost-vdpa.c                            |  228 ++
 pc-bios/bios-256k.bin                       |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                            |  Bin 131072 -> 131072 bytes
 pc-bios/s390-ccw.img                        |  Bin 42608 -> 42608 bytes
 pc-bios/s390-ccw/Makefile                   |    3 +
 pc-bios/s390-ccw/bootmap.c                  |    4 +-
 pc-bios/s390-ccw/cio.c                      |   40 +-
 pc-bios/s390-ccw/cio.h                      |   17 +-
 pc-bios/s390-ccw/helper.h                   |   19 +-
 pc-bios/s390-ccw/jump2ipl.c                 |   10 +-
 pc-bios/s390-ccw/main.c                     |   15 +-
 pc-bios/s390-ccw/menu.c                     |    1 +
 pc-bios/s390-ccw/netboot.mak                |   13 +-
 pc-bios/s390-ccw/netmain.c                  |   23 +-
 pc-bios/s390-ccw/s390-arch.h                |    4 +-
 pc-bios/s390-ccw/s390-ccw.h                 |   27 +-
 pc-bios/s390-ccw/s390-time.h                |   23 +
 pc-bios/s390-ccw/start.S                    |    5 +-
 pc-bios/s390-ccw/virtio-net.c               |    2 +
 pc-bios/s390-ccw/virtio-scsi.c              |    2 +
 pc-bios/s390-ccw/virtio.c                   |   18 +-
 pc-bios/s390-netboot.img                    |  Bin 67232 -> 67232 bytes
 pc-bios/vgabios-ati.bin                     |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin           |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin                  |  Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin                     |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin                   |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin                         |  Bin 38912 -> 38912 bytes
 qapi/block-core.json                        |   68 +
 qapi/crypto.json                            |   73 +-
 qapi/job.json                               |    4 +-
 qapi/misc.json                              |   64 +-
 qapi/net.json                               |   28 +-
 qdev-monitor.c                              |    2 +
 qemu-img-cmds.hx                            |    4 +-
 qemu-img.c                                  |   57 +-
 qemu-options.hx                             |   12 +
 qemu-storage-daemon.c                       |    5 +
 roms/config.seabios-128k                    |    3 +
 roms/seabios                                |    2 +-
 softmmu/vl.c                                |   24 +-
 stubs/Makefile.objs                         |    2 +
 stubs/isa-bus.c                             |    7 +
 stubs/pci-bus.c                             |    7 +
 target/arm/cpu.h                            |    2 +
 target/arm/kvm.c                            |   80 +
 target/arm/kvm32.c                          |   34 +
 target/arm/kvm64.c                          |   49 +
 target/arm/kvm_arm.h                        |   10 +
 target/arm/translate-a64.c                  |    6 +
 target/arm/translate-a64.h                  |    1 +
 target/arm/translate-sve.c                  |    8 +-
 target/i386/sev.c                           |    7 +
 target/riscv/Makefile.objs                  |    2 +-
 target/riscv/cpu.c                          |   50 +
 target/riscv/cpu.h                          |   82 +-
 target/riscv/cpu_bits.h                     |   15 +
 target/riscv/csr.c                          |   75 +-
 target/riscv/fpu_helper.c                   |   33 +-
 target/riscv/helper.h                       | 1069 ++++++
 target/riscv/insn32-64.decode               |   11 +
 target/riscv/insn32.decode                  |  372 ++
 target/riscv/insn_trans/trans_rvv.inc.c     | 2888 ++++++++++++++++
 target/riscv/internals.h                    |   41 +
 target/riscv/translate.c                    |   27 +-
 target/riscv/vector_helper.c                | 4899 +++++++++++++++++++++++++++
 target/s390x/insn-data.def                  |    2 +-
 target/sparc/translate.c                    |    2 +
 tcg/ppc/tcg-target.inc.c                    |   15 +-
 tcg/tcg-op.c                                |   10 +-
 tests/acceptance/machine_sparc64_sun4u.py   |   36 +
 tests/data/acpi/disassemle-aml.sh           |   52 +
 tests/data/acpi/rebuild-expected-aml.sh     |    1 +
 tests/data/acpi/virt/DSDT                   |  Bin 5307 -> 5205 bytes
 tests/data/acpi/virt/DSDT.memhp             |  Bin 6668 -> 6566 bytes
 tests/data/acpi/virt/DSDT.numamem           |  Bin 5307 -> 5205 bytes
 tests/qemu-iotests/049.out                  |  102 +-
 tests/qemu-iotests/051.pc.out               |    4 +-
 tests/qemu-iotests/061.out                  |   12 +-
 tests/qemu-iotests/082.out                  |  185 +-
 tests/qemu-iotests/085.out                  |   38 +-
 tests/qemu-iotests/087                      |    1 +
 tests/qemu-iotests/087.out                  |    6 +-
 tests/qemu-iotests/112.out                  |    2 +-
 tests/qemu-iotests/125                      |   24 +
 tests/qemu-iotests/125.out                  |    9 +
 tests/qemu-iotests/134.out                  |    2 +-
 tests/qemu-iotests/141                      |    2 +-
 tests/qemu-iotests/144.out                  |    4 +-
 tests/qemu-iotests/146                      |   60 +-
 tests/qemu-iotests/146.out                  |  405 ++-
 tests/qemu-iotests/153                      |    9 +-
 tests/qemu-iotests/158.out                  |    4 +-
 tests/qemu-iotests/178                      |    1 +
 tests/qemu-iotests/182.out                  |    2 +-
 tests/qemu-iotests/185.out                  |    8 +-
 tests/qemu-iotests/188                      |    1 +
 tests/qemu-iotests/188.out                  |    2 +-
 tests/qemu-iotests/189                      |    1 +
 tests/qemu-iotests/189.out                  |    4 +-
 tests/qemu-iotests/198                      |    1 +
 tests/qemu-iotests/198.out                  |    4 +-
 tests/qemu-iotests/206                      |    1 +
 tests/qemu-iotests/255.out                  |    8 +-
 tests/qemu-iotests/263                      |    1 +
 tests/qemu-iotests/263.out                  |    4 +-
 tests/qemu-iotests/274.out                  |   46 +-
 tests/qemu-iotests/280.out                  |    2 +-
 tests/qemu-iotests/284                      |    1 +
 tests/qemu-iotests/284.out                  |    6 +-
 tests/qemu-iotests/291                      |    4 -
 tests/qemu-iotests/291.out                  |   33 -
 tests/qemu-iotests/293                      |  208 ++
 tests/qemu-iotests/293.out                  |   99 +
 tests/qemu-iotests/294                      |   90 +
 tests/qemu-iotests/294.out                  |   30 +
 tests/qemu-iotests/295                      |  280 ++
 tests/qemu-iotests/295.out                  |   40 +
 tests/qemu-iotests/296                      |  234 ++
 tests/qemu-iotests/296.out                  |   33 +
 tests/qemu-iotests/common.filter            |  106 +-
 tests/qemu-iotests/common.rc                |   30 +
 tests/qemu-iotests/group                    |    4 +
 tests/qemu-iotests/iotests.py               |  108 +-
 tests/qtest/bios-tables-test-allowed-diff.h |   18 -
 tests/qtest/device-introspect-test.c        |    5 -
 tests/qtest/fuzz/fork_fuzz.c                |   40 +-
 tests/qtest/fuzz/fuzz.c                     |    3 +
 tests/qtest/libqtest.c                      |    4 +
 tests/qtest/migration-test.c                |    2 +-
 tests/qtest/qom-test.c                      |    5 -
 tests/qtest/test-hmp.c                      |    5 -
 thunk.c                                     |  154 +
 tools/virtiofsd/helper.c                    |    2 +
 tools/virtiofsd/passthrough_ll.c            |   71 +-
 util/qemu-openpty.c                         |    5 +-
 283 files changed, 17535 insertions(+), 1671 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index dec252f38b..42388f1de2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -787,6 +787,7 @@ F: hw/gpio/max7310.c
 F: hw/gpio/zaurus.c
 F: hw/misc/mst_fpga.c
 F: hw/misc/max111x.c
+F: include/hw/misc/max111x.h
 F: include/hw/arm/pxa.h
 F: include/hw/arm/sharpsl.h
 F: include/hw/display/tc6393xb.h
@@ -1318,6 +1319,7 @@ F: include/hw/pci-host/sabre.h
 F: hw/pci-bridge/simba.c
 F: include/hw/pci-bridge/simba.h
 F: pc-bios/openbios-sparc64
+F: tests/acceptance/machine_sparc64_sun4u.py
 
 Sun4v
 M: Artyom Tarasenko <atar4qemu@gmail.com>
@@ -1790,6 +1792,15 @@ F: hw/virtio/virtio-crypto.c
 F: hw/virtio/virtio-crypto-pci.c
 F: include/hw/virtio/virtio-crypto.h
 
+virtio-mem
+M: David Hildenbrand <david@redhat.com>
+S: Supported
+W: https://virtio-mem.gitlab.io/
+F: hw/virtio/virtio-mem.c
+F: hw/virtio/virtio-mem-pci.h
+F: hw/virtio/virtio-mem-pci.c
+F: include/hw/virtio/virtio-mem.h
+
 nvme
 M: Keith Busch <kbusch@kernel.org>
 L: qemu-block@nongnu.org
@@ -2615,6 +2626,15 @@ F: tests/uefi-test-tools/
 F: .gitlab-ci.d/edk2.yml
 F: .gitlab-ci.d/edk2/
 
+VT-d Emulation
+M: Michael S. Tsirkin <mst@redhat.com>
+M: Peter Xu <peterx@redhat.com>
+R: Jason Wang <jasowang@redhat.com>
+S: Supported
+F: hw/i386/intel_iommu.c
+F: hw/i386/intel_iommu_internal.h
+F: include/hw/i386/intel_iommu.h
+
 Usermode Emulation
 ------------------
 Overall usermode emulation
@@ -2629,8 +2649,7 @@ F: bsd-user/
 F: default-configs/*-bsd-user.mak
 
 Linux user
-M: Riku Voipio <riku.voipio@iki.fi>
-R: Laurent Vivier <laurent@vivier.eu>
+M: Laurent Vivier <laurent@vivier.eu>
 S: Maintained
 F: linux-user/
 F: default-configs/*-linux-user.mak
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index d54a8701d8..ab36fbfa0c 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -40,7 +40,6 @@
 #include "trace.h"
 #include "hw/irq.h"
 #include "sysemu/sev.h"
-#include "sysemu/balloon.h"
 #include "qapi/visitor.h"
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-visit-common.h"
@@ -2229,7 +2228,8 @@ static int kvm_init(MachineState *ms)
 
     s->sync_mmu = !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);
     if (!s->sync_mmu) {
-        qemu_balloon_inhibit(true);
+        ret = ram_block_discard_disable(true);
+        assert(!ret);
     }
 
     return 0;
diff --git a/balloon.c b/balloon.c
index f104b42961..354408c6ea 100644
--- a/balloon.c
+++ b/balloon.c
@@ -36,23 +36,6 @@
 static QEMUBalloonEvent *balloon_event_fn;
 static QEMUBalloonStatus *balloon_stat_fn;
 static void *balloon_opaque;
-static int balloon_inhibit_count;
-
-bool qemu_balloon_is_inhibited(void)
-{
-    return atomic_read(&balloon_inhibit_count) > 0;
-}
-
-void qemu_balloon_inhibit(bool state)
-{
-    if (state) {
-        atomic_inc(&balloon_inhibit_count);
-    } else {
-        atomic_dec(&balloon_inhibit_count);
-    }
-
-    assert(atomic_read(&balloon_inhibit_count) >= 0);
-}
 
 static bool have_balloon(Error **errp)
 {
diff --git a/block.c b/block.c
index 6dbcb7e083..62e40db2f1 100644
--- a/block.c
+++ b/block.c
@@ -5408,21 +5408,6 @@ int bdrv_has_zero_init(BlockDriverState *bs)
     return 0;
 }
 
-bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs)
-{
-    BlockDriverInfo bdi;
-
-    if (bs->backing) {
-        return false;
-    }
-
-    if (bdrv_get_info(bs, &bdi) == 0) {
-        return bdi.unallocated_blocks_are_zero;
-    }
-
-    return false;
-}
-
 bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs)
 {
     if (!(bs->open_flags & BDRV_O_UNMAP)) {
@@ -6482,6 +6467,7 @@ void bdrv_remove_aio_context_notifier(BlockDriverState *bs,
 
 int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts,
                        BlockDriverAmendStatusCB *status_cb, void *cb_opaque,
+                       bool force,
                        Error **errp)
 {
     if (!bs->drv) {
@@ -6493,7 +6479,8 @@ int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts,
                    bs->drv->format_name);
         return -ENOTSUP;
     }
-    return bs->drv->bdrv_amend_options(bs, opts, status_cb, cb_opaque, errp);
+    return bs->drv->bdrv_amend_options(bs, opts, status_cb,
+                                       cb_opaque, force, errp);
 }
 
 /*
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 96028eedce..577e578bc2 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -19,7 +19,7 @@ block-obj-$(CONFIG_WIN32) += file-win32.o win32-aio.o
 block-obj-$(CONFIG_POSIX) += file-posix.o
 block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 block-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
-block-obj-y += null.o mirror.o commit.o io.o create.o
+block-obj-y += null.o mirror.o commit.o io.o create.o amend.o
 block-obj-y += throttle-groups.o
 block-obj-$(CONFIG_LINUX) += nvme.o
 
diff --git a/block/amend.c b/block/amend.c
new file mode 100644
index 0000000000..f4612dcf08
--- /dev/null
+++ b/block/amend.c
@@ -0,0 +1,113 @@
+/*
+ * Block layer code related to image options amend
+ *
+ * Copyright (c) 2018 Kevin Wolf <kwolf@redhat.com>
+ * Copyright (c) 2020 Red Hat. Inc
+ *
+ * Heavily based on create.c
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "block/block_int.h"
+#include "qemu/job.h"
+#include "qemu/main-loop.h"
+#include "qapi/qapi-commands-block-core.h"
+#include "qapi/qapi-visit-block-core.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/error.h"
+
+typedef struct BlockdevAmendJob {
+    Job common;
+    BlockdevAmendOptions *opts;
+    BlockDriverState *bs;
+    bool force;
+} BlockdevAmendJob;
+
+static int coroutine_fn blockdev_amend_run(Job *job, Error **errp)
+{
+    BlockdevAmendJob *s = container_of(job, BlockdevAmendJob, common);
+    int ret;
+
+    job_progress_set_remaining(&s->common, 1);
+    ret = s->bs->drv->bdrv_co_amend(s->bs, s->opts, s->force, errp);
+    job_progress_update(&s->common, 1);
+    qapi_free_BlockdevAmendOptions(s->opts);
+    return ret;
+}
+
+static const JobDriver blockdev_amend_job_driver = {
+    .instance_size = sizeof(BlockdevAmendJob),
+    .job_type      = JOB_TYPE_AMEND,
+    .run           = blockdev_amend_run,
+};
+
+void qmp_x_blockdev_amend(const char *job_id,
+                          const char *node_name,
+                          BlockdevAmendOptions *options,
+                          bool has_force,
+                          bool force,
+                          Error **errp)
+{
+    BlockdevAmendJob *s;
+    const char *fmt = BlockdevDriver_str(options->driver);
+    BlockDriver *drv = bdrv_find_format(fmt);
+    BlockDriverState *bs = bdrv_find_node(node_name);
+
+
+    if (!drv) {
+        error_setg(errp, "Block driver '%s' not found or not supported", fmt);
+        return;
+    }
+
+    /*
+     * If the driver is in the schema, we know that it exists. But it may not
+     * be whitelisted.
+     */
+    if (bdrv_uses_whitelist() && !bdrv_is_whitelisted(drv, false)) {
+        error_setg(errp, "Driver is not whitelisted");
+        return;
+    }
+
+    if (bs->drv != drv) {
+        error_setg(errp,
+                   "x-blockdev-amend doesn't support changing the block driver");
+        return;
+    }
+
+    /* Error out if the driver doesn't support .bdrv_co_amend */
+    if (!drv->bdrv_co_amend) {
+        error_setg(errp, "Driver does not support x-blockdev-amend");
+        return;
+    }
+
+    /* Create the block job */
+    s = job_create(job_id, &blockdev_amend_job_driver, NULL,
+                   bdrv_get_aio_context(bs), JOB_DEFAULT | JOB_MANUAL_DISMISS,
+                   NULL, NULL, errp);
+    if (!s) {
+        return;
+    }
+
+    s->bs = bs,
+    s->opts = QAPI_CLONE(BlockdevAmendOptions, options),
+    s->force = has_force ? force : false;
+    job_start(&s->common);
+}
diff --git a/block/block-copy.c b/block/block-copy.c
index bb8d0569f2..f7428a7c08 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -622,8 +622,10 @@ out:
          * block_copy_task_run. If it fails, it means some task already failed
          * for real reason, let's return first failure.
          * Still, assert that we don't rewrite failure by success.
+         *
+         * Note: ret may be positive here because of block-status result.
          */
-        assert(ret == 0 || aio_task_pool_status(aio) < 0);
+        assert(ret >= 0 || aio_task_pool_status(aio) < 0);
         ret = aio_task_pool_status(aio);
 
         aio_task_pool_free(aio);
diff --git a/block/crypto.c b/block/crypto.c
index 973b57b3eb..2636e959ae 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -37,6 +37,7 @@ typedef struct BlockCrypto BlockCrypto;
 
 struct BlockCrypto {
     QCryptoBlock *block;
+    bool updating_keys;
 };
 
 
@@ -71,6 +72,24 @@ static ssize_t block_crypto_read_func(QCryptoBlock *block,
     return ret;
 }
 
+static ssize_t block_crypto_write_func(QCryptoBlock *block,
+                                       size_t offset,
+                                       const uint8_t *buf,
+                                       size_t buflen,
+                                       void *opaque,
+                                       Error **errp)
+{
+    BlockDriverState *bs = opaque;
+    ssize_t ret;
+
+    ret = bdrv_pwrite(bs->file, offset, buf, buflen);
+    if (ret < 0) {
+        error_setg_errno(errp, -ret, "Could not write encryption header");
+        return ret;
+    }
+    return ret;
+}
+
 
 struct BlockCryptoCreateData {
     BlockBackend *blk;
@@ -79,12 +98,12 @@ struct BlockCryptoCreateData {
 };
 
 
-static ssize_t block_crypto_write_func(QCryptoBlock *block,
-                                       size_t offset,
-                                       const uint8_t *buf,
-                                       size_t buflen,
-                                       void *opaque,
-                                       Error **errp)
+static ssize_t block_crypto_create_write_func(QCryptoBlock *block,
+                                              size_t offset,
+                                              const uint8_t *buf,
+                                              size_t buflen,
+                                              void *opaque,
+                                              Error **errp)
 {
     struct BlockCryptoCreateData *data = opaque;
     ssize_t ret;
@@ -97,11 +116,10 @@ static ssize_t block_crypto_write_func(QCryptoBlock *block,
     return ret;
 }
 
-
-static ssize_t block_crypto_init_func(QCryptoBlock *block,
-                                      size_t headerlen,
-                                      void *opaque,
-                                      Error **errp)
+static ssize_t block_crypto_create_init_func(QCryptoBlock *block,
+                                             size_t headerlen,
+                                             void *opaque,
+                                             Error **errp)
 {
     struct BlockCryptoCreateData *data = opaque;
     Error *local_error = NULL;
@@ -167,6 +185,19 @@ static QemuOptsList block_crypto_create_opts_luks = {
 };
 
 
+static QemuOptsList block_crypto_amend_opts_luks = {
+    .name = "crypto",
+    .head = QTAILQ_HEAD_INITIALIZER(block_crypto_create_opts_luks.head),
+    .desc = {
+        BLOCK_CRYPTO_OPT_DEF_LUKS_STATE(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME(""),
+        { /* end of list */ }
+    },
+};
+
 QCryptoBlockOpenOptions *
 block_crypto_open_opts_init(QDict *opts, Error **errp)
 {
@@ -202,6 +233,23 @@ block_crypto_create_opts_init(QDict *opts, Error **errp)
     return ret;
 }
 
+QCryptoBlockAmendOptions *
+block_crypto_amend_opts_init(QDict *opts, Error **errp)
+{
+    Visitor *v;
+    QCryptoBlockAmendOptions *ret;
+
+    v = qobject_input_visitor_new_flat_confused(opts, errp);
+    if (!v) {
+        return NULL;
+    }
+
+    visit_type_QCryptoBlockAmendOptions(v, NULL, &ret, errp);
+
+    visit_free(v);
+    return ret;
+}
+
 
 static int block_crypto_open_generic(QCryptoBlockFormat format,
                                      QemuOptsList *opts_spec,
@@ -296,8 +344,8 @@ static int block_crypto_co_create_generic(BlockDriverState *bs,
     };
 
     crypto = qcrypto_block_create(opts, NULL,
-                                  block_crypto_init_func,
-                                  block_crypto_write_func,
+                                  block_crypto_create_init_func,
+                                  block_crypto_create_write_func,
                                   &data,
                                   errp);
 
@@ -710,7 +758,6 @@ static int block_crypto_get_info_luks(BlockDriverState *bs,
         return ret;
     }
 
-    bdi->unallocated_blocks_are_zero = false;
     bdi->cluster_size = subbdi.cluster_size;
 
     return 0;
@@ -742,6 +789,131 @@ block_crypto_get_specific_info_luks(BlockDriverState *bs, Error **errp)
     return spec_info;
 }
 
+static int
+block_crypto_amend_options_generic_luks(BlockDriverState *bs,
+                                        QCryptoBlockAmendOptions *amend_options,
+                                        bool force,
+                                        Error **errp)
+{
+    BlockCrypto *crypto = bs->opaque;
+    int ret;
+
+    assert(crypto);
+    assert(crypto->block);
+
+    /* apply for exclusive read/write permissions to the underlying file*/
+    crypto->updating_keys = true;
+    ret = bdrv_child_refresh_perms(bs, bs->file, errp);
+    if (ret) {
+        goto cleanup;
+    }
+
+    ret = qcrypto_block_amend_options(crypto->block,
+                                      block_crypto_read_func,
+                                      block_crypto_write_func,
+                                      bs,
+                                      amend_options,
+                                      force,
+                                      errp);
+cleanup:
+    /* release exclusive read/write permissions to the underlying file*/
+    crypto->updating_keys = false;
+    bdrv_child_refresh_perms(bs, bs->file, errp);
+    return ret;
+}
+
+static int
+block_crypto_amend_options_luks(BlockDriverState *bs,
+                                QemuOpts *opts,
+                                BlockDriverAmendStatusCB *status_cb,
+                                void *cb_opaque,
+                                bool force,
+                                Error **errp)
+{
+    BlockCrypto *crypto = bs->opaque;
+    QDict *cryptoopts = NULL;
+    QCryptoBlockAmendOptions *amend_options = NULL;
+    int ret = -EINVAL;
+
+    assert(crypto);
+    assert(crypto->block);
+
+    cryptoopts = qemu_opts_to_qdict(opts, NULL);
+    qdict_put_str(cryptoopts, "format", "luks");
+    amend_options = block_crypto_amend_opts_init(cryptoopts, errp);
+    qobject_unref(cryptoopts);
+    if (!amend_options) {
+        goto cleanup;
+    }
+    ret = block_crypto_amend_options_generic_luks(bs, amend_options,
+                                                  force, errp);
+cleanup:
+    qapi_free_QCryptoBlockAmendOptions(amend_options);
+    return ret;
+}
+
+static int
+coroutine_fn block_crypto_co_amend_luks(BlockDriverState *bs,
+                                        BlockdevAmendOptions *opts,
+                                        bool force,
+                                        Error **errp)
+{
+    QCryptoBlockAmendOptions amend_opts;
+
+    amend_opts = (QCryptoBlockAmendOptions) {
+        .format = Q_CRYPTO_BLOCK_FORMAT_LUKS,
+        .u.luks = *qapi_BlockdevAmendOptionsLUKS_base(&opts->u.luks),
+    };
+    return block_crypto_amend_options_generic_luks(bs, &amend_opts,
+                                                   force, errp);
+}
+
+static void
+block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c,
+                         const BdrvChildRole role,
+                         BlockReopenQueue *reopen_queue,
+                         uint64_t perm, uint64_t shared,
+                         uint64_t *nperm, uint64_t *nshared)
+{
+
+    BlockCrypto *crypto = bs->opaque;
+
+    bdrv_default_perms(bs, c, role, reopen_queue, perm, shared, nperm, nshared);
+
+    /*
+     * For backward compatibility, manually share the write
+     * and resize permission
+     */
+    *nshared |= (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    /*
+     * Since we are not fully a format driver, don't always request
+     * the read/resize permission but only when explicitly
+     * requested
+     */
+    *nperm &= ~(BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    *nperm |= perm & (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+
+    /*
+     * This driver doesn't modify LUKS metadata except
+     * when updating the encryption slots.
+     * Thus unlike a proper format driver we don't ask for
+     * shared write/read permission. However we need it
+     * when we are updating the keys, to ensure that only we
+     * have access to the device.
+     *
+     * Encryption update will set the crypto->updating_keys
+     * during that period and refresh permissions
+     *
+     */
+    if (crypto->updating_keys) {
+        /* need exclusive write access for header update */
+        *nperm |= BLK_PERM_WRITE;
+        /* unshare read and write permission */
+        *nshared &= ~(BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE);
+    }
+}
+
+
 static const char *const block_crypto_strong_runtime_opts[] = {
     BLOCK_CRYPTO_OPT_LUKS_KEY_SECRET,
 
@@ -754,13 +926,12 @@ static BlockDriver bdrv_crypto_luks = {
     .bdrv_probe         = block_crypto_probe_luks,
     .bdrv_open          = block_crypto_open_luks,
     .bdrv_close         = block_crypto_close,
-    /* This driver doesn't modify LUKS metadata except when creating image.
-     * Allow share-rw=on as a special case. */
-    .bdrv_child_perm    = bdrv_default_perms,
+    .bdrv_child_perm    = block_crypto_child_perms,
     .bdrv_co_create     = block_crypto_co_create_luks,
     .bdrv_co_create_opts = block_crypto_co_create_opts_luks,
     .bdrv_co_truncate   = block_crypto_co_truncate,
     .create_opts        = &block_crypto_create_opts_luks,
+    .amend_opts         = &block_crypto_amend_opts_luks,
 
     .bdrv_reopen_prepare = block_crypto_reopen_prepare,
     .bdrv_refresh_limits = block_crypto_refresh_limits,
@@ -770,6 +941,8 @@ static BlockDriver bdrv_crypto_luks = {
     .bdrv_measure       = block_crypto_measure,
     .bdrv_get_info      = block_crypto_get_info_luks,
     .bdrv_get_specific_info = block_crypto_get_specific_info_luks,
+    .bdrv_amend_options = block_crypto_amend_options_luks,
+    .bdrv_co_amend      = block_crypto_co_amend_luks,
 
     .is_format          = true,
 
diff --git a/block/crypto.h b/block/crypto.h
index b935695e79..c72c3dec61 100644
--- a/block/crypto.h
+++ b/block/crypto.h
@@ -41,6 +41,11 @@
 #define BLOCK_CRYPTO_OPT_LUKS_IVGEN_HASH_ALG "ivgen-hash-alg"
 #define BLOCK_CRYPTO_OPT_LUKS_HASH_ALG "hash-alg"
 #define BLOCK_CRYPTO_OPT_LUKS_ITER_TIME "iter-time"
+#define BLOCK_CRYPTO_OPT_LUKS_KEYSLOT "keyslot"
+#define BLOCK_CRYPTO_OPT_LUKS_STATE "state"
+#define BLOCK_CRYPTO_OPT_LUKS_OLD_SECRET "old-secret"
+#define BLOCK_CRYPTO_OPT_LUKS_NEW_SECRET "new-secret"
+
 
 #define BLOCK_CRYPTO_OPT_DEF_LUKS_KEY_SECRET(prefix)                    \
     BLOCK_CRYPTO_OPT_DEF_KEY_SECRET(prefix,                             \
@@ -88,9 +93,41 @@
         .help = "Time to spend in PBKDF in milliseconds",     \
     }
 
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_STATE(prefix)                           \
+    {                                                                     \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_STATE,                       \
+        .type = QEMU_OPT_STRING,                                          \
+        .help = "Select new state of affected keyslots (active/inactive)",\
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT(prefix)              \
+    {                                                          \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_KEYSLOT,          \
+        .type = QEMU_OPT_NUMBER,                               \
+        .help = "Select a single keyslot to modify explicitly",\
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET(prefix)            \
+    {                                                           \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_OLD_SECRET,        \
+        .type = QEMU_OPT_STRING,                                \
+        .help = "Select all keyslots that match this password", \
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET(prefix)            \
+    {                                                           \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_NEW_SECRET,        \
+        .type = QEMU_OPT_STRING,                                \
+        .help = "New secret to set in the matching keyslots. "  \
+                "Empty string to erase",                        \
+    }
+
 QCryptoBlockCreateOptions *
 block_crypto_create_opts_init(QDict *opts, Error **errp);
 
+QCryptoBlockAmendOptions *
+block_crypto_amend_opts_init(QDict *opts, Error **errp);
+
 QCryptoBlockOpenOptions *
 block_crypto_open_opts_init(QDict *opts, Error **errp);
 
diff --git a/block/file-posix.c b/block/file-posix.c
index 3ab8f5a0fa..d86ea57769 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2878,9 +2878,6 @@ static int coroutine_fn raw_co_pwrite_zeroes(
 
 static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
-    BDRVRawState *s = bs->opaque;
-
-    bdi->unallocated_blocks_are_zero = s->discard_zeroes;
     return 0;
 }
 
diff --git a/block/io.c b/block/io.c
index df8f2a98d4..b6564e34c5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2406,16 +2406,16 @@ static int coroutine_fn bdrv_co_block_status(BlockDriverState *bs,
 
     if (ret & (BDRV_BLOCK_DATA | BDRV_BLOCK_ZERO)) {
         ret |= BDRV_BLOCK_ALLOCATED;
-    } else if (want_zero) {
-        if (bdrv_unallocated_blocks_are_zero(bs)) {
-            ret |= BDRV_BLOCK_ZERO;
-        } else if (bs->backing) {
+    } else if (want_zero && bs->drv->supports_backing) {
+        if (bs->backing) {
             BlockDriverState *bs2 = bs->backing->bs;
             int64_t size2 = bdrv_getlength(bs2);
 
             if (size2 >= 0 && offset >= size2) {
                 ret |= BDRV_BLOCK_ZERO;
             }
+        } else {
+            ret |= BDRV_BLOCK_ZERO;
         }
     }
 
diff --git a/block/iscsi.c b/block/iscsi.c
index a8b76979d8..767e3e75fd 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2163,7 +2163,6 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
 static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
     IscsiLun *iscsilun = bs->opaque;
-    bdi->unallocated_blocks_are_zero = iscsilun->lbprz;
     bdi->cluster_size = iscsilun->cluster_size;
     return 0;
 }
diff --git a/block/qcow2.c b/block/qcow2.c
index 0cd2e6757e..38198b4e75 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -176,6 +176,19 @@ static ssize_t qcow2_crypto_hdr_write_func(QCryptoBlock *block, size_t offset,
     return ret;
 }
 
+static QDict*
+qcow2_extract_crypto_opts(QemuOpts *opts, const char *fmt, Error **errp)
+{
+    QDict *cryptoopts_qdict;
+    QDict *opts_qdict;
+
+    /* Extract "encrypt." options into a qdict */
+    opts_qdict = qemu_opts_to_qdict(opts, NULL);
+    qdict_extract_subqdict(opts_qdict, &cryptoopts_qdict, "encrypt.");
+    qobject_unref(opts_qdict);
+    qdict_put_str(cryptoopts_qdict, "format", fmt);
+    return cryptoopts_qdict;
+}
 
 /*
  * read qcow2 extension and fill bs
@@ -3042,17 +3055,6 @@ static int qcow2_change_backing_file(BlockDriverState *bs,
     return qcow2_update_header(bs);
 }
 
-static int qcow2_crypt_method_from_format(const char *encryptfmt)
-{
-    if (g_str_equal(encryptfmt, "luks")) {
-        return QCOW_CRYPT_LUKS;
-    } else if (g_str_equal(encryptfmt, "aes")) {
-        return QCOW_CRYPT_AES;
-    } else {
-        return -EINVAL;
-    }
-}
-
 static int qcow2_set_up_encryption(BlockDriverState *bs,
                                    QCryptoBlockCreateOptions *cryptoopts,
                                    Error **errp)
@@ -4239,8 +4241,8 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
             old_file_size = ROUND_UP(old_file_size, s->cluster_size);
         }
 
-        nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,
-                                            s->cluster_size);
+        nb_new_data_clusters = (ROUND_UP(offset, s->cluster_size) -
+            start_of_cluster(s, old_length)) >> s->cluster_bits;
 
         /* This is an overestimation; we will not actually allocate space for
          * these in the file but just make sure the new refcount structures are
@@ -4317,10 +4319,21 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
             int64_t nb_clusters = MIN(
                 nb_new_data_clusters,
                 s->l2_slice_size - offset_to_l2_slice_index(s, guest_offset));
-            QCowL2Meta allocation = {
+            unsigned cow_start_length = offset_into_cluster(s, guest_offset);
+            QCowL2Meta allocation;
+            guest_offset = start_of_cluster(s, guest_offset);
+            allocation = (QCowL2Meta) {
                 .offset       = guest_offset,
                 .alloc_offset = host_offset,
                 .nb_clusters  = nb_clusters,
+                .cow_start    = {
+                    .offset       = 0,
+                    .nb_bytes     = cow_start_length,
+                },
+                .cow_end      = {
+                    .offset       = nb_clusters << s->cluster_bits,
+                    .nb_bytes     = 0,
+                },
             };
             qemu_co_queue_init(&allocation.dependent_requests);
 
@@ -4860,16 +4873,9 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
 
     if (has_luks) {
         g_autoptr(QCryptoBlockCreateOptions) create_opts = NULL;
-        QDict *opts_qdict;
-        QDict *cryptoopts;
+        QDict *cryptoopts = qcow2_extract_crypto_opts(opts, "luks", errp);
         size_t headerlen;
 
-        opts_qdict = qemu_opts_to_qdict(opts, NULL);
-        qdict_extract_subqdict(opts_qdict, &cryptoopts, "encrypt.");
-        qobject_unref(opts_qdict);
-
-        qdict_put_str(cryptoopts, "format", "luks");
-
         create_opts = block_crypto_create_opts_init(cryptoopts, errp);
         qobject_unref(cryptoopts);
         if (!create_opts) {
@@ -4981,7 +4987,6 @@ err:
 static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
     BDRVQcow2State *s = bs->opaque;
-    bdi->unallocated_blocks_are_zero = true;
     bdi->cluster_size = s->cluster_size;
     bdi->vm_state_offset = qcow2_vm_state_offset(s);
     return 0;
@@ -5273,6 +5278,7 @@ typedef enum Qcow2AmendOperation {
     QCOW2_NO_OPERATION = 0,
 
     QCOW2_UPGRADING,
+    QCOW2_UPDATING_ENCRYPTION,
     QCOW2_CHANGING_REFCOUNT_ORDER,
     QCOW2_DOWNGRADING,
 } Qcow2AmendOperation;
@@ -5340,6 +5346,7 @@ static void qcow2_amend_helper_cb(BlockDriverState *bs,
 static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                                BlockDriverAmendStatusCB *status_cb,
                                void *cb_opaque,
+                               bool force,
                                Error **errp)
 {
     BDRVQcow2State *s = bs->opaque;
@@ -5349,13 +5356,11 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     bool lazy_refcounts = s->use_lazy_refcounts;
     bool data_file_raw = data_file_is_raw(bs);
     const char *compat = NULL;
-    uint64_t cluster_size = s->cluster_size;
-    bool encrypt;
-    int encformat;
     int refcount_bits = s->refcount_bits;
     int ret;
     QemuOptDesc *desc = opts->list->desc;
     Qcow2AmendHelperCBInfo helper_cb_info;
+    bool encryption_update = false;
 
     while (desc && desc->name) {
         if (!qemu_opt_find(opts, desc->name)) {
@@ -5376,44 +5381,24 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                 error_setg(errp, "Unknown compatibility level %s", compat);
                 return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_PREALLOC)) {
-            error_setg(errp, "Cannot change preallocation mode");
-            return -ENOTSUP;
         } else if (!strcmp(desc->name, BLOCK_OPT_SIZE)) {
             new_size = qemu_opt_get_size(opts, BLOCK_OPT_SIZE, 0);
         } else if (!strcmp(desc->name, BLOCK_OPT_BACKING_FILE)) {
             backing_file = qemu_opt_get(opts, BLOCK_OPT_BACKING_FILE);
         } else if (!strcmp(desc->name, BLOCK_OPT_BACKING_FMT)) {
             backing_format = qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT);
-        } else if (!strcmp(desc->name, BLOCK_OPT_ENCRYPT)) {
-            encrypt = qemu_opt_get_bool(opts, BLOCK_OPT_ENCRYPT,
-                                        !!s->crypto);
-
-            if (encrypt != !!s->crypto) {
+        } else if (g_str_has_prefix(desc->name, "encrypt.")) {
+            if (!s->crypto) {
                 error_setg(errp,
-                           "Changing the encryption flag is not supported");
-                return -ENOTSUP;
+                           "Can't amend encryption options - encryption not present");
+                return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_ENCRYPT_FORMAT)) {
-            encformat = qcow2_crypt_method_from_format(
-                qemu_opt_get(opts, BLOCK_OPT_ENCRYPT_FORMAT));
-
-            if (encformat != s->crypt_method_header) {
+            if (s->crypt_method_header != QCOW_CRYPT_LUKS) {
                 error_setg(errp,
-                           "Changing the encryption format is not supported");
-                return -ENOTSUP;
-            }
-        } else if (g_str_has_prefix(desc->name, "encrypt.")) {
-            error_setg(errp,
-                       "Changing the encryption parameters is not supported");
-            return -ENOTSUP;
-        } else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
-            cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
-                                             cluster_size);
-            if (cluster_size != s->cluster_size) {
-                error_setg(errp, "Changing the cluster size is not supported");
+                           "Only LUKS encryption options can be amended");
                 return -ENOTSUP;
             }
+            encryption_update = true;
         } else if (!strcmp(desc->name, BLOCK_OPT_LAZY_REFCOUNTS)) {
             lazy_refcounts = qemu_opt_get_bool(opts, BLOCK_OPT_LAZY_REFCOUNTS,
                                                lazy_refcounts);
@@ -5443,22 +5428,6 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                                  "images");
                 return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_COMPRESSION_TYPE)) {
-            const char *ct_name =
-                qemu_opt_get(opts, BLOCK_OPT_COMPRESSION_TYPE);
-            int compression_type =
-                qapi_enum_parse(&Qcow2CompressionType_lookup, ct_name, -1,
-                                NULL);
-            if (compression_type == -1) {
-                error_setg(errp, "Unknown compression type: %s", ct_name);
-                return -ENOTSUP;
-            }
-
-            if (compression_type != s->compression_type) {
-                error_setg(errp, "Changing the compression type "
-                                 "is not supported");
-                return -ENOTSUP;
-            }
         } else {
             /* if this point is reached, this probably means a new option was
              * added without having it covered here */
@@ -5472,7 +5441,8 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
         .original_status_cb = status_cb,
         .original_cb_opaque = cb_opaque,
         .total_operations = (new_version != old_version)
-                          + (s->refcount_bits != refcount_bits)
+                          + (s->refcount_bits != refcount_bits) +
+                            (encryption_update == true)
     };
 
     /* Upgrade first (some features may require compat=1.1) */
@@ -5485,6 +5455,33 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
         }
     }
 
+    if (encryption_update) {
+        QDict *amend_opts_dict;
+        QCryptoBlockAmendOptions *amend_opts;
+
+        helper_cb_info.current_operation = QCOW2_UPDATING_ENCRYPTION;
+        amend_opts_dict = qcow2_extract_crypto_opts(opts, "luks", errp);
+        if (!amend_opts_dict) {
+            return -EINVAL;
+        }
+        amend_opts = block_crypto_amend_opts_init(amend_opts_dict, errp);
+        qobject_unref(amend_opts_dict);
+        if (!amend_opts) {
+            return -EINVAL;
+        }
+        ret = qcrypto_block_amend_options(s->crypto,
+                                          qcow2_crypto_hdr_read_func,
+                                          qcow2_crypto_hdr_write_func,
+                                          bs,
+                                          amend_opts,
+                                          force,
+                                          errp);
+        qapi_free_QCryptoBlockAmendOptions(amend_opts);
+        if (ret < 0) {
+            return ret;
+        }
+    }
+
     if (s->refcount_bits != refcount_bits) {
         int refcount_order = ctz32(refcount_bits);
 
@@ -5598,6 +5595,44 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     return 0;
 }
 
+static int coroutine_fn qcow2_co_amend(BlockDriverState *bs,
+                                       BlockdevAmendOptions *opts,
+                                       bool force,
+                                       Error **errp)
+{
+    BlockdevAmendOptionsQcow2 *qopts = &opts->u.qcow2;
+    BDRVQcow2State *s = bs->opaque;
+    int ret = 0;
+
+    if (qopts->has_encrypt) {
+        if (!s->crypto) {
+            error_setg(errp, "image is not encrypted, can't amend");
+            return -EOPNOTSUPP;
+        }
+
+        if (qopts->encrypt->format != Q_CRYPTO_BLOCK_FORMAT_LUKS) {
+            error_setg(errp,
+                       "Amend can't be used to change the qcow2 encryption format");
+            return -EOPNOTSUPP;
+        }
+
+        if (s->crypt_method_header != QCOW_CRYPT_LUKS) {
+            error_setg(errp,
+                       "Only LUKS encryption options can be amended for qcow2 with blockdev-amend");
+            return -EOPNOTSUPP;
+        }
+
+        ret = qcrypto_block_amend_options(s->crypto,
+                                          qcow2_crypto_hdr_read_func,
+                                          qcow2_crypto_hdr_write_func,
+                                          bs,
+                                          qopts->encrypt,
+                                          force,
+                                          errp);
+    }
+    return ret;
+}
+
 /*
  * If offset or size are negative, respectively, they will not be included in
  * the BLOCK_IMAGE_CORRUPTED event emitted.
@@ -5648,89 +5683,108 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,
     s->signaled_corruption = true;
 }
 
+#define QCOW_COMMON_OPTIONS                                         \
+    {                                                               \
+        .name = BLOCK_OPT_SIZE,                                     \
+        .type = QEMU_OPT_SIZE,                                      \
+        .help = "Virtual disk size"                                 \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_COMPAT_LEVEL,                             \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "Compatibility level (v2 [0.10] or v3 [1.1])"       \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_BACKING_FILE,                             \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "File name of a base image"                         \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_BACKING_FMT,                              \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "Image format of the base image"                    \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_DATA_FILE,                                \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "File name of an external data file"                \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_DATA_FILE_RAW,                            \
+        .type = QEMU_OPT_BOOL,                                      \
+        .help = "The external data file must stay valid "           \
+                "as a raw image"                                    \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_LAZY_REFCOUNTS,                           \
+        .type = QEMU_OPT_BOOL,                                      \
+        .help = "Postpone refcount updates",                        \
+        .def_value_str = "off"                                      \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_REFCOUNT_BITS,                            \
+        .type = QEMU_OPT_NUMBER,                                    \
+        .help = "Width of a reference count entry in bits",         \
+        .def_value_str = "16"                                       \
+    }
+
 static QemuOptsList qcow2_create_opts = {
     .name = "qcow2-create-opts",
     .head = QTAILQ_HEAD_INITIALIZER(qcow2_create_opts.head),
     .desc = {
-        {
-            .name = BLOCK_OPT_SIZE,
-            .type = QEMU_OPT_SIZE,
-            .help = "Virtual disk size"
-        },
-        {
-            .name = BLOCK_OPT_COMPAT_LEVEL,
-            .type = QEMU_OPT_STRING,
-            .help = "Compatibility level (v2 [0.10] or v3 [1.1])"
-        },
-        {
-            .name = BLOCK_OPT_BACKING_FILE,
-            .type = QEMU_OPT_STRING,
-            .help = "File name of a base image"
-        },
-        {
-            .name = BLOCK_OPT_BACKING_FMT,
-            .type = QEMU_OPT_STRING,
-            .help = "Image format of the base image"
-        },
-        {
-            .name = BLOCK_OPT_DATA_FILE,
-            .type = QEMU_OPT_STRING,
-            .help = "File name of an external data file"
-        },
-        {
-            .name = BLOCK_OPT_DATA_FILE_RAW,
-            .type = QEMU_OPT_BOOL,
-            .help = "The external data file must stay valid as a raw image"
-        },
-        {
-            .name = BLOCK_OPT_ENCRYPT,
-            .type = QEMU_OPT_BOOL,
-            .help = "Encrypt the image with format 'aes'. (Deprecated "
-                    "in favor of " BLOCK_OPT_ENCRYPT_FORMAT "=aes)",
+        {                                                               \
+            .name = BLOCK_OPT_ENCRYPT,                                  \
+            .type = QEMU_OPT_BOOL,                                      \
+            .help = "Encrypt the image with format 'aes'. (Deprecated " \
+                    "in favor of " BLOCK_OPT_ENCRYPT_FORMAT "=aes)",    \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_ENCRYPT_FORMAT,                           \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Encrypt the image, format choices: 'aes', 'luks'", \
+        },                                                              \
+        BLOCK_CRYPTO_OPT_DEF_KEY_SECRET("encrypt.",                     \
+            "ID of secret providing qcow AES key or LUKS passphrase"),  \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_ALG("encrypt."),               \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_MODE("encrypt."),              \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_ALG("encrypt."),                \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_HASH_ALG("encrypt."),           \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_HASH_ALG("encrypt."),                 \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME("encrypt."),                \
+        {                                                               \
+            .name = BLOCK_OPT_CLUSTER_SIZE,                             \
+            .type = QEMU_OPT_SIZE,                                      \
+            .help = "qcow2 cluster size",                               \
+            .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)            \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_PREALLOC,                                 \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Preallocation mode (allowed values: off, "         \
+                    "metadata, falloc, full)"                           \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_COMPRESSION_TYPE,                         \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Compression method used for image cluster "        \
+                    "compression",                                      \
+            .def_value_str = "zlib"                                     \
         },
-        {
-            .name = BLOCK_OPT_ENCRYPT_FORMAT,
-            .type = QEMU_OPT_STRING,
-            .help = "Encrypt the image, format choices: 'aes', 'luks'",
-        },
-        BLOCK_CRYPTO_OPT_DEF_KEY_SECRET("encrypt.",
-            "ID of secret providing qcow AES key or LUKS passphrase"),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_MODE("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_HASH_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_HASH_ALG("encrypt."),
+        QCOW_COMMON_OPTIONS,
+        { /* end of list */ }
+    }
+};
+
+static QemuOptsList qcow2_amend_opts = {
+    .name = "qcow2-amend-opts",
+    .head = QTAILQ_HEAD_INITIALIZER(qcow2_amend_opts.head),
+    .desc = {
+        BLOCK_CRYPTO_OPT_DEF_LUKS_STATE("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET("encrypt."),
         BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME("encrypt."),
-        {
-            .name = BLOCK_OPT_CLUSTER_SIZE,
-            .type = QEMU_OPT_SIZE,
-            .help = "qcow2 cluster size",
-            .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)
-        },
-        {
-            .name = BLOCK_OPT_PREALLOC,
-            .type = QEMU_OPT_STRING,
-            .help = "Preallocation mode (allowed values: off, metadata, "
-                    "falloc, full)"
-        },
-        {
-            .name = BLOCK_OPT_LAZY_REFCOUNTS,
-            .type = QEMU_OPT_BOOL,
-            .help = "Postpone refcount updates",
-            .def_value_str = "off"
-        },
-        {
-            .name = BLOCK_OPT_REFCOUNT_BITS,
-            .type = QEMU_OPT_NUMBER,
-            .help = "Width of a reference count entry in bits",
-            .def_value_str = "16"
-        },
-        {
-            .name = BLOCK_OPT_COMPRESSION_TYPE,
-            .type = QEMU_OPT_STRING,
-            .help = "Compression method used for image cluster compression",
-            .def_value_str = "zlib"
-        },
+        QCOW_COMMON_OPTIONS,
         { /* end of list */ }
     }
 };
@@ -5791,10 +5845,12 @@ BlockDriver bdrv_qcow2 = {
     .bdrv_inactivate            = qcow2_inactivate,
 
     .create_opts         = &qcow2_create_opts,
+    .amend_opts          = &qcow2_amend_opts,
     .strong_runtime_opts = qcow2_strong_runtime_opts,
     .mutable_opts        = mutable_opts,
     .bdrv_co_check       = qcow2_co_check,
     .bdrv_amend_options  = qcow2_amend_options,
+    .bdrv_co_amend       = qcow2_co_amend,
 
     .bdrv_detach_aio_context  = qcow2_detach_aio_context,
     .bdrv_attach_aio_context  = qcow2_attach_aio_context,
diff --git a/block/qed.c b/block/qed.c
index c0c65015c7..ece8b9bb60 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -849,56 +849,18 @@ static BDRVQEDState *acb_to_s(QEDAIOCB *acb)
  * @s:              QED state
  * @pos:            Byte position in device
  * @qiov:           Destination I/O vector
- * @backing_qiov:   Possibly shortened copy of qiov, to be allocated here
- * @cb:             Completion function
- * @opaque:         User data for completion function
  *
  * This function reads qiov->size bytes starting at pos from the backing file.
  * If there is no backing file then zeroes are read.
  */
 static int coroutine_fn qed_read_backing_file(BDRVQEDState *s, uint64_t pos,
-                                              QEMUIOVector *qiov,
-                                              QEMUIOVector **backing_qiov)
+                                              QEMUIOVector *qiov)
 {
-    uint64_t backing_length = 0;
-    size_t size;
-    int ret;
-
-    /* If there is a backing file, get its length.  Treat the absence of a
-     * backing file like a zero length backing file.
-     */
     if (s->bs->backing) {
-        int64_t l = bdrv_getlength(s->bs->backing->bs);
-        if (l < 0) {
-            return l;
-        }
-        backing_length = l;
-    }
-
-    /* Zero all sectors if reading beyond the end of the backing file */
-    if (pos >= backing_length ||
-        pos + qiov->size > backing_length) {
-        qemu_iovec_memset(qiov, 0, 0, qiov->size);
-    }
-
-    /* Complete now if there are no backing file sectors to read */
-    if (pos >= backing_length) {
-        return 0;
-    }
-
-    /* If the read straddles the end of the backing file, shorten it */
-    size = MIN((uint64_t)backing_length - pos, qiov->size);
-
-    assert(*backing_qiov == NULL);
-    *backing_qiov = g_new(QEMUIOVector, 1);
-    qemu_iovec_init(*backing_qiov, qiov->niov);
-    qemu_iovec_concat(*backing_qiov, qiov, 0, size);
-
-    BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);
-    ret = bdrv_co_preadv(s->bs->backing, pos, size, *backing_qiov, 0);
-    if (ret < 0) {
-        return ret;
+        BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);
+        return bdrv_co_preadv(s->bs->backing, pos, qiov->size, qiov, 0);
     }
+    qemu_iovec_memset(qiov, 0, 0, qiov->size);
     return 0;
 }
 
@@ -915,7 +877,6 @@ static int coroutine_fn qed_copy_from_backing_file(BDRVQEDState *s,
                                                    uint64_t offset)
 {
     QEMUIOVector qiov;
-    QEMUIOVector *backing_qiov = NULL;
     int ret;
 
     /* Skip copy entirely if there is no work to do */
@@ -925,13 +886,7 @@ static int coroutine_fn qed_copy_from_backing_file(BDRVQEDState *s,
 
     qemu_iovec_init_buf(&qiov, qemu_blockalign(s->bs, len), len);
 
-    ret = qed_read_backing_file(s, pos, &qiov, &backing_qiov);
-
-    if (backing_qiov) {
-        qemu_iovec_destroy(backing_qiov);
-        g_free(backing_qiov);
-        backing_qiov = NULL;
-    }
+    ret = qed_read_backing_file(s, pos, &qiov);
 
     if (ret) {
         goto out;
@@ -1339,8 +1294,7 @@ static int coroutine_fn qed_aio_read_data(void *opaque, int ret,
         qemu_iovec_memset(&acb->cur_qiov, 0, 0, acb->cur_qiov.size);
         r = 0;
     } else if (ret != QED_CLUSTER_FOUND) {
-        r = qed_read_backing_file(s, acb->cur_pos, &acb->cur_qiov,
-                                  &acb->backing_qiov);
+        r = qed_read_backing_file(s, acb->cur_pos, &acb->cur_qiov);
     } else {
         BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
         r = bdrv_co_preadv(bs->file, offset, acb->cur_qiov.size,
@@ -1365,12 +1319,6 @@ static int coroutine_fn qed_aio_next_io(QEDAIOCB *acb)
     while (1) {
         trace_qed_aio_next_io(s, acb, 0, acb->cur_pos + acb->cur_qiov.size);
 
-        if (acb->backing_qiov) {
-            qemu_iovec_destroy(acb->backing_qiov);
-            g_free(acb->backing_qiov);
-            acb->backing_qiov = NULL;
-        }
-
         acb->qiov_offset += acb->cur_qiov.size;
         acb->cur_pos += acb->cur_qiov.size;
         qemu_iovec_reset(&acb->cur_qiov);
@@ -1514,7 +1462,6 @@ static int bdrv_qed_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     memset(bdi, 0, sizeof(*bdi));
     bdi->cluster_size = s->header.cluster_size;
     bdi->is_dirty = s->header.features & QED_F_NEED_CHECK;
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
diff --git a/block/qed.h b/block/qed.h
index 42c115d822..3d12bf78d4 100644
--- a/block/qed.h
+++ b/block/qed.h
@@ -140,7 +140,6 @@ typedef struct QEDAIOCB {
 
     /* Current cluster scatter-gather list */
     QEMUIOVector cur_qiov;
-    QEMUIOVector *backing_qiov;
     uint64_t cur_pos;               /* position on block device, in bytes */
     uint64_t cur_cluster;           /* cluster offset in image file */
     unsigned int cur_nclusters;     /* number of clusters being accessed */
diff --git a/block/vdi.c b/block/vdi.c
index 2f506a01ba..c4527a9d8c 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -334,7 +334,6 @@ static int vdi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     logout("\n");
     bdi->cluster_size = s->block_size;
     bdi->vm_state_offset = 0;
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
@@ -536,7 +535,7 @@ static int coroutine_fn vdi_co_block_status(BlockDriverState *bs,
     *pnum = MIN(s->block_size - index_in_block, bytes);
     result = VDI_IS_ALLOCATED(bmap_entry);
     if (!result) {
-        return 0;
+        return BDRV_BLOCK_ZERO;
     }
 
     *map = s->header.offset_data + (uint64_t)bmap_entry * s->block_size +
diff --git a/block/vhdx.c b/block/vhdx.c
index fa9e544a5e..645dc4b4f4 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1164,9 +1164,6 @@ static int vhdx_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 
     bdi->cluster_size = s->block_size;
 
-    bdi->unallocated_blocks_are_zero =
-        (s->params.data_bits & VHDX_PARAMS_HAS_PARENT) == 0;
-
     return 0;
 }
 
diff --git a/block/vpc.c b/block/vpc.c
index c055591641..01fcd37e3c 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -606,7 +606,6 @@ static int vpc_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
         bdi->cluster_size = s->block_size;
     }
 
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
@@ -745,7 +744,7 @@ static int coroutine_fn vpc_co_block_status(BlockDriverState *bs,
     image_offset = get_image_offset(bs, offset, false, NULL);
     allocated = (image_offset != -1);
     *pnum = 0;
-    ret = 0;
+    ret = BDRV_BLOCK_ZERO;
 
     do {
         /* All sectors in a block are contiguous (without using the bitmap) */
diff --git a/block/vvfat.c b/block/vvfat.c
index c65a98e3ee..2eb8cbb19f 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -140,48 +140,16 @@ static inline void* array_insert(array_t* array,unsigned int index,unsigned int
     return array->pointer+index*array->item_size;
 }
 
-/* this performs a "roll", so that the element which was at index_from becomes
- * index_to, but the order of all other elements is preserved. */
-static inline int array_roll(array_t* array,int index_to,int index_from,int count)
-{
-    char* buf;
-    char* from;
-    char* to;
-    int is;
-
-    if(!array ||
-            index_to<0 || index_to>=array->next ||
-            index_from<0 || index_from>=array->next)
-        return -1;
-
-    if(index_to==index_from)
-        return 0;
-
-    is=array->item_size;
-    from=array->pointer+index_from*is;
-    to=array->pointer+index_to*is;
-    buf=g_malloc(is*count);
-    memcpy(buf,from,is*count);
-
-    if(index_to<index_from)
-        memmove(to+is*count,to,from-to);
-    else
-        memmove(from,from+is*count,to-from);
-
-    memcpy(to,buf,is*count);
-
-    g_free(buf);
-
-    return 0;
-}
-
 static inline int array_remove_slice(array_t* array,int index, int count)
 {
     assert(index >=0);
     assert(count > 0);
     assert(index + count <= array->next);
-    if(array_roll(array,array->next-1,index,count))
-        return -1;
+
+    memmove(array->pointer + index * array->item_size,
+            array->pointer + (index + count) * array->item_size,
+            (array->next - index - count) * array->item_size);
+
     array->next -= count;
     return 0;
 }
@@ -520,12 +488,31 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
     direntry->begin_hi = cpu_to_le16((begin >> 16) & 0xffff);
 }
 
+static bool valid_filename(const unsigned char *name)
+{
+    unsigned char c;
+    if (!strcmp((const char*)name, ".") || !strcmp((const char*)name, "..")) {
+        return false;
+    }
+    for (; (c = *name); name++) {
+        if (!((c >= '0' && c <= '9') ||
+              (c >= 'A' && c <= 'Z') ||
+              (c >= 'a' && c <= 'z') ||
+              c > 127 ||
+              strchr("$%'-_@~`!(){}^#&.+,;=[]", c) != NULL))
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
 static uint8_t to_valid_short_char(gunichar c)
 {
     c = g_unichar_toupper(c);
     if ((c >= '0' && c <= '9') ||
         (c >= 'A' && c <= 'Z') ||
-        strchr("$%'-_@~`!(){}^#&", c) != 0) {
+        strchr("$%'-_@~`!(){}^#&", c) != NULL) {
         return c;
     } else {
         return 0;
@@ -2098,6 +2085,10 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i))
             }
             lfn.checksum = 0x100; /* cannot use long name twice */
 
+            if (!valid_filename(lfn.name)) {
+                fprintf(stderr, "Invalid file name\n");
+                goto fail;
+            }
             if (path_len + 1 + lfn.len >= PATH_MAX) {
                 fprintf(stderr, "Name too long: %s/%s\n", path, lfn.name);
                 goto fail;
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 0bfe46cff9..ac40d79bfa 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -413,7 +413,11 @@ static void save_window(CPUSPARCState *env)
     save_window_offset(env, cpu_cwp_dec(env, env->cwp - 2));
     env->wim = new_wim;
 #else
-    save_window_offset(env, cpu_cwp_dec(env, env->cwp - 2));
+    /*
+     * cansave is zero if the spill trap handler is triggered by `save` and
+     * nonzero if triggered by a `flushw`
+     */
+    save_window_offset(env, cpu_cwp_dec(env, env->cwp - env->cansave - 2));
     env->cansave++;
     env->canrestore--;
 #endif
diff --git a/configure b/configure
index 8a65240d4a..ee6c3c6792 100755
--- a/configure
+++ b/configure
@@ -1575,6 +1575,10 @@ for opt do
   ;;
   --enable-vhost-user) vhost_user="yes"
   ;;
+  --disable-vhost-vdpa) vhost_vdpa="no"
+  ;;
+  --enable-vhost-vdpa) vhost_vdpa="yes"
+  ;;
   --disable-vhost-kernel) vhost_kernel="no"
   ;;
   --enable-vhost-kernel) vhost_kernel="yes"
@@ -1883,6 +1887,7 @@ disabled with --disable-FEATURE, default is enabled if available:
   vhost-crypto    vhost-user-crypto backend support
   vhost-kernel    vhost kernel backend support
   vhost-user      vhost-user backend support
+  vhost-vdpa      vhost-vdpa kernel backend support
   spice           spice
   rbd             rados block device (rbd)
   libiscsi        iscsi support
@@ -2394,6 +2399,10 @@ test "$vhost_user" = "" && vhost_user=yes
 if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then
   error_exit "vhost-user isn't available on win32"
 fi
+test "$vhost_vdpa" = "" && vhost_vdpa=$linux
+if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
+  error_exit "vhost-vdpa is only available on Linux"
+fi
 test "$vhost_kernel" = "" && vhost_kernel=$linux
 if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then
   error_exit "vhost-kernel is only available on Linux"
@@ -2422,6 +2431,11 @@ test "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user
 if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then
   error_exit "--enable-vhost-user-fs requires --enable-vhost-user"
 fi
+#vhost-vdpa backends
+test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa
+if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then
+  error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa"
+fi
 
 # OR the vhost-kernel and vhost-user values for simplicity
 if test "$vhost_net" = ""; then
@@ -3194,6 +3208,13 @@ if ! check_include "ifaddrs.h" ; then
   have_ifaddrs_h=no
 fi
 
+#########################################
+# libdrm check
+have_drm_h=no
+if check_include "libdrm/drm.h" ; then
+    have_drm_h=yes
+fi
+
 ##########################################
 # VTE probe
 
@@ -5134,10 +5155,14 @@ extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
 int main(void) { return openpty(0, 0, 0, 0, 0); }
 EOF
 
-if ! compile_prog "" "" ; then
+have_openpty="no"
+if compile_prog "" "" ; then
+  have_openpty="yes"
+else
   if compile_prog "" "-lutil" ; then
     libs_softmmu="-lutil $libs_softmmu"
     libs_tools="-lutil $libs_tools"
+    have_openpty="yes"
   fi
 fi
 
@@ -6936,6 +6961,7 @@ echo "vhost-scsi support $vhost_scsi"
 echo "vhost-vsock support $vhost_vsock"
 echo "vhost-user support $vhost_user"
 echo "vhost-user-fs support $vhost_user_fs"
+echo "vhost-vdpa support $vhost_vdpa"
 echo "Trace backends    $trace_backends"
 if have_backend "simple"; then
 echo "Trace output file $trace_file-<pid>"
@@ -7377,9 +7403,15 @@ fi
 if test "$have_ifaddrs_h" = "yes" ; then
     echo "HAVE_IFADDRS_H=y" >> $config_host_mak
 fi
+if test "$have_drm_h" = "yes" ; then
+  echo "HAVE_DRM_H=y" >> $config_host_mak
+fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
+if test "$have_openpty" = "yes" ; then
+    echo "HAVE_OPENPTY=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
@@ -7437,6 +7469,9 @@ fi
 if test "$vhost_net_user" = "yes" ; then
   echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
 fi
+if test "$vhost_net_vdpa" = "yes" ; then
+  echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak
+fi
 if test "$vhost_crypto" = "yes" ; then
   echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
 fi
@@ -7452,6 +7487,9 @@ fi
 if test "$vhost_user" = "yes" ; then
   echo "CONFIG_VHOST_USER=y" >> $config_host_mak
 fi
+if test "$vhost_vdpa" = "yes" ; then
+  echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
+fi
 if test "$vhost_user_fs" = "yes" ; then
   echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
 fi
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 4861db810c..564caa1094 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -32,6 +32,7 @@
 #include "qemu/uuid.h"
 
 #include "qemu/coroutine.h"
+#include "qemu/bitmap.h"
 
 /*
  * Reference for the LUKS format implemented here is
@@ -70,6 +71,9 @@ typedef struct QCryptoBlockLUKSKeySlot QCryptoBlockLUKSKeySlot;
 
 #define QCRYPTO_BLOCK_LUKS_SECTOR_SIZE 512LL
 
+#define QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS 2000
+#define QCRYPTO_BLOCK_LUKS_ERASE_ITERATIONS 40
+
 static const char qcrypto_block_luks_magic[QCRYPTO_BLOCK_LUKS_MAGIC_LEN] = {
     'L', 'U', 'K', 'S', 0xBA, 0xBE
 };
@@ -219,6 +223,9 @@ struct QCryptoBlockLUKS {
 
     /* Hash algorithm used in pbkdf2 function */
     QCryptoHashAlgorithm hash_alg;
+
+    /* Name of the secret that was used to open the image */
+    char *secret;
 };
 
 
@@ -720,7 +727,7 @@ qcrypto_block_luks_store_key(QCryptoBlock *block,
                              Error **errp)
 {
     QCryptoBlockLUKS *luks = block->opaque;
-    QCryptoBlockLUKSKeySlot *slot = &luks->header.key_slots[slot_idx];
+    QCryptoBlockLUKSKeySlot *slot;
     g_autofree uint8_t *splitkey = NULL;
     size_t splitkeylen;
     g_autofree uint8_t *slotkey = NULL;
@@ -730,6 +737,8 @@ qcrypto_block_luks_store_key(QCryptoBlock *block,
     uint64_t iters;
     int ret = -1;
 
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
     if (qcrypto_random_bytes(slot->salt,
                              QCRYPTO_BLOCK_LUKS_SALT_LEN,
                              errp) < 0) {
@@ -890,7 +899,7 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
                             Error **errp)
 {
     QCryptoBlockLUKS *luks = block->opaque;
-    const QCryptoBlockLUKSKeySlot *slot = &luks->header.key_slots[slot_idx];
+    const QCryptoBlockLUKSKeySlot *slot;
     g_autofree uint8_t *splitkey = NULL;
     size_t splitkeylen;
     g_autofree uint8_t *possiblekey = NULL;
@@ -900,6 +909,8 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
     g_autoptr(QCryptoIVGen) ivgen = NULL;
     size_t niv;
 
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
     if (slot->active != QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED) {
         return 0;
     }
@@ -1069,6 +1080,126 @@ qcrypto_block_luks_find_key(QCryptoBlock *block,
     return -1;
 }
 
+/*
+ * Returns true if a slot i is marked as active
+ * (contains encrypted copy of the master key)
+ */
+static bool
+qcrypto_block_luks_slot_active(const QCryptoBlockLUKS *luks,
+                               unsigned int slot_idx)
+{
+    uint32_t val;
+
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    val = luks->header.key_slots[slot_idx].active;
+    return val == QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED;
+}
+
+/*
+ * Returns the number of slots that are marked as active
+ * (slots that contain encrypted copy of the master key)
+ */
+static unsigned int
+qcrypto_block_luks_count_active_slots(const QCryptoBlockLUKS *luks)
+{
+    size_t i = 0;
+    unsigned int ret = 0;
+
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+        if (qcrypto_block_luks_slot_active(luks, i)) {
+            ret++;
+        }
+    }
+    return ret;
+}
+
+/*
+ * Finds first key slot which is not active
+ * Returns the key slot index, or -1 if it doesn't exist
+ */
+static int
+qcrypto_block_luks_find_free_keyslot(const QCryptoBlockLUKS *luks)
+{
+    size_t i;
+
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+        if (!qcrypto_block_luks_slot_active(luks, i)) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+/*
+ * Erases an keyslot given its index
+ * Returns:
+ *    0 if the keyslot was erased successfully
+ *   -1 if a error occurred while erasing the keyslot
+ *
+ */
+static int
+qcrypto_block_luks_erase_key(QCryptoBlock *block,
+                             unsigned int slot_idx,
+                             QCryptoBlockWriteFunc writefunc,
+                             void *opaque,
+                             Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    QCryptoBlockLUKSKeySlot *slot;
+    g_autofree uint8_t *garbagesplitkey = NULL;
+    size_t splitkeylen;
+    size_t i;
+    Error *local_err = NULL;
+    int ret;
+
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
+
+    splitkeylen = luks->header.master_key_len * slot->stripes;
+    assert(splitkeylen > 0);
+
+    garbagesplitkey = g_new0(uint8_t, splitkeylen);
+
+    /* Reset the key slot header */
+    memset(slot->salt, 0, QCRYPTO_BLOCK_LUKS_SALT_LEN);
+    slot->iterations = 0;
+    slot->active = QCRYPTO_BLOCK_LUKS_KEY_SLOT_DISABLED;
+
+    ret = qcrypto_block_luks_store_header(block, writefunc,
+                                          opaque, &local_err);
+
+    if (ret < 0) {
+        error_propagate(errp, local_err);
+    }
+    /*
+     * Now try to erase the key material, even if the header
+     * update failed
+     */
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_ERASE_ITERATIONS; i++) {
+        if (qcrypto_random_bytes(garbagesplitkey,
+                                 splitkeylen, &local_err) < 0) {
+            /*
+             * If we failed to get the random data, still write
+             * at least zeros to the key slot at least once
+             */
+            error_propagate(errp, local_err);
+
+            if (i > 0) {
+                return -1;
+            }
+        }
+        if (writefunc(block,
+                      slot->key_offset_sector * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
+                      garbagesplitkey,
+                      splitkeylen,
+                      opaque,
+                      &local_err) != splitkeylen) {
+            error_propagate(errp, local_err);
+            return -1;
+        }
+    }
+    return ret;
+}
 
 static int
 qcrypto_block_luks_open(QCryptoBlock *block,
@@ -1099,6 +1230,7 @@ qcrypto_block_luks_open(QCryptoBlock *block,
 
     luks = g_new0(QCryptoBlockLUKS, 1);
     block->opaque = luks;
+    luks->secret = g_strdup(options->u.luks.key_secret);
 
     if (qcrypto_block_luks_load_header(block, readfunc, opaque, errp) < 0) {
         goto fail;
@@ -1164,6 +1296,7 @@ qcrypto_block_luks_open(QCryptoBlock *block,
  fail:
     qcrypto_block_free_cipher(block);
     qcrypto_ivgen_free(block->ivgen);
+    g_free(luks->secret);
     g_free(luks);
     return -1;
 }
@@ -1204,7 +1337,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
 
     memcpy(&luks_opts, &options->u.luks, sizeof(luks_opts));
     if (!luks_opts.has_iter_time) {
-        luks_opts.iter_time = 2000;
+        luks_opts.iter_time = QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS;
     }
     if (!luks_opts.has_cipher_alg) {
         luks_opts.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256;
@@ -1244,6 +1377,8 @@ qcrypto_block_luks_create(QCryptoBlock *block,
                    optprefix ? optprefix : "");
         goto error;
     }
+    luks->secret = g_strdup(options->u.luks.key_secret);
+
     password = qcrypto_secret_lookup_as_utf8(luks_opts.key_secret, errp);
     if (!password) {
         goto error;
@@ -1471,10 +1606,278 @@ qcrypto_block_luks_create(QCryptoBlock *block,
     qcrypto_block_free_cipher(block);
     qcrypto_ivgen_free(block->ivgen);
 
+    g_free(luks->secret);
     g_free(luks);
     return -1;
 }
 
+static int
+qcrypto_block_luks_amend_add_keyslot(QCryptoBlock *block,
+                                     QCryptoBlockReadFunc readfunc,
+                                     QCryptoBlockWriteFunc writefunc,
+                                     void *opaque,
+                                     QCryptoBlockAmendOptionsLUKS *opts_luks,
+                                     bool force,
+                                     Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    uint64_t iter_time = opts_luks->has_iter_time ?
+                         opts_luks->iter_time :
+                         QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS;
+    int keyslot;
+    g_autofree char *old_password = NULL;
+    g_autofree char *new_password = NULL;
+    g_autofree uint8_t *master_key = NULL;
+
+    char *secret = opts_luks->has_secret ? opts_luks->secret : luks->secret;
+
+    if (!opts_luks->has_new_secret) {
+        error_setg(errp, "'new-secret' is required to activate a keyslot");
+        return -1;
+    }
+    if (opts_luks->has_old_secret) {
+        error_setg(errp,
+                   "'old-secret' must not be given when activating keyslots");
+        return -1;
+    }
+
+    if (opts_luks->has_keyslot) {
+        keyslot = opts_luks->keyslot;
+        if (keyslot < 0 || keyslot >= QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS) {
+            error_setg(errp,
+                       "Invalid keyslot %u specified, must be between 0 and %u",
+                       keyslot, QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS - 1);
+            return -1;
+        }
+    } else {
+        keyslot = qcrypto_block_luks_find_free_keyslot(luks);
+        if (keyslot == -1) {
+            error_setg(errp,
+                       "Can't add a keyslot - all keyslots are in use");
+            return -1;
+        }
+    }
+
+    if (!force && qcrypto_block_luks_slot_active(luks, keyslot)) {
+        error_setg(errp,
+                   "Refusing to overwrite active keyslot %i - "
+                   "please erase it first",
+                   keyslot);
+        return -1;
+    }
+
+    /* Locate the password that will be used to retrieve the master key */
+    old_password = qcrypto_secret_lookup_as_utf8(secret, errp);
+    if (!old_password) {
+        return -1;
+    }
+
+    /* Retrieve the master key */
+    master_key = g_new0(uint8_t, luks->header.master_key_len);
+
+    if (qcrypto_block_luks_find_key(block, old_password, master_key,
+                                    readfunc, opaque, errp) < 0) {
+        error_append_hint(errp, "Failed to retrieve the master key");
+        return -1;
+    }
+
+    /* Locate the new password*/
+    new_password = qcrypto_secret_lookup_as_utf8(opts_luks->new_secret, errp);
+    if (!new_password) {
+        return -1;
+    }
+
+    /* Now set the new keyslots */
+    if (qcrypto_block_luks_store_key(block, keyslot, new_password, master_key,
+                                     iter_time, writefunc, opaque, errp)) {
+        error_append_hint(errp, "Failed to write to keyslot %i", keyslot);
+        return -1;
+    }
+    return 0;
+}
+
+static int
+qcrypto_block_luks_amend_erase_keyslots(QCryptoBlock *block,
+                                        QCryptoBlockReadFunc readfunc,
+                                        QCryptoBlockWriteFunc writefunc,
+                                        void *opaque,
+                                        QCryptoBlockAmendOptionsLUKS *opts_luks,
+                                        bool force,
+                                        Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    g_autofree uint8_t *tmpkey = NULL;
+    g_autofree char *old_password = NULL;
+
+    if (opts_luks->has_new_secret) {
+        error_setg(errp,
+                   "'new-secret' must not be given when erasing keyslots");
+        return -1;
+    }
+    if (opts_luks->has_iter_time) {
+        error_setg(errp,
+                   "'iter-time' must not be given when erasing keyslots");
+        return -1;
+    }
+    if (opts_luks->has_secret) {
+        error_setg(errp,
+                   "'secret' must not be given when erasing keyslots");
+        return -1;
+    }
+
+    /* Load the old password if given */
+    if (opts_luks->has_old_secret) {
+        old_password = qcrypto_secret_lookup_as_utf8(opts_luks->old_secret,
+                                                     errp);
+        if (!old_password) {
+            return -1;
+        }
+
+        /*
+         * Allocate a temporary key buffer that we will need when
+         * checking if slot matches the given old password
+         */
+        tmpkey = g_new0(uint8_t, luks->header.master_key_len);
+    }
+
+    /* Erase an explicitly given keyslot */
+    if (opts_luks->has_keyslot) {
+        int keyslot = opts_luks->keyslot;
+
+        if (keyslot < 0 || keyslot >= QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS) {
+            error_setg(errp,
+                       "Invalid keyslot %i specified, must be between 0 and %i",
+                       keyslot, QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS - 1);
+            return -1;
+        }
+
+        if (opts_luks->has_old_secret) {
+            int rv = qcrypto_block_luks_load_key(block,
+                                                 keyslot,
+                                                 old_password,
+                                                 tmpkey,
+                                                 readfunc,
+                                                 opaque,
+                                                 errp);
+            if (rv == -1) {
+                return -1;
+            } else if (rv == 0) {
+                error_setg(errp,
+                           "Given keyslot %i doesn't contain the given "
+                           "old password for erase operation",
+                           keyslot);
+                return -1;
+            }
+        }
+
+        if (!force && !qcrypto_block_luks_slot_active(luks, keyslot)) {
+            error_setg(errp,
+                       "Given keyslot %i is already erased (inactive) ",
+                       keyslot);
+            return -1;
+        }
+
+        if (!force && qcrypto_block_luks_count_active_slots(luks) == 1) {
+            error_setg(errp,
+                       "Attempt to erase the only active keyslot %i "
+                       "which will erase all the data in the image "
+                       "irreversibly - refusing operation",
+                       keyslot);
+            return -1;
+        }
+
+        if (qcrypto_block_luks_erase_key(block, keyslot,
+                                         writefunc, opaque, errp)) {
+            error_append_hint(errp, "Failed to erase keyslot %i", keyslot);
+            return -1;
+        }
+
+    /* Erase all keyslots that match the given old password */
+    } else if (opts_luks->has_old_secret) {
+
+        unsigned long slots_to_erase_bitmap = 0;
+        size_t i;
+        int slot_count;
+
+        assert(QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS <=
+               sizeof(slots_to_erase_bitmap) * 8);
+
+        for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+            int rv = qcrypto_block_luks_load_key(block,
+                                                 i,
+                                                 old_password,
+                                                 tmpkey,
+                                                 readfunc,
+                                                 opaque,
+                                                 errp);
+            if (rv == -1) {
+                return -1;
+            } else if (rv == 1) {
+                bitmap_set(&slots_to_erase_bitmap, i, 1);
+            }
+        }
+
+        slot_count = bitmap_count_one(&slots_to_erase_bitmap,
+                                      QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+        if (slot_count == 0) {
+            error_setg(errp,
+                       "No keyslots match given (old) password for erase operation");
+            return -1;
+        }
+
+        if (!force &&
+            slot_count == qcrypto_block_luks_count_active_slots(luks)) {
+            error_setg(errp,
+                       "All the active keyslots match the (old) password that "
+                       "was given and erasing them will erase all the data in "
+                       "the image irreversibly - refusing operation");
+            return -1;
+        }
+
+        /* Now apply the update */
+        for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+            if (!test_bit(i, &slots_to_erase_bitmap)) {
+                continue;
+            }
+            if (qcrypto_block_luks_erase_key(block, i, writefunc,
+                opaque, errp)) {
+                error_append_hint(errp, "Failed to erase keyslot %zu", i);
+                return -1;
+            }
+        }
+    } else {
+        error_setg(errp,
+                   "To erase keyslot(s), either explicit keyslot index "
+                   "or the password currently contained in them must be given");
+        return -1;
+    }
+    return 0;
+}
+
+static int
+qcrypto_block_luks_amend_options(QCryptoBlock *block,
+                                 QCryptoBlockReadFunc readfunc,
+                                 QCryptoBlockWriteFunc writefunc,
+                                 void *opaque,
+                                 QCryptoBlockAmendOptions *options,
+                                 bool force,
+                                 Error **errp)
+{
+    QCryptoBlockAmendOptionsLUKS *opts_luks = &options->u.luks;
+
+    switch (opts_luks->state) {
+    case Q_CRYPTO_BLOCKLUKS_KEYSLOT_STATE_ACTIVE:
+        return qcrypto_block_luks_amend_add_keyslot(block, readfunc,
+                                                    writefunc, opaque,
+                                                    opts_luks, force, errp);
+    case Q_CRYPTO_BLOCKLUKS_KEYSLOT_STATE_INACTIVE:
+        return qcrypto_block_luks_amend_erase_keyslots(block, readfunc,
+                                                       writefunc, opaque,
+                                                       opts_luks, force, errp);
+    default:
+        g_assert_not_reached();
+    }
+}
 
 static int qcrypto_block_luks_get_info(QCryptoBlock *block,
                                        QCryptoBlockInfo *info,
@@ -1523,7 +1926,11 @@ static int qcrypto_block_luks_get_info(QCryptoBlock *block,
 
 static void qcrypto_block_luks_cleanup(QCryptoBlock *block)
 {
-    g_free(block->opaque);
+    QCryptoBlockLUKS *luks = block->opaque;
+    if (luks) {
+        g_free(luks->secret);
+        g_free(luks);
+    }
 }
 
 
@@ -1560,6 +1967,7 @@ qcrypto_block_luks_encrypt(QCryptoBlock *block,
 const QCryptoBlockDriver qcrypto_block_driver_luks = {
     .open = qcrypto_block_luks_open,
     .create = qcrypto_block_luks_create,
+    .amend = qcrypto_block_luks_amend_options,
     .get_info = qcrypto_block_luks_get_info,
     .cleanup = qcrypto_block_luks_cleanup,
     .decrypt = qcrypto_block_luks_decrypt,
diff --git a/crypto/block.c b/crypto/block.c
index 6f42b32f1e..eb057948b5 100644
--- a/crypto/block.c
+++ b/crypto/block.c
@@ -150,6 +150,35 @@ qcrypto_block_calculate_payload_offset(QCryptoBlockCreateOptions *create_opts,
     return crypto != NULL;
 }
 
+int qcrypto_block_amend_options(QCryptoBlock *block,
+                                QCryptoBlockReadFunc readfunc,
+                                QCryptoBlockWriteFunc writefunc,
+                                void *opaque,
+                                QCryptoBlockAmendOptions *options,
+                                bool force,
+                                Error **errp)
+{
+    if (options->format != block->format) {
+        error_setg(errp,
+                   "Cannot amend encryption format");
+        return -1;
+    }
+
+    if (!block->driver->amend) {
+        error_setg(errp,
+                   "Crypto format %s doesn't support format options amendment",
+                   QCryptoBlockFormat_str(block->format));
+        return -1;
+    }
+
+    return block->driver->amend(block,
+                                readfunc,
+                                writefunc,
+                                opaque,
+                                options,
+                                force,
+                                errp);
+}
 
 QCryptoBlockInfo *qcrypto_block_get_info(QCryptoBlock *block,
                                          Error **errp)
diff --git a/crypto/blockpriv.h b/crypto/blockpriv.h
index 71c59cb542..3c7ccea504 100644
--- a/crypto/blockpriv.h
+++ b/crypto/blockpriv.h
@@ -62,6 +62,14 @@ struct QCryptoBlockDriver {
                   void *opaque,
                   Error **errp);
 
+    int (*amend)(QCryptoBlock *block,
+                 QCryptoBlockReadFunc readfunc,
+                 QCryptoBlockWriteFunc writefunc,
+                 void *opaque,
+                 QCryptoBlockAmendOptions *options,
+                 bool force,
+                 Error **errp);
+
     int (*get_info)(QCryptoBlock *block,
                     QCryptoBlockInfo *info,
                     Error **errp);
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
index 049387ac6d..006f986420 100644
--- a/docs/interop/index.rst
+++ b/docs/interop/index.rst
@@ -20,3 +20,4 @@ Contents:
    qemu-ga
    vhost-user
    vhost-user-gpu
+   vhost-vdpa
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 688b7c6900..10e3e3475e 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -816,6 +816,7 @@ Protocol features
   #define VHOST_USER_PROTOCOL_F_RESET_DEVICE         13
   #define VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS 14
   #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS  15
+  #define VHOST_USER_PROTOCOL_F_STATUS               16
 
 Master message types
 --------------------
@@ -1307,6 +1308,29 @@ Master message types
   ``VHOST_USER_ADD_MEM_REG`` message, this message is used to set and
   update the memory tables of the slave device.
 
+``VHOST_USER_SET_STATUS``
+  :id: 39
+  :equivalent ioctl: VHOST_VDPA_SET_STATUS
+  :slave payload: N/A
+  :master payload: ``u64``
+
+  When the ``VHOST_USER_PROTOCOL_F_STATUS`` protocol feature has been
+  successfully negotiated, this message is submitted by the master to
+  notify the backend with updated device status as defined in the Virtio
+  specification.
+
+``VHOST_USER_GET_STATUS``
+  :id: 40
+  :equivalent ioctl: VHOST_VDPA_GET_STATUS
+  :slave payload: ``u64``
+  :master payload: N/A
+
+  When the ``VHOST_USER_PROTOCOL_F_STATUS`` protocol feature has been
+  successfully negotiated, this message is submitted by the master to
+  query the backend for its device status as defined in the Virtio
+  specification.
+
+
 Slave message types
 -------------------
 
diff --git a/docs/interop/vhost-vdpa.rst b/docs/interop/vhost-vdpa.rst
new file mode 100644
index 0000000000..0c70ba01bc
--- /dev/null
+++ b/docs/interop/vhost-vdpa.rst
@@ -0,0 +1,17 @@
+=====================
+Vhost-vdpa Protocol
+=====================
+
+Introduction
+=============
+vDPA(Virtual data path acceleration) device is a device that uses
+a datapath which complies with the virtio specifications with vendor
+specific control path. vDPA devices can be both physically located on
+the hardware or emulated by software.
+
+This document describes the vDPA support in qemu
+
+Here is the kernel commit here
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4c8cf31885f69e86be0b5b9e6677a26797365e1d
+
+TODO : More information will add later
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 843ae71fc6..58a9aeb851 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -82,6 +82,15 @@ should specify an ``audiodev=`` property.  Additionally, when using
 vnc, you should specify an ``audiodev=`` propery if you plan to
 transmit audio through the VNC protocol.
 
+Creating sound card devices using ``-soundhw`` (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Sound card devices should be created using ``-device`` instead.  The
+names are the same for most devices.  The exceptions are ``hda`` which
+needs two devices (``-device intel-hda -device hda-duplex``) and
+``pcspk`` which can be activated using ``-machine
+pcspk-audiodev=<name>``.
+
 ``-mon ...,control=readline,pretty=on|off`` (since 4.1)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
@@ -404,6 +413,17 @@ The above, converted to the current supported format::
 
   json:{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"}
 
+linux-user mode CPUs
+--------------------
+
+``tilegx`` CPUs (since 5.1.0)
+'''''''''''''''''''''''''''''
+
+The ``tilegx`` guest CPU support (which was only implemented in
+linux-user mode) is deprecated and will be removed in a future version
+of QEMU. Support for this CPU was removed from the upstream Linux
+kernel in 2018, and has also been dropped from glibc.
+
 Related binaries
 ----------------
 
diff --git a/docs/system/target-i386-desc.rst.inc b/docs/system/target-i386-desc.rst.inc
index 47a169e0ae..7d1fffacbe 100644
--- a/docs/system/target-i386-desc.rst.inc
+++ b/docs/system/target-i386-desc.rst.inc
@@ -31,6 +31,8 @@ The QEMU PC System emulator simulates the following peripherals:
 
 -  CS4231A compatible sound card
 
+-  PC speaker
+
 -  PCI UHCI, OHCI, EHCI or XHCI USB controller and a virtual USB-1.1
    hub.
 
@@ -49,7 +51,7 @@ must be told to not have parallel ports to have working GUS.
 
 .. parsed-literal::
 
-   |qemu_system_x86| dos.img -soundhw gus -parallel none
+   |qemu_system_x86| dos.img -device gus -parallel none
 
 Alternatively:
 
@@ -60,3 +62,12 @@ Alternatively:
 Or some other unclaimed IRQ.
 
 CS4231A is the chip used in Windows Sound System and GUSMAX products
+
+The PC speaker audio device can be configured using the pcspk-audiodev
+machine property, i.e.
+
+.. parsed-literal::
+
+   |qemu_system_x86| some.img \
+   -audiodev <backend>,id=<name> \
+   -machine pcspk-audiodev=<name>
diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
index 7f0737488a..e33f5575e3 100644
--- a/docs/tools/qemu-img.rst
+++ b/docs/tools/qemu-img.rst
@@ -253,11 +253,14 @@ Command description:
 
 .. program:: qemu-img-commands
 
-.. option:: amend [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] -o OPTIONS FILENAME
+.. option:: amend [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] [--force] -o OPTIONS FILENAME
 
   Amends the image format specific *OPTIONS* for the image file
   *FILENAME*. Not all file formats support this operation.
 
+  --force allows some unsafe operations. Currently for -f luks, it allows to
+  erase the last encryption key, and to overwrite an active encryption key.
+
 .. option:: bench [-c COUNT] [-d DEPTH] [-f FMT] [--flush-interval=FLUSH_INTERVAL] [-i AIO] [-n] [--no-drain] [-o OFFSET] [--pattern=PATTERN] [-q] [-s BUFFER_SIZE] [-S STEP_SIZE] [-t CACHE] [-w] [-U] FILENAME
 
   Run a simple sequential I/O benchmark on the specified image. If ``-w`` is
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
index 378594c422..824e713491 100644
--- a/docs/tools/virtiofsd.rst
+++ b/docs/tools/virtiofsd.rst
@@ -54,6 +54,11 @@ Options
   * flock|no_flock -
     Enable/disable flock.  The default is ``no_flock``.
 
+  * modcaps=CAPLIST
+    Modify the list of capabilities allowed; CAPLIST is a colon separated
+    list of capabilities, each preceded by either + or -, e.g.
+    ''+sys_admin:-chown''.
+
   * log_level=LEVEL -
     Print only log messages matching LEVEL or more severe.  LEVEL is one of
     ``err``, ``warn``, ``info``, or ``debug``.  The default is ``info``.
diff --git a/exec.c b/exec.c
index 21926dc9c7..893636176e 100644
--- a/exec.c
+++ b/exec.c
@@ -4115,4 +4115,56 @@ void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root)
     }
 }
 
+/*
+ * If positive, discarding RAM is disabled. If negative, discarding RAM is
+ * required to work and cannot be disabled.
+ */
+static int ram_block_discard_disabled;
+
+int ram_block_discard_disable(bool state)
+{
+    int old;
+
+    if (!state) {
+        atomic_dec(&ram_block_discard_disabled);
+        return 0;
+    }
+
+    do {
+        old = atomic_read(&ram_block_discard_disabled);
+        if (old < 0) {
+            return -EBUSY;
+        }
+    } while (atomic_cmpxchg(&ram_block_discard_disabled, old, old + 1) != old);
+    return 0;
+}
+
+int ram_block_discard_require(bool state)
+{
+    int old;
+
+    if (!state) {
+        atomic_inc(&ram_block_discard_disabled);
+        return 0;
+    }
+
+    do {
+        old = atomic_read(&ram_block_discard_disabled);
+        if (old > 0) {
+            return -EBUSY;
+        }
+    } while (atomic_cmpxchg(&ram_block_discard_disabled, old, old - 1) != old);
+    return 0;
+}
+
+bool ram_block_discard_is_disabled(void)
+{
+    return atomic_read(&ram_block_discard_disabled) > 0;
+}
+
+bool ram_block_discard_is_required(void)
+{
+    return atomic_read(&ram_block_discard_disabled) < 0;
+}
+
 #endif
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
index 6446034711..51b2f256ec 100644
--- a/hw/arm/fsl-imx6ul.c
+++ b/hw/arm/fsl-imx6ul.c
@@ -427,6 +427,9 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_ENET2_TIMER_IRQ,
         };
 
+        object_property_set_uint(OBJECT(&s->eth[i]),
+                                 s->phy_num[i],
+                                 "phy-num", &error_abort);
         object_property_set_uint(OBJECT(&s->eth[i]),
                                  FSL_IMX6UL_ETH_NUM_TX_RINGS,
                                  "tx-ring-num", &error_abort);
@@ -607,10 +610,17 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
                                 FSL_IMX6UL_OCRAM_ALIAS_ADDR, &s->ocram_alias);
 }
 
+static Property fsl_imx6ul_properties[] = {
+    DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0),
+    DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx6ul_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx6ul_properties);
     dc->realize = fsl_imx6ul_realize;
     dc->desc = "i.MX6UL SOC";
     /* Reason: Uses serial_hds and nd_table in realize() directly */
diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c
index 2f845cedfc..9033d3f8f3 100644
--- a/hw/arm/mcimx6ul-evk.c
+++ b/hw/arm/mcimx6ul-evk.c
@@ -40,6 +40,8 @@ static void mcimx6ul_evk_init(MachineState *machine)
 
     s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
     object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
+    object_property_set_uint(OBJECT(s), 2, "fec1-phy-num", &error_fatal);
+    object_property_set_uint(OBJECT(s), 1, "fec2-phy-num", &error_fatal);
     qdev_realize(DEVICE(s), NULL, &error_fatal);
 
     memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
index 105c5e63f2..ceee6aa48d 100644
--- a/hw/arm/pxa2xx_pic.c
+++ b/hw/arm/pxa2xx_pic.c
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "hw/arm/pxa.h"
 #include "hw/sysbus.h"
@@ -166,7 +167,9 @@ static uint64_t pxa2xx_pic_mem_read(void *opaque, hwaddr offset,
     case ICHP:	/* Highest Priority register */
         return pxa2xx_pic_highest(s);
     default:
-        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pxa2xx_pic_mem_read: bad register offset 0x%" HWADDR_PRIx
+                      "\n", offset);
         return 0;
     }
 }
@@ -199,7 +202,9 @@ static void pxa2xx_pic_mem_write(void *opaque, hwaddr offset,
         s->priority[32 + ((offset - IPR32) >> 2)] = value & 0x8000003f;
         break;
     default:
-        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pxa2xx_pic_mem_write: bad register offset 0x%"
+                      HWADDR_PRIx "\n", offset);
         return;
     }
     pxa2xx_pic_update(opaque);
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index fc18212e68..f020aff974 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -23,36 +23,66 @@
 #include "hw/ssi/ssi.h"
 #include "hw/block/flash.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 #include "hw/arm/sharpsl.h"
 #include "ui/console.h"
 #include "hw/audio/wm8750.h"
 #include "audio/audio.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
+#include "hw/misc/max111x.h"
 #include "migration/vmstate.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
 
-#undef REG_FMT
-#define REG_FMT			"0x%02lx"
+enum spitz_model_e { spitz, akita, borzoi, terrier };
+
+typedef struct {
+    MachineClass parent;
+    enum spitz_model_e model;
+    int arm_id;
+} SpitzMachineClass;
+
+typedef struct {
+    MachineState parent;
+    PXA2xxState *mpu;
+    DeviceState *mux;
+    DeviceState *lcdtg;
+    DeviceState *ads7846;
+    DeviceState *max1111;
+    DeviceState *scp0;
+    DeviceState *scp1;
+    DeviceState *misc_gpio;
+} SpitzMachineState;
+
+#define TYPE_SPITZ_MACHINE "spitz-common"
+#define SPITZ_MACHINE(obj) \
+    OBJECT_CHECK(SpitzMachineState, obj, TYPE_SPITZ_MACHINE)
+#define SPITZ_MACHINE_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(SpitzMachineClass, obj, TYPE_SPITZ_MACHINE)
+#define SPITZ_MACHINE_CLASS(klass) \
+    OBJECT_CLASS_CHECK(SpitzMachineClass, klass, TYPE_SPITZ_MACHINE)
+
+#define zaurus_printf(format, ...)                              \
+    fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
 
 /* Spitz Flash */
-#define FLASH_BASE		0x0c000000
-#define FLASH_ECCLPLB		0x00	/* Line parity 7 - 0 bit */
-#define FLASH_ECCLPUB		0x04	/* Line parity 15 - 8 bit */
-#define FLASH_ECCCP		0x08	/* Column parity 5 - 0 bit */
-#define FLASH_ECCCNTR		0x0c	/* ECC byte counter */
-#define FLASH_ECCCLRR		0x10	/* Clear ECC */
-#define FLASH_FLASHIO		0x14	/* Flash I/O */
-#define FLASH_FLASHCTL		0x18	/* Flash Control */
-
-#define FLASHCTL_CE0		(1 << 0)
-#define FLASHCTL_CLE		(1 << 1)
-#define FLASHCTL_ALE		(1 << 2)
-#define FLASHCTL_WP		(1 << 3)
-#define FLASHCTL_CE1		(1 << 4)
-#define FLASHCTL_RYBY		(1 << 5)
-#define FLASHCTL_NCE		(FLASHCTL_CE0 | FLASHCTL_CE1)
+#define FLASH_BASE              0x0c000000
+#define FLASH_ECCLPLB           0x00    /* Line parity 7 - 0 bit */
+#define FLASH_ECCLPUB           0x04    /* Line parity 15 - 8 bit */
+#define FLASH_ECCCP             0x08    /* Column parity 5 - 0 bit */
+#define FLASH_ECCCNTR           0x0c    /* ECC byte counter */
+#define FLASH_ECCCLRR           0x10    /* Clear ECC */
+#define FLASH_FLASHIO           0x14    /* Flash I/O */
+#define FLASH_FLASHCTL          0x18    /* Flash Control */
+
+#define FLASHCTL_CE0            (1 << 0)
+#define FLASHCTL_CLE            (1 << 1)
+#define FLASHCTL_ALE            (1 << 2)
+#define FLASHCTL_WP             (1 << 3)
+#define FLASHCTL_CE1            (1 << 4)
+#define FLASHCTL_RYBY           (1 << 5)
+#define FLASHCTL_NCE            (FLASHCTL_CE0 | FLASHCTL_CE1)
 
 #define TYPE_SL_NAND "sl-nand"
 #define SL_NAND(obj) OBJECT_CHECK(SLNANDState, (obj), TYPE_SL_NAND)
@@ -74,12 +104,12 @@ static uint64_t sl_read(void *opaque, hwaddr addr, unsigned size)
     int ryby;
 
     switch (addr) {
-#define BSHR(byte, from, to)	((s->ecc.lp[byte] >> (from - to)) & (1 << to))
+#define BSHR(byte, from, to)    ((s->ecc.lp[byte] >> (from - to)) & (1 << to))
     case FLASH_ECCLPLB:
         return BSHR(0, 4, 0) | BSHR(0, 5, 2) | BSHR(0, 6, 4) | BSHR(0, 7, 6) |
                 BSHR(1, 4, 1) | BSHR(1, 5, 3) | BSHR(1, 6, 5) | BSHR(1, 7, 7);
 
-#define BSHL(byte, from, to)	((s->ecc.lp[byte] << (to - from)) & (1 << to))
+#define BSHL(byte, from, to)    ((s->ecc.lp[byte] << (to - from)) & (1 << to))
     case FLASH_ECCLPUB:
         return BSHL(0, 0, 0) | BSHL(0, 1, 2) | BSHL(0, 2, 4) | BSHL(0, 3, 6) |
                 BSHL(1, 0, 1) | BSHL(1, 1, 3) | BSHL(1, 2, 5) | BSHL(1, 3, 7);
@@ -105,7 +135,9 @@ static uint64_t sl_read(void *opaque, hwaddr addr, unsigned size)
         return ecc_digest(&s->ecc, nand_getio(s->nand));
 
     default:
-        zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "sl_read: bad register offset 0x%02" HWADDR_PRIx "\n",
+                      addr);
     }
     return 0;
 }
@@ -136,7 +168,9 @@ static void sl_write(void *opaque, hwaddr addr,
         break;
 
     default:
-        zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "sl_write: bad register offset 0x%02" HWADDR_PRIx "\n",
+                      addr);
     }
 }
 
@@ -191,8 +225,8 @@ static void sl_nand_realize(DeviceState *dev, Error **errp)
 
 /* Spitz Keyboard */
 
-#define SPITZ_KEY_STROBE_NUM	11
-#define SPITZ_KEY_SENSE_NUM	7
+#define SPITZ_KEY_STROBE_NUM    11
+#define SPITZ_KEY_SENSE_NUM     7
 
 static const int spitz_gpio_key_sense[SPITZ_KEY_SENSE_NUM] = {
     12, 17, 91, 34, 36, 38, 39
@@ -214,11 +248,11 @@ static int spitz_keymap[SPITZ_KEY_SENSE_NUM + 1][SPITZ_KEY_STROBE_NUM] = {
     { 0x52, 0x43, 0x01, 0x47, 0x49,  -1 ,  -1 ,  -1 ,  -1 ,  -1 ,  -1  },
 };
 


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14605.36056 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqE-0002q5-Uh; Thu, 29 Oct 2020 19:44:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14605.36056; Thu, 29 Oct 2020 19:44:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqE-0002px-Rd; Thu, 29 Oct 2020 19:44:10 +0000
Received: by outflank-mailman (input) for mailman id 14605;
 Thu, 29 Oct 2020 19:44:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDqD-0002ps-N5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1cd77bb5-4eb4-4513-8264-ea2ab49ff7bb;
 Thu, 29 Oct 2020 19:44:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqC-0005Bm-Ef
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqC-0003B5-D5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDqD-0002ps-N5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:09 +0000
X-Inumbo-ID: 1cd77bb5-4eb4-4513-8264-ea2ab49ff7bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1cd77bb5-4eb4-4513-8264-ea2ab49ff7bb;
	Thu, 29 Oct 2020 19:44:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GeGKhOiZtPSyX1sXR8EMbx8BfPL0tUI1YCdN7Fn6LVk=; b=XP6ygGSn7j8xpAha1mw80FGYEo
	M/V1Snads6Jeu8SGq7Z2v6B73jXf5CRMz3bJEWSFb+mMJu8SaqZe+7wa6oLSpiXczLvGuXC/qUYud
	nmjqqPVEJ4woYznDFXn3A4cO2JhJVR/iR5BPHCGmPmtnPgQbuS6O5KOb4lUZ9GohkTEw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqC-0005Bm-Ef
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqC-0003B5-D5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fix the prototype of muls64/mulu64
Message-Id: <E1kYDqC-0003B5-D5@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:08 +0000

commit db7b62e70667b06ae18b69382f4647f5673bbf75
Author:     Lijun Pan <ljp@linux.ibm.com>
AuthorDate: Wed Jul 1 18:43:44 2020 -0500
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 18:13:13 2020 +0200

    fix the prototype of muls64/mulu64
    
    The prototypes of muls64/mulu64 in host-utils.h should match the
    definitions in host-utils.c
    
    Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
    Message-Id: <20200701234344.91843-10-ljp@linux.ibm.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/qemu/host-utils.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 4cd170e6cd..cdca2991d8 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -77,8 +77,8 @@ static inline int divs128(int64_t *plow, int64_t *phigh, int64_t divisor)
     }
 }
 #else
-void muls64(uint64_t *phigh, uint64_t *plow, int64_t a, int64_t b);
-void mulu64(uint64_t *phigh, uint64_t *plow, uint64_t a, uint64_t b);
+void muls64(uint64_t *plow, uint64_t *phigh, int64_t a, int64_t b);
+void mulu64(uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b);
 int divu128(uint64_t *plow, uint64_t *phigh, uint64_t divisor);
 int divs128(int64_t *plow, int64_t *phigh, int64_t divisor);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:44:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:44:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14606.36060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqO-0002qv-W6; Thu, 29 Oct 2020 19:44:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14606.36060; Thu, 29 Oct 2020 19:44:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqO-0002qn-TF; Thu, 29 Oct 2020 19:44:20 +0000
Received: by outflank-mailman (input) for mailman id 14606;
 Thu, 29 Oct 2020 19:44:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDqN-0002qg-TV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 89bcb5ba-79c9-41b7-91bc-e0215244b195;
 Thu, 29 Oct 2020 19:44:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqM-0005Bp-Iu
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqM-0003Bz-HS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDqN-0002qg-TV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:19 +0000
X-Inumbo-ID: 89bcb5ba-79c9-41b7-91bc-e0215244b195
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 89bcb5ba-79c9-41b7-91bc-e0215244b195;
	Thu, 29 Oct 2020 19:44:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1GUI7/oxoVvlEtsV4QkT5hwARM98UDGSyd1Uwkvs+4s=; b=jtW3LQ4CkgaKMFmTPr5FBwbJKU
	zKocfHGfM/Y8uBorgmO/YhKhvGdnOohJgNiawJB2OPRW+ELqkwyC+W0C3rOiSBZSvoRxSVFzlsn8F
	85i1W8b7V9skORuvG7e0aIPhIZRYRazvgAuWXDLmwTm78SWQp7Wa5CJIT6uM/UPB0DAk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqM-0005Bp-Iu
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqM-0003Bz-HS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] trivial: Respect alphabetical order of .o files in Makefile.objs
Message-Id: <E1kYDqM-0003Bz-HS@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:18 +0000

commit be99a9a09dcf8b056ec501591e4efdce8efeaf00
Author:     Christophe de Dinechin <dinechin@redhat.com>
AuthorDate: Mon Jun 29 11:49:34 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    trivial: Respect alphabetical order of .o files in Makefile.objs
    
    The vmgenid.o is the only file that is not in alphabetical order.
    
    Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200629094934.2081180-1-dinechin@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 stubs/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index f32b9e47a3..1df8bb3814 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -19,10 +19,10 @@ stub-obj-y += replay.o
 stub-obj-y += runstate-check.o
 stub-obj-$(CONFIG_SOFTMMU) += semihost.o
 stub-obj-y += set-fd-handler.o
-stub-obj-y += vmgenid.o
 stub-obj-y += sysbus.o
 stub-obj-y += tpm.o
 stub-obj-y += trace-control.o
+stub-obj-y += vmgenid.o
 stub-obj-y += vmstate.o
 stub-obj-$(CONFIG_SOFTMMU) += win32-kbd-hook.o
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:44:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:44:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14607.36064 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqZ-0002sM-21; Thu, 29 Oct 2020 19:44:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14607.36064; Thu, 29 Oct 2020 19:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqY-0002sA-Uk; Thu, 29 Oct 2020 19:44:30 +0000
Received: by outflank-mailman (input) for mailman id 14607;
 Thu, 29 Oct 2020 19:44:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDqX-0002s1-G3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4bafbe11-9bf7-41b0-acf1-7dbc39087a03;
 Thu, 29 Oct 2020 19:44:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqW-0005By-Mx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqW-0003D3-Lr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDqX-0002s1-G3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:29 +0000
X-Inumbo-ID: 4bafbe11-9bf7-41b0-acf1-7dbc39087a03
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4bafbe11-9bf7-41b0-acf1-7dbc39087a03;
	Thu, 29 Oct 2020 19:44:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1Cv+4U4aczP4G01jgUW+qsS6dUf0xXURo8Bk+EisuTo=; b=G+XtGPQN+Ds93WRAamnIPubNGT
	gl2JPnTum0QJrlDS3+aGGrBZQK1YgwT0mP6G63lomjOakzBC65qR4sOmAMfsHyTyVOMpTkSzaROG4
	MRenUjaNck+oZf/pzapkhKkNeYTmNEa0LY/ldmfLPgxqIcCVlc25AyqQVOdBSr/yzdFs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqW-0005By-Mx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqW-0003D3-Lr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] .mailmap: Update Alexander Graf email address
Message-Id: <E1kYDqW-0003D3-Lr@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:28 +0000

commit 0f57f8d84f36a1769720dae70bd12725194f48d1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jul 2 19:38:00 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    .mailmap: Update Alexander Graf email address
    
    Update Alexander Graf email address to avoid emails bouncing.
    
    Suggested-by: Alexander Graf <agraf@csgraf.de>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alexander Graf <agraf@csgraf.de>
    Message-Id: <20200702173818.14651-2-f4bug@amsat.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 .mailmap | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.mailmap b/.mailmap
index 926cac6bb8..e46e6c7302 100644
--- a/.mailmap
+++ b/.mailmap
@@ -44,6 +44,7 @@ Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgte
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
 Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <arikalo@wavecomp.com>
 Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <aleksandar.rikalo@rt-rk.com>
+Alexander Graf <agraf@csgraf.de> <agraf@suse.de>
 Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
 Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
 Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:44:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:44:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14608.36067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqj-0002tW-32; Thu, 29 Oct 2020 19:44:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14608.36067; Thu, 29 Oct 2020 19:44:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqj-0002tO-05; Thu, 29 Oct 2020 19:44:41 +0000
Received: by outflank-mailman (input) for mailman id 14608;
 Thu, 29 Oct 2020 19:44:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDqh-0002tH-NV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a4285133-b40e-4ba5-940f-3fb71e935b1c;
 Thu, 29 Oct 2020 19:44:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqg-0005C6-Qj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqg-0003E8-Pl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDqh-0002tH-NV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:39 +0000
X-Inumbo-ID: a4285133-b40e-4ba5-940f-3fb71e935b1c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a4285133-b40e-4ba5-940f-3fb71e935b1c;
	Thu, 29 Oct 2020 19:44:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sj+qztJm2XD0dQ49WlW21enx/m4tDT1l1H6iJjYDq/Q=; b=fT8mi3IIn0ddkbi8Gd4TTOQWGE
	MvuKTVu14u6S6pbctpKJbj8atvZP9my18MHIBezLvzDCPENoK2UcnWNyePjv07TR4O+LK234HWApb
	JHLRTcT8Auk7gSBv1GJXR/Zo+BHyutEJWZOjK/IM9wwLIY7WS4cvpN7ONqm/VZdX7Ue4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqg-0005C6-Qj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqg-0003E8-Pl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Update Radoslaw Biernacki email address
Message-Id: <E1kYDqg-0003E8-Pl@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:38 +0000

commit 428a37770406346dac6d355a70ea5a8916aecb1f
Author:     Radoslaw Biernacki <rad@semihalf.com>
AuthorDate: Tue May 12 19:07:04 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    MAINTAINERS: Update Radoslaw Biernacki email address
    
    My Linaro account is no longer active and stop forwarding emails to me.
    Changing it to my current employer domain.
    
    Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Acked-by: Leif Lindholm <leif@nuviainc.com>
    Message-Id: <20200512170704.9290-1-rad@semihalf.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 .mailmap    | 1 +
 MAINTAINERS | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index e46e6c7302..81c2ce0937 100644
--- a/.mailmap
+++ b/.mailmap
@@ -50,6 +50,7 @@ Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
 Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
 James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
 Leif Lindholm <leif@nuviainc.com> <leif.lindholm@linaro.org>
+Radoslaw Biernacki <rad@semihalf.com> <radoslaw.biernacki@linaro.org>
 Paul Burton <pburton@wavecomp.com> <paul.burton@mips.com>
 Paul Burton <pburton@wavecomp.com> <paul.burton@imgtec.com>
 Paul Burton <pburton@wavecomp.com> <paul@archlinuxmips.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index c31c878c63..36dce13bcc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -809,7 +809,7 @@ F: include/hw/misc/imx6_*.h
 F: include/hw/ssi/imx_spi.h
 
 SBSA-REF
-M: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
+M: Radoslaw Biernacki <rad@semihalf.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 R: Leif Lindholm <leif@nuviainc.com>
 L: qemu-arm@nongnu.org
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:44:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:44:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14609.36072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqt-0002uv-4i; Thu, 29 Oct 2020 19:44:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14609.36072; Thu, 29 Oct 2020 19:44:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDqt-0002un-1f; Thu, 29 Oct 2020 19:44:51 +0000
Received: by outflank-mailman (input) for mailman id 14609;
 Thu, 29 Oct 2020 19:44:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDqr-0002uf-Px
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c1d94629-02ec-4bff-bc88-70e8327fbf92;
 Thu, 29 Oct 2020 19:44:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqq-0005CE-V5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDqq-0003FE-Tf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDqr-0002uf-Px
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:49 +0000
X-Inumbo-ID: c1d94629-02ec-4bff-bc88-70e8327fbf92
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c1d94629-02ec-4bff-bc88-70e8327fbf92;
	Thu, 29 Oct 2020 19:44:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nfvDMMx4ZZ87HeHNjDtqW1flZ6ToAXtGSgekjQJf7Lw=; b=NxzqD+NlPEzy6gVIJsS0w15II+
	UNDI5yPT5k9aF836m6+cgZIMDEx9YnLLZi+F3k2Zwr82ssH6nuPtLTeWDXifdys5iB2g+I/T67iSa
	+rgL7TYxArINPg3StAXwLzfmEaXJ7OIudqMedIN1G38qJPuH8LewmkwvmC4iHEcao+6s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqq-0005CE-V5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDqq-0003FE-Tf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] util/qemu-option: Document the get_opt_value() function
Message-Id: <E1kYDqq-0003FE-Tf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:48 +0000

commit 8f4d9555823636c329cb40afc6f36969ec5d35e4
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Mon Jun 29 09:08:58 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    util/qemu-option: Document the get_opt_value() function
    
    Coverity noticed commit 950c4e6c94 introduced a dereference before
    null check in get_opt_value (CID1391003):
    
      In get_opt_value: All paths that lead to this null pointer
      comparison already dereference the pointer earlier (CWE-476)
    
    We fixed this in commit 6e3ad3f0e31, but relaxed the check in commit
    0c2f6e7ee99 because "No callers of get_opt_value() pass in a NULL
    for the 'value' parameter".
    
    Since this function is publicly exposed, it risks new users to do
    the same error again. Avoid that documenting the 'value' argument
    must not be NULL.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200629070858.19850-1-philmd@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/qemu/option.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/qemu/option.h b/include/qemu/option.h
index eb4097889d..ac50d25774 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -28,6 +28,19 @@
 
 #include "qemu/queue.h"
 
+/**
+ * get_opt_value
+ * @p: a pointer to the option name, delimited by commas
+ * @value: a non-NULL pointer that will received the delimited options
+ *
+ * The @value char pointer will be allocated and filled with
+ * the delimited options.
+ *
+ * Returns the position of the comma delimiter/zero byte after the
+ * option name in @p.
+ * The memory pointer in @value must be released with a call to g_free()
+ * when no longer required.
+ */
 const char *get_opt_value(const char *p, char **value);
 
 void parse_option_size(const char *name, const char *value,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:45:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:45:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14610.36076 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDr3-0002we-6T; Thu, 29 Oct 2020 19:45:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14610.36076; Thu, 29 Oct 2020 19:45:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDr3-0002wW-3E; Thu, 29 Oct 2020 19:45:01 +0000
Received: by outflank-mailman (input) for mailman id 14610;
 Thu, 29 Oct 2020 19:45:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDr2-0002wQ-3X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3511143f-77de-4cd0-aaad-8149bc9bd463;
 Thu, 29 Oct 2020 19:44:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDr1-0005Cz-3a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDr1-0003GJ-1k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDr2-0002wQ-3X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:00 +0000
X-Inumbo-ID: 3511143f-77de-4cd0-aaad-8149bc9bd463
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3511143f-77de-4cd0-aaad-8149bc9bd463;
	Thu, 29 Oct 2020 19:44:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B3erZCQ0NCo6xW4Yx9WPNaN0fp+uA63YW/6Ya3h4T1A=; b=LNODOGQvyRQoBrSqgVn272COYt
	ctdMMkxCVKR5OdmT3psweYr7hDUKy3nIDzEDr/NrOZwqf2kJqZqnuKt+WHJn/EdIGhoUEuFZRL+ej
	NFPyjV3Jt9xhDZO67e023D3Ejln2OFXq8L2x/c5dx9vgO8w7uN7o40bm2JoKmahOsfaA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDr1-0005Cz-3a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDr1-0003GJ-1k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:44:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
Message-Id: <E1kYDr1-0003GJ-1k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:44:59 +0000

commit 2a345149d1747d8625d5d2796e22f4bdd60bea83
Author:     Menno Lageman <menno.lageman@oracle.com>
AuthorDate: Thu Jun 25 17:52:58 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
    
    Commit 4b49b586c4 ('intel_iommu: remove "x-" prefix for "aw-bits"')
    removed the "x-" prefix but but didn't update the error message
    accordingly.
    
    Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200625155258.1452425-1-menno.lageman@oracle.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/i386/intel_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index df7ad254ac..c56398e991 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3758,7 +3758,7 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
     /* Currently only address widths supported are 39 and 48 bits */
     if ((s->aw_bits != VTD_HOST_AW_39BIT) &&
         (s->aw_bits != VTD_HOST_AW_48BIT)) {
-        error_setg(errp, "Supported values for x-aw-bits are: %d, %d",
+        error_setg(errp, "Supported values for aw-bits are: %d, %d",
                    VTD_HOST_AW_39BIT, VTD_HOST_AW_48BIT);
         return false;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:45:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:45:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14612.36079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrD-0002y2-7t; Thu, 29 Oct 2020 19:45:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14612.36079; Thu, 29 Oct 2020 19:45:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrD-0002xu-4x; Thu, 29 Oct 2020 19:45:11 +0000
Received: by outflank-mailman (input) for mailman id 14612;
 Thu, 29 Oct 2020 19:45:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDrC-0002xj-2Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b3c2cd2b-298a-478d-98e6-528a5a087109;
 Thu, 29 Oct 2020 19:45:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrB-0005DX-8V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrB-0003Hr-6q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDrC-0002xj-2Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:10 +0000
X-Inumbo-ID: b3c2cd2b-298a-478d-98e6-528a5a087109
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b3c2cd2b-298a-478d-98e6-528a5a087109;
	Thu, 29 Oct 2020 19:45:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yfL+vPAvAJsqs6mC1T7Ud9nsYApVBpoeGd9RFC4YUXA=; b=tB9OMhdx1k0MRBvtcAegnwYQrx
	TrjAY1Gr+2NOeqrGctq+rKGgUs9PtiTHKGOqs2TLo7EHVJ20v90aG6G0rvJZG7Zkt1BpHMVkShzKQ
	f7OcDyRHxiFYGhIsklsG2Ss6UdrmujPN+XyntF1VrIWs9r+8spl27Zt908anvvE8Hegg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrB-0005DX-8V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrB-0003Hr-6q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] net/tap-solaris.c: Include qemu-common.h for TFR macro
Message-Id: <E1kYDrB-0003Hr-6q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:45:09 +0000

commit 89615cfef57e04da0e5a1bd212a62f8696468e79
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 4 10:23:17 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    net/tap-solaris.c: Include qemu-common.h for TFR macro
    
    In commit a8d2532645cf5ce4 we cleaned up usage of the qemu-common.h header
    so that it was always included from .c files and never from other .h files.
    We missed adding it to net/tap-solaris.c (which previously was pulling it
    in via tap-int.h), which broke building on Solaris hosts.
    
    Fixes: a8d2532645cf5ce4
    Reported-by: Michele Denber <denber@mindspring.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Tested-by: Michele Denber <denber@mindspring.com>
    Message-Id: <20200704092317.12943-1-peter.maydell@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 net/tap-solaris.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 4725d2314e..d03165c57c 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -27,6 +27,7 @@
 #include "tap_int.h"
 #include "qemu/ctype.h"
 #include "qemu/cutils.h"
+#include "qemu-common.h"
 
 #include <sys/ethernet.h>
 #include <sys/sockio.h>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:45:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:45:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14613.36083 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrN-0002zQ-9o; Thu, 29 Oct 2020 19:45:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14613.36083; Thu, 29 Oct 2020 19:45:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrN-0002zJ-6Z; Thu, 29 Oct 2020 19:45:21 +0000
Received: by outflank-mailman (input) for mailman id 14613;
 Thu, 29 Oct 2020 19:45:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDrM-0002zB-8t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 407329f7-15fb-4437-8184-c7c7093a95b9;
 Thu, 29 Oct 2020 19:45:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrL-0005Dk-DJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrL-0003It-Bw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDrM-0002zB-8t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:20 +0000
X-Inumbo-ID: 407329f7-15fb-4437-8184-c7c7093a95b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 407329f7-15fb-4437-8184-c7c7093a95b9;
	Thu, 29 Oct 2020 19:45:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F+uZ965rcpAvXv0cc2to+ho8M3Lej/4IDSynynlATBo=; b=CNQMMxDJuNampoegf+Hjv9fdh6
	oYswal7yDmR9iRjeuXmYYclp7zrleKvBJZRtTRktBfiDBSLPaA8Azxo+6M0h6vmURMXAkeoq4tO2r
	nCuk/Yj6EWVYFSzxQo4fAXy3QebWnHOS2+gP/aA/5++zqooZ4bE57FB+vL8Djk/vsVpU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrL-0005Dk-DJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrL-0003It-Bw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.1-pull-request' into staging
Message-Id: <E1kYDrL-0003It-Bw@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:45:19 +0000

commit 3d7cad3c2388cb74451d50cf455a42d349236161
Merge: 48f22ad04ead83e61b4b35871ec6f6109779b791 89615cfef57e04da0e5a1bd212a62f8696468e79
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 14:13:19 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 14:13:19 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.1-pull-request' into staging
    
    trivial branch patches 20200707
    
    # gpg: Signature made Tue 07 Jul 2020 11:52:06 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/trivial-branch-for-5.1-pull-request:
      net/tap-solaris.c: Include qemu-common.h for TFR macro
      intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
      util/qemu-option: Document the get_opt_value() function
      MAINTAINERS: Update Radoslaw Biernacki email address
      .mailmap: Update Alexander Graf email address
      trivial: Respect alphabetical order of .o files in Makefile.objs
      fix the prototype of muls64/mulu64
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .mailmap                  |  2 ++
 MAINTAINERS               |  2 +-
 hw/i386/intel_iommu.c     |  2 +-
 include/qemu/host-utils.h |  4 ++--
 include/qemu/option.h     | 13 +++++++++++++
 net/tap-solaris.c         |  1 +
 stubs/Makefile.objs       |  2 +-
 7 files changed, 21 insertions(+), 5 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:45:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14614.36088 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrZ-00030y-Cy; Thu, 29 Oct 2020 19:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14614.36088; Thu, 29 Oct 2020 19:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYDrZ-00030q-9p; Thu, 29 Oct 2020 19:45:33 +0000
Received: by outflank-mailman (input) for mailman id 14614;
 Thu, 29 Oct 2020 19:45:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYDrX-00030j-PK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a371e056-63e6-4644-adb3-b55b7ccafa5f;
 Thu, 29 Oct 2020 19:45:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrV-0005E1-Uz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYDrV-0003LF-UE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYDrX-00030j-PK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:31 +0000
X-Inumbo-ID: a371e056-63e6-4644-adb3-b55b7ccafa5f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a371e056-63e6-4644-adb3-b55b7ccafa5f;
	Thu, 29 Oct 2020 19:45:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AzMgqV2ELiexo3V3WLtrWUW/sNARqq9DozKtq6ztBi8=; b=Vxwq96NoYiyFVzC40MF2XI3OL3
	fvU6EwBY66EnhD5Ry57slvuLLJAKR0nVjPq/6adpTvQv4CvyO/kUjmOq98UyzvFa3cEcwjR5juzZD
	OddrciGCAWXEr7BBxi8r8mmcV+pLSqOlctz4xF/WEf4SkQxslURuUjaia1LwfeAUa30Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrV-0005E1-Uz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYDrV-0003LF-UE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:45:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/modules-20200707-pull-request' into staging
Message-Id: <E1kYDrV-0003LF-UE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:45:29 +0000

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

commit aff2caf6b3fbab1062e117a47b66d27f7fd2f272
Merge: 3d7cad3c2388cb74451d50cf455a42d349236161 ef138c77249771081d8c2d09b8e729f7e92cdf28
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 17:02:29 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 17:02:29 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/modules-20200707-pull-request' into staging
    
    qom: add support for qom objects in modules.
    build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules.
    build braille chardev as module.
    
    v2: more verbose comment for "build: fix device module builds" patch.
    
    note: qemu doesn't rebuild objects on cflags changes (specifically
          -fPIC being added when code is switched from builtin to module).
          Workaround for resulting build errors: "make clean", rebuild.
    
    # gpg: Signature made Tue 07 Jul 2020 14:42:16 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/modules-20200707-pull-request:
      chardev: enable modules, use for braille
      vga: build virtio-gpu as module
      vga: build virtio-gpu only once
      vga: build qxl as module
      usb: build usb-redir as module
      ccid: build smartcard as module
      build: fix device module builds
      qdev: device module support
      object: qom module support
      module: qom module support
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Makefile.objs            |  2 ++
 Makefile.target          | 14 ++++++++++
 chardev/Makefile.objs    |  5 +++-
 chardev/char.c           |  2 +-
 hw/Makefile.objs         |  2 ++
 hw/core/qdev.c           |  6 +++--
 hw/display/Makefile.objs | 30 +++++++++++++---------
 hw/usb/Makefile.objs     | 13 +++++++---
 include/qemu/module.h    |  2 ++
 include/qom/object.h     | 12 +++++++++
 qdev-monitor.c           |  5 ++--
 qom/object.c             | 14 ++++++++++
 qom/qom-qmp-cmds.c       |  3 ++-
 softmmu/vl.c             |  4 +--
 util/module.c            | 67 ++++++++++++++++++++++++++++++++++++++++++++++++
 15 files changed, 156 insertions(+), 25 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 98383972ee..d22b3b45d7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -59,6 +59,7 @@ common-obj-y += migration/
 common-obj-y += audio/
 common-obj-m += audio/
 common-obj-y += hw/
+common-obj-m += hw/
 
 common-obj-y += replay/
 
@@ -70,6 +71,7 @@ common-obj-$(CONFIG_TPM) += tpm.o
 
 common-obj-y += backends/
 common-obj-y += chardev/
+common-obj-m += chardev/
 
 common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
 qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
diff --git a/Makefile.target b/Makefile.target
index 8ed1eba95b..02bd9d7117 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -179,6 +179,20 @@ endif # CONFIG_SOFTMMU
 dummy := $(call unnest-vars,,obj-y)
 all-obj-y := $(obj-y)
 
+#
+# common-obj-m has some crap here, probably as side effect from
+# unnest-vars recursing into target directories to fill obj-y and not
+# properly handling the -m case.
+#
+# Clear common-obj-m as workaround.  Fixes suspious dependency errors
+# when building devices as modules.  A bit hackish, but should be ok
+# as long as we do not have any target-specific modules.
+#
+# The meson-based build system currently in development doesn't need
+# unnest-vars and will obsolete this workaround.
+#
+common-obj-m :=
+
 include $(SRC_PATH)/Makefile.objs
 dummy := $(call unnest-vars,.., \
                authz-obj-y \
diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index d68e1347f9..3a58c9d329 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -18,8 +18,11 @@ chardev-obj-$(CONFIG_WIN32) += char-win.o
 chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o
 
 common-obj-y += msmouse.o wctablet.o testdev.o
-common-obj-$(CONFIG_BRLAPI) += baum.o
+
+ifeq ($(CONFIG_BRLAPI),y)
+common-obj-m += baum.o
 baum.o-cflags := $(SDL_CFLAGS)
 baum.o-libs := $(BRLAPI_LIBS)
+endif
 
 common-obj-$(CONFIG_SPICE) += spice.o
diff --git a/chardev/char.c b/chardev/char.c
index e3051295ac..df697f3ce9 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -527,7 +527,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
     const ChardevClass *cc;
     char *typename = g_strdup_printf("chardev-%s", driver);
 
-    oc = object_class_by_name(typename);
+    oc = module_object_class_by_name(typename);
     g_free(typename);
 
     if (!object_class_dynamic_cast(oc, TYPE_CHARDEV)) {
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 4cbe5e4e57..14b7ea4eb6 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -43,4 +43,6 @@ devices-dirs-y += smbios/
 endif
 
 common-obj-y += $(devices-dirs-y)
+common-obj-m += display/
+common-obj-m += usb/
 obj-y += $(devices-dirs-y)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..9de16eae05 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -137,6 +137,9 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
  */
 DeviceState *qdev_new(const char *name)
 {
+    if (!object_class_by_name(name)) {
+        module_load_qom_one(name);
+    }
     return DEVICE(object_new(name));
 }
 
@@ -147,10 +150,9 @@ DeviceState *qdev_new(const char *name)
  */
 DeviceState *qdev_try_new(const char *name)
 {
-    if (!object_class_by_name(name)) {
+    if (!module_object_class_by_name(name)) {
         return NULL;
     }
-
     return DEVICE(object_new(name));
 }
 
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 77a7d622bd..e907f3182b 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -44,18 +44,24 @@ common-obj-$(CONFIG_ARTIST) += artist.o
 
 obj-$(CONFIG_VGA) += vga.o
 
-common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o
-
-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
-virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
-virtio-gpu.o-libs += $(VIRGL_LIBS)
-virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
-virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
+ifeq ($(CONFIG_QXL),y)
+common-obj-m += qxl.mo
+qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o
+endif
+
+ifeq ($(CONFIG_VIRTIO_GPU),y)
+common-obj-m += virtio-gpu.mo
+virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
+virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
+virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
+virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
+virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
+virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
+virtio-gpu.mo-objs := $(virtio-gpu-obj-y)
+virtio-gpu.mo-cflags := $(VIRGL_CFLAGS)
+virtio-gpu.mo-libs := $(VIRGL_LIBS)
+endif
+
 common-obj-$(CONFIG_DPCD) += dpcd.o
 common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
 
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index fa5c3fa1b8..e342ff59fa 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -29,11 +29,13 @@ common-obj-$(CONFIG_USB_NETWORK)      += dev-network.o
 
 ifeq ($(CONFIG_USB_SMARTCARD),y)
 common-obj-y                          += dev-smartcard-reader.o
-common-obj-$(CONFIG_SMARTCARD)        += smartcard.mo
+ifeq ($(CONFIG_SMARTCARD),y)
+common-obj-m                          += smartcard.mo
 smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o
 smartcard.mo-cflags := $(SMARTCARD_CFLAGS)
 smartcard.mo-libs := $(SMARTCARD_LIBS)
 endif
+endif
 
 ifeq ($(CONFIG_POSIX),y)
 common-obj-$(CONFIG_USB_STORAGE_MTP)  += dev-mtp.o
@@ -41,9 +43,12 @@ endif
 
 # usb redirection
 ifeq ($(CONFIG_USB),y)
-common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o
-redirect.o-cflags = $(USB_REDIR_CFLAGS)
-redirect.o-libs = $(USB_REDIR_LIBS)
+ifeq ($(CONFIG_USB_REDIR),y)
+common-obj-m += redirect.mo
+redirect.mo-objs = redirect.o quirks.o
+redirect.mo-cflags = $(USB_REDIR_CFLAGS)
+redirect.mo-libs = $(USB_REDIR_LIBS)
+endif
 endif
 
 # usb pass-through
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 011ae1ae76..9121a475c1 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -70,5 +70,7 @@ void register_dso_module_init(void (*fn)(void), module_init_type type);
 
 void module_call_init(module_init_type type);
 bool module_load_one(const char *prefix, const char *lib_name);
+void module_load_qom_one(const char *type);
+void module_load_qom_all(void);
 
 #endif
diff --git a/include/qom/object.h b/include/qom/object.h
index 94a61ccc3f..51f188137f 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -994,6 +994,18 @@ bool object_class_is_abstract(ObjectClass *klass);
  */
 ObjectClass *object_class_by_name(const char *typename);
 
+/**
+ * module_object_class_by_name:
+ * @typename: The QOM typename to obtain the class for.
+ *
+ * For objects which might be provided by a module.  Behaves like
+ * object_class_by_name, but additionally tries to load the module
+ * needed in case the class is not available.
+ *
+ * Returns: The class for @typename or %NULL if not found.
+ */
+ObjectClass *module_object_class_by_name(const char *typename);
+
 void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
                           const char *implements_type, bool include_abstract,
                           void *opaque);
diff --git a/qdev-monitor.c b/qdev-monitor.c
index e3083fae39..648b8ac4fa 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -149,6 +149,7 @@ static void qdev_print_devinfos(bool show_no_user)
     int i;
     bool cat_printed;
 
+    module_load_qom_all();
     list = object_class_get_list_sorted(TYPE_DEVICE, false);
 
     for (i = 0; i <= DEVICE_CATEGORY_MAX; i++) {
@@ -217,13 +218,13 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
     DeviceClass *dc;
     const char *original_name = *driver;
 
-    oc = object_class_by_name(*driver);
+    oc = module_object_class_by_name(*driver);
     if (!oc) {
         const char *typename = find_typename_by_alias(*driver);
 
         if (typename) {
             *driver = typename;
-            oc = object_class_by_name(*driver);
+            oc = module_object_class_by_name(*driver);
         }
     }
 
diff --git a/qom/object.c b/qom/object.c
index 6ece96bc2b..34daaf1280 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -985,6 +985,20 @@ ObjectClass *object_class_by_name(const char *typename)
     return type->class;
 }
 
+ObjectClass *module_object_class_by_name(const char *typename)
+{
+    ObjectClass *oc;
+
+    oc = object_class_by_name(typename);
+#ifdef CONFIG_MODULES
+    if (!oc) {
+        module_load_qom_one(typename);
+        oc = object_class_by_name(typename);
+    }
+#endif
+    return oc;
+}
+
 ObjectClass *object_class_get_parent(ObjectClass *class)
 {
     TypeImpl *type = type_get_parent(class->type);
diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index c5249e44d0..5e2c8cbf33 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -116,6 +116,7 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
 {
     ObjectTypeInfoList *ret = NULL;
 
+    module_load_qom_all();
     object_class_foreach(qom_list_types_tramp, implements, abstract, &ret);
 
     return ret;
@@ -130,7 +131,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
     ObjectPropertyIterator iter;
     ObjectPropertyInfoList *prop_list = NULL;
 
-    klass = object_class_by_name(typename);
+    klass = module_object_class_by_name(typename);
     if (klass == NULL) {
         error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
                   "Device '%s' not found", typename);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ecbc18ba75..3f58ffd4dc 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1772,8 +1772,8 @@ static bool vga_interface_available(VGAInterfaceType t)
 
     assert(t < VGA_TYPE_MAX);
     return !ti->class_names[0] ||
-           object_class_by_name(ti->class_names[0]) ||
-           object_class_by_name(ti->class_names[1]);
+           module_object_class_by_name(ti->class_names[0]) ||
+           module_object_class_by_name(ti->class_names[1]);
 }
 
 static const char *
diff --git a/util/module.c b/util/module.c
index e48d9aacc0..32b0547b82 100644
--- a/util/module.c
+++ b/util/module.c
@@ -245,3 +245,70 @@ bool module_load_one(const char *prefix, const char *lib_name)
 #endif
     return success;
 }
+
+/*
+ * Building devices and other qom objects modular is mostly useful in
+ * case they have dependencies to external shared libraries, so we can
+ * cut down the core qemu library dependencies.  Which is the case for
+ * only a very few devices & objects.
+ *
+ * So with the expectation that this will be rather the exception than
+ * to rule and the list will not gain that many entries go with a
+ * simple manually maintained list for now.
+ */
+static struct {
+    const char *type;
+    const char *prefix;
+    const char *module;
+} const qom_modules[] = {
+    { "ccid-card-passthru",    "hw-", "usb-smartcard"         },
+    { "ccid-card-emulated",    "hw-", "usb-smartcard"         },
+    { "usb-redir",             "hw-", "usb-redirect"          },
+    { "qxl-vga",               "hw-", "display-qxl"           },
+    { "qxl",                   "hw-", "display-qxl"           },
+    { "virtio-gpu-device",     "hw-", "display-virtio-gpu"    },
+    { "virtio-gpu-pci",        "hw-", "display-virtio-gpu"    },
+    { "virtio-vga",            "hw-", "display-virtio-gpu"    },
+    { "vhost-user-gpu-device", "hw-", "display-virtio-gpu"    },
+    { "vhost-user-gpu-pci",    "hw-", "display-virtio-gpu"    },
+    { "vhost-user-vga",        "hw-", "display-virtio-gpu"    },
+    { "chardev-braille",       "chardev-", "baum"             },
+};
+
+static bool module_loaded_qom_all;
+
+void module_load_qom_one(const char *type)
+{
+    int i;
+
+    if (module_loaded_qom_all) {
+        return;
+    }
+    for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
+        if (strcmp(qom_modules[i].type, type) == 0) {
+            module_load_one(qom_modules[i].prefix,
+                            qom_modules[i].module);
+            return;
+        }
+    }
+}
+
+void module_load_qom_all(void)
+{
+    int i;
+
+    if (module_loaded_qom_all) {
+        return;
+    }
+    for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
+        if (i > 0 && (strcmp(qom_modules[i - 1].module,
+                             qom_modules[i].module) == 0 &&
+                      strcmp(qom_modules[i - 1].prefix,
+                             qom_modules[i].prefix) == 0)) {
+            /* one module implementing multiple types -> load only once */
+            continue;
+        }
+        module_load_one(qom_modules[i].prefix, qom_modules[i].module);
+    }
+    module_loaded_qom_all = true;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:55:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14618.36103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE0s-0003x6-Dl; Thu, 29 Oct 2020 19:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14618.36103; Thu, 29 Oct 2020 19:55:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE0s-0003wy-AP; Thu, 29 Oct 2020 19:55:10 +0000
Received: by outflank-mailman (input) for mailman id 14618;
 Thu, 29 Oct 2020 19:55:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE0r-0003ws-2M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 83c1d409-df2e-43ca-90de-8f694060f2cc;
 Thu, 29 Oct 2020 19:55:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE0p-0005Q5-Mt
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE0p-00043V-Lr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE0r-0003ws-2M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:09 +0000
X-Inumbo-ID: 83c1d409-df2e-43ca-90de-8f694060f2cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 83c1d409-df2e-43ca-90de-8f694060f2cc;
	Thu, 29 Oct 2020 19:55:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CqKE4ZVLeHSIN+Fz3EcIq42GgYuIcVu+dGMQJ6wWBCo=; b=cSN6TUY3Bcr4PXij3MP/qdMGQ/
	n5Pv7t0ukoHwIg9S4syBgW0k2jIWPTRPrlbLDPM00qqrNZ6LfPeSebFoTNP7H8YSUxOOfi0SbtPlN
	3fVpy0oRYtm4+KF64cuyOZvkjBkZOMMd4dgvpa+WMfw4ahkyQKUdink1yqN28RoIXLvY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE0p-0005Q5-Mt
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE0p-00043V-Lr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] crypto: Add tls-cipher-suites object
Message-Id: <E1kYE0p-00043V-Lr@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:07 +0000

commit 993aec27aa39aa90f89f227d8f82cc1f8062386e
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Oct 11 20:21:11 2018 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    crypto: Add tls-cipher-suites object
    
    On the host OS, various aspects of TLS operation are configurable.
    In particular it is possible for the sysadmin to control the TLS
    cipher/protocol algorithms that applications are permitted to use.
    
    * Any given crypto library has a built-in default priority list
      defined by the distro maintainer of the library package (or by
      upstream).
    
    * The "crypto-policies" RPM (or equivalent host OS package)
      provides a config file such as "/etc/crypto-policies/config",
      where the sysadmin can set a high level (library-independent)
      policy.
    
      The "update-crypto-policies --set" command (or equivalent) is
      used to translate the global policy to individual library
      representations, producing files such as
      "/etc/crypto-policies/back-ends/*.config". The generated files,
      if present, are loaded by the various crypto libraries to
      override their own built-in defaults.
    
      For example, the GNUTLS library may read
      "/etc/crypto-policies/back-ends/gnutls.config".
    
    * A management application (or the QEMU user) may overide the
      system-wide crypto-policies config via their own config, if
      they need to diverge from the former.
    
    Thus the priority order is "QEMU user config" > "crypto-policies
    system config" > "library built-in config".
    
    Introduce the "tls-cipher-suites" object for exposing the ordered
    list of permitted TLS cipher suites from the host side to the
    guest firmware, via fw_cfg. The list is represented as an array
    of bytes.
    
    The priority at which the host-side policy is retrieved is given
    by the "priority" property of the new object type. For example,
    "priority=@SYSTEM" may be used to refer to
    "/etc/crypto-policies/back-ends/gnutls.config" (given that QEMU
    uses GNUTLS).
    
    The firmware uses the IANA_TLS_CIPHER array for configuring
    guest-side TLS, for example in UEFI HTTPS Boot.
    
    [Description from Daniel P. Berrangé, edited by Laszlo Ersek.]
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Acked-by: Laszlo Ersek <lersek@redhat.com>
    Message-Id: <20200623172726.21040-2-philmd@redhat.com>
---
 crypto/Makefile.objs               |   1 +
 crypto/tls-cipher-suites.c         | 115 +++++++++++++++++++++++++++++++++++++
 crypto/trace-events                |   5 ++
 include/crypto/tls-cipher-suites.h |  39 +++++++++++++
 qemu-options.hx                    |  19 ++++++
 5 files changed, 179 insertions(+)

diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 707c02ad37..f1965b1a68 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -13,6 +13,7 @@ crypto-obj-y += cipher.o
 crypto-obj-$(CONFIG_AF_ALG) += afalg.o
 crypto-obj-$(CONFIG_AF_ALG) += cipher-afalg.o
 crypto-obj-$(CONFIG_AF_ALG) += hash-afalg.o
+crypto-obj-$(CONFIG_GNUTLS) += tls-cipher-suites.o
 crypto-obj-y += tlscreds.o
 crypto-obj-y += tlscredsanon.o
 crypto-obj-y += tlscredspsk.o
diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
new file mode 100644
index 0000000000..a4e0f84307
--- /dev/null
+++ b/crypto/tls-cipher-suites.c
@@ -0,0 +1,115 @@
+/*
+ * QEMU TLS Cipher Suites
+ *
+ * Copyright (c) 2018-2020 Red Hat, Inc.
+ *
+ * Author: Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qom/object_interfaces.h"
+#include "crypto/tlscreds.h"
+#include "crypto/tls-cipher-suites.h"
+#include "trace.h"
+
+/*
+ * IANA registered TLS ciphers:
+ * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4
+ */
+typedef struct {
+    uint8_t data[2];
+} QEMU_PACKED IANA_TLS_CIPHER;
+
+GByteArray *qcrypto_tls_cipher_suites_get_data(QCryptoTLSCipherSuites *obj,
+                                               Error **errp)
+{
+    QCryptoTLSCreds *creds = QCRYPTO_TLS_CREDS(obj);
+    gnutls_priority_t pcache;
+    GByteArray *byte_array;
+    const char *err;
+    size_t i;
+    int ret;
+
+    trace_qcrypto_tls_cipher_suite_priority(creds->priority);
+    ret = gnutls_priority_init(&pcache, creds->priority, &err);
+    if (ret < 0) {
+        error_setg(errp, "Syntax error using priority '%s': %s",
+                   creds->priority, gnutls_strerror(ret));
+        return NULL;
+    }
+
+    byte_array = g_byte_array_new();
+
+    for (i = 0;; i++) {
+        int ret;
+        unsigned idx;
+        const char *name;
+        IANA_TLS_CIPHER cipher;
+        gnutls_protocol_t protocol;
+        const char *version;
+
+        ret = gnutls_priority_get_cipher_suite_index(pcache, i, &idx);
+        if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
+            break;
+        }
+        if (ret == GNUTLS_E_UNKNOWN_CIPHER_SUITE) {
+            continue;
+        }
+
+        name = gnutls_cipher_suite_info(idx, (unsigned char *)&cipher,
+                                        NULL, NULL, NULL, &protocol);
+        if (name == NULL) {
+            continue;
+        }
+
+        version = gnutls_protocol_get_name(protocol);
+        g_byte_array_append(byte_array, cipher.data, 2);
+        trace_qcrypto_tls_cipher_suite_info(cipher.data[0],
+                                            cipher.data[1],
+                                            version, name);
+    }
+    trace_qcrypto_tls_cipher_suite_count(byte_array->len);
+    gnutls_priority_deinit(pcache);
+
+    return byte_array;
+}
+
+static void qcrypto_tls_cipher_suites_complete(UserCreatable *uc,
+                                               Error **errp)
+{
+    QCryptoTLSCreds *creds = QCRYPTO_TLS_CREDS(uc);
+
+    if (!creds->priority) {
+        error_setg(errp, "'priority' property is not set");
+        return;
+    }
+}
+
+static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
+{
+    UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
+
+    ucc->complete = qcrypto_tls_cipher_suites_complete;
+}
+
+static const TypeInfo qcrypto_tls_cipher_suites_info = {
+    .parent = TYPE_QCRYPTO_TLS_CREDS,
+    .name = TYPE_QCRYPTO_TLS_CIPHER_SUITES,
+    .instance_size = sizeof(QCryptoTLSCreds),
+    .class_size = sizeof(QCryptoTLSCredsClass),
+    .class_init = qcrypto_tls_cipher_suites_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { TYPE_USER_CREATABLE },
+        { }
+    }
+};
+
+static void qcrypto_tls_cipher_suites_register_types(void)
+{
+    type_register_static(&qcrypto_tls_cipher_suites_info);
+}
+
+type_init(qcrypto_tls_cipher_suites_register_types);
diff --git a/crypto/trace-events b/crypto/trace-events
index 9e594d30e8..798b6067ab 100644
--- a/crypto/trace-events
+++ b/crypto/trace-events
@@ -21,3 +21,8 @@ qcrypto_tls_creds_x509_load_cert_list(void *creds, const char *file) "TLS creds
 # tlssession.c
 qcrypto_tls_session_new(void *session, void *creds, const char *hostname, const char *authzid, int endpoint) "TLS session new session=%p creds=%p hostname=%s authzid=%s endpoint=%d"
 qcrypto_tls_session_check_creds(void *session, const char *status) "TLS session check creds session=%p status=%s"
+
+# tls-cipher-suites.c
+qcrypto_tls_cipher_suite_priority(const char *name) "priority: %s"
+qcrypto_tls_cipher_suite_info(uint8_t data0, uint8_t data1, const char *version, const char *name) "data=[0x%02x,0x%02x] version=%s name=%s"
+qcrypto_tls_cipher_suite_count(unsigned count) "count: %u"
diff --git a/include/crypto/tls-cipher-suites.h b/include/crypto/tls-cipher-suites.h
new file mode 100644
index 0000000000..28b3a73ce1
--- /dev/null
+++ b/include/crypto/tls-cipher-suites.h
@@ -0,0 +1,39 @@
+/*
+ * QEMU TLS Cipher Suites Registry (RFC8447)
+ *
+ * Copyright (c) 2018-2020 Red Hat, Inc.
+ *
+ * Author: Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QCRYPTO_TLSCIPHERSUITES_H
+#define QCRYPTO_TLSCIPHERSUITES_H
+
+#include "qom/object.h"
+#include "crypto/tlscreds.h"
+
+#define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites"
+#define QCRYPTO_TLS_CIPHER_SUITES(obj) \
+    OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SUITES)
+
+typedef struct QCryptoTLSCipherSuites {
+    /* <private> */
+    QCryptoTLSCreds parent_obj;
+    /* <public> */
+} QCryptoTLSCipherSuites;
+
+/**
+  * qcrypto_tls_cipher_suites_get_data:
+  * @obj: pointer to a TLS cipher suites object
+  * @errp: pointer to a NULL-initialized error object
+  *
+  * Returns: reference to a byte array containing the data.
+  * The caller should release the reference when no longer
+  * required.
+  */
+GByteArray *qcrypto_tls_cipher_suites_get_data(QCryptoTLSCipherSuites *obj,
+                                               Error **errp);
+
+#endif /* QCRYPTO_TLSCIPHERSUITES_H */
diff --git a/qemu-options.hx b/qemu-options.hx
index 196f468786..ecc4658e1f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4567,6 +4567,25 @@ SRST
         string as described at
         https://gnutls.org/manual/html_node/Priority-Strings.html.
 
+    ``-object tls-cipher-suites,id=id,priority=priority``
+        Creates a TLS cipher suites object, which can be used to control
+        the TLS cipher/protocol algorithms that applications are permitted
+        to use.
+
+        The ``id`` parameter is a unique ID which frontends will use to
+        access the ordered list of permitted TLS cipher suites from the
+        host.
+
+        The ``priority`` parameter allows to override the global default
+        priority used by gnutls. This can be useful if the system
+        administrator needs to use a weaker set of crypto priorities for
+        QEMU without potentially forcing the weakness onto all
+        applications. Or conversely if one wants wants a stronger
+        default for QEMU than for all other applications, they can do
+        this through this parameter. Its format is a gnutls priority
+        string as described at
+        https://gnutls.org/manual/html_node/Priority-Strings.html.
+
     ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
         Interval t can't be 0, this filter batches the packet delivery:
         all packets arriving in a given interval on netdev netdevid are
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:55:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14619.36108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE13-0003yU-H7; Thu, 29 Oct 2020 19:55:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14619.36108; Thu, 29 Oct 2020 19:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE13-0003yM-E5; Thu, 29 Oct 2020 19:55:21 +0000
Received: by outflank-mailman (input) for mailman id 14619;
 Thu, 29 Oct 2020 19:55:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE11-0003yB-AP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 16b4e71a-e27d-4288-9730-253aad8ea8f9;
 Thu, 29 Oct 2020 19:55:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE0z-0005Q8-Sx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE0z-000449-Pn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE11-0003yB-AP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:19 +0000
X-Inumbo-ID: 16b4e71a-e27d-4288-9730-253aad8ea8f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 16b4e71a-e27d-4288-9730-253aad8ea8f9;
	Thu, 29 Oct 2020 19:55:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4dJEt6ramEsoHhy3uu1xUPZm6BDxyQBmaASUtWhe0o4=; b=wvyktp9e6ivN4W2XoXz5QV9zL6
	4O37rH/cMXKaeZ2DeZec0haG0wfL040sIFSD1NDpO8K7LyceBNH+Uw+RFyi4uynrf4o5VVIqMMOBB
	kQnKLnqKnBqfADrrO+lnX3gSWe+A+fEqovI3zqKArlza31uZb3knpKEhKYZg0gO8L/Ds=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE0z-0005Q8-Sx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE0z-000449-Pn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
Message-Id: <E1kYE0z-000449-Pn@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:17 +0000

commit 3203148917d035b09f71986ac2eaa19a352d6d9d
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu May 14 15:15:38 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
    
    The FW_CFG_DATA_GENERATOR allows any object to produce
    blob of data consumable by the fw_cfg device.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-3-philmd@redhat.com>
---
 docs/specs/fw_cfg.txt     |  9 ++++++++-
 hw/nvram/fw_cfg.c         | 35 +++++++++++++++++++++++++++++++++++
 include/hw/nvram/fw_cfg.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 1 deletion(-)

diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
index 8f1ebc66fa..bc16daa38a 100644
--- a/docs/specs/fw_cfg.txt
+++ b/docs/specs/fw_cfg.txt
@@ -219,7 +219,7 @@ To check the result, read the "control" field:
 
 = Externally Provided Items =
 
-As of v2.4, "file" fw_cfg items (i.e., items with selector keys above
+Since v2.4, "file" fw_cfg items (i.e., items with selector keys above
 FW_CFG_FILE_FIRST, and with a corresponding entry in the fw_cfg file
 directory structure) may be inserted via the QEMU command line, using
 the following syntax:
@@ -230,6 +230,13 @@ Or
 
     -fw_cfg [name=]<item_name>,string=<string>
 
+Since v5.1, QEMU allows some objects to generate fw_cfg-specific content,
+the content is then associated with a "file" item using the 'gen_id' option
+in the command line, using the following syntax:
+
+    -object <generator-type>,id=<generated_id>,[generator-specific-options] \
+    -fw_cfg [name=]<item_name>,gen_id=<generated_id>
+
 See QEMU man page for more documentation.
 
 Using item_name with plain ASCII characters only is recommended.
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 0408a31f8e..694722b212 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1032,6 +1032,35 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
     return NULL;
 }
 
+void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+                               const char *gen_id, Error **errp)
+{
+    FWCfgDataGeneratorClass *klass;
+    Error *local_err = NULL;
+    GByteArray *array;
+    Object *obj;
+    gsize size;
+
+    obj = object_resolve_path_component(object_get_objects_root(), gen_id);
+    if (!obj) {
+        error_setg(errp, "Cannot find object ID '%s'", gen_id);
+        return;
+    }
+    if (!object_dynamic_cast(obj, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)) {
+        error_setg(errp, "Object ID '%s' is not a '%s' subclass",
+                   gen_id, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE);
+        return;
+    }
+    klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
+    array = klass->get_data(obj, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+    size = array->len;
+    fw_cfg_add_file(s, filename, g_byte_array_free(array, TRUE), size);
+}
+
 static void fw_cfg_machine_reset(void *opaque)
 {
     MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
@@ -1333,12 +1362,18 @@ static const TypeInfo fw_cfg_mem_info = {
     .class_init    = fw_cfg_mem_class_init,
 };
 
+static const TypeInfo fw_cfg_data_generator_interface_info = {
+    .parent = TYPE_INTERFACE,
+    .name = TYPE_FW_CFG_DATA_GENERATOR_INTERFACE,
+    .class_size = sizeof(FWCfgDataGeneratorClass),
+};
 
 static void fw_cfg_register_types(void)
 {
     type_register_static(&fw_cfg_info);
     type_register_static(&fw_cfg_io_info);
     type_register_static(&fw_cfg_mem_info);
+    type_register_static(&fw_cfg_data_generator_interface_info);
 }
 
 type_init(fw_cfg_register_types)
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 25d9307018..11feae3177 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -9,11 +9,36 @@
 #define TYPE_FW_CFG     "fw_cfg"
 #define TYPE_FW_CFG_IO  "fw_cfg_io"
 #define TYPE_FW_CFG_MEM "fw_cfg_mem"
+#define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator"
 
 #define FW_CFG(obj)     OBJECT_CHECK(FWCfgState,    (obj), TYPE_FW_CFG)
 #define FW_CFG_IO(obj)  OBJECT_CHECK(FWCfgIoState,  (obj), TYPE_FW_CFG_IO)
 #define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM)
 
+#define FW_CFG_DATA_GENERATOR_CLASS(class) \
+    OBJECT_CLASS_CHECK(FWCfgDataGeneratorClass, (class), \
+                       TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)
+#define FW_CFG_DATA_GENERATOR_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(FWCfgDataGeneratorClass, (obj), \
+                     TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)
+
+typedef struct FWCfgDataGeneratorClass {
+    /*< private >*/
+    InterfaceClass parent_class;
+    /*< public >*/
+
+    /**
+     * get_data:
+     * @obj: the object implementing this interface
+     * @errp: pointer to a NULL-initialized error object
+     *
+     * Returns: reference to a byte array containing the data.
+     * The caller should release the reference when no longer
+     * required.
+     */
+    GByteArray *(*get_data)(Object *obj, Error **errp);
+} FWCfgDataGeneratorClass;
+
 typedef struct fw_cfg_file FWCfgFile;
 
 #define FW_CFG_ORDER_OVERRIDE_VGA    70
@@ -263,6 +288,24 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
 void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
                          size_t len);
 
+/**
+ * fw_cfg_add_from_generator:
+ * @s: fw_cfg device being modified
+ * @filename: name of new fw_cfg file item
+ * @gen_id: name of object implementing FW_CFG_DATA_GENERATOR interface
+ * @errp: pointer to a NULL initialized error object
+ *
+ * Add a new NAMED fw_cfg item with the content generated from the
+ * @gen_id object. The data generated by the @gen_id object is copied
+ * into the data structure of the fw_cfg device.
+ * The next available (unused) selector key starting at FW_CFG_FILE_FIRST
+ * will be used; also, a new entry will be added to the file directory
+ * structure residing at key value FW_CFG_FILE_DIR, containing the item name,
+ * data size, and assigned selector key value.
+ */
+void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+                               const char *gen_id, Error **errp);
+
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
                                 AddressSpace *dma_as);
 FWCfgState *fw_cfg_init_io(uint32_t iobase);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:55:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:55:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14620.36112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1C-0003zs-Ic; Thu, 29 Oct 2020 19:55:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14620.36112; Thu, 29 Oct 2020 19:55:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1C-0003zk-Fb; Thu, 29 Oct 2020 19:55:30 +0000
Received: by outflank-mailman (input) for mailman id 14620;
 Thu, 29 Oct 2020 19:55:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1B-0003zY-0v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 126a788e-d4fc-464c-9940-761734ce4293;
 Thu, 29 Oct 2020 19:55:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1A-0005QP-1x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE19-00044s-W1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1B-0003zY-0v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:29 +0000
X-Inumbo-ID: 126a788e-d4fc-464c-9940-761734ce4293
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 126a788e-d4fc-464c-9940-761734ce4293;
	Thu, 29 Oct 2020 19:55:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CZ9oItVx22v04gYbALwdavEw7/n1RsXxJJEQKiFC5W8=; b=ahh/kXXpqL45s35kku5mCurHhI
	YSGjG60DQwkGqGtBvfm87bY+u/7n1gyhgDifBHeQ8m+A+Op3wpIYkeS/cqZ41NRJcaIRokFwl6mCH
	Y4mSL2X5U8/Ab04TnSkk+hlD8suklh5LW1A+Mg5gaCFfP6ecQJS0KP08gna5QtFVzde8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1A-0005QP-1x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE19-00044s-W1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
Message-Id: <E1kYE19-00044s-W1@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:27 +0000

commit 6552d87c48679e1ece2da3ddc0947d2146de53ee
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue May 19 19:20:43 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
    
    The 'gen_id' argument refers to a QOM object able to produce
    data consumable by the fw_cfg device. The producer object must
    implement the FW_CFG_DATA_GENERATOR interface.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-4-philmd@redhat.com>
---
 softmmu/vl.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3e15ee2435..13cada39d6 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -489,6 +489,11 @@ static QemuOptsList qemu_fw_cfg_opts = {
             .name = "string",
             .type = QEMU_OPT_STRING,
             .help = "Sets content of the blob to be inserted from a string",
+        }, {
+            .name = "gen_id",
+            .type = QEMU_OPT_STRING,
+            .help = "Sets id of the object generating the fw_cfg blob "
+                    "to be inserted",
         },
         { /* end of list */ }
     },
@@ -2020,7 +2025,7 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
 {
     gchar *buf;
     size_t size;
-    const char *name, *file, *str;
+    const char *name, *file, *str, *gen_id;
     FWCfgState *fw_cfg = (FWCfgState *) opaque;
 
     if (fw_cfg == NULL) {
@@ -2030,14 +2035,13 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
     name = qemu_opt_get(opts, "name");
     file = qemu_opt_get(opts, "file");
     str = qemu_opt_get(opts, "string");
+    gen_id = qemu_opt_get(opts, "gen_id");
 
-    /* we need name and either a file or the content string */
-    if (!(nonempty_str(name) && (nonempty_str(file) || nonempty_str(str)))) {
-        error_setg(errp, "invalid argument(s)");
-        return -1;
-    }
-    if (nonempty_str(file) && nonempty_str(str)) {
-        error_setg(errp, "file and string are mutually exclusive");
+    /* we need the name, and exactly one of: file, content string, gen_id */
+    if (!nonempty_str(name) ||
+        nonempty_str(file) + nonempty_str(str) + nonempty_str(gen_id) != 1) {
+        error_setg(errp, "name, plus exactly one of file,"
+                         " string and gen_id, are needed");
         return -1;
     }
     if (strlen(name) > FW_CFG_MAX_FILE_PATH - 1) {
@@ -2052,6 +2056,15 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
     if (nonempty_str(str)) {
         size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
         buf = g_memdup(str, size);
+    } else if (nonempty_str(gen_id)) {
+        Error *local_err = NULL;
+
+        fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            return -1;
+        }
+        return 0;
     } else {
         GError *err = NULL;
         if (!g_file_get_contents(file, &buf, &size, &err)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:55:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:55:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14621.36116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1M-00041V-K8; Thu, 29 Oct 2020 19:55:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14621.36116; Thu, 29 Oct 2020 19:55:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1M-00041P-H7; Thu, 29 Oct 2020 19:55:40 +0000
Received: by outflank-mailman (input) for mailman id 14621;
 Thu, 29 Oct 2020 19:55:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1L-00041E-03
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 984466c1-aae2-440b-8067-f3216ec539ee;
 Thu, 29 Oct 2020 19:55:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1K-0005QW-5l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1K-00045T-4x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1L-00041E-03
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:39 +0000
X-Inumbo-ID: 984466c1-aae2-440b-8067-f3216ec539ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 984466c1-aae2-440b-8067-f3216ec539ee;
	Thu, 29 Oct 2020 19:55:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3FFwdWCN2KlS4KDxJ28rirJH3YZ9IhbXdQN1GjbAcMA=; b=ShNEujKamPvw5OZdvY0OZRPFVO
	tJ1dPzghjxMflivm5zNvbc6JULEqCbYZp0OWGtXnwNT3CFdMnQQ1OgYSUIuqfohL9lqzVkgieq0Ai
	5QotEwdvyaEVPrt4Ry4kyUA57DyTkbuid0YKUWmIOdp0O2B4Qr3gaa5zAqbje/kNWjh0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1K-0005QW-5l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1K-00045T-4x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
Message-Id: <E1kYE1K-00045T-4x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:38 +0000

commit f7d8afb16dceb780270960692b949329c8752ff2
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue May 19 19:17:09 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
    
    Names of user-provided fw_cfg items are supposed to start
    with "opt/". However FW_CFG_DATA_GENERATOR items are generated
    by QEMU, so allow the "etc/" namespace in this specific case.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-5-philmd@redhat.com>
---
 docs/specs/fw_cfg.txt | 4 ++++
 softmmu/vl.c          | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
index bc16daa38a..3e6d586f66 100644
--- a/docs/specs/fw_cfg.txt
+++ b/docs/specs/fw_cfg.txt
@@ -258,4 +258,8 @@ Prefix "opt/org.qemu/" is reserved for QEMU itself.
 Use of names not beginning with "opt/" is potentially dangerous and
 entirely unsupported.  QEMU will warn if you try.
 
+Use of names not beginning with "opt/" is tolerated with 'gen_id' (that
+is, the warning is suppressed), but you must know exactly what you're
+doing.
+
 All externally provided fw_cfg items are read-only to the guest.
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 13cada39d6..159f0352a9 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2049,7 +2049,13 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
                    FW_CFG_MAX_FILE_PATH - 1);
         return -1;
     }
-    if (strncmp(name, "opt/", 4) != 0) {
+    if (nonempty_str(gen_id)) {
+        /*
+         * In this particular case where the content is populated
+         * internally, the "etc/" namespace protection is relaxed,
+         * so do not emit a warning.
+         */
+    } else if (strncmp(name, "opt/", 4) != 0) {
         warn_report("externally provided fw_cfg item names "
                     "should be prefixed with \"opt/\"");
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:55:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14622.36120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1W-000434-Lc; Thu, 29 Oct 2020 19:55:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14622.36120; Thu, 29 Oct 2020 19:55:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1W-00042w-Ib; Thu, 29 Oct 2020 19:55:50 +0000
Received: by outflank-mailman (input) for mailman id 14622;
 Thu, 29 Oct 2020 19:55:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1V-00042k-C6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 687d1239-db52-40fd-b606-c1fbe11bb4e8;
 Thu, 29 Oct 2020 19:55:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1U-0005Qi-9i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1U-000466-8k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1V-00042k-C6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:49 +0000
X-Inumbo-ID: 687d1239-db52-40fd-b606-c1fbe11bb4e8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 687d1239-db52-40fd-b606-c1fbe11bb4e8;
	Thu, 29 Oct 2020 19:55:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2jRT7+fZCk5A9R98vFLB69KD3uybIlYtX66gqbyKAvo=; b=qftQ8fsTZoBmTnmj+AaUZJj65A
	2bXHO7pp3aLd56O1eOHhvr0zE/3w9BK8tDUthHEDiV2xmNeOODHk42Z1LCCw2/2mCvL8NTaleDAZU
	IB3CQZWifzBk6iHzvf3Du95RWKoGZjNCSV2D+oYXCHsyFXGcr6zi2dWcSNX30gi5Ozcc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1U-0005Qi-9i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1U-000466-8k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] crypto/tls-cipher-suites: Produce fw_cfg consumable blob
Message-Id: <E1kYE1U-000466-8k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:48 +0000

commit 69699f3055a59e24f1153c329ae6eff4b9a343e0
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu May 14 15:15:47 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    crypto/tls-cipher-suites: Produce fw_cfg consumable blob
    
    Since our format is consumable by the fw_cfg device,
    we can implement the FW_CFG_DATA_GENERATOR interface.
    
    Example of use to dump the cipher suites (if tracing enabled):
    
      $ qemu-system-x86_64 -S \
        -object tls-cipher-suites,id=mysuite1,priority=@SYSTEM \
        -fw_cfg name=etc/path/to/ciphers,gen_id=mysuite1 \
        -trace qcrypto\*
      1590664444.197123:qcrypto_tls_cipher_suite_priority priority: @SYSTEM
      1590664444.197219:qcrypto_tls_cipher_suite_info data=[0x13,0x02] version=TLS1.3 name=TLS_AES_256_GCM_SHA384
      1590664444.197228:qcrypto_tls_cipher_suite_info data=[0x13,0x03] version=TLS1.3 name=TLS_CHACHA20_POLY1305_SHA256
      1590664444.197233:qcrypto_tls_cipher_suite_info data=[0x13,0x01] version=TLS1.3 name=TLS_AES_128_GCM_SHA256
      1590664444.197236:qcrypto_tls_cipher_suite_info data=[0x13,0x04] version=TLS1.3 name=TLS_AES_128_CCM_SHA256
      1590664444.197240:qcrypto_tls_cipher_suite_info data=[0xc0,0x30] version=TLS1.2 name=TLS_ECDHE_RSA_AES_256_GCM_SHA384
      1590664444.197245:qcrypto_tls_cipher_suite_info data=[0xcc,0xa8] version=TLS1.2 name=TLS_ECDHE_RSA_CHACHA20_POLY1305
      1590664444.197250:qcrypto_tls_cipher_suite_info data=[0xc0,0x14] version=TLS1.0 name=TLS_ECDHE_RSA_AES_256_CBC_SHA1
      1590664444.197254:qcrypto_tls_cipher_suite_info data=[0xc0,0x2f] version=TLS1.2 name=TLS_ECDHE_RSA_AES_128_GCM_SHA256
      1590664444.197258:qcrypto_tls_cipher_suite_info data=[0xc0,0x13] version=TLS1.0 name=TLS_ECDHE_RSA_AES_128_CBC_SHA1
      1590664444.197261:qcrypto_tls_cipher_suite_info data=[0xc0,0x2c] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_256_GCM_SHA384
      1590664444.197266:qcrypto_tls_cipher_suite_info data=[0xcc,0xa9] version=TLS1.2 name=TLS_ECDHE_ECDSA_CHACHA20_POLY1305
      1590664444.197270:qcrypto_tls_cipher_suite_info data=[0xc0,0xad] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_256_CCM
      1590664444.197274:qcrypto_tls_cipher_suite_info data=[0xc0,0x0a] version=TLS1.0 name=TLS_ECDHE_ECDSA_AES_256_CBC_SHA1
      1590664444.197278:qcrypto_tls_cipher_suite_info data=[0xc0,0x2b] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_128_GCM_SHA256
      1590664444.197283:qcrypto_tls_cipher_suite_info data=[0xc0,0xac] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_128_CCM
      1590664444.197287:qcrypto_tls_cipher_suite_info data=[0xc0,0x09] version=TLS1.0 name=TLS_ECDHE_ECDSA_AES_128_CBC_SHA1
      1590664444.197291:qcrypto_tls_cipher_suite_info data=[0x00,0x9d] version=TLS1.2 name=TLS_RSA_AES_256_GCM_SHA384
      1590664444.197296:qcrypto_tls_cipher_suite_info data=[0xc0,0x9d] version=TLS1.2 name=TLS_RSA_AES_256_CCM
      1590664444.197300:qcrypto_tls_cipher_suite_info data=[0x00,0x35] version=TLS1.0 name=TLS_RSA_AES_256_CBC_SHA1
      1590664444.197304:qcrypto_tls_cipher_suite_info data=[0x00,0x9c] version=TLS1.2 name=TLS_RSA_AES_128_GCM_SHA256
      1590664444.197308:qcrypto_tls_cipher_suite_info data=[0xc0,0x9c] version=TLS1.2 name=TLS_RSA_AES_128_CCM
      1590664444.197312:qcrypto_tls_cipher_suite_info data=[0x00,0x2f] version=TLS1.0 name=TLS_RSA_AES_128_CBC_SHA1
      1590664444.197316:qcrypto_tls_cipher_suite_info data=[0x00,0x9f] version=TLS1.2 name=TLS_DHE_RSA_AES_256_GCM_SHA384
      1590664444.197320:qcrypto_tls_cipher_suite_info data=[0xcc,0xaa] version=TLS1.2 name=TLS_DHE_RSA_CHACHA20_POLY1305
      1590664444.197325:qcrypto_tls_cipher_suite_info data=[0xc0,0x9f] version=TLS1.2 name=TLS_DHE_RSA_AES_256_CCM
      1590664444.197329:qcrypto_tls_cipher_suite_info data=[0x00,0x39] version=TLS1.0 name=TLS_DHE_RSA_AES_256_CBC_SHA1
      1590664444.197333:qcrypto_tls_cipher_suite_info data=[0x00,0x9e] version=TLS1.2 name=TLS_DHE_RSA_AES_128_GCM_SHA256
      1590664444.197337:qcrypto_tls_cipher_suite_info data=[0xc0,0x9e] version=TLS1.2 name=TLS_DHE_RSA_AES_128_CCM
      1590664444.197341:qcrypto_tls_cipher_suite_info data=[0x00,0x33] version=TLS1.0 name=TLS_DHE_RSA_AES_128_CBC_SHA1
      1590664444.197345:qcrypto_tls_cipher_suite_count count: 29
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Acked-by: Laszlo Ersek <lersek@redhat.com>
    Message-Id: <20200623172726.21040-6-philmd@redhat.com>
---
 crypto/tls-cipher-suites.c | 11 +++++++++++
 qemu-options.hx            | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
index a4e0f84307..0d305b684b 100644
--- a/crypto/tls-cipher-suites.c
+++ b/crypto/tls-cipher-suites.c
@@ -13,6 +13,7 @@
 #include "qom/object_interfaces.h"
 #include "crypto/tlscreds.h"
 #include "crypto/tls-cipher-suites.h"
+#include "hw/nvram/fw_cfg.h"
 #include "trace.h"
 
 /*
@@ -88,11 +89,20 @@ static void qcrypto_tls_cipher_suites_complete(UserCreatable *uc,
     }
 }
 
+static GByteArray *qcrypto_tls_cipher_suites_fw_cfg_gen_data(Object *obj,
+                                                             Error **errp)
+{
+    return qcrypto_tls_cipher_suites_get_data(QCRYPTO_TLS_CIPHER_SUITES(obj),
+                                              errp);
+}
+
 static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
 {
     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
+    FWCfgDataGeneratorClass *fwgc = FW_CFG_DATA_GENERATOR_CLASS(oc);
 
     ucc->complete = qcrypto_tls_cipher_suites_complete;
+    fwgc->get_data = qcrypto_tls_cipher_suites_fw_cfg_gen_data;
 }
 
 static const TypeInfo qcrypto_tls_cipher_suites_info = {
@@ -103,6 +113,7 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = {
     .class_init = qcrypto_tls_cipher_suites_class_init,
     .interfaces = (InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
+        { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE },
         { }
     }
 };
diff --git a/qemu-options.hx b/qemu-options.hx
index ecc4658e1f..b2cbbbf281 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4586,6 +4586,24 @@ SRST
         string as described at
         https://gnutls.org/manual/html_node/Priority-Strings.html.
 
+        An example of use of this object is to control UEFI HTTPS Boot.
+        The tls-cipher-suites object exposes the ordered list of permitted
+        TLS cipher suites from the host side to the guest firmware, via
+        fw_cfg. The list is represented as an array of IANA_TLS_CIPHER
+        objects. The firmware uses the IANA_TLS_CIPHER array for configuring
+        guest-side TLS.
+
+        In the following example, the priority at which the host-side policy
+        is retrieved is given by the ``priority`` property.
+        Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to
+        refer to /etc/crypto-policies/back-ends/gnutls.config.
+
+        .. parsed-literal::
+
+             # |qemu_system| \
+                 -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \
+                 -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0
+
     ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
         Interval t can't be 0, this filter batches the packet delivery:
         all packets arriving in a given interval on netdev netdevid are
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:56:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:56:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14624.36124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1g-000459-NA; Thu, 29 Oct 2020 19:56:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14624.36124; Thu, 29 Oct 2020 19:56:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1g-000451-KB; Thu, 29 Oct 2020 19:56:00 +0000
Received: by outflank-mailman (input) for mailman id 14624;
 Thu, 29 Oct 2020 19:55:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1f-00044o-Jm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5f5076c6-6e86-4ed7-969f-8f9d090f5a02;
 Thu, 29 Oct 2020 19:55:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1e-0005RK-Eh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1e-00046g-DF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1f-00044o-Jm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:59 +0000
X-Inumbo-ID: 5f5076c6-6e86-4ed7-969f-8f9d090f5a02
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5f5076c6-6e86-4ed7-969f-8f9d090f5a02;
	Thu, 29 Oct 2020 19:55:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gSaYkuOuypEZb7MqAW3VnxPNvmgVEOemOdTTS/YfTDk=; b=AqxKJ5rW2JKt9pkxYzocoLish+
	9WmNtk7VyjnZZbPjdJLD9tC/GSh0lkdlcFGwdteX1H102ugKk20cwKMIPdpwlRVVBClg2eGhC4Yon
	Cj9RjxKd7XF/+zg5Iil29a2ZAW4bJMyYDQMyzmTJnYvlSYAllJ/BmOJZu8pjvXUMgnyo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1e-0005RK-Eh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1e-00046g-DF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:55:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200704' into staging
Message-Id: <E1kYE1e-00046g-DF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:55:58 +0000

commit aecdfcc3f8499b34a90e5b21159b4d245bc833c2
Merge: aff2caf6b3fbab1062e117a47b66d27f7fd2f272 69699f3055a59e24f1153c329ae6eff4b9a343e0
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 20:01:43 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 20:01:43 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200704' into staging
    
    firmware (and crypto) patches
    
    - add the tls-cipher-suites object,
    - add the ability to QOM objects to produce data consumable
      by the fw_cfg device,
    - let the tls-cipher-suites object implement the
      FW_CFG_DATA_GENERATOR interface.
    
    This is required by EDK2 'HTTPS Boot' feature of OVMF to tell
    the guest which TLS ciphers it can use.
    
    CI jobs results:
      https://travis-ci.org/github/philmd/qemu/builds/704724619
      https://gitlab.com/philmd/qemu/-/pipelines/162938106
      https://cirrus-ci.com/build/4682977303068672
    
    # gpg: Signature made Sat 04 Jul 2020 17:37:08 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/fw_cfg-20200704:
      crypto/tls-cipher-suites: Produce fw_cfg consumable blob
      softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
      softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
      hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
      crypto: Add tls-cipher-suites object
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 crypto/Makefile.objs               |   1 +
 crypto/tls-cipher-suites.c         | 126 +++++++++++++++++++++++++++++++++++++
 crypto/trace-events                |   5 ++
 docs/specs/fw_cfg.txt              |  13 +++-
 hw/nvram/fw_cfg.c                  |  35 +++++++++++
 include/crypto/tls-cipher-suites.h |  39 ++++++++++++
 include/hw/nvram/fw_cfg.h          |  43 +++++++++++++
 qemu-options.hx                    |  37 +++++++++++
 softmmu/vl.c                       |  37 ++++++++---
 9 files changed, 326 insertions(+), 10 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:56:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:56:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14625.36128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1q-00046h-Px; Thu, 29 Oct 2020 19:56:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14625.36128; Thu, 29 Oct 2020 19:56:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE1q-00046Z-Mx; Thu, 29 Oct 2020 19:56:10 +0000
Received: by outflank-mailman (input) for mailman id 14625;
 Thu, 29 Oct 2020 19:56:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1p-00046O-MU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5557cbbd-ac71-4a1f-a9bf-c39beb662184;
 Thu, 29 Oct 2020 19:56:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1o-0005Ri-Pb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1o-00047j-Oh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1p-00046O-MU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:09 +0000
X-Inumbo-ID: 5557cbbd-ac71-4a1f-a9bf-c39beb662184
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5557cbbd-ac71-4a1f-a9bf-c39beb662184;
	Thu, 29 Oct 2020 19:56:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wZ88ItHq7aAv1+PTqHMoI+y+XyJAihh8af6OM9t7uss=; b=GuEwVg6N35sazxRKwsrj1pWa2t
	gYJNu/1NpRNWN5pAT2OTDO+iM2MqDBWJ7udk2sLvoqANlSLP07SptJXO3ae8wluyafmkRCSBNuqda
	Nvktvbg7NMslhDScwJEKe7cEWkEdIDNxQd5zcGiWOGo8lNYLwkRR7rWA3bGztSt2WG84=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1o-0005Ri-Pb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1o-00047j-Oh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tracetool: work around ust <sys/sdt.h> include conflict
Message-Id: <E1kYE1o-00047j-Oh@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:56:08 +0000

commit 27e08bab94f7c6ebe0b75938c98c394c969e3fd8
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Thu Jun 25 15:07:57 2020 +0100
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Tue Jul 7 16:07:14 2020 +0100

    tracetool: work around ust <sys/sdt.h> include conflict
    
    Both the dtrace and ust backends may include <sys/sdt.h> but LTTng
    Userspace Tracer 2.11 and later requires SDT_USE_VARIADIC to be defined
    before including the header file.
    
    This is a classic problem with C header files included from different
    parts of a program. If the same header is included twice within the same
    compilation unit then the first inclusion determines the macro
    environment.
    
    Work around this by defining SDT_USE_VARIADIC in the dtrace backend too.
    It doesn't hurt and fixes a missing STAP_PROBEV() compiler error when
    the ust backend is enabled together with the dtrace backend.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 20200625140757.237012-1-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool/backend/dtrace.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 5711892ba0..b7fe4c1b50 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -40,6 +40,12 @@ def generate_h_begin(events, group):
     else:
         header = "trace-dtrace.h"
 
+    # Workaround for ust backend, which also includes <sys/sdt.h> and may
+    # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h>
+    # first without defining SDT_USE_VARIADIC then ust breaks because the
+    # STAP_PROBEV() macro is not defined.
+    out('#define SDT_USE_VARIADIC 1')
+
     out('#include "%s"' % header,
         '')
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:56:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:56:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14626.36132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE20-00047y-RO; Thu, 29 Oct 2020 19:56:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14626.36132; Thu, 29 Oct 2020 19:56:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE20-00047q-OP; Thu, 29 Oct 2020 19:56:20 +0000
Received: by outflank-mailman (input) for mailman id 14626;
 Thu, 29 Oct 2020 19:56:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE1z-00047g-Ry
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a0fd6470-e73e-4a27-b132-9adfdc3e553e;
 Thu, 29 Oct 2020 19:56:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1y-0005Rv-UF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE1y-000496-Ss
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE1z-00047g-Ry
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:19 +0000
X-Inumbo-ID: a0fd6470-e73e-4a27-b132-9adfdc3e553e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a0fd6470-e73e-4a27-b132-9adfdc3e553e;
	Thu, 29 Oct 2020 19:56:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KMrBigowHoubEPCM1O5FQSF7XW4X1oogkCtJ70+zI44=; b=PXpMTPSldCVAm73WBymZJ3PZ0K
	HKBTdJluEz5Ab13+a2ueNxODGo8eP5o2q3Z9F7s5+JTsX8eRAwZh7eg03NfjXrHrGP/nz+WhocCzw
	Fm4q9SiAblN7NnizC4oHBopH2g28GCmIdahNeImLePwy4ECImZo1sU+PhN6dKjhRdkik=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1y-0005Rv-UF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE1y-000496-Ss
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Message-Id: <E1kYE1y-000496-Ss@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:56:18 +0000

commit b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf
Merge: aecdfcc3f8499b34a90e5b21159b4d245bc833c2 27e08bab94f7c6ebe0b75938c98c394c969e3fd8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 09:01:28 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 09:01:28 2020 +0100

    Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
    
    Pull request
    
    Fix for a LTTng Userspace Tracer header problem.
    
    # gpg: Signature made Tue 07 Jul 2020 16:10:04 BST
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
    
    * remotes/stefanha/tags/tracing-pull-request:
      tracetool: work around ust <sys/sdt.h> include conflict
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/tracetool/backend/dtrace.py | 6 ++++++
 1 file changed, 6 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 19:56:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 19:56:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14628.36139 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE2G-0004A8-Uf; Thu, 29 Oct 2020 19:56:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14628.36139; Thu, 29 Oct 2020 19:56:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE2G-0004A1-Qs; Thu, 29 Oct 2020 19:56:36 +0000
Received: by outflank-mailman (input) for mailman id 14628;
 Thu, 29 Oct 2020 19:56:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE2G-00049w-4N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f4ae4e52-2995-4667-b35b-0953fc8f0db1;
 Thu, 29 Oct 2020 19:56:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE29-0005S6-Ue
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE29-0004BK-To
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE2G-00049w-4N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:36 +0000
X-Inumbo-ID: f4ae4e52-2995-4667-b35b-0953fc8f0db1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f4ae4e52-2995-4667-b35b-0953fc8f0db1;
	Thu, 29 Oct 2020 19:56:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gk7qfmo9P/MWu+j90IbSnjIoTaEKYaI64j7wL7WsmdU=; b=HQ7VB+X2GC0wBU5wMpQYg5X3u8
	8EOotwq19nxGjANzscT/zvds4+RtL8FOFQn6OtxA1Re1k2IgbegOdDCSyvDSTd8GZN9cmhZGsGMJv
	40CyjuPerVLBuxGhS5btCqkhzkBiP81PcQ/7y+6lsjZH8s+biI4qfTOw/TVU0wyRA1nM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE29-0005S6-Ue
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE29-0004BK-To
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 19:56:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' into staging
Message-Id: <E1kYE29-0004BK-To@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 19:56:29 +0000

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

commit f2a1cf9180f63e88bb38ff21c169da97c3f2bad5
Merge: b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf 1de7096d8378a57e2d75d9cacc9a119e7e41640d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 14:41:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 14:41:23 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' into staging
    
    Error reporting patches patches for 2020-07-07
    
    # gpg: Signature made Fri 10 Jul 2020 14:24:42 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-error-2020-07-07-v2: (53 commits)
      xen: Use ERRP_GUARD()
      nbd: Use ERRP_GUARD()
      virtio-9p: Use ERRP_GUARD()
      fw_cfg: Use ERRP_GUARD()
      pflash: Use ERRP_GUARD()
      sd: Use ERRP_GUARD()
      scripts: Coccinelle script to use ERRP_GUARD()
      error: New macro ERRP_GUARD()
      hmp: Ignore Error objects where the return value suffices
      qdev: Ignore Error objects where the return value suffices
      qemu-img: Ignore Error objects where the return value suffices
      error: Avoid error_propagate() after migrate_add_blocker()
      qapi: Purge error_propagate() from QAPI core
      qapi: Smooth visitor error checking in generated code
      qapi: Smooth another visitor error checking pattern
      block/parallels: Simplify parallels_open() after previous commit
      error: Reduce unnecessary error propagation
      error: Eliminate error_propagate() manually
      error: Eliminate error_propagate() with Coccinelle, part 2
      error: Eliminate error_propagate() with Coccinelle, part 1
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                              |   1 +
 accel/kvm/kvm-all.c                      |  55 +++--
 accel/tcg/tcg-all.c                      |   5 +-
 audio/audio_legacy.c                     |  15 +-
 backends/cryptodev-vhost-user.c          |   3 +-
 backends/cryptodev.c                     |  16 +-
 backends/hostmem-file.c                  |  22 +-
 backends/hostmem-memfd.c                 |  18 +-
 backends/hostmem.c                       |  33 ++-
 backends/rng.c                           |   2 +-
 backends/tpm/tpm_util.c                  |   5 +-
 block.c                                  |  21 +-
 block/blkdebug.c                         |   9 +-
 block/blklogwrites.c                     |   4 +-
 block/blkverify.c                        |   4 +-
 block/crypto.c                           |   5 +-
 block/curl.c                             |   5 +-
 block/file-posix.c                       |  16 +-
 block/file-win32.c                       |   8 +-
 block/gluster.c                          |  17 +-
 block/iscsi.c                            |   4 +-
 block/nbd.c                              |  17 +-
 block/nfs.c                              |   7 +-
 block/parallels.c                        |  29 +--
 block/qcow.c                             |  16 +-
 block/qcow2.c                            |  21 +-
 block/qed.c                              |  10 +-
 block/quorum.c                           |  19 +-
 block/raw-format.c                       |   5 +-
 block/rbd.c                              |   7 +-
 block/replication.c                      |  19 +-
 block/sheepdog.c                         |  16 +-
 block/ssh.c                              |  11 +-
 block/throttle-groups.c                  |  31 +--
 block/throttle.c                         |   5 +-
 block/vdi.c                              |  13 +-
 block/vhdx.c                             |  15 +-
 block/vmdk.c                             |  13 +-
 block/vpc.c                              |  19 +-
 block/vvfat.c                            |  10 +-
 block/vxhs.c                             |  15 +-
 blockdev.c                               |  40 ++--
 bootdevice.c                             |  13 +-
 chardev/char.c                           |   6 +-
 contrib/ivshmem-server/main.c            |   4 +-
 crypto/secret.c                          |   2 +-
 crypto/secret_keyring.c                  |   2 +-
 crypto/tlscredsanon.c                    |   2 +-
 crypto/tlscredspsk.c                     |   2 +-
 crypto/tlscredsx509.c                    |   2 +-
 docs/devel/qapi-code-gen.txt             | 103 ++++------
 dump/dump.c                              |   7 +-
 hw/9pfs/9p-local.c                       |  12 +-
 hw/9pfs/9p.c                             |   1 +
 hw/acpi/core.c                           |  19 +-
 hw/acpi/cpu_hotplug.c                    |   4 +-
 hw/acpi/ich9.c                           |   2 +-
 hw/acpi/piix4.c                          |   2 +-
 hw/arm/allwinner-a10.c                   |  27 +--
 hw/arm/armsse.c                          | 208 ++++++-------------
 hw/arm/armv7m.c                          |  47 ++---
 hw/arm/aspeed.c                          |  24 +--
 hw/arm/aspeed_ast2600.c                  | 124 ++++--------
 hw/arm/aspeed_soc.c                      |  85 +++-----
 hw/arm/bcm2835_peripherals.c             |  81 ++------
 hw/arm/bcm2836.c                         |  35 +---
 hw/arm/cubieboard.c                      |  14 +-
 hw/arm/digic.c                           |  18 +-
 hw/arm/digic_boards.c                    |   3 +-
 hw/arm/exynos4210.c                      |  13 +-
 hw/arm/fsl-imx25.c                       |  58 ++----
 hw/arm/fsl-imx31.c                       |  34 +---
 hw/arm/fsl-imx6.c                        |  85 +++-----
 hw/arm/fsl-imx6ul.c                      |  29 ++-
 hw/arm/fsl-imx7.c                        |  31 ++-
 hw/arm/highbank.c                        |  12 +-
 hw/arm/integratorcp.c                    |   2 +-
 hw/arm/mcimx6ul-evk.c                    |   4 +-
 hw/arm/microbit.c                        |   4 +-
 hw/arm/mps2-tz.c                         |  31 ++-
 hw/arm/mps2.c                            |  12 +-
 hw/arm/msf2-soc.c                        |  29 +--
 hw/arm/musca.c                           |  18 +-
 hw/arm/musicpal.c                        |   4 +-
 hw/arm/nrf51_soc.c                       |  36 +---
 hw/arm/orangepi.c                        |  13 +-
 hw/arm/raspi.c                           |   2 +-
 hw/arm/realview.c                        |   6 +-
 hw/arm/sbsa-ref.c                        |  16 +-
 hw/arm/stellaris.c                       |   4 +-
 hw/arm/stm32f205_soc.c                   |  37 +---
 hw/arm/stm32f405_soc.c                   |  48 ++---
 hw/arm/versatilepb.c                     |   4 +-
 hw/arm/vexpress.c                        |   8 +-
 hw/arm/virt.c                            |  44 ++--
 hw/arm/xilinx_zynq.c                     |   6 +-
 hw/arm/xlnx-versal-virt.c                |   8 +-
 hw/arm/xlnx-versal.c                     |  30 ++-
 hw/arm/xlnx-zcu102.c                     |   8 +-
 hw/arm/xlnx-zynqmp.c                     | 117 ++++-------
 hw/block/dataplane/xen-block.c           |  17 +-
 hw/block/fdc.c                           |  12 +-
 hw/block/pflash_cfi01.c                  |   7 +-
 hw/block/pflash_cfi02.c                  |   7 +-
 hw/block/xen-block.c                     | 124 +++++-------
 hw/char/serial-pci-multi.c               |   5 +-
 hw/char/serial-pci.c                     |   5 +-
 hw/char/serial.c                         |  10 +-
 hw/core/bus.c                            |  12 +-
 hw/core/cpu.c                            |   3 +-
 hw/core/machine.c                        |   5 +-
 hw/core/numa.c                           |  55 ++---
 hw/core/platform-bus.c                   |   6 +-
 hw/core/qdev-properties-system.c         |  32 +--
 hw/core/qdev-properties.c                |  95 +++------
 hw/core/qdev.c                           |  16 +-
 hw/cpu/a15mpcore.c                       |   5 +-
 hw/cpu/a9mpcore.c                        |  21 +-
 hw/cpu/arm11mpcore.c                     |  17 +-
 hw/cpu/core.c                            |  10 +-
 hw/cpu/realview_mpcore.c                 |   9 +-
 hw/display/bcm2835_fb.c                  |   8 +-
 hw/display/virtio-gpu-base.c             |   5 +-
 hw/display/virtio-gpu-pci.c              |  11 +-
 hw/display/virtio-vga.c                  |  10 +-
 hw/dma/bcm2835_dma.c                     |   9 +-
 hw/dma/sparc32_dma.c                     |   6 +-
 hw/dma/xilinx_axidma.c                   |   4 +-
 hw/gpio/aspeed_gpio.c                    |   5 +-
 hw/gpio/bcm2835_gpio.c                   |  15 +-
 hw/hyperv/vmbus.c                        |   5 +-
 hw/i386/pc.c                             |  48 ++---
 hw/i386/pc_piix.c                        |   4 +-
 hw/i386/pc_q35.c                         |  28 +--
 hw/i386/x86.c                            |   7 +-
 hw/ide/qdev.c                            |   7 +-
 hw/intc/apic_common.c                    |   5 +-
 hw/intc/arm_gic_kvm.c                    |   4 +-
 hw/intc/arm_gicv3_its_kvm.c              |   5 +-
 hw/intc/arm_gicv3_kvm.c                  |   4 +-
 hw/intc/armv7m_nvic.c                    |   9 +-
 hw/intc/nios2_iic.c                      |  10 +-
 hw/intc/pnv_xive.c                       |  17 +-
 hw/intc/realview_gic.c                   |   5 +-
 hw/intc/spapr_xive.c                     |  17 +-
 hw/intc/xics.c                           |   9 +-
 hw/intc/xics_kvm.c                       |   4 +-
 hw/intc/xive.c                           |  17 +-
 hw/isa/piix4.c                           |   5 +-
 hw/m68k/q800.c                           |   4 +-
 hw/mem/nvdimm.c                          |  30 +--
 hw/mem/pc-dimm.c                         |  18 +-
 hw/microblaze/petalogix_ml605_mmu.c      |  24 +--
 hw/microblaze/petalogix_s3adsp1800_mmu.c |   2 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |  39 ++--
 hw/mips/boston.c                         |   4 +-
 hw/mips/cps.c                            |  41 ++--
 hw/mips/jazz.c                           |   4 +-
 hw/mips/malta.c                          |   4 +-
 hw/misc/aspeed_sdmc.c                    |   8 +-
 hw/misc/bcm2835_mbox.c                   |   9 +-
 hw/misc/bcm2835_property.c               |  17 +-
 hw/misc/iotkit-sysctl.c                  |   2 +-
 hw/misc/ivshmem.c                        |   4 +-
 hw/misc/macio/cuda.c                     |   5 +-
 hw/misc/macio/macio.c                    |  35 ++--
 hw/misc/macio/pmu.c                      |   5 +-
 hw/misc/pca9552.c                        |   5 +-
 hw/misc/tmp105.c                         |   5 +-
 hw/misc/tmp421.c                         |   5 +-
 hw/net/ne2000-isa.c                      |   7 +-
 hw/net/virtio-net.c                      |   7 +-
 hw/net/xilinx_axienet.c                  |   4 +-
 hw/nvram/fw_cfg.c                        |  21 +-
 hw/pci-host/pnv_phb3.c                   |  33 ++-
 hw/pci-host/pnv_phb4.c                   |   9 +-
 hw/pci-host/pnv_phb4_pec.c               |   9 +-
 hw/pci-host/prep.c                       |   4 +-
 hw/pci-host/xen_igd_pt.c                 |   7 +-
 hw/ppc/e500.c                            |   5 +-
 hw/ppc/mac_newworld.c                    |  10 +-
 hw/ppc/mac_oldworld.c                    |   4 +-
 hw/ppc/pnv.c                             | 171 +++++++---------
 hw/ppc/pnv_core.c                        |   4 +-
 hw/ppc/pnv_psi.c                         |  22 +-
 hw/ppc/rs6000_mc.c                       |   9 +-
 hw/ppc/spapr.c                           |  77 +++----
 hw/ppc/spapr_caps.c                      |  15 +-
 hw/ppc/spapr_cpu_core.c                  |  15 +-
 hw/ppc/spapr_drc.c                       |  16 +-
 hw/ppc/spapr_hcall.c                     |   3 +-
 hw/ppc/spapr_irq.c                       |  11 +-
 hw/ppc/spapr_pci.c                       |  16 +-
 hw/ppc/spapr_pci_nvlink2.c               |   3 +-
 hw/riscv/opentitan.c                     |  13 +-
 hw/riscv/sifive_e.c                      |  10 +-
 hw/riscv/sifive_u.c                      |  11 +-
 hw/riscv/spike.c                         |   4 +-
 hw/riscv/virt.c                          |   4 +-
 hw/rx/rx-gdbsim.c                        |  12 +-
 hw/s390x/css.c                           |   5 +-
 hw/s390x/event-facility.c                |  13 +-
 hw/s390x/ipl.c                           |  27 ++-
 hw/s390x/s390-pci-bus.c                  |  14 +-
 hw/s390x/s390-skeys.c                    |   2 +-
 hw/s390x/s390-stattrib.c                 |   2 +-
 hw/s390x/s390-virtio-ccw.c               |  20 +-
 hw/s390x/sclp.c                          |  13 +-
 hw/s390x/virtio-ccw-crypto.c             |  10 +-
 hw/s390x/virtio-ccw-rng.c                |   8 +-
 hw/scsi/scsi-bus.c                       |  15 +-
 hw/scsi/vhost-scsi.c                     |   4 +-
 hw/sd/aspeed_sdhci.c                     |  15 +-
 hw/sd/sd.c                               |   3 +-
 hw/sd/sdhci-pci.c                        |   7 +-
 hw/sd/sdhci.c                            |  21 +-
 hw/sd/ssi-sd.c                           |  15 +-
 hw/smbios/smbios.c                       |  33 +--
 hw/sparc/sun4m.c                         |   2 +-
 hw/sparc64/sun4u.c                       |   2 +-
 hw/usb/bus.c                             |   7 +-
 hw/usb/dev-storage.c                     |   9 +-
 hw/usb/hcd-dwc2.c                        |   9 +-
 hw/vfio/pci-quirks.c                     |   5 +-
 hw/vfio/pci.c                            |  10 +-
 hw/virtio/virtio-balloon.c               |  17 +-
 hw/virtio/virtio-crypto-pci.c            |   9 +-
 hw/virtio/virtio-iommu-pci.c             |   4 +-
 hw/virtio/virtio-mem-pci.c               |   4 +-
 hw/virtio/virtio-pmem-pci.c              |   2 +-
 hw/virtio/virtio-rng-pci.c               |   8 +-
 hw/virtio/virtio-rng.c                   |  11 +-
 hw/xen/xen-backend.c                     |   7 +-
 hw/xen/xen-bus.c                         |  92 ++++-----
 hw/xen/xen-host-pci-device.c             |  27 ++-
 hw/xen/xen_pt.c                          |  25 +--
 hw/xen/xen_pt_config_init.c              |  20 +-
 include/block/nbd.h                      |   1 +
 include/hw/audio/pcspk.h                 |   2 +-
 include/hw/qdev-properties.h             |   4 +-
 include/qapi/clone-visitor.h             |   8 +-
 include/qapi/error.h                     | 261 +++++++++++++++++++++---
 include/qapi/visitor-impl.h              |  26 +--
 include/qapi/visitor.h                   | 102 ++++++----
 include/qemu/option.h                    |  16 +-
 include/qom/object.h                     | 104 +++++-----
 include/qom/object_interfaces.h          |  12 +-
 include/qom/qom-qobject.h                |   9 +-
 iothread.c                               |  18 +-
 linux-user/syscall.c                     |   2 +-
 monitor/hmp-cmds.c                       |  11 +-
 monitor/monitor.c                        |  19 +-
 nbd/client.c                             |   5 +
 nbd/server.c                             |   5 +
 net/colo-compare.c                       |  26 +--
 net/dump.c                               |  13 +-
 net/filter-buffer.c                      |  13 +-
 net/filter.c                             |   2 +-
 net/net.c                                |  10 +-
 net/tap.c                                |   6 +-
 qapi/opts-visitor.c                      |  66 +++---
 qapi/qapi-clone-visitor.c                |  45 +++--
 qapi/qapi-dealloc-visitor.c              |  27 ++-
 qapi/qapi-visit-core.c                   | 197 +++++++++---------
 qapi/qobject-input-visitor.c             | 109 ++++++----
 qapi/qobject-output-visitor.c            |  27 ++-
 qapi/string-input-visitor.c              |  67 +++---
 qapi/string-output-visitor.c             |  32 +--
 qdev-monitor.c                           |  39 ++--
 qemu-img.c                               |  31 +--
 qga/commands-posix.c                     |   4 +-
 qga/commands-win32.c                     |  22 +-
 qom/object.c                             | 244 +++++++++++-----------
 qom/object_interfaces.c                  |  30 +--
 qom/qom-hmp-cmds.c                       |   2 +-
 qom/qom-qmp-cmds.c                       |   2 +-
 qom/qom-qobject.c                        |  14 +-
 scripts/coccinelle/errp-guard.cocci      | 336 +++++++++++++++++++++++++++++++
 scripts/qapi/commands.py                 |  22 +-
 scripts/qapi/visit.py                    | 107 ++++------
 softmmu/vl.c                             |  17 +-
 target/arm/cpu64.c                       |  15 +-
 target/arm/monitor.c                     |   7 +-
 target/i386/cpu.c                        |  98 ++++-----
 target/ppc/compat.c                      |   5 +-
 target/ppc/translate_init.inc.c          |   2 +-
 target/s390x/cpu_models.c                |  17 +-
 target/sparc/cpu.c                       |   5 +-
 tpm.c                                    |   5 +-
 ui/console.c                             |   4 +-
 ui/vnc.c                                 |   2 +-
 util/main-loop.c                         |   4 +-
 util/qemu-config.c                       |  25 +--
 util/qemu-option.c                       | 255 ++++++++++++-----------
 294 files changed, 3052 insertions(+), 3774 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f01284ebce..6aa54f7f8f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2176,6 +2176,7 @@ F: scripts/coccinelle/error-use-after-free.cocci
 F: scripts/coccinelle/error_propagate_null.cocci
 F: scripts/coccinelle/remove_local_err.cocci
 F: scripts/coccinelle/use-error_fatal.cocci
+F: scripts/coccinelle/errp-guard.cocci
 
 GDB stub
 M: Alex Bennée <alex.bennee@linaro.org>
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index ab36fbfa0c..63ef6af9a1 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -3113,12 +3113,9 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v,
                                    Error **errp)
 {
     KVMState *s = KVM_STATE(obj);
-    Error *error = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!visit_type_int(v, name, &value, errp)) {
         return;
     }
 
@@ -3129,37 +3126,33 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
                                    const char *name, void *opaque,
                                    Error **errp)
 {
-    Error *err = NULL;
     KVMState *s = KVM_STATE(obj);
     OnOffSplit mode;
 
-    visit_type_OnOffSplit(v, name, &mode, &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
         return;
-    } else {
-        switch (mode) {
-        case ON_OFF_SPLIT_ON:
-            s->kernel_irqchip_allowed = true;
-            s->kernel_irqchip_required = true;
-            s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
-            break;
-        case ON_OFF_SPLIT_OFF:
-            s->kernel_irqchip_allowed = false;
-            s->kernel_irqchip_required = false;
-            s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
-            break;
-        case ON_OFF_SPLIT_SPLIT:
-            s->kernel_irqchip_allowed = true;
-            s->kernel_irqchip_required = true;
-            s->kernel_irqchip_split = ON_OFF_AUTO_ON;
-            break;
-        default:
-            /* The value was checked in visit_type_OnOffSplit() above. If
-             * we get here, then something is wrong in QEMU.
-             */
-            abort();
-        }
+    }
+    switch (mode) {
+    case ON_OFF_SPLIT_ON:
+        s->kernel_irqchip_allowed = true;
+        s->kernel_irqchip_required = true;
+        s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
+        break;
+    case ON_OFF_SPLIT_OFF:
+        s->kernel_irqchip_allowed = false;
+        s->kernel_irqchip_required = false;
+        s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
+        break;
+    case ON_OFF_SPLIT_SPLIT:
+        s->kernel_irqchip_allowed = true;
+        s->kernel_irqchip_required = true;
+        s->kernel_irqchip_split = ON_OFF_AUTO_ON;
+        break;
+    default:
+        /* The value was checked in visit_type_OnOffSplit() above. If
+         * we get here, then something is wrong in QEMU.
+         */
+        abort();
     }
 }
 
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 3b4fda5640..eace2c113b 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -182,12 +182,9 @@ static void tcg_set_tb_size(Object *obj, Visitor *v,
                             Error **errp)
 {
     TCGState *s = TCG_STATE(obj);
-    Error *error = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!visit_type_uint32(v, name, &value, errp)) {
         return;
     }
 
diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c
index ebd7d9fa0d..ffdbd0bcce 100644
--- a/audio/audio_legacy.c
+++ b/audio/audio_legacy.c
@@ -421,11 +421,12 @@ typedef struct {
     GList *path;
 } LegacyPrintVisitor;
 
-static void lv_start_struct(Visitor *v, const char *name, void **obj,
+static bool lv_start_struct(Visitor *v, const char *name, void **obj,
                             size_t size, Error **errp)
 {
     LegacyPrintVisitor *lv = (LegacyPrintVisitor *) v;
     lv->path = g_list_append(lv->path, g_strdup(name));
+    return true;
 }
 
 static void lv_end_struct(Visitor *v, void **obj)
@@ -453,27 +454,30 @@ static void lv_print_key(Visitor *v, const char *name)
     printf("%s=", name);
 }
 
-static void lv_type_int64(Visitor *v, const char *name, int64_t *obj,
+static bool lv_type_int64(Visitor *v, const char *name, int64_t *obj,
                           Error **errp)
 {
     lv_print_key(v, name);
     printf("%" PRIi64, *obj);
+    return true;
 }
 
-static void lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
+static bool lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
                            Error **errp)
 {
     lv_print_key(v, name);
     printf("%" PRIu64, *obj);
+    return true;
 }
 
-static void lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
+static bool lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
 {
     lv_print_key(v, name);
     printf("%s", *obj ? "on" : "off");
+    return true;
 }
 
-static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
+static bool lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
 {
     const char *str = *obj;
     lv_print_key(v, name);
@@ -484,6 +488,7 @@ static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
         }
         putchar(*str++);
     }
+    return true;
 }
 
 static void lv_complete(Visitor *v, void *opaque)
diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c
index 8b8cbc4223..dbe5a8aae6 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -209,8 +209,7 @@ static void cryptodev_vhost_user_init(
         backend->conf.peers.ccs[i] = cc;
 
         if (i == 0) {
-            if (!qemu_chr_fe_init(&s->chr, chr, &local_err)) {
-                error_propagate(errp, local_err);
+            if (!qemu_chr_fe_init(&s->chr, chr, errp)) {
                 return;
             }
         }
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index a3841c4e41..ada4ebe78b 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -154,21 +154,17 @@ cryptodev_backend_set_queues(Object *obj, Visitor *v, const char *name,
                              void *opaque, Error **errp)
 {
     CryptoDevBackend *backend = CRYPTODEV_BACKEND(obj);
-    Error *local_err = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_uint32(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
-                   PRIu32 "'", object_get_typename(obj), name, value);
-        goto out;
+        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu32 "'",
+                   object_get_typename(obj), name, value);
+        return;
     }
     backend->conf.peers.queues = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
@@ -215,7 +211,7 @@ static void cryptodev_backend_instance_init(Object *obj)
                           cryptodev_backend_set_queues,
                           NULL, NULL);
     /* Initialize devices' queues property to 1 */
-    object_property_set_int(obj, 1, "queues", NULL);
+    object_property_set_int(obj, "queues", 1, NULL);
 }
 
 static void cryptodev_backend_finalize(Object *obj)
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index cdabb412e6..5b819020b4 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -110,23 +110,18 @@ static void file_memory_backend_set_align(Object *o, Visitor *v,
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(o);
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
-    Error *local_err = NULL;
     uint64_t val;
 
     if (host_memory_backend_mr_inited(backend)) {
-        error_setg(&local_err, "cannot change property '%s' of %s",
-                   name, object_get_typename(o));
-        goto out;
+        error_setg(errp, "cannot change property '%s' of %s", name,
+                   object_get_typename(o));
+        return;
     }
 
-    visit_type_size(v, name, &val, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &val, errp)) {
+        return;
     }
     fb->align = val;
-
- out:
-    error_propagate(errp, local_err);
 }
 
 static bool file_memory_backend_get_pmem(Object *o, Error **errp)
@@ -140,7 +135,6 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
 
     if (host_memory_backend_mr_inited(backend)) {
-
         error_setg(errp, "cannot change property 'pmem' of %s.",
                    object_get_typename(o));
         return;
@@ -148,13 +142,9 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
 
 #ifndef CONFIG_LIBPMEM
     if (value) {
-        Error *local_err = NULL;
-
-        error_setg(&local_err,
-                   "Lack of libpmem support while setting the 'pmem=on'"
+        error_setg(errp, "Lack of libpmem support while setting the 'pmem=on'"
                    " of %s. We can't ensure data persistence.",
                    object_get_typename(o));
-        error_propagate(errp, local_err);
         return;
     }
 #endif
diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index 1b5e4bfe0d..4c040a7541 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -77,26 +77,22 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, const char *name,
                               void *opaque, Error **errp)
 {
     HostMemoryBackendMemfd *m = MEMORY_BACKEND_MEMFD(obj);
-    Error *local_err = NULL;
     uint64_t value;
 
     if (host_memory_backend_mr_inited(MEMORY_BACKEND(obj))) {
-        error_setg(&local_err, "cannot change property value");
-        goto out;
+        error_setg(errp, "cannot change property value");
+        return;
     }
 
-    visit_type_size(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
-                   PRIu64 "'", object_get_typename(obj), name, value);
-        goto out;
+        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu64 "'",
+                   object_get_typename(obj), name, value);
+        return;
     }
     m->hugetlbsize = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 61e3255f5c..c614f1bdc1 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -54,28 +54,24 @@ host_memory_backend_set_size(Object *obj, Visitor *v, const char *name,
                              void *opaque, Error **errp)
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-    Error *local_err = NULL;
     uint64_t value;
 
     if (host_memory_backend_mr_inited(backend)) {
-        error_setg(&local_err, "cannot change property %s of %s ",
-                   name, object_get_typename(obj));
-        goto out;
+        error_setg(errp, "cannot change property %s of %s ", name,
+                   object_get_typename(obj));
+        return;
     }
 
-    visit_type_size(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err,
+        error_setg(errp,
                    "property '%s' of %s doesn't take value '%" PRIu64 "'",
                    name, object_get_typename(obj), value);
-        goto out;
+        return;
     }
     backend->size = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
@@ -254,22 +250,17 @@ static void host_memory_backend_set_prealloc_threads(Object *obj, Visitor *v,
     const char *name, void *opaque, Error **errp)
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-    Error *local_err = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_uint32(v, name, &value, errp)) {
+        return;
     }
     if (value <= 0) {
-        error_setg(&local_err,
-                   "property '%s' of %s doesn't take value '%d'",
-                   name, object_get_typename(obj), value);
-        goto out;
+        error_setg(errp, "property '%s' of %s doesn't take value '%d'", name,
+                   object_get_typename(obj), value);
+        return;
     }
     backend->prealloc_threads = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void host_memory_backend_init(Object *obj)
diff --git a/backends/rng.c b/backends/rng.c
index 597f0ec268..484f04e891 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -48,7 +48,7 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
 
 static void rng_backend_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "opened", errp);
+    object_property_set_bool(OBJECT(uc), "opened", true, errp);
 }
 
 static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
index cfc7572a61..b58d298c1a 100644
--- a/backends/tpm/tpm_util.c
+++ b/backends/tpm/tpm_util.c
@@ -48,7 +48,6 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
                     Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     Property *prop = opaque;
     TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
     char *str;
@@ -58,9 +57,7 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_str(v, name, &str, errp)) {
         return;
     }
 
diff --git a/block.c b/block.c
index 62e40db2f1..3031413deb 100644
--- a/block.c
+++ b/block.c
@@ -1629,9 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
     assert(options != NULL && bs->options != options);
 
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail_opts;
     }
@@ -4091,9 +4089,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
 
     /* Process generic block layer options */
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
         ret = -EINVAL;
         goto error;
     }
@@ -5665,10 +5661,9 @@ static void coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs,
     if (bs->open_flags & BDRV_O_INACTIVE) {
         bs->open_flags &= ~BDRV_O_INACTIVE;
         bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
-        ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, &local_err);
+        ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, errp);
         if (ret < 0) {
             bs->open_flags |= BDRV_O_INACTIVE;
-            error_propagate(errp, local_err);
             return;
         }
         bdrv_set_perm(bs, perm, shared_perm);
@@ -6063,8 +6058,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
 
     /* Parse -o options */
     if (options) {
-        qemu_opts_do_parse(opts, options, NULL, &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, options, NULL, errp)) {
             goto out;
         }
     }
@@ -6077,8 +6071,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_filename) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
+                          NULL)) {
             error_setg(errp, "Backing file not supported for file format '%s'",
                        fmt);
             goto out;
@@ -6086,8 +6080,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_fmt) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, NULL)) {
             error_setg(errp, "Backing file format not supported for file "
                              "format '%s'", fmt);
             goto out;
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 7194bc7f06..9c08d8a005 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -359,7 +359,6 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
     QObject *crumpled_subqdict = NULL;
     Visitor *v = NULL;
     BlockPermissionList *perm_list = NULL, *element;
-    Error *local_err = NULL;
 
     *dest = 0;
 
@@ -375,9 +374,7 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
     }
 
     v = qobject_input_visitor_new(crumpled_subqdict);
-    visit_type_BlockPermissionList(v, NULL, &perm_list, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_BlockPermissionList(v, NULL, &perm_list, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -472,9 +469,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t align;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index 6753bd9a3e..57315f56b4 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -149,10 +149,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
     bool log_append;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
diff --git a/block/blkverify.c b/block/blkverify.c
index 2f261de24b..4aed53ab59 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -116,9 +116,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
     int ret;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/crypto.c b/block/crypto.c
index 2636e959ae..8725c1bc02 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -260,7 +260,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
 {
     BlockCrypto *crypto = bs->opaque;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     int ret = -EINVAL;
     QCryptoBlockOpenOptions *open_opts = NULL;
     unsigned int cflags = 0;
@@ -276,9 +275,7 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
         bs->file->bs->supported_write_flags;
 
     opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto cleanup;
     }
 
diff --git a/block/curl.c b/block/curl.c
index 6e325901dc..4f907c47be 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -669,7 +669,6 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
     BDRVCURLState *s = bs->opaque;
     CURLState *state = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *file;
     const char *cookie;
     const char *cookie_secret;
@@ -695,9 +694,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
 
     qemu_mutex_init(&s->mutex);
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto out_noclean;
     }
 
diff --git a/block/file-posix.c b/block/file-posix.c
index d86ea57769..1989eae85f 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -490,9 +490,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     OnOffAuto locking;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1000,9 +998,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
     /* Handle options changes */
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, state->options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, state->options, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -3333,7 +3329,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
 #if defined(__APPLE__) && defined(__MACH__)
@@ -3398,9 +3393,8 @@ hdev_open_Mac_error:
 
     s->type = FTYPE_FILE;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
 #if defined(__APPLE__) && defined(__MACH__)
         if (*bsd_path) {
             filename = bsd_path;
@@ -3676,14 +3670,12 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
                       Error **errp)
 {
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
     s->type = FTYPE_CD;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret) {
-        error_propagate(errp, local_err);
         return ret;
     }
 
diff --git a/block/file-win32.c b/block/file-win32.c
index 221aaf713e..ab69bd811a 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -338,9 +338,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
     s->type = FTYPE_FILE;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -739,9 +737,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
 
     QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0,
                                       &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto done;
     }
diff --git a/block/gluster.c b/block/gluster.c
index 31233cac69..4f1448e2bc 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -523,8 +523,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
     /* create opts info from runtime_json_opts list */
     opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto out;
     }
 
@@ -555,8 +554,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
         /* create opts info from runtime_type_opts list */
         opts = qemu_opts_create(&runtime_type_opts, NULL, 0, &error_abort);
-        qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-        if (local_err) {
+        if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
             goto out;
         }
 
@@ -586,8 +584,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         if (gsconf->type == SOCKET_ADDRESS_TYPE_INET) {
             /* create opts info from runtime_inet_opts list */
             opts = qemu_opts_create(&runtime_inet_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
                 goto out;
             }
 
@@ -635,8 +632,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         } else {
             /* create opts info from runtime_unix_opts list */
             opts = qemu_opts_create(&runtime_unix_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
                 goto out;
             }
 
@@ -815,13 +811,10 @@ static int qemu_gluster_open(BlockDriverState *bs,  QDict *options,
     int ret = 0;
     BlockdevOptionsGluster *gconf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *filename, *logfile;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/iscsi.c b/block/iscsi.c
index 767e3e75fd..6c2e353e1a 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1792,9 +1792,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     int i, ret = 0, timeout = 0, lun;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/nbd.c b/block/nbd.c
index eed160c5cd..c297336ffc 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1408,16 +1408,15 @@ static void nbd_client_close(BlockDriverState *bs)
 static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
                                                   Error **errp)
 {
+    ERRP_GUARD();
     QIOChannelSocket *sioc;
-    Error *local_err = NULL;
 
     sioc = qio_channel_socket_new();
     qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");
 
-    qio_channel_socket_connect_sync(sioc, saddr, &local_err);
-    if (local_err) {
+    qio_channel_socket_connect_sync(sioc, saddr, errp);
+    if (*errp) {
         object_unref(OBJECT(sioc));
-        error_propagate(errp, local_err);
         return NULL;
     }
 
@@ -1726,7 +1725,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
     SocketAddress *saddr = NULL;
     QDict *addr = NULL;
     Visitor *iv = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &addr, "server.");
     if (!qdict_size(addr)) {
@@ -1739,9 +1737,7 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
         goto done;
     }
 
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
         goto done;
     }
 
@@ -1836,13 +1832,10 @@ static int nbd_process_options(BlockDriverState *bs, QDict *options,
 {
     BDRVNBDState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret = -EINVAL;
 
     opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto error;
     }
 
diff --git a/block/nfs.c b/block/nfs.c
index b1718d125a..61a249a9fc 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -563,18 +563,15 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
     BlockdevOptionsNfs *opts = NULL;
     Visitor *v;
     const QDictEntry *e;
-    Error *local_err = NULL;
 
     v = qobject_input_visitor_new_flat_confused(options, errp);
     if (!v) {
         return NULL;
     }
 
-    visit_type_BlockdevOptionsNfs(v, NULL, &opts, &local_err);
+    visit_type_BlockdevOptionsNfs(v, NULL, &opts, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!opts) {
         return NULL;
     }
 
diff --git a/block/parallels.c b/block/parallels.c
index 63a1cde8af..3c22dfdc9d 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -625,7 +625,6 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
                                                  Error **errp)
 {
     BlockdevCreateOptions *create_options = NULL;
-    Error *local_err = NULL;
     BlockDriverState *bs = NULL;
     QDict *qdict;
     Visitor *v;
@@ -646,9 +645,8 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto done;
     }
 
@@ -669,11 +667,9 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
         goto done;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto done;
     }
@@ -824,13 +820,12 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
         }
     }
 
-    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, &local_err);
-    if (local_err != NULL) {
+    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, errp);
+    if (!opts) {
         goto fail_options;
     }
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail_options;
     }
 
@@ -844,6 +839,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
                                        &local_err);
     g_free(buf);
     if (local_err != NULL) {
+        error_propagate(errp, local_err);
         goto fail_options;
     }
 
@@ -863,9 +859,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The Parallels format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -874,15 +869,11 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
 
 fail_format:
     error_setg(errp, "Image not in Parallels format");
+fail_options:
     ret = -EINVAL;
 fail:
     qemu_vfree(s->header);
     return ret;
-
-fail_options:
-    error_propagate(errp, local_err);
-    ret = -EINVAL;
-    goto fail;
 }
 
 
diff --git a/block/qcow.c b/block/qcow.c
index ee5d35fe20..1e134f3445 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -121,7 +121,6 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     unsigned int len, i, shift;
     int ret;
     QCowHeader header;
-    Error *local_err = NULL;
     QCryptoBlockOpenOptions *crypto_opts = NULL;
     unsigned int cflags = 0;
     QDict *encryptopts = NULL;
@@ -314,9 +313,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The qcow format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -943,7 +941,6 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     const char *val;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -973,9 +970,8 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -996,11 +992,9 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/qcow2.c b/block/qcow2.c
index 38198b4e75..ea33673c55 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -990,9 +990,7 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
     encryptfmt = qdict_get_try_str(encryptopts, "format");
 
     opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1596,8 +1594,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
 
     /* read qcow2 extensions */
     if (qcow2_read_extensions(bs, header.header_length, ext_end, NULL,
-                              flags, &update_header, &local_err)) {
-        error_propagate(errp, local_err);
+                              flags, &update_header, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -3358,7 +3355,6 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     int version;
     int refcount_order;
     uint64_t* refcount_table;
-    Error *local_err = NULL;
     int ret;
     uint8_t compression_type = QCOW2_COMPRESSION_TYPE_ZLIB;
 
@@ -3584,9 +3580,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     }
     blk = blk_new_open(NULL, NULL, options,
                        BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto out;
     }
@@ -3666,9 +3661,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     }
     blk = blk_new_open(NULL, NULL, options,
                        BDRV_O_RDWR | BDRV_O_NO_BACKING | BDRV_O_NO_IO,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto out;
     }
@@ -3691,7 +3685,6 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
     Visitor *v;
     BlockDriverState *bs = NULL;
     BlockDriverState *data_bs = NULL;
-    Error *local_err = NULL;
     const char *val;
     int ret;
 
@@ -3787,11 +3780,9 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
         goto finish;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto finish;
     }
diff --git a/block/qed.c b/block/qed.c
index ece8b9bb60..b27e7546ca 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -729,7 +729,6 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -749,9 +748,8 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -772,11 +770,9 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/quorum.c b/block/quorum.c
index 7cf7ab1546..6df9449fc2 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -910,27 +910,25 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     /* count how many different children are present */
     s->num_children = qdict_array_entries(options, "children.");
     if (s->num_children < 0) {
-        error_setg(&local_err, "Option children is not a valid array");
+        error_setg(errp, "Option children is not a valid array");
         ret = -EINVAL;
         goto exit;
     }
     if (s->num_children < 1) {
-        error_setg(&local_err,
-                   "Number of provided children must be 1 or more");
+        error_setg(errp, "Number of provided children must be 1 or more");
         ret = -EINVAL;
         goto exit;
     }
 
     opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto exit;
     }
 
     s->threshold = qemu_opt_get_number(opts, QUORUM_OPT_VOTE_THRESHOLD, 0);
     /* and validate it against s->num_children */
-    ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
+    ret = quorum_valid_threshold(s->threshold, s->num_children, errp);
     if (ret < 0) {
         goto exit;
     }
@@ -943,7 +941,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                               -EINVAL, NULL);
     }
     if (ret < 0) {
-        error_setg(&local_err, "Please set read-pattern as fifo or quorum");
+        error_setg(errp, "Please set read-pattern as fifo or quorum");
         goto exit;
     }
     s->read_pattern = ret;
@@ -951,7 +949,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
         s->is_blkverify = qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false);
         if (s->is_blkverify && (s->num_children != 2 || s->threshold != 2)) {
-            error_setg(&local_err, "blkverify=on can only be set if there are "
+            error_setg(errp, "blkverify=on can only be set if there are "
                        "exactly two files and vote-threshold is 2");
             ret = -EINVAL;
             goto exit;
@@ -960,7 +958,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
         s->rewrite_corrupted = qemu_opt_get_bool(opts, QUORUM_OPT_REWRITE,
                                                  false);
         if (s->rewrite_corrupted && s->is_blkverify) {
-            error_setg(&local_err,
+            error_setg(errp,
                        "rewrite-corrupted=on cannot be used with blkverify=on");
             ret = -EINVAL;
             goto exit;
@@ -980,6 +978,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                                          &child_of_bds, BDRV_CHILD_DATA, false,
                                          &local_err);
         if (local_err) {
+            error_propagate(errp, local_err);
             ret = -EINVAL;
             goto close_exit;
         }
@@ -1005,8 +1004,6 @@ close_exit:
     g_free(opened);
 exit:
     qemu_opts_del(opts);
-    /* propagate error */
-    error_propagate(errp, local_err);
     return ret;
 }
 
diff --git a/block/raw-format.c b/block/raw-format.c
index 233d019ca3..42ec50802b 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -74,14 +74,11 @@ static QemuOptsList raw_create_opts = {
 static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size,
                             uint64_t *size, Error **errp)
 {
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     int ret;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto end;
     }
diff --git a/block/rbd.c b/block/rbd.c
index 617553b022..688074c64b 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -681,7 +681,6 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
                                     Error **errp)
 {
     Visitor *v;
-    Error *local_err = NULL;
 
     /* Convert the remaining options into a QAPI object */
     v = qobject_input_visitor_new_flat_confused(options, errp);
@@ -689,11 +688,9 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
         return -EINVAL;
     }
 
-    visit_type_BlockdevOptionsRbd(v, NULL, opts, &local_err);
+    visit_type_BlockdevOptionsRbd(v, NULL, opts, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!opts) {
         return -EINVAL;
     }
 
diff --git a/block/replication.c b/block/replication.c
index ccf7b78160..0c70215784 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -85,7 +85,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 {
     int ret;
     BDRVReplicationState *s = bs->opaque;
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     const char *mode;
     const char *top_id;
@@ -99,14 +98,13 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
     ret = -EINVAL;
     opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail;
     }
 
     mode = qemu_opt_get(opts, REPLICATION_MODE);
     if (!mode) {
-        error_setg(&local_err, "Missing the option mode");
+        error_setg(errp, "Missing the option mode");
         goto fail;
     }
 
@@ -114,7 +112,8 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         s->mode = REPLICATION_MODE_PRIMARY;
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         if (top_id) {
-            error_setg(&local_err, "The primary side does not support option top-id");
+            error_setg(errp,
+                       "The primary side does not support option top-id");
             goto fail;
         }
     } else if (!strcmp(mode, "secondary")) {
@@ -122,11 +121,11 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         s->top_id = g_strdup(top_id);
         if (!s->top_id) {
-            error_setg(&local_err, "Missing the option top-id");
+            error_setg(errp, "Missing the option top-id");
             goto fail;
         }
     } else {
-        error_setg(&local_err,
+        error_setg(errp,
                    "The option mode's value should be primary or secondary");
         goto fail;
     }
@@ -137,8 +136,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
 fail:
     qemu_opts_del(opts);
-    error_propagate(errp, local_err);
-
     return ret;
 }
 
@@ -369,7 +366,6 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
 {
     BDRVReplicationState *s = bs->opaque;
     BlockReopenQueue *reopen_queue = NULL;
-    Error *local_err = NULL;
 
     if (writable) {
         s->orig_hidden_read_only = bdrv_is_read_only(s->hidden_disk->bs);
@@ -394,8 +390,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
     }
 
     if (reopen_queue) {
-        bdrv_reopen_multiple(reopen_queue, &local_err);
-        error_propagate(errp, local_err);
+        bdrv_reopen_multiple(reopen_queue, errp);
     }
 
     bdrv_subtree_drained_end(s->hidden_disk->bs);
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 27a30d17f4..6c487c8322 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -532,7 +532,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
     QDict *server = NULL;
     Visitor *iv = NULL;
     SocketAddress *saddr = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &server, "server.");
 
@@ -541,9 +540,7 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
         goto done;
     }
 
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
         goto done;
     }
 
@@ -1550,15 +1547,12 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t snap_id;
     char *buf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
 
     s->bs = bs;
     s->aio_context = bdrv_get_aio_context(bs);
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto err_no_fd;
     }
@@ -2199,11 +2193,9 @@ static int coroutine_fn sd_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/ssh.c b/block/ssh.c
index 098dbe03c1..ebe3d8b631 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -616,15 +616,12 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
 {
     BlockdevOptionsSsh *result = NULL;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     const QDictEntry *e;
     Visitor *v;
 
     /* Translate legacy options */
     opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail;
     }
 
@@ -638,11 +635,9 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
         goto fail;
     }
 
-    visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
+    visit_type_BlockdevOptionsSsh(v, NULL, &result, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!result) {
         goto fail;
     }
 
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 784fa4a16c..03a53c89ea 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -811,7 +811,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
     ThrottleGroup *tg = THROTTLE_GROUP(obj);
     ThrottleConfig *cfg;
     ThrottleParamInfo *info = opaque;
-    Error *local_err = NULL;
     int64_t value;
 
     /* If we have finished initialization, don't accept individual property
@@ -819,17 +818,16 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
      * transaction, as certain combinations are invalid.
      */
     if (tg->is_initialized) {
-        error_setg(&local_err, "Property cannot be set after initialization");
-        goto ret;
+        error_setg(errp, "Property cannot be set after initialization");
+        return;
     }
 
-    visit_type_int64(v, name, &value, &local_err);
-    if (local_err) {
-        goto ret;
+    if (!visit_type_int64(v, name, &value, errp)) {
+        return;
     }
     if (value < 0) {
-        error_setg(&local_err, "Property values cannot be negative");
-        goto ret;
+        error_setg(errp, "Property values cannot be negative");
+        return;
     }
 
     cfg = &tg->ts.cfg;
@@ -842,9 +840,9 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
         break;
     case BURST_LENGTH:
         if (value > UINT_MAX) {
-            error_setg(&local_err, "%s value must be in the"
-                       "range [0, %u]", info->name, UINT_MAX);
-            goto ret;
+            error_setg(errp, "%s value must be in the" "range [0, %u]",
+                       info->name, UINT_MAX);
+            return;
         }
         cfg->buckets[info->type].burst_length = value;
         break;
@@ -852,11 +850,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
         cfg->op_size = value;
         break;
     }
-
-ret:
-    error_propagate(errp, local_err);
-    return;
-
 }
 
 static void throttle_group_get(Object *obj, Visitor *v, const char *name,
@@ -896,9 +889,8 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
     ThrottleLimits *argp;
     Error *local_err = NULL;
 
-    visit_type_ThrottleLimits(v, name, &argp, &local_err);
-    if (local_err) {
-        goto ret;
+    if (!visit_type_ThrottleLimits(v, name, &argp, errp)) {
+        return;
     }
     qemu_mutex_lock(&tg->lock);
     throttle_get_config(&tg->ts, &cfg);
@@ -910,7 +902,6 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
 
 unlock:
     qemu_mutex_unlock(&tg->lock);
-ret:
     qapi_free_ThrottleLimits(argp);
     error_propagate(errp, local_err);
     return;
diff --git a/block/throttle.c b/block/throttle.c
index 0ebbad0743..1c1ac57bee 100644
--- a/block/throttle.c
+++ b/block/throttle.c
@@ -46,12 +46,9 @@ static int throttle_parse_options(QDict *options, char **group, Error **errp)
 {
     int ret;
     const char *group_name;
-    Error *local_err = NULL;
     QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fin;
     }
diff --git a/block/vdi.c b/block/vdi.c
index c4527a9d8c..5627e7d764 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -374,7 +374,6 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
     VdiHeader header;
     size_t bmap_size;
     int ret;
-    Error *local_err = NULL;
     QemuUUID uuid_link, uuid_parent;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
@@ -495,9 +494,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vdi format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail_free_bmap;
     }
@@ -906,7 +904,6 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
     uint64_t block_size = DEFAULT_CLUSTER_SIZE;
     bool is_static = false;
     Visitor *v;
-    Error *local_err = NULL;
     int ret;
 
     /* Parse options and convert legacy syntax.
@@ -957,11 +954,9 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
         ret = -EINVAL;
         goto done;
     }
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto done;
     }
diff --git a/block/vhdx.c b/block/vhdx.c
index 645dc4b4f4..791eb90263 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1089,9 +1089,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -2064,7 +2063,6 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -2083,9 +2081,8 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -2106,11 +2103,9 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/vmdk.c b/block/vmdk.c
index 62da465126..28cec50f38 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1263,7 +1263,6 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
     int ret;
     BDRVVmdkState *s = bs->opaque;
     uint32_t magic;
-    Error *local_err = NULL;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
                                BDRV_CHILD_IMAGE, false, errp);
@@ -1317,9 +1316,8 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -2250,19 +2248,16 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
 {
     int ret;
     BlockBackend *blk = NULL;
-    Error *local_err = NULL;
 
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto exit;
     }
 
     blk = blk_new_open(filename, NULL, NULL,
                        BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto exit;
     }
diff --git a/block/vpc.c b/block/vpc.c
index 01fcd37e3c..890554277e 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -235,9 +235,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     opts = qemu_opts_create(&vpc_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -448,9 +446,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vpc format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -1097,7 +1094,6 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -1114,9 +1110,8 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -1137,11 +1132,9 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/vvfat.c b/block/vvfat.c
index 2eb8cbb19f..36b53c8757 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1141,7 +1141,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
     bool floppy;
     const char *dirname, *label;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
 
 #ifdef DEBUG
@@ -1149,9 +1148,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
 #endif
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1269,9 +1266,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
                    "The vvfat (rw) format used by node '%s' "
                    "does not support live migration",
                    bdrv_get_device_or_node_name(bs));
-        ret = migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        ret = migrate_add_blocker(s->migration_blocker, errp);
+        if (ret < 0) {
             error_free(s->migration_blocker);
             goto fail;
         }
diff --git a/block/vxhs.c b/block/vxhs.c
index d79fc97df6..dc0e254730 100644
--- a/block/vxhs.c
+++ b/block/vxhs.c
@@ -318,8 +318,7 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
     tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -327,14 +326,14 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     /* vdisk-id is the disk UUID */
     vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID);
     if (!vdisk_id_opt) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
+        error_setg(errp, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
         ret = -EINVAL;
         goto out;
     }
 
     /* vdisk-id may contain a leading '/' */
     if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) {
-        error_setg(&local_err, "vdisk-id cannot be more than %d characters",
+        error_setg(errp, "vdisk-id cannot be more than %d characters",
                    UUID_FMT_LEN);
         ret = -EINVAL;
         goto out;
@@ -346,22 +345,21 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     /* get the 'server.' arguments */
     qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
 
-    qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) {
         ret = -EINVAL;
         goto out;
     }
 
     server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST);
     if (!server_host_opt) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER,
+        error_setg(errp, QERR_MISSING_PARAMETER,
                    VXHS_OPT_SERVER"."VXHS_OPT_HOST);
         ret = -EINVAL;
         goto out;
     }
 
     if (strlen(server_host_opt) > MAXHOSTNAMELEN) {
-        error_setg(&local_err, "server.host cannot be more than %d characters",
+        error_setg(errp, "server.host cannot be more than %d characters",
                    MAXHOSTNAMELEN);
         ret = -EINVAL;
         goto out;
@@ -414,7 +412,6 @@ out:
 
     if (ret < 0) {
         vxhs_unref();
-        error_propagate(errp, local_err);
         g_free(s->vdisk_hostinfo.host);
         g_free(s->vdisk_guid);
         g_free(s->tlscredsid);
diff --git a/blockdev.c b/blockdev.c
index 31d5eaf6bf..59b0b8ffaf 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -504,15 +504,12 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
     /* Check common options by copying from bs_opts to opts, all other options
      * stay in bs_opts for processing by bdrv_open(). */
     id = qdict_get_try_str(bs_opts, "id");
-    opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
-    if (error) {
-        error_propagate(errp, error);
+    opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, errp);
+    if (!opts) {
         goto err_no_opts;
     }
 
-    qemu_opts_absorb_qdict(opts, bs_opts, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!qemu_opts_absorb_qdict(opts, bs_opts, errp)) {
         goto early_err;
     }
 
@@ -706,7 +703,7 @@ BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
               : QTAILQ_FIRST(&monitor_bdrv_states);
 }
 
-static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
+static bool qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
                             Error **errp)
 {
     const char *value;
@@ -716,7 +713,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
         if (qemu_opt_find(opts, to)) {
             error_setg(errp, "'%s' and its alias '%s' can't be used at the "
                        "same time", to, from);
-            return;
+            return false;
         }
     }
 
@@ -725,6 +722,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
         qemu_opt_set(opts, to, value, &error_abort);
         qemu_opt_unset(opts, from);
     }
+    return true;
 }
 
 QemuOptsList qemu_legacy_drive_opts = {
@@ -795,7 +793,6 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     bool read_only = false;
     bool copy_on_read;
     const char *filename;
-    Error *local_err = NULL;
     int i;
 
     /* Change legacy command line options into QMP ones */
@@ -827,10 +824,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     };
 
     for (i = 0; i < ARRAY_SIZE(opt_renames); i++) {
-        qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
-                        &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (!qemu_opt_rename(all_opts, opt_renames[i].from,
+                             opt_renames[i].to, errp)) {
             return NULL;
         }
     }
@@ -867,9 +862,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
 
     legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 0,
                                    &error_abort);
-    qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(legacy_opts, bs_opts, errp)) {
         goto fail;
     }
 
@@ -1009,13 +1002,10 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     }
 
     /* Actual block device init: Functionality shared with blockdev-add */
-    blk = blockdev_init(filename, bs_opts, &local_err);
+    blk = blockdev_init(filename, bs_opts, errp);
     bs_opts = NULL;
     if (!blk) {
-        error_propagate(errp, local_err);
         goto fail;
-    } else {
-        assert(!local_err);
     }
 
     /* Create legacy DriveInfo */
@@ -3147,9 +3137,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
                            arg->has_copy_mode, arg->copy_mode,
                            arg->has_auto_finalize, arg->auto_finalize,
                            arg->has_auto_dismiss, arg->auto_dismiss,
-                           &local_err);
+                           errp);
     bdrv_unref(target_bs);
-    error_propagate(errp, local_err);
 out:
     aio_context_release(aio_context);
 }
@@ -3177,7 +3166,6 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
     AioContext *aio_context;
     AioContext *old_context;
     BlockMirrorBackingMode backing_mode = MIRROR_LEAVE_BACKING_CHAIN;
-    Error *local_err = NULL;
     bool zero_target;
     int ret;
 
@@ -3219,8 +3207,7 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
                            has_copy_mode, copy_mode,
                            has_auto_finalize, auto_finalize,
                            has_auto_dismiss, auto_dismiss,
-                           &local_err);
-    error_propagate(errp, local_err);
+                           errp);
 out:
     aio_context_release(aio_context);
 }
@@ -3439,8 +3426,7 @@ void qmp_change_backing_file(const char *device,
     }
 
     if (ro) {
-        bdrv_reopen_set_read_only(image_bs, true, &local_err);
-        error_propagate(errp, local_err);
+        bdrv_reopen_set_read_only(image_bs, true, errp);
     }
 
 out:
diff --git a/bootdevice.c b/bootdevice.c
index 0ff55e2b79..add4e3d2d1 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -297,22 +297,19 @@ static void device_set_bootindex(Object *obj, Visitor *v, const char *name,
     int32_t boot_index;
     Error *local_err = NULL;
 
-    visit_type_int32(v, name, &boot_index, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_int32(v, name, &boot_index, errp)) {
+        return;
     }
     /* check whether bootindex is present in fw_boot_order list  */
     check_boot_index(boot_index, &local_err);
     if (local_err) {
-        goto out;
+        error_propagate(errp, local_err);
+        return;
     }
     /* change bootindex to a new one */
     *prop->bootindex = boot_index;
 
     add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);
-
-out:
-    error_propagate(errp, local_err);
 }
 
 static void property_release_bootindex(Object *obj, const char *name,
@@ -342,7 +339,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         prop);
 
     /* initialize devices' bootindex property to -1 */
-    object_property_set_int(obj, -1, name, NULL);
+    object_property_set_int(obj, name, -1, NULL);
 }
 
 typedef struct FWLCHSEntry FWLCHSEntry;
diff --git a/chardev/char.c b/chardev/char.c
index df697f3ce9..e5b43cb4b8 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -444,8 +444,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
         qemu_opt_set(opts, "host", host, &error_abort);
         qemu_opt_set(opts, "port", port, &error_abort);
         if (p[pos] == ',') {
-            qemu_opts_do_parse(opts, p+pos+1, NULL, &local_err);
-            if (local_err) {
+            if (!qemu_opts_do_parse(opts, p + pos + 1, NULL, &local_err)) {
                 error_report_err(local_err);
                 goto fail;
             }
@@ -484,8 +483,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
     }
     if (strstart(filename, "unix:", &p)) {
         qemu_opt_set(opts, "backend", "socket", &error_abort);
-        qemu_opts_do_parse(opts, p, "path", &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, p, "path", &local_err)) {
             error_report_err(local_err);
             goto fail;
         }
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index e4cd35f74c..ee08c4ced0 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -103,8 +103,8 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
             break;
 
         case 'l': /* shm size */
-            parse_option_size("shm_size", optarg, &args->shm_size, &err);
-            if (err) {
+            if (!parse_option_size("shm_size", optarg, &args->shm_size,
+                                   &err)) {
                 error_report_err(err);
                 ivshmem_server_help(argv[0]);
                 exit(1);
diff --git a/crypto/secret.c b/crypto/secret.c
index 3447e2f64b..281cb81f0f 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -110,7 +110,7 @@ qcrypto_secret_prop_get_file(Object *obj,
 static void
 qcrypto_secret_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c
index 4f132d6370..8bfc58ebf4 100644
--- a/crypto/secret_keyring.c
+++ b/crypto/secret_keyring.c
@@ -105,7 +105,7 @@ qcrypto_secret_prop_get_key(Object *obj, Visitor *v,
 static void
 qcrypto_secret_keyring_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index fc078d5b97..30275b6847 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -165,7 +165,7 @@ qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c
index f01b64d8bc..e26807b899 100644
--- a/crypto/tlscredspsk.c
+++ b/crypto/tlscredspsk.c
@@ -234,7 +234,7 @@ qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index e337d68c4f..dd7267ccdb 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -774,7 +774,7 @@ qcrypto_tls_creds_x509_prop_get_sanity(Object *obj,
 static void
 qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index a7794ef658..69eede6c28 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -1408,105 +1408,87 @@ Example:
     #include "example-qapi-types.h"
 
 
-    void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
-    void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
-    void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
+    bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
+    bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
+    bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
 
-    void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
+    bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
 
     #endif /* EXAMPLE_QAPI_VISIT_H */
     $ cat qapi-generated/example-qapi-visit.c
 [Uninteresting stuff omitted...]
 
-    void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
+    bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
     {
-        Error *err = NULL;
-
-        visit_type_int(v, "integer", &obj->integer, &err);
-        if (err) {
-            goto out;
+        if (!visit_type_int(v, "integer", &obj->integer, errp)) {
+            return false;
         }
         if (visit_optional(v, "string", &obj->has_string)) {
-            visit_type_str(v, "string", &obj->string, &err);
-            if (err) {
-                goto out;
+            if (!visit_type_str(v, "string", &obj->string, errp)) {
+                return false;
             }
         }
-
-    out:
-        error_propagate(errp, err);
+        return true;
     }
 
-    void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
+    bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
     {
-        Error *err = NULL;
+        bool ok = false;
 
-        visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), &err);
-        if (err) {
-            goto out;
+        if (!visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), errp)) {
+            return false;
         }
         if (!*obj) {
             /* incomplete */
             assert(visit_is_dealloc(v));
             goto out_obj;
         }
-        visit_type_UserDefOne_members(v, *obj, &err);
-        if (err) {
+        if (!visit_type_UserDefOne_members(v, *obj, errp)) {
             goto out_obj;
         }
-        visit_check_struct(v, &err);
+        ok = visit_check_struct(v, errp);
     out_obj:
         visit_end_struct(v, (void **)obj);
-        if (err && visit_is_input(v)) {
+        if (!ok && visit_is_input(v)) {
             qapi_free_UserDefOne(*obj);
             *obj = NULL;
         }
-    out:
-        error_propagate(errp, err);
+        return ok;
     }
 
-    void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
+    bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
     {
-        Error *err = NULL;
+        bool ok = false;
         UserDefOneList *tail;
         size_t size = sizeof(**obj);
 
-        visit_start_list(v, name, (GenericList **)obj, size, &err);
-        if (err) {
-            goto out;
+        if (!visit_start_list(v, name, (GenericList **)obj, size, errp)) {
+            return false;
         }
 
         for (tail = *obj; tail;
              tail = (UserDefOneList *)visit_next_list(v, (GenericList *)tail, size)) {
-            visit_type_UserDefOne(v, NULL, &tail->value, &err);
-            if (err) {
-                break;
+            if (!visit_type_UserDefOne(v, NULL, &tail->value, errp)) {
+                goto out_obj;
             }
         }
 
-        if (!err) {
-            visit_check_list(v, &err);
-        }
+        ok = visit_check_list(v, errp);
+    out_obj:
         visit_end_list(v, (void **)obj);
-        if (err && visit_is_input(v)) {
+        if (!ok && visit_is_input(v)) {
             qapi_free_UserDefOneList(*obj);
             *obj = NULL;
         }
-    out:
-        error_propagate(errp, err);
+        return ok;
     }
 
-    void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
+    bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
     {
-        Error *err = NULL;
-
-        visit_type_UserDefOneList(v, "arg1", &obj->arg1, &err);
-        if (err) {
-            goto out;
+        if (!visit_type_UserDefOneList(v, "arg1", &obj->arg1, errp)) {
+            return false;
         }
-
-    out:
-        error_propagate(errp, err);
+        return true;
     }
 
 [Uninteresting stuff omitted...]
@@ -1561,15 +1543,12 @@ Example:
 
     static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject **ret_out, Error **errp)
     {
-        Error *err = NULL;
         Visitor *v;
 
         v = qobject_output_visitor_new(ret_out);
-        visit_type_UserDefOne(v, "unused", &ret_in, &err);
-        if (!err) {
+        if (visit_type_UserDefOne(v, "unused", &ret_in, errp)) {
             visit_complete(v, ret_out);
         }
-        error_propagate(errp, err);
         visit_free(v);
         v = qapi_dealloc_visitor_new();
         visit_type_UserDefOne(v, "unused", &ret_in, NULL);
@@ -1579,33 +1558,32 @@ Example:
     void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp)
     {
         Error *err = NULL;
+        bool ok = false;
         Visitor *v;
         UserDefOne *retval;
         q_obj_my_command_arg arg = {0};
 
         v = qobject_input_visitor_new(QOBJECT(args));
-        visit_start_struct(v, NULL, NULL, 0, &err);
-        if (err) {
+        if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
             goto out;
         }
-        visit_type_q_obj_my_command_arg_members(v, &arg, &err);
-        if (!err) {
-            visit_check_struct(v, &err);
+        if (visit_type_q_obj_my_command_arg_members(v, &arg, errp)) {
+            ok = visit_check_struct(v, errp);
         }
         visit_end_struct(v, NULL);
-        if (err) {
+        if (!ok) {
             goto out;
         }
 
         retval = qmp_my_command(arg.arg1, &err);
+        error_propagate(errp, err);
         if (err) {
             goto out;
         }
 
-        qmp_marshal_output_UserDefOne(retval, ret, &err);
+        qmp_marshal_output_UserDefOne(retval, ret, errp);
 
     out:
-        error_propagate(errp, err);
         visit_free(v);
         v = qapi_dealloc_visitor_new();
         visit_start_struct(v, NULL, NULL, 0, NULL);
@@ -1613,6 +1591,7 @@ Example:
         visit_end_struct(v, NULL);
         visit_free(v);
     }
+
 [Uninteresting stuff omitted...]
     $ cat qapi-generated/example-qapi-init-commands.h
 [Uninteresting stuff omitted...]
diff --git a/dump/dump.c b/dump/dump.c
index 248ea06370..383bc7876b 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1031,14 +1031,11 @@ out:
 
 static void write_dump_header(DumpState *s, Error **errp)
 {
-     Error *local_err = NULL;
-
     if (s->dump_info.d_class == ELFCLASS32) {
-        create_header32(s, &local_err);
+        create_header32(s, errp);
     } else {
-        create_header64(s, &local_err);
+        create_header64(s, errp);
     }
-    error_propagate(errp, local_err);
 }
 
 static size_t dump_bitmap_get_bufsize(DumpState *s)
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 54e012e5b4..3107637209 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -1479,10 +1479,10 @@ static void error_append_security_model_hint(Error *const *errp)
 
 static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
 {
+    ERRP_GUARD();
     const char *sec_model = qemu_opt_get(opts, "security_model");
     const char *path = qemu_opt_get(opts, "path");
     const char *multidevs = qemu_opt_get(opts, "multidevs");
-    Error *local_err = NULL;
 
     if (!sec_model) {
         error_setg(errp, "security_model property not set");
@@ -1516,11 +1516,10 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
             fse->export_flags &= ~V9FS_FORBID_MULTIDEVS;
             fse->export_flags &= ~V9FS_REMAP_INODES;
         } else {
-            error_setg(&local_err, "invalid multidevs property '%s'",
+            error_setg(errp, "invalid multidevs property '%s'",
                        multidevs);
-            error_append_hint(&local_err, "Valid options are: multidevs="
+            error_append_hint(errp, "Valid options are: multidevs="
                               "[remap|forbid|warn]\n");
-            error_propagate(errp, local_err);
             return -1;
         }
     }
@@ -1530,9 +1529,8 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
         return -1;
     }
 
-    if (fsdev_throttle_parse_opts(opts, &fse->fst, &local_err)) {
-        error_propagate_prepend(errp, local_err,
-                                "invalid throttle configuration: ");
+    if (fsdev_throttle_parse_opts(opts, &fse->fst, errp)) {
+        error_prepend(errp, "invalid throttle configuration: ");
         return -1;
     }
 
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 9755fba9a9..2ffd96ade9 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -4011,6 +4011,7 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr)
 int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
                                Error **errp)
 {
+    ERRP_GUARD();
     int i, len;
     struct stat stat;
     FsDriverEntry *fse;
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 45cbed49ab..f6d9ec4f13 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -239,7 +239,6 @@ static void acpi_table_install(const char unsigned *blob, size_t bloblen,
 void acpi_table_add(const QemuOpts *opts, Error **errp)
 {
     AcpiTableOptions *hdrs = NULL;
-    Error *err = NULL;
     char **pathnames = NULL;
     char **cur;
     size_t bloblen = 0;
@@ -249,21 +248,21 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         Visitor *v;
 
         v = opts_visitor_new(opts);
-        visit_type_AcpiTableOptions(v, NULL, &hdrs, &err);
+        visit_type_AcpiTableOptions(v, NULL, &hdrs, errp);
         visit_free(v);
     }
 
-    if (err) {
+    if (!hdrs) {
         goto out;
     }
     if (hdrs->has_file == hdrs->has_data) {
-        error_setg(&err, "'-acpitable' requires one of 'data' or 'file'");
+        error_setg(errp, "'-acpitable' requires one of 'data' or 'file'");
         goto out;
     }
 
     pathnames = g_strsplit(hdrs->has_file ? hdrs->file : hdrs->data, ":", 0);
     if (pathnames == NULL || pathnames[0] == NULL) {
-        error_setg(&err, "'-acpitable' requires at least one pathname");
+        error_setg(errp, "'-acpitable' requires at least one pathname");
         goto out;
     }
 
@@ -272,7 +271,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         int fd = open(*cur, O_RDONLY | O_BINARY);
 
         if (fd < 0) {
-            error_setg(&err, "can't open file %s: %s", *cur, strerror(errno));
+            error_setg(errp, "can't open file %s: %s", *cur, strerror(errno));
             goto out;
         }
 
@@ -288,8 +287,8 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
                 memcpy(blob + bloblen, data, r);
                 bloblen += r;
             } else if (errno != EINTR) {
-                error_setg(&err, "can't read file %s: %s",
-                           *cur, strerror(errno));
+                error_setg(errp, "can't read file %s: %s", *cur,
+                           strerror(errno));
                 close(fd);
                 goto out;
             }
@@ -298,14 +297,12 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         close(fd);
     }
 
-    acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, &err);
+    acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, errp);
 
 out:
     g_free(blob);
     g_strfreev(pathnames);
     qapi_free_AcpiTableOptions(hdrs);
-
-    error_propagate(errp, err);
 }
 
 unsigned acpi_table_len(void *current)
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 3e687d227a..53654f8638 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -41,7 +41,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
      */
     if (addr == 0 && data == 0) {
         AcpiCpuHotplug *cpus = opaque;
-        object_property_set_bool(cpus->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
     }
 }
@@ -63,7 +63,7 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu)
 
     cpu_id = k->get_arch_id(cpu);
     if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) {
-        object_property_set_bool(g->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(g->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
         return;
     }
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 2d204babc6..6a19070cec 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -201,7 +201,7 @@ static int vmstate_cpuhp_pre_load(void *opaque)
 {
     ICH9LPCPMRegs *s = opaque;
     Object *obj = OBJECT(s->gpe_cpu.device);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 283422e0d3..26bac4f16c 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -244,7 +244,7 @@ static bool vmstate_test_use_cpuhp(void *opaque)
 static int vmstate_cpuhp_pre_load(void *opaque)
 {
     Object *obj = OBJECT(opaque);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index 52e0d83760..e258463747 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -72,17 +72,12 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
 {
     AwA10State *s = AW_A10(dev);
     SysBusDevice *sysbusdev;
-    Error *err = NULL;
 
-    qdev_realize(DEVICE(&s->cpu), NULL, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
         return;
     }
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->intc);
@@ -93,9 +88,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
                        qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
     qdev_pass_gpios(DEVICE(&s->intc), dev, NULL);
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->timer);
@@ -117,18 +110,14 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
         qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC);
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
     }
-    sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->emac);
     sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE);
     sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(dev, 55));
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->sata), 0, AW_A10_SATA_BASE);
@@ -147,15 +136,15 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
 
             sprintf(bus, "usb-bus.%d", i);
 
-            object_property_set_bool(OBJECT(&s->ehci[i]), true,
-                                     "companion-enable", &error_fatal);
+            object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable",
+                                     true, &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                             AW_A10_EHCI_BASE + i * 0x8000);
             sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                                qdev_get_gpio_in(dev, 39 + i));
 
-            object_property_set_str(OBJECT(&s->ohci[i]), bus, "masterbus",
+            object_property_set_str(OBJECT(&s->ohci[i]), "masterbus", bus,
                                     &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ohci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ohci[i]), 0,
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 2fbd970b4f..64fcab895f 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -534,23 +534,18 @@ static void armsse_realize(DeviceState *dev, Error **errp)
          * later if necessary.
          */
         if (extract32(info->cpuwait_rst, i, 1)) {
-            object_property_set_bool(cpuobj, true, "start-powered-off", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "start-powered-off", true,
+                                          errp)) {
                 return;
             }
         }
         if (!s->cpu_fpu[i]) {
-            object_property_set_bool(cpuobj, false, "vfp", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "vfp", false, errp)) {
                 return;
             }
         }
         if (!s->cpu_dsp[i]) {
-            object_property_set_bool(cpuobj, false, "dsp", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "dsp", false, errp)) {
                 return;
             }
         }
@@ -562,12 +557,10 @@ static void armsse_realize(DeviceState *dev, Error **errp)
             memory_region_add_subregion_overlap(&s->cpu_container[i], 0,
                                                 &s->container, -1);
         }
-        object_property_set_link(cpuobj, OBJECT(&s->cpu_container[i]),
-                                 "memory", &error_abort);
-        object_property_set_link(cpuobj, OBJECT(s), "idau", &error_abort);
-        sysbus_realize(SYS_BUS_DEVICE(cpuobj), &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_link(cpuobj, "memory",
+                                 OBJECT(&s->cpu_container[i]), &error_abort);
+        object_property_set_link(cpuobj, "idau", OBJECT(s), &error_abort);
+        if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), errp)) {
             return;
         }
         /*
@@ -576,9 +569,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
          * CPU must exist and have been parented into the cluster before
          * the cluster is realized.
          */
-        qdev_realize(DEVICE(&s->cluster[i]), NULL, &err);
-        if (err) {
-            error_propagate(errp, err);
+        if (!qdev_realize(DEVICE(&s->cluster[i]), NULL, errp)) {
             return;
         }
 
@@ -606,15 +597,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
                 DeviceState *devs = DEVICE(splitter);
                 int cpunum;
 
-                object_property_set_int(splitter, info->num_cpus,
-                                        "num-lines", &err);
-                if (err) {
-                    error_propagate(errp, err);
+                if (!object_property_set_int(splitter, "num-lines",
+                                             info->num_cpus, errp)) {
                     return;
                 }
-                qdev_realize(DEVICE(splitter), NULL, &err);
-                if (err) {
-                    error_propagate(errp, err);
+                if (!qdev_realize(DEVICE(splitter), NULL, errp)) {
                     return;
                 }
                 for (cpunum = 0; cpunum < info->num_cpus; cpunum++) {
@@ -645,9 +632,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
     }
 
     /* Security controller */
-    sysbus_realize(SYS_BUS_DEVICE(&s->secctl), &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->secctl), errp)) {
         return;
     }
     sbd_secctl = SYS_BUS_DEVICE(&s->secctl);
@@ -662,15 +647,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
      * multiple lines, one for each of the PPCs within the ARMSSE and one


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:00:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14636.36158 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE5j-00058W-NE; Thu, 29 Oct 2020 20:00:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14636.36158; Thu, 29 Oct 2020 20:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE5j-00058J-Jr; Thu, 29 Oct 2020 20:00:11 +0000
Received: by outflank-mailman (input) for mailman id 14636;
 Thu, 29 Oct 2020 20:00:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE5h-00058D-SF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f3be9ab-1ec1-4e60-956e-fd01f9bb5915;
 Thu, 29 Oct 2020 20:00:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE5g-0005dd-TO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE5g-0004ge-SW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE5h-00058D-SF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:09 +0000
X-Inumbo-ID: 4f3be9ab-1ec1-4e60-956e-fd01f9bb5915
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f3be9ab-1ec1-4e60-956e-fd01f9bb5915;
	Thu, 29 Oct 2020 20:00:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GGQCXyPn1mddUdqRnsZj93T2aWNfizsR4vQdC2C0mFw=; b=YfqA8R6XNJVp/L7D5gqMiMBLZg
	aUvKN0wnUDFdXzk3girv2nVEI6BIUsj5KL59aWXPera+IJzloZjsw/Ai1PEZYmEVNmsN95jlXiwvF
	SSIoeoQd/Xa3l+LsDBwqiSd7HfyDj09WAz3JnNLJBH2lTANJbsGh1CTW/mmdwzvf5WAs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE5g-0005dd-TO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE5g-0004ge-SW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update OpenBIOS images to 75fbb41d built from submodule.
Message-Id: <E1kYE5g-0004ge-SW@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:00:08 +0000

commit 1e04092feecfc8caaf314df2670bf9c645a0b122
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Tue Jul 7 18:32:50 2020 +0100
Commit:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CommitDate: Tue Jul 7 21:54:37 2020 +0100

    Update OpenBIOS images to 75fbb41d built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index 5da9363bff..a07757a987 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index d68b5e5d30..2faaab83ba 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index 26d631ea64..dd7eeeeab4 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 4704d9eba6..75fbb41d28 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 4704d9eba6d8017dc694c077ca4205ffd8becad8
+Subproject commit 75fbb41d2857d93208c74a8e0228b29fd7bf04c0
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:00:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:00:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14637.36162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE5t-00059P-ON; Thu, 29 Oct 2020 20:00:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14637.36162; Thu, 29 Oct 2020 20:00:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE5t-00059H-LV; Thu, 29 Oct 2020 20:00:21 +0000
Received: by outflank-mailman (input) for mailman id 14637;
 Thu, 29 Oct 2020 20:00:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE5s-000599-78
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7d3d7d52-c9a2-4717-80ae-dfd64e16fcc0;
 Thu, 29 Oct 2020 20:00:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE5r-0005dj-2G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE5r-0004hs-0X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE5s-000599-78
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:20 +0000
X-Inumbo-ID: 7d3d7d52-c9a2-4717-80ae-dfd64e16fcc0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7d3d7d52-c9a2-4717-80ae-dfd64e16fcc0;
	Thu, 29 Oct 2020 20:00:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YamhhA88XwmGtJECNAxhEKU3zUVGA/aeWaZPuBxb87o=; b=Q84vTYQPidMzE85IeYFMGv8rM4
	XQ/ui7373KsVuMx8G/Gdbl2ZyF7WefAghr1JvtpCJ0iZJHVvgAnSHZGkPwWC4jd5NHOEnfeHi/4x4
	E84m0knHwHV87eGvUPzZZN0tqvRwIBqCAoEMaLB3RaR7VXFwHRPmvFiOWdqDKOWRy3/w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE5r-0005dj-2G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE5r-0004hs-0X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200707' into staging
Message-Id: <E1kYE5r-0004hs-0X@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:00:19 +0000

commit 45db94cc90c286a9965a285ba19450f448760a09
Merge: f2a1cf9180f63e88bb38ff21c169da97c3f2bad5 1e04092feecfc8caaf314df2670bf9c645a0b122
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 16:43:40 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 16:43:40 2020 +0100

    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200707' into staging
    
    qemu-openbios queue
    
    # gpg: Signature made Tue 07 Jul 2020 21:57:37 BST
    # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
    # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
    # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
    # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
    
    * remotes/mcayland/tags/qemu-openbios-20200707:
      Update OpenBIOS images to 75fbb41d built from submodule.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:00:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:00:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14638.36166 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE63-0005Az-QK; Thu, 29 Oct 2020 20:00:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14638.36166; Thu, 29 Oct 2020 20:00:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE63-0005Ar-NA; Thu, 29 Oct 2020 20:00:31 +0000
Received: by outflank-mailman (input) for mailman id 14638;
 Thu, 29 Oct 2020 20:00:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE62-0005Ae-55
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fbf54047-df6c-48e1-afa5-c8ab46041f53;
 Thu, 29 Oct 2020 20:00:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE61-0005e1-DT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE61-0004ig-Bk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE62-0005Ae-55
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:30 +0000
X-Inumbo-ID: fbf54047-df6c-48e1-afa5-c8ab46041f53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fbf54047-df6c-48e1-afa5-c8ab46041f53;
	Thu, 29 Oct 2020 20:00:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BY89zi4SURhTG1tStl0o+qCeFAy3HdoeiYdRqTSxNAw=; b=JZl8jqdAXZv6QoE8GQMMoF7Mjr
	sMYIWx/nmIuNESplJlTiYkj37nDQA16G5f2XB5EbCPZOXlq38D351TQGZrpmB4EHt4mJNbM0wa5hq
	lqBuFO8Ze9JHmg2tPRhCtynGHkbThLhSYhiBW65rzRkGANzhM6RL4+c1XSuv22k5bLas=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE61-0005e1-DT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE61-0004ig-Bk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] vhost-vdpa: fix the compile issue without kvm
Message-Id: <E1kYE61-0004ig-Bk@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:00:29 +0000

commit 4dc5acc07e88b2776513db75944f2e240116ebda
Author:     Cindy Lu <lulu@redhat.com>
AuthorDate: Wed Jul 8 16:49:22 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 8 06:16:48 2020 -0400

    vhost-vdpa: fix the compile issue without kvm
    
    Fix the compile issue in the system without the kvm support
    
    Signed-off-by: Cindy Lu <lulu@redhat.com>
    Message-Id: <20200708084922.21904-1-lulu@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index a3d17fe0f9..65d5aaf08a 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -19,8 +19,7 @@
 #include "hw/virtio/virtio-net.h"
 #include "hw/virtio/vhost-vdpa.h"
 #include "qemu/main-loop.h"
-#include <linux/kvm.h>
-#include "sysemu/kvm.h"
+#include "cpu.h"
 
 static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
 {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:00:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:00:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14639.36170 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6D-0005CF-Rc; Thu, 29 Oct 2020 20:00:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14639.36170; Thu, 29 Oct 2020 20:00:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6D-0005C7-Oi; Thu, 29 Oct 2020 20:00:41 +0000
Received: by outflank-mailman (input) for mailman id 14639;
 Thu, 29 Oct 2020 20:00:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE6C-0005Bv-F6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3992085f-2468-4481-9ce1-59e5f0b0888f;
 Thu, 29 Oct 2020 20:00:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6B-0005e8-J8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6B-0004jC-GN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE6C-0005Bv-F6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:40 +0000
X-Inumbo-ID: 3992085f-2468-4481-9ce1-59e5f0b0888f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3992085f-2468-4481-9ce1-59e5f0b0888f;
	Thu, 29 Oct 2020 20:00:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=scfb6QfSGEme6ZqmqrArO+/13NtzFcY1uHIYFhzmt9E=; b=IuPSQrl8KnC1n5ZJgLsDS9nIDh
	mvkvMeSNk/sBFAHD7Sw/4arCZ0ETq+ZBTJAYsR9ECcZAUaAXQbgbbp0nlpe6tMOu0jxYvKSKBtVmp
	kchdFe5fIWUbTEBpCqhkmhuUFKVxOTUYUjWmWjlGzieeLaeTI3CdTBMuL3BkemcMQlZI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6B-0005e8-J8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6B-0004jC-GN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYE6B-0004jC-GN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:00:39 +0000

commit 0fb7ea45157d63507675a4011bc4b24588217f6e
Merge: 45db94cc90c286a9965a285ba19450f448760a09 4dc5acc07e88b2776513db75944f2e240116ebda
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 19:29:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 19:29:07 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio: bugfix
    
    fixes vdpa on non-kvm platforms
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Wed 08 Jul 2020 11:17:48 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      vhost-vdpa: fix the compile issue without kvm
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/virtio/vhost-vdpa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:00:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:00:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14641.36186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6O-0005G8-6S; Thu, 29 Oct 2020 20:00:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14641.36186; Thu, 29 Oct 2020 20:00:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6O-0005G0-35; Thu, 29 Oct 2020 20:00:52 +0000
Received: by outflank-mailman (input) for mailman id 14641;
 Thu, 29 Oct 2020 20:00:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE6M-0005FX-S3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5648fc46-fc1a-44c7-9b3b-720881bf63e7;
 Thu, 29 Oct 2020 20:00:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6L-0005eI-WA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6L-0004kJ-TU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE6M-0005FX-S3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:50 +0000
X-Inumbo-ID: 5648fc46-fc1a-44c7-9b3b-720881bf63e7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5648fc46-fc1a-44c7-9b3b-720881bf63e7;
	Thu, 29 Oct 2020 20:00:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SjHb1j9KfqD6LT33TMIuxhwtgzSwzZshaynn0PgJOb8=; b=NnoScIzpKpN2oXBvJ5S1BKTrb6
	8bEuz1qkT9nZG7LqgeHs7btXdWo3YUyEG2y+6MO0OtD347znMxp5wToX6TRWsPG3rb4q8kGWue1a0
	oVJ3osoa/eJDbRJl/OpM09chgNQAsp6wrYx7jkPMUCKpeBKcMh+6dU7GAuDWD+NcdeS4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6L-0005eI-WA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6L-0004kJ-TU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:00:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen: Fix xen-legacy-backend qdev types
Message-Id: <E1kYE6L-0004kJ-TU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:00:49 +0000

commit 104a7f4e1355493175b0ad6f49c524ee449c16f7
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Wed Jun 24 08:19:39 2020 -0400
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Jul 10 13:49:16 2020 +0100

    xen: Fix xen-legacy-backend qdev types
    
    xen-sysdev is a TYPE_SYS_BUS_DEVICE.  bus_type should not be changed so
    that it can plug into the System bus.  Otherwise this assert triggers:
    qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion
    `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)'
    failed.
    
    TYPE_XENBACKEND attaches to TYPE_XENSYSBUS, so its class_init needs to
    be set accordingly to attach the qdev.  Otherwise the following assert
    triggers:
    qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion
    `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)'
    failed.
    
    TYPE_XENBACKEND is not a subclass of XEN_XENSYSDEV, so it's parent
    is just TYPE_DEVICE.  Change that.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Paul Durrant <pdurrant@amazon.com>
    Fixes: 81cb05732efb ("qdev: Assert devices are plugged into a bus that can take them")
    Message-Id: <20200624121939.10282-1-jandryuk@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/xen/xen-legacy-backend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 7d4b13351e..083d8dc1b2 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -789,11 +789,12 @@ static void xendev_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     /* xen-backend devices can be plugged/unplugged dynamically */
     dc->user_creatable = true;
+    dc->bus_type = TYPE_XENSYSBUS;
 }
 
 static const TypeInfo xendev_type_info = {
     .name          = TYPE_XENBACKEND,
-    .parent        = TYPE_XENSYSDEV,
+    .parent        = TYPE_DEVICE,
     .class_init    = xendev_class_init,
     .instance_size = sizeof(struct XenLegacyDevice),
 };
@@ -824,7 +825,6 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     device_class_set_props(dc, xen_sysdev_properties);
-    dc->bus_type = TYPE_XENSYSBUS;
 }
 
 static const TypeInfo xensysdev_info = {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:01:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:01:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14643.36190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6Y-0005JU-89; Thu, 29 Oct 2020 20:01:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14643.36190; Thu, 29 Oct 2020 20:01:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6Y-0005JN-4q; Thu, 29 Oct 2020 20:01:02 +0000
Received: by outflank-mailman (input) for mailman id 14643;
 Thu, 29 Oct 2020 20:01:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE6X-0005J8-2p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 39d7a971-71ff-4edf-ad21-cefcab83671a;
 Thu, 29 Oct 2020 20:01:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6W-0005f3-3w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6W-0004l9-2x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE6X-0005J8-2p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:01 +0000
X-Inumbo-ID: 39d7a971-71ff-4edf-ad21-cefcab83671a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 39d7a971-71ff-4edf-ad21-cefcab83671a;
	Thu, 29 Oct 2020 20:01:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pZn0bnXhE73A2ynIIgTGRxFR7F64PdunYd/e4bD09h4=; b=1f2ouSwJzzTSG/fNzufwNhRF0w
	96daU4rCmzgrM1A5yB5brFSafVWXHYBSYlt5+1ZMKf59Kvgrv8nMdCDY1ual1DjhWeJUkxQmFzWep
	ZRonLOhV5KtU3934sO8/IuVShV/yDsBInQz+92KLakfL5UjFA5IlsCrJIERXqH9Fufg0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6W-0005f3-3w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6W-0004l9-2x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xen: cleanup unrealized flash devices
Message-Id: <E1kYE6W-0004l9-2x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:01:00 +0000

commit dd29b5c30cd2a13f8c12376a8de84cb090c338bf
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Wed Jun 24 13:18:41 2020 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Jul 10 13:49:16 2020 +0100

    xen: cleanup unrealized flash devices
    
    The generic pc_machine_initfn() calls pc_system_flash_create() which creates
    'system.flash0' and 'system.flash1' devices. These devices are then realized
    by pc_system_flash_map() which is called from pc_system_firmware_init() which
    itself is called via pc_memory_init(). The latter however is not called when
    xen_enable() is true and hence the following assertion fails:
    
    qemu-system-i386: hw/core/qdev.c:439: qdev_assert_realized_properly:
    Assertion `dev->realized' failed
    
    These flash devices are unneeded when using Xen so this patch avoids the
    assertion by simply removing them using pc_system_flash_cleanup_unused().
    
    Reported-by: Jason Andryuk <jandryuk@gmail.com>
    Fixes: ebc29e1beab0 ("pc: Support firmware configuration with -blockdev")
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200624121841.17971-3-paul@xen.org>
    Fixes: dfe8c79c4468 ("qdev: Assert onboard devices all get realized properly")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/i386/pc_piix.c    | 9 ++++++---
 hw/i386/pc_sysfw.c   | 2 +-
 include/hw/i386/pc.h | 1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2bb42a8141..3469b1fd10 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -186,9 +186,12 @@ static void pc_init1(MachineState *machine,
     if (!xen_enabled()) {
         pc_memory_init(pcms, system_memory,
                        rom_memory, &ram_memory);
-    } else if (machine->kernel_filename != NULL) {
-        /* For xen HVM direct kernel boot, load linux here */
-        xen_load_linux(pcms);
+    } else {
+        pc_system_flash_cleanup_unused(pcms);
+        if (machine->kernel_filename != NULL) {
+            /* For xen HVM direct kernel boot, load linux here */
+            xen_load_linux(pcms);
+        }
     }
 
     gsi_state = pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled);
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index ec2a3b3e7e..0ff47a4b59 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -108,7 +108,7 @@ void pc_system_flash_create(PCMachineState *pcms)
     }
 }
 
-static void pc_system_flash_cleanup_unused(PCMachineState *pcms)
+void pc_system_flash_cleanup_unused(PCMachineState *pcms)
 {
     char *prop_name;
     int i;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index a802e69974..3d7ed3a55e 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -186,6 +186,7 @@ ISADevice *pc_find_fdc0(void);
 
 /* pc_sysfw.c */
 void pc_system_flash_create(PCMachineState *pcms);
+void pc_system_flash_cleanup_unused(PCMachineState *pcms);
 void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory);
 
 /* acpi-build.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:01:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:01:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14645.36194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6i-0005Lz-9Y; Thu, 29 Oct 2020 20:01:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14645.36194; Thu, 29 Oct 2020 20:01:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6i-0005Lr-6W; Thu, 29 Oct 2020 20:01:12 +0000
Received: by outflank-mailman (input) for mailman id 14645;
 Thu, 29 Oct 2020 20:01:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE6h-0005Lb-12
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eef4189a-0961-4a56-ab8d-f36aed3f0055;
 Thu, 29 Oct 2020 20:01:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6g-0005fN-8f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6g-0004mK-6u
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE6h-0005Lb-12
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:11 +0000
X-Inumbo-ID: eef4189a-0961-4a56-ab8d-f36aed3f0055
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eef4189a-0961-4a56-ab8d-f36aed3f0055;
	Thu, 29 Oct 2020 20:01:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TguvdtOh8B/Tb7Ii/QsA8WRYy0QKHdXy3wLZsbhtnfE=; b=DNz9Dwvf0GfeDBxlrslbKnoPys
	9TtTV/MvcB348xiICJGfZAuRa1hAZuXNjby/q+uY2FgEHpX82tzkcz+I7ujkUWxD6H8i87W5rJS2p
	yQOEGMHjIVT0P0qpc/QIlelxOkOwYVih1p68s61RW6brlsflU76ZWVHdSMgcBcM6A/4Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6g-0005fN-8f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6g-0004mK-6u
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200710' into staging
Message-Id: <E1kYE6g-0004mK-6u@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:01:10 +0000

commit 827937158b72ce2265841ff528bba3c44a1bfbc8
Merge: 0fb7ea45157d63507675a4011bc4b24588217f6e dd29b5c30cd2a13f8c12376a8de84cb090c338bf
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 13:56:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 13:56:03 2020 +0100

    Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200710' into staging
    
    xen patches
    
    Fixes following harden checks in qdev.
    
    # gpg: Signature made Fri 10 Jul 2020 14:05:46 BST
    # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
    # gpg:                issuer "anthony.perard@citrix.com"
    # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
    # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
    #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
    
    * remotes/aperard/tags/pull-xen-20200710:
      xen: cleanup unrealized flash devices
      xen: Fix xen-legacy-backend qdev types
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/i386/pc_piix.c           | 9 ++++++---
 hw/i386/pc_sysfw.c          | 2 +-
 hw/xen/xen-legacy-backend.c | 4 ++--
 include/hw/i386/pc.h        | 1 +
 4 files changed, 10 insertions(+), 6 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:01:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:01:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14647.36197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6s-0005NZ-B1; Thu, 29 Oct 2020 20:01:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14647.36197; Thu, 29 Oct 2020 20:01:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE6s-0005NR-85; Thu, 29 Oct 2020 20:01:22 +0000
Received: by outflank-mailman (input) for mailman id 14647;
 Thu, 29 Oct 2020 20:01:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE6r-0005NG-D1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 817e89c2-c7f2-45e7-ad26-c5c1919b7594;
 Thu, 29 Oct 2020 20:01:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6q-0005fc-Ju
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE6q-0004nD-IX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE6r-0005NG-D1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:21 +0000
X-Inumbo-ID: 817e89c2-c7f2-45e7-ad26-c5c1919b7594
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 817e89c2-c7f2-45e7-ad26-c5c1919b7594;
	Thu, 29 Oct 2020 20:01:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=P7P/IHjFG4l4NAtqJeD8SOihNekXb7Z0+i+UAmrocPU=; b=C+SfOZiM4JVVrURr5/mIs19gWZ
	rFQqI1ARYaozzA92TPJ5GhX7uGYoJDcbsL+dcu0Nga/c3h3WijQEEaHpPo9pZnuBRD6GpFA8c2CNh
	KvWrrM1bxycSdWyShBtFnrVXiceSg6FEsyyi+EygEL6qmS4TkBRp6SwPPPhEcv+ZcGJw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6q-0005fc-Ju
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE6q-0004nD-IX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] 9p: null terminate fs driver options list
Message-Id: <E1kYE6q-0004nD-IX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:01:20 +0000

commit 353b5a91ccf2789b85967d19a8795816b8865562
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jul 9 23:28:48 2020 +0530
Commit:     Greg Kurz <groug@kaod.org>
CommitDate: Fri Jul 10 12:48:06 2020 +0200

    9p: null terminate fs driver options list
    
    NULL terminate fs driver options' list, validate_opt() looks for
    a null entry to terminate the loop.
    
    Fixes: aee7f3ecd8b7 ("fsdev: Error out when unsupported option is passed")
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-Id: <20200709175848.650400-1-ppandit@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
---
 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index a9e069c0c7..3da64e9f72 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {
             "throttling.iops-read-max-length",
             "throttling.iops-write-max-length",
             "throttling.iops-size",
+            NULL
         },
     },
     {
@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = {
         .ops = &synth_ops,
         .opts = (const char * []) {
             COMMON_FS_DRIVER_OPTIONS,
+            NULL
         },
     },
     {
@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = {
             "socket",
             "sock_fd",
             "writeout",
+            NULL
         },
     },
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:01:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:01:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14649.36213 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE72-0005SH-N6; Thu, 29 Oct 2020 20:01:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14649.36213; Thu, 29 Oct 2020 20:01:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE72-0005SC-Jp; Thu, 29 Oct 2020 20:01:32 +0000
Received: by outflank-mailman (input) for mailman id 14649;
 Thu, 29 Oct 2020 20:01:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE71-0005Rj-HH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 118555e9-a399-41c3-90b6-a629179e5c52;
 Thu, 29 Oct 2020 20:01:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE70-0005fj-Oa
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE70-0004nj-Mo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE71-0005Rj-HH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:31 +0000
X-Inumbo-ID: 118555e9-a399-41c3-90b6-a629179e5c52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 118555e9-a399-41c3-90b6-a629179e5c52;
	Thu, 29 Oct 2020 20:01:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+9sUl3fIDjLB6fJNiIo6ogUo5dpMIYk8UjtRS9O5ceE=; b=VaXBkJDsliy8ouJFYD4izZxIE0
	Z0ltY3KMVvof+ZL1/OfgUHsCsbwowMx5yeNosP4AjeG6DN54eV5pkZLNNUpaTjRb19VTsG0KBklAX
	xC/rdgKFJOHP/YewQ0NlX6o0iIeTuqLVhHN0p6xQIKM9KBRA0w0xnOh0EUncK1IeCYwA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE70-0005fj-Oa
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE70-0004nj-Mo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/gkurz/tags/9p-fix-2020-07-10' into staging
Message-Id: <E1kYE70-0004nj-Mo@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:01:30 +0000

commit d4a6bab1ecf23d86e20e2f08a144e4e48643a6e4
Merge: 827937158b72ce2265841ff528bba3c44a1bfbc8 353b5a91ccf2789b85967d19a8795816b8865562
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:11:30 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 15:11:30 2020 +0100

    Merge remote-tracking branch 'remotes/gkurz/tags/9p-fix-2020-07-10' into staging
    
    Add missing NULL terminating element in fsdev option lists. Never
    crashed QEMU by pure luck.
    
    # gpg: Signature made Fri 10 Jul 2020 17:26:01 BST
    # gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
    # gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
    # gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
    # gpg:                 aka "[jpeg image of size 3330]" [full]
    # Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6
    
    * remotes/gkurz/tags/9p-fix-2020-07-10:
      9p: null terminate fs driver options list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:01:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:01:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14650.36218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE7H-0005Vr-Ou; Thu, 29 Oct 2020 20:01:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14650.36218; Thu, 29 Oct 2020 20:01:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYE7H-0005Vk-Lk; Thu, 29 Oct 2020 20:01:47 +0000
Received: by outflank-mailman (input) for mailman id 14650;
 Thu, 29 Oct 2020 20:01:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYE7G-0005VY-CY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a4580fbd-5a9c-4d8d-b671-66d334ce4266;
 Thu, 29 Oct 2020 20:01:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE7B-0005fu-GF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYE7B-0004qZ-FT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYE7G-0005VY-CY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:46 +0000
X-Inumbo-ID: a4580fbd-5a9c-4d8d-b671-66d334ce4266
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a4580fbd-5a9c-4d8d-b671-66d334ce4266;
	Thu, 29 Oct 2020 20:01:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e0uhjgoWnt25VFjxzxat7C3lf0n8NkygpACaMBfAtGs=; b=vOAxXjEcUOZWPYZ/LFQN207wLu
	q/m6Hw4UWxuAgVqohW2fRkAQaO+0EWJfGiEWWK8EZk9jcs0D27ZBbMVkQZkls+d04vA1RMaA5FY8e
	M/GCvcamRHWg1FdtZEf/sVjYcIeya9X5ORvD8g6LiquPFt7n9qlNZyPYUS/0I6iGwkko=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE7B-0005fu-GF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYE7B-0004qZ-FT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:01:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Message-Id: <E1kYE7B-0004qZ-FT@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:01:41 +0000

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

commit 2033cc6efa98b831d7839e367aa7d5aa74d0750f
Merge: d4a6bab1ecf23d86e20e2f08a144e4e48643a6e4 56908dc5041aa424fd1495b6c6beb78c539d93e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 16:52:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 16:52:24 2020 +0100

    Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
    
    * Make checkpatch say 'qemu' instead of 'kernel' (Aleksandar)
    * Fix PSE guests with emulated NPT (Alexander B. #1)
    * Fix leak (Alexander B. #2)
    * HVF fixes (Roman, Cameron)
    * New Sapphire Rapids CPUID bits (Cathy)
    * cpus.c and softmmu/ cleanups (Claudio)
    * TAP driver tweaks (Daniel, Havard)
    * object-add bugfix and testcases (Eric A.)
    * Fix Coverity MIN_CONST and MAX_CONST (Eric B.)
    * "info lapic" improvement (Jan)
    * SSE fixes (Joseph)
    * "-msg guest-name" option (Mario)
    * support for AMD nested live migration (myself)
    * Small i386 TCG fixes (myself)
    * improved error reporting for Xen (myself)
    * fix "-cpu host -overcommit cpu-pm=on" (myself)
    * Add accel/Kconfig (Philippe)
    * iscsi sense handling fixes (Yongji)
    * Misc bugfixes
    
    # gpg: Signature made Sat 11 Jul 2020 00:33:41 BST
    # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
    # gpg:                issuer "pbonzini@redhat.com"
    # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
    # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
    # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
    #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
    
    * remotes/bonzini/tags/for-upstream: (47 commits)
      linux-headers: update again to 5.8
      apic: Report current_count via 'info lapic'
      scripts: improve message when TAP based tests fail
      target/i386: Enable TSX Suspend Load Address Tracking feature
      target/i386: Add SERIALIZE cpu feature
      softmmu/vl: Remove the check for colons in -accel parameters
      cpu-throttle: new module, extracted from cpus.c
      softmmu: move softmmu only files from root
      pc: fix leak in pc_system_flash_cleanup_unused
      cpus: Move CPU code from exec.c to cpus-common.c
      target/i386: Correct the warning message of Intel PT
      checkpatch: Change occurences of 'kernel' to 'qemu' in user messages
      iscsi: return -EIO when sense fields are meaningless
      iscsi: handle check condition status in retry loop
      target/i386: sev: fail query-sev-capabilities if QEMU cannot use SEV
      target/i386: sev: provide proper error reporting for query-sev-capabilities
      KVM: x86: believe what KVM says about WAITPKG
      target/i386: implement undocumented "smsw r32" behavior
      target/i386: remove gen_io_end
      Makefile: simplify MINIKCONF rules
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Kconfig                                   |    4 +
 Kconfig.host                              |    7 -
 MAINTAINERS                               |   29 +-
 Makefile                                  |   12 +-
 Makefile.target                           |    7 +-
 accel/Kconfig                             |    9 +
 accel/stubs/tcg-stub.c                    |    7 +
 arch_init.c                               |  113 -
 balloon.c                                 |  106 -
 block/iscsi.c                             |   22 +-
 cpus-common.c                             |   18 +
 cpus.c                                    | 2329 ---------------------
 exec.c                                    |   22 -
 hw/core/null-machine.c                    |    5 +
 hw/i386/pc_sysfw.c                        |    5 +
 hw/intc/apic.c                            |   18 -
 hw/intc/apic_common.c                     |   19 +
 include/hw/core/cpu.h                     |   37 -
 include/hw/i386/apic_internal.h           |    1 +
 include/qemu/error-report.h               |    2 +
 include/qemu/main-loop.h                  |    5 +
 include/qemu/osdep.h                      |   21 +-
 include/qom/object.h                      |   26 +-
 include/sysemu/cpu-throttle.h             |   68 +
 include/sysemu/hvf.h                      |    2 +-
 include/sysemu/hw_accel.h                 |   13 +
 ioport.c                                  |  299 ---
 linux-headers/asm-arm/unistd-common.h     |    1 +
 linux-headers/asm-x86/kvm.h               |    5 +-
 memory.c                                  | 3250 -----------------------------
 memory_mapping.c                          |  357 ----
 migration/migration.c                     |    1 +
 migration/ram.c                           |    1 +
 qemu-options.hx                           |   12 +-
 qom/object.c                              |   21 +-
 qom/object_interfaces.c                   |    7 +-
 qtest.c                                   |  820 --------
 scripts/checkpatch.pl                     |    6 +-
 scripts/tap-driver.pl                     |    2 +-
 softmmu/Makefile.objs                     |   11 +
 softmmu/arch_init.c                       |  113 +
 softmmu/balloon.c                         |  106 +
 softmmu/cpu-throttle.c                    |  122 ++
 softmmu/cpus.c                            | 2238 ++++++++++++++++++++
 softmmu/ioport.c                          |  299 +++
 softmmu/memory.c                          | 3250 +++++++++++++++++++++++++++++
 softmmu/memory_mapping.c                  |  357 ++++
 softmmu/qtest.c                           |  820 ++++++++
 softmmu/vl.c                              |   14 +-
 target/i386/Makefile.objs                 |    1 +
 target/i386/cpu.c                         |   13 +-
 target/i386/cpu.h                         |   10 +
 target/i386/excp_helper.c                 |    4 +-
 target/i386/fpu_helper.c                  |   37 +-
 target/i386/gdbstub.c                     |    1 +
 target/i386/helper.c                      |    6 +-
 target/i386/helper.h                      |    1 +
 target/i386/hvf/hvf.c                     |  137 +-
 target/i386/hvf/vmx.h                     |   17 +-
 target/i386/kvm.c                         |   53 +-
 target/i386/kvm_i386.h                    |    1 +
 target/i386/machine.c                     |   31 +-
 target/i386/monitor.c                     |   10 +-
 target/i386/ops_sse.h                     |   28 +-
 target/i386/sev-stub.c                    |    3 +-
 target/i386/sev.c                         |   27 +-
 target/i386/sev_i386.h                    |    2 +-
 target/i386/svm.h                         |    1 +
 target/i386/svm_helper.c                  |    7 +-
 target/i386/tcg-stub.c                    |   25 +
 target/i386/translate.c                   |   36 +-
 tests/Makefile.include                    |    2 +-
 tests/qtest/qmp-cmd-test.c                |  109 +-
 tests/tcg/i386/Makefile.target            |    4 +
 tests/tcg/i386/test-i386-sse-exceptions.c |  813 ++++++++
 ui/cocoa.m                                |    1 +
 util/qemu-error.c                         |    7 +
 77 files changed, 8790 insertions(+), 7616 deletions(-)

diff --git a/Kconfig b/Kconfig
new file mode 100644
index 0000000000..bf694c42af
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,4 @@
+source Kconfig.host
+source backends/Kconfig
+source accel/Kconfig
+source hw/Kconfig
diff --git a/Kconfig.host b/Kconfig.host
index 55136e037d..a6d871c399 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -2,9 +2,6 @@
 # down to Kconfig.  See also MINIKCONF_ARGS in the Makefile:
 # these two need to be kept in sync.
 
-config KVM
-    bool
-
 config LINUX
     bool
 
@@ -31,10 +28,6 @@ config VHOST_KERNEL
     bool
     select VHOST
 
-config XEN
-    bool
-    select FSDEV_9P if VIRTFS
-
 config VIRTFS
     bool
 
diff --git a/MAINTAINERS b/MAINTAINERS
index 6aa54f7f8f..361ae5c662 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -115,7 +115,7 @@ Overall TCG CPUs
 M: Richard Henderson <rth@twiddle.net>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: cpus.c
+F: softmmu/cpus.c
 F: cpus-common.c
 F: exec.c
 F: accel/tcg/
@@ -362,7 +362,7 @@ Overall KVM CPUs
 M: Paolo Bonzini <pbonzini@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
-F: */kvm.*
+F: */*/kvm*
 F: accel/kvm/
 F: accel/stubs/kvm-stub.c
 F: include/hw/kvm/
@@ -416,8 +416,21 @@ S: Supported
 F: target/i386/kvm.c
 F: scripts/kvm/vmxcap
 
+Guest CPU Cores (other accelerators)
+------------------------------------
+Overall
+M: Richard Henderson <rth@twiddle.net>
+R: Paolo Bonzini <pbonzini@redhat.com>
+S: Maintained
+F: include/sysemu/accel.h
+F: accel/accel.c
+F: accel/Makefile.objs
+F: accel/stubs/Makefile.objs
+
 X86 HVF CPUs
+M: Cameron Esfahani <dirty@apple.com>
 M: Roman Bolshakov <r.bolshakov@yadro.com>
+W: https://wiki.qemu.org/Features/HVF
 S: Maintained
 F: accel/stubs/hvf-stub.c
 F: target/i386/hvf/
@@ -465,6 +478,7 @@ M: Colin Xu <colin.xu@intel.com>
 L: haxm-team@intel.com
 W: https://github.com/intel/haxm/issues
 S: Maintained
+F: accel/stubs/hax-stub.c
 F: include/sysemu/hax.h
 F: target/i386/hax-*
 
@@ -1710,7 +1724,7 @@ M: David Hildenbrand <david@redhat.com>
 S: Maintained
 F: hw/virtio/virtio-balloon*.c
 F: include/hw/virtio/virtio-balloon.h
-F: balloon.c
+F: softmmu/balloon.c
 F: include/sysemu/balloon.h
 
 virtio-9p
@@ -2189,12 +2203,12 @@ Memory API
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Supported
 F: include/exec/ioport.h
-F: ioport.c
 F: include/exec/memop.h
 F: include/exec/memory.h
 F: include/exec/ram_addr.h
 F: include/exec/ramblock.h
-F: memory.c
+F: softmmu/ioport.c
+F: softmmu/memory.c
 F: include/exec/memory-internal.h
 F: exec.c
 F: scripts/coccinelle/memory-region-housekeeping.cocci
@@ -2226,13 +2240,14 @@ F: ui/cocoa.m
 Main loop
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: cpus.c
 F: include/qemu/main-loop.h
 F: include/sysemu/runstate.h
 F: util/main-loop.c
 F: util/qemu-timer.c
 F: softmmu/vl.c
 F: softmmu/main.c
+F: softmmu/cpus.c
+F: softmmu/cpu-throttle.c
 F: qapi/run-state.json
 
 Human Monitor (HMP)
@@ -2387,7 +2402,7 @@ M: Thomas Huth <thuth@redhat.com>
 M: Laurent Vivier <lvivier@redhat.com>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: qtest.c
+F: softmmu/qtest.c
 F: accel/qtest.c
 F: tests/qtest/
 X: tests/qtest/bios-tables-test-allowed-diff.h
diff --git a/Makefile b/Makefile
index b1b8a5a6d0..32345c610e 100644
--- a/Makefile
+++ b/Makefile
@@ -404,7 +404,8 @@ endif
 # This has to be kept in sync with Kconfig.host.
 MINIKCONF_ARGS = \
     $(CONFIG_MINIKCONF_MODE) \
-    $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \
+    $@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
+    CONFIG_TCG=$(CONFIG_TCG) \
     CONFIG_KVM=$(CONFIG_KVM) \
     CONFIG_SPICE=$(CONFIG_SPICE) \
     CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
@@ -418,12 +419,11 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
-MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
-MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
+MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
 
-$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
-	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > $@.tmp, "GEN", "$@.tmp")
+$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
+	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
+		> $@.tmp, "GEN", "$@.tmp")
 	$(call quiet-command, if test -f $@; then \
 	  if cmp -s $@.old $@; then \
 	    mv $@.tmp $@; \
diff --git a/Makefile.target b/Makefile.target
index 02bd9d7117..ffa2657269 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -152,16 +152,13 @@ endif #CONFIG_BSD_USER
 #########################################################
 # System emulator target
 ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
-obj-y += qtest.o
+obj-y += softmmu/
+obj-y += gdbstub.o
 obj-y += dump/
 obj-y += hw/
 obj-y += monitor/
 obj-y += qapi/
-obj-y += memory.o
-obj-y += memory_mapping.o
 obj-y += migration/ram.o
-obj-y += softmmu/
 LIBS := $(libs_softmmu) $(LIBS)
 
 # Hardware support
diff --git a/accel/Kconfig b/accel/Kconfig
new file mode 100644
index 0000000000..2ad94a3839
--- /dev/null
+++ b/accel/Kconfig
@@ -0,0 +1,9 @@
+config TCG
+    bool
+
+config KVM
+    bool
+
+config XEN
+    bool
+    select FSDEV_9P if VIRTFS
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 677191a69c..e4bbf997aa 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -22,3 +22,10 @@ void tb_flush(CPUState *cpu)
 void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 }
+
+void *probe_access(CPUArchState *env, target_ulong addr, int size,
+                   MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
+{
+     /* Handled by hardware accelerator. */
+     g_assert_not_reached();
+}
diff --git a/arch_init.c b/arch_init.c
deleted file mode 100644
index 8afea4748b..0000000000
--- a/arch_init.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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.
- */
-#include "qemu/osdep.h"
-#include "cpu.h"
-#include "sysemu/sysemu.h"
-#include "sysemu/arch_init.h"
-#include "hw/pci/pci.h"
-#include "hw/audio/soundhw.h"
-#include "qapi/error.h"
-#include "qemu/config-file.h"
-#include "qemu/error-report.h"
-#include "hw/acpi/acpi.h"
-#include "qemu/help_option.h"
-
-#ifdef TARGET_SPARC
-int graphic_width = 1024;
-int graphic_height = 768;
-int graphic_depth = 8;
-#elif defined(TARGET_M68K)
-int graphic_width = 800;
-int graphic_height = 600;
-int graphic_depth = 8;
-#else
-int graphic_width = 800;
-int graphic_height = 600;
-int graphic_depth = 32;
-#endif
-
-
-#if defined(TARGET_ALPHA)
-#define QEMU_ARCH QEMU_ARCH_ALPHA
-#elif defined(TARGET_ARM)
-#define QEMU_ARCH QEMU_ARCH_ARM
-#elif defined(TARGET_CRIS)
-#define QEMU_ARCH QEMU_ARCH_CRIS
-#elif defined(TARGET_HPPA)
-#define QEMU_ARCH QEMU_ARCH_HPPA
-#elif defined(TARGET_I386)
-#define QEMU_ARCH QEMU_ARCH_I386
-#elif defined(TARGET_LM32)
-#define QEMU_ARCH QEMU_ARCH_LM32
-#elif defined(TARGET_M68K)
-#define QEMU_ARCH QEMU_ARCH_M68K
-#elif defined(TARGET_MICROBLAZE)
-#define QEMU_ARCH QEMU_ARCH_MICROBLAZE
-#elif defined(TARGET_MIPS)
-#define QEMU_ARCH QEMU_ARCH_MIPS
-#elif defined(TARGET_MOXIE)
-#define QEMU_ARCH QEMU_ARCH_MOXIE
-#elif defined(TARGET_NIOS2)
-#define QEMU_ARCH QEMU_ARCH_NIOS2
-#elif defined(TARGET_OPENRISC)
-#define QEMU_ARCH QEMU_ARCH_OPENRISC
-#elif defined(TARGET_PPC)
-#define QEMU_ARCH QEMU_ARCH_PPC
-#elif defined(TARGET_RISCV)
-#define QEMU_ARCH QEMU_ARCH_RISCV
-#elif defined(TARGET_RX)
-#define QEMU_ARCH QEMU_ARCH_RX
-#elif defined(TARGET_S390X)
-#define QEMU_ARCH QEMU_ARCH_S390X
-#elif defined(TARGET_SH4)
-#define QEMU_ARCH QEMU_ARCH_SH4
-#elif defined(TARGET_SPARC)
-#define QEMU_ARCH QEMU_ARCH_SPARC
-#elif defined(TARGET_TRICORE)
-#define QEMU_ARCH QEMU_ARCH_TRICORE
-#elif defined(TARGET_UNICORE32)
-#define QEMU_ARCH QEMU_ARCH_UNICORE32
-#elif defined(TARGET_XTENSA)
-#define QEMU_ARCH QEMU_ARCH_XTENSA
-#endif
-
-const uint32_t arch_type = QEMU_ARCH;
-
-int kvm_available(void)
-{
-#ifdef CONFIG_KVM
-    return 1;
-#else
-    return 0;
-#endif
-}
-
-int xen_available(void)
-{
-#ifdef CONFIG_XEN
-    return 1;
-#else
-    return 0;
-#endif
-}
diff --git a/balloon.c b/balloon.c
deleted file mode 100644
index 354408c6ea..0000000000
--- a/balloon.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Generic Balloon handlers and management
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (C) 2011 Red Hat, Inc.
- * Copyright (C) 2011 Amit Shah <amit.shah@redhat.com>
- *
- * 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.
- */
-
-#include "qemu/osdep.h"
-#include "qemu/atomic.h"
-#include "sysemu/kvm.h"
-#include "sysemu/balloon.h"
-#include "trace-root.h"
-#include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qmp/qerror.h"
-
-static QEMUBalloonEvent *balloon_event_fn;
-static QEMUBalloonStatus *balloon_stat_fn;
-static void *balloon_opaque;
-
-static bool have_balloon(Error **errp)
-{
-    if (kvm_enabled() && !kvm_has_sync_mmu()) {
-        error_set(errp, ERROR_CLASS_KVM_MISSING_CAP,
-                  "Using KVM without synchronous MMU, balloon unavailable");
-        return false;
-    }
-    if (!balloon_event_fn) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
-                  "No balloon device has been activated");
-        return false;
-    }
-    return true;
-}
-
-int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
-                             QEMUBalloonStatus *stat_func, void *opaque)
-{
-    if (balloon_event_fn || balloon_stat_fn || balloon_opaque) {
-        /* We're already registered one balloon handler.  How many can
-         * a guest really have?
-         */
-        return -1;
-    }
-    balloon_event_fn = event_func;
-    balloon_stat_fn = stat_func;
-    balloon_opaque = opaque;
-    return 0;
-}
-
-void qemu_remove_balloon_handler(void *opaque)
-{
-    if (balloon_opaque != opaque) {
-        return;
-    }
-    balloon_event_fn = NULL;
-    balloon_stat_fn = NULL;
-    balloon_opaque = NULL;
-}
-
-BalloonInfo *qmp_query_balloon(Error **errp)
-{
-    BalloonInfo *info;
-
-    if (!have_balloon(errp)) {
-        return NULL;
-    }
-
-    info = g_malloc0(sizeof(*info));
-    balloon_stat_fn(balloon_opaque, info);
-    return info;
-}
-
-void qmp_balloon(int64_t target, Error **errp)
-{
-    if (!have_balloon(errp)) {
-        return;
-    }
-
-    if (target <= 0) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
-        return;
-    }
-
-    trace_balloon_event(balloon_opaque, target);
-    balloon_event_fn(balloon_opaque, target);
-}
diff --git a/block/iscsi.c b/block/iscsi.c
index 6c2e353e1a..bd2122a3a4 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -241,9 +241,11 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
 
     iTask->status = status;
     iTask->do_retry = 0;
+    iTask->err_code = 0;
     iTask->task = task;
 
     if (status != SCSI_STATUS_GOOD) {
+        iTask->err_code = -EIO;
         if (iTask->retries++ < ISCSI_CMD_RETRIES) {
             if (status == SCSI_STATUS_BUSY ||
                 status == SCSI_STATUS_TIMEOUT ||
@@ -266,16 +268,16 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
                 timer_mod(&iTask->retry_timer,
                           qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
                 iTask->do_retry = 1;
-            }
-        } else if (status == SCSI_STATUS_CHECK_CONDITION) {
-            int error = iscsi_translate_sense(&task->sense);
-            if (error == EAGAIN) {
-                error_report("iSCSI CheckCondition: %s",
-                             iscsi_get_error(iscsi));
-                iTask->do_retry = 1;
-            } else {
-                iTask->err_code = -error;
-                iTask->err_str = g_strdup(iscsi_get_error(iscsi));
+            } else if (status == SCSI_STATUS_CHECK_CONDITION) {
+                int error = iscsi_translate_sense(&task->sense);
+                if (error == EAGAIN) {
+                    error_report("iSCSI CheckCondition: %s",
+                                 iscsi_get_error(iscsi));
+                    iTask->do_retry = 1;
+                } else {
+                    iTask->err_code = -error;
+                    iTask->err_str = g_strdup(iscsi_get_error(iscsi));
+                }
             }
         }
     }
diff --git a/cpus-common.c b/cpus-common.c
index 8f5512b3d7..34044f4e4c 100644
--- a/cpus-common.c
+++ b/cpus-common.c
@@ -72,6 +72,8 @@ static int cpu_get_free_index(void)
     return max_cpu_index;
 }
 
+CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
+
 void cpu_list_add(CPUState *cpu)
 {
     QEMU_LOCK_GUARD(&qemu_cpu_list_lock);
@@ -96,6 +98,22 @@ void cpu_list_remove(CPUState *cpu)
     cpu->cpu_index = UNASSIGNED_CPU_INDEX;
 }
 
+CPUState *qemu_get_cpu(int index)
+{
+    CPUState *cpu;
+
+    CPU_FOREACH(cpu) {
+        if (cpu->cpu_index == index) {
+            return cpu;
+        }
+    }
+
+    return NULL;
+}
+
+/* current CPU in the current thread. It is only valid inside cpu_exec() */
+__thread CPUState *current_cpu;
+
 struct qemu_work_item {
     QSIMPLEQ_ENTRY(qemu_work_item) node;
     run_on_cpu_func func;
diff --git a/cpus.c b/cpus.c
deleted file mode 100644
index 41d1c5099f..0000000000
--- a/cpus.c
+++ /dev/null
@@ -1,2329 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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.
- */
-
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "qemu/config-file.h"
-#include "qemu/cutils.h"
-#include "migration/vmstate.h"
-#include "monitor/monitor.h"
-#include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-events-run-state.h"
-#include "qapi/qmp/qerror.h"
-#include "qemu/error-report.h"
-#include "qemu/qemu-print.h"
-#include "sysemu/tcg.h"
-#include "sysemu/block-backend.h"
-#include "exec/gdbstub.h"
-#include "sysemu/dma.h"
-#include "sysemu/hw_accel.h"
-#include "sysemu/kvm.h"
-#include "sysemu/hax.h"
-#include "sysemu/hvf.h"
-#include "sysemu/whpx.h"
-#include "exec/exec-all.h"
-
-#include "qemu/thread.h"
-#include "qemu/plugin.h"
-#include "sysemu/cpus.h"
-#include "sysemu/qtest.h"
-#include "qemu/main-loop.h"
-#include "qemu/option.h"
-#include "qemu/bitmap.h"
-#include "qemu/seqlock.h"
-#include "qemu/guest-random.h"
-#include "tcg/tcg.h"
-#include "hw/nmi.h"
-#include "sysemu/replay.h"
-#include "sysemu/runstate.h"
-#include "hw/boards.h"
-#include "hw/hw.h"
-
-#ifdef CONFIG_LINUX
-
-#include <sys/prctl.h>
-
-#ifndef PR_MCE_KILL
-#define PR_MCE_KILL 33
-#endif
-
-#ifndef PR_MCE_KILL_SET
-#define PR_MCE_KILL_SET 1
-#endif
-
-#ifndef PR_MCE_KILL_EARLY
-#define PR_MCE_KILL_EARLY 1
-#endif
-
-#endif /* CONFIG_LINUX */
-
-static QemuMutex qemu_global_mutex;
-
-int64_t max_delay;
-int64_t max_advance;
-
-/* vcpu throttling controls */
-static QEMUTimer *throttle_timer;
-static unsigned int throttle_percentage;
-
-#define CPU_THROTTLE_PCT_MIN 1
-#define CPU_THROTTLE_PCT_MAX 99
-#define CPU_THROTTLE_TIMESLICE_NS 10000000
-
-bool cpu_is_stopped(CPUState *cpu)
-{
-    return cpu->stopped || !runstate_is_running();
-}
-
-static inline bool cpu_work_list_empty(CPUState *cpu)
-{
-    bool ret;
-
-    qemu_mutex_lock(&cpu->work_mutex);
-    ret = QSIMPLEQ_EMPTY(&cpu->work_list);
-    qemu_mutex_unlock(&cpu->work_mutex);
-    return ret;
-}
-
-static bool cpu_thread_is_idle(CPUState *cpu)
-{
-    if (cpu->stop || !cpu_work_list_empty(cpu)) {
-        return false;
-    }
-    if (cpu_is_stopped(cpu)) {
-        return true;
-    }
-    if (!cpu->halted || cpu_has_work(cpu) ||
-        kvm_halt_in_kernel()) {
-        return false;
-    }
-    return true;
-}
-
-static bool all_cpu_threads_idle(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (!cpu_thread_is_idle(cpu)) {
-            return false;
-        }
-    }
-    return true;
-}
-
-/***********************************************************/
-/* guest cycle counter */
-
-/* Protected by TimersState seqlock */
-
-static bool icount_sleep = true;
-/* Arbitrarily pick 1MIPS as the minimum allowable speed.  */
-#define MAX_ICOUNT_SHIFT 10
-
-typedef struct TimersState {
-    /* Protected by BQL.  */
-    int64_t cpu_ticks_prev;
-    int64_t cpu_ticks_offset;
-
-    /* Protect fields that can be respectively read outside the
-     * BQL, and written from multiple threads.
-     */
-    QemuSeqLock vm_clock_seqlock;
-    QemuSpin vm_clock_lock;
-
-    int16_t cpu_ticks_enabled;
-
-    /* Conversion factor from emulated instructions to virtual clock ticks.  */
-    int16_t icount_time_shift;
-
-    /* Compensate for varying guest execution speed.  */
-    int64_t qemu_icount_bias;
-
-    int64_t vm_clock_warp_start;
-    int64_t cpu_clock_offset;
-
-    /* Only written by TCG thread */
-    int64_t qemu_icount;
-
-    /* for adjusting icount */
-    QEMUTimer *icount_rt_timer;
-    QEMUTimer *icount_vm_timer;
-    QEMUTimer *icount_warp_timer;
-} TimersState;
-
-static TimersState timers_state;
-bool mttcg_enabled;
-
-
-/* The current number of executed instructions is based on what we
- * originally budgeted minus the current state of the decrementing
- * icount counters in extra/u16.low.
- */
-static int64_t cpu_get_icount_executed(CPUState *cpu)
-{
-    return (cpu->icount_budget -
-            (cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra));
-}
-
-/*
- * Update the global shared timer_state.qemu_icount to take into
- * account executed instructions. This is done by the TCG vCPU
- * thread so the main-loop can see time has moved forward.
- */
-static void cpu_update_icount_locked(CPUState *cpu)
-{
-    int64_t executed = cpu_get_icount_executed(cpu);
-    cpu->icount_budget -= executed;
-
-    atomic_set_i64(&timers_state.qemu_icount,
-                   timers_state.qemu_icount + executed);
-}
-
-/*
- * Update the global shared timer_state.qemu_icount to take into
- * account executed instructions. This is done by the TCG vCPU
- * thread so the main-loop can see time has moved forward.
- */
-void cpu_update_icount(CPUState *cpu)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    cpu_update_icount_locked(cpu);
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-static int64_t cpu_get_icount_raw_locked(void)
-{
-    CPUState *cpu = current_cpu;
-
-    if (cpu && cpu->running) {
-        if (!cpu->can_do_io) {
-            error_report("Bad icount read");
-            exit(1);
-        }
-        /* Take into account what has run */
-        cpu_update_icount_locked(cpu);
-    }
-    /* The read is protected by the seqlock, but needs atomic64 to avoid UB */
-    return atomic_read_i64(&timers_state.qemu_icount);
-}
-
-static int64_t cpu_get_icount_locked(void)
-{
-    int64_t icount = cpu_get_icount_raw_locked();
-    return atomic_read_i64(&timers_state.qemu_icount_bias) +
-        cpu_icount_to_ns(icount);
-}
-
-int64_t cpu_get_icount_raw(void)
-{
-    int64_t icount;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        icount = cpu_get_icount_raw_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return icount;
-}
-
-/* Return the virtual CPU time, based on the instruction counter.  */
-int64_t cpu_get_icount(void)
-{
-    int64_t icount;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        icount = cpu_get_icount_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return icount;
-}
-
-int64_t cpu_icount_to_ns(int64_t icount)
-{
-    return icount << atomic_read(&timers_state.icount_time_shift);
-}
-
-static int64_t cpu_get_ticks_locked(void)
-{
-    int64_t ticks = timers_state.cpu_ticks_offset;
-    if (timers_state.cpu_ticks_enabled) {
-        ticks += cpu_get_host_ticks();
-    }
-
-    if (timers_state.cpu_ticks_prev > ticks) {
-        /* Non increasing ticks may happen if the host uses software suspend.  */
-        timers_state.cpu_ticks_offset += timers_state.cpu_ticks_prev - ticks;
-        ticks = timers_state.cpu_ticks_prev;
-    }
-
-    timers_state.cpu_ticks_prev = ticks;
-    return ticks;
-}
-
-/* return the time elapsed in VM between vm_start and vm_stop.  Unless
- * icount is active, cpu_get_ticks() uses units of the host CPU cycle
- * counter.
- */
-int64_t cpu_get_ticks(void)
-{
-    int64_t ticks;
-
-    if (use_icount) {
-        return cpu_get_icount();
-    }
-
-    qemu_spin_lock(&timers_state.vm_clock_lock);
-    ticks = cpu_get_ticks_locked();
-    qemu_spin_unlock(&timers_state.vm_clock_lock);
-    return ticks;
-}
-
-static int64_t cpu_get_clock_locked(void)
-{
-    int64_t time;
-
-    time = timers_state.cpu_clock_offset;
-    if (timers_state.cpu_ticks_enabled) {
-        time += get_clock();
-    }
-
-    return time;
-}
-
-/* Return the monotonic time elapsed in VM, i.e.,
- * the time between vm_start and vm_stop
- */
-int64_t cpu_get_clock(void)
-{
-    int64_t ti;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        ti = cpu_get_clock_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return ti;
-}
-
-/* enable cpu_get_ticks()
- * Caller must hold BQL which serves as mutex for vm_clock_seqlock.
- */
-void cpu_enable_ticks(void)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (!timers_state.cpu_ticks_enabled) {
-        timers_state.cpu_ticks_offset -= cpu_get_host_ticks();
-        timers_state.cpu_clock_offset -= get_clock();
-        timers_state.cpu_ticks_enabled = 1;
-    }
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-}
-
-/* disable cpu_get_ticks() : the clock is stopped. You must not call
- * cpu_get_ticks() after that.
- * Caller must hold BQL which serves as mutex for vm_clock_seqlock.
- */
-void cpu_disable_ticks(void)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (timers_state.cpu_ticks_enabled) {
-        timers_state.cpu_ticks_offset += cpu_get_host_ticks();
-        timers_state.cpu_clock_offset = cpu_get_clock_locked();
-        timers_state.cpu_ticks_enabled = 0;
-    }
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-/* Correlation between real and virtual time is always going to be
-   fairly approximate, so ignore small variation.
-   When the guest is idle real and virtual time will be aligned in
-   the IO wait loop.  */
-#define ICOUNT_WOBBLE (NANOSECONDS_PER_SECOND / 10)
-
-static void icount_adjust(void)
-{
-    int64_t cur_time;
-    int64_t cur_icount;
-    int64_t delta;
-
-    /* Protected by TimersState mutex.  */
-    static int64_t last_delta;
-
-    /* If the VM is not running, then do nothing.  */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    cur_time = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
-                                   cpu_get_clock_locked());
-    cur_icount = cpu_get_icount_locked();
-
-    delta = cur_icount - cur_time;
-    /* FIXME: This is a very crude algorithm, somewhat prone to oscillation.  */
-    if (delta > 0
-        && last_delta + ICOUNT_WOBBLE < delta * 2
-        && timers_state.icount_time_shift > 0) {
-        /* The guest is getting too far ahead.  Slow time down.  */
-        atomic_set(&timers_state.icount_time_shift,
-                   timers_state.icount_time_shift - 1);
-    }
-    if (delta < 0
-        && last_delta - ICOUNT_WOBBLE > delta * 2
-        && timers_state.icount_time_shift < MAX_ICOUNT_SHIFT) {
-        /* The guest is getting too far behind.  Speed time up.  */
-        atomic_set(&timers_state.icount_time_shift,
-                   timers_state.icount_time_shift + 1);
-    }
-    last_delta = delta;
-    atomic_set_i64(&timers_state.qemu_icount_bias,
-                   cur_icount - (timers_state.qemu_icount
-                                 << timers_state.icount_time_shift));
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-static void icount_adjust_rt(void *opaque)
-{
-    timer_mod(timers_state.icount_rt_timer,
-              qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
-    icount_adjust();
-}
-
-static void icount_adjust_vm(void *opaque)
-{
-    timer_mod(timers_state.icount_vm_timer,
-                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
-                   NANOSECONDS_PER_SECOND / 10);
-    icount_adjust();
-}
-
-static int64_t qemu_icount_round(int64_t count)
-{
-    int shift = atomic_read(&timers_state.icount_time_shift);
-    return (count + (1 << shift) - 1) >> shift;
-}
-
-static void icount_warp_rt(void)
-{
-    unsigned seq;
-    int64_t warp_start;
-
-    /* The icount_warp_timer is rescheduled soon after vm_clock_warp_start
-     * changes from -1 to another value, so the race here is okay.
-     */
-    do {
-        seq = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        warp_start = timers_state.vm_clock_warp_start;
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, seq));
-
-    if (warp_start == -1) {
-        return;
-    }
-
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (runstate_is_running()) {
-        int64_t clock = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
-                                            cpu_get_clock_locked());
-        int64_t warp_delta;
-
-        warp_delta = clock - timers_state.vm_clock_warp_start;
-        if (use_icount == 2) {
-            /*
-             * In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too
-             * far ahead of real time.
-             */
-            int64_t cur_icount = cpu_get_icount_locked();
-            int64_t delta = clock - cur_icount;
-            warp_delta = MIN(warp_delta, delta);
-        }
-        atomic_set_i64(&timers_state.qemu_icount_bias,
-                       timers_state.qemu_icount_bias + warp_delta);
-    }
-    timers_state.vm_clock_warp_start = -1;
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-
-    if (qemu_clock_expired(QEMU_CLOCK_VIRTUAL)) {
-        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    }
-}
-
-static void icount_timer_cb(void *opaque)
-{
-    /* No need for a checkpoint because the timer already synchronizes
-     * with CHECKPOINT_CLOCK_VIRTUAL_RT.
-     */
-    icount_warp_rt();
-}
-
-void qtest_clock_warp(int64_t dest)
-{
-    int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    AioContext *aio_context;
-    assert(qtest_enabled());
-    aio_context = qemu_get_aio_context();
-    while (clock < dest) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                                      QEMU_TIMER_ATTR_ALL);
-        int64_t warp = qemu_soonest_timeout(dest - clock, deadline);
-
-        seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                           &timers_state.vm_clock_lock);
-        atomic_set_i64(&timers_state.qemu_icount_bias,
-                       timers_state.qemu_icount_bias + warp);
-        seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                             &timers_state.vm_clock_lock);
-
-        qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
-        timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]);
-        clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    }
-    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-}
-
-void qemu_start_warp_timer(void)
-{
-    int64_t clock;
-    int64_t deadline;
-
-    if (!use_icount) {
-        return;
-    }
-
-    /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
-     * do not fire, so computing the deadline does not make sense.
-     */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    if (replay_mode != REPLAY_MODE_PLAY) {
-        if (!all_cpu_threads_idle()) {
-            return;
-        }
-
-        if (qtest_enabled()) {
-            /* When testing, qtest commands advance icount.  */
-            return;
-        }
-
-        replay_checkpoint(CHECKPOINT_CLOCK_WARP_START);
-    } else {
-        /* warp clock deterministically in record/replay mode */
-        if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_START)) {
-            /* vCPU is sleeping and warp can't be started.
-               It is probably a race condition: notification sent
-               to vCPU was processed in advance and vCPU went to sleep.
-               Therefore we have to wake it up for doing someting. */
-            if (replay_has_checkpoint()) {
-                qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-            }
-            return;
-        }
-    }
-
-    /* We want to use the earliest deadline from ALL vm_clocks */
-    clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
-    deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                          ~QEMU_TIMER_ATTR_EXTERNAL);
-    if (deadline < 0) {
-        static bool notified;
-        if (!icount_sleep && !notified) {
-            warn_report("icount sleep disabled and no active timers");
-            notified = true;
-        }
-        return;
-    }
-
-    if (deadline > 0) {
-        /*
-         * Ensure QEMU_CLOCK_VIRTUAL proceeds even when the virtual CPU goes to
-         * sleep.  Otherwise, the CPU might be waiting for a future timer
-         * interrupt to wake it up, but the interrupt never comes because
-         * the vCPU isn't running any insns and thus doesn't advance the
-         * QEMU_CLOCK_VIRTUAL.
-         */
-        if (!icount_sleep) {
-            /*
-             * We never let VCPUs sleep in no sleep icount mode.
-             * If there is a pending QEMU_CLOCK_VIRTUAL timer we just advance
-             * to the next QEMU_CLOCK_VIRTUAL event and notify it.
-             * It is useful when we want a deterministic execution time,
-             * isolated from host latencies.
-             */
-            seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                               &timers_state.vm_clock_lock);
-            atomic_set_i64(&timers_state.qemu_icount_bias,
-                           timers_state.qemu_icount_bias + deadline);
-            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                                 &timers_state.vm_clock_lock);
-            qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-        } else {
-            /*
-             * We do stop VCPUs and only advance QEMU_CLOCK_VIRTUAL after some
-             * "real" time, (related to the time left until the next event) has
-             * passed. The QEMU_CLOCK_VIRTUAL_RT clock will do this.
-             * This avoids that the warps are visible externally; for example,
-             * you will not be sending network packets continuously instead of
-             * every 100ms.
-             */
-            seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                               &timers_state.vm_clock_lock);
-            if (timers_state.vm_clock_warp_start == -1
-                || timers_state.vm_clock_warp_start > clock) {
-                timers_state.vm_clock_warp_start = clock;
-            }
-            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                                 &timers_state.vm_clock_lock);
-            timer_mod_anticipate(timers_state.icount_warp_timer,
-                                 clock + deadline);
-        }
-    } else if (deadline == 0) {
-        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    }
-}
-
-static void qemu_account_warp_timer(void)
-{
-    if (!use_icount || !icount_sleep) {
-        return;
-    }
-
-    /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
-     * do not fire, so computing the deadline does not make sense.
-     */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    /* warp clock deterministically in record/replay mode */
-    if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_ACCOUNT)) {
-        return;
-    }
-
-    timer_del(timers_state.icount_warp_timer);
-    icount_warp_rt();
-}
-
-static bool icount_state_needed(void *opaque)
-{
-    return use_icount;
-}
-
-static bool warp_timer_state_needed(void *opaque)
-{
-    TimersState *s = opaque;
-    return s->icount_warp_timer != NULL;
-}
-
-static bool adjust_timers_state_needed(void *opaque)
-{
-    TimersState *s = opaque;
-    return s->icount_rt_timer != NULL;
-}
-
-static bool shift_state_needed(void *opaque)
-{
-    return use_icount == 2;
-}
-
-/*
- * Subsection for warp timer migration is optional, because may not be created
- */
-static const VMStateDescription icount_vmstate_warp_timer = {
-    .name = "timer/icount/warp_timer",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = warp_timer_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(vm_clock_warp_start, TimersState),
-        VMSTATE_TIMER_PTR(icount_warp_timer, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-static const VMStateDescription icount_vmstate_adjust_timers = {
-    .name = "timer/icount/timers",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = adjust_timers_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_TIMER_PTR(icount_rt_timer, TimersState),
-        VMSTATE_TIMER_PTR(icount_vm_timer, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-static const VMStateDescription icount_vmstate_shift = {
-    .name = "timer/icount/shift",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = shift_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT16(icount_time_shift, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-/*
- * This is a subsection for icount migration.
- */
-static const VMStateDescription icount_vmstate_timers = {
-    .name = "timer/icount",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = icount_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(qemu_icount_bias, TimersState),
-        VMSTATE_INT64(qemu_icount, TimersState),
-        VMSTATE_END_OF_LIST()
-    },
-    .subsections = (const VMStateDescription*[]) {
-        &icount_vmstate_warp_timer,
-        &icount_vmstate_adjust_timers,
-        &icount_vmstate_shift,
-        NULL
-    }
-};
-
-static const VMStateDescription vmstate_timers = {
-    .name = "timer",
-    .version_id = 2,
-    .minimum_version_id = 1,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(cpu_ticks_offset, TimersState),
-        VMSTATE_UNUSED(8),
-        VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2),
-        VMSTATE_END_OF_LIST()
-    },
-    .subsections = (const VMStateDescription*[]) {
-        &icount_vmstate_timers,
-        NULL
-    }
-};
-
-static void cpu_throttle_thread(CPUState *cpu, run_on_cpu_data opaque)
-{
-    double pct;
-    double throttle_ratio;
-    int64_t sleeptime_ns, endtime_ns;
-
-    if (!cpu_throttle_get_percentage()) {
-        return;
-    }
-
-    pct = (double)cpu_throttle_get_percentage()/100;
-    throttle_ratio = pct / (1 - pct);
-    /* Add 1ns to fix double's rounding error (like 0.9999999...) */
-    sleeptime_ns = (int64_t)(throttle_ratio * CPU_THROTTLE_TIMESLICE_NS + 1);
-    endtime_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + sleeptime_ns;
-    while (sleeptime_ns > 0 && !cpu->stop) {
-        if (sleeptime_ns > SCALE_MS) {
-            qemu_cond_timedwait(cpu->halt_cond, &qemu_global_mutex,
-                                sleeptime_ns / SCALE_MS);
-        } else {
-            qemu_mutex_unlock_iothread();
-            g_usleep(sleeptime_ns / SCALE_US);
-            qemu_mutex_lock_iothread();
-        }
-        sleeptime_ns = endtime_ns - qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
-    }
-    atomic_set(&cpu->throttle_thread_scheduled, 0);
-}
-
-static void cpu_throttle_timer_tick(void *opaque)
-{
-    CPUState *cpu;
-    double pct;
-
-    /* Stop the timer if needed */
-    if (!cpu_throttle_get_percentage()) {
-        return;
-    }
-    CPU_FOREACH(cpu) {
-        if (!atomic_xchg(&cpu->throttle_thread_scheduled, 1)) {
-            async_run_on_cpu(cpu, cpu_throttle_thread,
-                             RUN_ON_CPU_NULL);
-        }
-    }
-
-    pct = (double)cpu_throttle_get_percentage()/100;
-    timer_mod(throttle_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT) +
-                                   CPU_THROTTLE_TIMESLICE_NS / (1-pct));
-}
-
-void cpu_throttle_set(int new_throttle_pct)
-{
-    /* Ensure throttle percentage is within valid range */
-    new_throttle_pct = MIN(new_throttle_pct, CPU_THROTTLE_PCT_MAX);
-    new_throttle_pct = MAX(new_throttle_pct, CPU_THROTTLE_PCT_MIN);
-
-    atomic_set(&throttle_percentage, new_throttle_pct);
-
-    timer_mod(throttle_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT) +
-                                       CPU_THROTTLE_TIMESLICE_NS);
-}
-
-void cpu_throttle_stop(void)
-{
-    atomic_set(&throttle_percentage, 0);
-}
-
-bool cpu_throttle_active(void)
-{
-    return (cpu_throttle_get_percentage() != 0);
-}
-
-int cpu_throttle_get_percentage(void)
-{
-    return atomic_read(&throttle_percentage);
-}
-
-void cpu_ticks_init(void)
-{
-    seqlock_init(&timers_state.vm_clock_seqlock);
-    qemu_spin_init(&timers_state.vm_clock_lock);
-    vmstate_register(NULL, 0, &vmstate_timers, &timers_state);
-    throttle_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                           cpu_throttle_timer_tick, NULL);
-}
-
-void configure_icount(QemuOpts *opts, Error **errp)
-{
-    const char *option = qemu_opt_get(opts, "shift");
-    bool sleep = qemu_opt_get_bool(opts, "sleep", true);
-    bool align = qemu_opt_get_bool(opts, "align", false);
-    long time_shift = -1;
-
-    if (!option) {
-        if (qemu_opt_get(opts, "align") != NULL) {
-            error_setg(errp, "Please specify shift option when using align");
-        }
-        return;
-    }
-
-    if (align && !sleep) {
-        error_setg(errp, "align=on and sleep=off are incompatible");
-        return;
-    }
-
-    if (strcmp(option, "auto") != 0) {
-        if (qemu_strtol(option, NULL, 0, &time_shift) < 0
-            || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
-            error_setg(errp, "icount: Invalid shift value");
-            return;
-        }
-    } else if (icount_align_option) {
-        error_setg(errp, "shift=auto and align=on are incompatible");
-        return;
-    } else if (!icount_sleep) {
-        error_setg(errp, "shift=auto and sleep=off are incompatible");
-        return;
-    }
-
-    icount_sleep = sleep;
-    if (icount_sleep) {
-        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                         icount_timer_cb, NULL);
-    }
-
-    icount_align_option = align;
-
-    if (time_shift >= 0) {
-        timers_state.icount_time_shift = time_shift;
-        use_icount = 1;
-        return;
-    }
-
-    use_icount = 2;
-
-    /* 125MIPS seems a reasonable initial guess at the guest speed.
-       It will be corrected fairly quickly anyway.  */
-    timers_state.icount_time_shift = 3;
-
-    /* Have both realtime and virtual time triggers for speed adjustment.
-       The realtime trigger catches emulated time passing too slowly,
-       the virtual time trigger catches emulated time passing too fast.
-       Realtime triggers occur even when idle, so use them less frequently
-       than VM triggers.  */
-    timers_state.vm_clock_warp_start = -1;
-    timers_state.icount_rt_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL_RT,
-                                   icount_adjust_rt, NULL);
-    timer_mod(timers_state.icount_rt_timer,
-                   qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
-    timers_state.icount_vm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
-                                        icount_adjust_vm, NULL);
-    timer_mod(timers_state.icount_vm_timer,
-                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
-                   NANOSECONDS_PER_SECOND / 10);
-}
-
-/***********************************************************/
-/* TCG vCPU kick timer
- *
- * The kick timer is responsible for moving single threaded vCPU
- * emulation on to the next vCPU. If more than one vCPU is running a
- * timer event with force a cpu->exit so the next vCPU can get
- * scheduled.
- *
- * The timer is removed if all vCPUs are idle and restarted again once
- * idleness is complete.
- */
-
-static QEMUTimer *tcg_kick_vcpu_timer;
-static CPUState *tcg_current_rr_cpu;
-
-#define TCG_KICK_PERIOD (NANOSECONDS_PER_SECOND / 10)
-
-static inline int64_t qemu_tcg_next_kick(void)
-{
-    return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + TCG_KICK_PERIOD;
-}
-
-/* Kick the currently round-robin scheduled vCPU to next */
-static void qemu_cpu_kick_rr_next_cpu(void)
-{
-    CPUState *cpu;
-    do {
-        cpu = atomic_mb_read(&tcg_current_rr_cpu);
-        if (cpu) {
-            cpu_exit(cpu);
-        }
-    } while (cpu != atomic_mb_read(&tcg_current_rr_cpu));
-}
-
-/* Kick all RR vCPUs */
-static void qemu_cpu_kick_rr_cpus(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_exit(cpu);
-    };
-}
-
-static void do_nothing(CPUState *cpu, run_on_cpu_data unused)
-{
-}
-
-void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
-{
-    if (!use_icount || type != QEMU_CLOCK_VIRTUAL) {
-        qemu_notify_event();
-        return;
-    }
-
-    if (qemu_in_vcpu_thread()) {
-        /* A CPU is currently running; kick it back out to the
-         * tcg_cpu_exec() loop so it will recalculate its
-         * icount deadline immediately.
-         */
-        qemu_cpu_kick(current_cpu);
-    } else if (first_cpu) {
-        /* qemu_cpu_kick is not enough to kick a halted CPU out of
-         * qemu_tcg_wait_io_event.  async_run_on_cpu, instead,
-         * causes cpu_thread_is_idle to return false.  This way,
-         * handle_icount_deadline can run.
-         * If we have no CPUs at all for some reason, we don't
-         * need to do anything.
-         */
-        async_run_on_cpu(first_cpu, do_nothing, RUN_ON_CPU_NULL);
-    }
-}
-
-static void kick_tcg_thread(void *opaque)
-{
-    timer_mod(tcg_kick_vcpu_timer, qemu_tcg_next_kick());
-    qemu_cpu_kick_rr_next_cpu();
-}
-
-static void start_tcg_kick_timer(void)
-{
-    assert(!mttcg_enabled);
-    if (!tcg_kick_vcpu_timer && CPU_NEXT(first_cpu)) {
-        tcg_kick_vcpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
-                                           kick_tcg_thread, NULL);
-    }
-    if (tcg_kick_vcpu_timer && !timer_pending(tcg_kick_vcpu_timer)) {
-        timer_mod(tcg_kick_vcpu_timer, qemu_tcg_next_kick());
-    }
-}
-
-static void stop_tcg_kick_timer(void)
-{
-    assert(!mttcg_enabled);
-    if (tcg_kick_vcpu_timer && timer_pending(tcg_kick_vcpu_timer)) {
-        timer_del(tcg_kick_vcpu_timer);
-    }
-}
-
-/***********************************************************/
-void hw_error(const char *fmt, ...)
-{
-    va_list ap;
-    CPUState *cpu;
-
-    va_start(ap, fmt);
-    fprintf(stderr, "qemu: hardware error: ");
-    vfprintf(stderr, fmt, ap);
-    fprintf(stderr, "\n");
-    CPU_FOREACH(cpu) {
-        fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
-        cpu_dump_state(cpu, stderr, CPU_DUMP_FPU);
-    }
-    va_end(ap);
-    abort();
-}
-
-void cpu_synchronize_all_states(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_state(cpu);
-        /* TODO: move to cpu_synchronize_state() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_state(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_post_reset(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_post_reset(cpu);
-        /* TODO: move to cpu_synchronize_post_reset() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_post_reset(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_post_init(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_post_init(cpu);
-        /* TODO: move to cpu_synchronize_post_init() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_post_init(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_pre_loadvm(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_pre_loadvm(cpu);
-    }
-}
-
-static int do_vm_stop(RunState state, bool send_stop)
-{
-    int ret = 0;
-
-    if (runstate_is_running()) {
-        runstate_set(state);
-        cpu_disable_ticks();
-        pause_all_vcpus();
-        vm_state_notify(0, state);
-        if (send_stop) {
-            qapi_event_send_stop();
-        }
-    }
-
-    bdrv_drain_all();
-    ret = bdrv_flush_all();
-
-    return ret;
-}
-
-/* Special vm_stop() variant for terminating the process.  Historically clients
- * did not expect a QMP STOP event and so we need to retain compatibility.
- */
-int vm_shutdown(void)
-{
-    return do_vm_stop(RUN_STATE_SHUTDOWN, false);
-}
-
-static bool cpu_can_run(CPUState *cpu)
-{
-    if (cpu->stop) {
-        return false;
-    }
-    if (cpu_is_stopped(cpu)) {
-        return false;
-    }
-    return true;
-}
-
-static void cpu_handle_guest_debug(CPUState *cpu)
-{
-    gdb_set_stop_cpu(cpu);
-    qemu_system_debug_request();
-    cpu->stopped = true;
-}
-
-#ifdef CONFIG_LINUX
-static void sigbus_reraise(void)
-{
-    sigset_t set;
-    struct sigaction action;
-
-    memset(&action, 0, sizeof(action));
-    action.sa_handler = SIG_DFL;
-    if (!sigaction(SIGBUS, &action, NULL)) {
-        raise(SIGBUS);
-        sigemptyset(&set);
-        sigaddset(&set, SIGBUS);
-        pthread_sigmask(SIG_UNBLOCK, &set, NULL);
-    }
-    perror("Failed to re-raise SIGBUS!\n");
-    abort();
-}
-
-static void sigbus_handler(int n, siginfo_t *siginfo, void *ctx)
-{
-    if (siginfo->si_code != BUS_MCEERR_AO && siginfo->si_code != BUS_MCEERR_AR) {
-        sigbus_reraise();
-    }
-
-    if (current_cpu) {
-        /* Called asynchronously in VCPU thread.  */
-        if (kvm_on_sigbus_vcpu(current_cpu, siginfo->si_code, siginfo->si_addr)) {
-            sigbus_reraise();
-        }
-    } else {
-        /* Called synchronously (via signalfd) in main thread.  */
-        if (kvm_on_sigbus(siginfo->si_code, siginfo->si_addr)) {
-            sigbus_reraise();
-        }
-    }
-}
-
-static void qemu_init_sigbus(void)
-{
-    struct sigaction action;
-
-    memset(&action, 0, sizeof(action));
-    action.sa_flags = SA_SIGINFO;
-    action.sa_sigaction = sigbus_handler;
-    sigaction(SIGBUS, &action, NULL);
-
-    prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0);
-}
-#else /* !CONFIG_LINUX */
-static void qemu_init_sigbus(void)
-{
-}
-#endif /* !CONFIG_LINUX */
-
-static QemuThread io_thread;
-
-/* cpu creation */
-static QemuCond qemu_cpu_cond;
-/* system init */
-static QemuCond qemu_pause_cond;
-
-void qemu_init_cpu_loop(void)
-{
-    qemu_init_sigbus();
-    qemu_cond_init(&qemu_cpu_cond);
-    qemu_cond_init(&qemu_pause_cond);
-    qemu_mutex_init(&qemu_global_mutex);
-
-    qemu_thread_get_self(&io_thread);
-}
-
-void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data)
-{
-    do_run_on_cpu(cpu, func, data, &qemu_global_mutex);
-}
-
-static void qemu_kvm_destroy_vcpu(CPUState *cpu)
-{
-    if (kvm_destroy_vcpu(cpu) < 0) {
-        error_report("kvm_destroy_vcpu failed");
-        exit(EXIT_FAILURE);
-    }
-}
-
-static void qemu_tcg_destroy_vcpu(CPUState *cpu)
-{
-}
-
-static void qemu_cpu_stop(CPUState *cpu, bool exit)
-{
-    g_assert(qemu_cpu_is_self(cpu));
-    cpu->stop = false;
-    cpu->stopped = true;
-    if (exit) {
-        cpu_exit(cpu);
-    }
-    qemu_cond_broadcast(&qemu_pause_cond);
-}
-
-static void qemu_wait_io_event_common(CPUState *cpu)
-{
-    atomic_mb_set(&cpu->thread_kicked, false);
-    if (cpu->stop) {
-        qemu_cpu_stop(cpu, false);
-    }
-    process_queued_cpu_work(cpu);
-}
-
-static void qemu_tcg_rr_wait_io_event(void)
-{
-    CPUState *cpu;
-
-    while (all_cpu_threads_idle()) {
-        stop_tcg_kick_timer();
-        qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex);
-    }
-
-    start_tcg_kick_timer();
-
-    CPU_FOREACH(cpu) {
-        qemu_wait_io_event_common(cpu);
-    }
-}
-
-static void qemu_wait_io_event(CPUState *cpu)
-{
-    bool slept = false;
-
-    while (cpu_thread_is_idle(cpu)) {
-        if (!slept) {
-            slept = true;
-            qemu_plugin_vcpu_idle_cb(cpu);
-        }
-        qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
-    }
-    if (slept) {
-        qemu_plugin_vcpu_resume_cb(cpu);
-    }
-
-#ifdef _WIN32
-    /* Eat dummy APC queued by qemu_cpu_kick_thread.  */
-    if (!tcg_enabled()) {
-        SleepEx(0, TRUE);
-    }
-#endif
-    qemu_wait_io_event_common(cpu);
-}
-
-static void *qemu_kvm_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    r = kvm_init_vcpu(cpu);
-    if (r < 0) {
-        error_report("kvm_init_vcpu failed: %s", strerror(-r));
-        exit(1);
-    }
-
-    kvm_init_cpu_signals(cpu);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = kvm_cpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    qemu_kvm_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_dummy_cpu_thread_fn(void *arg)
-{
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
-    CPUState *cpu = arg;
-    sigset_t waitset;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    sigemptyset(&waitset);
-    sigaddset(&waitset, SIG_IPI);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        qemu_mutex_unlock_iothread();
-        do {
-            int sig;
-            r = sigwait(&waitset, &sig);
-        } while (r == -1 && (errno == EAGAIN || errno == EINTR));
-        if (r == -1) {
-            perror("sigwait");
-            exit(1);
-        }
-        qemu_mutex_lock_iothread();
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug);
-
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-#endif
-}
-
-static int64_t tcg_get_icount_limit(void)
-{
-    int64_t deadline;
-
-    if (replay_mode != REPLAY_MODE_PLAY) {
-        /*
-         * Include all the timers, because they may need an attention.
-         * Too long CPU execution may create unnecessary delay in UI.
-         */
-        deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                              QEMU_TIMER_ATTR_ALL);
-        /* Check realtime timers, because they help with input processing */
-        deadline = qemu_soonest_timeout(deadline,
-                qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME,
-                                           QEMU_TIMER_ATTR_ALL));
-
-        /* Maintain prior (possibly buggy) behaviour where if no deadline
-         * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than
-         * INT32_MAX nanoseconds ahead, we still use INT32_MAX
-         * nanoseconds.
-         */
-        if ((deadline < 0) || (deadline > INT32_MAX)) {
-            deadline = INT32_MAX;
-        }
-
-        return qemu_icount_round(deadline);
-    } else {
-        return replay_get_instructions();
-    }
-}
-
-static void notify_aio_contexts(void)
-{
-    /* Wake up other AioContexts.  */
-    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
-}
-
-static void handle_icount_deadline(void)
-{
-    assert(qemu_in_vcpu_thread());
-    if (use_icount) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                                      QEMU_TIMER_ATTR_ALL);
-
-        if (deadline == 0) {
-            notify_aio_contexts();
-        }
-    }
-}
-
-static void prepare_icount_for_run(CPUState *cpu)
-{
-    if (use_icount) {
-        int insns_left;
-
-        /* These should always be cleared by process_icount_data after
-         * each vCPU execution. However u16.high can be raised
-         * asynchronously by cpu_exit/cpu_interrupt/tcg_handle_interrupt
-         */
-        g_assert(cpu_neg(cpu)->icount_decr.u16.low == 0);
-        g_assert(cpu->icount_extra == 0);
-
-        cpu->icount_budget = tcg_get_icount_limit();
-        insns_left = MIN(0xffff, cpu->icount_budget);
-        cpu_neg(cpu)->icount_decr.u16.low = insns_left;
-        cpu->icount_extra = cpu->icount_budget - insns_left;
-
-        replay_mutex_lock();
-
-        if (cpu->icount_budget == 0 && replay_has_checkpoint()) {
-            notify_aio_contexts();
-        }
-    }
-}
-
-static void process_icount_data(CPUState *cpu)
-{
-    if (use_icount) {
-        /* Account for executed instructions */
-        cpu_update_icount(cpu);
-
-        /* Reset the counters */
-        cpu_neg(cpu)->icount_decr.u16.low = 0;
-        cpu->icount_extra = 0;
-        cpu->icount_budget = 0;
-
-        replay_account_executed_instructions();
-
-        replay_mutex_unlock();
-    }
-}
-
-
-static int tcg_cpu_exec(CPUState *cpu)
-{
-    int ret;
-#ifdef CONFIG_PROFILER
-    int64_t ti;
-#endif
-
-    assert(tcg_enabled());
-#ifdef CONFIG_PROFILER
-    ti = profile_getclock();
-#endif
-    cpu_exec_start(cpu);
-    ret = cpu_exec(cpu);
-    cpu_exec_end(cpu);
-#ifdef CONFIG_PROFILER
-    atomic_set(&tcg_ctx->prof.cpu_exec_time,
-               tcg_ctx->prof.cpu_exec_time + profile_getclock() - ti);
-#endif
-    return ret;
-}
-
-/* Destroy any remaining vCPUs which have been unplugged and have
- * finished running
- */
-static void deal_with_unplugged_cpus(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (cpu->unplug && !cpu_can_run(cpu)) {
-            qemu_tcg_destroy_vcpu(cpu);
-            cpu->created = false;
-            qemu_cond_signal(&qemu_cpu_cond);
-            break;
-        }
-    }
-}
-
-/* Single-threaded TCG
- *
- * In the single-threaded case each vCPU is simulated in turn. If
- * there is more than a single vCPU we create a simple timer to kick
- * the vCPU and ensure we don't get stuck in a tight loop in one vCPU.
- * This is done explicitly rather than relying on side-effects
- * elsewhere.
- */
-
-static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    assert(tcg_enabled());
-    rcu_register_thread();
-    tcg_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    cpu->can_do_io = 1;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    /* wait for initial kick-off after machine start */
-    while (first_cpu->stopped) {
-        qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex);
-
-        /* process any pending work */
-        CPU_FOREACH(cpu) {
-            current_cpu = cpu;
-            qemu_wait_io_event_common(cpu);
-        }
-    }
-
-    start_tcg_kick_timer();
-
-    cpu = first_cpu;
-
-    /* process any pending work */
-    cpu->exit_request = 1;
-
-    while (1) {
-        qemu_mutex_unlock_iothread();
-        replay_mutex_lock();
-        qemu_mutex_lock_iothread();
-        /* Account partial waits to QEMU_CLOCK_VIRTUAL.  */
-        qemu_account_warp_timer();
-
-        /* Run the timers here.  This is much more efficient than
-         * waking up the I/O thread and waiting for completion.
-         */
-        handle_icount_deadline();
-
-        replay_mutex_unlock();
-
-        if (!cpu) {
-            cpu = first_cpu;
-        }
-
-        while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) {
-
-            atomic_mb_set(&tcg_current_rr_cpu, cpu);
-            current_cpu = cpu;
-
-            qemu_clock_enable(QEMU_CLOCK_VIRTUAL,
-                              (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
-
-            if (cpu_can_run(cpu)) {
-                int r;
-
-                qemu_mutex_unlock_iothread();
-                prepare_icount_for_run(cpu);
-
-                r = tcg_cpu_exec(cpu);
-
-                process_icount_data(cpu);
-                qemu_mutex_lock_iothread();
-
-                if (r == EXCP_DEBUG) {
-                    cpu_handle_guest_debug(cpu);
-                    break;
-                } else if (r == EXCP_ATOMIC) {
-                    qemu_mutex_unlock_iothread();
-                    cpu_exec_step_atomic(cpu);
-                    qemu_mutex_lock_iothread();
-                    break;
-                }
-            } else if (cpu->stop) {
-                if (cpu->unplug) {
-                    cpu = CPU_NEXT(cpu);
-                }
-                break;
-            }
-
-            cpu = CPU_NEXT(cpu);
-        } /* while (cpu && !cpu->exit_request).. */
-
-        /* Does not need atomic_mb_set because a spurious wakeup is okay.  */
-        atomic_set(&tcg_current_rr_cpu, NULL);
-
-        if (cpu && cpu->exit_request) {
-            atomic_mb_set(&cpu->exit_request, 0);
-        }
-
-        if (use_icount && all_cpu_threads_idle()) {
-            /*
-             * When all cpus are sleeping (e.g in WFI), to avoid a deadlock
-             * in the main_loop, wake it up in order to start the warp timer.
-             */
-            qemu_notify_event();
-        }
-
-        qemu_tcg_rr_wait_io_event();
-        deal_with_unplugged_cpus();
-    }
-
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_hax_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    current_cpu = cpu;
-
-    hax_init_vcpu(cpu);
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = hax_smp_cpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-    rcu_unregister_thread();
-    return NULL;
-}
-
-/* The HVF-specific vCPU thread function. This one should only run when the host
- * CPU supports the VMX "unrestricted guest" feature. */
-static void *qemu_hvf_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    int r;
-
-    assert(hvf_enabled());
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    hvf_init_vcpu(cpu);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = hvf_vcpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    hvf_vcpu_destroy(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_whpx_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    current_cpu = cpu;
-
-    r = whpx_init_vcpu(cpu);
-    if (r < 0) {
-        fprintf(stderr, "whpx_init_vcpu failed: %s\n", strerror(-r));
-        exit(1);
-    }
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = whpx_vcpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        while (cpu_thread_is_idle(cpu)) {
-            qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
-        }
-        qemu_wait_io_event_common(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    whpx_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-#ifdef _WIN32
-static void CALLBACK dummy_apc_func(ULONG_PTR unused)
-{
-}
-#endif
-
-/* Multi-threaded TCG
- *
- * In the multi-threaded case each vCPU has its own thread. The TLS
- * variable current_cpu can be used deep in the code to find the
- * current CPUState for a given thread.
- */
-
-static void *qemu_tcg_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    assert(tcg_enabled());
-    g_assert(!use_icount);
-
-    rcu_register_thread();
-    tcg_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    /* process any pending work */
-    cpu->exit_request = 1;
-
-    do {
-        if (cpu_can_run(cpu)) {
-            int r;
-            qemu_mutex_unlock_iothread();
-            r = tcg_cpu_exec(cpu);
-            qemu_mutex_lock_iothread();
-            switch (r) {
-            case EXCP_DEBUG:
-                cpu_handle_guest_debug(cpu);
-                break;
-            case EXCP_HALTED:
-                /* during start-up the vCPU is reset and the thread is
-                 * kicked several times. If we don't ensure we go back
-                 * to sleep in the halted state we won't cleanly
-                 * start-up when the vCPU is enabled.
-                 *
-                 * cpu->halted should ensure we sleep in wait_io_event
-                 */
-                g_assert(cpu->halted);
-                break;
-            case EXCP_ATOMIC:
-                qemu_mutex_unlock_iothread();
-                cpu_exec_step_atomic(cpu);
-                qemu_mutex_lock_iothread();
-            default:
-                /* Ignore everything else? */
-                break;
-            }
-        }
-
-        atomic_mb_set(&cpu->exit_request, 0);
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    qemu_tcg_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void qemu_cpu_kick_thread(CPUState *cpu)
-{
-#ifndef _WIN32
-    int err;
-
-    if (cpu->thread_kicked) {
-        return;
-    }
-    cpu->thread_kicked = true;
-    err = pthread_kill(cpu->thread->thread, SIG_IPI);
-    if (err && err != ESRCH) {
-        fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
-        exit(1);
-    }
-#else /* _WIN32 */
-    if (!qemu_cpu_is_self(cpu)) {
-        if (whpx_enabled()) {
-            whpx_vcpu_kick(cpu);
-        } else if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) {
-            fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n",
-                    __func__, GetLastError());
-            exit(1);
-        }
-    }
-#endif
-}
-
-void qemu_cpu_kick(CPUState *cpu)
-{
-    qemu_cond_broadcast(cpu->halt_cond);
-    if (tcg_enabled()) {
-        if (qemu_tcg_mttcg_enabled()) {
-            cpu_exit(cpu);
-        } else {
-            qemu_cpu_kick_rr_cpus();
-        }
-    } else {
-        if (hax_enabled()) {
-            /*
-             * FIXME: race condition with the exit_request check in
-             * hax_vcpu_hax_exec
-             */
-            cpu->exit_request = 1;
-        }
-        qemu_cpu_kick_thread(cpu);
-    }
-}
-
-void qemu_cpu_kick_self(void)
-{
-    assert(current_cpu);
-    qemu_cpu_kick_thread(current_cpu);
-}
-
-bool qemu_cpu_is_self(CPUState *cpu)
-{
-    return qemu_thread_is_self(cpu->thread);
-}
-
-bool qemu_in_vcpu_thread(void)
-{
-    return current_cpu && qemu_cpu_is_self(current_cpu);
-}
-
-static __thread bool iothread_locked = false;
-
-bool qemu_mutex_iothread_locked(void)
-{
-    return iothread_locked;
-}
-
-/*
- * The BQL is taken from so many places that it is worth profiling the
- * callers directly, instead of funneling them all through a single function.
- */
-void qemu_mutex_lock_iothread_impl(const char *file, int line)
-{
-    QemuMutexLockFunc bql_lock = atomic_read(&qemu_bql_mutex_lock_func);
-
-    g_assert(!qemu_mutex_iothread_locked());
-    bql_lock(&qemu_global_mutex, file, line);
-    iothread_locked = true;
-}
-
-void qemu_mutex_unlock_iothread(void)
-{
-    g_assert(qemu_mutex_iothread_locked());
-    iothread_locked = false;
-    qemu_mutex_unlock(&qemu_global_mutex);
-}
-
-void qemu_cond_wait_iothread(QemuCond *cond)
-{
-    qemu_cond_wait(cond, &qemu_global_mutex);
-}
-
-static bool all_vcpus_paused(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (!cpu->stopped) {
-            return false;
-        }
-    }
-
-    return true;
-}
-
-void pause_all_vcpus(void)
-{
-    CPUState *cpu;
-
-    qemu_clock_enable(QEMU_CLOCK_VIRTUAL, false);
-    CPU_FOREACH(cpu) {
-        if (qemu_cpu_is_self(cpu)) {
-            qemu_cpu_stop(cpu, true);
-        } else {
-            cpu->stop = true;
-            qemu_cpu_kick(cpu);
-        }
-    }
-
-    /* We need to drop the replay_lock so any vCPU threads woken up
-     * can finish their replay tasks
-     */
-    replay_mutex_unlock();
-
-    while (!all_vcpus_paused()) {
-        qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex);
-        CPU_FOREACH(cpu) {
-            qemu_cpu_kick(cpu);
-        }
-    }
-
-    qemu_mutex_unlock_iothread();
-    replay_mutex_lock();
-    qemu_mutex_lock_iothread();
-}
-
-void cpu_resume(CPUState *cpu)
-{
-    cpu->stop = false;
-    cpu->stopped = false;
-    qemu_cpu_kick(cpu);
-}
-
-void resume_all_vcpus(void)
-{
-    CPUState *cpu;
-
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
-    CPU_FOREACH(cpu) {
-        cpu_resume(cpu);
-    }
-}
-
-void cpu_remove_sync(CPUState *cpu)
-{
-    cpu->stop = true;
-    cpu->unplug = true;
-    qemu_cpu_kick(cpu);
-    qemu_mutex_unlock_iothread();
-    qemu_thread_join(cpu->thread);
-    qemu_mutex_lock_iothread();
-}
-
-/* For temporary buffers for forming a name */
-#define VCPU_THREAD_NAME_SIZE 16
-
-static void qemu_tcg_init_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-    static QemuCond *single_tcg_halt_cond;
-    static QemuThread *single_tcg_cpu_thread;
-    static int tcg_region_inited;
-
-    assert(tcg_enabled());
-    /*
-     * Initialize TCG regions--once. Now is a good time, because:
-     * (1) TCG's init context, prologue and target globals have been set up.
-     * (2) qemu_tcg_mttcg_enabled() works now (TCG init code runs before the
-     *     -accel flag is processed, so the check doesn't work then).
-     */
-    if (!tcg_region_inited) {
-        tcg_region_inited = 1;
-        tcg_region_init();
-    }
-
-    if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) {
-        cpu->thread = g_malloc0(sizeof(QemuThread));
-        cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-        qemu_cond_init(cpu->halt_cond);
-
-        if (qemu_tcg_mttcg_enabled()) {
-            /* create a thread per vCPU with TCG (MTTCG) */
-            parallel_cpus = true;
-            snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",
-                 cpu->cpu_index);
-
-            qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn,
-                               cpu, QEMU_THREAD_JOINABLE);
-
-        } else {
-            /* share a single thread for all cpus with TCG */
-            snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "ALL CPUs/TCG");
-            qemu_thread_create(cpu->thread, thread_name,
-                               qemu_tcg_rr_cpu_thread_fn,
-                               cpu, QEMU_THREAD_JOINABLE);
-
-            single_tcg_halt_cond = cpu->halt_cond;
-            single_tcg_cpu_thread = cpu->thread;
-        }
-#ifdef _WIN32
-        cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-    } else {
-        /* For non-MTTCG cases we share the thread */
-        cpu->thread = single_tcg_cpu_thread;
-        cpu->halt_cond = single_tcg_halt_cond;
-        cpu->thread_id = first_cpu->thread_id;
-        cpu->can_do_io = 1;
-        cpu->created = true;
-    }
-}
-
-static void qemu_hax_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HAX",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_hax_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-#ifdef _WIN32
-    cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-}
-
-static void qemu_kvm_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_kvm_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-}
-
-static void qemu_hvf_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    /* HVF currently does not support TCG, and only runs in
-     * unrestricted-guest mode. */
-    assert(hvf_enabled());
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HVF",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_hvf_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-}
-
-static void qemu_whpx_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/WHPX",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_whpx_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-#ifdef _WIN32
-    cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-}
-
-static void qemu_dummy_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_dummy_cpu_thread_fn, cpu,
-                       QEMU_THREAD_JOINABLE);
-}
-
-void qemu_init_vcpu(CPUState *cpu)
-{
-    MachineState *ms = MACHINE(qdev_get_machine());
-
-    cpu->nr_cores = ms->smp.cores;
-    cpu->nr_threads =  ms->smp.threads;
-    cpu->stopped = true;
-    cpu->random_seed = qemu_guest_random_seed_thread_part1();
-
-    if (!cpu->as) {
-        /* If the target cpu hasn't set up any address spaces itself,
-         * give it the default one.
-         */
-        cpu->num_ases = 1;
-        cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory);
-    }
-
-    if (kvm_enabled()) {
-        qemu_kvm_start_vcpu(cpu);
-    } else if (hax_enabled()) {
-        qemu_hax_start_vcpu(cpu);
-    } else if (hvf_enabled()) {
-        qemu_hvf_start_vcpu(cpu);
-    } else if (tcg_enabled()) {
-        qemu_tcg_init_vcpu(cpu);
-    } else if (whpx_enabled()) {
-        qemu_whpx_start_vcpu(cpu);
-    } else {
-        qemu_dummy_start_vcpu(cpu);
-    }
-
-    while (!cpu->created) {
-        qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
-    }
-}
-
-void cpu_stop_current(void)
-{
-    if (current_cpu) {
-        current_cpu->stop = true;
-        cpu_exit(current_cpu);
-    }
-}
-
-int vm_stop(RunState state)
-{
-    if (qemu_in_vcpu_thread()) {
-        qemu_system_vmstop_request_prepare();
-        qemu_system_vmstop_request(state);
-        /*
-         * FIXME: should not return to device code in case
-         * vm_stop() has been requested.
-         */
-        cpu_stop_current();
-        return 0;
-    }
-
-    return do_vm_stop(state, true);
-}
-
-/**
- * Prepare for (re)starting the VM.
- * Returns -1 if the vCPUs are not to be restarted (e.g. if they are already
- * running or in case of an error condition), 0 otherwise.
- */
-int vm_prepare_start(void)
-{
-    RunState requested;
-
-    qemu_vmstop_requested(&requested);
-    if (runstate_is_running() && requested == RUN_STATE__MAX) {
-        return -1;
-    }
-
-    /* Ensure that a STOP/RESUME pair of events is emitted if a
-     * vmstop request was pending.  The BLOCK_IO_ERROR event, for
-     * example, according to documentation is always followed by
-     * the STOP event.
-     */
-    if (runstate_is_running()) {
-        qapi_event_send_stop();
-        qapi_event_send_resume();
-        return -1;
-    }
-
-    /* We are sending this now, but the CPUs will be resumed shortly later */
-    qapi_event_send_resume();
-
-    cpu_enable_ticks();
-    runstate_set(RUN_STATE_RUNNING);
-    vm_state_notify(1, RUN_STATE_RUNNING);
-    return 0;
-}
-
-void vm_start(void)
-{
-    if (!vm_prepare_start()) {
-        resume_all_vcpus();
-    }
-}
-
-/* does a state transition even if the VM is already stopped,
-   current state is forgotten forever */
-int vm_stop_force_state(RunState state)
-{
-    if (runstate_is_running()) {
-        return vm_stop(state);
-    } else {
-        runstate_set(state);
-
-        bdrv_drain_all();
-        /* Make sure to return an error if the flush in a previous vm_stop()
-         * failed. */
-        return bdrv_flush_all();
-    }
-}
-
-void list_cpus(const char *optarg)
-{
-    /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list)
-    cpu_list();
-#endif
-}
-
-void qmp_memsave(int64_t addr, int64_t size, const char *filename,
-                 bool has_cpu, int64_t cpu_index, Error **errp)
-{
-    FILE *f;
-    uint32_t l;
-    CPUState *cpu;
-    uint8_t buf[1024];
-    int64_t orig_addr = addr, orig_size = size;
-
-    if (!has_cpu) {
-        cpu_index = 0;
-    }
-
-    cpu = qemu_get_cpu(cpu_index);
-    if (cpu == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index",
-                   "a CPU number");
-        return;
-    }
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        error_setg_file_open(errp, errno, filename);
-        return;
-    }
-
-    while (size != 0) {
-        l = sizeof(buf);
-        if (l > size)
-            l = size;
-        if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) {
-            error_setg(errp, "Invalid addr 0x%016" PRIx64 "/size %" PRId64
-                             " specified", orig_addr, orig_size);
-            goto exit;
-        }
-        if (fwrite(buf, 1, l, f) != l) {
-            error_setg(errp, QERR_IO_ERROR);
-            goto exit;
-        }
-        addr += l;
-        size -= l;
-    }
-
-exit:
-    fclose(f);
-}
-
-void qmp_pmemsave(int64_t addr, int64_t size, const char *filename,
-                  Error **errp)
-{
-    FILE *f;
-    uint32_t l;
-    uint8_t buf[1024];
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        error_setg_file_open(errp, errno, filename);
-        return;
-    }
-
-    while (size != 0) {
-        l = sizeof(buf);
-        if (l > size)
-            l = size;
-        cpu_physical_memory_read(addr, buf, l);
-        if (fwrite(buf, 1, l, f) != l) {
-            error_setg(errp, QERR_IO_ERROR);
-            goto exit;
-        }
-        addr += l;
-        size -= l;
-    }
-
-exit:
-    fclose(f);
-}
-
-void qmp_inject_nmi(Error **errp)
-{
-    nmi_monitor_handle(monitor_get_cpu_index(), errp);
-}
-
-void dump_drift_info(void)
-{
-    if (!use_icount) {
-        return;
-    }


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:11:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:11:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14672.36270 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEGQ-0006r4-Lg; Thu, 29 Oct 2020 20:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14672.36270; Thu, 29 Oct 2020 20:11:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEGQ-0006qw-Ht; Thu, 29 Oct 2020 20:11:14 +0000
Received: by outflank-mailman (input) for mailman id 14672;
 Thu, 29 Oct 2020 20:11:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEGP-0006qe-HE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id da920960-32f7-4c30-b7cb-d82560222ad2;
 Thu, 29 Oct 2020 20:11:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEGJ-0005ti-MH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEGJ-0005oI-L7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEGP-0006qe-HE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:13 +0000
X-Inumbo-ID: da920960-32f7-4c30-b7cb-d82560222ad2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id da920960-32f7-4c30-b7cb-d82560222ad2;
	Thu, 29 Oct 2020 20:11:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GIreLQ7pNoBhhr/+MPyG89ee/DXfkudbip2rUKqPCD0=; b=odoMuMTVfoOlQt87C3Nyz1QZ6N
	Dyopaq+mf9UiySGcAi7/7U/L3OcwZZ62+pXQGFGEI/mUaJggB8s6sv7qZ8neYsTk0Zw+v2VUsz1m0
	leUpJiK+0i2WovMgWVwXgdzA2xrcLJ12Wjd/ztlNcsNiLY/eXd/EXJpvSQ7Gieir+g94=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEGJ-0005ti-MH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEGJ-0005oI-L7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:11:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-port-20200711' into staging
Message-Id: <E1kYEGJ-0005oI-L7@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:11:07 +0000

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

commit d34498309cff7560ac90c422c56e3137e6a64b19
Merge: 2033cc6efa98b831d7839e367aa7d5aa74d0750f 19b293472f1514b5424ef4d9b092e02bd9b106c2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 19:27:59 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 19:27:59 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-port-20200711' into staging
    
    8bit AVR port from Michael Rolnik.
    
    Michael started to work on the AVR port few years ago [*] and kept
    improving the code over various series.
    
    List of people who help him (in chronological order):
    - Richard Henderson
    - Sarah Harris and Edward Robbins
    - Philippe Mathieu-Daudé and Aleksandar Markovic
    - Pavel Dovgalyuk
    - Thomas Huth
    
    [*] The oldest contribution I could find on the list is from 2016:
    https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg02985.html
    
    Tests included:
    
    $ avocado --show=app run -t arch:avr tests/acceptance/
    Fetching asset from tests/acceptance/machine_avr6.py:AVR6Machine.test_freertos
     (1/1) tests/acceptance/machine_avr6.py:AVR6Machine.test_freertos: PASS (2.13 s)
    RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
    JOB TIME   : 2.35 s
    
    $ make check-qtest-avr
      TEST    check-qtest-avr: tests/qtest/boot-serial-test
      TEST    check-qtest-avr: tests/qtest/cdrom-test
      TEST    check-qtest-avr: tests/qtest/device-introspect-test
      TEST    check-qtest-avr: tests/qtest/machine-none-test
      TEST    check-qtest-avr: tests/qtest/qmp-test
      TEST    check-qtest-avr: tests/qtest/qmp-cmd-test
      TEST    check-qtest-avr: tests/qtest/qom-test
      TEST    check-qtest-avr: tests/qtest/test-hmp
      TEST    check-qtest-avr: tests/qtest/qos-test
    
    CI results:
    . https://cirrus-ci.com/build/5697049146425344
    . https://gitlab.com/philmd/qemu/-/pipelines/165328058
    . https://travis-ci.org/github/philmd/qemu/builds/705817933
    . https://app.shippable.com/github/philmd/qemu/runs/822/summary/console
    
    # gpg: Signature made Sat 11 Jul 2020 10:03:11 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/avr-port-20200711: (32 commits)
      target/avr/disas: Fix store instructions display order
      target/avr/cpu: Fix $PC displayed address
      target/avr/cpu: Drop tlb_flush() in avr_cpu_reset()
      target/avr: Add section into QEMU documentation
      tests/acceptance: Test the Arduino MEGA2560 board
      tests/boot-serial: Test some Arduino boards (AVR based)
      hw/avr: Add limited support for some Arduino boards
      hw/avr: Add some ATmega microcontrollers
      hw/avr: Add support for loading ELF/raw binaries
      hw/misc: avr: Add limited support for power reduction device
      hw/timer: avr: Add limited support for 16-bit timer peripheral
      hw/char: avr: Add limited support for USART peripheral
      tests/machine-none: Add AVR support
      target/avr: Register AVR support with the rest of QEMU
      target/avr: Add support for disassembling via option '-d in_asm'
      target/avr: Initialize TCG register variables
      target/avr: Add instruction translation - CPU main translation function
      target/avr: Add instruction translation - MCU Control Instructions
      target/avr: Add instruction translation - Bit and Bit-test Instructions
      target/avr: Add instruction translation - Data Transfer Instructions
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                      |   30 +
 configure                        |    7 +
 default-configs/avr-softmmu.mak  |    5 +
 docs/system/target-avr.rst       |   37 +
 docs/system/targets.rst          |    1 +
 gdb-xml/avr-cpu.xml              |   49 +
 hw/Kconfig                       |    1 +
 hw/avr/Kconfig                   |    9 +
 hw/avr/Makefile.objs             |    3 +
 hw/avr/arduino.c                 |  149 ++
 hw/avr/atmega.c                  |  458 ++++++
 hw/avr/atmega.h                  |   48 +
 hw/avr/boot.c                    |  115 ++
 hw/avr/boot.h                    |   33 +
 hw/char/Kconfig                  |    3 +
 hw/char/Makefile.objs            |    1 +
 hw/char/avr_usart.c              |  320 ++++
 hw/misc/Kconfig                  |    3 +
 hw/misc/Makefile.objs            |    2 +
 hw/misc/avr_power.c              |  113 ++
 hw/misc/trace-events             |    4 +
 hw/timer/Kconfig                 |    3 +
 hw/timer/Makefile.objs           |    2 +
 hw/timer/avr_timer16.c           |  621 ++++++++
 hw/timer/trace-events            |   12 +
 include/disas/dis-asm.h          |   19 +
 include/elf.h                    |    4 +
 include/hw/char/avr_usart.h      |   93 ++
 include/hw/misc/avr_power.h      |   46 +
 include/hw/timer/avr_timer16.h   |   94 ++
 include/sysemu/arch_init.h       |    1 +
 qapi/machine.json                |    3 +-
 softmmu/arch_init.c              |    2 +
 target/avr/Makefile.objs         |   34 +
 target/avr/cpu-param.h           |   36 +
 target/avr/cpu-qom.h             |   53 +
 target/avr/cpu.c                 |  366 +++++
 target/avr/cpu.h                 |  256 ++++
 target/avr/disas.c               |  245 +++
 target/avr/gdbstub.c             |   84 ++
 target/avr/helper.c              |  348 +++++
 target/avr/helper.h              |   29 +
 target/avr/insn.decode           |  187 +++
 target/avr/machine.c             |  119 ++
 target/avr/translate.c           | 3061 ++++++++++++++++++++++++++++++++++++++
 tests/acceptance/machine_avr6.py |   50 +
 tests/qtest/Makefile.include     |    2 +
 tests/qtest/boot-serial-test.c   |   11 +
 tests/qtest/machine-none-test.c  |    1 +
 49 files changed, 7172 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 361ae5c662..fe8139f367 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -167,6 +167,14 @@ S: Maintained
 F: hw/arm/smmu*
 F: include/hw/arm/smmu*
 
+AVR TCG CPUs
+M: Michael Rolnik <mrolnik@gmail.com>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: gdb-xml/avr-cpu.xml
+F: target/avr/
+F: tests/acceptance/machine_avr6.py
+
 CRIS TCG CPUs
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
 S: Maintained
@@ -982,6 +990,28 @@ F: include/hw/*/nrf51*.h
 F: include/hw/*/microbit*.h
 F: tests/qtest/microbit-test.c
 
+AVR Machines
+-------------
+
+AVR MCUs
+M: Michael Rolnik <mrolnik@gmail.com>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: default-configs/avr-softmmu.mak
+F: hw/avr/
+F: include/hw/char/avr_usart.h
+F: hw/char/avr_usart.c
+F: include/hw/timer/avr_timer16.h
+F: hw/timer/avr_timer16.c
+F: include/hw/misc/avr_power.h
+F: hw/misc/avr_power.c
+
+Arduino
+M: Philippe Mathieu-Daudé <f4bug@amsat.org>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: hw/avr/arduino.c
+
 CRIS Machines
 -------------
 Axis Dev88
diff --git a/configure b/configure
index ee6c3c6792..31e2ddbf28 100755
--- a/configure
+++ b/configure
@@ -8143,6 +8143,10 @@ case "$target_name" in
     mttcg="yes"
     gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml"
   ;;
+  avr)
+    gdb_xml_files="avr-cpu.xml"
+    target_compiler=$cross_cc_avr
+  ;;
   cris)
   ;;
   hppa)
@@ -8387,6 +8391,9 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
       disas_config "ARM_A64"
     fi
   ;;
+  avr)
+    disas_config "AVR"
+  ;;
   cris)
     disas_config "CRIS"
   ;;
diff --git a/default-configs/avr-softmmu.mak b/default-configs/avr-softmmu.mak
new file mode 100644
index 0000000000..80218add98
--- /dev/null
+++ b/default-configs/avr-softmmu.mak
@@ -0,0 +1,5 @@
+# Default configuration for avr-softmmu
+
+# Boards:
+#
+CONFIG_ARDUINO=y
diff --git a/docs/system/target-avr.rst b/docs/system/target-avr.rst
new file mode 100644
index 0000000000..dc99afc895
--- /dev/null
+++ b/docs/system/target-avr.rst
@@ -0,0 +1,37 @@
+.. _AVR-System-emulator:
+
+AVR System emulator
+-------------------
+
+Use the executable ``qemu-system-avr`` to emulate a AVR 8 bit based machine.
+These can have one of the following cores: avr1, avr2, avr25, avr3, avr31,
+avr35, avr4, avr5, avr51, avr6, avrtiny, xmega2, xmega3, xmega4, xmega5,
+xmega6 and xmega7.
+
+As for now it supports few Arduino boards for educational and testing purposes.
+These boards use a ATmega controller, which model is limited to USART & 16-bit
+timer devices, enought to run FreeRTOS based applications (like
+https://github.com/seharris/qemu-avr-tests/blob/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
+).
+
+Following are examples of possible usages, assuming demo.elf is compiled for
+AVR cpu
+
+ - Continuous non interrupted execution:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf``
+
+ - Continuous non interrupted execution with serial output into telnet window:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -serial
+   tcp::5678,server,nowait -nographic``
+   and then in another shell
+   ``telnet localhost 5678``
+
+ - Debugging wit GDB debugger:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -s -S``
+   and then in another shell
+   ``avr-gdb demo.elf``
+   and then within GDB shell
+   ``target remote :1234``
+
+ - Print out executed instructions:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -d in_asm``
diff --git a/docs/system/targets.rst b/docs/system/targets.rst
index 99435a3eba..560783644d 100644
--- a/docs/system/targets.rst
+++ b/docs/system/targets.rst
@@ -19,3 +19,4 @@ Contents:
    target-xtensa
    target-s390x
    target-rx
+   target-avr
diff --git a/gdb-xml/avr-cpu.xml b/gdb-xml/avr-cpu.xml
new file mode 100644
index 0000000000..c4747f5b40
--- /dev/null
+++ b/gdb-xml/avr-cpu.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- Register numbers are hard-coded in order to maintain backward
+     compatibility with older versions of tools that didn't use xml
+     register descriptions.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.riscv.cpu">
+  <reg name="r0" bitsize="8" type="int" regnum="0"/>
+  <reg name="r1" bitsize="8" type="int"/>
+  <reg name="r2" bitsize="8" type="int"/>
+  <reg name="r3" bitsize="8" type="int"/>
+  <reg name="r4" bitsize="8" type="int"/>
+  <reg name="r5" bitsize="8" type="int"/>
+  <reg name="r6" bitsize="8" type="int"/>
+  <reg name="r7" bitsize="8" type="int"/>
+  <reg name="r8" bitsize="8" type="int"/>
+  <reg name="r9" bitsize="8" type="int"/>
+  <reg name="r10" bitsize="8" type="int"/>
+  <reg name="r11" bitsize="8" type="int"/>
+  <reg name="r12" bitsize="8" type="int"/>
+  <reg name="r13" bitsize="8" type="int"/>
+  <reg name="r14" bitsize="8" type="int"/>
+  <reg name="r15" bitsize="8" type="int"/>
+  <reg name="r16" bitsize="8" type="int"/>
+  <reg name="r17" bitsize="8" type="int"/>
+  <reg name="r18" bitsize="8" type="int"/>
+  <reg name="r19" bitsize="8" type="int"/>
+  <reg name="r20" bitsize="8" type="int"/>
+  <reg name="r21" bitsize="8" type="int"/>
+  <reg name="r22" bitsize="8" type="int"/>
+  <reg name="r23" bitsize="8" type="int"/>
+  <reg name="r24" bitsize="8" type="int"/>
+  <reg name="r25" bitsize="8" type="int"/>
+  <reg name="r26" bitsize="8" type="int"/>
+  <reg name="r27" bitsize="8" type="int"/>
+  <reg name="r28" bitsize="8" type="int"/>
+  <reg name="r29" bitsize="8" type="int"/>
+  <reg name="r30" bitsize="8" type="int"/>
+  <reg name="r31" bitsize="8" type="int"/>
+  <reg name="sreg" bitsize="8" type="int"/>
+  <reg name="sp" bitsize="8" type="int"/>
+  <reg name="pc" bitsize="8" type="int"/>
+</feature>
diff --git a/hw/Kconfig b/hw/Kconfig
index 62f9ebdc22..4de1797ffd 100644
--- a/hw/Kconfig
+++ b/hw/Kconfig
@@ -43,6 +43,7 @@ source watchdog/Kconfig
 # arch Kconfig
 source arm/Kconfig
 source alpha/Kconfig
+source avr/Kconfig
 source cris/Kconfig
 source hppa/Kconfig
 source i386/Kconfig
diff --git a/hw/avr/Kconfig b/hw/avr/Kconfig
new file mode 100644
index 0000000000..d31298c3cc
--- /dev/null
+++ b/hw/avr/Kconfig
@@ -0,0 +1,9 @@
+config AVR_ATMEGA_MCU
+    bool
+    select AVR_TIMER16
+    select AVR_USART
+    select AVR_POWER
+
+config ARDUINO
+    select AVR_ATMEGA_MCU
+    select UNIMP
diff --git a/hw/avr/Makefile.objs b/hw/avr/Makefile.objs
new file mode 100644
index 0000000000..4dca064bfc
--- /dev/null
+++ b/hw/avr/Makefile.objs
@@ -0,0 +1,3 @@
+obj-y += boot.o
+obj-$(CONFIG_AVR_ATMEGA_MCU) += atmega.o
+obj-$(CONFIG_ARDUINO) += arduino.o
diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c
new file mode 100644
index 0000000000..65093ab6fd
--- /dev/null
+++ b/hw/avr/arduino.c
@@ -0,0 +1,149 @@
+/*
+ * QEMU Arduino boards
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+/* TODO: Implement the use of EXTRAM */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "hw/boards.h"
+#include "atmega.h"
+#include "boot.h"
+
+typedef struct ArduinoMachineState {
+    /*< private >*/
+    MachineState parent_obj;
+    /*< public >*/
+    AtmegaMcuState mcu;
+} ArduinoMachineState;
+
+typedef struct ArduinoMachineClass {
+    /*< private >*/
+    MachineClass parent_class;
+    /*< public >*/
+    const char *mcu_type;
+    uint64_t xtal_hz;
+} ArduinoMachineClass;
+
+#define TYPE_ARDUINO_MACHINE \
+        MACHINE_TYPE_NAME("arduino")
+#define ARDUINO_MACHINE(obj) \
+        OBJECT_CHECK(ArduinoMachineState, (obj), TYPE_ARDUINO_MACHINE)
+#define ARDUINO_MACHINE_CLASS(klass) \
+        OBJECT_CLASS_CHECK(ArduinoMachineClass, (klass), TYPE_ARDUINO_MACHINE)
+#define ARDUINO_MACHINE_GET_CLASS(obj) \
+        OBJECT_GET_CLASS(ArduinoMachineClass, (obj), TYPE_ARDUINO_MACHINE)
+
+static void arduino_machine_init(MachineState *machine)
+{
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_GET_CLASS(machine);
+    ArduinoMachineState *ams = ARDUINO_MACHINE(machine);
+
+    object_initialize_child(OBJECT(machine), "mcu", &ams->mcu, amc->mcu_type);
+    object_property_set_uint(OBJECT(&ams->mcu), "xtal-frequency-hz",
+                             amc->xtal_hz, &error_abort);
+    sysbus_realize(SYS_BUS_DEVICE(&ams->mcu), &error_abort);
+
+    if (machine->firmware) {
+        if (!avr_load_firmware(&ams->mcu.cpu, machine,
+                               &ams->mcu.flash, machine->firmware)) {
+            exit(1);
+        }
+    }
+}
+
+static void arduino_machine_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->init = arduino_machine_init;
+    mc->default_cpus = 1;
+    mc->min_cpus = mc->default_cpus;
+    mc->max_cpus = mc->default_cpus;
+    mc->no_floppy = 1;
+    mc->no_cdrom = 1;
+    mc->no_parallel = 1;
+}
+
+static void arduino_duemilanove_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove */
+    mc->desc        = "Arduino Duemilanove (ATmega168)",
+    mc->alias       = "2009";
+    amc->mcu_type   = TYPE_ATMEGA168_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_uno_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://store.arduino.cc/arduino-uno-rev3 */
+    mc->desc        = "Arduino UNO (ATmega328P)";
+    mc->alias       = "uno";
+    amc->mcu_type   = TYPE_ATMEGA328_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_mega_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://www.arduino.cc/en/Main/ArduinoBoardMega */
+    mc->desc        = "Arduino Mega (ATmega1280)";
+    mc->alias       = "mega";
+    amc->mcu_type   = TYPE_ATMEGA1280_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_mega2560_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://store.arduino.cc/arduino-mega-2560-rev3 */
+    mc->desc        = "Arduino Mega 2560 (ATmega2560)";
+    mc->alias       = "mega2560";
+    amc->mcu_type   = TYPE_ATMEGA2560_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000; /* CSTCE16M0V53-R0 */
+};
+
+static const TypeInfo arduino_machine_types[] = {
+    {
+        .name          = MACHINE_TYPE_NAME("arduino-duemilanove"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_duemilanove_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-uno"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_uno_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-mega"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_mega_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-mega-2560-v3"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_mega2560_class_init,
+    }, {
+        .name           = TYPE_ARDUINO_MACHINE,
+        .parent         = TYPE_MACHINE,
+        .instance_size  = sizeof(ArduinoMachineState),
+        .class_size     = sizeof(ArduinoMachineClass),
+        .class_init     = arduino_machine_class_init,
+        .abstract       = true,
+    }
+};
+
+DEFINE_TYPES(arduino_machine_types)
diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c
new file mode 100644
index 0000000000..7131224431
--- /dev/null
+++ b/hw/avr/atmega.c
@@ -0,0 +1,458 @@
+/*
+ * QEMU ATmega MCU
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/module.h"
+#include "qemu/units.h"
+#include "qapi/error.h"
+#include "exec/memory.h"
+#include "exec/address-spaces.h"
+#include "sysemu/sysemu.h"
+#include "hw/qdev-properties.h"
+#include "hw/sysbus.h"
+#include "hw/boards.h" /* FIXME memory_region_allocate_system_memory for sram */
+#include "hw/misc/unimp.h"
+#include "atmega.h"
+
+enum AtmegaPeripheral {
+    POWER0, POWER1,
+    GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF,
+    GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK, GPIOL,
+    USART0, USART1, USART2, USART3,
+    TIMER0, TIMER1, TIMER2, TIMER3, TIMER4, TIMER5,
+    PERIFMAX
+};
+
+#define GPIO(n)     (n + GPIOA)
+#define USART(n)    (n + USART0)
+#define TIMER(n)    (n + TIMER0)
+#define POWER(n)    (n + POWER0)
+
+typedef struct {
+    uint16_t addr;
+    enum AtmegaPeripheral power_index;
+    uint8_t power_bit;
+    /* timer specific */
+    uint16_t intmask_addr;
+    uint16_t intflag_addr;
+    bool is_timer16;
+} peripheral_cfg;
+
+typedef struct AtmegaMcuClass {
+    /*< private >*/
+    SysBusDeviceClass parent_class;
+    /*< public >*/
+    const char *uc_name;
+    const char *cpu_type;
+    size_t flash_size;
+    size_t eeprom_size;
+    size_t sram_size;
+    size_t io_size;
+    size_t gpio_count;
+    size_t adc_count;
+    const uint8_t *irq;
+    const peripheral_cfg *dev;
+} AtmegaMcuClass;
+
+#define ATMEGA_MCU_CLASS(klass) \
+    OBJECT_CLASS_CHECK(AtmegaMcuClass, (klass), TYPE_ATMEGA_MCU)
+#define ATMEGA_MCU_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(AtmegaMcuClass, (obj), TYPE_ATMEGA_MCU)
+
+static const peripheral_cfg dev168_328[PERIFMAX] = {
+    [USART0]        = {  0xc0, POWER0, 1 },
+    [TIMER2]        = {  0xb0, POWER0, 6, 0x70, 0x37, false },
+    [TIMER1]        = {  0x80, POWER0, 3, 0x6f, 0x36, true },
+    [POWER0]        = {  0x64 },
+    [TIMER0]        = {  0x44, POWER0, 5, 0x6e, 0x35, false },
+    [GPIOD]         = {  0x29 },
+    [GPIOC]         = {  0x26 },
+    [GPIOB]         = {  0x23 },
+}, dev1280_2560[PERIFMAX] = {
+    [USART3]        = { 0x130, POWER1, 2 },
+    [TIMER5]        = { 0x120, POWER1, 5, 0x73, 0x3a, true },
+    [GPIOL]         = { 0x109 },
+    [GPIOK]         = { 0x106 },
+    [GPIOJ]         = { 0x103 },
+    [GPIOH]         = { 0x100 },
+    [USART2]        = {  0xd0, POWER1, 1 },
+    [USART1]        = {  0xc8, POWER1, 0 },
+    [USART0]        = {  0xc0, POWER0, 1 },
+    [TIMER2]        = {  0xb0, POWER0, 6, 0x70, 0x37, false }, /* TODO async */
+    [TIMER4]        = {  0xa0, POWER1, 4, 0x72, 0x39, true },
+    [TIMER3]        = {  0x90, POWER1, 3, 0x71, 0x38, true },
+    [TIMER1]        = {  0x80, POWER0, 3, 0x6f, 0x36, true },
+    [POWER1]        = {  0x65 },
+    [POWER0]        = {  0x64 },
+    [TIMER0]        = {  0x44, POWER0, 5, 0x6e, 0x35, false },
+    [GPIOG]         = {  0x32 },
+    [GPIOF]         = {  0x2f },
+    [GPIOE]         = {  0x2c },
+    [GPIOD]         = {  0x29 },
+    [GPIOC]         = {  0x26 },
+    [GPIOB]         = {  0x23 },
+    [GPIOA]         = {  0x20 },
+};
+
+enum AtmegaIrq {
+    USART0_RXC_IRQ, USART0_DRE_IRQ, USART0_TXC_IRQ,
+    USART1_RXC_IRQ, USART1_DRE_IRQ, USART1_TXC_IRQ,
+    USART2_RXC_IRQ, USART2_DRE_IRQ, USART2_TXC_IRQ,
+    USART3_RXC_IRQ, USART3_DRE_IRQ, USART3_TXC_IRQ,
+    TIMER0_CAPT_IRQ, TIMER0_COMPA_IRQ, TIMER0_COMPB_IRQ,
+        TIMER0_COMPC_IRQ, TIMER0_OVF_IRQ,
+    TIMER1_CAPT_IRQ, TIMER1_COMPA_IRQ, TIMER1_COMPB_IRQ,
+        TIMER1_COMPC_IRQ, TIMER1_OVF_IRQ,
+    TIMER2_CAPT_IRQ, TIMER2_COMPA_IRQ, TIMER2_COMPB_IRQ,
+        TIMER2_COMPC_IRQ, TIMER2_OVF_IRQ,
+    TIMER3_CAPT_IRQ, TIMER3_COMPA_IRQ, TIMER3_COMPB_IRQ,
+        TIMER3_COMPC_IRQ, TIMER3_OVF_IRQ,
+    TIMER4_CAPT_IRQ, TIMER4_COMPA_IRQ, TIMER4_COMPB_IRQ,
+        TIMER4_COMPC_IRQ, TIMER4_OVF_IRQ,
+    TIMER5_CAPT_IRQ, TIMER5_COMPA_IRQ, TIMER5_COMPB_IRQ,
+        TIMER5_COMPC_IRQ, TIMER5_OVF_IRQ,
+    IRQ_COUNT
+};
+
+#define USART_IRQ_COUNT     3
+#define USART_RXC_IRQ(n)    (n * USART_IRQ_COUNT + USART0_RXC_IRQ)
+#define USART_DRE_IRQ(n)    (n * USART_IRQ_COUNT + USART0_DRE_IRQ)
+#define USART_TXC_IRQ(n)    (n * USART_IRQ_COUNT + USART0_TXC_IRQ)
+#define TIMER_IRQ_COUNT     5
+#define TIMER_CAPT_IRQ(n)   (n * TIMER_IRQ_COUNT + TIMER0_CAPT_IRQ)
+#define TIMER_COMPA_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPA_IRQ)
+#define TIMER_COMPB_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPB_IRQ)
+#define TIMER_COMPC_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPC_IRQ)
+#define TIMER_OVF_IRQ(n)    (n * TIMER_IRQ_COUNT + TIMER0_OVF_IRQ)
+
+static const uint8_t irq168_328[IRQ_COUNT] = {
+    [TIMER2_COMPA_IRQ]      = 8,
+    [TIMER2_COMPB_IRQ]      = 9,
+    [TIMER2_OVF_IRQ]        = 10,
+    [TIMER1_CAPT_IRQ]       = 11,
+    [TIMER1_COMPA_IRQ]      = 12,
+    [TIMER1_COMPB_IRQ]      = 13,
+    [TIMER1_OVF_IRQ]        = 14,
+    [TIMER0_COMPA_IRQ]      = 15,
+    [TIMER0_COMPB_IRQ]      = 16,
+    [TIMER0_OVF_IRQ]        = 17,
+    [USART0_RXC_IRQ]        = 19,
+    [USART0_DRE_IRQ]        = 20,
+    [USART0_TXC_IRQ]        = 21,
+}, irq1280_2560[IRQ_COUNT] = {
+    [TIMER2_COMPA_IRQ]      = 14,
+    [TIMER2_COMPB_IRQ]      = 15,
+    [TIMER2_OVF_IRQ]        = 16,
+    [TIMER1_CAPT_IRQ]       = 17,
+    [TIMER1_COMPA_IRQ]      = 18,
+    [TIMER1_COMPB_IRQ]      = 19,
+    [TIMER1_COMPC_IRQ]      = 20,
+    [TIMER1_OVF_IRQ]        = 21,
+    [TIMER0_COMPA_IRQ]      = 22,
+    [TIMER0_COMPB_IRQ]      = 23,
+    [TIMER0_OVF_IRQ]        = 24,
+    [USART0_RXC_IRQ]        = 26,
+    [USART0_DRE_IRQ]        = 27,
+    [USART0_TXC_IRQ]        = 28,
+    [TIMER3_CAPT_IRQ]       = 32,
+    [TIMER3_COMPA_IRQ]      = 33,
+    [TIMER3_COMPB_IRQ]      = 34,
+    [TIMER3_COMPC_IRQ]      = 35,
+    [TIMER3_OVF_IRQ]        = 36,
+    [USART1_RXC_IRQ]        = 37,
+    [USART1_DRE_IRQ]        = 38,
+    [USART1_TXC_IRQ]        = 39,
+    [TIMER4_CAPT_IRQ]       = 42,
+    [TIMER4_COMPA_IRQ]      = 43,
+    [TIMER4_COMPB_IRQ]      = 44,
+    [TIMER4_COMPC_IRQ]      = 45,
+    [TIMER4_OVF_IRQ]        = 46,
+    [TIMER5_CAPT_IRQ]       = 47,
+    [TIMER5_COMPA_IRQ]      = 48,
+    [TIMER5_COMPB_IRQ]      = 49,
+    [TIMER5_COMPC_IRQ]      = 50,
+    [TIMER5_OVF_IRQ]        = 51,
+    [USART2_RXC_IRQ]        = 52,
+    [USART2_DRE_IRQ]        = 53,
+    [USART2_TXC_IRQ]        = 54,
+    [USART3_RXC_IRQ]        = 55,
+    [USART3_DRE_IRQ]        = 56,
+    [USART3_TXC_IRQ]        = 57,
+};
+
+static void connect_peripheral_irq(const AtmegaMcuClass *k,
+                                   SysBusDevice *dev, int dev_irqn,
+                                   DeviceState *cpu,
+                                   unsigned peripheral_index)
+{
+    int cpu_irq = k->irq[peripheral_index];
+
+    if (!cpu_irq) {
+        return;
+    }
+    /* FIXME move that to avr_cpu_set_int() once 'sample' board is removed */
+    assert(cpu_irq >= 2);
+    cpu_irq -= 2;
+
+    sysbus_connect_irq(dev, dev_irqn, qdev_get_gpio_in(cpu, cpu_irq));
+}
+
+static void connect_power_reduction_gpio(AtmegaMcuState *s,
+                                         const AtmegaMcuClass *k,
+                                         DeviceState *cpu,
+                                         unsigned peripheral_index)
+{
+    unsigned power_index = k->dev[peripheral_index].power_index;
+    assert(k->dev[power_index].addr);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->pwr[power_index - POWER0]),
+                       k->dev[peripheral_index].power_bit,
+                       qdev_get_gpio_in(cpu, 0));
+}
+
+static void atmega_realize(DeviceState *dev, Error **errp)
+{
+    AtmegaMcuState *s = ATMEGA_MCU(dev);
+    const AtmegaMcuClass *mc = ATMEGA_MCU_GET_CLASS(dev);
+    DeviceState *cpudev;
+    SysBusDevice *sbd;
+    char *devname;
+    size_t i;
+
+    assert(mc->io_size <= 0x200);
+
+    if (!s->xtal_freq_hz) {
+        error_setg(errp, "\"xtal-frequency-hz\" property must be provided.");
+        return;
+    }
+
+    /* CPU */
+    object_initialize_child(OBJECT(dev), "cpu", &s->cpu, mc->cpu_type);
+    object_property_set_bool(OBJECT(&s->cpu), "realized", true, &error_abort);
+    cpudev = DEVICE(&s->cpu);
+
+    /* SRAM */
+    memory_region_init_ram(&s->sram, OBJECT(dev), "sram", mc->sram_size,
+                           &error_abort);
+    memory_region_add_subregion(get_system_memory(),
+                                OFFSET_DATA + mc->io_size, &s->sram);
+
+    /* Flash */
+    memory_region_init_rom(&s->flash, OBJECT(dev),
+                           "flash", mc->flash_size, &error_fatal);
+    memory_region_add_subregion(get_system_memory(), OFFSET_CODE, &s->flash);
+
+    /*
+     * I/O
+     *
+     * 0x00 - 0x1f: Registers
+     * 0x20 - 0x5f: I/O memory
+     * 0x60 - 0xff: Extended I/O
+     */
+    s->io = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
+    qdev_prop_set_string(s->io, "name", "I/O");
+    qdev_prop_set_uint64(s->io, "size", mc->io_size);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(s->io), &error_fatal);
+    sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->io), 0, OFFSET_DATA, -1234);
+
+    /* Power Reduction */
+    for (i = 0; i < POWER_MAX; i++) {
+        int idx = POWER(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("power%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->pwr[i],
+                                TYPE_AVR_MASK);
+        sysbus_realize(SYS_BUS_DEVICE(&s->pwr[i]), &error_abort);
+        sysbus_mmio_map(SYS_BUS_DEVICE(&s->pwr[i]), 0,
+                        OFFSET_DATA + mc->dev[idx].addr);
+        g_free(devname);
+    }
+
+    /* GPIO */
+    for (i = 0; i < GPIO_MAX; i++) {
+        int idx = GPIO(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("atmega-gpio-%c", 'a' + (char)i);
+        create_unimplemented_device(devname,
+                                    OFFSET_DATA + mc->dev[idx].addr, 3);
+        g_free(devname);
+    }
+
+    /* USART */
+    for (i = 0; i < USART_MAX; i++) {
+        int idx = USART(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("usart%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->usart[i],
+                                TYPE_AVR_USART);
+        qdev_prop_set_chr(DEVICE(&s->usart[i]), "chardev", serial_hd(i));
+        sbd = SYS_BUS_DEVICE(&s->usart[i]);
+        sysbus_realize(sbd, &error_abort);
+        sysbus_mmio_map(sbd, 0, OFFSET_DATA + mc->dev[USART(i)].addr);
+        connect_peripheral_irq(mc, sbd, 0, cpudev, USART_RXC_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 1, cpudev, USART_DRE_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 2, cpudev, USART_TXC_IRQ(i));
+        connect_power_reduction_gpio(s, mc, DEVICE(&s->usart[i]), idx);
+        g_free(devname);
+    }
+
+    /* Timer */
+    for (i = 0; i < TIMER_MAX; i++) {
+        int idx = TIMER(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        if (!mc->dev[idx].is_timer16) {
+            create_unimplemented_device("avr-timer8",
+                                        OFFSET_DATA + mc->dev[idx].addr, 5);
+            create_unimplemented_device("avr-timer8-intmask",
+                                        OFFSET_DATA
+                                        + mc->dev[idx].intmask_addr, 1);
+            create_unimplemented_device("avr-timer8-intflag",
+                                        OFFSET_DATA
+                                        + mc->dev[idx].intflag_addr, 1);
+            continue;
+        }
+        devname = g_strdup_printf("timer%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->timer[i],
+                                TYPE_AVR_TIMER16);
+        object_property_set_uint(OBJECT(&s->timer[i]), "cpu-frequency-hz",
+                                 s->xtal_freq_hz, &error_abort);
+        sbd = SYS_BUS_DEVICE(&s->timer[i]);
+        sysbus_realize(sbd, &error_abort);
+        sysbus_mmio_map(sbd, 0, OFFSET_DATA + mc->dev[idx].addr);
+        sysbus_mmio_map(sbd, 1, OFFSET_DATA + mc->dev[idx].intmask_addr);
+        sysbus_mmio_map(sbd, 2, OFFSET_DATA + mc->dev[idx].intflag_addr);
+        connect_peripheral_irq(mc, sbd, 0, cpudev, TIMER_CAPT_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 1, cpudev, TIMER_COMPA_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 2, cpudev, TIMER_COMPB_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 3, cpudev, TIMER_COMPC_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 4, cpudev, TIMER_OVF_IRQ(i));
+        connect_power_reduction_gpio(s, mc, DEVICE(&s->timer[i]), idx);
+        g_free(devname);
+    }
+
+    create_unimplemented_device("avr-twi",          OFFSET_DATA + 0x0b8, 6);
+    create_unimplemented_device("avr-adc",          OFFSET_DATA + 0x078, 8);
+    create_unimplemented_device("avr-ext-mem-ctrl", OFFSET_DATA + 0x074, 2);
+    create_unimplemented_device("avr-watchdog",     OFFSET_DATA + 0x060, 1);
+    create_unimplemented_device("avr-spi",          OFFSET_DATA + 0x04c, 3);
+    create_unimplemented_device("avr-eeprom",       OFFSET_DATA + 0x03f, 3);
+}
+
+static Property atmega_props[] = {
+    DEFINE_PROP_UINT64("xtal-frequency-hz", AtmegaMcuState,
+                       xtal_freq_hz, 0),
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void atmega_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->realize = atmega_realize;
+    device_class_set_props(dc, atmega_props);
+    /* Reason: Mapped at fixed location on the system bus */
+    dc->user_creatable = false;
+}
+
+static void atmega168_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr5");
+    amc->flash_size = 16 * KiB;
+    amc->eeprom_size = 512;
+    amc->sram_size = 1 * KiB;
+    amc->io_size = 256;
+    amc->gpio_count = 23;
+    amc->adc_count = 6;
+    amc->irq = irq168_328;
+    amc->dev = dev168_328;
+};
+
+static void atmega328_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr5");
+    amc->flash_size = 32 * KiB;
+    amc->eeprom_size = 1 * KiB;
+    amc->sram_size = 2 * KiB;
+    amc->io_size = 256;
+    amc->gpio_count = 23;
+    amc->adc_count = 6;
+    amc->irq = irq168_328;
+    amc->dev = dev168_328;
+};
+
+static void atmega1280_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr6");
+    amc->flash_size = 128 * KiB;
+    amc->eeprom_size = 4 * KiB;
+    amc->sram_size = 8 * KiB;
+    amc->io_size = 512;
+    amc->gpio_count = 86;
+    amc->adc_count = 16;
+    amc->irq = irq1280_2560;
+    amc->dev = dev1280_2560;
+};
+
+static void atmega2560_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr6");
+    amc->flash_size = 256 * KiB;
+    amc->eeprom_size = 4 * KiB;
+    amc->sram_size = 8 * KiB;
+    amc->io_size = 512;
+    amc->gpio_count = 54;
+    amc->adc_count = 16;
+    amc->irq = irq1280_2560;
+    amc->dev = dev1280_2560;
+};
+
+static const TypeInfo atmega_mcu_types[] = {
+    {
+        .name           = TYPE_ATMEGA168_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega168_class_init,
+    }, {
+        .name           = TYPE_ATMEGA328_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega328_class_init,
+    }, {
+        .name           = TYPE_ATMEGA1280_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega1280_class_init,
+    }, {
+        .name           = TYPE_ATMEGA2560_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega2560_class_init,
+    }, {
+        .name           = TYPE_ATMEGA_MCU,
+        .parent         = TYPE_SYS_BUS_DEVICE,
+        .instance_size  = sizeof(AtmegaMcuState),
+        .class_size     = sizeof(AtmegaMcuClass),
+        .class_init     = atmega_class_init,
+        .abstract       = true,
+    }
+};
+
+DEFINE_TYPES(atmega_mcu_types)
diff --git a/hw/avr/atmega.h b/hw/avr/atmega.h
new file mode 100644
index 0000000000..0928cb0ce6
--- /dev/null
+++ b/hw/avr/atmega.h
@@ -0,0 +1,48 @@
+/*
+ * QEMU ATmega MCU
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_AVR_ATMEGA_H
+#define HW_AVR_ATMEGA_H
+
+#include "hw/char/avr_usart.h"
+#include "hw/timer/avr_timer16.h"
+#include "hw/misc/avr_power.h"
+#include "target/avr/cpu.h"
+
+#define TYPE_ATMEGA_MCU     "ATmega"
+#define TYPE_ATMEGA168_MCU  "ATmega168"
+#define TYPE_ATMEGA328_MCU  "ATmega328"
+#define TYPE_ATMEGA1280_MCU "ATmega1280"
+#define TYPE_ATMEGA2560_MCU "ATmega2560"
+
+#define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MCU)
+
+#define POWER_MAX 2
+#define USART_MAX 4
+#define TIMER_MAX 6
+#define GPIO_MAX 12
+
+typedef struct AtmegaMcuState {
+    /*< private >*/
+    SysBusDevice parent_obj;
+    /*< public >*/
+
+    AVRCPU cpu;
+    MemoryRegion flash;
+    MemoryRegion eeprom;
+    MemoryRegion sram;
+    DeviceState *io;
+    AVRMaskState pwr[POWER_MAX];
+    AVRUsartState usart[USART_MAX];
+    AVRTimer16State timer[TIMER_MAX];
+    uint64_t xtal_freq_hz;
+} AtmegaMcuState;
+
+#endif /* HW_AVR_ATMEGA_H */
diff --git a/hw/avr/boot.c b/hw/avr/boot.c
new file mode 100644
index 0000000000..6fbcde4061
--- /dev/null
+++ b/hw/avr/boot.c
@@ -0,0 +1,115 @@
+/*
+ * AVR loader helpers
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "hw/loader.h"
+#include "elf.h"
+#include "boot.h"
+#include "qemu/error-report.h"
+
+static const char *avr_elf_e_flags_to_cpu_type(uint32_t flags)
+{
+    switch (flags & EF_AVR_MACH) {
+    case bfd_mach_avr1:
+        return AVR_CPU_TYPE_NAME("avr1");
+    case bfd_mach_avr2:
+        return AVR_CPU_TYPE_NAME("avr2");
+    case bfd_mach_avr25:
+        return AVR_CPU_TYPE_NAME("avr25");
+    case bfd_mach_avr3:
+        return AVR_CPU_TYPE_NAME("avr3");
+    case bfd_mach_avr31:
+        return AVR_CPU_TYPE_NAME("avr31");
+    case bfd_mach_avr35:
+        return AVR_CPU_TYPE_NAME("avr35");
+    case bfd_mach_avr4:
+        return AVR_CPU_TYPE_NAME("avr4");
+    case bfd_mach_avr5:
+        return AVR_CPU_TYPE_NAME("avr5");
+    case bfd_mach_avr51:
+        return AVR_CPU_TYPE_NAME("avr51");
+    case bfd_mach_avr6:
+        return AVR_CPU_TYPE_NAME("avr6");
+    case bfd_mach_avrtiny:
+        return AVR_CPU_TYPE_NAME("avrtiny");
+    case bfd_mach_avrxmega2:
+        return AVR_CPU_TYPE_NAME("xmega2");
+    case bfd_mach_avrxmega3:
+        return AVR_CPU_TYPE_NAME("xmega3");
+    case bfd_mach_avrxmega4:
+        return AVR_CPU_TYPE_NAME("xmega4");
+    case bfd_mach_avrxmega5:
+        return AVR_CPU_TYPE_NAME("xmega5");
+    case bfd_mach_avrxmega6:
+        return AVR_CPU_TYPE_NAME("xmega6");
+    case bfd_mach_avrxmega7:
+        return AVR_CPU_TYPE_NAME("xmega7");
+    default:
+        return NULL;
+    }
+}
+
+bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
+                       MemoryRegion *program_mr, const char *firmware)
+{
+    const char *filename;
+    int bytes_loaded;
+    uint64_t entry;
+    uint32_t e_flags;
+
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware);
+    if (filename == NULL) {
+        error_report("Unable to find %s", firmware);
+        return false;
+    }
+
+    bytes_loaded = load_elf_ram_sym(filename,
+                                    NULL, NULL, NULL,
+                                    &entry, NULL, NULL,
+                                    &e_flags, 0, EM_AVR, 0, 0,
+                                    NULL, true, NULL);
+    if (bytes_loaded >= 0) {
+        /* If ELF file is provided, determine CPU type reading ELF e_flags. */
+        const char *elf_cpu = avr_elf_e_flags_to_cpu_type(e_flags);
+        const char *mcu_cpu_type = object_get_typename(OBJECT(cpu));
+        int cpu_len = strlen(mcu_cpu_type) - strlen(AVR_CPU_TYPE_SUFFIX);
+
+        if (entry) {
+            error_report("BIOS entry_point must be 0x0000 "
+                         "(ELF image '%s' has entry_point 0x%04" PRIx64 ")",
+                         firmware, entry);
+            return false;
+        }
+        if (!elf_cpu) {
+            warn_report("Could not determine CPU type for ELF image '%s', "
+                        "assuming '%.*s' CPU",
+                         firmware, cpu_len, mcu_cpu_type);
+            return true;
+        }
+        if (strcmp(elf_cpu, mcu_cpu_type)) {
+            error_report("Current machine: %s with '%.*s' CPU",
+                         MACHINE_GET_CLASS(ms)->desc, cpu_len, mcu_cpu_type);
+            error_report("ELF image '%s' is for '%.*s' CPU",
+                         firmware,
+                         (int)(strlen(elf_cpu) - strlen(AVR_CPU_TYPE_SUFFIX)),
+                         elf_cpu);
+            return false;
+        }
+    } else {
+        bytes_loaded = load_image_mr(filename, program_mr);
+    }
+    if (bytes_loaded < 0) {
+        error_report("Unable to load firmware image %s as ELF or raw binary",
+                     firmware);
+        return false;
+    }
+    return true;
+}
diff --git a/hw/avr/boot.h b/hw/avr/boot.h
new file mode 100644
index 0000000000..684d553322
--- /dev/null
+++ b/hw/avr/boot.h
@@ -0,0 +1,33 @@
+/*
+ * AVR loader helpers
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_AVR_BOOT_H
+#define HW_AVR_BOOT_H
+
+#include "hw/boards.h"
+#include "cpu.h"
+
+/**
+ * avr_load_firmware:   load an image into a memory region
+ *
+ * @cpu:        Handle a AVR CPU object
+ * @ms:         A MachineState
+ * @mr:         Memory Region to load into
+ * @firmware:   Path to the firmware file (raw binary or ELF format)
+ *
+ * Load a firmware supplied by the machine or by the user  with the
+ * '-bios' command line option, and put it in target memory.
+ *
+ * Returns: true on success, false on error.
+ */
+bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
+                       MemoryRegion *mr, const char *firmware);
+
+#endif
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
index 874627520c..b7e0e4d5fa 100644
--- a/hw/char/Kconfig
+++ b/hw/char/Kconfig
@@ -49,3 +49,6 @@ config TERMINAL3270
 
 config RENESAS_SCI
     bool
+
+config AVR_USART
+    bool
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index 8306c4a789..bf177ac41d 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -22,6 +22,7 @@ common-obj-$(CONFIG_DIGIC) += digic-uart.o
 common-obj-$(CONFIG_STM32F2XX_USART) += stm32f2xx_usart.o
 common-obj-$(CONFIG_RASPI) += bcm2835_aux.o
 common-obj-$(CONFIG_RENESAS_SCI) += renesas_sci.o
+common-obj-$(CONFIG_AVR_USART) += avr_usart.o
 
 common-obj-$(CONFIG_CMSDK_APB_UART) += cmsdk-apb-uart.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o
diff --git a/hw/char/avr_usart.c b/hw/char/avr_usart.c
new file mode 100644
index 0000000000..fbe2a112b7
--- /dev/null
+++ b/hw/char/avr_usart.c
@@ -0,0 +1,320 @@
+/*
+ * AVR USART
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Sarah Harris
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#include "qemu/osdep.h"
+#include "hw/char/avr_usart.h"
+#include "qemu/log.h"
+#include "hw/irq.h"
+#include "hw/qdev-properties.h"
+
+static int avr_usart_can_receive(void *opaque)
+{
+    AVRUsartState *usart = opaque;
+
+    if (usart->data_valid || !(usart->csrb & USART_CSRB_RXEN)) {
+        return 0;
+    }
+    return 1;
+}
+
+static void avr_usart_receive(void *opaque, const uint8_t *buffer, int size)
+{
+    AVRUsartState *usart = opaque;
+    assert(size == 1);
+    assert(!usart->data_valid);
+    usart->data = buffer[0];
+    usart->data_valid = true;
+    usart->csra |= USART_CSRA_RXC;
+    if (usart->csrb & USART_CSRB_RXCIE) {
+        qemu_set_irq(usart->rxc_irq, 1);
+    }
+}
+
+static void update_char_mask(AVRUsartState *usart)
+{
+    uint8_t mode = ((usart->csrc & USART_CSRC_CSZ0) ? 1 : 0) |
+        ((usart->csrc & USART_CSRC_CSZ1) ? 2 : 0) |
+        ((usart->csrb & USART_CSRB_CSZ2) ? 4 : 0);
+    switch (mode) {
+    case 0:
+        usart->char_mask = 0b11111;
+        break;
+    case 1:
+        usart->char_mask = 0b111111;
+        break;
+    case 2:
+        usart->char_mask = 0b1111111;
+        break;
+    case 3:
+        usart->char_mask = 0b11111111;
+        break;
+    case 4:
+        /* Fallthrough. */
+    case 5:
+        /* Fallthrough. */
+    case 6:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Reserved character size 0x%x\n",
+            __func__,
+            mode);
+        break;
+    case 7:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Nine bit character size not supported (forcing eight)\n",
+            __func__);
+        usart->char_mask = 0b11111111;
+        break;
+    default:
+        assert(0);
+    }
+}
+
+static void avr_usart_reset(DeviceState *dev)
+{
+    AVRUsartState *usart = AVR_USART(dev);
+    usart->data_valid = false;
+    usart->csra = 0b00100000;
+    usart->csrb = 0b00000000;
+    usart->csrc = 0b00000110;
+    usart->brrl = 0;
+    usart->brrh = 0;
+    update_char_mask(usart);
+    qemu_set_irq(usart->rxc_irq, 0);
+    qemu_set_irq(usart->txc_irq, 0);
+    qemu_set_irq(usart->dre_irq, 0);
+}
+
+static uint64_t avr_usart_read(void *opaque, hwaddr addr, unsigned int size)
+{
+    AVRUsartState *usart = opaque;
+    uint8_t data;
+    assert(size == 1);
+
+    if (!usart->enabled) {
+        return 0;
+    }
+
+    switch (addr) {
+    case USART_DR:
+        if (!(usart->csrb & USART_CSRB_RXEN)) {
+            /* Receiver disabled, ignore. */
+            return 0;
+        }
+        if (usart->data_valid) {
+            data = usart->data & usart->char_mask;
+            usart->data_valid = false;
+        } else {
+            data = 0;
+        }
+        usart->csra &= 0xff ^ USART_CSRA_RXC;
+        qemu_set_irq(usart->rxc_irq, 0);
+        qemu_chr_fe_accept_input(&usart->chr);
+        return data;
+    case USART_CSRA:
+        return usart->csra;
+    case USART_CSRB:
+        return usart->csrb;
+    case USART_CSRC:
+        return usart->csrc;
+    case USART_BRRL:
+        return usart->brrl;
+    case USART_BRRH:
+        return usart->brrh;
+    default:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Bad offset 0x%"HWADDR_PRIx"\n",
+            __func__,
+            addr);
+    }
+    return 0;
+}
+
+static void avr_usart_write(void *opaque, hwaddr addr, uint64_t value,
+                                unsigned int size)
+{
+    AVRUsartState *usart = opaque;
+    uint8_t mask;
+    uint8_t data;
+    assert((value & 0xff) == value);
+    assert(size == 1);
+
+    if (!usart->enabled) {
+        return;
+    }
+
+    switch (addr) {
+    case USART_DR:
+        if (!(usart->csrb & USART_CSRB_TXEN)) {
+            /* Transmitter disabled, ignore. */
+            return;
+        }
+        usart->csra |= USART_CSRA_TXC;
+        usart->csra |= USART_CSRA_DRE;
+        if (usart->csrb & USART_CSRB_TXCIE) {
+            qemu_set_irq(usart->txc_irq, 1);
+            usart->csra &= 0xff ^ USART_CSRA_TXC;
+        }
+        if (usart->csrb & USART_CSRB_DREIE) {
+            qemu_set_irq(usart->dre_irq, 1);
+        }
+        data = value;
+        qemu_chr_fe_write_all(&usart->chr, &data, 1);
+        break;
+    case USART_CSRA:
+        mask = 0b01000011;
+        /* Mask read-only bits. */
+        value = (value & mask) | (usart->csra & (0xff ^ mask));
+        usart->csra = value;
+        if (value & USART_CSRA_TXC) {
+            usart->csra ^= USART_CSRA_TXC;
+            qemu_set_irq(usart->txc_irq, 0);
+        }
+        if (value & USART_CSRA_MPCM) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: MPCM not supported by USART\n",
+                __func__);
+        }
+        break;
+    case USART_CSRB:
+        mask = 0b11111101;
+        /* Mask read-only bits. */
+        value = (value & mask) | (usart->csrb & (0xff ^ mask));
+        usart->csrb = value;
+        if (!(value & USART_CSRB_RXEN)) {
+            /* Receiver disabled, flush input buffer. */
+            usart->data_valid = false;
+        }
+        qemu_set_irq(usart->rxc_irq,
+            ((value & USART_CSRB_RXCIE) &&
+            (usart->csra & USART_CSRA_RXC)) ? 1 : 0);
+        qemu_set_irq(usart->txc_irq,
+            ((value & USART_CSRB_TXCIE) &&
+            (usart->csra & USART_CSRA_TXC)) ? 1 : 0);
+        qemu_set_irq(usart->dre_irq,
+            ((value & USART_CSRB_DREIE) &&
+            (usart->csra & USART_CSRA_DRE)) ? 1 : 0);
+        update_char_mask(usart);
+        break;
+    case USART_CSRC:
+        usart->csrc = value;
+        if ((value & USART_CSRC_MSEL1) && (value & USART_CSRC_MSEL0)) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: SPI mode not supported by USART\n",
+                __func__);
+        }
+        if ((value & USART_CSRC_MSEL1) && !(value & USART_CSRC_MSEL0)) {
+            qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad USART mode\n", __func__);
+        }
+        if (!(value & USART_CSRC_PM1) && (value & USART_CSRC_PM0)) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: Bad USART parity mode\n",
+                __func__);
+        }
+        update_char_mask(usart);
+        break;
+    case USART_BRRL:
+        usart->brrl = value;
+        break;
+    case USART_BRRH:
+        usart->brrh = value & 0b00001111;
+        break;
+    default:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Bad offset 0x%"HWADDR_PRIx"\n",
+            __func__,
+            addr);
+    }
+}
+
+static const MemoryRegionOps avr_usart_ops = {
+    .read = avr_usart_read,
+    .write = avr_usart_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.min_access_size = 1, .max_access_size = 1}
+};
+
+static Property avr_usart_properties[] = {
+    DEFINE_PROP_CHR("chardev", AVRUsartState, chr),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void avr_usart_pr(void *opaque, int irq, int level)
+{
+    AVRUsartState *s = AVR_USART(opaque);
+
+    s->enabled = !level;
+
+    if (!s->enabled) {
+        avr_usart_reset(DEVICE(s));
+    }
+}
+
+static void avr_usart_init(Object *obj)
+{
+    AVRUsartState *s = AVR_USART(obj);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->rxc_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->dre_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->txc_irq);
+    memory_region_init_io(&s->mmio, obj, &avr_usart_ops, s, TYPE_AVR_USART, 7);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
+    qdev_init_gpio_in(DEVICE(s), avr_usart_pr, 1);
+    s->enabled = true;
+}
+
+static void avr_usart_realize(DeviceState *dev, Error **errp)
+{
+    AVRUsartState *s = AVR_USART(dev);
+    qemu_chr_fe_set_handlers(&s->chr, avr_usart_can_receive,
+                             avr_usart_receive, NULL, NULL,
+                             s, NULL, true);
+    avr_usart_reset(dev);
+}
+
+static void avr_usart_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_usart_reset;
+    device_class_set_props(dc, avr_usart_properties);
+    dc->realize = avr_usart_realize;
+}
+
+static const TypeInfo avr_usart_info = {
+    .name          = TYPE_AVR_USART,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRUsartState),
+    .instance_init = avr_usart_init,
+    .class_init    = avr_usart_class_init,
+};
+
+static void avr_usart_register_types(void)
+{
+    type_register_static(&avr_usart_info);
+}
+
+type_init(avr_usart_register_types)
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index bdd77d8020..92c397ca07 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -131,4 +131,7 @@ config MAC_VIA
     select MOS6522
     select ADB
 
+config AVR_POWER
+    bool
+
 source macio/Kconfig
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 5aaca8a039..6be3d255ab 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -91,3 +91,5 @@ common-obj-$(CONFIG_NRF51_SOC) += nrf51_rng.o
 obj-$(CONFIG_MAC_VIA) += mac_via.o
 
 common-obj-$(CONFIG_GRLIB) += grlib_ahb_apb_pnp.o
+
+obj-$(CONFIG_AVR_POWER) += avr_power.o
diff --git a/hw/misc/avr_power.c b/hw/misc/avr_power.c
new file mode 100644
index 0000000000..a5412f2cfe
--- /dev/null
+++ b/hw/misc/avr_power.c
@@ -0,0 +1,113 @@
+/*
+ * AVR Power Reduction Management
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/misc/avr_power.h"
+#include "qemu/log.h"
+#include "hw/qdev-properties.h"
+#include "hw/irq.h"
+#include "trace.h"
+
+static void avr_mask_reset(DeviceState *dev)
+{
+    AVRMaskState *s = AVR_MASK(dev);
+
+    s->val = 0x00;
+
+    for (int i = 0; i < 8; i++) {
+        qemu_set_irq(s->irq[i], 0);
+    }
+}
+
+static uint64_t avr_mask_read(void *opaque, hwaddr offset, unsigned size)
+{
+    assert(size == 1);
+    assert(offset == 0);
+    AVRMaskState *s = opaque;
+
+    trace_avr_power_read(s->val);
+
+    return (uint64_t)s->val;
+}
+
+static void avr_mask_write(void *opaque, hwaddr offset,
+                           uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    assert(offset == 0);
+    AVRMaskState *s = opaque;
+    uint8_t val8 = val64;
+
+    trace_avr_power_write(val8);
+    s->val = val8;
+    for (int i = 0; i < 8; i++) {
+        qemu_set_irq(s->irq[i], (val8 & (1 << i)) != 0);
+    }
+}
+
+static const MemoryRegionOps avr_mask_ops = {
+    .read = avr_mask_read,
+    .write = avr_mask_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {
+        .max_access_size = 1,
+    },
+};
+
+static void avr_mask_init(Object *dev)
+{
+    AVRMaskState *s = AVR_MASK(dev);
+    SysBusDevice *busdev = SYS_BUS_DEVICE(dev);
+
+    memory_region_init_io(&s->iomem, dev, &avr_mask_ops, s, TYPE_AVR_MASK,
+                          0x01);
+    sysbus_init_mmio(busdev, &s->iomem);
+
+    for (int i = 0; i < 8; i++) {
+        sysbus_init_irq(busdev, &s->irq[i]);
+    }
+    s->val = 0x00;
+}
+
+static void avr_mask_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_mask_reset;
+}
+
+static const TypeInfo avr_mask_info = {
+    .name          = TYPE_AVR_MASK,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRMaskState),
+    .class_init    = avr_mask_class_init,
+    .instance_init = avr_mask_init,
+};
+
+static void avr_mask_register_types(void)
+{
+    type_register_static(&avr_mask_info);
+}
+
+type_init(avr_mask_register_types)
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index ebea53735c..066752aa90 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -19,6 +19,10 @@ allwinner_h3_dramphy_write(uint64_t offset, uint64_t data, unsigned size) "write
 allwinner_sid_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
 allwinner_sid_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
 
+# avr_power.c
+avr_power_read(uint8_t value) "power_reduc read value:%u"
+avr_power_write(uint8_t value) "power_reduc write value:%u"
+
 # eccmemctl.c
 ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x"
 ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 59a667c503..8749edfb6a 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -41,3 +41,6 @@ config RENESAS_TMR
 
 config RENESAS_CMT
     bool
+
+config AVR_TIMER16
+    bool
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index a39f6ec0c2..1303b13e0d 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -37,3 +37,5 @@ common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
 common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
 common-obj-$(CONFIG_MSF2) += mss-timer.o
 common-obj-$(CONFIG_RASPI) += bcm2835_systmr.o
+
+obj-$(CONFIG_AVR_TIMER16) += avr_timer16.o
diff --git a/hw/timer/avr_timer16.c b/hw/timer/avr_timer16.c
new file mode 100644
index 0000000000..c48555da52
--- /dev/null
+++ b/hw/timer/avr_timer16.c
@@ -0,0 +1,621 @@
+/*
+ * AVR 16-bit timer
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Ed Robbins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+/*
+ * Driver for 16 bit timers on 8 bit AVR devices.
+ * Note:
+ * ATmega640/V-1280/V-1281/V-2560/V-2561/V timers 1, 3, 4 and 5 are 16 bit
+ */
+
+/*
+ * XXX TODO: Power Reduction Register support
+ *           prescaler pause support
+ *           PWM modes, GPIO, output capture pins, input compare pin
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qemu/log.h"
+#include "hw/irq.h"
+#include "hw/qdev-properties.h"
+#include "hw/timer/avr_timer16.h"
+#include "trace.h"
+
+/* Register offsets */
+#define T16_CRA     0x0
+#define T16_CRB     0x1
+#define T16_CRC     0x2
+#define T16_CNTL    0x4
+#define T16_CNTH    0x5
+#define T16_ICRL    0x6
+#define T16_ICRH    0x7
+#define T16_OCRAL   0x8
+#define T16_OCRAH   0x9
+#define T16_OCRBL   0xa
+#define T16_OCRBH   0xb
+#define T16_OCRCL   0xc
+#define T16_OCRCH   0xd
+
+/* Field masks */
+#define T16_CRA_WGM01   0x3
+#define T16_CRA_COMC    0xc
+#define T16_CRA_COMB    0x30
+#define T16_CRA_COMA    0xc0
+#define T16_CRA_OC_CONF \
+    (T16_CRA_COMA | T16_CRA_COMB | T16_CRA_COMC)
+
+#define T16_CRB_CS      0x7
+#define T16_CRB_WGM23   0x18
+#define T16_CRB_ICES    0x40
+#define T16_CRB_ICNC    0x80
+
+#define T16_CRC_FOCC    0x20
+#define T16_CRC_FOCB    0x40
+#define T16_CRC_FOCA    0x80
+
+/* Fields masks both TIMSK and TIFR (interrupt mask/flag registers) */
+#define T16_INT_TOV    0x1 /* Timer overflow */
+#define T16_INT_OCA    0x2 /* Output compare A */
+#define T16_INT_OCB    0x4 /* Output compare B */
+#define T16_INT_OCC    0x8 /* Output compare C */
+#define T16_INT_IC     0x20 /* Input capture */
+
+/* Clock source values */
+#define T16_CLKSRC_STOPPED     0
+#define T16_CLKSRC_DIV1        1
+#define T16_CLKSRC_DIV8        2
+#define T16_CLKSRC_DIV64       3
+#define T16_CLKSRC_DIV256      4
+#define T16_CLKSRC_DIV1024     5
+#define T16_CLKSRC_EXT_FALLING 6
+#define T16_CLKSRC_EXT_RISING  7
+
+/* Timer mode values (not including PWM modes) */
+#define T16_MODE_NORMAL     0
+#define T16_MODE_CTC_OCRA   4
+#define T16_MODE_CTC_ICR    12
+
+/* Accessors */
+#define CLKSRC(t16) (t16->crb & T16_CRB_CS)
+#define MODE(t16)   (((t16->crb & T16_CRB_WGM23) >> 1) | \
+                     (t16->cra & T16_CRA_WGM01))
+#define CNT(t16)    VAL16(t16->cntl, t16->cnth)
+#define OCRA(t16)   VAL16(t16->ocral, t16->ocrah)
+#define OCRB(t16)   VAL16(t16->ocrbl, t16->ocrbh)
+#define OCRC(t16)   VAL16(t16->ocrcl, t16->ocrch)
+#define ICR(t16)    VAL16(t16->icrl, t16->icrh)
+
+/* Helper macros */
+#define VAL16(l, h) ((h << 8) | l)
+#define DB_PRINT(fmt, args...) /* Nothing */
+
+static inline int64_t avr_timer16_ns_to_ticks(AVRTimer16State *t16, int64_t t)
+{
+    if (t16->period_ns == 0) {
+        return 0;
+    }
+    return t / t16->period_ns;
+}
+
+static void avr_timer16_update_cnt(AVRTimer16State *t16)
+{
+    uint16_t cnt;
+    cnt = avr_timer16_ns_to_ticks(t16, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) -
+                                       t16->reset_time_ns);
+    t16->cntl = (uint8_t)(cnt & 0xff);
+    t16->cnth = (uint8_t)((cnt & 0xff00) >> 8);
+}
+
+static inline void avr_timer16_recalc_reset_time(AVRTimer16State *t16)
+{
+    t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) -
+                         CNT(t16) * t16->period_ns;
+}
+
+static void avr_timer16_clock_reset(AVRTimer16State *t16)
+{
+    t16->cntl = 0;
+    t16->cnth = 0;
+    t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+}
+
+static void avr_timer16_clksrc_update(AVRTimer16State *t16)
+{
+    uint16_t divider = 0;
+    switch (CLKSRC(t16)) {
+    case T16_CLKSRC_EXT_FALLING:
+    case T16_CLKSRC_EXT_RISING:
+        qemu_log_mask(LOG_UNIMP, "%s: external clock source unsupported\n",
+                      __func__);
+        break;
+    case T16_CLKSRC_STOPPED:
+        break;
+    case T16_CLKSRC_DIV1:
+        divider = 1;
+        break;
+    case T16_CLKSRC_DIV8:
+        divider = 8;
+        break;
+    case T16_CLKSRC_DIV64:
+        divider = 64;
+        break;
+    case T16_CLKSRC_DIV256:
+        divider = 256;
+        break;
+    case T16_CLKSRC_DIV1024:
+        divider = 1024;
+        break;
+    default:
+        break;
+    }
+    if (divider) {
+        t16->freq_hz = t16->cpu_freq_hz / divider;
+        t16->period_ns = NANOSECONDS_PER_SECOND / t16->freq_hz;
+        trace_avr_timer16_clksrc_update(t16->freq_hz, t16->period_ns,
+                                        (uint64_t)(1e6 / t16->freq_hz));
+    }
+}
+
+static void avr_timer16_set_alarm(AVRTimer16State *t16)
+{
+    if (CLKSRC(t16) == T16_CLKSRC_EXT_FALLING ||
+        CLKSRC(t16) == T16_CLKSRC_EXT_RISING ||
+        CLKSRC(t16) == T16_CLKSRC_STOPPED) {
+        /* Timer is disabled or set to external clock source (unsupported) */
+        return;
+    }
+
+    uint64_t alarm_offset = 0xffff;
+    enum NextInterrupt next_interrupt = OVERFLOW;
+
+    switch (MODE(t16)) {
+    case T16_MODE_NORMAL:
+        /* Normal mode */
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16) &&
+            (t16->imsk & T16_INT_OCA)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+        break;
+    case T16_MODE_CTC_OCRA:
+        /* CTC mode, top = ocra */
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+       break;
+    case T16_MODE_CTC_ICR:
+        /* CTC mode, top = icr */
+        if (ICR(t16) < alarm_offset && ICR(t16) > CNT(t16)) {
+            alarm_offset = ICR(t16);
+            next_interrupt = CAPT;
+        }
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16) &&
+            (t16->imsk & T16_INT_OCA)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+        break;
+    default:
+        qemu_log_mask(LOG_UNIMP, "%s: pwm modes are unsupported\n",
+                      __func__);
+        return;
+    }
+    if (OCRB(t16) < alarm_offset && OCRB(t16) > CNT(t16) &&
+        (t16->imsk & T16_INT_OCB)) {
+        alarm_offset = OCRB(t16);
+        next_interrupt = COMPB;
+    }
+    if (OCRC(t16) < alarm_offset && OCRB(t16) > CNT(t16) &&
+        (t16->imsk & T16_INT_OCC)) {
+        alarm_offset = OCRB(t16);
+        next_interrupt = COMPC;
+    }
+    alarm_offset -= CNT(t16);
+
+    t16->next_interrupt = next_interrupt;
+    uint64_t alarm_ns =
+        t16->reset_time_ns + ((CNT(t16) + alarm_offset) * t16->period_ns);
+    timer_mod(t16->timer, alarm_ns);
+
+    trace_avr_timer16_next_alarm(alarm_offset * t16->period_ns);
+}
+
+static void avr_timer16_interrupt(void *opaque)
+{
+    AVRTimer16State *t16 = opaque;
+    uint8_t mode = MODE(t16);
+
+    avr_timer16_update_cnt(t16);
+
+    if (CLKSRC(t16) == T16_CLKSRC_EXT_FALLING ||
+        CLKSRC(t16) == T16_CLKSRC_EXT_RISING ||
+        CLKSRC(t16) == T16_CLKSRC_STOPPED) {
+        /* Timer is disabled or set to external clock source (unsupported) */
+        return;
+    }
+
+    trace_avr_timer16_interrupt_count(CNT(t16));
+
+    /* Counter overflow */
+    if (t16->next_interrupt == OVERFLOW) {
+        trace_avr_timer16_interrupt_overflow("counter 0xffff");
+        avr_timer16_clock_reset(t16);
+        if (t16->imsk & T16_INT_TOV) {
+            t16->ifr |= T16_INT_TOV;
+            qemu_set_irq(t16->ovf_irq, 1);
+        }
+    }
+    /* Check for ocra overflow in CTC mode */
+    if (mode == T16_MODE_CTC_OCRA && t16->next_interrupt == COMPA) {
+        trace_avr_timer16_interrupt_overflow("CTC OCRA");
+        avr_timer16_clock_reset(t16);
+    }
+    /* Check for icr overflow in CTC mode */
+    if (mode == T16_MODE_CTC_ICR && t16->next_interrupt == CAPT) {
+        trace_avr_timer16_interrupt_overflow("CTC ICR");
+        avr_timer16_clock_reset(t16);
+        if (t16->imsk & T16_INT_IC) {
+            t16->ifr |= T16_INT_IC;
+            qemu_set_irq(t16->capt_irq, 1);
+        }
+    }
+    /* Check for output compare interrupts */
+    if (t16->imsk & T16_INT_OCA && t16->next_interrupt == COMPA) {
+        t16->ifr |= T16_INT_OCA;
+        qemu_set_irq(t16->compa_irq, 1);
+    }
+    if (t16->imsk & T16_INT_OCB && t16->next_interrupt == COMPB) {
+        t16->ifr |= T16_INT_OCB;
+        qemu_set_irq(t16->compb_irq, 1);
+    }
+    if (t16->imsk & T16_INT_OCC && t16->next_interrupt == COMPC) {
+        t16->ifr |= T16_INT_OCC;
+        qemu_set_irq(t16->compc_irq, 1);
+    }
+    avr_timer16_set_alarm(t16);
+}
+
+static void avr_timer16_reset(DeviceState *dev)
+{
+    AVRTimer16State *t16 = AVR_TIMER16(dev);
+
+    avr_timer16_clock_reset(t16);
+    avr_timer16_clksrc_update(t16);
+    avr_timer16_set_alarm(t16);
+
+    qemu_set_irq(t16->capt_irq, 0);
+    qemu_set_irq(t16->compa_irq, 0);
+    qemu_set_irq(t16->compb_irq, 0);
+    qemu_set_irq(t16->compc_irq, 0);
+    qemu_set_irq(t16->ovf_irq, 0);
+}
+
+static uint64_t avr_timer16_read(void *opaque, hwaddr offset, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    uint8_t retval = 0;
+
+    switch (offset) {
+    case T16_CRA:
+        retval = t16->cra;
+        break;
+    case T16_CRB:
+        retval = t16->crb;
+        break;
+    case T16_CRC:
+        retval = t16->crc;
+        break;
+    case T16_CNTL:
+        avr_timer16_update_cnt(t16);
+        t16->rtmp = t16->cnth;
+        retval = t16->cntl;
+        break;
+    case T16_CNTH:
+        retval = t16->rtmp;
+        break;
+    case T16_ICRL:
+        /*
+         * The timer copies cnt to icr when the input capture pin changes
+         * state or when the analog comparator has a match. We don't
+         * emulate this behaviour. We do support it's use for defining a
+         * TOP value in T16_MODE_CTC_ICR
+         */
+        t16->rtmp = t16->icrh;
+        retval = t16->icrl;
+        break;
+    case T16_ICRH:
+        retval = t16->rtmp;
+        break;
+    case T16_OCRAL:
+        retval = t16->ocral;
+        break;
+    case T16_OCRAH:
+        retval = t16->ocrah;
+        break;
+    case T16_OCRBL:
+        retval = t16->ocrbl;
+        break;
+    case T16_OCRBH:
+        retval = t16->ocrbh;
+        break;
+    case T16_OCRCL:
+        retval = t16->ocrcl;
+        break;
+    case T16_OCRCH:
+        retval = t16->ocrch;
+        break;
+    default:
+        break;
+    }
+    trace_avr_timer16_read(offset, retval);
+
+    return (uint64_t)retval;
+}
+
+static void avr_timer16_write(void *opaque, hwaddr offset,
+                              uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    uint8_t val8 = (uint8_t)val64;
+    uint8_t prev_clk_src = CLKSRC(t16);
+
+    trace_avr_timer16_write(offset, val8);
+
+    switch (offset) {
+    case T16_CRA:
+        t16->cra = val8;
+        if (t16->cra & T16_CRA_OC_CONF) {
+            qemu_log_mask(LOG_UNIMP, "%s: output compare pins unsupported\n",
+                          __func__);
+        }
+        break;
+    case T16_CRB:
+        t16->crb = val8;
+        if (t16->crb & T16_CRB_ICNC) {
+            qemu_log_mask(LOG_UNIMP,
+                          "%s: input capture noise canceller unsupported\n",
+                          __func__);
+        }
+        if (t16->crb & T16_CRB_ICES) {
+            qemu_log_mask(LOG_UNIMP, "%s: input capture unsupported\n",
+                          __func__);
+        }
+        if (CLKSRC(t16) != prev_clk_src) {
+            avr_timer16_clksrc_update(t16);
+            if (prev_clk_src == T16_CLKSRC_STOPPED) {
+                t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+            }
+        }
+        break;
+    case T16_CRC:
+        t16->crc = val8;
+        qemu_log_mask(LOG_UNIMP, "%s: output compare pins unsupported\n",
+                      __func__);
+        break;
+    case T16_CNTL:
+        /*
+         * CNT is the 16-bit counter value, it must be read/written via
+         * a temporary register (rtmp) to make the read/write atomic.
+         */
+        /* ICR also has this behaviour, and shares rtmp */
+        /*
+         * Writing CNT blocks compare matches for one clock cycle.
+         * Writing CNT to TOP or to an OCR value (if in use) will
+         * skip the relevant interrupt
+         */
+        t16->cntl = val8;
+        t16->cnth = t16->rtmp;
+        avr_timer16_recalc_reset_time(t16);
+        break;
+    case T16_CNTH:
+        t16->rtmp = val8;
+        break;
+    case T16_ICRL:
+        /* ICR can only be written in mode T16_MODE_CTC_ICR */
+        if (MODE(t16) == T16_MODE_CTC_ICR) {
+            t16->icrl = val8;
+            t16->icrh = t16->rtmp;
+        }
+        break;
+    case T16_ICRH:
+        if (MODE(t16) == T16_MODE_CTC_ICR) {
+            t16->rtmp = val8;
+        }
+        break;
+    case T16_OCRAL:
+        /*
+         * OCRn cause the relevant output compare flag to be raised, and
+         * trigger an interrupt, when CNT is equal to the value here
+         */
+        t16->ocral = val8;
+        break;
+    case T16_OCRAH:
+        t16->ocrah = val8;
+        break;
+    case T16_OCRBL:
+        t16->ocrbl = val8;
+        break;
+    case T16_OCRBH:
+        t16->ocrbh = val8;
+        break;
+    case T16_OCRCL:
+        t16->ocrcl = val8;
+        break;
+    case T16_OCRCH:
+        t16->ocrch = val8;
+        break;
+    default:
+        break;
+    }
+    avr_timer16_set_alarm(t16);
+}
+
+static uint64_t avr_timer16_imsk_read(void *opaque,
+                                      hwaddr offset,
+                                      unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_read_imsk(offset ? 0 : t16->imsk);
+    if (offset != 0) {
+        return 0;
+    }
+    return t16->imsk;
+}
+
+static void avr_timer16_imsk_write(void *opaque, hwaddr offset,
+                                   uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_write_imsk(val64);
+    if (offset != 0) {
+        return;
+    }
+    t16->imsk = (uint8_t)val64;
+}
+
+static uint64_t avr_timer16_ifr_read(void *opaque,
+                                     hwaddr offset,
+                                     unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_read_ifr(offset ? 0 : t16->ifr);
+    if (offset != 0) {
+        return 0;
+    }
+    return t16->ifr;
+}
+
+static void avr_timer16_ifr_write(void *opaque, hwaddr offset,
+                                  uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_write_imsk(val64);
+    if (offset != 0) {
+        return;
+    }
+    t16->ifr = (uint8_t)val64;
+}
+
+static const MemoryRegionOps avr_timer16_ops = {
+    .read = avr_timer16_read,
+    .write = avr_timer16_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static const MemoryRegionOps avr_timer16_imsk_ops = {
+    .read = avr_timer16_imsk_read,
+    .write = avr_timer16_imsk_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static const MemoryRegionOps avr_timer16_ifr_ops = {
+    .read = avr_timer16_ifr_read,
+    .write = avr_timer16_ifr_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static Property avr_timer16_properties[] = {
+    DEFINE_PROP_UINT8("id", struct AVRTimer16State, id, 0),
+    DEFINE_PROP_UINT64("cpu-frequency-hz", struct AVRTimer16State,
+                       cpu_freq_hz, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void avr_timer16_pr(void *opaque, int irq, int level)
+{
+    AVRTimer16State *s = AVR_TIMER16(opaque);
+
+    s->enabled = !level;
+
+    if (!s->enabled) {
+        avr_timer16_reset(DEVICE(s));
+    }
+}
+
+static void avr_timer16_init(Object *obj)
+{
+    AVRTimer16State *s = AVR_TIMER16(obj);
+
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->capt_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compa_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compb_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compc_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->ovf_irq);
+
+    memory_region_init_io(&s->iomem, obj, &avr_timer16_ops,
+                          s, "avr-timer16", 0xe);
+    memory_region_init_io(&s->imsk_iomem, obj, &avr_timer16_imsk_ops,
+                          s, "avr-timer16-intmask", 0x1);
+    memory_region_init_io(&s->ifr_iomem, obj, &avr_timer16_ifr_ops,
+                          s, "avr-timer16-intflag", 0x1);
+
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->imsk_iomem);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->ifr_iomem);
+    qdev_init_gpio_in(DEVICE(s), avr_timer16_pr, 1);
+}
+
+static void avr_timer16_realize(DeviceState *dev, Error **errp)
+{
+    AVRTimer16State *s = AVR_TIMER16(dev);
+
+    if (s->cpu_freq_hz == 0) {
+        error_setg(errp, "AVR timer16: cpu-frequency-hz property must be set");
+        return;
+    }
+
+    s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, avr_timer16_interrupt, s);
+    s->enabled = true;
+}
+
+static void avr_timer16_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_timer16_reset;
+    dc->realize = avr_timer16_realize;
+    device_class_set_props(dc, avr_timer16_properties);
+}
+
+static const TypeInfo avr_timer16_info = {
+    .name          = TYPE_AVR_TIMER16,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRTimer16State),
+    .instance_init = avr_timer16_init,
+    .class_init    = avr_timer16_class_init,
+};
+
+static void avr_timer16_register_types(void)
+{
+    type_register_static(&avr_timer16_info);
+}
+
+type_init(avr_timer16_register_types)
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index 866c9f546a..447b7c405b 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -75,3 +75,15 @@ nrf51_timer_set_count(uint8_t timer_id, uint8_t counter_id, uint32_t value) "tim
 bcm2835_systmr_irq(bool enable) "timer irq state %u"
 bcm2835_systmr_read(uint64_t offset, uint64_t data) "timer read: offset 0x%" PRIx64 " data 0x%" PRIx64
 bcm2835_systmr_write(uint64_t offset, uint64_t data) "timer write: offset 0x%" PRIx64 " data 0x%" PRIx64
+
+# avr_timer16.c
+avr_timer16_read(uint8_t addr, uint8_t value) "timer16 read addr:%u value:%u"
+avr_timer16_read_ifr(uint8_t value) "timer16 read addr:ifr value:%u"
+avr_timer16_read_imsk(uint8_t value) "timer16 read addr:imsk value:%u"
+avr_timer16_write(uint8_t addr, uint8_t value) "timer16 write addr:%u value:%u"
+avr_timer16_write_ifr(uint8_t value) "timer16 write addr:ifr value:%u"
+avr_timer16_write_imsk(uint8_t value) "timer16 write addr:imsk value:%u"
+avr_timer16_interrupt_count(uint8_t cnt) "count: %u"
+avr_timer16_interrupt_overflow(const char *reason) "overflow: %s"
+avr_timer16_next_alarm(uint64_t delay_ns) "next alarm: %" PRIu64 " ns from now"
+avr_timer16_clksrc_update(uint64_t freq_hz, uint64_t period_ns, uint64_t delay_s) "timer frequency: %" PRIu64 " Hz, period: %" PRIu64 " ns (%" PRId64 " us)"
diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index c5f9fa08ab..9856bf7921 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -211,6 +211,25 @@ enum bfd_architecture
 #define bfd_mach_m32r          0  /* backwards compatibility */
   bfd_arch_mn10200,    /* Matsushita MN10200 */
   bfd_arch_mn10300,    /* Matsushita MN10300 */
+  bfd_arch_avr,        /* AVR microcontrollers */
+#define bfd_mach_avr1       1
+#define bfd_mach_avr2       2
+#define bfd_mach_avr25      25
+#define bfd_mach_avr3       3
+#define bfd_mach_avr31      31
+#define bfd_mach_avr35      35
+#define bfd_mach_avr4       4
+#define bfd_mach_avr5       5
+#define bfd_mach_avr51      51
+#define bfd_mach_avr6       6
+#define bfd_mach_avrtiny    100
+#define bfd_mach_avrxmega1  101
+#define bfd_mach_avrxmega2  102
+#define bfd_mach_avrxmega3  103
+#define bfd_mach_avrxmega4  104
+#define bfd_mach_avrxmega5  105
+#define bfd_mach_avrxmega6  106
+#define bfd_mach_avrxmega7  107
   bfd_arch_cris,       /* Axis CRIS */
 #define bfd_mach_cris_v0_v10   255
 #define bfd_mach_cris_v32      32
diff --git a/include/elf.h b/include/elf.h
index 8fbfe60e09..5b06b55f28 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -160,6 +160,8 @@ typedef struct mips_elf_abiflags_v0 {
 
 #define EM_CRIS         76      /* Axis Communications 32-bit embedded processor */
 
+#define EM_AVR          83      /* AVR 8-bit microcontroller */
+
 #define EM_V850		87	/* NEC v850 */
 
 #define EM_H8_300H      47      /* Hitachi H8/300H */
@@ -202,6 +204,8 @@ typedef struct mips_elf_abiflags_v0 {
 #define EM_MOXIE           223     /* Moxie processor family */
 #define EM_MOXIE_OLD       0xFEED
 
+#define EF_AVR_MACH     0x7F       /* Mask for AVR e_flags to get core type */
+
 /* This is the info that is needed to parse the dynamic section of the file */
 #define DT_NULL		0
 #define DT_NEEDED	1
diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h
new file mode 100644
index 0000000000..5739aaf26f
--- /dev/null
+++ b/include/hw/char/avr_usart.h
@@ -0,0 +1,93 @@
+/*
+ * AVR USART
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Sarah Harris
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef HW_CHAR_AVR_USART_H
+#define HW_CHAR_AVR_USART_H
+
+#include "hw/sysbus.h"
+#include "chardev/char-fe.h"
+#include "hw/hw.h"
+
+/* Offsets of registers. */
+#define USART_DR   0x06
+#define USART_CSRA  0x00
+#define USART_CSRB  0x01
+#define USART_CSRC  0x02
+#define USART_BRRH 0x05
+#define USART_BRRL 0x04
+
+/* Relevant bits in regiters. */
+#define USART_CSRA_RXC    (1 << 7)
+#define USART_CSRA_TXC    (1 << 6)
+#define USART_CSRA_DRE    (1 << 5)
+#define USART_CSRA_MPCM   (1 << 0)
+
+#define USART_CSRB_RXCIE  (1 << 7)
+#define USART_CSRB_TXCIE  (1 << 6)
+#define USART_CSRB_DREIE  (1 << 5)
+#define USART_CSRB_RXEN   (1 << 4)
+#define USART_CSRB_TXEN   (1 << 3)
+#define USART_CSRB_CSZ2   (1 << 2)
+#define USART_CSRB_RXB8   (1 << 1)
+#define USART_CSRB_TXB8   (1 << 0)
+
+#define USART_CSRC_MSEL1  (1 << 7)
+#define USART_CSRC_MSEL0  (1 << 6)
+#define USART_CSRC_PM1    (1 << 5)
+#define USART_CSRC_PM0    (1 << 4)
+#define USART_CSRC_CSZ1   (1 << 2)
+#define USART_CSRC_CSZ0   (1 << 1)
+
+#define TYPE_AVR_USART "avr-usart"
+#define AVR_USART(obj) \
+    OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion mmio;
+
+    CharBackend chr;
+
+    bool enabled;
+
+    uint8_t data;
+    bool data_valid;
+    uint8_t char_mask;
+    /* Control and Status Registers */
+    uint8_t csra;
+    uint8_t csrb;
+    uint8_t csrc;
+    /* Baud Rate Registers (low/high byte) */
+    uint8_t brrh;
+    uint8_t brrl;
+
+    /* Receive Complete */
+    qemu_irq rxc_irq;
+    /* Transmit Complete */
+    qemu_irq txc_irq;
+    /* Data Register Empty */
+    qemu_irq dre_irq;
+} AVRUsartState;
+
+#endif /* HW_CHAR_AVR_USART_H */
diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h
new file mode 100644
index 0000000000..e08e44f629
--- /dev/null
+++ b/include/hw/misc/avr_power.h
@@ -0,0 +1,46 @@
+/*
+ * AVR Power Reduction Management
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * 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 HW_MISC_AVR_POWER_H
+#define HW_MISC_AVR_POWER_H
+
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+
+
+#define TYPE_AVR_MASK "avr-power"
+#define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+
+    uint8_t val;
+    qemu_irq irq[8];
+} AVRMaskState;
+
+#endif /* HW_MISC_AVR_POWER_H */
diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h
new file mode 100644
index 0000000000..982019d242
--- /dev/null
+++ b/include/hw/timer/avr_timer16.h
@@ -0,0 +1,94 @@
+/*
+ * AVR 16-bit timer
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Ed Robbins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+/*
+ * Driver for 16 bit timers on 8 bit AVR devices.
+ * Note:
+ * On ATmega640/V-1280/V-1281/V-2560/V-2561/V timers 1, 3, 4 and 5 are 16 bit
+ */
+
+#ifndef HW_TIMER_AVR_TIMER16_H
+#define HW_TIMER_AVR_TIMER16_H
+
+#include "hw/sysbus.h"
+#include "qemu/timer.h"
+#include "hw/hw.h"
+
+enum NextInterrupt {
+    OVERFLOW,
+    COMPA,
+    COMPB,
+    COMPC,
+    CAPT
+};
+
+#define TYPE_AVR_TIMER16 "avr-timer16"
+#define AVR_TIMER16(obj) \
+    OBJECT_CHECK(AVRTimer16State, (obj), TYPE_AVR_TIMER16)
+
+typedef struct AVRTimer16State {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+    MemoryRegion imsk_iomem;
+    MemoryRegion ifr_iomem;
+    QEMUTimer *timer;
+    qemu_irq capt_irq;
+    qemu_irq compa_irq;
+    qemu_irq compb_irq;
+    qemu_irq compc_irq;
+    qemu_irq ovf_irq;
+
+    bool enabled;
+
+    /* registers */
+    uint8_t cra;
+    uint8_t crb;
+    uint8_t crc;
+    uint8_t cntl;
+    uint8_t cnth;
+    uint8_t icrl;
+    uint8_t icrh;
+    uint8_t ocral;
+    uint8_t ocrah;
+    uint8_t ocrbl;
+    uint8_t ocrbh;
+    uint8_t ocrcl;
+    uint8_t ocrch;
+    /*
+     * Reads and writes to CNT and ICR utilise a bizarre temporary
+     * register, which we emulate
+     */
+    uint8_t rtmp;
+    uint8_t imsk;
+    uint8_t ifr;
+
+    uint8_t id;
+    uint64_t cpu_freq_hz;
+    uint64_t freq_hz;
+    uint64_t period_ns;
+    uint64_t reset_time_ns;
+    enum NextInterrupt next_interrupt;
+} AVRTimer16State;
+
+#endif /* HW_TIMER_AVR_TIMER16_H */
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 71a7a285ee..54f069d491 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -25,6 +25,7 @@ enum {
     QEMU_ARCH_HPPA = (1 << 18),
     QEMU_ARCH_RISCV = (1 << 19),
     QEMU_ARCH_RX = (1 << 20),
+    QEMU_ARCH_AVR = (1 << 21),
 
     QEMU_ARCH_NONE = (1 << 31),
 };
diff --git a/qapi/machine.json b/qapi/machine.json
index ff7b5032e3..f59144023c 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -17,6 +17,7 @@
 # being.
 #
 # @rx: since 5.0
+# @avr: since 5.1
 #
 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
 #        prefix to produce the corresponding QEMU executable name. This
@@ -25,7 +26,7 @@
 # Since: 3.0
 ##
 { 'enum' : 'SysEmuTarget',
-  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
+  'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386', 'lm32',
              'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
              'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
              'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c
index 8afea4748b..7fd5c09b2b 100644
--- a/softmmu/arch_init.c
+++ b/softmmu/arch_init.c
@@ -90,6 +90,8 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_UNICORE32
 #elif defined(TARGET_XTENSA)
 #define QEMU_ARCH QEMU_ARCH_XTENSA
+#elif defined(TARGET_AVR)
+#define QEMU_ARCH QEMU_ARCH_AVR
 #endif
 
 const uint32_t arch_type = QEMU_ARCH;
diff --git a/target/avr/Makefile.objs b/target/avr/Makefile.objs
new file mode 100644
index 0000000000..6e35ba2c5c
--- /dev/null
+++ b/target/avr/Makefile.objs
@@ -0,0 +1,34 @@
+#
+#  QEMU AVR
+#
+#  Copyright (c) 2016-2020 Michael Rolnik
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License, or (at your option) any later version.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, see
+#  <http://www.gnu.org/licenses/lgpl-2.1.html>
+#
+
+DECODETREE = $(SRC_PATH)/scripts/decodetree.py
+decode-y = $(SRC_PATH)/target/avr/insn.decode
+
+target/avr/decode_insn.inc.c: $(decode-y) $(DECODETREE)
+	$(call quiet-command, \
+	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn --insnwidth 16 $<, \
+	  "GEN", $(TARGET_DIR)$@)
+
+target/avr/translate.o: target/avr/decode_insn.inc.c
+
+obj-y += translate.o cpu.o helper.o
+obj-y += gdbstub.o
+obj-y += disas.o
+obj-$(CONFIG_SOFTMMU) += machine.o
diff --git a/target/avr/cpu-param.h b/target/avr/cpu-param.h
new file mode 100644
index 0000000000..7ef4e7c679
--- /dev/null
+++ b/target/avr/cpu-param.h
@@ -0,0 +1,36 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef AVR_CPU_PARAM_H
+#define AVR_CPU_PARAM_H
+
+#define TARGET_LONG_BITS 32
+/*
+ * TARGET_PAGE_BITS cannot be more than 8 bits because
+ * 1.  all IO registers occupy [0x0000 .. 0x00ff] address range, and they
+ *     should be implemented as a device and not memory
+ * 2.  SRAM starts at the address 0x0100
+ */
+#define TARGET_PAGE_BITS 8
+#define TARGET_PHYS_ADDR_SPACE_BITS 24
+#define TARGET_VIRT_ADDR_SPACE_BITS 24
+#define NB_MMU_MODES 2
+
+#endif
diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h
new file mode 100644
index 0000000000..d23ad43a99
--- /dev/null
+++ b/target/avr/cpu-qom.h
@@ -0,0 +1,53 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef QEMU_AVR_QOM_H
+#define QEMU_AVR_QOM_H
+
+#include "hw/core/cpu.h"
+
+#define TYPE_AVR_CPU "avr-cpu"
+
+#define AVR_CPU_CLASS(klass) \
+    OBJECT_CLASS_CHECK(AVRCPUClass, (klass), TYPE_AVR_CPU)
+#define AVR_CPU(obj) \
+    OBJECT_CHECK(AVRCPU, (obj), TYPE_AVR_CPU)
+#define AVR_CPU_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(AVRCPUClass, (obj), TYPE_AVR_CPU)
+
+/**
+ *  AVRCPUClass:
+ *  @parent_realize: The parent class' realize handler.
+ *  @parent_reset: The parent class' reset handler.
+ *  @vr: Version Register value.
+ *
+ *  A AVR CPU model.
+ */
+typedef struct AVRCPUClass {
+    /*< private >*/
+    CPUClass parent_class;
+    /*< public >*/
+    DeviceRealize parent_realize;
+    DeviceReset parent_reset;
+} AVRCPUClass;
+
+typedef struct AVRCPU AVRCPU;
+
+#endif /* !defined (QEMU_AVR_CPU_QOM_H) */
diff --git a/target/avr/cpu.c b/target/avr/cpu.c
new file mode 100644
index 0000000000..5d9c4ad5bf
--- /dev/null
+++ b/target/avr/cpu.c
@@ -0,0 +1,366 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qemu/qemu-print.h"
+#include "exec/exec-all.h"
+#include "cpu.h"
+#include "disas/dis-asm.h"
+
+static void avr_cpu_set_pc(CPUState *cs, vaddr value)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+
+    cpu->env.pc_w = value / 2; /* internally PC points to words */
+}
+
+static bool avr_cpu_has_work(CPUState *cs)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+    CPUAVRState *env = &cpu->env;
+
+    return (cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_RESET))
+            && cpu_interrupts_enabled(env);
+}
+
+static void avr_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+    CPUAVRState *env = &cpu->env;
+
+    env->pc_w = tb->pc / 2; /* internally PC points to words */
+}
+
+static void avr_cpu_reset(DeviceState *ds)
+{
+    CPUState *cs = CPU(ds);
+    AVRCPU *cpu = AVR_CPU(cs);
+    AVRCPUClass *mcc = AVR_CPU_GET_CLASS(cpu);
+    CPUAVRState *env = &cpu->env;
+
+    mcc->parent_reset(ds);
+
+    env->pc_w = 0;
+    env->sregI = 1;
+    env->sregC = 0;
+    env->sregZ = 0;
+    env->sregN = 0;
+    env->sregV = 0;
+    env->sregS = 0;
+    env->sregH = 0;
+    env->sregT = 0;
+
+    env->rampD = 0;
+    env->rampX = 0;
+    env->rampY = 0;
+    env->rampZ = 0;
+    env->eind = 0;
+    env->sp = 0;
+
+    env->skip = 0;
+
+    memset(env->r, 0, sizeof(env->r));
+}
+
+static void avr_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
+{
+    info->mach = bfd_arch_avr;
+    info->print_insn = avr_print_insn;
+}
+
+static void avr_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+    CPUState *cs = CPU(dev);
+    AVRCPUClass *mcc = AVR_CPU_GET_CLASS(dev);
+    Error *local_err = NULL;
+
+    cpu_exec_realizefn(cs, &local_err);
+    if (local_err != NULL) {
+        error_propagate(errp, local_err);
+        return;
+    }
+    qemu_init_vcpu(cs);
+    cpu_reset(cs);
+
+    mcc->parent_realize(dev, errp);
+}
+
+static void avr_cpu_set_int(void *opaque, int irq, int level)
+{
+    AVRCPU *cpu = opaque;
+    CPUAVRState *env = &cpu->env;
+    CPUState *cs = CPU(cpu);
+    uint64_t mask = (1ull << irq);
+
+    if (level) {
+        env->intsrc |= mask;
+        cpu_interrupt(cs, CPU_INTERRUPT_HARD);
+    } else {
+        env->intsrc &= ~mask;
+        if (env->intsrc == 0) {
+            cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
+        }
+    }
+}
+
+static void avr_cpu_initfn(Object *obj)
+{
+    AVRCPU *cpu = AVR_CPU(obj);
+
+    cpu_set_cpustate_pointers(cpu);
+
+    /* Set the number of interrupts supported by the CPU. */
+    qdev_init_gpio_in(DEVICE(cpu), avr_cpu_set_int,
+                      sizeof(cpu->env.intsrc) * 8);
+}
+


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:22:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:22:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14684.36298 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYER5-00080K-2L; Thu, 29 Oct 2020 20:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14684.36298; Thu, 29 Oct 2020 20:22:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYER4-00080D-VD; Thu, 29 Oct 2020 20:22:14 +0000
Received: by outflank-mailman (input) for mailman id 14684;
 Thu, 29 Oct 2020 20:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYER4-000808-E4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 35ad043a-d2a7-41fd-b8c4-3354c7706674;
 Thu, 29 Oct 2020 20:22:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEQx-000680-Pr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEQx-0006og-Os
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYER4-000808-E4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:14 +0000
X-Inumbo-ID: 35ad043a-d2a7-41fd-b8c4-3354c7706674
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 35ad043a-d2a7-41fd-b8c4-3354c7706674;
	Thu, 29 Oct 2020 20:22:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oe9Kclqj9tyKLdIgiRg840J2n0GBuLSDcjYdpwSxPU4=; b=6FC0ypPaG21BcUu14i+tkIqxVE
	U+LE8xERQgdscyESh85jLJgDJYB7TgLE+aZSW+jd7EC6NvAbJUqT39cWsp+YQnG2BGQbOnnIdJO/j
	4fOlrSTe38SgD3/ww5bY5uTv+Z0oDAkEhoexH1pSSgUfEP7aYsKl+eRJi3t7QSnREQ90=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEQx-000680-Pr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEQx-0006og-Os
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:22:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-110720-2' into staging
Message-Id: <E1kYEQx-0006og-Os@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:22:07 +0000

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

commit 9f526fce49c6ac48114ed04914b5a76e4db75785
Merge: d34498309cff7560ac90c422c56e3137e6a64b19 4a40f561d5ebb5050a8c6dcbdcee85621056590a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 12 15:32:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 12 15:32:05 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-110720-2' into staging
    
    Testing and misc build updates:
    
      - tests/vm support for aarch64 VMs
      - tests/tcg better cross-compiler detection
      - update docker tooling to support registries
      - update docker support for xtensa
      - gitlab build docker images and store in registry
      - gitlab use docker images for builds
      - a number of skipIf updates to support move
      - linux-user MAP_FIXED_NOREPLACE fix
      - qht-bench compiler tweaks
      - configure fix for secret keyring
      - tsan fiber annotation clean-up
      - doc updates for mttcg/icount/gdbstub
      - fix cirrus to use brew bash for iotests
      - revert virtio-gpu breakage
      - fix LC_ALL to avoid sorting changes in iotests
    
    # gpg: Signature made Sat 11 Jul 2020 15:56:42 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-testing-and-misc-110720-2: (50 commits)
      iotests: Set LC_ALL=C for sort
      Revert "vga: build virtio-gpu as module"
      tests: fix "make check-qtest" for modular builds
      .cirrus.yml: add bash to the brew packages
      tests/docker: update toolchain set in debian-xtensa-cross
      tests/docker: fall back more gracefully when pull fails
      docs: Add to gdbstub documentation the PhyMemMode
      docs/devel: add some notes on tcg-icount for developers
      docs/devel: convert and update MTTCG design document
      tests/qht-bench: Adjust threshold computation
      tests/qht-bench: Adjust testing rate by -1
      travis.yml: Test also the other targets on s390x
      shippable: pull images from registry instead of building
      testing: add check-build target
      containers.yml: build with docker.py tooling
      gitlab: limit re-builds of the containers
      tests: improve performance of device-introspect-test
      gitlab: add avocado asset caching
      gitlab: enable check-tcg for linux-user tests
      linux-user/elfload: use MAP_FIXED_NOREPLACE in pgb_reserved_va
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 .cirrus.yml                                        |   4 +-
 .gitignore                                         |   1 +
 .gitlab-ci.d/containers.yml                        | 263 +++++++++++++++
 .gitlab-ci.d/edk2.yml                              |   5 +-
 .gitlab-ci.d/opensbi.yml                           |   5 +-
 .gitlab-ci.yml                                     | 265 +++++++++------
 .shippable.yml                                     |   8 +-
 .travis.yml                                        |  62 ++--
 configure                                          |  31 +-
 docs/devel/index.rst                               |   2 +
 docs/devel/multi-thread-tcg.rst                    | 372 +++++++++++++++++++++
 docs/devel/multi-thread-tcg.txt                    | 358 --------------------
 docs/devel/tcg-icount.rst                          |  97 ++++++
 docs/system/gdb.rst                                |  20 ++
 hw/display/Makefile.objs                           |  23 +-
 linux-user/elfload.c                               |  10 +-
 python/qemu/console_socket.py                      | 110 ++++++
 python/qemu/machine.py                             |  23 +-
 tests/Makefile.include                             |  19 +-
 tests/acceptance/boot_linux.py                     |   2 +
 tests/acceptance/linux_initrd.py                   |   3 +
 tests/acceptance/machine_mips_malta.py             |   3 +
 tests/acceptance/machine_rx_gdbsim.py              |   2 +-
 tests/acceptance/replay_kernel.py                  |   2 +-
 tests/docker/Makefile.include                      |  17 +-
 tests/docker/common.rc                             |   2 +-
 tests/docker/docker.py                             |  47 ++-
 .../dockerfiles/debian-all-test-cross.docker       |  53 +++
 tests/docker/dockerfiles/debian-alpha-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-amd64-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-amd64.docker       |   2 +-
 tests/docker/dockerfiles/debian-arm64-cross.docker |   2 +-
 .../dockerfiles/debian-arm64-test-cross.docker     |   2 +-
 tests/docker/dockerfiles/debian-armel-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-armhf-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-hppa-cross.docker  |   2 +-
 tests/docker/dockerfiles/debian-m68k-cross.docker  |   2 +-
 tests/docker/dockerfiles/debian-mips-cross.docker  |   2 +-
 .../docker/dockerfiles/debian-mips64-cross.docker  |   2 +-
 .../dockerfiles/debian-mips64el-cross.docker       |   2 +-
 .../docker/dockerfiles/debian-mipsel-cross.docker  |   2 +-
 .../docker/dockerfiles/debian-powerpc-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-ppc64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-ppc64el-cross.docker |   2 +-
 .../docker/dockerfiles/debian-riscv64-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-s390x-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-sh4-cross.docker   |   2 +-
 .../docker/dockerfiles/debian-sparc64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-tricore-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-win32-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-win64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-xtensa-cross.docker  |   6 +-
 tests/docker/dockerfiles/debian9-mxe.docker        |   2 +-
 tests/docker/dockerfiles/fedora.docker             |   7 +
 tests/docker/dockerfiles/ubuntu2004.docker         |  10 +-
 tests/qemu-iotests/common.filter                   |   2 +-
 tests/qht-bench.c                                  |  40 ++-
 tests/qtest/Makefile.include                       |   1 +
 tests/qtest/device-introspect-test.c               |  60 ++--
 tests/tcg/Makefile.qemu                            |   4 +-
 tests/tcg/configure.sh                             |  21 +-
 tests/vm/Makefile.include                          |  22 ++
 tests/vm/aarch64vm.py                              | 106 ++++++
 tests/vm/basevm.py                                 | 344 ++++++++++++++-----
 tests/vm/centos-8-aarch64.ks                       |  51 +++
 tests/vm/centos.aarch64                            | 227 +++++++++++++
 tests/vm/conf_example_aarch64.yml                  |  51 +++
 tests/vm/conf_example_x86.yml                      |  50 +++
 tests/vm/fedora                                    |  17 +-
 tests/vm/freebsd                                   |  16 +-
 tests/vm/netbsd                                    |  19 +-
 tests/vm/openbsd                                   |  17 +-
 tests/vm/ubuntu.aarch64                            |  68 ++++
 tests/vm/ubuntu.i386                               |  46 +--
 tests/vm/ubuntuvm.py                               |  60 ++++
 util/coroutine-ucontext.c                          |  52 ++-
 util/module.c                                      |   6 -
 77 files changed, 2373 insertions(+), 787 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 69342ae031..f287d23c5b 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -20,7 +20,7 @@ macos_task:
   osx_instance:
     image: mojave-base
   install_script:
-    - brew install pkg-config python gnu-sed glib pixman make sdl2
+    - brew install pkg-config python gnu-sed glib pixman make sdl2 bash
   script:
     - mkdir build
     - cd build
@@ -33,7 +33,7 @@ macos_xcode_task:
     # this is an alias for the latest Xcode
     image: mojave-xcode
   install_script:
-    - brew install pkg-config gnu-sed glib pixman make sdl2
+    - brew install pkg-config gnu-sed glib pixman make sdl2 bash
   script:
     - mkdir build
     - cd build
diff --git a/.gitignore b/.gitignore
index 90acb4347d..2992d15931 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,6 +93,7 @@
 *.tp
 *.vr
 *.d
+!/.gitlab-ci.d
 !/scripts/qemu-guest-agent/fsfreeze-hook.d
 *.o
 .sdk
diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
new file mode 100644
index 0000000000..f3c0ca4d61
--- /dev/null
+++ b/.gitlab-ci.d/containers.yml
@@ -0,0 +1,263 @@
+.container_job_template: &container_job_definition
+  image: docker:stable
+  stage: containers
+  services:
+    - docker:dind
+  before_script:
+    - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
+    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/$NAME:latest"
+    - apk add python3
+    - docker info
+    - docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
+  script:
+    - echo "TAG:$TAG"
+    - echo "COMMON_TAG:$COMMON_TAG"
+    - docker pull "$TAG" || docker pull "$COMMON_TAG" || true
+    - ./tests/docker/docker.py --engine docker build
+          -t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
+          -r $CI_REGISTRY_IMAGE
+    - docker tag "qemu/$NAME" "$TAG"
+    - docker push "$TAG"
+  after_script:
+    - docker logout
+  rules:
+    - changes:
+      - .gitlab-ci.d/containers.yml
+      - tests/docker/*
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+    - if: '$CI_COMMIT_REF_NAME == "testing/next"'
+
+amd64-centos7-container:
+  <<: *container_job_definition
+  variables:
+    NAME: centos7
+
+amd64-centos8-container:
+  <<: *container_job_definition
+  variables:
+    NAME: centos8
+
+amd64-debian10-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian10
+
+amd64-debian11-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian11
+
+amd64-debian9-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian9
+
+amd64-debian9-mxe-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian9-container']
+  variables:
+    NAME: debian9-mxe
+
+alpha-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-alpha-cross
+
+amd64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-amd64-cross
+
+amd64-debian-user-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-all-test-cross
+
+amd64-debian-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-amd64
+
+arm64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-arm64-cross
+
+arm64-test-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian11-container']
+  variables:
+    NAME: debian-arm64-test-cross
+
+armel-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-armel-cross
+
+armhf-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-armhf-cross
+
+hppa-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-hppa-cross
+
+m68k-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-m68k-cross
+
+mips64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips64-cross
+
+mips64el-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips64el-cross
+
+mips-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips-cross
+
+mipsel-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mipsel-cross
+
+powerpc-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-powerpc-cross
+
+ppc64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-ppc64-cross
+
+ppc64el-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-ppc64el-cross
+
+riscv64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-riscv64-cross
+
+s390x-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-s390x-cross
+
+sh4-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-sh4-cross
+
+sparc64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-sparc64-cross
+
+tricore-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian9-container']
+  variables:
+    NAME: debian-tricore-cross
+
+win32-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer3
+  needs: ['amd64-debian9-mxe-container']
+  variables:
+    NAME: debian-win32-cross
+
+win64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer3
+  needs: ['amd64-debian9-mxe-container']
+  variables:
+    NAME: debian-win64-cross
+
+xtensa-debian-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian-xtensa-cross
+
+cris-fedora-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora-cris-cross
+
+amd64-fedora-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora
+
+i386-fedora-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora-i386-cross
+
+amd64-ubuntu1804-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu1804
+
+amd64-ubuntu2004-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu2004
+
+amd64-ubuntu-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu
diff --git a/.gitlab-ci.d/edk2.yml b/.gitlab-ci.d/edk2.yml
index 088ba4b43a..e1e0452416 100644
--- a/.gitlab-ci.d/edk2.yml
+++ b/.gitlab-ci.d/edk2.yml
@@ -1,8 +1,8 @@
 docker-edk2:
- stage: build
+ stage: containers
  rules: # Only run this job when the Dockerfile is modified
  - changes:
-   - .gitlab-ci-edk2.yml
+   - .gitlab-ci.d/edk2.yml
    - .gitlab-ci.d/edk2/Dockerfile
    when: always
  image: docker:19.03.1
@@ -24,6 +24,7 @@ docker-edk2:
  - docker push $IMAGE_TAG
 
 build-edk2:
+ stage: build
  rules: # Only run this job when ...
  - changes: # ... roms/edk2/ is modified (submodule updated)
    - roms/edk2/*
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
index dd051c0124..62088ec5ec 100644
--- a/.gitlab-ci.d/opensbi.yml
+++ b/.gitlab-ci.d/opensbi.yml
@@ -1,8 +1,8 @@
 docker-opensbi:
- stage: build
+ stage: containers
  rules: # Only run this job when the Dockerfile is modified
  - changes:
-   - .gitlab-ci-opensbi.yml
+   - .gitlab-ci.d/opensbi.yml
    - .gitlab-ci.d/opensbi/Dockerfile
    when: always
  image: docker:19.03.1
@@ -24,6 +24,7 @@ docker-opensbi:
  - docker push $IMAGE_TAG
 
 build-opensbi:
+ stage: build
  rules: # Only run this job when ...
  - changes: # ... roms/opensbi/ is modified (submodule updated)
    - roms/opensbi/*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 349c77aa58..5eeba2791b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,127 +1,186 @@
+# Currently we have two build stages after our containers are built:
+#  - build (for traditional build and test or first stage build)
+#  - test (for test stages, using build artefacts from a build stage)
+stages:
+  - containers
+  - containers-layer2
+  - containers-layer3
+  - build
+  - test
+
+# We assume GitLab has it's own caching set up for RPM/APT repositories so we
+# just take care of avocado assets here.
+cache:
+  paths:
+    - $HOME/avocado/data/cache
+
 include:
   - local: '/.gitlab-ci.d/edk2.yml'
   - local: '/.gitlab-ci.d/opensbi.yml'
+  - local: '/.gitlab-ci.d/containers.yml'
+
+.native_build_job_template: &native_build_job_definition
+  stage: build
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  before_script:
+    - JOBS=$(expr $(nproc) + 1)
+  script:
+    - mkdir build
+    - cd build
+    - if test -n "$TARGETS";
+      then
+        ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
+      else
+        ../configure --enable-werror $CONFIGURE_ARGS ;
+      fi
+    - make -j"$JOBS"
+    - if test -n "$MAKE_CHECK_ARGS";
+      then
+        make -j"$JOBS" $MAKE_CHECK_ARGS ;
+      fi
+
+.native_test_job_template: &native_test_job_definition
+  stage: test
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  script:
+    - cd build
+    - find . -type f -exec touch {} +
+    - make $MAKE_CHECK_ARGS
+
+.post_acceptance_template: &post_acceptance
+  after_script:
+    - cd build
+    - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
+    - du -chs $HOME/avocado/data/cache
+
+build-system-ubuntu-main:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: ubuntu2004
+    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu
+      moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu
+      riscv64-softmmu sparc-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-ubuntu-main:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-ubuntu-main
+      artifacts: true
+  variables:
+    IMAGE: ubuntu2004
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-ubuntu-main:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-ubuntu-main
+      artifacts: true
+  variables:
+    IMAGE: ubuntu2004
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
+build-system-fedora-alt:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
+      riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu
+      xtensa-softmmu nios2-softmmu or1k-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-fedora-alt:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-fedora-alt
+      artifacts: true
+  variables:
+    IMAGE: fedora
+    MAKE_CHECK_ARGS: check
 
-.update_apt_template: &before_script_apt
- before_script:
-  - apt-get update -qq
-  - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make
-        genisoimage
-  - JOBS=$(expr $(nproc) + 1)
-
-.update_dnf_template: &before_script_dnf
- before_script:
-  - dnf update -y
-  - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel
-        make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel
-  - JOBS=$(expr $(nproc) + 1)
-
-build-system1:
- image: ubuntu:19.10
- <<: *before_script_apt
- script:
- - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev
-      libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev
- - mkdir build
- - cd build
- - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu
-      cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu
-      mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu"
- - make -j"$JOBS"
- - make -j"$JOBS" check
-
-build-system2:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel
-       libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel
-       libzstd-devel
- - mkdir build
- - cd build
- - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu
-      microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu
-      sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu"
- - make -j"$JOBS"
- - make -j"$JOBS" check
+acceptance-system-fedora-alt:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-fedora-alt
+      artifacts: true
+  variables:
+    IMAGE: fedora
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
 
 build-disabled:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - mkdir build
- - cd build
- - ../configure --enable-werror --disable-rdma --disable-slirp --disable-curl
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --disable-rdma --disable-slirp --disable-curl
       --disable-capstone --disable-live-block-migration --disable-glusterfs
       --disable-replication --disable-coroutine-pool --disable-smartcard
       --disable-guest-agent --disable-curses --disable-libxml2 --disable-tpm
       --disable-qom-cast-debug --disable-spice --disable-vhost-vsock
       --disable-vhost-net --disable-vhost-crypto --disable-vhost-user
-      --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user"
- - make -j"$JOBS"
- - make -j"$JOBS" check-qtest SPEED=slow
+    TARGETS: i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user
+    MAKE_CHECK_ARGS: check-qtest SPEED=slow
 
 build-tcg-disabled:
- image: centos:8
- <<: *before_script_dnf
- script:
- - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel
- - mkdir build
- - cd build
- - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
- - make -j"$JOBS"
- - make check-unit
- - make check-qapi-schema
- - cd tests/qemu-iotests/
- - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos8
+  script:
+    - mkdir build
+    - cd build
+    - ../configure --disable-tcg --audio-drv-list=""
+    - make -j"$JOBS"
+    - make check-unit
+    - make check-qapi-schema
+    - cd tests/qemu-iotests/
+    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
             052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
             170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
- - ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
+    - ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
             124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
             208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
             260 261 262 263 264 270 272 273 277 279
 
 build-user:
- <<: *before_script_apt
- script:
- - mkdir build
- - cd build
- - ../configure --enable-werror --disable-system --disable-guest-agent
-               --disable-capstone --disable-slirp --disable-fdt
- - make -j"$JOBS"
- - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: debian-all-test-cross
+    CONFIGURE_ARGS: --disable-tools --disable-system
+    MAKE_CHECK_ARGS: check-tcg
 
 build-clang:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel
-       libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel
- - mkdir build
- - cd build
- - ../configure --cc=clang --cxx=clang++ --enable-werror
-      --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
-                     ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
- - make -j"$JOBS"
- - make -j"$JOBS" check
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --cc=clang --cxx=clang++
+    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
+      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user
+    MAKE_CHECK_ARGS: check
 
 build-tci:
- image: centos:8
- <<: *before_script_dnf
- script:
- - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
- - mkdir build
- - cd build
- - ../configure --enable-tcg-interpreter
-      --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
- - make -j"$JOBS"
- - make run-tcg-tests-x86_64-softmmu
- - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
- - for tg in $TARGETS ; do
-     export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
-     ./tests/qtest/boot-serial-test || exit 1 ;
-     ./tests/qtest/cdrom-test || exit 1 ;
-   done
- - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
- - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x"
-   ./tests/qtest/pxe-test -m slow
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+  script:
+    - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
+    - mkdir build
+    - cd build
+    - ../configure --enable-tcg-interpreter
+        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
+    - make -j"$JOBS"
+    - make run-tcg-tests-x86_64-softmmu
+    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
+    - for tg in $TARGETS ; do
+        export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
+        ./tests/qtest/boot-serial-test || exit 1 ;
+        ./tests/qtest/cdrom-test || exit 1 ;
+      done
+    - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
+    - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x" ./tests/qtest/pxe-test -m slow
diff --git a/.shippable.yml b/.shippable.yml
index 2cce7b5689..f6b742432e 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -26,12 +26,10 @@ env:
     - IMAGE=debian-ppc64el-cross
       TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
 build:
-  pre_ci:
-    - make docker-image-${IMAGE} V=1
   pre_ci_boot:
-    image_name: qemu
-    image_tag: ${IMAGE}
-    pull: false
+    image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE}
+    image_tag: latest
+    pull: true
     options: "-e HOME=/root"
   ci:
     - unset CC
diff --git a/.travis.yml b/.travis.yml
index 74158f741b..ab429500fc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -289,29 +289,6 @@ jobs:
       python: 3.6
 
 
-    # Acceptance (Functional) tests
-    - name: "GCC check-acceptance"
-      dist: bionic
-      env:
-        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
-        - TEST_CMD="make check-acceptance"
-        - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance"
-      after_script:
-        - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
-        - du -chs $HOME/avocado/data/cache
-      addons:
-        apt:
-          packages:
-            - python3-pil
-            - python3-pip
-            - python3-numpy
-            - python3-opencv
-            - python3-venv
-            - rpm2cpio
-            - tesseract-ocr
-            - tesseract-ocr-eng
-
-
     # Using newer GCC with sanitizers
     - name: "GCC9 with sanitizers (softmmu)"
       addons:
@@ -505,6 +482,45 @@ jobs:
               $(exit $BUILD_RC);
           fi
 
+    - name: "[s390x] GCC (other-softmmu)"
+      arch: s390x
+      dist: bionic
+      addons:
+        apt_packages:
+          - libaio-dev
+          - libattr1-dev
+          - libcap-ng-dev
+          - libgnutls28-dev
+          - libiscsi-dev
+          - liblttng-ust-dev
+          - liblzo2-dev
+          - libncurses-dev
+          - libnfs-dev
+          - libnss3-dev
+          - libpixman-1-dev
+          - libsdl2-dev
+          - libsdl2-image-dev
+          - libseccomp-dev
+          - libsnappy-dev
+          - libzstd-dev
+          - nettle-dev
+          - xfslibs-dev
+          # Tests dependencies
+          - genisoimage
+      env:
+        - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
+                  --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+
+    - name: "[s390x] GCC (user)"
+      arch: s390x
+      dist: bionic
+      addons:
+        apt_packages:
+          - libgcrypt20-dev
+          - libgnutls28-dev
+      env:
+        - CONFIG="--disable-containers --disable-system"
+
     - name: "[s390x] Clang (disable-tcg)"
       arch: s390x
       dist: bionic
diff --git a/configure b/configure
index 31e2ddbf28..814ed81279 100755
--- a/configure
+++ b/configure
@@ -418,6 +418,7 @@ prefix="/usr/local"
 mandir="\${prefix}/share/man"
 datadir="\${prefix}/share"
 firmwarepath="\${prefix}/share/qemu-firmware"
+efi_aarch64=""
 qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
@@ -960,6 +961,13 @@ do
     fi
 done
 
+# Check for existence of python3 yaml, needed to
+# import yaml config files into vm-build.
+python_yaml="no"
+if $(python3 -c "import yaml" 2> /dev/null); then
+    python_yaml="yes"
+fi
+
 : ${smbd=${SMBD-/usr/sbin/smbd}}
 
 # Default objcc to clang if available, otherwise use CC
@@ -1102,6 +1110,8 @@ for opt do
   ;;
   --firmwarepath=*) firmwarepath="$optarg"
   ;;
+  --efi-aarch64=*) efi_aarch64="$optarg"
+  ;;
   --host=*|--build=*|\
   --disable-dependency-tracking|\
   --sbindir=*|--sharedstatedir=*|\
@@ -1784,6 +1794,7 @@ Advanced options (experts only):
   --sysconfdir=PATH        install config in PATH$confsuffix
   --localstatedir=PATH     install local state in PATH (set at runtime on win32)
   --firmwarepath=PATH      search PATH for firmware files
+  --efi-aarch64=PATH       PATH of efi file to use for aarch64 VMs.
   --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
   --with-pkgversion=VERS   use specified string as sub-version of the package
   --enable-debug           enable common debug build options
@@ -3620,6 +3631,20 @@ EOF
   fi
 fi
 
+############################################
+# efi-aarch64 probe
+# Check for efi files needed by aarch64 VMs.
+# By default we will use the efi included with QEMU.
+# Allow user to override the path for efi also.
+if ! test -f "$efi_aarch64"; then
+  if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then
+    # valid after build
+    efi_aarch64=$PWD/pc-bios/edk2-aarch64-code.fd
+  else
+    efi_aarch64=""
+  fi
+fi
+
 ##########################################
 # libcap-ng library probe
 if test "$cap_ng" != "no" ; then
@@ -6486,7 +6511,7 @@ EOF
 fi
 if test "$secret_keyring" != "no"
 then
-    if test "$have_keyring" == "yes"
+    if test "$have_keyring" = "yes"
     then
 	secret_keyring=yes
     else
@@ -6868,6 +6893,8 @@ if test "$docs" != "no"; then
     echo "sphinx-build      $sphinx_build"
 fi
 echo "genisoimage       $genisoimage"
+echo "efi_aarch64       $efi_aarch64"
+echo "python_yaml       $python_yaml"
 echo "slirp support     $slirp $(echo_version $slirp $slirp_version)"
 if test "$slirp" != "no" ; then
     echo "smbd              $smbd"
@@ -7966,6 +7993,8 @@ echo "PYTHON=$python" >> $config_host_mak
 echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
 echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
+echo "EFI_AARCH64=$efi_aarch64" >> $config_host_mak
+echo "PYTHON_YAML=$python_yaml" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "IASL=$iasl" >> $config_host_mak
diff --git a/docs/devel/index.rst b/docs/devel/index.rst
index bb8238c5d6..ae6eac7c9c 100644
--- a/docs/devel/index.rst
+++ b/docs/devel/index.rst
@@ -23,6 +23,8 @@ Contents:
    decodetree
    secure-coding-practices
    tcg
+   tcg-icount
+   multi-thread-tcg
    tcg-plugins
    bitops
    reset
diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst
new file mode 100644
index 0000000000..42158b77c7
--- /dev/null
+++ b/docs/devel/multi-thread-tcg.rst
@@ -0,0 +1,372 @@
+..
+  Copyright (c) 2015-2020 Linaro Ltd.
+
+  This work is licensed under the terms of the GNU GPL, version 2 or
+  later. See the COPYING file in the top-level directory.
+
+Introduction
+============
+
+This document outlines the design for multi-threaded TCG (a.k.a MTTCG)
+system-mode emulation. user-mode emulation has always mirrored the
+thread structure of the translated executable although some of the
+changes done for MTTCG system emulation have improved the stability of
+linux-user emulation.
+
+The original system-mode TCG implementation was single threaded and
+dealt with multiple CPUs with simple round-robin scheduling. This
+simplified a lot of things but became increasingly limited as systems
+being emulated gained additional cores and per-core performance gains
+for host systems started to level off.
+
+vCPU Scheduling
+===============
+
+We introduce a new running mode where each vCPU will run on its own
+user-space thread. This is enabled by default for all FE/BE
+combinations where the host memory model is able to accommodate the
+guest (TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO is zero) and the
+guest has had the required work done to support this safely
+(TARGET_SUPPORTS_MTTCG).
+
+System emulation will fall back to the original round robin approach
+if:
+
+* forced by --accel tcg,thread=single
+* enabling --icount mode
+* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST)
+
+In the general case of running translated code there should be no
+inter-vCPU dependencies and all vCPUs should be able to run at full
+speed. Synchronisation will only be required while accessing internal
+shared data structures or when the emulated architecture requires a
+coherent representation of the emulated machine state.
+
+Shared Data Structures
+======================
+
+Main Run Loop
+-------------
+
+Even when there is no code being generated there are a number of
+structures associated with the hot-path through the main run-loop.
+These are associated with looking up the next translation block to
+execute. These include:
+
+    tb_jmp_cache (per-vCPU, cache of recent jumps)
+    tb_ctx.htable (global hash table, phys address->tb lookup)
+
+As TB linking only occurs when blocks are in the same page this code
+is critical to performance as looking up the next TB to execute is the
+most common reason to exit the generated code.
+
+DESIGN REQUIREMENT: Make access to lookup structures safe with
+multiple reader/writer threads. Minimise any lock contention to do it.
+
+The hot-path avoids using locks where possible. The tb_jmp_cache is
+updated with atomic accesses to ensure consistent results. The fall
+back QHT based hash table is also designed for lockless lookups. Locks
+are only taken when code generation is required or TranslationBlocks
+have their block-to-block jumps patched.
+
+Global TCG State
+----------------
+
+User-mode emulation
+~~~~~~~~~~~~~~~~~~~
+
+We need to protect the entire code generation cycle including any post
+generation patching of the translated code. This also implies a shared
+translation buffer which contains code running on all cores. Any
+execution path that comes to the main run loop will need to hold a
+mutex for code generation. This also includes times when we need flush
+code or entries from any shared lookups/caches. Structures held on a
+per-vCPU basis won't need locking unless other vCPUs will need to
+modify them.
+
+DESIGN REQUIREMENT: Add locking around all code generation and TB
+patching.
+
+(Current solution)
+
+Code generation is serialised with mmap_lock().
+
+!User-mode emulation
+~~~~~~~~~~~~~~~~~~~~
+
+Each vCPU has its own TCG context and associated TCG region, thereby
+requiring no locking during translation.
+
+Translation Blocks
+------------------
+
+Currently the whole system shares a single code generation buffer
+which when full will force a flush of all translations and start from
+scratch again. Some operations also force a full flush of translations
+including:
+
+  - debugging operations (breakpoint insertion/removal)
+  - some CPU helper functions
+  - linux-user spawning it's first thread
+
+This is done with the async_safe_run_on_cpu() mechanism to ensure all
+vCPUs are quiescent when changes are being made to shared global
+structures.
+
+More granular translation invalidation events are typically due
+to a change of the state of a physical page:
+
+  - code modification (self modify code, patching code)
+  - page changes (new page mapping in linux-user mode)
+
+While setting the invalid flag in a TranslationBlock will stop it
+being used when looked up in the hot-path there are a number of other
+book-keeping structures that need to be safely cleared.
+
+Any TranslationBlocks which have been patched to jump directly to the
+now invalid blocks need the jump patches reversing so they will return
+to the C code.
+
+There are a number of look-up caches that need to be properly updated
+including the:
+
+  - jump lookup cache
+  - the physical-to-tb lookup hash table
+  - the global page table
+
+The global page table (l1_map) which provides a multi-level look-up
+for PageDesc structures which contain pointers to the start of a
+linked list of all Translation Blocks in that page (see page_next).
+
+Both the jump patching and the page cache involve linked lists that
+the invalidated TranslationBlock needs to be removed from.
+
+DESIGN REQUIREMENT: Safely handle invalidation of TBs
+                      - safely patch/revert direct jumps
+                      - remove central PageDesc lookup entries
+                      - ensure lookup caches/hashes are safely updated
+
+(Current solution)
+
+The direct jump themselves are updated atomically by the TCG
+tb_set_jmp_target() code. Modification to the linked lists that allow
+searching for linked pages are done under the protection of tb->jmp_lock,
+where tb is the destination block of a jump. Each origin block keeps a
+pointer to its destinations so that the appropriate lock can be acquired before
+iterating over a jump list.
+
+The global page table is a lockless radix tree; cmpxchg is used
+to atomically insert new elements.
+
+The lookup caches are updated atomically and the lookup hash uses QHT
+which is designed for concurrent safe lookup.
+
+Parallel code generation is supported. QHT is used at insertion time
+as the synchronization point across threads, thereby ensuring that we only
+keep track of a single TranslationBlock for each guest code block.
+
+Memory maps and TLBs
+--------------------
+
+The memory handling code is fairly critical to the speed of memory
+access in the emulated system. The SoftMMU code is designed so the
+hot-path can be handled entirely within translated code. This is
+handled with a per-vCPU TLB structure which once populated will allow
+a series of accesses to the page to occur without exiting the
+translated code. It is possible to set flags in the TLB address which
+will ensure the slow-path is taken for each access. This can be done
+to support:
+
+  - Memory regions (dividing up access to PIO, MMIO and RAM)
+  - Dirty page tracking (for code gen, SMC detection, migration and display)
+  - Virtual TLB (for translating guest address->real address)
+
+When the TLB tables are updated by a vCPU thread other than their own
+we need to ensure it is done in a safe way so no inconsistent state is
+seen by the vCPU thread.
+
+Some operations require updating a number of vCPUs TLBs at the same
+time in a synchronised manner.
+
+DESIGN REQUIREMENTS:
+
+  - TLB Flush All/Page
+    - can be across-vCPUs
+    - cross vCPU TLB flush may need other vCPU brought to halt
+    - change may need to be visible to the calling vCPU immediately
+  - TLB Flag Update
+    - usually cross-vCPU
+    - want change to be visible as soon as possible
+  - TLB Update (update a CPUTLBEntry, via tlb_set_page_with_attrs)
+    - This is a per-vCPU table - by definition can't race
+    - updated by its own thread when the slow-path is forced
+
+(Current solution)
+
+We have updated cputlb.c to defer operations when a cross-vCPU
+operation with async_run_on_cpu() which ensures each vCPU sees a
+coherent state when it next runs its work (in a few instructions
+time).
+
+A new set up operations (tlb_flush_*_all_cpus) take an additional flag
+which when set will force synchronisation by setting the source vCPUs
+work as "safe work" and exiting the cpu run loop. This ensure by the
+time execution restarts all flush operations have completed.
+
+TLB flag updates are all done atomically and are also protected by the
+corresponding page lock.
+
+(Known limitation)
+
+Not really a limitation but the wait mechanism is overly strict for
+some architectures which only need flushes completed by a barrier
+instruction. This could be a future optimisation.
+
+Emulated hardware state
+-----------------------
+
+Currently thanks to KVM work any access to IO memory is automatically
+protected by the global iothread mutex, also known as the BQL (Big
+Qemu Lock). Any IO region that doesn't use global mutex is expected to
+do its own locking.
+
+However IO memory isn't the only way emulated hardware state can be
+modified. Some architectures have model specific registers that
+trigger hardware emulation features. Generally any translation helper
+that needs to update more than a single vCPUs of state should take the
+BQL.
+
+As the BQL, or global iothread mutex is shared across the system we
+push the use of the lock as far down into the TCG code as possible to
+minimise contention.
+
+(Current solution)
+
+MMIO access automatically serialises hardware emulation by way of the
+BQL. Currently Arm targets serialise all ARM_CP_IO register accesses
+and also defer the reset/startup of vCPUs to the vCPU context by way
+of async_run_on_cpu().
+
+Updates to interrupt state are also protected by the BQL as they can
+often be cross vCPU.
+
+Memory Consistency
+==================
+
+Between emulated guests and host systems there are a range of memory
+consistency models. Even emulating weakly ordered systems on strongly
+ordered hosts needs to ensure things like store-after-load re-ordering
+can be prevented when the guest wants to.
+
+Memory Barriers
+---------------
+
+Barriers (sometimes known as fences) provide a mechanism for software
+to enforce a particular ordering of memory operations from the point
+of view of external observers (e.g. another processor core). They can
+apply to any memory operations as well as just loads or stores.
+
+The Linux kernel has an excellent `write-up
+<https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt>`
+on the various forms of memory barrier and the guarantees they can
+provide.
+
+Barriers are often wrapped around synchronisation primitives to
+provide explicit memory ordering semantics. However they can be used
+by themselves to provide safe lockless access by ensuring for example
+a change to a signal flag will only be visible once the changes to
+payload are.
+
+DESIGN REQUIREMENT: Add a new tcg_memory_barrier op
+
+This would enforce a strong load/store ordering so all loads/stores
+complete at the memory barrier. On single-core non-SMP strongly
+ordered backends this could become a NOP.
+
+Aside from explicit standalone memory barrier instructions there are
+also implicit memory ordering semantics which comes with each guest
+memory access instruction. For example all x86 load/stores come with
+fairly strong guarantees of sequential consistency whereas Arm has
+special variants of load/store instructions that imply acquire/release
+semantics.
+
+In the case of a strongly ordered guest architecture being emulated on
+a weakly ordered host the scope for a heavy performance impact is
+quite high.
+
+DESIGN REQUIREMENTS: Be efficient with use of memory barriers
+       - host systems with stronger implied guarantees can skip some barriers
+       - merge consecutive barriers to the strongest one
+
+(Current solution)
+
+The system currently has a tcg_gen_mb() which will add memory barrier
+operations if code generation is being done in a parallel context. The
+tcg_optimize() function attempts to merge barriers up to their
+strongest form before any load/store operations. The solution was
+originally developed and tested for linux-user based systems. All
+backends have been converted to emit fences when required. So far the
+following front-ends have been updated to emit fences when required:
+
+    - target-i386
+    - target-arm
+    - target-aarch64
+    - target-alpha
+    - target-mips
+
+Memory Control and Maintenance
+------------------------------
+
+This includes a class of instructions for controlling system cache
+behaviour. While QEMU doesn't model cache behaviour these instructions
+are often seen when code modification has taken place to ensure the
+changes take effect.
+
+Synchronisation Primitives
+--------------------------
+
+There are two broad types of synchronisation primitives found in
+modern ISAs: atomic instructions and exclusive regions.
+
+The first type offer a simple atomic instruction which will guarantee
+some sort of test and conditional store will be truly atomic w.r.t.
+other cores sharing access to the memory. The classic example is the
+x86 cmpxchg instruction.
+
+The second type offer a pair of load/store instructions which offer a
+guarantee that a region of memory has not been touched between the
+load and store instructions. An example of this is Arm's ldrex/strex
+pair where the strex instruction will return a flag indicating a
+successful store only if no other CPU has accessed the memory region
+since the ldrex.
+
+Traditionally TCG has generated a series of operations that work
+because they are within the context of a single translation block so
+will have completed before another CPU is scheduled. However with
+the ability to have multiple threads running to emulate multiple CPUs
+we will need to explicitly expose these semantics.
+
+DESIGN REQUIREMENTS:
+  - Support classic atomic instructions
+  - Support load/store exclusive (or load link/store conditional) pairs
+  - Generic enough infrastructure to support all guest architectures
+CURRENT OPEN QUESTIONS:
+  - How problematic is the ABA problem in general?
+
+(Current solution)
+
+The TCG provides a number of atomic helpers (tcg_gen_atomic_*) which
+can be used directly or combined to emulate other instructions like
+Arm's ldrex/strex instructions. While they are susceptible to the ABA
+problem so far common guests have not implemented patterns where
+this may be a problem - typically presenting a locking ABI which
+assumes cmpxchg like semantics.
+
+The code also includes a fall-back for cases where multi-threaded TCG
+ops can't work (e.g. guest atomic width > host atomic width). In this
+case an EXCP_ATOMIC exit occurs and the instruction is emulated with
+an exclusive lock which ensures all emulation is serialised.
+
+While the atomic helpers look good enough for now there may be a need
+to look at solutions that can more closely model the guest
+architectures semantics.
diff --git a/docs/devel/multi-thread-tcg.txt b/docs/devel/multi-thread-tcg.txt
deleted file mode 100644
index 3c85ac0eab..0000000000
--- a/docs/devel/multi-thread-tcg.txt
+++ /dev/null
@@ -1,358 +0,0 @@
-Copyright (c) 2015-2016 Linaro Ltd.
-
-This work is licensed under the terms of the GNU GPL, version 2 or
-later. See the COPYING file in the top-level directory.
-
-Introduction
-============
-
-This document outlines the design for multi-threaded TCG system-mode
-emulation. The current user-mode emulation mirrors the thread
-structure of the translated executable. Some of the work will be
-applicable to both system and linux-user emulation.
-
-The original system-mode TCG implementation was single threaded and
-dealt with multiple CPUs with simple round-robin scheduling. This
-simplified a lot of things but became increasingly limited as systems
-being emulated gained additional cores and per-core performance gains
-for host systems started to level off.
-
-vCPU Scheduling
-===============
-
-We introduce a new running mode where each vCPU will run on its own
-user-space thread. This will be enabled by default for all FE/BE
-combinations that have had the required work done to support this
-safely.
-
-In the general case of running translated code there should be no
-inter-vCPU dependencies and all vCPUs should be able to run at full
-speed. Synchronisation will only be required while accessing internal
-shared data structures or when the emulated architecture requires a
-coherent representation of the emulated machine state.
-
-Shared Data Structures
-======================
-
-Main Run Loop
--------------
-
-Even when there is no code being generated there are a number of
-structures associated with the hot-path through the main run-loop.
-These are associated with looking up the next translation block to
-execute. These include:
-
-    tb_jmp_cache (per-vCPU, cache of recent jumps)
-    tb_ctx.htable (global hash table, phys address->tb lookup)
-
-As TB linking only occurs when blocks are in the same page this code
-is critical to performance as looking up the next TB to execute is the
-most common reason to exit the generated code.
-
-DESIGN REQUIREMENT: Make access to lookup structures safe with
-multiple reader/writer threads. Minimise any lock contention to do it.
-
-The hot-path avoids using locks where possible. The tb_jmp_cache is
-updated with atomic accesses to ensure consistent results. The fall
-back QHT based hash table is also designed for lockless lookups. Locks
-are only taken when code generation is required or TranslationBlocks
-have their block-to-block jumps patched.
-
-Global TCG State
-----------------
-
-### User-mode emulation
-We need to protect the entire code generation cycle including any post
-generation patching of the translated code. This also implies a shared
-translation buffer which contains code running on all cores. Any
-execution path that comes to the main run loop will need to hold a
-mutex for code generation. This also includes times when we need flush
-code or entries from any shared lookups/caches. Structures held on a
-per-vCPU basis won't need locking unless other vCPUs will need to
-modify them.
-
-DESIGN REQUIREMENT: Add locking around all code generation and TB
-patching.
-
-(Current solution)
-
-Code generation is serialised with mmap_lock().
-
-### !User-mode emulation
-Each vCPU has its own TCG context and associated TCG region, thereby
-requiring no locking.
-
-Translation Blocks
-------------------
-
-Currently the whole system shares a single code generation buffer
-which when full will force a flush of all translations and start from
-scratch again. Some operations also force a full flush of translations
-including:
-
-  - debugging operations (breakpoint insertion/removal)
-  - some CPU helper functions
-
-This is done with the async_safe_run_on_cpu() mechanism to ensure all
-vCPUs are quiescent when changes are being made to shared global
-structures.
-
-More granular translation invalidation events are typically due
-to a change of the state of a physical page:
-
-  - code modification (self modify code, patching code)
-  - page changes (new page mapping in linux-user mode)
-
-While setting the invalid flag in a TranslationBlock will stop it
-being used when looked up in the hot-path there are a number of other
-book-keeping structures that need to be safely cleared.
-
-Any TranslationBlocks which have been patched to jump directly to the
-now invalid blocks need the jump patches reversing so they will return
-to the C code.
-
-There are a number of look-up caches that need to be properly updated
-including the:
-
-  - jump lookup cache
-  - the physical-to-tb lookup hash table
-  - the global page table
-
-The global page table (l1_map) which provides a multi-level look-up
-for PageDesc structures which contain pointers to the start of a
-linked list of all Translation Blocks in that page (see page_next).
-
-Both the jump patching and the page cache involve linked lists that
-the invalidated TranslationBlock needs to be removed from.
-
-DESIGN REQUIREMENT: Safely handle invalidation of TBs
-                      - safely patch/revert direct jumps
-                      - remove central PageDesc lookup entries
-                      - ensure lookup caches/hashes are safely updated
-
-(Current solution)
-
-The direct jump themselves are updated atomically by the TCG
-tb_set_jmp_target() code. Modification to the linked lists that allow
-searching for linked pages are done under the protection of tb->jmp_lock,
-where tb is the destination block of a jump. Each origin block keeps a
-pointer to its destinations so that the appropriate lock can be acquired before
-iterating over a jump list.
-
-The global page table is a lockless radix tree; cmpxchg is used
-to atomically insert new elements.
-
-The lookup caches are updated atomically and the lookup hash uses QHT
-which is designed for concurrent safe lookup.
-
-Parallel code generation is supported. QHT is used at insertion time
-as the synchronization point across threads, thereby ensuring that we only
-keep track of a single TranslationBlock for each guest code block.
-
-Memory maps and TLBs
---------------------
-
-The memory handling code is fairly critical to the speed of memory
-access in the emulated system. The SoftMMU code is designed so the
-hot-path can be handled entirely within translated code. This is
-handled with a per-vCPU TLB structure which once populated will allow
-a series of accesses to the page to occur without exiting the
-translated code. It is possible to set flags in the TLB address which
-will ensure the slow-path is taken for each access. This can be done
-to support:
-
-  - Memory regions (dividing up access to PIO, MMIO and RAM)
-  - Dirty page tracking (for code gen, SMC detection, migration and display)
-  - Virtual TLB (for translating guest address->real address)
-
-When the TLB tables are updated by a vCPU thread other than their own
-we need to ensure it is done in a safe way so no inconsistent state is
-seen by the vCPU thread.
-
-Some operations require updating a number of vCPUs TLBs at the same
-time in a synchronised manner.
-
-DESIGN REQUIREMENTS:
-
-  - TLB Flush All/Page
-    - can be across-vCPUs
-    - cross vCPU TLB flush may need other vCPU brought to halt
-    - change may need to be visible to the calling vCPU immediately
-  - TLB Flag Update
-    - usually cross-vCPU
-    - want change to be visible as soon as possible
-  - TLB Update (update a CPUTLBEntry, via tlb_set_page_with_attrs)
-    - This is a per-vCPU table - by definition can't race
-    - updated by its own thread when the slow-path is forced
-
-(Current solution)
-
-We have updated cputlb.c to defer operations when a cross-vCPU
-operation with async_run_on_cpu() which ensures each vCPU sees a
-coherent state when it next runs its work (in a few instructions
-time).
-
-A new set up operations (tlb_flush_*_all_cpus) take an additional flag
-which when set will force synchronisation by setting the source vCPUs
-work as "safe work" and exiting the cpu run loop. This ensure by the
-time execution restarts all flush operations have completed.
-
-TLB flag updates are all done atomically and are also protected by the
-corresponding page lock.
-
-(Known limitation)
-
-Not really a limitation but the wait mechanism is overly strict for
-some architectures which only need flushes completed by a barrier
-instruction. This could be a future optimisation.
-
-Emulated hardware state
------------------------
-
-Currently thanks to KVM work any access to IO memory is automatically
-protected by the global iothread mutex, also known as the BQL (Big
-Qemu Lock). Any IO region that doesn't use global mutex is expected to
-do its own locking.
-
-However IO memory isn't the only way emulated hardware state can be
-modified. Some architectures have model specific registers that
-trigger hardware emulation features. Generally any translation helper
-that needs to update more than a single vCPUs of state should take the
-BQL.
-
-As the BQL, or global iothread mutex is shared across the system we
-push the use of the lock as far down into the TCG code as possible to
-minimise contention.
-
-(Current solution)
-
-MMIO access automatically serialises hardware emulation by way of the
-BQL. Currently Arm targets serialise all ARM_CP_IO register accesses
-and also defer the reset/startup of vCPUs to the vCPU context by way
-of async_run_on_cpu().
-
-Updates to interrupt state are also protected by the BQL as they can
-often be cross vCPU.
-
-Memory Consistency
-==================
-
-Between emulated guests and host systems there are a range of memory
-consistency models. Even emulating weakly ordered systems on strongly
-ordered hosts needs to ensure things like store-after-load re-ordering
-can be prevented when the guest wants to.
-
-Memory Barriers
----------------
-
-Barriers (sometimes known as fences) provide a mechanism for software
-to enforce a particular ordering of memory operations from the point
-of view of external observers (e.g. another processor core). They can
-apply to any memory operations as well as just loads or stores.
-
-The Linux kernel has an excellent write-up on the various forms of
-memory barrier and the guarantees they can provide [1].
-
-Barriers are often wrapped around synchronisation primitives to
-provide explicit memory ordering semantics. However they can be used
-by themselves to provide safe lockless access by ensuring for example
-a change to a signal flag will only be visible once the changes to
-payload are.
-
-DESIGN REQUIREMENT: Add a new tcg_memory_barrier op
-
-This would enforce a strong load/store ordering so all loads/stores
-complete at the memory barrier. On single-core non-SMP strongly
-ordered backends this could become a NOP.
-
-Aside from explicit standalone memory barrier instructions there are
-also implicit memory ordering semantics which comes with each guest
-memory access instruction. For example all x86 load/stores come with
-fairly strong guarantees of sequential consistency whereas Arm has
-special variants of load/store instructions that imply acquire/release
-semantics.
-
-In the case of a strongly ordered guest architecture being emulated on
-a weakly ordered host the scope for a heavy performance impact is
-quite high.
-
-DESIGN REQUIREMENTS: Be efficient with use of memory barriers
-       - host systems with stronger implied guarantees can skip some barriers
-       - merge consecutive barriers to the strongest one
-
-(Current solution)
-
-The system currently has a tcg_gen_mb() which will add memory barrier
-operations if code generation is being done in a parallel context. The
-tcg_optimize() function attempts to merge barriers up to their
-strongest form before any load/store operations. The solution was
-originally developed and tested for linux-user based systems. All
-backends have been converted to emit fences when required. So far the
-following front-ends have been updated to emit fences when required:
-
-    - target-i386
-    - target-arm
-    - target-aarch64
-    - target-alpha
-    - target-mips
-
-Memory Control and Maintenance
-------------------------------
-
-This includes a class of instructions for controlling system cache
-behaviour. While QEMU doesn't model cache behaviour these instructions
-are often seen when code modification has taken place to ensure the
-changes take effect.
-
-Synchronisation Primitives
---------------------------
-
-There are two broad types of synchronisation primitives found in
-modern ISAs: atomic instructions and exclusive regions.
-
-The first type offer a simple atomic instruction which will guarantee
-some sort of test and conditional store will be truly atomic w.r.t.
-other cores sharing access to the memory. The classic example is the
-x86 cmpxchg instruction.
-
-The second type offer a pair of load/store instructions which offer a
-guarantee that a region of memory has not been touched between the
-load and store instructions. An example of this is Arm's ldrex/strex
-pair where the strex instruction will return a flag indicating a
-successful store only if no other CPU has accessed the memory region
-since the ldrex.
-
-Traditionally TCG has generated a series of operations that work
-because they are within the context of a single translation block so
-will have completed before another CPU is scheduled. However with
-the ability to have multiple threads running to emulate multiple CPUs
-we will need to explicitly expose these semantics.
-
-DESIGN REQUIREMENTS:
-  - Support classic atomic instructions
-  - Support load/store exclusive (or load link/store conditional) pairs
-  - Generic enough infrastructure to support all guest architectures
-CURRENT OPEN QUESTIONS:
-  - How problematic is the ABA problem in general?
-
-(Current solution)
-
-The TCG provides a number of atomic helpers (tcg_gen_atomic_*) which
-can be used directly or combined to emulate other instructions like
-Arm's ldrex/strex instructions. While they are susceptible to the ABA
-problem so far common guests have not implemented patterns where
-this may be a problem - typically presenting a locking ABI which
-assumes cmpxchg like semantics.
-
-The code also includes a fall-back for cases where multi-threaded TCG
-ops can't work (e.g. guest atomic width > host atomic width). In this
-case an EXCP_ATOMIC exit occurs and the instruction is emulated with
-an exclusive lock which ensures all emulation is serialised.
-
-While the atomic helpers look good enough for now there may be a need
-to look at solutions that can more closely model the guest
-architectures semantics.
-
-==========
-
-[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt
diff --git a/docs/devel/tcg-icount.rst b/docs/devel/tcg-icount.rst
new file mode 100644
index 0000000000..8d67b6c076
--- /dev/null
+++ b/docs/devel/tcg-icount.rst
@@ -0,0 +1,97 @@
+..
+   Copyright (c) 2020, Linaro Limited
+   Written by Alex Bennée
+
+
+========================
+TCG Instruction Counting
+========================
+
+TCG has long supported a feature known as icount which allows for
+instruction counting during execution. This should not be confused
+with cycle accurate emulation - QEMU does not attempt to emulate how
+long an instruction would take on real hardware. That is a job for
+other more detailed (and slower) tools that simulate the rest of a
+micro-architecture.
+
+This feature is only available for system emulation and is
+incompatible with multi-threaded TCG. It can be used to better align
+execution time with wall-clock time so a "slow" device doesn't run too
+fast on modern hardware. It can also provides for a degree of
+deterministic execution and is an essential part of the record/replay
+support in QEMU.
+
+Core Concepts
+=============
+
+At its heart icount is simply a count of executed instructions which
+is stored in the TimersState of QEMU's timer sub-system. The number of
+executed instructions can then be used to calculate QEMU_CLOCK_VIRTUAL
+which represents the amount of elapsed time in the system since
+execution started. Depending on the icount mode this may either be a
+fixed number of ns per instruction or adjusted as execution continues
+to keep wall clock time and virtual time in sync.
+
+To be able to calculate the number of executed instructions the
+translator starts by allocating a budget of instructions to be
+executed. The budget of instructions is limited by how long it will be
+until the next timer will expire. We store this budget as part of a
+vCPU icount_decr field which shared with the machinery for handling
+cpu_exit(). The whole field is checked at the start of every
+translated block and will cause a return to the outer loop to deal
+with whatever caused the exit.
+
+In the case of icount, before the flag is checked we subtract the
+number of instructions the translation block would execute. If this
+would cause the instruction budget to go negative we exit the main
+loop and regenerate a new translation block with exactly the right
+number of instructions to take the budget to 0 meaning whatever timer
+was due to expire will expire exactly when we exit the main run loop.
+
+Dealing with MMIO
+-----------------
+
+While we can adjust the instruction budget for known events like timer
+expiry we cannot do the same for MMIO. Every load/store we execute
+might potentially trigger an I/O event, at which point we will need an
+up to date and accurate reading of the icount number.
+
+To deal with this case, when an I/O access is made we:
+
+  - restore un-executed instructions to the icount budget
+  - re-compile a single [1]_ instruction block for the current PC
+  - exit the cpu loop and execute the re-compiled block
+
+The new block is created with the CF_LAST_IO compile flag which
+ensures the final instruction translation starts with a call to
+gen_io_start() so we don't enter a perpetual loop constantly
+recompiling a single instruction block. For translators using the
+common translator_loop this is done automatically.
+  
+.. [1] sometimes two instructions if dealing with delay slots  
+
+Other I/O operations
+--------------------
+
+MMIO isn't the only type of operation for which we might need a
+correct and accurate clock. IO port instructions and accesses to
+system registers are the common examples here. These instructions have
+to be handled by the individual translators which have the knowledge
+of which operations are I/O operations.
+
+When the translator is handling an instruction of this kind:
+
+* it must call gen_io_start() if icount is enabled, at some
+   point before the generation of the code which actually does
+   the I/O, using a code fragment similar to:
+
+.. code:: c
+
+    if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) {
+        gen_io_start();
+    }
+
+* it must end the TB immediately after this instruction
+
+Note that some older front-ends call a "gen_io_end()" function:
+this is obsolete and should not be used.
diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index a40145fcf8..abda961e2b 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -87,3 +87,23 @@ three commands you can query and set the single step behavior:
       (gdb) maintenance packet Qqemu.sstep=0x5
       sending: "qemu.sstep=0x5"
       received: "OK"
+
+
+Another feature that QEMU gdbstub provides is to toggle the memory GDB
+works with, by default GDB will show the current process memory respecting
+the virtual address translation.
+
+If you want to examine/change the physical memory you can set the gdbstub
+to work with the physical memory rather with the virtual one.
+
+The memory mode can be checked by sending the following command:
+
+``maintenance packet qqemu.PhyMemMode``
+    This will return either 0 or 1, 1 indicates you are currently in the
+    physical memory mode.
+
+``maintenance packet Qqemu.PhyMemMode:1``
+    This will change the memory mode to physical memory.
+
+``maintenance packet Qqemu.PhyMemMode:0``
+    This will change it back to normal memory mode.
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index e907f3182b..d619594ad4 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -49,19 +49,16 @@ common-obj-m += qxl.mo
 qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o
 endif
 
-ifeq ($(CONFIG_VIRTIO_GPU),y)
-common-obj-m += virtio-gpu.mo
-virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
-virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
-virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
-virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
-virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
-virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
-virtio-gpu.mo-objs := $(virtio-gpu-obj-y)
-virtio-gpu.mo-cflags := $(VIRGL_CFLAGS)
-virtio-gpu.mo-libs := $(VIRGL_LIBS)
-endif
-
+common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
+common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
+common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
+common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
+common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
+common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
+virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
+virtio-gpu.o-libs += $(VIRGL_LIBS)
+virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
+virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
 common-obj-$(CONFIG_DPCD) += dpcd.o
 common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
 
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index b5cb21384a..7e7f642332 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2294,7 +2294,7 @@ static void pgb_dynamic(const char *image_name, long align)
 static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
                             abi_ulong guest_hiaddr, long align)
 {
-    const int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
+    int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
     void *addr, *test;
 
     if (guest_hiaddr > reserved_va) {
@@ -2307,15 +2307,19 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
     /* Widen the "image" to the entire reserved address space. */
     pgb_static(image_name, 0, reserved_va, align);
 
+#ifdef MAP_FIXED_NOREPLACE
+    flags |= MAP_FIXED_NOREPLACE;
+#endif
+
     /* Reserve the memory on the host. */
     assert(guest_base != 0);
     test = g2h(0);
     addr = mmap(test, reserved_va, PROT_NONE, flags, -1, 0);
     if (addr == MAP_FAILED) {
         error_report("Unable to reserve 0x%lx bytes of virtual address "
-                     "space for use as guest address space (check your "
+                     "space (%s) for use as guest address space (check your "
                      "virtual memory ulimit setting or reserve less "
-                     "using -R option)", reserved_va);
+                     "using -R option)", reserved_va, strerror(errno));
         exit(EXIT_FAILURE);
     }
     assert(addr == test);
diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
new file mode 100644
index 0000000000..830cb7c628
--- /dev/null
+++ b/python/qemu/console_socket.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python3
+#
+# This python module implements a ConsoleSocket object which is
+# designed always drain the socket itself, and place
+# the bytes into a in memory buffer for later processing.
+#
+# Optionally a file path can be passed in and we will also
+# dump the characters to this file for debug.
+#
+# Copyright 2020 Linaro
+#
+# Authors:
+#  Robert Foley <robert.foley@linaro.org>
+#
+# This code is licensed under the GPL version 2 or later.  See
+# the COPYING file in the top-level directory.
+#
+import asyncore
+import socket
+import threading
+import io
+import os
+import sys
+from collections import deque
+import time
+import traceback
+
+class ConsoleSocket(asyncore.dispatcher):
+
+    def __init__(self, address, file=None):
+        self._recv_timeout_sec = 300
+        self._buffer = deque()
+        self._asyncore_thread = None
+        self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        self._sock.connect(address)
+        self._logfile = None
+        if file:
+            self._logfile = open(file, "w")
+        asyncore.dispatcher.__init__(self, sock=self._sock)
+        self._open = True
+        self._thread_start()
+
+    def _thread_start(self):
+        """Kick off a thread to wait on the asyncore.loop"""
+        if self._asyncore_thread is not None:
+            return
+        self._asyncore_thread = threading.Thread(target=asyncore.loop,
+                                                 kwargs={'timeout':1})
+        self._asyncore_thread.daemon = True
+        self._asyncore_thread.start()
+
+    def handle_close(self):
+        """redirect close to base class"""
+        # Call the base class close, but not self.close() since
+        # handle_close() occurs in the context of the thread which
+        # self.close() attempts to join.
+        asyncore.dispatcher.close(self)
+
+    def close(self):
+        """Close the base object and wait for the thread to terminate"""
+        if self._open:
+            self._open = False
+            asyncore.dispatcher.close(self)
+            if self._asyncore_thread is not None:
+                thread, self._asyncore_thread = self._asyncore_thread, None
+                thread.join()
+            if self._logfile:
+                self._logfile.close()
+                self._logfile = None
+
+    def handle_read(self):
+        """process arriving characters into in memory _buffer"""
+        try:
+            data = asyncore.dispatcher.recv(self, 1)
+            # latin1 is needed since there are some chars
+            # we are receiving that cannot be encoded to utf-8
+            # such as 0xe2, 0x80, 0xA6.
+            string = data.decode("latin1")
+        except:
+            print("Exception seen.")
+            traceback.print_exc()
+            return
+        if self._logfile:
+            self._logfile.write("{}".format(string))
+            self._logfile.flush()
+        for c in string:
+            self._buffer.extend(c)
+
+    def recv(self, n=1, sleep_delay_s=0.1):
+        """Return chars from in memory buffer"""
+        start_time = time.time()
+        while len(self._buffer) < n:
+            time.sleep(sleep_delay_s)
+            elapsed_sec = time.time() - start_time
+            if elapsed_sec > self._recv_timeout_sec:
+                raise socket.timeout
+        chars = ''.join([self._buffer.popleft() for i in range(n)])
+        # We choose to use latin1 to remain consistent with
+        # handle_read() and give back the same data as the user would
+        # receive if they were reading directly from the
+        # socket w/o our intervention.
+        return chars.encode("latin1")
+
+    def set_blocking(self):
+        """Maintain compatibility with socket API"""
+        pass
+
+    def settimeout(self, seconds):
+        """Set current timeout on recv"""
+        self._recv_timeout_sec = seconds
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 041c615052..c25f0b42cf 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -26,6 +26,7 @@ import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
+from qemu.console_socket import ConsoleSocket
 
 from . import qmp
 
@@ -75,7 +76,8 @@ class QEMUMachine:
 
     def __init__(self, binary, args=None, wrapper=None, name=None,
                  test_dir="/var/tmp", monitor_address=None,
-                 socket_scm_helper=None, sock_dir=None):
+                 socket_scm_helper=None, sock_dir=None,
+                 drain_console=False, console_log=None):
         '''
         Initialize a QEMUMachine
 
@@ -86,6 +88,9 @@ class QEMUMachine:
         @param test_dir: where to create socket and log file
         @param monitor_address: address for QMP monitor
         @param socket_scm_helper: helper program, required for send_fd_scm()
+        @param sock_dir: where to create socket (overrides test_dir for sock)
+        @param console_log: (optional) path to console log file
+        @param drain_console: (optional) True to drain console socket to buffer
         @note: Qemu process is not started until launch() is used.
         '''
         if args is None:
@@ -122,6 +127,12 @@ class QEMUMachine:
         self._console_address = None
         self._console_socket = None
         self._remove_files = []
+        self._console_log_path = console_log
+        if self._console_log_path:
+            # In order to log the console, buffering needs to be enabled.
+            self._drain_console = True
+        else:
+            self._drain_console = drain_console
 
     def __enter__(self):
         return self
@@ -580,7 +591,11 @@ class QEMUMachine:
         Returns a socket connected to the console
         """
         if self._console_socket is None:
-            self._console_socket = socket.socket(socket.AF_UNIX,
-                                                 socket.SOCK_STREAM)
-            self._console_socket.connect(self._console_address)
+            if self._drain_console:
+                self._console_socket = ConsoleSocket(self._console_address,
+                                                    file=self._console_log_path)
+            else:
+                self._console_socket = socket.socket(socket.AF_UNIX,
+                                                     socket.SOCK_STREAM)
+                self._console_socket.connect(self._console_address)
         return self._console_socket
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 09df2d3f86..c7e4646ded 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -22,6 +22,8 @@ endif
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
 	@echo " $(MAKE) check-clean          Clean the tests and related data"
 	@echo
+	@echo "The following are useful for CI builds"
+	@echo " $(MAKE) check-build          Build most test binaris"
 	@echo " $(MAKE) get-vm-images        Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
 	@echo
 	@echo
@@ -649,6 +651,10 @@ $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(c
 	  QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
 	  QTEST_QEMU_IMG=qemu-img$(EXESUF))
 
+build-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y)
+
+build-unit: $(check-unit-y)
+
 check-unit: $(check-unit-y)
 	$(call do_test_human, $^)
 
@@ -680,7 +686,6 @@ check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check
 FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
 
 # the build dir is created by configure
-.PHONY: $(FP_TEST_BIN)
 $(FP_TEST_BIN): config-host.h $(test-util-obj-y)
 	$(call quiet-command, \
 	 	$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
@@ -814,9 +819,10 @@ check-softfloat-ops: $(SF_MATH_RULES)
 
 .PHONY: check-softfloat
 ifeq ($(CONFIG_TCG),y)
-check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
+build-softfloat: $(FP_TEST_BIN)
+check-softfloat: build-softfloat check-softfloat-conv check-softfloat-compare check-softfloat-ops
 else
-check-softfloat:
+build-softfloat check-softfloat:
 	$(call quiet-command, /bin/true, "FLOAT TEST", \
 		"SKIPPED for non-TCG builds")
 endif
@@ -944,7 +950,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
             --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
             --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
             $(AVOCADO_TAGS) \
-            --failfast=on tests/acceptance, \
+            $(if $(GITLAB_CI),,--failfast=on) tests/acceptance, \
             "AVOCADO", "tests/acceptance")
 
 # Consolidated targets
@@ -955,7 +961,8 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 ifeq ($(CONFIG_TOOLS),y)
 check-block: $(patsubst %,check-%, $(check-block-y))
 endif
-check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
+check-build: build-unit build-softfloat build-qtest
+
 check-clean:
 	rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
 	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
@@ -963,6 +970,8 @@ check-clean:
 	rm -f tests/qtest/dbus-vmstate1-gen-timestamp
 	rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
 
+check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
+
 clean: check-clean
 
 # Build the help program automatically
diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
index 3aa57e88b0..0055dc7cee 100644
--- a/tests/acceptance/boot_linux.py
+++ b/tests/acceptance/boot_linux.py
@@ -20,6 +20,7 @@ from avocado.utils import network
 from avocado.utils import vmimage
 from avocado.utils import datadrainer
 from avocado.utils.path import find_command
+from avocado import skipIf
 
 ACCEL_NOT_AVAILABLE_FMT = "%s accelerator does not seem to be available"
 KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
@@ -220,6 +221,7 @@ class BootLinuxS390X(BootLinux):
 
     chksum = '4caaab5a434fd4d1079149a072fdc7891e354f834d355069ca982fdcaf5a122d'
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_s390_ccw_virtio_tcg(self):
         """
         :avocado: tags=machine:s390-ccw-virtio
diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
index a3e54d3fc9..a249e2f14a 100644
--- a/tests/acceptance/linux_initrd.py
+++ b/tests/acceptance/linux_initrd.py
@@ -8,10 +8,12 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
+import os
 import logging
 import tempfile
 
 from avocado_qemu import Test
+from avocado import skipIf
 
 
 class LinuxInitrd(Test):
@@ -51,6 +53,7 @@ class LinuxInitrd(Test):
                 max_size + 1)
             self.assertRegex(self.vm.get_log(), expected_msg)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_with_2gib_file_should_work_with_linux_v4_16(self):
         """
         QEMU has supported up to 4 GiB initrd for recent kernel
diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py
index 92b4f28a11..7c9a4ee4d2 100644
--- a/tests/acceptance/machine_mips_malta.py
+++ b/tests/acceptance/machine_mips_malta.py
@@ -15,6 +15,7 @@ from avocado import skipUnless
 from avocado_qemu import Test
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
+from avocado import skipIf
 
 
 NUMPY_AVAILABLE = True
@@ -99,6 +100,7 @@ class MaltaMachineFramebuffer(Test):
         """
         self.do_test_i6400_framebuffer_logo(1)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         :avocado: tags=arch:mips64el
@@ -108,6 +110,7 @@ class MaltaMachineFramebuffer(Test):
         """
         self.do_test_i6400_framebuffer_logo(7)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         """
         :avocado: tags=arch:mips64el
diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machine_rx_gdbsim.py
index a44f2c87da..bff63e421d 100644
--- a/tests/acceptance/machine_rx_gdbsim.py
+++ b/tests/acceptance/machine_rx_gdbsim.py
@@ -50,7 +50,7 @@ class RxGdbSimMachine(Test):
         :avocado: tags=machine:gdbsim-r5f562n7
         :avocado: tags=endian:little
         """
-        dtb_url = ('https://acc.dl.osdn.jp/users/23/23887/rx-qemu.dtb')
+        dtb_url = ('https://acc.dl.osdn.jp/users/23/23887/rx-virt.dtb')
         dtb_hash = '7b4e4e2c71905da44e86ce47adee2210b026ac18'
         dtb_path = self.fetch_asset(dtb_url, asset_hash=dtb_hash)
         kernel_url = ('http://acc.dl.osdn.jp/users/23/23845/zImage')
diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py
index 60621417dd..62d2db8c64 100644
--- a/tests/acceptance/replay_kernel.py
+++ b/tests/acceptance/replay_kernel.py
@@ -73,7 +73,7 @@ class ReplayKernel(LinuxKernelTest):
         logger = logging.getLogger('replay')
         logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1))
 
-    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_x86_64_pc(self):
         """
         :avocado: tags=arch:x86_64
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 3e3617816e..a104e9df28 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -13,6 +13,7 @@ DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.doc
 DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
 # Use a global constant ccache directory to speed up repetitive builds
 DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache
+DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),registry.gitlab.com/qemu-project/qemu)
 
 DOCKER_TESTS := $(notdir $(shell \
 	find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
@@ -50,13 +51,15 @@ docker-image: ${DOCKER_TARGETS}
 ifdef SKIP_DOCKER_BUILD
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 	$(call quiet-command, \
-		$(DOCKER_SCRIPT) check --quiet qemu:$* $<, \
+		$(DOCKER_SCRIPT) check --quiet qemu/$* $<, \
 		"CHECK", "$*")
 else
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 	$(call quiet-command,\
-		$(DOCKER_SCRIPT) build -t qemu:$* -f $< \
-		$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
+		$(DOCKER_SCRIPT) build -t qemu/$* -f $< \
+		$(if $V,,--quiet) \
+		$(if $(NOCACHE),--no-cache, \
+			$(if $(DOCKER_REGISTRY),--registry $(DOCKER_REGISTRY))) \
 		$(if $(NOUSER),,--add-current-user) \
 		$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
 		$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\
@@ -75,14 +78,14 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
 			DEB_ARCH=$(DEB_ARCH)					\
 			DEB_TYPE=$(DEB_TYPE) 					\
 			$(if $(DEB_URL),DEB_URL=$(DEB_URL),)			\
-			$(DOCKER_SCRIPT) build qemu:debian-$* $< 		\
+			$(DOCKER_SCRIPT) build qemu/debian-$* $< 		\
 			$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) 		\
 			$(if $(NOUSER),,--add-current-user) 			\
 			$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))	\
 			$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \
 			"BUILD","binfmt debian-$* (debootstrapped)"),		\
 		$(call quiet-command,						\
-			$(DOCKER_SCRIPT) check --quiet qemu:debian-$* $< || 	\
+			$(DOCKER_SCRIPT) check --quiet qemu/debian-$* $< || 	\
 			{ echo "You will need to build $(EXECUTABLE)"; exit 1;},\
 			"CHECK", "debian-$* exists"))
 
@@ -131,6 +134,7 @@ docker-image-travis: NOUSER=1
 
 # Specialist build images, sometimes very limited tools
 docker-image-debian-tricore-cross: docker-image-debian9
+docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
 
 # These images may be good enough for building tests but not for test builds
@@ -213,6 +217,7 @@ endif
 	@echo '                         Include extra files in image.'
 	@echo '    ENGINE=auto/docker/podman'
 	@echo '                         Specify which container engine to run.'
+	@echo '    REGISTRY=url         Cache builds from registry (default:$(DOCKER_REGISTRY))'
 
 # This rule if for directly running against an arbitrary docker target.
 # It is called by the expanded docker targets (e.g. make
@@ -258,7 +263,7 @@ docker-run: docker-qemu-src
 docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
 docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
 docker-run-%:
-	@$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
+	@$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu/$(IMAGE)
 
 docker-clean:
 	$(call quiet-command, $(DOCKER_SCRIPT) clean)
diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index 02cd67a8c5..ebc5b97ecf 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -47,7 +47,7 @@ build_qemu()
 check_qemu()
 {
     # default to make check unless the caller specifies
-    if test -z "$@"; then
+    if [ $# = 0 ]; then
         INVOCATION="check"
     else
         INVOCATION="$@"
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index e630aae108..2d67bbd15a 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -204,7 +204,7 @@ def _dockerfile_preprocess(df):
     for l in df.splitlines():
         if len(l.strip()) == 0 or l.startswith("#"):
             continue
-        from_pref = "FROM qemu:"
+        from_pref = "FROM qemu/"
         if l.startswith(from_pref):
             # TODO: Alternatively we could replace this line with "FROM $ID"
             # where $ID is the image's hex id obtained with
@@ -221,6 +221,13 @@ class Docker(object):
     """ Running Docker commands """
     def __init__(self):
         self._command = _guess_engine_command()
+
+        if "docker" in self._command and "TRAVIS" not in os.environ:
+            os.environ["DOCKER_BUILDKIT"] = "1"
+            self._buildkit = True
+        else:
+            self._buildkit = False
+
         self._instance = None
         atexit.register(self._kill_instances)
         signal.signal(signal.SIGTERM, self._kill_instances)
@@ -289,10 +296,25 @@ class Docker(object):
         return labels.get("com.qemu.dockerfile-checksum", "")
 
     def build_image(self, tag, docker_dir, dockerfile,
-                    quiet=True, user=False, argv=None, extra_files_cksum=[]):
+                    quiet=True, user=False, argv=None, registry=None,
+                    extra_files_cksum=[]):
         if argv is None:
             argv = []
 
+        # pre-calculate the docker checksum before any
+        # substitutions we make for caching
+        checksum = _text_checksum(_dockerfile_preprocess(dockerfile))
+
+        if registry is not None:
+            # see if we can fetch a cache copy, may fail...
+            pull_args = ["pull", "%s/%s" % (registry, tag)]
+            if self._do(pull_args, quiet=quiet) == 0:
+                dockerfile = dockerfile.replace("FROM qemu/",
+                                                "FROM %s/qemu/" %
+                                                (registry))
+            else:
+                registry = None
+
         tmp_df = tempfile.NamedTemporaryFile(mode="w+t",
                                              encoding='utf-8',
                                              dir=docker_dir, suffix=".docker")
@@ -306,15 +328,23 @@ class Docker(object):
                          (uname, uid, uname))
 
         tmp_df.write("\n")
-        tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" %
-                     _text_checksum(_dockerfile_preprocess(dockerfile)))
+        tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" % (checksum))
         for f, c in extra_files_cksum:
             tmp_df.write("LABEL com.qemu.%s-checksum=%s" % (f, c))
 
         tmp_df.flush()
 
-        self._do_check(["build", "-t", tag, "-f", tmp_df.name] + argv +
-                       [docker_dir],
+        build_args = ["build", "-t", tag, "-f", tmp_df.name]
+        if self._buildkit:
+            build_args += ["--build-arg", "BUILDKIT_INLINE_CACHE=1"]
+
+        if registry is not None:
+            cache = "%s/%s" % (registry, tag)
+            build_args += ["--cache-from", cache]
+        build_args += argv
+        build_args += [docker_dir]
+
+        self._do_check(build_args,
                        quiet=quiet)
 
     def update_image(self, tag, tarball, quiet=True):
@@ -403,6 +433,8 @@ class BuildCommand(SubCommand):
         parser.add_argument("--add-current-user", "-u", dest="user",
                             action="store_true",
                             help="Add the current user to image's passwd")
+        parser.add_argument("--registry", "-r",
+                            help="cache from docker registry")
         parser.add_argument("-t", dest="tag",
                             help="Image Tag")
         parser.add_argument("-f", dest="dockerfile",
@@ -458,7 +490,8 @@ class BuildCommand(SubCommand):
                      for k, v in os.environ.items()
                      if k.lower() in FILTERED_ENV_NAMES]
             dkr.build_image(tag, docker_dir, dockerfile,
-                            quiet=args.quiet, user=args.user, argv=argv,
+                            quiet=args.quiet, user=args.user,
+                            argv=argv, registry=args.registry,
                             extra_files_cksum=cksum)
 
             rmtree(docker_dir)
diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
new file mode 100644
index 0000000000..dedcea58b4
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
@@ -0,0 +1,53 @@
+#
+# Docker all cross-compiler target (tests only)
+#
+# While the normal cross builds take care to setup proper multiarch
+# build environments which can cross build QEMU this just installs the
+# basic compilers for as many targets as possible. We shall use this
+# to build and run linux-user tests on GitLab
+#
+FROM qemu/debian10
+
+# What we need to build QEMU itself
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt build-dep -yy qemu
+
+# Add the foreign architecture we want and install dependencies
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+        apt install -y --no-install-recommends \
+        gcc-aarch64-linux-gnu \
+        libc6-dev-arm64-cross \
+        gcc-alpha-linux-gnu \
+        libc6.1-dev-alpha-cross \
+        gcc-arm-linux-gnueabihf \
+        libc6-dev-armhf-cross \
+        gcc-hppa-linux-gnu \
+        libc6-dev-hppa-cross \
+        gcc-m68k-linux-gnu \
+        libc6-dev-m68k-cross \
+        gcc-mips-linux-gnu \
+        libc6-dev-mips-cross \
+        gcc-mips64-linux-gnuabi64 \
+        libc6-dev-mips64-cross \
+        gcc-mips64el-linux-gnuabi64 \
+        libc6-dev-mips64el-cross \
+        gcc-mipsel-linux-gnu \
+        libc6-dev-mipsel-cross \
+        gcc-powerpc-linux-gnu \
+        libc6-dev-powerpc-cross \
+        gcc-powerpc64-linux-gnu \
+        libc6-dev-ppc64-cross \
+        gcc-powerpc64le-linux-gnu \
+        libc6-dev-ppc64el-cross \
+        gcc-riscv64-linux-gnu \
+        libc6-dev-riscv64-cross \
+        gcc-s390x-linux-gnu \
+        libc6-dev-s390x-cross \
+        gcc-sh4-linux-gnu \
+        libc6-dev-sh4-cross \
+        gcc-sparc64-linux-gnu \
+        libc6-dev-sparc64-cross
+
+ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
+ENV DEF_TARGET_LIST aarch64-linux-user,alpha-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sparc64-linux-user
diff --git a/tests/docker/dockerfiles/debian-alpha-cross.docker b/tests/docker/dockerfiles/debian-alpha-cross.docker
index 74bcabfdb1..10fe30df0d 100644
--- a/tests/docker/dockerfiles/debian-alpha-cross.docker
+++ b/tests/docker/dockerfiles/debian-alpha-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker
index 5d89041925..870109ef6a 100644
--- a/tests/docker/dockerfiles/debian-amd64-cross.docker
+++ b/tests/docker/dockerfiles/debian-amd64-cross.docker
@@ -4,7 +4,7 @@
 # This docker target is used on non-x86_64 machines which need the
 # x86_64 cross compilers installed.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Alex Bennée <alex.bennee@linaro.org>
 
 # Add the foreign architecture we want and install dependencies
diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index 957f0bc2e7..8fdfd6a6b0 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -4,7 +4,7 @@
 # This docker target builds on the debian Stretch base image. Further
 # libraries which are not widely available are installed by hand.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
 RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker
index 09ca0a1ba7..166e24df13 100644
--- a/tests/docker/dockerfiles/debian-arm64-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture arm64
diff --git a/tests/docker/dockerfiles/debian-arm64-test-cross.docker b/tests/docker/dockerfiles/debian-arm64-test-cross.docker
index a44e76d942..53a9012beb 100644
--- a/tests/docker/dockerfiles/debian-arm64-test-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-test-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Bullseye base image.
 #
-FROM qemu:debian11
+FROM qemu/debian11
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture arm64
diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker
index e3794a61c9..b7b1a3585f 100644
--- a/tests/docker/dockerfiles/debian-armel-cross.docker
+++ b/tests/docker/dockerfiles/debian-armel-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
 # Add the foreign architecture we want and install dependencies
diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker
index e163b8b956..25d7618833 100644
--- a/tests/docker/dockerfiles/debian-armhf-cross.docker
+++ b/tests/docker/dockerfiles/debian-armhf-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture armhf
diff --git a/tests/docker/dockerfiles/debian-hppa-cross.docker b/tests/docker/dockerfiles/debian-hppa-cross.docker
index 5c68b2d330..3d6c65a3ef 100644
--- a/tests/docker/dockerfiles/debian-hppa-cross.docker
+++ b/tests/docker/dockerfiles/debian-hppa-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-m68k-cross.docker b/tests/docker/dockerfiles/debian-m68k-cross.docker
index 25edc80e9a..fcb10e3534 100644
--- a/tests/docker/dockerfiles/debian-m68k-cross.docker
+++ b/tests/docker/dockerfiles/debian-m68k-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips-cross.docker b/tests/docker/dockerfiles/debian-mips-cross.docker
index 08a8e1c29c..26c154014d 100644
--- a/tests/docker/dockerfiles/debian-mips-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-mips64-cross.docker b/tests/docker/dockerfiles/debian-mips64-cross.docker
index 1a79505d69..09c2ba584e 100644
--- a/tests/docker/dockerfiles/debian-mips64-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker
index 453b53ef72..c990b683b7 100644
--- a/tests/docker/dockerfiles/debian-mips64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker
@@ -4,7 +4,7 @@
 # This docker target builds on the debian Stretch base image.
 #
 
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker
index 3b6e975c68..0e5dd42d3c 100644
--- a/tests/docker/dockerfiles/debian-mipsel-cross.docker
+++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-powerpc-cross.docker b/tests/docker/dockerfiles/debian-powerpc-cross.docker
index 89dd4fbf87..07e1789650 100644
--- a/tests/docker/dockerfiles/debian-powerpc-cross.docker
+++ b/tests/docker/dockerfiles/debian-powerpc-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-ppc64-cross.docker b/tests/docker/dockerfiles/debian-ppc64-cross.docker
index 4bf88ab02d..8efe68874e 100644
--- a/tests/docker/dockerfiles/debian-ppc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64-cross.docker
@@ -2,7 +2,7 @@
 # Docker ppc64 cross-compiler target
 #
 # This docker target builds on the debian Buster base image.
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
index cd386f01d9..1146a06be6 100644
--- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture ppc64el && \
diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker
index 5e2d6ddb60..2bbff19772 100644
--- a/tests/docker/dockerfiles/debian-riscv64-cross.docker
+++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker
index 43fe59836f..9f2ab51eb0 100644
--- a/tests/docker/dockerfiles/debian-s390x-cross.docker
+++ b/tests/docker/dockerfiles/debian-s390x-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the s390x architecture
 RUN dpkg --add-architecture s390x
diff --git a/tests/docker/dockerfiles/debian-sh4-cross.docker b/tests/docker/dockerfiles/debian-sh4-cross.docker
index 9d7663764e..fd3af89575 100644
--- a/tests/docker/dockerfiles/debian-sh4-cross.docker
+++ b/tests/docker/dockerfiles/debian-sh4-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-sparc64-cross.docker b/tests/docker/dockerfiles/debian-sparc64-cross.docker
index 31fd34f120..f4bb9b561c 100644
--- a/tests/docker/dockerfiles/debian-sparc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-sparc64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index 4a0f7706a3..769d95c77b 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -7,7 +7,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 #
-FROM qemu:debian9
+FROM qemu/debian9
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-win32-cross.docker b/tests/docker/dockerfiles/debian-win32-cross.docker
index d16d6431bc..b045e821b9 100644
--- a/tests/docker/dockerfiles/debian-win32-cross.docker
+++ b/tests/docker/dockerfiles/debian-win32-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch MXE base image.
 #
-FROM qemu:debian9-mxe
+FROM qemu/debian9-mxe
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-win64-cross.docker b/tests/docker/dockerfiles/debian-win64-cross.docker
index b0bc960445..2fc9cfcbc6 100644
--- a/tests/docker/dockerfiles/debian-win64-cross.docker
+++ b/tests/docker/dockerfiles/debian-win64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch MXE base image.
 #
-FROM qemu:debian9-mxe
+FROM qemu/debian9-mxe
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-xtensa-cross.docker b/tests/docker/dockerfiles/debian-xtensa-cross.docker
index beb73f46ba..ba4148299c 100644
--- a/tests/docker/dockerfiles/debian-xtensa-cross.docker
+++ b/tests/docker/dockerfiles/debian-xtensa-cross.docker
@@ -18,12 +18,12 @@ RUN apt-get update && \
         git \
         python3-minimal
 
-ENV CPU_LIST csp dc232b dc233c
-ENV TOOLCHAIN_RELEASE 2018.02
+ENV CPU_LIST dc232b dc233c de233_fpu dsp3400
+ENV TOOLCHAIN_RELEASE 2020.07
 
 RUN for cpu in $CPU_LIST; do \
         curl -#SL http://github.com/foss-xtensa/toolchain/releases/download/$TOOLCHAIN_RELEASE/x86_64-$TOOLCHAIN_RELEASE-xtensa-$cpu-elf.tar.gz \
         | tar -xzC /opt; \
     done
 
-ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-csp-elf/bin
+ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-de233_fpu-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dsp3400-elf/bin
diff --git a/tests/docker/dockerfiles/debian9-mxe.docker b/tests/docker/dockerfiles/debian9-mxe.docker
index 62ff1cecf2..ae2c222a6f 100644
--- a/tests/docker/dockerfiles/debian9-mxe.docker
+++ b/tests/docker/dockerfiles/debian9-mxe.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian9
+FROM qemu/debian9
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 798ddd2c3e..70b6186bd3 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -80,7 +80,12 @@ ENV PACKAGES \
     pixman-devel \
     python3 \
     python3-PyYAML \
+    python3-numpy \
+    python3-opencv \
+    python3-pillow \
+    python3-pip \
     python3-sphinx \
+    python3-virtualenv \
     rdma-core-devel \
     SDL2-devel \
     snappy-devel \
@@ -89,6 +94,8 @@ ENV PACKAGES \
     systemd-devel \
     systemtap-sdt-devel \
     tar \
+    tesseract \
+    tesseract-langpack-eng \
     texinfo \
     usbredir-devel \
     virglrenderer-devel \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 6050ce7e8a..f7aac840bf 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -46,9 +46,17 @@ ENV PACKAGES flex bison \
     libxen-dev \
     libzstd-dev \
     make \
-    python3-yaml \
+    python3-numpy \
+    python3-opencv \
+    python3-pil \
+    python3-pip \
     python3-sphinx \
+    python3-venv \
+    python3-yaml \
+    rpm2cpio \
     sparse \
+    tesseract-ocr \
+    tesseract-ocr-eng \
     texinfo \
     xfslibs-dev\
     vim
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index d967adc59a..c9f978abce 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -186,7 +186,7 @@ _filter_img_create()
             -e 's/^\(data_file\)/3-\1/' \
             -e 's/^\(encryption\)/4-\1/' \
             -e 's/^\(preallocation\)/8-\1/' \
-        | sort \
+        | LC_ALL=C sort \
         | $SED -e 's/^[0-9]-//' \
         | tr '\n\0' ' \n' \
         | $SED -e 's/^ *$//' -e 's/ *$//'
diff --git a/tests/qht-bench.c b/tests/qht-bench.c
index eb88a90137..362f03cb03 100644
--- a/tests/qht-bench.c
+++ b/tests/qht-bench.c
@@ -25,7 +25,13 @@ struct thread_stats {
 struct thread_info {
     void (*func)(struct thread_info *);
     struct thread_stats stats;
-    uint64_t r;
+    /*
+     * Seed is in the range [1..UINT64_MAX], because the RNG requires
+     * a non-zero seed.  To use, subtract 1 and compare against the
+     * threshold with </>=.  This lets threshold = 0 never match (0% hit),
+     * and threshold = UINT64_MAX always match (100% hit).
+     */
+    uint64_t seed;
     bool write_op; /* writes alternate between insertions and removals */
     bool resize_down;
 } QEMU_ALIGNED(64); /* avoid false sharing among threads */
@@ -131,8 +137,9 @@ static uint64_t xorshift64star(uint64_t x)
 static void do_rz(struct thread_info *info)
 {
     struct thread_stats *stats = &info->stats;
+    uint64_t r = info->seed - 1;
 
-    if (info->r < resize_threshold) {
+    if (r < resize_threshold) {
         size_t size = info->resize_down ? resize_min : resize_max;
         bool resized;
 
@@ -151,13 +158,14 @@ static void do_rz(struct thread_info *info)
 static void do_rw(struct thread_info *info)
 {
     struct thread_stats *stats = &info->stats;
+    uint64_t r = info->seed - 1;
     uint32_t hash;
     long *p;
 
-    if (info->r >= update_threshold) {
+    if (r >= update_threshold) {
         bool read;
 
-        p = &keys[info->r & (lookup_range - 1)];
+        p = &keys[r & (lookup_range - 1)];
         hash = hfunc(*p);
         read = qht_lookup(&ht, p, hash);
         if (read) {
@@ -166,7 +174,7 @@ static void do_rw(struct thread_info *info)
             stats->not_rd++;
         }
     } else {
-        p = &keys[info->r & (update_range - 1)];
+        p = &keys[r & (update_range - 1)];
         hash = hfunc(*p);
         if (info->write_op) {
             bool written = false;
@@ -208,7 +216,7 @@ static void *thread_func(void *p)
 
     rcu_read_lock();
     while (!atomic_read(&test_stop)) {
-        info->r = xorshift64star(info->r);
+        info->seed = xorshift64star(info->seed);
         info->func(info);
     }
     rcu_read_unlock();
@@ -221,7 +229,7 @@ static void *thread_func(void *p)
 static void prepare_thread_info(struct thread_info *info, int i)
 {
     /* seed for the RNG; each thread should have a different one */
-    info->r = (i + 1) ^ time(NULL);
+    info->seed = (i + 1) ^ time(NULL);
     /* the first update will be a write */
     info->write_op = true;
     /* the first resize will be down */
@@ -281,11 +289,25 @@ static void pr_params(void)
 
 static void do_threshold(double rate, uint64_t *threshold)
 {
+    /*
+     * For 0 <= rate <= 1, scale to fit in a uint64_t.


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:33:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14691.36314 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEbf-0000ak-78; Thu, 29 Oct 2020 20:33:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14691.36314; Thu, 29 Oct 2020 20:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEbf-0000ac-3z; Thu, 29 Oct 2020 20:33:11 +0000
Received: by outflank-mailman (input) for mailman id 14691;
 Thu, 29 Oct 2020 20:33:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEbd-0000aX-A7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d2222451-07c9-4e04-94e7-c902e2db5e60;
 Thu, 29 Oct 2020 20:33:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbb-0006Oz-I7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbb-0007cP-Gd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEbd-0000aX-A7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:09 +0000
X-Inumbo-ID: d2222451-07c9-4e04-94e7-c902e2db5e60
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d2222451-07c9-4e04-94e7-c902e2db5e60;
	Thu, 29 Oct 2020 20:33:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hZxs0cKRUqisd+mt+HfsIct5gXftV10TVbkp2kMbWaY=; b=ReR6KLEaDzYtsRfmIebFuIPjch
	QOHgrwnbaWdTDyyGMwyaAR5xNmuBtRwmtV+TBXd9ldaqhte1gd1x3szm820W3RKdikYEboCXYE5MD
	fb/ORkDJta/rNZL3DCY3l9ayKx4WswRK4+qJSl6zbZDf53Nt3vU88MjHKGMyVU1eiwoQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbb-0006Oz-I7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbb-0007cP-Gd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] char-socket: initialize reconnect timer only when the timer doesn't start
Message-Id: <E1kYEbb-0007cP-Gd@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:07 +0000

commit 2b61bb716cd45ffe10fc92512b6134084c0ffcde
Author:     Li Feng <fengli@smartx.com>
AuthorDate: Fri May 22 10:55:54 2020 +0800
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    char-socket: initialize reconnect timer only when the timer doesn't start
    
    When the disconnect event is triggered in the connecting stage,
    the tcp_chr_disconnect_locked may be called twice.
    
    The first call:
        #0  qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:120
        #1  0x000055555558e38c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
        #2  0x000055555558e3cd in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
        #3  0x000055555558ea32 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
        #4  0x000055555558eeb8 in qemu_chr_socket_connected (task=0x55555582f300, opaque=<optimized out>) at chardev/char-socket.c:1090
        #5  0x0000555555574352 in qio_task_complete (task=task@entry=0x55555582f300) at io/task.c:196
        #6  0x00005555555745f4 in qio_task_thread_result (opaque=0x55555582f300) at io/task.c:111
        #7  qio_task_wait_thread (task=0x55555582f300) at io/task.c:190
        #8  0x000055555558f17e in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1013
        #9  0x0000555555567cbd in char_socket_client_reconnect_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1152
    The second call:
        #0  0x00007ffff5ac3277 in raise () from /lib64/libc.so.6
        #1  0x00007ffff5ac4968 in abort () from /lib64/libc.so.6
        #2  0x00007ffff5abc096 in __assert_fail_base () from /lib64/libc.so.6
        #3  0x00007ffff5abc142 in __assert_fail () from /lib64/libc.so.6
        #4  0x000055555558d10a in qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:125
        #5  0x000055555558df0c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
        #6  0x000055555558df4d in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
        #7  0x000055555558e5b2 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
        #8  0x000055555558e93a in tcp_chr_connect_client_sync (chr=chr@entry=0x55555582ee90, errp=errp@entry=0x7fffffffd178) at chardev/char-socket.c:944
        #9  0x000055555558ec78 in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1035
        #10 0x000055555556804b in char_socket_client_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1023
    
    Run test/test-char to reproduce this issue.
    
    test-char: chardev/char-socket.c:125: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed.
    
    Signed-off-by: Li Feng <fengli@smartx.com>
    Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20200522025554.41063-1-fengli@smartx.com>
---
 chardev/char-socket.c |  2 +-
 tests/test-char.c     | 73 +++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 57 insertions(+), 18 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 5758d9900f..320aa7c642 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -490,7 +490,7 @@ static void tcp_chr_disconnect_locked(Chardev *chr)
     if (emit_close) {
         qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
     }
-    if (s->reconnect_time) {
+    if (s->reconnect_time && !s->reconnect_timer) {
         qemu_chr_socket_restart_timer(chr);
     }
 }
diff --git a/tests/test-char.c b/tests/test-char.c
index 3afc9b1b8d..73ba1cf601 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -625,12 +625,14 @@ static void char_udp_test(void)
 typedef struct {
     int event;
     bool got_pong;
+    CharBackend *be;
 } CharSocketTestData;
 
 
 #define SOCKET_PING "Hello"
 #define SOCKET_PONG "World"
 
+typedef void (*char_socket_cb)(void *opaque, QEMUChrEvent event);
 
 static void
 char_socket_event(void *opaque, QEMUChrEvent event)
@@ -639,6 +641,27 @@ char_socket_event(void *opaque, QEMUChrEvent event)
     data->event = event;
 }
 
+static void
+char_socket_event_with_error(void *opaque, QEMUChrEvent event)
+{
+    static bool first_error;
+    CharSocketTestData *data = opaque;
+    CharBackend *be = data->be;
+    data->event = event;
+    switch (event) {
+    case CHR_EVENT_OPENED:
+        if (!first_error) {
+            first_error = true;
+            qemu_chr_fe_disconnect(be);
+        }
+        return;
+    case CHR_EVENT_CLOSED:
+        return;
+    default:
+        return;
+    }
+}
+
 
 static void
 char_socket_read(void *opaque, const uint8_t *buf, int size)
@@ -699,19 +722,24 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool fd_pass,
 }
 
 
-static void
-char_socket_ping_pong(QIOChannel *ioc)
+static int
+char_socket_ping_pong(QIOChannel *ioc, Error **errp)
 {
     char greeting[sizeof(SOCKET_PING)];
     const char *response = SOCKET_PONG;
 
-    qio_channel_read_all(ioc, greeting, sizeof(greeting), &error_abort);
+    int ret;
+    ret = qio_channel_read_all(ioc, greeting, sizeof(greeting), errp);
+    if (ret != 0) {
+        object_unref(OBJECT(ioc));
+        return -1;
+    }
 
     g_assert(memcmp(greeting, SOCKET_PING, sizeof(greeting)) == 0);
 
-    qio_channel_write_all(ioc, response, sizeof(SOCKET_PONG), &error_abort);
-
+    qio_channel_write_all(ioc, response, sizeof(SOCKET_PONG), errp);
     object_unref(OBJECT(ioc));
+    return 0;
 }
 
 
@@ -723,7 +751,7 @@ char_socket_server_client_thread(gpointer data)
 
     qio_channel_socket_connect_sync(ioc, addr, &error_abort);
 
-    char_socket_ping_pong(QIO_CHANNEL(ioc));
+    char_socket_ping_pong(QIO_CHANNEL(ioc), &error_abort);
 
     return NULL;
 }
@@ -783,6 +811,7 @@ static void char_socket_server_test(gconstpointer opaque)
 
  reconnect:
     data.event = -1;
+    data.be = &be;
     qemu_chr_fe_set_handlers(&be, NULL, NULL,
                              char_socket_event, NULL,
                              &data, NULL, true);
@@ -855,10 +884,13 @@ char_socket_client_server_thread(gpointer data)
     QIOChannelSocket *ioc = data;
     QIOChannelSocket *cioc;
 
+retry:
     cioc = qio_channel_socket_accept(ioc, &error_abort);
     g_assert_nonnull(cioc);
 
-    char_socket_ping_pong(QIO_CHANNEL(cioc));
+    if (char_socket_ping_pong(QIO_CHANNEL(cioc), NULL) != 0) {
+        goto retry;
+    }
 
     return NULL;
 }
@@ -869,12 +901,13 @@ typedef struct {
     const char *reconnect;
     bool wait_connected;
     bool fd_pass;
+    char_socket_cb event_cb;
 } CharSocketClientTestConfig;
 
-
 static void char_socket_client_test(gconstpointer opaque)
 {
     const CharSocketClientTestConfig *config = opaque;
+    const char_socket_cb event_cb = config->event_cb;
     QIOChannelSocket *ioc;
     char *optstr;
     Chardev *chr;
@@ -938,8 +971,9 @@ static void char_socket_client_test(gconstpointer opaque)
 
  reconnect:
     data.event = -1;
+    data.be = &be;
     qemu_chr_fe_set_handlers(&be, NULL, NULL,
-                             char_socket_event, NULL,
+                             event_cb, NULL,
                              &data, NULL, true);
     if (config->reconnect) {
         g_assert(data.event == -1);
@@ -977,7 +1011,7 @@ static void char_socket_client_test(gconstpointer opaque)
     /* Setup a callback to receive the reply to our greeting */
     qemu_chr_fe_set_handlers(&be, char_socket_can_read,
                              char_socket_read,
-                             char_socket_event, NULL,
+                             event_cb, NULL,
                              &data, NULL, true);
     g_assert(data.event == CHR_EVENT_OPENED);
     data.event = -1;
@@ -1422,17 +1456,20 @@ int main(int argc, char **argv)
 
 #define SOCKET_CLIENT_TEST(name, addr)                                  \
     static CharSocketClientTestConfig client1 ## name =                 \
-        { addr, NULL, false, false };                                   \
+        { addr, NULL, false, false, char_socket_event};                 \
     static CharSocketClientTestConfig client2 ## name =                 \
-        { addr, NULL, true, false };                                    \
+        { addr, NULL, true, false, char_socket_event };                 \
     static CharSocketClientTestConfig client3 ## name =                 \
-        { addr, ",reconnect=1", false };                                \
+        { addr, ",reconnect=1", false, false, char_socket_event };      \
     static CharSocketClientTestConfig client4 ## name =                 \
-        { addr, ",reconnect=1", true };                                 \
+        { addr, ",reconnect=1", true, false, char_socket_event };       \
     static CharSocketClientTestConfig client5 ## name =                 \
-        { addr, NULL, false, true };                                    \
+        { addr, NULL, false, true, char_socket_event };                 \
     static CharSocketClientTestConfig client6 ## name =                 \
-        { addr, NULL, true, true };                                     \
+        { addr, NULL, true, true, char_socket_event };                  \
+    static CharSocketClientTestConfig client7 ## name =                 \
+        { addr, ",reconnect=1", true, false,                            \
+            char_socket_event_with_error };                             \
     g_test_add_data_func("/char/socket/client/mainloop/" # name,        \
                          &client1 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn/" # name,       \
@@ -1444,7 +1481,9 @@ int main(int argc, char **argv)
     g_test_add_data_func("/char/socket/client/mainloop-fdpass/" # name, \
                          &client5 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn-fdpass/" # name, \
-                         &client6 ##name, char_socket_client_test)
+                         &client6 ##name, char_socket_client_test);     \
+    g_test_add_data_func("/char/socket/client/reconnect-error/" # name, \
+                         &client7 ##name, char_socket_client_test)
 
     if (has_ipv4) {
         SOCKET_SERVER_TEST(tcp, &tcpaddr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:33:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:33:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14692.36318 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEbo-0000bw-8s; Thu, 29 Oct 2020 20:33:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14692.36318; Thu, 29 Oct 2020 20:33:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEbo-0000bm-5h; Thu, 29 Oct 2020 20:33:20 +0000
Received: by outflank-mailman (input) for mailman id 14692;
 Thu, 29 Oct 2020 20:33:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEbm-0000bd-PH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1fdad499-fe32-4ed9-a9c4-558206973def;
 Thu, 29 Oct 2020 20:33:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbl-0006P7-Mw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbl-0007d3-Kx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEbm-0000bd-PH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:18 +0000
X-Inumbo-ID: 1fdad499-fe32-4ed9-a9c4-558206973def
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1fdad499-fe32-4ed9-a9c4-558206973def;
	Thu, 29 Oct 2020 20:33:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j+dNRqiD1dUL3WZZwiGhvMfeT6dyERijnfStT4354Us=; b=kPjCpd05NYK14GU/jZ/oo4WUdX
	0yW+aiC9F0/1GrevKiSv8RmOBMl8ZHe4anWzHhSrR+SZEDOPqrjFjx8HzUCsNxuAvyW3yxWG0oMF2
	mLDhXwQv1/iH4NkPLLOHp2bkXqoKTFRwZvvlXz2kH+g7txoykcUzTnAGJlbQJnGRy3bE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbl-0006P7-Mw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbl-0007d3-Kx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] chardev: don't abort on attempt to add duplicated chardev
Message-Id: <E1kYEbl-0007d3-Kx@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:17 +0000

commit 14a7a203063694ff932f3371ed93e97987dcafc0
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Mon Jul 6 22:10:34 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: don't abort on attempt to add duplicated chardev
    
    This is a regression from commit d2623129a7d ("qom: Drop parameter @errp
    of object_property_add() & friends").
    
    (qemu) chardev-add id=null,backend=null
    (qemu) chardev-add id=null,backend=null
    Unexpected error in object_property_try_add() at /home/elmarco/src/qemu/qom/object.c:1166:
    attempt to add duplicate property 'null' to object (type 'container')
    
    That case is currently not covered in the test suite, but will be with
    the queued patch "char: fix use-after-free with dup chardev &
    reconnect".
    
    Fixes: d2623129a7dec1d3041ad1221dda1ca49c667532
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 chardev/char.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/chardev/char.c b/chardev/char.c
index e5b43cb4b8..a0626d04d5 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -996,7 +996,11 @@ static Chardev *chardev_new(const char *id, const char *typename,
     }
 
     if (id) {
-        object_property_add_child(get_chardevs_root(), id, obj);
+        object_property_try_add_child(get_chardevs_root(), id, obj,
+                                      &local_err);
+        if (local_err) {
+            goto end;
+        }
         object_unref(obj);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:33:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:33:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14693.36322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEby-0000dP-Aj; Thu, 29 Oct 2020 20:33:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14693.36322; Thu, 29 Oct 2020 20:33:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEby-0000dF-7I; Thu, 29 Oct 2020 20:33:30 +0000
Received: by outflank-mailman (input) for mailman id 14693;
 Thu, 29 Oct 2020 20:33:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEbx-0000d3-5U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 39d37862-237d-4256-b76a-1fb54a665412;
 Thu, 29 Oct 2020 20:33:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbv-0006PF-RH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEbv-0007de-Pp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEbx-0000d3-5U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:29 +0000
X-Inumbo-ID: 39d37862-237d-4256-b76a-1fb54a665412
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 39d37862-237d-4256-b76a-1fb54a665412;
	Thu, 29 Oct 2020 20:33:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JCqzttCVJ4uUZp+T5pLcKIGgirv1zG8Pw67H1feYnVM=; b=ILSxTK9BBjBmbDBCjkXj/QGnRr
	d1neth5FFNbFldinvUvf3Ui7PbE5rjvQk+/OWQQKku24gxEYFbAIFJ1w0zJAR6RIG1Uvvgn/U2SJR
	oXttFN14O3nx7yuGbqLMiPQVNEyz+Pp42CcINIRLHJTybIa3671rLP+ZyAllqmi6AHoY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbv-0006PF-RH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEbv-0007de-Pp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] char: fix use-after-free with dup chardev & reconnect
Message-Id: <E1kYEbv-0007de-Pp@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:27 +0000

commit 6806601969a0d6c095e3836423fef1dedec55289
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Mon Apr 20 13:20:12 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    char: fix use-after-free with dup chardev & reconnect
    
    With a reconnect socket, qemu_char_open() will start a background
    thread. It should keep a reference on the chardev.
    
    Fixes invalid read:
    READ of size 8 at 0x6040000ac858 thread T7
        #0 0x5555598d37b8 in unix_connect_saddr /home/elmarco/src/qq/util/qemu-sockets.c:954
        #1 0x5555598d4751 in socket_connect /home/elmarco/src/qq/util/qemu-sockets.c:1109
        #2 0x555559707c34 in qio_channel_socket_connect_sync /home/elmarco/src/qq/io/channel-socket.c:145
        #3 0x5555596adebb in tcp_chr_connect_client_task /home/elmarco/src/qq/chardev/char-socket.c:1104
        #4 0x555559723d55 in qio_task_thread_worker /home/elmarco/src/qq/io/task.c:123
        #5 0x5555598a6731 in qemu_thread_start /home/elmarco/src/qq/util/qemu-thread-posix.c:519
        #6 0x7ffff40d4431 in start_thread (/lib64/libpthread.so.0+0x9431)
        #7 0x7ffff40029d2 in __clone (/lib64/libc.so.6+0x1019d2)
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200420112012.567284-1-marcandre.lureau@redhat.com>
---
 chardev/char-socket.c |  3 ++-
 tests/test-char.c     | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 320aa7c642..ef62dbf3d7 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -1129,7 +1129,8 @@ static void tcp_chr_connect_client_async(Chardev *chr)
      */
     s->connect_task = qio_task_new(OBJECT(sioc),
                                    qemu_chr_socket_connected,
-                                   chr, NULL);
+                                   object_ref(OBJECT(chr)),
+                                   (GDestroyNotify)object_unref);
     qio_task_run_in_thread(s->connect_task,
                            tcp_chr_connect_client_task,
                            s->addr,
diff --git a/tests/test-char.c b/tests/test-char.c
index 73ba1cf601..9d8746414d 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -904,6 +904,52 @@ typedef struct {
     char_socket_cb event_cb;
 } CharSocketClientTestConfig;
 
+static void char_socket_client_dupid_test(gconstpointer opaque)
+{
+    const CharSocketClientTestConfig *config = opaque;
+    QIOChannelSocket *ioc;
+    char *optstr;
+    Chardev *chr1, *chr2;
+    SocketAddress *addr;
+    QemuOpts *opts;
+    Error *local_err = NULL;
+
+    /*
+     * Setup a listener socket and determine get its address
+     * so we know the TCP port for the client later
+     */
+    ioc = qio_channel_socket_new();
+    g_assert_nonnull(ioc);
+    qio_channel_socket_listen_sync(ioc, config->addr, 1, &error_abort);
+    addr = qio_channel_socket_get_local_address(ioc, &error_abort);
+    g_assert_nonnull(addr);
+
+    /*
+     * Populate the chardev address based on what the server
+     * is actually listening on
+     */
+    optstr = char_socket_addr_to_opt_str(addr,
+                                         config->fd_pass,
+                                         config->reconnect,
+                                         false);
+
+    opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"),
+                                   optstr, true);
+    g_assert_nonnull(opts);
+    chr1 = qemu_chr_new_from_opts(opts, NULL, &error_abort);
+    g_assert_nonnull(chr1);
+
+    chr2 = qemu_chr_new_from_opts(opts, NULL, &local_err);
+    g_assert_null(chr2);
+    error_free_or_abort(&local_err);
+
+    object_unref(OBJECT(ioc));
+    qemu_opts_del(opts);
+    object_unparent(OBJECT(chr1));
+    qapi_free_SocketAddress(addr);
+    g_free(optstr);
+}
+
 static void char_socket_client_test(gconstpointer opaque)
 {
     const CharSocketClientTestConfig *config = opaque;
@@ -1456,7 +1502,7 @@ int main(int argc, char **argv)
 
 #define SOCKET_CLIENT_TEST(name, addr)                                  \
     static CharSocketClientTestConfig client1 ## name =                 \
-        { addr, NULL, false, false, char_socket_event};                 \
+        { addr, NULL, false, false, char_socket_event };                \
     static CharSocketClientTestConfig client2 ## name =                 \
         { addr, NULL, true, false, char_socket_event };                 \
     static CharSocketClientTestConfig client3 ## name =                 \
@@ -1470,6 +1516,8 @@ int main(int argc, char **argv)
     static CharSocketClientTestConfig client7 ## name =                 \
         { addr, ",reconnect=1", true, false,                            \
             char_socket_event_with_error };                             \
+    static CharSocketClientTestConfig client8 ## name =                 \
+        { addr, ",reconnect=1", false, false, char_socket_event };      \
     g_test_add_data_func("/char/socket/client/mainloop/" # name,        \
                          &client1 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn/" # name,       \
@@ -1483,7 +1531,9 @@ int main(int argc, char **argv)
     g_test_add_data_func("/char/socket/client/wait-conn-fdpass/" # name, \
                          &client6 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/reconnect-error/" # name, \
-                         &client7 ##name, char_socket_client_test)
+                         &client7 ##name, char_socket_client_test);     \
+    g_test_add_data_func("/char/socket/client/dupid-reconnect/" # name, \
+                         &client8 ##name, char_socket_client_dupid_test)
 
     if (has_ipv4) {
         SOCKET_SERVER_TEST(tcp, &tcpaddr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:33:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:33:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14694.36326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEc8-0000eq-Bv; Thu, 29 Oct 2020 20:33:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14694.36326; Thu, 29 Oct 2020 20:33:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEc8-0000ei-8q; Thu, 29 Oct 2020 20:33:40 +0000
Received: by outflank-mailman (input) for mailman id 14694;
 Thu, 29 Oct 2020 20:33:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEc6-0000eX-RA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 31130d80-e4f8-4582-8675-c7618b3c4bbe;
 Thu, 29 Oct 2020 20:33:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEc5-0006PP-Ux
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEc5-0007eJ-UB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEc6-0000eX-RA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:38 +0000
X-Inumbo-ID: 31130d80-e4f8-4582-8675-c7618b3c4bbe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 31130d80-e4f8-4582-8675-c7618b3c4bbe;
	Thu, 29 Oct 2020 20:33:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wUZXf5jRKcKTdy9dOKG6YDV6PONzJNinIrBGx44WBRI=; b=J7JlTwAZmkx3jKLIKbOu4/XVCk
	z6AtP5tJz3VP/akU3Hu/RjWs6WI672RMnxKowZfXzPXtSJpI/sYNLfDjbYBZy4Uc/aEg33i5Xv2G8
	/6bonoEFzCxt1xNrgH30cplQDKNca/k9/8ne/B3lXAwY9k5/lxcag6TP+8k8hCou8id4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEc5-0006PP-Ux
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEc5-0007eJ-UB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] monitor/misc: Remove unused "chardev/char-mux.h" include
Message-Id: <E1kYEc5-0007eJ-UB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:37 +0000

commit 833ef7ec5677ac3f6627f44fbd599cfb16581220
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:06 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    monitor/misc: Remove unused "chardev/char-mux.h" include
    
    monitor/misc.c never required "chardev/char-mux.h", remove it.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-2-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 monitor/misc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/monitor/misc.c b/monitor/misc.c
index 89bb970b00..e847b58a8c 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -33,7 +33,6 @@
 #include "exec/gdbstub.h"
 #include "net/net.h"
 #include "net/slirp.h"
-#include "chardev/char-mux.h"
 #include "ui/qemu-spice.h"
 #include "qemu/config-file.h"
 #include "qemu/ctype.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:33:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:33:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14695.36330 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcI-0000gA-DH; Thu, 29 Oct 2020 20:33:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14695.36330; Thu, 29 Oct 2020 20:33:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcI-0000g3-AN; Thu, 29 Oct 2020 20:33:50 +0000
Received: by outflank-mailman (input) for mailman id 14695;
 Thu, 29 Oct 2020 20:33:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEcG-0000fr-TQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 767100f8-b2b2-4951-8fd4-aa197337e3d4;
 Thu, 29 Oct 2020 20:33:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcG-0006Pe-2g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcG-0007f1-1k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEcG-0000fr-TQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
X-Inumbo-ID: 767100f8-b2b2-4951-8fd4-aa197337e3d4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 767100f8-b2b2-4951-8fd4-aa197337e3d4;
	Thu, 29 Oct 2020 20:33:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=91d2hNBo/btSfCVe0jY7ZK/br6XsqS4Acf5UbmQhPHI=; b=e0vGxbe5ax73JNoTbLSoQjHR0s
	WMIJXQP+D+cFE9xWDFL10YxrRa0RSFiDwOxV0PLafz5zuHf5vJnPLli8MS11GFrsEpkWb0wjVFRlj
	GpPI9PcDADe6fEM8e9U+zYcS757U55PgUEopzDWYuyedz8qfgN4ndj5SouhFmW7RUL1E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcG-0006Pe-2g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcG-0007f1-1k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/test-char: Remove unused "chardev/char-mux.h" include
Message-Id: <E1kYEcG-0007f1-1k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:48 +0000

commit 35b49e93fda0498fe1a8663a6ad3db11756d7e93
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:07 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    tests/test-char: Remove unused "chardev/char-mux.h" include
    
    This test never required "chardev/char-mux.h", remove it.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-3-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-char.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index 9d8746414d..614bdac2df 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -6,7 +6,6 @@
 #include "qemu/option.h"
 #include "qemu/sockets.h"
 #include "chardev/char-fe.h"
-#include "chardev/char-mux.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-char.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14696.36334 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcS-0000iL-GD; Thu, 29 Oct 2020 20:34:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14696.36334; Thu, 29 Oct 2020 20:34:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcS-0000i8-DQ; Thu, 29 Oct 2020 20:34:00 +0000
Received: by outflank-mailman (input) for mailman id 14696;
 Thu, 29 Oct 2020 20:33:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEcR-0000hK-2F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8f07c92c-3dd9-4ac0-91a1-d7f92549287d;
 Thu, 29 Oct 2020 20:33:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcQ-0006QD-7K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcQ-0007fh-5W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEcR-0000hK-2F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:59 +0000
X-Inumbo-ID: 8f07c92c-3dd9-4ac0-91a1-d7f92549287d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8f07c92c-3dd9-4ac0-91a1-d7f92549287d;
	Thu, 29 Oct 2020 20:33:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eq0Ag/k/bLLj9dZvQPpmuoPbubdY+Njrogr1o/GTbqg=; b=USQm2pQfgg7opzldW2GU3EWxCR
	fSnP7sJWgln2CYPBmMPEFN5YSAdEqygT5sPDu+oGcodAacpr3Mbp+COkmz2X23UgxJJvaPPReqF2v
	7ZUJjXLYcPzW4jv6zFsTRs3e3IZ429yIM6PaklZWWb7M1eEXeL6N0kUEY4pJ0TBRSYOY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcQ-0006QD-7K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcQ-0007fh-5W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:33:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] chardev: Restrict msmouse / wctablet / testdev to system emulation
Message-Id: <E1kYEcQ-0007fh-5W@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:33:58 +0000

commit c383efd50a12991a23921e37541c6e5f1bfec1e4
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:08 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Restrict msmouse / wctablet / testdev to system emulation
    
    The msmouse / wctablet / testdev character devices are only
    used by system emulation. Remove them from user mode and tools.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-4-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index 3a58c9d329..62ec0a3323 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -17,7 +17,7 @@ chardev-obj-y += char-udp.o
 chardev-obj-$(CONFIG_WIN32) += char-win.o
 chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o
 
-common-obj-y += msmouse.o wctablet.o testdev.o
+common-obj-$(CONFIG_SOFTMMU) += msmouse.o wctablet.o testdev.o
 
 ifeq ($(CONFIG_BRLAPI),y)
 common-obj-m += baum.o
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14697.36338 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcc-0000jV-Hr; Thu, 29 Oct 2020 20:34:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14697.36338; Thu, 29 Oct 2020 20:34:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcc-0000jN-Et; Thu, 29 Oct 2020 20:34:10 +0000
Received: by outflank-mailman (input) for mailman id 14697;
 Thu, 29 Oct 2020 20:34:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEcb-0000jG-Fk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a1e1c0ee-20cd-4b52-a6cb-ba493afc44e4;
 Thu, 29 Oct 2020 20:34:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEca-0006Qg-BB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEca-0007ga-AE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEcb-0000jG-Fk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:09 +0000
X-Inumbo-ID: a1e1c0ee-20cd-4b52-a6cb-ba493afc44e4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a1e1c0ee-20cd-4b52-a6cb-ba493afc44e4;
	Thu, 29 Oct 2020 20:34:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tto5gvRhSjpyYM2lbHC5c3QaQxJjGh7IursCsSuYQzM=; b=P0TZztQrWKTg6d/2FDPNS03LFs
	3jEQQe/tx4GFo5X4yNBlMOlXVrXTMGqbOuB7hsI6vO4QNKR5W4ep4ZmsHSAvn/psy+PT9CBL7v5qv
	ArRw0C6PMCELj0Yx5MA53ZKz8M5/WQGiN22itfkPsMe6RecY/wxy7MchlGQJQRjacmz0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEca-0006Qg-BB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEca-0007ga-AE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
Message-Id: <E1kYEca-0007ga-AE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:08 +0000

commit ffa0f7eb57f3fbb4947e5bf12040108481ea46c3
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:09 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
    
    No file out of chardev/ requires access to this header,
    restrict its scope.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-5-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/char-fe.c          |  2 +-
 chardev/char-mux.c         |  2 +-
 chardev/char.c             |  2 +-
 chardev/chardev-internal.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 include/chardev/char-mux.h | 61 ---------------------------------------------
 5 files changed, 65 insertions(+), 64 deletions(-)

diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index f3530a90e6..474715c5a9 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -29,7 +29,7 @@
 
 #include "chardev/char-fe.h"
 #include "chardev/char-io.h"
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len)
 {
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index 46c44af67c..6f980bb836 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -29,7 +29,7 @@
 #include "chardev/char.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 /* MUX driver for serial I/O splitting */
 
diff --git a/chardev/char.c b/chardev/char.c
index a0626d04d5..807be52300 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -40,7 +40,7 @@
 #include "qemu/id.h"
 #include "qemu/coroutine.h"
 
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 /***********************************************************/
 /* character device */
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
new file mode 100644
index 0000000000..e0264ac349
--- /dev/null
+++ b/chardev/chardev-internal.h
@@ -0,0 +1,62 @@
+/*
+ * QEMU Character device internals
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * 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 CHARDEV_INTERNAL_H
+#define CHARDEV_INTERNAL_H
+
+#include "chardev/char.h"
+#include "chardev/char-fe.h"
+
+#define MAX_MUX 4
+#define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
+#define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1)
+
+typedef struct MuxChardev {
+    Chardev parent;
+    CharBackend *backends[MAX_MUX];
+    CharBackend chr;
+    int focus;
+    int mux_cnt;
+    int term_got_escape;
+    int max_size;
+    /* Intermediate input buffer catches escape sequences even if the
+       currently active device is not accepting any input - but only until it
+       is full as well. */
+    unsigned char buffer[MAX_MUX][MUX_BUFFER_SIZE];
+    int prod[MAX_MUX];
+    int cons[MAX_MUX];
+    int timestamps;
+
+    /* Protected by the Chardev chr_write_lock.  */
+    int linestart;
+    int64_t timestamps_start;
+} MuxChardev;
+
+#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
+#define CHARDEV_IS_MUX(chr)                             \
+    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
+
+void mux_set_focus(Chardev *chr, int focus);
+void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
+
+#endif /* CHAR_MUX_H */
diff --git a/include/chardev/char-mux.h b/include/chardev/char-mux.h
deleted file mode 100644
index 417fe32eed..0000000000
--- a/include/chardev/char-mux.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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 CHAR_MUX_H
-#define CHAR_MUX_H
-
-#include "chardev/char.h"
-#include "chardev/char-fe.h"
-
-#define MAX_MUX 4
-#define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
-#define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1)
-typedef struct MuxChardev {
-    Chardev parent;
-    CharBackend *backends[MAX_MUX];
-    CharBackend chr;
-    int focus;
-    int mux_cnt;
-    int term_got_escape;
-    int max_size;
-    /* Intermediate input buffer catches escape sequences even if the
-       currently active device is not accepting any input - but only until it
-       is full as well. */
-    unsigned char buffer[MAX_MUX][MUX_BUFFER_SIZE];
-    int prod[MAX_MUX];
-    int cons[MAX_MUX];
-    int timestamps;
-
-    /* Protected by the Chardev chr_write_lock.  */
-    int linestart;
-    int64_t timestamps_start;
-} MuxChardev;
-
-#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
-#define CHARDEV_IS_MUX(chr)                             \
-    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
-
-void mux_set_focus(Chardev *chr, int focus);
-void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
-
-#endif /* CHAR_MUX_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14698.36341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEco-0000kl-JQ; Thu, 29 Oct 2020 20:34:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14698.36341; Thu, 29 Oct 2020 20:34:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEco-0000kd-GP; Thu, 29 Oct 2020 20:34:22 +0000
Received: by outflank-mailman (input) for mailman id 14698;
 Thu, 29 Oct 2020 20:34:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEcm-0000kP-Q0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6a3aede8-b8d5-4902-a862-cb2289cac00d;
 Thu, 29 Oct 2020 20:34:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEck-0006Qm-Er
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEck-0007hY-E3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEcm-0000kP-Q0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:20 +0000
X-Inumbo-ID: 6a3aede8-b8d5-4902-a862-cb2289cac00d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6a3aede8-b8d5-4902-a862-cb2289cac00d;
	Thu, 29 Oct 2020 20:34:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Mu2plgjDQ0g6TkM0XkGViC9J1iBuwbaSK4WBQ0nwVAM=; b=iuMx3Z1e0xxToq8iHEWmTXkhci
	j0NRz3vKBgNRiK7R9ojwTRVOGCOZuLBhpy9kPK8zlfml4K4inddNb8Ax9yGjloyf91Z4f9uoMa5hO
	GOcJ127sCxSjzYs36vIh7JKwIyIS8c3dDrBz4tisKlH21dFC3chH/lXWnkNwd9v/lVco=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEck-0006Qm-Er
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEck-0007hY-E3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] chardev: Extract system emulation specific code
Message-Id: <E1kYEck-0007hY-E3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:18 +0000

commit 30827bad3852fd85d86995e7ccab429679442889
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:10 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Extract system emulation specific code
    
    Split out code only used during system emulation,
    to reduce code pulled in user emulation and tools.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-6-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/Makefile.objs      |  1 +
 chardev/char.c             | 35 +----------------------
 chardev/chardev-internal.h |  3 ++
 chardev/chardev-sysemu.c   | 69 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 74 insertions(+), 34 deletions(-)

diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index 62ec0a3323..3783dadc4c 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -1,4 +1,5 @@
 chardev-obj-y += char.o
+chardev-obj-$(CONFIG_SOFTMMU) += chardev-sysemu.o
 chardev-obj-$(CONFIG_WIN32) += char-console.o
 chardev-obj-$(CONFIG_POSIX) += char-fd.o
 chardev-obj-y += char-fe.o
diff --git a/chardev/char.c b/chardev/char.c
index 807be52300..77e7ec814f 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -45,7 +45,7 @@
 /***********************************************************/
 /* character device */
 
-static Object *get_chardevs_root(void)
+Object *get_chardevs_root(void)
 {
     return container_get(object_get_root(), "/chardevs");
 }
@@ -305,33 +305,6 @@ static const TypeInfo char_type_info = {
     .class_init = char_class_init,
 };
 
-static int chardev_machine_done_notify_one(Object *child, void *opaque)
-{
-    Chardev *chr = (Chardev *)child;
-    ChardevClass *class = CHARDEV_GET_CLASS(chr);
-
-    if (class->chr_machine_done) {
-        return class->chr_machine_done(chr);
-    }
-
-    return 0;
-}
-
-static void chardev_machine_done_hook(Notifier *notifier, void *unused)
-{
-    int ret = object_child_foreach(get_chardevs_root(),
-                                   chardev_machine_done_notify_one, NULL);
-
-    if (ret) {
-        error_report("Failed to call chardev machine_done hooks");
-        exit(1);
-    }
-}
-
-static Notifier chardev_machine_done_notify = {
-    .notify = chardev_machine_done_hook,
-};
-
 static bool qemu_chr_is_busy(Chardev *s)
 {
     if (CHARDEV_IS_MUX(s)) {
@@ -1198,12 +1171,6 @@ void qemu_chr_cleanup(void)
 static void register_types(void)
 {
     type_register_static(&char_type_info);
-
-    /* this must be done after machine init, since we register FEs with muxes
-     * as part of realize functions like serial_isa_realizefn when -nographic
-     * is specified
-     */
-    qemu_add_machine_init_done_notifier(&chardev_machine_done_notify);
 }
 
 type_init(register_types);
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
index e0264ac349..f4d0429763 100644
--- a/chardev/chardev-internal.h
+++ b/chardev/chardev-internal.h
@@ -26,6 +26,7 @@
 
 #include "chardev/char.h"
 #include "chardev/char-fe.h"
+#include "qom/object.h"
 
 #define MAX_MUX 4
 #define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
@@ -59,4 +60,6 @@ typedef struct MuxChardev {
 void mux_set_focus(Chardev *chr, int focus);
 void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
 
+Object *get_chardevs_root(void);
+
 #endif /* CHAR_MUX_H */
diff --git a/chardev/chardev-sysemu.c b/chardev/chardev-sysemu.c
new file mode 100644
index 0000000000..eecdc615ee
--- /dev/null
+++ b/chardev/chardev-sysemu.c
@@ -0,0 +1,69 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "sysemu/sysemu.h"
+#include "chardev/char.h"
+#include "qemu/error-report.h"
+#include "chardev-internal.h"
+
+static int chardev_machine_done_notify_one(Object *child, void *opaque)
+{
+    Chardev *chr = (Chardev *)child;
+    ChardevClass *class = CHARDEV_GET_CLASS(chr);
+
+    if (class->chr_machine_done) {
+        return class->chr_machine_done(chr);
+    }
+
+    return 0;
+}
+
+static void chardev_machine_done_hook(Notifier *notifier, void *unused)
+{
+    int ret = object_child_foreach(get_chardevs_root(),
+                                   chardev_machine_done_notify_one, NULL);
+
+    if (ret) {
+        error_report("Failed to call chardev machine_done hooks");
+        exit(1);
+    }
+}
+
+
+static Notifier chardev_machine_done_notify = {
+    .notify = chardev_machine_done_hook,
+};
+
+static void register_types(void)
+{
+    /*
+     * This must be done after machine init, since we register FEs with muxes
+     * as part of realize functions like serial_isa_realizefn when -nographic
+     * is specified.
+     */
+    qemu_add_machine_init_done_notifier(&chardev_machine_done_notify);
+}
+
+type_init(register_types);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14699.36345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcx-0000m0-Kk; Thu, 29 Oct 2020 20:34:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14699.36345; Thu, 29 Oct 2020 20:34:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEcx-0000ls-Hu; Thu, 29 Oct 2020 20:34:31 +0000
Received: by outflank-mailman (input) for mailman id 14699;
 Thu, 29 Oct 2020 20:34:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEcv-0000lf-Mm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3ed3e296-07de-4831-8311-ecc898d254f6;
 Thu, 29 Oct 2020 20:34:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcu-0006Qv-JR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEcu-0007ik-IM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEcv-0000lf-Mm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:29 +0000
X-Inumbo-ID: 3ed3e296-07de-4831-8311-ecc898d254f6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3ed3e296-07de-4831-8311-ecc898d254f6;
	Thu, 29 Oct 2020 20:34:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0r0jH4c7QfFD3dGxE7ZF4ELYqNFUr8k0oPtbaQIdHPM=; b=xOaRKtHzL1xdSIGic+LCc+uOCV
	wSLLw7EqaJsa6RKjXpB5FnzhBCVsQMLoKhvQ9hR/For8f1igpxmPqvOQKnnVPru59MFoCFCG/U/p8
	1ILy2s3NglkIYAyCVS/Adz5DtmwAMibxVj17dFll4SlGROuJ1vciblWhr2qKPhs4OtyQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcu-0006Qv-JR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEcu-0007ik-IM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/elmarco/tags/chardev-pull-request' into staging
Message-Id: <E1kYEcu-0007ik-IM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:28 +0000

commit 6c87d9f311dba0641bdc2df556056938a8bf2a12
Merge: 9f526fce49c6ac48114ed04914b5a76e4db75785 30827bad3852fd85d86995e7ccab429679442889
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 09:34:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 09:34:24 2020 +0100

    Merge remote-tracking branch 'remotes/elmarco/tags/chardev-pull-request' into staging
    
    # gpg: Signature made Mon 13 Jul 2020 09:23:19 BST
    # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
    # gpg:                issuer "marcandre.lureau@redhat.com"
    # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
    # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
    # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
    
    * remotes/elmarco/tags/chardev-pull-request:
      chardev: Extract system emulation specific code
      chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
      chardev: Restrict msmouse / wctablet / testdev to system emulation
      tests/test-char: Remove unused "chardev/char-mux.h" include
      monitor/misc: Remove unused "chardev/char-mux.h" include
      char: fix use-after-free with dup chardev & reconnect
      chardev: don't abort on attempt to add duplicated chardev
      char-socket: initialize reconnect timer only when the timer doesn't start
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 chardev/Makefile.objs      |   3 +-
 chardev/char-fe.c          |   2 +-
 chardev/char-mux.c         |   2 +-
 chardev/char-socket.c      |   5 +-
 chardev/char.c             |  43 +++-------------
 chardev/chardev-internal.h |  65 ++++++++++++++++++++++++
 chardev/chardev-sysemu.c   |  69 +++++++++++++++++++++++++
 include/chardev/char-mux.h |  61 -----------------------
 monitor/misc.c             |   1 -
 tests/test-char.c          | 122 ++++++++++++++++++++++++++++++++++++++-------
 10 files changed, 253 insertions(+), 120 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14700.36350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEd7-0000nP-MO; Thu, 29 Oct 2020 20:34:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14700.36350; Thu, 29 Oct 2020 20:34:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEd7-0000nH-JM; Thu, 29 Oct 2020 20:34:41 +0000
Received: by outflank-mailman (input) for mailman id 14700;
 Thu, 29 Oct 2020 20:34:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEd6-0000n6-0L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8511edcc-0ea1-46d0-94b1-b83baeeb6e8e;
 Thu, 29 Oct 2020 20:34:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEd5-0006R4-2x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEd5-0007l0-24
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEd6-0000n6-0L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:40 +0000
X-Inumbo-ID: 8511edcc-0ea1-46d0-94b1-b83baeeb6e8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8511edcc-0ea1-46d0-94b1-b83baeeb6e8e;
	Thu, 29 Oct 2020 20:34:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zw5uOhi5BKN+UNxiTqso3U2XRNBESRNFcNkULVhuUGI=; b=XmS9SyT31kcyeCGVlnaffOnwgh
	9R1Lc42q6MCqefV4Mn0rrTb/Apjt9dRSEyTksYu+bGMbxgMDYDA25DxTEMOhU/ay6kFaDJNLctqwE
	eVjMIYim9mf/nNZSg/AYpkC+V/C0rRJKDULD5XdkyLIXyB9nCnUlXUwhXxv0gy+izdPo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEd5-0006R4-2x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEd5-0007l0-24
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] configure: fix malloc check
Message-Id: <E1kYEd5-0007l0-24@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:39 +0000

commit d1abf3fc6abc01fd5f8985af92726f87b5efd80a
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Jul 7 19:13:25 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    configure: fix malloc check
    
    Avoid random return value.
    
    Fixes commit f2dfe54c74f768a5bf78c9e5918918727f9d9459
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Message-Id: <20200707171326.16422-1-olaf@aepfle.de>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 814ed81279..f59418f6de 100755
--- a/configure
+++ b/configure
@@ -6343,6 +6343,7 @@ int main(void) {
     if (tmp != NULL) {
         return *(int *)(tmp + 2);
     }
+    return 1;
 }
 EOF
   if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:34:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:34:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14701.36354 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdH-0000of-Nw; Thu, 29 Oct 2020 20:34:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14701.36354; Thu, 29 Oct 2020 20:34:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdH-0000oV-Ko; Thu, 29 Oct 2020 20:34:51 +0000
Received: by outflank-mailman (input) for mailman id 14701;
 Thu, 29 Oct 2020 20:34:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEdG-0000oK-4p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8542c280-9e98-4e48-9167-3564ba696ba9;
 Thu, 29 Oct 2020 20:34:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdF-0006RD-7a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdF-0007m1-68
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEdG-0000oK-4p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:50 +0000
X-Inumbo-ID: 8542c280-9e98-4e48-9167-3564ba696ba9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8542c280-9e98-4e48-9167-3564ba696ba9;
	Thu, 29 Oct 2020 20:34:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A/462bLGKN4EwgF9oryXvxD4m9rVGgRlows4LOu30CU=; b=Usp4M3rKXC4S6GsWB2Pkvm9g1m
	D7dHHVjKolSaSalt1PnXBFy2W3QjXV/Upa/a1vUbUjfbg0V8Txlpb6D/HsnoUkXhLxlfsLPa2X4mt
	5QH7R1WrUmPmNIIr9rpoeK1V5iu/DBJsh6JUf63Q3XJaxlsdIqgRMrp6fJwmhkKBRmjY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdF-0006RD-7a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdF-0007m1-68
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] configure: do not clobber CFLAGS with --enable-fuzzing
Message-Id: <E1kYEdF-0007m1-68@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:49 +0000

commit 0ab6c2384ccae8968517f6883897509cd5f51a40
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Wed Jul 8 16:01:03 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    configure: do not clobber CFLAGS with --enable-fuzzing
    
    When configuring with --enable-fuzzing, we overwrote the CFLAGS
    added by all the preceding checks. Instead of overwriting CFLAGS, append
    the ones we need.
    
    Fixes: adc28027ff ("fuzz: add configure flag --enable-fuzzing")
    Reported-by: Li Qiang <liq3ea@163.com>
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200708200104.21978-2-alxndr@bu.edu>
    Tested-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f59418f6de..69a89113f7 100755
--- a/configure
+++ b/configure
@@ -7926,7 +7926,7 @@ if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
     FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
-    CFLAGS=" -fsanitize=address,fuzzer-no-link"
+    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
   else
     error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
     exit 1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14702.36358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdR-0000qZ-QV; Thu, 29 Oct 2020 20:35:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14702.36358; Thu, 29 Oct 2020 20:35:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdR-0000qR-NV; Thu, 29 Oct 2020 20:35:01 +0000
Received: by outflank-mailman (input) for mailman id 14702;
 Thu, 29 Oct 2020 20:35:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEdQ-0000qI-AL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 328349d6-9205-48c1-8791-a774094a7ad2;
 Thu, 29 Oct 2020 20:34:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdP-0006Ry-B9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdP-0007mz-AG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEdQ-0000qI-AL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:00 +0000
X-Inumbo-ID: 328349d6-9205-48c1-8791-a774094a7ad2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 328349d6-9205-48c1-8791-a774094a7ad2;
	Thu, 29 Oct 2020 20:34:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zow1P9GHEyyv0BHOflQ44hItj2Tg5tn9wgRanP9gF54=; b=jKC/VRW7jLHhTyu5DQqntVcaZs
	rlhuqOAUcGuQZpVfJbP4aYJMnO7Xf8G00iNXEa0pwhhEw426NrMpq0Br/9/K1M/HIORKT4px5wYfn
	BB75VTjIrvONA3pWwtkY8e/HEa7q/k8poQS1ToZCZ/lfEbSGXN3kt/Kd+pGfN44J7A2U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdP-0006Ry-B9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdP-0007mz-AG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:34:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fuzz: add missing header for rcu_enable_atfork
Message-Id: <E1kYEdP-0007mz-AG@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:34:59 +0000

commit 230225eaaa47f23acffef2f21f9bfb1e99b27b31
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Wed Jul 8 16:01:04 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    fuzz: add missing header for rcu_enable_atfork
    
    In 45222b9a90, I fixed a broken check for rcu_enable_atfork introduced
    in d6919e4cb6. I added a call to rcu_enable_atfork after the
    call to qemu_init in fuzz.c, but forgot to include the corresponding
    header, breaking --enable-fuzzing --enable-werror builds.
    
    Fixes: 45222b9a90 ("fuzz: fix broken qtest check at rcu_disable_atfork")
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200708200104.21978-3-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index a36d9038e0..0b66e43409 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -19,6 +19,7 @@
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
+#include "qemu/rcu.h"
 #include "tests/qtest/libqtest.h"
 #include "tests/qtest/libqos/qgraph.h"
 #include "fuzz.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14703.36362 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdb-0000rl-S0; Thu, 29 Oct 2020 20:35:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14703.36362; Thu, 29 Oct 2020 20:35:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdb-0000rd-P5; Thu, 29 Oct 2020 20:35:11 +0000
Received: by outflank-mailman (input) for mailman id 14703;
 Thu, 29 Oct 2020 20:35:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEda-0000rW-9S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f9cdf64d-10fd-430c-8da7-fcfec31f2077;
 Thu, 29 Oct 2020 20:35:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdZ-0006SH-F6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdZ-0007o8-EC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEda-0000rW-9S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:10 +0000
X-Inumbo-ID: f9cdf64d-10fd-430c-8da7-fcfec31f2077
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f9cdf64d-10fd-430c-8da7-fcfec31f2077;
	Thu, 29 Oct 2020 20:35:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a+RfX7LoioYpyEbKUfcPww1ApFgl59QCTzGN3LITpLU=; b=sUIj1Pp+iLbswfNRitIs0Xd7AF
	2LLCM2RvvMAeDYm5OXTekJbg7mfvIHqbKuS2G+vmBvRszOPV2aW9FhYi2VolF3zqueGXUQ0U++kzY
	Q7iS1C9dGFx8kEBTAquTTNTSZ0swO8EBdvD5UjEa1D2keP7nhoe2NdjSM4/3mjJ8oP2Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdZ-0006SH-F6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdZ-0007o8-EC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/qtest/fuzz: Add missing spaces in description
Message-Id: <E1kYEdZ-0007o8-EC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:35:09 +0000

commit 2c65fefa054fb8aa60b138efc48aa24e7d8e00bc
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 10:37:19 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    tests/qtest/fuzz: Add missing spaces in description
    
    There should be a space between "forking" and "for".
    
    Message-Id: <20200709083719.22221-1-thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/virtio_scsi_fuzz.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c
index 51dce491ab..3a9ea13736 100644
--- a/tests/qtest/fuzz/virtio_scsi_fuzz.c
+++ b/tests/qtest/fuzz/virtio_scsi_fuzz.c
@@ -191,7 +191,7 @@ static void register_virtio_scsi_fuzz_targets(void)
 {
     fuzz_add_qos_target(&(FuzzTarget){
                 .name = "virtio-scsi-fuzz",
-                .description = "Fuzz the virtio-scsi virtual queues, forking"
+                .description = "Fuzz the virtio-scsi virtual queues, forking "
                                 "for each fuzz run",
                 .pre_vm_init = &counter_shm_init,
                 .pre_fuzz = &virtio_scsi_pre_fuzz,
@@ -202,7 +202,7 @@ static void register_virtio_scsi_fuzz_targets(void)
 
     fuzz_add_qos_target(&(FuzzTarget){
                 .name = "virtio-scsi-flags-fuzz",
-                .description = "Fuzz the virtio-scsi virtual queues, forking"
+                .description = "Fuzz the virtio-scsi virtual queues, forking "
                 "for each fuzz run (also fuzzes the virtio flags)",
                 .pre_vm_init = &counter_shm_init,
                 .pre_fuzz = &virtio_scsi_pre_fuzz,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14704.36367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdl-0000t9-UP; Thu, 29 Oct 2020 20:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14704.36367; Thu, 29 Oct 2020 20:35:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdl-0000t1-Qb; Thu, 29 Oct 2020 20:35:21 +0000
Received: by outflank-mailman (input) for mailman id 14704;
 Thu, 29 Oct 2020 20:35:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEdk-0000st-Ai
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 49fbcf70-03fa-42be-9a8d-8abf92e77de1;
 Thu, 29 Oct 2020 20:35:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdj-0006SO-Ir
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdj-0007pJ-Hz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEdk-0000st-Ai
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:20 +0000
X-Inumbo-ID: 49fbcf70-03fa-42be-9a8d-8abf92e77de1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 49fbcf70-03fa-42be-9a8d-8abf92e77de1;
	Thu, 29 Oct 2020 20:35:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1tx9uBXOcmLWcgXir813MyX6cLne0F75iG8ooE4Kxc0=; b=nnHEGflardn7Dwx0PyKnhXce1+
	101gUK2s9NY6UQVWFd/Zk93Z1NjpjgmJ/okJ8wGxmsTJNRxJCJ+bd79HbQEUpmPnu65nmnngtN9aH
	OMdUyODNQmCmU+miCAh1PlfzZgeH74cp7k6jsz1fNzUBTqBKkIqeedZtmJoISO+8n/2Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdj-0006SO-Ir
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdj-0007pJ-Hz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/devel/fuzzing: Fix bugs in documentation
Message-Id: <E1kYEdj-0007pJ-Hz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:35:19 +0000

commit 590246ead7e5628e9e365c88aeb1ff3eab24de0d
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 10:40:59 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    docs/devel/fuzzing: Fix bugs in documentation
    
    Fix typo - the option is called "--fuzz-target" and not "--fuzz_taget".
    Also use a different fuzzer in the example, since "virtio-net-fork-fuzz"
    does not seem to be a valid fuzzer target (anymore?).
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200709084059.22539-1-thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 324d2cd92b..db5641de74 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -33,11 +33,11 @@ Fuzz targets are built similarly to system/softmmu:
 
 This builds ./i386-softmmu/qemu-fuzz-i386
 
-The first option to this command is: --fuzz_taget=FUZZ_NAME
+The first option to this command is: --fuzz-target=FUZZ_NAME
 To list all of the available fuzzers run qemu-fuzz-i386 with no arguments.
 
-eg:
-    ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=virtio-net-fork-fuzz
+For example:
+    ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=virtio-scsi-fuzz
 
 Internally, libfuzzer parses all arguments that do not begin with "--".
 Information about these is available by passing -help=1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14705.36370 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdw-0000uW-V9; Thu, 29 Oct 2020 20:35:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14705.36370; Thu, 29 Oct 2020 20:35:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEdw-0000uO-S9; Thu, 29 Oct 2020 20:35:32 +0000
Received: by outflank-mailman (input) for mailman id 14705;
 Thu, 29 Oct 2020 20:35:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEdu-0000uC-SJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1939a5c7-c808-42bf-ac84-24c38fe48251;
 Thu, 29 Oct 2020 20:35:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdt-0006Se-ND
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEdt-0007qY-MQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEdu-0000uC-SJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:30 +0000
X-Inumbo-ID: 1939a5c7-c808-42bf-ac84-24c38fe48251
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1939a5c7-c808-42bf-ac84-24c38fe48251;
	Thu, 29 Oct 2020 20:35:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e/Ozg26gZLbkzq3G7OfXO3plcvYiPKNLYoxpz7WuSMQ=; b=igijRFr4OnLYZaH/kA8JmHzS80
	lJmI/5rpwuvZJdRw+dJtnwZ+4iyHuSaDiDUkbjDdYOFjeTMJHcHDBWgZxZ8XMxzz5gO707PX8sdCT
	AmoghZLTp+iNj/QA1mZIWzaZNOyb2XtGGkwRNQy3TAOaNmU7G7zmOk+4ISrt8Y9U6cr4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdt-0006Se-ND
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEdt-0007qY-MQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
Message-Id: <E1kYEdt-0007qY-MQ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:35:29 +0000

commit 7aa12aa215e12ab2d41c60ba57e82d3e2af9f38e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 8 20:19:44 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
    
    GCC supports "#pragma GCC diagnostic" since version 4.6, and
    Clang seems to support it, too, since its early versions 3.x.
    That means that our minimum required compiler versions all support
    this pragma already and we can remove the test from configure and
    all the related #ifdefs in the code.
    
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200710045515.25986-1-thuth@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure                 | 29 -----------------------------
 include/ui/gtk.h          |  4 ----
 include/ui/qemu-pixman.h  |  4 ----
 scripts/decodetree.py     | 12 ++++--------
 ui/gtk.c                  |  4 ----
 util/coroutine-ucontext.c |  4 ++--
 6 files changed, 6 insertions(+), 51 deletions(-)

diff --git a/configure b/configure
index 69a89113f7..9b6ab9d3ca 100755
--- a/configure
+++ b/configure
@@ -5728,31 +5728,6 @@ if compile_prog "" "" ; then
     linux_magic_h=yes
 fi
 
-########################################
-# check whether we can disable warning option with a pragma (this is needed
-# to silence warnings in the headers of some versions of external libraries).
-# This test has to be compiled with -Werror as otherwise an unknown pragma is
-# only a warning.
-#
-# If we can't selectively disable warning in the code, disable -Werror so that
-# the build doesn't fail anyway.
-
-pragma_disable_unused_but_set=no
-cat > $TMPC << EOF
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#pragma GCC diagnostic pop
-
-int main(void) {
-    return 0;
-}
-EOF
-if compile_prog "-Werror" "" ; then
-    pragma_diagnostic_available=yes
-else
-    werror=no
-fi
-
 ########################################
 # check if we have valgrind/valgrind.h
 
@@ -7689,10 +7664,6 @@ if test "$linux_magic_h" = "yes" ; then
   echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
 fi
 
-if test "$pragma_diagnostic_available" = "yes" ; then
-  echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak
-fi
-
 if test "$valgrind_h" = "yes" ; then
   echo "CONFIG_VALGRIND_H=y" >> $config_host_mak
 fi
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index d1b230848a..eaeb450f91 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -1,15 +1,11 @@
 #ifndef UI_GTK_H
 #define UI_GTK_H
 
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 /* Work around an -Wstrict-prototypes warning in GTK headers */
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#endif
 #include <gtk/gtk.h>
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
 
 #include <gdk/gdkkeysyms.h>
 
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 3b7cf70157..87737a6f16 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -7,14 +7,10 @@
 #define QEMU_PIXMAN_H
 
 /* pixman-0.16.0 headers have a redundant declaration */
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wredundant-decls"
-#endif
 #include <pixman.h>
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
 
 /*
  * pixman image formats are defined to be native endian,
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 530d41ca62..694757b6c2 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -1327,12 +1327,10 @@ def main():
     # but we can't tell which ones.  Prevent issues from the compiler by
     # suppressing redundant declaration warnings.
     if anyextern:
-        output("#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE\n",
-               "# pragma GCC diagnostic push\n",
-               "# pragma GCC diagnostic ignored \"-Wredundant-decls\"\n",
-               "# ifdef __clang__\n"
+        output("#pragma GCC diagnostic push\n",
+               "#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n",
+               "#ifdef __clang__\n"
                "#  pragma GCC diagnostic ignored \"-Wtypedef-redefinition\"\n",
-               "# endif\n",
                "#endif\n\n")
 
     out_pats = {}
@@ -1347,9 +1345,7 @@ def main():
     output('\n')
 
     if anyextern:
-        output("#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE\n",
-               "# pragma GCC diagnostic pop\n",
-               "#endif\n\n")
+        output("#pragma GCC diagnostic pop\n\n")
 
     for n in sorted(formats.keys()):
         f = formats[n]
diff --git a/ui/gtk.c b/ui/gtk.c
index d4b49bd7da..b0cc08ad6d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1996,14 +1996,10 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
              * proper replacement (native opengl support) is only
              * available in 3.16+.  Silence the warning if possible.
              */
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
             gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE);
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
             vc->gfx.dcl.ops = &dcl_egl_ops;
         }
     } else
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index fff20aad80..904b375192 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -251,8 +251,8 @@ Coroutine *qemu_coroutine_new(void)
 }
 
 #ifdef CONFIG_VALGRIND_H
-#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && !defined(__clang__)
 /* Work around an unused variable in the valgrind.h macro... */
+#if !defined(__clang__)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #endif
@@ -260,7 +260,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co)
 {
     VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id);
 }
-#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && !defined(__clang__)
+#if !defined(__clang__)
 #pragma GCC diagnostic pop
 #endif
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14706.36374 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEe6-0000vd-0l; Thu, 29 Oct 2020 20:35:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14706.36374; Thu, 29 Oct 2020 20:35:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEe5-0000vT-Tb; Thu, 29 Oct 2020 20:35:41 +0000
Received: by outflank-mailman (input) for mailman id 14706;
 Thu, 29 Oct 2020 20:35:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEe4-0000vL-OA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 41cdb888-79ce-4adc-be19-ca517d0cc60c;
 Thu, 29 Oct 2020 20:35:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEe3-0006Sm-Qv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEe3-0007rY-QB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEe4-0000vL-OA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:40 +0000
X-Inumbo-ID: 41cdb888-79ce-4adc-be19-ca517d0cc60c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 41cdb888-79ce-4adc-be19-ca517d0cc60c;
	Thu, 29 Oct 2020 20:35:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hDh5UWxZW0KUwG2wAmRsESQmwACFU8ciz7vHr8ZZ9mc=; b=0O4Yh+k64gPunpTicGXSiRMDVd
	Wo/ynH8KXDzj2agLmkyvJ0WyAXSeAOhWM0yvCImXEV9fq0Q7huZKVr9mM8EnAva0d9dA/RIvZnFeJ
	XyL+w6+KsbxFpoeJ0EP8/XaYakuml5+22S9DvQZwh2fyJZ2onVZoJ72tnOVyWWZkMcCQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEe3-0006Sm-Qv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEe3-0007rY-QB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] disas/sh4: Add missing fallthrough annotations
Message-Id: <E1kYEe3-0007rY-QB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:35:39 +0000

commit ccb237090fdafedce56cb8b62f451a09ad5031c9
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jun 30 07:03:44 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    disas/sh4: Add missing fallthrough annotations
    
    Add fallthrough annotations to be able to compile the code without
    warnings with -Wimplicit-fallthrough. Looking at the code, it seems
    like the fallthrough is indeed intended here, so the comments should
    be appropriate.
    
    Message-Id: <20200630055953.9309-1-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 disas/sh4.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/disas/sh4.c b/disas/sh4.c
index 55ef865a36..dcdbdf26d8 100644
--- a/disas/sh4.c
+++ b/disas/sh4.c
@@ -1963,6 +1963,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rn & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_N:
 	      fprintf_fn (stream, "dr%d", rn);
 	      break;
@@ -1972,6 +1973,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rm & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_M:
 	      fprintf_fn (stream, "dr%d", rm);
 	      break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:35:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:35:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14707.36378 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEeG-0000x1-2F; Thu, 29 Oct 2020 20:35:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14707.36378; Thu, 29 Oct 2020 20:35:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEeF-0000wr-V9; Thu, 29 Oct 2020 20:35:51 +0000
Received: by outflank-mailman (input) for mailman id 14707;
 Thu, 29 Oct 2020 20:35:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEeE-0000wi-W7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c4feeec1-0790-48e3-b9d9-30348c00d7e3;
 Thu, 29 Oct 2020 20:35:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeD-0006Su-Ug
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeD-0007sK-Tq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEeE-0000wi-W7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:51 +0000
X-Inumbo-ID: c4feeec1-0790-48e3-b9d9-30348c00d7e3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c4feeec1-0790-48e3-b9d9-30348c00d7e3;
	Thu, 29 Oct 2020 20:35:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gyHWsQTaBytNWTe4S5e6hyAjj81j0Y1jye+f/v4M8fE=; b=oV3wvtmg9SvBxEwsP+IAL3ibXy
	nWURBOd7JW2LYD6ImsjdclsQLxiDFWx72eXgymhk3gquQkWzk60TojrL2Cm35fUHclBLH7ZBndO6Y
	gdm6xnw7ztJS9FEg+q8XGXUzT8wMF2zuVAvIc3GqrtjEHKWDUl4WMLF54OxrdFUgv4j4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeD-0006Su-Ug
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeD-0007sK-Tq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:35:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] GitLab Gating CI: introduce pipeline-status contrib script
Message-Id: <E1kYEeD-0007sK-Tq@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:35:49 +0000

commit c02b2eac55ef72dd17b2ea8408c312d83f9e0482
Author:     Cleber Rosa <crosa@redhat.com>
AuthorDate: Wed Jul 8 22:46:56 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    GitLab Gating CI: introduce pipeline-status contrib script
    
    This script is intended to be used right after a push to a branch.
    
    By default, it will look for the pipeline associated with the commit
    that is the HEAD of the *local* staging branch.  It can be used as a
    one time check, or with the `--wait` option to wait until the pipeline
    completes.
    
    If the pipeline is successful, then a merge of the staging branch into
    the master branch should be the next step.
    
    Signed-off-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200709024657.2500558-2-crosa@redhat.com>
    [thuth: Added the changes suggested by Erik Skultety]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/ci/gitlab-pipeline-status | 157 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)

diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline-status
new file mode 100755
index 0000000000..348a49b6a4
--- /dev/null
+++ b/scripts/ci/gitlab-pipeline-status
@@ -0,0 +1,157 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2019-2020 Red Hat, Inc.
+#
+# Author:
+#  Cleber Rosa <crosa@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later.  See the COPYING file in the top-level directory.
+
+"""
+Checks the GitLab pipeline status for a given commit ID
+"""
+
+# pylint: disable=C0103
+
+import argparse
+import http.client
+import json
+import os
+import subprocess
+import time
+import sys
+
+
+def get_local_staging_branch_commit():
+    """
+    Returns the commit sha1 for the *local* branch named "staging"
+    """
+    result = subprocess.run(['git', 'rev-parse', 'staging'],
+                            stdin=subprocess.DEVNULL,
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.DEVNULL,
+                            cwd=os.path.dirname(__file__),
+                            universal_newlines=True).stdout.strip()
+    if result == 'staging':
+        raise ValueError("There's no local branch named 'staging'")
+    if len(result) != 40:
+        raise ValueError("Branch staging HEAD doesn't look like a sha1")
+    return result
+
+
+def get_pipeline_status(project_id, commit_sha1):
+    """
+    Returns the JSON content of the pipeline status API response
+    """
+    url = '/api/v4/projects/{}/pipelines?sha={}'.format(project_id,
+                                                        commit_sha1)
+    connection = http.client.HTTPSConnection('gitlab.com')
+    connection.request('GET', url=url)
+    response = connection.getresponse()
+    if response.code != http.HTTPStatus.OK:
+        raise ValueError("Failed to receive a successful response")
+    json_response = json.loads(response.read())
+
+    # As far as I can tell, there should be only one pipeline for the same
+    # project + commit. If this assumption is false, we can add further
+    # filters to the url, such as username, and order_by.
+    if not json_response:
+        raise ValueError("No pipeline found")
+    return json_response[0]
+
+
+def wait_on_pipeline_success(timeout, interval,
+                             project_id, commit_sha):
+    """
+    Waits for the pipeline to finish within the given timeout
+    """
+    start = time.time()
+    while True:
+        if time.time() >= (start + timeout):
+            print("Waiting on the pipeline timed out")
+            return False
+
+        status = get_pipeline_status(project_id, commit_sha)
+        if status['status'] == 'running':
+            time.sleep(interval)
+            print('running...')
+            continue
+
+        if status['status'] == 'success':
+            return True
+
+        msg = "Pipeline failed, check: %s" % status['web_url']
+        print(msg)
+        return False
+
+
+def main():
+    """
+    Script entry point
+    """
+    parser = argparse.ArgumentParser(
+        prog='pipeline-status',
+        description='check or wait on a pipeline status')
+
+    parser.add_argument('-t', '--timeout', type=int, default=7200,
+                        help=('Amount of time (in seconds) to wait for the '
+                              'pipeline to complete.  Defaults to '
+                              '%(default)s'))
+    parser.add_argument('-i', '--interval', type=int, default=60,
+                        help=('Amount of time (in seconds) to wait between '
+                              'checks of the pipeline status.  Defaults '
+                              'to %(default)s'))
+    parser.add_argument('-w', '--wait', action='store_true', default=False,
+                        help=('Wether to wait, instead of checking only once '
+                              'the status of a pipeline'))
+    parser.add_argument('-p', '--project-id', type=int, default=11167699,
+                        help=('The GitLab project ID. Defaults to the project '
+                              'for https://gitlab.com/qemu-project/qemu, that '
+                              'is, "%(default)s"'))
+    try:
+        default_commit = get_local_staging_branch_commit()
+        commit_required = False
+    except ValueError:
+        default_commit = ''
+        commit_required = True
+    parser.add_argument('-c', '--commit', required=commit_required,
+                        default=default_commit,
+                        help=('Look for a pipeline associated with the given '
+                              'commit.  If one is not explicitly given, the '
+                              'commit associated with the local branch named '
+                              '"staging" is used.  Default: %(default)s'))
+    parser.add_argument('--verbose', action='store_true', default=False,
+                        help=('A minimal verbosity level that prints the '
+                              'overall result of the check/wait'))
+
+    args = parser.parse_args()
+
+    try:
+        if args.wait:
+            success = wait_on_pipeline_success(
+                args.timeout,
+                args.interval,
+                args.project_id,
+                args.commit)
+        else:
+            status = get_pipeline_status(args.project_id,
+                                         args.commit)
+            success = status['status'] == 'success'
+    except Exception as error:      # pylint: disable=W0703
+        success = False
+        if args.verbose:
+            print("ERROR: %s" % error.args[0])
+
+    if success:
+        if args.verbose:
+            print('success')
+        sys.exit(0)
+    else:
+        if args.verbose:
+            print('failure')
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:36:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:36:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14708.36382 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEeQ-0000z0-4j; Thu, 29 Oct 2020 20:36:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14708.36382; Thu, 29 Oct 2020 20:36:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEeQ-0000ys-1f; Thu, 29 Oct 2020 20:36:02 +0000
Received: by outflank-mailman (input) for mailman id 14708;
 Thu, 29 Oct 2020 20:36:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEeP-0000yl-LR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5c0d4c51-eaf3-4753-b1b4-e6daee50fd21;
 Thu, 29 Oct 2020 20:36:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeO-0006TS-2P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeO-0007ss-1D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEeP-0000yl-LR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:01 +0000
X-Inumbo-ID: 5c0d4c51-eaf3-4753-b1b4-e6daee50fd21
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5c0d4c51-eaf3-4753-b1b4-e6daee50fd21;
	Thu, 29 Oct 2020 20:36:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OLJy2rFWqT9pF+ztkagwT22NV+z9zDJqLxuVI3ljCOE=; b=yyAi22l9jA/nSU5LzhYtJhA6vE
	Uhy8kqRtMp+n0q2IZjRofo5VHQyCbQWotVUlr2jJLmNTj9HowhL3oYrI+NJfPqn5VzDkk266Z4WNf
	gNPxtrW7lAjXksYxcschjIUUkpJDzWQwBEF91eK55xvjEBDeh1qtqxUu+ydaJeZxaZfg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeO-0006TS-2P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeO-0007ss-1D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system/s390x: Improve the 3270 documentation
Message-Id: <E1kYEeO-0007ss-1D@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:36:00 +0000

commit 2a84f48c2b387877422ee85f6425d2c1b25bace0
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 18:00:39 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    docs/system/s390x: Improve the 3270 documentation
    
    There is some additional information about the 3270 support in our Wiki
    at https://wiki.qemu.org/Features/3270 - so let's include this information
    into the main documentation now to have one single source of information
    (the Wiki page could later be removed).
    
    While at it, I also shortened the lines of the first example a little bit.
    Otherwise they showed up with a horizontal scrollbar in my Firefox browser.
    
    Message-Id: <20200713075112.442-1-thuth@redhat.com>
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/system/s390x/3270.rst | 43 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 37 insertions(+), 6 deletions(-)

diff --git a/docs/system/s390x/3270.rst b/docs/system/s390x/3270.rst
index 1774cdcadf..0554a70a9f 100644
--- a/docs/system/s390x/3270.rst
+++ b/docs/system/s390x/3270.rst
@@ -1,9 +1,15 @@
 3270 devices
 ============
 
-QEMU supports connecting an external 3270 terminal emulator (such as
-``x3270``) to make a single 3270 device available to a guest. Note that this
-supports basic features only.
+The 3270 is the classic 'green-screen' console of the mainframes (see the
+`IBM 3270 Wikipedia article <https://en.wikipedia.org/wiki/IBM_3270>`__).
+
+The 3270 data stream is not implemented within QEMU; the device only provides
+TN3270 (a telnet extension; see `RFC 854 <https://tools.ietf.org/html/rfc854>`__
+and `RFC 1576 <https://tools.ietf.org/html/rfc1576>`__) and leaves the heavy
+lifting to an external 3270 terminal emulator (such as ``x3270``) to make a
+single 3270 device available to a guest. Note that this supports basic
+features only.
 
 To provide a 3270 device to a guest, create a ``x-terminal3270`` linked to
 a ``tn3270`` chardev. The guest will see a 3270 channel device. In order
@@ -12,10 +18,14 @@ to actually be able to use it, attach the ``x3270`` emulator to the chardev.
 Example configuration
 ---------------------
 
+* Make sure that 3270 support is enabled in the guest's Linux kernel. You need
+  ``CONFIG_TN3270`` and at least one of ``CONFIG_TN3270_TTY`` (for additional
+  ttys) or ``CONFIG_TN3270_CONSOLE`` (for a 3270 console).
+
 * Add a ``tn3270`` chardev and a ``x-terminal3270`` to the QEMU command line::
 
-    -chardev socket,id=char_0,host=0.0.0.0,port=2300,nowait,server,tn3270
-    -device x-terminal3270,chardev=char_0,devno=fe.0.000a,id=terminal_0
+   -chardev socket,id=ch0,host=0.0.0.0,port=2300,nowait,server,tn3270
+   -device x-terminal3270,chardev=ch0,devno=fe.0.000a,id=terminal0
 
 * Start the guest. In the guest, use ``chccwdev -e 0.0.000a`` to enable
   the device.
@@ -29,4 +39,25 @@ Example configuration
 
     systemctl start serial-getty@3270-tty1.service
 
-This should get you an addtional tty for logging into the guest.
+  This should get you an additional tty for logging into the guest.
+
+* If you want to use the 3270 device as the Linux kernel console instead of
+  an additional tty, you can also append ``conmode=3270 condev=000a`` to
+  the guest's kernel command line. The kernel then should use the 3270 as
+  console after the next boot.
+
+Restrictions
+------------
+
+3270 support is very basic. In particular:
+
+* Only one 3270 device is supported.
+
+* It has only been tested with Linux guests and the x3270 emulator.
+
+* TLS/SSL is not supported.
+
+* Resizing on reattach is not supported.
+
+* Multiple commands in one inbound buffer (for example, when the reset key
+  is pressed while the network is slow) are not supported.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:36:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:36:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14709.36386 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEea-00010H-69; Thu, 29 Oct 2020 20:36:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14709.36386; Thu, 29 Oct 2020 20:36:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEea-000109-3C; Thu, 29 Oct 2020 20:36:12 +0000
Received: by outflank-mailman (input) for mailman id 14709;
 Thu, 29 Oct 2020 20:36:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEeZ-000101-DK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee798fa8-572f-460c-a1e1-8c70be0abfe4;
 Thu, 29 Oct 2020 20:36:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeY-0006Tn-6r
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEeY-0007tw-5v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEeZ-000101-DK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:11 +0000
X-Inumbo-ID: ee798fa8-572f-460c-a1e1-8c70be0abfe4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee798fa8-572f-460c-a1e1-8c70be0abfe4;
	Thu, 29 Oct 2020 20:36:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=A7uZiwFg/qfEqLfy2rJ0IiYHx23mpzsBwOMSLIzoXJ8=; b=sy/BOE7LQMHgO/vXzepD0JOztn
	8FqxZi9tLOye4bqGCoPBytqMbbKWmASi8ZL068Y9ydcxQR39APXmM/azebKuhUbZSmS5V3rOFZaRc
	2vryxxEA+KdTDEJyw6C6vM74EpAQX/eDOz7/4tZcw8iKooEsI9FJK8I21NwXimVdQzxk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeY-0006Tn-6r
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEeY-0007tw-5v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging
Message-Id: <E1kYEeY-0007tw-5v@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:36:10 +0000

commit 00ce6c36b35e0eb8cc5d68a28f288a6335848813
Merge: 6c87d9f311dba0641bdc2df556056938a8bf2a12 2a84f48c2b387877422ee85f6425d2c1b25bace0
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 13:01:30 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 13:01:30 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging
    
    * Some fuzzer related fixes
    * Fixes / improvements for the "configure" script
    * Doc updates
    * Gitlab pipeline-status script
    
    # gpg: Signature made Mon 13 Jul 2020 11:48:32 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-13:
      docs/system/s390x: Improve the 3270 documentation
      GitLab Gating CI: introduce pipeline-status contrib script
      disas/sh4: Add missing fallthrough annotations
      Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
      docs/devel/fuzzing: Fix bugs in documentation
      tests/qtest/fuzz: Add missing spaces in description
      fuzz: add missing header for rcu_enable_atfork
      configure: do not clobber CFLAGS with --enable-fuzzing
      configure: fix malloc check
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 configure                           |  32 +-------
 disas/sh4.c                         |   2 +
 docs/devel/fuzzing.txt              |   6 +-
 docs/system/s390x/3270.rst          |  43 ++++++++--
 include/ui/gtk.h                    |   4 -
 include/ui/qemu-pixman.h            |   4 -
 scripts/ci/gitlab-pipeline-status   | 157 ++++++++++++++++++++++++++++++++++++
 scripts/decodetree.py               |  12 +--
 tests/qtest/fuzz/fuzz.c             |   1 +
 tests/qtest/fuzz/virtio_scsi_fuzz.c |   4 +-
 ui/gtk.c                            |   4 -
 util/coroutine-ucontext.c           |   4 +-
 12 files changed, 210 insertions(+), 63 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:36:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:36:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14710.36390 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEem-00011c-80; Thu, 29 Oct 2020 20:36:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14710.36390; Thu, 29 Oct 2020 20:36:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEem-00011U-4w; Thu, 29 Oct 2020 20:36:24 +0000
Received: by outflank-mailman (input) for mailman id 14710;
 Thu, 29 Oct 2020 20:36:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEel-00011O-Fy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cc803695-1fda-43d0-b48d-e654ec0ad644;
 Thu, 29 Oct 2020 20:36:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEei-0006U2-VK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEei-0007xV-Ua
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEel-00011O-Fy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:23 +0000
X-Inumbo-ID: cc803695-1fda-43d0-b48d-e654ec0ad644
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cc803695-1fda-43d0-b48d-e654ec0ad644;
	Thu, 29 Oct 2020 20:36:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rzkpW3nlNO6fQQ/mm7TfW/r7lKmy2A7mmLHyTUpH1mw=; b=l+vxOcGzWgKJGmZBJSSJlekdwT
	Db5ZMC6mwJxJpij0XPYyY2mfgAzCvvmkwYs6mz47cfmfZ4X9QweihnQ2APtwXD/UQWtmhvBvzd/hw
	QiV5FSNxm9J3tj4otCwo1ujzQ/Rd7fCmP8IwuwAOKiQ0P5kBzJccR0nj0t7FA61Ujg9E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEei-0006U2-VK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEei-0007xV-Ua
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:36:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200713' into staging
Message-Id: <E1kYEei-0007xV-Ua@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:36:20 +0000

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

commit 5c65b1f135ff09d24827fa3a17e56a4f8a032cd5
Merge: 00ce6c36b35e0eb8cc5d68a28f288a6335848813 756f739b1682bf131994ec96dad7fbdf8b54493a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 15:14:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 15:14:48 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200713' into staging
    
    target-arm queue:
     * hw/arm/bcm2836: Remove unused 'cpu_type' field
     * target/arm: Fix mtedesc for do_mem_zpz
     * Add the ability to change the FEC PHY MDIO device number on i.MX25/i.MX6/i.MX7
     * target/arm: Don't do raw writes for PMINTENCLR
     * virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
     * build: Fix various issues with building on Haiku
     * target/nios2: fix wrctl behaviour when using icount
     * hw/arm/tosa: Encapsulate misc GPIO handling in a device
     * hw/arm/palm.c: Encapsulate misc GPIO handling in a device
     * hw/arm/aspeed: Do not create and attach empty SD cards by default
    
    # gpg: Signature made Mon 13 Jul 2020 15:08:16 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200713: (25 commits)
      hw/arm/aspeed: Do not create and attach empty SD cards by default
      hw/arm/palm.c: Encapsulate misc GPIO handling in a device
      hw/arm/palm.c: Detabify
      hw/arm/tosa: Encapsulate misc GPIO handling in a device
      hw/arm/tosa.c: Detabify
      hw/nios2: exit to main CPU loop only when unmasking interrupts
      target/nios2: Use gen_io_start around wrctl instruction
      target/nios2: in line the semantics of DISAS_UPDATE with other targets
      target/nios2: add DISAS_NORETURN case for nothing more to generate
      util/drm: make portable by avoiding struct dirent d_type
      util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku
      util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD
      bswap.h: Include <endian.h> on Haiku for bswap operations
      osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL
      osdep.h: Always include <sys/signal.h> if it exists
      build: Check that mlockall() exists
      util/qemu-openpty.c: Don't assume pty.h is glibc-only
      build: Enable BSD symbols for Haiku
      virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
      target/arm: Don't do raw writes for PMINTENCLR
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 configure                   |  38 +++++++++++-
 hw/arm/aspeed.c             |   9 +--
 hw/arm/fsl-imx25.c          |   7 +++
 hw/arm/fsl-imx6.c           |   7 +++
 hw/arm/fsl-imx7.c           |   9 +++
 hw/arm/palm.c               | 111 ++++++++++++++++++++++++-----------
 hw/arm/tosa.c               | 140 ++++++++++++++++++++++++++++----------------
 hw/nios2/cpu_pic.c          |   3 +-
 hw/virtio/virtio-iommu.c    |   1 +
 hw/xen/xen-legacy-backend.c |   1 -
 include/hw/arm/bcm2836.h    |   1 -
 include/hw/arm/fsl-imx25.h  |   1 +
 include/hw/arm/fsl-imx6.h   |   1 +
 include/hw/arm/fsl-imx7.h   |   1 +
 include/qemu/bswap.h        |   2 +
 include/qemu/osdep.h        |   6 +-
 os-posix.c                  |   4 ++
 target/arm/helper.c         |   4 +-
 target/arm/translate-sve.c  |   2 +-
 target/nios2/translate.c    |  12 +++-
 util/compatfd.c             |   2 +
 util/drm.c                  |  19 ++++--
 util/oslib-posix.c          |  20 ++++++-
 util/qemu-openpty.c         |   2 +-
 24 files changed, 296 insertions(+), 107 deletions(-)

diff --git a/configure b/configure
index 9b6ab9d3ca..bc3b9ad931 100755
--- a/configure
+++ b/configure
@@ -904,8 +904,8 @@ SunOS)
 ;;
 Haiku)
   haiku="yes"
-  QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
-  LIBS="-lposix_error_mapper -lnetwork $LIBS"
+  QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS"
+  LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS"
 ;;
 Linux)
   audio_drv_list="try-pa oss"
@@ -2402,6 +2402,24 @@ else
   l2tpv3=no
 fi
 
+if check_include "pty.h" ; then
+  pty_h=yes
+else
+  pty_h=no
+fi
+
+cat > $TMPC <<EOF
+#include <sys/mman.h>
+int main(int argc, char *argv[]) {
+    return mlockall(MCL_FUTURE);
+}
+EOF
+if compile_prog "" "" ; then
+  have_mlockall=yes
+else
+  have_mlockall=no
+fi
+
 #########################################
 # vhost interdependencies and host support
 
@@ -3226,6 +3244,13 @@ if check_include "libdrm/drm.h" ; then
     have_drm_h=yes
 fi
 
+#########################################
+# sys/signal.h check
+have_sys_signal_h=no
+if check_include "sys/signal.h" ; then
+  have_sys_signal_h=yes
+fi
+
 ##########################################
 # VTE probe
 
@@ -7415,6 +7440,9 @@ fi
 if test "$have_openpty" = "yes" ; then
     echo "HAVE_OPENPTY=y" >> $config_host_mak
 fi
+if test "$have_sys_signal_h" = "yes" ; then
+    echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
@@ -7893,6 +7921,12 @@ fi
 if test "$sheepdog" = "yes" ; then
   echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
 fi
+if test "$pty_h" = "yes" ; then
+  echo "HAVE_PTY_H=y" >> $config_host_mak
+fi
+if test "$have_mlockall" = "yes" ; then
+  echo "HAVE_MLOCKALL=y" >> $config_host_mak
+fi
 if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 660dcb5414..6a3a345a6f 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -246,11 +246,12 @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo)
 {
         DeviceState *card;
 
-        card = qdev_new(TYPE_SD_CARD);
-        if (dinfo) {
-            qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
-                                    &error_fatal);
+        if (!dinfo) {
+            return;
         }
+        card = qdev_new(TYPE_SD_CARD);
+        qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
+                                &error_fatal);
         qdev_realize_and_unref(card,
                                qdev_get_child_bus(DEVICE(sdhci), "sd-bus"),
                                &error_fatal);
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index b4ddceae45..08a98f828f 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -171,6 +171,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
                                             epit_table[i].irq));
     }
 
+    object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err);
     qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) {
@@ -315,10 +316,16 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
                                 &s->iram_alias);
 }
 
+static Property fsl_imx25_properties[] = {
+    DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx25_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx25_properties);
     dc->realize = fsl_imx25_realize;
     dc->desc = "i.MX25 SOC";
     /*
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 0bc9f0b60d..00dafe3f62 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -377,6 +377,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                             spi_table[i].irq));
     }
 
+    object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err);
     qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) {
         return;
@@ -449,10 +450,16 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                 &s->ocram_alias);
 }
 
+static Property fsl_imx6_properties[] = {
+    DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx6_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx6_properties);
     dc->realize = fsl_imx6_realize;
     dc->desc = "i.MX6 SOC";
     /* Reason: Uses serial_hd() in the realize() function */
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index fad637d328..2ff2cab924 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -363,6 +363,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
             FSL_IMX7_ENET2_ADDR,
         };
 
+        object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
+                                 s->phy_num[i], &error_abort);
         object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
                                  FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
         qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
@@ -550,10 +552,17 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
                                 FSL_IMX7_PCIE_PHY_SIZE);
 }
 
+static Property fsl_imx7_properties[] = {
+    DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0),
+    DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx7_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx7_properties);
     dc->realize = fsl_imx7_realize;
 
     /* Reason: Uses serial_hds and nd_table in realize() directly */
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index 97ca105d29..e7bc9ea4c6 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -61,21 +61,21 @@ static const MemoryRegionOps static_ops = {
 /* Palm Tunsgten|E support */
 
 /* Shared GPIOs */
-#define PALMTE_USBDETECT_GPIO	0
-#define PALMTE_USB_OR_DC_GPIO	1
-#define PALMTE_TSC_GPIO		4
-#define PALMTE_PINTDAV_GPIO	6
-#define PALMTE_MMC_WP_GPIO	8
-#define PALMTE_MMC_POWER_GPIO	9
-#define PALMTE_HDQ_GPIO		11
-#define PALMTE_HEADPHONES_GPIO	14
-#define PALMTE_SPEAKER_GPIO	15
+#define PALMTE_USBDETECT_GPIO   0
+#define PALMTE_USB_OR_DC_GPIO   1
+#define PALMTE_TSC_GPIO                 4
+#define PALMTE_PINTDAV_GPIO     6
+#define PALMTE_MMC_WP_GPIO      8
+#define PALMTE_MMC_POWER_GPIO   9
+#define PALMTE_HDQ_GPIO                 11
+#define PALMTE_HEADPHONES_GPIO  14
+#define PALMTE_SPEAKER_GPIO     15
 /* MPU private GPIOs */
-#define PALMTE_DC_GPIO		2
-#define PALMTE_MMC_SWITCH_GPIO	4
-#define PALMTE_MMC1_GPIO	6
-#define PALMTE_MMC2_GPIO	7
-#define PALMTE_MMC3_GPIO	11
+#define PALMTE_DC_GPIO          2
+#define PALMTE_MMC_SWITCH_GPIO  4
+#define PALMTE_MMC1_GPIO        6
+#define PALMTE_MMC2_GPIO        7
+#define PALMTE_MMC3_GPIO        11
 
 static MouseTransformInfo palmte_pointercal = {
     .x = 320,
@@ -100,17 +100,17 @@ static struct {
     int column;
 } palmte_keymap[0x80] = {
     [0 ... 0x7f] = { -1, -1 },
-    [0x3b] = { 0, 0 },	/* F1	-> Calendar */
-    [0x3c] = { 1, 0 },	/* F2	-> Contacts */
-    [0x3d] = { 2, 0 },	/* F3	-> Tasks List */
-    [0x3e] = { 3, 0 },	/* F4	-> Note Pad */
-    [0x01] = { 4, 0 },	/* Esc	-> Power */
-    [0x4b] = { 0, 1 },	/* 	   Left */
-    [0x50] = { 1, 1 },	/* 	   Down */
-    [0x48] = { 2, 1 },	/*	   Up */
-    [0x4d] = { 3, 1 },	/*	   Right */
-    [0x4c] = { 4, 1 },	/* 	   Centre */
-    [0x39] = { 4, 1 },	/* Spc	-> Centre */
+    [0x3b] = { 0, 0 },  /* F1   -> Calendar */
+    [0x3c] = { 1, 0 },  /* F2   -> Contacts */
+    [0x3d] = { 2, 0 },  /* F3   -> Tasks List */
+    [0x3e] = { 3, 0 },  /* F4   -> Note Pad */
+    [0x01] = { 4, 0 },  /* Esc  -> Power */
+    [0x4b] = { 0, 1 },  /*         Left */
+    [0x50] = { 1, 1 },  /*         Down */
+    [0x48] = { 2, 1 },  /*         Up */
+    [0x4d] = { 3, 1 },  /*         Right */
+    [0x4c] = { 4, 1 },  /*         Centre */
+    [0x39] = { 4, 1 },  /* Spc  -> Centre */
 };
 
 static void palmte_button_event(void *opaque, int keycode)
@@ -124,6 +124,21 @@ static void palmte_button_event(void *opaque, int keycode)
                         !(keycode & 0x80));
 }
 
+/*
+ * Encapsulation of some GPIO line behaviour for the Palm board
+ *
+ * QEMU interface:
+ *  + unnamed GPIO inputs 0..6: for the various miscellaneous input lines
+ */
+
+#define TYPE_PALM_MISC_GPIO "palm-misc-gpio"
+#define PALM_MISC_GPIO(obj) \
+    OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO)
+
+typedef struct PalmMiscGPIOState {
+    SysBusDevice parent_obj;
+} PalmMiscGPIOState;
+
 static void palmte_onoff_gpios(void *opaque, int line, int level)
 {
     switch (line) {
@@ -151,23 +166,44 @@ static void palmte_onoff_gpios(void *opaque, int line, int level)
     }
 }
 
+static void palm_misc_gpio_init(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    qdev_init_gpio_in(dev, palmte_onoff_gpios, 7);
+}
+
+static const TypeInfo palm_misc_gpio_info = {
+    .name = TYPE_PALM_MISC_GPIO,
+    .parent = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(PalmMiscGPIOState),
+    .instance_init = palm_misc_gpio_init,
+    /*
+     * No class init required: device has no internal state so does not
+     * need to set up reset or vmstate, and has no realize method.
+     */
+};
+
 static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
 {
-    qemu_irq *misc_gpio;
+    DeviceState *misc_gpio;
+
+    misc_gpio = sysbus_create_simple(TYPE_PALM_MISC_GPIO, -1, NULL);
 
     omap_mmc_handlers(cpu->mmc,
                     qdev_get_gpio_in(cpu->gpio, PALMTE_MMC_WP_GPIO),
                     qemu_irq_invert(omap_mpuio_in_get(cpu->mpuio)
                             [PALMTE_MMC_SWITCH_GPIO]));
 
-    misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7);
-    qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,	misc_gpio[0]);
-    qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,	misc_gpio[1]);
-    qdev_connect_gpio_out(cpu->gpio, 11,			misc_gpio[2]);
-    qdev_connect_gpio_out(cpu->gpio, 12,			misc_gpio[3]);
-    qdev_connect_gpio_out(cpu->gpio, 13,			misc_gpio[4]);
-    omap_mpuio_out_set(cpu->mpuio, 1,				misc_gpio[5]);
-    omap_mpuio_out_set(cpu->mpuio, 3,				misc_gpio[6]);
+    qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,
+                          qdev_get_gpio_in(misc_gpio, 0));
+    qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,
+                          qdev_get_gpio_in(misc_gpio, 1));
+    qdev_connect_gpio_out(cpu->gpio, 11, qdev_get_gpio_in(misc_gpio, 2));
+    qdev_connect_gpio_out(cpu->gpio, 12, qdev_get_gpio_in(misc_gpio, 3));
+    qdev_connect_gpio_out(cpu->gpio, 13, qdev_get_gpio_in(misc_gpio, 4));
+    omap_mpuio_out_set(cpu->mpuio, 1, qdev_get_gpio_in(misc_gpio, 5));
+    omap_mpuio_out_set(cpu->mpuio, 3, qdev_get_gpio_in(misc_gpio, 6));
 
     /* Reset some inputs to initial state.  */
     qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));
@@ -276,3 +312,10 @@ static void palmte_machine_init(MachineClass *mc)
 }
 
 DEFINE_MACHINE("cheetah", palmte_machine_init)
+
+static void palm_register_types(void)
+{
+    type_register_static(&palm_misc_gpio_info);
+}
+
+type_init(palm_register_types)
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 5dee2d76c6..383b3b22e2 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -26,32 +26,32 @@
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
 
-#define TOSA_RAM    0x04000000
-#define TOSA_ROM	0x00800000
-
-#define TOSA_GPIO_USB_IN		(5)
-#define TOSA_GPIO_nSD_DETECT	(9)
-#define TOSA_GPIO_ON_RESET		(19)
-#define TOSA_GPIO_CF_IRQ		(21)	/* CF slot0 Ready */
-#define TOSA_GPIO_CF_CD			(13)
-#define TOSA_GPIO_TC6393XB_INT  (15)
-#define TOSA_GPIO_JC_CF_IRQ		(36)	/* CF slot1 Ready */
-
-#define TOSA_SCOOP_GPIO_BASE	1
-#define TOSA_GPIO_IR_POWERDWN	(TOSA_SCOOP_GPIO_BASE + 2)
-#define TOSA_GPIO_SD_WP			(TOSA_SCOOP_GPIO_BASE + 3)
-#define TOSA_GPIO_PWR_ON		(TOSA_SCOOP_GPIO_BASE + 4)
-
-#define TOSA_SCOOP_JC_GPIO_BASE		1
-#define TOSA_GPIO_BT_LED		(TOSA_SCOOP_JC_GPIO_BASE + 0)
-#define TOSA_GPIO_NOTE_LED		(TOSA_SCOOP_JC_GPIO_BASE + 1)
-#define TOSA_GPIO_CHRG_ERR_LED		(TOSA_SCOOP_JC_GPIO_BASE + 2)
-#define TOSA_GPIO_TC6393XB_L3V_ON	(TOSA_SCOOP_JC_GPIO_BASE + 5)
-#define TOSA_GPIO_WLAN_LED		(TOSA_SCOOP_JC_GPIO_BASE + 7)
-
-#define	DAC_BASE	0x4e
-#define DAC_CH1		0
-#define DAC_CH2		1
+#define TOSA_RAM 0x04000000
+#define TOSA_ROM 0x00800000
+
+#define TOSA_GPIO_USB_IN                (5)
+#define TOSA_GPIO_nSD_DETECT            (9)
+#define TOSA_GPIO_ON_RESET              (19)
+#define TOSA_GPIO_CF_IRQ                (21)    /* CF slot0 Ready */
+#define TOSA_GPIO_CF_CD                 (13)
+#define TOSA_GPIO_TC6393XB_INT          (15)
+#define TOSA_GPIO_JC_CF_IRQ             (36)    /* CF slot1 Ready */
+
+#define TOSA_SCOOP_GPIO_BASE            1
+#define TOSA_GPIO_IR_POWERDWN           (TOSA_SCOOP_GPIO_BASE + 2)
+#define TOSA_GPIO_SD_WP                 (TOSA_SCOOP_GPIO_BASE + 3)
+#define TOSA_GPIO_PWR_ON                (TOSA_SCOOP_GPIO_BASE + 4)
+
+#define TOSA_SCOOP_JC_GPIO_BASE         1
+#define TOSA_GPIO_BT_LED                (TOSA_SCOOP_JC_GPIO_BASE + 0)
+#define TOSA_GPIO_NOTE_LED              (TOSA_SCOOP_JC_GPIO_BASE + 1)
+#define TOSA_GPIO_CHRG_ERR_LED          (TOSA_SCOOP_JC_GPIO_BASE + 2)
+#define TOSA_GPIO_TC6393XB_L3V_ON       (TOSA_SCOOP_JC_GPIO_BASE + 5)
+#define TOSA_GPIO_WLAN_LED              (TOSA_SCOOP_JC_GPIO_BASE + 7)
+
+#define DAC_BASE 0x4e
+#define DAC_CH1 0
+#define DAC_CH2 1
 
 static void tosa_microdrive_attach(PXA2xxState *cpu)
 {
@@ -65,24 +65,39 @@ static void tosa_microdrive_attach(PXA2xxState *cpu)
     pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
 }
 
-static void tosa_out_switch(void *opaque, int line, int level)
+/*
+ * Encapsulation of some GPIO line behaviour for the Tosa board
+ *
+ * QEMU interface:
+ *  + named GPIO inputs "leds[0..3]": assert to light LEDs
+ *  + named GPIO input "reset": when asserted, resets the system
+ */
+
+#define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio"
+#define TOSA_MISC_GPIO(obj) \
+    OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO)
+
+typedef struct TosaMiscGPIOState {
+    SysBusDevice parent_obj;
+} TosaMiscGPIOState;
+
+static void tosa_gpio_leds(void *opaque, int line, int level)
 {
     switch (line) {
-        case 0:
-            fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
-            break;
-        case 1:
-            fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
-            break;
-        case 2:
-            fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
-            break;
-        case 3:
-            fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
-            break;
-        default:
-            fprintf(stderr, "Uhandled out event: %d = %d\n", line, level);
-            break;
+    case 0:
+        fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
+        break;
+    case 1:
+        fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
+        break;
+    case 2:
+        fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
+        break;
+    case 3:
+        fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
+        break;
+    default:
+        g_assert_not_reached();
     }
 }
 
@@ -93,13 +108,22 @@ static void tosa_reset(void *opaque, int line, int level)
     }
 }
 
+static void tosa_misc_gpio_init(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    qdev_init_gpio_in_named(dev, tosa_gpio_leds, "leds", 4);
+    qdev_init_gpio_in_named(dev, tosa_reset, "reset", 1);
+}
+
 static void tosa_gpio_setup(PXA2xxState *cpu,
                 DeviceState *scp0,
                 DeviceState *scp1,
                 TC6393xbState *tmio)
 {
-    qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4);
-    qemu_irq reset;
+    DeviceState *misc_gpio;
+
+    misc_gpio = sysbus_create_simple(TYPE_TOSA_MISC_GPIO, -1, NULL);
 
     /* MMC/SD host */
     pxa2xx_mmci_handlers(cpu->mmc,
@@ -107,8 +131,8 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
                     qemu_irq_invert(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_nSD_DETECT)));
 
     /* Handle reset */
-    reset = qemu_allocate_irq(tosa_reset, cpu, 0);
-    qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET, reset);
+    qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET,
+                          qdev_get_gpio_in_named(misc_gpio, "reset", 0));
 
     /* PCMCIA signals: card's IRQ and Card-Detect */
     pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0],
@@ -119,10 +143,14 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
                         qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ),
                         NULL);
 
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]);
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 0));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 1));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 2));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 3));
 
     qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));
 
@@ -287,10 +315,22 @@ static const TypeInfo tosa_ssp_info = {
     .class_init    = tosa_ssp_class_init,
 };
 
+static const TypeInfo tosa_misc_gpio_info = {
+    .name          = "tosa-misc-gpio",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(TosaMiscGPIOState),
+    .instance_init = tosa_misc_gpio_init,
+    /*
+     * No class init required: device has no internal state so does not
+     * need to set up reset or vmstate, and has no realize method.
+     */
+};
+
 static void tosa_register_types(void)
 {
     type_register_static(&tosa_dac_info);
     type_register_static(&tosa_ssp_info);
+    type_register_static(&tosa_misc_gpio_info);
 }
 
 type_init(tosa_register_types)
diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
index 1c1989d56a..5ea7e52ab8 100644
--- a/hw/nios2/cpu_pic.c
+++ b/hw/nios2/cpu_pic.c
@@ -54,7 +54,8 @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int level)
 
 void nios2_check_interrupts(CPUNios2State *env)
 {
-    if (env->irq_pending) {
+    if (env->irq_pending &&
+        (env->regs[CR_STATUS] & CR_STATUS_PIE)) {
         env->irq_pending = 0;
         cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD);
     }
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index b39e836181..5d56865e56 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -534,6 +534,7 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq)
             ptail = (struct virtio_iommu_req_tail *)
                         (buf + s->config.probe_size);
             ptail->status = virtio_iommu_handle_probe(s, iov, iov_cnt, buf);
+            break;
         }
         default:
             tail.status = VIRTIO_IOMMU_S_UNSUPP;
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 083d8dc1b2..b61a4855b7 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/signal.h>
 
 #include "hw/sysbus.h"
 #include "hw/boards.h"
diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
index 024af8aae4..79dfff9d73 100644
--- a/include/hw/arm/bcm2836.h
+++ b/include/hw/arm/bcm2836.h
@@ -33,7 +33,6 @@ typedef struct BCM283XState {
     DeviceState parent_obj;
     /*< public >*/
 
-    char *cpu_type;
     uint32_t enabled_cpus;
 
     struct {
diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h
index 9e228dacea..54ee1bfd78 100644
--- a/include/hw/arm/fsl-imx25.h
+++ b/include/hw/arm/fsl-imx25.h
@@ -65,6 +65,7 @@ typedef struct FslIMX25State {
     MemoryRegion   rom[2];
     MemoryRegion   iram;
     MemoryRegion   iram_alias;
+    uint32_t       phy_num;
 } FslIMX25State;
 
 /**
diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
index 1ebd751324..162fe99375 100644
--- a/include/hw/arm/fsl-imx6.h
+++ b/include/hw/arm/fsl-imx6.h
@@ -73,6 +73,7 @@ typedef struct FslIMX6State {
     MemoryRegion   caam;
     MemoryRegion   ocram;
     MemoryRegion   ocram_alias;
+    uint32_t       phy_num;
 } FslIMX6State;
 
 
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
index da977f9ffb..ad88923707 100644
--- a/include/hw/arm/fsl-imx7.h
+++ b/include/hw/arm/fsl-imx7.h
@@ -81,6 +81,7 @@ typedef struct FslIMX7State {
     IMX7GPRState       gpr;
     ChipideaState      usb[FSL_IMX7_NUM_USBS];
     DesignwarePCIEHost pcie;
+    uint32_t           phy_num[FSL_IMX7_NUM_ETHS];
 } FslIMX7State;
 
 enum FslIMX7MemoryMap {
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 2a9f3fe783..1d3e4c24e4 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -8,6 +8,8 @@
 # include <machine/bswap.h>
 #elif defined(__FreeBSD__)
 # include <sys/endian.h>
+#elif defined(__HAIKU__)
+# include <endian.h>
 #elif defined(CONFIG_BYTESWAP_H)
 # include <byteswap.h>
 
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 0fc206ae61..979a403984 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -104,7 +104,7 @@ extern int daemon(int, int);
 #include <setjmp.h>
 #include <signal.h>
 
-#ifdef __OpenBSD__
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
 #endif
 
@@ -432,6 +432,10 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 #define HAVE_CHARDEV_PARPORT 1
 #endif
 
+#if defined(__HAIKU__)
+#define SIGIO SIGPOLL
+#endif
+
 #if defined(CONFIG_LINUX)
 #ifndef BUS_MCEERR_AR
 #define BUS_MCEERR_AR 4
diff --git a/os-posix.c b/os-posix.c
index 3cd52e1e70..b674b20b1b 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -337,6 +337,7 @@ bool is_daemonized(void)
 
 int os_mlock(void)
 {
+#ifdef HAVE_MLOCKALL
     int ret = 0;
 
     ret = mlockall(MCL_CURRENT | MCL_FUTURE);
@@ -345,4 +346,7 @@ int os_mlock(void)
     }
 
     return ret;
+#else
+    return -ENOSYS;
+#endif
 }
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc9c29f998..c69a2baf1d 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2269,13 +2269,13 @@ static const ARMCPRegInfo v7_cp_reginfo[] = {
       .resetvalue = 0x0 },
     { .name = "PMINTENCLR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 2,
       .access = PL1_RW, .accessfn = access_tpm,
-      .type = ARM_CP_ALIAS | ARM_CP_IO,
+      .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
       .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
       .writefn = pmintenclr_write, },
     { .name = "PMINTENCLR_EL1", .state = ARM_CP_STATE_AA64,
       .opc0 = 3, .opc1 = 0, .crn = 9, .crm = 14, .opc2 = 2,
       .access = PL1_RW, .accessfn = access_tpm,
-      .type = ARM_CP_ALIAS | ARM_CP_IO,
+      .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
       .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
       .writefn = pmintenclr_write },
     { .name = "CCSIDR", .state = ARM_CP_STATE_BOTH,
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 08f0fd15b2..88a2fb271d 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -5275,7 +5275,7 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
         desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz);
         desc <<= SVE_MTEDESC_SHIFT;
     }
-    desc = simd_desc(vsz, vsz, scale);
+    desc = simd_desc(vsz, vsz, desc | scale);
     t_desc = tcg_const_i32(desc);
 
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 6c34cd3193..9824544eb3 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -32,6 +32,7 @@
 #include "exec/cpu_ldst.h"
 #include "exec/translator.h"
 #include "qemu/qemu-print.h"
+#include "exec/gen-icount.h"
 
 /* is_jmp field values */
 #define DISAS_JUMP    DISAS_TARGET_0 /* only pc was modified dynamically */
@@ -149,7 +150,7 @@ static void t_gen_helper_raise_exception(DisasContext *dc,
     tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc);
     gen_helper_raise_exception(dc->cpu_env, tmp);
     tcg_temp_free_i32(tmp);
-    dc->is_jmp = DISAS_UPDATE;
+    dc->is_jmp = DISAS_NORETURN;
 }
 
 static bool use_goto_tb(DisasContext *dc, uint32_t dest)
@@ -518,7 +519,11 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags)
     /* If interrupts were enabled using WRCTL, trigger them. */
 #if !defined(CONFIG_USER_ONLY)
     if ((instr.imm5 + CR_BASE) == CR_STATUS) {
+        if (tb_cflags(dc->tb) & CF_USE_ICOUNT) {
+            gen_io_start();
+        }
         gen_helper_check_interrupts(dc->cpu_env);
+        dc->is_jmp = DISAS_UPDATE;
     }
 #endif
 }
@@ -802,7 +807,7 @@ static void gen_exception(DisasContext *dc, uint32_t excp)
     tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
     gen_helper_raise_exception(cpu_env, tmp);
     tcg_temp_free_i32(tmp);
-    dc->is_jmp = DISAS_UPDATE;
+    dc->is_jmp = DISAS_NORETURN;
 }
 
 /* generate intermediate code for basic block 'tb'.  */
@@ -865,6 +870,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
     /* Indicate where the next block should start */
     switch (dc->is_jmp) {
     case DISAS_NEXT:
+    case DISAS_UPDATE:
         /* Save the current PC back into the CPU register */
         tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
         tcg_gen_exit_tb(NULL, 0);
@@ -872,11 +878,11 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
 
     default:
     case DISAS_JUMP:
-    case DISAS_UPDATE:
         /* The jump will already have updated the PC register */
         tcg_gen_exit_tb(NULL, 0);
         break;
 
+    case DISAS_NORETURN:
     case DISAS_TB_JUMP:
         /* nothing more to generate */
         break;
diff --git a/util/compatfd.c b/util/compatfd.c
index c296f55d14..ee47dd8089 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -16,7 +16,9 @@
 #include "qemu/osdep.h"
 #include "qemu/thread.h"
 
+#if defined(CONFIG_SIGNALFD)
 #include <sys/syscall.h>
+#endif
 
 struct sigfd_compat_info
 {
diff --git a/util/drm.c b/util/drm.c
index a23ff24538..dae8ffebc8 100644
--- a/util/drm.c
+++ b/util/drm.c
@@ -24,7 +24,8 @@ int qemu_drm_rendernode_open(const char *rendernode)
 {
     DIR *dir;
     struct dirent *e;
-    int r, fd;
+    struct stat st;
+    int r, fd, ret;
     char *p;
 
     if (rendernode) {
@@ -38,10 +39,6 @@ int qemu_drm_rendernode_open(const char *rendernode)
 
     fd = -1;
     while ((e = readdir(dir))) {
-        if (e->d_type != DT_CHR) {
-            continue;
-        }
-
         if (strncmp(e->d_name, "renderD", 7)) {
             continue;
         }
@@ -53,6 +50,18 @@ int qemu_drm_rendernode_open(const char *rendernode)
             g_free(p);
             continue;
         }
+
+        /*
+         * prefer fstat() over checking e->d_type == DT_CHR for
+         * portability reasons
+         */
+        ret = fstat(r, &st);
+        if (ret < 0 || (st.st_mode & S_IFMT) != S_IFCHR) {
+            close(r);
+            g_free(p);
+            continue;
+        }
+
         fd = r;
         g_free(p);
         break;
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 39ddc77c85..72907d4d7f 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -38,7 +38,6 @@
 #include "qemu/sockets.h"
 #include "qemu/thread.h"
 #include <libgen.h>
-#include <sys/signal.h>
 #include "qemu/cutils.h"
 
 #ifdef CONFIG_LINUX
@@ -61,6 +60,10 @@
 #include <mach-o/dyld.h>
 #endif
 
+#ifdef __HAIKU__
+#include <kernel/image.h>
+#endif
+
 #include "qemu/mmap-alloc.h"
 
 #ifdef CONFIG_DEBUG_STACK_USAGE
@@ -390,6 +393,21 @@ void qemu_init_exec_dir(const char *argv0)
             }
         }
     }
+#elif defined(__HAIKU__)
+    {
+        image_info ii;
+        int32_t c = 0;
+
+        *buf = '\0';
+        while (get_next_image_info(0, &c, &ii) == B_OK) {
+            if (ii.type == B_APP_IMAGE) {
+                strncpy(buf, ii.name, sizeof(buf));
+                buf[sizeof(buf) - 1] = 0;
+                p = buf;
+                break;
+            }
+        }
+    }
 #endif
     /* If we don't have any way of figuring out the actual executable
        location then try argv[0].  */
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
index 4b8df96f38..eb17f5b0bc 100644
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -35,7 +35,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#if defined(__GLIBC__)
+#if defined HAVE_PTY_H
 # include <pty.h>
 #elif defined CONFIG_BSD
 # include <termios.h>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14721.36418 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmK-00026I-En; Thu, 29 Oct 2020 20:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14721.36418; Thu, 29 Oct 2020 20:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmK-00026A-Bm; Thu, 29 Oct 2020 20:44:12 +0000
Received: by outflank-mailman (input) for mailman id 14721;
 Thu, 29 Oct 2020 20:44:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEmI-000262-JA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 445762f5-713d-481f-9760-17ee40f9d276;
 Thu, 29 Oct 2020 20:44:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmF-0006fd-V2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmF-0000Ed-RY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEmI-000262-JA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:10 +0000
X-Inumbo-ID: 445762f5-713d-481f-9760-17ee40f9d276
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 445762f5-713d-481f-9760-17ee40f9d276;
	Thu, 29 Oct 2020 20:44:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a9CJ8i91VATomr0hFTCXnpIeCdIIAkeIZPrtxPDvhas=; b=6gGFYkH5hMNKSumkiy0Yv9UefF
	4kTly1Ro05lTaSAQKpvEUct3A6XbuCgRryLRbT3B+anVfwuqTZSkTkDb/bCMdb9OCB1e0GCSm9Nel
	gwVLJQDF1JS1pTntvFZnQt4w8pgC4DmQHAM48VhvCPLhNprkjOQ42/3QTvG6Wx/8kjYk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmF-0006fd-V2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmF-0000Ed-RY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ossaudio: fix out of bounds write
Message-Id: <E1kYEmF-0000Ed-RY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:07 +0000

commit 4f50d4a48e0caa1aad591f3ca437502e33b8699d
Author:     Volker Rümelin <vr_qemu@t-online.de>
AuthorDate: Tue Jul 7 20:08:36 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:38:40 2020 +0200

    ossaudio: fix out of bounds write
    
    In function oss_read() a read error currently does not exit the
    read loop. With no data to read the variable pos will quickly
    underflow and a subsequent successful read overwrites memory
    outside the buffer. This patch adds the missing break statement
    to the error path of the function.
    
    To reproduce start qemu with -audiodev oss,id=audio0 and in the
    guest start audio recording. After some time this will trigger
    an exception.
    
    Fixes: 3ba4066d08 "ossaudio: port to the new audio backend api"
    
    Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
    Message-id: 20200707180836.5435-1-vr_qemu@t-online.de
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/ossaudio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index f88d076ec2..a7dcaa31ad 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -691,6 +691,7 @@ static size_t oss_read(HWVoiceIn *hw, void *buf, size_t len)
                            len, dst);
                 break;
             }
+            break;
         }
 
         pos += nread;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:44:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:44:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14722.36421 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmS-00027E-G1; Thu, 29 Oct 2020 20:44:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14722.36421; Thu, 29 Oct 2020 20:44:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmS-000276-DB; Thu, 29 Oct 2020 20:44:20 +0000
Received: by outflank-mailman (input) for mailman id 14722;
 Thu, 29 Oct 2020 20:44:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEmR-00026w-90
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0273ad04-7886-4f3c-b60f-fe1da0e1e4b4;
 Thu, 29 Oct 2020 20:44:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmQ-0006fg-2p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmQ-0000G9-1V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEmR-00026w-90
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:19 +0000
X-Inumbo-ID: 0273ad04-7886-4f3c-b60f-fe1da0e1e4b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0273ad04-7886-4f3c-b60f-fe1da0e1e4b4;
	Thu, 29 Oct 2020 20:44:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qWJuA6xNFzQ3LrIa+lxn2owo2z+FlG74QjBx6ljD8WM=; b=bDLQ5hyyXFM2wOSh1jw0L8ytk2
	vxAzV3OK8yiM6ICtL5pfc51RDHRox30xPTh/VTEsRa5lYqPt6QgIhtOpqjFtcbe39zJhSpnAAWzB/
	Ilb4atnIBoGNkyTcTj9MepGuDpGX34SaNUbmMtZKkiJKrf6Aol/zemjBnhZaUkjb3RA4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmQ-0006fg-2p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmQ-0000G9-1V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/qdev-device-use: Clean up the sentences related to -usbdevice
Message-Id: <E1kYEmQ-0000G9-1V@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:18 +0000

commit 480324ec8d76582fa1c367cc9a0fdb653d4ea96e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Fri Jul 10 08:55:20 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:40:47 2020 +0200

    docs/qdev-device-use: Clean up the sentences related to -usbdevice
    
    Most of the -usbdevice paramaters have been removed already. Update
    the doc accordingly.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-id: 20200710065520.24784-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 docs/qdev-device-use.txt | 28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
index 4bbbcf561f..f8d0d2fe29 100644
--- a/docs/qdev-device-use.txt
+++ b/docs/qdev-device-use.txt
@@ -125,12 +125,7 @@ The -device argument differs in detail for each type of drive:
 
 * if=pflash, if=mtd, if=sd, if=xen are not yet available with -device
 
-For USB devices, the old way is actually different:
-
-    -usbdevice disk:format=FMT:FILENAME
-
-Provides much less control than -drive's OPTS...  The new way fixes
-that:
+For USB storage devices, you can use something like:
 
     -device usb-storage,drive=DRIVE-ID,removable=RMB
 
@@ -177,8 +172,6 @@ The appropriate DEVNAME depends on the machine type.  For type "pc":
 
   This lets you control I/O ports and IRQs.
 
-* -usbdevice serial::chardev becomes -device usb-serial,chardev=dev.
-
 * -usbdevice braille doesn't support LEGACY-CHARDEV syntax.  It always
   uses "braille".  With -device, this useful default is gone, so you
   have to use something like
@@ -238,10 +231,6 @@ The old way to define the guest part looks like this:
 
     -net nic,netdev=NET-ID,macaddr=MACADDR,model=MODEL,name=ID,addr=STR,vectors=V
 
-Except for USB it looks like this:
-
-    -usbdevice net:netdev=NET-ID,macaddr=MACADDR,name=ID
-
 The new way is -device:
 
     -device DEVNAME,netdev=NET-ID,mac=MACADDR,DEV-OPTS...
@@ -336,12 +325,7 @@ The new way is -device DEVNAME,DEV-OPTS...  Details depend on DRIVER:
 * mouse           -device usb-mouse
 * tablet          -device usb-tablet
 * wacom-tablet    -device usb-wacom-tablet
-* host:...        See "Host Device Assignment"
-* disk:...        See "Block Devices"
-* serial:...      See "Character Devices"
 * braille         See "Character Devices"
-* net:...         See "Network Devices"
-* bt:...          not yet available with -device
 
 === Watchdog Devices ===
 
@@ -358,17 +342,11 @@ and host USB devices.  PCI devices can only be assigned with -device:
 
     -device vfio-pci,host=ADDR,id=ID
 
-The old way to assign a host USB device is
-
-    -usbdevice host:auto:BUS.ADDR:VID:PRID
-
-where any of BUS, ADDR, VID, PRID can be the wildcard *.
-
-The new way is
+To assign a host USB device use:
 
     -device usb-host,hostbus=BUS,hostaddr=ADDR,vendorid=VID,productid=PRID
 
-Omitted options match anything, just like the old way's wildcard.
+Omitted options match anything.
 
 === Default Devices ===
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:44:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:44:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14723.36427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmc-00028n-IB; Thu, 29 Oct 2020 20:44:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14723.36427; Thu, 29 Oct 2020 20:44:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmc-00028f-Eq; Thu, 29 Oct 2020 20:44:30 +0000
Received: by outflank-mailman (input) for mailman id 14723;
 Thu, 29 Oct 2020 20:44:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEmb-00028S-5m
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6419abbf-1c58-4aba-9a19-07648833b81a;
 Thu, 29 Oct 2020 20:44:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEma-0006fs-6n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEma-0000HB-5U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEmb-00028S-5m
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:29 +0000
X-Inumbo-ID: 6419abbf-1c58-4aba-9a19-07648833b81a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6419abbf-1c58-4aba-9a19-07648833b81a;
	Thu, 29 Oct 2020 20:44:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NTLY8hoRGw6nZlLtwwcu2H77cG7Q3zjCdNLNligSmp8=; b=gKTJG4syqaoQQBbEorQFhJPFNB
	NPQ+XE3X72QrYwWpMQ6EXEEAQeSwvWf94Z31qAFQQ3EmdhRbe41ysfHyDI7gIBwZrfAe/pVSacQPp
	8cNNmX+vIktqAeQx9I2E2fbiXZY1kqMY+BXcVroaMs/6OEhv04H3HzdoJU+n0zJQMR5o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEma-0006fs-6n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEma-0000HB-5U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ui: fix vc_chr_write call in text_console_do_init
Message-Id: <E1kYEma-0000HB-5U@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:28 +0000

commit 185951817dede3dfe4eb1c4c6d262607bee605ef
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Wed Jul 1 20:18:01 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:46:35 2020 +0200

    ui: fix vc_chr_write call in text_console_do_init
    
    In case the string doesn't fit into the buffer snprintf returns the size
    it would need, so len can be larger than the buffer.  Fix this by simply
    using g_strdup_printf() instead of a static buffer.
    
    Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-id: 20200701181801.27935-1-kraxel@redhat.com
---
 ui/console.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index 08f75c9bf6..0579be792f 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2184,12 +2184,12 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
     text_console_resize(s);
 
     if (chr->label) {
-        char msg[128];
-        int len;
+        char *msg;
 
         s->t_attrib.bgcol = QEMU_COLOR_BLUE;
-        len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label);
-        vc_chr_write(chr, (uint8_t *)msg, len);
+        msg = g_strdup_printf("%s console\r\n", chr->label);
+        vc_chr_write(chr, (uint8_t *)msg, strlen(msg));
+        g_free(msg);
         s->t_attrib = s->t_attrib_default;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:44:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:44:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14724.36430 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmm-0002A6-JC; Thu, 29 Oct 2020 20:44:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14724.36430; Thu, 29 Oct 2020 20:44:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmm-00029y-GJ; Thu, 29 Oct 2020 20:44:40 +0000
Received: by outflank-mailman (input) for mailman id 14724;
 Thu, 29 Oct 2020 20:44:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEml-00029o-7X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a5c22b94-21fe-47f3-9530-b9e9424f15c9;
 Thu, 29 Oct 2020 20:44:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmk-0006g1-BU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmk-0000Ia-A2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEml-00029o-7X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:39 +0000
X-Inumbo-ID: a5c22b94-21fe-47f3-9530-b9e9424f15c9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a5c22b94-21fe-47f3-9530-b9e9424f15c9;
	Thu, 29 Oct 2020 20:44:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AHphYReg6PqJW4bkd/jQoCsbogtV4bQJQjdJTZGfLxI=; b=ooC4j61rindHCqsycBdK9iZsGC
	L+DpK6WqBYSymgA4q/3FWoIUf4wRShAkgZRbFX3M2Dq4aMhtK67tLTX4yRWsaNBvlxSwYYPJ1M/li
	cddoU9t0dnsKWFFl3HX2xuHKqOIWHp4CbRBMMflsrSwd24nezi3mjkKn5mVwTlyA36Zo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmk-0006g1-BU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmk-0000Ia-A2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] usb: fix usb-host build on windows.
Message-Id: <E1kYEmk-0000Ia-A2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:38 +0000

commit 631009e775a91018a62e2670b4473e99916f858f
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Wed Jun 24 15:45:10 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:46:51 2020 +0200

    usb: fix usb-host build on windows.
    
    Seems the new API is not available on windows.
    Update #ifdefs accordingly.
    
    Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
    Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
    Message-id: 20200624134510.9381-1-kraxel@redhat.com
---
 hw/usb/host-libusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index ad7ed8fb0c..c474551d84 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
             goto fail;
         }
     } else {
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
         trace_usb_host_open_hostfd(hostfd);
 
         rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     QTAILQ_INIT(&s->isorings);
     s->hostfd = -1;
 
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
     if (s->hostdevice) {
         int fd;
         s->needs_autoscan = false;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:44:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:44:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14725.36434 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmx-0002BM-Kj; Thu, 29 Oct 2020 20:44:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14725.36434; Thu, 29 Oct 2020 20:44:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEmx-0002BD-Hq; Thu, 29 Oct 2020 20:44:51 +0000
Received: by outflank-mailman (input) for mailman id 14725;
 Thu, 29 Oct 2020 20:44:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEmv-0002B2-Lz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6687523b-bd36-4399-bc57-12aacc18b232;
 Thu, 29 Oct 2020 20:44:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmu-0006g8-G0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEmu-0000Ji-Eb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEmv-0002B2-Lz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:49 +0000
X-Inumbo-ID: 6687523b-bd36-4399-bc57-12aacc18b232
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6687523b-bd36-4399-bc57-12aacc18b232;
	Thu, 29 Oct 2020 20:44:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kkqw+F4pPCAGzouKygf609q6DcE+6u833X+admvlzBg=; b=tbms25lP8wrWqoqwgQuzun97Lv
	DowJOuU7r8fCYNQbN/MhkTEkvk5S/aTtuo1PkVF1GJGropEbk/Xz3nk4ifVPmfhI0sMUT+/OJGVXM
	LtzBFIctYXpmswyzO1vUusKUFanX5u0dbF/1V5gLE0xmXoAM3T6nd0bAaJ1+9/TG3XRU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmu-0006g8-G0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEmu-0000Ji-Eb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200713-pull-request' into staging
Message-Id: <E1kYEmu-0000Ji-Eb@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:48 +0000

commit 20c1df5476e1e9b5d3f5b94f9f3ce01d21f14c46
Merge: 5c65b1f135ff09d24827fa3a17e56a4f8a032cd5 631009e775a91018a62e2670b4473e99916f858f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 16:58:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 16:58:44 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200713-pull-request' into staging
    
    bugfixes for audio, usb, ui and docs.
    
    # gpg: Signature made Mon 13 Jul 2020 15:10:35 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200713-pull-request:
      usb: fix usb-host build on windows.
      ui: fix vc_chr_write call in text_console_do_init
      docs/qdev-device-use: Clean up the sentences related to -usbdevice
      ossaudio: fix out of bounds write
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 audio/ossaudio.c         |  1 +
 docs/qdev-device-use.txt | 28 +++-------------------------
 hw/usb/host-libusb.c     |  4 ++--
 ui/console.c             |  8 ++++----
 4 files changed, 10 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14726.36438 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEn7-0002D6-Mb; Thu, 29 Oct 2020 20:45:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14726.36438; Thu, 29 Oct 2020 20:45:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEn7-0002Cw-JQ; Thu, 29 Oct 2020 20:45:01 +0000
Received: by outflank-mailman (input) for mailman id 14726;
 Thu, 29 Oct 2020 20:45:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEn6-0002CL-8k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e47e0ef5-a08f-4611-a6f0-57fb08e07c34;
 Thu, 29 Oct 2020 20:44:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEn4-0006gw-ST
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEn4-0000Lj-Rh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEn6-0002CL-8k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:00 +0000
X-Inumbo-ID: e47e0ef5-a08f-4611-a6f0-57fb08e07c34
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e47e0ef5-a08f-4611-a6f0-57fb08e07c34;
	Thu, 29 Oct 2020 20:44:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u9MQBKUL2b8XmG/HfpVNrliuhGQ2baeLnhRsesStsVQ=; b=HVY9NAkZnupqKLvq2g7naSnIPL
	y/msM40P6pk172alCYWbZkaObcC2gIgKNi6of4XzFZfjyzdaGDQqP9D0dNgKaJUgRlcld8UFikNlb
	EYjq8eJnPdH1oPr+0mjw//pbX2G2E1OTgJl0OqwCWBFw2BABf9j3XXO+ph3Jyh+FyC7Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEn4-0006gw-ST
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEn4-0000Lj-Rh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:44:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] nbd: Avoid off-by-one in long export name truncation
Message-Id: <E1kYEn4-0000Lj-Rh@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:44:58 +0000

commit 00d69986da83a74f6f5731c80f8dd09fde95d19a
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 22 16:03:55 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    nbd: Avoid off-by-one in long export name truncation
    
    When snprintf returns the same value as the buffer size, the final
    byte was truncated to ensure a NUL terminator.  Fortunately, such long
    export names are unusual enough, with no real impact other than what
    is displayed to the user.
    
    Fixes: 5c86bdf12089
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200622210355.414941-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index c297336ffc..65a4f56924 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -2002,7 +2002,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
         len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
                        "nbd://%s:%s", host, port);
     }
-    if (len > sizeof(bs->exact_filename)) {
+    if (len >= sizeof(bs->exact_filename)) {
         /* Name is too long to represent exactly, so leave it empty. */
         bs->exact_filename[0] = '\0';
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14727.36441 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnH-0002EO-Nr; Thu, 29 Oct 2020 20:45:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14727.36441; Thu, 29 Oct 2020 20:45:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnH-0002EG-L2; Thu, 29 Oct 2020 20:45:11 +0000
Received: by outflank-mailman (input) for mailman id 14727;
 Thu, 29 Oct 2020 20:45:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEnG-0002E5-5x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ba86a607-f9ff-4e45-bfb8-8f246737ec5b;
 Thu, 29 Oct 2020 20:45:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnF-0006hU-0d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnE-0000Mw-VO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEnG-0002E5-5x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:10 +0000
X-Inumbo-ID: ba86a607-f9ff-4e45-bfb8-8f246737ec5b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ba86a607-f9ff-4e45-bfb8-8f246737ec5b;
	Thu, 29 Oct 2020 20:45:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k57z34ENbiv1d/cgmvmd47e9nC9Fva7pqpl7OZGPGtc=; b=EfrSUY7OEkspvFW3zWKdvLfX/K
	fElIHE/wCYxwEoQXGZXC+yB62nt/1YS+CaALSBHmdl8pij35yyEzL0ZRwulX7Qmx9IlLUQ5R8C0te
	DrzXM3uU3V1HMOwtS1rXoClI2sq3WTJTXeKOpnkjOW8TeAc3pMip0hBScpW9HcOdN/94=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnF-0006hU-0d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnE-0000Mw-VO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hax: Fix setting of FD_CLOEXEC
Message-Id: <E1kYEnE-0000Mw-VO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:08 +0000

commit 8cf58a49f883f089e7d4b6e19acc987085d024fd
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Apr 20 12:53:07 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    hax: Fix setting of FD_CLOEXEC
    
    Blindly setting FD_CLOEXEC without a read-modify-write will
    inadvertently clear any other intentionally-set bits, such as a
    proposed new bit for designating a fd that must behave in 32-bit mode.
    Use our wrapper function instead of an incorrect hand-rolled version.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200420175309.75894-2-eblake@redhat.com>
    Reviewed-by: Colin Xu <colin.xu@intel.com>
---
 target/i386/hax-posix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/i386/hax-posix.c b/target/i386/hax-posix.c
index 3bad89f133..5f9d1b803d 100644
--- a/target/i386/hax-posix.c
+++ b/target/i386/hax-posix.c
@@ -23,7 +23,7 @@ hax_fd hax_mod_open(void)
         fprintf(stderr, "Failed to open the hax module\n");
     }
 
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
 
     return fd;
 }
@@ -147,7 +147,7 @@ hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id)
     fd = open(vm_name, O_RDWR);
     g_free(vm_name);
 
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
 
     return fd;
 }
@@ -200,7 +200,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid)
     if (fd < 0) {
         fprintf(stderr, "Failed to open the vcpu devfs\n");
     }
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
     return fd;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14728.36446 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnR-0002Fv-Py; Thu, 29 Oct 2020 20:45:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14728.36446; Thu, 29 Oct 2020 20:45:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnR-0002Fm-MY; Thu, 29 Oct 2020 20:45:21 +0000
Received: by outflank-mailman (input) for mailman id 14728;
 Thu, 29 Oct 2020 20:45:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEnP-0002FW-U7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c969961c-6ae1-4e72-b203-271404f63440;
 Thu, 29 Oct 2020 20:45:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnP-0006hc-4d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnP-0000Nt-3i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEnP-0002FW-U7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
X-Inumbo-ID: c969961c-6ae1-4e72-b203-271404f63440
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c969961c-6ae1-4e72-b203-271404f63440;
	Thu, 29 Oct 2020 20:45:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iTwtlcjDuqpt9LlwcoIJhlGnd9CJr4AZaUIr4ezaE50=; b=Jg+YoroM2s+AZtAYMtjN9m3V/d
	XYw9dVEGr/aFMJF/xkEuMTLnMW2HNxQAzGhQuKl5qsX1EPzmyBQHgQ527c5jy1AzrlBFyXFMTewR2
	v595roQLKHKIstOPpaUpmgpXbSLeWkoBaNC22aImOu1Dx3tBHpANZhqj5Tq5z4cXBm70=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnP-0006hc-4d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnP-0000Nt-3i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: QemuIoInteractive: use qemu_io_args_no_fmt
Message-Id: <E1kYEnP-0000Nt-3i@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:19 +0000

commit a1a7f56cdd1ddc99fcd1078c9285849aaaaaeca9
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:27 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests: QemuIoInteractive: use qemu_io_args_no_fmt
    
    The only user (iotest 205) of QemuIoInteractive provides -f argument,
    so it's a bit inefficient to use qemu_io_args, which contains -f too.
    And we are going to add one more test, which wants to specify -f by
    hand. Let's use qemu_io_args_no_fmt.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200701105331.121670-2-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f1e0733dda..109fb3884a 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -212,7 +212,7 @@ def get_virtio_scsi_device():
 
 class QemuIoInteractive:
     def __init__(self, *args):
-        self.args = qemu_io_args + list(args)
+        self.args = qemu_io_args_no_fmt + list(args)
         self._p = subprocess.Popen(self.args, stdin=subprocess.PIPE,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14729.36451 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnb-0002HL-SW; Thu, 29 Oct 2020 20:45:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14729.36451; Thu, 29 Oct 2020 20:45:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnb-0002H9-PG; Thu, 29 Oct 2020 20:45:31 +0000
Received: by outflank-mailman (input) for mailman id 14729;
 Thu, 29 Oct 2020 20:45:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEna-0002Gx-1Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3a6553b7-436d-49dd-ae62-69c4ca22f1b8;
 Thu, 29 Oct 2020 20:45:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnZ-0006hr-AC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnZ-0000PD-7s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEna-0002Gx-1Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:30 +0000
X-Inumbo-ID: 3a6553b7-436d-49dd-ae62-69c4ca22f1b8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3a6553b7-436d-49dd-ae62-69c4ca22f1b8;
	Thu, 29 Oct 2020 20:45:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bvbfNzQCPoWHoXiTd5t6eEK3LV3QMsg09adHSIM+ZyU=; b=EkaBsICwhw04utwMYjBxQE45Pz
	6BbeOgQlMyOY4UxOV8VEgt5pPmKSRQjmbESWlAW4qa9JupQkZF4ojF+ll7mGTcfzR8EbDXkDnx7c3
	kIHviVWsi5oK2c20GLfjHGPcPFlQQnaQR+Y5HfvgeMl6tNi1cdwEE8pIfx6Zga/1ogXM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnZ-0006hr-AC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnZ-0000PD-7s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests.py: QemuIoInteractive: print output on failure
Message-Id: <E1kYEnZ-0000PD-7s@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:29 +0000

commit 1f4b774a6444575b86f27b17d3d01e4f41df6581
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:28 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests.py: QemuIoInteractive: print output on failure
    
    Make it simpler to debug when qemu-io fails due to wrong arguments or
    environment.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200701105331.121670-3-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 109fb3884a..2a08fea3c9 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -217,7 +217,13 @@ class QemuIoInteractive:
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT,
                                    universal_newlines=True)
-        assert self._p.stdout.read(9) == 'qemu-io> '
+        out = self._p.stdout.read(9)
+        if out != 'qemu-io> ':
+            # Most probably qemu-io just failed to start.
+            # Let's collect the whole output and exit.
+            out += self._p.stdout.read()
+            self._p.wait(timeout=1)
+            raise ValueError(out)
 
     def close(self):
         self._p.communicate('q\n')
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14730.36454 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnl-0002Ji-Tg; Thu, 29 Oct 2020 20:45:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14730.36454; Thu, 29 Oct 2020 20:45:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnl-0002Ja-Qk; Thu, 29 Oct 2020 20:45:41 +0000
Received: by outflank-mailman (input) for mailman id 14730;
 Thu, 29 Oct 2020 20:45:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEnk-0002J9-Fo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eccff703-c1d5-40c2-bf00-2fa59ff288b9;
 Thu, 29 Oct 2020 20:45:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnj-0006hz-EM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnj-0000QG-DV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEnk-0002J9-Fo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:40 +0000
X-Inumbo-ID: eccff703-c1d5-40c2-bf00-2fa59ff288b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eccff703-c1d5-40c2-bf00-2fa59ff288b9;
	Thu, 29 Oct 2020 20:45:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ucpb07esDpoYLZv/CIGV0W+cAVRnJfVhnPKFcGdyhqI=; b=QHMaLaIamqMmue7bSttwnRqryR
	jsGshggOjNA56Y/NL7TiBqTWLNIhOYNNTbWjMSD8jHgIKtF2btHlTVESwJnMDOfUM1o78yD0gaG+T
	8dV4mLCcpC0ggze/kJlDWPGXqDw4+KeQR2n8BVX6C/S//BmDCDqr68xO2FsZHdOoYGQw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnj-0006hz-EM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnj-0000QG-DV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests.py: filter_testfiles(): filter SOCK_DIR too
Message-Id: <E1kYEnj-0000QG-DV@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:39 +0000

commit df0e032b6196934b2b12180a6a05aa8b7e6553fc
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:30 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests.py: filter_testfiles(): filter SOCK_DIR too
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200701105331.121670-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 2a08fea3c9..8b760405ee 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -345,8 +345,9 @@ def filter_qmp(qmsg, filter_fn):
     return qmsg
 
 def filter_testfiles(msg):
-    prefix = os.path.join(test_dir, "%s-" % (os.getpid()))
-    return msg.replace(prefix, 'TEST_DIR/PID-')
+    pref1 = os.path.join(test_dir, "%s-" % (os.getpid()))
+    pref2 = os.path.join(sock_dir, "%s-" % (os.getpid()))
+    return msg.replace(pref1, 'TEST_DIR/PID-').replace(pref2, 'SOCK_DIR/PID-')
 
 def filter_qmp_testfiles(qmsg):
     def _filter(_key, value):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:45:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:45:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14731.36458 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnv-0002L0-V2; Thu, 29 Oct 2020 20:45:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14731.36458; Thu, 29 Oct 2020 20:45:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEnv-0002Ks-S9; Thu, 29 Oct 2020 20:45:51 +0000
Received: by outflank-mailman (input) for mailman id 14731;
 Thu, 29 Oct 2020 20:45:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEnu-0002Kj-AW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d613ae85-9ac0-4f53-a63f-71ad98730fb8;
 Thu, 29 Oct 2020 20:45:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnt-0006i7-IA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEnt-0000R4-HL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEnu-0002Kj-AW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:50 +0000
X-Inumbo-ID: d613ae85-9ac0-4f53-a63f-71ad98730fb8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d613ae85-9ac0-4f53-a63f-71ad98730fb8;
	Thu, 29 Oct 2020 20:45:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bUZukLBb6TTKUbW2OYJKISM7BEoPAa65hK9BkNVeTGs=; b=MepmRGJY9x6/Su2tjKzzEeYq0/
	IMk/dW9XAXRTk1mo0m/iyYYV7opfiQEwWFpPLRUtHWYvMYomHgl4Xq7Ysdud7/fQhayEv/4xM9D7r
	cgCwss8YGsa4D4shddEugQlVToYefcGxyIYIlAxiBY6tgUj8RBRihjJpsaZEWfdXtc38=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnt-0006i7-IA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEnt-0000R4-HL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-13' into staging
Message-Id: <E1kYEnt-0000R4-HL@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:49 +0000

commit 1a53dfee92284d3016a579ef31d53367e84d9dd8
Merge: 20c1df5476e1e9b5d3f5b94f9f3ce01d21f14c46 df0e032b6196934b2b12180a6a05aa8b7e6553fc
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 13:52:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 13:52:10 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-13' into staging
    
    NBD patches for 2020-07-13
    
    - fix off-by-one truncation in corner-case name display
    - use fcntl correctly
    - iotest cleanups that enable testing an upcoming fix for NBD close
    
    # gpg: Signature made Mon 13 Jul 2020 15:11:35 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-nbd-2020-07-13:
      iotests.py: filter_testfiles(): filter SOCK_DIR too
      iotests.py: QemuIoInteractive: print output on failure
      iotests: QemuIoInteractive: use qemu_io_args_no_fmt
      hax: Fix setting of FD_CLOEXEC
      nbd: Avoid off-by-one in long export name truncation
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/nbd.c                   |  2 +-
 target/i386/hax-posix.c       |  6 +++---
 tests/qemu-iotests/iotests.py | 15 +++++++++++----
 3 files changed, 15 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14732.36462 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEo6-0002Mt-0e; Thu, 29 Oct 2020 20:46:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14732.36462; Thu, 29 Oct 2020 20:46:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEo5-0002Ml-Tf; Thu, 29 Oct 2020 20:46:01 +0000
Received: by outflank-mailman (input) for mailman id 14732;
 Thu, 29 Oct 2020 20:46:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEo4-0002Mb-TH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c04ab2b-7390-4b02-92b9-0da58da025d5;
 Thu, 29 Oct 2020 20:46:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEo3-0006ii-Tt
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEo3-0000S3-Sy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEo4-0002Mb-TH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:00 +0000
X-Inumbo-ID: 2c04ab2b-7390-4b02-92b9-0da58da025d5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c04ab2b-7390-4b02-92b9-0da58da025d5;
	Thu, 29 Oct 2020 20:46:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SqKuJbOGUYJyS+74HqMxPDoTBESTuk0eeOY0p7rU0qs=; b=Tem8Fr+W0D95O1yJd5qKa7PKpo
	giG90Z2lXl5tVMYBmZQ+JHn7xIg88Ur/FKMACjGbaRww5RfuQzlljN6MwNMo7ikE+jKObBw9oRl7U
	dJ2vAMCP/CTo4+vLhfLpdpq/wN0QQAsrkjgxYCHJnKxy5DnVnCMSsOmbz3qp8htZDYCc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEo3-0006ii-Tt
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEo3-0000S3-Sy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:45:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration: fix memory leak in qmp_migrate_set_parameters
Message-Id: <E1kYEo3-0000S3-Sy@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:45:59 +0000

commit 9728ebfb77f0159f4c358103ac4b49a72109d972
Author:     Zheng Chuan <zhengchuan@huawei.com>
AuthorDate: Thu Jul 9 16:28:25 2020 +0800
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:13:49 2020 +0200

    migration: fix memory leak in qmp_migrate_set_parameters
    
    "tmp.tls_hostname" and "tmp.tls_creds" allocated by migrate_params_test_apply()
    is forgot to free at the end of qmp_migrate_set_parameters(). Fix that.
    
    The leak stack:
    Direct leak of 2 byte(s) in 2 object(s) allocated from:
       #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
       #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
       #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
       #3 0xaaaac52447fb in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1377)
       #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
       #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c:165)
       #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
       #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
       #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
       #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
       #10 0xaaaac55cae0f in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
       #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
       #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
       #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
       #14 0xaaaac47f45ef(/usr/bin/qemu-kvm-4.1.0+0x8455ef)
       #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
       #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)
    
    Direct leak of 2 byte(s) in 2 object(s) allocated from:
       #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
       #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
       #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
       #3 0xaaaac5244893 in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1382)
       #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
       #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c)
       #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
       #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
       #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
       #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
       #10 0xaaaac55cae0f in in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
       #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
       #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
       #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
       #14 0xaaaac47f45ef (/usr/bin/qemu-kvm-4.1.0+0x8455ef)
       #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
       #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)
    
    Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
    Reviewed-by: KeQian Zhu <zhukeqian1@huawei.com>
    Reviewed-by: HaiLiang <zhang.zhanghailiang@huawei.com>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 4e658c397e..08519de56f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1343,12 +1343,12 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
 
     if (params->has_tls_creds) {
         assert(params->tls_creds->type == QTYPE_QSTRING);
-        dest->tls_creds = g_strdup(params->tls_creds->u.s);
+        dest->tls_creds = params->tls_creds->u.s;
     }
 
     if (params->has_tls_hostname) {
         assert(params->tls_hostname->type == QTYPE_QSTRING);
-        dest->tls_hostname = g_strdup(params->tls_hostname->u.s);
+        dest->tls_hostname = params->tls_hostname->u.s;
     }
 
     if (params->has_max_bandwidth) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14733.36466 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoG-0002Ob-1z; Thu, 29 Oct 2020 20:46:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14733.36466; Thu, 29 Oct 2020 20:46:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoF-0002OT-VH; Thu, 29 Oct 2020 20:46:11 +0000
Received: by outflank-mailman (input) for mailman id 14733;
 Thu, 29 Oct 2020 20:46:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEoE-0002OL-RO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4034de7d-3b86-47c0-a316-a1797e6eaf8e;
 Thu, 29 Oct 2020 20:46:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoE-0006j3-1D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoE-0000T4-0W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEoE-0002OL-RO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
X-Inumbo-ID: 4034de7d-3b86-47c0-a316-a1797e6eaf8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4034de7d-3b86-47c0-a316-a1797e6eaf8e;
	Thu, 29 Oct 2020 20:46:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xciBIvSgcnnSldof93jARd+Wf/IQOS7zmY3vIY5PFEA=; b=YW8NAexBuGETZFRAaOOEvBgVlR
	WaNwRT1Qb5Ewr9gHKd8uEy/2v8TLxYM7GNtVg90LMEZpDNPA71CgwBiN9zumDvE+1Tw59C/WK4Z+c
	yZUQ9ay1ptVVfIT9J2Jn7BiW/vX1qoovFBi70crMdx27Tm+8KdsyWOifVBlc+jzysU9s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoE-0006j3-1D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoE-0000T4-0W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/savevm: respect qemu_fclose() error code in save_snapshot()
Message-Id: <E1kYEoE-0000T4-0W@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:46:10 +0000

commit 66270a475cb81f24b53c8cc9ccaf152baf6bb10f
Author:     Denis V. Lunev <den@openvz.org>
AuthorDate: Fri Jul 3 19:11:24 2020 +0300
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:15:35 2020 +0200

    migration/savevm: respect qemu_fclose() error code in save_snapshot()
    
    qemu_fclose() could return error, f.e. if bdrv_co_flush() will return
    the error.
    
    This validation will become more important once we will start waiting of
    asynchronous IO operations, started from bdrv_write_vmstate(), which are
    coming soon.
    
    Signed-off-by: Denis V. Lunev <den@openvz.org>
    Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    CC: Kevin Wolf <kwolf@redhat.com>
    CC: Max Reitz <mreitz@redhat.com>
    CC: Stefan Hajnoczi <stefanha@redhat.com>
    CC: Fam Zheng <fam@euphon.net>
    CC: Juan Quintela <quintela@redhat.com>
    CC: Denis Plotnikov <dplotnikov@virtuozzo.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/savevm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 6e01724605..45c9dd9d8a 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2635,7 +2635,7 @@ int save_snapshot(const char *name, Error **errp)
 {
     BlockDriverState *bs, *bs1;
     QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
-    int ret = -1;
+    int ret = -1, ret2;
     QEMUFile *f;
     int saved_vm_running;
     uint64_t vm_state_size;
@@ -2719,10 +2719,14 @@ int save_snapshot(const char *name, Error **errp)
     }
     ret = qemu_savevm_state(f, errp);
     vm_state_size = qemu_ftell(f);
-    qemu_fclose(f);
+    ret2 = qemu_fclose(f);
     if (ret < 0) {
         goto the_end;
     }
+    if (ret2 < 0) {
+        ret = ret2;
+        goto the_end;
+    }
 
     /* The bdrv_all_create_snapshot() call that follows acquires the AioContext
      * for itself.  BDRV_POLL_WHILE() does not support nested locking because
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14734.36471 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoQ-0002Pu-40; Thu, 29 Oct 2020 20:46:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14734.36471; Thu, 29 Oct 2020 20:46:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoQ-0002Pm-0b; Thu, 29 Oct 2020 20:46:22 +0000
Received: by outflank-mailman (input) for mailman id 14734;
 Thu, 29 Oct 2020 20:46:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEoP-0002Pf-6O
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1996cc78-45b2-4f53-8b02-c4f6789be078;
 Thu, 29 Oct 2020 20:46:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoO-0006jG-4l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoO-0000To-44
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEoP-0002Pf-6O
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:21 +0000
X-Inumbo-ID: 1996cc78-45b2-4f53-8b02-c4f6789be078
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1996cc78-45b2-4f53-8b02-c4f6789be078;
	Thu, 29 Oct 2020 20:46:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MBdqRcRic2pYSpIggAMmOnRXl5iKh+KEsT3BuVJCKiU=; b=ooY7Gjbyek0hsFIwTVM0zhV7Cj
	wU/hsH9KOMmkYaMPb7ldXddWbh5CfyR0qvr9Vbl6QF1wK9ZaFHYIAl7pDGx75myCMuZ3fqBREeGzj
	DOv4TZbebTiabXj2qHt30YCowbKCl/vwZktqdPCuxpRjf48NJsxvrVTTq8svANp72sfs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoO-0006jG-4l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoO-0000To-44
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/migration.c: Remove superfluous breaks
Message-Id: <E1kYEoO-0000To-44@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:46:20 +0000

commit eb9bd46ff658e05e2c0c71fc308f3b811afa87e1
Author:     Liao Pingfang <liao.pingfang@zte.com.cn>
AuthorDate: Mon Jul 13 17:04:38 2020 +0800
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:15:36 2020 +0200

    migration/migration.c: Remove superfluous breaks
    
    Remove superfluous breaks, as there is a "return" before them.
    
    Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
    Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 08519de56f..2ed9923227 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -986,7 +986,6 @@ static void fill_source_migration_info(MigrationInfo *info)
         /* no migration has happened ever */
         /* do not overwrite destination migration status */
         return;
-        break;
     case MIGRATION_STATUS_SETUP:
         info->has_status = true;
         info->has_total_time = false;
@@ -1105,7 +1104,6 @@ static void fill_destination_migration_info(MigrationInfo *info)
     switch (mis->state) {
     case MIGRATION_STATUS_NONE:
         return;
-        break;
     case MIGRATION_STATUS_SETUP:
     case MIGRATION_STATUS_CANCELLING:
     case MIGRATION_STATUS_CANCELLED:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14735.36474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoa-0002R6-4u; Thu, 29 Oct 2020 20:46:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14735.36474; Thu, 29 Oct 2020 20:46:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEoa-0002Qz-28; Thu, 29 Oct 2020 20:46:32 +0000
Received: by outflank-mailman (input) for mailman id 14735;
 Thu, 29 Oct 2020 20:46:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEoZ-0002Qm-5Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3269cf18-68c1-49b2-a9d3-fe3777a78752;
 Thu, 29 Oct 2020 20:46:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoY-0006jO-8b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoY-0000Ua-7o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEoZ-0002Qm-5Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:31 +0000
X-Inumbo-ID: 3269cf18-68c1-49b2-a9d3-fe3777a78752
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3269cf18-68c1-49b2-a9d3-fe3777a78752;
	Thu, 29 Oct 2020 20:46:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MINYB4YsWFzWYcTW5W1xJWfgKpfXL1hw0jMzl2MkM9M=; b=UgHAW2tJ+OYQxrVHhvrDySYjMj
	kUPcOxdbBhiR5c+2rvaUVMFOOEtZfaf+yARtHTJRqnRp7ZdWHKMfGUzSPwwyvAXl8uQxS7TJ3d1Pw
	zn4VdEgLZYWBN1GjgtFNZAVehjzYvMwbOL2aNRfLN/irPYJAMf/O4NnooCFux0XrKBhI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoY-0006jO-8b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoY-0000Ua-7o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/juanquintela/tags/migration-pull-request' into staging
Message-Id: <E1kYEoY-0000Ua-7o@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:46:30 +0000

commit beff47a2f6a8295161f98a9dac94e18e5376e749
Merge: 1a53dfee92284d3016a579ef31d53367e84d9dd8 eb9bd46ff658e05e2c0c71fc308f3b811afa87e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 16:33:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 16:33:23 2020 +0100

    Merge remote-tracking branch 'remotes/juanquintela/tags/migration-pull-request' into staging
    
    Migration Pull request
    
    It includes several fixes:
    
    - fix qemu_fclose(denis)
    - remove superfluous breaks (liao)
    - fix memory leak (zheng)
    
    Please apply
    
    [v1 & v2]
    
    There was one error on the huawei address of the 1st patch and mail
    was bouncing.  Fixed.
    
    # gpg: Signature made Mon 13 Jul 2020 18:51:34 BST
    # gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
    # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
    # gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
    # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723
    
    * remotes/juanquintela/tags/migration-pull-request:
      migration/migration.c: Remove superfluous breaks
      migration/savevm: respect qemu_fclose() error code in save_snapshot()
      migration: fix memory leak in qmp_migrate_set_parameters
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 migration/migration.c | 6 ++----
 migration/savevm.c    | 8 ++++++--
 2 files changed, 8 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14736.36478 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEok-0002Sc-8S; Thu, 29 Oct 2020 20:46:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14736.36478; Thu, 29 Oct 2020 20:46:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEok-0002SV-51; Thu, 29 Oct 2020 20:46:42 +0000
Received: by outflank-mailman (input) for mailman id 14736;
 Thu, 29 Oct 2020 20:46:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEoj-0002SM-OY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 91ed1c58-946c-4700-8c2e-404939f956e3;
 Thu, 29 Oct 2020 20:46:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoi-0006jZ-Q4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEoi-0000Wx-PI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEoj-0002SM-OY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:41 +0000
X-Inumbo-ID: 91ed1c58-946c-4700-8c2e-404939f956e3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 91ed1c58-946c-4700-8c2e-404939f956e3;
	Thu, 29 Oct 2020 20:46:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tN4FkVcxOZ/suSwQ9k7TNq0RJ216Y1M2wfxR3NW1SCE=; b=CetnHE7h2kD2tSy5oWaFAnoEfp
	xL1w2x2o0iY6ZKgR671zSG2BdYG5HxCy/B+mpL4ywtLctGjBxToaloqZ0MFtFaSIkXp1HUwotAwxa
	j8WZDdU+/Uhte/lXyRaMefPDQzl2rhElXVe35a6caEI7FnRnaa+lbDNu6/CoL5jnZCvw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoi-0006jZ-Q4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEoi-0000Wx-PI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Add an entry for OpenSBI firmware
Message-Id: <E1kYEoi-0000Wx-PI@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:46:40 +0000

commit e92fb01639cadbeb9c6fc5d5189e35ef3e45836f
Author:     Bin Meng <bmeng.cn@gmail.com>
AuthorDate: Fri Jun 26 06:13:40 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    MAINTAINERS: Add an entry for OpenSBI firmware
    
    List me as the maintainer for OpenSBI firmware related files.
    
    Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <1593177220-28143-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..80fa8837e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2681,6 +2681,13 @@ F: hw/i386/intel_iommu.c
 F: hw/i386/intel_iommu_internal.h
 F: include/hw/i386/intel_iommu.h
 
+OpenSBI Firmware
+M: Bin Meng <bmeng.cn@gmail.com>
+S: Supported
+F: pc-bios/opensbi-*
+F: .gitlab-ci.d/opensbi.yml
+F: .gitlab-ci.d/opensbi/
+
 Usermode Emulation
 ------------------
 Overall usermode emulation
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:46:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14738.36495 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEox-0002W2-Iw; Thu, 29 Oct 2020 20:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14738.36495; Thu, 29 Oct 2020 20:46:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEox-0002Vt-FQ; Thu, 29 Oct 2020 20:46:55 +0000
Received: by outflank-mailman (input) for mailman id 14738;
 Thu, 29 Oct 2020 20:46:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEov-0002TX-Vk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b886a93a-7b1e-42ef-a33c-344b5ffbb464;
 Thu, 29 Oct 2020 20:46:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEos-0006jj-Ta
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEos-0000XX-Sm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEov-0002TX-Vk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:54 +0000
X-Inumbo-ID: b886a93a-7b1e-42ef-a33c-344b5ffbb464
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b886a93a-7b1e-42ef-a33c-344b5ffbb464;
	Thu, 29 Oct 2020 20:46:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=okBgTBvylPlBNs4Gvfe4fq4aRwQCYD1ReKyHA1O56js=; b=04lxOPE/O5vsfXG17ynCYpitiX
	CwctnfNW4Rubpvz/XiNCAvbmKPKws1TmxR7C2wJMFO+FJ6fqIHpMiYzUQmzqYlcgerQhqLDmVEazC
	0zhbqLfaWRaBKB/D/QzjbIrXQe6UYoUDzoKyqrKDc+39OU2YRXlvSuqFTtW4uZs0UG+Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEos-0006jj-Ta
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEos-0000XX-Sm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:46:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/riscv: virt: Sort the SoC memmap table entries
Message-Id: <E1kYEos-0000XX-Sm@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:46:50 +0000

commit 2c44bbf32cda5fbf85b697e3a12127f59d2c2e80
Author:     Bin Meng <bin.meng@windriver.com>
AuthorDate: Thu Jul 2 20:21:51 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/riscv: virt: Sort the SoC memmap table entries
    
    Adjust the PCIe memory maps to follow the order.
    
    Signed-off-by: Bin Meng <bin.meng@windriver.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1593746511-19517-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/virt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index f7630c8a89..18283e262e 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -60,14 +60,14 @@ static const struct MemmapEntry {
     [VIRT_TEST] =        {   0x100000,        0x1000 },
     [VIRT_RTC] =         {   0x101000,        0x1000 },
     [VIRT_CLINT] =       {  0x2000000,       0x10000 },
+    [VIRT_PCIE_PIO] =    {  0x3000000,       0x10000 },
     [VIRT_PLIC] =        {  0xc000000,     0x4000000 },
     [VIRT_UART0] =       { 0x10000000,         0x100 },
     [VIRT_VIRTIO] =      { 0x10001000,        0x1000 },
     [VIRT_FLASH] =       { 0x20000000,     0x4000000 },
-    [VIRT_DRAM] =        { 0x80000000,           0x0 },
-    [VIRT_PCIE_MMIO] =   { 0x40000000,    0x40000000 },
-    [VIRT_PCIE_PIO] =    { 0x03000000,    0x00010000 },
     [VIRT_PCIE_ECAM] =   { 0x30000000,    0x10000000 },
+    [VIRT_PCIE_MMIO] =   { 0x40000000,    0x40000000 },
+    [VIRT_DRAM] =        { 0x80000000,           0x0 },
 };
 
 #define VIRT_FLASH_SECTOR_SIZE (256 * KiB)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14739.36500 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEp5-0002Zc-L4; Thu, 29 Oct 2020 20:47:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14739.36500; Thu, 29 Oct 2020 20:47:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEp5-0002ZR-Gz; Thu, 29 Oct 2020 20:47:03 +0000
Received: by outflank-mailman (input) for mailman id 14739;
 Thu, 29 Oct 2020 20:47:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEp4-0002Z2-EH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7ad08b85-be2f-4e9b-929c-00f628d6faa9;
 Thu, 29 Oct 2020 20:47:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEp3-0006ka-0r
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEp3-0000Y9-07
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEp4-0002Z2-EH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:02 +0000
X-Inumbo-ID: 7ad08b85-be2f-4e9b-929c-00f628d6faa9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7ad08b85-be2f-4e9b-929c-00f628d6faa9;
	Thu, 29 Oct 2020 20:47:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C6Ww4t9ifWwbjy6X5mhBRn5NLIdYu8kVIxP0Gu6OxYc=; b=prAHKzOKVOKk7tB8s8L0MBXV0Q
	ZJzenZBSmk0wqD27gH/yiT1i2TIXPLGA6aDidqY5C5jBEETKF5GqEqkt54gAAOfbZBx/PcQs9G7IX
	7qGPv2nbU3ALxz95qTwhwXza/jP4M1pTBDgaGl3QPrC486vpkLqYfpu5v3WWd7b6bK6Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEp3-0006ka-0r
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEp3-0000Y9-07
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] riscv: Unify Qemu's reset vector code path
Message-Id: <E1kYEp3-0000Y9-07@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:01 +0000

commit 43cf723adca9a5e188c664c3b606a585192a599c
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:46 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    riscv: Unify Qemu's reset vector code path
    
    Currently, all riscv machines except sifive_u have identical reset vector
    code implementations with memory addresses being different for all machines.
    They can be easily combined into a single function in common code.
    
    Move it to common function and let all the machines use the common function.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-2-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c         | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  1 -
 hw/riscv/spike.c        | 41 +++--------------------------------------
 hw/riscv/virt.c         | 40 +++-------------------------------------
 include/hw/riscv/boot.h |  2 ++
 5 files changed, 54 insertions(+), 76 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index adb421b91b..3df802380a 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -26,8 +26,11 @@
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
 #include "elf.h"
+#include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 
+#include <libfdt.h>
+
 #if defined(TARGET_RISCV32)
 # define KERNEL_BOOT_ADDRESS 0x80400000
 #else
@@ -155,3 +158,46 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
 
     return *start + size;
 }
+
+void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
+                               hwaddr rom_size, void *fdt)
+{
+    int i;
+
+    /* reset vector */
+    uint32_t reset_vec[8] = {
+        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
+        0xf1402573,                  /*     csrr   a0, mhartid  */
+#if defined(TARGET_RISCV32)
+        0x0182a283,                  /*     lw     t0, 24(t0) */
+#elif defined(TARGET_RISCV64)
+        0x0182b283,                  /*     ld     t0, 24(t0) */
+#endif
+        0x00028067,                  /*     jr     t0 */
+        0x00000000,
+        start_addr,                  /* start: .dword */
+        0x00000000,
+                                     /* dtb: */
+    };
+
+    /* copy in the reset vector in little_endian byte order */
+    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+        reset_vec[i] = cpu_to_le32(reset_vec[i]);
+    }
+    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
+                          rom_base, &address_space_memory);
+
+    /* copy in the device tree */
+    if (fdt_pack(fdt) || fdt_totalsize(fdt) >
+        rom_size - sizeof(reset_vec)) {
+        error_report("not enough space to store device-tree");
+        exit(1);
+    }
+    qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
+    rom_add_blob_fixed_as("mrom.fdt", fdt, fdt_totalsize(fdt),
+                           rom_base + sizeof(reset_vec),
+                           &address_space_memory);
+
+    return;
+}
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 7851326988..0695c93d2c 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -56,7 +56,6 @@
 #include "sysemu/device_tree.h"
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
 
 #include <libfdt.h>
 
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index c107bf3ba1..a8a0588824 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -41,9 +41,6 @@
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
-
-#include <libfdt.h>
 
 #if defined(TARGET_RISCV32)
 # define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf"
@@ -165,7 +162,6 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
-    int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
     /* Initialize SOC */
@@ -212,40 +208,9 @@ static void spike_board_init(MachineState *machine)
         }
     }
 
-    /* reset vector */
-    uint32_t reset_vec[8] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
-        0xf1402573,                  /*     csrr   a0, mhartid  */
-#if defined(TARGET_RISCV32)
-        0x0182a283,                  /*     lw     t0, 24(t0) */
-#elif defined(TARGET_RISCV64)
-        0x0182b283,                  /*     ld     t0, 24(t0) */
-#endif
-        0x00028067,                  /*     jr     t0 */
-        0x00000000,
-        memmap[SPIKE_DRAM].base,     /* start: .dword DRAM_BASE */
-        0x00000000,
-                                     /* dtb: */
-    };
-
-    /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
-        reset_vec[i] = cpu_to_le32(reset_vec[i]);
-    }
-    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[SPIKE_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[SPIKE_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[SPIKE_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
+    /* load the reset vector */
+    riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
+                              memmap[SPIKE_MROM].size, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
     htif_mm_init(system_memory, mask_rom, &s->soc.harts[0].env, serial_hd(0));
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 18283e262e..3463cf54aa 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -39,12 +39,9 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/gpex.h"
 
-#include <libfdt.h>
-
 #if defined(TARGET_RISCV32)
 # define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin"
 #else
@@ -535,40 +532,9 @@ static void virt_machine_init(MachineState *machine)
         start_addr = virt_memmap[VIRT_FLASH].base;
     }
 
-    /* reset vector */
-    uint32_t reset_vec[8] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
-        0xf1402573,                  /*     csrr   a0, mhartid  */
-#if defined(TARGET_RISCV32)
-        0x0182a283,                  /*     lw     t0, 24(t0) */
-#elif defined(TARGET_RISCV64)
-        0x0182b283,                  /*     ld     t0, 24(t0) */
-#endif
-        0x00028067,                  /*     jr     t0 */
-        0x00000000,
-        start_addr,                  /* start: .dword */
-        0x00000000,
-                                     /* dtb: */
-    };
-
-    /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
-        reset_vec[i] = cpu_to_le32(reset_vec[i]);
-    }
-    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[VIRT_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[VIRT_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[VIRT_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
+    /* load the reset vector */
+    riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
+                              virt_memmap[VIRT_MROM].size, s->fdt);
 
     /* create PLIC hart topology configuration string */
     plic_hart_config_len = (strlen(VIRT_PLIC_HART_CONFIG) + 1) * smp_cpus;
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 9daa98da08..3e9759c89a 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -35,5 +35,7 @@ target_ulong riscv_load_kernel(const char *kernel_filename,
                                symbol_fn_t sym_cb);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
+void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
+                               hwaddr rom_size, void *fdt);
 
 #endif /* RISCV_BOOT_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14742.36501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpF-0002c2-LY; Thu, 29 Oct 2020 20:47:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14742.36501; Thu, 29 Oct 2020 20:47:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpF-0002bu-Ia; Thu, 29 Oct 2020 20:47:13 +0000
Received: by outflank-mailman (input) for mailman id 14742;
 Thu, 29 Oct 2020 20:47:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEpE-0002bl-MM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a9a1a854-cbb2-4d78-a7b7-fcb74232a771;
 Thu, 29 Oct 2020 20:47:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpD-0006kt-4g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpD-0000Yx-3s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEpE-0002bl-MM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:12 +0000
X-Inumbo-ID: a9a1a854-cbb2-4d78-a7b7-fcb74232a771
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a9a1a854-cbb2-4d78-a7b7-fcb74232a771;
	Thu, 29 Oct 2020 20:47:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KFsUrkm4aQsY/8G9aqoyt1jD2aFZJm1Xusfjz9zkdoM=; b=DIFkEzx4WgD9hVloCblBmypWlh
	F3QvtvmXqVZQ1dVw4ciF9R4S4rplzpan/jbbbJoqnPxyVHgTKmQF+QT2O+t31zaGVXFaev+2NxXt+
	JrHaHm8aN1O+6h5Q9NTffL91j3zLiz/Nyw4JMTpgC7eqoEMtw4B6Kze3F8fEFTg12BSI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpD-0006kt-4g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpD-0000Yx-3s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] RISC-V: Copy the fdt in dram instead of ROM
Message-Id: <E1kYEpD-0000Yx-3s@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:11 +0000

commit 66b1205bc5ab8bb3f5e12fa4155bbeb56e6724e9
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:47 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    RISC-V: Copy the fdt in dram instead of ROM
    
    Currently, the fdt is copied to the ROM after the reset vector. The firmware
    has to copy it to DRAM. Instead of this, directly copy the device tree to a
    pre-computed dram address. The device tree load address should be as far as
    possible from kernel and initrd images. That's why it is kept at the end of
    the DRAM or 4GB whichever is lesser.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-3-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c         | 53 +++++++++++++++++++++++++++++++++++--------------
 hw/riscv/sifive_u.c     | 28 ++++++++++++--------------
 hw/riscv/spike.c        |  7 ++++++-
 hw/riscv/virt.c         |  7 ++++++-
 include/hw/riscv/boot.h |  4 +++-
 5 files changed, 66 insertions(+), 33 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 3df802380a..c62f545f15 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -159,45 +159,68 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
     return *start + size;
 }
 
+uint32_t riscv_load_fdt(hwaddr dram_base, uint64_t mem_size, void *fdt)
+{
+    uint32_t temp, fdt_addr;
+    hwaddr dram_end = dram_base + mem_size;
+    int fdtsize = fdt_totalsize(fdt);
+
+    if (fdtsize <= 0) {
+        error_report("invalid device-tree");
+        exit(1);
+    }
+
+    /*
+     * We should put fdt as far as possible to avoid kernel/initrd overwriting
+     * its content. But it should be addressable by 32 bit system as well.
+     * Thus, put it at an aligned address that less than fdt size from end of
+     * dram or 4GB whichever is lesser.
+     */
+    temp = MIN(dram_end, 4096 * MiB);
+    fdt_addr = QEMU_ALIGN_DOWN(temp - fdtsize, 2 * MiB);
+
+    fdt_pack(fdt);
+    /* copy in the device tree */
+    qemu_fdt_dumpdtb(fdt, fdtsize);
+
+    rom_add_blob_fixed_as("fdt", fdt, fdtsize, fdt_addr,
+                          &address_space_memory);
+
+    return fdt_addr;
+}
+
 void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
-                               hwaddr rom_size, void *fdt)
+                               hwaddr rom_size,
+                               uint32_t fdt_load_addr, void *fdt)
 {
     int i;
 
     /* reset vector */
-    uint32_t reset_vec[8] = {
+    uint32_t reset_vec[10] = {
         0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
         0xf1402573,                  /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
+        0x0202a583,                  /*     lw     a1, 32(t0) */
         0x0182a283,                  /*     lw     t0, 24(t0) */
 #elif defined(TARGET_RISCV64)
+        0x0202b583,                  /*     ld     a1, 32(t0) */
         0x0182b283,                  /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                  /*     jr     t0 */
         0x00000000,
         start_addr,                  /* start: .dword */
+        0x00000000,
+        fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
                                      /* dtb: */
     };
 
     /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+    for (i = 0; i < ARRAY_SIZE(reset_vec); i++) {
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           rom_base, &address_space_memory);
 
-    /* copy in the device tree */
-    if (fdt_pack(fdt) || fdt_totalsize(fdt) >
-        rom_size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
-    rom_add_blob_fixed_as("mrom.fdt", fdt, fdt_totalsize(fdt),
-                           rom_base + sizeof(reset_vec),
-                           &address_space_memory);
-
     return;
 }
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 0695c93d2c..39923209f4 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -379,6 +379,7 @@ static void sifive_u_machine_init(MachineState *machine)
     MemoryRegion *flash0 = g_new(MemoryRegion, 1);
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
     int i;
+    uint32_t fdt_load_addr;
 
     /* Initialize SoC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC);
@@ -450,40 +451,37 @@ static void sifive_u_machine_init(MachineState *machine)
         }
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DRAM].base,
+                                   machine->ram_size, s->fdt);
+
     /* reset vector */
-    uint32_t reset_vec[8] = {
+    uint32_t reset_vec[11] = {
         s->msel,                       /* MSEL pin state */
         0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x01c28593,                    /*     addi   a1, t0, %pcrel_lo(1b) */
         0xf1402573,                    /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
+        0x0202a583,                    /*     lw     a1, 32(t0) */
         0x0182a283,                    /*     lw     t0, 24(t0) */
 #elif defined(TARGET_RISCV64)
-        0x0182e283,                    /*     lwu    t0, 24(t0) */
+        0x0202b583,                    /*     ld     a1, 32(t0) */
+        0x0182b283,                    /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                    /*     jr     t0 */
         0x00000000,
         start_addr,                    /* start: .dword */
+        0x00000000,
+        fdt_load_addr,                 /* fdt_laddr: .dword */
+        0x00000000,
                                        /* dtb: */
     };
 
     /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+    for (i = 0; i < ARRAY_SIZE(reset_vec); i++) {
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           memmap[SIFIVE_U_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[SIFIVE_U_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[SIFIVE_U_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
 }
 
 static bool sifive_u_machine_get_start_in_flash(Object *obj, Error **errp)
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index a8a0588824..13fa0455e3 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -163,6 +163,7 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     unsigned int smp_cpus = machine->smp.cpus;
+    uint32_t fdt_load_addr;
 
     /* Initialize SOC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc,
@@ -208,9 +209,13 @@ static void spike_board_init(MachineState *machine)
         }
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[SPIKE_DRAM].base,
+                                   machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
-                              memmap[SPIKE_MROM].size, s->fdt);
+                              memmap[SPIKE_MROM].size,
+                              fdt_load_addr, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
     htif_mm_init(system_memory, mask_rom, &s->soc.harts[0].env, serial_hd(0));
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3463cf54aa..9d87319f70 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -478,6 +478,7 @@ static void virt_machine_init(MachineState *machine)
     char *plic_hart_config;
     size_t plic_hart_config_len;
     target_ulong start_addr = memmap[VIRT_DRAM].base;
+    uint32_t fdt_load_addr;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
@@ -532,9 +533,13 @@ static void virt_machine_init(MachineState *machine)
         start_addr = virt_memmap[VIRT_FLASH].base;
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[VIRT_DRAM].base,
+                                   machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
-                              virt_memmap[VIRT_MROM].size, s->fdt);
+                              virt_memmap[VIRT_MROM].size,
+                              fdt_load_addr, s->fdt);
 
     /* create PLIC hart topology configuration string */
     plic_hart_config_len = (strlen(VIRT_PLIC_HART_CONFIG) + 1) * smp_cpus;
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 3e9759c89a..35b6ddf710 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -35,7 +35,9 @@ target_ulong riscv_load_kernel(const char *kernel_filename,
                                symbol_fn_t sym_cb);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
+uint32_t riscv_load_fdt(hwaddr dram_start, uint64_t dram_size, void *fdt);
 void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
-                               hwaddr rom_size, void *fdt);
+                               hwaddr rom_size,
+                               uint32_t fdt_load_addr, void *fdt);
 
 #endif /* RISCV_BOOT_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14743.36506 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpP-0002dr-OM; Thu, 29 Oct 2020 20:47:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14743.36506; Thu, 29 Oct 2020 20:47:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpP-0002dj-LL; Thu, 29 Oct 2020 20:47:23 +0000
Received: by outflank-mailman (input) for mailman id 14743;
 Thu, 29 Oct 2020 20:47:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEpO-0002da-OE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ff7ab5a-f71f-488a-a570-915048bf9271;
 Thu, 29 Oct 2020 20:47:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpN-0006l5-8N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpN-0000Zg-7c
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEpO-0002da-OE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:22 +0000
X-Inumbo-ID: 6ff7ab5a-f71f-488a-a570-915048bf9271
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ff7ab5a-f71f-488a-a570-915048bf9271;
	Thu, 29 Oct 2020 20:47:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iK5gKU0mKe+FUlwenUml3Ay6LF64WsXmqDue8w9tMN8=; b=WtQmlTxQVaq/mq4bKEUoaKqDmv
	2vFKhHtzf2o9K6LT29daIreLfcTzb80hDcsmEN7dGqK8EZCTzCmWlfSoP+Y1RNFqcNOKeCDltP8/F
	OEM5RcKKTufPohJqvzwWn/TAAD2rQTCWd8DmXTzRzN52PSwL8K1n7yOr6XvMAcWRWTLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpN-0006l5-8N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpN-0000Zg-7c
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] riscv: Add opensbi firmware dynamic support
Message-Id: <E1kYEpN-0000Zg-7c@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:21 +0000

commit dc144fe13d336caac2f03b57f1df738e84f984ec
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:48 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    riscv: Add opensbi firmware dynamic support
    
    OpenSBI is the default firmware in Qemu and has various firmware loading
    options. Currently, qemu loader uses fw_jump which has a compile time
    pre-defined address where fdt & kernel image must reside. This puts a
    constraint on image size of the Linux kernel depending on the fdt location
    and available memory. However, fw_dynamic allows the loader to specify
    the next stage location (i.e. Linux kernel/U-Boot) in memory and other
    configurable boot options available in OpenSBI.
    
    Add support for OpenSBI dynamic firmware loading support. This doesn't
    break existing setup and fw_jump will continue to work as it is. Any
    other firmware will continue to work without any issues as long as it
    doesn't expect anything specific from loader in "a2" register.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-4-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c                 | 42 ++++++++++++++++++++++++++---
 hw/riscv/sifive_u.c             | 20 ++++++++++----
 hw/riscv/spike.c                | 13 ++++++---
 hw/riscv/virt.c                 | 12 ++++++---
 include/hw/riscv/boot.h         |  5 +++-
 include/hw/riscv/boot_opensbi.h | 58 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 134 insertions(+), 16 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index c62f545f15..feff6e3f4e 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -25,6 +25,7 @@
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
+#include "hw/riscv/boot_opensbi.h"
 #include "elf.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
@@ -33,8 +34,10 @@
 
 #if defined(TARGET_RISCV32)
 # define KERNEL_BOOT_ADDRESS 0x80400000
+#define fw_dynamic_info_data(__val)     cpu_to_le32(__val)
 #else
 # define KERNEL_BOOT_ADDRESS 0x80200000
+#define fw_dynamic_info_data(__val)     cpu_to_le64(__val)
 #endif
 
 void riscv_find_and_load_firmware(MachineState *machine,
@@ -189,15 +192,45 @@ uint32_t riscv_load_fdt(hwaddr dram_base, uint64_t mem_size, void *fdt)
     return fdt_addr;
 }
 
+void riscv_rom_copy_firmware_info(hwaddr rom_base, hwaddr rom_size,
+                              uint32_t reset_vec_size, uint64_t kernel_entry)
+{
+    struct fw_dynamic_info dinfo;
+    size_t dinfo_len;
+
+    dinfo.magic = fw_dynamic_info_data(FW_DYNAMIC_INFO_MAGIC_VALUE);
+    dinfo.version = fw_dynamic_info_data(FW_DYNAMIC_INFO_VERSION);
+    dinfo.next_mode = fw_dynamic_info_data(FW_DYNAMIC_INFO_NEXT_MODE_S);
+    dinfo.next_addr = fw_dynamic_info_data(kernel_entry);
+    dinfo.options = 0;
+    dinfo.boot_hart = 0;
+    dinfo_len = sizeof(dinfo);
+
+    /**
+     * copy the dynamic firmware info. This information is specific to
+     * OpenSBI but doesn't break any other firmware as long as they don't
+     * expect any certain value in "a2" register.
+     */
+    if (dinfo_len > (rom_size - reset_vec_size)) {
+        error_report("not enough space to store dynamic firmware info");
+        exit(1);
+    }
+
+    rom_add_blob_fixed_as("mrom.finfo", &dinfo, dinfo_len,
+                           rom_base + reset_vec_size,
+                           &address_space_memory);
+}
+
 void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
-                               hwaddr rom_size,
+                               hwaddr rom_size, uint64_t kernel_entry,
                                uint32_t fdt_load_addr, void *fdt)
 {
     int i;
 
     /* reset vector */
     uint32_t reset_vec[10] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
+        0x02828613,                  /*     addi   a2, t0, %pcrel_lo(1b) */
         0xf1402573,                  /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
         0x0202a583,                  /*     lw     a1, 32(t0) */
@@ -207,12 +240,11 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
         0x0182b283,                  /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                  /*     jr     t0 */
-        0x00000000,
         start_addr,                  /* start: .dword */
         0x00000000,
         fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
-                                     /* dtb: */
+                                     /* fw_dyn: */
     };
 
     /* copy in the reset vector in little_endian byte order */
@@ -221,6 +253,8 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           rom_base, &address_space_memory);
+    riscv_rom_copy_firmware_info(rom_base, rom_size, sizeof(reset_vec),
+                                 kernel_entry);
 
     return;
 }
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 39923209f4..46e6ed90ca 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -380,6 +380,7 @@ static void sifive_u_machine_init(MachineState *machine)
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
     int i;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
 
     /* Initialize SoC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC);
@@ -436,8 +437,7 @@ static void sifive_u_machine_init(MachineState *machine)
     riscv_find_and_load_firmware(machine, BIOS_FILENAME, start_addr, NULL);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  NULL);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename, NULL);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -449,6 +449,12 @@ static void sifive_u_machine_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     /* Compute the fdt load address in dram */
@@ -458,7 +464,8 @@ static void sifive_u_machine_init(MachineState *machine)
     /* reset vector */
     uint32_t reset_vec[11] = {
         s->msel,                       /* MSEL pin state */
-        0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
+        0x02828613,                    /*     addi   a2, t0, %pcrel_lo(1b) */
         0xf1402573,                    /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
         0x0202a583,                    /*     lw     a1, 32(t0) */
@@ -468,12 +475,11 @@ static void sifive_u_machine_init(MachineState *machine)
         0x0182b283,                    /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                    /*     jr     t0 */
-        0x00000000,
         start_addr,                    /* start: .dword */
         0x00000000,
         fdt_load_addr,                 /* fdt_laddr: .dword */
         0x00000000,
-                                       /* dtb: */
+                                       /* fw_dyn: */
     };
 
     /* copy in the reset vector in little_endian byte order */
@@ -482,6 +488,10 @@ static void sifive_u_machine_init(MachineState *machine)
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           memmap[SIFIVE_U_MROM].base, &address_space_memory);
+
+    riscv_rom_copy_firmware_info(memmap[SIFIVE_U_MROM].base,
+                                 memmap[SIFIVE_U_MROM].size,
+                                 sizeof(reset_vec), kernel_entry);
 }
 
 static bool sifive_u_machine_get_start_in_flash(Object *obj, Error **errp)
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 13fa0455e3..b17d96aec7 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -164,6 +164,7 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     unsigned int smp_cpus = machine->smp.cpus;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
 
     /* Initialize SOC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc,
@@ -194,8 +195,8 @@ static void spike_board_init(MachineState *machine)
                                  htif_symbol_callback);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  htif_symbol_callback);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename,
+                                         htif_symbol_callback);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -207,6 +208,12 @@ static void spike_board_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     /* Compute the fdt load address in dram */
@@ -214,7 +221,7 @@ static void spike_board_init(MachineState *machine)
                                    machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
-                              memmap[SPIKE_MROM].size,
+                              memmap[SPIKE_MROM].size, kernel_entry,
                               fdt_load_addr, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 9d87319f70..bc25ec69f7 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -479,6 +479,7 @@ static void virt_machine_init(MachineState *machine)
     size_t plic_hart_config_len;
     target_ulong start_addr = memmap[VIRT_DRAM].base;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
@@ -510,8 +511,7 @@ static void virt_machine_init(MachineState *machine)
                                  memmap[VIRT_DRAM].base, NULL);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  NULL);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename, NULL);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -523,6 +523,12 @@ static void virt_machine_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     if (drive_get(IF_PFLASH, 0, 0)) {
@@ -538,7 +544,7 @@ static void virt_machine_init(MachineState *machine)
                                    machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
-                              virt_memmap[VIRT_MROM].size,
+                              virt_memmap[VIRT_MROM].size, kernel_entry,
                               fdt_load_addr, s->fdt);
 
     /* create PLIC hart topology configuration string */
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 35b6ddf710..451338780a 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -37,7 +37,10 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
 uint32_t riscv_load_fdt(hwaddr dram_start, uint64_t dram_size, void *fdt);
 void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
-                               hwaddr rom_size,
+                               hwaddr rom_size, uint64_t kernel_entry,
                                uint32_t fdt_load_addr, void *fdt);
+void riscv_rom_copy_firmware_info(hwaddr rom_base, hwaddr rom_size,
+                                  uint32_t reset_vec_size,
+                                  uint64_t kernel_entry);
 
 #endif /* RISCV_BOOT_H */
diff --git a/include/hw/riscv/boot_opensbi.h b/include/hw/riscv/boot_opensbi.h
new file mode 100644
index 0000000000..0d5ddd6c3d
--- /dev/null
+++ b/include/hw/riscv/boot_opensbi.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+/*
+ * Copyright (c) 2019 Western Digital Corporation or its affiliates.
+ *
+ * Based on include/sbi/{fw_dynamic.h,sbi_scratch.h} from the OpenSBI project.
+ */
+#ifndef OPENSBI_H
+#define OPENSBI_H
+
+/** Expected value of info magic ('OSBI' ascii string in hex) */
+#define FW_DYNAMIC_INFO_MAGIC_VALUE     0x4942534f
+
+/** Maximum supported info version */
+#define FW_DYNAMIC_INFO_VERSION         0x2
+
+/** Possible next mode values */
+#define FW_DYNAMIC_INFO_NEXT_MODE_U     0x0
+#define FW_DYNAMIC_INFO_NEXT_MODE_S     0x1
+#define FW_DYNAMIC_INFO_NEXT_MODE_M     0x3
+
+enum sbi_scratch_options {
+    /** Disable prints during boot */
+    SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
+    /** Enable runtime debug prints */
+    SBI_SCRATCH_DEBUG_PRINTS = (1 << 1),
+};
+
+/** Representation dynamic info passed by previous booting stage */
+struct fw_dynamic_info {
+    /** Info magic */
+    target_long magic;
+    /** Info version */
+    target_long version;
+    /** Next booting stage address */
+    target_long next_addr;
+    /** Next booting stage mode */
+    target_long next_mode;
+    /** Options for OpenSBI library */
+    target_long options;
+    /**
+     * Preferred boot HART id
+     *
+     * It is possible that the previous booting stage uses same link
+     * address as the FW_DYNAMIC firmware. In this case, the relocation
+     * lottery mechanism can potentially overwrite the previous booting
+     * stage while other HARTs are still running in the previous booting
+     * stage leading to boot-time crash. To avoid this boot-time crash,
+     * the previous booting stage can specify last HART that will jump
+     * to the FW_DYNAMIC firmware as the preferred boot HART.
+     *
+     * To avoid specifying a preferred boot HART, the previous booting
+     * stage can set it to -1UL which will force the FW_DYNAMIC firmware
+     * to use the relocation lottery mechanism.
+     */
+    target_long boot_hart;
+};
+
+#endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14744.36510 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpZ-0002fO-Pw; Thu, 29 Oct 2020 20:47:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14744.36510; Thu, 29 Oct 2020 20:47:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpZ-0002fG-Mx; Thu, 29 Oct 2020 20:47:33 +0000
Received: by outflank-mailman (input) for mailman id 14744;
 Thu, 29 Oct 2020 20:47:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEpY-0002f6-HX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0deff1eb-c8c3-4b56-b5d9-0c9423b9461b;
 Thu, 29 Oct 2020 20:47:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpX-0006lD-Bo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpX-0000aJ-B8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEpY-0002f6-HX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:32 +0000
X-Inumbo-ID: 0deff1eb-c8c3-4b56-b5d9-0c9423b9461b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0deff1eb-c8c3-4b56-b5d9-0c9423b9461b;
	Thu, 29 Oct 2020 20:47:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7FpSWt1aeV/V/ETFgABEIQIPTxFe8Rh3mwQ8JMlHsi8=; b=olClyAes+/KXYyxBfHoN0Ym5GE
	891lJy8yCK5sAD8BFlYr2PliRR5r4TWX1x/g6U/E4H1EvetxwjsNXjtcPCiHR0frS9d6fUQ3VvYBa
	fskb6os3HARmMnJj6QO94fvyln+hrWx1XoLpD4nLbYjUU6une/orKdJbEOT3kQnfg92E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpX-0006lD-Bo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpX-0000aJ-B8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] RISC-V: Support 64 bit start address
Message-Id: <E1kYEpX-0000aJ-B8@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:31 +0000

commit 8590f53661ec678fd3aa97b4da212b0c00056c2e
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:49 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    RISC-V: Support 64 bit start address
    
    Even though the start address in ROM code is declared as a 64 bit address
    for RV64, it can't be used as upper bits are set to zero in ROM code.
    
    Update the ROM code correctly to reflect the 64bit value.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-5-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c     | 6 +++++-
 hw/riscv/sifive_u.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index feff6e3f4e..4c6c101ff1 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -226,7 +226,11 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
                                uint32_t fdt_load_addr, void *fdt)
 {
     int i;
+    uint32_t start_addr_hi32 = 0x00000000;
 
+    #if defined(TARGET_RISCV64)
+    start_addr_hi32 = start_addr >> 32;
+    #endif
     /* reset vector */
     uint32_t reset_vec[10] = {
         0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
@@ -241,7 +245,7 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
 #endif
         0x00028067,                  /*     jr     t0 */
         start_addr,                  /* start: .dword */
-        0x00000000,
+        start_addr_hi32,
         fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
                                      /* fw_dyn: */
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 46e6ed90ca..6595ab3f87 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -378,6 +378,7 @@ static void sifive_u_machine_init(MachineState *machine)
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *flash0 = g_new(MemoryRegion, 1);
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
+    uint32_t start_addr_hi32 = 0x00000000;
     int i;
     uint32_t fdt_load_addr;
     uint64_t kernel_entry;
@@ -460,6 +461,9 @@ static void sifive_u_machine_init(MachineState *machine)
     /* Compute the fdt load address in dram */
     fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DRAM].base,
                                    machine->ram_size, s->fdt);
+    #if defined(TARGET_RISCV64)
+    start_addr_hi32 = start_addr >> 32;
+    #endif
 
     /* reset vector */
     uint32_t reset_vec[11] = {
@@ -476,7 +480,7 @@ static void sifive_u_machine_init(MachineState *machine)
 #endif
         0x00028067,                    /*     jr     t0 */
         start_addr,                    /* start: .dword */
-        0x00000000,
+        start_addr_hi32,
         fdt_load_addr,                 /* fdt_laddr: .dword */
         0x00000000,
                                        /* fw_dyn: */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14747.36515 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpn-0002hQ-Ru; Thu, 29 Oct 2020 20:47:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14747.36515; Thu, 29 Oct 2020 20:47:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpn-0002hD-Oa; Thu, 29 Oct 2020 20:47:47 +0000
Received: by outflank-mailman (input) for mailman id 14747;
 Thu, 29 Oct 2020 20:47:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEpm-0002h4-PQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8219c38a-9901-4811-a80a-edd487601023;
 Thu, 29 Oct 2020 20:47:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEph-0006mp-FT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEph-0000cZ-Ee
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEpm-0002h4-PQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:46 +0000
X-Inumbo-ID: 8219c38a-9901-4811-a80a-edd487601023
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8219c38a-9901-4811-a80a-edd487601023;
	Thu, 29 Oct 2020 20:47:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=USw2s6Gq95Bu0e4GpjoQAaxX0PhmuBkBF1Kh2FPcSds=; b=lDRejCGO40CEOkaqL8Btz/IQs7
	HmPdYdN1zfiwKLzFDoeNCQ+I6/MAojiVuv8VPPuNWCuuCzwHlOW07+jKUcIcXpVybzpApk/AAYIGN
	McWgySoxFesSIr6QWFQtNoezxU8bUsFVUkA+KU2JaTPCnZQjjzvxYn9qCA1rtDuoAVqs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEph-0006mp-FT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEph-0000cZ-Ee
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/riscv: Modify MROM size to end at 0x10000
Message-Id: <E1kYEph-0000cZ-Ee@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:41 +0000

commit 9eb8b14a70e57bc1449afc08aa4bf3131ee680d8
Author:     Bin Meng <bin.meng@windriver.com>
AuthorDate: Thu Jul 9 03:05:43 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/riscv: Modify MROM size to end at 0x10000
    
    At present the size of Mask ROM for sifive_u / spike / virt machines
    is set to 0x11000, which ends at an unusual address. This changes the
    size to 0xf000 so that it ends at 0x10000.
    
    Signed-off-by: Bin Meng <bin.meng@windriver.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <1594289144-24723-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_u.c | 2 +-
 hw/riscv/spike.c    | 2 +-
 hw/riscv/virt.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 6595ab3f87..19a976c9a6 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -70,7 +70,7 @@ static const struct MemmapEntry {
     hwaddr size;
 } sifive_u_memmap[] = {
     [SIFIVE_U_DEBUG] =    {        0x0,      0x100 },
-    [SIFIVE_U_MROM] =     {     0x1000,    0x11000 },
+    [SIFIVE_U_MROM] =     {     0x1000,     0xf000 },
     [SIFIVE_U_CLINT] =    {  0x2000000,    0x10000 },
     [SIFIVE_U_L2LIM] =    {  0x8000000,  0x2000000 },
     [SIFIVE_U_PLIC] =     {  0xc000000,  0x4000000 },
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index b17d96aec7..7b23a297fc 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -52,7 +52,7 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } spike_memmap[] = {
-    [SPIKE_MROM] =     {     0x1000,    0x11000 },
+    [SPIKE_MROM] =     {     0x1000,     0xf000 },
     [SPIKE_CLINT] =    {  0x2000000,    0x10000 },
     [SPIKE_DRAM] =     { 0x80000000,        0x0 },
 };
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index bc25ec69f7..55a907bb35 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -53,7 +53,7 @@ static const struct MemmapEntry {
     hwaddr size;
 } virt_memmap[] = {
     [VIRT_DEBUG] =       {        0x0,         0x100 },
-    [VIRT_MROM] =        {     0x1000,       0x11000 },
+    [VIRT_MROM] =        {     0x1000,        0xf000 },
     [VIRT_TEST] =        {   0x100000,        0x1000 },
     [VIRT_RTC] =         {   0x101000,        0x1000 },
     [VIRT_CLINT] =       {  0x2000000,       0x10000 },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:47:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:47:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14748.36517 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpt-0002iW-Su; Thu, 29 Oct 2020 20:47:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14748.36517; Thu, 29 Oct 2020 20:47:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEpt-0002iP-Pu; Thu, 29 Oct 2020 20:47:53 +0000
Received: by outflank-mailman (input) for mailman id 14748;
 Thu, 29 Oct 2020 20:47:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEps-0002iI-MM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d93f54d5-ea44-4b74-aea3-7d30eb042bbf;
 Thu, 29 Oct 2020 20:47:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpr-0006mx-Iz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEpr-0000dC-IH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEps-0002iI-MM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:52 +0000
X-Inumbo-ID: d93f54d5-ea44-4b74-aea3-7d30eb042bbf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d93f54d5-ea44-4b74-aea3-7d30eb042bbf;
	Thu, 29 Oct 2020 20:47:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lzyJ0sxUJG7HIrLFqr5mrAl1h2/r66rW8z8+3Rv0DQQ=; b=x2kr1bUGphIY33Rj9u2ZNHoh00
	QiqzSIBeutyIzA5ILxXStGknmWhyyL36mgNjeCndh0JJbDaBdb7HVwYL/Fxq+ECDJgER3Vx9nLvCn
	c0xLRyqw6gUjsq2qI8Rghr/J/8TVWtgeKe1GIj4xKDn+8QZqO0gj73qOI/byJGG9Pznc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpr-0006mx-Iz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEpr-0000dC-IH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:47:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
Message-Id: <E1kYEpr-0000dC-IH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:47:51 +0000

commit 7acafcfa844fd93f5ff073077007627338bd6739
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:15 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
    
    gvec should provide vecop_list to avoid:
    "tcg_tcg_assert_listed_vecop: code should not be reached bug" assertion.
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-2-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index dc333e6a91..433cdacbe1 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -958,22 +958,27 @@ static void gen_rsub_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b)
 static void tcg_gen_gvec_rsubs(unsigned vece, uint32_t dofs, uint32_t aofs,
                                TCGv_i64 c, uint32_t oprsz, uint32_t maxsz)
 {
+    static const TCGOpcode vecop_list[] = { INDEX_op_sub_vec, 0 };
     static const GVecGen2s rsub_op[4] = {
         { .fni8 = gen_vec_rsub8_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs8,
+          .opt_opc = vecop_list,
           .vece = MO_8 },
         { .fni8 = gen_vec_rsub16_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs16,
+          .opt_opc = vecop_list,
           .vece = MO_16 },
         { .fni4 = gen_rsub_i32,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs32,
+          .opt_opc = vecop_list,
           .vece = MO_32 },
         { .fni8 = gen_rsub_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs64,
+          .opt_opc = vecop_list,
           .prefer_i64 = TCG_TARGET_REG_BITS == 64,
           .vece = MO_64 },
     };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14749.36523 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEq4-0002me-0H; Thu, 29 Oct 2020 20:48:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14749.36523; Thu, 29 Oct 2020 20:48:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEq3-0002mS-Sw; Thu, 29 Oct 2020 20:48:03 +0000
Received: by outflank-mailman (input) for mailman id 14749;
 Thu, 29 Oct 2020 20:48:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEq2-0002mH-TY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6fa0c7eb-bdc6-4f85-825d-1cb2dbb1a232;
 Thu, 29 Oct 2020 20:48:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEq1-0006nl-Mg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEq1-0000e4-Lu
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEq2-0002mH-TY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:02 +0000
X-Inumbo-ID: 6fa0c7eb-bdc6-4f85-825d-1cb2dbb1a232
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6fa0c7eb-bdc6-4f85-825d-1cb2dbb1a232;
	Thu, 29 Oct 2020 20:48:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gou4lCbrflVELR6cVzTOUnzVB8nPraIUoo5h6LcLmGM=; b=RIUr3/HhhPcXW4iTu7UaI2uvcZ
	5/4RMGEGZHReIyR7roMNzt2zG6fKe4l0RFUn7DB4bWoVmWHCG+XtmE2Vf9uZlzl/M27qJjanmmCDc
	zzVVg+0W31fWoADL+ul4GuxklQMUwkN0inc2eJsxjlvZy/74SuVC/MqRKI41e7/PXuGo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEq1-0006nl-Mg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEq1-0000e4-Lu
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
Message-Id: <E1kYEq1-0000e4-Lu@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:01 +0000

commit 1989205c4e973bc7f9fac0ce0700993f30582538
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:16 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-3-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 433cdacbe1..7cd08f0868 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -937,7 +937,7 @@ static void gen_vec_rsub8_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b)
 
 static void gen_vec_rsub16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b)
 {
-    tcg_gen_vec_sub8_i64(d, b, a);
+    tcg_gen_vec_sub16_i64(d, b, a);
 }
 
 static void gen_rsub_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14750.36526 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqE-0002o1-1E; Thu, 29 Oct 2020 20:48:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14750.36526; Thu, 29 Oct 2020 20:48:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqD-0002nt-UW; Thu, 29 Oct 2020 20:48:13 +0000
Received: by outflank-mailman (input) for mailman id 14750;
 Thu, 29 Oct 2020 20:48:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEqD-0002nk-0X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ae31acbb-eb2e-477a-b8e6-e0fdd579102a;
 Thu, 29 Oct 2020 20:48:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqB-0006nt-Qp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqB-0000ee-Ps
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEqD-0002nk-0X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:13 +0000
X-Inumbo-ID: ae31acbb-eb2e-477a-b8e6-e0fdd579102a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ae31acbb-eb2e-477a-b8e6-e0fdd579102a;
	Thu, 29 Oct 2020 20:48:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8t4RrzwQ6JWs9w7QSH9OrNbqxIwg/LX05eTj1vJ00YY=; b=NadKrhlPXHv1z+YJRCG9Uc5T3E
	q1fFYC8Lg8b4WdfKdIcWOLs4CoWM6w9kn60LPloiNCxOISpaXCRAFy6ODn0GDHHF8Gt0bznMohCMs
	U/OXwby1nacht2adPQ6bT/EPoP2GMa4RlSGR+OJbo4P6jtB+YzTbsOnFTiiuj0mMLjTQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqB-0006nt-Qp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqB-0000ee-Ps
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: fix return value of do_opivx_widen()
Message-Id: <E1kYEqB-0000ee-Ps@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:11 +0000

commit a69f97c1110205bc173657c77ce2d16877cad683
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:17 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix return value of do_opivx_widen()
    
    do_opivx_widen() should return false if check function returns false.
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-4-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 7cd08f0868..c0b7375927 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -1151,7 +1151,7 @@ static bool do_opivx_widen(DisasContext *s, arg_rmrr *a,
     if (opivx_widen_check(s, a)) {
         return opivx_trans(a->rd, a->rs1, a->rs2, a->vm, fn, s);
     }
-    return true;
+    return false;
 }
 
 #define GEN_OPIVX_WIDEN_TRANS(NAME) \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14751.36530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqO-0002pV-2v; Thu, 29 Oct 2020 20:48:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14751.36530; Thu, 29 Oct 2020 20:48:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqN-0002pN-W3; Thu, 29 Oct 2020 20:48:23 +0000
Received: by outflank-mailman (input) for mailman id 14751;
 Thu, 29 Oct 2020 20:48:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEqM-0002p4-P1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0479190a-739d-4dd2-b36d-94058a2c3849;
 Thu, 29 Oct 2020 20:48:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqL-0006o6-UQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqL-0000fG-Td
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEqM-0002p4-P1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:22 +0000
X-Inumbo-ID: 0479190a-739d-4dd2-b36d-94058a2c3849
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0479190a-739d-4dd2-b36d-94058a2c3849;
	Thu, 29 Oct 2020 20:48:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M3tfzNvmSZ1LXERhoY+rHp4Rymf+FlJEOPVUrR9ySs4=; b=LzYVKeWqGbIhnuZLol3BKabiL+
	WQmRTan4HNMFZYKh/cpSWme9sN2gg1ivYjGBxzeG/8jU+nwVWAFnL79qJ9Pw0tliqr+C/MEY+18ky
	FTUTEBgQWVS/YIGz8PXB25jEnzYnSXrPxbtXW7OCJ7NGqfXFdZx3PYIs369h3ruSz/rs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqL-0006o6-UQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqL-0000fG-Td
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: fix vill bit index in vtype register
Message-Id: <E1kYEqL-0000fG-Td@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:21 +0000

commit fbcbafa2c1c33ae6630e7717f7f4141befb5b31a
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:18 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix vill bit index in vtype register
    
    vill bit is at vtype[XLEN-1].
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-5-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index eef20ca6e5..a804a5d0ba 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -98,7 +98,7 @@ FIELD(VTYPE, VLMUL, 0, 2)
 FIELD(VTYPE, VSEW, 2, 3)
 FIELD(VTYPE, VEDIV, 5, 2)
 FIELD(VTYPE, RESERVED, 7, sizeof(target_ulong) * 8 - 9)
-FIELD(VTYPE, VILL, sizeof(target_ulong) * 8 - 2, 1)
+FIELD(VTYPE, VILL, sizeof(target_ulong) * 8 - 1, 1)
 
 struct CPURISCVState {
     target_ulong gpr[32];
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14754.36534 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqY-0002qu-4Z; Thu, 29 Oct 2020 20:48:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14754.36534; Thu, 29 Oct 2020 20:48:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqY-0002qm-1P; Thu, 29 Oct 2020 20:48:34 +0000
Received: by outflank-mailman (input) for mailman id 14754;
 Thu, 29 Oct 2020 20:48:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEqW-0002qL-V2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 022aebef-77d7-4ce9-a521-25b29dbb3149;
 Thu, 29 Oct 2020 20:48:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqW-0006oD-2B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqW-0000fs-0y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEqW-0002qL-V2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
X-Inumbo-ID: 022aebef-77d7-4ce9-a521-25b29dbb3149
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 022aebef-77d7-4ce9-a521-25b29dbb3149;
	Thu, 29 Oct 2020 20:48:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vpurjx8qcSDQhc2q+ZWiCEgEYaP8o/1MvdSzvtqXiqo=; b=TNEE894zEDZlJE21ieICQRNR7T
	osXLqoEjYbsGAfvIQFa5S4cy0hFnCofoJKHmGZPXDKdHWNY7JejJrQidRs++CdaDRwwCTd23mF9Ac
	789RXpdzTjL5iN03dnZuzb/WG+5aJVeEtVmxJoYTYDgrP6yD+63tstDE5zO2U3gpI4TY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqW-0006oD-2B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqW-0000fs-0y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/char: Convert the Ibex UART to use the qdev Clock model
Message-Id: <E1kYEqW-0000fs-0y@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:32 +0000

commit 940aabb9f47712da87182fee7163f1d3f7def36d
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Thu Jul 9 15:04:48 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/char: Convert the Ibex UART to use the qdev Clock model
    
    Conver the Ibex UART to use the recently added qdev-clock functions.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com
    Message-Id: <b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com>
---
 hw/char/ibex_uart.c         | 30 +++++++++++++++++++++++++++---
 include/hw/char/ibex_uart.h |  3 +++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c
index 45cd724998..ab6247de89 100644
--- a/hw/char/ibex_uart.c
+++ b/hw/char/ibex_uart.c
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "hw/char/ibex_uart.h"
 #include "hw/irq.h"
+#include "hw/qdev-clock.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
@@ -203,6 +204,17 @@ static void ibex_uart_reset(DeviceState *dev)
     ibex_uart_update_irqs(s);
 }
 
+static uint64_t ibex_uart_get_baud(IbexUartState *s)
+{
+    uint64_t baud;
+
+    baud = ((s->uart_ctrl & UART_CTRL_NCO) >> 16);
+    baud *= clock_get_hz(s->f_clk);
+    baud >>= 20;
+
+    return baud;
+}
+
 static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
                                        unsigned int size)
 {
@@ -329,9 +341,7 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
                           "%s: UART_CTRL_RXBLVL is not supported\n", __func__);
         }
         if (value & UART_CTRL_NCO) {
-            uint64_t baud = ((value & UART_CTRL_NCO) >> 16);
-            baud *= 1000;
-            baud >>= 20;
+            uint64_t baud = ibex_uart_get_baud(s);
 
             s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
         }
@@ -385,6 +395,16 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
     }
 }
 
+static void ibex_uart_clk_update(void *opaque)
+{
+    IbexUartState *s = opaque;
+
+    /* recompute uart's speed on clock change */
+    uint64_t baud = ibex_uart_get_baud(s);
+
+    s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
+}
+
 static void fifo_trigger_update(void *opaque)
 {
     IbexUartState *s = opaque;
@@ -444,6 +464,10 @@ static void ibex_uart_init(Object *obj)
 {
     IbexUartState *s = IBEX_UART(obj);
 
+    s->f_clk = qdev_init_clock_in(DEVICE(obj), "f_clock",
+                                  ibex_uart_clk_update, s);
+    clock_set_hz(s->f_clk, IBEX_UART_CLOCK);
+
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_watermark);
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->rx_watermark);
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_empty);
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index 2bec772615..6d81051161 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -72,6 +72,7 @@
 #define IBEX_UART_TIMEOUT_CTRL 0x2c
 
 #define IBEX_UART_TX_FIFO_SIZE 16
+#define IBEX_UART_CLOCK 50000000 /* 50MHz clock */
 
 #define TYPE_IBEX_UART "ibex-uart"
 #define IBEX_UART(obj) \
@@ -101,6 +102,8 @@ typedef struct {
     uint32_t uart_val;
     uint32_t uart_timeout_ctrl;
 
+    Clock *f_clk;
+
     CharBackend chr;
     qemu_irq tx_watermark;
     qemu_irq rx_watermark;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14755.36537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqj-0002sJ-68; Thu, 29 Oct 2020 20:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14755.36537; Thu, 29 Oct 2020 20:48:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqj-0002sB-32; Thu, 29 Oct 2020 20:48:45 +0000
Received: by outflank-mailman (input) for mailman id 14755;
 Thu, 29 Oct 2020 20:48:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEqh-0002s0-Po
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ba13088b-5ef0-415d-86c9-1c0068e974b4;
 Thu, 29 Oct 2020 20:48:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqg-0006oL-7Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqg-0000gW-55
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEqh-0002s0-Po
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:43 +0000
X-Inumbo-ID: ba13088b-5ef0-415d-86c9-1c0068e974b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ba13088b-5ef0-415d-86c9-1c0068e974b4;
	Thu, 29 Oct 2020 20:48:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t36ApOod6MV/aRxTdFEoe/Q+MsBtoAFXqycCgC8x5es=; b=lbXgvpCBL+ze4Pq/JluTIYbeYf
	DdtrNHYUDW2Q4XO8qjLq3Wu/93Bs15WWJPdVLLykVf0jbTkVoD7yQepMUhUrqp5exhu8MLBnR9FaM
	zNOy/ww47adlG6ol89HEzFHobKXl6PvL6+EBmYMdRTv8EGJdRZ/fMjcKocP8KSRGnLZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqg-0006oL-7Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqg-0000gW-55
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/char: Convert the Ibex UART to use the registerfields API
Message-Id: <E1kYEqg-0000gW-55@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:42 +0000

commit 59093cc407cb044c72aa786006a07bd404eb36b9
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Thu Jul 9 15:04:51 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/char: Convert the Ibex UART to use the registerfields API
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com
    Message-Id: <06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com>
---
 hw/char/ibex_uart.c         | 130 ++++++++++++++++++++++----------------------
 include/hw/char/ibex_uart.h |  76 ++++++++++++--------------
 2 files changed, 100 insertions(+), 106 deletions(-)

diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c
index ab6247de89..cc49a35013 100644
--- a/hw/char/ibex_uart.c
+++ b/hw/char/ibex_uart.c
@@ -36,25 +36,25 @@
 
 static void ibex_uart_update_irqs(IbexUartState *s)
 {
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_TX_WATERMARK) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_TX_WATERMARK_MASK) {
         qemu_set_irq(s->tx_watermark, 1);
     } else {
         qemu_set_irq(s->tx_watermark, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_RX_WATERMARK) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_RX_WATERMARK_MASK) {
         qemu_set_irq(s->rx_watermark, 1);
     } else {
         qemu_set_irq(s->rx_watermark, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_TX_EMPTY) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_TX_EMPTY_MASK) {
         qemu_set_irq(s->tx_empty, 1);
     } else {
         qemu_set_irq(s->tx_empty, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_RX_OVERFLOW) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_RX_OVERFLOW_MASK) {
         qemu_set_irq(s->rx_overflow, 1);
     } else {
         qemu_set_irq(s->rx_overflow, 0);
@@ -65,7 +65,7 @@ static int ibex_uart_can_receive(void *opaque)
 {
     IbexUartState *s = opaque;
 
-    if (s->uart_ctrl & UART_CTRL_RX_ENABLE) {
+    if (s->uart_ctrl & R_CTRL_RX_ENABLE_MASK) {
         return 1;
     }
 
@@ -75,16 +75,16 @@ static int ibex_uart_can_receive(void *opaque)
 static void ibex_uart_receive(void *opaque, const uint8_t *buf, int size)
 {
     IbexUartState *s = opaque;
-    uint8_t rx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_RXILVL)
-                            >> FIFO_CTRL_RXILVL_SHIFT;
+    uint8_t rx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_RXILVL_MASK)
+                            >> R_FIFO_CTRL_RXILVL_SHIFT;
 
     s->uart_rdata = *buf;
 
-    s->uart_status &= ~UART_STATUS_RXIDLE;
-    s->uart_status &= ~UART_STATUS_RXEMPTY;
+    s->uart_status &= ~R_STATUS_RXIDLE_MASK;
+    s->uart_status &= ~R_STATUS_RXEMPTY_MASK;
 
     if (size > rx_fifo_level) {
-        s->uart_intr_state |= INTR_STATE_RX_WATERMARK;
+        s->uart_intr_state |= R_INTR_STATE_RX_WATERMARK_MASK;
     }
 
     ibex_uart_update_irqs(s);
@@ -94,8 +94,8 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
                                void *opaque)
 {
     IbexUartState *s = opaque;
-    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_TXILVL)
-                            >> FIFO_CTRL_TXILVL_SHIFT;
+    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_TXILVL_MASK)
+                            >> R_FIFO_CTRL_TXILVL_SHIFT;
     int ret;
 
     /* instant drain the fifo when there's no back-end */
@@ -105,10 +105,10 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
     }
 
     if (!s->tx_level) {
-        s->uart_status &= ~UART_STATUS_TXFULL;
-        s->uart_status |= UART_STATUS_TXEMPTY;
-        s->uart_intr_state |= INTR_STATE_TX_EMPTY;
-        s->uart_intr_state &= ~INTR_STATE_TX_WATERMARK;
+        s->uart_status &= ~R_STATUS_TXFULL_MASK;
+        s->uart_status |= R_STATUS_TXEMPTY_MASK;
+        s->uart_intr_state |= R_INTR_STATE_TX_EMPTY_MASK;
+        s->uart_intr_state &= ~R_INTR_STATE_TX_WATERMARK_MASK;
         ibex_uart_update_irqs(s);
         return FALSE;
     }
@@ -131,18 +131,18 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
 
     /* Clear the TX Full bit */
     if (s->tx_level != IBEX_UART_TX_FIFO_SIZE) {
-        s->uart_status &= ~UART_STATUS_TXFULL;
+        s->uart_status &= ~R_STATUS_TXFULL_MASK;
     }
 
     /* Disable the TX_WATERMARK IRQ */
     if (s->tx_level < tx_fifo_level) {
-        s->uart_intr_state &= ~INTR_STATE_TX_WATERMARK;
+        s->uart_intr_state &= ~R_INTR_STATE_TX_WATERMARK_MASK;
     }
 
     /* Set TX empty */
     if (s->tx_level == 0) {
-        s->uart_status |= UART_STATUS_TXEMPTY;
-        s->uart_intr_state |= INTR_STATE_TX_EMPTY;
+        s->uart_status |= R_STATUS_TXEMPTY_MASK;
+        s->uart_intr_state |= R_INTR_STATE_TX_EMPTY_MASK;
     }
 
     ibex_uart_update_irqs(s);
@@ -153,8 +153,8 @@ static void uart_write_tx_fifo(IbexUartState *s, const uint8_t *buf,
                                int size)
 {
     uint64_t current_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_TXILVL)
-                            >> FIFO_CTRL_TXILVL_SHIFT;
+    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_TXILVL_MASK)
+                            >> R_FIFO_CTRL_TXILVL_SHIFT;
 
     if (size > IBEX_UART_TX_FIFO_SIZE - s->tx_level) {
         size = IBEX_UART_TX_FIFO_SIZE - s->tx_level;
@@ -165,16 +165,16 @@ static void uart_write_tx_fifo(IbexUartState *s, const uint8_t *buf,
     s->tx_level += size;
 
     if (s->tx_level > 0) {
-        s->uart_status &= ~UART_STATUS_TXEMPTY;
+        s->uart_status &= ~R_STATUS_TXEMPTY_MASK;
     }
 
     if (s->tx_level >= tx_fifo_level) {
-        s->uart_intr_state |= INTR_STATE_TX_WATERMARK;
+        s->uart_intr_state |= R_INTR_STATE_TX_WATERMARK_MASK;
         ibex_uart_update_irqs(s);
     }
 
     if (s->tx_level == IBEX_UART_TX_FIFO_SIZE) {
-        s->uart_status |= UART_STATUS_TXFULL;
+        s->uart_status |= R_STATUS_TXFULL_MASK;
     }
 
     timer_mod(s->fifo_trigger_handle, current_time +
@@ -208,7 +208,7 @@ static uint64_t ibex_uart_get_baud(IbexUartState *s)
 {
     uint64_t baud;
 
-    baud = ((s->uart_ctrl & UART_CTRL_NCO) >> 16);
+    baud = ((s->uart_ctrl & R_CTRL_NCO_MASK) >> 16);
     baud *= clock_get_hz(s->f_clk);
     baud >>= 20;
 
@@ -221,43 +221,43 @@ static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
     IbexUartState *s = opaque;
     uint64_t retvalue = 0;
 
-    switch (addr) {
-    case IBEX_UART_INTR_STATE:
+    switch (addr >> 2) {
+    case R_INTR_STATE:
         retvalue = s->uart_intr_state;
         break;
-    case IBEX_UART_INTR_ENABLE:
+    case R_INTR_ENABLE:
         retvalue = s->uart_intr_enable;
         break;
-    case IBEX_UART_INTR_TEST:
+    case R_INTR_TEST:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: wdata is write only\n", __func__);
         break;
 
-    case IBEX_UART_CTRL:
+    case R_CTRL:
         retvalue = s->uart_ctrl;
         break;
-    case IBEX_UART_STATUS:
+    case R_STATUS:
         retvalue = s->uart_status;
         break;
 
-    case IBEX_UART_RDATA:
+    case R_RDATA:
         retvalue = s->uart_rdata;
-        if (s->uart_ctrl & UART_CTRL_RX_ENABLE) {
+        if (s->uart_ctrl & R_CTRL_RX_ENABLE_MASK) {
             qemu_chr_fe_accept_input(&s->chr);
 
-            s->uart_status |= UART_STATUS_RXIDLE;
-            s->uart_status |= UART_STATUS_RXEMPTY;
+            s->uart_status |= R_STATUS_RXIDLE_MASK;
+            s->uart_status |= R_STATUS_RXEMPTY_MASK;
         }
         break;
-    case IBEX_UART_WDATA:
+    case R_WDATA:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: wdata is write only\n", __func__);
         break;
 
-    case IBEX_UART_FIFO_CTRL:
+    case R_FIFO_CTRL:
         retvalue = s->uart_fifo_ctrl;
         break;
-    case IBEX_UART_FIFO_STATUS:
+    case R_FIFO_STATUS:
         retvalue = s->uart_fifo_status;
 
         retvalue |= s->tx_level & 0x1F;
@@ -266,17 +266,17 @@ static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
                       "%s: RX fifos are not supported\n", __func__);
         break;
 
-    case IBEX_UART_OVRD:
+    case R_OVRD:
         retvalue = s->uart_ovrd;
         qemu_log_mask(LOG_UNIMP,
                       "%s: ovrd is not supported\n", __func__);
         break;
-    case IBEX_UART_VAL:
+    case R_VAL:
         retvalue = s->uart_val;
         qemu_log_mask(LOG_UNIMP,
                       "%s: val is not supported\n", __func__);
         break;
-    case IBEX_UART_TIMEOUT_CTRL:
+    case R_TIMEOUT_CTRL:
         retvalue = s->uart_timeout_ctrl;
         qemu_log_mask(LOG_UNIMP,
                       "%s: timeout_ctrl is not supported\n", __func__);
@@ -296,95 +296,95 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
     IbexUartState *s = opaque;
     uint32_t value = val64;
 
-    switch (addr) {
-    case IBEX_UART_INTR_STATE:
+    switch (addr >> 2) {
+    case R_INTR_STATE:
         /* Write 1 clear */
         s->uart_intr_state &= ~value;
         ibex_uart_update_irqs(s);
         break;
-    case IBEX_UART_INTR_ENABLE:
+    case R_INTR_ENABLE:
         s->uart_intr_enable = value;
         ibex_uart_update_irqs(s);
         break;
-    case IBEX_UART_INTR_TEST:
+    case R_INTR_TEST:
         s->uart_intr_state |= value;
         ibex_uart_update_irqs(s);
         break;
 
-    case IBEX_UART_CTRL:
+    case R_CTRL:
         s->uart_ctrl = value;
 
-        if (value & UART_CTRL_NF) {
+        if (value & R_CTRL_NF_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_NF is not supported\n", __func__);
         }
-        if (value & UART_CTRL_SLPBK) {
+        if (value & R_CTRL_SLPBK_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_SLPBK is not supported\n", __func__);
         }
-        if (value & UART_CTRL_LLPBK) {
+        if (value & R_CTRL_LLPBK_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_LLPBK is not supported\n", __func__);
         }
-        if (value & UART_CTRL_PARITY_EN) {
+        if (value & R_CTRL_PARITY_EN_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_PARITY_EN is not supported\n",
                           __func__);
         }
-        if (value & UART_CTRL_PARITY_ODD) {
+        if (value & R_CTRL_PARITY_ODD_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_PARITY_ODD is not supported\n",
                           __func__);
         }
-        if (value & UART_CTRL_RXBLVL) {
+        if (value & R_CTRL_RXBLVL_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_RXBLVL is not supported\n", __func__);
         }
-        if (value & UART_CTRL_NCO) {
+        if (value & R_CTRL_NCO_MASK) {
             uint64_t baud = ibex_uart_get_baud(s);
 
             s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
         }
         break;
-    case IBEX_UART_STATUS:
+    case R_STATUS:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: status is read only\n", __func__);
         break;
 
-    case IBEX_UART_RDATA:
+    case R_RDATA:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: rdata is read only\n", __func__);
         break;
-    case IBEX_UART_WDATA:
+    case R_WDATA:
         uart_write_tx_fifo(s, (uint8_t *) &value, 1);
         break;
 
-    case IBEX_UART_FIFO_CTRL:
+    case R_FIFO_CTRL:
         s->uart_fifo_ctrl = value;
 
-        if (value & FIFO_CTRL_RXRST) {
+        if (value & R_FIFO_CTRL_RXRST_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: RX fifos are not supported\n", __func__);
         }
-        if (value & FIFO_CTRL_TXRST) {
+        if (value & R_FIFO_CTRL_TXRST_MASK) {
             s->tx_level = 0;
         }
         break;
-    case IBEX_UART_FIFO_STATUS:
+    case R_FIFO_STATUS:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: fifo_status is read only\n", __func__);
         break;
 
-    case IBEX_UART_OVRD:
+    case R_OVRD:
         s->uart_ovrd = value;
         qemu_log_mask(LOG_UNIMP,
                       "%s: ovrd is not supported\n", __func__);
         break;
-    case IBEX_UART_VAL:
+    case R_VAL:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: val is read only\n", __func__);
         break;
-    case IBEX_UART_TIMEOUT_CTRL:
+    case R_TIMEOUT_CTRL:
         s->uart_timeout_ctrl = value;
         qemu_log_mask(LOG_UNIMP,
                       "%s: timeout_ctrl is not supported\n", __func__);
@@ -409,7 +409,7 @@ static void fifo_trigger_update(void *opaque)
 {
     IbexUartState *s = opaque;
 
-    if (s->uart_ctrl & UART_CTRL_TX_ENABLE) {
+    if (s->uart_ctrl & R_CTRL_TX_ENABLE_MASK) {
         ibex_uart_xmit(NULL, G_IO_OUT, s);
     }
 }
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index 6d81051161..b6bd5a6700 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -26,50 +26,44 @@
 #define HW_IBEX_UART_H
 
 #include "hw/sysbus.h"
+#include "hw/registerfields.h"
 #include "chardev/char-fe.h"
 #include "qemu/timer.h"
 
-#define IBEX_UART_INTR_STATE   0x00
-    #define INTR_STATE_TX_WATERMARK (1 << 0)
-    #define INTR_STATE_RX_WATERMARK (1 << 1)
-    #define INTR_STATE_TX_EMPTY     (1 << 2)
-    #define INTR_STATE_RX_OVERFLOW  (1 << 3)
-#define IBEX_UART_INTR_ENABLE  0x04
-#define IBEX_UART_INTR_TEST    0x08
-
-#define IBEX_UART_CTRL         0x0c
-    #define UART_CTRL_TX_ENABLE     (1 << 0)
-    #define UART_CTRL_RX_ENABLE     (1 << 1)
-    #define UART_CTRL_NF            (1 << 2)
-    #define UART_CTRL_SLPBK         (1 << 4)
-    #define UART_CTRL_LLPBK         (1 << 5)
-    #define UART_CTRL_PARITY_EN     (1 << 6)
-    #define UART_CTRL_PARITY_ODD    (1 << 7)
-    #define UART_CTRL_RXBLVL        (3 << 8)
-    #define UART_CTRL_NCO           (0xFFFF << 16)
-
-#define IBEX_UART_STATUS       0x10
-    #define UART_STATUS_TXFULL  (1 << 0)
-    #define UART_STATUS_RXFULL  (1 << 1)
-    #define UART_STATUS_TXEMPTY (1 << 2)
-    #define UART_STATUS_RXIDLE  (1 << 4)
-    #define UART_STATUS_RXEMPTY (1 << 5)
-
-#define IBEX_UART_RDATA        0x14
-#define IBEX_UART_WDATA        0x18
-
-#define IBEX_UART_FIFO_CTRL    0x1c
-    #define FIFO_CTRL_RXRST          (1 << 0)
-    #define FIFO_CTRL_TXRST          (1 << 1)
-    #define FIFO_CTRL_RXILVL         (7 << 2)
-    #define FIFO_CTRL_RXILVL_SHIFT   (2)
-    #define FIFO_CTRL_TXILVL         (3 << 5)
-    #define FIFO_CTRL_TXILVL_SHIFT   (5)
-
-#define IBEX_UART_FIFO_STATUS  0x20
-#define IBEX_UART_OVRD         0x24
-#define IBEX_UART_VAL          0x28
-#define IBEX_UART_TIMEOUT_CTRL 0x2c
+REG32(INTR_STATE, 0x00)
+    FIELD(INTR_STATE, TX_WATERMARK, 0, 1)
+    FIELD(INTR_STATE, RX_WATERMARK, 1, 1)
+    FIELD(INTR_STATE, TX_EMPTY, 2, 1)
+    FIELD(INTR_STATE, RX_OVERFLOW, 3, 1)
+REG32(INTR_ENABLE, 0x04)
+REG32(INTR_TEST, 0x08)
+REG32(CTRL, 0x0C)
+    FIELD(CTRL, TX_ENABLE, 0, 1)
+    FIELD(CTRL, RX_ENABLE, 1, 1)
+    FIELD(CTRL, NF, 2, 1)
+    FIELD(CTRL, SLPBK, 4, 1)
+    FIELD(CTRL, LLPBK, 5, 1)
+    FIELD(CTRL, PARITY_EN, 6, 1)
+    FIELD(CTRL, PARITY_ODD, 7, 1)
+    FIELD(CTRL, RXBLVL, 8, 2)
+    FIELD(CTRL, NCO, 16, 16)
+REG32(STATUS, 0x10)
+    FIELD(STATUS, TXFULL, 0, 1)
+    FIELD(STATUS, RXFULL, 1, 1)
+    FIELD(STATUS, TXEMPTY, 2, 1)
+    FIELD(STATUS, RXIDLE, 4, 1)
+    FIELD(STATUS, RXEMPTY, 5, 1)
+REG32(RDATA, 0x14)
+REG32(WDATA, 0x18)
+REG32(FIFO_CTRL, 0x1c)
+    FIELD(FIFO_CTRL, RXRST, 0, 1)
+    FIELD(FIFO_CTRL, TXRST, 1, 1)
+    FIELD(FIFO_CTRL, RXILVL, 2, 3)
+    FIELD(FIFO_CTRL, TXILVL, 5, 2)
+REG32(FIFO_STATUS, 0x20)
+REG32(OVRD, 0x24)
+REG32(VAL, 0x28)
+REG32(TIMEOUT_CTRL, 0x2c)
 
 #define IBEX_UART_TX_FIFO_SIZE 16
 #define IBEX_UART_CLOCK 50000000 /* 50MHz clock */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:48:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:48:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14756.36542 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqt-0002to-9s; Thu, 29 Oct 2020 20:48:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14756.36542; Thu, 29 Oct 2020 20:48:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEqt-0002tg-6m; Thu, 29 Oct 2020 20:48:55 +0000
Received: by outflank-mailman (input) for mailman id 14756;
 Thu, 29 Oct 2020 20:48:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEqr-0002tS-9N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f48c7a78-19c5-4789-b71a-27da214c7a62;
 Thu, 29 Oct 2020 20:48:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqq-0006oW-BK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEqq-0000h8-AT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEqr-0002tS-9N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:53 +0000
X-Inumbo-ID: f48c7a78-19c5-4789-b71a-27da214c7a62
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f48c7a78-19c5-4789-b71a-27da214c7a62;
	Thu, 29 Oct 2020 20:48:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Sx483eRApHLF/WwGLIqD28R+o0BjcKAHOh3ttCfPwr0=; b=1BhtnTqHyFuCY0jpXf1eXdMnS5
	FBEjrcf7uM/kAZRK4jfXpJl06hPFMH47fZz545wmQl/0HUiMvLBwHkd63dtXiWGeVrDwpM3hXDkGJ
	i2jaw6fw0TFyltRNSxa/zFV44ofaissEHap+BIS0Q/YEq0eQHKHfT5vCF+XhFXSvMC2E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqq-0006oW-BK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEqq-0000h8-AT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:48:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tcg/riscv: Remove superfluous breaks
Message-Id: <E1kYEqq-0000h8-AT@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:48:52 +0000

commit 895bfa84fec27899bf8e8c17f46358d31df2ab4f
Author:     Liao Pingfang <liao.pingfang@zte.com.cn>
AuthorDate: Mon Jul 13 08:33:41 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    tcg/riscv: Remove superfluous breaks
    
    Remove superfluous breaks, as there is a "return" before them.
    
    Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
    Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1594600421-22942-1-git-send-email-wang.yi59@zte.com.cn>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 tcg/riscv/tcg-target.inc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c
index 2bc0ba71f2..3c11ab8b7a 100644
--- a/tcg/riscv/tcg-target.inc.c
+++ b/tcg/riscv/tcg-target.inc.c
@@ -502,10 +502,8 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type,
         break;
     case R_RISCV_JAL:
         return reloc_jimm20(code_ptr, (tcg_insn_unit *)value);
-        break;
     case R_RISCV_CALL:
         return reloc_call(code_ptr, (tcg_insn_unit *)value);
-        break;
     default:
         tcg_abort();
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14757.36546 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEr3-0002vf-Be; Thu, 29 Oct 2020 20:49:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14757.36546; Thu, 29 Oct 2020 20:49:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEr3-0002vX-8J; Thu, 29 Oct 2020 20:49:05 +0000
Received: by outflank-mailman (input) for mailman id 14757;
 Thu, 29 Oct 2020 20:49:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEr1-0002vH-FP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2c3ee409-c3fb-4b6b-91a0-ae4be4336a86;
 Thu, 29 Oct 2020 20:49:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEr0-0006pZ-Ex
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEr0-0000hp-E9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEr1-0002vH-FP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:03 +0000
X-Inumbo-ID: 2c3ee409-c3fb-4b6b-91a0-ae4be4336a86
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2c3ee409-c3fb-4b6b-91a0-ae4be4336a86;
	Thu, 29 Oct 2020 20:49:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pk+vBhPyKRYvMrgQWlpfw54G6G+0VxIEUKAT18t3DLI=; b=PVogzCUGFpCcYaUK6qOX1l/YO8
	2Nv90LJCpJzYDuqVr2hLjrYS67tbm/a3aWHQvbCI9gKNfv0oLp4wcM0g7VnA48xBgj7ZMJzx8BEvU
	nbzEVMOGqQwDrdiqXNt8Wnu+hZgiT32fzYwBPkNMeElRLzftP9Z40XD6xO2VhH64GXus=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEr0-0006pZ-Ex
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEr0-0000hp-E9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: Fix pmp NA4 implementation
Message-Id: <E1kYEr0-0000hp-E9@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:02 +0000

commit cfad709bceb629a4ebeb5d8a3acd1871b9a6436b
Author:     Alexandre Mergnat <amergnat@baylibre.com>
AuthorDate: Mon Jul 6 10:45:50 2020 +0200
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: Fix pmp NA4 implementation
    
    The end address calculation for NA4 mode is wrong because the address
    used isn't shifted.
    
    It doesn't watch 4 bytes but a huge range because the end address
    calculation is wrong.
    
    The solution is to use the shifted address calculated for start address
    variable.
    
    Modifications are tested on Zephyr OS userspace test suite which works
    for other RISC-V boards (E31 and E34 core).
    
    Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200706084550.24117-1-amergnat@baylibre.com
    Message-Id: <20200706084550.24117-1-amergnat@baylibre.com>
    [ Changes by AF:
     - Improve the commit title and message
    ]
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/pmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index 9418660f1b..2a2b9f5363 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -171,7 +171,7 @@ static void pmp_update_rule(CPURISCVState *env, uint32_t pmp_index)
 
     case PMP_AMATCH_NA4:
         sa = this_addr << 2; /* shift up from [xx:0] to [xx+2:2] */
-        ea = (this_addr + 4u) - 1u;
+        ea = (sa + 4u) - 1u;
         break;
 
     case PMP_AMATCH_NAPOT:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14758.36550 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErD-0002wu-DI; Thu, 29 Oct 2020 20:49:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14758.36550; Thu, 29 Oct 2020 20:49:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErD-0002wm-A3; Thu, 29 Oct 2020 20:49:15 +0000
Received: by outflank-mailman (input) for mailman id 14758;
 Thu, 29 Oct 2020 20:49:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYErB-0002wb-Ve
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b41ba503-a1bd-482c-9ffc-897081f0cc45;
 Thu, 29 Oct 2020 20:49:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErA-0006pj-JQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErA-0000iR-IC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYErB-0002wb-Ve
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:14 +0000
X-Inumbo-ID: b41ba503-a1bd-482c-9ffc-897081f0cc45
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b41ba503-a1bd-482c-9ffc-897081f0cc45;
	Thu, 29 Oct 2020 20:49:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=81xXNLGUoQ/IDd+pLaPXAUJANROz1OAG/oZXOJW1HfA=; b=TUkuYrbTflVCsSZcx4fLlOqYD0
	RI74GKVVBWoSMGi3NeE97oii9XOfWVJc8Ffvs8V+ZHmGbqyqbm39cc9oFlFxgMKQPUiRlIB0vHjFJ
	I8xhOjFW9PSVgyDD0M+4J3MUlJd+nWGSZlcOCKb1X9Cg6+UbkalU+WnWAZi6Zay5x23s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErA-0006pj-JQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErA-0000iR-IC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200713' into staging
Message-Id: <E1kYErA-0000iR-IC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:12 +0000

commit aeb07b5f6e69ce93afea71027325e3e7a22d2149
Merge: beff47a2f6a8295161f98a9dac94e18e5376e749 cfad709bceb629a4ebeb5d8a3acd1871b9a6436b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 17:58:00 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 17:58:00 2020 +0100

    Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200713' into staging
    
    This is a colection of bug fixes and small imrprovements for RISC-V.
    
    This includes some vector extensions fixes, a PMP bug fix, OpenTitan
    UART bug fix and support for OpenSBI dynamic firmware.
    
    # gpg: Signature made Tue 14 Jul 2020 01:29:44 BST
    # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
    # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
    # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
    
    * remotes/alistair/tags/pull-riscv-to-apply-20200713:
      target/riscv: Fix pmp NA4 implementation
      tcg/riscv: Remove superfluous breaks
      hw/char: Convert the Ibex UART to use the registerfields API
      hw/char: Convert the Ibex UART to use the qdev Clock model
      target/riscv: fix vill bit index in vtype register
      target/riscv: fix return value of do_opivx_widen()
      target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
      target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
      hw/riscv: Modify MROM size to end at 0x10000
      RISC-V: Support 64 bit start address
      riscv: Add opensbi firmware dynamic support
      RISC-V: Copy the fdt in dram instead of ROM
      riscv: Unify Qemu's reset vector code path
      hw/riscv: virt: Sort the SoC memmap table entries
      MAINTAINERS: Add an entry for OpenSBI firmware
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                             |   7 ++
 hw/char/ibex_uart.c                     | 158 ++++++++++++++++++--------------
 hw/riscv/boot.c                         | 107 +++++++++++++++++++++
 hw/riscv/sifive_u.c                     |  53 ++++++-----
 hw/riscv/spike.c                        |  59 ++++--------
 hw/riscv/virt.c                         |  63 ++++---------
 include/hw/char/ibex_uart.h             |  79 ++++++++--------
 include/hw/riscv/boot.h                 |   7 ++
 include/hw/riscv/boot_opensbi.h         |  58 ++++++++++++
 target/riscv/cpu.h                      |   2 +-
 target/riscv/insn_trans/trans_rvv.inc.c |   9 +-
 target/riscv/pmp.c                      |   2 +-
 tcg/riscv/tcg-target.inc.c              |   2 -
 13 files changed, 387 insertions(+), 219 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14759.36554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErO-0002y9-Ei; Thu, 29 Oct 2020 20:49:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14759.36554; Thu, 29 Oct 2020 20:49:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErO-0002y1-Bd; Thu, 29 Oct 2020 20:49:26 +0000
Received: by outflank-mailman (input) for mailman id 14759;
 Thu, 29 Oct 2020 20:49:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYErM-0002xp-C9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cac109ac-05ed-42ff-a5b4-d5ec1db3ee75;
 Thu, 29 Oct 2020 20:49:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErL-0006pr-5d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErL-0000l0-4x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYErM-0002xp-C9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:24 +0000
X-Inumbo-ID: cac109ac-05ed-42ff-a5b4-d5ec1db3ee75
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cac109ac-05ed-42ff-a5b4-d5ec1db3ee75;
	Thu, 29 Oct 2020 20:49:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Qp00k6e8elDTSuDxTH8eGslcpFjahG7bUdR7AODBe/c=; b=XUZsDpDDztuIYNEdTaQnkEAuEg
	tLKqaJ28HSEOqPzc/St1ZFJI86HsMiddpcM4IlORht5fP2g5XVA1qWU9CQ3hkFgcN9SnAfoIvdmYQ
	kadhFuvc0mdD1/hpbzah+eKdWTOtlOc2xm3aUKGaVE+6lbjekFdbDWTCwas3FE9ZU/zg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErL-0006pr-5d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErL-0000l0-4x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Simplify _filter_img_create() a bit
Message-Id: <E1kYErL-0000l0-4x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:23 +0000

commit 4b196cd16dcfb17de19a4121f12aa4ef4bf7925f
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 9 13:02:05 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests: Simplify _filter_img_create() a bit
    
    Not only is it a bit stupid to try to filter multi-line "Formatting"
    output (because we only need it for a single test, which can easily be
    amended to no longer need it), it is also problematic when there can be
    output after a "Formatting" line that we do not want to filter as if it
    were part of it.
    
    So rename _filter_img_create to _do_filter_img_create, let it filter
    only a single line, and let _filter_img_create loop over all input
    lines, calling _do_filter_img_create only on those that match
    /^Formatting/ (basically, what _filter_img_create_in_qmp did already).
    (And fix 020 to work with that.)
    
    Reported-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200709110205.310942-1-mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/020           | 29 +++++++++++--------
 tests/qemu-iotests/020.out       | 13 +--------
 tests/qemu-iotests/141           |  2 +-
 tests/qemu-iotests/common.filter | 62 +++++++++++++++++-----------------------
 4 files changed, 45 insertions(+), 61 deletions(-)

diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index 20f8f185d0..b488000cb9 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -115,18 +115,23 @@ TEST_IMG="$TEST_IMG.base" _make_test_img 1M
 # Create an image with a null backing file to which committing will fail (with
 # ENOSPC so we can distinguish the result from some generic EIO which may be
 # generated anywhere in the block layer)
-_make_test_img -b "json:{'driver': '$IMGFMT',
-                         'file': {
-                             'driver': 'blkdebug',
-                             'inject-error': [{
-                                 'event': 'write_aio',
-                                 'errno': 28,
-                                 'once': true
-                             }],
-                             'image': {
-                                 'driver': 'file',
-                                 'filename': '$TEST_IMG.base'
-                             }}}"
+backing="json:{'driver': '$IMGFMT',
+               'file': {
+                   'driver': 'blkdebug',
+                   'inject-error': [{
+                       'event': 'write_aio',
+                       'errno': 28,
+                       'once': true
+                   }],
+                   'image': {
+                       'driver': 'file',
+                       'filename': '$TEST_IMG.base'
+                   }}}"
+
+# Filter out newlines and collapse spaces
+backing=$(echo "$backing" | tr -d '\n' | tr -s ' ')
+
+_make_test_img -b "$backing"
 
 # Just write anything so committing will not be a no-op
 $QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out
index 4b722b2dd0..4668ac59df 100644
--- a/tests/qemu-iotests/020.out
+++ b/tests/qemu-iotests/020.out
@@ -1079,18 +1079,7 @@ No errors were found on the image.
 Testing failing commit
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',,
-                         'file': {
-                             'driver': 'blkdebug',,
-                             'inject-error': [{
-                                 'event': 'write_aio',,
-                                 'errno': 28,,
-                                 'once': true
-                             }],,
-                             'image': {
-                                 'driver': 'file',,
-                                 'filename': 'TEST_DIR/t.IMGFMT.base'
-                             }}}
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}}
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Block job failed: No space left on device
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 6d1b7b0d4c..5192d256e3 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -68,7 +68,7 @@ test_blockjob()
     _send_qemu_cmd $QEMU_HANDLE \
         "$1" \
         "$2" \
-        | _filter_img_create_in_qmp | _filter_qmp_empty_return
+        | _filter_img_create | _filter_qmp_empty_return
 
     # We want this to return an error because the block job is still running
     _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index c9f978abce..9b772245cd 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -119,8 +119,21 @@ _filter_actual_image_size()
     $SED -s 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
 }
 
+# Filename filters for qemu-img create
+_filter_img_create_filenames()
+{
+    $SED \
+        -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
+        -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
+        -e "s#$TEST_DIR#TEST_DIR#g" \
+        -e "s#$SOCK_DIR#SOCK_DIR#g" \
+        -e "s#$IMGFMT#IMGFMT#g" \
+        -e 's#nbd:127.0.0.1:[0-9]\\+#TEST_DIR/t.IMGFMT#g' \
+        -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g'
+}
+
 # replace driver-specific options in the "Formatting..." line
-_filter_img_create()
+_do_filter_img_create()
 {
     # Split the line into the pre-options part ($filename_part, which
     # precedes ", fmt=") and the options part ($options, which starts
@@ -128,23 +141,10 @@ _filter_img_create()
     # (And just echo everything before the first "^Formatting")
     readarray formatting_line < <($SED -e 's/, fmt=/\n/')
 
-    filename_part=''
-    options=''
-    lines=${#formatting_line[@]}
-    for ((i = 0; i < $lines; i++)); do
-        line=${formatting_line[i]}
-        unset formatting_line[i]
-
-        filename_part="$filename_part$line"
+    filename_part=${formatting_line[0]}
+    unset formatting_line[0]
 
-        if echo "$line" | grep -q '^Formatting'; then
-            next_i=$((i + 1))
-            if [ -n "${formatting_line[next_i]}" ]; then
-                options="fmt=${formatting_line[@]}"
-            fi
-            break
-        fi
-    done
+    options="fmt=${formatting_line[@]}"
 
     # Set grep_data_file to '\|data_file' to keep it; make it empty
     # to drop it.
@@ -156,17 +156,7 @@ _filter_img_create()
         grep_data_file=()
     fi
 
-    filename_filters=(
-        -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
-        -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
-        -e "s#$TEST_DIR#TEST_DIR#g" \
-        -e "s#$SOCK_DIR#SOCK_DIR#g" \
-        -e "s#$IMGFMT#IMGFMT#g" \
-        -e 's#nbd:127.0.0.1:[0-9]\\+#TEST_DIR/t.IMGFMT#g' \
-        -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g'
-    )
-
-    filename_part=$(echo "$filename_part" | $SED "${filename_filters[@]}")
+    filename_part=$(echo "$filename_part" | _filter_img_create_filenames)
 
     # Break the option line before each option (preserving pre-existing
     # line breaks by replacing them by \0 and restoring them at the end),
@@ -179,7 +169,8 @@ _filter_img_create()
         | $SED -e 's/ \([a-z0-9_.-]*\)=/\n\1=/g' \
         | grep -a -e '^fmt' -e '^size' -e '^backing' -e '^preallocation' \
                   -e '^encryption' "${grep_data_file[@]}" \
-        | $SED "${filename_filters[@]}" \
+        | _filter_img_create_filenames \
+        | $SED \
             -e 's/^\(fmt\)/0-\1/' \
             -e 's/^\(size\)/1-\1/' \
             -e 's/^\(backing\)/2-\1/' \
@@ -199,17 +190,16 @@ _filter_img_create()
     fi
 }
 
-# Filter the "Formatting..." line in QMP output (leaving the QMP output
-# untouched)
-# (In contrast to _filter_img_create(), this function does not support
-# multi-line Formatting output)
-_filter_img_create_in_qmp()
+# Filter qemu-img create output:
+# Pipe all ^Formatting lines through _do_filter_img_create, and all
+# other lines through _filter_img_create_filenames
+_filter_img_create()
 {
     while read -r line; do
         if echo "$line" | grep -q '^Formatting'; then
-            echo "$line" | _filter_img_create
+            echo "$line" | _do_filter_img_create
         else
-            echo "$line"
+            echo "$line" | _filter_img_create_filenames
         fi
     done
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14760.36558 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErX-0002zK-GA; Thu, 29 Oct 2020 20:49:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14760.36558; Thu, 29 Oct 2020 20:49:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErX-0002zC-D6; Thu, 29 Oct 2020 20:49:35 +0000
Received: by outflank-mailman (input) for mailman id 14760;
 Thu, 29 Oct 2020 20:49:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYErW-0002z3-5H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3c9090e4-c77f-41fc-8b03-f66b3cb9b29f;
 Thu, 29 Oct 2020 20:49:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErV-0006pz-9C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErV-0000lZ-8W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYErW-0002z3-5H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:34 +0000
X-Inumbo-ID: 3c9090e4-c77f-41fc-8b03-f66b3cb9b29f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3c9090e4-c77f-41fc-8b03-f66b3cb9b29f;
	Thu, 29 Oct 2020 20:49:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G1G1GVmvoCbcKgYUYgllNHd44HV26fMhBbWruuaZee0=; b=mfI/gpWKI9hUIvosbdrWICDcFT
	zoIEJ6aUKGS08Skl3WsFU+iqdto4qjEtSxfIV3muUOFeMuQasRkMcIWdb+8H++HHNTytvGXMYV7zK
	OAuVkg6VRK4wgYYDYfGxpZviRzdmEB2wiS0/AVmiJcnM+D8hbxds8PKfHR8hbJBusGSg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErV-0006pz-9C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErV-0000lZ-8W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-img map: Don't limit block status request size
Message-Id: <E1kYErV-0000lZ-8W@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:33 +0000

commit d0ceea88dea053e0c1c038d42ca98782c2e3872d
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 7 16:46:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qemu-img map: Don't limit block status request size
    
    Limiting each loop iteration of qemu-img map to 1 GB was arbitrary from
    the beginning, though it only cut the maximum in half then because the
    interface was a signed 32 bit byte count. These days, bdrv_block_status
    supports a 64 bit byte count, so the arbitrary limit is even worse.
    
    On file-posix, bdrv_block_status() eventually maps to SEEK_HOLE and
    SEEK_DATA, which don't support a limit, but always do all of the work
    necessary to find the start of the next hole/data. Much of this work may
    be repeated if we don't use this information fully, but query with an
    only slightly larger offset in the next loop iteration. Therefore, if
    bdrv_block_status() is called in a loop, it should always pass the
    full number of bytes that the whole loop is interested in.
    
    This removes the arbitrary limit and speeds up 'qemu-img map'
    significantly on heavily fragmented images.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200707144629.51235-1-kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu-img.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 498fbf42fe..4548dbff82 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3210,12 +3210,9 @@ static int img_map(int argc, char **argv)
     curr.start = start_offset;
     while (curr.start + curr.length < length) {
         int64_t offset = curr.start + curr.length;
-        int64_t n;
+        int64_t n = length - offset;
 
-        /* Probe up to 1 GiB at a time.  */
-        n = MIN(1 * GiB, length - offset);
         ret = get_block_status(bs, offset, n, &next);
-
         if (ret < 0) {
             error_report("Could not read file metadata: %s", strerror(-ret));
             goto out;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14761.36562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErl-00030s-IT; Thu, 29 Oct 2020 20:49:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14761.36562; Thu, 29 Oct 2020 20:49:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErl-00030l-Eq; Thu, 29 Oct 2020 20:49:49 +0000
Received: by outflank-mailman (input) for mailman id 14761;
 Thu, 29 Oct 2020 20:49:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYErj-00030g-8Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e8816a9b-8c46-4eec-9e1d-b4bb60435394;
 Thu, 29 Oct 2020 20:49:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErf-0006q6-E2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErf-0000mA-CI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYErj-00030g-8Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:47 +0000
X-Inumbo-ID: e8816a9b-8c46-4eec-9e1d-b4bb60435394
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e8816a9b-8c46-4eec-9e1d-b4bb60435394;
	Thu, 29 Oct 2020 20:49:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Sx/owX8rjcU1ozxaq3SNdqy69duOJz7YCJa+jDFArl4=; b=hoPykqLfrKzMoLP/7g/q5EATAw
	W8XFQdksphIdk/pQPwjABmtF6WQ9L52R2Mlk8aATo2kq9CcBsE9351+YYbX+cizq1e3Hwh5CW74VY
	IfTCf1tepV7Dc+DbWXBAGCBh43HXGIoKJZtPmAba+bOSjGnLNuzYLt6HfvYsGfboWg0I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErf-0006q6-E2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErf-0000mA-CI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/059: Filter out disk size with more standard filter
Message-Id: <E1kYErf-0000mA-CI@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:43 +0000

commit 046e07ca556b3eb44ac5c64911b5bda204403113
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Mon Jul 13 15:45:37 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests/059: Filter out disk size with more standard filter
    
    The actual disk space used by an image can vary between filesystems and
    depending on other settings like an extent size hint. Replace the one
    call of "$QEMU_IMG info" and the associated one-off sed filter with the
    more standard "_img_info" and the standard filter from common.filter.
    
    Apart from turning "vmdk" into "IMGFMT" and changing the placeholder for
    cid fields, this only removes the "disk size" line.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/059     |    2 +-
 tests/qemu-iotests/059.out | 1009 ++++++++++++++++++++++----------------------
 2 files changed, 505 insertions(+), 506 deletions(-)

diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 4c90fc0363..dcc442be9f 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -82,7 +82,7 @@ _cleanup_test_img
 echo
 echo "=== Testing big twoGbMaxExtentFlat ==="
 _make_test_img -o "subformat=twoGbMaxExtentFlat" 1000G
-$QEMU_IMG info $TEST_IMG | _filter_testdir | sed -e 's/cid: [0-9]*/cid: XXXXXXXX/'
+_img_info --format-specific | _filter_img_info --format-specific
 _cleanup_test_img
 
 echo
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 39bf7e211d..6d127e28d8 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -24,2014 +24,2013 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
 
 === Testing big twoGbMaxExtentFlat ===
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824000
-image: TEST_DIR/t.vmdk
-file format: vmdk
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
 virtual size: 0.977 TiB (1073741824000 bytes)
-disk size: 1.97 MiB
 Format specific information:
-    cid: XXXXXXXX
-    parent cid: XXXXXXXX
+    cid: XXXXXXXXXX
+    parent cid: XXXXXXXXXX
     create type: twoGbMaxExtentFlat
     extents:
         [0]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f001.vmdk
+            filename: TEST_DIR/t-f001.IMGFMT
             format: FLAT
         [1]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f002.vmdk
+            filename: TEST_DIR/t-f002.IMGFMT
             format: FLAT
         [2]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f003.vmdk
+            filename: TEST_DIR/t-f003.IMGFMT
             format: FLAT
         [3]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f004.vmdk
+            filename: TEST_DIR/t-f004.IMGFMT
             format: FLAT
         [4]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f005.vmdk
+            filename: TEST_DIR/t-f005.IMGFMT
             format: FLAT
         [5]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f006.vmdk
+            filename: TEST_DIR/t-f006.IMGFMT
             format: FLAT
         [6]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f007.vmdk
+            filename: TEST_DIR/t-f007.IMGFMT
             format: FLAT
         [7]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f008.vmdk
+            filename: TEST_DIR/t-f008.IMGFMT
             format: FLAT
         [8]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f009.vmdk
+            filename: TEST_DIR/t-f009.IMGFMT
             format: FLAT
         [9]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f010.vmdk
+            filename: TEST_DIR/t-f010.IMGFMT
             format: FLAT
         [10]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f011.vmdk
+            filename: TEST_DIR/t-f011.IMGFMT
             format: FLAT
         [11]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f012.vmdk
+            filename: TEST_DIR/t-f012.IMGFMT
             format: FLAT
         [12]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f013.vmdk
+            filename: TEST_DIR/t-f013.IMGFMT
             format: FLAT
         [13]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f014.vmdk
+            filename: TEST_DIR/t-f014.IMGFMT
             format: FLAT
         [14]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f015.vmdk
+            filename: TEST_DIR/t-f015.IMGFMT
             format: FLAT
         [15]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f016.vmdk
+            filename: TEST_DIR/t-f016.IMGFMT
             format: FLAT
         [16]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f017.vmdk
+            filename: TEST_DIR/t-f017.IMGFMT
             format: FLAT
         [17]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f018.vmdk
+            filename: TEST_DIR/t-f018.IMGFMT
             format: FLAT
         [18]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f019.vmdk
+            filename: TEST_DIR/t-f019.IMGFMT
             format: FLAT
         [19]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f020.vmdk
+            filename: TEST_DIR/t-f020.IMGFMT
             format: FLAT
         [20]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f021.vmdk
+            filename: TEST_DIR/t-f021.IMGFMT
             format: FLAT
         [21]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f022.vmdk
+            filename: TEST_DIR/t-f022.IMGFMT
             format: FLAT
         [22]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f023.vmdk
+            filename: TEST_DIR/t-f023.IMGFMT
             format: FLAT
         [23]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f024.vmdk
+            filename: TEST_DIR/t-f024.IMGFMT
             format: FLAT
         [24]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f025.vmdk
+            filename: TEST_DIR/t-f025.IMGFMT
             format: FLAT
         [25]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f026.vmdk
+            filename: TEST_DIR/t-f026.IMGFMT
             format: FLAT
         [26]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f027.vmdk
+            filename: TEST_DIR/t-f027.IMGFMT
             format: FLAT
         [27]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f028.vmdk
+            filename: TEST_DIR/t-f028.IMGFMT
             format: FLAT
         [28]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f029.vmdk
+            filename: TEST_DIR/t-f029.IMGFMT
             format: FLAT
         [29]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f030.vmdk
+            filename: TEST_DIR/t-f030.IMGFMT
             format: FLAT
         [30]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f031.vmdk
+            filename: TEST_DIR/t-f031.IMGFMT
             format: FLAT
         [31]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f032.vmdk
+            filename: TEST_DIR/t-f032.IMGFMT
             format: FLAT
         [32]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f033.vmdk
+            filename: TEST_DIR/t-f033.IMGFMT
             format: FLAT
         [33]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f034.vmdk
+            filename: TEST_DIR/t-f034.IMGFMT
             format: FLAT
         [34]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f035.vmdk
+            filename: TEST_DIR/t-f035.IMGFMT
             format: FLAT
         [35]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f036.vmdk
+            filename: TEST_DIR/t-f036.IMGFMT
             format: FLAT
         [36]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f037.vmdk
+            filename: TEST_DIR/t-f037.IMGFMT
             format: FLAT
         [37]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f038.vmdk
+            filename: TEST_DIR/t-f038.IMGFMT
             format: FLAT
         [38]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f039.vmdk
+            filename: TEST_DIR/t-f039.IMGFMT
             format: FLAT
         [39]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f040.vmdk
+            filename: TEST_DIR/t-f040.IMGFMT
             format: FLAT
         [40]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f041.vmdk
+            filename: TEST_DIR/t-f041.IMGFMT
             format: FLAT
         [41]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f042.vmdk
+            filename: TEST_DIR/t-f042.IMGFMT
             format: FLAT
         [42]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f043.vmdk
+            filename: TEST_DIR/t-f043.IMGFMT
             format: FLAT
         [43]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f044.vmdk
+            filename: TEST_DIR/t-f044.IMGFMT
             format: FLAT
         [44]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f045.vmdk
+            filename: TEST_DIR/t-f045.IMGFMT
             format: FLAT
         [45]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f046.vmdk
+            filename: TEST_DIR/t-f046.IMGFMT
             format: FLAT
         [46]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f047.vmdk
+            filename: TEST_DIR/t-f047.IMGFMT
             format: FLAT
         [47]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f048.vmdk
+            filename: TEST_DIR/t-f048.IMGFMT
             format: FLAT
         [48]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f049.vmdk
+            filename: TEST_DIR/t-f049.IMGFMT
             format: FLAT
         [49]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f050.vmdk
+            filename: TEST_DIR/t-f050.IMGFMT
             format: FLAT
         [50]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f051.vmdk
+            filename: TEST_DIR/t-f051.IMGFMT
             format: FLAT
         [51]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f052.vmdk
+            filename: TEST_DIR/t-f052.IMGFMT
             format: FLAT
         [52]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f053.vmdk
+            filename: TEST_DIR/t-f053.IMGFMT
             format: FLAT
         [53]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f054.vmdk
+            filename: TEST_DIR/t-f054.IMGFMT
             format: FLAT
         [54]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f055.vmdk
+            filename: TEST_DIR/t-f055.IMGFMT
             format: FLAT
         [55]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f056.vmdk
+            filename: TEST_DIR/t-f056.IMGFMT
             format: FLAT
         [56]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f057.vmdk
+            filename: TEST_DIR/t-f057.IMGFMT
             format: FLAT
         [57]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f058.vmdk
+            filename: TEST_DIR/t-f058.IMGFMT
             format: FLAT
         [58]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f059.vmdk
+            filename: TEST_DIR/t-f059.IMGFMT
             format: FLAT
         [59]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f060.vmdk
+            filename: TEST_DIR/t-f060.IMGFMT
             format: FLAT
         [60]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f061.vmdk
+            filename: TEST_DIR/t-f061.IMGFMT
             format: FLAT
         [61]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f062.vmdk
+            filename: TEST_DIR/t-f062.IMGFMT
             format: FLAT
         [62]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f063.vmdk
+            filename: TEST_DIR/t-f063.IMGFMT
             format: FLAT
         [63]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f064.vmdk
+            filename: TEST_DIR/t-f064.IMGFMT
             format: FLAT
         [64]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f065.vmdk
+            filename: TEST_DIR/t-f065.IMGFMT
             format: FLAT
         [65]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f066.vmdk
+            filename: TEST_DIR/t-f066.IMGFMT
             format: FLAT
         [66]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f067.vmdk
+            filename: TEST_DIR/t-f067.IMGFMT
             format: FLAT
         [67]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f068.vmdk
+            filename: TEST_DIR/t-f068.IMGFMT
             format: FLAT
         [68]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f069.vmdk
+            filename: TEST_DIR/t-f069.IMGFMT
             format: FLAT
         [69]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f070.vmdk
+            filename: TEST_DIR/t-f070.IMGFMT
             format: FLAT
         [70]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f071.vmdk
+            filename: TEST_DIR/t-f071.IMGFMT
             format: FLAT
         [71]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f072.vmdk
+            filename: TEST_DIR/t-f072.IMGFMT
             format: FLAT
         [72]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f073.vmdk
+            filename: TEST_DIR/t-f073.IMGFMT
             format: FLAT
         [73]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f074.vmdk
+            filename: TEST_DIR/t-f074.IMGFMT
             format: FLAT
         [74]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f075.vmdk
+            filename: TEST_DIR/t-f075.IMGFMT
             format: FLAT
         [75]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f076.vmdk
+            filename: TEST_DIR/t-f076.IMGFMT
             format: FLAT
         [76]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f077.vmdk
+            filename: TEST_DIR/t-f077.IMGFMT
             format: FLAT
         [77]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f078.vmdk
+            filename: TEST_DIR/t-f078.IMGFMT
             format: FLAT
         [78]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f079.vmdk
+            filename: TEST_DIR/t-f079.IMGFMT
             format: FLAT
         [79]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f080.vmdk
+            filename: TEST_DIR/t-f080.IMGFMT
             format: FLAT
         [80]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f081.vmdk
+            filename: TEST_DIR/t-f081.IMGFMT
             format: FLAT
         [81]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f082.vmdk
+            filename: TEST_DIR/t-f082.IMGFMT
             format: FLAT
         [82]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f083.vmdk
+            filename: TEST_DIR/t-f083.IMGFMT
             format: FLAT
         [83]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f084.vmdk
+            filename: TEST_DIR/t-f084.IMGFMT
             format: FLAT
         [84]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f085.vmdk
+            filename: TEST_DIR/t-f085.IMGFMT
             format: FLAT
         [85]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f086.vmdk
+            filename: TEST_DIR/t-f086.IMGFMT
             format: FLAT
         [86]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f087.vmdk
+            filename: TEST_DIR/t-f087.IMGFMT
             format: FLAT
         [87]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f088.vmdk
+            filename: TEST_DIR/t-f088.IMGFMT
             format: FLAT
         [88]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f089.vmdk
+            filename: TEST_DIR/t-f089.IMGFMT
             format: FLAT
         [89]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f090.vmdk
+            filename: TEST_DIR/t-f090.IMGFMT
             format: FLAT
         [90]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f091.vmdk
+            filename: TEST_DIR/t-f091.IMGFMT
             format: FLAT
         [91]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f092.vmdk
+            filename: TEST_DIR/t-f092.IMGFMT
             format: FLAT
         [92]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f093.vmdk
+            filename: TEST_DIR/t-f093.IMGFMT
             format: FLAT
         [93]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f094.vmdk
+            filename: TEST_DIR/t-f094.IMGFMT
             format: FLAT
         [94]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f095.vmdk
+            filename: TEST_DIR/t-f095.IMGFMT
             format: FLAT
         [95]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f096.vmdk
+            filename: TEST_DIR/t-f096.IMGFMT
             format: FLAT
         [96]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f097.vmdk
+            filename: TEST_DIR/t-f097.IMGFMT
             format: FLAT
         [97]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f098.vmdk
+            filename: TEST_DIR/t-f098.IMGFMT
             format: FLAT
         [98]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f099.vmdk
+            filename: TEST_DIR/t-f099.IMGFMT
             format: FLAT
         [99]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f100.vmdk
+            filename: TEST_DIR/t-f100.IMGFMT
             format: FLAT
         [100]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f101.vmdk
+            filename: TEST_DIR/t-f101.IMGFMT
             format: FLAT
         [101]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f102.vmdk
+            filename: TEST_DIR/t-f102.IMGFMT
             format: FLAT
         [102]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f103.vmdk
+            filename: TEST_DIR/t-f103.IMGFMT
             format: FLAT
         [103]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f104.vmdk
+            filename: TEST_DIR/t-f104.IMGFMT
             format: FLAT
         [104]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f105.vmdk
+            filename: TEST_DIR/t-f105.IMGFMT
             format: FLAT
         [105]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f106.vmdk
+            filename: TEST_DIR/t-f106.IMGFMT
             format: FLAT
         [106]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f107.vmdk
+            filename: TEST_DIR/t-f107.IMGFMT
             format: FLAT
         [107]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f108.vmdk
+            filename: TEST_DIR/t-f108.IMGFMT
             format: FLAT
         [108]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f109.vmdk
+            filename: TEST_DIR/t-f109.IMGFMT
             format: FLAT
         [109]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f110.vmdk
+            filename: TEST_DIR/t-f110.IMGFMT
             format: FLAT
         [110]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f111.vmdk
+            filename: TEST_DIR/t-f111.IMGFMT
             format: FLAT
         [111]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f112.vmdk
+            filename: TEST_DIR/t-f112.IMGFMT
             format: FLAT
         [112]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f113.vmdk
+            filename: TEST_DIR/t-f113.IMGFMT
             format: FLAT
         [113]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f114.vmdk
+            filename: TEST_DIR/t-f114.IMGFMT
             format: FLAT
         [114]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f115.vmdk
+            filename: TEST_DIR/t-f115.IMGFMT
             format: FLAT
         [115]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f116.vmdk
+            filename: TEST_DIR/t-f116.IMGFMT
             format: FLAT
         [116]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f117.vmdk
+            filename: TEST_DIR/t-f117.IMGFMT
             format: FLAT
         [117]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f118.vmdk
+            filename: TEST_DIR/t-f118.IMGFMT
             format: FLAT
         [118]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f119.vmdk
+            filename: TEST_DIR/t-f119.IMGFMT
             format: FLAT
         [119]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f120.vmdk
+            filename: TEST_DIR/t-f120.IMGFMT
             format: FLAT
         [120]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f121.vmdk
+            filename: TEST_DIR/t-f121.IMGFMT
             format: FLAT
         [121]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f122.vmdk
+            filename: TEST_DIR/t-f122.IMGFMT
             format: FLAT
         [122]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f123.vmdk
+            filename: TEST_DIR/t-f123.IMGFMT
             format: FLAT
         [123]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f124.vmdk
+            filename: TEST_DIR/t-f124.IMGFMT
             format: FLAT
         [124]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f125.vmdk
+            filename: TEST_DIR/t-f125.IMGFMT
             format: FLAT
         [125]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f126.vmdk
+            filename: TEST_DIR/t-f126.IMGFMT
             format: FLAT
         [126]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f127.vmdk
+            filename: TEST_DIR/t-f127.IMGFMT
             format: FLAT
         [127]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f128.vmdk
+            filename: TEST_DIR/t-f128.IMGFMT
             format: FLAT
         [128]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f129.vmdk
+            filename: TEST_DIR/t-f129.IMGFMT
             format: FLAT
         [129]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f130.vmdk
+            filename: TEST_DIR/t-f130.IMGFMT
             format: FLAT
         [130]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f131.vmdk
+            filename: TEST_DIR/t-f131.IMGFMT
             format: FLAT
         [131]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f132.vmdk
+            filename: TEST_DIR/t-f132.IMGFMT
             format: FLAT
         [132]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f133.vmdk
+            filename: TEST_DIR/t-f133.IMGFMT
             format: FLAT
         [133]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f134.vmdk
+            filename: TEST_DIR/t-f134.IMGFMT
             format: FLAT
         [134]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f135.vmdk
+            filename: TEST_DIR/t-f135.IMGFMT
             format: FLAT
         [135]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f136.vmdk
+            filename: TEST_DIR/t-f136.IMGFMT
             format: FLAT
         [136]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f137.vmdk
+            filename: TEST_DIR/t-f137.IMGFMT
             format: FLAT
         [137]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f138.vmdk
+            filename: TEST_DIR/t-f138.IMGFMT
             format: FLAT
         [138]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f139.vmdk
+            filename: TEST_DIR/t-f139.IMGFMT
             format: FLAT
         [139]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f140.vmdk
+            filename: TEST_DIR/t-f140.IMGFMT
             format: FLAT
         [140]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f141.vmdk
+            filename: TEST_DIR/t-f141.IMGFMT
             format: FLAT
         [141]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f142.vmdk
+            filename: TEST_DIR/t-f142.IMGFMT
             format: FLAT
         [142]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f143.vmdk
+            filename: TEST_DIR/t-f143.IMGFMT
             format: FLAT
         [143]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f144.vmdk
+            filename: TEST_DIR/t-f144.IMGFMT
             format: FLAT
         [144]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f145.vmdk
+            filename: TEST_DIR/t-f145.IMGFMT
             format: FLAT
         [145]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f146.vmdk
+            filename: TEST_DIR/t-f146.IMGFMT
             format: FLAT
         [146]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f147.vmdk
+            filename: TEST_DIR/t-f147.IMGFMT
             format: FLAT
         [147]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f148.vmdk
+            filename: TEST_DIR/t-f148.IMGFMT
             format: FLAT
         [148]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f149.vmdk
+            filename: TEST_DIR/t-f149.IMGFMT
             format: FLAT
         [149]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f150.vmdk
+            filename: TEST_DIR/t-f150.IMGFMT
             format: FLAT
         [150]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f151.vmdk
+            filename: TEST_DIR/t-f151.IMGFMT
             format: FLAT
         [151]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f152.vmdk
+            filename: TEST_DIR/t-f152.IMGFMT
             format: FLAT
         [152]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f153.vmdk
+            filename: TEST_DIR/t-f153.IMGFMT
             format: FLAT
         [153]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f154.vmdk
+            filename: TEST_DIR/t-f154.IMGFMT
             format: FLAT
         [154]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f155.vmdk
+            filename: TEST_DIR/t-f155.IMGFMT
             format: FLAT
         [155]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f156.vmdk
+            filename: TEST_DIR/t-f156.IMGFMT
             format: FLAT
         [156]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f157.vmdk
+            filename: TEST_DIR/t-f157.IMGFMT
             format: FLAT
         [157]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f158.vmdk
+            filename: TEST_DIR/t-f158.IMGFMT
             format: FLAT
         [158]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f159.vmdk
+            filename: TEST_DIR/t-f159.IMGFMT
             format: FLAT
         [159]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f160.vmdk
+            filename: TEST_DIR/t-f160.IMGFMT
             format: FLAT
         [160]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f161.vmdk
+            filename: TEST_DIR/t-f161.IMGFMT
             format: FLAT
         [161]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f162.vmdk
+            filename: TEST_DIR/t-f162.IMGFMT
             format: FLAT
         [162]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f163.vmdk
+            filename: TEST_DIR/t-f163.IMGFMT
             format: FLAT
         [163]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f164.vmdk
+            filename: TEST_DIR/t-f164.IMGFMT
             format: FLAT
         [164]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f165.vmdk
+            filename: TEST_DIR/t-f165.IMGFMT
             format: FLAT
         [165]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f166.vmdk
+            filename: TEST_DIR/t-f166.IMGFMT
             format: FLAT
         [166]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f167.vmdk
+            filename: TEST_DIR/t-f167.IMGFMT
             format: FLAT
         [167]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f168.vmdk
+            filename: TEST_DIR/t-f168.IMGFMT
             format: FLAT
         [168]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f169.vmdk
+            filename: TEST_DIR/t-f169.IMGFMT
             format: FLAT
         [169]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f170.vmdk
+            filename: TEST_DIR/t-f170.IMGFMT
             format: FLAT
         [170]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f171.vmdk
+            filename: TEST_DIR/t-f171.IMGFMT
             format: FLAT
         [171]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f172.vmdk
+            filename: TEST_DIR/t-f172.IMGFMT
             format: FLAT
         [172]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f173.vmdk
+            filename: TEST_DIR/t-f173.IMGFMT
             format: FLAT
         [173]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f174.vmdk
+            filename: TEST_DIR/t-f174.IMGFMT
             format: FLAT
         [174]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f175.vmdk
+            filename: TEST_DIR/t-f175.IMGFMT
             format: FLAT
         [175]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f176.vmdk
+            filename: TEST_DIR/t-f176.IMGFMT
             format: FLAT
         [176]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f177.vmdk
+            filename: TEST_DIR/t-f177.IMGFMT
             format: FLAT
         [177]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f178.vmdk
+            filename: TEST_DIR/t-f178.IMGFMT
             format: FLAT
         [178]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f179.vmdk
+            filename: TEST_DIR/t-f179.IMGFMT
             format: FLAT
         [179]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f180.vmdk
+            filename: TEST_DIR/t-f180.IMGFMT
             format: FLAT
         [180]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f181.vmdk
+            filename: TEST_DIR/t-f181.IMGFMT
             format: FLAT
         [181]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f182.vmdk
+            filename: TEST_DIR/t-f182.IMGFMT
             format: FLAT
         [182]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f183.vmdk
+            filename: TEST_DIR/t-f183.IMGFMT
             format: FLAT
         [183]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f184.vmdk
+            filename: TEST_DIR/t-f184.IMGFMT
             format: FLAT
         [184]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f185.vmdk
+            filename: TEST_DIR/t-f185.IMGFMT
             format: FLAT
         [185]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f186.vmdk
+            filename: TEST_DIR/t-f186.IMGFMT
             format: FLAT
         [186]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f187.vmdk
+            filename: TEST_DIR/t-f187.IMGFMT
             format: FLAT
         [187]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f188.vmdk
+            filename: TEST_DIR/t-f188.IMGFMT
             format: FLAT
         [188]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f189.vmdk
+            filename: TEST_DIR/t-f189.IMGFMT
             format: FLAT
         [189]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f190.vmdk
+            filename: TEST_DIR/t-f190.IMGFMT
             format: FLAT
         [190]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f191.vmdk
+            filename: TEST_DIR/t-f191.IMGFMT
             format: FLAT
         [191]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f192.vmdk
+            filename: TEST_DIR/t-f192.IMGFMT
             format: FLAT
         [192]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f193.vmdk
+            filename: TEST_DIR/t-f193.IMGFMT
             format: FLAT
         [193]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f194.vmdk
+            filename: TEST_DIR/t-f194.IMGFMT
             format: FLAT
         [194]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f195.vmdk
+            filename: TEST_DIR/t-f195.IMGFMT
             format: FLAT
         [195]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f196.vmdk
+            filename: TEST_DIR/t-f196.IMGFMT
             format: FLAT
         [196]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f197.vmdk
+            filename: TEST_DIR/t-f197.IMGFMT
             format: FLAT
         [197]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f198.vmdk
+            filename: TEST_DIR/t-f198.IMGFMT
             format: FLAT
         [198]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f199.vmdk
+            filename: TEST_DIR/t-f199.IMGFMT
             format: FLAT
         [199]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f200.vmdk
+            filename: TEST_DIR/t-f200.IMGFMT
             format: FLAT
         [200]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f201.vmdk
+            filename: TEST_DIR/t-f201.IMGFMT
             format: FLAT
         [201]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f202.vmdk
+            filename: TEST_DIR/t-f202.IMGFMT
             format: FLAT
         [202]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f203.vmdk
+            filename: TEST_DIR/t-f203.IMGFMT
             format: FLAT
         [203]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f204.vmdk
+            filename: TEST_DIR/t-f204.IMGFMT
             format: FLAT
         [204]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f205.vmdk
+            filename: TEST_DIR/t-f205.IMGFMT
             format: FLAT
         [205]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f206.vmdk
+            filename: TEST_DIR/t-f206.IMGFMT
             format: FLAT
         [206]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f207.vmdk
+            filename: TEST_DIR/t-f207.IMGFMT
             format: FLAT
         [207]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f208.vmdk
+            filename: TEST_DIR/t-f208.IMGFMT
             format: FLAT
         [208]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f209.vmdk
+            filename: TEST_DIR/t-f209.IMGFMT
             format: FLAT
         [209]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f210.vmdk
+            filename: TEST_DIR/t-f210.IMGFMT
             format: FLAT
         [210]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f211.vmdk
+            filename: TEST_DIR/t-f211.IMGFMT
             format: FLAT
         [211]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f212.vmdk
+            filename: TEST_DIR/t-f212.IMGFMT
             format: FLAT
         [212]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f213.vmdk
+            filename: TEST_DIR/t-f213.IMGFMT
             format: FLAT
         [213]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f214.vmdk
+            filename: TEST_DIR/t-f214.IMGFMT
             format: FLAT
         [214]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f215.vmdk
+            filename: TEST_DIR/t-f215.IMGFMT
             format: FLAT
         [215]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f216.vmdk
+            filename: TEST_DIR/t-f216.IMGFMT
             format: FLAT
         [216]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f217.vmdk
+            filename: TEST_DIR/t-f217.IMGFMT
             format: FLAT
         [217]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f218.vmdk
+            filename: TEST_DIR/t-f218.IMGFMT
             format: FLAT
         [218]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f219.vmdk
+            filename: TEST_DIR/t-f219.IMGFMT
             format: FLAT
         [219]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f220.vmdk
+            filename: TEST_DIR/t-f220.IMGFMT
             format: FLAT
         [220]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f221.vmdk
+            filename: TEST_DIR/t-f221.IMGFMT
             format: FLAT
         [221]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f222.vmdk
+            filename: TEST_DIR/t-f222.IMGFMT
             format: FLAT
         [222]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f223.vmdk
+            filename: TEST_DIR/t-f223.IMGFMT
             format: FLAT
         [223]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f224.vmdk
+            filename: TEST_DIR/t-f224.IMGFMT
             format: FLAT
         [224]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f225.vmdk
+            filename: TEST_DIR/t-f225.IMGFMT
             format: FLAT
         [225]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f226.vmdk
+            filename: TEST_DIR/t-f226.IMGFMT
             format: FLAT
         [226]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f227.vmdk
+            filename: TEST_DIR/t-f227.IMGFMT
             format: FLAT
         [227]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f228.vmdk
+            filename: TEST_DIR/t-f228.IMGFMT
             format: FLAT
         [228]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f229.vmdk
+            filename: TEST_DIR/t-f229.IMGFMT
             format: FLAT
         [229]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f230.vmdk
+            filename: TEST_DIR/t-f230.IMGFMT
             format: FLAT
         [230]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f231.vmdk
+            filename: TEST_DIR/t-f231.IMGFMT
             format: FLAT
         [231]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f232.vmdk
+            filename: TEST_DIR/t-f232.IMGFMT
             format: FLAT
         [232]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f233.vmdk
+            filename: TEST_DIR/t-f233.IMGFMT
             format: FLAT
         [233]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f234.vmdk
+            filename: TEST_DIR/t-f234.IMGFMT
             format: FLAT
         [234]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f235.vmdk
+            filename: TEST_DIR/t-f235.IMGFMT
             format: FLAT
         [235]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f236.vmdk
+            filename: TEST_DIR/t-f236.IMGFMT
             format: FLAT
         [236]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f237.vmdk
+            filename: TEST_DIR/t-f237.IMGFMT
             format: FLAT
         [237]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f238.vmdk
+            filename: TEST_DIR/t-f238.IMGFMT
             format: FLAT
         [238]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f239.vmdk
+            filename: TEST_DIR/t-f239.IMGFMT
             format: FLAT
         [239]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f240.vmdk
+            filename: TEST_DIR/t-f240.IMGFMT
             format: FLAT
         [240]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f241.vmdk
+            filename: TEST_DIR/t-f241.IMGFMT
             format: FLAT
         [241]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f242.vmdk
+            filename: TEST_DIR/t-f242.IMGFMT
             format: FLAT
         [242]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f243.vmdk
+            filename: TEST_DIR/t-f243.IMGFMT
             format: FLAT
         [243]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f244.vmdk
+            filename: TEST_DIR/t-f244.IMGFMT
             format: FLAT
         [244]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f245.vmdk
+            filename: TEST_DIR/t-f245.IMGFMT
             format: FLAT
         [245]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f246.vmdk
+            filename: TEST_DIR/t-f246.IMGFMT
             format: FLAT
         [246]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f247.vmdk
+            filename: TEST_DIR/t-f247.IMGFMT
             format: FLAT
         [247]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f248.vmdk
+            filename: TEST_DIR/t-f248.IMGFMT
             format: FLAT
         [248]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f249.vmdk
+            filename: TEST_DIR/t-f249.IMGFMT
             format: FLAT
         [249]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f250.vmdk
+            filename: TEST_DIR/t-f250.IMGFMT
             format: FLAT
         [250]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f251.vmdk
+            filename: TEST_DIR/t-f251.IMGFMT
             format: FLAT
         [251]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f252.vmdk
+            filename: TEST_DIR/t-f252.IMGFMT
             format: FLAT
         [252]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f253.vmdk
+            filename: TEST_DIR/t-f253.IMGFMT
             format: FLAT
         [253]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f254.vmdk
+            filename: TEST_DIR/t-f254.IMGFMT
             format: FLAT
         [254]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f255.vmdk
+            filename: TEST_DIR/t-f255.IMGFMT
             format: FLAT
         [255]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f256.vmdk
+            filename: TEST_DIR/t-f256.IMGFMT
             format: FLAT
         [256]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f257.vmdk
+            filename: TEST_DIR/t-f257.IMGFMT
             format: FLAT
         [257]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f258.vmdk
+            filename: TEST_DIR/t-f258.IMGFMT
             format: FLAT
         [258]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f259.vmdk
+            filename: TEST_DIR/t-f259.IMGFMT
             format: FLAT
         [259]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f260.vmdk
+            filename: TEST_DIR/t-f260.IMGFMT
             format: FLAT
         [260]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f261.vmdk
+            filename: TEST_DIR/t-f261.IMGFMT
             format: FLAT
         [261]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f262.vmdk
+            filename: TEST_DIR/t-f262.IMGFMT
             format: FLAT
         [262]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f263.vmdk
+            filename: TEST_DIR/t-f263.IMGFMT
             format: FLAT
         [263]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f264.vmdk
+            filename: TEST_DIR/t-f264.IMGFMT
             format: FLAT
         [264]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f265.vmdk
+            filename: TEST_DIR/t-f265.IMGFMT
             format: FLAT
         [265]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f266.vmdk
+            filename: TEST_DIR/t-f266.IMGFMT
             format: FLAT
         [266]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f267.vmdk
+            filename: TEST_DIR/t-f267.IMGFMT
             format: FLAT
         [267]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f268.vmdk
+            filename: TEST_DIR/t-f268.IMGFMT
             format: FLAT
         [268]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f269.vmdk
+            filename: TEST_DIR/t-f269.IMGFMT
             format: FLAT
         [269]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f270.vmdk
+            filename: TEST_DIR/t-f270.IMGFMT
             format: FLAT
         [270]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f271.vmdk
+            filename: TEST_DIR/t-f271.IMGFMT
             format: FLAT
         [271]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f272.vmdk
+            filename: TEST_DIR/t-f272.IMGFMT
             format: FLAT
         [272]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f273.vmdk
+            filename: TEST_DIR/t-f273.IMGFMT
             format: FLAT
         [273]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f274.vmdk
+            filename: TEST_DIR/t-f274.IMGFMT
             format: FLAT
         [274]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f275.vmdk
+            filename: TEST_DIR/t-f275.IMGFMT
             format: FLAT
         [275]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f276.vmdk
+            filename: TEST_DIR/t-f276.IMGFMT
             format: FLAT
         [276]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f277.vmdk
+            filename: TEST_DIR/t-f277.IMGFMT
             format: FLAT
         [277]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f278.vmdk
+            filename: TEST_DIR/t-f278.IMGFMT
             format: FLAT
         [278]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f279.vmdk
+            filename: TEST_DIR/t-f279.IMGFMT
             format: FLAT
         [279]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f280.vmdk
+            filename: TEST_DIR/t-f280.IMGFMT
             format: FLAT
         [280]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f281.vmdk
+            filename: TEST_DIR/t-f281.IMGFMT
             format: FLAT
         [281]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f282.vmdk
+            filename: TEST_DIR/t-f282.IMGFMT
             format: FLAT
         [282]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f283.vmdk
+            filename: TEST_DIR/t-f283.IMGFMT
             format: FLAT
         [283]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f284.vmdk
+            filename: TEST_DIR/t-f284.IMGFMT
             format: FLAT
         [284]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f285.vmdk
+            filename: TEST_DIR/t-f285.IMGFMT
             format: FLAT
         [285]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f286.vmdk
+            filename: TEST_DIR/t-f286.IMGFMT
             format: FLAT
         [286]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f287.vmdk
+            filename: TEST_DIR/t-f287.IMGFMT
             format: FLAT
         [287]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f288.vmdk
+            filename: TEST_DIR/t-f288.IMGFMT
             format: FLAT
         [288]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f289.vmdk
+            filename: TEST_DIR/t-f289.IMGFMT
             format: FLAT
         [289]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f290.vmdk
+            filename: TEST_DIR/t-f290.IMGFMT
             format: FLAT
         [290]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f291.vmdk
+            filename: TEST_DIR/t-f291.IMGFMT
             format: FLAT
         [291]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f292.vmdk
+            filename: TEST_DIR/t-f292.IMGFMT
             format: FLAT
         [292]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f293.vmdk
+            filename: TEST_DIR/t-f293.IMGFMT
             format: FLAT
         [293]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f294.vmdk
+            filename: TEST_DIR/t-f294.IMGFMT
             format: FLAT
         [294]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f295.vmdk
+            filename: TEST_DIR/t-f295.IMGFMT
             format: FLAT
         [295]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f296.vmdk
+            filename: TEST_DIR/t-f296.IMGFMT
             format: FLAT
         [296]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f297.vmdk
+            filename: TEST_DIR/t-f297.IMGFMT
             format: FLAT
         [297]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f298.vmdk
+            filename: TEST_DIR/t-f298.IMGFMT
             format: FLAT
         [298]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f299.vmdk
+            filename: TEST_DIR/t-f299.IMGFMT
             format: FLAT
         [299]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f300.vmdk
+            filename: TEST_DIR/t-f300.IMGFMT
             format: FLAT
         [300]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f301.vmdk
+            filename: TEST_DIR/t-f301.IMGFMT
             format: FLAT
         [301]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f302.vmdk
+            filename: TEST_DIR/t-f302.IMGFMT
             format: FLAT
         [302]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f303.vmdk
+            filename: TEST_DIR/t-f303.IMGFMT
             format: FLAT
         [303]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f304.vmdk
+            filename: TEST_DIR/t-f304.IMGFMT
             format: FLAT
         [304]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f305.vmdk
+            filename: TEST_DIR/t-f305.IMGFMT
             format: FLAT
         [305]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f306.vmdk
+            filename: TEST_DIR/t-f306.IMGFMT
             format: FLAT
         [306]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f307.vmdk
+            filename: TEST_DIR/t-f307.IMGFMT
             format: FLAT
         [307]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f308.vmdk
+            filename: TEST_DIR/t-f308.IMGFMT
             format: FLAT
         [308]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f309.vmdk
+            filename: TEST_DIR/t-f309.IMGFMT
             format: FLAT
         [309]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f310.vmdk
+            filename: TEST_DIR/t-f310.IMGFMT
             format: FLAT
         [310]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f311.vmdk
+            filename: TEST_DIR/t-f311.IMGFMT
             format: FLAT
         [311]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f312.vmdk
+            filename: TEST_DIR/t-f312.IMGFMT
             format: FLAT
         [312]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f313.vmdk
+            filename: TEST_DIR/t-f313.IMGFMT
             format: FLAT
         [313]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f314.vmdk
+            filename: TEST_DIR/t-f314.IMGFMT
             format: FLAT
         [314]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f315.vmdk
+            filename: TEST_DIR/t-f315.IMGFMT
             format: FLAT
         [315]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f316.vmdk
+            filename: TEST_DIR/t-f316.IMGFMT
             format: FLAT
         [316]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f317.vmdk
+            filename: TEST_DIR/t-f317.IMGFMT
             format: FLAT
         [317]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f318.vmdk
+            filename: TEST_DIR/t-f318.IMGFMT
             format: FLAT
         [318]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f319.vmdk
+            filename: TEST_DIR/t-f319.IMGFMT
             format: FLAT
         [319]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f320.vmdk
+            filename: TEST_DIR/t-f320.IMGFMT
             format: FLAT
         [320]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f321.vmdk
+            filename: TEST_DIR/t-f321.IMGFMT
             format: FLAT
         [321]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f322.vmdk
+            filename: TEST_DIR/t-f322.IMGFMT
             format: FLAT
         [322]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f323.vmdk
+            filename: TEST_DIR/t-f323.IMGFMT
             format: FLAT
         [323]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f324.vmdk
+            filename: TEST_DIR/t-f324.IMGFMT
             format: FLAT
         [324]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f325.vmdk
+            filename: TEST_DIR/t-f325.IMGFMT
             format: FLAT
         [325]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f326.vmdk
+            filename: TEST_DIR/t-f326.IMGFMT
             format: FLAT
         [326]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f327.vmdk
+            filename: TEST_DIR/t-f327.IMGFMT
             format: FLAT
         [327]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f328.vmdk
+            filename: TEST_DIR/t-f328.IMGFMT
             format: FLAT
         [328]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f329.vmdk
+            filename: TEST_DIR/t-f329.IMGFMT
             format: FLAT
         [329]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f330.vmdk
+            filename: TEST_DIR/t-f330.IMGFMT
             format: FLAT
         [330]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f331.vmdk
+            filename: TEST_DIR/t-f331.IMGFMT
             format: FLAT
         [331]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f332.vmdk
+            filename: TEST_DIR/t-f332.IMGFMT
             format: FLAT
         [332]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f333.vmdk
+            filename: TEST_DIR/t-f333.IMGFMT
             format: FLAT
         [333]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f334.vmdk
+            filename: TEST_DIR/t-f334.IMGFMT
             format: FLAT
         [334]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f335.vmdk
+            filename: TEST_DIR/t-f335.IMGFMT
             format: FLAT
         [335]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f336.vmdk
+            filename: TEST_DIR/t-f336.IMGFMT
             format: FLAT
         [336]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f337.vmdk
+            filename: TEST_DIR/t-f337.IMGFMT
             format: FLAT
         [337]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f338.vmdk
+            filename: TEST_DIR/t-f338.IMGFMT
             format: FLAT
         [338]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f339.vmdk
+            filename: TEST_DIR/t-f339.IMGFMT
             format: FLAT
         [339]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f340.vmdk
+            filename: TEST_DIR/t-f340.IMGFMT
             format: FLAT
         [340]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f341.vmdk
+            filename: TEST_DIR/t-f341.IMGFMT
             format: FLAT
         [341]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f342.vmdk
+            filename: TEST_DIR/t-f342.IMGFMT
             format: FLAT
         [342]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f343.vmdk
+            filename: TEST_DIR/t-f343.IMGFMT
             format: FLAT
         [343]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f344.vmdk
+            filename: TEST_DIR/t-f344.IMGFMT
             format: FLAT
         [344]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f345.vmdk
+            filename: TEST_DIR/t-f345.IMGFMT
             format: FLAT
         [345]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f346.vmdk
+            filename: TEST_DIR/t-f346.IMGFMT
             format: FLAT
         [346]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f347.vmdk
+            filename: TEST_DIR/t-f347.IMGFMT
             format: FLAT
         [347]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f348.vmdk
+            filename: TEST_DIR/t-f348.IMGFMT
             format: FLAT
         [348]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f349.vmdk
+            filename: TEST_DIR/t-f349.IMGFMT
             format: FLAT
         [349]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f350.vmdk
+            filename: TEST_DIR/t-f350.IMGFMT
             format: FLAT
         [350]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f351.vmdk
+            filename: TEST_DIR/t-f351.IMGFMT
             format: FLAT
         [351]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f352.vmdk
+            filename: TEST_DIR/t-f352.IMGFMT
             format: FLAT
         [352]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f353.vmdk
+            filename: TEST_DIR/t-f353.IMGFMT
             format: FLAT
         [353]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f354.vmdk
+            filename: TEST_DIR/t-f354.IMGFMT
             format: FLAT
         [354]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f355.vmdk
+            filename: TEST_DIR/t-f355.IMGFMT
             format: FLAT
         [355]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f356.vmdk
+            filename: TEST_DIR/t-f356.IMGFMT
             format: FLAT
         [356]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f357.vmdk
+            filename: TEST_DIR/t-f357.IMGFMT
             format: FLAT
         [357]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f358.vmdk
+            filename: TEST_DIR/t-f358.IMGFMT
             format: FLAT
         [358]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f359.vmdk
+            filename: TEST_DIR/t-f359.IMGFMT
             format: FLAT
         [359]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f360.vmdk
+            filename: TEST_DIR/t-f360.IMGFMT
             format: FLAT
         [360]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f361.vmdk
+            filename: TEST_DIR/t-f361.IMGFMT
             format: FLAT
         [361]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f362.vmdk
+            filename: TEST_DIR/t-f362.IMGFMT
             format: FLAT
         [362]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f363.vmdk
+            filename: TEST_DIR/t-f363.IMGFMT
             format: FLAT
         [363]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f364.vmdk
+            filename: TEST_DIR/t-f364.IMGFMT
             format: FLAT
         [364]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f365.vmdk
+            filename: TEST_DIR/t-f365.IMGFMT
             format: FLAT
         [365]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f366.vmdk
+            filename: TEST_DIR/t-f366.IMGFMT
             format: FLAT
         [366]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f367.vmdk
+            filename: TEST_DIR/t-f367.IMGFMT
             format: FLAT
         [367]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f368.vmdk
+            filename: TEST_DIR/t-f368.IMGFMT
             format: FLAT
         [368]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f369.vmdk
+            filename: TEST_DIR/t-f369.IMGFMT
             format: FLAT
         [369]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f370.vmdk
+            filename: TEST_DIR/t-f370.IMGFMT
             format: FLAT
         [370]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f371.vmdk
+            filename: TEST_DIR/t-f371.IMGFMT
             format: FLAT
         [371]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f372.vmdk
+            filename: TEST_DIR/t-f372.IMGFMT
             format: FLAT
         [372]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f373.vmdk
+            filename: TEST_DIR/t-f373.IMGFMT
             format: FLAT
         [373]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f374.vmdk
+            filename: TEST_DIR/t-f374.IMGFMT
             format: FLAT
         [374]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f375.vmdk
+            filename: TEST_DIR/t-f375.IMGFMT
             format: FLAT
         [375]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f376.vmdk
+            filename: TEST_DIR/t-f376.IMGFMT
             format: FLAT
         [376]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f377.vmdk
+            filename: TEST_DIR/t-f377.IMGFMT
             format: FLAT
         [377]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f378.vmdk
+            filename: TEST_DIR/t-f378.IMGFMT
             format: FLAT
         [378]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f379.vmdk
+            filename: TEST_DIR/t-f379.IMGFMT
             format: FLAT
         [379]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f380.vmdk
+            filename: TEST_DIR/t-f380.IMGFMT
             format: FLAT
         [380]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f381.vmdk
+            filename: TEST_DIR/t-f381.IMGFMT
             format: FLAT
         [381]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f382.vmdk
+            filename: TEST_DIR/t-f382.IMGFMT
             format: FLAT
         [382]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f383.vmdk
+            filename: TEST_DIR/t-f383.IMGFMT
             format: FLAT
         [383]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f384.vmdk
+            filename: TEST_DIR/t-f384.IMGFMT
             format: FLAT
         [384]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f385.vmdk
+            filename: TEST_DIR/t-f385.IMGFMT
             format: FLAT
         [385]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f386.vmdk
+            filename: TEST_DIR/t-f386.IMGFMT
             format: FLAT
         [386]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f387.vmdk
+            filename: TEST_DIR/t-f387.IMGFMT
             format: FLAT
         [387]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f388.vmdk
+            filename: TEST_DIR/t-f388.IMGFMT
             format: FLAT
         [388]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f389.vmdk
+            filename: TEST_DIR/t-f389.IMGFMT
             format: FLAT
         [389]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f390.vmdk
+            filename: TEST_DIR/t-f390.IMGFMT
             format: FLAT
         [390]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f391.vmdk
+            filename: TEST_DIR/t-f391.IMGFMT
             format: FLAT
         [391]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f392.vmdk
+            filename: TEST_DIR/t-f392.IMGFMT
             format: FLAT
         [392]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f393.vmdk
+            filename: TEST_DIR/t-f393.IMGFMT
             format: FLAT
         [393]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f394.vmdk
+            filename: TEST_DIR/t-f394.IMGFMT
             format: FLAT
         [394]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f395.vmdk
+            filename: TEST_DIR/t-f395.IMGFMT
             format: FLAT
         [395]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f396.vmdk
+            filename: TEST_DIR/t-f396.IMGFMT
             format: FLAT
         [396]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f397.vmdk
+            filename: TEST_DIR/t-f397.IMGFMT
             format: FLAT
         [397]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f398.vmdk
+            filename: TEST_DIR/t-f398.IMGFMT
             format: FLAT
         [398]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f399.vmdk
+            filename: TEST_DIR/t-f399.IMGFMT
             format: FLAT
         [399]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f400.vmdk
+            filename: TEST_DIR/t-f400.IMGFMT
             format: FLAT
         [400]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f401.vmdk
+            filename: TEST_DIR/t-f401.IMGFMT
             format: FLAT
         [401]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f402.vmdk
+            filename: TEST_DIR/t-f402.IMGFMT
             format: FLAT
         [402]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f403.vmdk
+            filename: TEST_DIR/t-f403.IMGFMT
             format: FLAT
         [403]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f404.vmdk
+            filename: TEST_DIR/t-f404.IMGFMT
             format: FLAT
         [404]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f405.vmdk
+            filename: TEST_DIR/t-f405.IMGFMT
             format: FLAT
         [405]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f406.vmdk
+            filename: TEST_DIR/t-f406.IMGFMT
             format: FLAT
         [406]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f407.vmdk
+            filename: TEST_DIR/t-f407.IMGFMT
             format: FLAT
         [407]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f408.vmdk
+            filename: TEST_DIR/t-f408.IMGFMT
             format: FLAT
         [408]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f409.vmdk
+            filename: TEST_DIR/t-f409.IMGFMT
             format: FLAT
         [409]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f410.vmdk
+            filename: TEST_DIR/t-f410.IMGFMT
             format: FLAT
         [410]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f411.vmdk
+            filename: TEST_DIR/t-f411.IMGFMT
             format: FLAT
         [411]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f412.vmdk
+            filename: TEST_DIR/t-f412.IMGFMT
             format: FLAT
         [412]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f413.vmdk
+            filename: TEST_DIR/t-f413.IMGFMT
             format: FLAT
         [413]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f414.vmdk
+            filename: TEST_DIR/t-f414.IMGFMT
             format: FLAT
         [414]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f415.vmdk
+            filename: TEST_DIR/t-f415.IMGFMT
             format: FLAT
         [415]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f416.vmdk
+            filename: TEST_DIR/t-f416.IMGFMT
             format: FLAT
         [416]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f417.vmdk
+            filename: TEST_DIR/t-f417.IMGFMT
             format: FLAT
         [417]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f418.vmdk
+            filename: TEST_DIR/t-f418.IMGFMT
             format: FLAT
         [418]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f419.vmdk
+            filename: TEST_DIR/t-f419.IMGFMT
             format: FLAT
         [419]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f420.vmdk
+            filename: TEST_DIR/t-f420.IMGFMT
             format: FLAT
         [420]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f421.vmdk
+            filename: TEST_DIR/t-f421.IMGFMT
             format: FLAT
         [421]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f422.vmdk
+            filename: TEST_DIR/t-f422.IMGFMT
             format: FLAT
         [422]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f423.vmdk
+            filename: TEST_DIR/t-f423.IMGFMT
             format: FLAT
         [423]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f424.vmdk
+            filename: TEST_DIR/t-f424.IMGFMT
             format: FLAT
         [424]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f425.vmdk
+            filename: TEST_DIR/t-f425.IMGFMT
             format: FLAT
         [425]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f426.vmdk
+            filename: TEST_DIR/t-f426.IMGFMT
             format: FLAT
         [426]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f427.vmdk
+            filename: TEST_DIR/t-f427.IMGFMT
             format: FLAT
         [427]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f428.vmdk
+            filename: TEST_DIR/t-f428.IMGFMT
             format: FLAT
         [428]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f429.vmdk
+            filename: TEST_DIR/t-f429.IMGFMT
             format: FLAT
         [429]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f430.vmdk
+            filename: TEST_DIR/t-f430.IMGFMT
             format: FLAT
         [430]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f431.vmdk
+            filename: TEST_DIR/t-f431.IMGFMT
             format: FLAT
         [431]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f432.vmdk
+            filename: TEST_DIR/t-f432.IMGFMT
             format: FLAT
         [432]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f433.vmdk
+            filename: TEST_DIR/t-f433.IMGFMT
             format: FLAT
         [433]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f434.vmdk
+            filename: TEST_DIR/t-f434.IMGFMT
             format: FLAT
         [434]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f435.vmdk
+            filename: TEST_DIR/t-f435.IMGFMT
             format: FLAT
         [435]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f436.vmdk
+            filename: TEST_DIR/t-f436.IMGFMT
             format: FLAT
         [436]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f437.vmdk
+            filename: TEST_DIR/t-f437.IMGFMT
             format: FLAT
         [437]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f438.vmdk
+            filename: TEST_DIR/t-f438.IMGFMT
             format: FLAT
         [438]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f439.vmdk
+            filename: TEST_DIR/t-f439.IMGFMT
             format: FLAT
         [439]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f440.vmdk
+            filename: TEST_DIR/t-f440.IMGFMT
             format: FLAT
         [440]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f441.vmdk
+            filename: TEST_DIR/t-f441.IMGFMT
             format: FLAT
         [441]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f442.vmdk
+            filename: TEST_DIR/t-f442.IMGFMT
             format: FLAT
         [442]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f443.vmdk
+            filename: TEST_DIR/t-f443.IMGFMT
             format: FLAT
         [443]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f444.vmdk
+            filename: TEST_DIR/t-f444.IMGFMT
             format: FLAT
         [444]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f445.vmdk
+            filename: TEST_DIR/t-f445.IMGFMT
             format: FLAT
         [445]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f446.vmdk
+            filename: TEST_DIR/t-f446.IMGFMT
             format: FLAT
         [446]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f447.vmdk
+            filename: TEST_DIR/t-f447.IMGFMT
             format: FLAT
         [447]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f448.vmdk
+            filename: TEST_DIR/t-f448.IMGFMT
             format: FLAT
         [448]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f449.vmdk
+            filename: TEST_DIR/t-f449.IMGFMT
             format: FLAT
         [449]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f450.vmdk
+            filename: TEST_DIR/t-f450.IMGFMT
             format: FLAT
         [450]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f451.vmdk
+            filename: TEST_DIR/t-f451.IMGFMT
             format: FLAT
         [451]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f452.vmdk
+            filename: TEST_DIR/t-f452.IMGFMT
             format: FLAT
         [452]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f453.vmdk
+            filename: TEST_DIR/t-f453.IMGFMT
             format: FLAT
         [453]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f454.vmdk
+            filename: TEST_DIR/t-f454.IMGFMT
             format: FLAT
         [454]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f455.vmdk
+            filename: TEST_DIR/t-f455.IMGFMT
             format: FLAT
         [455]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f456.vmdk
+            filename: TEST_DIR/t-f456.IMGFMT
             format: FLAT
         [456]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f457.vmdk
+            filename: TEST_DIR/t-f457.IMGFMT
             format: FLAT
         [457]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f458.vmdk
+            filename: TEST_DIR/t-f458.IMGFMT
             format: FLAT
         [458]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f459.vmdk
+            filename: TEST_DIR/t-f459.IMGFMT
             format: FLAT
         [459]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f460.vmdk
+            filename: TEST_DIR/t-f460.IMGFMT
             format: FLAT
         [460]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f461.vmdk
+            filename: TEST_DIR/t-f461.IMGFMT
             format: FLAT
         [461]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f462.vmdk
+            filename: TEST_DIR/t-f462.IMGFMT
             format: FLAT
         [462]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f463.vmdk
+            filename: TEST_DIR/t-f463.IMGFMT
             format: FLAT
         [463]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f464.vmdk
+            filename: TEST_DIR/t-f464.IMGFMT
             format: FLAT
         [464]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f465.vmdk
+            filename: TEST_DIR/t-f465.IMGFMT
             format: FLAT
         [465]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f466.vmdk
+            filename: TEST_DIR/t-f466.IMGFMT
             format: FLAT
         [466]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f467.vmdk
+            filename: TEST_DIR/t-f467.IMGFMT
             format: FLAT
         [467]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f468.vmdk
+            filename: TEST_DIR/t-f468.IMGFMT
             format: FLAT
         [468]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f469.vmdk
+            filename: TEST_DIR/t-f469.IMGFMT
             format: FLAT
         [469]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f470.vmdk
+            filename: TEST_DIR/t-f470.IMGFMT
             format: FLAT
         [470]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f471.vmdk
+            filename: TEST_DIR/t-f471.IMGFMT
             format: FLAT
         [471]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f472.vmdk
+            filename: TEST_DIR/t-f472.IMGFMT
             format: FLAT
         [472]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f473.vmdk
+            filename: TEST_DIR/t-f473.IMGFMT
             format: FLAT
         [473]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f474.vmdk
+            filename: TEST_DIR/t-f474.IMGFMT
             format: FLAT
         [474]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f475.vmdk
+            filename: TEST_DIR/t-f475.IMGFMT
             format: FLAT
         [475]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f476.vmdk
+            filename: TEST_DIR/t-f476.IMGFMT
             format: FLAT
         [476]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f477.vmdk
+            filename: TEST_DIR/t-f477.IMGFMT
             format: FLAT
         [477]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f478.vmdk
+            filename: TEST_DIR/t-f478.IMGFMT
             format: FLAT
         [478]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f479.vmdk
+            filename: TEST_DIR/t-f479.IMGFMT
             format: FLAT
         [479]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f480.vmdk
+            filename: TEST_DIR/t-f480.IMGFMT
             format: FLAT
         [480]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f481.vmdk
+            filename: TEST_DIR/t-f481.IMGFMT
             format: FLAT
         [481]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f482.vmdk
+            filename: TEST_DIR/t-f482.IMGFMT
             format: FLAT
         [482]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f483.vmdk
+            filename: TEST_DIR/t-f483.IMGFMT
             format: FLAT
         [483]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f484.vmdk
+            filename: TEST_DIR/t-f484.IMGFMT
             format: FLAT
         [484]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f485.vmdk
+            filename: TEST_DIR/t-f485.IMGFMT
             format: FLAT
         [485]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f486.vmdk
+            filename: TEST_DIR/t-f486.IMGFMT
             format: FLAT
         [486]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f487.vmdk
+            filename: TEST_DIR/t-f487.IMGFMT
             format: FLAT
         [487]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f488.vmdk
+            filename: TEST_DIR/t-f488.IMGFMT
             format: FLAT
         [488]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f489.vmdk
+            filename: TEST_DIR/t-f489.IMGFMT
             format: FLAT
         [489]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f490.vmdk
+            filename: TEST_DIR/t-f490.IMGFMT
             format: FLAT
         [490]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f491.vmdk
+            filename: TEST_DIR/t-f491.IMGFMT
             format: FLAT
         [491]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f492.vmdk
+            filename: TEST_DIR/t-f492.IMGFMT
             format: FLAT
         [492]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f493.vmdk
+            filename: TEST_DIR/t-f493.IMGFMT
             format: FLAT
         [493]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f494.vmdk
+            filename: TEST_DIR/t-f494.IMGFMT
             format: FLAT
         [494]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f495.vmdk
+            filename: TEST_DIR/t-f495.IMGFMT
             format: FLAT
         [495]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f496.vmdk
+            filename: TEST_DIR/t-f496.IMGFMT
             format: FLAT
         [496]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f497.vmdk
+            filename: TEST_DIR/t-f497.IMGFMT
             format: FLAT
         [497]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f498.vmdk
+            filename: TEST_DIR/t-f498.IMGFMT
             format: FLAT
         [498]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f499.vmdk
+            filename: TEST_DIR/t-f499.IMGFMT
             format: FLAT
         [499]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f500.vmdk
+            filename: TEST_DIR/t-f500.IMGFMT
             format: FLAT
 
 === Testing malformed VMFS extent description line ===
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:49:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:49:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14762.36566 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErs-00031x-ND; Thu, 29 Oct 2020 20:49:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14762.36566; Thu, 29 Oct 2020 20:49:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYErs-00031p-KB; Thu, 29 Oct 2020 20:49:56 +0000
Received: by outflank-mailman (input) for mailman id 14762;
 Thu, 29 Oct 2020 20:49:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYErr-00031h-GX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2019c745-532e-4945-a529-c83c8b0cc2f2;
 Thu, 29 Oct 2020 20:49:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErp-0006q9-Ji
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErp-0000n3-Ih
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYErr-00031h-GX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:55 +0000
X-Inumbo-ID: 2019c745-532e-4945-a529-c83c8b0cc2f2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2019c745-532e-4945-a529-c83c8b0cc2f2;
	Thu, 29 Oct 2020 20:49:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GTx+drbAm4MNAi6o+t96Xqk/kBCQYW2eHeGK+9dmQ+k=; b=AkPa+rBUIY6iuJUD3BS4A1OwGj
	EYHO5saLhsvAo9mNH4TDXnN/NFVnZMELmGQ9KRGIa6hGvjrkSx0D7CWX18JmpwDkKlc6RAUuMia9t
	KzFoaQ3LBj1G4XNhVvRMF1o41aruDTXWRy2ExM0fPCCoHfM6p7z2DWz+VocAd/3C/MeM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErp-0006q9-Ji
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErp-0000n3-Ih
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:49:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Mitigate file fragmentation with extent size hints
Message-Id: <E1kYErp-0000n3-Ih@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:49:53 +0000

commit ffa244c84a1a30dff69ecc80b0137a2b6d428ecb
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 7 16:23:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    file-posix: Mitigate file fragmentation with extent size hints
    
    Especially when O_DIRECT is used with image files so that the page cache
    indirection can't cause a merge of allocating requests, the file will
    fragment on the file system layer, with a potentially very small
    fragment size (this depends on the requests the guest sent).
    
    On Linux, fragmentation can be reduced by setting an extent size hint
    when creating the file (at least on XFS, it can't be set any more after
    the first extent has been allocated), basically giving raw files a
    "cluster size" for allocation.
    
    This adds a create option to set the extent size hint, and changes the
    default from not setting a hint to setting it to 1 MB. The main reason
    why qcow2 defaults to smaller cluster sizes is that COW becomes more
    expensive, which is not an issue with raw files, so we can choose a
    larger size. The tradeoff here is only potentially wasted disk space.
    
    For qcow2 (or other image formats) over file-posix, the advantage should
    even be greater because they grow sequentially without leaving holes, so
    there won't be wasted space. Setting even larger extent size hints for
    such images may make sense. This can be done with the new option, but
    let's keep the default conservative for now.
    
    The effect is very visible with a test that intentionally creates a
    badly fragmented file with qemu-img bench (the time difference while
    creating the file is already remarkable) and then looks at the number of
    extents and the time a simple "qemu-img map" takes.
    
    Without an extent size hint:
    
        $ ./qemu-img create -f raw -o extent_size_hint=0 ~/tmp/test.raw 10G
        Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=0
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
        Run completed in 25.848 seconds.
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
        Run completed in 19.616 seconds.
        $ filefrag ~/tmp/test.raw
        /home/kwolf/tmp/test.raw: 2000000 extents found
        $ time ./qemu-img map ~/tmp/test.raw
        Offset          Length          Mapped to       File
        0               0x1e8480000     0               /home/kwolf/tmp/test.raw
    
        real    0m1,279s
        user    0m0,043s
        sys     0m1,226s
    
    With the new default extent size hint of 1 MB:
    
        $ ./qemu-img create -f raw -o extent_size_hint=1M ~/tmp/test.raw 10G
        Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=1048576
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
        Run completed in 11.833 seconds.
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
        Run completed in 10.155 seconds.
        $ filefrag ~/tmp/test.raw
        /home/kwolf/tmp/test.raw: 178 extents found
        $ time ./qemu-img map ~/tmp/test.raw
        Offset          Length          Mapped to       File
        0               0x1e8480000     0               /home/kwolf/tmp/test.raw
    
        real    0m0,061s
        user    0m0,040s
        sys     0m0,014s
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200707142329.48303-1-kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c         | 44 ++++++++++++++++++++++++++++++++++++++++++++
 include/block/block_int.h  |  1 +
 qapi/block-core.json       | 11 +++++++----
 tests/qemu-iotests/082.out | 16 ++++++++++++++++
 tests/qemu-iotests/106     |  7 +++++--
 tests/qemu-iotests/175     |  6 +++---
 tests/qemu-iotests/243     |  7 ++++---
 7 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 1989eae85f..8067e238cb 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -30,6 +30,7 @@
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/option.h"
+#include "qemu/units.h"
 #include "trace.h"
 #include "block/thread-pool.h"
 #include "qemu/iov.h"
@@ -2318,6 +2319,14 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
     if (!file_opts->has_preallocation) {
         file_opts->preallocation = PREALLOC_MODE_OFF;
     }
+    if (!file_opts->has_extent_size_hint) {
+        file_opts->extent_size_hint = 1 * MiB;
+    }
+    if (file_opts->extent_size_hint > UINT32_MAX) {
+        result = -EINVAL;
+        error_setg(errp, "Extent size hint is too large");
+        goto out;
+    }
 
     /* Create file */
     fd = qemu_open(file_opts->filename, O_RDWR | O_CREAT | O_BINARY, 0644);
@@ -2375,6 +2384,27 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
         }
 #endif
     }
+#ifdef FS_IOC_FSSETXATTR
+    /*
+     * Try to set the extent size hint. Failure is not fatal, and a warning is
+     * only printed if the option was explicitly specified.
+     */
+    {
+        struct fsxattr attr;
+        result = ioctl(fd, FS_IOC_FSGETXATTR, &attr);
+        if (result == 0) {
+            attr.fsx_xflags |= FS_XFLAG_EXTSIZE;
+            attr.fsx_extsize = file_opts->extent_size_hint;
+            result = ioctl(fd, FS_IOC_FSSETXATTR, &attr);
+        }
+        if (result < 0 && file_opts->has_extent_size_hint &&
+            file_opts->extent_size_hint)
+        {
+            warn_report("Failed to set extent size hint: %s",
+                        strerror(errno));
+        }
+    }
+#endif
 
     /* Resize and potentially preallocate the file to the desired
      * final size */
@@ -2410,6 +2440,8 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
 {
     BlockdevCreateOptions options;
     int64_t total_size = 0;
+    int64_t extent_size_hint = 0;
+    bool has_extent_size_hint = false;
     bool nocow = false;
     PreallocMode prealloc;
     char *buf = NULL;
@@ -2421,6 +2453,11 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
     /* Read out options */
     total_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0),
                           BDRV_SECTOR_SIZE);
+    if (qemu_opt_get(opts, BLOCK_OPT_EXTENT_SIZE_HINT)) {
+        has_extent_size_hint = true;
+        extent_size_hint =
+            qemu_opt_get_size_del(opts, BLOCK_OPT_EXTENT_SIZE_HINT, -1);
+    }
     nocow = qemu_opt_get_bool(opts, BLOCK_OPT_NOCOW, false);
     buf = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
     prealloc = qapi_enum_parse(&PreallocMode_lookup, buf,
@@ -2440,6 +2477,8 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
             .preallocation      = prealloc,
             .has_nocow          = true,
             .nocow              = nocow,
+            .has_extent_size_hint = has_extent_size_hint,
+            .extent_size_hint   = extent_size_hint,
         },
     };
     return raw_co_create(&options, errp);
@@ -2930,6 +2969,11 @@ static QemuOptsList raw_create_opts = {
 #endif
                     ", full)"
         },
+        {
+            .name = BLOCK_OPT_EXTENT_SIZE_HINT,
+            .type = QEMU_OPT_SIZE,
+            .help = "Extent size hint for the image file, 0 to disable"
+        },
         { /* end of list */ }
     }
 };
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 3d6cf88592..38dec0275b 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -53,6 +53,7 @@
 #define BLOCK_OPT_ADAPTER_TYPE      "adapter_type"
 #define BLOCK_OPT_REDUNDANCY        "redundancy"
 #define BLOCK_OPT_NOCOW             "nocow"
+#define BLOCK_OPT_EXTENT_SIZE_HINT  "extent_size_hint"
 #define BLOCK_OPT_OBJECT_SIZE       "object_size"
 #define BLOCK_OPT_REFCOUNT_BITS     "refcount_bits"
 #define BLOCK_OPT_DATA_FILE         "data_file"
diff --git a/qapi/block-core.json b/qapi/block-core.json
index b20332e592..463ffd83da 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4185,14 +4185,17 @@
 #                 falloc (if defined CONFIG_POSIX_FALLOCATE),
 #                 full (if defined CONFIG_POSIX))
 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
+# @extent-size-hint: Extent size hint to add to the image file; 0 for not
+#                    adding an extent size hint (default: 1 MB, since 5.1)
 #
 # Since: 2.12
 ##
 { 'struct': 'BlockdevCreateOptionsFile',
-  'data': { 'filename':         'str',
-            'size':             'size',
-            '*preallocation':   'PreallocMode',
-            '*nocow':           'bool' } }
+  'data': { 'filename':             'str',
+            'size':                 'size',
+            '*preallocation':       'PreallocMode',
+            '*nocow':               'bool',
+            '*extent-size-hint':    'size'} }
 
 ##
 # @BlockdevCreateOptionsGluster:
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index a4a2b69030..f7b3d54b28 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -62,6 +62,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -86,6 +87,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -110,6 +112,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -134,6 +137,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -158,6 +162,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -182,6 +187,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -206,6 +212,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -230,6 +237,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -353,6 +361,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -377,6 +386,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -401,6 +411,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -425,6 +436,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -449,6 +461,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -473,6 +486,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -497,6 +511,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -521,6 +536,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106
index b5d1ec4078..a20659d443 100755
--- a/tests/qemu-iotests/106
+++ b/tests/qemu-iotests/106
@@ -51,7 +51,10 @@ for create_mode in off falloc full; do
         echo
         echo "--- create_mode=$create_mode growth_mode=$growth_mode ---"
 
-        _make_test_img -o "preallocation=$create_mode" ${CREATION_SIZE}K
+        # Our calculation below assumes kilobytes as unit for the actual size.
+        # Disable the extent size hint because it would give us a result in
+        # megabytes.
+        _make_test_img -o "preallocation=$create_mode,extent_size_hint=0" ${CREATION_SIZE}K
         $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
 
         expected_size=0
@@ -98,7 +101,7 @@ for growth_mode in falloc full; do
     # plain int.  We should use the correct type for the result, and
     # this tests we do.
 
-    _make_test_img 2G
+    _make_test_img -o "extent_size_hint=0" 2G
     $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
 
     actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175
index 020ed8e61f..00a626aa63 100755
--- a/tests/qemu-iotests/175
+++ b/tests/qemu-iotests/175
@@ -89,20 +89,20 @@ min_blocks=$(stat -c '%b' "$TEST_DIR/empty")
 
 echo
 echo "== creating image with default preallocation =="
-_make_test_img $size | _filter_imgfmt
+_make_test_img -o extent_size_hint=0 $size | _filter_imgfmt
 stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $size
 
 for mode in off full falloc; do
     echo
     echo "== creating image with preallocation $mode =="
-    _make_test_img -o preallocation=$mode $size | _filter_imgfmt
+    _make_test_img -o preallocation=$mode,extent_size_hint=0 $size | _filter_imgfmt
     stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $size
 done
 
 for new_size in 4096 1048576; do
     echo
     echo "== resize empty image with block_resize =="
-    _make_test_img 0 | _filter_imgfmt
+    _make_test_img -o extent_size_hint=0 0 | _filter_imgfmt
     _block_resize $TEST_IMG $new_size >/dev/null
     stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $new_size
 done
diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243
index a61852f6d9..17388a4644 100755
--- a/tests/qemu-iotests/243
+++ b/tests/qemu-iotests/243
@@ -51,7 +51,7 @@ for mode in off metadata falloc full; do
     echo "=== preallocation=$mode ==="
     echo
 
-    _make_test_img -o "preallocation=$mode" 64M
+    _make_test_img -o "preallocation=$mode,extent_size_hint=0" 64M
 
     printf "File size: "
     du -b $TEST_IMG | cut -f1
@@ -68,7 +68,8 @@ for mode in off metadata falloc full; do
     echo "=== External data file: preallocation=$mode ==="
     echo
 
-    _make_test_img -o "data_file=$TEST_IMG.data,preallocation=$mode" 64M
+    _make_test_img \
+        -o "data_file=$TEST_IMG.data,preallocation=$mode,extent_size_hint=0" 64M
 
     echo -n "qcow2 file size: "
     du -b $TEST_IMG | cut -f1
@@ -79,7 +80,7 @@ for mode in off metadata falloc full; do
     echo -n "qcow2 disk usage: "
     [ $(du -B1 $TEST_IMG | cut -f1) -lt 1048576 ] && echo "low" || echo "high"
     echo -n "data disk usage:  "
-    [ $(du -B1 $TEST_IMG.data | cut -f1) -lt 1048576 ] && echo "low" || echo "high"
+    [ $(du -B1 $TEST_IMG.data | cut -f1) -lt 2097152 ] && echo "low" || echo "high"
 
 done
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14763.36570 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEs1-0003VW-P2; Thu, 29 Oct 2020 20:50:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14763.36570; Thu, 29 Oct 2020 20:50:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEs1-0003V8-Ln; Thu, 29 Oct 2020 20:50:05 +0000
Received: by outflank-mailman (input) for mailman id 14763;
 Thu, 29 Oct 2020 20:50:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEs1-0003Qi-5N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 90eed5fc-74be-4aa1-bb10-d7dbf4652b59;
 Thu, 29 Oct 2020 20:50:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErz-0006qy-Nn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYErz-0000nm-My
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEs1-0003Qi-5N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:05 +0000
X-Inumbo-ID: 90eed5fc-74be-4aa1-bb10-d7dbf4652b59
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 90eed5fc-74be-4aa1-bb10-d7dbf4652b59;
	Thu, 29 Oct 2020 20:50:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kDB294VJcSVMnKbnfFDxRHcSvdf5hijVXiscS7Qtcgw=; b=42lrYEJK+Jt3cJ3+0KMe6Phivo
	fUHE67ISbFA6mGkRDzPSvizPaYFvxz9ognOBfZsxUk3BCb7ZrdR8/Zle2M+joPqexkhSpXcs/ii/0
	1mpZIm5VpryJRgGJR5rj39MvYu09S+WdTG72XIm+AB3Qx6C+pQ6LuOAVPC+RszXu4k+k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErz-0006qy-Nn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYErz-0000nm-My
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-img: Flush stdout before before potential stderr messages
Message-Id: <E1kYErz-0000nm-My@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:03 +0000

commit 4e2f4418784da09cb106264340241856cd2846df
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:45 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qemu-img: Flush stdout before before potential stderr messages
    
    During 'qemu-img create ... 2>&1', if --quiet is not in force, we can
    end up with buffered I/O in stdout that was produced before failure,
    but which appears in output after failure.  This is confusing; the fix
    is to flush stdout prior to attempting anything that might produce an
    error message.  Several iotests demonstrate the resulting ordering
    change now that the merged outputs now reflect chronology.  (An even
    better fix would be to avoid printf from within block.c altogether,
    but that's much more invasive...)
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-2-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 1 +
 tests/qemu-iotests/049.out | 8 ++++----
 tests/qemu-iotests/054.out | 2 +-
 tests/qemu-iotests/079.out | 2 +-
 tests/qemu-iotests/112.out | 4 ++--
 tests/qemu-iotests/259.out | 2 +-
 tests/qemu-iotests/282.out | 6 +++---
 7 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/block.c b/block.c
index 3031413deb..98cad57cda 100644
--- a/block.c
+++ b/block.c
@@ -6164,6 +6164,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
         printf("Formatting '%s', fmt=%s ", filename, fmt);
         qemu_opts_print(opts, " ");
         puts("");
+        fflush(stdout);
     }
 
     ret = bdrv_create(drv, filename, opts, &local_err);
diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out
index e77966446b..4c21dc70a5 100644
--- a/tests/qemu-iotests/049.out
+++ b/tests/qemu-iotests/049.out
@@ -167,12 +167,12 @@ qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.42 lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
 
 qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=foobar lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
 
 == Check preallocation option ==
 
@@ -183,8 +183,8 @@ qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=metadata compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=1234 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
 
 == Check encryption option ==
 
@@ -206,7 +206,7 @@ qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=on refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
 
 *** done
diff --git a/tests/qemu-iotests/054.out b/tests/qemu-iotests/054.out
index e6ec430edd..71f18bb987 100644
--- a/tests/qemu-iotests/054.out
+++ b/tests/qemu-iotests/054.out
@@ -1,8 +1,8 @@
 QA output created by 054
 
 creating too large image (1 EB)
-qemu-img: TEST_DIR/t.IMGFMT: The image size is too large for file format 'IMGFMT' (try using a larger cluster size)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1152921504606846976
+qemu-img: TEST_DIR/t.IMGFMT: The image size is too large for file format 'IMGFMT' (try using a larger cluster size)
 
 creating too large image (1 EB) using qcow2.py
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296
diff --git a/tests/qemu-iotests/079.out b/tests/qemu-iotests/079.out
index aab922fb36..f65a9ca84f 100644
--- a/tests/qemu-iotests/079.out
+++ b/tests/qemu-iotests/079.out
@@ -9,6 +9,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadat
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
-qemu-img: TEST_DIR/t.IMGFMT: Cluster size must be a power of two between 512 and 2048k
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
+qemu-img: TEST_DIR/t.IMGFMT: Cluster size must be a power of two between 512 and 2048k
 *** done
diff --git a/tests/qemu-iotests/112.out b/tests/qemu-iotests/112.out
index 182655dbf6..dd3cc4383c 100644
--- a/tests/qemu-iotests/112.out
+++ b/tests/qemu-iotests/112.out
@@ -2,7 +2,6 @@ QA output created by 112
 
 === refcount_bits limits ===
 
-qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
@@ -10,6 +9,7 @@ qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not e
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 refcount bits: 1
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
@@ -21,10 +21,10 @@ refcount bits: 16
 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 refcount bits: 16
-qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 
 === Snapshot limit on refcount_bits=1 ===
 
diff --git a/tests/qemu-iotests/259.out b/tests/qemu-iotests/259.out
index ffed19c2a0..e27b9ff38d 100644
--- a/tests/qemu-iotests/259.out
+++ b/tests/qemu-iotests/259.out
@@ -9,6 +9,6 @@ virtual size: 64 MiB (67108864 bytes)
 disk size: unavailable
 
 --- Testing creation for which the node would need to grow ---
-qemu-img: TEST_DIR/t.IMGFMT: Could not resize image: Image format driver does not support resize
 Formatting 'TEST_DIR/t.IMGFMT', fmt=qcow2 size=67108864 preallocation=metadata
+qemu-img: TEST_DIR/t.IMGFMT: Could not resize image: Image format driver does not support resize
 *** done
diff --git a/tests/qemu-iotests/282.out b/tests/qemu-iotests/282.out
index 5d079dabce..67db7ab15a 100644
--- a/tests/qemu-iotests/282.out
+++ b/tests/qemu-iotests/282.out
@@ -1,11 +1,11 @@
 QA output created by 282
 == Create non-UTF8 secret ==
 == Throws an error because of invalid UTF-8 secret ==
-qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 Formatting 'vol.img', fmt=luks size=4194304 key-secret=sec0
+qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 == Image file should not exist after the error ==
 == Create a stub image file and run qemu-img again ==
-qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 Formatting 'vol.img', fmt=luks size=4194304 key-secret=sec0
+qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 == Pre-existing image file should also be deleted after the error ==
- *** done
+*** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14764.36573 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsC-0003kd-S6; Thu, 29 Oct 2020 20:50:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14764.36573; Thu, 29 Oct 2020 20:50:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsC-0003kV-P5; Thu, 29 Oct 2020 20:50:16 +0000
Received: by outflank-mailman (input) for mailman id 14764;
 Thu, 29 Oct 2020 20:50:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsB-0003kM-Ti
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8da2a662-bdff-414a-9bc8-5159aa2cfcc1;
 Thu, 29 Oct 2020 20:50:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEs9-0006r8-S0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEs9-0000oU-R3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsB-0003kM-Ti
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:15 +0000
X-Inumbo-ID: 8da2a662-bdff-414a-9bc8-5159aa2cfcc1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8da2a662-bdff-414a-9bc8-5159aa2cfcc1;
	Thu, 29 Oct 2020 20:50:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RC5TYMeiNmdmqR77Fk9WeQjUEee6GobzA06xAU4UYxY=; b=skMCCe596i+P6JU+TieB9WjPbR
	kMMD9A0Mrq6HOVYI/MHHsJGBVxdJsafgbErQLhW50ixeqd1qYLtu25m7KzJlDy1qsxJXpfz6dZV8K
	ehgFAHcDEa2ZZ4rXUkUsM/TRJjM3R7lwSPaNq5whyXAX8vJkDmuK2arHmX+0IPZsFlD0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEs9-0006r8-S0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEs9-0000oU-R3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Finish deprecation of 'qemu-img convert -n -o'
Message-Id: <E1kYEs9-0000oU-R3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:13 +0000

commit 25956af3fe5dd0385ad8017bc768a6afe41e2a74
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:46 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Finish deprecation of 'qemu-img convert -n -o'
    
    It's been two releases since we started warning; time to make the
    combination an error as promised.  There was no iotest coverage, so
    add some.
    
    While touching the documentation, tweak another section heading for
    consistent style.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-3-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 docs/system/deprecated.rst | 18 ++++++++----------
 qemu-img.c                 |  4 ++--
 tests/qemu-iotests/122     |  7 +++++++
 tests/qemu-iotests/122.out |  4 ++++
 4 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 58a9aeb851..aa9fdc8c53 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -427,14 +427,6 @@ kernel in 2018, and has also been dropped from glibc.
 Related binaries
 ----------------
 
-``qemu-img convert -n -o`` (since 4.2.0)
-''''''''''''''''''''''''''''''''''''''''
-
-All options specified in ``-o`` are image creation options, so
-they have no effect when used with ``-n`` to skip image creation.
-Silently ignored options can be confusing, so this combination of
-options will be made an error in future versions.
-
 Backwards compatibility
 -----------------------
 
@@ -540,8 +532,8 @@ spec you can use the ``-cpu rv64gcsu,priv_spec=v1.10.0`` command line argument.
 Related binaries
 ----------------
 
-``qemu-nbd --partition`` (removed in 5.0.0)
-'''''''''''''''''''''''''''''''''''''''''''
+``qemu-nbd --partition`` (removed in 5.0)
+'''''''''''''''''''''''''''''''''''''''''
 
 The ``qemu-nbd --partition $digit`` code (also spelled ``-P``)
 could only handle MBR partitions, and never correctly handled logical
@@ -557,6 +549,12 @@ can be rewritten as::
 
   qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2
 
+``qemu-img convert -n -o`` (removed in 5.1)
+'''''''''''''''''''''''''''''''''''''''''''
+
+All options specified in ``-o`` are image creation options, so
+they are now rejected when used with ``-n`` to skip image creation.
+
 Command line options
 --------------------
 
diff --git a/qemu-img.c b/qemu-img.c
index 4548dbff82..46d2796fb2 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2364,8 +2364,8 @@ static int img_convert(int argc, char **argv)
     }
 
     if (skip_create && options) {
-        warn_report("-o has no effect when skipping image creation");
-        warn_report("This will become an error in future QEMU versions.");
+        error_report("-o has no effect when skipping image creation");
+        goto fail_getopt;
     }
 
     if (s.has_zero_init && !skip_create) {
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index f7a3ae684a..2dc16b2ca4 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -290,6 +290,13 @@ TEST_IMG="$TEST_IMG".orig _make_test_img 64M
 # backing file"
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -n "$TEST_IMG" "$TEST_IMG".orig
 
+echo
+echo '=== -n incompatible with -o ==='
+echo
+
+$QEMU_IMG convert -O $IMGFMT -o preallocation=metadata -n \
+	  "$TEST_IMG" "$TEST_IMG".orig && echo "unexpected success"
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index 1a35951a80..c2e154a1e5 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -233,4 +233,8 @@ Images are identical.
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+
+=== -n incompatible with -o ===
+
+qemu-img: -o has no effect when skipping image creation
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14765.36577 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsL-0003ll-Tv; Thu, 29 Oct 2020 20:50:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14765.36577; Thu, 29 Oct 2020 20:50:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsL-0003ld-Qk; Thu, 29 Oct 2020 20:50:25 +0000
Received: by outflank-mailman (input) for mailman id 14765;
 Thu, 29 Oct 2020 20:50:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsK-0003lV-Pr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4765c821-02f2-4982-9bba-3a0f9f2ae005;
 Thu, 29 Oct 2020 20:50:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsJ-0006rM-VZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsJ-0000pJ-Um
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsK-0003lV-Pr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:24 +0000
X-Inumbo-ID: 4765c821-02f2-4982-9bba-3a0f9f2ae005
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4765c821-02f2-4982-9bba-3a0f9f2ae005;
	Thu, 29 Oct 2020 20:50:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Zr+fE6vhKS+mxPTLAQOwLqMQmUbI39C1vnJGYQnI2dQ=; b=Rp//cB8qReL3J60DHD2adR0Xc5
	ExC0YRZ88xS4/e7U5MD19vMHHBlvrpzXnfDKwQB1HhflmO4pciGufEWsM1YLTJ5BNsM554o53URVX
	lpYF2EYDMUQFvoi7A30uZMZp2rIADkhqZ2HayN1SVwEDOP2NhV6TVrKl55OHS4a+3KY8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsJ-0006rM-VZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsJ-0000pJ-Um
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] sheepdog: Add trivial backing_fmt support
Message-Id: <E1kYEsJ-0000pJ-Um@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:23 +0000

commit 80fa43e7df5d68d60a2662036b7d3d95ca8b68f3
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:47 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    sheepdog: Add trivial backing_fmt support
    
    Sheepdog already requires that if backing_file is present, that it be
    another sheepdog image (see sd_co_create).  Meanwhile, we want to move
    towards always being explicit about the backing format for other
    drivers where it matters.  So for convenience, make qemu-img create -F
    sheepdog work, while rejecting all other explicit formats (note that
    this is only for QemuOpts usage; there is no change to the QAPI to
    allow a format through -blockdev).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-4-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/sheepdog.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 6c487c8322..cbbebc1aaf 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2151,13 +2151,21 @@ static int coroutine_fn sd_co_create_opts(BlockDriver *drv,
                                           Error **errp)
 {
     BlockdevCreateOptions *create_options = NULL;
-    QDict *qdict, *location_qdict;
+    QDict *qdict = NULL, *location_qdict;
     Visitor *v;
-    char *redundancy;
+    char *redundancy = NULL;
     Error *local_err = NULL;
     int ret;
+    char *backing_fmt = NULL;
 
     redundancy = qemu_opt_get_del(opts, BLOCK_OPT_REDUNDANCY);
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+
+    if (backing_fmt && strcmp(backing_fmt, "sheepdog") != 0) {
+        error_setg(errp, "backing_file must be a sheepdog image");
+        ret = -EINVAL;
+        goto fail;
+    }
 
     qdict = qemu_opts_to_qdict(opts, NULL);
     qdict_put_str(qdict, "driver", "sheepdog");
@@ -2220,6 +2228,7 @@ fail:
     qapi_free_BlockdevCreateOptions(create_options);
     qobject_unref(qdict);
     g_free(redundancy);
+    g_free(backing_fmt);
     return ret;
 }
 
@@ -3177,6 +3186,11 @@ static QemuOptsList sd_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Must be 'sheepdog' if present",
+        },
         {
             .name = BLOCK_OPT_PREALLOC,
             .type = QEMU_OPT_STRING,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14766.36583 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsV-0003nH-Vz; Thu, 29 Oct 2020 20:50:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14766.36583; Thu, 29 Oct 2020 20:50:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsV-0003n8-SF; Thu, 29 Oct 2020 20:50:35 +0000
Received: by outflank-mailman (input) for mailman id 14766;
 Thu, 29 Oct 2020 20:50:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsU-0003mx-UO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a99d9fff-f1ef-4012-83a1-9a3f4c8bc789;
 Thu, 29 Oct 2020 20:50:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsU-0006rV-46
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsU-0000px-2K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsU-0003mx-UO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
X-Inumbo-ID: a99d9fff-f1ef-4012-83a1-9a3f4c8bc789
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a99d9fff-f1ef-4012-83a1-9a3f4c8bc789;
	Thu, 29 Oct 2020 20:50:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZC2IfvguM5ZkTclts57XjYQdFAYIIqLXAfIrzNe1DVE=; b=frk2PBFTQCqjCtJSyHSSt26E2O
	CAT0idNSEFhnba3jrm/Fofe42zd/SRvseDew7yZcwEpgeNkiMoYgUommTLfWoGiD+LCtiVaipS7Dp
	uqilWVnS83xP4J+gz0NFRt8bwcSThcTkIGeWtg6AqgB0bYynNAwahlKTGIZ7WoCD5ONc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsU-0006rV-46
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsU-0000px-2K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] vmdk: Add trivial backing_fmt support
Message-Id: <E1kYEsU-0000px-2K@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:34 +0000

commit d51a814cf41033d2d29b050e04d85155ac941221
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:48 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    vmdk: Add trivial backing_fmt support
    
    vmdk already requires that if backing_file is present, that it be
    another vmdk image (see vmdk_co_do_create).  Meanwhile, we want to
    move towards always being explicit about the backing format for other
    drivers where it matters.  So for convenience, make qemu-img create -F
    vmdk work, while rejecting all other explicit formats (note that this
    is only for QemuOpts usage; there is no change to the QAPI to allow a
    format through -blockdev).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-5-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vmdk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/block/vmdk.c b/block/vmdk.c
index 28cec50f38..bf9df5ce92 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2633,6 +2633,14 @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
     bool zeroed_grain;
     bool compat6;
     VMDKCreateOptsData data;
+    char *backing_fmt = NULL;
+
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+    if (backing_fmt && strcmp(backing_fmt, "vmdk") != 0) {
+        error_setg(errp, "backing_file must be a vmdk image");
+        ret = -EINVAL;
+        goto exit;
+    }
 
     if (filename_decompose(filename, path, prefix, postfix, PATH_MAX, errp)) {
         ret = -EINVAL;
@@ -2691,6 +2699,7 @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
                             vmdk_co_create_opts_cb, &data, errp);
 
 exit:
+    g_free(backing_fmt);
     g_free(adapter_type);
     g_free(backing_file);
     g_free(hw_version);
@@ -3026,6 +3035,11 @@ static QemuOptsList vmdk_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Must be 'vmdk' if present",
+        },
         {
             .name = BLOCK_OPT_COMPAT6,
             .type = QEMU_OPT_BOOL,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14767.36586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsh-0003oc-0q; Thu, 29 Oct 2020 20:50:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14767.36586; Thu, 29 Oct 2020 20:50:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsg-0003oU-U3; Thu, 29 Oct 2020 20:50:46 +0000
Received: by outflank-mailman (input) for mailman id 14767;
 Thu, 29 Oct 2020 20:50:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsf-0003oI-II
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3f6ecb22-55c1-4773-b3eb-fcbc84821ec5;
 Thu, 29 Oct 2020 20:50:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEse-0006rf-7a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEse-0000qj-6p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsf-0003oI-II
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:45 +0000
X-Inumbo-ID: 3f6ecb22-55c1-4773-b3eb-fcbc84821ec5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3f6ecb22-55c1-4773-b3eb-fcbc84821ec5;
	Thu, 29 Oct 2020 20:50:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wPP9B5hDU6pYj/1L0EhGXTGG7qYZjTz7Yqqv9ienKzg=; b=ioZA0lvn+UClYpOnnmMbRdOxXG
	twb/PQXHSg1tJH9kDfzRefmnLDk4Eertk4VZT2JQvVC0ypBtIoL7QaPGcUAZ8ouiOt6wHX/BYsj4C
	BL41JPz2CcBPtlvEiuiIygKfJJ6ORnqlfkJxU4n0Vwzxw+NxI2n+FOAn0pGC0ApOFEgo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEse-0006rf-7a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEse-0000qj-6p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow: Tolerate backing_fmt=
Message-Id: <E1kYEse-0000qj-6p@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:44 +0000

commit 344acbd62ffdbeb7f803644ad46a8129059f6823
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:49 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qcow: Tolerate backing_fmt=
    
    qcow has no space in the metadata to store a backing format, and there
    are existing qcow images backed both by raw or by other formats
    (usually qcow) images, reliant on probing to tell the difference.  On
    the bright side, because we probe every time, raw files are marked as
    probed and we thus forbid a commit action into the backing file where
    guest-controlled contents could change the result of the probe next
    time around (the iotest added here proves that).
    
    Still, allowing the user to specify the backing format during
    creation, even if we can't record it, is a good thing.  This patch
    blindly allows any value that resolves to a known driver, even if the
    user's request is a mismatch from what probing finds; then the next
    patch will further enhance things to verify that the user's request
    matches what we actually probe.  With this and the next patch in
    place, we will finally be ready to deprecate the creation of images
    where a backing format was not explicitly specified by the user.
    
    Note that this is only for QemuOpts usage; there is no change to the
    QAPI to allow a format through -blockdev.
    
    Add a new iotest 301 just for qcow, to demonstrate the latest
    behavior, and to make it easier to show the improvements made in the
    next patch.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-6-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow.c               | 20 ++++++++++-
 tests/qemu-iotests/301     | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/301.out | 60 +++++++++++++++++++++++++++++++
 tests/qemu-iotests/group   |  1 +
 4 files changed, 168 insertions(+), 1 deletion(-)

diff --git a/block/qcow.c b/block/qcow.c
index 1e134f3445..e514a86fe5 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -938,10 +938,11 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
 {
     BlockdevCreateOptions *create_options = NULL;
     BlockDriverState *bs = NULL;
-    QDict *qdict;
+    QDict *qdict = NULL;
     Visitor *v;
     const char *val;
     int ret;
+    char *backing_fmt;
 
     static const QDictRenames opt_renames[] = {
         { BLOCK_OPT_BACKING_FILE,       "backing-file" },
@@ -949,6 +950,17 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
         { NULL, NULL },
     };
 
+    /*
+     * We can't actually store a backing format, but can check that
+     * the user's request made sense.
+     */
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+    if (backing_fmt && !bdrv_find_format(backing_fmt)) {
+        error_setg(errp, "unrecognized backing format '%s'", backing_fmt);
+        ret = -EINVAL;
+        goto fail;
+    }
+
     /* Parse options and convert legacy syntax */
     qdict = qemu_opts_to_qdict_filtered(opts, NULL, &qcow_create_opts, true);
 
@@ -1012,6 +1024,7 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
 
     ret = 0;
 fail:
+    g_free(backing_fmt);
     qobject_unref(qdict);
     bdrv_unref(bs);
     qapi_free_BlockdevCreateOptions(create_options);
@@ -1146,6 +1159,11 @@ static QemuOptsList qcow_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Format of the backing image",
+        },
         {
             .name = BLOCK_OPT_ENCRYPT,
             .type = QEMU_OPT_BOOL,
diff --git a/tests/qemu-iotests/301 b/tests/qemu-iotests/301
new file mode 100755
index 0000000000..3823e95617
--- /dev/null
+++ b/tests/qemu-iotests/301
@@ -0,0 +1,88 @@
+#!/usr/bin/env bash
+#
+# Test qcow backing file warnings
+#
+# Copyright (C) 2020 Red Hat, 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+_cleanup()
+{
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.qcow2"
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt qcow
+_supported_proto file
+_supported_os Linux
+
+size=32M
+
+echo
+echo "== qcow backed by qcow =="
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $size
+_make_test_img -b "$TEST_IMG.base" $size
+_img_info
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
+_img_info
+
+echo
+echo "== mismatched command line detection =="
+
+_make_test_img -b "$TEST_IMG.base" -F vmdk
+_make_test_img -b "$TEST_IMG.base" -F vmdk $size
+echo
+# Use of -u bypasses the backing format sanity check
+_make_test_img -u -b "$TEST_IMG.base" -F vmdk
+_make_test_img -u -b "$TEST_IMG.base" -F vmdk $size
+echo
+# But the format must still be recognized
+_make_test_img -b "$TEST_IMG.base" -F garbage $size
+_make_test_img -u -b "$TEST_IMG.base" -F garbage $size
+_img_info
+
+echo
+echo "== qcow backed by raw =="
+
+rm "$TEST_IMG.base"
+truncate --size=$size "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" $size
+_img_info
+_make_test_img -b "$TEST_IMG.base" -F raw $size
+_img_info
+
+echo
+echo "== commit cannot change type of raw backing file =="
+TEST_IMG="$TEST_IMG.qcow2" IMGFMT=qcow2 _make_test_img $size
+truncate --size=$size "$TEST_IMG.qcow2"
+$QEMU_IMG convert -n -f raw -O $IMGFMT "$TEST_IMG.qcow2" "$TEST_IMG"
+$QEMU_IMG commit -f $IMGFMT "$TEST_IMG" && echo "unexpected success"
+TEST_IMG="$TEST_IMG.base" _img_info
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
new file mode 100644
index 0000000000..adaf11d42d
--- /dev/null
+++ b/tests/qemu-iotests/301.out
@@ -0,0 +1,60 @@
+QA output created by 301
+
+== qcow backed by qcow ==
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== mismatched command line detection ==
+qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
+Could not open backing image to determine size.
+qemu-img: warning: Could not verify backing image. This may become an error in future versions.
+invalid VMDK image descriptor
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+
+qemu-img: TEST_DIR/t.IMGFMT: Image creation needs a size parameter
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+
+qemu-img: warning: Could not verify backing image. This may become an error in future versions.
+Unknown driver 'garbage'
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
+qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
+qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== qcow backed by raw ==
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== commit cannot change type of raw backing file ==
+Formatting 'TEST_DIR/t.qcow.IMGFMT', fmt=IMGFMT size=33554432
+qemu-img: Block job failed: Operation not permitted
+image: TEST_DIR/t.IMGFMT.base
+file format: raw
+virtual size: 32 MiB (33554432 bytes)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 9b07a7ed03..a4f9e11e7a 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -306,3 +306,4 @@
 295 rw
 296 rw
 297 meta
+301 backing quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:50:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:50:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14768.36590 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsq-0003ph-2G; Thu, 29 Oct 2020 20:50:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14768.36590; Thu, 29 Oct 2020 20:50:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEsp-0003pZ-Vd; Thu, 29 Oct 2020 20:50:55 +0000
Received: by outflank-mailman (input) for mailman id 14768;
 Thu, 29 Oct 2020 20:50:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsp-0003pR-D6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6dcd80eb-9dc7-4b4a-be46-8b36cb882e45;
 Thu, 29 Oct 2020 20:50:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEso-0006rl-Bt
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEso-0000rV-Ah
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsp-0003pR-D6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:55 +0000
X-Inumbo-ID: 6dcd80eb-9dc7-4b4a-be46-8b36cb882e45
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6dcd80eb-9dc7-4b4a-be46-8b36cb882e45;
	Thu, 29 Oct 2020 20:50:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oWSvTsjAG4Z9zx583F2Vg36E/p6UAA64H7WRiDSTGR4=; b=m6tBhHPmM1uxdqbyQlA6jEfDyU
	/g88bSp+YaikYhsoN8AviBOJO3fcnQOwQJnUwxLJieuwo7JN7gjCUmMelN/WiHK1LSoh3ONZ++o61
	8CF0t4nLE2/to2Mn2ygeIKeS1SFV8aqXg2tPefY0iIUPowLJ5LJw6gzVnE4njjOZmPn8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEso-0006rl-Bt
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEso-0000rV-Ah
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:50:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Error if backing file fails during creation without -u
Message-Id: <E1kYEso-0000rV-Ah@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:50:54 +0000

commit add8200dd14041d059cc376eff91461fadd93ec5
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:50 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Error if backing file fails during creation without -u
    
    Back in commit 6e6e55f5 (Jul 2017, v2.10), we tweaked the code to warn
    if the backing file could not be opened but the user gave a size,
    unless the user also passes the -u option to bypass the open of the
    backing file.  As one common reason for failure to open the backing
    file is when there is mismatch in the requested backing format in
    relation to what the backing file actually contains, we actually want
    to open the backing file and ensure that it has the right format in as
    many cases as possible.  iotest 301 for qcow demonstrates how
    detecting explicit format mismatch is useful to prevent the creation
    of an image that would probe differently than the user requested.  Now
    is the time to finally turn the warning an error, as promised.
    
    Note that the original warning was added prior to our documentation of
    an official deprecation policy (eb22aeca, also Jul 2017), and because
    the warning didn't mention the word "deprecated", we never actually
    remembered to document it as such.  But the warning has been around
    long enough that I don't see prolonging it another two releases.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-7-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 12 ++----------
 docs/system/deprecated.rst | 12 ++++++++++++
 tests/qemu-iotests/111.out |  2 +-
 tests/qemu-iotests/301.out | 13 +++++--------
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/block.c b/block.c
index 98cad57cda..6925e57d7c 100644
--- a/block.c
+++ b/block.c
@@ -6128,16 +6128,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
         bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
                        &local_err);
         g_free(full_backing);
-        if (!bs && size != -1) {
-            /* Couldn't open BS, but we have a size, so it's nonfatal */
-            warn_reportf_err(local_err,
-                            "Could not verify backing image. "
-                            "This may become an error in future versions.\n");
-            local_err = NULL;
-        } else if (!bs) {
-            /* Couldn't open bs, do not have size */
-            error_append_hint(&local_err,
-                              "Could not open backing image to determine size.\n");
+        if (!bs) {
+            error_append_hint(&local_err, "Could not open backing image.\n");
             goto out;
         } else {
             if (size == -1) {
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index aa9fdc8c53..c014e049c3 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -555,6 +555,18 @@ can be rewritten as::
 All options specified in ``-o`` are image creation options, so
 they are now rejected when used with ``-n`` to skip image creation.
 
+
+``qemu-img create -b bad file $size`` (removed in 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+When creating an image with a backing file that could not be opened,
+``qemu-img create`` used to issue a warning about the failure but
+proceed with the image creation if an explicit size was provided.
+However, as the ``-u`` option exists for this purpose, it is safer to
+enforce that any failure to open the backing image (including if the
+backing file is missing or an incorrect format was specified) is an
+error when ``-u`` is not used.
+
 Command line options
 --------------------
 
diff --git a/tests/qemu-iotests/111.out b/tests/qemu-iotests/111.out
index 5279c462fc..ba034e5c58 100644
--- a/tests/qemu-iotests/111.out
+++ b/tests/qemu-iotests/111.out
@@ -1,4 +1,4 @@
 QA output created by 111
 qemu-img: TEST_DIR/t.IMGFMT: Could not open 'TEST_DIR/t.IMGFMT.inexistent': No such file or directory
-Could not open backing image to determine size.
+Could not open backing image.
 *** done
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
index adaf11d42d..281a16d87a 100644
--- a/tests/qemu-iotests/301.out
+++ b/tests/qemu-iotests/301.out
@@ -17,18 +17,15 @@ backing file: TEST_DIR/t.IMGFMT.base
 
 == mismatched command line detection ==
 qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
-Could not open backing image to determine size.
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-invalid VMDK image descriptor
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+Could not open backing image.
+qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
+Could not open backing image.
 
 qemu-img: TEST_DIR/t.IMGFMT: Image creation needs a size parameter
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
 
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-Unknown driver 'garbage'
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
-qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+qemu-img: TEST_DIR/t.IMGFMT: Unknown driver 'garbage'
+Could not open backing image.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
 qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
 image: TEST_DIR/t.IMGFMT
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14769.36594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEt1-0003rn-51; Thu, 29 Oct 2020 20:51:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14769.36594; Thu, 29 Oct 2020 20:51:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEt1-0003rf-29; Thu, 29 Oct 2020 20:51:07 +0000
Received: by outflank-mailman (input) for mailman id 14769;
 Thu, 29 Oct 2020 20:51:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEsz-0003rV-GK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2ed8ba2d-e2fc-4083-ad1a-a5000a5bab02;
 Thu, 29 Oct 2020 20:51:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsy-0006sm-Gc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEsy-0000sP-F3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEsz-0003rV-GK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:05 +0000
X-Inumbo-ID: 2ed8ba2d-e2fc-4083-ad1a-a5000a5bab02
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2ed8ba2d-e2fc-4083-ad1a-a5000a5bab02;
	Thu, 29 Oct 2020 20:51:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S5ESpPJzr77d5u+y1liH9vhobaUZynxWh//4iW9kgwQ=; b=kYfqOLaa2zYuBEr7CgxXgPUHus
	2MMkezZSy+PV9YhehTsQ4Co9rVYovIrPewNzSUSe4ggFh285ysLhbqDYVImMT4zlObpyecDum7POI
	R5qrKifhN8RIMhkKKvSlq1RzO5b+gWNomS4ZPSTGpHeL3gpbmpQuHsJrwK4i9m27kfh8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsy-0006sm-Gc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEsy-0000sP-F3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow2: Deprecate use of qemu-img amend to change backing file
Message-Id: <E1kYEsy-0000sP-F3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:04 +0000

commit bc5ee6da7122f6fe93ed07241a44315a331487e9
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:51 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qcow2: Deprecate use of qemu-img amend to change backing file
    
    The use of 'qemu-img amend' to change qcow2 backing files is not
    tested very well.  In particular, our implementation has a bug where
    if a new backing file is provided without a format, then the prior
    format is blindly reused, even if this results in data corruption, but
    this is not caught by iotests.
    
    There are also situations where amending other options needs access to
    the original backing file (for example, on a downgrade to a v2 image,
    knowing whether a v3 zero cluster must be allocated or may be left
    unallocated depends on knowing whether the backing file already reads
    as zero), but the command line does not have a nice way to tell us
    both the backing file to use for opening the image as well as the
    backing file to install after the operation is complete.
    
    Even if we do allow changing the backing file, it is redundant with
    the existing ability to change backing files via 'qemu-img rebase -u'.
    It is time to deprecate this support (leaving the existing behavior
    intact, even if it is buggy), and at a point in the future, require
    the use of only 'qemu-img rebase' for adjusting backing chain
    relations, saving 'qemu-img amend' for changes unrelated to the
    backing chain.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-8-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c              |  5 +++++
 docs/system/deprecated.rst | 12 ++++++++++++
 docs/tools/qemu-img.rst    |  4 ++++
 tests/qemu-iotests/061.out |  1 +
 tests/qemu-iotests/082.out |  2 ++
 5 files changed, 24 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index ea33673c55..f3fc2707cd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -5511,6 +5511,11 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     }
 
     if (backing_file || backing_format) {
+        if (g_strcmp0(backing_file, s->image_backing_file) ||
+            g_strcmp0(backing_format, s->image_backing_format)) {
+            warn_report("Deprecated use of amend to alter the backing file; "
+                        "use qemu-img rebase instead");
+        }
         ret = qcow2_change_backing_file(bs,
                     backing_file ?: s->image_backing_file,
                     backing_format ?: s->image_backing_format);
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index c014e049c3..c1f019b9d2 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -427,6 +427,18 @@ kernel in 2018, and has also been dropped from glibc.
 Related binaries
 ----------------
 
+qemu-img amend to adjust backing file (since 5.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''
+
+The use of ``qemu-img amend`` to modify the name or format of a qcow2
+backing image is deprecated; this functionality was never fully
+documented or tested, and interferes with other amend operations that
+need access to the original backing image (such as deciding whether a
+v3 zero cluster may be left unallocated when converting to a v2
+image).  Rather, any changes to the backing chain should be performed
+with ``qemu-img rebase -u`` either before or after the remaining
+changes being performed by amend, as appropriate.
+
 Backwards compatibility
 -----------------------
 
diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
index e33f5575e3..c35bd64822 100644
--- a/docs/tools/qemu-img.rst
+++ b/docs/tools/qemu-img.rst
@@ -258,6 +258,10 @@ Command description:
   Amends the image format specific *OPTIONS* for the image file
   *FILENAME*. Not all file formats support this operation.
 
+  The set of options that can be amended are dependent on the image
+  format, but note that amending the backing chain relationship should
+  instead be performed with ``qemu-img rebase``.
+
   --force allows some unsafe operations. Currently for -f luks, it allows to
   erase the last encryption key, and to overwrite an active encryption key.
 
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index b0f8befe30..44e3c624f9 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -370,6 +370,7 @@ wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index f7b3d54b28..a38a26fc57 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -783,10 +783,12 @@ Amend options for 'qcow2':
   size=<size>            - Virtual disk size
 
 Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 
 Testing: rebase -u -b  -f qcow2 TEST_DIR/t.qcow2
 
 Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 
 Testing: rebase -u -b  -f qcow2 TEST_DIR/t.qcow2
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14770.36598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtJ-0003t5-8v; Thu, 29 Oct 2020 20:51:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14770.36598; Thu, 29 Oct 2020 20:51:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtJ-0003sy-3o; Thu, 29 Oct 2020 20:51:25 +0000
Received: by outflank-mailman (input) for mailman id 14770;
 Thu, 29 Oct 2020 20:51:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEtI-0003st-2Q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 84b50f33-85e3-4c9e-b791-34008141e2a7;
 Thu, 29 Oct 2020 20:51:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEt8-0006su-Ob
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEt8-0000tK-NE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEtI-0003st-2Q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
X-Inumbo-ID: 84b50f33-85e3-4c9e-b791-34008141e2a7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 84b50f33-85e3-4c9e-b791-34008141e2a7;
	Thu, 29 Oct 2020 20:51:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=epMPXHYTDTeZ6N5tp1gA8F9oIuGLTadIL5GWCe+sJwM=; b=T+3XunqZOlvqfhdciOVK6ZALfv
	u8I+JIyPI9WJ/iWMbGLOV/y1f1ekERbTyC7vmldLV6NPtTldltfRB13iMo0foDFt/P2G82NhR6k7J
	M/PInFGbzm55liC1lwDs1H2HEc9d8gq5fhamSqkC1EsDJuehj8hg1WIKZlZ9592Hq1ZA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEt8-0006su-Ob
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEt8-0000tK-NE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Specify explicit backing format where sensible
Message-Id: <E1kYEt8-0000tK-NE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:14 +0000

commit b66ff2c29817f5efa18f5120fd6f089fbf59a933
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:52 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests: Specify explicit backing format where sensible
    
    There are many existing qcow2 images that specify a backing file but
    no format.  This has been the source of CVEs in the past, but has
    become more prominent of a problem now that libvirt has switched to
    -blockdev.  With older -drive, at least the probing was always done by
    qemu (so the only risk of a changed format between successive boots of
    a guest was if qemu was upgraded and probed differently).  But with
    newer -blockdev, libvirt must specify a format; if libvirt guesses raw
    where the image was formatted, this results in data corruption visible
    to the guest; conversely, if libvirt guesses qcow2 where qemu was
    using raw, this can result in potential security holes, so modern
    libvirt instead refuses to use images without explicit backing format.
    
    The change in libvirt to reject images without explicit backing format
    has pointed out that a number of tools have been far too reliant on
    probing in the past.  It's time to set a better example in our own
    iotests of properly setting this parameter.
    
    iotest calls to create, rebase, and convert are all impacted to some
    degree.  It's a bit annoying that we are inconsistent on command line
    - while all of those accept -o backing_file=...,backing_fmt=..., the
    shortcuts are different: create and rebase have -b and -F, while
    convert has -B but no -F.  (amend has no shortcuts, but the previous
    patch just deprecated the use of amend to change backing chains).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-9-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/017        |  2 +-
 tests/qemu-iotests/017.out    |  2 +-
 tests/qemu-iotests/018        |  2 +-
 tests/qemu-iotests/018.out    |  2 +-
 tests/qemu-iotests/019        |  5 +++--
 tests/qemu-iotests/019.out    |  2 +-
 tests/qemu-iotests/020        |  4 ++--
 tests/qemu-iotests/020.out    |  4 ++--
 tests/qemu-iotests/024        | 10 ++++-----
 tests/qemu-iotests/024.out    |  4 ++--
 tests/qemu-iotests/028        |  4 ++--
 tests/qemu-iotests/028.out    |  2 +-
 tests/qemu-iotests/030        | 26 +++++++++++++++++-------
 tests/qemu-iotests/034        |  2 +-
 tests/qemu-iotests/034.out    |  2 +-
 tests/qemu-iotests/037        |  2 +-
 tests/qemu-iotests/037.out    |  2 +-
 tests/qemu-iotests/038        |  2 +-
 tests/qemu-iotests/038.out    |  2 +-
 tests/qemu-iotests/039        |  3 ++-
 tests/qemu-iotests/039.out    |  2 +-
 tests/qemu-iotests/040        | 47 +++++++++++++++++++++++++++++++------------
 tests/qemu-iotests/041        | 37 +++++++++++++++++++++++-----------
 tests/qemu-iotests/042        |  4 ++--
 tests/qemu-iotests/043        | 23 +++++++++++----------
 tests/qemu-iotests/043.out    | 12 +++++------
 tests/qemu-iotests/046        |  2 +-
 tests/qemu-iotests/046.out    |  2 +-
 tests/qemu-iotests/050        |  4 ++--
 tests/qemu-iotests/050.out    |  2 +-
 tests/qemu-iotests/051        |  2 +-
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 tests/qemu-iotests/056        |  3 ++-
 tests/qemu-iotests/060        |  2 +-
 tests/qemu-iotests/060.out    |  2 +-
 tests/qemu-iotests/061        | 10 ++++-----
 tests/qemu-iotests/061.out    | 10 ++++-----
 tests/qemu-iotests/069        |  2 +-
 tests/qemu-iotests/069.out    |  2 +-
 tests/qemu-iotests/073        |  2 +-
 tests/qemu-iotests/073.out    |  2 +-
 tests/qemu-iotests/082        | 10 +++++----
 tests/qemu-iotests/082.out    | 12 +++++------
 tests/qemu-iotests/085        |  4 ++--
 tests/qemu-iotests/085.out    |  6 +++---
 tests/qemu-iotests/089        |  2 +-
 tests/qemu-iotests/089.out    |  2 +-
 tests/qemu-iotests/095        |  4 ++--
 tests/qemu-iotests/095.out    |  4 ++--
 tests/qemu-iotests/097        |  4 ++--
 tests/qemu-iotests/097.out    | 16 +++++++--------
 tests/qemu-iotests/098        |  2 +-
 tests/qemu-iotests/098.out    |  8 ++++----
 tests/qemu-iotests/110        |  4 ++--
 tests/qemu-iotests/110.out    |  4 ++--
 tests/qemu-iotests/122        | 27 +++++++++++++++----------
 tests/qemu-iotests/122.out    |  8 ++++----
 tests/qemu-iotests/126        |  4 ++--
 tests/qemu-iotests/126.out    |  4 ++--
 tests/qemu-iotests/127        |  4 ++--
 tests/qemu-iotests/127.out    |  4 ++--
 tests/qemu-iotests/129        |  3 ++-
 tests/qemu-iotests/133        |  2 +-
 tests/qemu-iotests/133.out    |  2 +-
 tests/qemu-iotests/139        |  2 +-
 tests/qemu-iotests/141        |  4 ++--
 tests/qemu-iotests/141.out    |  4 ++--
 tests/qemu-iotests/142        |  2 +-
 tests/qemu-iotests/142.out    |  2 +-
 tests/qemu-iotests/153        | 14 ++++++-------
 tests/qemu-iotests/153.out    | 35 +++++++++++++++++---------------
 tests/qemu-iotests/154        | 42 +++++++++++++++++++-------------------
 tests/qemu-iotests/154.out    | 42 +++++++++++++++++++-------------------
 tests/qemu-iotests/155        | 12 +++++++----
 tests/qemu-iotests/156        |  9 +++++----
 tests/qemu-iotests/156.out    |  6 +++---
 tests/qemu-iotests/158        |  2 +-
 tests/qemu-iotests/158.out    |  2 +-
 tests/qemu-iotests/161        |  8 ++++----
 tests/qemu-iotests/161.out    |  8 ++++----
 tests/qemu-iotests/176        |  4 ++--
 tests/qemu-iotests/176.out    | 32 ++++++++++++++---------------
 tests/qemu-iotests/177        |  2 +-
 tests/qemu-iotests/177.out    |  2 +-
 tests/qemu-iotests/179        |  2 +-
 tests/qemu-iotests/179.out    |  2 +-
 tests/qemu-iotests/189        |  2 +-
 tests/qemu-iotests/189.out    |  2 +-
 tests/qemu-iotests/191        | 12 +++++------
 tests/qemu-iotests/191.out    | 12 +++++------
 tests/qemu-iotests/195        |  6 +++---
 tests/qemu-iotests/195.out    |  6 +++---
 tests/qemu-iotests/198        |  2 +-
 tests/qemu-iotests/198.out    |  3 ++-
 tests/qemu-iotests/204        |  2 +-
 tests/qemu-iotests/204.out    |  2 +-
 tests/qemu-iotests/216        |  2 +-
 tests/qemu-iotests/224        |  4 ++--
 tests/qemu-iotests/225        |  2 +-
 tests/qemu-iotests/225.out    |  2 +-
 tests/qemu-iotests/228        |  5 +++--
 tests/qemu-iotests/245        |  3 ++-
 tests/qemu-iotests/249        |  4 ++--
 tests/qemu-iotests/249.out    |  4 ++--
 tests/qemu-iotests/252        |  2 +-
 tests/qemu-iotests/257        |  3 ++-
 tests/qemu-iotests/267        |  4 ++--
 tests/qemu-iotests/267.out    |  6 +++---
 tests/qemu-iotests/270        |  2 +-
 tests/qemu-iotests/270.out    |  2 +-
 tests/qemu-iotests/273        |  4 ++--
 tests/qemu-iotests/273.out    |  4 ++--
 tests/qemu-iotests/274        | 12 +++++------
 tests/qemu-iotests/274.out    | 29 ++++++++++++++------------
 tests/qemu-iotests/279        |  4 ++--
 tests/qemu-iotests/279.out    |  4 ++--
 tests/qemu-iotests/290        |  2 +-
 tests/qemu-iotests/290.out    |  4 ++--
 119 files changed, 434 insertions(+), 361 deletions(-)

diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 0a4b854e65..585512bb29 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG=$TEST_IMG_SAVE
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
diff --git a/tests/qemu-iotests/017.out b/tests/qemu-iotests/017.out
index 8fc9241942..f439d3ece3 100644
--- a/tests/qemu-iotests/017.out
+++ b/tests/qemu-iotests/017.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
index c69ce09209..191b461a4d 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE.orig"
-_make_test_img -b "$TEST_IMG_SAVE.base" 6G
+_make_test_img -b "$TEST_IMG_SAVE.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
diff --git a/tests/qemu-iotests/018.out b/tests/qemu-iotests/018.out
index 5df966727f..0ab664ca4b 100644
--- a/tests/qemu-iotests/018.out
+++ b/tests/qemu-iotests/018.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index 813a84acac..d3c11256dc 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -74,7 +74,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE.orig"
-_make_test_img -b "$TEST_IMG_SAVE.base" 6G
+_make_test_img -b "$TEST_IMG_SAVE.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
@@ -98,7 +98,8 @@ for backing_option in "-B " "-o backing_file="; do
     echo
     echo Testing conversion with $backing_option"$TEST_IMG.base" | _filter_testdir | _filter_imgfmt
     echo
-    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG"
+    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT $backing_option"$TEST_IMG.base" \
+        -o backing_fmt=$IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
 
     echo "Checking if backing clusters are allocated when they shouldn't"
     echo
diff --git a/tests/qemu-iotests/019.out b/tests/qemu-iotests/019.out
index 17a7c036b9..0fa73bd69a 100644
--- a/tests/qemu-iotests/019.out
+++ b/tests/qemu-iotests/019.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4296015872
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 43
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index b488000cb9..a0782937b0 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -70,7 +70,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE"
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
@@ -131,7 +131,7 @@ backing="json:{'driver': '$IMGFMT',
 # Filter out newlines and collapse spaces
 backing=$(echo "$backing" | tr -d '\n' | tr -s ' ')
 
-_make_test_img -b "$backing"
+_make_test_img -b "$backing" -F $IMGFMT
 
 # Just write anything so committing will not be a no-op
 $QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out
index 4668ac59df..5936bc1cae 100644
--- a/tests/qemu-iotests/020.out
+++ b/tests/qemu-iotests/020.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
@@ -1079,7 +1079,7 @@ No errors were found on the image.
 Testing failing commit
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}}
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}} backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Block job failed: No space left on device
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
index e2e766241e..12aceb2d41 100755
--- a/tests/qemu-iotests/024
+++ b/tests/qemu-iotests/024
@@ -83,7 +83,7 @@ TEST_IMG="$TEST_IMG_SAVE"
 echo "Creating COW image"
 echo
 
-_make_test_img -b "$TEST_IMG.base_old" 1G
+_make_test_img -b "$TEST_IMG.base_old" -F $IMGFMT 1G
 io_pattern writev 0 $((4 * CLUSTER_SIZE)) 0 1 0x33
 io_pattern writev $((8 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 0 1 0x33
 
@@ -109,7 +109,7 @@ io_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00
 echo
 echo Rebase and test again
 echo
-$QEMU_IMG rebase -b "$TEST_IMG.base_new" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.base_new" -F $IMGFMT "$TEST_IMG"
 io_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
 io_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
 io_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
@@ -159,7 +159,7 @@ OVERLAY="$TEST_DIR/$OVERLAY_WREL"
 
 TEST_IMG=$BASE_OLD _make_test_img 1M
 TEST_IMG=$BASE_NEW _make_test_img 1M
-TEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD_OREL" 1M
+TEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD_OREL" -F $IMGFMT 1M
 
 echo
 
@@ -176,11 +176,11 @@ $QEMU_IO "$BASE_NEW" \
 echo
 
 pushd "$TEST_DIR" >/dev/null
-$QEMU_IMG rebase -f "$IMGFMT" -b "$BASE_NEW_OREL" "$OVERLAY_WREL"
+$QEMU_IMG rebase -f "$IMGFMT" -b "$BASE_NEW_OREL" -F $IMGFMT "$OVERLAY_WREL"
 popd >/dev/null
 
 # Verify the backing path is correct
-TEST_IMG=$OVERLAY _img_info | grep '^backing file'
+TEST_IMG=$OVERLAY _img_info | grep '^backing file:'
 
 echo
 
diff --git a/tests/qemu-iotests/024.out b/tests/qemu-iotests/024.out
index 024dc786b3..973a5a3711 100644
--- a/tests/qemu-iotests/024.out
+++ b/tests/qemu-iotests/024.out
@@ -33,7 +33,7 @@ wrote 131072/131072 bytes at offset 786432
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Creating COW image
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base_old
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base_old backing_fmt=IMGFMT
 === IO: pattern 0x33
 wrote 262144/262144 bytes at offset 0
 256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -146,7 +146,7 @@ read 65536/65536 bytes at offset 983040
 
 Formatting 'TEST_DIR/subdir/t.IMGFMT.base_old', fmt=IMGFMT size=1048576
 Formatting 'TEST_DIR/subdir/t.IMGFMT.base_new', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/subdir/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=t.IMGFMT.base_old
+Formatting 'TEST_DIR/subdir/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=t.IMGFMT.base_old backing_fmt=IMGFMT
 
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 797dae5350..5d043cef92 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -76,7 +76,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE"
-_make_test_img -b "$TEST_IMG.base" $image_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
 
 echo "Filling test image"
 echo
@@ -101,7 +101,7 @@ io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 _check_test_img
 
 # Rebase it on top of its base image
-$QEMU_IMG rebase -b "$TEST_IMG.base" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.base" -F $IMGFMT "$TEST_IMG"
 
 echo
 echo block-backup
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 37aed84436..12f82c6a6c 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -70,7 +70,7 @@ wrote 512/512 bytes at offset 3221225984
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 196
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 1cdd7e2999..256b2bfbc6 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -32,8 +32,12 @@ class TestSingleDrive(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestSingleDrive.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img)
         self.vm = iotests.VM().add_drive("blkdebug::" + test_img,
@@ -199,7 +203,8 @@ class TestParallelOps(iotests.QMPTestCase):
         iotests.create_image(self.imgs[0], self.image_len)
         for i in range(1, self.num_imgs):
             qemu_img('create', '-f', iotests.imgfmt,
-                     '-o', 'backing_file=%s' % self.imgs[i-1], self.imgs[i])
+                     '-o', 'backing_file=%s' % self.imgs[i-1],
+                     '-F', 'raw' if i == 1 else iotests.imgfmt, self.imgs[i])
 
         # Put data into the images we are copying data from
         odd_img_indexes = [x for x in reversed(range(self.num_imgs)) if x % 2 == 1]
@@ -544,7 +549,8 @@ class TestQuorum(iotests.QMPTestCase):
             qemu_io('-f', iotests.imgfmt,
                     '-c', 'write -P 0x55 0 1024', backing_img)
             qemu_img('create', '-f', iotests.imgfmt,
-                     '-o', 'backing_file=%s' % backing_img, child_img)
+                     '-o', 'backing_file=%s' % backing_img,
+                     '-F', iotests.imgfmt, child_img)
             opts.append("children.%d.file.filename=%s" % (i, child_img))
             opts.append("children.%d.node-name=node%d" % (i, i))
 
@@ -585,7 +591,9 @@ class TestSmallerBackingFile(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.backing_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img, str(self.image_len))
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img, str(self.image_len))
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
@@ -848,7 +856,9 @@ class TestStreamStop(iotests.QMPTestCase):
     def setUp(self):
         qemu_img('create', backing_img, str(TestStreamStop.image_len))
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive("blkdebug::" + test_img)
         self.vm.launch()
@@ -879,7 +889,9 @@ class TestSetSpeed(iotests.QMPTestCase):
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
         self.vm.launch()
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
index da4cea1571..ac2d687c71 100755
--- a/tests/qemu-iotests/034
+++ b/tests/qemu-iotests/034
@@ -58,7 +58,7 @@ $QEMU_IO -c "write -P 0x55 0 1M" "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== zero write with backing file =="
diff --git a/tests/qemu-iotests/034.out b/tests/qemu-iotests/034.out
index 0764ead8b9..478205ad25 100644
--- a/tests/qemu-iotests/034.out
+++ b/tests/qemu-iotests/034.out
@@ -4,7 +4,7 @@ QA output created by 034
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == zero write with backing file ==
 wrote 196608/196608 bytes at offset 65536
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
index e6517acbd4..e1187ac24a 100755
--- a/tests/qemu-iotests/037
+++ b/tests/qemu-iotests/037
@@ -74,7 +74,7 @@ backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== COW in a single cluster =="
diff --git a/tests/qemu-iotests/037.out b/tests/qemu-iotests/037.out
index cd6710c901..30ef989b64 100644
--- a/tests/qemu-iotests/037.out
+++ b/tests/qemu-iotests/037.out
@@ -514,7 +514,7 @@ wrote 512/512 bytes at offset 130048
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 130560
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == COW in a single cluster ==
 wrote 2048/2048 bytes at offset 0
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
index 707e2d72e9..a253231f5b 100755
--- a/tests/qemu-iotests/038
+++ b/tests/qemu-iotests/038
@@ -71,7 +71,7 @@ backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== Some concurrent requests touching the same cluster =="
diff --git a/tests/qemu-iotests/038.out b/tests/qemu-iotests/038.out
index 0bdfb19faa..fe2108593a 100644
--- a/tests/qemu-iotests/038.out
+++ b/tests/qemu-iotests/038.out
@@ -514,7 +514,7 @@ wrote 65536/65536 bytes at offset 16646144
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 16711680
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Some concurrent requests touching the same cluster ==
 wrote 65536/65536 bytes at offset XXX
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index ddce48ab47..42f6503138 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -133,7 +133,8 @@ echo "== Committing to a backing file with lazy_refcounts=on =="
 
 TEST_IMG="$TEST_IMG".base _make_test_img -o "compat=1.1,lazy_refcounts=on" $size
 
-_make_test_img -o "compat=1.1,lazy_refcounts=on,backing_file=$TEST_IMG.base" $size
+_make_test_img -o "compat=1.1,lazy_refcounts=on,backing_file=$TEST_IMG.base" \
+    -F $IMGFMT $size
 
 $QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG commit "$TEST_IMG"
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index bdafa3ace3..e52484d4be 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -66,7 +66,7 @@ No errors were found on the image.
 
 == Committing to a backing file with lazy_refcounts=on ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Image committed.
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 32c82b4ec6..f58f50d023 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -80,8 +80,11 @@ class TestSingleDrive(ImageCommitTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
         self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none")
@@ -305,10 +308,16 @@ class TestRelativePaths(ImageCommitTestCase):
             if exception.errno != errno.EEXIST:
                 raise
         iotests.create_image(self.backing_img_abs, TestRelativePaths.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.backing_img_abs, self.mid_img_abs)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.mid_img_abs, self.test_img)
-        qemu_img('rebase', '-u', '-b', self.backing_img, self.mid_img_abs)
-        qemu_img('rebase', '-u', '-b', self.mid_img, self.test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.backing_img_abs,
+                 '-F', 'raw', self.mid_img_abs)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.mid_img_abs,
+                 '-F', iotests.imgfmt, self.test_img)
+        qemu_img('rebase', '-u', '-b', self.backing_img,
+                 '-F', 'raw', self.mid_img_abs)
+        qemu_img('rebase', '-u', '-b', self.mid_img,
+                 '-F', iotests.imgfmt, self.test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', self.backing_img_abs)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', self.mid_img_abs)
         self.vm = iotests.VM().add_drive(self.test_img)
@@ -371,8 +380,11 @@ class TestSetSpeed(ImageCommitTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 0 512', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
         self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
@@ -410,9 +422,14 @@ class TestReopenOverlay(ImageCommitTestCase):
 
     def setUp(self):
         iotests.create_image(self.img0, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img0, self.img1)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img1, self.img2)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img2, self.img3)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img0, '-F', 'raw', self.img1)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img1,
+                 '-F', iotests.imgfmt, self.img2)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img2,
+                 '-F', iotests.imgfmt, self.img3)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xab 0 128K', self.img1)
         self.vm = iotests.VM().add_drive(self.img3)
         self.vm.launch()
@@ -435,8 +452,12 @@ class TestErrorHandling(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
 
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x11 0 512k', mid_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x22 0 512k', test_img)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index b843f88a66..f0a7bf6650 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -44,7 +44,8 @@ class TestSingleDrive(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=base")
         if iotests.qemu_default_machine == 'pc':
             self.vm.add_drive(None, 'media=cdrom', 'ide')
@@ -157,7 +158,8 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'cluster_size=%d,backing_file=%s'
-                        % (self.image_len, backing_img), target_img)
+                        % (self.image_len, backing_img),
+                 '-F', 'raw', target_img)
         result = self.vm.qmp(self.qmp_cmd, device='drive0', sync='full',
                              mode='existing', target=self.qmp_target)
         self.assert_qmp(result, 'return', {})
@@ -227,7 +229,8 @@ class TestSingleBlockdev(TestSingleDrive):
 
     def setUp(self):
         TestSingleDrive.setUp(self)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         args = {'driver': iotests.imgfmt,
                 'node-name': self.qmp_target,
                 'file': { 'filename': target_img, 'driver': 'file' } }
@@ -312,7 +315,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestMirrorNoBacking.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
@@ -329,7 +333,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
     def test_complete(self):
         self.assert_no_active_block_jobs()
 
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
         self.assert_qmp(result, 'return', {})
@@ -344,7 +349,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
     def test_cancel(self):
         self.assert_no_active_block_jobs()
 
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
         self.assert_qmp(result, 'return', {})
@@ -363,7 +369,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'size=%d'
                         %(TestMirrorNoBacking.image_len), target_backing_img)
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'cluster_size=%d,backing_file=%s'
-                        % (TestMirrorNoBacking.image_len, target_backing_img), target_img)
+                        % (TestMirrorNoBacking.image_len, target_backing_img),
+                 '-F', iotests.imgfmt, target_img)
 
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
@@ -382,7 +389,8 @@ class TestMirrorResized(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestMirrorResized.backing_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         qemu_img('resize', test_img, '2M')
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
@@ -528,7 +536,9 @@ new_state = "1"
         # Test COW into the target image.  The first half of the
         # cluster at MIRROR_GRANULARITY has to be copied from
         # backing_img, even though sync='top'.
-        qemu_img('create', '-f', iotests.imgfmt, '-ocluster_size=131072,backing_file=%s' %(backing_img), target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-ocluster_size=131072,backing_file=%s' %(backing_img),
+                 '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='top',
                              on_source_error='ignore',
                              mode='existing', target=target_img)
@@ -548,7 +558,8 @@ new_state = "1"
         self.vm.shutdown()
 
         # Detach blkdebug to compare images successfully
-        qemu_img('rebase', '-f', iotests.imgfmt, '-u', '-b', backing_img, test_img)
+        qemu_img('rebase', '-f', iotests.imgfmt, '-u', '-b', backing_img,
+                 '-F', 'raw', test_img)
         self.assertTrue(iotests.compare_images(test_img, target_img),
                         'target image does not match source after mirroring')
 
@@ -620,7 +631,8 @@ new_state = "1"
         self.blkdebug_file = target_img + ".blkdebug"
         iotests.create_image(backing_img, TestWriteErrors.image_len)
         self.create_blkdebug_file(self.blkdebug_file, "write_aio", 5)
-        qemu_img('create', '-f', iotests.imgfmt, '-obacking_file=%s' %(backing_img), test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-obacking_file=%s' %(backing_img), '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.target_img = 'blkdebug:%s:%s' % (self.blkdebug_file, target_img)
         qemu_img('create', '-f', iotests.imgfmt, '-osize=%d' %(TestWriteErrors.image_len), target_img)
@@ -715,7 +727,8 @@ class TestSetSpeed(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
index 0e85b356b7..e8f23a174c 100755
--- a/tests/qemu-iotests/042
+++ b/tests/qemu-iotests/042
@@ -64,8 +64,8 @@ _check_test_img
 echo
 echo "== Rebasing the image =="
 
-$QEMU_IMG rebase -u -b "$TEST_IMG.orig" "$TEST_IMG"
-$QEMU_IMG rebase -b "$TEST_IMG.orig" "$TEST_IMG"
+$QEMU_IMG rebase -u -b "$TEST_IMG.orig" -F $IMGFMT "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.orig" -F $IMGFMT "$TEST_IMG"
 _check_test_img
 
 # success, all done
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index b102e49208..3271737f69 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -46,7 +46,7 @@ _supported_proto file
 
 size=128M
 _make_test_img $size
-$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG"
+$QEMU_IMG rebase -u -b "$TEST_IMG" -F $IMGFMT "$TEST_IMG"
 
 echo
 echo "== backing file references self =="
@@ -54,8 +54,8 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.base" $size
-$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
+$QEMU_IMG rebase -u -b "$TEST_IMG" -F $IMGFMT "$TEST_IMG.base"
 
 echo
 echo "== parent references self =="
@@ -63,12 +63,12 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
+_make_test_img -b "$TEST_IMG.1.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.2.base"
-_make_test_img -b "$TEST_IMG.2.base" $size
+_make_test_img -b "$TEST_IMG.2.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.3.base"
-_make_test_img -b "$TEST_IMG.3.base" $size
-$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" "$TEST_IMG.1.base"
+_make_test_img -b "$TEST_IMG.3.base" -F $IMGFMT $size
+$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" -F $IMGFMT "$TEST_IMG.1.base"
 
 echo
 echo "== ancestor references another ancestor =="
@@ -76,17 +76,18 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
+_make_test_img -b "$TEST_IMG.1.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.2.base"
-_make_test_img -b "$TEST_IMG.2.base" $size
+_make_test_img -b "$TEST_IMG.2.base" -F $IMGFMT $size
 
 echo
 echo "== finite chain of length 3 (human) =="
-_img_info --backing-chain
+# Exclude backing format, since qed differs from qcow2 on what gets stored
+_img_info --backing-chain | grep -v '^backing file format:'
 
 echo
 echo "== finite chain of length 3 (json) =="
-_img_info --backing-chain --output=json
+_img_info --backing-chain --output=json | grep -v 'backing-filename-format'
 
 # success, all done
 echo "*** done"
diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
index 0280f999ce..63ecb21816 100644
--- a/tests/qemu-iotests/043.out
+++ b/tests/qemu-iotests/043.out
@@ -4,20 +4,20 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 == backing file references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == parent references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.3.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.3.base backing_fmt=IMGFMT
 
 == ancestor references another ancestor ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT.2.base' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base backing_fmt=IMGFMT
 
 == finite chain of length 3 (human) ==
 image: TEST_DIR/t.IMGFMT
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
index ecbe5fc0f4..88b3363c19 100755
--- a/tests/qemu-iotests/046
+++ b/tests/qemu-iotests/046
@@ -69,7 +69,7 @@ backing_io 0 32 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 mv "$TEST_IMG" "$TEST_IMG.base"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== Some concurrent requests touching the same cluster =="
diff --git a/tests/qemu-iotests/046.out b/tests/qemu-iotests/046.out
index 70783041e2..b022bcddd5 100644
--- a/tests/qemu-iotests/046.out
+++ b/tests/qemu-iotests/046.out
@@ -66,7 +66,7 @@ wrote 65536/65536 bytes at offset 1966080
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 2031616
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Some concurrent requests touching the same cluster ==
 blkdebug: Suspended request 'A'
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
index cdc5356541..4b0a390c43 100755
--- a/tests/qemu-iotests/050
+++ b/tests/qemu-iotests/050
@@ -58,13 +58,13 @@ $QEMU_IO -c "write -P 0x5a 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.old" $size
+_make_test_img -b "$TEST_IMG.old" -F $IMGFMT $size
 $QEMU_IO -c "write -z 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 echo
 echo "== Rebasing the image =="
 
-$QEMU_IMG rebase -b "$TEST_IMG.new" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.new" -F $IMGFMT "$TEST_IMG"
 $QEMU_IO -c "read -P 0x00 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 # success, all done
diff --git a/tests/qemu-iotests/050.out b/tests/qemu-iotests/050.out
index 3602d580dc..ab3daeddca 100644
--- a/tests/qemu-iotests/050.out
+++ b/tests/qemu-iotests/050.out
@@ -7,7 +7,7 @@ wrote 1048576/1048576 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.new', fmt=IMGFMT size=10485760
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 backing_file=TEST_DIR/t.IMGFMT.old
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 backing_file=TEST_DIR/t.IMGFMT.old backing_fmt=IMGFMT
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 034d3a3250..bee26075b2 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -70,7 +70,7 @@ device_id="drive0"
 _make_test_img $size
 cp "$TEST_IMG" "$TEST_IMG.orig"
 mv "$TEST_IMG" "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.base" $size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
 
 echo
 echo === Unknown option ===
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 554c5ca90a..de4771bcb3 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -1,6 +1,6 @@
 QA output created by 051
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Unknown option ===
 
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index da8ad87187..f707471fb0 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -1,6 +1,6 @@
 QA output created by 051
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Unknown option ===
 
diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056
index f73fc74457..052456aa00 100755
--- a/tests/qemu-iotests/056
+++ b/tests/qemu-iotests/056
@@ -54,7 +54,8 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
 
     def setUp(self):
         create_image(backing_img, TestSyncModesNoneAndTop.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         qemu_io('-c', 'write -P0x41 0 512', test_img)
         qemu_io('-c', 'write -P0xd5 1M 32k', test_img)
         qemu_io('-c', 'write -P0xdc 32M 124k', test_img)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 32c0ecce9e..94c0d5accc 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -160,7 +160,7 @@ TEST_IMG=$BACKING_IMG _make_test_img 1G
 
 $QEMU_IO -c 'write 0k 64k' "$BACKING_IMG" | _filter_qemu_io
 
-_make_test_img -b "$BACKING_IMG" 1G
+_make_test_img -b "$BACKING_IMG" -F $IMGFMT 1G
 # Write two clusters, the second one enforces creation of an L2 table after
 # the first data cluster.
 $QEMU_IO -c 'write 0k 64k' -c 'write 512M 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index be5f8707a3..e574c38797 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -101,7 +101,7 @@ read 512/512 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1073741824
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 536870912
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index 10eb243164..08ddbdd10c 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -224,7 +224,7 @@ echo "=== Testing zero expansion on backed image ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "read -P 0x2a 0 128k" -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
 _check_test_img
@@ -235,7 +235,7 @@ echo "=== Testing zero expansion on backed inactive clusters ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IO -c "write -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io
@@ -251,7 +251,7 @@ echo "=== Testing zero expansion on backed image with shared L2 table ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
@@ -274,7 +274,7 @@ echo
 echo "=== Testing progress report without snapshot ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 4G
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 4G
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 4G
 $QEMU_IO -c "write -z 0  64k" \
          -c "write -z 1G 64k" \
          -c "write -z 2G 64k" \
@@ -286,7 +286,7 @@ echo
 echo "=== Testing progress report with snapshot ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 4G
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 4G
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 4G
 $QEMU_IO -c "write -z 0  64k" \
          -c "write -z 1G 64k" \
          -c "write -z 2G 64k" \
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index 44e3c624f9..b2d2dfed04 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -428,7 +428,7 @@ read 131072/131072 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 0
@@ -444,7 +444,7 @@ read 65536/65536 bytes at offset 65536
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 0
@@ -463,7 +463,7 @@ read 65536/65536 bytes at offset 65536
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
@@ -487,7 +487,7 @@ read 67108864/67108864 bytes at offset 0
 === Testing progress report without snapshot ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=4294967296
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 1073741824
@@ -502,7 +502,7 @@ No errors were found on the image.
 === Testing progress report with snapshot ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=4294967296
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 1073741824
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index b997b127f0..a4da83b2d9 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -46,7 +46,7 @@ echo
 echo "=== Creating an image with a backing file and deleting that file ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE
-_make_test_img -b "$TEST_IMG.base" $IMG_SIZE
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $IMG_SIZE
 _rm_test_img "$TEST_IMG.base"
 # Just open the image and close it right again (this should print an error message)
 $QEMU_IO -c quit "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
diff --git a/tests/qemu-iotests/069.out b/tests/qemu-iotests/069.out
index c78e8c2b72..126b4d2d51 100644
--- a/tests/qemu-iotests/069.out
+++ b/tests/qemu-iotests/069.out
@@ -3,6 +3,6 @@ QA output created by 069
 === Creating an image with a backing file and deleting that file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=131072
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 qemu-io: can't open device TEST_DIR/t.IMGFMT: Could not open backing file: Could not open 'TEST_DIR/t.IMGFMT.base': No such file or directory
 *** done
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 23a1bdf890..1dce478709 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -52,7 +52,7 @@ echo "== creating backing file =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 0xa5 0 $size" "$TEST_IMG.base" | _filter_qemu_io
 
 echo
diff --git a/tests/qemu-iotests/073.out b/tests/qemu-iotests/073.out
index de5452492c..7a718b525e 100644
--- a/tests/qemu-iotests/073.out
+++ b/tests/qemu-iotests/073.out
@@ -2,7 +2,7 @@ QA output created by 073
 
 == creating backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
index 1998965ed4..2135581867 100755
--- a/tests/qemu-iotests/082
+++ b/tests/qemu-iotests/082
@@ -84,8 +84,10 @@ run_qemu_img create -f $IMGFMT -o cluster_size=4k -o help "$TEST_IMG" $size
 run_qemu_img create -f $IMGFMT -o cluster_size=4k -o \? "$TEST_IMG" $size
 
 # Looks like a help option, but is part of the backing file name
-run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,help "$TEST_IMG" $size
-run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,\? "$TEST_IMG" $size
+run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,help \
+    -F $IMGFMT "$TEST_IMG" $size
+run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,\? \
+    -F $IMGFMT "$TEST_IMG" $size
 
 # Try to trick qemu-img into creating escaped commas
 run_qemu_img create -f $IMGFMT -o backing_file="$TEST_IMG", -o help "$TEST_IMG" $size
@@ -141,8 +143,8 @@ run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o help "$TEST_IMG" "$TEST_IM
 run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o \? "$TEST_IMG" "$TEST_IMG".base
 
 # Looks like a help option, but is part of the backing file name
-run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG",,help "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG",,\? "$TEST_IMG" "$TEST_IMG".base
+run_qemu_img convert -O $IMGFMT -o backing_fmt=$IMGFMT,backing_file="$TEST_IMG",,help "$TEST_IMG" "$TEST_IMG".base
+run_qemu_img convert -O $IMGFMT -o backing_fmt=$IMGFMT,backing_file="$TEST_IMG",,\? "$TEST_IMG" "$TEST_IMG".base
 
 # Try to trick qemu-img into creating escaped commas
 run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG", -o help "$TEST_IMG" "$TEST_IMG".base
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index a38a26fc57..1728aff1e0 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -244,11 +244,11 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
-Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help lazy_refcounts=off refcount_bits=16
+Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help -F qcow2 TEST_DIR/t.qcow2 128M
+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
 
-Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 128M
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? lazy_refcounts=off refcount_bits=16
+Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? -F qcow2 TEST_DIR/t.qcow2 128M
+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
 
 Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 128M
 qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2,
@@ -543,10 +543,10 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
-Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
+Testing: convert -O qcow2 -o backing_fmt=qcow2,backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
 qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,help': No such file or directory
 
-Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
+Testing: convert -O qcow2 -o backing_fmt=qcow2,backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
 qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,?': No such file or directory
 
 Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085
index dd3c993a2d..e99eb44581 100755
--- a/tests/qemu-iotests/085
+++ b/tests/qemu-iotests/085
@@ -106,7 +106,7 @@ add_snapshot_image()
 {
     base_image="${TEST_DIR}/$((${1}-1))-${snapshot_virt0}"
     snapshot_file="${TEST_DIR}/${1}-${snapshot_virt0}"
-    TEST_IMG=$snapshot_file _make_test_img -u -b "${base_image}" "$size"
+    TEST_IMG=$snapshot_file _make_test_img -u -b "${base_image}" -F $IMGFMT "$size"
     do_blockdev_add "$1" "'backing': null, " "${snapshot_file}"
 }
 
@@ -225,7 +225,7 @@ echo
 SNAPSHOTS=$((${SNAPSHOTS}+1))
 
 TEST_IMG="$TEST_IMG.base" _make_test_img "$size"
-_make_test_img -b "${TEST_IMG}.base" "$size"
+_make_test_img -b "${TEST_IMG}.base" -F $IMGFMT "$size"
 do_blockdev_add ${SNAPSHOTS} "" "${TEST_IMG}"
 blockdev_snapshot ${SNAPSHOTS} error
 
diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out
index d68c06efdf..700658d5a3 100644
--- a/tests/qemu-iotests/085.out
+++ b/tests/qemu-iotests/085.out
@@ -68,12 +68,12 @@ Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compres
 
 === Create a couple of snapshots using blockdev-snapshot ===
 
-Formatting 'TEST_DIR/11-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/10-snapshot-v0.IMGFMT
+Formatting 'TEST_DIR/11-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/10-snapshot-v0.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_11', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TEST_DIR/11-snapshot-v0.IMGFMT', 'node-name': 'file_11' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_11' } }
 {"return": {}}
-Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/11-snapshot-v0.IMGFMT
+Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/11-snapshot-v0.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_12', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TEST_DIR/12-snapshot-v0.IMGFMT', 'node-name': 'file_12' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_12' } }
@@ -101,7 +101,7 @@ Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_f
 === Invalid command - snapshot node has a backing image ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_13', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'node-name': 'file_13' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_13' } }
diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089
index 059ad75e28..66c5415abe 100755
--- a/tests/qemu-iotests/089
+++ b/tests/qemu-iotests/089
@@ -84,7 +84,7 @@ echo
 echo "=== Testing correct handling of 'backing':null ==="
 echo
 
-_make_test_img -b "$TEST_IMG.base" $IMG_SIZE
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $IMG_SIZE
 
 # This should read 42
 $QEMU_IO -c 'read -P 42 0 512' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out
index 20c8ce8f0e..15682c2886 100644
--- a/tests/qemu-iotests/089.out
+++ b/tests/qemu-iotests/089.out
@@ -21,7 +21,7 @@ read 512/512 bytes at offset 0
 
 === Testing correct handling of 'backing':null ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 512/512 bytes at offset 0
diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095
index 155ae86aa7..77a5f0f3f5 100755
--- a/tests/qemu-iotests/095
+++ b/tests/qemu-iotests/095
@@ -51,9 +51,9 @@ size_larger=100M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size_smaller
 
-TEST_IMG="$TEST_IMG.snp1" _make_test_img -b "$TEST_IMG.base" $size_larger
+TEST_IMG="$TEST_IMG.snp1" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size_larger
 
-_make_test_img -b "${TEST_IMG}.snp1" $size_larger
+_make_test_img -b "${TEST_IMG}.snp1" -F $IMGFMT $size_larger
 
 echo
 echo "=== Base image info before commit and resize ==="
diff --git a/tests/qemu-iotests/095.out b/tests/qemu-iotests/095.out
index 614e5ccbbb..e66ced58f8 100644
--- a/tests/qemu-iotests/095.out
+++ b/tests/qemu-iotests/095.out
@@ -1,7 +1,7 @@
 QA output created by 095
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=5242880
-Formatting 'TEST_DIR/t.IMGFMT.snp1', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.snp1
+Formatting 'TEST_DIR/t.IMGFMT.snp1', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.snp1 backing_fmt=IMGFMT
 
 === Base image info before commit and resize ===
 image: TEST_DIR/t.IMGFMT.base
diff --git a/tests/qemu-iotests/097 b/tests/qemu-iotests/097
index 690f3d3ce1..d910a8b107 100755
--- a/tests/qemu-iotests/097
+++ b/tests/qemu-iotests/097
@@ -67,8 +67,8 @@ echo
 
 len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
 TEST_IMG="$TEST_IMG.base" _make_test_img $len
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
-_make_test_img -b "$TEST_IMG.itmd" $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $len
+_make_test_img -b "$TEST_IMG.itmd" -F $IMGFMT $len
 
 $QEMU_IO -c "write -P 1 0x7ffd0000 192k" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -P 2 0x7ffe0000 128k" "$TEST_IMG.itmd" | _filter_qemu_io
diff --git a/tests/qemu-iotests/097.out b/tests/qemu-iotests/097.out
index f6705a1cc7..3038ddab31 100644
--- a/tests/qemu-iotests/097.out
+++ b/tests/qemu-iotests/097.out
@@ -3,8 +3,8 @@ QA output created by 097
 === Test pass 0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -40,8 +40,8 @@ Offset          Length          File
 === Test pass 1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -78,8 +78,8 @@ Offset          Length          File
 === Test pass 2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -116,8 +116,8 @@ Offset          Length          File
 === Test pass 3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
diff --git a/tests/qemu-iotests/098 b/tests/qemu-iotests/098
index 1e29d96b3d..f2ccdd7909 100755
--- a/tests/qemu-iotests/098
+++ b/tests/qemu-iotests/098
@@ -52,7 +52,7 @@ echo "=== $event ==="
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base" 64M
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 64M
 
 # Some data that can be leaked when emptying the top image
 $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/098.out b/tests/qemu-iotests/098.out
index 23cf371f53..6c73dd0977 100644
--- a/tests/qemu-iotests/098.out
+++ b/tests/qemu-iotests/098.out
@@ -3,7 +3,7 @@ QA output created by 098
 === l1_update ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -12,7 +12,7 @@ No errors were found on the image.
 === empty_image_prepare ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -25,7 +25,7 @@ No errors were found on the image.
 === reftable_update ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -39,7 +39,7 @@ No errors were found on the image.
 === refblock_alloc ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
index 139c02c2cf..f1813d0dfb 100755
--- a/tests/qemu-iotests/110
+++ b/tests/qemu-iotests/110
@@ -50,7 +50,7 @@ echo '=== Reconstructable filename ==='
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG_REL.base" 64M
+_make_test_img -b "$TEST_IMG_REL.base" -F $IMGFMT 64M
 # qemu should be able to reconstruct the filename, so relative backing names
 # should work
 # (We have to filter the backing file format because vmdk always
@@ -91,7 +91,7 @@ echo '=== Backing name is always relative to the backed image ==='
 echo
 
 # omit the image size; it should work anyway
-_make_test_img -b "$TEST_IMG_REL.base"
+_make_test_img -b "$TEST_IMG_REL.base" -F $IMGFMT
 
 echo
 echo '=== Nodes without a common directory ==='
diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out
index f835553a99..cf8f6c025d 100644
--- a/tests/qemu-iotests/110.out
+++ b/tests/qemu-iotests/110.out
@@ -3,7 +3,7 @@ QA output created by 110
 === Reconstructable filename ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base backing_fmt=IMGFMT
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
@@ -18,7 +18,7 @@ backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base)
 
 === Backing name is always relative to the backed image ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base backing_fmt=IMGFMT
 
 === Nodes without a common directory ===
 
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index 2dc16b2ca4..dfd1cd05d6 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -52,9 +52,10 @@ echo
 echo "=== Check allocation status regression with -B ==="
 echo
 
-_make_test_img -b "$TEST_IMG".base
+_make_test_img -b "$TEST_IMG".base -F $IMGFMT
 $QEMU_IO -c "write -P 0x22 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base \
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 
 
@@ -62,18 +63,22 @@ echo
 echo "=== Check that zero clusters are kept in overlay ==="
 echo
 
-_make_test_img -b "$TEST_IMG".base
+_make_test_img -b "$TEST_IMG".base -F $IMGFMT
 
 $QEMU_IO -c "write -P 0 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
 
 $QEMU_IO -c "write -z 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
 
 
@@ -94,11 +99,11 @@ TEST_IMG="$TEST_IMG".base _make_test_img 256M
 # We do not want such a zero write, however, because we are past the
 # end of the backing file on the target as well, so we do not need to
 # write anything there.
-_make_test_img -b "$TEST_IMG".base 768M
+_make_test_img -b "$TEST_IMG".base 768M -F $IMGFMT
 
 # Use compat=0.10 as the output so there is no zero cluster support
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o compat=0.10 \
-    "$TEST_IMG" "$TEST_IMG".orig
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 # See that nothing has been allocated past 64M
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 
@@ -110,7 +115,7 @@ $QEMU_IO -c 'write -P 0x11 255M 1M' "$TEST_IMG".base 2>&1 | _filter_qemu_io
 $QEMU_IO -c 'write -P 0x22 600M 1M' "$TEST_IMG" 2>&1 | _filter_qemu_io
 
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o compat=0.10 \
-    "$TEST_IMG" "$TEST_IMG".orig
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 $QEMU_IO -c 'read -P 0x11 255M 1M' \
@@ -199,7 +204,7 @@ $QEMU_IMG map --output=json "$TEST_IMG".orig | _filter_qemu_img_map
 TEST_IMG="$TEST_IMG".base _make_test_img 64M
 $QEMU_IO -c "write -P 0x11 0 32M" "$TEST_IMG".base 2>&1 | _filter_qemu_io | _filter_testdir
 
-_make_test_img -b "$TEST_IMG".base 64M
+_make_test_img -b "$TEST_IMG".base 64M -F $IMGFMT
 $QEMU_IO -c "write -P 0x22 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
 
 echo
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index c2e154a1e5..f1f195ed77 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -5,7 +5,7 @@ wrote 67108864/67108864 bytes at offset 0
 
 === Check allocation status regression with -B ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Offset          Length          File
@@ -14,7 +14,7 @@ Offset          Length          File
 
 === Check that zero clusters are kept in overlay ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 3145728/3145728 bytes at offset 0
@@ -31,7 +31,7 @@ read 3145728/3145728 bytes at offset 0
 === Converting to an overlay larger than its backing file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=268435456
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=805306368 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=805306368 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Offset          Length          File
 
 wrote 1048576/1048576 bytes at offset 267386880
@@ -141,7 +141,7 @@ read 63963136/63963136 bytes at offset 3145728
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 33554432/33554432 bytes at offset 0
 32 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/126 b/tests/qemu-iotests/126
index b7fce1e59d..dd5a211227 100755
--- a/tests/qemu-iotests/126
+++ b/tests/qemu-iotests/126
@@ -61,7 +61,7 @@ BASE_IMG="$TEST_DIR/image:base.$IMGFMT"
 TOP_IMG="$TEST_DIR/image:top.$IMGFMT"
 
 TEST_IMG=$BASE_IMG _make_test_img 64M
-TEST_IMG=$TOP_IMG _make_test_img -b ./image:base.$IMGFMT
+TEST_IMG=$TOP_IMG _make_test_img -b ./image:base.$IMGFMT -F $IMGFMT
 
 # (1) The default cluster size depends on the image format
 # (2) vmdk only supports vmdk backing files, so it always reports the
@@ -82,7 +82,7 @@ BASE_IMG="base.$IMGFMT"
 TOP_IMG="file:image:top.$IMGFMT"
 
 TEST_IMG=$BASE_IMG _make_test_img 64M
-TEST_IMG=$TOP_IMG _make_test_img -b "$BASE_IMG"
+TEST_IMG=$TOP_IMG _make_test_img -b "$BASE_IMG" -F $IMGFMT
 
 TEST_IMG=$TOP_IMG _img_info | grep -ve 'cluster_size' -e 'backing file format'
 
diff --git a/tests/qemu-iotests/126.out b/tests/qemu-iotests/126.out
index e3c4d61916..7d6634685e 100644
--- a/tests/qemu-iotests/126.out
+++ b/tests/qemu-iotests/126.out
@@ -8,14 +8,14 @@ Formatting 'file:TEST_DIR/a:b.IMGFMT', fmt=IMGFMT size=67108864
 === Testing relative backing filename resolution ===
 
 Formatting 'TEST_DIR/image:base.IMGFMT', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=./image:base.IMGFMT
+Formatting 'TEST_DIR/image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=./image:base.IMGFMT backing_fmt=IMGFMT
 image: TEST_DIR/image:top.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
 backing file: ./image:base.IMGFMT (actual path: TEST_DIR/./image:base.IMGFMT)
 
 Formatting 'base.IMGFMT', fmt=IMGFMT size=67108864
-Formatting 'file:image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=base.IMGFMT
+Formatting 'file:image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=base.IMGFMT backing_fmt=IMGFMT
 image: ./image:top.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
index a4fc866038..e2ac2f5536 100755
--- a/tests/qemu-iotests/127
+++ b/tests/qemu-iotests/127
@@ -48,8 +48,8 @@ _require_devices virtio-scsi scsi-hd
 IMG_SIZE=64K
 
 _make_test_img $IMG_SIZE
-TEST_IMG="$TEST_IMG.overlay0" _make_test_img -b "$TEST_IMG" $IMG_SIZE
-TEST_IMG="$TEST_IMG.overlay1" _make_test_img -b "$TEST_IMG" $IMG_SIZE
+TEST_IMG="$TEST_IMG.overlay0" _make_test_img -b "$TEST_IMG" -F $IMGFMT $IMG_SIZE
+TEST_IMG="$TEST_IMG.overlay1" _make_test_img -b "$TEST_IMG" -F $IMGFMT $IMG_SIZE
 
 # So that we actually have something to mirror and the job does not return
 # immediately (which may be bad because then we cannot know whether the
diff --git a/tests/qemu-iotests/127.out b/tests/qemu-iotests/127.out
index 623d52bbd1..efd6cb327f 100644
--- a/tests/qemu-iotests/127.out
+++ b/tests/qemu-iotests/127.out
@@ -1,7 +1,7 @@
 QA output created by 127
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536
-Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
 wrote 42/42 bytes at offset 0
 42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129
index b0da4a5541..0e13244d85 100755
--- a/tests/qemu-iotests/129
+++ b/tests/qemu-iotests/129
@@ -29,7 +29,8 @@ class TestStopWithBlockJob(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.qemu_img('create', '-f', iotests.imgfmt, self.base_img, "1G")
-        iotests.qemu_img('create', '-f', iotests.imgfmt, self.test_img, "-b", self.base_img)
+        iotests.qemu_img('create', '-f', iotests.imgfmt, self.test_img,
+                         "-b", self.base_img, '-F', iotests.imgfmt)
         iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write -P0x5d 1M 128M', self.test_img)
         self.vm = iotests.VM().add_drive(self.test_img)
         self.vm.launch()
diff --git a/tests/qemu-iotests/133 b/tests/qemu-iotests/133
index 6f7cacc091..4070fd9457 100755
--- a/tests/qemu-iotests/133
+++ b/tests/qemu-iotests/133
@@ -40,7 +40,7 @@ _supported_fmt qcow2
 _supported_proto file
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 echo
 echo "=== Check that node-name can't be changed ==="
diff --git a/tests/qemu-iotests/133.out b/tests/qemu-iotests/133.out
index 1491ef45a9..d70c2e8041 100644
--- a/tests/qemu-iotests/133.out
+++ b/tests/qemu-iotests/133.out
@@ -1,6 +1,6 @@
 QA output created by 133
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Check that node-name can't be changed ===
 
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 7120d3142b..1452fd24b3 100755
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -71,7 +71,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
     def addBlockDriverStateOverlay(self, node):
         self.checkBlockDriverState(node, False)
         iotests.qemu_img('create', '-u', '-f', iotests.imgfmt,
-                         '-b', base_img, new_img, '1M')
+                         '-b', base_img, '-F', iotests.imgfmt, new_img, '1M')
         opts = {'driver': iotests.imgfmt,
                 'node-name': node,
                 'backing': None,
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 5192d256e3..21aa0b42d8 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -89,8 +89,8 @@ test_blockjob()
 
 
 TEST_IMG="$TEST_DIR/b.$IMGFMT" _make_test_img 1M
-TEST_IMG="$TEST_DIR/m.$IMGFMT" _make_test_img -b "$TEST_DIR/b.$IMGFMT" 1M
-_make_test_img -b "$TEST_DIR/m.$IMGFMT" 1M
+TEST_IMG="$TEST_DIR/m.$IMGFMT" _make_test_img -b "$TEST_DIR/b.$IMGFMT" -F $IMGFMT 1M
+_make_test_img -b "$TEST_DIR/m.$IMGFMT" 1M -F $IMGFMT
 
 _launch_qemu -nodefaults
 
diff --git a/tests/qemu-iotests/141.out b/tests/qemu-iotests/141.out
index 263b680bdf..08e0aecd65 100644
--- a/tests/qemu-iotests/141.out
+++ b/tests/qemu-iotests/141.out
@@ -1,7 +1,7 @@
 QA output created by 141
 Formatting 'TEST_DIR/b.IMGFMT', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/m.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/b.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/m.IMGFMT
+Formatting 'TEST_DIR/m.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/b.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/m.IMGFMT backing_fmt=IMGFMT
 {'execute': 'qmp_capabilities'}
 {"return": {}}
 
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
index daefcbaa58..69fd10ef51 100755
--- a/tests/qemu-iotests/142
+++ b/tests/qemu-iotests/142
@@ -67,7 +67,7 @@ size=128M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 TEST_IMG="$TEST_IMG.snap" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base" $size
+_make_test_img -b "$TEST_IMG.base" $size -F $IMGFMT
 
 echo
 echo === Simple test for all cache modes ===
diff --git a/tests/qemu-iotests/142.out b/tests/qemu-iotests/142.out
index 3667e38def..a92b948edd 100644
--- a/tests/qemu-iotests/142.out
+++ b/tests/qemu-iotests/142.out
@@ -1,7 +1,7 @@
 QA output created by 142
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 Formatting 'TEST_DIR/t.IMGFMT.snap', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Simple test for all cache modes ===
 
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index 11e3d28841..34045ea3cf 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -94,7 +94,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
 
     echo
     echo "== Creating test image =="
-    _make_test_img -b "${TEST_IMG}.base"
+    _make_test_img -b "${TEST_IMG}.base" -F $IMGFMT
 
     echo
     echo "== Launching QEMU, opts: '$opts1' =="
@@ -125,7 +125,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
         _run_cmd $QEMU_IMG amend -o "size=$size" $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG commit      $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG resize      $L "${TEST_IMG}" $size
-        _run_cmd $QEMU_IMG rebase      $L "${TEST_IMG}" -b "${TEST_IMG}.base"
+        _run_cmd $QEMU_IMG rebase      $L "${TEST_IMG}" -b "${TEST_IMG}.base" -F $IMGFMT
         _run_cmd $QEMU_IMG snapshot -l $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG convert     $L "${TEST_IMG}" "${TEST_IMG}.convert"
         _run_cmd $QEMU_IMG dd          $L if="${TEST_IMG}" of="${TEST_IMG}.convert" bs=512 count=1
@@ -135,7 +135,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
         # qemu-img create does not support -U
         if [ -z "$L" ]; then
             _run_cmd $QEMU_IMG create -f $IMGFMT "${TEST_IMG}" \
-                                      -b ${TEST_IMG}.base
+                                      -b ${TEST_IMG}.base -F $IMGFMT
             # Read the file format.  It used to be the case that
             # file-posix simply truncated the file, but the qcow2
             # driver then failed to format it because it was unable
@@ -167,9 +167,9 @@ done
 
 echo
 echo "== Creating ${TEST_IMG}.[abc] ==" | _filter_testdir
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}" | _filter_img_create
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.b" -b "${TEST_IMG}" | _filter_img_create
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.c" -b "${TEST_IMG}.b" \
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.b" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.c" -b "${TEST_IMG}.b" -F $IMGFMT \
     | _filter_img_create
 
 echo
@@ -218,7 +218,7 @@ _send_qemu_cmd $QEMU_HANDLE \
 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
 
 echo "Creating overlay with qemu-img when the guest is running should be allowed"
-_run_cmd $QEMU_IMG create -f $IMGFMT -b "${TEST_IMG}" "${TEST_IMG}.overlay"
+_run_cmd $QEMU_IMG create -f $IMGFMT -b "${TEST_IMG}" -F $IMGFMT "${TEST_IMG}.overlay"
 
 echo "== Closing an image should unlock it =="
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index b2a90caa6b..8a79e1ee87 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -6,7 +6,7 @@ QEMU_PROG: -drive if=none,file=null-co://,readonly=off,force-share=on: force-sha
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: '' ==
 
@@ -68,7 +68,7 @@ _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -92,10 +92,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -130,7 +131,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -152,7 +153,7 @@ Round done
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: 'read-only=on' ==
 
@@ -199,7 +200,7 @@ _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -215,10 +216,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -253,7 +255,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -275,7 +277,7 @@ Round done
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: 'read-only=on,force-share=on' ==
 
@@ -309,7 +311,7 @@ _qemu_img_wrapper commit TEST_DIR/t.qcow2
 
 _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 
 _qemu_img_wrapper snapshot -l TEST_DIR/t.qcow2
 
@@ -321,8 +323,9 @@ _qemu_img_wrapper bench -c 1 TEST_DIR/t.qcow2
 
 _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -357,7 +360,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 
 _qemu_img_wrapper snapshot -l -U TEST_DIR/t.qcow2
 
@@ -398,9 +401,9 @@ Is another process using the image [TEST_DIR/t.qcow2]?
 == Two devices with the same image (read-only=on,force-share=on - read-only=on,force-share=on) ==
 
 == Creating TEST_DIR/t.qcow2.[abc] ==
-Formatting 'TEST_DIR/t.IMGFMT.a', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.b', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.c', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.b
+Formatting 'TEST_DIR/t.IMGFMT.a', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.b', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.c', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.b backing_fmt=IMGFMT
 
 == Two devices sharing the same file in backing chain ==
 
@@ -430,7 +433,7 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 Creating overlay with qemu-img when the guest is running should be allowed
 
-_qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.overlay
+_qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 -F qcow2 TEST_DIR/t.qcow2.overlay
 == Closing an image should unlock it ==
 { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'drive_del d0' } }
 {"return": ""}
diff --git a/tests/qemu-iotests/154 b/tests/qemu-iotests/154
index d68f66b9e0..7f1c0d9bd9 100755
--- a/tests/qemu-iotests/154
+++ b/tests/qemu-iotests/154
@@ -50,7 +50,7 @@ echo
 echo == backing file contains zeros ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Make sure that the whole cluster is allocated even for partial write_zeroes
 # when the backing file contains zeros
@@ -74,7 +74,7 @@ echo
 echo == backing file contains non-zero data before write_zeroes ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Single cluster; non-zero data at the cluster start
 # ... | XX -- 00 -- | ...
@@ -97,7 +97,7 @@ echo
 echo == backing file contains non-zero data after write_zeroes ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Single cluster; non-zero data directly after request
 # ... | -- 00 XX -- | ...
@@ -120,7 +120,7 @@ echo
 echo == write_zeroes covers non-zero data ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # non-zero data at front of request
 # Backing file: -- XX -- --
@@ -160,7 +160,7 @@ echo
 echo == spanning two clusters, non-zero before request ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Two clusters; non-zero data before request:
 # 1. At cluster start:          32k: XX -- -- 00 | 00 -- -- --
@@ -190,7 +190,7 @@ echo
 echo == spanning two clusters, non-zero after request ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Two clusters; non-zero data after request:
 # 1. Directly after request:    32k: -- -- -- 00 | 00 XX -- --
@@ -220,7 +220,7 @@ echo
 echo == spanning two clusters, partially overwriting backing file ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: -- -- XX XX | XX XX -- --
 # Active layer: -- -- XX 00 | 00 XX -- --
@@ -239,7 +239,7 @@ echo
 echo == spanning multiple clusters, non-zero in first cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: XX XX -- -- | -- -- -- -- | -- -- -- --
 # Active layer: 64k: XX XX 00 00 | 00 00 00 00 | 00 -- -- --
@@ -255,7 +255,7 @@ echo
 echo == spanning multiple clusters, non-zero in intermediate cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- -- -- -- | -- XX XX -- | -- -- -- --
 # Active layer: 64k: -- -- 00 00 | 00 00 00 00 | 00 -- -- --
@@ -270,7 +270,7 @@ echo
 echo == spanning multiple clusters, non-zero in final cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- -- -- -- | -- -- -- -- | -- -- XX XX
 # Active layer: 64k: -- -- 00 00 | 00 00 00 00 | 00 -- XX XX
@@ -286,7 +286,7 @@ echo
 echo == spanning multiple clusters, partially overwriting backing file ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- XX XX XX | XX XX XX XX | XX XX XX --
 # Active layer: 64k: -- XX 00 00 | 00 00 00 00 | 00 XX XX --
@@ -338,7 +338,7 @@ CLUSTER_SIZE=2048 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
 # Write at the front: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | 00 -- -- --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -346,7 +346,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at the back: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | -- -- -- 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 1536)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -354,7 +354,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at middle: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | -- 00 00 --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 512)) 1024" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -362,7 +362,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write entire cluster: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | 00 00 00 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -373,7 +373,7 @@ $QEMU_IO -c "write -z $size 512" "$TEST_IMG.base" | _filter_qemu_io
 # Write at the front: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | 00 -- -- --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -381,7 +381,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at the back: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | -- -- -- 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 1536)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -389,7 +389,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at middle: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | -- 00 00 --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 512)) 1024" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -397,7 +397,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write entire cluster: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | 00 00 00 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -427,7 +427,7 @@ echo == unaligned image tail cluster, allocation required ==
 # Backing file: 128m... | XX --
 # Active layer: 128m... | -- -- 00 --
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -P 1 $((size)) 512" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -z $((size + 1024)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "read -P 1 $((size)) 512" "$TEST_IMG" | _filter_qemu_io
@@ -438,7 +438,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Backing file: 128m: ... | -- XX
 # Active layer: 128m: ... | 00 -- -- 00
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -P 1 $((size + 512)) 512" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -z $((size)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "read -P 0 $((size)) 512" "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/154.out b/tests/qemu-iotests/154.out
index fa3673317f..4863e24838 100644
--- a/tests/qemu-iotests/154.out
+++ b/tests/qemu-iotests/154.out
@@ -2,7 +2,7 @@ QA output created by 154
 
 == backing file contains zeros ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 0
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 10240
@@ -22,7 +22,7 @@ wrote 2048/2048 bytes at offset 27648
 
 == backing file contains non-zero data before write_zeroes ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 32768
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1024/1024 bytes at offset 34816
@@ -49,7 +49,7 @@ read 2048/2048 bytes at offset 67584
 
 == backing file contains non-zero data after write_zeroes ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 34816
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1024/1024 bytes at offset 33792
@@ -76,7 +76,7 @@ read 3072/3072 bytes at offset 40960
 
 == write_zeroes covers non-zero data ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 5120
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 5120
@@ -113,7 +113,7 @@ read 4096/4096 bytes at offset 28672
 
 == spanning two clusters, non-zero before request ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 32768
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 35840
@@ -155,7 +155,7 @@ read 5120/5120 bytes at offset 68608
 
 == spanning two clusters, non-zero after request ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 37888
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 35840
@@ -197,7 +197,7 @@ read 1024/1024 bytes at offset 72704
 
 == spanning two clusters, partially overwriting backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 4096/4096 bytes at offset 2048
 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 3072
@@ -217,7 +217,7 @@ read 2048/2048 bytes at offset 6144
 
 == spanning multiple clusters, non-zero in first cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 65536
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -233,7 +233,7 @@ read 10240/10240 bytes at offset 67584
 
 == spanning multiple clusters, non-zero in intermediate cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 70656
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -246,7 +246,7 @@ read 12288/12288 bytes at offset 65536
 
 == spanning multiple clusters, non-zero in final cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 75776
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -262,7 +262,7 @@ read 2048/2048 bytes at offset 75776
 
 == spanning multiple clusters, partially overwriting backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 10240/10240 bytes at offset 66560
 10 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -305,25 +305,25 @@ wrote 2048/2048 bytes at offset 134217728
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134219776, "depth": 0, "zero": true, "data": false}]
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134219264
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 134218240
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 134217728
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
@@ -331,25 +331,25 @@ wrote 2048/2048 bytes at offset 134217728
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134219264
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 134218240
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 134217728
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
@@ -377,7 +377,7 @@ read 1024/1024 bytes at offset 134217728
 
 == unaligned image tail cluster, allocation required ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 134218752
@@ -389,7 +389,7 @@ read 1536/1536 bytes at offset 134218240
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134218240
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 134217728
diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155
index cb371d4649..988f986144 100755
--- a/tests/qemu-iotests/155
+++ b/tests/qemu-iotests/155
@@ -60,9 +60,12 @@ class BaseClass(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', '-f', iotests.imgfmt, back0_img, '1440K')
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back0_img, back1_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back1_img, back2_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back2_img, source_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back0_img,
+                 '-F', iotests.imgfmt, back1_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back1_img,
+                 '-F', iotests.imgfmt, back2_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back2_img,
+                 '-F', iotests.imgfmt, source_img)
 
         self.vm = iotests.VM()
         # Add the BDS via blockdev-add so it stays around after the mirror block
@@ -89,7 +92,8 @@ class BaseClass(iotests.QMPTestCase):
         if self.existing:
             if self.target_backing:
                 qemu_img('create', '-f', iotests.imgfmt,
-                         '-b', self.target_backing, target_img, '1440K')
+                         '-b', self.target_backing, '-F', 'raw',
+                         target_img, '1440K')
             else:
                 qemu_img('create', '-f', iotests.imgfmt, target_img, '1440K')
 
diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156
index 5559df63a5..7c69a6c3fa 100755
--- a/tests/qemu-iotests/156
+++ b/tests/qemu-iotests/156
@@ -56,7 +56,7 @@ _unsupported_imgopts data_file
 
 # Create source disk
 TEST_IMG="$TEST_IMG.backing" _make_test_img 1M
-_make_test_img -b "$TEST_IMG.backing" 1M
+_make_test_img -b "$TEST_IMG.backing" -F $IMGFMT 1M
 
 $QEMU_IO -c 'write -P 1 0 256k' "$TEST_IMG.backing" | _filter_qemu_io
 $QEMU_IO -c 'write -P 2 64k 192k' "$TEST_IMG" | _filter_qemu_io
@@ -68,7 +68,7 @@ _send_qemu_cmd $QEMU_HANDLE \
     'return'
 
 # Create snapshot
-TEST_IMG="$TEST_IMG.overlay" _make_test_img -u -b "$TEST_IMG" 1M
+TEST_IMG="$TEST_IMG.overlay" _make_test_img -u -b "$TEST_IMG" -F $IMGFMT 1M
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'blockdev-snapshot-sync',
        'arguments': { 'device': 'source',
@@ -85,7 +85,8 @@ _send_qemu_cmd $QEMU_HANDLE \
     'return'
 
 # Create target image
-TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" 1M
+TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" \
+    -F $IMGFMT 1M
 
 # Mirror snapshot
 _send_qemu_cmd $QEMU_HANDLE \
@@ -111,7 +112,7 @@ _send_qemu_cmd $QEMU_HANDLE \
 # Copy source backing chain to the target before completing the job
 cp "$TEST_IMG.backing" "$TEST_IMG.target.backing"
 cp "$TEST_IMG" "$TEST_IMG.target"
-$QEMU_IMG rebase -u -b "$TEST_IMG.target.backing" "$TEST_IMG.target"
+$QEMU_IMG rebase -u -b "$TEST_IMG.target.backing" -F $IMGFMT "$TEST_IMG.target"
 
 # Complete block job
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/156.out b/tests/qemu-iotests/156.out
index 084be5ad71..cce167b63f 100644
--- a/tests/qemu-iotests/156.out
+++ b/tests/qemu-iotests/156.out
@@ -1,20 +1,20 @@
 QA output created by 156
 Formatting 'TEST_DIR/t.IMGFMT.backing', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.backing
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.backing backing_fmt=IMGFMT
 wrote 262144/262144 bytes at offset 0
 256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 196608/196608 bytes at offset 65536
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
 {"return": {}}
-Formatting 'TEST_DIR/t.IMGFMT.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'source', 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'format': 'IMGFMT', 'mode': 'existing' } }
 {"return": {}}
 { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io source "write -P 3 128k 128k"' } }
 wrote 131072/131072 bytes at offset 131072
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 {"return": ""}
-Formatting 'TEST_DIR/t.IMGFMT.target.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.target
+Formatting 'TEST_DIR/t.IMGFMT.target.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.target backing_fmt=IMGFMT
 { 'execute': 'drive-mirror', 'arguments': { 'device': 'source', 'target': 'TEST_DIR/t.IMGFMT.target.overlay', 'mode': 'existing', 'sync': 'top' } }
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "source"}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "source"}}
diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158
index ba4db6116a..3175968e2b 100755
--- a/tests/qemu-iotests/158
+++ b/tests/qemu-iotests/158
@@ -64,7 +64,7 @@ echo "== verify pattern =="
 $QEMU_IO --object $SECRET -c "read -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img -u --object $SECRET -o "encryption=on,encrypt.key-secret=sec0" -b "$TEST_IMG_BASE" $size
+_make_test_img -u --object $SECRET -o "encryption=on,encrypt.key-secret=sec0" -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing part of a cluster =="
diff --git a/tests/qemu-iotests/158.out b/tests/qemu-iotests/158.out
index f28a17626b..83f19699bb 100644
--- a/tests/qemu-iotests/158.out
+++ b/tests/qemu-iotests/158.out
@@ -10,7 +10,7 @@ wrote 134217728/134217728 bytes at offset 0
 read 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base encryption=on
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT encryption=on
 
 == writing part of a cluster ==
 wrote 1024/1024 bytes at offset 0
diff --git a/tests/qemu-iotests/161 b/tests/qemu-iotests/161
index f572a19af2..e270976d87 100755
--- a/tests/qemu-iotests/161
+++ b/tests/qemu-iotests/161
@@ -49,8 +49,8 @@ IMG_SIZE=1M
 
 # Create the images
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE | _filter_imgfmt
-TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" | _filter_imgfmt
-_make_test_img -b "$TEST_IMG.int" | _filter_imgfmt
+TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT | _filter_imgfmt
+_make_test_img -b "$TEST_IMG.int" -F $IMGFMT -F $IMGFMT | _filter_imgfmt
 
 # First test: reopen $TEST.IMG changing the detect-zeroes option on
 # its backing file ($TEST_IMG.int).
@@ -106,8 +106,8 @@ echo "*** Commit and then change an option on the backing file"
 echo
 # Create the images again
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE | _filter_imgfmt
-TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" | _filter_imgfmt
-_make_test_img -b "$TEST_IMG.int" | _filter_imgfmt
+TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT| _filter_imgfmt
+_make_test_img -b "$TEST_IMG.int" -F $IMGFMT | _filter_imgfmt
 
 _launch_qemu -drive if=none,file="${TEST_IMG}"
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/161.out b/tests/qemu-iotests/161.out
index aef9741ed3..3d8d89a9da 100644
--- a/tests/qemu-iotests/161.out
+++ b/tests/qemu-iotests/161.out
@@ -1,7 +1,7 @@
 QA output created by 161
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int
+Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int backing_fmt=IMGFMT
 
 *** Change an option on the backing file
 
@@ -29,8 +29,8 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.
 *** Commit and then change an option on the backing file
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int
+Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int backing_fmt=IMGFMT
 { 'execute': 'qmp_capabilities' }
 {"return": {}}
 { 'execute': 'block-commit', 'arguments': { 'device': 'none0', 'top': 'TEST_DIR/t.IMGFMT.int' } }
diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176
index 117c8b6954..2565ff12ee 100755
--- a/tests/qemu-iotests/176
+++ b/tests/qemu-iotests/176
@@ -84,8 +84,8 @@ echo
 
 len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
 TEST_IMG="$TEST_IMG.base" _make_test_img $len
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
-_make_test_img -b "$TEST_IMG.itmd" $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $len
+_make_test_img -b "$TEST_IMG.itmd" -F $IMGFMT $len
 # Update the top image to use a feature that is incompatible with fast path
 case $reason in
     snapshot) $QEMU_IMG snapshot -c snap "$TEST_IMG" ;;
diff --git a/tests/qemu-iotests/176.out b/tests/qemu-iotests/176.out
index cc33def96b..9d09b60452 100644
--- a/tests/qemu-iotests/176.out
+++ b/tests/qemu-iotests/176.out
@@ -3,8 +3,8 @@ QA output created by 176
 === Test pass snapshot.0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -43,8 +43,8 @@ ID        TAG
 === Test pass snapshot.1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -84,8 +84,8 @@ ID        TAG
 === Test pass snapshot.2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -125,8 +125,8 @@ ID        TAG
 === Test pass snapshot.3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -163,8 +163,8 @@ ID        TAG
 === Test pass bitmap.0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -212,8 +212,8 @@ QMP_VERSION
 === Test pass bitmap.1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -262,8 +262,8 @@ QMP_VERSION
 === Test pass bitmap.2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -312,8 +312,8 @@ QMP_VERSION
 === Test pass bitmap.3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
diff --git a/tests/qemu-iotests/177 b/tests/qemu-iotests/177
index eadc2c7ef6..5d4a77a6ab 100755
--- a/tests/qemu-iotests/177
+++ b/tests/qemu-iotests/177
@@ -51,7 +51,7 @@ echo "== setting up files =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 $QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 22 0 $size" "$TEST_IMG" | _filter_qemu_io
 
 # Limited to 64k max-transfer
diff --git a/tests/qemu-iotests/177.out b/tests/qemu-iotests/177.out
index e887542678..ba1e1e212e 100644
--- a/tests/qemu-iotests/177.out
+++ b/tests/qemu-iotests/177.out
@@ -4,7 +4,7 @@ QA output created by 177
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/179 b/tests/qemu-iotests/179
index 9372dc30ef..11a20cb1bf 100755
--- a/tests/qemu-iotests/179
+++ b/tests/qemu-iotests/179
@@ -49,7 +49,7 @@ echo '=== Testing write zeroes with unmap ==='
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Offsets chosen at or near 2M boundaries so test works at all cluster sizes
 # 8k and larger (smaller clusters fail due to non-contiguous allocations)
diff --git a/tests/qemu-iotests/179.out b/tests/qemu-iotests/179.out
index 80722b2289..1f7680002c 100644
--- a/tests/qemu-iotests/179.out
+++ b/tests/qemu-iotests/179.out
@@ -3,7 +3,7 @@ QA output created by 179
 === Testing write zeroes with unmap ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2097152/2097152 bytes at offset 2097152
 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2097152/2097152 bytes at offset 6291456
diff --git a/tests/qemu-iotests/189 b/tests/qemu-iotests/189
index e6a84b8a3b..3e5ded14c6 100755
--- a/tests/qemu-iotests/189
+++ b/tests/qemu-iotests/189
@@ -66,7 +66,7 @@ echo "== verify pattern =="
 $QEMU_IO --object $SECRET0 -c "read -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" $size
+_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing part of a cluster =="
diff --git a/tests/qemu-iotests/189.out b/tests/qemu-iotests/189.out
index bc213cbe14..30af0a8608 100644
--- a/tests/qemu-iotests/189.out
+++ b/tests/qemu-iotests/189.out
@@ -10,7 +10,7 @@ wrote 16777216/16777216 bytes at offset 0
 read 16777216/16777216 bytes at offset 0
 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == writing part of a cluster ==
 wrote 1024/1024 bytes at offset 0
diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
index b05db68141..d17462e1e4 100755
--- a/tests/qemu-iotests/191
+++ b/tests/qemu-iotests/191
@@ -54,8 +54,8 @@ echo
 
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
 TEST_IMG="${TEST_IMG}.mid" _make_test_img -o "backing_fmt=$IMGFMT" -b "${TEST_IMG}.base"
-_make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
+_make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
 
 $QEMU_IO -c 'write -P 0x55 1M 64k' "${TEST_IMG}.mid" | _filter_qemu_io
 
@@ -102,10 +102,10 @@ echo === Preparing and starting VM with -drive ===
 echo
 
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
-TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base"
-_make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl3" _make_test_img -b "${TEST_IMG}.ovl2"
+TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" -F $IMGFMT
+_make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl3" _make_test_img -b "${TEST_IMG}.ovl2" -F $IMGFMT
 
 $QEMU_IO -c 'write -P 0x55 1M 64k' "${TEST_IMG}.mid" | _filter_qemu_io
 
diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out
index 34cec7b9ec..11aaf3b691 100644
--- a/tests/qemu-iotests/191.out
+++ b/tests/qemu-iotests/191.out
@@ -4,8 +4,8 @@ QA output created by 191
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 1048576
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
@@ -413,10 +413,10 @@ backing file format: IMGFMT
 === Preparing and starting VM with -drive ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl3', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.ovl2
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl3', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.ovl2 backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 1048576
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195
index 48984b7ac1..2351d55fe1 100755
--- a/tests/qemu-iotests/195
+++ b/tests/qemu-iotests/195
@@ -56,8 +56,8 @@ run_qemu()
 
 size=64M
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.mid"
+TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
+_make_test_img -b "$TEST_IMG.mid" -F $IMGFMT
 
 echo
 echo "Change backing file of mid (opened read-only)"
@@ -75,7 +75,7 @@ echo
 echo "Change backing file of top (opened writable)"
 echo
 
-TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
+TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 run_qemu -drive if=none,file="$TEST_IMG",node-name=top <<EOF
 {"execute":"qmp_capabilities"}
diff --git a/tests/qemu-iotests/195.out b/tests/qemu-iotests/195.out
index e6df0d6781..ec84df5012 100644
--- a/tests/qemu-iotests/195.out
+++ b/tests/qemu-iotests/195.out
@@ -1,7 +1,7 @@
 QA output created by 195
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
 
 Change backing file of mid (opened read-only)
 
@@ -42,7 +42,7 @@ backing file format: IMGFMT
 
 Change backing file of top (opened writable)
 
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,node-name=top
 {
     QMP_VERSION
diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198
index aeb059d5ea..1b9bfb827b 100755
--- a/tests/qemu-iotests/198
+++ b/tests/qemu-iotests/198
@@ -63,7 +63,7 @@ echo "== writing whole image base =="
 $QEMU_IO --object $SECRET0 -c "write -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" $size
+_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing whole image layer =="
diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out
index 4b800e70db..3952708444 100644
--- a/tests/qemu-iotests/198.out
+++ b/tests/qemu-iotests/198.out
@@ -6,7 +6,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=16777216
 wrote 16777216/16777216 bytes at offset 0
 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == writing whole image layer ==
 wrote 16777216/16777216 bytes at offset 0
@@ -79,6 +79,7 @@ image: json:{ /* filtered */ }
 file format: IMGFMT
 virtual size: 16 MiB (16777216 bytes)
 backing file: TEST_DIR/t.IMGFMT.base
+backing file format: IMGFMT
 Format specific information:
     compression type: zlib
     encrypt:
diff --git a/tests/qemu-iotests/204 b/tests/qemu-iotests/204
index abb73dc381..6770fa9b96 100755
--- a/tests/qemu-iotests/204
+++ b/tests/qemu-iotests/204
@@ -52,7 +52,7 @@ echo "== setting up files =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 $QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 22 0 110M" "$TEST_IMG" | _filter_qemu_io
 
 # Limited to 64k max-transfer
diff --git a/tests/qemu-iotests/204.out b/tests/qemu-iotests/204.out
index f3a10fbe90..457f72df8f 100644
--- a/tests/qemu-iotests/204.out
+++ b/tests/qemu-iotests/204.out
@@ -4,7 +4,7 @@ QA output created by 204
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 115343360/115343360 bytes at offset 0
 110 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/216 b/tests/qemu-iotests/216
index de11d85b5d..f93c61aad6 100755
--- a/tests/qemu-iotests/216
+++ b/tests/qemu-iotests/216
@@ -53,7 +53,7 @@ with iotests.FilePath('base.img') as base_img_path, \
     assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
     assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') == 0
     assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                    top_img_path) == 0
+                    '-F', iotests.imgfmt, top_img_path) == 0
     assert qemu_io_silent(top_img_path,  '-c', 'write -P 2 1M 1M') == 0
 
     log('Done')
diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224
index 81ca1e4898..017b0685ba 100755
--- a/tests/qemu-iotests/224
+++ b/tests/qemu-iotests/224
@@ -49,9 +49,9 @@ for filter_node_name in False, True:
         assert qemu_img('create', '-f', iotests.imgfmt,
                         base_img_path, '64M') == 0
         assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                        mid_img_path) == 0
+                        '-F', iotests.imgfmt, mid_img_path) == 0
         assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
-                        top_img_path) == 0
+                        '-F', iotests.imgfmt, top_img_path) == 0
 
         # Something to commit
         assert qemu_io_silent(mid_img_path, '-c', 'write -P 1 0 1M') == 0
diff --git a/tests/qemu-iotests/225 b/tests/qemu-iotests/225
index c9a334c7e9..0186ec8156 100755
--- a/tests/qemu-iotests/225
+++ b/tests/qemu-iotests/225
@@ -48,7 +48,7 @@ _unsupported_imgopts "subformat=monolithicFlat" \
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 1M
 TEST_IMG="$TEST_IMG.not_base" _make_test_img 1M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 make_opts()
 {
diff --git a/tests/qemu-iotests/225.out b/tests/qemu-iotests/225.out
index 4dc8ee282f..0998ae094c 100644
--- a/tests/qemu-iotests/225.out
+++ b/tests/qemu-iotests/225.out
@@ -1,7 +1,7 @@
 QA output created by 225
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
 Formatting 'TEST_DIR/t.IMGFMT.not_base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Testing fitting VMDK backing image ===
 
diff --git a/tests/qemu-iotests/228 b/tests/qemu-iotests/228
index da0900fb82..60db986d84 100755
--- a/tests/qemu-iotests/228
+++ b/tests/qemu-iotests/228
@@ -56,7 +56,8 @@ with iotests.FilePath('base.img') as base_img_path, \
     assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
     # Choose a funny way to describe the backing filename
     assert qemu_img('create', '-f', iotests.imgfmt, '-b',
-                    'file:' + base_img_path, top_img_path) == 0
+                    'file:' + base_img_path, '-F', iotests.imgfmt,
+                    top_img_path) == 0
 
     vm.launch()
 
@@ -171,7 +172,7 @@ with iotests.FilePath('base.img') as base_img_path, \
     # filename unless the backing file is opened implicitly with the
     # overlay)
     assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                    top_img_path) == 0
+                    '-F', iotests.imgfmt, top_img_path) == 0
 
     # You can only reliably override backing options by using a node
     # reference (or by specifying file.filename, but, well...)
diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245
index 4f5f0bb901..ad91a6f5b4 100755
--- a/tests/qemu-iotests/245
+++ b/tests/qemu-iotests/245
@@ -44,7 +44,8 @@ class TestBlockdevReopen(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', '-f', iotests.imgfmt, hd_path[0], '3M')
-        qemu_img('create', '-f', iotests.imgfmt, '-b', hd_path[0], hd_path[1])
+        qemu_img('create', '-f', iotests.imgfmt, '-b', hd_path[0],
+                 '-F', iotests.imgfmt, hd_path[1])
         qemu_img('create', '-f', iotests.imgfmt, hd_path[2], '3M')
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xa0  0 1M', hd_path[0])
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xa1 1M 1M', hd_path[1])
diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249
index 2b99c9789e..68f13ed328 100755
--- a/tests/qemu-iotests/249
+++ b/tests/qemu-iotests/249
@@ -49,8 +49,8 @@ IMG_SIZE=1M
 
 # Create the images: base <- int <- active


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14771.36601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtL-0003u2-De; Thu, 29 Oct 2020 20:51:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14771.36601; Thu, 29 Oct 2020 20:51:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtL-0003tr-A1; Thu, 29 Oct 2020 20:51:27 +0000
Received: by outflank-mailman (input) for mailman id 14771;
 Thu, 29 Oct 2020 20:51:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEtK-0003tj-0C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 311f3208-ee49-4a55-9d09-bcaa5b0cbc67;
 Thu, 29 Oct 2020 20:51:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtI-0006t2-TR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtI-0000tw-Sf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEtK-0003tj-0C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:26 +0000
X-Inumbo-ID: 311f3208-ee49-4a55-9d09-bcaa5b0cbc67
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 311f3208-ee49-4a55-9d09-bcaa5b0cbc67;
	Thu, 29 Oct 2020 20:51:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nzgI77+DrNAF0BRqusB+p/hY5eeH45NEltZDHqmfpks=; b=m2DJPIZxsZkiGIzTAUpN8cFsBh
	KMM7Ju5EEkvbszYz5tvEw3BClkKzMHQpzQadtwi5Ge251dAiliz77JHDl66NgEyS/WWWmkoD2hYv8
	DxMthaCiRURsMV+ydPMMcUda+lUsCBH7s6+u7Qmbs1pg2dFtuPHRNtNZYw9u8jij4Inc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtI-0006t2-TR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtI-0000tw-Sf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Add support to warn on backing file change without format
Message-Id: <E1kYEtI-0000tw-Sf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:24 +0000

commit e54ee1b385a9d084b4052b6db7391ea2fd799fa8
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:53 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Add support to warn on backing file change without format
    
    For now, this is a mechanical addition; all callers pass false. But
    the next patch will use it to improve 'qemu-img rebase -u' when
    selecting a backing file with no format.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Peter Krempa <pkrempa@redhat.com>
    Reviewed-by: Ján Tomko <jtomko@redhat.com>
    Message-Id: <20200706203954.341758-10-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c               | 13 ++++++++++---
 block/qcow2.c         |  2 +-
 block/stream.c        |  2 +-
 blockdev.c            |  3 ++-
 include/block/block.h |  4 ++--
 qemu-img.c            |  4 ++--
 6 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/block.c b/block.c
index 6925e57d7c..4acfebf0e8 100644
--- a/block.c
+++ b/block.c
@@ -1206,7 +1206,8 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
     }
 
     ret = bdrv_change_backing_file(parent, filename,
-                                   base->drv ? base->drv->format_name : "");
+                                   base->drv ? base->drv->format_name : "",
+                                   false);
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not update backing file link");
     }
@@ -4680,8 +4681,8 @@ int bdrv_check(BlockDriverState *bs,
  *            image file header
  * -ENOTSUP - format driver doesn't support changing the backing file
  */
-int bdrv_change_backing_file(BlockDriverState *bs,
-    const char *backing_file, const char *backing_fmt)
+int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file,
+                             const char *backing_fmt, bool warn)
 {
     BlockDriver *drv = bs->drv;
     int ret;
@@ -4695,6 +4696,12 @@ int bdrv_change_backing_file(BlockDriverState *bs,
         return -EINVAL;
     }
 
+    if (warn && backing_file && !backing_fmt) {
+        warn_report("Deprecated use of backing file without explicit "
+                    "backing format, use of this image requires "
+                    "potentially unsafe format probing");
+    }
+
     if (drv->bdrv_change_backing_file != NULL) {
         ret = drv->bdrv_change_backing_file(bs, backing_file, backing_fmt);
     } else {
diff --git a/block/qcow2.c b/block/qcow2.c
index f3fc2707cd..fadf3422f8 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3627,7 +3627,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
         }
 
         ret = bdrv_change_backing_file(blk_bs(blk), qcow2_opts->backing_file,
-                                       backing_format);
+                                       backing_format, false);
         if (ret < 0) {
             error_setg_errno(errp, -ret, "Could not assign backing file '%s' "
                              "with format '%s'", qcow2_opts->backing_file,
diff --git a/block/stream.c b/block/stream.c
index aa2e7af98e..310ccbaa4c 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -78,7 +78,7 @@ static int stream_prepare(Job *job)
             }
         }
         bdrv_set_backing_hd(bs, base, &local_err);
-        ret = bdrv_change_backing_file(bs, base_id, base_fmt);
+        ret = bdrv_change_backing_file(bs, base_id, base_fmt, false);
         if (local_err) {
             error_report_err(local_err);
             return -EPERM;
diff --git a/blockdev.c b/blockdev.c
index 59b0b8ffaf..3848a9c8ab 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3416,7 +3416,8 @@ void qmp_change_backing_file(const char *device,
     }
 
     ret = bdrv_change_backing_file(image_bs, backing_file,
-                               image_bs->drv ? image_bs->drv->format_name : "");
+                                   image_bs->drv ? image_bs->drv->format_name : "",
+                                   false);
 
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not change backing file to '%s'",
diff --git a/include/block/block.h b/include/block/block.h
index bca3bb831c..6e36154061 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -405,8 +405,8 @@ void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
 void bdrv_refresh_limits(BlockDriverState *bs, Error **errp);
 int bdrv_commit(BlockDriverState *bs);
 int bdrv_make_empty(BdrvChild *c, Error **errp);
-int bdrv_change_backing_file(BlockDriverState *bs,
-    const char *backing_file, const char *backing_fmt);
+int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file,
+                             const char *backing_fmt, bool warn);
 void bdrv_register(BlockDriver *bdrv);
 int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base,
                            const char *backing_file_str);
diff --git a/qemu-img.c b/qemu-img.c
index 46d2796fb2..a6df64a949 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3797,9 +3797,9 @@ static int img_rebase(int argc, char **argv)
      * doesn't change when we switch the backing file.
      */
     if (out_baseimg && *out_baseimg) {
-        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt);
+        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, false);
     } else {
-        ret = bdrv_change_backing_file(bs, NULL, NULL);
+        ret = bdrv_change_backing_file(bs, NULL, NULL, false);
     }
 
     if (ret == -ENOSPC) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14772.36606 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtV-0003vR-EY; Thu, 29 Oct 2020 20:51:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14772.36606; Thu, 29 Oct 2020 20:51:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtV-0003vJ-BX; Thu, 29 Oct 2020 20:51:37 +0000
Received: by outflank-mailman (input) for mailman id 14772;
 Thu, 29 Oct 2020 20:51:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEtU-0003vB-Go
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aaa1904c-ec94-446a-b1b8-7fa4004e8e79;
 Thu, 29 Oct 2020 20:51:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtT-0006t8-2T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtT-0000un-1H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEtU-0003vB-Go
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:36 +0000
X-Inumbo-ID: aaa1904c-ec94-446a-b1b8-7fa4004e8e79
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aaa1904c-ec94-446a-b1b8-7fa4004e8e79;
	Thu, 29 Oct 2020 20:51:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y2sKR73mDorI26G0iMBtWxlvyffKeW6TviGwyJv3j40=; b=yXLHZjzeHnsOksiCt994NcdUT0
	99q20fNOPJeynXkAV/kwnYgJP3L34P29WVQpUN68+J9F0v8VZwj6GF92ypHowdfETORdDRGXIn6zo
	sdpioDYGhTuCSJCjuNL+J7szbPZVheJM5DsfSvZHRZ4wv4efII9R85naM769WdpNRyNg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtT-0006t8-2T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtT-0000un-1H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-img: Deprecate use of -b without -F
Message-Id: <E1kYEtT-0000un-1H@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:35 +0000

commit d9f059aa6cfccefaffa3532556e966df4a99ece2
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:54 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:24:05 2020 +0200

    qemu-img: Deprecate use of -b without -F
    
    Creating an image that requires format probing of the backing image is
    potentially unsafe (we've had several CVEs over the years based on
    probes leaking information to the guest on a subsequent boot, although
    these days tools like libvirt are aware of the issue enough to prevent
    the worst effects).  For example, if our probing algorithm ever
    changes, or if other tools like libvirt determine a different probe
    result than we do, then subsequent use of that backing file under a
    different format will present corrupted data to the guest.
    Fortunately, the worst effects occur only when the backing image is
    originally raw, and we at least prevent commit into a probed raw
    backing file that would change its probed type.
    
    Still, it is worth starting a deprecation clock so that future
    qemu-img can refuse to create backing chains that would rely on
    probing, to encourage clients to avoid unsafe practices.  Most
    warnings are intentionally emitted from bdrv_img_create() in the block
    layer, but qemu-img convert uses bdrv_create() which cannot emit its
    own warning without causing spurious warnings on other code paths.  In
    the end, all command-line image creation or backing file rewriting now
    performs a check.
    
    Furthermore, if we probe a backing file as non-raw, then it is safe to
    explicitly record that result (rather than relying on future probes);
    only where we probe a raw image do we care about further warnings to
    the user when using such an image (for example, commits into a
    probed-raw backing file are prevented), to help them improve their
    tooling.  But whether or not we make the probe results explicit, we
    still warn the user to remind them to upgrade their workflow to supply
    -F always.
    
    iotest 114 specifically wants to create an unsafe image for later
    amendment rather than defaulting to our new default of recording a
    probed format, so it needs an update.  While touching it, expand it to
    cover all of the various warnings enabled by this patch.  iotest 301
    also shows a change to qcow messages.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-11-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 27 ++++++++++++++++++++++++++-
 docs/system/deprecated.rst | 20 ++++++++++++++++++++
 qemu-img.c                 |  9 ++++++++-
 tests/qemu-iotests/114     | 14 ++++++++++++++
 tests/qemu-iotests/114.out |  9 +++++++++
 tests/qemu-iotests/301.out |  4 +++-
 6 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/block.c b/block.c
index 4acfebf0e8..35a372df57 100644
--- a/block.c
+++ b/block.c
@@ -6139,6 +6139,26 @@ void bdrv_img_create(const char *filename, const char *fmt,
             error_append_hint(&local_err, "Could not open backing image.\n");
             goto out;
         } else {
+            if (!backing_fmt) {
+                warn_report("Deprecated use of backing file without explicit "
+                            "backing format (detected format of %s)",
+                            bs->drv->format_name);
+                if (bs->drv != &bdrv_raw) {
+                    /*
+                     * A probe of raw deserves the most attention:
+                     * leaving the backing format out of the image
+                     * will ensure bs->probed is set (ensuring we
+                     * don't accidentally commit into the backing
+                     * file), and allow more spots to warn the users
+                     * to fix their toolchain when opening this image
+                     * later.  For other images, we can safely record
+                     * the format that we probed.
+                     */
+                    backing_fmt = bs->drv->format_name;
+                    qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, backing_fmt,
+                                 NULL);
+                }
+            }
             if (size == -1) {
                 /* Opened BS, have no size */
                 size = bdrv_getlength(bs);
@@ -6152,7 +6172,12 @@ void bdrv_img_create(const char *filename, const char *fmt,
             }
             bdrv_unref(bs);
         }
-    } /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */
+        /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */
+    } else if (backing_file && !backing_fmt) {
+        warn_report("Deprecated use of unopened backing file without "
+                    "explicit backing format, use of this image requires "
+                    "potentially unsafe format probing");
+    }
 
     if (size == -1) {
         error_setg(errp, "Image creation needs a size parameter");
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index c1f019b9d2..971b65be75 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -439,6 +439,26 @@ image).  Rather, any changes to the backing chain should be performed
 with ``qemu-img rebase -u`` either before or after the remaining
 changes being performed by amend, as appropriate.
 
+qemu-img backing file without format (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''
+
+The use of ``qemu-img create``, ``qemu-img rebase``, or ``qemu-img
+convert`` to create or modify an image that depends on a backing file
+now recommends that an explicit backing format be provided.  This is
+for safety: if QEMU probes a different format than what you thought,
+the data presented to the guest will be corrupt; similarly, presenting
+a raw image to a guest allows a potential security exploit if a future
+probe sees a non-raw image based on guest writes.
+
+To avoid the warning message, or even future refusal to create an
+unsafe image, you must pass ``-o backing_fmt=`` (or the shorthand
+``-F`` during create) to specify the intended backing format.  You may
+use ``qemu-img rebase -u`` to retroactively add a backing format to an
+existing image.  However, be aware that there are already potential
+security risks to blindly using ``qemu-img info`` to probe the format
+of an untrusted backing image, when deciding what format to add into
+an existing image.
+
 Backwards compatibility
 -----------------------
 
diff --git a/qemu-img.c b/qemu-img.c
index a6df64a949..efb6ca139e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2517,6 +2517,13 @@ static int img_convert(int argc, char **argv)
         goto out;
     }
 
+    if (out_baseimg_param) {
+        if (!qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT)) {
+            warn_report("Deprecated use of backing file without explicit "
+                        "backing format");
+        }
+    }
+
     /* Check if compression is supported */
     if (s.compressed) {
         bool encryption =
@@ -3797,7 +3804,7 @@ static int img_rebase(int argc, char **argv)
      * doesn't change when we switch the backing file.
      */
     if (out_baseimg && *out_baseimg) {
-        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, false);
+        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, true);
     } else {
         ret = bdrv_change_backing_file(bs, NULL, NULL, false);
     }
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
index 26104fff6c..5a7b0a4998 100755
--- a/tests/qemu-iotests/114
+++ b/tests/qemu-iotests/114
@@ -39,12 +39,21 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _unsupported_proto vxhs
+# At least OpenBSD doesn't seem to have truncate
+_supported_os Linux
 # qcow2.py does not work too well with external data files
 _unsupported_imgopts data_file
 
+# Intentionally specify backing file without backing format; demonstrate
+# the difference in warning messages when backing file could be probed.
+# Note that only a non-raw probe result will affect the resulting image.
+truncate -s $((64 * 1024 * 1024)) "$TEST_IMG.orig"
+_make_test_img -b "$TEST_IMG.orig" 64M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+$QEMU_IMG convert -O qcow2 -B "$TEST_IMG.orig" "$TEST_IMG.orig" "$TEST_IMG"
 _make_test_img -b "$TEST_IMG.base" 64M
+_make_test_img -u -b "$TEST_IMG.base" 64M
 
 # Set an invalid backing file format
 $PYTHON qcow2.py "$TEST_IMG" add-header-ext 0xE2792ACA "foo"
@@ -55,6 +64,11 @@ _img_info
 $QEMU_IO -c "open $TEST_IMG" -c "read 0 4k" 2>&1 | _filter_qemu_io | _filter_testdir
 $QEMU_IO -c "open -o backing.driver=$IMGFMT $TEST_IMG" -c "read 0 4k" | _filter_qemu_io
 
+# Rebase the image, to show that omitting backing format triggers a warning,
+# but probing now lets us use the backing file.
+$QEMU_IMG rebase -u -b "$TEST_IMG.base" "$TEST_IMG"
+$QEMU_IO -c "open $TEST_IMG" -c "read 0 4k" 2>&1 | _filter_qemu_io | _filter_testdir
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/114.out b/tests/qemu-iotests/114.out
index 67adef37a4..0a37d20c82 100644
--- a/tests/qemu-iotests/114.out
+++ b/tests/qemu-iotests/114.out
@@ -1,5 +1,11 @@
 QA output created by 114
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of raw)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+qemu-img: warning: Deprecated use of backing file without explicit backing format
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of IMGFMT)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+qemu-img: warning: Deprecated use of unopened backing file without explicit backing format, use of this image requires potentially unsafe format probing
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
@@ -11,4 +17,7 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknow
 no file open, try 'help open'
 read 4096/4096 bytes at offset 0
 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: warning: Deprecated use of backing file without explicit backing format, use of this image requires potentially unsafe format probing
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
index 281a16d87a..9004dad639 100644
--- a/tests/qemu-iotests/301.out
+++ b/tests/qemu-iotests/301.out
@@ -2,7 +2,8 @@ QA output created by 301
 
 == qcow backed by qcow ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of IMGFMT)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
 virtual size: 32 MiB (33554432 bytes)
@@ -35,6 +36,7 @@ cluster_size: 512
 backing file: TEST_DIR/t.IMGFMT.base
 
 == qcow backed by raw ==
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of raw)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14773.36610 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtf-0003wf-GB; Thu, 29 Oct 2020 20:51:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14773.36610; Thu, 29 Oct 2020 20:51:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtf-0003wW-D4; Thu, 29 Oct 2020 20:51:47 +0000
Received: by outflank-mailman (input) for mailman id 14773;
 Thu, 29 Oct 2020 20:51:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEte-0003wK-4U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7bc6a728-beff-4e0b-b5b4-6467b2968f26;
 Thu, 29 Oct 2020 20:51:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtd-0006tJ-6o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtd-0000vJ-5f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEte-0003wK-4U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:46 +0000
X-Inumbo-ID: 7bc6a728-beff-4e0b-b5b4-6467b2968f26
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7bc6a728-beff-4e0b-b5b4-6467b2968f26;
	Thu, 29 Oct 2020 20:51:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TCsOE2l1pF/dtYkg3HuDzXw1gjuW5LrpngCdHEfcTmg=; b=CFGh7yuT3lWP5bHzAkOktNrUsJ
	3OsFRyFbjebki3tVac3XOCBpE66+20EUlYBJsImpIQjPxu4bjiDeqRAw3l9G26+XG3wlKyLQCa1FJ
	pnaThBw9z2corbkPFTamNKbaoyZD6ahgwzQtDi0MODZH3rCUWmHxqHfkQvk77RtAthT0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtd-0006tJ-6o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtd-0000vJ-5f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Avoid stale pointer dereference in blk_get_aio_context()
Message-Id: <E1kYEtd-0000vJ-5f@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:45 +0000

commit e6cada9231af022ffc2e351c70dfaea8530496e1
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Thu Jul 9 15:50:45 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:24:15 2020 +0200

    block: Avoid stale pointer dereference in blk_get_aio_context()
    
    It is possible for blk_remove_bs() to race with blk_drain_all(), causing
    the latter to dereference a stale blk->root pointer:
    
      blk_remove_bs(blk)
       bdrv_root_unref_child(blk->root)
        child_bs = blk->root->bs
        bdrv_detach_child(blk->root)
         ...
         g_free(blk->root) <============== blk->root becomes stale
        bdrv_unref(child_bs) <============ yield at some point
    
    A blk_drain_all() can be triggered by some guest action in the
    meantime, eg. on POWER, SLOF might disable bus mastering on
    a virtio-scsi-pci device:
    
      virtio_write_config()
       virtio_pci_stop_ioeventfd()
        virtio_bus_stop_ioeventfd()
         virtio_scsi_dataplane_stop()
          blk_drain_all()
           blk_get_aio_context()
           bs = blk->root ? blk->root->bs : NULL
                ^^^^^^^^^
                  stale
    
    Then, depending on one's luck, QEMU either crashes with SEGV or
    hits the assertion in blk_get_aio_context().
    
    blk->root is set by blk_insert_bs() which calls bdrv_root_attach_child()
    first. The blk_remove_bs() function should rollback the changes made
    by blk_insert_bs() in the opposite order (or it should be documented
    somewhere why this isn't the case). Clear blk->root before calling
    bdrv_root_unref_child() in blk_remove_bs().
    
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159430264541.389456.11925072456012783045.stgit@bahia.lan>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/block-backend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index 6936b25c83..0bf0188133 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -808,6 +808,7 @@ void blk_remove_bs(BlockBackend *blk)
 {
     ThrottleGroupMember *tgm = &blk->public.throttle_group_member;
     BlockDriverState *bs;
+    BdrvChild *root;
 
     notifier_list_notify(&blk->remove_bs_notifiers, blk);
     if (tgm->throttle_state) {
@@ -825,8 +826,9 @@ void blk_remove_bs(BlockBackend *blk)
      * to avoid that and a potential QEMU crash.
      */
     blk_drain(blk);
-    bdrv_root_unref_child(blk->root);
+    root = blk->root;
     blk->root = NULL;
+    bdrv_root_unref_child(root);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:51:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14774.36615 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtq-0003xy-Ic; Thu, 29 Oct 2020 20:51:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14774.36615; Thu, 29 Oct 2020 20:51:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEtq-0003xp-Eg; Thu, 29 Oct 2020 20:51:58 +0000
Received: by outflank-mailman (input) for mailman id 14774;
 Thu, 29 Oct 2020 20:51:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEtp-0003xd-0n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9df5e92c-f29e-450b-a797-6126636d563a;
 Thu, 29 Oct 2020 20:51:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtn-0006tT-CF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtn-0000w7-BU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEtp-0003xd-0n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:57 +0000
X-Inumbo-ID: 9df5e92c-f29e-450b-a797-6126636d563a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9df5e92c-f29e-450b-a797-6126636d563a;
	Thu, 29 Oct 2020 20:51:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vCSbA7lvJGlfMsAOKOc44FiKv0Ifu18T+8x/DTO/jzk=; b=wysCLwCCQl/zCAtCROHzUOA8fd
	nHgVmh1LQsOJ71L5addSvs/Us98AebnfZQO87rvFiaMCQYhh+ymL7Lpp4Kt3lTItZE+i0yo7GYM8b
	WJbVV89o70yLQF0+USwlMxIhI1Uzi+ljXdyG+IpEgfWXT5hENiIHDHJzYnFTc6AUtCG8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtn-0006tT-CF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtn-0000w7-BU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:51:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYEtn-0000w7-BU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:51:55 +0000

commit d2628b1eb761a5fbf08f367da405eb3314a1f068
Merge: aeb07b5f6e69ce93afea71027325e3e7a22d2149 e6cada9231af022ffc2e351c70dfaea8530496e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 19:39:51 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 19:39:52 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Mitigate file fragmentation with extent size hints
    - Tighten qemu-img rules on missing backing format
    - qemu-img map: Don't limit block status request size
    - Fix crash with virtio-scsi and iothreads
    
    # gpg: Signature made Tue 14 Jul 2020 14:24:19 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      block: Avoid stale pointer dereference in blk_get_aio_context()
      qemu-img: Deprecate use of -b without -F
      block: Add support to warn on backing file change without format
      iotests: Specify explicit backing format where sensible
      qcow2: Deprecate use of qemu-img amend to change backing file
      block: Error if backing file fails during creation without -u
      qcow: Tolerate backing_fmt=
      vmdk: Add trivial backing_fmt support
      sheepdog: Add trivial backing_fmt support
      block: Finish deprecation of 'qemu-img convert -n -o'
      qemu-img: Flush stdout before before potential stderr messages
      file-posix: Mitigate file fragmentation with extent size hints
      iotests/059: Filter out disk size with more standard filter
      qemu-img map: Don't limit block status request size
      iotests: Simplify _filter_img_create() a bit
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block.c                          |   53 +-
 block/block-backend.c            |    4 +-
 block/file-posix.c               |   44 ++
 block/qcow.c                     |   20 +-
 block/qcow2.c                    |    7 +-
 block/sheepdog.c                 |   18 +-
 block/stream.c                   |    2 +-
 block/vmdk.c                     |   14 +
 blockdev.c                       |    3 +-
 docs/system/deprecated.rst       |   58 ++-
 docs/tools/qemu-img.rst          |    4 +
 include/block/block.h            |    4 +-
 include/block/block_int.h        |    1 +
 qapi/block-core.json             |   11 +-
 qemu-img.c                       |   20 +-
 tests/qemu-iotests/017           |    2 +-
 tests/qemu-iotests/017.out       |    2 +-
 tests/qemu-iotests/018           |    2 +-
 tests/qemu-iotests/018.out       |    2 +-
 tests/qemu-iotests/019           |    5 +-
 tests/qemu-iotests/019.out       |    2 +-
 tests/qemu-iotests/020           |   31 +-
 tests/qemu-iotests/020.out       |   15 +-
 tests/qemu-iotests/024           |   10 +-
 tests/qemu-iotests/024.out       |    4 +-
 tests/qemu-iotests/028           |    4 +-
 tests/qemu-iotests/028.out       |    2 +-
 tests/qemu-iotests/030           |   26 +-
 tests/qemu-iotests/034           |    2 +-
 tests/qemu-iotests/034.out       |    2 +-
 tests/qemu-iotests/037           |    2 +-
 tests/qemu-iotests/037.out       |    2 +-
 tests/qemu-iotests/038           |    2 +-
 tests/qemu-iotests/038.out       |    2 +-
 tests/qemu-iotests/039           |    3 +-
 tests/qemu-iotests/039.out       |    2 +-
 tests/qemu-iotests/040           |   47 +-
 tests/qemu-iotests/041           |   37 +-
 tests/qemu-iotests/042           |    4 +-
 tests/qemu-iotests/043           |   23 +-
 tests/qemu-iotests/043.out       |   12 +-
 tests/qemu-iotests/046           |    2 +-
 tests/qemu-iotests/046.out       |    2 +-
 tests/qemu-iotests/049.out       |    8 +-
 tests/qemu-iotests/050           |    4 +-
 tests/qemu-iotests/050.out       |    2 +-
 tests/qemu-iotests/051           |    2 +-
 tests/qemu-iotests/051.out       |    2 +-
 tests/qemu-iotests/051.pc.out    |    2 +-
 tests/qemu-iotests/054.out       |    2 +-
 tests/qemu-iotests/056           |    3 +-
 tests/qemu-iotests/059           |    2 +-
 tests/qemu-iotests/059.out       | 1009 +++++++++++++++++++-------------------
 tests/qemu-iotests/060           |    2 +-
 tests/qemu-iotests/060.out       |    2 +-
 tests/qemu-iotests/061           |   10 +-
 tests/qemu-iotests/061.out       |   11 +-
 tests/qemu-iotests/069           |    2 +-
 tests/qemu-iotests/069.out       |    2 +-
 tests/qemu-iotests/073           |    2 +-
 tests/qemu-iotests/073.out       |    2 +-
 tests/qemu-iotests/079.out       |    2 +-
 tests/qemu-iotests/082           |   10 +-
 tests/qemu-iotests/082.out       |   30 +-
 tests/qemu-iotests/085           |    4 +-
 tests/qemu-iotests/085.out       |    6 +-
 tests/qemu-iotests/089           |    2 +-
 tests/qemu-iotests/089.out       |    2 +-
 tests/qemu-iotests/095           |    4 +-
 tests/qemu-iotests/095.out       |    4 +-
 tests/qemu-iotests/097           |    4 +-
 tests/qemu-iotests/097.out       |   16 +-
 tests/qemu-iotests/098           |    2 +-
 tests/qemu-iotests/098.out       |    8 +-
 tests/qemu-iotests/106           |    7 +-
 tests/qemu-iotests/110           |    4 +-
 tests/qemu-iotests/110.out       |    4 +-
 tests/qemu-iotests/111.out       |    2 +-
 tests/qemu-iotests/112.out       |    4 +-
 tests/qemu-iotests/114           |   14 +
 tests/qemu-iotests/114.out       |    9 +
 tests/qemu-iotests/122           |   34 +-
 tests/qemu-iotests/122.out       |   12 +-
 tests/qemu-iotests/126           |    4 +-
 tests/qemu-iotests/126.out       |    4 +-
 tests/qemu-iotests/127           |    4 +-
 tests/qemu-iotests/127.out       |    4 +-
 tests/qemu-iotests/129           |    3 +-
 tests/qemu-iotests/133           |    2 +-
 tests/qemu-iotests/133.out       |    2 +-
 tests/qemu-iotests/139           |    2 +-
 tests/qemu-iotests/141           |    6 +-
 tests/qemu-iotests/141.out       |    4 +-
 tests/qemu-iotests/142           |    2 +-
 tests/qemu-iotests/142.out       |    2 +-
 tests/qemu-iotests/153           |   14 +-
 tests/qemu-iotests/153.out       |   35 +-
 tests/qemu-iotests/154           |   42 +-
 tests/qemu-iotests/154.out       |   42 +-
 tests/qemu-iotests/155           |   12 +-
 tests/qemu-iotests/156           |    9 +-
 tests/qemu-iotests/156.out       |    6 +-
 tests/qemu-iotests/158           |    2 +-
 tests/qemu-iotests/158.out       |    2 +-
 tests/qemu-iotests/161           |    8 +-
 tests/qemu-iotests/161.out       |    8 +-
 tests/qemu-iotests/175           |    6 +-
 tests/qemu-iotests/176           |    4 +-
 tests/qemu-iotests/176.out       |   32 +-
 tests/qemu-iotests/177           |    2 +-
 tests/qemu-iotests/177.out       |    2 +-
 tests/qemu-iotests/179           |    2 +-
 tests/qemu-iotests/179.out       |    2 +-
 tests/qemu-iotests/189           |    2 +-
 tests/qemu-iotests/189.out       |    2 +-
 tests/qemu-iotests/191           |   12 +-
 tests/qemu-iotests/191.out       |   12 +-
 tests/qemu-iotests/195           |    6 +-
 tests/qemu-iotests/195.out       |    6 +-
 tests/qemu-iotests/198           |    2 +-
 tests/qemu-iotests/198.out       |    3 +-
 tests/qemu-iotests/204           |    2 +-
 tests/qemu-iotests/204.out       |    2 +-
 tests/qemu-iotests/216           |    2 +-
 tests/qemu-iotests/224           |    4 +-
 tests/qemu-iotests/225           |    2 +-
 tests/qemu-iotests/225.out       |    2 +-
 tests/qemu-iotests/228           |    5 +-
 tests/qemu-iotests/243           |    7 +-
 tests/qemu-iotests/245           |    3 +-
 tests/qemu-iotests/249           |    4 +-
 tests/qemu-iotests/249.out       |    4 +-
 tests/qemu-iotests/252           |    2 +-
 tests/qemu-iotests/257           |    3 +-
 tests/qemu-iotests/259.out       |    2 +-
 tests/qemu-iotests/267           |    4 +-
 tests/qemu-iotests/267.out       |    6 +-
 tests/qemu-iotests/270           |    2 +-
 tests/qemu-iotests/270.out       |    2 +-
 tests/qemu-iotests/273           |    4 +-
 tests/qemu-iotests/273.out       |    4 +-
 tests/qemu-iotests/274           |   12 +-
 tests/qemu-iotests/274.out       |   29 +-
 tests/qemu-iotests/279           |    4 +-
 tests/qemu-iotests/279.out       |    4 +-
 tests/qemu-iotests/282.out       |    6 +-
 tests/qemu-iotests/290           |    2 +-
 tests/qemu-iotests/290.out       |    4 +-
 tests/qemu-iotests/301           |   88 ++++
 tests/qemu-iotests/301.out       |   59 +++
 tests/qemu-iotests/common.filter |   62 +--
 tests/qemu-iotests/group         |    1 +
 152 files changed, 1428 insertions(+), 990 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14775.36618 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEu0-00040G-L3; Thu, 29 Oct 2020 20:52:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14775.36618; Thu, 29 Oct 2020 20:52:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEu0-000408-Hi; Thu, 29 Oct 2020 20:52:08 +0000
Received: by outflank-mailman (input) for mailman id 14775;
 Thu, 29 Oct 2020 20:52:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEty-0003zx-Vl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96deb85b-73ad-4acd-94e7-2fc92c804ee7;
 Thu, 29 Oct 2020 20:52:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtx-0006uO-RQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEtx-0000xr-Qd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEty-0003zx-Vl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:07 +0000
X-Inumbo-ID: 96deb85b-73ad-4acd-94e7-2fc92c804ee7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96deb85b-73ad-4acd-94e7-2fc92c804ee7;
	Thu, 29 Oct 2020 20:52:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CJVBbu4+AYqoqeV1WHBuEKgKl+SxCkPh/E6RgtZr0pg=; b=n7LJJJwdsGmdT2P5/vNNJGw5oG
	/dGbZfGCmO2GYOBGon3SdhwnUaLUJQRFBqOzz11IjaVRxvv4mc/4oN+/VPth3Eo1lOWyDxYXN7KB2
	JRF76KD0sm4VklJZlPyI+cRSAX3Oa66sZRgRqEtP7KQgYx7WHfTns5uRbiXYEGfDRIqs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtx-0006uO-RQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEtx-0000xr-Qd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
Message-Id: <E1kYEtx-0000xr-Qd@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:05 +0000

commit 71e2443e4ca1540db63c0bbf58ae78944c97e993
Author:     Josh Kunz <jkz@google.com>
AuthorDate: Mon Jul 6 17:10:36 2020 -0700
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 20:47:57 2020 +0200

    linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
    
    Linux uses the EPROTONOSUPPORT error code[1] if the users requests a
    netlink socket with an unsupported netlink protocol. This change
    switches linux-user to use the same code as Linux, instead of
    EPFNOSUPPORT (which AFAIK is just an anachronistic version of
    EAFNOSUPPORT).
    
    Tested by compiling all linux-user targets on x86.
    
    [1]:
    https://github.com/torvalds/linux/blob/bfe91da29bfad9941d5d703d45e29f0812a20724/net/netlink/af_netlink.c#L683
    
    Signed-off-by: Josh Kunz <jkz@google.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200707001036.1671982-1-jkz@google.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 98ea86ca81..e9f53340cd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2990,7 +2990,7 @@ static abi_long do_socket(int domain, int type, int protocol)
 #endif
          protocol == NETLINK_KOBJECT_UEVENT ||
          protocol == NETLINK_AUDIT)) {
-        return -TARGET_EPFNOSUPPORT;
+        return -TARGET_EPROTONOSUPPORT;
     }
 
     if (domain == AF_PACKET ||
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14777.36634 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuA-00043o-UG; Thu, 29 Oct 2020 20:52:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14777.36634; Thu, 29 Oct 2020 20:52:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuA-00043f-RE; Thu, 29 Oct 2020 20:52:18 +0000
Received: by outflank-mailman (input) for mailman id 14777;
 Thu, 29 Oct 2020 20:52:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEu9-00042x-AK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ca5874fc-0b77-4d43-85c5-cd1ef1903f72;
 Thu, 29 Oct 2020 20:52:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEu8-0006ub-0F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEu7-0000yO-Uj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEu9-00042x-AK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:17 +0000
X-Inumbo-ID: ca5874fc-0b77-4d43-85c5-cd1ef1903f72
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ca5874fc-0b77-4d43-85c5-cd1ef1903f72;
	Thu, 29 Oct 2020 20:52:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KoyziOpvlSuZokKNMCIFjEQpiTF5KS12tKl4s/H0r0M=; b=cV/v+XajsqN1MEWvbRsQvwh6i9
	NhgELPIl2wchNtl2Eoa1EzcH5FYid8A3i3MN+oHY3ojnvsVzhdhG2Y0oSUQggiyfl7+xm5LNquD0b
	IUAmK39bO3IPiWXsRlHxmtd2O8azxVFBT08IywSpZjsXiDNIKpctXDzCM5YXS1cG0gnI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEu8-0006ub-0F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEu7-0000yO-Uj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: refactor ipc syscall and support of semtimedop syscall
Message-Id: <E1kYEu7-0000yO-Uj@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:15 +0000

commit d8c08b1e6c7b1a5be1ec70e339437823a41b1946
Author:     Matus Kysel <mkysel@tachyum.com>
AuthorDate: Fri Jun 26 14:46:11 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:21:02 2020 +0200

    linux-user: refactor ipc syscall and support of semtimedop syscall
    
    Refactoring ipc syscall for s390x and SPARC, so it matches glibc implementation
    
    We should add support of semtimedop syscall as new version of glibc
    2.31 uses semop based on semtimedop
    (commit: https://gitlab.com/freedesktop-sdk/mirrors/sourceware/glibc/-/commit/765cdd0bffd77960ae852104fc4ea5edcdb8aed3 ).
    
    Signed-off-by: Matus Kysel <mkysel@tachyum.com>
    Message-Id: <20200626124612.58593-2-mkysel@tachyum.com>
    Message-Id: <20200626124612.58593-3-mkysel@tachyum.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    [lv: merged PATCH 1 & 2 to avoid build break on PATCH 1]
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 77 insertions(+), 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e9f53340cd..1211e759c2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -817,9 +817,14 @@ safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
               const struct timespec *, req, struct timespec *, rem)
 #endif
 #ifdef __NR_ipc
+#ifdef __s390x__
+safe_syscall5(int, ipc, int, call, long, first, long, second, long, third,
+              void *, ptr)
+#else
 safe_syscall6(int, ipc, int, call, long, first, long, second, long, third,
               void *, ptr, long, fifth)
 #endif
+#endif
 #ifdef __NR_msgsnd
 safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz,
               int, flags)
@@ -1230,7 +1235,8 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr,
     defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \
     defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \
     defined(TARGET_NR_utimensat) || defined(TARGET_NR_mq_timedsend) || \
-    defined(TARGET_NR_mq_timedreceive)
+    defined(TARGET_NR_mq_timedreceive) || defined(TARGET_NR_ipc) || \
+    defined(TARGET_NR_semop) || defined(TARGET_NR_semtimedop)
 static inline abi_long target_to_host_timespec(struct timespec *host_ts,
                                                abi_ulong target_addr)
 {
@@ -3878,25 +3884,53 @@ static inline abi_long target_to_host_sembuf(struct sembuf *host_sembuf,
     return 0;
 }
 
-static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops)
+#if defined(TARGET_NR_ipc) || defined(TARGET_NR_semop) || \
+    defined(TARGET_NR_semtimedop)
+
+/*
+ * This macro is required to handle the s390 variants, which passes the
+ * arguments in a different order than default.
+ */
+#ifdef __s390x__
+#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
+  (__nsops), (__timeout), (__sops)
+#else
+#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
+  (__nsops), 0, (__sops), (__timeout)
+#endif
+
+static inline abi_long do_semtimedop(int semid,
+                                     abi_long ptr,
+                                     unsigned nsops,
+                                     abi_long timeout)
 {
     struct sembuf sops[nsops];
+    struct timespec ts, *pts = NULL;
     abi_long ret;
 
+    if (timeout) {
+        pts = &ts;
+        if (target_to_host_timespec(pts, timeout)) {
+            return -TARGET_EFAULT;
+        }
+    }
+
     if (target_to_host_sembuf(sops, ptr, nsops))
         return -TARGET_EFAULT;
 
     ret = -TARGET_ENOSYS;
 #ifdef __NR_semtimedop
-    ret = get_errno(safe_semtimedop(semid, sops, nsops, NULL));
+    ret = get_errno(safe_semtimedop(semid, sops, nsops, pts));
 #endif
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
-        ret = get_errno(safe_ipc(IPCOP_semtimedop, semid, nsops, 0, sops, 0));
+        ret = get_errno(safe_ipc(IPCOP_semtimedop, semid,
+                                 SEMTIMEDOP_IPC_ARGS(nsops, sops, (long)pts)));
     }
 #endif
     return ret;
 }
+#endif
 
 struct target_msqid_ds
 {
@@ -4056,8 +4090,13 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
 #endif
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
+#ifdef __s390x__
+        ret = get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg,
+                                 host_mb));
+#else
         ret = get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg,
                                  host_mb, 0));
+#endif
     }
 #endif
     g_free(host_mb);
@@ -4066,6 +4105,20 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
     return ret;
 }
 
+#ifdef __NR_ipc
+#if defined(__sparc__)
+/* SPARC for msgrcv it does not use the kludge on final 2 arguments.  */
+#define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp
+#elif defined(__s390x__)
+/* The s390 sys_ipc variant has only five parameters.  */
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+    ((long int[]){(long int)__msgp, __msgtyp})
+#else
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+    ((long int[]){(long int)__msgp, __msgtyp}), 0
+#endif
+#endif
+
 static inline abi_long do_msgrcv(int msqid, abi_long msgp,
                                  ssize_t msgsz, abi_long msgtyp,
                                  int msgflg)
@@ -4094,7 +4147,7 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
         ret = get_errno(safe_ipc(IPCOP_CALL(1, IPCOP_msgrcv), msqid, msgsz,
-                        msgflg, host_mb, msgtyp));
+                        msgflg, MSGRCV_ARGS(host_mb, msgtyp)));
     }
 #endif
 
@@ -4372,7 +4425,20 @@ static abi_long do_ipc(CPUArchState *cpu_env,
 
     switch (call) {
     case IPCOP_semop:
-        ret = do_semop(first, ptr, second);
+        ret = do_semtimedop(first, ptr, second, 0);
+        break;
+    case IPCOP_semtimedop:
+    /*
+     * The s390 sys_ipc variant has only five parameters instead of six
+     * (as for default variant) and the only difference is the handling of
+     * SEMTIMEDOP where on s390 the third parameter is used as a pointer
+     * to a struct timespec where the generic variant uses fifth parameter.
+     */
+#if defined(TARGET_S390X)
+        ret = do_semtimedop(first, ptr, second, third);
+#else
+        ret = do_semtimedop(first, ptr, second, fifth);
+#endif
         break;
 
     case IPCOP_semget:
@@ -9684,7 +9750,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_semop
     case TARGET_NR_semop:
-        return do_semop(arg1, arg2, arg3);
+        return do_semtimedop(arg1, arg2, arg3, 0);
+#endif
+#ifdef TARGET_NR_semtimedop
+    case TARGET_NR_semtimedop:
+        return do_semtimedop(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_semctl
     case TARGET_NR_semctl:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14779.36637 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuK-000474-Vk; Thu, 29 Oct 2020 20:52:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14779.36637; Thu, 29 Oct 2020 20:52:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuK-00046x-So; Thu, 29 Oct 2020 20:52:28 +0000
Received: by outflank-mailman (input) for mailman id 14779;
 Thu, 29 Oct 2020 20:52:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEuJ-00046L-14
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7b30241d-827d-416c-84c8-60d225b3c97c;
 Thu, 29 Oct 2020 20:52:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuI-0006ul-44
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuI-0000yw-3G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEuJ-00046L-14
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:27 +0000
X-Inumbo-ID: 7b30241d-827d-416c-84c8-60d225b3c97c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7b30241d-827d-416c-84c8-60d225b3c97c;
	Thu, 29 Oct 2020 20:52:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0fKTnjYgByVJFRiCrzuIakiMaeeSwl1lxW815WYX0qw=; b=TqeIo7ZB0lBb2tqYynDy/M01sj
	L9tIdI3zLC7NivCs2H2PrHJiR+G7CXulCxpSTMLttC13Cn2QVpMbuUSt6Maoqu6cdFigLKMI42uli
	RNBv2KXe0ZtpS1wiPseYUFQK0z4tmG9D8joB7Kdib8HAjun5lPWdItjlSZjQnn/Prmv8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuI-0006ul-44
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuI-0000yw-3G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: Fix Coverity CID 1430271 / CID 1430272
Message-Id: <E1kYEuI-0000yw-3G@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:26 +0000

commit 4c1850c130a31e6f3cc896a5ba5fb7a602540bc9
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 21:22:17 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:22:08 2020 +0200

    linux-user: Fix Coverity CID 1430271 / CID 1430272
    
    In new functions print_ioctl() and print_syscall_ret_ioctl(), we don't
    check if lock_user() returns NULL and this would cause a segfault in
    thunk_print().
    
    If lock_user() returns NULL don't call thunk_print() but prints only the
    value of the (invalid) pointer.
    
    Tested with:
    
        # cat ioctl.c
        #include <unistd.h>
        #include <sys/ioctl.h>
    
        int main(void)
        {
            int ret;
    
            ret = ioctl(STDOUT_FILENO, TCGETS, 0xdeadbeef);
            ret = ioctl(STDOUT_FILENO, TCSETSF, 0xdeadbeef);
            return 0;
        }
        # QEMU_STRACE= ./ioctl
        ...
        578 ioctl(1,TCGETS,0xdeadbeef) = -1 errno=2 (Bad address)
        578 ioctl(1,TCSETSF,0xdeadbeef) = -1 errno=2 (Bad address)
        ...
        # QEMU_STRACE= passwd
        ...
        623 ioctl(0,TCGETS,0x3fffed04) = 0 ({})
        623 ioctl(0,TCSETSF,{}) = 0
        ...
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Fixes: 79482e5987c8 ("linux-user: Add strace support for printing arguments of ioctl()")
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/strace.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5235b2260c..39554d9039 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -889,8 +889,12 @@ print_syscall_ret_ioctl(const struct syscallname *name, abi_long ret,
             arg_type++;
             target_size = thunk_type_size(arg_type, 0);
             argptr = lock_user(VERIFY_READ, arg2, target_size, 1);
-            thunk_print(argptr, arg_type);
-            unlock_user(argptr, arg2, target_size);
+            if (argptr) {
+                thunk_print(argptr, arg_type);
+                unlock_user(argptr, arg2, target_size);
+            } else {
+                print_pointer(arg2, 1);
+            }
             qemu_log(")");
         }
     }
@@ -3119,8 +3123,12 @@ print_ioctl(const struct syscallname *name,
                     arg_type++;
                     target_size = thunk_type_size(arg_type, 0);
                     argptr = lock_user(VERIFY_READ, arg2, target_size, 1);
-                    thunk_print(argptr, arg_type);
-                    unlock_user(argptr, arg2, target_size);
+                    if (argptr) {
+                        thunk_print(argptr, arg_type);
+                        unlock_user(argptr, arg2, target_size);
+                    } else {
+                        print_pointer(arg2, 1);
+                    }
                     break;
                 }
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14782.36642 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuU-00049e-1p; Thu, 29 Oct 2020 20:52:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14782.36642; Thu, 29 Oct 2020 20:52:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuT-00049Y-UZ; Thu, 29 Oct 2020 20:52:37 +0000
Received: by outflank-mailman (input) for mailman id 14782;
 Thu, 29 Oct 2020 20:52:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEuS-00049H-W7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b9a585b9-1e5c-4f70-ba58-28e88490b30a;
 Thu, 29 Oct 2020 20:52:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuS-0006wO-8M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuS-000118-6q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEuS-00049H-W7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:37 +0000
X-Inumbo-ID: b9a585b9-1e5c-4f70-ba58-28e88490b30a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b9a585b9-1e5c-4f70-ba58-28e88490b30a;
	Thu, 29 Oct 2020 20:52:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1WHTX/KIbzo+7ezRxd67E6UNrVdJ/Da9gzBkblxRUKI=; b=FxShmIGi4SWFx84iDoI33248is
	hyD6i5VRaQebWaJXZQWq4jhbbJJTNRzf302NBrIWifGVDtZQcmImtL7IU968VywNjVSsNnItpltbL
	ngKkRue58YXrWFktK21h/MYwFupeOdo6y4Mhs49JoIHNp0xCrkwieFQi0k3CjYHlCEaQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuS-0006wO-8M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuS-000118-6q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: add new netlink types
Message-Id: <E1kYEuS-000118-6q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:36 +0000

commit d9679ee592dd181854a39ed05db4038c0a6bbf80
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 09:23:31 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:25:33 2020 +0200

    linux-user: add new netlink types
    
    Only implement IFLA_PERM_ADDRESS to fix the following error:
    
      Unknown host QEMU_IFLA type: 54
    
    The couple of other ones, IFLA_PROP_LIST and IFLA_ALT_IFNAME, have
    been introduced to be used with RTM_NEWLINKPROP, RTM_DELLINKPROP and
    RTM_GETLINKPROP that are not implemented by QEMU.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200709072332.890440-1-laurent@vivier.eu>
---
 linux-user/fd-trans.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index c0687c52e6..5d49a53552 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -133,6 +133,9 @@ enum {
     QEMU_IFLA_NEW_IFINDEX,
     QEMU_IFLA_MIN_MTU,
     QEMU_IFLA_MAX_MTU,
+    QEMU_IFLA_PROP_LIST,
+    QEMU_IFLA_ALT_IFNAME,
+    QEMU_IFLA_PERM_ADDRESS,
     QEMU___IFLA_MAX
 };
 
@@ -807,6 +810,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
     /* binary stream */
     case QEMU_IFLA_ADDRESS:
     case QEMU_IFLA_BROADCAST:
+    case QEMU_IFLA_PERM_ADDRESS:
     /* string */
     case QEMU_IFLA_IFNAME:
     case QEMU_IFLA_QDISC:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14784.36647 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEue-0004BU-3S; Thu, 29 Oct 2020 20:52:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14784.36647; Thu, 29 Oct 2020 20:52:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEud-0004BL-W6; Thu, 29 Oct 2020 20:52:47 +0000
Received: by outflank-mailman (input) for mailman id 14784;
 Thu, 29 Oct 2020 20:52:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEud-0004B8-7S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a900b7ec-3cd2-4559-84ef-cc77c0d1b95a;
 Thu, 29 Oct 2020 20:52:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuc-0006wW-CH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuc-00011e-B8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEud-0004B8-7S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:47 +0000
X-Inumbo-ID: a900b7ec-3cd2-4559-84ef-cc77c0d1b95a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a900b7ec-3cd2-4559-84ef-cc77c0d1b95a;
	Thu, 29 Oct 2020 20:52:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TmSvrM0KbIA1MAXCNWPfbFBt+DHFK9YTQWkVPrHM4F0=; b=GH5nBwpvGAa8xpqI3I+wDVhyQZ
	w90LaySG1ln4YnJmbuk60klbeZzu0eAt5xBKCgsZH/xg6dDF65OPh3yjBbDXVElHsBNgqI5MKDsz+
	NodeCS6n1+VvrfId5GCzgdexA+4H2QIlNQCb/iqo7sdI15FRhoIGsWFn17XHNxOcnWG8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuc-0006wW-CH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuc-00011e-B8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: add netlink RTM_SETLINK command
Message-Id: <E1kYEuc-00011e-B8@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:46 +0000

commit 65b261a63a48fbb3b11193361d4ea0c38a3c3dfd
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 09:23:32 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:26:33 2020 +0200

    linux-user: add netlink RTM_SETLINK command
    
    This command is needed to be able to boot systemd in a container.
    
      $ sudo systemd-nspawn -D /chroot/armhf/sid/ -b
      Spawning container sid on /chroot/armhf/sid.
      Press ^] three times within 1s to kill container.
      systemd 245.6-2 running in system mode.
      Detected virtualization systemd-nspawn.
      Detected architecture arm.
    
      Welcome to Debian GNU/Linux bullseye/sid!
    
      Set hostname to <virt-arm>.
      Failed to enqueue loopback interface start request: Operation not supported
      Caught <SEGV>, dumped core as pid 3.
      Exiting PID 1...
      Container sid failed with error code 255.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200709072332.890440-2-laurent@vivier.eu>
---
 linux-user/fd-trans.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index 5d49a53552..1486c81aaa 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -1204,6 +1204,7 @@ static abi_long target_to_host_data_route(struct nlmsghdr *nlh)
         break;
     case RTM_NEWLINK:
     case RTM_DELLINK:
+    case RTM_SETLINK:
         if (nlh->nlmsg_len >= NLMSG_LENGTH(sizeof(*ifi))) {
             ifi = NLMSG_DATA(nlh);
             ifi->ifi_type = tswap16(ifi->ifi_type);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:52:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:52:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14785.36650 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuo-0004EW-4L; Thu, 29 Oct 2020 20:52:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14785.36650; Thu, 29 Oct 2020 20:52:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuo-0004EO-1P; Thu, 29 Oct 2020 20:52:58 +0000
Received: by outflank-mailman (input) for mailman id 14785;
 Thu, 29 Oct 2020 20:52:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEun-0004Db-8T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 467dd14a-dd13-46aa-b492-ce8acd7cd08a;
 Thu, 29 Oct 2020 20:52:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEum-0006wd-Fm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEum-00012Q-F5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEun-0004Db-8T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:57 +0000
X-Inumbo-ID: 467dd14a-dd13-46aa-b492-ce8acd7cd08a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 467dd14a-dd13-46aa-b492-ce8acd7cd08a;
	Thu, 29 Oct 2020 20:52:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tCFkfpmK7ngTQtnf/a5wSeNM5Q5orcXSL7alCtCjaSE=; b=NCQhXPqY+J1h8U/qP1jLXDtAxD
	Oy5Lt7GEIgKmz+f0wy+9UyhBo7iN8FGhnilAGpvGjI1Bx9u91DCwUQnvdAsGw0B0p85izvLBPM4wo
	eX+n3qEWlq9PBiAJSoZoWCv5WPp9r/3N5+oStUagIxZzi/AH02fn14J0q1qA7WQsS2Jg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEum-0006wd-Fm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEum-00012Q-F5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:52:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: fix the errno value in print_syscall_err()
Message-Id: <E1kYEum-00012Q-F5@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:52:56 +0000

commit 6733d57035d1c4a67070b8d737334c28e5c63bc6
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Wed Jul 8 17:24:34 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 14 09:29:14 2020 +0200

    linux-user: fix the errno value in print_syscall_err()
    
    errno of the target is returned as a negative value by the syscall,
    not in the host errno variable.
    
    The emulation of the target syscall can return an error while the
    host doesn't set an errno value. Target errnos and host errnos can
    also differ in some cases.
    
    Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument printing after syscall execution")
    Cc: Filip.Bozuta@syrmia.com
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
    Message-Id: <20200708152435.706070-2-laurent@vivier.eu>
---
 linux-user/strace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 39554d9039..7769f53bd5 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -731,7 +731,7 @@ print_syscall_err(abi_long ret)
 
     qemu_log(" = ");
     if (ret < 0) {
-        qemu_log("-1 errno=%d", errno);
+        qemu_log("-1 errno=%d", (int)-ret);
         errstr = target_strerror(-ret);
         if (errstr) {
             qemu_log(" (%s)", errstr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14786.36653 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuy-0004Gm-77; Thu, 29 Oct 2020 20:53:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14786.36653; Thu, 29 Oct 2020 20:53:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEuy-0004Gd-4J; Thu, 29 Oct 2020 20:53:08 +0000
Received: by outflank-mailman (input) for mailman id 14786;
 Thu, 29 Oct 2020 20:53:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEux-0004GV-Nz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id dea54ff7-50a5-4003-ab08-7ca9eb217edb;
 Thu, 29 Oct 2020 20:53:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuw-0006xc-JU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEuw-00013T-In
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEux-0004GV-Nz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:07 +0000
X-Inumbo-ID: dea54ff7-50a5-4003-ab08-7ca9eb217edb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id dea54ff7-50a5-4003-ab08-7ca9eb217edb;
	Thu, 29 Oct 2020 20:53:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tNnyfnBYWORbPFdchBlqmF/kI9d/ym2966+FaSeKTKc=; b=m4JDO6TlyBmtOTHvv1pLJfNhwf
	jsLS06YtwLRBm/k/ljbksqxrMl7dU4nTO5xIA5mnElwE52pY6/L+mM7aqMCm3HM4iSgotVVy3HBxp
	WcfVZ6cYf7h7FW2yQjfchfQjtwQzDDfk8Ii+HH+Dtg9/h+2tk2azw1sxjndThBaFXK6c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuw-0006xc-JU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEuw-00013T-In
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: fix print_syscall_err() when syscall returned value is negative
Message-Id: <E1kYEuw-00013T-In@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:06 +0000

commit 42b16184d016d48d167229a1ddb89b3671c77440
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Wed Jul 8 17:24:35 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 14 09:29:14 2020 +0200

    linux-user: fix print_syscall_err() when syscall returned value is negative
    
    print_syscall_err() relies on the sign of the returned value to know
    if it is an errno value or not.
    
    But in some cases the returned value can have the most signicant bit
    set without being an errno.
    
    This patch restores previous behaviour that was also checking if
    we can decode the errno to validate it.
    
    This patch fixes this kind of problem (qemu-m68k):
    
      root@sid:/# QEMU_STRACE= ls
      3 brk(NULL) = -1 errno=21473607683 uname(0x407fff8a) = 0
    
    to become:
    
      root@sid:/# QEMU_STRACE= ls
      3 brk(NULL) = 0x8001e000
      3 uname(0xffffdf8a) = 0
    
    Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument printing after syscall execution")
    Cc: Filip.Bozuta@syrmia.com
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200708152435.706070-3-laurent@vivier.eu>
---
 linux-user/strace.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 7769f53bd5..13981341b3 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -724,19 +724,20 @@ print_ipc(const struct syscallname *name,
  * Variants for the return value output function
  */
 
-static void
+static bool
 print_syscall_err(abi_long ret)
 {
-    const char *errstr = NULL;
+    const char *errstr;
 
     qemu_log(" = ");
     if (ret < 0) {
-        qemu_log("-1 errno=%d", (int)-ret);
         errstr = target_strerror(-ret);
         if (errstr) {
-            qemu_log(" (%s)", errstr);
+            qemu_log("-1 errno=%d (%s)", (int)-ret, errstr);
+            return true;
         }
     }
+    return false;
 }
 
 static void
@@ -744,11 +745,10 @@ print_syscall_ret_addr(const struct syscallname *name, abi_long ret,
                        abi_long arg0, abi_long arg1, abi_long arg2,
                        abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
-        qemu_log("0x" TARGET_ABI_FMT_lx "\n", ret);
+    if (!print_syscall_err(ret)) {
+        qemu_log("0x" TARGET_ABI_FMT_lx, ret);
     }
+    qemu_log("\n");
 }
 
 #if 0 /* currently unused */
@@ -765,9 +765,7 @@ print_syscall_ret_newselect(const struct syscallname *name, abi_long ret,
                             abi_long arg0, abi_long arg1, abi_long arg2,
                             abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(" = 0x" TARGET_ABI_FMT_lx " (", ret);
         print_fdset(arg0, arg1);
         qemu_log(",");
@@ -796,9 +794,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret,
                            abi_long arg0, abi_long arg1, abi_long arg2,
                            abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
         switch (ret) {
         case TARGET_TIME_OK:
@@ -833,9 +829,7 @@ print_syscall_ret_listxattr(const struct syscallname *name, abi_long ret,
                             abi_long arg0, abi_long arg1, abi_long arg2,
                             abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
         qemu_log(" (list = ");
         if (arg1 != 0) {
@@ -866,9 +860,7 @@ print_syscall_ret_ioctl(const struct syscallname *name, abi_long ret,
                         abi_long arg0, abi_long arg1, abi_long arg2,
                         abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
 
         const IOCTLEntry *ie;
@@ -3197,9 +3189,7 @@ print_syscall_ret(int num, abi_long ret,
                                   arg1, arg2, arg3,
                                   arg4, arg5, arg6);
             } else {
-                print_syscall_err(ret);
-
-                if (ret >= 0) {
+                if (!print_syscall_err(ret)) {
                     qemu_log(TARGET_ABI_FMT_ld, ret);
                 }
                 qemu_log("\n");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14787.36657 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEv8-0004KL-8n; Thu, 29 Oct 2020 20:53:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14787.36657; Thu, 29 Oct 2020 20:53:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEv8-0004KE-61; Thu, 29 Oct 2020 20:53:18 +0000
Received: by outflank-mailman (input) for mailman id 14787;
 Thu, 29 Oct 2020 20:53:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEv7-0004K6-FG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3f8b71d1-2db7-4c5f-9c09-996304166d35;
 Thu, 29 Oct 2020 20:53:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEv6-0006xk-NZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEv6-000148-Mh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEv7-0004K6-FG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:17 +0000
X-Inumbo-ID: 3f8b71d1-2db7-4c5f-9c09-996304166d35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3f8b71d1-2db7-4c5f-9c09-996304166d35;
	Thu, 29 Oct 2020 20:53:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bke4f6TismFJ4VM14SPBl6ssG2DxbIMP/bBSL3AgWlg=; b=HrqIK2UhOOLLziOKbZ33AKYF1O
	EZiI62mC55D6GKlEgasp0icmI7VQgGZ3lJwGgWJ6rEX2pJlDgISLIlX5akoTCM0a0BA2ltRz8ioQD
	dX+JQ/IclSiCPUKiQHyRA2hQ4TezDiPBexVK2asjg+eQ+UQ5zgUDzk90teya1Z+dDevk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEv6-0006xk-NZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEv6-000148-Mh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
Message-Id: <E1kYEv6-000148-Mh@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:16 +0000

commit 8bfa25a46ff1082f75e7052875b5d435119dcf49
Merge: d2628b1eb761a5fbf08f367da405eb3314a1f068 42b16184d016d48d167229a1ddb89b3671c77440
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 20:24:00 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 20:24:00 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
    
    linux-user branch 20200714
    
    Fix strace errno management
    Fix Coverity erros in ioctl straces
    Fix some netlinks errors
    Fix semtimedop
    
    # gpg: Signature made Tue 14 Jul 2020 08:31:56 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/linux-user-for-5.1-pull-request:
      linux-user: fix print_syscall_err() when syscall returned value is negative
      linux-user: fix the errno value in print_syscall_err()
      linux-user: add netlink RTM_SETLINK command
      linux-user: add new netlink types
      linux-user: Fix Coverity CID 1430271 / CID 1430272
      linux-user: refactor ipc syscall and support of semtimedop syscall
      linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 linux-user/fd-trans.c |  5 +++
 linux-user/strace.c   | 52 +++++++++++++++----------------
 linux-user/syscall.c  | 86 ++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 108 insertions(+), 35 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14788.36663 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvJ-0004M1-BK; Thu, 29 Oct 2020 20:53:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14788.36663; Thu, 29 Oct 2020 20:53:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvJ-0004Lp-7i; Thu, 29 Oct 2020 20:53:29 +0000
Received: by outflank-mailman (input) for mailman id 14788;
 Thu, 29 Oct 2020 20:53:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEvH-0004Lb-UX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3531ea9b-2dd7-48fb-bf72-7f93a17ba058;
 Thu, 29 Oct 2020 20:53:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvH-0006xw-3b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvH-00015F-2q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEvH-0004Lb-UX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
X-Inumbo-ID: 3531ea9b-2dd7-48fb-bf72-7f93a17ba058
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3531ea9b-2dd7-48fb-bf72-7f93a17ba058;
	Thu, 29 Oct 2020 20:53:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jvk1ExqcIlzH9ugcokcSv2YTSg64qR7IqEDUojsP1QE=; b=IBx+uu6kRGw3a0FCMWLVi6Kp2s
	1xpsFCafbnCHH9a816g9Rua78+Dmuf3C9boctPX6MkquoQQ6pOfl+VEzBJLaTlmgDrJHSoXjJ6Dcg
	4jzRk25P41VV4VMF/xpEFA9hNbN2CfskG5hwB+3Ut1qlk6mfezKYVJyyVnuO+AlFLdKo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvH-0006xw-3b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvH-00015F-2q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qga-win: Fix QGA VSS Provider service stop failure
Message-Id: <E1kYEvH-00015F-2q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:27 +0000

commit 917ebcb170273913bca33d44263bc5fd14f72fd7
Author:     Basil Salman <bsalman@redhat.com>
AuthorDate: Mon Jul 6 18:50:39 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:13:14 2020 -0500

    qga-win: Fix QGA VSS Provider service stop failure
    
    On one hand "guest-fsfreeze-freeze" command, "COM+ System Application service" is
    stopped, on the other hand "guest-fsfreeze-thaw" stops QGA VSS Provider service from
    "COM+ Application Admin Catalog".
    Invoking a series of freeze and thaw commands may result in QGA failing to stop
    VSS Provider service as "COM+ System Application service" is stopped, which can
    cause some delay in qga response.
    In this commit StopService function was changed and VSS Provider service is now
    stopped using Winsvc library API.
    
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1549425
    
    Signed-off-by: Basil Salman <bsalman@redhat.com>
    Signed-off-by: Basil Salman <basil@daynix.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/install.cpp | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index a456841360..40de133774 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -19,6 +19,7 @@
 #include <comdef.h>
 #include <comutil.h>
 #include <sddl.h>
+#include <winsvc.h>
 
 #define BUFFER_SIZE 1024
 
@@ -509,26 +510,32 @@ namespace _com_util
     }
 }
 
-/* Stop QGA VSS provider service from COM+ Application Admin Catalog */
-
+/* Stop QGA VSS provider service using Winsvc API  */
 STDAPI StopService(void)
 {
     HRESULT hr;
-    COMInitializer initializer;
-    COMPointer<IUnknown> pUnknown;
-    COMPointer<ICOMAdminCatalog2> pCatalog;
+    SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
+    SC_HANDLE service = NULL;
 
-    int count = 0;
+    if (!manager) {
+        errmsg(E_FAIL, "Failed to open service manager");
+        hr = E_FAIL;
+        goto out;
+    }
+    service = OpenService(manager, QGA_PROVIDER_NAME, SC_MANAGER_ALL_ACCESS);
 
-    chk(QGAProviderFind(QGAProviderCount, (void *)&count));
-    if (count) {
-        chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER,
-            IID_IUnknown, (void **)pUnknown.replace()));
-        chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2,
-            (void **)pCatalog.replace()));
-        chk(pCatalog->ShutdownApplication(_bstr_t(QGA_PROVIDER_LNAME)));
+    if (!service) {
+        errmsg(E_FAIL, "Failed to open service");
+        hr =  E_FAIL;
+        goto out;
+    }
+    if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) {
+        errmsg(E_FAIL, "Failed to stop service");
+        hr = E_FAIL;
     }
 
 out:
+    CloseServiceHandle(service);
+    CloseServiceHandle(manager);
     return hr;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14789.36667 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvT-0004NE-CZ; Thu, 29 Oct 2020 20:53:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14789.36667; Thu, 29 Oct 2020 20:53:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvT-0004N5-9L; Thu, 29 Oct 2020 20:53:39 +0000
Received: by outflank-mailman (input) for mailman id 14789;
 Thu, 29 Oct 2020 20:53:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEvR-0004Mv-UE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b992234b-b492-4ae9-b264-b184be523d07;
 Thu, 29 Oct 2020 20:53:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvR-0006y3-74
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvR-00016I-6K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEvR-0004Mv-UE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
X-Inumbo-ID: b992234b-b492-4ae9-b264-b184be523d07
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b992234b-b492-4ae9-b264-b184be523d07;
	Thu, 29 Oct 2020 20:53:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/5PZI7DsKwhdK9IrAoU9yk5DBbPcBhppuBr5w0sGwjY=; b=HLGvWz/tjxFmoIOMAoLgx35Nhl
	db4B071OFGmyd79D2a90Aes5YU0NFXopW8XSdSEIK7Z+5dbV7vw0n2DMGLU6i76SpIKzyUkqK4A2e
	XTk+buH5aTeHCoG1gKygmxIrkvLecE3l8m2hltEM7vdSJ7jC8RPfKyY7MD4a7mOQ+NG4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvR-0006y3-74
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvR-00016I-6K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qga: fix assert regression on guest-shutdown
Message-Id: <E1kYEvR-00016I-6K@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:37 +0000

commit 844bd70b5652f30bbace89499f513e3fbbb6457a
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Thu Jun 4 11:44:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:17:08 2020 -0500

    qga: fix assert regression on guest-shutdown
    
    Since commit 781f2b3d1e ("qga: process_event() simplification"),
    send_response() is called unconditionally, but will assert when "rsp" is
    NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as
    "guest-shutdown".
    
    Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35
    Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index f0e454f28d..3febf3b0fd 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp)
     QString *payload_qstr, *response_qstr;
     GIOStatus status;
 
-    g_assert(rsp && s->channel);
+    g_assert(s->channel);
+
+    if (!rsp) {
+        return 0;
+    }
 
     payload_qstr = qobject_to_json(QOBJECT(rsp));
     if (!payload_qstr) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14790.36670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvd-0004Od-ED; Thu, 29 Oct 2020 20:53:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14790.36670; Thu, 29 Oct 2020 20:53:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvd-0004OU-Ax; Thu, 29 Oct 2020 20:53:49 +0000
Received: by outflank-mailman (input) for mailman id 14790;
 Thu, 29 Oct 2020 20:53:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEvc-0004OG-7I
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8eeb6b9d-4bce-4784-b83e-d152e4a01697;
 Thu, 29 Oct 2020 20:53:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvb-0006yF-Bi
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvb-00017I-9x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEvc-0004OG-7I
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:48 +0000
X-Inumbo-ID: 8eeb6b9d-4bce-4784-b83e-d152e4a01697
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8eeb6b9d-4bce-4784-b83e-d152e4a01697;
	Thu, 29 Oct 2020 20:53:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tzUSzWM71J0wU5g0IvjzQq61Hsm1Gq1ypke6P+xEKS8=; b=r8v9KeGQiwRa7py2Hb1Q85mlOq
	Rl9COYO6i5e32hPVQjuYoZxRUlR6jvuU5ZBHUbC+fZJfe3BfRUZRgrZzE/i7NfB/+gP7QJFPsPVW+
	1BkLOPNjHa9uWNtSpYPH99qy4CrlhIINNWB/+Rwl+dYloQDpGihIpTx4maGeFzJSE4Tc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvb-0006yF-Bi
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvb-00017I-9x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] util: Introduce qemu_get_host_name()
Message-Id: <E1kYEvb-00017I-9x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:47 +0000

commit e47f4765afcab2b78dfa5b0115abf64d1d49a5d3
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:44:58 2020 -0500

    util: Introduce qemu_get_host_name()
    
    This function offers operating system agnostic way to fetch host
    name. It is implemented for both POSIX-like and Windows systems.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/qemu/osdep.h | 10 ++++++++++
 util/oslib-posix.c   | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c   | 13 +++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 979a403984..4841b5c6b5 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -655,4 +655,14 @@ static inline void qemu_reset_optind(void)
 #endif
 }
 
+/**
+ * qemu_get_host_name:
+ * @errp: Error object
+ *
+ * Operating system agnostic way of querying host name.
+ *
+ * Returns allocated hostname (caller should free), NULL on failure.
+ */
+char *qemu_get_host_name(Error **errp);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 72907d4d7f..e60aea85b6 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -794,3 +794,38 @@ void sigaction_invoke(struct sigaction *action,
     }
     action->sa_sigaction(info->ssi_signo, &si, NULL);
 }
+
+#ifndef HOST_NAME_MAX
+# ifdef _POSIX_HOST_NAME_MAX
+#  define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+# else
+#  define HOST_NAME_MAX 255
+# endif
+#endif
+
+char *qemu_get_host_name(Error **errp)
+{
+    long len = -1;
+    g_autofree char *hostname = NULL;
+
+#ifdef _SC_HOST_NAME_MAX
+    len = sysconf(_SC_HOST_NAME_MAX);
+#endif /* _SC_HOST_NAME_MAX */
+
+    if (len < 0) {
+        len = HOST_NAME_MAX;
+    }
+
+    /* Unfortunately, gethostname() below does not guarantee a
+     * NULL terminated string. Therefore, allocate one byte more
+     * to be sure. */
+    hostname = g_new0(char, len + 1);
+
+    if (gethostname(hostname, len) < 0) {
+        error_setg_errno(errp, errno,
+                         "cannot get hostname");
+        return NULL;
+    }
+
+    return g_steal_pointer(&hostname);
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index e9b14ab178..3b49d27297 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -808,3 +808,16 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
     }
     return true;
 }
+
+char *qemu_get_host_name(Error **errp)
+{
+    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD size = G_N_ELEMENTS(tmp);
+
+    if (GetComputerNameW(tmp, &size) == 0) {
+        error_setg_win32(errp, GetLastError(), "failed close handle");
+        return NULL;
+    }
+
+    return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:53:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:53:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14793.36686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvn-0004RQ-Pb; Thu, 29 Oct 2020 20:53:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14793.36686; Thu, 29 Oct 2020 20:53:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvn-0004RJ-Lp; Thu, 29 Oct 2020 20:53:59 +0000
Received: by outflank-mailman (input) for mailman id 14793;
 Thu, 29 Oct 2020 20:53:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEvm-0004Pa-9a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2a82aa50-a80f-4216-8087-c9f1e4b31d87;
 Thu, 29 Oct 2020 20:53:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvl-0006yZ-FL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvl-00018O-ES
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEvm-0004Pa-9a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:58 +0000
X-Inumbo-ID: 2a82aa50-a80f-4216-8087-c9f1e4b31d87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2a82aa50-a80f-4216-8087-c9f1e4b31d87;
	Thu, 29 Oct 2020 20:53:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UVCsPoHm7oVCZU/8w1mY49ZrDl4JPh1UNRkQh607ulw=; b=xGwk3bqnafB70MQ65RPj0ovUhN
	lRPonjqd0NDVBXPxEdnrNJBmbI3Kz+7x8dzHgOkZo+POiyvamWxZTdYcRNEctTxuVTdm2Ozrvp/Ei
	MWkhQn0uDz8WfZex0Xm/U5wCi9oHAjBJHpJzOvuUd/65Z+KHPPLXktysRZn7OGiyhNR0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvl-0006yZ-FL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvl-00018O-ES
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:53:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qga: Use qemu_get_host_name() instead of g_get_host_name()
Message-Id: <E1kYEvl-00018O-ES@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:53:57 +0000

commit 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:44:58 2020 -0500

    qga: Use qemu_get_host_name() instead of g_get_host_name()
    
    Problem with g_get_host_name() is that on the first call it saves
    the hostname into a global variable and from then on, every
    subsequent call returns the saved hostname. Even if the hostname
    changes. This doesn't play nicely with guest agent, because if
    the hostname is acquired before the guest is set up (e.g. on the
    first boot, or before DHCP) we will report old, invalid hostname.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/qga/commands.c b/qga/commands.c
index efc8b90281..d3fec807c1 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -515,11 +515,20 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
 GuestHostName *qmp_guest_get_host_name(Error **errp)
 {
     GuestHostName *result = NULL;
-    gchar const *hostname = g_get_host_name();
-    if (hostname != NULL) {
-        result = g_new0(GuestHostName, 1);
-        result->host_name = g_strdup(hostname);
+    g_autofree char *hostname = qemu_get_host_name(errp);
+
+    /*
+     * We want to avoid using g_get_host_name() because that
+     * caches the result and we wouldn't reflect changes in the
+     * host name.
+     */
+
+    if (!hostname) {
+        hostname = g_strdup("localhost");
     }
+
+    result = g_new0(GuestHostName, 1);
+    result->host_name = g_steal_pointer(&hostname);
     return result;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:54:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:54:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14795.36690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvx-0004W2-Ry; Thu, 29 Oct 2020 20:54:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14795.36690; Thu, 29 Oct 2020 20:54:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEvx-0004Vu-P1; Thu, 29 Oct 2020 20:54:09 +0000
Received: by outflank-mailman (input) for mailman id 14795;
 Thu, 29 Oct 2020 20:54:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEvw-0004Uc-By
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6c38e105-2f53-4d8b-8ae9-40daad5bcc89;
 Thu, 29 Oct 2020 20:54:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvv-0006zJ-JE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEvv-00019O-IP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEvw-0004Uc-By
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:08 +0000
X-Inumbo-ID: 6c38e105-2f53-4d8b-8ae9-40daad5bcc89
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6c38e105-2f53-4d8b-8ae9-40daad5bcc89;
	Thu, 29 Oct 2020 20:54:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WAMS4ocUeDsQ6f7ktdMEkYrhX9LbvJg5VX4rTDPGr7A=; b=K3Xc/G/oatLgKZoj3f0DXW8999
	409ejE+4AAnEmS36c6IkCg2UZgLEf9ZBFjIA2xSyhAYQ1GQaMjCYYppwKr7VLojvdgGAk+jMNSqm4
	8FCqlZmrne/P65j4o8Y1THRD7VLyWCSyqHMBpGFzXFI0TRGav2mgs0OP1LVI8k0rFSlw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvv-0006zJ-JE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEvv-00019O-IP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-13-tag' into staging
Message-Id: <E1kYEvv-00019O-IP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:07 +0000

commit c920fdba39480989cb5f1af3cc63acccef021b54
Merge: 8bfa25a46ff1082f75e7052875b5d435119dcf49 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 21:21:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 21:21:58 2020 +0100

    Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-13-tag' into staging
    
    qemu-ga patch queue for hard-freeze
    
    * fix erroneously reporting stale hostname in guest-get-host-name
    * fix regression where guest-shutdown asserts when called
    * fix race condition with guest-fs-freeze/thaw on w32
    
    # gpg: Signature made Tue 14 Jul 2020 05:47:11 BST
    # gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
    # gpg:                issuer "mdroth@linux.vnet.ibm.com"
    # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
    # gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
    # gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
    # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584
    
    * remotes/mdroth/tags/qga-pull-2020-07-13-tag:
      qga: Use qemu_get_host_name() instead of g_get_host_name()
      util: Introduce qemu_get_host_name()
      qga: fix assert regression on guest-shutdown
      qga-win: Fix QGA VSS Provider service stop failure
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 include/qemu/osdep.h      | 10 ++++++++++
 qga/commands.c            | 17 +++++++++++++----
 qga/main.c                |  6 +++++-
 qga/vss-win32/install.cpp | 33 ++++++++++++++++++++-------------
 util/oslib-posix.c        | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c        | 13 +++++++++++++
 6 files changed, 96 insertions(+), 18 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:54:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:54:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14796.36694 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEw7-0004YV-Te; Thu, 29 Oct 2020 20:54:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14796.36694; Thu, 29 Oct 2020 20:54:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEw7-0004YM-Qa; Thu, 29 Oct 2020 20:54:19 +0000
Received: by outflank-mailman (input) for mailman id 14796;
 Thu, 29 Oct 2020 20:54:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEw6-0004Y7-Ue
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ae258e41-1b33-4a2a-a55c-183590fccc68;
 Thu, 29 Oct 2020 20:54:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEw6-0006zM-7W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEw6-0001Bj-6W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEw6-0004Y7-Ue
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:19 +0000
X-Inumbo-ID: ae258e41-1b33-4a2a-a55c-183590fccc68
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ae258e41-1b33-4a2a-a55c-183590fccc68;
	Thu, 29 Oct 2020 20:54:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q11wyIrKbgCzkfK38HX1PVhY+zpbwwPu8S+Jtamy9aw=; b=Pm2x+Li+JVdKavTjxmVNrkfG38
	gHFmuSHimYLFVgi7zbyg8drAYFlXFgTGaYZNPsX1RVXTCEYF2oe62Ttc1PoFbTCyNSVHP9LwnV9Fm
	dSoE17+nQ6rYMQEyukcxhr435saWuM2MO5RjG5chlS/9mgW7ytCtrBvS2lWzL9sJ5Ikk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEw6-0006zM-7W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEw6-0001Bj-6W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Cc qemu-block mailing list
Message-Id: <E1kYEw6-0001Bj-6W@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:18 +0000

commit ba412478d16ca6abb4f240d92e6528eac7d3c337
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Fri Jun 5 06:56:38 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    MAINTAINERS: Cc qemu-block mailing list
    
    We forgot to include the qemu-block mailing list while adding
    this section in commit 076a0fc32a7. Fix this.
    
    Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200630133912.9428-2-f4bug@amsat.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..d9c71d0bb3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1674,6 +1674,7 @@ F: hw/ssi/xilinx_*
 
 SD (Secure Card)
 M: Philippe Mathieu-Daudé <f4bug@amsat.org>
+L: qemu-block@nongnu.org
 S: Odd Fixes
 F: include/hw/sd/sd*
 F: hw/sd/core.c
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:54:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:54:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14798.36697 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwI-0004aO-V2; Thu, 29 Oct 2020 20:54:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14798.36697; Thu, 29 Oct 2020 20:54:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwI-0004aH-SA; Thu, 29 Oct 2020 20:54:30 +0000
Received: by outflank-mailman (input) for mailman id 14798;
 Thu, 29 Oct 2020 20:54:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEwH-0004a4-7d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b16e400c-f965-4434-9c4f-4530ba272ce1;
 Thu, 29 Oct 2020 20:54:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwG-0006zT-C6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwG-0001Ct-AV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEwH-0004a4-7d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:29 +0000
X-Inumbo-ID: b16e400c-f965-4434-9c4f-4530ba272ce1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b16e400c-f965-4434-9c4f-4530ba272ce1;
	Thu, 29 Oct 2020 20:54:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uBqzTiXAeU2B501BzOFieMrc9rGzCMmA/li9SIM+v9w=; b=uVihAuUaGe1pKUXwU9PZ9C4emu
	UXQ2FWchiFdw2TewCTPntINdeF2GEEPMMGAeT1u9li6sTtbhPYh07kIInDMsG/oFGM+LRjqfRSHNh
	2YWgQUsrJcQbv9EZHTHxTuGT43FrbmlTNKjU6+PUtxq5oTbGxJzgZWjQerGzvvRUswQs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwG-0006zT-C6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwG-0001Ct-AV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/orangepi: Add instructions for resizing SD image to power of two
Message-Id: <E1kYEwG-0001Ct-AV@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:28 +0000

commit 1c2329b5d644bad16e888d095e2021ad682201d9
Author:     Niek Linnenbank <nieklinnenbank@gmail.com>
AuthorDate: Sun Jul 12 20:37:08 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    docs/orangepi: Add instructions for resizing SD image to power of two
    
    SD cards need to have a size of a power of two.
    Update the Orange Pi machine documentation to include
    instructions for resizing downloaded images using the
    qemu-img command.
    
    Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200712183708.15450-1-nieklinnenbank@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 docs/system/arm/orangepi.rst | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst
index c41adad488..6f23907fb6 100644
--- a/docs/system/arm/orangepi.rst
+++ b/docs/system/arm/orangepi.rst
@@ -127,6 +127,16 @@ can be downloaded from:
 Alternatively, you can also choose to build you own image with buildroot
 using the orangepi_pc_defconfig. Also see https://buildroot.org for more information.
 
+When using an image as an SD card, it must be resized to a power of two. This can be
+done with the qemu-img command. It is recommended to only increase the image size
+instead of shrinking it to a power of two, to avoid loss of data. For example,
+to prepare a downloaded Armbian image, first extract it and then increase
+its size to one gigabyte as follows:
+
+.. code-block:: bash
+
+  $ qemu-img resize Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img 1G
+
 You can choose to attach the selected image either as an SD card or as USB mass storage.
 For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd
 argument and provide the proper root= kernel parameter:
@@ -213,12 +223,12 @@ Next, unzip the NetBSD image and write the U-Boot binary including SPL using:
   $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc
 
 Finally, before starting the machine the SD image must be extended such
-that the NetBSD kernel will not conclude the NetBSD partition is larger than
-the emulated SD card:
+that the size of the SD image is a power of two and that the NetBSD kernel
+will not conclude the NetBSD partition is larger than the emulated SD card:
 
 .. code-block:: bash
 
-  $ dd if=/dev/zero bs=1M count=64 >> armv7.img
+  $ qemu-img resize armv7.img 2G
 
 Start the machine using the following command:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:54:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:54:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14799.36702 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwT-0004bx-0k; Thu, 29 Oct 2020 20:54:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14799.36702; Thu, 29 Oct 2020 20:54:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwS-0004bp-To; Thu, 29 Oct 2020 20:54:40 +0000
Received: by outflank-mailman (input) for mailman id 14799;
 Thu, 29 Oct 2020 20:54:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEwR-0004bc-VV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id adae340e-3641-4d1d-9044-717167757838;
 Thu, 29 Oct 2020 20:54:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwQ-0006zZ-FS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwQ-0001Dj-Ei
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEwR-0004bc-VV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:39 +0000
X-Inumbo-ID: adae340e-3641-4d1d-9044-717167757838
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id adae340e-3641-4d1d-9044-717167757838;
	Thu, 29 Oct 2020 20:54:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KNSKa/+igTQZJEN7NRg2uFxO/4P93ionEklm4iAYt7k=; b=oKDd9A/fTcQoicZl7Byf9zrh/2
	J2By1dPu+QU/pbdbMBPyKWtj6FKXgqEhgDAHeKKXN7AqZfJOmiUEiXK/CoS2X7hvex5U+1DU7tPHo
	CoABK0SUEq8sTDQvCYusgbWI46CjIhFbpRwY7e8kDsknRAoeyF3YubNhtQX2JOD9PD60=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwQ-0006zZ-FS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwQ-0001Dj-Ei
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
Message-Id: <E1kYEwQ-0001Dj-Ei@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:38 +0000

commit b7dcbf1395da960ec3c313300dc0030674de8cd1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:45:33 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
    
    Avocado tags are handy to automatically select tests matching
    the tags. Since these tests use a SD card, tag them.
    
    We can run all the tests using a SD card at once with:
    
      $ avocado --show=app run -t u-boot tests/acceptance/
      $ AVOCADO_ALLOW_LARGE_STORAGE=ok \
        avocado --show=app \
          run -t device:sd tests/acceptance/
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
       (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd: PASS (19.56 s)
       (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic: PASS (49.97 s)
       (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: PASS (20.06 s)
      RESULTS    : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
      JOB TIME   : 90.02 s
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-4-f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3d02519660..b7e8858c2d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -620,6 +620,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
@@ -669,6 +670,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
 
         # This test download a 196MB compressed image and expand it to 932MB...
@@ -710,6 +712,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         # This test download a 304MB compressed image and expand it to 1.3GB...
         deb_url = ('http://snapshot.debian.org/archive/debian/'
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:54:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:54:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14800.36706 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwd-0004dZ-22; Thu, 29 Oct 2020 20:54:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14800.36706; Thu, 29 Oct 2020 20:54:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwc-0004dQ-VN; Thu, 29 Oct 2020 20:54:50 +0000
Received: by outflank-mailman (input) for mailman id 14800;
 Thu, 29 Oct 2020 20:54:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEwb-0004dD-Q3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 73a14ac5-3a7e-4a1b-bfe8-be7cd7c5d20f;
 Thu, 29 Oct 2020 20:54:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwa-0006zh-JW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwa-0001EX-IG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEwb-0004dD-Q3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:49 +0000
X-Inumbo-ID: 73a14ac5-3a7e-4a1b-bfe8-be7cd7c5d20f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 73a14ac5-3a7e-4a1b-bfe8-be7cd7c5d20f;
	Thu, 29 Oct 2020 20:54:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zyOu0PNCgfimwpCYMgc7Cct3+qzRNO/z8bmODRUyP/w=; b=DVA9+XM65x5sOcHTeltmTNx0cW
	Ox6qsMGX3Qw8jA1qCLEXF6xBIWoShrYwHbvjwvz8gqMjcD7f1PKg03USNO/B0HQfo+g+wrGqYkXVg
	INBscKZPBb0Pl/iDTUhi88+Yi2onq4frim1/DeVtKmigNlWXF/NKwj+M5WJ52F8zdoXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwa-0006zh-JW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwa-0001EX-IG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/acceptance/boot_linux: Expand SD card image to power of 2
Message-Id: <E1kYEwa-0001EX-IG@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:48 +0000

commit 6a289a5ba3383e17fb47029720425bef42e424d7
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 15:05:27 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    tests/acceptance/boot_linux: Expand SD card image to power of 2
    
    In few commits we won't allow SD card images with invalid size
    (not aligned to a power of 2). Prepare the tests: add the
    pow2ceil() and image_pow2ceil_expand() methods and resize the
    images (expanding) of the tests using SD cards.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-5-f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index b7e8858c2d..67c3b2f3d1 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,6 +28,22 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
+"""
+Round up to next power of 2
+"""
+def pow2ceil(x):
+    return 1 if x == 0 else 2**(x - 1).bit_length()
+
+"""
+Expand file size to next power of 2
+"""
+def image_pow2ceil_expand(path):
+        size = os.path.getsize(path)
+        size_aligned = pow2ceil(size)
+        if size != size_aligned:
+            with open(path, 'ab+') as fd:
+                fd.truncate(size_aligned)
+
 class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
@@ -636,6 +652,7 @@ class BootLinuxConsole(LinuxKernelTest):
         rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
         rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
         archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
+        image_pow2ceil_expand(rootfs_path)
 
         self.vm.set_console()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -673,7 +690,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=device:sd
         """
 
-        # This test download a 196MB compressed image and expand it to 932MB...
+        # This test download a 196MB compressed image and expand it to 1GB
         image_url = ('https://dl.armbian.com/orangepipc/archive/'
                      'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
         image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
@@ -681,6 +698,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
         image_path = os.path.join(self.workdir, image_name)
         process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
+        image_pow2ceil_expand(image_path)
 
         self.vm.set_console()
         self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
@@ -714,7 +732,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=machine:orangepi-pc
         :avocado: tags=device:sd
         """
-        # This test download a 304MB compressed image and expand it to 1.3GB...
+        # This test download a 304MB compressed image and expand it to 2GB
         deb_url = ('http://snapshot.debian.org/archive/debian/'
                    '20200108T145233Z/pool/main/u/u-boot/'
                    'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
@@ -731,8 +749,9 @@ class BootLinuxConsole(LinuxKernelTest):
         image_hash = '2babb29d36d8360adcb39c09e31060945259917a'
         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
         image_path = os.path.join(self.workdir, 'armv7.img')
-        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
         archive.gzip_uncompress(image_path_gz, image_path)
+        image_pow2ceil_expand(image_path)
+        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
 
         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
         with open(uboot_path, 'rb') as f_in:
@@ -740,12 +759,6 @@ class BootLinuxConsole(LinuxKernelTest):
                 f_out.seek(8 * 1024)
                 shutil.copyfileobj(f_in, f_out)
 
-                # Extend image, to avoid that NetBSD thinks the partition
-                # inside the image is larger than device size itself
-                f_out.seek(0, 2)
-                f_out.seek(64 * 1024 * 1024, 1)
-                f_out.write(bytearray([0x00]))
-
         self.vm.set_console()
         self.vm.add_args('-nic', 'user',
                          '-drive', image_drive_args,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14801.36709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwn-0004fT-3k; Thu, 29 Oct 2020 20:55:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14801.36709; Thu, 29 Oct 2020 20:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwn-0004fJ-0j; Thu, 29 Oct 2020 20:55:01 +0000
Received: by outflank-mailman (input) for mailman id 14801;
 Thu, 29 Oct 2020 20:54:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEwl-0004eb-Dm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 03080858-9f82-408d-ba00-25ab90aff96b;
 Thu, 29 Oct 2020 20:54:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwk-00070O-N9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwk-0001FB-MJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEwl-0004eb-Dm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:59 +0000
X-Inumbo-ID: 03080858-9f82-408d-ba00-25ab90aff96b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 03080858-9f82-408d-ba00-25ab90aff96b;
	Thu, 29 Oct 2020 20:54:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X2smXVFhgi1umU84sL4OMXClWP+a0drLAb7k+76YusU=; b=wOYk+InXHhJybdLhbmETJ+6AbS
	RZ5Ps1AvuAxOk+MG/DyAG81Qeiy0+KWaWWSEQAx791t4aBJThLcsJYNMCTZmxqG9RgWRb6yfSJ0Hj
	UnhPEICEvFD7tLfg59aiPi/R1SlLJlqYR3B6kSPJMVs6uvv/Z8kq1XXIkdYYGHu0lN6M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwk-00070O-N9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwk-0001FB-MJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:54:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
Message-Id: <E1kYEwk-0001FB-MJ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:54:58 +0000

commit 9157dd597d293ab7f599f4d96c3fe8a6e07c633d
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Wed Jun 3 19:59:16 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:45:58 2020 +0200

    hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
    
    Only SCSD cards support Class 6 (Block Oriented Write Protection)
    commands.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.14 Command Functional Difference in Card Capacity Types
    
      * Write Protected Group
    
      SDHC and SDXC do not support write-protected groups. Issuing
      CMD28, CMD29 and CMD30 generates the ILLEGAL_COMMAND error.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-7-f4bug@amsat.org>
---
 hw/sd/sd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 5137168d66..1cc16bfd31 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -920,6 +920,11 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
         sd->multi_blk_cnt = 0;
     }
 
+    if (sd_cmd_class[req.cmd] == 6 && FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
+        /* Only Standard Capacity cards support class 6 commands */
+        return sd_illegal;
+    }
+
     switch (req.cmd) {
     /* Basic commands (Class 0 and Class 1) */
     case 0:	/* CMD0:   GO_IDLE_STATE */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14803.36714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwz-0004h5-5v; Thu, 29 Oct 2020 20:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14803.36714; Thu, 29 Oct 2020 20:55:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEwz-0004gx-2I; Thu, 29 Oct 2020 20:55:13 +0000
Received: by outflank-mailman (input) for mailman id 14803;
 Thu, 29 Oct 2020 20:55:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEwx-0004gP-5W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c0c8069e-ba5f-4eaa-a3cc-26038b1b8313;
 Thu, 29 Oct 2020 20:55:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwu-00070m-R5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEwu-0001G9-QM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEwx-0004gP-5W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:11 +0000
X-Inumbo-ID: c0c8069e-ba5f-4eaa-a3cc-26038b1b8313
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c0c8069e-ba5f-4eaa-a3cc-26038b1b8313;
	Thu, 29 Oct 2020 20:55:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=62W0cVhcmGc1NRV5t3Y7lWQ4isV2Fz4qxz8reJ7ycHs=; b=eB5LC5vM5HrRDVy7zHGfgOA/Xs
	ztaSPYT2ReBjBoogJJsUCW5GQLzB3uFq1VavdStejaocn5wrRH8mIWf0PV1ptAnx1IU3qkRCaYmp7
	dEfwtckC6qXi/h074xhBn8TIJK7cKkp93WYpshiUaErf6VwusEcbclrGjWc2v7dol6aA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwu-00070m-R5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEwu-0001G9-QM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/sd/sdcard: Simplify realize() a bit
Message-Id: <E1kYEwu-0001G9-QM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:08 +0000

commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jun 5 22:28:51 2018 -0300
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:07 2020 +0200

    hw/sd/sdcard: Simplify realize() a bit
    
    We don't need to check if sd->blk is set twice.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-18-f4bug@amsat.org>
---
 hw/sd/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1cc16bfd31..edd60a09c0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2105,12 +2105,12 @@ static void sd_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (sd->blk && blk_is_read_only(sd->blk)) {
-        error_setg(errp, "Cannot use read-only drive as SD card");
-        return;
-    }
-
     if (sd->blk) {
+        if (blk_is_read_only(sd->blk)) {
+            error_setg(errp, "Cannot use read-only drive as SD card");
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14804.36717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEx7-0004iY-85; Thu, 29 Oct 2020 20:55:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14804.36717; Thu, 29 Oct 2020 20:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEx7-0004iQ-5B; Thu, 29 Oct 2020 20:55:21 +0000
Received: by outflank-mailman (input) for mailman id 14804;
 Thu, 29 Oct 2020 20:55:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEx6-0004i9-1B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9962ae89-21c2-4bb7-bb6c-280551a98543;
 Thu, 29 Oct 2020 20:55:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEx4-00070t-Ug
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEx4-0001Gf-Tv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEx6-0004i9-1B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:20 +0000
X-Inumbo-ID: 9962ae89-21c2-4bb7-bb6c-280551a98543
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9962ae89-21c2-4bb7-bb6c-280551a98543;
	Thu, 29 Oct 2020 20:55:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v9hflNpCf2Pvn7bth1E+hJFZtYRbflTXn/0P2b2u/+A=; b=KzPQHhUlQjxvWaqzBScQrsBTwo
	OExOb1uXhqfKM0AgTUb1F221t8kF/5r1C/KI8GiWK0325GIY0IADV9vrOKI374Cis9llo16VOzu28
	RDqn76U6JoT+UeT3y7yAGoAL80lXaBvtbZRXXNxtroNwknkjiqCYBBVp50rnlchm3fDs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEx4-00070t-Ug
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEx4-0001Gf-Tv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/sd/sdcard: Do not allow invalid SD card sizes
Message-Id: <E1kYEx4-0001Gf-Tv@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:18 +0000

commit a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 13:02:34 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:07 2020 +0200

    hw/sd/sdcard: Do not allow invalid SD card sizes
    
    QEMU allows to create SD card with unrealistic sizes. This could
    work, but some guests (at least Linux) consider sizes that are not
    a power of 2 as a firmware bug and fix the card size to the next
    power of 2.
    
    While the possibility to use small SD card images has been seen as
    a feature, it became a bug with CVE-2020-13253, where the guest is
    able to do OOB read/write accesses past the image size end.
    
    In a pair of commits we will fix CVE-2020-13253 as:
    
        Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        WP_VIOLATION errors are not modified: the error bit is set, we
        stay in receive-data state, wait for a stop command. All further
        data transfer is ignored. See the check on sd->card_status at the
        beginning of sd_read_data() and sd_write_data().
    
    While this is the correct behavior, in case QEMU create smaller SD
    cards, guests still try to access past the image size end, and QEMU
    considers this is an invalid address, thus "all further data transfer
    is ignored". This is wrong and make the guest looping until
    eventually timeouts.
    
    Fix by not allowing invalid SD card sizes (suggesting the expected
    size as a hint):
    
      $ qemu-system-arm -M orangepi-pc -drive file=rootfs.ext2,if=sd,format=raw
      qemu-system-arm: Invalid SD card size: 60 MiB
      SD card size has to be a power of 2, e.g. 64 MiB.
      You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
      (note that this will lose data if you make the image smaller than it currently is).
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200713183209.26308-8-f4bug@amsat.org>
---
 hw/sd/sd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index edd60a09c0..76d68359a4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "qemu/cutils.h"
 #include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "sysemu/block-backend.h"
@@ -2106,11 +2107,35 @@ static void sd_realize(DeviceState *dev, Error **errp)
     }
 
     if (sd->blk) {
+        int64_t blk_size;
+
         if (blk_is_read_only(sd->blk)) {
             error_setg(errp, "Cannot use read-only drive as SD card");
             return;
         }
 
+        blk_size = blk_getlength(sd->blk);
+        if (blk_size > 0 && !is_power_of_2(blk_size)) {
+            int64_t blk_size_aligned = pow2ceil(blk_size);
+            char *blk_size_str;
+
+            blk_size_str = size_to_str(blk_size);
+            error_setg(errp, "Invalid SD card size: %s", blk_size_str);
+            g_free(blk_size_str);
+
+            blk_size_str = size_to_str(blk_size_aligned);
+            error_append_hint(errp,
+                              "SD card size has to be a power of 2, e.g. %s.\n"
+                              "You can resize disk images with"
+                              " 'qemu-img resize <imagefile> <new-size>'\n"
+                              "(note that this will lose data if you make the"
+                              " image smaller than it currently is).\n",
+                              blk_size_str);
+            g_free(blk_size_str);
+
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14806.36722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExH-0004kC-9w; Thu, 29 Oct 2020 20:55:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14806.36722; Thu, 29 Oct 2020 20:55:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExH-0004k3-6n; Thu, 29 Oct 2020 20:55:31 +0000
Received: by outflank-mailman (input) for mailman id 14806;
 Thu, 29 Oct 2020 20:55:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYExF-0004jq-Rs
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4e9dd2de-6d24-4c6d-929b-d0ec372b562c;
 Thu, 29 Oct 2020 20:55:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExF-00071E-2F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExF-0001HG-1P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYExF-0004jq-Rs
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
X-Inumbo-ID: 4e9dd2de-6d24-4c6d-929b-d0ec372b562c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4e9dd2de-6d24-4c6d-929b-d0ec372b562c;
	Thu, 29 Oct 2020 20:55:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7gKE2OZliXU34ALngm3RcLJjKkYO2fI2z8v1lwsmoZo=; b=R/HRNnHkALEhc/+PtvPIl1Dp3P
	VH3UcGzrvGCyCYX1biU3YgK8JmO1Zgbb9PMG4lfSwliZFZ+/9l+sr2TbFZGH/iNNcSx2MhZXS/zvf
	XUi/T3t04lCOLQh7YOHWxhn3WUshCUZrTQT7oZB93FbfJHygEnxRM5NV0ZLtBzXTG8vE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExF-00071E-2F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExF-0001HG-1P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/sd/sdcard: Update coding style to make checkpatch.pl happy
Message-Id: <E1kYExF-0001HG-1P@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:29 +0000

commit 794d68de2f021a6d3874df41d6bbe8590ec05207
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:27:35 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:14 2020 +0200

    hw/sd/sdcard: Update coding style to make checkpatch.pl happy
    
    To make the next commit easier to review, clean this code first.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200630133912.9428-3-f4bug@amsat.org>
---
 hw/sd/sd.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 76d68359a4..f4f76f8fd2 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1175,8 +1175,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1191,8 +1192,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1237,12 +1239,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
@@ -1261,12 +1266,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14807.36726 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExR-0004la-Bh; Thu, 29 Oct 2020 20:55:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14807.36726; Thu, 29 Oct 2020 20:55:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExR-0004lR-8K; Thu, 29 Oct 2020 20:55:41 +0000
Received: by outflank-mailman (input) for mailman id 14807;
 Thu, 29 Oct 2020 20:55:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYExQ-0004lG-42
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d09b92a6-6d31-4252-92fb-2ad6a1234f40;
 Thu, 29 Oct 2020 20:55:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExP-00071Q-6x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExP-0001I0-5F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYExQ-0004lG-42
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:40 +0000
X-Inumbo-ID: d09b92a6-6d31-4252-92fb-2ad6a1234f40
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d09b92a6-6d31-4252-92fb-2ad6a1234f40;
	Thu, 29 Oct 2020 20:55:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AU1v0pKbgWSqLCZeBQvgutp8Et4L/dkn94jQIRLdH5I=; b=IF8cFwP5RzMzq+5kfqWwEkLfwe
	6qQiBMzS637ahf5/0MvziIkJc3wxFQM+aqQ+PrvqSTCIWl0r9zL4fnlcCUjaho+1VnzbHdDOujmuo
	3DgeR/uX81JK4LTpopREevRBbG+ZTBf4HbPMFhHaiCTmqjuchqbpXuALpwbpdmLHDk/I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExP-00071Q-6x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExP-0001I0-5F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
Message-Id: <E1kYExP-0001I0-5F@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:39 +0000

commit 790762e5487114341cccc5bffcec4cb3c022c3cd
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jun 4 19:22:29 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:14 2020 +0200

    hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
    
    Only move the state machine to ReceivingData if there is no
    pending error. This avoids later OOB access while processing
    commands queued.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.3 Data Read
    
      Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
      4.3.4 Data Write
    
      Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
    WP_VIOLATION errors are not modified: the error bit is set, we
    stay in receive-data state, wait for a stop command. All further
    data transfer is ignored. See the check on sd->card_status at the
    beginning of sd_read_data() and sd_write_data().
    
    Fixes: CVE-2020-13253
    Cc: qemu-stable@nongnu.org
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880822
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-6-f4bug@amsat.org>
---
 hw/sd/sd.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index f4f76f8fd2..fad9cf1ee7 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1171,13 +1171,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 17:	/* CMD17:  READ_SINGLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1188,13 +1190,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 18:	/* CMD18:  READ_MULTIPLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1234,14 +1238,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
@@ -1261,14 +1268,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:55:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14808.36730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExb-0004mp-D9; Thu, 29 Oct 2020 20:55:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14808.36730; Thu, 29 Oct 2020 20:55:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExb-0004mf-A0; Thu, 29 Oct 2020 20:55:51 +0000
Received: by outflank-mailman (input) for mailman id 14808;
 Thu, 29 Oct 2020 20:55:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYExa-0004mW-4x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f36c06cf-f1b8-4597-af69-0d5972bf8d3e;
 Thu, 29 Oct 2020 20:55:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExZ-00071Y-BD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExZ-0001Iw-A0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYExa-0004mW-4x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:50 +0000
X-Inumbo-ID: f36c06cf-f1b8-4597-af69-0d5972bf8d3e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f36c06cf-f1b8-4597-af69-0d5972bf8d3e;
	Thu, 29 Oct 2020 20:55:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=40XWuDuhKbcSjW7l/4QQVOQ+nqp/V8OTA79qsAAfWms=; b=pId7PMLCeKKjJJTC4jb3GCegQl
	OT+5LcJTWQ6+A/DVlog1SVU4MkenPBDRHAuddT9TW9uPG5kyEF/cr2mth0dHNRPxdrhXyge46KJbk
	OGmcNTvcvtDATdlavLaGpvQ9kXzBKE/rAz69OR+2eLsJBVxvfErnD8RHJRt2tpbljM6A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExZ-00071Y-BD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExZ-0001Iw-A0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request' into staging
Message-Id: <E1kYExZ-0001Iw-A0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:49 +0000

commit 3a9163af4e3dd61795a35d47b702e302f98f81d6
Merge: c920fdba39480989cb5f1af3cc63acccef021b54 790762e5487114341cccc5bffcec4cb3c022c3cd
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 09:06:55 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 09:06:55 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request' into staging
    
    Fix CVE-2020-13253
    
    By using invalidated address, guest can do out-of-bounds accesses.
    These patches fix the issue by only allowing SD card image sizes
    power of 2, and not switching to SEND_DATA state when the address
    is invalid (out of range).
    
    This issue was found using QEMU fuzzing mode (using --enable-fuzzing,
    see docs/devel/fuzzing.txt) and reported by Alexander Bulekov.
    
    Reproducer:
      https://bugs.launchpad.net/qemu/+bug/1880822/comments/1
    
    CI jobs results:
    . https://cirrus-ci.com/build/5157142548185088
    . https://gitlab.com/philmd/qemu/-/pipelines/166381731
    . https://travis-ci.org/github/philmd/qemu/builds/707956535
    
    # gpg: Signature made Tue 14 Jul 2020 14:54:44 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request:
      hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
      hw/sd/sdcard: Update coding style to make checkpatch.pl happy
      hw/sd/sdcard: Do not allow invalid SD card sizes
      hw/sd/sdcard: Simplify realize() a bit
      hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
      tests/acceptance/boot_linux: Expand SD card image to power of 2
      tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
      docs/orangepi: Add instructions for resizing SD image to power of two
      MAINTAINERS: Cc qemu-block mailing list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                            |  1 +
 docs/system/arm/orangepi.rst           | 16 +++++--
 hw/sd/sd.c                             | 86 ++++++++++++++++++++++++++--------
 tests/acceptance/boot_linux_console.py | 34 ++++++++++----
 4 files changed, 106 insertions(+), 31 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14809.36734 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExm-0004on-F2; Thu, 29 Oct 2020 20:56:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14809.36734; Thu, 29 Oct 2020 20:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExm-0004of-BX; Thu, 29 Oct 2020 20:56:02 +0000
Received: by outflank-mailman (input) for mailman id 14809;
 Thu, 29 Oct 2020 20:56:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYExl-0004oV-3Q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id de9a55e7-fd89-4f9d-8119-dbf54b5e1b8e;
 Thu, 29 Oct 2020 20:56:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExj-000729-VU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExj-0001Li-TQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYExl-0004oV-3Q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:01 +0000
X-Inumbo-ID: de9a55e7-fd89-4f9d-8119-dbf54b5e1b8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id de9a55e7-fd89-4f9d-8119-dbf54b5e1b8e;
	Thu, 29 Oct 2020 20:56:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u5p7LkDZXCRQw5CVJeiZYoW3mTiShJnAbzYZ8V9rBMg=; b=KiJE8RsZB+cBid6AxhsDEIJZCu
	WC/40KdCKOEzU6rBSCwgcgToPq7MXnrxXXklfTG/ODIFdT4F3xahGLYq1ATvb3a/1QPhHAC9f9W8t
	wynk/aDJwDSXe4hnywzJRPGmxjQDvEKoSo/MgTZLC6d0+pDsJwrVnbzbuulRCxFh7Yco=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExj-000729-VU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExj-0001Li-TQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:55:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] scripts/performance: Add dissect.py script
Message-Id: <E1kYExj-0001Li-TQ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:55:59 +0000

commit 01afa757b6f1b8c7858cc29b8332e9fb6aa1e16f
Author:     Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
AuthorDate: Thu Jul 9 07:20:55 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    scripts/performance: Add dissect.py script
    
    Python script that dissects QEMU execution into three main phases:
    code generation, JIT execution and helpers execution.
    
    Syntax:
    dissect.py [-h] -- <qemu executable> [<qemu executable options>] \
                     <target executable> [<target executable options>]
    
    [-h] - Print the script arguments help message.
    
    Example of usage:
    dissect.py -- qemu-arm coulomb_double-arm
    
    Example output:
    Total Instructions:        4,702,865,362
    
    Code Generation:             115,819,309         2.463%
    JIT Execution:             1,081,980,528        23.007%
    Helpers:                   3,505,065,525        74.530%
    
    Signed-off-by: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
    Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200709052055.2650-2-ahmedkhaledkaraman@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 scripts/performance/dissect.py | 166 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 166 insertions(+)

diff --git a/scripts/performance/dissect.py b/scripts/performance/dissect.py
new file mode 100755
index 0000000000..bf24f50922
--- /dev/null
+++ b/scripts/performance/dissect.py
@@ -0,0 +1,166 @@
+#!/usr/bin/env python3
+
+#  Print the percentage of instructions spent in each phase of QEMU
+#  execution.
+#
+#  Syntax:
+#  dissect.py [-h] -- <qemu executable> [<qemu executable options>] \
+#                   <target executable> [<target executable options>]
+#
+#  [-h] - Print the script arguments help message.
+#
+#  Example of usage:
+#  dissect.py -- qemu-arm coulomb_double-arm
+#
+#  This file is a part of the project "TCG Continuous Benchmarking".
+#
+#  Copyright (C) 2020  Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
+#  Copyright (C) 2020  Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
+#
+#  This program is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+import argparse
+import os
+import subprocess
+import sys
+import tempfile
+
+
+def get_JIT_line(callgrind_data):
+    """
+    Search for the first instance of the JIT call in
+    the callgrind_annotate output when ran using --tree=caller
+    This is equivalent to the self number of instructions of JIT.
+
+    Parameters:
+    callgrind_data (list): callgrind_annotate output
+
+    Returns:
+    (int): Line number
+    """
+    line = -1
+    for i in range(len(callgrind_data)):
+        if callgrind_data[i].strip('\n') and \
+                callgrind_data[i].split()[-1] == "[???]":
+            line = i
+            break
+    if line == -1:
+        sys.exit("Couldn't locate the JIT call ... Exiting.")
+    return line
+
+
+def main():
+    # Parse the command line arguments
+    parser = argparse.ArgumentParser(
+        usage='dissect.py [-h] -- '
+        '<qemu executable> [<qemu executable options>] '
+        '<target executable> [<target executable options>]')
+
+    parser.add_argument('command', type=str, nargs='+', help=argparse.SUPPRESS)
+
+    args = parser.parse_args()
+
+    # Extract the needed variables from the args
+    command = args.command
+
+    # Insure that valgrind is installed
+    check_valgrind = subprocess.run(
+        ["which", "valgrind"], stdout=subprocess.DEVNULL)
+    if check_valgrind.returncode:
+        sys.exit("Please install valgrind before running the script.")
+
+    # Save all intermediate files in a temporary directory
+    with tempfile.TemporaryDirectory() as tmpdirname:
+        # callgrind output file path
+        data_path = os.path.join(tmpdirname, "callgrind.data")
+        # callgrind_annotate output file path
+        annotate_out_path = os.path.join(tmpdirname, "callgrind_annotate.out")
+
+        # Run callgrind
+        callgrind = subprocess.run((["valgrind",
+                                     "--tool=callgrind",
+                                     "--callgrind-out-file=" + data_path]
+                                    + command),
+                                   stdout=subprocess.DEVNULL,
+                                   stderr=subprocess.PIPE)
+        if callgrind.returncode:
+            sys.exit(callgrind.stderr.decode("utf-8"))
+
+        # Save callgrind_annotate output
+        with open(annotate_out_path, "w") as output:
+            callgrind_annotate = subprocess.run(
+                ["callgrind_annotate", data_path, "--tree=caller"],
+                stdout=output,
+                stderr=subprocess.PIPE)
+            if callgrind_annotate.returncode:
+                sys.exit(callgrind_annotate.stderr.decode("utf-8"))
+
+        # Read the callgrind_annotate output to callgrind_data[]
+        callgrind_data = []
+        with open(annotate_out_path, 'r') as data:
+            callgrind_data = data.readlines()
+
+        # Line number with the total number of instructions
+        total_instructions_line_number = 20
+        # Get the total number of instructions
+        total_instructions_line_data = \
+            callgrind_data[total_instructions_line_number]
+        total_instructions = total_instructions_line_data.split()[0]
+        total_instructions = int(total_instructions.replace(',', ''))
+
+        # Line number with the JIT self number of instructions
+        JIT_self_instructions_line_number = get_JIT_line(callgrind_data)
+        # Get the JIT self number of instructions
+        JIT_self_instructions_line_data = \
+            callgrind_data[JIT_self_instructions_line_number]
+        JIT_self_instructions = JIT_self_instructions_line_data.split()[0]
+        JIT_self_instructions = int(JIT_self_instructions.replace(',', ''))
+
+        # Line number with the JIT self + inclusive number of instructions
+        # It's the line above the first JIT call when running with --tree=caller
+        JIT_total_instructions_line_number = JIT_self_instructions_line_number-1
+        # Get the JIT self + inclusive number of instructions
+        JIT_total_instructions_line_data = \
+            callgrind_data[JIT_total_instructions_line_number]
+        JIT_total_instructions = JIT_total_instructions_line_data.split()[0]
+        JIT_total_instructions = int(JIT_total_instructions.replace(',', ''))
+
+        # Calculate number of instructions in helpers and code generation
+        helpers_instructions = JIT_total_instructions-JIT_self_instructions
+        code_generation_instructions = total_instructions-JIT_total_instructions
+
+        # Print results (Insert commas in large numbers)
+        # Print total number of instructions
+        print('{:<20}{:>20}\n'.
+              format("Total Instructions:",
+                     format(total_instructions, ',')))
+        # Print code generation instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("Code Generation:",
+                     format(code_generation_instructions, ","),
+                     (code_generation_instructions / total_instructions) * 100))
+        # Print JIT instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("JIT Execution:",
+                     format(JIT_self_instructions, ","),
+                     (JIT_self_instructions / total_instructions) * 100))
+        # Print helpers instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("Helpers:",
+                     format(helpers_instructions, ","),
+                     (helpers_instructions/total_instructions)*100))
+
+
+if __name__ == "__main__":
+    main()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14810.36739 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExv-0004qB-Hv; Thu, 29 Oct 2020 20:56:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14810.36739; Thu, 29 Oct 2020 20:56:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYExv-0004q1-Eg; Thu, 29 Oct 2020 20:56:11 +0000
Received: by outflank-mailman (input) for mailman id 14810;
 Thu, 29 Oct 2020 20:56:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYExv-0004pu-1L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id dbfa2eb0-5c9b-4cea-9ce6-1a0e6687f8cf;
 Thu, 29 Oct 2020 20:56:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExu-00072S-4K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYExu-0001Mn-2B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYExv-0004pu-1L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:11 +0000
X-Inumbo-ID: dbfa2eb0-5c9b-4cea-9ce6-1a0e6687f8cf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id dbfa2eb0-5c9b-4cea-9ce6-1a0e6687f8cf;
	Thu, 29 Oct 2020 20:56:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h4ehkMB439y+aH8iMkG/cdbiwvJJSaH64udeEGbAvlY=; b=3i4JvByKqdz71j7qmjft00AHUZ
	kt6mv+WFP/iJgoDZyYUKqr2y+vQCIQdj2NEgKrXLLe81ylNWOG9oGR/AYdu0EPgsfqwPEKG3tFNYQ
	2Us3QEVXw/gzdqMQT6rmqyZ+j5P6yX0TNfBgxKef3xBG/ydavrC/reuPP2RHuZ4BvdfQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExu-00072S-4K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYExu-0001Mn-2B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: consolidate _post_shutdown()
Message-Id: <E1kYExu-0001Mn-2B@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:56:10 +0000

commit 14661d93d787846833b0e62d5995195c8851f741
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:38 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: consolidate _post_shutdown()
    
    Move more cleanup actions into _post_shutdown. As a change, if QEMU
    should so happen to be terminated during a call to wait(), that event
    will now be logged.
    
    This is not likely to occur during normative use.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200710050649.32434-2-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index c25f0b42cf..ca1f2114e6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,8 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        self._load_io_log()
+
         if self._qemu_log_file is not None:
             self._qemu_log_file.close()
             self._qemu_log_file = None
@@ -307,6 +309,17 @@ class QEMUMachine:
         while len(self._remove_files) > 0:
             self._remove_if_exists(self._remove_files.pop())
 
+        exitcode = self.exitcode()
+        if exitcode is not None and exitcode < 0:
+            msg = 'qemu received signal %i; command: "%s"'
+            if self._qemu_full_args:
+                command = ' '.join(self._qemu_full_args)
+            else:
+                command = ''
+            LOG.warning(msg, -int(exitcode), command)
+
+        self._launched = False
+
     def launch(self):
         """
         Launch the VM and make sure we cleanup and expose the
@@ -355,7 +368,6 @@ class QEMUMachine:
         self._popen.wait()
         if self._qmp:
             self._qmp.close()
-        self._load_io_log()
         self._post_shutdown()
 
     def shutdown(self, has_quit=False, hard=False):
@@ -382,21 +394,8 @@ class QEMUMachine:
                     self._popen.kill()
             self._popen.wait()
 
-        self._load_io_log()
         self._post_shutdown()
 
-        exitcode = self.exitcode()
-        if exitcode is not None and exitcode < 0 and \
-                not (exitcode == -9 and hard):
-            msg = 'qemu received signal %i: %s'
-            if self._qemu_full_args:
-                command = ' '.join(self._qemu_full_args)
-            else:
-                command = ''
-            LOG.warning(msg, -int(exitcode), command)
-
-        self._launched = False
-
     def kill(self):
         self.shutdown(hard=True)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14811.36742 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEy5-0004rV-JE; Thu, 29 Oct 2020 20:56:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14811.36742; Thu, 29 Oct 2020 20:56:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEy5-0004rN-GF; Thu, 29 Oct 2020 20:56:21 +0000
Received: by outflank-mailman (input) for mailman id 14811;
 Thu, 29 Oct 2020 20:56:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEy5-0004rH-5T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6723da28-161b-417f-924b-bc5eb7fe2fa1;
 Thu, 29 Oct 2020 20:56:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEy4-00072h-8G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEy4-0001NW-7P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEy5-0004rH-5T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:21 +0000
X-Inumbo-ID: 6723da28-161b-417f-924b-bc5eb7fe2fa1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6723da28-161b-417f-924b-bc5eb7fe2fa1;
	Thu, 29 Oct 2020 20:56:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rTmX1+A3hXfzfS7LrLwb+B8caHfau3N2lVmidxtuFUo=; b=OB6sgg9a7nIuSeDBtdXsnw0L1n
	kS1j+crrJzneKXc+lN8/P4nrSNbnKyN4PGyo6NMJFnkJA40p00NfvjelDD04xuos+RoX36cMnnJ4v
	Gjr/O+2mvAn2ZisZ5PRNiJk/pyhGkCRQHfxGH1oWs7tWnbbokBW3ZeD3sKeIVwtcCZ6g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEy4-00072h-8G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEy4-0001NW-7P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Close QMP socket in cleanup
Message-Id: <E1kYEy4-0001NW-7P@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:56:20 +0000

commit 671940e633b83ac489e0b4bb407749723ff8a879
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:39 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Close QMP socket in cleanup
    
    It's not important to do this before waiting for the process to exit, so
    it can be done during generic post-shutdown cleanup.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-3-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index ca1f2114e6..d3faa9a84c 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,10 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        if self._qmp:
+            self._qmp.close()
+            self._qmp = None
+
         self._load_io_log()
 
         if self._qemu_log_file is not None:
@@ -366,8 +370,6 @@ class QEMUMachine:
         Wait for the VM to power off
         """
         self._popen.wait()
-        if self._qmp:
-            self._qmp.close()
         self._post_shutdown()
 
     def shutdown(self, has_quit=False, hard=False):
@@ -388,7 +390,6 @@ class QEMUMachine:
                 try:
                     if not has_quit:
                         self._qmp.cmd('quit')
-                    self._qmp.close()
                     self._popen.wait(timeout=3)
                 except:
                     self._popen.kill()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14812.36746 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyG-0004su-Km; Thu, 29 Oct 2020 20:56:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14812.36746; Thu, 29 Oct 2020 20:56:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyG-0004sm-Hm; Thu, 29 Oct 2020 20:56:32 +0000
Received: by outflank-mailman (input) for mailman id 14812;
 Thu, 29 Oct 2020 20:56:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEyG-0004sg-1T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 27adf711-c11f-442f-a672-a8f80e329c37;
 Thu, 29 Oct 2020 20:56:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyE-00072p-Bz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyE-0001O0-B5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEyG-0004sg-1T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:32 +0000
X-Inumbo-ID: 27adf711-c11f-442f-a672-a8f80e329c37
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 27adf711-c11f-442f-a672-a8f80e329c37;
	Thu, 29 Oct 2020 20:56:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VdYjlvXfsz00mjyNvQK0ewcdDAHQnsKxY5VsDZWr8pY=; b=69X2saWHmLxeE8wnJk/7gAzPHN
	+q2a9GTPVnF5BYaxiglOZm8a7ApzPoXp+eKqSYXUgMdckhvsOKAbV+EWHY2GgB1ZpHZO9fc8WFvs3
	rArhn8wIwmMXM55l9Wt1sERfHEziysgSFtHB9pqvjovg57FgfI01cz5hnL1IghaZR7Eo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyE-00072p-Bz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyE-0001O0-B5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Add _early_cleanup hook
Message-Id: <E1kYEyE-0001O0-B5@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:56:30 +0000

commit e2c97f161294c702ee4a2dd08532d5df67f6bff4
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:40 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Add _early_cleanup hook
    
    Some parts of cleanup need to occur prior to shutdown, otherwise
    shutdown might break. Move this into a suitably named method/callback.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-4-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index d3faa9a84c..127926b276 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -365,6 +365,17 @@ class QEMUMachine:
                                        close_fds=False)
         self._post_launch()
 
+    def _early_cleanup(self) -> None:
+        """
+        Perform any cleanup that needs to happen before the VM exits.
+        """
+        # If we keep the console socket open, we may deadlock waiting
+        # for QEMU to exit, while QEMU is waiting for the socket to
+        # become writeable.
+        if self._console_socket is not None:
+            self._console_socket.close()
+            self._console_socket = None
+
     def wait(self):
         """
         Wait for the VM to power off
@@ -376,12 +387,7 @@ class QEMUMachine:
         """
         Terminate the VM and clean up
         """
-        # If we keep the console socket open, we may deadlock waiting
-        # for QEMU to exit, while QEMU is waiting for the socket to
-        # become writeable.
-        if self._console_socket is not None:
-            self._console_socket.close()
-            self._console_socket = None
+        self._early_cleanup()
 
         if self.is_running():
             if hard:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14813.36749 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyP-0004u7-M5; Thu, 29 Oct 2020 20:56:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14813.36749; Thu, 29 Oct 2020 20:56:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyP-0004u0-JE; Thu, 29 Oct 2020 20:56:41 +0000
Received: by outflank-mailman (input) for mailman id 14813;
 Thu, 29 Oct 2020 20:56:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEyP-0004tu-7r
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 39733230-3de4-410f-b651-5a54d5b431b8;
 Thu, 29 Oct 2020 20:56:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyO-000730-FW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyO-0001Ob-Ei
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEyP-0004tu-7r
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:41 +0000
X-Inumbo-ID: 39733230-3de4-410f-b651-5a54d5b431b8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 39733230-3de4-410f-b651-5a54d5b431b8;
	Thu, 29 Oct 2020 20:56:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8GAZrb/llLmYpdtgH/A9t9Nvoupyuchb7VP3l+L1dfA=; b=tIvEdFNHS3nSpE8AKnP5tSrvXb
	7JH9J7+gMf3yulPaL8/9DXAkj8rdh8nN24RntNpCUKgU4hDd0jsceJvIIoJd1L7aQFKo408FSyj17
	RoyrC9uCHXSeJDpCTt7nuPMgTEN9lAMhWLA2LXmWob+jRXTnCFzrdXVwVANq89uS6v6g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyO-000730-FW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyO-0001Ob-Ei
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Perform early cleanup for wait() calls, too
Message-Id: <E1kYEyO-0001Ob-Ei@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:56:40 +0000

commit 3a7d64b6fc8ddce3987005e0ee6eadbe2cbba5c8
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:41 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Perform early cleanup for wait() calls, too
    
    This is primarily for consistency, and is a step towards wait() and
    shutdown() sharing the same implementation so that the two cleanup paths
    cannot diverge.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-5-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 127926b276..63e40879e2 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -380,6 +380,7 @@ class QEMUMachine:
         """
         Wait for the VM to power off
         """
+        self._early_cleanup()
         self._popen.wait()
         self._post_shutdown()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:56:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:56:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14814.36753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEya-0004vc-Nw; Thu, 29 Oct 2020 20:56:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14814.36753; Thu, 29 Oct 2020 20:56:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEya-0004vV-L4; Thu, 29 Oct 2020 20:56:52 +0000
Received: by outflank-mailman (input) for mailman id 14814;
 Thu, 29 Oct 2020 20:56:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEyZ-0004vM-FJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a3bf4725-1f3a-414c-87d4-4eae59d84c28;
 Thu, 29 Oct 2020 20:56:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyY-000738-JD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyY-0001PG-IH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEyZ-0004vM-FJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:51 +0000
X-Inumbo-ID: a3bf4725-1f3a-414c-87d4-4eae59d84c28
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a3bf4725-1f3a-414c-87d4-4eae59d84c28;
	Thu, 29 Oct 2020 20:56:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yzzd5uJrz9vAjr7BgDvKHemqxE7d3zfgVpojIiyTZ50=; b=42K0laVpmJJmvF72m2B+QMsFpE
	W6TqQ7jnSa/Oe2t8/6A/iydeMt64u47K3/JpLdU63a4+yjxJVov53RMU+zvUXCfUUmEWIlDJI2O+w
	dvNnpBaQtH6hQFbDyFDkzQSvGjodMbThr48Lpmj+d/7rRvhzS7ptSxapidNxu42sSvq8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyY-000738-JD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyY-0001PG-IH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:56:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Prohibit multiple shutdown() calls
Message-Id: <E1kYEyY-0001PG-IH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:56:50 +0000

commit a3842cb078a195db0715b00edd7812adcb8b077f
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:42 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Prohibit multiple shutdown() calls
    
    If the VM is not launched, don't try to shut it down. As a change,
    _post_shutdown now unconditionally also calls _early_cleanup in order to
    offer comprehensive object cleanup in failure cases.
    
    As a courtesy, treat it as a NOP instead of rejecting it as an
    error. This is slightly nicer for acceptance tests where vm.shutdown()
    is issued unconditionally in tearDown callbacks.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200710050649.32434-6-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 63e40879e2..c28957ee82 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,13 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        """
+        Called to cleanup the VM instance after the process has exited.
+        May also be called after a failed launch.
+        """
+        # Comprehensive reset for the failed launch case:
+        self._early_cleanup()
+
         if self._qmp:
             self._qmp.close()
             self._qmp = None
@@ -339,7 +346,7 @@ class QEMUMachine:
             self._launch()
             self._launched = True
         except:
-            self.shutdown()
+            self._post_shutdown()
 
             LOG.debug('Error launching VM')
             if self._qemu_full_args:
@@ -368,6 +375,8 @@ class QEMUMachine:
     def _early_cleanup(self) -> None:
         """
         Perform any cleanup that needs to happen before the VM exits.
+
+        Called additionally by _post_shutdown for comprehensive cleanup.
         """
         # If we keep the console socket open, we may deadlock waiting
         # for QEMU to exit, while QEMU is waiting for the socket to
@@ -388,6 +397,9 @@ class QEMUMachine:
         """
         Terminate the VM and clean up
         """
+        if not self._launched:
+            return
+
         self._early_cleanup()
 
         if self.is_running():
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14815.36758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyk-0004xG-Ps; Thu, 29 Oct 2020 20:57:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14815.36758; Thu, 29 Oct 2020 20:57:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyk-0004x8-Mf; Thu, 29 Oct 2020 20:57:02 +0000
Received: by outflank-mailman (input) for mailman id 14815;
 Thu, 29 Oct 2020 20:57:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEyj-0004ww-Nw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e41b09f8-fded-474a-994b-372c9d5273f7;
 Thu, 29 Oct 2020 20:57:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyi-00073u-Mo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEyi-0001Po-M3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEyj-0004ww-Nw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:01 +0000
X-Inumbo-ID: e41b09f8-fded-474a-994b-372c9d5273f7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e41b09f8-fded-474a-994b-372c9d5273f7;
	Thu, 29 Oct 2020 20:57:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CyPr7k3R6lhEYUfeUAIvow1GcNMF558gMKOahQeaC7M=; b=kvGmF89M3Gw6R7ySqK6/4lF9/x
	ZMaNYgKWfyo8H0BGX7StX1JqDIlhQGZ4CAZtp45ZmimnDnqe0h5AYkPjuwfdKupM3HN9R/wwDpY4V
	Z4E6KzX5D8DPMBQ8F6Wva8NPU/q/4XMDhBFfTSc9QCig9ljlLdRj2g5RiywwqKYXr31M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyi-00073u-Mo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEyi-0001Po-M3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Add a configurable timeout to shutdown()
Message-Id: <E1kYEyi-0001Po-M3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:00 +0000

commit c9b3045bc2f52aca8825b6a04e9367b87d64d1cf
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:43 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Add a configurable timeout to shutdown()
    
    Three seconds is hardcoded. Use it as a default parameter instead, and use that
    value for both waits that may occur in the function.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-7-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index c28957ee82..e825f0bdc6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -393,7 +393,9 @@ class QEMUMachine:
         self._popen.wait()
         self._post_shutdown()
 
-    def shutdown(self, has_quit=False, hard=False):
+    def shutdown(self, has_quit: bool = False,
+                 hard: bool = False,
+                 timeout: Optional[int] = 3) -> None:
         """
         Terminate the VM and clean up
         """
@@ -409,10 +411,10 @@ class QEMUMachine:
                 try:
                     if not has_quit:
                         self._qmp.cmd('quit')
-                    self._popen.wait(timeout=3)
+                    self._popen.wait(timeout=timeout)
                 except:
                     self._popen.kill()
-            self._popen.wait()
+            self._popen.wait(timeout=timeout)
 
         self._post_shutdown()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14816.36762 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyu-0004yY-RY; Thu, 29 Oct 2020 20:57:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14816.36762; Thu, 29 Oct 2020 20:57:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEyu-0004yO-OL; Thu, 29 Oct 2020 20:57:12 +0000
Received: by outflank-mailman (input) for mailman id 14816;
 Thu, 29 Oct 2020 20:57:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEyt-0004yE-IA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c128a6a4-933d-47e0-bb85-22bf88525060;
 Thu, 29 Oct 2020 20:57:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEys-00074K-Qk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEys-0001QS-PY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEyt-0004yE-IA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:11 +0000
X-Inumbo-ID: c128a6a4-933d-47e0-bb85-22bf88525060
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c128a6a4-933d-47e0-bb85-22bf88525060;
	Thu, 29 Oct 2020 20:57:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0f3EA2MXyNJ+FD5clqeeLfkFFgY93hiDumEo6/ckw7s=; b=1axSTWrP46vjtpFs3FpJYm0cr/
	G3Q6Q+3/I4qWc14yWZFHqRGnfPnNOt6625Tca6j0SrJz/Y04mdA3AZJqRpotzs4x5JnkssiGxwewn
	eSJpYwE5ZIovXqwjCaGst5FyG2Pd6pafgCTr8deos13Zj/3Bl9TwVPmn22THM6OrYZ4s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEys-00074K-Qk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEys-0001QS-PY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: Make wait() call shutdown()
Message-Id: <E1kYEys-0001QS-PY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:10 +0000

commit 895280593139a1c34e59526835ba8fda903f8aaa
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:44 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Make wait() call shutdown()
    
    At this point, shutdown(has_quit=True) and wait() do essentially the
    same thing; they perform cleanup without actually instructing QEMU to
    quit.
    
    Define one in terms of the other.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-8-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index e825f0bdc6..3f0b873f58 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -385,14 +385,6 @@ class QEMUMachine:
             self._console_socket.close()
             self._console_socket = None
 
-    def wait(self):
-        """
-        Wait for the VM to power off
-        """
-        self._early_cleanup()
-        self._popen.wait()
-        self._post_shutdown()
-
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
                  timeout: Optional[int] = 3) -> None:
@@ -421,6 +413,15 @@ class QEMUMachine:
     def kill(self):
         self.shutdown(hard=True)
 
+    def wait(self, timeout: Optional[int] = None) -> None:
+        """
+        Wait for the VM to power off and perform post-shutdown cleanup.
+
+        :param timeout: Optional timeout in seconds.
+                        Default None, an infinite wait.
+        """
+        self.shutdown(has_quit=True, timeout=timeout)
+
     def set_qmp_monitor(self, enabled=True):
         """
         Set the QMP monitor.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14817.36766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEz4-000504-Um; Thu, 29 Oct 2020 20:57:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14817.36766; Thu, 29 Oct 2020 20:57:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEz4-0004zv-RX; Thu, 29 Oct 2020 20:57:22 +0000
Received: by outflank-mailman (input) for mailman id 14817;
 Thu, 29 Oct 2020 20:57:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEz3-0004zl-UH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9959970b-fe58-44c0-b558-2e57d4984fb7;
 Thu, 29 Oct 2020 20:57:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEz2-00074W-Up
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEz2-0001Qx-TZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEz3-0004zl-UH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:21 +0000
X-Inumbo-ID: 9959970b-fe58-44c0-b558-2e57d4984fb7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9959970b-fe58-44c0-b558-2e57d4984fb7;
	Thu, 29 Oct 2020 20:57:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fww18I9blf95ncVWZ8PlWYugps0jFuogxmLmM7lY1jU=; b=Avjt4XxyJH9Vl3nGyvM9/Iywqv
	jCbWBHep7Oz897UOjPDiORw9aZbI2xV+ZnvLdw4WD2BxLqvJDyELFSef+uLNEuOx6iBsKQMhPCRkQ
	J2SmKxgxtOxUTvWVeFSM1IiPfnOM+onczGR1a5CUTGOD/+xi3HYsEjQQtxay39aKRuBA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEz2-00074W-Up
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEz2-0001Qx-TZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/acceptance: wait() instead of shutdown() where appropriate
Message-Id: <E1kYEz2-0001Qx-TZ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:20 +0000

commit a0690c39006b897d6453daf591909948ac553650
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:45 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    tests/acceptance: wait() instead of shutdown() where appropriate
    
    When issuing 'reboot' to a VM with the no-reboot option, that VM will
    exit. When then issuing a shutdown command, the cleanup may race.
    
    Add calls to vm.wait() which will gracefully mark the VM as having
    exited. Subsequent vm.shutdown() calls in generic tearDown code will not
    race when called after completion of the call.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-9-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_linux_console.py   | 10 ++++++++++
 tests/acceptance/linux_ssh_mips_malta.py |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3d02519660..5867ef760c 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -191,6 +191,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Debian')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
     def test_mips64el_malta_5KEc_cpio(self):
@@ -231,6 +233,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 '3.19.3.mtoman.20150408')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
         kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -506,6 +510,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'system-control@1c00000')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
 
     def test_arm_cubieboard_sata(self):
         """
@@ -550,6 +555,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'sda')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
 
     def test_arm_orangepi(self):
         """
@@ -615,6 +621,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'system-control@1c00000')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def test_arm_orangepi_sd(self):
         """
@@ -662,6 +670,8 @@ class BootLinuxConsole(LinuxKernelTest):
             '3 packets transmitted, 3 packets received, 0% packet loss')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
     @skipUnless(P7ZIP_AVAILABLE, '7z not installed')
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
index 90d7f2f167..25c5c5f741 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -212,6 +212,8 @@ class LinuxSSH(Test):
 
         self.run_common_commands(wordsize)
         self.shutdown_via_ssh()
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def test_mips_malta32eb_kernel3_2_0(self):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14818.36770 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzE-00051L-WF; Thu, 29 Oct 2020 20:57:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14818.36770; Thu, 29 Oct 2020 20:57:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzE-00051C-TI; Thu, 29 Oct 2020 20:57:32 +0000
Received: by outflank-mailman (input) for mailman id 14818;
 Thu, 29 Oct 2020 20:57:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEzD-000513-TJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 40af2cb1-3f29-4302-8ac4-ae08de23fa9f;
 Thu, 29 Oct 2020 20:57:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzD-00074g-2M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzD-0001Rd-1b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEzD-000513-TJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
X-Inumbo-ID: 40af2cb1-3f29-4302-8ac4-ae08de23fa9f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 40af2cb1-3f29-4302-8ac4-ae08de23fa9f;
	Thu, 29 Oct 2020 20:57:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6ZLRsnNHlnydwkE1RIy/awOiuVAbJTRmgPTEdT0Ie5o=; b=Pwh3dNsmOjxbSY0NlbTylZoQz2
	eSHKx/oNo441w9eLl2/eCRhTmLeLYV1MlB20SuYl8u4oQhOPW0BK3vdoodri93H+qAYAz+giyE8oe
	3HE0TGTu/GJ8PXf+xB6zht6MlrU3a1eaGqXTnHIyuCjp8fa/JU10o1KTqydCrpGLEe6Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzD-00074g-2M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzD-0001Rd-1b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/acceptance: Don't test reboot on cubieboard
Message-Id: <E1kYEzD-0001Rd-1b@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:31 +0000

commit fdb87f0dc2ed8e4f712a88fb5f9382ceea620223
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:46 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    tests/acceptance: Don't test reboot on cubieboard
    
    cubieboard does not have a functioning reboot, it halts and QEMU does
    not exit.
    
    vm.shutdown() is modified in a forthcoming patch that makes it less tolerant
    of race conditions on shutdown; tests should consciously decide to WAIT
    or to SHUTDOWN qemu.
    
    So long as this test is attempting to reboot, the correct choice would
    be to WAIT for the VM to exit. However, since that's broken, we should
    SHUTDOWN instead.
    
    SHUTDOWN is indeed what already happens when the test performs teardown,
    however, if anyone fixes cubieboard reboot in the future, this test will
    develop a new race condition that might be hard to debug.
    
    Therefore: remove the reboot test and make it obvious that the VM is
    still running when the test concludes, where the test teardown will do
    the right thing.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-10-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_linux_console.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 5867ef760c..8b8b828bc5 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -508,9 +508,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Allwinner sun4i/sun5i')
         exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
                                                 'system-control@1c00000')
-        exec_command_and_wait_for_pattern(self, 'reboot',
-                                                'reboot: Restarting system')
-        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
+        # cubieboard's reboot is not functioning; omit reboot test.
 
     def test_arm_cubieboard_sata(self):
         """
@@ -553,9 +551,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Allwinner sun4i/sun5i')
         exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
                                                 'sda')
-        exec_command_and_wait_for_pattern(self, 'reboot',
-                                                'reboot: Restarting system')
-        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
+        # cubieboard's reboot is not functioning; omit reboot test.
 
     def test_arm_orangepi(self):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14819.36774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzP-00052g-1g; Thu, 29 Oct 2020 20:57:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14819.36774; Thu, 29 Oct 2020 20:57:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzO-00052Y-Uq; Thu, 29 Oct 2020 20:57:42 +0000
Received: by outflank-mailman (input) for mailman id 14819;
 Thu, 29 Oct 2020 20:57:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEzO-00052O-9m
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 05cdf5d2-3bcb-4dae-9579-dc9f88bdeaf9;
 Thu, 29 Oct 2020 20:57:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzN-00076J-6t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzN-0001To-5E
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEzO-00052O-9m
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:42 +0000
X-Inumbo-ID: 05cdf5d2-3bcb-4dae-9579-dc9f88bdeaf9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 05cdf5d2-3bcb-4dae-9579-dc9f88bdeaf9;
	Thu, 29 Oct 2020 20:57:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CC7KvJkd0uj+ZdmZBh4N/1YY01y5F2vvHnPgVJkJBcE=; b=AIgEmEdknKLJX6XSx3H/aHZ68D
	s95Icc1cgoFjVmR0mvup6opvkcBaTKs3bYnu35VamUZMrdanpf/pi3I9K/BiAYElFib2Skj5Sgwv3
	wICUYwv8XPZdgx4YaDD+lIdj0vD1VIh2yp5sf/J+21YpQat2Mbc5dvN3t9gkcgWjAgAI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzN-00076J-6t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzN-0001To-5E
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: split shutdown into hard and soft flavors
Message-Id: <E1kYEzN-0001To-5E@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:41 +0000

commit 193bf1c061ce0bb078ebc153facb9f31fe139d72
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:47 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: split shutdown into hard and soft flavors
    
    This is done primarily to avoid the 'bare except' pattern, which
    suppresses all exceptions during shutdown and can obscure errors.
    
    Replace this with a pattern that isolates the different kind of shutdown
    paradigms (_hard_shutdown and _soft_shutdown), and a new fallback shutdown
    handler (_do_shutdown) that gracefully attempts one before the other.
    
    This split now also ensures that no matter what happens,
    _post_shutdown() is always invoked.
    
    shutdown() changes in behavior such that if it attempts to do a graceful
    shutdown and is unable to, it will now always raise an exception to
    indicate this. This can be avoided by the test writer in three ways:
    
    1. If the VM is expected to have already exited or is in the process of
    exiting, wait() can be used instead of shutdown() to clean up resources
    instead. This helps avoid race conditions in shutdown.
    
    2. If a test writer is expecting graceful shutdown to fail, shutdown
    should be called in a try...except block.
    
    3. If the test writer has no interest in performing a graceful shutdown
    at all, kill() can be used instead.
    
    Handling shutdown in this way makes it much more explicit which type of
    shutdown we want and allows the library to report problems with this
    process.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-11-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 98 ++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 83 insertions(+), 15 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 3f0b873f58..a955e3f221 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -49,6 +49,12 @@ class QEMUMachineAddDeviceError(QEMUMachineError):
     """
 
 
+class AbnormalShutdown(QEMUMachineError):
+    """
+    Exception raised when a graceful shutdown was requested, but not performed.
+    """
+
+
 class MonitorResponseError(qmp.QMPError):
     """
     Represents erroneous QMP monitor reply
@@ -376,6 +382,7 @@ class QEMUMachine:
         """
         Perform any cleanup that needs to happen before the VM exits.
 
+        May be invoked by both soft and hard shutdown in failover scenarios.
         Called additionally by _post_shutdown for comprehensive cleanup.
         """
         # If we keep the console socket open, we may deadlock waiting
@@ -385,32 +392,93 @@ class QEMUMachine:
             self._console_socket.close()
             self._console_socket = None
 
+    def _hard_shutdown(self) -> None:
+        """
+        Perform early cleanup, kill the VM, and wait for it to terminate.
+
+        :raise subprocess.Timeout: When timeout is exceeds 60 seconds
+            waiting for the QEMU process to terminate.
+        """
+        self._early_cleanup()
+        self._popen.kill()
+        self._popen.wait(timeout=60)
+
+    def _soft_shutdown(self, has_quit: bool = False,
+                       timeout: Optional[int] = 3) -> None:
+        """
+        Perform early cleanup, attempt to gracefully shut down the VM, and wait
+        for it to terminate.
+
+        :param has_quit: When True, don't attempt to issue 'quit' QMP command
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
+
+        :raise ConnectionReset: On QMP communication errors
+        :raise subprocess.TimeoutExpired: When timeout is exceeded waiting for
+            the QEMU process to terminate.
+        """
+        self._early_cleanup()
+
+        if self._qmp is not None:
+            if not has_quit:
+                # Might raise ConnectionReset
+                self._qmp.cmd('quit')
+
+        # May raise subprocess.TimeoutExpired
+        self._popen.wait(timeout=timeout)
+
+    def _do_shutdown(self, has_quit: bool = False,
+                     timeout: Optional[int] = 3) -> None:
+        """
+        Attempt to shutdown the VM gracefully; fallback to a hard shutdown.
+
+        :param has_quit: When True, don't attempt to issue 'quit' QMP command
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
+
+        :raise AbnormalShutdown: When the VM could not be shut down gracefully.
+            The inner exception will likely be ConnectionReset or
+            subprocess.TimeoutExpired. In rare cases, non-graceful termination
+            may result in its own exceptions, likely subprocess.TimeoutExpired.
+        """
+        try:
+            self._soft_shutdown(has_quit, timeout)
+        except Exception as exc:
+            self._hard_shutdown()
+            raise AbnormalShutdown("Could not perform graceful shutdown") \
+                from exc
+
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
                  timeout: Optional[int] = 3) -> None:
         """
-        Terminate the VM and clean up
+        Terminate the VM (gracefully if possible) and perform cleanup.
+        Cleanup will always be performed.
+
+        If the VM has not yet been launched, or shutdown(), wait(), or kill()
+        have already been called, this method does nothing.
+
+        :param has_quit: When true, do not attempt to issue 'quit' QMP command.
+        :param hard: When true, do not attempt graceful shutdown, and
+                     suppress the SIGKILL warning log message.
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
         """
         if not self._launched:
             return
 
-        self._early_cleanup()
-
-        if self.is_running():
+        try:
             if hard:
-                self._popen.kill()
-            elif self._qmp:
-                try:
-                    if not has_quit:
-                        self._qmp.cmd('quit')
-                    self._popen.wait(timeout=timeout)
-                except:
-                    self._popen.kill()
-            self._popen.wait(timeout=timeout)
-
-        self._post_shutdown()
+                self._hard_shutdown()
+            else:
+                self._do_shutdown(has_quit, timeout=timeout)
+        finally:
+            self._post_shutdown()
 
     def kill(self):
+        """
+        Terminate the VM forcefully, wait for it to exit, and perform cleanup.
+        """
         self.shutdown(hard=True)
 
     def wait(self, timeout: Optional[int] = None) -> None:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:57:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:57:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14820.36777 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzZ-00053z-33; Thu, 29 Oct 2020 20:57:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14820.36777; Thu, 29 Oct 2020 20:57:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzZ-00053r-0C; Thu, 29 Oct 2020 20:57:53 +0000
Received: by outflank-mailman (input) for mailman id 14820;
 Thu, 29 Oct 2020 20:57:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEzY-00053c-8o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 281897d0-c614-49b5-8154-c4c328be7262;
 Thu, 29 Oct 2020 20:57:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzX-00076P-AV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzX-0001UO-9k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEzY-00053c-8o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:52 +0000
X-Inumbo-ID: 281897d0-c614-49b5-8154-c4c328be7262
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 281897d0-c614-49b5-8154-c4c328be7262;
	Thu, 29 Oct 2020 20:57:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MUOG0OJ/uNfb/hnHy5pAwkke4R8a4wwSMps9hdT2DDs=; b=GK301ecU8iSvCz9DilCFQBu18u
	POZOs3JGOwm62S8xWun8Ic4+FM1OtAnQVxuDP11jRgL5cc+19nunGzw6N40LkmgrU1RFYMVtWZevE
	zKhDWZuzv0WNxcINo3Cy0Rq49gdbijJwQRnYEgGjWGogaDNzXy/oYmS86PKaqi17B/BA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzX-00076P-AV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzX-0001UO-9k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:57:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: re-add sigkill warning suppression
Message-Id: <E1kYEzX-0001UO-9k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:57:51 +0000

commit de6e08b5b987afbaf22e37e7f9e34421fb76ef3f
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:48 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: re-add sigkill warning suppression
    
    If the user kills QEMU on purpose, we don't need to warn
    them about that having happened: they know already.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-12-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index a955e3f221..736a3c906f 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -22,6 +22,7 @@ import logging
 import os
 import subprocess
 import shutil
+import signal
 import socket
 import tempfile
 from typing import Optional, Type
@@ -133,6 +134,7 @@ class QEMUMachine:
         self._console_address = None
         self._console_socket = None
         self._remove_files = []
+        self._user_killed = False
         self._console_log_path = console_log
         if self._console_log_path:
             # In order to log the console, buffering needs to be enabled.
@@ -327,7 +329,8 @@ class QEMUMachine:
             self._remove_if_exists(self._remove_files.pop())
 
         exitcode = self.exitcode()
-        if exitcode is not None and exitcode < 0:
+        if (exitcode is not None and exitcode < 0
+                and not (self._user_killed and exitcode == -signal.SIGKILL)):
             msg = 'qemu received signal %i; command: "%s"'
             if self._qemu_full_args:
                 command = ' '.join(self._qemu_full_args)
@@ -335,6 +338,7 @@ class QEMUMachine:
                 command = ''
             LOG.warning(msg, -int(exitcode), command)
 
+        self._user_killed = False
         self._launched = False
 
     def launch(self):
@@ -469,6 +473,7 @@ class QEMUMachine:
 
         try:
             if hard:
+                self._user_killed = True
                 self._hard_shutdown()
             else:
                 self._do_shutdown(has_quit, timeout=timeout)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14821.36782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzj-00057O-4k; Thu, 29 Oct 2020 20:58:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14821.36782; Thu, 29 Oct 2020 20:58:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzj-00057G-1o; Thu, 29 Oct 2020 20:58:03 +0000
Received: by outflank-mailman (input) for mailman id 14821;
 Thu, 29 Oct 2020 20:58:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEzi-000579-BO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ed1b694e-3f49-4dd3-b689-3c6f286c76d0;
 Thu, 29 Oct 2020 20:58:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzh-00076x-ET
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzh-0001VJ-DE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEzi-000579-BO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:02 +0000
X-Inumbo-ID: ed1b694e-3f49-4dd3-b689-3c6f286c76d0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ed1b694e-3f49-4dd3-b689-3c6f286c76d0;
	Thu, 29 Oct 2020 20:58:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U+3YrpZKV9ks92A8IHNLtp2jJNWqR5NIPpyaRB6NZ94=; b=sV7g67bNR6WCGEpkpxEmjJh3/k
	baTKLalgQLS1dHVKKPJ8DkX5uIal9yvQHdY/k0DVQZtrvGGTSNhLMcxPTz8a4kypY8XEYAeq7OKW5
	sdT20Hi+dGod7a68cIqVX7b7PPJzqafgieO6tGaNQJ30oVMdSPqF53Lxr/ZZUdJaMx60=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzh-00076x-ET
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzh-0001VJ-DE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine.py: change default wait timeout to 3 seconds
Message-Id: <E1kYEzh-0001VJ-DE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:01 +0000

commit 04f0e36eba7b1a06e413a0690d4b1a24994d99fe
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:49 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: change default wait timeout to 3 seconds
    
    Machine.wait() does not appear to be used except in the acceptance tests,
    and an infinite timeout by default in a test suite is not the most helpful.
    
    Change it to 3 seconds, like the default shutdown timeout.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-13-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 736a3c906f..69055189bd 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -486,12 +486,12 @@ class QEMUMachine:
         """
         self.shutdown(hard=True)
 
-    def wait(self, timeout: Optional[int] = None) -> None:
+    def wait(self, timeout: Optional[int] = 3) -> None:
         """
         Wait for the VM to power off and perform post-shutdown cleanup.
 
         :param timeout: Optional timeout in seconds.
-                        Default None, an infinite wait.
+                        Default 3 seconds, A value of None is an infinite wait.
         """
         self.shutdown(has_quit=True, timeout=timeout)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14822.36786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzt-00058z-7c; Thu, 29 Oct 2020 20:58:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14822.36786; Thu, 29 Oct 2020 20:58:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYEzt-00058r-4c; Thu, 29 Oct 2020 20:58:13 +0000
Received: by outflank-mailman (input) for mailman id 14822;
 Thu, 29 Oct 2020 20:58:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYEzs-00058i-BW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 12d2e841-a02e-43cb-a752-fa090268153d;
 Thu, 29 Oct 2020 20:58:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzr-00077I-JR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYEzr-0001Vp-HF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYEzs-00058i-BW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:12 +0000
X-Inumbo-ID: 12d2e841-a02e-43cb-a752-fa090268153d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 12d2e841-a02e-43cb-a752-fa090268153d;
	Thu, 29 Oct 2020 20:58:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vuOanAiRjBHhLkOmjYcFQZg0kP+JqR057xwKoDVo4F4=; b=6CYVAUW9ljiM/OcPMyMk1o0QLw
	RRHSov3o09Jww1SmUDC6JhlzAfi/oZnWEt18D/68PEZscy43wGSY1Cr9Hg9t6dQ+kRPdqQ/53m4ti
	1ZOE8/FCexh2jgJ94UNWn2nqIXD0iv60mgn2BvNi44KOPAaxREYiCx9vxguYTlXAsPRY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzr-00077I-JR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYEzr-0001Vp-HF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qmp.py: Define common types
Message-Id: <E1kYEzr-0001Vp-HF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:11 +0000

commit a5d76376d65d8777f28bb064412a8d72fa2c7953
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:05 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: Define common types
    
    Define some common types that we'll need to annotate a lot of other
    functions going forward.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-2-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index e64b6b5faa..8388c7b603 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -12,13 +12,31 @@ import errno
 import socket
 import logging
 from typing import (
+    Any,
+    Dict,
     Optional,
     TextIO,
     Type,
+    Tuple,
+    Union,
 )
 from types import TracebackType
 
 
+# QMPMessage is a QMP Message of any kind.
+# e.g. {'yee': 'haw'}
+#
+# QMPReturnValue is the inner value of return values only.
+# {'return': {}} is the QMPMessage,
+# {} is the QMPReturnValue.
+QMPMessage = Dict[str, Any]
+QMPReturnValue = Dict[str, Any]
+
+InternetAddrT = Tuple[str, str]
+UnixAddrT = str
+SocketAddrT = Union[InternetAddrT, UnixAddrT]
+
+
 class QMPError(Exception):
     """
     QMP base exception
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14823.36790 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF04-0005AJ-9l; Thu, 29 Oct 2020 20:58:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14823.36790; Thu, 29 Oct 2020 20:58:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF04-0005A9-6S; Thu, 29 Oct 2020 20:58:24 +0000
Received: by outflank-mailman (input) for mailman id 14823;
 Thu, 29 Oct 2020 20:58:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF02-0005A0-Q7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 16748df9-0d75-4f3c-a2d3-a716cb981693;
 Thu, 29 Oct 2020 20:58:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF01-00077S-NK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF01-0001WN-MO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF02-0005A0-Q7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:22 +0000
X-Inumbo-ID: 16748df9-0d75-4f3c-a2d3-a716cb981693
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 16748df9-0d75-4f3c-a2d3-a716cb981693;
	Thu, 29 Oct 2020 20:58:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H7avhpZxD7RFiyFDqVZHl3PJUUNWbUrntrcwOqZyMMk=; b=DCl8e3SggtAEyWkTJwlkFwJ4HJ
	VRipPIVX7jL6SjCPWGrU9yfih2YaHhKOhaTNhspPoTdtPePwd1JHnWHnEMUZhHqFCPNaShQea6cG/
	36nu9FRHfm7KEPTIGK45jCpsV5am5ch4ZieOjFZWwgzdqzQPlpkrn3ZyU/7EkrvSCoPk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF01-00077S-NK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF01-0001WN-MO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests.py: use qemu.qmp type aliases
Message-Id: <E1kYF01-0001WN-MO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:21 +0000

commit 2012453ddde0506d044d4739257227c6868028b6
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:06 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    iotests.py: use qemu.qmp type aliases
    
    iotests.py should use the type definitions from qmp.py instead of its
    own.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-3-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/qemu-iotests/iotests.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8b760405ee..3590ed78a0 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -35,13 +35,10 @@ import unittest
 # pylint: disable=import-error, wrong-import-position
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu import qtest
+from qemu.qmp import QMPMessage
 
 assert sys.version_info >= (3, 6)
 
-# Type Aliases
-QMPResponse = Dict[str, Any]
-
-
 # Use this logger for logging messages directly from the iotests module
 logger = logging.getLogger('qemu.iotests')
 logger.addHandler(logging.NullHandler())
@@ -561,7 +558,7 @@ class VM(qtest.QEMUQtestMachine):
         self._args.append(addr)
         return self
 
-    def hmp(self, command_line: str, use_log: bool = False) -> QMPResponse:
+    def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage:
         cmd = 'human-monitor-command'
         kwargs = {'command-line': command_line}
         if use_log:
@@ -582,7 +579,7 @@ class VM(qtest.QEMUQtestMachine):
         self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
 
     def hmp_qemu_io(self, drive: str, cmd: str,
-                    use_log: bool = False) -> QMPResponse:
+                    use_log: bool = False) -> QMPMessage:
         """Write to a given drive using an HMP command"""
         return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14824.36795 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0E-0005BZ-Bp; Thu, 29 Oct 2020 20:58:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14824.36795; Thu, 29 Oct 2020 20:58:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0E-0005BN-7y; Thu, 29 Oct 2020 20:58:34 +0000
Received: by outflank-mailman (input) for mailman id 14824;
 Thu, 29 Oct 2020 20:58:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF0C-0005BD-Qy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 576701ab-2645-4028-9bf1-6f415dbd8bf4;
 Thu, 29 Oct 2020 20:58:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0B-00077a-R3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0B-0001Wv-QK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF0C-0005BD-Qy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:32 +0000
X-Inumbo-ID: 576701ab-2645-4028-9bf1-6f415dbd8bf4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 576701ab-2645-4028-9bf1-6f415dbd8bf4;
	Thu, 29 Oct 2020 20:58:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Pnd5rvONg9Nzo4lD6Z1SjvAKe671StWaTgTpF9y0++8=; b=exy9KIXqNmv0ixSpIdKn/mGwSH
	lwBt1P0i6OgOBv9Osi53eZ3yYy5ne2mBPaj6ozfe10aui35LL9UL71Sc0NbCZ2wtMDu15mDZpKdN2
	7W/ONQFYEct+8hvZKanROnK5rlcAo5ijX8U7/1NXAIKusLRVaQTQk+vGnYT3xnfQwt9o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0B-00077a-R3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0B-0001Wv-QK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qmp.py: re-absorb MonitorResponseError
Message-Id: <E1kYF0B-0001Wv-QK@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:31 +0000

commit e3a23b4803a3939c7e24e8946880f5ef369ef781
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:07 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: re-absorb MonitorResponseError
    
    When I initially split this out, I considered this more of a machine
    error than a QMP protocol error, but I think that's misguided.
    
    Move this back to qmp.py and name it QMPResponseError. Convert
    qmp.command() to use this exception type.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-4-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py        | 15 +--------------
 python/qemu/qmp.py            | 17 +++++++++++++++--
 scripts/render_block_graph.py |  7 +++++--
 3 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 69055189bd..80c4d4a8b6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -56,19 +56,6 @@ class AbnormalShutdown(QEMUMachineError):
     """
 
 
-class MonitorResponseError(qmp.QMPError):
-    """
-    Represents erroneous QMP monitor reply
-    """
-    def __init__(self, reply):
-        try:
-            desc = reply["error"]["desc"]
-        except KeyError:
-            desc = reply
-        super().__init__(desc)
-        self.reply = reply
-
-
 class QEMUMachine:
     """
     A QEMU VM
@@ -533,7 +520,7 @@ class QEMUMachine:
         if reply is None:
             raise qmp.QMPError("Monitor is closed")
         if "error" in reply:
-            raise MonitorResponseError(reply)
+            raise qmp.QMPResponseError(reply)
         return reply["return"]
 
     def get_qmp_event(self, wait=False):
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index 8388c7b603..aa8a666b8a 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -61,6 +61,19 @@ class QMPTimeoutError(QMPError):
     """
 
 
+class QMPResponseError(QMPError):
+    """
+    Represents erroneous QMP monitor reply
+    """
+    def __init__(self, reply: QMPMessage):
+        try:
+            desc = reply['error']['desc']
+        except KeyError:
+            desc = reply
+        super().__init__(desc)
+        self.reply = reply
+
+
 class QEMUMonitorProtocol:
     """
     Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) and then
@@ -251,8 +264,8 @@ class QEMUMonitorProtocol:
         Build and send a QMP command to the monitor, report errors if any
         """
         ret = self.cmd(cmd, kwds)
-        if "error" in ret:
-            raise Exception(ret['error']['desc'])
+        if 'error' in ret:
+            raise QMPResponseError(ret)
         return ret['return']
 
     def pull_event(self, wait=False):
diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py
index 409b4321f2..da6acf050d 100755
--- a/scripts/render_block_graph.py
+++ b/scripts/render_block_graph.py
@@ -25,7 +25,10 @@ import json
 from graphviz import Digraph
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
-from qemu.machine import MonitorResponseError
+from qemu.qmp import (
+    QEMUMonitorProtocol,
+    QMPResponseError,
+)
 
 
 def perm(arr):
@@ -102,7 +105,7 @@ class LibvirtGuest():
         reply = json.loads(subprocess.check_output(ar))
 
         if 'error' in reply:
-            raise MonitorResponseError(reply)
+            raise QMPResponseError(reply)
 
         return reply['return']
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14825.36798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0O-0005Ck-Cg; Thu, 29 Oct 2020 20:58:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14825.36798; Thu, 29 Oct 2020 20:58:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0O-0005Cb-9h; Thu, 29 Oct 2020 20:58:44 +0000
Received: by outflank-mailman (input) for mailman id 14825;
 Thu, 29 Oct 2020 20:58:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF0M-0005CS-Nn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1c19f02a-ec66-4e1b-b445-1389137fd761;
 Thu, 29 Oct 2020 20:58:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0L-00077j-Ud
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0L-0001XT-Tq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF0M-0005CS-Nn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:42 +0000
X-Inumbo-ID: 1c19f02a-ec66-4e1b-b445-1389137fd761
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1c19f02a-ec66-4e1b-b445-1389137fd761;
	Thu, 29 Oct 2020 20:58:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6Fu+EonJeaSQjo0oFfKx3kWePXGzPenQng0sT8gyIAo=; b=HM3pcyPxAmpqEm64Ko9pMCc+Wr
	6JCRlzeXHYudYE7k549es1zmtVd6MRxRLIRqzkAqHWQICCFBxe8MvWhwS4mFDmcCkEHerTmqBB3mB
	JEl6fuqypIQTzFAW+6mru4CCn96BWNsNl5RDzP7M2cBT8FZ4k7fMZb8d1tdYn0/35EfE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0L-00077j-Ud
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0L-0001XT-Tq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qmp.py: Do not return None from cmd_obj
Message-Id: <E1kYF0L-0001XT-Tq@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:41 +0000

commit ef5d474472426eda6abf8128cdb1d026af94862b
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:08 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: Do not return None from cmd_obj
    
    This makes typing the qmp library difficult, as it necessitates wrapping
    Optional[] around the type for every return type up the stack. At some
    point, it becomes difficult to discern or remember why it's None instead
    of the expected object.
    
    Use the python exception system to tell us exactly why we didn't get an
    object. Remove this special-cased return.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-5-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index aa8a666b8a..ef3c919b76 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -225,22 +225,18 @@ class QEMUMonitorProtocol:
         self.__sockfile = self.__sock.makefile(mode='r')
         return self.__negotiate_capabilities()
 
-    def cmd_obj(self, qmp_cmd):
+    def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage:
         """
         Send a QMP command to the QMP Monitor.
 
         @param qmp_cmd: QMP command to be sent as a Python dict
-        @return QMP response as a Python dict or None if the connection has
-                been closed
+        @return QMP response as a Python dict
         """
         self.logger.debug(">>> %s", qmp_cmd)
-        try:
-            self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8'))
-        except OSError as err:
-            if err.errno == errno.EPIPE:
-                return None
-            raise err
+        self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8'))
         resp = self.__json_read()
+        if resp is None:
+            raise QMPConnectError("Unexpected empty reply from server")
         self.logger.debug("<<< %s", resp)
         return resp
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:58:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:58:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14826.36802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0Y-0005E5-EM; Thu, 29 Oct 2020 20:58:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14826.36802; Thu, 29 Oct 2020 20:58:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0Y-0005Dv-BF; Thu, 29 Oct 2020 20:58:54 +0000
Received: by outflank-mailman (input) for mailman id 14826;
 Thu, 29 Oct 2020 20:58:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF0W-0005Dk-S3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 48695887-7ef6-4a38-b358-e57c2ee21690;
 Thu, 29 Oct 2020 20:58:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0W-00077v-1v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0W-0001Xx-16
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF0W-0005Dk-S3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
X-Inumbo-ID: 48695887-7ef6-4a38-b358-e57c2ee21690
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 48695887-7ef6-4a38-b358-e57c2ee21690;
	Thu, 29 Oct 2020 20:58:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I88wvtu4JuHbsmZVpr7EGvVS0V7W8utL4/yvPfrGEfs=; b=4PE20mjFpXxE/ayVilpcKmgADp
	P7QQ4r1PyEhGhr1G/z47r8y5Fouqsqr7XKXBJgxsYd/7h9TCHzRUvMINwWti9XbjNX0UJYLOLWIFn
	2jfWzCschTIPc76rGWf/DbsY1I19j62zwfyAFw3+6GFPgdaKoby/d5bU1/SmDDSA1hw0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0W-00077v-1v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0W-0001Xx-16
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:58:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qmp.py: add casts to JSON deserialization
Message-Id: <E1kYF0W-0001Xx-16@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:58:52 +0000

commit 2e2d93051753067fc5b888fdc18831127a4a900e
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:09 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: add casts to JSON deserialization
    
    mypy and python type hints are not powerful enough to properly describe
    JSON messages in Python 3.6. The best we can do, generally, is describe
    them as Dict[str, Any].
    
    Add casts to coerce this type for static analysis; but do NOT enforce
    this type at runtime in any way.
    
    Note: Python 3.8 adds a TypedDict construct which allows for the
    description of more arbitrary Dictionary shapes. There is a third-party
    module, "Pydantic", which is compatible with 3.6 that can be used
    instead of the JSON library that parses JSON messages to fully-typed
    Python objects, and may be preferable in some cases.
    
    (That is well beyond the scope of this commit or series.)
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-6-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index ef3c919b76..1ae36050a4 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -13,6 +13,7 @@ import socket
 import logging
 from typing import (
     Any,
+    cast,
     Dict,
     Optional,
     TextIO,
@@ -130,7 +131,10 @@ class QEMUMonitorProtocol:
             data = self.__sockfile.readline()
             if not data:
                 return None
-            resp = json.loads(data)
+            # By definition, any JSON received from QMP is a QMPMessage,
+            # and we are asserting only at static analysis time that it
+            # has a particular shape.
+            resp: QMPMessage = json.loads(data)
             if 'event' in resp:
                 self.logger.debug("<<< %s", resp)
                 self.__events.append(resp)
@@ -262,7 +266,7 @@ class QEMUMonitorProtocol:
         ret = self.cmd(cmd, kwds)
         if 'error' in ret:
             raise QMPResponseError(ret)
-        return ret['return']
+        return cast(QMPReturnValue, ret['return'])
 
     def pull_event(self, wait=False):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14827.36806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0i-0005Fn-Fm; Thu, 29 Oct 2020 20:59:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14827.36806; Thu, 29 Oct 2020 20:59:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0i-0005Ff-Cj; Thu, 29 Oct 2020 20:59:04 +0000
Received: by outflank-mailman (input) for mailman id 14827;
 Thu, 29 Oct 2020 20:59:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF0h-0005FT-6P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6fed54d5-a6aa-4ea1-a33e-907ce1a01c7e;
 Thu, 29 Oct 2020 20:59:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0g-00078u-5h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0g-0001Yc-4q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF0h-0005FT-6P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:03 +0000
X-Inumbo-ID: 6fed54d5-a6aa-4ea1-a33e-907ce1a01c7e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6fed54d5-a6aa-4ea1-a33e-907ce1a01c7e;
	Thu, 29 Oct 2020 20:59:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vtvo1b96sQm27TG1TnX1LG7yZLT+9fI2ojPAc3fKxTE=; b=yFDeKqsz+DI/BWTrXoHq1/+mlW
	7FbH/LrgWkifZV9clZH2ZdjH4VTcZ0Ow41KkB5eEyIpOh3xZBOr3NM9LpNOm2fceFQ7kNQaHVRe7h
	uE30n4Dxr9S/8zevsRY24qNxwGHlY13vBrE+l9AvZ5ttV2Ab/U3oFj1g6I4mShKgf3s4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0g-00078u-5h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0g-0001Yc-4q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qmp.py: add QMPProtocolError
Message-Id: <E1kYF0g-0001Yc-4q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:02 +0000

commit 84dcdf0887cdaaba7300442482c99e5064865a2d
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:10 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: add QMPProtocolError
    
    In the case that we receive a reply but are unable to understand it,
    use this exception name to indicate that case.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-7-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index 1ae36050a4..7935dababb 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -62,6 +62,12 @@ class QMPTimeoutError(QMPError):
     """
 
 
+class QMPProtocolError(QMPError):
+    """
+    QMP protocol error; unexpected response
+    """
+
+
 class QMPResponseError(QMPError):
     """
     Represents erroneous QMP monitor reply
@@ -266,6 +272,10 @@ class QEMUMonitorProtocol:
         ret = self.cmd(cmd, kwds)
         if 'error' in ret:
             raise QMPResponseError(ret)
+        if 'return' not in ret:
+            raise QMPProtocolError(
+                "'return' key not found in QMP response '{}'".format(str(ret))
+            )
         return cast(QMPReturnValue, ret['return'])
 
     def pull_event(self, wait=False):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14828.36810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0s-0005H1-HH; Thu, 29 Oct 2020 20:59:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14828.36810; Thu, 29 Oct 2020 20:59:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF0s-0005Gv-EE; Thu, 29 Oct 2020 20:59:14 +0000
Received: by outflank-mailman (input) for mailman id 14828;
 Thu, 29 Oct 2020 20:59:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF0r-0005Gl-5Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id da011854-ff58-436f-9aff-bcd609947f9f;
 Thu, 29 Oct 2020 20:59:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0q-000794-9R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF0q-0001ZA-8i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF0r-0005Gl-5Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:13 +0000
X-Inumbo-ID: da011854-ff58-436f-9aff-bcd609947f9f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id da011854-ff58-436f-9aff-bcd609947f9f;
	Thu, 29 Oct 2020 20:59:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XiyWsmpvY+2rLN0MT3TURtf2+B+BhJFfCsn+5x1Ex6s=; b=Bd4JDM5+pNheZDGsrKdrR5y+3Y
	wa8O1quhDDG4M+eY41K3Q660m2Oome1FK7kS0OQZriuFCArQm8pkYCSd0wEvm0VuYkc5bXo4XTUfY
	OLbzDHIW3Skn/bmvrAk5KRwdSgSfOg5wXq5VGrcWT2sAbuFA03ZDzMSiDlNcUlYpHrw8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0q-000794-9R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF0q-0001ZA-8i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/python-next-20200714' into staging
Message-Id: <E1kYF0q-0001ZA-8i@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:12 +0000

commit 673205379fb499d2b72f2985b47ec7114282f5fe
Merge: 3a9163af4e3dd61795a35d47b702e302f98f81d6 84dcdf0887cdaaba7300442482c99e5064865a2d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 13:04:27 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 13:04:27 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/python-next-20200714' into staging
    
    Python patches for 5.1
    
    - Reduce race conditions on QEMUMachine::shutdown()
    
     1. Remove the "bare except" pattern in the existing shutdown code,
        which can mask problems and make debugging difficult.
     2. Ensure that post-shutdown cleanup is always performed, even when
        graceful termination fails.
     3. Unify cleanup paths such that no matter how the VM is terminated,
        the same functions and steps are always taken to reset the object
        state.
     4. Rewrite shutdown() such that any error encountered when attempting
        a graceful shutdown will be raised as an AbnormalShutdown exception.
        The pythonic idiom is to allow the caller to decide if this is a
        problem or not.
    
    - Modify part of the python/qemu library to comply with:
    
      . mypy --strict
      . pylint
      . flake8
    
    - Script for the TCG Continuous Benchmarking project that uses
      callgrind to dissect QEMU execution into three main phases:
    
      . code generation
      . JIT execution
      . helpers execution
    
    CI jobs results:
    . https://cirrus-ci.com/build/5421349961203712
    . https://gitlab.com/philmd/qemu/-/pipelines/166556001
    . https://travis-ci.org/github/philmd/qemu/builds/708102347
    
    # gpg: Signature made Tue 14 Jul 2020 21:40:05 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/python-next-20200714:
      python/qmp.py: add QMPProtocolError
      python/qmp.py: add casts to JSON deserialization
      python/qmp.py: Do not return None from cmd_obj
      python/qmp.py: re-absorb MonitorResponseError
      iotests.py: use qemu.qmp type aliases
      python/qmp.py: Define common types
      python/machine.py: change default wait timeout to 3 seconds
      python/machine.py: re-add sigkill warning suppression
      python/machine.py: split shutdown into hard and soft flavors
      tests/acceptance: Don't test reboot on cubieboard
      tests/acceptance: wait() instead of shutdown() where appropriate
      python/machine.py: Make wait() call shutdown()
      python/machine.py: Add a configurable timeout to shutdown()
      python/machine.py: Prohibit multiple shutdown() calls
      python/machine.py: Perform early cleanup for wait() calls, too
      python/machine.py: Add _early_cleanup hook
      python/machine.py: Close QMP socket in cleanup
      python/machine.py: consolidate _post_shutdown()
      scripts/performance: Add dissect.py script
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 python/qemu/machine.py                   | 174 +++++++++++++++++++++++--------
 python/qemu/qmp.py                       |  67 +++++++++---
 scripts/performance/dissect.py           | 166 +++++++++++++++++++++++++++++
 scripts/render_block_graph.py            |   7 +-
 tests/acceptance/boot_linux_console.py   |  14 ++-
 tests/acceptance/linux_ssh_mips_malta.py |   2 +
 tests/qemu-iotests/iotests.py            |   9 +-
 7 files changed, 368 insertions(+), 71 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14829.36814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF13-0005IT-K6; Thu, 29 Oct 2020 20:59:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14829.36814; Thu, 29 Oct 2020 20:59:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF13-0005IN-H3; Thu, 29 Oct 2020 20:59:25 +0000
Received: by outflank-mailman (input) for mailman id 14829;
 Thu, 29 Oct 2020 20:59:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF11-0005IA-M3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e40bd545-55d3-4f07-9088-0847f89ed52f;
 Thu, 29 Oct 2020 20:59:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF10-00079C-L3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF10-0001aY-KH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF11-0005IA-M3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:23 +0000
X-Inumbo-ID: e40bd545-55d3-4f07-9088-0847f89ed52f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e40bd545-55d3-4f07-9088-0847f89ed52f;
	Thu, 29 Oct 2020 20:59:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=quHTmSS/OS4iH+hwniDKLwJL8ImwVTnDXRVKfz2fNSM=; b=KWkT/hXrGXAnB6CVrXiiQI8KQH
	9Z7thuUkquamA28Bmf3TTTGPgOqXhFuGsIpgJVUSPpvNRnyz2jd/yK95OqvJLND8Fs2skNDbMMkqu
	5RtxYc72QIlRS543kFfRmbKpge785pFcQyD2Vp+7AlIs6uBi7cjMNBDhIF6sW7xX2sHQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF10-00079C-L3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF10-0001aY-KH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/mips: Remove identical if/else branches
Message-Id: <E1kYF10-0001aY-KH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:22 +0000

commit 9788e8c9b64e4cebb01c96bab2b0e4c2d4454041
Author:     Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
AuthorDate: Wed Jul 1 20:25:57 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    target/mips: Remove identical if/else branches
    
    Remove the segment:
    
          if (other_tc == other->current_tc) {
              tccause = other->CP0_Cause;
          } else {
              tccause = other->CP0_Cause;
          }
    
    Original contributor can't remember what was his intention.
    
    Fixes: 5a25ce9487 ("mips: Hook in more reg accesses via mttr/mftr")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1885718
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Message-Id: <20200701182559.28841-2-aleksandar.qemu.devel@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/cp0_helper.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c
index bbf12e4a97..de64add038 100644
--- a/target/mips/cp0_helper.c
+++ b/target/mips/cp0_helper.c
@@ -375,16 +375,9 @@ target_ulong helper_mftc0_entryhi(CPUMIPSState *env)
 target_ulong helper_mftc0_cause(CPUMIPSState *env)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
-    int32_t tccause;
     CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);
 
-    if (other_tc == other->current_tc) {
-        tccause = other->CP0_Cause;
-    } else {
-        tccause = other->CP0_Cause;
-    }
-
-    return tccause;
+    return other->CP0_Cause;
 }
 
 target_ulong helper_mftc0_status(CPUMIPSState *env)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14830.36818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1D-0005Jf-Lb; Thu, 29 Oct 2020 20:59:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14830.36818; Thu, 29 Oct 2020 20:59:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1D-0005JX-IY; Thu, 29 Oct 2020 20:59:35 +0000
Received: by outflank-mailman (input) for mailman id 14830;
 Thu, 29 Oct 2020 20:59:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF1C-0005JO-2U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9747a647-a25b-4821-8a4e-4d0221c4f493;
 Thu, 29 Oct 2020 20:59:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1A-00079M-Oz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1A-0001b4-No
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF1C-0005JO-2U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:34 +0000
X-Inumbo-ID: 9747a647-a25b-4821-8a4e-4d0221c4f493
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9747a647-a25b-4821-8a4e-4d0221c4f493;
	Thu, 29 Oct 2020 20:59:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GY6N0voTCE7sCwe8kmfAir8NcCpBZ6pkGmmsjOKxEk4=; b=h4HjVeYONYKJpTMFcVArsn+j7o
	kWtdY+KlYRrTmeHps9Ix4cEdwAGavWC5jyq1/ZwzLoHz5zq9ODtmz/hzZj/rsj3K7HJY07uPEICRq
	0dGoPYVBERdH8btT5cclQxNA96ZNKILQxkf8n7xystDAjXLtmG9mT5TStAH21maUQkms=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1A-00079M-Oz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1A-0001b4-No
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/mips: Fix ADD.S FPU instruction
Message-Id: <E1kYF1A-0001b4-No@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:32 +0000

commit dda97e385b2f0fa84267a497596fe79898d48123
Author:     Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
AuthorDate: Fri Jul 3 17:15:15 2020 +0100
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    target/mips: Fix ADD.S FPU instruction
    
    After merging latest QEMU upstream into our CHERI fork,
    I noticed that some of the FPU tests in our MIPS baremetal
    testsuite [*] started failing.
    It turns out commit 1ace099f2a accidentally changed add.s
    into a subtract.
    
    [*] https://github.com/CTSRD-CHERI/cheritest
    
    Fixes: 1ace099f2a ("target/mips: fpu: Demacro ADD.<D|S|PS>")
    Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200703161515.25966-1-Alexander.Richardson@cl.cam.ac.uk>
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c
index 7a3a61cab3..56beda49d8 100644
--- a/target/mips/fpu_helper.c
+++ b/target/mips/fpu_helper.c
@@ -1221,7 +1221,7 @@ uint32_t helper_float_add_s(CPUMIPSState *env,
 {
     uint32_t wt2;
 
-    wt2 = float32_sub(fst0, fst1, &env->active_fpu.fp_status);
+    wt2 = float32_add(fst0, fst1, &env->active_fpu.fp_status);
     update_fcr31(env, GETPC());
     return wt2;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14831.36821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1N-0005Kw-NB; Thu, 29 Oct 2020 20:59:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14831.36821; Thu, 29 Oct 2020 20:59:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1N-0005Ko-KC; Thu, 29 Oct 2020 20:59:45 +0000
Received: by outflank-mailman (input) for mailman id 14831;
 Thu, 29 Oct 2020 20:59:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF1M-0005Kc-3I
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id decb953e-efaa-429e-ba7f-eab82bd9cac2;
 Thu, 29 Oct 2020 20:59:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1K-00079U-So
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1K-0001be-S3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF1M-0005Kc-3I
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:44 +0000
X-Inumbo-ID: decb953e-efaa-429e-ba7f-eab82bd9cac2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id decb953e-efaa-429e-ba7f-eab82bd9cac2;
	Thu, 29 Oct 2020 20:59:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wIsi9qY/Qd+Y5VYSAeb/JQVD+UhKX6dquTzwRMvHavs=; b=5Wcf00KYlpItqDoyCTz0nWM1WN
	k46UhK+my0gZtgbCPbqQcX2fY8mmYYx8VdNvvspDFATcJxqMF3le4w8Dvdshs2UhKHCIn7+z/g/Ep
	rnKO1kgBniLrbqzvtMSTTyt3NOF30TCRJeXmKdg0d41oc765u2G32tvPkcQPN9u0DUAg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1K-00079U-So
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1K-0001be-S3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
Message-Id: <E1kYF1K-0001be-S3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:42 +0000

commit 15d983dee95edff1dc4c0bed71ce02fff877e766
Author:     Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
AuthorDate: Wed Jul 1 20:25:58 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
    
    Huacai Chen and Jiaxun Yang step in as new energy [1].
    
    Aurelien Jarno comment [2]:
    
      It happens that I known Huacai Chen from the time he was
      upstreaming the Loongson 3 support to the kernel, I have been
      testing and reviewing his patches. I also know Jiaxun Yang from
      the #debian-mips IRC channel. I know that they are both very
      competent and have a good knowledge of the open source world.
      I therefore agree that they are good additions to maintain and/or
      review the MIPS part of QEMU.
    
    [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg718434.html
    [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg718738.html
    
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Message-Id: <20200701182559.28841-3-aleksandar.qemu.devel@gmail.com>
    PMD: [Split patch, added Aurelien's comment]
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
    Acked-by: Huacai Chen <chenhc@lemote.com>
---
 MAINTAINERS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..cdb5c6f171 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -222,6 +222,7 @@ F: disas/microblaze.c
 MIPS TCG CPUs
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: target/mips/
@@ -384,6 +385,7 @@ S: Maintained
 F: target/arm/kvm.c
 
 MIPS KVM CPUs
+M: Huacai Chen <chenhc@lemote.com>
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 S: Odd Fixes
 F: target/mips/kvm.c
@@ -2743,6 +2745,8 @@ F: disas/i386.c
 MIPS TCG target
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
+R: Huacai Chen <chenhc@lemote.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: tcg/mips/
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 20:59:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 20:59:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14832.36827 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1X-0005MO-PV; Thu, 29 Oct 2020 20:59:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14832.36827; Thu, 29 Oct 2020 20:59:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1X-0005MC-Lj; Thu, 29 Oct 2020 20:59:55 +0000
Received: by outflank-mailman (input) for mailman id 14832;
 Thu, 29 Oct 2020 20:59:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF1V-0005Lx-Vr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e0a3001d-28a6-4bd6-983e-515f3d40a107;
 Thu, 29 Oct 2020 20:59:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1V-00079b-0f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1U-0001cM-Vx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF1V-0005Lx-Vr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:54 +0000
X-Inumbo-ID: e0a3001d-28a6-4bd6-983e-515f3d40a107
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e0a3001d-28a6-4bd6-983e-515f3d40a107;
	Thu, 29 Oct 2020 20:59:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8YYJO2uNRMIa939qSdD4PikvbduvfUyZlb5geYjScNA=; b=g88dnU//NZrD5M+FmQYjcoS0mg
	BQFLuacyUDWg87jLWV/HMmc5+hnF/+l7bbVQECUwYIo3+CV1bQn+NzjiPfSkrodJd9Fn679pv+30B
	3MkNUehCo9k0kdbbjE7Tkd5wc1indfwajAcVV7TLpKUW0cavQpaMqCUB3J69DpdR9MHw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1V-00079b-0f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1U-0001cM-Vx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 20:59:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-next-20200714' into staging
Message-Id: <E1kYF1U-0001cM-Vx@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 20:59:52 +0000

commit f1d5948669041d01d245ce42894fcec2eebbaab1
Merge: 673205379fb499d2b72f2985b47ec7114282f5fe 15d983dee95edff1dc4c0bed71ce02fff877e766
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 13:54:09 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 13:54:09 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-next-20200714' into staging
    
    MIPS patches for 5.1
    
    - A pair of fixes,
    - Add Huacai Chen as MIPS KVM maintainer,
    - Add Jiaxun Yang as designated MIPS TCG reviewer.
    
    CI jobs results:
    . https://travis-ci.org/github/philmd/qemu/builds/708079271
    . https://gitlab.com/philmd/qemu/-/pipelines/166528104
    . https://cirrus-ci.com/build/6483996878045184
    
    # gpg: Signature made Tue 14 Jul 2020 20:59:58 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/mips-next-20200714:
      MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
      target/mips: Fix ADD.S FPU instruction
      target/mips: Remove identical if/else branches
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS              | 4 ++++
 target/mips/cp0_helper.c | 9 +--------
 target/mips/fpu_helper.c | 2 +-
 3 files changed, 6 insertions(+), 9 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14833.36830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1h-0005qa-QZ; Thu, 29 Oct 2020 21:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14833.36830; Thu, 29 Oct 2020 21:00:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1h-0005qM-NO; Thu, 29 Oct 2020 21:00:05 +0000
Received: by outflank-mailman (input) for mailman id 14833;
 Thu, 29 Oct 2020 21:00:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF1g-0005dQ-BU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b5883286-056d-4d56-8ebb-ee381119216c;
 Thu, 29 Oct 2020 21:00:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1f-0007CV-Hi
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1f-0001eT-Gn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF1g-0005dQ-BU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:04 +0000
X-Inumbo-ID: b5883286-056d-4d56-8ebb-ee381119216c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b5883286-056d-4d56-8ebb-ee381119216c;
	Thu, 29 Oct 2020 21:00:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8mPTaM6pxFifYYYVKgBeLboYBauXJDc5AELg/0ZBPYM=; b=iXa3J0+1lZll8ZUhLXxfarMcqf
	TYn1lYlVJjfiH03NIESDKgMTfpxVW56SyS7TbVqHJtclFGX905+1NgyTyVrmmFPscOZvzwV7AdkI/
	B4oWN70L72dkpYUVjRYlPAkJZcR0TLcGdgAs+4WrNXtKt9cNXlc7DQQKe9mgrKlt14Wo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1f-0007CV-Hi
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1f-0001eT-Gn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/devel: fix grammar in multi-thread-tcg
Message-Id: <E1kYF1f-0001eT-Gn@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:03 +0000

commit 93154e767f1b886e6d258178821d400333042a22
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:12 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:39 2020 +0100

    docs/devel: fix grammar in multi-thread-tcg
    
    Review comment came just too late ;-)
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713200415.26214-9-alex.bennee@linaro.org>
---
 docs/devel/multi-thread-tcg.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst
index 42158b77c7..21483870db 100644
--- a/docs/devel/multi-thread-tcg.rst
+++ b/docs/devel/multi-thread-tcg.rst
@@ -107,7 +107,7 @@ including:
 
   - debugging operations (breakpoint insertion/removal)
   - some CPU helper functions
-  - linux-user spawning it's first thread
+  - linux-user spawning its first thread
 
 This is done with the async_safe_run_on_cpu() mechanism to ensure all
 vCPUs are quiescent when changes are being made to shared global
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14834.36834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1s-00066I-SB; Thu, 29 Oct 2020 21:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14834.36834; Thu, 29 Oct 2020 21:00:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF1s-00066A-Ot; Thu, 29 Oct 2020 21:00:16 +0000
Received: by outflank-mailman (input) for mailman id 14834;
 Thu, 29 Oct 2020 21:00:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF1q-000662-Rk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 62e38ff6-06bb-45e4-aab1-a69f5351ba73;
 Thu, 29 Oct 2020 21:00:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1p-0007Ca-LG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1p-0001ff-KU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF1q-000662-Rk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:14 +0000
X-Inumbo-ID: 62e38ff6-06bb-45e4-aab1-a69f5351ba73
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 62e38ff6-06bb-45e4-aab1-a69f5351ba73;
	Thu, 29 Oct 2020 21:00:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EcH1FCx+e6eYGZBEh31BPiwGMY7yW5Rdg7gxaQdILuU=; b=zruNAcqFhnQyDLrTWmgA/S3AKX
	Pnew94+b70Zp9mtDj8hLMCrsSBe61GTGi6xDoGNuS7BhTqKa2BHav8inS8LVetA4hUfG7rKDs1MJe
	yeSPN4pw05tyb5uMHlhUplo+KDcR5UnWJ8xNKcnHF2YJXFXokWy1t2DePjBdl97wpDrs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1p-0007Ca-LG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1p-0001ff-KU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
Message-Id: <E1kYF1p-0001ff-KU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:13 +0000

commit a77312e77c7d19702aa4e2ddefd20cae060a7fb9
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Jul 13 21:04:06 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
    
    The libssh problem only exists in Ubuntu 18.04 - we can enable it
    in 20.04 again.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713185237.9419-1-thuth@redhat.com>
    Message-Id: <20200713200415.26214-3-alex.bennee@linaro.org>
---
 tests/docker/dockerfiles/ubuntu2004.docker | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index f7aac840bf..8d10934a2a 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -65,9 +65,6 @@ RUN apt-get update && \
 RUN dpkg -l $PACKAGES | sort > /packages.txt
 ENV FEATURES clang tsan pyyaml sdl2
 
-# https://bugs.launchpad.net/qemu/+bug/1838763
-ENV QEMU_CONFIGURE_OPTS --disable-libssh
-
 # Apply patch https://reviews.llvm.org/D75820
 # This is required for TSan in clang-10 to compile with QEMU.
 RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14835.36838 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF21-00067S-TV; Thu, 29 Oct 2020 21:00:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14835.36838; Thu, 29 Oct 2020 21:00:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF21-00067K-QP; Thu, 29 Oct 2020 21:00:25 +0000
Received: by outflank-mailman (input) for mailman id 14835;
 Thu, 29 Oct 2020 21:00:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF20-00067E-Iy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a00a2ba4-cd1a-4d4e-a6a3-095a767b5a4f;
 Thu, 29 Oct 2020 21:00:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1z-0007Co-P9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF1z-0001gD-Nz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF20-00067E-Iy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:24 +0000
X-Inumbo-ID: a00a2ba4-cd1a-4d4e-a6a3-095a767b5a4f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a00a2ba4-cd1a-4d4e-a6a3-095a767b5a4f;
	Thu, 29 Oct 2020 21:00:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FQE+n1LZ5mmBOvbuUTd8tAq9qYb2XgB6KK893UpaomI=; b=bdNb9LulAKFINj4pMxzXpr0qf8
	lNA4BwEkD9Th251Ohhujdk40pj16GXKQyUs/Oh2Cfb5iVtJvkkBCX+AEzTGP+PzNnMFspOu9bboBX
	s65F9zzomhNyVoMBh/842tPKD0DFHkHtf25dXkPcWBcIj5EsCSb/1+mASDOsXq7I473s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1z-0007Co-P9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF1z-0001gD-Nz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docker.py: fix fetching of FROM layers
Message-Id: <E1kYF1z-0001gD-Nz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:23 +0000

commit f73e485285bc2da944a08e1dd20a30df93e23f25
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:07 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    docker.py: fix fetching of FROM layers
    
    This worked on a system that was already bootstrapped because the
    stage 2 images already existed even if they wouldn't be used. What we
    should have pulled down was the FROM line containers first because
    building on gitlab doesn't have the advantage of using our build
    system to build the pre-requisite bits.
    
    We still pull the image we want to build just in case we can use the
    cached data.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713200415.26214-4-alex.bennee@linaro.org>
---
 tests/docker/docker.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 2d67bbd15a..c9f20d8d09 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -306,14 +306,18 @@ class Docker(object):
         checksum = _text_checksum(_dockerfile_preprocess(dockerfile))
 
         if registry is not None:
-            # see if we can fetch a cache copy, may fail...
-            pull_args = ["pull", "%s/%s" % (registry, tag)]
-            if self._do(pull_args, quiet=quiet) == 0:
+            sources = re.findall("FROM qemu\/(.*)", dockerfile)
+            # Fetch any cache layers we can, may fail
+            for s in sources:
+                pull_args = ["pull", "%s/qemu/%s" % (registry, s)]
+                if self._do(pull_args, quiet=quiet) != 0:
+                    registry = None
+                    break
+            # Make substitutions
+            if registry is not None:
                 dockerfile = dockerfile.replace("FROM qemu/",
                                                 "FROM %s/qemu/" %
                                                 (registry))
-            else:
-                registry = None
 
         tmp_df = tempfile.NamedTemporaryFile(mode="w+t",
                                              encoding='utf-8',
@@ -339,6 +343,8 @@ class Docker(object):
             build_args += ["--build-arg", "BUILDKIT_INLINE_CACHE=1"]
 
         if registry is not None:
+            pull_args = ["pull", "%s/%s" % (registry, tag)]
+            self._do(pull_args, quiet=quiet)
             cache = "%s/%s" % (registry, tag)
             build_args += ["--cache-from", cache]
         build_args += argv
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14836.36842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2C-00068r-VG; Thu, 29 Oct 2020 21:00:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14836.36842; Thu, 29 Oct 2020 21:00:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2C-00068k-S0; Thu, 29 Oct 2020 21:00:36 +0000
Received: by outflank-mailman (input) for mailman id 14836;
 Thu, 29 Oct 2020 21:00:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF2A-00068Z-Tw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5d18c61e-aa0b-4e10-a4de-fdd0269dd43e;
 Thu, 29 Oct 2020 21:00:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF29-0007Cz-Sc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF29-0001gh-Rl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF2A-00068Z-Tw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:34 +0000
X-Inumbo-ID: 5d18c61e-aa0b-4e10-a4de-fdd0269dd43e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5d18c61e-aa0b-4e10-a4de-fdd0269dd43e;
	Thu, 29 Oct 2020 21:00:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vgpx/NT3Du5aAHVCaVlEgZVjmCnKX1NaGV4hMCL/7C8=; b=aCLAYMocRQdavotc3e6Ox1WgOD
	3G6h2F5Evrg8EqNZKqquSE4ZymfCl56r8mpruH4vnkHmpB7waqQaSAfP2xhFuatRgufsBiOQqdi/e
	EPayrQAY4/aYSJjdd34P0Vtgq4Vmadt9plZgsGodVyaRUFHRqTZkphu8zKZjYW6Oev1M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF29-0007Cz-Sc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF29-0001gh-Rl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] gitlab-ci/containers: Add missing wildcard where we should look for changes
Message-Id: <E1kYF29-0001gh-Rl@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:33 +0000

commit 6f60a240f60122fe2df402402311bf425f34e553
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Jul 13 20:22:35 2020 +0200
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    gitlab-ci/containers: Add missing wildcard where we should look for changes
    
    The tests/docker/* wildcard seems to only match the files that are directly
    in the tests/docker folder - but changes to the files in the directory
    tests/docker/dockerfiles are currently ignored. Seems like we need a
    separate entry to match the files in that folder. With this wildcard added,
    the stages now get re-run successfully when something in the dockerfiles
    has been changed.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200713182235.30379-1-thuth@redhat.com>
---
 .gitlab-ci.d/containers.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index f3c0ca4d61..8c89efeb6d 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -24,6 +24,7 @@
     - changes:
       - .gitlab-ci.d/containers.yml
       - tests/docker/*
+      - tests/docker/dockerfiles/*
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
     - if: '$CI_COMMIT_REF_NAME == "testing/next"'
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14837.36846 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2M-0006A9-1u; Thu, 29 Oct 2020 21:00:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14837.36846; Thu, 29 Oct 2020 21:00:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2L-0006A1-Uq; Thu, 29 Oct 2020 21:00:45 +0000
Received: by outflank-mailman (input) for mailman id 14837;
 Thu, 29 Oct 2020 21:00:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF2K-00069t-Nn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1d0d47ae-7b7c-4d07-9c6a-af52ae6c6a0f;
 Thu, 29 Oct 2020 21:00:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2J-0007D6-W6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2J-0001hH-VM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF2K-00069t-Nn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:44 +0000
X-Inumbo-ID: 1d0d47ae-7b7c-4d07-9c6a-af52ae6c6a0f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1d0d47ae-7b7c-4d07-9c6a-af52ae6c6a0f;
	Thu, 29 Oct 2020 21:00:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yeQ4P2kbh07CY7Cwsg1hDa3zlwf5BTs/zZR74kWScno=; b=Fazr29a/HdxqNfii5GlVw24V/5
	4Gnyt1KLQbYDOABZfN/CHGmAUwfCKrf/7ONjxPid30mISocBXOh33pQZ34BN1LToqlKv6rBxEFTS+
	0Gr80G28KcoEjFsPSFTEGFLv3zOCM4b5I/221smN03OhHBYAajcbdz9uWIf8Ob+fFKq8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2J-0007D6-W6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2J-0001hH-VM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fpu/softfloat: fix up float16 nan recognition
Message-Id: <E1kYF2J-0001hH-VM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:43 +0000

commit 8cdf91243f7515f424b78d5469d64c34ee534783
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Mon Jul 13 21:04:08 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    fpu/softfloat: fix up float16 nan recognition
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200712234521.3972-2-zhiwei_liu@c-sky.com>
    Message-Id: <20200713200415.26214-5-alex.bennee@linaro.org>
---
 fpu/softfloat-specialize.inc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fpu/softfloat-specialize.inc.c b/fpu/softfloat-specialize.inc.c
index 44f5b661f8..034d18199c 100644
--- a/fpu/softfloat-specialize.inc.c
+++ b/fpu/softfloat-specialize.inc.c
@@ -254,7 +254,7 @@ bool float16_is_quiet_nan(float16 a_, float_status *status)
     if (snan_bit_is_one(status)) {
         return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
     } else {
-        return ((a & ~0x8000) >= 0x7C80);
+        return ((a >> 9) & 0x3F) == 0x3F;
     }
 #endif
 }
@@ -271,7 +271,7 @@ bool float16_is_signaling_nan(float16 a_, float_status *status)
 #else
     uint16_t a = float16_val(a_);
     if (snan_bit_is_one(status)) {
-        return ((a & ~0x8000) >= 0x7C80);
+        return ((a >> 9) & 0x3F) == 0x3F;
     } else {
         return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:00:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:00:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14838.36851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2X-0006BY-3m; Thu, 29 Oct 2020 21:00:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14838.36851; Thu, 29 Oct 2020 21:00:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2X-0006BQ-0B; Thu, 29 Oct 2020 21:00:57 +0000
Received: by outflank-mailman (input) for mailman id 14838;
 Thu, 29 Oct 2020 21:00:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF2U-0006BC-TG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0f70587-14c3-49a2-a098-d2153e4b5924;
 Thu, 29 Oct 2020 21:00:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2U-0007DD-43
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2U-0001ht-2v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF2U-0006BC-TG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
X-Inumbo-ID: f0f70587-14c3-49a2-a098-d2153e4b5924
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0f70587-14c3-49a2-a098-d2153e4b5924;
	Thu, 29 Oct 2020 21:00:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hvNMor6VTulHjzG4JjS8DTu6M9FMHPP1hksGre8/qs0=; b=uvVeFGrfhpqCgMbINUxR22ZctG
	cpfBvArRijamKxhknDgRUroITgzbjFt6Y4PCms8ycEkjc6GiCgshAvunVRoDPBAoysNrNZwGxmt5h
	KkYYUuRLRMBrOCObaIbLpcBzMYULMf6lXbz7MbGA+slyB6f1SMqwN0Jz2ik1cLTXv8EA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2U-0007DD-43
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2U-0001ht-2v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:00:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/plugins: don't unconditionally add -Wpsabi
Message-Id: <E1kYF2U-0001ht-2v@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:00:54 +0000

commit 777dddc501fa31bc9afff6de5e55dbf799e1703b
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:09 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    tests/plugins: don't unconditionally add -Wpsabi
    
    Not all compilers support the -Wpsabi (clang-9 in my case). To handle
    this gracefully we pare back the shared build machinery so the
    Makefile is relatively "standalone". We still take advantage of
    config-host.mak as configure has done a bunch of probing for us but
    that is it.
    
    Fixes: bac8d222a
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200713200415.26214-6-alex.bennee@linaro.org>
---
 configure             |  3 +++
 tests/plugin/Makefile | 22 ++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index bc3b9ad931..b751c853f5 100755
--- a/configure
+++ b/configure
@@ -7115,6 +7115,9 @@ echo "GIT_UPDATE=$git_update" >> $config_host_mak
 
 echo "ARCH=$ARCH" >> $config_host_mak
 
+echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
+echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak
+
 if test "$default_devices" = "yes" ; then
   echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak
 else
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
index 3a50451428..e9348fde4a 100644
--- a/tests/plugin/Makefile
+++ b/tests/plugin/Makefile
@@ -1,9 +1,16 @@
+# -*- Mode: makefile -*-
+#
+# This Makefile example is fairly independent from the main makefile
+# so users can take and adapt it for their build. We only really
+# include config-host.mak so we don't have to repeat probing for
+# cflags that the main configure has already done for us.
+#
+
 BUILD_DIR := $(CURDIR)/../..
 
 include $(BUILD_DIR)/config-host.mak
-include $(SRC_PATH)/rules.mak
 
-$(call set-vpath, $(SRC_PATH)/tests/plugin)
+VPATH += $(SRC_PATH)/tests/plugin
 
 NAMES :=
 NAMES += bb
@@ -17,11 +24,18 @@ NAMES += lockstep
 
 SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
-QEMU_CFLAGS += -fPIC -Wpsabi
-QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
+# The main QEMU uses Glib extensively so it's perfectly fine to use it
+# in plugins (which many example do).
+CFLAGS = $(GLIB_CFLAGS)
+CFLAGS += -fPIC
+CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
+CFLAGS += -I$(SRC_PATH)/include/qemu
 
 all: $(SONAMES)
 
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
 lib%.so: %.o
 	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14839.36854 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2i-0006DD-4s; Thu, 29 Oct 2020 21:01:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14839.36854; Thu, 29 Oct 2020 21:01:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2i-0006D5-1q; Thu, 29 Oct 2020 21:01:08 +0000
Received: by outflank-mailman (input) for mailman id 14839;
 Thu, 29 Oct 2020 21:01:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF2g-0006Cv-KE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a406aa22-a86e-40db-a3a5-763100890fad;
 Thu, 29 Oct 2020 21:01:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2e-0007EE-80
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2e-0001iw-76
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF2g-0006Cv-KE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:06 +0000
X-Inumbo-ID: a406aa22-a86e-40db-a3a5-763100890fad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a406aa22-a86e-40db-a3a5-763100890fad;
	Thu, 29 Oct 2020 21:01:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M2y6Zu2f64LAtG9dAVOFBnGwMF2N2FJjmW1CRKqs3Eo=; b=bIDSpAeeIldItWtXWeWqKELTvR
	xtZ4PwKafTbuM0nlUZWoLp4Tv2dshIVdrBamsNPDwFmSAaaYb0+JOk4n13HeJKjMFn83dQJl4UpP9
	Mb1X66z/L6cWYTpgRL5OPAaG7HJt8XLLjqLKSP4xdwyGSbFEWWuO+aFoE668/dscXiKc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2e-0007EE-80
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2e-0001iw-76
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] cputlb: ensure we save the IOTLB data in case of reset
Message-Id: <E1kYF2e-0001iw-76@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:04 +0000

commit 2f3a57ee47df970d19fa5b324d44aab857d43517
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:10 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    cputlb: ensure we save the IOTLB data in case of reset
    
    Any write to a device might cause a re-arrangement of memory
    triggering a TLB flush and potential re-size of the TLB invalidating
    previous entries. This would cause users of qemu_plugin_get_hwaddr()
    to see the warning:
    
      invalid use of qemu_plugin_get_hwaddr
    
    because of the failed tlb_lookup which should always succeed. To
    prevent this we save the IOTLB data in case it is later needed by a
    plugin doing a lookup.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200713200415.26214-7-alex.bennee@linaro.org>
---
 accel/tcg/cputlb.c      | 38 +++++++++++++++++++++++++++++++++++---
 include/hw/core/cpu.h   | 16 ++++++++++++++++
 include/qemu/typedefs.h |  1 +
 3 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 1e815357c7..d370aedb47 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1073,6 +1073,24 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
     return val;
 }
 
+/*
+ * Save a potentially trashed IOTLB entry for later lookup by plugin.
+ *
+ * We also need to track the thread storage address because the RCU
+ * cleanup that runs when we leave the critical region (the current
+ * execution) is actually in a different thread.
+ */
+static void save_iotlb_data(CPUState *cs, hwaddr addr,
+                            MemoryRegionSection *section, hwaddr mr_offset)
+{
+#ifdef CONFIG_PLUGIN
+    SavedIOTLB *saved = &cs->saved_iotlb;
+    saved->addr = addr;
+    saved->section = section;
+    saved->mr_offset = mr_offset;
+#endif
+}
+
 static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
                       int mmu_idx, uint64_t val, target_ulong addr,
                       uintptr_t retaddr, MemOp op)
@@ -1092,6 +1110,12 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
     }
     cpu->mem_io_pc = retaddr;
 
+    /*
+     * The memory_region_dispatch may trigger a flush/resize
+     * so for plugins we save the iotlb_data just in case.
+     */
+    save_iotlb_data(cpu, iotlbentry->addr, section, mr_offset);
+
     if (mr->global_locking && !qemu_mutex_iothread_locked()) {
         qemu_mutex_lock_iothread();
         locked = true;
@@ -1381,8 +1405,11 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
  * in the softmmu lookup code (or helper). We don't handle re-fills or
  * checking the victim table. This is purely informational.
  *
- * This should never fail as the memory access being instrumented
- * should have just filled the TLB.
+ * This almost never fails as the memory access being instrumented
+ * should have just filled the TLB. The one corner case is io_writex
+ * which can cause TLB flushes and potential resizing of the TLBs
+ * loosing the information we need. In those cases we need to recover
+ * data from a copy of the io_tlb entry.
  */
 
 bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
@@ -1406,8 +1433,13 @@ bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
             data->v.ram.hostaddr = addr + tlbe->addend;
         }
         return true;
+    } else {
+        SavedIOTLB *saved = &cpu->saved_iotlb;
+        data->is_io = true;
+        data->v.io.section = saved->section;
+        data->v.io.offset = saved->mr_offset;
+        return true;
     }
-    return false;
 }
 
 #endif
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5542577d2b..8f145733ce 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -259,6 +259,18 @@ struct CPUWatchpoint {
     QTAILQ_ENTRY(CPUWatchpoint) entry;
 };
 
+#ifdef CONFIG_PLUGIN
+/*
+ * For plugins we sometime need to save the resolved iotlb data before
+ * the memory regions get moved around  by io_writex.
+ */
+typedef struct SavedIOTLB {
+    hwaddr addr;
+    MemoryRegionSection *section;
+    hwaddr mr_offset;
+} SavedIOTLB;
+#endif
+
 struct KVMState;
 struct kvm_run;
 
@@ -417,7 +429,11 @@ struct CPUState {
 
     DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX);
 
+#ifdef CONFIG_PLUGIN
     GArray *plugin_mem_cbs;
+    /* saved iotlb data from io_writex */
+    SavedIOTLB saved_iotlb;
+#endif
 
     /* TODO Move common fields from CPUArchState here. */
     int cpu_index;
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 15f5047bf1..427027a970 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -116,6 +116,7 @@ typedef struct QObject QObject;
 typedef struct QString QString;
 typedef struct RAMBlock RAMBlock;
 typedef struct Range Range;
+typedef struct SavedIOTLB SavedIOTLB;
 typedef struct SHPCDevice SHPCDevice;
 typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14840.36858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2t-0006EX-6V; Thu, 29 Oct 2020 21:01:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14840.36858; Thu, 29 Oct 2020 21:01:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF2t-0006EP-3Q; Thu, 29 Oct 2020 21:01:19 +0000
Received: by outflank-mailman (input) for mailman id 14840;
 Thu, 29 Oct 2020 21:01:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF2r-0006ED-BZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8674f43f-9a3c-4801-befe-909b3e1562cc;
 Thu, 29 Oct 2020 21:01:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2q-0007EL-8I
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF2o-0001jc-Ay
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF2r-0006ED-BZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:17 +0000
X-Inumbo-ID: 8674f43f-9a3c-4801-befe-909b3e1562cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8674f43f-9a3c-4801-befe-909b3e1562cc;
	Thu, 29 Oct 2020 21:01:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Os/zkKKt19GGksgNBFuWRMYdSqV3SnLXyRN11D6IkVM=; b=KW+QkkVF74lDkWwHQXfGd8yN46
	QW5XqEYGlCS2Wy8MRgvbw3ndoPUhFI6jN8fCQMugyeMJHQS86HFpFDYTv1aYJB2lkequAGLJJqKNS
	SEOxnpYtVIOe7VPGuWJld461pU0g585muJblnMEkku4jVpCqWFSYQp5kd1WvjABt+zSQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2q-0007EL-8I
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF2o-0001jc-Ay
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] plugins: expand the bb plugin to be thread safe and track per-cpu
Message-Id: <E1kYF2o-0001jc-Ay@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:14 +0000

commit 406b53c9ca669b8551d4cde27f2cde03135d0d1d
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:11 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    plugins: expand the bb plugin to be thread safe and track per-cpu
    
    While there isn't any easy way to make the inline counts thread safe
    we can ensure the callback based ones are. While we are at it we can
    reduce introduce a new option ("idle") to dump a report of the current
    bb and insn count each time a vCPU enters the idle state.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Robert Foley <robert.foley@linaro.org>
    Cc: Dave Bort <dbort@dbort.com>
    
    Message-Id: <20200713200415.26214-8-alex.bennee@linaro.org>
---
 tests/plugin/bb.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 84 insertions(+), 13 deletions(-)

diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c
index df19fd359d..e4cc7fdd6e 100644
--- a/tests/plugin/bb.c
+++ b/tests/plugin/bb.c
@@ -16,24 +16,67 @@
 
 QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
 
-static uint64_t bb_count;
-static uint64_t insn_count;
+typedef struct {
+    GMutex lock;
+    int index;
+    uint64_t bb_count;
+    uint64_t insn_count;
+} CPUCount;
+
+/* Used by the inline & linux-user counts */
 static bool do_inline;
+static CPUCount inline_count;
+
+/* Dump running CPU total on idle? */
+static bool idle_report;
+static GPtrArray *counts;
+static int max_cpus;
+
+static void gen_one_cpu_report(CPUCount *count, GString *report)
+{
+    if (count->bb_count) {
+        g_string_append_printf(report, "CPU%d: "
+                               "bb's: %" PRIu64", insns: %" PRIu64 "\n",
+                               count->index,
+                               count->bb_count, count->insn_count);
+    }
+}
 
 static void plugin_exit(qemu_plugin_id_t id, void *p)
 {
-    g_autofree gchar *out = g_strdup_printf(
-        "bb's: %" PRIu64", insns: %" PRIu64 "\n",
-        bb_count, insn_count);
-    qemu_plugin_outs(out);
+    g_autoptr(GString) report = g_string_new("");
+
+    if (do_inline || !max_cpus) {
+        g_string_printf(report, "bb's: %" PRIu64", insns: %" PRIu64 "\n",
+                        inline_count.bb_count, inline_count.insn_count);
+    } else {
+        g_ptr_array_foreach(counts, (GFunc) gen_one_cpu_report, report);
+    }
+    qemu_plugin_outs(report->str);
+}
+
+static void vcpu_idle(qemu_plugin_id_t id, unsigned int cpu_index)
+{
+    CPUCount *count = g_ptr_array_index(counts, cpu_index);
+    g_autoptr(GString) report = g_string_new("");
+    gen_one_cpu_report(count, report);
+
+    if (report->len > 0) {
+        g_string_prepend(report, "Idling ");
+        qemu_plugin_outs(report->str);
+    }
 }
 
 static void vcpu_tb_exec(unsigned int cpu_index, void *udata)
 {
-    unsigned long n_insns = (unsigned long)udata;
+    CPUCount *count = max_cpus ?
+        g_ptr_array_index(counts, cpu_index) : &inline_count;
 
-    insn_count += n_insns;
-    bb_count++;
+    unsigned long n_insns = (unsigned long)udata;
+    g_mutex_lock(&count->lock);
+    count->insn_count += n_insns;
+    count->bb_count++;
+    g_mutex_unlock(&count->lock);
 }
 
 static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
@@ -42,9 +85,10 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
 
     if (do_inline) {
         qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64,
-                                                 &bb_count, 1);
+                                                 &inline_count.bb_count, 1);
         qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64,
-                                                 &insn_count, n_insns);
+                                                 &inline_count.insn_count,
+                                                 n_insns);
     } else {
         qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec,
                                              QEMU_PLUGIN_CB_NO_REGS,
@@ -56,8 +100,35 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
                                            const qemu_info_t *info,
                                            int argc, char **argv)
 {
-    if (argc && strcmp(argv[0], "inline") == 0) {
-        do_inline = true;
+    int i;
+
+    for (i = 0; i < argc; i++) {
+        char *opt = argv[i];
+        if (g_strcmp0(opt, "inline") == 0) {
+            do_inline = true;
+        } else if (g_strcmp0(opt, "idle") == 0) {
+            idle_report = true;
+        } else {
+            fprintf(stderr, "option parsing failed: %s\n", opt);
+            return -1;
+        }
+    }
+
+    if (info->system_emulation && !do_inline) {
+        max_cpus = info->system.max_vcpus;
+        counts = g_ptr_array_new();
+        for (i = 0; i < max_cpus; i++) {
+            CPUCount *count = g_new0(CPUCount, 1);
+            g_mutex_init(&count->lock);
+            count->index = i;
+            g_ptr_array_add(counts, count);
+        }
+    } else if (!do_inline) {
+        g_mutex_init(&inline_count.lock);
+    }
+
+    if (idle_report) {
+        qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle);
     }
 
     qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14841.36862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF32-0006Ff-7p; Thu, 29 Oct 2020 21:01:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14841.36862; Thu, 29 Oct 2020 21:01:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF32-0006FX-4w; Thu, 29 Oct 2020 21:01:28 +0000
Received: by outflank-mailman (input) for mailman id 14841;
 Thu, 29 Oct 2020 21:01:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF31-0006FQ-G3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 08f5aa2a-e01a-491b-8529-a507971a273e;
 Thu, 29 Oct 2020 21:01:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF30-0007EY-D0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF30-0001kB-BF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF31-0006FQ-G3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:27 +0000
X-Inumbo-ID: 08f5aa2a-e01a-491b-8529-a507971a273e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 08f5aa2a-e01a-491b-8529-a507971a273e;
	Thu, 29 Oct 2020 21:01:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dGHk1u0SyRdDCNYhjpFA+g9DQPoPWKIzWQai/gQwsRs=; b=vJrrE14qx1fIibXa2bbEhoh7gD
	sU2T2AUfVzjX14lRi83en256BOs2QewWdYy4z63EhFuO9RHcTkQRgyUdM7dZimWzlUwC+c6Sj+Www
	JOXxmfbhAwIjDxmJmZTQDu/hWN2fkG+BRZzelfPpdcqWGD34HqqwwuUSjvOCq2uJlutI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF30-0007EY-D0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF30-0001kB-BF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] .travis.yml: skip ppc64abi32-linux-user with plugins
Message-Id: <E1kYF30-0001kB-BF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:26 +0000

commit 0571d280d057b851e3bb3ea7c350b86c950aea6e
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Tue Jul 14 18:55:16 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:57:17 2020 +0100

    .travis.yml: skip ppc64abi32-linux-user with plugins
    
    We actually see failures on threadcount running without plugins:
    
      retry.py -n 1000 -c -- \
        ./ppc64abi32-linux-user/qemu-ppc64abi32 \
        ./tests/tcg/ppc64abi32-linux-user/threadcount
    
    which reports:
    
      0: 978 times (97.80%), avg time 0.270 (0.01 varience/0.08 deviation)
      -6: 21 times (2.10%), avg time 0.336 (0.01 varience/0.12 deviation)
      -11: 1 times (0.10%), avg time 0.502 (0.00 varience/0.00 deviation)
      Ran command 1000 times, 978 passes
    
    But when running with plugins we hit the failure a lot more often:
    
      0: 91 times (91.00%), avg time 0.302 (0.04 varience/0.19 deviation)
      -11: 9 times (9.00%), avg time 0.558 (0.01 varience/0.11 deviation)
      Ran command 100 times, 91 passes
    
    The crash occurs in guest code which is the same in both pass and fail
    cases. However we see various messages reported on the console about
    corrupted memory lists which seems to imply the guest memory allocation
    is corrupted. This lines up with the seg fault being in the guest
    __libc_free function. So we think this is a guest bug which is
    exacerbated by various modes of translation. If anyone has access to
    real hardware to soak test the test case we could prove this properly.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Acked-by: David Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200714175516.5475-1-alex.bennee@linaro.org>
---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index ab429500fc..6695c0620f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -350,9 +350,10 @@ jobs:
     # Run check-tcg against linux-user (with plugins)
     # we skip sparc64-linux-user until it has been fixed somewhat
     # we skip cris-linux-user as it doesn't use the common run loop
+    # we skip ppc64abi32-linux-user as it seems to have a broken libc
     - name: "GCC plugins check-tcg (user)"
       env:
-        - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user"
+        - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user,ppc64abi32-linux-user"
         - TEST_BUILD_CMD="make build-tcg"
         - TEST_CMD="make check-tcg"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14842.36866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3C-0006Gy-9K; Thu, 29 Oct 2020 21:01:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14842.36866; Thu, 29 Oct 2020 21:01:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3C-0006Gp-6P; Thu, 29 Oct 2020 21:01:38 +0000
Received: by outflank-mailman (input) for mailman id 14842;
 Thu, 29 Oct 2020 21:01:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF3B-0006Gg-Fi
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0bbb91a1-e03a-4f5a-a197-fb68c3e4e7e5;
 Thu, 29 Oct 2020 21:01:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3A-0007Ei-Go
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3A-0001kg-G5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF3B-0006Gg-Fi
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:37 +0000
X-Inumbo-ID: 0bbb91a1-e03a-4f5a-a197-fb68c3e4e7e5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0bbb91a1-e03a-4f5a-a197-fb68c3e4e7e5;
	Thu, 29 Oct 2020 21:01:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=30sgkCj4kxBCVGfONRFKyMry01HMn4YJNCgMQA+18vU=; b=qpoD92rtqte3/nKH9H173MpFS4
	9ZE7qkgWPTkGbGz64oqRyEhGvqDjbaYTlGxdqvr5q5YKZxh+I/t9TNMVruopCM79Y/HnuZ6Oho3u+
	StMlaBJ3ja2oiJQ3UJIlFVABL3tvpbzcYlcxnu3oFiR5ehD546SrzfI+C2WKkrgPHiRY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3A-0007Ei-Go
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3A-0001kg-G5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stsquad/tags/pull-misc-for-rc0-150720-3' into staging
Message-Id: <E1kYF3A-0001kg-G5@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:36 +0000

commit dfcade7cefb433f8cf46788b771a085a625286d8
Merge: f1d5948669041d01d245ce42894fcec2eebbaab1 0571d280d057b851e3bb3ea7c350b86c950aea6e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 17:16:39 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 17:16:39 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-misc-for-rc0-150720-3' into staging
    
    Final fixes for 5.1-rc0
    
      - minor documentation nit
      - docker.py bootstrap fixes
      - tweak containers.yml wildcards
      - fix float16 nan detection
      - conditional use of -Wpsabi
      - fix missing iotlb data for plugins
      - proper locking for helper based bb count
      - drop ppc64abi32 from the plugin check-tcg test
    
    # gpg: Signature made Wed 15 Jul 2020 11:59:08 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-misc-for-rc0-150720-3:
      .travis.yml: skip ppc64abi32-linux-user with plugins
      plugins: expand the bb plugin to be thread safe and track per-cpu
      cputlb: ensure we save the IOTLB data in case of reset
      tests/plugins: don't unconditionally add -Wpsabi
      fpu/softfloat: fix up float16 nan recognition
      gitlab-ci/containers: Add missing wildcard where we should look for changes
      docker.py: fix fetching of FROM layers
      tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
      docs/devel: fix grammar in multi-thread-tcg
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.d/containers.yml                |  1 +
 .travis.yml                                |  3 +-
 accel/tcg/cputlb.c                         | 38 +++++++++++-
 configure                                  |  3 +
 docs/devel/multi-thread-tcg.rst            |  2 +-
 fpu/softfloat-specialize.inc.c             |  4 +-
 include/hw/core/cpu.h                      | 16 +++++
 include/qemu/typedefs.h                    |  1 +
 tests/docker/docker.py                     | 16 +++--
 tests/docker/dockerfiles/ubuntu2004.docker |  3 -
 tests/plugin/Makefile                      | 22 +++++--
 tests/plugin/bb.c                          | 97 ++++++++++++++++++++++++++----
 12 files changed, 174 insertions(+), 32 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14843.36872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3M-0006IK-D5; Thu, 29 Oct 2020 21:01:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14843.36872; Thu, 29 Oct 2020 21:01:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3M-0006IC-9J; Thu, 29 Oct 2020 21:01:48 +0000
Received: by outflank-mailman (input) for mailman id 14843;
 Thu, 29 Oct 2020 21:01:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF3L-0006I2-Hg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 60ba73c4-b222-431e-8686-817900b70a9f;
 Thu, 29 Oct 2020 21:01:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3K-0007Et-KA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3K-0001lC-JT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF3L-0006I2-Hg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:47 +0000
X-Inumbo-ID: 60ba73c4-b222-431e-8686-817900b70a9f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 60ba73c4-b222-431e-8686-817900b70a9f;
	Thu, 29 Oct 2020 21:01:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SvTBqTLarV621rgJiHT2GtgZNKZrKBBBb4YLMlsjfls=; b=k7t4QTbhpJ/cVToxXUNqkLxdup
	JGhqOYG+YpOY+3t+55VFuVykuMeDz1XtN3WNkRiCm8PS6OYCEZsdIt6okL6ckwOK1oT1ZbKIUMEsC
	/i8MiLVzYvFb4xWszwZksv6rx+0J6ND9lpg2Dh37/H0l6Diyx6imvLfM7h1J64eKzWd0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3K-0007Et-KA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3K-0001lC-JT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update version for v5.1.0-rc0 release
Message-Id: <E1kYF3K-0001lC-JT@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:46 +0000

commit 8746309137ba470d1b2e8f5ce86ac228625db940
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 19:08:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 19:08:07 2020 +0100

    Update version for v5.1.0-rc0 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index a480698ce5..e427b98203 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.50
+5.0.90
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:01:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:01:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14844.36874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3X-0006Ji-EI; Thu, 29 Oct 2020 21:01:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14844.36874; Thu, 29 Oct 2020 21:01:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3X-0006Ja-B5; Thu, 29 Oct 2020 21:01:59 +0000
Received: by outflank-mailman (input) for mailman id 14844;
 Thu, 29 Oct 2020 21:01:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF3W-0006JU-6Q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 97ce2f9c-cef1-4396-95f1-34a583b7da00;
 Thu, 29 Oct 2020 21:01:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3V-0007F1-1z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3V-0001mh-12
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF3W-0006JU-6Q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:58 +0000
X-Inumbo-ID: 97ce2f9c-cef1-4396-95f1-34a583b7da00
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 97ce2f9c-cef1-4396-95f1-34a583b7da00;
	Thu, 29 Oct 2020 21:01:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NY8qixvxOLTHBbRLF9hSVkZnEoxphc4JM8vPc09uf/0=; b=xRUlOMl94tW5pSZiGWa8Cb5aFS
	v/5agmyOMK/bklvPQWz5FYgkfR+NvV8eTrvGdC4+1L4H79a+LgFlMzcBdhzPeyG20BjTmHaUcR23z
	nc1Dr1s2k96FwlGJqCevglwi2tcva8nYx1Z3Vt0fKBthM8uYcmuUTzchrib341v6ssz0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3V-0007F1-1z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3V-0001mh-12
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:01:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-net: fix removal of failover device
Message-Id: <E1kYF3V-0001mh-12@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:01:57 +0000

commit 650181007a027034620995eb3d5044cea1ec9b49
Author:     Juan Quintela <quintela@redhat.com>
AuthorDate: Fri Jul 3 13:48:13 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    virtio-net: fix removal of failover device
    
    If you have a networking device and its virtio failover device, and
    you remove them in this order:
    - virtio device
    - the real device
    
    You get qemu crash.
    See bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1820120
    
    Bug exist on qemu 4.2 and 5.0.
    But in 5.0 don't shows because commit
    77b06bba62034a87cc61a9c8de1309ae3e527d97
    
    somehow papers over it.
    
    CC: Jason Wang <jasowang@redhat.com>
    CC: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Laurent Vivier <lvivier@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 10cc958396..4895af1cbe 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3416,6 +3416,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
     g_free(n->vlans);
 
     if (n->failover) {
+        device_listener_unregister(&n->primary_listener);
         g_free(n->primary_device_id);
         g_free(n->standby_id);
         qobject_unref(n->primary_device_dict);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:02:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:02:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14845.36878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3h-0006LT-G1; Thu, 29 Oct 2020 21:02:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14845.36878; Thu, 29 Oct 2020 21:02:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3h-0006LL-Ck; Thu, 29 Oct 2020 21:02:09 +0000
Received: by outflank-mailman (input) for mailman id 14845;
 Thu, 29 Oct 2020 21:02:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF3g-0006LB-8j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c608e27e-cf94-4552-b383-8eaec44e58de;
 Thu, 29 Oct 2020 21:02:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3f-0007Fs-EY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3f-0001nM-58
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF3g-0006LB-8j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:08 +0000
X-Inumbo-ID: c608e27e-cf94-4552-b383-8eaec44e58de
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c608e27e-cf94-4552-b383-8eaec44e58de;
	Thu, 29 Oct 2020 21:02:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nzJ2Mut7bAlzgHhcGVy2Us+oIq9k2XU4/SgC15bU5+g=; b=mNMeyOsu7WCH0Gp4J/rGNGDscj
	xGIH6M8msv/b63hc8BPU0oJL+ZCcjCEBS947C80InSAVWsgD7sqcDuhz56wbVq2SIctpxtPzSc6Kn
	R9hryj0E8owfbwXxYYPYu25Z5c38IKwzCdX5sykls5/1VTHah6n0G/i2iNSsWhf6Bc4g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3f-0007Fs-EY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3f-0001nM-58
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/net: Added CSO for IPv6
Message-Id: <E1kYF3f-0001nM-58@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:07 +0000

commit 9a8d949245a0a3f90842d1611f56df6ae705560d
Author:     Andrew <andrew@daynix.com>
AuthorDate: Mon Jun 29 04:17:59 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    hw/net: Added CSO for IPv6
    
    Added fix for checksum offload for IPv6 if a backend doesn't
    have a virtual header.
    This patch is a part of IPv6 fragmentation.
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 162f802dd7..331c73cfc0 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -468,8 +468,8 @@ static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
     /* num of iovec without vhdr */
     uint32_t iov_len = pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1;
     uint16_t csl;
-    struct ip_header *iphdr;
     size_t csum_offset = pkt->virt_hdr.csum_start + pkt->virt_hdr.csum_offset;
+    uint16_t l3_proto = eth_get_l3_proto(iov, 1, iov->iov_len);
 
     /* Put zero to checksum field */
     iov_from_buf(iov, iov_len, csum_offset, &csum, sizeof csum);
@@ -477,9 +477,18 @@ static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
     /* Calculate L4 TCP/UDP checksum */
     csl = pkt->payload_len;
 
+    csum_cntr = 0;
+    cso = 0;
     /* add pseudo header to csum */
-    iphdr = pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base;
-    csum_cntr = eth_calc_ip4_pseudo_hdr_csum(iphdr, csl, &cso);
+    if (l3_proto == ETH_P_IP) {
+        csum_cntr = eth_calc_ip4_pseudo_hdr_csum(
+                pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
+                csl, &cso);
+    } else if (l3_proto == ETH_P_IPV6) {
+        csum_cntr = eth_calc_ip6_pseudo_hdr_csum(
+                pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
+                csl, pkt->l4proto, &cso);
+    }
 
     /* data checksum */
     csum_cntr +=
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:02:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:02:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14846.36882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3r-0006NA-HO; Thu, 29 Oct 2020 21:02:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14846.36882; Thu, 29 Oct 2020 21:02:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF3r-0006N2-EI; Thu, 29 Oct 2020 21:02:19 +0000
Received: by outflank-mailman (input) for mailman id 14846;
 Thu, 29 Oct 2020 21:02:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF3q-0006Mp-H2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 293c028d-d1af-4a97-9bbe-8d4becdb3231;
 Thu, 29 Oct 2020 21:02:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3p-0007G2-Im
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3p-0001nt-Hp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF3q-0006Mp-H2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:18 +0000
X-Inumbo-ID: 293c028d-d1af-4a97-9bbe-8d4becdb3231
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 293c028d-d1af-4a97-9bbe-8d4becdb3231;
	Thu, 29 Oct 2020 21:02:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HGZlGZNeevKsGJRGnsqnLBfiJ7a4EmfaZG2ioxI6sAs=; b=enR/6dMIFRIM2oxiF/C0VDjgD7
	eOVmlLqo5N2G4vZTbp3H9HK8o7QI/hZ577CRM1bu4PnvtYgVfsyDE7atp3ajldgzzcrzRp6zU1op8
	zwtOCR4WexZkxPe3jT/AV7S0uKnTedo+c0cB+u3ZLfOxtJNwPPAbhEPTgbM2izTwBMbQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3p-0007G2-Im
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3p-0001nt-Hp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] net/colo-compare.c: Expose compare "max_queue_size" to users
Message-Id: <E1kYF3p-0001nt-Hp@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:17 +0000

commit a2e5cb7a87206b916506697d22dc31aa0a43d8fe
Author:     Zhang Chen <chen.zhang@intel.com>
AuthorDate: Wed Jun 24 09:20:41 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net/colo-compare.c: Expose compare "max_queue_size" to users
    
    This patch allow users to set the "max_queue_size" according
    to their environment.
    
    Signed-off-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/colo-compare.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
 qemu-options.hx    |  5 +++--
 2 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 398b7546ff..cc15f23dea 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -59,6 +59,7 @@ static bool colo_compare_active;
 static QemuMutex event_mtx;
 static QemuCond event_complete_cond;
 static int event_unhandled_count;
+static uint32_t max_queue_size;
 
 /*
  *  + CompareState ++
@@ -222,7 +223,7 @@ static void fill_pkt_tcp_info(void *data, uint32_t *max_ack)
  */
 static int colo_insert_packet(GQueue *queue, Packet *pkt, uint32_t *max_ack)
 {
-    if (g_queue_get_length(queue) <= MAX_QUEUE_SIZE) {
+    if (g_queue_get_length(queue) <= max_queue_size) {
         if (pkt->ip->ip_p == IPPROTO_TCP) {
             fill_pkt_tcp_info(pkt, max_ack);
             g_queue_insert_sorted(queue,
@@ -1134,6 +1135,37 @@ static void compare_set_expired_scan_cycle(Object *obj, Visitor *v,
     s->expired_scan_cycle = value;
 }
 
+static void get_max_queue_size(Object *obj, Visitor *v,
+                               const char *name, void *opaque,
+                               Error **errp)
+{
+    uint32_t value = max_queue_size;
+
+    visit_type_uint32(v, name, &value, errp);
+}
+
+static void set_max_queue_size(Object *obj, Visitor *v,
+                               const char *name, void *opaque,
+                               Error **errp)
+{
+    Error *local_err = NULL;
+    uint32_t value;
+
+    visit_type_uint32(v, name, &value, &local_err);
+    if (local_err) {
+        goto out;
+    }
+    if (!value) {
+        error_setg(&local_err, "Property '%s.%s' requires a positive value",
+                   object_get_typename(obj), name);
+        goto out;
+    }
+    max_queue_size = value;
+
+out:
+    error_propagate(errp, local_err);
+}
+
 static void compare_pri_rs_finalize(SocketReadState *pri_rs)
 {
     CompareState *s = container_of(pri_rs, CompareState, pri_rs);
@@ -1251,6 +1283,11 @@ static void colo_compare_complete(UserCreatable *uc, Error **errp)
         s->expired_scan_cycle = REGULAR_PACKET_CHECK_MS;
     }
 
+    if (!max_queue_size) {
+        /* Set default queue size to 1024 */
+        max_queue_size = MAX_QUEUE_SIZE;
+    }
+
     if (find_and_check_chardev(&chr, s->pri_indev, errp) ||
         !qemu_chr_fe_init(&s->chr_pri_in, chr, errp)) {
         return;
@@ -1370,6 +1407,10 @@ static void colo_compare_init(Object *obj)
                         compare_get_expired_scan_cycle,
                         compare_set_expired_scan_cycle, NULL, NULL);
 
+    object_property_add(obj, "max_queue_size", "uint32",
+                        get_max_queue_size,
+                        set_max_queue_size, NULL, NULL);
+
     s->vnet_hdr = false;
     object_property_add_bool(obj, "vnet_hdr_support", compare_get_vnet_hdr,
                              compare_set_vnet_hdr);
diff --git a/qemu-options.hx b/qemu-options.hx
index d2c1e95bcf..310885c60e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4695,7 +4695,7 @@ SRST
         stored. The file format is libpcap, so it can be analyzed with
         tools such as tcpdump or Wireshark.
 
-    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}``
+    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
         Colo-compare gets packet from primary\_inchardevid and
         secondary\_inchardevid, than compare primary packet with
         secondary packet. If the packets are same, we will output
@@ -4707,7 +4707,8 @@ SRST
         vnet\_hdr\_len. Then compare\_timeout=@var{ms} determines the
         maximum delay colo-compare wait for the packet.
         The expired\_scan\_cycle=@var{ms} to set the period of scanning
-        expired primary node network packets.
+        expired primary node network packets. The max\_queue\_size=@var{size}
+        is to set the max compare queue size depend on user environment.
         If you want to use Xen COLO, will need the notify\_dev to
         notify Xen colo-frame to do checkpoint.
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:02:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:02:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14847.36886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF41-0006OR-J5; Thu, 29 Oct 2020 21:02:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14847.36886; Thu, 29 Oct 2020 21:02:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF41-0006OJ-G9; Thu, 29 Oct 2020 21:02:29 +0000
Received: by outflank-mailman (input) for mailman id 14847;
 Thu, 29 Oct 2020 21:02:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF40-0006OA-N9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a337cb27-631c-4ed7-a8f7-2c4c199effbd;
 Thu, 29 Oct 2020 21:02:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3z-0007GC-Mf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF3z-0001oN-Ly
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF40-0006OA-N9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:28 +0000
X-Inumbo-ID: a337cb27-631c-4ed7-a8f7-2c4c199effbd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a337cb27-631c-4ed7-a8f7-2c4c199effbd;
	Thu, 29 Oct 2020 21:02:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xxoZkwvZzs6o6kHgs2QW73cX1UYCyKDANQ3tit+eOCU=; b=SPJoRiOYPFUFSb270pvLgf2CZw
	89DbXanJP57HZKbeaJ8YJn0YlAX0DmI1vyi30G4mB2BmL5EJ8N5suFISoHcjzlf1Yde+Ln4WSrZy/
	AmVlxdTcAH/izPryUyODHSySEyEuIKQVSree3t/GUOAPStsH2ewlXkQaEEuzaQ9rmY0g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3z-0007GC-Mf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF3z-0001oN-Ly
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-options.hx: Clean up and fix typo for colo-compare
Message-Id: <E1kYF3z-0001oN-Ly@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:27 +0000

commit 2b28a7ef90d79ed757f6b1cc512840389dc25748
Author:     Zhang Chen <chen.zhang@intel.com>
AuthorDate: Wed Jun 24 09:20:42 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    qemu-options.hx: Clean up and fix typo for colo-compare
    
    Fix some typo and optimized some descriptions.
    
    Signed-off-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 310885c60e..65147ad971 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4696,24 +4696,24 @@ SRST
         tools such as tcpdump or Wireshark.
 
     ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
-        Colo-compare gets packet from primary\_inchardevid and
-        secondary\_inchardevid, than compare primary packet with
-        secondary packet. If the packets are same, we will output
-        primary packet to outdevchardevid, else we will notify
-        colo-frame do checkpoint and send primary packet to
-        outdevchardevid. In order to improve efficiency, we need to put
-        the task of comparison in another thread. If it has the
-        vnet\_hdr\_support flag, colo compare will send/recv packet with
-        vnet\_hdr\_len. Then compare\_timeout=@var{ms} determines the
-        maximum delay colo-compare wait for the packet.
-        The expired\_scan\_cycle=@var{ms} to set the period of scanning
-        expired primary node network packets. The max\_queue\_size=@var{size}
-        is to set the max compare queue size depend on user environment.
-        If you want to use Xen COLO, will need the notify\_dev to
+        Colo-compare gets packet from primary\_in chardevid and
+        secondary\_in, then compare whether the payload of primary packet
+        and secondary packet are the same. If same, it will output
+        primary packet to out\_dev, else it will notify COLO-framework to do
+        checkpoint and send primary packet to out\_dev. In order to
+        improve efficiency, we need to put the task of comparison in
+        another iothread. If it has the vnet\_hdr\_support flag,
+        colo compare will send/recv packet with vnet\_hdr\_len.
+        The compare\_timeout=@var{ms} determines the maximum time of the
+        colo-compare hold the packet. The expired\_scan\_cycle=@var{ms}
+        is to set the period of scanning expired primary node network packets.
+        The max\_queue\_size=@var{size} is to set the max compare queue
+        size depend on user environment.
+        If user want to use Xen COLO, need to add the notify\_dev to
         notify Xen colo-frame to do checkpoint.
 
-        we must use it with the help of filter-mirror and
-        filter-redirector.
+        COLO-compare must be used with the help of filter-mirror,
+        filter-redirector and filter-rewriter.
 
         ::
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:02:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:02:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14848.36890 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4C-0006Pl-Kc; Thu, 29 Oct 2020 21:02:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14848.36890; Thu, 29 Oct 2020 21:02:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4C-0006Pd-Hj; Thu, 29 Oct 2020 21:02:40 +0000
Received: by outflank-mailman (input) for mailman id 14848;
 Thu, 29 Oct 2020 21:02:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4B-0006PT-Fa
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a6c4138c-780f-4c9f-8212-961e362e4922;
 Thu, 29 Oct 2020 21:02:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF49-0007Hq-QJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF49-0001qS-Pb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4B-0006PT-Fa
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:39 +0000
X-Inumbo-ID: a6c4138c-780f-4c9f-8212-961e362e4922
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a6c4138c-780f-4c9f-8212-961e362e4922;
	Thu, 29 Oct 2020 21:02:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cde0ZSbq7hxa35Um/vWzDY32rySO3SmBQ46JsyH9/4Y=; b=qfN3NBvFie2R1piNVyTzVdLaIW
	ZcOZGNSMRLe1j5hHnwBBL4wjOAKsguAiq/BPzeOUa5Vw51vwaiPycuCXan2k/SWbR9nvT+zzru9Y2
	nub6uil9oEmvN6RuKkWme0ZHcW3/LPVdg1Hv+t6DTqDLBiEGo7aek7LobZtRjNrO1VrA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF49-0007Hq-QJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF49-0001qS-Pb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] net: check if the file descriptor is valid before using it
Message-Id: <E1kYF49-0001qS-Pb@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:37 +0000

commit 894022e616016fe81745753f14adfbd680a1c7ee
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 7 20:45:14 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net: check if the file descriptor is valid before using it
    
    qemu_set_nonblock() checks that the file descriptor can be used and, if
    not, crashes QEMU. An assert() is used for that. The use of assert() is
    used to detect programming error and the coredump will allow to debug
    the problem.
    
    But in the case of the tap device, this assert() can be triggered by
    a misconfiguration by the user. At startup, it's not a real problem, but it
    can also happen during the hot-plug of a new device, and here it's a
    problem because we can crash a perfectly healthy system.
    
    For instance:
     # ip link add link virbr0 name macvtap0 type macvtap mode bridge
     # ip link set macvtap0 up
     # TAP=/dev/tap$(ip -o link show macvtap0 | cut -d: -f1)
     # qemu-system-x86_64 -machine q35 -device pcie-root-port,id=pcie-root-port-0 -monitor stdio 9<> $TAP
     (qemu) netdev_add type=tap,id=hostnet0,vhost=on,fd=9
     (qemu) device_add driver=virtio-net-pci,netdev=hostnet0,id=net0,bus=pcie-root-port-0
     (qemu) device_del net0
     (qemu) netdev_del hostnet0
     (qemu) netdev_add type=tap,id=hostnet1,vhost=on,fd=9
     qemu-system-x86_64: .../util/oslib-posix.c:247: qemu_set_nonblock: Assertion `f != -1' failed.
     Aborted (core dumped)
    
    To avoid that, add a function, qemu_try_set_nonblock(), that allows to report the
    problem without crashing.
    
    In the same way, we also update the function for vhostfd in net_init_tap_one() and
    for fd in net_init_socket() (both descriptors are provided by the user and can
    be wrong).
    
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/qemu/sockets.h |  1 +
 net/socket.c           |  9 ++++++--
 net/tap.c              | 25 ++++++++++++++++++----
 util/oslib-posix.c     | 26 ++++++++++++++++-------
 util/oslib-win32.c     | 57 ++++++++++++++++++++++++++++----------------------
 5 files changed, 79 insertions(+), 39 deletions(-)

diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 57cd049d6e..7d1f813576 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -18,6 +18,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 int socket_set_cork(int fd, int v);
 int socket_set_nodelay(int fd);
 void qemu_set_block(int fd);
+int qemu_try_set_nonblock(int fd);
 void qemu_set_nonblock(int fd);
 int socket_set_fast_reuse(int fd);
 
diff --git a/net/socket.c b/net/socket.c
index c92354049b..2d21fddd9c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -725,13 +725,18 @@ int net_init_socket(const Netdev *netdev, const char *name,
     }
 
     if (sock->has_fd) {
-        int fd;
+        int fd, ret;
 
         fd = monitor_fd_param(cur_mon, sock->fd, errp);
         if (fd == -1) {
             return -1;
         }
-        qemu_set_nonblock(fd);
+        ret = qemu_try_set_nonblock(fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                             name, fd);
+            return -1;
+        }
         if (!net_socket_fd_init(peer, "socket", name, fd, 1, sock->mcast,
                                 errp)) {
             return -1;
diff --git a/net/tap.c b/net/tap.c
index f9dcc2ef51..32e4813dbc 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -690,6 +690,8 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
         }
 
         if (vhostfdname) {
+            int ret;
+
             vhostfd = monitor_fd_param(cur_mon, vhostfdname, &err);
             if (vhostfd == -1) {
                 if (tap->has_vhostforce && tap->vhostforce) {
@@ -699,7 +701,12 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
                 }
                 return;
             }
-            qemu_set_nonblock(vhostfd);
+            ret = qemu_try_set_nonblock(vhostfd);
+            if (ret < 0) {
+                error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                                 name, fd);
+                return;
+            }
         } else {
             vhostfd = open("/dev/vhost-net", O_RDWR);
             if (vhostfd < 0) {
@@ -767,6 +774,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
     Error *err = NULL;
     const char *vhostfdname;
     char ifname[128];
+    int ret = 0;
 
     assert(netdev->type == NET_CLIENT_DRIVER_TAP);
     tap = &netdev->u.tap;
@@ -795,7 +803,12 @@ int net_init_tap(const Netdev *netdev, const char *name,
             return -1;
         }
 
-        qemu_set_nonblock(fd);
+        ret = qemu_try_set_nonblock(fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                             name, fd);
+            return -1;
+        }
 
         vnet_hdr = tap_probe_vnet_hdr(fd);
 
@@ -810,7 +823,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
         char **fds;
         char **vhost_fds;
         int nfds = 0, nvhosts = 0;
-        int ret = 0;
 
         if (tap->has_ifname || tap->has_script || tap->has_downscript ||
             tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||
@@ -842,7 +854,12 @@ int net_init_tap(const Netdev *netdev, const char *name,
                 goto free_fail;
             }
 
-            qemu_set_nonblock(fd);
+            ret = qemu_try_set_nonblock(fd);
+            if (ret < 0) {
+                error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                                 name, fd);
+                goto free_fail;
+            }
 
             if (i == 0) {
                 vnet_hdr = tap_probe_vnet_hdr(fd);
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index e60aea85b6..36bf8593f8 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -260,25 +260,35 @@ void qemu_set_block(int fd)
     assert(f != -1);
 }
 
-void qemu_set_nonblock(int fd)
+int qemu_try_set_nonblock(int fd)
 {
     int f;
     f = fcntl(fd, F_GETFL);
-    assert(f != -1);
-    f = fcntl(fd, F_SETFL, f | O_NONBLOCK);
-#ifdef __OpenBSD__
     if (f == -1) {
+        return -errno;
+    }
+    if (fcntl(fd, F_SETFL, f | O_NONBLOCK) == -1) {
+#ifdef __OpenBSD__
         /*
          * Previous to OpenBSD 6.3, fcntl(F_SETFL) is not permitted on
          * memory devices and sets errno to ENODEV.
          * It's OK if we fail to set O_NONBLOCK on devices like /dev/null,
          * because they will never block anyway.
          */
-        assert(errno == ENODEV);
-    }
-#else
-    assert(f != -1);
+        if (errno == ENODEV) {
+            return 0;
+        }
 #endif
+        return -errno;
+    }
+    return 0;
+}
+
+void qemu_set_nonblock(int fd)
+{
+    int f;
+    f = qemu_try_set_nonblock(fd);
+    assert(f == 0);
 }
 
 int socket_set_fast_reuse(int fd)
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 3b49d27297..7eedbe5859 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -132,31 +132,6 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
 }
 #endif /* CONFIG_LOCALTIME_R */
 
-void qemu_set_block(int fd)
-{
-    unsigned long opt = 0;
-    WSAEventSelect(fd, NULL, 0);
-    ioctlsocket(fd, FIONBIO, &opt);
-}
-
-void qemu_set_nonblock(int fd)
-{
-    unsigned long opt = 1;
-    ioctlsocket(fd, FIONBIO, &opt);
-    qemu_fd_register(fd);
-}
-
-int socket_set_fast_reuse(int fd)
-{
-    /* Enabling the reuse of an endpoint that was used by a socket still in
-     * TIME_WAIT state is usually performed by setting SO_REUSEADDR. On Windows
-     * fast reuse is the default and SO_REUSEADDR does strange things. So we
-     * don't have to do anything here. More info can be found at:
-     * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */
-    return 0;
-}
-
-
 static int socket_error(void)
 {
     switch (WSAGetLastError()) {
@@ -233,6 +208,38 @@ static int socket_error(void)
     }
 }
 
+void qemu_set_block(int fd)
+{
+    unsigned long opt = 0;
+    WSAEventSelect(fd, NULL, 0);
+    ioctlsocket(fd, FIONBIO, &opt);
+}
+
+int qemu_try_set_nonblock(int fd)
+{
+    unsigned long opt = 1;
+    if (ioctlsocket(fd, FIONBIO, &opt) != NO_ERROR) {
+        return -socket_error();
+    }
+    qemu_fd_register(fd);
+    return 0;
+}
+
+void qemu_set_nonblock(int fd)
+{
+    (void)qemu_try_set_nonblock(fd);
+}
+
+int socket_set_fast_reuse(int fd)
+{
+    /* Enabling the reuse of an endpoint that was used by a socket still in
+     * TIME_WAIT state is usually performed by setting SO_REUSEADDR. On Windows
+     * fast reuse is the default and SO_REUSEADDR does strange things. So we
+     * don't have to do anything here. More info can be found at:
+     * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */
+    return 0;
+}
+
 int inet_aton(const char *cp, struct in_addr *ia)
 {
     uint32_t addr = inet_addr(cp);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:02:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:02:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14849.36894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4L-0006R1-Nv; Thu, 29 Oct 2020 21:02:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14849.36894; Thu, 29 Oct 2020 21:02:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4L-0006Qu-Kn; Thu, 29 Oct 2020 21:02:49 +0000
Received: by outflank-mailman (input) for mailman id 14849;
 Thu, 29 Oct 2020 21:02:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4L-0006Ql-16
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 22ca94ab-7ce3-4b16-8bcb-1dc5f8cb8349;
 Thu, 29 Oct 2020 21:02:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4J-0007I0-U0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4J-0001r1-TB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4L-0006Ql-16
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:49 +0000
X-Inumbo-ID: 22ca94ab-7ce3-4b16-8bcb-1dc5f8cb8349
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 22ca94ab-7ce3-4b16-8bcb-1dc5f8cb8349;
	Thu, 29 Oct 2020 21:02:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GfyK/iLjyqj383HyZIT8JxeEfO3pzZcJpGwNwMkrnsY=; b=WNTqV6OFT0XfAWLs7iCd43kZ5r
	yoUp/07+lBpsbbodB9UWz0KRaEaOVAEdzqTovgKhQLEGvBrW0rTv9GjNN67J6OBmYvtdsXlX6jwZA
	sT5x7L8sTqVHedW1zQ1IYQkyeOqlASSkq59QjDoAwSdL9eMS6ZPY6k23zyPKYAQeDyJQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4J-0007I0-U0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4J-0001r1-TB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] net: detect errors from probing vnet hdr flag for TAP devices
Message-Id: <E1kYF4J-0001r1-TB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:47 +0000

commit e7b347d0bf640adb1c998d317eaf44d2d7cbd973
Author:     Daniel P. Berrange <berrange@redhat.com>
AuthorDate: Tue Jul 7 20:45:15 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net: detect errors from probing vnet hdr flag for TAP devices
    
    When QEMU sets up a tap based network device backend, it mostly ignores errors
    reported from various ioctl() calls it makes, assuming the TAP file descriptor
    is valid. This assumption can easily be violated when the user is passing in a
    pre-opened file descriptor. At best, the ioctls may fail with a -EBADF, but if
    the user passes in a bogus FD number that happens to clash with a FD number that
    QEMU has opened internally for another reason, a wide variety of errnos may
    result, as the TUNGETIFF ioctl number may map to a completely different command
    on a different type of file.
    
    By ignoring all these errors, QEMU sets up a zombie network backend that will
    never pass any data. Even worse, when QEMU shuts down, or that network backend
    is hot-removed, it will close this bogus file descriptor, which could belong to
    another QEMU device backend.
    
    There's no obvious guaranteed reliable way to detect that a FD genuinely is a
    TAP device, as opposed to a UNIX socket, or pipe, or something else. Checking
    the errno from probing vnet hdr flag though, does catch the big common cases.
    ie calling TUNGETIFF will return EBADF for an invalid FD, and ENOTTY when FD is
    a UNIX socket, or pipe which catches accidental collisions with FDs used for
    stdio, or monitor socket.
    
    Previously the example below where bogus fd 9 collides with the FD used for the
    chardev saw:
    
    $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
      -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
      -monitor stdio -vnc :0
    qemu-system-x86_64: -netdev tap,id=hostnet0,fd=9: TUNGETIFF ioctl() failed: Inappropriate ioctl for device
    TUNSETOFFLOAD ioctl() failed: Bad address
    QEMU 2.9.1 monitor - type 'help' for more information
    (qemu) Warning: netdev hostnet0 has no peer
    
    which gives a running QEMU with a zombie network backend.
    
    With this change applied we get an error message and QEMU immediately exits
    before carrying on and making a bigger disaster:
    
    $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
      -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
      -monitor stdio -vnc :0
    qemu-system-x86_64: -netdev tap,id=hostnet0,vhost=on,fd=9: Unable to query TUNGETIFF on FD 9: Inappropriate ioctl for device
    
    Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-id: 20171027085548.3472-1-berrange@redhat.com
    [lv: to simplify, don't check on EINVAL with TUNGETIFF as it exists since v2.6.27]
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/tap-bsd.c     |  2 +-
 net/tap-linux.c   |  8 +++++---
 net/tap-solaris.c |  2 +-
 net/tap-stub.c    |  2 +-
 net/tap.c         | 25 ++++++++++++++++++++-----
 net/tap_int.h     |  2 +-
 6 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index a5c3707f80..77aaf674b1 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -211,7 +211,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap-linux.c b/net/tap-linux.c
index e0dd442ee3..b0635e9e32 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -147,13 +147,15 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
     }
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     struct ifreq ifr;
 
     if (ioctl(fd, TUNGETIFF, &ifr) != 0) {
-        error_report("TUNGETIFF ioctl() failed: %s", strerror(errno));
-        return 0;
+        /* TUNGETIFF is available since kernel v2.6.27 */
+        error_setg_errno(errp, errno,
+                         "Unable to query TUNGETIFF on FD %d", fd);
+        return -1;
     }
 
     return ifr.ifr_flags & IFF_VNET_HDR;
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index d03165c57c..0475a58207 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -207,7 +207,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap-stub.c b/net/tap-stub.c
index a9ab8f8293..de525a2e69 100644
--- a/net/tap-stub.c
+++ b/net/tap-stub.c
@@ -37,7 +37,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap.c b/net/tap.c
index 32e4813dbc..14dc904fca 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -598,7 +598,11 @@ int net_init_bridge(const Netdev *netdev, const char *name,
     }
 
     qemu_set_nonblock(fd);
-    vnet_hdr = tap_probe_vnet_hdr(fd);
+    vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+    if (vnet_hdr < 0) {
+        close(fd);
+        return -1;
+    }
     s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);
 
     snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,
@@ -810,7 +814,11 @@ int net_init_tap(const Netdev *netdev, const char *name,
             return -1;
         }
 
-        vnet_hdr = tap_probe_vnet_hdr(fd);
+        vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+        if (vnet_hdr < 0) {
+            close(fd);
+            return -1;
+        }
 
         net_init_tap_one(tap, peer, "tap", name, NULL,
                          script, downscript,
@@ -862,8 +870,11 @@ int net_init_tap(const Netdev *netdev, const char *name,
             }
 
             if (i == 0) {
-                vnet_hdr = tap_probe_vnet_hdr(fd);
-            } else if (vnet_hdr != tap_probe_vnet_hdr(fd)) {
+                vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+                if (vnet_hdr < 0) {
+                    goto free_fail;
+                }
+            } else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {
                 error_setg(errp,
                            "vnet_hdr not consistent across given tap fds");
                 ret = -1;
@@ -908,7 +919,11 @@ free_fail:
         }
 
         qemu_set_nonblock(fd);
-        vnet_hdr = tap_probe_vnet_hdr(fd);
+        vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+        if (vnet_hdr < 0) {
+            close(fd);
+            return -1;
+        }
 
         net_init_tap_one(tap, peer, "bridge", name, ifname,
                          script, downscript, vhostfdname,
diff --git a/net/tap_int.h b/net/tap_int.h
index e3194b23f4..225a49ea48 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -34,7 +34,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
 ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
 
 void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
-int tap_probe_vnet_hdr(int fd);
+int tap_probe_vnet_hdr(int fd, Error **errp);
 int tap_probe_vnet_hdr_len(int fd, int len);
 int tap_probe_has_ufo(int fd);
 void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14850.36897 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4W-0006UF-Pa; Thu, 29 Oct 2020 21:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14850.36897; Thu, 29 Oct 2020 21:03:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4W-0006U7-Mh; Thu, 29 Oct 2020 21:03:00 +0000
Received: by outflank-mailman (input) for mailman id 14850;
 Thu, 29 Oct 2020 21:02:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4V-0006Tr-55
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c7b29286-10ef-4824-b580-7a306ad46b49;
 Thu, 29 Oct 2020 21:02:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4U-0007IW-2D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4U-0001rm-0c
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4V-0006Tr-55
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:59 +0000
X-Inumbo-ID: c7b29286-10ef-4824-b580-7a306ad46b49
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c7b29286-10ef-4824-b580-7a306ad46b49;
	Thu, 29 Oct 2020 21:02:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mnBlv5wWivgHlsufTA9Kbk1I9Ye30KhypB2G1ok6amM=; b=uaemdf4ot6Zmtbf/s+D2M81/wv
	ua0qEKEE1s7QfnIZkMxmyIC5yeu8DV2lzl2f/vIRtg/fpzFX9oJzf2BdqKNON0+ewrgEoaG4AJ5zo
	IY6PPmCA89qCZvJ0WqdiXTfy7Gxn5K45V+8X/hhM4Ko6fqvwfXk83vz8UjWBMgKOZP4E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4U-0007IW-2D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4U-0001rm-0c
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:02:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ftgmac100: fix dblac write test
Message-Id: <E1kYF4U-0001rm-0c@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:02:58 +0000

commit a134321ef676723768973537bb9b49365ae2062e
Author:     erik-smit <erik.lucas.smit@gmail.com>
AuthorDate: Sun Jun 28 16:26:59 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    ftgmac100: fix dblac write test
    
    The test of the write of the dblac register was testing the old value
    instead of the new value. This would accept the write of an invalid value
    but subsequently refuse any following valid writes.
    
    Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/ftgmac100.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index 043ba61b86..5f4b26fc5f 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -810,16 +810,18 @@ static void ftgmac100_write(void *opaque, hwaddr addr,
         s->phydata = value & 0xffff;
         break;
     case FTGMAC100_DBLAC: /* DMA Burst Length and Arbitration Control */
-        if (FTGMAC100_DBLAC_TXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+        if (FTGMAC100_DBLAC_TXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
             qemu_log_mask(LOG_GUEST_ERROR,
-                          "%s: transmit descriptor too small : %d bytes\n",
-                          __func__, FTGMAC100_DBLAC_TXDES_SIZE(s->dblac));
+                          "%s: transmit descriptor too small: %" PRIx64
+                          " bytes\n", __func__,
+                          FTGMAC100_DBLAC_TXDES_SIZE(value));
             break;
         }
-        if (FTGMAC100_DBLAC_RXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+        if (FTGMAC100_DBLAC_RXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
             qemu_log_mask(LOG_GUEST_ERROR,
-                          "%s: receive descriptor too small : %d bytes\n",
-                          __func__, FTGMAC100_DBLAC_RXDES_SIZE(s->dblac));
+                          "%s: receive descriptor too small : %" PRIx64
+                          " bytes\n", __func__,
+                          FTGMAC100_DBLAC_RXDES_SIZE(value));
             break;
         }
         s->dblac = value;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14851.36902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4f-0006Vm-RH; Thu, 29 Oct 2020 21:03:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14851.36902; Thu, 29 Oct 2020 21:03:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4f-0006Ve-OC; Thu, 29 Oct 2020 21:03:09 +0000
Received: by outflank-mailman (input) for mailman id 14851;
 Thu, 29 Oct 2020 21:03:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4e-0006VY-VO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9cc798e6-2321-483c-a69a-2583b2a6e21c;
 Thu, 29 Oct 2020 21:03:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4e-0007JU-7B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4e-0001sg-5Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4e-0006VY-VO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
X-Inumbo-ID: 9cc798e6-2321-483c-a69a-2583b2a6e21c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9cc798e6-2321-483c-a69a-2583b2a6e21c;
	Thu, 29 Oct 2020 21:03:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wCj+bSPiSQd+KInMtSGnElPmR7u6DvJQkEWIB2XzgbU=; b=TJipw14LnsOCDATVx8f+7LyLOD
	GxqPyeX7L/j3IMDHQYXOzTlYS6tuZdWNhSWkXmhrHkZNM65fEFGWxH4Od8GN/YtSY4KlOtcblIFM3
	IlheQZtnDqsUMv6zdKsDgoGtfsmNar0dLX4Kxc0dyZt573byfjQUGwE9EaQHVg573YBU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4e-0007JU-7B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4e-0001sg-5Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYF4e-0001sg-5Z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:08 +0000

commit ee5128bb00f90dd301991d80d1db5224ce924c84
Merge: 8746309137ba470d1b2e8f5ce86ac228625db940 a134321ef676723768973537bb9b49365ae2062e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 13:12:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 13:12:05 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Wed 15 Jul 2020 14:49:07 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      ftgmac100: fix dblac write test
      net: detect errors from probing vnet hdr flag for TAP devices
      net: check if the file descriptor is valid before using it
      qemu-options.hx: Clean up and fix typo for colo-compare
      net/colo-compare.c: Expose compare "max_queue_size" to users
      hw/net: Added CSO for IPv6
      virtio-net: fix removal of failover device
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/ftgmac100.c     | 14 +++++++------
 hw/net/net_tx_pkt.c    | 15 ++++++++++---
 hw/net/virtio-net.c    |  1 +
 include/qemu/sockets.h |  1 +
 net/colo-compare.c     | 43 ++++++++++++++++++++++++++++++++++++-
 net/socket.c           |  9 ++++++--
 net/tap-bsd.c          |  2 +-
 net/tap-linux.c        |  8 ++++---
 net/tap-solaris.c      |  2 +-
 net/tap-stub.c         |  2 +-
 net/tap.c              | 50 +++++++++++++++++++++++++++++++++++--------
 net/tap_int.h          |  2 +-
 qemu-options.hx        | 33 +++++++++++++++--------------
 util/oslib-posix.c     | 26 ++++++++++++++++-------
 util/oslib-win32.c     | 57 ++++++++++++++++++++++++++++----------------------
 15 files changed, 188 insertions(+), 77 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14852.36906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4q-0006b9-Ss; Thu, 29 Oct 2020 21:03:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14852.36906; Thu, 29 Oct 2020 21:03:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF4q-0006b1-Pv; Thu, 29 Oct 2020 21:03:20 +0000
Received: by outflank-mailman (input) for mailman id 14852;
 Thu, 29 Oct 2020 21:03:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4p-0006ar-BN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 49e1a2f5-bef8-4ae0-9ad8-c58cd39c6af7;
 Thu, 29 Oct 2020 21:03:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4o-0007Je-Iz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4o-0001tn-Hg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4p-0006ar-BN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:19 +0000
X-Inumbo-ID: 49e1a2f5-bef8-4ae0-9ad8-c58cd39c6af7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 49e1a2f5-bef8-4ae0-9ad8-c58cd39c6af7;
	Thu, 29 Oct 2020 21:03:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tJWbG//FPui6u+ig0jOr7v+xraIStTsOqubPw7ScfvQ=; b=oa9PvV6dpr4F/ESTSXwmx39QcJ
	CH04pRM+t+eB/i2PG2iG7W9VYcRN00X0EC5D2oNIVUUVNf5sBObtjcdg9PX1JxKc+Sa0GtTb5372t
	Tg5ZTRT49O4QGY6UMtzLjTh2l5TY4qVq24ttWAX2NEnb0mud/85Qegw4lCgoi3m6V55I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4o-0007Je-Iz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4o-0001tn-Hg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tpm: tpm_spapr: Exit on TPM backend failures
Message-Id: <E1kYF4o-0001tn-Hg@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:18 +0000

commit f8b332a1ff107dc014a52eaf9bf547995205f18a
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:24 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Wed Jul 15 14:57:33 2020 -0400

    tpm: tpm_spapr: Exit on TPM backend failures
    
    Exit on TPM backend failures in the same way as the TPM CRB and TIS device
    models do. With this change we now get an error report when the backend
    did not start up properly:
    
    error: internal error: qemu unexpectedly closed the monitor:
    2020-07-07T12:49:28.333928Z qemu-system-ppc64: tpm-emulator: \
      TPM result for CMD_INIT: 0x101 operation failed
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-2-stefanb@linux.vnet.ibm.com
---
 hw/tpm/tpm_spapr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index cb4dfd1e6a..8288ab0a15 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
                             TPM_SPAPR_BUFFER_MAX);
 
     tpm_backend_reset(s->be_driver);
-    tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
+
+    if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
+        exit(1);
+    }
 }
 
 static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14853.36910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF50-0006cJ-UQ; Thu, 29 Oct 2020 21:03:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14853.36910; Thu, 29 Oct 2020 21:03:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF50-0006cB-RT; Thu, 29 Oct 2020 21:03:30 +0000
Received: by outflank-mailman (input) for mailman id 14853;
 Thu, 29 Oct 2020 21:03:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF4z-0006bz-KZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9839e355-f20c-4d6c-b6dc-b873eb205047;
 Thu, 29 Oct 2020 21:03:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4y-0007Jk-Mb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF4y-0001uL-Lq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF4z-0006bz-KZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:29 +0000
X-Inumbo-ID: 9839e355-f20c-4d6c-b6dc-b873eb205047
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9839e355-f20c-4d6c-b6dc-b873eb205047;
	Thu, 29 Oct 2020 21:03:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+fLQqnw0QlcYgc4kUUe7a3GgPL9gQYwMEeeVck3r2M4=; b=LWHRIyzWtifd1tR+9mjNRiolCf
	961ZOA0pDuc+QkNm6bf+g7KH4XkIFYS8x9WpsNlKv6vdS4ykNtTJrd2obzqP61QP/bc2+qHhi0DE/
	AKdJh/vOuo9kkXPk0tAZ4Bdp3cxBAYGl5/udS+mPWBNtZWuV9sV6AlTj0fNSPlsySci8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4y-0007Jk-Mb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF4y-0001uL-Lq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests: tpm: Skip over pcrUpdateCounter byte in result comparison
Message-Id: <E1kYF4y-0001uL-Lq@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:28 +0000

commit df8a7568932e4c3c930fdfeb228dd72b4bb71a1f
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:25 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Wed Jul 15 14:57:33 2020 -0400

    tests: tpm: Skip over pcrUpdateCounter byte in result comparison
    
    The TPM 2 code in libtpms was fixed to handle the PCR 'TCB group' according
    to the PCClient profile. The change of the PCRs belonging to the 'TCB group'
    now affects the pcrUpdateCounter in the TPM2_PCRRead() responses where its
    value is now different (typically lower by '1') than what it was before. To
    not fail the tests, we skip the comparison of the 14th byte, which
    represents the pcrUpdateCounter.
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-3-stefanb@linux.vnet.ibm.com
---
 tests/qtest/tpm-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index 34efae8f18..58a9593745 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
 
     tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
 
-    g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
+    /* skip pcrUpdateCounter (14th byte) in comparison */
+    g_assert(exp_resp_size >= 15);
+    g_assert_cmpmem(buffer, 13, exp_resp, 13);
+    g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
+                    &exp_resp[14], exp_resp_size - 14);
 }
 
 bool tpm_util_swtpm_has_tpm2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14854.36914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5B-0006df-WE; Thu, 29 Oct 2020 21:03:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14854.36914; Thu, 29 Oct 2020 21:03:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5B-0006dX-T6; Thu, 29 Oct 2020 21:03:41 +0000
Received: by outflank-mailman (input) for mailman id 14854;
 Thu, 29 Oct 2020 21:03:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5A-0006dM-I3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8125c42b-22d4-4faa-bbc6-a193ff59914c;
 Thu, 29 Oct 2020 21:03:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF58-0007Js-RA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF58-0001v6-PT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5A-0006dM-I3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:40 +0000
X-Inumbo-ID: 8125c42b-22d4-4faa-bbc6-a193ff59914c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8125c42b-22d4-4faa-bbc6-a193ff59914c;
	Thu, 29 Oct 2020 21:03:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IlLk51NHu3Mf1J6LLjCAP3FDBwOHwWDZr06rbeJry1w=; b=WP/R3hLFKKNdZUie9aJyUA5OSl
	+5vOcleBOTtv/igJh3HhLy2eHgLWDj2TO4lDBo8c9aof7QVmsvKwPcIa3iHPK7y+NSySpDLdBufDg
	HqNfigF/AjyEnSbvZYwtxAoY67oQdYC42y9FBCqs4Ff3MpxyzPBomAEY8BhMi7dje7ZU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF58-0007Js-RA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF58-0001v6-PT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging
Message-Id: <E1kYF58-0001v6-PT@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:38 +0000

commit 175788d4eb91a840e9505d84ff2c6bedf4380143
Merge: ee5128bb00f90dd301991d80d1db5224ce924c84 df8a7568932e4c3c930fdfeb228dd72b4bb71a1f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 14:46:47 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 14:46:47 2020 +0100

    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging
    
    Merge tpm 2020/07/15 v1
    
    # gpg: Signature made Wed 15 Jul 2020 20:16:21 BST
    # gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
    # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
    
    * remotes/stefanberger/tags/pull-tpm-2020-07-15-1:
      tests: tpm: Skip over pcrUpdateCounter byte in result comparison
      tpm: tpm_spapr: Exit on TPM backend failures
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/tpm/tpm_spapr.c     | 5 ++++-
 tests/qtest/tpm-util.c | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:03:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:03:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14855.36918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5L-0006ez-2d; Thu, 29 Oct 2020 21:03:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14855.36918; Thu, 29 Oct 2020 21:03:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5K-0006er-W1; Thu, 29 Oct 2020 21:03:50 +0000
Received: by outflank-mailman (input) for mailman id 14855;
 Thu, 29 Oct 2020 21:03:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5K-0006ek-18
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4aee5a4b-b2cb-4909-b618-a42867a3f1b1;
 Thu, 29 Oct 2020 21:03:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5J-0007K7-6H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5J-0001w1-5a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5K-0006ek-18
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:50 +0000
X-Inumbo-ID: 4aee5a4b-b2cb-4909-b618-a42867a3f1b1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4aee5a4b-b2cb-4909-b618-a42867a3f1b1;
	Thu, 29 Oct 2020 21:03:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jI6hz2vVtfH7vTIZPrm6c1iEFGoHKlFgOFc648hblrA=; b=5ZWJMEGvbQVFtRIPMBs+45seds
	56qDthgwwzWhj66/QViPWtkNjfSs/C1gA0LylwA9Rx83+wOOqXcA8FMOta7GQBK+ZhTqZkk9noPIg
	ZNnipf9Hjuw+UWbTd33ePJRegDgRZUhth+mz9lVtkGZGml/HRWtyefPcKET6Czj/KRUg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5J-0007K7-6H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5J-0001w1-5a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] vfio: fix use-after-free in display
Message-Id: <E1kYF5J-0001w1-5a@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:49 +0000

commit 8ec1415935ff4214ef9b47448ff7ac52cfa8b77e
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 13 14:45:20 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Thu Jul 16 10:20:12 2020 +0200

    vfio: fix use-after-free in display
    
    Calling ramfb_display_update() might replace the DisplaySurface with the
    boot display, which in turn will free the currently active
    DisplaySurface.
    
    So clear our DisplaySurface pinter (dpy->region.surface pointer) to (a)
    avoid use-after-free and (b) force replacing the boot display with the
    real display when switching back.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
    Acked-by: Alex Williamson <alex.williamson@redhat.com>
    Message-id: 20200713124520.23266-1-kraxel@redhat.com
---
 hw/vfio/display.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/vfio/display.c b/hw/vfio/display.c
index a57a22674d..342054193b 100644
--- a/hw/vfio/display.c
+++ b/hw/vfio/display.c
@@ -405,6 +405,7 @@ static void vfio_display_region_update(void *opaque)
     if (!plane.drm_format || !plane.size) {
         if (dpy->ramfb) {
             ramfb_display_update(dpy->con, dpy->ramfb);
+            dpy->region.surface = NULL;
         }
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14856.36923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5V-0006h1-54; Thu, 29 Oct 2020 21:04:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14856.36923; Thu, 29 Oct 2020 21:04:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5V-0006gt-1A; Thu, 29 Oct 2020 21:04:01 +0000
Received: by outflank-mailman (input) for mailman id 14856;
 Thu, 29 Oct 2020 21:04:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5U-0006g2-3e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0f7fba65-fed8-498c-a18a-883510407af5;
 Thu, 29 Oct 2020 21:03:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5T-0007Kg-A1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5T-0001wb-9C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5U-0006g2-3e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:00 +0000
X-Inumbo-ID: 0f7fba65-fed8-498c-a18a-883510407af5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0f7fba65-fed8-498c-a18a-883510407af5;
	Thu, 29 Oct 2020 21:03:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OaK8r8kHR4j6LoFjYQf5UeXeth4ZPj3OOdXxA8GVUl4=; b=JhdBfEO91uqPumkTDiaQ/aqjlF
	cCFGX2vSVKEy3KVSg56UbGD/5VF95/z/6IBHzyLw/6xVHKQOBsJ891bzQ1GPNYe1uD9xnhPYSMfCP
	okP3H6iqauF3HQZTIaCgmAJwaDQcVv9z6VZnFr3Aq2eDxhmu2DHKuqX27oxXlZwe9ugk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5T-0007Kg-A1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5T-0001wb-9C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:03:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] usb: fix storage regression
Message-Id: <E1kYF5T-0001wb-9C@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:03:59 +0000

commit 4084e35068772cf4f81bbae5174019f277c61084
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 13 08:27:12 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Thu Jul 16 10:20:27 2020 +0200

    usb: fix storage regression
    
    Fix the contition to figure whenever we need to wait for more data or
    not.  Simply check the mode, if we are not in DATAIN state any more we
    are done already and don't need to go ASYNC.
    
    Fixes: 7ad3d51ebb8a ("usb: add short-packet handling to usb-storage driver")
    Reported-by: Sai Pavan Boddu <saipava@xilinx.com>
    Tested-by: Paul Zimmerman <pauldzim@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-id: 20200713062712.1476-1-kraxel@redhat.com
---
 hw/usb/dev-storage.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 2ed6a8df24..405a4ccfe7 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -546,8 +546,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
                     }
                 }
             }
-            if (p->actual_length < p->iov.size && (p->short_not_ok ||
-                    s->scsi_len >= p->ep->max_packet_size)) {
+            if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
                 DPRINTF("Deferring packet %p [wait data-in]\n", p);
                 s->packet = p;
                 p->status = USB_RET_ASYNC;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14857.36926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5g-0006iE-5f; Thu, 29 Oct 2020 21:04:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14857.36926; Thu, 29 Oct 2020 21:04:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5g-0006i6-2l; Thu, 29 Oct 2020 21:04:12 +0000
Received: by outflank-mailman (input) for mailman id 14857;
 Thu, 29 Oct 2020 21:04:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5e-0006ht-G4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1b62d1ef-be92-494a-81a5-44894cdf3794;
 Thu, 29 Oct 2020 21:04:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5d-0007L4-EF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5d-0001xU-Cz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5e-0006ht-G4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:10 +0000
X-Inumbo-ID: 1b62d1ef-be92-494a-81a5-44894cdf3794
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1b62d1ef-be92-494a-81a5-44894cdf3794;
	Thu, 29 Oct 2020 21:04:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4yUaUvLlaobcGyeAXJ6yh4qQ75vHwmlyqJqlFCtYIHU=; b=kMJXhyTDqdiuZP38wapV0QKdjx
	yJEfZgrkUnYbl065v+oBUvdOp/c3z08vIr+t63AUZ9NcysjVqXFl4DfIjJLImPN90VOSPyyhEgCX0
	4DDQ7W5+juhRy7eNuyRkMe5qfS8i9YmEqYL9NSTX6DJgH3AocvkQTxd0EDTHSQgDWJUI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5d-0007L4-EF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5d-0001xU-Cz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200716-pull-request' into staging
Message-Id: <E1kYF5d-0001xU-Cz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:04:09 +0000

commit 95d1fbabae0cd44156ac4b96d512d143ca7dfd5e
Merge: 175788d4eb91a840e9505d84ff2c6bedf4380143 4084e35068772cf4f81bbae5174019f277c61084
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 18:50:51 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 18:50:51 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200716-pull-request' into staging
    
    fixes: usb storage regression, vfio display ramfb bug
    
    # gpg: Signature made Thu 16 Jul 2020 10:30:58 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200716-pull-request:
      usb: fix storage regression
      vfio: fix use-after-free in display
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/usb/dev-storage.c | 3 +--
 hw/vfio/display.c    | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14858.36929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5q-0006jW-7L; Thu, 29 Oct 2020 21:04:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14858.36929; Thu, 29 Oct 2020 21:04:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF5q-0006jQ-4J; Thu, 29 Oct 2020 21:04:22 +0000
Received: by outflank-mailman (input) for mailman id 14858;
 Thu, 29 Oct 2020 21:04:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5p-0006jH-B1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ef4ffbe4-9ace-4cd2-b4b6-3ecd1222cd29;
 Thu, 29 Oct 2020 21:04:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5n-0007LA-SO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5n-0001zS-Qy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5p-0006jH-B1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:21 +0000
X-Inumbo-ID: ef4ffbe4-9ace-4cd2-b4b6-3ecd1222cd29
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ef4ffbe4-9ace-4cd2-b4b6-3ecd1222cd29;
	Thu, 29 Oct 2020 21:04:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xggf7q/KRnzCTeJCfyUUsD8EAjM1Vl1FYQd+uEdGXV4=; b=TmP1kpW/si1O4SOHvHeH9x1k+t
	gfE8O/q3/TF7kjDnHdz4S6HbDeWjE0RdNrdiJA+MBbgiEk4EH2kQ4BEWv5jk8ps5KBUfUdTtSCQ8H
	SskrH9AvGG9kB5khNbi5l/AH0TfWsjMrjvI+mUZwksH7xt00ndDeUYJN5RAoChR/Ho5s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5n-0007LA-SO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5n-0001zS-Qy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] i368/cpu: Clear env->user_features after loading versioned CPU model
Message-Id: <E1kYF5n-0001zS-Qy@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:04:19 +0000

commit 1f43671a0d55d863f9111535ca4241e9fa238506
Author:     Xiaoyao Li <xiaoyao.li@intel.com>
AuthorDate: Tue Jul 14 01:44:35 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:04:42 2020 -0400

    i368/cpu: Clear env->user_features after loading versioned CPU model
    
    Features defined in versioned CPU model are recorded in env->user_features
    since they are updated as property. It's unwated because they are not
    user specified.
    
    Simply clear env->user_features as a fix. It won't clear user specified
    features because user specified features are filled to
    env->user_features later in x86_cpu_expand_features().
    
    Cc: Chenyi Qiang <chenyi.qiang@intel.com>
    Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
    Message-Id: <20200713174436.41070-2-xiaoyao.li@intel.com>
    [ehabkost: fix coding style]
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1e5123251d..caf0334f3a 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5159,6 +5159,13 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model)
     object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort);
 
     x86_cpu_apply_version_props(cpu, model);
+
+    /*
+     * Properties in versioned CPU model are not user specified features.
+     * We can simply clear env->user_features here since it will be filled later
+     * in x86_cpu_expand_features() based on plus_features and minus_features.
+     */
+    memset(&env->user_features, 0, sizeof(env->user_features));
 }
 
 #ifndef CONFIG_USER_ONLY
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14859.36935 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF60-0006kj-9j; Thu, 29 Oct 2020 21:04:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14859.36935; Thu, 29 Oct 2020 21:04:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF60-0006kb-5m; Thu, 29 Oct 2020 21:04:32 +0000
Received: by outflank-mailman (input) for mailman id 14859;
 Thu, 29 Oct 2020 21:04:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF5z-0006kU-8R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 32b7f050-1569-4edb-8f14-6e4ed46c8aee;
 Thu, 29 Oct 2020 21:04:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5x-0007LJ-W9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF5x-00020M-VO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF5z-0006kU-8R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:31 +0000
X-Inumbo-ID: 32b7f050-1569-4edb-8f14-6e4ed46c8aee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 32b7f050-1569-4edb-8f14-6e4ed46c8aee;
	Thu, 29 Oct 2020 21:04:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Kfmr9GzWR1cTnUHWxXLtTAdIC0rYtk1vdWMtbMTZhRE=; b=mtheKXM2tPwJKMQxqWV9jwwdC5
	ZEDhSx3UlLSbC1USO0V1OkpqUrvaW3Yw63isCqbPto8o7X5+N3/bziLxKQiJI749hl43/1IdWyaAw
	iWLtGbvBGxSC6NFG+2nDcjEPMnu3bVLkD+s2HQyMF/1xacJHzEsaZCSM6dt80AuFi5VU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5x-0007LJ-W9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF5x-00020M-VO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] i386/cpu: Don't add unavailable_features to env->user_features
Message-Id: <E1kYF5x-00020M-VO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:04:29 +0000

commit f9f08e7cae8a6c292cacaf6531ede88786fcb3d3
Author:     Xiaoyao Li <xiaoyao.li@intel.com>
AuthorDate: Tue Jul 14 01:44:36 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:04:42 2020 -0400

    i386/cpu: Don't add unavailable_features to env->user_features
    
    Features unavailable due to absent of their dependent features should
    not be added to env->user_features. env->user_features only contains the
    feature explicity specified with -feature/+feature by user.
    
    Fixes: 99e24dbdaa68 ("target/i386: introduce generic feature dependency mechanism")
    Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
    Message-Id: <20200713174436.41070-3-xiaoyao.li@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index caf0334f3a..93b62b2eca 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6371,7 +6371,6 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
                                       unavailable_features & env->user_features[d->to.index],
                                       "This feature depends on other features that were not requested");
 
-            env->user_features[d->to.index] |= unavailable_features;
             env->features[d->to.index] &= ~unavailable_features;
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14860.36938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6A-0006m2-AP; Thu, 29 Oct 2020 21:04:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14860.36938; Thu, 29 Oct 2020 21:04:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6A-0006lu-7K; Thu, 29 Oct 2020 21:04:42 +0000
Received: by outflank-mailman (input) for mailman id 14860;
 Thu, 29 Oct 2020 21:04:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF68-0006ll-SO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ca22a05c-816d-4c78-8831-2bcbc3243553;
 Thu, 29 Oct 2020 21:04:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF68-0007LS-3k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF68-00021G-2y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF68-0006ll-SO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
X-Inumbo-ID: ca22a05c-816d-4c78-8831-2bcbc3243553
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ca22a05c-816d-4c78-8831-2bcbc3243553;
	Thu, 29 Oct 2020 21:04:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G1d3ylEwL6E8I/FrM1DHjMlGK2p+sTiuFx2vv45sxFQ=; b=kEL1iOENPeSKqE43sbRyMrmX+m
	XocN6Aogm+XA5uU3fGG7Vd2+AgZbRoKMjs4ZnZsE6RwrfFnOw5BkmOdNFMwXhF2XmFTV1+dIagcf3
	mO7FMbNctOMSVJ8mTj8FWe0NeU45og+vxQrQlEHqbCWA1JlfxNgmHQjwunNKR+UndqBY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF68-0007LS-3k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF68-00021G-2y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/i386: add fast short REP MOV support
Message-Id: <E1kYF68-00021G-2y@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:04:40 +0000

commit 5cb287d2bd578dfe4897458793b4fce35bc4f744
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:46 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: add fast short REP MOV support
    
    For CPUs support fast short REP MOV[CPUID.(EAX=7,ECX=0):EDX(bit4)], e.g
    Icelake and Tigerlake, expose it to the guest VM.
    
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-2-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 93b62b2eca..3885826bc4 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -984,7 +984,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .type = CPUID_FEATURE_WORD,
         .feat_names = {
             NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
-            NULL, NULL, NULL, NULL,
+            "fsrm", NULL, NULL, NULL,
             "avx512-vp2intersect", NULL, "md-clear", NULL,
             NULL, NULL, "serialize", NULL,
             "tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 37fffa5cac..e1a5c174dc 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -775,6 +775,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EDX_AVX512_4VNNIW     (1U << 2)
 /* AVX512 Multiply Accumulation Single Precision */
 #define CPUID_7_0_EDX_AVX512_4FMAPS     (1U << 3)
+/* Fast Short Rep Mov */
+#define CPUID_7_0_EDX_FSRM              (1U << 4)
 /* AVX512 Vector Pair Intersection to a Pair of Mask Registers */
 #define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
 /* SERIALIZE instruction */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:04:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:04:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14861.36943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6K-0006nN-CV; Thu, 29 Oct 2020 21:04:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14861.36943; Thu, 29 Oct 2020 21:04:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6K-0006nF-8q; Thu, 29 Oct 2020 21:04:52 +0000
Received: by outflank-mailman (input) for mailman id 14861;
 Thu, 29 Oct 2020 21:04:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF6J-0006n5-46
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 238f56df-6487-4ee2-9df5-ba4f66951773;
 Thu, 29 Oct 2020 21:04:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6I-0007LZ-7h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6I-00022H-70
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF6J-0006n5-46
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:51 +0000
X-Inumbo-ID: 238f56df-6487-4ee2-9df5-ba4f66951773
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 238f56df-6487-4ee2-9df5-ba4f66951773;
	Thu, 29 Oct 2020 21:04:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V5iN5XkwIyEJm9igpdBhYTpS/jcKxrbbbKqSmVnCSAY=; b=RKaiEp/QzO7AynSf0agn1XnpEd
	VWc8kXn7i3C76LFhIhpxlmaTP7mzsWeHnm159iqr8KEfpdWPDplhlOD65hyORD4hrouLERadnEAly
	HlI+bsnl/tMIhjbuR2Qzycy8wzKjcy1E5LnsvQFubpGOjVGgxX7FSnjON2X91Oyym+ag=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6I-0007LZ-7h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6I-00022H-70
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:04:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/i386: fix model number and add missing features for Icelake-Server CPU model
Message-Id: <E1kYF6I-00022H-70@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:04:50 +0000

commit e0013791b9326945ccd09b5b602437beb322cab8
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:47 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: fix model number and add missing features for Icelake-Server CPU model
    
    Add the missing features(sha_ni, avx512ifma, rdpid, fsrm,
    vmx-rdseed-exit, vmx-pml, vmx-eptp-switching) and change the model
    number to 106 in the Icelake-Server-v4 CPU model.
    
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-3-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3885826bc4..132ef90421 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3512,6 +3512,20 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 },
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "sha-ni", "on" },
+                    { "avx512ifma", "on" },
+                    { "rdpid", "on" },
+                    { "fsrm", "on" },
+                    { "vmx-rdseed-exit", "on" },
+                    { "vmx-pml", "on" },
+                    { "vmx-eptp-switching", "on" },
+                    { "model", "106" },
+                    { /* end of list */ }
+                },
+            },
             { /* end of list */ }
         }
     },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14862.36946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6V-0006p5-Do; Thu, 29 Oct 2020 21:05:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14862.36946; Thu, 29 Oct 2020 21:05:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6V-0006ox-AN; Thu, 29 Oct 2020 21:05:03 +0000
Received: by outflank-mailman (input) for mailman id 14862;
 Thu, 29 Oct 2020 21:05:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF6T-0006om-DZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d1a0da3b-878a-43d6-a0ba-9b2fe5c55bfa;
 Thu, 29 Oct 2020 21:05:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6S-0007MN-Bf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6S-00023D-Ao
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF6T-0006om-DZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:01 +0000
X-Inumbo-ID: d1a0da3b-878a-43d6-a0ba-9b2fe5c55bfa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d1a0da3b-878a-43d6-a0ba-9b2fe5c55bfa;
	Thu, 29 Oct 2020 21:05:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CVqVNRlf8XERxiDxowZ2ZznRx2o2EIxsFPgsYQDYEYo=; b=E3StW3Z8O3mxLx0j/R0h5uybw2
	TXH0q9x4sc6d8IZTRAuWgyTyJoaqSxh3AB8GQRnWvhEBryKiD5cJgKCrk4loHmD2mcFyisT3p0bTR
	2bKB57bgPr10p+2GoiV1hIJ9gikCJJa95MHzVHfFEdQMXD7Z4E/kPoKQp+HaX75yTx7w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6S-0007MN-Bf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6S-00023D-Ao
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
Message-Id: <E1kYF6S-00023D-Ao@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:00 +0000

commit 644e3c5d812d1d672388124eeb43d0e26b3ff58c
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:48 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
    
    Add the missing vmx features in Skylake-Server and Cascadelake-Server
    CPU models based on the output of Paolo's script.
    
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-4-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 132ef90421..588f32e136 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3034,6 +3034,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 }
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "vmx-eptp-switching", "on" },
+                    { /* end of list */ }
+                }
+            },
             { /* end of list */ }
         }
     },
@@ -3158,6 +3165,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                   { /* end of list */ }
               },
             },
+            { .version = 4,
+              .note = "ARCH_CAPABILITIES, no TSX",
+              .props = (PropValue[]) {
+                  { "vmx-eptp-switching", "on" },
+                  { /* end of list */ }
+              },
+            },
             { /* end of list */ }
         }
     },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14863.36950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6e-0006qP-GD; Thu, 29 Oct 2020 21:05:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14863.36950; Thu, 29 Oct 2020 21:05:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6e-0006qH-DK; Thu, 29 Oct 2020 21:05:12 +0000
Received: by outflank-mailman (input) for mailman id 14863;
 Thu, 29 Oct 2020 21:05:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF6d-0006q9-6j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fef6866a-df45-4d55-bb55-c8b3af8fe27c;
 Thu, 29 Oct 2020 21:05:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6c-0007Mi-FX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6c-00024f-Ek
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF6d-0006q9-6j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:11 +0000
X-Inumbo-ID: fef6866a-df45-4d55-bb55-c8b3af8fe27c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fef6866a-df45-4d55-bb55-c8b3af8fe27c;
	Thu, 29 Oct 2020 21:05:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DjWWUqcVUVeYS2svZvypPBSpDE0h8QbuEhMA9gtkIok=; b=ppMoMkNjxlmusXonCe7qjIRqH+
	faVfzqNvKA3j2jxnPylcDCWWVGMkeu18Ig5hdavxomaQwihuEQ8VhiZScxlo6lSIQtdCk08H0KPsP
	18SUDrPBE9oesl8NWqNO7RVjj4SXpIa9cnf/DpqX6VTXepzJZAX4WwavMPmKwyCUynu4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6c-0007Mi-FX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6c-00024f-Ek
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] i386: hvf: Explicitly set CR4 guest/host mask
Message-Id: <E1kYF6c-00024f-Ek@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:10 +0000

commit 818b9f111d64b40661d08f5e23236ac1ca5df505
Author:     Roman Bolshakov <r.bolshakov@yadro.com>
AuthorDate: Tue Jul 14 12:07:27 2020 +0300
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 14:15:13 2020 -0400

    i386: hvf: Explicitly set CR4 guest/host mask
    
    Removal of register reset omitted initialization of CR4 guest/host mask.
    x86_64 guests aren't booting without it.
    
    Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
    Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
    Message-Id: <20200714090726.41082-1-r.bolshakov@yadro.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/hvf/vmx.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h
index 75ba1e2a5f..587b1b8375 100644
--- a/target/i386/hvf/vmx.h
+++ b/target/i386/hvf/vmx.h
@@ -166,6 +166,7 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
 
     wvmcs(vcpu, VMCS_GUEST_CR4, guest_cr4);
     wvmcs(vcpu, VMCS_CR4_SHADOW, cr4);
+    wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE);
 
     hv_vcpu_invalidate_tlb(vcpu);
     hv_vcpu_flush(vcpu);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14864.36954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6o-0006rt-I1; Thu, 29 Oct 2020 21:05:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14864.36954; Thu, 29 Oct 2020 21:05:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6o-0006rl-F2; Thu, 29 Oct 2020 21:05:22 +0000
Received: by outflank-mailman (input) for mailman id 14864;
 Thu, 29 Oct 2020 21:05:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF6n-0006ra-Cn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fc589469-349d-47dc-b74e-ec70a2e9bd3f;
 Thu, 29 Oct 2020 21:05:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6m-0007Ms-JZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6m-00025Z-Ig
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF6n-0006ra-Cn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:21 +0000
X-Inumbo-ID: fc589469-349d-47dc-b74e-ec70a2e9bd3f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fc589469-349d-47dc-b74e-ec70a2e9bd3f;
	Thu, 29 Oct 2020 21:05:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IV/ncJuT0WIArtxxnVfUKt2xpEVgP31+5D/x3sGypbM=; b=mmbppHy9n4DjPYp1nUn8jWQUlL
	7e+9XA8xIO8RbRIeNCr6cgGQ2bgMGnebz8s16K711eGChLc4gXTmnpbR0VquNv7BhTdqusJX7Qz0P
	g7WdovYLMpcH7QP65rxIRTmAExWJt0mbiIsrGCFd2TsMr7+/2vLhj82UK8d2/z8GqemU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6m-0007Ms-JZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6m-00025Z-Ig
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Message-Id: <E1kYF6m-00025Z-Ig@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:20 +0000

commit 151f76c689b1ff4c2c59e6d8469a0d4fe5346f55
Merge: 95d1fbabae0cd44156ac4b96d512d143ca7dfd5e 818b9f111d64b40661d08f5e23236ac1ca5df505
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 21:46:18 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 21:46:18 2020 +0100

    Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
    
    x86 fixes for -rc1
    
    Fixes for x86 that missed hard freeze:
    * Don't trigger warnings for features set by
      CPU model versions (Xiaoyao Li)
    * Missing features in Icelake-Server, Skylake-Server,
      Cascadelake-Server CPU models (Chenyi Qiang)
    * Fix hvf x86_64 guest boot crash (Roman Bolshakov)
    
    # gpg: Signature made Thu 16 Jul 2020 19:17:18 BST
    # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
    # gpg:                issuer "ehabkost@redhat.com"
    # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
    # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
    
    * remotes/ehabkost/tags/x86-next-pull-request:
      i386: hvf: Explicitly set CR4 guest/host mask
      target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
      target/i386: fix model number and add missing features for Icelake-Server CPU model
      target/i386: add fast short REP MOV support
      i386/cpu: Don't add unavailable_features to env->user_features
      i368/cpu: Clear env->user_features after loading versioned CPU model
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 target/i386/cpu.c     | 38 ++++++++++++++++++++++++++++++++++++--
 target/i386/cpu.h     |  2 ++
 target/i386/hvf/vmx.h |  1 +
 3 files changed, 39 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14865.36958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6z-0006t9-Jj; Thu, 29 Oct 2020 21:05:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14865.36958; Thu, 29 Oct 2020 21:05:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF6z-0006t1-Gi; Thu, 29 Oct 2020 21:05:33 +0000
Received: by outflank-mailman (input) for mailman id 14865;
 Thu, 29 Oct 2020 21:05:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF6y-0006sr-0e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2d0a9eb6-b7e5-4a2b-9c8f-b4d09229b0f4;
 Thu, 29 Oct 2020 21:05:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6x-0007N9-1T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF6x-000274-0C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF6y-0006sr-0e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:32 +0000
X-Inumbo-ID: 2d0a9eb6-b7e5-4a2b-9c8f-b4d09229b0f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2d0a9eb6-b7e5-4a2b-9c8f-b4d09229b0f4;
	Thu, 29 Oct 2020 21:05:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U031B/EqUNOz6zJ6tbpKYulvGVMklvE1RudYaUcohNY=; b=hgIJjFYrlogOblneRnimrKaea0
	tSpxXOQIll6X5Gg8vq5P/ICQeL3yMbtjwfyzRpMA3MemVg9SxQHXf8r1eMPTxnusp9K2QWaGjCXTE
	Exx4ZeokRyShkQuTkHdi1iucfov1fVcI7Mo/Re2JVd/3cZYwbj12ZMB9ZVr8aDZTS/No=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6x-0007N9-1T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF6x-000274-0C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qtest: bios-tables-test: fix a memory leak
Message-Id: <E1kYF6x-000274-0C@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:31 +0000

commit 82e258db15dc563e1d015c19b3af2d585695a7b1
Author:     Li Qiang <liq3ea@163.com>
AuthorDate: Tue Jul 14 08:35:36 2020 -0700
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    qtest: bios-tables-test: fix a memory leak
    
    Fixes: 5da7c35e25a("bios-tables-test: Add Q35/TPM-TIS test")
    Signed-off-by: Li Qiang <liq3ea@163.com>
    Message-Id: <20200714153536.66060-1-liq3ea@163.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Reviewed-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/bios-tables-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index c315156858..d49b3988ec 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -924,6 +924,7 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
     g_free(variant);
     g_free(tmp_path);
     g_free(tmp_dir_name);
+    g_free(args);
     free_test_data(&data);
 #else
     g_test_skip("TPM disabled");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14866.36961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF79-0006uM-LJ; Thu, 29 Oct 2020 21:05:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14866.36961; Thu, 29 Oct 2020 21:05:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF79-0006uE-IR; Thu, 29 Oct 2020 21:05:43 +0000
Received: by outflank-mailman (input) for mailman id 14866;
 Thu, 29 Oct 2020 21:05:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF78-0006u4-BY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 000de9fc-7ee7-4265-8a76-ef0cf89028d7;
 Thu, 29 Oct 2020 21:05:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF77-0007NK-58
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF77-00028i-4O
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF78-0006u4-BY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:42 +0000
X-Inumbo-ID: 000de9fc-7ee7-4265-8a76-ef0cf89028d7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 000de9fc-7ee7-4265-8a76-ef0cf89028d7;
	Thu, 29 Oct 2020 21:05:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wTJVMhYUimGY78pM656swjSFdW+ST/6OAfZIWMu0HlQ=; b=b/iAbW6VVlzI1xsUQVEfL6+Xss
	3hlhqG68DzflT4E5rN0ICSefgy4mDuMZY1fzuXSu0a34RrHJV6zB2XR3V0WB/L7ESwRiJCplgBRWy
	5OfaoZfsmroTSBSqBFvEATmkiHnH/iqQrvyFBD8I+qW4vV9AW8HOLRHFHPRHkEAasUM4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF77-0007NK-58
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF77-00028i-4O
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests: qmp-cmd-test: fix memory leak
Message-Id: <E1kYF77-00028i-4O@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:41 +0000

commit 15c51f724ec61ab6a6910c41113d6d07164b6ca4
Author:     Li Qiang <liq3ea@163.com>
AuthorDate: Wed Jul 15 08:41:17 2020 -0700
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    tests: qmp-cmd-test: fix memory leak
    
    Properly free each test response to avoid memory leak and separate
    qtest_qmp() calls with spare lines, in a consistent manner.
    
    Fixes: 5b88849e7b9("tests/qmp-cmd-test: Add qmp/object-add-failure-modes")
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Signed-off-by: Li Qiang <liq3ea@163.com>
    Message-Id: <20200715154117.15456-1-liq3ea@163.com>
    Fixes: 9fc719b869 ("tests/qmp-cmd-test: Add qmp/object-add-duplicate-id")
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/qmp-cmd-test.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
index c68f99f659..f7b1aa7fdc 100644
--- a/tests/qtest/qmp-cmd-test.c
+++ b/tests/qtest/qmp-cmd-test.c
@@ -230,6 +230,8 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
@@ -241,6 +243,7 @@ static void test_object_add_failure_modes(void)
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to create an object with a property of a wrong type */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -249,17 +252,20 @@ static void test_object_add_failure_modes(void)
     g_assert_nonnull(resp);
     /* now do it right */
     qmp_assert_error_class(resp, "GenericError");
+
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to create an object without the id */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -267,18 +273,21 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     qmp_assert_error_class(resp, "GenericError");
+
     /* now do it right */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to set a non existing property */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -286,23 +295,27 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'sized': 1048576 } } }");
     g_assert_nonnull(resp);
     qmp_assert_error_class(resp, "GenericError");
+
     /* now do it right */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object without id */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'ida': 'ram1' } }");
     g_assert_nonnull(resp);
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object that does not exist anymore*/
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:05:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:05:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14867.36966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7J-0006vd-N1; Thu, 29 Oct 2020 21:05:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14867.36966; Thu, 29 Oct 2020 21:05:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7J-0006vU-Jw; Thu, 29 Oct 2020 21:05:53 +0000
Received: by outflank-mailman (input) for mailman id 14867;
 Thu, 29 Oct 2020 21:05:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF7I-0006vL-6s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d77cb37f-39fe-4321-8288-b2cce159c8bc;
 Thu, 29 Oct 2020 21:05:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7H-0007NQ-8g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7H-00029l-7w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF7I-0006vL-6s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:52 +0000
X-Inumbo-ID: d77cb37f-39fe-4321-8288-b2cce159c8bc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d77cb37f-39fe-4321-8288-b2cce159c8bc;
	Thu, 29 Oct 2020 21:05:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t3GtCM2Au8Y2m31/lMOKx48j++GVaEOfqzmJQMkDzT8=; b=3kdTxTm9Dd5X0Mvd8IGZej+thS
	Uyxi/3VLSDM15SNEV6NHRZGiv2g1wCvp5a7rceWF93+o3YMZuAM40YGiFG8CI7fDzy8wYitgkQqXO
	h7xKU1MpiIUTzr4x7omXfUETc9YkGGSFXwIl9XvjnlNY2/PsL5XbKgCh9EPHMS65jVrE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7H-0007NQ-8g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7H-00029l-7w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:05:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fuzz: Expect the cmdline in a freeable GString
Message-Id: <E1kYF7H-00029l-7w@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:05:51 +0000

commit f5ec79f5e0a3a307fc2a11b3ba8066a2d0a90233
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Tue Jul 14 13:46:16 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    fuzz: Expect the cmdline in a freeable GString
    
    In the initial FuzzTarget, get_init_cmdline returned a char *. With this
    API, we had no guarantee about where the string came from. For example,
    i440fx-qtest-reboot-fuzz simply returned a pointer to a string literal,
    while the QOS-based targets build the arguments out in a GString an
    return the gchar *str pointer. Since we did not try to free the cmdline,
    we have a leak for any targets that do not simply return string
    literals. Clean up this mess by forcing fuzz-targets to return
    a GString, that we can free.
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200714174616.20709-1-alxndr@bu.edu>
    Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c        | 13 ++++++-------
 tests/qtest/fuzz/fuzz.h        |  6 +++---
 tests/qtest/fuzz/i440fx_fuzz.c |  4 ++--
 tests/qtest/fuzz/qos_fuzz.c    |  6 +++---
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 0b66e43409..6bc17ef313 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -199,16 +199,15 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
     }
 
     /* Run QEMU's softmmu main with the fuzz-target dependent arguments */
-    const char *init_cmdline = fuzz_target->get_init_cmdline(fuzz_target);
-    init_cmdline = g_strdup_printf("%s -qtest /dev/null -qtest-log %s",
-                                   init_cmdline,
-                                   getenv("QTEST_LOG") ? "/dev/fd/2"
-                                                       : "/dev/null");
-
+    GString *cmd_line = fuzz_target->get_init_cmdline(fuzz_target);
+    g_string_append_printf(cmd_line,
+                           " -qtest /dev/null -qtest-log %s",
+                           getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null");
 
     /* Split the runcmd into an argv and argc */
     wordexp_t result;
-    wordexp(init_cmdline, &result, 0);
+    wordexp(cmd_line->str, &result, 0);
+    g_string_free(cmd_line, true);
 
     qemu_init(result.we_wordc, result.we_wordv, NULL);
 
diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index 72d5710f6c..9ca3d107c5 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -50,10 +50,10 @@ typedef struct FuzzTarget {
 
 
     /*
-     * returns the arg-list that is passed to qemu/softmmu init()
-     * Cannot be NULL
+     * Returns the arguments that are passed to qemu/softmmu init(). Freed by
+     * the caller.
      */
-    const char* (*get_init_cmdline)(struct FuzzTarget *);
+    GString *(*get_init_cmdline)(struct FuzzTarget *);
 
     /*
      * will run once, prior to running qemu/softmmu init.
diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c
index e2f31e56f9..bf966d478b 100644
--- a/tests/qtest/fuzz/i440fx_fuzz.c
+++ b/tests/qtest/fuzz/i440fx_fuzz.c
@@ -158,9 +158,9 @@ static void i440fx_fuzz_qos_fork(QTestState *s,
 
 static const char *i440fx_qtest_argv = TARGET_NAME " -machine accel=qtest"
                                        " -m 0 -display none";
-static const char *i440fx_argv(FuzzTarget *t)
+static GString *i440fx_argv(FuzzTarget *t)
 {
-    return i440fx_qtest_argv;
+    return g_string_new(i440fx_qtest_argv);
 }
 
 static void fork_init(void)
diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c
index 0c68f5361f..d52f3ebd83 100644
--- a/tests/qtest/fuzz/qos_fuzz.c
+++ b/tests/qtest/fuzz/qos_fuzz.c
@@ -66,7 +66,7 @@ void *qos_allocate_objects(QTestState *qts, QGuestAllocator **p_alloc)
     return allocate_objects(qts, current_path + 1, p_alloc);
 }
 
-static const char *qos_build_main_args(void)
+static GString *qos_build_main_args(void)
 {
     char **path = fuzz_path_vec;
     QOSGraphNode *test_node;
@@ -88,7 +88,7 @@ static const char *qos_build_main_args(void)
     /* Prepend the arguments that we need */
     g_string_prepend(cmd_line,
             TARGET_NAME " -display none -machine accel=qtest -m 64 ");
-    return cmd_line->str;
+    return cmd_line;
 }
 
 /*
@@ -189,7 +189,7 @@ static void walk_path(QOSGraphNode *orig_path, int len)
     g_free(path_str);
 }
 
-static const char *qos_get_cmdline(FuzzTarget *t)
+static GString *qos_get_cmdline(FuzzTarget *t)
 {
     /*
      * Set a global variable that we use to identify the qos_path for our
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14868.36970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7T-0006xV-Om; Thu, 29 Oct 2020 21:06:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14868.36970; Thu, 29 Oct 2020 21:06:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7T-0006xO-LX; Thu, 29 Oct 2020 21:06:03 +0000
Received: by outflank-mailman (input) for mailman id 14868;
 Thu, 29 Oct 2020 21:06:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF7S-0006xB-8N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8cf546c3-cfa3-4362-918f-ee869a7699a2;
 Thu, 29 Oct 2020 21:06:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7R-0007OB-Ca
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7R-0002Ac-Bk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF7S-0006xB-8N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:02 +0000
X-Inumbo-ID: 8cf546c3-cfa3-4362-918f-ee869a7699a2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8cf546c3-cfa3-4362-918f-ee869a7699a2;
	Thu, 29 Oct 2020 21:06:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DsS0dj2HA/xq7S1CiOK6K8iyw1//cr4PrFVC/z7UlkM=; b=HEu0lhA+DvdE8PWQojrkkkKaU8
	SEszteW/TKgDi9xmUyoWsyv5F2EN3PgF55hFBcE48qvgXnGxJSmPMtwOawLlUp0N5Y7xkH/fAa1fD
	o53DJIrojou3d6CWM+TUf7ex0gCFeFytPO7Ml7O9P6FuROslMgAYLhd6Qk7MTHibLKq0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7R-0007OB-Ca
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7R-0002Ac-Bk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] configure: Fix for running with --enable-werror on macOS
Message-Id: <E1kYF7R-0002Ac-Bk@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:01 +0000

commit 12a9b8d8240aaddf14774b9fb03af5e2e0b9f60a
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 16 07:12:22 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    configure: Fix for running with --enable-werror on macOS
    
    The configure script currently refuses to succeed when run on macOS
    with --enable-werror:
    
     ERROR: configure test passed without -Werror but failed with -Werror.
    
    The information in config.log indicates:
    
     config-temp/qemu-conf.c:3:55: error: control reaches end of non-void
     function [-Werror,-Wreturn-type]
     static void *f(void *p) { pthread_setname_np("QEMU"); }
                                                          ^
    And indeed, the return statement is missing here.
    
    Fixes: 479a57475e ("util: Implement debug-threads for macOS")
    Message-Id: <20200716055655.24507-1-thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b751c853f5..e93836aaae 100755
--- a/configure
+++ b/configure
@@ -4198,7 +4198,7 @@ pthread_setname_np_wo_tid=no
 cat > $TMPC << EOF
 #include <pthread.h>
 
-static void *f(void *p) { pthread_setname_np("QEMU"); }
+static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; }
 int main(void)
 {
     pthread_t thread;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14869.36973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7d-0006yp-QV; Thu, 29 Oct 2020 21:06:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14869.36973; Thu, 29 Oct 2020 21:06:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7d-0006yh-NI; Thu, 29 Oct 2020 21:06:13 +0000
Received: by outflank-mailman (input) for mailman id 14869;
 Thu, 29 Oct 2020 21:06:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF7c-0006yX-BQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27fe2822-f127-492c-961e-dc1c680f1893;
 Thu, 29 Oct 2020 21:06:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7b-0007OL-HD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7b-0002BO-FX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF7c-0006yX-BQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:12 +0000
X-Inumbo-ID: 27fe2822-f127-492c-961e-dc1c680f1893
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27fe2822-f127-492c-961e-dc1c680f1893;
	Thu, 29 Oct 2020 21:06:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YWimwdYTJ5pv4feIQAdIHNNayTkyUJHBwOYT2uOduvQ=; b=UqGAtVr3rTcSatIFEsy59ccGsA
	A8iM2dH/9NVev7Ld3I7KKmcPLm6AvV9inQtzMzNsGxAOUAMBabKkiJdLnAgamyIqq/S+KqGZaPEBy
	irbekVW9vlLqX4CFnhuSy0J+EHDfbnW0pJyv4VI+eF/fgBwYOs8ZRpcE4zFKvu+EcCV4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7b-0007OL-HD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7b-0002BO-FX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qom: Plug memory leak in "info qom-tree"
Message-Id: <E1kYF7b-0002BO-FX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:11 +0000

commit ab2d185d6b1d3aa1ab2416a896347d235e32ac3d
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:59 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    qom: Plug memory leak in "info qom-tree"
    
    Commit e8c9e65816 "qom: Make "info qom-tree" show children sorted"
    created a memory leak, because I didn't realize
    object_get_canonical_path_component()'s value needs to be freed.
    
    Reproducer:
    
        $ qemu-system-x86_64 -nodefaults -display none -S -monitor stdio
        QEMU 5.0.50 monitor - type 'help' for more information
        (qemu) info qom-tree
    
    This leaks some 4500 path components, 12-13 characters on average,
    i.e. roughly 100kBytes depending on the allocator.  A couple of
    hundred "info qom-tree" here, a couple of hundred there, and soon
    enough we're talking about real memory.
    
    Plug the leak.
    
    Fixes: e8c9e65816f5dbfe18ad3b2be938d0d8192d459a
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reported-by: Reviewed-by: Li Qiang <liq3ea@gmail.com> [sent same patch]
    Message-Id: <20200714160202.3121879-3-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qom/qom-hmp-cmds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index 9ed8bb1c9f..aaacadacca 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -96,8 +96,10 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
 static int qom_composition_compare(const void *a, const void *b, void *ignore)
 {
-    return g_strcmp0(a ? object_get_canonical_path_component(a) : NULL,
-                     b ? object_get_canonical_path_component(b) : NULL);
+    g_autofree char *ac = object_get_canonical_path_component(a);
+    g_autofree char *bc = object_get_canonical_path_component(b);
+
+    return g_strcmp0(ac, bc);
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14870.36977 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7n-00070E-UG; Thu, 29 Oct 2020 21:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14870.36977; Thu, 29 Oct 2020 21:06:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7n-000708-RM; Thu, 29 Oct 2020 21:06:23 +0000
Received: by outflank-mailman (input) for mailman id 14870;
 Thu, 29 Oct 2020 21:06:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF7m-0006zv-Kg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c52a387e-bc84-45f5-ac6e-c6050ab326e8;
 Thu, 29 Oct 2020 21:06:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7l-0007OW-Le
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7l-0002CJ-K0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF7m-0006zv-Kg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:22 +0000
X-Inumbo-ID: c52a387e-bc84-45f5-ac6e-c6050ab326e8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c52a387e-bc84-45f5-ac6e-c6050ab326e8;
	Thu, 29 Oct 2020 21:06:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C2vjeEw9SIlEowrg3TCuo00aiLxxWT29NzLPr1OzFbY=; b=MAkbkHFRb7RP/vQzxfs0rpZVX8
	BAnFkCvYG8dm+FO43+aQj5i0vKMEPOZdEtuYlgd+I+X7U2DNIkJONk2V//CrixczEx8K+dN8MOSwU
	1OpFDrtJGyAs0cWh5ht7Q8GMkIqG7dtQfV4U44ByPYKV+Pqhqgsuwq8u5ZQ8nEZ/WJNY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7l-0007OW-Le
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7l-0002CJ-K0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] gitlab-ci.yml: Add fuzzer tests
Message-Id: <E1kYF7l-0002CJ-K0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:21 +0000

commit b610eba335d5c8ac7484dbb1c886b125e2dea058
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 15 06:32:48 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    gitlab-ci.yml: Add fuzzer tests
    
    So far we neither compile-tested nor run any of the new fuzzers in our CI,
    which led to some build failures of the fuzzer code in the past weeks.
    To avoid this problem, add a job to compile the fuzzer code and run some
    loops (which likely don't find any new bugs via fuzzing, but at least we
    know that the code can still be run).
    
    A nice side-effect of this test is that the leak tests are enabled here,
    so we should now notice some of the memory leaks in our code base earlier.
    
    Message-Id: <20200716100950.27396-1-thuth@redhat.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5eeba2791b..41597c3603 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -161,9 +161,27 @@ build-clang:
     IMAGE: fedora
     CONFIGURE_ARGS: --cc=clang --cxx=clang++
     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
-      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user
+      ppc-softmmu s390x-softmmu arm-linux-user
     MAKE_CHECK_ARGS: check
 
+build-fuzzer:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+  script:
+    - mkdir build
+    - cd build
+    - ../configure --cc=clang --cxx=clang++ --enable-fuzzing
+                   --enable-sanitizers --target-list=x86_64-softmmu
+    - make -j"$JOBS" all check-build x86_64-softmmu/fuzz
+    - make check
+    - for fuzzer in i440fx-qos-fork-fuzz i440fx-qos-noreset-fuzz
+        i440fx-qtest-reboot-fuzz virtio-scsi-flags-fuzz virtio-scsi-fuzz ; do
+          echo Testing ${fuzzer} ... ;
+          x86_64-softmmu/qemu-fuzz-x86_64 --fuzz-target=${fuzzer} -runs=1000
+            || exit 1 ;
+      done
+
 build-tci:
   <<: *native_build_job_definition
   variables:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14871.36982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7w-00071X-Vq; Thu, 29 Oct 2020 21:06:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14871.36982; Thu, 29 Oct 2020 21:06:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF7w-00071P-Sw; Thu, 29 Oct 2020 21:06:32 +0000
Received: by outflank-mailman (input) for mailman id 14871;
 Thu, 29 Oct 2020 21:06:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF7w-00071K-H3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 01c64f5c-1b40-4f21-bcef-368d69e033d9;
 Thu, 29 Oct 2020 21:06:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7v-0007Od-PX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF7v-0002Dh-Oi
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF7w-00071K-H3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:32 +0000
X-Inumbo-ID: 01c64f5c-1b40-4f21-bcef-368d69e033d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 01c64f5c-1b40-4f21-bcef-368d69e033d9;
	Thu, 29 Oct 2020 21:06:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BUBEzdzk8W0UT4W1vVub8u72v/cpwdHLOP8MFOz8Ay4=; b=46jgGpzWots0uasDdh8BnrFC/0
	5vaQfHez+gQK5AfOu05uPR0FBcm/k7YRj3Pc+a/zZl4kU5YyEhrV4T/1jYzRcqmjmPrabTuPLU5RV
	8QLc0jvnf6nLPyDrYbL9ZeHnDVj1yodsmY0P7QEP7koIEfQP5POIvpDRaNe1G0hVyNNU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7v-0007Od-PX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF7v-0002Dh-Oi
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-17' into staging
Message-Id: <E1kYF7v-0002Dh-Oi@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:31 +0000

commit b7bda69c4ef46c57480f6e378923f5215b122778
Merge: 151f76c689b1ff4c2c59e6d8469a0d4fe5346f55 b610eba335d5c8ac7484dbb1c886b125e2dea058
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 12:06:02 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 17 12:06:02 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-17' into staging
    
    * Leak fixes
    * One fix for running with --enable-werror on macOS
    * Add fuzzer test to the Gitlab-CI
    
    # gpg: Signature made Fri 17 Jul 2020 10:53:07 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-17:
      gitlab-ci.yml: Add fuzzer tests
      qom: Plug memory leak in "info qom-tree"
      configure: Fix for running with --enable-werror on macOS
      fuzz: Expect the cmdline in a freeable GString
      tests: qmp-cmd-test: fix memory leak
      qtest: bios-tables-test: fix a memory leak
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml                 | 20 +++++++++++++++++++-
 configure                      |  2 +-
 qom/qom-hmp-cmds.c             |  6 ++++--
 tests/qtest/bios-tables-test.c |  1 +
 tests/qtest/fuzz/fuzz.c        | 13 ++++++-------
 tests/qtest/fuzz/fuzz.h        |  6 +++---
 tests/qtest/fuzz/i440fx_fuzz.c |  4 ++--
 tests/qtest/fuzz/qos_fuzz.c    |  6 +++---
 tests/qtest/qmp-cmd-test.c     | 13 +++++++++++++
 9 files changed, 52 insertions(+), 19 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14872.36986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF88-00072s-1U; Thu, 29 Oct 2020 21:06:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14872.36986; Thu, 29 Oct 2020 21:06:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF87-00072l-Ua; Thu, 29 Oct 2020 21:06:43 +0000
Received: by outflank-mailman (input) for mailman id 14872;
 Thu, 29 Oct 2020 21:06:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF87-00072e-35
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4863653a-eb45-46fa-8deb-a18cb31243aa;
 Thu, 29 Oct 2020 21:06:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF86-0007On-Bt
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF86-0002GZ-Ab
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF87-00072e-35
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:43 +0000
X-Inumbo-ID: 4863653a-eb45-46fa-8deb-a18cb31243aa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4863653a-eb45-46fa-8deb-a18cb31243aa;
	Thu, 29 Oct 2020 21:06:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Oxxz39Zp6cnMmWvGEMfTQENAVAdEuLsTzuDfCAmo+sE=; b=p7cYou6JQyE2hElGYhScWDKk/S
	fP4SnV+6obYogOiTB+c05YARo5ywnXkpvL6L5FEXvoe+TtV5W7BAy51i1pSsugfzz45pFgg2nzw3H
	Zfib05CHLzAfvxdFnkFu8oyYd2/YCQNcLyU/LvWDgqvALBiOFSFwsqSlNZQYbcszZAb0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF86-0007On-Bt
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF86-0002GZ-Ab
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] vvfat: set status to odd fixes
Message-Id: <E1kYF86-0002GZ-Ab@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:42 +0000

commit 4b7c5bc447070bd1573bc8ae7294f3a64525c20b
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Sat Jul 11 00:34:51 2020 +0530
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    vvfat: set status to odd fixes
    
    Virtual VFAT driver is quite old and rarely used. Set its status
    to Odd Fixes.
    
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Message-Id: <20200710190451.761286-1-ppandit@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 030faf0249..5d9c56e441 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2987,7 +2987,7 @@ F: block/vpc.c
 vvfat
 M: Kevin Wolf <kwolf@redhat.com>
 L: qemu-block@nongnu.org
-S: Supported
+S: Odd Fixes
 F: block/vvfat.c
 
 Image format fuzzer
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:06:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:06:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14873.36990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8K-00074B-3S; Thu, 29 Oct 2020 21:06:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14873.36990; Thu, 29 Oct 2020 21:06:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8K-000741-05; Thu, 29 Oct 2020 21:06:56 +0000
Received: by outflank-mailman (input) for mailman id 14873;
 Thu, 29 Oct 2020 21:06:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF8J-00073u-24
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 299f9588-f859-4169-a3fb-6174b9efe228;
 Thu, 29 Oct 2020 21:06:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8G-0007Ov-Ge
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8G-0002Hb-Fl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF8J-00073u-24
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:55 +0000
X-Inumbo-ID: 299f9588-f859-4169-a3fb-6174b9efe228
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 299f9588-f859-4169-a3fb-6174b9efe228;
	Thu, 29 Oct 2020 21:06:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DWiXXM30kOfGJ/OXmdjQ8vIehdjW7TTVK4dGf8ZveEQ=; b=L9/4/FNgkUB0wh+1wOKgNd3lsw
	nob9zIy230fJ2ZYBNI3SCVNqBb19G0vkL77BwQP2Abex08qxLspCAp+l1lirzyRNO1/N1NZ4mgRDu
	Bqod8i0NKYW5WzPUa55NbOxZxUFjyeCxPZ9giE2xKn7mY6G4wRE4+151QJ5jZqa152R4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8G-0007Ov-Ge
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8G-0002Hb-Fl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:06:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Remove VXHS block device
Message-Id: <E1kYF8G-0002Hb-Fl@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:06:52 +0000

commit a08464521ccb302a24c7785f50ce32473904136c
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sat Jul 11 10:59:26 2020 +0400
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    Remove VXHS block device
    
    The vxhs code doesn't compile since v2.12.0. There's no point in fixing
    and then adding CI for a config that our users have demonstrated that
    they do not use; better to just remove it.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200711065926.2204721-1-marcandre.lureau@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/Makefile.objs              |   2 -
 block/trace-events               |  17 --
 block/vxhs.c                     | 587 ---------------------------------------
 configure                        |  39 ---
 docs/system/deprecated.rst       |   8 +
 qapi/block-core.json             |  22 +-
 tests/qemu-iotests/017           |   1 -
 tests/qemu-iotests/029           |   1 -
 tests/qemu-iotests/073           |   1 -
 tests/qemu-iotests/114           |   1 -
 tests/qemu-iotests/130           |   1 -
 tests/qemu-iotests/134           |   1 -
 tests/qemu-iotests/156           |   1 -
 tests/qemu-iotests/158           |   1 -
 tests/qemu-iotests/282           |   1 -
 tests/qemu-iotests/check         |  10 -
 tests/qemu-iotests/common.filter |   1 -
 tests/qemu-iotests/common.rc     |  33 ---
 18 files changed, 10 insertions(+), 718 deletions(-)

diff --git a/block/Makefile.objs b/block/Makefile.objs
index 577e578bc2..19c6f371c9 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -31,7 +31,6 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
 block-obj-$(CONFIG_CURL) += curl.o
 block-obj-$(CONFIG_RBD) += rbd.o
 block-obj-$(CONFIG_GLUSTERFS) += gluster.o
-block-obj-$(CONFIG_VXHS) += vxhs.o
 block-obj-$(CONFIG_LIBSSH) += ssh.o
 block-obj-y += accounting.o dirty-bitmap.o
 block-obj-y += write-threshold.o
@@ -61,7 +60,6 @@ rbd.o-cflags       := $(RBD_CFLAGS)
 rbd.o-libs         := $(RBD_LIBS)
 gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
 gluster.o-libs     := $(GLUSTERFS_LIBS)
-vxhs.o-libs        := $(VXHS_LIBS)
 ssh.o-cflags       := $(LIBSSH_CFLAGS)
 ssh.o-libs         := $(LIBSSH_LIBS)
 block-obj-dmg-bz2-$(CONFIG_BZIP2) += dmg-bz2.o
diff --git a/block/trace-events b/block/trace-events
index dbe76a7613..d3533ca896 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -136,23 +136,6 @@ qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t o
 qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
 qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
 
-# vxhs.c
-vxhs_iio_callback(int error) "ctx is NULL: error %d"
-vxhs_iio_callback_chnfail(int err, int error) "QNIO channel failed, no i/o %d, %d"
-vxhs_iio_callback_unknwn(int opcode, int err) "unexpected opcode %d, errno %d"
-vxhs_aio_rw_invalid(int req) "Invalid I/O request iodir %d"
-vxhs_aio_rw_ioerr(char *guid, int iodir, uint64_t size, uint64_t off, void *acb, int ret, int err) "IO ERROR (vDisk %s) FOR : Read/Write = %d size = %"PRIu64" offset = %"PRIu64" ACB = %p. Error = %d, errno = %d"
-vxhs_get_vdisk_stat_err(char *guid, int ret, int err) "vDisk (%s) stat ioctl failed, ret = %d, errno = %d"
-vxhs_get_vdisk_stat(char *vdisk_guid, uint64_t vdisk_size) "vDisk %s stat ioctl returned size %"PRIu64
-vxhs_complete_aio(void *acb, uint64_t ret) "aio failed acb %p ret %"PRIu64
-vxhs_parse_uri_filename(const char *filename) "URI passed via bdrv_parse_filename %s"
-vxhs_open_vdiskid(const char *vdisk_id) "Opening vdisk-id %s"
-vxhs_open_hostinfo(char *of_vsa_addr, int port) "Adding host %s:%d to BDRVVXHSState"
-vxhs_open_iio_open(const char *host) "Failed to connect to storage agent on host %s"
-vxhs_parse_uri_hostinfo(char *host, int port) "Host: IP %s, Port %d"
-vxhs_close(char *vdisk_guid) "Closing vdisk %s"
-vxhs_get_creds(const char *cacert, const char *client_key, const char *client_cert) "cacert %s, client_key %s, client_cert %s"
-
 # nvme.c
 nvme_kick(void *s, int queue) "s %p queue %d"
 nvme_dma_flush_queue_wait(void *s) "s %p"
diff --git a/block/vxhs.c b/block/vxhs.c
deleted file mode 100644
index dc0e254730..0000000000
--- a/block/vxhs.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- * QEMU Block driver for Veritas HyperScale (VxHS)
- *
- * Copyright (c) 2017 Veritas Technologies LLC.
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include <qnio/qnio_api.h>
-#include <sys/param.h>
-#include "block/block_int.h"
-#include "block/qdict.h"
-#include "qapi/qmp/qerror.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qstring.h"
-#include "trace.h"
-#include "qemu/module.h"
-#include "qemu/uri.h"
-#include "qapi/error.h"
-#include "qemu/uuid.h"
-#include "crypto/tlscredsx509.h"
-#include "sysemu/replay.h"
-
-#define VXHS_OPT_FILENAME           "filename"
-#define VXHS_OPT_VDISK_ID           "vdisk-id"
-#define VXHS_OPT_SERVER             "server"
-#define VXHS_OPT_HOST               "host"
-#define VXHS_OPT_PORT               "port"
-
-/* Only accessed under QEMU global mutex */
-static uint32_t vxhs_ref;
-
-typedef enum {
-    VDISK_AIO_READ,
-    VDISK_AIO_WRITE,
-} VDISKAIOCmd;
-
-/*
- * HyperScale AIO callbacks structure
- */
-typedef struct VXHSAIOCB {
-    BlockAIOCB common;
-    int err;
-} VXHSAIOCB;
-
-typedef struct VXHSvDiskHostsInfo {
-    void *dev_handle; /* Device handle */
-    char *host; /* Host name or IP */
-    int port; /* Host's port number */
-} VXHSvDiskHostsInfo;
-
-/*
- * Structure per vDisk maintained for state
- */
-typedef struct BDRVVXHSState {
-    VXHSvDiskHostsInfo vdisk_hostinfo; /* Per host info */
-    char *vdisk_guid;
-    char *tlscredsid; /* tlscredsid */
-} BDRVVXHSState;
-
-static void vxhs_complete_aio_bh(void *opaque)
-{
-    VXHSAIOCB *acb = opaque;
-    BlockCompletionFunc *cb = acb->common.cb;
-    void *cb_opaque = acb->common.opaque;
-    int ret = 0;
-
-    if (acb->err != 0) {
-        trace_vxhs_complete_aio(acb, acb->err);
-        ret = (-EIO);
-    }
-
-    qemu_aio_unref(acb);
-    cb(cb_opaque, ret);
-}
-
-/*
- * Called from a libqnio thread
- */
-static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error)
-{
-    VXHSAIOCB *acb = NULL;
-
-    switch (opcode) {
-    case IRP_READ_REQUEST:
-    case IRP_WRITE_REQUEST:
-
-        /*
-         * ctx is VXHSAIOCB*
-         * ctx is NULL if error is QNIOERROR_CHANNEL_HUP
-         */
-        if (ctx) {
-            acb = ctx;
-        } else {
-            trace_vxhs_iio_callback(error);
-            goto out;
-        }
-
-        if (error) {
-            if (!acb->err) {
-                acb->err = error;
-            }
-            trace_vxhs_iio_callback(error);
-        }
-
-        replay_bh_schedule_oneshot_event(bdrv_get_aio_context(acb->common.bs),
-                                         vxhs_complete_aio_bh, acb);
-        break;
-
-    default:
-        if (error == QNIOERROR_HUP) {
-            /*
-             * Channel failed, spontaneous notification,
-             * not in response to I/O
-             */
-            trace_vxhs_iio_callback_chnfail(error, errno);
-        } else {
-            trace_vxhs_iio_callback_unknwn(opcode, error);
-        }
-        break;
-    }
-out:
-    return;
-}
-
-static QemuOptsList runtime_opts = {
-    .name = "vxhs",
-    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
-    .desc = {
-        {
-            .name = VXHS_OPT_FILENAME,
-            .type = QEMU_OPT_STRING,
-            .help = "URI to the Veritas HyperScale image",
-        },
-        {
-            .name = VXHS_OPT_VDISK_ID,
-            .type = QEMU_OPT_STRING,
-            .help = "UUID of the VxHS vdisk",
-        },
-        {
-            .name = "tls-creds",
-            .type = QEMU_OPT_STRING,
-            .help = "ID of the TLS/SSL credentials to use",
-        },
-        { /* end of list */ }
-    },
-};
-
-static QemuOptsList runtime_tcp_opts = {
-    .name = "vxhs_tcp",
-    .head = QTAILQ_HEAD_INITIALIZER(runtime_tcp_opts.head),
-    .desc = {
-        {
-            .name = VXHS_OPT_HOST,
-            .type = QEMU_OPT_STRING,
-            .help = "host address (ipv4 addresses)",
-        },
-        {
-            .name = VXHS_OPT_PORT,
-            .type = QEMU_OPT_NUMBER,
-            .help = "port number on which VxHSD is listening (default 9999)",
-            .def_value_str = "9999"
-        },
-        { /* end of list */ }
-    },
-};
-
-/*
- * Parse incoming URI and populate *options with the host
- * and device information
- */
-static int vxhs_parse_uri(const char *filename, QDict *options)
-{
-    URI *uri = NULL;
-    char *port;
-    int ret = 0;
-
-    trace_vxhs_parse_uri_filename(filename);
-    uri = uri_parse(filename);
-    if (!uri || !uri->server || !uri->path) {
-        uri_free(uri);
-        return -EINVAL;
-    }
-
-    qdict_put_str(options, VXHS_OPT_SERVER ".host", uri->server);
-
-    if (uri->port) {
-        port = g_strdup_printf("%d", uri->port);
-        qdict_put_str(options, VXHS_OPT_SERVER ".port", port);
-        g_free(port);
-    }
-
-    qdict_put_str(options, "vdisk-id", uri->path);
-
-    trace_vxhs_parse_uri_hostinfo(uri->server, uri->port);
-    uri_free(uri);
-
-    return ret;
-}
-
-static void vxhs_parse_filename(const char *filename, QDict *options,
-                                Error **errp)
-{
-    if (qdict_haskey(options, "vdisk-id") || qdict_haskey(options, "server")) {
-        error_setg(errp, "vdisk-id/server and a file name may not be specified "
-                         "at the same time");
-        return;
-    }
-
-    if (strstr(filename, "://")) {
-        int ret = vxhs_parse_uri(filename, options);
-        if (ret < 0) {
-            error_setg(errp, "Invalid URI. URI should be of the form "
-                       "  vxhs://<host_ip>:<port>/<vdisk-id>");
-        }
-    }
-}
-
-static void vxhs_refresh_limits(BlockDriverState *bs, Error **errp)
-{
-    /* XXX Does VXHS support AIO on less than 512-byte alignment? */
-    bs->bl.request_alignment = 512;
-}
-
-static int vxhs_init_and_ref(void)
-{
-    if (vxhs_ref++ == 0) {
-        if (iio_init(QNIO_VERSION, vxhs_iio_callback)) {
-            return -ENODEV;
-        }
-    }
-    return 0;
-}
-
-static void vxhs_unref(void)
-{
-    if (--vxhs_ref == 0) {
-        iio_fini();
-    }
-}
-
-static void vxhs_get_tls_creds(const char *id, char **cacert,
-                               char **key, char **cert, Error **errp)
-{
-    Object *obj;
-    QCryptoTLSCreds *creds;
-    QCryptoTLSCredsX509 *creds_x509;
-
-    obj = object_resolve_path_component(
-        object_get_objects_root(), id);
-
-    if (!obj) {
-        error_setg(errp, "No TLS credentials with id '%s'",
-                   id);
-        return;
-    }
-
-    creds_x509 = (QCryptoTLSCredsX509 *)
-        object_dynamic_cast(obj, TYPE_QCRYPTO_TLS_CREDS_X509);
-
-    if (!creds_x509) {
-        error_setg(errp, "Object with id '%s' is not TLS credentials",
-                   id);
-        return;
-    }
-
-    creds = &creds_x509->parent_obj;
-
-    if (creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) {
-        error_setg(errp,
-                   "Expecting TLS credentials with a client endpoint");
-        return;
-    }
-
-    /*
-     * Get the cacert, client_cert and client_key file names.
-     */
-    if (!creds->dir) {
-        error_setg(errp, "TLS object missing 'dir' property value");
-        return;
-    }
-
-    *cacert = g_strdup_printf("%s/%s", creds->dir,
-                              QCRYPTO_TLS_CREDS_X509_CA_CERT);
-    *cert = g_strdup_printf("%s/%s", creds->dir,
-                            QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);
-    *key = g_strdup_printf("%s/%s", creds->dir,
-                           QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);
-}
-
-static int vxhs_open(BlockDriverState *bs, QDict *options,
-                     int bdrv_flags, Error **errp)
-{
-    BDRVVXHSState *s = bs->opaque;
-    void *dev_handlep;
-    QDict *backing_options = NULL;
-    QemuOpts *opts = NULL;
-    QemuOpts *tcp_opts = NULL;
-    char *of_vsa_addr = NULL;
-    Error *local_err = NULL;
-    const char *vdisk_id_opt;
-    const char *server_host_opt;
-    int ret = 0;
-    char *cacert = NULL;
-    char *client_key = NULL;
-    char *client_cert = NULL;
-
-    ret = vxhs_init_and_ref();
-    if (ret < 0) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* Create opts info from runtime_opts and runtime_tcp_opts list */
-    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
-
-    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* vdisk-id is the disk UUID */
-    vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID);
-    if (!vdisk_id_opt) {
-        error_setg(errp, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* vdisk-id may contain a leading '/' */
-    if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) {
-        error_setg(errp, "vdisk-id cannot be more than %d characters",
-                   UUID_FMT_LEN);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    s->vdisk_guid = g_strdup(vdisk_id_opt);
-    trace_vxhs_open_vdiskid(vdisk_id_opt);
-
-    /* get the 'server.' arguments */
-    qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
-
-    if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST);
-    if (!server_host_opt) {
-        error_setg(errp, QERR_MISSING_PARAMETER,
-                   VXHS_OPT_SERVER"."VXHS_OPT_HOST);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    if (strlen(server_host_opt) > MAXHOSTNAMELEN) {
-        error_setg(errp, "server.host cannot be more than %d characters",
-                   MAXHOSTNAMELEN);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* check if we got tls-creds via the --object argument */
-    s->tlscredsid = g_strdup(qemu_opt_get(opts, "tls-creds"));
-    if (s->tlscredsid) {
-        vxhs_get_tls_creds(s->tlscredsid, &cacert, &client_key,
-                           &client_cert, &local_err);
-        if (local_err != NULL) {
-            ret = -EINVAL;
-            goto out;
-        }
-        trace_vxhs_get_creds(cacert, client_key, client_cert);
-    }
-
-    s->vdisk_hostinfo.host = g_strdup(server_host_opt);
-    s->vdisk_hostinfo.port = g_ascii_strtoll(qemu_opt_get(tcp_opts,
-                                                          VXHS_OPT_PORT),
-                                                          NULL, 0);
-
-    trace_vxhs_open_hostinfo(s->vdisk_hostinfo.host,
-                             s->vdisk_hostinfo.port);
-
-    of_vsa_addr = g_strdup_printf("of://%s:%d",
-                                  s->vdisk_hostinfo.host,
-                                  s->vdisk_hostinfo.port);
-
-    /*
-     * Open qnio channel to storage agent if not opened before
-     */
-    dev_handlep = iio_open(of_vsa_addr, s->vdisk_guid, 0,
-                           cacert, client_key, client_cert);
-    if (dev_handlep == NULL) {
-        trace_vxhs_open_iio_open(of_vsa_addr);
-        ret = -ENODEV;
-        goto out;
-    }
-    s->vdisk_hostinfo.dev_handle = dev_handlep;
-
-out:
-    g_free(of_vsa_addr);
-    qobject_unref(backing_options);
-    qemu_opts_del(tcp_opts);
-    qemu_opts_del(opts);
-    g_free(cacert);
-    g_free(client_key);
-    g_free(client_cert);
-
-    if (ret < 0) {
-        vxhs_unref();
-        g_free(s->vdisk_hostinfo.host);
-        g_free(s->vdisk_guid);
-        g_free(s->tlscredsid);
-        s->vdisk_guid = NULL;
-    }
-
-    return ret;
-}
-
-static const AIOCBInfo vxhs_aiocb_info = {
-    .aiocb_size = sizeof(VXHSAIOCB)
-};
-
-/*
- * This allocates QEMU-VXHS callback for each IO
- * and is passed to QNIO. When QNIO completes the work,
- * it will be passed back through the callback.
- */
-static BlockAIOCB *vxhs_aio_rw(BlockDriverState *bs, uint64_t offset,
-                               QEMUIOVector *qiov, uint64_t size,
-                               BlockCompletionFunc *cb, void *opaque,
-                               VDISKAIOCmd iodir)
-{
-    VXHSAIOCB *acb = NULL;
-    BDRVVXHSState *s = bs->opaque;
-    int iio_flags = 0;
-    int ret = 0;
-    void *dev_handle = s->vdisk_hostinfo.dev_handle;
-
-    acb = qemu_aio_get(&vxhs_aiocb_info, bs, cb, opaque);
-
-    /*
-     * Initialize VXHSAIOCB.
-     */
-    acb->err = 0;
-
-    iio_flags = IIO_FLAG_ASYNC;
-
-    switch (iodir) {
-    case VDISK_AIO_WRITE:
-            ret = iio_writev(dev_handle, acb, qiov->iov, qiov->niov,
-                             offset, size, iio_flags);
-            break;
-    case VDISK_AIO_READ:
-            ret = iio_readv(dev_handle, acb, qiov->iov, qiov->niov,
-                            offset, size, iio_flags);
-            break;
-    default:
-            trace_vxhs_aio_rw_invalid(iodir);
-            goto errout;
-    }
-
-    if (ret != 0) {
-        trace_vxhs_aio_rw_ioerr(s->vdisk_guid, iodir, size, offset,
-                                acb, ret, errno);
-        goto errout;
-    }
-    return &acb->common;
-
-errout:
-    qemu_aio_unref(acb);
-    return NULL;
-}
-
-static BlockAIOCB *vxhs_aio_preadv(BlockDriverState *bs,
-                                   uint64_t offset, uint64_t bytes,
-                                   QEMUIOVector *qiov, int flags,
-                                   BlockCompletionFunc *cb, void *opaque)
-{
-    return vxhs_aio_rw(bs, offset, qiov, bytes, cb, opaque, VDISK_AIO_READ);
-}
-
-static BlockAIOCB *vxhs_aio_pwritev(BlockDriverState *bs,
-                                    uint64_t offset, uint64_t bytes,
-                                    QEMUIOVector *qiov, int flags,
-                                    BlockCompletionFunc *cb, void *opaque)
-{
-    return vxhs_aio_rw(bs, offset, qiov, bytes, cb, opaque, VDISK_AIO_WRITE);
-}
-
-static void vxhs_close(BlockDriverState *bs)
-{
-    BDRVVXHSState *s = bs->opaque;
-
-    trace_vxhs_close(s->vdisk_guid);
-
-    g_free(s->vdisk_guid);
-    s->vdisk_guid = NULL;
-
-    /*
-     * Close vDisk device
-     */
-    if (s->vdisk_hostinfo.dev_handle) {
-        iio_close(s->vdisk_hostinfo.dev_handle);
-        s->vdisk_hostinfo.dev_handle = NULL;
-    }
-
-    vxhs_unref();
-
-    /*
-     * Free the dynamically allocated host string etc
-     */
-    g_free(s->vdisk_hostinfo.host);
-    g_free(s->tlscredsid);
-    s->tlscredsid = NULL;
-    s->vdisk_hostinfo.host = NULL;
-    s->vdisk_hostinfo.port = 0;
-}
-
-static int64_t vxhs_get_vdisk_stat(BDRVVXHSState *s)
-{
-    int64_t vdisk_size = -1;
-    int ret = 0;
-    void *dev_handle = s->vdisk_hostinfo.dev_handle;
-
-    ret = iio_ioctl(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0);
-    if (ret < 0) {
-        trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno);
-        return -EIO;
-    }
-
-    trace_vxhs_get_vdisk_stat(s->vdisk_guid, vdisk_size);
-    return vdisk_size;
-}
-
-/*
- * Returns the size of vDisk in bytes. This is required
- * by QEMU block upper block layer so that it is visible
- * to guest.
- */
-static int64_t vxhs_getlength(BlockDriverState *bs)
-{
-    BDRVVXHSState *s = bs->opaque;
-    int64_t vdisk_size;
-
-    vdisk_size = vxhs_get_vdisk_stat(s);
-    if (vdisk_size < 0) {
-        return -EIO;
-    }
-
-    return vdisk_size;
-}
-
-static const char *const vxhs_strong_runtime_opts[] = {
-    VXHS_OPT_VDISK_ID,
-    "tls-creds",
-    VXHS_OPT_HOST,
-    VXHS_OPT_PORT,
-    VXHS_OPT_SERVER".",
-
-    NULL
-};
-
-static BlockDriver bdrv_vxhs = {
-    .format_name                  = "vxhs",
-    .protocol_name                = "vxhs",
-    .instance_size                = sizeof(BDRVVXHSState),
-    .bdrv_file_open               = vxhs_open,
-    .bdrv_parse_filename          = vxhs_parse_filename,
-    .bdrv_refresh_limits          = vxhs_refresh_limits,
-    .bdrv_close                   = vxhs_close,
-    .bdrv_getlength               = vxhs_getlength,
-    .bdrv_aio_preadv              = vxhs_aio_preadv,
-    .bdrv_aio_pwritev             = vxhs_aio_pwritev,
-    .strong_runtime_opts          = vxhs_strong_runtime_opts,
-};
-
-static void bdrv_vxhs_init(void)
-{
-    bdrv_register(&bdrv_vxhs);
-}
-
-block_init(bdrv_vxhs_init);
diff --git a/configure b/configure
index b751c853f5..8227962b45 100755
--- a/configure
+++ b/configure
@@ -501,7 +501,6 @@ numa=""
 tcmalloc="no"
 jemalloc="no"
 replication="yes"
-vxhs=""
 bochs="yes"
 cloop="yes"
 dmg="yes"
@@ -1541,10 +1540,6 @@ for opt do
   ;;
   --enable-replication) replication="yes"
   ;;
-  --disable-vxhs) vxhs="no"
-  ;;
-  --enable-vxhs) vxhs="yes"
-  ;;
   --disable-bochs) bochs="no"
   ;;
   --enable-bochs) bochs="yes"
@@ -1932,7 +1927,6 @@ disabled with --disable-FEATURE, default is enabled if available:
   xfsctl          xfsctl support
   qom-cast-debug  cast debugging support
   tools           build qemu-io, qemu-nbd and qemu-img tools
-  vxhs            Veritas HyperScale vDisk backend support
   bochs           bochs image format support
   cloop           cloop image format support
   dmg             dmg image format support
@@ -6249,33 +6243,6 @@ if compile_prog "" "" ; then
     have_sysmacros=yes
 fi
 
-##########################################
-# Veritas HyperScale block driver VxHS
-# Check if libvxhs is installed
-
-if test "$vxhs" != "no" ; then
-  cat > $TMPC <<EOF
-#include <stdint.h>
-#include <qnio/qnio_api.h>
-
-void *vxhs_callback;
-
-int main(void) {
-    iio_init(QNIO_VERSION, vxhs_callback);
-    return 0;
-}
-EOF
-  vxhs_libs="-lvxhs -lssl"
-  if compile_prog "" "$vxhs_libs" ; then
-    vxhs=yes
-  else
-    if test "$vxhs" = "yes" ; then
-      feature_not_found "vxhs block device" "Install libvxhs See github"
-    fi
-    vxhs=no
-  fi
-fi
-
 ##########################################
 # check for _Static_assert()
 
@@ -7033,7 +7000,6 @@ echo "jemalloc support  $jemalloc"
 echo "avx2 optimization $avx2_opt"
 echo "avx512f optimization $avx512f_opt"
 echo "replication support $replication"
-echo "VxHS block device $vxhs"
 echo "bochs support     $bochs"
 echo "cloop support     $cloop"
 echo "dmg support       $dmg"
@@ -7884,11 +7850,6 @@ elif test "$pthread_setname_np_wo_tid" = "yes" ; then
   echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak
 fi
 
-if test "$vxhs" = "yes" ; then
-  echo "CONFIG_VXHS=y" >> $config_host_mak
-  echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak
-fi
-
 if test "$libpmem" = "yes" ; then
   echo "CONFIG_LIBPMEM=y" >> $config_host_mak
 fi
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 971b65be75..851dbdeb8a 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -618,3 +618,11 @@ to achieve the same fake NUMA effect or a properly configured
 New machine versions (since 5.1) will not accept the option but it will still
 work with old machine types. User can check the QAPI schema to see if the legacy
 option is supported by looking at MachineInfo::numa-mem-supported property.
+
+Block devices
+-------------
+
+VXHS backend (removed in 5.1)
+'''''''''''''''''''''''''''''
+
+The VXHS code does not compile since v2.12.0. It was removed in 5.1.
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 463ffd83da..ab7bf3c612 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2790,7 +2790,6 @@
 #
 # Drivers that are supported in block device operations.
 #
-# @vxhs: Since 2.10
 # @throttle: Since 2.11
 # @nvme: Since 2.12
 # @copy-on-read: Since 3.0
@@ -2808,7 +2807,7 @@
             'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
             { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
             'sheepdog',
-            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
+            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
 
 ##
 # @BlockdevOptionsFile:
@@ -3895,22 +3894,6 @@
   'base': 'BlockdevOptionsGenericFormat',
   'data': { '*offset': 'int', '*size': 'int' } }
 
-##
-# @BlockdevOptionsVxHS:
-#
-# Driver specific block device options for VxHS
-#
-# @vdisk-id: UUID of VxHS volume
-# @server: vxhs server IP, port
-# @tls-creds: TLS credentials ID
-#
-# Since: 2.10
-##
-{ 'struct': 'BlockdevOptionsVxHS',
-  'data': { 'vdisk-id': 'str',
-            'server': 'InetSocketAddressBase',
-            '*tls-creds': 'str' } }
-
 ##
 # @BlockdevOptionsThrottle:
 #
@@ -4010,8 +3993,7 @@
       'vhdx':       'BlockdevOptionsGenericFormat',
       'vmdk':       'BlockdevOptionsGenericCOWFormat',
       'vpc':        'BlockdevOptionsGenericFormat',
-      'vvfat':      'BlockdevOptionsVVFAT',
-      'vxhs':       'BlockdevOptionsVxHS'
+      'vvfat':      'BlockdevOptionsVVFAT'
   } }
 
 ##
diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 585512bb29..3413e34f27 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -40,7 +40,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # Any format supporting backing files
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
-_unsupported_proto vxhs
 _unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" \
                      "subformat=streamOptimized"
 
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index 2161a4b87a..61d78c00a4 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -41,7 +41,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # Any format supporting intenal snapshots
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
 _unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 1dce478709..68517821e8 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # External data files do not support compressed clusters
 # (TODO: Consider writing a version for external data files that does
 #        not test compressed clusters)
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
index 5a7b0a4998..80e5e5e591 100755
--- a/tests/qemu-iotests/114
+++ b/tests/qemu-iotests/114
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # At least OpenBSD doesn't seem to have truncate
 _supported_os Linux
 # qcow2.py does not work too well with external data files
diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130
index 77ad2aa13a..a7b365701c 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -42,7 +42,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 _supported_os Linux
 # We are going to use lazy-refcounts
 _unsupported_imgopts 'compat=0.10'
diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134
index 5162d21662..17fe1d6ed4 100755
--- a/tests/qemu-iotests/134
+++ b/tests/qemu-iotests/134
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 
 
 size=128M
diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156
index 7c69a6c3fa..9c7878dd2d 100755
--- a/tests/qemu-iotests/156
+++ b/tests/qemu-iotests/156
@@ -50,7 +50,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2 qed
 _supported_proto generic
-_unsupported_proto vxhs
 # Copying files around with cp does not work with external data files
 _unsupported_imgopts data_file
 
diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158
index 3175968e2b..cf23742c59 100755
--- a/tests/qemu-iotests/158
+++ b/tests/qemu-iotests/158
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 
 
 size=128M
diff --git a/tests/qemu-iotests/282 b/tests/qemu-iotests/282
index 081eb12080..27da2a0023 100755
--- a/tests/qemu-iotests/282
+++ b/tests/qemu-iotests/282
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt luks
 _supported_proto generic
-_unsupported_proto vxhs
 
 echo "== Create non-UTF8 secret =="
 echo -n -e '\x3a\x3c\x3b\xff' > non_utf8_secret
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 9c461cf76d..e0d8049012 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -272,7 +272,6 @@ image protocol options
     -nbd                test nbd
     -ssh                test ssh
     -nfs                test nfs
-    -vxhs               test vxhs
 
 other options
     -xdiff              graphical mode diff
@@ -383,11 +382,6 @@ testlist options
             xpand=false
             ;;
 
-        -vxhs)
-            IMGPROTO=vxhs
-            xpand=false
-            ;;
-
         -ssh)
             IMGPROTO=ssh
             xpand=false
@@ -646,10 +640,6 @@ if [ -z $QEMU_NBD_PROG ]; then
 fi
 export QEMU_NBD_PROG="$(type -p "$QEMU_NBD_PROG")"
 
-if [ -z "$QEMU_VXHS_PROG" ]; then
-    export QEMU_VXHS_PROG="$(set_prog_path qnio_server)"
-fi
-
 if [ -x "$build_iotests/socket_scm_helper" ]
 then
     export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 9b772245cd..c6912be009 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -227,7 +227,6 @@ _filter_img_info()
         -e "s#$IMGFMT#IMGFMT#g" \
         -e 's#nbd://127.0.0.1:[0-9]\\+$#TEST_DIR/t.IMGFMT#g' \
         -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g' \
-        -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \
         -e "/encrypted: yes/d" \
         -e "/cluster_size: [0-9]\\+/d" \
         -e "/table_size: [0-9]\\+/d" \
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 7ac46edc1f..494490a272 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -124,7 +124,6 @@ fi
 : ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
 : ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
 : ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
-: ${VALGRIND_QEMU_VXHS=$VALGRIND_QEMU}
 
 # The Valgrind own parameters may be set with
 # its environment variable VALGRIND_OPTS, e.g.
@@ -212,19 +211,6 @@ _qemu_nbd_wrapper()
     return $RETVAL
 }
 
-_qemu_vxhs_wrapper()
-{
-    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
-    (
-        echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
-        VALGRIND_QEMU="${VALGRIND_QEMU_VXHS}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
-            "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
-    )
-    RETVAL=$?
-    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
-    return $RETVAL
-}
-
 # Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
 # Until valgrind 3.16+ is ubiquitous, we must work around a hang in
 # valgrind when issuing sigkill. Disable valgrind for this invocation.
@@ -237,7 +223,6 @@ export QEMU=_qemu_wrapper
 export QEMU_IMG=_qemu_img_wrapper
 export QEMU_IO=_qemu_io_wrapper
 export QEMU_NBD=_qemu_nbd_wrapper
-export QEMU_VXHS=_qemu_vxhs_wrapper
 
 if [ "$IMGOPTSSYNTAX" = "true" ]; then
     DRIVER="driver=$IMGFMT"
@@ -279,9 +264,6 @@ else
         TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
         REMOTE_TEST_DIR="nfs://127.0.0.1$TEST_DIR"
         TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE"
-    elif [ "$IMGPROTO" = "vxhs" ]; then
-        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
-        TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT"
     else
         TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
     fi
@@ -436,12 +418,6 @@ _make_test_img()
         eval "$QEMU_NBD -v -t -k '$SOCK_DIR/nbd' -f $IMGFMT -e 42 -x '' $TEST_IMG_FILE >/dev/null &"
         sleep 1 # FIXME: qemu-nbd needs to be listening before we continue
     fi
-
-    # Start QNIO server on image directory for vxhs protocol
-    if [ $IMGPROTO = "vxhs" ]; then
-        eval "$QEMU_VXHS -d  $TEST_DIR > /dev/null &"
-        sleep 1 # Wait for server to come up.
-    fi
 }
 
 _rm_test_img()
@@ -468,15 +444,6 @@ _cleanup_test_img()
             _stop_nbd_server
             rm -f "$TEST_IMG_FILE"
             ;;
-        vxhs)
-            if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then
-                local QEMU_VXHS_PID
-                read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid"
-                kill ${QEMU_VXHS_PID} >/dev/null 2>&1
-                rm -f "${TEST_DIR}/qemu-vxhs.pid"
-            fi
-            rm -f "$TEST_IMG_FILE"
-            ;;
 
         file)
             _rm_test_img "$TEST_DIR/t.$IMGFMT"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14874.36994 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8T-00075l-6E; Thu, 29 Oct 2020 21:07:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14874.36994; Thu, 29 Oct 2020 21:07:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8T-00075d-38; Thu, 29 Oct 2020 21:07:05 +0000
Received: by outflank-mailman (input) for mailman id 14874;
 Thu, 29 Oct 2020 21:07:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF8R-00075U-SB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 450c584b-62a7-4adf-b925-efe8a975cae4;
 Thu, 29 Oct 2020 21:07:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8Q-0007Pt-Kg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8Q-0002Iu-Jm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF8R-00075U-SB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:03 +0000
X-Inumbo-ID: 450c584b-62a7-4adf-b925-efe8a975cae4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 450c584b-62a7-4adf-b925-efe8a975cae4;
	Thu, 29 Oct 2020 21:07:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wg6dydTJEzmF3jekzdtgRwY8SRzNJ6VPN/9Xz/bPZxc=; b=z7MjzPw5H6JF5SSNAHW+CkHKdJ
	uhaQpUOdgZ5hR6Ls+8EOtZmKKXHcQGCZG1bXVNndN4IPBUwTag73Qo57ASgBYc8HOPe2vCFNrCy16
	eYGbcBSBIObE2T3xpzM+N5ZtOgHQKGxst78lWfd8F/fOPpz/4QKS/M6pwv9daAwXxaMY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8Q-0007Pt-Kg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8Q-0002Iu-Jm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-img resize: Require --shrink for shrinking all image formats
Message-Id: <E1kYF8Q-0002Iu-Jm@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:02 +0000

commit 1c404d756fd59ecee09dec924b88c492d24b3fc8
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 10 14:17:17 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    qemu-img resize: Require --shrink for shrinking all image formats
    
    QEMU 2.11 introduced the --shrink option for qemu-img resize to avoid
    accidentally shrinking images (commit 4ffca8904a3). However, for
    compatibility reasons, it was not enforced for raw images yet, but only
    a deprecation warning was printed. This warning has existed for long
    enough that we can now finally require --shrink for raw images, too, and
    error out if it's not given.
    
    Documentation already describes the state as it is after this patch.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710121717.28339-1-kwolf@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu-img.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index efb6ca139e..5308773811 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4004,20 +4004,12 @@ static int img_resize(int argc, char **argv)
     }
 
     if (total_size < current_size && !shrink) {
+        error_report("Use the --shrink option to perform a shrink operation.");
         warn_report("Shrinking an image will delete all data beyond the "
                     "shrunken image's end. Before performing such an "
                     "operation, make sure there is no important data there.");
-
-        if (g_strcmp0(bdrv_get_format_name(blk_bs(blk)), "raw") != 0) {
-            error_report(
-              "Use the --shrink option to perform a shrink operation.");
-            ret = -1;
-            goto out;
-        } else {
-            warn_report("Using the --shrink option will suppress this message. "
-                        "Note that future versions of qemu-img may refuse to "
-                        "shrink images without this option.");
-        }
+        ret = -1;
+        goto out;
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14875.36998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8d-00076u-7o; Thu, 29 Oct 2020 21:07:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14875.36998; Thu, 29 Oct 2020 21:07:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8d-00076m-4c; Thu, 29 Oct 2020 21:07:15 +0000
Received: by outflank-mailman (input) for mailman id 14875;
 Thu, 29 Oct 2020 21:07:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF8c-00076d-2M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 18807ead-19ad-4f6f-bbcc-ec297a468960;
 Thu, 29 Oct 2020 21:07:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8a-0007Q4-PA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8a-0002Jy-NX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF8c-00076d-2M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:14 +0000
X-Inumbo-ID: 18807ead-19ad-4f6f-bbcc-ec297a468960
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 18807ead-19ad-4f6f-bbcc-ec297a468960;
	Thu, 29 Oct 2020 21:07:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uQvndOVgTJAoweXKal9l628MNuXdUk4wswEAmiXblow=; b=kmNJRze1ta/jecFdJZFVFyHj7n
	HAqb0YRNjG4Py/rFaE/tqmLHc2htn4qX7PeERiCktP1mJCMZ5XzQFWF/yA5j46faXqr1/hjE2gK8P
	ODJ4wctaLDcGubjAkKEkgkE/UEEmqQvQ5XNerPHvRjxiAW63Df+/YImpPvEs4XogNjRI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8a-0007Q4-PA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8a-0002Jy-NX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] crypto: use a stronger private key for tests
Message-Id: <E1kYF8a-0002Jy-NX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:12 +0000

commit 3e018afbfe005a3448949bfe3954888b9d8460c4
Author:     Daniel P. Berrangé <berrange@redhat.com>
AuthorDate: Wed Jul 15 16:47:01 2020 +0100
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    crypto: use a stronger private key for tests
    
    The unit tests using the x509 crypto functionality have started
    failing in Fedora 33 rawhide with a message like
    
          The certificate uses an insecure algorithm
    
    This is result of Fedora changes to support strong crypto [1]. RSA
    with 1024 bit key is viewed as legacy and thus insecure. Generate
    a new private key which is 3072 bits long and reasonable future
    proof.
    
    [1] https://fedoraproject.org/wiki/Changes/StrongCryptoSettings2
    
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200715154701.1041325-1-berrange@redhat.com>
    Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/crypto-tls-x509-helpers.c | 59 ++++++++++++++++++++++++++++-------------
 tests/qemu-iotests/common.tls   | 57 ++++++++++++++++++++++++++-------------
 2 files changed, 79 insertions(+), 37 deletions(-)

diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c
index 9b669c2a4b..01b3daf358 100644
--- a/tests/crypto-tls-x509-helpers.c
+++ b/tests/crypto-tls-x509-helpers.c
@@ -37,25 +37,46 @@ ASN1_TYPE pkix_asn1;
  * here's one we prepared earlier :-)
  */
 gnutls_x509_privkey_t privkey;
-# define PRIVATE_KEY                                              \
-    "-----BEGIN PRIVATE KEY-----\n"                               \
-    "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVcr\n"     \
-    "BL40Tm6yq88FBhJNw1aaoCjmtg0l4dWQZ/e9Fimx4ARxFpT+ji4FE\n"     \
-    "Cgl9s/SGqC+1nvlkm9ViSo0j7MKDbnDB+VRHDvMAzQhA2X7e8M0n9\n"     \
-    "rPolUY2lIVC83q0BBaOBkCj2RSmT2xTEbbC2xLukSrg2WP/ihVOxc\n"     \
-    "kXRuyFtzAgMBAAECgYB7slBexDwXrtItAMIH6m/U+LUpNe0Xx48OL\n"     \
-    "IOn4a4whNgO/o84uIwygUK27ZGFZT0kAGAk8CdF9hA6ArcbQ62s1H\n"     \
-    "myxrUbF9/mrLsQw1NEqpuUk9Ay2Tx5U/wPx35S3W/X2AvR/ZpTnCn\n"     \
-    "2q/7ym9fyiSoj86drD7BTvmKXlOnOwQJBAPOFMp4mMa9NGpGuEssO\n"     \
-    "m3Uwbp6lhcP0cA9MK+iOmeANpoKWfBdk5O34VbmeXnGYWEkrnX+9J\n"     \
-    "bM4wVhnnBWtgBMCQQC+qAEmvwcfhauERKYznMVUVksyeuhxhCe7EK\n"     \
-    "mPh+U2+g0WwdKvGDgO0PPt1gq0ILEjspMDeMHVdTwkaVBo/uMhAkA\n"     \
-    "Z5SsZyCP2aTOPFDypXRdI4eqRcjaEPOUBq27r3uYb/jeboVb2weLa\n"     \
-    "L1MmVuHiIHoa5clswPdWVI2y0em2IGoDAkBPSp/v9VKJEZabk9Frd\n"     \
-    "a+7u4fanrM9QrEjY3KhduslSilXZZSxrWjjAJPyPiqFb3M8XXA26W\n"     \
-    "nz1KYGnqYKhLcBAkB7dt57n9xfrhDpuyVEv+Uv1D3VVAhZlsaZ5Pp\n"     \
-    "dcrhrkJn2sa/+O8OKvdrPSeeu/N5WwYhJf61+CPoenMp7IFci\n"         \
-    "-----END PRIVATE KEY-----\n"
+# define PRIVATE_KEY \
+    "-----BEGIN RSA PRIVATE KEY-----\n" \
+    "MIIG5AIBAAKCAYEAyjWyLSNm5PZvYUKUcDWGqbLX10b2ood+YaFjWSnJrqx/q3qh\n" \
+    "rVGBJglD25AJENJsmZF3zPP1oMhfIxsXu63Hdkb6Rdlc2RUoUP34x9VC1izH25mR\n" \
+    "6c8DPDp1d6IraZ/llDMI1HsBFz0qGWtvOHgm815XG4PAr/N8rDsuqfv/cJ01KlnO\n" \
+    "0OdO5QRXCJf9g/dYd41MPu7wOXk9FqjQlmRoP59HgtJ+zUpE4z+Keruw9cMT9VJj\n" \
+    "0oT+pQ9ysenqeZ3gbT224T1khrEhT5kifhtFLNyDssRchUUWH0hiqoOO1vgb+850\n" \
+    "W6/1VdxvuPam48py4diSPi1Vip8NITCOBaX9FIpVp4Ruw4rTPVMNMjq9Cpx/DwMP\n" \
+    "9MbfXfnaVaZaMrmq67/zPhl0eVbUrecH2hQ3ZB9oIF4GkNskzlWF5+yPy6zqk304\n" \
+    "AKaiFR6jRyh3YfHo2XFqV8x/hxdsIEXOtEUGhSIcpynsW+ckUCartzu7xbhXjd4b\n" \
+    "kxJT89+riPFYij09AgMBAAECggGBAKyFkaZXXROeejrmHlV6JZGlp+fhgM38gkRz\n" \
+    "+Jp7P7rLLAY3E7gXIPQ91WqAAmwazFNdvHPd9USfkCQYmnAi/VoZhrCPmlsQZRxt\n" \
+    "A5QjjOnEvSPMa6SrXZxGWDCg6R8uMCb4P+FhrPWR1thnRDZOtRTQ+crc50p3mHgt\n" \
+    "6ktXWIJRbqnag8zSfQqCYGtRmhe8sfsWT+Yl4El4+jjaAVU/B364u7+PLmaiphGp\n" \
+    "BdJfTsTwEpgtGkPj+osDmhzXcZkfq3V+fz5JLkemsCiQKmn4VJRpg8c3ZmE8NPNt\n" \
+    "gRtGWZ4W3WKDvhotT65WpQx4+6R8Duux/blNPBmH1Upmwd7kj7GYFBArbCjgd9PT\n" \
+    "xgfCSUZpgOZHHkcgSB+022a8XncXna7WYYij28SLtwImFyu0nNtqECFQHH5u+k6C\n" \
+    "LRYBSN+3t3At8dQuk01NVrJBndmjmXRfxpqUtTdeaNgVpdUYRY98s30G68NYGSra\n" \
+    "aEvhhRSghkcLNetkobpY9pUgeqW/tQKBwQDZHHK9nDMt/zk1TxtILeUSitPXcv1/\n" \
+    "8ufXqO0miHdH23XuXhIEA6Ef26RRVGDGgpjkveDJK/1w5feJ4H/ni4Vclil/cm38\n" \
+    "OwRqjjd7ElHJX6JQbsxEx/gNTk5/QW1iAL9TXUalgepsSXYT6AJ0/CJv0jmJSJ36\n" \
+    "YoKMOM8uqzb2KhN6i+RlJRi5iY53kUhWTJq5ArWvNhUzQNSYODI4bNxlsKSBL2Ik\n" \
+    "LZ5QKHuaEjQet0IlPlfIb4PzMm8CHa/urOcCgcEA7m3zW/lL5bIFoKPjWig5Lbn1\n" \
+    "aHfrG2ngqzWtgWtfZqMH8OkZc1Mdhhmvd46titjiLjeI+UP/uHXR0068PnrNngzl\n" \
+    "tTgwlakzu+bWzqhBm1F+3/341st/FEk07r0P/3/PhezVjwfO8c8Exj7pLxH4wrH0\n" \
+    "ROHgDbClmlJRu6OO78wk1+Vapf5DWa8YfA+q+fdvr7KvgGyytheKMT/b/dsqOq7y\n" \
+    "qZPjmaJKWAvV3RWG8lWHFSdHx2IAHMHfGr17Y/w7AoHBALzwZeYebeekiVucGSjq\n" \
+    "T8SgLhT7zCIx+JMUPjVfYzaUhP/Iu7Lkma6IzWm9nW6Drpy5pUpMzwUWDCLfzU9q\n" \
+    "eseFIl337kEn9wLn+t5OpgAyCqYmlftxbqvdrrBN9uvnrJjWvqk/8wsDrw9JxAGc\n" \
+    "fjeD4nBXUqvYWLXApoR9mZoGKedmoH9pFig4zlO9ig8YITnKYuQ0k6SD0b8agJHc\n" \
+    "Ir0YSUDnRGgpjvFBGbeOCe+FGbohk/EpItJc3IAh5740lwKBwAdXd2DjokSmYKn7\n" \
+    "oeqKxofz6+yVlLW5YuOiuX78sWlVp87xPolgi84vSEnkKM/Xsc8+goc6YstpRVa+\n" \
+    "W+mImoA9YW1dF5HkLeWhTAf9AlgoAEIhbeIfTgBv6KNZSv7RDrDPBBxtXx/vAfSg\n" \
+    "x0ldwk0scZsVYXLKd67yzfV7KdGUdaX4N/xYgfZm/9gCG3+q8NN2KxVHQ5F71BOE\n" \
+    "JeABOaGo9WvnU+DNMIDZjHJMUWVw4MHz/a/UArDf/2CxaPVBNQKBwASg6j4ohSTk\n" \
+    "J7aE6RQ3OBmmDDpixcoCJt9u9SjHVYMlbs5CEJGVSczk0SG3y8P1lOWNDSRnMksZ\n" \
+    "xWnHdP/ogcuYMuvK7UACNAF0zNddtzOhzcpNmejFj+WCHYY/UmPr2/Kf6t7Cxk2K\n" \
+    "3cZ4tqWsiTmBT8Bknmah7L5DrhS+ZBJliDeFAA8fZHdMH0Xjr4UBp9kF90EMTdW1\n" \
+    "Xr5uz7ZrMsYpYQI7mmyqV9SSjUg4iBXwVSoag1iDJ1K8Qg/L7Semgg==\n" \
+    "-----END RSA PRIVATE KEY-----\n"
 
 /*
  * This loads the private key we defined earlier
diff --git a/tests/qemu-iotests/common.tls b/tests/qemu-iotests/common.tls
index 54c331d7a5..6ba28a78d3 100644
--- a/tests/qemu-iotests/common.tls
+++ b/tests/qemu-iotests/common.tls
@@ -50,24 +50,45 @@ tls_x509_init()
     # use a fixed key so we don't waste system entropy on
     # each test run
     cat > "${tls_dir}/key.pem" <<EOF
------BEGIN PRIVATE KEY-----
-MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVcr
-BL40Tm6yq88FBhJNw1aaoCjmtg0l4dWQZ/e9Fimx4ARxFpT+ji4FE
-Cgl9s/SGqC+1nvlkm9ViSo0j7MKDbnDB+VRHDvMAzQhA2X7e8M0n9
-rPolUY2lIVC83q0BBaOBkCj2RSmT2xTEbbC2xLukSrg2WP/ihVOxc
-kXRuyFtzAgMBAAECgYB7slBexDwXrtItAMIH6m/U+LUpNe0Xx48OL
-IOn4a4whNgO/o84uIwygUK27ZGFZT0kAGAk8CdF9hA6ArcbQ62s1H
-myxrUbF9/mrLsQw1NEqpuUk9Ay2Tx5U/wPx35S3W/X2AvR/ZpTnCn
-2q/7ym9fyiSoj86drD7BTvmKXlOnOwQJBAPOFMp4mMa9NGpGuEssO
-m3Uwbp6lhcP0cA9MK+iOmeANpoKWfBdk5O34VbmeXnGYWEkrnX+9J
-bM4wVhnnBWtgBMCQQC+qAEmvwcfhauERKYznMVUVksyeuhxhCe7EK
-mPh+U2+g0WwdKvGDgO0PPt1gq0ILEjspMDeMHVdTwkaVBo/uMhAkA
-Z5SsZyCP2aTOPFDypXRdI4eqRcjaEPOUBq27r3uYb/jeboVb2weLa
-L1MmVuHiIHoa5clswPdWVI2y0em2IGoDAkBPSp/v9VKJEZabk9Frd
-a+7u4fanrM9QrEjY3KhduslSilXZZSxrWjjAJPyPiqFb3M8XXA26W
-nz1KYGnqYKhLcBAkB7dt57n9xfrhDpuyVEv+Uv1D3VVAhZlsaZ5Pp
-dcrhrkJn2sa/+O8OKvdrPSeeu/N5WwYhJf61+CPoenMp7IFci
------END PRIVATE KEY-----
+-----BEGIN RSA PRIVATE KEY-----
+MIIG5AIBAAKCAYEAyjWyLSNm5PZvYUKUcDWGqbLX10b2ood+YaFjWSnJrqx/q3qh
+rVGBJglD25AJENJsmZF3zPP1oMhfIxsXu63Hdkb6Rdlc2RUoUP34x9VC1izH25mR
+6c8DPDp1d6IraZ/llDMI1HsBFz0qGWtvOHgm815XG4PAr/N8rDsuqfv/cJ01KlnO
+0OdO5QRXCJf9g/dYd41MPu7wOXk9FqjQlmRoP59HgtJ+zUpE4z+Keruw9cMT9VJj
+0oT+pQ9ysenqeZ3gbT224T1khrEhT5kifhtFLNyDssRchUUWH0hiqoOO1vgb+850
+W6/1VdxvuPam48py4diSPi1Vip8NITCOBaX9FIpVp4Ruw4rTPVMNMjq9Cpx/DwMP
+9MbfXfnaVaZaMrmq67/zPhl0eVbUrecH2hQ3ZB9oIF4GkNskzlWF5+yPy6zqk304
+AKaiFR6jRyh3YfHo2XFqV8x/hxdsIEXOtEUGhSIcpynsW+ckUCartzu7xbhXjd4b
+kxJT89+riPFYij09AgMBAAECggGBAKyFkaZXXROeejrmHlV6JZGlp+fhgM38gkRz
++Jp7P7rLLAY3E7gXIPQ91WqAAmwazFNdvHPd9USfkCQYmnAi/VoZhrCPmlsQZRxt
+A5QjjOnEvSPMa6SrXZxGWDCg6R8uMCb4P+FhrPWR1thnRDZOtRTQ+crc50p3mHgt
+6ktXWIJRbqnag8zSfQqCYGtRmhe8sfsWT+Yl4El4+jjaAVU/B364u7+PLmaiphGp
+BdJfTsTwEpgtGkPj+osDmhzXcZkfq3V+fz5JLkemsCiQKmn4VJRpg8c3ZmE8NPNt
+gRtGWZ4W3WKDvhotT65WpQx4+6R8Duux/blNPBmH1Upmwd7kj7GYFBArbCjgd9PT
+xgfCSUZpgOZHHkcgSB+022a8XncXna7WYYij28SLtwImFyu0nNtqECFQHH5u+k6C
+LRYBSN+3t3At8dQuk01NVrJBndmjmXRfxpqUtTdeaNgVpdUYRY98s30G68NYGSra
+aEvhhRSghkcLNetkobpY9pUgeqW/tQKBwQDZHHK9nDMt/zk1TxtILeUSitPXcv1/
+8ufXqO0miHdH23XuXhIEA6Ef26RRVGDGgpjkveDJK/1w5feJ4H/ni4Vclil/cm38
+OwRqjjd7ElHJX6JQbsxEx/gNTk5/QW1iAL9TXUalgepsSXYT6AJ0/CJv0jmJSJ36
+YoKMOM8uqzb2KhN6i+RlJRi5iY53kUhWTJq5ArWvNhUzQNSYODI4bNxlsKSBL2Ik
+LZ5QKHuaEjQet0IlPlfIb4PzMm8CHa/urOcCgcEA7m3zW/lL5bIFoKPjWig5Lbn1
+aHfrG2ngqzWtgWtfZqMH8OkZc1Mdhhmvd46titjiLjeI+UP/uHXR0068PnrNngzl
+tTgwlakzu+bWzqhBm1F+3/341st/FEk07r0P/3/PhezVjwfO8c8Exj7pLxH4wrH0
+ROHgDbClmlJRu6OO78wk1+Vapf5DWa8YfA+q+fdvr7KvgGyytheKMT/b/dsqOq7y
+qZPjmaJKWAvV3RWG8lWHFSdHx2IAHMHfGr17Y/w7AoHBALzwZeYebeekiVucGSjq
+T8SgLhT7zCIx+JMUPjVfYzaUhP/Iu7Lkma6IzWm9nW6Drpy5pUpMzwUWDCLfzU9q
+eseFIl337kEn9wLn+t5OpgAyCqYmlftxbqvdrrBN9uvnrJjWvqk/8wsDrw9JxAGc
+fjeD4nBXUqvYWLXApoR9mZoGKedmoH9pFig4zlO9ig8YITnKYuQ0k6SD0b8agJHc
+Ir0YSUDnRGgpjvFBGbeOCe+FGbohk/EpItJc3IAh5740lwKBwAdXd2DjokSmYKn7
+oeqKxofz6+yVlLW5YuOiuX78sWlVp87xPolgi84vSEnkKM/Xsc8+goc6YstpRVa+
+W+mImoA9YW1dF5HkLeWhTAf9AlgoAEIhbeIfTgBv6KNZSv7RDrDPBBxtXx/vAfSg
+x0ldwk0scZsVYXLKd67yzfV7KdGUdaX4N/xYgfZm/9gCG3+q8NN2KxVHQ5F71BOE
+JeABOaGo9WvnU+DNMIDZjHJMUWVw4MHz/a/UArDf/2CxaPVBNQKBwASg6j4ohSTk
+J7aE6RQ3OBmmDDpixcoCJt9u9SjHVYMlbs5CEJGVSczk0SG3y8P1lOWNDSRnMksZ
+xWnHdP/ogcuYMuvK7UACNAF0zNddtzOhzcpNmejFj+WCHYY/UmPr2/Kf6t7Cxk2K
+3cZ4tqWsiTmBT8Bknmah7L5DrhS+ZBJliDeFAA8fZHdMH0Xjr4UBp9kF90EMTdW1
+Xr5uz7ZrMsYpYQI7mmyqV9SSjUg4iBXwVSoag1iDJ1K8Qg/L7Semgg==
+-----END RSA PRIVATE KEY-----
 EOF
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14876.37002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8m-000787-9R; Thu, 29 Oct 2020 21:07:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14876.37002; Thu, 29 Oct 2020 21:07:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8m-00077z-6A; Thu, 29 Oct 2020 21:07:24 +0000
Received: by outflank-mailman (input) for mailman id 14876;
 Thu, 29 Oct 2020 21:07:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF8l-00077u-O0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0bb692a3-8e2e-42cc-b145-caf6c722f87f;
 Thu, 29 Oct 2020 21:07:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8k-0007QI-Sn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8k-0002Ko-S2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF8l-00077u-O0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:23 +0000
X-Inumbo-ID: 0bb692a3-8e2e-42cc-b145-caf6c722f87f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0bb692a3-8e2e-42cc-b145-caf6c722f87f;
	Thu, 29 Oct 2020 21:07:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6vJYQLyoiE/eRnMdQEdUh8ljeODpa/HYQMeolnw+XKw=; b=CYuLgcv1K94wzZxcCpwNXxHtUR
	WNu+lhq4ececE+28UDUSvodii9qFk+JiRjEi32wWsZ+SLuL//nwzFqnIC8X0PdhA8x5YPqs3V5N7i
	hFJ0q5hWFQbhhvjli8oMXw8oPTXzdgyzDgpIJJN1n0dl0qK5kDOUyCpWZgaEj4Z8KOxM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8k-0007QI-Sn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8k-0002Ko-S2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/030: Reduce job speed to make race less likely
Message-Id: <E1kYF8k-0002Ko-S2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:22 +0000

commit f21f12936f9db6de4eddfcf9a086b6efd5b093cc
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 15:28:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    iotests/030: Reduce job speed to make race less likely
    
    It can happen that the throttling of the stream job doesn't make it slow
    enough that we can be sure that it still exists when it is referenced
    again. Just use a much smaller speed to make this very unlikely to
    happen again.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200716132829.20127-1-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/030 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 256b2bfbc6..31c028306b 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
             node_name = 'node%d' % i
             job_id = 'stream-%s' % node_name
             pending_jobs.append(job_id)
-            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
+            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
             self.assert_qmp(result, 'return', {})
 
         for job in pending_jobs:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14878.37006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8x-00079l-B9; Thu, 29 Oct 2020 21:07:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14878.37006; Thu, 29 Oct 2020 21:07:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF8x-00079d-7o; Thu, 29 Oct 2020 21:07:35 +0000
Received: by outflank-mailman (input) for mailman id 14878;
 Thu, 29 Oct 2020 21:07:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF8v-00079L-Rm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1d6d80ea-23a7-4a85-8e4b-d4243a38aa47;
 Thu, 29 Oct 2020 21:07:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8v-0007QP-0B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF8u-0002Lr-Vg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF8v-00079L-Rm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:33 +0000
X-Inumbo-ID: 1d6d80ea-23a7-4a85-8e4b-d4243a38aa47
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1d6d80ea-23a7-4a85-8e4b-d4243a38aa47;
	Thu, 29 Oct 2020 21:07:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Is0QXcoMOuNLu0/Dv5O3YjmHkL3m+HkaLSLFlND5Nt4=; b=Eko097LZzdPGWEXKifIQkqkDXZ
	p3yLsiiemPHgwPPS+/o5i23gZHHaR8y3zwwSD/EcfOZigSfnR+dwcR23RHDWYZDF1PO3bNMSnyoKm
	WlI8DhENKZk8eLOa4Tr6Nv+/O++NZPvBU8p7n8zSiogapP9hThs5d2vFvfLdgi0RTsjQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8v-0007QP-0B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF8u-0002Lr-Vg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] nbd: make nbd_export_close_all() synchronous
Message-Id: <E1kYF8u-0002Lr-Vg@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:32 +0000

commit 453cc6be0a954ecdb4e0cdbf5b5b87f07b3e1075
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Tue Jul 14 19:22:33 2020 +0300
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    nbd: make nbd_export_close_all() synchronous
    
    Consider nbd_export_close_all(). The call-stack looks like this:
     nbd_export_close_all() -> nbd_export_close -> call client_close() for
    each client.
    
    client_close() doesn't guarantee that client is closed: nbd_trip()
    keeps reference to it. So, nbd_export_close_all() just reduce
    reference counter on export and removes it from the list, but doesn't
    guarantee that nbd_trip() finished neither export actually removed.
    
    Let's wait for all exports actually removed.
    
    Without this fix, the following crash is possible:
    
    - export bitmap through internal Qemu NBD server
    - connect a client
    - shutdown Qemu
    
    On shutdown nbd_export_close_all is called, but it actually don't wait
    for nbd_trip() to finish and to release its references. So, export is
    not release, and exported bitmap remains busy, and on try to remove the
    bitmap (which is part of bdrv_close()) the assertion fails:
    
    bdrv_release_dirty_bitmap_locked: Assertion `!bdrv_dirty_bitmap_busy(bitmap)' failed
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200714162234.13113-2-vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 nbd/server.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nbd/server.c b/nbd/server.c
index 5357f588f0..4752a6c8bc 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -102,6 +102,8 @@ struct NBDExport {
 };
 
 static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports);
+static QTAILQ_HEAD(, NBDExport) closed_exports =
+        QTAILQ_HEAD_INITIALIZER(closed_exports);
 
 /* NBDExportMetaContexts represents a list of contexts to be exported,
  * as selected by NBD_OPT_SET_META_CONTEXT. Also used for
@@ -1659,6 +1661,7 @@ void nbd_export_close(NBDExport *exp)
         g_free(exp->name);
         exp->name = NULL;
         QTAILQ_REMOVE(&exports, exp, next);
+        QTAILQ_INSERT_TAIL(&closed_exports, exp, next);
     }
     g_free(exp->description);
     exp->description = NULL;
@@ -1722,7 +1725,9 @@ void nbd_export_put(NBDExport *exp)
             g_free(exp->export_bitmap_context);
         }
 
+        QTAILQ_REMOVE(&closed_exports, exp, next);
         g_free(exp);
+        aio_wait_kick();
     }
 }
 
@@ -1742,6 +1747,9 @@ void nbd_export_close_all(void)
         nbd_export_close(exp);
         aio_context_release(aio_context);
     }
+
+    AIO_WAIT_WHILE(NULL, !(QTAILQ_EMPTY(&exports) &&
+                           QTAILQ_EMPTY(&closed_exports)));
 }
 
 static int coroutine_fn nbd_co_send_iov(NBDClient *client, struct iovec *iov,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14879.37010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF97-0007BB-Ca; Thu, 29 Oct 2020 21:07:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14879.37010; Thu, 29 Oct 2020 21:07:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF97-0007B4-9K; Thu, 29 Oct 2020 21:07:45 +0000
Received: by outflank-mailman (input) for mailman id 14879;
 Thu, 29 Oct 2020 21:07:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF96-0007Ar-5b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 00a9d546-9beb-4794-99d0-6ee38ba43b42;
 Thu, 29 Oct 2020 21:07:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF95-0007S2-3l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF95-0002OP-31
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF96-0007Ar-5b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:44 +0000
X-Inumbo-ID: 00a9d546-9beb-4794-99d0-6ee38ba43b42
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 00a9d546-9beb-4794-99d0-6ee38ba43b42;
	Thu, 29 Oct 2020 21:07:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ue/eGowABRkZCS5yjz8nZ22Ktbj/iH/BBP7vagYr9s4=; b=ENo7O+WuAgCEZ5pOVCdEzmjdkO
	mN/s+3Wi1rkGWpiPX8XXEkAKr4mqVYhzMpCUhIU2IZHXMagdes0+TuXRVcKsKP69qRZYdBBFfB1Th
	OBUeyQsMdfxd7G0vGdK9OPnjgBzdRVmr3x0pMcRPsqQJZ7tr97ZEDOHPCHo7m3VmrdZM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF95-0007S2-3l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF95-0002OP-31
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: test shutdown when bitmap is exported through NBD
Message-Id: <E1kYF95-0002OP-31@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:43 +0000

commit d047cfa78dc76fb8c7768620106bf1acb7c79797
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Tue Jul 14 19:22:34 2020 +0300
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    iotests: test shutdown when bitmap is exported through NBD
    
    Test shutdown when bitmap is exported through NBD and active client
    exists. The previous patch fixes a crash, provoked by this scenario.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200714162234.13113-3-vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/299     | 65 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/299.out | 10 +++++++
 tests/qemu-iotests/group   |  1 +
 3 files changed, 76 insertions(+)

diff --git a/tests/qemu-iotests/299 b/tests/qemu-iotests/299
new file mode 100644
index 0000000000..e129c7f7cb
--- /dev/null
+++ b/tests/qemu-iotests/299
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+#
+# Test shutdown when bitmap is exported through NBD server
+#
+# Copyright (c) 2020 Virtuozzo International GmbH.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+import iotests
+
+# The test is unrelated to formats, restrict it to qcow2 to avoid extra runs
+iotests.script_initialize(
+    supported_fmts=['qcow2'],
+)
+
+nbd_sock = iotests.file_path('nbd.sock', base_dir=iotests.sock_dir)
+nbd_uri = 'nbd+unix:///disk?socket=' + nbd_sock
+size = 1024 * 1024
+
+vm = iotests.VM()
+vm.launch()
+
+vm.qmp_log('blockdev-add', **{
+    'node-name': 'disk',
+    'driver': 'null-co',
+    'size': 1024 * 1024,
+})
+
+vm.qmp_log('block-dirty-bitmap-add', **{
+    'node': 'disk',
+    'name': 'bitmap0'
+})
+
+vm.qmp_log('nbd-server-start', **{
+    'addr': {
+        'type': 'unix',
+        'data': {'path': nbd_sock}
+    }
+}, filters=[iotests.filter_qmp_testfiles])
+
+vm.qmp_log('nbd-server-add', **{
+    'device': 'disk',
+    'writable': True,
+    'bitmap': 'bitmap0'
+})
+
+p = iotests.QemuIoInteractive('-f', 'raw', nbd_uri)
+# wait for connection and check it:
+iotests.log(p.cmd('read 0 512').rstrip(), filters=[iotests.filter_qemu_io])
+
+vm.shutdown()
+
+p.close()
diff --git a/tests/qemu-iotests/299.out b/tests/qemu-iotests/299.out
new file mode 100644
index 0000000000..bba4252923
--- /dev/null
+++ b/tests/qemu-iotests/299.out
@@ -0,0 +1,10 @@
+{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "disk", "size": 1048576}}
+{"return": {}}
+{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap0", "node": "disk"}}
+{"return": {}}
+{"execute": "nbd-server-start", "arguments": {"addr": {"data": {"path": "SOCK_DIR/PID-nbd.sock"}, "type": "unix"}}}
+{"return": {}}
+{"execute": "nbd-server-add", "arguments": {"bitmap": "bitmap0", "device": "disk", "writable": true}}
+{"return": {}}
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a4f9e11e7a..1d0252e1f0 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -306,4 +306,5 @@
 295 rw
 296 rw
 297 meta
+299 auto quick
 301 backing quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:07:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:07:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14880.37014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9H-0007Cr-Fo; Thu, 29 Oct 2020 21:07:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14880.37014; Thu, 29 Oct 2020 21:07:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9H-0007Ci-Ca; Thu, 29 Oct 2020 21:07:55 +0000
Received: by outflank-mailman (input) for mailman id 14880;
 Thu, 29 Oct 2020 21:07:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF9G-0007CZ-8N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 85fd9ae4-2033-485a-9e39-32ebf20dbf08;
 Thu, 29 Oct 2020 21:07:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9F-0007S9-8U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9F-0002PO-6g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF9G-0007CZ-8N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:54 +0000
X-Inumbo-ID: 85fd9ae4-2033-485a-9e39-32ebf20dbf08
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 85fd9ae4-2033-485a-9e39-32ebf20dbf08;
	Thu, 29 Oct 2020 21:07:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UAWgpocOr1IBzaBATz02qclshxhSxpSvV9rp5+Iyn24=; b=Tb9vaVzfDW3swfDtg32r2BV3kA
	nhUWbKVwIyYf6HYGYQKuCFwepRr1ZEW/MtLmENt7VFWfXieq1R4w1Jq89twtDuUdEbxJPTH4f2lBL
	hUWxldfEEZb+1TaCjzcEJc00xkSsGJOtHPYvDNSVGAAac1GQUSdiKuLcKToDHrUWPuN0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9F-0007S9-8U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9F-0002PO-6g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:07:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Require aligned image size to avoid assertion failure
Message-Id: <E1kYF9F-0002PO-6g@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:07:53 +0000

commit 9c60a5d1978e6dcf85c0e01b50e6f7f54ca09104
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 16:26:00 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    block: Require aligned image size to avoid assertion failure
    
    Unaligned requests will automatically be aligned to bl.request_alignment
    and we can't extend write requests to access space beyond the end of the
    image without resizing the image, so if we have the WRITE permission,
    but not the RESIZE one, it's required that the image size is aligned.
    
    Failing to meet this requirement could cause assertion failures like
    this if RESIZE permissions weren't requested:
    
    qemu-img: block/io.c:1910: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
    
    This was e.g. triggered by qemu-img converting to a target image with 4k
    request alignment when the image was only aligned to 512 bytes, but not
    to 4k.
    
    Turn this into a graceful error in bdrv_check_perm() so that WRITE
    without RESIZE can only be taken if the image size is aligned. If a user
    holds both permissions and drops only RESIZE, the function will return
    an error, but bdrv_child_try_set_perm() will ignore the failure silently
    if permissions are only requested to be relaxed and just keep both
    permissions while returning success.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200716142601.111237-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/block.c b/block.c
index 35a372df57..d9ac0e07eb 100644
--- a/block.c
+++ b/block.c
@@ -2025,6 +2025,22 @@ static int bdrv_check_perm(BlockDriverState *bs, BlockReopenQueue *q,
         return -EPERM;
     }
 
+    /*
+     * Unaligned requests will automatically be aligned to bl.request_alignment
+     * and without RESIZE we can't extend requests to write to space beyond the
+     * end of the image, so it's required that the image size is aligned.
+     */
+    if ((cumulative_perms & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED)) &&
+        !(cumulative_perms & BLK_PERM_RESIZE))
+    {
+        if ((bs->total_sectors * BDRV_SECTOR_SIZE) % bs->bl.request_alignment) {
+            error_setg(errp, "Cannot get 'write' permission without 'resize': "
+                             "Image size is not a multiple of request "
+                             "alignment");
+            return -EPERM;
+        }
+    }
+
     /* Check this node */
     if (!drv) {
         return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14881.37020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9S-0007GN-I2; Thu, 29 Oct 2020 21:08:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14881.37020; Thu, 29 Oct 2020 21:08:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9S-0007GD-EG; Thu, 29 Oct 2020 21:08:06 +0000
Received: by outflank-mailman (input) for mailman id 14881;
 Thu, 29 Oct 2020 21:08:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF9R-0007G2-3W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee6c681d-9c70-4a0b-a645-59cf35ec9c88;
 Thu, 29 Oct 2020 21:08:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9P-0007Sv-Cb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9P-0002QH-Be
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF9R-0007G2-3W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:05 +0000
X-Inumbo-ID: ee6c681d-9c70-4a0b-a645-59cf35ec9c88
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee6c681d-9c70-4a0b-a645-59cf35ec9c88;
	Thu, 29 Oct 2020 21:08:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1IpOq7ZLpOWetJNWoK8C764ev23Kt3qEDnKEVi2y6Ic=; b=JsQ//ptaQ9Grxf1wELvz9E2t28
	xaoDjwXmxSnj4xfvurzF7uqsHtXYK/49D9BBdqLkPxOwLNvJ8ObJu+kw7jJzlJnoSD9wXjN1ah4sW
	s/HAVl18/jGmOQBlNvALmeeyO7E3L/UGA6kw/+T45qYY0ztyoGZTu1Pfy/HRfpSPT27o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9P-0007Sv-Cb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9P-0002QH-Be
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Allow byte-aligned O_DIRECT with NFS
Message-Id: <E1kYF9P-0002QH-Be@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:03 +0000

commit 5edc85571e7b7269dce408735eba7507f18ac666
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 16:26:01 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Allow byte-aligned O_DIRECT with NFS
    
    Since commit a6b257a08e3 ('file-posix: Handle undetectable alignment'),
    we assume that if we open a file with O_DIRECT and alignment probing
    returns 1, we just couldn't find out the real alignment requirement
    because some filesystems make the requirement only for allocated blocks.
    In this case, a safe default of 4k is used.
    
    This is too strict for NFS, which does actually allow byte-aligned
    requests even with O_DIRECT. Because we can't distinguish both cases
    with generic code, let's just look at the file system magic and disable
    s->needs_alignment for NFS. This way, O_DIRECT can still be used on NFS
    for images that are not aligned to 4k.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200716142601.111237-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 8067e238cb..ae8190edab 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -62,10 +62,12 @@
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <sys/syscall.h>
+#include <sys/vfs.h>
 #include <linux/cdrom.h>
 #include <linux/fd.h>
 #include <linux/fs.h>
 #include <linux/hdreg.h>
+#include <linux/magic.h>
 #include <scsi/sg.h>
 #ifdef __s390__
 #include <asm/dasd.h>
@@ -300,6 +302,28 @@ static int probe_physical_blocksize(int fd, unsigned int *blk_size)
 #endif
 }
 
+/*
+ * Returns true if no alignment restrictions are necessary even for files
+ * opened with O_DIRECT.
+ *
+ * raw_probe_alignment() probes the required alignment and assume that 1 means
+ * the probing failed, so it falls back to a safe default of 4k. This can be
+ * avoided if we know that byte alignment is okay for the file.
+ */
+static bool dio_byte_aligned(int fd)
+{
+#ifdef __linux__
+    struct statfs buf;
+    int ret;
+
+    ret = fstatfs(fd, &buf);
+    if (ret == 0 && buf.f_type == NFS_SUPER_MAGIC) {
+        return true;
+    }
+#endif
+    return false;
+}
+
 /* Check if read is allowed with given memory buffer and length.
  *
  * This function is used to check O_DIRECT memory buffer and request alignment.
@@ -629,7 +653,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     s->has_discard = true;
     s->has_write_zeroes = true;
-    if ((bs->open_flags & BDRV_O_NOCACHE) != 0) {
+    if ((bs->open_flags & BDRV_O_NOCACHE) != 0 && !dio_byte_aligned(s->fd)) {
         s->needs_alignment = true;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14882.37021 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9b-0007HS-Ii; Thu, 29 Oct 2020 21:08:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14882.37021; Thu, 29 Oct 2020 21:08:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9b-0007HK-Fj; Thu, 29 Oct 2020 21:08:15 +0000
Received: by outflank-mailman (input) for mailman id 14882;
 Thu, 29 Oct 2020 21:08:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF9a-0007HD-Dz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e86e9758-644e-422a-bda7-545287ae18ce;
 Thu, 29 Oct 2020 21:08:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9Z-0007T3-GO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9Z-0002Qr-Fb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF9a-0007HD-Dz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:14 +0000
X-Inumbo-ID: e86e9758-644e-422a-bda7-545287ae18ce
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e86e9758-644e-422a-bda7-545287ae18ce;
	Thu, 29 Oct 2020 21:08:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=elmJPhS3aB3/0FKfYkVSK/Bij6U5ish6ffGwoZvH+h0=; b=M0MzToVd622Z/LIhw+HaKd9jFl
	ZSsx6dA7Ry4bXvATGpFCL1tawojIqVzcpdYMnrqMnPZmHV59Hs7yjMrEddN2Pn1KnL02ks/QViV+u
	Rarmasb+bJ9PC4iPhLPTk+S5dramOWODLmUXIqmj6WPwiCffMhXGcWdm+8KccedMlPCA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9Z-0007T3-GO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9Z-0002Qr-Fb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Move check_hdev_writable() up
Message-Id: <E1kYF9Z-0002Qr-Fb@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:13 +0000

commit 20eaf1bf6ef1df916cb7ea2d06d1e868f238835f
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:24 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Move check_hdev_writable() up
    
    We'll need to call it in raw_open_common(), so move the function to
    avoid a forward declaration.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 66 +++++++++++++++++++++++++++---------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index ae8190edab..dd7dab07d6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -425,6 +425,39 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
     }
 }
 
+static int check_hdev_writable(BDRVRawState *s)
+{
+#if defined(BLKROGET)
+    /* Linux block devices can be configured "read-only" using blockdev(8).
+     * This is independent of device node permissions and therefore open(2)
+     * with O_RDWR succeeds.  Actual writes fail with EPERM.
+     *
+     * bdrv_open() is supposed to fail if the disk is read-only.  Explicitly
+     * check for read-only block devices so that Linux block devices behave
+     * properly.
+     */
+    struct stat st;
+    int readonly = 0;
+
+    if (fstat(s->fd, &st)) {
+        return -errno;
+    }
+
+    if (!S_ISBLK(st.st_mode)) {
+        return 0;
+    }
+
+    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
+        return -errno;
+    }
+
+    if (readonly) {
+        return -EACCES;
+    }
+#endif /* defined(BLKROGET) */
+    return 0;
+}
+
 static void raw_parse_flags(int bdrv_flags, int *open_flags, bool has_writers)
 {
     bool read_write = false;
@@ -3323,39 +3356,6 @@ static int hdev_probe_device(const char *filename)
     return 0;
 }
 
-static int check_hdev_writable(BDRVRawState *s)
-{
-#if defined(BLKROGET)
-    /* Linux block devices can be configured "read-only" using blockdev(8).
-     * This is independent of device node permissions and therefore open(2)
-     * with O_RDWR succeeds.  Actual writes fail with EPERM.
-     *
-     * bdrv_open() is supposed to fail if the disk is read-only.  Explicitly
-     * check for read-only block devices so that Linux block devices behave
-     * properly.
-     */
-    struct stat st;
-    int readonly = 0;
-
-    if (fstat(s->fd, &st)) {
-        return -errno;
-    }
-
-    if (!S_ISBLK(st.st_mode)) {
-        return 0;
-    }
-
-    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
-        return -errno;
-    }
-
-    if (readonly) {
-        return -EACCES;
-    }
-#endif /* defined(BLKROGET) */
-    return 0;
-}
-
 static void hdev_parse_filename(const char *filename, QDict *options,
                                 Error **errp)
 {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14883.37026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9l-0007Ip-KO; Thu, 29 Oct 2020 21:08:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14883.37026; Thu, 29 Oct 2020 21:08:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9l-0007Ih-HE; Thu, 29 Oct 2020 21:08:25 +0000
Received: by outflank-mailman (input) for mailman id 14883;
 Thu, 29 Oct 2020 21:08:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF9k-0007IY-JQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ac443ab2-057f-4730-b1b2-fb7e2f719f93;
 Thu, 29 Oct 2020 21:08:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9j-0007TC-K7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9j-0002RJ-JK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF9k-0007IY-JQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:24 +0000
X-Inumbo-ID: ac443ab2-057f-4730-b1b2-fb7e2f719f93
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ac443ab2-057f-4730-b1b2-fb7e2f719f93;
	Thu, 29 Oct 2020 21:08:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UlveKuRhlYxyzk1M79dEeBoSNFRqEYU1P4rWl8t/x2g=; b=zAgqwa6CdnB9VSwBNISsP0BzJQ
	5YkZCE0XKAyjS4PrfAAdqhq7l/dz623GAUc4s8Ss64+29SAUmnHpnN1iX1iQmbESfJYPRCkz8gixH
	gU2EU1RGNlN7SmXCXGQo+le1CVN9QbJGdBMIvJ9vURLHC5S8FgcnQ3dCr8vmCz1DX9hA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9j-0007TC-K7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9j-0002RJ-JK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Fix check_hdev_writable() with auto-read-only
Message-Id: <E1kYF9j-0002RJ-JK@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:23 +0000

commit bca5283bd4a086bcbfaddc024491a400cc9b2fa9
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:25 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Fix check_hdev_writable() with auto-read-only
    
    For Linux block devices, being able to open the device read-write
    doesn't necessarily mean that the device is actually writable (one
    example is a read-only LV, as you get with lvchange -pr <device>). We
    have check_hdev_writable() to check this condition and fail opening the
    image read-write if it's not actually writable.
    
    However, this check doesn't take auto-read-only into account, but
    results in a hard failure instead of downgrading to read-only where
    possible.
    
    Fix this and do the writable check not based on BDRV_O_RDWR, but only
    when this actually results in opening the file read-write. A second
    check is inserted in raw_reconfigure_getfd() to have the same check when
    dynamic auto-read-only upgrades an image file from read-only to
    read-write.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index dd7dab07d6..996e45ab95 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -425,7 +425,7 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
     }
 }
 
-static int check_hdev_writable(BDRVRawState *s)
+static int check_hdev_writable(int fd)
 {
 #if defined(BLKROGET)
     /* Linux block devices can be configured "read-only" using blockdev(8).
@@ -439,7 +439,7 @@ static int check_hdev_writable(BDRVRawState *s)
     struct stat st;
     int readonly = 0;
 
-    if (fstat(s->fd, &st)) {
+    if (fstat(fd, &st)) {
         return -errno;
     }
 
@@ -447,7 +447,7 @@ static int check_hdev_writable(BDRVRawState *s)
         return 0;
     }
 
-    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
+    if (ioctl(fd, BLKROGET, &readonly) < 0) {
         return -errno;
     }
 
@@ -642,6 +642,15 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     }
     s->fd = fd;
 
+    /* Check s->open_flags rather than bdrv_flags due to auto-read-only */
+    if (s->open_flags & O_RDWR) {
+        ret = check_hdev_writable(s->fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "The device is not writable");
+            goto fail;
+        }
+    }
+
     s->perm = 0;
     s->shared_perm = BLK_PERM_ALL;
 
@@ -1034,6 +1043,15 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
         }
     }
 
+    if (fd != -1 && (*open_flags & O_RDWR)) {
+        ret = check_hdev_writable(fd);
+        if (ret < 0) {
+            qemu_close(fd);
+            error_setg_errno(errp, -ret, "The device is not writable");
+            return -1;
+        }
+    }
+
     return fd;
 }
 
@@ -3478,15 +3496,6 @@ hdev_open_Mac_error:
     /* Since this does ioctl the device must be already opened */
     bs->sg = hdev_is_sg(bs);
 
-    if (flags & BDRV_O_RDWR) {
-        ret = check_hdev_writable(s);
-        if (ret < 0) {
-            raw_close(bs);
-            error_setg_errno(errp, -ret, "The device is not writable");
-            return ret;
-        }
-    }
-
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14884.37030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9v-0007K7-Lw; Thu, 29 Oct 2020 21:08:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14884.37030; Thu, 29 Oct 2020 21:08:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYF9v-0007Jy-In; Thu, 29 Oct 2020 21:08:35 +0000
Received: by outflank-mailman (input) for mailman id 14884;
 Thu, 29 Oct 2020 21:08:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYF9u-0007Jo-J9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4abcbd10-9b3f-448c-afdb-438c44cc9335;
 Thu, 29 Oct 2020 21:08:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9t-0007TJ-O8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYF9t-0002S8-Mw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYF9u-0007Jo-J9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:34 +0000
X-Inumbo-ID: 4abcbd10-9b3f-448c-afdb-438c44cc9335
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4abcbd10-9b3f-448c-afdb-438c44cc9335;
	Thu, 29 Oct 2020 21:08:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E0eN7+hjxcHvVJIPe1zb+Rye53ecoMx2bYgBQnK0oT0=; b=R8glf34crdY1CLPGgkO0EH5qqv
	qdr632M2KoJcsnMc0i6NJHguH7WR1oYm8hf3jvRk64YXmI3JQSXKElr1S91pZL7xURrTNCaP1r+6w
	y2X0YmnzY2Tgcjw9vsDyE4ehHZHUGtc7GJhjVLMjhSZIXDaQht582iCuco5oKAEJnhFE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9t-0007TJ-O8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYF9t-0002S8-Mw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Fix leaked fd in raw_open_common() error path
Message-Id: <E1kYF9t-0002S8-Mw@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:33 +0000

commit a8c5cf27c945d392edd85b0b0c64cd5c52cae658
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:26 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Fix leaked fd in raw_open_common() error path
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-4-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index 996e45ab95..8cc39a1ef6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -773,6 +773,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     }
     ret = 0;
 fail:
+    if (ret < 0 && s->fd != -1) {
+        qemu_close(s->fd);
+    }
     if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) {
         unlink(filename);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14885.37034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFA5-0007LI-Nk; Thu, 29 Oct 2020 21:08:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14885.37034; Thu, 29 Oct 2020 21:08:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFA5-0007LA-KR; Thu, 29 Oct 2020 21:08:45 +0000
Received: by outflank-mailman (input) for mailman id 14885;
 Thu, 29 Oct 2020 21:08:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFA4-0007L4-Rf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 53681e7a-e2d8-4bc0-b62d-1a54c08f93f6;
 Thu, 29 Oct 2020 21:08:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFA3-0007TS-Uy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFA3-0002Sm-S2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFA4-0007L4-Rf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:44 +0000
X-Inumbo-ID: 53681e7a-e2d8-4bc0-b62d-1a54c08f93f6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 53681e7a-e2d8-4bc0-b62d-1a54c08f93f6;
	Thu, 29 Oct 2020 21:08:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YZM57Lb0ZMNh4NNX1hwpWMFCZrkQmXEDtDIbe/KaO7Q=; b=oR6b+kU3A7+QQyqKqzuktNK41+
	GWGJb+MjvHkprqshBLZtVHD7GWKJWFjtv/P8jE5Ew8sJcOxO5H7b4YqyaSDbRGPLGxMyW6mpX7Jc+
	fcThQCtGrwsQOohGWkFcRzIpHtTLrTQ1IE24iHSxJ7zOySx8ONiMCqI/r+TrA/Lo50Bk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFA3-0007TS-Uy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFA3-0002Sm-S2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYFA3-0002Sm-S2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:43 +0000

commit 920d213cb22a4b8d1a7c941da1955b45c5fd9a09
Merge: b7bda69c4ef46c57480f6e378923f5215b122778 a8c5cf27c945d392edd85b0b0c64cd5c52cae658
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 14:58:13 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 17 14:58:13 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Fix read-only Linux block devices with auto-read-only
    - Require aligned image size with O_DIRECT to avoid assertion failure
    - Allow byte-aligned direct I/O on NFS instead of guessing 4k alignment
    - Fix nbd_export_close_all() crash
    - Fix race in iotests case 030
    - qemu-img resize: Require --shrink for shrinking all image formats
    - crypto: use a stronger private key for tests
    - Remove VXHS block device
    - MAINTAINERS: vvfat: set status to odd fixes
    
    # gpg: Signature made Fri 17 Jul 2020 13:31:18 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      file-posix: Fix leaked fd in raw_open_common() error path
      file-posix: Fix check_hdev_writable() with auto-read-only
      file-posix: Move check_hdev_writable() up
      file-posix: Allow byte-aligned O_DIRECT with NFS
      block: Require aligned image size to avoid assertion failure
      iotests: test shutdown when bitmap is exported through NBD
      nbd: make nbd_export_close_all() synchronous
      iotests/030: Reduce job speed to make race less likely
      crypto: use a stronger private key for tests
      qemu-img resize: Require --shrink for shrinking all image formats
      Remove VXHS block device
      vvfat: set status to odd fixes
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                      |   2 +-
 block.c                          |  16 ++
 block/Makefile.objs              |   2 -
 block/file-posix.c               | 122 +++++---
 block/trace-events               |  17 --
 block/vxhs.c                     | 587 ---------------------------------------
 configure                        |  39 ---
 docs/system/deprecated.rst       |   8 +
 nbd/server.c                     |   8 +
 qapi/block-core.json             |  22 +-
 qemu-img.c                       |  14 +-
 tests/crypto-tls-x509-helpers.c  |  59 ++--
 tests/qemu-iotests/017           |   1 -
 tests/qemu-iotests/029           |   1 -
 tests/qemu-iotests/030           |   2 +-
 tests/qemu-iotests/073           |   1 -
 tests/qemu-iotests/114           |   1 -
 tests/qemu-iotests/130           |   1 -
 tests/qemu-iotests/134           |   1 -
 tests/qemu-iotests/156           |   1 -
 tests/qemu-iotests/158           |   1 -
 tests/qemu-iotests/282           |   1 -
 tests/qemu-iotests/299           |  65 +++++
 tests/qemu-iotests/299.out       |  10 +
 tests/qemu-iotests/check         |  10 -
 tests/qemu-iotests/common.filter |   1 -
 tests/qemu-iotests/common.rc     |  33 ---
 tests/qemu-iotests/common.tls    |  57 ++--
 tests/qemu-iotests/group         |   1 +
 29 files changed, 273 insertions(+), 811 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:08:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14886.37038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAG-0007Mp-SH; Thu, 29 Oct 2020 21:08:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14886.37038; Thu, 29 Oct 2020 21:08:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAG-0007Mh-PA; Thu, 29 Oct 2020 21:08:56 +0000
Received: by outflank-mailman (input) for mailman id 14886;
 Thu, 29 Oct 2020 21:08:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFAF-0007MW-15
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8fe5081f-2001-414c-8083-662534892e55;
 Thu, 29 Oct 2020 21:08:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAE-0007Te-95
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAE-0002Tc-8P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFAF-0007MW-15
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:55 +0000
X-Inumbo-ID: 8fe5081f-2001-414c-8083-662534892e55
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8fe5081f-2001-414c-8083-662534892e55;
	Thu, 29 Oct 2020 21:08:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KqDeFv38CWR5ak7+TNuRB4sT5d/IcXcm8+fUYw2PV98=; b=hj0acUqI6OdNs05FVNMUAIO4y5
	q3CjuqfFAUL5LA23HfL/8bZku9ZlPIMZa73kl8ZsRdB6n/qTJYRVHuow4LT/5flAu+8j8s7oTyQWz
	x8JGG2kV3vd9Ll/r3sXkpOa/Rha5EcKsOM0ZT0utAIeieYlUcDsbX4aMKlxiEws5W1JY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAE-0007Te-95
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAE-0002Tc-8P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:08:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/s390x: fix vfio-ccw type
Message-Id: <E1kYFAE-0002Tc-8P@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:08:54 +0000

commit 9ece07d7a3941eeb845a6f000a191bba19557231
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Thu Jul 16 16:50:31 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 17 12:56:22 2020 +0200

    docs/s390x: fix vfio-ccw type
    
    Fix the type name in the mdevctl example.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Eric Farman <farman@linux.ibm.com>
    Message-Id: <20200716145031.771476-1-cohuck@redhat.com>
---
 docs/system/s390x/vfio-ccw.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/system/s390x/vfio-ccw.rst b/docs/system/s390x/vfio-ccw.rst
index 8f65442c0f..41e0bad5b4 100644
--- a/docs/system/s390x/vfio-ccw.rst
+++ b/docs/system/s390x/vfio-ccw.rst
@@ -29,7 +29,7 @@ automatically, use
 
    [root@host ~]# driverctl -b css set-override 0.0.0313 vfio_ccw
    [root@host ~]# mdevctl define -u 7e270a25-e163-4922-af60-757fc8ed48c6 \
-                  -p 0.0.0313 -t vfio-ccw_io -a
+                  -p 0.0.0313 -t vfio_ccw-io -a
 
 If using ``mdevctl`` is not possible or wanted, follow the manual procedure
 below.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14887.37043 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAQ-0007Oc-Tz; Thu, 29 Oct 2020 21:09:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14887.37043; Thu, 29 Oct 2020 21:09:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAQ-0007OS-Qb; Thu, 29 Oct 2020 21:09:06 +0000
Received: by outflank-mailman (input) for mailman id 14887;
 Thu, 29 Oct 2020 21:09:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFAP-0007OF-4K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 51daf399-f701-400d-8409-8a9fd4551e1e;
 Thu, 29 Oct 2020 21:09:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAO-0007V7-Cc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAO-0002UZ-Br
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFAP-0007OF-4K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:05 +0000
X-Inumbo-ID: 51daf399-f701-400d-8409-8a9fd4551e1e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 51daf399-f701-400d-8409-8a9fd4551e1e;
	Thu, 29 Oct 2020 21:09:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Duut5aJcUXOabewATJPEOawhC6f/P7tthGVztnmoWaQ=; b=CNcLf6NgILBQe0tiGscwfibGVj
	H4ncH2TNI9kvFJYy/Yqq1LZZ86Ih9NMERMkwiXtti9H4kVMfkereeRdequN6AdnBFg50FkC/UovoH
	MdW4GbzuiQtPYZ368i42bxLfBNCdKxxiRNLhKU8jh7xKxLvJexLyVpWJuC2Iekjj2dSU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAO-0007V7-Cc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAO-0002UZ-Br
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200717' into staging
Message-Id: <E1kYFAO-0002UZ-Br@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:04 +0000

commit 97f750becac33e3d3e446d3ff4ae9af2577b7877
Merge: 920d213cb22a4b8d1a7c941da1955b45c5fd9a09 9ece07d7a3941eeb845a6f000a191bba19557231
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 17:27:34 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 17:27:34 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200717' into staging
    
    Fix typo in newly added documentation.
    
    # gpg: Signature made Fri 17 Jul 2020 14:54:20 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200717:
      docs/s390x: fix vfio-ccw type
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/system/s390x/vfio-ccw.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14888.37046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAa-0007Pn-VP; Thu, 29 Oct 2020 21:09:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14888.37046; Thu, 29 Oct 2020 21:09:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAa-0007Pd-SF; Thu, 29 Oct 2020 21:09:16 +0000
Received: by outflank-mailman (input) for mailman id 14888;
 Thu, 29 Oct 2020 21:09:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFAZ-0007PT-IV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9b2bc7c4-528c-4f56-aa86-7fc4f5d6f8d0;
 Thu, 29 Oct 2020 21:09:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAY-0007VI-NW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAY-0002VP-Mo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFAZ-0007PT-IV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:15 +0000
X-Inumbo-ID: 9b2bc7c4-528c-4f56-aa86-7fc4f5d6f8d0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9b2bc7c4-528c-4f56-aa86-7fc4f5d6f8d0;
	Thu, 29 Oct 2020 21:09:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MWtDk4U/a24b0YuqQXpZse1p/hbOVWntBeMAp25QR7g=; b=3kaLygDLMvHYbnY2A6+ewp2A5Y
	AVqcKIAiBPzV5jQf1oQq+fQm/dNZU0xqL7vOYScKQV0CEAmLMiWtLVoHQEDYfmBzoNH05cWzsKpjl
	nfhGKs3DP18QJG5KHNJI6TfdtGqqDXkhEQknlF1BR92XGHn+l/K4d215AfNGYAr4Uajk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAY-0007VI-NW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAY-0002VP-Mo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: fix add_bitmaps_to_list
Message-Id: <E1kYFAY-0002VP-Mo@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:14 +0000

commit 7cb015197b383a62f5729d2c92b1050db0185c1c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Fri Jun 26 16:06:58 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Fri Jul 17 08:18:51 2020 -0500

    migration/block-dirty-bitmap: fix add_bitmaps_to_list
    
    We shouldn't fail when finding an unnamed bitmap in a unnamed node or
    node with auto-generated node name, as bitmap migration ignores such
    bitmaps in the first place.
    
    Fixes: 82640edb88faa
    Fixes: 4ff5cc121b089
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200626130658.76498-1-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: commit message grammar tweaks]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 47bc0f650c..b0dbf9eeed 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -274,7 +274,11 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
     DirtyBitmapMigBitmapState *dbms;
     Error *local_err = NULL;
 
-    bitmap = bdrv_dirty_bitmap_first(bs);
+    FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
+        if (bdrv_dirty_bitmap_name(bitmap)) {
+            break;
+        }
+    }
     if (!bitmap) {
         return 0;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14889.37050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAl-0007R3-0h; Thu, 29 Oct 2020 21:09:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14889.37050; Thu, 29 Oct 2020 21:09:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAk-0007Qu-Tu; Thu, 29 Oct 2020 21:09:26 +0000
Received: by outflank-mailman (input) for mailman id 14889;
 Thu, 29 Oct 2020 21:09:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFAj-0007Qk-In
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 354f4151-9064-43c2-a5fc-187c62e7ac12;
 Thu, 29 Oct 2020 21:09:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAi-0007VR-Rk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAi-0002W9-QR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFAj-0007Qk-In
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:25 +0000
X-Inumbo-ID: 354f4151-9064-43c2-a5fc-187c62e7ac12
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 354f4151-9064-43c2-a5fc-187c62e7ac12;
	Thu, 29 Oct 2020 21:09:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9onIOCMCORfctfSK6KaniPgS8acjHSytsYzRGY7I4Yo=; b=Y00Le0+ifgrCByi17jrhIi4X/O
	8Wtgsiqs//zgFwxQgzcNwKkaVDf4misnGmU+OZXkU8wH9zNp6olrgcWiIEr80oRVUoLflPp9gtT+D
	fFT82sTUkzfuz8vuAtp0idJ31SA+7TINQzQEM7M7kw9s59UZAL8tHAWY1inQXeQRGNmo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAi-0007VR-Rk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAi-0002W9-QR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-17' into staging
Message-Id: <E1kYFAi-0002W9-QR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:24 +0000

commit 939ab64b400b9bec4b59795a87817784093e1acd
Merge: 97f750becac33e3d3e446d3ff4ae9af2577b7877 7cb015197b383a62f5729d2c92b1050db0185c1c
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 22:24:34 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 22:24:34 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-17' into staging
    
    bitmaps patches for 2020-07-17
    
    - improve corner-case of bitmap migration
    
    # gpg: Signature made Fri 17 Jul 2020 16:10:07 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-07-17:
      migration/block-dirty-bitmap: fix add_bitmaps_to_list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 migration/block-dirty-bitmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14890.37054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAv-0007SF-2K; Thu, 29 Oct 2020 21:09:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14890.37054; Thu, 29 Oct 2020 21:09:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFAu-0007S8-VU; Thu, 29 Oct 2020 21:09:36 +0000
Received: by outflank-mailman (input) for mailman id 14890;
 Thu, 29 Oct 2020 21:09:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFAt-0007S1-Vd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 01260785-9a7e-4256-b2ef-09b2173ecd9b;
 Thu, 29 Oct 2020 21:09:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAt-0007VV-7b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFAt-0002Xd-6f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFAt-0007S1-Vd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:36 +0000
X-Inumbo-ID: 01260785-9a7e-4256-b2ef-09b2173ecd9b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 01260785-9a7e-4256-b2ef-09b2173ecd9b;
	Thu, 29 Oct 2020 21:09:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7SbmennroPgpdq9fJlcLspRMLTakDN/rPg+fe8SWHZU=; b=tA6QQBhzz5DqSd+aocledPUlEJ
	Fr4iI4ZlkfXNkpfVmx6pBexPlEe4nq6K5TgtnEAyeAo5Iqyph9lvQB4i4ZETVgm26LniH0TPfrnBI
	mgwBCsWkA1bgOCudyyFRS/XruI0sClLy7kTdH0fCvKRgBlbFn7dTNheGARfnWQgApJ/g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAt-0007VV-7b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFAt-0002Xd-6f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ipmi: Add man page pieces for the IPMI PCI devices
Message-Id: <E1kYFAt-0002Xd-6f@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:35 +0000

commit 323679da77b2fd4dc9be3731ecac96613beea4f1
Author:     Corey Minyard <cminyard@mvista.com>
AuthorDate: Mon Sep 23 13:50:33 2019 -0500
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: Add man page pieces for the IPMI PCI devices
    
    This was forgotten when the devices were added.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 qemu-options.hx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 65147ad971..fb31fe3df6 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -876,6 +876,15 @@ SRST
 ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
     Like the KCS interface, but defines a BT interface. The default port
     is 0xe4 and the default interrupt is 5.
+
+``-device pci-ipmi-kcs,bmc=id``
+    Add a KCS IPMI interafce on the PCI bus.
+
+    ``bmc=id``
+        The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
+
+``-device pci-ipmi-bt,bmc=id``
+    Like the KCS interface, but defines a BT interface on the PCI bus.
 ERST
 
 DEF("name", HAS_ARG, QEMU_OPTION_name,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14891.37058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFB9-0007Th-4C; Thu, 29 Oct 2020 21:09:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14891.37058; Thu, 29 Oct 2020 21:09:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFB9-0007TZ-1F; Thu, 29 Oct 2020 21:09:51 +0000
Received: by outflank-mailman (input) for mailman id 14891;
 Thu, 29 Oct 2020 21:09:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFB7-0007TT-AZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 99b683d4-4df9-44d5-858b-765c46ed8933;
 Thu, 29 Oct 2020 21:09:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFB3-0007Vg-BJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFB3-0002Yc-AW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFB7-0007TT-AZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:49 +0000
X-Inumbo-ID: 99b683d4-4df9-44d5-858b-765c46ed8933
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 99b683d4-4df9-44d5-858b-765c46ed8933;
	Thu, 29 Oct 2020 21:09:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZS2pG+oG9R1TZ4GGLFqCxkfDkctZyUTbjR0507jBDH0=; b=Mc9UCy0ZgpoHS+j/QxZ9hsM4kG
	0ypnTlVkxK57cSxpy8nn1XgNw0y2UXVkoRRn83sXTX/TeOkmgpK2n8owjWD34WoxXALHEbpztabd5
	UHc7iFXBJYuGFzImADQfXHqB7cYe43+TRxEx8GnwqnKrS0pMxDiCWLemISQFp1TElv7s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFB3-0007Vg-BJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFB3-0002Yc-AW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ipmi: Fix a man page entry
Message-Id: <E1kYFB3-0002Yc-AW@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:45 +0000

commit 789101b73d93ab11f37a44c24fff44336f041345
Author:     Corey Minyard <cminyard@mvista.com>
AuthorDate: Fri Jul 17 11:37:02 2020 -0500
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: Fix a man page entry
    
    The line was too long, and some of the entries were wrong (fur instead
    of fru).  Just use the prop=val thing tha other entries use.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index fb31fe3df6..708583b4ce 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -806,7 +806,7 @@ SRST
 
     Some drivers are:
 
-``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]``
+``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]``
     Add an IPMI BMC. This is a simulation of a hardware management
     interface processor that normally sits on a system. It provides a
     watchdog and the ability to reset and power control the system. You
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:09:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:09:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14892.37062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBG-0007Ui-5x; Thu, 29 Oct 2020 21:09:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14892.37062; Thu, 29 Oct 2020 21:09:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBG-0007Ua-2d; Thu, 29 Oct 2020 21:09:58 +0000
Received: by outflank-mailman (input) for mailman id 14892;
 Thu, 29 Oct 2020 21:09:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFBE-0007US-Se
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 05c7312d-b469-4684-8e61-ccf02dbf43eb;
 Thu, 29 Oct 2020 21:09:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBD-0007Vn-Ez
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBD-0002ZT-EB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFBE-0007US-Se
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:56 +0000
X-Inumbo-ID: 05c7312d-b469-4684-8e61-ccf02dbf43eb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 05c7312d-b469-4684-8e61-ccf02dbf43eb;
	Thu, 29 Oct 2020 21:09:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OnpJmigytP1srsSgM5Gfv8SvlTS5RRpqJQq8IzEdpws=; b=3vEqQEYhtUabi6gHp0vrNDylOQ
	sJuNSQEWzwEcHDe5gdLrCKTJW9RQJ2mNMvUp/eOOVJj4G0AlUzBNq+xJFpt7kOxmx4Ejb4bvNZb6O
	z51h5wAXEobCjd3ROT9+cetRdNpcJDLDMe9eSNgU78If8GYHJCxuhFnJ5zWXCKNNcJ2M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBD-0007Vn-Ez
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBD-0002ZT-EB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:09:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ipmi: add SET_SENSOR_READING command
Message-Id: <E1kYFBD-0002ZT-EB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:09:55 +0000

commit e3f7320caa1cc08a9b752e555b79abd6218c7c7a
Author:     Cédric Le Goater <clg@kaod.org>
AuthorDate: Mon Nov 18 10:24:29 2019 +0100
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: add SET_SENSOR_READING command
    
    SET_SENSOR_READING is a complex IPMI command (see IPMI spec 35.17)
    which enables the host software to set the reading value and the event
    status of sensors supporting it.
    
    Below is a proposal for all the operations (reading, assert, deassert,
    event data) with the following limitations :
    
     - No event are generated for threshold-based sensors.
     - The case in which the BMC needs to generate its own events is not
       supported.
    
    Signed-off-by: Cédric Le Goater <clg@kaod.org>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Message-Id: <20191118092429.16149-1-clg@kaod.org>
    [Moved the break statement for case SENSOR_GEN_EVENT_DATA above the
     closing brace to keep the indention consistent.]
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/ipmi/ipmi_bmc_sim.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 223 insertions(+)

diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index 0b97e04774..f78e92d3d5 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -49,6 +49,7 @@
 #define IPMI_CMD_GET_SENSOR_READING       0x2d
 #define IPMI_CMD_SET_SENSOR_TYPE          0x2e
 #define IPMI_CMD_GET_SENSOR_TYPE          0x2f
+#define IPMI_CMD_SET_SENSOR_READING       0x30
 
 /* #define IPMI_NETFN_APP             0x06 In ipmi.h */
 
@@ -1747,6 +1748,227 @@ static void get_sensor_type(IPMIBmcSim *ibs,
     rsp_buffer_push(rsp, sens->evt_reading_type_code);
 }
 
+/*
+ * bytes   parameter
+ *    1    sensor number
+ *    2    operation (see below for bits meaning)
+ *    3    sensor reading
+ *  4:5    assertion states (optional)
+ *  6:7    deassertion states (optional)
+ *  8:10   event data 1,2,3 (optional)
+ */
+static void set_sensor_reading(IPMIBmcSim *ibs,
+                               uint8_t *cmd, unsigned int cmd_len,
+                               RspBuffer *rsp)
+{
+    IPMISensor *sens;
+    uint8_t evd1 = 0;
+    uint8_t evd2 = 0;
+    uint8_t evd3 = 0;
+    uint8_t new_reading = 0;
+    uint16_t new_assert_states = 0;
+    uint16_t new_deassert_states = 0;
+    bool change_reading = false;
+    bool change_assert = false;
+    bool change_deassert = false;
+    enum {
+        SENSOR_GEN_EVENT_NONE,
+        SENSOR_GEN_EVENT_DATA,
+        SENSOR_GEN_EVENT_BMC,
+    } do_gen_event = SENSOR_GEN_EVENT_NONE;
+
+    if ((cmd[2] >= MAX_SENSORS) ||
+            !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {
+        rsp_buffer_set_error(rsp, IPMI_CC_REQ_ENTRY_NOT_PRESENT);
+        return;
+    }
+
+    sens = ibs->sensors + cmd[2];
+
+    /* [1:0] Sensor Reading operation */
+    switch ((cmd[3]) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value to sensor reading byte */
+        new_reading = cmd[4];
+        if (sens->reading != new_reading) {
+            change_reading = true;
+        }
+        break;
+    case 2:
+    case 3:
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /* [3:2] Deassertion bits operation */
+    switch ((cmd[3] >> 2) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value */
+        if (cmd_len > 7) {
+            new_deassert_states = cmd[7];
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (cmd[8] << 8);
+        }
+        break;
+
+    case 2: /* mask on */
+        if (cmd_len > 7) {
+            new_deassert_states = (sens->deassert_states | cmd[7]);
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (sens->deassert_states | (cmd[8] << 8));
+        }
+        break;
+
+    case 3: /* mask off */
+        if (cmd_len > 7) {
+            new_deassert_states = (sens->deassert_states & cmd[7]);
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (sens->deassert_states & (cmd[8] << 8));
+        }
+        break;
+    }
+
+    if (change_deassert && (new_deassert_states == sens->deassert_states)) {
+        change_deassert = false;
+    }
+
+    /* [5:4] Assertion bits operation */
+    switch ((cmd[3] >> 4) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value */
+        if (cmd_len > 5) {
+            new_assert_states = cmd[5];
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (cmd[6] << 8);
+        }
+        break;
+
+    case 2: /* mask on */
+        if (cmd_len > 5) {
+            new_assert_states = (sens->assert_states | cmd[5]);
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (sens->assert_states | (cmd[6] << 8));
+        }
+        break;
+
+    case 3: /* mask off */
+        if (cmd_len > 5) {
+            new_assert_states = (sens->assert_states & cmd[5]);
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (sens->assert_states & (cmd[6] << 8));
+        }
+        break;
+    }
+
+    if (change_assert && (new_assert_states == sens->assert_states)) {
+        change_assert = false;
+    }
+
+    if (cmd_len > 9) {
+        evd1 = cmd[9];
+    }
+    if (cmd_len > 10) {
+        evd2 = cmd[10];
+    }
+    if (cmd_len > 11) {
+        evd3 = cmd[11];
+    }
+
+    /* [7:6] Event Data Bytes operation */
+    switch ((cmd[3] >> 6) & 0x3) {
+    case 0: /*
+             * Don’t use Event Data bytes from this command. BMC will
+             * generate it's own Event Data bytes based on its sensor
+             * implementation.
+             */
+        evd1 = evd2 = evd3 = 0x0;
+        do_gen_event = SENSOR_GEN_EVENT_BMC;
+        break;
+    case 1: /*
+             * Write given values to event data bytes including bits
+             * [3:0] Event Data 1.
+             */
+        do_gen_event = SENSOR_GEN_EVENT_DATA;
+        break;
+    case 2: /*
+             * Write given values to event data bytes excluding bits
+             * [3:0] Event Data 1.
+             */
+        evd1 &= 0xf0;
+        do_gen_event = SENSOR_GEN_EVENT_DATA;
+        break;
+    case 3:
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /*
+     * Event Data Bytes operation and parameter are inconsistent. The
+     * Specs are not clear on that topic but generating an error seems
+     * correct.
+     */
+    if (do_gen_event == SENSOR_GEN_EVENT_DATA && cmd_len < 10) {
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /* commit values */
+    if (change_reading) {
+        sens->reading = new_reading;
+    }
+
+    if (change_assert) {
+        sens->assert_states = new_assert_states;
+    }
+
+    if (change_deassert) {
+        sens->deassert_states = new_deassert_states;
+    }
+
+    /* TODO: handle threshold sensor */
+    if (!IPMI_SENSOR_IS_DISCRETE(sens)) {
+        return;
+    }
+
+    switch (do_gen_event) {
+    case SENSOR_GEN_EVENT_DATA: {
+        unsigned int bit = evd1 & 0xf;
+        uint16_t mask = (1 << bit);
+
+        if (sens->assert_states & mask & sens->assert_enable) {
+            gen_event(ibs, cmd[2], 0, evd1, evd2, evd3);
+        }
+
+        if (sens->deassert_states & mask & sens->deassert_enable) {
+            gen_event(ibs, cmd[2], 1, evd1, evd2, evd3);
+        }
+        break;
+    }
+    case SENSOR_GEN_EVENT_BMC:
+        /*
+         * TODO: generate event and event data bytes depending on the
+         * sensor
+         */
+        break;
+    case SENSOR_GEN_EVENT_NONE:
+        break;
+    }
+}
 
 static const IPMICmdHandler chassis_cmds[] = {
     [IPMI_CMD_GET_CHASSIS_CAPABILITIES] = { chassis_capabilities },
@@ -1768,6 +1990,7 @@ static const IPMICmdHandler sensor_event_cmds[] = {
     [IPMI_CMD_GET_SENSOR_READING] = { get_sensor_reading, 3 },
     [IPMI_CMD_SET_SENSOR_TYPE] = { set_sensor_type, 5 },
     [IPMI_CMD_GET_SENSOR_TYPE] = { get_sensor_type, 3 },
+    [IPMI_CMD_SET_SENSOR_READING] = { set_sensor_reading, 5 },
 };
 static const IPMINetfn sensor_event_netfn = {
     .cmd_nums = ARRAY_SIZE(sensor_event_cmds),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14893.37066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBT-0008Bt-A6; Thu, 29 Oct 2020 21:10:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14893.37066; Thu, 29 Oct 2020 21:10:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBT-0008Bl-75; Thu, 29 Oct 2020 21:10:11 +0000
Received: by outflank-mailman (input) for mailman id 14893;
 Thu, 29 Oct 2020 21:10:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFBS-0008Bc-3n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ee0436b4-06ef-43d1-8294-82c4f3a22617;
 Thu, 29 Oct 2020 21:10:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBN-0007Wb-Iv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBN-0002aU-IE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFBS-0008Bc-3n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:10 +0000
X-Inumbo-ID: ee0436b4-06ef-43d1-8294-82c4f3a22617
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ee0436b4-06ef-43d1-8294-82c4f3a22617;
	Thu, 29 Oct 2020 21:10:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9LUV8UyegQXIMyMPLvEbr1yrLF66YUxz+Imo3jXKqiM=; b=KpKtlCOoOP3Bk3pzjI5MeCsfEL
	Ir/L+kix3y0AYTcPbe25BH0q5hB7uRaPxYXfwlsymCd7Xk0QWLxZy9MwuGdaQzhH+vHlj84oh5GWL
	VN9ENtpHh6VD7O9ZXOdZndWeJJXtsvEWhPvr/tB6hFnmRkXJKRlRk/ncTJF/7OmXZka0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBN-0007Wb-Iv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBN-0002aU-IE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-ipmi-5' into staging
Message-Id: <E1kYFBN-0002aU-IE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:05 +0000

commit b4421193299c09dfe690ec93c9b4713ed710aa3e
Merge: 939ab64b400b9bec4b59795a87817784093e1acd e3f7320caa1cc08a9b752e555b79abd6218c7c7a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 23:59:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 23:59:03 2020 +0100

    Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-ipmi-5' into staging
    
    Man page update and new set sensor command
    
    Some minor man page updates for fairly obvious things.
    
    The set sensor command addition has been in the Power group's tree for a
    long time and I have neglected to submit it.
    
    -corey
    
    # gpg: Signature made Fri 17 Jul 2020 17:45:32 BST
    # gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
    # gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
    # gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81
    
    * remotes/cminyard/tags/for-qemu-ipmi-5:
      ipmi: add SET_SENSOR_READING command
      ipmi: Fix a man page entry
      ipmi: Add man page pieces for the IPMI PCI devices
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ipmi/ipmi_bmc_sim.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-options.hx        |  11 ++-
 2 files changed, 233 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14894.37070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBa-0008D1-BT; Thu, 29 Oct 2020 21:10:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14894.37070; Thu, 29 Oct 2020 21:10:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBa-0008Cu-8Y; Thu, 29 Oct 2020 21:10:18 +0000
Received: by outflank-mailman (input) for mailman id 14894;
 Thu, 29 Oct 2020 21:10:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFBY-0008Cl-Ke
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 31e251a0-f10c-402d-b6e4-7fc6e136103e;
 Thu, 29 Oct 2020 21:10:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBX-0007Wl-UJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBX-0002ba-Ta
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFBY-0008Cl-Ke
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:16 +0000
X-Inumbo-ID: 31e251a0-f10c-402d-b6e4-7fc6e136103e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 31e251a0-f10c-402d-b6e4-7fc6e136103e;
	Thu, 29 Oct 2020 21:10:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JesLarX4VqR3gaY9j0chKxQremrcrzD+KaS2G0xvLAc=; b=HwHdU9sNidh/yQOkndjOxNGAG9
	hL5lxJFQttJaZfe+tmWcWmXwBujXFqElcA9zxwarfFsqdke/ywiGpbqPWj9pqdITkIc+NYga3oSBs
	pDoEbSC4nzdIPPcntX/8g2AdkcKXSdLLfBlkT89k2Bum6xloGTHEvnx4B0rccfuUHsLA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBX-0007Wl-UJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBX-0002ba-Ta
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tcg: Save/restore vecop_list around minmax fallback
Message-Id: <E1kYFBX-0002ba-Ta@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:15 +0000

commit 69c918d2ef319ac63cd759c527debc2a2bdf3a0c
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Tue Jun 9 16:32:09 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Thu Jul 16 13:09:22 2020 -0700

    tcg: Save/restore vecop_list around minmax fallback
    
    Forgetting this asserts when tcg_gen_cmp_vec is called from
    within tcg_gen_cmpsel_vec.
    
    Fixes: 72b4c792c7a
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg-op-vec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c
index f784517d84..ed6fb55fe1 100644
--- a/tcg/tcg-op-vec.c
+++ b/tcg/tcg-op-vec.c
@@ -657,7 +657,9 @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_vec a,
                       TCGv_vec b, TCGOpcode opc, TCGCond cond)
 {
     if (!do_op3(vece, r, a, b, opc)) {
+        const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL);
         tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b);
+        tcg_swap_vecop_list(hold_list);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14895.37074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBl-0008Eh-DE; Thu, 29 Oct 2020 21:10:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14895.37074; Thu, 29 Oct 2020 21:10:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBl-0008EZ-AF; Thu, 29 Oct 2020 21:10:29 +0000
Received: by outflank-mailman (input) for mailman id 14895;
 Thu, 29 Oct 2020 21:10:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFBj-0008EN-JE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 544b177e-f443-466f-b195-3b666ac7c2da;
 Thu, 29 Oct 2020 21:10:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBi-0007X1-2S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBi-0002cd-14
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFBj-0008EN-JE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:27 +0000
X-Inumbo-ID: 544b177e-f443-466f-b195-3b666ac7c2da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 544b177e-f443-466f-b195-3b666ac7c2da;
	Thu, 29 Oct 2020 21:10:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SwKmVVvVU7P7YruGlonOqUGYvr6Yyf21EWUU06XpwDg=; b=s6bGnES0IhrG0xqMwf+v4JGKWE
	0kLWeLNMcNSTnejN3NBYv8eKx/s/qtGz67SsPsXQ+1o325zMg2ioD4UE86jo3qH1wBvyNpZiQ/QcB
	VZgXp19IIaal1NDh0mxCHTu58bm/TNGhOadhfatpocC/4FpFlMCt7Fse3W2ggXYoV22Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBi-0007X1-2S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBi-0002cd-14
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tcg/cpu-exec: precise single-stepping after an exception
Message-Id: <E1kYFBi-0002cd-14@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:26 +0000

commit a7ba744f4082abbd3e36a9265dd1682ad0980477
Author:     Luc Michel <luc.michel@greensocs.com>
AuthorDate: Thu Jul 16 21:39:47 2020 +0200
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Thu Jul 16 14:08:29 2020 -0700

    tcg/cpu-exec: precise single-stepping after an exception
    
    When single-stepping with a debugger attached to QEMU, and when an
    exception is raised, the debugger misses the first instruction after the
    exception:
    
    $ qemu-system-aarch64 -M virt -display none -cpu cortex-a53 -s -S
    
    $ aarch64-linux-gnu-gdb
    GNU gdb (GDB) 9.2
    [...]
    (gdb) tar rem :1234
    Remote debugging using :1234
    warning: No executable has been specified and target does not support
    determining executable automatically.  Try using the "file" command.
    0x0000000000000000 in ?? ()
    (gdb) # writing nop insns to 0x200 and 0x204
    (gdb) set *0x200 = 0xd503201f
    (gdb) set *0x204 = 0xd503201f
    (gdb) # 0x0 address contains 0 which is an invalid opcode.
    (gdb) # The CPU should raise an exception and jump to 0x200
    (gdb) si
    0x0000000000000204 in ?? ()
    
    With this commit, the same run steps correctly on the first instruction
    of the exception vector:
    
    (gdb) si
    0x0000000000000200 in ?? ()
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/757702
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Message-Id: <20200716193947.3058389-1-luc.michel@greensocs.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index d95c4848a4..6a3d3a3cfc 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -504,6 +504,17 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
             cc->do_interrupt(cpu);
             qemu_mutex_unlock_iothread();
             cpu->exception_index = -1;
+
+            if (unlikely(cpu->singlestep_enabled)) {
+                /*
+                 * After processing the exception, ensure an EXCP_DEBUG is
+                 * raised when single-stepping so that GDB doesn't miss the
+                 * next instruction.
+                 */
+                *ret = EXCP_DEBUG;
+                cpu_handle_debug_exception(cpu);
+                return true;
+            }
         } else if (!replay_has_interrupt()) {
             /* give a chance to iothread in replay mode */
             *ret = EXCP_INTERRUPT;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14896.37078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBv-0008Fo-Ei; Thu, 29 Oct 2020 21:10:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14896.37078; Thu, 29 Oct 2020 21:10:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFBv-0008Fg-Bj; Thu, 29 Oct 2020 21:10:39 +0000
Received: by outflank-mailman (input) for mailman id 14896;
 Thu, 29 Oct 2020 21:10:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFBt-0008FW-El
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7e127d0e-dd0c-4b31-a934-e95655651bd4;
 Thu, 29 Oct 2020 21:10:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBs-0007X9-6R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFBs-0002d9-5Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFBt-0008FW-El
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:37 +0000
X-Inumbo-ID: 7e127d0e-dd0c-4b31-a934-e95655651bd4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7e127d0e-dd0c-4b31-a934-e95655651bd4;
	Thu, 29 Oct 2020 21:10:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iaa8wi0bvtNujOAHSG3ZiN4p0+b8ZLP0ncNhfOeEpHA=; b=bn+KzVzPv/h/PvbVTVIhPyYD4s
	NgANyf+mzrSaJHRjwr/i+zBiICcgvFwLvZUJQ2M4LXZDiGhn0GCqd1nF1rOJ6zsHnjCYKCR64qEIU
	9W74UKzAXgaHshtvklsVSI3XTFMSknEwg/70RBikT2QfCGicZFYYiHSZ0lGNY1bYypSM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBs-0007X9-6R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFBs-0002d9-5Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tcg/cpu-exec: precise single-stepping after an interrupt
Message-Id: <E1kYFBs-0002d9-5Z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:36 +0000

commit ba3c35d9c4026361fd380b269dc6def9510b7166
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Fri Jul 17 09:26:59 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 17 11:09:34 2020 -0700

    tcg/cpu-exec: precise single-stepping after an interrupt
    
    When single-stepping with a debugger attached to QEMU, and when an
    interrupt is raised, the debugger misses the first instruction after
    the interrupt.
    
    Tested-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Luc Michel <luc.michel@greensocs.com>
    Buglink: https://bugs.launchpad.net/qemu/+bug/757702
    Message-Id: <20200717163029.2737546-1-richard.henderson@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 6a3d3a3cfc..66d38f9d85 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -588,7 +588,13 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
         else {
             if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
                 replay_interrupt();
-                cpu->exception_index = -1;
+                /*
+                 * After processing the interrupt, ensure an EXCP_DEBUG is
+                 * raised when single-stepping so that GDB doesn't miss the
+                 * next instruction.
+                 */
+                cpu->exception_index =
+                    (cpu->singlestep_enabled ? EXCP_DEBUG : -1);
                 *last_tb = NULL;
             }
             /* The target hook may have updated the 'cpu->interrupt_request';
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14897.37082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFC4-0008Gw-GB; Thu, 29 Oct 2020 21:10:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14897.37082; Thu, 29 Oct 2020 21:10:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFC4-0008Gp-DC; Thu, 29 Oct 2020 21:10:48 +0000
Received: by outflank-mailman (input) for mailman id 14897;
 Thu, 29 Oct 2020 21:10:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFC3-0008Gg-2J
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 09bab88c-4afe-4331-9b48-0c34bb95f483;
 Thu, 29 Oct 2020 21:10:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFC2-0007XH-Ag
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFC2-0002df-9Q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFC3-0008Gg-2J
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:47 +0000
X-Inumbo-ID: 09bab88c-4afe-4331-9b48-0c34bb95f483
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 09bab88c-4afe-4331-9b48-0c34bb95f483;
	Thu, 29 Oct 2020 21:10:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j38kha91hC3R2VHvZD72LIyLnHs58gITTo3rV5RZGds=; b=f9Jdw8DBIKRP8xInX4IffKYClI
	Cu0WVRpGDx1Os1X33JqSlGwtRi7OJGRpuorD7ldTZ9L0hNIp+XYMpMtGzT9uKl691sWXfLNf6lORF
	653QGBOlgBXD3oIjWjn90wnmx+F/7L3FI+v9pzGU7jc8vNzs/h8KJCPojFk+ohMOrgEM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFC2-0007XH-Ag
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFC2-0002df-9Q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200717' into staging
Message-Id: <E1kYFC2-0002df-9Q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:46 +0000

commit 9fc87111005e8903785db40819af66b8f85b8b96
Merge: b4421193299c09dfe690ec93c9b4713ed710aa3e ba3c35d9c4026361fd380b269dc6def9510b7166
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 19 10:29:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 19 10:29:05 2020 +0100

    Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200717' into staging
    
    Fix vector min/max fallback expansion
    Fix singlestep from exception and interrupt
    
    # gpg: Signature made Fri 17 Jul 2020 19:13:32 BST
    # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
    # gpg:                issuer "richard.henderson@linaro.org"
    # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
    # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
    
    * remotes/rth/tags/pull-tcg-20200717:
      tcg/cpu-exec: precise single-stepping after an interrupt
      tcg/cpu-exec: precise single-stepping after an exception
      tcg: Save/restore vecop_list around minmax fallback
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/tcg/cpu-exec.c | 19 ++++++++++++++++++-
 tcg/tcg-op-vec.c     |  2 ++
 2 files changed, 20 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:10:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:10:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14898.37087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCE-0008IO-IP; Thu, 29 Oct 2020 21:10:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14898.37087; Thu, 29 Oct 2020 21:10:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCE-0008IE-F0; Thu, 29 Oct 2020 21:10:58 +0000
Received: by outflank-mailman (input) for mailman id 14898;
 Thu, 29 Oct 2020 21:10:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFCE-0008I4-16
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 04043c87-1c4d-4bd0-81c6-a6d01c2987f5;
 Thu, 29 Oct 2020 21:10:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCC-0007XO-EL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCC-0002eG-DM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFCE-0008I4-16
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:58 +0000
X-Inumbo-ID: 04043c87-1c4d-4bd0-81c6-a6d01c2987f5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 04043c87-1c4d-4bd0-81c6-a6d01c2987f5;
	Thu, 29 Oct 2020 21:10:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sF01kcyzmTMvLf1YYDHESTrF1t4dZaYbXGYXZaruvBw=; b=yT2K1Ujn+qM97pKHr4Hy/Vry2/
	1m7finE63OGPT0prUhrtfeGuqi9adyZgP6F1hli0VfRA/GEpk+CcH2CRxJ6pRBma45xPqBTiPEzOh
	vrbOK6aq1WeTARQdGRpeNPOQQBj2yGAJRaVs7DdCIeyUdRV8UNLKeN5wnmghBXfVaLng=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCC-0007XO-EL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCC-0002eG-DM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:10:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Makefile: Remove config-devices.mak on "make clean"
Message-Id: <E1kYFCC-0002eG-DM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:10:56 +0000

commit d69cda7ed722e445d03e1ace6563bab3a76e023e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 16:25:08 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:02:46 2020 +0100

    Makefile: Remove config-devices.mak on "make clean"
    
    The config-devices.mak files are generated by "make", and so they
    should be deleted by "make clean".
    
    (This is different from config-host.mak and config-all-disas.mak,
    which are created by "configure" and so only deleted by
    "make distclean".)
    
    If we don't delete these files on "make clean", then the build
    tree is left in a state where it has the config-devices.mak
    file but not the config-devices.mak.d file, and make will not
    realize that it needs to rebuild config-devices.mak if, for
    instance, hw/sd/Kconfig changes.
    
    NB: config-all-devices.mak is also generated by "make", but we
    already remove it on "make clean".
    
    Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20200717152508.10272-1-peter.maydell@linaro.org
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 32345c610e..c2120d8d48 100644
--- a/Makefile
+++ b/Makefile
@@ -775,6 +775,7 @@ clean: recurse-clean
 	rm -f storage-daemon/qapi/qapi-gen-timestamp
 	rm -rf qga/qapi-generated
 	rm -f config-all-devices.mak
+	rm -f $(SUBDIR_DEVICES_MAK)
 
 VERSION ?= $(shell cat VERSION)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14899.37090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCO-0008K8-JT; Thu, 29 Oct 2020 21:11:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14899.37090; Thu, 29 Oct 2020 21:11:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCO-0008K0-GU; Thu, 29 Oct 2020 21:11:08 +0000
Received: by outflank-mailman (input) for mailman id 14899;
 Thu, 29 Oct 2020 21:11:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFCN-0008Js-Ll
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1b35979f-78cf-4c47-9b47-37d6a998bf8d;
 Thu, 29 Oct 2020 21:11:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCM-0007Yt-TZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCM-0002g3-SW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFCN-0008Js-Ll
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:07 +0000
X-Inumbo-ID: 1b35979f-78cf-4c47-9b47-37d6a998bf8d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1b35979f-78cf-4c47-9b47-37d6a998bf8d;
	Thu, 29 Oct 2020 21:11:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jyza5/Dxwf+h1dtCXvp0t41AUk38VdmVUxse3exL278=; b=yaVmHfvhCKk9NLxxini0MZDHy6
	0NtVvTn/wlJnPKKtG6yWNKxQ0zvma3vdYmA1iFuwnEbByQa4ETWngzYv25gxblUfQyoR5ux6PG9aZ
	Ut1HhCP3azIJZdHf2bINUvKJhDd13UhLxozIjk7OZkhWYSQtPZHzclr7PDGM46IaPkC8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCM-0007Yt-TZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCM-0002g3-SW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c/Kconfig: Add an entry for the SMBus
Message-Id: <E1kYFCM-0002g3-SW@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:06 +0000

commit ae163b8d9588f02de6a4b6dba310307ba485d4a9
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Dec 31 19:32:07 2019 +0100
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c/Kconfig: Add an entry for the SMBus
    
    The System Management Bus is more or less a derivative of the I2C
    bus, thus the Kconfig entry depends of I2C.
    Not all boards providing an I2C bus support SMBus.
    Use two different Kconfig entries to be able to select I2C without
    selecting SMBus.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20191231183216.6781-6-philmd@redhat.com>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/i2c/Kconfig       | 8 ++++++--
 hw/i2c/Makefile.objs | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index 2bbd395813..09642a6dcb 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -1,9 +1,13 @@
 config I2C
     bool
 
+config SMBUS
+    bool
+    select I2C
+
 config SMBUS_EEPROM
     bool
-    depends on I2C
+    select SMBUS
 
 config VERSATILE_I2C
     bool
@@ -11,7 +15,7 @@ config VERSATILE_I2C
 
 config ACPI_SMBUS
     bool
-    select I2C
+    select SMBUS
 
 config BITBANG_I2C
     bool
diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs
index 6ba976b257..f2c61eaa8b 100644
--- a/hw/i2c/Makefile.objs
+++ b/hw/i2c/Makefile.objs
@@ -1,4 +1,5 @@
-common-obj-$(CONFIG_I2C) += core.o smbus_slave.o smbus_master.o
+common-obj-$(CONFIG_I2C) += core.o
+common-obj-$(CONFIG_SMBUS) += smbus_slave.o smbus_master.o
 common-obj-$(CONFIG_SMBUS_EEPROM) += smbus_eeprom.o
 common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
 common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14900.37094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCY-0008LT-Kz; Thu, 29 Oct 2020 21:11:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14900.37094; Thu, 29 Oct 2020 21:11:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCY-0008LL-I7; Thu, 29 Oct 2020 21:11:18 +0000
Received: by outflank-mailman (input) for mailman id 14900;
 Thu, 29 Oct 2020 21:11:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFCY-0008LD-8Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aa91b083-f91f-4505-b5ea-cfaf11bdc287;
 Thu, 29 Oct 2020 21:11:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCX-0007Z1-0y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCX-0002gx-0E
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFCY-0008LD-8Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:18 +0000
X-Inumbo-ID: aa91b083-f91f-4505-b5ea-cfaf11bdc287
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aa91b083-f91f-4505-b5ea-cfaf11bdc287;
	Thu, 29 Oct 2020 21:11:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YB89lhV/NfE8IBWRSa1oD6jmZGcCAI7yrp83HsIOkIk=; b=tVMQdter5mQqrlPwZxREphRpVA
	FCw6zcaZUEZU7/p4P1wHyq/UI6l9hZucUmtfVTFSm8irgGyEO5O4H+KZGe/rahISPG4OGPSSqgyrK
	RSC68XpXOstmgdZ40mzMlZJfGmh6FkDihE6fsa0PKRvlRwWorHN19shX/NWF1jFPG9ug=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCX-0007Z1-0y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCX-0002gx-0E
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
Message-Id: <E1kYFCX-0002gx-0E@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:17 +0000

commit 7a204cbdc280fd9ab6c8d34a01f112ea5e809f70
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:50 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
    
    All the callers of aspeed_i2c_get_bus() have a AspeedI2CState and
    cast it to a DeviceState with DEVICE(), then aspeed_i2c_get_bus()
    cast the DeviceState to an AspeedI2CState with ASPEED_I2C()...
    
    Simplify aspeed_i2c_get_bus() callers by using AspeedI2CState
    argument.
    
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-2-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c             | 70 ++++++++++++++++++++++-----------------------
 hw/i2c/aspeed_i2c.c         |  3 +-
 include/hw/i2c/aspeed_i2c.h |  2 +-
 3 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 660dcb5414..dc3f44393f 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -385,13 +385,13 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The palmetto platform expects a ds3231 RTC but a ds1338 is
      * enough to provide basic RTC features. Alarms will be missing */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), "ds1338", 0x68);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), 0x50,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50,
                           eeprom_buf);
 
     /* add a TMP423 temperature sensor */
-    dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2),
+    dev = i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2),
                            "tmp423", 0x4c);
     object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
@@ -404,16 +404,16 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
     uint8_t *eeprom_buf = g_malloc0(8 * 1024);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), 0x50,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 0x50,
                           eeprom_buf);
 
     /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7),
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7),
                      TYPE_TMP105, 0x4d);
 
     /* The AST2500 EVB does not have an RTC. Let's pretend that one is
      * plugged on the I2C bus header */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
@@ -428,36 +428,36 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void swift_bmc_i2c_init(AspeedMachineState *bmc)
 {
     AspeedSoCState *soc = &bmc->soc;
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
     /* The swift board expects a pca9551 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
 
     /* The swift board expects an Epson RX8900 RTC but a ds1338 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "ds1338", 0x32);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "pca9552", 0x74);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "pca9552",
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
                      0x74);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", 0x4a);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
 }
 
 static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
@@ -465,32 +465,32 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
 
     /* bus 2 : */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0x49);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
     /* bus 2 : pca9546 @ 0x73 */
 
     /* bus 3 : pca9548 @ 0x70 */
 
     /* bus 4 : */
     uint8_t *eeprom4_54 = g_malloc0(8 * 1024);
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), 0x54,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 4), 0x54,
                           eeprom4_54);
     /* PCA9539 @ 0x76, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", 0x76);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
     /* PCA9539 @ 0x77, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", 0x77);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
 
     /* bus 6 : */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x49);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
     /* bus 6 : pca9546 @ 0x73 */
 
     /* bus 8 : */
     uint8_t *eeprom8_56 = g_malloc0(8 * 1024);
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), 0x56,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 0x56,
                           eeprom8_56);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x60);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x61);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
     /* bus 8 : adc128d818 @ 0x1d */
     /* bus 8 : adc128d818 @ 0x1f */
 
@@ -515,25 +515,25 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO dps310@76 */
     dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
     qdev_prop_set_string(dev, "description", "pca1");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3),
+    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
                           &error_fatal);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "tmp423", 0x4c);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
 
     /* The Witherspoon expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), TYPE_TMP105,
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
                      0x4a);
 
     /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), 0x51,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
     dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
     qdev_prop_set_string(dev, "description", "pca0");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11),
+    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
                           &error_fatal);
     /* Bus 11: TODO ucd90160@64 */
 }
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index fb973a983d..518a3f5c6f 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -959,9 +959,8 @@ static void aspeed_i2c_register_types(void)
 type_init(aspeed_i2c_register_types)
 
 
-I2CBus *aspeed_i2c_get_bus(DeviceState *dev, int busnr)
+I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr)
 {
-    AspeedI2CState *s = ASPEED_I2C(dev);
     AspeedI2CClass *aic = ASPEED_I2C_GET_CLASS(s);
     I2CBus *bus = NULL;
 
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index f1b9e5bf91..243789ae5d 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -93,6 +93,6 @@ typedef struct AspeedI2CClass {
 
 } AspeedI2CClass;
 
-I2CBus *aspeed_i2c_get_bus(DeviceState *dev, int busnr);
+I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr);
 
 #endif /* ASPEED_I2C_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14901.37098 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCj-0008Mv-OC; Thu, 29 Oct 2020 21:11:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14901.37098; Thu, 29 Oct 2020 21:11:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCj-0008Mn-LB; Thu, 29 Oct 2020 21:11:29 +0000
Received: by outflank-mailman (input) for mailman id 14901;
 Thu, 29 Oct 2020 21:11:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFCi-0008Md-DF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 637e7757-55c1-4bf1-9411-3f5954fc829f;
 Thu, 29 Oct 2020 21:11:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCh-0007ZC-4t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCh-0002ht-44
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFCi-0008Md-DF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:28 +0000
X-Inumbo-ID: 637e7757-55c1-4bf1-9411-3f5954fc829f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 637e7757-55c1-4bf1-9411-3f5954fc829f;
	Thu, 29 Oct 2020 21:11:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bfapFJw74ampUpm1I4rz/tTm+x0eiY3vh3lE7bzCv4M=; b=xU6gc4MlpyS/gfHlaFdXBJ+bBD
	YRwbHgAhf5xxQ5PA8kMb81eHfOlC4pAEW12oXQOX1+9cPXx3DhmlEWhys267d4sOuI5YkcQEaeuCd
	TuasLQPcprS99r97h3sjgcyoIToCG3LlfPP/o9WMiMIcVrmhjBnaGGoN+PaVdYoXVcIo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCh-0007ZC-4t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCh-0002ht-44
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
Message-Id: <E1kYFCh-0002ht-44@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:27 +0000

commit db437ca6dfc8db3d91ee75babc4b1fee8c95e9ab
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:51 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
    
    We use "new" names for functions that allocate and initialize
    device objects: pci_new(), isa_new(), usb_new().
    Let's call this one i2c_slave_new(). Since we have to update
    all the callers, also let it return a I2CSlave object.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-3-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      |  4 ++--
 hw/i2c/core.c        | 11 +++++------
 include/hw/i2c/i2c.h |  2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index dc3f44393f..51687fd3b3 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -513,7 +513,7 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO bmp280@77 */
     /* Bus 3: TODO max31785@52 */
     /* Bus 3: TODO dps310@76 */
-    dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
+    dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca1");
     i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
                           &error_fatal);
@@ -531,7 +531,7 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
-    dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
+    dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca0");
     i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
                           &error_fatal);
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index acf34a12d6..144786f17a 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -267,13 +267,13 @@ const VMStateDescription vmstate_i2c_slave = {
     }
 };
 
-DeviceState *i2c_try_create_slave(const char *name, uint8_t addr)
+I2CSlave *i2c_slave_new(const char *name, uint8_t addr)
 {
     DeviceState *dev;
 
     dev = qdev_new(name);
     qdev_prop_set_uint8(dev, "address", addr);
-    return dev;
+    return I2C_SLAVE(dev);
 }
 
 bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
@@ -283,12 +283,11 @@ bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
 
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
 {
-    DeviceState *dev;
+    I2CSlave *dev = i2c_slave_new(name, addr);
 
-    dev = i2c_try_create_slave(name, addr);
-    i2c_realize_and_unref(dev, bus, &error_fatal);
+    i2c_realize_and_unref(DEVICE(dev), bus, &error_fatal);
 
-    return dev;
+    return DEVICE(dev);
 }
 
 static void i2c_slave_class_init(ObjectClass *klass, void *data)
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index d6e3d85faf..18efc668f1 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -79,8 +79,8 @@ int i2c_send_recv(I2CBus *bus, uint8_t *data, bool send);
 int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
+I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
-DeviceState *i2c_try_create_slave(const char *name, uint8_t addr);
 bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14902.37102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCs-0008O4-Pd; Thu, 29 Oct 2020 21:11:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14902.37102; Thu, 29 Oct 2020 21:11:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFCs-0008Nw-Mi; Thu, 29 Oct 2020 21:11:38 +0000
Received: by outflank-mailman (input) for mailman id 14902;
 Thu, 29 Oct 2020 21:11:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFCs-0008Np-4U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5dabd610-e773-44fd-93c8-68499d850980;
 Thu, 29 Oct 2020 21:11:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCr-0007ZP-8S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFCr-0002ib-7h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFCs-0008Np-4U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:38 +0000
X-Inumbo-ID: 5dabd610-e773-44fd-93c8-68499d850980
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5dabd610-e773-44fd-93c8-68499d850980;
	Thu, 29 Oct 2020 21:11:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KeTkqvYoyk3qgap/p3UdJ+Nqvk7GjjBcSzr7LykduVs=; b=BSjmc52kTLFVo+Kz4+uZG60aFc
	Tz2CH+BCYkdu9peSF3UZdZFWMG3cNeHrUWTpPx21YKvoSA2JWi5NvE/Cq45FZIB+y6nvKh+YtcvX+
	qBdJfmw23bQkw9OrqN8Cr70JCK2XeGFHZyumZPZvElglwhQu3BPbvSqb1cfs/1abgsZ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCr-0007ZP-8S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFCr-0002ib-7h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
Message-Id: <E1kYFCr-0002ib-7h@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:37 +0000

commit 2616f57231c8e065df77de894a8f018cd1842c95
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:52 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
    
    The other i2c functions are called i2c_slave_FOO(). Rename as
    i2c_slave_realize_and_unref() to be consistent.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-4-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      | 10 ++++++----
 hw/i2c/core.c        |  6 +++---
 include/hw/i2c/i2c.h |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 51687fd3b3..78432e267b 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -515,8 +515,9 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO dps310@76 */
     dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca1");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
-                          &error_fatal);
+    i2c_slave_realize_and_unref(I2C_SLAVE(dev),
+                                aspeed_i2c_get_bus(&soc->i2c, 3),
+                                &error_fatal);
 
     i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
     i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
@@ -533,8 +534,9 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
                           eeprom_buf);
     dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca0");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
-                          &error_fatal);
+    i2c_slave_realize_and_unref(I2C_SLAVE(dev),
+                                aspeed_i2c_get_bus(&soc->i2c, 11),
+                                &error_fatal);
     /* Bus 11: TODO ucd90160@64 */
 }
 
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 144786f17a..f81601a5b9 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -276,16 +276,16 @@ I2CSlave *i2c_slave_new(const char *name, uint8_t addr)
     return I2C_SLAVE(dev);
 }
 
-bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
+bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp)
 {
-    return qdev_realize_and_unref(dev, &bus->qbus, errp);
+    return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
 }
 
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
 {
     I2CSlave *dev = i2c_slave_new(name, addr);
 
-    i2c_realize_and_unref(DEVICE(dev), bus, &error_fatal);
+    i2c_slave_realize_and_unref(dev, bus, &error_fatal);
 
     return DEVICE(dev);
 }
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 18efc668f1..cb7211f027 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -81,7 +81,7 @@ uint8_t i2c_recv(I2CBus *bus);
 
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
-bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp);
+bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
 void lm832x_key_event(DeviceState *dev, int key, int state);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14903.37107 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFD4-0008Pf-Sb; Thu, 29 Oct 2020 21:11:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14903.37107; Thu, 29 Oct 2020 21:11:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFD4-0008PT-OT; Thu, 29 Oct 2020 21:11:50 +0000
Received: by outflank-mailman (input) for mailman id 14903;
 Thu, 29 Oct 2020 21:11:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFD4-0008PN-6s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 96ecbf99-fe93-4865-8d26-a50002fc2c7d;
 Thu, 29 Oct 2020 21:11:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFD1-0007ZX-DB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFD1-0002jZ-Bw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFD4-0008PN-6s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:50 +0000
X-Inumbo-ID: 96ecbf99-fe93-4865-8d26-a50002fc2c7d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 96ecbf99-fe93-4865-8d26-a50002fc2c7d;
	Thu, 29 Oct 2020 21:11:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SNU2vEFYmgyiE5l0d9QpeoxqNDnti3Ae6eu3QCajaIU=; b=u+psyS+R4K4HviXK+PgprSApSq
	Hdkuw+J9nfFabLmBX4TWD6tYR6qpI53Q0YUBsvDR5Zdt0x41X8lMK7hzvDSnVdqPSNtlaQOlmsaKK
	aRxuzF13+JulFOO1XwG0Tr+dAQCrGKsUEBoNZF9BqHT4RgLhVau+bcjYy/tkBpiDNsMM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFD1-0007ZX-DB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFD1-0002jZ-Bw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
Message-Id: <E1kYFD1-0002jZ-Bw@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:47 +0000

commit 1373b15bb55e46b067f84f70c60d3d03af62fd62
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:53 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
    
    We use "create_simple" names for functions that allocate, initialize,
    configure and realize device objects: pci_create_simple(),
    isa_create_simple(), usb_create_simple(). For consistency, rename
    i2c_create_slave() as i2c_slave_create_simple(). Since we have
    to update all the callers, also let it return a I2CSlave object.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-5-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      | 58 ++++++++++++++++++++++++++--------------------------
 hw/arm/musicpal.c    |  4 ++--
 hw/arm/nseries.c     |  8 ++++----
 hw/arm/pxa2xx.c      |  5 +++--
 hw/arm/realview.c    |  2 +-
 hw/arm/spitz.c       |  4 ++--
 hw/arm/stellaris.c   |  2 +-
 hw/arm/tosa.c        |  2 +-
 hw/arm/versatilepb.c |  2 +-
 hw/arm/vexpress.c    |  2 +-
 hw/arm/z2.c          |  4 ++--
 hw/display/sii9022.c |  2 +-
 hw/i2c/core.c        |  6 +++---
 hw/ppc/e500.c        |  2 +-
 hw/ppc/sam460ex.c    |  2 +-
 include/hw/i2c/i2c.h |  2 +-
 16 files changed, 54 insertions(+), 53 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 78432e267b..c4288b5fb1 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -385,14 +385,14 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The palmetto platform expects a ds3231 RTC but a ds1338 is
      * enough to provide basic RTC features. Alarms will be missing */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50,
                           eeprom_buf);
 
     /* add a TMP423 temperature sensor */
-    dev = i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2),
-                           "tmp423", 0x4c);
+    dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2),
+                                         "tmp423", 0x4c));
     object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
@@ -408,12 +408,12 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
                           eeprom_buf);
 
     /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7),
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7),
                      TYPE_TMP105, 0x4d);
 
     /* The AST2500 EVB does not have an RTC. Let's pretend that one is
      * plugged on the I2C bus header */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
@@ -428,36 +428,36 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void swift_bmc_i2c_init(AspeedMachineState *bmc)
 {
     AspeedSoCState *soc = &bmc->soc;
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
     /* The swift board expects a pca9551 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
 
     /* The swift board expects an Epson RX8900 RTC but a ds1338 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
                      0x74);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
 }
 
 static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
@@ -465,8 +465,8 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
 
     /* bus 2 : */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
     /* bus 2 : pca9546 @ 0x73 */
 
     /* bus 3 : pca9548 @ 0x70 */
@@ -476,21 +476,21 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 4), 0x54,
                           eeprom4_54);
     /* PCA9539 @ 0x76, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
     /* PCA9539 @ 0x77, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
 
     /* bus 6 : */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
     /* bus 6 : pca9546 @ 0x73 */
 
     /* bus 8 : */
     uint8_t *eeprom8_56 = g_malloc0(8 * 1024);
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 0x56,
                           eeprom8_56);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
     /* bus 8 : adc128d818 @ 0x1d */
     /* bus 8 : adc128d818 @ 0x1f */
 
@@ -519,16 +519,16 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
                                 aspeed_i2c_get_bus(&soc->i2c, 3),
                                 &error_fatal);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
 
     /* The Witherspoon expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
                      0x4a);
 
     /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index ff9a7c8cc6..c3b9780f35 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -1584,7 +1584,7 @@ static void musicpal_init(MachineState *machine)
     DeviceState *i2c_dev;
     DeviceState *lcd_dev;
     DeviceState *key_dev;
-    DeviceState *wm8750_dev;
+    I2CSlave *wm8750_dev;
     SysBusDevice *s;
     I2CBus *i2c;
     int i;
@@ -1687,7 +1687,7 @@ static void musicpal_init(MachineState *machine)
         qdev_connect_gpio_out(key_dev, i, qdev_get_gpio_in(dev, i + 15));
     }
 
-    wm8750_dev = i2c_create_slave(i2c, TYPE_WM8750, MP_WM_ADDR);
+    wm8750_dev = i2c_slave_create_simple(i2c, TYPE_WM8750, MP_WM_ADDR);
     dev = qdev_new(TYPE_MV88W8618_AUDIO);
     s = SYS_BUS_DEVICE(dev);
     object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev),
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 428a2a2c5a..e48092ca04 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -215,7 +215,7 @@ static void n8x0_i2c_setup(struct n800_s *s)
     I2CBus *i2c = omap_i2c_bus(s->mpu->i2c[0]);
 
     /* Attach a menelaus PM chip */
-    dev = i2c_create_slave(i2c, "twl92230", N8X0_MENELAUS_ADDR);
+    dev = DEVICE(i2c_slave_create_simple(i2c, "twl92230", N8X0_MENELAUS_ADDR));
     qdev_connect_gpio_out(dev, 3,
                           qdev_get_gpio_in(s->mpu->ih[0],
                                            OMAP_INT_24XX_SYS_NIRQ));
@@ -224,7 +224,7 @@ static void n8x0_i2c_setup(struct n800_s *s)
     qemu_register_powerdown_notifier(&n8x0_system_powerdown_notifier);
 
     /* Attach a TMP105 PM chip (A0 wired to ground) */
-    dev = i2c_create_slave(i2c, TYPE_TMP105, N8X0_TMP105_ADDR);
+    dev = DEVICE(i2c_slave_create_simple(i2c, TYPE_TMP105, N8X0_TMP105_ADDR));
     qdev_connect_gpio_out(dev, 0, tmp_irq);
 }
 
@@ -416,8 +416,8 @@ static void n810_kbd_setup(struct n800_s *s)
 
     /* Attach the LM8322 keyboard to the I2C bus,
      * should happen in n8x0_i2c_setup and s->kbd be initialised here.  */
-    s->kbd = i2c_create_slave(omap_i2c_bus(s->mpu->i2c[0]),
-                           "lm8323", N810_LM8323_ADDR);
+    s->kbd = DEVICE(i2c_slave_create_simple(omap_i2c_bus(s->mpu->i2c[0]),
+                                            "lm8323", N810_LM8323_ADDR));
     qdev_connect_gpio_out(s->kbd, 0, kbd_irq);
 }
 
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index f104a33463..6203c4cfe0 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -1522,8 +1522,9 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base,
     s = PXA2XX_I2C(i2c_dev);
     /* FIXME: Should the slave device really be on a separate bus?  */
     i2cbus = i2c_init_bus(dev, "dummy");
-    dev = i2c_create_slave(i2cbus, TYPE_PXA2XX_I2C_SLAVE, 0);
-    s->slave = PXA2XX_I2C_SLAVE(dev);
+    s->slave = PXA2XX_I2C_SLAVE(i2c_slave_create_simple(i2cbus,
+                                                        TYPE_PXA2XX_I2C_SLAVE,
+                                                        0));
     s->slave->host = s;
 
     return s;
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 22e132058e..c1ff172b13 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -285,7 +285,7 @@ static void realview_init(MachineState *machine,
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", 0x68);
+    i2c_slave_create_simple(i2c, "ds1338", 0x68);
 
     /* Memory map for RealView Emulation Baseboard:  */
     /* 0x10000000 System registers.  */
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index f020aff974..7ac8254aa6 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -787,7 +787,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
     DeviceState *wm;
 
     /* Attach a WM8750 to the bus */
-    wm = i2c_create_slave(bus, TYPE_WM8750, 0);
+    wm = DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0));
 
     spitz_wm8750_addr(wm, 0, 0);
     qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM,
@@ -802,7 +802,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
 static void spitz_akita_i2c_setup(PXA2xxState *cpu)
 {
     /* Attach a Max7310 to Akita I2C bus.  */
-    i2c_create_slave(pxa2xx_i2c_bus(cpu->i2c[0]), "max7310",
+    i2c_slave_create_simple(pxa2xx_i2c_bus(cpu->i2c[0]), "max7310",
                      AKITA_MAX_ADDR);
 }
 
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 7156fb3ece..28eb15c76c 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1380,7 +1380,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
                                    qdev_get_gpio_in(nvic, 8));
         i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
         if (board->peripherals & BP_OLED_I2C) {
-            i2c_create_slave(i2c, "ssd0303", 0x3d);
+            i2c_slave_create_simple(i2c, "ssd0303", 0x3d);
         }
     }
 
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 5dee2d76c6..8c1ee0cdd1 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -206,7 +206,7 @@ static uint8_t tosa_dac_recv(I2CSlave *s)
 static void tosa_tg_init(PXA2xxState *cpu)
 {
     I2CBus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
-    i2c_create_slave(bus, TYPE_TOSA_DAC, DAC_BASE);
+    i2c_slave_create_simple(bus, TYPE_TOSA_DAC, DAC_BASE);
     ssi_create_slave(cpu->ssp[1], "tosa-ssp");
 }
 
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d09ea24ae2..9dc93182b6 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -317,7 +317,7 @@ static void versatile_init(MachineState *machine, int board_id)
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", 0x68);
+    i2c_slave_create_simple(i2c, "ds1338", 0x68);
 
     /* Add PL041 AACI Interface to the LM4549 codec */
     pl041 = qdev_new("pl041");
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 762b068e90..1dc971c34f 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -642,7 +642,7 @@ static void vexpress_common_init(MachineState *machine)
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, map[VE_SERIALDVI], NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "sii9022", 0x39);
+    i2c_slave_create_simple(i2c, "sii9022", 0x39);
 
     sysbus_create_simple("pl031", map[VE_RTC], pic[4]); /* RTC */
 
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index e1f22f5868..9a9bbc653b 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -330,8 +330,8 @@ static void z2_init(MachineState *machine)
     type_register_static(&aer915_info);
     z2_lcd = ssi_create_slave(mpu->ssp[1], TYPE_ZIPIT_LCD);
     bus = pxa2xx_i2c_bus(mpu->i2c[0]);
-    i2c_create_slave(bus, TYPE_AER915, 0x55);
-    wm = i2c_create_slave(bus, TYPE_WM8750, 0x1b);
+    i2c_slave_create_simple(bus, TYPE_AER915, 0x55);
+    wm = DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0x1b));
     mpu->i2s->opaque = wm;
     mpu->i2s->codec_out = wm8750_dac_dat;
     mpu->i2s->codec_in = wm8750_adc_dat;
diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c
index 0710ce9de5..3b82a8567f 100644
--- a/hw/display/sii9022.c
+++ b/hw/display/sii9022.c
@@ -161,7 +161,7 @@ static void sii9022_realize(DeviceState *dev, Error **errp)
     I2CBus *bus;
 
     bus = I2C_BUS(qdev_get_parent_bus(dev));
-    i2c_create_slave(bus, TYPE_I2CDDC, 0x50);
+    i2c_slave_create_simple(bus, TYPE_I2CDDC, 0x50);
 }
 
 static void sii9022_class_init(ObjectClass *klass, void *data)
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index f81601a5b9..21ec52ac5a 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -281,13 +281,13 @@ bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp)
     return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
 }
 
-DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
+I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr)
 {
     I2CSlave *dev = i2c_slave_new(name, addr);
 
-    i2c_slave_realize_and_unref(dev, bus, &error_fatal);
+    i2c_slave_realize_and_unref(dev, bus, &error_abort);
 
-    return DEVICE(dev);
+    return dev;
 }
 
 static void i2c_slave_class_init(ObjectClass *klass, void *data)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 5448d101d9..ab9884e315 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -941,7 +941,7 @@ void ppce500_init(MachineState *machine)
     memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET,
                                 sysbus_mmio_get_region(s, 0));
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", RTC_REGS_OFFSET);
+    i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET);
 
 
     /* General Utility device */
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 1a106a68de..1702344c46 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -339,7 +339,7 @@ static void sam460ex_init(MachineState *machine)
     spd_data[20] = 4; /* SO-DIMM module */
     smbus_eeprom_init_one(i2c, 0x50, spd_data);
     /* RTC */
-    i2c_create_slave(i2c, "m41t80", 0x68);
+    i2c_slave_create_simple(i2c, "m41t80", 0x68);
 
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600800, uic[0][3]);
 
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index cb7211f027..c533058998 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -80,7 +80,7 @@ int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
-DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
+I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr);
 bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:11:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:11:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14904.37110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDD-0008Qp-Ua; Thu, 29 Oct 2020 21:11:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14904.37110; Thu, 29 Oct 2020 21:11:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDD-0008Qh-RN; Thu, 29 Oct 2020 21:11:59 +0000
Received: by outflank-mailman (input) for mailman id 14904;
 Thu, 29 Oct 2020 21:11:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFDC-0008QY-Do
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 16dc4516-d86c-496d-829a-2693ccdd285f;
 Thu, 29 Oct 2020 21:11:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDB-0007Zf-Gx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDB-0002kR-G5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFDC-0008QY-Do
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:58 +0000
X-Inumbo-ID: 16dc4516-d86c-496d-829a-2693ccdd285f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 16dc4516-d86c-496d-829a-2693ccdd285f;
	Thu, 29 Oct 2020 21:11:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dcRkA4cJbbWAAdZoPLRLp99f0qunj/64P0dBBb7Vqac=; b=DewkKeJFQ8MKhGqwa1zsKxy5ZB
	GLJDQVpZntlY7cqFiOzjTAlXiczoDtjf/OZmEAWyVKzdwHU1ItwayKhRquO02fS7byUKlLTv4HyCB
	8EYzEa640bfhWJ6FubhP0wMpVs4lBbsgSZEV0FMh4hRo0s7/GBeoG6JDoRipPAFWllSo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDB-0007Zf-Gx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDB-0002kR-G5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:11:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/i2c: Document the I2C qdev helpers
Message-Id: <E1kYFDB-0002kR-G5@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:11:57 +0000

commit 73d5f22ecbb76dfc785876779d47787084ff0f42
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:54 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Document the I2C qdev helpers
    
    In commit d88c42ff2c we added new prototype but neglected to
    add their documentation. Fix that.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-6-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 include/hw/i2c/i2c.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index c533058998..a9c030a512 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -79,8 +79,56 @@ int i2c_send_recv(I2CBus *bus, uint8_t *data, bool send);
 int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
+/**
+ * Create an I2C slave device on the heap.
+ * @name: a device type name
+ * @addr: I2C address of the slave when put on a bus
+ *
+ * This only initializes the device state structure and allows
+ * properties to be set. Type @name must exist. The device still
+ * needs to be realized. See qdev-core.h.
+ */
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
+
+/**
+ * Create and realize an I2C slave device on the heap.
+ * @bus: I2C bus to put it on
+ * @name: I2C slave device type name
+ * @addr: I2C address of the slave when put on a bus
+ *
+ * Create the device state structure, initialize it, put it on the
+ * specified @bus, and drop the reference to it (the device is realized).
+ */
 I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr);
+
+/**
+ * Realize and and drop a reference an I2C slave device
+ * @dev: I2C slave device to realize
+ * @bus: I2C bus to put it on
+ * @addr: I2C address of the slave on the bus
+ * @errp: pointer to NULL initialized error object
+ *
+ * Returns: %true on success, %false on failure.
+ *
+ * Call 'realize' on @dev, put it on the specified @bus, and drop the
+ * reference to it.
+ *
+ * This function is useful if you have created @dev via qdev_new(),
+ * i2c_slave_new() or i2c_slave_try_new() (which take a reference to
+ * the device it returns to you), so that you can set properties on it
+ * before realizing it. If you don't need to set properties then
+ * i2c_slave_create_simple() is probably better (as it does the create,
+ * init and realize in one step).
+ *
+ * If you are embedding the I2C slave into another QOM device and
+ * initialized it via some variant on object_initialize_child() then
+ * do not use this function, because that family of functions arrange
+ * for the only reference to the child device to be held by the parent
+ * via the child<> property, and so the reference-count-drop done here
+ * would be incorrect.  (Instead you would want i2c_slave_realize(),
+ * which doesn't currently exist but would be trivial to create if we
+ * had any code that wanted it.)
+ */
 bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:12:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14905.37114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDN-0008Ss-W5; Thu, 29 Oct 2020 21:12:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14905.37114; Thu, 29 Oct 2020 21:12:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDN-0008Sk-Sy; Thu, 29 Oct 2020 21:12:09 +0000
Received: by outflank-mailman (input) for mailman id 14905;
 Thu, 29 Oct 2020 21:12:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFDM-0008Sa-IC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id efffb33c-dbe8-4f93-b6e3-13e01a344c53;
 Thu, 29 Oct 2020 21:12:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDL-0007aT-Mo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDL-0002lR-LP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFDM-0008Sa-IC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:08 +0000
X-Inumbo-ID: efffb33c-dbe8-4f93-b6e3-13e01a344c53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id efffb33c-dbe8-4f93-b6e3-13e01a344c53;
	Thu, 29 Oct 2020 21:12:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uzkgYwZmgDAszswcrKTOW0UE10xJsEDYBuLAn+M4xQc=; b=NitRT2TP0bn/zUk7sRe96aSWai
	G/+t3/Ka25B6ohWxSsbWR/FABOomYgNjlHb1SYsXeyr1eZJtpJryvmahlgjLC6qS5e3+qsCfhwmQG
	siK72YmgnhqAC7VZ+nRBUuNVJlKmFHcrFj7L1f3WzexhQibCQbFLR9DptUtGYQSsHGi4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDL-0007aT-Mo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDL-0002lR-LP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-i2c-5' into staging
Message-Id: <E1kYFDL-0002lR-LP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:07 +0000

commit 873ec69aeb12e24eec7fb317fd0cd8494e8489dd
Merge: d69cda7ed722e445d03e1ace6563bab3a76e023e 73d5f22ecbb76dfc785876779d47787084ff0f42
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 11:03:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:03:09 2020 +0100

    Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-i2c-5' into staging
    
    Minor changes to:
    
    Add an SMBus config entry
    
    Cleanup/simplify/document some I2C interfaces
    
    # gpg: Signature made Thu 16 Jul 2020 18:46:55 BST
    # gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
    # gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
    # gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81
    
    * remotes/cminyard/tags/for-qemu-i2c-5:
      hw/i2c: Document the I2C qdev helpers
      hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
      hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
      hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
      hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
      hw/i2c/Kconfig: Add an entry for the SMBus
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/arm/aspeed.c             | 82 +++++++++++++++++++++++----------------------
 hw/arm/musicpal.c           |  4 +--
 hw/arm/nseries.c            |  8 ++---
 hw/arm/pxa2xx.c             |  5 +--
 hw/arm/realview.c           |  2 +-
 hw/arm/spitz.c              |  4 +--
 hw/arm/stellaris.c          |  2 +-
 hw/arm/tosa.c               |  2 +-
 hw/arm/versatilepb.c        |  2 +-
 hw/arm/vexpress.c           |  2 +-
 hw/arm/z2.c                 |  4 +--
 hw/display/sii9022.c        |  2 +-
 hw/i2c/Kconfig              |  8 +++--
 hw/i2c/Makefile.objs        |  3 +-
 hw/i2c/aspeed_i2c.c         |  3 +-
 hw/i2c/core.c               | 15 ++++-----
 hw/ppc/e500.c               |  2 +-
 hw/ppc/sam460ex.c           |  2 +-
 include/hw/i2c/aspeed_i2c.h |  2 +-
 include/hw/i2c/i2c.h        | 54 +++++++++++++++++++++++++++--
 20 files changed, 131 insertions(+), 77 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:12:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:12:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14906.37118 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDY-0008UC-1K; Thu, 29 Oct 2020 21:12:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14906.37118; Thu, 29 Oct 2020 21:12:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDX-0008U4-UZ; Thu, 29 Oct 2020 21:12:19 +0000
Received: by outflank-mailman (input) for mailman id 14906;
 Thu, 29 Oct 2020 21:12:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFDX-0008Tt-1d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 739bd499-e266-4a38-861c-d96d2ed42d1a;
 Thu, 29 Oct 2020 21:12:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDW-0007ag-3a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDW-0002ml-2k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFDX-0008Tt-1d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:19 +0000
X-Inumbo-ID: 739bd499-e266-4a38-861c-d96d2ed42d1a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 739bd499-e266-4a38-861c-d96d2ed42d1a;
	Thu, 29 Oct 2020 21:12:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ZO4nLY1d0MoOixLu1Qp3woNVCBY5Z7Bg8G5fDfKwRk=; b=hag48ZDdEQ3DDPeep7homP/WwD
	bufMOQsxRIZMvx9bq6e4OepDAmNcUCURx6y0c0EzMCktm37+i4g7S/aX40esJevV4lDOvoNeI+jKB
	wEXQxa+evy8Pe9KKGAG/S5U6ShTe70dwozYcI7CFLOjpUPslfw9Oi3S3Wcy8wWyzgPKM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDW-0007ag-3a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDW-0002ml-2k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ppc/pnv: Make PSI device types not user creatable
Message-Id: <E1kYFDW-0002ml-2k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:18 +0000

commit 14de3d4ac58c0f63e9f5560c7e01e62e39467edd
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Tue Jul 7 18:35:57 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    ppc/pnv: Make PSI device types not user creatable
    
    QEMU aborts with -device pnv-psi-POWER8:
    
    $ qemu-system-ppc64 -device pnv-psi-POWER8
    qemu-system-ppc64: hw/intc/xics.c:605: ics_realize: Assertion
    `ics->xics' failed.
    Aborted (core dumped)
    
    The Processor Service Interface Controller is an internal device.
    It should only be instantiated by the chip, which takes care of
    configuring the link required by the ICS object in the case of
    POWER8. It doesn't make sense for a user to specify it on the
    command line.
    
    Note that the PSI model for POWER8 was added 3 yrs ago but the
    devices weren't available on the command line because of a bug
    that was fixed by recent commit 2f35254aa0 ("pnv/psi: Correct
    the pnv-psi* devices not to be sysbus devices").
    
    Fixes: 54f59d786c ("ppc/pnv: Add cut down PSI bridge model and hookup external interrupt")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159413975752.169116.5808968580649255382.stgit@bahia.lan>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/pnv_psi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 5bdeec700e..6a479cac53 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -929,6 +929,7 @@ static void pnv_psi_class_init(ObjectClass *klass, void *data)
     dc->desc = "PowerNV PSI Controller";
     device_class_set_props(dc, pnv_psi_properties);
     dc->reset = pnv_psi_reset;
+    dc->user_creatable = false;
 }
 
 static const TypeInfo pnv_psi_info = {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:12:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:12:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14907.37122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDi-0008VR-2z; Thu, 29 Oct 2020 21:12:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14907.37122; Thu, 29 Oct 2020 21:12:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDh-0008VJ-W6; Thu, 29 Oct 2020 21:12:29 +0000
Received: by outflank-mailman (input) for mailman id 14907;
 Thu, 29 Oct 2020 21:12:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFDh-0008VB-6C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c876a74e-7b71-461b-8476-c9328db36d4f;
 Thu, 29 Oct 2020 21:12:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDg-0007ao-7P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDg-0002nq-6A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFDh-0008VB-6C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:29 +0000
X-Inumbo-ID: c876a74e-7b71-461b-8476-c9328db36d4f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c876a74e-7b71-461b-8476-c9328db36d4f;
	Thu, 29 Oct 2020 21:12:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Infsi5w9G/dcnxCdwgzxDo/SnkSSiRGRDOUenk5du8A=; b=E7YW6l/M8kUwTOMspl5fPftFzs
	b8PQhDIbwiuIWwbbZcSAlgpmhAua4dyV5sNwzKkGpmz1N8vWPSwp5rC7+xs/lcok9wp0WHAFwt/wy
	0uq7igvNFUQOEP1pHJsGMhZmhVRW/aKa1TrVBePNVwIOMJ5MCLSsKZ+0bU7ZYHQCAqeY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDg-0007ao-7P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDg-0002nq-6A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] spapr_pci: Robustify support of PCI bridges
Message-Id: <E1kYFDg-0002nq-6A@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:28 +0000

commit a4beb5f5d4672400a76cc0551c4f0878e42d921c
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Thu Jul 9 19:12:47 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    spapr_pci: Robustify support of PCI bridges
    
    Some recent error handling cleanups unveiled issues with our support of
    PCI bridges:
    
    1) QEMU aborts when using non-standard PCI bridge types,
       unveiled by commit 7ef1553dac "spapr_pci: Drop some dead error handling"
    
    $ qemu-system-ppc64 -M pseries -device pcie-pci-bridge
    Unexpected error in object_property_find() at qom/object.c:1240:
    qemu-system-ppc64: -device pcie-pci-bridge: Property '.chassis_nr' not found
    Aborted (core dumped)
    
    This happens because we assume all PCI bridge types to have a "chassis_nr"
    property. This property only exists with the standard PCI bridge type
    "pci-bridge" actually. We could possibly revert 7ef1553dac but it seems
    much simpler to check the presence of "chassis_nr" earlier.
    
    2) QEMU abort if same "chassis_nr" value is used several times,
       unveiled by commit d2623129a7de "qom: Drop parameter @errp of
       object_property_add() & friends"
    
    $ qemu-system-ppc64 -M pseries -device pci-bridge,chassis_nr=1 \
                            -device pci-bridge,chassis_nr=1
    Unexpected error in object_property_try_add() at qom/object.c:1167:
    qemu-system-ppc64: -device pci-bridge,chassis_nr=1: attempt to add duplicate property '40000100' to object (type 'container')
    Aborted (core dumped)
    
    This happens because we assume that "chassis_nr" values are unique, but
    nobody enforces that and we end up generating duplicate DRC ids. The PCI
    code doesn't really care for duplicate "chassis_nr" properties since it
    is only used to initialize the "Chassis Number Register" of the bridge,
    with no functional impact on QEMU. So, even if passing the same value
    several times might look weird, it never broke anything before, so
    I guess we don't necessarily want to enforce strict checking in the PCI
    code now.
    
    Workaround both issues in the PAPR code: check that the bridge has a
    unique and non null "chassis_nr" when plugging it into its parent bus.
    
    Fixes: 05929a6c5dfe ("spapr: Don't use bus number for building DRC ids")
    Fixes: 7ef1553dac ("spapr_pci: Drop some dead error handling")
    Fixes: d2623129a7de ("qom: Drop parameter @errp of object_property_add() & friends")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159431476748.407044.16711294833569014964.stgit@bahia.lan>
    [dwg: Move check slightly to a better place]
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_pci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 2a6a48744a..21681215d4 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1480,6 +1480,57 @@ static void spapr_pci_bridge_plug(SpaprPhbState *phb,
     add_drcs(phb, bus);
 }
 
+/* Returns non-zero if the value of "chassis_nr" is already in use */
+static int check_chassis_nr(Object *obj, void *opaque)
+{
+    int new_chassis_nr =
+        object_property_get_uint(opaque, "chassis_nr", &error_abort);
+    int chassis_nr =
+        object_property_get_uint(obj, "chassis_nr", NULL);
+
+    if (!object_dynamic_cast(obj, TYPE_PCI_BRIDGE)) {
+        return 0;
+    }
+
+    /* Skip unsupported bridge types */
+    if (!chassis_nr) {
+        return 0;
+    }
+
+    /* Skip self */
+    if (obj == opaque) {
+        return 0;
+    }
+
+    return chassis_nr == new_chassis_nr;
+}
+
+static bool bridge_has_valid_chassis_nr(Object *bridge, Error **errp)
+{
+    int chassis_nr =
+        object_property_get_uint(bridge, "chassis_nr", NULL);
+
+    /*
+     * slotid_cap_init() already ensures that "chassis_nr" isn't null for
+     * standard PCI bridges, so this really tells if "chassis_nr" is present
+     * or not.
+     */
+    if (!chassis_nr) {
+        error_setg(errp, "PCI Bridge lacks a \"chassis_nr\" property");
+        error_append_hint(errp, "Try -device pci-bridge instead.\n");
+        return false;
+    }
+
+    /* We want unique values for "chassis_nr" */
+    if (object_child_foreach_recursive(object_get_root(), check_chassis_nr,
+                                       bridge)) {
+        error_setg(errp, "Bridge chassis %d already in use", chassis_nr);
+        return false;
+    }
+
+    return true;
+}
+
 static void spapr_pci_plug(HotplugHandler *plug_handler,
                            DeviceState *plugged_dev, Error **errp)
 {
@@ -1508,6 +1559,9 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,
     g_assert(drc);
 
     if (pc->is_bridge) {
+        if (!bridge_has_valid_chassis_nr(OBJECT(plugged_dev), errp)) {
+            return;
+        }
         spapr_pci_bridge_plug(phb, PCI_BRIDGE(plugged_dev));
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:12:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:12:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14908.37125 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDv-00005G-4t; Thu, 29 Oct 2020 21:12:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14908.37125; Thu, 29 Oct 2020 21:12:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFDv-000055-1d; Thu, 29 Oct 2020 21:12:43 +0000
Received: by outflank-mailman (input) for mailman id 14908;
 Thu, 29 Oct 2020 21:12:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFDt-00004y-M4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f1e9bfc4-cb11-4a9a-8cca-b18ecccb3055;
 Thu, 29 Oct 2020 21:12:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDq-0007cQ-BA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFDq-0002qD-AN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFDt-00004y-M4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:41 +0000
X-Inumbo-ID: f1e9bfc4-cb11-4a9a-8cca-b18ecccb3055
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f1e9bfc4-cb11-4a9a-8cca-b18ecccb3055;
	Thu, 29 Oct 2020 21:12:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x8Zi1OB8Cl/6Gn+1XwoBdtxADEvnugItIVfsd0IP/zI=; b=TXkBPEOoLc0btnWRNnpXJ6rgZ9
	cqSxysWUNqGiu5uZ5euZyrAz82FeFpzavp2csdZeb4IjWGZaLO5+Ln+hAcbXQ7nuFictojour8qWk
	WFWpDdC7K5CcwnvZc/9wki9/fLRI5xZW0u7XEgQKW0lmEDxuS9vJ3z2lVNWXsrZd36Ek=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDq-0007cQ-BA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFDq-0002qD-AN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] spapr: Add a new level of NUMA for GPUs
Message-Id: <E1kYFDq-0002qD-AN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:38 +0000

commit a6030d7e0b35a23c82e4a765b53dc3847bcdb4d1
Author:     Reza Arbab <arbab@linux.ibm.com>
AuthorDate: Thu Jul 16 17:56:55 2020 -0500
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    spapr: Add a new level of NUMA for GPUs
    
    NUMA nodes corresponding to GPU memory currently have the same
    affinity/distance as normal memory nodes. Add a third NUMA associativity
    reference point enabling us to give GPU nodes more distance.
    
    This is guest visible information, which shouldn't change under a
    running guest across migration between different qemu versions, so make
    the change effective only in new (pseries > 5.0) machine types.
    
    Before, `numactl -H` output in a guest with 4 GPUs (nodes 2-5):
    
    node distances:
    node   0   1   2   3   4   5
      0:  10  40  40  40  40  40
      1:  40  10  40  40  40  40
      2:  40  40  10  40  40  40
      3:  40  40  40  10  40  40
      4:  40  40  40  40  10  40
      5:  40  40  40  40  40  10
    
    After:
    
    node distances:
    node   0   1   2   3   4   5
      0:  10  40  80  80  80  80
      1:  40  10  80  80  80  80
      2:  80  80  10  80  80  80
      3:  80  80  80  10  80  80
      4:  80  80  80  80  10  80
      5:  80  80  80  80  80  10
    
    These are the same distances as on the host, mirroring the change made
    to host firmware in skiboot commit f845a648b8cb ("numa/associativity:
    Add a new level of NUMA for GPU's").
    
    Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
    Message-Id: <20200716225655.24289-1-arbab@linux.ibm.com>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c              | 21 +++++++++++++++++++--
 hw/ppc/spapr_pci.c          |  2 ++
 hw/ppc/spapr_pci_nvlink2.c  | 13 ++++++++++---
 include/hw/pci-host/spapr.h |  1 +
 include/hw/ppc/spapr.h      |  1 +
 5 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 299908cc73..0ae293ec94 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -890,10 +890,16 @@ static int spapr_dt_rng(void *fdt)
 static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
 {
     MachineState *ms = MACHINE(spapr);
+    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(ms);
     int rtas;
     GString *hypertas = g_string_sized_new(256);
     GString *qemu_hypertas = g_string_sized_new(256);
-    uint32_t refpoints[] = { cpu_to_be32(0x4), cpu_to_be32(0x4) };
+    uint32_t refpoints[] = {
+        cpu_to_be32(0x4),
+        cpu_to_be32(0x4),
+        cpu_to_be32(0x2),
+    };
+    uint32_t nr_refpoints = ARRAY_SIZE(refpoints);
     uint64_t max_device_addr = MACHINE(spapr)->device_memory->base +
         memory_region_size(&MACHINE(spapr)->device_memory->mr);
     uint32_t lrdr_capacity[] = {
@@ -945,8 +951,12 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
                      qemu_hypertas->str, qemu_hypertas->len));
     g_string_free(qemu_hypertas, TRUE);
 
+    if (smc->pre_5_1_assoc_refpoints) {
+        nr_refpoints = 2;
+    }
+
     _FDT(fdt_setprop(fdt, rtas, "ibm,associativity-reference-points",
-                     refpoints, sizeof(refpoints)));
+                     refpoints, nr_refpoints * sizeof(refpoints[0])));
 
     _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
                      maxdomains, sizeof(maxdomains)));
@@ -4584,9 +4594,16 @@ DEFINE_SPAPR_MACHINE(5_1, "5.1", true);
  */
 static void spapr_machine_5_0_class_options(MachineClass *mc)
 {
+    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+    static GlobalProperty compat[] = {
+        { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-5.1-associativity", "on" },
+    };
+
     spapr_machine_5_1_class_options(mc);
     compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len);
+    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
     mc->numa_mem_supported = true;
+    smc->pre_5_1_assoc_refpoints = true;
 }
 
 DEFINE_SPAPR_MACHINE(5_0, "5.0", false);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 21681215d4..363cdb3f7b 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2089,6 +2089,8 @@ static Property spapr_phb_properties[] = {
                      pcie_ecs, true),
     DEFINE_PROP_UINT64("gpa", SpaprPhbState, nv2_gpa_win_addr, 0),
     DEFINE_PROP_UINT64("atsd", SpaprPhbState, nv2_atsd_win_addr, 0),
+    DEFINE_PROP_BOOL("pre-5.1-associativity", SpaprPhbState,
+                     pre_5_1_assoc, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/ppc/spapr_pci_nvlink2.c b/hw/ppc/spapr_pci_nvlink2.c
index dd8cd6db96..76ae77ebc8 100644
--- a/hw/ppc/spapr_pci_nvlink2.c
+++ b/hw/ppc/spapr_pci_nvlink2.c
@@ -362,9 +362,9 @@ void spapr_phb_nvgpu_ram_populate_dt(SpaprPhbState *sphb, void *fdt)
                                                     &error_abort);
         uint32_t associativity[] = {
             cpu_to_be32(0x4),
-            SPAPR_GPU_NUMA_ID,
-            SPAPR_GPU_NUMA_ID,
-            SPAPR_GPU_NUMA_ID,
+            cpu_to_be32(nvslot->numa_id),
+            cpu_to_be32(nvslot->numa_id),
+            cpu_to_be32(nvslot->numa_id),
             cpu_to_be32(nvslot->numa_id)
         };
         uint64_t size = object_property_get_uint(nv_mrobj, "size", NULL);
@@ -375,6 +375,13 @@ void spapr_phb_nvgpu_ram_populate_dt(SpaprPhbState *sphb, void *fdt)
         _FDT(off);
         _FDT((fdt_setprop_string(fdt, off, "device_type", "memory")));
         _FDT((fdt_setprop(fdt, off, "reg", mem_reg, sizeof(mem_reg))));
+
+        if (sphb->pre_5_1_assoc) {
+            associativity[1] = SPAPR_GPU_NUMA_ID;
+            associativity[2] = SPAPR_GPU_NUMA_ID;
+            associativity[3] = SPAPR_GPU_NUMA_ID;
+        }
+
         _FDT((fdt_setprop(fdt, off, "ibm,associativity", associativity,
                           sizeof(associativity))));
 
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 8877ff51fb..600eb55c34 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -94,6 +94,7 @@ struct SpaprPhbState {
     hwaddr nv2_gpa_win_addr;
     hwaddr nv2_atsd_win_addr;
     SpaprPhbPciNvGpuConfig *nvgpus;
+    bool pre_5_1_assoc;
 };
 
 #define SPAPR_PCI_MEM_WIN_BUS_OFFSET 0x80000000ULL
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index c421410e3f..3134d339e8 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -129,6 +129,7 @@ struct SpaprMachineClass {
     bool linux_pci_probe;
     bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
     hwaddr rma_limit;          /* clamp the RMA to this size */
+    bool pre_5_1_assoc_refpoints;
 
     void (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
                           uint64_t *buid, hwaddr *pio, 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:12:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:12:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14909.37130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFE4-00006f-8q; Thu, 29 Oct 2020 21:12:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14909.37130; Thu, 29 Oct 2020 21:12:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFE4-00006X-5Y; Thu, 29 Oct 2020 21:12:52 +0000
Received: by outflank-mailman (input) for mailman id 14909;
 Thu, 29 Oct 2020 21:12:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFE2-00006L-Nv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 16426eb0-f781-4e96-bfdc-9ebc9cb4003a;
 Thu, 29 Oct 2020 21:12:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFE0-0007cY-Er
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFE0-0002qj-E1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFE2-00006L-Nv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:50 +0000
X-Inumbo-ID: 16426eb0-f781-4e96-bfdc-9ebc9cb4003a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 16426eb0-f781-4e96-bfdc-9ebc9cb4003a;
	Thu, 29 Oct 2020 21:12:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uBiEQrPzZNgutFExhALhgCpGrKaNi7qKnc396FZcfYA=; b=JcZopQJJ1fdV4gdj5fKYn9/Wqe
	WcGI4ilqmYDseWt5fgnw8JScvOYivpJMFC4SnX7ZVuJl5ByxkcVyGD7mG5JTDsT9H5aFVJ1cBNL1I
	Vh5rEAssOpFVTltmEThZtRd2RCiJGyC6PwkVyIcpt03Fyuk3jaCAr78b0ImgttTDe0SI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFE0-0007cY-Er
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFE0-0002qj-E1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] pseries: Update SLOF firmware image
Message-Id: <E1kYFE0-0002qj-E1@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:48 +0000

commit b25fbd6a1302c0eac5b326be3e1f828e905c0c9a
Author:     Alexey Kardashevskiy <aik@ozlabs.ru>
AuthorDate: Fri Jul 17 11:15:31 2020 +1000
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    pseries: Update SLOF firmware image
    
    This adds tcgbios (this was posted earlier [1] but got lost)
    and fixes FDT update at ibm,client-architecture-support
    for huge guests.
    
    The full list of changes:
    
    Alexey Kardashevskiy (4):
          make: Define default rule for .c when V=1 or V=2
          version: update to 20200513
          fdt: Avoid recursion when traversing tree
          version: update to 20200717
    
    Gustavo Romero (1):
          board-qemu: Fix comment about SLOF start address
    
    Stefan Berger (6):
          tcgbios: Only write logs for PCRs that are allocated
          tcgbios: Fix the vendorInfoSize to be of type uint8_t
          tcgbios: Add support for SHA3 type of algorithms
          elf: Implement elf_get_file_size to determine size of an ELF image
          tcgbios: Implement tpm_hash_log_extend_event_buffer
          tcgbios: Measure the bootloader file read from disk
    
    [1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20200513024355.121476-1-aik@ozlabs.ru/
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 pc-bios/README   |   2 +-
 pc-bios/slof.bin | Bin 965112 -> 968368 bytes
 roms/SLOF        |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pc-bios/README b/pc-bios/README
index a5a770f066..fa8b58b797 100644
--- a/pc-bios/README
+++ b/pc-bios/README
@@ -14,7 +14,7 @@
 - SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
   implementation for certain IBM POWER hardware.  The sources are at
   https://github.com/aik/SLOF, and the image currently in qemu is
-  built from git tag qemu-slof-20200327.
+  built from git tag qemu-slof-20200717.
 
 - sgabios (the Serial Graphics Adapter option ROM) provides a means for
   legacy x86 software to communicate with an attached serial console as
diff --git a/pc-bios/slof.bin b/pc-bios/slof.bin
index 80bbf91a18..448dcada36 100644
Binary files a/pc-bios/slof.bin and b/pc-bios/slof.bin differ
diff --git a/roms/SLOF b/roms/SLOF
index 8e012d6fdd..e18ddad851 160000
--- a/roms/SLOF
+++ b/roms/SLOF
@@ -1 +1 @@
-Subproject commit 8e012d6fddb62be833d746cef3f03e6c8beecde0
+Subproject commit e18ddad8516ff2cfe36ec130200318f7251aa78c
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14910.37134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEC-00009h-A7; Thu, 29 Oct 2020 21:13:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14910.37134; Thu, 29 Oct 2020 21:13:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEC-00009Z-6u; Thu, 29 Oct 2020 21:13:00 +0000
Received: by outflank-mailman (input) for mailman id 14910;
 Thu, 29 Oct 2020 21:12:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFEB-00009S-G8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cbd44dfd-617b-4a53-a924-b927b207be7a;
 Thu, 29 Oct 2020 21:12:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEA-0007cg-J0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEA-0002rm-IB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFEB-00009S-G8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:59 +0000
X-Inumbo-ID: cbd44dfd-617b-4a53-a924-b927b207be7a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cbd44dfd-617b-4a53-a924-b927b207be7a;
	Thu, 29 Oct 2020 21:12:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fP3zay1m1zAafjNsgj/ReTqgA5qNHIovSkx0wVP2mns=; b=YZCVdR2Mgn3YAkbgSHfB4GVnhx
	8CGZc1aOxfLx1OyaSizgq9v6psqTyAGdQ8gXAhwP92P2kDT6fSu1QiPnPANNoSBEw983Gl3IKf+S/
	fHwVrnXMi18o3EojekDVXKwLArYLcp9w5z87dM6xsShZnKwuNrHFvAWA39ZkD8KsYMdg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEA-0007cg-J0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEA-0002rm-IB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:12:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200720' into staging
Message-Id: <E1kYFEA-0002rm-IB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:12:58 +0000

commit 1e6c50ad8559c18b21041ef69d8fff781a8db0bb
Merge: 873ec69aeb12e24eec7fb317fd0cd8494e8489dd b25fbd6a1302c0eac5b326be3e1f828e905c0c9a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 11:34:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:34:10 2020 +0100

    Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200720' into staging
    
    ppc patch queue 20200720
    
    Here are some assorted fixes for qemu-5.1:
     * SLOF update with improved TPM handling, and fix for possible stack
       overflows on many-vcpu machines
     * Fix for NUMA distances on NVLink2 attached GPU memory nodes
     * Fixes to fail more gracefully on attempting to plug unsupported PCI bridge types
     * Don't allow pnv-psi device to be user created
    
    # gpg: Signature made Mon 20 Jul 2020 06:29:21 BST
    # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
    # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
    # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
    # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
    # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
    # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
    
    * remotes/dgibson/tags/ppc-for-5.1-20200720:
      pseries: Update SLOF firmware image
      spapr: Add a new level of NUMA for GPUs
      spapr_pci: Robustify support of PCI bridges
      ppc/pnv: Make PSI device types not user creatable
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ppc/pnv_psi.c            |   1 +
 hw/ppc/spapr.c              |  21 +++++++++++++++--
 hw/ppc/spapr_pci.c          |  56 ++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/spapr_pci_nvlink2.c  |  13 +++++++---
 include/hw/pci-host/spapr.h |   1 +
 include/hw/ppc/spapr.h      |   1 +
 pc-bios/README              |   2 +-
 pc-bios/slof.bin            | Bin 965112 -> 968368 bytes
 roms/SLOF                   |   2 +-
 9 files changed, 90 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14911.37140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEN-0000Bw-Cq; Thu, 29 Oct 2020 21:13:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14911.37140; Thu, 29 Oct 2020 21:13:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEN-0000Bg-8Y; Thu, 29 Oct 2020 21:13:11 +0000
Received: by outflank-mailman (input) for mailman id 14911;
 Thu, 29 Oct 2020 21:13:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFEM-0000BP-Ak
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e91286d2-245d-4054-aa9f-579ec4bce6bb;
 Thu, 29 Oct 2020 21:13:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEL-0007de-6S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEL-0002uN-5J
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFEM-0000BP-Ak
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:10 +0000
X-Inumbo-ID: e91286d2-245d-4054-aa9f-579ec4bce6bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e91286d2-245d-4054-aa9f-579ec4bce6bb;
	Thu, 29 Oct 2020 21:13:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0yTpby5P7dQSzwg97nXdAnNgP+bgfZDg/HZjj20EyDE=; b=v3ee+1TxBtsDNnIhC3ZDX/InK0
	3e6rVBeW/wywNinQJeMxOrYu8AiHpKq8H0N7+hZ5Zr4myUbF/MJQMmKZBhL+dkmQRA+qIhU0vJYE+
	6YnO1fdtq0bLjGvXrlgYiH9Bv1UkMK291aOLTz3Q5liHsM94xqI6cKeDFb0CxNJQ7Whc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEL-0007de-6S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEL-0002uN-5J
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/virt: Enable MTE via a machine property
Message-Id: <E1kYFEL-0002uN-5J@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:09 +0000

commit 6f4e1405b91da0d0a1084ae3aff2bd308432778f
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:15 2020 +0100

    hw/arm/virt: Enable MTE via a machine property
    
    Control this cpu feature via a machine property, much as we do
    with secure=on, since both require specialized support in the
    machine setup to be functional.
    
    Default MTE to off, since this feature implies extra overhead.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-2-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c         | 39 ++++++++++++++++++++++++++++++++++-----
 include/hw/arm/virt.h |  1 +
 target/arm/cpu.c      | 19 +++++++++++--------
 target/arm/cpu64.c    |  5 +++--
 4 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9005dae356..5866c4ce20 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1837,12 +1837,19 @@ static void machvirt_init(MachineState *machine)
                                      OBJECT(secure_sysmem), &error_abort);
         }
 
-        /*
-         * The cpu adds the property if and only if MemTag is supported.
-         * If it is, we must allocate the ram to back that up.
-         */
-        if (object_property_find(cpuobj, "tag-memory", NULL)) {
+        if (vms->mte) {
+            /* Create the memory region only once, but link to all cpus. */
             if (!tag_sysmem) {
+                /*
+                 * The property exists only if MemTag is supported.
+                 * If it is, we must allocate the ram to back that up.
+                 */
+                if (!object_property_find(cpuobj, "tag-memory", NULL)) {
+                    error_report("MTE requested, but not supported "
+                                 "by the guest CPU");
+                    exit(1);
+                }
+
                 tag_sysmem = g_new(MemoryRegion, 1);
                 memory_region_init(tag_sysmem, OBJECT(machine),
                                    "tag-memory", UINT64_MAX / 32);
@@ -2061,6 +2068,20 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
     vms->ras = value;
 }
 
+static bool virt_get_mte(Object *obj, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    return vms->mte;
+}
+
+static void virt_set_mte(Object *obj, bool value, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    vms->mte = value;
+}
+
 static char *virt_get_gic_version(Object *obj, Error **errp)
 {
     VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2481,6 +2502,14 @@ static void virt_instance_init(Object *obj)
                                     "Set on/off to enable/disable reporting host memory errors "
                                     "to a KVM guest using ACPI and guest external abort exceptions");
 
+    /* MTE is disabled by default.  */
+    vms->mte = false;
+    object_property_add_bool(obj, "mte", virt_get_mte, virt_set_mte);
+    object_property_set_description(obj, "mte",
+                                    "Set on/off to enable/disable emulating a "
+                                    "guest CPU which implements the ARM "
+                                    "Memory Tagging Extension");
+
     vms->irqmap = a15irqmap;
 
     virt_flash_create(vms);
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 54bcf17afd..dff67e1bef 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -140,6 +140,7 @@ typedef struct {
     bool its;
     bool virt;
     bool ras;
+    bool mte;
     OnOffAuto acpi;
     VirtGICType gic_version;
     VirtIOMMUType iommu;
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 5050e1843a..111579554f 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1698,6 +1698,17 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
         cpu->id_pfr1 &= ~0xf000;
     }
 
+#ifndef CONFIG_USER_ONLY
+    if (cpu->tag_memory == NULL && cpu_isar_feature(aa64_mte, cpu)) {
+        /*
+         * Disable the MTE feature bits if we do not have tag-memory
+         * provided by the machine.
+         */
+        cpu->isar.id_aa64pfr1 =
+            FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
+    }
+#endif
+
     /* MPU can be configured out of a PMSA CPU either by setting has-mpu
      * to false or by setting pmsav7-dregion to 0.
      */
@@ -1787,14 +1798,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
             cpu_address_space_init(cs, ARMASIdx_TagS, "cpu-tag-memory",
                                    cpu->secure_tag_memory);
         }
-    } else if (cpu_isar_feature(aa64_mte, cpu)) {
-        /*
-         * Since there is no tag memory, we can't meaningfully support MTE
-         * to its fullest.  To avoid problems later, when we would come to
-         * use the tag memory, downgrade support to insns only.
-         */
-        cpu->isar.id_aa64pfr1 =
-            FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1);
     }
 
     cpu_address_space_init(cs, ARMASIdx_NS, "cpu-memory", cs->memory);
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 15494002d2..dd696183df 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -646,8 +646,9 @@ static void aarch64_max_initfn(Object *obj)
         t = cpu->isar.id_aa64pfr1;
         t = FIELD_DP64(t, ID_AA64PFR1, BT, 1);
         /*
-         * Begin with full support for MTE; will be downgraded to MTE=1
-         * during realize if the board provides no tag memory.
+         * Begin with full support for MTE. This will be downgraded to MTE=0
+         * during realize if the board provides no tag memory, much like
+         * we do for EL2 with the virtualization=on property.
          */
         t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2);
         cpu->isar.id_aa64pfr1 = t;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14912.37142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEX-0000H9-Cu; Thu, 29 Oct 2020 21:13:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14912.37142; Thu, 29 Oct 2020 21:13:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEX-0000H1-A4; Thu, 29 Oct 2020 21:13:21 +0000
Received: by outflank-mailman (input) for mailman id 14912;
 Thu, 29 Oct 2020 21:13:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFEW-0000Go-2a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e4fb472e-43bf-4305-b4ee-7420258aa36b;
 Thu, 29 Oct 2020 21:13:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEV-0007dl-AV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEV-0002v7-9f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFEW-0000Go-2a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:20 +0000
X-Inumbo-ID: e4fb472e-43bf-4305-b4ee-7420258aa36b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e4fb472e-43bf-4305-b4ee-7420258aa36b;
	Thu, 29 Oct 2020 21:13:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2+g56nVFj/vtB4d8lmhVqIrWU1hMmDNX0CBAjdAFln8=; b=QFWwNc4IkQSP5hVrhgOcQAJaG8
	d6LR/ksqq9LohvuMjUDwlUb3JAEl1w1pvRBocTZwEgxh1vmvJqK6XmVrFEHIXUDvT9OKX9PM3ZP/F
	xInb+jEXnAz6hRl2wR85qM2mVRzPqIHV6zAwVDPqYCHHHIvFMypvtn2JLb2zRJr+ED4A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEV-0007dl-AV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEV-0002v7-9f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/virt: Error for MTE enabled with KVM
Message-Id: <E1kYFEV-0002v7-9f@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:19 +0000

commit 7f6185ed9ca977a9836f35b994e4f85cecae8437
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/virt: Error for MTE enabled with KVM
    
    While we expect KVM to support MTE at some future point,
    it certainly won't be ready in time for qemu 5.1.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-3-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 5866c4ce20..a7f3d442db 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1773,6 +1773,12 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
+    if (vms->mte && kvm_enabled()) {
+        error_report("mach-virt: KVM does not support providing "
+                     "MTE to the guest CPU");
+        exit(1);
+    }
+
     create_fdt(vms);
 
     possible_cpus = mc->possible_cpu_arch_ids(machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14913.37146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEi-0000Lr-EU; Thu, 29 Oct 2020 21:13:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14913.37146; Thu, 29 Oct 2020 21:13:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEi-0000Lj-BZ; Thu, 29 Oct 2020 21:13:32 +0000
Received: by outflank-mailman (input) for mailman id 14913;
 Thu, 29 Oct 2020 21:13:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFEh-0000La-70
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 652baa92-1985-40bd-9ea8-4032d1e3d8f4;
 Thu, 29 Oct 2020 21:13:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEf-0007dv-E0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEf-0002vx-DI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFEh-0000La-70
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:31 +0000
X-Inumbo-ID: 652baa92-1985-40bd-9ea8-4032d1e3d8f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 652baa92-1985-40bd-9ea8-4032d1e3d8f4;
	Thu, 29 Oct 2020 21:13:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ywDH/mDENAt2zx6R8f8/p/toIjsXsi3zVINpvkEqLC0=; b=Fp8RdEsc/qYlHnuCDyZyhB/OED
	PrDmy4u4f8qcMuwXR0W20h30BYiiqVpO0ZTlGcRQYcLyIKyGo1c0VgGxEnMMwyD7juzLV45Dgd6dq
	kMcgmvmWNdnsd1i/MnsYLObiVqz8lV7u9Qt+s0TVBqiRbKC/cTCyXRjyTN3QY4VUJPg4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEf-0007dv-E0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEf-0002vx-DI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/virt: Disable memory hotplug when MTE is enabled
Message-Id: <E1kYFEf-0002vx-DI@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:29 +0000

commit 19bd6aafbd184be963d2b7c24874e3252a7088b7
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/virt: Disable memory hotplug when MTE is enabled
    
    When MTE is enabled, tag memory must exist for all RAM.
    
    It might be possible to simultaneously hot plug tag memory
    alongside the corresponding normal memory, but for now just
    disable hotplug.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-4-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a7f3d442db..ecfee362a1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2194,6 +2194,11 @@ static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
         return;
     }
 
+    if (vms->mte) {
+        error_setg(errp, "memory hotplug is not enabled: MTE is enabled");
+        return;
+    }
+
     if (is_nvdimm && !ms->nvdimms_state->is_enabled) {
         error_setg(errp, "nvdimm is not enabled: add 'nvdimm=on' to '-M'");
         return;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14914.37150 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEs-0000NJ-Fv; Thu, 29 Oct 2020 21:13:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14914.37150; Thu, 29 Oct 2020 21:13:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFEs-0000NB-D3; Thu, 29 Oct 2020 21:13:42 +0000
Received: by outflank-mailman (input) for mailman id 14914;
 Thu, 29 Oct 2020 21:13:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFEq-0000Mn-Rl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6eb4307c-3ef5-46f9-9a49-6d040db0aa63;
 Thu, 29 Oct 2020 21:13:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEp-0007e3-KF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEp-0002wt-H3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFEq-0000Mn-Rl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:40 +0000
X-Inumbo-ID: 6eb4307c-3ef5-46f9-9a49-6d040db0aa63
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6eb4307c-3ef5-46f9-9a49-6d040db0aa63;
	Thu, 29 Oct 2020 21:13:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G4nYv0aDyTwJfhZEmYQXsHMsyJDBVKYuXRyddKjihp4=; b=CfYl/r2wZn8N0fNucvRuUmbh98
	IyxE+sW61CbgfGjnGmgiIFBnpXdPFdI8LvEKxYi/OkWGtYCpFuFm5b7AusVXVS2d8ozMCkSS6yDOP
	5A+ILUbmg/B6aBHW6JY8JOnFDka6I1yE4/H6NPMquIT4d8iCTjm+6sX816m/H3J68FYU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEp-0007e3-KF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEp-0002wt-H3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] util: Implement qemu_get_thread_id() for OpenBSD
Message-Id: <E1kYFEp-0002wt-H3@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:39 +0000

commit 8edbca515c20bdbb3d2dca3c60dcc5b8ca4fc718
Author:     David CARLIER <devnexen@gmail.com>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    util: Implement qemu_get_thread_id() for OpenBSD
    
    Implement qemu_get_thread_id() for OpenBSD hosts, using
    getthrid().
    
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Reviewed-by: Brad Smith <brad@comstyle.com>
    Message-id: CA+XhMqxD6gQDBaj8tX0CMEj3si7qYKsM8u1km47e_-U7MC37Pg@mail.gmail.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: tidied up commit message]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 util/oslib-posix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 36bf8593f8..d923674624 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -100,6 +100,8 @@ int qemu_get_thread_id(void)
     return (int)tid;
 #elif defined(__NetBSD__)
     return _lwp_self();
+#elif defined(__OpenBSD__)
+    return getthrid();
 #else
     return getpid();
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:13:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:13:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14915.37153 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFF2-0000OW-Hh; Thu, 29 Oct 2020 21:13:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14915.37153; Thu, 29 Oct 2020 21:13:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFF2-0000OP-Ef; Thu, 29 Oct 2020 21:13:52 +0000
Received: by outflank-mailman (input) for mailman id 14915;
 Thu, 29 Oct 2020 21:13:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFF0-0000OE-T8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 40239154-eb0e-4df9-a37f-67fe5223774f;
 Thu, 29 Oct 2020 21:13:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEz-0007eG-OP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFEz-0002xq-NR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFF0-0000OE-T8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:50 +0000
X-Inumbo-ID: 40239154-eb0e-4df9-a37f-67fe5223774f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 40239154-eb0e-4df9-a37f-67fe5223774f;
	Thu, 29 Oct 2020 21:13:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CyrT7u3dCDBwni9ZOvKLpCjRuVsx9MDMJ+JGI8h4Dzw=; b=N9L8/O0kbN6buPDFaLx7mGKHp7
	G8dzt9PQ9p1PwwzlD0IGA68ilVE20OuaHeXQPtvCMQAhUcjSzfXEutJo4HXyRBIExnzwVzVlF8YRC
	OJaulHIMCALhSLkFN5t+hwo0uEWm6coSRj6ZUJkdk3xeKHdBKdFyo6gbnpPgvEeFEg3Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEz-0007eG-OP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFEz-0002xq-NR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qdev: Move doc comments from qdev.c to qdev-core.h
Message-Id: <E1kYFEz-0002xq-NR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:49 +0000

commit b51238e251cefb496b60d3db992af175fb354a68
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Move doc comments from qdev.c to qdev-core.h
    
    The doc-comments which document the qdev API are split between the
    header file and the C source files, because as a project we haven't
    been consistent about where we put them.
    
    Move all the doc-comments in qdev.c to the header files, so that
    users of the APIs don't have to look at the implementation files for
    this information.
    
    In the process, unify them into our doc-comment format and expand on
    them in some cases to clarify expected use cases.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-2-peter.maydell@linaro.org
---
 hw/core/qdev.c               | 33 -------------------------
 include/hw/qdev-core.h       | 57 ++++++++++++++++++++++++++++++++++++++++++++
 include/hw/qdev-properties.h | 13 ++++++++++
 3 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 01796823b4..96772a15bd 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -128,13 +128,6 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
     }
 }
 
-/*
- * Create a device on the heap.
- * A type @name must exist.
- * This only initializes the device state structure and allows
- * properties to be set.  The device still needs to be realized.  See
- * qdev-core.h.
- */
 DeviceState *qdev_new(const char *name)
 {
     if (!object_class_by_name(name)) {
@@ -143,11 +136,6 @@ DeviceState *qdev_new(const char *name)
     return DEVICE(object_new(name));
 }
 
-/*
- * Try to create a device on the heap.
- * This is like qdev_new(), except it returns %NULL when type @name
- * does not exist.
- */
 DeviceState *qdev_try_new(const char *name)
 {
     if (!module_object_class_by_name(name)) {
@@ -378,14 +366,6 @@ void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
     qdev_unrealize(dev);
 }
 
-/*
- * Realize @dev.
- * @dev must not be plugged into a bus.
- * If @bus, plug @dev into @bus.  This takes a reference to @dev.
- * If @dev has no QOM parent, make one up, taking another reference.
- * On success, return true.
- * On failure, store an error through @errp and return false.
- */
 bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp)
 {
     assert(!dev->realized && !dev->parent_bus);
@@ -399,16 +379,6 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp)
     return object_property_set_bool(OBJECT(dev), "realized", true, errp);
 }
 
-/*
- * Realize @dev and drop a reference.
- * This is like qdev_realize(), except the caller must hold a
- * (private) reference, which is dropped on return regardless of
- * success or failure.  Intended use:
- *     dev = qdev_new();
- *     [...]
- *     qdev_realize_and_unref(dev, bus, errp);
- * Now @dev can go away without further ado.
- */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp)
 {
     bool ret;
@@ -814,9 +784,6 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
                                           prop->info->description);
 }
 
-/* @qdev_alias_all_properties - Add alias properties to the source object for
- * all qdev properties on the target DeviceState.
- */
 void qdev_alias_all_properties(DeviceState *target, Object *source)
 {
     ObjectClass *class;
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index fe78073c70..2d441d1fb2 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -320,9 +320,66 @@ compat_props_add(GPtrArray *arr,
 
 /*** Board API.  This should go away once we have a machine config file.  ***/
 
+/**
+ * qdev_new: Create a device on the heap
+ * @name: device type to create (we assert() that this type exists)
+ *
+ * This only allocates the memory and initializes the device state
+ * structure, ready for the caller to set properties if they wish.
+ * The device still needs to be realized.
+ * The returned object has a reference count of 1.
+ */
 DeviceState *qdev_new(const char *name);
+/**
+ * qdev_try_new: Try to create a device on the heap
+ * @name: device type to create
+ *
+ * This is like qdev_new(), except it returns %NULL when type @name
+ * does not exist, rather than asserting.
+ */
 DeviceState *qdev_try_new(const char *name);
+/**
+ * qdev_realize: Realize @dev.
+ * @dev: device to realize
+ * @bus: bus to plug it into (may be NULL)
+ * @errp: pointer to error object
+ *
+ * "Realize" the device, i.e. perform the second phase of device
+ * initialization.
+ * @dev must not be plugged into a bus already.
+ * If @bus, plug @dev into @bus.  This takes a reference to @dev.
+ * If @dev has no QOM parent, make one up, taking another reference.
+ * On success, return true.
+ * On failure, store an error through @errp and return false.
+ *
+ * If you created @dev using qdev_new(), you probably want to use
+ * qdev_realize_and_unref() instead.
+ */
 bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp);
+/**
+ * qdev_realize_and_unref: Realize @dev and drop a reference
+ * @dev: device to realize
+ * @bus: bus to plug it into (may be NULL)
+ * @errp: pointer to error object
+ *
+ * Realize @dev and drop a reference.
+ * This is like qdev_realize(), except the caller must hold a
+ * (private) reference, which is dropped on return regardless of
+ * success or failure.  Intended use::
+ *
+ *     dev = qdev_new();
+ *     [...]
+ *     qdev_realize_and_unref(dev, bus, errp);
+ *
+ * Now @dev can go away without further ado.
+ *
+ * If you are embedding the device into some other QOM device and
+ * initialized it via some variant on object_initialize_child() then
+ * do not use this function, because that family of functions arrange
+ * for the only reference to the child device to be held by the parent
+ * via the child<> property, and so the reference-count-drop done here
+ * would be incorrect. For that use case you want qdev_realize().
+ */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);
 void qdev_unrealize(DeviceState *dev);
 void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 587e5b7d31..8f3a98cba6 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -282,6 +282,19 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
  */
 void qdev_property_add_static(DeviceState *dev, Property *prop);
 
+/**
+ * qdev_alias_all_properties: Create aliases on source for all target properties
+ * @target: Device which has properties to be aliased
+ * @source: Object to add alias properties to
+ *
+ * Add alias properties to the @source object for all qdev properties on
+ * the @target DeviceState.
+ *
+ * This is useful when @target is an internal implementation object
+ * owned by @source, and you want to expose all the properties of that
+ * implementation object as properties on the @source object so that users
+ * of @source can set them.
+ */
 void qdev_alias_all_properties(DeviceState *target, Object *source);
 
 /**
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14916.37158 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFC-0000Qe-Kc; Thu, 29 Oct 2020 21:14:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14916.37158; Thu, 29 Oct 2020 21:14:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFC-0000QW-Hm; Thu, 29 Oct 2020 21:14:02 +0000
Received: by outflank-mailman (input) for mailman id 14916;
 Thu, 29 Oct 2020 21:14:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFA-0000Pg-Q4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id edc4bbdc-dd76-4961-a978-7413e0923339;
 Thu, 29 Oct 2020 21:14:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFF9-0007ep-SE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFF9-0002yq-RH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFA-0000Pg-Q4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:00 +0000
X-Inumbo-ID: edc4bbdc-dd76-4961-a978-7413e0923339
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id edc4bbdc-dd76-4961-a978-7413e0923339;
	Thu, 29 Oct 2020 21:14:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=afcQTjxMb+MUudTpHHXVtEV7Ken2N78j1SX/vg4CMGQ=; b=KBMZM+SzAy/gOb8Uv3WCtw7UYQ
	9H37mjCePol2gor7iEDZCoZPNZf9ueUOMuFlsknxfsWD6UplUHofyxy2plN9Ajumz2R8BeS8QnSo8
	JVSLHPtat8lQUx5swgl+oPXlnhwajySDGWzA5EZ7WhKHIwpBrcb3XUd+0BKJCjjpOfI8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFF9-0007ep-SE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFF9-0002yq-RH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:13:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qdev: Document qdev_unrealize()
Message-Id: <E1kYFF9-0002yq-RH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:13:59 +0000

commit 46ea1be1ee72b778043e60c8a59cbcb53fb8be34
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Document qdev_unrealize()
    
    Add a doc comment for qdev_unrealize(), to go with the new
    documentation for the realize part of the qdev lifecycle.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-3-peter.maydell@linaro.org
---
 include/hw/qdev-core.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 2d441d1fb2..1d2bf5f37d 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -381,6 +381,25 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp);
  * would be incorrect. For that use case you want qdev_realize().
  */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);
+/**
+ * qdev_unrealize: Unrealize a device
+ * @dev: device to unrealize
+ *
+ * This function will "unrealize" a device, which is the first phase
+ * of correctly destroying a device that has been realized. It will:
+ *
+ *  - unrealize any child buses by calling qbus_unrealize()
+ *    (this will recursively unrealize any devices on those buses)
+ *  - call the the unrealize method of @dev
+ *
+ * The device can then be freed by causing its reference count to go
+ * to zero.
+ *
+ * Warning: most devices in QEMU do not expect to be unrealized.  Only
+ * devices which are hot-unpluggable should be unrealized (as part of
+ * the unplugging process); all other devices are expected to last for
+ * the life of the simulation and should not be unrealized and freed.
+ */
 void qdev_unrealize(DeviceState *dev);
 void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
                                  int required_for_version);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14918.37173 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFM-0000To-UE; Thu, 29 Oct 2020 21:14:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14918.37173; Thu, 29 Oct 2020 21:14:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFM-0000Tf-R5; Thu, 29 Oct 2020 21:14:12 +0000
Received: by outflank-mailman (input) for mailman id 14918;
 Thu, 29 Oct 2020 21:14:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFL-0000TG-EI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2de315a9-ad03-4ee3-9b63-9804ef1b0bab;
 Thu, 29 Oct 2020 21:14:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFK-0007fF-04
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFJ-000301-V7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFL-0000TG-EI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:11 +0000
X-Inumbo-ID: 2de315a9-ad03-4ee3-9b63-9804ef1b0bab
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2de315a9-ad03-4ee3-9b63-9804ef1b0bab;
	Thu, 29 Oct 2020 21:14:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V4dgZG+i6wUxF4kx/0jtsa+unqq2cW7S++m2HKpbO7s=; b=a1z/99fYWB1kMYKgThNLirqYDb
	zxr5G+eLK0cj+6bGfv9JA8/U1JccHffyeW2egLyt6+4Yp2dTGfIkgs/PvbahVEHQrJfPkw++M0evH
	jLck8ZGNmwNyjBKJIWM9Nlk26aDxLgl0X3UJJgdBnoCO718UbN9cYKJJcU9swgKTTGLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFK-0007fF-04
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFJ-000301-V7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qdev: Document GPIO related functions
Message-Id: <E1kYFFJ-000301-V7@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:14:09 +0000

commit cd07d7f9f5117954edd9a9bbd97b0442eecf5c49
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Document GPIO related functions
    
    Add documentation comments for the various qdev functions
    related to creating and connecting GPIO lines.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-4-peter.maydell@linaro.org
---
 include/hw/qdev-core.h | 191 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 189 insertions(+), 2 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 1d2bf5f37d..ea3f73a282 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -424,13 +424,132 @@ void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
 void qdev_machine_creation_done(void);
 bool qdev_machine_modified(void);
 
+/**
+ * qdev_get_gpio_in: Get one of a device's anonymous input GPIO lines
+ * @dev: Device whose GPIO we want
+ * @n: Number of the anonymous GPIO line (which must be in range)
+ *
+ * Returns the qemu_irq corresponding to an anonymous input GPIO line
+ * (which the device has set up with qdev_init_gpio_in()). The index
+ * @n of the GPIO line must be valid (i.e. be at least 0 and less than
+ * the total number of anonymous input GPIOs the device has); this
+ * function will assert() if passed an invalid index.
+ *
+ * This function is intended to be used by board code or SoC "container"
+ * device models to wire up the GPIO lines; usually the return value
+ * will be passed to qdev_connect_gpio_out() or a similar function to
+ * connect another device's output GPIO line to this input.
+ *
+ * For named input GPIO lines, use qdev_get_gpio_in_named().
+ */
 qemu_irq qdev_get_gpio_in(DeviceState *dev, int n);
+/**
+ * qdev_get_gpio_in_named: Get one of a device's named input GPIO lines
+ * @dev: Device whose GPIO we want
+ * @name: Name of the input GPIO array
+ * @n: Number of the GPIO line in that array (which must be in range)
+ *
+ * Returns the qemu_irq corresponding to a named input GPIO line
+ * (which the device has set up with qdev_init_gpio_in_named()).
+ * The @name string must correspond to an input GPIO array which exists on
+ * the device, and the index @n of the GPIO line must be valid (i.e.
+ * be at least 0 and less than the total number of input GPIOs in that
+ * array); this function will assert() if passed an invalid name or index.
+ *
+ * For anonymous input GPIO lines, use qdev_get_gpio_in().
+ */
 qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n);
 
+/**
+ * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines
+ * @dev: Device whose GPIO to connect
+ * @n: Number of the anonymous output GPIO line (which must be in range)
+ * @pin: qemu_irq to connect the output line to
+ *
+ * This function connects an anonymous output GPIO line on a device
+ * up to an arbitrary qemu_irq, so that when the device asserts that
+ * output GPIO line, the qemu_irq's callback is invoked.
+ * The index @n of the GPIO line must be valid (i.e. be at least 0 and
+ * less than the total number of anonymous output GPIOs the device has
+ * created with qdev_init_gpio_out()); otherwise this function will assert().
+ *
+ * Outbound GPIO lines can be connected to any qemu_irq, but the common
+ * case is connecting them to another device's inbound GPIO line, using
+ * the qemu_irq returned by qdev_get_gpio_in() or qdev_get_gpio_in_named().
+ *
+ * It is not valid to try to connect one outbound GPIO to multiple
+ * qemu_irqs at once, or to connect multiple outbound GPIOs to the
+ * same qemu_irq. (Warning: there is no assertion or other guard to
+ * catch this error: the model will just not do the right thing.)
+ * Instead, for fan-out you can use the TYPE_IRQ_SPLIT device: connect
+ * a device's outbound GPIO to the splitter's input, and connect each
+ * of the splitter's outputs to a different device.  For fan-in you
+ * can use the TYPE_OR_IRQ device, which is a model of a logical OR
+ * gate with multiple inputs and one output.
+ *
+ * For named output GPIO lines, use qdev_connect_gpio_out_named().
+ */
 void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
+/**
+ * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines
+ * @dev: Device whose GPIO to connect
+ * @name: Name of the output GPIO array
+ * @n: Number of the anonymous output GPIO line (which must be in range)
+ * @pin: qemu_irq to connect the output line to
+ *
+ * This function connects an anonymous output GPIO line on a device
+ * up to an arbitrary qemu_irq, so that when the device asserts that
+ * output GPIO line, the qemu_irq's callback is invoked.
+ * The @name string must correspond to an output GPIO array which exists on
+ * the device, and the index @n of the GPIO line must be valid (i.e.
+ * be at least 0 and less than the total number of input GPIOs in that
+ * array); this function will assert() if passed an invalid name or index.
+ *
+ * Outbound GPIO lines can be connected to any qemu_irq, but the common
+ * case is connecting them to another device's inbound GPIO line, using
+ * the qemu_irq returned by qdev_get_gpio_in() or qdev_get_gpio_in_named().
+ *
+ * It is not valid to try to connect one outbound GPIO to multiple
+ * qemu_irqs at once, or to connect multiple outbound GPIOs to the
+ * same qemu_irq; see qdev_connect_gpio_out() for details.
+ *
+ * For named output GPIO lines, use qdev_connect_gpio_out_named().
+ */
 void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
                                  qemu_irq pin);
+/**
+ * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GPIO
+ * @dev: Device whose output GPIO we are interested in
+ * @name: Name of the output GPIO array
+ * @n: Number of the output GPIO line within that array
+ *
+ * Returns whatever qemu_irq is currently connected to the specified
+ * output GPIO line of @dev. This will be NULL if the output GPIO line
+ * has never been wired up to the anything.  Note that the qemu_irq
+ * returned does not belong to @dev -- it will be the input GPIO or
+ * IRQ of whichever device the board code has connected up to @dev's
+ * output GPIO.
+ *
+ * You probably don't need to use this function -- it is used only
+ * by the platform-bus subsystem.
+ */
 qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n);
+/**
+ * qdev_intercept_gpio_out: Intercept an existing GPIO connection
+ * @dev: Device to intercept the outbound GPIO line from
+ * @icpt: New qemu_irq to connect instead
+ * @name: Name of the output GPIO array
+ * @n: Number of the GPIO line in the array
+ *
+ * This function is provided only for use by the qtest testing framework
+ * and is not suitable for use in non-testing parts of QEMU.
+ *
+ * This function breaks an existing connection of an outbound GPIO
+ * line from @dev, and replaces it with the new qemu_irq @icpt, as if
+ * ``qdev_connect_gpio_out_named(dev, icpt, name, n)`` had been called.
+ * The previously connected qemu_irq is returned, so it can be restored
+ * by a second call to qdev_intercept_gpio_out() if desired.
+ */
 qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt,
                                  const char *name, int n);
 
@@ -438,10 +557,59 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name);
 
 /*** Device API.  ***/
 
-/* Register device properties.  */
-/* GPIO inputs also double as IRQ sinks.  */
+/**
+ * qdev_init_gpio_in: create an array of anonymous input GPIO lines
+ * @dev: Device to create input GPIOs for
+ * @handler: Function to call when GPIO line value is set
+ * @n: Number of GPIO lines to create
+ *
+ * Devices should use functions in the qdev_init_gpio_in* family in
+ * their instance_init or realize methods to create any input GPIO
+ * lines they need. There is no functional difference between
+ * anonymous and named GPIO lines. Stylistically, named GPIOs are
+ * preferable (easier to understand at callsites) unless a device
+ * has exactly one uniform kind of GPIO input whose purpose is obvious.
+ * Note that input GPIO lines can serve as 'sinks' for IRQ lines.
+ *
+ * See qdev_get_gpio_in() for how code that uses such a device can get
+ * hold of an input GPIO line to manipulate it.
+ */
 void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
+/**
+ * qdev_init_gpio_out: create an array of anonymous output GPIO lines
+ * @dev: Device to create output GPIOs for
+ * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines
+ * @n: Number of GPIO lines to create
+ *
+ * Devices should use functions in the qdev_init_gpio_out* family
+ * in their instance_init or realize methods to create any output
+ * GPIO lines they need. There is no functional difference between
+ * anonymous and named GPIO lines. Stylistically, named GPIOs are
+ * preferable (easier to understand at callsites) unless a device
+ * has exactly one uniform kind of GPIO output whose purpose is obvious.
+ *
+ * The @pins argument should be a pointer to either a "qemu_irq"
+ * (if @n == 1) or a "qemu_irq []" array (if @n > 1) in the device's
+ * state structure. The device implementation can then raise and
+ * lower the GPIO line by calling qemu_set_irq(). (If anything is
+ * connected to the other end of the GPIO this will cause the handler
+ * function for that input GPIO to be called.)
+ *
+ * See qdev_connect_gpio_out() for how code that uses such a device
+ * can connect to one of its output GPIO lines.
+ */
 void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
+/**
+ * qdev_init_gpio_out: create an array of named output GPIO lines
+ * @dev: Device to create output GPIOs for
+ * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines
+ * @name: Name to give this array of GPIO lines
+ * @n: Number of GPIO lines to create
+ *
+ * Like qdev_init_gpio_out(), but creates an array of GPIO output lines
+ * with a name. Code using the device can then connect these GPIO lines
+ * using qdev_connect_gpio_out_named().
+ */
 void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins,
                               const char *name, int n);
 /**
@@ -473,6 +641,25 @@ static inline void qdev_init_gpio_in_named(DeviceState *dev,
     qdev_init_gpio_in_named_with_opaque(dev, handler, dev, name, n);
 }
 
+/**
+ * qdev_pass_gpios: create GPIO lines on container which pass through to device
+ * @dev: Device which has GPIO lines
+ * @container: Container device which needs to expose them
+ * @name: Name of GPIO array to pass through (NULL for the anonymous GPIO array)
+ *
+ * In QEMU, complicated devices like SoCs are often modelled with a
+ * "container" QOM device which itself contains other QOM devices and
+ * which wires them up appropriately. This function allows the container
+ * to create GPIO arrays on itself which simply pass through to a GPIO
+ * array of one of its internal devices.
+ *
+ * If @dev has both input and output GPIOs named @name then both will
+ * be passed through. It is not possible to pass a subset of the array
+ * with this function.
+ *
+ * To users of the container device, the GPIO array created on @container
+ * behaves exactly like any other.
+ */
 void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
                      const char *name);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14920.37179 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFZ-0000Xv-W5; Thu, 29 Oct 2020 21:14:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14920.37179; Thu, 29 Oct 2020 21:14:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFZ-0000Xj-Sm; Thu, 29 Oct 2020 21:14:25 +0000
Received: by outflank-mailman (input) for mailman id 14920;
 Thu, 29 Oct 2020 21:14:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFY-0000WB-3w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f7c6e7fd-06b1-4d52-8cc5-d2bac7f418ff;
 Thu, 29 Oct 2020 21:14:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFU-0007fM-42
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFU-000312-2z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFY-0000WB-3w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:24 +0000
X-Inumbo-ID: f7c6e7fd-06b1-4d52-8cc5-d2bac7f418ff
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f7c6e7fd-06b1-4d52-8cc5-d2bac7f418ff;
	Thu, 29 Oct 2020 21:14:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5LpalwiSgDMSzEgv4pO7ps30podJxmTWUvg3ujockp8=; b=z9/cBNEpOLxvbxXL2sM3jPL0SC
	0wtkx3VEME0MvPoU2KjZRcVsFtGvWkIjIsJGtP87HQ+gFkQdqt3ITRpzQ8tI7F8e3NdIKYlUJCr4Q
	s775F8Py75j6DE5waTDkp63e/4yGoujaIaCz5Y3kacdfwxO8FYXAjmPOaGdBDbD2pHZU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFU-0007fM-42
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFU-000312-2z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
Message-Id: <E1kYFFU-000312-2z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:14:20 +0000

commit 3f410039b79c0468e18142c6ddfede6f6f7b0427
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 15:37:16 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
    
    In armsse_realize() we have a loop over [0, info->num_cpus), which
    indexes into various fixed-size arrays in the ARMSSE struct.  This
    confuses Coverity, which warns that we might overrun those arrays
    (CID 1430326, 1430337, 1430371, 1430414, 1430430).  This can't
    actually happen, because the info struct is always one of the entries
    in the armsse_variants[] array and num_cpus is either 1 or 2; we also
    already assert in armsse_init() that num_cpus is not too large.
    However, adding an assert to armsse_realize() like the one in
    armsse_init() should help Coverity figure out that these code paths
    aren't possible.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200713143716.9881-1-peter.maydell@linaro.org
---
 hw/arm/armsse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 64fcab895f..dcbff9bd8f 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -452,6 +452,8 @@ static void armsse_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    assert(info->num_cpus <= SSE_MAX_CPUS);
+
     /* max SRAM_ADDR_WIDTH: 24 - log2(SRAM_NUM_BANK) */
     assert(is_power_of_2(info->sram_banks));
     addr_width_max = 24 - ctz32(info->sram_banks);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14923.37182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFh-0000ZN-0s; Thu, 29 Oct 2020 21:14:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14923.37182; Thu, 29 Oct 2020 21:14:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFg-0000ZE-UC; Thu, 29 Oct 2020 21:14:32 +0000
Received: by outflank-mailman (input) for mailman id 14923;
 Thu, 29 Oct 2020 21:14:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFf-0000Z0-1n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 756dbb53-29c6-415a-9802-f9ea54f8a451;
 Thu, 29 Oct 2020 21:14:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFe-0007fX-88
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFe-00032O-7L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFf-0000Z0-1n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:31 +0000
X-Inumbo-ID: 756dbb53-29c6-415a-9802-f9ea54f8a451
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 756dbb53-29c6-415a-9802-f9ea54f8a451;
	Thu, 29 Oct 2020 21:14:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t4cHS3M9+bU2wah5sl3s4IY6ax5igXJCh1ob9hMhN4Y=; b=Iru/0LIb2SKx3lNnEwJKhImnIW
	LMAx8/jnSzZBCbjYfeY/m96rpgtmHh/xGCrkklZxNzwFAG6mxSVqzd1FxeTe0ywo5Bh5V1m6FzGvI
	jvboVj9yS6zUTX3B/frw+RupBgj8Ad+8cmJw1MrYudiXaBJUgHmg4eG+stUT7xKWuOVo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFe-0007fX-88
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFe-00032O-7L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system: Briefly document canon-a1100 board
Message-Id: <E1kYFFe-00032O-7L@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:14:30 +0000

commit 2d21dd17c560a574e19ba94d07173924bf74571b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:43 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document canon-a1100 board
    
    Add skeletal documentation of the canon-a1100 board.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-2-peter.maydell@linaro.org
---
 MAINTAINERS                |  1 +
 docs/system/arm/digic.rst  | 11 +++++++++++
 docs/system/target-arm.rst |  1 +
 3 files changed, 13 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5d9c56e441..9ed36dcf73 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -636,6 +636,7 @@ F: include/hw/arm/digic.h
 F: hw/*/digic*
 F: include/hw/*/digic*
 F: tests/acceptance/machine_arm_canona1100.py
+F: docs/system/arm/digic.rst
 
 Goldfish RTC
 M: Anup Patel <anup.patel@wdc.com>
diff --git a/docs/system/arm/digic.rst b/docs/system/arm/digic.rst
new file mode 100644
index 0000000000..2b3520ff5e
--- /dev/null
+++ b/docs/system/arm/digic.rst
@@ -0,0 +1,11 @@
+Canon A1100 (``canon-a1100``)
+=============================
+
+This machine is a model of the Canon PowerShot A1100 camera, which
+uses the DIGIC SoC. This model is based on reverse engineering efforts
+by the contributors to the `CHDK <http://chdk.wikia.com/>`_ and
+`Magic Lantern <http://www.magiclantern.fm/>`_ projects.
+
+The emulation is incomplete. In particular it can't be used
+to run the original camera firmware, but it can successfully run
+an experimental version of the `barebox bootloader <http://www.barebox.org/>`_.
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 1bd477a293..8fa51a2281 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -82,6 +82,7 @@ undocumented; you can get a complete list by running
    arm/versatile
    arm/vexpress
    arm/aspeed
+   arm/digic
    arm/musicpal
    arm/nseries
    arm/orangepi
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14924.37187 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFr-0000b5-2r; Thu, 29 Oct 2020 21:14:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14924.37187; Thu, 29 Oct 2020 21:14:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFFq-0000aw-Vj; Thu, 29 Oct 2020 21:14:42 +0000
Received: by outflank-mailman (input) for mailman id 14924;
 Thu, 29 Oct 2020 21:14:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFp-0000ah-FB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c4b24028-fa86-4674-9cf1-606b466bbe35;
 Thu, 29 Oct 2020 21:14:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFo-0007fj-Bz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFo-00033g-B4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFp-0000ah-FB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:41 +0000
X-Inumbo-ID: c4b24028-fa86-4674-9cf1-606b466bbe35
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c4b24028-fa86-4674-9cf1-606b466bbe35;
	Thu, 29 Oct 2020 21:14:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uLDE8Qmxg2Prn0D5/NSZAYiVGvMvyT6sYi3vDFFBQuk=; b=KtiGZQjxLuTzPwUhJ+eYuUNnhf
	Fq9YWAk7I88jECl7xwWAzw58PWu4uzcQ5wJiOko8e1zy0Rb4B+Q59sAR6WycyIyBhfNT7pVLWpNt3
	cWCf6GhLftaF8aZnn34W6SXLUbDxQKloTuLR2tfKxVeZzBhkZe4CIdugoJnVIKkfzjuk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFo-0007fj-Bz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFo-00033g-B4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system: Briefly document collie board
Message-Id: <E1kYFFo-00033g-B4@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:14:40 +0000

commit b76b60f59bb95f9184bb70ea62f3db7b65730478
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document collie board
    
    Add skeletal documentation of the collie board.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-3-peter.maydell@linaro.org
---
 MAINTAINERS                |  1 +
 docs/system/arm/collie.rst | 16 ++++++++++++++++
 docs/system/target-arm.rst |  1 +
 3 files changed, 18 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9ed36dcf73..6973b68975 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -847,6 +847,7 @@ L: qemu-arm@nongnu.org
 S: Odd Fixes
 F: hw/arm/collie.c
 F: hw/arm/strongarm*
+F: docs/system/arm/collie.rst
 
 Stellaris
 M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/docs/system/arm/collie.rst b/docs/system/arm/collie.rst
new file mode 100644
index 0000000000..5cc67b6d1b
--- /dev/null
+++ b/docs/system/arm/collie.rst
@@ -0,0 +1,16 @@
+Sharp Zaurus SL-5500 (``collie``)
+=================================
+
+This machine is a model of the Sharp Zaurus SL-5500, which was
+a 1990s PDA based on the StrongARM SA1110.
+
+Implemented devices:
+
+ * NOR flash
+ * Interrupt controller
+ * Timer
+ * RTC
+ * GPIO
+ * Peripheral Pin Controller (PPC)
+ * UARTs
+ * Synchronous Serial Ports (SSP)
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 8fa51a2281..376c18f0b1 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -88,6 +88,7 @@ undocumented; you can get a complete list by running
    arm/orangepi
    arm/palm
    arm/xscale
+   arm/collie
    arm/sx1
    arm/stellaris
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:14:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:14:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14925.37190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFG0-0000cZ-5n; Thu, 29 Oct 2020 21:14:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14925.37190; Thu, 29 Oct 2020 21:14:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFG0-0000cQ-2N; Thu, 29 Oct 2020 21:14:52 +0000
Received: by outflank-mailman (input) for mailman id 14925;
 Thu, 29 Oct 2020 21:14:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFFz-0000cI-AR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c61cfa83-e34e-479b-9a43-9e4baa08abda;
 Thu, 29 Oct 2020 21:14:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFy-0007fq-GV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFFy-00034u-FK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFFz-0000cI-AR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:51 +0000
X-Inumbo-ID: c61cfa83-e34e-479b-9a43-9e4baa08abda
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c61cfa83-e34e-479b-9a43-9e4baa08abda;
	Thu, 29 Oct 2020 21:14:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7LMi+zXTV3obTBlrqIsxOgllRFhNAfpcRqiZ2SzRZ9k=; b=SImOGSqLL+RxiZ7huwB1YHWunN
	T2STVg8ejMTOrxhE2vOYGcr4O8EpgDfQVH8ByKkjw5Kvg4NcsVSItVXnNytLaLEd8dUOPaIagtiLN
	abFXsGXXTQJlFuhUs6lf5qyOFkt7X6ZJvtJJFid5e376AQjxCAnSJAdWvN3sQGovp1sg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFy-0007fq-GV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFFy-00034u-FK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:14:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system: Briefly document gumstix boards
Message-Id: <E1kYFFy-00034u-FK@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:14:50 +0000

commit bb309000c818b4ff4763ebc38b1c4bfae56ddf37
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:45 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document gumstix boards
    
    Add skeletal documentation of the gumstix boards
    ('connex' and 'verdex').
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-4-peter.maydell@linaro.org
---
 MAINTAINERS                 |  1 +
 docs/system/arm/gumstix.rst | 21 +++++++++++++++++++++
 docs/system/target-arm.rst  |  1 +
 3 files changed, 23 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6973b68975..935ccb3ab3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -652,6 +652,7 @@ R: Philippe Mathieu-Daudé <f4bug@amsat.org>
 L: qemu-arm@nongnu.org
 S: Odd Fixes
 F: hw/arm/gumstix.c
+F: docs/system/arm/gumstix.rst
 
 i.MX25 PDK
 M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/docs/system/arm/gumstix.rst b/docs/system/arm/gumstix.rst
new file mode 100644
index 0000000000..cb373139dc
--- /dev/null
+++ b/docs/system/arm/gumstix.rst
@@ -0,0 +1,21 @@
+Gumstix Connex and Verdex (``connex``, ``verdex``)
+==================================================
+
+These machines model the Gumstix Connex and Verdex boards.
+The Connex has a PXA255 CPU and the Verdex has a PXA270.
+
+Implemented devices:
+
+ * NOR flash
+ * SMC91C111 ethernet
+ * Interrupt controller
+ * DMA
+ * Timer
+ * GPIO
+ * MMC/SD card
+ * Fast infra-red communications port (FIR)
+ * LCD controller
+ * Synchronous serial ports (SPI)
+ * PCMCIA interface
+ * I2C
+ * I2S
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 376c18f0b1..163ab91559 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -84,6 +84,7 @@ undocumented; you can get a complete list by running
    arm/aspeed
    arm/digic
    arm/musicpal
+   arm/gumstix
    arm/nseries
    arm/orangepi
    arm/palm
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14926.37194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGB-0000eY-7F; Thu, 29 Oct 2020 21:15:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14926.37194; Thu, 29 Oct 2020 21:15:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGB-0000eP-48; Thu, 29 Oct 2020 21:15:03 +0000
Received: by outflank-mailman (input) for mailman id 14926;
 Thu, 29 Oct 2020 21:15:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFG9-0000eE-S8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e485ae77-0566-4dbc-9a20-2f77d274da68;
 Thu, 29 Oct 2020 21:15:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFG8-0007ge-KB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFG8-00035y-JR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFG9-0000eE-S8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:01 +0000
X-Inumbo-ID: e485ae77-0566-4dbc-9a20-2f77d274da68
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e485ae77-0566-4dbc-9a20-2f77d274da68;
	Thu, 29 Oct 2020 21:15:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WlgVWuZD+NOc4e/N86hjDehHsvhbjjfYaANaG/jMaNA=; b=lbUlssPjIltI39syzzb+NK+3p9
	eMIHy7JAFbuYFK0GGXB5XwdkCRcOp4uH6/oa2HQ7wk/ISQtZ3vSix+6TF0hxoImeH5tdbOfboHPfJ
	yx8+sVeWN1vbk0OYV05La4lUtFTdKNLREfz0vmqCb+CIrOQrdm+fqe7HjVqDxW0B+/pk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFG8-0007ge-KB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFG8-00035y-JR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system: Document the arm virt board
Message-Id: <E1kYFG8-00035y-JR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:00 +0000

commit 6a0b7505f1fd6769c3f1558fda76464d51e4118a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Document the arm virt board
    
    Document the arm 'virt' board, which has been undocumented
    for far too long given that it is the main recommended board
    type for arm guests.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-5-peter.maydell@linaro.org
---
 MAINTAINERS                |   1 +
 docs/system/arm/virt.rst   | 161 +++++++++++++++++++++++++++++++++++++++++++++
 docs/system/target-arm.rst |   1 +
 3 files changed, 163 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 935ccb3ab3..5e8616821a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -880,6 +880,7 @@ L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/virt*
 F: include/hw/arm/virt.h
+F: docs/system/arm/virt.rst
 
 Xilinx Zynq
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
new file mode 100644
index 0000000000..6621ab7205
--- /dev/null
+++ b/docs/system/arm/virt.rst
@@ -0,0 +1,161 @@
+'virt' generic virtual platform (``virt``)
+==========================================
+
+The `virt` board is a platform which does not correspond to any
+real hardware; it is designed for use in virtual machines.
+It is the recommended board type if you simply want to run
+a guest such as Linux and do not care about reproducing the
+idiosyncrasies and limitations of a particular bit of real-world
+hardware.
+
+This is a "versioned" board model, so as well as the ``virt`` machine
+type itself (which may have improvements, bugfixes and other minor
+changes between QEMU versions) a version is provided that guarantees
+to have the same behaviour as that of previous QEMU releases, so
+that VM migration will work between QEMU versions. For instance the
+``virt-5.0`` machine type will behave like the ``virt`` machine from
+the QEMU 5.0 release, and migration should work between ``virt-5.0``
+of the 5.0 release and ``virt-5.0`` of the 5.1 release. Migration
+is not guaranteed to work between different QEMU releases for
+the non-versioned ``virt`` machine type.
+
+Supported devices
+"""""""""""""""""
+
+The virt board supports:
+
+- PCI/PCIe devices
+- Flash memory
+- One PL011 UART
+- An RTC
+- The fw_cfg device that allows a guest to obtain data from QEMU
+- A PL061 GPIO controller
+- An optional SMMUv3 IOMMU
+- hotpluggable DIMMs
+- hotpluggable NVDIMMs
+- An MSI controller (GICv2M or ITS). GICv2M is selected by default along
+  with GICv2. ITS is selected by default with GICv3 (>= virt-2.7). Note
+  that ITS is not modeled in TCG mode.
+- 32 virtio-mmio transport devices
+- running guests using the KVM accelerator on aarch64 hardware
+- large amounts of RAM (at least 255GB, and more if using highmem)
+- many CPUs (up to 512 if using a GICv3 and highmem)
+- Secure-World-only devices if the CPU has TrustZone:
+
+  - A second PL011 UART
+  - A secure flash memory
+  - 16MB of secure RAM
+
+Supported guest CPU types:
+
+- ``cortex-a7`` (32-bit)
+- ``cortex-a15`` (32-bit; the default)
+- ``cortex-a53`` (64-bit)
+- ``cortex-a57`` (64-bit)
+- ``cortex-a72`` (64-bit)
+- ``host`` (with KVM only)
+- ``max`` (same as ``host`` for KVM; best possible emulation with TCG)
+
+Note that the default is ``cortex-a15``, so for an AArch64 guest you must
+specify a CPU type.
+
+Graphics output is available, but unlike the x86 PC machine types
+there is no default display device enabled: you should select one from
+the Display devices section of "-device help". The recommended option
+is ``virtio-gpu-pci``; this is the only one which will work correctly
+with KVM. You may also need to ensure your guest kernel is configured
+with support for this; see below.
+
+Machine-specific options
+""""""""""""""""""""""""
+
+The following machine-specific options are supported:
+
+secure
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Security Extensions (TrustZone). The default is ``off``.
+
+virtualization
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Virtualization Extensions. The default is ``off``.
+
+highmem
+  Set ``on``/``off`` to enable/disable placing devices and RAM in physical
+  address space above 32 bits. The default is ``on`` for machine types
+  later than ``virt-2.12``.
+
+gic-version
+  Specify the version of the Generic Interrupt Controller (GIC) to provide.
+  Valid values are:
+
+  ``2``
+    GICv2
+  ``3``
+    GICv3
+  ``host``
+    Use the same GIC version the host provides, when using KVM
+  ``max``
+    Use the best GIC version possible (same as host when using KVM;
+    currently same as ``3``` for TCG, but this may change in future)
+
+its
+  Set ``on``/``off`` to enable/disable ITS instantiation. The default is ``on``
+  for machine types later than ``virt-2.7``.
+
+iommu
+  Set the IOMMU type to create for the guest. Valid values are:
+
+  ``none``
+    Don't create an IOMMU (the default)
+  ``smmuv3``
+    Create an SMMUv3
+
+ras
+  Set ``on``/``off`` to enable/disable reporting host memory errors to a guest
+  using ACPI and guest external abort exceptions. The default is off.
+
+Linux guest kernel configuration
+""""""""""""""""""""""""""""""""
+
+The 'defconfig' for Linux arm and arm64 kernels should include the
+right device drivers for virtio and the PCI controller; however some older
+kernel versions, especially for 32-bit Arm, did not have everything
+enabled by default. If you're not seeing PCI devices that you expect,
+then check that your guest config has::
+
+  CONFIG_PCI=y
+  CONFIG_VIRTIO_PCI=y
+  CONFIG_PCI_HOST_GENERIC=y
+
+If you want to use the ``virtio-gpu-pci`` graphics device you will also
+need::
+
+  CONFIG_DRM=y
+  CONFIG_DRM_VIRTIO_GPU=y
+
+Hardware configuration information for bare-metal programming
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The ``virt`` board automatically generates a device tree blob ("dtb")
+which it passes to the guest. This provides information about the
+addresses, interrupt lines and other configuration of the various devices
+in the system. Guest code can rely on and hard-code the following
+addresses:
+
+- Flash memory starts at address 0x0000_0000
+
+- RAM starts at 0x4000_0000
+
+All other information about device locations may change between
+QEMU versions, so guest code must look in the DTB.
+
+QEMU supports two types of guest image boot for ``virt``, and
+the way for the guest code to locate the dtb binary differs:
+
+- For guests using the Linux kernel boot protocol (this means any
+  non-ELF file passed to the QEMU ``-kernel`` option) the address
+  of the DTB is passed in a register (``r2`` for 32-bit guests,
+  or ``x0`` for 64-bit guests)
+
+- For guests booting as "bare-metal" (any other kind of boot),
+  the DTB is at the start of RAM (0x4000_0000)
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 163ab91559..4c5b0e4aab 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -92,6 +92,7 @@ undocumented; you can get a complete list by running
    arm/collie
    arm/sx1
    arm/stellaris
+   arm/virt
 
 Arm CPU features
 ================
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14927.37198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGL-0000fo-8m; Thu, 29 Oct 2020 21:15:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14927.37198; Thu, 29 Oct 2020 21:15:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGL-0000fh-5q; Thu, 29 Oct 2020 21:15:13 +0000
Received: by outflank-mailman (input) for mailman id 14927;
 Thu, 29 Oct 2020 21:15:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFGJ-0000fW-TI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0faa33a5-abfc-4caf-8138-596652683a93;
 Thu, 29 Oct 2020 21:15:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGI-0007hC-P8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGI-00037p-NR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFGJ-0000fW-TI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:11 +0000
X-Inumbo-ID: 0faa33a5-abfc-4caf-8138-596652683a93
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0faa33a5-abfc-4caf-8138-596652683a93;
	Thu, 29 Oct 2020 21:15:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NTS++DUVLka/L6ClrSJnjCz4ckwa5Yd3lkMcBRWQsRs=; b=lKPMwT89iDM4j08HC7dUiD0WpU
	EKRfDu5qSLgdI2PYreL73MNXGQxOluAHQZgvONo5uYwP5yS8iVlK1ptNCjHLABJrw9PX83Q10fO2m
	jae3SNYMWW3nahOu0AepsyCUmMJT0OkE8Pm/VuEWPyQjMy1SBGMEL5m5TGEzc37alrOk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGI-0007hC-P8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGI-00037p-NR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200720' into staging
Message-Id: <E1kYFGI-00037p-NR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:10 +0000

commit af3d69058e09bede9900f266a618ed11f76f49f3
Merge: 1e6c50ad8559c18b21041ef69d8fff781a8db0bb 6a0b7505f1fd6769c3f1558fda76464d51e4118a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 15:58:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 15:58:07 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200720' into staging
    
    target-arm queue:
     * virt: Don't enable MTE emulation by default
     * virt: Diagnose attempts to use MTE with memory-hotplug or KVM
       (rather than silently not working correctly)
     * util: Implement qemu_get_thread_id() for OpenBSD
     * qdev: Add doc comments for qdev_unrealize and GPIO functions,
       and standardize on doc-comments-in-header-file
     * hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
     * docs/system: Document canon-a1100, collie, gumstix, virt boards
    
    # gpg: Signature made Mon 20 Jul 2020 13:55:36 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200720:
      docs/system: Document the arm virt board
      docs/system: Briefly document gumstix boards
      docs/system: Briefly document collie board
      docs/system: Briefly document canon-a1100 board
      hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
      qdev: Document GPIO related functions
      qdev: Document qdev_unrealize()
      qdev: Move doc comments from qdev.c to qdev-core.h
      util: Implement qemu_get_thread_id() for OpenBSD
      hw/arm/virt: Disable memory hotplug when MTE is enabled
      hw/arm/virt: Error for MTE enabled with KVM
      hw/arm/virt: Enable MTE via a machine property
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                  |   4 +
 docs/system/arm/collie.rst   |  16 +++
 docs/system/arm/digic.rst    |  11 ++
 docs/system/arm/gumstix.rst  |  21 ++++
 docs/system/arm/virt.rst     | 161 ++++++++++++++++++++++++++
 docs/system/target-arm.rst   |   4 +
 hw/arm/armsse.c              |   2 +
 hw/arm/virt.c                |  50 +++++++-
 hw/core/qdev.c               |  33 ------
 include/hw/arm/virt.h        |   1 +
 include/hw/qdev-core.h       | 267 ++++++++++++++++++++++++++++++++++++++++++-
 include/hw/qdev-properties.h |  13 +++
 target/arm/cpu.c             |  19 +--
 target/arm/cpu64.c           |   5 +-
 util/oslib-posix.c           |   2 +
 15 files changed, 559 insertions(+), 50 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14928.37203 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGV-0000hP-B6; Thu, 29 Oct 2020 21:15:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14928.37203; Thu, 29 Oct 2020 21:15:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGV-0000hF-7Y; Thu, 29 Oct 2020 21:15:23 +0000
Received: by outflank-mailman (input) for mailman id 14928;
 Thu, 29 Oct 2020 21:15:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFGU-0000h8-B2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bb262e8f-14c3-418d-ba8f-684b96675f0e;
 Thu, 29 Oct 2020 21:15:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGT-0007hQ-7j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGT-0003A6-6y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFGU-0000h8-B2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:22 +0000
X-Inumbo-ID: bb262e8f-14c3-418d-ba8f-684b96675f0e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bb262e8f-14c3-418d-ba8f-684b96675f0e;
	Thu, 29 Oct 2020 21:15:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+LbCyOy8ErSi0GgbuPZQM8VlAs8LHOoRt7EO37XfCGg=; b=AHN6JCAvcGuvI4sVt3IUT55RjJ
	YSbaEUcyCvNiwCHRZLWUPy07VRjUyEHi5vrhkK+/FoMKfWvI+evHUH/qkg7aHL373j2hm5Kcf82vt
	i1b3jCEsaXkIHzNCKTF7zmUD7oR2LMuAyd8QblwWwLD4wvzfiods38xQ6ZjX+ljnGev4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGT-0007hQ-7j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGT-0003A6-6y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] scripts/oss-fuzz: Limit target list to i386-softmmu
Message-Id: <E1kYFGT-0003A6-6y@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:21 +0000

commit 7cee363bc2eff06068db0dc3e59cbc5f1906067e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Fri Jul 17 08:57:42 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    scripts/oss-fuzz: Limit target list to i386-softmmu
    
    The build.sh script only copies qemu-fuzz-i386 to the destination folder,
    so we can speed up the compilation step quite a bit by not compiling the
    other targets here.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/oss-fuzz/build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index f5cee3d67e..a07b3022e8 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -68,7 +68,7 @@ mkdir -p "$DEST_DIR/lib/"  # Copy the shared libraries here
 
 # Build once to get the list of dynamic lib paths, and copy them over
 ../configure --disable-werror --cc="$CC" --cxx="$CXX" \
-    --extra-cflags="$EXTRA_CFLAGS"
+    --extra-cflags="$EXTRA_CFLAGS" --target-list="i386-softmmu"
 
 if ! make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" \
     i386-softmmu/fuzz; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14929.37205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGf-0000ip-CS; Thu, 29 Oct 2020 21:15:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14929.37205; Thu, 29 Oct 2020 21:15:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGf-0000ih-99; Thu, 29 Oct 2020 21:15:33 +0000
Received: by outflank-mailman (input) for mailman id 14929;
 Thu, 29 Oct 2020 21:15:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFGe-0000iW-9d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9bb0e314-c083-4701-aa85-a5834ac2762e;
 Thu, 29 Oct 2020 21:15:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGd-0007hb-B5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGd-0003BB-AQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFGe-0000iW-9d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:32 +0000
X-Inumbo-ID: 9bb0e314-c083-4701-aa85-a5834ac2762e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9bb0e314-c083-4701-aa85-a5834ac2762e;
	Thu, 29 Oct 2020 21:15:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q9CwWgpyFAvsv5X+6R+n8zqdD+i20if/k5uuXMsPELs=; b=54lkxO9Ke8nJ6+lGVdLzKcSuE6
	61fv4agg0+mELfRGk1QdAGaMrnUbeycWIhYlbhZZQ4T4SW+banabnlzx1/6KEJ0OG11wtS7MIFzns
	85EvXXj+68HWBgh3TbEkiwy7OQskDqaPWXnLMoId+BMZ1V9OoqgWqIcPcRgosTPLNpoA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGd-0007hb-B5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGd-0003BB-AQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fuzz: Fix leak when assembling datadir path string
Message-Id: <E1kYFGd-0003BB-AQ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:31 +0000

commit bcbad8b05c7f9072cadd3d3ebef2992196b73801
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Fri Jul 17 12:35:23 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    fuzz: Fix leak when assembling datadir path string
    
    We freed the string containing the final datadir path, but did not free
    the path to the executable's directory that we get from
    g_path_get_dirname(). Fix that.
    
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200717163523.1591-1-alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 6bc17ef313..031594a686 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -143,7 +143,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 {
 
     char *target_name;
-    char *dir;
+    char *bindir, *datadir;
     bool serialize = false;
 
     /* Initialize qgraph and modules */
@@ -164,11 +164,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
          * location of the executable. Using this we add exec_dir/pc-bios to
          * the datadirs.
          */
-        dir = g_build_filename(g_path_get_dirname(**argv), "pc-bios", NULL);
-        if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
-            qemu_add_data_dir(dir);
+        bindir = g_path_get_dirname(**argv);
+        datadir = g_build_filename(bindir, "pc-bios", NULL);
+        g_free(bindir);
+        if (g_file_test(datadir, G_FILE_TEST_IS_DIR)) {
+            qemu_add_data_dir(datadir);
         }
-        g_free(dir);
+        g_free(datadir);
     } else if (*argc > 1) {  /* The target is specified as an argument */
         target_name = (*argv)[1];
         if (!strstr(target_name, "--fuzz-target=")) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14930.37210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGp-0000kM-El; Thu, 29 Oct 2020 21:15:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14930.37210; Thu, 29 Oct 2020 21:15:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGp-0000kE-B0; Thu, 29 Oct 2020 21:15:43 +0000
Received: by outflank-mailman (input) for mailman id 14930;
 Thu, 29 Oct 2020 21:15:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFGo-0000k7-P1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id acd0d9ee-20dc-4e81-9900-ed0689eefe98;
 Thu, 29 Oct 2020 21:15:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGn-0007hj-Eq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGn-0003CK-Dg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFGo-0000k7-P1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:42 +0000
X-Inumbo-ID: acd0d9ee-20dc-4e81-9900-ed0689eefe98
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id acd0d9ee-20dc-4e81-9900-ed0689eefe98;
	Thu, 29 Oct 2020 21:15:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nev46mSSGmbbIuQxRrUWUonLvUR3Dt9vJViJRrYOGso=; b=q+kjfOezSG16nODHu87ssETK2j
	T7EZSaHC74biy3l/aD87YhaCuwBr5LOjC2f1JcFRkMWLnFToZZJ2BDQLSy30viBM2CvTLWorlNLS5
	aNanx0RAtdai7dY8vPaivp4f4bPwdzRBHj6U4g1zUaoJmMdIQ42i74WMKYXV3MQAYuGo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGn-0007hj-Eq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGn-0003CK-Dg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] gitlab-ci.yml: Add oss-fuzz build tests
Message-Id: <E1kYFGn-0003CK-Dg@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:41 +0000

commit 48eac1019769ebc4647ba380a828c25d8014be37
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Thu Jul 16 12:33:30 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    gitlab-ci.yml: Add oss-fuzz build tests
    
    This tries to build and run the fuzzers with the same build-script used
    by oss-fuzz. This doesn't guarantee that the builds on oss-fuzz will
    also succeed, since oss-fuzz provides its own compiler and fuzzer vars,
    but it can catch changes that are not compatible with the the
    ./scripts/oss-fuzz/build.sh script.
    The strange way of finding fuzzer binaries stems from the method used by
    oss-fuzz:
    https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-runner/targets_list
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200720073223.22945-1-thuth@redhat.com>
    [thuth: Tweak the "script" to make it work, exclude slirp test, etc.]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 41597c3603..362e5ee755 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -164,22 +164,20 @@ build-clang:
       ppc-softmmu s390x-softmmu arm-linux-user
     MAKE_CHECK_ARGS: check
 
-build-fuzzer:
+build-oss-fuzz:
   <<: *native_build_job_definition
   variables:
     IMAGE: fedora
   script:
-    - mkdir build
-    - cd build
-    - ../configure --cc=clang --cxx=clang++ --enable-fuzzing
-                   --enable-sanitizers --target-list=x86_64-softmmu
-    - make -j"$JOBS" all check-build x86_64-softmmu/fuzz
-    - make check
-    - for fuzzer in i440fx-qos-fork-fuzz i440fx-qos-noreset-fuzz
-        i440fx-qtest-reboot-fuzz virtio-scsi-flags-fuzz virtio-scsi-fuzz ; do
-          echo Testing ${fuzzer} ... ;
-          x86_64-softmmu/qemu-fuzz-x86_64 --fuzz-target=${fuzzer} -runs=1000
-            || exit 1 ;
+    - mkdir build-oss-fuzz
+    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
+      ./scripts/oss-fuzz/build.sh
+    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
+                      | grep -v slirp); do
+        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
+        echo Testing ${fuzzer} ... ;
+        ASAN_OPTIONS="fast_unwind_on_malloc=0"
+         "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
       done
 
 build-tci:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:15:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:15:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14931.37214 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGz-0000m5-HU; Thu, 29 Oct 2020 21:15:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14931.37214; Thu, 29 Oct 2020 21:15:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFGz-0000lx-EY; Thu, 29 Oct 2020 21:15:53 +0000
Received: by outflank-mailman (input) for mailman id 14931;
 Thu, 29 Oct 2020 21:15:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFGy-0000lm-GE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 584d99e7-1e69-4d08-b261-f1dbb4ffd934;
 Thu, 29 Oct 2020 21:15:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGx-0007hr-J3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFGx-0003Dg-IE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFGy-0000lm-GE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:52 +0000
X-Inumbo-ID: 584d99e7-1e69-4d08-b261-f1dbb4ffd934
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 584d99e7-1e69-4d08-b261-f1dbb4ffd934;
	Thu, 29 Oct 2020 21:15:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MVtg/upXzOJ7ikSs/Lcu0IJxb+He2X/PuITFM9gPJmo=; b=3sRtXFwAvvGmSuRxfIcXBxKFZ/
	y2IW6MkQelthzQ0erqW1vQwHEWiZG3KtRqgn7kdXXDwV1q5j2SqVD2ifruqpbKmqmYtaCpVaIfgd8
	1+vKfHEQzBW+db/fgUCvalGByHGQR81Bs+8IaD4ncTt4Mq9fp4ed1kfrHuwGUbd9Hukc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGx-0007hr-J3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFGx-0003Dg-IE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:15:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] fuzz: build without AddressSanitizer, by default
Message-Id: <E1kYFGx-0003Dg-IE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:15:51 +0000

commit dd0162653c11de58331506beb8b3d85c8923149c
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:31 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:06 2020 +0200

    fuzz: build without AddressSanitizer, by default
    
    We already have a nice --enable-sanitizers option to enable
    AddressSanitizer. There is no reason to duplicate and force this
    functionality in --enable-fuzzing. In the future, if more sanitizers are
    added to --enable-sanitizers, it might be impossible to build with both
    --enable-sanitizers and --enable-fuzzing, since not all sanitizers are
    compatible with libFuzzer. In that case, we could enable ASAN with
    --extra-cflags="-fsanitize=address"
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-2-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    [thuth: Added missing $CFLAGS]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 33cee41f9c..4bd80ed507 100755
--- a/configure
+++ b/configure
@@ -6337,7 +6337,7 @@ fi
 # checks for fuzzer
 if test "$fuzzing" = "yes" ; then
   write_c_fuzzer_skeleton
-  if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address,fuzzer" ""; then
+  if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then
       have_fuzzer=yes
   fi
 fi
@@ -7893,11 +7893,11 @@ if test "$have_mlockall" = "yes" ; then
 fi
 if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
-    FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
-    FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
-    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
+    FUZZ_LDFLAGS=" -fsanitize=fuzzer"
+    FUZZ_CFLAGS=" -fsanitize=fuzzer"
+    CFLAGS="$CFLAGS -fsanitize=fuzzer-no-link"
   else
-    error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
+    error_exit "Your compiler doesn't support -fsanitize=fuzzer"
     exit 1
   fi
 fi
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14933.37218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHA-0000oH-JH; Thu, 29 Oct 2020 21:16:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14933.37218; Thu, 29 Oct 2020 21:16:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHA-0000o9-G5; Thu, 29 Oct 2020 21:16:04 +0000
Received: by outflank-mailman (input) for mailman id 14933;
 Thu, 29 Oct 2020 21:16:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFH9-0000nz-0W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 79174a17-5619-4d0c-a2bb-989b270eca5e;
 Thu, 29 Oct 2020 21:16:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFH7-0007ih-Md
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFH7-0003Em-Lw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFH9-0000nz-0W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:03 +0000
X-Inumbo-ID: 79174a17-5619-4d0c-a2bb-989b270eca5e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 79174a17-5619-4d0c-a2bb-989b270eca5e;
	Thu, 29 Oct 2020 21:16:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wWaA1s4zdwwtJJzAW8AhKnPuaoMJaImo+1ejHLn8Fik=; b=zJtwSSRF9Q7e+LDvZrTxEL3Qmo
	3zx7iJG8tX5tpf9vpa0kTmLx1lu2HP/lB0GZTkDHMdl4MZUotUbPrdwetDIREa5KbBjQjDl+UB7WU
	PAFxYeVfYWVKwUbv2xq9NA+RF/CEybyNAiKTVeHiVZ+6HvZ6aAjv18fK6cmDfCx8RorY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFH7-0007ih-Md
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFH7-0003Em-Lw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/fuzz: describe building fuzzers with enable-sanitizers
Message-Id: <E1kYFH7-0003Em-Lw@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:01 +0000

commit ee16da12d7035bffb1c990c794de8fb1a96815d7
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:32 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:28 2020 +0200

    docs/fuzz: describe building fuzzers with enable-sanitizers
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-3-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index db5641de74..12bf6aa0ca 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -23,9 +23,12 @@ AddressSanitizer mmaps ~20TB of memory, as part of its detection. This results
 in a large page-map, and a much slower fork().
 
 To build the fuzzers, install a recent version of clang:
-Configure with (substitute the clang binaries with the version you installed):
+Configure with (substitute the clang binaries with the version you installed).
+Here, enable-sanitizers, is optional but it allows us to reliably detect bugs
+such as out-of-bounds accesses, use-after-frees, double-frees etc.
 
-    CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing
+    CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing \
+                                                --enable-sanitizers
 
 Fuzz targets are built similarly to system/softmmu:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14934.37222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHJ-0000pO-Ks; Thu, 29 Oct 2020 21:16:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14934.37222; Thu, 29 Oct 2020 21:16:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHJ-0000pG-Hd; Thu, 29 Oct 2020 21:16:13 +0000
Received: by outflank-mailman (input) for mailman id 14934;
 Thu, 29 Oct 2020 21:16:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFHI-0000p7-R2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c3061ede-6ba2-4bd2-ad04-74125d533c44;
 Thu, 29 Oct 2020 21:16:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHH-0007io-RU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHH-0003Fd-Pf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFHI-0000p7-R2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:12 +0000
X-Inumbo-ID: c3061ede-6ba2-4bd2-ad04-74125d533c44
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c3061ede-6ba2-4bd2-ad04-74125d533c44;
	Thu, 29 Oct 2020 21:16:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U53Fyxyvq6CjRSTpYSCqA4FcC+UnXaqBlhC5SxgDFF0=; b=1BQ69ofdzTFa4wmsh2PyecodNF
	elcD9lH4Wt5NWQrl1amhCCbPSXearel6742VJ0xugFDgqnD3L6ZzJ+TzlcoBF52vKbXZUhQoafWKg
	mLjCAVD3RSkmYMIwDyO5tlP8n3odvcxbk8EGnhzLpccHC1L1KLxm/9EGEuQUxoWphsIc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHH-0007io-RU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHH-0003Fd-Pf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/fuzz: add information about useful libFuzzer flags
Message-Id: <E1kYFHH-0003Fd-Pf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:11 +0000

commit 19a91e4af86c578420e9fdfe2efdc3b3b3826222
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:33 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:28 2020 +0200

    docs/fuzz: add information about useful libFuzzer flags
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-4-alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 12bf6aa0ca..6d18115239 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -48,6 +48,43 @@ Information about these is available by passing -help=1
 Now the only thing left to do is wait for the fuzzer to trigger potential
 crashes.
 
+== Useful libFuzzer flags ==
+
+As mentioned above, libFuzzer accepts some arguments. Passing -help=1 will list
+the available arguments. In particular, these arguments might be helpful:
+
+$CORPUS_DIR/ : Specify a directory as the last argument to libFuzzer. libFuzzer
+stores each "interesting" input in this corpus directory. The next time you run
+libFuzzer, it will read all of the inputs from the corpus, and continue fuzzing
+from there. You can also specify multiple directories. libFuzzer loads existing
+inputs from all specified directories, but will only write new ones to the
+first one specified.
+
+-max_len=4096 : specify the maximum byte-length of the inputs libFuzzer will
+generate.
+
+-close_fd_mask={1,2,3} : close, stderr, or both. Useful for targets that
+trigger many debug/error messages, or create output on the serial console.
+
+-jobs=4 -workers=4 : These arguments configure libFuzzer to run 4 fuzzers in
+parallel (4 fuzzing jobs in 4 worker processes). Alternatively, with only
+-jobs=N, libFuzzer automatically spawns a number of workers less than or equal
+to half the available CPU cores. Replace 4 with a number appropriate for your
+machine. Make sure to specify a $CORPUS_DIR, which will allow the parallel
+fuzzers to share information about the interesting inputs they find.
+
+-use_value_profile=1 : For each comparison operation, libFuzzer computes 
+(caller_pc&4095) | (popcnt(Arg1 ^ Arg2) << 12) and places this in the coverage
+table. Useful for targets with "magic" constants. If Arg1 came from the fuzzer's
+input and Arg2 is a magic constant, then each time the Hamming distance
+between Arg1 and Arg2 decreases, libFuzzer adds the input to the corpus.
+
+-shrink=1 : Tries to make elements of the corpus "smaller". Might lead to
+better coverage performance, depending on the target.
+
+Note that libFuzzer's exact behavior will depend on the version of
+clang and libFuzzer used to build the device fuzzers.
+
 == Adding a new fuzzer ==
 Coverage over virtual devices can be improved by adding additional fuzzers.
 Fuzzers are kept in tests/qtest/fuzz/ and should be added to
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14935.37226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHT-0000qr-MW; Thu, 29 Oct 2020 21:16:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14935.37226; Thu, 29 Oct 2020 21:16:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHT-0000qk-JX; Thu, 29 Oct 2020 21:16:23 +0000
Received: by outflank-mailman (input) for mailman id 14935;
 Thu, 29 Oct 2020 21:16:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFHS-0000qb-SS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cb053117-b474-4f1b-a6a8-5aea142fe591;
 Thu, 29 Oct 2020 21:16:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHR-0007j0-VI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHR-0003GI-UM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFHS-0000qb-SS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:22 +0000
X-Inumbo-ID: cb053117-b474-4f1b-a6a8-5aea142fe591
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cb053117-b474-4f1b-a6a8-5aea142fe591;
	Thu, 29 Oct 2020 21:16:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pka424IddrS6slPRbVkQD7GYtxoQsMF4sHyIRc8o214=; b=njl+91cSJO+E+DFiVOwJiThRIC
	DFGgbBLkGCyelTbPwjW9txmr/czEs/vnbKm8nb79YkKw0nrmMnp2vx6wGk5mnabHmhLHhl1x8kB6K
	Ar/wmNaHKvqE2YlVCqnTgunw08Lw1pYd3QWiFTNIQdfG/4s8TfjvAPqHyG9eWNRI8V3k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHR-0007j0-VI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHR-0003GI-UM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/fuzz: add instructions for generating a coverage report
Message-Id: <E1kYFHR-0003GI-UM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:21 +0000

commit 09a14f586c315b01411dc1ef1bfe99b034b302de
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:34 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:29:18 2020 +0200

    docs/fuzz: add instructions for generating a coverage report
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-5-alxndr@bu.edu>
    [thuth: Replaced --enable-sanitizers with --enable-fuzzing]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 6d18115239..96d71c94d7 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -85,6 +85,25 @@ better coverage performance, depending on the target.
 Note that libFuzzer's exact behavior will depend on the version of
 clang and libFuzzer used to build the device fuzzers.
 
+== Generating Coverage Reports ==
+Code coverage is a crucial metric for evaluating a fuzzer's performance.
+libFuzzer's output provides a "cov: " column that provides a total number of
+unique blocks/edges covered. To examine coverage on a line-by-line basis we
+can use Clang coverage:
+
+ 1. Configure libFuzzer to store a corpus of all interesting inputs (see
+    CORPUS_DIR above)
+ 2. ./configure the QEMU build with:
+    --enable-fuzzing \
+    --extra-cflags="-fprofile-instr-generate -fcoverage-mapping"
+ 3. Re-run the fuzzer. Specify $CORPUS_DIR/* as an argument, telling libfuzzer
+    to execute all of the inputs in $CORPUS_DIR and exit. Once the process
+    exits, you should find a file, "default.profraw" in the working directory.
+ 4. Execute these commands to generate a detailed HTML coverage-report:
+ llvm-profdata merge -output=default.profdata default.profraw
+ llvm-cov show ./path/to/qemu-fuzz-i386 -instr-profile=default.profdata \
+ --format html -output-dir=/path/to/output/report
+
 == Adding a new fuzzer ==
 Coverage over virtual devices can be improved by adding additional fuzzers.
 Fuzzers are kept in tests/qtest/fuzz/ and should be added to
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14936.37230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHd-0000sF-OD; Thu, 29 Oct 2020 21:16:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14936.37230; Thu, 29 Oct 2020 21:16:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHd-0000s7-LC; Thu, 29 Oct 2020 21:16:33 +0000
Received: by outflank-mailman (input) for mailman id 14936;
 Thu, 29 Oct 2020 21:16:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFHc-0000s0-Rn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 148c0fd3-b467-42a6-b485-fbb2005ef84a;
 Thu, 29 Oct 2020 21:16:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHc-0007jD-3Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHc-0003HA-1u
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFHc-0000s0-Rn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
X-Inumbo-ID: 148c0fd3-b467-42a6-b485-fbb2005ef84a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 148c0fd3-b467-42a6-b485-fbb2005ef84a;
	Thu, 29 Oct 2020 21:16:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4fzGbIduE40hMGYl2SYwgBVRAR71Xb2xUtT+zUVJbCI=; b=l46g8UfQNLJZv3/Wp1fFcNihK/
	RD0eekKNlZ9nPKhxN9vatg5zDysb0EYeyCe+kB4gf5qnrA+rXB9de54wbKqKP5GeeVhOqdVtCjTHW
	aJ3BNTLBK20QgCTroMCk9o00Tp26i0vlqw26nRuCVPVib6UBe0fzBXJJdtzyWbN9WPMo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHc-0007jD-3Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHc-0003HA-1u
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Extend the device fuzzing section
Message-Id: <E1kYFHc-0003HA-1u@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:32 +0000

commit 6184e5fb4221ec5dd6f0c27d05a8e575b81eb89b
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jul 21 07:36:09 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:40:42 2020 +0200

    MAINTAINERS: Extend the device fuzzing section
    
    The file docs/devel/fuzzing.txt should be in this section, too, and add
    myself as a reviewer (since I often take the fuzzer patches through the
    qtest-next tree, I should be notified on patches, too).
    
    Message-Id: <20200721053926.17197-1-thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5e8616821a..3395abd4e1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2449,9 +2449,11 @@ M: Alexander Bulekov <alxndr@bu.edu>
 R: Paolo Bonzini <pbonzini@redhat.com>
 R: Bandan Das <bsd@redhat.com>
 R: Stefan Hajnoczi <stefanha@redhat.com>
+R: Thomas Huth <thuth@redhat.com>
 S: Maintained
 F: tests/qtest/fuzz/
 F: scripts/oss-fuzz/
+F: docs/devel/fuzzing.txt
 
 Register API
 M: Alistair Francis <alistair@alistair23.me>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14937.37235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHo-0000tX-Qb; Thu, 29 Oct 2020 21:16:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14937.37235; Thu, 29 Oct 2020 21:16:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHo-0000tP-Mw; Thu, 29 Oct 2020 21:16:44 +0000
Received: by outflank-mailman (input) for mailman id 14937;
 Thu, 29 Oct 2020 21:16:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFHn-0000tE-3F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a83fe050-3b60-4668-a6fc-3e4304b644fd;
 Thu, 29 Oct 2020 21:16:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHm-0007jJ-7H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHm-0003Hw-6K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFHn-0000tE-3F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:43 +0000
X-Inumbo-ID: a83fe050-3b60-4668-a6fc-3e4304b644fd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a83fe050-3b60-4668-a6fc-3e4304b644fd;
	Thu, 29 Oct 2020 21:16:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=g8AX7Sa062WjGF+NW+XMhBsoDnpfNfEy4A/A41bEuX4=; b=iQ5BSVQmoL520LVYaUFSaEgpyZ
	0VxKl08oos5M67bA2D0WjMfCXpfbG3uH3KmGfM+yN7STqJHcNVwPrbCI6uVwo2qoTD8+DUS5M9tcS
	YuBkFZm/UMQoxVLUFlz/IPFr9I6oJJ5luHk9Dgh+OVGTf+XP8k4X5y+DzoNFHcExE0DQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHm-0007jJ-7H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHm-0003Hw-6K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] msf2: Unbreak device-list-properties for "msf-soc"
Message-Id: <E1kYFHm-0003Hw-6K@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:42 +0000

commit 2b0650205b71c2aa8bf6f877a8333ef25bf288b2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 15 16:04:39 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:40:54 2020 +0200

    msf2: Unbreak device-list-properties for "msf-soc"
    
    Watch this:
    
        $ qemu-system-aarch64 -M ast2600-evb -S -display none -qmp stdio
        {"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 5}, "package": "v5.0.0-2464-g3a9163af4e"}, "capabilities": ["oob"]}}
        {"execute": "qmp_capabilities"}
        {"return": {}}
        {"execute": "device-list-properties", "arguments": {"typename": "msf2-soc"}}
        Unsupported NIC model: ftgmac100
        armbru@dusky:~/work/images$ echo $?
        1
    
    This is what breaks "make check SPEED=slow".
    
    Root cause is m2sxxx_soc_initfn()'s messing with nd_table[] via
    qemu_check_nic_model().  That's wrong.
    
    We fixed the exact same bug for device "allwinner-a10" in commit
    8aabc5437b "hw/arm/allwinner-a10: Do not use nd_table in instance_init
    function".  Fix this instance the same way: move the offending code to
    m2sxxx_soc_realize(), where it's less wrong, and add a FIXME comment.
    
    Fixes: 05b7374a58 ("msf2: Add EMAC block to SmartFusion2 SoC")
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200715140440.3540942-2-armbru@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/msf2-soc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 16bb7c9916..33ea7df342 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -82,10 +82,6 @@ static void m2sxxx_soc_initfn(Object *obj)
     }
 
     object_initialize_child(obj, "emac", &s->emac, TYPE_MSS_EMAC);
-    if (nd_table[0].used) {
-        qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
-        qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
-    }
 }
 
 static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
@@ -187,6 +183,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
         g_free(bus_name);
     }
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
+    if (nd_table[0].used) {
+        qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
+        qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
+    }
     dev = DEVICE(&s->emac);
     object_property_set_link(OBJECT(&s->emac), "ahb-bus",
                              OBJECT(get_system_memory()), &error_abort);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:16:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:16:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14938.37237 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHy-0000up-RH; Thu, 29 Oct 2020 21:16:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14938.37237; Thu, 29 Oct 2020 21:16:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFHy-0000uh-OP; Thu, 29 Oct 2020 21:16:54 +0000
Received: by outflank-mailman (input) for mailman id 14938;
 Thu, 29 Oct 2020 21:16:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFHx-0000uX-J3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 12f54d98-0855-47ce-8083-4a0a0aad3466;
 Thu, 29 Oct 2020 21:16:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHw-0007jP-BI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFHw-0003Im-A6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFHx-0000uX-J3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:53 +0000
X-Inumbo-ID: 12f54d98-0855-47ce-8083-4a0a0aad3466
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 12f54d98-0855-47ce-8083-4a0a0aad3466;
	Thu, 29 Oct 2020 21:16:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rCKk/Lf7ArB5GXJ8Xmtb1ApMXWpdK2NZKTw2w6VLonA=; b=FgX0vHzdAz1sorjuIKiTjCAnM6
	Xcc1174/egmTpMMtAgiuIzrGK/BBcKVWcA6qjcJZK3Oac3/m1z0qpWHyjoMCAGkjz9W3isL5X7NMm
	gbZp9eBJM2uFGMCSdwGVKu0kNPToSEKPcDnMf5F3NKED3Yc6hjYoU4/yFeZTAkTqDqdw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHw-0007jP-BI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFHw-0003Im-A6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:16:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw: Mark nd_table[] misuse in realize methods FIXME
Message-Id: <E1kYFHw-0003Im-A6@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:16:52 +0000

commit 7ad36e2e241bd924f774a1f9fb208c102da58e50
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 15 16:04:40 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:41:15 2020 +0200

    hw: Mark nd_table[] misuse in realize methods FIXME
    
    nd_table[] contains NIC configuration for boards to pick up.  Device
    code has no business looking there.  Several devices do it anyway.
    Two of them already have a suitable FIXME comment: "allwinner-a10" and
    "msf2-soc".  Copy it to the others: "allwinner-h3", "xlnx-versal",
    "xlnx,zynqmp", "sparc32-ledma", "riscv.sifive.u.soc".
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200715140440.3540942-3-armbru@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/allwinner-h3.c | 1 +
 hw/arm/xlnx-versal.c  | 1 +
 hw/arm/xlnx-zynqmp.c  | 1 +
 hw/dma/sparc32_dma.c  | 1 +
 hw/riscv/sifive_u.c   | 1 +
 5 files changed, 5 insertions(+)

diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 8e09468e86..ff92ded82c 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -358,6 +358,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
                               "sd-bus");
 
     /* EMAC */
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     if (nd_table[0].used) {
         qemu_check_nic_model(&nd_table[0], TYPE_AW_SUN8I_EMAC);
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index ead038b971..e3aa4bd1e5 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -160,6 +160,7 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
         object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
                                 TYPE_CADENCE_GEM);
         dev = DEVICE(&s->lpd.iou.gem[i]);
+        /* FIXME use qdev NIC properties instead of nd_table[] */
         if (nd->used) {
             qemu_check_nic_model(nd, "cadence_gem");
             qdev_set_nic_properties(dev, nd);
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 772cfa3771..5855e5d5bf 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -455,6 +455,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
         NICInfo *nd = &nd_table[i];
 
+        /* FIXME use qdev NIC properties instead of nd_table[] */
         if (nd->used) {
             qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
             qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 9459178866..bcd1626fbd 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -341,6 +341,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
     DeviceState *d;
     NICInfo *nd = &nd_table[0];
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     qemu_check_nic_model(nd, TYPE_LANCE);
 
     d = qdev_new(TYPE_LANCE);
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 19a976c9a6..e5682c38a9 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -714,6 +714,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base);
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     if (nd->used) {
         qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
         qdev_set_nic_properties(DEVICE(&s->gem), nd);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14939.37241 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFI8-0000wp-UF; Thu, 29 Oct 2020 21:17:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14939.37241; Thu, 29 Oct 2020 21:17:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFI8-0000wh-RL; Thu, 29 Oct 2020 21:17:04 +0000
Received: by outflank-mailman (input) for mailman id 14939;
 Thu, 29 Oct 2020 21:17:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFI7-0000wX-Q0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7c98a4e7-cbaf-4a65-8800-2598b1dec4ae;
 Thu, 29 Oct 2020 21:17:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFI6-0007kP-GK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFI6-0003Jk-Ew
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFI7-0000wX-Q0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:03 +0000
X-Inumbo-ID: 7c98a4e7-cbaf-4a65-8800-2598b1dec4ae
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7c98a4e7-cbaf-4a65-8800-2598b1dec4ae;
	Thu, 29 Oct 2020 21:17:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HU4iA1Cl6KBN4uOVAyT0lJQI8Z9XEitqEPTcUEAY91c=; b=2s1tOWPviBK3GPda1JInCmNq2l
	6e4V/22E0xc8BPfN9XGPQ8M1yquQxyh//YOSgllhgROZ+fqpe/OF09WMRZ1BpuZ7BJWtSGOsXqQuF
	5Bqzw9BPl7+ho1GMPTbUlgjMPG2c+KP8cgs79bk8XZ2t2rRpqUMIWgQ0n7WxzKOlmuLY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFI6-0007kP-GK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFI6-0003Jk-Ew
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-21' into staging
Message-Id: <E1kYFI6-0003Jk-Ew@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:02 +0000

commit 90218a9a393c7925f330e7dcc08658e2a01d3bd4
Merge: af3d69058e09bede9900f266a618ed11f76f49f3 7ad36e2e241bd924f774a1f9fb208c102da58e50
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 10:24:38 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 10:24:38 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-21' into staging
    
    * Fix memory leak in fuzzer
    * Fuzzer documentation updates
    * Some other minor fuzzer updates
    * Fix "make check-qtest SPEED=slow" (bug in msf2 instance_init)
    
    # gpg: Signature made Tue 21 Jul 2020 07:48:10 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-21:
      hw: Mark nd_table[] misuse in realize methods FIXME
      msf2: Unbreak device-list-properties for "msf-soc"
      MAINTAINERS: Extend the device fuzzing section
      docs/fuzz: add instructions for generating a coverage report
      docs/fuzz: add information about useful libFuzzer flags
      docs/fuzz: describe building fuzzers with enable-sanitizers
      fuzz: build without AddressSanitizer, by default
      gitlab-ci.yml: Add oss-fuzz build tests
      fuzz: Fix leak when assembling datadir path string
      scripts/oss-fuzz: Limit target list to i386-softmmu
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml            | 22 ++++++++---------
 MAINTAINERS               |  2 ++
 configure                 | 10 ++++----
 docs/devel/fuzzing.txt    | 63 +++++++++++++++++++++++++++++++++++++++++++++--
 hw/arm/allwinner-h3.c     |  1 +
 hw/arm/msf2-soc.c         |  9 ++++---
 hw/arm/xlnx-versal.c      |  1 +
 hw/arm/xlnx-zynqmp.c      |  1 +
 hw/dma/sparc32_dma.c      |  1 +
 hw/riscv/sifive_u.c       |  1 +
 scripts/oss-fuzz/build.sh |  2 +-
 tests/qtest/fuzz/fuzz.c   | 12 +++++----
 12 files changed, 96 insertions(+), 29 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14940.37246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFII-0000y6-Vg; Thu, 29 Oct 2020 21:17:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14940.37246; Thu, 29 Oct 2020 21:17:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFII-0000xy-Sp; Thu, 29 Oct 2020 21:17:14 +0000
Received: by outflank-mailman (input) for mailman id 14940;
 Thu, 29 Oct 2020 21:17:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFIH-0000xp-P7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id afded79e-db0c-4af4-9a41-a9bf03cbff59;
 Thu, 29 Oct 2020 21:17:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIG-0007kW-SQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIG-0003Kv-Rj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFIH-0000xp-P7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:13 +0000
X-Inumbo-ID: afded79e-db0c-4af4-9a41-a9bf03cbff59
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id afded79e-db0c-4af4-9a41-a9bf03cbff59;
	Thu, 29 Oct 2020 21:17:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qaQW0LKFHKUUMuw2Hmiu74gyGQgr3mfSRPGRjDAR5eo=; b=VU2UscJ2iIh2SLEI1pA0T4T/lE
	AefrrU8BYDkps0yUgcmXNdOeTgJoEJ+p2eBvGfGPk63GnzxiOg7LXOeMK00y4DB5TfwTLh+4zOks2
	43xg4MvCZnb+VHuVVSh+wtICrFfXBlpykjyGF5TUvOrL7zFbgeQetxjsp3Mur4tZYR7w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIG-0007kW-SQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIG-0003Kv-Rj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/crypto: disallow write sharing by default
Message-Id: <E1kYFIG-0003Kv-Rj@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:12 +0000

commit 662d0c5392a272aa0357aa7205e77fa3ca89c316
Author:     Maxim Levitsky <mlevitsk@redhat.com>
AuthorDate: Sun Jul 19 15:20:58 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 10:49:02 2020 +0200

    block/crypto: disallow write sharing by default
    
    My commit 'block/crypto: implement the encryption key management'
    accidently allowed raw luks images to be shared between different
    qemu processes without share-rw=on explicit override.
    Fix that.
    
    Fixes: bbfdae91fb ("block/crypto: implement the encryption key management")
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1857490
    
    Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20200719122059.59843-2-mlevitsk@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/crypto.c b/block/crypto.c
index 8725c1bc02..0807557763 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -881,7 +881,7 @@ block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c,
      * For backward compatibility, manually share the write
      * and resize permission
      */
-    *nshared |= (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    *nshared |= shared & (BLK_PERM_WRITE | BLK_PERM_RESIZE);
     /*
      * Since we are not fully a format driver, don't always request
      * the read/resize permission but only when explicitly
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14941.37250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIT-0000zK-17; Thu, 29 Oct 2020 21:17:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14941.37250; Thu, 29 Oct 2020 21:17:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIS-0000zB-UI; Thu, 29 Oct 2020 21:17:24 +0000
Received: by outflank-mailman (input) for mailman id 14941;
 Thu, 29 Oct 2020 21:17:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFIS-0000z4-1M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 02b9da57-f2c3-4164-9228-92bc0def916c;
 Thu, 29 Oct 2020 21:17:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIR-0007kn-0h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIQ-0003LX-VG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFIS-0000z4-1M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:24 +0000
X-Inumbo-ID: 02b9da57-f2c3-4164-9228-92bc0def916c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 02b9da57-f2c3-4164-9228-92bc0def916c;
	Thu, 29 Oct 2020 21:17:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jt/LIFArCusn9MeYFogLNPY/TI3aCWRsHWPJUSqE4LU=; b=CMn8Sm9vOsOZ8EdM+XNZ5Cq8Za
	n8oKw8p4lbi5VMVNGUSJ2L5sbJzWk9v5R3qRT4kNaF5yNSfh34Xpmyo/0YUfFXexaM7RtyzZlw5dY
	YPhq7Gk3DE58u1/HnfGn3W8Ud0LQScqe4L+5fRiBQr79AEVDCA7gVv+r5CqdGQ0wJgO8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIR-0007kn-0h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIQ-0003LX-VG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests: add testcase for bz #1857490
Message-Id: <E1kYFIQ-0003LX-VG@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:22 +0000

commit 0fca43de1b617a95f2472691ca1e740932ab2fea
Author:     Maxim Levitsky <mlevitsk@redhat.com>
AuthorDate: Sun Jul 19 15:20:59 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 10:49:02 2020 +0200

    qemu-iotests: add testcase for bz #1857490
    
    Test that we can't write-share raw luks images by default,
    but we still can with share-rw=on
    
    Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20200719122059.59843-3-mlevitsk@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/296     | 44 +++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/296.out | 12 ++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index ec69ec8974..fb7dec88aa 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -133,6 +133,21 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         )
         self.assert_qmp(result, 'return', {})
 
+
+    ###########################################################################
+    # add virtio-blk consumer for a block device
+    def addImageUser(self, vm, id, disk_id, share_rw=False):
+        result = vm.qmp('device_add', **
+            {
+                'driver': 'virtio-blk',
+                'id': id,
+                'drive': disk_id,
+                'share-rw' : share_rw
+            }
+        )
+
+        iotests.log(result)
+
     # close the encrypted block device
     def closeImageQmp(self, vm, id):
         result = vm.qmp('blockdev-del', **{ 'node-name': id })
@@ -159,7 +174,7 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         vm.run_job('job0')
 
     # test that when the image opened by two qemu processes,
-    # neither of them can update the image
+    # neither of them can update the encryption keys
     def test1(self):
         self.createImg(test_img, self.secrets[0]);
 
@@ -193,6 +208,9 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         os.remove(test_img)
 
 
+    # test that when the image opened by two qemu processes,
+    # even if first VM opens it read-only, the second can't update encryption
+    # keys
     def test2(self):
         self.createImg(test_img, self.secrets[0]);
 
@@ -226,6 +244,30 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         self.closeImageQmp(self.vm1, "testdev")
         os.remove(test_img)
 
+    # test that two VMs can't open the same luks image by default
+    # and attach it to a guest device
+    def test3(self):
+        self.createImg(test_img, self.secrets[0]);
+
+        self.openImageQmp(self.vm1, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm1, "testctrl", "testdev")
+
+        self.openImageQmp(self.vm2, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm2, "testctrl", "testdev")
+
+
+    # test that two VMs can attach the same luks image to a guest device,
+    # if both use share-rw=on
+    def test4(self):
+        self.createImg(test_img, self.secrets[0]);
+
+        self.openImageQmp(self.vm1, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm1, "testctrl", "testdev", share_rw=True)
+
+        self.openImageQmp(self.vm2, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm2, "testctrl", "testdev", share_rw=True)
+
+
 
 if __name__ == '__main__':
     # support only raw luks since luks encrypted qcow2 is a proper
diff --git a/tests/qemu-iotests/296.out b/tests/qemu-iotests/296.out
index afb6d2d09d..cb2859a15c 100644
--- a/tests/qemu-iotests/296.out
+++ b/tests/qemu-iotests/296.out
@@ -26,8 +26,16 @@ Job failed: Failed to get shared "consistent read" lock
 {"return": {}}
 {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 {"return": {}}
-..
+Formatting 'TEST_DIR/test.img', fmt=luks size=1048576 key-secret=keysec0 iter-time=10
+
+{"return": {}}
+{"error": {"class": "GenericError", "desc": "Failed to get \"write\" lock"}}
+Formatting 'TEST_DIR/test.img', fmt=luks size=1048576 key-secret=keysec0 iter-time=10
+
+{"return": {}}
+{"return": {}}
+....
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 4 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14942.37254 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIe-00010j-2b; Thu, 29 Oct 2020 21:17:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14942.37254; Thu, 29 Oct 2020 21:17:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFId-00010b-Vw; Thu, 29 Oct 2020 21:17:35 +0000
Received: by outflank-mailman (input) for mailman id 14942;
 Thu, 29 Oct 2020 21:17:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFIc-00010T-Da
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 97e33fe0-23ae-4611-8759-5ea2d1fa4652;
 Thu, 29 Oct 2020 21:17:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIb-0007kt-5A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIb-0003MB-3U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFIc-00010T-Da
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:34 +0000
X-Inumbo-ID: 97e33fe0-23ae-4611-8759-5ea2d1fa4652
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 97e33fe0-23ae-4611-8759-5ea2d1fa4652;
	Thu, 29 Oct 2020 21:17:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ogsYVAdiRkVKtJjluCpbluhcxa/+1gMiKHXyYVLHzLA=; b=oEPkkD9TxVox54D5g68FoGceQj
	EtMo/X+PwvPbY8oZLe23U8TNrV3HHUPk1kqbwCRQAe7dE4TMs1pT2kJTAyE5vYdAL/a455O3HvfkA
	VOTqMEFxdGrrxMcYtdyNAQRoLMHbOzi4tdP6tHpse3bbmIkvbgWBibggkuURdB7bxOUw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIb-0007kt-5A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIb-0003MB-3U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: fix bdrv_aio_cancel() for ENOMEDIUM requests
Message-Id: <E1kYFIb-0003MB-3U@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:33 +0000

commit 1d719ddc35e9827b6e5df771555874df34301a0d
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon Jul 20 11:01:41 2020 +0100
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 12:00:38 2020 +0200

    block: fix bdrv_aio_cancel() for ENOMEDIUM requests
    
    bdrv_aio_cancel() calls aio_poll() on the AioContext for the given I/O
    request until it has completed. ENOMEDIUM requests are special because
    there is no BlockDriverState when the drive has no medium!
    
    Define a .get_aio_context() function for BlkAioEmAIOCB requests so that
    bdrv_aio_cancel() can find the AioContext where the completion BH is
    pending. Without this function bdrv_aio_cancel() aborts on ENOMEDIUM
    requests!
    
    libFuzzer triggered the following assertion:
    
      cat << EOF | qemu-system-i386 -M pc-q35-5.0 \
        -nographic -monitor none -serial none \
        -qtest stdio -trace ide\*
      outl 0xcf8 0x8000fa24
      outl 0xcfc 0xe106c000
      outl 0xcf8 0x8000fa04
      outw 0xcfc 0x7
      outl 0xcf8 0x8000fb20
      write 0x0 0x3 0x2780e7
      write 0xe106c22c 0xd 0x1130c218021130c218021130c2
      write 0xe106c218 0x15 0x110010110010110010110010110010110010110010
      EOF
      ide_exec_cmd IDE exec cmd: bus 0x56170a77a2b8; state 0x56170a77a340; cmd 0xe7
      ide_reset IDEstate 0x56170a77a340
      Aborted (core dumped)
    
      (gdb) bt
      #1  0x00007ffff4f93895 in abort () at /lib64/libc.so.6
      #2  0x0000555555dc6c00 in bdrv_aio_cancel (acb=0x555556765550) at block/io.c:2745
      #3  0x0000555555dac202 in blk_aio_cancel (acb=0x555556765550) at block/block-backend.c:1546
      #4  0x0000555555b1bd74 in ide_reset (s=0x555557213340) at hw/ide/core.c:1318
      #5  0x0000555555b1e3a1 in ide_bus_reset (bus=0x5555572132b8) at hw/ide/core.c:2422
      #6  0x0000555555b2aa27 in ahci_reset_port (s=0x55555720eb50, port=2) at hw/ide/ahci.c:650
      #7  0x0000555555b29fd7 in ahci_port_write (s=0x55555720eb50, port=2, offset=44, val=16) at hw/ide/ahci.c:360
      #8  0x0000555555b2a564 in ahci_mem_write (opaque=0x55555720eb50, addr=556, val=16, size=1) at hw/ide/ahci.c:513
      #9  0x000055555598415b in memory_region_write_accessor (mr=0x55555720eb80, addr=556, value=0x7fffffffb838, size=1, shift=0, mask=255, attrs=...) at softmmu/memory.c:483
    
    Looking at bdrv_aio_cancel:
    
    2728 /* async I/Os */
    2729
    2730 void bdrv_aio_cancel(BlockAIOCB *acb)
    2731 {
    2732     qemu_aio_ref(acb);
    2733     bdrv_aio_cancel_async(acb);
    2734     while (acb->refcnt > 1) {
    2735         if (acb->aiocb_info->get_aio_context) {
    2736             aio_poll(acb->aiocb_info->get_aio_context(acb), true);
    2737         } else if (acb->bs) {
    2738             /* qemu_aio_ref and qemu_aio_unref are not thread-safe, so
    2739              * assert that we're not using an I/O thread.  Thread-safe
    2740              * code should use bdrv_aio_cancel_async exclusively.
    2741              */
    2742             assert(bdrv_get_aio_context(acb->bs) == qemu_get_aio_context());
    2743             aio_poll(bdrv_get_aio_context(acb->bs), true);
    2744         } else {
    2745             abort();     <===============
    2746         }
    2747     }
    2748     qemu_aio_unref(acb);
    2749 }
    
    Fixes: 02c50efe08736116048d5fc355043080f4d5859c ("block: Add bdrv_aio_cancel_async")
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1878255
    Originally-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20200720100141.129739-1-stefanha@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/block-backend.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/block-backend.c b/block/block-backend.c
index 0bf0188133..3a13cb5f0b 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1394,8 +1394,16 @@ typedef struct BlkAioEmAIOCB {
     bool has_returned;
 } BlkAioEmAIOCB;
 
+static AioContext *blk_aio_em_aiocb_get_aio_context(BlockAIOCB *acb_)
+{
+    BlkAioEmAIOCB *acb = container_of(acb_, BlkAioEmAIOCB, common);
+
+    return blk_get_aio_context(acb->rwco.blk);
+}
+
 static const AIOCBInfo blk_aio_em_aiocb_info = {
     .aiocb_size         = sizeof(BlkAioEmAIOCB),
+    .get_aio_context    = blk_aio_em_aiocb_get_aio_context,
 };
 
 static void blk_aio_complete(BlkAioEmAIOCB *acb)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14943.37257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIo-00012C-45; Thu, 29 Oct 2020 21:17:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14943.37257; Thu, 29 Oct 2020 21:17:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIo-000124-1F; Thu, 29 Oct 2020 21:17:46 +0000
Received: by outflank-mailman (input) for mailman id 14943;
 Thu, 29 Oct 2020 21:17:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFIm-00011n-Ah
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1e994358-70e0-4c53-8aec-af159c694621;
 Thu, 29 Oct 2020 21:17:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIl-0007mW-8p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIl-0003OO-82
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFIm-00011n-Ah
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:44 +0000
X-Inumbo-ID: 1e994358-70e0-4c53-8aec-af159c694621
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1e994358-70e0-4c53-8aec-af159c694621;
	Thu, 29 Oct 2020 21:17:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TrefMVCr7fWmdZZ74wFw+S5iTmGcDhwjtwlKm0aHCTs=; b=kvnwGwNUib36G7LINrsIpB8k1v
	f/HO3u27eR0xdhyT9mD1KKbuD/DZPl3m57EsfdA9sW+3kp0qohNL/+qLACOw98/YA+pqgQfOnRAoB
	Lez3CpcdBPw57/KC9hw+nCUxUhVv7uX9de7CHp+6q+uD4kqdv2laWm/4Mc0VupFosryI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIl-0007mW-8p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIl-0003OO-82
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-21' into staging
Message-Id: <E1kYFIl-0003OO-82@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:43 +0000

commit 98d897eb4b6fb8c637b2b046e1c543bc5a9f2c4e
Merge: 90218a9a393c7925f330e7dcc08658e2a01d3bd4 1d719ddc35e9827b6e5df771555874df34301a0d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 14:03:45 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 14:03:45 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-21' into staging
    
    Block patches for 5.1:
    - Let LUKS images only be shared between VMs if the guest device was
      configured to allow that
    - Fix abort() from bdrv_aio_cancel() for guest devices without a BDS
    
    # gpg: Signature made Tue 21 Jul 2020 12:47:17 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-21:
      block: fix bdrv_aio_cancel() for ENOMEDIUM requests
      qemu-iotests: add testcase for bz #1857490
      block/crypto: disallow write sharing by default
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/block-backend.c      |  8 ++++++++
 block/crypto.c             |  2 +-
 tests/qemu-iotests/296     | 44 +++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/296.out | 12 ++++++++++--
 4 files changed, 62 insertions(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:17:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:17:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14945.37262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIy-000149-62; Thu, 29 Oct 2020 21:17:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14945.37262; Thu, 29 Oct 2020 21:17:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFIy-000141-2g; Thu, 29 Oct 2020 21:17:56 +0000
Received: by outflank-mailman (input) for mailman id 14945;
 Thu, 29 Oct 2020 21:17:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFIw-00013s-FG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id be3690ab-aebb-47f3-b518-07e886d746e5;
 Thu, 29 Oct 2020 21:17:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIv-0007mo-Ja
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFIv-0003Py-Ig
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFIw-00013s-FG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:54 +0000
X-Inumbo-ID: be3690ab-aebb-47f3-b518-07e886d746e5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id be3690ab-aebb-47f3-b518-07e886d746e5;
	Thu, 29 Oct 2020 21:17:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oUK2OKVWVJ+kwOkcG2aGoFAbHDJSZS+FVmaW14TKet4=; b=eHGsLybz4PL47D4BPhO9kdYTD/
	F/KdoaW6x3SNt1nfZbKyQYribJElgB58d5g1P7zc5D4YuI53v55q5AGNfnWBKJHmT3yoG+1qTC0NP
	QO8UM4gbkgf9P5dWP0ogCAN7hTKNpT/CNswSe/1NS12uDHfg074/OOHiHOFbs1i1mOXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIv-0007mo-Ja
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFIv-0003Py-Ig
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:17:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qapi: Fix visit_type_STRUCT() not to fail for null object
Message-Id: <E1kYFIv-0003Py-Ig@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:17:53 +0000

commit cbf97d5b799f4bc47b9e825100d1a98d3cf77c80
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 16 17:06:17 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 14:38:23 2020 +0200

    qapi: Fix visit_type_STRUCT() not to fail for null object
    
    To make deallocating partially constructed objects work, the
    visit_type_STRUCT() need to succeed without doing anything when passed
    a null object.
    
    Commit cdd2b228b9 "qapi: Smooth visitor error checking in generated
    code" broke that.  To reproduce, run tests/test-qobject-input-visitor
    with AddressSanitizer:
    
        ==4353==ERROR: LeakSanitizer: detected memory leaks
    
        Direct leak of 16 byte(s) in 1 object(s) allocated from:
            #0 0x7f192d0c5d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
            #1 0x7f192cd21b10 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
            #2 0x556725f6bbee in visit_next_list qapi/qapi-visit-core.c:86
            #3 0x556725f49e15 in visit_type_UserDefOneList tests/test-qapi-visit.c:474
            #4 0x556725f4489b in test_visitor_in_fail_struct_in_list tests/test-qobject-input-visitor.c:1086
            #5 0x7f192cd42f29  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f29)
    
        SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
    
    Test case /visitor/input/fail/struct-in-list feeds a list with a bad
    element to the QObject input visitor.  Visiting that element duly
    fails, and aborts the visit with the list only partially constructed:
    the faulty object is null.  Cleaning up the partially constructed list
    visits that null object, fails, and aborts the visit before the list
    node gets freed.
    
    Fix the the generated visit_type_STRUCT() to succeed for null objects.
    
    Fixes: cdd2b228b973d2a29edf7696ef6e8b08ec329019
    Reported-by: Li Qiang <liq3ea@163.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200716150617.4027356-1-armbru@redhat.com>
    Tested-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
---
 scripts/qapi/visit.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 3fb2f30510..cdabc5fa28 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -249,6 +249,7 @@ bool visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
     if (!*obj) {
         /* incomplete */
         assert(visit_is_dealloc(v));
+        ok = true;
         goto out_obj;
     }
     if (!visit_type_%(c_name)s_members(v, *obj, errp)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14947.37268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJ8-00018G-BM; Thu, 29 Oct 2020 21:18:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14947.37268; Thu, 29 Oct 2020 21:18:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJ8-000188-8J; Thu, 29 Oct 2020 21:18:06 +0000
Received: by outflank-mailman (input) for mailman id 14947;
 Thu, 29 Oct 2020 21:18:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJ6-00017N-Cl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8e30f84c-f0ee-4132-95fa-09dc5e81b0ea;
 Thu, 29 Oct 2020 21:18:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJ5-0007nb-ND
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJ5-0003Qp-MR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJ6-00017N-Cl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:04 +0000
X-Inumbo-ID: 8e30f84c-f0ee-4132-95fa-09dc5e81b0ea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8e30f84c-f0ee-4132-95fa-09dc5e81b0ea;
	Thu, 29 Oct 2020 21:18:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XsiAd4anTC3zmxQcc3upm9tc2cImgoOa4iG2WXupKU0=; b=5nk6xP2OUflJ+qe1PmAwM5PHs1
	BPQbck3AWoX0jcc22eAR6BrhGz+8irqpByy1tOfkFew16ouVKz8+TzkL2lScQePXB01pGGGvs8IMv
	4Amgw0sMpQQgisLYNDK5PCfIwB/VtHIEY4cgj6rxjddLJW8VqMSfgy3eDLv812fATMLY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJ5-0007nb-ND
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJ5-0003Qp-MR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-07-21' into staging
Message-Id: <E1kYFJ5-0003Qp-MR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:03 +0000

commit 8856755eb8075ca6f3dab51c2791c210ebfe6550
Merge: 98d897eb4b6fb8c637b2b046e1c543bc5a9f2c4e cbf97d5b799f4bc47b9e825100d1a98d3cf77c80
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 16:10:38 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 16:10:38 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-07-21' into staging
    
    QAPI patches patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 14:05:05 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qapi-2020-07-21:
      qapi: Fix visit_type_STRUCT() not to fail for null object
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/qapi/visit.py | 1 +
 1 file changed, 1 insertion(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14948.37273 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJI-00019b-Cq; Thu, 29 Oct 2020 21:18:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14948.37273; Thu, 29 Oct 2020 21:18:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJI-00019T-9l; Thu, 29 Oct 2020 21:18:16 +0000
Received: by outflank-mailman (input) for mailman id 14948;
 Thu, 29 Oct 2020 21:18:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJH-00019H-2R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fe76a5e1-04ee-40d8-a17b-e49223480517;
 Thu, 29 Oct 2020 21:18:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJG-0007nk-2E
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJG-0003Ru-1V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJH-00019H-2R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:15 +0000
X-Inumbo-ID: fe76a5e1-04ee-40d8-a17b-e49223480517
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fe76a5e1-04ee-40d8-a17b-e49223480517;
	Thu, 29 Oct 2020 21:18:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TKKo8RVGq1NuJwgzjW7/fWuNKbUqbDzf4SOj8j/LcuQ=; b=14orVvMyfarGP4SA8Ylbc1LywQ
	e1kgvEZL4sL6WFwKSOCI+X16uG+QHMRPMVhsqwNcd4L3KUPVtbhtWngH5lmKxVD0ry3XzldjU9Ofy
	S0m83feWigae0KTKkpe2VXc9WTWpesGBaavP4sfuLZblPqQn4L7xxuR2L12qmlbY3wtY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJG-0007nk-2E
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJG-0003Ru-1V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/net: Added plen fix for IPv6
Message-Id: <E1kYFJG-0003Ru-1V@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:14 +0000

commit e219d30910d8584868dd5c11df10ba2a1336034c
Author:     Andrew <andrew@daynix.com>
AuthorDate: Thu Jul 16 06:53:24 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 21 21:30:39 2020 +0800

    hw/net: Added plen fix for IPv6
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1708065
    With network backend with 'virtual header' - there was an issue
    in 'plen' field. Overall, during TSO, 'plen' would be changed,
    but with 'vheader' this field should be set to the size of the
    payload itself instead of '0'.
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 23 +++++++++++++++++++++++
 hw/net/net_tx_pkt.h | 14 ++++++++++++++
 include/net/eth.h   |  1 +
 3 files changed, 38 insertions(+)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 331c73cfc0..9560e4a49e 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -626,6 +626,7 @@ bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientState *nc)
 
     if (pkt->has_virt_hdr ||
         pkt->virt_hdr.gso_type == VIRTIO_NET_HDR_GSO_NONE) {
+        net_tx_pkt_fix_ip6_payload_len(pkt);
         net_tx_pkt_sendv(pkt, nc, pkt->vec,
             pkt->payload_frags + NET_TX_PKT_PL_START_FRAG);
         return true;
@@ -644,3 +645,25 @@ bool net_tx_pkt_send_loopback(struct NetTxPkt *pkt, NetClientState *nc)
 
     return res;
 }
+
+void net_tx_pkt_fix_ip6_payload_len(struct NetTxPkt *pkt)
+{
+    struct iovec *l2 = &pkt->vec[NET_TX_PKT_L2HDR_FRAG];
+    if (eth_get_l3_proto(l2, 1, l2->iov_len) == ETH_P_IPV6) {
+        struct ip6_header *ip6 = (struct ip6_header *) pkt->l3_hdr;
+        /*
+         * TODO: if qemu would support >64K packets - add jumbo option check
+         * something like that:
+         * 'if (ip6->ip6_plen == 0 && !has_jumbo_option(ip6)) {'
+         */
+        if (ip6->ip6_plen == 0) {
+            if (pkt->payload_len <= ETH_MAX_IP_DGRAM_LEN) {
+                ip6->ip6_plen = htons(pkt->payload_len);
+            }
+            /*
+             * TODO: if qemu would support >64K packets
+             * add jumbo option for packets greater then 65,535 bytes
+             */
+        }
+    }
+}
diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h
index 212ecc62fc..4ec8bbe9bd 100644
--- a/hw/net/net_tx_pkt.h
+++ b/hw/net/net_tx_pkt.h
@@ -187,4 +187,18 @@ bool net_tx_pkt_parse(struct NetTxPkt *pkt);
 */
 bool net_tx_pkt_has_fragments(struct NetTxPkt *pkt);
 
+/**
+ * Fix IPv6 'plen' field.
+ * If ipv6 payload length field is 0 - then there should be Hop-by-Hop
+ * option for packets greater than 65,535.
+ * For packets with a payload less than 65,535: fix 'plen' field.
+ * For backends with vheader, we need just one packet with proper
+ * payload size. For now, qemu drops every packet with size greater 64K
+ * (see net_tx_pkt_send()) so, there is no reason to add jumbo option to ip6
+ * hop-by-hop extension if it's missed
+ *
+ * @pkt            packet
+ */
+void net_tx_pkt_fix_ip6_payload_len(struct NetTxPkt *pkt);
+
 #endif
diff --git a/include/net/eth.h b/include/net/eth.h
index 7f45c678e7..0671be6916 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -186,6 +186,7 @@ struct tcp_hdr {
 
 #define ip6_nxt      ip6_ctlun.ip6_un1.ip6_un1_nxt
 #define ip6_ecn_acc  ip6_ctlun.ip6_un3.ip6_un3_ecn
+#define ip6_plen     ip6_ctlun.ip6_un1.ip6_un1_plen
 
 #define PKT_GET_ETH_HDR(p)        \
     ((struct eth_header *)(p))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14949.37277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJT-0001Av-EJ; Thu, 29 Oct 2020 21:18:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14949.37277; Thu, 29 Oct 2020 21:18:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJT-0001Am-BH; Thu, 29 Oct 2020 21:18:27 +0000
Received: by outflank-mailman (input) for mailman id 14949;
 Thu, 29 Oct 2020 21:18:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJR-0001Aa-GL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3013b72b-e922-4526-9394-68c7f28f58ed;
 Thu, 29 Oct 2020 21:18:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJQ-0007ns-5g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJQ-0003SY-4z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJR-0001Aa-GL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:25 +0000
X-Inumbo-ID: 3013b72b-e922-4526-9394-68c7f28f58ed
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3013b72b-e922-4526-9394-68c7f28f58ed;
	Thu, 29 Oct 2020 21:18:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HHL5peOhnuNk7xFSckgnuZSErKoERuq5tgXDhPRfrdE=; b=eBkkFOmuXrtBzfkB4xl+FfJLEZ
	cahjbCHs/vwO6hTZdnCgYbgPCGBb/+8Jz9Uza+ncIJwFvxvZ0+ufIc8w71EETC4akqnxLA8oxWx+J
	L/4Vo+gNq7v+vGMHCsbzxg4ezeOEFoo7VroQM6i4/ho1eOGLWoYaC+WYLV7Kw7wcPrOs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJQ-0007ns-5g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJQ-0003SY-4z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
Message-Id: <E1kYFJQ-0003SY-4z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:24 +0000

commit 5519724a13664b43e225ca05351c60b4468e4555
Author:     Mauro Matteo Cascella <mcascell@redhat.com>
AuthorDate: Fri Jul 10 11:19:41 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 21 21:30:39 2020 +0800

    hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
    
    A buffer overflow issue was reported by Mr. Ziming Zhang, CC'd here. It
    occurs while sending an Ethernet frame due to missing break statements
    and improper checking of the buffer size.
    
    Reported-by: Ziming Zhang <ezrakiez@gmail.com>
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/xgmac.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index 574dd47b41..5bf1b61012 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -220,21 +220,31 @@ static void xgmac_enet_send(XgmacState *s)
         }
         len = (bd.buffer1_size & 0xfff) + (bd.buffer2_size & 0xfff);
 
+        /*
+         * FIXME: these cases of malformed tx descriptors (bad sizes)
+         * should probably be reported back to the guest somehow
+         * rather than simply silently stopping processing, but we
+         * don't know what the hardware does in this situation.
+         * This will only happen for buggy guests anyway.
+         */
         if ((bd.buffer1_size & 0xfff) > 2048) {
             DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
                         "xgmac buffer 1 len on send > 2048 (0x%x)\n",
                          __func__, bd.buffer1_size & 0xfff);
+            break;
         }
         if ((bd.buffer2_size & 0xfff) != 0) {
             DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
                         "xgmac buffer 2 len on send != 0 (0x%x)\n",
                         __func__, bd.buffer2_size & 0xfff);
+            break;
         }
-        if (len >= sizeof(frame)) {
+        if (frame_size + len >= sizeof(frame)) {
             DEBUGF_BRK("qemu:%s: buffer overflow %d read into %zu "
-                        "buffer\n" , __func__, len, sizeof(frame));
+                        "buffer\n" , __func__, frame_size + len, sizeof(frame));
             DEBUGF_BRK("qemu:%s: buffer1.size=%d; buffer2.size=%d\n",
                         __func__, bd.buffer1_size, bd.buffer2_size);
+            break;
         }
 
         cpu_physical_memory_read(bd.buffer1_addr, ptr, len);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14950.37281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJc-0001C2-G2; Thu, 29 Oct 2020 21:18:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14950.37281; Thu, 29 Oct 2020 21:18:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJc-0001Bt-Cq; Thu, 29 Oct 2020 21:18:36 +0000
Received: by outflank-mailman (input) for mailman id 14950;
 Thu, 29 Oct 2020 21:18:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJb-0001Bl-2k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id dfdc0934-972f-493f-b74b-9fb613f2d345;
 Thu, 29 Oct 2020 21:18:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJa-0007ny-95
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJa-0003TK-8K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJb-0001Bl-2k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:35 +0000
X-Inumbo-ID: dfdc0934-972f-493f-b74b-9fb613f2d345
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id dfdc0934-972f-493f-b74b-9fb613f2d345;
	Thu, 29 Oct 2020 21:18:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AD8mooUxnDXS8LZvjmjM5jIJ245bdI6kyZu8zuwM+h4=; b=zoVHvpRTXQuHAFeXpUhhCnLGKG
	UMq0E5lrnTZsZ2jG7ASkHOe0aPtD2YQHfr8IcA1mBx/yOf24i5f1F2WZ3rkbW9EYEoBKLM84k3+Cj
	6qNvQQ61OoOaT1FPZnf49nzi0SI/MSy8HvRIS3fAXkQINmSEQqvntItrfsZLSaxe8Fb8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJa-0007ny-95
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJa-0003TK-8K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYFJa-0003TK-8K@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:34 +0000

commit 5252220dbf006969fab377d7ab42c6704d833e8a
Merge: 8856755eb8075ca6f3dab51c2791c210ebfe6550 5519724a13664b43e225ca05351c60b4468e4555
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 16:50:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 16:50:42 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Tue 21 Jul 2020 14:31:13 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
      hw/net: Added plen fix for IPv6
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/net_tx_pkt.c | 23 +++++++++++++++++++++++
 hw/net/net_tx_pkt.h | 14 ++++++++++++++
 hw/net/xgmac.c      | 14 ++++++++++++--
 include/net/eth.h   |  1 +
 4 files changed, 50 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14951.37285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJn-0001DR-HH; Thu, 29 Oct 2020 21:18:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14951.37285; Thu, 29 Oct 2020 21:18:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJn-0001DJ-EM; Thu, 29 Oct 2020 21:18:47 +0000
Received: by outflank-mailman (input) for mailman id 14951;
 Thu, 29 Oct 2020 21:18:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJl-0001D8-Ka
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8c68f004-35ed-4bb9-b518-5e8af1ca3796;
 Thu, 29 Oct 2020 21:18:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJk-0007o6-Kg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJk-0003UQ-Jr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJl-0001D8-Ka
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:45 +0000
X-Inumbo-ID: 8c68f004-35ed-4bb9-b518-5e8af1ca3796
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8c68f004-35ed-4bb9-b518-5e8af1ca3796;
	Thu, 29 Oct 2020 21:18:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=W1+2RlXmsjmy/AVtiE7apqbeXZ5dQLYaoHdpdPo4HxU=; b=AT4tuMV1hFyrqIZ2FNzKAvXzMD
	06tAxZnbwZFvBSMrbcJCc9ezcuGUTOIVRE6zIXPedOJJDuSQ5nF1E+069FO8GzYU47zePp09Nxj2r
	7+gn0vZx1VpLX+yG5L3bYCjIbAdRRLo7xl97U+cPNEdTrjrbGo+ItlbPQ0Je3nTAPY3o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJk-0007o6-Kg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJk-0003UQ-Jr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] xhci: fix valid.max_access_size to access address registers
Message-Id: <E1kYFJk-0003UQ-Jr@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:44 +0000

commit 8e67fda2dd6202ccec093fda561107ba14830a17
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 21 10:33:22 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:38 2020 +0200

    xhci: fix valid.max_access_size to access address registers
    
    QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
    64-bit mode access in "runtime" and "operational" MemoryRegionOps.
    
    Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.
    
    XHCI specs:
    "If the xHC supports 64-bit addressing (AC64 = ‘1’), then software
    should write 64-bit registers using only Qword accesses.  If a
    system is incapable of issuing Qword accesses, then writes to the
    64-bit address fields shall be performed using 2 Dword accesses;
    low Dword-first, high-Dword second.  If the xHC supports 32-bit
    addressing (AC64 = ‘0’), then the high Dword of registers containing
    64-bit address fields are unused and software should write addresses
    using only Dword accesses"
    
    The problem has been detected with SLOF, as linux kernel always accesses
    registers using 32-bit access even if AC64 is set and revealed by
    5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    
    Suggested-by: Alexey Kardashevskiy <aik@au1.ibm.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-id: 20200721083322.90651-1-lvivier@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-xhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index b330e36fe6..67a18fe2b6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = {
     .read = xhci_oper_read,
     .write = xhci_oper_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
@@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = {
     .read = xhci_runtime_read,
     .write = xhci_runtime_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:18:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:18:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14952.37289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJx-0001Ed-Ig; Thu, 29 Oct 2020 21:18:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14952.37289; Thu, 29 Oct 2020 21:18:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFJx-0001EV-Fo; Thu, 29 Oct 2020 21:18:57 +0000
Received: by outflank-mailman (input) for mailman id 14952;
 Thu, 29 Oct 2020 21:18:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFJv-0001EL-Ml
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id db3858c2-c5b4-44c4-90a7-b74cb226e588;
 Thu, 29 Oct 2020 21:18:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJu-0007oI-Op
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFJu-0003V6-NU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFJv-0001EL-Ml
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:55 +0000
X-Inumbo-ID: db3858c2-c5b4-44c4-90a7-b74cb226e588
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id db3858c2-c5b4-44c4-90a7-b74cb226e588;
	Thu, 29 Oct 2020 21:18:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pvSKoqJxYn143P9SzYdLlLUp7JO7IiwS31v5igGPv0Q=; b=FVRH5SJBVvRi4EgsdLVIVFVMTS
	sNc1hNaGF0E8Rntn0uN8YHBRSXPF87/NB8wo3B3kUK8u8avV2+e6vadbcrTLGi8lLT5xENPw++2kP
	PgehUO2A+vPo3rCXNc9poK3IZc6KhvLlV5LZ+JLCjWf4PQ/wNEJyMH10eMMmqR0pkqss=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJu-0007oI-Op
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFJu-0003V6-NU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:18:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qxl: fix modular builds with dtrace
Message-Id: <E1kYFJu-0003V6-NU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:18:54 +0000

commit d97df4b84bc42613cf9a03619de453ebd0be30b7
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 20 12:03:50 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:47 2020 +0200

    qxl: fix modular builds with dtrace
    
    Checking the enable/disable state of tracepoints via
    trace_event_get_state_backends() does not work for modules.
    
    qxl checks the state for a small optimization (avoid g_strndup
    call in case log_buf will not be used anyway), so we can just
    drop that check for modular builds.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-Id: <20200720100352.2477-2-kraxel@redhat.com>
---
 hw/display/qxl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index d5627119ec..11871340e7 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1762,7 +1762,16 @@ async_common:
         qxl_set_mode(d, val, 0);
         break;
     case QXL_IO_LOG:
+#ifdef CONFIG_MODULES
+        /*
+         * FIXME
+         * trace_event_get_state_backends() does not work for modules,
+         * it leads to "undefined symbol: qemu_qxl_io_log_semaphore"
+         */
+        if (true) {
+#else
         if (trace_event_get_state_backends(TRACE_QXL_IO_LOG) || d->guestdebug) {
+#endif
             /* We cannot trust the guest to NUL terminate d->ram->log_buf */
             char *log_buf = g_strndup((const char *)d->ram->log_buf,
                                       sizeof(d->ram->log_buf));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14953.37293 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFK7-0001GK-KR; Thu, 29 Oct 2020 21:19:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14953.37293; Thu, 29 Oct 2020 21:19:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFK7-0001GC-HM; Thu, 29 Oct 2020 21:19:07 +0000
Received: by outflank-mailman (input) for mailman id 14953;
 Thu, 29 Oct 2020 21:19:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFK5-0001G4-Kj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ff6e3a0c-9e3d-475b-ae2d-3714e8f5396a;
 Thu, 29 Oct 2020 21:19:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFK4-0007pE-Sa
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFK4-0003Vr-Rp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFK5-0001G4-Kj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:05 +0000
X-Inumbo-ID: ff6e3a0c-9e3d-475b-ae2d-3714e8f5396a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ff6e3a0c-9e3d-475b-ae2d-3714e8f5396a;
	Thu, 29 Oct 2020 21:19:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NqrpG2h6n68BSqf5KXx6sUOxWPq1LBdscjtxd3ieE7o=; b=BiLTWkx8LWyHXXSV3QbHeFF111
	BjqmIjMICCZDxJNaxX0ajYttG5enIdHs3YXqyqfBslupQzVtiOrQ3VIwuJ2JfmmfZUfLczGCP2YEY
	dE5gbTH//NNxSXJ6HacXUtnphBYw8u/mT6e8dF0EXqlsLONA14OmQM6UROuX4dvo2s0Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFK4-0007pE-Sa
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFK4-0003Vr-Rp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] module: ignore NULL type
Message-Id: <E1kYFK4-0003Vr-Rp@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:04 +0000

commit d87350b065128e8156e7aca93e89a1ab9e5fa63d
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 20 12:03:51 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:51 2020 +0200

    module: ignore NULL type
    
    Just return in case module_load_qom_one(NULL) is called.
    vga_interface_available() can do that.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-Id: <20200720100352.2477-3-kraxel@redhat.com>
---
 util/module.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/util/module.c b/util/module.c
index 90e9bd42c6..0ab00851f0 100644
--- a/util/module.c
+++ b/util/module.c
@@ -275,6 +275,9 @@ void module_load_qom_one(const char *type)
 {
     int i;
 
+    if (!type) {
+        return;
+    }
     if (module_loaded_qom_all) {
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14954.37297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKH-0001Ho-Na; Thu, 29 Oct 2020 21:19:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14954.37297; Thu, 29 Oct 2020 21:19:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKH-0001Hg-KQ; Thu, 29 Oct 2020 21:19:17 +0000
Received: by outflank-mailman (input) for mailman id 14954;
 Thu, 29 Oct 2020 21:19:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFKF-0001HU-Ug
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7974c47d-eab5-405e-bf48-4ddbe22880da;
 Thu, 29 Oct 2020 21:19:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKE-0007pS-WB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKE-0003Wy-VT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFKF-0001HU-Ug
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:15 +0000
X-Inumbo-ID: 7974c47d-eab5-405e-bf48-4ddbe22880da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7974c47d-eab5-405e-bf48-4ddbe22880da;
	Thu, 29 Oct 2020 21:19:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0u2gfzTRgjWMbfJjg5pmdhq8luJsOBPDLP8e2/ljhLw=; b=fmNkC1WDCYY+VbBPq2jvghXTfS
	rxRaTEgyJW4C3lHr2UQgpQhFpYXoTsiZZIyk4pse3r7LiNVA96Md1RIXG0x/MNbAELOFD/qPw2p/f
	RjOJGTpAFmtK+4eiYf6kBZzzoJu+lqiivIS52l9XrcLaDRRrGv2rsY/vb+yQjjIOV2Wc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKE-0007pS-WB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKE-0003Wy-VT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200721-pull-request' into staging
Message-Id: <E1kYFKE-0003Wy-VT@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:14 +0000

commit a418695e1b177da055d477c4e15ce900c01a94fd
Merge: 5252220dbf006969fab377d7ab42c6704d833e8a d87350b065128e8156e7aca93e89a1ab9e5fa63d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 17:36:14 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 17:36:14 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200721-pull-request' into staging
    
    fixes for xhci and modular builds.
    
    # gpg: Signature made Tue 21 Jul 2020 15:02:33 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200721-pull-request:
      module: ignore NULL type
      qxl: fix modular builds with dtrace
      xhci: fix valid.max_access_size to access address registers
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/display/qxl.c  | 9 +++++++++
 hw/usb/hcd-xhci.c | 4 ++--
 util/module.c     | 3 +++
 3 files changed, 14 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14955.37301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKR-0001J4-Oy; Thu, 29 Oct 2020 21:19:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14955.37301; Thu, 29 Oct 2020 21:19:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKR-0001Ix-Lx; Thu, 29 Oct 2020 21:19:27 +0000
Received: by outflank-mailman (input) for mailman id 14955;
 Thu, 29 Oct 2020 21:19:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFKR-0001Ip-3j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3ebc2f6a-8689-4ded-9d0a-4571ef995f13;
 Thu, 29 Oct 2020 21:19:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKP-0007pd-CI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKP-0003YI-BZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFKR-0001Ip-3j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:27 +0000
X-Inumbo-ID: 3ebc2f6a-8689-4ded-9d0a-4571ef995f13
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3ebc2f6a-8689-4ded-9d0a-4571ef995f13;
	Thu, 29 Oct 2020 21:19:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2n6mr9ItjVlr9Q4jjCU1Y8FFqRKixGRXcosyzg/jINY=; b=XV+7YZadzBPt2Rg1RKb08p/yo/
	vjf6HJAZimvy3+cnpGpNul6J0wAGlV24mzWiGou1GnwvkCrQHAUU1gGk5S6UazIxTz35sS5FMLbW3
	USV9OZNWc+199bxHPxqLzvophthg+uC78/Lpp0iQBKvUDJd4Q9p6CZ817TAoKJZyX3bE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKP-0007pd-CI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKP-0003YI-BZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qom: Change object_get_canonical_path_component() not to malloc
Message-Id: <E1kYFKP-0003YI-BZ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:25 +0000

commit 7a309cc95b862be74711e7a35997daa3f885651a
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:00 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 16:23:43 2020 +0200

    qom: Change object_get_canonical_path_component() not to malloc
    
    object_get_canonical_path_component() returns a malloced copy of a
    property name on success, null on failure.
    
    19 of its 25 callers immediately free the returned copy.
    
    Change object_get_canonical_path_component() to return the property
    name directly.  Since modifying the name would be wrong, adjust the
    return type to const char *.
    
    Drop the free from the 19 callers become simpler, add the g_strdup()
    to the other six.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-4-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
---
 backends/hostmem.c         |  2 +-
 block/throttle-groups.c    |  2 +-
 gdbstub.c                  |  2 +-
 hw/arm/xlnx-zynqmp.c       |  6 ++----
 hw/block/nvme.c            |  5 ++---
 hw/core/machine-qmp-cmds.c |  2 +-
 hw/core/machine.c          |  5 ++---
 hw/mem/nvdimm.c            |  5 ++---
 hw/mem/pc-dimm.c           |  5 ++---
 hw/misc/ivshmem.c          |  5 ++---
 hw/ppc/spapr_drc.c         |  3 +--
 hw/ppc/trace-events        |  2 +-
 hw/virtio/virtio-crypto.c  |  5 ++---
 hw/virtio/virtio-mem.c     |  6 ++----
 hw/virtio/virtio-pmem.c    |  5 ++---
 include/qom/object.h       |  2 +-
 iothread.c                 |  9 ++++-----
 net/net.c                  |  6 ++----
 qom/object.c               |  7 +++----
 qom/qom-hmp-cmds.c         | 11 ++++-------
 scsi/pr-manager-helper.c   |  3 +--
 scsi/pr-manager.c          |  2 +-
 softmmu/memory.c           |  2 +-
 23 files changed, 41 insertions(+), 61 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index c614f1bdc1..4bde00e8e7 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -33,7 +33,7 @@ char *
 host_memory_backend_get_name(HostMemoryBackend *backend)
 {
     if (!backend->use_canonical_path) {
-        return object_get_canonical_path_component(OBJECT(backend));
+        return g_strdup(object_get_canonical_path_component(OBJECT(backend)));
     }
 
     return object_get_canonical_path(OBJECT(backend));
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 03a53c89ea..98fea7fd47 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -771,7 +771,7 @@ static void throttle_group_obj_complete(UserCreatable *obj, Error **errp)
 
     /* set group name to object id if it exists */
     if (!tg->name && tg->parent_obj.parent) {
-        tg->name = object_get_canonical_path_component(OBJECT(obj));
+        tg->name = g_strdup(object_get_canonical_path_component(OBJECT(obj)));
     }
     /* We must have a group name at this point */
     assert(tg->name);
diff --git a/gdbstub.c b/gdbstub.c
index 6950fd243f..f3a318cd7f 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2059,7 +2059,7 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
         /* Print the CPU model and name in multiprocess mode */
         ObjectClass *oc = object_get_class(OBJECT(cpu));
         const char *cpu_model = object_class_get_name(oc);
-        g_autofree char *cpu_name =
+        const char *cpu_name =
             object_get_canonical_path_component(OBJECT(cpu));
         g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
                         cpu->halted ? "halted " : "running");
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 772cfa3771..e14323c991 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -190,7 +190,7 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
     qdev_prop_set_uint32(DEVICE(&s->rpu_cluster), "cluster-id", 1);
 
     for (i = 0; i < num_rpus; i++) {
-        char *name;
+        const char *name;
 
         object_initialize_child(OBJECT(&s->rpu_cluster), "rpu-cpu[*]",
                                 &s->rpu_cpu[i],
@@ -204,7 +204,6 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
         } else {
             s->boot_cpu_ptr = &s->rpu_cpu[i];
         }
-        g_free(name);
 
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), "reset-hivecs", true,
                                  &error_abort);
@@ -341,7 +340,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
 
     /* Realize APUs before realizing the GIC. KVM requires this.  */
     for (i = 0; i < num_apus; i++) {
-        char *name;
+        const char *name;
 
         object_property_set_int(OBJECT(&s->apu_cpu[i]), "psci-conduit",
                                 QEMU_PSCI_CONDUIT_SMC, &error_abort);
@@ -354,7 +353,6 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
         } else {
             s->boot_cpu_ptr = &s->apu_cpu[i];
         }
-        g_free(name);
 
         object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el3", s->secure,
                                  NULL);
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 1aee042d4c..3426e17e65 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1397,9 +1397,8 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
 
     if (!n->params.cmb_size_mb && n->pmrdev) {
         if (host_memory_backend_is_mapped(n->pmrdev)) {
-            char *path = object_get_canonical_path_component(OBJECT(n->pmrdev));
-            error_setg(errp, "can't use already busy memdev: %s", path);
-            g_free(path);
+            error_setg(errp, "can't use already busy memdev: %s",
+                       object_get_canonical_path_component(OBJECT(n->pmrdev)));
             return;
         }
 
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 2c5da8413d..963088b798 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -315,7 +315,7 @@ static int query_memdev(Object *obj, void *opaque)
 
         m->value = g_malloc0(sizeof(*m->value));
 
-        m->value->id = object_get_canonical_path_component(obj);
+        m->value->id = g_strdup(object_get_canonical_path_component(obj));
         m->value->has_id = !!m->value->id;
 
         m->value->size = object_property_get_uint(obj, "size",
diff --git a/hw/core/machine.c b/hw/core/machine.c
index eb267b828d..2f881d6d75 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1073,9 +1073,8 @@ MemoryRegion *machine_consume_memdev(MachineState *machine,
     MemoryRegion *ret = host_memory_backend_get_memory(backend);
 
     if (memory_region_is_mapped(ret)) {
-        char *path = object_get_canonical_path_component(OBJECT(backend));
-        error_report("memory backend %s can't be used multiple times.", path);
-        g_free(path);
+        error_report("memory backend %s can't be used multiple times.",
+                     object_get_canonical_path_component(OBJECT(backend)));
         exit(EXIT_FAILURE);
     }
     host_memory_backend_set_mapped(backend, true);
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index d0d6e553cf..e1574bc07c 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -137,13 +137,12 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
 
     if (size <= nvdimm->label_size || !pmem_size) {
         HostMemoryBackend *hostmem = dimm->hostmem;
-        char *path = object_get_canonical_path_component(OBJECT(hostmem));
 
         error_setg(errp, "the size of memdev %s (0x%" PRIx64 ") is too "
                    "small to contain nvdimm label (0x%" PRIx64 ") and "
                    "aligned PMEM (0x%" PRIx64 ")",
-                   path, memory_region_size(mr), nvdimm->label_size, align);
-        g_free(path);
+                   object_get_canonical_path_component(OBJECT(hostmem)),
+                   memory_region_size(mr), nvdimm->label_size, align);
         return;
     }
 
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 9d3f0b9691..c30351070b 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -179,9 +179,8 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     } else if (host_memory_backend_is_mapped(dimm->hostmem)) {
-        char *path = object_get_canonical_path_component(OBJECT(dimm->hostmem));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(dimm->hostmem)));
         return;
     }
     if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index fc128b25e2..2b6882face 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -1037,9 +1037,8 @@ static void ivshmem_plain_realize(PCIDevice *dev, Error **errp)
         error_setg(errp, "You must specify a 'memdev'");
         return;
     } else if (host_memory_backend_is_mapped(s->hostmem)) {
-        char *path = object_get_canonical_path_component(OBJECT(s->hostmem));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(s->hostmem)));
         return;
     }
 
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 43d12bc33a..fe998d8108 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -513,7 +513,7 @@ static void realize(DeviceState *d, Error **errp)
     SpaprDrc *drc = SPAPR_DR_CONNECTOR(d);
     Object *root_container;
     gchar *link_name;
-    char *child_name;
+    const char *child_name;
 
     trace_spapr_drc_realize(spapr_drc_index(drc));
     /* NOTE: we do this as part of realize/unrealize due to the fact
@@ -529,7 +529,6 @@ static void realize(DeviceState *d, Error **errp)
     trace_spapr_drc_realize_child(spapr_drc_index(drc), child_name);
     object_property_add_alias(root_container, link_name,
                               drc->owner, child_name);
-    g_free(child_name);
     g_free(link_name);
     vmstate_register(VMSTATE_IF(drc), spapr_drc_index(drc), &vmstate_spapr_drc,
                      drc);
diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
index 9ea620f23c..7c0be4102e 100644
--- a/hw/ppc/trace-events
+++ b/hw/ppc/trace-events
@@ -57,7 +57,7 @@ spapr_drc_detach(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_awaiting_quiesce(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_reset(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_realize(uint32_t index) "drc: 0x%"PRIx32
-spapr_drc_realize_child(uint32_t index, char *childname) "drc: 0x%"PRIx32", child name: %s"
+spapr_drc_realize_child(uint32_t index, const char *childname) "drc: 0x%"PRIx32", child name: %s"
 spapr_drc_realize_complete(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_unrealize(uint32_t index) "drc: 0x%"PRIx32
 
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index bd9165c565..6da12e315f 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -786,9 +786,8 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'cryptodev' parameter expects a valid object");
         return;
     } else if (cryptodev_backend_is_used(vcrypto->cryptodev)) {
-        char *path = object_get_canonical_path_component(OBJECT(vcrypto->conf.cryptodev));
-        error_setg(errp, "can't use already used cryptodev backend: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already used cryptodev backend: %s",
+                   object_get_canonical_path_component(OBJECT(vcrypto->conf.cryptodev)));
         return;
     }
 
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 65850530e7..c12e9f79b0 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -409,11 +409,9 @@ static void virtio_mem_device_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'%s' property is not set", VIRTIO_MEM_MEMDEV_PROP);
         return;
     } else if (host_memory_backend_is_mapped(vmem->memdev)) {
-        char *path = object_get_canonical_path_component(OBJECT(vmem->memdev));
-
         error_setg(errp, "'%s' property specifies a busy memdev: %s",
-                   VIRTIO_MEM_MEMDEV_PROP, path);
-        g_free(path);
+                   VIRTIO_MEM_MEMDEV_PROP,
+                   object_get_canonical_path_component(OBJECT(vmem->memdev)));
         return;
     } else if (!memory_region_is_ram(&vmem->memdev->mr) ||
         memory_region_is_rom(&vmem->memdev->mr) ||
diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
index c3374b2f3f..1e0c137497 100644
--- a/hw/virtio/virtio-pmem.c
+++ b/hw/virtio/virtio-pmem.c
@@ -112,9 +112,8 @@ static void virtio_pmem_realize(DeviceState *dev, Error **errp)
     }
 
     if (host_memory_backend_is_mapped(pmem->memdev)) {
-        char *path = object_get_canonical_path_component(OBJECT(pmem->memdev));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(pmem->memdev)));
         return;
     }
 
diff --git a/include/qom/object.h b/include/qom/object.h
index 79c8f838b6..55d925d2c8 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1462,7 +1462,7 @@ Object *object_get_internal_root(void);
  * path is the path within the composition tree starting from the root.
  * %NULL if the object doesn't have a parent (and thus a canonical path).
  */
-char *object_get_canonical_path_component(const Object *obj);
+const char *object_get_canonical_path_component(const Object *obj);
 
 /**
  * object_get_canonical_path:
diff --git a/iothread.c b/iothread.c
index 0598a6d20d..263ec6e5bc 100644
--- a/iothread.c
+++ b/iothread.c
@@ -165,7 +165,7 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
 {
     Error *local_error = NULL;
     IOThread *iothread = IOTHREAD(obj);
-    char *name, *thread_name;
+    char *thread_name;
 
     iothread->stopping = false;
     iothread->running = true;
@@ -195,12 +195,11 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
     /* This assumes we are called from a thread with useful CPU affinity for us
      * to inherit.
      */
-    name = object_get_canonical_path_component(OBJECT(obj));
-    thread_name = g_strdup_printf("IO %s", name);
+    thread_name = g_strdup_printf("IO %s",
+                        object_get_canonical_path_component(OBJECT(obj)));
     qemu_thread_create(&iothread->thread, thread_name, iothread_run,
                        iothread, QEMU_THREAD_JOINABLE);
     g_free(thread_name);
-    g_free(name);
 
     /* Wait for initialization to complete */
     while (iothread->thread_id == -1) {
@@ -303,7 +302,7 @@ type_init(iothread_register_types)
 
 char *iothread_get_id(IOThread *iothread)
 {
-    return object_get_canonical_path_component(OBJECT(iothread));
+    return g_strdup(object_get_canonical_path_component(OBJECT(iothread)));
 }
 
 AioContext *iothread_get_aio_context(IOThread *iothread)
diff --git a/net/net.c b/net/net.c
index 7fddcebaa2..bbaedb3c7a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1185,12 +1185,10 @@ void print_net_client(Monitor *mon, NetClientState *nc)
         monitor_printf(mon, "filters:\n");
     }
     QTAILQ_FOREACH(nf, &nc->filters, next) {
-        char *path = object_get_canonical_path_component(OBJECT(nf));
-
-        monitor_printf(mon, "  - %s: type=%s", path,
+        monitor_printf(mon, "  - %s: type=%s",
+                       object_get_canonical_path_component(OBJECT(nf)),
                        object_get_typename(OBJECT(nf)));
         netfilter_print_info(mon, nf);
-        g_free(path);
     }
 }
 
diff --git a/qom/object.c b/qom/object.c
index 76f5f75239..00fdf89b3b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1931,7 +1931,7 @@ object_property_add_const_link(Object *obj, const char *name,
                                 NULL, OBJ_PROP_LINK_DIRECT);
 }
 
-char *object_get_canonical_path_component(const Object *obj)
+const char *object_get_canonical_path_component(const Object *obj)
 {
     ObjectProperty *prop = NULL;
     GHashTableIter iter;
@@ -1947,7 +1947,7 @@ char *object_get_canonical_path_component(const Object *obj)
         }
 
         if (prop->opaque == obj) {
-            return g_strdup(prop->name);
+            return prop->name;
         }
     }
 
@@ -1966,7 +1966,7 @@ char *object_get_canonical_path(const Object *obj)
     }
 
     do {
-        char *component = object_get_canonical_path_component(obj);
+        const char *component = object_get_canonical_path_component(obj);
 
         if (!component) {
             /* A canonical path must be complete, so discard what was
@@ -1978,7 +1978,6 @@ char *object_get_canonical_path(const Object *obj)
 
         newpath = g_strdup_printf("/%s%s", component, path ? path : "");
         g_free(path);
-        g_free(component);
         path = newpath;
         obj = obj->parent;
     } while (obj != root);
diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index aaacadacca..4032c96089 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -96,10 +96,8 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
 static int qom_composition_compare(const void *a, const void *b, void *ignore)
 {
-    g_autofree char *ac = object_get_canonical_path_component(a);
-    g_autofree char *bc = object_get_canonical_path_component(b);
-
-    return g_strcmp0(ac, bc);
+    return g_strcmp0(object_get_canonical_path_component(a),
+                     object_get_canonical_path_component(b));
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
@@ -112,18 +110,17 @@ static int insert_qom_composition_child(Object *obj, void *opaque)
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent)
 {
-    char *name;
+    const char *name;
     GQueue children;
     Object *child;
 
     if (obj == object_get_root()) {
-        name = g_strdup("");
+        name = "";
     } else {
         name = object_get_canonical_path_component(obj);
     }
     monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
                    object_get_typename(obj));
-    g_free(name);
 
     g_queue_init(&children);
     object_child_foreach(obj, insert_qom_composition_child, &children);
diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c
index bf62cbec11..5acccfb4e3 100644
--- a/scsi/pr-manager-helper.c
+++ b/scsi/pr-manager-helper.c
@@ -42,11 +42,10 @@ typedef struct PRManagerHelper {
 
 static void pr_manager_send_status_changed_event(PRManagerHelper *pr_mgr)
 {
-    char *id = object_get_canonical_path_component(OBJECT(pr_mgr));
+    const char *id = object_get_canonical_path_component(OBJECT(pr_mgr));
 
     if (id) {
         qapi_event_send_pr_manager_status_changed(id, !!pr_mgr->ioc);
-        g_free(id);
     }
 }
 
diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c
index 0c866e8698..32b9287e68 100644
--- a/scsi/pr-manager.c
+++ b/scsi/pr-manager.c
@@ -128,7 +128,7 @@ static int query_one_pr_manager(Object *object, void *opaque)
 
     elem = g_new0(PRManagerInfoList, 1);
     info = g_new0(PRManagerInfo, 1);
-    info->id = object_get_canonical_path_component(object);
+    info->id = g_strdup(object_get_canonical_path_component(object));
     info->connected = pr_manager_is_connected(pr_mgr);
     elem->value = info;
     elem->next = NULL;
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 9200b20130..af25987518 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1764,7 +1764,7 @@ const char *memory_region_name(const MemoryRegion *mr)
 {
     if (!mr->name) {
         ((MemoryRegion *)mr)->name =
-            object_get_canonical_path_component(OBJECT(mr));
+            g_strdup(object_get_canonical_path_component(OBJECT(mr)));
     }
     return mr->name;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14956.37306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKa-0001KG-R4; Thu, 29 Oct 2020 21:19:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14956.37306; Thu, 29 Oct 2020 21:19:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKa-0001K8-Ng; Thu, 29 Oct 2020 21:19:36 +0000
Received: by outflank-mailman (input) for mailman id 14956;
 Thu, 29 Oct 2020 21:19:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFKa-0001K1-8V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 21de66cd-8934-4032-b962-26a03584c3b4;
 Thu, 29 Oct 2020 21:19:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKZ-0007pm-GY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKZ-0003ZI-FL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFKa-0001K1-8V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:36 +0000
X-Inumbo-ID: 21de66cd-8934-4032-b962-26a03584c3b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 21de66cd-8934-4032-b962-26a03584c3b4;
	Thu, 29 Oct 2020 21:19:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GWycvfg5aOe7eySM/1hutGVdlBGjdArAcb1ZWtLkKf0=; b=hqEBYvLdQs8X7rvqNOJ5WU55zy
	O6C4gih2FRc86GT1o3MRqpHfHvYOQA+0X+96xG7zlg9ou8vWWU2i1Aj3iasy1nkLN0MDvngX3OiQ7
	8X0TfKa/5gdujd5tbtGoTVhFn6rP+n1cqpWMUNfpfaiM5CSnXk+w+nXSYxqINPUbg2DQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKZ-0007pm-GY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKZ-0003ZI-FL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qom: Document object_get_canonical_path() returns malloced string
Message-Id: <E1kYFKZ-0003ZI-FL@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:35 +0000

commit 5bd929d2fff068f829688f27b54f2f159ff06eb6
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:01 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 16:23:43 2020 +0200

    qom: Document object_get_canonical_path() returns malloced string
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-5-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/qom/object.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 55d925d2c8..0f3a60617c 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1467,8 +1467,9 @@ const char *object_get_canonical_path_component(const Object *obj);
 /**
  * object_get_canonical_path:
  *
- * Returns: The canonical path for a object.  This is the path within the
- * composition tree starting from the root.
+ * Returns: The canonical path for a object, newly allocated.  This is
+ * the path within the composition tree starting from the root.  Use
+ * g_free() to free it.
  */
 char *object_get_canonical_path(const Object *obj);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14957.37308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKk-0001Lf-SI; Thu, 29 Oct 2020 21:19:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14957.37308; Thu, 29 Oct 2020 21:19:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKk-0001LX-PE; Thu, 29 Oct 2020 21:19:46 +0000
Received: by outflank-mailman (input) for mailman id 14957;
 Thu, 29 Oct 2020 21:19:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFKk-0001LQ-Fv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id baa52853-e5f6-435f-983f-2904943eee4a;
 Thu, 29 Oct 2020 21:19:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKj-0007pu-K0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKj-0003a7-JC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFKk-0001LQ-Fv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:46 +0000
X-Inumbo-ID: baa52853-e5f6-435f-983f-2904943eee4a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id baa52853-e5f6-435f-983f-2904943eee4a;
	Thu, 29 Oct 2020 21:19:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lwCVJ6iVzsSIJms5/9hL6P1mAY+kqL/eKV7TioZZKCM=; b=dRyC3NJRpJH0ytmjqMhuTyf/bo
	6Dcz6kVuhMqL3VXVOrLSGwsIt2Aa61LMGhATOyI+p1aLZhRX9sj2TtIvLcb5Er+rtcgKhm5jrP+Um
	0YEqZSjIeD+YCAAX213NMuDXHgBeimDlaQ5E2l8axHBWoSSpLBgxypNog36vRjr6Vvo0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKj-0007pu-K0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKj-0003a7-JC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qom: Make info qom-tree sort children more efficiently
Message-Id: <E1kYFKj-0003a7-JC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:45 +0000

commit 0dde9fd12fd39762ff68fca80d2f0a735d66e7bd
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:02 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 17:39:37 2020 +0200

    qom: Make info qom-tree sort children more efficiently
    
    Commit e8c9e65816 "qom: Make "info qom-tree" show children sorted"
    sorts children the simple, stupid, quadratic way.  I thought the
    number of children would be small enough for this not to matter.  I
    was wrong: there are outliers with several hundred children, e.g ARM
    machines nuri and smdkc210 each have a node with 513 children.
    
    While n^2 sorting isn't noticeable in normal, human usage even for
    n=513, it can be quite noticeable in certain automated tests.  In
    particular, the sort made device-introspect-test even slower.  Commit
    3e7b80f84d "tests: improve performance of device-introspect-test" just
    fixed that by cutting back its excessive use of "info qom-tree".
    Sorting more efficiently makes sense regardless, so do it.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-6-armbru@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 qom/qom-hmp-cmds.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index 4032c96089..8861a109d5 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -94,25 +94,23 @@ typedef struct QOMCompositionState {
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
-static int qom_composition_compare(const void *a, const void *b, void *ignore)
+static int qom_composition_compare(const void *a, const void *b)
 {
-    return g_strcmp0(object_get_canonical_path_component(a),
-                     object_get_canonical_path_component(b));
+    return g_strcmp0(object_get_canonical_path_component(*(Object **)a),
+                     object_get_canonical_path_component(*(Object **)b));
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
 {
-    GQueue *children = opaque;
-
-    g_queue_insert_sorted(children, obj, qom_composition_compare, NULL);
+    g_array_append_val(opaque, obj);
     return 0;
 }
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent)
 {
+    GArray *children = g_array_new(false, false, sizeof(Object *));
     const char *name;
-    GQueue children;
-    Object *child;
+    int i;
 
     if (obj == object_get_root()) {
         name = "";
@@ -122,11 +120,14 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent)
     monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
                    object_get_typename(obj));
 
-    g_queue_init(&children);
-    object_child_foreach(obj, insert_qom_composition_child, &children);
-    while ((child = g_queue_pop_head(&children))) {
-        print_qom_composition(mon, child, indent + 2);
+    object_child_foreach(obj, insert_qom_composition_child, children);
+    g_array_sort(children, qom_composition_compare);
+
+    for (i = 0; i < children->len; i++) {
+        print_qom_composition(mon, g_array_index(children, Object *, i),
+                              indent + 2);
     }
+    g_array_free(children, TRUE);
 }
 
 void hmp_info_qom_tree(Monitor *mon, const QDict *dict)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:19:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:19:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14958.37313 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKv-0001N5-VD; Thu, 29 Oct 2020 21:19:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14958.37313; Thu, 29 Oct 2020 21:19:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFKv-0001Mx-SD; Thu, 29 Oct 2020 21:19:57 +0000
Received: by outflank-mailman (input) for mailman id 14958;
 Thu, 29 Oct 2020 21:19:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFKu-0001Mr-Ic
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bf35d054-15ba-4050-8e51-19fcd2a6986c;
 Thu, 29 Oct 2020 21:19:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKt-0007q0-OV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFKt-0003au-NX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFKu-0001Mr-Ic
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:56 +0000
X-Inumbo-ID: bf35d054-15ba-4050-8e51-19fcd2a6986c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bf35d054-15ba-4050-8e51-19fcd2a6986c;
	Thu, 29 Oct 2020 21:19:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SERj2svevuyLpGDofBAAz91wzMWG9FH3J3Yt5Ky3yZQ=; b=qN5wI9bJMYsOnSvIax6C+5zvDj
	vhkBCVscLdEEzaAQPgQvN0sd4UjvFlPbRbug82ECT3MwGqUY6xRAB0mhV+/LVb7d9BNXtCLkY3DYd
	w+6pYIdeFYwjDD2MZEODAGE1qiItfYXeliwTiOlTyFRX54BnD8AfeQwS0zVGppPumAmI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKt-0007q0-OV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFKt-0003au-NX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:19:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-07-21' into staging
Message-Id: <E1kYFKt-0003au-NX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:19:55 +0000

commit b50dab9ecac442acc1b316e4749dae36a2fe7d61
Merge: a418695e1b177da055d477c4e15ce900c01a94fd 0dde9fd12fd39762ff68fca80d2f0a735d66e7bd
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 18:31:52 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 18:31:52 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-07-21' into staging
    
    QOM patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 16:40:27 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qom-2020-07-21:
      qom: Make info qom-tree sort children more efficiently
      qom: Document object_get_canonical_path() returns malloced string
      qom: Change object_get_canonical_path_component() not to malloc
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 backends/hostmem.c         |  2 +-
 block/throttle-groups.c    |  2 +-
 gdbstub.c                  |  2 +-
 hw/arm/xlnx-zynqmp.c       |  6 ++----
 hw/block/nvme.c            |  5 ++---
 hw/core/machine-qmp-cmds.c |  2 +-
 hw/core/machine.c          |  5 ++---
 hw/mem/nvdimm.c            |  5 ++---
 hw/mem/pc-dimm.c           |  5 ++---
 hw/misc/ivshmem.c          |  5 ++---
 hw/ppc/spapr_drc.c         |  3 +--
 hw/ppc/trace-events        |  2 +-
 hw/virtio/virtio-crypto.c  |  5 ++---
 hw/virtio/virtio-mem.c     |  6 ++----
 hw/virtio/virtio-pmem.c    |  5 ++---
 include/qom/object.h       |  7 ++++---
 iothread.c                 |  9 ++++-----
 net/net.c                  |  6 ++----
 qom/object.c               |  7 +++----
 qom/qom-hmp-cmds.c         | 32 +++++++++++++++-----------------
 scsi/pr-manager-helper.c   |  3 +--
 scsi/pr-manager.c          |  2 +-
 softmmu/memory.c           |  2 +-
 23 files changed, 55 insertions(+), 73 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14959.37317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFL6-00020A-1A; Thu, 29 Oct 2020 21:20:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14959.37317; Thu, 29 Oct 2020 21:20:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFL5-000203-Tj; Thu, 29 Oct 2020 21:20:07 +0000
Received: by outflank-mailman (input) for mailman id 14959;
 Thu, 29 Oct 2020 21:20:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFL5-0001wO-60
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f2ce292d-31d3-4652-bc80-413d5dc4ff8c;
 Thu, 29 Oct 2020 21:20:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFL4-0007ql-7P
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFL4-0003cV-4n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFL5-0001wO-60
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:07 +0000
X-Inumbo-ID: f2ce292d-31d3-4652-bc80-413d5dc4ff8c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f2ce292d-31d3-4652-bc80-413d5dc4ff8c;
	Thu, 29 Oct 2020 21:20:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lzbmZtw7vXJm/vJG1TO/PgCdkMK86OUK0pED1dL3e1w=; b=eSR2AVGUTwQDcuturqf757KodZ
	BSV8R/gqEXJmpg+tClZnsp/KyUe0hb/o6KGRj7WrZBqW6ezkpqI9qUtcBi8vD3lwKwwvhzsix3PGK
	GFD3Ev68in/8jjLO05PxSb1X7aVaeMax7IJ0LwD35G2kt0EBu7Jr8cIU8QfS/frTT/bM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFL4-0007ql-7P
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFL4-0003cV-4n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] file-posix: Handle `EINVAL` fallocate return value
Message-Id: <E1kYFL4-0003cV-4n@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:06 +0000

commit bae127d4dcf6158c5042e2eee9582430839a9967
Author:     Antoine Damhet <antoine.damhet@blade-group.com>
AuthorDate: Fri Jul 17 15:56:04 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 16:28:57 2020 +0200

    file-posix: Handle `EINVAL` fallocate return value
    
    The `detect-zeroes=unmap` option may issue unaligned
    `FALLOC_FL_PUNCH_HOLE` requests, raw block devices can (and will) return
    `EINVAL`, qemu should then write the zeroes to the blockdev instead of
    issuing an `IO_ERROR`.
    
    The problem can be reprodced like this:
    
    $ qemu-io -c 'write -P 0 42 1234' --image-opts driver=host_device,filename=/dev/loop0,detect-zeroes=unmap
    write failed: Invalid argument
    
    Signed-off-by: Antoine Damhet <antoine.damhet@blade-group.com>
    Message-Id: <20200717135603.51180-1-antoine.damhet@blade-group.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 8cc39a1ef6..9a00d4190a 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1698,7 +1698,11 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
 #ifdef CONFIG_FALLOCATE_PUNCH_HOLE
     int ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
                            aiocb->aio_offset, aiocb->aio_nbytes);
-    if (ret != -ENOTSUP) {
+    switch (ret) {
+    case -ENOTSUP:
+    case -EINVAL:
+        break;
+    default:
         return ret;
     }
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14960.37321 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLG-00025J-2F; Thu, 29 Oct 2020 21:20:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14960.37321; Thu, 29 Oct 2020 21:20:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLF-00025B-VK; Thu, 29 Oct 2020 21:20:17 +0000
Received: by outflank-mailman (input) for mailman id 14960;
 Thu, 29 Oct 2020 21:20:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFLF-000252-9R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 382592b8-2c02-460a-96e1-f392c5b5733e;
 Thu, 29 Oct 2020 21:20:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLE-0007qs-BH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLE-0003dp-AX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFLF-000252-9R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:17 +0000
X-Inumbo-ID: 382592b8-2c02-460a-96e1-f392c5b5733e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 382592b8-2c02-460a-96e1-f392c5b5733e;
	Thu, 29 Oct 2020 21:20:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7sc13rF6XSJzvAFXpOyIsMNy01tcM0TYJatBrfJlUOc=; b=Da5RblLldZuTEdxdXkCuuUsuSK
	Yi+d1swiMtLI0UlFIUJsbdvsRyWahmk4cfNLMZNcHGar0XWa3eYu1xKUKbMIAx/uEuEusQdA70TK1
	ufxy91+35st/vvuMqtZvnKShi4gVDFUoprkdiUzCneBlJHECE2zaJLA86rDBDzbUDSuA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLE-0007qs-BH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLE-0003dp-AX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow2: Implement v2 zero writes with discard if possible
Message-Id: <E1kYFLE-0003dp-AX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:16 +0000

commit 61b3043965fe3552ee2684a97e7cc809ca7a71b3
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 21 15:55:19 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 16:28:57 2020 +0200

    qcow2: Implement v2 zero writes with discard if possible
    
    qcow2 version 2 images don't support the zero flag for clusters, so for
    write_zeroes requests, we return -ENOTSUP and get explicit zero buffer
    writes. If the image doesn't have a backing file, we can do better: Just
    discard the respective clusters.
    
    This is relevant for 'qemu-img convert -O qcow2 -n', where qemu-img has
    to assume that the existing target image may contain any data, so it has
    to write zeroes. Without this patch, this results in a fully allocated
    target image, even if the source image was empty.
    
    Reported-by: Nir Soffer <nsoffer@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200721135520.72355-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2-cluster.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4b5fc8c4a7..a677ba9f5c 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1797,8 +1797,15 @@ int qcow2_cluster_zeroize(BlockDriverState *bs, uint64_t offset,
     assert(QEMU_IS_ALIGNED(end_offset, s->cluster_size) ||
            end_offset >= bs->total_sectors << BDRV_SECTOR_BITS);
 
-    /* The zero flag is only supported by version 3 and newer */
+    /*
+     * The zero flag is only supported by version 3 and newer. However, if we
+     * have no backing file, we can resort to discard in version 2.
+     */
     if (s->qcow_version < 3) {
+        if (!bs->backing) {
+            return qcow2_cluster_discard(bs, offset, bytes,
+                                         QCOW2_DISCARD_REQUEST, false);
+        }
         return -ENOTSUP;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14961.37325 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLQ-00026d-3T; Thu, 29 Oct 2020 21:20:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14961.37325; Thu, 29 Oct 2020 21:20:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLQ-00026V-0V; Thu, 29 Oct 2020 21:20:28 +0000
Received: by outflank-mailman (input) for mailman id 14961;
 Thu, 29 Oct 2020 21:20:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFLP-00026O-E8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 82ae3f80-e997-4976-b25c-f8acdb293ee6;
 Thu, 29 Oct 2020 21:20:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLO-0007rB-FE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLO-0003eZ-ES
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFLP-00026O-E8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:27 +0000
X-Inumbo-ID: 82ae3f80-e997-4976-b25c-f8acdb293ee6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 82ae3f80-e997-4976-b25c-f8acdb293ee6;
	Thu, 29 Oct 2020 21:20:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YL2xkLdtxsn0xdm8Mrp1XKtqLPaQOTA9pKq5KJRuBX0=; b=y0ewyx7PZy+/1maaI/tozhRDaH
	ohTBMW3fdi1BPXbcxy++W1GxaG+/0LTeiZnWXuPCFNx30E7otpn2ORGlRG9J8q4xq+ior/e+wR06O
	kdxOM1rcFoAU6dRoYIpp6tc9uhuDzcBw7g5zlY5dIjOHaEohChswn4GtKVBVnvEBykng=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLO-0007rB-FE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLO-0003eZ-ES
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Test sparseness for qemu-img convert -n
Message-Id: <E1kYFLO-0003eZ-ES@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:26 +0000

commit 4a01e27ddcb5921efd68820d05d85ba71293fea6
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 21 15:55:20 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 17:44:35 2020 +0200

    iotests: Test sparseness for qemu-img convert -n
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200721135520.72355-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/122     | 30 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/122.out | 17 +++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index dfd1cd05d6..0f3d4ca851 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -281,6 +281,36 @@ $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG".orig
 
 $QEMU_IMG compare "$TEST_IMG" "$TEST_IMG".orig
 
+echo
+echo '=== -n to an empty image ==='
+echo
+
+TEST_IMG="$TEST_IMG".orig _make_test_img 64M
+
+# Convert with -n, which should not result in a fully allocated image, not even
+# with compat=0.10 (because the target doesn't have a backing file)
+for compat in "1.1" "0.10"; do
+    IMGOPTS="compat=$compat" _make_test_img 64M
+    $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG".orig "$TEST_IMG"
+    $QEMU_IMG map --output=json "$TEST_IMG"
+done
+
+echo
+echo '=== -n to an empty image with a backing file ==='
+echo
+
+TEST_IMG="$TEST_IMG".orig _make_test_img 64M
+TEST_IMG="$TEST_IMG".base _make_test_img 64M
+
+# Convert with -n, which should still not result in a fully allocated image for
+# compat=1.1 (because it can use zero clusters), but it should be fully
+# allocated with compat=0.10
+for compat in "1.1" "0.10"; do
+    IMGOPTS="compat=$compat" _make_test_img -b "$TEST_IMG".base -F $IMGFMT 64M
+    $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG".orig "$TEST_IMG"
+    $QEMU_IMG map --output=json "$TEST_IMG"
+done
+
 echo
 echo '=== -n -B to an image without a backing file ==='
 echo
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index f1f195ed77..3a3e121d57 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -229,6 +229,23 @@ wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Images are identical.
 
+=== -n to an empty image ===
+
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+
+=== -n to an empty image with a backing file ===
+
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": false, "data": true, "offset": 327680}]
+
 === -n -B to an image without a backing file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14962.37329 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLa-00027s-55; Thu, 29 Oct 2020 21:20:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14962.37329; Thu, 29 Oct 2020 21:20:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLa-00027k-20; Thu, 29 Oct 2020 21:20:38 +0000
Received: by outflank-mailman (input) for mailman id 14962;
 Thu, 29 Oct 2020 21:20:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFLZ-00027b-Bj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 81e19343-dccb-45b0-bd5f-16c38bd1818f;
 Thu, 29 Oct 2020 21:20:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLY-0007rJ-JA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLY-0003fZ-IL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFLZ-00027b-Bj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:37 +0000
X-Inumbo-ID: 81e19343-dccb-45b0-bd5f-16c38bd1818f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 81e19343-dccb-45b0-bd5f-16c38bd1818f;
	Thu, 29 Oct 2020 21:20:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oDRZH6+tCCh0cSDTm95jV1Rf2P4bJDvks884wr4qAJ0=; b=iBn4Xhl3qrURLBhN1hapnPtjuZ
	nEoiIsbsOwt8s5AvIJA7YZWCuEnRYvKZA8GYwVEc6zplKl/U3apcMfhOEShaDRQLgirZ1qLD3C+LD
	C5K5IbJKRuu5IhqEpBoanjK9RFmlU6gSohnSnJZ82n4uR2gFNvWHySW8LOfY/9zwQM3I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLY-0007rJ-JA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLY-0003fZ-IL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYFLY-0003fZ-IL@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:36 +0000

commit 0c1fd2f41f2f63cf3305d6d29d1acd0d960dbd36
Merge: b50dab9ecac442acc1b316e4749dae36a2fe7d61 4a01e27ddcb5921efd68820d05d85ba71293fea6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 19:25:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 19:25:48 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Handle `EINVAL` fallocate return value
    - qemu-img convert -n: Keep qcow2 v2 target sparse
    
    # gpg: Signature made Tue 21 Jul 2020 16:45:28 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      iotests: Test sparseness for qemu-img convert -n
      qcow2: Implement v2 zero writes with discard if possible
      file-posix: Handle `EINVAL` fallocate return value
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/file-posix.c         |  6 +++++-
 block/qcow2-cluster.c      |  9 ++++++++-
 tests/qemu-iotests/122     | 30 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/122.out | 17 +++++++++++++++++
 4 files changed, 60 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14963.37333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLk-000296-6t; Thu, 29 Oct 2020 21:20:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14963.37333; Thu, 29 Oct 2020 21:20:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLk-00028y-3d; Thu, 29 Oct 2020 21:20:48 +0000
Received: by outflank-mailman (input) for mailman id 14963;
 Thu, 29 Oct 2020 21:20:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFLj-00028r-I7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id eefdcd8f-8406-4e2c-887e-30bc37acb359;
 Thu, 29 Oct 2020 21:20:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLi-0007rR-Ml
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLi-0003gR-Lu
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFLj-00028r-I7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:47 +0000
X-Inumbo-ID: eefdcd8f-8406-4e2c-887e-30bc37acb359
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id eefdcd8f-8406-4e2c-887e-30bc37acb359;
	Thu, 29 Oct 2020 21:20:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mUEI7z9zYZobq2TEMPLrHZBxrdcW20c+dvR2i3VheOE=; b=flx0YIuEqspp847RM6bdTRg3hO
	L0rLV6knHFdEzD2pGmZekZMz8Hg7sfiX2A7QOPHKocooR+0ApFuBlyTibZB5djbKj5rBccRcNl+/J
	Xf8KIJVuA5mfQVr1Ai7DGrG7nw0XQWKVFp6/YDwxPR3vP0eEEKfOiEGCbwkjsBC2IBBg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLi-0007rR-Ml
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLi-0003gR-Lu
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update version for v5.1.0-rc1 release
Message-Id: <E1kYFLi-0003gR-Lu@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:46 +0000

commit c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 20:28:59 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 20:28:59 2020 +0100

    Update version for v5.1.0-rc1 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index e427b98203..023d5c9cfb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.90
+5.0.91
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:20:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:20:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14964.37337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLv-0002AR-87; Thu, 29 Oct 2020 21:20:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14964.37337; Thu, 29 Oct 2020 21:20:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFLv-0002AJ-58; Thu, 29 Oct 2020 21:20:59 +0000
Received: by outflank-mailman (input) for mailman id 14964;
 Thu, 29 Oct 2020 21:20:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFLt-0002A8-PX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d39d2f39-7077-453d-986a-7dfef3b0185d;
 Thu, 29 Oct 2020 21:20:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLt-0007rZ-1D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFLt-0003hl-0V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFLt-0002A8-PX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
X-Inumbo-ID: d39d2f39-7077-453d-986a-7dfef3b0185d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d39d2f39-7077-453d-986a-7dfef3b0185d;
	Thu, 29 Oct 2020 21:20:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N9+wBazdJ41erRr1m/Olf2oKFa8L8MQYWwVm09Ta8PU=; b=e4JuY32GLlm4dJyZ0metr5Zy57
	OflsCgWqe0FBIf3uyFIW+gVH7iT4de/ethIwUldZ794ZlRNqwkVOhC6Yog4gGVWlVRNBnodIYJpri
	b0/Ta9/e+jKsqageiD1aCjaYq8jLsKC6sr2St52swWKhk0OeP0sr082tRnX/dqLX8/EA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLt-0007rZ-1D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFLt-0003hl-0V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:20:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qdev: Fix device_add DRIVER,help to print to monitor
Message-Id: <E1kYFLt-0003hl-0V@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:20:57 +0000

commit 029afc4e76041e1a320530d97f99122a1b3d5da2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:58 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 17:22:44 2020 +0200

    qdev: Fix device_add DRIVER,help to print to monitor
    
    Help on device properties gets printed to stdout instead of the
    monitor.  If you have the monitor anywhere else, no help for you.
    Broken when commit e1043d674d "qdev: use object_property_help()"
    accidentally switched from qemu_printf() to printf().  Switch right
    back.
    
    Fixes: e1043d674d792ff64aebae1a3eafc08b38a8a085
    Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-2-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 71ebce19df..e9b7228480 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -300,7 +300,7 @@ int qdev_device_help(QemuOpts *opts)
     }
     g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0);
     for (i = 0; i < array->len; i++) {
-        printf("%s\n", (char *)array->pdata[i]);
+        qemu_printf("%s\n", (char *)array->pdata[i]);
     }
     g_ptr_array_set_free_func(array, g_free);
     g_ptr_array_free(array, true);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:21:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:21:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14965.37340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFM5-0002C5-9M; Thu, 29 Oct 2020 21:21:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14965.37340; Thu, 29 Oct 2020 21:21:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFM5-0002Bu-6K; Thu, 29 Oct 2020 21:21:09 +0000
Received: by outflank-mailman (input) for mailman id 14965;
 Thu, 29 Oct 2020 21:21:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFM4-0002Bl-0x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d67ebff1-700b-4d05-b880-539bdfb2942b;
 Thu, 29 Oct 2020 21:21:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFM3-0007sW-5C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFM3-0003ij-4L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFM4-0002Bl-0x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:08 +0000
X-Inumbo-ID: d67ebff1-700b-4d05-b880-539bdfb2942b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d67ebff1-700b-4d05-b880-539bdfb2942b;
	Thu, 29 Oct 2020 21:21:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NE8rV+QDucyFpefuGnJGFCbulGrQOdbFCt2mxCYEbbs=; b=lBPB7e8Nnd6ZqgDSo2BnPw6Lk+
	uRpmtcbQ07hE6MC8P+VKgwmbU/6sRtVpYFUxL0K8Kw1HqUlNRt2wzI+h8duVCOZWPxkoFy5SLmg+s
	VmBZwEbCCiPI+7+QaLqJFdT4HmCXOHf6VyHSUneUqFNvRO/oAgOQM/Pp4bpOhxzYZKcM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFM3-0007sW-5C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFM3-0003ij-4L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-07-21' into staging
Message-Id: <E1kYFM3-0003ij-4L@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:07 +0000

commit 3cbc8970f55c87cb58699b6dc8fe42998bc79dc0
Merge: c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00 029afc4e76041e1a320530d97f99122a1b3d5da2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 22 09:13:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 22 09:13:46 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-07-21' into staging
    
    Monitor patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 16:23:27 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-monitor-2020-07-21:
      qdev: Fix device_add DRIVER,help to print to monitor
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:21:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:21:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14968.37347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMF-0002Dz-EO; Thu, 29 Oct 2020 21:21:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14968.37347; Thu, 29 Oct 2020 21:21:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMF-0002Dl-A0; Thu, 29 Oct 2020 21:21:19 +0000
Received: by outflank-mailman (input) for mailman id 14968;
 Thu, 29 Oct 2020 21:21:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFME-0002DT-9O
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ca18145e-ac9c-4d16-9335-d48df88bab8e;
 Thu, 29 Oct 2020 21:21:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMD-0007sg-HT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMD-0003jx-GJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFME-0002DT-9O
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:18 +0000
X-Inumbo-ID: ca18145e-ac9c-4d16-9335-d48df88bab8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ca18145e-ac9c-4d16-9335-d48df88bab8e;
	Thu, 29 Oct 2020 21:21:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rc+u62jIdXz9lLdPijoN4zwwsyL1ZAMA1pyGZ4i+B/g=; b=ooa/v9hHBDenK78Ng983fWvG/r
	Uj8LMSLVSkgT4UlcyzZZD8mzjsmfdQZPfEYHFwWudbo/tvn+06HVKsoN15nKBjzvBNvvQXi50shvQ
	86tvWZ/AIq2VfyIGByWLwsA7SQF9r5aYjZkhebSOegs81AfYakt/BR+V+Oe54PwT/uiQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMD-0007sg-HT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMD-0003jx-GJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
Message-Id: <E1kYFMD-0003jx-GJ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:17 +0000

commit a3ad58342a9d88d1baafc0aee39302f79faad480
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Jul 21 15:05:51 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 21 16:47:31 2020 +0200

    hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
    
    Document FWCfgDataGeneratorClass::get_data() return NULL
    on error, and non-NULL on success. This allow us to simplify
    fw_cfg_add_from_generator(). Since we don't need a local
    variable to propagate the error, we can remove the ERRP_GUARD()
    macro.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200721131911.27380-2-philmd@redhat.com>
---
 hw/nvram/fw_cfg.c         | 3 +--
 include/hw/nvram/fw_cfg.h | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 3b1811d3bf..dfa1f2012a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1035,7 +1035,6 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
 void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp)
 {
-    ERRP_GUARD();
     FWCfgDataGeneratorClass *klass;
     GByteArray *array;
     Object *obj;
@@ -1053,7 +1052,7 @@ void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
     }
     klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
     array = klass->get_data(obj, errp);
-    if (*errp) {
+    if (!array) {
         return;
     }
     size = array->len;
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 11feae3177..bbcf405649 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -32,7 +32,9 @@ typedef struct FWCfgDataGeneratorClass {
      * @obj: the object implementing this interface
      * @errp: pointer to a NULL-initialized error object
      *
-     * Returns: reference to a byte array containing the data.
+     * Returns: reference to a byte array containing the data on success,
+     *          or NULL on error.
+     *
      * The caller should release the reference when no longer
      * required.
      */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:21:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:21:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14969.37352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMP-0002FN-FF; Thu, 29 Oct 2020 21:21:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14969.37352; Thu, 29 Oct 2020 21:21:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMP-0002FF-Br; Thu, 29 Oct 2020 21:21:29 +0000
Received: by outflank-mailman (input) for mailman id 14969;
 Thu, 29 Oct 2020 21:21:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFMO-0002F6-LE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3e433fbb-fa64-4e06-998b-d1d915819509;
 Thu, 29 Oct 2020 21:21:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMN-0007sv-LM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMN-0003kV-KW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFMO-0002F6-LE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:28 +0000
X-Inumbo-ID: 3e433fbb-fa64-4e06-998b-d1d915819509
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3e433fbb-fa64-4e06-998b-d1d915819509;
	Thu, 29 Oct 2020 21:21:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ybpai3IoqVTaxlGxJiXVKeNE1rqpe2ndlQoIJTYUpwY=; b=Dq+L7R+DKEw0IxFUIII1P+0TFO
	CuMECwA29X3hkbq8S9Q4VwLvI7dAmlbrGIKgxcg/uFf4uyX2T1Guh0PNSf8Tuno/ErbSYESDljMXc
	h/AyyLxwQrk9c5KGijJ9LQ12tewEEY8SIvqvheeYYbJIT9hof61/L64Rvm30Kj1gQNHg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMN-0007sv-LM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMN-0003kV-KW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
Message-Id: <E1kYFMN-0003kV-KW@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:27 +0000

commit 077195187b47d83418e5fb521c89d7881fab3049
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Mon Jul 20 14:20:15 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 21 16:47:54 2020 +0200

    hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
    
    Commits b6d7e9b66f..a43770df5d simplified the error propagation.
    Similarly to commit 6fd5bef10b "qom: Make functions taking Error**
    return bool, not void", let fw_cfg_add_from_generator() return a
    boolean value, not void.
    This allow to simplify parse_fw_cfg() and fixes the error handling
    issue reported by Coverity (CID 1430396):
    
      In parse_fw_cfg():
    
        Variable assigned once to a constant guards dead code.
    
        Local variable local_err is assigned only once, to a constant
        value, making it effectively constant throughout its scope.
        If this is not the intent, examine the logic to see if there
        is a missing assignment that would make local_err not remain
        constant.
    
    It's the call of fw_cfg_add_from_generator():
    
            Error *local_err = NULL;
    
            fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
            if (local_err) {
                error_propagate(errp, local_err);
                return -1;
            }
            return 0;
    
    If it fails, parse_fw_cfg() sets an error and returns 0, which is
    wrong. Harmless, because the only caller passes &error_fatal.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Fixes: Coverity CID 1430396: 'Constant' variable guards dead code (DEADCODE)
    Fixes: 6552d87c48 ("softmmu/vl: Let -fw_cfg option take a 'gen_id' argument")
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200721131911.27380-3-philmd@redhat.com>
---
 hw/nvram/fw_cfg.c         | 10 ++++++----
 include/hw/nvram/fw_cfg.h |  4 +++-
 softmmu/vl.c              |  6 +-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index dfa1f2012a..f3a4728288 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1032,7 +1032,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
     return NULL;
 }
 
-void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp)
 {
     FWCfgDataGeneratorClass *klass;
@@ -1043,20 +1043,22 @@ void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
     obj = object_resolve_path_component(object_get_objects_root(), gen_id);
     if (!obj) {
         error_setg(errp, "Cannot find object ID '%s'", gen_id);
-        return;
+        return false;
     }
     if (!object_dynamic_cast(obj, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)) {
         error_setg(errp, "Object ID '%s' is not a '%s' subclass",
                    gen_id, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE);
-        return;
+        return false;
     }
     klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
     array = klass->get_data(obj, errp);
     if (!array) {
-        return;
+        return false;
     }
     size = array->len;
     fw_cfg_add_file(s, filename, g_byte_array_free(array, TRUE), size);
+
+    return true;
 }
 
 static void fw_cfg_machine_reset(void *opaque)
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index bbcf405649..f190c428e8 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -304,8 +304,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
  * will be used; also, a new entry will be added to the file directory
  * structure residing at key value FW_CFG_FILE_DIR, containing the item name,
  * data size, and assigned selector key value.
+ *
+ * Returns: %true on success, %false on error.
  */
-void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp);
 
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
diff --git a/softmmu/vl.c b/softmmu/vl.c
index f476ef89ed..3416241557 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2070,11 +2070,7 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
         size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
         buf = g_memdup(str, size);
     } else if (nonempty_str(gen_id)) {
-        Error *local_err = NULL;
-
-        fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) {
             return -1;
         }
         return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:21:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:21:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14970.37356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMa-0002Gi-GZ; Thu, 29 Oct 2020 21:21:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14970.37356; Thu, 29 Oct 2020 21:21:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMa-0002Gb-DR; Thu, 29 Oct 2020 21:21:40 +0000
Received: by outflank-mailman (input) for mailman id 14970;
 Thu, 29 Oct 2020 21:21:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFMY-0002GQ-SA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 64d0f2ee-e168-4d62-a28b-b6298200b3a5;
 Thu, 29 Oct 2020 21:21:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMX-0007t6-PG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMX-0003l9-OA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFMY-0002GQ-SA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:38 +0000
X-Inumbo-ID: 64d0f2ee-e168-4d62-a28b-b6298200b3a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 64d0f2ee-e168-4d62-a28b-b6298200b3a5;
	Thu, 29 Oct 2020 21:21:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QT3QxOb8xw6u4+BE0S2OtZeisXpR2b5SydMNq5Kyzy0=; b=KHvPYUQLTWyOiMmlwqNAmtlfyS
	fYepuG+tIqP4oJKhSdoOb4Eazb3JCXg+ZcpRepMyGZdiB9sSd1Mcq0ykff1If37hKWDsCsBTEgwKz
	65AxFCVI4sqaYdBhfkStutriob/hBL7TkfMVXbY6fVJiLkzL/0uBOe7byk6q3oo58F2E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMX-0007t6-PG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMX-0003l9-OA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200721' into staging
Message-Id: <E1kYFMX-0003l9-OA@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:37 +0000

commit d0cc248164961a7ba9d43806feffd76f9f6d7f41
Merge: 3cbc8970f55c87cb58699b6dc8fe42998bc79dc0 077195187b47d83418e5fb521c89d7881fab3049
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 22 12:42:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 22 12:42:25 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200721' into staging
    
    fw_cfg patches
    
    Fixes the DEADCODE issue reported by Coverity (CID 1430396).
    
    CI jobs result:
    . https://gitlab.com/philmd/qemu/-/pipelines/169086301
    
    # gpg: Signature made Tue 21 Jul 2020 18:52:46 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/fw_cfg-20200721:
      hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
      hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/nvram/fw_cfg.c         | 13 +++++++------
 include/hw/nvram/fw_cfg.h |  8 ++++++--
 softmmu/vl.c              |  6 +-----
 3 files changed, 14 insertions(+), 13 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:21:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14971.37360 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMk-0002Hz-I6; Thu, 29 Oct 2020 21:21:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14971.37360; Thu, 29 Oct 2020 21:21:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMk-0002Hr-F2; Thu, 29 Oct 2020 21:21:50 +0000
Received: by outflank-mailman (input) for mailman id 14971;
 Thu, 29 Oct 2020 21:21:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFMj-0002Hg-4N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ab65c2a7-a3ea-4116-850c-f459a6c976ca;
 Thu, 29 Oct 2020 21:21:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMi-0007tE-6K
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMi-0003mX-52
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFMj-0002Hg-4N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:49 +0000
X-Inumbo-ID: ab65c2a7-a3ea-4116-850c-f459a6c976ca
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ab65c2a7-a3ea-4116-850c-f459a6c976ca;
	Thu, 29 Oct 2020 21:21:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VcGBdhaVltQomZtXnKoWAgYmwCm8weXJPw3goXU/vmc=; b=UlOLC+wQ22YcYTnW7+GYBBhBRV
	66AzIXbMvycYFAalhBitIYhASdQppUaoh1aA3Ll39VvGKeqy1A8xtw78txEJtHwD5AXkoCQF99uSg
	Vb4r9t9jPHQ6lFSZdchAebknkB0wu3PA8TLtL6r0d5aaJFo22b1KTyQ9Iaj5XmYNI1Ic=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMi-0007tE-6K
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMi-0003mX-52
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu/osdep: Document os_find_datadir() return value
Message-Id: <E1kYFMi-0003mX-52@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:48 +0000

commit 7da1d7dcc0c08519b92d8af579fec2e2ea9e60b1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:10:44 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu/osdep: Document os_find_datadir() return value
    
    Document os_find_datadir() returned data must be freed.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-2-f4bug@amsat.org>
---
 os-posix.c | 3 +++
 os-win32.c | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/os-posix.c b/os-posix.c
index b674b20b1b..3572db3f44 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -84,6 +84,9 @@ void os_setup_signal_handling(void)
  * Find a likely location for support files using the location of the binary.
  * When running from the build tree this will be "$bindir/../pc-bios".
  * Otherwise, this is CONFIG_QEMU_DATADIR.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
  */
 char *os_find_datadir(void)
 {
diff --git a/os-win32.c b/os-win32.c
index 6b86e022f0..c9c3afe648 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -57,7 +57,12 @@ void os_setup_early_signal_handling(void)
     atexit(os_undo_timer_resolution);
 }
 
-/* Look for support files in the same directory as the executable.  */
+/*
+ * Look for support files in the same directory as the executable.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
+ */
 char *os_find_datadir(void)
 {
     return qemu_get_exec_dir();
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14972.37364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMu-0002Jh-Jj; Thu, 29 Oct 2020 21:22:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14972.37364; Thu, 29 Oct 2020 21:22:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFMu-0002JZ-Gc; Thu, 29 Oct 2020 21:22:00 +0000
Received: by outflank-mailman (input) for mailman id 14972;
 Thu, 29 Oct 2020 21:21:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFMt-0002J0-2f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 88183302-899b-4592-b94b-13b4c986ec6f;
 Thu, 29 Oct 2020 21:21:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMs-0007tM-9t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFMs-0003nS-9D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFMt-0002J0-2f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:59 +0000
X-Inumbo-ID: 88183302-899b-4592-b94b-13b4c986ec6f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 88183302-899b-4592-b94b-13b4c986ec6f;
	Thu, 29 Oct 2020 21:21:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DM+gk3lm3enzdaL4uNq7Px3qhpcrHToT2tuLo1UKJyE=; b=Z0uYDCEsVZlJYarkX5bieJ3c/M
	Swh4L97O6HBEode7++e6g+ST3JQZehChWlvGWa6x0k5w2zANf45pl94cnd6MbYm5rL5sI9pfeywBj
	c2RRsNHRtG396tPx3XtkWzoZh9O9cAXPW6Q6eh5n/OTPbB6kBQu7FuGL3kGB6JCyucWQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMs-0007tM-9t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFMs-0003nS-9D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:21:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu/osdep: Reword qemu_get_exec_dir() documentation
Message-Id: <E1kYFMs-0003nS-9D@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:21:58 +0000

commit d450cccc9a4f4409434f4bd0a80270836f6bc3c3
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:14:33 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu/osdep: Reword qemu_get_exec_dir() documentation
    
    This comment is confuse, reword it a bit.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-3-f4bug@amsat.org>
---
 include/qemu/osdep.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 4841b5c6b5..45c217aa28 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -588,7 +588,10 @@ char *qemu_get_local_state_pathname(const char *relative_pathname);
 void qemu_init_exec_dir(const char *argv0);
 
 /* Get the saved exec dir.
- * Caller needs to release the returned string by g_free() */
+ *
+ * The caller is responsible for releasing the value returned with g_free()
+ * after use.
+ */
 char *qemu_get_exec_dir(void);
 
 /**
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14973.37368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFN4-0002La-L6; Thu, 29 Oct 2020 21:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14973.37368; Thu, 29 Oct 2020 21:22:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFN4-0002LS-IH; Thu, 29 Oct 2020 21:22:10 +0000
Received: by outflank-mailman (input) for mailman id 14973;
 Thu, 29 Oct 2020 21:22:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFN3-0002LH-7e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 41563108-d57c-493d-adc3-dc79dfa6aa56;
 Thu, 29 Oct 2020 21:22:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFN2-0007uD-EF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFN2-0003og-Cr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFN3-0002LH-7e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:09 +0000
X-Inumbo-ID: 41563108-d57c-493d-adc3-dc79dfa6aa56
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 41563108-d57c-493d-adc3-dc79dfa6aa56;
	Thu, 29 Oct 2020 21:22:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zDeq6Y7LdSIlTiQWvt+yDrcErDASAWg46xyBQdAGRWI=; b=pBfbEMgpyRpI0HVX40e/lcWzhU
	S54dwN3HM5IUEyvJ8UzJRWVJcoNTL5DaV/7tPNXknIGyzuZoZ4/+npTjMWsQmnGl+YBsKIBhf9SGm
	/V6y+NFJq9oXNUf9UpJF1neRE9GuWeHd0QwJeHNnE9M81CdFD1geXy7/Qf4ddP0PMloI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFN2-0007uD-EF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFN2-0003og-Cr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-common: Document qemu_find_file()
Message-Id: <E1kYFN2-0003og-Cr@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:08 +0000

commit b6c61f69349ca3706c7e757ec1f2df916b70de7a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:10:10 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu-common: Document qemu_find_file()
    
    Document qemu_find_file(), in particular the returned
    value which must be freed.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-4-f4bug@amsat.org>
---
 include/qemu-common.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index d0142f29ac..bb9496bd80 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -110,6 +110,23 @@ const char *qemu_get_vm_name(void);
 
 #define QEMU_FILE_TYPE_BIOS   0
 #define QEMU_FILE_TYPE_KEYMAP 1
+/**
+ * qemu_find_file:
+ * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
+ *        or QEMU_FILE_TYPE_KEYMAP (for keymaps).
+ * @name: Relative or absolute file name
+ *
+ * If @name exists on disk as an absolute path, or a path relative
+ * to the current directory, then returns @name unchanged.
+ * Otherwise searches for @name file in the data directories, either
+ * configured at build time (DATADIR) or registered with the -L command
+ * line option.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
+ *
+ * Returns: a path that can access @name, or NULL if no matching file exists.
+ */
 char *qemu_find_file(int type, const char *name);
 
 /* OS specific functions */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14974.37372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNE-0002Ms-N2; Thu, 29 Oct 2020 21:22:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14974.37372; Thu, 29 Oct 2020 21:22:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNE-0002Mk-Ji; Thu, 29 Oct 2020 21:22:20 +0000
Received: by outflank-mailman (input) for mailman id 14974;
 Thu, 29 Oct 2020 21:22:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFND-0002MZ-9S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2f582b2d-1cc2-410f-af70-8698af6a8fb4;
 Thu, 29 Oct 2020 21:22:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNC-0007uN-Ic
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNC-0003pG-HP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFND-0002MZ-9S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:19 +0000
X-Inumbo-ID: 2f582b2d-1cc2-410f-af70-8698af6a8fb4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2f582b2d-1cc2-410f-af70-8698af6a8fb4;
	Thu, 29 Oct 2020 21:22:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pq4x0lyEVn8OPJEzml+DX4pu0Lp/QjPR5uKYTpwiCPs=; b=R5mY+/B1W9OKGyWCK0EvGgQi6X
	5Eg3g1dmrE9o12Vcm/uKVxGz7qGyY/6zh1Sr3PqGMtUkpLpfxInr6I/qoHvxj0AoSMwuRgdOGRDKu
	4pkeTex5OoJYSC1eqFfW7oH/E3UpKBZvykizoCWwX6bfG6yH/Bmzl0CuUQ82CsjU5EKI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNC-0007uN-Ic
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNC-0003pG-HP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/avr/boot: Fix memory leak in avr_load_firmware()
Message-Id: <E1kYFNC-0003pG-HP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:18 +0000

commit 5e29521a82e540552880c3572cb8274bcaa1002c
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:15:05 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    hw/avr/boot: Fix memory leak in avr_load_firmware()
    
    The value returned by qemu_find_file() must be freed.
    
    This fixes Coverity issue CID 1430449, which points out
    that the memory returned by qemu_find_file() is leaked.
    
    Fixes: Coverity CID 1430449 (RESOURCE_LEAK)
    Fixes: 7dd8f6fde4 ('hw/avr: Add support for loading ELF/raw binaries')
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-5-f4bug@amsat.org>
---
 hw/avr/boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/avr/boot.c b/hw/avr/boot.c
index 6fbcde4061..d16bb3dbe1 100644
--- a/hw/avr/boot.c
+++ b/hw/avr/boot.c
@@ -60,7 +60,7 @@ static const char *avr_elf_e_flags_to_cpu_type(uint32_t flags)
 bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
                        MemoryRegion *program_mr, const char *firmware)
 {
-    const char *filename;
+    g_autofree char *filename = NULL;
     int bytes_loaded;
     uint64_t entry;
     uint32_t e_flags;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14975.37376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNO-0002Oq-Pg; Thu, 29 Oct 2020 21:22:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14975.37376; Thu, 29 Oct 2020 21:22:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNO-0002Oi-Mj; Thu, 29 Oct 2020 21:22:30 +0000
Received: by outflank-mailman (input) for mailman id 14975;
 Thu, 29 Oct 2020 21:22:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFNN-0002OW-IH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id dbd7e6a6-777a-4769-8f5a-79beeba1c4ad;
 Thu, 29 Oct 2020 21:22:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNM-0007ua-NI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNM-0003q1-LS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFNN-0002OW-IH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:29 +0000
X-Inumbo-ID: dbd7e6a6-777a-4769-8f5a-79beeba1c4ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id dbd7e6a6-777a-4769-8f5a-79beeba1c4ad;
	Thu, 29 Oct 2020 21:22:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wCCaea1hAnEmRtjTFHtSO/UbnY6XRaigxO7rtDvoFBc=; b=3Jp0hRKWqxYXs86WmuQqcLkjpe
	rUVb8PwLkmW90SxSDfsNCE4zNMEBEOCsZ+2wKKPnA+MXQ3JtAaQEpa09oxZhfKJMImPLRyRGCuM/K
	DIO5UScrOkj2XrM4MuRIDxHdib51Y6j3LY/HqpA/r/aYEn12/rV0zX3YAxPxU11kOeUQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNM-0007ua-NI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNM-0003q1-LS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-20200721' into staging
Message-Id: <E1kYFNM-0003q1-LS@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:28 +0000

commit 53ce7b47b5bf47db067b81c18c786ed7b792d031
Merge: d0cc248164961a7ba9d43806feffd76f9f6d7f41 5e29521a82e540552880c3572cb8274bcaa1002c
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 11:43:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 11:43:25 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-20200721' into staging
    
    AVR patches
    
    Fixes a memory leak reported by Coverity (CID 1430449).
    
    CI jobs result:
    . https://gitlab.com/philmd/qemu/-/pipelines/168722631
    
    # gpg: Signature made Tue 21 Jul 2020 19:00:03 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/avr-20200721:
      hw/avr/boot: Fix memory leak in avr_load_firmware()
      qemu-common: Document qemu_find_file()
      qemu/osdep: Reword qemu_get_exec_dir() documentation
      qemu/osdep: Document os_find_datadir() return value
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/avr/boot.c         |  2 +-
 include/qemu-common.h | 17 +++++++++++++++++
 include/qemu/osdep.h  |  5 ++++-
 os-posix.c            |  3 +++
 os-win32.c            |  7 ++++++-
 5 files changed, 31 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14976.37380 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNZ-0002QF-RA; Thu, 29 Oct 2020 21:22:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14976.37380; Thu, 29 Oct 2020 21:22:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNZ-0002Q7-OH; Thu, 29 Oct 2020 21:22:41 +0000
Received: by outflank-mailman (input) for mailman id 14976;
 Thu, 29 Oct 2020 21:22:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFNY-0002Py-LS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b4ce7e2c-842b-47fb-90bd-b8db314ad8b9;
 Thu, 29 Oct 2020 21:22:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNX-0007wD-7v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNX-0003tR-6G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFNY-0002Py-LS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:40 +0000
X-Inumbo-ID: b4ce7e2c-842b-47fb-90bd-b8db314ad8b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b4ce7e2c-842b-47fb-90bd-b8db314ad8b9;
	Thu, 29 Oct 2020 21:22:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lvl86qznC0LjoRPbz6ymG4G4YyUarTXWe6VUCcBPNBs=; b=40/IRVECCce694Aym2kLv1Nmof
	xiWEv5TUxWBxojwOjWEwCjcjl4xoTTcvqeNOEqnSoAYHEzZjfgFhnXVNAzQ1a1SJJEx+NIgXTL7+D
	oRidpwYyBf85F6d0oceTIm5csZ9agOpYilQ24ZrJRg+W4OWEha9xTDmb07HGBBGDdfe0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNX-0007wD-7v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNX-0003tR-6G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] acpi: accept byte and word access to core ACPI registers
Message-Id: <E1kYFNX-0003tR-6G@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:39 +0000

commit dba04c3488c4699f5afe96f66e448b1d447cf3fb
Author:     Michael Tokarev <mjt@tls.msk.ru>
AuthorDate: Mon Jul 20 19:06:27 2020 +0300
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    acpi: accept byte and word access to core ACPI registers
    
    All ISA registers should be accessible as bytes, words or dwords
    (if wide enough).  Fix the access constraints for acpi-pm-evt,
    acpi-pm-tmr & acpi-cnt registers.
    
    Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Fixes: afafe4bbe0 (apci: switch cnt to memory api)
    Fixes: 77d58b1e47 (apci: switch timer to memory api)
    Fixes: b5a7c024d2 (apci: switch evt to memory api)
    Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
    Buglink: https://bugs.debian.org/964793
    BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
    BugLink: https://bugs.launchpad.net/bugs/1886318
    Reported-By: Simon John <git@the-jedi.co.uk>
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/acpi/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index f6d9ec4f13..ac06db3450 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -458,7 +458,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_evt_ops = {
     .read = acpi_pm_evt_read,
     .write = acpi_pm_evt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -527,7 +528,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_tmr_ops = {
     .read = acpi_pm_tmr_read,
     .write = acpi_pm_tmr_write,
-    .valid.min_access_size = 4,
+    .impl.min_access_size = 4,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -599,7 +601,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_cnt_ops = {
     .read = acpi_pm_cnt_read,
     .write = acpi_pm_cnt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:22:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:22:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14977.37385 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNj-0002RO-T7; Thu, 29 Oct 2020 21:22:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14977.37385; Thu, 29 Oct 2020 21:22:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNj-0002RE-Pr; Thu, 29 Oct 2020 21:22:51 +0000
Received: by outflank-mailman (input) for mailman id 14977;
 Thu, 29 Oct 2020 21:22:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFNi-0002R1-8x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 62b5d67c-805a-4638-8ed6-ace2f9eac015;
 Thu, 29 Oct 2020 21:22:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNh-0007wO-BK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNh-0003u5-AY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFNi-0002R1-8x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:50 +0000
X-Inumbo-ID: 62b5d67c-805a-4638-8ed6-ace2f9eac015
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 62b5d67c-805a-4638-8ed6-ace2f9eac015;
	Thu, 29 Oct 2020 21:22:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VKPzXEXSKMlgTh710djGOX0bHXsLia1p3jr2wpFb9Us=; b=43Nwf8F8WnduskpueYgnTcg4D1
	NI2R7JmVEFuzJMUZP03hZmsiR7PIkpwmrvTuyYdSz7hc/s2rrPXDP4ahOY8Hm120itMJCW3NpJQB2
	gfFP7/gbyH0zFl10gv+WF3mip/hvgX/pkM6dZNaHuv4q1sUymzDhcPDG8Fi98ZGRUHtY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNh-0007wO-BK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNh-0003u5-AY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio: Drop broken and superfluous object_property_set_link()
Message-Id: <E1kYFNh-0003u5-AY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:49 +0000

commit cf4e3d000e438d04077a56c401b41f3336a2a09d
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 21 14:11:53 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: Drop broken and superfluous object_property_set_link()
    
    virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's
    property "cryptodev" to vcrypto's property:
    
        object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
                                 NULL);
    
    Since it does so only after realize, this always fails, but the error
    is ignored.
    
    It's actually superfluous: vcrypto's property is an alias of
    vcrypto->vdev's property, created by virtio_instance_init_common().
    
    Drop the call.
    
    Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
    virtio_ccw_rng_realize().
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200721121153.1128844-1-armbru@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw-crypto.c  | 3 ---
 hw/s390x/virtio-ccw-rng.c     | 3 ---
 hw/virtio/virtio-crypto-pci.c | 2 --
 hw/virtio/virtio-rng-pci.c    | 3 ---
 4 files changed, 11 deletions(-)

diff --git a/hw/s390x/virtio-ccw-crypto.c b/hw/s390x/virtio-ccw-crypto.c
index 570c0333fc..358c74fb4b 100644
--- a/hw/s390x/virtio-ccw-crypto.c
+++ b/hw/s390x/virtio-ccw-crypto.c
@@ -23,9 +23,6 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vdev), "cryptodev",
-                             OBJECT(dev->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_ccw_crypto_instance_init(Object *obj)
diff --git a/hw/s390x/virtio-ccw-rng.c b/hw/s390x/virtio-ccw-rng.c
index 4bb8c16d79..2e3a9da5e8 100644
--- a/hw/s390x/virtio-ccw-rng.c
+++ b/hw/s390x/virtio-ccw-rng.c
@@ -24,9 +24,6 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(dev), "rng", OBJECT(dev->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_ccw_rng_instance_init(Object *obj)
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index f1cc979d33..198f86e08c 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -57,8 +57,6 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-    object_property_set_link(OBJECT(vcrypto), "cryptodev",
-                             OBJECT(vcrypto->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c
index 2f0b529b62..8afbb4c209 100644
--- a/hw/virtio/virtio-rng-pci.c
+++ b/hw/virtio/virtio-rng-pci.c
@@ -38,9 +38,6 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14978.37388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNt-0002Uh-UP; Thu, 29 Oct 2020 21:23:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14978.37388; Thu, 29 Oct 2020 21:23:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFNt-0002UZ-RN; Thu, 29 Oct 2020 21:23:01 +0000
Received: by outflank-mailman (input) for mailman id 14978;
 Thu, 29 Oct 2020 21:23:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFNs-0002Tv-AJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 51bac070-6fbb-42d4-a8e6-3e94132677b0;
 Thu, 29 Oct 2020 21:22:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNr-0007xA-Et
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFNr-0003ul-E4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFNs-0002Tv-AJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:00 +0000
X-Inumbo-ID: 51bac070-6fbb-42d4-a8e6-3e94132677b0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 51bac070-6fbb-42d4-a8e6-3e94132677b0;
	Thu, 29 Oct 2020 21:22:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dvrgYG8zHS0KmI5E43rK9bqiwX6ABOTGDb0c8l1kZcE=; b=5iEXz86O5GIlPrK8wMCPd1uBKZ
	Wxt1aW/eja8noUar1BbGjIxLR8+FMm+h5zHvOSm14EybroSRVJujKI5X3cOZl1EUv6+KlNubOIaNn
	dsReKTSli5lZOCp48CRIcFwTU5bPTej0V7tD4IO7NaWns9hqixje5qvk981a8a38umFM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNr-0007xA-Et
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFNr-0003ul-E4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:22:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-balloon: Prevent guest from starting a report when we didn't request one
Message-Id: <E1kYFNr-0003ul-E4@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:22:59 +0000

commit 20a4da0f23078deeff5ea6d1e12f47d968d7c3c9
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:15 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Prevent guest from starting a report when we didn't request one
    
    Based on code review it appears possible for the driver to force the device
    out of a stopped state when hinting by repeating the last ID it was
    provided.
    
    Prevent this by only allowing a transition to the start state when we are
    in the requested state. This way the driver is only allowed to send one
    descriptor that will transition the device into the start state. All others
    will leave it in the stop state once it has finished.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175115.21935.99563.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index e670f1e595..ce70adcc69 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -526,7 +526,8 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (id == dev->free_page_report_cmd_id) {
+        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
+            id == dev->free_page_report_cmd_id) {
             dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
         } else {
             /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14979.37391 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFO3-0002Vv-Vr; Thu, 29 Oct 2020 21:23:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14979.37391; Thu, 29 Oct 2020 21:23:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFO3-0002Vn-Sy; Thu, 29 Oct 2020 21:23:11 +0000
Received: by outflank-mailman (input) for mailman id 14979;
 Thu, 29 Oct 2020 21:23:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFO2-0002Ve-NJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 66fe05d3-a62d-46f4-96db-ab80c7ca30b3;
 Thu, 29 Oct 2020 21:23:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFO1-0007xY-Ik
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFO1-0003vZ-Hx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFO2-0002Ve-NJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:10 +0000
X-Inumbo-ID: 66fe05d3-a62d-46f4-96db-ab80c7ca30b3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 66fe05d3-a62d-46f4-96db-ab80c7ca30b3;
	Thu, 29 Oct 2020 21:23:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=B97ta2/3yFUxVGnofTkAK+DQP9lACb+xuu01M/z63MU=; b=XXt97TUdyXjFKK5rBaZRqb1DFb
	MLxJcCKi36QJSkQagQdg3KrN2Cpgf8sJkbg9zW4qd6L3dQRLkcRUPOkoBqMsGGN8luuKUkXLETKXa
	RZm/ME1MrBIJwQf1i+t0n1P8jGZ57dII0DcetvKcVlhPVBxK0aoP/B7gJbWxe4ecs3ZE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFO1-0007xY-Ik
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFO1-0003vZ-Hx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-balloon: Add locking to prevent possible race when starting hinting
Message-Id: <E1kYFO1-0003vZ-Hx@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:23:09 +0000

commit 1a83e0b9c492a0eaeacd6fbb858fc81d04ab9c3e
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:22 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Add locking to prevent possible race when starting hinting
    
    There is already locking in place when we are stopping free page hinting
    but there is not similar protections in place when we start. I can only
    assume this was overlooked as in most cases the page hinting should not be
    occurring when we are starting the hinting, however there is still a chance
    we could be processing hints by the time we get back around to restarting
    the hinting so we are better off making sure to protect the state with the
    mutex lock rather than just updating the value with no protections.
    
    Based on feedback from Peter Maydell this issue had also been spotted by
    Coverity: CID 1430269
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index ce70adcc69..6e2d129340 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -592,6 +592,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
         return;
     }
 
+    qemu_mutex_lock(&s->free_page_lock);
+
     if (s->free_page_report_cmd_id == UINT_MAX) {
         s->free_page_report_cmd_id =
                        VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
@@ -600,6 +602,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
     }
 
     s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    qemu_mutex_unlock(&s->free_page_lock);
+
     virtio_notify_config(vdev);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14980.37396 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOF-0002i0-1O; Thu, 29 Oct 2020 21:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14980.37396; Thu, 29 Oct 2020 21:23:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOE-0002hs-Ub; Thu, 29 Oct 2020 21:23:22 +0000
Received: by outflank-mailman (input) for mailman id 14980;
 Thu, 29 Oct 2020 21:23:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFOD-0002hD-1T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9ea074b4-3d24-42dc-9299-0613011e58b2;
 Thu, 29 Oct 2020 21:23:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOB-0007xg-MZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOB-0003wN-Lp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFOD-0002hD-1T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:21 +0000
X-Inumbo-ID: 9ea074b4-3d24-42dc-9299-0613011e58b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9ea074b4-3d24-42dc-9299-0613011e58b2;
	Thu, 29 Oct 2020 21:23:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=APGuwSmisMmy7zU1Cn8E5QkjPVCYobUKj7MhYqo1chQ=; b=j1H0LnabYjJVe8H5JIu9An2Zx2
	YQrhPHhQRMbmdxXB61y7dAfMiM8AycPOLXYWXe9882uBznIRAzefVqEqCBAnyV/npqkpgMdP7jo9T
	XmVJeowhmAfcnS6y+V2vzTM1DakYJbSeA8gv2MUt2II5bi/GdGQ/yYHh4xacCF8cCEXI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOB-0007xg-MZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOB-0003wN-Lp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-balloon: Replace free page hinting references to 'report' with 'hint'
Message-Id: <E1kYFOB-0003wN-Lp@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:23:19 +0000

commit 3219b42f025d4d7a9c463235e9f937ab38067de3
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:28 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Replace free page hinting references to 'report' with 'hint'
    
    Recently a feature named Free Page Reporting was added to the virtio
    balloon. In order to avoid any confusion we should drop the use of the word
    'report' when referring to Free Page Hinting. So what this patch does is go
    through and replace all instances of 'report' with 'hint" when we are
    referring to free page hinting.
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175128.21935.93927.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c         | 76 +++++++++++++++++++-------------------
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 6e2d129340..22cb5df717 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -526,22 +526,22 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
-            id == dev->free_page_report_cmd_id) {
-            dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED &&
+            id == dev->free_page_hint_cmd_id) {
+            dev->free_page_hint_status = FREE_PAGE_HINT_S_START;
         } else {
             /*
              * Stop the optimization only when it has started. This
              * avoids a stale stop sign for the previous command.
              */
-            if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
-                dev->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+            if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
+                dev->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
             }
         }
     }
 
     if (elem->in_num) {
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
             qemu_guest_free_page_hint(elem->in_sg[0].iov_base,
                                       elem->in_sg[0].iov_len);
         }
@@ -567,11 +567,11 @@ static void virtio_ballloon_get_free_page_hints(void *opaque)
         qemu_mutex_unlock(&dev->free_page_lock);
         virtio_notify(vdev, vq);
       /*
-       * Start to poll the vq once the reporting started. Otherwise, continue
+       * Start to poll the vq once the hinting started. Otherwise, continue
        * only when there are entries on the vq, which need to be given back.
        */
     } while (continue_to_get_hints ||
-             dev->free_page_report_status == FREE_PAGE_REPORT_S_START);
+             dev->free_page_hint_status == FREE_PAGE_HINT_S_START);
     virtio_queue_set_notification(vq, 1);
 }
 
@@ -594,14 +594,14 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
 
     qemu_mutex_lock(&s->free_page_lock);
 
-    if (s->free_page_report_cmd_id == UINT_MAX) {
-        s->free_page_report_cmd_id =
-                       VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    if (s->free_page_hint_cmd_id == UINT_MAX) {
+        s->free_page_hint_cmd_id =
+                       VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
     } else {
-        s->free_page_report_cmd_id++;
+        s->free_page_hint_cmd_id++;
     }
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    s->free_page_hint_status = FREE_PAGE_HINT_S_REQUESTED;
     qemu_mutex_unlock(&s->free_page_lock);
 
     virtio_notify_config(vdev);
@@ -611,18 +611,18 @@ static void virtio_balloon_free_page_stop(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_STOP) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_STOP) {
         /*
          * The lock also guarantees us that the
          * virtio_ballloon_get_free_page_hints exits after the
-         * free_page_report_status is set to S_STOP.
+         * free_page_hint_status is set to S_STOP.
          */
         qemu_mutex_lock(&s->free_page_lock);
         /*
-         * The guest hasn't done the reporting, so host sends a notification
-         * to the guest to actively stop the reporting.
+         * The guest isn't done hinting, so send a notification
+         * to the guest to actively stop the hinting.
          */
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
@@ -632,20 +632,20 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_DONE) {
         /* See virtio_balloon_free_page_stop() */
         qemu_mutex_lock(&s->free_page_lock);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_DONE;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
 }
 
 static int
-virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
+virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data)
 {
     VirtIOBalloon *dev = container_of(n, VirtIOBalloon,
-                                      free_page_report_notify);
+                                      free_page_hint_notify);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     PrecopyNotifyData *pnd = data;
 
@@ -703,7 +703,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon *s)
     if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         return offsetof(struct virtio_balloon_config, poison_val);
     }
-    return offsetof(struct virtio_balloon_config, free_page_report_cmd_id);
+    return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id);
 }
 
 static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
@@ -715,14 +715,14 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
     config.actual = cpu_to_le32(dev->actual);
     config.poison_val = cpu_to_le32(dev->poison_val);
 
-    if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED) {
-        config.free_page_report_cmd_id =
-                       cpu_to_le32(dev->free_page_report_cmd_id);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_STOP) {
-        config.free_page_report_cmd_id =
+    if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED) {
+        config.free_page_hint_cmd_id =
+                       cpu_to_le32(dev->free_page_hint_cmd_id);
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_STOP) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) {
-        config.free_page_report_cmd_id =
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_DONE) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE);
     }
 
@@ -835,14 +835,14 @@ static int virtio_balloon_post_load_device(void *opaque, int version_id)
     return 0;
 }
 
-static const VMStateDescription vmstate_virtio_balloon_free_page_report = {
+static const VMStateDescription vmstate_virtio_balloon_free_page_hint = {
     .name = "virtio-balloon-device/free-page-report",
     .version_id = 1,
     .minimum_version_id = 1,
     .needed = virtio_balloon_free_page_support,
     .fields = (VMStateField[]) {
-        VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon),
-        VMSTATE_UINT32(free_page_report_status, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -869,7 +869,7 @@ static const VMStateDescription vmstate_virtio_balloon_device = {
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * []) {
-        &vmstate_virtio_balloon_free_page_report,
+        &vmstate_virtio_balloon_free_page_hint,
         &vmstate_virtio_balloon_page_poison,
         NULL
     }
@@ -908,7 +908,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        precopy_add_notifier(&s->free_page_report_notify);
+        precopy_add_notifier(&s->free_page_hint_notify);
 
         object_ref(OBJECT(s->iothread));
         s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
@@ -932,7 +932,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev)
         qemu_bh_delete(s->free_page_bh);
         object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
-        precopy_remove_notifier(&s->free_page_report_notify);
+        precopy_remove_notifier(&s->free_page_hint_notify);
     }
     balloon_stats_destroy_timer(s);
     qemu_remove_balloon_handler(s);
@@ -1004,8 +1004,8 @@ static void virtio_balloon_instance_init(Object *obj)
 
     qemu_mutex_init(&s->free_page_lock);
     qemu_cond_init(&s->free_page_cond);
-    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+    s->free_page_hint_cmd_id = VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
+    s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify;
 
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s);
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index d49fef00ce..28fd2b3960 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -23,7 +23,7 @@
 #define VIRTIO_BALLOON(obj) \
         OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
 
-#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000
+#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000
 
 typedef struct virtio_balloon_stat VirtIOBalloonStat;
 
@@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern {
        uint64_t val;
 } VirtIOBalloonStatModern;
 
-enum virtio_balloon_free_page_report_status {
-    FREE_PAGE_REPORT_S_STOP = 0,
-    FREE_PAGE_REPORT_S_REQUESTED = 1,
-    FREE_PAGE_REPORT_S_START = 2,
-    FREE_PAGE_REPORT_S_DONE = 3,
+enum virtio_balloon_free_page_hint_status {
+    FREE_PAGE_HINT_S_STOP = 0,
+    FREE_PAGE_HINT_S_REQUESTED = 1,
+    FREE_PAGE_HINT_S_START = 2,
+    FREE_PAGE_HINT_S_DONE = 3,
 };
 
 typedef struct VirtIOBalloon {
     VirtIODevice parent_obj;
     VirtQueue *ivq, *dvq, *svq, *free_page_vq, *reporting_vq;
-    uint32_t free_page_report_status;
+    uint32_t free_page_hint_status;
     uint32_t num_pages;
     uint32_t actual;
-    uint32_t free_page_report_cmd_id;
+    uint32_t free_page_hint_cmd_id;
     uint64_t stats[VIRTIO_BALLOON_S_NR];
     VirtQueueElement *stats_vq_elem;
     size_t stats_vq_offset;
@@ -55,7 +55,7 @@ typedef struct VirtIOBalloon {
     QEMUBH *free_page_bh;
     /*
      * Lock to synchronize threads to access the free page reporting related
-     * fields (e.g. free_page_report_status).
+     * fields (e.g. free_page_hint_status).
      */
     QemuMutex free_page_lock;
     QemuCond  free_page_cond;
@@ -64,7 +64,7 @@ typedef struct VirtIOBalloon {
      * stopped.
      */
     bool block_iothread;
-    NotifierWithReturn free_page_report_notify;
+    NotifierWithReturn free_page_hint_notify;
     int64_t stats_last_update;
     int64_t stats_poll_interval;
     uint32_t host_features;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14981.37400 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOO-0002jI-4F; Thu, 29 Oct 2020 21:23:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14981.37400; Thu, 29 Oct 2020 21:23:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOO-0002jA-1H; Thu, 29 Oct 2020 21:23:32 +0000
Received: by outflank-mailman (input) for mailman id 14981;
 Thu, 29 Oct 2020 21:23:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFOM-0002j0-LJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bb609500-7075-4bae-a7b6-79d89be9eb2d;
 Thu, 29 Oct 2020 21:23:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOL-0007xm-Qp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOL-0003ww-PX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFOM-0002j0-LJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:30 +0000
X-Inumbo-ID: bb609500-7075-4bae-a7b6-79d89be9eb2d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bb609500-7075-4bae-a7b6-79d89be9eb2d;
	Thu, 29 Oct 2020 21:23:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WdJErRX84QrQr6MBhCwHNekLkVVM8p4KAeCbvtaksUU=; b=KZUEKg/GTQz8NWQv+X26P9jW6u
	IiZ4Qgz3+Nj2ig9rlmxVL+KKz/XKm1aT4L+AyzHfWf3roNS2N74dzEDt0mRIYQwBlpbC3qOIIU8T+
	X5Q9IqsEFUbclFlsz/aLrudgeHPs4wZzHKP+eHcsHlbyo5TcfrfaNmQnnT4qy3A6ykbU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOL-0007xm-Qp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOL-0003ww-PX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio: list legacy-capable devices
Message-Id: <E1kYFOL-0003ww-PX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:23:29 +0000

commit 7c78bdd7a3d0086179331f10d1f6f8cdac34731a
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Tue Jul 7 12:54:45 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: list legacy-capable devices
    
    Several types of virtio devices had already been around before the
    virtio standard was specified. These devices support virtio in legacy
    (and transitional) mode.
    
    Devices that have been added in the virtio standard are considered
    non-transitional (i.e. with no support for legacy virtio).
    
    Provide a helper function so virtio transports can figure that out
    easily.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200707105446.677966-2-cohuck@redhat.com>
    Cc: qemu-stable@nongnu.org
    Acked-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio.c         | 25 +++++++++++++++++++++++++
 include/hw/virtio/virtio.h |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5bd2a2f621..546a198e79 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -27,6 +27,7 @@
 #include "hw/virtio/virtio-access.h"
 #include "sysemu/dma.h"
 #include "sysemu/runstate.h"
+#include "standard-headers/linux/virtio_ids.h"
 
 /*
  * The alignment to use between consumer and producer parts of vring.
@@ -3279,6 +3280,30 @@ void virtio_init(VirtIODevice *vdev, const char *name,
     vdev->use_guest_notifier_mask = true;
 }
 
+/*
+ * Only devices that have already been around prior to defining the virtio
+ * standard support legacy mode; this includes devices not specified in the
+ * standard. All newer devices conform to the virtio standard only.
+ */
+bool virtio_legacy_allowed(VirtIODevice *vdev)
+{
+    switch (vdev->device_id) {
+    case VIRTIO_ID_NET:
+    case VIRTIO_ID_BLOCK:
+    case VIRTIO_ID_CONSOLE:
+    case VIRTIO_ID_RNG:
+    case VIRTIO_ID_BALLOON:
+    case VIRTIO_ID_RPMSG:
+    case VIRTIO_ID_SCSI:
+    case VIRTIO_ID_9P:
+    case VIRTIO_ID_RPROC_SERIAL:
+    case VIRTIO_ID_CAIF:
+        return true;
+    default:
+        return false;
+    }
+}
+
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n)
 {
     return vdev->vq[n].vring.desc;
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index b69d517496..198ffc7626 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -396,4 +396,6 @@ static inline bool virtio_device_disabled(VirtIODevice *vdev)
     return unlikely(vdev->disabled || vdev->broken);
 }
 
+bool virtio_legacy_allowed(VirtIODevice *vdev);
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14982.37404 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOY-0002kg-5l; Thu, 29 Oct 2020 21:23:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14982.37404; Thu, 29 Oct 2020 21:23:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOY-0002kY-2s; Thu, 29 Oct 2020 21:23:42 +0000
Received: by outflank-mailman (input) for mailman id 14982;
 Thu, 29 Oct 2020 21:23:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFOW-0002kO-TO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1473b97b-1d6d-4f65-a351-2901d7037629;
 Thu, 29 Oct 2020 21:23:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOV-0007xt-Vw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOV-0003xu-Ts
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFOW-0002kO-TO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:40 +0000
X-Inumbo-ID: 1473b97b-1d6d-4f65-a351-2901d7037629
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1473b97b-1d6d-4f65-a351-2901d7037629;
	Thu, 29 Oct 2020 21:23:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2/zzHSUBwcxoBsnedH2YMia6QBJcyPSjFpaLJ9ex9Oo=; b=Ho+q2bCKRvC2NOrco6gDDfXBOJ
	vsu0KR03ynS+ix9xtxoQYE3HApNeMysg9nKlugLn+0HEjXndZylDMQ2n1DO8QkJZ/03RGkZ4nElj9
	6sstbzCQ39iVec+Yza9q9bBCJYC0wfIXQwz22xE/insTXr3CCvjesyYgxaistUNO4Vw8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOV-0007xt-Vw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOV-0003xu-Ts
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio: verify that legacy support is not accidentally on
Message-Id: <E1kYFOV-0003xu-Ts@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:23:39 +0000

commit 9b3a35ec8236933ab958a4c3ad883163f1ca66e7
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Tue Jul 7 12:54:46 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: verify that legacy support is not accidentally on
    
    If a virtio device does not have legacy support, make sure that
    it is actually off, and bail out if not.
    
    For virtio-pci, this means that any device without legacy support
    that has been specified to modern-only (or that has been forced
    to it) will work.
    
    For virtio-ccw, this duplicates the check that is currently done
    prior to realization for any device that explicitly specified no
    support for legacy.
    
    This catches devices that have not been fenced properly.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200707105446.677966-3-cohuck@redhat.com>
    Cc: qemu-stable@nongnu.org
    Acked-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw.c  | 6 ++++++
 hw/virtio/virtio-pci.c | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 3c988a000b..0e60270297 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1121,6 +1121,12 @@ static void virtio_ccw_device_plugged(DeviceState *d, Error **errp)
         dev->max_rev = 0;
     }
 
+    if (!virtio_ccw_rev_max(dev) && !virtio_legacy_allowed(vdev)) {
+        error_setg(errp, "Invalid value of property max_rev "
+                   "(is %d expected >= 1)", virtio_ccw_rev_max(dev));
+        return;
+    }
+
     if (virtio_get_num_queues(vdev) > VIRTIO_QUEUE_MAX) {
         error_setg(errp, "The number of virtqueues %d "
                    "exceeds virtio limit %d", n,
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 8554cf2a03..db8b711b35 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1581,6 +1581,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
     }
 
     if (legacy) {
+        if (!virtio_legacy_allowed(vdev)) {
+            error_setg(errp, "device is modern-only, use disable-legacy=on");
+            return;
+        }
         if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
             error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was supported by"
                        " neither legacy nor transitional device");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:23:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:23:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14983.37408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOj-0002lx-7V; Thu, 29 Oct 2020 21:23:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14983.37408; Thu, 29 Oct 2020 21:23:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOj-0002lp-4Q; Thu, 29 Oct 2020 21:23:53 +0000
Received: by outflank-mailman (input) for mailman id 14983;
 Thu, 29 Oct 2020 21:23:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFOh-0002ld-2f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6d4ad62a-b057-4aeb-8f0d-c3709d155bca;
 Thu, 29 Oct 2020 21:23:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOg-0007y5-4G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOg-0003yf-2i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFOh-0002ld-2f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:51 +0000
X-Inumbo-ID: 6d4ad62a-b057-4aeb-8f0d-c3709d155bca
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6d4ad62a-b057-4aeb-8f0d-c3709d155bca;
	Thu, 29 Oct 2020 21:23:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0C2YV6ULNBVULn/uOKEkKxFrAWMn9fu29lNVeAv7EBI=; b=BiEwzIhK/kWmAnrNqtAWY/RrY1
	TNYvJV+ak5mxq6v7TYpsM2DUf2n6hlXXxDv4RQeikR1nj5AET3a6cE4ozbIBKVc1aFz+rN4rAhZkn
	QNIipLlSNWqrC7OE/aHackszCjj9mY/dt/qMzTQT2UuUckqFYGJpfywqE3xfCK79zolA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOg-0007y5-4G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOg-0003yf-2i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:23:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] intel_iommu: Use correct shift for 256 bits qi descriptor
Message-Id: <E1kYFOg-0003yf-2i@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:23:50 +0000

commit a4544c45e109ceee87ee8c19baff28be3890d788
Author:     Liu Yi L <yi.l.liu@intel.com>
AuthorDate: Sat Jul 4 01:07:15 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    intel_iommu: Use correct shift for 256 bits qi descriptor
    
    In chapter 10.4.23 of VT-d spec 3.0, Descriptor Width bit was introduced
    in VTD_IQA_REG. Software could set this bit to tell VT-d the QI descriptor
    from software would be 256 bits. Accordingly, the VTD_IQH_QH_SHIFT should
    be 5 when descriptor size is 256 bits.
    
    This patch adds the DW bit check when deciding the shift used to update
    VTD_IQH_REG.
    
    Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
    Message-Id: <1593850035-35483-1-git-send-email-yi.l.liu@intel.com>
    Reviewed-by: Peter Xu <peterx@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/intel_iommu.c          | 7 ++++++-
 hw/i386/intel_iommu_internal.h | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c56398e991..0c286635cf 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2549,6 +2549,11 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)
 /* Try to fetch and process more Invalidation Descriptors */
 static void vtd_fetch_inv_desc(IntelIOMMUState *s)
 {
+    int qi_shift;
+
+    /* Refer to 10.4.23 of VT-d spec 3.0 */
+    qi_shift = s->iq_dw ? VTD_IQH_QH_SHIFT_5 : VTD_IQH_QH_SHIFT_4;
+
     trace_vtd_inv_qi_fetch();
 
     if (s->iq_tail >= s->iq_size) {
@@ -2567,7 +2572,7 @@ static void vtd_fetch_inv_desc(IntelIOMMUState *s)
         }
         /* Must update the IQH_REG in time */
         vtd_set_quad_raw(s, DMAR_IQH_REG,
-                         (((uint64_t)(s->iq_head)) << VTD_IQH_QH_SHIFT) &
+                         (((uint64_t)(s->iq_head)) << qi_shift) &
                          VTD_IQH_QH_MASK);
     }
 }
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 862033ebe6..3d5487fe2c 100644
--- a/hw/i386/intel_iommu_internal.h
+++ b/hw/i386/intel_iommu_internal.h
@@ -230,7 +230,8 @@
 #define VTD_IQA_DW_MASK             0x800
 
 /* IQH_REG */
-#define VTD_IQH_QH_SHIFT            4
+#define VTD_IQH_QH_SHIFT_4          4
+#define VTD_IQH_QH_SHIFT_5          5
 #define VTD_IQH_QH_MASK             0x7fff0ULL
 
 /* ICS_REG */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14984.37411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOt-0002np-8u; Thu, 29 Oct 2020 21:24:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14984.37411; Thu, 29 Oct 2020 21:24:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFOt-0002nj-5w; Thu, 29 Oct 2020 21:24:03 +0000
Received: by outflank-mailman (input) for mailman id 14984;
 Thu, 29 Oct 2020 21:24:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFOr-0002ms-9Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b9e80a42-305e-4d41-a25d-8ad75576bda8;
 Thu, 29 Oct 2020 21:24:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOq-0007zN-8D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFOq-0003zY-70
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFOr-0002ms-9Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:01 +0000
X-Inumbo-ID: b9e80a42-305e-4d41-a25d-8ad75576bda8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b9e80a42-305e-4d41-a25d-8ad75576bda8;
	Thu, 29 Oct 2020 21:24:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pz3xeK1QDoVtWN+vnrMcjzyym0Mz5G8SqxOti3T+Um0=; b=Lj/YTWFUfSnMAMy+N0bAS1R+N1
	uVW95eu/cM0gezy89ypCAQLPbtVo0PdxQwkRkk9CzxrY1/JDvprZVs1W3OcyndvGirlo1lPLr17VC
	9mZWxnfzm6hhcIxyAcJHXuHD9DHVs5jZOev/KgagR+5Ai7CPMHa/9NDuNcK5UhJpNcww=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOq-0007zN-8D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFOq-0003zY-70
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
Message-Id: <E1kYFOq-0003zY-70@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:00 +0000

commit ccec7e9603f446fe75c6c563ba335c00cfda6a06
Author:     Andrew Melnychenko <andrew@daynix.com>
AuthorDate: Mon Jul 6 14:21:23 2020 +0300
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 08:05:37 2020 -0400

    virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
    
    There is an issue when callback may be called with invalid vdev.
    It happens on unplug when vdev already deleted and VirtIOPciProxy is not.
    So now, callbacks accept proxy device, and vdev retrieved from it.
    Technically memio callbacks should be removed during the flatview update,
    but memoryregions remain til PCI device(and it's address space) completely deleted.
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1716352
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Message-Id: <20200706112123.971087-1-andrew@daynix.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-pci.c | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index db8b711b35..ada1101d07 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1333,11 +1333,12 @@ static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
-    VirtIOPCIProxy *proxy = VIRTIO_PCI(DEVICE(vdev)->parent_bus->parent);
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = addr / virtio_pci_queue_mem_mult(proxy);
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1345,10 +1346,12 @@ static void virtio_pci_notify_write(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write_pio(void *opaque, hwaddr addr,
                                         uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = val;
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1372,9 +1375,14 @@ static void virtio_pci_isr_write(void *opaque, hwaddr addr,
 static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
                                        unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     uint64_t val = 0;
 
+    if (vdev == NULL) {
+        return val;
+    }
+
     switch (size) {
     case 1:
         val = virtio_config_modern_readb(vdev, addr);
@@ -1392,7 +1400,13 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
 static void virtio_pci_device_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
+    if (vdev == NULL) {
+        return;
+    }
+
     switch (size) {
     case 1:
         virtio_config_modern_writeb(vdev, addr, val);
@@ -1469,19 +1483,19 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
 
     memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
                           &device_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-device",
                           proxy->device.size);
 
     memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
                           &notify_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify",
                           proxy->notify.size);
 
     memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy),
                           &notify_pio_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify-pio",
                           proxy->notify_pio.size);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14985.37416 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFP3-0002p4-AQ; Thu, 29 Oct 2020 21:24:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14985.37416; Thu, 29 Oct 2020 21:24:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFP3-0002ow-7U; Thu, 29 Oct 2020 21:24:13 +0000
Received: by outflank-mailman (input) for mailman id 14985;
 Thu, 29 Oct 2020 21:24:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFP1-0002om-52
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a39d53b1-8a9b-470b-bf90-ffd487ff6d9e;
 Thu, 29 Oct 2020 21:24:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFP0-0007zn-CH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFP0-00040c-BR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFP1-0002om-52
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:11 +0000
X-Inumbo-ID: a39d53b1-8a9b-470b-bf90-ffd487ff6d9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a39d53b1-8a9b-470b-bf90-ffd487ff6d9e;
	Thu, 29 Oct 2020 21:24:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2vmY4AtpxyuOok9KnZzSTo5WJftZCDz8W4eVP8/oYik=; b=5QIwU97AQzKje0oXYapSehMfAU
	ADfHeahtiu1vqysWTai64284HD0co/VygKiFICEKSKO+tmvmnM4z0VuZ8lCZMuCu/B6e3aqFjAN0y
	5BVAJdC2Rhg35wGaGFmlrRLHHwV4zQ/Rl3slvESJzk/SdWTKaDkJH5tDxMiq9EPQJrAI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFP0-0007zn-CH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFP0-00040c-BR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYFP0-00040c-BR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:10 +0000

commit 8ffa52c20d5693d454f65f2024a1494edfea65d4
Merge: 53ce7b47b5bf47db067b81c18c786ed7b792d031 ccec7e9603f446fe75c6c563ba335c00cfda6a06
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 13:38:21 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 13:38:21 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    acpi,virtio,pc: bugfixes
    
    Fix bug in ACPI which were tripping up guests.
    Fix a use-after-free with hotplug of virtio devices.
    Block ability to create legacy devices which shouldn't have been
    there in the first place.
    Fix migration error handling with balloon.
    Drop some dead code in virtio.
    vtd emulation fixup.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Wed 22 Jul 2020 13:07:26 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
      intel_iommu: Use correct shift for 256 bits qi descriptor
      virtio: verify that legacy support is not accidentally on
      virtio: list legacy-capable devices
      virtio-balloon: Replace free page hinting references to 'report' with 'hint'
      virtio-balloon: Add locking to prevent possible race when starting hinting
      virtio-balloon: Prevent guest from starting a report when we didn't request one
      virtio: Drop broken and superfluous object_property_set_link()
      acpi: accept byte and word access to core ACPI registers
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/acpi/core.c                     |  9 +++--
 hw/i386/intel_iommu.c              |  7 +++-
 hw/i386/intel_iommu_internal.h     |  3 +-
 hw/s390x/virtio-ccw-crypto.c       |  3 --
 hw/s390x/virtio-ccw-rng.c          |  3 --
 hw/s390x/virtio-ccw.c              |  6 +++
 hw/virtio/virtio-balloon.c         | 79 ++++++++++++++++++++------------------
 hw/virtio/virtio-crypto-pci.c      |  2 -
 hw/virtio/virtio-pci.c             | 38 +++++++++++++-----
 hw/virtio/virtio-rng-pci.c         |  3 --
 hw/virtio/virtio.c                 | 25 ++++++++++++
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 include/hw/virtio/virtio.h         |  2 +
 13 files changed, 127 insertions(+), 73 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14986.37419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPD-0002qM-Ca; Thu, 29 Oct 2020 21:24:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14986.37419; Thu, 29 Oct 2020 21:24:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPD-0002qE-9A; Thu, 29 Oct 2020 21:24:23 +0000
Received: by outflank-mailman (input) for mailman id 14986;
 Thu, 29 Oct 2020 21:24:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFPB-0002q4-Nc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 508857b5-aaa0-494f-b21b-1c9afd7c30da;
 Thu, 29 Oct 2020 21:24:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPA-0007zv-QU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPA-00042D-Pa
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFPB-0002q4-Nc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:21 +0000
X-Inumbo-ID: 508857b5-aaa0-494f-b21b-1c9afd7c30da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 508857b5-aaa0-494f-b21b-1c9afd7c30da;
	Thu, 29 Oct 2020 21:24:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ej34ugskxP4MJwjYl4CnJW+EfJLS9UTWMVGJ1R2Q1Ro=; b=s6A/sJtLTs9bmt91fz+UFr6W0B
	e5WXO9/kNUInmG7Sme6pRRVUrvbPS2N42ROkKnzggGeWy275B98LtLAbdYXi0fsKgCFnWNljnkEka
	caNsv7VM8dWaedsWS1Pz3Ki6PKPu4u+9bGzOudmeWBoh+YsyyZqW/bPK6xFDTFRQHSxg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPA-0007zv-QU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPA-00042D-Pa
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
Message-Id: <E1kYFPA-00042D-Pa@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:20 +0000

commit 8380b3a453c38f040e7ca2105418802344cc23d0
Author:     Jessica Clarke <jrtc27@jrtc27.com>
AuthorDate: Sat Jul 18 01:49:34 2020 +0100
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
    
    The specification says:
    
       0x00  TIME_LOW   R: Get current time, then return low-order 32-bits.
       0x04  TIME_HIGH  R: Return high 32-bits from previous TIME_LOW read.
    
       ...
    
       To read the value, the kernel must perform an IO_READ(TIME_LOW),
       which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
       which returns a signed 32-bit value, corresponding to the higher half
       of the full value.
    
    However, we were just returning the current time for both. If the guest
    is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
    overflow of the lower half, it will see time be in the future, before
    jumping backwards on the next read, and Linux currently relies on the
    atomicity guaranteed by the spec so is affected by this. Fix this
    violation of the spec by caching the correct value for TIME_HIGH
    whenever TIME_LOW is read, and returning that value for any TIME_HIGH
    read.
    
    Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200718004934.83174-1-jrtc27@jrtc27.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/rtc/goldfish_rtc.c         | 17 ++++++++++++++---
 include/hw/rtc/goldfish_rtc.h |  1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
index 01e9d2b083..6ddd45cce0 100644
--- a/hw/rtc/goldfish_rtc.c
+++ b/hw/rtc/goldfish_rtc.c
@@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
     GoldfishRTCState *s = opaque;
     uint64_t r = 0;
 
+    /*
+     * From the documentation linked at the top of the file:
+     *
+     *   To read the value, the kernel must perform an IO_READ(TIME_LOW), which
+     *   returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
+     *   returns a signed 32-bit value, corresponding to the higher half of the
+     *   full value.
+     */
     switch (offset) {
     case RTC_TIME_LOW:
-        r = goldfish_rtc_get_count(s) & 0xffffffff;
+        r = goldfish_rtc_get_count(s);
+        s->time_high = r >> 32;
+        r &= 0xffffffff;
         break;
     case RTC_TIME_HIGH:
-        r = goldfish_rtc_get_count(s) >> 32;
+        r = s->time_high;
         break;
     case RTC_ALARM_LOW:
         r = s->alarm_next & 0xffffffff;
@@ -216,7 +226,7 @@ static const MemoryRegionOps goldfish_rtc_ops = {
 
 static const VMStateDescription goldfish_rtc_vmstate = {
     .name = TYPE_GOLDFISH_RTC,
-    .version_id = 1,
+    .version_id = 2,
     .pre_save = goldfish_rtc_pre_save,
     .post_load = goldfish_rtc_post_load,
     .fields = (VMStateField[]) {
@@ -225,6 +235,7 @@ static const VMStateDescription goldfish_rtc_vmstate = {
         VMSTATE_UINT32(alarm_running, GoldfishRTCState),
         VMSTATE_UINT32(irq_pending, GoldfishRTCState),
         VMSTATE_UINT32(irq_enabled, GoldfishRTCState),
+        VMSTATE_UINT32(time_high, GoldfishRTCState),
         VMSTATE_END_OF_LIST()
     }
 };
diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
index 16f9f9e29d..9bd8924f5f 100644
--- a/include/hw/rtc/goldfish_rtc.h
+++ b/include/hw/rtc/goldfish_rtc.h
@@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
     uint32_t alarm_running;
     uint32_t irq_pending;
     uint32_t irq_enabled;
+    uint32_t time_high;
 } GoldfishRTCState;
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14987.37424 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPN-0002rn-FX; Thu, 29 Oct 2020 21:24:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14987.37424; Thu, 29 Oct 2020 21:24:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPN-0002rf-Cj; Thu, 29 Oct 2020 21:24:33 +0000
Received: by outflank-mailman (input) for mailman id 14987;
 Thu, 29 Oct 2020 21:24:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFPM-0002rW-L5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id aa35fc67-6d4f-4a57-bf40-ba628ba06796;
 Thu, 29 Oct 2020 21:24:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPK-000804-UH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPK-00042n-TV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFPM-0002rW-L5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:32 +0000
X-Inumbo-ID: aa35fc67-6d4f-4a57-bf40-ba628ba06796
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id aa35fc67-6d4f-4a57-bf40-ba628ba06796;
	Thu, 29 Oct 2020 21:24:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ale2jtKpYiW8FMjr5SMIGMDYygTLJ1lj/36B+Vue/uc=; b=uDFLj+Yjy4D0u1kjBYyRLQWfvh
	bSicv56Z++1GM/FGLXML4stWnS0JKnXJRhDFvN/dVUBAM9x+ftuEFX6HWJNFaDJEelpxZ07Lb+z8r
	D8rU3j68MbwlKZKrbPsV2qADD1VPogRgCtjOAIUaSWbf3weVsSPfFzp7xxnDirjd4jnI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPK-000804-UH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPK-00042n-TV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: Quiet Coverity complains about vamo*
Message-Id: <E1kYFPK-00042n-TV@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:30 +0000

commit eabfeb0cb9e054108b3e29a3a85363b3d80d9c38
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Tue Jul 21 21:37:41 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    target/riscv: Quiet Coverity complains about vamo*
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200721133742.2298-1-zhiwei_liu@c-sky.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index c0b7375927..7b4752b911 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -733,6 +733,7 @@ static bool amo_op(DisasContext *s, arg_rwdvm *a, uint8_t seq)
             g_assert_not_reached();
 #endif
         } else {
+            assert(seq < ARRAY_SIZE(fnsw));
             fn = fnsw[seq];
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14988.37428 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPW-0002t0-HG; Thu, 29 Oct 2020 21:24:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14988.37428; Thu, 29 Oct 2020 21:24:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPW-0002ss-EH; Thu, 29 Oct 2020 21:24:42 +0000
Received: by outflank-mailman (input) for mailman id 14988;
 Thu, 29 Oct 2020 21:24:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFPV-0002sl-R5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 514cdd7a-8f73-4132-b3bd-f9f523063b68;
 Thu, 29 Oct 2020 21:24:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPV-00080B-1h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPV-00043W-10
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFPV-0002sl-R5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
X-Inumbo-ID: 514cdd7a-8f73-4132-b3bd-f9f523063b68
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 514cdd7a-8f73-4132-b3bd-f9f523063b68;
	Thu, 29 Oct 2020 21:24:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NfFgF6vdQvIdZ7UlIs3FRCxlasCTcKRtxowDFOdncJA=; b=BWNXbi9Re0ncCpgl0WB0Ycvyfl
	bemrUhHDYSS3YJQ4ob6JatiBY7nn5YlB6F/BEa0575Ph2vQ3DZ2AJi4CqoeKco+ZfWYCJ+snvoN1e
	Nackd0SyQsBmE2d/iDBQcHso3kuYNDieL/F3U8YLQfkipK99j+25DEa6+KsFwuvyHE5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPV-00080B-1h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPV-00043W-10
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: fix vector index load/store constraints
Message-Id: <E1kYFPV-00043W-10@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:41 +0000

commit 3e09396e36dff4234afd6f6fd51861949be383e1
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Tue Jul 21 21:37:42 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    target/riscv: fix vector index load/store constraints
    
    Although not explicitly specified that the the destination
    vector register groups cannot overlap the source vector register group,
    it is still necessary.
    
    And this constraint has been added to the v0.8 spec.
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200721133742.2298-2-zhiwei_liu@c-sky.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 7b4752b911..887c6b8883 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -513,13 +513,21 @@ static bool ld_index_op(DisasContext *s, arg_rnfvm *a, uint8_t seq)
     return ldst_index_trans(a->rd, a->rs1, a->rs2, data, fn, s);
 }
 
+/*
+ * For vector indexed segment loads, the destination vector register
+ * groups cannot overlap the source vector register group (specified by
+ * `vs2`), else an illegal instruction exception is raised.
+ */
 static bool ld_index_check(DisasContext *s, arg_rnfvm* a)
 {
     return (vext_check_isa_ill(s) &&
             vext_check_overlap_mask(s, a->rd, a->vm, false) &&
             vext_check_reg(s, a->rd, false) &&
             vext_check_reg(s, a->rs2, false) &&
-            vext_check_nf(s, a->nf));
+            vext_check_nf(s, a->nf) &&
+            ((a->nf == 1) ||
+             vext_check_overlap_group(a->rd, a->nf << s->lmul,
+                                      a->rs2, 1 << s->lmul)));
 }
 
 GEN_VEXT_TRANS(vlxb_v, 0, rnfvm, ld_index_op, ld_index_check)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:24:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:24:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14990.37432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPg-0002uV-Iq; Thu, 29 Oct 2020 21:24:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14990.37432; Thu, 29 Oct 2020 21:24:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPg-0002uM-Fk; Thu, 29 Oct 2020 21:24:52 +0000
Received: by outflank-mailman (input) for mailman id 14990;
 Thu, 29 Oct 2020 21:24:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFPf-0002uC-Su
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6a6745e7-926b-47a9-b663-3134984224d3;
 Thu, 29 Oct 2020 21:24:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPf-00080L-5X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPf-00044W-4e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFPf-0002uC-Su
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
X-Inumbo-ID: 6a6745e7-926b-47a9-b663-3134984224d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6a6745e7-926b-47a9-b663-3134984224d3;
	Thu, 29 Oct 2020 21:24:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lug3o4QM+8OFsT4NQjNeqk1jLLMwkZuh2BVbYf353YM=; b=5ZGF1k3JEN3lZkqUjEAmCSdAW7
	9hkO8WCNDO4erchprcB8Ip23nd1CNSPvsg6aY5pZBLKSCQZG5XMoRE6WTPPkmCv/KrZRcqYxqjzQs
	1OJFtQSBNpeyIu/s6HfD7Ymz8KAxGCZxuqEvweZQ0A9fHtW3dpxjGbOx4klJsNz8aMHg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPf-00080L-5X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPf-00044W-4e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:24:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/riscv: sifive_e: Correct debug block size
Message-Id: <E1kYFPf-00044W-4e@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:24:51 +0000

commit e79d27cb322b60b460b709d2c74ff7d77cde0565
Author:     Bin Meng <bmeng.cn@gmail.com>
AuthorDate: Thu Jul 16 02:30:56 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    hw/riscv: sifive_e: Correct debug block size
    
    Currently the debug region size is set to 0x100, but according to
    FE310-G000 and FE310-G002 manuals:
    
      FE310-G000: 0x100 - 0xFFF
      FE310-G002: 0x0   - 0xFFF
    
    Change the size to 0x1000 that applies to both.
    
    Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1594891856-15474-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 7bb97b463d..c8b060486a 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -54,7 +54,7 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } sifive_e_memmap[] = {
-    [SIFIVE_E_DEBUG] =    {        0x0,      0x100 },
+    [SIFIVE_E_DEBUG] =    {        0x0,     0x1000 },
     [SIFIVE_E_MROM] =     {     0x1000,     0x2000 },
     [SIFIVE_E_OTP] =      {    0x20000,     0x2000 },
     [SIFIVE_E_CLINT] =    {  0x2000000,    0x10000 },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14991.37436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPr-0002w9-Ka; Thu, 29 Oct 2020 21:25:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14991.37436; Thu, 29 Oct 2020 21:25:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFPr-0002w1-HH; Thu, 29 Oct 2020 21:25:03 +0000
Received: by outflank-mailman (input) for mailman id 14991;
 Thu, 29 Oct 2020 21:25:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFPq-0002vw-W2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ac2e580e-5602-4116-957e-9b5627b3e54d;
 Thu, 29 Oct 2020 21:25:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPp-000817-9R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPp-00045P-8h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFPq-0002vw-W2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:03 +0000
X-Inumbo-ID: ac2e580e-5602-4116-957e-9b5627b3e54d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ac2e580e-5602-4116-957e-9b5627b3e54d;
	Thu, 29 Oct 2020 21:25:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IokFj4/FFSZuu44x4UjUxz5tR+B6eQilt6vbGxGs+Xc=; b=UURY5JPnDejF5TZB+myMuqZnhI
	nxrsiu11k5/8OU7V/2UUriK2otCAyx64eXx2KM497YqgBfLcJLcfPOA0ElRxtN+nyKHI0nJ4YJS0u
	H2v6e9dukRHPOeiCWgR9nFzYg5SiR+W36VnUr5mKIdXv7vS5NyYbFKK3xWI7dgnbg7nQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPp-000817-9R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPp-00045P-8h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv: Fix the range of pmpcfg of CSR funcion table
Message-Id: <E1kYFPp-00045P-8h@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:01 +0000

commit 8ba26b0b2b00dd5849a6c0981e358dc7a7cc315d
Author:     Zong Li <zong.li@sifive.com>
AuthorDate: Tue Jul 21 20:40:50 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:41:36 2020 -0700

    target/riscv: Fix the range of pmpcfg of CSR funcion table
    
    The range of Physical Memory Protection should be from CSR_PMPCFG0
    to CSR_PMPCFG3, not to CSR_PMPADDR9.
    
    Signed-off-by: Zong Li <zong.li@sifive.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <eae49e9252c9596e4f3bdb471772f79235141a87.1595335112.git.zong.li@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index ac01c835e1..6a96a01b1c 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -1353,7 +1353,7 @@ static riscv_csr_operations csr_ops[CSR_TABLE_SIZE] = {
     [CSR_MTINST] =              { hmode,   read_mtinst,      write_mtinst     },
 
     /* Physical Memory Protection */
-    [CSR_PMPCFG0  ... CSR_PMPADDR9] =  { pmp,   read_pmpcfg,  write_pmpcfg   },
+    [CSR_PMPCFG0  ... CSR_PMPCFG3]   = { pmp,   read_pmpcfg,  write_pmpcfg   },
     [CSR_PMPADDR0 ... CSR_PMPADDR15] = { pmp,   read_pmpaddr, write_pmpaddr  },
 
     /* Performance Counters */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14992.37440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQ1-0002xS-M8; Thu, 29 Oct 2020 21:25:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14992.37440; Thu, 29 Oct 2020 21:25:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQ1-0002xI-Ip; Thu, 29 Oct 2020 21:25:13 +0000
Received: by outflank-mailman (input) for mailman id 14992;
 Thu, 29 Oct 2020 21:25:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQ0-0002x9-BL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 886cb8f8-f159-4848-b20b-9395a843ad8f;
 Thu, 29 Oct 2020 21:25:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPz-00081S-Dr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFPz-00046Q-CC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQ0-0002x9-BL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:12 +0000
X-Inumbo-ID: 886cb8f8-f159-4848-b20b-9395a843ad8f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 886cb8f8-f159-4848-b20b-9395a843ad8f;
	Thu, 29 Oct 2020 21:25:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tjG2m0zwPBQ2sai7bSDG11Q2A/mI9y+tz5sn195aqo4=; b=5vQqav7QSdkXpZeCcL4w7c3wVZ
	duaHjJe5h4oH1SVAgg1slnt+brwkjYICyLoXQKxVe+u01n5mbamjwSk9c/9vqo9k5TlUwBvo6cBL7
	kweSlZP0YTYDbOGEBBWlHFFhalWXo4sHyKQzKzShjcNneYuLmTYfaK+3vI2FxiVg2scY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPz-00081S-Dr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFPz-00046Q-CC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200722-1' into staging
Message-Id: <E1kYFPz-00046Q-CC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:11 +0000

commit 09e0cd773723219d21655587954da2769f64ba01
Merge: 8ffa52c20d5693d454f65f2024a1494edfea65d4 8ba26b0b2b00dd5849a6c0981e358dc7a7cc315d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 19:00:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 19:00:42 2020 +0100

    Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200722-1' into staging
    
    This PR contains a few RISC-V fixes.
    
    The main fix is the correction of the goldfish RTC time. On top of that
    some small fixes to the recently added vector extensions have been added
    (including an assert that fixed a coverity report). There is a change in
    the SiFive E debug memory size to match hardware. Finally there is a fix
    for PMP accesses.
    
    # gpg: Signature made Wed 22 Jul 2020 17:43:59 BST
    # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
    # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
    # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
    
    * remotes/alistair/tags/pull-riscv-to-apply-20200722-1:
      target/riscv: Fix the range of pmpcfg of CSR funcion table
      hw/riscv: sifive_e: Correct debug block size
      target/riscv: fix vector index load/store constraints
      target/riscv: Quiet Coverity complains about vamo*
      goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/riscv/sifive_e.c                     |  2 +-
 hw/rtc/goldfish_rtc.c                   | 17 ++++++++++++++---
 include/hw/rtc/goldfish_rtc.h           |  1 +
 target/riscv/csr.c                      |  2 +-
 target/riscv/insn_trans/trans_rvv.inc.c | 11 ++++++++++-
 5 files changed, 27 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14994.37444 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQB-0002yv-NG; Thu, 29 Oct 2020 21:25:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14994.37444; Thu, 29 Oct 2020 21:25:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQB-0002yn-KJ; Thu, 29 Oct 2020 21:25:23 +0000
Received: by outflank-mailman (input) for mailman id 14994;
 Thu, 29 Oct 2020 21:25:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQA-0002yd-HZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 43fbdbd8-6da6-4a29-9444-71656d24b309;
 Thu, 29 Oct 2020 21:25:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQ9-00081g-OK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQ9-00047I-Na
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQA-0002yd-HZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:22 +0000
X-Inumbo-ID: 43fbdbd8-6da6-4a29-9444-71656d24b309
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 43fbdbd8-6da6-4a29-9444-71656d24b309;
	Thu, 29 Oct 2020 21:25:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hJzrD6HmC2QIyzokXcKDWtPj11yi9xWeZ0HnyvP0X+A=; b=RKUbb7KnFW+9tXEIZteUFskViM
	Gres1tx4UTtTvZQknh58S5W5ancoWP0T4rrmK0WJgkrJyotmy/cvabZxNKIdNNWguPeuMkfkbWx5K
	kkWJxRsqT0QgeHvpZuOVGhL+ZWvH9hohulzLvpxhJfo6MHORsxdNiABXv3xFhvkwfCmM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQ9-00081g-OK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQ9-00047I-Na
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] KVM: fix CPU reset wrt HF2_GIF_MASK
Message-Id: <E1kYFQ9-00047I-Na@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:21 +0000

commit 0baa4b445e28f37243e5dc72e7efe32f0c9d7801
Author:     Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Thu Jul 23 16:27:01 2020 +0200
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 23 15:03:54 2020 -0400

    KVM: fix CPU reset wrt HF2_GIF_MASK
    
    HF2_GIF_MASK is set in env->hflags2 unconditionally on CPU reset
    (see x86_cpu_reset()) but when calling KVM_SET_NESTED_STATE,
    KVM_STATE_NESTED_GIF_SET is only valid for nSVM as e.g. nVMX code
    looks like
    
    if (kvm_state->hdr.vmx.vmxon_pa == -1ull) {
        if (kvm_state->flags & ~KVM_STATE_NESTED_EVMCS)
            return -EINVAL;
    }
    
    Also, when adjusting the environment after KVM_GET_NESTED_STATE we
    need not reset HF2_GIF_MASK on VMX as e.g. x86_cpu_pending_interrupt()
    expects it to be set.
    
    Alternatively, we could've made env->hflags2 SVM-only.
    
    Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
    Fixes: b16c0e20c742 ("KVM: add support for AMD nested live migration")
    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Message-Id: <20200723142701.2521161-1-vkuznets@redhat.com>
    Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/kvm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index b8455c89ed..6f18d940a5 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -3877,7 +3877,9 @@ static int kvm_put_nested_state(X86CPU *cpu)
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GUEST_MODE;
     }
-    if (env->hflags2 & HF2_GIF_MASK) {
+
+    /* Don't set KVM_STATE_NESTED_GIF_SET on VMX as it is illegal */
+    if (cpu_has_svm(env) && (env->hflags2 & HF2_GIF_MASK)) {
         env->nested_state->flags |= KVM_STATE_NESTED_GIF_SET;
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GIF_SET;
@@ -3919,10 +3921,14 @@ static int kvm_get_nested_state(X86CPU *cpu)
     } else {
         env->hflags &= ~HF_GUEST_MASK;
     }
-    if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
-        env->hflags2 |= HF2_GIF_MASK;
-    } else {
-        env->hflags2 &= ~HF2_GIF_MASK;
+
+    /* Keep HF2_GIF_MASK set on !SVM as x86_cpu_pending_interrupt() needs it */
+    if (cpu_has_svm(env)) {
+        if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
+            env->hflags2 |= HF2_GIF_MASK;
+        } else {
+            env->hflags2 &= ~HF2_GIF_MASK;
+        }
     }
 
     return ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14995.37448 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQL-000309-Or; Thu, 29 Oct 2020 21:25:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14995.37448; Thu, 29 Oct 2020 21:25:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQL-000301-Lo; Thu, 29 Oct 2020 21:25:33 +0000
Received: by outflank-mailman (input) for mailman id 14995;
 Thu, 29 Oct 2020 21:25:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQK-0002zr-JD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 90ee029d-beae-4bbc-9e39-162c5c5c1f4a;
 Thu, 29 Oct 2020 21:25:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQJ-00081q-Rm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQJ-00047y-R7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQK-0002zr-JD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:32 +0000
X-Inumbo-ID: 90ee029d-beae-4bbc-9e39-162c5c5c1f4a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 90ee029d-beae-4bbc-9e39-162c5c5c1f4a;
	Thu, 29 Oct 2020 21:25:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U2jzcdh82LMSTckYI0FrGCUSflwwRydJ3WgHIwcP2YU=; b=SQ5T7IiZ+gDIl6EMCsShnQo75n
	szuzOioVXgsVhrFJ7t6m3FowQcWL1f4jg+480o+gFgzW0AuWa1npiHborjYYwXjs/epX+LlUuG9E8
	hIk3wlPEf87znw9DSylPeYi4kqvEcaxWPgyzfJhf/MLf7bWBiPQN4bwm7ENcvtwOR4Ig=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQJ-00081q-Rm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQJ-00047y-R7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging
Message-Id: <E1kYFQJ-00047y-R7@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:31 +0000

commit 7adfbea8fd1efce36019a0c2f198ca73be9d3f18
Merge: 09e0cd773723219d21655587954da2769f64ba01 0baa4b445e28f37243e5dc72e7efe32f0c9d7801
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 24 10:52:20 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 24 10:52:20 2020 +0100

    Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging
    
    x86 bug fix for -rc2
    
    A fix from Vitaly Kuznetsov for a CPU reset bug
    reported by Jan Kiszka.
    
    # gpg: Signature made Thu 23 Jul 2020 20:10:40 BST
    # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
    # gpg:                issuer "ehabkost@redhat.com"
    # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
    # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
    
    * remotes/ehabkost/tags/x86-next-for-5.1-pull-request:
      KVM: fix CPU reset wrt HF2_GIF_MASK
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 target/i386/kvm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14996.37452 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQV-00031S-QQ; Thu, 29 Oct 2020 21:25:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14996.37452; Thu, 29 Oct 2020 21:25:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQV-00031J-NM; Thu, 29 Oct 2020 21:25:43 +0000
Received: by outflank-mailman (input) for mailman id 14996;
 Thu, 29 Oct 2020 21:25:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQV-000318-06
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c21919d1-56b5-40e5-9696-42aa8f396f46;
 Thu, 29 Oct 2020 21:25:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQU-00081x-7l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQU-00049G-6U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQV-000318-06
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:43 +0000
X-Inumbo-ID: c21919d1-56b5-40e5-9696-42aa8f396f46
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c21919d1-56b5-40e5-9696-42aa8f396f46;
	Thu, 29 Oct 2020 21:25:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DTQKp2qpD8fxtxUgb0VGuHFfhaDSZs1xu6gV62Fs2Rg=; b=Od6EYNhpfB5+IqwTr8CyS/dyi2
	/PSs/f6P+3AoshB402m+xj+Lx2pckNjgQFvSEmAOrzSMsFljUqRBcjB7i4h3ZmmmW3y5JB6SgaJBv
	bTVVNdGW1kz1rKyiXwk03FaEw1zLkwFA0jjy4yHWHOmYzytoj3HR9EuojNM0hChrfiwA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQU-00081x-7l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQU-00049G-6U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] coccinelle/err-bad-newline: Fix for Python 3, and add patterns
Message-Id: <E1kYFQU-00049G-6U@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:42 +0000

commit cb3fa1e4c05a4ad2563b39cdb1146e617f3b5424
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 22 10:40:45 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 12:56:44 2020 +0200

    coccinelle/err-bad-newline: Fix for Python 3, and add patterns
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200722084048.1726105-2-armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 scripts/coccinelle/err-bad-newline.cocci | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/scripts/coccinelle/err-bad-newline.cocci b/scripts/coccinelle/err-bad-newline.cocci
index 1316cc86a6..5394421873 100644
--- a/scripts/coccinelle/err-bad-newline.cocci
+++ b/scripts/coccinelle/err-bad-newline.cocci
@@ -1,22 +1,42 @@
 // Error messages should not contain newlines.  This script finds
 // messages that do.  Fixing them is manual.
 @r@
-expression errp, eno, cls, fmt;
+expression errp, err, eno, cls, fmt, ap;
 position p;
 @@
 (
+error_vreport(fmt, ap)@p
+|
+warn_vreport(fmt, ap)@p
+|
+info_vreport(fmt, ap)@p
+|
 error_report(fmt, ...)@p
 |
+warn_report(fmt, ...)@p
+|
+info_report(fmt, ...)@p
+|
+error_report_once(fmt, ...)@p
+|
+warn_report_once(fmt, ...)@p
+|
 error_setg(errp, fmt, ...)@p
 |
 error_setg_errno(errp, eno, fmt, ...)@p
 |
 error_setg_win32(errp, eno, cls, fmt, ...)@p
 |
+error_propagate_prepend(errp, err, fmt, ...)@p
+|
+error_vprepend(errp, fmt, ap)@p
+|
 error_prepend(errp, fmt, ...)@p
 |
 error_setg_file_open(errp, eno, cls, fmt, ...)@p
 |
+warn_reportf_err(errp, fmt, ...)@p
+|
 error_reportf_err(errp, fmt, ...)@p
 |
 error_set(errp, cls, fmt, ...)@p
@@ -26,4 +46,4 @@ fmt << r.fmt;
 p << r.p;
 @@
 if "\\n" in str(fmt):
-    print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)
+    print("%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:25:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:25:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14997.37456 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQg-00032w-Tj; Thu, 29 Oct 2020 21:25:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14997.37456; Thu, 29 Oct 2020 21:25:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQg-00032o-QY; Thu, 29 Oct 2020 21:25:54 +0000
Received: by outflank-mailman (input) for mailman id 14997;
 Thu, 29 Oct 2020 21:25:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQf-00032e-Ea
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 02f47d80-32d3-48db-962d-b9372f218e4f;
 Thu, 29 Oct 2020 21:25:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQe-000825-CL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQe-0004A0-Aj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQf-00032e-Ea
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:53 +0000
X-Inumbo-ID: 02f47d80-32d3-48db-962d-b9372f218e4f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 02f47d80-32d3-48db-962d-b9372f218e4f;
	Thu, 29 Oct 2020 21:25:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lQCRH8SDu0GL4Yxi3swLIB0ZNohSxmyN+enRGoqA6Yc=; b=v0lRUQxrmv7zg5/wx/Upu0/mpc
	+DHBRLjzA1Jj5jrbHf9uCwxkGZ4waq6Am2mpIq0qJc6EN3ILXgqQO/7BViYIBu1E7HaC6hNOkYaNC
	oZZCYDOt4GvIxpEd0fYB0zOVjZZSK/qCHZEZSpWP0CfmO2YQqZCqimvDnszH/r03eHFU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQe-000825-CL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQe-0004A0-Aj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:25:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] error: Strip trailing '\n' from error string arguments (again)
Message-Id: <E1kYFQe-0004A0-Aj@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:25:52 +0000

commit ff5b5d5b6df5655946142820912b28f1a67efc94
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 22 10:40:46 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 12:56:44 2020 +0200

    error: Strip trailing '\n' from error string arguments (again)
    
    Tracked down with scripts/coccinelle/err-bad-newline.cocci.
    
    Cc: Peter Xu <peterx@redhat.com>
    Cc: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200722084048.1726105-3-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Acked-by: David Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: Peter Xu <peterx@redhat.com>
---
 hw/i386/intel_iommu.c   | 6 +++---
 target/ppc/mmu-hash64.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 0c286635cf..5284bb68b6 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2356,7 +2356,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
     if ((inv_desc->lo & VTD_INV_DESC_IOTLB_RSVD_LO) ||
         (inv_desc->hi & VTD_INV_DESC_IOTLB_RSVD_HI)) {
         error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                          ", lo=0x%"PRIx64" (reserved bits unzero)\n",
+                          ", lo=0x%"PRIx64" (reserved bits unzero)",
                           __func__, inv_desc->hi, inv_desc->lo);
         return false;
     }
@@ -2377,7 +2377,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
         am = VTD_INV_DESC_IOTLB_AM(inv_desc->hi);
         if (am > VTD_MAMV) {
             error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                              ", lo=0x%"PRIx64" (am=%u > VTD_MAMV=%u)\n",
+                              ", lo=0x%"PRIx64" (am=%u > VTD_MAMV=%u)",
                               __func__, inv_desc->hi, inv_desc->lo,
                               am, (unsigned)VTD_MAMV);
             return false;
@@ -2387,7 +2387,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
 
     default:
         error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                          ", lo=0x%"PRIx64" (type mismatch: 0x%llx)\n",
+                          ", lo=0x%"PRIx64" (type mismatch: 0x%llx)",
                           __func__, inv_desc->hi, inv_desc->lo,
                           inv_desc->lo & VTD_INV_DESC_IOTLB_G);
         return false;
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index e5baabf0e1..c31d21e6a9 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -859,7 +859,7 @@ static int build_vrma_slbe(PowerPCCPU *cpu, ppc_slb_t *slb)
     }
 
     error_report("Bad page size encoding in LPCR[VRMASD]; LPCR=0x"
-                 TARGET_FMT_lx"\n", lpcr);
+                 TARGET_FMT_lx, lpcr);
 
     return -1;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14998.37460 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQp-00034e-VS; Thu, 29 Oct 2020 21:26:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14998.37460; Thu, 29 Oct 2020 21:26:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFQp-00034W-SD; Thu, 29 Oct 2020 21:26:03 +0000
Received: by outflank-mailman (input) for mailman id 14998;
 Thu, 29 Oct 2020 21:26:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQp-00034R-9O
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e45e0e1d-0a83-43d8-9885-b4c1b046102e;
 Thu, 29 Oct 2020 21:26:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQo-00082m-Gn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQo-0004Aw-F2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQp-00034R-9O
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:03 +0000
X-Inumbo-ID: e45e0e1d-0a83-43d8-9885-b4c1b046102e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e45e0e1d-0a83-43d8-9885-b4c1b046102e;
	Thu, 29 Oct 2020 21:26:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cEUZRC0/tOaID90UbeSTElo9pTtsArlEwhlcMj9UvJU=; b=iJ2LSuE5QrKlTvw93YU5U0hFk1
	vqWa9DGN1Hrb8VGOfvGNCfogpqV/xxjIcmi2mf0YYC6Do0udeL69UqRTxkfhkSkerqQytj4cXmoci
	UzJ2xMFHz6nKCiuk0/tC/Wbsn23475YR5R5N7rHyxDZtcQqqzgEv0x9fyLv/9kdOvixM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQo-00082m-Gn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQo-0004Aw-F2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] sd/milkymist-memcard: Fix format string
Message-Id: <E1kYFQo-0004Aw-F2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:02 +0000

commit 838886378eac879771708100a08a1099173d6935
Author:     Stefan Weil <sw@weilnetz.de>
AuthorDate: Wed Jul 22 22:40:54 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 15:03:09 2020 +0200

    sd/milkymist-memcard: Fix format string
    
    Fixes: b98e8d1230ff7023bb34ddeb7194424dfcbaf789
    Signed-off-by: Stefan Weil <sw@weilnetz.de>
    Message-Id: <20200722204054.1400555-1-sw@weilnetz.de>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    [Commit message tweaked]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/sd/milkymist-memcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index afdb8aa0c0..11f61294fc 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -281,7 +281,7 @@ static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
     carddev = qdev_new(TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk);
     if (!qdev_realize_and_unref(carddev, BUS(&s->sdbus), &err)) {
-        error_propagate_prepend(errp, err, "failed to init SD card: %s");
+        error_propagate_prepend(errp, err, "failed to init SD card");
         return;
     }
     s->enabled = blk && blk_is_inserted(blk);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.14999.37464 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFR1-00035u-0o; Thu, 29 Oct 2020 21:26:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 14999.37464; Thu, 29 Oct 2020 21:26:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFR0-00035m-Tn; Thu, 29 Oct 2020 21:26:14 +0000
Received: by outflank-mailman (input) for mailman id 14999;
 Thu, 29 Oct 2020 21:26:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFQz-00035d-FW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 47a21798-54a5-4316-99e2-ee9c226af4df;
 Thu, 29 Oct 2020 21:26:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQy-00082z-KH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFQy-0004Bu-JZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFQz-00035d-FW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:13 +0000
X-Inumbo-ID: 47a21798-54a5-4316-99e2-ee9c226af4df
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 47a21798-54a5-4316-99e2-ee9c226af4df;
	Thu, 29 Oct 2020 21:26:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zGuoSv6sERsTOzsYrOfaTUIMq4UG0tdEuHkryhLRdtI=; b=q/NeOJDm70daRtlwm35s3xtw+3
	uptLvVaNIjcFUBkUGNy+tOOxZjLfi/VmftXUVJ0quyRDaoqhOS+Pl1xGYuFzUVwZ2vaT8chdIC6nq
	ceNdF7qDYcRBMdf+PV95drNOB4EeM+6KnpS6vJStP0MkLK3Nh9CkjABlUSqJAXOUaDTA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQy-00082z-KH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFQy-0004Bu-JZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qapi/error: Check format string argument in error_*prepend()
Message-Id: <E1kYFQy-0004Bu-JZ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:12 +0000

commit 192cf54ac5408d21c20c17b3794a632970bbb880
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:12:05 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 15:03:09 2020 +0200

    qapi/error: Check format string argument in error_*prepend()
    
    error_propagate_prepend() "behaves like error_prepend()", and
    error_prepend() uses "formatting @fmt, ... like printf()".
    error_prepend() checks its format string argument, but
    error_propagate_prepend() does not. Fix by addint the format
    attribute to error_propagate_prepend() and error_vprepend().
    
    This would have caught the bug fixed in the previous commit.
    
    Missed in commit 4b5766488f "error: Fix use of error_prepend() with
    &error_fatal, &error_abort".
    
    Inspired-by: Stefan Weil <sw@weilnetz.de>
    Suggested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171205.14949-1-philmd@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Commit message tweaked]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qapi/error.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 7932594dce..eaa05c4837 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -382,13 +382,15 @@ void error_propagate(Error **dst_errp, Error *local_err);
  * Please use ERRP_GUARD() and error_prepend() instead when possible.
  */
 void error_propagate_prepend(Error **dst_errp, Error *local_err,
-                             const char *fmt, ...);
+                             const char *fmt, ...)
+    GCC_FMT_ATTR(3, 4);
 
 /*
  * Prepend some text to @errp's human-readable error message.
  * The text is made by formatting @fmt, @ap like vprintf().
  */
-void error_vprepend(Error *const *errp, const char *fmt, va_list ap);
+void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
+    GCC_FMT_ATTR(2, 0);
 
 /*
  * Prepend some text to @errp's human-readable error message.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15000.37468 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRB-00036y-20; Thu, 29 Oct 2020 21:26:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15000.37468; Thu, 29 Oct 2020 21:26:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRA-00036q-VK; Thu, 29 Oct 2020 21:26:24 +0000
Received: by outflank-mailman (input) for mailman id 15000;
 Thu, 29 Oct 2020 21:26:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFR9-00036j-FE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fba6311a-21a4-4d1f-9890-1625c1a9de48;
 Thu, 29 Oct 2020 21:26:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFR8-00083C-Ne
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFR8-0004Cj-Mz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFR9-00036j-FE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:23 +0000
X-Inumbo-ID: fba6311a-21a4-4d1f-9890-1625c1a9de48
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fba6311a-21a4-4d1f-9890-1625c1a9de48;
	Thu, 29 Oct 2020 21:26:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OLsFQRjVB0kwYN1Drz6V09q1zUCd7ArUbcooULinor4=; b=O2APM163xecKZUMDjQ5XcisWYi
	xkIB58OErbO3skrbX9AWeSGhZ98anxQ7Y5OFfwUG7zVIc0OCEoN05ZXP9GWIPYYVQr1eWNNwonLrz
	bCxhFbfrGMu8Umv3+s/ltyEenuySyAcRDQZsHtI+IO2+BPPqjoaQAYF0wKtP/T4kZoTY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFR8-00083C-Ne
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFR8-0004Cj-Mz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-24' into staging
Message-Id: <E1kYFR8-0004Cj-Mz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:22 +0000

commit e68808a797d0c585b0e82e4a788d1ba8899b01eb
Merge: 7adfbea8fd1efce36019a0c2f198ca73be9d3f18 192cf54ac5408d21c20c17b3794a632970bbb880
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 24 16:24:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 24 16:24:42 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-24' into staging
    
    Error reporting patches patches for 2020-07-24
    
    # gpg: Signature made Fri 24 Jul 2020 14:03:44 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-error-2020-07-24:
      qapi/error: Check format string argument in error_*prepend()
      sd/milkymist-memcard: Fix format string
      error: Strip trailing '\n' from error string arguments (again)
      coccinelle/err-bad-newline: Fix for Python 3, and add patterns
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/i386/intel_iommu.c                    |  6 +++---
 hw/sd/milkymist-memcard.c                |  2 +-
 include/qapi/error.h                     |  6 ++++--
 scripts/coccinelle/err-bad-newline.cocci | 24 ++++++++++++++++++++++--
 target/ppc/mmu-hash64.c                  |  2 +-
 5 files changed, 31 insertions(+), 9 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15001.37472 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRL-00038E-3c; Thu, 29 Oct 2020 21:26:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15001.37472; Thu, 29 Oct 2020 21:26:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRL-000386-0Z; Thu, 29 Oct 2020 21:26:35 +0000
Received: by outflank-mailman (input) for mailman id 15001;
 Thu, 29 Oct 2020 21:26:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFRJ-00037w-PC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9d0ba452-47a1-42d5-b85d-5ba0331f664c;
 Thu, 29 Oct 2020 21:26:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRI-00083K-RS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRI-0004DL-QG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFRJ-00037w-PC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:33 +0000
X-Inumbo-ID: 9d0ba452-47a1-42d5-b85d-5ba0331f664c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9d0ba452-47a1-42d5-b85d-5ba0331f664c;
	Thu, 29 Oct 2020 21:26:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GIwo6z/MKJpeJpCQlRq1zcQMnth9CzFPewO38lt9dH0=; b=zFH+lFRDGMYKFEmOafkfY//y4Y
	wZb76aMez67Dax4rBwIeqaQAT0GDD2Ghzp54tQ1yrIC47+PXcCGpOi8QYufiyqBGSBKy05XnYOD9h
	FJz9qGvQ9djbskvFYikpIwZx0PGJqY+8kJ4l/cgYelT5aiMIfaZ3loA9CecjOfEAobY4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRI-00083K-RS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRI-0004DL-QG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/machine: Change default timeout to 30 seconds
Message-Id: <E1kYFRI-0004DL-QG@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:32 +0000

commit 8226a4b88b35aab2d7c95f9dbe2fcd662276685a
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Mon Jul 20 12:02:52 2020 -0400
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 17:27:10 2020 +0100

    python/machine: Change default timeout to 30 seconds
    
    3 seconds is too short for some tests running inside busy VMs. Build it out to
    a rather generous 30 seconds to find out conclusively if there are more severe
    problems in the merge/CI tests.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Message-id: 20200720160252.104139-2-jsnow@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 python/qemu/machine.py | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 80c4d4a8b6..51aa255ef9 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -394,15 +394,15 @@ class QEMUMachine:
         self._popen.kill()
         self._popen.wait(timeout=60)
 
-    def _soft_shutdown(self, has_quit: bool = False,
-                       timeout: Optional[int] = 3) -> None:
+    def _soft_shutdown(self, timeout: Optional[int],
+                       has_quit: bool = False) -> None:
         """
         Perform early cleanup, attempt to gracefully shut down the VM, and wait
         for it to terminate.
 
+        :param timeout: Timeout in seconds for graceful shutdown.
+                        A value of None is an infinite wait.
         :param has_quit: When True, don't attempt to issue 'quit' QMP command
-        :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
 
         :raise ConnectionReset: On QMP communication errors
         :raise subprocess.TimeoutExpired: When timeout is exceeded waiting for
@@ -418,14 +418,14 @@ class QEMUMachine:
         # May raise subprocess.TimeoutExpired
         self._popen.wait(timeout=timeout)
 
-    def _do_shutdown(self, has_quit: bool = False,
-                     timeout: Optional[int] = 3) -> None:
+    def _do_shutdown(self, timeout: Optional[int],
+                     has_quit: bool = False) -> None:
         """
         Attempt to shutdown the VM gracefully; fallback to a hard shutdown.
 
+        :param timeout: Timeout in seconds for graceful shutdown.
+                        A value of None is an infinite wait.
         :param has_quit: When True, don't attempt to issue 'quit' QMP command
-        :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
 
         :raise AbnormalShutdown: When the VM could not be shut down gracefully.
             The inner exception will likely be ConnectionReset or
@@ -433,7 +433,7 @@ class QEMUMachine:
             may result in its own exceptions, likely subprocess.TimeoutExpired.
         """
         try:
-            self._soft_shutdown(has_quit, timeout)
+            self._soft_shutdown(timeout, has_quit)
         except Exception as exc:
             self._hard_shutdown()
             raise AbnormalShutdown("Could not perform graceful shutdown") \
@@ -441,7 +441,7 @@ class QEMUMachine:
 
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
-                 timeout: Optional[int] = 3) -> None:
+                 timeout: Optional[int] = 30) -> None:
         """
         Terminate the VM (gracefully if possible) and perform cleanup.
         Cleanup will always be performed.
@@ -453,7 +453,7 @@ class QEMUMachine:
         :param hard: When true, do not attempt graceful shutdown, and
                      suppress the SIGKILL warning log message.
         :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
+                        Default 30 seconds, A `None` value is an infinite wait.
         """
         if not self._launched:
             return
@@ -463,7 +463,7 @@ class QEMUMachine:
                 self._user_killed = True
                 self._hard_shutdown()
             else:
-                self._do_shutdown(has_quit, timeout=timeout)
+                self._do_shutdown(timeout, has_quit)
         finally:
             self._post_shutdown()
 
@@ -473,12 +473,12 @@ class QEMUMachine:
         """
         self.shutdown(hard=True)
 
-    def wait(self, timeout: Optional[int] = 3) -> None:
+    def wait(self, timeout: Optional[int] = 30) -> None:
         """
         Wait for the VM to power off and perform post-shutdown cleanup.
 
-        :param timeout: Optional timeout in seconds.
-                        Default 3 seconds, A value of None is an infinite wait.
+        :param timeout: Optional timeout in seconds. Default 30 seconds.
+                        A value of `None` is an infinite wait.
         """
         self.shutdown(has_quit=True, timeout=timeout)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15002.37475 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRV-00039J-4p; Thu, 29 Oct 2020 21:26:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15002.37475; Thu, 29 Oct 2020 21:26:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRV-00039B-25; Thu, 29 Oct 2020 21:26:45 +0000
Received: by outflank-mailman (input) for mailman id 15002;
 Thu, 29 Oct 2020 21:26:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFRU-000393-0H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a4cfd46c-c7ca-4e11-8219-c023157e260f;
 Thu, 29 Oct 2020 21:26:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRT-00083T-6p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRT-0004ER-67
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFRU-000393-0H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:44 +0000
X-Inumbo-ID: a4cfd46c-c7ca-4e11-8219-c023157e260f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a4cfd46c-c7ca-4e11-8219-c023157e260f;
	Thu, 29 Oct 2020 21:26:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7JMfI+Csc8lM698IGzyzwluQVl9nYl4Jc1mM0BOKV6Y=; b=uzrLYG6oXstbIweocifxOr8Hkp
	Whxzo2GTP7MBUscSd8Z1dOz0ylzZqvMmed/SQh4Socs3kE7PabRwHF+irsAQofiDCYhOc/N4CESes
	toI9FynIl6jnWAUhEWv3JneMWi1jjINK+YzAIfKHdbJcYth8wPjQZeTOcJJDcd44xIhw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRT-00083T-6p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRT-0004ER-67
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw: Only compile the usb-dwc2 controller if it is really needed
Message-Id: <E1kYFRT-0004ER-67@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:43 +0000

commit 8d942986be27bb40e6faca2032af763d7db57082
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 17:47:19 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 16:15:28 2020 +0200

    hw: Only compile the usb-dwc2 controller if it is really needed
    
    The USB_DWC2 switch is currently "default y", so it is included in all
    qemu-system-* builds, even if it is not needed. Even worse, it does a
    "select USB", so USB devices are now showing up as available on targets
    that do not support USB at all. This sysbus device should only be
    included by the boards that need it, i.e. by the Raspi machines.
    
    Fixes: 153ef1662c ("dwc-hsotg (dwc2) USB host controller emulation")
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Paul Zimmerman <pauldzim@gmail.com>
    Message-id: 20200722154719.10130-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/arm/Kconfig | 1 +
 hw/usb/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 4a224a6351..bc3a423940 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -315,6 +315,7 @@ config RASPI
     select FRAMEBUFFER
     select PL011 # UART
     select SDHCI
+    select USB_DWC2
 
 config STM32F205_SOC
     bool
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index d4d8c37c28..5e63dc75f8 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -48,7 +48,6 @@ config USB_MUSB
 
 config USB_DWC2
     bool
-    default y
     select USB
 
 config TUSB6010
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:26:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15003.37480 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRf-0003Ak-6W; Thu, 29 Oct 2020 21:26:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15003.37480; Thu, 29 Oct 2020 21:26:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRf-0003Ad-3X; Thu, 29 Oct 2020 21:26:55 +0000
Received: by outflank-mailman (input) for mailman id 15003;
 Thu, 29 Oct 2020 21:26:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFRe-0003AT-9I
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cc5d9b4c-dba1-495e-9d9a-433b6afae8d3;
 Thu, 29 Oct 2020 21:26:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRd-00083d-AK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRd-0004F3-9d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFRe-0003AT-9I
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:54 +0000
X-Inumbo-ID: cc5d9b4c-dba1-495e-9d9a-433b6afae8d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cc5d9b4c-dba1-495e-9d9a-433b6afae8d3;
	Thu, 29 Oct 2020 21:26:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t5MB3WjxxrzIZG3/F+7SWoyDW8bB3ntJQWNcKTh/ELQ=; b=k/jWHSMxS8yc762IA5IPBwQdIa
	ALvTH+IEVUeHGLeDVt2i9O0X4tUxHDh9Swhcsy7KTIAqJDrZROQW+oPUrC4AEtsKQygau3+O2f63h
	Wj8WUfv/f7IGMMaucH2gFRhmngvoVbkGdUJfa17ispusj6iMd7DPQ4ODGs4QI8r0ukis=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRd-00083d-AK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRd-0004F3-9d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:26:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
Message-Id: <E1kYFRd-0004F3-9d@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:26:53 +0000

commit 2c9728c0db8c02bf2f4f067548433af9f4102948
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 20:24:57 2020 +0100
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 16:15:28 2020 +0200

    hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
    
    virtio-input-hid.c undefines CONFIG_CURSES before including
    ui/console.h. However since commits e2f82e924d057935 and b0766612d16da18
    that header does not have behaviour dependent on CONFIG_CURSES.
    Remove the now-unneeded undef.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Message-id: 20200723192457.28136-1-peter.maydell@linaro.org
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/input/virtio-input-hid.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index 09cf260985..a7a244a95d 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -12,7 +12,6 @@
 #include "hw/qdev-properties.h"
 #include "hw/virtio/virtio-input.h"
 
-#undef CONFIG_CURSES
 #include "ui/console.h"
 
 #include "standard-headers/linux/input.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15004.37484 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRr-0003D8-9X; Thu, 29 Oct 2020 21:27:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15004.37484; Thu, 29 Oct 2020 21:27:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRr-0003D0-6f; Thu, 29 Oct 2020 21:27:07 +0000
Received: by outflank-mailman (input) for mailman id 15004;
 Thu, 29 Oct 2020 21:27:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFRp-0003Cs-P3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 142dcc4d-8def-4766-abcd-35c37168b2e4;
 Thu, 29 Oct 2020 21:27:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRn-00084e-EG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRn-0004Fp-DM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFRp-0003Cs-P3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:05 +0000
X-Inumbo-ID: 142dcc4d-8def-4766-abcd-35c37168b2e4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 142dcc4d-8def-4766-abcd-35c37168b2e4;
	Thu, 29 Oct 2020 21:27:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gVq5F6zqgnszMopMduvj90ozVBZbupkjUVYexXwOutQ=; b=d7cSrljlIS547f2WxhahwYAYSi
	8OW3DwwN4bJEHle6hgt0NFVUJs1uteN2yHDJNK/aq+Y5eX0WjG6BrfUzfUXTtGcMXhaHIZlSTP1SP
	Um55RAC3fJUteMm4QS0wW6g7Q1LoyccjX6TZSnSneu59sHO5Acvh46c0pPvip/pB88z4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRn-00084e-EG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRn-0004Fp-DM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] configure: Allow to build tools without pixman
Message-Id: <E1kYFRn-0004Fp-DM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:03 +0000

commit 9b52b17ba5e96cec182537715e87308108b47117
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 23 16:11:23 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 17:36:03 2020 +0200

    configure: Allow to build tools without pixman
    
    If pixman is not installed, it is currently not possible to run:
    
     .../configure  --disable-system --enable-tools
    
    Seems like there was a dependency from one of the required source
    files to pixman in the past, but since commit 1ac0206b2ae1ffaeec56
    ("qemu-timer.c: Trim list of included headers"), this dependency
    should be gone. Thus allow to compile the tools without pixman now.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-id: 20200723141123.14765-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 4bd80ed507..2acc4d1465 100755
--- a/configure
+++ b/configure
@@ -4065,7 +4065,7 @@ fi
 ##########################################
 # pixman support probe
 
-if test "$want_tools" = "no" && test "$softmmu" = "no"; then
+if test "$softmmu" = "no"; then
   pixman_cflags=
   pixman_libs=
 elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15005.37489 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRz-0003ED-Ba; Thu, 29 Oct 2020 21:27:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15005.37489; Thu, 29 Oct 2020 21:27:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFRz-0003E7-83; Thu, 29 Oct 2020 21:27:15 +0000
Received: by outflank-mailman (input) for mailman id 15005;
 Thu, 29 Oct 2020 21:27:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFRy-0003Dy-9a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 407cf9f2-cee6-4a33-8964-9a62f11481f4;
 Thu, 29 Oct 2020 21:27:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRx-00084k-IJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFRx-0004Ga-HQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFRy-0003Dy-9a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:14 +0000
X-Inumbo-ID: 407cf9f2-cee6-4a33-8964-9a62f11481f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 407cf9f2-cee6-4a33-8964-9a62f11481f4;
	Thu, 29 Oct 2020 21:27:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xkl4gVpA4uzClzsqklJPqejgoSA3oqA95sZQ2HgOUC8=; b=bJZHKR447Q8gC9JG7W3JHehzLs
	R+6lTPA5g+K4apeO2bkWf4FaurD/S6Vk7Wf2vvm/QsHVnQ9/TRAO/Ki95fwt69r1E3b0l8Ogejj7Y
	YS8mX6cZ2THI4mJO2FHcsqPTpUp9qiBWz5tH3PNgsXXbVP2juZ2tmp6yb9PNoIvFAPPA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRx-00084k-IJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFRx-0004Ga-HQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200724-pull-request' into staging
Message-Id: <E1kYFRx-0004Ga-HQ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:13 +0000

commit b0ce3f021e0157e9a5ab836cb162c48caac132e1
Merge: 8226a4b88b35aab2d7c95f9dbe2fcd662276685a 9b52b17ba5e96cec182537715e87308108b47117
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 25 18:46:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 18:46:48 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200724-pull-request' into staging
    
    bugfixes: virtio-input, usb-dwc2, pixman.
    
    # gpg: Signature made Fri 24 Jul 2020 17:42:43 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200724-pull-request:
      configure: Allow to build tools without pixman
      hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
      hw: Only compile the usb-dwc2 controller if it is really needed
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 configure                   | 2 +-
 hw/arm/Kconfig              | 1 +
 hw/input/virtio-input-hid.c | 1 -
 hw/usb/Kconfig              | 1 -
 4 files changed, 2 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15006.37492 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSA-0003Fd-Cc; Thu, 29 Oct 2020 21:27:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15006.37492; Thu, 29 Oct 2020 21:27:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSA-0003FV-9c; Thu, 29 Oct 2020 21:27:26 +0000
Received: by outflank-mailman (input) for mailman id 15006;
 Thu, 29 Oct 2020 21:27:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFS9-0003FO-BQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b6d7e373-1fe5-4c97-ad43-02bfbc3b37a6;
 Thu, 29 Oct 2020 21:27:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFS7-00084y-Tk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFS7-0004Ha-Sz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFS9-0003FO-BQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:25 +0000
X-Inumbo-ID: b6d7e373-1fe5-4c97-ad43-02bfbc3b37a6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b6d7e373-1fe5-4c97-ad43-02bfbc3b37a6;
	Thu, 29 Oct 2020 21:27:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TSSp8MAln4UTBh5Gi8zmkGDkIY/syWxAzpaCZTMxvWk=; b=hDInbvQ4fNO/1GMXw/NzsQF27Y
	2gDyc7JH+Z3ryVk1aDA7A6qA/5iA9dydSS2GZgGKsk0Wi3xATAZhI77v/4oGZ4Ys7zcqAIEKOd1zL
	/cuV7Q2dI5onx0Ht+tLfjfrvgEQVFSQXwv/S8LoZX0gyuacoV9bLzCUMfvRNFqetpjv8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFS7-00084y-Tk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFS7-0004Ha-Sz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
Message-Id: <E1kYFS7-0004Ha-Sz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:23 +0000

commit d64072c0ac6f73413026695bb33a4aa232e69617
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 23 13:58:44 2020 +0200
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
    
    This reverts commit d10e05f15d5c3dd5e5cc59c5dfff460d89d48580.
    
    We report some -tpmdev failures, but then continue as if all was fine.
    Reproducer:
    
        $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -chardev null,id=tpm0 -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
        qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: tpm chardev 'chrtpm' not found.
        qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: Could not cleanly shutdown the TPM: No such file or directory
        QEMU 5.0.90 monitor - type 'help' for more information
        (qemu) qemu-system-x86_64: -device tpm-tis,tpmdev=tpm0: Property 'tpm-tis.tpmdev' can't find value 'tpm0'
        $ echo $?
        1
    
    This is a regression caused by commit d10e05f15d "tpm: Clean up error
    reporting in tpm_init_tpmdev()".  It's incomplete: be->create(opts)
    continues to use error_report(), and we don't set an error when it
    fails.
    
    I figure converting the create() methods to Error would make some
    sense, but I'm not sure it's worth the effort right now.  Revert the
    broken commit instead, and add a comment to tpm_init_tpmdev().
    
    Straightforward conflict in tpm.c resolved.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 include/sysemu/tpm.h |  2 +-
 softmmu/vl.c         |  4 +++-
 stubs/tpm.c          |  3 ++-
 tpm.c                | 30 +++++++++++++++++++++---------
 4 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
index 03fb25941c..730c61ac97 100644
--- a/include/sysemu/tpm.h
+++ b/include/sysemu/tpm.h
@@ -16,7 +16,7 @@
 #include "qom/object.h"
 
 int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
-void tpm_init(void);
+int tpm_init(void);
 void tpm_cleanup(void);
 
 typedef enum TPMVersion {
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3416241557..660537a709 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4258,7 +4258,9 @@ void qemu_init(int argc, char **argv, char **envp)
                       user_creatable_add_opts_foreach,
                       object_create_delayed, &error_fatal);
 
-    tpm_init();
+    if (tpm_init() < 0) {
+        exit(1);
+    }
 
     blk_mig_init();
     ram_mig_init();
diff --git a/stubs/tpm.c b/stubs/tpm.c
index 66c99d667d..9bded191d9 100644
--- a/stubs/tpm.c
+++ b/stubs/tpm.c
@@ -10,8 +10,9 @@
 #include "sysemu/tpm.h"
 #include "hw/acpi/tpm.h"
 
-void tpm_init(void)
+int tpm_init(void)
 {
+    return 0;
 }
 
 void tpm_cleanup(void)
diff --git a/tpm.c b/tpm.c
index fe03b24858..f6045bb6da 100644
--- a/tpm.c
+++ b/tpm.c
@@ -81,26 +81,33 @@ TPMBackend *qemu_find_tpm_be(const char *id)
 
 static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
 {
+    /*
+     * Use of error_report() in a function with an Error ** parameter
+     * is suspicious.  It is okay here.  The parameter only exists to
+     * make the function usable with qemu_opts_foreach().  It is not
+     * actually used.
+     */
     const char *value;
     const char *id;
     const TPMBackendClass *be;
     TPMBackend *drv;
+    Error *local_err = NULL;
     int i;
 
     if (!QLIST_EMPTY(&tpm_backends)) {
-        error_setg(errp, "Only one TPM is allowed.");
+        error_report("Only one TPM is allowed.");
         return 1;
     }
 
     id = qemu_opts_id(opts);
     if (id == NULL) {
-        error_setg(errp, QERR_MISSING_PARAMETER, "id");
+        error_report(QERR_MISSING_PARAMETER, "id");
         return 1;
     }
 
     value = qemu_opt_get(opts, "type");
     if (!value) {
-        error_setg(errp, QERR_MISSING_PARAMETER, "type");
+        error_report(QERR_MISSING_PARAMETER, "type");
         tpm_display_backend_drivers();
         return 1;
     }
@@ -108,14 +115,15 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
     i = qapi_enum_parse(&TpmType_lookup, value, -1, NULL);
     be = i >= 0 ? tpm_be_find_by_type(i) : NULL;
     if (be == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type",
-                   "a TPM backend type");
+        error_report(QERR_INVALID_PARAMETER_VALUE,
+                     "type", "a TPM backend type");
         tpm_display_backend_drivers();
         return 1;
     }
 
     /* validate backend specific opts */
-    if (!qemu_opts_validate(opts, be->opts, errp)) {
+    if (!qemu_opts_validate(opts, be->opts, &local_err)) {
+        error_report_err(local_err);
         return 1;
     }
 
@@ -148,10 +156,14 @@ void tpm_cleanup(void)
  * Initialize the TPM. Process the tpmdev command line options describing the
  * TPM backend.
  */
-void tpm_init(void)
+int tpm_init(void)
 {
-    qemu_opts_foreach(qemu_find_opts("tpmdev"),
-                      tpm_init_tpmdev, NULL, &error_fatal);
+    if (qemu_opts_foreach(qemu_find_opts("tpmdev"),
+                          tpm_init_tpmdev, NULL, NULL)) {
+        return -1;
+    }
+
+    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15007.37496 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSK-0003Gw-EC; Thu, 29 Oct 2020 21:27:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15007.37496; Thu, 29 Oct 2020 21:27:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSK-0003Go-BH; Thu, 29 Oct 2020 21:27:36 +0000
Received: by outflank-mailman (input) for mailman id 15007;
 Thu, 29 Oct 2020 21:27:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFSI-0003Gd-Qg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1f1739c9-db6b-44f2-9ae1-8b4cc01826e6;
 Thu, 29 Oct 2020 21:27:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSI-000859-1t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSI-0004IE-0H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFSI-0003Gd-Qg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
X-Inumbo-ID: 1f1739c9-db6b-44f2-9ae1-8b4cc01826e6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1f1739c9-db6b-44f2-9ae1-8b4cc01826e6;
	Thu, 29 Oct 2020 21:27:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zQcUWAo6v6H14uZwqJD83EjZ1GnH7DOWwP6sqT4+Kug=; b=IDA/dhTh8tHbdVHWQgz/OBfrik
	lm93KoKIpGKOuU0437uFA5eunAxEMw9hU1qiqEiWToMIhwSJikFhqyiKcYdq5x1IJeH3AM2QFni/q
	o+yKFfU/lu88ctqbdG7acaYNcI/MeeQevMguk4Qgf5acPWRyu3WMdUrHqhXK4Ct2DKpU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSI-000859-1t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSI-0004IE-0H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tpm: Improve help on TPM types when none are available
Message-Id: <E1kYFSI-0004IE-0H@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:34 +0000

commit 5a6791c3d4a7719e8d0797afe0e2822a54bda6a2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 23 13:58:45 2020 +0200
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    tpm: Improve help on TPM types when none are available
    
    Help is a bit awkward when no TPM types are built into QEMU:
    
        $ qemu-system-x86_64 -tpmdev nonexistent,id=tpm0
        qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
        Supported TPM types (choose only one):
    
    Improve to
    
        qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
        No TPM backend types are available
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 tpm.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tpm.c b/tpm.c
index f6045bb6da..cab206355a 100644
--- a/tpm.c
+++ b/tpm.c
@@ -47,18 +47,23 @@ tpm_be_find_by_type(enum TpmType type)
  */
 static void tpm_display_backend_drivers(void)
 {
+    bool got_one = false;
     int i;
 
-    fprintf(stderr, "Supported TPM types (choose only one):\n");
-
     for (i = 0; i < TPM_TYPE__MAX; i++) {
         const TPMBackendClass *bc = tpm_be_find_by_type(i);
         if (!bc) {
             continue;
         }
-        fprintf(stderr, "%12s   %s\n", TpmType_str(i), bc->desc);
+        if (!got_one) {
+            error_printf("Supported TPM types (choose only one):\n");
+            got_one = true;
+        }
+        error_printf("%12s   %s\n", TpmType_str(i), bc->desc);
+    }
+    if (!got_one) {
+        error_printf("No TPM backend types are available\n");
     }
-    fprintf(stderr, "\n");
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15008.37500 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSU-0003IE-Fi; Thu, 29 Oct 2020 21:27:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15008.37500; Thu, 29 Oct 2020 21:27:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSU-0003I6-Cn; Thu, 29 Oct 2020 21:27:46 +0000
Received: by outflank-mailman (input) for mailman id 15008;
 Thu, 29 Oct 2020 21:27:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFST-0003Hz-2k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id aebdb65a-415e-4efa-8890-eb412b56c8d8;
 Thu, 29 Oct 2020 21:27:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSS-00086m-5s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSS-0004KP-4b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFST-0003Hz-2k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:45 +0000
X-Inumbo-ID: aebdb65a-415e-4efa-8890-eb412b56c8d8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id aebdb65a-415e-4efa-8890-eb412b56c8d8;
	Thu, 29 Oct 2020 21:27:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pv/XOqONWX5+LPBQn1/BYbnlCBCeeQ/J2stJ73sRjEM=; b=HWB/LX3bXHKo8OcP3R1bg/e8lU
	kwXU0XCIss5LLjGBe54lsccM8x7y83iMLqW2fMD56gvIfd/UMecK/rxqaOg27t1L5cyvSRXW42QJu
	pjuLCYAUWuVJfPshXC869zaWHlBitpbh1H9HBy9jcZaRDsVYAee38CjuUjjqHmGWKmBM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSS-00086m-5s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSS-0004KP-4b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tpm_emulator: Report an error if chardev is missing
Message-Id: <E1kYFSS-0004KP-4b@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:44 +0000

commit 88f830745721ba8c9e9d2831c01045a6f130c1a6
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Fri Jul 24 08:57:26 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    tpm_emulator: Report an error if chardev is missing
    
    This patch fixes the odd error reporting when trying to send a file
    descriptor to the TPM emulator if one has not passed a valid chardev.
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev emulator,id=tpm0
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: Failed to send CMD_SET_DATAFD: Success
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: Could not cleanly shutdown the TPM: Success
    
    This is the new error report:
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev emulator,id=tpm0
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: parameter 'chardev' is missing
    
    This change does not hide the display of supported TPM types if a non-existent type is passed:
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev nonexistent,id=tpm0
    qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
    Supported TPM types (choose only one):
     passthrough   Passthrough TPM backend driver
        emulator   TPM emulator backend driver
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 backends/tpm/tpm_emulator.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
index 9605339f93..a9b0f55e67 100644
--- a/backends/tpm/tpm_emulator.c
+++ b/backends/tpm/tpm_emulator.c
@@ -549,27 +549,30 @@ err_exit:
 static int tpm_emulator_handle_device_opts(TPMEmulator *tpm_emu, QemuOpts *opts)
 {
     const char *value;
+    Error *err = NULL;
+    Chardev *dev;
 
     value = qemu_opt_get(opts, "chardev");
-    if (value) {
-        Error *err = NULL;
-        Chardev *dev = qemu_chr_find(value);
-
-        if (!dev) {
-            error_report("tpm-emulator: tpm chardev '%s' not found.", value);
-            goto err;
-        }
+    if (!value) {
+        error_report("tpm-emulator: parameter 'chardev' is missing");
+        goto err;
+    }
 
-        if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
-            error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
-                          value);
-            error_report_err(err);
-            goto err;
-        }
+    dev = qemu_chr_find(value);
+    if (!dev) {
+        error_report("tpm-emulator: tpm chardev '%s' not found", value);
+        goto err;
+    }
 
-        tpm_emu->options->chardev = g_strdup(value);
+    if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
+        error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
+                      value);
+        error_report_err(err);
+        goto err;
     }
 
+    tpm_emu->options->chardev = g_strdup(value);
+
     if (tpm_emulator_prepare_data_fd(tpm_emu) < 0) {
         goto err;
     }
@@ -925,6 +928,11 @@ static void tpm_emulator_shutdown(TPMEmulator *tpm_emu)
 {
     ptm_res res;
 
+    if (!tpm_emu->options->chardev) {
+        /* was never properly initialized */
+        return;
+    }
+
     if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SHUTDOWN, &res, 0, sizeof(res)) < 0) {
         error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s",
                      strerror(errno));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:27:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:27:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15009.37504 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSe-0003Je-Hw; Thu, 29 Oct 2020 21:27:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15009.37504; Thu, 29 Oct 2020 21:27:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSe-0003JW-EM; Thu, 29 Oct 2020 21:27:56 +0000
Received: by outflank-mailman (input) for mailman id 15009;
 Thu, 29 Oct 2020 21:27:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFSd-0003JK-49
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2b48f34e-0258-4e0e-a1b3-25456097d356;
 Thu, 29 Oct 2020 21:27:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSc-00086u-AM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSc-0004L4-8j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFSd-0003JK-49
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:55 +0000
X-Inumbo-ID: 2b48f34e-0258-4e0e-a1b3-25456097d356
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2b48f34e-0258-4e0e-a1b3-25456097d356;
	Thu, 29 Oct 2020 21:27:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BrZ68ocbD6JBB9rYrY/9x9iCE8WFhsw+wW8kfoJM6jc=; b=SAba/aeEnMW2GF5KoDg+02zHiM
	gkLSiMhEHZlwpThisZDLG+0hdiYUK/TTIFgnLIJh8TvDaemhk5XwD29CWbpRDrTMBtY09m2eoylBc
	d/5Xn+yIeenDo8Bk+C4YRk6LXUiyoGxqhRtv6dGtK8IYTCIE3D+Y0tmwwZTn+AQ18snE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSc-00086u-AM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSc-0004L4-8j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:27:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-24-1' into staging
Message-Id: <E1kYFSc-0004L4-8j@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:27:54 +0000

commit 57cdde4a74dd0d68df9e32657773484a5484a027
Merge: b0ce3f021e0157e9a5ab836cb162c48caac132e1 88f830745721ba8c9e9d2831c01045a6f130c1a6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 25 20:30:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 20:30:58 2020 +0100

    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-24-1' into staging
    
    Merge tpm 2020/07/24 v1
    
    # gpg: Signature made Sat 25 Jul 2020 01:13:22 BST
    # gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
    # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
    
    * remotes/stefanberger/tags/pull-tpm-2020-07-24-1:
      tpm_emulator: Report an error if chardev is missing
      tpm: Improve help on TPM types when none are available
      Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 backends/tpm/tpm_emulator.c | 38 +++++++++++++++++++++++---------------
 include/sysemu/tpm.h        |  2 +-
 softmmu/vl.c                |  4 +++-
 stubs/tpm.c                 |  3 ++-
 tpm.c                       | 43 ++++++++++++++++++++++++++++++-------------
 5 files changed, 59 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15010.37508 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSo-0003NG-KB; Thu, 29 Oct 2020 21:28:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15010.37508; Thu, 29 Oct 2020 21:28:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFSo-0003N8-HD; Thu, 29 Oct 2020 21:28:06 +0000
Received: by outflank-mailman (input) for mailman id 15010;
 Thu, 29 Oct 2020 21:28:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFSn-0003My-GN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 23894ea8-242f-478d-bb40-bbfc55d1e1df;
 Thu, 29 Oct 2020 21:28:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSm-00087g-Lv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSm-0004MQ-L8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFSn-0003My-GN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:05 +0000
X-Inumbo-ID: 23894ea8-242f-478d-bb40-bbfc55d1e1df
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 23894ea8-242f-478d-bb40-bbfc55d1e1df;
	Thu, 29 Oct 2020 21:28:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L/fKhDZ/7XCxhAtHJR42s+dNFXHG00IOBAsFtRNYKcg=; b=PFKFLw6jRtnCrrFiLuP2IHllog
	mpCgjjtP1jgYj/XUbgnJyZ1kObHPPzh9cO6atFsFV37SgMANBidfnKOUyoLEY0LGWLuTIIMSYfAja
	/+/YCbUEACIFU7qlpI9eRzm3mBtv+1hV1FkpVFPU2D8Dc7t1+Ffi8siZttPFnptHbM7w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSm-00087g-Lv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSm-0004MQ-L8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tcg: update comments for save_iotlb_data in cputlb
Message-Id: <E1kYFSm-0004MQ-L8@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:04 +0000

commit 570ef3093b5ed327249397ad0295cf01c67d9db4
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 20 13:23:58 2020 +0100
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:25:11 2020 -0700

    tcg: update comments for save_iotlb_data in cputlb
    
    I missed Emilio's review comments:
    
      Message-ID: <20200718205107.GA994221@sff>
    
    and the patch got merged. Correcting the comments now.
    
    Reviewed-by: Emilio G. Cota <cota@braap.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200720122358.26881-1-alex.bennee@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cputlb.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index d370aedb47..5698292749 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1075,10 +1075,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
 
 /*
  * Save a potentially trashed IOTLB entry for later lookup by plugin.
- *
- * We also need to track the thread storage address because the RCU
- * cleanup that runs when we leave the critical region (the current
- * execution) is actually in a different thread.
+ * This is read by tlb_plugin_lookup if the iotlb entry doesn't match
+ * because of the side effect of io_writex changing memory layout.
  */
 static void save_iotlb_data(CPUState *cs, hwaddr addr,
                             MemoryRegionSection *section, hwaddr mr_offset)
@@ -1408,8 +1406,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
  * This almost never fails as the memory access being instrumented
  * should have just filled the TLB. The one corner case is io_writex
  * which can cause TLB flushes and potential resizing of the TLBs
- * loosing the information we need. In those cases we need to recover
- * data from a copy of the io_tlb entry.
+ * losing the information we need. In those cases we need to recover
+ * data from a copy of the iotlbentry. As long as this always occurs
+ * from the same thread (which a mem callback will be) this is safe.
  */
 
 bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15011.37512 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFT1-0003Oe-Lu; Thu, 29 Oct 2020 21:28:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15011.37512; Thu, 29 Oct 2020 21:28:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFT1-0003OV-Ip; Thu, 29 Oct 2020 21:28:19 +0000
Received: by outflank-mailman (input) for mailman id 15011;
 Thu, 29 Oct 2020 21:28:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFT0-0003OQ-B8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6f1247bb-1359-4175-a505-21d1be73fdab;
 Thu, 29 Oct 2020 21:28:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSw-00087o-Q2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFSw-0004NA-Op
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFT0-0003OQ-B8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:18 +0000
X-Inumbo-ID: 6f1247bb-1359-4175-a505-21d1be73fdab
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6f1247bb-1359-4175-a505-21d1be73fdab;
	Thu, 29 Oct 2020 21:28:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e64Ubtbs3NCEeIY3qbpzG/eN2n8tifnAmQQXxmWF9zM=; b=sxO0F1l5UZelXR4wbt/g7xWA+T
	giR+xuP3eOESLdiNBNVW9TKwklHQ7txhR1n+XwJ6NQP8a+bu8QuFpTh5znUM88M3UDzjYv1psWVSl
	sYz6giWJPwPimtHf0rhNYj1l9WvxklZmkzGJRA8PkFNorLD1LGCt06OWGvkCc2kuXPz0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSw-00087o-Q2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFSw-0004NA-Op
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/hppa: Free some temps in do_sub
Message-Id: <E1kYFSw-0004NA-Op@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:14 +0000

commit 79826f99feb7222b7804058f0b4ace9ee0546361
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:35:00 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:28:33 2020 -0700

    target/hppa: Free some temps in do_sub
    
    Two temps allocated but not freed.  Do enough subtractions
    within a single TB and one can run out of temps entirely.
    
    Fixes: b2167459ae ("target-hppa: Implement basic arithmetic")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880287
    Tested-by: Sven Schnelle <svens@stackframe.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org>
---
 target/hppa/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..4bd22d4820 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1,
     save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb);
     save_gpr(ctx, rt, dest);
     tcg_temp_free(dest);
+    tcg_temp_free(cb);
+    tcg_temp_free(cb_msb);
 
     /* Install the new nullification.  */
     cond_free(&ctx->null_cond);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15012.37516 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTA-0003Pl-NK; Thu, 29 Oct 2020 21:28:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15012.37516; Thu, 29 Oct 2020 21:28:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTA-0003Pd-KM; Thu, 29 Oct 2020 21:28:28 +0000
Received: by outflank-mailman (input) for mailman id 15012;
 Thu, 29 Oct 2020 21:28:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFT8-0003PS-N1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9f22deef-6073-4dbc-a4ee-71da21f2da47;
 Thu, 29 Oct 2020 21:28:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFT6-00087u-U6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFT6-0004Nm-TF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFT8-0003PS-N1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:26 +0000
X-Inumbo-ID: 9f22deef-6073-4dbc-a4ee-71da21f2da47
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9f22deef-6073-4dbc-a4ee-71da21f2da47;
	Thu, 29 Oct 2020 21:28:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6g+Ze3buS60bDySFJCz2XUajcHn/lkgU6Ynr+SMRKxs=; b=d5G6alLdzW5QyRe0yWAfM1NVy7
	Fs6RQcMpef6IgzLl3mPq39gksyk7tat8H4wHIZtYYnKRzjZNWTNYwSmL1kwvo3HL8N9Bs2/DdN3b7
	h9Ym9AF/m1uknBouUrhPD8phHrQWGQPXr0YDxS+gXgD5eXFw3M0SaBui8kZLnku0rN54=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFT6-00087u-U6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFT6-0004Nm-TF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/i386: Save cc_op before loop insns
Message-Id: <E1kYFT6-0004Nm-TF@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:24 +0000

commit 3cb3a7720b01830abd5fbb81819dbb9271bf7821
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 08:30:40 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:29:35 2020 -0700

    target/i386: Save cc_op before loop insns
    
    We forgot to update cc_op before these branch insns,
    which lead to losing track of the current eflags.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1888165
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720154028.477457-1-richard.henderson@linaro.org>
---
 target/i386/translate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/translate.c b/target/i386/translate.c
index a1d31f09c1..caea6f5fb1 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
             l1 = gen_new_label();
             l2 = gen_new_label();
             l3 = gen_new_label();
+            gen_update_cc_op(s);
             b &= 3;
             switch(b) {
             case 0: /* loopnz */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15013.37520 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTJ-0003R2-Ol; Thu, 29 Oct 2020 21:28:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15013.37520; Thu, 29 Oct 2020 21:28:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTJ-0003Qt-Ll; Thu, 29 Oct 2020 21:28:37 +0000
Received: by outflank-mailman (input) for mailman id 15013;
 Thu, 29 Oct 2020 21:28:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFTI-0003Qk-IU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e01bfbad-5bd4-4bce-87c3-05470bb5e7b4;
 Thu, 29 Oct 2020 21:28:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTH-000881-1y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTH-0004OU-0q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFTI-0003Qk-IU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:36 +0000
X-Inumbo-ID: e01bfbad-5bd4-4bce-87c3-05470bb5e7b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e01bfbad-5bd4-4bce-87c3-05470bb5e7b4;
	Thu, 29 Oct 2020 21:28:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+7nwTALdScsfbBpZuFoErDjN+DiUfOJo6k5yS/gRWz4=; b=0mPzA3EJrPfRgI3BDUKQ/EHbCs
	/l4bWfTy9V/1UjDqqCjyT0y3KYcO/S5nYXlTMRHr71mjDSvISkjP5ZaKr3bIRYO0g1lliqtb36eQi
	97GdrcAXhkq0QTj1oBcsD7/nigLwDAqPig5Xr0rIjeeXjY30WQl1cQtYu/VRDV9II4JU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTH-000881-1y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTH-0004OU-0q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200725' into staging
Message-Id: <E1kYFTH-0004OU-0q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:35 +0000

commit 194f8ca825854abef3aceca1ed7eb5a53b08751f
Merge: 57cdde4a74dd0d68df9e32657773484a5484a027 3cb3a7720b01830abd5fbb81819dbb9271bf7821
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 26 17:17:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 26 17:17:58 2020 +0100

    Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200725' into staging
    
    Fix some cputlb commentary
    Fix an hppa temporary leak
    Fix an i386 translation issue with loop insns
    
    # gpg: Signature made Sat 25 Jul 2020 17:03:59 BST
    # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
    # gpg:                issuer "richard.henderson@linaro.org"
    # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
    # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
    
    * remotes/rth/tags/pull-tcg-20200725:
      target/i386: Save cc_op before loop insns
      target/hppa: Free some temps in do_sub
      tcg: update comments for save_iotlb_data in cputlb
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/tcg/cputlb.c      | 11 +++++------
 target/hppa/translate.c |  2 ++
 target/i386/translate.c |  1 +
 3 files changed, 8 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15014.37523 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTT-0003SL-QR; Thu, 29 Oct 2020 21:28:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15014.37523; Thu, 29 Oct 2020 21:28:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTT-0003SF-NL; Thu, 29 Oct 2020 21:28:47 +0000
Received: by outflank-mailman (input) for mailman id 15014;
 Thu, 29 Oct 2020 21:28:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFTS-0003S6-N8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 536e7406-c3b9-4502-94fc-a2de12a0f90b;
 Thu, 29 Oct 2020 21:28:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTR-000889-Cv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTR-0004PN-C1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFTS-0003S6-N8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:46 +0000
X-Inumbo-ID: 536e7406-c3b9-4502-94fc-a2de12a0f90b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 536e7406-c3b9-4502-94fc-a2de12a0f90b;
	Thu, 29 Oct 2020 21:28:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SkTyc+HE9GvOmE6hm2k9X9bFVKjQFuCzi1BU2FDJV3k=; b=ANyZlnTOk0588Sww23iNgPdlg9
	stifM8chgQ2JGQewRfMo9Rx7qJRLJCsnw5Abp7VTRY73cKevL2Y8EmwnbhmoEfQO9YKOryQLhEuqo
	AeoitMEG7mdjLY12bJzCWOBflVweZGuMLuaQi4XTEONCOKIuVrwc1TSPF6yjSkE5UnRE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTR-000889-Cv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTR-0004PN-C1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] pseries: fix kvmppc_set_fwnmi()
Message-Id: <E1kYFTR-0004PN-C1@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:45 +0000

commit aef92d87c59d257c0ff24ba1dc82506a03f1f522
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Fri Jul 24 10:35:33 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 27 11:09:25 2020 +1000

    pseries: fix kvmppc_set_fwnmi()
    
    QEMU issues the ioctl(KVM_CAP_PPC_FWNMI) on the first vCPU.
    
    If the first vCPU is currently running, the vCPU mutex is held
    and the ioctl() cannot be done and waits until the mutex is released.
    This never happens and the VM is stuck.
    
    To avoid this deadlock, issue the ioctl on the same vCPU doing the
    RTAS call.
    
    The problem can be reproduced by booting a guest with several vCPUs
    (the probability to have the problem is (n - 1) / n,  n = # of CPUs),
    and then by triggering a kernel crash with "echo c >/proc/sysrq-trigger".
    
    On the reboot, the kernel hangs after:
    
    ...
    [    0.000000] -----------------------------------------------------
    [    0.000000] ppc64_pft_size    = 0x0
    [    0.000000] phys_mem_size     = 0x48000000
    [    0.000000] dcache_bsize      = 0x80
    [    0.000000] icache_bsize      = 0x80
    [    0.000000] cpu_features      = 0x0001c06f8f4f91a7
    [    0.000000]   possible        = 0x0003fbffcf5fb1a7
    [    0.000000]   always          = 0x00000003800081a1
    [    0.000000] cpu_user_features = 0xdc0065c2 0xaee00000
    [    0.000000] mmu_features      = 0x3c006041
    [    0.000000] firmware_features = 0x00000085455a445f
    [    0.000000] physical_start    = 0x8000000
    [    0.000000] -----------------------------------------------------
    [    0.000000] numa:   NODE_DATA [mem 0x47f33c80-0x47f3ffff]
    
    Fixes: ec010c00665b ("ppc/spapr: KVM FWNMI should not be enabled until guest requests it")
    Cc: npiggin@gmail.com
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-Id: <20200724083533.281700-1-lvivier@redhat.com>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_rtas.c  | 2 +-
 target/ppc/kvm.c     | 3 +--
 target/ppc/kvm_ppc.h | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index bcac0d00e7..513c7a8435 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -438,7 +438,7 @@ static void rtas_ibm_nmi_register(PowerPCCPU *cpu,
     }
 
     if (kvm_enabled()) {
-        if (kvmppc_set_fwnmi() < 0) {
+        if (kvmppc_set_fwnmi(cpu) < 0) {
             rtas_st(rets, 0, RTAS_OUT_NOT_SUPPORTED);
             return;
         }
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 2692f76130..d85ba8ffe0 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2071,9 +2071,8 @@ bool kvmppc_get_fwnmi(void)
     return cap_fwnmi;
 }
 
-int kvmppc_set_fwnmi(void)
+int kvmppc_set_fwnmi(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
     CPUState *cs = CPU(cpu);
 
     return kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_FWNMI, 0);
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index 701c0c262b..72e05f1cd2 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -28,7 +28,7 @@ void kvmppc_set_papr(PowerPCCPU *cpu);
 int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr);
 void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy);
 bool kvmppc_get_fwnmi(void);
-int kvmppc_set_fwnmi(void);
+int kvmppc_set_fwnmi(PowerPCCPU *cpu);
 int kvmppc_smt_threads(void);
 void kvmppc_error_append_smt_possible_hint(Error *const *errp);
 int kvmppc_set_smt_threads(int smt);
@@ -169,7 +169,7 @@ static inline bool kvmppc_get_fwnmi(void)
     return false;
 }
 
-static inline int kvmppc_set_fwnmi(void)
+static inline int kvmppc_set_fwnmi(PowerPCCPU *cpu)
 {
     return -1;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:28:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:28:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15015.37528 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTe-0003Th-Rz; Thu, 29 Oct 2020 21:28:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15015.37528; Thu, 29 Oct 2020 21:28:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTe-0003Ta-P5; Thu, 29 Oct 2020 21:28:58 +0000
Received: by outflank-mailman (input) for mailman id 15015;
 Thu, 29 Oct 2020 21:28:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFTd-0003TR-8Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3b2d8c90-6780-420b-b27f-bd9330952ab5;
 Thu, 29 Oct 2020 21:28:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTb-00088L-Hd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTb-0004Pz-Fq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFTd-0003TR-8Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:57 +0000
X-Inumbo-ID: 3b2d8c90-6780-420b-b27f-bd9330952ab5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3b2d8c90-6780-420b-b27f-bd9330952ab5;
	Thu, 29 Oct 2020 21:28:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qtlgc16bUPLTkLBhvab0F7mtGf9sd0SengdSvBPnPqs=; b=Cm1l1k2z7cmPil61+0jUB2iefv
	1brJXtL7atq/6kC13gKZKL9fRLjDxcBruvbPwHiXIr3obJMrcQDvMAS3JQXjOjzPX+0mjxJsIH/Ql
	HzEHQnJBK2MnXI4WWebBHB34nv/Cmfzyat8DEi87L//eLMZ5K1Daf5mSzRVKyRx4yA1c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTb-00088L-Hd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTb-0004Pz-Fq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:28:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging
Message-Id: <E1kYFTb-0004Pz-Fq@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:28:55 +0000

commit 4215d3413272ad6d1c6c9d0234450b602e46a74c
Merge: 194f8ca825854abef3aceca1ed7eb5a53b08751f aef92d87c59d257c0ff24ba1dc82506a03f1f522
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 09:33:04 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 09:33:04 2020 +0100

    Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging
    
    ppc patch queue 2020-07-27
    
    Only one patch in this batch, but it fixes a fairly important
    regression, so we want it in qemu-5.1
    
    # gpg: Signature made Mon 27 Jul 2020 06:51:57 BST
    # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
    # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
    # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
    # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
    # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
    # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
    
    * remotes/dgibson/tags/ppc-for-5.1-20200727:
      pseries: fix kvmppc_set_fwnmi()
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ppc/spapr_rtas.c  | 2 +-
 target/ppc/kvm.c     | 3 +--
 target/ppc/kvm_ppc.h | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:29:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:29:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15016.37532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTo-0003VM-Tm; Thu, 29 Oct 2020 21:29:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15016.37532; Thu, 29 Oct 2020 21:29:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTo-0003VE-Qf; Thu, 29 Oct 2020 21:29:08 +0000
Received: by outflank-mailman (input) for mailman id 15016;
 Thu, 29 Oct 2020 21:29:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFTn-0003V2-0a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e033ec71-5e95-471d-a992-19129fca2c31;
 Thu, 29 Oct 2020 21:29:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTm-00089M-4V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTm-0004Sd-3l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFTn-0003V2-0a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:07 +0000
X-Inumbo-ID: e033ec71-5e95-471d-a992-19129fca2c31
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e033ec71-5e95-471d-a992-19129fca2c31;
	Thu, 29 Oct 2020 21:29:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Domn2NQQ2EZ9b1Mb+euVvAon0BIz8cySwmcxaO/ydHo=; b=REbKxNy2YVSMUfhGWTNs3yDRS0
	7EmEk3oWspq0HepW8GRheQAdpbZ+ELA84SjA7XwFnFH5TOgzPSUccnW6rKOrjjaxRqm0DyRSnuEZ6
	9Pmf2+9ZiLk08ddO/jM0VySWTNZG4CimiedTDysv7isVecTbpTEncPY9iaxDeoKHPzY0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTm-00089M-4V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTm-0004Sd-3l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] shippable: add one more qemu to registry url
Message-Id: <E1kYFTm-0004Sd-3l@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:06 +0000

commit 3b6b4997b378c4e7685ab7f04491f3077284df4c
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:54 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:39:57 2020 +0100

    shippable: add one more qemu to registry url
    
    The registry url is <project>/<repo>/qemu/<image>
    
    Perhaps we should rationalise that some day but for now.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200724064509.331-2-alex.bennee@linaro.org>
---
 .shippable.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.shippable.yml b/.shippable.yml
index f6b742432e..89d8be4291 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -27,7 +27,7 @@ env:
       TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
 build:
   pre_ci_boot:
-    image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE}
+    image_name: registry.gitlab.com/qemu-project/qemu/qemu/${IMAGE}
     image_tag: latest
     pull: true
     options: "-e HOME=/root"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:29:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:29:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15017.37536 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTy-0003Wd-Vi; Thu, 29 Oct 2020 21:29:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15017.37536; Thu, 29 Oct 2020 21:29:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFTy-0003WV-SK; Thu, 29 Oct 2020 21:29:18 +0000
Received: by outflank-mailman (input) for mailman id 15017;
 Thu, 29 Oct 2020 21:29:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFTx-0003WK-PG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a77a0e00-308f-4508-8fc8-9a97351876ac;
 Thu, 29 Oct 2020 21:29:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTw-00089U-8Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFTw-0004TD-7S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFTx-0003WK-PG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:17 +0000
X-Inumbo-ID: a77a0e00-308f-4508-8fc8-9a97351876ac
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a77a0e00-308f-4508-8fc8-9a97351876ac;
	Thu, 29 Oct 2020 21:29:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MJBMrmkGfS6vq4zUJs7GRg37P2mn151G/hOJ9Ls3gY4=; b=YZ7XL1h5p2vw4MldvaQO5HPS1p
	iWnAl0LGlzqKkI+mjCh26o+U1dRVBTxEv3Jn/Kl3nwsNHbJjTIscrGbsOivj06GWoBu26c6W4B68q
	S6eO7RNdUtbB3CUsrZgbZ/u/6HprBbF0oSY9mGaoEn/Hf0l2PAGQocTjm1lb2uYO8+OA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTw-00089U-8Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFTw-0004TD-7S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] semihosting: defer connect_chardevs a little more to use serialx
Message-Id: <E1kYFTw-0004TD-7S@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:16 +0000

commit 619985e937c2f6a61ae7d52ae4e9973c83387dce
Author:     KONRAD Frederic <frederic.konrad@adacore.com>
AuthorDate: Fri Jul 24 07:44:55 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:03 2020 +0100

    semihosting: defer connect_chardevs a little more to use serialx
    
    With that we can just use -semihosting-config chardev=serial0.
    
    [AJB: tweak commit message]
    
    Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <1592215252-26742-1-git-send-email-frederic.konrad@adacore.com>
    Message-Id: <20200724064509.331-3-alex.bennee@linaro.org>
---
 softmmu/vl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 660537a709..4eb9d1f7fd 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4127,8 +4127,6 @@ void qemu_init(int argc, char **argv, char **envp)
 
     qemu_opts_foreach(qemu_find_opts("chardev"),
                       chardev_init_func, NULL, &error_fatal);
-    /* now chardevs have been created we may have semihosting to connect */
-    qemu_semihosting_connect_chardevs();
 
 #ifdef CONFIG_VIRTFS
     qemu_opts_foreach(qemu_find_opts("fsdev"),
@@ -4279,6 +4277,9 @@ void qemu_init(int argc, char **argv, char **envp)
     if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
         exit(1);
 
+    /* now chardevs have been created we may have semihosting to connect */
+    qemu_semihosting_connect_chardevs();
+
     /* If no default VGA is requested, the default is "none".  */
     if (default_vga) {
         vga_model = get_default_vga_model(machine_class);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:29:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:29:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15018.37540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFU9-0003Y7-2g; Thu, 29 Oct 2020 21:29:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15018.37540; Thu, 29 Oct 2020 21:29:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFU8-0003Xz-Vp; Thu, 29 Oct 2020 21:29:28 +0000
Received: by outflank-mailman (input) for mailman id 15018;
 Thu, 29 Oct 2020 21:29:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFU7-0003Xo-2p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3cca7093-e3dd-44a7-8c82-4c6905a5a6ce;
 Thu, 29 Oct 2020 21:29:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFU6-00089f-C8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFU6-0004Tn-BN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFU7-0003Xo-2p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:27 +0000
X-Inumbo-ID: 3cca7093-e3dd-44a7-8c82-4c6905a5a6ce
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3cca7093-e3dd-44a7-8c82-4c6905a5a6ce;
	Thu, 29 Oct 2020 21:29:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yy7SJhoF0c/+HKLRjpmV04r56K0q8M5MFSVScwYF740=; b=HGGKDwqsJ6VdQeURd+7ypzkx4z
	dShYBIYq7b08zEJnDSHQqfVafQCA8PWgcCZtxlLdKg/NzIfsHzusmlBlXxhQ9v0mI77ZaRnrUbDCB
	GW9PH+o93IKxorHVZvTfCzPMoQmD2Vamktsl8evYRPkBWnAvU26Ky4aWObiGNo2M5d/o=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFU6-00089f-C8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFU6-0004Tn-BN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] semihosting: don't send the trailing '\0'
Message-Id: <E1kYFU6-0004Tn-BN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:26 +0000

commit 7d2d6522bbadfa8d9877e38bfa7413444fa64fbb
Author:     KONRAD Frederic <frederic.konrad@adacore.com>
AuthorDate: Fri Jul 24 07:44:56 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:08 2020 +0100

    semihosting: don't send the trailing '\0'
    
    Don't send the trailing 0 from the string.
    
    Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <1592215252-26742-2-git-send-email-frederic.konrad@adacore.com>
    Message-Id: <20200724064509.331-4-alex.bennee@linaro.org>
---
 hw/semihosting/console.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c
index 22e7827824..9b4fee9260 100644
--- a/hw/semihosting/console.c
+++ b/hw/semihosting/console.c
@@ -52,7 +52,9 @@ static GString *copy_user_string(CPUArchState *env, target_ulong addr)
 
     do {
         if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) == 0) {
-            s = g_string_append_c(s, c);
+            if (c) {
+                s = g_string_append_c(s, c);
+            }
         } else {
             qemu_log_mask(LOG_GUEST_ERROR,
                           "%s: passed inaccessible address " TARGET_FMT_lx,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:29:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:29:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15019.37544 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUJ-0003ZL-45; Thu, 29 Oct 2020 21:29:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15019.37544; Thu, 29 Oct 2020 21:29:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUJ-0003ZD-1C; Thu, 29 Oct 2020 21:29:39 +0000
Received: by outflank-mailman (input) for mailman id 15019;
 Thu, 29 Oct 2020 21:29:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFUH-0003Z3-AF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fb597455-693c-4323-9365-63302e26e083;
 Thu, 29 Oct 2020 21:29:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUG-00089o-Ff
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUG-0004UL-Ey
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFUH-0003Z3-AF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:37 +0000
X-Inumbo-ID: fb597455-693c-4323-9365-63302e26e083
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fb597455-693c-4323-9365-63302e26e083;
	Thu, 29 Oct 2020 21:29:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y8/70q3CRSe1f0SnlOncxcrJvXEf+InoHJ5h/AjzPRA=; b=w8RM/f8HgPheiEgIAiQfBsdV/3
	DSnjP8AiLZV56KPaA/JUkHVuRLIhGMd0pbw2VLVTimpfQLZWwWIk+yBOxBtuxwC6xl434rjrwONUl
	AF5yQtyMRewFlAKEm+j06+I5rWhYpHaUCqpII8v8UaeqNJQikeh0zC7sxdLtVgFPf9os=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUG-00089o-Ff
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUG-0004UL-Ey
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] util: add qemu_get_host_physmem utility function
Message-Id: <E1kYFUG-0004UL-Ey@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:36 +0000

commit ad06ef0efbf7cafba5074a183fef1ad586f38caa
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:57 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:12 2020 +0100

    util: add qemu_get_host_physmem utility function
    
    This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES
    isn't standardised but at least appears in the man pages for
    Open/FreeBSD. The result is advisory so any users of it shouldn't just
    fail if we can't work it out.
    
    The win32 stub currently returns 0 until someone with a Windows system
    can develop and test a patch.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Cc: BALATON Zoltan <balaton@eik.bme.hu>
    Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Message-Id: <20200724064509.331-5-alex.bennee@linaro.org>
---
 include/qemu/osdep.h | 12 ++++++++++++
 util/oslib-posix.c   | 15 +++++++++++++++
 util/oslib-win32.c   |  6 ++++++
 3 files changed, 33 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 45c217aa28..0b1298b3c9 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -668,4 +668,16 @@ static inline void qemu_reset_optind(void)
  */
 char *qemu_get_host_name(Error **errp);
 
+/**
+ * qemu_get_host_physmem:
+ *
+ * Operating system agnostic way of querying host memory.
+ *
+ * Returns amount of physical memory on the system. This is purely
+ * advisery and may return 0 if we can't work it out. At the other
+ * end we saturate to SIZE_MAX if you are lucky enough to have that
+ * much memory.
+ */
+size_t qemu_get_host_physmem(void);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index d923674624..ad8001a4ad 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -841,3 +841,18 @@ char *qemu_get_host_name(Error **errp)
 
     return g_steal_pointer(&hostname);
 }
+
+size_t qemu_get_host_physmem(void)
+{
+#ifdef _SC_PHYS_PAGES
+    long pages = sysconf(_SC_PHYS_PAGES);
+    if (pages > 0) {
+        if (pages > SIZE_MAX / qemu_real_host_page_size) {
+            return SIZE_MAX;
+        } else {
+            return pages * qemu_real_host_page_size;
+        }
+    }
+#endif
+    return 0;
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 7eedbe5859..31030463cc 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -828,3 +828,9 @@ char *qemu_get_host_name(Error **errp)
 
     return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
 }
+
+size_t qemu_get_host_physmem(void)
+{
+    /* currently unimplemented */
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:29:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:29:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15020.37548 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUS-0003aX-5f; Thu, 29 Oct 2020 21:29:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15020.37548; Thu, 29 Oct 2020 21:29:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUS-0003aP-2i; Thu, 29 Oct 2020 21:29:48 +0000
Received: by outflank-mailman (input) for mailman id 15020;
 Thu, 29 Oct 2020 21:29:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFUR-0003aI-OV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id bbdc2482-0fc8-46d7-a42c-bba1effb4320;
 Thu, 29 Oct 2020 21:29:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUQ-00089w-Jw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUQ-0004V2-IS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFUR-0003aI-OV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:47 +0000
X-Inumbo-ID: bbdc2482-0fc8-46d7-a42c-bba1effb4320
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id bbdc2482-0fc8-46d7-a42c-bba1effb4320;
	Thu, 29 Oct 2020 21:29:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3jI+9NIU9PSQX999IqBTTBE2smQKh2NKo0AfTpq8V68=; b=bP+MeP4dWxtTZaZlwOU2dXZK7y
	eB3HxPaPTid2Kt0ifBeSpltK++mB3XgmVH7reoJti5Ql/ycYC82hiqj92x6tnNWAxrvQ6UZePJvAr
	E+3n8zIM1QRpUfWccIwO5nSaJUC3jyARmnbW43tCchd3SWIy+XfqMk0LSAqupcs0vWAw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUQ-00089w-Jw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUQ-0004V2-IS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] util/oslib-win32: add qemu_get_host_physmem implementation
Message-Id: <E1kYFUQ-0004V2-IS@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:46 +0000

commit 986babaab30279a4962648d03730bf1291d89f93
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:58 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    util/oslib-win32: add qemu_get_host_physmem implementation
    
    Compile tested only.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Message-Id: <20200724064509.331-6-alex.bennee@linaro.org>
---
 util/oslib-win32.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 31030463cc..c654dafd93 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -831,6 +831,11 @@ char *qemu_get_host_name(Error **errp)
 
 size_t qemu_get_host_physmem(void)
 {
-    /* currently unimplemented */
+    MEMORYSTATUSEX statex;
+    statex.dwLength = sizeof(statex);
+
+    if (GlobalMemoryStatusEx(&statex)) {
+        return statex.ullTotalPhys;
+    }
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15021.37552 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUd-0003bm-75; Thu, 29 Oct 2020 21:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15021.37552; Thu, 29 Oct 2020 21:29:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUd-0003be-4E; Thu, 29 Oct 2020 21:29:59 +0000
Received: by outflank-mailman (input) for mailman id 15021;
 Thu, 29 Oct 2020 21:29:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFUc-0003bV-4x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1e4d47b0-1cc8-42b6-8f11-29d86c21287f;
 Thu, 29 Oct 2020 21:29:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUa-0008A4-NX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUa-0004Vc-Mm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFUc-0003bV-4x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:58 +0000
X-Inumbo-ID: 1e4d47b0-1cc8-42b6-8f11-29d86c21287f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1e4d47b0-1cc8-42b6-8f11-29d86c21287f;
	Thu, 29 Oct 2020 21:29:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ztRZhfhr9IO9z47ZEmu2CIFiwxxr8+iN5sYSPcwRcyM=; b=pb3hcsNhACNIoaHpCLvWBOjr/l
	ME9Dr1r4wYsQNx090SDF8UW8dF59qRc5FyFz8/JxQbTZq+kx6KqahKE6Yz5zcJ63pfrn4h+1paHt4
	q+PXdodruwFooJDr2dAtscD/3jBB5V5wqPYOIub2jHXjNj/OwUTA8TOV20bAVoZuGV54=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUa-0008A4-NX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUa-0004Vc-Mm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:29:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] accel/tcg: better handle memory constrained systems
Message-Id: <E1kYFUa-0004Vc-Mm@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:29:56 +0000

commit c83d628b7fba050e59ccf7bda050bc27af241b61
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:59 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    accel/tcg: better handle memory constrained systems
    
    It turns out there are some 64 bit systems that have relatively low
    amounts of physical memory available to them (typically CI system).
    Even with swapping available a 1GB translation buffer that fills up
    can put the machine under increased memory pressure. Detect these low
    memory situations and reduce tb_size appropriately.
    
    Fixes: 600e17b2615 ("accel/tcg: increase default code gen buffer size for 64 bit")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Robert Foley <robert.foley@linaro.org>
    Cc: BALATON Zoltan <balaton@eik.bme.hu>
    Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Message-Id: <20200724064509.331-7-alex.bennee@linaro.org>
---
 accel/tcg/translate-all.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 2afa46bd2b..2d83013633 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -976,7 +976,12 @@ static inline size_t size_code_gen_buffer(size_t tb_size)
 {
     /* Size the buffer.  */
     if (tb_size == 0) {
-        tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
+        size_t phys_mem = qemu_get_host_physmem();
+        if (phys_mem == 0) {
+            tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
+        } else {
+            tb_size = MIN(DEFAULT_CODE_GEN_BUFFER_SIZE, phys_mem / 8);
+        }
     }
     if (tb_size < MIN_CODE_GEN_BUFFER_SIZE) {
         tb_size = MIN_CODE_GEN_BUFFER_SIZE;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15023.37568 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUo-0004Jq-Gc; Thu, 29 Oct 2020 21:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15023.37568; Thu, 29 Oct 2020 21:30:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUo-0004Ji-DN; Thu, 29 Oct 2020 21:30:10 +0000
Received: by outflank-mailman (input) for mailman id 15023;
 Thu, 29 Oct 2020 21:30:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFUm-0004Ez-VL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c9a54f30-a02d-4e6a-af59-0328fbd3f057;
 Thu, 29 Oct 2020 21:30:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUk-0008B1-SM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUk-0004WM-QU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFUm-0004Ez-VL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:09 +0000
X-Inumbo-ID: c9a54f30-a02d-4e6a-af59-0328fbd3f057
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c9a54f30-a02d-4e6a-af59-0328fbd3f057;
	Thu, 29 Oct 2020 21:30:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1tOBPUnauWq2+ZpYMd1OfEmfcWhXck4ZfVQgm28Eba4=; b=EeOyblEbY1Imq1UzOaIgb/SFOr
	TFb9Z+oE+pylKWqKLOlR+xS9zccT67S8bKtX4qn1h5tzUCGrMW+T2yeWJrAh7q2yx1KM3N1JO3RLn
	KaG+7TCZZewEYizZuNgM4wMByerR+sppyXLsX7iQhB/UkdbymngUEG+KrJUQwDJ9dUvc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUk-0008B1-SM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUk-0004WM-QU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/i386: floatx80: avoid compound literals in static initializers
Message-Id: <E1kYFUk-0004WM-QU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:06 +0000

commit 163b3d1af2552845a60967979aca8d78a6b1b088
Author:     Laszlo Ersek <lersek@redhat.com>
AuthorDate: Fri Jul 24 07:45:00 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    target/i386: floatx80: avoid compound literals in static initializers
    
    Quoting ISO C99 6.7.8p4, "All the expressions in an initializer for an
    object that has static storage duration shall be constant expressions or
    string literals".
    
    The compound literal produced by the make_floatx80() macro is not such a
    constant expression, per 6.6p7-9. (An implementation may accept it,
    according to 6.6p10, but is not required to.)
    
    Therefore using "floatx80_zero" and make_floatx80() for initializing
    "f2xm1_table" and "fpatan_table" is not portable. And gcc-4.8 in RHEL-7.6
    actually chokes on them:
    
    > target/i386/fpu_helper.c:871:5: error: initializer element is not constant
    >      { make_floatx80(0xbfff, 0x8000000000000000ULL),
    >      ^
    
    We've had the make_floatx80_init() macro for this purpose since commit
    3bf7e40ab914 ("softfloat: fix for C99", 2012-03-17), so let's use that
    macro again.
    
    Fixes: eca30647fc0 ("target/i386: reimplement f2xm1 using floatx80 operations")
    Fixes: ff57bb7b632 ("target/i386: reimplement fpatan using floatx80 operations")
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Cc: Aurelien Jarno <aurelien@aurel32.net>
    Cc: Eduardo Habkost <ehabkost@redhat.com>
    Cc: Joseph Myers <joseph@codesourcery.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Link: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg06566.html
    Link: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04714.html
    Message-Id: <20200716144251.23004-1-lersek@redhat.com>
    Message-Id: <20200724064509.331-8-alex.bennee@linaro.org>
---
 include/fpu/softfloat.h  |   1 +
 target/i386/fpu_helper.c | 426 +++++++++++++++++++++++------------------------
 2 files changed, 214 insertions(+), 213 deletions(-)

diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index f1a19df066..659218b5c7 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -822,6 +822,7 @@ static inline bool floatx80_invalid_encoding(floatx80 a)
 }
 
 #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL)
+#define floatx80_zero_init make_floatx80_init(0x0000, 0x0000000000000000LL)
 #define floatx80_one make_floatx80(0x3fff, 0x8000000000000000LL)
 #define floatx80_ln2 make_floatx80(0x3ffe, 0xb17217f7d1cf79acLL)
 #define floatx80_pi make_floatx80(0x4000, 0xc90fdaa22168c235LL)
diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c
index f5e6c4b88d..4ea73874d8 100644
--- a/target/i386/fpu_helper.c
+++ b/target/i386/fpu_helper.c
@@ -868,201 +868,201 @@ struct f2xm1_data {
 };
 
 static const struct f2xm1_data f2xm1_table[65] = {
-    { make_floatx80(0xbfff, 0x8000000000000000ULL),
-      make_floatx80(0x3ffe, 0x8000000000000000ULL),
-      make_floatx80(0xbffe, 0x8000000000000000ULL) },
-    { make_floatx80(0xbffe, 0xf800000000002e7eULL),
-      make_floatx80(0x3ffe, 0x82cd8698ac2b9160ULL),
-      make_floatx80(0xbffd, 0xfa64f2cea7a8dd40ULL) },
-    { make_floatx80(0xbffe, 0xefffffffffffe960ULL),
-      make_floatx80(0x3ffe, 0x85aac367cc488345ULL),
-      make_floatx80(0xbffd, 0xf4aa7930676ef976ULL) },
-    { make_floatx80(0xbffe, 0xe800000000006f10ULL),
-      make_floatx80(0x3ffe, 0x88980e8092da5c14ULL),
-      make_floatx80(0xbffd, 0xeecfe2feda4b47d8ULL) },
-    { make_floatx80(0xbffe, 0xe000000000008a45ULL),
-      make_floatx80(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
-      make_floatx80(0xbffd, 0xe8d47c382ae8bab6ULL) },
-    { make_floatx80(0xbffe, 0xd7ffffffffff8a9eULL),
-      make_floatx80(0x3ffe, 0x8ea4398b45cd8116ULL),
-      make_floatx80(0xbffd, 0xe2b78ce97464fdd4ULL) },
-    { make_floatx80(0xbffe, 0xd0000000000019a0ULL),
-      make_floatx80(0x3ffe, 0x91c3d373ab11b919ULL),
-      make_floatx80(0xbffd, 0xdc785918a9dc8dceULL) },
-    { make_floatx80(0xbffe, 0xc7ffffffffff14dfULL),
-      make_floatx80(0x3ffe, 0x94f4efa8fef76836ULL),
-      make_floatx80(0xbffd, 0xd61620ae02112f94ULL) },
-    { make_floatx80(0xbffe, 0xc000000000006530ULL),
-      make_floatx80(0x3ffe, 0x9837f0518db87fbbULL),
-      make_floatx80(0xbffd, 0xcf901f5ce48f008aULL) },
-    { make_floatx80(0xbffe, 0xb7ffffffffff1723ULL),
-      make_floatx80(0x3ffe, 0x9b8d39b9d54eb74cULL),
-      make_floatx80(0xbffd, 0xc8e58c8c55629168ULL) },
-    { make_floatx80(0xbffe, 0xb00000000000b5e1ULL),
-      make_floatx80(0x3ffe, 0x9ef5326091a0c366ULL),
-      make_floatx80(0xbffd, 0xc2159b3edcbe7934ULL) },
-    { make_floatx80(0xbffe, 0xa800000000006f8aULL),
-      make_floatx80(0x3ffe, 0xa27043030c49370aULL),
-      make_floatx80(0xbffd, 0xbb1f79f9e76d91ecULL) },
-    { make_floatx80(0xbffe, 0x9fffffffffff816aULL),
-      make_floatx80(0x3ffe, 0xa5fed6a9b15171cfULL),
-      make_floatx80(0xbffd, 0xb40252ac9d5d1c62ULL) },
-    { make_floatx80(0xbffe, 0x97ffffffffffb621ULL),
-      make_floatx80(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
-      make_floatx80(0xbffd, 0xacbd4a962b079e34ULL) },
-    { make_floatx80(0xbffe, 0x8fffffffffff162bULL),
-      make_floatx80(0x3ffe, 0xad583eea42a1b886ULL),
-      make_floatx80(0xbffd, 0xa54f822b7abc8ef4ULL) },
-    { make_floatx80(0xbffe, 0x87ffffffffff4d34ULL),
-      make_floatx80(0x3ffe, 0xb123f581d2ac7b51ULL),
-      make_floatx80(0xbffd, 0x9db814fc5aa7095eULL) },
-    { make_floatx80(0xbffe, 0x800000000000227dULL),
-      make_floatx80(0x3ffe, 0xb504f333f9de539dULL),
-      make_floatx80(0xbffd, 0x95f619980c4358c6ULL) },
-    { make_floatx80(0xbffd, 0xefffffffffff3978ULL),
-      make_floatx80(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
-      make_floatx80(0xbffd, 0x8e08a1713a085ebeULL) },
-    { make_floatx80(0xbffd, 0xe00000000000df81ULL),
-      make_floatx80(0x3ffe, 0xbd08a39f580bfd8cULL),
-      make_floatx80(0xbffd, 0x85eeb8c14fe804e8ULL) },
-    { make_floatx80(0xbffd, 0xd00000000000bccfULL),
-      make_floatx80(0x3ffe, 0xc12c4cca667062f6ULL),
-      make_floatx80(0xbffc, 0xfb4eccd6663e7428ULL) },
-    { make_floatx80(0xbffd, 0xc00000000000eff0ULL),
-      make_floatx80(0x3ffe, 0xc5672a1155069abeULL),
-      make_floatx80(0xbffc, 0xea6357baabe59508ULL) },
-    { make_floatx80(0xbffd, 0xb000000000000fe6ULL),
-      make_floatx80(0x3ffe, 0xc9b9bd866e2f234bULL),
-      make_floatx80(0xbffc, 0xd91909e6474372d4ULL) },
-    { make_floatx80(0xbffd, 0x9fffffffffff2172ULL),
-      make_floatx80(0x3ffe, 0xce248c151f84bf00ULL),
-      make_floatx80(0xbffc, 0xc76dcfab81ed0400ULL) },
-    { make_floatx80(0xbffd, 0x8fffffffffffafffULL),
-      make_floatx80(0x3ffe, 0xd2a81d91f12afb2bULL),
-      make_floatx80(0xbffc, 0xb55f89b83b541354ULL) },
-    { make_floatx80(0xbffc, 0xffffffffffff81a3ULL),
-      make_floatx80(0x3ffe, 0xd744fccad69d7d5eULL),
-      make_floatx80(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
-    { make_floatx80(0xbffc, 0xdfffffffffff1568ULL),
-      make_floatx80(0x3ffe, 0xdbfbb797daf25a44ULL),
-      make_floatx80(0xbffc, 0x901121a0943696f0ULL) },
-    { make_floatx80(0xbffc, 0xbfffffffffff68daULL),
-      make_floatx80(0x3ffe, 0xe0ccdeec2a94f811ULL),
-      make_floatx80(0xbffb, 0xf999089eab583f78ULL) },
-    { make_floatx80(0xbffc, 0x9fffffffffff4690ULL),
-      make_floatx80(0x3ffe, 0xe5b906e77c83657eULL),
-      make_floatx80(0xbffb, 0xd237c8c41be4d410ULL) },
-    { make_floatx80(0xbffb, 0xffffffffffff8aeeULL),
-      make_floatx80(0x3ffe, 0xeac0c6e7dd24427cULL),
-      make_floatx80(0xbffb, 0xa9f9c8c116ddec20ULL) },
-    { make_floatx80(0xbffb, 0xbfffffffffff2d18ULL),
-      make_floatx80(0x3ffe, 0xefe4b99bdcdb06ebULL),
-      make_floatx80(0xbffb, 0x80da33211927c8a8ULL) },
-    { make_floatx80(0xbffa, 0xffffffffffff8ccbULL),
-      make_floatx80(0x3ffe, 0xf5257d152486d0f4ULL),
-      make_floatx80(0xbffa, 0xada82eadb792f0c0ULL) },
-    { make_floatx80(0xbff9, 0xffffffffffff11feULL),
-      make_floatx80(0x3ffe, 0xfa83b2db722a0846ULL),
-      make_floatx80(0xbff9, 0xaf89a491babef740ULL) },
-    { floatx80_zero,
-      make_floatx80(0x3fff, 0x8000000000000000ULL),
-      floatx80_zero },
-    { make_floatx80(0x3ff9, 0xffffffffffff2680ULL),
-      make_floatx80(0x3fff, 0x82cd8698ac2b9f6fULL),
-      make_floatx80(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
-    { make_floatx80(0x3ffb, 0x800000000000b500ULL),
-      make_floatx80(0x3fff, 0x85aac367cc488345ULL),
-      make_floatx80(0x3ffa, 0xb5586cf9891068a0ULL) },
-    { make_floatx80(0x3ffb, 0xbfffffffffff4b67ULL),
-      make_floatx80(0x3fff, 0x88980e8092da7cceULL),
-      make_floatx80(0x3ffb, 0x8980e8092da7cce0ULL) },
-    { make_floatx80(0x3ffb, 0xffffffffffffff57ULL),
-      make_floatx80(0x3fff, 0x8b95c1e3ea8bd6dfULL),
-      make_floatx80(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
-    { make_floatx80(0x3ffc, 0x9fffffffffff811fULL),
-      make_floatx80(0x3fff, 0x8ea4398b45cd4780ULL),
-      make_floatx80(0x3ffb, 0xea4398b45cd47800ULL) },
-    { make_floatx80(0x3ffc, 0xbfffffffffff9980ULL),
-      make_floatx80(0x3fff, 0x91c3d373ab11b919ULL),
-      make_floatx80(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
-    { make_floatx80(0x3ffc, 0xdffffffffffff631ULL),
-      make_floatx80(0x3fff, 0x94f4efa8fef70864ULL),
-      make_floatx80(0x3ffc, 0xa7a77d47f7b84320ULL) },
-    { make_floatx80(0x3ffc, 0xffffffffffff2499ULL),
-      make_floatx80(0x3fff, 0x9837f0518db892d4ULL),
-      make_floatx80(0x3ffc, 0xc1bf828c6dc496a0ULL) },
-    { make_floatx80(0x3ffd, 0x8fffffffffff80fbULL),
-      make_floatx80(0x3fff, 0x9b8d39b9d54e3a79ULL),
-      make_floatx80(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
-    { make_floatx80(0x3ffd, 0x9fffffffffffbc23ULL),
-      make_floatx80(0x3fff, 0x9ef5326091a10313ULL),
-      make_floatx80(0x3ffc, 0xf7a993048d081898ULL) },
-    { make_floatx80(0x3ffd, 0xafffffffffff20ecULL),
-      make_floatx80(0x3fff, 0xa27043030c49370aULL),
-      make_floatx80(0x3ffd, 0x89c10c0c3124dc28ULL) },
-    { make_floatx80(0x3ffd, 0xc00000000000fd2cULL),
-      make_floatx80(0x3fff, 0xa5fed6a9b15171cfULL),
-      make_floatx80(0x3ffd, 0x97fb5aa6c545c73cULL) },
-    { make_floatx80(0x3ffd, 0xd0000000000093beULL),
-      make_floatx80(0x3fff, 0xa9a15ab4ea7c30e6ULL),
-      make_floatx80(0x3ffd, 0xa6856ad3a9f0c398ULL) },
-    { make_floatx80(0x3ffd, 0xe00000000000c2aeULL),
-      make_floatx80(0x3fff, 0xad583eea42a17876ULL),
-      make_floatx80(0x3ffd, 0xb560fba90a85e1d8ULL) },
-    { make_floatx80(0x3ffd, 0xefffffffffff1e3fULL),
-      make_floatx80(0x3fff, 0xb123f581d2abef6cULL),
-      make_floatx80(0x3ffd, 0xc48fd6074aafbdb0ULL) },
-    { make_floatx80(0x3ffd, 0xffffffffffff1c23ULL),
-      make_floatx80(0x3fff, 0xb504f333f9de2cadULL),
-      make_floatx80(0x3ffd, 0xd413cccfe778b2b4ULL) },
-    { make_floatx80(0x3ffe, 0x8800000000006344ULL),
-      make_floatx80(0x3fff, 0xb8fbaf4762fbd0a1ULL),
-      make_floatx80(0x3ffd, 0xe3eebd1d8bef4284ULL) },
-    { make_floatx80(0x3ffe, 0x9000000000005d67ULL),
-      make_floatx80(0x3fff, 0xbd08a39f580c668dULL),
-      make_floatx80(0x3ffd, 0xf4228e7d60319a34ULL) },
-    { make_floatx80(0x3ffe, 0x9800000000009127ULL),
-      make_floatx80(0x3fff, 0xc12c4cca6670e042ULL),
-      make_floatx80(0x3ffe, 0x82589994cce1c084ULL) },
-    { make_floatx80(0x3ffe, 0x9fffffffffff06f9ULL),
-      make_floatx80(0x3fff, 0xc5672a11550655c3ULL),
-      make_floatx80(0x3ffe, 0x8ace5422aa0cab86ULL) },
-    { make_floatx80(0x3ffe, 0xa7fffffffffff80dULL),
-      make_floatx80(0x3fff, 0xc9b9bd866e2f234bULL),
-      make_floatx80(0x3ffe, 0x93737b0cdc5e4696ULL) },
-    { make_floatx80(0x3ffe, 0xafffffffffff1470ULL),
-      make_floatx80(0x3fff, 0xce248c151f83fd69ULL),
-      make_floatx80(0x3ffe, 0x9c49182a3f07fad2ULL) },
-    { make_floatx80(0x3ffe, 0xb800000000000e0aULL),
-      make_floatx80(0x3fff, 0xd2a81d91f12aec5cULL),
-      make_floatx80(0x3ffe, 0xa5503b23e255d8b8ULL) },
-    { make_floatx80(0x3ffe, 0xc00000000000b7faULL),
-      make_floatx80(0x3fff, 0xd744fccad69dd630ULL),
-      make_floatx80(0x3ffe, 0xae89f995ad3bac60ULL) },
-    { make_floatx80(0x3ffe, 0xc800000000003aa6ULL),
-      make_floatx80(0x3fff, 0xdbfbb797daf25a44ULL),
-      make_floatx80(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
-    { make_floatx80(0x3ffe, 0xd00000000000a6aeULL),
-      make_floatx80(0x3fff, 0xe0ccdeec2a954685ULL),
-      make_floatx80(0x3ffe, 0xc199bdd8552a8d0aULL) },
-    { make_floatx80(0x3ffe, 0xd800000000004165ULL),
-      make_floatx80(0x3fff, 0xe5b906e77c837155ULL),
-      make_floatx80(0x3ffe, 0xcb720dcef906e2aaULL) },
-    { make_floatx80(0x3ffe, 0xe00000000000582cULL),
-      make_floatx80(0x3fff, 0xeac0c6e7dd24713aULL),
-      make_floatx80(0x3ffe, 0xd5818dcfba48e274ULL) },
-    { make_floatx80(0x3ffe, 0xe800000000001a5dULL),
-      make_floatx80(0x3fff, 0xefe4b99bdcdb06ebULL),
-      make_floatx80(0x3ffe, 0xdfc97337b9b60dd6ULL) },
-    { make_floatx80(0x3ffe, 0xefffffffffffc1efULL),
-      make_floatx80(0x3fff, 0xf5257d152486a2faULL),
-      make_floatx80(0x3ffe, 0xea4afa2a490d45f4ULL) },
-    { make_floatx80(0x3ffe, 0xf800000000001069ULL),
-      make_floatx80(0x3fff, 0xfa83b2db722a0e5cULL),
-      make_floatx80(0x3ffe, 0xf50765b6e4541cb8ULL) },
-    { make_floatx80(0x3fff, 0x8000000000000000ULL),
-      make_floatx80(0x4000, 0x8000000000000000ULL),
-      make_floatx80(0x3fff, 0x8000000000000000ULL) },
+    { make_floatx80_init(0xbfff, 0x8000000000000000ULL),
+      make_floatx80_init(0x3ffe, 0x8000000000000000ULL),
+      make_floatx80_init(0xbffe, 0x8000000000000000ULL) },
+    { make_floatx80_init(0xbffe, 0xf800000000002e7eULL),
+      make_floatx80_init(0x3ffe, 0x82cd8698ac2b9160ULL),
+      make_floatx80_init(0xbffd, 0xfa64f2cea7a8dd40ULL) },
+    { make_floatx80_init(0xbffe, 0xefffffffffffe960ULL),
+      make_floatx80_init(0x3ffe, 0x85aac367cc488345ULL),
+      make_floatx80_init(0xbffd, 0xf4aa7930676ef976ULL) },
+    { make_floatx80_init(0xbffe, 0xe800000000006f10ULL),
+      make_floatx80_init(0x3ffe, 0x88980e8092da5c14ULL),
+      make_floatx80_init(0xbffd, 0xeecfe2feda4b47d8ULL) },
+    { make_floatx80_init(0xbffe, 0xe000000000008a45ULL),
+      make_floatx80_init(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
+      make_floatx80_init(0xbffd, 0xe8d47c382ae8bab6ULL) },
+    { make_floatx80_init(0xbffe, 0xd7ffffffffff8a9eULL),
+      make_floatx80_init(0x3ffe, 0x8ea4398b45cd8116ULL),
+      make_floatx80_init(0xbffd, 0xe2b78ce97464fdd4ULL) },
+    { make_floatx80_init(0xbffe, 0xd0000000000019a0ULL),
+      make_floatx80_init(0x3ffe, 0x91c3d373ab11b919ULL),
+      make_floatx80_init(0xbffd, 0xdc785918a9dc8dceULL) },
+    { make_floatx80_init(0xbffe, 0xc7ffffffffff14dfULL),
+      make_floatx80_init(0x3ffe, 0x94f4efa8fef76836ULL),
+      make_floatx80_init(0xbffd, 0xd61620ae02112f94ULL) },
+    { make_floatx80_init(0xbffe, 0xc000000000006530ULL),
+      make_floatx80_init(0x3ffe, 0x9837f0518db87fbbULL),
+      make_floatx80_init(0xbffd, 0xcf901f5ce48f008aULL) },
+    { make_floatx80_init(0xbffe, 0xb7ffffffffff1723ULL),
+      make_floatx80_init(0x3ffe, 0x9b8d39b9d54eb74cULL),
+      make_floatx80_init(0xbffd, 0xc8e58c8c55629168ULL) },
+    { make_floatx80_init(0xbffe, 0xb00000000000b5e1ULL),
+      make_floatx80_init(0x3ffe, 0x9ef5326091a0c366ULL),
+      make_floatx80_init(0xbffd, 0xc2159b3edcbe7934ULL) },
+    { make_floatx80_init(0xbffe, 0xa800000000006f8aULL),
+      make_floatx80_init(0x3ffe, 0xa27043030c49370aULL),
+      make_floatx80_init(0xbffd, 0xbb1f79f9e76d91ecULL) },
+    { make_floatx80_init(0xbffe, 0x9fffffffffff816aULL),
+      make_floatx80_init(0x3ffe, 0xa5fed6a9b15171cfULL),
+      make_floatx80_init(0xbffd, 0xb40252ac9d5d1c62ULL) },
+    { make_floatx80_init(0xbffe, 0x97ffffffffffb621ULL),
+      make_floatx80_init(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
+      make_floatx80_init(0xbffd, 0xacbd4a962b079e34ULL) },
+    { make_floatx80_init(0xbffe, 0x8fffffffffff162bULL),
+      make_floatx80_init(0x3ffe, 0xad583eea42a1b886ULL),
+      make_floatx80_init(0xbffd, 0xa54f822b7abc8ef4ULL) },
+    { make_floatx80_init(0xbffe, 0x87ffffffffff4d34ULL),
+      make_floatx80_init(0x3ffe, 0xb123f581d2ac7b51ULL),
+      make_floatx80_init(0xbffd, 0x9db814fc5aa7095eULL) },
+    { make_floatx80_init(0xbffe, 0x800000000000227dULL),
+      make_floatx80_init(0x3ffe, 0xb504f333f9de539dULL),
+      make_floatx80_init(0xbffd, 0x95f619980c4358c6ULL) },
+    { make_floatx80_init(0xbffd, 0xefffffffffff3978ULL),
+      make_floatx80_init(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
+      make_floatx80_init(0xbffd, 0x8e08a1713a085ebeULL) },
+    { make_floatx80_init(0xbffd, 0xe00000000000df81ULL),
+      make_floatx80_init(0x3ffe, 0xbd08a39f580bfd8cULL),
+      make_floatx80_init(0xbffd, 0x85eeb8c14fe804e8ULL) },
+    { make_floatx80_init(0xbffd, 0xd00000000000bccfULL),
+      make_floatx80_init(0x3ffe, 0xc12c4cca667062f6ULL),
+      make_floatx80_init(0xbffc, 0xfb4eccd6663e7428ULL) },
+    { make_floatx80_init(0xbffd, 0xc00000000000eff0ULL),
+      make_floatx80_init(0x3ffe, 0xc5672a1155069abeULL),
+      make_floatx80_init(0xbffc, 0xea6357baabe59508ULL) },
+    { make_floatx80_init(0xbffd, 0xb000000000000fe6ULL),
+      make_floatx80_init(0x3ffe, 0xc9b9bd866e2f234bULL),
+      make_floatx80_init(0xbffc, 0xd91909e6474372d4ULL) },
+    { make_floatx80_init(0xbffd, 0x9fffffffffff2172ULL),
+      make_floatx80_init(0x3ffe, 0xce248c151f84bf00ULL),
+      make_floatx80_init(0xbffc, 0xc76dcfab81ed0400ULL) },
+    { make_floatx80_init(0xbffd, 0x8fffffffffffafffULL),
+      make_floatx80_init(0x3ffe, 0xd2a81d91f12afb2bULL),
+      make_floatx80_init(0xbffc, 0xb55f89b83b541354ULL) },
+    { make_floatx80_init(0xbffc, 0xffffffffffff81a3ULL),
+      make_floatx80_init(0x3ffe, 0xd744fccad69d7d5eULL),
+      make_floatx80_init(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
+    { make_floatx80_init(0xbffc, 0xdfffffffffff1568ULL),
+      make_floatx80_init(0x3ffe, 0xdbfbb797daf25a44ULL),
+      make_floatx80_init(0xbffc, 0x901121a0943696f0ULL) },
+    { make_floatx80_init(0xbffc, 0xbfffffffffff68daULL),
+      make_floatx80_init(0x3ffe, 0xe0ccdeec2a94f811ULL),
+      make_floatx80_init(0xbffb, 0xf999089eab583f78ULL) },
+    { make_floatx80_init(0xbffc, 0x9fffffffffff4690ULL),
+      make_floatx80_init(0x3ffe, 0xe5b906e77c83657eULL),
+      make_floatx80_init(0xbffb, 0xd237c8c41be4d410ULL) },
+    { make_floatx80_init(0xbffb, 0xffffffffffff8aeeULL),
+      make_floatx80_init(0x3ffe, 0xeac0c6e7dd24427cULL),
+      make_floatx80_init(0xbffb, 0xa9f9c8c116ddec20ULL) },
+    { make_floatx80_init(0xbffb, 0xbfffffffffff2d18ULL),
+      make_floatx80_init(0x3ffe, 0xefe4b99bdcdb06ebULL),
+      make_floatx80_init(0xbffb, 0x80da33211927c8a8ULL) },
+    { make_floatx80_init(0xbffa, 0xffffffffffff8ccbULL),
+      make_floatx80_init(0x3ffe, 0xf5257d152486d0f4ULL),
+      make_floatx80_init(0xbffa, 0xada82eadb792f0c0ULL) },
+    { make_floatx80_init(0xbff9, 0xffffffffffff11feULL),
+      make_floatx80_init(0x3ffe, 0xfa83b2db722a0846ULL),
+      make_floatx80_init(0xbff9, 0xaf89a491babef740ULL) },
+    { floatx80_zero_init,
+      make_floatx80_init(0x3fff, 0x8000000000000000ULL),
+      floatx80_zero_init },
+    { make_floatx80_init(0x3ff9, 0xffffffffffff2680ULL),
+      make_floatx80_init(0x3fff, 0x82cd8698ac2b9f6fULL),
+      make_floatx80_init(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
+    { make_floatx80_init(0x3ffb, 0x800000000000b500ULL),
+      make_floatx80_init(0x3fff, 0x85aac367cc488345ULL),
+      make_floatx80_init(0x3ffa, 0xb5586cf9891068a0ULL) },
+    { make_floatx80_init(0x3ffb, 0xbfffffffffff4b67ULL),
+      make_floatx80_init(0x3fff, 0x88980e8092da7cceULL),
+      make_floatx80_init(0x3ffb, 0x8980e8092da7cce0ULL) },
+    { make_floatx80_init(0x3ffb, 0xffffffffffffff57ULL),
+      make_floatx80_init(0x3fff, 0x8b95c1e3ea8bd6dfULL),
+      make_floatx80_init(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
+    { make_floatx80_init(0x3ffc, 0x9fffffffffff811fULL),
+      make_floatx80_init(0x3fff, 0x8ea4398b45cd4780ULL),
+      make_floatx80_init(0x3ffb, 0xea4398b45cd47800ULL) },
+    { make_floatx80_init(0x3ffc, 0xbfffffffffff9980ULL),
+      make_floatx80_init(0x3fff, 0x91c3d373ab11b919ULL),
+      make_floatx80_init(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
+    { make_floatx80_init(0x3ffc, 0xdffffffffffff631ULL),
+      make_floatx80_init(0x3fff, 0x94f4efa8fef70864ULL),
+      make_floatx80_init(0x3ffc, 0xa7a77d47f7b84320ULL) },
+    { make_floatx80_init(0x3ffc, 0xffffffffffff2499ULL),
+      make_floatx80_init(0x3fff, 0x9837f0518db892d4ULL),
+      make_floatx80_init(0x3ffc, 0xc1bf828c6dc496a0ULL) },
+    { make_floatx80_init(0x3ffd, 0x8fffffffffff80fbULL),
+      make_floatx80_init(0x3fff, 0x9b8d39b9d54e3a79ULL),
+      make_floatx80_init(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
+    { make_floatx80_init(0x3ffd, 0x9fffffffffffbc23ULL),
+      make_floatx80_init(0x3fff, 0x9ef5326091a10313ULL),
+      make_floatx80_init(0x3ffc, 0xf7a993048d081898ULL) },
+    { make_floatx80_init(0x3ffd, 0xafffffffffff20ecULL),
+      make_floatx80_init(0x3fff, 0xa27043030c49370aULL),
+      make_floatx80_init(0x3ffd, 0x89c10c0c3124dc28ULL) },
+    { make_floatx80_init(0x3ffd, 0xc00000000000fd2cULL),
+      make_floatx80_init(0x3fff, 0xa5fed6a9b15171cfULL),
+      make_floatx80_init(0x3ffd, 0x97fb5aa6c545c73cULL) },
+    { make_floatx80_init(0x3ffd, 0xd0000000000093beULL),
+      make_floatx80_init(0x3fff, 0xa9a15ab4ea7c30e6ULL),
+      make_floatx80_init(0x3ffd, 0xa6856ad3a9f0c398ULL) },
+    { make_floatx80_init(0x3ffd, 0xe00000000000c2aeULL),
+      make_floatx80_init(0x3fff, 0xad583eea42a17876ULL),
+      make_floatx80_init(0x3ffd, 0xb560fba90a85e1d8ULL) },
+    { make_floatx80_init(0x3ffd, 0xefffffffffff1e3fULL),
+      make_floatx80_init(0x3fff, 0xb123f581d2abef6cULL),
+      make_floatx80_init(0x3ffd, 0xc48fd6074aafbdb0ULL) },
+    { make_floatx80_init(0x3ffd, 0xffffffffffff1c23ULL),
+      make_floatx80_init(0x3fff, 0xb504f333f9de2cadULL),
+      make_floatx80_init(0x3ffd, 0xd413cccfe778b2b4ULL) },
+    { make_floatx80_init(0x3ffe, 0x8800000000006344ULL),
+      make_floatx80_init(0x3fff, 0xb8fbaf4762fbd0a1ULL),
+      make_floatx80_init(0x3ffd, 0xe3eebd1d8bef4284ULL) },
+    { make_floatx80_init(0x3ffe, 0x9000000000005d67ULL),
+      make_floatx80_init(0x3fff, 0xbd08a39f580c668dULL),
+      make_floatx80_init(0x3ffd, 0xf4228e7d60319a34ULL) },
+    { make_floatx80_init(0x3ffe, 0x9800000000009127ULL),
+      make_floatx80_init(0x3fff, 0xc12c4cca6670e042ULL),
+      make_floatx80_init(0x3ffe, 0x82589994cce1c084ULL) },
+    { make_floatx80_init(0x3ffe, 0x9fffffffffff06f9ULL),
+      make_floatx80_init(0x3fff, 0xc5672a11550655c3ULL),
+      make_floatx80_init(0x3ffe, 0x8ace5422aa0cab86ULL) },
+    { make_floatx80_init(0x3ffe, 0xa7fffffffffff80dULL),
+      make_floatx80_init(0x3fff, 0xc9b9bd866e2f234bULL),
+      make_floatx80_init(0x3ffe, 0x93737b0cdc5e4696ULL) },
+    { make_floatx80_init(0x3ffe, 0xafffffffffff1470ULL),
+      make_floatx80_init(0x3fff, 0xce248c151f83fd69ULL),
+      make_floatx80_init(0x3ffe, 0x9c49182a3f07fad2ULL) },
+    { make_floatx80_init(0x3ffe, 0xb800000000000e0aULL),
+      make_floatx80_init(0x3fff, 0xd2a81d91f12aec5cULL),
+      make_floatx80_init(0x3ffe, 0xa5503b23e255d8b8ULL) },
+    { make_floatx80_init(0x3ffe, 0xc00000000000b7faULL),
+      make_floatx80_init(0x3fff, 0xd744fccad69dd630ULL),
+      make_floatx80_init(0x3ffe, 0xae89f995ad3bac60ULL) },
+    { make_floatx80_init(0x3ffe, 0xc800000000003aa6ULL),
+      make_floatx80_init(0x3fff, 0xdbfbb797daf25a44ULL),
+      make_floatx80_init(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
+    { make_floatx80_init(0x3ffe, 0xd00000000000a6aeULL),
+      make_floatx80_init(0x3fff, 0xe0ccdeec2a954685ULL),
+      make_floatx80_init(0x3ffe, 0xc199bdd8552a8d0aULL) },
+    { make_floatx80_init(0x3ffe, 0xd800000000004165ULL),
+      make_floatx80_init(0x3fff, 0xe5b906e77c837155ULL),
+      make_floatx80_init(0x3ffe, 0xcb720dcef906e2aaULL) },
+    { make_floatx80_init(0x3ffe, 0xe00000000000582cULL),
+      make_floatx80_init(0x3fff, 0xeac0c6e7dd24713aULL),
+      make_floatx80_init(0x3ffe, 0xd5818dcfba48e274ULL) },
+    { make_floatx80_init(0x3ffe, 0xe800000000001a5dULL),
+      make_floatx80_init(0x3fff, 0xefe4b99bdcdb06ebULL),
+      make_floatx80_init(0x3ffe, 0xdfc97337b9b60dd6ULL) },
+    { make_floatx80_init(0x3ffe, 0xefffffffffffc1efULL),
+      make_floatx80_init(0x3fff, 0xf5257d152486a2faULL),
+      make_floatx80_init(0x3ffe, 0xea4afa2a490d45f4ULL) },
+    { make_floatx80_init(0x3ffe, 0xf800000000001069ULL),
+      make_floatx80_init(0x3fff, 0xfa83b2db722a0e5cULL),
+      make_floatx80_init(0x3ffe, 0xf50765b6e4541cb8ULL) },
+    { make_floatx80_init(0x3fff, 0x8000000000000000ULL),
+      make_floatx80_init(0x4000, 0x8000000000000000ULL),
+      make_floatx80_init(0x3fff, 0x8000000000000000ULL) },
 };
 
 void helper_f2xm1(CPUX86State *env)
@@ -1275,24 +1275,24 @@ struct fpatan_data {
 };
 
 static const struct fpatan_data fpatan_table[9] = {
-    { floatx80_zero,
-      floatx80_zero },
-    { make_floatx80(0x3ffb, 0xfeadd4d5617b6e33ULL),
-      make_floatx80(0xbfb9, 0xdda19d8305ddc420ULL) },
-    { make_floatx80(0x3ffc, 0xfadbafc96406eb15ULL),
-      make_floatx80(0x3fbb, 0xdb8f3debef442fccULL) },
-    { make_floatx80(0x3ffd, 0xb7b0ca0f26f78474ULL),
-      make_floatx80(0xbfbc, 0xeab9bdba460376faULL) },
-    { make_floatx80(0x3ffd, 0xed63382b0dda7b45ULL),
-      make_floatx80(0x3fbc, 0xdfc88bd978751a06ULL) },
-    { make_floatx80(0x3ffe, 0x8f005d5ef7f59f9bULL),
-      make_floatx80(0x3fbd, 0xb906bc2ccb886e90ULL) },
-    { make_floatx80(0x3ffe, 0xa4bc7d1934f70924ULL),
-      make_floatx80(0x3fbb, 0xcd43f9522bed64f8ULL) },
-    { make_floatx80(0x3ffe, 0xb8053e2bc2319e74ULL),
-      make_floatx80(0xbfbc, 0xd3496ab7bd6eef0cULL) },
-    { make_floatx80(0x3ffe, 0xc90fdaa22168c235ULL),
-      make_floatx80(0xbfbc, 0xece675d1fc8f8cbcULL) },
+    { floatx80_zero_init,
+      floatx80_zero_init },
+    { make_floatx80_init(0x3ffb, 0xfeadd4d5617b6e33ULL),
+      make_floatx80_init(0xbfb9, 0xdda19d8305ddc420ULL) },
+    { make_floatx80_init(0x3ffc, 0xfadbafc96406eb15ULL),
+      make_floatx80_init(0x3fbb, 0xdb8f3debef442fccULL) },
+    { make_floatx80_init(0x3ffd, 0xb7b0ca0f26f78474ULL),
+      make_floatx80_init(0xbfbc, 0xeab9bdba460376faULL) },
+    { make_floatx80_init(0x3ffd, 0xed63382b0dda7b45ULL),
+      make_floatx80_init(0x3fbc, 0xdfc88bd978751a06ULL) },
+    { make_floatx80_init(0x3ffe, 0x8f005d5ef7f59f9bULL),
+      make_floatx80_init(0x3fbd, 0xb906bc2ccb886e90ULL) },
+    { make_floatx80_init(0x3ffe, 0xa4bc7d1934f70924ULL),
+      make_floatx80_init(0x3fbb, 0xcd43f9522bed64f8ULL) },
+    { make_floatx80_init(0x3ffe, 0xb8053e2bc2319e74ULL),
+      make_floatx80_init(0xbfbc, 0xd3496ab7bd6eef0cULL) },
+    { make_floatx80_init(0x3ffe, 0xc90fdaa22168c235ULL),
+      make_floatx80_init(0xbfbc, 0xece675d1fc8f8cbcULL) },
 };
 
 void helper_fpatan(CPUX86State *env)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15024.37572 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUw-0004Mw-Jl; Thu, 29 Oct 2020 21:30:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15024.37572; Thu, 29 Oct 2020 21:30:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFUw-0004Mp-GW; Thu, 29 Oct 2020 21:30:18 +0000
Received: by outflank-mailman (input) for mailman id 15024;
 Thu, 29 Oct 2020 21:30:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFUv-0004MZ-Re
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 32b9b8fb-4b9a-4b68-96c9-5406efe65eaa;
 Thu, 29 Oct 2020 21:30:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUv-0008BB-0N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFUu-0004X4-VS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFUv-0004MZ-Re
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:17 +0000
X-Inumbo-ID: 32b9b8fb-4b9a-4b68-96c9-5406efe65eaa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 32b9b8fb-4b9a-4b68-96c9-5406efe65eaa;
	Thu, 29 Oct 2020 21:30:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5dbxwunjB4pBebfWUlB5A3CogCZt7lSZO+hgVmEtUEw=; b=WnN/Crc1xUnC0qe4NA++fPISWH
	R5874dSwJ1RuioFxcNuL4zlBnTq9Sr0rzGrdxrWwNpha8ijFOz3LPccal5KAtq+PlMnrS2czTsRaL
	hRz4nVGN90jiTQGSQnPiRe0b/FbPya25M2Yq9r/67RPys+l0mKnF1GC3q27TQceyuAN4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUv-0008BB-0N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFUu-0004X4-VS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
Message-Id: <E1kYFUu-0004X4-VS@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:16 +0000

commit 2667e069e7b5807c69f32109d930967bc1b222cb
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:01 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:18 2020 +0100

    linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
    
    Plain MAP_FIXED has the undesirable behaviour of splatting exiting
    maps so we don't actually achieve what we want when looking for gaps.
    We should be using MAP_FIXED_NOREPLACE. As this isn't always available
    we need to potentially check the returned address to see if the kernel
    gave us what we asked for.
    
    Fixes: ad592e37dfc ("linux-user: provide fallback pgd_find_hole for bare chroots")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200724064509.331-9-alex.bennee@linaro.org>
---
 include/qemu/osdep.h |  3 +++
 linux-user/elfload.c | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 0b1298b3c9..20872e793e 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -173,6 +173,9 @@ extern int daemon(int, int);
 #ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
 #endif
+#ifndef MAP_FIXED_NOREPLACE
+#define MAP_FIXED_NOREPLACE 0
+#endif
 #ifndef ENOMEDIUM
 #define ENOMEDIUM ENODEV
 #endif
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 7e7f642332..fe9dfe795d 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2134,12 +2134,15 @@ static uintptr_t pgd_find_hole_fallback(uintptr_t guest_size, uintptr_t brk,
             /* we have run out of space */
             return -1;
         } else {
-            int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE | MAP_FIXED;
+            int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE |
+                MAP_FIXED_NOREPLACE;
             void * mmap_start = mmap((void *) align_start, guest_size,
                                      PROT_NONE, flags, -1, 0);
             if (mmap_start != MAP_FAILED) {
                 munmap((void *) align_start, guest_size);
-                return (uintptr_t) mmap_start + offset;
+                if (MAP_FIXED_NOREPLACE || mmap_start == (void *) align_start) {
+                    return (uintptr_t) mmap_start + offset;
+                }
             }
             base += qemu_host_page_size;
         }
@@ -2307,9 +2310,8 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
     /* Widen the "image" to the entire reserved address space. */
     pgb_static(image_name, 0, reserved_va, align);
 
-#ifdef MAP_FIXED_NOREPLACE
+    /* osdep.h defines this as 0 if it's missing */
     flags |= MAP_FIXED_NOREPLACE;
-#endif
 
     /* Reserve the memory on the host. */
     assert(guest_base != 0);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15027.37576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFV6-0004QO-LD; Thu, 29 Oct 2020 21:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15027.37576; Thu, 29 Oct 2020 21:30:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFV6-0004QF-IM; Thu, 29 Oct 2020 21:30:28 +0000
Received: by outflank-mailman (input) for mailman id 15027;
 Thu, 29 Oct 2020 21:30:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFV5-0004Px-Su
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c923cd7-e428-4360-8ecc-fc73150f1e80;
 Thu, 29 Oct 2020 21:30:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFV5-0008BR-4M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFV5-0004Xa-3A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFV5-0004Px-Su
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
X-Inumbo-ID: 2c923cd7-e428-4360-8ecc-fc73150f1e80
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c923cd7-e428-4360-8ecc-fc73150f1e80;
	Thu, 29 Oct 2020 21:30:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eWzUW6D5f+3wlO9mzIrEuEFsl05Kwap0fiAg8kcpOGA=; b=5fJwpxphL0NR6KigqDCBmLrxMi
	sU6sl6l83AkntCqDYTO0t+DHPWH9ajU4y1bMCWbhQgCAW7x26Hv1fhBvEv2KriK9GxDL7QOF357dh
	O1XyryLW8pth0MaxLQRNVHuqqiUE+jRHudaWTFXQhaQ0yNTXxDBW+icteC2jhTXbIdeg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFV5-0008BR-4M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFV5-0004Xa-3A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/docker: fix update command due to python3 str/bytes distinction
Message-Id: <E1kYFV5-0004Xa-3A@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:27 +0000

commit e336cec3a59df5c4e79f6f9625780dccd8a607db
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:02 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:18 2020 +0100

    tests/docker: fix update command due to python3 str/bytes distinction
    
    Does this seem convoluted to you? It feels a little complicated to me.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200724064509.331-10-alex.bennee@linaro.org>
---
 tests/docker/docker.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index c9f20d8d09..356d7618f1 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -24,7 +24,7 @@ import tempfile
 import re
 import signal
 from tarfile import TarFile, TarInfo
-from io import StringIO
+from io import StringIO, BytesIO
 from shutil import copy, rmtree
 from pwd import getpwuid
 from datetime import datetime, timedelta
@@ -541,13 +541,14 @@ class UpdateCommand(SubCommand):
 
         # Create a Docker buildfile
         df = StringIO()
-        df.write("FROM %s\n" % args.tag)
-        df.write("ADD . /\n")
-        df.seek(0)
+        df.write(u"FROM %s\n" % args.tag)
+        df.write(u"ADD . /\n")
+
+        df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8"))
 
         df_tar = TarInfo(name="Dockerfile")
-        df_tar.size = len(df.buf)
-        tmp_tar.addfile(df_tar, fileobj=df)
+        df_tar.size = df_bytes.getbuffer().nbytes
+        tmp_tar.addfile(df_tar, fileobj=df_bytes)
 
         tmp_tar.close()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15029.37580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVH-0004SB-N3; Thu, 29 Oct 2020 21:30:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15029.37580; Thu, 29 Oct 2020 21:30:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVH-0004S3-K4; Thu, 29 Oct 2020 21:30:39 +0000
Received: by outflank-mailman (input) for mailman id 15029;
 Thu, 29 Oct 2020 21:30:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFVG-0004Rv-5q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 94b26ea9-c54a-4543-82ca-e3927a6fc74a;
 Thu, 29 Oct 2020 21:30:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVF-0008BZ-7y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVF-0004YC-75
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFVG-0004Rv-5q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:38 +0000
X-Inumbo-ID: 94b26ea9-c54a-4543-82ca-e3927a6fc74a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 94b26ea9-c54a-4543-82ca-e3927a6fc74a;
	Thu, 29 Oct 2020 21:30:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y1ijfBcP7CG+jtS7awasVmu97Gyw4bEkf+Z76Z+K/b4=; b=Sf6QN4IBr3wqd12CswzB/Qu//b
	vAJeRt3FvLBozFbT4sjsNDaRNilDpBjJhAt6B/uFBsDgpWox93yekPW4V7kfHhUPdQsBYvIOvArGW
	X6xDa79p8A0wpCg6cjxEHIc73c0TmOpO/qUpbAWQkHyMvFQDpGpkO4ZfHAib1fSS7PAs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVF-0008BZ-7y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVF-0004YC-75
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/docker: fix binfmt_misc image building
Message-Id: <E1kYFVF-0004YC-75@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:37 +0000

commit 182ec0607600f23e7768a1c3c490f61e36b15bc4
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:03 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:22 2020 +0100

    tests/docker: fix binfmt_misc image building
    
    When we updated the arguments for docker.py we missed a bit.
    
    Fixes: dfae628459 ("docker.py/build: support -t and -f arguments")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200724064509.331-11-alex.bennee@linaro.org>
---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index a104e9df28..9119dff97d 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -78,7 +78,7 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
 			DEB_ARCH=$(DEB_ARCH)					\
 			DEB_TYPE=$(DEB_TYPE) 					\
 			$(if $(DEB_URL),DEB_URL=$(DEB_URL),)			\
-			$(DOCKER_SCRIPT) build qemu/debian-$* $< 		\
+			$(DOCKER_SCRIPT) build -t qemu/debian-$* -f $< 		\
 			$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) 		\
 			$(if $(NOUSER),,--add-current-user) 			\
 			$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))	\
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15030.37584 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVR-0004TX-OT; Thu, 29 Oct 2020 21:30:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15030.37584; Thu, 29 Oct 2020 21:30:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVR-0004TP-LX; Thu, 29 Oct 2020 21:30:49 +0000
Received: by outflank-mailman (input) for mailman id 15030;
 Thu, 29 Oct 2020 21:30:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFVQ-0004TF-IH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id dbebdb2f-1f07-48b7-ab19-de2990f26b12;
 Thu, 29 Oct 2020 21:30:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVP-0008Bj-Cb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVP-0004Yq-Af
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFVQ-0004TF-IH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:48 +0000
X-Inumbo-ID: dbebdb2f-1f07-48b7-ab19-de2990f26b12
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id dbebdb2f-1f07-48b7-ab19-de2990f26b12;
	Thu, 29 Oct 2020 21:30:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x1DFAtyyrz2jX4Ws8R5eB23JKUD6pDyALY2qmaZwM0Y=; b=27zB8HAhSAWpmF1Mbl4cqXcosL
	6eKyyiJ59ODRlUcy/JNUvG+/nVspQGPHrHA5bR77ySLns0LWdSrYohX8PsikGgvjBjh2pnJnzaBLk
	zCQliiXQsBFB4JX1cR+nr3S1lG0l5HdZDJ2HOAZ7l8burLfDyhKqduogGgpiybC74wf0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVP-0008Bj-Cb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVP-0004Yq-Af
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/docker: add support for DEB_KEYRING
Message-Id: <E1kYFVP-0004Yq-Af@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:47 +0000

commit 4c5aeb12387f05348d3ea25c138c450005086ecd
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:04 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:35 2020 +0100

    tests/docker: add support for DEB_KEYRING
    
    For installing stuff from sid or ports you may need to manually
    specify the location of the keyring. You can even import keys into
    your personal keyring and point it there, e.g.:
    
      gpg --keyserver keyring.debian.org --recv-keys 84C573CD4E1AFD6C
      make docker-binfmt-image-debian-sid-hppa DEB_TYPE=sid DEB_ARCH=hppa \
          DEB_URL=http://ftp.ports.debian.org/debian-ports/ \
          EXECUTABLE=./hppa-linux-user/qemu-hppa V=1 \
          DEB_KEYRING=${HOME}/.gnupg/pubring.kbx
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200724064509.331-12-alex.bennee@linaro.org>
---
 tests/docker/dockerfiles/debian-bootstrap.pre | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre
index c164778c30..35c85f7db8 100755
--- a/tests/docker/dockerfiles/debian-bootstrap.pre
+++ b/tests/docker/dockerfiles/debian-bootstrap.pre
@@ -79,6 +79,13 @@ else
     fi
 fi
 
+#
+# Add optional args
+#
+if [ -n "${DEB_KEYRING}" ]; then
+    DEBOOTSTRAP="${DEBOOTSTRAP} --keyring=${DEB_KEYRING}"
+fi
+
 #
 # Finally check to see if any qemu's are installed
 #
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:30:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:30:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15031.37588 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVb-0004V1-QM; Thu, 29 Oct 2020 21:30:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15031.37588; Thu, 29 Oct 2020 21:30:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVb-0004Ut-N4; Thu, 29 Oct 2020 21:30:59 +0000
Received: by outflank-mailman (input) for mailman id 15031;
 Thu, 29 Oct 2020 21:30:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFVa-0004Ug-9t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c4105647-cc24-41b5-96da-637f99f023e6;
 Thu, 29 Oct 2020 21:30:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVZ-0008Br-GI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVZ-0004ZQ-Ff
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFVa-0004Ug-9t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:58 +0000
X-Inumbo-ID: c4105647-cc24-41b5-96da-637f99f023e6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c4105647-cc24-41b5-96da-637f99f023e6;
	Thu, 29 Oct 2020 21:30:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yj4/lhcnJGHiXLr+xffoy1aEHNdl/cxmG3lXcadZGiQ=; b=ROYIJbbBjwTg3gueQnoJ8wdgCx
	RVqjPXf40p7hSFw8r5Lb+NEoV2J/D21+Q/JXjO41MIpH7NHdSwemoyifQNQQkogOMLAMW4cfRGl+y
	D1ny3MGbsWT2b3FDKAi5qnUUZe92neLpGxId2kPBABMowvekBSbfQVeRrY6FkcodUziI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVZ-0008Br-GI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVZ-0004ZQ-Ff
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:30:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: fix clock_nanosleep()
Message-Id: <E1kYFVZ-0004ZQ-Ff@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:30:57 +0000

commit 8ec68a0a873d24d3f81e0f34892ec4b8b1215ccf
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jul 24 07:45:05 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:41 2020 +0100

    linux-user: fix clock_nanosleep()
    
    If the call is interrupted by a signal handler, it fails with error EINTR
    and if "remain" is not NULL and "flags" is not TIMER_ABSTIME, it returns
    the remaining unslept time in "remain".
    
    Update linux-user to not overwrite the "remain" structure if there is no
    error.
    
    Found with "make check-tcg", linux-test fails on nanosleep test:
    
      TEST    linux-test on x86_64
    .../tests/tcg/multiarch/linux-test.c:242: nanosleep
    
    Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200722174612.2917566-2-laurent@vivier.eu>
    Message-Id: <20200724064509.331-13-alex.bennee@linaro.org>
---
 linux-user/syscall.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1211e759c2..43a6e28396 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11831,8 +11831,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         target_to_host_timespec(&ts, arg3);
         ret = get_errno(safe_clock_nanosleep(arg1, arg2,
                                              &ts, arg4 ? &ts : NULL));
-        if (arg4)
+        /*
+         * if the call is interrupted by a signal handler, it fails
+         * with error -TARGET_EINTR and if arg4 is not NULL and arg2 is not
+         * TIMER_ABSTIME, it returns the remaining unslept time in arg4.
+         */
+        if (ret == -TARGET_EINTR && arg4 && arg2 != TIMER_ABSTIME) {
             host_to_target_timespec(arg4, &ts);
+        }
 
 #if defined(TARGET_PPC)
         /* clock_nanosleep is odd in that it returns positive errno values.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:31:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:31:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15032.37592 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVm-0004Wy-Rr; Thu, 29 Oct 2020 21:31:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15032.37592; Thu, 29 Oct 2020 21:31:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVm-0004Wq-Om; Thu, 29 Oct 2020 21:31:10 +0000
Received: by outflank-mailman (input) for mailman id 15032;
 Thu, 29 Oct 2020 21:31:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFVl-0004Wf-9J
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e7d03c13-6d94-4b2b-841f-733d9bcbfd1f;
 Thu, 29 Oct 2020 21:31:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVj-0008Cq-KW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVj-0004aQ-Jk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFVl-0004Wf-9J
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:09 +0000
X-Inumbo-ID: e7d03c13-6d94-4b2b-841f-733d9bcbfd1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e7d03c13-6d94-4b2b-841f-733d9bcbfd1f;
	Thu, 29 Oct 2020 21:31:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O77QutXxOJ13UY++42nBYr2/TiHT8KVSt6wzuxJvANA=; b=i4C259TpxGZ1RWjfhG3ki3Iom9
	lCqUTUf/b1i7VlTNmXFdxjcDcIlK+f0VMD3FBG/dRW6jK8d2XX63Vl0UWv3kHz3hmTwONMVUxMYJZ
	FwLekw5fCZsu+lb1bwlaWkn0APGj8YMfxTkTO3MWspxSUQrtj0SK8EB6vM6SVsR+9IoE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVj-0008Cq-KW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVj-0004aQ-Jk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
Message-Id: <E1kYFVj-0004aQ-Jk@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:07 +0000

commit 445883885a3507e3a0898df0084a59ba65ee9979
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jul 24 07:45:06 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:47 2020 +0100

    linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
    
    Our safe_clock_nanosleep() returns -1 and updates errno.
    
    We don't need to update the CRF bit in syscall.c because it will
    be updated in ppc/cpu_loop.c as the return value is negative.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200722174612.2917566-3-laurent@vivier.eu>
    Message-Id: <20200724064509.331-14-alex.bennee@linaro.org>
---
 linux-user/syscall.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 43a6e28396..f5c4f6b95d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11840,13 +11840,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             host_to_target_timespec(arg4, &ts);
         }
 
-#if defined(TARGET_PPC)
-        /* clock_nanosleep is odd in that it returns positive errno values.
-         * On PPC, CR0 bit 3 should be set in such a situation. */
-        if (ret && ret != -TARGET_ERESTARTSYS) {
-            ((CPUPPCState *)cpu_env)->crf[0] |= 1;
-        }
-#endif
         return ret;
     }
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:31:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:31:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15033.37596 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVv-0004YY-Tk; Thu, 29 Oct 2020 21:31:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15033.37596; Thu, 29 Oct 2020 21:31:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFVv-0004YQ-QN; Thu, 29 Oct 2020 21:31:19 +0000
Received: by outflank-mailman (input) for mailman id 15033;
 Thu, 29 Oct 2020 21:31:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFVu-0004YD-Ob
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id acc577b7-239e-444b-b0fb-8c402cf82242;
 Thu, 29 Oct 2020 21:31:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVt-0008Cy-OH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFVt-0004b8-NY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFVu-0004YD-Ob
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:18 +0000
X-Inumbo-ID: acc577b7-239e-444b-b0fb-8c402cf82242
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id acc577b7-239e-444b-b0fb-8c402cf82242;
	Thu, 29 Oct 2020 21:31:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HNrbFzonKmBBVlaNUkCN+/eWLgJKGjnylN2SrtTOxlI=; b=GZdHRTHtPEJE7jTbGpvewtR5v4
	ZzN6AA7ryr8mawfE6HcP29dIIHdoJ6xeEinQOAKSU7P1jTHUCKUa42d2T4EaLxPsFdqd03Cs94ZHz
	4KwwMcvGiZStSJvB52zQMjxdEZf6d3ZDhNc76JFd0aMPqS1qWZU5ZAVhv7wnnUe7KvrM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVt-0008Cy-OH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFVt-0004b8-NY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qemu: Cleanup changes to ConsoleSocket
Message-Id: <E1kYFVt-0004b8-NY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:17 +0000

commit 4b84d87449f7f7cae5a032f40200915332b32a70
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:07 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:52 2020 +0100

    python/qemu: Cleanup changes to ConsoleSocket
    
    The changes to console_socket.py and machine.py are to
    cleanup for pylint and flake8.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200717203041.9867-2-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-15-alex.bennee@linaro.org>
---
 python/qemu/console_socket.py | 57 ++++++++++++++++++++++---------------------
 python/qemu/machine.py        |  7 +++---
 python/qemu/pylintrc          |  2 +-
 3 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
index 830cb7c628..09986bc215 100644
--- a/python/qemu/console_socket.py
+++ b/python/qemu/console_socket.py
@@ -1,12 +1,9 @@
-#!/usr/bin/env python3
-#
-# This python module implements a ConsoleSocket object which is
-# designed always drain the socket itself, and place
-# the bytes into a in memory buffer for later processing.
-#
-# Optionally a file path can be passed in and we will also
-# dump the characters to this file for debug.
-#
+"""
+QEMU Console Socket Module:
+
+This python module implements a ConsoleSocket object,
+which can drain a socket and optionally dump the bytes to file.
+"""
 # Copyright 2020 Linaro
 #
 # Authors:
@@ -15,20 +12,27 @@
 # This code is licensed under the GPL version 2 or later.  See
 # the COPYING file in the top-level directory.
 #
+
 import asyncore
 import socket
 import threading
-import io
-import os
-import sys
 from collections import deque
 import time
-import traceback
+
 
 class ConsoleSocket(asyncore.dispatcher):
+    """
+    ConsoleSocket represents a socket attached to a char device.
 
+    Drains the socket and places the bytes into an in memory buffer
+    for later processing.
+
+    Optionally a file path can be passed in and we will also
+    dump the characters to this file for debugging purposes.
+    """
     def __init__(self, address, file=None):
         self._recv_timeout_sec = 300
+        self._sleep_time = 0.5
         self._buffer = deque()
         self._asyncore_thread = None
         self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
@@ -70,31 +74,28 @@ class ConsoleSocket(asyncore.dispatcher):
 
     def handle_read(self):
         """process arriving characters into in memory _buffer"""
-        try:
-            data = asyncore.dispatcher.recv(self, 1)
-            # latin1 is needed since there are some chars
-            # we are receiving that cannot be encoded to utf-8
-            # such as 0xe2, 0x80, 0xA6.
-            string = data.decode("latin1")
-        except:
-            print("Exception seen.")
-            traceback.print_exc()
-            return
+        data = asyncore.dispatcher.recv(self, 1)
+        # latin1 is needed since there are some chars
+        # we are receiving that cannot be encoded to utf-8
+        # such as 0xe2, 0x80, 0xA6.
+        string = data.decode("latin1")
         if self._logfile:
             self._logfile.write("{}".format(string))
             self._logfile.flush()
         for c in string:
             self._buffer.extend(c)
 
-    def recv(self, n=1, sleep_delay_s=0.1):
-        """Return chars from in memory buffer"""
+    def recv(self, buffer_size=1):
+        """Return chars from in memory buffer.
+           Maintains the same API as socket.socket.recv.
+        """
         start_time = time.time()
-        while len(self._buffer) < n:
-            time.sleep(sleep_delay_s)
+        while len(self._buffer) < buffer_size:
+            time.sleep(self._sleep_time)
             elapsed_sec = time.time() - start_time
             if elapsed_sec > self._recv_timeout_sec:
                 raise socket.timeout
-        chars = ''.join([self._buffer.popleft() for i in range(n)])
+        chars = ''.join([self._buffer.popleft() for i in range(buffer_size)])
         # We choose to use latin1 to remain consistent with
         # handle_read() and give back the same data as the user would
         # receive if they were reading directly from the
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 51aa255ef9..a09768e9f9 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -27,7 +27,7 @@ import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
-from qemu.console_socket import ConsoleSocket
+from . import console_socket
 
 from . import qmp
 
@@ -674,8 +674,9 @@ class QEMUMachine:
         """
         if self._console_socket is None:
             if self._drain_console:
-                self._console_socket = ConsoleSocket(self._console_address,
-                                                    file=self._console_log_path)
+                self._console_socket = console_socket.ConsoleSocket(
+                    self._console_address,
+                    file=self._console_log_path)
             else:
                 self._console_socket = socket.socket(socket.AF_UNIX,
                                                      socket.SOCK_STREAM)
diff --git a/python/qemu/pylintrc b/python/qemu/pylintrc
index 5d6ae7367d..3f69205000 100644
--- a/python/qemu/pylintrc
+++ b/python/qemu/pylintrc
@@ -33,7 +33,7 @@ good-names=i,
            Run,
            _,
            fd,
-
+           c,
 [VARIABLES]
 
 [STRING]
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:31:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:31:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15034.37600 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFW7-0004aO-0r; Thu, 29 Oct 2020 21:31:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15034.37600; Thu, 29 Oct 2020 21:31:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFW6-0004aG-U0; Thu, 29 Oct 2020 21:31:30 +0000
Received: by outflank-mailman (input) for mailman id 15034;
 Thu, 29 Oct 2020 21:31:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFW5-0004a3-6F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 067aa313-cfe1-4e09-8600-1233c2163616;
 Thu, 29 Oct 2020 21:31:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFW3-0008DA-Ru
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFW3-0004bi-R6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFW5-0004a3-6F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:29 +0000
X-Inumbo-ID: 067aa313-cfe1-4e09-8600-1233c2163616
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 067aa313-cfe1-4e09-8600-1233c2163616;
	Thu, 29 Oct 2020 21:31:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1Vtqebe0327bCtzHTiU6KyGABHWP9BgtvjvBM2fBjRs=; b=knPNaP2VB3XdKZ1ZVRCXsoDxsA
	xEUKtVgZAFygg5G8tcbIUI2bR/ER7sLdjRPA257+EMXlzSBJF1GlufOXU1kg48gDzeK1BZUovG7QJ
	ewDIVDpJyanhXdFJIQ6z9sUjHzTOsfD0W0fs5OcO11/Rjpb8Nm+LmDMjGb8nWoWDLNn0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFW3-0008DA-Ru
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFW3-0004bi-R6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] python/qemu: Change ConsoleSocket to optionally drain socket.
Message-Id: <E1kYFW3-0004bi-R6@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:27 +0000

commit 80ded8e99d9fc44c206f6b2fae6638df7dcf9305
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:08 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:56 2020 +0100

    python/qemu: Change ConsoleSocket to optionally drain socket.
    
    The primary purpose of this change is to clean up
    machine.py's console_socket property to return a single type,
    a ConsoleSocket.
    
    ConsoleSocket now derives from a socket, which means that
    in the default case (of not draining), machine.py
    will see the same behavior as it did prior to ConsoleSocket.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200717203041.9867-3-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-16-alex.bennee@linaro.org>
---
 python/qemu/console_socket.py | 92 ++++++++++++++++++++++++++-----------------
 python/qemu/machine.py        | 13 ++----
 2 files changed, 59 insertions(+), 46 deletions(-)

diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
index 09986bc215..70869fbbdc 100644
--- a/python/qemu/console_socket.py
+++ b/python/qemu/console_socket.py
@@ -13,68 +13,75 @@ which can drain a socket and optionally dump the bytes to file.
 # the COPYING file in the top-level directory.
 #
 
-import asyncore
 import socket
 import threading
 from collections import deque
 import time
 
 
-class ConsoleSocket(asyncore.dispatcher):
+class ConsoleSocket(socket.socket):
     """
     ConsoleSocket represents a socket attached to a char device.
 
-    Drains the socket and places the bytes into an in memory buffer
-    for later processing.
+    Optionally (if drain==True), drains the socket and places the bytes
+    into an in memory buffer for later processing.
 
     Optionally a file path can be passed in and we will also
     dump the characters to this file for debugging purposes.
     """
-    def __init__(self, address, file=None):
+    def __init__(self, address, file=None, drain=False):
         self._recv_timeout_sec = 300
         self._sleep_time = 0.5
         self._buffer = deque()
-        self._asyncore_thread = None
-        self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-        self._sock.connect(address)
+        socket.socket.__init__(self, socket.AF_UNIX, socket.SOCK_STREAM)
+        self.connect(address)
         self._logfile = None
         if file:
             self._logfile = open(file, "w")
-        asyncore.dispatcher.__init__(self, sock=self._sock)
         self._open = True
-        self._thread_start()
+        if drain:
+            self._drain_thread = self._thread_start()
+        else:
+            self._drain_thread = None
 
-    def _thread_start(self):
-        """Kick off a thread to wait on the asyncore.loop"""
-        if self._asyncore_thread is not None:
-            return
-        self._asyncore_thread = threading.Thread(target=asyncore.loop,
-                                                 kwargs={'timeout':1})
-        self._asyncore_thread.daemon = True
-        self._asyncore_thread.start()
+    def _drain_fn(self):
+        """Drains the socket and runs while the socket is open."""
+        while self._open:
+            try:
+                self._drain_socket()
+            except socket.timeout:
+                # The socket is expected to timeout since we set a
+                # short timeout to allow the thread to exit when
+                # self._open is set to False.
+                time.sleep(self._sleep_time)
 
-    def handle_close(self):
-        """redirect close to base class"""
-        # Call the base class close, but not self.close() since
-        # handle_close() occurs in the context of the thread which
-        # self.close() attempts to join.
-        asyncore.dispatcher.close(self)
+    def _thread_start(self):
+        """Kick off a thread to drain the socket."""
+        # Configure socket to not block and timeout.
+        # This allows our drain thread to not block
+        # on recieve and exit smoothly.
+        socket.socket.setblocking(self, False)
+        socket.socket.settimeout(self, 1)
+        drain_thread = threading.Thread(target=self._drain_fn)
+        drain_thread.daemon = True
+        drain_thread.start()
+        return drain_thread
 
     def close(self):
         """Close the base object and wait for the thread to terminate"""
         if self._open:
             self._open = False
-            asyncore.dispatcher.close(self)
-            if self._asyncore_thread is not None:
-                thread, self._asyncore_thread = self._asyncore_thread, None
+            if self._drain_thread is not None:
+                thread, self._drain_thread = self._drain_thread, None
                 thread.join()
+            socket.socket.close(self)
             if self._logfile:
                 self._logfile.close()
                 self._logfile = None
 
-    def handle_read(self):
+    def _drain_socket(self):
         """process arriving characters into in memory _buffer"""
-        data = asyncore.dispatcher.recv(self, 1)
+        data = socket.socket.recv(self, 1)
         # latin1 is needed since there are some chars
         # we are receiving that cannot be encoded to utf-8
         # such as 0xe2, 0x80, 0xA6.
@@ -85,27 +92,38 @@ class ConsoleSocket(asyncore.dispatcher):
         for c in string:
             self._buffer.extend(c)
 
-    def recv(self, buffer_size=1):
+    def recv(self, bufsize=1):
         """Return chars from in memory buffer.
            Maintains the same API as socket.socket.recv.
         """
+        if self._drain_thread is None:
+            # Not buffering the socket, pass thru to socket.
+            return socket.socket.recv(self, bufsize)
         start_time = time.time()
-        while len(self._buffer) < buffer_size:
+        while len(self._buffer) < bufsize:
             time.sleep(self._sleep_time)
             elapsed_sec = time.time() - start_time
             if elapsed_sec > self._recv_timeout_sec:
                 raise socket.timeout
-        chars = ''.join([self._buffer.popleft() for i in range(buffer_size)])
+        chars = ''.join([self._buffer.popleft() for i in range(bufsize)])
         # We choose to use latin1 to remain consistent with
         # handle_read() and give back the same data as the user would
         # receive if they were reading directly from the
         # socket w/o our intervention.
         return chars.encode("latin1")
 
-    def set_blocking(self):
-        """Maintain compatibility with socket API"""
-        pass
+    def setblocking(self, value):
+        """When not draining we pass thru to the socket,
+           since when draining we control socket blocking.
+        """
+        if self._drain_thread is None:
+            socket.socket.setblocking(self, value)
 
     def settimeout(self, seconds):
-        """Set current timeout on recv"""
-        self._recv_timeout_sec = seconds
+        """When not draining we pass thru to the socket,
+           since when draining we control the timeout.
+        """
+        if seconds is not None:
+            self._recv_timeout_sec = seconds
+        if self._drain_thread is None:
+            socket.socket.settimeout(self, seconds)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index a09768e9f9..82f3731fc3 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -23,7 +23,6 @@ import os
 import subprocess
 import shutil
 import signal
-import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
@@ -673,12 +672,8 @@ class QEMUMachine:
         Returns a socket connected to the console
         """
         if self._console_socket is None:
-            if self._drain_console:
-                self._console_socket = console_socket.ConsoleSocket(
-                    self._console_address,
-                    file=self._console_log_path)
-            else:
-                self._console_socket = socket.socket(socket.AF_UNIX,
-                                                     socket.SOCK_STREAM)
-                self._console_socket.connect(self._console_address)
+            self._console_socket = console_socket.ConsoleSocket(
+                self._console_address,
+                file=self._console_log_path,
+                drain=self._drain_console)
         return self._console_socket
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:31:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:31:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15035.37605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWG-0004bl-2g; Thu, 29 Oct 2020 21:31:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15035.37605; Thu, 29 Oct 2020 21:31:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWF-0004bc-Vf; Thu, 29 Oct 2020 21:31:39 +0000
Received: by outflank-mailman (input) for mailman id 15035;
 Thu, 29 Oct 2020 21:31:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFWE-0004bU-Tk
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7501759f-ddd9-49e3-a0b3-9b3b8d24f75a;
 Thu, 29 Oct 2020 21:31:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWD-0008DN-VO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWD-0004cI-Uh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFWE-0004bU-Tk
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:38 +0000
X-Inumbo-ID: 7501759f-ddd9-49e3-a0b3-9b3b8d24f75a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7501759f-ddd9-49e3-a0b3-9b3b8d24f75a;
	Thu, 29 Oct 2020 21:31:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HjpKU8/tWup+XdmS0Pz+j43Somi5EzHoiwihYwSfj1g=; b=tvi1gQ3qgFpXTMBSMAtucVEmI/
	slFi1ZXqrjBOIchAIEkKYBUDI562Ml/d/jTzIquibs/S5awd3JN140OZsEub3cK09zZBwmyZ8aWfF
	5klvZ7nkPiK44jXyZjSPrLbRYUbUWrwqXDHNsuq06fJqaONoXPx3Zm8IgYgkwED+mEa0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWD-0008DN-VO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWD-0004cI-Uh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/vm: add shutdown timeout in basevm.py
Message-Id: <E1kYFWD-0004cI-Uh@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:37 +0000

commit 4a70232b1d26b0d73e1bce60b2c3bdb7e4279d16
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:09 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:58 2020 +0100

    tests/vm: add shutdown timeout in basevm.py
    
    We are adding the shutdown timeout to solve an issue
    we now see where the aarch64 VMs timeout on shutdown
    under TCG.
    
    There is a new 3 second timeout in machine.py,
    which we override in basevm.py when shutting down.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200717203041.9867-4-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-17-alex.bennee@linaro.org>
---
 tests/vm/basevm.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 7acb48b876..3fac20e929 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -80,6 +80,8 @@ class BaseVM(object):
     arch = "#arch"
     # command to halt the guest, can be overridden by subclasses
     poweroff = "poweroff"
+    # Time to wait for shutdown to finish.
+    shutdown_timeout_default = 30
     # enable IPv6 networking
     ipv6 = True
     # This is the timeout on the wait for console bytes.
@@ -87,7 +89,7 @@ class BaseVM(object):
     # Scale up some timeouts under TCG.
     # 4 is arbitrary, but greater than 2,
     # since we found we need to wait more than twice as long.
-    tcg_ssh_timeout_multiplier = 4
+    tcg_timeout_multiplier = 4
     def __init__(self, args, config=None):
         self._guest = None
         self._genisoimage = args.genisoimage
@@ -141,9 +143,12 @@ class BaseVM(object):
         if args.jobs and args.jobs > 1:
             self._args += ["-smp", "%d" % args.jobs]
         if kvm_available(self.arch):
+            self._shutdown_timeout = self.shutdown_timeout_default
             self._args += ["-enable-kvm"]
         else:
             logging.info("KVM not available, not using -enable-kvm")
+            self._shutdown_timeout = \
+                self.shutdown_timeout_default * self.tcg_timeout_multiplier
         self._data_args = []
 
         if self._config['qemu_args'] != None:
@@ -423,7 +428,7 @@ class BaseVM(object):
     def wait_ssh(self, wait_root=False, seconds=300, cmd="exit 0"):
         # Allow more time for VM to boot under TCG.
         if not kvm_available(self.arch):
-            seconds *= self.tcg_ssh_timeout_multiplier
+            seconds *= self.tcg_timeout_multiplier
         starttime = datetime.datetime.now()
         endtime = starttime + datetime.timedelta(seconds=seconds)
         cmd_success = False
@@ -441,14 +446,14 @@ class BaseVM(object):
             raise Exception("Timeout while waiting for guest ssh")
 
     def shutdown(self):
-        self._guest.shutdown()
+        self._guest.shutdown(timeout=self._shutdown_timeout)
 
     def wait(self):
-        self._guest.wait()
+        self._guest.wait(timeout=self._shutdown_timeout)
 
     def graceful_shutdown(self):
         self.ssh_root(self.poweroff)
-        self._guest.wait()
+        self._guest.wait(timeout=self._shutdown_timeout)
 
     def qmp(self, *args, **kwargs):
         return self._guest.qmp(*args, **kwargs)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:31:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:31:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15036.37608 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWQ-0004dG-4T; Thu, 29 Oct 2020 21:31:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15036.37608; Thu, 29 Oct 2020 21:31:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWQ-0004d8-0t; Thu, 29 Oct 2020 21:31:50 +0000
Received: by outflank-mailman (input) for mailman id 15036;
 Thu, 29 Oct 2020 21:31:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFWP-0004cy-3a
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8f68416e-4741-4716-9de3-60d8d292e470;
 Thu, 29 Oct 2020 21:31:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWO-0008DU-3G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWO-0004cs-2Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFWP-0004cy-3a
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:49 +0000
X-Inumbo-ID: 8f68416e-4741-4716-9de3-60d8d292e470
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8f68416e-4741-4716-9de3-60d8d292e470;
	Thu, 29 Oct 2020 21:31:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xx72jAZPdG/zmBWVI5KrMPw6pZE1inIn/3EzufcwX8I=; b=abTpLac4kYjtZtNjpL/BL9lQa0
	Yq/Ni51GQT8flaRBIVQ6NxHstFeDfjCTz3sVqeuCRfCOpahSCoOwKnCqXdrTv0MTSWVF5nB9unOYF
	AVZtdcRq3GW4p7gkMYW/Leu3JoFfQnoLs6i36LQyIW7cuir76hbcRDo7WDPWJVvyDWaY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWO-0008DU-3G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWO-0004cs-2Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stsquad/tags/pull-fixes-for-rc2-270720-1' into staging
Message-Id: <E1kYFWO-0004cs-2Z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:48 +0000

commit cb320a07e6cb6e251f9aeb4bf57f99cc320eb8ea
Merge: 4215d3413272ad6d1c6c9d0234450b602e46a74c 4a70232b1d26b0d73e1bce60b2c3bdb7e4279d16
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 15:55:56 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 15:55:56 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-fixes-for-rc2-270720-1' into staging
    
    Various fixes for rc2:
    
      - get shippable working again
      - semihosting bug fixes
      - tweak tb-size handling for low memory machines
      - i386 compound literal float fix
      - linux-user MAP_FIXED->MAP_NOREPLACE on fallback
      - docker binfmt_misc fixes
      - linux-user nanosleep fix
      - tests/vm drain console fixes
    
    # gpg: Signature made Mon 27 Jul 2020 09:45:31 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-fixes-for-rc2-270720-1:
      tests/vm: add shutdown timeout in basevm.py
      python/qemu: Change ConsoleSocket to optionally drain socket.
      python/qemu: Cleanup changes to ConsoleSocket
      linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
      linux-user: fix clock_nanosleep()
      tests/docker: add support for DEB_KEYRING
      tests/docker: fix binfmt_misc image building
      tests/docker: fix update command due to python3 str/bytes distinction
      linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
      target/i386: floatx80: avoid compound literals in static initializers
      accel/tcg: better handle memory constrained systems
      util/oslib-win32: add qemu_get_host_physmem implementation
      util: add qemu_get_host_physmem utility function
      semihosting: don't send the trailing '\0'
      semihosting: defer connect_chardevs a little more to use serialx
      shippable: add one more qemu to registry url
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .shippable.yml                                |   2 +-
 accel/tcg/translate-all.c                     |   7 +-
 hw/semihosting/console.c                      |   4 +-
 include/fpu/softfloat.h                       |   1 +
 include/qemu/osdep.h                          |  15 +
 linux-user/elfload.c                          |  10 +-
 linux-user/syscall.c                          |  15 +-
 python/qemu/console_socket.py                 | 137 +++++----
 python/qemu/machine.py                        |  14 +-
 python/qemu/pylintrc                          |   2 +-
 softmmu/vl.c                                  |   5 +-
 target/i386/fpu_helper.c                      | 426 +++++++++++++-------------
 tests/docker/Makefile.include                 |   2 +-
 tests/docker/docker.py                        |  13 +-
 tests/docker/dockerfiles/debian-bootstrap.pre |   7 +
 tests/vm/basevm.py                            |  15 +-
 util/oslib-posix.c                            |  15 +
 util/oslib-win32.c                            |  11 +
 18 files changed, 390 insertions(+), 311 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15038.37612 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWb-0004eg-5j; Thu, 29 Oct 2020 21:32:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15038.37612; Thu, 29 Oct 2020 21:32:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWb-0004eY-2X; Thu, 29 Oct 2020 21:32:01 +0000
Received: by outflank-mailman (input) for mailman id 15038;
 Thu, 29 Oct 2020 21:31:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFWZ-0004eO-Jz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 654fa65e-f882-40c5-9c92-113c4257e282;
 Thu, 29 Oct 2020 21:31:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWY-0008Dg-EQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWY-0004dq-De
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFWZ-0004eO-Jz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:59 +0000
X-Inumbo-ID: 654fa65e-f882-40c5-9c92-113c4257e282
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 654fa65e-f882-40c5-9c92-113c4257e282;
	Thu, 29 Oct 2020 21:31:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AiFLVP1Cn0cq1HNLodVM1+tbCD92h0dAyS1oWrt+RFQ=; b=7M/dV463Lr/3fQRa3m9gHiXY1N
	Lf4sH6SNl/qe2tMJKkIHTgqERahHqNKULjEkvY2COPiul0a5W8cwgvcuyCcdflHpUO5kJqmAU3mWz
	OEpwhZDjLNEYKiktC3aG8GQfFxpxjJLMpZ6D0KQj+fK5XutaLiXQXDKaM7rRKGWMBua4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWY-0008Dg-EQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWY-0004dq-De
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:31:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] s390x/protvirt: allow to IPL secure guests with -no-reboot
Message-Id: <E1kYFWY-0004dq-De@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:31:58 +0000

commit d1bb69db4ceb6897ef6a17bf263146b53a123632
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Tue Jul 21 06:32:02 2020 -0400
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 24 08:35:22 2020 +0200

    s390x/protvirt: allow to IPL secure guests with -no-reboot
    
    Right now, -no-reboot prevents secure guests from running. This is
    correct from an implementation point of view, as we have modeled the
    transition from non-secure to secure as a program directed IPL. From
    a user perspective, this is not the behavior of least surprise.
    
    We should implement the IPL into protected mode similar to the
    functions that we use for kdump/kexec. In other words, we do not stop
    here when -no-reboot is specified on the command line. Like function 0
    or function 1, function 10 is not a classic reboot. For example, it
    can only be called once. Before calling it a second time, a real
    reboot/reset must happen in-between. So function code 10 is more or
    less a state transition reset, but not a "standard" reset or reboot.
    
    Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility")
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Acked-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
    Message-Id: <20200721103202.30610-1-borntraeger@de.ibm.com>
    [CH: tweaked description]
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index d46b1f094f..3d2652d75a 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -630,7 +630,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15039.37616 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWl-0004gd-7C; Thu, 29 Oct 2020 21:32:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15039.37616; Thu, 29 Oct 2020 21:32:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWl-0004gW-44; Thu, 29 Oct 2020 21:32:11 +0000
Received: by outflank-mailman (input) for mailman id 15039;
 Thu, 29 Oct 2020 21:32:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFWj-0004gK-C3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ca698c60-8815-4c68-bfb1-fc0487f18033;
 Thu, 29 Oct 2020 21:32:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWi-0008EY-I3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWi-0004ea-HH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFWj-0004gK-C3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:09 +0000
X-Inumbo-ID: ca698c60-8815-4c68-bfb1-fc0487f18033
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ca698c60-8815-4c68-bfb1-fc0487f18033;
	Thu, 29 Oct 2020 21:32:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wx01USUob2iSOAXxRsI00su9hKz4ASk4sQHtAKuRc44=; b=t7N/g5QmjefM25GpN4p88WL2lF
	cB5LemHjYl8pqx8d0j4eVKFvfHr9ob+H09U7k73Y9QtHqqI7qVt3cZBN+pqQ21T5TNl2Et/QzttbA
	wh04cxaSmYAkzBRNXRU420xVJbZ9UQVuLg+vzIlCO3qhlIfAHyhFDbZ783699Cc50620=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWi-0008EY-I3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWi-0004ea-HH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] s390x/s390-virtio-ccw: fix loadparm property getter
Message-Id: <E1kYFWi-0004ea-HH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:08 +0000

commit d6645483285feaa0aa26fe2b0c3bac6989250d2f
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Thu Jul 23 18:27:17 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 24 08:49:53 2020 +0200

    s390x/s390-virtio-ccw: fix loadparm property getter
    
    The function machine_get_loadparm() is supposed to produce a C-string,
    that is a NUL-terminated one, but it does not. ElectricFence can detect
    this problem if the loadparm machine property is used.
    
    Let us make the returned string a NUL-terminated one.
    
    Fixes: 7104bae9de ("hw/s390x: provide loadparm property for the machine")
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200723162717.88485-1-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 8cc2f25d8a..403d30e13b 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -701,8 +701,12 @@ bool hpage_1m_allowed(void)
 static char *machine_get_loadparm(Object *obj, Error **errp)
 {
     S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+    char *loadparm_str;
 
-    return g_memdup(ms->loadparm, sizeof(ms->loadparm));
+    /* make a NUL-terminated string */
+    loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
+    loadparm_str[sizeof(ms->loadparm)] = 0;
+    return loadparm_str;
 }
 
 static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15040.37622 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWv-0004i9-Aa; Thu, 29 Oct 2020 21:32:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15040.37622; Thu, 29 Oct 2020 21:32:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFWv-0004i1-6m; Thu, 29 Oct 2020 21:32:21 +0000
Received: by outflank-mailman (input) for mailman id 15040;
 Thu, 29 Oct 2020 21:32:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFWt-0004hn-DW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d04b040e-3a57-4de6-b20e-8b98e1925648;
 Thu, 29 Oct 2020 21:32:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWs-0008Eh-Ld
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFWs-0004fE-Ku
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFWt-0004hn-DW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:19 +0000
X-Inumbo-ID: d04b040e-3a57-4de6-b20e-8b98e1925648
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d04b040e-3a57-4de6-b20e-8b98e1925648;
	Thu, 29 Oct 2020 21:32:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uHrYA0rVLWWl+Ib58N8vXti6aYsSBFKlQh60X1WTOTo=; b=tHYhsOiGmvhVybdR4iQHSWNzXJ
	uZ5L/LKtRK4/jnUo5o6MevhRmpTG6nC19KTB8Oj0KFqzMQ3IAMC0gUenimNffC+wHJS269j3WI6fR
	cWmDNwpfsk9j9Ni42qtp4F/FMybZtOsDb4a0kIK4vQtX118gj1Dz6CaI+Di/qpmNViIs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWs-0008Eh-Ld
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFWs-0004fE-Ku
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging
Message-Id: <E1kYFWs-0004fE-Ku@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:18 +0000

commit 9303ecb658a0194560d1eecde165a1511223c2d8
Merge: cb320a07e6cb6e251f9aeb4bf57f99cc320eb8ea d6645483285feaa0aa26fe2b0c3bac6989250d2f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 17:25:06 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 17:25:06 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging
    
    fixes for protected virtualization and loadparm handling
    
    # gpg: Signature made Mon 27 Jul 2020 15:01:32 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200727:
      s390x/s390-virtio-ccw: fix loadparm property getter
      s390x/protvirt: allow to IPL secure guests with -no-reboot
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/s390x/ipl.c             | 3 ++-
 hw/s390x/s390-virtio-ccw.c | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15041.37624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFX5-0004jW-B2; Thu, 29 Oct 2020 21:32:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15041.37624; Thu, 29 Oct 2020 21:32:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFX5-0004jO-8B; Thu, 29 Oct 2020 21:32:31 +0000
Received: by outflank-mailman (input) for mailman id 15041;
 Thu, 29 Oct 2020 21:32:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFX4-0004jB-6o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1d7fa410-ef2b-4b01-88c9-92363ccac1cc;
 Thu, 29 Oct 2020 21:32:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFX3-0008Eu-2k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFX3-0004gi-1w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFX4-0004jB-6o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:30 +0000
X-Inumbo-ID: 1d7fa410-ef2b-4b01-88c9-92363ccac1cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1d7fa410-ef2b-4b01-88c9-92363ccac1cc;
	Thu, 29 Oct 2020 21:32:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sCZwbuXQTbLc7ivprGZwq46fmRdP7fvnoBCqIpk4VmE=; b=xHSnzAyX2wDketepA0fzxjgrUi
	PtQH5SOAm52azdk0OPL3X4etxytcdyq7FLP/ZCqcvy2NmGW1rNVMbKZ9NRahZNy0AKJaT997AGy7m
	YfruPK2/B+/lcvQZ7tVcZholPmP6x1l3zKtcjRYxCR2x5tY0Yz3dje4LST0CN3orm9iQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFX3-0008Eu-2k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFX3-0004gi-1w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-mem-pci: force virtio version 1
Message-Id: <E1kYFX3-0004gi-1w@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:29 +0000

commit c22aba196341995f2e45c37eed36cc7be09e4bc3
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Mon Jul 27 13:59:05 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 09:38:33 2020 -0400

    virtio-mem-pci: force virtio version 1
    
    Trying to run simple virtio-mem-pci examples currently fails with
        qemu-system-x86_64: -device virtio-mem-pci,id=vm0,memdev=mem0,node=0,
        requested-size=300M: device is modern-only, use disable-legacy=on
    due to the added safety checks in 9b3a35ec8236 ("virtio: verify that legacy
    support is not accidentally on").
    
    As noted by Conny, we have to force virtio version 1. While at it, use
    qdev_realize() to set the parent bus and realize - like most other
    virtio-*-pci implementations.
    
    Fixes: 0b9a2443a48b ("virtio-pci: Proxy for virtio-mem")
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Cc: Cornelia Huck <cohuck@redhat.com>
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200727115905.129397-1-david@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-mem-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c
index d375280ee1..590cec041b 100644
--- a/hw/virtio/virtio-mem-pci.c
+++ b/hw/virtio/virtio-mem-pci.c
@@ -21,8 +21,8 @@ static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOMEMPCI *mem_pci = VIRTIO_MEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&mem_pci->vdev);
 
-    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
-    object_property_set_bool(OBJECT(vdev), "realized", true, errp);
+    virtio_pci_force_virtio_1(vpci_dev);
+    qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
 static void virtio_mem_pci_set_addr(MemoryDeviceState *md, uint64_t addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15042.37628 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXG-0004l0-CW; Thu, 29 Oct 2020 21:32:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15042.37628; Thu, 29 Oct 2020 21:32:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXG-0004ks-9e; Thu, 29 Oct 2020 21:32:42 +0000
Received: by outflank-mailman (input) for mailman id 15042;
 Thu, 29 Oct 2020 21:32:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFXE-0004kh-Oy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e5faaa73-0ea3-4d94-8791-582ee531df60;
 Thu, 29 Oct 2020 21:32:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXD-0008GX-7D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXD-0004ip-5Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFXE-0004kh-Oy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:40 +0000
X-Inumbo-ID: e5faaa73-0ea3-4d94-8791-582ee531df60
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e5faaa73-0ea3-4d94-8791-582ee531df60;
	Thu, 29 Oct 2020 21:32:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=82BDBvk49Vi3hT6aBmfS6mKUDFzcrQMo2nIL8nHWBLU=; b=AEystIMeOIuOu2vB660AAVVggf
	1ToRs9RxN576KrpsqEv0nRJnBdSBFE8qv1mSSBJhhTjZdTCMZGgHdfiyjqXFh+3h8F784lMK5Ezx+
	rxbCDkXNs3vRuYeYE79xeLvG9gHVhDeYuo901582CSKtPYre5SRTp4rXcoXQTlrobWHs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXD-0008GX-7D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXD-0004ip-5Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/pci-host: save/restore pci host config register
Message-Id: <E1kYFXD-0004ip-5Z@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:39 +0000

commit 2ebc21216f58f6fcbf16f7ec0bebe7f72ab3d8ca
Author:     Hogan Wang <king.wang@huawei.com>
AuthorDate: Mon Jul 27 16:46:20 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:24:39 2020 -0400

    hw/pci-host: save/restore pci host config register
    
    The pci host config register is used to save PCI address for
    read/write config data. If guest writes a value to config register,
    and then QEMU pauses the vcpu to migrate, after the migration, the guest
    will continue to write pci config data, and the write data will be ignored
    because of new qemu process losing the config register state.
    
    To trigger the bug:
    1. guest is booting in seabios.
    2. guest enables the SMRAM in seabios:piix4_apmc_smm_setup, and then
       expects to disable the SMRAM by pci_config_writeb.
    3. after guest writes the pci host config register, QEMU pauses vcpu
       to finish migration.
    4. guest write of config data(0x0A) fails to disable the SMRAM because
       the config register state is lost.
    5. guest continues to boot and crashes in ipxe option ROM due to SMRAM
       in enabled state.
    
    Example Reproducer:
    
    step 1. Make modifications to seabios and qemu for increase reproduction
    efficiency, write 0xf0 to 0x402 port notify qemu to stop vcpu after
    0x0cf8 port wrote i440 configure register. qemu stop vcpu when catch
    0x402 port wrote 0xf0.
    
    seabios:/src/hw/pci.c
    @@ -52,6 +52,11 @@ void pci_config_writeb(u16 bdf, u32 addr, u8 val)
             writeb(mmconfig_addr(bdf, addr), val);
         } else {
             outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD);
    +       if (bdf == 0 && addr == 0x72 && val == 0xa) {
    +            dprintf(1, "stop vcpu\n");
    +            outb(0xf0, 0x402); // notify qemu to stop vcpu
    +            dprintf(1, "resume vcpu\n");
    +        }
             outb(val, PORT_PCI_DATA + (addr & 3));
         }
     }
    
    qemu:hw/char/debugcon.c
    @@ -60,6 +61,9 @@ static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
         printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02" PRIx64 "]\n", addr, val);
     #endif
    
    +    if (ch == 0xf0) {
    +        vm_stop(RUN_STATE_PAUSED);
    +    }
         /* XXX this blocks entire thread. Rewrite to use
          * qemu_chr_fe_write and background I/O callbacks */
         qemu_chr_fe_write_all(&s->chr, &ch, 1);
    
    step 2. start vm1 by the following command line, and then vm stopped.
    $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
     -netdev tap,ifname=tap-test,id=hostnet0,vhost=on,downscript=no,script=no\
     -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
     -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
     -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
     -device isa-debugcon,iobase=0x402,chardev=seabios\
     -monitor stdio
    
    step 3. start vm2 to accept vm1 state.
    $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
     -netdev tap,ifname=tap-test1,id=hostnet0,vhost=on,downscript=no,script=no\
     -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
     -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
     -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
     -device isa-debugcon,iobase=0x402,chardev=seabios\
     -monitor stdio \
     -incoming tcp:127.0.0.1:8000
    
    step 4. execute the following qmp command in vm1 to migrate.
    (qemu) migrate tcp:127.0.0.1:8000
    
    step 5. execute the following qmp command in vm2 to resume vcpu.
    (qemu) cont
    Before this patch, we get KVM "emulation failure" error on vm2.
    This patch fixes it.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Hogan Wang <hogan.wang@huawei.com>
    Message-Id: <20200727084621.3279-1-hogan.wang@huawei.com>
    Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/core/machine.c         |  1 +
 hw/i386/pc.c              |  3 ++-
 hw/pci/pci_host.c         | 33 +++++++++++++++++++++++++++++++++
 include/hw/pci/pci_host.h |  1 +
 4 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2f881d6d75..8d1a90c6cf 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -29,6 +29,7 @@
 #include "migration/vmstate.h"
 
 GlobalProperty hw_compat_5_0[] = {
+    { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
     { "virtio-balloon-device", "page-poison", "false" },
     { "vmport", "x-read-set-eax", "off" },
     { "vmport", "x-signal-unsupported-cmd", "off" },
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3d419d5991..47c5ca3e34 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -97,7 +97,8 @@
 #include "fw_cfg.h"
 #include "trace.h"
 
-GlobalProperty pc_compat_5_0[] = {};
+GlobalProperty pc_compat_5_0[] = {
+};
 const size_t pc_compat_5_0_len = G_N_ELEMENTS(pc_compat_5_0);
 
 GlobalProperty pc_compat_4_2[] = {
diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c
index ce7bcdb1d5..8ca5fadcbd 100644
--- a/hw/pci/pci_host.c
+++ b/hw/pci/pci_host.c
@@ -22,8 +22,10 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_host.h"
+#include "hw/qdev-properties.h"
 #include "qemu/module.h"
 #include "hw/pci/pci_bus.h"
+#include "migration/vmstate.h"
 #include "trace.h"
 
 /* debug PCI */
@@ -200,12 +202,43 @@ const MemoryRegionOps pci_host_data_be_ops = {
     .endianness = DEVICE_BIG_ENDIAN,
 };
 
+static bool pci_host_needed(void *opaque)
+{
+    PCIHostState *s = opaque;
+    return s->mig_enabled;
+}
+
+const VMStateDescription vmstate_pcihost = {
+    .name = "PCIHost",
+    .needed = pci_host_needed,
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(config_reg, PCIHostState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static Property pci_host_properties_common[] = {
+    DEFINE_PROP_BOOL("x-config-reg-migration-enabled", PCIHostState,
+                     mig_enabled, true),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void pci_host_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    device_class_set_props(dc, pci_host_properties_common);
+    dc->vmsd = &vmstate_pcihost;
+}
+
 static const TypeInfo pci_host_type_info = {
     .name = TYPE_PCI_HOST_BRIDGE,
     .parent = TYPE_SYS_BUS_DEVICE,
     .abstract = true,
     .class_size = sizeof(PCIHostBridgeClass),
     .instance_size = sizeof(PCIHostState),
+    .class_init = pci_host_class_init,
 };
 
 static void pci_host_register_types(void)
diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h
index 9ce088bd13..6210a7e14d 100644
--- a/include/hw/pci/pci_host.h
+++ b/include/hw/pci/pci_host.h
@@ -45,6 +45,7 @@ struct PCIHostState {
     MemoryRegion data_mem;
     MemoryRegion mmcfg;
     uint32_t config_reg;
+    bool mig_enabled;
     PCIBus *bus;
 
     QLIST_ENTRY(PCIHostState) next;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:32:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15043.37631 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXP-0004mC-Dx; Thu, 29 Oct 2020 21:32:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15043.37631; Thu, 29 Oct 2020 21:32:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXP-0004m4-B6; Thu, 29 Oct 2020 21:32:51 +0000
Received: by outflank-mailman (input) for mailman id 15043;
 Thu, 29 Oct 2020 21:32:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFXO-0004lt-4h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 780b0948-fc0e-4c2a-8fb0-28651b7c664e;
 Thu, 29 Oct 2020 21:32:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXN-0008Gf-Ba
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXN-0004jU-9w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFXO-0004lt-4h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:50 +0000
X-Inumbo-ID: 780b0948-fc0e-4c2a-8fb0-28651b7c664e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 780b0948-fc0e-4c2a-8fb0-28651b7c664e;
	Thu, 29 Oct 2020 21:32:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BM2HP+bkLEleRZr6L6XnCiW/j58evz7UM8ow0iMOCvY=; b=ef6RrdCrHWgaUmjWhoAzAJ/aEo
	KWqPgezcsFmUgWuucsv+cMgXWpegSS0Y5aOTnGfzzIN1wn8/ngqv2rr8s01KdaAUSIJ+lIbVlUjZw
	usY5vVzZhp6RI5rvEgFl8zw/MySMUuCFumjrV/aVLzxaWrpPe5JWFQe4pzQHs40kEqdw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXN-0008Gf-Ba
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXN-0004jU-9w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Fix vhost-user buffer over-read on ram hot-unplug
Message-Id: <E1kYFXN-0004jU-9w@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:49 +0000

commit 4fdecf0543b49b8e171510104f3117538b9d1fe9
Author:     Raphael Norwitz <raphael.norwitz@nutanix.com>
AuthorDate: Fri Jul 17 04:21:30 2020 +0000
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    Fix vhost-user buffer over-read on ram hot-unplug
    
    The VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS vhost-user protocol
    feature introduced a shadow-table, used by the backend to dynamically
    determine how a vdev's memory regions have changed since the last
    vhost_user_set_mem_table() call. On hot-remove, a memmove() operation
    is used to overwrite the removed shadow region descriptor(s). The size
    parameter of this memmove was off by 1 such that if a VM with a backend
    supporting the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS filled it's
    shadow-table (by performing the maximum number of supported hot-add
    operatons) and attempted to remove the last region, Qemu would read an
    out of bounds value and potentially crash.
    
    This change fixes the memmove() bounds such that this erroneous read can
    never happen.
    
    Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com>
    Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Message-Id: <1594799958-31356-1-git-send-email-raphael.norwitz@nutanix.com>
    Fixes: f1aeb14b0809 ("Transmit vhost-user memory regions individually")
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 31231218dc..d7e2423762 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -672,7 +672,7 @@ static int send_remove_regions(struct vhost_dev *dev,
         memmove(&u->shadow_regions[shadow_reg_idx],
                 &u->shadow_regions[shadow_reg_idx + 1],
                 sizeof(struct vhost_memory_region) *
-                (u->num_shadow_regions - shadow_reg_idx));
+                (u->num_shadow_regions - shadow_reg_idx - 1));
         u->num_shadow_regions--;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15044.37637 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXZ-0004p7-Gm; Thu, 29 Oct 2020 21:33:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15044.37637; Thu, 29 Oct 2020 21:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXZ-0004ov-Cv; Thu, 29 Oct 2020 21:33:01 +0000
Received: by outflank-mailman (input) for mailman id 15044;
 Thu, 29 Oct 2020 21:33:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFXY-0004oj-Aq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0bc06289-87b8-4efd-ae5f-bfb14c0ce6fb;
 Thu, 29 Oct 2020 21:32:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXX-0008HR-F7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXX-0004k9-EN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFXY-0004oj-Aq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:00 +0000
X-Inumbo-ID: 0bc06289-87b8-4efd-ae5f-bfb14c0ce6fb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0bc06289-87b8-4efd-ae5f-bfb14c0ce6fb;
	Thu, 29 Oct 2020 21:32:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0Vg3m5TOECgC7POpO8yPSDC32rlIivP0SSlGVUCRy54=; b=LYepmjiV4IudsXvNeifa5OzyN/
	gzMAuRAQhp7ZYLPLpXaP+u8NtqCGUMsXy02amrABHyCSUs5Iux71iFjDhndMmDLKt5WOK/sAmGOL3
	bCjeEukzUMW7IDTGecrkbL3PrQFxgJTuKbRK1qgaj3rnvBR3RLLqTtH02e7c2yTXLwb0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXX-0008HR-F7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXX-0004k9-EN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:32:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] libvhost-user: Report descriptor index on panic
Message-Id: <E1kYFXX-0004k9-EN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:32:59 +0000

commit 8fe9805c73c277dc2feeaa83de73d6a58bf23f39
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:19:35 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    libvhost-user: Report descriptor index on panic
    
    We want to report the index of the descriptor,
    not its pointer.
    
    Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171935.18535-1-philmd@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index d315db1396..53f16bdf08 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -2074,7 +2074,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
 
     /* If their number is silly, that's a fatal mistake. */
     if (*head >= vq->vring.num) {
-        vu_panic(dev, "Guest says index %u is available", head);
+        vu_panic(dev, "Guest says index %u is available", *head);
         return false;
     }
 
@@ -2133,7 +2133,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
     smp_wmb();
 
     if (*next >= max) {
-        vu_panic(dev, "Desc next is %u", next);
+        vu_panic(dev, "Desc next is %u", *next);
         return VIRTQUEUE_READ_DESC_ERROR;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15045.37640 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXk-0004qw-I0; Thu, 29 Oct 2020 21:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15045.37640; Thu, 29 Oct 2020 21:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXk-0004qp-Ej; Thu, 29 Oct 2020 21:33:12 +0000
Received: by outflank-mailman (input) for mailman id 15045;
 Thu, 29 Oct 2020 21:33:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFXi-0004qe-Pd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id da1e011f-0b5e-4efb-bb1b-abcf951c4b9e;
 Thu, 29 Oct 2020 21:33:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXh-0008Hr-IR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXh-0004l3-Hn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFXi-0004qe-Pd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:10 +0000
X-Inumbo-ID: da1e011f-0b5e-4efb-bb1b-abcf951c4b9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id da1e011f-0b5e-4efb-bb1b-abcf951c4b9e;
	Thu, 29 Oct 2020 21:33:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xz9l72CJeHoBJuuF04gJ8oLYTh0QOncotspcMmqpEEE=; b=qkIcs/cL7hV/u6T3bR5Lbc8pZc
	rqwYACUvSv0Wqvd59TT8d93rzVrQh+Db1Ib4/kUcqQ1z76LwvHAI65SMI3ZXVvcYo3osYNwHEQs/R
	DKqs/xzWDp0XaKc23sLu5E9q8j9eZ51Mi2EqIKGzpkwBhyl47GZ4VtLAD2v+rpuHV7yU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXh-0008Hr-IR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXh-0004l3-Hn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
Message-Id: <E1kYFXh-0004l3-Hn@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:33:09 +0000

commit 386494f29e2b902bc501176573bb4c69eab666c4
Author:     Cindy Lu <lulu@redhat.com>
AuthorDate: Fri Jul 10 14:46:42 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
    
    In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
    
    Signed-off-by: Cindy Lu <lulu@redhat.com>
    Message-Id: <20200710064642.24505-1-lulu@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 65d5aaf08a..4580f3efd8 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -37,7 +37,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
 static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
                               void *vaddr, bool readonly)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
@@ -60,7 +60,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
 static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
                                 hwaddr size)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15046.37644 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXu-00051X-KO; Thu, 29 Oct 2020 21:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15046.37644; Thu, 29 Oct 2020 21:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFXu-00051P-HQ; Thu, 29 Oct 2020 21:33:22 +0000
Received: by outflank-mailman (input) for mailman id 15046;
 Thu, 29 Oct 2020 21:33:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFXs-0004zr-Ds
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a41a0efa-4283-49f1-a1d6-1ecc5f8c0e6b;
 Thu, 29 Oct 2020 21:33:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXr-0008Hz-MC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFXr-0004lf-LE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFXs-0004zr-Ds
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:20 +0000
X-Inumbo-ID: a41a0efa-4283-49f1-a1d6-1ecc5f8c0e6b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a41a0efa-4283-49f1-a1d6-1ecc5f8c0e6b;
	Thu, 29 Oct 2020 21:33:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y6tYZ/Jhn/wSJmins5hJeVITaHBrbwMQIxMIEbCrOjM=; b=f02EzrzZnWOs4rzWInBaew1C0I
	XPqOEdEQnT9PdfktOsty8YRUsDXcSskiJ5mTTCCYlItOnV9v4+cjC4u05KqWxQUUEnO5eJh/c4wzR
	O/9IsYsfVVxLPtetT/tnz5JUMs1yvOsri1DOa8fwZ1mF03YIw+8GfRtdomgyeEtC3/go=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXr-0008Hz-MC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFXr-0004lf-LE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] MAINTAINERS: Cover the firmware JSON schema
Message-Id: <E1kYFXr-0004lf-LE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:33:19 +0000

commit d0d89526f70ded5ac41a4c6bb071c0d919b772db
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Fri Jul 3 20:34:50 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    MAINTAINERS: Cover the firmware JSON schema
    
    Add an entry to cover firmware.json (see commit 3a0adfc9bf:
    schema that describes the different uses and properties of
    virtual machine firmware).
    
    Cc: Laszlo Ersek <lersek@redhat.com>
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Kashyap Chamarthy <kchamart@redhat.com>
    Cc: Daniel P. Berrange <berrange@redhat.com>
    Suggested-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200703183450.32398-1-philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3395abd4e1..0886eb3d2b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2667,6 +2667,14 @@ F: include/hw/i2c/smbus_master.h
 F: include/hw/i2c/smbus_slave.h
 F: include/hw/i2c/smbus_eeprom.h
 
+Firmware schema specifications
+M: Laszlo Ersek <lersek@redhat.com>
+M: Philippe Mathieu-Daudé <philmd@redhat.com>
+R: Daniel P. Berrange <berrange@redhat.com>
+R: Kashyap Chamarthy <kchamart@redhat.com>
+S: Maintained
+F: docs/interop/firmware.json
+
 EDK2 Firmware
 M: Laszlo Ersek <lersek@redhat.com>
 M: Philippe Mathieu-Daudé <philmd@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15047.37648 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFY4-00057q-MK; Thu, 29 Oct 2020 21:33:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15047.37648; Thu, 29 Oct 2020 21:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFY4-00057g-J4; Thu, 29 Oct 2020 21:33:32 +0000
Received: by outflank-mailman (input) for mailman id 15047;
 Thu, 29 Oct 2020 21:33:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFY3-00057X-Aj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f8ba3370-6574-4668-9565-6dc5e59eb4dc;
 Thu, 29 Oct 2020 21:33:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFY1-0008I7-Qm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFY1-0004mI-PC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFY3-00057X-Aj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:31 +0000
X-Inumbo-ID: f8ba3370-6574-4668-9565-6dc5e59eb4dc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f8ba3370-6574-4668-9565-6dc5e59eb4dc;
	Thu, 29 Oct 2020 21:33:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QSVBSPcdLf/KBxk2Yddh172G1o8gC7Sge0FEr9W0g+I=; b=Yyi5LUazV/xcfABs6CF1p8duB6
	XnAvfsQWgOK5wuhLvsbZM/8kjhTvF0aAnbDcc26U3qkr+uc2NK/wsm30JUKOVsKk/Gx+fbhqc4jPU
	eWAwKPJjG1IExiumZ8a4fztEZAnukWfrPOgX7CUR0NK7IFzfWV4eDatBipmD+c0ShWFM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFY1-0008I7-Qm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFY1-0004mI-PC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-pci: fix virtio_pci_queue_enabled()
Message-Id: <E1kYFY1-0004mI-PC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:33:29 +0000

commit 0c9753ebda274b0e618d7b4032bb2d83d27483ed
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Mon Jul 27 17:33:19 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 11:34:50 2020 -0400

    virtio-pci: fix virtio_pci_queue_enabled()
    
    In legacy mode, virtio_pci_queue_enabled() falls back to
    virtio_queue_enabled() to know if the queue is enabled.
    
    But virtio_queue_enabled() calls again virtio_pci_queue_enabled()
    if k->queue_enabled is set. This ends in a crash after a stack
    overflow.
    
    The problem can be reproduced with
    "-device virtio-net-pci,disable-legacy=off,disable-modern=true
     -net tap,vhost=on"
    
    And a look to the backtrace is very explicit:
    
        ...
        #4  0x000000010029a438 in virtio_queue_enabled ()
        #5  0x0000000100497a9c in virtio_pci_queue_enabled ()
        ...
        #130902 0x000000010029a460 in virtio_queue_enabled ()
        #130903 0x0000000100497a9c in virtio_pci_queue_enabled ()
        #130904 0x000000010029a460 in virtio_queue_enabled ()
        #130905 0x0000000100454a20 in vhost_net_start ()
        ...
    
    This patch fixes the problem by introducing a new function
    for the legacy case and calls it from virtio_pci_queue_enabled().
    It also calls it from virtio_queue_enabled() to avoid code duplication.
    
    Fixes: f19bcdfedd53 ("virtio-pci: implement queue_enabled method")
    Cc: Jason Wang <jasowang@redhat.com>
    Cc: Cindy Lu <lulu@redhat.com>
    CC: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-Id: <20200727153319.43716-1-lvivier@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-pci.c     | 2 +-
 hw/virtio/virtio.c         | 7 ++++++-
 include/hw/virtio/virtio.h | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ada1101d07..4ad3ad81a2 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1116,7 +1116,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
         return proxy->vqs[vdev->queue_sel].enabled;
     }
 
-    return virtio_queue_enabled(vdev, n);
+    return virtio_queue_enabled_legacy(vdev, n);
 }
 
 static int virtio_pci_add_mem_cap(VirtIOPCIProxy *proxy,
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 546a198e79..e983025217 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3309,6 +3309,11 @@ hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n)
     return vdev->vq[n].vring.desc;
 }
 
+bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n)
+{
+    return virtio_queue_get_desc_addr(vdev, n) != 0;
+}
+
 bool virtio_queue_enabled(VirtIODevice *vdev, int n)
 {
     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
@@ -3317,7 +3322,7 @@ bool virtio_queue_enabled(VirtIODevice *vdev, int n)
     if (k->queue_enabled) {
         return k->queue_enabled(qbus->parent, n);
     }
-    return virtio_queue_get_desc_addr(vdev, n) != 0;
+    return virtio_queue_enabled_legacy(vdev, n);
 }
 
 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 198ffc7626..e424df12cf 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -295,6 +295,7 @@ typedef struct VirtIORNGConf VirtIORNGConf;
                       VIRTIO_F_RING_PACKED, false)
 
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
+bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n);
 bool virtio_queue_enabled(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15048.37652 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYE-000592-NU; Thu, 29 Oct 2020 21:33:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15048.37652; Thu, 29 Oct 2020 21:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYE-00058u-Ka; Thu, 29 Oct 2020 21:33:42 +0000
Received: by outflank-mailman (input) for mailman id 15048;
 Thu, 29 Oct 2020 21:33:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFYC-00058k-Ul
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f78df956-a57d-42b4-be5a-b69783955d78;
 Thu, 29 Oct 2020 21:33:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYB-0008ID-VB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYB-0004mz-U4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFYC-00058k-Ul
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:40 +0000
X-Inumbo-ID: f78df956-a57d-42b4-be5a-b69783955d78
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f78df956-a57d-42b4-be5a-b69783955d78;
	Thu, 29 Oct 2020 21:33:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/wuZ+lex3QmQWWX+Fok0UcEIJTW4RHlSkdbk3r8H+OI=; b=nX/mc0nuI7J+q5RdeEIxWBpMdi
	aKK3AC9D2KV4TdlBFnxuyi7ZVXnzjGxA/J8TaW0UTGOFuw03CO+7ecJh9uBcWMe5OB3KAxA8wIOkh
	MMukOo9akl9eAsB4qtH+DRmJNc0VD7MNCGYFwG04GxrDoSRiPdgna8QmDHtM/IOF+tyw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYB-0008ID-VB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYB-0004mz-U4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYFYB-0004mz-U4@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:33:39 +0000

commit 93ea484375ab473379dd9c836261ef484bd71ab1
Merge: 9303ecb658a0194560d1eecde165a1511223c2d8 0c9753ebda274b0e618d7b4032bb2d83d27483ed
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 21:00:01 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 21:00:01 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio,pci: bugfixes
    
    Minor bugfixes all over the places, including one CVE.
    
    Additionally, a fix for an ancient bug in migration -
    one has to wonder how come no one noticed.
    
    The fix is also non-trivial since we dare not break all
    existing machine types with pci - we have a work around
    in the works, for now we just skip the work-around for
    old machine types.
    
    Great job by Hogan Wang noticing, debugging and fixing it,
    and thanks to Dr. David Alan Gilbert for reviewing the patches.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Mon 27 Jul 2020 16:34:58 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-pci: fix virtio_pci_queue_enabled()
      MAINTAINERS: Cover the firmware JSON schema
      vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
      libvhost-user: Report descriptor index on panic
      Fix vhost-user buffer over-read on ram hot-unplug
      hw/pci-host: save/restore pci host config register
      virtio-mem-pci: force virtio version 1
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                           |  8 ++++++++
 contrib/libvhost-user/libvhost-user.c |  4 ++--
 hw/core/machine.c                     |  1 +
 hw/i386/pc.c                          |  3 ++-
 hw/pci/pci_host.c                     | 33 +++++++++++++++++++++++++++++++++
 hw/virtio/vhost-user.c                |  2 +-
 hw/virtio/vhost-vdpa.c                |  4 ++--
 hw/virtio/virtio-mem-pci.c            |  4 ++--
 hw/virtio/virtio-pci.c                |  2 +-
 hw/virtio/virtio.c                    |  7 ++++++-
 include/hw/pci/pci_host.h             |  1 +
 include/hw/virtio/virtio.h            |  1 +
 12 files changed, 60 insertions(+), 10 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:33:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:33:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15049.37656 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYO-0005AR-PD; Thu, 29 Oct 2020 21:33:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15049.37656; Thu, 29 Oct 2020 21:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYO-0005AJ-M3; Thu, 29 Oct 2020 21:33:52 +0000
Received: by outflank-mailman (input) for mailman id 15049;
 Thu, 29 Oct 2020 21:33:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFYN-0005A9-Jh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 04e43ad9-1c3e-4656-b3da-2d7fe7c1e97c;
 Thu, 29 Oct 2020 21:33:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYM-0008IP-Bn
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYM-0004o8-Av
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFYN-0005A9-Jh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:51 +0000
X-Inumbo-ID: 04e43ad9-1c3e-4656-b3da-2d7fe7c1e97c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 04e43ad9-1c3e-4656-b3da-2d7fe7c1e97c;
	Thu, 29 Oct 2020 21:33:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ci0f84cqyrPZMP8DeQ5pVZSDaRZGYzzKzZUbg8OWEJs=; b=F7m589Mwua9h+Lez/jrgXbr4L+
	rFbQ2dkuGaQBtfaXDS51uG0Bf1kUKKKaS28ekkXnx7MBW9bSU6cOCb0wzerzQHq0sr1SIine0JwwZ
	QYb/ecnSJfHQHYV8NqChdz9NyrXpKXwAn4rmcMm5JD8PvNyLwpgZg798nQNYlSiaykYY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYM-0008IP-Bn
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYM-0004o8-Av
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:33:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/amend: Check whether the node exists
Message-Id: <E1kYFYM-0004o8-Av@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:33:50 +0000

commit 984c36781404592a6fbaa31ec6d25d6b8f933489
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Fri Jul 10 11:50:37 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 12:37:25 2020 +0200

    block/amend: Check whether the node exists
    
    We should check whether the user-specified node-name actually refers to
    a node.  The simplest way to do that is to use bdrv_lookup_bs() instead
    of bdrv_find_node() (the former wraps the latter, and produces an error
    message if necessary).
    
    Reported-by: Coverity (CID 1430268)
    Fixes: ced914d0ab9fb2c900f873f6349a0b8eecd1fdbe
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200710095037.10885-1-mreitz@redhat.com>
    Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 block/amend.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/amend.c b/block/amend.c
index f4612dcf08..392df9ef83 100644
--- a/block/amend.c
+++ b/block/amend.c
@@ -69,8 +69,12 @@ void qmp_x_blockdev_amend(const char *job_id,
     BlockdevAmendJob *s;
     const char *fmt = BlockdevDriver_str(options->driver);
     BlockDriver *drv = bdrv_find_format(fmt);
-    BlockDriverState *bs = bdrv_find_node(node_name);
+    BlockDriverState *bs;
 
+    bs = bdrv_lookup_bs(NULL, node_name, errp);
+    if (!bs) {
+        return;
+    }
 
     if (!drv) {
         error_setg(errp, "Block driver '%s' not found or not supported", fmt);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15050.37660 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYY-0005CT-Qf; Thu, 29 Oct 2020 21:34:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15050.37660; Thu, 29 Oct 2020 21:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYY-0005CL-Ne; Thu, 29 Oct 2020 21:34:02 +0000
Received: by outflank-mailman (input) for mailman id 15050;
 Thu, 29 Oct 2020 21:34:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFYX-0005BW-Jm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ae798889-22de-4b5e-8904-a2f96d298e47;
 Thu, 29 Oct 2020 21:34:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYW-0008Ix-Gg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYW-0004om-Er
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFYX-0005BW-Jm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:01 +0000
X-Inumbo-ID: ae798889-22de-4b5e-8904-a2f96d298e47
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ae798889-22de-4b5e-8904-a2f96d298e47;
	Thu, 29 Oct 2020 21:34:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UU/lH8EWQHSP+oYVy+0CkB1lR2x5UrHFxAgrQtVlZnk=; b=CljCH9L+uaAipCQjPWSa5Hierk
	t2GeZnK7ROWzvnudnOyIaQ9DtIc22qTqsgvIrLJn9o0Fg3kfXKSDFIARD5rgHeXDbdHq3nzphgBYf
	H9q3FIpAheTOcak8Ztyy+hY4sxwMa+Fp/C1k3OJH/3Ei/G5Bnte3VDjjAVDHrED66OE0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYW-0008Ix-Gg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYW-0004om-Er
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Select a default machine for the rx and avr targets
Message-Id: <E1kYFYW-0004om-Er@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:00 +0000

commit 733dafe4914ef2e6d6a9d546b7fdbb429f3590e7
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 18:19:08 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 12:37:25 2020 +0200

    iotests: Select a default machine for the rx and avr targets
    
    If you are building only with either the new rx-softmmu or avr-softmmu
    target, "make check-block" fails a couple of tests since there is no
    default machine defined in these new targets. We have to select a machine
    in the "check" script for these, just like we already do for the arm- and
    tricore-softmmu targets.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200722161908.25383-1-thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/check | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e0d8049012..0657f7286c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -595,15 +595,19 @@ then
 fi
 export QEMU_PROG="$(type -p "$QEMU_PROG")"
 
+export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
 case "$QEMU_PROG" in
     *qemu-system-arm|*qemu-system-aarch64)
-        export QEMU_OPTIONS="-nodefaults -display none -machine virt -accel qtest"
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine virt"
         ;;
-    *qemu-system-tricore)
-        export QEMU_OPTIONS="-nodefaults -display none -machine tricore_testboard -accel qtest"
+    *qemu-system-avr)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine mega2560"
+        ;;
+    *qemu-system-rx)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine gdbsim-r5f562n8"
         ;;
-    *)
-        export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
+    *qemu-system-tricore)
+        export QEMU_OPTIONS="-$QEMU_OPTIONS -machine tricore_testboard"
         ;;
 esac
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15051.37664 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYi-0005Dd-SS; Thu, 29 Oct 2020 21:34:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15051.37664; Thu, 29 Oct 2020 21:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYi-0005DV-PK; Thu, 29 Oct 2020 21:34:12 +0000
Received: by outflank-mailman (input) for mailman id 15051;
 Thu, 29 Oct 2020 21:34:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFYh-0005DN-W9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 579e03a1-6784-4b8f-ac1b-c13c5faacd65;
 Thu, 29 Oct 2020 21:34:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYg-0008JP-L0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYg-0004pp-JP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFYh-0005DN-W9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:12 +0000
X-Inumbo-ID: 579e03a1-6784-4b8f-ac1b-c13c5faacd65
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 579e03a1-6784-4b8f-ac1b-c13c5faacd65;
	Thu, 29 Oct 2020 21:34:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ltV0N2o2p4g8pwoia9XZcge96Op0RS8mufhlEaSuVzc=; b=A3hxyIiv3mcbxBiyN69vgRDAgn
	4BfJ3O2vXzRB3lOgEYU3anomXl3famASGehnsgSOxsCsojn9bOwbVHy5ZqFpEKaNvVuUX2ZXox/n4
	FyKDSVLc0Cp+pV2jY7MYOzORPY73ywzioU+XgKLqBSRmQDcBKD4WX+WcAvQYXDhBvJAg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYg-0008JP-L0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYg-0004pp-JP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/197: Fix for compat=0.10
Message-Id: <E1kYFYg-0004pp-JP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:10 +0000

commit 1855536256eb0a5708b04b85f744de69559ea323
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Mon Jul 27 15:52:37 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 16:35:17 2020 +0200

    iotests/197: Fix for compat=0.10
    
    Writing zeroes to a qcow2 v2 images without a backing file results in an
    unallocated cluster as of 61b3043965.  197 has a test for COR-ing a
    cluster on an image without a backing file, which means that the data
    will be zero, so now on a v2 image that cluster will just stay
    unallocated, and so the test fails.  Just force compat=1.1 for that
    particular case to enforce the cluster to get allocated.
    
    Fixes: 61b3043965fe3552ee2684a97e7cc809ca7a71b3
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200727135237.1096841-1-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/197 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index 95f05b0e34..121959a09c 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -112,7 +112,9 @@ echo
 echo '=== Partial final cluster ==='
 echo
 
-_make_test_img 1024
+# Force compat=1.1, because writing zeroes on a v2 image without a
+# backing file would just result in an unallocated cluster
+_make_test_img -o compat=1.1 1024
 $QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
 _check_test_img
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15052.37668 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYs-0005Ev-U3; Thu, 29 Oct 2020 21:34:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15052.37668; Thu, 29 Oct 2020 21:34:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFYs-0005El-Qq; Thu, 29 Oct 2020 21:34:22 +0000
Received: by outflank-mailman (input) for mailman id 15052;
 Thu, 29 Oct 2020 21:34:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFYr-0005Eb-L7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a10545bc-d9c2-4fa1-abc6-3a0b1413c2a5;
 Thu, 29 Oct 2020 21:34:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYq-0008JX-Oy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFYq-0004qn-Nm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFYr-0005Eb-L7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:21 +0000
X-Inumbo-ID: a10545bc-d9c2-4fa1-abc6-3a0b1413c2a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a10545bc-d9c2-4fa1-abc6-3a0b1413c2a5;
	Thu, 29 Oct 2020 21:34:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZMnAEb6xe0N0IqKoj4mZq7XXQPwHIQEtO4ZNVoq3R+0=; b=5qh/9qmSxSw3AF9nK4gfmfmH3U
	fMsFzck4R43xQeab7Yut+zingBlPZ7RQ8JgB/6AyJWp1xgmTV5vpyImtA84v78iMWcvwT22I/W8F9
	7o9h/mK8tKo8BwH58WibMXidy7tVL1D9+oHbCROyg7S9j5OrTXE2c3ACQIz0AxkyAh5M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYq-0008JX-Oy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFYq-0004qn-Nm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-27' into staging
Message-Id: <E1kYFYq-0004qn-Nm@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:20 +0000

commit 23ae28783f4674e98f7539d1c05d793166c2fc12
Merge: 93ea484375ab473379dd9c836261ef484bd71ab1 1855536256eb0a5708b04b85f744de69559ea323
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 09:15:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 09:15:44 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-27' into staging
    
    Block patches for 5.1:
    - Coverity fix
    - iotests fix for rx and avr
    - iotests fix for qcow2 -o compat=0.10
    
    # gpg: Signature made Mon 27 Jul 2020 15:36:23 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-27:
      iotests/197: Fix for compat=0.10
      iotests: Select a default machine for the rx and avr targets
      block/amend: Check whether the node exists
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/amend.c            |  6 +++++-
 tests/qemu-iotests/197   |  4 +++-
 tests/qemu-iotests/check | 14 +++++++++-----
 3 files changed, 17 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15053.37672 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZ3-0005GR-0I; Thu, 29 Oct 2020 21:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15053.37672; Thu, 29 Oct 2020 21:34:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZ2-0005GJ-Tb; Thu, 29 Oct 2020 21:34:32 +0000
Received: by outflank-mailman (input) for mailman id 15053;
 Thu, 29 Oct 2020 21:34:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZ1-0005GA-T7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d3ccb949-a963-4c6d-85c1-9f1377bea0ab;
 Thu, 29 Oct 2020 21:34:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZ1-0008Jg-4G
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZ1-0004sA-2g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZ1-0005GA-T7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
X-Inumbo-ID: d3ccb949-a963-4c6d-85c1-9f1377bea0ab
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d3ccb949-a963-4c6d-85c1-9f1377bea0ab;
	Thu, 29 Oct 2020 21:34:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XS/IfvjGhvIvIAXRrJDTib6SFp5inKfA7a7iuH8aRW4=; b=hXbWrlTqgPHg2oOIYGLr8mqH+D
	Sk7LIKewdZ4+DCB49wEqc4FkooqorX1UL+ZFML3EjO7ExAWlIuJ32HmIymOL3we+h8tB3ffbIzrvs
	pwPH5J8z2Fo2manpEUT7YvbdG+2WUcWPoJho/47gDjF4/KPLDlKE/qD5y6nUKAgbjrRg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZ1-0008Jg-4G
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZ1-0004sA-2g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update OpenBIOS images to 7f28286f built from submodule.
Message-Id: <E1kYFZ1-0004sA-2g@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:31 +0000

commit 54414d0fb11314ede939ec80238787c5b2079f4e
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Mon Jul 27 09:15:42 2020 +0100
Commit:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CommitDate: Mon Jul 27 16:08:24 2020 +0100

    Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Cc: qemu-stable@nongnu.org
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index a07757a987..def6d4cf63 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index 2faaab83ba..67b8b83d98 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index dd7eeeeab4..dfa1f10bbc 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 75fbb41d28..7f28286f5c 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 75fbb41d2857d93208c74a8e0228b29fd7bf04c0
+Subproject commit 7f28286f5cb1ca682e3ba0a8706d8884f12bc49e
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15055.37688 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZD-0005LD-EP; Thu, 29 Oct 2020 21:34:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15055.37688; Thu, 29 Oct 2020 21:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZD-0005L5-BH; Thu, 29 Oct 2020 21:34:43 +0000
Received: by outflank-mailman (input) for mailman id 15055;
 Thu, 29 Oct 2020 21:34:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZC-0005KV-0A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5157f7da-24a9-42ff-8309-f6859b367bc6;
 Thu, 29 Oct 2020 21:34:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZB-0008Ju-8H
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZB-0004th-7T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZC-0005KV-0A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:42 +0000
X-Inumbo-ID: 5157f7da-24a9-42ff-8309-f6859b367bc6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5157f7da-24a9-42ff-8309-f6859b367bc6;
	Thu, 29 Oct 2020 21:34:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7lZNcShrGYOjx3H/iNpacb0gtOY3fIZ+Tf1qTUPqjxQ=; b=jTS22vmSAmvh8Ifo1Xkp7jdPw5
	uI00HpALIiRy5N0fEs/UGIqPRhOkmF5Cb2AxNl1rkRK7Dg7BWlwub7YTljoNpCgjHGjZqMOsjprtO
	upayNp1ybcoWF/IElpg2MNnjLN11qVDlwkOGlvx2qO085vEK1IJCc/pnJi9WI+7SkQq4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZB-0008Ju-8H
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZB-0004th-7T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200727' into staging
Message-Id: <E1kYFZB-0004th-7T@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:41 +0000

commit 1b242c3b1ec7c6011901b4f3b4b0876e31746afb
Merge: 23ae28783f4674e98f7539d1c05d793166c2fc12 54414d0fb11314ede939ec80238787c5b2079f4e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 13:46:31 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 13:46:31 2020 +0100

    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200727' into staging
    
    qemu-openbios queue
    
    # gpg: Signature made Mon 27 Jul 2020 16:09:34 BST
    # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
    # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
    # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
    # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
    
    * remotes/mcayland/tags/qemu-openbios-20200727:
      Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:34:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:34:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15060.37695 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZS-0005Ph-GY; Thu, 29 Oct 2020 21:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15060.37695; Thu, 29 Oct 2020 21:34:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZS-0005PZ-Dg; Thu, 29 Oct 2020 21:34:58 +0000
Received: by outflank-mailman (input) for mailman id 15060;
 Thu, 29 Oct 2020 21:34:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZR-0005OF-J7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a0f939ac-a26e-4fdd-aede-9d1d1bc047a4;
 Thu, 29 Oct 2020 21:34:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZL-0008K4-VC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZL-0004xf-UR
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZR-0005OF-J7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:57 +0000
X-Inumbo-ID: a0f939ac-a26e-4fdd-aede-9d1d1bc047a4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a0f939ac-a26e-4fdd-aede-9d1d1bc047a4;
	Thu, 29 Oct 2020 21:34:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=68O61uuOII2SXAZvln9VR9Xm7+fxBJPovU29Z0sFvwU=; b=2/QWvVlTko6kUxusphiIhthiue
	9lYx9/0e6/BwdxByfmf3EJhfOyg4/X9JmiLQT+obSK2BGluIQy6xL3vm1fH+tZR0hiNN9EUsgZ9zh
	JMUJNBbvZQc4h+l1GJw+ensG4+o9jVuovvGdVAtdy8ugGTpEbvY1ISbZuN33iEVREduo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZL-0008K4-VC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZL-0004xf-UR
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:34:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow2: Fix capitalization of header extension constant.
Message-Id: <E1kYFZL-0004xf-UR@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:34:51 +0000

commit 8098969cf2f0acb794b69bd63ee90c9173b6122c
Author:     Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
AuthorDate: Fri Jul 17 11:14:49 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qcow2: Fix capitalization of header extension constant.
    
    Make the capitalization of the hexadecimal numbers consistent for the
    QCOW2 header extension constants in docs/interop/qcow2.txt.
    
    Suggested-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <1594973699-781898-2-git-send-email-andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2.c          | 2 +-
 docs/interop/qcow2.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index fadf3422f8..6ad6bdc166 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -66,7 +66,7 @@ typedef struct {
 } QEMU_PACKED QCowExtension;
 
 #define  QCOW2_EXT_MAGIC_END 0
-#define  QCOW2_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA
+#define  QCOW2_EXT_MAGIC_BACKING_FORMAT 0xe2792aca
 #define  QCOW2_EXT_MAGIC_FEATURE_TABLE 0x6803f857
 #define  QCOW2_EXT_MAGIC_CRYPTO_HEADER 0x0537be77
 #define  QCOW2_EXT_MAGIC_BITMAPS 0x23852875
diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
index cb723463f2..f072e27900 100644
--- a/docs/interop/qcow2.txt
+++ b/docs/interop/qcow2.txt
@@ -231,7 +231,7 @@ be stored. Each extension has a structure like the following:
 
     Byte  0 -  3:   Header extension type:
                         0x00000000 - End of the header extension area
-                        0xE2792ACA - Backing file format name string
+                        0xe2792aca - Backing file format name string
                         0x6803f857 - Feature name table
                         0x23852875 - Bitmaps extension
                         0x0537be77 - Full disk encryption header pointer
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15061.37699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZY-0005RP-I7; Thu, 29 Oct 2020 21:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15061.37699; Thu, 29 Oct 2020 21:35:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZY-0005RG-F2; Thu, 29 Oct 2020 21:35:04 +0000
Received: by outflank-mailman (input) for mailman id 15061;
 Thu, 29 Oct 2020 21:35:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZX-0005R5-5W
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9a9cba20-fc5f-46ee-9834-e58bc8346c23;
 Thu, 29 Oct 2020 21:35:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZW-0008L5-2v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZW-0004z0-1x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZX-0005R5-5W
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:03 +0000
X-Inumbo-ID: 9a9cba20-fc5f-46ee-9834-e58bc8346c23
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9a9cba20-fc5f-46ee-9834-e58bc8346c23;
	Thu, 29 Oct 2020 21:35:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NEykLsqWT6IuzvhzyIv7n/KIvR7a9Ee+i7iVzYOSZ4U=; b=DWYfg91rGxYQH3iioJzqU4FZps
	ZLkPLBno5vmA5gjHq4KRhfn/Owb8QVBf2/Q9792HghllSofVjuKFewgNOt6FCX1K05f2kZ+IeZhXN
	OKKANWOnuUCb/w/lDWqT6y8LYXm1SD3r4MFdfvoyuFDawSR9JFNhD5MublETPu8TGgM4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZW-0008L5-2v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZW-0004z0-1x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: fix style
Message-Id: <E1kYFZW-0004z0-1x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:02 +0000

commit 8243219fa565d7285b520cba0f1579744ae0b3e9
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:16 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: fix style
    
    Mostly, satisfy pep8 complaints.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-2-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 40774eed74..de9ba8d94c 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -28,8 +28,8 @@ disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
-class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
+class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
         self.vm_a.shutdown()
         self.vm_b.shutdown()
@@ -54,7 +54,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                name='bitmap', granularity=granularity)
-        self.assert_qmp(result, 'return', {});
+        self.assert_qmp(result, 'return', {})
 
         s = 0
         while s < write_size:
@@ -71,7 +71,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
-        self.assert_qmp(result, 'return', {});
+        self.assert_qmp(result, 'return', {})
         s = 0
         while s < write_size:
             self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
@@ -104,15 +104,16 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
-        result = self.vm_b.qmp('query-block');
+        result = self.vm_b.qmp('query-block')
         while len(result['return'][0]['dirty-bitmaps']) > 1:
             time.sleep(2)
-            result = self.vm_b.qmp('query-block');
+            result = self.vm_b.qmp('query-block')
 
         result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
 
-        self.assert_qmp(result, 'return/sha256', sha256);
+        self.assert_qmp(result, 'return/sha256', sha256)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15063.37703 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZi-0005TF-KJ; Thu, 29 Oct 2020 21:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15063.37703; Thu, 29 Oct 2020 21:35:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZi-0005T5-Gd; Thu, 29 Oct 2020 21:35:14 +0000
Received: by outflank-mailman (input) for mailman id 15063;
 Thu, 29 Oct 2020 21:35:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZg-0005Sn-Ve
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c3ab2e76-03b5-404b-9f7e-33dfa5c9f57e;
 Thu, 29 Oct 2020 21:35:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZg-0008LE-6i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZg-0004zv-5s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZg-0005Sn-Ve
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:13 +0000
X-Inumbo-ID: c3ab2e76-03b5-404b-9f7e-33dfa5c9f57e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c3ab2e76-03b5-404b-9f7e-33dfa5c9f57e;
	Thu, 29 Oct 2020 21:35:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fH/ChJbzN6icEOtFbHO6JQ0RVFVuyok6oVOw6PZN5Hs=; b=Xc6sMM3RtOHRSSJ+1aEQDUjUKh
	LnZj/lWTwt9ju8Y70ImGHUL9d0g2IEdqioJEEuhIZsx2M4nmiDGLIjcZy0EXsYT4iThboBZsnG5zM
	krRThZ3tvgWucFAi74206TJqX8I2vBDXDZXWN82OAXErWwqnarSQBzDxt3881fECr8e8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZg-0008LE-6i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZg-0004zv-5s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: drop extra constraints
Message-Id: <E1kYFZg-0004zv-5s@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:12 +0000

commit f3f483ac6310f26bd17ce5518cba14730a4d0546
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:17 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: drop extra constraints
    
    We don't need any specific format constraints here. Still keep qcow2
    for two reasons:
    1. No extra calls of format-unrelated test
    2. Add some check around persistent bitmap in future (require qcow2)
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-3-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index de9ba8d94c..dda918450a 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -116,5 +116,4 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
-                 supported_protocols=['file'])
+    iotests.main(supported_fmts=['qcow2'])
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15065.37719 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZs-0005X9-U6; Thu, 29 Oct 2020 21:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15065.37719; Thu, 29 Oct 2020 21:35:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFZs-0005X1-QY; Thu, 29 Oct 2020 21:35:24 +0000
Received: by outflank-mailman (input) for mailman id 15065;
 Thu, 29 Oct 2020 21:35:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFZr-0005WP-DG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id def008b4-12bd-4c89-9468-426ee5693453;
 Thu, 29 Oct 2020 21:35:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZq-0008LW-A2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFZq-00050q-9L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFZr-0005WP-DG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:23 +0000
X-Inumbo-ID: def008b4-12bd-4c89-9468-426ee5693453
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id def008b4-12bd-4c89-9468-426ee5693453;
	Thu, 29 Oct 2020 21:35:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zU1kRLOSaickS8zB83DyUXvGrSoMsnBHoZBm6ODw2iA=; b=xGZSjyHlGRm1Pbp6sAERvFgqel
	c9g98Bue/exFQx3+1a+rvPqSHJJwGFlnZG76JVlPblfaqdUQa4zsHlZyqlctjI4PtAl+JwHmvzyn7
	7Pvdwe0RaNwLzZmEIiZbEBZqCS+zkVB8PFRLytz46685OOwUsCNOhh4FTQSTrJpoKyys=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZq-0008LW-A2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFZq-00050q-9L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: better catch postcopy time
Message-Id: <E1kYFZq-00050q-9L@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:22 +0000

commit 09feea6cf528b3158640d6530174cf21cb579bc0
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:18 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: better catch postcopy time
    
    The test aims to test _postcopy_ migration, and wants to do some write
    operations during postcopy time.
    
    Test considers migrate status=complete event on source as start of
    postcopy. This is completely wrong, completion is completion of the
    whole migration process. Let's instead consider destination start as
    start of postcopy, and use RESUME event for it.
    
    Next, as migration finish, let's use migration status=complete event on
    target, as such method is closer to what libvirt or another user will
    do, than tracking number of dirty-bitmaps.
    
    Finally, add a possibility to dump events for debug. And if
    set debug to True, we see, that actual postcopy period is very small
    relatively to the whole test duration time (~0.2 seconds to >40 seconds
    for me). This means, that test is very inefficient in what it supposed
    to do. Let's improve it in following commits.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-4-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 72 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 57 insertions(+), 15 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index dda918450a..dd6044768c 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -20,17 +20,43 @@
 
 import os
 import iotests
-import time
 from iotests import qemu_img
 
+debug = False
+
 disk_a = os.path.join(iotests.test_dir, 'disk_a')
 disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
 
+def event_seconds(event):
+    return event['timestamp']['seconds'] + \
+        event['timestamp']['microseconds'] / 1000000.0
+
+
+def event_dist(e1, e2):
+    return event_seconds(e2) - event_seconds(e1)
+
+
 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
+        if debug:
+            self.vm_a_events += self.vm_a.get_qmp_events()
+            self.vm_b_events += self.vm_b.get_qmp_events()
+            for e in self.vm_a_events:
+                e['vm'] = 'SRC'
+            for e in self.vm_b_events:
+                e['vm'] = 'DST'
+            events = (self.vm_a_events + self.vm_b_events)
+            events = [(e['timestamp']['seconds'],
+                       e['timestamp']['microseconds'],
+                       e['vm'],
+                       e['event'],
+                       e.get('data', '')) for e in events]
+            for e in sorted(events):
+                print('{}.{:06} {} {} {}'.format(*e))
+
         self.vm_a.shutdown()
         self.vm_b.shutdown()
         os.remove(disk_a)
@@ -47,6 +73,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         self.vm_b.launch()
 
+        # collect received events for debug
+        self.vm_a_events = []
+        self.vm_b_events = []
+
     def test_postcopy(self):
         write_size = 0x40000000
         granularity = 512
@@ -77,15 +107,13 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
-        bitmaps_cap = {'capability': 'dirty-bitmaps', 'state': True}
-        events_cap = {'capability': 'events', 'state': True}
+        caps = [{'capability': 'dirty-bitmaps', 'state': True},
+                {'capability': 'events', 'state': True}]
 
-        result = self.vm_a.qmp('migrate-set-capabilities',
-                               capabilities=[bitmaps_cap, events_cap])
+        result = self.vm_a.qmp('migrate-set-capabilities', capabilities=caps)
         self.assert_qmp(result, 'return', {})
 
-        result = self.vm_b.qmp('migrate-set-capabilities',
-                               capabilities=[bitmaps_cap])
+        result = self.vm_b.qmp('migrate-set-capabilities', capabilities=caps)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('migrate', uri='exec:cat>' + fifo)
@@ -94,24 +122,38 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         result = self.vm_a.qmp('migrate-start-postcopy')
         self.assert_qmp(result, 'return', {})
 
-        while True:
-            event = self.vm_a.event_wait('MIGRATION')
-            if event['data']['status'] == 'completed':
-                break
+        event_resume = self.vm_b.event_wait('RESUME')
+        self.vm_b_events.append(event_resume)
 
         s = 0x8000
         while s < write_size:
             self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
+        match = {'data': {'status': 'completed'}}
+        event_complete = self.vm_b.event_wait('MIGRATION', match=match)
+        self.vm_b_events.append(event_complete)
+
+        # take queued event, should already been happened
+        event_stop = self.vm_a.event_wait('STOP')
+        self.vm_a_events.append(event_stop)
+
+        downtime = event_dist(event_stop, event_resume)
+        postcopy_time = event_dist(event_resume, event_complete)
+
+        # TODO: assert downtime * 10 < postcopy_time
+        if debug:
+            print('downtime:', downtime)
+            print('postcopy_time:', postcopy_time)
+
+        # Assert that bitmap migration is finished (check that successor bitmap
+        # is removed)
         result = self.vm_b.qmp('query-block')
-        while len(result['return'][0]['dirty-bitmaps']) > 1:
-            time.sleep(2)
-            result = self.vm_b.qmp('query-block')
+        assert len(result['return'][0]['dirty-bitmaps']) == 1
 
+        # Check content of migrated (and updated by new writes) bitmap
         result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
-
         self.assert_qmp(result, 'return/sha256', sha256)
 
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15067.37723 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFa4-0005am-0M; Thu, 29 Oct 2020 21:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15067.37723; Thu, 29 Oct 2020 21:35:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFa3-0005ad-SI; Thu, 29 Oct 2020 21:35:35 +0000
Received: by outflank-mailman (input) for mailman id 15067;
 Thu, 29 Oct 2020 21:35:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFa1-0005a7-QZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6c140f0d-24de-4e05-a746-783b6b669b4d;
 Thu, 29 Oct 2020 21:35:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFa0-0008Lj-Dc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFa0-00051q-Ct
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFa1-0005a7-QZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:33 +0000
X-Inumbo-ID: 6c140f0d-24de-4e05-a746-783b6b669b4d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6c140f0d-24de-4e05-a746-783b6b669b4d;
	Thu, 29 Oct 2020 21:35:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TARM2+H1QArEY9Il5VwnWs42tJONxiaHqrttj/heeuE=; b=Y4Kbgdi52S1Sx1ekJMEWSwgF/i
	BgFY2rKhc2ELK2I0J2X4x1SGn+xrQa+nP3B1/Mlfx7w4qBcWu5ae64upqvO2bhcepZTIkAZg+ZfWk
	BZax1/49xzPVjWF6gz3BT20uvbSdr+3EoWHb9H4xTYjKIAVICcBl6F9JrbBTfsESUU/g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFa0-0008Lj-Dc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFa0-00051q-Ct
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: improve performance: set bitmap by discard
Message-Id: <E1kYFa0-00051q-Ct@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:32 +0000

commit edb90bbdf33f6e96788b454fae9abfed18274692
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:19 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: improve performance: set bitmap by discard
    
    Discard dirties dirty-bitmap as well as write, but works faster. Let's
    use it instead.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index dd6044768c..190e820b84 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -67,8 +67,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         os.mkfifo(fifo)
         qemu_img('create', '-f', iotests.imgfmt, disk_a, size)
         qemu_img('create', '-f', iotests.imgfmt, disk_b, size)
-        self.vm_a = iotests.VM(path_suffix='a').add_drive(disk_a)
-        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_a = iotests.VM(path_suffix='a').add_drive(disk_a,
+                                                          'discard=unmap')
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b,
+                                                          'discard=unmap')
         self.vm_b.add_incoming("exec: cat '" + fifo + "'")
         self.vm_a.launch()
         self.vm_b.launch()
@@ -78,7 +80,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events = []
 
     def test_postcopy(self):
-        write_size = 0x40000000
+        discard_size = 0x40000000
         granularity = 512
         chunk = 4096
 
@@ -86,25 +88,32 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
                                name='bitmap', granularity=granularity)
         self.assert_qmp(result, 'return', {})
 
+        result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
+                               node='drive0', name='bitmap')
+        empty_sha256 = result['return']['sha256']
+
         s = 0
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
         s = 0x8000
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
         sha256 = result['return']['sha256']
 
+        # Check, that updating the bitmap by discards works
+        assert sha256 != empty_sha256
+
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
         self.assert_qmp(result, 'return', {})
         s = 0
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
@@ -126,8 +135,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events.append(event_resume)
 
         s = 0x8000
-        while s < write_size:
-            self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         match = {'data': {'status': 'completed'}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15069.37727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaD-0005dC-2V; Thu, 29 Oct 2020 21:35:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15069.37727; Thu, 29 Oct 2020 21:35:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaC-0005d4-Vk; Thu, 29 Oct 2020 21:35:44 +0000
Received: by outflank-mailman (input) for mailman id 15069;
 Thu, 29 Oct 2020 21:35:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFaB-0005co-Dl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5587572f-3153-4ef0-836d-da7d3a0a12a1;
 Thu, 29 Oct 2020 21:35:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaA-0008Lp-H8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaA-00052c-GH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFaB-0005co-Dl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:43 +0000
X-Inumbo-ID: 5587572f-3153-4ef0-836d-da7d3a0a12a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5587572f-3153-4ef0-836d-da7d3a0a12a1;
	Thu, 29 Oct 2020 21:35:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2ki7/wCd2rsgkWIUdBw0QhLGwdbvE3SOnY4aYJEfQJM=; b=ecbr139Y8dJ8QH1sm/wpZ4QYVc
	z+LlgbSuyY8jH+ogXBtmxs0r8tJVMoboZtRBzrneoAjPs7mQvrz0HRkQA1eT0JxTW3+1cZuBPry4R
	5c/8VztJJo/UjTxuCTxtmHTC97y3TcCkOw0sIrdRj6fvpQ31VyHGsv7U/8my9fb0Ozxg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaA-0008Lp-H8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaA-00052c-GH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: change discard patterns
Message-Id: <E1kYFaA-00052c-GH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:42 +0000

commit 31e382791352ed1f6fa2894f84286d0d4ee28e4f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:20 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: change discard patterns
    
    iotest 199 works too long because of many discard operations. At the
    same time, postcopy period is very short, in spite of all these
    efforts.
    
    So, let's use less discards (and with more interesting patterns) to
    reduce test timing. In the next commit we'll increase postcopy period.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-6-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 44 ++++++++++++++++++++++++++------------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 190e820b84..da4dae01fb 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -30,6 +30,28 @@ size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
 
+GiB = 1024 * 1024 * 1024
+
+discards1 = (
+    (0, GiB),
+    (2 * GiB + 512 * 5, 512),
+    (3 * GiB + 512 * 5, 512),
+    (100 * GiB, GiB)
+)
+
+discards2 = (
+    (3 * GiB + 512 * 8, 512),
+    (4 * GiB + 512 * 8, 512),
+    (50 * GiB, GiB),
+    (100 * GiB + GiB // 2, GiB)
+)
+
+
+def apply_discards(vm, discards):
+    for d in discards:
+        vm.hmp_qemu_io('drive0', 'discard {} {}'.format(*d))
+
+
 def event_seconds(event):
     return event['timestamp']['seconds'] + \
         event['timestamp']['microseconds'] / 1000000.0
@@ -80,9 +102,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events = []
 
     def test_postcopy(self):
-        discard_size = 0x40000000
         granularity = 512
-        chunk = 4096
 
         result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                name='bitmap', granularity=granularity)
@@ -92,14 +112,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
                                node='drive0', name='bitmap')
         empty_sha256 = result['return']['sha256']
 
-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
-        s = 0x8000
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_a, discards1 + discards2)
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
@@ -111,10 +124,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
         self.assert_qmp(result, 'return', {})
-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+
+        apply_discards(self.vm_a, discards1)
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
                 {'capability': 'events', 'state': True}]
@@ -134,10 +145,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
 
-        s = 0x8000
-        while s < discard_size:
-            self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_b, discards2)
 
         match = {'data': {'status': 'completed'}}
         event_complete = self.vm_b.event_wait('MIGRATION', match=match)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:35:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:35:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15071.37730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaN-0005ex-3r; Thu, 29 Oct 2020 21:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15071.37730; Thu, 29 Oct 2020 21:35:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaN-0005ep-0r; Thu, 29 Oct 2020 21:35:55 +0000
Received: by outflank-mailman (input) for mailman id 15071;
 Thu, 29 Oct 2020 21:35:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFaL-0005ee-KX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0c6a8c3b-2662-4173-96c9-ecbbcdaedc07;
 Thu, 29 Oct 2020 21:35:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaK-0008Lw-Lc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaK-00053G-Jz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFaL-0005ee-KX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:53 +0000
X-Inumbo-ID: 0c6a8c3b-2662-4173-96c9-ecbbcdaedc07
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0c6a8c3b-2662-4173-96c9-ecbbcdaedc07;
	Thu, 29 Oct 2020 21:35:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=16rZ/SEM7kGm7okY+gZMb1DMhmFFwoXnNDPY/Wr5zlI=; b=jq/lRdEaj2wzSSBRTllZp180PV
	YZKcTXZepPtDfV6kzNTqpGawSJAV89ElX5RdsNKJTyFKzkrNvWTyIGmZSqY81iJGNVRiSBvuQeFZk
	gs4WEUl3EBWMd6NDIjJ8jnSA4P8tgcg15v2O5Nd6TDwLSBiygCn61rzftDIfBZzzsa6E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaK-0008Lw-Lc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaK-00053G-Jz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:35:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: increase postcopy period
Message-Id: <E1kYFaK-00053G-Jz@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:35:52 +0000

commit e80a4150a54d69a56e31de2c96e7655109e4c60a
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:21 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: increase postcopy period
    
    The test wants to force a bitmap postcopy. Still, the resulting
    postcopy period is very small. Let's increase it by adding more
    bitmaps to migrate. Also, test disabled bitmaps migration.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-7-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 58 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 19 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index da4dae01fb..d8532e49da 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -103,29 +103,45 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
     def test_postcopy(self):
         granularity = 512
+        nb_bitmaps = 15
 
-        result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
-                               name='bitmap', granularity=granularity)
-        self.assert_qmp(result, 'return', {})
+        for i in range(nb_bitmaps):
+            result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
+                                   name='bitmap{}'.format(i),
+                                   granularity=granularity)
+            self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
+                               node='drive0', name='bitmap0')
         empty_sha256 = result['return']['sha256']
 
-        apply_discards(self.vm_a, discards1 + discards2)
+        apply_discards(self.vm_a, discards1)
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
-        sha256 = result['return']['sha256']
+                               node='drive0', name='bitmap0')
+        discards1_sha256 = result['return']['sha256']
 
         # Check, that updating the bitmap by discards works
-        assert sha256 != empty_sha256
+        assert discards1_sha256 != empty_sha256
 
-        result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
-                               name='bitmap')
-        self.assert_qmp(result, 'return', {})
+        # We want to calculate resulting sha256. Do it in bitmap0, so, disable
+        # other bitmaps
+        for i in range(1, nb_bitmaps):
+            result = self.vm_a.qmp('block-dirty-bitmap-disable', node='drive0',
+                                   name='bitmap{}'.format(i))
+            self.assert_qmp(result, 'return', {})
 
-        apply_discards(self.vm_a, discards1)
+        apply_discards(self.vm_a, discards2)
+
+        result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
+                               node='drive0', name='bitmap0')
+        all_discards_sha256 = result['return']['sha256']
+
+        # Now, enable some bitmaps, to be updated during migration
+        for i in range(2, nb_bitmaps, 2):
+            result = self.vm_a.qmp('block-dirty-bitmap-enable', node='drive0',
+                                   name='bitmap{}'.format(i))
+            self.assert_qmp(result, 'return', {})
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
                 {'capability': 'events', 'state': True}]
@@ -145,6 +161,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
 
+        # enabled bitmaps should be updated
         apply_discards(self.vm_b, discards2)
 
         match = {'data': {'status': 'completed'}}
@@ -158,7 +175,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         downtime = event_dist(event_stop, event_resume)
         postcopy_time = event_dist(event_resume, event_complete)
 
-        # TODO: assert downtime * 10 < postcopy_time
+        assert downtime * 10 < postcopy_time
         if debug:
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
@@ -166,12 +183,15 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         # Assert that bitmap migration is finished (check that successor bitmap
         # is removed)
         result = self.vm_b.qmp('query-block')
-        assert len(result['return'][0]['dirty-bitmaps']) == 1
-
-        # Check content of migrated (and updated by new writes) bitmap
-        result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
-        self.assert_qmp(result, 'return/sha256', sha256)
+        assert len(result['return'][0]['dirty-bitmaps']) == nb_bitmaps
+
+        # Check content of migrated bitmaps. Still, don't waste time checking
+        # every bitmap
+        for i in range(0, nb_bitmaps, 5):
+            result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
+                                   node='drive0', name='bitmap{}'.format(i))
+            sha256 = discards1_sha256 if i % 2 else all_discards_sha256
+            self.assert_qmp(result, 'return/sha256', sha256)
 
 
 if __name__ == '__main__':
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15072.37735 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaX-0005hE-5P; Thu, 29 Oct 2020 21:36:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15072.37735; Thu, 29 Oct 2020 21:36:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFaX-0005h6-2M; Thu, 29 Oct 2020 21:36:05 +0000
Received: by outflank-mailman (input) for mailman id 15072;
 Thu, 29 Oct 2020 21:36:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFaV-0005gt-JC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ed7d3742-d774-4492-a14e-f9acba6551c4;
 Thu, 29 Oct 2020 21:36:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaU-0008Mi-QG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaU-000543-OX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFaV-0005gt-JC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:03 +0000
X-Inumbo-ID: ed7d3742-d774-4492-a14e-f9acba6551c4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ed7d3742-d774-4492-a14e-f9acba6551c4;
	Thu, 29 Oct 2020 21:36:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=namTXWR0FBHstb5+T4EPNxUOALyVqu25h0qXNl8IkKw=; b=1PKOItIuw10X4m7D32PDaHaVMz
	Qbb+LuvZQzOXt4iTy4+e9Yzi8KzgLsQdyrdv/O/SoS0ucnoVz8d4B1NumbsNxtCfJIQFAs/uWs4z9
	3Sp+YnPBZsHQFItmWFkYnHtvX5ZLNOEouQ3S8Pfn3khv7SjxidKV6XMCMRLS2Mx+wBLE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaU-0008Mi-QG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaU-000543-OX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
Message-Id: <E1kYFaU-000543-OX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:02 +0000

commit e6ce5e92248be5547daaee3eb6cd226e9820cf7b
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:22 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
    
    Using the _locked version of bdrv_enable_dirty_bitmap to bypass locking
    is wrong as we do not already own the mutex.  Moreover, the adjacent
    call to bdrv_dirty_bitmap_enable_successor grabs the mutex.
    
    Fixes: 58f72b965e9e1q
    Cc: qemu-stable@nongnu.org # v3.0
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-8-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index b0dbf9eeed..0739f1259e 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -566,7 +566,7 @@ void dirty_bitmap_mig_before_vm_start(void)
         DirtyBitmapLoadBitmapState *b = item->data;
 
         if (b->migrated) {
-            bdrv_enable_dirty_bitmap_locked(b->bitmap);
+            bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15073.37740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFah-0005ip-8H; Thu, 29 Oct 2020 21:36:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15073.37740; Thu, 29 Oct 2020 21:36:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFah-0005if-49; Thu, 29 Oct 2020 21:36:15 +0000
Received: by outflank-mailman (input) for mailman id 15073;
 Thu, 29 Oct 2020 21:36:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFag-0005iV-7Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ecd5ed04-983c-496c-aca4-4dd31ee5fc9a;
 Thu, 29 Oct 2020 21:36:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFae-0008Mp-U4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFae-00054j-TO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFag-0005iV-7Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:14 +0000
X-Inumbo-ID: ecd5ed04-983c-496c-aca4-4dd31ee5fc9a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ecd5ed04-983c-496c-aca4-4dd31ee5fc9a;
	Thu, 29 Oct 2020 21:36:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WSXFT9Xls+nGt/S9ZCPrbL2v+4AKCaPMyybzF5LqFzI=; b=49okAcebLi9lbqiqVzvwryceDU
	vMjCf1xbjL10j3T4H64r8A06EXxL2gpXrJDb7FKN3apZFZSbFAdcC1wYTUO39hB9TT0eGIHm/XQiu
	0ynRf7tj0pV7nUGbE8dEsrEeFZkHuvJPYnGzM3dkFvmyvmX5zLkSd61Usg9fNajBxQe8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFae-0008Mp-U4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFae-00054j-TO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: rename state structure types
Message-Id: <E1kYFae-00054j-TO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:12 +0000

commit fbbc6b14705ea8c2f6326d4fab455d6432d83d08
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:23 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename state structure types
    
    Rename types to be symmetrical for load/save part and shorter.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-9-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 70 ++++++++++++++++++++++--------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 0739f1259e..1d57bff4f6 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -100,23 +100,25 @@
 /* 0x04 was "AUTOLOAD" flags on elder versions, no it is ignored */
 #define DIRTY_BITMAP_MIG_START_FLAG_RESERVED_MASK    0xf8
 
-typedef struct DirtyBitmapMigBitmapState {
+/* State of one bitmap during save process */
+typedef struct SaveBitmapState {
     /* Written during setup phase. */
     BlockDriverState *bs;
     const char *node_name;
     BdrvDirtyBitmap *bitmap;
     uint64_t total_sectors;
     uint64_t sectors_per_chunk;
-    QSIMPLEQ_ENTRY(DirtyBitmapMigBitmapState) entry;
+    QSIMPLEQ_ENTRY(SaveBitmapState) entry;
     uint8_t flags;
 
     /* For bulk phase. */
     bool bulk_completed;
     uint64_t cur_sector;
-} DirtyBitmapMigBitmapState;
+} SaveBitmapState;
 
-typedef struct DirtyBitmapMigState {
-    QSIMPLEQ_HEAD(, DirtyBitmapMigBitmapState) dbms_list;
+/* State of the dirty bitmap migration (DBM) during save process */
+typedef struct DBMSaveState {
+    QSIMPLEQ_HEAD(, SaveBitmapState) dbms_list;
 
     bool bulk_completed;
     bool no_bitmaps;
@@ -124,23 +126,25 @@ typedef struct DirtyBitmapMigState {
     /* for send_bitmap_bits() */
     BlockDriverState *prev_bs;
     BdrvDirtyBitmap *prev_bitmap;
-} DirtyBitmapMigState;
+} DBMSaveState;
 
-typedef struct DirtyBitmapLoadState {
+/* State of the dirty bitmap migration (DBM) during load process */
+typedef struct DBMLoadState {
     uint32_t flags;
     char node_name[256];
     char bitmap_name[256];
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
-} DirtyBitmapLoadState;
+} DBMLoadState;
 
-static DirtyBitmapMigState dirty_bitmap_mig_state;
+static DBMSaveState dirty_bitmap_mig_state;
 
-typedef struct DirtyBitmapLoadBitmapState {
+/* State of one bitmap during load process */
+typedef struct LoadBitmapState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
     bool migrated;
-} DirtyBitmapLoadBitmapState;
+} LoadBitmapState;
 static GSList *enabled_bitmaps;
 QemuMutex finish_lock;
 
@@ -170,7 +174,7 @@ static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
     qemu_put_byte(f, flags);
 }
 
-static void send_bitmap_header(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
+static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
                                uint32_t additional_flags)
 {
     BlockDriverState *bs = dbms->bs;
@@ -199,19 +203,19 @@ static void send_bitmap_header(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
     }
 }
 
-static void send_bitmap_start(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void send_bitmap_start(QEMUFile *f, SaveBitmapState *dbms)
 {
     send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_START);
     qemu_put_be32(f, bdrv_dirty_bitmap_granularity(dbms->bitmap));
     qemu_put_byte(f, dbms->flags);
 }
 
-static void send_bitmap_complete(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void send_bitmap_complete(QEMUFile *f, SaveBitmapState *dbms)
 {
     send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
 }
 
-static void send_bitmap_bits(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
+static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
                              uint64_t start_sector, uint32_t nr_sectors)
 {
     /* align for buffer_is_zero() */
@@ -257,7 +261,7 @@ static void send_bitmap_bits(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
 /* Called with iothread lock taken.  */
 static void dirty_bitmap_mig_cleanup(void)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
 
     while ((dbms = QSIMPLEQ_FIRST(&dirty_bitmap_mig_state.dbms_list)) != NULL) {
         QSIMPLEQ_REMOVE_HEAD(&dirty_bitmap_mig_state.dbms_list, entry);
@@ -271,7 +275,7 @@ static void dirty_bitmap_mig_cleanup(void)
 static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
 {
     BdrvDirtyBitmap *bitmap;
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     Error *local_err = NULL;
 
     FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
@@ -309,7 +313,7 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
         bdrv_ref(bs);
         bdrv_dirty_bitmap_set_busy(bitmap, true);
 
-        dbms = g_new0(DirtyBitmapMigBitmapState, 1);
+        dbms = g_new0(SaveBitmapState, 1);
         dbms->bs = bs;
         dbms->node_name = bs_name;
         dbms->bitmap = bitmap;
@@ -334,7 +338,7 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
 static int init_dirty_bitmap_migration(void)
 {
     BlockDriverState *bs;
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
     BlockBackend *blk;
 
@@ -408,7 +412,7 @@ fail:
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase_send_chunk(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
 {
     uint32_t nr_sectors = MIN(dbms->total_sectors - dbms->cur_sector,
                              dbms->sectors_per_chunk);
@@ -424,7 +428,7 @@ static void bulk_phase_send_chunk(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
 /* Called with no lock taken.  */
 static void bulk_phase(QEMUFile *f, bool limit)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
 
     QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
         while (!dbms->bulk_completed) {
@@ -461,7 +465,7 @@ static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
 
 static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     trace_dirty_bitmap_save_complete_enter();
 
     if (!dirty_bitmap_mig_state.bulk_completed) {
@@ -486,7 +490,7 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
                                       uint64_t *res_compatible,
                                       uint64_t *res_postcopy_only)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     uint64_t pending = 0;
 
     qemu_mutex_lock_iothread();
@@ -507,7 +511,7 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
 }
 
 /* First occurrence of this bitmap. It should be created if doesn't exist */
-static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 {
     Error *local_err = NULL;
     uint32_t granularity = qemu_get_be32(f);
@@ -538,7 +542,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
 
     bdrv_disable_dirty_bitmap(s->bitmap);
     if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
-        DirtyBitmapLoadBitmapState *b;
+        LoadBitmapState *b;
 
         bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
         if (local_err) {
@@ -546,7 +550,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
             return -EINVAL;
         }
 
-        b = g_new(DirtyBitmapLoadBitmapState, 1);
+        b = g_new(LoadBitmapState, 1);
         b->bs = s->bs;
         b->bitmap = s->bitmap;
         b->migrated = false;
@@ -563,7 +567,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_lock(&finish_lock);
 
     for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
-        DirtyBitmapLoadBitmapState *b = item->data;
+        LoadBitmapState *b = item->data;
 
         if (b->migrated) {
             bdrv_enable_dirty_bitmap(b->bitmap);
@@ -580,7 +584,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_unlock(&finish_lock);
 }
 
-static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
+static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
     trace_dirty_bitmap_load_complete();
@@ -589,7 +593,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
     qemu_mutex_lock(&finish_lock);
 
     for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
-        DirtyBitmapLoadBitmapState *b = item->data;
+        LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
             b->migrated = true;
@@ -621,7 +625,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
     qemu_mutex_unlock(&finish_lock);
 }
 
-static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
 {
     uint64_t first_byte = qemu_get_be64(f) << BDRV_SECTOR_BITS;
     uint64_t nr_bytes = (uint64_t)qemu_get_be32(f) << BDRV_SECTOR_BITS;
@@ -666,7 +670,7 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
     return 0;
 }
 
-static int dirty_bitmap_load_header(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
 {
     Error *local_err = NULL;
     bool nothing;
@@ -715,7 +719,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DirtyBitmapLoadState *s)
 
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
-    static DirtyBitmapLoadState s;
+    static DBMLoadState s;
     int ret = 0;
 
     trace_dirty_bitmap_load_enter();
@@ -753,7 +757,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 
 static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 {
-    DirtyBitmapMigBitmapState *dbms = NULL;
+    SaveBitmapState *dbms = NULL;
     if (init_dirty_bitmap_migration() < 0) {
         return -1;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15075.37743 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFar-0005kR-9s; Thu, 29 Oct 2020 21:36:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15075.37743; Thu, 29 Oct 2020 21:36:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFar-0005kJ-70; Thu, 29 Oct 2020 21:36:25 +0000
Received: by outflank-mailman (input) for mailman id 15075;
 Thu, 29 Oct 2020 21:36:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFap-0005k9-Ug
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cbbf612d-435a-4424-922f-0d7ecf5df359;
 Thu, 29 Oct 2020 21:36:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFap-0008N4-1N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFap-00055M-0Y
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFap-0005k9-Ug
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
X-Inumbo-ID: cbbf612d-435a-4424-922f-0d7ecf5df359
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cbbf612d-435a-4424-922f-0d7ecf5df359;
	Thu, 29 Oct 2020 21:36:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IBmF+vU4450ALJd/EccVD4lD3c9vw3u4UhkPbIA2cRM=; b=4oyvysbq/ajgBEoJtc9s2P6MUs
	puAn4ZaW7f3OYD0qAAZaFM4im0D5qGiWhFH2LuDHsXCoH0rg/ue+iSNtkcK3mIxrxDDCuav6yksTZ
	c+pDMZ48yc7YgnW1zrRX7thmtvNaWMmA5n2Qk3+pgyWtQS6982gqP7QExTGuygWLG8ks=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFap-0008N4-1N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFap-00055M-0Y
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
Message-Id: <E1kYFap-00055M-0Y@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:23 +0000

commit b25d364102686f9fb3854f44c75625bd79f5aee2
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:24 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
    
    Rename dirty_bitmap_mig_cleanup to dirty_bitmap_do_save_cleanup, to
    stress that it is on save part.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-10-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 1d57bff4f6..01a536d7d3 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -259,7 +259,7 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 }
 
 /* Called with iothread lock taken.  */
-static void dirty_bitmap_mig_cleanup(void)
+static void dirty_bitmap_do_save_cleanup(void)
 {
     SaveBitmapState *dbms;
 
@@ -406,7 +406,7 @@ static int init_dirty_bitmap_migration(void)
 
 fail:
     g_hash_table_destroy(handled_by_blk);
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
 
     return -1;
 }
@@ -445,7 +445,7 @@ static void bulk_phase(QEMUFile *f, bool limit)
 /* for SaveVMHandlers */
 static void dirty_bitmap_save_cleanup(void *opaque)
 {
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
 }
 
 static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
@@ -480,7 +480,7 @@ static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 
     trace_dirty_bitmap_save_complete_finish();
 
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15076.37747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFb1-0005m6-Ba; Thu, 29 Oct 2020 21:36:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15076.37747; Thu, 29 Oct 2020 21:36:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFb1-0005ly-8e; Thu, 29 Oct 2020 21:36:35 +0000
Received: by outflank-mailman (input) for mailman id 15076;
 Thu, 29 Oct 2020 21:36:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFb0-0005lo-A9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1e5f96e3-797d-4d6d-b0bb-96c440d38de4;
 Thu, 29 Oct 2020 21:36:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaz-0008NF-4o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFaz-00055y-46
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFb0-0005lo-A9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:34 +0000
X-Inumbo-ID: 1e5f96e3-797d-4d6d-b0bb-96c440d38de4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1e5f96e3-797d-4d6d-b0bb-96c440d38de4;
	Thu, 29 Oct 2020 21:36:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xuBMAruU2Yqbyh/ikq8Nco0/Q/5m9DzID5nTIc9Xg4Q=; b=GYb0UohN/sRxoHqRFm9h2Z2wiW
	837V+tIp/USvSziUYgxyUaaOWzPqLVcOU3bTBws8ZUdv3Kr7yYXych/+QxOZA8bBC2xIrlH6qT8T2
	hfGCpXZcCnpXrKS5Mi+CB05FDX7HyUFW9S5o7sZVZmtB3zNKniMV6spRQoEGIX1BvAsc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaz-0008NF-4o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFaz-00055y-46
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
Message-Id: <E1kYFaz-00055y-46@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:33 +0000

commit d0cccbd1183eccc731deafa1b4c5a2c9dcedca08
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:25 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
    
    No reasons to keep two public init functions.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200727194236.19551-11-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 6 +-----
 migration/migration.c          | 2 --
 migration/migration.h          | 1 -
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 01a536d7d3..4b67e4f4fb 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -148,11 +148,6 @@ typedef struct LoadBitmapState {
 static GSList *enabled_bitmaps;
 QemuMutex finish_lock;
 
-void init_dirty_bitmap_incoming_migration(void)
-{
-    qemu_mutex_init(&finish_lock);
-}
-
 static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 {
     uint8_t flags = qemu_get_byte(f);
@@ -801,6 +796,7 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 void dirty_bitmap_mig_init(void)
 {
     QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
+    qemu_mutex_init(&finish_lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
diff --git a/migration/migration.c b/migration/migration.c
index 2ed9923227..1c61428988 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -165,8 +165,6 @@ void migration_object_init(void)
     qemu_sem_init(&current_incoming->postcopy_pause_sem_dst, 0);
     qemu_sem_init(&current_incoming->postcopy_pause_sem_fault, 0);
 
-    init_dirty_bitmap_incoming_migration();
-
     if (!migration_object_check(current_migration, &err)) {
         error_report_err(err);
         exit(1);
diff --git a/migration/migration.h b/migration/migration.h
index f617960522..ab20c756f5 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -335,7 +335,6 @@ void migrate_send_rp_recv_bitmap(MigrationIncomingState *mis,
 void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
 
 void dirty_bitmap_mig_before_vm_start(void);
-void init_dirty_bitmap_incoming_migration(void);
 void migrate_add_address(SocketAddress *address);
 
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15077.37751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbB-0005nb-Dd; Thu, 29 Oct 2020 21:36:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15077.37751; Thu, 29 Oct 2020 21:36:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbB-0005nT-AM; Thu, 29 Oct 2020 21:36:45 +0000
Received: by outflank-mailman (input) for mailman id 15077;
 Thu, 29 Oct 2020 21:36:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFbA-0005nL-Qm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 915439af-e1a6-4200-96f9-f9690420c763;
 Thu, 29 Oct 2020 21:36:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFb9-0008NR-AH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFb9-00056Y-7k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFbA-0005nL-Qm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:44 +0000
X-Inumbo-ID: 915439af-e1a6-4200-96f9-f9690420c763
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 915439af-e1a6-4200-96f9-f9690420c763;
	Thu, 29 Oct 2020 21:36:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ir6Y+Z5HTvmZpuTBkoZiJ/xGK9ETocFLINFn2FdLuAw=; b=fyl78txBHIPygaw5qM4m7ZnPpz
	ApDKI/dAySaCQAd8X1sDBxGRQLki7yZcJU8VkXxfL/sOUpXlqRCc9AKc+PRPg/hweomy5ddiH3I1u
	PKh7vyORwZ3WAr2P5/MotfhtuBOUOuLh/0oSFF3UmOhJ4vnbpx3U31SMnuVVCVvnvOWw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFb9-0008NR-AH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFb9-00056Y-7k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: refactor state global variables
Message-Id: <E1kYFb9-00056Y-7k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:43 +0000

commit 3b52726ec0e2f5c5732fe5f9d76af700463b73d3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:26 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: refactor state global variables
    
    Move all state variables into one global struct. Reduce global
    variable usage, utilizing opaque pointer where possible.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-12-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 179 +++++++++++++++++++++++------------------
 1 file changed, 99 insertions(+), 80 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 4b67e4f4fb..9b39e7aa2b 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -128,6 +128,12 @@ typedef struct DBMSaveState {
     BdrvDirtyBitmap *prev_bitmap;
 } DBMSaveState;
 
+typedef struct LoadBitmapState {
+    BlockDriverState *bs;
+    BdrvDirtyBitmap *bitmap;
+    bool migrated;
+} LoadBitmapState;
+
 /* State of the dirty bitmap migration (DBM) during load process */
 typedef struct DBMLoadState {
     uint32_t flags;
@@ -135,18 +141,17 @@ typedef struct DBMLoadState {
     char bitmap_name[256];
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
+
+    GSList *enabled_bitmaps;
+    QemuMutex finish_lock;
 } DBMLoadState;
 
-static DBMSaveState dirty_bitmap_mig_state;
+typedef struct DBMState {
+    DBMSaveState save;
+    DBMLoadState load;
+} DBMState;
 
-/* State of one bitmap during load process */
-typedef struct LoadBitmapState {
-    BlockDriverState *bs;
-    BdrvDirtyBitmap *bitmap;
-    bool migrated;
-} LoadBitmapState;
-static GSList *enabled_bitmaps;
-QemuMutex finish_lock;
+static DBMState dbm_state;
 
 static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 {
@@ -169,21 +174,21 @@ static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
     qemu_put_byte(f, flags);
 }
 
-static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
-                               uint32_t additional_flags)
+static void send_bitmap_header(QEMUFile *f, DBMSaveState *s,
+                               SaveBitmapState *dbms, uint32_t additional_flags)
 {
     BlockDriverState *bs = dbms->bs;
     BdrvDirtyBitmap *bitmap = dbms->bitmap;
     uint32_t flags = additional_flags;
     trace_send_bitmap_header_enter();
 
-    if (bs != dirty_bitmap_mig_state.prev_bs) {
-        dirty_bitmap_mig_state.prev_bs = bs;
+    if (bs != s->prev_bs) {
+        s->prev_bs = bs;
         flags |= DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME;
     }
 
-    if (bitmap != dirty_bitmap_mig_state.prev_bitmap) {
-        dirty_bitmap_mig_state.prev_bitmap = bitmap;
+    if (bitmap != s->prev_bitmap) {
+        s->prev_bitmap = bitmap;
         flags |= DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME;
     }
 
@@ -198,19 +203,22 @@ static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
     }
 }
 
-static void send_bitmap_start(QEMUFile *f, SaveBitmapState *dbms)
+static void send_bitmap_start(QEMUFile *f, DBMSaveState *s,
+                              SaveBitmapState *dbms)
 {
-    send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_START);
+    send_bitmap_header(f, s, dbms, DIRTY_BITMAP_MIG_FLAG_START);
     qemu_put_be32(f, bdrv_dirty_bitmap_granularity(dbms->bitmap));
     qemu_put_byte(f, dbms->flags);
 }
 
-static void send_bitmap_complete(QEMUFile *f, SaveBitmapState *dbms)
+static void send_bitmap_complete(QEMUFile *f, DBMSaveState *s,
+                                 SaveBitmapState *dbms)
 {
-    send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
+    send_bitmap_header(f, s, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
 }
 
-static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
+static void send_bitmap_bits(QEMUFile *f, DBMSaveState *s,
+                             SaveBitmapState *dbms,
                              uint64_t start_sector, uint32_t nr_sectors)
 {
     /* align for buffer_is_zero() */
@@ -235,7 +243,7 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 
     trace_send_bitmap_bits(flags, start_sector, nr_sectors, buf_size);
 
-    send_bitmap_header(f, dbms, flags);
+    send_bitmap_header(f, s, dbms, flags);
 
     qemu_put_be64(f, start_sector);
     qemu_put_be32(f, nr_sectors);
@@ -254,12 +262,12 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 }
 
 /* Called with iothread lock taken.  */
-static void dirty_bitmap_do_save_cleanup(void)
+static void dirty_bitmap_do_save_cleanup(DBMSaveState *s)
 {
     SaveBitmapState *dbms;
 
-    while ((dbms = QSIMPLEQ_FIRST(&dirty_bitmap_mig_state.dbms_list)) != NULL) {
-        QSIMPLEQ_REMOVE_HEAD(&dirty_bitmap_mig_state.dbms_list, entry);
+    while ((dbms = QSIMPLEQ_FIRST(&s->dbms_list)) != NULL) {
+        QSIMPLEQ_REMOVE_HEAD(&s->dbms_list, entry);
         bdrv_dirty_bitmap_set_busy(dbms->bitmap, false);
         bdrv_unref(dbms->bs);
         g_free(dbms);
@@ -267,7 +275,8 @@ static void dirty_bitmap_do_save_cleanup(void)
 }
 
 /* Called with iothread lock taken. */
-static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
+static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs,
+                               const char *bs_name)
 {
     BdrvDirtyBitmap *bitmap;
     SaveBitmapState *dbms;
@@ -322,25 +331,24 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
             dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
         }
 
-        QSIMPLEQ_INSERT_TAIL(&dirty_bitmap_mig_state.dbms_list,
-                             dbms, entry);
+        QSIMPLEQ_INSERT_TAIL(&s->dbms_list, dbms, entry);
     }
 
     return 0;
 }
 
 /* Called with iothread lock taken. */
-static int init_dirty_bitmap_migration(void)
+static int init_dirty_bitmap_migration(DBMSaveState *s)
 {
     BlockDriverState *bs;
     SaveBitmapState *dbms;
     GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
     BlockBackend *blk;
 
-    dirty_bitmap_mig_state.bulk_completed = false;
-    dirty_bitmap_mig_state.prev_bs = NULL;
-    dirty_bitmap_mig_state.prev_bitmap = NULL;
-    dirty_bitmap_mig_state.no_bitmaps = false;
+    s->bulk_completed = false;
+    s->prev_bs = NULL;
+    s->prev_bitmap = NULL;
+    s->no_bitmaps = false;
 
     /*
      * Use blockdevice name for direct (or filtered) children of named block
@@ -369,7 +377,7 @@ static int init_dirty_bitmap_migration(void)
         }
 
         if (bs && bs->drv && !bs->drv->is_filter) {
-            if (add_bitmaps_to_list(bs, name)) {
+            if (add_bitmaps_to_list(s, bs, name)) {
                 goto fail;
             }
             g_hash_table_add(handled_by_blk, bs);
@@ -381,18 +389,18 @@ static int init_dirty_bitmap_migration(void)
             continue;
         }
 
-        if (add_bitmaps_to_list(bs, bdrv_get_node_name(bs))) {
+        if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs))) {
             goto fail;
         }
     }
 
     /* unset migration flags here, to not roll back it */
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         bdrv_dirty_bitmap_skip_store(dbms->bitmap, true);
     }
 
-    if (QSIMPLEQ_EMPTY(&dirty_bitmap_mig_state.dbms_list)) {
-        dirty_bitmap_mig_state.no_bitmaps = true;
+    if (QSIMPLEQ_EMPTY(&s->dbms_list)) {
+        s->no_bitmaps = true;
     }
 
     g_hash_table_destroy(handled_by_blk);
@@ -401,18 +409,19 @@ static int init_dirty_bitmap_migration(void)
 
 fail:
     g_hash_table_destroy(handled_by_blk);
-    dirty_bitmap_do_save_cleanup();
+    dirty_bitmap_do_save_cleanup(s);
 
     return -1;
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
+static void bulk_phase_send_chunk(QEMUFile *f, DBMSaveState *s,
+                                  SaveBitmapState *dbms)
 {
     uint32_t nr_sectors = MIN(dbms->total_sectors - dbms->cur_sector,
                              dbms->sectors_per_chunk);
 
-    send_bitmap_bits(f, dbms, dbms->cur_sector, nr_sectors);
+    send_bitmap_bits(f, s, dbms, dbms->cur_sector, nr_sectors);
 
     dbms->cur_sector += nr_sectors;
     if (dbms->cur_sector >= dbms->total_sectors) {
@@ -421,61 +430,66 @@ static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase(QEMUFile *f, bool limit)
+static void bulk_phase(QEMUFile *f, DBMSaveState *s, bool limit)
 {
     SaveBitmapState *dbms;
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         while (!dbms->bulk_completed) {
-            bulk_phase_send_chunk(f, dbms);
+            bulk_phase_send_chunk(f, s, dbms);
             if (limit && qemu_file_rate_limit(f)) {
                 return;
             }
         }
     }
 
-    dirty_bitmap_mig_state.bulk_completed = true;
+    s->bulk_completed = true;
 }
 
 /* for SaveVMHandlers */
 static void dirty_bitmap_save_cleanup(void *opaque)
 {
-    dirty_bitmap_do_save_cleanup();
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
+    dirty_bitmap_do_save_cleanup(s);
 }
 
 static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
     trace_dirty_bitmap_save_iterate(migration_in_postcopy());
 
-    if (migration_in_postcopy() && !dirty_bitmap_mig_state.bulk_completed) {
-        bulk_phase(f, true);
+    if (migration_in_postcopy() && !s->bulk_completed) {
+        bulk_phase(f, s, true);
     }
 
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
-    return dirty_bitmap_mig_state.bulk_completed;
+    return s->bulk_completed;
 }
 
 /* Called with iothread lock taken.  */
 
 static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms;
     trace_dirty_bitmap_save_complete_enter();
 
-    if (!dirty_bitmap_mig_state.bulk_completed) {
-        bulk_phase(f, false);
+    if (!s->bulk_completed) {
+        bulk_phase(f, s, false);
     }
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
-        send_bitmap_complete(f, dbms);
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
+        send_bitmap_complete(f, s, dbms);
     }
 
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
     trace_dirty_bitmap_save_complete_finish();
 
-    dirty_bitmap_do_save_cleanup();
+    dirty_bitmap_save_cleanup(opaque);
     return 0;
 }
 
@@ -485,12 +499,13 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
                                       uint64_t *res_compatible,
                                       uint64_t *res_postcopy_only)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms;
     uint64_t pending = 0;
 
     qemu_mutex_lock_iothread();
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         uint64_t gran = bdrv_dirty_bitmap_granularity(dbms->bitmap);
         uint64_t sectors = dbms->bulk_completed ? 0 :
                            dbms->total_sectors - dbms->cur_sector;
@@ -549,7 +564,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
         b->bs = s->bs;
         b->bitmap = s->bitmap;
         b->migrated = false;
-        enabled_bitmaps = g_slist_prepend(enabled_bitmaps, b);
+        s->enabled_bitmaps = g_slist_prepend(s->enabled_bitmaps, b);
     }
 
     return 0;
@@ -557,11 +572,12 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 
 void dirty_bitmap_mig_before_vm_start(void)
 {
+    DBMLoadState *s = &dbm_state.load;
     GSList *item;
 
-    qemu_mutex_lock(&finish_lock);
+    qemu_mutex_lock(&s->finish_lock);
 
-    for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->migrated) {
@@ -573,10 +589,10 @@ void dirty_bitmap_mig_before_vm_start(void)
         g_free(b);
     }
 
-    g_slist_free(enabled_bitmaps);
-    enabled_bitmaps = NULL;
+    g_slist_free(s->enabled_bitmaps);
+    s->enabled_bitmaps = NULL;
 
-    qemu_mutex_unlock(&finish_lock);
+    qemu_mutex_unlock(&s->finish_lock);
 }
 
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
@@ -585,9 +601,9 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
     trace_dirty_bitmap_load_complete();
     bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&finish_lock);
+    qemu_mutex_lock(&s->finish_lock);
 
-    for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
@@ -598,7 +614,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 
     if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
         bdrv_dirty_bitmap_lock(s->bitmap);
-        if (enabled_bitmaps == NULL) {
+        if (s->enabled_bitmaps == NULL) {
             /* in postcopy */
             bdrv_reclaim_dirty_bitmap_locked(s->bitmap, &error_abort);
             bdrv_enable_dirty_bitmap_locked(s->bitmap);
@@ -617,7 +633,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_dirty_bitmap_unlock(s->bitmap);
     }
 
-    qemu_mutex_unlock(&finish_lock);
+    qemu_mutex_unlock(&s->finish_lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -714,7 +730,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
 
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
-    static DBMLoadState s;
+    DBMLoadState *s = &((DBMState *)opaque)->load;
     int ret = 0;
 
     trace_dirty_bitmap_load_enter();
@@ -724,17 +740,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
     }
 
     do {
-        ret = dirty_bitmap_load_header(f, &s);
+        ret = dirty_bitmap_load_header(f, s);
         if (ret < 0) {
             return ret;
         }
 
-        if (s.flags & DIRTY_BITMAP_MIG_FLAG_START) {
-            ret = dirty_bitmap_load_start(f, &s);
-        } else if (s.flags & DIRTY_BITMAP_MIG_FLAG_COMPLETE) {
-            dirty_bitmap_load_complete(f, &s);
-        } else if (s.flags & DIRTY_BITMAP_MIG_FLAG_BITS) {
-            ret = dirty_bitmap_load_bits(f, &s);
+        if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) {
+            ret = dirty_bitmap_load_start(f, s);
+        } else if (s->flags & DIRTY_BITMAP_MIG_FLAG_COMPLETE) {
+            dirty_bitmap_load_complete(f, s);
+        } else if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITS) {
+            ret = dirty_bitmap_load_bits(f, s);
         }
 
         if (!ret) {
@@ -744,7 +760,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
         if (ret) {
             return ret;
         }
-    } while (!(s.flags & DIRTY_BITMAP_MIG_FLAG_EOS));
+    } while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS));
 
     trace_dirty_bitmap_load_success();
     return 0;
@@ -752,13 +768,14 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 
 static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms = NULL;
-    if (init_dirty_bitmap_migration() < 0) {
+    if (init_dirty_bitmap_migration(s) < 0) {
         return -1;
     }
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
-        send_bitmap_start(f, dbms);
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
+        send_bitmap_start(f, s, dbms);
     }
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
@@ -767,7 +784,9 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 
 static bool dirty_bitmap_is_active(void *opaque)
 {
-    return migrate_dirty_bitmaps() && !dirty_bitmap_mig_state.no_bitmaps;
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
+    return migrate_dirty_bitmaps() && !s->no_bitmaps;
 }
 
 static bool dirty_bitmap_is_active_iterate(void *opaque)
@@ -795,10 +814,10 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 
 void dirty_bitmap_mig_init(void)
 {
-    QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
-    qemu_mutex_init(&finish_lock);
+    QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
+    qemu_mutex_init(&dbm_state.load.finish_lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
-                         &dirty_bitmap_mig_state);
+                         &dbm_state);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:36:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:36:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15079.37755 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbL-0005p8-F4; Thu, 29 Oct 2020 21:36:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15079.37755; Thu, 29 Oct 2020 21:36:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbL-0005p0-C1; Thu, 29 Oct 2020 21:36:55 +0000
Received: by outflank-mailman (input) for mailman id 15079;
 Thu, 29 Oct 2020 21:36:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFbK-0005oq-BF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 468b89d1-ab6c-4913-9213-837dd062994f;
 Thu, 29 Oct 2020 21:36:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbJ-0008Nb-Dx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbJ-000576-DH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFbK-0005oq-BF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:54 +0000
X-Inumbo-ID: 468b89d1-ab6c-4913-9213-837dd062994f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 468b89d1-ab6c-4913-9213-837dd062994f;
	Thu, 29 Oct 2020 21:36:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uJhYaHcEc1sZQpzxOfRouEuFz9w424ytp+cBv4XCMrw=; b=Fo4DKp/ZDPvU/QDMU9OOXT0Dsd
	6wDuaViiCrliHer5iuM/6eHEVghrWW+bzOzHRveV6xyV2ZtANN+lAM7mdoYelAMrHfTF3/NlGk51N
	7Rhn+5cXxCYfXz4xSowG+wYj+DwwhQBcbj9U+ZBKKcJ+gTejXF3zaLQRzv6lhtM3D0/w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbJ-0008Nb-Dx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbJ-000576-DH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:36:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: rename finish_lock to just lock
Message-Id: <E1kYFbJ-000576-DH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:36:53 +0000

commit 8949121644b756b58d6546d86c9a49f18a0e5153
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:27 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename finish_lock to just lock
    
    finish_lock is bad name, as lock used not only on process end.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-13-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9b39e7aa2b..9194807b54 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -143,7 +143,7 @@ typedef struct DBMLoadState {
     BdrvDirtyBitmap *bitmap;
 
     GSList *enabled_bitmaps;
-    QemuMutex finish_lock;
+    QemuMutex lock; /* protect enabled_bitmaps */
 } DBMLoadState;
 
 typedef struct DBMState {
@@ -575,7 +575,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     DBMLoadState *s = &dbm_state.load;
     GSList *item;
 
-    qemu_mutex_lock(&s->finish_lock);
+    qemu_mutex_lock(&s->lock);
 
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
@@ -592,7 +592,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     g_slist_free(s->enabled_bitmaps);
     s->enabled_bitmaps = NULL;
 
-    qemu_mutex_unlock(&s->finish_lock);
+    qemu_mutex_unlock(&s->lock);
 }
 
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
@@ -601,7 +601,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
     trace_dirty_bitmap_load_complete();
     bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&s->finish_lock);
+    qemu_mutex_lock(&s->lock);
 
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
@@ -633,7 +633,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_dirty_bitmap_unlock(s->bitmap);
     }
 
-    qemu_mutex_unlock(&s->finish_lock);
+    qemu_mutex_unlock(&s->lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -815,7 +815,7 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 void dirty_bitmap_mig_init(void)
 {
     QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
-    qemu_mutex_init(&dbm_state.load.finish_lock);
+    qemu_mutex_init(&dbm_state.load.lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15080.37759 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbV-0005rE-I8; Thu, 29 Oct 2020 21:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15080.37759; Thu, 29 Oct 2020 21:37:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbV-0005r4-Ey; Thu, 29 Oct 2020 21:37:05 +0000
Received: by outflank-mailman (input) for mailman id 15080;
 Thu, 29 Oct 2020 21:37:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFbU-0005qw-UB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 02bf8b3d-cdf0-461d-8690-9a6323e9eeda;
 Thu, 29 Oct 2020 21:37:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbT-0008Ob-HL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbT-000584-Ga
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFbU-0005qw-UB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:04 +0000
X-Inumbo-ID: 02bf8b3d-cdf0-461d-8690-9a6323e9eeda
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 02bf8b3d-cdf0-461d-8690-9a6323e9eeda;
	Thu, 29 Oct 2020 21:37:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=81GBjr/22hv3QbMwVBlC1smuR0l+JB9pd4bSXiB1jhc=; b=ks3pR+9x9ixMuSop/BL2zt34Je
	GRMawwEcJ6JDpp5jAgwIM+O5gqbtlo6s66edXBDgLtgb3AL4X6qUo1pboLLQi8R63B7CVRJyt/CRr
	XxajdWLJdgp2rxnejn7ONlD/cHUr7BkU8QYAYSxQTe6blM3UrnF/LtC5dfrQnxBLc2yk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbT-0008Ob-HL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbT-000584-Ga
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
Message-Id: <E1kYFbT-000584-Ga@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:03 +0000

commit f3045b9a828e99221083a4ad9905b9d7cdd4df2f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:28 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
    
    bdrv_enable_dirty_bitmap_locked() call does nothing, as if we are in
    postcopy, bitmap successor must be enabled, and reclaim operation will
    enable the bitmap.
    
    So, actually we need just call _reclaim_ in both if branches, and
    making differences only to add an assertion seems not really good. The
    logic becomes simple: on load complete we do reclaim and that's all.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-14-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9194807b54..405a259296 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -603,6 +603,10 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 
     qemu_mutex_lock(&s->lock);
 
+    if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
+        bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
+    }
+
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
@@ -612,27 +616,6 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         }
     }
 
-    if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
-        bdrv_dirty_bitmap_lock(s->bitmap);
-        if (s->enabled_bitmaps == NULL) {
-            /* in postcopy */
-            bdrv_reclaim_dirty_bitmap_locked(s->bitmap, &error_abort);
-            bdrv_enable_dirty_bitmap_locked(s->bitmap);
-        } else {
-            /* target not started, successor must be empty */
-            int64_t count = bdrv_get_dirty_count(s->bitmap);
-            BdrvDirtyBitmap *ret = bdrv_reclaim_dirty_bitmap_locked(s->bitmap,
-                                                                    NULL);
-            /* bdrv_reclaim_dirty_bitmap can fail only on no successor (it
-             * must be) or on merge fail, but merge can't fail when second
-             * bitmap is empty
-             */
-            assert(ret == s->bitmap &&
-                   count == bdrv_get_dirty_count(s->bitmap));
-        }
-        bdrv_dirty_bitmap_unlock(s->bitmap);
-    }
-
     qemu_mutex_unlock(&s->lock);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15081.37762 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbf-0005sV-JR; Thu, 29 Oct 2020 21:37:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15081.37762; Thu, 29 Oct 2020 21:37:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbf-0005sN-Ga; Thu, 29 Oct 2020 21:37:15 +0000
Received: by outflank-mailman (input) for mailman id 15081;
 Thu, 29 Oct 2020 21:37:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFbe-0005sG-Pj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f4c29bf-cb98-4322-a9de-1028397b19e9;
 Thu, 29 Oct 2020 21:37:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbd-0008Oi-LF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbd-00059M-K8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFbe-0005sG-Pj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:14 +0000
X-Inumbo-ID: 4f4c29bf-cb98-4322-a9de-1028397b19e9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f4c29bf-cb98-4322-a9de-1028397b19e9;
	Thu, 29 Oct 2020 21:37:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dBnrg56xrbX1zbZPhoi2Xbh6/muGxjogodN6LNk4PUc=; b=GNcElQwk41tXBOSkIye+5l+uNz
	WH/3kzubaRKsq4H2HWjyBrbrM4i0rf0Aq5BZjpOC8jMUsSfHMLftej358AWD2yHDCQaIQGkVUuDuB
	YE+Pn9tpjrwywtiCQhzKDJGrtNCzyPV7ttqzx4tbec8kFeqDFrrTxo8AcGZeJs5Z7fDs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbd-0008Oi-LF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbd-00059M-K8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: keep bitmap state for all bitmaps
Message-Id: <E1kYFbd-00059M-K8@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:13 +0000

commit 0a47190a009614598dc5ae3d9d25138575184520
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:29 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: keep bitmap state for all bitmaps
    
    Keep bitmap state for disabled bitmaps too. Keep the state until the
    end of the process. It's needed for the following commit to implement
    bitmap postcopy canceling.
    
    To clean-up the new list the following logic is used:
    We need two events to consider bitmap migration finished:
    1. chunk with DIRTY_BITMAP_MIG_FLAG_COMPLETE flag should be received
    2. dirty_bitmap_mig_before_vm_start should be called
    These two events may come in any order, so we understand which one is
    last, and on the last of them we remove bitmap migration state from the
    list.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-15-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 64 ++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 21 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 405a259296..eb4ffeac4d 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -132,6 +132,7 @@ typedef struct LoadBitmapState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
     bool migrated;
+    bool enabled;
 } LoadBitmapState;
 
 /* State of the dirty bitmap migration (DBM) during load process */
@@ -142,8 +143,10 @@ typedef struct DBMLoadState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
 
-    GSList *enabled_bitmaps;
-    QemuMutex lock; /* protect enabled_bitmaps */
+    bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
+
+    GSList *bitmaps;
+    QemuMutex lock; /* protect bitmaps */
 } DBMLoadState;
 
 typedef struct DBMState {
@@ -526,6 +529,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
     Error *local_err = NULL;
     uint32_t granularity = qemu_get_be32(f);
     uint8_t flags = qemu_get_byte(f);
+    LoadBitmapState *b;
 
     if (s->bitmap) {
         error_report("Bitmap with the same name ('%s') already exists on "
@@ -552,45 +556,59 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 
     bdrv_disable_dirty_bitmap(s->bitmap);
     if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
-        LoadBitmapState *b;
-
         bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
         if (local_err) {
             error_report_err(local_err);
             return -EINVAL;
         }
-
-        b = g_new(LoadBitmapState, 1);
-        b->bs = s->bs;
-        b->bitmap = s->bitmap;
-        b->migrated = false;
-        s->enabled_bitmaps = g_slist_prepend(s->enabled_bitmaps, b);
     }
 
+    b = g_new(LoadBitmapState, 1);
+    b->bs = s->bs;
+    b->bitmap = s->bitmap;
+    b->migrated = false;
+    b->enabled = flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED;
+
+    s->bitmaps = g_slist_prepend(s->bitmaps, b);
+
     return 0;
 }
 
-void dirty_bitmap_mig_before_vm_start(void)
+/*
+ * before_vm_start_handle_item
+ *
+ * g_slist_foreach helper
+ *
+ * item is LoadBitmapState*
+ * opaque is DBMLoadState*
+ */
+static void before_vm_start_handle_item(void *item, void *opaque)
 {
-    DBMLoadState *s = &dbm_state.load;
-    GSList *item;
-
-    qemu_mutex_lock(&s->lock);
-
-    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
-        LoadBitmapState *b = item->data;
+    DBMLoadState *s = opaque;
+    LoadBitmapState *b = item;
 
+    if (b->enabled) {
         if (b->migrated) {
             bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
+    }
 
+    if (b->migrated) {
+        s->bitmaps = g_slist_remove(s->bitmaps, b);
         g_free(b);
     }
+}
 
-    g_slist_free(s->enabled_bitmaps);
-    s->enabled_bitmaps = NULL;
+void dirty_bitmap_mig_before_vm_start(void)
+{
+    DBMLoadState *s = &dbm_state.load;
+    qemu_mutex_lock(&s->lock);
+
+    assert(!s->before_vm_start_handled);
+    g_slist_foreach(s->bitmaps, before_vm_start_handle_item, s);
+    s->before_vm_start_handled = true;
 
     qemu_mutex_unlock(&s->lock);
 }
@@ -607,11 +625,15 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
     }
 
-    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
             b->migrated = true;
+            if (s->before_vm_start_handled) {
+                s->bitmaps = g_slist_remove(s->bitmaps, b);
+                g_free(b);
+            }
             break;
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15082.37767 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbp-0005tl-LC; Thu, 29 Oct 2020 21:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15082.37767; Thu, 29 Oct 2020 21:37:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbp-0005td-IC; Thu, 29 Oct 2020 21:37:25 +0000
Received: by outflank-mailman (input) for mailman id 15082;
 Thu, 29 Oct 2020 21:37:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFbp-0005tU-0o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e0c7d3af-fcc4-4171-b301-e658ce5d8856;
 Thu, 29 Oct 2020 21:37:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbn-0008Ot-PX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbn-0005AE-Ns
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFbp-0005tU-0o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:25 +0000
X-Inumbo-ID: e0c7d3af-fcc4-4171-b301-e658ce5d8856
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e0c7d3af-fcc4-4171-b301-e658ce5d8856;
	Thu, 29 Oct 2020 21:37:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wq9CzDo860FdTuAAwSJ/saT358kitwQQBCZOgZ5aOeo=; b=jJwMDjWNqEb+8u8GGZdzn7Uv/4
	FxXhTiXmtkra2e0JYFJ8AvWTU8z9YITzokDidrNOHT1dWojPCOe+6sta8htpgRJkhdoreeOXzNieL
	nVSc01ISyE78E9aOzIA98KWYlWgSWqY1OnyAmykyexPNReVs0bvRxwJPKlaNt3oavkyI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbn-0008Ot-PX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbn-0005AE-Ns
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: relax error handling in incoming part
Message-Id: <E1kYFbn-0005AE-Ns@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:23 +0000

commit b91f33b81df7439ac504f4737c3e529ec2bf0525
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:30 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:40:14 2020 -0500

    migration/block-dirty-bitmap: relax error handling in incoming part
    
    Bitmaps data is not critical, and we should not fail the migration (or
    use postcopy recovering) because of dirty-bitmaps migration failure.
    Instead we should just lose unfinished bitmaps.
    
    Still we have to report io stream violation errors, as they affect the
    whole migration stream.
    
    While touching this, tighten code that was previously blindly calling
    malloc on a size read from the migration stream, as a corrupted stream
    (perhaps from a malicious user) should not be able to convince us to
    allocate an inordinate amount of memory.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727194236.19551-16-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: typo fixes, enhance commit message]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 164 +++++++++++++++++++++++++++++++----------
 1 file changed, 127 insertions(+), 37 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index eb4ffeac4d..f91015a4f8 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -145,6 +145,15 @@ typedef struct DBMLoadState {
 
     bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
 
+    /*
+     * cancelled
+     * Incoming migration is cancelled for some reason. That means that we
+     * still should read our chunks from migration stream, to not affect other
+     * migration objects (like RAM), but just ignore them and do not touch any
+     * bitmaps or nodes.
+     */
+    bool cancelled;
+
     GSList *bitmaps;
     QemuMutex lock; /* protect bitmaps */
 } DBMLoadState;
@@ -531,6 +540,10 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
     uint8_t flags = qemu_get_byte(f);
     LoadBitmapState *b;
 
+    if (s->cancelled) {
+        return 0;
+    }
+
     if (s->bitmap) {
         error_report("Bitmap with the same name ('%s') already exists on "
                      "destination", bdrv_dirty_bitmap_name(s->bitmap));
@@ -613,13 +626,47 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_unlock(&s->lock);
 }
 
+static void cancel_incoming_locked(DBMLoadState *s)
+{
+    GSList *item;
+
+    if (s->cancelled) {
+        return;
+    }
+
+    s->cancelled = true;
+    s->bs = NULL;
+    s->bitmap = NULL;
+
+    /* Drop all unfinished bitmaps */
+    for (item = s->bitmaps; item; item = g_slist_next(item)) {
+        LoadBitmapState *b = item->data;
+
+        /*
+         * Bitmap must be unfinished, as finished bitmaps should already be
+         * removed from the list.
+         */
+        assert(!s->before_vm_start_handled || !b->migrated);
+        if (bdrv_dirty_bitmap_has_successor(b->bitmap)) {
+            bdrv_reclaim_dirty_bitmap(b->bitmap, &error_abort);
+        }
+        bdrv_release_dirty_bitmap(b->bitmap);
+    }
+
+    g_slist_free_full(s->bitmaps, g_free);
+    s->bitmaps = NULL;
+}
+
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
     trace_dirty_bitmap_load_complete();
-    bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&s->lock);
+    if (s->cancelled) {
+        return;
+    }
+
+    bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
     if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
         bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
@@ -637,8 +684,6 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
             break;
         }
     }
-
-    qemu_mutex_unlock(&s->lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -650,15 +695,46 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
 
     if (s->flags & DIRTY_BITMAP_MIG_FLAG_ZEROES) {
         trace_dirty_bitmap_load_bits_zeroes();
-        bdrv_dirty_bitmap_deserialize_zeroes(s->bitmap, first_byte, nr_bytes,
-                                             false);
+        if (!s->cancelled) {
+            bdrv_dirty_bitmap_deserialize_zeroes(s->bitmap, first_byte,
+                                                 nr_bytes, false);
+        }
     } else {
         size_t ret;
-        uint8_t *buf;
+        g_autofree uint8_t *buf = NULL;
         uint64_t buf_size = qemu_get_be64(f);
-        uint64_t needed_size =
-            bdrv_dirty_bitmap_serialization_size(s->bitmap,
-                                                 first_byte, nr_bytes);
+        uint64_t needed_size;
+
+        /*
+         * The actual check for buf_size is done a bit later. We can't do it in
+         * cancelled mode as we don't have the bitmap to check the constraints
+         * (so, we allocate a buffer and read prior to the check). On the other
+         * hand, we shouldn't blindly g_malloc the number from the stream.
+         * Actually one chunk should not be larger than CHUNK_SIZE. Let's allow
+         * a bit larger (which means that bitmap migration will fail anyway and
+         * the whole migration will most probably fail soon due to broken
+         * stream).
+         */
+        if (buf_size > 10 * CHUNK_SIZE) {
+            error_report("Bitmap migration stream buffer allocation request "
+                         "is too large");
+            return -EIO;
+        }
+
+        buf = g_malloc(buf_size);
+        ret = qemu_get_buffer(f, buf, buf_size);
+        if (ret != buf_size) {
+            error_report("Failed to read bitmap bits");
+            return -EIO;
+        }
+
+        if (s->cancelled) {
+            return 0;
+        }
+
+        needed_size = bdrv_dirty_bitmap_serialization_size(s->bitmap,
+                                                           first_byte,
+                                                           nr_bytes);
 
         if (needed_size > buf_size ||
             buf_size > QEMU_ALIGN_UP(needed_size, 4 * sizeof(long))
@@ -667,20 +743,12 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
             error_report("Migrated bitmap granularity doesn't "
                          "match the destination bitmap '%s' granularity",
                          bdrv_dirty_bitmap_name(s->bitmap));
-            return -EINVAL;
-        }
-
-        buf = g_malloc(buf_size);
-        ret = qemu_get_buffer(f, buf, buf_size);
-        if (ret != buf_size) {
-            error_report("Failed to read bitmap bits");
-            g_free(buf);
-            return -EIO;
+            cancel_incoming_locked(s);
+            return 0;
         }
 
         bdrv_dirty_bitmap_deserialize_part(s->bitmap, buf, first_byte, nr_bytes,
                                            false);
-        g_free(buf);
     }
 
     return 0;
@@ -700,14 +768,16 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
             error_report("Unable to read node name string");
             return -EINVAL;
         }
-        s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err);
-        if (!s->bs) {
-            error_report_err(local_err);
-            return -EINVAL;
+        if (!s->cancelled) {
+            s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err);
+            if (!s->bs) {
+                error_report_err(local_err);
+                cancel_incoming_locked(s);
+            }
         }
-    } else if (!s->bs && !nothing) {
+    } else if (!s->bs && !nothing && !s->cancelled) {
         error_report("Error: block device name is not set");
-        return -EINVAL;
+        cancel_incoming_locked(s);
     }
 
     if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) {
@@ -715,24 +785,38 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
             error_report("Unable to read bitmap name string");
             return -EINVAL;
         }
-        s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
-
-        /* bitmap may be NULL here, it wouldn't be an error if it is the
-         * first occurrence of the bitmap */
-        if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) {
-            error_report("Error: unknown dirty bitmap "
-                         "'%s' for block device '%s'",
-                         s->bitmap_name, s->node_name);
-            return -EINVAL;
+        if (!s->cancelled) {
+            s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
+
+            /*
+             * bitmap may be NULL here, it wouldn't be an error if it is the
+             * first occurrence of the bitmap
+             */
+            if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) {
+                error_report("Error: unknown dirty bitmap "
+                             "'%s' for block device '%s'",
+                             s->bitmap_name, s->node_name);
+                cancel_incoming_locked(s);
+            }
         }
-    } else if (!s->bitmap && !nothing) {
+    } else if (!s->bitmap && !nothing && !s->cancelled) {
         error_report("Error: block device name is not set");
-        return -EINVAL;
+        cancel_incoming_locked(s);
     }
 
     return 0;
 }
 
+/*
+ * dirty_bitmap_load
+ *
+ * Load sequence of dirty bitmap chunks. Return error only on fatal io stream
+ * violations. On other errors just cancel bitmaps incoming migration and return
+ * 0.
+ *
+ * Note, than when incoming bitmap migration is canceled, we still must read all
+ * our chunks (and just ignore them), to not affect other migration objects.
+ */
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
     DBMLoadState *s = &((DBMState *)opaque)->load;
@@ -741,12 +825,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
     trace_dirty_bitmap_load_enter();
 
     if (version_id != 1) {
+        QEMU_LOCK_GUARD(&s->lock);
+        cancel_incoming_locked(s);
         return -EINVAL;
     }
 
     do {
+        QEMU_LOCK_GUARD(&s->lock);
+
         ret = dirty_bitmap_load_header(f, s);
         if (ret < 0) {
+            cancel_incoming_locked(s);
             return ret;
         }
 
@@ -763,6 +852,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
         }
 
         if (ret) {
+            cancel_incoming_locked(s);
             return ret;
         }
     } while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15083.37770 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbz-0005vA-Mj; Thu, 29 Oct 2020 21:37:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15083.37770; Thu, 29 Oct 2020 21:37:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFbz-0005v2-Jm; Thu, 29 Oct 2020 21:37:35 +0000
Received: by outflank-mailman (input) for mailman id 15083;
 Thu, 29 Oct 2020 21:37:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFby-0005uv-PG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 552a91b8-4ad5-4bbe-bb41-b282dfeced5c;
 Thu, 29 Oct 2020 21:37:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbx-0008P6-Tx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFbx-0005B8-SM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFby-0005uv-PG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:34 +0000
X-Inumbo-ID: 552a91b8-4ad5-4bbe-bb41-b282dfeced5c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 552a91b8-4ad5-4bbe-bb41-b282dfeced5c;
	Thu, 29 Oct 2020 21:37:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5qCojsFe2oESXC0r5AerZGk8NM2AGlPP20ha2ikdeCg=; b=XWK7RZVUbkn6oAJHLO8whwRwjk
	tsYiH1L9euGad8x9LvgYqBG1PJfY3mQ6Pad0HMaITPxA+KQJ1LbD/dPYMbILDwLjS+2mB63Mbfacz
	r1f7nlpRoTA6mQftcWBrgbI+iZaC8vmGH6AtpgvkDStAE6mZ6E5b96bOczeSRvDfLW28=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbx-0008P6-Tx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFbx-0005B8-SM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/block-dirty-bitmap: cancel migration on shutdown
Message-Id: <E1kYFbx-0005B8-SM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:33 +0000

commit 1499ab096950364d634418e7aefb562694d6c953
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:31 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    migration/block-dirty-bitmap: cancel migration on shutdown
    
    If target is turned off prior to postcopy finished, target crashes
    because busy bitmaps are found at shutdown.
    Canceling incoming migration helps, as it removes all unfinished (and
    therefore busy) bitmaps.
    
    Similarly on source we crash in bdrv_close_all which asserts that all
    bdrv states are removed, because bdrv states involved into dirty bitmap
    migration are referenced by it. So, we need to cancel outgoing
    migration as well.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-17-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 16 ++++++++++++++++
 migration/migration.c          | 13 +++++++++++++
 migration/migration.h          |  2 ++
 3 files changed, 31 insertions(+)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index f91015a4f8..1f675b792f 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -657,6 +657,22 @@ static void cancel_incoming_locked(DBMLoadState *s)
     s->bitmaps = NULL;
 }
 
+void dirty_bitmap_mig_cancel_outgoing(void)
+{
+    dirty_bitmap_do_save_cleanup(&dbm_state.save);
+}
+
+void dirty_bitmap_mig_cancel_incoming(void)
+{
+    DBMLoadState *s = &dbm_state.load;
+
+    qemu_mutex_lock(&s->lock);
+
+    cancel_incoming_locked(s);
+
+    qemu_mutex_unlock(&s->lock);
+}
+
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
diff --git a/migration/migration.c b/migration/migration.c
index 1c61428988..8fe36339db 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -188,6 +188,19 @@ void migration_shutdown(void)
      */
     migrate_fd_cancel(current_migration);
     object_unref(OBJECT(current_migration));
+
+    /*
+     * Cancel outgoing migration of dirty bitmaps. It should
+     * at least unref used block nodes.
+     */
+    dirty_bitmap_mig_cancel_outgoing();
+
+    /*
+     * Cancel incoming migration of dirty bitmaps. Dirty bitmaps
+     * are non-critical data, and their loss never considered as
+     * something serious.
+     */
+    dirty_bitmap_mig_cancel_incoming();
 }
 
 /* For outgoing */
diff --git a/migration/migration.h b/migration/migration.h
index ab20c756f5..6c6a931d0d 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -335,6 +335,8 @@ void migrate_send_rp_recv_bitmap(MigrationIncomingState *mis,
 void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
 
 void dirty_bitmap_mig_before_vm_start(void);
+void dirty_bitmap_mig_cancel_outgoing(void);
+void dirty_bitmap_mig_cancel_incoming(void);
 void migrate_add_address(SocketAddress *address);
 
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15084.37775 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFc9-0005wi-Po; Thu, 29 Oct 2020 21:37:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15084.37775; Thu, 29 Oct 2020 21:37:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFc9-0005wa-Mv; Thu, 29 Oct 2020 21:37:45 +0000
Received: by outflank-mailman (input) for mailman id 15084;
 Thu, 29 Oct 2020 21:37:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFc8-0005wV-Un
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6bed2874-ebfd-44f3-aee3-4e6852109570;
 Thu, 29 Oct 2020 21:37:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFc8-0008Qi-1F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFc8-0005DT-0U
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFc8-0005wV-Un
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
X-Inumbo-ID: 6bed2874-ebfd-44f3-aee3-4e6852109570
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6bed2874-ebfd-44f3-aee3-4e6852109570;
	Thu, 29 Oct 2020 21:37:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BYWTY43cEC9yw2fqye5W3C1r9YHAzgUqDQgO/UVxqpM=; b=nU+DarZODFGr4CeMFfVI4OrBOv
	DseG8X0mn/iQ23mlA66JhhDYmjj9lvLIsa74N9cOW2fHZHQhPzdkWh11bjyqjA3Pc6HO156xvBbeC
	CE8Gk4d6jo3sw+UEteMmeMltl+s0UJ7VL0G+jNktAmhzV9EitfOiHbDdu4AXqp77dC5E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFc8-0008Qi-1F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFc8-0005DT-0U
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration/savevm: don't worry if bitmap migration postcopy failed
Message-Id: <E1kYFc8-0005DT-0U@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:44 +0000

commit ee64722514fabcad2430982ade86180208f5be4f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:32 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    migration/savevm: don't worry if bitmap migration postcopy failed
    
    First, if only bitmaps postcopy is enabled (and not ram postcopy)
    postcopy_pause_incoming crashes on an assertion
    assert(mis->to_src_file).
    
    And anyway, bitmaps postcopy is not prepared to be somehow recovered.
    The original idea instead is that if bitmaps postcopy failed, we just
    lose some bitmaps, which is not critical. So, on failure we just need
    to remove unfinished bitmaps and guest should continue execution on
    destination.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-18-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/savevm.c | 37 ++++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 45c9dd9d8a..a843d202b5 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1813,6 +1813,9 @@ static void *postcopy_ram_listen_thread(void *opaque)
     MigrationIncomingState *mis = migration_incoming_get_current();
     QEMUFile *f = mis->from_src_file;
     int load_res;
+    MigrationState *migr = migrate_get_current();
+
+    object_ref(OBJECT(migr));
 
     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                                    MIGRATION_STATUS_POSTCOPY_ACTIVE);
@@ -1839,11 +1842,24 @@ static void *postcopy_ram_listen_thread(void *opaque)
 
     trace_postcopy_ram_listen_thread_exit();
     if (load_res < 0) {
-        error_report("%s: loadvm failed: %d", __func__, load_res);
         qemu_file_set_error(f, load_res);
-        migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
-                                       MIGRATION_STATUS_FAILED);
-    } else {
+        dirty_bitmap_mig_cancel_incoming();
+        if (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING &&
+            !migrate_postcopy_ram() && migrate_dirty_bitmaps())
+        {
+            error_report("%s: loadvm failed during postcopy: %d. All states "
+                         "are migrated except dirty bitmaps. Some dirty "
+                         "bitmaps may be lost, and present migrated dirty "
+                         "bitmaps are correctly migrated and valid.",
+                         __func__, load_res);
+            load_res = 0; /* prevent further exit() */
+        } else {
+            error_report("%s: loadvm failed: %d", __func__, load_res);
+            migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
+                                           MIGRATION_STATUS_FAILED);
+        }
+    }
+    if (load_res >= 0) {
         /*
          * This looks good, but it's possible that the device loading in the
          * main thread hasn't finished yet, and so we might not be in 'RUN'
@@ -1879,6 +1895,8 @@ static void *postcopy_ram_listen_thread(void *opaque)
     mis->have_listen_thread = false;
     postcopy_state_set(POSTCOPY_INCOMING_END);
 
+    object_unref(OBJECT(migr));
+
     return NULL;
 }
 
@@ -2437,6 +2455,8 @@ static bool postcopy_pause_incoming(MigrationIncomingState *mis)
 {
     trace_postcopy_pause_incoming();
 
+    assert(migrate_postcopy_ram());
+
     /* Clear the triggered bit to allow one recovery */
     mis->postcopy_recover_triggered = false;
 
@@ -2521,15 +2541,22 @@ out:
     if (ret < 0) {
         qemu_file_set_error(f, ret);
 
+        /* Cancel bitmaps incoming regardless of recovery */
+        dirty_bitmap_mig_cancel_incoming();
+
         /*
          * If we are during an active postcopy, then we pause instead
          * of bail out to at least keep the VM's dirty data.  Note
          * that POSTCOPY_INCOMING_LISTENING stage is still not enough,
          * during which we're still receiving device states and we
          * still haven't yet started the VM on destination.
+         *
+         * Only RAM postcopy supports recovery. Still, if RAM postcopy is
+         * enabled, canceled bitmaps postcopy will not affect RAM postcopy
+         * recovering.
          */
         if (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING &&
-            postcopy_pause_incoming(mis)) {
+            migrate_postcopy_ram() && postcopy_pause_incoming(mis)) {
             /* Reset f to point to the newly created channel */
             f = mis->from_src_file;
             goto retry;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:37:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:37:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15085.37780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcJ-0005y9-S3; Thu, 29 Oct 2020 21:37:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15085.37780; Thu, 29 Oct 2020 21:37:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcJ-0005y1-Od; Thu, 29 Oct 2020 21:37:55 +0000
Received: by outflank-mailman (input) for mailman id 15085;
 Thu, 29 Oct 2020 21:37:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFcJ-0005xt-15
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 20e63953-cac8-4114-bd1d-533e0269737e;
 Thu, 29 Oct 2020 21:37:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcI-0008Qp-4s
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcI-0005ES-4B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFcJ-0005xt-15
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:55 +0000
X-Inumbo-ID: 20e63953-cac8-4114-bd1d-533e0269737e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 20e63953-cac8-4114-bd1d-533e0269737e;
	Thu, 29 Oct 2020 21:37:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZLi8NArMNIV3wg3uAal/b++sivvTvhGxhJgNtJnElL4=; b=AhzoqwcYrZKL3fviepwCKbSQ+v
	89jF6OV3iHEJBplXU5mur2yQovOkNTh2jSw9VuUEOTqYLH4ZKW6XfFMC3z/hmYQfBkyNrKQw5KTrg
	fMoTpS+b4sVei8MXku0gVQxtu/UmFcKBEAvo4HVbU/pLVDdo9PQyl+dO+YKvU7H5rarQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcI-0008Qp-4s
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcI-0005ES-4B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:37:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: prepare for new test-cases addition
Message-Id: <E1kYFcI-0005ES-4B@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:37:54 +0000

commit 48f43820cd39f566536f0a5acc328c181f03f0d0
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:33 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: prepare for new test-cases addition
    
    Move future common part to start_postcopy() method. Move checking
    number of bitmaps to check_bitmap().
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-19-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index d8532e49da..355c0b2885 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -29,6 +29,8 @@ disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
+granularity = 512
+nb_bitmaps = 15
 
 GiB = 1024 * 1024 * 1024
 
@@ -61,6 +63,15 @@ def event_dist(e1, e2):
     return event_seconds(e2) - event_seconds(e1)
 
 
+def check_bitmaps(vm, count):
+    result = vm.qmp('query-block')
+
+    if count == 0:
+        assert 'dirty-bitmaps' not in result['return'][0]
+    else:
+        assert len(result['return'][0]['dirty-bitmaps']) == count
+
+
 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
         if debug:
@@ -101,10 +112,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a_events = []
         self.vm_b_events = []
 
-    def test_postcopy(self):
-        granularity = 512
-        nb_bitmaps = 15
-
+    def start_postcopy(self):
+        """ Run migration until RESUME event on target. Return this event. """
         for i in range(nb_bitmaps):
             result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                    name='bitmap{}'.format(i),
@@ -119,10 +128,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap0')
-        discards1_sha256 = result['return']['sha256']
+        self.discards1_sha256 = result['return']['sha256']
 
         # Check, that updating the bitmap by discards works
-        assert discards1_sha256 != empty_sha256
+        assert self.discards1_sha256 != empty_sha256
 
         # We want to calculate resulting sha256. Do it in bitmap0, so, disable
         # other bitmaps
@@ -135,7 +144,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap0')
-        all_discards_sha256 = result['return']['sha256']
+        self.all_discards_sha256 = result['return']['sha256']
 
         # Now, enable some bitmaps, to be updated during migration
         for i in range(2, nb_bitmaps, 2):
@@ -160,6 +169,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
+        return event_resume
+
+    def test_postcopy_success(self):
+        event_resume = self.start_postcopy()
 
         # enabled bitmaps should be updated
         apply_discards(self.vm_b, discards2)
@@ -180,18 +193,15 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
 
-        # Assert that bitmap migration is finished (check that successor bitmap
-        # is removed)
-        result = self.vm_b.qmp('query-block')
-        assert len(result['return'][0]['dirty-bitmaps']) == nb_bitmaps
+        check_bitmaps(self.vm_b, nb_bitmaps)
 
         # Check content of migrated bitmaps. Still, don't waste time checking
         # every bitmap
         for i in range(0, nb_bitmaps, 5):
             result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                    node='drive0', name='bitmap{}'.format(i))
-            sha256 = discards1_sha256 if i % 2 else all_discards_sha256
-            self.assert_qmp(result, 'return/sha256', sha256)
+            sha = self.discards1_sha256 if i % 2 else self.all_discards_sha256
+            self.assert_qmp(result, 'return/sha256', sha)
 
 
 if __name__ == '__main__':
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15086.37783 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcT-00061b-T9; Thu, 29 Oct 2020 21:38:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15086.37783; Thu, 29 Oct 2020 21:38:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcT-00061T-Q6; Thu, 29 Oct 2020 21:38:05 +0000
Received: by outflank-mailman (input) for mailman id 15086;
 Thu, 29 Oct 2020 21:38:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFcT-00061L-1c
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e09e405c-2a31-446b-9de4-ff9f2bc8f6f4;
 Thu, 29 Oct 2020 21:38:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcS-0008Ra-8i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcS-0005Fg-7k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFcT-00061L-1c
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:05 +0000
X-Inumbo-ID: e09e405c-2a31-446b-9de4-ff9f2bc8f6f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e09e405c-2a31-446b-9de4-ff9f2bc8f6f4;
	Thu, 29 Oct 2020 21:38:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U/hiJPQBRjYaPRRg/rZhmn4bubND039Erv0tEU3FSiw=; b=rwpepgIC3EgPr08I2B9SaqeunL
	zffhCnksphRuMcZAYtokstKAnIPgIAJEbwma6exstArA1157dmrzX7TJ3PifOWKK5hHsUfHtRmIFN
	1qVk6tIDLX+RHc4xTJlt3Mkm23NZqY/uY5GJqZixmlyVwOgu3CwTLTySvTA+7K10T6Lw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcS-0008Ra-8i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcS-0005Fg-7k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: check persistent bitmaps
Message-Id: <E1kYFcS-0005Fg-7k@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:04 +0000

commit d4c6fcc01b59016e49adf3b12e23e65df212eba2
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:34 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: check persistent bitmaps
    
    Check that persistent bitmaps are not stored on source and that bitmaps
    are persistent on destination.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-20-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 355c0b2885..5fd34f0fcd 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -117,7 +117,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         for i in range(nb_bitmaps):
             result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                    name='bitmap{}'.format(i),
-                                   granularity=granularity)
+                                   granularity=granularity,
+                                   persistent=True)
             self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
@@ -193,6 +194,19 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
 
+        # check that there are no bitmaps stored on source
+        self.vm_a_events += self.vm_a.get_qmp_events()
+        self.vm_a.shutdown()
+        self.vm_a.launch()
+        check_bitmaps(self.vm_a, 0)
+
+        # check that bitmaps are migrated and persistence works
+        check_bitmaps(self.vm_b, nb_bitmaps)
+        self.vm_b.shutdown()
+        # recreate vm_b, so there is no incoming option, which prevents
+        # loading bitmaps from disk
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_b.launch()
         check_bitmaps(self.vm_b, nb_bitmaps)
 
         # Check content of migrated bitmaps. Still, don't waste time checking
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15088.37790 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcg-00063q-0Z; Thu, 29 Oct 2020 21:38:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15088.37790; Thu, 29 Oct 2020 21:38:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcf-00063i-TH; Thu, 29 Oct 2020 21:38:17 +0000
Received: by outflank-mailman (input) for mailman id 15088;
 Thu, 29 Oct 2020 21:38:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFce-00063Y-BE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 26060d9c-93c3-43a6-b3b5-131701467425;
 Thu, 29 Oct 2020 21:38:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcc-0008Rk-CC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcc-0005Ge-BW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFce-00063Y-BE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:16 +0000
X-Inumbo-ID: 26060d9c-93c3-43a6-b3b5-131701467425
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 26060d9c-93c3-43a6-b3b5-131701467425;
	Thu, 29 Oct 2020 21:38:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zxE35+2E1WTtdUJTiU/AsmwI/sqAsiw0XCgy1MKgcgc=; b=LP1HoSRZzYefybsLHLoMVqIO3r
	iCXOzmolkdVIWQUx3uStde+uyTxk7ky3gSvztUS1ETeGFPIt1b3stnoxLXxuSZbaFyl2CRUivLRHl
	5b4jEH/Zy2iC3OuW5HDlnxFXbHBjZ6umaFbV8HB4+qwCrEQ7h968qoxZTTJvhGKulMo8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcc-0008Rk-CC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcc-0005Ge-BW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: add early shutdown case to bitmaps postcopy
Message-Id: <E1kYFcc-0005Ge-BW@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:14 +0000

commit 845b2204c969c90949d5b90765d754a7ca25dc56
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:35 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: add early shutdown case to bitmaps postcopy
    
    Previous patches fixed two crashes which may occur on shutdown prior to
    bitmaps postcopy finished. Check that it works now.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-21-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199     | 24 ++++++++++++++++++++++++
 tests/qemu-iotests/199.out |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 5fd34f0fcd..140930b2b1 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -217,6 +217,30 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             sha = self.discards1_sha256 if i % 2 else self.all_discards_sha256
             self.assert_qmp(result, 'return/sha256', sha)
 
+    def test_early_shutdown_destination(self):
+        self.start_postcopy()
+
+        self.vm_b_events += self.vm_b.get_qmp_events()
+        self.vm_b.shutdown()
+        # recreate vm_b, so there is no incoming option, which prevents
+        # loading bitmaps from disk
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_b.launch()
+        check_bitmaps(self.vm_b, 0)
+
+        # Bitmaps will be lost if we just shutdown the vm, as they are marked
+        # to skip storing to disk when prepared for migration. And that's
+        # correct, as actual data may be modified in target vm, so we play
+        # safe.
+        # Still, this mark would be taken away if we do 'cont', and bitmaps
+        # become persistent again. (see iotest 169 for such behavior case)
+        result = self.vm_a.qmp('query-status')
+        assert not result['return']['running']
+        self.vm_a_events += self.vm_a.get_qmp_events()
+        self.vm_a.shutdown()
+        self.vm_a.launch()
+        check_bitmaps(self.vm_a, 0)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index ae1213e6f8..fbc63e62f8 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-.
+..
 ----------------------------------------------------------------------
-Ran 1 tests
+Ran 2 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15089.37793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcp-00065A-1d; Thu, 29 Oct 2020 21:38:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15089.37793; Thu, 29 Oct 2020 21:38:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFco-000652-Uv; Thu, 29 Oct 2020 21:38:26 +0000
Received: by outflank-mailman (input) for mailman id 15089;
 Thu, 29 Oct 2020 21:38:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFcn-00064t-J3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b5e234e0-bb3e-4474-903f-30c76ddcbd8a;
 Thu, 29 Oct 2020 21:38:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcm-0008Rs-Fl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcm-0005HU-F0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFcn-00064t-J3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:25 +0000
X-Inumbo-ID: b5e234e0-bb3e-4474-903f-30c76ddcbd8a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b5e234e0-bb3e-4474-903f-30c76ddcbd8a;
	Thu, 29 Oct 2020 21:38:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6w7s/fOXXYrjgS6cz+Ep1dQS8mVx9fWannsTYjcdX20=; b=b+MJyn5H/GK7SvYwEZRsd1foi6
	pSIZEGzvTwvsOT0Ni2fm1flOgUiqkBKPWYrEQpXVWL94Qv53rSlL7YTkMM3bW+pJV/5YpunByqdw5
	UDQsWz8q2BhL9cKtfn2S1Fcty7KEA2jbyWcdHI5gcGh+m5kLBnsalCcP44/xAAecD4sA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcm-0008Rs-Fl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcm-0005HU-F0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qemu-iotests/199: add source-killed case to bitmaps postcopy
Message-Id: <E1kYFcm-0005HU-F0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:24 +0000

commit 058a08a658ebe152526ea41093679cdb0004abb3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:36 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: add source-killed case to bitmaps postcopy
    
    Previous patches fixes behavior of bitmaps migration, so that errors
    are handled by just removing unfinished bitmaps, and not fail or try to
    recover postcopy migration. Add corresponding test.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-22-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199     | 15 +++++++++++++++
 tests/qemu-iotests/199.out |  4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 140930b2b1..58fad872a1 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -241,6 +241,21 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         check_bitmaps(self.vm_a, 0)
 
+    def test_early_kill_source(self):
+        self.start_postcopy()
+
+        self.vm_a_events = self.vm_a.get_qmp_events()
+        self.vm_a.kill()
+
+        self.vm_a.launch()
+
+        match = {'data': {'status': 'completed'}}
+        e_complete = self.vm_b.event_wait('MIGRATION', match=match)
+        self.vm_b_events.append(e_complete)
+
+        check_bitmaps(self.vm_a, 0)
+        check_bitmaps(self.vm_b, 0)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index fbc63e62f8..8d7e996700 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-..
+...
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15090.37798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcz-000673-3K; Thu, 29 Oct 2020 21:38:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15090.37798; Thu, 29 Oct 2020 21:38:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFcz-00066v-0F; Thu, 29 Oct 2020 21:38:37 +0000
Received: by outflank-mailman (input) for mailman id 15090;
 Thu, 29 Oct 2020 21:38:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFcx-00066f-Bz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 410c73d4-5bf9-405f-a2a7-d7bc2b2ce5b9;
 Thu, 29 Oct 2020 21:38:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcw-0008S0-JM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFcw-0005IU-Ia
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFcx-00066f-Bz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:35 +0000
X-Inumbo-ID: 410c73d4-5bf9-405f-a2a7-d7bc2b2ce5b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 410c73d4-5bf9-405f-a2a7-d7bc2b2ce5b9;
	Thu, 29 Oct 2020 21:38:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rVgf4/rfmpbtwZo+qqYTvyeI9OrD8AnYAUkY5gZqfnM=; b=UFtYOAdZ7Vc9Jzq0BXdljtJE2v
	7jM0EqQ3LqG77ITiFgMdURz5yzh6tCEcAgTdkO90RbZC2Mf7rGEr0F9TZ9Y1ocN+uaA2UH+vVjJC0
	L90sroR2BHXjdjSmORPUxQe/leIEO3FX5uXKmn1ikPAA/7yyH+KytfRmXZJK1DYEvBgE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcw-0008S0-JM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFcw-0005IU-Ia
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Adjust which migration tests are quick
Message-Id: <E1kYFcw-0005IU-Ia@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:34 +0000

commit fbd1c1b6426019ab4410f9d01eaa1a8c6394491f
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 27 14:51:17 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:42:13 2020 -0500

    iotests: Adjust which migration tests are quick
    
    A quick run of './check -qcow2 -g migration' shows that test 169 is
    NOT quick, but meanwhile several other tests ARE quick.  Let's adjust
    the test designations accordingly.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727195117.132151-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/group | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 1d0252e1f0..806044642c 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -112,7 +112,7 @@
 088 rw quick
 089 rw auto quick
 090 rw auto quick
-091 rw migration
+091 rw migration quick
 092 rw quick
 093 throttle
 094 rw quick
@@ -186,7 +186,7 @@
 162 quick
 163 rw
 165 rw quick
-169 rw quick migration
+169 rw migration
 170 rw auto quick
 171 rw quick
 172 auto
@@ -197,9 +197,9 @@
 177 rw auto quick
 178 img
 179 rw auto quick
-181 rw auto migration
+181 rw auto migration quick
 182 rw quick
-183 rw migration
+183 rw migration quick
 184 rw auto quick
 185 rw
 186 rw auto
@@ -216,9 +216,9 @@
 198 rw
 199 rw migration
 200 rw
-201 rw migration
+201 rw migration quick
 202 rw quick
-203 rw auto migration
+203 rw auto migration quick
 204 rw quick
 205 rw quick
 206 rw
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15091.37802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFd9-00069C-6I; Thu, 29 Oct 2020 21:38:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15091.37802; Thu, 29 Oct 2020 21:38:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFd9-000694-3O; Thu, 29 Oct 2020 21:38:47 +0000
Received: by outflank-mailman (input) for mailman id 15091;
 Thu, 29 Oct 2020 21:38:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFd7-00068u-T2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 65bb3e32-ce19-4cac-8824-36845e849e16;
 Thu, 29 Oct 2020 21:38:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFd6-0008S9-NY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFd6-0005JU-MA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFd7-00068u-T2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:45 +0000
X-Inumbo-ID: 65bb3e32-ce19-4cac-8824-36845e849e16
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 65bb3e32-ce19-4cac-8824-36845e849e16;
	Thu, 29 Oct 2020 21:38:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cpYdB4QYYFk4KczhVm80O302hLc0957elKEWXe4JQ0w=; b=QO3+OlIShIbYeps6QYehu+vSaQ
	loYwemQn8ccSGx0WtTJb/IJRr97JDLHPFM7T69X/ZvbJAg/GcUcZ7WVkt/HVc5qrttfqYIXps6M0S
	iSLX1FcbMy9hPn5AfS9vU4cQ4nU0RJua9ZnaYbzxKchn+JmwsshKH8hxCuVLr8divHjQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFd6-0008S9-NY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFd6-0005JU-MA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] migration: Fix typos in bitmap migration comments
Message-Id: <E1kYFd6-0005JU-MA@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:44 +0000

commit 37931e006f05cb768b78dcc47453b13f76ea43c5
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 27 15:32:06 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:42:21 2020 -0500

    migration: Fix typos in bitmap migration comments
    
    Noticed while reviewing the file for newer patches.
    
    Fixes: b35ebdf076
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727203206.134996-1-eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 1f675b792f..784330ebe1 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -97,7 +97,7 @@
 
 #define DIRTY_BITMAP_MIG_START_FLAG_ENABLED          0x01
 #define DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT       0x02
-/* 0x04 was "AUTOLOAD" flags on elder versions, no it is ignored */
+/* 0x04 was "AUTOLOAD" flags on older versions, now it is ignored */
 #define DIRTY_BITMAP_MIG_START_FLAG_RESERVED_MASK    0xf8
 
 /* State of one bitmap during save process */
@@ -180,7 +180,7 @@ static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 
 static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
 {
-    /* The code currently do not send flags more than one byte */
+    /* The code currently does not send flags as more than one byte */
     assert(!(flags & (0xffffff00 | DIRTY_BITMAP_MIG_EXTRA_FLAGS)));
 
     qemu_put_byte(f, flags);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:38:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:38:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15092.37806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdJ-0006BK-82; Thu, 29 Oct 2020 21:38:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15092.37806; Thu, 29 Oct 2020 21:38:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdJ-0006BC-4s; Thu, 29 Oct 2020 21:38:57 +0000
Received: by outflank-mailman (input) for mailman id 15092;
 Thu, 29 Oct 2020 21:38:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFdH-0006As-No
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d06d64cd-f18d-4361-959f-02d0c199a463;
 Thu, 29 Oct 2020 21:38:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdG-0008SN-SV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdG-0005KG-R0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFdH-0006As-No
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:55 +0000
X-Inumbo-ID: d06d64cd-f18d-4361-959f-02d0c199a463
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d06d64cd-f18d-4361-959f-02d0c199a463;
	Thu, 29 Oct 2020 21:38:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MQ/eD3XTl1qXX7B/NK6pv+CtxO5WvDqDrHuFuyMiU6U=; b=ugOBDsplzzUTAoYwZxC6gxWKGw
	HgmTsxhHcV30NbgVHfH7kvk2NPdEWqbvVk0YlgtzeQgAzyfMAtrmy+RuFluE8DZ5d94kMMAXrC3Mt
	TyJ/8yUTnxpLoJm9rGQcTPU4O44BOXgisgeKtlwU1zn71810QG0Q0lTKF27l8s5Ax9UE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdG-0008SN-SV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdG-0005KG-R0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:38:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-27' into staging
Message-Id: <E1kYFdG-0005KG-R0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:38:54 +0000

commit 264991512193ee50e27d43e66f832d5041cf3b28
Merge: 1b242c3b1ec7c6011901b4f3b4b0876e31746afb 37931e006f05cb768b78dcc47453b13f76ea43c5
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 14:38:17 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 14:38:17 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-27' into staging
    
    bitmaps patches for 2020-07-27
    
    - Improve handling of various post-copy bitmap migration scenarios. A lost
    bitmap should merely mean that the next backup must be full rather than
    incremental, rather than abruptly breaking the entire guest migration.
    - Associated iotest improvements
    
    # gpg: Signature made Mon 27 Jul 2020 21:46:17 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-07-27: (24 commits)
      migration: Fix typos in bitmap migration comments
      iotests: Adjust which migration tests are quick
      qemu-iotests/199: add source-killed case to bitmaps postcopy
      qemu-iotests/199: add early shutdown case to bitmaps postcopy
      qemu-iotests/199: check persistent bitmaps
      qemu-iotests/199: prepare for new test-cases addition
      migration/savevm: don't worry if bitmap migration postcopy failed
      migration/block-dirty-bitmap: cancel migration on shutdown
      migration/block-dirty-bitmap: relax error handling in incoming part
      migration/block-dirty-bitmap: keep bitmap state for all bitmaps
      migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
      migration/block-dirty-bitmap: rename finish_lock to just lock
      migration/block-dirty-bitmap: refactor state global variables
      migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
      migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
      migration/block-dirty-bitmap: rename state structure types
      migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
      qemu-iotests/199: increase postcopy period
      qemu-iotests/199: change discard patterns
      qemu-iotests/199: improve performance: set bitmap by discard
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/qcow2.c                  |   2 +-
 docs/interop/qcow2.txt         |   2 +-
 migration/block-dirty-bitmap.c | 474 ++++++++++++++++++++++++++---------------
 migration/migration.c          |  15 +-
 migration/migration.h          |   3 +-
 migration/savevm.c             |  37 +++-
 tests/qemu-iotests/199         | 250 +++++++++++++++++-----
 tests/qemu-iotests/199.out     |   4 +-
 tests/qemu-iotests/group       |  12 +-
 9 files changed, 555 insertions(+), 244 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15093.37810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdU-0006EM-A7; Thu, 29 Oct 2020 21:39:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15093.37810; Thu, 29 Oct 2020 21:39:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdU-0006EE-6b; Thu, 29 Oct 2020 21:39:08 +0000
Received: by outflank-mailman (input) for mailman id 15093;
 Thu, 29 Oct 2020 21:39:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFdS-0006Dx-GF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1baf33e5-6326-45ca-8fd5-9dcf927d59c1;
 Thu, 29 Oct 2020 21:39:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdR-0008TR-A0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdR-0005LG-8F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFdS-0006Dx-GF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:06 +0000
X-Inumbo-ID: 1baf33e5-6326-45ca-8fd5-9dcf927d59c1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1baf33e5-6326-45ca-8fd5-9dcf927d59c1;
	Thu, 29 Oct 2020 21:39:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N4GYRezesh+wc9CCcx44sRm6epiXW3p/ODC8ysTfRBY=; b=Z7XUuSbG453MQKj4V167WEvkum
	c/jU+iuZ8xQ55s3vfri5fv0RpxSObAEg64nK7xtrOVsOEu2n03QNQ4CbxehXse1BxwnYSbmdft3co
	ay8tR2EikxBn/UBi86YqisstJmULxbyxZzLniXFS3oJzU3ZPr78elwaMX2IgBC94X66k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdR-0008TR-A0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdR-0005LG-8F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qga-win: fix "guest-get-fsinfo" wrong filesystem type
Message-Id: <E1kYFdR-0005LG-8F@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:05 +0000

commit 3aaebc0cce4a4963f331f45643e17266646411e6
Author:     Basil Salman <bsalman@redhat.com>
AuthorDate: Thu Apr 30 15:11:40 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 27 18:03:55 2020 -0500

    qga-win: fix "guest-get-fsinfo" wrong filesystem type
    
    This patch handles the case where unmounted volumes exist,
    where in that case GetVolumePathNamesForVolumeName returns
    empty path, GetVolumeInformation will use the current working
    directory instead.
    This patch fixes the issue by opening a handle to the volumes,
    and using GetVolumeInformationByHandleW instead.
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1746667
    
    Signed-off-by: Basil Salman <bsalman@redhat.com>
    Signed-off-by: Basil Salman <basil@daynix.com>
    *fix crash when guest_build_fsinfo() sets errp multiple times
    *make new error message more distinct from existing ones
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-win32.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index aaa71f147b..15c9d7944b 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -958,11 +958,13 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
 {
     DWORD info_size;
     char mnt, *mnt_point;
+    wchar_t wfs_name[32];
     char fs_name[32];
-    char vol_info[MAX_PATH+1];
+    wchar_t vol_info[MAX_PATH + 1];
     size_t len;
     uint64_t i64FreeBytesToCaller, i64TotalBytes, i64FreeBytes;
     GuestFilesystemInfo *fs = NULL;
+    HANDLE hLocalDiskHandle = NULL;
 
     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0, &info_size);
     if (GetLastError() != ERROR_MORE_DATA) {
@@ -977,18 +979,27 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
         goto free;
     }
 
+    hLocalDiskHandle = CreateFile(guid, 0 , 0, NULL, OPEN_EXISTING,
+                                  FILE_ATTRIBUTE_NORMAL |
+                                  FILE_FLAG_BACKUP_SEMANTICS, NULL);
+    if (INVALID_HANDLE_VALUE == hLocalDiskHandle) {
+        error_setg_win32(errp, GetLastError(), "failed to get handle for volume");
+        goto free;
+    }
+
     len = strlen(mnt_point);
     mnt_point[len] = '\\';
     mnt_point[len+1] = 0;
-    if (!GetVolumeInformation(mnt_point, vol_info, sizeof(vol_info), NULL, NULL,
-                              NULL, (LPSTR)&fs_name, sizeof(fs_name))) {
+
+    if (!GetVolumeInformationByHandleW(hLocalDiskHandle, vol_info,
+                                       sizeof(vol_info), NULL, NULL, NULL,
+                                       (LPWSTR) & wfs_name, sizeof(wfs_name))) {
         if (GetLastError() != ERROR_NOT_READY) {
             error_setg_win32(errp, GetLastError(), "failed to get volume info");
         }
         goto free;
     }
 
-    fs_name[sizeof(fs_name) - 1] = 0;
     fs = g_malloc(sizeof(*fs));
     fs->name = g_strdup(guid);
     fs->has_total_bytes = false;
@@ -1007,9 +1018,11 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
             fs->has_used_bytes = true;
         }
     }
+    wcstombs(fs_name, wfs_name, sizeof(wfs_name));
     fs->type = g_strdup(fs_name);
     fs->disk = build_guest_disk_info(guid, errp);
 free:
+    CloseHandle(hLocalDiskHandle);
     g_free(mnt_point);
     return fs;
 }
@@ -1027,8 +1040,12 @@ GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp)
     }
 
     do {
-        GuestFilesystemInfo *info = build_guest_fsinfo(guid, errp);
-        if (info == NULL) {
+        Error *local_err = NULL;
+        GuestFilesystemInfo *info = build_guest_fsinfo(guid, &local_err);
+        if (local_err) {
+            g_debug("failed to get filesystem info, ignoring error: %s",
+                    error_get_pretty(local_err));
+            error_free(local_err);
             continue;
         }
         new = g_malloc(sizeof(*ret));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15094.37814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdd-0006Gf-B3; Thu, 29 Oct 2020 21:39:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15094.37814; Thu, 29 Oct 2020 21:39:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdd-0006GX-88; Thu, 29 Oct 2020 21:39:17 +0000
Received: by outflank-mailman (input) for mailman id 15094;
 Thu, 29 Oct 2020 21:39:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFdc-0006GE-7f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6bcbbd74-ee65-47b6-9b69-e710278f1d03;
 Thu, 29 Oct 2020 21:39:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdb-0008Ta-Do
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdb-0005M8-Cw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFdc-0006GE-7f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:16 +0000
X-Inumbo-ID: 6bcbbd74-ee65-47b6-9b69-e710278f1d03
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6bcbbd74-ee65-47b6-9b69-e710278f1d03;
	Thu, 29 Oct 2020 21:39:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C4vrFLT6elZlfe9SzB0KFKt0GXYHWDDe1T3j93iHwGI=; b=Jc6yOWV+JJm2muyIC13iacluxf
	3l8xDFQEQWOjOAGXDdt8q7O5H85NN0Pkg36FjJSV/N45iwWRT+hToUXlfKHZFGRQYKF7YspVfLQMy
	5QUVV59HwQJO2VSjIwIJs5ntotQcn+Xzuw+chFGtaEL9K0WoC783aO9+LurI7bS8pwsU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdb-0008Ta-Do
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdb-0005M8-Cw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qga/qapi-schema: Document -1 for invalid PCI address fields
Message-Id: <E1kYFdb-0005M8-Cw@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:15 +0000

commit ba620541d0db7e3433babbd97c0413a371e6fb4a
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 06:40:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 27 18:03:55 2020 -0500

    qga/qapi-schema: Document -1 for invalid PCI address fields
    
    The "guest-get-fsinfo" could also be used for non-PCI devices in the
    future. And the code in GuestPCIAddress() in qga/commands-win32.c seems
    to be using "-1" for fields that it can not determine already. Thus
    let's properly document "-1" as value for invalid PCI address fields.
    
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/qapi-schema.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 4be9aad48e..408a662ea5 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -846,7 +846,7 @@
 ##
 # @GuestDiskAddress:
 #
-# @pci-controller: controller's PCI address
+# @pci-controller: controller's PCI address (fields are set to -1 if invalid)
 # @bus-type: bus type
 # @bus: bus id
 # @target: target id
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15095.37818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdo-0006JY-Cf; Thu, 29 Oct 2020 21:39:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15095.37818; Thu, 29 Oct 2020 21:39:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdo-0006JQ-9d; Thu, 29 Oct 2020 21:39:28 +0000
Received: by outflank-mailman (input) for mailman id 15095;
 Thu, 29 Oct 2020 21:39:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFdm-0006Iy-FT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 89ce1a5d-9099-4b17-aa28-28bbaafab0b9;
 Thu, 29 Oct 2020 21:39:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdl-0008Tl-Hj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdl-0005N3-GZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFdm-0006Iy-FT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:26 +0000
X-Inumbo-ID: 89ce1a5d-9099-4b17-aa28-28bbaafab0b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 89ce1a5d-9099-4b17-aa28-28bbaafab0b9;
	Thu, 29 Oct 2020 21:39:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DHxRmyySa8HpOtFtrZ/UbLqwz2RlonmkJTLGPA1tpWM=; b=v4AEmtiVDcutc6bicSTMvgC5wM
	vWJnRstiwkdeBOzuUMYsNc1v6JRWaoNbthAtdPNDWhvCqH6BsW+CMDy528b/xk7YVY0mvxmi4WZnk
	KZeXXJ85v8M5887KJ9MNJFZYRVY+o/akYLZsrphAAEtmWwBH1XQkkT7/FloANDGsQcJE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdl-0008Tl-Hj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdl-0005N3-GZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-27-tag' into staging
Message-Id: <E1kYFdl-0005N3-GZ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:25 +0000

commit 1e0e0917e5df765575a72afd35a7183e65f505ac
Merge: 264991512193ee50e27d43e66f832d5041cf3b28 ba620541d0db7e3433babbd97c0413a371e6fb4a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 15:24:31 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 15:24:31 2020 +0100

    Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-27-tag' into staging
    
    qemu-ga patch queue for hard-freeze
    
    * document use of -1 when pci_controller field can't be retrieved for
      guest-get-fsinfo
    * fix incorrect filesystem type reporting on w32 for guest-get-fsinfo
      when a volume is not mounted
    
    # gpg: Signature made Tue 28 Jul 2020 00:16:50 BST
    # gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
    # gpg:                issuer "mdroth@linux.vnet.ibm.com"
    # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
    # gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
    # gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
    # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584
    
    * remotes/mdroth/tags/qga-pull-2020-07-27-tag:
      qga/qapi-schema: Document -1 for invalid PCI address fields
      qga-win: fix "guest-get-fsinfo" wrong filesystem type
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 qga/commands-win32.c | 29 +++++++++++++++++++++++------
 qga/qapi-schema.json |  2 +-
 2 files changed, 24 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15096.37823 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdy-0006MR-FB; Thu, 29 Oct 2020 21:39:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15096.37823; Thu, 29 Oct 2020 21:39:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFdy-0006MI-BI; Thu, 29 Oct 2020 21:39:38 +0000
Received: by outflank-mailman (input) for mailman id 15096;
 Thu, 29 Oct 2020 21:39:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFdw-0006Lh-Pg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6a3efba4-e5a0-4cee-92ac-ccb62eff68ac;
 Thu, 29 Oct 2020 21:39:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdv-0008Tu-T2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFdv-0005OI-SJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFdw-0006Lh-Pg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:36 +0000
X-Inumbo-ID: 6a3efba4-e5a0-4cee-92ac-ccb62eff68ac
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6a3efba4-e5a0-4cee-92ac-ccb62eff68ac;
	Thu, 29 Oct 2020 21:39:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oMVPp+I80bY54T2f7F14YHK34ON9b6nzrTNn+fOTxPA=; b=Tjbb2XiJzkptqC+FM5vckwyPEL
	XrgZwX+DhuFngY3Okr944dQDqy3HuCP72q0MMz4/pRpX/YyekyFqWk8oVIygOYDQJQVW4l52vcqjz
	DtF6gvqC/FocIqHyDSrq4h92sd1TxXhUKyojIdv+iI9i8zV4vs5xBtnXxO6VT8JRhFwg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdv-0008Tu-T2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFdv-0005OI-SJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-pci: fix wrong index in virtio_pci_queue_enabled
Message-Id: <E1kYFdv-0005OI-SJ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:35 +0000

commit a48aaf882b100b30111b5c7c75e1d9e83fe76cfd
Author:     Yuri Benditovich <yuri.benditovich@daynix.com>
AuthorDate: Mon Jul 27 17:38:07 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:54:46 2020 +0800

    virtio-pci: fix wrong index in virtio_pci_queue_enabled
    
    We should use the index passed by the caller instead of the queue_sel
    when checking the enablement of a specific virtqueue.
    
    This is reported in https://bugzilla.redhat.com/show_bug.cgi?id=1702608
    
    Fixes: f19bcdfedd53 ("virtio-pci: implement queue_enabled method")
    Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/virtio/virtio-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4ad3ad81a2..ccdf54e81c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1113,7 +1113,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
 
     if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
-        return proxy->vqs[vdev->queue_sel].enabled;
+        return proxy->vqs[n].enabled;
     }
 
     return virtio_queue_enabled_legacy(vdev, n);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15097.37826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFe8-0006OP-GJ; Thu, 29 Oct 2020 21:39:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15097.37826; Thu, 29 Oct 2020 21:39:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFe8-0006OH-Cw; Thu, 29 Oct 2020 21:39:48 +0000
Received: by outflank-mailman (input) for mailman id 15097;
 Thu, 29 Oct 2020 21:39:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFe6-0006O7-TE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b4088cc8-a0b1-4e0b-8b7b-e966abe7e3dd;
 Thu, 29 Oct 2020 21:39:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFe6-0008U2-0N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFe5-0005Ow-Vt
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFe6-0006O7-TE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:46 +0000
X-Inumbo-ID: b4088cc8-a0b1-4e0b-8b7b-e966abe7e3dd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b4088cc8-a0b1-4e0b-8b7b-e966abe7e3dd;
	Thu, 29 Oct 2020 21:39:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mMOuCLAj+4iUj9b16g7obxgpaSe5LE0LK9JH6mDVv4s=; b=ypkzVm9Z0yUw6wH/OHlSqj3kgV
	xXjPX/NnARawlqwQnr/22ZkvARMrXzZlb3Ivof04c+H1zkUyZQfFcMsMXiYE6WBdPcZCouCUnK3Ux
	bagEA+Aa7idrnwcE0A2ldGouGdFcuEaqq90cTQR0l/xEAUwopOfy8pTNKsF0GIlN/jhI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFe6-0008U2-0N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFe5-0005Ow-Vt
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-net: check the existence of peer before accessing vDPA config
Message-Id: <E1kYFe5-0005Ow-Vt@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:45 +0000

commit c546ecf27da1114d0274abe600cc6bde6584e659
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Sat Jul 25 08:13:17 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:57:58 2020 +0800

    virtio-net: check the existence of peer before accessing vDPA config
    
    We try to check whether a peer is VDPA in order to get config from
    there - with no peer, this leads to a NULL
    pointer dereference. Add a check before trying to access the peer
    type. No peer means not VDPA.
    
    Fixes: 108a64818e69b ("vhost-vdpa: introduce vhost-vdpa backend")
    Cc: Cindy Lu <lulu@redhat.com>
    Tested-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 4895af1cbe..a1fe9e9285 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -125,6 +125,7 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
 {
     VirtIONet *n = VIRTIO_NET(vdev);
     struct virtio_net_config netcfg;
+    NetClientState *nc = qemu_get_queue(n->nic);
 
     int ret = 0;
     memset(&netcfg, 0 , sizeof(struct virtio_net_config));
@@ -142,13 +143,16 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
                  VIRTIO_NET_RSS_SUPPORTED_HASHES);
     memcpy(config, &netcfg, n->config_size);
 
-    NetClientState *nc = qemu_get_queue(n->nic);
-    if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
+    /*
+     * Is this VDPA? No peer means not VDPA: there's no way to
+     * disconnect/reconnect a VDPA peer.
+     */
+    if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
         ret = vhost_net_get_config(get_vhost_net(nc->peer), (uint8_t *)&netcfg,
-                             n->config_size);
-    if (ret != -1) {
-        memcpy(config, &netcfg, n->config_size);
-    }
+                                   n->config_size);
+        if (ret != -1) {
+            memcpy(config, &netcfg, n->config_size);
+        }
     }
 }
 
@@ -156,6 +160,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
 {
     VirtIONet *n = VIRTIO_NET(vdev);
     struct virtio_net_config netcfg = {};
+    NetClientState *nc = qemu_get_queue(n->nic);
 
     memcpy(&netcfg, config, n->config_size);
 
@@ -166,11 +171,14 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
         qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
     }
 
-    NetClientState *nc = qemu_get_queue(n->nic);
-    if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
-        vhost_net_set_config(get_vhost_net(nc->peer), (uint8_t *)&netcfg,
-                               0, n->config_size,
-                        VHOST_SET_CONFIG_TYPE_MASTER);
+    /*
+     * Is this VDPA? No peer means not VDPA: there's no way to
+     * disconnect/reconnect a VDPA peer.
+     */
+    if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
+        vhost_net_set_config(get_vhost_net(nc->peer),
+                             (uint8_t *)&netcfg, 0, n->config_size,
+                             VHOST_SET_CONFIG_TYPE_MASTER);
       }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:39:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:39:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15098.37830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFeI-0006Pu-Jh; Thu, 29 Oct 2020 21:39:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15098.37830; Thu, 29 Oct 2020 21:39:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFeI-0006Pm-GP; Thu, 29 Oct 2020 21:39:58 +0000
Received: by outflank-mailman (input) for mailman id 15098;
 Thu, 29 Oct 2020 21:39:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFeG-0006Pd-Rz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 95caa77d-9359-4dbc-9d3a-0dfc6f0b66a6;
 Thu, 29 Oct 2020 21:39:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeG-0008UA-3w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeG-0005PS-36
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFeG-0006Pd-Rz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
X-Inumbo-ID: 95caa77d-9359-4dbc-9d3a-0dfc6f0b66a6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 95caa77d-9359-4dbc-9d3a-0dfc6f0b66a6;
	Thu, 29 Oct 2020 21:39:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i3pdcceutgmiscMnRqHeat+6n08tq/cF+qos4GJrw5w=; b=BncHeLTstBmGl5/CSOHLZ8f8cB
	eeAV1i4NkI6kxOZ2lHIffj6dmgcGYfmoROZX8nloZ+QzCO6fBNxjccIOyi0244ID7pq+a4lazJ6fy
	sdNYynT4E5P8ktpN1QFluQrKbtIsfCijxCeciSGeQk4e1XMGXqcIuFFaaQ7yaybdqQgw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeG-0008UA-3w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeG-0005PS-36
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:39:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] net: forbid the reentrant RX
Message-Id: <E1kYFeG-0005PS-36@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:39:56 +0000

commit 22dc8663d9fc7baa22100544c600b6285a63c7a3
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Wed Jul 22 16:57:46 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:57:58 2020 +0800

    net: forbid the reentrant RX
    
    The memory API allows DMA into NIC's MMIO area. This means the NIC's
    RX routine must be reentrant. Instead of auditing all the NIC, we can
    simply detect the reentrancy and return early. The queue->delivering
    is set and cleared by qemu_net_queue_deliver() for other queue helpers
    to know whether the delivering in on going (NIC's receive is being
    called). We can check it and return early in qemu_net_queue_flush() to
    forbid reentrant RX.
    
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/queue.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/queue.c b/net/queue.c
index 0164727e39..19e32c80fd 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -250,6 +250,9 @@ void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)
 
 bool qemu_net_queue_flush(NetQueue *queue)
 {
+    if (queue->delivering)
+        return false;
+
     while (!QTAILQ_EMPTY(&queue->packets)) {
         NetPacket *packet;
         int ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15099.37836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFeS-00073G-N2; Thu, 29 Oct 2020 21:40:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15099.37836; Thu, 29 Oct 2020 21:40:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFeS-000731-Hw; Thu, 29 Oct 2020 21:40:08 +0000
Received: by outflank-mailman (input) for mailman id 15099;
 Thu, 29 Oct 2020 21:40:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFeR-0006zF-04
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 95948e36-7117-4635-8b25-f88d01b2b717;
 Thu, 29 Oct 2020 21:40:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeQ-0008Uw-7t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeQ-0005QY-70
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFeR-0006zF-04
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:07 +0000
X-Inumbo-ID: 95948e36-7117-4635-8b25-f88d01b2b717
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 95948e36-7117-4635-8b25-f88d01b2b717;
	Thu, 29 Oct 2020 21:40:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FA5lUwIZO2HLf/zX3ULHZlp1Abd4qTeoqPslPYFciwQ=; b=V8rkelnkX36LEY4T0sIfuLYD7e
	GFjhdCwLHq7e4Ev/2eM0POMnQrcn6Kur+2PeIXF3x+j1Ntu0AEGL2XDfgP4lbQqwHHBbfaoy8J0XR
	Rzih7l3V2nM+uDno01KQftSx6mq5ffSd67PHoarm4nO5Av2OnbvO/QA4cttS6A92audQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeQ-0008Uw-7t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeQ-0005QY-70
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYFeQ-0005QY-70@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:06 +0000

commit a466dd084f51cdc9da2e99361f674f98d7218559
Merge: 1e0e0917e5df765575a72afd35a7183e65f505ac 22dc8663d9fc7baa22100544c600b6285a63c7a3
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 16:28:22 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 16:28:22 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    Want to send earlier but most patches just come.
    
    - fix vhost-vdpa issues when no peer
    - fix virtio-pci queue enabling index value
    - forbid reentrant RX
    
    Changes from V1:
    
    - drop the patch that has been merged
    
    # gpg: Signature made Tue 28 Jul 2020 09:59:41 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      net: forbid the reentrant RX
      virtio-net: check the existence of peer before accessing vDPA config
      virtio-pci: fix wrong index in virtio_pci_queue_enabled
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/virtio-net.c    | 30 +++++++++++++++++++-----------
 hw/virtio/virtio-pci.c |  2 +-
 net/queue.c            |  3 +++
 3 files changed, 23 insertions(+), 12 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15100.37838 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFec-00078A-MU; Thu, 29 Oct 2020 21:40:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15100.37838; Thu, 29 Oct 2020 21:40:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFec-000782-JP; Thu, 29 Oct 2020 21:40:18 +0000
Received: by outflank-mailman (input) for mailman id 15100;
 Thu, 29 Oct 2020 21:40:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFeb-00077v-Fm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 02e7ed74-5e9f-4011-a668-a135ce5e8421;
 Thu, 29 Oct 2020 21:40:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFea-0008V4-JF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFea-0005Ru-IU
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFeb-00077v-Fm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:17 +0000
X-Inumbo-ID: 02e7ed74-5e9f-4011-a668-a135ce5e8421
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 02e7ed74-5e9f-4011-a668-a135ce5e8421;
	Thu, 29 Oct 2020 21:40:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IyupXPFhQBhwwbeXYSnZVA7Fg0EvIJhGJXqerJpWvdI=; b=QuVuQ3/bMLcRA3flzsHuCCdvxi
	L/ZwPXkylq+mJt2twKvcgFEJhQxVxOeeFCa4rLOy/06RiyOT/CxgcWBa3pdqu1LUfazc0oy6pZFN3
	t73nOP7YIBm3kzoL8kl+bvcPvbOcoFFYv0RLE8jZd1kr82BSBPFH9K61GSn8QeTjLtJQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFea-0008V4-JF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFea-0005Ru-IU
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: Ensure mmap_min_addr is non-zero
Message-Id: <E1kYFea-0005Ru-IU@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:16 +0000

commit c9f8066697e0d3e77b97f6df423e9d6540b693be
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Fri Jul 24 14:23:14 2020 -0700
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:02:40 2020 +0200

    linux-user: Ensure mmap_min_addr is non-zero
    
    When the chroot does not have /proc mounted, we can read neither
    /proc/sys/vm/mmap_min_addr nor /proc/sys/maps.
    
    The enforcement of mmap_min_addr in the host kernel is done by
    the security module, and so does not apply to processes owned
    by root.  Which leads pgd_find_hole_fallback to succeed in probing
    a reservation at address 0.  Which confuses pgb_reserved_va to
    believe that guest_base has not actually been initialized.
    
    We don't actually want NULL addresses to become accessible, so
    make sure that mmap_min_addr is initialized with a non-zero value.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1888728
    Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Acked-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200724212314.545877-1-richard.henderson@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 3597e99bb1..75c9785157 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -758,14 +758,26 @@ int main(int argc, char **argv, char **envp)
 
         if ((fp = fopen("/proc/sys/vm/mmap_min_addr", "r")) != NULL) {
             unsigned long tmp;
-            if (fscanf(fp, "%lu", &tmp) == 1) {
+            if (fscanf(fp, "%lu", &tmp) == 1 && tmp != 0) {
                 mmap_min_addr = tmp;
-                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n", mmap_min_addr);
+                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n",
+                              mmap_min_addr);
             }
             fclose(fp);
         }
     }
 
+    /*
+     * We prefer to not make NULL pointers accessible to QEMU.
+     * If we're in a chroot with no /proc, fall back to 1 page.
+     */
+    if (mmap_min_addr == 0) {
+        mmap_min_addr = qemu_host_page_size;
+        qemu_log_mask(CPU_LOG_PAGE,
+                      "host mmap_min_addr=0x%lx (fallback)\n",
+                      mmap_min_addr);
+    }
+
     /*
      * Prepare copy of argv vector for target.
      */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15101.37842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFen-00079T-O0; Thu, 29 Oct 2020 21:40:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15101.37842; Thu, 29 Oct 2020 21:40:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFen-00079L-L5; Thu, 29 Oct 2020 21:40:29 +0000
Received: by outflank-mailman (input) for mailman id 15101;
 Thu, 29 Oct 2020 21:40:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFel-00079A-H4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9f5867eb-c458-487b-ac93-3d6e322e4947;
 Thu, 29 Oct 2020 21:40:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFek-0008VL-NV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFek-0005SO-MO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFel-00079A-H4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:27 +0000
X-Inumbo-ID: 9f5867eb-c458-487b-ac93-3d6e322e4947
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9f5867eb-c458-487b-ac93-3d6e322e4947;
	Thu, 29 Oct 2020 21:40:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=taQ/k0oK22g04IvWyZSY650zrfYzKVo75/TlwygXKpE=; b=451WHV1sMpnaGDoMrjsWREyMM8
	Jf2z95R0JU4NAi6LBNHyhcG3l/HhI98l5Yo+Pxtw6x0sO1mVvky/SWdopEJQYmRo013IGks6F8DuN
	qnF5vT7OlNl39MlN72rlMT+dxIG8GnrYGYcaK8TXh6I0bhHPIe2i+1cko76JDB2wiNT4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFek-0008VL-NV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFek-0005SO-MO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: Fix syscall rt_sigtimedwait() implementation
Message-Id: <E1kYFek-0005SO-MO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:26 +0000

commit 4d213001b356c4a24c05afbc72f4860088900627
Author:     Filip Bozuta <Filip.Bozuta@syrmia.com>
AuthorDate: Fri Jul 24 20:16:51 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:04:07 2020 +0200

    linux-user: Fix syscall rt_sigtimedwait() implementation
    
    Implementation of 'rt_sigtimedwait()' in 'syscall.c' uses the
    function 'target_to_host_timespec()' to transfer the value of
    'struct timespec' from target to host. However, the implementation
    doesn't check whether this conversion succeeds and thus can cause
    an unaproppriate error instead of the 'EFAULT (Bad address)' which
    is supposed to be set if the conversion from target to host fails.
    
    This was confirmed with the LTP test for rt_sigtimedwait:
    "/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c"
    which causes an unapropriate error in test case "test_bad_adress3"
    which is run with a bad adress for the 'struct timespec' argument:
    
    FAIL: test_bad_address3 (349): Unexpected failure: EAGAIN/EWOULDBLOCK (11)
    
    The test fails with an unexptected errno 'EAGAIN/EWOULDBLOCK' instead
    of the expected EFAULT.
    
    After the changes from this patch, the test case is executed successfully
    along with the other LTP test cases for 'rt_sigtimedwait()':
    
    PASS: test_bad_address3 (349): Test passed
    
    Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200724181651.167819-1-Filip.Bozuta@syrmia.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f5c4f6b95d..c1ebf7b8f3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8868,7 +8868,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg1, 0);
             if (arg3) {
                 puts = &uts;
-                target_to_host_timespec(puts, arg3);
+                if (target_to_host_timespec(puts, arg3)) {
+                    return -TARGET_EFAULT;
+                }
             } else {
                 puts = NULL;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15102.37846 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFex-0007Ak-Pk; Thu, 29 Oct 2020 21:40:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15102.37846; Thu, 29 Oct 2020 21:40:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFex-0007Aa-Mc; Thu, 29 Oct 2020 21:40:39 +0000
Received: by outflank-mailman (input) for mailman id 15102;
 Thu, 29 Oct 2020 21:40:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFew-0007AR-7R
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 004731e8-34d5-40c9-9a56-8b1e13ca4db1;
 Thu, 29 Oct 2020 21:40:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeu-0008VT-RQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFeu-0005Sv-Qd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFew-0007AR-7R
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:38 +0000
X-Inumbo-ID: 004731e8-34d5-40c9-9a56-8b1e13ca4db1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 004731e8-34d5-40c9-9a56-8b1e13ca4db1;
	Thu, 29 Oct 2020 21:40:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TgZNB7mJx4qSk2RQUxbL7mqZBeuWe3BgAD/x2WmNL1o=; b=Ne4g2I1Hbzyd4If2XAdrAkCgN/
	QPh4dxjwQAyr2qw84fJmlhdKC08lF+k/B3JW8NWkeN08R5YKo9hUMXfBEc7qYQdoHK55tU0nZJUE4
	91olMxARGitWGZoAKG0ELgC0T20noHnVGJNFuQF3IVUr2JHWs0E0K9QMG1Eoxd3ZFvYw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeu-0008VT-RQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFeu-0005Sv-Qd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] linux-user: Use getcwd syscall directly
Message-Id: <E1kYFeu-0005Sv-Qd@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:36 +0000

commit 0f6bb1958f3aae0171996941df7fb7ea7536bb12
Author:     Andreas Schwab <schwab@suse.de>
AuthorDate: Thu Jul 23 12:27:13 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:05:34 2020 +0200

    linux-user: Use getcwd syscall directly
    
    The glibc getcwd function returns different errors than the getcwd
    syscall, which triggers an assertion failure in the glibc getcwd function
    when running under the emulation.
    
    When the syscall returns ENAMETOOLONG, the glibc wrapper uses a fallback
    implementation that potentially handles an unlimited path length, and
    returns with ERANGE if the provided buffer is too small.  The qemu
    emulation cannot distinguish the two cases, and thus always returns ERANGE.
    This is unexpected by the glibc wrapper.
    
    Signed-off-by: Andreas Schwab <schwab@suse.de>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <mvmmu3qplvi.fsf@suse.de>
    [lv: updated description]
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c1ebf7b8f3..945fc25279 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -388,14 +388,7 @@ static bitmask_transtbl fcntl_flags_tbl[] = {
   { 0, 0, 0, 0 }
 };
 
-static int sys_getcwd1(char *buf, size_t size)
-{
-  if (getcwd(buf, size) == NULL) {
-      /* getcwd() sets errno */
-      return (-1);
-  }
-  return strlen(buf)+1;
-}
+_syscall2(int, sys_getcwd1, char *, buf, size_t, size)
 
 #ifdef TARGET_NR_utimensat
 #if defined(__NR_utimensat)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15103.37850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFf7-0007By-RB; Thu, 29 Oct 2020 21:40:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15103.37850; Thu, 29 Oct 2020 21:40:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFf7-0007Bq-O7; Thu, 29 Oct 2020 21:40:49 +0000
Received: by outflank-mailman (input) for mailman id 15103;
 Thu, 29 Oct 2020 21:40:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFf5-0007Be-W0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 12f0de3f-101d-4b8d-9a4a-6ecc93b35622;
 Thu, 29 Oct 2020 21:40:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFf5-0008Vb-0B
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFf4-0005TQ-Ui
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFf5-0007Be-W0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:48 +0000
X-Inumbo-ID: 12f0de3f-101d-4b8d-9a4a-6ecc93b35622
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 12f0de3f-101d-4b8d-9a4a-6ecc93b35622;
	Thu, 29 Oct 2020 21:40:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PSJrq3cQdRwLV68vLjZBCBTwFXdpfX1yeecRENXAo/g=; b=HV9u25ItTiKO4mQ159v347KEPF
	O7dHzlDTainKdF5NKonEPgLQWAqxS+OGhS0X3YnTXn4oIAPuWC90PaBF6+J+K2NtaDYW3TBV8Gaa/
	IfBF7uEOd245Kc8mm2ziFGr/WfhLcbEbAg0AcW/vtimcZ9zJ6Y5+WPkl8YbbU19fyVVE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFf5-0008Vb-0B
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFf4-0005TQ-Ui
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
Message-Id: <E1kYFf4-0005TQ-Ui@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:46 +0000

commit 0a58e39fe90c50b313a5148c095f8dbb6111a6d6
Merge: a466dd084f51cdc9da2e99361f674f98d7218559 0f6bb1958f3aae0171996941df7fb7ea7536bb12
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 17:15:09 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 17:15:09 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
    
    linux-user 20200728
    
    Fix "pgb_reserved_va: Assertion `guest_base != 0' failed." error
    Fix rt_sigtimedwait() errno
    Fix getcwd() errno
    
    # gpg: Signature made Tue 28 Jul 2020 13:34:11 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/linux-user-for-5.1-pull-request:
      linux-user: Use getcwd syscall directly
      linux-user: Fix syscall rt_sigtimedwait() implementation
      linux-user: Ensure mmap_min_addr is non-zero
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 linux-user/main.c    | 16 ++++++++++++++--
 linux-user/syscall.c | 13 ++++---------
 2 files changed, 18 insertions(+), 11 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:40:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:40:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15104.37854 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfG-0007D7-Sg; Thu, 29 Oct 2020 21:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15104.37854; Thu, 29 Oct 2020 21:40:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfG-0007D0-Pj; Thu, 29 Oct 2020 21:40:58 +0000
Received: by outflank-mailman (input) for mailman id 15104;
 Thu, 29 Oct 2020 21:40:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFfG-0007Cs-5j
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c39134b-f7f8-4d7a-b043-cd1b0e950168;
 Thu, 29 Oct 2020 21:40:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfF-0008Vj-C6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfF-0005UM-BD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFfG-0007Cs-5j
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:58 +0000
X-Inumbo-ID: 2c39134b-f7f8-4d7a-b043-cd1b0e950168
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c39134b-f7f8-4d7a-b043-cd1b0e950168;
	Thu, 29 Oct 2020 21:40:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XaclWGnzNLwPT+lMzfGFWl01GPSU1+JsCjbWkeXLXB0=; b=GigFTRsr3rSWlXcbKCNNi05XBe
	J0oXsPV27GjcZT6JiB6ES0yjqWJpm1HRgh4fD8Ut4B+QeRy2FI2Ii2QnpzUSpw9q5UfVNHoBQBOKt
	x8kwE0OayS4aN4KMHWBbWRRzJXrN6Foa+nmWQDqgHNPK7OioD0Xdtdy3JBjCC2SI0DZM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfF-0008Vj-C6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfF-0005UM-BD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:40:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: Fix bdrv_aligned_p*v() for qiov_offset != 0
Message-Id: <E1kYFfF-0005UM-BD@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:40:57 +0000

commit 134b7dec6ec2d90616d7986afb3b3b7ca7a4c383
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:04 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:47 2020 +0200

    block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Since these functions take a @qiov_offset, they must always take it into
    account when working with @qiov.  There are a couple of places where
    they do not, but they should.
    
    Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c
           ("block/io: bdrv_aligned_preadv: use and support qiov_offset")
    Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d
           ("block/io: bdrv_aligned_pwritev: use and support qiov_offset")
    Reported-by: Claudio Fontana <cfontana@suse.de>
    Reported-by: Bruce Rogers <brogers@suse.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-2-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    Tested-by: Bruce Rogers <brogers@suse.com>
---
 block/io.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/io.c b/block/io.c
index b6564e34c5..ad3a51ed53 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1524,12 +1524,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
             assert(num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, qiov, bytes - bytes_remaining, 0);
+                                     num, qiov,
+                                     qiov_offset + bytes - bytes_remaining, 0);
             max_bytes -= num;
         } else {
             num = bytes_remaining;
-            ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
-                                    bytes_remaining);
+            ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining,
+                                    0, bytes_remaining);
         }
         if (ret < 0) {
             goto out;
@@ -2032,7 +2033,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
             }
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, qiov, bytes - bytes_remaining,
+                                      num, qiov,
+                                      qiov_offset + bytes - bytes_remaining,
                                       local_flags);
             if (ret < 0) {
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:41:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:41:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15105.37858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfQ-0007F6-Vb; Thu, 29 Oct 2020 21:41:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15105.37858; Thu, 29 Oct 2020 21:41:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfQ-0007Ey-Si; Thu, 29 Oct 2020 21:41:08 +0000
Received: by outflank-mailman (input) for mailman id 15105;
 Thu, 29 Oct 2020 21:41:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFfQ-0007Et-A1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d0db1fa5-3a2b-48eb-926f-190ab296c0a9;
 Thu, 29 Oct 2020 21:41:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfP-000052-Fu
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfP-0005VQ-F0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFfQ-0007Et-A1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:08 +0000
X-Inumbo-ID: d0db1fa5-3a2b-48eb-926f-190ab296c0a9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d0db1fa5-3a2b-48eb-926f-190ab296c0a9;
	Thu, 29 Oct 2020 21:41:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rRzg/RHIZ6223t6eEqaZQtoHcz2/bkoNCl5eX6vKBzU=; b=p3ghTjZ4qZqPv15PdqhghCC3lz
	z2wIS3dFkAFjwZ47Tbp9/1MNXvu1tcgz0OlmCFNnv3ZQXF9U5idCSH+k5UFSmBmVQa0NnYzw3zoi1
	2t03ap73VcwQrDZXxyelGSY4bd1t6blHhSr7+8C3S2h2fAMy5mtc7XDGL+6uavoRd2UM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfP-000052-Fu
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfP-0005VQ-F0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/028: Add test for cross-base-EOF reads
Message-Id: <E1kYFfP-0005VQ-F0@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:07 +0000

commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:05 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:56 2020 +0200

    iotests/028: Add test for cross-base-EOF reads
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-3-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
---
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 2 files changed, 30 insertions(+)

diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 5d043cef92..6dd3ae09a3 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 
 _check_test_img
 
+echo
+echo '=== Reading across backing EOF in one operation ==='
+echo
+
+# Use a cluster boundary as the base end here
+base_size=$((3 * 1024 * 1024 * 1024))
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $base_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
+
+# Write 16 times 42 at the end of the base image
+$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \
+    | _filter_qemu_io
+
+# Read 32 bytes across the base EOF from the top;
+# should be 16 times 0x2a, then 16 times 0x00
+$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \
+    | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 12f82c6a6c..5a68de5c46 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728
 read 512/512 bytes at offset 3221258752
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
+
+=== Reading across backing EOF in one operation ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+wrote 16/16 bytes at offset 3221225456
+16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+bffffff0:  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ................
+c0000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+read 32/32 bytes at offset 3221225456
+32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:41:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:41:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15106.37862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfc-0007GT-1A; Thu, 29 Oct 2020 21:41:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15106.37862; Thu, 29 Oct 2020 21:41:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfb-0007GL-UT; Thu, 29 Oct 2020 21:41:19 +0000
Received: by outflank-mailman (input) for mailman id 15106;
 Thu, 29 Oct 2020 21:41:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFfa-0007GC-RA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 87831f50-aa1e-4c11-9cd8-f86143771a65;
 Thu, 29 Oct 2020 21:41:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfZ-00005H-JM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfZ-0005Vx-Ie
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFfa-0007GC-RA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:18 +0000
X-Inumbo-ID: 87831f50-aa1e-4c11-9cd8-f86143771a65
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 87831f50-aa1e-4c11-9cd8-f86143771a65;
	Thu, 29 Oct 2020 21:41:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bF4v2uqClqoUqh2vPpebtBMDIVwhSbsxHiPDvHqRWUc=; b=Zlj257k633nr+afhYl9QTRYa6L
	n/Elvt9iyyzkFrN4CZnmlGV7EZYjsQqMLfD5zgge1vSiSq8MRThXDlxPx7epmFqXTqZSl2FQuQZay
	KJbRCBhixdn1WjPLritC/jgGmBm7G/TPSgonM0VQyKqZkADadzPHnp54HAc11Kd04dr4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfZ-00005H-JM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfZ-0005Vx-Ie
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/197: Fix for non-qcow2 formats
Message-Id: <E1kYFfZ-0005Vx-Ie@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:17 +0000

commit afac471b71da92d91cc56fb64c0719b8a4a2d96b
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 15:11:34 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:56 2020 +0200

    iotests/197: Fix for non-qcow2 formats
    
    While 197 is very much a qcow2 test, and it looks like the partial
    cluster case at the end (introduced in b0ddcbbb36a66a6) is specifically
    a qcow2 case, the whole test scripts actually marks itself to work with
    generic formats (and generic protocols, even).
    
    Said partial cluster case happened to work with non-qcow2 formats as
    well (mostly by accident), but 1855536256 broke that, because it sets
    the compat option, which does not work for non-qcow2 formats.
    
    So go the whole way and force IMGFMT=qcow2 and IMGPROTO=file, as done in
    other places in this test.
    
    Fixes: 1855536256eb0a5708b04b85f744de69559ea323
           ("iotests/197: Fix for compat=0.10")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728131134.902519-1-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/197     | 8 +++++---
 tests/qemu-iotests/197.out | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index 121959a09c..a161c89816 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -114,9 +114,11 @@ echo
 
 # Force compat=1.1, because writing zeroes on a v2 image without a
 # backing file would just result in an unallocated cluster
-_make_test_img -o compat=1.1 1024
-$QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
-$QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
+# (Also, note that this is really a pure qcow2 test.)
+IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
+    _make_test_img --no-opts -o compat=1.1 1024
+$QEMU_IO -f qcow2 -C -c 'read 0 1024' "$TEST_WRAP" | _filter_qemu_io
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
 _check_test_img
 
 # success, all done
diff --git a/tests/qemu-iotests/197.out b/tests/qemu-iotests/197.out
index 7ca46be6e4..ad414c3b0e 100644
--- a/tests/qemu-iotests/197.out
+++ b/tests/qemu-iotests/197.out
@@ -26,7 +26,7 @@ Images are identical.
 
 === Partial final cluster ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024
+Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=1024
 read 1024/1024 bytes at offset 0
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 1 KiB (0x400) bytes     allocated at offset 0 bytes (0x0)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:41:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:41:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15107.37866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfm-0007Hh-2k; Thu, 29 Oct 2020 21:41:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15107.37866; Thu, 29 Oct 2020 21:41:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfl-0007HZ-W2; Thu, 29 Oct 2020 21:41:29 +0000
Received: by outflank-mailman (input) for mailman id 15107;
 Thu, 29 Oct 2020 21:41:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFfk-0007HQ-MI
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bbc6b669-7fc8-4995-823d-53fda44962b8;
 Thu, 29 Oct 2020 21:41:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfj-00005U-N3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfj-0005WT-MA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFfk-0007HQ-MI
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:28 +0000
X-Inumbo-ID: bbc6b669-7fc8-4995-823d-53fda44962b8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bbc6b669-7fc8-4995-823d-53fda44962b8;
	Thu, 29 Oct 2020 21:41:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=47KckGbtNoEmGjs7I8exzv2yTE9TPBmkxwtIFOy/188=; b=0CGBBxK7nAH3UKF5iGza6Mh0sx
	aJrrzbpKausK09rNEU2BbmZMPZhYbemo4Cz3rkA32pBS4CYqwUbr3R0LCZ4px2+3C7A2BzMErmZcM
	6lHshsSm+boNEj/EdkTY8BOqprTMjauOj0RicevUCMYJhc4b4J/w0DnxZvDmFvGDHlXM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfj-00005U-N3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfj-0005WT-MA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-28' into staging
Message-Id: <E1kYFfj-0005WT-MA@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:27 +0000

commit 0c4fa5bc1aa47d30a8def2dc8345284400d123f1
Merge: 0a58e39fe90c50b313a5148c095f8dbb6111a6d6 afac471b71da92d91cc56fb64c0719b8a4a2d96b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 18:00:21 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 18:00:21 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-28' into staging
    
    Block patches for 5.1.0:
    - Fix block I/O for split transfers
    - Fix iotest 197 for non-qcow2 formats
    
    # gpg: Signature made Tue 28 Jul 2020 14:45:28 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-28:
      iotests/197: Fix for non-qcow2 formats
      iotests/028: Add test for cross-base-EOF reads
      block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/io.c                 | 10 ++++++----
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 tests/qemu-iotests/197     |  8 +++++---
 tests/qemu-iotests/197.out |  2 +-
 5 files changed, 42 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:41:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:41:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15108.37870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfw-0007J0-45; Thu, 29 Oct 2020 21:41:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15108.37870; Thu, 29 Oct 2020 21:41:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFfw-0007Is-1F; Thu, 29 Oct 2020 21:41:40 +0000
Received: by outflank-mailman (input) for mailman id 15108;
 Thu, 29 Oct 2020 21:41:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFfu-0007Ij-S5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 53ad0ea2-8e90-4b65-976d-be67d15f9337;
 Thu, 29 Oct 2020 21:41:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfu-00005h-3o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFfu-0005Xx-31
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFfu-0007Ij-S5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
X-Inumbo-ID: 53ad0ea2-8e90-4b65-976d-be67d15f9337
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 53ad0ea2-8e90-4b65-976d-be67d15f9337;
	Thu, 29 Oct 2020 21:41:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mz3x4U7MuosSdvA0MhQYMHvlxQ8ili9yvY6UZGVWKUM=; b=GD67m4NABz0cBIa3x6pGoHIxtc
	E02B4Fv6J1m+SMcduqlRcMEGPxLKCu4oOw6wIIin94MIH2xfw7po8Y0maPVrHBJX69INS5H9Mg3nX
	GdOBqB1H0w7Ql/VvwnVg4VmAnR39Pw84tKUOLKiA/WYdos6286dP2zfyVdtOysoUKmvk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfu-00005h-3o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFfu-0005Xx-31
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] ACPI: Assert that we don't run out of the preallocated memory
Message-Id: <E1kYFfu-0005Xx-31@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:38 +0000

commit 4bf7c0cb09a59314aca261291e3a20a24c7dd3b3
Author:     Dongjiu Geng <gengdongjiu@huawei.com>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    ACPI: Assert that we don't run out of the preallocated memory
    
    data_length is a constant value, so we use assert instead of
    condition check.
    
    Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
    Message-id: 20200622113146.33421-1-gengdongjiu@huawei.com
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/acpi/ghes.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
index b363bc331d..f0ee9f51ca 100644
--- a/hw/acpi/ghes.c
+++ b/hw/acpi/ghes.c
@@ -204,16 +204,12 @@ static int acpi_ghes_record_mem_error(uint64_t error_block_address,
 
     /* This is the length if adding a new generic error data entry*/
     data_length = ACPI_GHES_DATA_LENGTH + ACPI_GHES_MEM_CPER_LENGTH;
-
     /*
-     * Check whether it will run out of the preallocated memory if adding a new
-     * generic error data entry
+     * It should not run out of the preallocated memory if adding a new generic
+     * error data entry
      */
-    if ((data_length + ACPI_GHES_GESB_SIZE) > ACPI_GHES_MAX_RAW_DATA_LENGTH) {
-        error_report("Not enough memory to record new CPER!!!");
-        g_array_free(block, true);
-        return -1;
-    }
+    assert((data_length + ACPI_GHES_GESB_SIZE) <=
+            ACPI_GHES_MAX_RAW_DATA_LENGTH);
 
     /* Build the new generic error status block header */
     acpi_ghes_generic_error_status(block, ACPI_GEBS_UNCORRECTABLE,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:41:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:41:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15109.37874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFg6-0007KE-5b; Thu, 29 Oct 2020 21:41:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15109.37874; Thu, 29 Oct 2020 21:41:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFg6-0007K6-2h; Thu, 29 Oct 2020 21:41:50 +0000
Received: by outflank-mailman (input) for mailman id 15109;
 Thu, 29 Oct 2020 21:41:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFg5-0007Jx-2A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f2c09521-40e2-480f-a5d0-052f6e1964a5;
 Thu, 29 Oct 2020 21:41:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFg4-00005s-7C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFg4-0005YP-6T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFg5-0007Jx-2A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:49 +0000
X-Inumbo-ID: f2c09521-40e2-480f-a5d0-052f6e1964a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f2c09521-40e2-480f-a5d0-052f6e1964a5;
	Thu, 29 Oct 2020 21:41:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xA4lrgDZoYg2uJMRB2m18FMCWFSNtx2bOmmwirbH2dA=; b=ZGyJyH3xJpaBlE6NR0I21B11CF
	b9lmSTyeUNz582X+ONtb8QKmmEMsCyIkrpxWJgZVYUotNaCIHcbwuiTK+6viRxkaFH1w3baVixeqq
	tp1+wDOV4wg5oazquzzoJp/Gau22Ko3QC89E4PMwmnf1AliDCllT30KYgnmduDJVbTis=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFg4-00005s-7C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFg4-0005YP-6T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/misc/aspeed_sdmc: Fix incorrect memory size
Message-Id: <E1kYFg4-0005YP-6T@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:48 +0000

commit ca05a240d4fa2ce880c630058b635482d3d472f8
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/misc/aspeed_sdmc: Fix incorrect memory size
    
    The SDRAM Memory Controller has a 32-bit address bus, thus
    supports up to 4 GiB of DRAM. There is a signed to unsigned
    conversion error with the AST2600 maximum memory size:
    
      (uint64_t)(2048 << 20) = (uint64_t)(-2147483648)
                             = 0xffffffff40000000
                             = 16 EiB - 2 GiB
    
    Fix by using the IEC suffixes which are usually safer, and add
    an assertion check to verify the memory is valid. This would have
    caught this bug:
    
      $ qemu-system-arm -M ast2600-evb
      qemu-system-arm: hw/misc/aspeed_sdmc.c:258: aspeed_sdmc_realize: Assertion `asc->max_ram_size < 4 * GiB' failed.
      Aborted (core dumped)
    
    Fixes: 1550d72679 ("aspeed/sdmc: Add AST2600 support")
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/misc/aspeed_sdmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c
index 0737d8de81..855848b7d2 100644
--- a/hw/misc/aspeed_sdmc.c
+++ b/hw/misc/aspeed_sdmc.c
@@ -255,6 +255,7 @@ static void aspeed_sdmc_realize(DeviceState *dev, Error **errp)
     AspeedSDMCState *s = ASPEED_SDMC(dev);
     AspeedSDMCClass *asc = ASPEED_SDMC_GET_CLASS(s);
 
+    assert(asc->max_ram_size < 4 * GiB); /* 32-bit address bus */
     s->max_ram_size = asc->max_ram_size;
 
     memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_sdmc_ops, s,
@@ -341,7 +342,7 @@ static void aspeed_2400_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2400 SDRAM Memory Controller";
-    asc->max_ram_size = 512 << 20;
+    asc->max_ram_size = 512 * MiB;
     asc->compute_conf = aspeed_2400_sdmc_compute_conf;
     asc->write = aspeed_2400_sdmc_write;
     asc->valid_ram_sizes = aspeed_2400_ram_sizes;
@@ -408,7 +409,7 @@ static void aspeed_2500_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2500 SDRAM Memory Controller";
-    asc->max_ram_size = 1024 << 20;
+    asc->max_ram_size = 1 * GiB;
     asc->compute_conf = aspeed_2500_sdmc_compute_conf;
     asc->write = aspeed_2500_sdmc_write;
     asc->valid_ram_sizes = aspeed_2500_ram_sizes;
@@ -485,7 +486,7 @@ static void aspeed_2600_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2600 SDRAM Memory Controller";
-    asc->max_ram_size = 2048 << 20;
+    asc->max_ram_size = 2 * GiB;
     asc->compute_conf = aspeed_2600_sdmc_compute_conf;
     asc->write = aspeed_2600_sdmc_write;
     asc->valid_ram_sizes = aspeed_2600_ram_sizes;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15110.37877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgG-0007LW-7H; Thu, 29 Oct 2020 21:42:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15110.37877; Thu, 29 Oct 2020 21:42:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgG-0007LO-4C; Thu, 29 Oct 2020 21:42:00 +0000
Received: by outflank-mailman (input) for mailman id 15110;
 Thu, 29 Oct 2020 21:41:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFgF-0007LH-HE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c5cdc3b4-9e9f-4750-b095-fcb67ed9cc8b;
 Thu, 29 Oct 2020 21:41:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgE-000061-C5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgE-0005Yu-AN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFgF-0007LH-HE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:59 +0000
X-Inumbo-ID: c5cdc3b4-9e9f-4750-b095-fcb67ed9cc8b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c5cdc3b4-9e9f-4750-b095-fcb67ed9cc8b;
	Thu, 29 Oct 2020 21:41:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EM28nVqQil4eSHA0KBdo08pnIAut6C+r9uW5nAwPRbU=; b=puGJJdj+ZORQVs5i1aP0Ufzitn
	qpg4tVb8WWaXPD9Nua8Cf/po5q6jIZhvv8LMYFy/fPfABGy+3k69uww5kCvuoLWnaLRN6Tb/WTRkY
	TAtBumonLBkSppg41XZs0P+IfKVKjf4DiKqyjzIahtzduBPAjjh++jY9ACLQBTrmxIzM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgE-000061-C5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgE-0005Yu-AN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:41:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Always pass cacheattr in S1_ptw_translate
Message-Id: <E1kYFgE-0005Yu-AN@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:41:58 +0000

commit a6d6f37aed4b171d121cd4a9363fbb41e90dcb53
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    target/arm: Always pass cacheattr in S1_ptw_translate
    
    When we changed the interface of get_phys_addr_lpae to require
    the cacheattr parameter, this spot was missed.  The compiler is
    unable to detect the use of NULL vs the nonnull attribute here.
    
    Fixes: 7e98e21c098
    Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Tested-by: Jan Kiszka <jan.kiskza@siemens.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/helper.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index c69a2baf1d..8ef0fb478f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10204,21 +10204,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx,
         int s2prot;
         int ret;
         ARMCacheAttrs cacheattrs = {};
-        ARMCacheAttrs *pcacheattrs = NULL;
-
-        if (env->cp15.hcr_el2 & HCR_PTW) {
-            /*
-             * PTW means we must fault if this S1 walk touches S2 Device
-             * memory; otherwise we don't care about the attributes and can
-             * save the S2 translation the effort of computing them.
-             */
-            pcacheattrs = &cacheattrs;
-        }
 
         ret = get_phys_addr_lpae(env, addr, MMU_DATA_LOAD, ARMMMUIdx_Stage2,
                                  false,
                                  &s2pa, &txattrs, &s2prot, &s2size, fi,
-                                 pcacheattrs);
+                                 &cacheattrs);
         if (ret) {
             assert(fi->type != ARMFault_None);
             fi->s2addr = addr;
@@ -10226,8 +10216,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx,
             fi->s1ptw = true;
             return ~0;
         }
-        if (pcacheattrs && (pcacheattrs->attrs & 0xf0) == 0) {
-            /* Access was to Device memory: generate Permission fault */
+        if ((env->cp15.hcr_el2 & HCR_PTW) && (cacheattrs.attrs & 0xf0) == 0) {
+            /*
+             * PTW set and S1 walk touched S2 Device memory:
+             * generate Permission fault.
+             */
             fi->type = ARMFault_Permission;
             fi->s2addr = addr;
             fi->stage2 = true;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15111.37882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgQ-0007NV-97; Thu, 29 Oct 2020 21:42:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15111.37882; Thu, 29 Oct 2020 21:42:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgQ-0007NM-5n; Thu, 29 Oct 2020 21:42:10 +0000
Received: by outflank-mailman (input) for mailman id 15111;
 Thu, 29 Oct 2020 21:42:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFgP-0007NF-9S
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 41d7a8a4-a360-43fe-ac18-cbab75fbc961;
 Thu, 29 Oct 2020 21:42:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgO-00006p-GJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgO-0005Za-Eh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFgP-0007NF-9S
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:09 +0000
X-Inumbo-ID: 41d7a8a4-a360-43fe-ac18-cbab75fbc961
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 41d7a8a4-a360-43fe-ac18-cbab75fbc961;
	Thu, 29 Oct 2020 21:42:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v+ghyPJn4NIt2MG04PTovG7fPPwgWA29CrC+EpWxlOw=; b=UQJQvu2jpScKNYgpNLv5zhXREt
	/ESwgsJP/aFbqUlvbyK/Rh26+A1/w016xuHcUROQOueDJ0WeNjaJ8lwRVDhKanM4gVCNJEKQo9NFU
	r1Wo19e0lqzDyxHbRTQ4JGdmbFobSeSz+E2pGxXP/YiKyyrFXq44xd2oqYMK01tNkRmc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgO-00006p-GJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgO-0005Za-Eh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/system/arm/virt: Document 'mte' machine option
Message-Id: <E1kYFgO-0005Za-Eh@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:08 +0000

commit 222f45b75970452b864f80cc4c0d3eb8f4862f64
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    docs/system/arm/virt: Document 'mte' machine option
    
    Commit 6a0b7505f1fd6769c which added documentation of the virt board
    crossed in the post with commit 6f4e1405b91da0d0 which added a new
    'mte' machine option. Update the docs to include the new option.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 docs/system/arm/virt.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
index 6621ab7205..32dc5eb22e 100644
--- a/docs/system/arm/virt.rst
+++ b/docs/system/arm/virt.rst
@@ -79,6 +79,10 @@ virtualization
   Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
   Arm Virtualization Extensions. The default is ``off``.
 
+mte
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Memory Tagging Extensions. The default is ``off``.
+
 highmem
   Set ``on``/``off`` to enable/disable placing devices and RAM in physical
   address space above 32 bits. The default is ``on`` for machine types
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15112.37886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFga-0007P1-Bx; Thu, 29 Oct 2020 21:42:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15112.37886; Thu, 29 Oct 2020 21:42:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFga-0007Os-8d; Thu, 29 Oct 2020 21:42:20 +0000
Received: by outflank-mailman (input) for mailman id 15112;
 Thu, 29 Oct 2020 21:42:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFgZ-0007Ok-CX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a6f9e9f3-b803-4603-ba9c-0c6f29a74d09;
 Thu, 29 Oct 2020 21:42:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgY-00006y-Jy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgY-0005a7-JB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFgZ-0007Ok-CX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:19 +0000
X-Inumbo-ID: a6f9e9f3-b803-4603-ba9c-0c6f29a74d09
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a6f9e9f3-b803-4603-ba9c-0c6f29a74d09;
	Thu, 29 Oct 2020 21:42:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rBLep1JEc1GfllBf0a05KUj3mmus+/t006Ra4RMToUI=; b=BBBjFv0rYPguAMTwot9Og+lfZa
	D72LgtpXFhjogHpw6bfqFqMvId9+3Pvd9nfqHFvMFzC53yRF08CLq1VEF0GBbw0vf0/NOyBVD1DSL
	kdSrWJUTVbDAyLMGJuDmOANPAAv3ib5dz6TBLseOvyZnBJcQyXGeBYDw5CQ4HOs8Q5mo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgY-00006y-Jy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgY-0005a7-JB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
Message-Id: <E1kYFgY-0005a7-JB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:18 +0000

commit 24ac0d309ab379cd0347f198c2db5b2b48b02887
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
    
    When booting an EL3 cpu with -kernel, we set up EL3 and then
    drop down to EL2.  We need to enable access to v8.3-PAuth
    keys and instructions at EL3 before doing so.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-2-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index fef4072db1..c44fd3382d 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -736,6 +736,9 @@ static void do_cpu_reset(void *opaque)
                     } else {
                         env->pstate = PSTATE_MODE_EL1h;
                     }
+                    if (cpu_isar_feature(aa64_pauth, cpu)) {
+                        env->cp15.scr_el3 |= SCR_API | SCR_APK;
+                    }
                     /* AArch64 kernels never boot in secure mode */
                     assert(!info->secure_boot);
                     /* This hook is only supported for AArch32 currently:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15113.37890 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgk-0007QE-DG; Thu, 29 Oct 2020 21:42:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15113.37890; Thu, 29 Oct 2020 21:42:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgk-0007Q6-AK; Thu, 29 Oct 2020 21:42:30 +0000
Received: by outflank-mailman (input) for mailman id 15113;
 Thu, 29 Oct 2020 21:42:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFgj-0007Px-K7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 226ca799-94f0-45f9-8794-7e9180324238;
 Thu, 29 Oct 2020 21:42:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgi-000079-Oc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgi-0005ag-Ms
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFgj-0007Px-K7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:29 +0000
X-Inumbo-ID: 226ca799-94f0-45f9-8794-7e9180324238
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 226ca799-94f0-45f9-8794-7e9180324238;
	Thu, 29 Oct 2020 21:42:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RLcvonKdKOIPrk09hzxi68msUZJgtRn7ljTipDLdheo=; b=nH7lAylh5B1C9rnaRLIIjjrzfO
	7fHojFmEdA3CyPsA6GPI2cc/ZsdXaYPhOWMGdwq3x/hIdJtDSQKQg/eliMoHcvK+2NW5a/rwwgV3b
	YRCvcKNSyPN03kk3YBdw6Ll5nnkTepytwTIpGlXwVR8mIPZbBybLieqZzPoaDpnxzcAY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgi-000079-Oc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgi-0005ag-Ms
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/boot: Fix MTE for EL3 direct kernel boot
Message-Id: <E1kYFgi-0005ag-Ms@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:28 +0000

commit 7ad01d78a9f2e80d1be41226d98f34059f7fff90
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/arm/boot: Fix MTE for EL3 direct kernel boot
    
    When booting an EL3 cpu with -kernel, we set up EL3 and then
    drop down to EL2.  We need to enable access to v8.5-MemTag
    tag allocation at EL3 before doing so.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-3-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index c44fd3382d..3e9816af80 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -739,6 +739,9 @@ static void do_cpu_reset(void *opaque)
                     if (cpu_isar_feature(aa64_pauth, cpu)) {
                         env->cp15.scr_el3 |= SCR_API | SCR_APK;
                     }
+                    if (cpu_isar_feature(aa64_mte, cpu)) {
+                        env->cp15.scr_el3 |= SCR_ATA;
+                    }
                     /* AArch64 kernels never boot in secure mode */
                     assert(!info->secure_boot);
                     /* This hook is only supported for AArch32 currently:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15114.37894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgv-0007Rc-Eu; Thu, 29 Oct 2020 21:42:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15114.37894; Thu, 29 Oct 2020 21:42:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFgv-0007RU-Bt; Thu, 29 Oct 2020 21:42:41 +0000
Received: by outflank-mailman (input) for mailman id 15114;
 Thu, 29 Oct 2020 21:42:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFgt-0007RN-VB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 229b07d9-6d4f-42f7-8463-2503ce73420c;
 Thu, 29 Oct 2020 21:42:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgs-000090-SG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFgs-0005cn-RQ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFgt-0007RN-VB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:39 +0000
X-Inumbo-ID: 229b07d9-6d4f-42f7-8463-2503ce73420c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 229b07d9-6d4f-42f7-8463-2503ce73420c;
	Thu, 29 Oct 2020 21:42:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tMYoGn/Uk1PCOfsIoTbxZsNtJTlNpH+3K11v66CB/GY=; b=FqvroSDCW6j+I7QBi5TSwbjq0l
	msaxlX/MzOk7FvTUGaIE2lKqIW3QNxME9l0+TtHi1xPV8Zkqxo6ICPp1t04jyEgbT1+gKw1UUna9N
	NqMSg/CLHggN1pk64eN6FX205HRSQBVH2YcBAmbQz+IcJpwP/IXwjfSjc3dCJNv8o9t8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgs-000090-SG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFgs-0005cn-RQ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Improve IMPDEF algorithm for IRG
Message-Id: <E1kYFgs-0005cn-RQ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:38 +0000

commit d4f6dda182e19afa75706936805e18397cb95f07
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:11 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:11 2020 +0100

    target/arm: Improve IMPDEF algorithm for IRG
    
    When GCR_EL1.RRND==1, the choosing of the random value is IMPDEF,
    and the kernel is not expected to have set RGSR_EL1.  Force a
    non-zero value into SEED, so that we do not continually return
    the same tag.
    
    Reported-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-4-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/mte_helper.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c
index 5ea57d487a..104752041f 100644
--- a/target/arm/mte_helper.c
+++ b/target/arm/mte_helper.c
@@ -24,6 +24,8 @@
 #include "exec/ram_addr.h"
 #include "exec/cpu_ldst.h"
 #include "exec/helper-proto.h"
+#include "qapi/error.h"
+#include "qemu/guest-random.h"
 
 
 static int choose_nonexcluded_tag(int tag, int offset, uint16_t exclude)
@@ -211,16 +213,37 @@ static uint8_t *allocation_tag_mem(CPUARMState *env, int ptr_mmu_idx,
 
 uint64_t HELPER(irg)(CPUARMState *env, uint64_t rn, uint64_t rm)
 {
-    int rtag;
-
-    /*
-     * Our IMPDEF choice for GCR_EL1.RRND==1 is to behave as if
-     * GCR_EL1.RRND==0, always producing deterministic results.
-     */
     uint16_t exclude = extract32(rm | env->cp15.gcr_el1, 0, 16);
+    int rrnd = extract32(env->cp15.gcr_el1, 16, 1);
     int start = extract32(env->cp15.rgsr_el1, 0, 4);
     int seed = extract32(env->cp15.rgsr_el1, 8, 16);
-    int offset, i;
+    int offset, i, rtag;
+
+    /*
+     * Our IMPDEF choice for GCR_EL1.RRND==1 is to continue to use the
+     * deterministic algorithm.  Except that with RRND==1 the kernel is
+     * not required to have set RGSR_EL1.SEED != 0, which is required for
+     * the deterministic algorithm to function.  So we force a non-zero
+     * SEED for that case.
+     */
+    if (unlikely(seed == 0) && rrnd) {
+        do {
+            Error *err = NULL;
+            uint16_t two;
+
+            if (qemu_guest_getrandom(&two, sizeof(two), &err) < 0) {
+                /*
+                 * Failed, for unknown reasons in the crypto subsystem.
+                 * Best we can do is log the reason and use a constant seed.
+                 */
+                qemu_log_mask(LOG_UNIMP, "IRG: Crypto failure: %s\n",
+                              error_get_pretty(err));
+                error_free(err);
+                two = 1;
+            }
+            seed = two;
+        } while (seed == 0);
+    }
 
     /* RandomTag */
     for (i = offset = 0; i < 4; ++i) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:42:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:42:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15115.37898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFh4-0007Sm-GN; Thu, 29 Oct 2020 21:42:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15115.37898; Thu, 29 Oct 2020 21:42:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFh4-0007Se-DO; Thu, 29 Oct 2020 21:42:50 +0000
Received: by outflank-mailman (input) for mailman id 15115;
 Thu, 29 Oct 2020 21:42:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFh3-0007SW-Qm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 017fa9e1-c95b-4753-82bd-685cfdaf8a23;
 Thu, 29 Oct 2020 21:42:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFh3-000098-0r
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFh2-0005dK-VS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFh3-0007SW-Qm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:49 +0000
X-Inumbo-ID: 017fa9e1-c95b-4753-82bd-685cfdaf8a23
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 017fa9e1-c95b-4753-82bd-685cfdaf8a23;
	Thu, 29 Oct 2020 21:42:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qFDC5kV6ojIesOTgJ6SxZAUASPRqm6wviNLR4t2v7l8=; b=CEuOP7i9OciHuW1oT9t2BtntLO
	ftSctpr+UoF89uMrWgQ69i/CT5HdsjYGbiUCJS+I5XAkRq/BKf+YVpjentS+KPxMniV+kpONdWXHM
	jWn34PVVRKBqgVO4j2s4le6C4Tg2/2s7iDXAiJUS2cAaX2tzH8E16OT/4NbVPtTCTmgc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFh3-000098-0r
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFh2-0005dK-VS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200727' into staging
Message-Id: <E1kYFh2-0005dK-VS@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:48 +0000

commit 3461487523b897d324e8d91f3fd20ed55f849544
Merge: 0c4fa5bc1aa47d30a8def2dc8345284400d123f1 d4f6dda182e19afa75706936805e18397cb95f07
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 18:43:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 18:43:48 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200727' into staging
    
    target-arm queue:
     * ACPI: Assert that we don't run out of the preallocated memory
     * hw/misc/aspeed_sdmc: Fix incorrect memory size
     * target/arm: Always pass cacheattr in S1_ptw_translate
     * docs/system/arm/virt: Document 'mte' machine option
     * hw/arm/boot: Fix PAUTH, MTE for EL3 direct kernel boot
     * target/arm: Improve IMPDEF algorithm for IRG
    
    # gpg: Signature made Mon 27 Jul 2020 16:18:38 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200727:
      target/arm: Improve IMPDEF algorithm for IRG
      hw/arm/boot: Fix MTE for EL3 direct kernel boot
      hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
      docs/system/arm/virt: Document 'mte' machine option
      target/arm: Always pass cacheattr in S1_ptw_translate
      hw/misc/aspeed_sdmc: Fix incorrect memory size
      ACPI: Assert that we don't run out of the preallocated memory
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/system/arm/virt.rst |  4 ++++
 hw/acpi/ghes.c           | 12 ++++--------
 hw/arm/boot.c            |  6 ++++++
 hw/misc/aspeed_sdmc.c    |  7 ++++---
 target/arm/helper.c      | 19 ++++++-------------
 target/arm/mte_helper.c  | 37 ++++++++++++++++++++++++++++++-------
 6 files changed, 54 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15116.37902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhF-0007Vt-IA; Thu, 29 Oct 2020 21:43:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15116.37902; Thu, 29 Oct 2020 21:43:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhF-0007Vl-F5; Thu, 29 Oct 2020 21:43:01 +0000
Received: by outflank-mailman (input) for mailman id 15116;
 Thu, 29 Oct 2020 21:43:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFhE-0007Va-41
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b1039d80-d027-4144-9518-7b531bd8fc70;
 Thu, 29 Oct 2020 21:42:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhD-00009F-C5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhD-0005eC-BJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFhE-0007Va-41
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:00 +0000
X-Inumbo-ID: b1039d80-d027-4144-9518-7b531bd8fc70
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b1039d80-d027-4144-9518-7b531bd8fc70;
	Thu, 29 Oct 2020 21:42:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nAtClig2mstgoC2mAECO3hr5Z0X7BLq2KjYIbRfGN28=; b=2VoOa6n+ooQ4e682+OL7eA6jSb
	+c0I+x9OGZF7tWgZrG0ZZINRwoTIDGSV22cHh36jVzvXrP9k2uxj2FTm3gVfOQJjPpJXb4Wb7L77v
	0PkHA1q+D1ZZqGO8ATOhjagz3P5VA+hgkab2Q50JO7V94SS3gqRuJXQAIF4rQLrk3PuM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhD-00009F-C5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhD-0005eC-BJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:42:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] test-char: abort on serial test error
Message-Id: <E1kYFhD-0005eC-BJ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:42:59 +0000

commit 297641d43ccf18274e18da841f69bdb256a60ce1
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sun Jul 26 19:30:23 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Tue Jul 28 18:27:59 2020 +0400

    test-char: abort on serial test error
    
    We are having issues debugging and bisecting this issue that happen
    mostly on patchew. Let's make it abort where it failed to gather some
    new informations.
    
    Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index 614bdac2df..d35cc839bc 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -1200,7 +1200,7 @@ static void char_serial_test(void)
 
     /* test tty alias */
     qemu_opt_set(opts, "backend", "tty", &error_abort);
-    chr = qemu_chr_new_from_opts(opts, NULL, NULL);
+    chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
     g_assert_nonnull(chr);
     object_unparent(OBJECT(chr));
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15117.37906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhP-0007Xa-Jp; Thu, 29 Oct 2020 21:43:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15117.37906; Thu, 29 Oct 2020 21:43:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhP-0007XS-Go; Thu, 29 Oct 2020 21:43:11 +0000
Received: by outflank-mailman (input) for mailman id 15117;
 Thu, 29 Oct 2020 21:43:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFhO-0007XH-8w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3d4c9465-a0eb-4937-8a65-8dfa9f3ea0f1;
 Thu, 29 Oct 2020 21:43:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhN-0000AG-Fa
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhN-0005ex-Er
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFhO-0007XH-8w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:10 +0000
X-Inumbo-ID: 3d4c9465-a0eb-4937-8a65-8dfa9f3ea0f1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3d4c9465-a0eb-4937-8a65-8dfa9f3ea0f1;
	Thu, 29 Oct 2020 21:43:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UAJOuKsMFujXOegLYEqMT16HjdefFmTxbrV6cLl4rD0=; b=UwAM9TQPCKSc+rV+D5n3kSbRzh
	Fr8CxHua2T2V5DLm5n6jVjL01InqJTRHJ7JaE6nK4o6wau4gj0/RvyYa3tzRozJhHZtdMf7JhNndE
	CTrKWeXdUTc8wnVgSJfsEONGPrRsa5960NMn8MNQqSSKTtse7AZPf1GWT8wfSvYd5kHk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhN-0000AG-Fa
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhN-0005ex-Er
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] slirp: update to latest stable-4.2 branch
Message-Id: <E1kYFhN-0005ex-Er@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:43:09 +0000

commit 9c15f57891af7c2cb3baf2d66a1b1f3f87a665ba
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sun Jul 26 19:41:00 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Tue Jul 28 18:27:59 2020 +0400

    slirp: update to latest stable-4.2 branch
    
    Dr. David Alan Gilbert (1):
          ip_stripoptions use memmove
    
    Jindrich Novy (4):
          Fix possible infinite loops and use-after-free
          Use secure string copy to avoid overflow
          Be sure to initialize sockaddr structure
          Check lseek() for failure
    
    Marc-André Lureau (2):
          util: do not silently truncate
          Merge branch 'stable-4.2' into 'stable-4.2'
    
    Philippe Mathieu-Daudé (3):
          Fix win32 builds by using the SLIRP_PACKED definition
          Fix constness warnings
          Remove unnecessary break
    
    Ralf Haferkamp (2):
          Drop bogus IPv6 messages
          Fix MTU check
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 slirp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slirp b/slirp
index 2faae0f778..ce94eba204 160000
--- a/slirp
+++ b/slirp
@@ -1 +1 @@
-Subproject commit 2faae0f778f818fadc873308f983289df697eb93
+Subproject commit ce94eba2042d52a0ba3d9e252ebce86715e94275
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15118.37909 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhZ-0007Yq-LH; Thu, 29 Oct 2020 21:43:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15118.37909; Thu, 29 Oct 2020 21:43:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhZ-0007Yi-IN; Thu, 29 Oct 2020 21:43:21 +0000
Received: by outflank-mailman (input) for mailman id 15118;
 Thu, 29 Oct 2020 21:43:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFhY-0007Ya-AW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a2cad402-4f18-4d29-978e-16c3bfd38dec;
 Thu, 29 Oct 2020 21:43:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhX-0000AM-J4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhX-0005fT-IG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFhY-0007Ya-AW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:20 +0000
X-Inumbo-ID: a2cad402-4f18-4d29-978e-16c3bfd38dec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a2cad402-4f18-4d29-978e-16c3bfd38dec;
	Thu, 29 Oct 2020 21:43:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TdVi7JGaz3lu41JsBY0+IgxZAL8XRTbLG07Yvrq4WQ8=; b=aGqny4dIRhtt4xhFXNiSGX1zYh
	kLvTRmaB5IEZfSxRxICpkTfzt0O9tcXFOz0cwyq3cfLYxD6VADgW5J2ntaLg+EYxSZlapJkLmkuEY
	Ao3htG6wFy0PXzUPsEU0fduRLSvrA60lyCQ6CdLbNOpSWLAf/MQRwvMYZVTfnIeZTBfg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhX-0000AM-J4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhX-0005fT-IG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging
Message-Id: <E1kYFhX-0005fT-IG@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:43:19 +0000

commit b1753831b0e58587db4fdf8219237331269c00c3
Merge: 3461487523b897d324e8d91f3fd20ed55f849544 9c15f57891af7c2cb3baf2d66a1b1f3f87a665ba
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 19:44:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 19:44:03 2020 +0100

    Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging
    
    slirp: update to latest stable-4.2 branch
    
    # gpg: Signature made Tue 28 Jul 2020 15:30:09 BST
    # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
    # gpg:                issuer "marcandre.lureau@redhat.com"
    # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
    # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
    # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
    
    * remotes/elmarco/tags/slirp-pull-request:
      slirp: update to latest stable-4.2 branch
      test-char: abort on serial test error
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 slirp             | 2 +-
 tests/test-char.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15119.37914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhm-0007aR-N3; Thu, 29 Oct 2020 21:43:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15119.37914; Thu, 29 Oct 2020 21:43:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhm-0007aJ-K0; Thu, 29 Oct 2020 21:43:34 +0000
Received: by outflank-mailman (input) for mailman id 15119;
 Thu, 29 Oct 2020 21:43:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFhl-0007aC-3v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c840e227-c983-4f8e-9ba6-cb82497770b2;
 Thu, 29 Oct 2020 21:43:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhi-0000AT-1w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhi-0005hy-0N
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFhl-0007aC-3v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:33 +0000
X-Inumbo-ID: c840e227-c983-4f8e-9ba6-cb82497770b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c840e227-c983-4f8e-9ba6-cb82497770b2;
	Thu, 29 Oct 2020 21:43:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9ToujohKvD2faLB0jNaTXPEF+Eemc0dl3+ybud5vfyc=; b=WPFQXP2n1nZ9NfutOSDbhNIN6v
	zvsiO8y6BnEmyTHSx7cLEkh/6SZQ5zhN5ybucvnkq5CfNafgdmULaDB7PconIuen6VGrnl6Tk8GIq
	sTWTfel1uqaGsa8uCPWzyqOInY85YbdwijlieX8bOu+AJt/H8dqCfxfYOKWWoTD0r53A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhi-0000AT-1w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhi-0005hy-0N
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] nbd: Fix large trim/zero requests
Message-Id: <E1kYFhi-0005hy-0N@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:43:30 +0000

commit 890cbccb089db9e646cc1baea3be9dc060e3917b
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Wed Jul 22 16:22:31 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 08:49:29 2020 -0500

    nbd: Fix large trim/zero requests
    
    Although qemu as NBD client limits requests to <2G, the NBD protocol
    allows clients to send requests almost all the way up to 4G.  But
    because our block layer is not yet 64-bit clean, we accidentally wrap
    such requests into a negative size, and fail with EIO instead of
    performing the intended operation.
    
    The bug is visible in modern systems with something as simple as:
    
    $ qemu-img create -f qcow2 /tmp/image.img 5G
    $ sudo qemu-nbd --connect=/dev/nbd0 /tmp/image.img
    $ sudo blkdiscard /dev/nbd0
    
    or with user-space only:
    
    $ truncate --size=3G file
    $ qemu-nbd -f raw file
    $ nbdsh -u nbd://localhost:10809 -c 'h.trim(3*1024*1024*1024,0)'
    
    Although both blk_co_pdiscard and blk_pwrite_zeroes currently return 0
    on success, this is also a good time to fix our code to a more robust
    paradigm that treats all non-negative values as success.
    
    Alas, our iotests do not currently make it easy to add external
    dependencies on blkdiscard or nbdsh, so we have to rely on manual
    testing for now.
    
    This patch can be reverted when we later improve the overall block
    layer to be 64-bit clean, but for now, a minimal fix was deemed less
    risky prior to release.
    
    CC: qemu-stable@nongnu.org
    Fixes: 1f4d6d18ed
    Fixes: 1c6c4bb7f0
    Fixes: https://github.com/systemd/systemd/issues/16242
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200722212231.535072-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: rework success tests to use >=0]
---
 nbd/server.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 4752a6c8bc..c5d71cff10 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2378,8 +2378,17 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
         if (request->flags & NBD_CMD_FLAG_FAST_ZERO) {
             flags |= BDRV_REQ_NO_FALLBACK;
         }
-        ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
-                                request->len, flags);
+        ret = 0;
+        /* FIXME simplify this when blk_pwrite_zeroes switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
+                                    len, flags);
+            request->len -= len;
+            request->from += len;
+        }
         return nbd_send_generic_reply(client, request->handle, ret,
                                       "writing to file failed", errp);
 
@@ -2393,9 +2402,18 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
                                       "flush failed", errp);
 
     case NBD_CMD_TRIM:
-        ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
-                              request->len);
-        if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) {
+        ret = 0;
+        /* FIXME simplify this when blk_co_pdiscard switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
+                                  len);
+            request->len -= len;
+            request->from += len;
+        }
+        if (ret >= 0 && request->flags & NBD_CMD_FLAG_FUA) {
             ret = blk_co_flush(exp->blk);
         }
         return nbd_send_generic_reply(client, request->handle, ret,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15120.37918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhu-0007bj-QA; Thu, 29 Oct 2020 21:43:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15120.37918; Thu, 29 Oct 2020 21:43:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFhu-0007ba-Ml; Thu, 29 Oct 2020 21:43:42 +0000
Received: by outflank-mailman (input) for mailman id 15120;
 Thu, 29 Oct 2020 21:43:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFht-0007bR-5A
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8721afb7-cb88-4a05-8905-ba3974970720;
 Thu, 29 Oct 2020 21:43:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhs-0000Ae-5T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFhs-0005if-4f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFht-0007bR-5A
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:41 +0000
X-Inumbo-ID: 8721afb7-cb88-4a05-8905-ba3974970720
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8721afb7-cb88-4a05-8905-ba3974970720;
	Thu, 29 Oct 2020 21:43:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nx7FuKrrYQ7O+j4tt073jWcuB70YiLWHoP7bRv/Cx/A=; b=RvCbBHSw1/lGIhwDU5DbUj9HkD
	RjGDib5fGynWPKdfS8qUJ/W3ARrRSJHlOyCesiv81GpVOt26cCBOCOOp7U7+jk2WE5k11PBtcUUWO
	By9PNZmWUW7aVcfzmTfW4mrdEFwH2IAewSjzOy31ZT8VrQjKPsbgKGWEVHzjM+ytoPdA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhs-0000Ae-5T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFhs-0005if-4f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block: nbd: Fix convert qcow2 compressed to nbd
Message-Id: <E1kYFhs-0005if-4f@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:43:40 +0000

commit a2b333c01880f56056d50c238834d62e32001e54
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:43 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:19 2020 -0500

    block: nbd: Fix convert qcow2 compressed to nbd
    
    When converting to qcow2 compressed format, the last step is a special
    zero length compressed write, ending in a call to bdrv_co_truncate(). This
    call always fails for the nbd driver since it does not implement
    bdrv_co_truncate().
    
    For block devices, which have the same limits, the call succeeds since
    the file driver implements bdrv_co_truncate(). If the caller asked to
    truncate to the same or smaller size with exact=false, the truncate
    succeeds. Implement the same logic for nbd.
    
    Example failing without this change:
    
    In one shell start qemu-nbd:
    
    $ truncate -s 1g test.tar
    $ qemu-nbd --socket=/tmp/nbd.sock --persistent --format=raw --offset 1536 test.tar
    
    In another shell convert an image to qcow2 compressed via NBD:
    
    $ echo "disk data" > disk.raw
    $ truncate -s 1g disk.raw
    $ qemu-img convert -f raw -O qcow2 -c disk1.raw nbd+unix:///?socket=/tmp/nbd.sock; echo $?
    1
    
    qemu-img failed, but the conversion was successful:
    
    $ qemu-img info nbd+unix:///?socket=/tmp/nbd.sock
    image: nbd+unix://?socket=/tmp/nbd.sock
    file format: qcow2
    virtual size: 1 GiB (1073741824 bytes)
    ...
    
    $ qemu-img check nbd+unix:///?socket=/tmp/nbd.sock
    No errors were found on the image.
    1/16384 = 0.01% allocated, 100.00% fragmented, 100.00% compressed clusters
    Image end offset: 393216
    
    $ qemu-img compare disk.raw nbd+unix:///?socket=/tmp/nbd.sock
    Images are identical.
    
    Fixes: https://bugzilla.redhat.com/1860627
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-2-nsoffer@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: typo fixes]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c    | 30 ++++++++++++++++++++++++++++++
 qemu-io-cmds.c |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index 65a4f56924..8934bcb479 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1966,6 +1966,33 @@ static void nbd_close(BlockDriverState *bs)
     nbd_clear_bdrvstate(s);
 }
 
+/*
+ * NBD cannot truncate, but if the caller asks to truncate to the same size, or
+ * to a smaller size with exact=false, there is no reason to fail the
+ * operation.
+ *
+ * Preallocation mode is ignored since it does not seems useful to fail when
+ * we never change anything.
+ */
+static int coroutine_fn nbd_co_truncate(BlockDriverState *bs, int64_t offset,
+                                        bool exact, PreallocMode prealloc,
+                                        BdrvRequestFlags flags, Error **errp)
+{
+    BDRVNBDState *s = bs->opaque;
+
+    if (offset != s->info.size && exact) {
+        error_setg(errp, "Cannot resize NBD nodes");
+        return -ENOTSUP;
+    }
+
+    if (offset > s->info.size) {
+        error_setg(errp, "Cannot grow NBD nodes");
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 static int64_t nbd_getlength(BlockDriverState *bs)
 {
     BDRVNBDState *s = bs->opaque;
@@ -2045,6 +2072,7 @@ static BlockDriver bdrv_nbd = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
@@ -2072,6 +2100,7 @@ static BlockDriver bdrv_nbd_tcp = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
@@ -2099,6 +2128,7 @@ static BlockDriver bdrv_nbd_unix = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 851f07e8f8..baeae86d8c 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1715,7 +1715,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
      * exact=true.  It is better to err on the "emit more errors" side
      * than to be overly permissive.
      */
-    ret = blk_truncate(blk, offset, true, PREALLOC_MODE_OFF, 0, &local_err);
+    ret = blk_truncate(blk, offset, false, PREALLOC_MODE_OFF, 0, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
         return ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:43:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:43:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15121.37922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFi4-0007d4-Rd; Thu, 29 Oct 2020 21:43:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15121.37922; Thu, 29 Oct 2020 21:43:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFi4-0007cw-OK; Thu, 29 Oct 2020 21:43:52 +0000
Received: by outflank-mailman (input) for mailman id 15121;
 Thu, 29 Oct 2020 21:43:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFi3-0007cl-BM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 185b2be0-6af3-49d1-8768-7b0a0b84bd49;
 Thu, 29 Oct 2020 21:43:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFi2-0000At-8w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFi2-0005jH-8I
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFi3-0007cl-BM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:51 +0000
X-Inumbo-ID: 185b2be0-6af3-49d1-8768-7b0a0b84bd49
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 185b2be0-6af3-49d1-8768-7b0a0b84bd49;
	Thu, 29 Oct 2020 21:43:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EfeI8L8x9+FNc65cjlz/KnnCau7Kzg0ZX/np1/F+gYI=; b=6B86gDf/g2sbdgnFzmJJyIPHeR
	qLKoB7XbqEk1YNmNH8ndPM7Pjeh/X5kD2pnVMhPnZVKG/fxhoBihur3ynyj8YDO+LOvRgYhIpuuMa
	18X4DV0UezwZYIKJvX0ZZXvSPThrfEOb2mA6aHLaRXRwVNQbYL/OY67XHqW2bqjWNJ1c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFi2-0000At-8w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFi2-0005jH-8I
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:43:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Make qemu_nbd_popen() a contextmanager
Message-Id: <E1kYFi2-0005jH-8I@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:43:50 +0000

commit b7719bcad2e92bab5aae3166fa9011f127e6ee49
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:44 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Make qemu_nbd_popen() a contextmanager
    
    Instead of duplicating the code to wait until the server is ready and
    remember to terminate the server and wait for it, make it possible to
    use like this:
    
        with qemu_nbd_popen('-k', sock, image):
            # Access image via qemu-nbd socket...
    
    Only test 264 used this helper, but I had to modify the output since it
    did not consistently when starting and stopping qemu-nbd.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-3-nsoffer@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/264        | 76 ++++++++++++++++---------------------------
 tests/qemu-iotests/264.out    |  2 ++
 tests/qemu-iotests/iotests.py | 28 ++++++++++++++--
 3 files changed, 56 insertions(+), 50 deletions(-)

diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264
index 304a7443d7..666f164ed8 100755
--- a/tests/qemu-iotests/264
+++ b/tests/qemu-iotests/264
@@ -36,48 +36,32 @@ wait_step = 0.2
 
 qemu_img_create('-f', iotests.imgfmt, disk_a, str(size))
 qemu_img_create('-f', iotests.imgfmt, disk_b, str(size))
-srv = qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b)
 
-# Wait for NBD server availability
-t = 0
-ok = False
-while t < wait_limit:
-    ok = qemu_io_silent_check('-f', 'raw', '-c', 'read 0 512', nbd_uri)
-    if ok:
-        break
-    time.sleep(wait_step)
-    t += wait_step
+with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b):
+    vm = iotests.VM().add_drive(disk_a)
+    vm.launch()
+    vm.hmp_qemu_io('drive0', 'write 0 {}'.format(size))
+
+    vm.qmp_log('blockdev-add', filters=[iotests.filter_qmp_testfiles],
+               **{'node_name': 'backup0',
+                  'driver': 'raw',
+                  'file': {'driver': 'nbd',
+                           'server': {'type': 'unix', 'path': nbd_sock},
+                           'reconnect-delay': 10}})
+    vm.qmp_log('blockdev-backup', device='drive0', sync='full', target='backup0',
+               speed=(1 * 1024 * 1024))
+
+    # Wait for some progress
+    t = 0
+    while t < wait_limit:
+        jobs = vm.qmp('query-block-jobs')['return']
+        if jobs and jobs[0]['offset'] > 0:
+            break
+        time.sleep(wait_step)
+        t += wait_step
 
-assert ok
-
-vm = iotests.VM().add_drive(disk_a)
-vm.launch()
-vm.hmp_qemu_io('drive0', 'write 0 {}'.format(size))
-
-vm.qmp_log('blockdev-add', filters=[iotests.filter_qmp_testfiles],
-           **{'node_name': 'backup0',
-              'driver': 'raw',
-              'file': {'driver': 'nbd',
-                       'server': {'type': 'unix', 'path': nbd_sock},
-                       'reconnect-delay': 10}})
-vm.qmp_log('blockdev-backup', device='drive0', sync='full', target='backup0',
-           speed=(1 * 1024 * 1024))
-
-# Wait for some progress
-t = 0
-while t < wait_limit:
-    jobs = vm.qmp('query-block-jobs')['return']
     if jobs and jobs[0]['offset'] > 0:
-        break
-    time.sleep(wait_step)
-    t += wait_step
-
-if jobs and jobs[0]['offset'] > 0:
-    log('Backup job is started')
-
-log('Kill NBD server')
-srv.kill()
-srv.wait()
+        log('Backup job is started')
 
 jobs = vm.qmp('query-block-jobs')['return']
 if jobs and jobs[0]['offset'] < jobs[0]['len']:
@@ -88,12 +72,8 @@ vm.qmp_log('block-job-set-speed', device='drive0', speed=0)
 # Emulate server down time for 1 second
 time.sleep(1)
 
-log('Start NBD server')
-srv = qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b)
-
-e = vm.event_wait('BLOCK_JOB_COMPLETED')
-log('Backup completed: {}'.format(e['data']['offset']))
-
-vm.qmp_log('blockdev-del', node_name='backup0')
-srv.kill()
-vm.shutdown()
+with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b):
+    e = vm.event_wait('BLOCK_JOB_COMPLETED')
+    log('Backup completed: {}'.format(e['data']['offset']))
+    vm.qmp_log('blockdev-del', node_name='backup0')
+    vm.shutdown()
diff --git a/tests/qemu-iotests/264.out b/tests/qemu-iotests/264.out
index 3000944b09..c45b1e81ef 100644
--- a/tests/qemu-iotests/264.out
+++ b/tests/qemu-iotests/264.out
@@ -1,3 +1,4 @@
+Start NBD server
 {"execute": "blockdev-add", "arguments": {"driver": "raw", "file": {"driver": "nbd", "reconnect-delay": 10, "server": {"path": "TEST_DIR/PID-nbd-sock", "type": "unix"}}, "node-name": "backup0"}}
 {"return": {}}
 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "speed": 1048576, "sync": "full", "target": "backup0"}}
@@ -11,3 +12,4 @@ Start NBD server
 Backup completed: 5242880
 {"execute": "blockdev-del", "arguments": {"node-name": "backup0"}}
 {"return": {}}
+Kill NBD server
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 3590ed78a0..8f79668435 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -28,10 +28,13 @@ import signal
 import struct
 import subprocess
 import sys
+import time
 from typing import (Any, Callable, Dict, Iterable,
                     List, Optional, Sequence, Tuple, TypeVar)
 import unittest
 
+from contextlib import contextmanager
+
 # pylint: disable=import-error, wrong-import-position
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu import qtest
@@ -270,9 +273,30 @@ def qemu_nbd_early_pipe(*args):
 
     return subp.returncode, output if subp.returncode else ''
 
+@contextmanager
 def qemu_nbd_popen(*args):
-    '''Run qemu-nbd in daemon mode and return the parent's exit code'''
-    return subprocess.Popen(qemu_nbd_args + ['--persistent'] + list(args))
+    '''Context manager running qemu-nbd within the context'''
+    pid_file = file_path("pid")
+
+    cmd = list(qemu_nbd_args)
+    cmd.extend(('--persistent', '--pid-file', pid_file))
+    cmd.extend(args)
+
+    log('Start NBD server')
+    p = subprocess.Popen(cmd)
+    try:
+        while not os.path.exists(pid_file):
+            if p.poll() is not None:
+                raise RuntimeError(
+                    "qemu-nbd terminated with exit code {}: {}"
+                    .format(p.returncode, ' '.join(cmd)))
+
+            time.sleep(0.01)
+        yield
+    finally:
+        log('Kill NBD server')
+        p.kill()
+        p.wait()
 
 def compare_images(img1, img2, fmt1=imgfmt, fmt2=imgfmt):
     '''Return True if two image files are identical'''
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15122.37926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFiE-0007f2-Su; Thu, 29 Oct 2020 21:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15122.37926; Thu, 29 Oct 2020 21:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFiE-0007eu-Px; Thu, 29 Oct 2020 21:44:02 +0000
Received: by outflank-mailman (input) for mailman id 15122;
 Thu, 29 Oct 2020 21:44:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFiD-0007e7-Fz
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c504cb55-5854-40c6-bae6-c8cdab3647fe;
 Thu, 29 Oct 2020 21:44:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiC-0000Bf-DN
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiC-0005k1-Be
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFiD-0007e7-Fz
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:01 +0000
X-Inumbo-ID: c504cb55-5854-40c6-bae6-c8cdab3647fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c504cb55-5854-40c6-bae6-c8cdab3647fe;
	Thu, 29 Oct 2020 21:44:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t6eA5xKgatSaHc/n3BLhhU4EU2b4ugwPeSB8CJJsNiw=; b=UckMwHNeqTLVHzE0R3ldjmo9PU
	iZsJdtUWD7kH0YalaTHC7Sre3ePku2LakRlUfxOWB7TMnevJnQA/sXM/TKmzHHI7QGUnEhHyaXT51
	IORVJxJZqJg8uWt0XLnbE5vw+EP/6Gm5zSfJVhhx3JFzDYGFSN2Ul3K0Gp1/ayBPp+3s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiC-0000Bf-DN
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiC-0005k1-Be
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Add more qemu_img helpers
Message-Id: <E1kYFiC-0005k1-Be@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:00 +0000

commit 4b914b01cdb95fe5722cb70826db7f0a262e8d2a
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:45 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Add more qemu_img helpers
    
    Add 2 helpers for measuring and checking images:
    - qemu_img_measure()
    - qemu_img_check()
    
    Both use --output-json and parse the returned json to make easy to use
    in other tests. I'm going to use them in a new test, and I hope they
    will be useful in may other tests.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-4-nsoffer@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8f79668435..717b5b652c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -141,6 +141,12 @@ def qemu_img_create(*args):
 
     return qemu_img(*args)
 
+def qemu_img_measure(*args):
+    return json.loads(qemu_img_pipe("measure", "--output", "json", *args))
+
+def qemu_img_check(*args):
+    return json.loads(qemu_img_pipe("check", "--output", "json", *args))
+
 def qemu_img_verbose(*args):
     '''Run qemu-img without suppressing its output and return the exit code'''
     exitcode = subprocess.call(qemu_img_args + list(args))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15123.37930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFiO-0007q2-UW; Thu, 29 Oct 2020 21:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15123.37930; Thu, 29 Oct 2020 21:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFiO-0007pu-RY; Thu, 29 Oct 2020 21:44:12 +0000
Received: by outflank-mailman (input) for mailman id 15123;
 Thu, 29 Oct 2020 21:44:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFiN-0007oH-TO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6e1fe421-5173-4a42-86e1-b2c0bad48867;
 Thu, 29 Oct 2020 21:44:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiM-0000C6-Gp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiM-0005lR-G6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFiN-0007oH-TO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:11 +0000
X-Inumbo-ID: 6e1fe421-5173-4a42-86e1-b2c0bad48867
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6e1fe421-5173-4a42-86e1-b2c0bad48867;
	Thu, 29 Oct 2020 21:44:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vigQ/PdkuV7+bDHH9Jq8NCTBWaJ229TVYkZE7y4Hmaw=; b=4Qkqt85qcusVKGfDLa78Er6iIf
	m3v9dZxfoCURtweJbl3ftIBu8sP2F7PaVur9RCXi+VqX+ka3VUB/bqwVJfHDZRStyRKkvwBE8h4Ja
	flOku7RsRFub6pjySW8rogH5NFQgkNjFpMMwySK4Hwkxi6Q9Db/GqmjZ1Jn/PBUUWcIs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiM-0000C6-Gp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiM-0005lR-G6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests: Test convert to qcow2 compressed to NBD
Message-Id: <E1kYFiM-0005lR-G6@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:10 +0000

commit 03a970bb6ffe17a3ae77d54d4127330cf9a73587
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:46 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Test convert to qcow2 compressed to NBD
    
    Add test for "qemu-img convert -O qcow2 -c" to NBD target. The tests    
    create a OVA file and write compressed qcow2 disk content directly into
    the OVA file via qemu-nbd.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-5-nsoffer@redhat.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/302     | 127 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/302.out |  31 +++++++++++
 tests/qemu-iotests/group   |   1 +
 3 files changed, 159 insertions(+)

diff --git a/tests/qemu-iotests/302 b/tests/qemu-iotests/302
new file mode 100755
index 0000000000..a8506bda15
--- /dev/null
+++ b/tests/qemu-iotests/302
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+#
+# Tests converting qcow2 compressed to NBD
+#
+# Copyright (c) 2020 Nir Soffer <nirsof@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# owner=nirsof@gmail.com
+
+import io
+import tarfile
+
+import iotests
+
+from iotests import (
+    file_path,
+    qemu_img,
+    qemu_img_check,
+    qemu_img_create,
+    qemu_img_log,
+    qemu_img_measure,
+    qemu_io,
+    qemu_nbd_popen,
+)
+
+iotests.script_initialize(supported_fmts=["qcow2"])
+
+# Create source disk. Using qcow2 to enable strict comparing later, and
+# avoid issues with random filesystem on CI environment.
+src_disk = file_path("disk.qcow2")
+qemu_img_create("-f", iotests.imgfmt, src_disk, "1g")
+qemu_io("-f", iotests.imgfmt, "-c", "write 1m 64k", src_disk)
+
+# The use case is writing qcow2 image directly into an ova file, which
+# is a tar file with specific layout. This is tricky since we don't know the
+# size of the image before compressing, so we have to do:
+# 1. Add an ovf file.
+# 2. Find the offset of the next member data.
+# 3. Make room for image data, allocating for the worst case.
+# 4. Write compressed image data into the tar.
+# 5. Add a tar entry with the actual image size.
+# 6. Shrink the tar to the actual size, aligned to 512 bytes.
+
+tar_file = file_path("test.ova")
+
+with tarfile.open(tar_file, "w") as tar:
+
+    # 1. Add an ovf file.
+
+    ovf_data = b"<xml/>"
+    ovf = tarfile.TarInfo("vm.ovf")
+    ovf.size = len(ovf_data)
+    tar.addfile(ovf, io.BytesIO(ovf_data))
+
+    # 2. Find the offset of the next member data.
+
+    offset = tar.fileobj.tell() + 512
+
+    # 3. Make room for image data, allocating for the worst case.
+
+    measure = qemu_img_measure("-O", "qcow2", src_disk)
+    tar.fileobj.truncate(offset + measure["required"])
+
+    # 4. Write compressed image data into the tar.
+
+    nbd_sock = file_path("nbd-sock", base_dir=iotests.sock_dir)
+    nbd_uri = "nbd+unix:///exp?socket=" + nbd_sock
+
+    # Use raw format to allow creating qcow2 directly into tar file.
+    with qemu_nbd_popen(
+            "--socket", nbd_sock,
+            "--export-name", "exp",
+            "--format", "raw",
+            "--offset", str(offset),
+            tar_file):
+
+        iotests.log("=== Target image info ===")
+        qemu_img_log("info", nbd_uri)
+
+        qemu_img(
+            "convert",
+            "-f", iotests.imgfmt,
+            "-O", "qcow2",
+            "-c",
+            src_disk,
+            nbd_uri)
+
+        iotests.log("=== Converted image info ===")
+        qemu_img_log("info", nbd_uri)
+
+        iotests.log("=== Converted image check ===")
+        qemu_img_log("check", nbd_uri)
+
+        iotests.log("=== Comparing to source disk ===")
+        qemu_img_log("compare", src_disk, nbd_uri)
+
+        actual_size = qemu_img_check(nbd_uri)["image-end-offset"]
+
+    # 5. Add a tar entry with the actual image size.
+
+    disk = tarfile.TarInfo("disk")
+    disk.size = actual_size
+    tar.addfile(disk)
+
+    # 6. Shrink the tar to the actual size, aligned to 512 bytes.
+
+    tar_size = offset + (disk.size + 511) & ~511
+    tar.fileobj.seek(tar_size)
+    tar.fileobj.truncate(tar_size)
+
+with tarfile.open(tar_file) as tar:
+    members = [{"name": m.name, "size": m.size, "offset": m.offset_data}
+               for m in tar]
+    iotests.log("=== OVA file contents ===")
+    iotests.log(members)
diff --git a/tests/qemu-iotests/302.out b/tests/qemu-iotests/302.out
new file mode 100644
index 0000000000..e37d3a1030
--- /dev/null
+++ b/tests/qemu-iotests/302.out
@@ -0,0 +1,31 @@
+Start NBD server
+=== Target image info ===
+image: nbd+unix:///exp?socket=SOCK_DIR/PID-nbd-sock
+file format: raw
+virtual size: 448 KiB (458752 bytes)
+disk size: unavailable
+
+=== Converted image info ===
+image: nbd+unix:///exp?socket=SOCK_DIR/PID-nbd-sock
+file format: qcow2
+virtual size: 1 GiB (1073741824 bytes)
+disk size: unavailable
+cluster_size: 65536
+Format specific information:
+    compat: 1.1
+    compression type: zlib
+    lazy refcounts: false
+    refcount bits: 16
+    corrupt: false
+
+=== Converted image check ===
+No errors were found on the image.
+1/16384 = 0.01% allocated, 100.00% fragmented, 100.00% compressed clusters
+Image end offset: 393216
+
+=== Comparing to source disk ===
+Images are identical.
+
+Kill NBD server
+=== OVA file contents ===
+[{"name": "vm.ovf", "offset": 512, "size": 6}, {"name": "disk", "offset": 1536, "size": 393216}]
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 1d0252e1f0..1e1cb27bc8 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -308,3 +308,4 @@
 297 meta
 299 auto quick
 301 backing quick
+302 quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15125.37934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFib-0007rN-0e; Thu, 29 Oct 2020 21:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15125.37934; Thu, 29 Oct 2020 21:44:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFia-0007rF-T9; Thu, 29 Oct 2020 21:44:24 +0000
Received: by outflank-mailman (input) for mailman id 15125;
 Thu, 29 Oct 2020 21:44:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFiZ-0007qq-T8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b52d0d43-6faa-44db-a460-3fbd131c8f75;
 Thu, 29 Oct 2020 21:44:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiW-0000CE-KO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiW-0005mP-Jd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFiZ-0007qq-T8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:23 +0000
X-Inumbo-ID: b52d0d43-6faa-44db-a460-3fbd131c8f75
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b52d0d43-6faa-44db-a460-3fbd131c8f75;
	Thu, 29 Oct 2020 21:44:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4mkJXdmp3UI8OeTvM48n+j1SLcxSuM/4aIYmpW3rmWU=; b=oHoq3Im/Ag3giaSrCmXps5eemh
	/EjDaWZR1zxE9LobWm7o4Qysc4xrctzZU01m2feYTgXOTia2HqE01Nmpx/puGk3SJSp5LMgfL/qJN
	6U4AQEUSLCeivlImhXsHx1+zsQ9ia4sHl4GOWYEFMsM8poG2LoFraHCE3pc2YFWZS6Sg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiW-0000CE-KO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiW-0005mP-Jd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/nbd: split nbd_establish_connection out of nbd_client_connect
Message-Id: <E1kYFiW-0005mP-Jd@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:20 +0000

commit fa35591b9cb9a7fd0af2d8c2d8848abba30d3c69
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:47 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: split nbd_establish_connection out of nbd_client_connect
    
    We are going to implement non-blocking version of
    nbd_establish_connection, which for a while will be used only for
    nbd_reconnect_attempt, not for nbd_open, so we need to call it
    separately.
    
    Refactor nbd_reconnect_attempt in a way which makes next commit
    simpler.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727184751.15704-2-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c        | 60 ++++++++++++++++++++++++++++++++----------------------
 block/trace-events |  4 ++--
 2 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index 8934bcb479..3558c173e3 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -93,7 +93,10 @@ typedef struct BDRVNBDState {
     char *x_dirty_bitmap;
 } BDRVNBDState;
 
-static int nbd_client_connect(BlockDriverState *bs, Error **errp);
+static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
+                                                  Error **errp);
+static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
+                                Error **errp);
 
 static void nbd_clear_bdrvstate(BDRVNBDState *s)
 {
@@ -241,7 +244,9 @@ static bool nbd_client_connecting_wait(BDRVNBDState *s)
 
 static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
 {
+    int ret;
     Error *local_err = NULL;
+    QIOChannelSocket *sioc;
 
     if (!nbd_client_connecting(s)) {
         return;
@@ -280,19 +285,25 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
         s->ioc = NULL;
     }
 
-    s->connect_status = nbd_client_connect(s->bs, &local_err);
+    sioc = nbd_establish_connection(s->saddr, &local_err);
+    if (!sioc) {
+        ret = -ECONNREFUSED;
+        goto out;
+    }
+
+    ret = nbd_client_handshake(s->bs, sioc, &local_err);
+
+out:
+    s->connect_status = ret;
     error_free(s->connect_err);
     s->connect_err = NULL;
     error_propagate(&s->connect_err, local_err);
 
-    if (s->connect_status < 0) {
-        /* failed attempt */
-        return;
+    if (ret >= 0) {
+        /* successfully connected */
+        s->state = NBD_CLIENT_CONNECTED;
+        qemu_co_queue_restart_all(&s->free_sema);
     }
-
-    /* successfully connected */
-    s->state = NBD_CLIENT_CONNECTED;
-    qemu_co_queue_restart_all(&s->free_sema);
 }
 
 static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
@@ -1425,24 +1436,15 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
     return sioc;
 }
 
-static int nbd_client_connect(BlockDriverState *bs, Error **errp)
+/* nbd_client_handshake takes ownership on sioc. On failure it is unref'ed. */
+static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
+                                Error **errp)
 {
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
     AioContext *aio_context = bdrv_get_aio_context(bs);
     int ret;
 
-    /*
-     * establish TCP connection, return error if it fails
-     * TODO: Configurable retry-until-timeout behaviour.
-     */
-    QIOChannelSocket *sioc = nbd_establish_connection(s->saddr, errp);
-
-    if (!sioc) {
-        return -ECONNREFUSED;
-    }
-
-    /* NBD handshake */
-    trace_nbd_client_connect(s->export);
+    trace_nbd_client_handshake(s->export);
     qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
     qio_channel_attach_aio_context(QIO_CHANNEL(sioc), aio_context);
 
@@ -1489,7 +1491,7 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp)
         object_ref(OBJECT(s->ioc));
     }
 
-    trace_nbd_client_connect_success(s->export);
+    trace_nbd_client_handshake_success(s->export);
 
     return 0;
 
@@ -1894,6 +1896,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
 {
     int ret;
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
+    QIOChannelSocket *sioc;
 
     ret = nbd_process_options(bs, options, errp);
     if (ret < 0) {
@@ -1904,7 +1907,16 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
     qemu_co_mutex_init(&s->send_mutex);
     qemu_co_queue_init(&s->free_sema);
 
-    ret = nbd_client_connect(bs, errp);
+    /*
+     * establish TCP connection, return error if it fails
+     * TODO: Configurable retry-until-timeout behaviour.
+     */
+    sioc = nbd_establish_connection(s->saddr, errp);
+    if (!sioc) {
+        return -ECONNREFUSED;
+    }
+
+    ret = nbd_client_handshake(bs, sioc, errp);
     if (ret < 0) {
         nbd_clear_bdrvstate(s);
         return ret;
diff --git a/block/trace-events b/block/trace-events
index d3533ca896..9158335061 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -168,8 +168,8 @@ nbd_parse_blockstatus_compliance(const char *err) "ignoring extra data from non-
 nbd_structured_read_compliance(const char *type) "server sent non-compliant unaligned read %s chunk"
 nbd_read_reply_entry_fail(int ret, const char *err) "ret = %d, err: %s"
 nbd_co_request_fail(uint64_t from, uint32_t len, uint64_t handle, uint16_t flags, uint16_t type, const char *name, int ret, const char *err) "Request failed { .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 ", .flags = 0x%" PRIx16 ", .type = %" PRIu16 " (%s) } ret = %d, err: %s"
-nbd_client_connect(const char *export_name) "export '%s'"
-nbd_client_connect_success(const char *export_name) "export '%s'"
+nbd_client_handshake(const char *export_name) "export '%s'"
+nbd_client_handshake_success(const char *export_name) "export '%s'"
 
 # ssh.c
 ssh_restart_coroutine(void *co) "co=%p"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15126.37938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFij-0007se-3O; Thu, 29 Oct 2020 21:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15126.37938; Thu, 29 Oct 2020 21:44:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFij-0007sW-0V; Thu, 29 Oct 2020 21:44:33 +0000
Received: by outflank-mailman (input) for mailman id 15126;
 Thu, 29 Oct 2020 21:44:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFih-0007sO-OZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2154d772-6cad-49fb-a79e-cef935e3807f;
 Thu, 29 Oct 2020 21:44:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFig-0000CL-Ox
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFig-0005nJ-N9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFih-0007sO-OZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:31 +0000
X-Inumbo-ID: 2154d772-6cad-49fb-a79e-cef935e3807f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2154d772-6cad-49fb-a79e-cef935e3807f;
	Thu, 29 Oct 2020 21:44:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tapH1tBw91iFFQevXcTKird1c/lP2gPD83RGnXttLKk=; b=i+z8bUadYeQwu7Y014IbPBZwFg
	6NOlUlwKNAuJMthjwXxXvTkQLNTzo7YwqzrMvk1Y831UPRqaOTBI/F5BPywjvhZrXRv2jtn2Xh6tQ
	GB06DpTwFVZPqU9EfS8BOnNMEGRB7wD/pqwnrz3nwxbbXK7/p2mtN8hZcIhrbe9UQntM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFig-0000CL-Ox
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFig-0005nJ-N9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/nbd: allow drain during reconnect attempt
Message-Id: <E1kYFig-0005nJ-N9@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:30 +0000

commit dd1ec1a4afe190e030edfa052d95c9e6e065438c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:48 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: allow drain during reconnect attempt
    
    It should be safe to reenter qio_channel_yield() on io/channel read/write
    path, so it's safe to reduce in_flight and allow attaching new aio
    context. And no problem to allow drain itself: connection attempt is
    not a guest request. Moreover, if remote server is down, we can hang
    in negotiation, blocking drain section and provoking a dead lock.
    
    How to reproduce the dead lock:
    
    1. Create nbd-fault-injector.conf with the following contents:
    
    [inject-error "mega1"]
    event=data
    io=readwrite
    when=before
    
    2. In one terminal run nbd-fault-injector in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./nbd-fault-injector.py 127.0.0.1:10000 nbd-fault-injector.conf;
    done
    
    3. In another terminal run qemu-io in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./qemu-io -c 'read 0 512' nbd://127.0.0.1:10000;
    done
    
    After some time, qemu-io will hang trying to drain, for example, like
    this:
    
     #3 aio_poll (ctx=0x55f006bdd890, blocking=true) at
        util/aio-posix.c:600
     #4 bdrv_do_drained_begin (bs=0x55f006bea710, recursive=false,
        parent=0x0, ignore_bds_parents=false, poll=true) at block/io.c:427
     #5 bdrv_drained_begin (bs=0x55f006bea710) at block/io.c:433
     #6 blk_drain (blk=0x55f006befc80) at block/block-backend.c:1710
     #7 blk_unref (blk=0x55f006befc80) at block/block-backend.c:498
     #8 bdrv_open_inherit (filename=0x7fffba1563bc
        "nbd+tcp://127.0.0.1:10000", reference=0x0, options=0x55f006be86d0,
        flags=24578, parent=0x0, child_class=0x0, child_role=0,
        errp=0x7fffba154620) at block.c:3491
     #9 bdrv_open (filename=0x7fffba1563bc "nbd+tcp://127.0.0.1:10000",
        reference=0x0, options=0x0, flags=16386, errp=0x7fffba154620) at
        block.c:3513
     #10 blk_new_open (filename=0x7fffba1563bc "nbd+tcp://127.0.0.1:10000",
        reference=0x0, options=0x0, flags=16386, errp=0x7fffba154620) at
        block/block-backend.c:421
    
    And connection_co stack like this:
    
     #0 qemu_coroutine_switch (from_=0x55f006bf2650, to_=0x7fe96e07d918,
        action=COROUTINE_YIELD) at util/coroutine-ucontext.c:302
     #1 qemu_coroutine_yield () at util/qemu-coroutine.c:193
     #2 qio_channel_yield (ioc=0x55f006bb3c20, condition=G_IO_IN) at
        io/channel.c:472
     #3 qio_channel_readv_all_eof (ioc=0x55f006bb3c20, iov=0x7fe96d729bf0,
        niov=1, errp=0x7fe96d729eb0) at io/channel.c:110
     #4 qio_channel_readv_all (ioc=0x55f006bb3c20, iov=0x7fe96d729bf0,
        niov=1, errp=0x7fe96d729eb0) at io/channel.c:143
     #5 qio_channel_read_all (ioc=0x55f006bb3c20, buf=0x7fe96d729d28
        "\300.\366\004\360U", buflen=8, errp=0x7fe96d729eb0) at
        io/channel.c:247
     #6 nbd_read (ioc=0x55f006bb3c20, buffer=0x7fe96d729d28, size=8,
        desc=0x55f004f69644 "initial magic", errp=0x7fe96d729eb0) at
        /work/src/qemu/master/include/block/nbd.h:365
     #7 nbd_read64 (ioc=0x55f006bb3c20, val=0x7fe96d729d28,
        desc=0x55f004f69644 "initial magic", errp=0x7fe96d729eb0) at
        /work/src/qemu/master/include/block/nbd.h:391
     #8 nbd_start_negotiate (aio_context=0x55f006bdd890,
        ioc=0x55f006bb3c20, tlscreds=0x0, hostname=0x0,
        outioc=0x55f006bf19f8, structured_reply=true,
        zeroes=0x7fe96d729dca, errp=0x7fe96d729eb0) at nbd/client.c:904
     #9 nbd_receive_negotiate (aio_context=0x55f006bdd890,
        ioc=0x55f006bb3c20, tlscreds=0x0, hostname=0x0,
        outioc=0x55f006bf19f8, info=0x55f006bf1a00, errp=0x7fe96d729eb0) at
        nbd/client.c:1032
     #10 nbd_client_connect (bs=0x55f006bea710, errp=0x7fe96d729eb0) at
        block/nbd.c:1460
     #11 nbd_reconnect_attempt (s=0x55f006bf19f0) at block/nbd.c:287
     #12 nbd_co_reconnect_loop (s=0x55f006bf19f0) at block/nbd.c:309
     #13 nbd_connection_entry (opaque=0x55f006bf19f0) at block/nbd.c:360
     #14 coroutine_trampoline (i0=113190480, i1=22000) at
        util/coroutine-ucontext.c:173
    
    Note, that the hang may be
    triggered by another bug, so the whole case is fixed only together with
    commit "block/nbd: on shutdown terminate connection attempt".
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727184751.15704-3-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/block/nbd.c b/block/nbd.c
index 3558c173e3..ee9ab7512b 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -291,8 +291,22 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
         goto out;
     }
 
+    bdrv_dec_in_flight(s->bs);
+
     ret = nbd_client_handshake(s->bs, sioc, &local_err);
 
+    if (s->drained) {
+        s->wait_drained_end = true;
+        while (s->drained) {
+            /*
+             * We may be entered once from nbd_client_attach_aio_context_bh
+             * and then from nbd_client_co_drain_end. So here is a loop.
+             */
+            qemu_coroutine_yield();
+        }
+    }
+    bdrv_inc_in_flight(s->bs);
+
 out:
     s->connect_status = ret;
     error_free(s->connect_err);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15127.37942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFit-0007u2-5H; Thu, 29 Oct 2020 21:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15127.37942; Thu, 29 Oct 2020 21:44:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFit-0007tv-21; Thu, 29 Oct 2020 21:44:43 +0000
Received: by outflank-mailman (input) for mailman id 15127;
 Thu, 29 Oct 2020 21:44:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFir-0007tl-QK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c61db204-85de-44d3-852f-b447834aff87;
 Thu, 29 Oct 2020 21:44:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiq-0000CT-ST
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFiq-0005oJ-Rf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFir-0007tl-QK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:41 +0000
X-Inumbo-ID: c61db204-85de-44d3-852f-b447834aff87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c61db204-85de-44d3-852f-b447834aff87;
	Thu, 29 Oct 2020 21:44:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0kMblGfgS89mPCxzK85ahlZbIMXVToPatrFhmzktjOs=; b=HjtRcgTa+jYcVVRA4HF/mLTBq2
	/HqVAfYzsIbsNd3lQge+sXczp9DnR8YqQVPfQJVU1C6znMGonKcKq4CdcytfbsZMQXjnH8nm0B1a+
	9acQ63IkdZ3bDK/tQwcar/jACfE7fCCEjKbLhnNtzKAI+zOkNSOrxU1a0Yvid45Nu4Jg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiq-0000CT-ST
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFiq-0005oJ-Rf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/nbd: on shutdown terminate connection attempt
Message-Id: <E1kYFiq-0005oJ-Rf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:40 +0000

commit fbeb3e63b34a1af4a968031de1c82e5edf20bf6c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:49 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: on shutdown terminate connection attempt
    
    On shutdown nbd driver may be in a connecting state. We should shutdown
    it as well, otherwise we may hang in
    nbd_teardown_connection, waiting for conneciton_co to finish in
    BDRV_POLL_WHILE(bs, s->connection_co) loop if remote server is down.
    
    How to reproduce the dead lock:
    
    1. Create nbd-fault-injector.conf with the following contents:
    
    [inject-error "mega1"]
    event=data
    io=readwrite
    when=before
    
    2. In one terminal run nbd-fault-injector in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./nbd-fault-injector.py 127.0.0.1:10000 nbd-fault-injector.conf;
    done
    
    3. In another terminal run qemu-io in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./qemu-io -c 'read 0 512' nbd://127.0.0.1:10000;
    done
    
    After some time, qemu-io will hang. Note, that this hang may be
    triggered by another bug, so the whole case is fixed only together with
    commit "block/nbd: allow drain during reconnect attempt".
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727184751.15704-4-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index ee9ab7512b..620c97be6b 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -209,11 +209,15 @@ static void nbd_teardown_connection(BlockDriverState *bs)
 {
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
 
-    if (s->state == NBD_CLIENT_CONNECTED) {
+    if (s->ioc) {
         /* finish any pending coroutines */
-        assert(s->ioc);
         qio_channel_shutdown(s->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
+    } else if (s->sioc) {
+        /* abort negotiation */
+        qio_channel_shutdown(QIO_CHANNEL(s->sioc), QIO_CHANNEL_SHUTDOWN_BOTH,
+                             NULL);
     }
+
     s->state = NBD_CLIENT_QUIT;
     if (s->connection_co) {
         if (s->connection_co_sleep_ns_state) {
@@ -1459,6 +1463,9 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
     int ret;
 
     trace_nbd_client_handshake(s->export);
+
+    s->sioc = sioc;
+
     qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
     qio_channel_attach_aio_context(QIO_CHANNEL(sioc), aio_context);
 
@@ -1473,6 +1480,7 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
     g_free(s->info.name);
     if (ret < 0) {
         object_unref(OBJECT(sioc));
+        s->sioc = NULL;
         return ret;
     }
     if (s->x_dirty_bitmap && !s->info.base_allocation) {
@@ -1498,8 +1506,6 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
         }
     }
 
-    s->sioc = sioc;
-
     if (!s->ioc) {
         s->ioc = QIO_CHANNEL(sioc);
         object_ref(OBJECT(s->ioc));
@@ -1520,6 +1526,7 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
         nbd_send_request(s->ioc ?: QIO_CHANNEL(sioc), &request);
 
         object_unref(OBJECT(sioc));
+        s->sioc = NULL;
 
         return ret;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:44:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:44:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15128.37946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFj3-0007vK-6x; Thu, 29 Oct 2020 21:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15128.37946; Thu, 29 Oct 2020 21:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFj3-0007vC-3o; Thu, 29 Oct 2020 21:44:53 +0000
Received: by outflank-mailman (input) for mailman id 15128;
 Thu, 29 Oct 2020 21:44:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFj1-0007v3-QK
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2dbcc75f-390d-4152-8ba1-e71011d47b11;
 Thu, 29 Oct 2020 21:44:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFj1-0000Ca-0E
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFj0-0005pP-VE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFj1-0007v3-QK
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:51 +0000
X-Inumbo-ID: 2dbcc75f-390d-4152-8ba1-e71011d47b11
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2dbcc75f-390d-4152-8ba1-e71011d47b11;
	Thu, 29 Oct 2020 21:44:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BJCtIKYN/JWbMJavU/DiMyB9PXpqY+jpoUVWSB+jf6A=; b=Vaox/oP5xFJO4TmXfQwXjm1MSz
	kxcmRumavguIAouW4PMCKuUFzhnBy1zkzdLFk0cxqiw9Xt60dq2tnYcc0qbb1gYvlyPFrHgrmw9YW
	h81XkzqiVkWEN4n10JdFyVRw4rTW/Rc7ajNvt5zlGIpRU5P+v9a2uwqPBBfH8ss70Ib4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFj1-0000Ca-0E
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFj0-0005pP-VE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:44:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
Message-Id: <E1kYFj0-0005pP-VE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:44:50 +0000

commit 12c75e20a269ac917f4a76936d7142264e522233
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:50 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
    
    We try to go to wakeable sleep, so that, if drain begins it will break
    the sleep. But what if nbd_client_co_drain_begin() already called and
    s->drained is already true? We'll go to sleep, and drain will have to
    wait for the whole timeout. Let's improve it.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727184751.15704-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index 620c97be6b..7bb881fef4 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -341,8 +341,6 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
             qemu_co_queue_restart_all(&s->free_sema);
         }
 
-        qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
-                                  &s->connection_co_sleep_ns_state);
         if (s->drained) {
             bdrv_dec_in_flight(s->bs);
             s->wait_drained_end = true;
@@ -354,9 +352,12 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
                 qemu_coroutine_yield();
             }
             bdrv_inc_in_flight(s->bs);
-        }
-        if (timeout < max_timeout) {
-            timeout *= 2;
+        } else {
+            qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
+                                      &s->connection_co_sleep_ns_state);
+            if (timeout < max_timeout) {
+                timeout *= 2;
+            }
         }
 
         nbd_reconnect_attempt(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15129.37949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjD-0007ww-89; Thu, 29 Oct 2020 21:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15129.37949; Thu, 29 Oct 2020 21:45:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjD-0007wo-5E; Thu, 29 Oct 2020 21:45:03 +0000
Received: by outflank-mailman (input) for mailman id 15129;
 Thu, 29 Oct 2020 21:45:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFjB-0007wF-UO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 71636590-8541-4f9e-9a3d-13ddf71a3c9e;
 Thu, 29 Oct 2020 21:45:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjB-0000DL-41
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjB-0005qV-3D
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFjB-0007wF-UO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
X-Inumbo-ID: 71636590-8541-4f9e-9a3d-13ddf71a3c9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 71636590-8541-4f9e-9a3d-13ddf71a3c9e;
	Thu, 29 Oct 2020 21:45:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tiGWnHTAkd8P0BTYrEyUxGbDAe7Lb7I/ECD0QPsIlgg=; b=erNL43sah6ZpBdZh89OqfLHDTK
	RWquy6X4VCB5WtqWNl72tAoaJAAbVnk5rE5SdYQMAEOXhow4W2OVainA0/9trX0diiSrpWLLz+Zm3
	VUXAQsvjht/U4ZslYaI18rxNtQOng6ExBBd4xYJri0/NjJDa2f36AgfrVxrPtZYfFE9k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjB-0000DL-41
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjB-0005qV-3D
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-28' into staging
Message-Id: <E1kYFjB-0005qV-3D@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:01 +0000

commit 5045be872db97be2aecc694bf43762e75e7e5395
Merge: b1753831b0e58587db4fdf8219237331269c00c3 12c75e20a269ac917f4a76936d7142264e522233
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 20:43:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 20:43:03 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-28' into staging
    
    nbd patches for 2020-07-28
    
    - fix NBD handling of trim/zero requests larger than 2G
    - allow no-op resizes on NBD (in turn fixing qemu-img convert -c into NBD)
    - several deadlock fixes when using NBD reconnect
    
    # gpg: Signature made Tue 28 Jul 2020 15:59:42 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-nbd-2020-07-28:
      block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
      block/nbd: on shutdown terminate connection attempt
      block/nbd: allow drain during reconnect attempt
      block/nbd: split nbd_establish_connection out of nbd_client_connect
      iotests: Test convert to qcow2 compressed to NBD
      iotests: Add more qemu_img helpers
      iotests: Make qemu_nbd_popen() a contextmanager
      block: nbd: Fix convert qcow2 compressed to nbd
      nbd: Fix large trim/zero requests
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/nbd.c                   | 126 ++++++++++++++++++++++++++++++-----------
 block/trace-events            |   4 +-
 nbd/server.c                  |  28 ++++++++--
 qemu-io-cmds.c                |   2 +-
 tests/qemu-iotests/264        |  76 ++++++++++---------------
 tests/qemu-iotests/264.out    |   2 +
 tests/qemu-iotests/302        | 127 ++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/302.out    |  31 +++++++++++
 tests/qemu-iotests/group      |   1 +
 tests/qemu-iotests/iotests.py |  34 ++++++++++-
 10 files changed, 342 insertions(+), 89 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15130.37954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjN-0007yI-9r; Thu, 29 Oct 2020 21:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15130.37954; Thu, 29 Oct 2020 21:45:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjN-0007yA-6t; Thu, 29 Oct 2020 21:45:13 +0000
Received: by outflank-mailman (input) for mailman id 15130;
 Thu, 29 Oct 2020 21:45:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFjL-0007y1-Tx
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 263e2e50-ff00-44dd-9883-298f9f7ccdf3;
 Thu, 29 Oct 2020 21:45:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjL-0000Dv-7t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjL-0005rp-6h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFjL-0007y1-Tx
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
X-Inumbo-ID: 263e2e50-ff00-44dd-9883-298f9f7ccdf3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 263e2e50-ff00-44dd-9883-298f9f7ccdf3;
	Thu, 29 Oct 2020 21:45:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1M02QWiXxuISER3FQgO57xOCqN6wi/4i/LbgUvywkpA=; b=q2r00oL0+sa1bF+SRabKVzNkLj
	2OssT3HhUhYWzN8M/ZajUI+q5BPWCaqrE23XaaH3ElOhIxJa1fvSnKYwiEtyTgm2NOqt23xmZxxUu
	6YTOLrtgmN+ozaEW4IAE1zRTsV4i66o+3S93h+/Mn5muiY7qd1YjyOhB1wIxKKxF2veM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjL-0000Dv-7t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjL-0005rp-6h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update version for v5.1.0-rc2 release
Message-Id: <E1kYFjL-0005rp-6h@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:11 +0000

commit 5772f2b1fc5d00e7e04e01fa28e9081d6550440a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 21:51:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 21:51:03 2020 +0100

    Update version for v5.1.0-rc2 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 023d5c9cfb..388c02aef2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.91
+5.0.92
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15131.37958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjY-0007zf-BN; Thu, 29 Oct 2020 21:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15131.37958; Thu, 29 Oct 2020 21:45:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFjY-0007zX-8M; Thu, 29 Oct 2020 21:45:24 +0000
Received: by outflank-mailman (input) for mailman id 15131;
 Thu, 29 Oct 2020 21:45:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFjW-0007zO-KD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d4ae338e-cc13-43e5-8ad5-9a06f9278691;
 Thu, 29 Oct 2020 21:45:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjV-0000E8-IS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjV-0005t6-Hc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFjW-0007zO-KD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:22 +0000
X-Inumbo-ID: d4ae338e-cc13-43e5-8ad5-9a06f9278691
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d4ae338e-cc13-43e5-8ad5-9a06f9278691;
	Thu, 29 Oct 2020 21:45:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=83EhoWmrJD9VqwDTNPw+/mZ9rrK1RCn1IVijBcL1vJM=; b=VRgC683T47VxxYAdbkSQmkhimT
	RxTEsvAgXM0XDH8/5CKyXjPfHkrOFnwI4xpA74ksCbmW+26gX0YyWjjM31lxNREw2VaWRPpFAgot+
	PCL/KrVdR1jlUlNK4wue3o4ZPrrSAmDHxyUx8TEXF+wwh5qhh/cYDZSCeZ7rr1e1JqkY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjV-0000E8-IS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjV-0005t6-Hc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] trace/simple: Allow enabling simple traces from command line
Message-Id: <E1kYFjV-0005t6-Hc@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:21 +0000

commit 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4
Author:     Josh DuBois <duboisj@gmail.com>
AuthorDate: Thu Jul 23 00:33:59 2020 -0500
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Wed Jul 29 16:39:56 2020 +0100

    trace/simple: Allow enabling simple traces from command line
    
    The simple trace backend is enabled / disabled with a call
    to st_set_trace_file_enabled().  When initializing tracing
    from the command-line, this must be enabled on startup.
    (Prior to db25d56c014aa1a9, command-line initialization of
    simple trace worked because every call to st_set_trace_file
    enabled tracing.)
    
    Fixes: db25d56c014aa1a96319c663e0a60346a223b31e
    Signed-off-by: Josh DuBois <josh@joshdubois.com>
    Message-id: 20200723053359.256928-1-josh@joshdubois.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 trace/control.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/trace/control.c b/trace/control.c
index 2ffe000818..6558b5c906 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -225,6 +225,7 @@ void trace_init_file(const char *file)
 {
 #ifdef CONFIG_TRACE_SIMPLE
     st_set_trace_file(file);
+    st_set_trace_file_enabled(true);
 #elif defined CONFIG_TRACE_LOG
     /*
      * If both the simple and the log backends are enabled, "--trace file"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15132.37961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFji-00080v-Cs; Thu, 29 Oct 2020 21:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15132.37961; Thu, 29 Oct 2020 21:45:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFji-00080o-9v; Thu, 29 Oct 2020 21:45:34 +0000
Received: by outflank-mailman (input) for mailman id 15132;
 Thu, 29 Oct 2020 21:45:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFjg-00080b-FC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id dab1e072-0f38-4c80-b60e-97d4ff60bb47;
 Thu, 29 Oct 2020 21:45:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjf-0000EI-MM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjf-0005u8-LD
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFjg-00080b-FC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:32 +0000
X-Inumbo-ID: dab1e072-0f38-4c80-b60e-97d4ff60bb47
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id dab1e072-0f38-4c80-b60e-97d4ff60bb47;
	Thu, 29 Oct 2020 21:45:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N8DZ0oJjbWP+psTj1uwFSO0lERc/RjdT/RVfx411YS4=; b=W1V+/vfQ7MUj4gAOsWv16mnEx1
	xQ7X9RI34SDwT1lscoUf6zHI5Yh+UZgGG0jGaSKBievLvAjaxNZVsU01grvRYsXecBFyYK4AgTpIE
	3sj8YKO0qfWxAHcsSq84+zOqASE9Pxnwj2+H4S/5Cu41owzLDzSwz+Rs6NMTtv+iyGJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjf-0000EI-MM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjf-0005u8-LD
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tracetool: carefully define SDT_USE_VARIADIC
Message-Id: <E1kYFjf-0005u8-LD@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:31 +0000

commit 000822441e34916991f7c03217dc24f38be49e50
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Wed Jul 29 16:39:26 2020 +0100
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Thu Jul 30 16:02:38 2020 +0100

    tracetool: carefully define SDT_USE_VARIADIC
    
    The dtrace backend defines SDT_USE_VARIADIC as a workaround for a
    conflict with a LTTng UST header file, which requires SDT_USE_VARIADIC
    to be defined.
    
    LTTng UST <lttng/tracepoint.h> breaks if included after generated dtrace
    headers because SDT_USE_VARIADIC will already be defined:
    
      #ifdef LTTNG_UST_HAVE_SDT_INTEGRATION
      #define SDT_USE_VARIADIC <-- error, it's already defined
      #include <sys/sdt.h>
    
    Be more careful when defining SDT_USE_VARIADIC. This fixes the build
    when both the dtrace and ust tracers are enabled at the same time.
    
    Fixes: 27e08bab94f7c6ebe0b75938c98c394c969e3fd8 ("tracetool: work around ust <sys/sdt.h> include conflict")
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 20200729153926.127083-1-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool/backend/dtrace.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index b7fe4c1b50..fc0c8fc52f 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -44,11 +44,15 @@ def generate_h_begin(events, group):
     # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h>
     # first without defining SDT_USE_VARIADIC then ust breaks because the
     # STAP_PROBEV() macro is not defined.
+    out('#ifndef SDT_USE_VARIADIC')
     out('#define SDT_USE_VARIADIC 1')
+    out('#endif')
 
     out('#include "%s"' % header,
         '')
 
+    out('#undef SDT_USE_VARIADIC')
+
     # SystemTap defines <provider>_<name>_ENABLED() but other DTrace
     # implementations might not.
     for e in events:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15133.37965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFju-00082O-Fd; Thu, 29 Oct 2020 21:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15133.37965; Thu, 29 Oct 2020 21:45:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFju-00082H-Cp; Thu, 29 Oct 2020 21:45:46 +0000
Received: by outflank-mailman (input) for mailman id 15133;
 Thu, 29 Oct 2020 21:45:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFjs-000829-NJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7eee9bc1-80d8-4dd1-b4a8-f80d374fd16b;
 Thu, 29 Oct 2020 21:45:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjp-0000EP-Qd
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFjp-0005vB-P2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFjs-000829-NJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:44 +0000
X-Inumbo-ID: 7eee9bc1-80d8-4dd1-b4a8-f80d374fd16b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7eee9bc1-80d8-4dd1-b4a8-f80d374fd16b;
	Thu, 29 Oct 2020 21:45:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uo/sN5Vlr+mYI06ipwe8Z70IwyM9ioe80CoA8pVPk7w=; b=GCVmG1RwI4BvfSp6hBwQhsTTkM
	141junNPEPved/JqqSWszh0v+OJ6yI8xoaYGiX6yAn3cI74r27m3L3yLoJ5IRFfZUW1yA12QKXClP
	bQP/dqaT6rCr5eOI62f3lvnRBWRwMDl0T8kSoW7DdX0u0pbHSn72YJcTAV+Wm8u1phMo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjp-0000EP-Qd
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFjp-0005vB-P2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Message-Id: <E1kYFjp-0005vB-P2@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:41 +0000

commit 1448629751871c4924c234c2faaa968fc26890e1
Merge: 5772f2b1fc5d00e7e04e01fa28e9081d6550440a 000822441e34916991f7c03217dc24f38be49e50
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 30 20:02:26 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 30 20:02:26 2020 +0100

    Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
    
    Pull request
    
    A build fix and a 'simple' trace backend regression fix.
    
    # gpg: Signature made Thu 30 Jul 2020 19:13:10 BST
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
    
    * remotes/stefanha/tags/tracing-pull-request:
      tracetool: carefully define SDT_USE_VARIADIC
      trace/simple: Allow enabling simple traces from command line
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/tracetool/backend/dtrace.py | 4 ++++
 trace/control.c                     | 1 +
 2 files changed, 5 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:45:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15134.37971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFk2-00083Z-I3; Thu, 29 Oct 2020 21:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15134.37971; Thu, 29 Oct 2020 21:45:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFk2-00083R-EV; Thu, 29 Oct 2020 21:45:54 +0000
Received: by outflank-mailman (input) for mailman id 15134;
 Thu, 29 Oct 2020 21:45:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFk1-00083G-0T
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b16131af-47cc-4c98-b1bb-da1c3b30da05;
 Thu, 29 Oct 2020 21:45:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFk0-0000EZ-6Z
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFk0-0005wH-4q
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFk1-00083G-0T
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:53 +0000
X-Inumbo-ID: b16131af-47cc-4c98-b1bb-da1c3b30da05
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b16131af-47cc-4c98-b1bb-da1c3b30da05;
	Thu, 29 Oct 2020 21:45:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OjEr3YlFIzOUYCxahzf2ilqbTtIroW+K8x3NpDlMQMs=; b=qKZviEfNi+MRLznevLE7ffhaPZ
	8qAYVZDaLbvu1d/HZ4SLlKRHeNyZQgYARe6uxT0JaZcd1fDyUjNhbBxZI04PYjfYrdum4CXwG9mm+
	c4wClfPufeQQpnRUOjcoyl0McLnYmOHqCCHMBiT/mQwsRshfkxE+5zkaURnOaIPxtxEQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFk0-0000EZ-6Z
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFk0-0005wH-4q
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:45:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
Message-Id: <E1kYFk0-0005wH-4q@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:45:52 +0000

commit 148d25e0f6ad1dc3bd6aace092d65262d4217ec6
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Thu Jul 30 15:01:56 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Thu Jul 30 16:53:34 2020 +0200

    s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
    
    As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1)
    reads one past of the end of ms->loadparm, so g_memdup() can not be used
    here.
    
    Let's use g_strndup instead!
    
    Fixes: d6645483285f ("s390x/s390-virtio-ccw: fix loadparm property getter")
    Fixes: Coverity CID 1431058
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200730130156.35063-1-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 403d30e13b..e72c61d2ea 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -701,12 +701,9 @@ bool hpage_1m_allowed(void)
 static char *machine_get_loadparm(Object *obj, Error **errp)
 {
     S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
-    char *loadparm_str;
 
     /* make a NUL-terminated string */
-    loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
-    loadparm_str[sizeof(ms->loadparm)] = 0;
-    return loadparm_str;
+    return g_strndup((char *) ms->loadparm, sizeof(ms->loadparm));
 }
 
 static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15135.37975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkB-00085Y-JX; Thu, 29 Oct 2020 21:46:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15135.37975; Thu, 29 Oct 2020 21:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkB-00085N-G4; Thu, 29 Oct 2020 21:46:03 +0000
Received: by outflank-mailman (input) for mailman id 15135;
 Thu, 29 Oct 2020 21:46:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFkB-00085H-1c
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 103f8d46-a85d-4f64-b486-6897a9d9f6b2;
 Thu, 29 Oct 2020 21:46:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkA-0000FK-9x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkA-0005x0-9F
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFkB-00085H-1c
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:03 +0000
X-Inumbo-ID: 103f8d46-a85d-4f64-b486-6897a9d9f6b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 103f8d46-a85d-4f64-b486-6897a9d9f6b2;
	Thu, 29 Oct 2020 21:46:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+nZrwPMlgiHtP4bW9W2FFc2G8LYwD6v62qp/QW/j0bQ=; b=cIw/do6GtdPvJ25lFraghc3MmA
	qY91Osg2SGPFXLlRHoRZRuXweGiFt4kBBsYDzzHWYs5RX1m+iLfpkOVJDCWdF+zIKmxSoPernatew
	iy6w+rYWiCxd+Ivy+icK3gM+1MIJEgRt00Wt5HCnLOjKSk2+XJRkup6vK96/inLWRWPo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkA-0000FK-9x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkA-0005x0-9F
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200731' into staging
Message-Id: <E1kYFkA-0005x0-9F@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:02 +0000

commit d74824cf7c8b352f9045e949dc636c7207a41eee
Merge: 1448629751871c4924c234c2faaa968fc26890e1 148d25e0f6ad1dc3bd6aace092d65262d4217ec6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 31 10:28:12 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 31 10:28:13 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200731' into staging
    
    Fix a problem introduced in a recent fix.
    
    # gpg: Signature made Fri 31 Jul 2020 09:50:28 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200731:
      s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/s390x/s390-virtio-ccw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15136.37977 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkM-00086u-Kg; Thu, 29 Oct 2020 21:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15136.37977; Thu, 29 Oct 2020 21:46:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkM-00086m-Hm; Thu, 29 Oct 2020 21:46:14 +0000
Received: by outflank-mailman (input) for mailman id 15136;
 Thu, 29 Oct 2020 21:46:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFkL-00086e-LS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 895093c1-9ca7-4f02-9568-3dff5d19051e;
 Thu, 29 Oct 2020 21:46:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkK-0000FT-Ki
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkK-0005xp-Jo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFkL-00086e-LS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:13 +0000
X-Inumbo-ID: 895093c1-9ca7-4f02-9568-3dff5d19051e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 895093c1-9ca7-4f02-9568-3dff5d19051e;
	Thu, 29 Oct 2020 21:46:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lbdR3/eOgKowxxRr/i7xDI5pLyp6JVNez1GhOncPDes=; b=a9ekfDZhKUgqMTQ2WRXHU6pwuw
	I9nJN/2+OkL+ZYmp0FIuKjr8AorGwEh9r21sqPA2LjLu2MB2+BsBBhYUzYe43wlWNdr2+z2oTgMtr
	HB+ZZQpGkxdZaVRnURC7Ol6Q0mYgWAf40UNvV/oQpf7J/j4UPdGthYTi7fJ/TbVVMsD8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkK-0000FT-Ki
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkK-0005xp-Jo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] seabios: update to master snapshot
Message-Id: <E1kYFkK-0005xp-Jo@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:12 +0000

commit 1f42e246995a99890f6af4e42329f184ee14b0e7
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Aug 3 07:00:58 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Aug 3 07:01:02 2020 +0200

    seabios: update to master snapshot
    
    seabios master branch got a few bugfixes, so update
    to a newer snapshot to pick them up for 5.1-rc3.
    
    shortlog
    ========
    
    Kevin O'Connor (2):
          vgabios: Fix preserve memory flag in handle_1000
          ldnoexec: Add script to remove ET_EXEC flag from intermediate build objects
    
    Paul Menzel (1):
          nvme: Increase `nvme_cmd_readwrite()` message log level from 3 to 5
    
    Stefan Reiter (1):
          virtio-scsi: fix boot prio detection by using correct lun
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/bios-256k.bin             | Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                  | Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin        | Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin         | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin               | Bin 38912 -> 38912 bytes
 roms/seabios                      |   2 +-
 12 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 25b69cafba..8fd42903cd 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index 1167633985..528b8ab412 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-ati.bin b/pc-bios/vgabios-ati.bin
index d034f6d254..3dbfe53e5c 100644
Binary files a/pc-bios/vgabios-ati.bin and b/pc-bios/vgabios-ati.bin differ
diff --git a/pc-bios/vgabios-bochs-display.bin b/pc-bios/vgabios-bochs-display.bin
index 1ced8400f4..ca4c3db2db 100644
Binary files a/pc-bios/vgabios-bochs-display.bin and b/pc-bios/vgabios-bochs-display.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index b3af3771bd..b8ee1fe0ff 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index 3fac6dc137..9829cd1dec 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-ramfb.bin b/pc-bios/vgabios-ramfb.bin
index 1ca4f68a6e..12dcb8e823 100644
Binary files a/pc-bios/vgabios-ramfb.bin and b/pc-bios/vgabios-ramfb.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index a146eead00..68fe2fe820 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-virtio.bin b/pc-bios/vgabios-virtio.bin
index 49981a4334..60ce81d37c 100644
Binary files a/pc-bios/vgabios-virtio.bin and b/pc-bios/vgabios-virtio.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index 2f8935bf1f..b75a3517d1 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index d371983ab9..410436fbdf 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/seabios b/roms/seabios
index 88ab0c1552..d9c812dda5 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 88ab0c15525ced2eefe39220742efe4769089ad8
+Subproject commit d9c812dda519a1a73e8370e1b81ddf46eb22ed16
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15137.37982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkW-00088C-MQ; Thu, 29 Oct 2020 21:46:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15137.37982; Thu, 29 Oct 2020 21:46:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkW-000881-JM; Thu, 29 Oct 2020 21:46:24 +0000
Received: by outflank-mailman (input) for mailman id 15137;
 Thu, 29 Oct 2020 21:46:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFkV-00087t-NX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id efc7a96c-eb4b-40d5-804b-ecec8c80958d;
 Thu, 29 Oct 2020 21:46:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkU-0000Fg-PB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkU-0005yM-NZ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFkV-00087t-NX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:23 +0000
X-Inumbo-ID: efc7a96c-eb4b-40d5-804b-ecec8c80958d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id efc7a96c-eb4b-40d5-804b-ecec8c80958d;
	Thu, 29 Oct 2020 21:46:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CCalEF3j45Lq28fV2gXWi4RjiF3O7I7LtS08GhIP7yo=; b=49k8J1JU/gkf8zUBn9U5bBKHyf
	uEwH34w/hH7SmzPnnb2m14UQtaxhDwNRxQlhoeOJ0AuHyVCyB1lh8bEvBSVKkb5NwSiAq4+JPrYd1
	DmoZUaJZ4FA0Tg0Th9oy2lel40TnHwJwDfyGecLVRXzNChHtgq3Djw6OyDCSlvqsU2HM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkU-0000Fg-PB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkU-0005yM-NZ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/kraxel/tags/seabios-20200803-pull-request' into staging
Message-Id: <E1kYFkU-0005yM-NZ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:22 +0000

commit 92a95ab44655602e8665d5a0de13e0781a4fe824
Merge: d74824cf7c8b352f9045e949dc636c7207a41eee 1f42e246995a99890f6af4e42329f184ee14b0e7
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 09:54:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 09:54:58 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/seabios-20200803-pull-request' into staging
    
    seabios: update to master snapshot
    
    seabios master branch got a few bugfixes, so update
    to a newer snapshot to pick them up for 5.1-rc3.
    
    # gpg: Signature made Mon 03 Aug 2020 06:24:17 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/seabios-20200803-pull-request:
      seabios: update to master snapshot
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/bios-256k.bin             | Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                  | Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin        | Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin         | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin               | Bin 38912 -> 38912 bytes
 roms/seabios                      |   2 +-
 12 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15138.37986 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkg-00089S-Nq; Thu, 29 Oct 2020 21:46:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15138.37986; Thu, 29 Oct 2020 21:46:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkg-00089K-Kq; Thu, 29 Oct 2020 21:46:34 +0000
Received: by outflank-mailman (input) for mailman id 15138;
 Thu, 29 Oct 2020 21:46:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFkf-00089C-Up
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2345c292-d4a1-4efa-92c5-813f2122ca4c;
 Thu, 29 Oct 2020 21:46:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkf-0000Fp-4g
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkf-0005zI-3x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFkf-00089C-Up
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
X-Inumbo-ID: 2345c292-d4a1-4efa-92c5-813f2122ca4c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2345c292-d4a1-4efa-92c5-813f2122ca4c;
	Thu, 29 Oct 2020 21:46:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DU4NA3AR5M5sodm595So+opw+3reJzbNgLbv5+aP0lc=; b=afwRP6wj2Hs3dVQL/aUAfDYULm
	A4p/cZSHT+uF1EEbd4gViA0DJs0xkiSj8RuSkG0W3j7sfe6Xht41r0Mnb4BXQL3VwQLvG0iDDUpK7
	U8UuvLGPAALRnj2uHYBcdgfsa2hMMs2hXN9ZtU2axEULCjktS6sijP28ExfUcJu0Djyo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkf-0000Fp-4g
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkf-0005zI-3x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qapi/machine.json: Fix missing newline in doc comment
Message-Id: <E1kYFkf-0005zI-3x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:33 +0000

commit 6ac3f1e79974091aa292a0ab8637d5be8e5e4b1e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 29 20:10:19 2020 +0100
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    qapi/machine.json: Fix missing newline in doc comment
    
    In commit 176d2cda0dee9f4 we added the @die-id field
    to the CpuInstanceProperties struct, but in the process
    accidentally removed the newline between the doc-comment
    lines for @core-id and @thread-id.
    
    Put the newline back in; this fixes a misformatting in the
    generated HTML QMP reference manual.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200729191019.19168-1-peter.maydell@linaro.org>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/machine.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qapi/machine.json b/qapi/machine.json
index f59144023c..daede5ab14 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -825,7 +825,8 @@
 # @node-id: NUMA node ID the CPU belongs to
 # @socket-id: socket number within node/board the CPU belongs to
 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
-# @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
+# @core-id: core number within die the CPU belongs to
+# @thread-id: thread number within core the CPU belongs to
 #
 # Note: currently there are 5 properties that could be present
 #       but management should be prepared to pass through other
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15139.37990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkq-0008An-PO; Thu, 29 Oct 2020 21:46:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15139.37990; Thu, 29 Oct 2020 21:46:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFkq-0008Af-MK; Thu, 29 Oct 2020 21:46:44 +0000
Received: by outflank-mailman (input) for mailman id 15139;
 Thu, 29 Oct 2020 21:46:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFkq-0008AY-6f
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d956039f-4afc-429b-9ca8-993be8dca453;
 Thu, 29 Oct 2020 21:46:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkp-0000G1-8i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkp-0005zm-7X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFkq-0008AY-6f
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:44 +0000
X-Inumbo-ID: d956039f-4afc-429b-9ca8-993be8dca453
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d956039f-4afc-429b-9ca8-993be8dca453;
	Thu, 29 Oct 2020 21:46:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O6gEblDA/+In5QDJ0VC2KRdjCI+aBnH+g/DxFjSYyGE=; b=aDD3a0z7MVuicCczibUXLGYyUd
	NCpcGukNo1NCFxAyn5JDmxvq/jFQiz6pDUIwrriulQ5QEgAPGL/E6Hsaa6LL7AU8Mm3XFQng5OiQO
	2giVp29CDXJpROLjQY23UAJ0XKmkswQQqzXro1retffo45XnFLE2Yo+pYU/EYaJXzyxw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkp-0000G1-8i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkp-0005zm-7X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qapi: Delete unwanted indentation of top-level expressions
Message-Id: <E1kYFkp-0005zm-7X@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:43 +0000

commit fbeed197611bda439968e68a42d8efadb2e60f81
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 30 11:16:56 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    qapi: Delete unwanted indentation of top-level expressions
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200730091656.2633334-1-armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [One more line de-indented]
---
 qapi/block-core.json | 26 +++++++++++++-------------
 qapi/ui.json         |  4 ++--
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index ab7bf3c612..49edb4fdae 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1847,9 +1847,9 @@
 #
 # Since: 4.0
 ##
-  { 'enum': 'BlockPermission',
-    'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
-              'graph-mod' ] }
+{ 'enum': 'BlockPermission',
+  'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
+            'graph-mod' ] }
 ##
 # @XDbgBlockGraphEdge:
 #
@@ -2155,8 +2155,8 @@
 # <- { "return": {} }
 #
 ##
-  { 'command': 'block-dirty-bitmap-enable',
-    'data': 'BlockDirtyBitmap' }
+{ 'command': 'block-dirty-bitmap-enable',
+  'data': 'BlockDirtyBitmap' }
 
 ##
 # @block-dirty-bitmap-disable:
@@ -2176,8 +2176,8 @@
 # <- { "return": {} }
 #
 ##
-    { 'command': 'block-dirty-bitmap-disable',
-      'data': 'BlockDirtyBitmap' }
+{ 'command': 'block-dirty-bitmap-disable',
+  'data': 'BlockDirtyBitmap' }
 
 ##
 # @block-dirty-bitmap-merge:
@@ -2208,8 +2208,8 @@
 # <- { "return": {} }
 #
 ##
-      { 'command': 'block-dirty-bitmap-merge',
-        'data': 'BlockDirtyBitmapMerge' }
+{ 'command': 'block-dirty-bitmap-merge',
+  'data': 'BlockDirtyBitmapMerge' }
 
 ##
 # @BlockDirtyBitmapSha256:
@@ -2220,8 +2220,8 @@
 #
 # Since: 2.10
 ##
-  { 'struct': 'BlockDirtyBitmapSha256',
-    'data': {'sha256': 'str'} }
+{ 'struct': 'BlockDirtyBitmapSha256',
+  'data': {'sha256': 'str'} }
 
 ##
 # @x-debug-block-dirty-bitmap-sha256:
@@ -2235,8 +2235,8 @@
 #
 # Since: 2.10
 ##
-  { 'command': 'x-debug-block-dirty-bitmap-sha256',
-    'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
+{ 'command': 'x-debug-block-dirty-bitmap-sha256',
+  'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
 
 ##
 # @blockdev-mirror:
diff --git a/qapi/ui.json b/qapi/ui.json
index e16e98a060..1568cfeaad 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1081,8 +1081,8 @@
  # Since: 3.0
  #
  ##
- { 'enum'    : 'DisplayGLMode',
-   'data'    : [ 'off', 'on', 'core', 'es' ] }
+{ 'enum'    : 'DisplayGLMode',
+  'data'    : [ 'off', 'on', 'core', 'es' ] }
 
 ##
 # @DisplayCurses:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:46:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15140.37994 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFl1-0008CK-SL; Thu, 29 Oct 2020 21:46:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15140.37994; Thu, 29 Oct 2020 21:46:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFl1-0008CC-PE; Thu, 29 Oct 2020 21:46:55 +0000
Received: by outflank-mailman (input) for mailman id 15140;
 Thu, 29 Oct 2020 21:46:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFl0-0008C5-QP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d4aff098-85a7-4576-96fd-03e6c1ead234;
 Thu, 29 Oct 2020 21:46:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkz-0000G9-D4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFkz-00060I-CJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFl0-0008C5-QP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:54 +0000
X-Inumbo-ID: d4aff098-85a7-4576-96fd-03e6c1ead234
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d4aff098-85a7-4576-96fd-03e6c1ead234;
	Thu, 29 Oct 2020 21:46:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gbLsky4QWM5o/5vfF6TTI90EKH3wDAYcY80VlN4Q/Rc=; b=JSNqSLj0v6E6O5j8gyUCAa1Me/
	S8V0Q8SaBWH915J3M1e1itZTQZHL2OOO3/UIsb78LwzC2ZnnQWaH6241iGGNrlem13xIZCtJP+46+
	yppmKJtZgh79oa6/oBbnrX3BmK8QF19hBNyZU3XOsXua1SNk9VytQ1onQgDSWOdjNY0w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkz-0000G9-D4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFkz-00060I-CJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:46:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] schemas: Add vim modeline
Message-Id: <E1kYFkz-00060I-CJ@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:46:53 +0000

commit f7160f32186b4ae1e1327e3bd05060fffec8f9ae
Author:     Andrea Bolognani <abologna@redhat.com>
AuthorDate: Wed Jul 29 20:50:24 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    schemas: Add vim modeline
    
    The various schemas included in QEMU use a JSON-based format which
    is, however, strictly speaking not valid JSON.
    
    As a consequence, when vim tries to apply syntax highlight rules
    for JSON (as guessed from the file name), the result is an unreadable
    mess which mostly consist of red markers pointing out supposed errors
    in, well, pretty much everything.
    
    Using Python syntax highlighting produces much better results, and
    in fact these files already start with specially-formatted comments
    that instruct Emacs to process them as if they were Python files.
    
    This commit adds the equivalent special comments for vim.
    
    Signed-off-by: Andrea Bolognani <abologna@redhat.com>
    Message-Id: <20200729185024.121766-1-abologna@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: John Snow <jsnow@redhat.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/interop/firmware.json                | 1 +
 docs/interop/vhost-user.json              | 1 +
 qapi/authz.json                           | 1 +
 qapi/block-core.json                      | 1 +
 qapi/block.json                           | 1 +
 qapi/char.json                            | 1 +
 qapi/common.json                          | 1 +
 qapi/control.json                         | 1 +
 qapi/crypto.json                          | 1 +
 qapi/dump.json                            | 1 +
 qapi/error.json                           | 1 +
 qapi/introspect.json                      | 1 +
 qapi/job.json                             | 1 +
 qapi/machine-target.json                  | 1 +
 qapi/machine.json                         | 1 +
 qapi/migration.json                       | 1 +
 qapi/misc-target.json                     | 1 +
 qapi/misc.json                            | 1 +
 qapi/net.json                             | 1 +
 qapi/qapi-schema.json                     | 1 +
 qapi/qdev.json                            | 1 +
 qapi/qom.json                             | 1 +
 qapi/rdma.json                            | 1 +
 qapi/rocker.json                          | 1 +
 qapi/run-state.json                       | 1 +
 qapi/sockets.json                         | 1 +
 qapi/tpm.json                             | 1 +
 qapi/transaction.json                     | 1 +
 qapi/ui.json                              | 1 +
 qga/qapi-schema.json                      | 1 +
 storage-daemon/qapi/qapi-schema.json      | 1 +
 tests/qapi-schema/doc-good.json           | 2 ++
 tests/qapi-schema/include/sub-module.json | 1 +
 tests/qapi-schema/qapi-schema-test.json   | 1 +
 tests/qapi-schema/sub-sub-module.json     | 1 +
 35 files changed, 36 insertions(+)

diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 240f565397..989f10b626 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2018 Red Hat, Inc.
 #
diff --git a/docs/interop/vhost-user.json b/docs/interop/vhost-user.json
index ef8ac5941f..feb5fe58ca 100644
--- a/docs/interop/vhost-user.json
+++ b/docs/interop/vhost-user.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2018 Red Hat, Inc.
 #
diff --git a/qapi/authz.json b/qapi/authz.json
index 1c836a3abd..f3e9745426 100644
--- a/qapi/authz.json
+++ b/qapi/authz.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # QAPI authz definitions
 
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 49edb4fdae..197bdc1c36 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # == Block core (VM unrelated)
diff --git a/qapi/block.json b/qapi/block.json
index 2ddbfa8306..c54a393cf3 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Block devices
diff --git a/qapi/char.json b/qapi/char.json
index daceb20f84..8aeedf96b2 100644
--- a/qapi/char.json
+++ b/qapi/char.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/common.json b/qapi/common.json
index 7b9cbcd97b..716712d4b3 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Common data types
diff --git a/qapi/control.json b/qapi/control.json
index 6b816bb61f..de51e9916c 100644
--- a/qapi/control.json
+++ b/qapi/control.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/crypto.json b/qapi/crypto.json
index 5a68e0db25..bb7930d332 100644
--- a/qapi/crypto.json
+++ b/qapi/crypto.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/dump.json b/qapi/dump.json
index a1eed7b15c..f7c4267e3f 100644
--- a/qapi/dump.json
+++ b/qapi/dump.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/error.json b/qapi/error.json
index 3fad08f506..94a6502de9 100644
--- a/qapi/error.json
+++ b/qapi/error.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = QMP errors
diff --git a/qapi/introspect.json b/qapi/introspect.json
index b1aabd4cfd..944bb87a20 100644
--- a/qapi/introspect.json
+++ b/qapi/introspect.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2015 Red Hat, Inc.
 #
diff --git a/qapi/job.json b/qapi/job.json
index c48a0c3e34..280c2f76f1 100644
--- a/qapi/job.json
+++ b/qapi/job.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # == Background jobs
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index f2c82949d8..698850cc78 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/machine.json b/qapi/machine.json
index daede5ab14..481b1f07ec 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/migration.json b/qapi/migration.json
index d5000558c6..ea53b23dca 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index dee3b45930..1e561fa97b 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/misc.json b/qapi/misc.json
index 149c925246..9d32820dc1 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/net.json b/qapi/net.json
index 558d520a2f..ddb113e5e5 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 43b0ba0dea..f03ff91ceb 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 ##
 # = Introduction
 #
diff --git a/qapi/qdev.json b/qapi/qdev.json
index f4ed9735c4..13254529bf 100644
--- a/qapi/qdev.json
+++ b/qapi/qdev.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/qom.json b/qapi/qom.json
index 8abe998962..0b0b92944b 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/rdma.json b/qapi/rdma.json
index b58105b1b6..a1d2175a8b 100644
--- a/qapi/rdma.json
+++ b/qapi/rdma.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/rocker.json b/qapi/rocker.json
index 52597db491..b48e49a89b 100644
--- a/qapi/rocker.json
+++ b/qapi/rocker.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Rocker switch device
diff --git a/qapi/run-state.json b/qapi/run-state.json
index 2e22907740..7cc9f96a5b 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/sockets.json b/qapi/sockets.json
index cbd6ef35d0..c0c640a5b0 100644
--- a/qapi/sockets.json
+++ b/qapi/sockets.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Socket data types
diff --git a/qapi/tpm.json b/qapi/tpm.json
index dc1f081739..6a10c9ed8d 100644
--- a/qapi/tpm.json
+++ b/qapi/tpm.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/transaction.json b/qapi/transaction.json
index b6c11158f0..15ddebdbc3 100644
--- a/qapi/transaction.json
+++ b/qapi/transaction.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/ui.json b/qapi/ui.json
index 1568cfeaad..9d6721037f 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 408a662ea5..b1e9ed836d 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 ##
 #
diff --git a/storage-daemon/qapi/qapi-schema.json b/storage-daemon/qapi/qapi-schema.json
index 14f4f8fe61..6100d1f0c9 100644
--- a/storage-daemon/qapi/qapi-schema.json
+++ b/storage-daemon/qapi/qapi-schema.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 # Note that modules are shared with the QEMU main schema under the assumption
 # that the storage daemon schema is a subset of the main schema. For the shared
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index ddd89d1233..9da72a1f55 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -1,4 +1,6 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
+#
 # Positive QAPI doc comment tests
 
 { 'pragma': { 'doc-required': true } }
diff --git a/tests/qapi-schema/include/sub-module.json b/tests/qapi-schema/include/sub-module.json
index afdb267228..b9f7b9bb56 100644
--- a/tests/qapi-schema/include/sub-module.json
+++ b/tests/qapi-schema/include/sub-module.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # Sub-module of ../qapi-schema-test.json
 
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 6b1f05afa7..3a9f2cbb33 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # This file is a stress test of supported qapi constructs that must
 # parse and compile correctly.
diff --git a/tests/qapi-schema/sub-sub-module.json b/tests/qapi-schema/sub-sub-module.json
index 524ef9b83f..94f36ec0b1 100644
--- a/tests/qapi-schema/sub-sub-module.json
+++ b/tests/qapi-schema/sub-sub-module.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # Sub-module of sub-module include/sub-module.json of qapi-schema-test.json
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15141.37998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlB-0008E1-Tk; Thu, 29 Oct 2020 21:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15141.37998; Thu, 29 Oct 2020 21:47:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlB-0008Dr-Qs; Thu, 29 Oct 2020 21:47:05 +0000
Received: by outflank-mailman (input) for mailman id 15141;
 Thu, 29 Oct 2020 21:47:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFlB-0008Dl-83
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f3587c1c-8c9b-4a63-ae13-d22804e29351;
 Thu, 29 Oct 2020 21:47:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFl9-0000Ha-I0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFl9-00060y-GE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFlB-0008Dl-83
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:05 +0000
X-Inumbo-ID: f3587c1c-8c9b-4a63-ae13-d22804e29351
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f3587c1c-8c9b-4a63-ae13-d22804e29351;
	Thu, 29 Oct 2020 21:47:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PEJv9S8W7qUFQgoLO5f2hAp9tiidqiTo7UuXz76wDw0=; b=kW3tzzIrg0PLcdHE4r1F+ZDP1g
	isA4mQefn4LV1UjQvSeQ6KkppqueDWuT/YEao7gg1rRgnhqcqCDYYZhciiNLQuRvIJHygDpbg6U1T
	8DiJudJmxANu5v2uUfYbTeRHjSRISQduPqzFn8zoJmEZFrScLpQMLKYCI5PR52OBIuvw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFl9-0000Ha-I0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFl9-00060y-GE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-08-03' into staging
Message-Id: <E1kYFl9-00060y-GE@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:03 +0000

commit 6c5dfc9ccb643a0d50fdec9f10806b14960571d1
Merge: 92a95ab44655602e8665d5a0de13e0781a4fe824 f7160f32186b4ae1e1327e3bd05060fffec8f9ae
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 12:21:57 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 12:21:57 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-08-03' into staging
    
    QAPI patches patches for 2020-08-03
    
    # gpg: Signature made Mon 03 Aug 2020 10:08:30 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qapi-2020-08-03:
      schemas: Add vim modeline
      qapi: Delete unwanted indentation of top-level expressions
      qapi/machine.json: Fix missing newline in doc comment
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/interop/firmware.json                |  1 +
 docs/interop/vhost-user.json              |  1 +
 qapi/authz.json                           |  1 +
 qapi/block-core.json                      | 27 ++++++++++++++-------------
 qapi/block.json                           |  1 +
 qapi/char.json                            |  1 +
 qapi/common.json                          |  1 +
 qapi/control.json                         |  1 +
 qapi/crypto.json                          |  1 +
 qapi/dump.json                            |  1 +
 qapi/error.json                           |  1 +
 qapi/introspect.json                      |  1 +
 qapi/job.json                             |  1 +
 qapi/machine-target.json                  |  1 +
 qapi/machine.json                         |  4 +++-
 qapi/migration.json                       |  1 +
 qapi/misc-target.json                     |  1 +
 qapi/misc.json                            |  1 +
 qapi/net.json                             |  1 +
 qapi/qapi-schema.json                     |  1 +
 qapi/qdev.json                            |  1 +
 qapi/qom.json                             |  1 +
 qapi/rdma.json                            |  1 +
 qapi/rocker.json                          |  1 +
 qapi/run-state.json                       |  1 +
 qapi/sockets.json                         |  1 +
 qapi/tpm.json                             |  1 +
 qapi/transaction.json                     |  1 +
 qapi/ui.json                              |  5 +++--
 qga/qapi-schema.json                      |  1 +
 storage-daemon/qapi/qapi-schema.json      |  1 +
 tests/qapi-schema/doc-good.json           |  2 ++
 tests/qapi-schema/include/sub-module.json |  1 +
 tests/qapi-schema/qapi-schema-test.json   |  1 +
 tests/qapi-schema/sub-sub-module.json     |  1 +
 35 files changed, 53 insertions(+), 16 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15142.38002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlL-0008FO-VO; Thu, 29 Oct 2020 21:47:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15142.38002; Thu, 29 Oct 2020 21:47:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlL-0008FG-SQ; Thu, 29 Oct 2020 21:47:15 +0000
Received: by outflank-mailman (input) for mailman id 15142;
 Thu, 29 Oct 2020 21:47:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFlK-0008F4-Qr
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e4dd23c6-bed0-4aba-a588-92fa9db9dfea;
 Thu, 29 Oct 2020 21:47:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlJ-0000Hk-VV
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlJ-00061y-Ui
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFlK-0008F4-Qr
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:14 +0000
X-Inumbo-ID: e4dd23c6-bed0-4aba-a588-92fa9db9dfea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e4dd23c6-bed0-4aba-a588-92fa9db9dfea;
	Thu, 29 Oct 2020 21:47:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=m3B1EZQ5xWtjOOWx8tXJFPy45VWGw8QWvKoV+Vzibnc=; b=mWshsEISobrFz6Ie699ByDO7cJ
	7BBE1iUdDJGbvF+dG/SbavagMVJmLhyqXrryo9dJt1VBLvUvDm0Qw2LYrD3zG4nJKIJVKVb4GTT/L
	8uCnqlhyVxwz17m+9XLP/bAf69ylhliqZu8Nos2urrum5rpn3kk6D5o+BgQH2X9XM/UI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlJ-0000Hk-VV
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlJ-00061y-Ui
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow2: Release read-only bitmaps when inactivated
Message-Id: <E1kYFlJ-00061y-Ui@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:13 +0000

commit fe16c7ddf82b25e54cb76936a4cdf6bf9327ece5
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 30 14:02:33 2020 +0200
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Aug 3 08:59:37 2020 -0500

    qcow2: Release read-only bitmaps when inactivated
    
    During migration, we release all bitmaps after storing them on disk, as
    long as they are (1) stored on disk, (2) not read-only, and (3)
    consistent.
    
    (2) seems arbitrary, though.  The reason we do not release them is
    because we do not write them, as there is no need to; and then we just
    forget about all bitmaps that we have not written to the file.  However,
    read-only persistent bitmaps are still in the file and in sync with
    their in-memory representation, so we may as well release them just like
    any R/W bitmap that we have updated.
    
    It leads to actual problems, too: After migration, letting the source
    continue may result in an error if there were any bitmaps on read-only
    nodes (such as backing images), because those have not been released by
    bdrv_inactive_all(), but bdrv_invalidate_cache_all() attempts to reload
    them (which fails, because they are still present in memory).
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200730120234.49288-2-mreitz@redhat.com>
    Tested-by: Peter Krempa <pkrempa@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2-bitmap.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 1f38806ca6..8c34b2aef7 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1562,11 +1562,22 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         Qcow2Bitmap *bm;
 
         if (!bdrv_dirty_bitmap_get_persistence(bitmap) ||
-            bdrv_dirty_bitmap_readonly(bitmap) ||
             bdrv_dirty_bitmap_inconsistent(bitmap)) {
             continue;
         }
 
+        if (bdrv_dirty_bitmap_readonly(bitmap)) {
+            /*
+             * Store the bitmap in the associated Qcow2Bitmap so it
+             * can be released later
+             */
+            bm = find_bitmap_by_name(bm_list, name);
+            if (bm) {
+                bm->dirty_bitmap = bitmap;
+            }
+            continue;
+        }
+
         need_write = true;
 
         if (check_constraints_on_bitmap(bs, name, granularity, errp) < 0) {
@@ -1618,7 +1629,9 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
 
     /* allocate clusters and store bitmaps */
     QSIMPLEQ_FOREACH(bm, bm_list, entry) {
-        if (bm->dirty_bitmap == NULL) {
+        BdrvDirtyBitmap *bitmap = bm->dirty_bitmap;
+
+        if (bitmap == NULL || bdrv_dirty_bitmap_readonly(bitmap)) {
             continue;
         }
 
@@ -1641,6 +1654,7 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         g_free(tb);
     }
 
+success:
     if (release_stored) {
         QSIMPLEQ_FOREACH(bm, bm_list, entry) {
             if (bm->dirty_bitmap == NULL) {
@@ -1651,13 +1665,14 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         }
     }
 
-success:
     bitmap_list_free(bm_list);
     return;
 
 fail:
     QSIMPLEQ_FOREACH(bm, bm_list, entry) {
-        if (bm->dirty_bitmap == NULL || bm->table.offset == 0) {
+        if (bm->dirty_bitmap == NULL || bm->table.offset == 0 ||
+            bdrv_dirty_bitmap_readonly(bm->dirty_bitmap))
+        {
             continue;
         }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15143.38006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlX-0008Gh-0m; Thu, 29 Oct 2020 21:47:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15143.38006; Thu, 29 Oct 2020 21:47:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlW-0008GZ-U4; Thu, 29 Oct 2020 21:47:26 +0000
Received: by outflank-mailman (input) for mailman id 15143;
 Thu, 29 Oct 2020 21:47:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFlV-0008GQ-Ie
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 481902da-f70e-4060-86e8-c524792f0efa;
 Thu, 29 Oct 2020 21:47:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlU-0000I0-2k
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlU-00062W-21
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFlV-0008GQ-Ie
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:25 +0000
X-Inumbo-ID: 481902da-f70e-4060-86e8-c524792f0efa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 481902da-f70e-4060-86e8-c524792f0efa;
	Thu, 29 Oct 2020 21:47:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t+CAqc4R38NVKN4svTEvlGM+4vjrW2adSolPpxeKkzY=; b=XaAviaxwlOR3bhipLedfYLSCv3
	K6CdI7EmMlG7SCEVjCA/FpUBVo0LEWIYaWyATOaskfyDzb3ssAtM0Xm0ocXXMEdyV48fWFF4ygNHI
	Hz5cYo9X9EqFUlXo7Uz7pYtOtuvwhC3b+KhYenmxIW2iBmn4fD74XdqeScBq3aD7jE0Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlU-0000I0-2k
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlU-00062W-21
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] iotests/169: Test source cont with backing bmap
Message-Id: <E1kYFlU-00062W-21@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:24 +0000

commit edadc99a2ee90daeaaf4fba21d623ec8efe7c8e6
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 30 14:02:34 2020 +0200
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Aug 3 08:59:37 2020 -0500

    iotests/169: Test source cont with backing bmap
    
    Test migrating from a VM with a persistent bitmap in the backing chain,
    and then continuing that VM after the migration
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200730120234.49288-3-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/169     | 64 +++++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/169.out |  4 +--
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 2c5a132aa3..40afb15299 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -24,11 +24,12 @@ import time
 import itertools
 import operator
 import re
-from iotests import qemu_img
+from iotests import qemu_img, qemu_img_create, Timeout
 
 
 disk_a = os.path.join(iotests.test_dir, 'disk_a')
 disk_b = os.path.join(iotests.test_dir, 'disk_b')
+base_a = os.path.join(iotests.test_dir, 'base_a')
 size = '1M'
 mig_file = os.path.join(iotests.test_dir, 'mig_file')
 mig_cmd = 'exec: cat > ' + mig_file
@@ -234,6 +235,67 @@ for cmb in list(itertools.product((True, False), repeat=2)):
     inject_test_case(TestDirtyBitmapMigration, name,
                      'do_test_migration_resume_source', *list(cmb))
 
+
+class TestDirtyBitmapBackingMigration(iotests.QMPTestCase):
+    def setUp(self):
+        qemu_img_create('-f', iotests.imgfmt, base_a, size)
+        qemu_img_create('-f', iotests.imgfmt, '-F', iotests.imgfmt,
+                        '-b', base_a, disk_a, size)
+
+        for f in (disk_a, base_a):
+            qemu_img('bitmap', '--add', f, 'bmap0')
+
+        blockdev = {
+            'node-name': 'node0',
+            'driver': iotests.imgfmt,
+            'file': {
+                'driver': 'file',
+                'filename': disk_a
+            },
+            'backing': {
+                'node-name': 'node0-base',
+                'driver': iotests.imgfmt,
+                'file': {
+                    'driver': 'file',
+                    'filename': base_a
+                }
+            }
+        }
+
+        self.vm = iotests.VM()
+        self.vm.launch()
+
+        result = self.vm.qmp('blockdev-add', **blockdev)
+        self.assert_qmp(result, 'return', {})
+
+        # Check that the bitmaps are there
+        for node in self.vm.qmp('query-named-block-nodes', flat=True)['return']:
+            if 'node0' in node['node-name']:
+                self.assert_qmp(node, 'dirty-bitmaps[0]/name', 'bmap0')
+
+        caps = [{'capability': 'events', 'state': True}]
+        result = self.vm.qmp('migrate-set-capabilities', capabilities=caps)
+        self.assert_qmp(result, 'return', {})
+
+    def tearDown(self):
+        self.vm.shutdown()
+        for f in (disk_a, base_a):
+            os.remove(f)
+
+    def test_cont_on_source(self):
+        """
+        Continue the source after migration.
+        """
+        result = self.vm.qmp('migrate', uri=f'exec: cat > /dev/null')
+        self.assert_qmp(result, 'return', {})
+
+        with Timeout(10, 'Migration timeout'):
+            self.vm.wait_migration('postmigrate')
+
+        result = self.vm.qmp('cont')
+        self.assert_qmp(result, 'return', {})
+
+
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'],
                  supported_protocols=['file'])
diff --git a/tests/qemu-iotests/169.out b/tests/qemu-iotests/169.out
index 5c26d15c0d..cafb8161f7 100644
--- a/tests/qemu-iotests/169.out
+++ b/tests/qemu-iotests/169.out
@@ -1,5 +1,5 @@
-....................................
+.....................................
 ----------------------------------------------------------------------
-Ran 36 tests
+Ran 37 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15144.38010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlg-0008I3-3t; Thu, 29 Oct 2020 21:47:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15144.38010; Thu, 29 Oct 2020 21:47:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlg-0008Hv-0v; Thu, 29 Oct 2020 21:47:36 +0000
Received: by outflank-mailman (input) for mailman id 15144;
 Thu, 29 Oct 2020 21:47:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFle-0008Hn-W5
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cf6dc604-df23-448b-a7ca-44ef2bf99035;
 Thu, 29 Oct 2020 21:47:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFle-0000I6-6M
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFle-000632-5c
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFle-0008Hn-W5
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:35 +0000
X-Inumbo-ID: cf6dc604-df23-448b-a7ca-44ef2bf99035
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cf6dc604-df23-448b-a7ca-44ef2bf99035;
	Thu, 29 Oct 2020 21:47:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VKhqcsB/E652MOxZ3RxYTadKGSdSfstBRl4xjQwx/wc=; b=uCHrYbx7jaJvfJiDlNVrdw7an2
	5VJWpGzoEic/ygAKD8+4+uS6/b9Tw429yXrkjqSulwwJBZ6BkYdjjMxoHciEBSNhW6chWdXRoTWVE
	VTLXGHHxhh7eKaVi6fCUwguvPO9qo1uPlYZ9sOENC+JaJRvCWpt4B141x8NgOya9KGlE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFle-0000I6-6M
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFle-000632-5c
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-08-03' into staging
Message-Id: <E1kYFle-000632-5c@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:34 +0000

commit 45a150aa2b3492acf6691c7bdbeb25a8545d8345
Merge: 6c5dfc9ccb643a0d50fdec9f10806b14960571d1 edadc99a2ee90daeaaf4fba21d623ec8efe7c8e6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 15:13:49 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 15:13:49 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-08-03' into staging
    
    bitmaps patches for 2020-08-03
    
    - fix bitmap migration involving read-only bitmap from backing chain
    
    # gpg: Signature made Mon 03 Aug 2020 15:06:51 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-08-03:
      iotests/169: Test source cont with backing bmap
      qcow2: Release read-only bitmaps when inactivated
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/qcow2-bitmap.c       | 23 ++++++++++++++---
 tests/qemu-iotests/169     | 64 +++++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/169.out |  4 +--
 3 files changed, 84 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15145.38014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlr-0008JO-5X; Thu, 29 Oct 2020 21:47:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15145.38014; Thu, 29 Oct 2020 21:47:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFlr-0008JG-2V; Thu, 29 Oct 2020 21:47:47 +0000
Received: by outflank-mailman (input) for mailman id 15145;
 Thu, 29 Oct 2020 21:47:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFlp-0008J7-Rl
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 86648d15-0279-4e70-ba2d-eebfcf194006;
 Thu, 29 Oct 2020 21:47:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlo-0000Jo-KB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFlo-000664-JO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFlp-0008J7-Rl
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:45 +0000
X-Inumbo-ID: 86648d15-0279-4e70-ba2d-eebfcf194006
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 86648d15-0279-4e70-ba2d-eebfcf194006;
	Thu, 29 Oct 2020 21:47:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ue1KBFrvzNgWYe6GX7TvOGMzRZ1V3X4JNFwu9S2fPFU=; b=bNQjP6rXFKBvtycG6uZZQKTare
	zToMC4R73JrSLCh+zJBGCwZsR3OsKpkN+1GNs05HEkdlvH0g2c9ex+Epdn7ZYjga4cerp1pjdi+Vo
	2P9hx4WcOQEy1jSJvieWZXfsHRza1EWmbsy2UiaXNeiR6/z2IRUDPEpf1vJkU7wNv2W0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlo-0000Jo-KB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFlo-000664-JO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/netduino2, netduinoplus2: Set system_clock_scale
Message-Id: <E1kYFlo-000664-JO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:44 +0000

commit e7e5a9595ab1136845c444141830fca0d2746a73
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    hw/arm/netduino2, netduinoplus2: Set system_clock_scale
    
    The netduino2 and netduinoplus2 boards forgot to set the system_clock_scale
    global, which meant that if guest code used the systick timer in "use
    the processor clock" mode it would hang because time never advances.
    
    Set the global to match the documented CPU clock speed of these boards.
    Judging by the data sheet this is slightly simplistic because the
    SoC allows configuration of the SYSCLK source and frequency via the
    RCC (reset and clock control) module, but we don't model that.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1876187
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200727162617.26227-1-peter.maydell@linaro.org
---
 hw/arm/netduino2.c     | 10 ++++++++++
 hw/arm/netduinoplus2.c | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c
index 79e19392b5..8f10334144 100644
--- a/hw/arm/netduino2.c
+++ b/hw/arm/netduino2.c
@@ -30,10 +30,20 @@
 #include "hw/arm/stm32f205_soc.h"
 #include "hw/arm/boot.h"
 
+/* Main SYSCLK frequency in Hz (120MHz) */
+#define SYSCLK_FRQ 120000000ULL
+
 static void netduino2_init(MachineState *machine)
 {
     DeviceState *dev;
 
+    /*
+     * TODO: ideally we would model the SoC RCC and let it handle
+     * system_clock_scale, including its ability to define different
+     * possible SYSCLK sources.
+     */
+    system_clock_scale = NANOSECONDS_PER_SECOND / SYSCLK_FRQ;
+
     dev = qdev_new(TYPE_STM32F205_SOC);
     qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m3"));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
diff --git a/hw/arm/netduinoplus2.c b/hw/arm/netduinoplus2.c
index 958d21dd9f..68abd3ec69 100644
--- a/hw/arm/netduinoplus2.c
+++ b/hw/arm/netduinoplus2.c
@@ -30,10 +30,20 @@
 #include "hw/arm/stm32f405_soc.h"
 #include "hw/arm/boot.h"
 
+/* Main SYSCLK frequency in Hz (168MHz) */
+#define SYSCLK_FRQ 168000000ULL
+
 static void netduinoplus2_init(MachineState *machine)
 {
     DeviceState *dev;
 
+    /*
+     * TODO: ideally we would model the SoC RCC and let it handle
+     * system_clock_scale, including its ability to define different
+     * possible SYSCLK sources.
+     */
+    system_clock_scale = NANOSECONDS_PER_SECOND / SYSCLK_FRQ;
+
     dev = qdev_new(TYPE_STM32F405_SOC);
     qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m4"));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:47:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:47:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15146.38017 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFm1-0008LW-7X; Thu, 29 Oct 2020 21:47:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15146.38017; Thu, 29 Oct 2020 21:47:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFm1-0008LN-3z; Thu, 29 Oct 2020 21:47:57 +0000
Received: by outflank-mailman (input) for mailman id 15146;
 Thu, 29 Oct 2020 21:47:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFlz-0008KP-He
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e97aa49-8597-4ca9-9110-af9fc8d9aed1;
 Thu, 29 Oct 2020 21:47:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFly-0000Jw-O2
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFly-00066h-Mc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFlz-0008KP-He
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:55 +0000
X-Inumbo-ID: 6e97aa49-8597-4ca9-9110-af9fc8d9aed1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e97aa49-8597-4ca9-9110-af9fc8d9aed1;
	Thu, 29 Oct 2020 21:47:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=twWavbb8AwN79whnh4mPj4qHnzycwp6571KQFV5Elbk=; b=uP73bjnkaH++mSNGlUr/y2rrDN
	i334He81a7EjeHE2fnLkROekt+0Sw9ctfmjdARIPBHy03GtDcnDljjuSiJpB6bPs36Pdg7CQOBuva
	c5YKwYekEjpFvQUeuM34EsyqFj7lEBlh7UV4hTxzKei9DZtyo36oCbjBzkLbnVk/Y+gA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFly-0000Jw-O2
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFly-00066h-Mc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:47:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] include/hw/irq.h: New function qemu_irq_is_connected()
Message-Id: <E1kYFly-00066h-Mc@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:47:54 +0000

commit faf7c6de34fb8eaa566726cc658ba5ad81fb32af
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    include/hw/irq.h: New function qemu_irq_is_connected()
    
    Mostly devices don't need to care whether one of their output
    qemu_irq lines is connected, because functions like qemu_set_irq()
    silently do nothing if there is nothing on the other end.  However
    sometimes a device might want to implement default behaviour for the
    case where the machine hasn't wired the line up to anywhere.
    
    Provide a function qemu_irq_is_connected() that devices can use for
    this purpose.  (The test is trivial but encapsulating it in a
    function makes it easier to see where we're doing it in case we need
    to change the implementation later.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-2-peter.maydell@linaro.org
---
 include/hw/irq.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/hw/irq.h b/include/hw/irq.h
index 24ba0ece11..dc7abf199e 100644
--- a/include/hw/irq.h
+++ b/include/hw/irq.h
@@ -55,4 +55,22 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2);
    on an existing vector of qemu_irq.  */
 void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);
 
+/**
+ * qemu_irq_is_connected: Return true if IRQ line is wired up
+ *
+ * If a qemu_irq has a device on the other (receiving) end of it,
+ * return true; otherwise return false.
+ *
+ * Usually device models don't need to care whether the machine model
+ * has wired up their outbound qemu_irq lines, because functions like
+ * qemu_set_irq() silently do nothing if there is nothing on the other
+ * end of the line. However occasionally a device model will want to
+ * provide default behaviour if its output is left floating, and
+ * it can use this function to identify when that is the case.
+ */
+static inline bool qemu_irq_is_connected(qemu_irq irq)
+{
+    return irq != NULL;
+}
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15147.38022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmB-0008OE-8c; Thu, 29 Oct 2020 21:48:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15147.38022; Thu, 29 Oct 2020 21:48:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmB-0008O6-5X; Thu, 29 Oct 2020 21:48:07 +0000
Received: by outflank-mailman (input) for mailman id 15147;
 Thu, 29 Oct 2020 21:48:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFm9-0008Nw-SS
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 64bbea01-c5aa-4128-972c-f65eeb76f875;
 Thu, 29 Oct 2020 21:48:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFm8-0000Ki-Sg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFm8-00067R-Qv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFm9-0008Nw-SS
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:05 +0000
X-Inumbo-ID: 64bbea01-c5aa-4128-972c-f65eeb76f875
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 64bbea01-c5aa-4128-972c-f65eeb76f875;
	Thu, 29 Oct 2020 21:48:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ALMID24RRlmxCVP0cyC1rJHWmYPT3IT6HMILbGoJws8=; b=FcM7XmZpzRek3VcG5LB0BBXv7N
	isiZic/c9WEsV5VJo1mQ7ZNiSvhz65sRDDBtYxWzy46Cw9kzgA4y3fKG/yL1G6nCxOMk4xwe/I7M4
	xbyzRe6dYav58lzfFfAP+SxTCnW35hhmkTyFAt9dFcmmXQX41V84bRMyV/faAV+XhKKE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFm8-0000Ki-Sg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFm8-00067R-Qv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
Message-Id: <E1kYFm8-00067R-Qv@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:04 +0000

commit 9e60d759d38d1faae1d85de2c53411e635be3cf2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
    
    The NVIC provides an outbound qemu_irq "SYSRESETREQ" which it signals
    when the guest sets the SYSRESETREQ bit in the AIRCR register.  This
    matches the hardware design (where the CPU has a signal of this name
    and it is up to the SoC to connect that up to an actual reset
    mechanism), but in QEMU it mostly results in duplicated code in SoC
    objects and bugs where SoC model implementors forget to wire up the
    SYSRESETREQ line.
    
    Provide a default behaviour for the case where SYSRESETREQ is not
    actually connected to anything: use qemu_system_reset_request() to
    perform a system reset.  This will allow us to remove the
    implementations of SYSRESETREQ handling from the boards where that's
    exactly what it does, and also fixes the bugs in the board models
    which forgot to wire up the signal:
    
     * microbit
     * mps2-an385
     * mps2-an505
     * mps2-an511
     * mps2-an521
     * musca-a
     * musca-b1
     * netduino
     * netduinoplus2
    
    We still allow the board to wire up the signal if it needs to, in case
    we need to model more complicated reset controller logic or to model
    buggy SoC hardware which forgot to wire up the line itself. But
    defaulting to "reset the system" is more often going to be correct
    than defaulting to "do nothing".
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-3-peter.maydell@linaro.org
---
 hw/intc/armv7m_nvic.c   | 17 ++++++++++++++++-
 include/hw/arm/armv7m.h |  4 +++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 3c4b6e6d70..277a98b87b 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -19,6 +19,7 @@
 #include "hw/intc/armv7m_nvic.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
+#include "sysemu/runstate.h"
 #include "target/arm/cpu.h"
 #include "exec/exec-all.h"
 #include "exec/memop.h"
@@ -64,6 +65,20 @@ static const uint8_t nvic_id[] = {
     0x00, 0xb0, 0x1b, 0x00, 0x0d, 0xe0, 0x05, 0xb1
 };
 
+static void signal_sysresetreq(NVICState *s)
+{
+    if (qemu_irq_is_connected(s->sysresetreq)) {
+        qemu_irq_pulse(s->sysresetreq);
+    } else {
+        /*
+         * Default behaviour if the SoC doesn't need to wire up
+         * SYSRESETREQ (eg to a system reset controller of some kind):
+         * perform a system reset via the usual QEMU API.
+         */
+        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+    }
+}
+
 static int nvic_pending_prio(NVICState *s)
 {
     /* return the group priority of the current pending interrupt,
@@ -1524,7 +1539,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value,
             if (value & R_V7M_AIRCR_SYSRESETREQ_MASK) {
                 if (attrs.secure ||
                     !(cpu->env.v7m.aircr & R_V7M_AIRCR_SYSRESETREQS_MASK)) {
-                    qemu_irq_pulse(s->sysresetreq);
+                    signal_sysresetreq(s);
                 }
             }
             if (value & R_V7M_AIRCR_VECTCLRACTIVE_MASK) {
diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h
index d2c74d3872..a30e3c6471 100644
--- a/include/hw/arm/armv7m.h
+++ b/include/hw/arm/armv7m.h
@@ -35,7 +35,9 @@ typedef struct {
 
 /* ARMv7M container object.
  * + Unnamed GPIO input lines: external IRQ lines for the NVIC
- * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ
+ * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ.
+ *   If this GPIO is not wired up then the NVIC will default to performing
+ *   a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET).
  * + Property "cpu-type": CPU type to instantiate
  * + Property "num-irq": number of external IRQ lines
  * + Property "memory": MemoryRegion defining the physical address space
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15148.38027 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmL-0008PW-Ab; Thu, 29 Oct 2020 21:48:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15148.38027; Thu, 29 Oct 2020 21:48:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmL-0008PN-7C; Thu, 29 Oct 2020 21:48:17 +0000
Received: by outflank-mailman (input) for mailman id 15148;
 Thu, 29 Oct 2020 21:48:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFmJ-0008PD-SL
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1009a636-76ff-40ad-946d-3548b37f4c6c;
 Thu, 29 Oct 2020 21:48:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmI-0000Ko-WF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmI-000681-VP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFmJ-0008PD-SL
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:15 +0000
X-Inumbo-ID: 1009a636-76ff-40ad-946d-3548b37f4c6c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1009a636-76ff-40ad-946d-3548b37f4c6c;
	Thu, 29 Oct 2020 21:48:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ij9ahlAtDagmSPTZ+yG0oCs78dP6C/dSdl2SS6HeMzk=; b=OGJ+9Ef/VXNqlSxUx/jAFhETsE
	qjgm2Az8O/CpD1twtfPXdo0spX6bdN77YziGTKtm7onnLpxvZAu1s7tIFjpgVTmFH7bWOAaLWYzs2
	odXElPreeiPbMzTcN9ccHPS7j2KdXuWG0MRymrPRWAaLe/fiLQRJHuVf55EbGXOZe+aY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmI-0000Ko-WF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmI-000681-VP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] msf2-soc, stellaris: Don't wire up SYSRESETREQ
Message-Id: <E1kYFmI-000681-VP@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:14 +0000

commit fc6bb6e67e2f2b81de765a1c1ad5956de625ab19
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    msf2-soc, stellaris: Don't wire up SYSRESETREQ
    
    The MSF2 SoC model and the Stellaris board code both wire
    SYSRESETREQ up to a function that just invokes
        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
    This is now the default action that the NVIC does if the line is
    not connected, so we can delete the handling code.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-4-peter.maydell@linaro.org
---
 hw/arm/msf2-soc.c  | 11 -----------
 hw/arm/stellaris.c | 12 ------------
 2 files changed, 23 deletions(-)

diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 33ea7df342..d2c29e82d1 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -30,7 +30,6 @@
 #include "hw/irq.h"
 #include "hw/arm/msf2-soc.h"
 #include "hw/misc/unimp.h"
-#include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 
 #define MSF2_TIMER_BASE       0x40004000
@@ -59,13 +58,6 @@ static const int spi_irq[MSF2_NUM_SPIS] = { 2, 3 };
 static const int uart_irq[MSF2_NUM_UARTS] = { 10, 11 };
 static const int timer_irq[MSF2_NUM_TIMERS] = { 14, 15 };
 
-static void do_sys_reset(void *opaque, int n, int level)
-{
-    if (level) {
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
-    }
-}
-
 static void m2sxxx_soc_initfn(Object *obj)
 {
     MSF2State *s = MSF2_SOC(obj);
@@ -130,9 +122,6 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
         return;
     }
 
-    qdev_connect_gpio_out_named(DEVICE(&s->armv7m.nvic), "SYSRESETREQ", 0,
-                                qemu_allocate_irq(&do_sys_reset, NULL, 0));
-
     system_clock_scale = NANOSECONDS_PER_SECOND / s->m3clk;
 
     for (i = 0; i < MSF2_NUM_UARTS; i++) {
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 28eb15c76c..5f9d080180 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -18,7 +18,6 @@
 #include "hw/boards.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
-#include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/armv7m.h"
 #include "hw/char/pl011.h"
@@ -1206,14 +1205,6 @@ static void stellaris_adc_init(Object *obj)
     qdev_init_gpio_in(dev, stellaris_adc_trigger, 1);
 }
 
-static
-void do_sys_reset(void *opaque, int n, int level)
-{
-    if (level) {
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
-    }
-}
-
 /* Board init.  */
 static stellaris_board_info stellaris_boards[] = {
   { "LM3S811EVB",
@@ -1317,9 +1308,6 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
     /* This will exit with an error if the user passed us a bad cpu_type */
     sysbus_realize_and_unref(SYS_BUS_DEVICE(nvic), &error_fatal);
 
-    qdev_connect_gpio_out_named(nvic, "SYSRESETREQ", 0,
-                                qemu_allocate_irq(&do_sys_reset, NULL, 0));
-
     if (board->dc1 & (1 << 16)) {
         dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000,
                                     qdev_get_gpio_in(nvic, 14),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15149.38030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmV-0008Qp-CI; Thu, 29 Oct 2020 21:48:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15149.38030; Thu, 29 Oct 2020 21:48:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmV-0008Qh-8p; Thu, 29 Oct 2020 21:48:27 +0000
Received: by outflank-mailman (input) for mailman id 15149;
 Thu, 29 Oct 2020 21:48:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFmU-0008QU-1b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ae9b8533-aed1-4385-9b1c-3ba1093e5ac1;
 Thu, 29 Oct 2020 21:48:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmT-0000Kw-3t
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmT-00068Y-2i
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFmU-0008QU-1b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:26 +0000
X-Inumbo-ID: ae9b8533-aed1-4385-9b1c-3ba1093e5ac1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ae9b8533-aed1-4385-9b1c-3ba1093e5ac1;
	Thu, 29 Oct 2020 21:48:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6uFAXso9Z1EfKqd0D/LXPKIyxKg8gCimqOK594LQywE=; b=2Tti/kqGSmEBBWrsTKWng+TayP
	GPEu4edD5SVhqx1uLA3rW305aE992cgkKnakLFeZzlGk7Q0V7Zx0eG3pktMbr/rY+Q6PYdqNCBa+G
	36BtSjo3ozWL7SviUPwawNy1VM5ABb0dq+/bhXVE4iCtd6NbdxSk8XK+3fbFItKc4wgs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmT-0000Kw-3t
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmT-00068Y-2i
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Fix AddPAC error indication
Message-Id: <E1kYFmT-00068Y-2i@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:25 +0000

commit 8796fe40dd30cd9ffd3c958906471715c923b341
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    target/arm: Fix AddPAC error indication
    
    The definition of top_bit used in this function is one higher
    than that used in the Arm ARM psuedo-code, which put the error
    indication at top_bit - 1 at the wrong place, which meant that
    it wasn't visible to Auth.
    
    Fixing the definition of top_bit requires more changes, because
    its most common use is for the count of bits in top_bit:bot_bit,
    which would then need to be computed as top_bit - bot_bit + 1.
    
    For now, prefer the minimal fix to the error indication alone.
    
    Fixes: 63ff0ca94cb
    Reported-by: Derrick McKee <derrick.mckee@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200728195706.11087-1-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: added comment about the divergence from the pseudocode]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/pauth_helper.c         |  6 +++++-
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/aarch64/pauth-5.c       | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c
index b909630317..6dbab03768 100644
--- a/target/arm/pauth_helper.c
+++ b/target/arm/pauth_helper.c
@@ -300,7 +300,11 @@ static uint64_t pauth_addpac(CPUARMState *env, uint64_t ptr, uint64_t modifier,
      */
     test = sextract64(ptr, bot_bit, top_bit - bot_bit);
     if (test != 0 && test != -1) {
-        pac ^= MAKE_64BIT_MASK(top_bit - 1, 1);
+        /*
+         * Note that our top_bit is one greater than the pseudocode's
+         * version, hence "- 2" here.
+         */
+        pac ^= MAKE_64BIT_MASK(top_bit - 2, 1);
     }
 
     /*
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index b617f2ac7e..e7249915e7 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -19,7 +19,7 @@ run-fcvt: fcvt
 
 # Pauth Tests
 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),)
-AARCH64_TESTS += pauth-1 pauth-2 pauth-4
+AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
 pauth-%: CFLAGS += -march=armv8.3-a
 run-pauth-%: QEMU_OPTS += -cpu max
 run-plugin-pauth-%: QEMU_OPTS += -cpu max
diff --git a/tests/tcg/aarch64/pauth-5.c b/tests/tcg/aarch64/pauth-5.c
new file mode 100644
index 0000000000..67c257918b
--- /dev/null
+++ b/tests/tcg/aarch64/pauth-5.c
@@ -0,0 +1,33 @@
+#include <assert.h>
+
+static int x;
+
+int main()
+{
+    int *p0 = &x, *p1, *p2, *p3;
+    unsigned long salt = 0;
+
+    /*
+     * With TBI enabled and a 48-bit VA, there are 7 bits of auth, and so
+     * a 1/128 chance of auth = pac(ptr,key,salt) producing zero.
+     * Find a salt that creates auth != 0.
+     */
+    do {
+        salt++;
+        asm("pacda %0, %1" : "=r"(p1) : "r"(salt), "0"(p0));
+    } while (p0 == p1);
+
+    /*
+     * This pac must fail, because the input pointer bears an encryption,
+     * and so is not properly extended within bits [55:47].  This will
+     * toggle bit 54 in the output...
+     */
+    asm("pacda %0, %1" : "=r"(p2) : "r"(salt), "0"(p1));
+
+    /* ... so that the aut must fail, setting bit 53 in the output ... */
+    asm("autda %0, %1" : "=r"(p3) : "r"(salt), "0"(p2));
+
+    /* ... which means this equality must not hold. */
+    assert(p3 != p0);
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15150.38034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmf-0008SE-Er; Thu, 29 Oct 2020 21:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15150.38034; Thu, 29 Oct 2020 21:48:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmf-0008S6-Bi; Thu, 29 Oct 2020 21:48:37 +0000
Received: by outflank-mailman (input) for mailman id 15150;
 Thu, 29 Oct 2020 21:48:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFme-0008Rx-A4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 264bf355-debb-4fde-bd9b-3c67aa3996fa;
 Thu, 29 Oct 2020 21:48:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmd-0000L6-7e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmd-00069D-70
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFme-0008Rx-A4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:36 +0000
X-Inumbo-ID: 264bf355-debb-4fde-bd9b-3c67aa3996fa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 264bf355-debb-4fde-bd9b-3c67aa3996fa;
	Thu, 29 Oct 2020 21:48:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G/1O3HNskvfU6TjE4iHfnzi9nEJ5xN0ssLF7ypOnJwg=; b=UnTEP2eX1Poueg/dIdA7nBX3Hk
	Mys7x1pObglDr2uBc5GcZRQrSx4CTp+xnR04kKR6fag0TCyVGHlj5HHO7QRSXNYKfWliGEdbxKUsR
	3lqfGSPiMdzwUEV82SqY9v05jCl5j+D/K8q1zuX+UanMwj63GoTwFS9rhnS7rU0QRc60=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmd-0000L6-7e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmd-00069D-70
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Avoid maybe-uninitialized warning with gcc 4.9
Message-Id: <E1kYFmd-00069D-70@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:35 +0000

commit 88a90e3de6ae99cbcfcc04c862c51f241fdf685f
Author:     Kaige Li <likaige@loongson.cn>
AuthorDate: Mon Aug 3 17:55:04 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:04 2020 +0100

    target/arm: Avoid maybe-uninitialized warning with gcc 4.9
    
    GCC version 4.9.4 isn't clever enough to figure out that all
    execution paths in disas_ldst() that use 'fn' will have initialized
    it first, and so it warns:
    
    /home/LiKaige/qemu/target/arm/translate-a64.c: In function ‘disas_ldst’:
    /home/LiKaige/qemu/target/arm/translate-a64.c:3392:5: error: ‘fn’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         fn(cpu_reg(s, rt), clean_addr, tcg_rs, get_mem_index(s),
         ^
    /home/LiKaige/qemu/target/arm/translate-a64.c:3318:22: note: ‘fn’ was declared here
         AtomicThreeOpFn *fn;
                          ^
    
    Make it happy by initializing the variable to NULL.
    
    Signed-off-by: Kaige Li <likaige@loongson.cn>
    Message-id: 1596110248-7366-2-git-send-email-likaige@loongson.cn
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: Clean up commit message and note which gcc version this was]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/translate-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 8c0764957c..c98dfb17a8 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3315,7 +3315,7 @@ static void disas_ldst_atomic(DisasContext *s, uint32_t insn,
     bool r = extract32(insn, 22, 1);
     bool a = extract32(insn, 23, 1);
     TCGv_i64 tcg_rs, clean_addr;
-    AtomicThreeOpFn *fn;
+    AtomicThreeOpFn *fn = NULL;
 
     if (is_vector || !dc_isar_feature(aa64_atomics, s)) {
         unallocated_encoding(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15151.38038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmp-0008TW-G7; Thu, 29 Oct 2020 21:48:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15151.38038; Thu, 29 Oct 2020 21:48:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmp-0008TO-DB; Thu, 29 Oct 2020 21:48:47 +0000
Received: by outflank-mailman (input) for mailman id 15151;
 Thu, 29 Oct 2020 21:48:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFmo-0008TB-4p
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a679afe4-d3aa-417a-af89-5ba68bab9b52;
 Thu, 29 Oct 2020 21:48:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmn-0000LF-Aq
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmn-00069n-AA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFmo-0008TB-4p
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:46 +0000
X-Inumbo-ID: a679afe4-d3aa-417a-af89-5ba68bab9b52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a679afe4-d3aa-417a-af89-5ba68bab9b52;
	Thu, 29 Oct 2020 21:48:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=i5xnXZxfgvifbOoCwzSMC4L7+UNSIuU+aUqwrlWI708=; b=wRFMRfmtaDIn0Jg8/BbROc+Vk6
	3Jg2vr1JNhipU85nPyW5ZBdLhZjrIV9EsKhcKh4C2Kwi9NVKytVvdC9pXN7IbIHXFlA8XSlZFNXeb
	npMYj9OrbiLaojGmBeldgg5Lb01xJNUQ5Wj1Gs+6d1XnybL+Cbey0VquOp+/co4A9rWk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmn-0000LF-Aq
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmn-00069n-AA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/arm/nrf51_soc: Set system_clock_scale
Message-Id: <E1kYFmn-00069n-AA@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:45 +0000

commit ce4f70e81ed23c93ff39234672aff33114532640
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 20:34:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:31 2020 +0100

    hw/arm/nrf51_soc: Set system_clock_scale
    
    The nrf51 SoC model wasn't setting the system_clock_scale
    global.which meant that if guest code used the systick timer in "use
    the processor clock" mode it would hang because time never advances.
    
    Set the global to match the documented CPU clock speed for this SoC.
    
    This SoC in fact doesn't have a SysTick timer (which is the only thing
    currently that cares about the system_clock_scale), because it's
    a configurable option in the Cortex-M0. However our Cortex-M0 and
    thus our nrf51 and our micro:bit board do provide a SysTick, so
    we ought to provide a functional one rather than a broken one.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200727193458.31250-1-peter.maydell@linaro.org
---
 hw/arm/nrf51_soc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c
index 45e6cc97d7..e15981e019 100644
--- a/hw/arm/nrf51_soc.c
+++ b/hw/arm/nrf51_soc.c
@@ -32,6 +32,9 @@
 
 #define BASE_TO_IRQ(base) ((base >> 12) & 0x1F)
 
+/* HCLK (the main CPU clock) on this SoC is always 16MHz */
+#define HCLK_FRQ 16000000
+
 static uint64_t clock_read(void *opaque, hwaddr addr, unsigned int size)
 {
     qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " [%u]\n",
@@ -65,6 +68,8 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
         return;
     }
 
+    system_clock_scale = NANOSECONDS_PER_SECOND / HCLK_FRQ;
+
     object_property_set_link(OBJECT(&s->cpu), "memory", OBJECT(&s->container),
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), errp)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:48:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:48:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15152.38042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmz-0008Up-IG; Thu, 29 Oct 2020 21:48:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15152.38042; Thu, 29 Oct 2020 21:48:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFmz-0008Uh-Ek; Thu, 29 Oct 2020 21:48:57 +0000
Received: by outflank-mailman (input) for mailman id 15152;
 Thu, 29 Oct 2020 21:48:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFmy-0008UX-8n
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e83b2bb-03ae-4155-bb00-0de72122d7c1;
 Thu, 29 Oct 2020 21:48:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmx-0000LR-EE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFmx-0006AH-DY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFmy-0008UX-8n
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:56 +0000
X-Inumbo-ID: 6e83b2bb-03ae-4155-bb00-0de72122d7c1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e83b2bb-03ae-4155-bb00-0de72122d7c1;
	Thu, 29 Oct 2020 21:48:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sRaEAjVhamxHDvsx06la6xpaf+TAoVflMAZ7qjNrMgQ=; b=aecLeD7d32KIR8pY52y31gnawm
	ctvl3HFs4qRIVcsIlt342LFelwPbh9n7WLXmd+nvc8w9JXtrFnHeHoqhoHJ34uq3+j/a7/qwy/Pki
	FgLcA6YRzcHrC2FopCo5y0HLGkUlAHhfU3cyW9SqaNOcoZW1+hPOP/xJaxkj2gC+HQjs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmx-0000LR-EE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFmx-0006AH-DY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:48:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/timer/imx_epit: Avoid assertion when CR.SWR is written
Message-Id: <E1kYFmx-0006AH-DY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:48:55 +0000

commit 13557fd392890cbd985bceba7f717e01efd674b8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 16:45:50 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:56:11 2020 +0100

    hw/timer/imx_epit: Avoid assertion when CR.SWR is written
    
    The imx_epit device has a software-controllable reset triggered by
    setting the SWR bit in the CR register. An error in commit cc2722ec83ad9
    means that we will end up assert()ing if the guest does this, because
    the code in imx_epit_write() starts ptimer transactions, and then
    imx_epit_reset() also starts ptimer transactions, triggering
    "ptimer_transaction_begin: Assertion `!s->in_transaction' failed".
    
    The cleanest way to avoid this double-transaction is to move the
    start-transaction for the CR write handling down below the check of
    the SWR bit.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1880424
    Fixes: cc2722ec83ad944505fe
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200727154550.3409-1-peter.maydell@linaro.org
---
 hw/timer/imx_epit.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index baf6338e1a..ebd58254d1 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -199,15 +199,22 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
 
     switch (offset >> 2) {
     case 0: /* CR */
-        ptimer_transaction_begin(s->timer_cmp);
-        ptimer_transaction_begin(s->timer_reload);
 
         oldcr = s->cr;
         s->cr = value & 0x03ffffff;
         if (s->cr & CR_SWR) {
             /* handle the reset */
             imx_epit_reset(DEVICE(s));
-        } else {
+            /*
+             * TODO: could we 'break' here? following operations appear
+             * to duplicate the work imx_epit_reset() already did.
+             */
+        }
+
+        ptimer_transaction_begin(s->timer_cmp);
+        ptimer_transaction_begin(s->timer_reload);
+
+        if (!(s->cr & CR_SWR)) {
             imx_epit_set_freq(s);
         }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15153.38048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFn9-00004z-Ju; Thu, 29 Oct 2020 21:49:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15153.38048; Thu, 29 Oct 2020 21:49:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFn9-0008WU-GD; Thu, 29 Oct 2020 21:49:07 +0000
Received: by outflank-mailman (input) for mailman id 15153;
 Thu, 29 Oct 2020 21:49:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFn8-0008WJ-Ki
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9b5d5725-272e-47b6-96ee-293737a03f88;
 Thu, 29 Oct 2020 21:49:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFn7-0000MQ-IJ
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFn7-0006Aw-HX
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFn8-0008WJ-Ki
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:06 +0000
X-Inumbo-ID: 9b5d5725-272e-47b6-96ee-293737a03f88
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9b5d5725-272e-47b6-96ee-293737a03f88;
	Thu, 29 Oct 2020 21:49:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rvn1KzAdXk49X/vqQHnwLDocw2T3CYhdzyCvtoWGVbE=; b=YU1gfB6odRWr4CAjYQdxNv8HJb
	3x1kKphXx7NgPmdlkOAxDh1AFrrIwGPzIVqqSPKKVUA5iOuJFptotkmyMgYWIhZ6B4bm2H66V9241
	yMlROEkyrolKVmME2mJ8XNULp8moO7qhiHY8fgnU8JAmZzk78L5TJgBMSiLGQ4YjwhCo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFn7-0000MQ-IJ
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFn7-0006Aw-HX
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200803' into staging
Message-Id: <E1kYFn7-0006Aw-HX@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:05 +0000

commit 5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10
Merge: 45a150aa2b3492acf6691c7bdbeb25a8545d8345 13557fd392890cbd985bceba7f717e01efd674b8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 20:34:26 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 20:34:26 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200803' into staging
    
    target-arm queue:
     * hw/timer/imx_epit: Avoid assertion when CR.SWR is written
     * netduino2, netduinoplus2, microbit: set system_clock_scale so that
       SysTick running on the CPU clock works
     * target/arm: Avoid maybe-uninitialized warning with gcc 4.9
     * target/arm: Fix AddPAC error indication
     * Make AIRCR.SYSRESETREQ actually reset the system for the
       microbit, mps2-*, musca-*, netduino* boards
    
    # gpg: Signature made Mon 03 Aug 2020 20:29:17 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200803:
      hw/timer/imx_epit: Avoid assertion when CR.SWR is written
      hw/arm/nrf51_soc: Set system_clock_scale
      target/arm: Avoid maybe-uninitialized warning with gcc 4.9
      target/arm: Fix AddPAC error indication
      msf2-soc, stellaris: Don't wire up SYSRESETREQ
      hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
      include/hw/irq.h: New function qemu_irq_is_connected()
      hw/arm/netduino2, netduinoplus2: Set system_clock_scale
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/arm/msf2-soc.c                 | 11 -----------
 hw/arm/netduino2.c                | 10 ++++++++++
 hw/arm/netduinoplus2.c            | 10 ++++++++++
 hw/arm/nrf51_soc.c                |  5 +++++
 hw/arm/stellaris.c                | 12 ------------
 hw/intc/armv7m_nvic.c             | 17 ++++++++++++++++-
 hw/timer/imx_epit.c               | 13 ++++++++++---
 include/hw/arm/armv7m.h           |  4 +++-
 include/hw/irq.h                  | 18 ++++++++++++++++++
 target/arm/pauth_helper.c         |  6 +++++-
 target/arm/translate-a64.c        |  2 +-
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/aarch64/pauth-5.c       | 33 +++++++++++++++++++++++++++++++++
 13 files changed, 112 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15154.38050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFnK-00006I-Ky; Thu, 29 Oct 2020 21:49:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15154.38050; Thu, 29 Oct 2020 21:49:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFnK-000069-Hj; Thu, 29 Oct 2020 21:49:18 +0000
Received: by outflank-mailman (input) for mailman id 15154;
 Thu, 29 Oct 2020 21:49:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFnI-000062-WE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 788f5d80-e4ff-4247-86c7-5f18cf56c1e6;
 Thu, 29 Oct 2020 21:49:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnH-0000Mb-TT
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnH-0006Bn-SH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFnI-000062-WE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:17 +0000
X-Inumbo-ID: 788f5d80-e4ff-4247-86c7-5f18cf56c1e6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 788f5d80-e4ff-4247-86c7-5f18cf56c1e6;
	Thu, 29 Oct 2020 21:49:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HAqYlfnuwUi3TfLPffPyehiYJOwvNSMNeGJ+WCKRNe4=; b=hLb+2F5xFvnuyi3w8tuJ+9xZfo
	eIVoh8TQgTMRn7gYTxzUrICf4qavM4prHAIQnX0VRUoOOilaCE452bpYtC59C2dbZagI7H1/yfFyv
	LPRbRdM2bSpPdWOZ3+U13OyvR30AZi1JQrdhOfEDjvcKngwZY0KMXO67Fkp6QU5E+cw0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnH-0000Mb-TT
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnH-0006Bn-SH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Message-Id: <E1kYFnH-0006Bn-SH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:15 +0000

commit f81cddfe8abe7d7e2220e611ee69d2cdf34eb789
Author:     Lukas Straub <lukasstraub2@web.de>
AuthorDate: Fri Jul 31 07:06:04 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Aug 4 14:14:48 2020 +0800

    colo-compare: Remove superfluous NULL-pointer checks for s->iothread
    
    s->iothread is checked for NULL on object creation in colo_compare_complete,
    so it's guaranteed not to be NULL.
    This resolves a false alert from Coverity (CID 1429969).
    
    Signed-off-by: Lukas Straub <lukasstraub2@web.de>
    Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/colo-compare.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index cc15f23dea..2c20de1537 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -1442,9 +1442,7 @@ static void colo_compare_finalize(Object *obj)
         qemu_chr_fe_deinit(&s->chr_notify_dev, false);
     }
 
-    if (s->iothread) {
-        colo_compare_timer_del(s);
-    }
+    colo_compare_timer_del(s);
 
     qemu_bh_delete(s->event_bh);
 
@@ -1470,9 +1468,7 @@ static void colo_compare_finalize(Object *obj)
         g_hash_table_destroy(s->connection_track_table);
     }
 
-    if (s->iothread) {
-        object_unref(OBJECT(s->iothread));
-    }
+    object_unref(OBJECT(s->iothread));
 
     g_free(s->pri_indev);
     g_free(s->sec_indev);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15155.38054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFnU-00007o-MR; Thu, 29 Oct 2020 21:49:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15155.38054; Thu, 29 Oct 2020 21:49:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFnU-00007e-JD; Thu, 29 Oct 2020 21:49:28 +0000
Received: by outflank-mailman (input) for mailman id 15155;
 Thu, 29 Oct 2020 21:49:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFnS-00007P-Uv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6dfd176e-caae-4cdb-a9c5-b29e0f68e66b;
 Thu, 29 Oct 2020 21:49:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnS-0000Mi-0v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnS-0006CI-02
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFnS-00007P-Uv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
X-Inumbo-ID: 6dfd176e-caae-4cdb-a9c5-b29e0f68e66b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6dfd176e-caae-4cdb-a9c5-b29e0f68e66b;
	Thu, 29 Oct 2020 21:49:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vCwiKGo75b0HcwmJK/VEU7349Zwlh3/0IsDFt3UUHik=; b=HGlJp8Ga14HViWaJie40+brbYT
	O3PueDxgQe29IcvqnkuFiZ4yF/wsowzQf2xTJY/hOnebOU+BsIR/alvgiwKBlg6NVyDbe5a8Xvslt
	ML0Xsa72slornV+ylyoBkgB/heiWcjX3eXoJQivY3i80L00eYyDSn3XmJnA1LVd0L1Zg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnS-0000Mi-0v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnS-0006CI-02
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
Message-Id: <E1kYFnS-0006CI-02@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:26 +0000

commit 035e69b063835a5fd23cacabd63690a3d84532a8
Author:     Mauro Matteo Cascella <mcascell@redhat.com>
AuthorDate: Sat Aug 1 18:42:38 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Aug 4 14:14:48 2020 +0800

    hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
    
    An assertion failure issue was found in the code that processes network packets
    while adding data fragments into the packet context. It could be abused by a
    malicious guest to abort the QEMU process on the host. This patch replaces the
    affected assert() with a conditional statement, returning false if the current
    data fragment exceeds max_raw_frags.
    
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Reported-by: Ziming Zhang <ezrakiez@gmail.com>
    Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com>
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 9560e4a49e..da262edc3e 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -379,7 +379,10 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa,
     hwaddr mapped_len = 0;
     struct iovec *ventry;
     assert(pkt);
-    assert(pkt->max_raw_frags > pkt->raw_frags);
+
+    if (pkt->raw_frags >= pkt->max_raw_frags) {
+        return false;
+    }
 
     if (!len) {
         return true;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15156.38058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFne-000091-Op; Thu, 29 Oct 2020 21:49:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15156.38058; Thu, 29 Oct 2020 21:49:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFne-00008r-Kh; Thu, 29 Oct 2020 21:49:38 +0000
Received: by outflank-mailman (input) for mailman id 15156;
 Thu, 29 Oct 2020 21:49:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFnd-00008i-AY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4b29f97e-cb02-4fee-903f-76f54dbd9cf8;
 Thu, 29 Oct 2020 21:49:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnc-0000Mt-4w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnc-0006Co-3d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFnd-00008i-AY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:37 +0000
X-Inumbo-ID: 4b29f97e-cb02-4fee-903f-76f54dbd9cf8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4b29f97e-cb02-4fee-903f-76f54dbd9cf8;
	Thu, 29 Oct 2020 21:49:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MmqlCDdjw5EjgzsLsefsjiiAlOc7z47HsStXCgmiFhE=; b=zI4mfMeA78zBeYo9gktlFMvqhl
	K0/sIupAoMKI8bTKxYN6fUogOMXOuh7DyQVwzR5NzY6YQ6rXVfMQX6sO2miMQ6+kASyRkyistfTYZ
	80JtvIOGL0XAjqmlZpx1/Plld6jheXBOjXmND5c0sKqeZxZ/wgNbtinjm2SQMNWkW9pM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnc-0000Mt-4w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnc-0006Co-3d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYFnc-0006Co-3d@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:36 +0000

commit bcc983234ba0852729107acca3365ab5359dc0e0
Merge: 5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10 035e69b063835a5fd23cacabd63690a3d84532a8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 10:20:08 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 10:20:08 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Tue 04 Aug 2020 07:15:08 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
      colo-compare: Remove superfluous NULL-pointer checks for s->iothread
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/net_tx_pkt.c | 5 ++++-
 net/colo-compare.c  | 8 ++------
 2 files changed, 6 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15157.38062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFno-0000AY-Qe; Thu, 29 Oct 2020 21:49:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15157.38062; Thu, 29 Oct 2020 21:49:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFno-0000AQ-NX; Thu, 29 Oct 2020 21:49:48 +0000
Received: by outflank-mailman (input) for mailman id 15157;
 Thu, 29 Oct 2020 21:49:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFnn-0000AG-D1
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id faccb39e-6b80-473f-a036-1e9ce7b0e88d;
 Thu, 29 Oct 2020 21:49:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnm-0000N1-F3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnm-0006Dd-EH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFnn-0000AG-D1
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:47 +0000
X-Inumbo-ID: faccb39e-6b80-473f-a036-1e9ce7b0e88d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id faccb39e-6b80-473f-a036-1e9ce7b0e88d;
	Thu, 29 Oct 2020 21:49:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sx9yEwpNK0WU9V3Qtw7gjQXiWB6Hu6UY1zMxJnlcr8k=; b=cwNtS8Yol3Z+M4ymz23aER5cZh
	13iwu/4AeMsREoK8sG8fKluOO0fhN+cP6aGuUfjebehxiva+NKZJk+ZKk74+ePkw8TvQtbLefTNmd
	vr6Uc0tsrADuWBe5rDHt6kil+Q/75+mAUMI3MuGpSxK7BtyIUkYMZ3psI2teT5Ltn684=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnm-0000N1-F3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnm-0006Dd-EH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] accel/xen: Fix xen_enabled() behavior on target-agnostic objects
Message-Id: <E1kYFnm-0006Dd-EH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:46 +0000

commit 8e0ef068942e4152f0d23e76ca1f5e35dc4456f7
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Aug 4 09:49:30 2020 +0200
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Tue Aug 4 10:21:35 2020 +0100

    accel/xen: Fix xen_enabled() behavior on target-agnostic objects
    
    CONFIG_XEN is generated by configure and stored in "config-target.h",
    which is (obviously) only include for target-specific objects.
    This is a problem for target-agnostic objects as CONFIG_XEN is never
    defined and xen_enabled() is always inlined as 'false'.
    
    Fix by following the KVM schema, defining CONFIG_XEN_IS_POSSIBLE
    when we don't know to force the call of the non-inlined function,
    returning the xen_allowed boolean.
    
    Fixes: da278d58a092 ("accel: Move Xen accelerator code under accel/xen/")
    Reported-by: Paul Durrant <pdurrant@amazon.com>
    Suggested-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Message-Id: <20200804074930.13104-2-philmd@redhat.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 accel/stubs/xen-stub.c |  2 ++
 accel/xen/xen-all.c    |  7 +------
 include/sysemu/xen.h   | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/accel/stubs/xen-stub.c b/accel/stubs/xen-stub.c
index dcca4e678a..8ae658acff 100644
--- a/accel/stubs/xen-stub.c
+++ b/accel/stubs/xen-stub.c
@@ -9,6 +9,8 @@
 #include "hw/xen/xen.h"
 #include "qapi/qapi-commands-misc.h"
 
+bool xen_allowed;
+
 void xenstore_store_pv_console_info(int i, Chardev *chr)
 {
 }
diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
index 0c24d4b191..60b971d0a8 100644
--- a/accel/xen/xen-all.c
+++ b/accel/xen/xen-all.c
@@ -32,12 +32,7 @@
     do { } while (0)
 #endif
 
-static bool xen_allowed;
-
-bool xen_enabled(void)
-{
-    return xen_allowed;
-}
+bool xen_allowed;
 
 xc_interface *xen_xc;
 xenforeignmemory_handle *xen_fmem;
diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h
index 1ca292715e..2c2c429ea8 100644
--- a/include/sysemu/xen.h
+++ b/include/sysemu/xen.h
@@ -8,9 +8,19 @@
 #ifndef SYSEMU_XEN_H
 #define SYSEMU_XEN_H
 
-#ifdef CONFIG_XEN
+#ifdef NEED_CPU_H
+# ifdef CONFIG_XEN
+#  define CONFIG_XEN_IS_POSSIBLE
+# endif
+#else
+# define CONFIG_XEN_IS_POSSIBLE
+#endif
+
+#ifdef CONFIG_XEN_IS_POSSIBLE
+
+extern bool xen_allowed;
 
-bool xen_enabled(void);
+#define xen_enabled()           (xen_allowed)
 
 #ifndef CONFIG_USER_ONLY
 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
@@ -18,7 +28,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
                    struct MemoryRegion *mr, Error **errp);
 #endif
 
-#else /* !CONFIG_XEN */
+#else /* !CONFIG_XEN_IS_POSSIBLE */
 
 #define xen_enabled() 0
 #ifndef CONFIG_USER_ONLY
@@ -33,6 +43,6 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
 }
 #endif
 
-#endif /* CONFIG_XEN */
+#endif /* CONFIG_XEN_IS_POSSIBLE */
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:49:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:49:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15158.38066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFny-0000C4-SA; Thu, 29 Oct 2020 21:49:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15158.38066; Thu, 29 Oct 2020 21:49:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFny-0000Bu-Ow; Thu, 29 Oct 2020 21:49:58 +0000
Received: by outflank-mailman (input) for mailman id 15158;
 Thu, 29 Oct 2020 21:49:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFnx-0000Bl-Dh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id de126ec5-5ba8-492d-be4a-c1b056bec625;
 Thu, 29 Oct 2020 21:49:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnw-0000N4-Ia
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFnw-0006E9-Hf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFnx-0000Bl-Dh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:57 +0000
X-Inumbo-ID: de126ec5-5ba8-492d-be4a-c1b056bec625
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id de126ec5-5ba8-492d-be4a-c1b056bec625;
	Thu, 29 Oct 2020 21:49:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TqOF42q9mOZLLx/wYBMR9B84Ts3DJRS0ClDf98YPDtc=; b=HTkfgmRG+GkI4qLCcFBR7Peh/U
	i+UJofBNYGCMUdSlfCUOQlyMLeXaPlLboP9Vx7Ob0HQskgfCsfs1rQJAqCy6FT5PN9b8l1tv/Kina
	rKOtqWJJC3NbRB3HcXq8kUOeM6Rga3nu+pru28t8wCUDnew+lEjflslXwJYN5z3Ss3hU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnw-0000N4-Ia
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFnw-0006E9-Hf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:49:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200804' into staging
Message-Id: <E1kYFnw-0006E9-Hf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:49:56 +0000

commit d15532d91be177e7528310e0110e39f915779a99
Merge: bcc983234ba0852729107acca3365ab5359dc0e0 8e0ef068942e4152f0d23e76ca1f5e35dc4456f7
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 11:53:20 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 11:53:20 2020 +0100

    Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200804' into staging
    
    xen patch
    
    Bug fix.
    
    # gpg: Signature made Tue 04 Aug 2020 10:24:51 BST
    # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
    # gpg:                issuer "anthony.perard@citrix.com"
    # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
    # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
    #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
    
    * remotes/aperard/tags/pull-xen-20200804:
      accel/xen: Fix xen_enabled() behavior on target-agnostic objects
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/stubs/xen-stub.c |  2 ++
 accel/xen/xen-all.c    |  7 +------
 include/sysemu/xen.h   | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 10 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:50:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:50:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15159.38069 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFo9-0000tZ-TG; Thu, 29 Oct 2020 21:50:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15159.38069; Thu, 29 Oct 2020 21:50:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFo9-0000tR-QP; Thu, 29 Oct 2020 21:50:09 +0000
Received: by outflank-mailman (input) for mailman id 15159;
 Thu, 29 Oct 2020 21:50:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFo7-0000pY-U9
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fb30d6f1-d067-48e1-8b12-16146e1ed6ef;
 Thu, 29 Oct 2020 21:50:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFo6-0000Nt-Us
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFo6-0006F3-Tf
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFo7-0000pY-U9
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:07 +0000
X-Inumbo-ID: fb30d6f1-d067-48e1-8b12-16146e1ed6ef
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fb30d6f1-d067-48e1-8b12-16146e1ed6ef;
	Thu, 29 Oct 2020 21:50:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I2q+qAOENRqmITPhwUmQGE9DdI4RvxpiX9I+NXXLdPk=; b=UzoVz0ESqB2UG3+C+d0uiq/Icm
	73u4HTUig7dzhAcmB4elLqbcKRN4zg8020xTGi6zealWm37tdHchfcIvut9ygLUcj/oQzE78rmpea
	DHGsiJKJgUpApaqopzzNaxI1nyzSPW4URfWnj3AuRIaOwhEexuyIuw+WH9lm8omHi3vY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFo6-0000Nt-Us
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFo6-0006F3-Tf
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] virtio-mem: Correct format specifier mismatch for RISC-V
Message-Id: <E1kYFo6-0006F3-Tf@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:06 +0000

commit facc68516a7ee6d4992dc47b42b47c600b20b21d
Author:     Bruce Rogers <brogers@suse.com>
AuthorDate: Thu Jul 30 07:05:19 2020 -0600
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Tue Aug 4 11:48:17 2020 -0400

    virtio-mem: Correct format specifier mismatch for RISC-V
    
    This likely affects other, less popular host architectures as well.
    Less common host architectures under linux get QEMU_VMALLOC_ALIGN (from
    which VIRTIO_MEM_MIN_BLOCK_SIZE is derived) define to a variable of
    type uintptr, which isn't compatible with the format specifier used to
    print a user message. Since this particular usage of the underlying data
    seems unique to this file, the simple fix is to just cast
    QEMU_VMALLOC_ALIGN to uint32_t, which corresponds to the format specifier
    used.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Message-Id: <20200730130519.168475-1-brogers@suse.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
    Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index c12e9f79b0..7740fc613f 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -36,7 +36,7 @@
  * Use QEMU_VMALLOC_ALIGN, so no THP will have to be split when unplugging
  * memory (e.g., 2MB on x86_64).
  */
-#define VIRTIO_MEM_MIN_BLOCK_SIZE QEMU_VMALLOC_ALIGN
+#define VIRTIO_MEM_MIN_BLOCK_SIZE ((uint32_t)QEMU_VMALLOC_ALIGN)
 /*
  * Size the usable region bigger than the requested size if possible. Esp.
  * Linux guests will only add (aligned) memory blocks in case they fully
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:50:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:50:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15160.38075 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoJ-0000uq-VJ; Thu, 29 Oct 2020 21:50:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15160.38075; Thu, 29 Oct 2020 21:50:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoJ-0000ui-Ry; Thu, 29 Oct 2020 21:50:19 +0000
Received: by outflank-mailman (input) for mailman id 15160;
 Thu, 29 Oct 2020 21:50:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFoI-0000uZ-27
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7fa257b9-1cfc-4845-9630-4ffeb8b9a6cb;
 Thu, 29 Oct 2020 21:50:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFoH-0000O3-2v
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFoH-0006Fd-1L
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFoI-0000uZ-27
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:18 +0000
X-Inumbo-ID: 7fa257b9-1cfc-4845-9630-4ffeb8b9a6cb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7fa257b9-1cfc-4845-9630-4ffeb8b9a6cb;
	Thu, 29 Oct 2020 21:50:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vswTOax9iEc9r3HKA5PEHDqp9Mlposfc5rON4QhyyOA=; b=4fzWjRzHcggJe/nXdMEmwyLiAa
	LK59VMozvW7RTNzZ4aBKnnZYmbUBrj2J+BWruQEHisrhhLJ+Q0sjn2Z/dkh7tOiMixKoenXvobMiH
	pmRuMPO1tc23IiwjPZwxPBRY8CYqB/RgiT79gEEyOHV1Dm7RVh6episdkDdRapTVwJPc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFoH-0000O3-2v
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFoH-0006Fd-1L
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYFoH-0006Fd-1L@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:17 +0000

commit 881419b7117d5350c2a0288bfb79f2a83715df32
Merge: d15532d91be177e7528310e0110e39f915779a99 facc68516a7ee6d4992dc47b42b47c600b20b21d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 16:51:32 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:51:32 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio: bugfix
    
    A last minute bugfix.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Tue 04 Aug 2020 16:48:37 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-mem: Correct format specifier mismatch for RISC-V
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:50:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15161.38078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoU-0000w3-0Y; Thu, 29 Oct 2020 21:50:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15161.38078; Thu, 29 Oct 2020 21:50:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoT-0000vv-Te; Thu, 29 Oct 2020 21:50:29 +0000
Received: by outflank-mailman (input) for mailman id 15161;
 Thu, 29 Oct 2020 21:50:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFoS-0000vl-Fb
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 165b4c59-829e-49b7-802e-fc1a96d29d7c;
 Thu, 29 Oct 2020 21:50:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFoR-0000OL-E6
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFoR-0006GQ-Cy
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFoS-0000vl-Fb
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:28 +0000
X-Inumbo-ID: 165b4c59-829e-49b7-802e-fc1a96d29d7c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 165b4c59-829e-49b7-802e-fc1a96d29d7c;
	Thu, 29 Oct 2020 21:50:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=efY7COYPX83Vz42sFakppuTitxc3FKNIb0PgqT32Asw=; b=XGMuecffn2qwfn8Q8lXmV6RpBm
	3bcxFsHoPP5nx+FaD5oMgcK5frKLKmS4SCtj7c2O9U/QVjmwZ9fPmxkNq6u8xpRsijJjRyHjlEWbg
	LFq2XuSgvlMlkZgyXFKlW3CS1rTOQAkCl6730BYA4Hg4IJ/ma36PDgJbJJHIPCQyKqJc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFoR-0000OL-E6
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFoR-0006GQ-Cy
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] docs/devel: Document decodetree no-overlap groups
Message-Id: <E1kYFoR-0006GQ-Cy@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:27 +0000

commit ffdfca6fac7e87faf4d0815e5cbc31c4a53f7a3a
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Aug 3 13:57:08 2020 -0700
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:33:47 2020 +0100

    docs/devel: Document decodetree no-overlap groups
    
    When support for this feature went in, the update to the
    documentation was forgotten.
    
    Fixes: 067e8b0f45d6
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20200803205708.315829-1-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 docs/devel/decodetree.rst | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/docs/devel/decodetree.rst b/docs/devel/decodetree.rst
index ce7f52308f..74f66bf46e 100644
--- a/docs/devel/decodetree.rst
+++ b/docs/devel/decodetree.rst
@@ -173,18 +173,25 @@ Pattern Groups
 
 Syntax::
 
-  group    := '{' ( pat_def | group )+ '}'
-
-A *group* begins with a lone open-brace, with all subsequent lines
-indented two spaces, and ending with a lone close-brace.  Groups
-may be nested, increasing the required indentation of the lines
-within the nested group to two spaces per nesting level.
-
-Unlike ungrouped patterns, grouped patterns are allowed to overlap.
-Conflicts are resolved by selecting the patterns in order.  If all
-of the fixedbits for a pattern match, its translate function will
-be called.  If the translate function returns false, then subsequent
-patterns within the group will be matched.
+  group            := overlap_group | no_overlap_group
+  overlap_group    := '{' ( pat_def | group )+ '}'
+  no_overlap_group := '[' ( pat_def | group )+ ']'
+
+A *group* begins with a lone open-brace or open-bracket, with all
+subsequent lines indented two spaces, and ending with a lone
+close-brace or close-bracket.  Groups may be nested, increasing the
+required indentation of the lines within the nested group to two
+spaces per nesting level.
+
+Patterns within overlap groups are allowed to overlap.  Conflicts are
+resolved by selecting the patterns in order.  If all of the fixedbits
+for a pattern match, its translate function will be called.  If the
+translate function returns false, then subsequent patterns within the
+group will be matched.
+
+Patterns within no-overlap groups are not allowed to overlap, just
+the same as ungrouped patterns.  Thus no-overlap groups are intended
+to be nested inside overlap groups.
 
 The following example from PA-RISC shows specialization of the *or*
 instruction::
@@ -200,7 +207,7 @@ instruction::
 When the *cf* field is zero, the instruction has no side effects,
 and may be specialized.  When the *rt* field is zero, the output
 is discarded and so the instruction has no effect.  When the *rt2*
-field is zero, the operation is ``reg[rt] | 0`` and so encodes
+field is zero, the operation is ``reg[r1] | 0`` and so encodes
 the canonical register copy operation.
 
 The output from the generator might look like::
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:50:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15162.38082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoe-0000xM-25; Thu, 29 Oct 2020 21:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15162.38082; Thu, 29 Oct 2020 21:50:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFod-0000xE-VM; Thu, 29 Oct 2020 21:50:39 +0000
Received: by outflank-mailman (input) for mailman id 15162;
 Thu, 29 Oct 2020 21:50:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFoc-0000x3-9V
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d335104f-3ea0-491d-a4f7-96d2f7d080ae;
 Thu, 29 Oct 2020 21:50:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFob-0000OU-IA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFob-0006Gw-HM
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFoc-0000x3-9V
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:38 +0000
X-Inumbo-ID: d335104f-3ea0-491d-a4f7-96d2f7d080ae
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d335104f-3ea0-491d-a4f7-96d2f7d080ae;
	Thu, 29 Oct 2020 21:50:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j4+yyw5tb7TtaMRUeCTfwwlFvelrVssXtmvektEzcG4=; b=De8SGKPUSkhPfRJ4ybtDXR6aH7
	YxnQlobOkAwPvSVAnlEOFG7kq5PpdEdD0aDXtHkC0/YEz7/g1jIXFI5HKtUex9K8s4aj8bJ3wBOhR
	0DBZmY9R5Ol/TyYjP8QZ6A3bfupRhtks1moGf1IbplrV2JQor1YBjlaqW65dJCzNXoSg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFob-0000OU-IA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFob-0006Gw-HM
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Fix decode of LDRA[AB] instructions
Message-Id: <E1kYFob-0006Gw-HM@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:37 +0000

commit d250bb19ced3b702c7c37731855f6876d0cc7995
Author:     Peter Collingbourne <pcc@google.com>
AuthorDate: Mon Aug 3 17:28:49 2020 -0700
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:40:19 2020 +0100

    target/arm: Fix decode of LDRA[AB] instructions
    
    These instructions use zero as the discriminator, not SP.
    
    Signed-off-by: Peter Collingbourne <pcc@google.com>
    Message-id: 20200804002849.30268-1-pcc@google.com
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/translate-a64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index c98dfb17a8..534c3ff5f3 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3429,9 +3429,11 @@ static void disas_ldst_pac(DisasContext *s, uint32_t insn,
 
     if (s->pauth_active) {
         if (use_key_a) {
-            gen_helper_autda(dirty_addr, cpu_env, dirty_addr, cpu_X[31]);
+            gen_helper_autda(dirty_addr, cpu_env, dirty_addr,
+                             new_tmp_a64_zero(s));
         } else {
-            gen_helper_autdb(dirty_addr, cpu_env, dirty_addr, cpu_X[31]);
+            gen_helper_autdb(dirty_addr, cpu_env, dirty_addr,
+                             new_tmp_a64_zero(s));
         }
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:50:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:50:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15163.38087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoo-0000yc-4D; Thu, 29 Oct 2020 21:50:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15163.38087; Thu, 29 Oct 2020 21:50:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoo-0000yU-0e; Thu, 29 Oct 2020 21:50:50 +0000
Received: by outflank-mailman (input) for mailman id 15163;
 Thu, 29 Oct 2020 21:50:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFom-0000yJ-DY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 363875a2-5f03-468c-b4e4-e2f809e07af5;
 Thu, 29 Oct 2020 21:50:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFol-0000Oe-Ly
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFol-0006HS-LA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFom-0000yJ-DY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:48 +0000
X-Inumbo-ID: 363875a2-5f03-468c-b4e4-e2f809e07af5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 363875a2-5f03-468c-b4e4-e2f809e07af5;
	Thu, 29 Oct 2020 21:50:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dim7z1kdd40G+r3ndJsMhCAnVDsFtxL6VtjpKidVJvQ=; b=TgeqLl4YP8+MzNgdZMbucysw4p
	RUUFR4PZdt1B8UhUI5lUlfYiFMdtS94AsTWDutOWXP4XSlIc7kn9w822dQKbSDcDewbO4BWRRbKZk
	IE5WJ88hKy0o0RohzoxCHKTcN1YmwreBO7D5agXoO0/V4WAEE1VeJs5zEkHMKvk7qtUQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFol-0000Oe-Ly
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFol-0006HS-LA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200804' into staging
Message-Id: <E1kYFol-0006HS-LA@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:47 +0000

commit fd3cd581f9dcd11286daacaa5272e721c65aece8
Merge: 881419b7117d5350c2a0288bfb79f2a83715df32 d250bb19ced3b702c7c37731855f6876d0cc7995
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 18:20:32 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 18:20:32 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200804' into staging
    
    target-arm queue:
     * Fix decode of LDRA[AB] instructions
     * docs/devel: Document decodetree no-overlap groups
    
    # gpg: Signature made Tue 04 Aug 2020 17:08:11 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200804:
      target/arm: Fix decode of LDRA[AB] instructions
      docs/devel: Document decodetree no-overlap groups
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/devel/decodetree.rst  | 33 ++++++++++++++++++++-------------
 target/arm/translate-a64.c |  6 ++++--
 2 files changed, 24 insertions(+), 15 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15164.38090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoy-000105-6d; Thu, 29 Oct 2020 21:51:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15164.38090; Thu, 29 Oct 2020 21:51:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFoy-0000zx-3g; Thu, 29 Oct 2020 21:51:00 +0000
Received: by outflank-mailman (input) for mailman id 15164;
 Thu, 29 Oct 2020 21:50:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFow-0000zn-Tw
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e1d12d07-2eaa-4047-a6d9-6e73b6ea7070;
 Thu, 29 Oct 2020 21:50:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFow-0000Om-1w
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFow-0006Ik-19
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFow-0000zn-Tw
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
X-Inumbo-ID: e1d12d07-2eaa-4047-a6d9-6e73b6ea7070
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e1d12d07-2eaa-4047-a6d9-6e73b6ea7070;
	Thu, 29 Oct 2020 21:50:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OPF62K5oa06ze/GevC9R0iLOOPXnE1Wri5Hvwwqd9Hc=; b=19e1xGRSuui9dtDzoeSme1CWP+
	RBHPUnpPU8fga0xsOt0abjlgSfuOhbw+1bC0zNa8lTUNwXPhP3WNPTYoH4EFd3+jZzvCCx0BPmLZe
	TdKl0P5V26YA1IAeRI3tLAufksjWjZyFigmvIE9g9T650lKtpyG+fSm4bTekpHJZAJy4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFow-0000Om-1w
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFow-0006Ik-19
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:50:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/docker: Add python3-venv and netcat to the debian-amd64 container
Message-Id: <E1kYFow-0006Ik-19@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:50:58 +0000

commit 1caac1c0e4d5bdcf18c88ee184453b8ccfdaaee3
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 15 06:35:01 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:37:42 2020 +0200

    tests/docker: Add python3-venv and netcat to the debian-amd64 container
    
    Without python3-venv, I get the following message when trying to
    run the acceptance tests within the debian container:
    
     The virtual environment was not created successfully because ensurepip is not
     available.  On Debian/Ubuntu systems, you need to install the python3-venv
     package using the following command.
        apt-get install python3-venv
     You may need to use sudo with that command.  After installing the python3-venv
     package, recreate your virtual environment.
    
    Let's do it as the message suggests.
    
    And while we're at it, also add netcat here since it is required for
    some of the acceptance tests.
    
    Message-Id: <20200730141326.8260-2-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/docker/dockerfiles/debian-amd64.docker | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index 8fdfd6a6b0..d2500dcff1 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -20,7 +20,9 @@ RUN apt update && \
         librdmacm-dev \
         libsasl2-dev \
         libsnappy-dev \
-        libvte-dev
+        libvte-dev \
+        netcat-openbsd \
+        python3-venv
 
 # virgl
 RUN apt update && \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15165.38095 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFp9-00011u-8Y; Thu, 29 Oct 2020 21:51:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15165.38095; Thu, 29 Oct 2020 21:51:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFp9-00011k-5C; Thu, 29 Oct 2020 21:51:11 +0000
Received: by outflank-mailman (input) for mailman id 15165;
 Thu, 29 Oct 2020 21:51:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFp7-00011Y-37
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8053abb4-1df6-4313-b6ad-6dc2407756d9;
 Thu, 29 Oct 2020 21:51:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFp6-0000Pl-6C
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFp6-0006Jb-4e
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFp7-00011Y-37
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:09 +0000
X-Inumbo-ID: 8053abb4-1df6-4313-b6ad-6dc2407756d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8053abb4-1df6-4313-b6ad-6dc2407756d9;
	Thu, 29 Oct 2020 21:51:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bBldLmnntb7N/lhcTU2qH/m/UNj2kzQiOLhwv26XaUI=; b=hfwgfQ1ebJibh1+E6tqpmtFLNH
	awl+a0GUENtl4uxqgQ6RVyJvJmyeiVM/UmtFTlC/Ygp2NyXfdN/L6E1rPOrNFr6qt2Fj/L/3pOuPd
	iT0ArdzQqxjDKeF48gXkdOAFH/TVmU49bAEbaW6IzXrR6Zi9ByBMyKaUNrHwYXEkDoT4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFp6-0000Pl-6C
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFp6-0006Jb-4e
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
Message-Id: <E1kYFp6-0006Jb-4e@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:08 +0000

commit 4d6862ffc74622c34324537549b8ea19e7854ed5
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 23 08:36:04 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:38:27 2020 +0200

    tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
    
    These tests always time out on Gitlab, not sure what's happening here.
    Let's disable them until somebody has enough spare time to debug the
    issues.
    
    Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200730141326.8260-3-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/acceptance/machine_rx_gdbsim.py | 4 ++++
 tests/acceptance/replay_kernel.py     | 1 +
 2 files changed, 5 insertions(+)

diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machine_rx_gdbsim.py
index bff63e421d..0c72506028 100644
--- a/tests/acceptance/machine_rx_gdbsim.py
+++ b/tests/acceptance/machine_rx_gdbsim.py
@@ -8,6 +8,9 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
+import os
+
+from avocado import skipIf
 from avocado_qemu import Test
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
@@ -42,6 +45,7 @@ class RxGdbSimMachine(Test):
         # FIXME limit baudrate on chardev, else we type too fast
         #exec_command_and_wait_for_pattern(self, 'version', gcc_version)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_linux_sash(self):
         """
         Boots a Linux kernel and checks that the console is operational.
diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py
index 62d2db8c64..b79fc8daf8 100644
--- a/tests/acceptance/replay_kernel.py
+++ b/tests/acceptance/replay_kernel.py
@@ -126,6 +126,7 @@ class ReplayKernel(LinuxKernelTest):
 
         self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_arm_cubieboard_initrd(self):
         """
         :avocado: tags=arch:arm
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15166.38098 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpI-00012z-9x; Thu, 29 Oct 2020 21:51:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15166.38098; Thu, 29 Oct 2020 21:51:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpI-00012r-6c; Thu, 29 Oct 2020 21:51:20 +0000
Received: by outflank-mailman (input) for mailman id 15166;
 Thu, 29 Oct 2020 21:51:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFpH-00012k-FF
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e0403e53-e420-489e-a2a7-d3f4e4de8573;
 Thu, 29 Oct 2020 21:51:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpG-0000Pw-9X
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpG-0006K6-8o
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFpH-00012k-FF
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:19 +0000
X-Inumbo-ID: e0403e53-e420-489e-a2a7-d3f4e4de8573
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e0403e53-e420-489e-a2a7-d3f4e4de8573;
	Thu, 29 Oct 2020 21:51:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ng027VGnmF0s+4ykvaWkr/csDieHW6b+TUrbf8U1Tik=; b=q5+zMhLG1I9RDYnOyJsVGAEOp0
	2E2vSuj1SiQfd4FeSdMXbU99ubml6a0APVZfXY3n1IGPQ2aOtClcnALAlBdlrFe6OY4yetWavWn0K
	UA+/wPzJNLrcazd9O+oWkAqob0/ejMzghmlMjYuSt8rZFID5MP/oQS+rKWKJRXO84b+g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpG-0000Pw-9X
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpG-0006K6-8o
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
Message-Id: <E1kYFpG-0006K6-8o@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:18 +0000

commit 699616db6465b01580d5ddea18887a562206d928
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jul 14 17:35:45 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:39:21 2020 +0200

    gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
    
    We were missing the two new targets avr-softmmu and rx-softmmu in the
    gitlab-CI so far, and did not add some of the "other endianess" targets
    like sh4eb-softmmu yet.
    Since the current build-system-* jobs run already for a very long time,
    let's do not add these missing targets there, but introduce two new
    additional build jobs, one running with Debian and one running with
    CentOS, and add the new targets there. Also move some targets from
    the old build-system-* jobs to these new targets, to distribute the
    load and reduce the runtime of the CI.
    
    Message-Id: <20200730141326.8260-4-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 88 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 73 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 362e5ee755..e96bcd50f8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -53,68 +53,126 @@ include:
     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
     - du -chs $HOME/avocado/data/cache
 
-build-system-ubuntu-main:
+build-system-ubuntu:
   <<: *native_build_job_definition
   variables:
     IMAGE: ubuntu2004
-    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu
-      moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu
-      riscv64-softmmu sparc-softmmu
+    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
+      moxie-softmmu microblazeel-softmmu mips64el-softmmu
     MAKE_CHECK_ARGS: check-build
   artifacts:
     paths:
       - build
 
-check-system-ubuntu-main:
+check-system-ubuntu:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-ubuntu-main
+    - job: build-system-ubuntu
       artifacts: true
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check
 
-acceptance-system-ubuntu-main:
+acceptance-system-ubuntu:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-ubuntu-main
+    - job: build-system-ubuntu
       artifacts: true
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check-acceptance
   <<: *post_acceptance
 
-build-system-fedora-alt:
+build-system-debian:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: debian-amd64
+    TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
+      riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-debian:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-debian
+      artifacts: true
+  variables:
+    IMAGE: debian-amd64
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-debian:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-debian
+      artifacts: true
+  variables:
+    IMAGE: debian-amd64
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
+build-system-fedora:
   <<: *native_build_job_definition
   variables:
     IMAGE: fedora
     TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
-      riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu
-      xtensa-softmmu nios2-softmmu or1k-softmmu
+      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
     MAKE_CHECK_ARGS: check-build
   artifacts:
     paths:
       - build
 
-check-system-fedora-alt:
+check-system-fedora:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-fedora-alt
+    - job: build-system-fedora
       artifacts: true
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check
 
-acceptance-system-fedora-alt:
+acceptance-system-fedora:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-fedora-alt
+    - job: build-system-fedora
       artifacts: true
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check-acceptance
   <<: *post_acceptance
 
+build-system-centos:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos8
+    TARGETS: ppc64-softmmu lm32-softmmu or1k-softmmu s390x-softmmu
+      x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-centos:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-centos
+      artifacts: true
+  variables:
+    IMAGE: centos8
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-centos:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-centos
+      artifacts: true
+  variables:
+    IMAGE: centos8
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
 build-disabled:
   <<: *native_build_job_definition
   variables:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15167.38102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpS-00014h-BE; Thu, 29 Oct 2020 21:51:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15167.38102; Thu, 29 Oct 2020 21:51:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpS-00014Z-8I; Thu, 29 Oct 2020 21:51:30 +0000
Received: by outflank-mailman (input) for mailman id 15167;
 Thu, 29 Oct 2020 21:51:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFpR-00014Q-7h
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 52e4eb94-2290-4904-8b39-746f3c4f460e;
 Thu, 29 Oct 2020 21:51:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpQ-0000Q3-D0
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpQ-0006Ke-CB
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFpR-00014Q-7h
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:29 +0000
X-Inumbo-ID: 52e4eb94-2290-4904-8b39-746f3c4f460e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 52e4eb94-2290-4904-8b39-746f3c4f460e;
	Thu, 29 Oct 2020 21:51:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q2XMlsYMv1MseKm/bSbyXQwveor8xS7m1D60WsH6jbM=; b=jqf/bml6kosYV23NcFO0k8N8il
	npu/kSQmLiLGOLc8C11/8Ev8vA5mwp124wCrGLk4xZ3HJ+FnQmSCNvb2y0+FM+r4j10d+9aAPecss
	wecX3x/zIAoL44VnKuHj7Q1rSj24FqO1Qf0JcXIijlcdPrvEEUXYEKKMd8iAZvXUm6vQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpQ-0000Q3-D0
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpQ-0006Ke-CB
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] gitlab-ci: Fix Avocado cache usage
Message-Id: <E1kYFpQ-0006Ke-CB@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:28 +0000

commit 5896c5395476ca30caad6ddd48d4b9dca2c63c00
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 30 10:35:48 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:39:55 2020 +0200

    gitlab-ci: Fix Avocado cache usage
    
    In commit 6957fd98dc ("gitlab: add avocado asset caching") we
    tried to save the Avocado cache (as in commit c1073e44b4 with
    Travis-CI) however it doesn't work as expected. For some reason
    Avocado uses /root/avocado_cache/ which we can not select later.
    
    Manually generate a Avocado config to force the use of the
    current job's directory.
    
    This patch is based on an earlier version from Philippe Mathieu-Daudé.
    
    Message-Id: <20200730141326.8260-5-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e96bcd50f8..9820066379 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,11 +47,24 @@ include:
     - find . -type f -exec touch {} +
     - make $MAKE_CHECK_ARGS
 
-.post_acceptance_template: &post_acceptance
+.acceptance_template: &acceptance_definition
+  cache:
+    key: "${CI_JOB_NAME}-cache"
+    paths:
+      - ${CI_PROJECT_DIR}/avocado-cache
+    policy: pull-push
+  before_script:
+    - mkdir -p ~/.config/avocado
+    - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
+    - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
+           >> ~/.config/avocado/avocado.conf
+    - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
+        du -chs ${CI_PROJECT_DIR}/avocado-cache ;
+      fi
   after_script:
     - cd build
     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
-    - du -chs $HOME/avocado/data/cache
+    - du -chs ${CI_PROJECT_DIR}/avocado-cache
 
 build-system-ubuntu:
   <<: *native_build_job_definition
@@ -81,7 +94,7 @@ acceptance-system-ubuntu:
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-debian:
   <<: *native_build_job_definition
@@ -111,7 +124,7 @@ acceptance-system-debian:
   variables:
     IMAGE: debian-amd64
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-fedora:
   <<: *native_build_job_definition
@@ -141,7 +154,7 @@ acceptance-system-fedora:
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-centos:
   <<: *native_build_job_definition
@@ -171,7 +184,7 @@ acceptance-system-centos:
   variables:
     IMAGE: centos8
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-disabled:
   <<: *native_build_job_definition
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15168.38106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpc-000164-Ce; Thu, 29 Oct 2020 21:51:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15168.38106; Thu, 29 Oct 2020 21:51:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpc-00015w-9q; Thu, 29 Oct 2020 21:51:40 +0000
Received: by outflank-mailman (input) for mailman id 15168;
 Thu, 29 Oct 2020 21:51:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFpb-00015n-C3
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 31f20d0d-7ff2-45c8-9aff-9c2f401483c5;
 Thu, 29 Oct 2020 21:51:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpa-0000QG-Gg
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpa-0006LE-Fv
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFpb-00015n-C3
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:39 +0000
X-Inumbo-ID: 31f20d0d-7ff2-45c8-9aff-9c2f401483c5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 31f20d0d-7ff2-45c8-9aff-9c2f401483c5;
	Thu, 29 Oct 2020 21:51:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KevXCe9O7owbu1DO48Ud9B/fnfwTLghFw3XSXh6PqFU=; b=ifbj7+XqSclL01aNb+/gsEnqFF
	8feX2t7t0mVA2Nal/vfbHYK4ECv7q1N4CLeTu1Y0yC3bANDOzTkdgyy3ov9K5OSoqX0Q2EwBjvs3d
	0KOhwCBWnn04eKHbcGzM0zrScIpNvlRzbZ8M4lgD8rCBccRPgiyi1qCW/5S8aGhO7FH0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpa-0000QG-Gg
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpa-0006LE-Fv
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/riscv/vector_helper: Fix build on 32-bit big endian hosts
Message-Id: <E1kYFpa-0006LE-Fv@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:38 +0000

commit 35c7f5254b608c0694b11fc9f0d2c1a4ffb216b4
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Aug 3 19:54:36 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:43:45 2020 +0200

    target/riscv/vector_helper: Fix build on 32-bit big endian hosts
    
    The code currently fails to compile on 32-bit big endian hosts:
    
     target/riscv/vector_helper.c: In function 'vext_clear':
     target/riscv/vector_helper.c:154:16: error: cast to pointer from integer
     of different size [-Werror=int-to-pointer-cast]
             memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
                    ^
     target/riscv/vector_helper.c:155:16: error: cast to pointer from integer
     of different size [-Werror=int-to-pointer-cast]
             memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
                    ^
     cc1: all warnings being treated as errors
    
    We should not use "long long" (i.e. 64-bit) values here to avoid the
    problem. Switch to our QEMU_ALIGN_PTR_DOWN/UP macros instead.
    
    Fixes: 751538d5da ("add vector stride load and store instructions")
    Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200804170055.2851-3-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/riscv/vector_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index 39f44d1029..793af99067 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -151,8 +151,8 @@ static void vext_clear(void *tail, uint32_t cnt, uint32_t tot)
     if (cnt % 8) {
         part1 = 8 - (cnt % 8);
         part2 = tot - cnt - part1;
-        memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
-        memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
+        memset(QEMU_ALIGN_PTR_DOWN(tail, 8), 0, part1);
+        memset(QEMU_ALIGN_PTR_UP(tail, 8), 0, part2);
     } else {
         memset(tail, 0, part2);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:51:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:51:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15169.38111 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpm-00017L-Es; Thu, 29 Oct 2020 21:51:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15169.38111; Thu, 29 Oct 2020 21:51:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpm-00017D-BO; Thu, 29 Oct 2020 21:51:50 +0000
Received: by outflank-mailman (input) for mailman id 15169;
 Thu, 29 Oct 2020 21:51:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFpl-000175-W7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a6705b57-2e6c-4adf-a3f4-2997a6a1de45;
 Thu, 29 Oct 2020 21:51:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpk-0000QN-KW
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpk-0006Li-Jj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFpl-000175-W7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:50 +0000
X-Inumbo-ID: a6705b57-2e6c-4adf-a3f4-2997a6a1de45
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a6705b57-2e6c-4adf-a3f4-2997a6a1de45;
	Thu, 29 Oct 2020 21:51:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yg9sxBvSO5dH3YDPuQWL0LHA4bxQSDxSKDcaM3mugC0=; b=OOLtTMuRDDdLBDjxrdLvxW+ZKS
	4UFyLSVaclHOAyfGHeg/Qr5lp4l1SfZ5oHfhkrv58gxJRftIM39GC+pPQCueIGHANU9/aGhz5shkg
	vo+Hb7YBBqj5L5Ixq/9nFGfw1gLtgfBJFBRrpJYCpFb6dI/+Sk4d0kzedVfwrezQkVF8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpk-0000QN-KW
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpk-0006Li-Jj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Get rid of the libqemustub.a remainders
Message-Id: <E1kYFpk-0006Li-Jj@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:48 +0000

commit d2a71d7474d4649eabe554994a3fcba75244cce3
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Aug 3 21:14:57 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 11:45:43 2020 +0200

    Get rid of the libqemustub.a remainders
    
    libqemustub.a has been removed in commit ebedb37c8d ("Makefile: Remove
    libqemustub.a"). Some remainders have been missed. Remove them now.
    
    Message-Id: <20200804170055.2851-8-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Makefile                                | 2 +-
 scripts/coverity-scan/run-coverity-scan | 3 ---
 tests/test-util-sockets.c               | 3 ++-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index c2120d8d48..13dd708c4a 100644
--- a/Makefile
+++ b/Makefile
@@ -726,7 +726,7 @@ virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
 	$(call LINK, $^)
 endif
 
-vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
+vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a
 	$(call LINK, $^)
 
 ifdef CONFIG_VHOST_USER_INPUT
diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan
index 03a791dec9..6eefb4b558 100755
--- a/scripts/coverity-scan/run-coverity-scan
+++ b/scripts/coverity-scan/run-coverity-scan
@@ -403,9 +403,6 @@ echo "Configuring..."
     --enable-mpath --enable-libxml2 --enable-glusterfs \
     --enable-virtfs --enable-zstd
 
-echo "Making libqemustub.a..."
-make libqemustub.a
-
 echo "Running cov-build..."
 rm -rf cov-int
 mkdir cov-int
diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index 2ca1e99f17..261dc48c03 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -64,7 +64,8 @@ int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp)
     return dup(mon_fd);
 }
 
-/* Syms in libqemustub.a are discarded at .o file granularity.
+/*
+ * Syms of stubs in libqemuutil.a are discarded at .o file granularity.
  * To replace monitor_get_fd() we must ensure everything in
  * stubs/monitor.c is defined, to make sure monitor.o is discarded
  * otherwise we get duplicate syms at link time.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15170.38114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpw-00018n-HQ; Thu, 29 Oct 2020 21:52:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15170.38114; Thu, 29 Oct 2020 21:52:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFpw-00018f-Ea; Thu, 29 Oct 2020 21:52:00 +0000
Received: by outflank-mailman (input) for mailman id 15170;
 Thu, 29 Oct 2020 21:52:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFpv-00018Z-VE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 05b7c9fa-0813-4ef5-9ec6-c8aaa4fb8137;
 Thu, 29 Oct 2020 21:51:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpu-0000QW-OH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFpu-0006MF-Nc
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFpv-00018Z-VE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:59 +0000
X-Inumbo-ID: 05b7c9fa-0813-4ef5-9ec6-c8aaa4fb8137
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 05b7c9fa-0813-4ef5-9ec6-c8aaa4fb8137;
	Thu, 29 Oct 2020 21:51:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AxGTbnkv+IT7t3tbg3kgw4N3krMkXEqdY0W+zJ1uPqY=; b=bejU/DEFv6/yh8ScpfT7vq0jcb
	UxixcLxAsRXHr0LmpACV11xd6687+D09MBIhur3vTV0suiGXwXH00wSTdImNxtcVQHpDLMDtcgdRB
	saigGlVDrYzVEBgxoeT0KaUiguykT6Xg9n3YtAH6cD9+BBiygpPUqU1YopB5A/PD8+zw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpu-0000QW-OH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFpu-0006MF-Nc
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:51:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-08-05' into staging
Message-Id: <E1kYFpu-0006MF-Nc@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:51:58 +0000

commit 616dab9afc904923554c151011c817ff3191ecde
Merge: fd3cd581f9dcd11286daacaa5272e721c65aece8 d2a71d7474d4649eabe554994a3fcba75244cce3
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Aug 5 11:02:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 11:02:46 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-08-05' into staging
    
    * Test rx-softmmu, avr-softmmu, Centos7 and Debian on gitlab-CI
    * Fix compiler warning on 32-bit big endian systems
    * Remove remainders of libqemustub.a
    
    # gpg: Signature made Wed 05 Aug 2020 10:51:32 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-08-05:
      Get rid of the libqemustub.a remainders
      target/riscv/vector_helper: Fix build on 32-bit big endian hosts
      gitlab-ci: Fix Avocado cache usage
      gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
      tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
      tests/docker: Add python3-venv and netcat to the debian-amd64 container
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml                               | 109 ++++++++++++++++++++++-----
 Makefile                                     |   2 +-
 scripts/coverity-scan/run-coverity-scan      |   3 -
 target/riscv/vector_helper.c                 |   4 +-
 tests/acceptance/machine_rx_gdbsim.py        |   4 +
 tests/acceptance/replay_kernel.py            |   1 +
 tests/docker/dockerfiles/debian-amd64.docker |   4 +-
 tests/test-util-sockets.c                    |   3 +-
 8 files changed, 103 insertions(+), 27 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15171.38119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFq7-0001Ao-JS; Thu, 29 Oct 2020 21:52:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15171.38119; Thu, 29 Oct 2020 21:52:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFq7-0001Ae-G7; Thu, 29 Oct 2020 21:52:11 +0000
Received: by outflank-mailman (input) for mailman id 15171;
 Thu, 29 Oct 2020 21:52:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFq6-0001AY-Kj
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1ceaaf73-2465-4127-99d9-47175aafd7dc;
 Thu, 29 Oct 2020 21:52:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFq4-0000RM-Rs
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFq4-0006Mt-R4
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFq6-0001AY-Kj
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:10 +0000
X-Inumbo-ID: 1ceaaf73-2465-4127-99d9-47175aafd7dc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1ceaaf73-2465-4127-99d9-47175aafd7dc;
	Thu, 29 Oct 2020 21:52:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6sEL4Sa++HL46tvN571lz1Vj8Ut0h7CFQa3lxEc46OI=; b=pFk5dB/77P/T25qxfi4Xx9za2n
	m4UBhMxBWT08UKyR29KrhbvNdsyWfL66gs6Qp41x0bF4p/L45lV1xoT+ND6zraogpffxuiAqddt29
	AeiUtPwPcRjwH8IH41DAUtILOmI13hC9Br3MMitTJC3qysNg92dHCbL9Q7OY2b9LCNc4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFq4-0000RM-Rs
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFq4-0006Mt-R4
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
Message-Id: <E1kYFq4-0006Mt-R4@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:08 +0000

commit 348fcc4f7ace1718006e646078d88c8cd8c1d97e
Author:     Tuguoyi <tu.guoyi@h3c.com>
AuthorDate: Wed Aug 5 09:22:58 2020 +0000
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 14:56:11 2020 +0100

    qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
    
    When calculating the offset, the result of left shift operation will be promoted
    to type int64 automatically because the left operand of + operator is uint64_t.
    but the result after integer promotion may be produce an error value for us and
    trigger the following asserting error.
    
    For example, consider i=0x2000, cluster_bits=18, the result of left shift
    operation will be 0x80000000. Cause argument i is of signed integer type,
    the result is automatically promoted to 0xffffffff80000000 which is not
    we expected
    
    The way to trigger the assertion error:
      qemu-img create -f qcow2 -o preallocation=full,cluster_size=256k tmpdisk 10G
    
    This patch fix it by casting @i to uint64_t before doing left shift operation
    
    Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Reviewed-by: Alberto Garcia <berto@igalia.com>
    Message-id: 81ba90fe0c014f269621c283269b42ad@h3c.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 block/qcow2-cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index a677ba9f5c..550850b264 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -980,7 +980,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m)
 
     assert(l2_index + m->nb_clusters <= s->l2_slice_size);
     for (i = 0; i < m->nb_clusters; i++) {
-        uint64_t offset = cluster_offset + (i << s->cluster_bits);
+        uint64_t offset = cluster_offset + ((uint64_t)i << s->cluster_bits);
         /* if two concurrent writes happen to the same unallocated cluster
          * each write allocates separate cluster and writes data concurrently.
          * The first one to complete updates l2 table with pointer to its
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15172.38122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqG-0001Bv-Kw; Thu, 29 Oct 2020 21:52:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15172.38122; Thu, 29 Oct 2020 21:52:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqG-0001Bm-Ha; Thu, 29 Oct 2020 21:52:20 +0000
Received: by outflank-mailman (input) for mailman id 15172;
 Thu, 29 Oct 2020 21:52:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFqG-0001Bg-1b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 557a6d64-e23e-41cb-b0c6-9afffc3dc468;
 Thu, 29 Oct 2020 21:52:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqE-0000RW-W7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqE-0006NP-VO
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFqG-0001Bg-1b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:20 +0000
X-Inumbo-ID: 557a6d64-e23e-41cb-b0c6-9afffc3dc468
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 557a6d64-e23e-41cb-b0c6-9afffc3dc468;
	Thu, 29 Oct 2020 21:52:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tdbwELPZlk0RB+2jEj1goeE+Gi2yP3LgiduomJt+8MY=; b=BJQnv/aanOsjrfq9l0K7Q1hkSH
	Koc4kUp6R4V9iNsZCai6mYJ4rXOvcQ0N3vwZ3uQa2gu/Suolue9dIVR9kbgyzWImuc7KtLPfpE14h
	V9FDjSli5duVck+Jmgcl6tpupKj9bBukaASHxsB06+fn952kGoKM5hpnBvOTQWIXfWpE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqE-0000RW-W7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqE-0006NP-VO
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] target/arm: Fix Rt/Rt2 in ESR_ELx for copro traps from AArch32 to 64
Message-Id: <E1kYFqE-0006NP-VO@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:18 +0000

commit a65dabf71a9f9b949d556b1b57fd72595df92398
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 20:39:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 17:31:51 2020 +0100

    target/arm: Fix Rt/Rt2 in ESR_ELx for copro traps from AArch32 to 64
    
    When a coprocessor instruction in an  AArch32 guest traps to AArch32
    Hyp mode, the syndrome register (HSR) includes Rt and Rt2 fields
    which are simply copies of the Rt and Rt2 fields from the trapped
    instruction.  However, if the instruction is trapped from AArch32 to
    an AArch64 higher exception level, the Rt and Rt2 fields in the
    syndrome register (ESR_ELx) must be the AArch64 view of the register.
    This makes a difference if the AArch32 guest was in a mode other than
    User or System and it was using r13 or r14, or if it was in FIQ mode
    and using r8-r14.
    
    We don't know at translate time which AArch32 CPU mode we are in, so
    we leave the values we generate in our prototype syndrome register
    value at translate time as the raw Rt/Rt2 from the instruction, and
    instead correct them to the AArch64 view when we find we need to take
    an exception from AArch32 to AArch64 with one of these syndrome
    values.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1879587
    Reported-by: Julien Freche <julien@bedrocksystems.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20200804193903.31240-1-peter.maydell@linaro.org
---
 target/arm/helper.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 8ef0fb478f..455c92b891 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9581,6 +9581,66 @@ static void arm_cpu_do_interrupt_aarch32(CPUState *cs)
     take_aarch32_exception(env, new_mode, mask, offset, addr);
 }
 
+static int aarch64_regnum(CPUARMState *env, int aarch32_reg)
+{
+    /*
+     * Return the register number of the AArch64 view of the AArch32
+     * register @aarch32_reg. The CPUARMState CPSR is assumed to still
+     * be that of the AArch32 mode the exception came from.
+     */
+    int mode = env->uncached_cpsr & CPSR_M;
+
+    switch (aarch32_reg) {
+    case 0 ... 7:
+        return aarch32_reg;
+    case 8 ... 12:
+        return mode == ARM_CPU_MODE_FIQ ? aarch32_reg + 16 : aarch32_reg;
+    case 13:
+        switch (mode) {
+        case ARM_CPU_MODE_USR:
+        case ARM_CPU_MODE_SYS:
+            return 13;
+        case ARM_CPU_MODE_HYP:
+            return 15;
+        case ARM_CPU_MODE_IRQ:
+            return 17;
+        case ARM_CPU_MODE_SVC:
+            return 19;
+        case ARM_CPU_MODE_ABT:
+            return 21;
+        case ARM_CPU_MODE_UND:
+            return 23;
+        case ARM_CPU_MODE_FIQ:
+            return 29;
+        default:
+            g_assert_not_reached();
+        }
+    case 14:
+        switch (mode) {
+        case ARM_CPU_MODE_USR:
+        case ARM_CPU_MODE_SYS:
+        case ARM_CPU_MODE_HYP:
+            return 14;
+        case ARM_CPU_MODE_IRQ:
+            return 16;
+        case ARM_CPU_MODE_SVC:
+            return 18;
+        case ARM_CPU_MODE_ABT:
+            return 20;
+        case ARM_CPU_MODE_UND:
+            return 22;
+        case ARM_CPU_MODE_FIQ:
+            return 30;
+        default:
+            g_assert_not_reached();
+        }
+    case 15:
+        return 31;
+    default:
+        g_assert_not_reached();
+    }
+}
+
 /* Handle exception entry to a target EL which is using AArch64 */
 static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
 {
@@ -9591,6 +9651,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
     unsigned int new_mode = aarch64_pstate_mode(new_el, true);
     unsigned int old_mode;
     unsigned int cur_el = arm_current_el(env);
+    int rt;
 
     /*
      * Note that new_el can never be 0.  If cur_el is 0, then
@@ -9645,7 +9706,8 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
     case EXCP_HVC:
     case EXCP_HYP_TRAP:
     case EXCP_SMC:
-        if (syn_get_ec(env->exception.syndrome) == EC_ADVSIMDFPACCESSTRAP) {
+        switch (syn_get_ec(env->exception.syndrome)) {
+        case EC_ADVSIMDFPACCESSTRAP:
             /*
              * QEMU internal FP/SIMD syndromes from AArch32 include the
              * TA and coproc fields which are only exposed if the exception
@@ -9653,6 +9715,34 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
              * AArch64 format syndrome.
              */
             env->exception.syndrome &= ~MAKE_64BIT_MASK(0, 20);
+            break;
+        case EC_CP14RTTRAP:
+        case EC_CP15RTTRAP:
+        case EC_CP14DTTRAP:
+            /*
+             * For a trap on AArch32 MRC/MCR/LDC/STC the Rt field is currently
+             * the raw register field from the insn; when taking this to
+             * AArch64 we must convert it to the AArch64 view of the register
+             * number. Notice that we read a 4-bit AArch32 register number and
+             * write back a 5-bit AArch64 one.
+             */
+            rt = extract32(env->exception.syndrome, 5, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                5, 5, rt);
+            break;
+        case EC_CP15RRTTRAP:
+        case EC_CP14RRTTRAP:
+            /* Similarly for MRRC/MCRR traps for Rt and Rt2 fields */
+            rt = extract32(env->exception.syndrome, 5, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                5, 5, rt);
+            rt = extract32(env->exception.syndrome, 10, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                10, 5, rt);
+            break;
         }
         env->cp15.esr_el[new_el] = env->exception.syndrome;
         break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15173.38126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqQ-0001DG-M4; Thu, 29 Oct 2020 21:52:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15173.38126; Thu, 29 Oct 2020 21:52:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqQ-0001D8-J8; Thu, 29 Oct 2020 21:52:30 +0000
Received: by outflank-mailman (input) for mailman id 15173;
 Thu, 29 Oct 2020 21:52:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFqQ-0001D0-2u
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 163d2435-d162-4b27-8e57-2700d565b5ea;
 Thu, 29 Oct 2020 21:52:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqP-0000Rf-3J
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqP-0006Nt-2d
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFqQ-0001D0-2u
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:30 +0000
X-Inumbo-ID: 163d2435-d162-4b27-8e57-2700d565b5ea
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 163d2435-d162-4b27-8e57-2700d565b5ea;
	Thu, 29 Oct 2020 21:52:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TWfyZfydhsPA2uC0fhcFirJp2mGOyAljYdrpUIDFmW8=; b=BWcKrEhbrZGG/myYseDZS4wALp
	jx5xpyN36GNBUYrlGALYjihmmj8BfHWrrhkShz0FFsDJeyGJyS7NfiZlmwSLGJdugLivLWvEEGLUv
	nFkjS45ZtJ8D07GpvM2x9RPgkrsjMv2usZSc9PefZavc1mqsbI0vtUYNclJPBoFY2tzo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqP-0000Rf-3J
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqP-0006Nt-2d
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update version for v5.1.0-rc3 release
Message-Id: <E1kYFqP-0006Nt-2d@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:29 +0000

commit e1d322c40524d2c544d1fcd37b267d106d16d328
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Aug 5 17:37:17 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 17:37:17 2020 +0100

    Update version for v5.1.0-rc3 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 388c02aef2..c4550df997 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.92
+5.0.93
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15174.38130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqa-0001EX-Nh; Thu, 29 Oct 2020 21:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15174.38130; Thu, 29 Oct 2020 21:52:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqa-0001EP-Kj; Thu, 29 Oct 2020 21:52:40 +0000
Received: by outflank-mailman (input) for mailman id 15174;
 Thu, 29 Oct 2020 21:52:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFqa-0001EI-1u
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5edda74d-4372-4986-b0a2-1cd77d97898b;
 Thu, 29 Oct 2020 21:52:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqZ-0000TI-6l
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqZ-0006Pw-5x
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFqa-0001EI-1u
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:40 +0000
X-Inumbo-ID: 5edda74d-4372-4986-b0a2-1cd77d97898b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5edda74d-4372-4986-b0a2-1cd77d97898b;
	Thu, 29 Oct 2020 21:52:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JOz/f1K7/dBRzUyL369EpMsbn23dssTv39OFjhrvmE8=; b=Kazu2X9fXwExCTh9t21da7Tk46
	LPH32Jr6h9kerPm4qYEG6jUtoiO/+PeQVthC2edf30P0CTktQfIqtw0BgK49xUnS3uPtRXaulSoXp
	Ep/C+rIIdm4myCeS9sBGjtrRuY+3+m/BFxRJ+mARpcDlje89idgVDnRMLsaUy7dwG1PM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqZ-0000TI-6l
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqZ-0006Pw-5x
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Update version for v5.1.0 release
Message-Id: <E1kYFqZ-0006Pw-5x@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:39 +0000

commit d0ed6a69d399ae193959225cdeaa9382746c91cc
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 11 17:07:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 11 17:07:03 2020 +0100

    Update version for v5.1.0 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index c4550df997..831446cbd2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.93
+5.1.0
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:52:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:52:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15175.38135 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqk-0001Fv-Px; Thu, 29 Oct 2020 21:52:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15175.38135; Thu, 29 Oct 2020 21:52:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqk-0001Fj-MI; Thu, 29 Oct 2020 21:52:50 +0000
Received: by outflank-mailman (input) for mailman id 15175;
 Thu, 29 Oct 2020 21:52:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFqk-0001FY-5b
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ae34035-b33d-421f-8eb2-9e0d438451f5;
 Thu, 29 Oct 2020 21:52:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqj-0000TS-Dp
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqj-0006QW-CH
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFqk-0001FY-5b
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:50 +0000
X-Inumbo-ID: 6ae34035-b33d-421f-8eb2-9e0d438451f5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ae34035-b33d-421f-8eb2-9e0d438451f5;
	Thu, 29 Oct 2020 21:52:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QFnSu1tCqRCQv3WtIkzh1H7jqulPDe8HHg8HTNZU08A=; b=A7jLYDvk6PZ37KcpKTUUTUHWgb
	0Y9l6SYtG3L4xfRxenanEr0aCCUF/RCkgJrf1gemSk8tfwSK1oECDsz55UjTTYngNCU+YeblTX/Xv
	rzraBXtg8ncz2LWTCemaPxPU4kXRvBFRrwDxkpgHnexTz1WAuD78kHLwLDmcLpXAvPxA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqj-0000TS-Dp
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqj-0006QW-CH
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] Merge tag 'v5.1.0' into 'staging'
Message-Id: <E1kYFqj-0006QW-CH@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:49 +0000

commit 34aeb4f2cc190a99cde89d7ac13b805e009272d8
Merge: d0ed6a69d399ae193959225cdeaa9382746c91cc ea6d3cd1ed79d824e605a70c3626bc437c386260
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Oct 29 16:12:36 2020 +0000
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Oct 29 16:12:36 2020 +0000

    Merge tag 'v5.1.0' into 'staging'

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 21:53:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 21:53:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15176.38138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqv-0001It-R5; Thu, 29 Oct 2020 21:53:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15176.38138; Thu, 29 Oct 2020 21:53:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYFqv-0001Il-Nn; Thu, 29 Oct 2020 21:53:01 +0000
Received: by outflank-mailman (input) for mailman id 15176;
 Thu, 29 Oct 2020 21:53:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYFqu-0001Id-LP
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:53:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9797617b-51ca-41c9-b9e1-ee072985652b;
 Thu, 29 Oct 2020 21:52:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqt-0000Ta-Hm
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYFqt-0006R7-GY
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYFqu-0001Id-LP
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:53:00 +0000
X-Inumbo-ID: 9797617b-51ca-41c9-b9e1-ee072985652b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9797617b-51ca-41c9-b9e1-ee072985652b;
	Thu, 29 Oct 2020 21:52:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=g/fg0FA5P6SfJKHQaXbAuqvDoo9hE8vOugjoJlz1szU=; b=KdKWD1bzZAbVZ+cXqd1C1584jE
	kjQWl+iouExp9V9iK2uFVcUtQA7Ulwr1NFDzug9nDSZO51V3QKoZVeuHiP0PE8wVGZciZOUhpclmv
	uf8Krh1cLRZS3LIjffkZGmLXnb/NYPoeyPbEsVAV5Yvj2fqc2QPYpM2cM2ljALoDzI94=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqt-0000Ta-Hm
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYFqt-0006R7-GY
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 21:52:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen staging] main loop: Big hammer to fix logfile disk DoS in Xen setups
Message-Id: <E1kYFqt-0006R7-GY@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 21:52:59 +0000

commit 677cbe1324c29294bb1d1b8454b3f214725e40fd
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu May 26 16:21:56 2016 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Oct 29 16:13:29 2020 +0000

    main loop: Big hammer to fix logfile disk DoS in Xen setups
    
    Each time round the main loop, we now fstat stderr.  If it is too big,
    we dup2 /dev/null onto it.  This is not a very pretty patch but it is
    very simple, easy to see that it's correct, and has a low risk of
    collateral damage.
    
    There is no limit by default but can be adjusted by setting a new
    environment variable.
    
    This fixes CVE-2014-3672.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Tested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    
    Set the default to 0 so that it won't affect non-xen installation. The
    limit will be set by Xen toolstack.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 44a072f0de0d57c95c2212bbce02888832b7b74f)
    (cherry picked from commit 269381bb635692856aa8789a3f322e543e0c648d)
---
 util/main-loop.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/util/main-loop.c b/util/main-loop.c
index f69f055013..5268b6ec84 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -173,6 +173,50 @@ int qemu_init_main_loop(Error **errp)
     return 0;
 }
 
+static void check_cve_2014_3672_xen(void)
+{
+    static unsigned long limit = ~0UL;
+    const int fd = 2;
+    struct stat stab;
+
+    if (limit == ~0UL) {
+        const char *s = getenv("XEN_QEMU_CONSOLE_LIMIT");
+        /* XEN_QEMU_CONSOLE_LIMIT=0 means no limit */
+        limit = s ? strtoul(s,0,0) : 0;
+    }
+    if (limit == 0)
+        return;
+
+    int r = fstat(fd, &stab);
+    if (r) {
+        perror("fstat stderr (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    if (!S_ISREG(stab.st_mode))
+        return;
+    if (stab.st_size <= limit)
+        return;
+
+    /* oh dear */
+    fprintf(stderr,"\r\n"
+            "Closing stderr due to CVE-2014-3672 limit. "
+            " Set XEN_QEMU_CONSOLE_LIMIT to number of bytes to override,"
+            " or 0 for no limit.\n");
+    fflush(stderr);
+
+    int nfd = open("/dev/null", O_WRONLY);
+    if (nfd < 0) {
+        perror("open /dev/null (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    r = dup2(nfd, fd);
+    if (r != fd) {
+        perror("dup2 /dev/null (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    close(nfd);
+}
+
 static int max_priority;
 
 #ifndef _WIN32
@@ -227,6 +271,8 @@ static int os_host_main_loop_wait(int64_t timeout)
 
     g_main_context_acquire(context);
 
+    check_cve_2014_3672_xen();
+
     glib_pollfds_fill(&timeout);
 
     qemu_mutex_unlock_iothread();
@@ -399,6 +445,8 @@ static int os_host_main_loop_wait(int64_t timeout)
 
     g_main_context_acquire(context);
 
+    check_cve_2014_3672_xen();
+
     /* XXX: need to suppress polling by better using win32 events */
     ret = 0;
     for (pe = first_polling_entry; pe != NULL; pe = pe->next) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 23:33:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 23:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15338.38288 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHPn-00047x-QI; Thu, 29 Oct 2020 23:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15338.38288; Thu, 29 Oct 2020 23:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHPn-00047p-NN; Thu, 29 Oct 2020 23:33:07 +0000
Received: by outflank-mailman (input) for mailman id 15338;
 Thu, 29 Oct 2020 23:33:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYHPm-00047f-CE
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9d0e00f2-67a7-4bd2-97cd-bb123b3817bd;
 Thu, 29 Oct 2020 23:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHPl-0002aj-Fh
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHPl-0004IR-ET
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYHPm-00047f-CE
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:06 +0000
X-Inumbo-ID: 9d0e00f2-67a7-4bd2-97cd-bb123b3817bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9d0e00f2-67a7-4bd2-97cd-bb123b3817bd;
	Thu, 29 Oct 2020 23:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xJOyEob6XSlThxE3Fkxwjs+d76mHni9ygt5Uqf9PPSc=; b=rVSnL7NuctiHJyAWMJiKPKufTA
	aQ6AuIXbD41pcchxQ/Er1yn9ma4F7FuwtIhV6LP9S+RwgQuESPIdbldudm43jH0drSFTOxyazX+/3
	c+5+8+xDiqt0asrUHZJvBd0ahi6HaZiU8o1VajF8aeTf8uxOCQIOtQRvEsM1mapZeF0Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHPl-0002aj-Fh
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHPl-0004IR-ET
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: use printk_once for errata warning prints
Message-Id: <E1kYHPl-0004IR-ET@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 23:33:05 +0000

commit f9179d21e864c1f3ae1834f727a8c9f9137ccbbf
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Oct 26 16:21:31 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Thu Oct 29 14:02:59 2020 -0700

    xen/arm: use printk_once for errata warning prints
    
    Replace usage of warning_add by printk_once with a **** prefix and
    suffix for errata related warnings.
    
    This prevents the need for the assert which is not secure enough to
    protect this print against wrong usage.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/cpuerrata.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 0c63dfa779..0430069a84 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -157,7 +157,6 @@ extern char __smccc_workaround_1_smc_start[], __smccc_workaround_1_smc_end[];
 static int enable_smccc_arch_workaround_1(void *data)
 {
     struct arm_smccc_res res;
-    static bool warned = false;
     const struct arm_cpu_capabilities *entry = data;
 
     /*
@@ -182,13 +181,8 @@ static int enable_smccc_arch_workaround_1(void *data)
                                      "call ARM_SMCCC_ARCH_WORKAROUND_1");
 
 warn:
-    if ( !warned )
-    {
-        ASSERT(system_state < SYS_STATE_active);
-        warning_add("No support for ARM_SMCCC_ARCH_WORKAROUND_1.\n"
-                    "Please update your firmware.\n");
-        warned = true;
-    }
+    printk_once("**** No support for ARM_SMCCC_ARCH_WORKAROUND_1. ****\n"
+                "**** Please update your firmware.                ****\n");
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 23:33:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 23:33:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15340.38292 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHPx-00049V-Rk; Thu, 29 Oct 2020 23:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15340.38292; Thu, 29 Oct 2020 23:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHPx-00049N-Ow; Thu, 29 Oct 2020 23:33:17 +0000
Received: by outflank-mailman (input) for mailman id 15340;
 Thu, 29 Oct 2020 23:33:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYHPw-00049B-E7
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7447f81e-fc5d-44a5-8064-ed5c6622c17a;
 Thu, 29 Oct 2020 23:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHPv-0002aq-J8
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHPv-0004JD-IC
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYHPw-00049B-E7
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:16 +0000
X-Inumbo-ID: 7447f81e-fc5d-44a5-8064-ed5c6622c17a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7447f81e-fc5d-44a5-8064-ed5c6622c17a;
	Thu, 29 Oct 2020 23:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=stD7j9Y/Xb8u6EkqYVRklGA5nOPUwFQoK8qT19O2tDY=; b=Kuj3xDriRmYxCazQ+6aMNGZklG
	DUjZw94CxD2V+lY0jcNxaoyED7zvQkj/pSJJfctKj8LCixBxDZz8AliAop74xSBoYoiscaBj9CTDr
	vtVarZwpMyBAsR37340EcBac2dPZ1D39FgVvExUvle4nsuuH8kSqLNiu9Dtutfy0VuJo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHPv-0002aq-J8
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHPv-0004JD-IC
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Add an unsecure Taint type
Message-Id: <E1kYHPv-0004JD-IC@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 23:33:15 +0000

commit 82c0d3d491ccb183cf12c87775086b68531b8444
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Oct 26 16:21:32 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Thu Oct 29 14:03:00 2020 -0700

    xen: Add an unsecure Taint type
    
    Define a new Unsecure taint type to be used to signal a system tainted
    due to an unsecure configuration or hardware feature/errata.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/kernel.c   | 4 +++-
 xen/include/xen/lib.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index c3a943f077..7a345ae45e 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -326,6 +326,7 @@ unsigned int tainted;
  *  'E' - An error (e.g. a machine check exceptions) has been injected.
  *  'H' - HVM forced emulation prefix is permitted.
  *  'M' - Machine had a machine check experience.
+ *  'U' - Platform is unsecure (usually due to an errata on the platform).
  *
  *      The string is overwritten by the next call to print_taint().
  */
@@ -333,7 +334,8 @@ char *print_tainted(char *str)
 {
     if ( tainted )
     {
-        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
+        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c",
+                 tainted & TAINT_MACHINE_UNSECURE ? 'U' : ' ',
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                  tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
                  tainted & TAINT_ERROR_INJECT ? 'E' : ' ',
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 1983bd6b86..a9679c913d 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -193,6 +193,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 #define TAINT_MACHINE_CHECK             (1u << 1)
 #define TAINT_ERROR_INJECT              (1u << 2)
 #define TAINT_HVM_FEP                   (1u << 3)
+#define TAINT_MACHINE_UNSECURE          (1u << 4)
 extern unsigned int tainted;
 #define TAINT_STRING_MAX_LEN            20
 extern char *print_tainted(char *str);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Oct 29 23:33:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Oct 2020 23:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15342.38298 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHQ7-0004BM-Tl; Thu, 29 Oct 2020 23:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15342.38298; Thu, 29 Oct 2020 23:33:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYHQ7-0004BD-QS; Thu, 29 Oct 2020 23:33:27 +0000
Received: by outflank-mailman (input) for mailman id 15342;
 Thu, 29 Oct 2020 23:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYHQ6-0004B4-LA
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9e3d9dd3-f9dd-4ce3-a2d9-9f6403cafa93;
 Thu, 29 Oct 2020 23:33:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHQ5-0002ay-NG
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYHQ5-0004Jo-Lo
 for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=Z7lg=EE=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYHQ6-0004B4-LA
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:26 +0000
X-Inumbo-ID: 9e3d9dd3-f9dd-4ce3-a2d9-9f6403cafa93
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9e3d9dd3-f9dd-4ce3-a2d9-9f6403cafa93;
	Thu, 29 Oct 2020 23:33:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e7R5Vex0PQeJgcTzNX4ADF4eRh+0spt4/ySJNGSj9rY=; b=2ETWOP+4YLuL29XqmvkiJsJYay
	nS81lE/ykR9K4hwGzErHR/YIKAeu6h0Oy7FqbPzAxyrfGykWMFIPeIOvZ0CNr7ld5gJlxhihXukPw
	qddQHkh+PCPGOE0RZBaJC7+Gu1iYv5e6q2s3b1m8NAHg5wwfaqUGFBda5FpsUT9+m9y0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHQ5-0002ay-NG
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYHQ5-0004Jo-Lo
	for xen-changelog@lists.xenproject.org; Thu, 29 Oct 2020 23:33:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Warn user on cpu errata 832075
Message-Id: <E1kYHQ5-0004Jo-Lo@xenbits.xenproject.org>
Date: Thu, 29 Oct 2020 23:33:25 +0000

commit 6e2ee3dfd660d9fde96243da7d565244b4d2f164
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Oct 26 16:21:33 2020 +0000
Commit:     Stefano Stabellini <sstabellini@kernel.org>
CommitDate: Thu Oct 29 14:09:38 2020 -0700

    xen/arm: Warn user on cpu errata 832075
    
    When a Cortex A57 processor is affected by CPU errata 832075, a guest
    not implementing the workaround for it could deadlock the system.
    Add a warning during boot informing the user that only trusted guests
    should be executed on the system.
    An equivalent warning is already given to the user by KVM on cores
    affected by this errata.
    
    Also taint the hypervisor as unsecure when this errata applies and
    mention Cortex A57 r0p0 - r1p2 as not security supported in SUPPORT.md
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Julien Grall <jgrall@amazon.com>
    [fix SUPPORT.md style, 3 printk lines instead of 4]
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 SUPPORT.md               |  3 +++
 xen/arch/arm/cpuerrata.c | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/SUPPORT.md b/SUPPORT.md
index 5fbe5fc444..88d4bc7384 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -38,6 +38,9 @@ supported in this document.
 ### ARM v8
 
     Status: Supported
+    Status, Cortex A57 r0p0-r1p1: Supported, not security supported
+
+For the Cortex A57 r0p0 - r1p1, see Errata 832075.
 
 ## Host hardware support
 
diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c
index 0430069a84..6731d873e8 100644
--- a/xen/arch/arm/cpuerrata.c
+++ b/xen/arch/arm/cpuerrata.c
@@ -503,6 +503,18 @@ void check_local_cpu_errata(void)
 void __init enable_errata_workarounds(void)
 {
     enable_cpu_capabilities(arm_errata);
+
+#ifdef CONFIG_ARM64_ERRATUM_832075
+    if ( cpus_have_cap(ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE) )
+    {
+        printk_once("**** This CPU is affected by the errata 832075.                      ****\n"
+                    "**** Guests without CPU erratum workarounds can deadlock the system! ****\n"
+                    "**** Only trusted guests should be used.                             ****\n");
+
+        /* Taint the machine has being insecure */
+        add_taint(TAINT_MACHINE_UNSECURE);
+    }
+#endif
 }
 
 static int cpu_errata_callback(struct notifier_block *nfb,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 09:44:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 09:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15560.38557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYQx3-0005UY-TO; Fri, 30 Oct 2020 09:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15560.38557; Fri, 30 Oct 2020 09:44:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYQx3-0005UQ-QD; Fri, 30 Oct 2020 09:44:05 +0000
Received: by outflank-mailman (input) for mailman id 15560;
 Fri, 30 Oct 2020 09:44:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYQx2-0005UJ-Hk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f4cba238-44bb-444f-b27d-d79b9ab016e0;
 Fri, 30 Oct 2020 09:44:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYQx0-0004a0-F1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYQx0-0003JA-DH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYQx2-0005UJ-Hk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:04 +0000
X-Inumbo-ID: f4cba238-44bb-444f-b27d-d79b9ab016e0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f4cba238-44bb-444f-b27d-d79b9ab016e0;
	Fri, 30 Oct 2020 09:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E0u6RrY9Dwm82iyn2T8FQ+phfaba8nK6pyMuUqsHXFM=; b=ePxxEH0wWxrGO7JevO8ZrNqeyh
	b98T9Uap++JQ65hM4DG6rOdZpTvx8QDvdWJKNyuFZiLHI7KzwTePkVOGjFeJetJcz+/gl8i6kv4YD
	Pn2BwyR+4ImkA7s9eAs4jfXdPdaz1bEk5oM5XjTX8zLgLlApocM2F6XGJ2G+N9f6IwbA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYQx0-0004a0-F1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYQx0-0003JA-DH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
Message-Id: <E1kYQx0-0003JA-DH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 09:44:02 +0000

commit 055e1c3a3d95b1e753148369fbc4ba48782dd602
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Oct 22 11:28:58 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:39:11 2020 +0000

    x86/pv: Drop FLUSH_TLB_GLOBAL in do_mmu_update() for XPTI
    
    c/s 9d1d31ad9498 "x86: slightly reduce Meltdown band-aid overhead" removed the
    use of Global TLB flushes on the Xen entry path, but added a FLUSH_TLB_GLOBAL
    to the L4 path in do_mmu_update().
    
    However, this was unnecessary.
    
    It is the guests responsibility to perform appropriate TLB flushing if the L4
    modification altered an established mapping in a flush-relevant way.  In this
    case, an MMUEXT_OP hypercall will follow.  The case which Xen needs to cover
    is when new mappings are created, and the resync on the exit-to-guest path
    covers this correctly.
    
    There is a corner case with multiple vCPUs in hypercalls at the same time,
    which 9d1d31ad9498 changed, and this patch changes back to its original XPTI
    behaviour.
    
    Architecturally, established TLB entries can continue to be used until the
    broadcast flush has completed.  Therefore, even with concurrent hypercalls,
    the guest cannot depend on older mappings not being used until an MMUEXT_OP
    hypercall completes.  Xen's implementation of guest-initiated flushes will
    take correct effect on top of an in-progress hypercall, picking up new mapping
    setting before the other vCPU's MMUEXT_OP completes.
    
    Note: The correctness of this change is not impacted by whether XPTI uses
    global mappings or not.  Correctness there depends on the behaviour of Xen on
    the entry/exit paths when switching two/from the XPTI "shadow" pagetables.
    
    This is (not really) XSA-286 (but necessary to simplify the logic).
    
    Fixes: 9d1d31ad9498 ("x86: slightly reduce Meltdown band-aid overhead")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b2f35b3e7d..38168189aa 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4188,7 +4188,7 @@ long do_mmu_update(
 
         cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_TLB_GLOBAL | FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_ROOT_PGTBL);
     }
 
     perfc_add(num_page_updates, i);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 09:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 09:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15562.38562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYQxD-0005Vo-VB; Fri, 30 Oct 2020 09:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15562.38562; Fri, 30 Oct 2020 09:44:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYQxD-0005Vi-Ro; Fri, 30 Oct 2020 09:44:15 +0000
Received: by outflank-mailman (input) for mailman id 15562;
 Fri, 30 Oct 2020 09:44:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYQxC-0005VV-39
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7eff16ec-4b57-40b8-b3a6-2add4db002f6;
 Fri, 30 Oct 2020 09:44:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYQxA-0004a6-Io
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYQxA-0003K8-Hj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYQxC-0005VV-39
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:14 +0000
X-Inumbo-ID: 7eff16ec-4b57-40b8-b3a6-2add4db002f6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7eff16ec-4b57-40b8-b3a6-2add4db002f6;
	Fri, 30 Oct 2020 09:44:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a67Dx7VsbxhArhBQa4APr23pELLLsLm4mnWCIJchYlI=; b=F8GbesDr/ZGk5NUo6BPdvkcGZL
	3E+EZRn9Ws0hEWWaow9DDr9NBnicyPafISxBLDEb+angamLVBCo+b/KlCIRomtXbWQ3OwNrwNxRME
	iGwj/2dSQrddZyDZWxh/kjvOjeNJab3n/1Ai6NXjSkGKMuYe72RJ2xsmv8vFNSiNkt7I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYQxA-0004a6-Io
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYQxA-0003K8-Hj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 09:44:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Flush TLB in response to paging structure changes
Message-Id: <E1kYQxA-0003K8-Hj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 09:44:12 +0000

commit 16a20963b3209788f2c0d3a3eebb7d92f03f5883
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Oct 19 15:51:22 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue Oct 27 17:39:11 2020 +0000

    x86/pv: Flush TLB in response to paging structure changes
    
    With MMU_UPDATE, a PV guest can make changes to higher level pagetables.  This
    is safe from Xen's point of view (as the update only affects guest mappings),
    and the guest is required to flush (if necessary) after making updates.
    
    However, Xen's use of linear pagetables (UPDATE_VA_MAPPING, GNTTABOP_map,
    writeable pagetables, etc.) is an implementation detail outside of the
    API/ABI.
    
    Changes in the paging structure require invalidations in the linear pagetable
    range for subsequent accesses into the linear pagetables to access non-stale
    mappings.  Xen must provide suitable flushing to prevent intermixed guest
    actions from accidentally accessing/modifying the wrong pagetable.
    
    For all L2 and higher modifications, flush the TLB.  PV guests cannot create
    L2 or higher entries with the Global bit set, so no mappings established in
    the linear range can be global.  (This could in principle be an order 39 flush
    starting at LINEAR_PT_VIRT_START, but no such mechanism exists in practice.)
    
    Express the necessary flushes as a set of booleans which accumulate across the
    operation.  Comment the flushing logic extensively.
    
    This is XSA-286.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 38168189aa..5a50339284 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3891,7 +3891,8 @@ long do_mmu_update(
     struct vcpu *curr = current, *v = curr;
     struct domain *d = v->domain, *pt_owner = d, *pg_owner;
     mfn_t map_mfn = INVALID_MFN, mfn;
-    bool sync_guest = false;
+    bool flush_linear_pt = false, flush_root_pt_local = false,
+        flush_root_pt_others = false;
     uint32_t xsm_needed = 0;
     uint32_t xsm_checked = 0;
     int rc = put_old_guest_table(curr);
@@ -4041,6 +4042,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l3_page_table:
@@ -4048,6 +4051,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     break;
 
                 case PGT_l4_page_table:
@@ -4055,6 +4060,8 @@ long do_mmu_update(
                         break;
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
+                    if ( !rc )
+                        flush_linear_pt = true;
                     if ( !rc && pt_owner->arch.pv.xpti )
                     {
                         bool local_in_use = false;
@@ -4063,7 +4070,7 @@ long do_mmu_update(
                                     mfn) )
                         {
                             local_in_use = true;
-                            get_cpu_info()->root_pgt_changed = true;
+                            flush_root_pt_local = true;
                         }
 
                         /*
@@ -4075,7 +4082,7 @@ long do_mmu_update(
                              (1 + !!(page->u.inuse.type_info & PGT_pinned) +
                               mfn_eq(pagetable_get_mfn(curr->arch.guest_table_user),
                                      mfn) + local_in_use) )
-                            sync_guest = true;
+                            flush_root_pt_others = true;
                     }
                     break;
 
@@ -4177,19 +4184,61 @@ long do_mmu_update(
     if ( va )
         unmap_domain_page(va);
 
-    if ( sync_guest )
+    /*
+     * Perform required TLB maintenance.
+     *
+     * This logic currently depend on flush_linear_pt being a superset of the
+     * flush_root_pt_* conditions.
+     *
+     * pt_owner may not be current->domain.  This may occur during
+     * construction of 32bit PV guests, or debugging of PV guests.  The
+     * behaviour cannot be correct with domain unpaused.  We therefore expect
+     * pt_owner->dirty_cpumask to be empty, but it is a waste of effort to
+     * explicitly check for, and exclude, this corner case.
+     *
+     * flush_linear_pt requires a FLUSH_TLB to all dirty CPUs.  The flush must
+     * be performed now to maintain correct behaviour across a multicall.
+     * i.e. we cannot relax FLUSH_TLB to FLUSH_ROOT_PGTBL, given that the
+     * former is a side effect of the latter, because the resync (which is in
+     * the return-to-guest path) happens too late.
+     *
+     * flush_root_pt_* requires FLUSH_ROOT_PGTBL on either the local CPU
+     * (implies pt_owner == current->domain and current->processor set in
+     * pt_owner->dirty_cpumask), and/or all *other* dirty CPUs as there are
+     * references we can't account for locally.
+     */
+    if ( flush_linear_pt /* || flush_root_pt_local || flush_root_pt_others */ )
     {
+        unsigned int cpu = smp_processor_id();
+        cpumask_t *mask = pt_owner->dirty_cpumask;
+
         /*
-         * Force other vCPU-s of the affected guest to pick up L4 entry
-         * changes (if any).
+         * Always handle local flushing separately (if applicable), to
+         * separate the flush invocations appropriately for scope of the two
+         * flush_root_pt_* variables.
          */
-        unsigned int cpu = smp_processor_id();
-        cpumask_t *mask = per_cpu(scratch_cpumask, cpu);
+        if ( likely(cpumask_test_cpu(cpu, mask)) )
+        {
+            mask = per_cpu(scratch_cpumask, cpu);
 
-        cpumask_andnot(mask, pt_owner->dirty_cpumask, cpumask_of(cpu));
+            cpumask_copy(mask, pt_owner->dirty_cpumask);
+            __cpumask_clear_cpu(cpu, mask);
+
+            flush_local(FLUSH_TLB |
+                        (flush_root_pt_local ? FLUSH_ROOT_PGTBL : 0));
+        }
+        else
+            /* Sanity check.  flush_root_pt_local implies local cpu is dirty. */
+            ASSERT(!flush_root_pt_local);
+
+        /* Flush the remote dirty CPUs.  Does not include the local CPU. */
         if ( !cpumask_empty(mask) )
-            flush_mask(mask, FLUSH_ROOT_PGTBL);
+            flush_mask(mask, FLUSH_TLB |
+                       (flush_root_pt_others ? FLUSH_ROOT_PGTBL : 0));
     }
+    else
+        /* Sanity check.  flush_root_pt_* implies flush_linear_pt. */
+        ASSERT(!flush_root_pt_local && !flush_root_pt_others);
 
     perfc_add(num_page_updates, i);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 11:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 11:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15682.38752 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYSea-0008Eb-3p; Fri, 30 Oct 2020 11:33:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15682.38752; Fri, 30 Oct 2020 11:33:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYSea-0008ET-0i; Fri, 30 Oct 2020 11:33:08 +0000
Received: by outflank-mailman (input) for mailman id 15682;
 Fri, 30 Oct 2020 11:33:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYSeY-0008EO-E9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c2b36615-d2e6-4233-ae9c-d6f1c0daf49c;
 Fri, 30 Oct 2020 11:33:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYSeW-0006vh-UZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYSeW-00025E-SY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYSeY-0008EO-E9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:06 +0000
X-Inumbo-ID: c2b36615-d2e6-4233-ae9c-d6f1c0daf49c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c2b36615-d2e6-4233-ae9c-d6f1c0daf49c;
	Fri, 30 Oct 2020 11:33:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TR4sf78jYxut0rBVhmQ8R/LQKRCEkkB+9ttcqzJ+/XQ=; b=0jey6y8N1hmKk+rfsiXwKeUsRI
	Yb6RyfeKxKuYJARsG93Qly1Y8nexIPPLach0nGoe4FEUKPUVTsmVdj9yRgzokq3uhzsG/rDvFcQuA
	5UGdMMaqb6JxLhyBOID2H20uCk29LcnaCo69Zm63FtvWgtxnUcjseNd2cII13l14yaas=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYSeW-0006vh-UZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYSeW-00025E-SY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 11:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.13] update Xen version to 4.13.2
Message-Id: <E1kYSeW-00025E-SY@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 11:33:04 +0000

commit 0060ac29bcbdb76d49d2e248ddfcb7afa2345440
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 12:24:39 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 12:24:39 2020 +0100

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

diff --git a/Config.mk b/Config.mk
index fb7c0511b1..6f0321a9ee 100644
--- a/Config.mk
+++ b/Config.mk
@@ -276,15 +276,15 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 20d2e5a125e34fc8501026613a71549b2a1a3e54
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.1
-MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.2
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.2
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.12.1
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.13.1
+QEMU_TRADITIONAL_REVISION ?= xen-4.13.2
 # Wed Oct 10 18:52:54 2018 +0000
 # xen/pt: allow QEMU to request MSI unmasking at bind time
 
diff --git a/xen/Makefile b/xen/Makefile
index 5db0a25b3e..4a7709bd5c 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    = 13
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15820.39003 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUWj-0003ot-H4; Fri, 30 Oct 2020 13:33:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15820.39003; Fri, 30 Oct 2020 13:33:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUWj-0003ol-DZ; Fri, 30 Oct 2020 13:33:09 +0000
Received: by outflank-mailman (input) for mailman id 15820;
 Fri, 30 Oct 2020 13:33:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUWh-0003of-GV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3689a0c5-2934-44c6-aedb-cd103e38b48b;
 Fri, 30 Oct 2020 13:33:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUWf-00011s-V2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUWf-0002At-Tc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUWh-0003of-GV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:07 +0000
X-Inumbo-ID: 3689a0c5-2934-44c6-aedb-cd103e38b48b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3689a0c5-2934-44c6-aedb-cd103e38b48b;
	Fri, 30 Oct 2020 13:33:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N7elJaBMW1aaEK9j+YH2hsIBbr2LZrBULgyJjiV86qU=; b=QOrY8csvbAnV979SuFiAZFk88u
	nMLdvq8PjYdNBeE8IxmNyHaIQcAsLBuGEpsvQs+lFwudy8ZaoN6LQrBibBdfnHW4hOI76QXQYUIWB
	539pqoHPI6ASxkJG5RA8+PgcbMadlt+oMqUNBnzaL/hAnnFU5r4llZgDZYKgCWu1WkwI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUWf-00011s-V2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUWf-0002At-Tc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: refactor shadow_vram_{get,put}_l1e()
Message-Id: <E1kYUWf-0002At-Tc@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:05 +0000

commit 8ac7e452a6e9fb3c8314fe92b2e1ebb0937fa0dd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:25:42 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:25:42 2020 +0100

    x86/shadow: refactor shadow_vram_{get,put}_l1e()
    
    By passing the functions an MFN and flags, only a single instance of
    each is needed; they were pretty large for being inline functions
    anyway.
    
    While moving the code, also adjust coding style and add const where
    sensible / possible.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/hvm.c     |  98 +++++++++++++++++++++++++++++
 xen/arch/x86/mm/shadow/multi.c   | 130 +++++----------------------------------
 xen/arch/x86/mm/shadow/private.h |   8 +++
 3 files changed, 123 insertions(+), 113 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index b832272c10..967c1a6a04 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -903,6 +903,104 @@ int shadow_track_dirty_vram(struct domain *d,
     return rc;
 }
 
+void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
+                         mfn_t sl1mfn, const void *sl1e,
+                         const struct domain *d)
+{
+    unsigned long gfn;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+
+    ASSERT(is_hvm_domain(d));
+
+    if ( !dirty_vram /* tracking disabled? */ ||
+         !(l1f & _PAGE_RW) /* read-only mapping? */ ||
+         !mfn_valid(mfn) /* mfn can be invalid in mmio_direct */)
+        return;
+
+    gfn = gfn_x(mfn_to_gfn(d, mfn));
+    /* Page sharing not supported on shadow PTs */
+    BUG_ON(SHARED_M2P(gfn));
+
+    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    {
+        unsigned long i = gfn - dirty_vram->begin_pfn;
+        const struct page_info *page = mfn_to_page(mfn);
+
+        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
+            /* Initial guest reference, record it */
+            dirty_vram->sl1ma[i] = mfn_to_maddr(sl1mfn) |
+                                   PAGE_OFFSET(sl1e);
+    }
+}
+
+void shadow_vram_put_mfn(mfn_t mfn, unsigned int l1f,
+                         mfn_t sl1mfn, const void *sl1e,
+                         const struct domain *d)
+{
+    unsigned long gfn;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+
+    ASSERT(is_hvm_domain(d));
+
+    if ( !dirty_vram /* tracking disabled? */ ||
+         !(l1f & _PAGE_RW) /* read-only mapping? */ ||
+         !mfn_valid(mfn) /* mfn can be invalid in mmio_direct */)
+        return;
+
+    gfn = gfn_x(mfn_to_gfn(d, mfn));
+    /* Page sharing not supported on shadow PTs */
+    BUG_ON(SHARED_M2P(gfn));
+
+    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
+    {
+        unsigned long i = gfn - dirty_vram->begin_pfn;
+        const struct page_info *page = mfn_to_page(mfn);
+        bool dirty = false;
+        paddr_t sl1ma = mfn_to_maddr(sl1mfn) | PAGE_OFFSET(sl1e);
+
+        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
+        {
+            /* Last reference */
+            if ( dirty_vram->sl1ma[i] == INVALID_PADDR )
+            {
+                /* We didn't know it was that one, let's say it is dirty */
+                dirty = true;
+            }
+            else
+            {
+                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
+                dirty_vram->sl1ma[i] = INVALID_PADDR;
+                if ( l1f & _PAGE_DIRTY )
+                    dirty = true;
+            }
+        }
+        else
+        {
+            /* We had more than one reference, just consider the page dirty. */
+            dirty = true;
+            /* Check that it's not the one we recorded. */
+            if ( dirty_vram->sl1ma[i] == sl1ma )
+            {
+                /* Too bad, we remembered the wrong one... */
+                dirty_vram->sl1ma[i] = INVALID_PADDR;
+            }
+            else
+            {
+                /*
+                 * Ok, our recorded sl1e is still pointing to this page, let's
+                 * just hope it will remain.
+                 */
+            }
+        }
+
+        if ( dirty )
+        {
+            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
+            dirty_vram->last_dirty = NOW();
+        }
+    }
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 225082fc2f..04be86e422 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1047,107 +1047,6 @@ static int shadow_set_l2e(struct domain *d,
     return flags;
 }
 
-static inline void shadow_vram_get_l1e(shadow_l1e_t new_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-#ifdef CONFIG_HVM
-    mfn_t mfn = shadow_l1e_get_mfn(new_sl1e);
-    int flags = shadow_l1e_get_flags(new_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
-
-    if ( !is_hvm_domain(d) || !dirty_vram /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = gfn_x(mfn_to_gfn(d, mfn));
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
-    {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-            /* Initial guest reference, record it */
-            dirty_vram->sl1ma[i] = mfn_to_maddr(sl1mfn)
-                | ((unsigned long)sl1e & ~PAGE_MASK);
-    }
-#endif
-}
-
-static inline void shadow_vram_put_l1e(shadow_l1e_t old_sl1e,
-                                       shadow_l1e_t *sl1e,
-                                       mfn_t sl1mfn,
-                                       struct domain *d)
-{
-#ifdef CONFIG_HVM
-    mfn_t mfn = shadow_l1e_get_mfn(old_sl1e);
-    int flags = shadow_l1e_get_flags(old_sl1e);
-    unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
-
-    if ( !is_hvm_domain(d) || !dirty_vram /* tracking disabled? */
-         || !(flags & _PAGE_RW) /* read-only mapping? */
-         || !mfn_valid(mfn) )   /* mfn can be invalid in mmio_direct */
-        return;
-
-    gfn = gfn_x(mfn_to_gfn(d, mfn));
-    /* Page sharing not supported on shadow PTs */
-    BUG_ON(SHARED_M2P(gfn));
-
-    if ( (gfn >= dirty_vram->begin_pfn) && (gfn < dirty_vram->end_pfn) )
-    {
-        unsigned long i = gfn - dirty_vram->begin_pfn;
-        struct page_info *page = mfn_to_page(mfn);
-        int dirty = 0;
-        paddr_t sl1ma = mfn_to_maddr(sl1mfn)
-            | ((unsigned long)sl1e & ~PAGE_MASK);
-
-        if ( (page->u.inuse.type_info & PGT_count_mask) == 1 )
-        {
-            /* Last reference */
-            if ( dirty_vram->sl1ma[i] == INVALID_PADDR ) {
-                /* We didn't know it was that one, let's say it is dirty */
-                dirty = 1;
-            }
-            else
-            {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-                if ( flags & _PAGE_DIRTY )
-                    dirty = 1;
-            }
-        }
-        else
-        {
-            /* We had more than one reference, just consider the page dirty. */
-            dirty = 1;
-            /* Check that it's not the one we recorded. */
-            if ( dirty_vram->sl1ma[i] == sl1ma )
-            {
-                /* Too bad, we remembered the wrong one... */
-                dirty_vram->sl1ma[i] = INVALID_PADDR;
-            }
-            else
-            {
-                /* Ok, our recorded sl1e is still pointing to this page, let's
-                 * just hope it will remain. */
-            }
-        }
-        if ( dirty )
-        {
-            dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-            dirty_vram->last_dirty = NOW();
-        }
-    }
-#endif
-}
-
 static int shadow_set_l1e(struct domain *d,
                           shadow_l1e_t *sl1e,
                           shadow_l1e_t new_sl1e,
@@ -1156,6 +1055,7 @@ static int shadow_set_l1e(struct domain *d,
 {
     int flags = 0;
     shadow_l1e_t old_sl1e;
+    unsigned int old_sl1f;
 #if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
     mfn_t new_gmfn = shadow_l1e_get_mfn(new_sl1e);
 #endif
@@ -1194,7 +1094,9 @@ static int shadow_set_l1e(struct domain *d,
                 new_sl1e = shadow_l1e_flip_flags(new_sl1e, rc);
                 /* fall through */
             case 0:
-                shadow_vram_get_l1e(new_sl1e, sl1e, sl1mfn, d);
+                shadow_vram_get_mfn(shadow_l1e_get_mfn(new_sl1e),
+                                    shadow_l1e_get_flags(new_sl1e),
+                                    sl1mfn, sl1e, d);
                 break;
             }
 #undef PAGE_FLIPPABLE
@@ -1205,20 +1107,19 @@ static int shadow_set_l1e(struct domain *d,
     shadow_write_entries(sl1e, &new_sl1e, 1, sl1mfn);
     flags |= SHADOW_SET_CHANGED;
 
-    if ( (shadow_l1e_get_flags(old_sl1e) & _PAGE_PRESENT)
-         && !sh_l1e_is_magic(old_sl1e) )
+    old_sl1f = shadow_l1e_get_flags(old_sl1e);
+    if ( (old_sl1f & _PAGE_PRESENT) && !sh_l1e_is_magic(old_sl1e) &&
+         shadow_mode_refcounts(d) )
     {
         /* We lost a reference to an old mfn. */
         /* N.B. Unlike higher-level sets, never need an extra flush
          * when writing an l1e.  Because it points to the same guest frame
          * as the guest l1e did, it's the guest's responsibility to
          * trigger a flush later. */
-        if ( shadow_mode_refcounts(d) )
-        {
-            shadow_vram_put_l1e(old_sl1e, sl1e, sl1mfn, d);
-            shadow_put_page_from_l1e(old_sl1e, d);
-            TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
-        }
+        shadow_vram_put_mfn(shadow_l1e_get_mfn(old_sl1e), old_sl1f,
+                            sl1mfn, sl1e, d);
+        shadow_put_page_from_l1e(old_sl1e, d);
+        TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_SHADOW_L1_PUT_REF);
     }
     return flags;
 }
@@ -1944,9 +1845,12 @@ void sh_destroy_l1_shadow(struct domain *d, mfn_t smfn)
         /* Decrement refcounts of all the old entries */
         mfn_t sl1mfn = smfn;
         SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 0, {
-            if ( (shadow_l1e_get_flags(*sl1e) & _PAGE_PRESENT)
-                 && !sh_l1e_is_magic(*sl1e) ) {
-                shadow_vram_put_l1e(*sl1e, sl1e, sl1mfn, d);
+            unsigned int sl1f = shadow_l1e_get_flags(*sl1e);
+
+            if ( (sl1f & _PAGE_PRESENT) && !sh_l1e_is_magic(*sl1e) )
+            {
+                shadow_vram_put_mfn(shadow_l1e_get_mfn(*sl1e), sl1f,
+                                    sl1mfn, sl1e, d);
                 shadow_put_page_from_l1e(*sl1e, d);
             }
         });
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 992461d4bc..5372fdc253 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -410,6 +410,14 @@ void shadow_update_paging_modes(struct vcpu *v);
  * With user_only == 1, unhooks only the user-mode mappings. */
 void shadow_unhook_mappings(struct domain *d, mfn_t smfn, int user_only);
 
+/* VRAM dirty tracking helpers. */
+void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
+                         mfn_t sl1mfn, const void *sl1e,
+                         const struct domain *d);
+void shadow_vram_put_mfn(mfn_t mfn, unsigned int l1f,
+                         mfn_t sl1mfn, const void *sl1e,
+                         const struct domain *d);
+
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
 /* Allow a shadowed page to go out of sync */
 int sh_unsync(struct vcpu *v, mfn_t gmfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15821.39007 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUWt-0003qU-JB; Fri, 30 Oct 2020 13:33:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15821.39007; Fri, 30 Oct 2020 13:33:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUWt-0003qL-FS; Fri, 30 Oct 2020 13:33:19 +0000
Received: by outflank-mailman (input) for mailman id 15821;
 Fri, 30 Oct 2020 13:33:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUWs-0003qA-05
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3a722eaa-57b7-49cf-9b0b-0447ee42542a;
 Fri, 30 Oct 2020 13:33:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUWq-00011z-3G
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUWq-0002BW-1m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUWs-0003qA-05
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:18 +0000
X-Inumbo-ID: 3a722eaa-57b7-49cf-9b0b-0447ee42542a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3a722eaa-57b7-49cf-9b0b-0447ee42542a;
	Fri, 30 Oct 2020 13:33:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=glMdUaKjV7qHpTq3IDIhpr/uOIPxL9y5mJaQmFwzNvE=; b=ERNGGJxl3876+PzyDNUt11Sn8h
	Coyhc2NUs7UrE55RZwrkuozG5bAPhC7vqdpLi8KSh1zvj77s8/Ac9FQpejp4Az6Uq+xnZl4Oyf8xP
	VjSGrNGNy6USiSjphpJ25/+EuN2rqTiA6ehTgo6PIP6o2oxg+M2O2j+bdDzflAZZ5RWo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUWq-00011z-3G
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUWq-0002BW-1m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: sh_{make,destroy}_monitor_table() are "even more" HVM-only
Message-Id: <E1kYUWq-0002BW-1m@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:16 +0000

commit 0b841314dacecc94376be22f514da0665055fa3b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:26:46 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:26:46 2020 +0100

    x86/shadow: sh_{make,destroy}_monitor_table() are "even more" HVM-only
    
    With them depending on just the number of shadow levels, there's no need
    for more than one instance of them, and hence no need for any hook (IOW
    452219e24648 ["x86/shadow: monitor table is HVM-only"] didn't go quite
    far enough). Move the functions to hvm.c while dropping the dead
    is_pv_32bit_domain() code paths.
    
    While moving the code, replace a stale comment reference to
    sh_install_xen_entries_in_l4(). Doing so made me notice the function
    also didn't have its prototype dropped in 8d7b633adab7 ("x86/mm:
    Consolidate all Xen L4 slot writing into init_xen_l4_slots()"), which
    gets done here as well.
    
    Also make their first parameters const.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c  |  14 +++--
 xen/arch/x86/mm/shadow/hvm.c     |  82 ++++++++++++++++++++++++++
 xen/arch/x86/mm/shadow/multi.c   | 124 ---------------------------------------
 xen/arch/x86/mm/shadow/private.h |  11 +++-
 xen/arch/x86/mm/shadow/types.h   |   9 ---
 xen/include/asm-x86/paging.h     |   2 -
 6 files changed, 100 insertions(+), 142 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 6182313a0e..0d59dea6ad 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2467,7 +2467,9 @@ static void sh_update_paging_modes(struct vcpu *v)
 
         if ( pagetable_is_null(v->arch.hvm.monitor_table) )
         {
-            mfn_t mmfn = v->arch.paging.mode->shadow.make_monitor_table(v);
+            mfn_t mmfn = sh_make_monitor_table(
+                             v, v->arch.paging.mode->shadow.shadow_levels);
+
             v->arch.hvm.monitor_table = pagetable_from_mfn(mmfn);
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
@@ -2504,7 +2506,8 @@ static void sh_update_paging_modes(struct vcpu *v)
 
                 old_mfn = pagetable_get_mfn(v->arch.hvm.monitor_table);
                 v->arch.hvm.monitor_table = pagetable_null();
-                new_mfn = v->arch.paging.mode->shadow.make_monitor_table(v);
+                new_mfn = sh_make_monitor_table(
+                              v, v->arch.paging.mode->shadow.shadow_levels);
                 v->arch.hvm.monitor_table = pagetable_from_mfn(new_mfn);
                 SHADOW_PRINTK("new monitor table %"PRI_mfn "\n",
                                mfn_x(new_mfn));
@@ -2516,7 +2519,8 @@ static void sh_update_paging_modes(struct vcpu *v)
                 if ( v == current )
                     write_ptbase(v);
                 hvm_update_host_cr3(v);
-                old_mode->shadow.destroy_monitor_table(v, old_mfn);
+                sh_destroy_monitor_table(v, old_mfn,
+                                         old_mode->shadow.shadow_levels);
             }
         }
 
@@ -2801,7 +2805,9 @@ void shadow_teardown(struct domain *d, bool *preempted)
                     mfn_t mfn = pagetable_get_mfn(v->arch.hvm.monitor_table);
 
                     if ( mfn_valid(mfn) && (mfn_x(mfn) != 0) )
-                        v->arch.paging.mode->shadow.destroy_monitor_table(v, mfn);
+                        sh_destroy_monitor_table(
+                            v, mfn,
+                            v->arch.paging.mode->shadow.shadow_levels);
                     v->arch.hvm.monitor_table = pagetable_null();
                 }
 #endif /* CONFIG_HVM */
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 967c1a6a04..87fc57704f 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -691,6 +691,88 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
     atomic_inc(&v->domain->arch.paging.shadow.gtable_dirty_version);
 }
 
+mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels)
+{
+    struct domain *d = v->domain;
+    mfn_t m4mfn;
+    l4_pgentry_t *l4e;
+
+    ASSERT(!pagetable_get_pfn(v->arch.hvm.monitor_table));
+
+    /* Guarantee we can get the memory we need */
+    shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS);
+    m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
+    mfn_to_page(m4mfn)->shadow_flags = 4;
+
+    l4e = map_domain_page(m4mfn);
+
+    /*
+     * Create a self-linear mapping, but no shadow-linear mapping.  A
+     * shadow-linear mapping will either be inserted below when creating
+     * lower level monitor tables, or later in sh_update_cr3().
+     */
+    init_xen_l4_slots(l4e, m4mfn, d, INVALID_MFN, false);
+
+    if ( shadow_levels < 4 )
+    {
+        mfn_t m3mfn, m2mfn;
+        l3_pgentry_t *l3e;
+
+        /*
+         * Install an l3 table and an l2 table that will hold the shadow
+         * linear map entries.  This overrides the empty entry that was
+         * installed by init_xen_l4_slots().
+         */
+        m3mfn = shadow_alloc(d, SH_type_monitor_table, 0);
+        mfn_to_page(m3mfn)->shadow_flags = 3;
+        l4e[l4_table_offset(SH_LINEAR_PT_VIRT_START)]
+            = l4e_from_mfn(m3mfn, __PAGE_HYPERVISOR_RW);
+
+        m2mfn = shadow_alloc(d, SH_type_monitor_table, 0);
+        mfn_to_page(m2mfn)->shadow_flags = 2;
+        l3e = map_domain_page(m3mfn);
+        l3e[0] = l3e_from_mfn(m2mfn, __PAGE_HYPERVISOR_RW);
+        unmap_domain_page(l3e);
+    }
+
+    unmap_domain_page(l4e);
+
+    return m4mfn;
+}
+
+void sh_destroy_monitor_table(const struct vcpu *v, mfn_t mmfn,
+                              unsigned int shadow_levels)
+{
+    struct domain *d = v->domain;
+
+    ASSERT(mfn_to_page(mmfn)->u.sh.type == SH_type_monitor_table);
+
+    if ( shadow_levels < 4 )
+    {
+        mfn_t m3mfn;
+        l4_pgentry_t *l4e = map_domain_page(mmfn);
+        l3_pgentry_t *l3e;
+        unsigned int linear_slot = l4_table_offset(SH_LINEAR_PT_VIRT_START);
+
+        /*
+         * Need to destroy the l3 and l2 monitor pages used
+         * for the linear map.
+         */
+        ASSERT(l4e_get_flags(l4e[linear_slot]) & _PAGE_PRESENT);
+        m3mfn = l4e_get_mfn(l4e[linear_slot]);
+        l3e = map_domain_page(m3mfn);
+        ASSERT(l3e_get_flags(l3e[0]) & _PAGE_PRESENT);
+        shadow_free(d, l3e_get_mfn(l3e[0]));
+        unmap_domain_page(l3e);
+        shadow_free(d, m3mfn);
+
+        unmap_domain_page(l4e);
+    }
+
+    /* Put the memory back in the pool */
+    shadow_free(d, mmfn);
+}
+
 /**************************************************************************/
 /* VRAM dirty tracking support */
 int shadow_track_dirty_vram(struct domain *d,
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 04be86e422..eba5164a27 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1405,84 +1405,6 @@ make_fl1_shadow(struct domain *d, gfn_t gfn)
 }
 
 
-#if SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS && defined(CONFIG_HVM)
-mfn_t
-sh_make_monitor_table(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-
-    ASSERT(pagetable_get_pfn(v->arch.hvm.monitor_table) == 0);
-
-    /* Guarantee we can get the memory we need */
-    shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS);
-
-    {
-        mfn_t m4mfn;
-        l4_pgentry_t *l4e;
-
-        m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-        mfn_to_page(m4mfn)->shadow_flags = 4;
-
-        l4e = map_domain_page(m4mfn);
-
-        /*
-         * Create a self-linear mapping, but no shadow-linear mapping.  A
-         * shadow-linear mapping will either be inserted below when creating
-         * lower level monitor tables, or later in sh_update_cr3().
-         */
-        init_xen_l4_slots(l4e, m4mfn, d, INVALID_MFN, false);
-
-#if SHADOW_PAGING_LEVELS < 4
-        {
-            mfn_t m3mfn, m2mfn;
-            l3_pgentry_t *l3e;
-            /* Install an l3 table and an l2 table that will hold the shadow
-             * linear map entries.  This overrides the linear map entry that
-             * was installed by sh_install_xen_entries_in_l4. */
-
-            m3mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-            mfn_to_page(m3mfn)->shadow_flags = 3;
-            l4e[shadow_l4_table_offset(SH_LINEAR_PT_VIRT_START)]
-                = l4e_from_mfn(m3mfn, __PAGE_HYPERVISOR_RW);
-
-            m2mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-            mfn_to_page(m2mfn)->shadow_flags = 2;
-            l3e = map_domain_page(m3mfn);
-            l3e[0] = l3e_from_mfn(m2mfn, __PAGE_HYPERVISOR_RW);
-            unmap_domain_page(l3e);
-
-            if ( is_pv_32bit_domain(d) )
-            {
-                l2_pgentry_t *l2t;
-
-                /* For 32-bit PV guests, we need to map the 32-bit Xen
-                 * area into its usual VAs in the monitor tables */
-                m3mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-                mfn_to_page(m3mfn)->shadow_flags = 3;
-                l4e[0] = l4e_from_mfn(m3mfn, __PAGE_HYPERVISOR_RW);
-
-                m2mfn = shadow_alloc(d, SH_type_monitor_table, 0);
-                mfn_to_page(m2mfn)->shadow_flags = 2;
-                l3e = map_domain_page(m3mfn);
-                l3e[3] = l3e_from_mfn(m2mfn, _PAGE_PRESENT);
-
-                l2t = map_domain_page(m2mfn);
-                init_xen_pae_l2_slots(l2t, d);
-                unmap_domain_page(l2t);
-
-                unmap_domain_page(l3e);
-            }
-
-        }
-#endif /* SHADOW_PAGING_LEVELS < 4 */
-
-        unmap_domain_page(l4e);
-
-        return m4mfn;
-    }
-}
-#endif /* SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS */
-
 /**************************************************************************/
 /* These functions also take a virtual address and return the level-N
  * shadow table mfn and entry, but they create the shadow pagetables if
@@ -1860,50 +1782,6 @@ void sh_destroy_l1_shadow(struct domain *d, mfn_t smfn)
     shadow_free(d, smfn);
 }
 
-#if SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS && defined(CONFIG_HVM)
-void sh_destroy_monitor_table(struct vcpu *v, mfn_t mmfn)
-{
-    struct domain *d = v->domain;
-    ASSERT(mfn_to_page(mmfn)->u.sh.type == SH_type_monitor_table);
-
-#if SHADOW_PAGING_LEVELS != 4
-    {
-        mfn_t m3mfn;
-        l4_pgentry_t *l4e = map_domain_page(mmfn);
-        l3_pgentry_t *l3e;
-        int linear_slot = shadow_l4_table_offset(SH_LINEAR_PT_VIRT_START);
-
-        /* Need to destroy the l3 and l2 monitor pages used
-         * for the linear map */
-        ASSERT(l4e_get_flags(l4e[linear_slot]) & _PAGE_PRESENT);
-        m3mfn = l4e_get_mfn(l4e[linear_slot]);
-        l3e = map_domain_page(m3mfn);
-        ASSERT(l3e_get_flags(l3e[0]) & _PAGE_PRESENT);
-        shadow_free(d, l3e_get_mfn(l3e[0]));
-        unmap_domain_page(l3e);
-        shadow_free(d, m3mfn);
-
-        if ( is_pv_32bit_domain(d) )
-        {
-            /* Need to destroy the l3 and l2 monitor pages that map the
-             * Xen VAs at 3GB-4GB */
-            ASSERT(l4e_get_flags(l4e[0]) & _PAGE_PRESENT);
-            m3mfn = l4e_get_mfn(l4e[0]);
-            l3e = map_domain_page(m3mfn);
-            ASSERT(l3e_get_flags(l3e[3]) & _PAGE_PRESENT);
-            shadow_free(d, l3e_get_mfn(l3e[3]));
-            unmap_domain_page(l3e);
-            shadow_free(d, m3mfn);
-        }
-        unmap_domain_page(l4e);
-    }
-#endif
-
-    /* Put the memory back in the pool */
-    shadow_free(d, mmfn);
-}
-#endif
-
 /**************************************************************************/
 /* Functions to destroy non-Xen mappings in a pagetable hierarchy.
  * These are called from common code when we are running out of shadow
@@ -4705,8 +4583,6 @@ const struct paging_mode sh_paging_mode = {
     .shadow.cmpxchg_guest_entry    = sh_cmpxchg_guest_entry,
 #endif
 #ifdef CONFIG_HVM
-    .shadow.make_monitor_table     = sh_make_monitor_table,
-    .shadow.destroy_monitor_table  = sh_destroy_monitor_table,
 #if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
     .shadow.guess_wrmap            = sh_guess_wrmap,
 #endif
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 5372fdc253..e9b304f755 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -366,9 +366,6 @@ void sh_set_toplevel_shadow(struct vcpu *v,
                                                  mfn_t gmfn,
                                                  uint32_t shadow_type));
 
-/* Install the xen mappings in various flavours of shadow */
-void sh_install_xen_entries_in_l4(struct domain *, mfn_t gl4mfn, mfn_t sl4mfn);
-
 /* Update the shadows in response to a pagetable write from Xen */
 int sh_validate_guest_entry(struct vcpu *v, mfn_t gmfn, void *entry, u32 size);
 
@@ -410,6 +407,14 @@ void shadow_update_paging_modes(struct vcpu *v);
  * With user_only == 1, unhooks only the user-mode mappings. */
 void shadow_unhook_mappings(struct domain *d, mfn_t smfn, int user_only);
 
+/*
+ * sh_{make,destroy}_monitor_table() depend only on the number of shadow
+ * levels.
+ */
+mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels);
+void sh_destroy_monitor_table(const struct vcpu *v, mfn_t mmfn,
+                              unsigned int shadow_levels);
+
 /* VRAM dirty tracking helpers. */
 void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
                          mfn_t sl1mfn, const void *sl1e,
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d5096748ac..416b284123 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -262,15 +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
 
-/* 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)
-#define sh_destroy_monitor_table \
-        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)
 #endif
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 61534da538..726f48339a 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -107,8 +107,6 @@ struct shadow_paging_mode {
                                             mfn_t gmfn);
 #endif
 #ifdef CONFIG_HVM
-    mfn_t         (*make_monitor_table    )(struct vcpu *v);
-    void          (*destroy_monitor_table )(struct vcpu *v, mfn_t mmfn);
     int           (*guess_wrmap           )(struct vcpu *v, 
                                             unsigned long vaddr, mfn_t gmfn);
     void          (*pagetable_dying       )(paddr_t gpa);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15822.39012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUX2-0003sO-MW; Fri, 30 Oct 2020 13:33:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15822.39012; Fri, 30 Oct 2020 13:33:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUX2-0003sE-J7; Fri, 30 Oct 2020 13:33:28 +0000
Received: by outflank-mailman (input) for mailman id 15822;
 Fri, 30 Oct 2020 13:33:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUX1-0003s0-4P
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 84969a0f-16da-463d-9786-05f98aee63e1;
 Fri, 30 Oct 2020 13:33:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUX0-00012k-7U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUX0-0002C6-5q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUX1-0003s0-4P
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:27 +0000
X-Inumbo-ID: 84969a0f-16da-463d-9786-05f98aee63e1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 84969a0f-16da-463d-9786-05f98aee63e1;
	Fri, 30 Oct 2020 13:33:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T1M9HFQnSyd7M1W+cJ+Pf8mKB0D1952wsqZTPRqP9Sg=; b=zbkTrOXVZ5JeQ/Ydh/TWGnVXGF
	bvyZu4fAeXX02VDp854EKm6kxLYCd8B6l5U7jXN9mIUZTBpG8sUGavsv1AboGbShfmXGeLYPlDCEE
	odLKtWV/PBMYuoIByjypgwBydRts/xY/bNRVsiO31p9J4G390Dju/8Dm2hCwIE/2Mhhs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUX0-00012k-7U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUX0-0002C6-5q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: correct GFN use by sh_unshadow_for_p2m_change()
Message-Id: <E1kYUX0-0002C6-5q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:26 +0000

commit 92bc18632011c85a58247ce305ffa4ca583f52cd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:27:23 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:27:23 2020 +0100

    x86/shadow: correct GFN use by sh_unshadow_for_p2m_change()
    
    Luckily sh_remove_all_mappings()'s use of the parameter is limited to
    generation of log messages. Nevertheless we'd better pass correct GFNs
    around:
    - the incoming GFN, when replacing a large page, may not be large page
      aligned,
    - incrementing by page-size-scaled values can't be right.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/shadow/common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 0d59dea6ad..9c3d9a7cfd 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3121,6 +3121,8 @@ static void sh_unshadow_for_p2m_change(struct domain *d, unsigned long gfn,
                  && mfn_valid(nmfn) )
                 npte = map_domain_page(nmfn);
 
+            gfn &= ~(L1_PAGETABLE_ENTRIES - 1);
+
             for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
             {
                 if ( !npte
@@ -3129,8 +3131,7 @@ static void sh_unshadow_for_p2m_change(struct domain *d, unsigned long gfn,
                 {
                     /* This GFN->MFN mapping has gone away */
                     sh_remove_all_shadows_and_parents(d, omfn);
-                    if ( sh_remove_all_mappings(d, omfn,
-                                                _gfn(gfn + (i << PAGE_SHIFT))) )
+                    if ( sh_remove_all_mappings(d, omfn, _gfn(gfn + i)) )
                         cpumask_or(&flushmask, &flushmask, d->dirty_cpumask);
                 }
                 omfn = mfn_add(omfn, 1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15823.39015 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXB-0003to-O3; Fri, 30 Oct 2020 13:33:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15823.39015; Fri, 30 Oct 2020 13:33:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXB-0003tg-Kh; Fri, 30 Oct 2020 13:33:37 +0000
Received: by outflank-mailman (input) for mailman id 15823;
 Fri, 30 Oct 2020 13:33:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUXB-0003tZ-9J
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5153cdbe-dc4e-45bd-9167-72f897d2768e;
 Fri, 30 Oct 2020 13:33:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXA-00012w-Bg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXA-0002DA-AF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUXB-0003tZ-9J
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:37 +0000
X-Inumbo-ID: 5153cdbe-dc4e-45bd-9167-72f897d2768e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5153cdbe-dc4e-45bd-9167-72f897d2768e;
	Fri, 30 Oct 2020 13:33:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+sovVVTB47/iqLzhYR6FHoWIo8hETlRLhu0SphQgR44=; b=iUhcAzwEbZZAwbI2E3YRcagSgA
	dimVzfVvuQ9jOp1M0r3uV0V2coevESR+2fhdjt4DkbWtN3byXfRG1j785B6y07dKCSV/EC6mvPCho
	fZcwxv4fxwUOs0eNYvY2ibxX3bihfngD2DLkC47o5UXihg1YQAZdMTMA7Vpvp2ugiUxo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXA-00012w-Bg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXA-0002DA-AF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: process softirq while saving/loading entries
Message-Id: <E1kYUXA-0002DA-AF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:36 +0000

commit e0daa27e9511f7c9ce6e2be7655231e112d69920
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Oct 30 14:28:03 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:28:03 2020 +0100

    x86/hvm: process softirq while saving/loading entries
    
    On slow systems with sync_console saving or loading the context of big
    guests can cause the watchdog to trigger. Fix this by adding a couple
    of process_pending_softirqs.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/save.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c
index a2c56fbc1e..584620985b 100644
--- a/xen/arch/x86/hvm/save.c
+++ b/xen/arch/x86/hvm/save.c
@@ -21,6 +21,7 @@
  */
 
 #include <xen/guest_access.h>
+#include <xen/softirq.h>
 #include <xen/version.h>
 
 #include <asm/hvm/support.h>
@@ -255,6 +256,7 @@ int hvm_save(struct domain *d, hvm_domain_context_t *h)
                            v, i);
                     return -ENODATA;
                 }
+                process_pending_softirqs();
             }
         }
         else
@@ -268,6 +270,7 @@ int hvm_save(struct domain *d, hvm_domain_context_t *h)
                        d->domain_id, i);
                 return -ENODATA;
             }
+            process_pending_softirqs();
         }
     }
 
@@ -341,6 +344,7 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h)
                    d->domain_id, desc->typecode, desc->instance);
             return -1;
         }
+        process_pending_softirqs();
     }
 
     /* Not reached */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15824.39019 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXM-0003vC-Pc; Fri, 30 Oct 2020 13:33:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15824.39019; Fri, 30 Oct 2020 13:33:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXM-0003v4-Mc; Fri, 30 Oct 2020 13:33:48 +0000
Received: by outflank-mailman (input) for mailman id 15824;
 Fri, 30 Oct 2020 13:33:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUXM-0003ux-4c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1267a878-5ea5-43ef-8f5e-ed05d8739176;
 Fri, 30 Oct 2020 13:33:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXK-000136-HC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXK-0002Dz-FQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUXM-0003ux-4c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:48 +0000
X-Inumbo-ID: 1267a878-5ea5-43ef-8f5e-ed05d8739176
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1267a878-5ea5-43ef-8f5e-ed05d8739176;
	Fri, 30 Oct 2020 13:33:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gOg/o+ZwS/s44fxhja7IojGfYkAQ3e5AYpss4SvWISw=; b=KuZqg+WoelSybu7UUYOvAChX0U
	7T/ByuJc5PqUGCCe5jNscjKRCdm2Iz7A7pe7UubOkRzPffPPu4cI9FlXJ8zMCHoRPW3Safyn/Hh9M
	JNc/fUKZD/j6qwBtjtLJ9W7Raet1X2TAeiRQ1y/PfjalZaMwO6jYRYtmgzft4iF27HhA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXK-000136-HC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXK-0002Dz-FQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: support AVX-VNNI
Message-Id: <E1kYUXK-0002Dz-FQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:46 +0000

commit a780b17c72ef9f40f024a32fcda19f2544acaf2a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:29:06 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:29:06 2020 +0100

    x86emul: support AVX-VNNI
    
    These are VEX-encoded equivalents of the EVEX-encoded AVX512-VNNI ISA
    extension.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libs/light/libxl_cpuid.c               |  1 +
 tools/misc/xen-cpuid.c                       |  2 +-
 tools/tests/x86_emulator/predicates.c        |  4 ++
 tools/tests/x86_emulator/test_x86_emulator.c | 55 ++++++++++++++++++++++++++++
 tools/tests/x86_emulator/x86-emulate.h       |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.c       |  9 +++++
 xen/include/asm-x86/cpufeature.h             |  1 +
 xen/include/public/arch-x86/cpufeatureset.h  |  1 +
 xen/tools/gen-cpuid.py                       |  2 +-
 9 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 16c077cceb..259612834e 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -226,6 +226,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
         {"core-caps",    0x00000007,  0, CPUID_REG_EDX, 30,  1},
         {"ssbd",         0x00000007,  0, CPUID_REG_EDX, 31,  1},
 
+        {"avx-vnni",     0x00000007,  1, CPUID_REG_EAX,  4,  1},
         {"avx512-bf16",  0x00000007,  1, CPUID_REG_EAX,  5,  1},
 
         {"lahfsahf",     0x80000001, NA, CPUID_REG_ECX,  0,  1},
diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c
index 2446941a47..c81aa93055 100644
--- a/tools/misc/xen-cpuid.c
+++ b/tools/misc/xen-cpuid.c
@@ -175,7 +175,7 @@ static const char *const str_7d0[32] =
 
 static const char *const str_7a1[32] =
 {
-    /* 4 */                 [ 5] = "avx512-bf16",
+    [ 4] = "avx-vnni",      [ 5] = "avx512-bf16",
 };
 
 static const struct {
diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 137681ba78..94b99c94e8 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -1335,6 +1335,10 @@ static const struct vex {
     { { 0x45 }, 2, T, R, pfx_66, Wn, Ln }, /* vpsrlv{d,q} */
     { { 0x46 }, 2, T, R, pfx_66, W0, Ln }, /* vpsravd */
     { { 0x47 }, 2, T, R, pfx_66, Wn, Ln }, /* vpsllv{d,q} */
+    { { 0x50 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpbusd */
+    { { 0x51 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpbusds */
+    { { 0x52 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpwssd */
+    { { 0x53 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpwssds */
     { { 0x58 }, 2, T, R, pfx_66, W0, Ln }, /* vpbroadcastd */
     { { 0x59 }, 2, T, R, pfx_66, W0, Ln }, /* vpbroadcastq */
     { { 0x5a }, 2, F, R, pfx_66, W0, L1 }, /* vbroadcasti128 */
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index b9663214e2..cbb8f34f58 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -5028,6 +5028,61 @@ int main(int argc, char **argv)
         printf("okay\n");
     }
 
+    printf("%-40s", "Testing vpdpwssd (%ecx),%{y,z}mmA,%{y,z}mmB...");
+    if ( stack_exec && cpu_has_avx512_vnni && cpu_has_avx_vnni )
+    {
+        /* Do the same operation two ways and compare the results. */
+        decl_insn(vpdpwssd_vex1);
+        decl_insn(vpdpwssd_vex2);
+        decl_insn(vpdpwssd_evex);
+
+        for ( i = 0; i < 24; ++i )
+            res[i] = i | (~i << 16);
+
+        asm volatile ( "vmovdqu32 32(%0), %%zmm1\n\t"
+                       "vextracti64x4 $1, %%zmm1, %%ymm2\n\t"
+                       "vpxor %%xmm0, %%xmm0, %%xmm3\n\t"
+                       "vpxor %%xmm0, %%xmm0, %%xmm4\n\t"
+                       "vpxor %%xmm0, %%xmm0, %%xmm5\n"
+                       put_insn(vpdpwssd_vex1,
+                                /* %{vex%} vpdpwssd (%1), %%ymm1, %%ymm3" */
+                                ".byte 0xc4, 0xe2, 0x75, 0x52, 0x19") "\n"
+                       put_insn(vpdpwssd_vex2,
+                                /* "%{vex%} vpdpwssd 32(%1), %%ymm2, %%ymm4" */
+                                ".byte 0xc4, 0xe2, 0x6d, 0x52, 0x61, 0x20") "\n"
+                       put_insn(vpdpwssd_evex,
+                                /* "vpdpwssd (%1), %%zmm1, %%zmm5" */
+                                ".byte 0x62, 0xf2, 0x75, 0x48, 0x52, 0x29")
+                       :: "r" (res), "c" (NULL) );
+
+        set_insn(vpdpwssd_vex1);
+        regs.ecx = (unsigned long)res;
+        rc = x86_emulate(&ctxt, &emulops);
+        if ( rc != X86EMUL_OKAY || !check_eip(vpdpwssd_vex1) )
+            goto fail;
+
+        set_insn(vpdpwssd_vex2);
+        regs.ecx = (unsigned long)res;
+        rc = x86_emulate(&ctxt, &emulops);
+        if ( rc != X86EMUL_OKAY || !check_eip(vpdpwssd_vex2) )
+            goto fail;
+
+        set_insn(vpdpwssd_evex);
+        regs.ecx = (unsigned long)res;
+        rc = x86_emulate(&ctxt, &emulops);
+        if ( rc != X86EMUL_OKAY || !check_eip(vpdpwssd_evex) )
+            goto fail;
+
+        asm ( "vinserti64x4 $1, %%ymm4, %%zmm3, %%zmm0\n\t"
+              "vpcmpeqd %%zmm0, %%zmm5, %%k0\n\t"
+              "kmovw %%k0, %0" : "=g" (rc) );
+        if ( rc != 0xffff )
+            goto fail;
+        printf("okay\n");
+    }
+    else
+        printf("skipped\n");
+
     printf("%-40s", "Testing invpcid 16(%ecx),%%edx...");
     if ( stack_exec )
     {
diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index fc52edf8ce..e1a2aaef68 100644
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -170,6 +170,7 @@ static inline bool xcr0_mask(uint64_t mask)
 #define cpu_has_avx512_4fmaps (cp.feat.avx512_4fmaps && xcr0_mask(0xe6))
 #define cpu_has_avx512_vp2intersect (cp.feat.avx512_vp2intersect && xcr0_mask(0xe6))
 #define cpu_has_serialize  cp.feat.serialize
+#define cpu_has_avx_vnni   (cp.feat.avx_vnni && xcr0_mask(6))
 #define cpu_has_avx512_bf16 (cp.feat.avx512_bf16 && xcr0_mask(0xe6))
 
 #define cpu_has_xgetbv1   (cpu_has_xsave && cp.xstate.xgetbv1)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index fd70551bc2..a35b63634b 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2008,6 +2008,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #define vcpu_has_avx512_4fmaps() (ctxt->cpuid->feat.avx512_4fmaps)
 #define vcpu_has_avx512_vp2intersect() (ctxt->cpuid->feat.avx512_vp2intersect)
 #define vcpu_has_serialize()   (ctxt->cpuid->feat.serialize)
+#define vcpu_has_avx_vnni()    (ctxt->cpuid->feat.avx_vnni)
 #define vcpu_has_avx512_bf16() (ctxt->cpuid->feat.avx512_bf16)
 
 #define vcpu_must_have(feat) \
@@ -9453,6 +9454,14 @@ x86_emulate(
         generate_exception_if(vex.l, EXC_UD);
         goto simd_0f_avx;
 
+    case X86EMUL_OPC_VEX_66(0x0f38, 0x50): /* vpdpbusd [xy]mm/mem,[xy]mm,[xy]mm */
+    case X86EMUL_OPC_VEX_66(0x0f38, 0x51): /* vpdpbusds [xy]mm/mem,[xy]mm,[xy]mm */
+    case X86EMUL_OPC_VEX_66(0x0f38, 0x52): /* vpdpwssd [xy]mm/mem,[xy]mm,[xy]mm */
+    case X86EMUL_OPC_VEX_66(0x0f38, 0x53): /* vpdpwssds [xy]mm/mem,[xy]mm,[xy]mm */
+        host_and_vcpu_must_have(avx_vnni);
+        generate_exception_if(vex.w, EXC_UD);
+        goto simd_0f_avx;
+
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x50): /* vpdpbusd [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x51): /* vpdpbusds [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x52): /* vpdpwssd [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
diff --git a/xen/include/asm-x86/cpufeature.h b/xen/include/asm-x86/cpufeature.h
index 4de992781e..ad3d84bdde 100644
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -133,6 +133,7 @@
 #define cpu_has_serialize       boot_cpu_has(X86_FEATURE_SERIALIZE)
 
 /* CPUID level 0x00000007:1.eax */
+#define cpu_has_avx_vnni        boot_cpu_has(X86_FEATURE_AVX_VNNI)
 #define cpu_has_avx512_bf16     boot_cpu_has(X86_FEATURE_AVX512_BF16)
 
 /* Synthesized. */
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index ef7cca334d..6f7efaad6d 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -273,6 +273,7 @@ XEN_CPUFEATURE(CORE_CAPS,     9*32+30) /*   IA32_CORE_CAPABILITIES MSR */
 XEN_CPUFEATURE(SSBD,          9*32+31) /*A  MSR_SPEC_CTRL.SSBD available */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1.eax, word 10 */
+XEN_CPUFEATURE(AVX_VNNI,     10*32+ 4) /*A  AVX-VNNI Instructions */
 XEN_CPUFEATURE(AVX512_BF16,  10*32+ 5) /*A  AVX512 BFloat16 Instructions */
 
 #endif /* XEN_CPUFEATURE */
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index 143ee7cae1..50412b9a46 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -252,7 +252,7 @@ def crunch_numbers(state):
         # feature flags.  If want to use AVX512, AVX2 must be supported and
         # enabled.  Certain later extensions, acting on 256-bit vectors of
         # integers, better depend on AVX2 than AVX.
-        AVX2: [AVX512F, VAES, VPCLMULQDQ],
+        AVX2: [AVX512F, VAES, VPCLMULQDQ, AVX_VNNI],
 
         # AVX512F is taken to mean hardware support for 512bit registers
         # (which in practice depends on the EVEX prefix to encode) as well
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:33:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15825.39023 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXW-0003wV-RU; Fri, 30 Oct 2020 13:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15825.39023; Fri, 30 Oct 2020 13:33:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXW-0003wL-OG; Fri, 30 Oct 2020 13:33:58 +0000
Received: by outflank-mailman (input) for mailman id 15825;
 Fri, 30 Oct 2020 13:33:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUXW-0003wF-90
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d0fc3402-26e4-4955-a652-77eaff796415;
 Fri, 30 Oct 2020 13:33:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXU-00013C-LP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXU-0002Eo-Jh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUXW-0003wF-90
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:58 +0000
X-Inumbo-ID: d0fc3402-26e4-4955-a652-77eaff796415
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d0fc3402-26e4-4955-a652-77eaff796415;
	Fri, 30 Oct 2020 13:33:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mnzdo8NggalsqVIW+iXO9bu0wPi2OiFlU3i65i0A/5k=; b=uhm4aGd14Xtf1KVPadjY/5rRZw
	8QqMcoz/rAeFEhMbNVnv8Y5H6I/ZlOmjqy8XfCOu6ZHCaz1RG8CctwEFRzRJDc9qhK/FtVNjNhQZZ
	FKb9pI6sn92FBKrKjFnzeV7Kvm+I30cbTHwoRbkD/3O7aLwY6XIiBaAY/h8tmVyXTF7I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXU-00013C-LP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXU-0002Eo-Jh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:33:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HVM: send mapcache invalidation request to qemu regardless of preemption
Message-Id: <E1kYUXU-0002Eo-Jh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:33:56 +0000

commit 177cf860f0b7dcbb8e0f4b495cad677995444c7a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:30:00 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:30:00 2020 +0100

    x86/HVM: send mapcache invalidation request to qemu regardless of preemption
    
    Even if only part of a hypercall completed before getting preempted,
    invalidation ought to occur. Therefore fold the two return statements.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hypercall.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index b6ccaf4457..ac573c8e94 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -326,14 +326,11 @@ int hvm_hypercall(struct cpu_user_regs *regs)
 
     HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%lu -> %lx", eax, regs->rax);
 
-    if ( curr->hcall_preempted )
-        return HVM_HCALL_preempted;
-
     if ( unlikely(currd->arch.hvm.qemu_mapcache_invalidate) &&
          test_and_clear_bool(currd->arch.hvm.qemu_mapcache_invalidate) )
         send_invalidate_req();
 
-    return HVM_HCALL_completed;
+    return curr->hcall_preempted ? HVM_HCALL_preempted : HVM_HCALL_completed;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:34:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15826.39028 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXg-0003xn-TO; Fri, 30 Oct 2020 13:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15826.39028; Fri, 30 Oct 2020 13:34:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXg-0003xf-Pm; Fri, 30 Oct 2020 13:34:08 +0000
Received: by outflank-mailman (input) for mailman id 15826;
 Fri, 30 Oct 2020 13:34:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUXf-0003xX-I5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4d26d840-a246-49d2-af55-e564051b2a61;
 Fri, 30 Oct 2020 13:34:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXe-00013Z-PX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXe-0002Fx-OS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUXf-0003xX-I5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:07 +0000
X-Inumbo-ID: 4d26d840-a246-49d2-af55-e564051b2a61
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4d26d840-a246-49d2-af55-e564051b2a61;
	Fri, 30 Oct 2020 13:34:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SDwd/lGrxYGnf7i4yhFj/ZEb2fbEYqCNGqhD4RC2rNo=; b=3FmKiGyZSM3FcrSNLKDOffbTCx
	C4+zT8sde6ATBCZEaqB3lIA9P5DhmlptUUtB/t6+6TsFD2TW416cNDkARpDIV1fbFVfVKHMQao2t0
	uD5zNYg9ZLX6OueGH9Ys8MarwHG/pWoHx992icF8Gob94Iy5pHoklXDdj3cbBzL/5VXI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXe-00013Z-PX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXe-0002Fx-OS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: fix build of PV shim when !GRANT_TABLE
Message-Id: <E1kYUXe-0002Fx-OS@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:34:06 +0000

commit b1b4f9598b021c7a9dc6b33eb55bc3e5912614f6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:30:35 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:30:35 2020 +0100

    x86: fix build of PV shim when !GRANT_TABLE
    
    To do its compat translation, shim code needs to include the compat
    header. For this to work, this header first of all needs to be
    generated.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/include/Makefile b/xen/include/Makefile
index 5c2f57a0f6..75e982a316 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -24,6 +24,7 @@ headers-$(CONFIG_X86)     += compat/arch-x86/xen-$(compat-arch-y).h
 headers-$(CONFIG_ARGO)    += compat/argo.h
 headers-$(CONFIG_PV)      += compat/callback.h
 headers-$(CONFIG_GRANT_TABLE) += compat/grant_table.h
+headers-$(CONFIG_PV_SHIM) += compat/grant_table.h
 headers-$(CONFIG_HVM)     += compat/hvm/dm_op.h
 headers-$(CONFIG_HVM)     += compat/hvm/hvm_op.h
 headers-$(CONFIG_HVM)     += compat/hvm/hvm_vcpu.h
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 13:34:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 13:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.15827.39032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXq-0003zD-Up; Fri, 30 Oct 2020 13:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 15827.39032; Fri, 30 Oct 2020 13:34:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYUXq-0003z3-RT; Fri, 30 Oct 2020 13:34:18 +0000
Received: by outflank-mailman (input) for mailman id 15827;
 Fri, 30 Oct 2020 13:34:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYUXp-0003yu-TH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a5ccde0c-bbaf-40c4-a899-451096f86569;
 Fri, 30 Oct 2020 13:34:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXo-00013g-Sv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYUXo-0002H1-Ry
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYUXp-0003yu-TH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:17 +0000
X-Inumbo-ID: a5ccde0c-bbaf-40c4-a899-451096f86569
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a5ccde0c-bbaf-40c4-a899-451096f86569;
	Fri, 30 Oct 2020 13:34:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dwP0wjYmVuFZld66u+qlzaNDINSH7LcgeOSdhaUphio=; b=JrWsVppl9oPW7O5t8oa40QObBc
	+dr3u9FH84uCd5XU2aEtsyz2Pfn2n7TffWEaLPBw25u862AvLJAjlo+Q4x4ZXiRYb54iKOmWaZG5t
	kyKTKGj/fBHYupu0bHT/OiUrlxQop3S7NrSt/q+bY1m9ekrg+Hm6MZ+joNCdqRjbQvXs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXo-00013g-Sv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYUXo-0002H1-Ry
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 13:34:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: PV shim doesn't need GRANT_TABLE
Message-Id: <E1kYUXo-0002H1-Ry@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 13:34:16 +0000

commit ca56b06043bb4241eeb0a41a60daffb1408a08d5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 14:31:00 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 14:31:00 2020 +0100

    x86: PV shim doesn't need GRANT_TABLE
    
    The only reference into the code controlled by this option is from the
    hypercall table, and that hypercall table entry gets overwritten.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/configs/pvshim_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig
index 5478b991ac..cdf5776610 100644
--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -9,6 +9,7 @@ CONFIG_EXPERT=y
 CONFIG_SCHED_NULL=y
 # Disable features not used by the PV shim
 # CONFIG_XEN_SHSTK is not set
+# CONFIG_GRANT_TABLE is not set
 # CONFIG_HYPFS is not set
 # CONFIG_BIGMEM is not set
 # CONFIG_KEXEC is not set
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 18:11:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 18:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16134.39433 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYYsH-0006cU-CL; Fri, 30 Oct 2020 18:11:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16134.39433; Fri, 30 Oct 2020 18:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYYsH-0006cM-9E; Fri, 30 Oct 2020 18:11:41 +0000
Received: by outflank-mailman (input) for mailman id 16134;
 Fri, 30 Oct 2020 18:11:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYYsF-0006cE-Hd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d7727310-872e-41c3-8244-07be0d26af13;
 Fri, 30 Oct 2020 18:11:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYYs9-0007RW-OY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYYs9-0000jl-M5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYYsF-0006cE-Hd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:39 +0000
X-Inumbo-ID: d7727310-872e-41c3-8244-07be0d26af13
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d7727310-872e-41c3-8244-07be0d26af13;
	Fri, 30 Oct 2020 18:11:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WVBCaOhgc4PMRd7tZekIwWZ6LYA2UtVs13RaEDPTw60=; b=W8ttQT+xdrV6ZGZcVqBgELrMfa
	RRmRDhkc7ssgqjMQQylpF86GSiEO4uX23+m936p5oTFabkhebtso15mP3CQVW1cGGK3b0ffFUDr3C
	a2ri7ISBXp5o565dbHbdlF5GZTHqQfUm7/D7yevkt/NVtIt6BpH5RlJQiNfx2raoCYTM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYYs9-0007RW-OY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYYs9-0000jl-M5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:11:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Open 5.1 development tree
Message-Id: <E1kYYs9-0000jl-M5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 18:11:33 +0000

commit a7922a3c81f34f45b1ebc9670a7769edc4c42a43
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Apr 29 15:07:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Apr 29 15:07:10 2020 +0100

    Open 5.1 development tree
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 0062ac9718..a480698ce5 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.0
+5.0.50
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 18:22:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 18:22:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16147.39461 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZ2r-0007ia-Nm; Fri, 30 Oct 2020 18:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16147.39461; Fri, 30 Oct 2020 18:22:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZ2r-0007iS-KH; Fri, 30 Oct 2020 18:22:37 +0000
Received: by outflank-mailman (input) for mailman id 16147;
 Fri, 30 Oct 2020 18:22:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZ2q-0007iF-L6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 478742f8-28c5-464d-a6dc-1f7f27ebbe5f;
 Fri, 30 Oct 2020 18:22:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZ2n-0007fV-0q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZ2m-0004B8-Vy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZ2q-0007iF-L6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:36 +0000
X-Inumbo-ID: 478742f8-28c5-464d-a6dc-1f7f27ebbe5f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 478742f8-28c5-464d-a6dc-1f7f27ebbe5f;
	Fri, 30 Oct 2020 18:22:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6pdWxgaCuVJ4Dtx8NrQACV5AtMPrrV2BA11wdV/Zyd0=; b=gfjmYbA0iBv0V4QRYKysXIIedP
	ki3pbiDL5sljUNHFPnvYs43SkkELSAiYE1wtEZrKBOEyT5xpni9OlOxzaexdXVcFLpX+19jU6LqX3
	ygGuK5hLte2VWK7xKUK7Zci9gTZlK4aZ8gtI3mZFgZSJ9d9MpzAtoaOUNCrlhTCKy+Ek=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZ2n-0007fV-0q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZ2m-0004B8-Vy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:22:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-04-29' into staging
Message-Id: <E1kYZ2m-0004B8-Vy@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 18:22:32 +0000

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

commit 648db19685b7030aa558a4ddbd3a8e53d8c9a062
Merge: a7922a3c81f34f45b1ebc9670a7769edc4c42a43 8ef3a4be27efccd791d05e74b7b17d918f511a76
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Apr 29 15:07:33 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Apr 29 15:07:33 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2020-04-29' into staging
    
    Miscellaneous patches for 2020-04-29
    
    # gpg: Signature made Wed 29 Apr 2020 07:42:52 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-misc-2020-04-29: (32 commits)
      qemu-option: pass NULL rather than 0 to the id of qemu_opts_set()
      libqos: Give get_machine_allocator() internal linkage
      fuzz: Simplify how we compute available machines and types
      Makefile: Drop unused, broken target recurse-fuzz
      smbus: Fix spd_data_generate() for number of banks > 2
      bamboo, sam460ex: Tidy up error message for unsupported RAM size
      smbus: Fix spd_data_generate() error API violation
      sam460ex: Suppress useless warning on -m 32 and -m 64
      qga: Fix qmp_guest_suspend_{disk, ram}() error handling
      qga: Fix qmp_guest_get_memory_blocks() error handling
      tests/test-logging: Fix test for -dfilter 0..0xffffffffffffffff
      migration/colo: Fix qmp_xen_colo_do_checkpoint() error handling
      io: Fix qio_channel_socket_close() error handling
      xen/pt: Fix flawed conversion to realize()
      virtio-net: Fix duplex=... and speed=... error handling
      bochs-display: Fix vgamem=SIZE error handling
      fdc: Fix fallback=auto error handling
      arm/virt: Fix virt_machine_device_plug_cb() error API violation
      cpus: Proper range-checking for -icount shift=N
      cpus: Fix configure_icount() error API violation
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Makefile                          |   1 -
 backends/cryptodev-builtin.c      |  10 +-
 block/file-posix.c                |   5 +-
 block/replication.c               |   4 +-
 block/vhdx.c                      |   8 +-
 cpus.c                            |  50 ++++++----
 dump/dump.c                       |   2 +-
 hw/arm/virt.c                     |   4 +-
 hw/block/fdc.c                    |   1 +
 hw/display/bochs-display.c        |   6 +-
 hw/i2c/smbus_eeprom.c             |  32 +-----
 hw/mips/mips_fulong2e.c           |  10 +-
 hw/net/virtio-net.c               |   7 +-
 hw/ppc/ppc4xx_devs.c              |   8 +-
 hw/ppc/sam460ex.c                 |  13 +--
 hw/riscv/sifive_u.c               |   2 +-
 hw/scsi/scsi-disk.c               |   2 +-
 hw/sd/sdhci.c                     |   2 +-
 hw/xen/xen_pt.c                   |  12 +--
 include/hw/i2c/smbus_eeprom.h     |   2 +-
 include/qemu/option.h             |   1 -
 io/channel-socket.c               |   5 +-
 migration/colo.c                  |   8 +-
 qemu-img.c                        |  87 +++++++++-------
 qga/commands-posix.c              |   3 +
 qga/commands-win32.c              |  14 +++
 softmmu/vl.c                      |  10 +-
 target/i386/cpu.c                 |  18 ++--
 target/microblaze/cpu.c           |  14 +--
 target/ppc/translate_init.inc.c   |   4 +-
 tests/qtest/fuzz/qos_fuzz.c       |  34 ++-----
 tests/qtest/libqos/qos_external.c |  68 +++++--------
 tests/qtest/libqos/qos_external.h |  10 +-
 tests/qtest/qos-test.c            |  29 ++++--
 tests/test-logging.c              |   4 +-
 tests/test-qemu-opts.c            |  46 ++++++++-
 util/qemu-option.c                | 202 +++++++++++++++++++-------------------
 37 files changed, 384 insertions(+), 354 deletions(-)

diff --git a/Makefile b/Makefile
index 8a9113e666..34275f57c9 100644
--- a/Makefile
+++ b/Makefile
@@ -582,7 +582,6 @@ $(ROM_DIRS_RULES):
 
 .PHONY: recurse-all recurse-clean recurse-install
 recurse-all: $(addsuffix /all, $(TARGET_DIRS) $(ROM_DIRS))
-recurse-fuzz: $(addsuffix /fuzz, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-clean: $(addsuffix /clean, $(TARGET_DIRS) $(ROM_DIRS))
 recurse-install: $(addsuffix /install, $(TARGET_DIRS))
 $(addsuffix /install, $(TARGET_DIRS)): all
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index c8ae3b9742..14316333fe 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -282,12 +282,7 @@ static int cryptodev_builtin_sym_close_session(
     CryptoDevBackendBuiltin *builtin =
                       CRYPTODEV_BACKEND_BUILTIN(backend);
 
-    if (session_id >= MAX_NUM_SESSIONS ||
-              builtin->sessions[session_id] == NULL) {
-        error_setg(errp, "Cannot find a valid session id: %" PRIu64 "",
-                      session_id);
-        return -1;
-    }
+    assert(session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]);
 
     qcrypto_cipher_free(builtin->sessions[session_id]->cipher);
     g_free(builtin->sessions[session_id]);
@@ -356,8 +351,7 @@ static void cryptodev_builtin_cleanup(
 
     for (i = 0; i < MAX_NUM_SESSIONS; i++) {
         if (builtin->sessions[i] != NULL) {
-            cryptodev_builtin_sym_close_session(
-                    backend, i, 0, errp);
+            cryptodev_builtin_sym_close_session(backend, i, 0, &error_abort);
         }
     }
 
diff --git a/block/file-posix.c b/block/file-posix.c
index 7e19bbff5f..094e3b0212 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2691,10 +2691,13 @@ static void check_cache_dropped(BlockDriverState *bs, Error **errp)
         vec_end = DIV_ROUND_UP(length, page_size);
         for (i = 0; i < vec_end; i++) {
             if (vec[i] & 0x1) {
-                error_setg(errp, "page cache still in use!");
                 break;
             }
         }
+        if (i < vec_end) {
+            error_setg(errp, "page cache still in use!");
+            break;
+        }
     }
 
     if (window) {
diff --git a/block/replication.c b/block/replication.c
index da013c2041..971f0fe266 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -172,8 +172,8 @@ static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
     if ((bs->open_flags & (BDRV_O_INACTIVE | BDRV_O_RDWR)) == BDRV_O_RDWR) {
         *nperm |= BLK_PERM_WRITE;
     }
-    *nshared = BLK_PERM_CONSISTENT_READ \
-               | BLK_PERM_WRITE \
+    *nshared = BLK_PERM_CONSISTENT_READ
+               | BLK_PERM_WRITE
                | BLK_PERM_WRITE_UNCHANGED;
     return;
 }
diff --git a/block/vhdx.c b/block/vhdx.c
index 33e57cd656..e16fdc2f2d 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -2206,20 +2206,20 @@ static QemuOptsList vhdx_create_opts = {
            .name = VHDX_BLOCK_OPT_BLOCK_SIZE,
            .type = QEMU_OPT_SIZE,
            .def_value_str = stringify(0),
-           .help = "Block Size; min 1MB, max 256MB. " \
+           .help = "Block Size; min 1MB, max 256MB. "
                    "0 means auto-calculate based on image size."
        },
        {
            .name = BLOCK_OPT_SUBFMT,
            .type = QEMU_OPT_STRING,
-           .help = "VHDX format type, can be either 'dynamic' or 'fixed'. "\
+           .help = "VHDX format type, can be either 'dynamic' or 'fixed'. "
                    "Default is 'dynamic'."
        },
        {
            .name = VHDX_BLOCK_OPT_ZERO,
            .type = QEMU_OPT_BOOL,
-           .help = "Force use of payload blocks of type 'ZERO'. "\
-                   "Non-standard, but default.  Do not set to 'off' when "\
+           .help = "Force use of payload blocks of type 'ZERO'. "
+                   "Non-standard, but default.  Do not set to 'off' when "
                    "using 'qemu-img convert' with subformat=dynamic."
        },
        { NULL }
diff --git a/cpus.c b/cpus.c
index ef441bdf62..5670c96bcf 100644
--- a/cpus.c
+++ b/cpus.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/config-file.h"
+#include "qemu/cutils.h"
 #include "migration/vmstate.h"
 #include "monitor/monitor.h"
 #include "qapi/error.h"
@@ -797,40 +798,47 @@ void cpu_ticks_init(void)
 
 void configure_icount(QemuOpts *opts, Error **errp)
 {
-    const char *option;
-    char *rem_str = NULL;
+    const char *option = qemu_opt_get(opts, "shift");
+    bool sleep = qemu_opt_get_bool(opts, "sleep", true);
+    bool align = qemu_opt_get_bool(opts, "align", false);
+    long time_shift = -1;
 
-    option = qemu_opt_get(opts, "shift");
-    if (!option) {
-        if (qemu_opt_get(opts, "align") != NULL) {
-            error_setg(errp, "Please specify shift option when using align");
-        }
+    if (!option && qemu_opt_get(opts, "align")) {
+        error_setg(errp, "Please specify shift option when using align");
         return;
     }
 
-    icount_sleep = qemu_opt_get_bool(opts, "sleep", true);
-    if (icount_sleep) {
-        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                         icount_timer_cb, NULL);
-    }
-
-    icount_align_option = qemu_opt_get_bool(opts, "align", false);
-
-    if (icount_align_option && !icount_sleep) {
+    if (align && !sleep) {
         error_setg(errp, "align=on and sleep=off are incompatible");
+        return;
     }
+
     if (strcmp(option, "auto") != 0) {
-        errno = 0;
-        timers_state.icount_time_shift = strtol(option, &rem_str, 0);
-        if (errno != 0 || *rem_str != '\0' || !strlen(option)) {
+        if (qemu_strtol(option, NULL, 0, &time_shift) < 0
+            || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
             error_setg(errp, "icount: Invalid shift value");
+            return;
         }
-        use_icount = 1;
-        return;
     } else if (icount_align_option) {
         error_setg(errp, "shift=auto and align=on are incompatible");
+        return;
     } else if (!icount_sleep) {
         error_setg(errp, "shift=auto and sleep=off are incompatible");
+        return;
+    }
+
+    icount_sleep = sleep;
+    if (icount_sleep) {
+        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
+                                         icount_timer_cb, NULL);
+    }
+
+    icount_align_option = align;
+
+    if (time_shift >= 0) {
+        timers_state.icount_time_shift = time_shift;
+        use_icount = 1;
+        return;
     }
 
     use_icount = 2;
diff --git a/dump/dump.c b/dump/dump.c
index 22ed1d3b0d..248ea06370 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1892,7 +1892,7 @@ static void dump_process(DumpState *s, Error **errp)
     result = qmp_query_dump(NULL);
     /* should never fail */
     assert(result);
-    qapi_event_send_dump_completed(result, !!local_err, (local_err ? \
+    qapi_event_send_dump_completed(result, !!local_err, (local_err ?
                                    error_get_pretty(local_err) : NULL));
     qapi_free_DumpQueryResult(result);
 
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7dc96abf72..cca5316256 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1186,7 +1186,7 @@ static void create_smmu(const VirtMachineState *vms,
     g_free(node);
 }
 
-static void create_virtio_iommu_dt_bindings(VirtMachineState *vms, Error **errp)
+static void create_virtio_iommu_dt_bindings(VirtMachineState *vms)
 {
     const char compat[] = "virtio,pci-iommu";
     uint16_t bdf = vms->virtio_iommu_bdf;
@@ -2118,7 +2118,7 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
 
         vms->iommu = VIRT_IOMMU_VIRTIO;
         vms->virtio_iommu_bdf = pci_get_bdf(pdev);
-        create_virtio_iommu_dt_bindings(vms, errp);
+        create_virtio_iommu_dt_bindings(vms);
     }
 }
 
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 33bc9e2f92..9628cc171e 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2615,6 +2615,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
 
     if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
         error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
+        return;
     }
 
     /* Fill 'command_to_handler' lookup table */
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index 70eb619ef4..e763a0a72d 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -267,16 +267,18 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp)
     Object *obj = OBJECT(dev);
     int ret;
 
-    s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s);
-
     if (s->vgamem < 4 * MiB) {
         error_setg(errp, "bochs-display: video memory too small");
+        return;
     }
     if (s->vgamem > 256 * MiB) {
         error_setg(errp, "bochs-display: video memory too big");
+        return;
     }
     s->vgamem = pow2ceil(s->vgamem);
 
+    s->con = graphic_console_init(DEVICE(dev), 0, &bochs_display_gfx_ops, s);
+
     memory_region_init_ram(&s->vram, obj, "bochs-display-vram", s->vgamem,
                            &error_fatal);
     memory_region_init_io(&s->vbe, obj, &bochs_display_vbe_ops, s,
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c
index 5adf3b15b5..e199fc8678 100644
--- a/hw/i2c/smbus_eeprom.c
+++ b/hw/i2c/smbus_eeprom.c
@@ -195,8 +195,7 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,
 }
 
 /* Generate SDRAM SPD EEPROM data describing a module of type and size */
-uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size,
-                           Error **errp)
+uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size)
 {
     uint8_t *spd;
     uint8_t nbanks;
@@ -222,39 +221,18 @@ uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t ram_size,
         g_assert_not_reached();
     }
     size = ram_size >> 20; /* work in terms of megabytes */
-    if (size < 4) {
-        error_setg(errp, "SDRAM size is too small");
-        return NULL;
-    }
     sz_log2 = 31 - clz32(size);
     size = 1U << sz_log2;
-    if (ram_size > size * MiB) {
-        error_setg(errp, "SDRAM size 0x"RAM_ADDR_FMT" is not a power of 2, "
-                   "truncating to %u MB", ram_size, size);
-    }
-    if (sz_log2 < min_log2) {
-        error_setg(errp,
-                   "Memory size is too small for SDRAM type, adjusting type");
-        if (size >= 32) {
-            type = DDR;
-            min_log2 = 5;
-            max_log2 = 12;
-        } else {
-            type = SDR;
-            min_log2 = 2;
-            max_log2 = 9;
-        }
-    }
+    assert(ram_size == size * MiB);
+    assert(sz_log2 >= min_log2);
 
     nbanks = 1;
     while (sz_log2 > max_log2 && nbanks < 8) {
         sz_log2--;
-        nbanks++;
+        nbanks *= 2;
     }
 
-    if (size > (1ULL << sz_log2) * nbanks) {
-        error_setg(errp, "Memory size is too big for SDRAM, truncating");
-    }
+    assert(size == (1ULL << sz_log2) * nbanks);
 
     /* split to 2 banks if possible to avoid a bug in MIPS Malta firmware */
     if (nbanks == 1 && sz_log2 > min_log2) {
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 5040afd581..ef02d54b33 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -297,7 +297,6 @@ static void mips_fulong2e_init(MachineState *machine)
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     long bios_size;
     uint8_t *spd_data;
-    Error *err = NULL;
     int64_t kernel_entry;
     PCIBus *pci_bus;
     ISABus *isa_bus;
@@ -377,13 +376,8 @@ static void mips_fulong2e_init(MachineState *machine)
     }
 
     /* Populate SPD eeprom data */
-    spd_data = spd_data_generate(DDR, machine->ram_size, &err);
-    if (err) {
-        warn_report_err(err);
-    }
-    if (spd_data) {
-        smbus_eeprom_init_one(smbus, 0x50, spd_data);
-    }
+    spd_data = spd_data_generate(DDR, machine->ram_size);
+    smbus_eeprom_init_one(smbus, 0x50, spd_data);
 
     mc146818_rtc_init(isa_bus, 2000, NULL);
 
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index a46e3b37a7..65bb6886c7 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1526,7 +1526,7 @@ static void virtio_net_rsc_extract_unit6(VirtioNetRscChain *chain,
                                  + sizeof(struct eth_header));
     unit->ip = ip6;
     unit->ip_plen = &(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen);
-    unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)\
+    unit->tcp = (struct tcp_header *)(((uint8_t *)unit->ip)
                                         + sizeof(struct ip6_header));
     unit->tcp_hdrlen = (htons(unit->tcp->th_offset_flags) & 0xF000) >> 10;
 
@@ -2947,6 +2947,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
             n->net_conf.duplex = DUPLEX_FULL;
         } else {
             error_setg(errp, "'duplex' must be 'half' or 'full'");
+            return;
         }
         n->host_features |= (1ULL << VIRTIO_NET_F_SPEED_DUPLEX);
     } else {
@@ -2955,7 +2956,9 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
 
     if (n->net_conf.speed < SPEED_UNKNOWN) {
         error_setg(errp, "'speed' must be between 0 and INT_MAX");
-    } else if (n->net_conf.speed >= 0) {
+        return;
+    }
+    if (n->net_conf.speed >= 0) {
         n->host_features |= (1ULL << VIRTIO_NET_F_SPEED_DUPLEX);
     }
 
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index 3376c43ff5..f1651e04d9 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -716,11 +716,11 @@ void ppc4xx_sdram_banks(MemoryRegion *ram, int nr_banks,
         for (i = 0; sdram_bank_sizes[i]; i++) {
             g_string_append_printf(s, "%" PRIi64 "%s",
                                    sdram_bank_sizes[i] / MiB,
-                                   sdram_bank_sizes[i + 1] ? " ," : "");
+                                   sdram_bank_sizes[i + 1] ? ", " : "");
         }
-        error_report("Max %d banks of %s MB DIMM/bank supported",
-            nr_banks, s->str);
-        error_report("Possible valid RAM size: %" PRIi64,
+        error_report("at most %d bank%s of %s MiB each supported",
+                     nr_banks, nr_banks == 1 ? "" : "s", s->str);
+        error_printf("Possible valid RAM size: %" PRIi64 " MiB \n",
             used_size ? used_size / MiB : sdram_bank_sizes[i - 1] / MiB);
 
         g_string_free(s, true);
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 898453cf30..42a8c9fb7f 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -292,7 +292,6 @@ static void sam460ex_init(MachineState *machine)
     SysBusDevice *sbdev;
     struct boot_info *boot_info;
     uint8_t *spd_data;
-    Error *err = NULL;
     int success;
 
     cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
@@ -335,14 +334,10 @@ static void sam460ex_init(MachineState *machine)
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600700, uic[0][2]);
     i2c = PPC4xx_I2C(dev)->bus;
     /* SPD EEPROM on RAM module */
-    spd_data = spd_data_generate(DDR2, ram_sizes[0], &err);
-    if (err) {
-        warn_report_err(err);
-    }
-    if (spd_data) {
-        spd_data[20] = 4; /* SO-DIMM module */
-        smbus_eeprom_init_one(i2c, 0x50, spd_data);
-    }
+    spd_data = spd_data_generate(ram_sizes[0] < 128 * MiB ? DDR : DDR2,
+                                 ram_sizes[0]);
+    spd_data[20] = 4; /* SO-DIMM module */
+    smbus_eeprom_init_one(i2c, 0x50, spd_data);
     /* RTC */
     i2c_create_slave(i2c, "m41t80", 0x68);
 
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 56351c4faa..998666c91f 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -465,7 +465,7 @@ static void riscv_sifive_u_machine_instance_init(Object *obj)
     object_property_add_bool(obj, "start-in-flash", sifive_u_get_start_in_flash,
                              sifive_u_set_start_in_flash, NULL);
     object_property_set_description(obj, "start-in-flash",
-                                    "Set on to tell QEMU's ROM to jump to " \
+                                    "Set on to tell QEMU's ROM to jump to "
                                     "flash. Otherwise QEMU will jump to DRAM",
                                     NULL);
 }
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 1c0cb63a6f..e5bcd0baf8 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -3078,7 +3078,7 @@ static const TypeInfo scsi_cd_info = {
 
 #ifdef __linux__
 static Property scsi_block_properties[] = {
-    DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),         \
+    DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),
     DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
     DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
     DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index de63ffb037..70531ad360 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1130,7 +1130,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
 
         /* Limit block size to the maximum buffer size */
         if (extract32(s->blksize, 0, 12) > s->buf_maxsz) {
-            qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than " \
+            qemu_log_mask(LOG_GUEST_ERROR, "%s: Size 0x%x is larger than "
                           "the maximum buffer 0x%x", __func__, s->blksize,
                           s->buf_maxsz);
 
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index b91082cb8b..81d5ad8da7 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -858,8 +858,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
 
     rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
     if (rc < 0) {
-        error_setg_errno(errp, errno, "Mapping machine irq %u to"
-                         " pirq %i failed", machine_irq, pirq);
+        XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: %d)\n",
+                   machine_irq, pirq, errno);
 
         /* Disable PCI intx assertion (turn on bit10 of devctl) */
         cmd |= PCI_COMMAND_INTX_DISABLE;
@@ -880,8 +880,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
                                        PCI_SLOT(d->devfn),
                                        e_intx);
         if (rc < 0) {
-            error_setg_errno(errp, errno, "Binding of interrupt %u failed",
-                             e_intx);
+            XEN_PT_ERR(d, "Binding of interrupt %i failed! (err: %d)\n",
+                       e_intx, errno);
 
             /* Disable PCI intx assertion (turn on bit10 of devctl) */
             cmd |= PCI_COMMAND_INTX_DISABLE;
@@ -889,8 +889,8 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
 
             if (xen_pt_mapped_machine_irq[machine_irq] == 0) {
                 if (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq)) {
-                    error_setg_errno(errp, errno, "Unmapping of machine"
-                            " interrupt %u failed", machine_irq);
+                    XEN_PT_ERR(d, "Unmapping of machine interrupt %i failed!"
+                               " (err: %d)\n", machine_irq, errno);
                 }
             }
             s->machine_irq = 0;
diff --git a/include/hw/i2c/smbus_eeprom.h b/include/hw/i2c/smbus_eeprom.h
index 15e2151b50..68b0063ab6 100644
--- a/include/hw/i2c/smbus_eeprom.h
+++ b/include/hw/i2c/smbus_eeprom.h
@@ -31,6 +31,6 @@ void smbus_eeprom_init(I2CBus *bus, int nb_eeprom,
                        const uint8_t *eeprom_spd, int size);
 
 enum sdram_type { SDR = 0x4, DDR = 0x7, DDR2 = 0x8 };
-uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size, Error **errp);
+uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size);
 
 #endif
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 844587cab3..eb4097889d 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -33,7 +33,6 @@ const char *get_opt_value(const char *p, char **value);
 void parse_option_size(const char *name, const char *value,
                        uint64_t *ret, Error **errp);
 bool has_help_option(const char *param);
-bool is_valid_option_list(const char *param);
 
 enum QemuOptType {
     QEMU_OPT_STRING = 0,  /* no parsing (use string as-is)                        */
diff --git a/io/channel-socket.c b/io/channel-socket.c
index b74f5b92a0..e1b4667087 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -704,6 +704,7 @@ qio_channel_socket_close(QIOChannel *ioc,
 {
     QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(ioc);
     int rc = 0;
+    Error *err = NULL;
 
     if (sioc->fd != -1) {
 #ifdef WIN32
@@ -715,8 +716,8 @@ qio_channel_socket_close(QIOChannel *ioc,
 
         if (closesocket(sioc->fd) < 0) {
             sioc->fd = -1;
-            error_setg_errno(errp, errno,
-                             "Unable to close socket");
+            error_setg_errno(&err, errno, "Unable to close socket");
+            error_propagate(errp, err);
             return -1;
         }
         sioc->fd = -1;
diff --git a/migration/colo.c b/migration/colo.c
index a54ac84f41..1b3493729b 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -263,7 +263,13 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 
 void qmp_xen_colo_do_checkpoint(Error **errp)
 {
-    replication_do_checkpoint_all(errp);
+    Error *err = NULL;
+
+    replication_do_checkpoint_all(&err);
+    if (err) {
+        error_propagate(errp, err);
+        return;
+    }
     /* Notify all filters of all NIC to do checkpoint */
     colo_notify_filters_event(COLO_EVENT_CHECKPOINT, errp);
 }
diff --git a/qemu-img.c b/qemu-img.c
index 821cbf610e..a2369766f0 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -223,6 +223,53 @@ static bool qemu_img_object_print_help(const char *type, QemuOpts *opts)
     return true;
 }
 
+/*
+ * Is @optarg safe for accumulate_options()?
+ * It is when multiple of them can be joined together separated by ','.
+ * To make that work, @optarg must not start with ',' (or else a
+ * separating ',' preceding it gets escaped), and it must not end with
+ * an odd number of ',' (or else a separating ',' following it gets
+ * escaped), or be empty (or else a separating ',' preceding it can
+ * escape a separating ',' following it).
+ * 
+ */
+static bool is_valid_option_list(const char *optarg)
+{
+    size_t len = strlen(optarg);
+    size_t i;
+
+    if (!optarg[0] || optarg[0] == ',') {
+        return false;
+    }
+
+    for (i = len; i > 0 && optarg[i - 1] == ','; i--) {
+    }
+    if ((len - i) % 2) {
+        return false;
+    }
+
+    return true;
+}
+
+static int accumulate_options(char **options, char *optarg)
+{
+    char *new_options;
+
+    if (!is_valid_option_list(optarg)) {
+        error_report("Invalid option list: %s", optarg);
+        return -1;
+    }
+
+    if (!*options) {
+        *options = g_strdup(optarg);
+    } else {
+        new_options = g_strdup_printf("%s,%s", *options, optarg);
+        g_free(*options);
+        *options = new_options;
+    }
+    return 0;
+}
+
 static QemuOptsList qemu_source_opts = {
     .name = "source",
     .implied_opt_name = "file",
@@ -482,17 +529,9 @@ static int img_create(int argc, char **argv)
             fmt = optarg;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto fail;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'q':
             quiet = true;
@@ -2127,17 +2166,9 @@ static int img_convert(int argc, char **argv)
             s.compressed = true;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto fail_getopt;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
@@ -3953,18 +3984,10 @@ static int img_amend(int argc, char **argv)
             help();
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 ret = -1;
                 goto out_no_progress;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'f':
             fmt = optarg;
@@ -4855,17 +4878,9 @@ static int img_measure(int argc, char **argv)
             out_fmt = optarg;
             break;
         case 'o':
-            if (!is_valid_option_list(optarg)) {
-                error_report("Invalid option list: %s", optarg);
+            if (accumulate_options(&options, optarg) < 0) {
                 goto out;
             }
-            if (!options) {
-                options = g_strdup(optarg);
-            } else {
-                char *old_options = options;
-                options = g_strdup_printf("%s,%s", options, optarg);
-                g_free(old_options);
-            }
             break;
         case 'l':
             if (strstart(optarg, SNAPSHOT_OPT_BASE, NULL)) {
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index a52af0315f..ae1348dc8f 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2518,6 +2518,9 @@ GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp)
         mem_blk->phys_index = strtoul(&de->d_name[6], NULL, 10);
         mem_blk->has_can_offline = true; /* lolspeak ftw */
         transfer_memory_block(mem_blk, true, NULL, &local_err);
+        if (local_err) {
+            break;
+        }
 
         entry = g_malloc0(sizeof *entry);
         entry->value = mem_blk;
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 9717a8d52d..5ba56327dd 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -1322,9 +1322,16 @@ void qmp_guest_suspend_disk(Error **errp)
 
     *mode = GUEST_SUSPEND_MODE_DISK;
     check_suspend_mode(*mode, &local_err);
+    if (local_err) {
+        goto out;
+    }
     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
+    if (local_err) {
+        goto out;
+    }
     execute_async(do_suspend, mode, &local_err);
 
+out:
     if (local_err) {
         error_propagate(errp, local_err);
         g_free(mode);
@@ -1338,9 +1345,16 @@ void qmp_guest_suspend_ram(Error **errp)
 
     *mode = GUEST_SUSPEND_MODE_RAM;
     check_suspend_mode(*mode, &local_err);
+    if (local_err) {
+        goto out;
+    }
     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
+    if (local_err) {
+        goto out;
+    }
     execute_async(do_suspend, mode, &local_err);
 
+out:
     if (local_err) {
         error_propagate(errp, local_err);
         g_free(mode);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 32c0047889..afd2615fb3 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3059,19 +3059,19 @@ void qemu_init(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_kernel:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "kernel", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "kernel", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_initrd:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "initrd", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "initrd", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_append:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "append", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "append", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_dtb:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "dtb", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "dtb", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_cdrom:
@@ -3182,7 +3182,7 @@ void qemu_init(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_bios:
-                qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg,
+                qemu_opts_set(qemu_find_opts("machine"), NULL, "firmware", optarg,
                               &error_abort);
                 break;
             case QEMU_OPTION_singlestep:
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 90ffc5f3b1..9c256ab159 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5784,9 +5784,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             host_cpuid(index, 0, eax, ebx, ecx, edx);
             break;
         }
-        *eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) | \
+        *eax = (L1_DTLB_2M_ASSOC << 24) | (L1_DTLB_2M_ENTRIES << 16) |
                (L1_ITLB_2M_ASSOC <<  8) | (L1_ITLB_2M_ENTRIES);
-        *ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) | \
+        *ebx = (L1_DTLB_4K_ASSOC << 24) | (L1_DTLB_4K_ENTRIES << 16) |
                (L1_ITLB_4K_ASSOC <<  8) | (L1_ITLB_4K_ENTRIES);
         *ecx = encode_cache_cpuid80000005(env->cache_info_amd.l1d_cache);
         *edx = encode_cache_cpuid80000005(env->cache_info_amd.l1i_cache);
@@ -5797,13 +5797,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
             host_cpuid(index, 0, eax, ebx, ecx, edx);
             break;
         }
-        *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) | \
-               (L2_DTLB_2M_ENTRIES << 16) | \
-               (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) | \
+        *eax = (AMD_ENC_ASSOC(L2_DTLB_2M_ASSOC) << 28) |
+               (L2_DTLB_2M_ENTRIES << 16) |
+               (AMD_ENC_ASSOC(L2_ITLB_2M_ASSOC) << 12) |
                (L2_ITLB_2M_ENTRIES);
-        *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) | \
-               (L2_DTLB_4K_ENTRIES << 16) | \
-               (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) | \
+        *ebx = (AMD_ENC_ASSOC(L2_DTLB_4K_ASSOC) << 28) |
+               (L2_DTLB_4K_ENTRIES << 16) |
+               (AMD_ENC_ASSOC(L2_ITLB_4K_ASSOC) << 12) |
                (L2_ITLB_4K_ENTRIES);
         encode_cache_cpuid80000006(env->cache_info_amd.l2_cache,
                                    cpu->enable_l3_cache ?
@@ -6326,7 +6326,7 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
              */
             env->features[w] |=
                 x86_cpu_get_supported_feature_word(w, cpu->migratable) &
-                ~env->user_features[w] & \
+                ~env->user_features[w] &
                 ~feature_word_info[w].no_autoenable_flags;
         }
     }
diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index a2c2f271df..c9cf2364ca 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -163,14 +163,14 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
 
     qemu_init_vcpu(cs);
 
-    env->pvr.regs[0] = PVR0_USE_EXC_MASK \
-                       | PVR0_USE_ICACHE_MASK \
+    env->pvr.regs[0] = PVR0_USE_EXC_MASK
+                       | PVR0_USE_ICACHE_MASK
                        | PVR0_USE_DCACHE_MASK;
-    env->pvr.regs[2] = PVR2_D_OPB_MASK \
-                        | PVR2_D_LMB_MASK \
-                        | PVR2_I_OPB_MASK \
-                        | PVR2_I_LMB_MASK \
-                        | PVR2_FPU_EXC_MASK \
+    env->pvr.regs[2] = PVR2_D_OPB_MASK
+                        | PVR2_D_LMB_MASK
+                        | PVR2_I_OPB_MASK
+                        | PVR2_I_LMB_MASK
+                        | PVR2_FPU_EXC_MASK
                         | 0;
 
     version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION;
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index e853164a86..fd763e588e 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -5210,7 +5210,7 @@ POWERPC_FAMILY(e5500)(ObjectClass *oc, void *data)
                        PPC_FLOAT_STFIWX | PPC_WAIT |
                        PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
                        PPC_64B | PPC_POPCNTB | PPC_POPCNTWD;
-    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \
+    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
                         PPC2_FP_CVT_S64;
     pcc->msr_mask = (1ull << MSR_CM) |
                     (1ull << MSR_GS) |
@@ -5258,7 +5258,7 @@ POWERPC_FAMILY(e6500)(ObjectClass *oc, void *data)
                        PPC_FLOAT_STFIWX | PPC_WAIT |
                        PPC_MEM_TLBSYNC | PPC_TLBIVAX | PPC_MEM_SYNC |
                        PPC_64B | PPC_POPCNTB | PPC_POPCNTWD | PPC_ALTIVEC;
-    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | \
+    pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 |
                         PPC2_FP_CVT_S64 | PPC2_ATOMIC_ISA206;
     pcc->msr_mask = (1ull << MSR_CM) |
                     (1ull << MSR_GS) |
diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c
index af28c92866..87eadb0889 100644
--- a/tests/qtest/fuzz/qos_fuzz.c
+++ b/tests/qtest/fuzz/qos_fuzz.c
@@ -36,7 +36,6 @@
 
 #include "qapi/qapi-commands-machine.h"
 #include "qapi/qapi-commands-qom.h"
-#include "qapi/qmp/qlist.h"
 
 
 void *fuzz_qos_obj;
@@ -45,34 +44,19 @@ QGuestAllocator *fuzz_qos_alloc;
 static const char *fuzz_target_name;
 static char **fuzz_path_vec;
 
-/*
- * Replaced the qmp commands with direct qmp_marshal calls.
- * Probably there is a better way to do this
- */
 static void qos_set_machines_devices_available(void)
 {
-    QDict *req = qdict_new();
-    QObject *response;
-    QDict *args = qdict_new();
-    QList *lst;
-
-    qmp_marshal_query_machines(NULL, &response, &error_abort);
-    lst = qobject_to(QList, response);
-    apply_to_qlist(lst, true);
-
-    qobject_unref(response);
-
+    MachineInfoList *mach_info;
+    ObjectTypeInfoList *type_info;
 
-    qdict_put_str(req, "execute", "qom-list-types");
-    qdict_put_str(args, "implements", "device");
-    qdict_put_bool(args, "abstract", true);
-    qdict_put_obj(req, "arguments", (QObject *) args);
+    mach_info = qmp_query_machines(&error_abort);
+    machines_apply_to_node(mach_info);
+    qapi_free_MachineInfoList(mach_info);
 
-    qmp_marshal_qom_list_types(args, &response, &error_abort);
-    lst = qobject_to(QList, response);
-    apply_to_qlist(lst, false);
-    qobject_unref(response);
-    qobject_unref(req);
+    type_info = qmp_qom_list_types(true, "device", true, true,
+                                   &error_abort);
+    types_apply_to_node(type_info);
+    qapi_free_ObjectTypeInfoList(type_info);
 }
 
 static char **current_path;
diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_external.c
index 398556dde0..9f5180e18d 100644
--- a/tests/qtest/libqos/qos_external.c
+++ b/tests/qtest/libqos/qos_external.c
@@ -29,66 +29,44 @@
 #include "libqos/qgraph_internal.h"
 #include "libqos/qos_external.h"
 
+static void machine_apply_to_node(const char *name)
+{
+    char *machine_name = g_strconcat(qtest_get_arch(), "/", name, NULL);
 
+    qos_graph_node_set_availability(machine_name, true);
+    g_free(machine_name);
+}
 
-void apply_to_node(const char *name, bool is_machine, bool is_abstract)
+void machines_apply_to_node(MachineInfoList *mach_info)
 {
-    char *machine_name = NULL;
-    if (is_machine) {
-        const char *arch = qtest_get_arch();
-        machine_name = g_strconcat(arch, "/", name, NULL);
-        name = machine_name;
+    MachineInfoList *tail;
+
+    for (tail = mach_info; tail; tail = tail->next) {
+        machine_apply_to_node(tail->value->name);
+        if (tail->value->alias) {
+            machine_apply_to_node(tail->value->alias);
+        }
     }
+}
+
+static void type_apply_to_node(const char *name, bool is_abstract)
+{
     qos_graph_node_set_availability(name, true);
     if (is_abstract) {
         qos_delete_cmd_line(name);
     }
-    g_free(machine_name);
 }
 
-/**
- * apply_to_qlist(): using QMP queries QEMU for a list of
- * machines and devices available, and sets the respective node
- * as true. If a node is found, also all its produced and contained
- * child are marked available.
- *
- * See qos_graph_node_set_availability() for more info
- */
-void apply_to_qlist(QList *list, bool is_machine)
+void types_apply_to_node(ObjectTypeInfoList *type_info)
 {
-    const QListEntry *p;
-    const char *name;
-    bool abstract;
-    QDict *minfo;
-    QObject *qobj;
-    QString *qstr;
-    QBool *qbool;
-
-    for (p = qlist_first(list); p; p = qlist_next(p)) {
-        minfo = qobject_to(QDict, qlist_entry_obj(p));
-        qobj = qdict_get(minfo, "name");
-        qstr = qobject_to(QString, qobj);
-        name = qstring_get_str(qstr);
-
-        qobj = qdict_get(minfo, "abstract");
-        if (qobj) {
-            qbool = qobject_to(QBool, qobj);
-            abstract = qbool_get_bool(qbool);
-        } else {
-            abstract = false;
-        }
+    ObjectTypeInfoList *tail;
 
-        apply_to_node(name, is_machine, abstract);
-        qobj = qdict_get(minfo, "alias");
-        if (qobj) {
-            qstr = qobject_to(QString, qobj);
-            name = qstring_get_str(qstr);
-            apply_to_node(name, is_machine, abstract);
-        }
+    for (tail = type_info; tail; tail = tail->next) {
+        type_apply_to_node(tail->value->name, tail->value->abstract);
     }
 }
 
-QGuestAllocator *get_machine_allocator(QOSGraphObject *obj)
+static QGuestAllocator *get_machine_allocator(QOSGraphObject *obj)
 {
     return obj->get_driver(obj, "memory");
 }
diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_external.h
index 7b44930c55..72d7f91707 100644
--- a/tests/qtest/libqos/qos_external.h
+++ b/tests/qtest/libqos/qos_external.h
@@ -18,11 +18,13 @@
 
 #ifndef QOS_EXTERNAL_H
 #define QOS_EXTERNAL_H
-#include "libqos/qgraph.h"
 
-void apply_to_node(const char *name, bool is_machine, bool is_abstract);
-void apply_to_qlist(QList *list, bool is_machine);
-QGuestAllocator *get_machine_allocator(QOSGraphObject *obj);
+#include "libqos/malloc.h"
+#include "qapi/qapi-types-machine.h"
+#include "qapi/qapi-types-qom.h"
+
+void machines_apply_to_node(MachineInfoList *mach_info);
+void types_apply_to_node(ObjectTypeInfoList *type_info);
 void *allocate_objects(QTestState *qts, char **path, QGuestAllocator **p_alloc);
 
 #endif
diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c
index ad193f43a5..3062a13557 100644
--- a/tests/qtest/qos-test.c
+++ b/tests/qtest/qos-test.c
@@ -19,11 +19,12 @@
 #include "qemu/osdep.h"
 #include <getopt.h>
 #include "libqtest-single.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qstring.h"
 #include "qemu/module.h"
-#include "qapi/qmp/qlist.h"
+#include "qapi/qobject-input-visitor.h"
+#include "qapi/qapi-visit-machine.h"
+#include "qapi/qapi-visit-qom.h"
 #include "libqos/malloc.h"
 #include "libqos/qgraph.h"
 #include "libqos/qgraph_internal.h"
@@ -51,13 +52,20 @@ static void qos_set_machines_devices_available(void)
 {
     QDict *response;
     QDict *args = qdict_new();
-    QList *list;
+    QObject *ret;
+    Visitor *v;
+    MachineInfoList *mach_info;
+    ObjectTypeInfoList *type_info;
 
     qtest_start("-machine none");
     response = qmp("{ 'execute': 'query-machines' }");
-    list = qdict_get_qlist(response, "return");
+    ret = qdict_get(response, "return");
 
-    apply_to_qlist(list, true);
+    v = qobject_input_visitor_new(ret);
+    visit_type_MachineInfoList(v, NULL, &mach_info, &error_abort);
+    visit_free(v);
+    machines_apply_to_node(mach_info);
+    qapi_free_MachineInfoList(mach_info);
 
     qobject_unref(response);
 
@@ -66,10 +74,13 @@ static void qos_set_machines_devices_available(void)
 
     response = qmp("{'execute': 'qom-list-types',"
                    " 'arguments': %p }", args);
-    g_assert(qdict_haskey(response, "return"));
-    list = qdict_get_qlist(response, "return");
+    ret = qdict_get(response, "return");
 
-    apply_to_qlist(list, false);
+    v = qobject_input_visitor_new(ret);
+    visit_type_ObjectTypeInfoList(v, NULL, &type_info, &error_abort);
+    visit_free(v);
+    types_apply_to_node(type_info);
+    qapi_free_ObjectTypeInfoList(type_info);
 
     qtest_end();
     qobject_unref(response);
diff --git a/tests/test-logging.c b/tests/test-logging.c
index 6387e4933f..8580b82420 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -73,10 +73,10 @@ static void test_parse_range(void)
     g_assert(qemu_log_in_addr_range(UINT64_MAX));
     g_assert_false(qemu_log_in_addr_range(UINT64_MAX - 1));
 
-    qemu_set_dfilter_ranges("0..0xffffffffffffffff", &err);
+    qemu_set_dfilter_ranges("0..0xffffffffffffffff", &error_abort);
     g_assert(qemu_log_in_addr_range(0));
     g_assert(qemu_log_in_addr_range(UINT64_MAX));
- 
+
     qemu_set_dfilter_ranges("2..1", &err);
     error_free_or_abort(&err);
 
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index ef96e84aed..2a0f42a09b 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -500,10 +500,10 @@ static void test_opts_parse(void)
     g_assert(!opts);
     /* TODO Cover .merge_lists = true */
 
-    /* Buggy ID recognition */
+    /* Buggy ID recognition (fixed) */
     opts = qemu_opts_parse(&opts_list_03, "x=,,id=bar", false, &error_abort);
     g_assert_cmpuint(opts_count(opts), ==, 1);
-    g_assert_cmpstr(qemu_opts_id(opts), ==, "bar"); /* BUG */
+    g_assert(!qemu_opts_id(opts));
     g_assert_cmpstr(qemu_opt_get(opts, "x"), ==, ",id=bar");
 
     /* Anti-social ID */
@@ -728,6 +728,47 @@ static void test_opts_parse_size(void)
     qemu_opts_reset(&opts_list_02);
 }
 
+static void test_has_help_option(void)
+{
+    static const struct {
+        const char *params;
+        /* expected value of qemu_opt_has_help_opt() with implied=false */
+        bool expect;
+        /* expected value of qemu_opt_has_help_opt() with implied=true */
+        bool expect_implied;
+    } test[] = {
+        { "help", true, false },
+        { "?", true, false },
+        { "helpme", false, false },
+        { "?me", false, false },
+        { "a,help", true, true },
+        { "a,?", true, true },
+        { "a=0,help,b", true, true },
+        { "a=0,?,b", true, true },
+        { "help,b=1", true, false },
+        { "?,b=1", true, false },
+        { "a,b,,help", true, true },
+        { "a,b,,?", true, true },
+    };
+    int i;
+    QemuOpts *opts;
+
+    for (i = 0; i < ARRAY_SIZE(test); i++) {
+        g_assert_cmpint(has_help_option(test[i].params),
+                        ==, test[i].expect);
+        opts = qemu_opts_parse(&opts_list_03, test[i].params, false,
+                               &error_abort);
+        g_assert_cmpint(qemu_opt_has_help_opt(opts),
+                        ==, test[i].expect);
+        qemu_opts_del(opts);
+        opts = qemu_opts_parse(&opts_list_03, test[i].params, true,
+                               &error_abort);
+        g_assert_cmpint(qemu_opt_has_help_opt(opts),
+                        ==, test[i].expect_implied);
+        qemu_opts_del(opts);
+    }
+}
+
 static void append_verify_list_01(QemuOptDesc *desc, bool with_overlapping)
 {
     int i = 0;
@@ -990,6 +1031,7 @@ int main(int argc, char *argv[])
     g_test_add_func("/qemu-opts/opts_parse/bool", test_opts_parse_bool);
     g_test_add_func("/qemu-opts/opts_parse/number", test_opts_parse_number);
     g_test_add_func("/qemu-opts/opts_parse/size", test_opts_parse_size);
+    g_test_add_func("/qemu-opts/has_help_option", test_has_help_option);
     g_test_add_func("/qemu-opts/append_to_null", test_opts_append_to_null);
     g_test_add_func("/qemu-opts/append", test_opts_append);
     g_test_add_func("/qemu-opts/to_qdict/basic", test_opts_to_qdict_basic);
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 97172b5eaa..9542988183 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -165,48 +165,6 @@ void parse_option_size(const char *name, const char *value,
     *ret = size;
 }
 
-bool has_help_option(const char *param)
-{
-    const char *p = param;
-    bool result = false;
-
-    while (*p && !result) {
-        char *value;
-
-        p = get_opt_value(p, &value);
-        if (*p) {
-            p++;
-        }
-
-        result = is_help_option(value);
-        g_free(value);
-    }
-
-    return result;
-}
-
-bool is_valid_option_list(const char *p)
-{
-    char *value = NULL;
-    bool result = false;
-
-    while (*p) {
-        p = get_opt_value(p, &value);
-        if ((*p && !*++p) ||
-            (!*value || *value == ',')) {
-            goto out;
-        }
-
-        g_free(value);
-        value = NULL;
-    }
-
-    result = true;
-out:
-    g_free(value);
-    return result;
-}
-
 static const char *opt_type_to_string(enum QemuOptType type)
 {
     switch (type) {
@@ -539,7 +497,7 @@ int qemu_opt_unset(QemuOpts *opts, const char *name)
 }
 
 static void opt_set(QemuOpts *opts, const char *name, char *value,
-                    bool prepend, bool *invalidp, Error **errp)
+                    bool prepend, bool *help_wanted, Error **errp)
 {
     QemuOpt *opt;
     const QemuOptDesc *desc;
@@ -549,8 +507,8 @@ static void opt_set(QemuOpts *opts, const char *name, char *value,
     if (!desc && !opts_accepts_any(opts)) {
         g_free(value);
         error_setg(errp, QERR_INVALID_PARAMETER, name);
-        if (invalidp) {
-            *invalidp = true;
+        if (help_wanted && is_help_option(name)) {
+            *help_wanted = true;
         }
         return;
     }
@@ -805,61 +763,108 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
     }
 }
 
+static const char *get_opt_name_value(const char *params,
+                                      const char *firstname,
+                                      char **name, char **value)
+{
+    const char *p, *pe, *pc;
+
+    pe = strchr(params, '=');
+    pc = strchr(params, ',');
+
+    if (!pe || (pc && pc < pe)) {
+        /* found "foo,more" */
+        if (firstname) {
+            /* implicitly named first option */
+            *name = g_strdup(firstname);
+            p = get_opt_value(params, value);
+        } else {
+            /* option without value, must be a flag */
+            p = get_opt_name(params, name, ',');
+            if (strncmp(*name, "no", 2) == 0) {
+                memmove(*name, *name + 2, strlen(*name + 2) + 1);
+                *value = g_strdup("off");
+            } else {
+                *value = g_strdup("on");
+            }
+        }
+    } else {
+        /* found "foo=bar,more" */
+        p = get_opt_name(params, name, '=');
+        assert(*p == '=');
+        p++;
+        p = get_opt_value(p, value);
+    }
+
+    assert(!*p || *p == ',');
+    if (*p == ',') {
+        p++;
+    }
+    return p;
+}
+
 static void opts_do_parse(QemuOpts *opts, const char *params,
                           const char *firstname, bool prepend,
-                          bool *invalidp, Error **errp)
+                          bool *help_wanted, Error **errp)
 {
-    char *option = NULL;
-    char *value = NULL;
-    const char *p,*pe,*pc;
     Error *local_err = NULL;
+    char *option, *value;
+    const char *p;
 
-    for (p = params; *p != '\0'; p++) {
-        pe = strchr(p, '=');
-        pc = strchr(p, ',');
-        if (!pe || (pc && pc < pe)) {
-            /* found "foo,more" */
-            if (p == params && firstname) {
-                /* implicitly named first option */
-                option = g_strdup(firstname);
-                p = get_opt_value(p, &value);
-            } else {
-                /* option without value, probably a flag */
-                p = get_opt_name(p, &option, ',');
-                if (strncmp(option, "no", 2) == 0) {
-                    memmove(option, option+2, strlen(option+2)+1);
-                    value = g_strdup("off");
-                } else {
-                    value = g_strdup("on");
-                }
-            }
-        } else {
-            /* found "foo=bar,more" */
-            p = get_opt_name(p, &option, '=');
-            assert(*p == '=');
-            p++;
-            p = get_opt_value(p, &value);
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, firstname, &option, &value);
+        firstname = NULL;
+
+        if (!strcmp(option, "id")) {
+            g_free(option);
+            g_free(value);
+            continue;
         }
-        if (strcmp(option, "id") != 0) {
-            /* store and parse */
-            opt_set(opts, option, value, prepend, invalidp, &local_err);
-            value = NULL;
-            if (local_err) {
-                error_propagate(errp, local_err);
-                goto cleanup;
-            }
+
+        opt_set(opts, option, value, prepend, help_wanted, &local_err);
+        g_free(option);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            return;
         }
-        if (*p != ',') {
-            break;
+    }
+}
+
+static char *opts_parse_id(const char *params)
+{
+    const char *p;
+    char *name, *value;
+
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, NULL, &name, &value);
+        if (!strcmp(name, "id")) {
+            g_free(name);
+            return value;
         }
-        g_free(option);
+        g_free(name);
         g_free(value);
-        option = value = NULL;
     }
 
- cleanup:
-    g_free(option);
-    g_free(value);
+    return NULL;
+}
+
+bool has_help_option(const char *params)
+{
+    const char *p;
+    char *name, *value;
+    bool ret;
+
+    for (p = params; *p;) {
+        p = get_opt_name_value(p, NULL, &name, &value);
+        ret = is_help_option(name);
+        g_free(name);
+        g_free(value);
+        if (ret) {
+            return true;
+        }
+    }
+
+    return false;
 }
 
 /**
@@ -876,23 +881,16 @@ void qemu_opts_do_parse(QemuOpts *opts, const char *params,
 
 static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
                             bool permit_abbrev, bool defaults,
-                            bool *invalidp, Error **errp)
+                            bool *help_wanted, Error **errp)
 {
     const char *firstname;
-    char *id = NULL;
-    const char *p;
+    char *id = opts_parse_id(params);
     QemuOpts *opts;
     Error *local_err = NULL;
 
     assert(!permit_abbrev || list->implied_opt_name);
     firstname = permit_abbrev ? list->implied_opt_name : NULL;
 
-    if (strncmp(params, "id=", 3) == 0) {
-        get_opt_value(params + 3, &id);
-    } else if ((p = strstr(params, ",id=")) != NULL) {
-        get_opt_value(p + 4, &id);
-    }
-
     /*
      * This code doesn't work for defaults && !list->merge_lists: when
      * params has no id=, and list has an element with !opts->id, it
@@ -908,7 +906,7 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
         return NULL;
     }
 
-    opts_do_parse(opts, params, firstname, defaults, invalidp, &local_err);
+    opts_do_parse(opts, params, firstname, defaults, help_wanted, &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
         qemu_opts_del(opts);
@@ -944,11 +942,11 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params,
 {
     Error *err = NULL;
     QemuOpts *opts;
-    bool invalidp = false;
+    bool help_wanted = false;
 
-    opts = opts_parse(list, params, permit_abbrev, false, &invalidp, &err);
+    opts = opts_parse(list, params, permit_abbrev, false, &help_wanted, &err);
     if (err) {
-        if (invalidp && has_help_option(params)) {
+        if (help_wanted) {
             qemu_opts_print_help(list, true);
             error_free(err);
         } else {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 18:33:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 18:33:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16175.39513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZDT-0000a0-BZ; Fri, 30 Oct 2020 18:33:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16175.39513; Fri, 30 Oct 2020 18:33:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZDT-0000Zs-8X; Fri, 30 Oct 2020 18:33:35 +0000
Received: by outflank-mailman (input) for mailman id 16175;
 Fri, 30 Oct 2020 18:33:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZDR-0000ZM-Vm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b679ae4d-cf53-4362-be5b-1255a04783d9;
 Fri, 30 Oct 2020 18:33:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZDQ-0007vX-N0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZDQ-0007dP-LO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZDR-0000ZM-Vm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:34 +0000
X-Inumbo-ID: b679ae4d-cf53-4362-be5b-1255a04783d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b679ae4d-cf53-4362-be5b-1255a04783d9;
	Fri, 30 Oct 2020 18:33:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E0na1SfP9YWz9iKj/GLj+2aF3FAeUKmk/BIrb5EvRvU=; b=TxxK7gmPd9zJagLREBpgT/Rvx3
	aohgjXZVx/hBhCWBepvqOLoVn0EcGQgSKYRHoqLBRmrH87sPB6VFLqKcYFe0y/7lWMCRGIBUjPuZv
	Cxugl7GtCgbIoGeNCA1jpqwBV1yyhUUXsGc/PH21EZr6dXv8RxTy2bBfdl6mcdfFaI44=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZDQ-0007vX-N0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZDQ-0007dP-LO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:33:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/xtensa: work around missing SR definitions
Message-Id: <E1kYZDQ-0007dP-LO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 18:33:32 +0000

commit 59afd43daedabe672c289326a5f268f737d35252
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Tue Apr 28 15:59:08 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Thu Apr 30 04:37:36 2020 -0700

    target/xtensa: work around missing SR definitions
    
    Xtensa configuration overlays for recent releases may have special
    registers for which [rwx]sr opcodes are defined, but they are not listed
    as SR in xtensa_sysreg_name and associated functions. As a result
    generic translate_[rwx]sr* functions generate access to uninitialized
    cpu_SR causing segfault at runtime.
    Don't try to access cpu_SR for such registers, ignore writes and return
    0 for reads.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 48 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index e0beaf7abb..546d2fa2fa 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2191,7 +2191,11 @@ static void translate_rsil(DisasContext *dc, const OpcodeArg arg[],
 static void translate_rsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+    if (sr_name[par[0]]) {
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_rsr_ccount(DisasContext *dc, const OpcodeArg arg[],
@@ -2563,13 +2567,17 @@ static void translate_wrmsk_expstate(DisasContext *dc, const OpcodeArg arg[],
 static void translate_wsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
+    if (sr_name[par[0]]) {
+        tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
+    }
 }
 
 static void translate_wsr_mask(DisasContext *dc, const OpcodeArg arg[],
                                const uint32_t par[])
 {
-    tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, par[2]);
+    if (sr_name[par[0]]) {
+        tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, par[2]);
+    }
 }
 
 static void translate_wsr_acchi(DisasContext *dc, const OpcodeArg arg[],
@@ -2775,23 +2783,31 @@ static void translate_xor(DisasContext *dc, const OpcodeArg arg[],
 static void translate_xsr(DisasContext *dc, const OpcodeArg arg[],
                           const uint32_t par[])
 {
-    TCGv_i32 tmp = tcg_temp_new_i32();
+    if (sr_name[par[0]]) {
+        TCGv_i32 tmp = tcg_temp_new_i32();
 
-    tcg_gen_mov_i32(tmp, arg[0].in);
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
-    tcg_gen_mov_i32(cpu_SR[par[0]], tmp);
-    tcg_temp_free(tmp);
+        tcg_gen_mov_i32(tmp, arg[0].in);
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+        tcg_gen_mov_i32(cpu_SR[par[0]], tmp);
+        tcg_temp_free(tmp);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_xsr_mask(DisasContext *dc, const OpcodeArg arg[],
                                const uint32_t par[])
 {
-    TCGv_i32 tmp = tcg_temp_new_i32();
+    if (sr_name[par[0]]) {
+        TCGv_i32 tmp = tcg_temp_new_i32();
 
-    tcg_gen_mov_i32(tmp, arg[0].in);
-    tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
-    tcg_gen_andi_i32(cpu_SR[par[0]], tmp, par[2]);
-    tcg_temp_free(tmp);
+        tcg_gen_mov_i32(tmp, arg[0].in);
+        tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
+        tcg_gen_andi_i32(cpu_SR[par[0]], tmp, par[2]);
+        tcg_temp_free(tmp);
+    } else {
+        tcg_gen_movi_i32(arg[0].out, 0);
+    }
 }
 
 static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
@@ -2819,7 +2835,11 @@ static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
 { \
     TCGv_i32 tmp = tcg_temp_new_i32(); \
  \
-    tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
+    if (sr_name[par[0]]) { \
+        tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
+    } else { \
+        tcg_gen_movi_i32(tmp, 0); \
+    } \
     translate_wsr_##name(dc, arg, par); \
     tcg_gen_mov_i32(arg[0].out, tmp); \
     tcg_temp_free(tmp); \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 18:44:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 18:44:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16187.39529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZO7-0001Yn-DN; Fri, 30 Oct 2020 18:44:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16187.39529; Fri, 30 Oct 2020 18:44:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZO7-0001Yf-AG; Fri, 30 Oct 2020 18:44:35 +0000
Received: by outflank-mailman (input) for mailman id 16187;
 Fri, 30 Oct 2020 18:44:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZO6-0001Xw-6u
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eb0e176b-c1ac-49b3-881c-d6a0ebb58b02;
 Fri, 30 Oct 2020 18:44:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZO5-00088d-91
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZO5-0002lp-7Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZO6-0001Xw-6u
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:34 +0000
X-Inumbo-ID: eb0e176b-c1ac-49b3-881c-d6a0ebb58b02
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eb0e176b-c1ac-49b3-881c-d6a0ebb58b02;
	Fri, 30 Oct 2020 18:44:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Qk2j1U9f5T6isb+yG8FV5tJyU/ZNGpyKk/P7xe1HvJE=; b=UvKA2VYiftK2P6nI8sG+8bKsg8
	uHsElEoYlUiN6+msiX4kM3q52bkD3v9xRb0P1eT19rG9Jm3CkPx+vExaeTkrTxUU7xdCEZxRubWyy
	uE79BtS4YgVZo3YAAc0VU/RHqg6NrMk+VJZufXDtIKW+z/nd4UeVcAnTY3KkyRczs2DQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZO5-00088d-91
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZO5-0002lp-7Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:44:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/xtensa: fetch HW version from configuration overlay
Message-Id: <E1kYZO5-0002lp-7Y@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 18:44:33 +0000

commit 2cc2278edf0403720397a33b0747e0aba9e6d420
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Mon May 4 04:30:45 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Sun May 17 14:52:25 2020 -0700

    target/xtensa: fetch HW version from configuration overlay
    
    Xtensa architecture has features which behavior depends on hardware
    version. Provide hardware version information to translators: add
    XtensaConfig::hw_version and use XCHAL_HW_VERSION from configuration
    overlay to initialize it.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/cpu.h          | 1 +
 target/xtensa/overlay_tool.h | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h
index 7a46dccbe1..32749378bf 100644
--- a/target/xtensa/cpu.h
+++ b/target/xtensa/cpu.h
@@ -464,6 +464,7 @@ struct XtensaConfig {
     XtensaMemory sysrom;
     XtensaMemory sysram;
 
+    unsigned hw_version;
     uint32_t configid[2];
 
     void *isa_internal;
diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h
index cab532095c..a994e69b6e 100644
--- a/target/xtensa/overlay_tool.h
+++ b/target/xtensa/overlay_tool.h
@@ -60,8 +60,9 @@
 #define XCHAL_RESET_VECTOR1_VADDR XCHAL_RESET_VECTOR_VADDR
 #endif
 
-#ifndef XCHAL_HW_MIN_VERSION
-#define XCHAL_HW_MIN_VERSION 0
+#ifndef XCHAL_HW_VERSION
+#define XCHAL_HW_VERSION (XCHAL_HW_VERSION_MAJOR * 100 \
+                          + XCHAL_HW_VERSION_MINOR)
 #endif
 
 #ifndef XCHAL_LOOP_BUFFER_SIZE
@@ -100,7 +101,7 @@
     XCHAL_OPTION(XCHAL_HAVE_FP, XTENSA_OPTION_FP_COPROCESSOR) | \
     XCHAL_OPTION(XCHAL_HAVE_RELEASE_SYNC, XTENSA_OPTION_MP_SYNCHRO) | \
     XCHAL_OPTION(XCHAL_HAVE_S32C1I, XTENSA_OPTION_CONDITIONAL_STORE) | \
-    XCHAL_OPTION(((XCHAL_HAVE_S32C1I && XCHAL_HW_MIN_VERSION >= 230000) || \
+    XCHAL_OPTION(((XCHAL_HAVE_S32C1I && XCHAL_HW_VERSION >= 230000) || \
                   XCHAL_HAVE_EXCLUSIVE), XTENSA_OPTION_ATOMCTL) | \
     XCHAL_OPTION(XCHAL_HAVE_DEPBITS, XTENSA_OPTION_DEPBITS) | \
     /* Interrupts and exceptions */ \
@@ -498,6 +499,7 @@
     }
 
 #define CONFIG_SECTION \
+    .hw_version = XCHAL_HW_VERSION, \
     .configid = { \
         XCHAL_HW_CONFIGID0, \
         XCHAL_HW_CONFIGID1, \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 18:55:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 18:55:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16200.39557 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZYm-0002f7-SB; Fri, 30 Oct 2020 18:55:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16200.39557; Fri, 30 Oct 2020 18:55:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZYm-0002ez-P5; Fri, 30 Oct 2020 18:55:36 +0000
Received: by outflank-mailman (input) for mailman id 16200;
 Fri, 30 Oct 2020 18:55:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZYk-0002eu-Ss
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b13f13b3-983f-480f-b171-1bfe9e57e507;
 Fri, 30 Oct 2020 18:55:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZYj-0008OW-K5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZYj-0006Dj-Ic
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZYk-0002eu-Ss
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:34 +0000
X-Inumbo-ID: b13f13b3-983f-480f-b171-1bfe9e57e507
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b13f13b3-983f-480f-b171-1bfe9e57e507;
	Fri, 30 Oct 2020 18:55:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=msIvawnetlNdKzvZy8tDT7eWlF1MEFxICqRyWTCUFuM=; b=gmDOfOqtN+2whvJwkt406xe6/d
	ntIKSB31kF6ThbglUL38OSIDOcnSOPAibRv2DceJMpOjiKThlsWXi5/0z32INu2kziC5K1CqbxZYW
	xowRytH18s8tWbiOlG0jhnTHFP1/4nVH55Bto8D85YE5veZbnIFz9UbY3uyNEMjULHBY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZYj-0008OW-K5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZYj-0006Dj-Ic
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 18:55:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/xtensa: fix simcall for newer hardware
Message-Id: <E1kYZYj-0006Dj-Ic@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 18:55:33 +0000

commit 62ed68e33db89584355ca4c63cd5b21dd98df636
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Mon May 4 05:15:14 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Sun May 17 14:52:25 2020 -0700

    target/xtensa: fix simcall for newer hardware
    
    After Xtensa release RE.2 simcall opcode has become nop for the
    hardware instead of illegal instruction.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 target/xtensa/translate.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 546d2fa2fa..4bc15252c8 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2367,9 +2367,10 @@ static bool test_ill_simcall(DisasContext *dc, const OpcodeArg arg[],
 #ifdef CONFIG_USER_ONLY
     bool ill = true;
 #else
-    bool ill = !semihosting_enabled();
+    /* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
+    bool ill = dc->config->hw_version <= 250002 && !semihosting_enabled();
 #endif
-    if (ill) {
+    if (ill || !semihosting_enabled()) {
         qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
     }
     return ill;
@@ -2379,7 +2380,9 @@ static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
                               const uint32_t par[])
 {
 #ifndef CONFIG_USER_ONLY
-    gen_helper_simcall(cpu_env);
+    if (semihosting_enabled()) {
+        gen_helper_simcall(cpu_env);
+    }
 #endif
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:00:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:00:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16202.39561 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZdU-0003Ra-8P; Fri, 30 Oct 2020 19:00:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16202.39561; Fri, 30 Oct 2020 19:00:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZdU-0003RS-5N; Fri, 30 Oct 2020 19:00:28 +0000
Received: by outflank-mailman (input) for mailman id 16202;
 Fri, 30 Oct 2020 19:00:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZdS-0003RN-HS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 660a1d43-6159-49fb-90eb-ae1a2c1fba39;
 Fri, 30 Oct 2020 19:00:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZdR-0008W4-LY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZdR-00006L-K0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZdS-0003RN-HS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:26 +0000
X-Inumbo-ID: 660a1d43-6159-49fb-90eb-ae1a2c1fba39
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 660a1d43-6159-49fb-90eb-ae1a2c1fba39;
	Fri, 30 Oct 2020 19:00:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dy1ay8AVFaVFiWUp+f9qwA/0k6rOpbCdwdat4NTfcvA=; b=fP7/7598Z3hsaP/tmm0uKrwLHy
	AuFWi9eefmcBoXDLeHprsfbBn8rnKcVffm9xJwE07mtwi8F/FI57zR7Oj8Rc17/nnjOnyELuZxQ3P
	ivPggWILHoxfFMY2RcDlcrpgMxVz4HOk0jEou80Td4QPPjHZqpKn6PEHxL3iYcXQvSEg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZdR-0008W4-LY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZdR-00006L-K0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:00:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/xtensa: drop gen_io_end call
Message-Id: <E1kYZdR-00006L-K0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:00:25 +0000

commit 8a3a81478dcc592518069125a6ad271fe5511b95
Author:     Max Filippov <jcmvbkbc@gmail.com>
AuthorDate: Sun Jun 21 22:26:50 2020 -0700
Commit:     Max Filippov <jcmvbkbc@gmail.com>
CommitDate: Mon Jun 22 03:38:30 2020 -0700

    target/xtensa: drop gen_io_end call
    
    Since commit
    ba3e7926691e ("icount: clean up cpu_can_io at the entry to the block")
    it has been unnecessary for target code to call gen_io_end() after an IO
    instruction in icount mode; it is sufficient to call gen_io_start()
    before it and to force the end of the TB.
    Remaining call in xtensa target translator is for the opcodes that may
    change IRQ state. All of them end current TB, so gen_io_end is not
    needed. Drop gen_io_end call from the xtensa target translator.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/xtensa/translate.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 4bc15252c8..6346b2eef0 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -595,9 +595,6 @@ static int gen_postprocess(DisasContext *dc, int slot)
             gen_io_start();
         }
         gen_helper_check_interrupts(cpu_env);
-        if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
-            gen_io_end();
-        }
     }
 #endif
     if (op_flags & XTENSA_OP_SYNC_REGISTER_WINDOW) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:11:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:11:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16204.39569 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZoD-0004KU-6K; Fri, 30 Oct 2020 19:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16204.39569; Fri, 30 Oct 2020 19:11:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZoD-0004KN-1L; Fri, 30 Oct 2020 19:11:33 +0000
Received: by outflank-mailman (input) for mailman id 16204;
 Fri, 30 Oct 2020 19:11:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZoB-0004KA-3O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 376e3431-7351-44c6-a884-9ea7001da9b2;
 Fri, 30 Oct 2020 19:11:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZo4-0000IC-V5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZo4-0002kP-Tb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZoB-0004KA-3O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:31 +0000
X-Inumbo-ID: 376e3431-7351-44c6-a884-9ea7001da9b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 376e3431-7351-44c6-a884-9ea7001da9b2;
	Fri, 30 Oct 2020 19:11:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fqtWK5ZQwOqjKzpdx83xAO4M7tAK4Swfd8TQTRThtQA=; b=Sgixh2uHHRdc2ms5PPmN4micmE
	kJxBQKsc+I4zhUVA+iA+6t1MIL02Rc8UqKMuGPJloUuqm6ht4uFDh/V57Knn5Q6vLpLDZopSHJ8PD
	1hdAl7X3RfLQ61NjrHps6M0lqmbn6AL6Lxur/3Q6Jvj1F6Rs2Y6YJIM4U+43A2QWfOrM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZo4-0000IC-V5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZo4-0002kP-Tb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:11:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/xtensa/tags/20200625-xtensa' into staging
Message-Id: <E1kYZo4-0002kP-Tb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:11:24 +0000

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

commit 5acc270a355120ce967ca1f1eeca0abbdb9303c8
Merge: 63d211993b73ca9ac2bc618afeb61a698e9f5198 8a3a81478dcc592518069125a6ad271fe5511b95
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jun 25 21:20:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jun 25 21:20:45 2020 +0100

    Merge remote-tracking branch 'remotes/xtensa/tags/20200625-xtensa' into staging
    
    target/xtensa fixes for 5.1:
    
    - fix access to special registers missing in the core configuration;
    - fix simcall opcode behavior for new hardware;
    - drop gen_io_end call from xtensa translator.
    
    # gpg: Signature made Thu 25 Jun 2020 09:08:58 BST
    # gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
    # gpg:                issuer "jcmvbkbc@gmail.com"
    # gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
    # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
    # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
    # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
    
    * remotes/xtensa/tags/20200625-xtensa:
      target/xtensa: drop gen_io_end call
      target/xtensa: fix simcall for newer hardware
      target/xtensa: fetch HW version from configuration overlay
      target/xtensa: work around missing SR definitions
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 .cirrus.yml                                        |   12 +-
 .gitignore                                         |   17 +-
 .gitlab-ci-edk2.yml                                |   49 -
 .gitlab-ci-opensbi.yml                             |   63 -
 .gitlab-ci.d/edk2.yml                              |   49 +
 .gitlab-ci.d/opensbi.yml                           |   63 +
 .gitlab-ci.yml                                     |   67 +-
 .mailmap                                           |    6 +-
 .travis.yml                                        |   65 +-
 MAINTAINERS                                        |  165 +-
 Makefile                                           |   35 +-
 Makefile.objs                                      |    5 +-
 accel/Makefile.objs                                |    1 +
 accel/kvm/kvm-all.c                                |  139 +-
 accel/kvm/trace-events                             |    1 +
 accel/stubs/Makefile.objs                          |    1 +
 accel/stubs/xen-stub.c                             |   53 +
 accel/tcg/cputlb.c                                 |  408 +-
 accel/tcg/tcg-all.c                                |    7 +-
 accel/tcg/tcg-runtime-gvec.c                       |  144 +
 accel/tcg/tcg-runtime.h                            |   15 +
 accel/tcg/trace-events                             |    8 +-
 accel/tcg/translate-all.c                          |   71 +-
 accel/tcg/user-exec.c                              |  299 +-
 accel/xen/Makefile.objs                            |    1 +
 accel/xen/xen-all.c                                |  227 +
 arch_init.c                                        |    1 -
 audio/Makefile.objs                                |    5 +
 audio/audio.c                                      |    5 +-
 audio/audio.h                                      |    4 +-
 audio/audio_template.h                             |    2 +
 audio/jackaudio.c                                  |  670 +++
 audio/mixeng.c                                     |    9 +-
 audio/wavcapture.c                                 |    2 +-
 authz/list.c                                       |    5 +-
 authz/listfile.c                                   |    6 +-
 authz/pamacct.c                                    |    3 +-
 authz/simple.c                                     |    3 +-
 backends/Kconfig                                   |    1 +
 backends/Makefile.objs                             |    2 +-
 backends/cryptodev-vhost-user.c                    |    3 +-
 backends/cryptodev.c                               |    2 +-
 backends/dbus-vmstate.c                            |    6 +-
 backends/hostmem-file.c                            |   11 +-
 backends/hostmem-memfd.c                           |   17 +-
 backends/hostmem.c                                 |   41 +-
 backends/rng-egd.c                                 |    3 +-
 backends/rng-random.c                              |    3 +-
 backends/rng.c                                     |    3 +-
 backends/tpm.c                                     |  208 -
 backends/tpm/Kconfig                               |   14 +
 backends/tpm/Makefile.objs                         |    4 +
 backends/tpm/tpm_backend.c                         |  208 +
 backends/tpm/tpm_emulator.c                        |  997 ++++
 backends/tpm/tpm_int.h                             |   88 +
 backends/tpm/tpm_ioctl.h                           |  271 ++
 backends/tpm/tpm_passthrough.c                     |  405 ++
 backends/tpm/tpm_util.c                            |  380 ++
 backends/tpm/trace-events                          |   33 +
 backends/vhost-user.c                              |    2 +-
 block.c                                            |  643 +--
 block/Makefile.objs                                |    1 +
 block/backup-top.c                                 |   25 +-
 block/backup.c                                     |   18 +-
 block/blkdebug.c                                   |   10 +-
 block/blklogwrites.c                               |   16 +-
 block/blkreplay.c                                  |    8 +-
 block/blkverify.c                                  |   10 +-
 block/block-backend.c                              |   57 +-
 block/block-copy.c                                 |  291 +-
 block/bochs.c                                      |    7 +-
 block/cloop.c                                      |    7 +-
 block/commit.c                                     |   24 +-
 block/copy-on-read.c                               |    7 +-
 block/crypto.c                                     |   49 +-
 block/dirty-bitmap.c                               |   22 +
 block/dmg.c                                        |    7 +-
 block/file-posix.c                                 |   15 +-
 block/file-win32.c                                 |    6 +-
 block/filter-compress.c                            |    7 +-
 block/gluster.c                                    |   15 +-
 block/io.c                                         |  259 +-
 block/io_uring.c                                   |   11 +-
 block/iscsi.c                                      |    9 +-
 block/mirror.c                                     |   27 +-
 block/monitor/Makefile.objs                        |    1 +
 block/monitor/bitmap-qmp-cmds.c                    |  321 ++
 block/nbd.c                                        |   27 +-
 block/nfs.c                                        |   61 +-
 block/nvme.c                                       |    4 +-
 block/parallels.c                                  |   44 +-
 block/qcow.c                                       |   19 +-
 block/qcow2-bitmap.c                               |   44 +
 block/qcow2-cluster.c                              |    2 +-
 block/qcow2-refcount.c                             |    4 +-
 block/qcow2-snapshot.c                             |   20 +-
 block/qcow2-threads.c                              |  240 +-
 block/qcow2.c                                      |  287 +-
 block/qcow2.h                                      |   23 +-
 block/qed.c                                        |   19 +-
 block/quorum.c                                     |    8 +-
 block/raw-format.c                                 |  142 +-
 block/rbd.c                                        |    5 +-
 block/replication.c                                |   23 +-
 block/sheepdog.c                                   |   27 +-
 block/ssh.c                                        |    7 +-
 block/throttle-groups.c                            |    6 +-
 block/throttle.c                                   |    7 +-
 block/vdi.c                                        |   17 +-
 block/vhdx-log.c                                   |    2 +-
 block/vhdx.c                                       |  113 +-
 block/vmdk.c                                       |   87 +-
 block/vpc.c                                        |   17 +-
 block/vvfat.c                                      |   27 +-
 blockdev.c                                         |  354 +-
 blockjob.c                                         |   14 +-
 bootdevice.c                                       |   10 +-
 bsd-user/main.c                                    |   12 +-
 chardev/char-serial.c                              |    2 +-
 chardev/char-socket.c                              |   24 +-
 chardev/char.c                                     |   21 +-
 configure                                          |  242 +-
 contrib/libvhost-user/libvhost-user.c              |  351 +-
 contrib/libvhost-user/libvhost-user.h              |   24 +-
 contrib/vhost-user-blk/vhost-user-blk.c            |    4 +-
 cpus-common.c                                      |   49 +-
 cpus.c                                             |   40 +-
 crypto/Makefile.objs                               |    5 +-
 crypto/cipher-builtin.c                            |   10 +-
 crypto/init.c                                      |    2 +-
 crypto/random-none.c                               |   38 +
 crypto/secret.c                                    |  356 +-
 crypto/secret_common.c                             |  403 ++
 crypto/secret_keyring.c                            |  148 +
 crypto/tlscreds.c                                  |   12 +-
 crypto/tlscredsanon.c                              |    3 +-
 crypto/tlscredspsk.c                               |    6 +-
 crypto/tlscredsx509.c                              |    9 +-
 default-configs/arm-softmmu.mak                    |    1 +
 default-configs/mips64el-softmmu.mak               |    2 +-
 default-configs/riscv32-softmmu.mak                |    1 +
 default-configs/riscv64-softmmu.mak                |   11 +-
 default-configs/rx-softmmu.mak                     |    1 +
 default-configs/unicore32-softmmu.mak              |    1 +
 device_tree.c                                      |    4 +-
 disas.c                                            |   50 +-
 dma-helpers.c                                      |   22 +
 docs/devel/clocks.rst                              |  391 ++
 docs/devel/index.rst                               |    1 +
 docs/devel/loads-stores.rst                        |   39 +-
 docs/devel/migration.rst                           |   20 +
 docs/devel/qapi-code-gen.txt                       |    4 +-
 docs/devel/testing.rst                             |  107 +
 docs/interop/qcow2.txt                             |    4 +
 docs/interop/vhost-user.rst                        |   44 +
 docs/qdev-device-use.txt                           |   17 +-
 docs/specs/acpi_hest_ghes.rst                      |  110 +
 docs/specs/acpi_hw_reduced_hotplug.rst             |    3 +-
 docs/specs/index.rst                               |    1 +
 docs/specs/tpm.rst                                 |   16 +-
 docs/system/arm/aspeed.rst                         |   85 +
 docs/system/arm/integratorcp.rst                   |    4 +-
 docs/system/arm/mps2.rst                           |   29 +
 docs/system/arm/musca.rst                          |   31 +
 docs/system/arm/vexpress.rst                       |   60 +
 docs/system/deprecated.rst                         |  152 +-
 docs/system/s390x/3270.rst                         |   32 +
 docs/system/s390x/css.rst                          |   86 +
 docs/system/s390x/protvirt.rst                     |   60 +
 docs/system/s390x/vfio-ap.rst                      |    8 +-
 docs/system/s390x/vfio-ccw.rst                     |   77 +
 docs/system/target-arm.rst                         |   21 +-
 docs/system/target-mips.rst                        |    2 +-
 docs/system/target-rx.rst                          |   36 +
 docs/system/target-s390x.rst                       |    8 +
 docs/system/targets.rst                            |    1 +
 docs/tools/qemu-img.rst                            |   87 +-
 docs/xbzrle.txt                                    |    8 +-
 dtc                                                |    2 +-
 exec.c                                             |   46 +-
 fpu/softfloat-specialize.inc.c                     |   32 +-
 fpu/softfloat.c                                    | 1515 ++----
 gdb-xml/arm-m-profile.xml                          |   27 +
 gdb-xml/m68k-core.xml                              |   29 +
 gdbstub.c                                          |  119 +-
 hmp-commands-info.hx                               |    7 +-
 hmp-commands.hx                                    |   21 +-
 hw/9pfs/9p-util.h                                  |   13 +
 hw/9pfs/9p.c                                       |   38 +-
 hw/9pfs/9p.h                                       |   12 +-
 hw/9pfs/virtio-9p-device.c                         |   15 +-
 hw/9pfs/xen-9p-backend.c                           |   43 +-
 hw/Kconfig                                         |    1 +
 hw/Makefile.objs                                   |    2 +-
 hw/acpi/Kconfig                                    |    4 +
 hw/acpi/Makefile.objs                              |    5 +-
 hw/acpi/aml-build-stub.c                           |   79 +
 hw/acpi/aml-build.c                                |   64 +-
 hw/acpi/cpu.c                                      |    2 +-
 hw/acpi/generic_event_device.c                     |   79 +-
 hw/acpi/ghes.c                                     |  448 ++
 hw/acpi/ich9.c                                     |   25 +-
 hw/acpi/nvdimm.c                                   |  105 +-
 hw/acpi/pcihp.c                                    |    9 +-
 hw/acpi/piix4.c                                    |   44 +-
 hw/adc/stm32f2xx_adc.c                             |    4 +-
 hw/alpha/typhoon.c                                 |    4 +-
 hw/arm/Kconfig                                     |   14 +-
 hw/arm/allwinner-a10.c                             |   52 +-
 hw/arm/allwinner-h3.c                              |   69 +-
 hw/arm/armsse.c                                    |  174 +-
 hw/arm/armv7m.c                                    |   20 +-
 hw/arm/aspeed.c                                    |  231 +-
 hw/arm/aspeed_ast2600.c                            |  152 +-
 hw/arm/aspeed_soc.c                                |  109 +-
 hw/arm/bcm2835_peripherals.c                       |  127 +-
 hw/arm/bcm2836.c                                   |   33 +-
 hw/arm/cubieboard.c                                |   11 +-
 hw/arm/digic.c                                     |   16 +-
 hw/arm/digic_boards.c                              |    2 +-
 hw/arm/exynos4210.c                                |   50 +-
 hw/arm/exynos4_boards.c                            |   11 +-
 hw/arm/fsl-imx25.c                                 |   76 +-
 hw/arm/fsl-imx31.c                                 |   45 +-
 hw/arm/fsl-imx6.c                                  |   89 +-
 hw/arm/fsl-imx6ul.c                                |  115 +-
 hw/arm/fsl-imx7.c                                  |  135 +-
 hw/arm/highbank.c                                  |   28 +-
 hw/arm/imx25_pdk.c                                 |   12 +-
 hw/arm/integratorcp.c                              |   29 +-
 hw/arm/kzm.c                                       |    5 +-
 hw/arm/mcimx6ul-evk.c                              |   11 +-
 hw/arm/mcimx7d-sabre.c                             |   11 +-
 hw/arm/microbit.c                                  |   22 +-
 hw/arm/mps2-tz.c                                   |  102 +-
 hw/arm/mps2.c                                      |   93 +-
 hw/arm/msf2-soc.c                                  |   48 +-
 hw/arm/msf2-som.c                                  |   16 +-
 hw/arm/musca.c                                     |   60 +-
 hw/arm/musicpal.c                                  |   20 +-
 hw/arm/netduino2.c                                 |    4 +-
 hw/arm/netduinoplus2.c                             |    4 +-
 hw/arm/nrf51_soc.c                                 |   42 +-
 hw/arm/nseries.c                                   |   12 +-
 hw/arm/omap1.c                                     |   16 +-
 hw/arm/omap2.c                                     |   16 +-
 hw/arm/orangepi.c                                  |   11 +-
 hw/arm/pxa2xx.c                                    |   74 +-
 hw/arm/pxa2xx_gpio.c                               |   12 +-
 hw/arm/pxa2xx_pic.c                                |    5 +-
 hw/arm/raspi.c                                     |   15 +-
 hw/arm/realview.c                                  |   25 +-
 hw/arm/sabrelite.c                                 |   19 +-
 hw/arm/sbsa-ref.c                                  |   33 +-
 hw/arm/spitz.c                                     |    4 +-
 hw/arm/stellaris.c                                 |   12 +-
 hw/arm/stm32f205_soc.c                             |   34 +-
 hw/arm/stm32f405_soc.c                             |   66 +-
 hw/arm/strongarm.c                                 |    9 +-
 hw/arm/versatilepb.c                               |   21 +-
 hw/arm/vexpress.c                                  |   34 +-
 hw/arm/virt-acpi-build.c                           |   66 +
 hw/arm/virt.c                                      |  232 +-
 hw/arm/xilinx_zynq.c                               |  104 +-
 hw/arm/xlnx-versal-virt.c                          |   85 +-
 hw/arm/xlnx-versal.c                               |  130 +-
 hw/arm/xlnx-zcu102.c                               |   85 +-
 hw/arm/xlnx-zynqmp.c                               |  101 +-
 hw/audio/ac97.c                                    |    4 +-
 hw/audio/adlib.c                                   |    5 +-
 hw/audio/es1370.c                                  |    7 +-
 hw/audio/gus.c                                     |    8 +-
 hw/audio/gusemu_hal.c                              |    2 +-
 hw/audio/gusemu_mixer.c                            |    2 +-
 hw/audio/intel-hda.c                               |    6 +-
 hw/audio/marvell_88w8618.c                         |    2 +-
 hw/audio/pcspk.c                                   |    2 +-
 hw/block/Makefile.objs                             |    2 +-
 hw/block/block.c                                   |   40 +-
 hw/block/dataplane/virtio-blk.c                    |    8 +
 hw/block/fdc.c                                     |  214 +-
 hw/block/nand.c                                    |    6 +-
 hw/block/nvme.c                                    |  583 ++-
 hw/block/nvme.h                                    |   36 +-
 hw/block/pflash_cfi01.c                            |   83 +-
 hw/block/pflash_cfi02.c                            |   18 +-
 hw/block/swim.c                                    |    5 +-
 hw/block/trace-events                              |  176 +-
 hw/block/vhost-user-blk.c                          |   47 +-
 hw/block/virtio-blk.c                              |   43 +-
 hw/block/xen-block.c                               |   18 +-
 hw/char/Kconfig                                    |    3 +
 hw/char/Makefile.objs                              |    2 +
 hw/char/cadence_uart.c                             |   73 +-
 hw/char/exynos4210_uart.c                          |    5 +-
 hw/char/ibex_uart.c                                |  492 ++
 hw/char/mcf_uart.c                                 |    5 +-
 hw/char/parallel-isa.c                             |    5 +-
 hw/char/parallel.c                                 |   22 +
 hw/char/renesas_sci.c                              |  350 ++
 hw/char/serial-isa.c                               |   31 +-
 hw/char/serial-pci-multi.c                         |    8 +-
 hw/char/serial-pci.c                               |    7 +-
 hw/char/serial.c                                   |   16 +-
 hw/char/spapr_vty.c                                |    4 +-
 hw/char/trace-events                               |    3 +
 hw/char/virtio-console.c                           |    2 +-
 hw/char/virtio-serial-bus.c                        |    8 +-
 hw/char/xilinx_uartlite.c                          |    5 +-
 hw/core/Makefile.objs                              |    3 +-
 hw/core/bus.c                                      |   47 +-
 hw/core/clock-vmstate.c                            |   25 +
 hw/core/clock.c                                    |  130 +
 hw/core/cpu.c                                      |    7 +-
 hw/core/empty_slot.c                               |  102 -
 hw/core/generic-loader.c                           |    2 +-
 hw/core/machine-hmp-cmds.c                         |    2 +-
 hw/core/machine-qmp-cmds.c                         |   16 +-
 hw/core/machine.c                                  |   96 +-
 hw/core/numa.c                                     |    5 +
 hw/core/qdev-clock.c                               |  185 +
 hw/core/qdev-properties-system.c                   |  151 +-
 hw/core/qdev-properties.c                          |  113 +-
 hw/core/qdev.c                                     |  225 +-
 hw/core/register.c                                 |   46 +-
 hw/core/stream.c                                   |    4 +-
 hw/core/sysbus.c                                   |   27 +-
 hw/core/trace-events                               |    7 +
 hw/cpu/a15mpcore.c                                 |    5 +-
 hw/cpu/a9mpcore.c                                  |   23 +-
 hw/cpu/arm11mpcore.c                               |   18 +-
 hw/cpu/core.c                                      |    4 +-
 hw/cpu/realview_mpcore.c                           |   10 +-
 hw/cris/axis_dev88.c                               |    4 +-
 hw/display/artist.c                                |    4 +-
 hw/display/ati.c                                   |   15 +-
 hw/display/blizzard.c                              |   10 +-
 hw/display/bochs-display.c                         |    3 +-
 hw/display/cg3.c                                   |   16 +-
 hw/display/cirrus_vga.c                            |  123 +-
 hw/display/dpcd.c                                  |   20 +-
 hw/display/exynos4210_fimd.c                       |   46 +-
 hw/display/milkymist-tmu2.c                        |    4 +-
 hw/display/next-fb.c                               |    2 +-
 hw/display/omap_dss.c                              |    2 +-
 hw/display/pxa2xx_lcd.c                            |   34 +-
 hw/display/qxl.c                                   |   43 +-
 hw/display/ramfb-standalone.c                      |   12 +-
 hw/display/ramfb.c                                 |   79 +-
 hw/display/sm501.c                                 |  326 +-
 hw/display/tcx.c                                   |    4 +-
 hw/display/trace-events                            |   10 +
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |    4 +-
 hw/display/vhost-user-gpu-pci.c                    |    3 +-
 hw/display/vhost-user-gpu.c                        |    2 +-
 hw/display/vhost-user-vga.c                        |    3 +-
 hw/display/virtio-gpu-base.c                       |    2 +-
 hw/display/virtio-gpu-pci.c                        |    3 +-
 hw/display/virtio-vga.c                            |    4 +-
 hw/display/vmware_vga.c                            |   18 +-
 hw/display/xlnx_dp.c                               |   34 +-
 hw/dma/i8257.c                                     |    9 +-
 hw/dma/puv3_dma.c                                  |    9 +-
 hw/dma/pxa2xx_dma.c                                |   22 +-
 hw/dma/rc4030.c                                    |    7 +-
 hw/dma/sparc32_dma.c                               |   26 +-
 hw/dma/xilinx_axidma.c                             |   92 +-
 hw/dma/xlnx-zdma.c                                 |   32 +-
 hw/gpio/aspeed_gpio.c                              |    4 +-
 hw/gpio/pl061.c                                    |   12 +-
 hw/gpio/puv3_gpio.c                                |   15 +-
 hw/hppa/dino.c                                     |    8 +-
 hw/hppa/lasi.c                                     |    4 +-
 hw/hppa/machine.c                                  |    4 +-
 hw/hyperv/Kconfig                                  |    5 +
 hw/hyperv/Makefile.objs                            |    1 +
 hw/hyperv/hyperv.c                                 |   27 +-
 hw/hyperv/trace-events                             |   18 +
 hw/hyperv/vmbus.c                                  | 2778 +++++++++++
 hw/i2c/core.c                                      |    5 +-
 hw/i2c/imx_i2c.c                                   |    2 +-
 hw/i2c/microbit_i2c.c                              |    2 +-
 hw/i2c/mpc_i2c.c                                   |    2 +-
 hw/i2c/pm_smbus.c                                  |    1 -
 hw/i2c/smbus_eeprom.c                              |    4 +-
 hw/i2c/versatile_i2c.c                             |   38 +-
 hw/i386/Makefile.objs                              |    1 +
 hw/i386/acpi-build.c                               |  529 +--
 hw/i386/acpi-build.h                               |    3 +
 hw/i386/acpi-common.c                              |  156 +
 hw/i386/acpi-common.h                              |   15 +
 hw/i386/amd_iommu.c                                |   22 +-
 hw/i386/fw_cfg.c                                   |   28 +
 hw/i386/fw_cfg.h                                   |    1 +
 hw/i386/kvm/apic.c                                 |    2 +-
 hw/i386/microvm.c                                  |   64 +-
 hw/i386/pc.c                                       |  112 +-
 hw/i386/pc_piix.c                                  |   33 +-
 hw/i386/pc_q35.c                                   |   46 +-
 hw/i386/pc_sysfw.c                                 |   13 +-
 hw/i386/vmmouse.c                                  |   41 +-
 hw/i386/vmport.c                                   |  186 +-
 hw/i386/x86.c                                      |   64 +-
 hw/i386/xen/xen-hvm.c                              |    6 +-
 hw/i386/xen/xen_platform.c                         |    1 +
 hw/ide/ahci-allwinner.c                            |    2 +-
 hw/ide/ahci.c                                      |   19 +-
 hw/ide/core.c                                      |    6 +-
 hw/ide/isa.c                                       |    5 +-
 hw/ide/macio.c                                     |    8 +-
 hw/ide/microdrive.c                                |    3 +-
 hw/ide/pci.c                                       |   12 +-
 hw/ide/piix.c                                      |    2 +-
 hw/ide/qdev.c                                      |   19 +-
 hw/ide/sii3112.c                                   |    5 +-
 hw/input/adb-kbd.c                                 |    6 +-
 hw/input/pckbd.c                                   |   31 +
 hw/input/pxa2xx_keypad.c                           |   10 +-
 hw/input/vhost-user-input.c                        |    2 +-
 hw/input/virtio-input-hid.c                        |    2 +-
 hw/input/virtio-input-host.c                       |    2 +-
 hw/input/virtio-input.c                            |    9 +-
 hw/intc/Kconfig                                    |    3 +
 hw/intc/Makefile.objs                              |    2 +
 hw/intc/apic.c                                     |    2 +-
 hw/intc/apic_common.c                              |    6 +-
 hw/intc/arm_gicv3_kvm.c                            |    4 +-
 hw/intc/armv7m_nvic.c                              |   15 +-
 hw/intc/exynos4210_gic.c                           |    5 +-
 hw/intc/i8259_common.c                             |    5 +-
 hw/intc/ibex_plic.c                                |  261 ++
 hw/intc/ioapic.c                                   |   21 +-
 hw/intc/pnv_xive.c                                 |   10 +-
 hw/intc/puv3_intc.c                                |    9 +-
 hw/intc/realview_gic.c                             |    4 +-
 hw/intc/rx_icu.c                                   |  397 ++
 hw/intc/s390_flic.c                                |   10 +-
 hw/intc/spapr_xive.c                               |   10 +-
 hw/intc/xics.c                                     |    6 +-
 hw/intc/xive.c                                     |    4 +-
 hw/ipack/ipack.c                                   |    6 +-
 hw/ipmi/ipmi.c                                     |    3 +-
 hw/ipmi/smbus_ipmi.c                               |    2 +-
 hw/isa/apm.c                                       |   15 +-
 hw/isa/i82378.c                                    |    8 +-
 hw/isa/isa-bus.c                                   |   42 +-
 hw/isa/isa-superio.c                               |   45 +-
 hw/isa/lpc_ich9.c                                  |    8 +-
 hw/isa/piix3.c                                     |    1 +
 hw/isa/piix4.c                                     |    3 +-
 hw/isa/trace-events                                |    4 +
 hw/isa/vt82c686.c                                  |   15 +-
 hw/lm32/lm32.h                                     |   13 +-
 hw/lm32/milkymist-hw.h                             |   37 +-
 hw/m68k/mcf5206.c                                  |   14 +-
 hw/m68k/mcf5208.c                                  |   20 +-
 hw/m68k/mcf_intc.c                                 |   15 +-
 hw/m68k/next-cube.c                                |   12 +-
 hw/m68k/q800.c                                     |   39 +-
 hw/mem/Kconfig                                     |    2 +-
 hw/mem/nvdimm.c                                    |    5 +-
 hw/mem/pc-dimm.c                                   |   11 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   45 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   14 +-
 hw/microblaze/xlnx-zynqmp-pmu.c                    |   21 +-
 hw/mips/Kconfig                                    |    3 +-
 hw/mips/Makefile.objs                              |   10 +-
 hw/mips/boston.c                                   |   27 +-
 hw/mips/cps.c                                      |   20 +-
 hw/mips/fuloong2e.c                                |  400 ++
 hw/mips/gt64xxx_pci.c                              |    5 +-
 hw/mips/jazz.c                                     |  428 ++
 hw/mips/malta.c                                    | 1451 ++++++
 hw/mips/mips_fulong2e.c                            |  398 --
 hw/mips/mips_int.c                                 |   11 +-
 hw/mips/mips_jazz.c                                |  428 --
 hw/mips/mips_malta.c                               | 1458 ------
 hw/mips/mips_mipssim.c                             |  246 -
 hw/mips/mips_r4k.c                                 |  318 --
 hw/mips/mipssim.c                                  |  246 +
 hw/mips/r4k.c                                      |  318 ++
 hw/misc/Makefile.objs                              |    3 +-
 hw/misc/aspeed_scu.c                               |   11 +-
 hw/misc/aspeed_sdmc.c                              |   57 +-
 hw/misc/auxbus.c                                   |   24 +-
 hw/misc/bcm2835_mphi.c                             |  191 +
 hw/misc/edu.c                                      |    3 +-
 hw/misc/empty_slot.c                               |  108 +
 hw/misc/grlib_ahb_apb_pnp.c                        |   24 +-
 hw/misc/imx2_wdt.c                                 |   90 -
 hw/misc/imx6ul_ccm.c                               |   76 +-
 hw/misc/mac_via.c                                  |   15 +-
 hw/misc/macio/cuda.c                               |   19 +-
 hw/misc/macio/gpio.c                               |    2 +-
 hw/misc/macio/macio.c                              |   63 +-
 hw/misc/macio/pmu.c                                |   23 +-
 hw/misc/pca9552.c                                  |    2 +-
 hw/misc/puv3_pm.c                                  |    9 +-
 hw/misc/tmp105.c                                   |    2 +-
 hw/misc/tmp421.c                                   |    8 +-
 hw/misc/trace-events                               |    8 +
 hw/misc/zynq_slcr.c                                |  172 +-
 hw/net/Makefile.objs                               |    2 +
 hw/net/cadence_gem.c                               |  475 +-
 hw/net/can/can_kvaser_pci.c                        |    2 +-
 hw/net/can/can_mioe3680_pci.c                      |    4 +-
 hw/net/can/can_pcm3680_pci.c                       |    4 +-
 hw/net/e1000.c                                     |    3 +-
 hw/net/e1000e.c                                    |    2 +-
 hw/net/e1000e_core.c                               |   10 +-
 hw/net/eepro100.c                                  |    2 +-
 hw/net/etraxfs_eth.c                               |    4 +-
 hw/net/fsl_etsec/etsec.c                           |    5 +-
 hw/net/ftgmac100.c                                 |   29 +-
 hw/net/imx_fec.c                                   |  108 +-
 hw/net/lan9118.c                                   |    5 +-
 hw/net/lance.c                                     |    2 +-
 hw/net/lasi_i82596.c                               |    7 +-
 hw/net/mcf_fec.c                                   |    9 +-
 hw/net/msf2-emac.c                                 |  589 +++
 hw/net/ne2000-isa.c                                |    2 +-
 hw/net/ne2000-pci.c                                |    2 +-
 hw/net/pcnet-pci.c                                 |    2 +-
 hw/net/rtl8139.c                                   |    2 +-
 hw/net/smc91c111.c                                 |    5 +-
 hw/net/spapr_llan.c                                |    6 +-
 hw/net/sungem.c                                    |    2 +-
 hw/net/sunhme.c                                    |    2 +-
 hw/net/trace-events                                |   21 +
 hw/net/tulip.c                                     |   14 +-
 hw/net/tulip.h                                     |    2 +-
 hw/net/virtio-net.c                                |  393 +-
 hw/net/vmxnet3.c                                   |    2 +-
 hw/net/xilinx_axienet.c                            |   88 +-
 hw/nios2/10m50_devboard.c                          |   15 +-
 hw/nubus/nubus-device.c                            |    2 +-
 hw/nvram/fw_cfg.c                                  |   12 +-
 hw/nvram/mac_nvram.c                               |   19 +-
 hw/nvram/trace-events                              |    4 +
 hw/openrisc/openrisc_sim.c                         |    9 +-
 hw/pci-bridge/dec.c                                |   16 +-
 hw/pci-bridge/pci_expander_bridge.c                |    8 +-
 hw/pci-host/Kconfig                                |    5 +
 hw/pci-host/Makefile.objs                          |    2 +-
 hw/pci-host/bonito.c                               |   98 +-
 hw/pci-host/designware.c                           |    6 +-
 hw/pci-host/gpex.c                                 |    6 +-
 hw/pci-host/grackle.c                              |    2 +-
 hw/pci-host/i440fx.c                               |   19 +-
 hw/pci-host/pam.c                                  |    1 -
 hw/pci-host/pnv_phb3.c                             |   21 +-
 hw/pci-host/pnv_phb3_msi.c                         |    3 +-
 hw/pci-host/pnv_phb3_pbcq.c                        |    3 +-
 hw/pci-host/pnv_phb4.c                             |   11 +-
 hw/pci-host/pnv_phb4_pec.c                         |   11 +-
 hw/pci-host/prep.c                                 |    9 +-
 hw/pci-host/q35.c                                  |   28 +-
 hw/pci-host/sabre.c                                |   15 +-
 hw/pci-host/uninorth.c                             |    8 +-
 hw/pci-host/versatile.c                            |    9 +-
 hw/pci-host/xilinx-pcie.c                          |    6 +-
 hw/pci/msix.c                                      |    7 +
 hw/pci/pci.c                                       |   61 +-
 hw/pci/pci_bridge.c                                |    7 +-
 hw/pci/pcie.c                                      |   30 +-
 hw/pci/shpc.c                                      |    2 +-
 hw/pcmcia/pxa2xx.c                                 |    7 +-
 hw/ppc/e500.c                                      |   40 +-
 hw/ppc/mac_newworld.c                              |   53 +-
 hw/ppc/mac_oldworld.c                              |   28 +-
 hw/ppc/pnv.c                                       |  165 +-
 hw/ppc/pnv_bmc.c                                   |    7 +-
 hw/ppc/pnv_core.c                                  |    6 +-
 hw/ppc/pnv_psi.c                                   |   14 +-
 hw/ppc/ppc440_uc.c                                 |   10 +-
 hw/ppc/prep.c                                      |   41 +-
 hw/ppc/sam460ex.c                                  |    4 +-
 hw/ppc/spapr.c                                     |  131 +-
 hw/ppc/spapr_caps.c                                |   16 +-
 hw/ppc/spapr_cpu_core.c                            |   10 +-
 hw/ppc/spapr_drc.c                                 |   38 +-
 hw/ppc/spapr_hcall.c                               |  108 +-
 hw/ppc/spapr_iommu.c                               |    6 +-
 hw/ppc/spapr_irq.c                                 |    8 +-
 hw/ppc/spapr_nvdimm.c                              |   10 +-
 hw/ppc/spapr_pci.c                                 |  101 +-
 hw/ppc/spapr_rng.c                                 |    3 +-
 hw/ppc/spapr_rtc.c                                 |    2 +-
 hw/ppc/spapr_tpm_proxy.c                           |    2 +-
 hw/ppc/spapr_vio.c                                 |    4 +-
 hw/ppc/virtex_ml507.c                              |    9 +-
 hw/rdma/rdma_backend.c                             |   50 +-
 hw/rdma/rdma_rm.c                                  |    3 +-
 hw/rdma/rdma_utils.c                               |    1 +
 hw/riscv/Kconfig                                   |    9 +
 hw/riscv/Makefile.objs                             |    1 +
 hw/riscv/boot.c                                    |   58 +-
 hw/riscv/opentitan.c                               |  210 +
 hw/riscv/riscv_hart.c                              |    7 +-
 hw/riscv/sifive_clint.c                            |    5 +-
 hw/riscv/sifive_e.c                                |  121 +-
 hw/riscv/sifive_e_prci.c                           |    5 +-
 hw/riscv/sifive_gpio.c                             |   45 +-
 hw/riscv/sifive_plic.c                             |    5 +-
 hw/riscv/sifive_test.c                             |    5 +-
 hw/riscv/sifive_u.c                                |  348 +-
 hw/riscv/spike.c                                   |  252 +-
 hw/riscv/virt.c                                    |   48 +-
 hw/rtc/m48t59-isa.c                                |    7 +-
 hw/rtc/m48t59.c                                    |    5 +-
 hw/rtc/mc146818rtc.c                               |   37 +-
 hw/rtc/sun4v-rtc.c                                 |    5 +-
 hw/rx/Kconfig                                      |   10 +
 hw/rx/Makefile.objs                                |    2 +
 hw/rx/rx-gdbsim.c                                  |  198 +
 hw/rx/rx62n.c                                      |  323 ++
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/ap-bridge.c                               |    6 +-
 hw/s390x/css-bridge.c                              |   13 +-
 hw/s390x/css.c                                     |   57 +-
 hw/s390x/event-facility.c                          |   66 +-
 hw/s390x/ipl.c                                     |   59 +-
 hw/s390x/ipl.h                                     |  103 +-
 hw/s390x/pv.c                                      |  113 +
 hw/s390x/s390-ccw.c                                |   25 +-
 hw/s390x/s390-pci-bus.c                            |    8 +-
 hw/s390x/s390-skeys.c                              |    6 +-
 hw/s390x/s390-stattrib.c                           |    6 +-
 hw/s390x/s390-virtio-ccw.c                         |  186 +-
 hw/s390x/sclp.c                                    |   75 +-
 hw/s390x/tod.c                                     |    4 +-
 hw/s390x/vhost-vsock-ccw.c                         |    3 +-
 hw/s390x/virtio-ccw-9p.c                           |    3 +-
 hw/s390x/virtio-ccw-balloon.c                      |    7 +-
 hw/s390x/virtio-ccw-blk.c                          |    5 +-
 hw/s390x/virtio-ccw-crypto.c                       |    3 +-
 hw/s390x/virtio-ccw-gpu.c                          |    3 +-
 hw/s390x/virtio-ccw-input.c                        |    3 +-
 hw/s390x/virtio-ccw-net.c                          |    5 +-
 hw/s390x/virtio-ccw-rng.c                          |    3 +-
 hw/s390x/virtio-ccw-scsi.c                         |    6 +-
 hw/s390x/virtio-ccw-serial.c                       |    3 +-
 hw/s390x/virtio-ccw.c                              |    8 +-
 hw/s390x/virtio-ccw.h                              |    2 +-
 hw/scsi/esp-pci.c                                  |    1 +
 hw/scsi/lsi53c895a.c                               |    2 +-
 hw/scsi/megasas.c                                  |   44 +-
 hw/scsi/scsi-bus.c                                 |   23 +-
 hw/scsi/scsi-disk.c                                |   14 +-
 hw/scsi/spapr_vscsi.c                              |    4 +-
 hw/scsi/vhost-scsi.c                               |    4 +-
 hw/scsi/vhost-user-scsi.c                          |    5 +-
 hw/scsi/virtio-scsi.c                              |    2 +-
 hw/sd/aspeed_sdhci.c                               |    2 +-
 hw/sd/milkymist-memcard.c                          |    6 +-
 hw/sd/pxa2xx_mmci.c                                |   20 +-
 hw/sd/sd.c                                         |   44 +-
 hw/sd/sdhci-internal.h                             |    7 +-
 hw/sd/sdhci-pci.c                                  |    2 +-
 hw/sd/sdhci.c                                      |   24 +-
 hw/sd/ssi-sd.c                                     |    7 +-
 hw/semihosting/console.c                           |    1 -
 hw/sh4/r2d.c                                       |   12 +-
 hw/sh4/sh7750.c                                    |    1 +
 hw/sh4/sh_pci.c                                    |    2 +-
 hw/sparc/Kconfig                                   |    1 +
 hw/sparc/leon3.c                                   |   34 +-
 hw/sparc/sun4m.c                                   |   94 +-
 hw/sparc64/niagara.c                               |    7 +-
 hw/sparc64/sun4u.c                                 |   61 +-
 hw/ssi/aspeed_smc.c                                |    1 -
 hw/ssi/imx_spi.c                                   |    6 +-
 hw/ssi/mss-spi.c                                   |    1 -
 hw/ssi/ssi.c                                       |   43 +-
 hw/ssi/xilinx_spi.c                                |    1 -
 hw/ssi/xilinx_spips.c                              |    9 +-
 hw/timer/Kconfig                                   |    6 +
 hw/timer/Makefile.objs                             |    2 +
 hw/timer/exynos4210_mct.c                          |   16 +-
 hw/timer/nrf51_timer.c                             |   14 +-
 hw/timer/puv3_ost.c                                |    9 +-
 hw/timer/pxa2xx_timer.c                            |    1 +
 hw/timer/renesas_cmt.c                             |  283 ++
 hw/timer/renesas_tmr.c                             |  477 ++
 hw/timer/sh_timer.c                                |    3 +-
 hw/timer/stm32f2xx_timer.c                         |    1 -
 hw/timer/trace-events                              |    7 +-
 hw/tpm/Kconfig                                     |   21 +-
 hw/tpm/Makefile.objs                               |    3 -
 hw/tpm/tpm_crb.c                                   |    4 +-
 hw/tpm/tpm_emulator.c                              |  997 ----
 hw/tpm/tpm_int.h                                   |   75 -
 hw/tpm/tpm_ioctl.h                                 |  271 --
 hw/tpm/tpm_passthrough.c                           |  405 --
 hw/tpm/tpm_ppi.c                                   |    1 +
 hw/tpm/tpm_ppi.h                                   |    1 -
 hw/tpm/tpm_prop.h                                  |   31 +
 hw/tpm/tpm_spapr.c                                 |    4 +-
 hw/tpm/tpm_tis.h                                   |    1 -
 hw/tpm/tpm_tis_common.c                            |   15 +-
 hw/tpm/tpm_tis_isa.c                               |    3 +-
 hw/tpm/tpm_tis_sysbus.c                            |    5 +-
 hw/tpm/tpm_util.c                                  |  377 --
 hw/tpm/tpm_util.h                                  |   85 -
 hw/tpm/trace-events                                |   34 +-
 hw/unicore32/puv3.c                                |    2 -
 hw/usb/Kconfig                                     |    5 +
 hw/usb/Makefile.objs                               |    1 +
 hw/usb/bus.c                                       |   70 +-
 hw/usb/ccid-card-emulated.c                        |    2 +-
 hw/usb/ccid.h                                      |    2 +-
 hw/usb/dev-audio.c                                 |    2 +-
 hw/usb/dev-hid.c                                   |    2 +-
 hw/usb/dev-hub.c                                   |    2 +-
 hw/usb/dev-mtp.c                                   |    9 +-
 hw/usb/dev-network.c                               |    4 +-
 hw/usb/dev-serial.c                                |    4 +-
 hw/usb/dev-smartcard-reader.c                      |   11 +-
 hw/usb/dev-storage.c                               |   22 +-
 hw/usb/dev-uas.c                                   |    2 +-
 hw/usb/dev-wacom.c                                 |    2 +-
 hw/usb/hcd-dwc2.c                                  | 1417 ++++++
 hw/usb/hcd-dwc2.h                                  |  190 +
 hw/usb/hcd-ehci-pci.c                              |    2 +-
 hw/usb/hcd-ehci.c                                  |    2 +-
 hw/usb/hcd-ehci.h                                  |    2 +-
 hw/usb/hcd-musb.c                                  |    5 +-
 hw/usb/host-libusb.c                               |   93 +-
 hw/usb/redirect.c                                  |    4 +-
 hw/usb/trace-events                                |   51 +
 hw/usb/tusb6010.c                                  |    1 +
 hw/usb/xen-usb.c                                   |   19 +-
 hw/vfio/ap.c                                       |    2 +-
 hw/vfio/ccw.c                                      |  227 +-
 hw/vfio/display.c                                  |    4 +-
 hw/vfio/pci-quirks.c                               |   95 +-
 hw/vfio/pci.c                                      |   39 +-
 hw/vfio/platform.c                                 |    5 +-
 hw/virtio/Makefile.objs                            |    4 +-
 hw/virtio/trace-events                             |    3 +-
 hw/virtio/vhost-scsi-pci.c                         |    5 +-
 hw/virtio/vhost-user-blk-pci.c                     |    5 +-
 hw/virtio/vhost-user-fs-pci.c                      |    3 +-
 hw/virtio/vhost-user-fs.c                          |    2 +-
 hw/virtio/vhost-user-input-pci.c                   |    3 +-
 hw/virtio/vhost-user-scsi-pci.c                    |    5 +-
 hw/virtio/vhost-user-vsock-pci.c                   |   83 +
 hw/virtio/vhost-user-vsock.c                       |  181 +
 hw/virtio/vhost-user.c                             |  743 ++-
 hw/virtio/vhost-vsock-common.c                     |  258 +
 hw/virtio/vhost-vsock-pci.c                        |    3 +-
 hw/virtio/vhost-vsock.c                            |  285 +-
 hw/virtio/vhost.c                                  |   63 +-
 hw/virtio/virtio-9p-pci.c                          |    3 +-
 hw/virtio/virtio-balloon-pci.c                     |    7 +-
 hw/virtio/virtio-balloon.c                         |  143 +-
 hw/virtio/virtio-blk-pci.c                         |    5 +-
 hw/virtio/virtio-crypto-pci.c                      |    3 +-
 hw/virtio/virtio-crypto.c                          |    2 +-
 hw/virtio/virtio-input-pci.c                       |    3 +-
 hw/virtio/virtio-iommu-pci.c                       |    3 +-
 hw/virtio/virtio-iommu.c                           |    2 +-
 hw/virtio/virtio-net-pci.c                         |    5 +-
 hw/virtio/virtio-pci.c                             |   13 +-
 hw/virtio/virtio-pmem-pci.c                        |    3 +-
 hw/virtio/virtio-pmem.c                            |    2 +-
 hw/virtio/virtio-rng-pci.c                         |    3 +-
 hw/virtio/virtio-rng.c                             |    4 +-
 hw/virtio/virtio-scsi-pci.c                        |    3 +-
 hw/virtio/virtio-serial-pci.c                      |    3 +-
 hw/virtio/virtio.c                                 |   16 +-
 hw/watchdog/Kconfig                                |    3 +
 hw/watchdog/Makefile.objs                          |    1 +
 hw/watchdog/cmsdk-apb-watchdog.c                   |    1 +
 hw/watchdog/trace-events                           |    1 +
 hw/watchdog/wdt_diag288.c                          |    2 +-
 hw/watchdog/wdt_imx2.c                             |  304 ++
 hw/xen/Makefile.objs                               |    3 +-
 hw/xen/xen-bus.c                                   |   16 +-
 hw/xen/xen-common.c                                |  220 -
 hw/xen/xen-legacy-backend.c                        |    9 +-
 hw/xen/xen_pt.c                                    |   12 +-
 hw/xen/xen_pt.h                                    |    6 +-
 hw/xen/xen_pt_stub.c                               |   22 +
 hw/xtensa/virt.c                                   |    4 +-
 hw/xtensa/xtfpga.c                                 |   11 +-
 include/block/aio.h                                |    3 +
 include/block/block.h                              |   71 +-
 include/block/block_int.h                          |   88 +-
 include/block/dirty-bitmap.h                       |    2 +
 include/block/nvme.h                               |  180 +
 include/crypto/secret.h                            |   20 +-
 include/crypto/secret_common.h                     |   68 +
 include/crypto/secret_keyring.h                    |   52 +
 include/disas/disas.h                              |    2 +-
 include/exec/cpu-all.h                             |   39 +-
 include/exec/cpu-common.h                          |    3 -
 include/exec/cpu_ldst.h                            |  271 +-
 include/exec/exec-all.h                            |   47 +
 include/exec/gdbstub.h                             |   25 +-
 include/exec/log.h                                 |    4 +-
 include/exec/memory.h                              |   45 +-
 include/exec/ram_addr.h                            |    6 +-
 include/fpu/softfloat-helpers.h                    |   27 +-
 include/fpu/softfloat-macros.h                     |   24 +-
 include/fpu/softfloat-types.h                      |   28 +-
 include/fpu/softfloat.h                            |  336 +-
 include/hw/acpi/acpi-defs.h                        |   20 +-
 include/hw/acpi/aml-build.h                        |    4 +-
 include/hw/acpi/generic_event_device.h             |    5 +-
 include/hw/acpi/ghes.h                             |   74 +
 include/hw/acpi/ich9.h                             |    2 +-
 include/hw/arm/aspeed.h                            |    6 +
 include/hw/arm/aspeed_soc.h                        |    1 -
 include/hw/arm/bcm2835_peripherals.h               |    5 +-
 include/hw/arm/fsl-imx25.h                         |    5 +
 include/hw/arm/fsl-imx31.h                         |    4 +
 include/hw/arm/fsl-imx6.h                          |    2 +-
 include/hw/arm/fsl-imx6ul.h                        |    2 +-
 include/hw/arm/fsl-imx7.h                          |   23 +-
 include/hw/arm/msf2-soc.h                          |    2 +
 include/hw/arm/nrf51.h                             |    3 +-
 include/hw/arm/virt.h                              |    2 +
 include/hw/arm/xlnx-versal.h                       |   31 +-
 include/hw/audio/pcspk.h                           |    5 +-
 include/hw/block/block.h                           |   14 +-
 include/hw/block/fdc.h                             |    5 +-
 include/hw/boards.h                                |    3 +
 include/hw/char/cadence_uart.h                     |    6 +-
 include/hw/char/cmsdk-apb-uart.h                   |    4 +-
 include/hw/char/ibex_uart.h                        |  110 +
 include/hw/char/pl011.h                            |    9 +-
 include/hw/char/renesas_sci.h                      |   51 +
 include/hw/char/xilinx_uartlite.h                  |    4 +-
 include/hw/clock.h                                 |  225 +
 include/hw/core/cpu.h                              |   36 +-
 include/hw/cris/etraxfs.h                          |    4 +-
 include/hw/display/edid.h                          |    2 -
 include/hw/display/ramfb.h                         |    2 +-
 include/hw/elf_ops.h                               |   15 +-
 include/hw/empty_slot.h                            |    9 -
 include/hw/gpio/nrf51_gpio.h                       |    2 +-
 include/hw/hyperv/hyperv.h                         |    1 +
 include/hw/hyperv/vmbus-bridge.h                   |   35 +
 include/hw/hyperv/vmbus-proto.h                    |  222 +
 include/hw/hyperv/vmbus.h                          |  230 +
 include/hw/i2c/arm_sbcon_i2c.h                     |   35 +
 include/hw/i2c/microbit_i2c.h                      |    2 +-
 include/hw/i386/microvm.h                          |    2 +-
 include/hw/i386/pc.h                               |   19 +-
 include/hw/i386/vmport.h                           |   28 +
 include/hw/i386/x86.h                              |    4 -
 include/hw/ide/internal.h                          |   12 +-
 include/hw/intc/ibex_plic.h                        |   63 +
 include/hw/intc/rx_icu.h                           |   76 +
 include/hw/isa/isa.h                               |    7 +-
 include/hw/mem/nvdimm.h                            |    4 +
 include/hw/misc/aspeed_scu.h                       |    1 +
 include/hw/misc/auxbus.h                           |   18 +-
 include/hw/misc/bcm2835_mphi.h                     |   44 +
 include/hw/misc/empty_slot.h                       |   19 +
 include/hw/misc/imx2_wdt.h                         |   33 -
 include/hw/misc/unimp.h                            |    5 +-
 include/hw/net/cadence_gem.h                       |    6 +
 include/hw/net/msf2-emac.h                         |   53 +
 include/hw/net/ne2000-isa.h                        |    5 +-
 include/hw/pci/pci.h                               |    6 +-
 include/hw/ppc/pnv_psi.h                           |    2 +-
 include/hw/ppc/spapr.h                             |   11 +-
 include/hw/qdev-clock.h                            |  159 +
 include/hw/qdev-core.h                             |   31 +-
 include/hw/qdev-properties.h                       |   23 +-
 include/hw/register.h                              |    8 +
 include/hw/registerfields.h                        |   40 +-
 include/hw/riscv/boot.h                            |    7 +-
 include/hw/riscv/opentitan.h                       |   84 +
 include/hw/riscv/sifive_e.h                        |    7 +-
 include/hw/riscv/sifive_gpio.h                     |    8 +-
 include/hw/riscv/sifive_u.h                        |   32 +-
 include/hw/riscv/spike.h                           |    6 +-
 include/hw/rtc/mc146818rtc.h                       |    1 +
 include/hw/rx/rx62n.h                              |   76 +
 include/hw/s390x/css.h                             |    4 +-
 include/hw/s390x/pv.h                              |   58 +
 include/hw/s390x/s390-ccw.h                        |    3 +-
 include/hw/s390x/s390-virtio-ccw.h                 |    1 +
 include/hw/s390x/sclp.h                            |    2 +
 include/hw/scsi/scsi.h                             |    2 +-
 include/hw/sd/sdhci.h                              |    5 +
 include/hw/sh4/sh.h                                |   12 +-
 include/hw/ssi/ssi.h                               |    5 -
 include/hw/stream.h                                |    5 +-
 include/hw/sysbus.h                                |   19 +-
 include/hw/timer/cmsdk-apb-timer.h                 |    4 +-
 include/hw/timer/i8254.h                           |    9 +-
 include/hw/timer/nrf51_timer.h                     |    1 +
 include/hw/timer/renesas_cmt.h                     |   40 +
 include/hw/timer/renesas_tmr.h                     |   55 +
 include/hw/timer/tmu012.h                          |   23 +
 include/hw/usb.h                                   |   38 +-
 include/hw/usb/dwc2-regs.h                         |  899 ++++
 include/hw/usb/hcd-musb.h                          |   47 +
 include/hw/virtio/vhost-user-vsock.h               |   36 +
 include/hw/virtio/vhost-user.h                     |    1 +
 include/hw/virtio/vhost-vsock-common.h             |   47 +
 include/hw/virtio/vhost-vsock.h                    |   11 +-
 include/hw/virtio/virtio-balloon.h                 |    3 +-
 include/hw/virtio/virtio-blk.h                     |    1 +
 include/hw/virtio/virtio-net.h                     |   16 +
 include/hw/watchdog/wdt_imx2.h                     |   90 +
 include/hw/xen/xen-block.h                         |    2 +-
 include/hw/xen/xen-bus.h                           |    2 +-
 include/hw/xen/xen.h                               |   11 -
 include/io/task.h                                  |    2 -
 include/migration/vmstate.h                        |   11 +-
 include/monitor/hmp.h                              |    1 +
 include/qapi/qmp/qdict.h                           |    3 -
 include/qapi/qmp/qlist.h                           |   10 +-
 include/qapi/visitor-impl.h                        |    9 +-
 include/qapi/visitor.h                             |  192 +-
 include/qemu/lockable.h                            |    7 +-
 include/qemu/osdep.h                               |    2 +-
 include/qemu/plugin.h                              |   65 +-
 include/qemu/qemu-plugin.h                         |    3 +-
 include/qemu/rcu.h                                 |    2 +-
 include/qemu/thread.h                              |   40 +-
 include/qemu/tsan.h                                |   71 +
 include/qemu/typedefs.h                            |    3 +-
 include/qemu/uuid.h                                |   27 +
 include/qom/object.h                               |  195 +-
 include/qom/object_interfaces.h                    |   16 +
 include/qom/qom-qobject.h                          |    2 -
 include/standard-headers/asm-x86/kvm_para.h        |   17 +-
 include/standard-headers/drm/drm_fourcc.h          |  140 +-
 include/standard-headers/linux/ethtool.h           |   26 +-
 include/standard-headers/linux/input-event-codes.h |    5 +-
 include/standard-headers/linux/pci_regs.h          |    2 +
 include/standard-headers/linux/vhost_types.h       |    8 +
 include/standard-headers/linux/virtio_balloon.h    |   12 +-
 include/standard-headers/linux/virtio_ids.h        |    2 +
 include/standard-headers/linux/virtio_mem.h        |  211 +
 include/standard-headers/linux/virtio_net.h        |  102 +-
 include/standard-headers/linux/virtio_ring.h       |   48 +-
 include/sysemu/accel.h                             |    2 +
 include/sysemu/block-backend.h                     |    6 +-
 include/sysemu/blockdev.h                          |    2 +
 include/sysemu/device_tree.h                       |    5 +-
 include/sysemu/hvf.h                               |   72 +-
 include/sysemu/kvm.h                               |    7 +-
 include/sysemu/kvm_int.h                           |   12 +
 include/sysemu/sysemu.h                            |    5 +-
 include/sysemu/tcg.h                               |    2 +-
 include/sysemu/tpm.h                               |    2 +
 include/sysemu/tpm_util.h                          |   72 +
 include/sysemu/xen.h                               |   38 +
 include/tcg/tcg-op-gvec.h                          |   25 +-
 include/tcg/tcg-op.h                               |   13 +-
 include/tcg/tcg-opc.h                              |    4 +
 include/tcg/tcg.h                                  |    4 +
 include/ui/win32-kbd-hook.h                        |   14 +
 io/task.c                                          |    1 +
 iothread.c                                         |    6 +-
 linux-headers/COPYING                              |    2 +
 linux-headers/asm-arm64/mman.h                     |    8 +
 linux-headers/asm-generic/unistd.h                 |    4 +-
 linux-headers/asm-mips/unistd_n32.h                |    1 +
 linux-headers/asm-mips/unistd_n64.h                |    1 +
 linux-headers/asm-mips/unistd_o32.h                |    1 +
 linux-headers/asm-powerpc/unistd_32.h              |    1 +
 linux-headers/asm-powerpc/unistd_64.h              |    1 +
 linux-headers/asm-s390/unistd_32.h                 |    1 +
 linux-headers/asm-s390/unistd_64.h                 |    1 +
 linux-headers/asm-x86/kvm.h                        |   21 +-
 linux-headers/asm-x86/unistd.h                     |   11 +-
 linux-headers/asm-x86/unistd_32.h                  |    2 +
 linux-headers/asm-x86/unistd_64.h                  |    2 +
 linux-headers/asm-x86/unistd_x32.h                 |    2 +
 linux-headers/linux/kvm.h                          |   65 +-
 linux-headers/linux/mman.h                         |    5 +-
 linux-headers/linux/psp-sev.h                      |    2 +
 linux-headers/linux/userfaultfd.h                  |   40 +-
 linux-headers/linux/vfio.h                         |  359 ++
 linux-headers/linux/vfio_ccw.h                     |   19 +
 linux-headers/linux/vhost.h                        |   28 +
 linux-user/arm/cpu_loop.c                          |  145 +-
 linux-user/arm/signal.c                            |   15 +-
 linux-user/elfload.c                               |  548 ++-
 linux-user/flatload.c                              |    6 +
 linux-user/generic/fcntl.h                         |    4 +
 linux-user/main.c                                  |   39 +-
 linux-user/mmap.c                                  |    4 +-
 linux-user/ppc/cpu_loop.c                          |    1 +
 linux-user/qemu.h                                  |   31 +-
 linux-user/riscv/signal.c                          |    3 +-
 linux-user/strace.list                             |    4 +-
 linux-user/syscall.c                               |   52 +-
 memory.c                                           |  101 +-
 migration/block-dirty-bitmap.c                     |  130 +-
 migration/colo.c                                   |   40 +-
 migration/migration.c                              |   53 +-
 migration/migration.h                              |    4 +-
 migration/multifd.c                                |   19 +-
 migration/ram.c                                    |   84 +-
 migration/ram.h                                    |    1 +
 migration/rdma.c                                   |   11 +-
 migration/savevm.c                                 |    2 +-
 monitor/hmp-cmds.c                                 |   59 +-
 monitor/misc.c                                     |   10 +-
 monitor/monitor-internal.h                         |    2 +-
 monitor/qmp.c                                      |    5 +-
 nbd/server.c                                       |   23 +-
 net/can/can_host.c                                 |    3 +-
 net/can/can_socketcan.c                            |    3 +-
 net/colo-compare.c                                 |  297 +-
 net/colo.c                                         |    7 +
 net/colo.h                                         |    1 +
 net/dump.c                                         |    4 +-
 net/filter-buffer.c                                |    2 +-
 net/filter-mirror.c                                |   10 +-
 net/filter-rewriter.c                              |    2 +-
 net/filter.c                                       |   15 +-
 net/net.c                                          |   91 +-
 net/tap.c                                          |    3 +-
 net/trace-events                                   |    1 +
 pc-bios/openbios-ppc                               |  Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32                           |  Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64                           |  Bin 1593408 -> 1593408 bytes
 pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin       |  Bin 49472 -> 49520 bytes
 pc-bios/opensbi-riscv32-virt-fw_jump.bin           |  Bin 41280 -> 49504 bytes
 pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin       |  Bin 53760 -> 57936 bytes
 pc-bios/opensbi-riscv64-virt-fw_jump.bin           |  Bin 49664 -> 57920 bytes
 plugins/api.c                                      |    4 +-
 po/sv.po                                           |   75 +
 python/qemu/.flake8                                |    2 +
 python/qemu/accel.py                               |    9 +-
 python/qemu/machine.py                             |   44 +-
 python/qemu/pylintrc                               |   58 +
 python/qemu/qmp.py                                 |   29 +-
 python/qemu/qtest.py                               |   83 +-
 qapi/audio.json                                    |   56 +-
 qapi/block-core.json                               |   39 +-
 qapi/migration.json                                |   53 +-
 qapi/misc.json                                     |    6 +-
 qapi/net.json                                      |   49 -
 qapi/qapi-dealloc-visitor.c                        |    7 -
 qapi/qapi-visit-core.c                             |   20 +-
 qapi/qobject-input-visitor.c                       |   21 +-
 qapi/sockets.json                                  |    8 +-
 qdev-monitor.c                                     |   21 +-
 qemu-img-cmds.hx                                   |   17 +-
 qemu-img.c                                         |  467 +-
 qemu-io-cmds.c                                     |    2 +-
 qemu-nbd.c                                         |   13 +-
 qemu-options.hx                                    |   22 +-
 qemu-storage-daemon.c                              |    4 +-
 qobject/qdict.c                                    |   19 -
 qobject/qjson.c                                    |  107 +-
 qobject/qlist.c                                    |   44 +-
 qom/container.c                                    |    5 +-
 qom/object.c                                       |  584 +--
 qom/object_interfaces.c                            |   39 +-
 qom/qom-hmp-cmds.c                                 |   67 +-
 qom/qom-qmp-cmds.c                                 |   24 +-
 replay/replay-internal.c                           |   15 +-
 replay/replay.c                                    |    5 +
 roms/openbios                                      |    2 +-
 roms/opensbi                                       |    2 +-
 scripts/analyze-migration.py                       |    5 -
 scripts/checkpatch.pl                              |   33 +-
 scripts/clean-includes                             |    1 +
 scripts/coverity-scan/coverity-scan.docker         |    5 +-
 scripts/coverity-scan/run-coverity-scan            |  139 +-
 scripts/decodetree.py                              |  536 ++-
 scripts/kvm/vmxcap                                 |    7 +-
 scripts/modules/module_block.py                    |   29 +-
 scripts/oss-fuzz/build.sh                          |  105 +
 scripts/qapi/commands.py                           |   60 +-
 scripts/qapi/visit.py                              |    8 +
 scripts/qemu-gdb.py                                |    4 +-
 scripts/qemugdb/__init__.py                        |    3 +-
 scripts/qemugdb/aio.py                             |    3 +-
 scripts/qemugdb/coroutine.py                       |    3 +-
 scripts/qemugdb/mtree.py                           |    4 +-
 scripts/qemugdb/tcg.py                             |    1 -
 scripts/qemugdb/timers.py                          |    1 -
 scripts/qmp/qmp                                    |    4 +-
 scripts/qmp/qmp-shell                              |    3 -
 scripts/qmp/qom-fuse                               |    4 +-
 scripts/qmp/qom-get                                |    6 +-
 scripts/qmp/qom-list                               |    6 +-
 scripts/qmp/qom-set                                |    6 +-
 scripts/qmp/qom-tree                               |    6 +-
 scripts/tracetool.py                               |    2 +-
 scripts/tracetool/__init__.py                      |    2 +-
 scripts/tracetool/backend/__init__.py              |    2 +-
 scripts/tracetool/backend/dtrace.py                |    2 +-
 scripts/tracetool/backend/log.py                   |    2 +-
 scripts/tracetool/backend/simple.py                |    2 +-
 scripts/tracetool/backend/ust.py                   |    2 +-
 scripts/tracetool/format/__init__.py               |    2 +-
 scripts/tracetool/format/c.py                      |    2 +-
 scripts/tracetool/format/d.py                      |    2 +-
 scripts/tracetool/format/h.py                      |    2 +-
 scripts/tracetool/format/stap.py                   |    2 +-
 scripts/tracetool/format/tcg_h.py                  |    2 +-
 scripts/tracetool/format/tcg_helper_c.py           |    2 +-
 scripts/tracetool/format/tcg_helper_h.py           |    2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py   |    2 +-
 scripts/tracetool/transform.py                     |    2 +-
 scripts/tracetool/vcpu.py                          |    2 +-
 scsi/pr-manager-helper.c                           |    3 +-
 scsi/qemu-pr-helper.c                              |    4 +-
 softmmu/vl.c                                       |   30 +-
 stubs/Makefile.objs                                |   52 +-
 stubs/cmos.c                                       |    7 +
 stubs/qmp_memory_device.c                          |    1 -
 stubs/ramfb.c                                      |    2 +-
 stubs/win32-kbd-hook.c                             |   18 +
 stubs/xen-common.c                                 |   13 -
 stubs/xen-hvm.c                                    |   62 -
 target/alpha/cpu-param.h                           |   15 +-
 target/arm/Makefile.objs                           |   19 +
 target/arm/cpu-param.h                             |    2 +-
 target/arm/cpu-qom.h                               |    9 +-
 target/arm/cpu.c                                   |  689 +--
 target/arm/cpu.h                                   |   56 +-
 target/arm/cpu64.c                                 |   56 +-
 target/arm/cpu_tcg.c                               |  665 +++
 target/arm/crypto_helper.c                         |  271 +-
 target/arm/gdbstub.c                               |   22 +-
 target/arm/helper-sve.h                            |   53 +-
 target/arm/helper.c                                |  234 +-
 target/arm/helper.h                                |  158 +-
 target/arm/internals.h                             |   10 +-
 target/arm/kvm.c                                   |   25 +-
 target/arm/kvm32.c                                 |   13 +-
 target/arm/kvm64.c                                 |  113 +-
 target/arm/kvm_arm.h                               |   21 +-
 target/arm/neon-dp.decode                          |  635 +++
 target/arm/neon-ls.decode                          |   52 +
 target/arm/neon-shared.decode                      |   66 +
 target/arm/neon_helper.c                           |   41 -
 target/arm/sve_helper.c                            | 2438 +++++-----
 target/arm/t32.decode                              |    4 +-
 target/arm/tlb_helper.c                            |    2 +-
 target/arm/translate-a64.c                         |  552 +--
 target/arm/translate-a64.h                         |   10 +-
 target/arm/translate-neon.inc.c                    | 4161 +++++++++++++++++
 target/arm/translate-sve.c                         |  103 +-
 target/arm/translate-vfp.inc.c                     |   13 +-
 target/arm/translate.c                             | 4912 +++++---------------
 target/arm/translate.h                             |  108 +-
 target/arm/vec_helper.c                            |  277 +-
 target/arm/vec_internal.h                          |   33 +
 target/arm/vfp_helper.c                            |   23 +-
 target/hppa/op_helper.c                            |    7 +-
 target/i386/TODO                                   |   31 -
 target/i386/cpu.c                                  |  174 +-
 target/i386/cpu.h                                  |   17 +-
 target/i386/fpu_helper.c                           |  266 +-
 target/i386/hax-all.c                              |   25 +-
 target/i386/hax-i386.h                             |    7 +-
 target/i386/hvf/hvf-i386.h                         |   37 +-
 target/i386/hvf/hvf.c                              |   30 +-
 target/i386/hvf/x86.c                              |    2 +-
 target/i386/hvf/x86.h                              |   89 +-
 target/i386/hvf/x86_decode.c                       |   25 +-
 target/i386/hvf/x86_emu.c                          |  122 +-
 target/i386/hvf/x86_flags.c                        |   81 +-
 target/i386/hvf/x86_task.c                         |   10 +-
 target/i386/hvf/x86hvf.c                           |    6 +-
 target/i386/kvm.c                                  |   70 +-
 target/i386/misc_helper.c                          |    2 +-
 target/i386/ops_sse.h                              |   65 +-
 target/i386/sev.c                                  |  274 +-
 target/i386/sev_i386.h                             |   49 -
 target/m68k/cpu.c                                  |   52 +-
 target/m68k/fpu_helper.c                           |   11 +-
 target/m68k/helper.c                               |    3 +-
 target/m68k/helper.h                               |    1 +
 target/m68k/softfloat.c                            |   70 +-
 target/m68k/translate.c                            |   17 +
 target/microblaze/cpu.c                            |   26 +-
 target/microblaze/cpu.h                            |    6 +
 target/microblaze/gdbstub.c                        |   91 +-
 target/microblaze/op_helper.c                      |    5 +-
 target/microblaze/translate.c                      |   27 +-
 target/mips/Makefile.objs                          |    2 +-
 target/mips/cpu-param.h                            |    5 +
 target/mips/cpu.h                                  |   32 +-
 target/mips/fpu_helper.c                           |  658 ++-
 target/mips/helper.h                               |   73 +-
 target/mips/internal.h                             |    3 +-
 target/mips/kvm.c                                  |  212 +
 target/mips/lmi_helper.c                           |  747 ---
 target/mips/lmmi_helper.c                          |  747 +++
 target/mips/machine.c                              |    6 +-
 target/mips/mips-defs.h                            |   51 +-
 target/mips/msa_helper.c                           | 1351 ++++--
 target/mips/translate.c                            |  215 +-
 target/mips/translate_init.inc.c                   |   95 +-
 target/openrisc/fpu_helper.c                       |    4 +-
 target/ppc/compat.c                                |   14 +-
 target/ppc/cpu.h                                   |   40 +-
 target/ppc/excp_helper.c                           |  152 +-
 target/ppc/gdbstub.c                               |    4 +-
 target/ppc/helper.h                                |    5 +-
 target/ppc/int_helper.c                            |   30 +-
 target/ppc/kvm_ppc.h                               |   22 +-
 target/ppc/mmu-radix64.c                           |  481 +-
 target/ppc/mmu-radix64.h                           |    4 +-
 target/ppc/mmu_helper.c                            |    2 +-
 target/ppc/translate.c                             |   77 +-
 target/ppc/translate/vmx-impl.inc.c                |   40 +-
 target/ppc/translate/vsx-impl.inc.c                |    2 +-
 target/ppc/translate_init.inc.c                    |   18 +-
 target/riscv/cpu.c                                 |   94 +-
 target/riscv/cpu.h                                 |   10 +-
 target/riscv/cpu_helper.c                          |  107 +-
 target/riscv/csr.c                                 |  138 +-
 target/riscv/helper.h                              |    5 +
 target/riscv/insn32.decode                         |    8 +-
 target/riscv/insn_trans/trans_privileged.inc.c     |   52 +-
 target/riscv/insn_trans/trans_rvf.inc.c            |   17 +-
 target/riscv/insn_trans/trans_rvh.inc.c            |   37 +
 target/riscv/monitor.c                             |    5 -
 target/riscv/op_helper.c                           |   30 +-
 target/riscv/pmp.c                                 |   14 +-
 target/riscv/translate.c                           |    1 +
 target/s390x/cpu.c                                 |   41 +-
 target/s390x/cpu.h                                 |    7 +-
 target/s390x/cpu_features_def.inc.h                |    3 +-
 target/s390x/cpu_models.c                          |   17 +-
 target/s390x/diag.c                                |   75 +-
 target/s390x/fpu_helper.c                          |   22 +-
 target/s390x/gen-features.c                        |    1 +
 target/s390x/helper.c                              |   11 +-
 target/s390x/helper.h                              |    4 -
 target/s390x/insn-data.def                         |    4 +-
 target/s390x/internal.h                            |   16 +-
 target/s390x/ioinst.c                              |   99 +-
 target/s390x/kvm-stub.c                            |    5 +
 target/s390x/kvm.c                                 |   83 +-
 target/s390x/kvm_s390x.h                           |    3 +
 target/s390x/mmu_helper.c                          |   14 +
 target/s390x/translate_vx.inc.c                    |  107 +-
 target/s390x/vec_fpu_helper.c                      |    2 +-
 target/s390x/vec_int_helper.c                      |   31 -
 target/sparc/fop_helper.c                          |    4 +-
 target/sparc/int32_helper.c                        |   23 +-
 target/tricore/Makefile.objs                       |    2 +-
 target/tricore/cpu.c                               |   18 +-
 target/tricore/cpu.h                               |    2 +
 target/tricore/gdbstub.c                           |  139 +
 target/tricore/helper.c                            |   13 +
 target/tricore/translate.c                         |   79 +-
 target/unicore32/helper.c                          |   70 +-
 target/unicore32/ucf64_helper.c                    |    6 +-
 target/xtensa/fpu_helper.c                         |    6 +-
 tcg/README                                         |    7 +-
 tcg/aarch64/tcg-target.h                           |    3 +
 tcg/aarch64/tcg-target.inc.c                       |   53 +-
 tcg/aarch64/tcg-target.opc.h                       |    1 +
 tcg/i386/tcg-target.h                              |    3 +
 tcg/i386/tcg-target.inc.c                          |  116 +-
 tcg/ppc/tcg-target.h                               |    3 +
 tcg/ppc/tcg-target.inc.c                           |   23 +-
 tcg/ppc/tcg-target.opc.h                           |    1 -
 tcg/tcg-op-gvec.c                                  |  376 +-
 tcg/tcg-op-vec.c                                   |   62 +-
 tcg/tcg-op.c                                       |   16 +-
 tcg/tcg.c                                          |   98 +-
 tests/Makefile.include                             |   76 +-
 tests/acceptance/avocado_qemu/__init__.py          |   13 +-
 tests/acceptance/boot_linux.py                     |   49 +-
 tests/acceptance/boot_linux_console.py             |   84 +-
 tests/acceptance/machine_arm_canona1100.py         |   35 +
 tests/acceptance/machine_rx_gdbsim.py              |   68 +
 tests/acceptance/migration.py                      |    4 +
 tests/acceptance/replay_kernel.py                  |  300 ++
 tests/benchmark-crypto-hash.c                      |   73 +-
 tests/check-qlist.c                                |   37 +-
 tests/check-qom-proplist.c                         |   70 +-
 tests/data/acpi/pc/DSDT                            |  Bin 5131 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat                   |  Bin 6455 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge                     |  Bin 6990 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp                       |  Bin 5594 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm                    |  Bin 6784 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs                    |  Bin 5203 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp                      |  Bin 6490 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem                    |  Bin 5137 -> 4940 bytes
 tests/data/acpi/pc/SRAT.dimmpxm                    |  Bin 392 -> 392 bytes
 tests/data/acpi/pc/SSDT.dimmpxm                    |  Bin 685 -> 734 bytes
 tests/data/acpi/pc/WAET                            |  Bin 0 -> 40 bytes
 tests/data/acpi/q35/DSDT                           |  Bin 7869 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat                  |  Bin 9193 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge                    |  Bin 7886 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp                      |  Bin 8332 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm                   |  Bin 9522 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt                    |  Bin 7944 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp                     |  Bin 9228 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64                    |  Bin 8999 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem                   |  Bin 7875 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis                       |  Bin 0 -> 8283 bytes
 tests/data/acpi/q35/SRAT.dimmpxm                   |  Bin 392 -> 392 bytes
 tests/data/acpi/q35/SSDT.dimmpxm                   |  Bin 685 -> 734 bytes
 tests/data/acpi/q35/TPM2.tis                       |  Bin 0 -> 76 bytes
 tests/data/acpi/q35/WAET                           |  Bin 0 -> 40 bytes
 tests/data/acpi/virt/DSDT.memhp                    |  Bin 6644 -> 6668 bytes
 tests/data/acpi/virt/NFIT.memhp                    |  Bin 0 -> 224 bytes
 tests/data/acpi/virt/SRAT.memhp                    |  Bin 186 -> 226 bytes
 tests/data/acpi/virt/SSDT.memhp                    |  Bin 0 -> 736 bytes
 tests/decode/err_pattern_group_nest1.decode        |   11 +-
 tests/decode/err_pattern_group_nest2.decode        |    6 +
 tests/decode/err_pattern_group_nest3.decode        |   14 +
 tests/decode/succ_pattern_group_nest2.decode       |   13 +
 tests/decode/succ_pattern_group_nest3.decode       |   11 +
 tests/decode/succ_pattern_group_nest4.decode       |   13 +
 tests/docker/Makefile.include                      |    8 +-
 tests/docker/docker.py                             |   19 +-
 tests/docker/dockerfiles/centos7.docker            |    2 -
 tests/docker/dockerfiles/centos8.docker            |    2 -
 .../dockerfiles/debian-arm64-test-cross.docker     |   13 +
 .../docker/dockerfiles/debian-xtensa-cross.docker  |    2 -
 tests/docker/dockerfiles/debian10.docker           |    2 -
 tests/docker/dockerfiles/debian11.docker           |   18 +
 tests/docker/dockerfiles/debian9.docker            |    2 -
 tests/docker/dockerfiles/fedora.docker             |    4 +-
 tests/docker/dockerfiles/ubuntu.docker             |    4 +-
 tests/docker/dockerfiles/ubuntu1804.docker         |    2 +-
 tests/docker/dockerfiles/ubuntu2004.docker         |   65 +
 tests/docker/test-tsan                             |   44 +
 tests/fp/fp-test.c                                 |    2 +-
 tests/guest-debug/run-test.py                      |   36 +-
 tests/migration/guestperf-batch.py                 |    2 +-
 tests/migration/guestperf-plot.py                  |    2 +-
 tests/migration/guestperf.py                       |    2 +-
 tests/migration/stress.c                           |   34 +-
 tests/plugin/Makefile                              |    3 +-
 tests/plugin/lockstep.c                            |  340 ++
 tests/plugin/mem.c                                 |    2 +-
 tests/qemu-iotests/001                             |    2 +-
 tests/qemu-iotests/030                             |   10 +-
 tests/qemu-iotests/031.out                         |   36 +-
 tests/qemu-iotests/036.out                         |    8 +-
 tests/qemu-iotests/041                             |   57 +-
 tests/qemu-iotests/041.out                         |    4 +-
 tests/qemu-iotests/049.out                         |  110 +-
 tests/qemu-iotests/052                             |    2 +-
 tests/qemu-iotests/055                             |  121 +-
 tests/qemu-iotests/055.out                         |    4 +-
 tests/qemu-iotests/059                             |    6 +-
 tests/qemu-iotests/060.out                         |    1 +
 tests/qemu-iotests/061                             |   35 +
 tests/qemu-iotests/061.out                         |   76 +-
 tests/qemu-iotests/065                             |   28 +-
 tests/qemu-iotests/080                             |    2 +-
 tests/qemu-iotests/082                             |    1 +
 tests/qemu-iotests/082.out                         |   48 +-
 tests/qemu-iotests/085.out                         |   38 +-
 tests/qemu-iotests/091                             |    2 +-
 tests/qemu-iotests/098.out                         |    8 +-
 tests/qemu-iotests/109                             |   11 +-
 tests/qemu-iotests/109.out                         |   74 +-
 tests/qemu-iotests/113                             |    4 +-
 tests/qemu-iotests/118                             |    7 +-
 tests/qemu-iotests/134                             |    2 +-
 tests/qemu-iotests/143                             |    4 +
 tests/qemu-iotests/143.out                         |    2 +
 tests/qemu-iotests/144.out                         |    4 +-
 tests/qemu-iotests/148                             |    1 +
 tests/qemu-iotests/149                             |    3 +-
 tests/qemu-iotests/153                             |    2 +-
 tests/qemu-iotests/153.out                         |   12 +-
 tests/qemu-iotests/155                             |    2 +-
 tests/qemu-iotests/172                             |   27 +-
 tests/qemu-iotests/172.out                         | 1154 +++--
 tests/qemu-iotests/178.out.qcow2                   |   18 +-
 tests/qemu-iotests/178.out.raw                     |    2 +-
 tests/qemu-iotests/182.out                         |    2 +-
 tests/qemu-iotests/185.out                         |    8 +-
 tests/qemu-iotests/188                             |    2 +-
 tests/qemu-iotests/190                             |   49 +-
 tests/qemu-iotests/190.out                         |   27 +-
 tests/qemu-iotests/194                             |   28 +-
 tests/qemu-iotests/194.out                         |   11 +
 tests/qemu-iotests/198.out                         |    2 +
 tests/qemu-iotests/202                             |    4 +-
 tests/qemu-iotests/203                             |    4 +-
 tests/qemu-iotests/206                             |    2 +-
 tests/qemu-iotests/206.out                         |    5 +
 tests/qemu-iotests/207                             |    6 +-
 tests/qemu-iotests/208                             |    2 +-
 tests/qemu-iotests/209                             |    2 +-
 tests/qemu-iotests/210                             |    6 +-
 tests/qemu-iotests/211                             |    6 +-
 tests/qemu-iotests/212                             |    6 +-
 tests/qemu-iotests/213                             |    6 +-
 tests/qemu-iotests/216                             |    4 +-
 tests/qemu-iotests/218                             |    2 +-
 tests/qemu-iotests/219                             |    2 +-
 tests/qemu-iotests/222                             |    7 +-
 tests/qemu-iotests/223                             |    6 +-
 tests/qemu-iotests/223.out                         |    3 +-
 tests/qemu-iotests/224                             |    4 +-
 tests/qemu-iotests/228                             |    6 +-
 tests/qemu-iotests/229                             |   21 +-
 tests/qemu-iotests/229.out                         |    6 +-
 tests/qemu-iotests/234                             |    4 +-
 tests/qemu-iotests/235                             |    4 +-
 tests/qemu-iotests/236                             |    2 +-
 tests/qemu-iotests/237                             |    2 +-
 tests/qemu-iotests/238                             |    2 +
 tests/qemu-iotests/242                             |    2 +-
 tests/qemu-iotests/242.out                         |    5 +
 tests/qemu-iotests/244                             |   10 +-
 tests/qemu-iotests/244.out                         |    9 +-
 tests/qemu-iotests/245                             |    1 +
 tests/qemu-iotests/245.out                         |   10 +-
 tests/qemu-iotests/246                             |    2 +-
 tests/qemu-iotests/248                             |    2 +-
 tests/qemu-iotests/254                             |    2 +-
 tests/qemu-iotests/255                             |    2 +-
 tests/qemu-iotests/255.out                         |    8 +-
 tests/qemu-iotests/256                             |    2 +-
 tests/qemu-iotests/258                             |   10 +-
 tests/qemu-iotests/260                             |    4 +-
 tests/qemu-iotests/262                             |    4 +-
 tests/qemu-iotests/264                             |    4 +-
 tests/qemu-iotests/274                             |  155 +
 tests/qemu-iotests/274.out                         |  271 ++
 tests/qemu-iotests/277                             |    2 +
 tests/qemu-iotests/280                             |    8 +-
 tests/qemu-iotests/280.out                         |    2 +-
 tests/qemu-iotests/283                             |   10 +-
 tests/qemu-iotests/283.out                         |    2 +-
 tests/qemu-iotests/287                             |  152 +
 tests/qemu-iotests/287.out                         |   67 +
 tests/qemu-iotests/291                             |  118 +
 tests/qemu-iotests/291.out                         |  113 +
 tests/qemu-iotests/292                             |   78 +
 tests/qemu-iotests/292.out                         |   24 +
 tests/qemu-iotests/297                             |   44 +
 tests/qemu-iotests/297.out                         |    3 +
 tests/qemu-iotests/check                           |    3 +
 tests/qemu-iotests/common.filter                   |    8 +-
 tests/qemu-iotests/common.rc                       |   37 +-
 tests/qemu-iotests/group                           |    5 +
 tests/qemu-iotests/iotests.py                      |  390 +-
 tests/qemu-iotests/nbd-fault-injector.py           |    5 +-
 tests/qemu-iotests/pylintrc                        |   26 +
 tests/qemu-iotests/qcow2.py                        |  220 +-
 tests/qemu-iotests/qcow2_format.py                 |  287 ++
 tests/qht-bench.c                                  |    3 +-
 tests/qtest/Makefile.include                       |    8 +-
 tests/qtest/arm-cpu-features.c                     |   38 +-
 tests/qtest/bios-tables-test-allowed-diff.h        |   18 +
 tests/qtest/bios-tables-test.c                     |   73 +-
 tests/qtest/e1000e-test.c                          |    2 +-
 tests/qtest/endianness-test.c                      |    2 +-
 tests/qtest/fuzz/Makefile.include                  |   27 +-
 tests/qtest/fuzz/fork_fuzz.ld                      |    5 +
 tests/qtest/fuzz/fuzz.c                            |   48 +-
 tests/qtest/fuzz/fuzz.h                            |    3 +
 tests/qtest/fuzz/i440fx_fuzz.c                     |   50 +-
 tests/qtest/fuzz/qos_fuzz.c                        |    2 +-
 tests/qtest/fuzz/qtest_wrappers.c                  |  252 +
 tests/qtest/fuzz/virtio_net_fuzz.c                 |    2 +
 tests/qtest/fuzz/virtio_scsi_fuzz.c                |    2 +
 tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c   |    2 +-
 tests/qtest/libqos/arm-imx25-pdk-machine.c         |    2 +-
 tests/qtest/libqos/arm-n800-machine.c              |    2 +-
 tests/qtest/libqos/arm-raspi2-machine.c            |    2 +-
 tests/qtest/libqos/arm-sabrelite-machine.c         |    2 +-
 tests/qtest/libqos/arm-smdkc210-machine.c          |    2 +-
 tests/qtest/libqos/arm-virt-machine.c              |    2 +-
 tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c    |    2 +-
 tests/qtest/libqos/e1000e.c                        |    2 +-
 tests/qtest/libqos/e1000e.h                        |    2 +-
 tests/qtest/libqos/ppc64_pseries-machine.c         |    2 +-
 tests/qtest/libqos/qgraph.c                        |    2 +-
 tests/qtest/libqos/qgraph.h                        |    2 +-
 tests/qtest/libqos/qgraph_internal.h               |    2 +-
 tests/qtest/libqos/qos_external.c                  |    2 +-
 tests/qtest/libqos/qos_external.h                  |    2 +-
 tests/qtest/libqos/sdhci.c                         |    2 +-
 tests/qtest/libqos/sdhci.h                         |    2 +-
 tests/qtest/libqos/virtio-9p.c                     |    2 +-
 tests/qtest/libqos/virtio-9p.h                     |    2 +-
 tests/qtest/libqos/virtio-balloon.c                |    2 +-
 tests/qtest/libqos/virtio-balloon.h                |    2 +-
 tests/qtest/libqos/virtio-blk.c                    |    2 +-
 tests/qtest/libqos/virtio-blk.h                    |    2 +-
 tests/qtest/libqos/virtio-net.c                    |    2 +-
 tests/qtest/libqos/virtio-net.h                    |    2 +-
 tests/qtest/libqos/virtio-rng.c                    |    2 +-
 tests/qtest/libqos/virtio-rng.h                    |    2 +-
 tests/qtest/libqos/virtio-scsi.c                   |    2 +-
 tests/qtest/libqos/virtio-scsi.h                   |    2 +-
 tests/qtest/libqos/virtio-serial.c                 |    2 +-
 tests/qtest/libqos/virtio-serial.h                 |    2 +-
 tests/qtest/libqos/x86_64_pc-machine.c             |    2 +-
 tests/qtest/machine-none-test.c                    |   14 +-
 tests/qtest/migration-test.c                       |    4 +-
 tests/qtest/qos-test.c                             |    2 +-
 tests/qtest/test-hmp.c                             |    1 +
 tests/qtest/tpm-emu.c                              |    3 +-
 tests/qtest/tpm-emu.h                              |    3 +
 tests/tcg/Makefile.target                          |   12 +-
 tests/tcg/aarch64/Makefile.softmmu-target          |    2 +-
 tests/tcg/aarch64/Makefile.target                  |   10 +-
 tests/tcg/aarch64/gdbstub/test-sve-ioctl.py        |    4 -
 tests/tcg/aarch64/gdbstub/test-sve.py              |    4 -
 tests/tcg/arm/Makefile.target                      |    4 +-
 tests/tcg/arm/commpage.c                           |   61 +
 tests/tcg/configure.sh                             |    4 +-
 tests/tcg/cris/Makefile.target                     |    1 +
 tests/tcg/i386/Makefile.target                     |    4 +
 tests/tcg/i386/test-i386-fbstp.c                   |  140 +
 tests/tcg/i386/test-i386-fisttp.c                  |  100 +
 tests/tcg/i386/test-i386-fldcst.c                  |  199 +
 tests/tcg/i386/test-i386-fp-exceptions.c           |  831 ++++
 tests/tcg/i386/test-i386-fscale.c                  |  108 +
 tests/tcg/i386/test-i386-fxam.c                    |  143 +
 tests/tcg/i386/test-i386-fxtract.c                 |  120 +
 tests/tcg/i386/test-i386-pcmpistri.c               |   33 +
 tests/tcg/i386/test-i386-pseudo-denormal.c         |   38 +
 tests/tcg/i386/test-i386-snan-convert.c            |   63 +
 tests/tcg/multiarch/Makefile.target                |   16 +
 tests/tcg/multiarch/gdbstub/sha1.py                |   85 +
 tests/tcg/multiarch/threadcount.c                  |   64 +
 tests/test-bdrv-drain.c                            |   72 +-
 tests/test-bdrv-graph-mod.c                        |   10 +-
 tests/test-block-iothread.c                        |   26 +-
 tests/test-crypto-secret.c                         |  158 +
 tests/test-io-task.c                               |    1 +
 tests/test-qdev-global-props.c                     |   13 +-
 tests/test-qobject-output-visitor.c                |   39 -
 tests/test-string-output-visitor.c                 |   19 -
 tests/test-util-sockets.c                          |   92 +
 tests/tsan/blacklist.tsan                          |   10 +
 tests/tsan/suppressions.tsan                       |   14 +
 tests/vm/Makefile.include                          |    6 +
 tests/vm/basevm.py                                 |   54 +-
 tests/vm/fedora                                    |    1 -
 tests/vm/freebsd                                   |    1 -
 tests/vm/netbsd                                    |    1 -
 tests/vm/openbsd                                   |    1 -
 tests/vm/ubuntu.i386                               |    2 +-
 tools/virtiofsd/fuse_lowlevel.h                    |    1 +
 tools/virtiofsd/helper.c                           |   47 +
 tools/virtiofsd/passthrough_ll.c                   |  277 +-
 tools/virtiofsd/seccomp.c                          |    1 +
 trace/simple.c                                     |   20 +-
 trace/simple.h                                     |    2 +-
 ui/Makefile.objs                                   |    3 +
 ui/console.c                                       |    7 +-
 ui/gtk.c                                           |  197 +-
 ui/input-barrier.c                                 |   14 +-
 ui/input-linux.c                                   |    8 +-
 ui/sdl2-input.c                                    |    3 +
 ui/sdl2.c                                          |   45 +-
 ui/spice-display.c                                 |   14 +-
 ui/trace-events                                    |    3 +
 ui/vnc.c                                           |    2 +-
 ui/win32-kbd-hook.c                                |  102 +
 util/Makefile.objs                                 |   59 +-
 util/aio-posix.c                                   |   13 +
 util/aio-win32.c                                   |    4 +
 util/async.c                                       |    1 +
 util/coroutine-ucontext.c                          |   66 +-
 util/fdmon-io_uring.c                              |   13 +-
 util/log.c                                         |    4 +-
 util/oslib-posix.c                                 |   24 +
 util/qemu-option.c                                 |   43 +-
 util/qemu-sockets.c                                |   44 +-
 util/qemu-thread-posix.c                           |    2 +
 util/qemu-timer.c                                  |   17 +-
 util/qht.c                                         |    1 +
 util/rcu.c                                         |    8 +-
 util/systemd.c                                     |    4 +-
 util/thread-pool.c                                 |    3 +-
 util/vfio-helpers.c                                |    5 +-
 1584 files changed, 65536 insertions(+), 30718 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 90645fede6..69342ae031 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -3,18 +3,18 @@ env:
 
 freebsd_12_task:
   freebsd_instance:
-    image: freebsd-12-0-release-amd64
+    image_family: freebsd-12-1
     cpu: 8
     memory: 8G
-  install_script: pkg install -y
-    bash bison curl cyrus-sasl git glib gmake gnutls gsed
+  install_script: ASSUME_ALWAYS_YES=yes pkg bootstrap -f ; pkg install -y
+    bash curl cyrus-sasl git glib gmake gnutls gsed
     nettle perl5 pixman pkgconf png usbredir
   script:
     - mkdir build
     - cd build
     - ../configure || { cat config.log; exit 1; }
     - gmake -j8
-    - gmake -j8 V=1 check
+    - gmake V=1 check
 
 macos_task:
   osx_instance:
@@ -26,7 +26,7 @@ macos_task:
     - cd build
     - ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
-    - gmake check -j$(sysctl -n hw.ncpu)
+    - gmake check
 
 macos_xcode_task:
   osx_instance:
@@ -39,4 +39,4 @@ macos_xcode_task:
     - cd build
     - ../configure --cc=clang || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
-    - gmake check -j$(sysctl -n hw.ncpu)
+    - gmake check
diff --git a/.gitignore b/.gitignore
index 0c5af83aa7..90acb4347d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,18 +34,18 @@
 /qapi/qapi-builtin-types.[ch]
 /qapi/qapi-builtin-visit.[ch]
 /qapi/qapi-commands-*.[ch]
-/qapi/qapi-commands.[ch]
-/qapi/qapi-emit-events.[ch]
+**/qapi/qapi-commands.[ch]
+**/qapi/qapi-emit-events.[ch]
 /qapi/qapi-events-*.[ch]
-/qapi/qapi-events.[ch]
-/qapi/qapi-init-commands.[ch]
-/qapi/qapi-introspect.[ch]
+**/qapi/qapi-events.[ch]
+**/qapi/qapi-init-commands.[ch]
+**/qapi/qapi-introspect.[ch]
 /qapi/qapi-types-*.[ch]
-/qapi/qapi-types.[ch]
+**/qapi/qapi-types.[ch]
 /qapi/qapi-visit-*.[ch]
 !/qapi/qapi-visit-core.c
-/qapi/qapi-visit.[ch]
-/qapi/qapi-doc.texi
+**/qapi/qapi-visit.[ch]
+**/qapi/qapi-doc.texi
 /qemu-edid
 /qemu-img
 /qemu-nbd
@@ -59,6 +59,7 @@
 /qemu-keymap
 /qemu-monitor.texi
 /qemu-monitor-info.texi
+/qemu-storage-daemon
 /qemu-version.h
 /qemu-version.h.tmp
 /module_block.h
diff --git a/.gitlab-ci-edk2.yml b/.gitlab-ci-edk2.yml
deleted file mode 100644
index 088ba4b43a..0000000000
--- a/.gitlab-ci-edk2.yml
+++ /dev/null
@@ -1,49 +0,0 @@
-docker-edk2:
- stage: build
- rules: # Only run this job when the Dockerfile is modified
- - changes:
-   - .gitlab-ci-edk2.yml
-   - .gitlab-ci.d/edk2/Dockerfile
-   when: always
- image: docker:19.03.1
- services:
- - docker:19.03.1-dind
- variables:
-  GIT_DEPTH: 3
-  IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
-  # We don't use TLS
-  DOCKER_HOST: tcp://docker:2375
-  DOCKER_TLS_CERTDIR: ""
- before_script:
- - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- script:
- - docker pull $IMAGE_TAG || true
- - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-                                        --tag $IMAGE_TAG .gitlab-ci.d/edk2
- - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- - docker push $IMAGE_TAG
-
-build-edk2:
- rules: # Only run this job when ...
- - changes: # ... roms/edk2/ is modified (submodule updated)
-   - roms/edk2/*
-   when: always
- - if: '$CI_COMMIT_REF_NAME =~ /^edk2/' # or the branch/tag starts with 'edk2'
-   when: always
- - if: '$CI_COMMIT_MESSAGE =~ /edk2/i' # or last commit description contains 'EDK2'
-   when: always
- artifacts:
-   paths: # 'artifacts.zip' will contains the following files:
-   - pc-bios/edk2*bz2
-   - pc-bios/edk2-licenses.txt
-   - edk2-stdout.log
-   - edk2-stderr.log
- image: $CI_REGISTRY_IMAGE:edk2-cross-build
- variables:
-   GIT_DEPTH: 3
- script: # Clone the required submodules and build EDK2
- - git submodule update --init roms/edk2
- - git -C roms/edk2 submodule update --init
- - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
- - echo "=== Using ${JOBS} simultaneous jobs ==="
- - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
diff --git a/.gitlab-ci-opensbi.yml b/.gitlab-ci-opensbi.yml
deleted file mode 100644
index dd051c0124..0000000000
--- a/.gitlab-ci-opensbi.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-docker-opensbi:
- stage: build
- rules: # Only run this job when the Dockerfile is modified
- - changes:
-   - .gitlab-ci-opensbi.yml
-   - .gitlab-ci.d/opensbi/Dockerfile
-   when: always
- image: docker:19.03.1
- services:
- - docker:19.03.1-dind
- variables:
-  GIT_DEPTH: 3
-  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
-  # We don't use TLS
-  DOCKER_HOST: tcp://docker:2375
-  DOCKER_TLS_CERTDIR: ""
- before_script:
- - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- script:
- - docker pull $IMAGE_TAG || true
- - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
- - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- - docker push $IMAGE_TAG
-
-build-opensbi:
- rules: # Only run this job when ...
- - changes: # ... roms/opensbi/ is modified (submodule updated)
-   - roms/opensbi/*
-   when: always
- - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
-   when: always
- - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
-   when: always
- artifacts:
-   paths: # 'artifacts.zip' will contains the following files:
-   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
-   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
-   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
-   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
-   - opensbi32-virt-stdout.log
-   - opensbi32-virt-stderr.log
-   - opensbi64-virt-stdout.log
-   - opensbi64-virt-stderr.log
-   - opensbi32-sifive_u-stdout.log
-   - opensbi32-sifive_u-stderr.log
-   - opensbi64-sifive_u-stdout.log
-   - opensbi64-sifive_u-stderr.log
- image: $CI_REGISTRY_IMAGE:opensbi-cross-build
- variables:
-   GIT_DEPTH: 3
- script: # Clone the required submodules and build OpenSBI
- - git submodule update --init roms/opensbi
- - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
- - echo "=== Using ${JOBS} simultaneous jobs ==="
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
- - make -j${JOBS} -C roms/opensbi clean
- - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2
diff --git a/.gitlab-ci.d/edk2.yml b/.gitlab-ci.d/edk2.yml
new file mode 100644
index 0000000000..088ba4b43a
--- /dev/null
+++ b/.gitlab-ci.d/edk2.yml
@@ -0,0 +1,49 @@
+docker-edk2:
+ stage: build
+ rules: # Only run this job when the Dockerfile is modified
+ - changes:
+   - .gitlab-ci-edk2.yml
+   - .gitlab-ci.d/edk2/Dockerfile
+   when: always
+ image: docker:19.03.1
+ services:
+ - docker:19.03.1-dind
+ variables:
+  GIT_DEPTH: 3
+  IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build
+  # We don't use TLS
+  DOCKER_HOST: tcp://docker:2375
+  DOCKER_TLS_CERTDIR: ""
+ before_script:
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ script:
+ - docker pull $IMAGE_TAG || true
+ - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+                                        --tag $IMAGE_TAG .gitlab-ci.d/edk2
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+ - docker push $IMAGE_TAG
+
+build-edk2:
+ rules: # Only run this job when ...
+ - changes: # ... roms/edk2/ is modified (submodule updated)
+   - roms/edk2/*
+   when: always
+ - if: '$CI_COMMIT_REF_NAME =~ /^edk2/' # or the branch/tag starts with 'edk2'
+   when: always
+ - if: '$CI_COMMIT_MESSAGE =~ /edk2/i' # or last commit description contains 'EDK2'
+   when: always
+ artifacts:
+   paths: # 'artifacts.zip' will contains the following files:
+   - pc-bios/edk2*bz2
+   - pc-bios/edk2-licenses.txt
+   - edk2-stdout.log
+   - edk2-stderr.log
+ image: $CI_REGISTRY_IMAGE:edk2-cross-build
+ variables:
+   GIT_DEPTH: 3
+ script: # Clone the required submodules and build EDK2
+ - git submodule update --init roms/edk2
+ - git -C roms/edk2 submodule update --init
+ - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
+ - echo "=== Using ${JOBS} simultaneous jobs ==="
+ - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
new file mode 100644
index 0000000000..dd051c0124
--- /dev/null
+++ b/.gitlab-ci.d/opensbi.yml
@@ -0,0 +1,63 @@
+docker-opensbi:
+ stage: build
+ rules: # Only run this job when the Dockerfile is modified
+ - changes:
+   - .gitlab-ci-opensbi.yml
+   - .gitlab-ci.d/opensbi/Dockerfile
+   when: always
+ image: docker:19.03.1
+ services:
+ - docker:19.03.1-dind
+ variables:
+  GIT_DEPTH: 3
+  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
+  # We don't use TLS
+  DOCKER_HOST: tcp://docker:2375
+  DOCKER_TLS_CERTDIR: ""
+ before_script:
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ script:
+ - docker pull $IMAGE_TAG || true
+ - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+ - docker push $IMAGE_TAG
+
+build-opensbi:
+ rules: # Only run this job when ...
+ - changes: # ... roms/opensbi/ is modified (submodule updated)
+   - roms/opensbi/*
+   when: always
+ - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
+   when: always
+ - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
+   when: always
+ artifacts:
+   paths: # 'artifacts.zip' will contains the following files:
+   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
+   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
+   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
+   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
+   - opensbi32-virt-stdout.log
+   - opensbi32-virt-stderr.log
+   - opensbi64-virt-stdout.log
+   - opensbi64-virt-stderr.log
+   - opensbi32-sifive_u-stdout.log
+   - opensbi32-sifive_u-stderr.log
+   - opensbi64-sifive_u-stdout.log
+   - opensbi64-sifive_u-stderr.log
+ image: $CI_REGISTRY_IMAGE:opensbi-cross-build
+ variables:
+   GIT_DEPTH: 3
+ script: # Clone the required submodules and build OpenSBI
+ - git submodule update --init roms/opensbi
+ - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
+ - echo "=== Using ${JOBS} simultaneous jobs ==="
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
+ - make -j${JOBS} -C roms/opensbi clean
+ - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b889fb96b6..349c77aa58 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,24 @@
 include:
-  - local: '/.gitlab-ci-edk2.yml'
-  - local: '/.gitlab-ci-opensbi.yml'
+  - local: '/.gitlab-ci.d/edk2.yml'
+  - local: '/.gitlab-ci.d/opensbi.yml'
 
-before_script:
- - apt-get update -qq
- - apt-get install -y -qq flex bison libglib2.0-dev libpixman-1-dev genisoimage
+.update_apt_template: &before_script_apt
+ before_script:
+  - apt-get update -qq
+  - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make
+        genisoimage
+  - JOBS=$(expr $(nproc) + 1)
+
+.update_dnf_template: &before_script_dnf
+ before_script:
+  - dnf update -y
+  - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel
+        make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel
+  - JOBS=$(expr $(nproc) + 1)
 
 build-system1:
+ image: ubuntu:19.10
+ <<: *before_script_apt
  script:
  - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev
       libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev
@@ -15,23 +27,27 @@ build-system1:
  - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu
       cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu
       mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-system2:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq libsdl2-dev libgcrypt-dev libbrlapi-dev libaio-dev
-      libfdt-dev liblzo2-dev librdmacm-dev libibverbs-dev libibumad-dev
-      libzstd-dev
+ - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel
+       libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel
+       libzstd-devel
  - mkdir build
  - cd build
  - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu
       microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu
       sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-disabled:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
  - mkdir build
  - cd build
@@ -42,16 +58,18 @@ build-disabled:
       --disable-qom-cast-debug --disable-spice --disable-vhost-vsock
       --disable-vhost-net --disable-vhost-crypto --disable-vhost-user
       --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user"
- - make -j2
- - make -j2 check-qtest SPEED=slow
+ - make -j"$JOBS"
+ - make -j"$JOBS" check-qtest SPEED=slow
 
 build-tcg-disabled:
+ image: centos:8
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq clang libgtk-3-dev libusb-dev
+ - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel
  - mkdir build
  - cd build
  - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
- - make -j2
+ - make -j"$JOBS"
  - make check-unit
  - make check-qapi-schema
  - cd tests/qemu-iotests/
@@ -64,34 +82,39 @@ build-tcg-disabled:
             260 261 262 263 264 270 272 273 277 279
 
 build-user:
+ <<: *before_script_apt
  script:
  - mkdir build
  - cd build
  - ../configure --enable-werror --disable-system --disable-guest-agent
                --disable-capstone --disable-slirp --disable-fdt
- - make -j2
+ - make -j"$JOBS"
  - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user
 
 build-clang:
+ image: fedora:latest
+ <<: *before_script_dnf
  script:
- - apt-get install -y -qq clang libsdl2-dev libattr1-dev libcap-ng-dev
-      xfslibs-dev libiscsi-dev libnfs-dev libseccomp-dev gnutls-dev librbd-dev
+ - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel
+       libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel
  - mkdir build
  - cd build
  - ../configure --cc=clang --cxx=clang++ --enable-werror
       --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
                      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
- - make -j2
- - make -j2 check
+ - make -j"$JOBS"
+ - make -j"$JOBS" check
 
 build-tci:
+ image: centos:8
+ <<: *before_script_dnf
  script:
  - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
  - mkdir build
  - cd build
  - ../configure --enable-tcg-interpreter
       --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
- - make -j2
+ - make -j"$JOBS"
  - make run-tcg-tests-x86_64-softmmu
  - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
  - for tg in $TARGETS ; do
diff --git a/.mailmap b/.mailmap
index 6412067bde..926cac6bb8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -42,14 +42,18 @@ Justin Terry (VM) <juterry@microsoft.com> Justin Terry (VM) via Qemu-devel <qemu
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@mips.com>
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgtec.com>
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
-Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com> <arikalo@wavecomp.com>
+Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <arikalo@wavecomp.com>
+Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <aleksandar.rikalo@rt-rk.com>
 Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
+Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
+Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
 James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
 Leif Lindholm <leif@nuviainc.com> <leif.lindholm@linaro.org>
 Paul Burton <pburton@wavecomp.com> <paul.burton@mips.com>
 Paul Burton <pburton@wavecomp.com> <paul.burton@imgtec.com>
 Paul Burton <pburton@wavecomp.com> <paul@archlinuxmips.org>
 Philippe Mathieu-Daudé <philmd@redhat.com> <f4bug@amsat.org>
+Stefan Brankovic <stefan.brankovic@syrmia.com> <stefan.brankovic@rt-rk.com.com>
 Yongbok Kim <yongbok.kim@mips.com> <yongbok.kim@imgtec.com>
 
 # Also list preferred name forms where people have changed their
diff --git a/.travis.yml b/.travis.yml
index 2fd63eceaa..74158f741b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,9 +9,8 @@ compiler:
 cache:
   # There is one cache per branch and compiler version.
   # characteristics of each job are used to identify the cache:
-  # - OS name (currently, linux, osx, or windows)
+  # - OS name (currently only linux)
   # - OS distribution (for Linux, xenial, trusty, or precise)
-  # - macOS image name (e.g., xcode7.2)
   # - Names and values of visible environment variables set in .travis.yml or Settings panel
   timeout: 1200
   ccache: true
@@ -113,6 +112,7 @@ script:
         $(exit $BUILD_RC);
     fi
 after_script:
+  - df -h
   - if command -v ccache ; then ccache --show-stats ; fi
 
 
@@ -205,14 +205,15 @@ jobs:
     # Test with Clang for compile portability (Travis uses clang-5.0)
     - name: "Clang (user)"
       env:
-        - CONFIG="--disable-system"
+        - CONFIG="--disable-system --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
       compiler: clang
 
 
     - name: "Clang (main-softmmu)"
       env:
-        - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} "
+        - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}
+                  --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
       compiler: clang
       before_script:
@@ -222,7 +223,8 @@ jobs:
 
     - name: "Clang (other-softmmu)"
       env:
-        - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+        - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
+                  --host-cc=clang --cxx=clang++"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
       compiler: clang
 
@@ -270,31 +272,6 @@ jobs:
         - TEST_CMD=""
 
 
-    # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
-
-    - name: "OSX Xcode 10.3"
-      env:
-        - BASE_CONFIG="--disable-docs --enable-tools"
-        - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
-      os: osx
-      osx_image: xcode10.3
-      compiler: clang
-      addons:
-        homebrew:
-          packages:
-            - ccache
-            - glib
-            - pixman
-            - gnu-sed
-            - python
-          update: true
-      before_script:
-        - brew link --overwrite python
-        - export PATH="/usr/local/opt/ccache/libexec:$PATH"
-        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
-        - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
-
-
     # Python builds
     - name: "GCC Python 3.5 (x86_64-softmmu)"
       env:
@@ -316,7 +293,7 @@ jobs:
     - name: "GCC check-acceptance"
       dist: bionic
       env:
-        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
+        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
         - TEST_CMD="make check-acceptance"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance"
       after_script:
@@ -452,6 +429,7 @@ jobs:
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
+        - UNRELIABLE=true
 
     - name: "[ppc64] GCC check-tcg"
       arch: ppc64le
@@ -483,7 +461,7 @@ jobs:
           - genisoimage
       env:
         - TEST_CMD="make check check-tcg V=1"
-        - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
+        - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
 
     - name: "[s390x] GCC check-tcg"
       arch: s390x
@@ -516,8 +494,8 @@ jobs:
       env:
         - TEST_CMD="make check check-tcg V=1"
         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
+        - UNRELIABLE=true
       script:
-        - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
         - |
           if [ "$BUILD_RC" -eq 0 ] ; then
@@ -527,9 +505,10 @@ jobs:
               $(exit $BUILD_RC);
           fi
 
-    - name: "[s390x] GCC check (KVM)"
+    - name: "[s390x] Clang (disable-tcg)"
       arch: s390x
       dist: bionic
+      compiler: clang
       addons:
         apt_packages:
           - libaio-dev
@@ -553,21 +532,11 @@ jobs:
           - libusb-1.0-0-dev
           - libvdeplug-dev
           - libvte-2.91-dev
-          # Tests dependencies
-          - genisoimage
       env:
         - TEST_CMD="make check-unit"
-        - CONFIG="--disable-containers --disable-tcg --enable-kvm --disable-tools"
-      script:
-        - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
-        - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
-        - |
-          if [ "$BUILD_RC" -eq 0 ] ; then
-              mv pc-bios/s390-ccw/*.img pc-bios/ ;
-              ${TEST_CMD} ;
-          else
-              $(exit $BUILD_RC);
-          fi
+        - CONFIG="--disable-containers --disable-tcg --enable-kvm
+                  --disable-tools --host-cc=clang --cxx=clang++"
+        - UNRELIABLE=true
 
     # Release builds
     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
@@ -589,3 +558,5 @@ jobs:
         - mkdir -p release-build && cd release-build
         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
         - make install
+  allow_failures:
+    - env: UNRELIABLE=true
diff --git a/MAINTAINERS b/MAINTAINERS
index 8cbc1fac2b..1b40446c73 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -85,6 +85,7 @@ Architecture support
 --------------------
 S390 general architecture support
 M: Cornelia Huck <cohuck@redhat.com>
+M: Thomas Huth <thuth@redhat.com>
 S: Supported
 F: default-configs/s390x-softmmu.mak
 F: gdb-xml/s390*.xml
@@ -115,6 +116,7 @@ M: Richard Henderson <rth@twiddle.net>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: cpus.c
+F: cpus-common.c
 F: exec.c
 F: accel/tcg/
 F: accel/stubs/tcg-stub.c
@@ -184,8 +186,8 @@ F: hw/net/*i82596*
 F: include/hw/net/lasi_82596.h
 
 LM32 TCG CPUs
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: target/lm32/
 F: disas/lm32.c
 F: hw/lm32/
@@ -212,7 +214,7 @@ F: disas/microblaze.c
 MIPS TCG CPUs
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: target/mips/
 F: default-configs/*mips*
@@ -294,7 +296,7 @@ F: tests/tcg/s390x/
 L: qemu-s390x@nongnu.org
 
 SH4 TCG CPUs
-M: Aurelien Jarno <aurelien@aurel32.net>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
 S: Odd Fixes
 F: target/sh4/
 F: hw/sh4/
@@ -396,6 +398,8 @@ F: target/s390x/machine.c
 F: target/s390x/sigp.c
 F: target/s390x/cpu_features*.[ch]
 F: target/s390x/cpu_models.[ch]
+F: hw/s390x/pv.c
+F: include/hw/s390x/pv.h
 F: hw/intc/s390_flic.c
 F: hw/intc/s390_flic_kvm.c
 F: include/hw/s390x/s390_flic.h
@@ -436,6 +440,7 @@ M: Paul Durrant <paul@xen.org>
 L: xen-devel@lists.xenproject.org
 S: Supported
 F: */xen*
+F: accel/xen/*
 F: hw/9pfs/xen-9p*
 F: hw/char/xen_console.c
 F: hw/display/xenfb.c
@@ -449,6 +454,7 @@ F: hw/i386/xen/
 F: hw/pci-host/xen_igd_pt.c
 F: include/hw/block/dataplane/xen*
 F: include/hw/xen/
+F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 
 Guest CPU Cores (HAXM)
@@ -605,6 +611,7 @@ S: Odd Fixes
 F: include/hw/arm/digic.h
 F: hw/*/digic*
 F: include/hw/*/digic*
+F: tests/acceptance/machine_arm_canona1100.py
 
 Goldfish RTC
 M: Anup Patel <anup.patel@wdc.com>
@@ -629,8 +636,10 @@ S: Odd Fixes
 F: hw/arm/fsl-imx25.c
 F: hw/arm/imx25_pdk.c
 F: hw/misc/imx25_ccm.c
+F: hw/watchdog/wdt_imx2.c
 F: include/hw/arm/fsl-imx25.h
 F: include/hw/misc/imx25_ccm.h
+F: include/hw/watchdog/wdt_imx2.h
 
 i.MX31 (kzm)
 M: Peter Chubb <peter.chubb@nicta.com.au>
@@ -697,12 +706,14 @@ F: hw/misc/armsse-cpuid.c
 F: include/hw/misc/armsse-cpuid.h
 F: hw/misc/armsse-mhu.c
 F: include/hw/misc/armsse-mhu.h
+F: docs/system/arm/mps2.rst
 
 Musca
 M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/musca.c
+F: docs/system/arm/musca.rst
 
 Musicpal
 M: Jan Kiszka <jan.kiszka@web.de>
@@ -824,12 +835,14 @@ M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/vexpress.c
+F: docs/system/arm/vexpress.rst
 
 Versatile PB
 M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/*/versatile*
+F: include/hw/i2c/arm_sbcon_i2c.h
 F: hw/misc/arm_sysctl.c
 F: docs/system/arm/versatile.rst
 
@@ -919,6 +932,8 @@ F: include/hw/arm/msf2-soc.h
 F: include/hw/misc/msf2-sysreg.h
 F: include/hw/timer/mss-timer.h
 F: include/hw/ssi/mss-spi.h
+F: hw/net/msf2-emac.c
+F: include/hw/net/msf2-emac.h
 
 Emcraft M2S-FG484
 M: Subbaraya Sundeep <sundeep.lkml@gmail.com>
@@ -973,13 +988,13 @@ F: pc-bios/hppa-firmware.img
 LM32 Machines
 -------------
 EVR32 and uclinux BSP
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: hw/lm32/lm32_boards.c
 
 milkymist
-M: Michael Walle <michael@walle.cc>
-S: Maintained
+R: Michael Walle <michael@walle.cc>
+S: Orphan
 F: hw/lm32/milkymist.c
 
 M68K Machines
@@ -1037,9 +1052,9 @@ MIPS Machines
 -------------
 Jazz
 M: Hervé Poussineau <hpoussin@reactos.org>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
-F: hw/mips/mips_jazz.c
+F: hw/mips/jazz.c
 F: hw/display/jazz_led.c
 F: hw/dma/rc4030.c
 
@@ -1050,7 +1065,7 @@ R: Aurelien Jarno <aurelien@aurel32.net>
 S: Maintained
 F: hw/isa/piix4.c
 F: hw/acpi/piix4.c
-F: hw/mips/mips_malta.c
+F: hw/mips/malta.c
 F: hw/mips/gt64xxx_pci.c
 F: include/hw/southbridge/piix.h
 F: tests/acceptance/linux_ssh_mips_malta.py
@@ -1058,30 +1073,32 @@ F: tests/acceptance/machine_mips_malta.py
 
 Mipssim
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Odd Fixes
-F: hw/mips/mips_mipssim.c
+F: hw/mips/mipssim.c
 F: hw/net/mipsnet.c
 
 R4000
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Obsolete
-F: hw/mips/mips_r4k.c
+F: hw/mips/r4k.c
 
-Fulong 2E
+Fuloong 2E
+M: Huacai Chen <chenhc@lemote.com>
 M: Philippe Mathieu-Daudé <f4bug@amsat.org>
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 S: Odd Fixes
-F: hw/mips/mips_fulong2e.c
+F: hw/mips/fuloong2e.c
 F: hw/isa/vt82c686.c
 F: hw/pci-host/bonito.c
 F: include/hw/isa/vt82c686.h
 
 Boston
 M: Paul Burton <pburton@wavecomp.com>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: hw/core/loader-fit.c
 F: hw/mips/boston.c
@@ -1202,7 +1219,9 @@ S: Maintained
 F: hw/ppc/pnv*
 F: hw/intc/pnv*
 F: hw/intc/xics_pnv.c
+F: hw/pci-host/pnv*
 F: include/hw/ppc/pnv*
+F: include/hw/pci-host/pnv*
 F: pc-bios/skiboot.lid
 F: tests/qtest/pnv*
 
@@ -1225,19 +1244,45 @@ F: pc-bios/canyonlands.dt[sb]
 F: pc-bios/u-boot-sam460ex-20100605.bin
 F: roms/u-boot-sam460ex
 
+RISC-V Machines
+---------------
+OpenTitan
+M: Alistair Francis <Alistair.Francis@wdc.com>
+L: qemu-riscv@nongnu.org
+S: Supported
+F: hw/riscv/opentitan.c
+F: hw/char/ibex_uart.c
+F: hw/intc/ibex_plic.c
+F: include/hw/riscv/opentitan.h
+F: include/hw/char/ibex_uart.h
+F: include/hw/intc/ibex_plic.h
+
+RX Machines
+-----------
+rx-gdbsim
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+S: Maintained
+F: docs/system/target-rx.rst
+F: hw/rx/rx-gdbsim.c
+F: tests/acceptance/machine_rx_gdbsim.py
+
 SH4 Machines
 ------------
 R2D
-M: Magnus Damm <magnus.damm@gmail.com>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
 S: Maintained
 F: hw/sh4/r2d.c
 F: hw/intc/sh_intc.c
-F: hw/timer/sh_timer.c
+F: include/hw/sh4/sh_intc.h
 
 Shix
-M: Magnus Damm <magnus.damm@gmail.com>
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
 S: Odd Fixes
 F: hw/sh4/shix.c
+F: hw/intc/sh_intc.c
+F: include/hw/sh4/sh_intc.h
 
 SPARC Machines
 --------------
@@ -1508,10 +1553,19 @@ F: hw/acpi/*
 F: hw/smbios/*
 F: hw/i386/acpi-build.[hc]
 F: hw/arm/virt-acpi-build.c
-F: tests/qtest/bios-tables-test.c
+F: tests/qtest/bios-tables-test*
 F: tests/qtest/acpi-utils.[hc]
 F: tests/data/acpi/
 
+ACPI/HEST/GHES
+R: Dongjiu Geng <gengdongjiu@huawei.com>
+R: Xiang Zheng <zhengxiang9@huawei.com>
+L: qemu-arm@nongnu.org
+S: Maintained
+F: hw/acpi/ghes.c
+F: include/hw/acpi/ghes.h
+F: docs/specs/acpi_hest_ghes.rst
+
 ppc4xx
 M: David Gibson <david@gibson.dropbear.id.au>
 L: qemu-ppc@nongnu.org
@@ -1653,7 +1707,7 @@ F: include/sysemu/balloon.h
 
 virtio-9p
 M: Greg Kurz <groug@kaod.org>
-R: Christian Schoenebeck <qemu_oss@crudebyte.com>
+M: Christian Schoenebeck <qemu_oss@crudebyte.com>
 S: Odd Fixes
 F: hw/9pfs/
 X: hw/9pfs/xen-9p*
@@ -1731,7 +1785,7 @@ F: hw/virtio/virtio-crypto-pci.c
 F: include/hw/virtio/virtio-crypto.h
 
 nvme
-M: Keith Busch <keith.busch@intel.com>
+M: Keith Busch <kbusch@kernel.org>
 L: qemu-block@nongnu.org
 S: Supported
 F: hw/block/nvme*
@@ -1832,6 +1886,13 @@ S: Maintained
 F: include/hw/misc/unimp.h
 F: hw/misc/unimp.c
 
+Empty slot
+M: Artyom Tarasenko <atar4qemu@gmail.com>
+R: Philippe Mathieu-Daudé <f4bug@amsat.org>
+S: Maintained
+F: include/hw/misc/empty_slot.h
+F: hw/misc/empty_slot.c
+
 Standard VGA
 M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
@@ -1916,6 +1977,26 @@ F: hw/*/*xive*
 F: include/hw/*/*xive*
 F: docs/*/*xive*
 
+Renesas peripherals
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+R: Magnus Damm <magnus.damm@gmail.com>
+S: Maintained
+F: hw/char/renesas_sci.c
+F: hw/char/sh_serial.c
+F: hw/timer/renesas_*.c
+F: hw/timer/sh_timer.c
+F: include/hw/char/renesas_sci.h
+F: include/hw/sh4/sh.h
+F: include/hw/timer/renesas_*.h
+
+Renesas RX peripherals
+M: Yoshinori Sato <ysato@users.sourceforge.jp>
+S: Maintained
+F: hw/intc/rx_icu.c
+F: hw/rx/
+F: include/hw/intc/rx_icu.h
+F: include/hw/rx/
+
 Subsystems
 ----------
 Audio
@@ -1997,19 +2078,21 @@ F: qapi/transaction.json
 T: git https://repo.or.cz/qemu/armbru.git block-next
 
 Dirty Bitmaps
-M: John Snow <jsnow@redhat.com>
-R: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
+M: Eric Blake <eblake@redhat.com>
+M: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
+R: John Snow <jsnow@redhat.com>
 L: qemu-block@nongnu.org
 S: Supported
 F: include/qemu/hbitmap.h
 F: include/block/dirty-bitmap.h
+F: block/monitor/bitmap-qmp-cmds.c
 F: block/dirty-bitmap.c
 F: block/qcow2-bitmap.c
 F: migration/block-dirty-bitmap.c
 F: util/hbitmap.c
 F: tests/test-hbitmap.c
 F: docs/interop/bitmaps.rst
-T: git https://github.com/jnsnow/qemu.git bitmaps
+T: git https://repo.or.cz/qemu/ericb.git bitmaps
 
 Character device backends
 M: Marc-André Lureau <marcandre.lureau@redhat.com>
@@ -2253,6 +2336,8 @@ R: Eduardo Habkost <ehabkost@redhat.com>
 S: Supported
 F: docs/qdev-device-use.txt
 F: hw/core/qdev*
+F: hw/core/bus.c
+F: hw/core/sysbus.c
 F: include/hw/qdev*
 F: include/monitor/qdev.h
 F: include/qom/
@@ -2287,6 +2372,7 @@ S: Maintained
 F: qtest.c
 F: accel/qtest.c
 F: tests/qtest/
+X: tests/qtest/bios-tables-test-allowed-diff.h
 
 Device Fuzzing
 M: Alexander Bulekov <alxndr@bu.edu>
@@ -2295,6 +2381,7 @@ R: Bandan Das <bsd@redhat.com>
 R: Stefan Hajnoczi <stefanha@redhat.com>
 S: Maintained
 F: tests/qtest/fuzz/
+F: scripts/oss-fuzz/
 
 Register API
 M: Alistair Francis <alistair@alistair23.me>
@@ -2311,6 +2398,12 @@ F: net/slirp.c
 F: include/net/slirp.h
 T: git https://people.debian.org/~sthibault/qemu.git slirp
 
+Streams
+M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
+S: Maintained
+F: hw/core/stream.c
+F: include/hw/stream.h
+
 Stubs
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
@@ -2338,7 +2431,7 @@ F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
 F: qapi/tpm.json
-F: backends/tpm.c
+F: backends/tpm/
 F: tests/qtest/*tpm*
 T: git https://github.com/stefanberger/qemu-tpm.git tpm-next
 
@@ -2477,6 +2570,7 @@ F: net/filter-replay.c
 F: include/sysemu/replay.h
 F: docs/replay.txt
 F: stubs/replay.c
+F: tests/acceptance/replay_kernel.py
 
 IOVA Tree
 M: Peter Xu <peterx@redhat.com>
@@ -2512,7 +2606,7 @@ F: roms/edk2
 F: roms/edk2-*
 F: tests/data/uefi-boot-images/
 F: tests/uefi-test-tools/
-F: .gitlab-ci-edk2.yml
+F: .gitlab-ci.d/edk2.yml
 F: .gitlab-ci.d/edk2/
 
 Usermode Emulation
@@ -2578,7 +2672,7 @@ F: disas/i386.c
 MIPS TCG target
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
-R: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
+R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: tcg/mips/
 
@@ -2871,6 +2965,9 @@ W: https://cirrus-ci.com/github/qemu/qemu
 
 GitLab Continuous Integration
 M: Thomas Huth <thuth@redhat.com>
+M: Philippe Mathieu-Daudé <philmd@redhat.com>
+M: Alex Bennée <alex.bennee@linaro.org>
+R: Wainer dos Santos Moschetta <wainersm@redhat.com>
 S: Maintained
 F: .gitlab-ci.yml
 
@@ -2881,6 +2978,14 @@ S: Maintained
 F: tests/tcg/Makefile
 F: tests/tcg/Makefile.include
 
+Acceptance (Integration) Testing with the Avocado framework
+W: https://trello.com/b/6Qi1pxVn/avocado-qemu
+R: Cleber Rosa <crosa@redhat.com>
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
+R: Wainer dos Santos Moschetta <wainersm@redhat.com>
+S: Odd Fixes
+F: tests/acceptance/
+
 Documentation
 -------------
 Build system architecture
diff --git a/Makefile b/Makefile
index 34275f57c9..a0092153af 100644
--- a/Makefile
+++ b/Makefile
@@ -336,16 +336,16 @@ $(call set-vpath, $(SRC_PATH))
 LIBS+=-lz $(LIBS_TOOLS)
 
 vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += vhost-user-gpu$(EXESUF)
 vhost-user-json-y += contrib/vhost-user-gpu/50-qemu-gpu.json
 endif
 
-ifeq ($(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyy)
+ifeq ($(CONFIG_SOFTMMU)$(CONFIG_LINUX)$(CONFIG_SECCOMP)$(CONFIG_LIBCAP_NG),yyyy)
 HELPERS-y += virtiofsd$(EXESUF)
 vhost-user-json-y += tools/virtiofsd/50-qemu-virtiofsd.json
 endif
@@ -418,7 +418,7 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
@@ -526,13 +526,14 @@ $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
 $(TARGET_DIRS_RULES):
 	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
 
-DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+# LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib=""
 DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
-DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+DTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt
 
 .PHONY: dtc/all
-dtc/all: .git-submodule-status dtc/libfdt dtc/tests
-	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
+dtc/all: .git-submodule-status dtc/libfdt
+	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
 
 dtc/%: .git-submodule-status
 	@mkdir -p $@
@@ -561,12 +562,6 @@ slirp/all: .git-submodule-status
 		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
 		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
 
-# Compatibility gunk to keep make working across the rename of targets
-# for recursion, to be removed some time after 4.1.
-subdir-dtc: dtc/all
-subdir-capstone: capstone/all
-subdir-slirp: slirp/all
-
 $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \
 	$(qom-obj-y)
 
@@ -820,7 +815,6 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	rm -Rf .sdk
-	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
@@ -1252,7 +1246,16 @@ endif
 	@$(if $(TARGET_DIRS), \
 		echo 'Architecture specific targets:'; \
 		$(foreach t, $(TARGET_DIRS), \
-		$(call print-help-run,$(t)/all,Build for $(t));) \
+		$(call print-help-run,$(t)/all,Build for $(t)); \
+		$(if $(CONFIG_FUZZ), \
+			$(if $(findstring softmmu,$(t)), \
+				$(call print-help-run,$(t)/fuzz,Build fuzzer for $(t)); \
+		))) \
+		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
 		echo '')
 	@$(if $(TOOLS), \
 		echo 'Tools targets:'; \
diff --git a/Makefile.objs b/Makefile.objs
index a7c967633a..98383972ee 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -13,9 +13,8 @@ chardev-obj-y = chardev/
 
 authz-obj-y = authz/
 
-block-obj-y = nbd/
+block-obj-y = block/ nbd/ scsi/
 block-obj-y += block.o blockjob.o job.o
-block-obj-y += block/ scsi/
 block-obj-y += qemu-io-cmds.o
 block-obj-$(CONFIG_REPLICATION) += replication.o
 
@@ -126,6 +125,7 @@ trace-events-subdirs =
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += backends
+trace-events-subdirs += backends/tpm
 trace-events-subdirs += crypto
 trace-events-subdirs += monitor
 ifeq ($(CONFIG_USER_ONLY),y)
@@ -151,6 +151,7 @@ trace-events-subdirs += hw/block/dataplane
 trace-events-subdirs += hw/char
 trace-events-subdirs += hw/dma
 trace-events-subdirs += hw/hppa
+trace-events-subdirs += hw/hyperv
 trace-events-subdirs += hw/i2c
 trace-events-subdirs += hw/i386
 trace-events-subdirs += hw/i386/xen
diff --git a/accel/Makefile.objs b/accel/Makefile.objs
index 17e5ac6061..ff72f0d030 100644
--- a/accel/Makefile.objs
+++ b/accel/Makefile.objs
@@ -2,4 +2,5 @@ common-obj-$(CONFIG_SOFTMMU) += accel.o
 obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o
 obj-$(CONFIG_KVM) += kvm/
 obj-$(CONFIG_TCG) += tcg/
+obj-$(CONFIG_XEN) += xen/
 obj-y += stubs/
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 439a4efe52..f24d7da783 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -44,6 +44,7 @@
 #include "qapi/visitor.h"
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-visit-common.h"
+#include "sysemu/reset.h"
 
 #include "hw/boards.h"
 
@@ -159,9 +160,59 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = {
 static NotifierList kvm_irqchip_change_notifiers =
     NOTIFIER_LIST_INITIALIZER(kvm_irqchip_change_notifiers);
 
+struct KVMResampleFd {
+    int gsi;
+    EventNotifier *resample_event;
+    QLIST_ENTRY(KVMResampleFd) node;
+};
+typedef struct KVMResampleFd KVMResampleFd;
+
+/*
+ * Only used with split irqchip where we need to do the resample fd
+ * kick for the kernel from userspace.
+ */
+static QLIST_HEAD(, KVMResampleFd) kvm_resample_fd_list =
+    QLIST_HEAD_INITIALIZER(kvm_resample_fd_list);
+
 #define kvm_slots_lock(kml)      qemu_mutex_lock(&(kml)->slots_lock)
 #define kvm_slots_unlock(kml)    qemu_mutex_unlock(&(kml)->slots_lock)
 
+static inline void kvm_resample_fd_remove(int gsi)
+{
+    KVMResampleFd *rfd;
+
+    QLIST_FOREACH(rfd, &kvm_resample_fd_list, node) {
+        if (rfd->gsi == gsi) {
+            QLIST_REMOVE(rfd, node);
+            g_free(rfd);
+            break;
+        }
+    }
+}
+
+static inline void kvm_resample_fd_insert(int gsi, EventNotifier *event)
+{
+    KVMResampleFd *rfd = g_new0(KVMResampleFd, 1);
+
+    rfd->gsi = gsi;
+    rfd->resample_event = event;
+
+    QLIST_INSERT_HEAD(&kvm_resample_fd_list, rfd, node);
+}
+
+void kvm_resample_fd_notify(int gsi)
+{
+    KVMResampleFd *rfd;
+
+    QLIST_FOREACH(rfd, &kvm_resample_fd_list, node) {
+        if (rfd->gsi == gsi) {
+            event_notifier_set(rfd->resample_event);
+            trace_kvm_resample_fd_notify(gsi);
+            return;
+        }
+    }
+}
+
 int kvm_get_max_memslots(void)
 {
     KVMState *s = KVM_STATE(current_accel());
@@ -883,6 +934,39 @@ int kvm_vm_check_extension(KVMState *s, unsigned int extension)
     return ret;
 }
 
+typedef struct HWPoisonPage {
+    ram_addr_t ram_addr;
+    QLIST_ENTRY(HWPoisonPage) list;
+} HWPoisonPage;
+
+static QLIST_HEAD(, HWPoisonPage) hwpoison_page_list =
+    QLIST_HEAD_INITIALIZER(hwpoison_page_list);
+
+static void kvm_unpoison_all(void *param)
+{
+    HWPoisonPage *page, *next_page;
+
+    QLIST_FOREACH_SAFE(page, &hwpoison_page_list, list, next_page) {
+        QLIST_REMOVE(page, list);
+        qemu_ram_remap(page->ram_addr, TARGET_PAGE_SIZE);
+        g_free(page);
+    }
+}
+
+void kvm_hwpoison_page_add(ram_addr_t ram_addr)
+{
+    HWPoisonPage *page;
+
+    QLIST_FOREACH(page, &hwpoison_page_list, list) {
+        if (page->ram_addr == ram_addr) {
+            return;
+        }
+    }
+    page = g_new(HWPoisonPage, 1);
+    page->ram_addr = ram_addr;
+    QLIST_INSERT_HEAD(&hwpoison_page_list, page, list);
+}
+
 static uint32_t adjust_ioeventfd_endianness(uint32_t val, uint32_t size)
 {
 #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
@@ -1628,9 +1712,13 @@ int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg,
     return kvm_update_routing_entry(s, &kroute);
 }
 
-static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int rfd, int virq,
+static int kvm_irqchip_assign_irqfd(KVMState *s, EventNotifier *event,


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:22:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16211.39585 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZyT-0005JD-BB; Fri, 30 Oct 2020 19:22:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16211.39585; Fri, 30 Oct 2020 19:22:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYZyT-0005J5-89; Fri, 30 Oct 2020 19:22:09 +0000
Received: by outflank-mailman (input) for mailman id 16211;
 Fri, 30 Oct 2020 19:22:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYZyR-0005J0-Sv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aebcefa6-0451-4e4d-8c79-0759dac137e8;
 Fri, 30 Oct 2020 19:22:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZyP-0000WA-Sm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYZyP-0003gx-Of
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYZyR-0005J0-Sv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:08 +0000
X-Inumbo-ID: aebcefa6-0451-4e4d-8c79-0759dac137e8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aebcefa6-0451-4e4d-8c79-0759dac137e8;
	Fri, 30 Oct 2020 19:22:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pWe5vJDsq2kwk7jUFwB3t38kC2KYCQ58jBZs0pEolnk=; b=CxWzEnKAmiX61Vnql0br4nMCIl
	YlulVlueTm0MOqvwy2/TBlMpfJPnKT9l79X5/b9MjEtDSpvC0f3HOhmMUBfTKwLVpwol9JG7XKfCI
	8ZDB8tXdL9UadWpb3mEQ0vR81jvUSOuMebd+iaJzgvzCk2SClcyKlQ/KVCYUPoGFTW40=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZyP-0000WA-Sm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYZyP-0003gx-Of
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:22:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Fix 051 output after qdev_init_nofail() removal
Message-Id: <E1kYZyP-0003gx-Of@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:22:05 +0000

commit e11543c53fed2634146b9223112bc5c941434607
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Jun 16 17:49:49 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Wed Jun 24 10:00:04 2020 +0200

    iotests: Fix 051 output after qdev_init_nofail() removal
    
    Commit 96927c744 replaced qdev_init_nofail() call by
    isa_realize_and_unref() which has a different error
    message. Update the test output accordingly.
    
    Gitlab CI error after merging b77b5b3dc7:
    https://gitlab.com/qemu-project/qemu/-/jobs/597414772#L4375
    
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200616154949.6586-1-philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/051.pc.out | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 0ea80d35f0..da8ad87187 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -142,7 +142,7 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
 Testing: -drive if=ide
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty
+(qemu) QEMU_PROG: Device needs media, but drive is empty
 
 Testing: -drive if=virtio
 QEMU X.Y.Z monitor - type 'help' for more information
@@ -214,7 +214,7 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only
+(qemu) QEMU_PROG: Block node is read-only
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:33:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16214.39593 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYa98-0006DM-7m; Fri, 30 Oct 2020 19:33:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16214.39593; Fri, 30 Oct 2020 19:33:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYa98-0006DE-4b; Fri, 30 Oct 2020 19:33:10 +0000
Received: by outflank-mailman (input) for mailman id 16214;
 Fri, 30 Oct 2020 19:33:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYa96-0006D9-Vx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0bcc7282-7739-442d-a504-1645505f9e48;
 Fri, 30 Oct 2020 19:33:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYa94-0000kx-Gb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYa94-0004dt-EW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYa96-0006D9-Vx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:09 +0000
X-Inumbo-ID: 0bcc7282-7739-442d-a504-1645505f9e48
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0bcc7282-7739-442d-a504-1645505f9e48;
	Fri, 30 Oct 2020 19:33:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jpqcpTGSkANJDlDJXrRHx3T2hs4YuiCHgDcA9MNNUgc=; b=cXlOqFopJMdeaawSylL8Ovioo4
	0MtTxyUwAUBhLag0qmmSCt2Ko6rYSmNU8suGjSJJT+3aRwMEPeo6R4enMpDjpxknfl514euqyL79P
	vlS6tkQENIu8nIPFpvB7rUOXqNF7RExRMt+t5tVNWIKxOtyh5E8FhS9sJI1xl8oc9900=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYa94-0000kx-Gb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYa94-0004dt-EW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:33:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: don't test qcow2.py inside 291
Message-Id: <E1kYa94-0004dt-EW@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:33:06 +0000

commit 24b861c0386a17ea31eb824310c21118fb7be883
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Thu Jun 18 18:40:52 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Wed Jun 24 10:00:04 2020 +0200

    iotests: don't test qcow2.py inside 291
    
    820c6bee534ec3b added testing of qcow2.py into 291, and it breaks 291
    with external data file. Actually, 291 is bad place for qcow2.py
    testing, better add a separate test.
    
    For now, drop qcow2.py testing from 291 to fix the regression.
    
    Fixes: 820c6bee534ec3b
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200618154052.8629-1-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/291     |  4 ----
 tests/qemu-iotests/291.out | 33 ---------------------------------
 2 files changed, 37 deletions(-)

diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291
index 28e4fb9b4d..1e0bb76959 100755
--- a/tests/qemu-iotests/291
+++ b/tests/qemu-iotests/291
@@ -64,8 +64,6 @@ $QEMU_IO -c 'w 1M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG bitmap --disable -f $IMGFMT "$TEST_IMG" b1
 $QEMU_IMG bitmap --enable -f $IMGFMT "$TEST_IMG" b2
 $QEMU_IO -c 'w 2M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io
-echo "Check resulting qcow2 header extensions:"
-$PYTHON qcow2.py "$TEST_IMG" dump-header-exts
 
 echo
 echo "=== Bitmap preservation not possible to non-qcow2 ==="
@@ -92,8 +90,6 @@ $QEMU_IMG bitmap --merge tmp -f $IMGFMT "$TEST_IMG" b0
 $QEMU_IMG bitmap --remove --image-opts \
     driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG" tmp
 _img_info --format-specific
-echo "Check resulting qcow2 header extensions:"
-$PYTHON qcow2.py "$TEST_IMG" dump-header-exts
 
 echo
 echo "=== Check bitmap contents ==="
diff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/291.out
index 08bfaaaa6b..9f661515b4 100644
--- a/tests/qemu-iotests/291.out
+++ b/tests/qemu-iotests/291.out
@@ -14,25 +14,6 @@ wrote 1048576/1048576 bytes at offset 1048576
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1048576/1048576 bytes at offset 2097152
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Check resulting qcow2 header extensions:
-Header extension:
-magic                     0xe2792aca (Backing format)
-length                    5
-data                      'qcow2'
-
-Header extension:
-magic                     0x6803f857 (Feature table)
-length                    336
-data                      <binary>
-
-Header extension:
-magic                     0x23852875 (Bitmaps)
-length                    24
-nb_bitmaps                2
-reserved32                0
-bitmap_directory_size     0x40
-bitmap_directory_offset   0x510000
-
 
 === Bitmap preservation not possible to non-qcow2 ===
 
@@ -84,20 +65,6 @@ Format specific information:
             granularity: 65536
     refcount bits: 16
     corrupt: false
-Check resulting qcow2 header extensions:
-Header extension:
-magic                     0x6803f857 (Feature table)
-length                    336
-data                      <binary>
-
-Header extension:
-magic                     0x23852875 (Bitmaps)
-length                    24
-nb_bitmaps                3
-reserved32                0
-bitmap_directory_size     0x60
-bitmap_directory_offset   0x520000
-
 
 === Check bitmap contents ===
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16217.39601 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJp-00075s-68; Fri, 30 Oct 2020 19:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16217.39601; Fri, 30 Oct 2020 19:44:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJp-00075c-0x; Fri, 30 Oct 2020 19:44:13 +0000
Received: by outflank-mailman (input) for mailman id 16217;
 Fri, 30 Oct 2020 19:44:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaJn-00075G-Qv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 650d7d19-707d-42be-a80d-81e1d3d0fd37;
 Fri, 30 Oct 2020 19:44:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJi-0000ys-EW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJi-0005lj-Bj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaJn-00075G-Qv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:11 +0000
X-Inumbo-ID: 650d7d19-707d-42be-a80d-81e1d3d0fd37
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 650d7d19-707d-42be-a80d-81e1d3d0fd37;
	Fri, 30 Oct 2020 19:44:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T7MIn2EmvRUhE0zuT0gT7XBmmYiFwmQFJ9sPs55U3IA=; b=5pcayVl/95UCC1G4JbLc36qn55
	fUIRBzm1MjXqhed0nhtPDk6BJSYAAWjlRVY9tAYTNUaWqKaV4PqJPmAkJSDMAt731NWMNr+l2SA8O
	nDKPrKfiLbVr9N2FNuMqICOxoJXcw5KyvID5D96PdNga/9eBNX6An7cujVJRr4KqJ6PI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJi-0000ys-EW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJi-0005lj-Bj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-06-24' into staging
Message-Id: <E1kYaJi-0005lj-Bj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:06 +0000

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

commit 4abf70a661a5df3886ac9d7c19c3617fa92b922a
Merge: 6651620b92bc08cde07cb500e9a43dba7bd9b2b7 24b861c0386a17ea31eb824310c21118fb7be883
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 3 15:34:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 3 15:34:45 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-06-24' into staging
    
    Block patches:
    - Two iotest fixes
    
    # gpg: Signature made Wed 24 Jun 2020 09:00:51 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-06-24:
      iotests: don't test qcow2.py inside 291
      iotests: Fix 051 output after qdev_init_nofail() removal
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                                      |   16 +-
 Makefile                                         |   12 +-
 Makefile.objs                                    |    1 +
 accel/kvm/kvm-all.c                              |   21 +-
 accel/tcg/translate-all.c                        |    6 +-
 backends/Kconfig                                 |    1 +
 backends/Makefile.objs                           |    2 +-
 backends/tpm.c                                   |  208 ----
 backends/tpm/Kconfig                             |   14 +
 backends/tpm/Makefile.objs                       |    4 +
 backends/tpm/tpm_backend.c                       |  208 ++++
 backends/tpm/tpm_emulator.c                      |  997 +++++++++++++++
 backends/tpm/tpm_int.h                           |   88 ++
 backends/tpm/tpm_ioctl.h                         |  271 +++++
 backends/tpm/tpm_passthrough.c                   |  405 ++++++
 backends/tpm/tpm_util.c                          |  380 ++++++
 backends/tpm/trace-events                        |   33 +
 block/nvme.c                                     |  218 +++-
 block/trace-events                               |    2 +-
 blockdev.c                                       |   27 +-
 chardev/char-socket.c                            |    9 +-
 configure                                        |  108 +-
 cpus.c                                           |   15 +-
 docs/index.html.in                               |    4 +-
 docs/nvdimm.txt                                  |   10 +
 docs/qdev-device-use.txt                         |   17 +-
 docs/specs/tpm.rst                               |   16 +-
 docs/system/deprecated.rst                       |   71 +-
 exec.c                                           |   54 +-
 fpu/softfloat.c                                  |   87 +-
 hw/9pfs/9p.c                                     |    6 +-
 hw/acpi/aml-build.c                              |   51 +-
 hw/acpi/generic_event_device.c                   |   29 +
 hw/acpi/pcihp.c                                  |    3 +-
 hw/acpi/piix4.c                                  |   23 +-
 hw/arm/Kconfig                                   |    8 +-
 hw/arm/armsse.c                                  |   61 +-
 hw/arm/armv7m.c                                  |    7 +-
 hw/arm/aspeed.c                                  |   62 +-
 hw/arm/aspeed_ast2600.c                          |   35 +-
 hw/arm/aspeed_soc.c                              |   29 +-
 hw/arm/bcm2835_peripherals.c                     |   12 +-
 hw/arm/cubieboard.c                              |    2 +-
 hw/arm/exynos4210.c                              |    2 +-
 hw/arm/fsl-imx25.c                               |   12 +-
 hw/arm/fsl-imx6.c                                |   12 +-
 hw/arm/imx25_pdk.c                               |    2 +-
 hw/arm/mcimx6ul-evk.c                            |    2 +-
 hw/arm/mcimx7d-sabre.c                           |    2 +-
 hw/arm/mps2-tz.c                                 |   23 +-
 hw/arm/mps2.c                                    |   67 +-
 hw/arm/msf2-som.c                                |    4 +-
 hw/arm/nrf51_soc.c                               |    6 +-
 hw/arm/nseries.c                                 |    4 +-
 hw/arm/orangepi.c                                |    2 +-
 hw/arm/raspi.c                                   |    2 +-
 hw/arm/realview.c                                |    3 +-
 hw/arm/sabrelite.c                               |    6 +-
 hw/arm/stm32f205_soc.c                           |    2 +-
 hw/arm/stm32f405_soc.c                           |    2 +-
 hw/arm/versatilepb.c                             |    3 +-
 hw/arm/vexpress.c                                |    6 +-
 hw/arm/virt-acpi-build.c                         |   34 +
 hw/arm/virt.c                                    |  124 +-
 hw/arm/xilinx_zynq.c                             |    7 +-
 hw/arm/xlnx-versal-virt.c                        |    2 +-
 hw/arm/xlnx-zcu102.c                             |   10 +-
 hw/block/fdc.c                                   |  193 ++-
 hw/block/nand.c                                  |    2 +-
 hw/block/pflash_cfi01.c                          |    6 +-
 hw/block/pflash_cfi02.c                          |    2 +-
 hw/char/ibex_uart.c                              |    2 +-
 hw/char/virtio-serial-bus.c                      |    4 +-
 hw/core/bus.c                                    |    8 +-
 hw/core/machine.c                                |    8 +-
 hw/core/numa.c                                   |    7 +
 hw/core/qdev-properties-system.c                 |  151 ++-
 hw/core/qdev-properties.c                        |   17 +
 hw/display/ati.c                                 |   92 +-
 hw/display/ati_dbg.c                             |    1 +
 hw/display/ati_regs.h                            |    1 +
 hw/display/sm501.c                               |  157 ++-
 hw/display/trace-events                          |   12 +
 hw/display/virtio-gpu-pci.c                      |    2 +-
 hw/display/virtio-vga.c                          |    2 +-
 hw/dma/sparc32_dma.c                             |    6 +-
 hw/dma/xilinx_axidma.c                           |   12 +-
 hw/hyperv/vmbus.c                                |    3 +-
 hw/i2c/core.c                                    |   18 +-
 hw/i2c/versatile_i2c.c                           |   38 +-
 hw/i386/acpi-build.c                             |  214 +---
 hw/i386/amd_iommu.c                              |    6 +-
 hw/i386/fw_cfg.c                                 |   28 +
 hw/i386/fw_cfg.h                                 |    1 +
 hw/i386/pc.c                                     |   34 +-
 hw/i386/pc_piix.c                                |    1 +
 hw/i386/pc_q35.c                                 |    1 +
 hw/i386/x86.c                                    |    8 +-
 hw/ide/qdev.c                                    |    4 +-
 hw/input/adb-kbd.c                               |   42 +-
 hw/input/adb-mouse.c                             |   65 +-
 hw/input/adb.c                                   |  210 +++-
 hw/input/pckbd.c                                 |   31 +
 hw/input/trace-events                            |   27 +-
 hw/intc/Kconfig                                  |    3 +
 hw/intc/Makefile.objs                            |    1 +
 hw/intc/loongson_liointc.c                       |  242 ++++
 hw/isa/isa-superio.c                             |   18 +-
 hw/m68k/q800.c                                   |    3 +-
 hw/microblaze/petalogix_ml605_mmu.c              |    5 +-
 hw/mips/cps.c                                    |   35 +-
 hw/misc/mac_via.c                                |  411 ++++---
 hw/misc/macio/cuda.c                             |   60 +-
 hw/misc/macio/macio.c                            |    3 +-
 hw/misc/macio/pmu.c                              |   47 +-
 hw/misc/pca9552.c                                |  217 +++-
 hw/misc/trace-events                             |    7 +
 hw/net/virtio-net.c                              |    2 +-
 hw/net/xilinx_axienet.c                          |   12 +-
 hw/pci/pci.c                                     |    3 -
 hw/pci/pcie.c                                    |    2 +-
 hw/pci/shpc.c                                    |    2 +-
 hw/ppc/mac_newworld.c                            |    2 -
 hw/ppc/pnv.c                                     |   12 +-
 hw/ppc/spapr.c                                   |   10 +-
 hw/ppc/spapr_caps.c                              |   28 +-
 hw/ppc/spapr_drc.c                               |    4 +-
 hw/ppc/spapr_pci.c                               |    4 +-
 hw/ppc/spapr_vio.c                               |    6 +-
 hw/riscv/riscv_hart.c                            |   14 +-
 hw/riscv/sifive_u.c                              |   12 +-
 hw/s390x/ap-bridge.c                             |    2 +-
 hw/s390x/css-bridge.c                            |    2 +-
 hw/s390x/s390-pci-bus.c                          |   14 +-
 hw/scsi/megasas.c                                |   36 +-
 hw/scsi/scsi-bus.c                               |    4 +-
 hw/scsi/virtio-scsi.c                            |    4 +-
 hw/scsi/vmw_pvscsi.c                             |    2 +-
 hw/sd/milkymist-memcard.c                        |    7 +-
 hw/sd/pxa2xx_mmci.c                              |   15 +-
 hw/sd/sd.c                                       |    2 +-
 hw/sd/ssi-sd.c                                   |    3 +-
 hw/sparc64/sun4u.c                               |    9 +-
 hw/tpm/Kconfig                                   |   21 +-
 hw/tpm/Makefile.objs                             |    3 -
 hw/tpm/tpm_crb.c                                 |    4 +-
 hw/tpm/tpm_emulator.c                            |  997 ---------------
 hw/tpm/tpm_int.h                                 |   75 --
 hw/tpm/tpm_ioctl.h                               |  271 -----
 hw/tpm/tpm_passthrough.c                         |  405 ------
 hw/tpm/tpm_ppi.c                                 |    1 +
 hw/tpm/tpm_ppi.h                                 |    1 -
 hw/tpm/tpm_prop.h                                |   31 +
 hw/tpm/tpm_spapr.c                               |    4 +-
 hw/tpm/tpm_tis.h                                 |    1 -
 hw/tpm/tpm_tis_common.c                          |   11 +-
 hw/tpm/tpm_tis_isa.c                             |    3 +-
 hw/tpm/tpm_tis_sysbus.c                          |    3 +-
 hw/tpm/tpm_util.c                                |  377 ------
 hw/tpm/tpm_util.h                                |   85 --
 hw/tpm/trace-events                              |   34 +-
 hw/usb/bus.c                                     |    2 +-
 hw/usb/dev-mtp.c                                 |    2 -
 hw/usb/dev-smartcard-reader.c                    |    2 +-
 hw/usb/hcd-xhci.h                                |    2 +-
 hw/virtio/vhost-user.c                           |   12 +-
 hw/virtio/virtio-iommu-pci.c                     |    4 +-
 hw/watchdog/cmsdk-apb-watchdog.c                 |    1 +
 hw/watchdog/trace-events                         |    1 +
 hw/xen/Makefile.objs                             |    2 +-
 hw/xen/xen-bus.c                                 |    2 +-
 hw/xen/xen-legacy-backend.c                      |    2 +-
 hw/xtensa/xtfpga.c                               |    3 +-
 include/block/block.h                            |    4 +-
 include/exec/cpu-all.h                           |    8 +-
 include/exec/cpu-defs.h                          |    7 +-
 include/fpu/softfloat.h                          |    3 +
 include/hw/acpi/acpi-defs.h                      |   18 -
 include/hw/arm/aspeed.h                          |   12 +-
 include/hw/block/fdc.h                           |    5 +-
 include/hw/hyperv/vmbus-bridge.h                 |    3 +-
 include/hw/i2c/arm_sbcon_i2c.h                   |   35 +
 include/hw/i2c/i2c.h                             |    2 +
 include/hw/i386/pc.h                             |    1 -
 include/hw/input/adb.h                           |   26 +-
 include/hw/misc/mac_via.h                        |    2 +-
 include/hw/misc/macio/cuda.h                     |    4 -
 include/hw/misc/macio/pmu.h                      |    4 -
 include/hw/misc/pca9552.h                        |   16 +-
 include/hw/ppc/xive_regs.h                       |    2 +-
 include/hw/qdev-core.h                           |    5 +-
 include/hw/qdev-properties.h                     |   18 +-
 include/qemu/coroutine_int.h                     |    5 +
 include/qemu/osdep.h                             |   57 +-
 include/sysemu/blockdev.h                        |    2 +
 include/sysemu/tpm_util.h                        |   72 ++
 memory.c                                         |   29 +-
 migration/qemu-file.c                            |    2 +-
 migration/rdma.c                                 |   19 +-
 pc-bios/bios-256k.bin                            |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                                 |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin                          |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin                |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin                       |  Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin                          |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin                        |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin                       |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin                              |  Bin 38912 -> 38912 bytes
 qemu-options.hx                                  |    9 +-
 qga/commands-posix.c                             |    1 +
 replay/replay.c                                  |    2 +-
 roms/config.seabios-128k                         |    3 +
 roms/seabios                                     |    2 +-
 scripts/minikconf.py                             |    6 +-
 scripts/performance/topN_callgrind.py            |  140 +++
 scripts/performance/topN_perf.py                 |  149 +++
 scripts/tracetool.py                             |    2 +-
 scripts/tracetool/__init__.py                    |    2 +-
 scripts/tracetool/backend/__init__.py            |    2 +-
 scripts/tracetool/backend/dtrace.py              |    2 +-
 scripts/tracetool/backend/log.py                 |    2 +-
 scripts/tracetool/backend/simple.py              |    2 +-
 scripts/tracetool/backend/ust.py                 |    2 +-
 scripts/tracetool/format/__init__.py             |    2 +-
 scripts/tracetool/format/c.py                    |    2 +-
 scripts/tracetool/format/d.py                    |    2 +-
 scripts/tracetool/format/h.py                    |    2 +-
 scripts/tracetool/format/stap.py                 |    2 +-
 scripts/tracetool/format/tcg_h.py                |    2 +-
 scripts/tracetool/format/tcg_helper_c.py         |    2 +-
 scripts/tracetool/format/tcg_helper_h.py         |    2 +-
 scripts/tracetool/format/tcg_helper_wrapper_h.py |    2 +-
 scripts/tracetool/transform.py                   |    2 +-
 scripts/tracetool/vcpu.py                        |    2 +-
 softmmu/vl.c                                     |    8 +
 stubs/Makefile.objs                              |    1 +
 stubs/cmos.c                                     |    7 +
 target/arm/Makefile.objs                         |    1 +
 target/arm/cpu.c                                 |   83 +-
 target/arm/cpu.h                                 |   52 +-
 target/arm/cpu64.c                               |   15 +-
 target/arm/helper-a64.c                          |   96 +-
 target/arm/helper-a64.h                          |   16 +
 target/arm/helper-sve.h                          |  488 ++++++++
 target/arm/helper.c                              |  421 +++++--
 target/arm/helper.h                              |    2 +
 target/arm/internals.h                           |  153 ++-
 target/arm/kvm.c                                 |    4 +-
 target/arm/kvm64.c                               |   14 +-
 target/arm/kvm_arm.h                             |   21 +-
 target/arm/m_helper.c                            |   11 +-
 target/arm/mte_helper.c                          |  906 ++++++++++++++
 target/arm/neon-dp.decode                        |  106 ++
 target/arm/op_helper.c                           |   16 +
 target/arm/sve_helper.c                          |  614 ++++++++--
 target/arm/tlb_helper.c                          |   13 +-
 target/arm/translate-a64.c                       |  677 +++++++++--
 target/arm/translate-a64.h                       |    5 +
 target/arm/translate-neon.inc.c                  | 1191 +++++++++++++++++-
 target/arm/translate-sve.c                       | 1420 ++++++++++++++--------
 target/arm/translate-vfp.inc.c                   |    9 +-
 target/arm/translate.c                           | 1080 +---------------
 target/arm/translate.h                           |   31 +-
 target/i386/cpu.c                                |    9 +
 target/i386/fpu_helper.c                         | 1396 +++++++++++++++++++--
 target/i386/kvm.c                                |   46 +-
 target/m68k/softfloat.c                          |   83 --
 target/m68k/softfloat.h                          |    1 -
 target/mips/kvm.c                                |   26 +
 target/mips/kvm_mips.h                           |   11 +
 target/ppc/translate_init.inc.c                  |    5 -
 target/xtensa/cpu.h                              |    1 +
 target/xtensa/overlay_tool.h                     |    8 +-
 target/xtensa/translate.c                        |   60 +-
 tests/check-block-qdict.c                        |   24 +-
 tests/check-block.sh                             |   12 +-
 tests/check-qobject.c                            |    5 +-
 tests/check-qom-proplist.c                       |   14 +-
 tests/data/acpi/pc/DSDT                          |  Bin 5014 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat                 |  Bin 6338 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge                   |  Bin 6873 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp                     |  Bin 5477 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm                  |  Bin 6667 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs                  |  Bin 5086 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp                    |  Bin 6373 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem                  |  Bin 5020 -> 4940 bytes
 tests/data/acpi/q35/DSDT                         |  Bin 7752 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat                |  Bin 9076 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge                  |  Bin 7769 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp                    |  Bin 8215 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm                 |  Bin 9405 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt                  |  Bin 7827 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp                   |  Bin 9111 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64                  |  Bin 8882 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem                 |  Bin 7758 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis                     |  Bin 8357 -> 8283 bytes
 tests/qemu-iotests/172                           |   27 +-
 tests/qemu-iotests/172.out                       |  642 +++++++++-
 tests/qtest/arm-cpu-features.c                   |   38 +-
 tests/qtest/bios-tables-test-allowed-diff.h      |   18 +
 tests/qtest/bios-tables-test.c                   |    2 +-
 tests/qtest/libqos/pci-pc.c                      |    2 +-
 tests/qtest/test-x86-cpuid-compat.c              |    4 +-
 tests/qtest/tpm-emu.c                            |    2 +-
 tests/qtest/usb-hcd-ehci-test.c                  |    2 +-
 tests/tcg/i386/test-i386-f2xm1.c                 | 1140 +++++++++++++++++
 tests/tcg/i386/test-i386-fpatan.c                | 1071 ++++++++++++++++
 tests/tcg/i386/test-i386-fyl2x.c                 | 1161 ++++++++++++++++++
 tests/tcg/i386/test-i386-fyl2xp1.c               | 1156 ++++++++++++++++++
 tests/test-base64.c                              |    3 +-
 tests/test-bdrv-graph-mod.c                      |    4 +-
 tests/test-block-iothread.c                      |    3 +-
 tests/test-crypto-cipher.c                       |    8 +-
 tests/test-io-task.c                             |    4 +-
 tests/test-logging.c                             |   12 +-
 tests/test-qemu-opts.c                           |   22 +-
 tests/test-replication.c                         |  109 +-
 tests/test-string-input-visitor.c                |   33 +-
 tests/test-string-output-visitor.c               |   16 +-
 tests/test-util-filemonitor.c                    |    1 +
 trace/simple.c                                   |   20 +-
 trace/simple.h                                   |    2 +-
 ui/vnc.c                                         |    6 +-
 util/coroutine-sigaltstack.c                     |    4 +
 util/coroutine-ucontext.c                        |   28 +
 util/getauxval.c                                 |   10 +
 util/oslib-posix.c                               |   15 +
 util/qemu-timer.c                                |   32 +-
 330 files changed, 17977 insertions(+), 6506 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 51a45703b8..dec252f38b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -842,6 +842,7 @@ M: Peter Maydell <peter.maydell@linaro.org>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/*/versatile*
+F: include/hw/i2c/arm_sbcon_i2c.h
 F: hw/misc/arm_sysctl.c
 F: docs/system/arm/versatile.rst
 
@@ -1095,6 +1096,12 @@ F: hw/isa/vt82c686.c
 F: hw/pci-host/bonito.c
 F: include/hw/isa/vt82c686.h
 
+Loongson-3 virtual platforms
+M: Huacai Chen <chenhc@lemote.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
+S: Maintained
+F: hw/intc/loongson_liointc.c
+
 Boston
 M: Paul Burton <pburton@wavecomp.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
@@ -2430,7 +2437,7 @@ F: hw/tpm/*
 F: include/hw/acpi/tpm.h
 F: include/sysemu/tpm*
 F: qapi/tpm.json
-F: backends/tpm.c
+F: backends/tpm/
 F: tests/qtest/*tpm*
 T: git https://github.com/stefanberger/qemu-tpm.git tpm-next
 
@@ -3018,3 +3025,10 @@ M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: docs/conf.py
 F: docs/*/conf.py
+
+Miscellaneous
+-------------
+Performance Tools and Tests
+M: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
+S: Maintained
+F: scripts/performance/
diff --git a/Makefile b/Makefile
index 48f23aa978..b1b8a5a6d0 100644
--- a/Makefile
+++ b/Makefile
@@ -418,7 +418,7 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
 MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
@@ -873,8 +873,9 @@ install-sphinxdocs: sphinxdocs
 install-doc: $(DOCS) install-sphinxdocs
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
 ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu.1 "$(DESTDIR)$(mandir)/man1"
@@ -892,8 +893,9 @@ ifdef CONFIG_TRACE_SYSTEMTAP
 endif
 ifneq (,$(findstring qemu-ga,$(TOOLS)))
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
-	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)/interop"
+	$(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)/interop"
 	$(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
 endif
 endif
diff --git a/Makefile.objs b/Makefile.objs
index 7ce2588b89..98383972ee 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -125,6 +125,7 @@ trace-events-subdirs =
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += backends
+trace-events-subdirs += backends/tpm
 trace-events-subdirs += crypto
 trace-events-subdirs += monitor
 ifeq ($(CONFIG_USER_ONLY),y)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index f24d7da783..d54a8701d8 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -101,7 +101,7 @@ struct KVMState
     bool kernel_irqchip_required;
     OnOffAuto kernel_irqchip_split;
     bool sync_mmu;
-    bool manual_dirty_log_protect;
+    uint64_t manual_dirty_log_protect;
     /* The man page (and posix) say ioctl numbers are signed int, but
      * they're not.  Linux, glibc and *BSD all treat ioctl numbers as
      * unsigned, and treating them as signed here can break things */
@@ -1995,6 +1995,7 @@ static int kvm_init(MachineState *ms)
     int ret;
     int type = 0;
     const char *kvm_type;
+    uint64_t dirty_log_manual_caps;
 
     s = KVM_STATE(ms->accelerator);
 
@@ -2120,14 +2121,20 @@ static int kvm_init(MachineState *ms)
     s->coalesced_pio = s->coalesced_mmio &&
                        kvm_check_extension(s, KVM_CAP_COALESCED_PIO);
 
-    s->manual_dirty_log_protect =
+    dirty_log_manual_caps =
         kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);
-    if (s->manual_dirty_log_protect) {
-        ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, 1);
+    dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE |
+                              KVM_DIRTY_LOG_INITIALLY_SET);
+    s->manual_dirty_log_protect = dirty_log_manual_caps;
+    if (dirty_log_manual_caps) {
+        ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0,
+                                   dirty_log_manual_caps);
         if (ret) {
-            warn_report("Trying to enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 "
-                        "but failed.  Falling back to the legacy mode. ");
-            s->manual_dirty_log_protect = false;
+            warn_report("Trying to enable capability %"PRIu64" of "
+                        "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. "
+                        "Falling back to the legacy mode. ",
+                        dirty_log_manual_caps);
+            s->manual_dirty_log_protect = 0;
         }
     }
 
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index c3d37058a1..2afa46bd2b 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2582,9 +2582,9 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
     /* This function should never be called with addresses outside the
        guest address space.  If this assert fires, it probably indicates
        a missing call to h2g_valid.  */
-#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
-    assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
-#endif
+    if (TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS) {
+        assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
+    }
 
     if (len == 0) {
         return 0;
diff --git a/backends/Kconfig b/backends/Kconfig
new file mode 100644
index 0000000000..f35abc1609
--- /dev/null
+++ b/backends/Kconfig
@@ -0,0 +1 @@
+source tpm/Kconfig
diff --git a/backends/Makefile.objs b/backends/Makefile.objs
index 28a847cd57..22d204cb48 100644
--- a/backends/Makefile.objs
+++ b/backends/Makefile.objs
@@ -1,7 +1,7 @@
 common-obj-y += rng.o rng-egd.o rng-builtin.o
 common-obj-$(CONFIG_POSIX) += rng-random.o
 
-common-obj-$(CONFIG_TPM) += tpm.o
+common-obj-$(CONFIG_TPM) += tpm/
 
 common-obj-y += hostmem.o hostmem-ram.o
 common-obj-$(CONFIG_POSIX) += hostmem-file.o
diff --git a/backends/tpm.c b/backends/tpm.c
deleted file mode 100644
index 375587e743..0000000000
--- a/backends/tpm.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * QEMU TPM Backend
- *
- * Copyright IBM, Corp. 2013
- *
- * Authors:
- *  Stefan Berger   <stefanb@us.ibm.com>
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- * Based on backends/rng.c by Anthony Liguori
- */
-
-#include "qemu/osdep.h"
-#include "sysemu/tpm_backend.h"
-#include "qapi/error.h"
-#include "sysemu/tpm.h"
-#include "qemu/thread.h"
-#include "qemu/main-loop.h"
-#include "qemu/module.h"
-#include "block/thread-pool.h"
-#include "qemu/error-report.h"
-
-static void tpm_backend_request_completed(void *opaque, int ret)
-{
-    TPMBackend *s = TPM_BACKEND(opaque);
-    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
-
-    tic->request_completed(s->tpmif, ret);
-
-    /* no need for atomic, as long the BQL is taken */
-    s->cmd = NULL;
-    object_unref(OBJECT(s));
-}
-
-static int tpm_backend_worker_thread(gpointer data)
-{
-    TPMBackend *s = TPM_BACKEND(data);
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-    Error *err = NULL;
-
-    k->handle_request(s, s->cmd, &err);
-    if (err) {
-        error_report_err(err);
-        return -1;
-    }
-
-    return 0;
-}
-
-void tpm_backend_finish_sync(TPMBackend *s)
-{
-    while (s->cmd) {
-        aio_poll(qemu_get_aio_context(), true);
-    }
-}
-
-enum TpmType tpm_backend_get_type(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->type;
-}
-
-int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
-{
-    if (s->tpmif) {
-        error_setg(errp, "TPM backend '%s' is already initialized", s->id);
-        return -1;
-    }
-
-    s->tpmif = tpmif;
-    object_ref(OBJECT(tpmif));
-
-    s->had_startup_error = false;
-
-    return 0;
-}
-
-int tpm_backend_startup_tpm(TPMBackend *s, size_t buffersize)
-{
-    int res = 0;
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    /* terminate a running TPM */
-    tpm_backend_finish_sync(s);
-
-    res = k->startup_tpm ? k->startup_tpm(s, buffersize) : 0;
-
-    s->had_startup_error = (res != 0);
-
-    return res;
-}
-
-bool tpm_backend_had_startup_error(TPMBackend *s)
-{
-    return s->had_startup_error;
-}
-
-void tpm_backend_deliver_request(TPMBackend *s, TPMBackendCmd *cmd)
-{
-    ThreadPool *pool = aio_get_thread_pool(qemu_get_aio_context());
-
-    if (s->cmd != NULL) {
-        error_report("There is a TPM request pending");
-        return;
-    }
-
-    s->cmd = cmd;
-    object_ref(OBJECT(s));
-    thread_pool_submit_aio(pool, tpm_backend_worker_thread, s,
-                           tpm_backend_request_completed, s);
-}
-
-void tpm_backend_reset(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    if (k->reset) {
-        k->reset(s);
-    }
-
-    tpm_backend_finish_sync(s);
-
-    s->had_startup_error = false;
-}
-
-void tpm_backend_cancel_cmd(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    k->cancel_cmd(s);
-}
-
-bool tpm_backend_get_tpm_established_flag(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_tpm_established_flag ?
-           k->get_tpm_established_flag(s) : false;
-}
-
-int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->reset_tpm_established_flag ?
-           k->reset_tpm_established_flag(s, locty) : 0;
-}
-
-TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_tpm_version(s);
-}
-
-size_t tpm_backend_get_buffer_size(TPMBackend *s)
-{
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-
-    return k->get_buffer_size(s);
-}
-
-TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
-{
-    TPMInfo *info = g_new0(TPMInfo, 1);
-    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
-    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
-
-    info->id = g_strdup(s->id);
-    info->model = tic->model;
-    info->options = k->get_tpm_options(s);
-
-    return info;
-}
-
-static void tpm_backend_instance_finalize(Object *obj)
-{
-    TPMBackend *s = TPM_BACKEND(obj);
-
-    object_unref(OBJECT(s->tpmif));
-    g_free(s->id);
-}
-
-static const TypeInfo tpm_backend_info = {
-    .name = TYPE_TPM_BACKEND,
-    .parent = TYPE_OBJECT,
-    .instance_size = sizeof(TPMBackend),
-    .instance_finalize = tpm_backend_instance_finalize,
-    .class_size = sizeof(TPMBackendClass),
-    .abstract = true,
-};
-
-static const TypeInfo tpm_if_info = {
-    .name = TYPE_TPM_IF,
-    .parent = TYPE_INTERFACE,
-    .class_size = sizeof(TPMIfClass),
-};
-
-static void register_types(void)
-{
-    type_register_static(&tpm_backend_info);
-    type_register_static(&tpm_if_info);
-}
-
-type_init(register_types);
diff --git a/backends/tpm/Kconfig b/backends/tpm/Kconfig
new file mode 100644
index 0000000000..5d91eb89c2
--- /dev/null
+++ b/backends/tpm/Kconfig
@@ -0,0 +1,14 @@
+config TPM_BACKEND
+    bool
+    depends on TPM
+
+config TPM_PASSTHROUGH
+    bool
+    default y
+    # FIXME: should check for x86 host as well
+    depends on TPM_BACKEND && LINUX
+
+config TPM_EMULATOR
+    bool
+    default y
+    depends on TPM_BACKEND
diff --git a/backends/tpm/Makefile.objs b/backends/tpm/Makefile.objs
new file mode 100644
index 0000000000..db2731f634
--- /dev/null
+++ b/backends/tpm/Makefile.objs
@@ -0,0 +1,4 @@
+common-obj-y += tpm_backend.o
+common-obj-y += tpm_util.o
+common-obj-$(CONFIG_TPM_PASSTHROUGH) += tpm_passthrough.o
+common-obj-$(CONFIG_TPM_EMULATOR) += tpm_emulator.o
diff --git a/backends/tpm/tpm_backend.c b/backends/tpm/tpm_backend.c
new file mode 100644
index 0000000000..375587e743
--- /dev/null
+++ b/backends/tpm/tpm_backend.c
@@ -0,0 +1,208 @@
+/*
+ * QEMU TPM Backend
+ *
+ * Copyright IBM, Corp. 2013
+ *
+ * Authors:
+ *  Stefan Berger   <stefanb@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ * Based on backends/rng.c by Anthony Liguori
+ */
+
+#include "qemu/osdep.h"
+#include "sysemu/tpm_backend.h"
+#include "qapi/error.h"
+#include "sysemu/tpm.h"
+#include "qemu/thread.h"
+#include "qemu/main-loop.h"
+#include "qemu/module.h"
+#include "block/thread-pool.h"
+#include "qemu/error-report.h"
+
+static void tpm_backend_request_completed(void *opaque, int ret)
+{
+    TPMBackend *s = TPM_BACKEND(opaque);
+    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
+
+    tic->request_completed(s->tpmif, ret);
+
+    /* no need for atomic, as long the BQL is taken */
+    s->cmd = NULL;
+    object_unref(OBJECT(s));
+}
+
+static int tpm_backend_worker_thread(gpointer data)
+{
+    TPMBackend *s = TPM_BACKEND(data);
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+    Error *err = NULL;
+
+    k->handle_request(s, s->cmd, &err);
+    if (err) {
+        error_report_err(err);
+        return -1;
+    }
+
+    return 0;
+}
+
+void tpm_backend_finish_sync(TPMBackend *s)
+{
+    while (s->cmd) {
+        aio_poll(qemu_get_aio_context(), true);
+    }
+}
+
+enum TpmType tpm_backend_get_type(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->type;
+}
+
+int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
+{
+    if (s->tpmif) {
+        error_setg(errp, "TPM backend '%s' is already initialized", s->id);
+        return -1;
+    }
+
+    s->tpmif = tpmif;
+    object_ref(OBJECT(tpmif));
+
+    s->had_startup_error = false;
+
+    return 0;
+}
+
+int tpm_backend_startup_tpm(TPMBackend *s, size_t buffersize)
+{
+    int res = 0;
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    /* terminate a running TPM */
+    tpm_backend_finish_sync(s);
+
+    res = k->startup_tpm ? k->startup_tpm(s, buffersize) : 0;
+
+    s->had_startup_error = (res != 0);
+
+    return res;
+}
+
+bool tpm_backend_had_startup_error(TPMBackend *s)
+{
+    return s->had_startup_error;
+}
+
+void tpm_backend_deliver_request(TPMBackend *s, TPMBackendCmd *cmd)
+{
+    ThreadPool *pool = aio_get_thread_pool(qemu_get_aio_context());
+
+    if (s->cmd != NULL) {
+        error_report("There is a TPM request pending");
+        return;
+    }
+
+    s->cmd = cmd;
+    object_ref(OBJECT(s));
+    thread_pool_submit_aio(pool, tpm_backend_worker_thread, s,
+                           tpm_backend_request_completed, s);
+}
+
+void tpm_backend_reset(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    if (k->reset) {
+        k->reset(s);
+    }
+
+    tpm_backend_finish_sync(s);
+
+    s->had_startup_error = false;
+}
+
+void tpm_backend_cancel_cmd(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    k->cancel_cmd(s);
+}
+
+bool tpm_backend_get_tpm_established_flag(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_tpm_established_flag ?
+           k->get_tpm_established_flag(s) : false;
+}
+
+int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->reset_tpm_established_flag ?
+           k->reset_tpm_established_flag(s, locty) : 0;
+}
+
+TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_tpm_version(s);
+}
+
+size_t tpm_backend_get_buffer_size(TPMBackend *s)
+{
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+    return k->get_buffer_size(s);
+}
+
+TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
+{
+    TPMInfo *info = g_new0(TPMInfo, 1);
+    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+    TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif);
+
+    info->id = g_strdup(s->id);
+    info->model = tic->model;
+    info->options = k->get_tpm_options(s);
+
+    return info;
+}
+
+static void tpm_backend_instance_finalize(Object *obj)
+{
+    TPMBackend *s = TPM_BACKEND(obj);
+
+    object_unref(OBJECT(s->tpmif));
+    g_free(s->id);
+}
+
+static const TypeInfo tpm_backend_info = {
+    .name = TYPE_TPM_BACKEND,
+    .parent = TYPE_OBJECT,
+    .instance_size = sizeof(TPMBackend),
+    .instance_finalize = tpm_backend_instance_finalize,
+    .class_size = sizeof(TPMBackendClass),
+    .abstract = true,
+};
+
+static const TypeInfo tpm_if_info = {
+    .name = TYPE_TPM_IF,
+    .parent = TYPE_INTERFACE,
+    .class_size = sizeof(TPMIfClass),
+};
+
+static void register_types(void)
+{
+    type_register_static(&tpm_backend_info);
+    type_register_static(&tpm_if_info);
+}
+
+type_init(register_types);
diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
new file mode 100644
index 0000000000..9605339f93
--- /dev/null
+++ b/backends/tpm/tpm_emulator.c
@@ -0,0 +1,997 @@
+/*
+ *  Emulator TPM driver
+ *
+ *  Copyright (c) 2017 Intel Corporation
+ *  Author: Amarnath Valluri <amarnath.valluri@intel.com>
+ *
+ *  Copyright (c) 2010 - 2013, 2018 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ *  Copyright (C) 2011 IAIK, Graz University of Technology
+ *    Author: Andreas Niederl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qemu/module.h"
+#include "qemu/sockets.h"
+#include "io/channel-socket.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "tpm_int.h"
+#include "tpm_ioctl.h"
+#include "migration/blocker.h"
+#include "migration/vmstate.h"
+#include "qapi/error.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-tpm.h"
+#include "chardev/char-fe.h"
+#include "trace.h"
+
+#define TYPE_TPM_EMULATOR "tpm-emulator"
+#define TPM_EMULATOR(obj) \
+    OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR)
+
+#define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) == (cap))
+
+/* data structures */
+
+/* blobs from the TPM; part of VM state when migrating */
+typedef struct TPMBlobBuffers {
+    uint32_t permanent_flags;
+    TPMSizedBuffer permanent;
+
+    uint32_t volatil_flags;
+    TPMSizedBuffer volatil;
+
+    uint32_t savestate_flags;
+    TPMSizedBuffer savestate;
+} TPMBlobBuffers;
+
+typedef struct TPMEmulator {
+    TPMBackend parent;
+
+    TPMEmulatorOptions *options;
+    CharBackend ctrl_chr;
+    QIOChannel *data_ioc;
+    TPMVersion tpm_version;
+    ptm_cap caps; /* capabilities of the TPM */
+    uint8_t cur_locty_number; /* last set locality */
+    Error *migration_blocker;
+
+    QemuMutex mutex;
+
+    unsigned int established_flag:1;
+    unsigned int established_flag_cached:1;
+
+    TPMBlobBuffers state_blobs;
+} TPMEmulator;
+
+struct tpm_error {
+    uint32_t tpm_result;
+    const char *string;
+};
+
+static const struct tpm_error tpm_errors[] = {
+    /* TPM 1.2 error codes */
+    { TPM_BAD_PARAMETER   , "a parameter is bad" },
+    { TPM_FAIL            , "operation failed" },
+    { TPM_KEYNOTFOUND     , "key could not be found" },
+    { TPM_BAD_PARAM_SIZE  , "bad parameter size"},
+    { TPM_ENCRYPT_ERROR   , "encryption error" },
+    { TPM_DECRYPT_ERROR   , "decryption error" },
+    { TPM_BAD_KEY_PROPERTY, "bad key property" },
+    { TPM_BAD_MODE        , "bad (encryption) mode" },
+    { TPM_BAD_VERSION     , "bad version identifier" },
+    { TPM_BAD_LOCALITY    , "bad locality" },
+    /* TPM 2 error codes */
+    { TPM_RC_FAILURE     , "operation failed" },
+    { TPM_RC_LOCALITY    , "bad locality"     },
+    { TPM_RC_INSUFFICIENT, "insufficient amount of data" },
+};
+
+static const char *tpm_emulator_strerror(uint32_t tpm_result)
+{
+    size_t i;
+
+    for (i = 0; i < ARRAY_SIZE(tpm_errors); i++) {
+        if (tpm_errors[i].tpm_result == tpm_result) {
+            return tpm_errors[i].string;
+        }
+    }
+    return "";
+}
+
+static int tpm_emulator_ctrlcmd(TPMEmulator *tpm, unsigned long cmd, void *msg,
+                                size_t msg_len_in, size_t msg_len_out)
+{
+    CharBackend *dev = &tpm->ctrl_chr;
+    uint32_t cmd_no = cpu_to_be32(cmd);
+    ssize_t n = sizeof(uint32_t) + msg_len_in;
+    uint8_t *buf = NULL;
+    int ret = -1;
+
+    qemu_mutex_lock(&tpm->mutex);
+
+    buf = g_alloca(n);
+    memcpy(buf, &cmd_no, sizeof(cmd_no));
+    memcpy(buf + sizeof(cmd_no), msg, msg_len_in);
+
+    n = qemu_chr_fe_write_all(dev, buf, n);
+    if (n <= 0) {
+        goto end;
+    }
+
+    if (msg_len_out != 0) {
+        n = qemu_chr_fe_read_all(dev, msg, msg_len_out);
+        if (n <= 0) {
+            goto end;
+        }
+    }
+
+    ret = 0;
+
+end:
+    qemu_mutex_unlock(&tpm->mutex);
+    return ret;
+}
+
+static int tpm_emulator_unix_tx_bufs(TPMEmulator *tpm_emu,
+                                     const uint8_t *in, uint32_t in_len,
+                                     uint8_t *out, uint32_t out_len,
+                                     bool *selftest_done,
+                                     Error **errp)
+{
+    ssize_t ret;
+    bool is_selftest = false;
+
+    if (selftest_done) {
+        *selftest_done = false;
+        is_selftest = tpm_util_is_selftest(in, in_len);
+    }
+
+    ret = qio_channel_write_all(tpm_emu->data_ioc, (char *)in, in_len, errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    ret = qio_channel_read_all(tpm_emu->data_ioc, (char *)out,
+              sizeof(struct tpm_resp_hdr), errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    ret = qio_channel_read_all(tpm_emu->data_ioc,
+              (char *)out + sizeof(struct tpm_resp_hdr),
+              tpm_cmd_get_size(out) - sizeof(struct tpm_resp_hdr), errp);
+    if (ret != 0) {
+        return -1;
+    }
+
+    if (is_selftest) {
+        *selftest_done = tpm_cmd_get_errcode(out) == 0;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_set_locality(TPMEmulator *tpm_emu, uint8_t locty_number,
+                                     Error **errp)
+{
+    ptm_loc loc;
+
+    if (tpm_emu->cur_locty_number == locty_number) {
+        return 0;
+    }
+
+    trace_tpm_emulator_set_locality(locty_number);
+
+    memset(&loc, 0, sizeof(loc));
+    loc.u.req.loc = locty_number;
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc,
+                             sizeof(loc), sizeof(loc)) < 0) {
+        error_setg(errp, "tpm-emulator: could not set locality : %s",
+                   strerror(errno));
+        return -1;
+    }
+
+    loc.u.resp.tpm_result = be32_to_cpu(loc.u.resp.tpm_result);
+    if (loc.u.resp.tpm_result != 0) {
+        error_setg(errp, "tpm-emulator: TPM result for set locality : 0x%x",
+                   loc.u.resp.tpm_result);
+        return -1;
+    }
+
+    tpm_emu->cur_locty_number = locty_number;
+
+    return 0;
+}
+
+static void tpm_emulator_handle_request(TPMBackend *tb, TPMBackendCmd *cmd,
+                                        Error **errp)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    trace_tpm_emulator_handle_request();
+
+    if (tpm_emulator_set_locality(tpm_emu, cmd->locty, errp) < 0 ||
+        tpm_emulator_unix_tx_bufs(tpm_emu, cmd->in, cmd->in_len,
+                                  cmd->out, cmd->out_len,
+                                  &cmd->selftest_done, errp) < 0) {
+        tpm_util_write_fatal_error_response(cmd->out, cmd->out_len);
+    }
+}
+
+static int tpm_emulator_probe_caps(TPMEmulator *tpm_emu)
+{
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_CAPABILITY,
+                             &tpm_emu->caps, 0, sizeof(tpm_emu->caps)) < 0) {
+        error_report("tpm-emulator: probing failed : %s", strerror(errno));
+        return -1;
+    }
+
+    tpm_emu->caps = be64_to_cpu(tpm_emu->caps);
+
+    trace_tpm_emulator_probe_caps(tpm_emu->caps);
+
+    return 0;
+}
+
+static int tpm_emulator_check_caps(TPMEmulator *tpm_emu)
+{
+    ptm_cap caps = 0;
+    const char *tpm = NULL;
+
+    /* check for min. required capabilities */
+    switch (tpm_emu->tpm_version) {
+    case TPM_VERSION_1_2:
+        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
+               PTM_CAP_SET_LOCALITY | PTM_CAP_SET_DATAFD | PTM_CAP_STOP |
+               PTM_CAP_SET_BUFFERSIZE;
+        tpm = "1.2";
+        break;
+    case TPM_VERSION_2_0:
+        caps = PTM_CAP_INIT | PTM_CAP_SHUTDOWN | PTM_CAP_GET_TPMESTABLISHED |
+               PTM_CAP_SET_LOCALITY | PTM_CAP_RESET_TPMESTABLISHED |
+               PTM_CAP_SET_DATAFD | PTM_CAP_STOP | PTM_CAP_SET_BUFFERSIZE;
+        tpm = "2";
+        break;
+    case TPM_VERSION_UNSPEC:
+        error_report("tpm-emulator: TPM version has not been set");
+        return -1;
+    }
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, caps)) {
+        error_report("tpm-emulator: TPM does not implement minimum set of "
+                     "required capabilities for TPM %s (0x%x)", tpm, (int)caps);
+        return -1;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_stop_tpm(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_res res;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_STOP, &res, 0, sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not stop TPM: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(res);
+    if (res) {
+        error_report("tpm-emulator: TPM result for CMD_STOP: 0x%x %s", res,
+                     tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_set_buffer_size(TPMBackend *tb,
+                                        size_t wanted_size,
+                                        size_t *actual_size)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_setbuffersize psbs;
+
+    if (tpm_emulator_stop_tpm(tb) < 0) {
+        return -1;
+    }
+
+    psbs.u.req.buffersize = cpu_to_be32(wanted_size);
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_BUFFERSIZE, &psbs,
+                             sizeof(psbs.u.req), sizeof(psbs.u.resp)) < 0) {
+        error_report("tpm-emulator: Could not set buffer size: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    psbs.u.resp.tpm_result = be32_to_cpu(psbs.u.resp.tpm_result);
+    if (psbs.u.resp.tpm_result != 0) {
+        error_report("tpm-emulator: TPM result for set buffer size : 0x%x %s",
+                     psbs.u.resp.tpm_result,
+                     tpm_emulator_strerror(psbs.u.resp.tpm_result));
+        return -1;
+    }
+
+    if (actual_size) {
+        *actual_size = be32_to_cpu(psbs.u.resp.buffersize);
+    }
+
+    trace_tpm_emulator_set_buffer_size(
+            be32_to_cpu(psbs.u.resp.buffersize),
+            be32_to_cpu(psbs.u.resp.minsize),
+            be32_to_cpu(psbs.u.resp.maxsize));
+
+    return 0;
+}
+
+static int tpm_emulator_startup_tpm_resume(TPMBackend *tb, size_t buffersize,
+                                     bool is_resume)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_init init = {
+        .u.req.init_flags = 0,
+    };
+    ptm_res res;
+
+    trace_tpm_emulator_startup_tpm_resume(is_resume, buffersize);
+
+    if (buffersize != 0 &&
+        tpm_emulator_set_buffer_size(tb, buffersize, NULL) < 0) {
+        goto err_exit;
+    }
+
+    if (is_resume) {
+        init.u.req.init_flags |= cpu_to_be32(PTM_INIT_FLAG_DELETE_VOLATILE);
+    }
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init),
+                             sizeof(init)) < 0) {
+        error_report("tpm-emulator: could not send INIT: %s",
+                     strerror(errno));
+        goto err_exit;
+    }
+
+    res = be32_to_cpu(init.u.resp.tpm_result);
+    if (res) {
+        error_report("tpm-emulator: TPM result for CMD_INIT: 0x%x %s", res,
+                     tpm_emulator_strerror(res));
+        goto err_exit;
+    }
+    return 0;
+
+err_exit:
+    return -1;
+}
+
+static int tpm_emulator_startup_tpm(TPMBackend *tb, size_t buffersize)
+{
+    return tpm_emulator_startup_tpm_resume(tb, buffersize, false);
+}
+
+static bool tpm_emulator_get_tpm_established_flag(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_est est;
+
+    if (tpm_emu->established_flag_cached) {
+        return tpm_emu->established_flag;
+    }
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_TPMESTABLISHED, &est,
+                             0, sizeof(est)) < 0) {
+        error_report("tpm-emulator: Could not get the TPM established flag: %s",
+                     strerror(errno));
+        return false;
+    }
+    trace_tpm_emulator_get_tpm_established_flag(est.u.resp.bit);
+
+    tpm_emu->established_flag_cached = 1;
+    tpm_emu->established_flag = (est.u.resp.bit != 0);
+
+    return tpm_emu->established_flag;
+}
+
+static int tpm_emulator_reset_tpm_established_flag(TPMBackend *tb,
+                                                   uint8_t locty)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_reset_est reset_est;
+    ptm_res res;
+
+    /* only a TPM 2.0 will support this */
+    if (tpm_emu->tpm_version != TPM_VERSION_2_0) {
+        return 0;
+    }
+
+    reset_est.u.req.loc = tpm_emu->cur_locty_number;
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_RESET_TPMESTABLISHED,
+                             &reset_est, sizeof(reset_est),
+                             sizeof(reset_est)) < 0) {
+        error_report("tpm-emulator: Could not reset the establishment bit: %s",
+                     strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(reset_est.u.resp.tpm_result);
+    if (res) {
+        error_report(
+            "tpm-emulator: TPM result for rest established flag: 0x%x %s",
+            res, tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    tpm_emu->established_flag_cached = 0;
+
+    return 0;
+}
+
+static void tpm_emulator_cancel_cmd(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    ptm_res res;
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, PTM_CAP_CANCEL_TPM_CMD)) {
+        trace_tpm_emulator_cancel_cmd_not_supt();
+        return;
+    }
+
+    /* FIXME: make the function non-blocking, or it may block a VCPU */
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_CANCEL_TPM_CMD, &res, 0,
+                             sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not cancel command: %s",
+                     strerror(errno));
+    } else if (res != 0) {
+        error_report("tpm-emulator: Failed to cancel TPM: 0x%x",
+                     be32_to_cpu(res));
+    }
+}
+
+static TPMVersion tpm_emulator_get_tpm_version(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    return tpm_emu->tpm_version;
+}
+
+static size_t tpm_emulator_get_buffer_size(TPMBackend *tb)
+{
+    size_t actual_size;
+
+    if (tpm_emulator_set_buffer_size(tb, 0, &actual_size) < 0) {
+        return 4096;
+    }
+
+    return actual_size;
+}
+
+static int tpm_emulator_block_migration(TPMEmulator *tpm_emu)
+{
+    Error *err = NULL;
+    ptm_cap caps = PTM_CAP_GET_STATEBLOB | PTM_CAP_SET_STATEBLOB |
+                   PTM_CAP_STOP;
+
+    if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, caps)) {
+        error_setg(&tpm_emu->migration_blocker,
+                   "Migration disabled: TPM emulator does not support "
+                   "migration");
+        migrate_add_blocker(tpm_emu->migration_blocker, &err);
+        if (err) {
+            error_report_err(err);
+            error_free(tpm_emu->migration_blocker);
+            tpm_emu->migration_blocker = NULL;
+
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int tpm_emulator_prepare_data_fd(TPMEmulator *tpm_emu)
+{
+    ptm_res res;
+    Error *err = NULL;
+    int fds[2] = { -1, -1 };
+
+    if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
+        error_report("tpm-emulator: Failed to create socketpair");
+        return -1;
+    }
+
+    qemu_chr_fe_set_msgfds(&tpm_emu->ctrl_chr, fds + 1, 1);
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_DATAFD, &res, 0,
+                             sizeof(res)) < 0 || res != 0) {
+        error_report("tpm-emulator: Failed to send CMD_SET_DATAFD: %s",
+                     strerror(errno));
+        goto err_exit;
+    }
+
+    tpm_emu->data_ioc = QIO_CHANNEL(qio_channel_socket_new_fd(fds[0], &err));
+    if (err) {
+        error_prepend(&err, "tpm-emulator: Failed to create io channel: ");
+        error_report_err(err);
+        goto err_exit;
+    }
+
+    closesocket(fds[1]);
+
+    return 0;
+
+err_exit:
+    closesocket(fds[0]);
+    closesocket(fds[1]);
+    return -1;
+}
+
+static int tpm_emulator_handle_device_opts(TPMEmulator *tpm_emu, QemuOpts *opts)
+{
+    const char *value;
+
+    value = qemu_opt_get(opts, "chardev");
+    if (value) {
+        Error *err = NULL;
+        Chardev *dev = qemu_chr_find(value);
+
+        if (!dev) {
+            error_report("tpm-emulator: tpm chardev '%s' not found.", value);
+            goto err;
+        }
+
+        if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
+            error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
+                          value);
+            error_report_err(err);
+            goto err;
+        }
+
+        tpm_emu->options->chardev = g_strdup(value);
+    }
+
+    if (tpm_emulator_prepare_data_fd(tpm_emu) < 0) {
+        goto err;
+    }
+
+    /* FIXME: tpm_util_test_tpmdev() accepts only on socket fd, as it also used
+     * by passthrough driver, which not yet using GIOChannel.
+     */
+    if (tpm_util_test_tpmdev(QIO_CHANNEL_SOCKET(tpm_emu->data_ioc)->fd,
+                             &tpm_emu->tpm_version)) {
+        error_report("'%s' is not emulating TPM device. Error: %s",
+                      tpm_emu->options->chardev, strerror(errno));
+        goto err;
+    }
+
+    switch (tpm_emu->tpm_version) {
+    case TPM_VERSION_1_2:
+        trace_tpm_emulator_handle_device_opts_tpm12();
+        break;
+    case TPM_VERSION_2_0:
+        trace_tpm_emulator_handle_device_opts_tpm2();
+        break;
+    default:
+        trace_tpm_emulator_handle_device_opts_unspec();
+    }
+
+    if (tpm_emulator_probe_caps(tpm_emu) ||
+        tpm_emulator_check_caps(tpm_emu)) {
+        goto err;
+    }
+
+    return tpm_emulator_block_migration(tpm_emu);
+
+err:
+    trace_tpm_emulator_handle_device_opts_startup_error();
+
+    return -1;
+}
+
+static TPMBackend *tpm_emulator_create(QemuOpts *opts)
+{
+    TPMBackend *tb = TPM_BACKEND(object_new(TYPE_TPM_EMULATOR));
+
+    if (tpm_emulator_handle_device_opts(TPM_EMULATOR(tb), opts)) {
+        object_unref(OBJECT(tb));
+        return NULL;
+    }
+
+    return tb;
+}
+
+static TpmTypeOptions *tpm_emulator_get_tpm_options(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    TpmTypeOptions *options = g_new0(TpmTypeOptions, 1);
+
+    options->type = TPM_TYPE_OPTIONS_KIND_EMULATOR;
+    options->u.emulator.data = QAPI_CLONE(TPMEmulatorOptions, tpm_emu->options);
+
+    return options;
+}
+
+static const QemuOptDesc tpm_emulator_cmdline_opts[] = {
+    TPM_STANDARD_CMDLINE_OPTS,
+    {
+        .name = "chardev",
+        .type = QEMU_OPT_STRING,
+        .help = "Character device to use for out-of-band control messages",
+    },
+    { /* end of list */ },
+};
+
+/*
+ * Transfer a TPM state blob from the TPM into a provided buffer.
+ *
+ * @tpm_emu: TPMEmulator
+ * @type: the type of blob to transfer
+ * @tsb: the TPMSizeBuffer to fill with the blob
+ * @flags: the flags to return to the caller
+ */
+static int tpm_emulator_get_state_blob(TPMEmulator *tpm_emu,
+                                       uint8_t type,
+                                       TPMSizedBuffer *tsb,
+                                       uint32_t *flags)
+{
+    ptm_getstate pgs;
+    ptm_res res;
+    ssize_t n;
+    uint32_t totlength, length;
+
+    tpm_sized_buffer_reset(tsb);
+
+    pgs.u.req.state_flags = cpu_to_be32(PTM_STATE_FLAG_DECRYPTED);
+    pgs.u.req.type = cpu_to_be32(type);
+    pgs.u.req.offset = 0;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_STATEBLOB,
+                             &pgs, sizeof(pgs.u.req),
+                             offsetof(ptm_getstate, u.resp.data)) < 0) {
+        error_report("tpm-emulator: could not get state blob type %d : %s",
+                     type, strerror(errno));
+        return -1;
+    }
+
+    res = be32_to_cpu(pgs.u.resp.tpm_result);
+    if (res != 0 && (res & 0x800) == 0) {
+        error_report("tpm-emulator: Getting the stateblob (type %d) failed "
+                     "with a TPM error 0x%x %s", type, res,
+                     tpm_emulator_strerror(res));
+        return -1;
+    }
+
+    totlength = be32_to_cpu(pgs.u.resp.totlength);
+    length = be32_to_cpu(pgs.u.resp.length);
+    if (totlength != length) {
+        error_report("tpm-emulator: Expecting to read %u bytes "
+                     "but would get %u", totlength, length);
+        return -1;
+    }
+
+    *flags = be32_to_cpu(pgs.u.resp.state_flags);
+
+    if (totlength > 0) {
+        tsb->buffer = g_try_malloc(totlength);
+        if (!tsb->buffer) {
+            error_report("tpm-emulator: Out of memory allocating %u bytes",
+                         totlength);
+            return -1;
+        }
+
+        n = qemu_chr_fe_read_all(&tpm_emu->ctrl_chr, tsb->buffer, totlength);
+        if (n != totlength) {
+            error_report("tpm-emulator: Could not read stateblob (type %d); "
+                         "expected %u bytes, got %zd",
+                         type, totlength, n);
+            return -1;
+        }
+    }
+    tsb->size = totlength;
+
+    trace_tpm_emulator_get_state_blob(type, tsb->size, *flags);
+
+    return 0;
+}
+
+static int tpm_emulator_get_state_blobs(TPMEmulator *tpm_emu)
+{
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    if (tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_PERMANENT,
+                                    &state_blobs->permanent,
+                                    &state_blobs->permanent_flags) < 0 ||
+        tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_VOLATILE,
+                                    &state_blobs->volatil,
+                                    &state_blobs->volatil_flags) < 0 ||
+        tpm_emulator_get_state_blob(tpm_emu, PTM_BLOB_TYPE_SAVESTATE,
+                                    &state_blobs->savestate,
+                                    &state_blobs->savestate_flags) < 0) {
+        goto err_exit;
+    }
+
+    return 0;
+
+ err_exit:
+    tpm_sized_buffer_reset(&state_blobs->volatil);
+    tpm_sized_buffer_reset(&state_blobs->permanent);
+    tpm_sized_buffer_reset(&state_blobs->savestate);
+
+    return -1;
+}
+
+/*
+ * Transfer a TPM state blob to the TPM emulator.
+ *
+ * @tpm_emu: TPMEmulator
+ * @type: the type of TPM state blob to transfer
+ * @tsb: TPMSizedBuffer containing the TPM state blob
+ * @flags: Flags describing the (encryption) state of the TPM state blob
+ */
+static int tpm_emulator_set_state_blob(TPMEmulator *tpm_emu,
+                                       uint32_t type,
+                                       TPMSizedBuffer *tsb,
+                                       uint32_t flags)
+{
+    ssize_t n;
+    ptm_setstate pss;
+    ptm_res tpm_result;
+
+    if (tsb->size == 0) {
+        return 0;
+    }
+
+    pss = (ptm_setstate) {
+        .u.req.state_flags = cpu_to_be32(flags),
+        .u.req.type = cpu_to_be32(type),
+        .u.req.length = cpu_to_be32(tsb->size),
+    };
+
+    /* write the header only */
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_STATEBLOB, &pss,
+                             offsetof(ptm_setstate, u.req.data), 0) < 0) {
+        error_report("tpm-emulator: could not set state blob type %d : %s",
+                     type, strerror(errno));
+        return -1;
+    }
+
+    /* now the body */
+    n = qemu_chr_fe_write_all(&tpm_emu->ctrl_chr, tsb->buffer, tsb->size);
+    if (n != tsb->size) {
+        error_report("tpm-emulator: Writing the stateblob (type %d) "
+                     "failed; could not write %u bytes, but only %zd",
+                     type, tsb->size, n);
+        return -1;
+    }
+
+    /* now get the result */
+    n = qemu_chr_fe_read_all(&tpm_emu->ctrl_chr,
+                             (uint8_t *)&pss, sizeof(pss.u.resp));
+    if (n != sizeof(pss.u.resp)) {
+        error_report("tpm-emulator: Reading response from writing stateblob "
+                     "(type %d) failed; expected %zu bytes, got %zd", type,
+                     sizeof(pss.u.resp), n);
+        return -1;
+    }
+
+    tpm_result = be32_to_cpu(pss.u.resp.tpm_result);
+    if (tpm_result != 0) {
+        error_report("tpm-emulator: Setting the stateblob (type %d) failed "
+                     "with a TPM error 0x%x %s", type, tpm_result,
+                     tpm_emulator_strerror(tpm_result));
+        return -1;
+    }
+
+    trace_tpm_emulator_set_state_blob(type, tsb->size, flags);
+
+    return 0;
+}
+
+/*
+ * Set all the TPM state blobs.
+ *
+ * Returns a negative errno code in case of error.
+ */
+static int tpm_emulator_set_state_blobs(TPMBackend *tb)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    trace_tpm_emulator_set_state_blobs();
+
+    if (tpm_emulator_stop_tpm(tb) < 0) {
+        trace_tpm_emulator_set_state_blobs_error("Could not stop TPM");
+        return -EIO;
+    }
+
+    if (tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_PERMANENT,
+                                    &state_blobs->permanent,
+                                    state_blobs->permanent_flags) < 0 ||
+        tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_VOLATILE,
+                                    &state_blobs->volatil,
+                                    state_blobs->volatil_flags) < 0 ||
+        tpm_emulator_set_state_blob(tpm_emu, PTM_BLOB_TYPE_SAVESTATE,
+                                    &state_blobs->savestate,
+                                    state_blobs->savestate_flags) < 0) {
+        return -EIO;
+    }
+
+    trace_tpm_emulator_set_state_blobs_done();
+
+    return 0;
+}
+
+static int tpm_emulator_pre_save(void *opaque)
+{
+    TPMBackend *tb = opaque;
+    TPMEmulator *tpm_emu = TPM_EMULATOR(tb);
+
+    trace_tpm_emulator_pre_save();
+
+    tpm_backend_finish_sync(tb);
+
+    /* get the state blobs from the TPM */
+    return tpm_emulator_get_state_blobs(tpm_emu);
+}
+
+/*
+ * Load the TPM state blobs into the TPM.
+ *
+ * Returns negative errno codes in case of error.
+ */
+static int tpm_emulator_post_load(void *opaque, int version_id)
+{
+    TPMBackend *tb = opaque;
+    int ret;
+
+    ret = tpm_emulator_set_state_blobs(tb);
+    if (ret < 0) {
+        return ret;
+    }
+
+    if (tpm_emulator_startup_tpm_resume(tb, 0, true) < 0) {
+        return -EIO;
+    }
+
+    return 0;
+}
+
+static const VMStateDescription vmstate_tpm_emulator = {
+    .name = "tpm-emulator",
+    .version_id = 0,
+    .pre_save = tpm_emulator_pre_save,
+    .post_load = tpm_emulator_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(state_blobs.permanent_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.permanent.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.permanent.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.permanent.size),
+
+        VMSTATE_UINT32(state_blobs.volatil_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.volatil.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.volatil.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.volatil.size),
+
+        VMSTATE_UINT32(state_blobs.savestate_flags, TPMEmulator),
+        VMSTATE_UINT32(state_blobs.savestate.size, TPMEmulator),
+        VMSTATE_VBUFFER_ALLOC_UINT32(state_blobs.savestate.buffer,
+                                     TPMEmulator, 0, 0,
+                                     state_blobs.savestate.size),
+
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void tpm_emulator_inst_init(Object *obj)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(obj);
+
+    trace_tpm_emulator_inst_init();
+
+    tpm_emu->options = g_new0(TPMEmulatorOptions, 1);
+    tpm_emu->cur_locty_number = ~0;
+    qemu_mutex_init(&tpm_emu->mutex);
+
+    vmstate_register(NULL, VMSTATE_INSTANCE_ID_ANY,
+                     &vmstate_tpm_emulator, obj);
+}
+
+/*
+ * Gracefully shut down the external TPM
+ */
+static void tpm_emulator_shutdown(TPMEmulator *tpm_emu)
+{
+    ptm_res res;
+
+    if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SHUTDOWN, &res, 0, sizeof(res)) < 0) {
+        error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s",
+                     strerror(errno));
+    } else if (res != 0) {
+        error_report("tpm-emulator: TPM result for shutdown: 0x%x %s",
+                     be32_to_cpu(res), tpm_emulator_strerror(be32_to_cpu(res)));
+    }
+}
+
+static void tpm_emulator_inst_finalize(Object *obj)
+{
+    TPMEmulator *tpm_emu = TPM_EMULATOR(obj);
+    TPMBlobBuffers *state_blobs = &tpm_emu->state_blobs;
+
+    tpm_emulator_shutdown(tpm_emu);
+
+    object_unref(OBJECT(tpm_emu->data_ioc));
+
+    qemu_chr_fe_deinit(&tpm_emu->ctrl_chr, false);
+
+    qapi_free_TPMEmulatorOptions(tpm_emu->options);
+
+    if (tpm_emu->migration_blocker) {
+        migrate_del_blocker(tpm_emu->migration_blocker);
+        error_free(tpm_emu->migration_blocker);
+    }
+
+    tpm_sized_buffer_reset(&state_blobs->volatil);
+    tpm_sized_buffer_reset(&state_blobs->permanent);
+    tpm_sized_buffer_reset(&state_blobs->savestate);
+
+    qemu_mutex_destroy(&tpm_emu->mutex);
+
+    vmstate_unregister(NULL, &vmstate_tpm_emulator, obj);
+}
+
+static void tpm_emulator_class_init(ObjectClass *klass, void *data)
+{
+    TPMBackendClass *tbc = TPM_BACKEND_CLASS(klass);
+
+    tbc->type = TPM_TYPE_EMULATOR;
+    tbc->opts = tpm_emulator_cmdline_opts;
+    tbc->desc = "TPM emulator backend driver";
+    tbc->create = tpm_emulator_create;
+    tbc->startup_tpm = tpm_emulator_startup_tpm;
+    tbc->cancel_cmd = tpm_emulator_cancel_cmd;
+    tbc->get_tpm_established_flag = tpm_emulator_get_tpm_established_flag;
+    tbc->reset_tpm_established_flag = tpm_emulator_reset_tpm_established_flag;
+    tbc->get_tpm_version = tpm_emulator_get_tpm_version;
+    tbc->get_buffer_size = tpm_emulator_get_buffer_size;
+    tbc->get_tpm_options = tpm_emulator_get_tpm_options;
+
+    tbc->handle_request = tpm_emulator_handle_request;
+}
+
+static const TypeInfo tpm_emulator_info = {
+    .name = TYPE_TPM_EMULATOR,
+    .parent = TYPE_TPM_BACKEND,
+    .instance_size = sizeof(TPMEmulator),
+    .class_init = tpm_emulator_class_init,
+    .instance_init = tpm_emulator_inst_init,
+    .instance_finalize = tpm_emulator_inst_finalize,
+};
+
+static void tpm_emulator_register(void)
+{
+    type_register_static(&tpm_emulator_info);
+}
+
+type_init(tpm_emulator_register)
diff --git a/backends/tpm/tpm_int.h b/backends/tpm/tpm_int.h
new file mode 100644
index 0000000000..ba6109306e
--- /dev/null
+++ b/backends/tpm/tpm_int.h
@@ -0,0 +1,88 @@
+/*
+ * TPM configuration
+ *
+ * Copyright (C) 2011-2013 IBM Corporation
+ *
+ * Authors:
+ *  Stefan Berger    <stefanb@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef BACKENDS_TPM_INT_H
+#define BACKENDS_TPM_INT_H
+
+#include "qemu/option.h"
+#include "sysemu/tpm.h"
+
+#define TPM_STANDARD_CMDLINE_OPTS \
+    { \
+        .name = "type", \
+        .type = QEMU_OPT_STRING, \
+        .help = "Type of TPM backend", \
+    }
+
+struct tpm_req_hdr {
+    uint16_t tag;
+    uint32_t len;
+    uint32_t ordinal;
+} QEMU_PACKED;
+
+struct tpm_resp_hdr {
+    uint16_t tag;
+    uint32_t len;
+    uint32_t errcode;
+} QEMU_PACKED;
+
+#define TPM_TAG_RQU_COMMAND       0xc1
+#define TPM_TAG_RQU_AUTH1_COMMAND 0xc2
+#define TPM_TAG_RQU_AUTH2_COMMAND 0xc3
+
+#define TPM_TAG_RSP_COMMAND       0xc4
+#define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
+#define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
+
+#define TPM_BAD_PARAMETER         3
+#define TPM_FAIL                  9
+#define TPM_KEYNOTFOUND           13
+#define TPM_BAD_PARAM_SIZE        25
+#define TPM_ENCRYPT_ERROR         32
+#define TPM_DECRYPT_ERROR         33
+#define TPM_BAD_KEY_PROPERTY      40
+#define TPM_BAD_MODE              44
+#define TPM_BAD_VERSION           46
+#define TPM_BAD_LOCALITY          61
+
+#define TPM_ORD_ContinueSelfTest  0x53
+#define TPM_ORD_GetTicks          0xf1
+#define TPM_ORD_GetCapability     0x65
+
+#define TPM_CAP_PROPERTY          0x05
+
+#define TPM_CAP_PROP_INPUT_BUFFER 0x124
+
+/* TPM2 defines */
+#define TPM2_ST_NO_SESSIONS       0x8001
+
+#define TPM2_CC_ReadClock         0x00000181
+#define TPM2_CC_GetCapability     0x0000017a
+
+#define TPM2_CAP_TPM_PROPERTIES   0x6
+
+#define TPM2_PT_MAX_COMMAND_SIZE  0x11e
+
+#define TPM_RC_INSUFFICIENT       0x9a
+#define TPM_RC_FAILURE            0x101
+#define TPM_RC_LOCALITY           0x907
+
+int tpm_util_get_buffer_size(int tpm_fd, TPMVersion tpm_version,
+                             size_t *buffersize);
+
+typedef struct TPMSizedBuffer {
+    uint32_t size;
+    uint8_t  *buffer;
+} TPMSizedBuffer;
+
+void tpm_sized_buffer_reset(TPMSizedBuffer *tsb);
+
+#endif /* BACKENDS_TPM_INT_H */
diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h
new file mode 100644
index 0000000000..f5f5c553a9
--- /dev/null
+++ b/backends/tpm/tpm_ioctl.h
@@ -0,0 +1,271 @@
+/*
+ * tpm_ioctl.h
+ *
+ * (c) Copyright IBM Corporation 2014, 2015.
+ *
+ * This file is licensed under the terms of the 3-clause BSD license
+ */
+
+#ifndef TPM_IOCTL_H
+#define TPM_IOCTL_H
+
+#include <sys/uio.h>
+#include <sys/ioctl.h>
+
+/*
+ * Every response from a command involving a TPM command execution must hold
+ * the ptm_res as the first element.
+ * ptm_res corresponds to the error code of a command executed by the TPM.
+ */
+
+typedef uint32_t ptm_res;
+
+/* PTM_GET_TPMESTABLISHED: get the establishment bit */
+struct ptm_est {
+    union {
+        struct {
+            ptm_res tpm_result;
+            unsigned char bit; /* TPM established bit */
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_RESET_TPMESTABLISHED: reset establishment bit */
+struct ptm_reset_est {
+    union {
+        struct {
+            uint8_t loc; /* locality to use */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_INIT */
+struct ptm_init {
+    union {
+        struct {
+            uint32_t init_flags; /* see definitions below */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* above init_flags */
+#define PTM_INIT_FLAG_DELETE_VOLATILE (1 << 0)
+    /* delete volatile state file after reading it */
+
+/* PTM_SET_LOCALITY */
+struct ptm_loc {
+    union {
+        struct {
+            uint8_t loc; /* locality to set */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/* PTM_HASH_DATA: hash given data */
+struct ptm_hdata {
+    union {
+        struct {
+            uint32_t length;
+            uint8_t data[4096];
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/*
+ * size of the TPM state blob to transfer; x86_64 can handle 8k,
+ * ppc64le only ~7k; keep the response below a 4k page size
+ */
+#define PTM_STATE_BLOB_SIZE (3 * 1024)
+
+/*
+ * The following is the data structure to get state blobs from the TPM.
+ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple reads
+ * with this ioctl and with adjusted offset are necessary. All bytes
+ * must be transferred and the transfer is done once the last byte has been
+ * returned.
+ * It is possible to use the read() interface for reading the data; however, the
+ * first bytes of the state blob will be part of the response to the ioctl(); a
+ * subsequent read() is only necessary if the total length (totlength) exceeds
+ * the number of received bytes. seek() is not supported.
+ */
+struct ptm_getstate {
+    union {
+        struct {
+            uint32_t state_flags; /* may be: PTM_STATE_FLAG_DECRYPTED */
+            uint32_t type;        /* which blob to pull */
+            uint32_t offset;      /* offset from where to read */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+            uint32_t state_flags; /* may be: PTM_STATE_FLAG_ENCRYPTED */
+            uint32_t totlength;   /* total length that will be transferred */
+            uint32_t length;      /* number of bytes in following buffer */
+            uint8_t  data[PTM_STATE_BLOB_SIZE];
+        } resp; /* response */
+    } u;
+};
+
+/* TPM state blob types */
+#define PTM_BLOB_TYPE_PERMANENT  1
+#define PTM_BLOB_TYPE_VOLATILE   2
+#define PTM_BLOB_TYPE_SAVESTATE  3
+
+/* state_flags above : */
+#define PTM_STATE_FLAG_DECRYPTED     1 /* on input:  get decrypted state */
+#define PTM_STATE_FLAG_ENCRYPTED     2 /* on output: state is encrypted */
+
+/*
+ * The following is the data structure to set state blobs in the TPM.
+ * If the size of the state blob exceeds the PTM_STATE_BLOB_SIZE, multiple
+ * 'writes' using this ioctl are necessary. The last packet is indicated
+ * by the length being smaller than the PTM_STATE_BLOB_SIZE.
+ * The very first packet may have a length indicator of '0' enabling
+ * a write() with all the bytes from a buffer. If the write() interface
+ * is used, a final ioctl with a non-full buffer must be made to indicate
+ * that all data were transferred (a write with 0 bytes would not work).
+ */
+struct ptm_setstate {
+    union {
+        struct {
+            uint32_t state_flags; /* may be PTM_STATE_FLAG_ENCRYPTED */
+            uint32_t type;        /* which blob to set */
+            uint32_t length;      /* length of the data;
+                                     use 0 on the first packet to
+                                     transfer using write() */
+            uint8_t data[PTM_STATE_BLOB_SIZE];
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+        } resp; /* response */
+    } u;
+};
+
+/*
+ * PTM_GET_CONFIG: Data structure to get runtime configuration information
+ * such as which keys are applied.
+ */
+struct ptm_getconfig {
+    union {
+        struct {
+            ptm_res tpm_result;
+            uint32_t flags;
+        } resp; /* response */
+    } u;
+};
+
+#define PTM_CONFIG_FLAG_FILE_KEY        0x1
+#define PTM_CONFIG_FLAG_MIGRATION_KEY   0x2
+
+/*
+ * PTM_SET_BUFFERSIZE: Set the buffer size to be used by the TPM.
+ * A 0 on input queries for the current buffer size. Any other
+ * number will try to set the buffer size. The returned number is
+ * the buffer size that will be used, which can be larger than the
+ * requested one, if it was below the minimum, or smaller than the
+ * requested one, if it was above the maximum.
+ */
+struct ptm_setbuffersize {
+    union {
+        struct {
+            uint32_t buffersize; /* 0 to query for current buffer size */
+        } req; /* request */
+        struct {
+            ptm_res tpm_result;
+            uint32_t buffersize; /* buffer size in use */
+            uint32_t minsize; /* min. supported buffer size */
+            uint32_t maxsize; /* max. supported buffer size */
+        } resp; /* response */
+    } u;
+};
+
+
+typedef uint64_t ptm_cap;
+typedef struct ptm_est ptm_est;
+typedef struct ptm_reset_est ptm_reset_est;
+typedef struct ptm_loc ptm_loc;
+typedef struct ptm_hdata ptm_hdata;
+typedef struct ptm_init ptm_init;
+typedef struct ptm_getstate ptm_getstate;
+typedef struct ptm_setstate ptm_setstate;
+typedef struct ptm_getconfig ptm_getconfig;
+typedef struct ptm_setbuffersize ptm_setbuffersize;
+
+/* capability flags returned by PTM_GET_CAPABILITY */
+#define PTM_CAP_INIT               (1)
+#define PTM_CAP_SHUTDOWN           (1 << 1)
+#define PTM_CAP_GET_TPMESTABLISHED (1 << 2)
+#define PTM_CAP_SET_LOCALITY       (1 << 3)
+#define PTM_CAP_HASHING            (1 << 4)
+#define PTM_CAP_CANCEL_TPM_CMD     (1 << 5)
+#define PTM_CAP_STORE_VOLATILE     (1 << 6)
+#define PTM_CAP_RESET_TPMESTABLISHED (1 << 7)
+#define PTM_CAP_GET_STATEBLOB      (1 << 8)
+#define PTM_CAP_SET_STATEBLOB      (1 << 9)
+#define PTM_CAP_STOP               (1 << 10)
+#define PTM_CAP_GET_CONFIG         (1 << 11)
+#define PTM_CAP_SET_DATAFD         (1 << 12)
+#define PTM_CAP_SET_BUFFERSIZE     (1 << 13)
+
+enum {
+    PTM_GET_CAPABILITY     = _IOR('P', 0, ptm_cap),
+    PTM_INIT               = _IOWR('P', 1, ptm_init),
+    PTM_SHUTDOWN           = _IOR('P', 2, ptm_res),
+    PTM_GET_TPMESTABLISHED = _IOR('P', 3, ptm_est),
+    PTM_SET_LOCALITY       = _IOWR('P', 4, ptm_loc),
+    PTM_HASH_START         = _IOR('P', 5, ptm_res),
+    PTM_HASH_DATA          = _IOWR('P', 6, ptm_hdata),
+    PTM_HASH_END           = _IOR('P', 7, ptm_res),
+    PTM_CANCEL_TPM_CMD     = _IOR('P', 8, ptm_res),
+    PTM_STORE_VOLATILE     = _IOR('P', 9, ptm_res),
+    PTM_RESET_TPMESTABLISHED = _IOWR('P', 10, ptm_reset_est),
+    PTM_GET_STATEBLOB      = _IOWR('P', 11, ptm_getstate),
+    PTM_SET_STATEBLOB      = _IOWR('P', 12, ptm_setstate),
+    PTM_STOP               = _IOR('P', 13, ptm_res),
+    PTM_GET_CONFIG         = _IOR('P', 14, ptm_getconfig),
+    PTM_SET_DATAFD         = _IOR('P', 15, ptm_res),
+    PTM_SET_BUFFERSIZE     = _IOWR('P', 16, ptm_setbuffersize),
+};
+
+/*
+ * Commands used by the non-CUSE TPMs
+ *
+ * All messages container big-endian data.
+ *
+ * The return messages only contain the 'resp' part of the unions
+ * in the data structures above. Besides that the limits in the
+ * buffers above (ptm_hdata:u.req.data and ptm_get_state:u.resp.data
+ * and ptm_set_state:u.req.data) are 0xffffffff.
+ */
+enum {
+    CMD_GET_CAPABILITY = 1,
+    CMD_INIT,
+    CMD_SHUTDOWN,
+    CMD_GET_TPMESTABLISHED,
+    CMD_SET_LOCALITY,
+    CMD_HASH_START,
+    CMD_HASH_DATA,
+    CMD_HASH_END,
+    CMD_CANCEL_TPM_CMD,
+    CMD_STORE_VOLATILE,
+    CMD_RESET_TPMESTABLISHED,
+    CMD_GET_STATEBLOB,
+    CMD_SET_STATEBLOB,
+    CMD_STOP,
+    CMD_GET_CONFIG,
+    CMD_SET_DATAFD,
+    CMD_SET_BUFFERSIZE,
+};
+
+#endif /* TPM_IOCTL_H */
diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c
new file mode 100644
index 0000000000..7403807ec4
--- /dev/null
+++ b/backends/tpm/tpm_passthrough.c
@@ -0,0 +1,405 @@
+/*
+ *  passthrough TPM driver
+ *
+ *  Copyright (c) 2010 - 2013 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ *  Copyright (C) 2011 IAIK, Graz University of Technology
+ *    Author: Andreas Niederl
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "qemu/error-report.h"
+#include "qemu/module.h"
+#include "qemu/sockets.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "tpm_int.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-tpm.h"
+#include "trace.h"
+
+#define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
+#define TPM_PASSTHROUGH(obj) \
+    OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
+
+/* data structures */
+struct TPMPassthruState {
+    TPMBackend parent;
+
+    TPMPassthroughOptions *options;
+    const char *tpm_dev;
+    int tpm_fd;
+    bool tpm_executing;
+    bool tpm_op_canceled;
+    int cancel_fd;
+
+    TPMVersion tpm_version;
+    size_t tpm_buffersize;
+};
+
+typedef struct TPMPassthruState TPMPassthruState;
+
+#define TPM_PASSTHROUGH_DEFAULT_DEVICE "/dev/tpm0"
+
+/* functions */
+
+static void tpm_passthrough_cancel_cmd(TPMBackend *tb);
+
+static int tpm_passthrough_unix_read(int fd, uint8_t *buf, uint32_t len)
+{
+    int ret;
+ reread:
+    ret = read(fd, buf, len);
+    if (ret < 0) {
+        if (errno != EINTR && errno != EAGAIN) {
+            return -1;
+        }
+        goto reread;
+    }
+    return ret;
+}
+
+static void tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt,
+                                         const uint8_t *in, uint32_t in_len,
+                                         uint8_t *out, uint32_t out_len,
+                                         bool *selftest_done, Error **errp)
+{
+    ssize_t ret;
+    bool is_selftest;
+
+    /* FIXME: protect shared variables or use other sync mechanism */
+    tpm_pt->tpm_op_canceled = false;
+    tpm_pt->tpm_executing = true;
+    *selftest_done = false;
+
+    is_selftest = tpm_util_is_selftest(in, in_len);
+
+    ret = qemu_write_full(tpm_pt->tpm_fd, in, in_len);
+    if (ret != in_len) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
+            error_setg_errno(errp, errno, "tpm_passthrough: error while "
+                             "transmitting data to TPM");
+        }
+        goto err_exit;
+    }
+
+    tpm_pt->tpm_executing = false;
+
+    ret = tpm_passthrough_unix_read(tpm_pt->tpm_fd, out, out_len);
+    if (ret < 0) {
+        if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) {
+            error_setg_errno(errp, errno, "tpm_passthrough: error while "
+                             "reading data from TPM");
+        }
+    } else if (ret < sizeof(struct tpm_resp_hdr) ||
+               tpm_cmd_get_size(out) != ret) {
+        ret = -1;
+        error_setg_errno(errp, errno, "tpm_passthrough: received invalid "
+                     "response packet from TPM");
+    }
+
+    if (is_selftest && (ret >= sizeof(struct tpm_resp_hdr))) {
+        *selftest_done = tpm_cmd_get_errcode(out) == 0;
+    }
+
+err_exit:
+    if (ret < 0) {
+        tpm_util_write_fatal_error_response(out, out_len);
+    }
+
+    tpm_pt->tpm_executing = false;
+}
+
+static void tpm_passthrough_handle_request(TPMBackend *tb, TPMBackendCmd *cmd,
+                                           Error **errp)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    trace_tpm_passthrough_handle_request(cmd);
+
+    tpm_passthrough_unix_tx_bufs(tpm_pt, cmd->in, cmd->in_len,
+                                 cmd->out, cmd->out_len, &cmd->selftest_done,
+                                 errp);
+}
+
+static void tpm_passthrough_reset(TPMBackend *tb)
+{
+    trace_tpm_passthrough_reset();
+
+    tpm_passthrough_cancel_cmd(tb);
+}
+
+static bool tpm_passthrough_get_tpm_established_flag(TPMBackend *tb)
+{
+    return false;
+}
+
+static int tpm_passthrough_reset_tpm_established_flag(TPMBackend *tb,
+                                                      uint8_t locty)
+{
+    /* only a TPM 2.0 will support this */
+    return 0;
+}
+
+static void tpm_passthrough_cancel_cmd(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+    int n;
+
+    /*
+     * As of Linux 3.7 the tpm_tis driver does not properly cancel
+     * commands on all TPM manufacturers' TPMs.
+     * Only cancel if we're busy so we don't cancel someone else's
+     * command, e.g., a command executed on the host.
+     */
+    if (tpm_pt->tpm_executing) {
+        if (tpm_pt->cancel_fd >= 0) {
+            tpm_pt->tpm_op_canceled = true;
+            n = write(tpm_pt->cancel_fd, "-", 1);
+            if (n != 1) {
+                error_report("Canceling TPM command failed: %s",
+                             strerror(errno));
+            }
+        } else {
+            error_report("Cannot cancel TPM command due to missing "
+                         "TPM sysfs cancel entry");
+        }
+    }
+}
+
+static TPMVersion tpm_passthrough_get_tpm_version(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    return tpm_pt->tpm_version;
+}
+
+static size_t tpm_passthrough_get_buffer_size(TPMBackend *tb)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+    int ret;
+
+    ret = tpm_util_get_buffer_size(tpm_pt->tpm_fd, tpm_pt->tpm_version,
+                                   &tpm_pt->tpm_buffersize);
+    if (ret < 0) {
+        tpm_pt->tpm_buffersize = 4096;
+    }
+    return tpm_pt->tpm_buffersize;
+}
+
+/*
+ * Unless path or file descriptor set has been provided by user,
+ * determine the sysfs cancel file following kernel documentation
+ * in Documentation/ABI/stable/sysfs-class-tpm.
+ * From /dev/tpm0 create /sys/class/tpm/tpm0/device/cancel
+ * before 4.0: /sys/class/misc/tpm0/device/cancel
+ */
+static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
+{
+    int fd = -1;
+    char *dev;
+    char path[PATH_MAX];
+
+    if (tpm_pt->options->cancel_path) {
+        fd = qemu_open(tpm_pt->options->cancel_path, O_WRONLY);
+        if (fd < 0) {
+            error_report("tpm_passthrough: Could not open TPM cancel path: %s",
+                         strerror(errno));
+        }
+        return fd;
+    }
+
+    dev = strrchr(tpm_pt->tpm_dev, '/');
+    if (!dev) {
+        error_report("tpm_passthrough: Bad TPM device path %s",
+                     tpm_pt->tpm_dev);
+        return -1;
+    }
+
+    dev++;
+    if (snprintf(path, sizeof(path), "/sys/class/tpm/%s/device/cancel",
+                 dev) < sizeof(path)) {
+        fd = qemu_open(path, O_WRONLY);
+        if (fd < 0) {
+            if (snprintf(path, sizeof(path), "/sys/class/misc/%s/device/cancel",
+                         dev) < sizeof(path)) {
+                fd = qemu_open(path, O_WRONLY);
+            }
+        }
+    }
+
+    if (fd < 0) {
+        error_report("tpm_passthrough: Could not guess TPM cancel path");
+    } else {
+        tpm_pt->options->cancel_path = g_strdup(path);
+    }
+
+    return fd;
+}
+
+static int
+tpm_passthrough_handle_device_opts(TPMPassthruState *tpm_pt, QemuOpts *opts)
+{
+    const char *value;
+
+    value = qemu_opt_get(opts, "cancel-path");
+    if (value) {
+        tpm_pt->options->cancel_path = g_strdup(value);
+        tpm_pt->options->has_cancel_path = true;
+    }
+
+    value = qemu_opt_get(opts, "path");
+    if (value) {
+        tpm_pt->options->has_path = true;
+        tpm_pt->options->path = g_strdup(value);
+    }
+
+    tpm_pt->tpm_dev = value ? value : TPM_PASSTHROUGH_DEFAULT_DEVICE;
+    tpm_pt->tpm_fd = qemu_open(tpm_pt->tpm_dev, O_RDWR);
+    if (tpm_pt->tpm_fd < 0) {
+        error_report("Cannot access TPM device using '%s': %s",
+                     tpm_pt->tpm_dev, strerror(errno));
+        return -1;
+    }
+
+    if (tpm_util_test_tpmdev(tpm_pt->tpm_fd, &tpm_pt->tpm_version)) {
+        error_report("'%s' is not a TPM device.",
+                     tpm_pt->tpm_dev);
+        return -1;
+    }
+
+    tpm_pt->cancel_fd = tpm_passthrough_open_sysfs_cancel(tpm_pt);
+    if (tpm_pt->cancel_fd < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+static TPMBackend *tpm_passthrough_create(QemuOpts *opts)
+{
+    Object *obj = object_new(TYPE_TPM_PASSTHROUGH);
+
+    if (tpm_passthrough_handle_device_opts(TPM_PASSTHROUGH(obj), opts)) {
+        object_unref(obj);
+        return NULL;
+    }
+
+    return TPM_BACKEND(obj);
+}
+
+static int tpm_passthrough_startup_tpm(TPMBackend *tb, size_t buffersize)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb);
+
+    if (buffersize && buffersize < tpm_pt->tpm_buffersize) {
+        error_report("Requested buffer size of %zu is smaller than host TPM's "
+                     "fixed buffer size of %zu",
+                     buffersize, tpm_pt->tpm_buffersize);
+        return -1;
+    }
+
+    return 0;
+}
+
+static TpmTypeOptions *tpm_passthrough_get_tpm_options(TPMBackend *tb)
+{
+    TpmTypeOptions *options = g_new0(TpmTypeOptions, 1);
+
+    options->type = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH;
+    options->u.passthrough.data = QAPI_CLONE(TPMPassthroughOptions,
+                                             TPM_PASSTHROUGH(tb)->options);
+
+    return options;
+}
+
+static const QemuOptDesc tpm_passthrough_cmdline_opts[] = {
+    TPM_STANDARD_CMDLINE_OPTS,
+    {
+        .name = "cancel-path",
+        .type = QEMU_OPT_STRING,
+        .help = "Sysfs file entry for canceling TPM commands",
+    },
+    {
+        .name = "path",
+        .type = QEMU_OPT_STRING,
+        .help = "Path to TPM device on the host",
+    },
+    { /* end of list */ },
+};
+
+static void tpm_passthrough_inst_init(Object *obj)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(obj);
+
+    tpm_pt->options = g_new0(TPMPassthroughOptions, 1);
+    tpm_pt->tpm_fd = -1;
+    tpm_pt->cancel_fd = -1;
+}
+
+static void tpm_passthrough_inst_finalize(Object *obj)
+{
+    TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(obj);
+
+    tpm_passthrough_cancel_cmd(TPM_BACKEND(obj));
+
+    if (tpm_pt->tpm_fd >= 0) {
+        qemu_close(tpm_pt->tpm_fd);
+    }
+    if (tpm_pt->cancel_fd >= 0) {
+        qemu_close(tpm_pt->cancel_fd);
+    }
+    qapi_free_TPMPassthroughOptions(tpm_pt->options);
+}
+
+static void tpm_passthrough_class_init(ObjectClass *klass, void *data)
+{
+    TPMBackendClass *tbc = TPM_BACKEND_CLASS(klass);
+
+    tbc->type = TPM_TYPE_PASSTHROUGH;
+    tbc->opts = tpm_passthrough_cmdline_opts;
+    tbc->desc = "Passthrough TPM backend driver";
+    tbc->create = tpm_passthrough_create;
+    tbc->startup_tpm = tpm_passthrough_startup_tpm;
+    tbc->reset = tpm_passthrough_reset;
+    tbc->cancel_cmd = tpm_passthrough_cancel_cmd;
+    tbc->get_tpm_established_flag = tpm_passthrough_get_tpm_established_flag;
+    tbc->reset_tpm_established_flag =
+        tpm_passthrough_reset_tpm_established_flag;
+    tbc->get_tpm_version = tpm_passthrough_get_tpm_version;
+    tbc->get_buffer_size = tpm_passthrough_get_buffer_size;
+    tbc->get_tpm_options = tpm_passthrough_get_tpm_options;
+    tbc->handle_request = tpm_passthrough_handle_request;
+}
+
+static const TypeInfo tpm_passthrough_info = {
+    .name = TYPE_TPM_PASSTHROUGH,
+    .parent = TYPE_TPM_BACKEND,
+    .instance_size = sizeof(TPMPassthruState),
+    .class_init = tpm_passthrough_class_init,
+    .instance_init = tpm_passthrough_inst_init,
+    .instance_finalize = tpm_passthrough_inst_finalize,
+};
+
+static void tpm_passthrough_register(void)
+{
+    type_register_static(&tpm_passthrough_info);
+}
+
+type_init(tpm_passthrough_register)
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
new file mode 100644
index 0000000000..cfc7572a61
--- /dev/null
+++ b/backends/tpm/tpm_util.c
@@ -0,0 +1,380 @@
+/*
+ * TPM utility functions
+ *
+ *  Copyright (c) 2010 - 2015 IBM Corporation
+ *  Authors:
+ *    Stefan Berger <stefanb@us.ibm.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "qapi/visitor.h"
+#include "tpm_int.h"
+#include "exec/memory.h"
+#include "hw/qdev-properties.h"
+#include "sysemu/tpm_backend.h"
+#include "sysemu/tpm_util.h"
+#include "trace.h"
+
+/* tpm backend property */
+
+static void get_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
+                    Error **errp)
+{
+    DeviceState *dev = DEVICE(obj);
+    TPMBackend **be = qdev_get_prop_ptr(dev, opaque);
+    char *p;
+
+    p = g_strdup(*be ? (*be)->id : "");
+    visit_type_str(v, name, &p, errp);
+    g_free(p);
+}
+
+static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
+                    Error **errp)
+{
+    DeviceState *dev = DEVICE(obj);
+    Error *local_err = NULL;
+    Property *prop = opaque;
+    TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
+    char *str;
+
+    if (dev->realized) {
+        qdev_prop_set_after_realize(dev, name, errp);
+        return;
+    }
+
+    visit_type_str(v, name, &str, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+
+    s = qemu_find_tpm_be(str);
+    if (s == NULL) {
+        error_setg(errp, "Property '%s.%s' can't find value '%s'",
+                   object_get_typename(obj), prop->name, str);
+    } else if (tpm_backend_init(s, TPM_IF(obj), errp) == 0) {
+        *be = s; /* weak reference, avoid cyclic ref */
+    }
+    g_free(str);
+}
+
+static void release_tpm(Object *obj, const char *name, void *opaque)
+{
+    DeviceState *dev = DEVICE(obj);
+    Property *prop = opaque;
+    TPMBackend **be = qdev_get_prop_ptr(dev, prop);
+
+    if (*be) {
+        tpm_backend_reset(*be);
+    }
+}
+
+const PropertyInfo qdev_prop_tpm = {
+    .name  = "str",
+    .description = "ID of a tpm to use as a backend",
+    .get   = get_tpm,
+    .set   = set_tpm,
+    .release = release_tpm,
+};
+
+/*
+ * Write an error message in the given output buffer.
+ */
+void tpm_util_write_fatal_error_response(uint8_t *out, uint32_t out_len)
+{
+    if (out_len >= sizeof(struct tpm_resp_hdr)) {
+        tpm_cmd_set_tag(out, TPM_TAG_RSP_COMMAND);
+        tpm_cmd_set_size(out, sizeof(struct tpm_resp_hdr));
+        tpm_cmd_set_error(out, TPM_FAIL);
+    }
+}
+
+bool tpm_util_is_selftest(const uint8_t *in, uint32_t in_len)
+{
+    if (in_len >= sizeof(struct tpm_req_hdr)) {
+        return tpm_cmd_get_ordinal(in) == TPM_ORD_ContinueSelfTest;
+    }
+
+    return false;
+}
+
+/*
+ * Send request to a TPM device. We expect a response within one second.
+ */
+static int tpm_util_request(int fd,
+                            const void *request,
+                            size_t requestlen,
+                            void *response,
+                            size_t responselen)
+{
+    fd_set readfds;
+    int n;
+    struct timeval tv = {
+        .tv_sec = 1,
+        .tv_usec = 0,
+    };
+
+    n = write(fd, request, requestlen);
+    if (n < 0) {
+        return -errno;
+    }
+    if (n != requestlen) {
+        return -EFAULT;
+    }
+
+    FD_ZERO(&readfds);
+    FD_SET(fd, &readfds);
+
+    /* wait for a second */
+    n = select(fd + 1, &readfds, NULL, NULL, &tv);
+    if (n != 1) {
+        return -errno;
+    }
+
+    n = read(fd, response, responselen);
+    if (n < sizeof(struct tpm_resp_hdr)) {
+        return -EFAULT;
+    }
+
+    /* check the header */
+    if (tpm_cmd_get_size(response) != n) {
+        return -EMSGSIZE;
+    }
+
+    return 0;
+}
+
+/*
+ * A basic test of a TPM device. We expect a well formatted response header
+ * (error response is fine).
+ */
+static int tpm_util_test(int fd,
+                         const void *request,
+                         size_t requestlen,
+                         uint16_t *return_tag)
+{
+    char buf[1024];
+    ssize_t ret;
+
+    ret = tpm_util_request(fd, request, requestlen,
+                           buf, sizeof(buf));
+    if (ret < 0) {
+        return ret;
+    }
+
+    *return_tag = tpm_cmd_get_tag(buf);
+
+    return 0;
+}
+
+/*
+ * Probe for the TPM device in the back
+ * Returns 0 on success with the version of the probed TPM set, 1 on failure.
+ */
+int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version)
+{
+    /*
+     * Sending a TPM1.2 command to a TPM2 should return a TPM1.2
+     * header (tag = 0xc4) and error code (TPM_BADTAG = 0x1e)
+     *
+     * Sending a TPM2 command to a TPM 2 will give a TPM 2 tag in the
+     * header.
+     * Sending a TPM2 command to a TPM 1.2 will give a TPM 1.2 tag
+     * in the header and an error code.
+     */
+    const struct tpm_req_hdr test_req = {
+        .tag = cpu_to_be16(TPM_TAG_RQU_COMMAND),
+        .len = cpu_to_be32(sizeof(test_req)),
+        .ordinal = cpu_to_be32(TPM_ORD_GetTicks),
+    };
+
+    const struct tpm_req_hdr test_req_tpm2 = {
+        .tag = cpu_to_be16(TPM2_ST_NO_SESSIONS),
+        .len = cpu_to_be32(sizeof(test_req_tpm2)),


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16216.39597 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJp-00075Y-2y; Fri, 30 Oct 2020 19:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16216.39597; Fri, 30 Oct 2020 19:44:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJo-00075Q-Vp; Fri, 30 Oct 2020 19:44:12 +0000
Received: by outflank-mailman (input) for mailman id 16216;
 Fri, 30 Oct 2020 19:44:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaJn-00075H-RK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 62d57f42-f3a5-4c0d-aa61-c83a87bd5a5e;
 Fri, 30 Oct 2020 19:44:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJm-0000yv-Dn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJm-0005sy-CM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaJn-00075H-RK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:11 +0000
X-Inumbo-ID: 62d57f42-f3a5-4c0d-aa61-c83a87bd5a5e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 62d57f42-f3a5-4c0d-aa61-c83a87bd5a5e;
	Fri, 30 Oct 2020 19:44:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OHY9O9VqNWWOJK4lLGazrVdyUyhCrZpY0Ff9n7ih/5s=; b=XrhzzAFblu49Jh0EfWj9TYwju0
	HHtDKqfkl+vFWAVMPpRspBXKYEMa7RxXz9Pl+wl5GbLZWMketsleeVG7npbo+t5/GINv1sxQX/6ie
	1OkOhNMBQeytRsHBiXgJJSRsbbK51w5S0FEMg6u6bUK/Omx1aX70GEGxvsQO4I9vkysk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJm-0000yv-Dn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJm-0005sy-CM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/acpi: Rework acpi_os_map_memory() and acpi_os_unmap_memory()
Message-Id: <E1kYaJm-0005sy-CM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:10 +0000

commit 1c4aa69ca1e1fad20b2158051eb152276d1eb973
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Sep 26 17:44:29 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 30 18:17:34 2020 +0000

    xen/acpi: Rework acpi_os_map_memory() and acpi_os_unmap_memory()
    
    The functions acpi_os_{un,}map_memory() are meant to be arch-agnostic
    while the __acpi_os_{un,}map_memory() are meant to be arch-specific.
    
    Currently, the former are still containing x86 specific code.
    
    To avoid this rather strange split, the generic helpers are reworked so
    they are arch-agnostic. This requires the introduction of a new helper
    __acpi_os_unmap_memory() that will undo any mapping done by
    __acpi_os_map_memory().
    
    Currently, the arch-helper for unmap is basically a no-op so it only
    returns whether the mapping was arch specific. But this will change
    in the future.
    
    Note that the x86 version of acpi_os_map_memory() was already able to
    able the 1MB region. Hence why there is no addition of new code.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Tested-by: Rahul Singh <rahul.singh@arm.com>
    Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 xen/arch/arm/acpi/lib.c | 12 ++++++++++++
 xen/arch/x86/acpi/lib.c | 18 ++++++++++++++++++
 xen/drivers/acpi/osl.c  | 34 ++++++++++++++++++----------------
 xen/include/xen/acpi.h  |  1 +
 4 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
index 4fc6e17322..fcc186b033 100644
--- a/xen/arch/arm/acpi/lib.c
+++ b/xen/arch/arm/acpi/lib.c
@@ -30,6 +30,10 @@ char *__acpi_map_table(paddr_t phys, unsigned long size)
     unsigned long base, offset, mapped_size;
     int idx;
 
+    /* No arch specific implementation after early boot */
+    if ( system_state >= SYS_STATE_boot )
+        return NULL;
+
     offset = phys & (PAGE_SIZE - 1);
     mapped_size = PAGE_SIZE - offset;
     set_fixmap(FIXMAP_ACPI_BEGIN, maddr_to_mfn(phys), PAGE_HYPERVISOR);
@@ -49,6 +53,14 @@ char *__acpi_map_table(paddr_t phys, unsigned long size)
     return ((char *) base + offset);
 }
 
+bool __acpi_unmap_table(const void *ptr, unsigned long size)
+{
+    vaddr_t vaddr = (vaddr_t)ptr;
+
+    return ((vaddr >= FIXMAP_ADDR(FIXMAP_ACPI_BEGIN)) &&
+            (vaddr < (FIXMAP_ADDR(FIXMAP_ACPI_END) + PAGE_SIZE)));
+}
+
 /* True to indicate PSCI 0.2+ is implemented */
 bool __init acpi_psci_present(void)
 {
diff --git a/xen/arch/x86/acpi/lib.c b/xen/arch/x86/acpi/lib.c
index 265b9ad819..a22414a05c 100644
--- a/xen/arch/x86/acpi/lib.c
+++ b/xen/arch/x86/acpi/lib.c
@@ -46,6 +46,10 @@ char *__acpi_map_table(paddr_t phys, unsigned long size)
 	if ((phys + size) <= (1 * 1024 * 1024))
 		return __va(phys);
 
+	/* No further arch specific implementation after early boot */
+	if (system_state >= SYS_STATE_boot)
+		return NULL;
+
 	offset = phys & (PAGE_SIZE - 1);
 	mapped_size = PAGE_SIZE - offset;
 	set_fixmap(FIX_ACPI_END, phys);
@@ -66,6 +70,20 @@ char *__acpi_map_table(paddr_t phys, unsigned long size)
 	return ((char *) base + offset);
 }
 
+bool __acpi_unmap_table(const void *ptr, unsigned long size)
+{
+	unsigned long vaddr = (unsigned long)ptr;
+
+	if ((vaddr >= DIRECTMAP_VIRT_START) &&
+	    (vaddr < DIRECTMAP_VIRT_END)) {
+		ASSERT(!((__pa(ptr) + size - 1) >> 20));
+		return true;
+	}
+
+	return ((vaddr >= __fix_to_virt(FIX_ACPI_END)) &&
+		(vaddr < (__fix_to_virt(FIX_ACPI_BEGIN) + PAGE_SIZE)));
+}
+
 unsigned int acpi_get_processor_id(unsigned int cpu)
 {
 	unsigned int acpiid, apicid;
diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
index 4c8bb7839e..389505f786 100644
--- a/xen/drivers/acpi/osl.c
+++ b/xen/drivers/acpi/osl.c
@@ -92,27 +92,29 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
 void __iomem *
 acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 {
-	if (system_state >= SYS_STATE_boot) {
-		mfn_t mfn = _mfn(PFN_DOWN(phys));
-		unsigned int offs = phys & (PAGE_SIZE - 1);
-
-		/* The low first Mb is always mapped on x86. */
-		if (IS_ENABLED(CONFIG_X86) && !((phys + size - 1) >> 20))
-			return __va(phys);
-		return __vmap(&mfn, PFN_UP(offs + size), 1, 1,
-			      ACPI_MAP_MEM_ATTR, VMAP_DEFAULT) + offs;
-	}
-	return __acpi_map_table(phys, size);
+	void *ptr;
+	mfn_t mfn = _mfn(PFN_DOWN(phys));
+	unsigned int offs = PAGE_OFFSET(phys);
+
+	/* Try the arch specific implementation first */
+	ptr = __acpi_map_table(phys, size);
+	if (ptr)
+		return ptr;
+
+	/* No common implementation for early boot map */
+	if (unlikely(system_state < SYS_STATE_boot))
+		return NULL;
+
+	ptr = __vmap(&mfn, PFN_UP(offs + size), 1, 1,
+		     ACPI_MAP_MEM_ATTR, VMAP_DEFAULT);
+
+	return !ptr ? NULL : (ptr + offs);
 }
 
 void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
 {
-	if (IS_ENABLED(CONFIG_X86) &&
-	    (unsigned long)virt >= DIRECTMAP_VIRT_START &&
-	    (unsigned long)virt < DIRECTMAP_VIRT_END) {
-		ASSERT(!((__pa(virt) + size - 1) >> 20));
+	if (__acpi_unmap_table(virt, size))
 		return;
-	}
 
 	if (system_state >= SYS_STATE_boot)
 		vunmap((void *)((unsigned long)virt & PAGE_MASK));
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index c945ab05c8..21d5e9feb5 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -68,6 +68,7 @@ typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, co
 
 unsigned int acpi_get_processor_id (unsigned int cpu);
 char * __acpi_map_table (paddr_t phys_addr, unsigned long size);
+bool __acpi_unmap_table(const void *ptr, unsigned long size);
 int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16218.39605 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJz-00077O-8t; Fri, 30 Oct 2020 19:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16218.39605; Fri, 30 Oct 2020 19:44:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaJz-00077G-5x; Fri, 30 Oct 2020 19:44:23 +0000
Received: by outflank-mailman (input) for mailman id 16218;
 Fri, 30 Oct 2020 19:44:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaJx-000774-KT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 70b6ba02-2e51-4cd2-acea-79398233f58f;
 Fri, 30 Oct 2020 19:44:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJw-0000yy-Ig
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaJw-0005uK-GI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaJx-000774-KT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:21 +0000
X-Inumbo-ID: 70b6ba02-2e51-4cd2-acea-79398233f58f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 70b6ba02-2e51-4cd2-acea-79398233f58f;
	Fri, 30 Oct 2020 19:44:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tpHc9hVCuMj/k+oPOxeAQzP52pbnGWo9A4SlwsZz2oc=; b=o91lgvhOE5Fh0KrGSuD+s3wC0p
	qwIwwr9hG3Oyd0KBSyWxGVgHtNUkF5/O4l4K2WFq8TLyO7LCmSjk4ciboRAovJ0flkJda1l2ZnWqK
	YXuJ3YYv8ZeGdHYHO02tFIGDuaAtfXiMUNYhJoWYTyVqAZfOk/lcBQpG5g1nQ4KLL02s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJw-0000yy-Ig
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaJw-0005uK-GI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: acpi: The fixmap area should always be cleared during failure/unmap
Message-Id: <E1kYaJw-0005uK-GI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:20 +0000

commit 4d625ff3c3a939dc270b03654337568c30c5ab6e
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Sep 26 19:53:27 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 30 18:43:23 2020 +0000

    xen/arm: acpi: The fixmap area should always be cleared during failure/unmap
    
    Commit 022387ee1ad3 "xen/arm: mm: Don't open-code Xen PT update in
    {set, clear}_fixmap()" enforced that each set_fixmap() should be
    paired with a clear_fixmap(). Any failure to follow the model would
    result to a platform crash.
    
    Unfortunately, the use of fixmap in the ACPI code was overlooked as it
    is calling set_fixmap() but not clear_fixmap().
    
    The function __acpi_os_map_table() is reworked so:
        - We know before the mapping whether the fixmap region is big
        enough for the mapping.
        - It will fail if the fixmap is already in use. This is not a
        change of behavior but clarifying the current expectation to avoid
        hitting a BUG().
    
    The function __acpi_os_unmap_table() will now call clear_fixmap().
    
    Reported-by: Wei Xu <xuwei5@hisilicon.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/acpi/lib.c | 73 +++++++++++++++++++++++++++++++++++++------------
 1 file changed, 56 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/acpi/lib.c b/xen/arch/arm/acpi/lib.c
index fcc186b033..a59cc4074c 100644
--- a/xen/arch/arm/acpi/lib.c
+++ b/xen/arch/arm/acpi/lib.c
@@ -25,40 +25,79 @@
 #include <xen/init.h>
 #include <xen/mm.h>
 
+static bool fixmap_inuse;
+
 char *__acpi_map_table(paddr_t phys, unsigned long size)
 {
-    unsigned long base, offset, mapped_size;
-    int idx;
+    unsigned long base, offset;
+    mfn_t mfn;
+    unsigned int idx;
 
     /* No arch specific implementation after early boot */
     if ( system_state >= SYS_STATE_boot )
         return NULL;
 
     offset = phys & (PAGE_SIZE - 1);
-    mapped_size = PAGE_SIZE - offset;
-    set_fixmap(FIXMAP_ACPI_BEGIN, maddr_to_mfn(phys), PAGE_HYPERVISOR);
-    base = FIXMAP_ADDR(FIXMAP_ACPI_BEGIN);
+    base = FIXMAP_ADDR(FIXMAP_ACPI_BEGIN) + offset;
+
+    /* Check the fixmap is big enough to map the region */
+    if ( (FIXMAP_ADDR(FIXMAP_ACPI_END) + PAGE_SIZE - base) < size )
+        return NULL;
+
+    /* With the fixmap, we can only map one region at the time */
+    if ( fixmap_inuse )
+        return NULL;
 
-    /* Most cases can be covered by the below. */
+    fixmap_inuse = true;
+
+    size += offset;
+    mfn = maddr_to_mfn(phys);
     idx = FIXMAP_ACPI_BEGIN;
-    while ( mapped_size < size )
-    {
-        if ( ++idx > FIXMAP_ACPI_END )
-            return NULL;    /* cannot handle this */
-        phys += PAGE_SIZE;
-        set_fixmap(idx, maddr_to_mfn(phys), PAGE_HYPERVISOR);
-        mapped_size += PAGE_SIZE;
-    }
 
-    return ((char *) base + offset);
+    do {
+        set_fixmap(idx, mfn, PAGE_HYPERVISOR);
+        size -= min(size, (unsigned long)PAGE_SIZE);
+        mfn = mfn_add(mfn, 1);
+        idx++;
+    } while ( size > 0 );
+
+    return (char *)base;
 }
 
 bool __acpi_unmap_table(const void *ptr, unsigned long size)
 {
     vaddr_t vaddr = (vaddr_t)ptr;
+    unsigned int idx;
+
+    /* We are only handling fixmap address in the arch code */
+    if ( (vaddr < FIXMAP_ADDR(FIXMAP_ACPI_BEGIN)) ||
+         (vaddr >= (FIXMAP_ADDR(FIXMAP_ACPI_END) + PAGE_SIZE)) )
+        return false;
+
+    /*
+     * __acpi_map_table() will always return a pointer in the first page
+     * for the ACPI fixmap region. The caller is expected to free with
+     * the same address.
+     */
+    ASSERT((vaddr & PAGE_MASK) == FIXMAP_ADDR(FIXMAP_ACPI_BEGIN));
+
+    /* The region allocated fit in the ACPI fixmap region. */
+    ASSERT(size < (FIXMAP_ADDR(FIXMAP_ACPI_END) + PAGE_SIZE - vaddr));
+    ASSERT(fixmap_inuse);
+
+    fixmap_inuse = false;
+
+    size += vaddr - FIXMAP_ADDR(FIXMAP_ACPI_BEGIN);
+    idx = FIXMAP_ACPI_BEGIN;
+
+    do
+    {
+        clear_fixmap(idx);
+        size -= min(size, (unsigned long)PAGE_SIZE);
+        idx++;
+    } while ( size > 0 );
 
-    return ((vaddr >= FIXMAP_ADDR(FIXMAP_ACPI_BEGIN)) &&
-            (vaddr < (FIXMAP_ADDR(FIXMAP_ACPI_END) + PAGE_SIZE)));
+    return true;
 }
 
 /* True to indicate PSCI 0.2+ is implemented */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16219.39609 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaK9-00078y-Ab; Fri, 30 Oct 2020 19:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16219.39609; Fri, 30 Oct 2020 19:44:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaK9-00078q-7T; Fri, 30 Oct 2020 19:44:33 +0000
Received: by outflank-mailman (input) for mailman id 16219;
 Fri, 30 Oct 2020 19:44:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaK7-00078Z-GF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c2cdcffe-be6e-4516-bdeb-d08a5d8b804d;
 Fri, 30 Oct 2020 19:44:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaK6-0000zA-M7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaK6-0005vR-L9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaK7-00078Z-GF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:31 +0000
X-Inumbo-ID: c2cdcffe-be6e-4516-bdeb-d08a5d8b804d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c2cdcffe-be6e-4516-bdeb-d08a5d8b804d;
	Fri, 30 Oct 2020 19:44:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V5MZWmIdzqRz4zyAStJ2ZOqYKza0+MNyaGqEZ5uxOZw=; b=TVkjM0FI8pfuSsJL07Kdy8nY3i
	u51JICYENeSQGeDHuGFp5Pva2FtvwS1YjrUBYt23wY+F+i+4O1Yq7yPcnjz5HgZRtnIFuscESjB2c
	Q8fqh10XvAUqy6gi7023g3VBgs5G0GGjIExiGCwFGvBNVKL45QyBpNexg1PIbpG2BDv0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaK6-0000zA-M7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaK6-0005vR-L9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Check if the platform is not using ACPI before initializing Dom0less
Message-Id: <E1kYaK6-0005vR-L9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:30 +0000

commit dac867bf9adc1562a4cf9db5f89726597af13ef8
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Sep 26 21:16:55 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 30 18:43:42 2020 +0000

    xen/arm: Check if the platform is not using ACPI before initializing Dom0less
    
    Dom0less requires a device-tree. However, since commit 6e3e77120378
    "xen/arm: setup: Relocate the Device-Tree later on in the boot", the
    device-tree will not get unflatten when using ACPI.
    
    This will lead to a crash during boot.
    
    Given the complexity to setup dom0less with ACPI (for instance how to
    assign device?), we should skip any code related to Dom0less when using
    ACPI.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Tested-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Rahul Singh <rahul.singh@arm.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
    Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 xen/arch/arm/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index f16b33fa87..35e5bee04e 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -987,7 +987,8 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     system_state = SYS_STATE_active;
 
-    create_domUs();
+    if ( acpi_disabled )
+        create_domUs();
 
     domain_unpause_by_systemcontroller(dom0);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16220.39612 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaKJ-0007B4-Bs; Fri, 30 Oct 2020 19:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16220.39612; Fri, 30 Oct 2020 19:44:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaKJ-0007Au-8z; Fri, 30 Oct 2020 19:44:43 +0000
Received: by outflank-mailman (input) for mailman id 16220;
 Fri, 30 Oct 2020 19:44:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaKH-0007Ah-Ri
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 006cfe43-8ee8-4540-beb9-630a8a229bf5;
 Fri, 30 Oct 2020 19:44:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaKG-0000zr-Q7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaKG-0005wX-OZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaKH-0007Ah-Ri
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:41 +0000
X-Inumbo-ID: 006cfe43-8ee8-4540-beb9-630a8a229bf5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 006cfe43-8ee8-4540-beb9-630a8a229bf5;
	Fri, 30 Oct 2020 19:44:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FL+zU4TMcNeq9XOT0AwSjgnWFvVuwlxd41ro9vzbizo=; b=qQTEJwmGsr5QQourQiaaa+v9U5
	8t/pmBeeTrFvZboVI6l3xsQVS/F9pPFkId906W6CBljOmE5juFUm1dvjzGd4D7MJr+CZyTWVDulF4
	alwjIlqGsKSciVGz2zlFdX5wt7NLxUrnNedql3Ws0VueuRVrV5ZVcJ1WGBoqdvy/J8w0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaKG-0000zr-Q7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaKG-0005wX-OZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Introduce fw_unreserved_regions() and use it
Message-Id: <E1kYaKG-0005wX-OZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:40 +0000

commit 9c2bc0f24b2ba7082df408b3c33ec9a86bf20cf0
Author:     Julien Grall <jgrall@amazon.com>
AuthorDate: Sat Sep 26 21:30:14 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 30 18:43:42 2020 +0000

    xen/arm: Introduce fw_unreserved_regions() and use it
    
    Since commit 6e3e77120378 "xen/arm: setup: Relocate the Device-Tree
    later on in the boot", the device-tree will not be kept mapped when
    using ACPI.
    
    However, a few places are calling dt_unreserved_regions() which expects
    a valid DT. This will lead to a crash.
    
    As the DT should not be used for ACPI (other than for detecting the
    modules), a new function fw_unreserved_regions() is introduced.
    
    It will behave the same way on DT system. On ACPI system, it will
    unreserve the whole region.
    
    Take the opportunity to clarify that bootinfo.reserved_mem is only used
    when booting using Device-Tree.
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/kernel.c       |  2 +-
 xen/arch/arm/setup.c        | 22 +++++++++++++++++-----
 xen/include/asm-arm/setup.h |  3 ++-
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 032923853f..ab78689ed2 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -307,7 +307,7 @@ static __init int kernel_decompress(struct bootmodule *mod)
      * Free the original kernel, update the pointers to the
      * decompressed kernel
      */
-    dt_unreserved_regions(addr, addr + size, init_domheap_pages, 0);
+    fw_unreserved_regions(addr, addr + size, init_domheap_pages, 0);
 
     return 0;
 }
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 35e5bee04e..7fcff9af2a 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -196,8 +196,9 @@ static void __init processor_id(void)
     processor_setup();
 }
 
-void __init dt_unreserved_regions(paddr_t s, paddr_t e,
-                                  void (*cb)(paddr_t, paddr_t), int first)
+static void __init 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);
 
@@ -244,6 +245,17 @@ void __init dt_unreserved_regions(paddr_t s, paddr_t e,
     cb(s, e);
 }
 
+void __init fw_unreserved_regions(paddr_t s, paddr_t e,
+                                  void (*cb)(paddr_t, paddr_t), int first)
+{
+    if ( acpi_disabled )
+        dt_unreserved_regions(s, e, cb, first);
+    else
+        cb(s, e);
+}
+
+
+
 struct bootmodule __init *add_boot_module(bootmodule_kind kind,
                                           paddr_t start, paddr_t size,
                                           bool domU)
@@ -405,7 +417,7 @@ void __init discard_initial_modules(void)
              !mfn_valid(maddr_to_mfn(e)) )
             continue;
 
-        dt_unreserved_regions(s, e, init_domheap_pages, 0);
+        fw_unreserved_regions(s, e, init_domheap_pages, 0);
     }
 
     mi->nr_mods = 0;
@@ -712,7 +724,7 @@ static void __init setup_mm(void)
                 n = mfn_to_maddr(mfn_add(xenheap_mfn_start, xenheap_pages));
             }
 
-            dt_unreserved_regions(s, e, init_boot_pages, 0);
+            fw_unreserved_regions(s, e, init_boot_pages, 0);
 
             s = n;
         }
@@ -765,7 +777,7 @@ static void __init setup_mm(void)
             if ( e > bank_end )
                 e = bank_end;
 
-            dt_unreserved_regions(s, e, init_boot_pages, 0);
+            fw_unreserved_regions(s, e, init_boot_pages, 0);
             s = n;
         }
     }
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 2f8f24e286..28bf622aa1 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -67,6 +67,7 @@ struct bootcmdlines {
 
 struct bootinfo {
     struct meminfo mem;
+    /* The reserved regions are only used when booting using Device-Tree */
     struct meminfo reserved_mem;
     struct bootmodules modules;
     struct bootcmdlines cmdlines;
@@ -96,7 +97,7 @@ int construct_dom0(struct domain *d);
 void create_domUs(void);
 
 void discard_initial_modules(void);
-void dt_unreserved_regions(paddr_t s, paddr_t e,
+void fw_unreserved_regions(paddr_t s, paddr_t e,
                            void (*cb)(paddr_t, paddr_t), int first);
 
 size_t boot_fdt_info(const void *fdt, paddr_t paddr);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:44:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16221.39617 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaKT-0007Cb-Db; Fri, 30 Oct 2020 19:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16221.39617; Fri, 30 Oct 2020 19:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaKT-0007CR-AV; Fri, 30 Oct 2020 19:44:53 +0000
Received: by outflank-mailman (input) for mailman id 16221;
 Fri, 30 Oct 2020 19:44:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaKR-0007CH-Vp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f05abc0-044d-4525-80a9-d2602f0411c3;
 Fri, 30 Oct 2020 19:44:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaKQ-000101-TY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaKQ-0005xv-Sh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaKR-0007CH-Vp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:52 +0000
X-Inumbo-ID: 4f05abc0-044d-4525-80a9-d2602f0411c3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f05abc0-044d-4525-80a9-d2602f0411c3;
	Fri, 30 Oct 2020 19:44:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M/mv2ENWKXPbDZ9CS0YZib8XCE26Nozw7lxiUICzxBI=; b=mdyk5gFwOhyroundr8J4UjUY98
	6/LlHWumeRwW0E6cn2/cO7q3GrwKS+MuraAIagw9ol1/D8ZjXEiggHjsNz2DCnJ9aPjyyhG8iWMWC
	E2njt+ze0gSzyk79LKOL7clDZipWyn9gB7sTVIi8Xv/KF/j58RahA8GvjKA+F7mlzxAM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaKQ-000101-TY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaKQ-0005xv-Sh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:44:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: acpi: add BAD_MADT_GICC_ENTRY() macro
Message-Id: <E1kYaKQ-0005xv-Sh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:44:50 +0000

commit 7056f2f89f03f2f804ac7e776c7b2b000cd716cd
Author:     Julien Grall <julien.grall@arm.com>
AuthorDate: Wed Sep 30 12:25:04 2020 +0100
Commit:     Julien Grall <jgrall@amazon.com>
CommitDate: Fri Oct 30 18:47:14 2020 +0000

    xen/arm: acpi: add BAD_MADT_GICC_ENTRY() macro
    
    Imported from Linux commit b6cfb277378ef831c0fa84bcff5049307294adc6:
    
        The BAD_MADT_ENTRY() macro is designed to work for all of the subtables
        of the MADT.  In the ACPI 5.1 version of the spec, the struct for the
        GICC subtable (struct acpi_madt_generic_interrupt) is 76 bytes long; in
        ACPI 6.0, the struct is 80 bytes long.  But, there is only one definition
        in ACPICA for this struct -- and that is the 6.0 version.  Hence, when
        BAD_MADT_ENTRY() compares the struct size to the length in the GICC
        subtable, it fails if 5.1 structs are in use, and there are systems in
        the wild that have them.
    
        This patch adds the BAD_MADT_GICC_ENTRY() that checks the GICC subtable
        only, accounting for the difference in specification versions that are
        possible.  The BAD_MADT_ENTRY() will continue to work as is for all other
        MADT subtables.
    
        This code is being added to an arm64 header file since that is currently
        the only architecture using the GICC subtable of the MADT.  As a GIC is
        specific to ARM, it is also unlikely the subtable will be used elsewhere.
    
        Fixes: aeb823bbacc2 ("ACPICA: ACPI 6.0: Add changes for FADT table.")
        Signed-off-by: Al Stone <al.stone@linaro.org>
        Acked-by: Will Deacon <will.deacon@arm.com>
        Acked-by: "Rafael J. Wysocki" <rjw@rjwysocki.net>
        [catalin.marinas@arm.com: extra brackets around macro arguments]
        Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    
    Signed-off-by: Julien Grall <julien.grall@arm.com>
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    Signed-off-by: Julien Grall <jgrall@amazon.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
    Tested-by: Elliott Mitchell <ehem+xen@m5p.com>
---
 xen/include/asm-arm/acpi.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/include/asm-arm/acpi.h b/xen/include/asm-arm/acpi.h
index 50340281a9..b52ae2d6ef 100644
--- a/xen/include/asm-arm/acpi.h
+++ b/xen/include/asm-arm/acpi.h
@@ -54,6 +54,14 @@ void acpi_smp_init_cpus(void);
  */
 paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
 
+/* Macros for consistency checks of the GICC subtable of MADT */
+#define ACPI_MADT_GICC_LENGTH	\
+    (acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
+
+#define BAD_MADT_GICC_ENTRY(entry, end)						\
+    (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
+     (entry)->header.length != ACPI_MADT_GICC_LENGTH)
+
 #ifdef CONFIG_ACPI
 extern bool acpi_disabled;
 /* Basic configuration for ACPI */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 19:55:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 19:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16223.39627 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaUQ-00083w-9G; Fri, 30 Oct 2020 19:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16223.39627; Fri, 30 Oct 2020 19:55:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaUQ-00083k-5r; Fri, 30 Oct 2020 19:55:10 +0000
Received: by outflank-mailman (input) for mailman id 16223;
 Fri, 30 Oct 2020 19:55:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaUO-00083b-Co
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9a4317c3-54ba-4b94-94bf-47d25393686b;
 Fri, 30 Oct 2020 19:55:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaUM-0001Ce-LD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaUM-0006rB-IB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaUO-00083b-Co
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:08 +0000
X-Inumbo-ID: 9a4317c3-54ba-4b94-94bf-47d25393686b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9a4317c3-54ba-4b94-94bf-47d25393686b;
	Fri, 30 Oct 2020 19:55:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D3ndvOEJM/yellajk1bCxhKJ+x+sNJVyd4eC1+U+G5Q=; b=zk/tKDTeoAeFBhdgVip61AjAY+
	/vOl6w1S6UCfnRu6me2htJ2XRteqUQRT+L3JnzL4rZWRQlW1cArBf5dcmOKMnYEnyO3jPCDRx+oAm
	ky/xLXvG/X4oxbvnTewSMkNY+7rghTgWTxMnsACSdWh7oczD9sE4ZKVMoifn5wGK+y7U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaUM-0001Ce-LD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaUM-0006rB-IB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 19:55:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
Message-Id: <E1kYaUM-0006rB-IB@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 19:55:06 +0000

commit 78318119eead6aed050d1730a6b72d1c555302d2
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Wed Jul 1 21:15:30 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:39:19 2020 +0200

    target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
    
    The result of the get_physical_address() function should be combined with the
    offset of the original page access before being returned. Otherwise the
    m68k_cpu_get_phys_page_debug() function can round to the wrong page causing
    incorrect lookups in gdbstub and various "Disassembler disagrees with
    translator over instruction decoding" warnings to appear at translation time.
    
    Fixes: 88b2fef6c3 ("target/m68k: add MC68040 MMU")
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200701201531.13828-2-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/helper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 79b0b10ea9..631eab7774 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -820,10 +820,14 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     if (env->sr & SR_S) {
         access_type |= ACCESS_SUPER;
     }
+
     if (get_physical_address(env, &phys_addr, &prot,
                              addr, access_type, &page_size) != 0) {
         return -1;
     }
+
+    addr &= TARGET_PAGE_MASK;
+    phys_addr += addr & (page_size - 1);
     return phys_addr;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:00:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16225.39630 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaZE-0000Ro-Mt; Fri, 30 Oct 2020 20:00:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16225.39630; Fri, 30 Oct 2020 20:00:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaZE-0000RY-Il; Fri, 30 Oct 2020 20:00:08 +0000
Received: by outflank-mailman (input) for mailman id 16225;
 Fri, 30 Oct 2020 20:00:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaZC-0000Np-Uz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 643e8647-1b66-4a26-960f-e1760cc20855;
 Fri, 30 Oct 2020 20:00:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaZB-0001Ou-Pp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYaZB-0007Yl-Nx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaZC-0000Np-Uz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:06 +0000
X-Inumbo-ID: 643e8647-1b66-4a26-960f-e1760cc20855
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 643e8647-1b66-4a26-960f-e1760cc20855;
	Fri, 30 Oct 2020 20:00:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Noj7Qit6yR4EgYIecSsNVQdVqUVmOtr/CfuUmPOW6Bs=; b=zLqNrvvG8KTZp9rfATLQS+JFFM
	yFxaqzInhQNZ0LKYpjlW/GAiSM1C4gmmU4rGEjw4lh3T0fFPSev/9Axca0EPBSoSGY1xi1zBfYR4J
	zqXYlVih71kIw+NUHUhilshl+/zBXCN1RYpQKWMYqPFbH3ajySKIasCaYH2C5wrN/8Og=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaZB-0001Ou-Pp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYaZB-0007Yl-Nx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:00:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/m68k: consolidate physical translation offset into get_physical_address()
Message-Id: <E1kYaZB-0007Yl-Nx@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:00:05 +0000

commit 852002b5664bf079da05c5201dbf2345b870e5ed
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Wed Jul 1 21:15:31 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:39:57 2020 +0200

    target/m68k: consolidate physical translation offset into get_physical_address()
    
    Since all callers to get_physical_address() now apply the same page offset to
    the translation result, move the logic into get_physical_address() itself to
    avoid duplication.
    
    Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200701201531.13828-3-mark.cave-ayland@ilande.co.uk>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/helper.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 631eab7774..3ff5765795 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -643,7 +643,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
                 /* Transparent Translation Register bit */
                 env->mmu.mmusr = M68K_MMU_T_040 | M68K_MMU_R_040;
             }
-            *physical = address & TARGET_PAGE_MASK;
+            *physical = address;
             *page_size = TARGET_PAGE_SIZE;
             return 0;
         }
@@ -771,7 +771,7 @@ static int get_physical_address(CPUM68KState *env, hwaddr *physical,
     }
     *page_size = 1 << page_bits;
     page_mask = ~(*page_size - 1);
-    *physical = next & page_mask;
+    *physical = (next & page_mask) + (address & (*page_size - 1));
 
     if (access_type & ACCESS_PTEST) {
         env->mmu.mmusr |= next & M68K_MMU_SR_MASK_040;
@@ -826,8 +826,6 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
         return -1;
     }
 
-    addr &= TARGET_PAGE_MASK;
-    phys_addr += addr & (page_size - 1);
     return phys_addr;
 }
 
@@ -891,10 +889,8 @@ bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     ret = get_physical_address(&cpu->env, &physical, &prot,
                                address, access_type, &page_size);
     if (likely(ret == 0)) {
-        address &= TARGET_PAGE_MASK;
-        physical += address & (page_size - 1);
-        tlb_set_page(cs, address, physical,
-                     prot, mmu_idx, TARGET_PAGE_SIZE);
+        tlb_set_page(cs, address & TARGET_PAGE_MASK,
+                     physical & TARGET_PAGE_MASK, prot, mmu_idx, page_size);
         return true;
     }
 
@@ -1383,9 +1379,8 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
     ret = get_physical_address(env, &physical, &prot, addr,
                                access_type, &page_size);
     if (ret == 0) {
-        addr &= TARGET_PAGE_MASK;
-        physical += addr & (page_size - 1);
-        tlb_set_page(env_cpu(env), addr, physical,
+        tlb_set_page(env_cpu(env), addr & TARGET_PAGE_MASK,
+                     physical & TARGET_PAGE_MASK,
                      prot, access_type & ACCESS_SUPER ?
                      MMU_KERNEL_IDX : MMU_USER_IDX, page_size);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:11:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16228.39646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYajq-0001Qy-Q7; Fri, 30 Oct 2020 20:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16228.39646; Fri, 30 Oct 2020 20:11:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYajq-0001Qq-N3; Fri, 30 Oct 2020 20:11:06 +0000
Received: by outflank-mailman (input) for mailman id 16228;
 Fri, 30 Oct 2020 20:11:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYajq-0001Qi-Ao
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ba3f74e4-ffa7-4909-bc80-55b52cbd306b;
 Fri, 30 Oct 2020 20:11:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYajp-0001bn-8b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYajp-0000Mv-6V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYajq-0001Qi-Ao
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:06 +0000
X-Inumbo-ID: ba3f74e4-ffa7-4909-bc80-55b52cbd306b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ba3f74e4-ffa7-4909-bc80-55b52cbd306b;
	Fri, 30 Oct 2020 20:11:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ctDzAWa52zPdW28EujRxUTxHHd5fOrxlMsbymmgyqHI=; b=q4v7sHC3YhV8NujSYuMa8f3dvp
	+xE9okpEPnOailNpexOZ197SwNlmAr/IYOYJj79ijbdtpMvUntEr2hoF7p/FynzpMxk2+bVkdX+TV
	CTDOME3ZGPujKG+825+4g5PjpkLWE+F6LimVoLOszUL9jpDIor3MKZZT0ElBB95joHnY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYajp-0001bn-8b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYajp-0000Mv-6V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:11:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] softfloat,m68k: disable floatx80_invalid_encoding() for m68k
Message-Id: <E1kYajp-0000Mv-6V@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:11:05 +0000

commit d159dd058c7dc48a9291fde92eaae52a9f26a4d1
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jun 12 16:04:00 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 21:41:52 2020 +0200

    softfloat,m68k: disable floatx80_invalid_encoding() for m68k
    
    According to the comment, this definition of invalid encoding is given
    by intel developer's manual, and doesn't comply with 680x0 FPU.
    
    With m68k, the explicit integer bit can be zero in the case of:
     - zeros                (exp == 0, mantissa == 0)
     - denormalized numbers (exp == 0, mantissa != 0)
     - unnormalized numbers (exp != 0, exp < 0x7FFF)
     - infinities           (exp == 0x7FFF, mantissa == 0)
     - not-a-numbers        (exp == 0x7FFF, mantissa != 0)
    
    For infinities and NaNs, the explicit integer bit can be either one or
    zero.
    
    The IEEE 754 standard does not define a zero integer bit. Such a number
    is an unnormalized number. Hardware does not directly support
    denormalized and unnormalized numbers, but implicitly supports them by
    trapping them as unimplemented data types, allowing efficient conversion
    in software.
    
    See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL",
        "1.6 FLOATING-POINT DATA TYPES"
    
    We will implement in the m68k TCG emulator the FP_UNIMP exception to
    trap into the kernel to normalize the number. In case of linux-user,
    the number will be normalized by QEMU.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200612140400.2130118-1-laurent@vivier.eu>
---
 include/fpu/softfloat.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index ff4e2605b1..f1a19df066 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -794,7 +794,31 @@ static inline bool floatx80_unordered_quiet(floatx80 a, floatx80 b,
 *----------------------------------------------------------------------------*/
 static inline bool floatx80_invalid_encoding(floatx80 a)
 {
+#if defined(TARGET_M68K)
+    /*-------------------------------------------------------------------------
+    | With m68k, the explicit integer bit can be zero in the case of:
+    | - zeros                (exp == 0, mantissa == 0)
+    | - denormalized numbers (exp == 0, mantissa != 0)
+    | - unnormalized numbers (exp != 0, exp < 0x7FFF)
+    | - infinities           (exp == 0x7FFF, mantissa == 0)
+    | - not-a-numbers        (exp == 0x7FFF, mantissa != 0)
+    |
+    | For infinities and NaNs, the explicit integer bit can be either one or
+    | zero.
+    |
+    | The IEEE 754 standard does not define a zero integer bit. Such a number
+    | is an unnormalized number. Hardware does not directly support
+    | denormalized and unnormalized numbers, but implicitly supports them by
+    | trapping them as unimplemented data types, allowing efficient conversion
+    | in software.
+    |
+    | See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL",
+    |     "1.6 FLOATING-POINT DATA TYPES"
+    *------------------------------------------------------------------------*/
+    return false;
+#else
     return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0;
+#endif
 }
 
 #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:22:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16234.39650 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaua-0002Kv-LW; Fri, 30 Oct 2020 20:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16234.39650; Fri, 30 Oct 2020 20:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYaua-0002Ko-I3; Fri, 30 Oct 2020 20:22:12 +0000
Received: by outflank-mailman (input) for mailman id 16234;
 Fri, 30 Oct 2020 20:22:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYaua-0002Kj-2W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 592e3e05-956e-4f6b-857a-130cbbe7a865;
 Fri, 30 Oct 2020 20:22:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYauU-0001pD-7R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYauU-0001MG-6O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYaua-0002Kj-2W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:12 +0000
X-Inumbo-ID: 592e3e05-956e-4f6b-857a-130cbbe7a865
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 592e3e05-956e-4f6b-857a-130cbbe7a865;
	Fri, 30 Oct 2020 20:22:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M5/DpxINiohvVWrZDB2BURplsxEr6rYj/PbyYs5WoLs=; b=1n6hgxYpeLXv5ajlO34VLvp5YT
	p3igqZT9nZ1YvpS59TbD2dWofIoF5U1NfoNNkugN4YjP49kIQqie/jbSIoW3KTaW+Gdq9V4UFeVNN
	r+Cy67GaQjNSgjKXEm4o0pjyHieZrxRGRqYPJcaLaCV4pJzTlgZpGAF9m+vSDxblznHE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYauU-0001pD-7R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYauU-0001MG-6O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:22:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/vivier/tags/m68k-next-pull-request' into staging
Message-Id: <E1kYauU-0001MG-6O@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:22:06 +0000

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

commit 48f22ad04ead83e61b4b35871ec6f6109779b791
Merge: 8796c64ecdfd34be394ea277aaaaa53df0c76996 d159dd058c7dc48a9291fde92eaae52a9f26a4d1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 8 21:38:47 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 8 21:38:47 2020 +0100

    Merge remote-tracking branch 'remotes/vivier/tags/m68k-next-pull-request' into staging
    
    m68k pull-request 20200706
    
    disable floatx80_invalid_encoding() for m68k
    fix m68k_cpu_get_phys_page_debug()
    
    # gpg: Signature made Mon 06 Jul 2020 21:05:33 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier/tags/m68k-next-pull-request:
      softfloat,m68k: disable floatx80_invalid_encoding() for m68k
      target/m68k: consolidate physical translation offset into get_physical_address()
      target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                                 |   23 +-
 accel/kvm/kvm-all.c                         |    4 +-
 balloon.c                                   |   17 -
 block.c                                     |   19 +-
 block/Makefile.objs                         |    2 +-
 block/amend.c                               |  113 +
 block/block-copy.c                          |    4 +-
 block/crypto.c                              |  207 +-
 block/crypto.h                              |   37 +
 block/file-posix.c                          |    3 -
 block/io.c                                  |    8 +-
 block/iscsi.c                               |    1 -
 block/qcow2.c                               |  350 +-
 block/qed.c                                 |   65 +-
 block/qed.h                                 |    1 -
 block/vdi.c                                 |    3 +-
 block/vhdx.c                                |    3 -
 block/vpc.c                                 |    3 +-
 block/vvfat.c                               |   67 +-
 bsd-user/main.c                             |    6 +-
 configure                                   |   40 +-
 crypto/block-luks.c                         |  416 ++-
 crypto/block.c                              |   29 +
 crypto/blockpriv.h                          |    8 +
 docs/interop/index.rst                      |    1 +
 docs/interop/vhost-user.rst                 |   24 +
 docs/interop/vhost-vdpa.rst                 |   17 +
 docs/system/deprecated.rst                  |   20 +
 docs/system/target-i386-desc.rst.inc        |   13 +-
 docs/tools/qemu-img.rst                     |    5 +-
 docs/tools/virtiofsd.rst                    |    5 +
 exec.c                                      |   52 +
 hw/arm/fsl-imx6ul.c                         |   10 +
 hw/arm/mcimx6ul-evk.c                       |    2 +
 hw/arm/pxa2xx_pic.c                         |    9 +-
 hw/arm/spitz.c                              |  505 +--
 hw/arm/virt-acpi-build.c                    |    5 +-
 hw/arm/virt.c                               |   35 +
 hw/arm/z2.c                                 |   11 +-
 hw/audio/ac97.c                             |    9 +-
 hw/audio/adlib.c                            |    8 +-
 hw/audio/cs4231a.c                          |    8 +-
 hw/audio/es1370.c                           |    9 +-
 hw/audio/gus.c                              |    8 +-
 hw/audio/intel-hda.c                        |    3 +
 hw/audio/pcspk.c                            |   26 +-
 hw/audio/sb16.c                             |    9 +-
 hw/audio/soundhw.c                          |   24 +-
 hw/core/numa.c                              |   17 +-
 hw/core/qdev-properties.c                   |   89 +
 hw/display/ads7846.c                        |    9 +-
 hw/display/bcm2835_fb.c                     |    4 +
 hw/display/ssd0323.c                        |   10 +-
 hw/gpio/zaurus.c                            |   12 +-
 hw/i386/Kconfig                             |    1 +
 hw/i386/microvm.c                           |    1 +
 hw/i386/pc.c                                |   80 +-
 hw/i386/pc_piix.c                           |    4 +-
 hw/i386/pc_q35.c                            |    4 +-
 hw/isa/i82378.c                             |    2 +-
 hw/m68k/mcf5206.c                           |   39 +-
 hw/mips/jazz.c                              |    2 +-
 hw/misc/max111x.c                           |   86 +-
 hw/net/imx_fec.c                            |   24 +-
 hw/net/trace-events                         |    4 +-
 hw/net/vhost_net-stub.c                     |   11 +
 hw/net/vhost_net.c                          |   44 +-
 hw/net/virtio-net.c                         |   19 +
 hw/riscv/sifive_clint.c                     |    2 +-
 hw/riscv/sifive_plic.c                      |   20 +-
 hw/s390x/s390-pci-bus.c                     |   16 +-
 hw/s390x/s390-virtio-ccw.c                  |   22 +-
 hw/s390x/virtio-ccw.c                       |   18 +-
 hw/sd/ssi-sd.c                              |    4 +-
 hw/ssi/ssi.c                                |    7 +-
 hw/vfio/ap.c                                |    8 +-
 hw/vfio/ccw.c                               |   11 +-
 hw/vfio/common.c                            |   53 +-
 hw/vfio/pci.c                               |    6 +-
 hw/virtio/Kconfig                           |   11 +
 hw/virtio/Makefile.objs                     |    3 +
 hw/virtio/trace-events                      |   11 +
 hw/virtio/vhost-backend.c                   |    6 +
 hw/virtio/vhost-vdpa.c                      |  475 +++
 hw/virtio/vhost.c                           |   52 +-
 hw/virtio/virtio-balloon.c                  |   36 +-
 hw/virtio/virtio-iommu-pci.c                |   11 +
 hw/virtio/virtio-iommu.c                    |  114 +-
 hw/virtio/virtio-mem-pci.c                  |  157 +
 hw/virtio/virtio-mem-pci.h                  |   34 +
 hw/virtio/virtio-mem.c                      |  873 +++++
 hw/virtio/virtio-pci.c                      |   13 +
 hw/virtio/virtio.c                          |    6 +
 include/block/block.h                       |    7 +-
 include/block/block_int.h                   |   36 +-
 include/crypto/block.h                      |   22 +
 include/exec/memory.h                       |   47 +
 include/exec/ram_addr.h                     |    5 +-
 include/exec/user/thunk.h                   |    1 +
 include/hw/arm/fsl-imx6ul.h                 |    2 +
 include/hw/arm/pxa.h                        |    1 -
 include/hw/arm/sharpsl.h                    |    3 -
 include/hw/arm/virt.h                       |    8 +
 include/hw/audio/pcspk.h                    |   12 +-
 include/hw/audio/soundhw.h                  |    2 +
 include/hw/boards.h                         |    1 +
 include/hw/i386/pc.h                        |    6 +-
 include/hw/misc/max111x.h                   |   56 +
 include/hw/net/imx_fec.h                    |    1 +
 include/hw/pci/pci.h                        |    1 +
 include/hw/qdev-properties.h                |    3 +
 include/hw/ssi/ssi.h                        |   31 +-
 include/hw/vfio/vfio-common.h               |    4 +-
 include/hw/virtio/vhost-backend.h           |   19 +-
 include/hw/virtio/vhost-vdpa.h              |   26 +
 include/hw/virtio/vhost.h                   |    7 +
 include/hw/virtio/virtio-bus.h              |    4 +
 include/hw/virtio/virtio-iommu.h            |    2 +
 include/hw/virtio/virtio-mem.h              |   86 +
 include/migration/colo.h                    |    2 +-
 include/migration/misc.h                    |    2 +
 include/net/net.h                           |    1 +
 include/net/vhost-vdpa.h                    |   22 +
 include/net/vhost_net.h                     |    5 +
 include/qemu/typedefs.h                     |    1 +
 include/sysemu/balloon.h                    |    2 -
 linux-user/ioctls.h                         |   17 +-
 linux-user/qemu.h                           |   40 +-
 linux-user/sparc/cpu_loop.c                 |    6 +-
 linux-user/strace.c                         |  435 ++-
 linux-user/strace.list                      |   40 +-
 linux-user/syscall.c                        |  136 +-
 linux-user/syscall_defs.h                   |   15 +
 linux-user/syscall_types.h                  |   33 +
 migration/migration.c                       |   15 +-
 migration/postcopy-ram.c                    |   25 +-
 migration/ram.c                             |    8 +-
 migration/rdma.c                            |   18 +-
 migration/savevm.c                          |   11 +-
 monitor/hmp-cmds.c                          |   16 +
 monitor/monitor.c                           |    1 +
 net/Makefile.objs                           |    2 +-
 net/clients.h                               |    2 +
 net/net.c                                   |   10 +
 net/vhost-vdpa.c                            |  228 ++
 pc-bios/bios-256k.bin                       |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                            |  Bin 131072 -> 131072 bytes
 pc-bios/s390-ccw.img                        |  Bin 42608 -> 42608 bytes
 pc-bios/s390-ccw/Makefile                   |    3 +
 pc-bios/s390-ccw/bootmap.c                  |    4 +-
 pc-bios/s390-ccw/cio.c                      |   40 +-
 pc-bios/s390-ccw/cio.h                      |   17 +-
 pc-bios/s390-ccw/helper.h                   |   19 +-
 pc-bios/s390-ccw/jump2ipl.c                 |   10 +-
 pc-bios/s390-ccw/main.c                     |   15 +-
 pc-bios/s390-ccw/menu.c                     |    1 +
 pc-bios/s390-ccw/netboot.mak                |   13 +-
 pc-bios/s390-ccw/netmain.c                  |   23 +-
 pc-bios/s390-ccw/s390-arch.h                |    4 +-
 pc-bios/s390-ccw/s390-ccw.h                 |   27 +-
 pc-bios/s390-ccw/s390-time.h                |   23 +
 pc-bios/s390-ccw/start.S                    |    5 +-
 pc-bios/s390-ccw/virtio-net.c               |    2 +
 pc-bios/s390-ccw/virtio-scsi.c              |    2 +
 pc-bios/s390-ccw/virtio.c                   |   18 +-
 pc-bios/s390-netboot.img                    |  Bin 67232 -> 67232 bytes
 pc-bios/vgabios-ati.bin                     |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin           |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin                  |  Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin                     |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin                   |  Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin                  |  Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin                         |  Bin 38912 -> 38912 bytes
 qapi/block-core.json                        |   68 +
 qapi/crypto.json                            |   73 +-
 qapi/job.json                               |    4 +-
 qapi/misc.json                              |   64 +-
 qapi/net.json                               |   28 +-
 qdev-monitor.c                              |    2 +
 qemu-img-cmds.hx                            |    4 +-
 qemu-img.c                                  |   57 +-
 qemu-options.hx                             |   12 +
 qemu-storage-daemon.c                       |    5 +
 roms/config.seabios-128k                    |    3 +
 roms/seabios                                |    2 +-
 softmmu/vl.c                                |   24 +-
 stubs/Makefile.objs                         |    2 +
 stubs/isa-bus.c                             |    7 +
 stubs/pci-bus.c                             |    7 +
 target/arm/cpu.h                            |    2 +
 target/arm/kvm.c                            |   80 +
 target/arm/kvm32.c                          |   34 +
 target/arm/kvm64.c                          |   49 +
 target/arm/kvm_arm.h                        |   10 +
 target/arm/translate-a64.c                  |    6 +
 target/arm/translate-a64.h                  |    1 +
 target/arm/translate-sve.c                  |    8 +-
 target/i386/sev.c                           |    7 +
 target/riscv/Makefile.objs                  |    2 +-
 target/riscv/cpu.c                          |   50 +
 target/riscv/cpu.h                          |   82 +-
 target/riscv/cpu_bits.h                     |   15 +
 target/riscv/csr.c                          |   75 +-
 target/riscv/fpu_helper.c                   |   33 +-
 target/riscv/helper.h                       | 1069 ++++++
 target/riscv/insn32-64.decode               |   11 +
 target/riscv/insn32.decode                  |  372 ++
 target/riscv/insn_trans/trans_rvv.inc.c     | 2888 ++++++++++++++++
 target/riscv/internals.h                    |   41 +
 target/riscv/translate.c                    |   27 +-
 target/riscv/vector_helper.c                | 4899 +++++++++++++++++++++++++++
 target/s390x/insn-data.def                  |    2 +-
 target/sparc/translate.c                    |    2 +
 tcg/ppc/tcg-target.inc.c                    |   15 +-
 tcg/tcg-op.c                                |   10 +-
 tests/acceptance/machine_sparc64_sun4u.py   |   36 +
 tests/data/acpi/disassemle-aml.sh           |   52 +
 tests/data/acpi/rebuild-expected-aml.sh     |    1 +
 tests/data/acpi/virt/DSDT                   |  Bin 5307 -> 5205 bytes
 tests/data/acpi/virt/DSDT.memhp             |  Bin 6668 -> 6566 bytes
 tests/data/acpi/virt/DSDT.numamem           |  Bin 5307 -> 5205 bytes
 tests/qemu-iotests/049.out                  |  102 +-
 tests/qemu-iotests/051.pc.out               |    4 +-
 tests/qemu-iotests/061.out                  |   12 +-
 tests/qemu-iotests/082.out                  |  185 +-
 tests/qemu-iotests/085.out                  |   38 +-
 tests/qemu-iotests/087                      |    1 +
 tests/qemu-iotests/087.out                  |    6 +-
 tests/qemu-iotests/112.out                  |    2 +-
 tests/qemu-iotests/125                      |   24 +
 tests/qemu-iotests/125.out                  |    9 +
 tests/qemu-iotests/134.out                  |    2 +-
 tests/qemu-iotests/141                      |    2 +-
 tests/qemu-iotests/144.out                  |    4 +-
 tests/qemu-iotests/146                      |   60 +-
 tests/qemu-iotests/146.out                  |  405 ++-
 tests/qemu-iotests/153                      |    9 +-
 tests/qemu-iotests/158.out                  |    4 +-
 tests/qemu-iotests/178                      |    1 +
 tests/qemu-iotests/182.out                  |    2 +-
 tests/qemu-iotests/185.out                  |    8 +-
 tests/qemu-iotests/188                      |    1 +
 tests/qemu-iotests/188.out                  |    2 +-
 tests/qemu-iotests/189                      |    1 +
 tests/qemu-iotests/189.out                  |    4 +-
 tests/qemu-iotests/198                      |    1 +
 tests/qemu-iotests/198.out                  |    4 +-
 tests/qemu-iotests/206                      |    1 +
 tests/qemu-iotests/255.out                  |    8 +-
 tests/qemu-iotests/263                      |    1 +
 tests/qemu-iotests/263.out                  |    4 +-
 tests/qemu-iotests/274.out                  |   46 +-
 tests/qemu-iotests/280.out                  |    2 +-
 tests/qemu-iotests/284                      |    1 +
 tests/qemu-iotests/284.out                  |    6 +-
 tests/qemu-iotests/291                      |    4 -
 tests/qemu-iotests/291.out                  |   33 -
 tests/qemu-iotests/293                      |  208 ++
 tests/qemu-iotests/293.out                  |   99 +
 tests/qemu-iotests/294                      |   90 +
 tests/qemu-iotests/294.out                  |   30 +
 tests/qemu-iotests/295                      |  280 ++
 tests/qemu-iotests/295.out                  |   40 +
 tests/qemu-iotests/296                      |  234 ++
 tests/qemu-iotests/296.out                  |   33 +
 tests/qemu-iotests/common.filter            |  106 +-
 tests/qemu-iotests/common.rc                |   30 +
 tests/qemu-iotests/group                    |    4 +
 tests/qemu-iotests/iotests.py               |  108 +-
 tests/qtest/bios-tables-test-allowed-diff.h |   18 -
 tests/qtest/device-introspect-test.c        |    5 -
 tests/qtest/fuzz/fork_fuzz.c                |   40 +-
 tests/qtest/fuzz/fuzz.c                     |    3 +
 tests/qtest/libqtest.c                      |    4 +
 tests/qtest/migration-test.c                |    2 +-
 tests/qtest/qom-test.c                      |    5 -
 tests/qtest/test-hmp.c                      |    5 -
 thunk.c                                     |  154 +
 tools/virtiofsd/helper.c                    |    2 +
 tools/virtiofsd/passthrough_ll.c            |   71 +-
 util/qemu-openpty.c                         |    5 +-
 283 files changed, 17535 insertions(+), 1671 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index dec252f38b..42388f1de2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -787,6 +787,7 @@ F: hw/gpio/max7310.c
 F: hw/gpio/zaurus.c
 F: hw/misc/mst_fpga.c
 F: hw/misc/max111x.c
+F: include/hw/misc/max111x.h
 F: include/hw/arm/pxa.h
 F: include/hw/arm/sharpsl.h
 F: include/hw/display/tc6393xb.h
@@ -1318,6 +1319,7 @@ F: include/hw/pci-host/sabre.h
 F: hw/pci-bridge/simba.c
 F: include/hw/pci-bridge/simba.h
 F: pc-bios/openbios-sparc64
+F: tests/acceptance/machine_sparc64_sun4u.py
 
 Sun4v
 M: Artyom Tarasenko <atar4qemu@gmail.com>
@@ -1790,6 +1792,15 @@ F: hw/virtio/virtio-crypto.c
 F: hw/virtio/virtio-crypto-pci.c
 F: include/hw/virtio/virtio-crypto.h
 
+virtio-mem
+M: David Hildenbrand <david@redhat.com>
+S: Supported
+W: https://virtio-mem.gitlab.io/
+F: hw/virtio/virtio-mem.c
+F: hw/virtio/virtio-mem-pci.h
+F: hw/virtio/virtio-mem-pci.c
+F: include/hw/virtio/virtio-mem.h
+
 nvme
 M: Keith Busch <kbusch@kernel.org>
 L: qemu-block@nongnu.org
@@ -2615,6 +2626,15 @@ F: tests/uefi-test-tools/
 F: .gitlab-ci.d/edk2.yml
 F: .gitlab-ci.d/edk2/
 
+VT-d Emulation
+M: Michael S. Tsirkin <mst@redhat.com>
+M: Peter Xu <peterx@redhat.com>
+R: Jason Wang <jasowang@redhat.com>
+S: Supported
+F: hw/i386/intel_iommu.c
+F: hw/i386/intel_iommu_internal.h
+F: include/hw/i386/intel_iommu.h
+
 Usermode Emulation
 ------------------
 Overall usermode emulation
@@ -2629,8 +2649,7 @@ F: bsd-user/
 F: default-configs/*-bsd-user.mak
 
 Linux user
-M: Riku Voipio <riku.voipio@iki.fi>
-R: Laurent Vivier <laurent@vivier.eu>
+M: Laurent Vivier <laurent@vivier.eu>
 S: Maintained
 F: linux-user/
 F: default-configs/*-linux-user.mak
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index d54a8701d8..ab36fbfa0c 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -40,7 +40,6 @@
 #include "trace.h"
 #include "hw/irq.h"
 #include "sysemu/sev.h"
-#include "sysemu/balloon.h"
 #include "qapi/visitor.h"
 #include "qapi/qapi-types-common.h"
 #include "qapi/qapi-visit-common.h"
@@ -2229,7 +2228,8 @@ static int kvm_init(MachineState *ms)
 
     s->sync_mmu = !!kvm_vm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);
     if (!s->sync_mmu) {
-        qemu_balloon_inhibit(true);
+        ret = ram_block_discard_disable(true);
+        assert(!ret);
     }
 
     return 0;
diff --git a/balloon.c b/balloon.c
index f104b42961..354408c6ea 100644
--- a/balloon.c
+++ b/balloon.c
@@ -36,23 +36,6 @@
 static QEMUBalloonEvent *balloon_event_fn;
 static QEMUBalloonStatus *balloon_stat_fn;
 static void *balloon_opaque;
-static int balloon_inhibit_count;
-
-bool qemu_balloon_is_inhibited(void)
-{
-    return atomic_read(&balloon_inhibit_count) > 0;
-}
-
-void qemu_balloon_inhibit(bool state)
-{
-    if (state) {
-        atomic_inc(&balloon_inhibit_count);
-    } else {
-        atomic_dec(&balloon_inhibit_count);
-    }
-
-    assert(atomic_read(&balloon_inhibit_count) >= 0);
-}
 
 static bool have_balloon(Error **errp)
 {
diff --git a/block.c b/block.c
index 6dbcb7e083..62e40db2f1 100644
--- a/block.c
+++ b/block.c
@@ -5408,21 +5408,6 @@ int bdrv_has_zero_init(BlockDriverState *bs)
     return 0;
 }
 
-bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs)
-{
-    BlockDriverInfo bdi;
-
-    if (bs->backing) {
-        return false;
-    }
-
-    if (bdrv_get_info(bs, &bdi) == 0) {
-        return bdi.unallocated_blocks_are_zero;
-    }
-
-    return false;
-}
-
 bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs)
 {
     if (!(bs->open_flags & BDRV_O_UNMAP)) {
@@ -6482,6 +6467,7 @@ void bdrv_remove_aio_context_notifier(BlockDriverState *bs,
 
 int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts,
                        BlockDriverAmendStatusCB *status_cb, void *cb_opaque,
+                       bool force,
                        Error **errp)
 {
     if (!bs->drv) {
@@ -6493,7 +6479,8 @@ int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts,
                    bs->drv->format_name);
         return -ENOTSUP;
     }
-    return bs->drv->bdrv_amend_options(bs, opts, status_cb, cb_opaque, errp);
+    return bs->drv->bdrv_amend_options(bs, opts, status_cb,
+                                       cb_opaque, force, errp);
 }
 
 /*
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 96028eedce..577e578bc2 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -19,7 +19,7 @@ block-obj-$(CONFIG_WIN32) += file-win32.o win32-aio.o
 block-obj-$(CONFIG_POSIX) += file-posix.o
 block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 block-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
-block-obj-y += null.o mirror.o commit.o io.o create.o
+block-obj-y += null.o mirror.o commit.o io.o create.o amend.o
 block-obj-y += throttle-groups.o
 block-obj-$(CONFIG_LINUX) += nvme.o
 
diff --git a/block/amend.c b/block/amend.c
new file mode 100644
index 0000000000..f4612dcf08
--- /dev/null
+++ b/block/amend.c
@@ -0,0 +1,113 @@
+/*
+ * Block layer code related to image options amend
+ *
+ * Copyright (c) 2018 Kevin Wolf <kwolf@redhat.com>
+ * Copyright (c) 2020 Red Hat. Inc
+ *
+ * Heavily based on create.c
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "block/block_int.h"
+#include "qemu/job.h"
+#include "qemu/main-loop.h"
+#include "qapi/qapi-commands-block-core.h"
+#include "qapi/qapi-visit-block-core.h"
+#include "qapi/clone-visitor.h"
+#include "qapi/error.h"
+
+typedef struct BlockdevAmendJob {
+    Job common;
+    BlockdevAmendOptions *opts;
+    BlockDriverState *bs;
+    bool force;
+} BlockdevAmendJob;
+
+static int coroutine_fn blockdev_amend_run(Job *job, Error **errp)
+{
+    BlockdevAmendJob *s = container_of(job, BlockdevAmendJob, common);
+    int ret;
+
+    job_progress_set_remaining(&s->common, 1);
+    ret = s->bs->drv->bdrv_co_amend(s->bs, s->opts, s->force, errp);
+    job_progress_update(&s->common, 1);
+    qapi_free_BlockdevAmendOptions(s->opts);
+    return ret;
+}
+
+static const JobDriver blockdev_amend_job_driver = {
+    .instance_size = sizeof(BlockdevAmendJob),
+    .job_type      = JOB_TYPE_AMEND,
+    .run           = blockdev_amend_run,
+};
+
+void qmp_x_blockdev_amend(const char *job_id,
+                          const char *node_name,
+                          BlockdevAmendOptions *options,
+                          bool has_force,
+                          bool force,
+                          Error **errp)
+{
+    BlockdevAmendJob *s;
+    const char *fmt = BlockdevDriver_str(options->driver);
+    BlockDriver *drv = bdrv_find_format(fmt);
+    BlockDriverState *bs = bdrv_find_node(node_name);
+
+
+    if (!drv) {
+        error_setg(errp, "Block driver '%s' not found or not supported", fmt);
+        return;
+    }
+
+    /*
+     * If the driver is in the schema, we know that it exists. But it may not
+     * be whitelisted.
+     */
+    if (bdrv_uses_whitelist() && !bdrv_is_whitelisted(drv, false)) {
+        error_setg(errp, "Driver is not whitelisted");
+        return;
+    }
+
+    if (bs->drv != drv) {
+        error_setg(errp,
+                   "x-blockdev-amend doesn't support changing the block driver");
+        return;
+    }
+
+    /* Error out if the driver doesn't support .bdrv_co_amend */
+    if (!drv->bdrv_co_amend) {
+        error_setg(errp, "Driver does not support x-blockdev-amend");
+        return;
+    }
+
+    /* Create the block job */
+    s = job_create(job_id, &blockdev_amend_job_driver, NULL,
+                   bdrv_get_aio_context(bs), JOB_DEFAULT | JOB_MANUAL_DISMISS,
+                   NULL, NULL, errp);
+    if (!s) {
+        return;
+    }
+
+    s->bs = bs,
+    s->opts = QAPI_CLONE(BlockdevAmendOptions, options),
+    s->force = has_force ? force : false;
+    job_start(&s->common);
+}
diff --git a/block/block-copy.c b/block/block-copy.c
index bb8d0569f2..f7428a7c08 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -622,8 +622,10 @@ out:
          * block_copy_task_run. If it fails, it means some task already failed
          * for real reason, let's return first failure.
          * Still, assert that we don't rewrite failure by success.
+         *
+         * Note: ret may be positive here because of block-status result.
          */
-        assert(ret == 0 || aio_task_pool_status(aio) < 0);
+        assert(ret >= 0 || aio_task_pool_status(aio) < 0);
         ret = aio_task_pool_status(aio);
 
         aio_task_pool_free(aio);
diff --git a/block/crypto.c b/block/crypto.c
index 973b57b3eb..2636e959ae 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -37,6 +37,7 @@ typedef struct BlockCrypto BlockCrypto;
 
 struct BlockCrypto {
     QCryptoBlock *block;
+    bool updating_keys;
 };
 
 
@@ -71,6 +72,24 @@ static ssize_t block_crypto_read_func(QCryptoBlock *block,
     return ret;
 }
 
+static ssize_t block_crypto_write_func(QCryptoBlock *block,
+                                       size_t offset,
+                                       const uint8_t *buf,
+                                       size_t buflen,
+                                       void *opaque,
+                                       Error **errp)
+{
+    BlockDriverState *bs = opaque;
+    ssize_t ret;
+
+    ret = bdrv_pwrite(bs->file, offset, buf, buflen);
+    if (ret < 0) {
+        error_setg_errno(errp, -ret, "Could not write encryption header");
+        return ret;
+    }
+    return ret;
+}
+
 
 struct BlockCryptoCreateData {
     BlockBackend *blk;
@@ -79,12 +98,12 @@ struct BlockCryptoCreateData {
 };
 
 
-static ssize_t block_crypto_write_func(QCryptoBlock *block,
-                                       size_t offset,
-                                       const uint8_t *buf,
-                                       size_t buflen,
-                                       void *opaque,
-                                       Error **errp)
+static ssize_t block_crypto_create_write_func(QCryptoBlock *block,
+                                              size_t offset,
+                                              const uint8_t *buf,
+                                              size_t buflen,
+                                              void *opaque,
+                                              Error **errp)
 {
     struct BlockCryptoCreateData *data = opaque;
     ssize_t ret;
@@ -97,11 +116,10 @@ static ssize_t block_crypto_write_func(QCryptoBlock *block,
     return ret;
 }
 
-
-static ssize_t block_crypto_init_func(QCryptoBlock *block,
-                                      size_t headerlen,
-                                      void *opaque,
-                                      Error **errp)
+static ssize_t block_crypto_create_init_func(QCryptoBlock *block,
+                                             size_t headerlen,
+                                             void *opaque,
+                                             Error **errp)
 {
     struct BlockCryptoCreateData *data = opaque;
     Error *local_error = NULL;
@@ -167,6 +185,19 @@ static QemuOptsList block_crypto_create_opts_luks = {
 };
 
 
+static QemuOptsList block_crypto_amend_opts_luks = {
+    .name = "crypto",
+    .head = QTAILQ_HEAD_INITIALIZER(block_crypto_create_opts_luks.head),
+    .desc = {
+        BLOCK_CRYPTO_OPT_DEF_LUKS_STATE(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET(""),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME(""),
+        { /* end of list */ }
+    },
+};
+
 QCryptoBlockOpenOptions *
 block_crypto_open_opts_init(QDict *opts, Error **errp)
 {
@@ -202,6 +233,23 @@ block_crypto_create_opts_init(QDict *opts, Error **errp)
     return ret;
 }
 
+QCryptoBlockAmendOptions *
+block_crypto_amend_opts_init(QDict *opts, Error **errp)
+{
+    Visitor *v;
+    QCryptoBlockAmendOptions *ret;
+
+    v = qobject_input_visitor_new_flat_confused(opts, errp);
+    if (!v) {
+        return NULL;
+    }
+
+    visit_type_QCryptoBlockAmendOptions(v, NULL, &ret, errp);
+
+    visit_free(v);
+    return ret;
+}
+
 
 static int block_crypto_open_generic(QCryptoBlockFormat format,
                                      QemuOptsList *opts_spec,
@@ -296,8 +344,8 @@ static int block_crypto_co_create_generic(BlockDriverState *bs,
     };
 
     crypto = qcrypto_block_create(opts, NULL,
-                                  block_crypto_init_func,
-                                  block_crypto_write_func,
+                                  block_crypto_create_init_func,
+                                  block_crypto_create_write_func,
                                   &data,
                                   errp);
 
@@ -710,7 +758,6 @@ static int block_crypto_get_info_luks(BlockDriverState *bs,
         return ret;
     }
 
-    bdi->unallocated_blocks_are_zero = false;
     bdi->cluster_size = subbdi.cluster_size;
 
     return 0;
@@ -742,6 +789,131 @@ block_crypto_get_specific_info_luks(BlockDriverState *bs, Error **errp)
     return spec_info;
 }
 
+static int
+block_crypto_amend_options_generic_luks(BlockDriverState *bs,
+                                        QCryptoBlockAmendOptions *amend_options,
+                                        bool force,
+                                        Error **errp)
+{
+    BlockCrypto *crypto = bs->opaque;
+    int ret;
+
+    assert(crypto);
+    assert(crypto->block);
+
+    /* apply for exclusive read/write permissions to the underlying file*/
+    crypto->updating_keys = true;
+    ret = bdrv_child_refresh_perms(bs, bs->file, errp);
+    if (ret) {
+        goto cleanup;
+    }
+
+    ret = qcrypto_block_amend_options(crypto->block,
+                                      block_crypto_read_func,
+                                      block_crypto_write_func,
+                                      bs,
+                                      amend_options,
+                                      force,
+                                      errp);
+cleanup:
+    /* release exclusive read/write permissions to the underlying file*/
+    crypto->updating_keys = false;
+    bdrv_child_refresh_perms(bs, bs->file, errp);
+    return ret;
+}
+
+static int
+block_crypto_amend_options_luks(BlockDriverState *bs,
+                                QemuOpts *opts,
+                                BlockDriverAmendStatusCB *status_cb,
+                                void *cb_opaque,
+                                bool force,
+                                Error **errp)
+{
+    BlockCrypto *crypto = bs->opaque;
+    QDict *cryptoopts = NULL;
+    QCryptoBlockAmendOptions *amend_options = NULL;
+    int ret = -EINVAL;
+
+    assert(crypto);
+    assert(crypto->block);
+
+    cryptoopts = qemu_opts_to_qdict(opts, NULL);
+    qdict_put_str(cryptoopts, "format", "luks");
+    amend_options = block_crypto_amend_opts_init(cryptoopts, errp);
+    qobject_unref(cryptoopts);
+    if (!amend_options) {
+        goto cleanup;
+    }
+    ret = block_crypto_amend_options_generic_luks(bs, amend_options,
+                                                  force, errp);
+cleanup:
+    qapi_free_QCryptoBlockAmendOptions(amend_options);
+    return ret;
+}
+
+static int
+coroutine_fn block_crypto_co_amend_luks(BlockDriverState *bs,
+                                        BlockdevAmendOptions *opts,
+                                        bool force,
+                                        Error **errp)
+{
+    QCryptoBlockAmendOptions amend_opts;
+
+    amend_opts = (QCryptoBlockAmendOptions) {
+        .format = Q_CRYPTO_BLOCK_FORMAT_LUKS,
+        .u.luks = *qapi_BlockdevAmendOptionsLUKS_base(&opts->u.luks),
+    };
+    return block_crypto_amend_options_generic_luks(bs, &amend_opts,
+                                                   force, errp);
+}
+
+static void
+block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c,
+                         const BdrvChildRole role,
+                         BlockReopenQueue *reopen_queue,
+                         uint64_t perm, uint64_t shared,
+                         uint64_t *nperm, uint64_t *nshared)
+{
+
+    BlockCrypto *crypto = bs->opaque;
+
+    bdrv_default_perms(bs, c, role, reopen_queue, perm, shared, nperm, nshared);
+
+    /*
+     * For backward compatibility, manually share the write
+     * and resize permission
+     */
+    *nshared |= (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    /*
+     * Since we are not fully a format driver, don't always request
+     * the read/resize permission but only when explicitly
+     * requested
+     */
+    *nperm &= ~(BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    *nperm |= perm & (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+
+    /*
+     * This driver doesn't modify LUKS metadata except
+     * when updating the encryption slots.
+     * Thus unlike a proper format driver we don't ask for
+     * shared write/read permission. However we need it
+     * when we are updating the keys, to ensure that only we
+     * have access to the device.
+     *
+     * Encryption update will set the crypto->updating_keys
+     * during that period and refresh permissions
+     *
+     */
+    if (crypto->updating_keys) {
+        /* need exclusive write access for header update */
+        *nperm |= BLK_PERM_WRITE;
+        /* unshare read and write permission */
+        *nshared &= ~(BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE);
+    }
+}
+
+
 static const char *const block_crypto_strong_runtime_opts[] = {
     BLOCK_CRYPTO_OPT_LUKS_KEY_SECRET,
 
@@ -754,13 +926,12 @@ static BlockDriver bdrv_crypto_luks = {
     .bdrv_probe         = block_crypto_probe_luks,
     .bdrv_open          = block_crypto_open_luks,
     .bdrv_close         = block_crypto_close,
-    /* This driver doesn't modify LUKS metadata except when creating image.
-     * Allow share-rw=on as a special case. */
-    .bdrv_child_perm    = bdrv_default_perms,
+    .bdrv_child_perm    = block_crypto_child_perms,
     .bdrv_co_create     = block_crypto_co_create_luks,
     .bdrv_co_create_opts = block_crypto_co_create_opts_luks,
     .bdrv_co_truncate   = block_crypto_co_truncate,
     .create_opts        = &block_crypto_create_opts_luks,
+    .amend_opts         = &block_crypto_amend_opts_luks,
 
     .bdrv_reopen_prepare = block_crypto_reopen_prepare,
     .bdrv_refresh_limits = block_crypto_refresh_limits,
@@ -770,6 +941,8 @@ static BlockDriver bdrv_crypto_luks = {
     .bdrv_measure       = block_crypto_measure,
     .bdrv_get_info      = block_crypto_get_info_luks,
     .bdrv_get_specific_info = block_crypto_get_specific_info_luks,
+    .bdrv_amend_options = block_crypto_amend_options_luks,
+    .bdrv_co_amend      = block_crypto_co_amend_luks,
 
     .is_format          = true,
 
diff --git a/block/crypto.h b/block/crypto.h
index b935695e79..c72c3dec61 100644
--- a/block/crypto.h
+++ b/block/crypto.h
@@ -41,6 +41,11 @@
 #define BLOCK_CRYPTO_OPT_LUKS_IVGEN_HASH_ALG "ivgen-hash-alg"
 #define BLOCK_CRYPTO_OPT_LUKS_HASH_ALG "hash-alg"
 #define BLOCK_CRYPTO_OPT_LUKS_ITER_TIME "iter-time"
+#define BLOCK_CRYPTO_OPT_LUKS_KEYSLOT "keyslot"
+#define BLOCK_CRYPTO_OPT_LUKS_STATE "state"
+#define BLOCK_CRYPTO_OPT_LUKS_OLD_SECRET "old-secret"
+#define BLOCK_CRYPTO_OPT_LUKS_NEW_SECRET "new-secret"
+
 
 #define BLOCK_CRYPTO_OPT_DEF_LUKS_KEY_SECRET(prefix)                    \
     BLOCK_CRYPTO_OPT_DEF_KEY_SECRET(prefix,                             \
@@ -88,9 +93,41 @@
         .help = "Time to spend in PBKDF in milliseconds",     \
     }
 
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_STATE(prefix)                           \
+    {                                                                     \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_STATE,                       \
+        .type = QEMU_OPT_STRING,                                          \
+        .help = "Select new state of affected keyslots (active/inactive)",\
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT(prefix)              \
+    {                                                          \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_KEYSLOT,          \
+        .type = QEMU_OPT_NUMBER,                               \
+        .help = "Select a single keyslot to modify explicitly",\
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET(prefix)            \
+    {                                                           \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_OLD_SECRET,        \
+        .type = QEMU_OPT_STRING,                                \
+        .help = "Select all keyslots that match this password", \
+    }
+
+#define BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET(prefix)            \
+    {                                                           \
+        .name = prefix BLOCK_CRYPTO_OPT_LUKS_NEW_SECRET,        \
+        .type = QEMU_OPT_STRING,                                \
+        .help = "New secret to set in the matching keyslots. "  \
+                "Empty string to erase",                        \
+    }
+
 QCryptoBlockCreateOptions *
 block_crypto_create_opts_init(QDict *opts, Error **errp);
 
+QCryptoBlockAmendOptions *
+block_crypto_amend_opts_init(QDict *opts, Error **errp);
+
 QCryptoBlockOpenOptions *
 block_crypto_open_opts_init(QDict *opts, Error **errp);
 
diff --git a/block/file-posix.c b/block/file-posix.c
index 3ab8f5a0fa..d86ea57769 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2878,9 +2878,6 @@ static int coroutine_fn raw_co_pwrite_zeroes(
 
 static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
-    BDRVRawState *s = bs->opaque;
-
-    bdi->unallocated_blocks_are_zero = s->discard_zeroes;
     return 0;
 }
 
diff --git a/block/io.c b/block/io.c
index df8f2a98d4..b6564e34c5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2406,16 +2406,16 @@ static int coroutine_fn bdrv_co_block_status(BlockDriverState *bs,
 
     if (ret & (BDRV_BLOCK_DATA | BDRV_BLOCK_ZERO)) {
         ret |= BDRV_BLOCK_ALLOCATED;
-    } else if (want_zero) {
-        if (bdrv_unallocated_blocks_are_zero(bs)) {
-            ret |= BDRV_BLOCK_ZERO;
-        } else if (bs->backing) {
+    } else if (want_zero && bs->drv->supports_backing) {
+        if (bs->backing) {
             BlockDriverState *bs2 = bs->backing->bs;
             int64_t size2 = bdrv_getlength(bs2);
 
             if (size2 >= 0 && offset >= size2) {
                 ret |= BDRV_BLOCK_ZERO;
             }
+        } else {
+            ret |= BDRV_BLOCK_ZERO;
         }
     }
 
diff --git a/block/iscsi.c b/block/iscsi.c
index a8b76979d8..767e3e75fd 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -2163,7 +2163,6 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
 static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
     IscsiLun *iscsilun = bs->opaque;
-    bdi->unallocated_blocks_are_zero = iscsilun->lbprz;
     bdi->cluster_size = iscsilun->cluster_size;
     return 0;
 }
diff --git a/block/qcow2.c b/block/qcow2.c
index 0cd2e6757e..38198b4e75 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -176,6 +176,19 @@ static ssize_t qcow2_crypto_hdr_write_func(QCryptoBlock *block, size_t offset,
     return ret;
 }
 
+static QDict*
+qcow2_extract_crypto_opts(QemuOpts *opts, const char *fmt, Error **errp)
+{
+    QDict *cryptoopts_qdict;
+    QDict *opts_qdict;
+
+    /* Extract "encrypt." options into a qdict */
+    opts_qdict = qemu_opts_to_qdict(opts, NULL);
+    qdict_extract_subqdict(opts_qdict, &cryptoopts_qdict, "encrypt.");
+    qobject_unref(opts_qdict);
+    qdict_put_str(cryptoopts_qdict, "format", fmt);
+    return cryptoopts_qdict;
+}
 
 /*
  * read qcow2 extension and fill bs
@@ -3042,17 +3055,6 @@ static int qcow2_change_backing_file(BlockDriverState *bs,
     return qcow2_update_header(bs);
 }
 
-static int qcow2_crypt_method_from_format(const char *encryptfmt)
-{
-    if (g_str_equal(encryptfmt, "luks")) {
-        return QCOW_CRYPT_LUKS;
-    } else if (g_str_equal(encryptfmt, "aes")) {
-        return QCOW_CRYPT_AES;
-    } else {
-        return -EINVAL;
-    }
-}
-
 static int qcow2_set_up_encryption(BlockDriverState *bs,
                                    QCryptoBlockCreateOptions *cryptoopts,
                                    Error **errp)
@@ -4239,8 +4241,8 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
             old_file_size = ROUND_UP(old_file_size, s->cluster_size);
         }
 
-        nb_new_data_clusters = DIV_ROUND_UP(offset - old_length,
-                                            s->cluster_size);
+        nb_new_data_clusters = (ROUND_UP(offset, s->cluster_size) -
+            start_of_cluster(s, old_length)) >> s->cluster_bits;
 
         /* This is an overestimation; we will not actually allocate space for
          * these in the file but just make sure the new refcount structures are
@@ -4317,10 +4319,21 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
             int64_t nb_clusters = MIN(
                 nb_new_data_clusters,
                 s->l2_slice_size - offset_to_l2_slice_index(s, guest_offset));
-            QCowL2Meta allocation = {
+            unsigned cow_start_length = offset_into_cluster(s, guest_offset);
+            QCowL2Meta allocation;
+            guest_offset = start_of_cluster(s, guest_offset);
+            allocation = (QCowL2Meta) {
                 .offset       = guest_offset,
                 .alloc_offset = host_offset,
                 .nb_clusters  = nb_clusters,
+                .cow_start    = {
+                    .offset       = 0,
+                    .nb_bytes     = cow_start_length,
+                },
+                .cow_end      = {
+                    .offset       = nb_clusters << s->cluster_bits,
+                    .nb_bytes     = 0,
+                },
             };
             qemu_co_queue_init(&allocation.dependent_requests);
 
@@ -4860,16 +4873,9 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
 
     if (has_luks) {
         g_autoptr(QCryptoBlockCreateOptions) create_opts = NULL;
-        QDict *opts_qdict;
-        QDict *cryptoopts;
+        QDict *cryptoopts = qcow2_extract_crypto_opts(opts, "luks", errp);
         size_t headerlen;
 
-        opts_qdict = qemu_opts_to_qdict(opts, NULL);
-        qdict_extract_subqdict(opts_qdict, &cryptoopts, "encrypt.");
-        qobject_unref(opts_qdict);
-
-        qdict_put_str(cryptoopts, "format", "luks");
-
         create_opts = block_crypto_create_opts_init(cryptoopts, errp);
         qobject_unref(cryptoopts);
         if (!create_opts) {
@@ -4981,7 +4987,6 @@ err:
 static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 {
     BDRVQcow2State *s = bs->opaque;
-    bdi->unallocated_blocks_are_zero = true;
     bdi->cluster_size = s->cluster_size;
     bdi->vm_state_offset = qcow2_vm_state_offset(s);
     return 0;
@@ -5273,6 +5278,7 @@ typedef enum Qcow2AmendOperation {
     QCOW2_NO_OPERATION = 0,
 
     QCOW2_UPGRADING,
+    QCOW2_UPDATING_ENCRYPTION,
     QCOW2_CHANGING_REFCOUNT_ORDER,
     QCOW2_DOWNGRADING,
 } Qcow2AmendOperation;
@@ -5340,6 +5346,7 @@ static void qcow2_amend_helper_cb(BlockDriverState *bs,
 static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                                BlockDriverAmendStatusCB *status_cb,
                                void *cb_opaque,
+                               bool force,
                                Error **errp)
 {
     BDRVQcow2State *s = bs->opaque;
@@ -5349,13 +5356,11 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     bool lazy_refcounts = s->use_lazy_refcounts;
     bool data_file_raw = data_file_is_raw(bs);
     const char *compat = NULL;
-    uint64_t cluster_size = s->cluster_size;
-    bool encrypt;
-    int encformat;
     int refcount_bits = s->refcount_bits;
     int ret;
     QemuOptDesc *desc = opts->list->desc;
     Qcow2AmendHelperCBInfo helper_cb_info;
+    bool encryption_update = false;
 
     while (desc && desc->name) {
         if (!qemu_opt_find(opts, desc->name)) {
@@ -5376,44 +5381,24 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                 error_setg(errp, "Unknown compatibility level %s", compat);
                 return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_PREALLOC)) {
-            error_setg(errp, "Cannot change preallocation mode");
-            return -ENOTSUP;
         } else if (!strcmp(desc->name, BLOCK_OPT_SIZE)) {
             new_size = qemu_opt_get_size(opts, BLOCK_OPT_SIZE, 0);
         } else if (!strcmp(desc->name, BLOCK_OPT_BACKING_FILE)) {
             backing_file = qemu_opt_get(opts, BLOCK_OPT_BACKING_FILE);
         } else if (!strcmp(desc->name, BLOCK_OPT_BACKING_FMT)) {
             backing_format = qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT);
-        } else if (!strcmp(desc->name, BLOCK_OPT_ENCRYPT)) {
-            encrypt = qemu_opt_get_bool(opts, BLOCK_OPT_ENCRYPT,
-                                        !!s->crypto);
-
-            if (encrypt != !!s->crypto) {
+        } else if (g_str_has_prefix(desc->name, "encrypt.")) {
+            if (!s->crypto) {
                 error_setg(errp,
-                           "Changing the encryption flag is not supported");
-                return -ENOTSUP;
+                           "Can't amend encryption options - encryption not present");
+                return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_ENCRYPT_FORMAT)) {
-            encformat = qcow2_crypt_method_from_format(
-                qemu_opt_get(opts, BLOCK_OPT_ENCRYPT_FORMAT));
-
-            if (encformat != s->crypt_method_header) {
+            if (s->crypt_method_header != QCOW_CRYPT_LUKS) {
                 error_setg(errp,
-                           "Changing the encryption format is not supported");
-                return -ENOTSUP;
-            }
-        } else if (g_str_has_prefix(desc->name, "encrypt.")) {
-            error_setg(errp,
-                       "Changing the encryption parameters is not supported");
-            return -ENOTSUP;
-        } else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
-            cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
-                                             cluster_size);
-            if (cluster_size != s->cluster_size) {
-                error_setg(errp, "Changing the cluster size is not supported");
+                           "Only LUKS encryption options can be amended");
                 return -ENOTSUP;
             }
+            encryption_update = true;
         } else if (!strcmp(desc->name, BLOCK_OPT_LAZY_REFCOUNTS)) {
             lazy_refcounts = qemu_opt_get_bool(opts, BLOCK_OPT_LAZY_REFCOUNTS,
                                                lazy_refcounts);
@@ -5443,22 +5428,6 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
                                  "images");
                 return -EINVAL;
             }
-        } else if (!strcmp(desc->name, BLOCK_OPT_COMPRESSION_TYPE)) {
-            const char *ct_name =
-                qemu_opt_get(opts, BLOCK_OPT_COMPRESSION_TYPE);
-            int compression_type =
-                qapi_enum_parse(&Qcow2CompressionType_lookup, ct_name, -1,
-                                NULL);
-            if (compression_type == -1) {
-                error_setg(errp, "Unknown compression type: %s", ct_name);
-                return -ENOTSUP;
-            }
-
-            if (compression_type != s->compression_type) {
-                error_setg(errp, "Changing the compression type "
-                                 "is not supported");
-                return -ENOTSUP;
-            }
         } else {
             /* if this point is reached, this probably means a new option was
              * added without having it covered here */
@@ -5472,7 +5441,8 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
         .original_status_cb = status_cb,
         .original_cb_opaque = cb_opaque,
         .total_operations = (new_version != old_version)
-                          + (s->refcount_bits != refcount_bits)
+                          + (s->refcount_bits != refcount_bits) +
+                            (encryption_update == true)
     };
 
     /* Upgrade first (some features may require compat=1.1) */
@@ -5485,6 +5455,33 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
         }
     }
 
+    if (encryption_update) {
+        QDict *amend_opts_dict;
+        QCryptoBlockAmendOptions *amend_opts;
+
+        helper_cb_info.current_operation = QCOW2_UPDATING_ENCRYPTION;
+        amend_opts_dict = qcow2_extract_crypto_opts(opts, "luks", errp);
+        if (!amend_opts_dict) {
+            return -EINVAL;
+        }
+        amend_opts = block_crypto_amend_opts_init(amend_opts_dict, errp);
+        qobject_unref(amend_opts_dict);
+        if (!amend_opts) {
+            return -EINVAL;
+        }
+        ret = qcrypto_block_amend_options(s->crypto,
+                                          qcow2_crypto_hdr_read_func,
+                                          qcow2_crypto_hdr_write_func,
+                                          bs,
+                                          amend_opts,
+                                          force,
+                                          errp);
+        qapi_free_QCryptoBlockAmendOptions(amend_opts);
+        if (ret < 0) {
+            return ret;
+        }
+    }
+
     if (s->refcount_bits != refcount_bits) {
         int refcount_order = ctz32(refcount_bits);
 
@@ -5598,6 +5595,44 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     return 0;
 }
 
+static int coroutine_fn qcow2_co_amend(BlockDriverState *bs,
+                                       BlockdevAmendOptions *opts,
+                                       bool force,
+                                       Error **errp)
+{
+    BlockdevAmendOptionsQcow2 *qopts = &opts->u.qcow2;
+    BDRVQcow2State *s = bs->opaque;
+    int ret = 0;
+
+    if (qopts->has_encrypt) {
+        if (!s->crypto) {
+            error_setg(errp, "image is not encrypted, can't amend");
+            return -EOPNOTSUPP;
+        }
+
+        if (qopts->encrypt->format != Q_CRYPTO_BLOCK_FORMAT_LUKS) {
+            error_setg(errp,
+                       "Amend can't be used to change the qcow2 encryption format");
+            return -EOPNOTSUPP;
+        }
+
+        if (s->crypt_method_header != QCOW_CRYPT_LUKS) {
+            error_setg(errp,
+                       "Only LUKS encryption options can be amended for qcow2 with blockdev-amend");
+            return -EOPNOTSUPP;
+        }
+
+        ret = qcrypto_block_amend_options(s->crypto,
+                                          qcow2_crypto_hdr_read_func,
+                                          qcow2_crypto_hdr_write_func,
+                                          bs,
+                                          qopts->encrypt,
+                                          force,
+                                          errp);
+    }
+    return ret;
+}
+
 /*
  * If offset or size are negative, respectively, they will not be included in
  * the BLOCK_IMAGE_CORRUPTED event emitted.
@@ -5648,89 +5683,108 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,
     s->signaled_corruption = true;
 }
 
+#define QCOW_COMMON_OPTIONS                                         \
+    {                                                               \
+        .name = BLOCK_OPT_SIZE,                                     \
+        .type = QEMU_OPT_SIZE,                                      \
+        .help = "Virtual disk size"                                 \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_COMPAT_LEVEL,                             \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "Compatibility level (v2 [0.10] or v3 [1.1])"       \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_BACKING_FILE,                             \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "File name of a base image"                         \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_BACKING_FMT,                              \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "Image format of the base image"                    \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_DATA_FILE,                                \
+        .type = QEMU_OPT_STRING,                                    \
+        .help = "File name of an external data file"                \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_DATA_FILE_RAW,                            \
+        .type = QEMU_OPT_BOOL,                                      \
+        .help = "The external data file must stay valid "           \
+                "as a raw image"                                    \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_LAZY_REFCOUNTS,                           \
+        .type = QEMU_OPT_BOOL,                                      \
+        .help = "Postpone refcount updates",                        \
+        .def_value_str = "off"                                      \
+    },                                                              \
+    {                                                               \
+        .name = BLOCK_OPT_REFCOUNT_BITS,                            \
+        .type = QEMU_OPT_NUMBER,                                    \
+        .help = "Width of a reference count entry in bits",         \
+        .def_value_str = "16"                                       \
+    }
+
 static QemuOptsList qcow2_create_opts = {
     .name = "qcow2-create-opts",
     .head = QTAILQ_HEAD_INITIALIZER(qcow2_create_opts.head),
     .desc = {
-        {
-            .name = BLOCK_OPT_SIZE,
-            .type = QEMU_OPT_SIZE,
-            .help = "Virtual disk size"
-        },
-        {
-            .name = BLOCK_OPT_COMPAT_LEVEL,
-            .type = QEMU_OPT_STRING,
-            .help = "Compatibility level (v2 [0.10] or v3 [1.1])"
-        },
-        {
-            .name = BLOCK_OPT_BACKING_FILE,
-            .type = QEMU_OPT_STRING,
-            .help = "File name of a base image"
-        },
-        {
-            .name = BLOCK_OPT_BACKING_FMT,
-            .type = QEMU_OPT_STRING,
-            .help = "Image format of the base image"
-        },
-        {
-            .name = BLOCK_OPT_DATA_FILE,
-            .type = QEMU_OPT_STRING,
-            .help = "File name of an external data file"
-        },
-        {
-            .name = BLOCK_OPT_DATA_FILE_RAW,
-            .type = QEMU_OPT_BOOL,
-            .help = "The external data file must stay valid as a raw image"
-        },
-        {
-            .name = BLOCK_OPT_ENCRYPT,
-            .type = QEMU_OPT_BOOL,
-            .help = "Encrypt the image with format 'aes'. (Deprecated "
-                    "in favor of " BLOCK_OPT_ENCRYPT_FORMAT "=aes)",
+        {                                                               \
+            .name = BLOCK_OPT_ENCRYPT,                                  \
+            .type = QEMU_OPT_BOOL,                                      \
+            .help = "Encrypt the image with format 'aes'. (Deprecated " \
+                    "in favor of " BLOCK_OPT_ENCRYPT_FORMAT "=aes)",    \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_ENCRYPT_FORMAT,                           \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Encrypt the image, format choices: 'aes', 'luks'", \
+        },                                                              \
+        BLOCK_CRYPTO_OPT_DEF_KEY_SECRET("encrypt.",                     \
+            "ID of secret providing qcow AES key or LUKS passphrase"),  \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_ALG("encrypt."),               \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_MODE("encrypt."),              \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_ALG("encrypt."),                \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_HASH_ALG("encrypt."),           \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_HASH_ALG("encrypt."),                 \
+        BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME("encrypt."),                \
+        {                                                               \
+            .name = BLOCK_OPT_CLUSTER_SIZE,                             \
+            .type = QEMU_OPT_SIZE,                                      \
+            .help = "qcow2 cluster size",                               \
+            .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)            \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_PREALLOC,                                 \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Preallocation mode (allowed values: off, "         \
+                    "metadata, falloc, full)"                           \
+        },                                                              \
+        {                                                               \
+            .name = BLOCK_OPT_COMPRESSION_TYPE,                         \
+            .type = QEMU_OPT_STRING,                                    \
+            .help = "Compression method used for image cluster "        \
+                    "compression",                                      \
+            .def_value_str = "zlib"                                     \
         },
-        {
-            .name = BLOCK_OPT_ENCRYPT_FORMAT,
-            .type = QEMU_OPT_STRING,
-            .help = "Encrypt the image, format choices: 'aes', 'luks'",
-        },
-        BLOCK_CRYPTO_OPT_DEF_KEY_SECRET("encrypt.",
-            "ID of secret providing qcow AES key or LUKS passphrase"),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_CIPHER_MODE("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_IVGEN_HASH_ALG("encrypt."),
-        BLOCK_CRYPTO_OPT_DEF_LUKS_HASH_ALG("encrypt."),
+        QCOW_COMMON_OPTIONS,
+        { /* end of list */ }
+    }
+};
+
+static QemuOptsList qcow2_amend_opts = {
+    .name = "qcow2-amend-opts",
+    .head = QTAILQ_HEAD_INITIALIZER(qcow2_amend_opts.head),
+    .desc = {
+        BLOCK_CRYPTO_OPT_DEF_LUKS_STATE("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_KEYSLOT("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_OLD_SECRET("encrypt."),
+        BLOCK_CRYPTO_OPT_DEF_LUKS_NEW_SECRET("encrypt."),
         BLOCK_CRYPTO_OPT_DEF_LUKS_ITER_TIME("encrypt."),
-        {
-            .name = BLOCK_OPT_CLUSTER_SIZE,
-            .type = QEMU_OPT_SIZE,
-            .help = "qcow2 cluster size",
-            .def_value_str = stringify(DEFAULT_CLUSTER_SIZE)
-        },
-        {
-            .name = BLOCK_OPT_PREALLOC,
-            .type = QEMU_OPT_STRING,
-            .help = "Preallocation mode (allowed values: off, metadata, "
-                    "falloc, full)"
-        },
-        {
-            .name = BLOCK_OPT_LAZY_REFCOUNTS,
-            .type = QEMU_OPT_BOOL,
-            .help = "Postpone refcount updates",
-            .def_value_str = "off"
-        },
-        {
-            .name = BLOCK_OPT_REFCOUNT_BITS,
-            .type = QEMU_OPT_NUMBER,
-            .help = "Width of a reference count entry in bits",
-            .def_value_str = "16"
-        },
-        {
-            .name = BLOCK_OPT_COMPRESSION_TYPE,
-            .type = QEMU_OPT_STRING,
-            .help = "Compression method used for image cluster compression",
-            .def_value_str = "zlib"
-        },
+        QCOW_COMMON_OPTIONS,
         { /* end of list */ }
     }
 };
@@ -5791,10 +5845,12 @@ BlockDriver bdrv_qcow2 = {
     .bdrv_inactivate            = qcow2_inactivate,
 
     .create_opts         = &qcow2_create_opts,
+    .amend_opts          = &qcow2_amend_opts,
     .strong_runtime_opts = qcow2_strong_runtime_opts,
     .mutable_opts        = mutable_opts,
     .bdrv_co_check       = qcow2_co_check,
     .bdrv_amend_options  = qcow2_amend_options,
+    .bdrv_co_amend       = qcow2_co_amend,
 
     .bdrv_detach_aio_context  = qcow2_detach_aio_context,
     .bdrv_attach_aio_context  = qcow2_attach_aio_context,
diff --git a/block/qed.c b/block/qed.c
index c0c65015c7..ece8b9bb60 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -849,56 +849,18 @@ static BDRVQEDState *acb_to_s(QEDAIOCB *acb)
  * @s:              QED state
  * @pos:            Byte position in device
  * @qiov:           Destination I/O vector
- * @backing_qiov:   Possibly shortened copy of qiov, to be allocated here
- * @cb:             Completion function
- * @opaque:         User data for completion function
  *
  * This function reads qiov->size bytes starting at pos from the backing file.
  * If there is no backing file then zeroes are read.
  */
 static int coroutine_fn qed_read_backing_file(BDRVQEDState *s, uint64_t pos,
-                                              QEMUIOVector *qiov,
-                                              QEMUIOVector **backing_qiov)
+                                              QEMUIOVector *qiov)
 {
-    uint64_t backing_length = 0;
-    size_t size;
-    int ret;
-
-    /* If there is a backing file, get its length.  Treat the absence of a
-     * backing file like a zero length backing file.
-     */
     if (s->bs->backing) {
-        int64_t l = bdrv_getlength(s->bs->backing->bs);
-        if (l < 0) {
-            return l;
-        }
-        backing_length = l;
-    }
-
-    /* Zero all sectors if reading beyond the end of the backing file */
-    if (pos >= backing_length ||
-        pos + qiov->size > backing_length) {
-        qemu_iovec_memset(qiov, 0, 0, qiov->size);
-    }
-
-    /* Complete now if there are no backing file sectors to read */
-    if (pos >= backing_length) {
-        return 0;
-    }
-
-    /* If the read straddles the end of the backing file, shorten it */
-    size = MIN((uint64_t)backing_length - pos, qiov->size);
-
-    assert(*backing_qiov == NULL);
-    *backing_qiov = g_new(QEMUIOVector, 1);
-    qemu_iovec_init(*backing_qiov, qiov->niov);
-    qemu_iovec_concat(*backing_qiov, qiov, 0, size);
-
-    BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);
-    ret = bdrv_co_preadv(s->bs->backing, pos, size, *backing_qiov, 0);
-    if (ret < 0) {
-        return ret;
+        BLKDBG_EVENT(s->bs->file, BLKDBG_READ_BACKING_AIO);
+        return bdrv_co_preadv(s->bs->backing, pos, qiov->size, qiov, 0);
     }
+    qemu_iovec_memset(qiov, 0, 0, qiov->size);
     return 0;
 }
 
@@ -915,7 +877,6 @@ static int coroutine_fn qed_copy_from_backing_file(BDRVQEDState *s,
                                                    uint64_t offset)
 {
     QEMUIOVector qiov;
-    QEMUIOVector *backing_qiov = NULL;
     int ret;
 
     /* Skip copy entirely if there is no work to do */
@@ -925,13 +886,7 @@ static int coroutine_fn qed_copy_from_backing_file(BDRVQEDState *s,
 
     qemu_iovec_init_buf(&qiov, qemu_blockalign(s->bs, len), len);
 
-    ret = qed_read_backing_file(s, pos, &qiov, &backing_qiov);
-
-    if (backing_qiov) {
-        qemu_iovec_destroy(backing_qiov);
-        g_free(backing_qiov);
-        backing_qiov = NULL;
-    }
+    ret = qed_read_backing_file(s, pos, &qiov);
 
     if (ret) {
         goto out;
@@ -1339,8 +1294,7 @@ static int coroutine_fn qed_aio_read_data(void *opaque, int ret,
         qemu_iovec_memset(&acb->cur_qiov, 0, 0, acb->cur_qiov.size);
         r = 0;
     } else if (ret != QED_CLUSTER_FOUND) {
-        r = qed_read_backing_file(s, acb->cur_pos, &acb->cur_qiov,
-                                  &acb->backing_qiov);
+        r = qed_read_backing_file(s, acb->cur_pos, &acb->cur_qiov);
     } else {
         BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO);
         r = bdrv_co_preadv(bs->file, offset, acb->cur_qiov.size,
@@ -1365,12 +1319,6 @@ static int coroutine_fn qed_aio_next_io(QEDAIOCB *acb)
     while (1) {
         trace_qed_aio_next_io(s, acb, 0, acb->cur_pos + acb->cur_qiov.size);
 
-        if (acb->backing_qiov) {
-            qemu_iovec_destroy(acb->backing_qiov);
-            g_free(acb->backing_qiov);
-            acb->backing_qiov = NULL;
-        }
-
         acb->qiov_offset += acb->cur_qiov.size;
         acb->cur_pos += acb->cur_qiov.size;
         qemu_iovec_reset(&acb->cur_qiov);
@@ -1514,7 +1462,6 @@ static int bdrv_qed_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     memset(bdi, 0, sizeof(*bdi));
     bdi->cluster_size = s->header.cluster_size;
     bdi->is_dirty = s->header.features & QED_F_NEED_CHECK;
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
diff --git a/block/qed.h b/block/qed.h
index 42c115d822..3d12bf78d4 100644
--- a/block/qed.h
+++ b/block/qed.h
@@ -140,7 +140,6 @@ typedef struct QEDAIOCB {
 
     /* Current cluster scatter-gather list */
     QEMUIOVector cur_qiov;
-    QEMUIOVector *backing_qiov;
     uint64_t cur_pos;               /* position on block device, in bytes */
     uint64_t cur_cluster;           /* cluster offset in image file */
     unsigned int cur_nclusters;     /* number of clusters being accessed */
diff --git a/block/vdi.c b/block/vdi.c
index 2f506a01ba..c4527a9d8c 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -334,7 +334,6 @@ static int vdi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     logout("\n");
     bdi->cluster_size = s->block_size;
     bdi->vm_state_offset = 0;
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
@@ -536,7 +535,7 @@ static int coroutine_fn vdi_co_block_status(BlockDriverState *bs,
     *pnum = MIN(s->block_size - index_in_block, bytes);
     result = VDI_IS_ALLOCATED(bmap_entry);
     if (!result) {
-        return 0;
+        return BDRV_BLOCK_ZERO;
     }
 
     *map = s->header.offset_data + (uint64_t)bmap_entry * s->block_size +
diff --git a/block/vhdx.c b/block/vhdx.c
index fa9e544a5e..645dc4b4f4 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1164,9 +1164,6 @@ static int vhdx_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
 
     bdi->cluster_size = s->block_size;
 
-    bdi->unallocated_blocks_are_zero =
-        (s->params.data_bits & VHDX_PARAMS_HAS_PARENT) == 0;
-
     return 0;
 }
 
diff --git a/block/vpc.c b/block/vpc.c
index c055591641..01fcd37e3c 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -606,7 +606,6 @@ static int vpc_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
         bdi->cluster_size = s->block_size;
     }
 
-    bdi->unallocated_blocks_are_zero = true;
     return 0;
 }
 
@@ -745,7 +744,7 @@ static int coroutine_fn vpc_co_block_status(BlockDriverState *bs,
     image_offset = get_image_offset(bs, offset, false, NULL);
     allocated = (image_offset != -1);
     *pnum = 0;
-    ret = 0;
+    ret = BDRV_BLOCK_ZERO;
 
     do {
         /* All sectors in a block are contiguous (without using the bitmap) */
diff --git a/block/vvfat.c b/block/vvfat.c
index c65a98e3ee..2eb8cbb19f 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -140,48 +140,16 @@ static inline void* array_insert(array_t* array,unsigned int index,unsigned int
     return array->pointer+index*array->item_size;
 }
 
-/* this performs a "roll", so that the element which was at index_from becomes
- * index_to, but the order of all other elements is preserved. */
-static inline int array_roll(array_t* array,int index_to,int index_from,int count)
-{
-    char* buf;
-    char* from;
-    char* to;
-    int is;
-
-    if(!array ||
-            index_to<0 || index_to>=array->next ||
-            index_from<0 || index_from>=array->next)
-        return -1;
-
-    if(index_to==index_from)
-        return 0;
-
-    is=array->item_size;
-    from=array->pointer+index_from*is;
-    to=array->pointer+index_to*is;
-    buf=g_malloc(is*count);
-    memcpy(buf,from,is*count);
-
-    if(index_to<index_from)
-        memmove(to+is*count,to,from-to);
-    else
-        memmove(from,from+is*count,to-from);
-
-    memcpy(to,buf,is*count);
-
-    g_free(buf);
-
-    return 0;
-}
-
 static inline int array_remove_slice(array_t* array,int index, int count)
 {
     assert(index >=0);
     assert(count > 0);
     assert(index + count <= array->next);
-    if(array_roll(array,array->next-1,index,count))
-        return -1;
+
+    memmove(array->pointer + index * array->item_size,
+            array->pointer + (index + count) * array->item_size,
+            (array->next - index - count) * array->item_size);
+
     array->next -= count;
     return 0;
 }
@@ -520,12 +488,31 @@ static void set_begin_of_direntry(direntry_t* direntry, uint32_t begin)
     direntry->begin_hi = cpu_to_le16((begin >> 16) & 0xffff);
 }
 
+static bool valid_filename(const unsigned char *name)
+{
+    unsigned char c;
+    if (!strcmp((const char*)name, ".") || !strcmp((const char*)name, "..")) {
+        return false;
+    }
+    for (; (c = *name); name++) {
+        if (!((c >= '0' && c <= '9') ||
+              (c >= 'A' && c <= 'Z') ||
+              (c >= 'a' && c <= 'z') ||
+              c > 127 ||
+              strchr("$%'-_@~`!(){}^#&.+,;=[]", c) != NULL))
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
 static uint8_t to_valid_short_char(gunichar c)
 {
     c = g_unichar_toupper(c);
     if ((c >= '0' && c <= '9') ||
         (c >= 'A' && c <= 'Z') ||
-        strchr("$%'-_@~`!(){}^#&", c) != 0) {
+        strchr("$%'-_@~`!(){}^#&", c) != NULL) {
         return c;
     } else {
         return 0;
@@ -2098,6 +2085,10 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i))
             }
             lfn.checksum = 0x100; /* cannot use long name twice */
 
+            if (!valid_filename(lfn.name)) {
+                fprintf(stderr, "Invalid file name\n");
+                goto fail;
+            }
             if (path_len + 1 + lfn.len >= PATH_MAX) {
                 fprintf(stderr, "Name too long: %s/%s\n", path, lfn.name);
                 goto fail;
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 0bfe46cff9..ac40d79bfa 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -413,7 +413,11 @@ static void save_window(CPUSPARCState *env)
     save_window_offset(env, cpu_cwp_dec(env, env->cwp - 2));
     env->wim = new_wim;
 #else
-    save_window_offset(env, cpu_cwp_dec(env, env->cwp - 2));
+    /*
+     * cansave is zero if the spill trap handler is triggered by `save` and
+     * nonzero if triggered by a `flushw`
+     */
+    save_window_offset(env, cpu_cwp_dec(env, env->cwp - env->cansave - 2));
     env->cansave++;
     env->canrestore--;
 #endif
diff --git a/configure b/configure
index 8a65240d4a..ee6c3c6792 100755
--- a/configure
+++ b/configure
@@ -1575,6 +1575,10 @@ for opt do
   ;;
   --enable-vhost-user) vhost_user="yes"
   ;;
+  --disable-vhost-vdpa) vhost_vdpa="no"
+  ;;
+  --enable-vhost-vdpa) vhost_vdpa="yes"
+  ;;
   --disable-vhost-kernel) vhost_kernel="no"
   ;;
   --enable-vhost-kernel) vhost_kernel="yes"
@@ -1883,6 +1887,7 @@ disabled with --disable-FEATURE, default is enabled if available:
   vhost-crypto    vhost-user-crypto backend support
   vhost-kernel    vhost kernel backend support
   vhost-user      vhost-user backend support
+  vhost-vdpa      vhost-vdpa kernel backend support
   spice           spice
   rbd             rados block device (rbd)
   libiscsi        iscsi support
@@ -2394,6 +2399,10 @@ test "$vhost_user" = "" && vhost_user=yes
 if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then
   error_exit "vhost-user isn't available on win32"
 fi
+test "$vhost_vdpa" = "" && vhost_vdpa=$linux
+if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
+  error_exit "vhost-vdpa is only available on Linux"
+fi
 test "$vhost_kernel" = "" && vhost_kernel=$linux
 if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then
   error_exit "vhost-kernel is only available on Linux"
@@ -2422,6 +2431,11 @@ test "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user
 if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then
   error_exit "--enable-vhost-user-fs requires --enable-vhost-user"
 fi
+#vhost-vdpa backends
+test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa
+if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then
+  error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa"
+fi
 
 # OR the vhost-kernel and vhost-user values for simplicity
 if test "$vhost_net" = ""; then
@@ -3194,6 +3208,13 @@ if ! check_include "ifaddrs.h" ; then
   have_ifaddrs_h=no
 fi
 
+#########################################
+# libdrm check
+have_drm_h=no
+if check_include "libdrm/drm.h" ; then
+    have_drm_h=yes
+fi
+
 ##########################################
 # VTE probe
 
@@ -5134,10 +5155,14 @@ extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
 int main(void) { return openpty(0, 0, 0, 0, 0); }
 EOF
 
-if ! compile_prog "" "" ; then
+have_openpty="no"
+if compile_prog "" "" ; then
+  have_openpty="yes"
+else
   if compile_prog "" "-lutil" ; then
     libs_softmmu="-lutil $libs_softmmu"
     libs_tools="-lutil $libs_tools"
+    have_openpty="yes"
   fi
 fi
 
@@ -6936,6 +6961,7 @@ echo "vhost-scsi support $vhost_scsi"
 echo "vhost-vsock support $vhost_vsock"
 echo "vhost-user support $vhost_user"
 echo "vhost-user-fs support $vhost_user_fs"
+echo "vhost-vdpa support $vhost_vdpa"
 echo "Trace backends    $trace_backends"
 if have_backend "simple"; then
 echo "Trace output file $trace_file-<pid>"
@@ -7377,9 +7403,15 @@ fi
 if test "$have_ifaddrs_h" = "yes" ; then
     echo "HAVE_IFADDRS_H=y" >> $config_host_mak
 fi
+if test "$have_drm_h" = "yes" ; then
+  echo "HAVE_DRM_H=y" >> $config_host_mak
+fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
+if test "$have_openpty" = "yes" ; then
+    echo "HAVE_OPENPTY=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
@@ -7437,6 +7469,9 @@ fi
 if test "$vhost_net_user" = "yes" ; then
   echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
 fi
+if test "$vhost_net_vdpa" = "yes" ; then
+  echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak
+fi
 if test "$vhost_crypto" = "yes" ; then
   echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
 fi
@@ -7452,6 +7487,9 @@ fi
 if test "$vhost_user" = "yes" ; then
   echo "CONFIG_VHOST_USER=y" >> $config_host_mak
 fi
+if test "$vhost_vdpa" = "yes" ; then
+  echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
+fi
 if test "$vhost_user_fs" = "yes" ; then
   echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
 fi
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 4861db810c..564caa1094 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -32,6 +32,7 @@
 #include "qemu/uuid.h"
 
 #include "qemu/coroutine.h"
+#include "qemu/bitmap.h"
 
 /*
  * Reference for the LUKS format implemented here is
@@ -70,6 +71,9 @@ typedef struct QCryptoBlockLUKSKeySlot QCryptoBlockLUKSKeySlot;
 
 #define QCRYPTO_BLOCK_LUKS_SECTOR_SIZE 512LL
 
+#define QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS 2000
+#define QCRYPTO_BLOCK_LUKS_ERASE_ITERATIONS 40
+
 static const char qcrypto_block_luks_magic[QCRYPTO_BLOCK_LUKS_MAGIC_LEN] = {
     'L', 'U', 'K', 'S', 0xBA, 0xBE
 };
@@ -219,6 +223,9 @@ struct QCryptoBlockLUKS {
 
     /* Hash algorithm used in pbkdf2 function */
     QCryptoHashAlgorithm hash_alg;
+
+    /* Name of the secret that was used to open the image */
+    char *secret;
 };
 
 
@@ -720,7 +727,7 @@ qcrypto_block_luks_store_key(QCryptoBlock *block,
                              Error **errp)
 {
     QCryptoBlockLUKS *luks = block->opaque;
-    QCryptoBlockLUKSKeySlot *slot = &luks->header.key_slots[slot_idx];
+    QCryptoBlockLUKSKeySlot *slot;
     g_autofree uint8_t *splitkey = NULL;
     size_t splitkeylen;
     g_autofree uint8_t *slotkey = NULL;
@@ -730,6 +737,8 @@ qcrypto_block_luks_store_key(QCryptoBlock *block,
     uint64_t iters;
     int ret = -1;
 
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
     if (qcrypto_random_bytes(slot->salt,
                              QCRYPTO_BLOCK_LUKS_SALT_LEN,
                              errp) < 0) {
@@ -890,7 +899,7 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
                             Error **errp)
 {
     QCryptoBlockLUKS *luks = block->opaque;
-    const QCryptoBlockLUKSKeySlot *slot = &luks->header.key_slots[slot_idx];
+    const QCryptoBlockLUKSKeySlot *slot;
     g_autofree uint8_t *splitkey = NULL;
     size_t splitkeylen;
     g_autofree uint8_t *possiblekey = NULL;
@@ -900,6 +909,8 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
     g_autoptr(QCryptoIVGen) ivgen = NULL;
     size_t niv;
 
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
     if (slot->active != QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED) {
         return 0;
     }
@@ -1069,6 +1080,126 @@ qcrypto_block_luks_find_key(QCryptoBlock *block,
     return -1;
 }
 
+/*
+ * Returns true if a slot i is marked as active
+ * (contains encrypted copy of the master key)
+ */
+static bool
+qcrypto_block_luks_slot_active(const QCryptoBlockLUKS *luks,
+                               unsigned int slot_idx)
+{
+    uint32_t val;
+
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    val = luks->header.key_slots[slot_idx].active;
+    return val == QCRYPTO_BLOCK_LUKS_KEY_SLOT_ENABLED;
+}
+
+/*
+ * Returns the number of slots that are marked as active
+ * (slots that contain encrypted copy of the master key)
+ */
+static unsigned int
+qcrypto_block_luks_count_active_slots(const QCryptoBlockLUKS *luks)
+{
+    size_t i = 0;
+    unsigned int ret = 0;
+
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+        if (qcrypto_block_luks_slot_active(luks, i)) {
+            ret++;
+        }
+    }
+    return ret;
+}
+
+/*
+ * Finds first key slot which is not active
+ * Returns the key slot index, or -1 if it doesn't exist
+ */
+static int
+qcrypto_block_luks_find_free_keyslot(const QCryptoBlockLUKS *luks)
+{
+    size_t i;
+
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+        if (!qcrypto_block_luks_slot_active(luks, i)) {
+            return i;
+        }
+    }
+    return -1;
+}
+
+/*
+ * Erases an keyslot given its index
+ * Returns:
+ *    0 if the keyslot was erased successfully
+ *   -1 if a error occurred while erasing the keyslot
+ *
+ */
+static int
+qcrypto_block_luks_erase_key(QCryptoBlock *block,
+                             unsigned int slot_idx,
+                             QCryptoBlockWriteFunc writefunc,
+                             void *opaque,
+                             Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    QCryptoBlockLUKSKeySlot *slot;
+    g_autofree uint8_t *garbagesplitkey = NULL;
+    size_t splitkeylen;
+    size_t i;
+    Error *local_err = NULL;
+    int ret;
+
+    assert(slot_idx < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+    slot = &luks->header.key_slots[slot_idx];
+
+    splitkeylen = luks->header.master_key_len * slot->stripes;
+    assert(splitkeylen > 0);
+
+    garbagesplitkey = g_new0(uint8_t, splitkeylen);
+
+    /* Reset the key slot header */
+    memset(slot->salt, 0, QCRYPTO_BLOCK_LUKS_SALT_LEN);
+    slot->iterations = 0;
+    slot->active = QCRYPTO_BLOCK_LUKS_KEY_SLOT_DISABLED;
+
+    ret = qcrypto_block_luks_store_header(block, writefunc,
+                                          opaque, &local_err);
+
+    if (ret < 0) {
+        error_propagate(errp, local_err);
+    }
+    /*
+     * Now try to erase the key material, even if the header
+     * update failed
+     */
+    for (i = 0; i < QCRYPTO_BLOCK_LUKS_ERASE_ITERATIONS; i++) {
+        if (qcrypto_random_bytes(garbagesplitkey,
+                                 splitkeylen, &local_err) < 0) {
+            /*
+             * If we failed to get the random data, still write
+             * at least zeros to the key slot at least once
+             */
+            error_propagate(errp, local_err);
+
+            if (i > 0) {
+                return -1;
+            }
+        }
+        if (writefunc(block,
+                      slot->key_offset_sector * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
+                      garbagesplitkey,
+                      splitkeylen,
+                      opaque,
+                      &local_err) != splitkeylen) {
+            error_propagate(errp, local_err);
+            return -1;
+        }
+    }
+    return ret;
+}
 
 static int
 qcrypto_block_luks_open(QCryptoBlock *block,
@@ -1099,6 +1230,7 @@ qcrypto_block_luks_open(QCryptoBlock *block,
 
     luks = g_new0(QCryptoBlockLUKS, 1);
     block->opaque = luks;
+    luks->secret = g_strdup(options->u.luks.key_secret);
 
     if (qcrypto_block_luks_load_header(block, readfunc, opaque, errp) < 0) {
         goto fail;
@@ -1164,6 +1296,7 @@ qcrypto_block_luks_open(QCryptoBlock *block,
  fail:
     qcrypto_block_free_cipher(block);
     qcrypto_ivgen_free(block->ivgen);
+    g_free(luks->secret);
     g_free(luks);
     return -1;
 }
@@ -1204,7 +1337,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
 
     memcpy(&luks_opts, &options->u.luks, sizeof(luks_opts));
     if (!luks_opts.has_iter_time) {
-        luks_opts.iter_time = 2000;
+        luks_opts.iter_time = QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS;
     }
     if (!luks_opts.has_cipher_alg) {
         luks_opts.cipher_alg = QCRYPTO_CIPHER_ALG_AES_256;
@@ -1244,6 +1377,8 @@ qcrypto_block_luks_create(QCryptoBlock *block,
                    optprefix ? optprefix : "");
         goto error;
     }
+    luks->secret = g_strdup(options->u.luks.key_secret);
+
     password = qcrypto_secret_lookup_as_utf8(luks_opts.key_secret, errp);
     if (!password) {
         goto error;
@@ -1471,10 +1606,278 @@ qcrypto_block_luks_create(QCryptoBlock *block,
     qcrypto_block_free_cipher(block);
     qcrypto_ivgen_free(block->ivgen);
 
+    g_free(luks->secret);
     g_free(luks);
     return -1;
 }
 
+static int
+qcrypto_block_luks_amend_add_keyslot(QCryptoBlock *block,
+                                     QCryptoBlockReadFunc readfunc,
+                                     QCryptoBlockWriteFunc writefunc,
+                                     void *opaque,
+                                     QCryptoBlockAmendOptionsLUKS *opts_luks,
+                                     bool force,
+                                     Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    uint64_t iter_time = opts_luks->has_iter_time ?
+                         opts_luks->iter_time :
+                         QCRYPTO_BLOCK_LUKS_DEFAULT_ITER_TIME_MS;
+    int keyslot;
+    g_autofree char *old_password = NULL;
+    g_autofree char *new_password = NULL;
+    g_autofree uint8_t *master_key = NULL;
+
+    char *secret = opts_luks->has_secret ? opts_luks->secret : luks->secret;
+
+    if (!opts_luks->has_new_secret) {
+        error_setg(errp, "'new-secret' is required to activate a keyslot");
+        return -1;
+    }
+    if (opts_luks->has_old_secret) {
+        error_setg(errp,
+                   "'old-secret' must not be given when activating keyslots");
+        return -1;
+    }
+
+    if (opts_luks->has_keyslot) {
+        keyslot = opts_luks->keyslot;
+        if (keyslot < 0 || keyslot >= QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS) {
+            error_setg(errp,
+                       "Invalid keyslot %u specified, must be between 0 and %u",
+                       keyslot, QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS - 1);
+            return -1;
+        }
+    } else {
+        keyslot = qcrypto_block_luks_find_free_keyslot(luks);
+        if (keyslot == -1) {
+            error_setg(errp,
+                       "Can't add a keyslot - all keyslots are in use");
+            return -1;
+        }
+    }
+
+    if (!force && qcrypto_block_luks_slot_active(luks, keyslot)) {
+        error_setg(errp,
+                   "Refusing to overwrite active keyslot %i - "
+                   "please erase it first",
+                   keyslot);
+        return -1;
+    }
+
+    /* Locate the password that will be used to retrieve the master key */
+    old_password = qcrypto_secret_lookup_as_utf8(secret, errp);
+    if (!old_password) {
+        return -1;
+    }
+
+    /* Retrieve the master key */
+    master_key = g_new0(uint8_t, luks->header.master_key_len);
+
+    if (qcrypto_block_luks_find_key(block, old_password, master_key,
+                                    readfunc, opaque, errp) < 0) {
+        error_append_hint(errp, "Failed to retrieve the master key");
+        return -1;
+    }
+
+    /* Locate the new password*/
+    new_password = qcrypto_secret_lookup_as_utf8(opts_luks->new_secret, errp);
+    if (!new_password) {
+        return -1;
+    }
+
+    /* Now set the new keyslots */
+    if (qcrypto_block_luks_store_key(block, keyslot, new_password, master_key,
+                                     iter_time, writefunc, opaque, errp)) {
+        error_append_hint(errp, "Failed to write to keyslot %i", keyslot);
+        return -1;
+    }
+    return 0;
+}
+
+static int
+qcrypto_block_luks_amend_erase_keyslots(QCryptoBlock *block,
+                                        QCryptoBlockReadFunc readfunc,
+                                        QCryptoBlockWriteFunc writefunc,
+                                        void *opaque,
+                                        QCryptoBlockAmendOptionsLUKS *opts_luks,
+                                        bool force,
+                                        Error **errp)
+{
+    QCryptoBlockLUKS *luks = block->opaque;
+    g_autofree uint8_t *tmpkey = NULL;
+    g_autofree char *old_password = NULL;
+
+    if (opts_luks->has_new_secret) {
+        error_setg(errp,
+                   "'new-secret' must not be given when erasing keyslots");
+        return -1;
+    }
+    if (opts_luks->has_iter_time) {
+        error_setg(errp,
+                   "'iter-time' must not be given when erasing keyslots");
+        return -1;
+    }
+    if (opts_luks->has_secret) {
+        error_setg(errp,
+                   "'secret' must not be given when erasing keyslots");
+        return -1;
+    }
+
+    /* Load the old password if given */
+    if (opts_luks->has_old_secret) {
+        old_password = qcrypto_secret_lookup_as_utf8(opts_luks->old_secret,
+                                                     errp);
+        if (!old_password) {
+            return -1;
+        }
+
+        /*
+         * Allocate a temporary key buffer that we will need when
+         * checking if slot matches the given old password
+         */
+        tmpkey = g_new0(uint8_t, luks->header.master_key_len);
+    }
+
+    /* Erase an explicitly given keyslot */
+    if (opts_luks->has_keyslot) {
+        int keyslot = opts_luks->keyslot;
+
+        if (keyslot < 0 || keyslot >= QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS) {
+            error_setg(errp,
+                       "Invalid keyslot %i specified, must be between 0 and %i",
+                       keyslot, QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS - 1);
+            return -1;
+        }
+
+        if (opts_luks->has_old_secret) {
+            int rv = qcrypto_block_luks_load_key(block,
+                                                 keyslot,
+                                                 old_password,
+                                                 tmpkey,
+                                                 readfunc,
+                                                 opaque,
+                                                 errp);
+            if (rv == -1) {
+                return -1;
+            } else if (rv == 0) {
+                error_setg(errp,
+                           "Given keyslot %i doesn't contain the given "
+                           "old password for erase operation",
+                           keyslot);
+                return -1;
+            }
+        }
+
+        if (!force && !qcrypto_block_luks_slot_active(luks, keyslot)) {
+            error_setg(errp,
+                       "Given keyslot %i is already erased (inactive) ",
+                       keyslot);
+            return -1;
+        }
+
+        if (!force && qcrypto_block_luks_count_active_slots(luks) == 1) {
+            error_setg(errp,
+                       "Attempt to erase the only active keyslot %i "
+                       "which will erase all the data in the image "
+                       "irreversibly - refusing operation",
+                       keyslot);
+            return -1;
+        }
+
+        if (qcrypto_block_luks_erase_key(block, keyslot,
+                                         writefunc, opaque, errp)) {
+            error_append_hint(errp, "Failed to erase keyslot %i", keyslot);
+            return -1;
+        }
+
+    /* Erase all keyslots that match the given old password */
+    } else if (opts_luks->has_old_secret) {
+
+        unsigned long slots_to_erase_bitmap = 0;
+        size_t i;
+        int slot_count;
+
+        assert(QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS <=
+               sizeof(slots_to_erase_bitmap) * 8);
+
+        for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+            int rv = qcrypto_block_luks_load_key(block,
+                                                 i,
+                                                 old_password,
+                                                 tmpkey,
+                                                 readfunc,
+                                                 opaque,
+                                                 errp);
+            if (rv == -1) {
+                return -1;
+            } else if (rv == 1) {
+                bitmap_set(&slots_to_erase_bitmap, i, 1);
+            }
+        }
+
+        slot_count = bitmap_count_one(&slots_to_erase_bitmap,
+                                      QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS);
+        if (slot_count == 0) {
+            error_setg(errp,
+                       "No keyslots match given (old) password for erase operation");
+            return -1;
+        }
+
+        if (!force &&
+            slot_count == qcrypto_block_luks_count_active_slots(luks)) {
+            error_setg(errp,
+                       "All the active keyslots match the (old) password that "
+                       "was given and erasing them will erase all the data in "
+                       "the image irreversibly - refusing operation");
+            return -1;
+        }
+
+        /* Now apply the update */
+        for (i = 0; i < QCRYPTO_BLOCK_LUKS_NUM_KEY_SLOTS; i++) {
+            if (!test_bit(i, &slots_to_erase_bitmap)) {
+                continue;
+            }
+            if (qcrypto_block_luks_erase_key(block, i, writefunc,
+                opaque, errp)) {
+                error_append_hint(errp, "Failed to erase keyslot %zu", i);
+                return -1;
+            }
+        }
+    } else {
+        error_setg(errp,
+                   "To erase keyslot(s), either explicit keyslot index "
+                   "or the password currently contained in them must be given");
+        return -1;
+    }
+    return 0;
+}
+
+static int
+qcrypto_block_luks_amend_options(QCryptoBlock *block,
+                                 QCryptoBlockReadFunc readfunc,
+                                 QCryptoBlockWriteFunc writefunc,
+                                 void *opaque,
+                                 QCryptoBlockAmendOptions *options,
+                                 bool force,
+                                 Error **errp)
+{
+    QCryptoBlockAmendOptionsLUKS *opts_luks = &options->u.luks;
+
+    switch (opts_luks->state) {
+    case Q_CRYPTO_BLOCKLUKS_KEYSLOT_STATE_ACTIVE:
+        return qcrypto_block_luks_amend_add_keyslot(block, readfunc,
+                                                    writefunc, opaque,
+                                                    opts_luks, force, errp);
+    case Q_CRYPTO_BLOCKLUKS_KEYSLOT_STATE_INACTIVE:
+        return qcrypto_block_luks_amend_erase_keyslots(block, readfunc,
+                                                       writefunc, opaque,
+                                                       opts_luks, force, errp);
+    default:
+        g_assert_not_reached();
+    }
+}
 
 static int qcrypto_block_luks_get_info(QCryptoBlock *block,
                                        QCryptoBlockInfo *info,
@@ -1523,7 +1926,11 @@ static int qcrypto_block_luks_get_info(QCryptoBlock *block,
 
 static void qcrypto_block_luks_cleanup(QCryptoBlock *block)
 {
-    g_free(block->opaque);
+    QCryptoBlockLUKS *luks = block->opaque;
+    if (luks) {
+        g_free(luks->secret);
+        g_free(luks);
+    }
 }
 
 
@@ -1560,6 +1967,7 @@ qcrypto_block_luks_encrypt(QCryptoBlock *block,
 const QCryptoBlockDriver qcrypto_block_driver_luks = {
     .open = qcrypto_block_luks_open,
     .create = qcrypto_block_luks_create,
+    .amend = qcrypto_block_luks_amend_options,
     .get_info = qcrypto_block_luks_get_info,
     .cleanup = qcrypto_block_luks_cleanup,
     .decrypt = qcrypto_block_luks_decrypt,
diff --git a/crypto/block.c b/crypto/block.c
index 6f42b32f1e..eb057948b5 100644
--- a/crypto/block.c
+++ b/crypto/block.c
@@ -150,6 +150,35 @@ qcrypto_block_calculate_payload_offset(QCryptoBlockCreateOptions *create_opts,
     return crypto != NULL;
 }
 
+int qcrypto_block_amend_options(QCryptoBlock *block,
+                                QCryptoBlockReadFunc readfunc,
+                                QCryptoBlockWriteFunc writefunc,
+                                void *opaque,
+                                QCryptoBlockAmendOptions *options,
+                                bool force,
+                                Error **errp)
+{
+    if (options->format != block->format) {
+        error_setg(errp,
+                   "Cannot amend encryption format");
+        return -1;
+    }
+
+    if (!block->driver->amend) {
+        error_setg(errp,
+                   "Crypto format %s doesn't support format options amendment",
+                   QCryptoBlockFormat_str(block->format));
+        return -1;
+    }
+
+    return block->driver->amend(block,
+                                readfunc,
+                                writefunc,
+                                opaque,
+                                options,
+                                force,
+                                errp);
+}
 
 QCryptoBlockInfo *qcrypto_block_get_info(QCryptoBlock *block,
                                          Error **errp)
diff --git a/crypto/blockpriv.h b/crypto/blockpriv.h
index 71c59cb542..3c7ccea504 100644
--- a/crypto/blockpriv.h
+++ b/crypto/blockpriv.h
@@ -62,6 +62,14 @@ struct QCryptoBlockDriver {
                   void *opaque,
                   Error **errp);
 
+    int (*amend)(QCryptoBlock *block,
+                 QCryptoBlockReadFunc readfunc,
+                 QCryptoBlockWriteFunc writefunc,
+                 void *opaque,
+                 QCryptoBlockAmendOptions *options,
+                 bool force,
+                 Error **errp);
+
     int (*get_info)(QCryptoBlock *block,
                     QCryptoBlockInfo *info,
                     Error **errp);
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
index 049387ac6d..006f986420 100644
--- a/docs/interop/index.rst
+++ b/docs/interop/index.rst
@@ -20,3 +20,4 @@ Contents:
    qemu-ga
    vhost-user
    vhost-user-gpu
+   vhost-vdpa
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 688b7c6900..10e3e3475e 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -816,6 +816,7 @@ Protocol features
   #define VHOST_USER_PROTOCOL_F_RESET_DEVICE         13
   #define VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS 14
   #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS  15
+  #define VHOST_USER_PROTOCOL_F_STATUS               16
 
 Master message types
 --------------------
@@ -1307,6 +1308,29 @@ Master message types
   ``VHOST_USER_ADD_MEM_REG`` message, this message is used to set and
   update the memory tables of the slave device.
 
+``VHOST_USER_SET_STATUS``
+  :id: 39
+  :equivalent ioctl: VHOST_VDPA_SET_STATUS
+  :slave payload: N/A
+  :master payload: ``u64``
+
+  When the ``VHOST_USER_PROTOCOL_F_STATUS`` protocol feature has been
+  successfully negotiated, this message is submitted by the master to
+  notify the backend with updated device status as defined in the Virtio
+  specification.
+
+``VHOST_USER_GET_STATUS``
+  :id: 40
+  :equivalent ioctl: VHOST_VDPA_GET_STATUS
+  :slave payload: ``u64``
+  :master payload: N/A
+
+  When the ``VHOST_USER_PROTOCOL_F_STATUS`` protocol feature has been
+  successfully negotiated, this message is submitted by the master to
+  query the backend for its device status as defined in the Virtio
+  specification.
+
+
 Slave message types
 -------------------
 
diff --git a/docs/interop/vhost-vdpa.rst b/docs/interop/vhost-vdpa.rst
new file mode 100644
index 0000000000..0c70ba01bc
--- /dev/null
+++ b/docs/interop/vhost-vdpa.rst
@@ -0,0 +1,17 @@
+=====================
+Vhost-vdpa Protocol
+=====================
+
+Introduction
+=============
+vDPA(Virtual data path acceleration) device is a device that uses
+a datapath which complies with the virtio specifications with vendor
+specific control path. vDPA devices can be both physically located on
+the hardware or emulated by software.
+
+This document describes the vDPA support in qemu
+
+Here is the kernel commit here
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4c8cf31885f69e86be0b5b9e6677a26797365e1d
+
+TODO : More information will add later
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 843ae71fc6..58a9aeb851 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -82,6 +82,15 @@ should specify an ``audiodev=`` property.  Additionally, when using
 vnc, you should specify an ``audiodev=`` propery if you plan to
 transmit audio through the VNC protocol.
 
+Creating sound card devices using ``-soundhw`` (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Sound card devices should be created using ``-device`` instead.  The
+names are the same for most devices.  The exceptions are ``hda`` which
+needs two devices (``-device intel-hda -device hda-duplex``) and
+``pcspk`` which can be activated using ``-machine
+pcspk-audiodev=<name>``.
+
 ``-mon ...,control=readline,pretty=on|off`` (since 4.1)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
@@ -404,6 +413,17 @@ The above, converted to the current supported format::
 
   json:{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"}
 
+linux-user mode CPUs
+--------------------
+
+``tilegx`` CPUs (since 5.1.0)
+'''''''''''''''''''''''''''''
+
+The ``tilegx`` guest CPU support (which was only implemented in
+linux-user mode) is deprecated and will be removed in a future version
+of QEMU. Support for this CPU was removed from the upstream Linux
+kernel in 2018, and has also been dropped from glibc.
+
 Related binaries
 ----------------
 
diff --git a/docs/system/target-i386-desc.rst.inc b/docs/system/target-i386-desc.rst.inc
index 47a169e0ae..7d1fffacbe 100644
--- a/docs/system/target-i386-desc.rst.inc
+++ b/docs/system/target-i386-desc.rst.inc
@@ -31,6 +31,8 @@ The QEMU PC System emulator simulates the following peripherals:
 
 -  CS4231A compatible sound card
 
+-  PC speaker
+
 -  PCI UHCI, OHCI, EHCI or XHCI USB controller and a virtual USB-1.1
    hub.
 
@@ -49,7 +51,7 @@ must be told to not have parallel ports to have working GUS.
 
 .. parsed-literal::
 
-   |qemu_system_x86| dos.img -soundhw gus -parallel none
+   |qemu_system_x86| dos.img -device gus -parallel none
 
 Alternatively:
 
@@ -60,3 +62,12 @@ Alternatively:
 Or some other unclaimed IRQ.
 
 CS4231A is the chip used in Windows Sound System and GUSMAX products
+
+The PC speaker audio device can be configured using the pcspk-audiodev
+machine property, i.e.
+
+.. parsed-literal::
+
+   |qemu_system_x86| some.img \
+   -audiodev <backend>,id=<name> \
+   -machine pcspk-audiodev=<name>
diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
index 7f0737488a..e33f5575e3 100644
--- a/docs/tools/qemu-img.rst
+++ b/docs/tools/qemu-img.rst
@@ -253,11 +253,14 @@ Command description:
 
 .. program:: qemu-img-commands
 
-.. option:: amend [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] -o OPTIONS FILENAME
+.. option:: amend [--object OBJECTDEF] [--image-opts] [-p] [-q] [-f FMT] [-t CACHE] [--force] -o OPTIONS FILENAME
 
   Amends the image format specific *OPTIONS* for the image file
   *FILENAME*. Not all file formats support this operation.
 
+  --force allows some unsafe operations. Currently for -f luks, it allows to
+  erase the last encryption key, and to overwrite an active encryption key.
+
 .. option:: bench [-c COUNT] [-d DEPTH] [-f FMT] [--flush-interval=FLUSH_INTERVAL] [-i AIO] [-n] [--no-drain] [-o OFFSET] [--pattern=PATTERN] [-q] [-s BUFFER_SIZE] [-S STEP_SIZE] [-t CACHE] [-w] [-U] FILENAME
 
   Run a simple sequential I/O benchmark on the specified image. If ``-w`` is
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
index 378594c422..824e713491 100644
--- a/docs/tools/virtiofsd.rst
+++ b/docs/tools/virtiofsd.rst
@@ -54,6 +54,11 @@ Options
   * flock|no_flock -
     Enable/disable flock.  The default is ``no_flock``.
 
+  * modcaps=CAPLIST
+    Modify the list of capabilities allowed; CAPLIST is a colon separated
+    list of capabilities, each preceded by either + or -, e.g.
+    ''+sys_admin:-chown''.
+
   * log_level=LEVEL -
     Print only log messages matching LEVEL or more severe.  LEVEL is one of
     ``err``, ``warn``, ``info``, or ``debug``.  The default is ``info``.
diff --git a/exec.c b/exec.c
index 21926dc9c7..893636176e 100644
--- a/exec.c
+++ b/exec.c
@@ -4115,4 +4115,56 @@ void mtree_print_dispatch(AddressSpaceDispatch *d, MemoryRegion *root)
     }
 }
 
+/*
+ * If positive, discarding RAM is disabled. If negative, discarding RAM is
+ * required to work and cannot be disabled.
+ */
+static int ram_block_discard_disabled;
+
+int ram_block_discard_disable(bool state)
+{
+    int old;
+
+    if (!state) {
+        atomic_dec(&ram_block_discard_disabled);
+        return 0;
+    }
+
+    do {
+        old = atomic_read(&ram_block_discard_disabled);
+        if (old < 0) {
+            return -EBUSY;
+        }
+    } while (atomic_cmpxchg(&ram_block_discard_disabled, old, old + 1) != old);
+    return 0;
+}
+
+int ram_block_discard_require(bool state)
+{
+    int old;
+
+    if (!state) {
+        atomic_inc(&ram_block_discard_disabled);
+        return 0;
+    }
+
+    do {
+        old = atomic_read(&ram_block_discard_disabled);
+        if (old > 0) {
+            return -EBUSY;
+        }
+    } while (atomic_cmpxchg(&ram_block_discard_disabled, old, old - 1) != old);
+    return 0;
+}
+
+bool ram_block_discard_is_disabled(void)
+{
+    return atomic_read(&ram_block_discard_disabled) > 0;
+}
+
+bool ram_block_discard_is_required(void)
+{
+    return atomic_read(&ram_block_discard_disabled) < 0;
+}
+
 #endif
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
index 6446034711..51b2f256ec 100644
--- a/hw/arm/fsl-imx6ul.c
+++ b/hw/arm/fsl-imx6ul.c
@@ -427,6 +427,9 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_ENET2_TIMER_IRQ,
         };
 
+        object_property_set_uint(OBJECT(&s->eth[i]),
+                                 s->phy_num[i],
+                                 "phy-num", &error_abort);
         object_property_set_uint(OBJECT(&s->eth[i]),
                                  FSL_IMX6UL_ETH_NUM_TX_RINGS,
                                  "tx-ring-num", &error_abort);
@@ -607,10 +610,17 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
                                 FSL_IMX6UL_OCRAM_ALIAS_ADDR, &s->ocram_alias);
 }
 
+static Property fsl_imx6ul_properties[] = {
+    DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0),
+    DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx6ul_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx6ul_properties);
     dc->realize = fsl_imx6ul_realize;
     dc->desc = "i.MX6UL SOC";
     /* Reason: Uses serial_hds and nd_table in realize() directly */
diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c
index 2f845cedfc..9033d3f8f3 100644
--- a/hw/arm/mcimx6ul-evk.c
+++ b/hw/arm/mcimx6ul-evk.c
@@ -40,6 +40,8 @@ static void mcimx6ul_evk_init(MachineState *machine)
 
     s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
     object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
+    object_property_set_uint(OBJECT(s), 2, "fec1-phy-num", &error_fatal);
+    object_property_set_uint(OBJECT(s), 1, "fec2-phy-num", &error_fatal);
     qdev_realize(DEVICE(s), NULL, &error_fatal);
 
     memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c
index 105c5e63f2..ceee6aa48d 100644
--- a/hw/arm/pxa2xx_pic.c
+++ b/hw/arm/pxa2xx_pic.c
@@ -11,6 +11,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "qemu/log.h"
 #include "cpu.h"
 #include "hw/arm/pxa.h"
 #include "hw/sysbus.h"
@@ -166,7 +167,9 @@ static uint64_t pxa2xx_pic_mem_read(void *opaque, hwaddr offset,
     case ICHP:	/* Highest Priority register */
         return pxa2xx_pic_highest(s);
     default:
-        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pxa2xx_pic_mem_read: bad register offset 0x%" HWADDR_PRIx
+                      "\n", offset);
         return 0;
     }
 }
@@ -199,7 +202,9 @@ static void pxa2xx_pic_mem_write(void *opaque, hwaddr offset,
         s->priority[32 + ((offset - IPR32) >> 2)] = value & 0x8000003f;
         break;
     default:
-        printf("%s: Bad register offset " REG_FMT "\n", __func__, offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pxa2xx_pic_mem_write: bad register offset 0x%"
+                      HWADDR_PRIx "\n", offset);
         return;
     }
     pxa2xx_pic_update(opaque);
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index fc18212e68..f020aff974 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -23,36 +23,66 @@
 #include "hw/ssi/ssi.h"
 #include "hw/block/flash.h"
 #include "qemu/timer.h"
+#include "qemu/log.h"
 #include "hw/arm/sharpsl.h"
 #include "ui/console.h"
 #include "hw/audio/wm8750.h"
 #include "audio/audio.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
+#include "hw/misc/max111x.h"
 #include "migration/vmstate.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
 
-#undef REG_FMT
-#define REG_FMT			"0x%02lx"
+enum spitz_model_e { spitz, akita, borzoi, terrier };
+
+typedef struct {
+    MachineClass parent;
+    enum spitz_model_e model;
+    int arm_id;
+} SpitzMachineClass;
+
+typedef struct {
+    MachineState parent;
+    PXA2xxState *mpu;
+    DeviceState *mux;
+    DeviceState *lcdtg;
+    DeviceState *ads7846;
+    DeviceState *max1111;
+    DeviceState *scp0;
+    DeviceState *scp1;
+    DeviceState *misc_gpio;
+} SpitzMachineState;
+
+#define TYPE_SPITZ_MACHINE "spitz-common"
+#define SPITZ_MACHINE(obj) \
+    OBJECT_CHECK(SpitzMachineState, obj, TYPE_SPITZ_MACHINE)
+#define SPITZ_MACHINE_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(SpitzMachineClass, obj, TYPE_SPITZ_MACHINE)
+#define SPITZ_MACHINE_CLASS(klass) \
+    OBJECT_CLASS_CHECK(SpitzMachineClass, klass, TYPE_SPITZ_MACHINE)
+
+#define zaurus_printf(format, ...)                              \
+    fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
 
 /* Spitz Flash */
-#define FLASH_BASE		0x0c000000
-#define FLASH_ECCLPLB		0x00	/* Line parity 7 - 0 bit */
-#define FLASH_ECCLPUB		0x04	/* Line parity 15 - 8 bit */
-#define FLASH_ECCCP		0x08	/* Column parity 5 - 0 bit */
-#define FLASH_ECCCNTR		0x0c	/* ECC byte counter */
-#define FLASH_ECCCLRR		0x10	/* Clear ECC */
-#define FLASH_FLASHIO		0x14	/* Flash I/O */
-#define FLASH_FLASHCTL		0x18	/* Flash Control */
-
-#define FLASHCTL_CE0		(1 << 0)
-#define FLASHCTL_CLE		(1 << 1)
-#define FLASHCTL_ALE		(1 << 2)
-#define FLASHCTL_WP		(1 << 3)
-#define FLASHCTL_CE1		(1 << 4)
-#define FLASHCTL_RYBY		(1 << 5)
-#define FLASHCTL_NCE		(FLASHCTL_CE0 | FLASHCTL_CE1)
+#define FLASH_BASE              0x0c000000
+#define FLASH_ECCLPLB           0x00    /* Line parity 7 - 0 bit */
+#define FLASH_ECCLPUB           0x04    /* Line parity 15 - 8 bit */
+#define FLASH_ECCCP             0x08    /* Column parity 5 - 0 bit */
+#define FLASH_ECCCNTR           0x0c    /* ECC byte counter */
+#define FLASH_ECCCLRR           0x10    /* Clear ECC */
+#define FLASH_FLASHIO           0x14    /* Flash I/O */
+#define FLASH_FLASHCTL          0x18    /* Flash Control */
+
+#define FLASHCTL_CE0            (1 << 0)
+#define FLASHCTL_CLE            (1 << 1)
+#define FLASHCTL_ALE            (1 << 2)
+#define FLASHCTL_WP             (1 << 3)
+#define FLASHCTL_CE1            (1 << 4)
+#define FLASHCTL_RYBY           (1 << 5)
+#define FLASHCTL_NCE            (FLASHCTL_CE0 | FLASHCTL_CE1)
 
 #define TYPE_SL_NAND "sl-nand"
 #define SL_NAND(obj) OBJECT_CHECK(SLNANDState, (obj), TYPE_SL_NAND)
@@ -74,12 +104,12 @@ static uint64_t sl_read(void *opaque, hwaddr addr, unsigned size)
     int ryby;
 
     switch (addr) {
-#define BSHR(byte, from, to)	((s->ecc.lp[byte] >> (from - to)) & (1 << to))
+#define BSHR(byte, from, to)    ((s->ecc.lp[byte] >> (from - to)) & (1 << to))
     case FLASH_ECCLPLB:
         return BSHR(0, 4, 0) | BSHR(0, 5, 2) | BSHR(0, 6, 4) | BSHR(0, 7, 6) |
                 BSHR(1, 4, 1) | BSHR(1, 5, 3) | BSHR(1, 6, 5) | BSHR(1, 7, 7);
 
-#define BSHL(byte, from, to)	((s->ecc.lp[byte] << (to - from)) & (1 << to))
+#define BSHL(byte, from, to)    ((s->ecc.lp[byte] << (to - from)) & (1 << to))
     case FLASH_ECCLPUB:
         return BSHL(0, 0, 0) | BSHL(0, 1, 2) | BSHL(0, 2, 4) | BSHL(0, 3, 6) |
                 BSHL(1, 0, 1) | BSHL(1, 1, 3) | BSHL(1, 2, 5) | BSHL(1, 3, 7);
@@ -105,7 +135,9 @@ static uint64_t sl_read(void *opaque, hwaddr addr, unsigned size)
         return ecc_digest(&s->ecc, nand_getio(s->nand));
 
     default:
-        zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "sl_read: bad register offset 0x%02" HWADDR_PRIx "\n",
+                      addr);
     }
     return 0;
 }
@@ -136,7 +168,9 @@ static void sl_write(void *opaque, hwaddr addr,
         break;
 
     default:
-        zaurus_printf("Bad register offset " REG_FMT "\n", (unsigned long)addr);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "sl_write: bad register offset 0x%02" HWADDR_PRIx "\n",
+                      addr);
     }
 }
 
@@ -191,8 +225,8 @@ static void sl_nand_realize(DeviceState *dev, Error **errp)
 
 /* Spitz Keyboard */
 
-#define SPITZ_KEY_STROBE_NUM	11
-#define SPITZ_KEY_SENSE_NUM	7
+#define SPITZ_KEY_STROBE_NUM    11
+#define SPITZ_KEY_SENSE_NUM     7
 
 static const int spitz_gpio_key_sense[SPITZ_KEY_SENSE_NUM] = {
     12, 17, 91, 34, 36, 38, 39
@@ -214,11 +248,11 @@ static int spitz_keymap[SPITZ_KEY_SENSE_NUM + 1][SPITZ_KEY_STROBE_NUM] = {
     { 0x52, 0x43, 0x01, 0x47, 0x49,  -1 ,  -1 ,  -1 ,  -1 ,  -1 ,  -1  },
 };
 


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16235.39654 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb58-0003Dv-IH; Fri, 30 Oct 2020 20:33:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16235.39654; Fri, 30 Oct 2020 20:33:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb58-0003Dn-FC; Fri, 30 Oct 2020 20:33:06 +0000
Received: by outflank-mailman (input) for mailman id 16235;
 Fri, 30 Oct 2020 20:33:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb57-0003Di-Gr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5f3e410b-f7d9-436a-82c4-6d6e2210ea86;
 Fri, 30 Oct 2020 20:33:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb56-00025b-Ej
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb56-0002HZ-Cb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb57-0003Di-Gr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:05 +0000
X-Inumbo-ID: 5f3e410b-f7d9-436a-82c4-6d6e2210ea86
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5f3e410b-f7d9-436a-82c4-6d6e2210ea86;
	Fri, 30 Oct 2020 20:33:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9FxkKi5lcDkcdnezkrPbfi5EZo/QOOwzzHNYswev2iI=; b=u4VlzAKOgDYVyoqMx20o+v6qg6
	zetY6RLGFwsCiIY9aE9jeoVu1SPFRZGgAhvdZlyjAhvptz6svLvbOVYiwwLrul7pFl/+s//6IHZ1z
	R6SPPNOByfyIV3On+wLc78fyuwHzBHKi83BTrj74/MREtojlOApgGZZTGWqmgstVedKM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb56-00025b-Ej
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb56-0002HZ-Cb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fix the prototype of muls64/mulu64
Message-Id: <E1kYb56-0002HZ-Cb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:04 +0000

commit db7b62e70667b06ae18b69382f4647f5673bbf75
Author:     Lijun Pan <ljp@linux.ibm.com>
AuthorDate: Wed Jul 1 18:43:44 2020 -0500
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 6 18:13:13 2020 +0200

    fix the prototype of muls64/mulu64
    
    The prototypes of muls64/mulu64 in host-utils.h should match the
    definitions in host-utils.c
    
    Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
    Message-Id: <20200701234344.91843-10-ljp@linux.ibm.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/qemu/host-utils.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 4cd170e6cd..cdca2991d8 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -77,8 +77,8 @@ static inline int divs128(int64_t *plow, int64_t *phigh, int64_t divisor)
     }
 }
 #else
-void muls64(uint64_t *phigh, uint64_t *plow, int64_t a, int64_t b);
-void mulu64(uint64_t *phigh, uint64_t *plow, uint64_t a, uint64_t b);
+void muls64(uint64_t *plow, uint64_t *phigh, int64_t a, int64_t b);
+void mulu64(uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b);
 int divu128(uint64_t *plow, uint64_t *phigh, uint64_t divisor);
 int divs128(int64_t *plow, int64_t *phigh, int64_t divisor);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16236.39658 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5I-0003Eo-Jh; Fri, 30 Oct 2020 20:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16236.39658; Fri, 30 Oct 2020 20:33:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5I-0003Eg-Gh; Fri, 30 Oct 2020 20:33:16 +0000
Received: by outflank-mailman (input) for mailman id 16236;
 Fri, 30 Oct 2020 20:33:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb5H-0003EU-DW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 70c48a30-f869-41f8-b7cf-2a3257fc49d2;
 Fri, 30 Oct 2020 20:33:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5G-00025h-IY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5G-0002IL-HP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb5H-0003EU-DW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:15 +0000
X-Inumbo-ID: 70c48a30-f869-41f8-b7cf-2a3257fc49d2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 70c48a30-f869-41f8-b7cf-2a3257fc49d2;
	Fri, 30 Oct 2020 20:33:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7Rm5Q4HeoazpQdCClFoDpCiGEbnhr3TFezZeiwwiwtg=; b=Xs3CJdo2TtFWt8m+dbw0knRsUx
	BwJb27P3TaXnqHdo6kFLNvc+Xkf0dnnfyU38TDO8UYRkmU+3b7Ic7tAtSHma2Z33NjeQGab+KuNSf
	NuCOcvqeWhyIWzV/pkwvFNV8zQub4OFFTtSCQHOxkVMcaj2bIgrNu23rcTwzS32ngS3M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5G-00025h-IY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5G-0002IL-HP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] trivial: Respect alphabetical order of .o files in Makefile.objs
Message-Id: <E1kYb5G-0002IL-HP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:14 +0000

commit be99a9a09dcf8b056ec501591e4efdce8efeaf00
Author:     Christophe de Dinechin <dinechin@redhat.com>
AuthorDate: Mon Jun 29 11:49:34 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    trivial: Respect alphabetical order of .o files in Makefile.objs
    
    The vmgenid.o is the only file that is not in alphabetical order.
    
    Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200629094934.2081180-1-dinechin@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 stubs/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index f32b9e47a3..1df8bb3814 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -19,10 +19,10 @@ stub-obj-y += replay.o
 stub-obj-y += runstate-check.o
 stub-obj-$(CONFIG_SOFTMMU) += semihost.o
 stub-obj-y += set-fd-handler.o
-stub-obj-y += vmgenid.o
 stub-obj-y += sysbus.o
 stub-obj-y += tpm.o
 stub-obj-y += trace-control.o
+stub-obj-y += vmgenid.o
 stub-obj-y += vmstate.o
 stub-obj-$(CONFIG_SOFTMMU) += win32-kbd-hook.o
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16237.39662 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5T-0003GP-LG; Fri, 30 Oct 2020 20:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16237.39662; Fri, 30 Oct 2020 20:33:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5T-0003GH-IK; Fri, 30 Oct 2020 20:33:27 +0000
Received: by outflank-mailman (input) for mailman id 16237;
 Fri, 30 Oct 2020 20:33:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb5S-0003G9-H3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 26c88bc0-5a6e-4cb5-89d2-92a9a3ab0434;
 Fri, 30 Oct 2020 20:33:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5Q-00025o-OA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5Q-0002JK-LJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb5S-0003G9-H3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:26 +0000
X-Inumbo-ID: 26c88bc0-5a6e-4cb5-89d2-92a9a3ab0434
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 26c88bc0-5a6e-4cb5-89d2-92a9a3ab0434;
	Fri, 30 Oct 2020 20:33:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kui3C4I3gj1KBytPWfg8B9bsxjryoMhQr0f8nxEg56E=; b=DH4UP5Hd4HSgrr+Of851iYkjA+
	4tFJK80tTzC1mi9mnz/Q2JFzkfStUrHkCqFKKgQrUOeDS3ZnOgoPtWCP88GTCV5iZwDAE7ORVy0DQ
	1Gi4U1xHpuCHxHWQDhqp1leUW5hQBjyEXvY+SUtZxEuu8cJ6rbzmeH02P2e6OVMhmdX4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5Q-00025o-OA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5Q-0002JK-LJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] .mailmap: Update Alexander Graf email address
Message-Id: <E1kYb5Q-0002JK-LJ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:24 +0000

commit 0f57f8d84f36a1769720dae70bd12725194f48d1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jul 2 19:38:00 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    .mailmap: Update Alexander Graf email address
    
    Update Alexander Graf email address to avoid emails bouncing.
    
    Suggested-by: Alexander Graf <agraf@csgraf.de>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alexander Graf <agraf@csgraf.de>
    Message-Id: <20200702173818.14651-2-f4bug@amsat.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 .mailmap | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.mailmap b/.mailmap
index 926cac6bb8..e46e6c7302 100644
--- a/.mailmap
+++ b/.mailmap
@@ -44,6 +44,7 @@ Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgte
 Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
 Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <arikalo@wavecomp.com>
 Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> <aleksandar.rikalo@rt-rk.com>
+Alexander Graf <agraf@csgraf.de> <agraf@suse.de>
 Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
 Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
 Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16239.39665 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5c-0003Hc-Mg; Fri, 30 Oct 2020 20:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16239.39665; Fri, 30 Oct 2020 20:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5c-0003HU-Jp; Fri, 30 Oct 2020 20:33:36 +0000
Received: by outflank-mailman (input) for mailman id 16239;
 Fri, 30 Oct 2020 20:33:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb5b-0003HK-Nz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9cf3fa37-e1d2-4924-a570-5706d1e5e3d2;
 Fri, 30 Oct 2020 20:33:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5a-00025v-Sw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5a-0002KA-R8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb5b-0003HK-Nz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:35 +0000
X-Inumbo-ID: 9cf3fa37-e1d2-4924-a570-5706d1e5e3d2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9cf3fa37-e1d2-4924-a570-5706d1e5e3d2;
	Fri, 30 Oct 2020 20:33:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qtsKlakI8G+YKzaoTsQ90GRR7wIu+8vmfCJDROXa51Y=; b=FmHmIOF2n8sQ8/u0+PZ/V5WvmN
	Rb4JyqOqh6SuHP04ejTYgGyxl8vvXWIpC9HkQyrn97nzixwSTM6DtAcE4nzMswSY85bcShQkkjzHw
	UZPRmuyp/r4z+f2r3m1T4jQZZ6lYAoU16B75St9dqGGwOFyksFKF+57O5VZJMjGjgdJw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5a-00025v-Sw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5a-0002KA-R8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Update Radoslaw Biernacki email address
Message-Id: <E1kYb5a-0002KA-R8@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:34 +0000

commit 428a37770406346dac6d355a70ea5a8916aecb1f
Author:     Radoslaw Biernacki <rad@semihalf.com>
AuthorDate: Tue May 12 19:07:04 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    MAINTAINERS: Update Radoslaw Biernacki email address
    
    My Linaro account is no longer active and stop forwarding emails to me.
    Changing it to my current employer domain.
    
    Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Acked-by: Leif Lindholm <leif@nuviainc.com>
    Message-Id: <20200512170704.9290-1-rad@semihalf.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 .mailmap    | 1 +
 MAINTAINERS | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index e46e6c7302..81c2ce0937 100644
--- a/.mailmap
+++ b/.mailmap
@@ -50,6 +50,7 @@ Filip Bozuta <filip.bozuta@syrmia.com> <filip.bozuta@rt-rk.com.com>
 Frederic Konrad <konrad@adacore.com> <fred.konrad@greensocs.com>
 James Hogan <jhogan@kernel.org> <james.hogan@imgtec.com>
 Leif Lindholm <leif@nuviainc.com> <leif.lindholm@linaro.org>
+Radoslaw Biernacki <rad@semihalf.com> <radoslaw.biernacki@linaro.org>
 Paul Burton <pburton@wavecomp.com> <paul.burton@mips.com>
 Paul Burton <pburton@wavecomp.com> <paul.burton@imgtec.com>
 Paul Burton <pburton@wavecomp.com> <paul@archlinuxmips.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index c31c878c63..36dce13bcc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -809,7 +809,7 @@ F: include/hw/misc/imx6_*.h
 F: include/hw/ssi/imx_spi.h
 
 SBSA-REF
-M: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
+M: Radoslaw Biernacki <rad@semihalf.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 R: Leif Lindholm <leif@nuviainc.com>
 L: qemu-arm@nongnu.org
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16240.39670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5m-0003JP-Om; Fri, 30 Oct 2020 20:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16240.39670; Fri, 30 Oct 2020 20:33:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5m-0003JF-LU; Fri, 30 Oct 2020 20:33:46 +0000
Received: by outflank-mailman (input) for mailman id 16240;
 Fri, 30 Oct 2020 20:33:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb5m-0003J6-51
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f5dcd9d6-a224-4a06-8e3e-601977d30bb2;
 Fri, 30 Oct 2020 20:33:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5l-00026k-0O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5k-0002Kw-Ve
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb5m-0003J6-51
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:46 +0000
X-Inumbo-ID: f5dcd9d6-a224-4a06-8e3e-601977d30bb2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f5dcd9d6-a224-4a06-8e3e-601977d30bb2;
	Fri, 30 Oct 2020 20:33:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OMSxdmICiucsU0zkmA48nwXQpNO/sdRy3STTie3dN9U=; b=xIVK9D6eeT14g+slfB/Ye0jt2+
	S9s3ewAp4zf7oUKRPlDEH2Uy4fdFhw6HabxQsUAhxGchy+C/Jg8mwpPelMaPOTwHr2t8oIHNpO0PB
	FABq/mI9uL6hp7UluvCtbTKKIuG4nL2VidBZflWkEtX24oU7r7ph57lXaWfE9qUuWmcc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5l-00026k-0O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5k-0002Kw-Ve
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] util/qemu-option: Document the get_opt_value() function
Message-Id: <E1kYb5k-0002Kw-Ve@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:44 +0000

commit 8f4d9555823636c329cb40afc6f36969ec5d35e4
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Mon Jun 29 09:08:58 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    util/qemu-option: Document the get_opt_value() function
    
    Coverity noticed commit 950c4e6c94 introduced a dereference before
    null check in get_opt_value (CID1391003):
    
      In get_opt_value: All paths that lead to this null pointer
      comparison already dereference the pointer earlier (CWE-476)
    
    We fixed this in commit 6e3ad3f0e31, but relaxed the check in commit
    0c2f6e7ee99 because "No callers of get_opt_value() pass in a NULL
    for the 'value' parameter".
    
    Since this function is publicly exposed, it risks new users to do
    the same error again. Avoid that documenting the 'value' argument
    must not be NULL.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200629070858.19850-1-philmd@redhat.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 include/qemu/option.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/qemu/option.h b/include/qemu/option.h
index eb4097889d..ac50d25774 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -28,6 +28,19 @@
 
 #include "qemu/queue.h"
 
+/**
+ * get_opt_value
+ * @p: a pointer to the option name, delimited by commas
+ * @value: a non-NULL pointer that will received the delimited options
+ *
+ * The @value char pointer will be allocated and filled with
+ * the delimited options.
+ *
+ * Returns the position of the comma delimiter/zero byte after the
+ * option name in @p.
+ * The memory pointer in @value must be released with a call to g_free()
+ * when no longer required.
+ */
 const char *get_opt_value(const char *p, char **value);
 
 void parse_option_size(const char *name, const char *value,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:33:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16241.39673 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5x-0003Kl-Pt; Fri, 30 Oct 2020 20:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16241.39673; Fri, 30 Oct 2020 20:33:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb5x-0003Kd-N4; Fri, 30 Oct 2020 20:33:57 +0000
Received: by outflank-mailman (input) for mailman id 16241;
 Fri, 30 Oct 2020 20:33:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb5w-0003KR-9n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 63ab770c-8b49-4c17-ab7b-7a73fe3f6c72;
 Fri, 30 Oct 2020 20:33:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5v-00026w-5E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb5v-0002Lp-3J
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb5w-0003KR-9n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:56 +0000
X-Inumbo-ID: 63ab770c-8b49-4c17-ab7b-7a73fe3f6c72
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 63ab770c-8b49-4c17-ab7b-7a73fe3f6c72;
	Fri, 30 Oct 2020 20:33:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=N/+Z+yPGSRXQxeU3k+DN1QCCCX0GZ41ZZdcxmWqH40c=; b=PlDx9dbvNtWmpucPFxf0OLng0Q
	APHP8aFu/1D25kvXbSQQDLVVKWySRB8twSxKKiNT4WunF2jDcRysR8votH3ajPH6R9arCHbgPLSz5
	4QrgRlsVHcVwXLEMOCcUOuMLV8Ph3BMiO2RBNRg+TbHnvoohMBwI+S3vBXFGh2VnHkls=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5v-00026w-5E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb5v-0002Lp-3J
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:33:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
Message-Id: <E1kYb5v-0002Lp-3J@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:33:55 +0000

commit 2a345149d1747d8625d5d2796e22f4bdd60bea83
Author:     Menno Lageman <menno.lageman@oracle.com>
AuthorDate: Thu Jun 25 17:52:58 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
    
    Commit 4b49b586c4 ('intel_iommu: remove "x-" prefix for "aw-bits"')
    removed the "x-" prefix but but didn't update the error message
    accordingly.
    
    Signed-off-by: Menno Lageman <menno.lageman@oracle.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200625155258.1452425-1-menno.lageman@oracle.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/i386/intel_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index df7ad254ac..c56398e991 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3758,7 +3758,7 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)
     /* Currently only address widths supported are 39 and 48 bits */
     if ((s->aw_bits != VTD_HOST_AW_39BIT) &&
         (s->aw_bits != VTD_HOST_AW_48BIT)) {
-        error_setg(errp, "Supported values for x-aw-bits are: %d, %d",
+        error_setg(errp, "Supported values for aw-bits are: %d, %d",
                    VTD_HOST_AW_39BIT, VTD_HOST_AW_48BIT);
         return false;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:34:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16242.39678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb67-0003M4-Re; Fri, 30 Oct 2020 20:34:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16242.39678; Fri, 30 Oct 2020 20:34:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb67-0003Lw-OX; Fri, 30 Oct 2020 20:34:07 +0000
Received: by outflank-mailman (input) for mailman id 16242;
 Fri, 30 Oct 2020 20:34:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb66-0003Ln-AR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 637758c1-1817-4374-a9e5-815af3ba17fb;
 Fri, 30 Oct 2020 20:34:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb65-00027H-A6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb65-0002Mk-8J
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb66-0003Ln-AR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:06 +0000
X-Inumbo-ID: 637758c1-1817-4374-a9e5-815af3ba17fb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 637758c1-1817-4374-a9e5-815af3ba17fb;
	Fri, 30 Oct 2020 20:34:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LTTJMtJOGIw6gzKhbR2aCnsndldImwW4Rg9NtJ3Kk1A=; b=3n3KmYEO1gIvcgHv3HgfsnXArw
	61y4ooE8jWTCXF2Ublg7f0x1oshkwQwkdtXpzCuDjx0YdJ+cwFxthZELKrBRBY4VQKjbQ5szvGPYH
	cbPMwJyG5hpCwS1AhDRkAekGxgdsebkiFhx1EPfp4c7c/gxte6Tx35Icdk7WehF9C1c0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb65-00027H-A6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb65-0002Mk-8J
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] net/tap-solaris.c: Include qemu-common.h for TFR macro
Message-Id: <E1kYb65-0002Mk-8J@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:34:05 +0000

commit 89615cfef57e04da0e5a1bd212a62f8696468e79
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 4 10:23:17 2020 +0100
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 7 12:38:50 2020 +0200

    net/tap-solaris.c: Include qemu-common.h for TFR macro
    
    In commit a8d2532645cf5ce4 we cleaned up usage of the qemu-common.h header
    so that it was always included from .c files and never from other .h files.
    We missed adding it to net/tap-solaris.c (which previously was pulling it
    in via tap-int.h), which broke building on Solaris hosts.
    
    Fixes: a8d2532645cf5ce4
    Reported-by: Michele Denber <denber@mindspring.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Tested-by: Michele Denber <denber@mindspring.com>
    Message-Id: <20200704092317.12943-1-peter.maydell@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 net/tap-solaris.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 4725d2314e..d03165c57c 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -27,6 +27,7 @@
 #include "tap_int.h"
 #include "qemu/ctype.h"
 #include "qemu/cutils.h"
+#include "qemu-common.h"
 
 #include <sys/ethernet.h>
 #include <sys/sockio.h>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:34:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:34:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16243.39681 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb6H-0003NF-TS; Fri, 30 Oct 2020 20:34:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16243.39681; Fri, 30 Oct 2020 20:34:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb6H-0003N7-Q7; Fri, 30 Oct 2020 20:34:17 +0000
Received: by outflank-mailman (input) for mailman id 16243;
 Fri, 30 Oct 2020 20:34:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb6G-0003My-Av
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96ededb3-7110-4aa3-8235-70886afb3a9b;
 Fri, 30 Oct 2020 20:34:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb6F-00027U-EJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb6F-0002OB-DJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb6G-0003My-Av
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:16 +0000
X-Inumbo-ID: 96ededb3-7110-4aa3-8235-70886afb3a9b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96ededb3-7110-4aa3-8235-70886afb3a9b;
	Fri, 30 Oct 2020 20:34:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F+sYp2/UPMQZIUqmw2YcpiHj5Vtkzfbh344OPZcKIQE=; b=dUh03EWy86xBu7kWQOKOp/6McS
	/3TAnk7r1rr8PI66FUxp0NFuGgn1BWnvrV0pvC3f2WcjmDH+UjzDQsiQKjZCRCvuWHQN0v5+Ivwpi
	ZrSZ+JL9Y3HQIbLLPZcIJ8N8yA5XfnqbA5/SdRXyYN+XTyylxH9GWgHUcSGT20aWHkK8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb6F-00027U-EJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb6F-0002OB-DJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.1-pull-request' into staging
Message-Id: <E1kYb6F-0002OB-DJ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:34:15 +0000

commit 3d7cad3c2388cb74451d50cf455a42d349236161
Merge: 48f22ad04ead83e61b4b35871ec6f6109779b791 89615cfef57e04da0e5a1bd212a62f8696468e79
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 14:13:19 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 14:13:19 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.1-pull-request' into staging
    
    trivial branch patches 20200707
    
    # gpg: Signature made Tue 07 Jul 2020 11:52:06 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/trivial-branch-for-5.1-pull-request:
      net/tap-solaris.c: Include qemu-common.h for TFR macro
      intel_iommu: "aw-bits" error message still refers to "x-aw-bits"
      util/qemu-option: Document the get_opt_value() function
      MAINTAINERS: Update Radoslaw Biernacki email address
      .mailmap: Update Alexander Graf email address
      trivial: Respect alphabetical order of .o files in Makefile.objs
      fix the prototype of muls64/mulu64
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .mailmap                  |  2 ++
 MAINTAINERS               |  2 +-
 hw/i386/intel_iommu.c     |  2 +-
 include/qemu/host-utils.h |  4 ++--
 include/qemu/option.h     | 13 +++++++++++++
 net/tap-solaris.c         |  1 +
 stubs/Makefile.objs       |  2 +-
 7 files changed, 21 insertions(+), 5 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:34:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:34:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16244.39686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb6T-0003Oo-18; Fri, 30 Oct 2020 20:34:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16244.39686; Fri, 30 Oct 2020 20:34:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYb6S-0003Of-U9; Fri, 30 Oct 2020 20:34:28 +0000
Received: by outflank-mailman (input) for mailman id 16244;
 Fri, 30 Oct 2020 20:34:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYb6R-0003OX-Im
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3ad28ae7-d1d0-497d-89a6-82d6cb63cb9a;
 Fri, 30 Oct 2020 20:34:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb6P-00027d-W1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYb6P-0002QW-Uc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYb6R-0003OX-Im
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:27 +0000
X-Inumbo-ID: 3ad28ae7-d1d0-497d-89a6-82d6cb63cb9a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3ad28ae7-d1d0-497d-89a6-82d6cb63cb9a;
	Fri, 30 Oct 2020 20:34:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FSZnFc+n/uBeihxUOPIZxEnRsq6WUHprW59T0l9UR8M=; b=vyrpapwOwN3qufWyTJOKKOQZ3X
	qm8trhniD4VXERKt0P2qKyAo145BQnc8EuQhe6A/uGaXLx7TNpos314w9aYoDIKlD4tjbVavevhKI
	li3B2QlRP0ofrie/xR3zFLlNconWew0fhJeRju8Rc3uysOmQylxDc4a7I+hwh2SVBTm4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb6P-00027d-W1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYb6P-0002QW-Uc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:34:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/modules-20200707-pull-request' into staging
Message-Id: <E1kYb6P-0002QW-Uc@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:34:25 +0000

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

commit aff2caf6b3fbab1062e117a47b66d27f7fd2f272
Merge: 3d7cad3c2388cb74451d50cf455a42d349236161 ef138c77249771081d8c2d09b8e729f7e92cdf28
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 17:02:29 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 17:02:29 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/modules-20200707-pull-request' into staging
    
    qom: add support for qom objects in modules.
    build some devices (qxl, virtio-gpu, ccid, usb-redir) as modules.
    build braille chardev as module.
    
    v2: more verbose comment for "build: fix device module builds" patch.
    
    note: qemu doesn't rebuild objects on cflags changes (specifically
          -fPIC being added when code is switched from builtin to module).
          Workaround for resulting build errors: "make clean", rebuild.
    
    # gpg: Signature made Tue 07 Jul 2020 14:42:16 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/modules-20200707-pull-request:
      chardev: enable modules, use for braille
      vga: build virtio-gpu as module
      vga: build virtio-gpu only once
      vga: build qxl as module
      usb: build usb-redir as module
      ccid: build smartcard as module
      build: fix device module builds
      qdev: device module support
      object: qom module support
      module: qom module support
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Makefile.objs            |  2 ++
 Makefile.target          | 14 ++++++++++
 chardev/Makefile.objs    |  5 +++-
 chardev/char.c           |  2 +-
 hw/Makefile.objs         |  2 ++
 hw/core/qdev.c           |  6 +++--
 hw/display/Makefile.objs | 30 +++++++++++++---------
 hw/usb/Makefile.objs     | 13 +++++++---
 include/qemu/module.h    |  2 ++
 include/qom/object.h     | 12 +++++++++
 qdev-monitor.c           |  5 ++--
 qom/object.c             | 14 ++++++++++
 qom/qom-qmp-cmds.c       |  3 ++-
 softmmu/vl.c             |  4 +--
 util/module.c            | 67 ++++++++++++++++++++++++++++++++++++++++++++++++
 15 files changed, 156 insertions(+), 25 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 98383972ee..d22b3b45d7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -59,6 +59,7 @@ common-obj-y += migration/
 common-obj-y += audio/
 common-obj-m += audio/
 common-obj-y += hw/
+common-obj-m += hw/
 
 common-obj-y += replay/
 
@@ -70,6 +71,7 @@ common-obj-$(CONFIG_TPM) += tpm.o
 
 common-obj-y += backends/
 common-obj-y += chardev/
+common-obj-m += chardev/
 
 common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o
 qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS)
diff --git a/Makefile.target b/Makefile.target
index 8ed1eba95b..02bd9d7117 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -179,6 +179,20 @@ endif # CONFIG_SOFTMMU
 dummy := $(call unnest-vars,,obj-y)
 all-obj-y := $(obj-y)
 
+#
+# common-obj-m has some crap here, probably as side effect from
+# unnest-vars recursing into target directories to fill obj-y and not
+# properly handling the -m case.
+#
+# Clear common-obj-m as workaround.  Fixes suspious dependency errors
+# when building devices as modules.  A bit hackish, but should be ok
+# as long as we do not have any target-specific modules.
+#
+# The meson-based build system currently in development doesn't need
+# unnest-vars and will obsolete this workaround.
+#
+common-obj-m :=
+
 include $(SRC_PATH)/Makefile.objs
 dummy := $(call unnest-vars,.., \
                authz-obj-y \
diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index d68e1347f9..3a58c9d329 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -18,8 +18,11 @@ chardev-obj-$(CONFIG_WIN32) += char-win.o
 chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o
 
 common-obj-y += msmouse.o wctablet.o testdev.o
-common-obj-$(CONFIG_BRLAPI) += baum.o
+
+ifeq ($(CONFIG_BRLAPI),y)
+common-obj-m += baum.o
 baum.o-cflags := $(SDL_CFLAGS)
 baum.o-libs := $(BRLAPI_LIBS)
+endif
 
 common-obj-$(CONFIG_SPICE) += spice.o
diff --git a/chardev/char.c b/chardev/char.c
index e3051295ac..df697f3ce9 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -527,7 +527,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp)
     const ChardevClass *cc;
     char *typename = g_strdup_printf("chardev-%s", driver);
 
-    oc = object_class_by_name(typename);
+    oc = module_object_class_by_name(typename);
     g_free(typename);
 
     if (!object_class_dynamic_cast(oc, TYPE_CHARDEV)) {
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 4cbe5e4e57..14b7ea4eb6 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -43,4 +43,6 @@ devices-dirs-y += smbios/
 endif
 
 common-obj-y += $(devices-dirs-y)
+common-obj-m += display/
+common-obj-m += usb/
 obj-y += $(devices-dirs-y)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..9de16eae05 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -137,6 +137,9 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
  */
 DeviceState *qdev_new(const char *name)
 {
+    if (!object_class_by_name(name)) {
+        module_load_qom_one(name);
+    }
     return DEVICE(object_new(name));
 }
 
@@ -147,10 +150,9 @@ DeviceState *qdev_new(const char *name)
  */
 DeviceState *qdev_try_new(const char *name)
 {
-    if (!object_class_by_name(name)) {
+    if (!module_object_class_by_name(name)) {
         return NULL;
     }
-
     return DEVICE(object_new(name));
 }
 
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 77a7d622bd..e907f3182b 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -44,18 +44,24 @@ common-obj-$(CONFIG_ARTIST) += artist.o
 
 obj-$(CONFIG_VGA) += vga.o
 
-common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o
-
-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
-virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
-virtio-gpu.o-libs += $(VIRGL_LIBS)
-virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
-virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
+ifeq ($(CONFIG_QXL),y)
+common-obj-m += qxl.mo
+qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o
+endif
+
+ifeq ($(CONFIG_VIRTIO_GPU),y)
+common-obj-m += virtio-gpu.mo
+virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
+virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
+virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
+virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
+virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
+virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
+virtio-gpu.mo-objs := $(virtio-gpu-obj-y)
+virtio-gpu.mo-cflags := $(VIRGL_CFLAGS)
+virtio-gpu.mo-libs := $(VIRGL_LIBS)
+endif
+
 common-obj-$(CONFIG_DPCD) += dpcd.o
 common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
 
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index fa5c3fa1b8..e342ff59fa 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -29,11 +29,13 @@ common-obj-$(CONFIG_USB_NETWORK)      += dev-network.o
 
 ifeq ($(CONFIG_USB_SMARTCARD),y)
 common-obj-y                          += dev-smartcard-reader.o
-common-obj-$(CONFIG_SMARTCARD)        += smartcard.mo
+ifeq ($(CONFIG_SMARTCARD),y)
+common-obj-m                          += smartcard.mo
 smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o
 smartcard.mo-cflags := $(SMARTCARD_CFLAGS)
 smartcard.mo-libs := $(SMARTCARD_LIBS)
 endif
+endif
 
 ifeq ($(CONFIG_POSIX),y)
 common-obj-$(CONFIG_USB_STORAGE_MTP)  += dev-mtp.o
@@ -41,9 +43,12 @@ endif
 
 # usb redirection
 ifeq ($(CONFIG_USB),y)
-common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o
-redirect.o-cflags = $(USB_REDIR_CFLAGS)
-redirect.o-libs = $(USB_REDIR_LIBS)
+ifeq ($(CONFIG_USB_REDIR),y)
+common-obj-m += redirect.mo
+redirect.mo-objs = redirect.o quirks.o
+redirect.mo-cflags = $(USB_REDIR_CFLAGS)
+redirect.mo-libs = $(USB_REDIR_LIBS)
+endif
 endif
 
 # usb pass-through
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 011ae1ae76..9121a475c1 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -70,5 +70,7 @@ void register_dso_module_init(void (*fn)(void), module_init_type type);
 
 void module_call_init(module_init_type type);
 bool module_load_one(const char *prefix, const char *lib_name);
+void module_load_qom_one(const char *type);
+void module_load_qom_all(void);
 
 #endif
diff --git a/include/qom/object.h b/include/qom/object.h
index 94a61ccc3f..51f188137f 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -994,6 +994,18 @@ bool object_class_is_abstract(ObjectClass *klass);
  */
 ObjectClass *object_class_by_name(const char *typename);
 
+/**
+ * module_object_class_by_name:
+ * @typename: The QOM typename to obtain the class for.
+ *
+ * For objects which might be provided by a module.  Behaves like
+ * object_class_by_name, but additionally tries to load the module
+ * needed in case the class is not available.
+ *
+ * Returns: The class for @typename or %NULL if not found.
+ */
+ObjectClass *module_object_class_by_name(const char *typename);
+
 void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
                           const char *implements_type, bool include_abstract,
                           void *opaque);
diff --git a/qdev-monitor.c b/qdev-monitor.c
index e3083fae39..648b8ac4fa 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -149,6 +149,7 @@ static void qdev_print_devinfos(bool show_no_user)
     int i;
     bool cat_printed;
 
+    module_load_qom_all();
     list = object_class_get_list_sorted(TYPE_DEVICE, false);
 
     for (i = 0; i <= DEVICE_CATEGORY_MAX; i++) {
@@ -217,13 +218,13 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
     DeviceClass *dc;
     const char *original_name = *driver;
 
-    oc = object_class_by_name(*driver);
+    oc = module_object_class_by_name(*driver);
     if (!oc) {
         const char *typename = find_typename_by_alias(*driver);
 
         if (typename) {
             *driver = typename;
-            oc = object_class_by_name(*driver);
+            oc = module_object_class_by_name(*driver);
         }
     }
 
diff --git a/qom/object.c b/qom/object.c
index 6ece96bc2b..34daaf1280 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -985,6 +985,20 @@ ObjectClass *object_class_by_name(const char *typename)
     return type->class;
 }
 
+ObjectClass *module_object_class_by_name(const char *typename)
+{
+    ObjectClass *oc;
+
+    oc = object_class_by_name(typename);
+#ifdef CONFIG_MODULES
+    if (!oc) {
+        module_load_qom_one(typename);
+        oc = object_class_by_name(typename);
+    }
+#endif
+    return oc;
+}
+
 ObjectClass *object_class_get_parent(ObjectClass *class)
 {
     TypeImpl *type = type_get_parent(class->type);
diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index c5249e44d0..5e2c8cbf33 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -116,6 +116,7 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
 {
     ObjectTypeInfoList *ret = NULL;
 
+    module_load_qom_all();
     object_class_foreach(qom_list_types_tramp, implements, abstract, &ret);
 
     return ret;
@@ -130,7 +131,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
     ObjectPropertyIterator iter;
     ObjectPropertyInfoList *prop_list = NULL;
 
-    klass = object_class_by_name(typename);
+    klass = module_object_class_by_name(typename);
     if (klass == NULL) {
         error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
                   "Device '%s' not found", typename);
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ecbc18ba75..3f58ffd4dc 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1772,8 +1772,8 @@ static bool vga_interface_available(VGAInterfaceType t)
 
     assert(t < VGA_TYPE_MAX);
     return !ti->class_names[0] ||
-           object_class_by_name(ti->class_names[0]) ||
-           object_class_by_name(ti->class_names[1]);
+           module_object_class_by_name(ti->class_names[0]) ||
+           module_object_class_by_name(ti->class_names[1]);
 }
 
 static const char *
diff --git a/util/module.c b/util/module.c
index e48d9aacc0..32b0547b82 100644
--- a/util/module.c
+++ b/util/module.c
@@ -245,3 +245,70 @@ bool module_load_one(const char *prefix, const char *lib_name)
 #endif
     return success;
 }
+
+/*
+ * Building devices and other qom objects modular is mostly useful in
+ * case they have dependencies to external shared libraries, so we can
+ * cut down the core qemu library dependencies.  Which is the case for
+ * only a very few devices & objects.
+ *
+ * So with the expectation that this will be rather the exception than
+ * to rule and the list will not gain that many entries go with a
+ * simple manually maintained list for now.
+ */
+static struct {
+    const char *type;
+    const char *prefix;
+    const char *module;
+} const qom_modules[] = {
+    { "ccid-card-passthru",    "hw-", "usb-smartcard"         },
+    { "ccid-card-emulated",    "hw-", "usb-smartcard"         },
+    { "usb-redir",             "hw-", "usb-redirect"          },
+    { "qxl-vga",               "hw-", "display-qxl"           },
+    { "qxl",                   "hw-", "display-qxl"           },
+    { "virtio-gpu-device",     "hw-", "display-virtio-gpu"    },
+    { "virtio-gpu-pci",        "hw-", "display-virtio-gpu"    },
+    { "virtio-vga",            "hw-", "display-virtio-gpu"    },
+    { "vhost-user-gpu-device", "hw-", "display-virtio-gpu"    },
+    { "vhost-user-gpu-pci",    "hw-", "display-virtio-gpu"    },
+    { "vhost-user-vga",        "hw-", "display-virtio-gpu"    },
+    { "chardev-braille",       "chardev-", "baum"             },
+};
+
+static bool module_loaded_qom_all;
+
+void module_load_qom_one(const char *type)
+{
+    int i;
+
+    if (module_loaded_qom_all) {
+        return;
+    }
+    for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
+        if (strcmp(qom_modules[i].type, type) == 0) {
+            module_load_one(qom_modules[i].prefix,
+                            qom_modules[i].module);
+            return;
+        }
+    }
+}
+
+void module_load_qom_all(void)
+{
+    int i;
+
+    if (module_loaded_qom_all) {
+        return;
+    }
+    for (i = 0; i < ARRAY_SIZE(qom_modules); i++) {
+        if (i > 0 && (strcmp(qom_modules[i - 1].module,
+                             qom_modules[i].module) == 0 &&
+                      strcmp(qom_modules[i - 1].prefix,
+                             qom_modules[i].prefix) == 0)) {
+            /* one module implementing multiple types -> load only once */
+            continue;
+        }
+        module_load_one(qom_modules[i].prefix, qom_modules[i].module);
+    }
+    module_loaded_qom_all = true;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16245.39690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbFn-0004Fv-MW; Fri, 30 Oct 2020 20:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16245.39690; Fri, 30 Oct 2020 20:44:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbFn-0004Fn-JF; Fri, 30 Oct 2020 20:44:07 +0000
Received: by outflank-mailman (input) for mailman id 16245;
 Fri, 30 Oct 2020 20:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbFm-0004Fi-Bu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5a6c1626-81b3-4a30-9b49-cbdbb45052ec;
 Fri, 30 Oct 2020 20:44:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbFk-0002Jc-H1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbFk-0003NF-FF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbFm-0004Fi-Bu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:06 +0000
X-Inumbo-ID: 5a6c1626-81b3-4a30-9b49-cbdbb45052ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5a6c1626-81b3-4a30-9b49-cbdbb45052ec;
	Fri, 30 Oct 2020 20:44:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UNsdG/3Nuwm46++8pNGnhZcjAvRCX/bgx6J7R6YLACY=; b=nIl5hkrL8Ys3mlxBkbDT8qZOVK
	5fCpBNAPbLwjaeS8qXJ+S1X/TaJI9PjHlsKjK1rZ/DHnkFj/MdMp8ZrlRFzcnMgHOCeIlZNu3wge7
	7R/SnMuGcMrLkLFcKRfaN2TRnEJG1GVEVo5C9RMGOQpRkklWmxKtidFFeD51gq9gQCLg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbFk-0002Jc-H1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbFk-0003NF-FF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] crypto: Add tls-cipher-suites object
Message-Id: <E1kYbFk-0003NF-FF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:04 +0000

commit 993aec27aa39aa90f89f227d8f82cc1f8062386e
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Oct 11 20:21:11 2018 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    crypto: Add tls-cipher-suites object
    
    On the host OS, various aspects of TLS operation are configurable.
    In particular it is possible for the sysadmin to control the TLS
    cipher/protocol algorithms that applications are permitted to use.
    
    * Any given crypto library has a built-in default priority list
      defined by the distro maintainer of the library package (or by
      upstream).
    
    * The "crypto-policies" RPM (or equivalent host OS package)
      provides a config file such as "/etc/crypto-policies/config",
      where the sysadmin can set a high level (library-independent)
      policy.
    
      The "update-crypto-policies --set" command (or equivalent) is
      used to translate the global policy to individual library
      representations, producing files such as
      "/etc/crypto-policies/back-ends/*.config". The generated files,
      if present, are loaded by the various crypto libraries to
      override their own built-in defaults.
    
      For example, the GNUTLS library may read
      "/etc/crypto-policies/back-ends/gnutls.config".
    
    * A management application (or the QEMU user) may overide the
      system-wide crypto-policies config via their own config, if
      they need to diverge from the former.
    
    Thus the priority order is "QEMU user config" > "crypto-policies
    system config" > "library built-in config".
    
    Introduce the "tls-cipher-suites" object for exposing the ordered
    list of permitted TLS cipher suites from the host side to the
    guest firmware, via fw_cfg. The list is represented as an array
    of bytes.
    
    The priority at which the host-side policy is retrieved is given
    by the "priority" property of the new object type. For example,
    "priority=@SYSTEM" may be used to refer to
    "/etc/crypto-policies/back-ends/gnutls.config" (given that QEMU
    uses GNUTLS).
    
    The firmware uses the IANA_TLS_CIPHER array for configuring
    guest-side TLS, for example in UEFI HTTPS Boot.
    
    [Description from Daniel P. Berrangé, edited by Laszlo Ersek.]
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Acked-by: Laszlo Ersek <lersek@redhat.com>
    Message-Id: <20200623172726.21040-2-philmd@redhat.com>
---
 crypto/Makefile.objs               |   1 +
 crypto/tls-cipher-suites.c         | 115 +++++++++++++++++++++++++++++++++++++
 crypto/trace-events                |   5 ++
 include/crypto/tls-cipher-suites.h |  39 +++++++++++++
 qemu-options.hx                    |  19 ++++++
 5 files changed, 179 insertions(+)

diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index 707c02ad37..f1965b1a68 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -13,6 +13,7 @@ crypto-obj-y += cipher.o
 crypto-obj-$(CONFIG_AF_ALG) += afalg.o
 crypto-obj-$(CONFIG_AF_ALG) += cipher-afalg.o
 crypto-obj-$(CONFIG_AF_ALG) += hash-afalg.o
+crypto-obj-$(CONFIG_GNUTLS) += tls-cipher-suites.o
 crypto-obj-y += tlscreds.o
 crypto-obj-y += tlscredsanon.o
 crypto-obj-y += tlscredspsk.o
diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
new file mode 100644
index 0000000000..a4e0f84307
--- /dev/null
+++ b/crypto/tls-cipher-suites.c
@@ -0,0 +1,115 @@
+/*
+ * QEMU TLS Cipher Suites
+ *
+ * Copyright (c) 2018-2020 Red Hat, Inc.
+ *
+ * Author: Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qom/object_interfaces.h"
+#include "crypto/tlscreds.h"
+#include "crypto/tls-cipher-suites.h"
+#include "trace.h"
+
+/*
+ * IANA registered TLS ciphers:
+ * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4
+ */
+typedef struct {
+    uint8_t data[2];
+} QEMU_PACKED IANA_TLS_CIPHER;
+
+GByteArray *qcrypto_tls_cipher_suites_get_data(QCryptoTLSCipherSuites *obj,
+                                               Error **errp)
+{
+    QCryptoTLSCreds *creds = QCRYPTO_TLS_CREDS(obj);
+    gnutls_priority_t pcache;
+    GByteArray *byte_array;
+    const char *err;
+    size_t i;
+    int ret;
+
+    trace_qcrypto_tls_cipher_suite_priority(creds->priority);
+    ret = gnutls_priority_init(&pcache, creds->priority, &err);
+    if (ret < 0) {
+        error_setg(errp, "Syntax error using priority '%s': %s",
+                   creds->priority, gnutls_strerror(ret));
+        return NULL;
+    }
+
+    byte_array = g_byte_array_new();
+
+    for (i = 0;; i++) {
+        int ret;
+        unsigned idx;
+        const char *name;
+        IANA_TLS_CIPHER cipher;
+        gnutls_protocol_t protocol;
+        const char *version;
+
+        ret = gnutls_priority_get_cipher_suite_index(pcache, i, &idx);
+        if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
+            break;
+        }
+        if (ret == GNUTLS_E_UNKNOWN_CIPHER_SUITE) {
+            continue;
+        }
+
+        name = gnutls_cipher_suite_info(idx, (unsigned char *)&cipher,
+                                        NULL, NULL, NULL, &protocol);
+        if (name == NULL) {
+            continue;
+        }
+
+        version = gnutls_protocol_get_name(protocol);
+        g_byte_array_append(byte_array, cipher.data, 2);
+        trace_qcrypto_tls_cipher_suite_info(cipher.data[0],
+                                            cipher.data[1],
+                                            version, name);
+    }
+    trace_qcrypto_tls_cipher_suite_count(byte_array->len);
+    gnutls_priority_deinit(pcache);
+
+    return byte_array;
+}
+
+static void qcrypto_tls_cipher_suites_complete(UserCreatable *uc,
+                                               Error **errp)
+{
+    QCryptoTLSCreds *creds = QCRYPTO_TLS_CREDS(uc);
+
+    if (!creds->priority) {
+        error_setg(errp, "'priority' property is not set");
+        return;
+    }
+}
+
+static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
+{
+    UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
+
+    ucc->complete = qcrypto_tls_cipher_suites_complete;
+}
+
+static const TypeInfo qcrypto_tls_cipher_suites_info = {
+    .parent = TYPE_QCRYPTO_TLS_CREDS,
+    .name = TYPE_QCRYPTO_TLS_CIPHER_SUITES,
+    .instance_size = sizeof(QCryptoTLSCreds),
+    .class_size = sizeof(QCryptoTLSCredsClass),
+    .class_init = qcrypto_tls_cipher_suites_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { TYPE_USER_CREATABLE },
+        { }
+    }
+};
+
+static void qcrypto_tls_cipher_suites_register_types(void)
+{
+    type_register_static(&qcrypto_tls_cipher_suites_info);
+}
+
+type_init(qcrypto_tls_cipher_suites_register_types);
diff --git a/crypto/trace-events b/crypto/trace-events
index 9e594d30e8..798b6067ab 100644
--- a/crypto/trace-events
+++ b/crypto/trace-events
@@ -21,3 +21,8 @@ qcrypto_tls_creds_x509_load_cert_list(void *creds, const char *file) "TLS creds
 # tlssession.c
 qcrypto_tls_session_new(void *session, void *creds, const char *hostname, const char *authzid, int endpoint) "TLS session new session=%p creds=%p hostname=%s authzid=%s endpoint=%d"
 qcrypto_tls_session_check_creds(void *session, const char *status) "TLS session check creds session=%p status=%s"
+
+# tls-cipher-suites.c
+qcrypto_tls_cipher_suite_priority(const char *name) "priority: %s"
+qcrypto_tls_cipher_suite_info(uint8_t data0, uint8_t data1, const char *version, const char *name) "data=[0x%02x,0x%02x] version=%s name=%s"
+qcrypto_tls_cipher_suite_count(unsigned count) "count: %u"
diff --git a/include/crypto/tls-cipher-suites.h b/include/crypto/tls-cipher-suites.h
new file mode 100644
index 0000000000..28b3a73ce1
--- /dev/null
+++ b/include/crypto/tls-cipher-suites.h
@@ -0,0 +1,39 @@
+/*
+ * QEMU TLS Cipher Suites Registry (RFC8447)
+ *
+ * Copyright (c) 2018-2020 Red Hat, Inc.
+ *
+ * Author: Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QCRYPTO_TLSCIPHERSUITES_H
+#define QCRYPTO_TLSCIPHERSUITES_H
+
+#include "qom/object.h"
+#include "crypto/tlscreds.h"
+
+#define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites"
+#define QCRYPTO_TLS_CIPHER_SUITES(obj) \
+    OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SUITES)
+
+typedef struct QCryptoTLSCipherSuites {
+    /* <private> */
+    QCryptoTLSCreds parent_obj;
+    /* <public> */
+} QCryptoTLSCipherSuites;
+
+/**
+  * qcrypto_tls_cipher_suites_get_data:
+  * @obj: pointer to a TLS cipher suites object
+  * @errp: pointer to a NULL-initialized error object
+  *
+  * Returns: reference to a byte array containing the data.
+  * The caller should release the reference when no longer
+  * required.
+  */
+GByteArray *qcrypto_tls_cipher_suites_get_data(QCryptoTLSCipherSuites *obj,
+                                               Error **errp);
+
+#endif /* QCRYPTO_TLSCIPHERSUITES_H */
diff --git a/qemu-options.hx b/qemu-options.hx
index 196f468786..ecc4658e1f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4567,6 +4567,25 @@ SRST
         string as described at
         https://gnutls.org/manual/html_node/Priority-Strings.html.
 
+    ``-object tls-cipher-suites,id=id,priority=priority``
+        Creates a TLS cipher suites object, which can be used to control
+        the TLS cipher/protocol algorithms that applications are permitted
+        to use.
+
+        The ``id`` parameter is a unique ID which frontends will use to
+        access the ordered list of permitted TLS cipher suites from the
+        host.
+
+        The ``priority`` parameter allows to override the global default
+        priority used by gnutls. This can be useful if the system
+        administrator needs to use a weaker set of crypto priorities for
+        QEMU without potentially forcing the weakness onto all
+        applications. Or conversely if one wants wants a stronger
+        default for QEMU than for all other applications, they can do
+        this through this parameter. Its format is a gnutls priority
+        string as described at
+        https://gnutls.org/manual/html_node/Priority-Strings.html.
+
     ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
         Interval t can't be 0, this filter batches the packet delivery:
         all packets arriving in a given interval on netdev netdevid are
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16246.39693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbFw-0004Gu-Pz; Fri, 30 Oct 2020 20:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16246.39693; Fri, 30 Oct 2020 20:44:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbFw-0004Gn-Mw; Fri, 30 Oct 2020 20:44:16 +0000
Received: by outflank-mailman (input) for mailman id 16246;
 Fri, 30 Oct 2020 20:44:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbFv-0004Gg-Ue
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b3868663-1e37-4d55-bb6b-2c23cb4680be;
 Fri, 30 Oct 2020 20:44:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbFu-0002Ji-Mn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbFu-0003OT-Jz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbFv-0004Gg-Ue
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:15 +0000
X-Inumbo-ID: b3868663-1e37-4d55-bb6b-2c23cb4680be
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b3868663-1e37-4d55-bb6b-2c23cb4680be;
	Fri, 30 Oct 2020 20:44:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QMs62n80C0b+6aHcDc/HzFK8/5HRSR+WEpj+KLqQcDk=; b=tPfEmV7GoRwNmqO0hH539RHmpg
	sxljGfvBx7VF3HUa7x+GbyrrAr7kvaArsEHNd23cn8bqdwA2+0NsGRKxuNzyK5Dqxl2dbWCA+wwzx
	SoQndst0d4scmwUjfFNgPQWSuhi7le51/NvQ0mNjcnvKE6qA2bg0c2IEXN6/99hSR3iI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbFu-0002Ji-Mn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbFu-0003OT-Jz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
Message-Id: <E1kYbFu-0003OT-Jz@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:14 +0000

commit 3203148917d035b09f71986ac2eaa19a352d6d9d
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu May 14 15:15:38 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
    
    The FW_CFG_DATA_GENERATOR allows any object to produce
    blob of data consumable by the fw_cfg device.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-3-philmd@redhat.com>
---
 docs/specs/fw_cfg.txt     |  9 ++++++++-
 hw/nvram/fw_cfg.c         | 35 +++++++++++++++++++++++++++++++++++
 include/hw/nvram/fw_cfg.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 86 insertions(+), 1 deletion(-)

diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
index 8f1ebc66fa..bc16daa38a 100644
--- a/docs/specs/fw_cfg.txt
+++ b/docs/specs/fw_cfg.txt
@@ -219,7 +219,7 @@ To check the result, read the "control" field:
 
 = Externally Provided Items =
 
-As of v2.4, "file" fw_cfg items (i.e., items with selector keys above
+Since v2.4, "file" fw_cfg items (i.e., items with selector keys above
 FW_CFG_FILE_FIRST, and with a corresponding entry in the fw_cfg file
 directory structure) may be inserted via the QEMU command line, using
 the following syntax:
@@ -230,6 +230,13 @@ Or
 
     -fw_cfg [name=]<item_name>,string=<string>
 
+Since v5.1, QEMU allows some objects to generate fw_cfg-specific content,
+the content is then associated with a "file" item using the 'gen_id' option
+in the command line, using the following syntax:
+
+    -object <generator-type>,id=<generated_id>,[generator-specific-options] \
+    -fw_cfg [name=]<item_name>,gen_id=<generated_id>
+
 See QEMU man page for more documentation.
 
 Using item_name with plain ASCII characters only is recommended.
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 0408a31f8e..694722b212 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1032,6 +1032,35 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
     return NULL;
 }
 
+void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+                               const char *gen_id, Error **errp)
+{
+    FWCfgDataGeneratorClass *klass;
+    Error *local_err = NULL;
+    GByteArray *array;
+    Object *obj;
+    gsize size;
+
+    obj = object_resolve_path_component(object_get_objects_root(), gen_id);
+    if (!obj) {
+        error_setg(errp, "Cannot find object ID '%s'", gen_id);
+        return;
+    }
+    if (!object_dynamic_cast(obj, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)) {
+        error_setg(errp, "Object ID '%s' is not a '%s' subclass",
+                   gen_id, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE);
+        return;
+    }
+    klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
+    array = klass->get_data(obj, &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+    size = array->len;
+    fw_cfg_add_file(s, filename, g_byte_array_free(array, TRUE), size);
+}
+
 static void fw_cfg_machine_reset(void *opaque)
 {
     MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
@@ -1333,12 +1362,18 @@ static const TypeInfo fw_cfg_mem_info = {
     .class_init    = fw_cfg_mem_class_init,
 };
 
+static const TypeInfo fw_cfg_data_generator_interface_info = {
+    .parent = TYPE_INTERFACE,
+    .name = TYPE_FW_CFG_DATA_GENERATOR_INTERFACE,
+    .class_size = sizeof(FWCfgDataGeneratorClass),
+};
 
 static void fw_cfg_register_types(void)
 {
     type_register_static(&fw_cfg_info);
     type_register_static(&fw_cfg_io_info);
     type_register_static(&fw_cfg_mem_info);
+    type_register_static(&fw_cfg_data_generator_interface_info);
 }
 
 type_init(fw_cfg_register_types)
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 25d9307018..11feae3177 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -9,11 +9,36 @@
 #define TYPE_FW_CFG     "fw_cfg"
 #define TYPE_FW_CFG_IO  "fw_cfg_io"
 #define TYPE_FW_CFG_MEM "fw_cfg_mem"
+#define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator"
 
 #define FW_CFG(obj)     OBJECT_CHECK(FWCfgState,    (obj), TYPE_FW_CFG)
 #define FW_CFG_IO(obj)  OBJECT_CHECK(FWCfgIoState,  (obj), TYPE_FW_CFG_IO)
 #define FW_CFG_MEM(obj) OBJECT_CHECK(FWCfgMemState, (obj), TYPE_FW_CFG_MEM)
 
+#define FW_CFG_DATA_GENERATOR_CLASS(class) \
+    OBJECT_CLASS_CHECK(FWCfgDataGeneratorClass, (class), \
+                       TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)
+#define FW_CFG_DATA_GENERATOR_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(FWCfgDataGeneratorClass, (obj), \
+                     TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)
+
+typedef struct FWCfgDataGeneratorClass {
+    /*< private >*/
+    InterfaceClass parent_class;
+    /*< public >*/
+
+    /**
+     * get_data:
+     * @obj: the object implementing this interface
+     * @errp: pointer to a NULL-initialized error object
+     *
+     * Returns: reference to a byte array containing the data.
+     * The caller should release the reference when no longer
+     * required.
+     */
+    GByteArray *(*get_data)(Object *obj, Error **errp);
+} FWCfgDataGeneratorClass;
+
 typedef struct fw_cfg_file FWCfgFile;
 
 #define FW_CFG_ORDER_OVERRIDE_VGA    70
@@ -263,6 +288,24 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
 void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
                          size_t len);
 
+/**
+ * fw_cfg_add_from_generator:
+ * @s: fw_cfg device being modified
+ * @filename: name of new fw_cfg file item
+ * @gen_id: name of object implementing FW_CFG_DATA_GENERATOR interface
+ * @errp: pointer to a NULL initialized error object
+ *
+ * Add a new NAMED fw_cfg item with the content generated from the
+ * @gen_id object. The data generated by the @gen_id object is copied
+ * into the data structure of the fw_cfg device.
+ * The next available (unused) selector key starting at FW_CFG_FILE_FIRST
+ * will be used; also, a new entry will be added to the file directory
+ * structure residing at key value FW_CFG_FILE_DIR, containing the item name,
+ * data size, and assigned selector key value.
+ */
+void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+                               const char *gen_id, Error **errp);
+
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
                                 AddressSpace *dma_as);
 FWCfgState *fw_cfg_init_io(uint32_t iobase);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16247.39698 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbG6-0004IJ-Ry; Fri, 30 Oct 2020 20:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16247.39698; Fri, 30 Oct 2020 20:44:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbG6-0004IB-Oj; Fri, 30 Oct 2020 20:44:26 +0000
Received: by outflank-mailman (input) for mailman id 16247;
 Fri, 30 Oct 2020 20:44:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbG5-0004I2-Rw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 77abfdef-e08f-48e6-a9ec-8b1d3f3dcb3d;
 Fri, 30 Oct 2020 20:44:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbG4-0002Ju-R9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbG4-0003PY-Pm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbG5-0004I2-Rw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:25 +0000
X-Inumbo-ID: 77abfdef-e08f-48e6-a9ec-8b1d3f3dcb3d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 77abfdef-e08f-48e6-a9ec-8b1d3f3dcb3d;
	Fri, 30 Oct 2020 20:44:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GTsTZ4O6KUiPOWZ52IjaMkUzOgS0nDO1jvX9DLMGoZU=; b=umxY4vgILLTM/dIut2kjJYRbdw
	HAMXtJyR7apDglqYxw+ny9uWl8CVJfv87i+rs+uk7lnqCOK5xfdLx2PkSh1Wh0gy5PN1qEucMgNpc
	Tzhq5RkUDgUwxVvh0/H9LbSAx5/L3zSHsBuMStCUBJM6edJKohuFYwn8aGKKKCicBvQw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbG4-0002Ju-R9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbG4-0003PY-Pm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
Message-Id: <E1kYbG4-0003PY-Pm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:24 +0000

commit 6552d87c48679e1ece2da3ddc0947d2146de53ee
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue May 19 19:20:43 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
    
    The 'gen_id' argument refers to a QOM object able to produce
    data consumable by the fw_cfg device. The producer object must
    implement the FW_CFG_DATA_GENERATOR interface.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-4-philmd@redhat.com>
---
 softmmu/vl.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3e15ee2435..13cada39d6 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -489,6 +489,11 @@ static QemuOptsList qemu_fw_cfg_opts = {
             .name = "string",
             .type = QEMU_OPT_STRING,
             .help = "Sets content of the blob to be inserted from a string",
+        }, {
+            .name = "gen_id",
+            .type = QEMU_OPT_STRING,
+            .help = "Sets id of the object generating the fw_cfg blob "
+                    "to be inserted",
         },
         { /* end of list */ }
     },
@@ -2020,7 +2025,7 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
 {
     gchar *buf;
     size_t size;
-    const char *name, *file, *str;
+    const char *name, *file, *str, *gen_id;
     FWCfgState *fw_cfg = (FWCfgState *) opaque;
 
     if (fw_cfg == NULL) {
@@ -2030,14 +2035,13 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
     name = qemu_opt_get(opts, "name");
     file = qemu_opt_get(opts, "file");
     str = qemu_opt_get(opts, "string");
+    gen_id = qemu_opt_get(opts, "gen_id");
 
-    /* we need name and either a file or the content string */
-    if (!(nonempty_str(name) && (nonempty_str(file) || nonempty_str(str)))) {
-        error_setg(errp, "invalid argument(s)");
-        return -1;
-    }
-    if (nonempty_str(file) && nonempty_str(str)) {
-        error_setg(errp, "file and string are mutually exclusive");
+    /* we need the name, and exactly one of: file, content string, gen_id */
+    if (!nonempty_str(name) ||
+        nonempty_str(file) + nonempty_str(str) + nonempty_str(gen_id) != 1) {
+        error_setg(errp, "name, plus exactly one of file,"
+                         " string and gen_id, are needed");
         return -1;
     }
     if (strlen(name) > FW_CFG_MAX_FILE_PATH - 1) {
@@ -2052,6 +2056,15 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
     if (nonempty_str(str)) {
         size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
         buf = g_memdup(str, size);
+    } else if (nonempty_str(gen_id)) {
+        Error *local_err = NULL;
+
+        fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            return -1;
+        }
+        return 0;
     } else {
         GError *err = NULL;
         if (!g_file_get_contents(file, &buf, &size, &err)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16248.39704 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGG-0004Jb-UM; Fri, 30 Oct 2020 20:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16248.39704; Fri, 30 Oct 2020 20:44:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGG-0004JO-QM; Fri, 30 Oct 2020 20:44:36 +0000
Received: by outflank-mailman (input) for mailman id 16248;
 Fri, 30 Oct 2020 20:44:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbGF-0004JD-PO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 466e8d62-1c79-4831-bebd-d1d913c050d9;
 Fri, 30 Oct 2020 20:44:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGE-0002K2-Vy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGE-0003Qb-U6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbGF-0004JD-PO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:35 +0000
X-Inumbo-ID: 466e8d62-1c79-4831-bebd-d1d913c050d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 466e8d62-1c79-4831-bebd-d1d913c050d9;
	Fri, 30 Oct 2020 20:44:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yWMZ7TXfhfc1eki1pdD1mTHSoYyt6D0RnjJpzFhlylE=; b=c4ZgcxH9sjIvCzD0XcoMngGa1e
	7viW9/I40fUykbre5qw1U/x2dyaSv6DGraiMCGv74CEabzjV9y0d4ttAUc2RArYx/+Gnt8TJSdkjj
	eWaNbCwp1qibwO+O4pKeCepc/bTwzsPLMMsjZ2BfjmabXPZ6l7GlbgDO0kBV4sEgs8j8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGE-0002K2-Vy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGE-0003Qb-U6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
Message-Id: <E1kYbGE-0003Qb-U6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:34 +0000

commit f7d8afb16dceb780270960692b949329c8752ff2
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue May 19 19:17:09 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
    
    Names of user-provided fw_cfg items are supposed to start
    with "opt/". However FW_CFG_DATA_GENERATOR items are generated
    by QEMU, so allow the "etc/" namespace in this specific case.
    
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200623172726.21040-5-philmd@redhat.com>
---
 docs/specs/fw_cfg.txt | 4 ++++
 softmmu/vl.c          | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt
index bc16daa38a..3e6d586f66 100644
--- a/docs/specs/fw_cfg.txt
+++ b/docs/specs/fw_cfg.txt
@@ -258,4 +258,8 @@ Prefix "opt/org.qemu/" is reserved for QEMU itself.
 Use of names not beginning with "opt/" is potentially dangerous and
 entirely unsupported.  QEMU will warn if you try.
 
+Use of names not beginning with "opt/" is tolerated with 'gen_id' (that
+is, the warning is suppressed), but you must know exactly what you're
+doing.
+
 All externally provided fw_cfg items are read-only to the guest.
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 13cada39d6..159f0352a9 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2049,7 +2049,13 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
                    FW_CFG_MAX_FILE_PATH - 1);
         return -1;
     }
-    if (strncmp(name, "opt/", 4) != 0) {
+    if (nonempty_str(gen_id)) {
+        /*
+         * In this particular case where the content is populated
+         * internally, the "etc/" namespace protection is relaxed,
+         * so do not emit a warning.
+         */
+    } else if (strncmp(name, "opt/", 4) != 0) {
         warn_report("externally provided fw_cfg item names "
                     "should be prefixed with \"opt/\"");
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16249.39706 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGR-0004LV-Uy; Fri, 30 Oct 2020 20:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16249.39706; Fri, 30 Oct 2020 20:44:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGR-0004LO-S4; Fri, 30 Oct 2020 20:44:47 +0000
Received: by outflank-mailman (input) for mailman id 16249;
 Fri, 30 Oct 2020 20:44:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbGQ-0004LF-NU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 283e4df8-cb52-4f21-b1dc-1a88e1ee2ca8;
 Fri, 30 Oct 2020 20:44:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGP-0002Kd-3l
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGP-0003Ro-2m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbGQ-0004LF-NU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:46 +0000
X-Inumbo-ID: 283e4df8-cb52-4f21-b1dc-1a88e1ee2ca8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 283e4df8-cb52-4f21-b1dc-1a88e1ee2ca8;
	Fri, 30 Oct 2020 20:44:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=b0OVc2BDecCmPCqw67bFLufIg5YsArYvMWo5DPFns3c=; b=O/tQKX1qBTa5hrLBwRZGqlkT1m
	L+U5rla8weF/UAa7WV+XLFhk0Cj3bV7FSn86TdbUWboZt2e6UtzBh9iltupJPgB7R6jH7nfs0AsHL
	BnfHGsrH74axJ1tVk9cTqpyZX2EN9O/YttHhr/Hb145P6dHuyXnb7s4gqNP4JhRUgRIU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGP-0002Kd-3l
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGP-0003Ro-2m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] crypto/tls-cipher-suites: Produce fw_cfg consumable blob
Message-Id: <E1kYbGP-0003Ro-2m@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:45 +0000

commit 69699f3055a59e24f1153c329ae6eff4b9a343e0
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu May 14 15:15:47 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Fri Jul 3 18:16:01 2020 +0200

    crypto/tls-cipher-suites: Produce fw_cfg consumable blob
    
    Since our format is consumable by the fw_cfg device,
    we can implement the FW_CFG_DATA_GENERATOR interface.
    
    Example of use to dump the cipher suites (if tracing enabled):
    
      $ qemu-system-x86_64 -S \
        -object tls-cipher-suites,id=mysuite1,priority=@SYSTEM \
        -fw_cfg name=etc/path/to/ciphers,gen_id=mysuite1 \
        -trace qcrypto\*
      1590664444.197123:qcrypto_tls_cipher_suite_priority priority: @SYSTEM
      1590664444.197219:qcrypto_tls_cipher_suite_info data=[0x13,0x02] version=TLS1.3 name=TLS_AES_256_GCM_SHA384
      1590664444.197228:qcrypto_tls_cipher_suite_info data=[0x13,0x03] version=TLS1.3 name=TLS_CHACHA20_POLY1305_SHA256
      1590664444.197233:qcrypto_tls_cipher_suite_info data=[0x13,0x01] version=TLS1.3 name=TLS_AES_128_GCM_SHA256
      1590664444.197236:qcrypto_tls_cipher_suite_info data=[0x13,0x04] version=TLS1.3 name=TLS_AES_128_CCM_SHA256
      1590664444.197240:qcrypto_tls_cipher_suite_info data=[0xc0,0x30] version=TLS1.2 name=TLS_ECDHE_RSA_AES_256_GCM_SHA384
      1590664444.197245:qcrypto_tls_cipher_suite_info data=[0xcc,0xa8] version=TLS1.2 name=TLS_ECDHE_RSA_CHACHA20_POLY1305
      1590664444.197250:qcrypto_tls_cipher_suite_info data=[0xc0,0x14] version=TLS1.0 name=TLS_ECDHE_RSA_AES_256_CBC_SHA1
      1590664444.197254:qcrypto_tls_cipher_suite_info data=[0xc0,0x2f] version=TLS1.2 name=TLS_ECDHE_RSA_AES_128_GCM_SHA256
      1590664444.197258:qcrypto_tls_cipher_suite_info data=[0xc0,0x13] version=TLS1.0 name=TLS_ECDHE_RSA_AES_128_CBC_SHA1
      1590664444.197261:qcrypto_tls_cipher_suite_info data=[0xc0,0x2c] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_256_GCM_SHA384
      1590664444.197266:qcrypto_tls_cipher_suite_info data=[0xcc,0xa9] version=TLS1.2 name=TLS_ECDHE_ECDSA_CHACHA20_POLY1305
      1590664444.197270:qcrypto_tls_cipher_suite_info data=[0xc0,0xad] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_256_CCM
      1590664444.197274:qcrypto_tls_cipher_suite_info data=[0xc0,0x0a] version=TLS1.0 name=TLS_ECDHE_ECDSA_AES_256_CBC_SHA1
      1590664444.197278:qcrypto_tls_cipher_suite_info data=[0xc0,0x2b] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_128_GCM_SHA256
      1590664444.197283:qcrypto_tls_cipher_suite_info data=[0xc0,0xac] version=TLS1.2 name=TLS_ECDHE_ECDSA_AES_128_CCM
      1590664444.197287:qcrypto_tls_cipher_suite_info data=[0xc0,0x09] version=TLS1.0 name=TLS_ECDHE_ECDSA_AES_128_CBC_SHA1
      1590664444.197291:qcrypto_tls_cipher_suite_info data=[0x00,0x9d] version=TLS1.2 name=TLS_RSA_AES_256_GCM_SHA384
      1590664444.197296:qcrypto_tls_cipher_suite_info data=[0xc0,0x9d] version=TLS1.2 name=TLS_RSA_AES_256_CCM
      1590664444.197300:qcrypto_tls_cipher_suite_info data=[0x00,0x35] version=TLS1.0 name=TLS_RSA_AES_256_CBC_SHA1
      1590664444.197304:qcrypto_tls_cipher_suite_info data=[0x00,0x9c] version=TLS1.2 name=TLS_RSA_AES_128_GCM_SHA256
      1590664444.197308:qcrypto_tls_cipher_suite_info data=[0xc0,0x9c] version=TLS1.2 name=TLS_RSA_AES_128_CCM
      1590664444.197312:qcrypto_tls_cipher_suite_info data=[0x00,0x2f] version=TLS1.0 name=TLS_RSA_AES_128_CBC_SHA1
      1590664444.197316:qcrypto_tls_cipher_suite_info data=[0x00,0x9f] version=TLS1.2 name=TLS_DHE_RSA_AES_256_GCM_SHA384
      1590664444.197320:qcrypto_tls_cipher_suite_info data=[0xcc,0xaa] version=TLS1.2 name=TLS_DHE_RSA_CHACHA20_POLY1305
      1590664444.197325:qcrypto_tls_cipher_suite_info data=[0xc0,0x9f] version=TLS1.2 name=TLS_DHE_RSA_AES_256_CCM
      1590664444.197329:qcrypto_tls_cipher_suite_info data=[0x00,0x39] version=TLS1.0 name=TLS_DHE_RSA_AES_256_CBC_SHA1
      1590664444.197333:qcrypto_tls_cipher_suite_info data=[0x00,0x9e] version=TLS1.2 name=TLS_DHE_RSA_AES_128_GCM_SHA256
      1590664444.197337:qcrypto_tls_cipher_suite_info data=[0xc0,0x9e] version=TLS1.2 name=TLS_DHE_RSA_AES_128_CCM
      1590664444.197341:qcrypto_tls_cipher_suite_info data=[0x00,0x33] version=TLS1.0 name=TLS_DHE_RSA_AES_128_CBC_SHA1
      1590664444.197345:qcrypto_tls_cipher_suite_count count: 29
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Acked-by: Laszlo Ersek <lersek@redhat.com>
    Message-Id: <20200623172726.21040-6-philmd@redhat.com>
---
 crypto/tls-cipher-suites.c | 11 +++++++++++
 qemu-options.hx            | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
index a4e0f84307..0d305b684b 100644
--- a/crypto/tls-cipher-suites.c
+++ b/crypto/tls-cipher-suites.c
@@ -13,6 +13,7 @@
 #include "qom/object_interfaces.h"
 #include "crypto/tlscreds.h"
 #include "crypto/tls-cipher-suites.h"
+#include "hw/nvram/fw_cfg.h"
 #include "trace.h"
 
 /*
@@ -88,11 +89,20 @@ static void qcrypto_tls_cipher_suites_complete(UserCreatable *uc,
     }
 }
 
+static GByteArray *qcrypto_tls_cipher_suites_fw_cfg_gen_data(Object *obj,
+                                                             Error **errp)
+{
+    return qcrypto_tls_cipher_suites_get_data(QCRYPTO_TLS_CIPHER_SUITES(obj),
+                                              errp);
+}
+
 static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
 {
     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
+    FWCfgDataGeneratorClass *fwgc = FW_CFG_DATA_GENERATOR_CLASS(oc);
 
     ucc->complete = qcrypto_tls_cipher_suites_complete;
+    fwgc->get_data = qcrypto_tls_cipher_suites_fw_cfg_gen_data;
 }
 
 static const TypeInfo qcrypto_tls_cipher_suites_info = {
@@ -103,6 +113,7 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = {
     .class_init = qcrypto_tls_cipher_suites_class_init,
     .interfaces = (InterfaceInfo[]) {
         { TYPE_USER_CREATABLE },
+        { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE },
         { }
     }
 };
diff --git a/qemu-options.hx b/qemu-options.hx
index ecc4658e1f..b2cbbbf281 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4586,6 +4586,24 @@ SRST
         string as described at
         https://gnutls.org/manual/html_node/Priority-Strings.html.
 
+        An example of use of this object is to control UEFI HTTPS Boot.
+        The tls-cipher-suites object exposes the ordered list of permitted
+        TLS cipher suites from the host side to the guest firmware, via
+        fw_cfg. The list is represented as an array of IANA_TLS_CIPHER
+        objects. The firmware uses the IANA_TLS_CIPHER array for configuring
+        guest-side TLS.
+
+        In the following example, the priority at which the host-side policy
+        is retrieved is given by the ``priority`` property.
+        Given that QEMU uses GNUTLS, ``priority=@SYSTEM`` may be used to
+        refer to /etc/crypto-policies/back-ends/gnutls.config.
+
+        .. parsed-literal::
+
+             # |qemu_system| \
+                 -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \
+                 -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0
+
     ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
         Interval t can't be 0, this filter batches the packet delivery:
         all packets arriving in a given interval on netdev netdevid are
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:44:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:44:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16250.39709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGc-0004Mo-0o; Fri, 30 Oct 2020 20:44:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16250.39709; Fri, 30 Oct 2020 20:44:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGb-0004Mg-Tg; Fri, 30 Oct 2020 20:44:57 +0000
Received: by outflank-mailman (input) for mailman id 16250;
 Fri, 30 Oct 2020 20:44:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbGa-0004MT-CZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8d292c6c-f4c5-402f-80c0-cf684c594b4b;
 Fri, 30 Oct 2020 20:44:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGZ-0002Ko-8Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGZ-0003Sw-7T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbGa-0004MT-CZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:56 +0000
X-Inumbo-ID: 8d292c6c-f4c5-402f-80c0-cf684c594b4b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8d292c6c-f4c5-402f-80c0-cf684c594b4b;
	Fri, 30 Oct 2020 20:44:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KkWhtrco8q2djas+wGpGk8bjWbtiYQ0OvEaadgAPNBg=; b=lMONlwkc35/42kOBnpSojMNNcr
	+54OWaN7Zr4/k2nJLwpkjetO84+IpOQmj2wPaybSdTSb3ElsH6MhpKTIUBJe0Ot3izr5KaHF9zcTX
	YlC9bWJYQ8Zl2m13KxGnurjPmGx3N5lhXyrsz6giVNVC9MCA25ebDXAXPHtgVC1B9mPU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGZ-0002Ko-8Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGZ-0003Sw-7T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:44:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200704' into staging
Message-Id: <E1kYbGZ-0003Sw-7T@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:44:55 +0000

commit aecdfcc3f8499b34a90e5b21159b4d245bc833c2
Merge: aff2caf6b3fbab1062e117a47b66d27f7fd2f272 69699f3055a59e24f1153c329ae6eff4b9a343e0
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 9 20:01:43 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 9 20:01:43 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200704' into staging
    
    firmware (and crypto) patches
    
    - add the tls-cipher-suites object,
    - add the ability to QOM objects to produce data consumable
      by the fw_cfg device,
    - let the tls-cipher-suites object implement the
      FW_CFG_DATA_GENERATOR interface.
    
    This is required by EDK2 'HTTPS Boot' feature of OVMF to tell
    the guest which TLS ciphers it can use.
    
    CI jobs results:
      https://travis-ci.org/github/philmd/qemu/builds/704724619
      https://gitlab.com/philmd/qemu/-/pipelines/162938106
      https://cirrus-ci.com/build/4682977303068672
    
    # gpg: Signature made Sat 04 Jul 2020 17:37:08 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/fw_cfg-20200704:
      crypto/tls-cipher-suites: Produce fw_cfg consumable blob
      softmmu/vl: Allow -fw_cfg 'gen_id' option to use the 'etc/' namespace
      softmmu/vl: Let -fw_cfg option take a 'gen_id' argument
      hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface
      crypto: Add tls-cipher-suites object
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 crypto/Makefile.objs               |   1 +
 crypto/tls-cipher-suites.c         | 126 +++++++++++++++++++++++++++++++++++++
 crypto/trace-events                |   5 ++
 docs/specs/fw_cfg.txt              |  13 +++-
 hw/nvram/fw_cfg.c                  |  35 +++++++++++
 include/crypto/tls-cipher-suites.h |  39 ++++++++++++
 include/hw/nvram/fw_cfg.h          |  43 +++++++++++++
 qemu-options.hx                    |  37 +++++++++++
 softmmu/vl.c                       |  37 ++++++++---
 9 files changed, 326 insertions(+), 10 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:45:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:45:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16251.39713 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGm-0004OE-3v; Fri, 30 Oct 2020 20:45:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16251.39713; Fri, 30 Oct 2020 20:45:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGm-0004O6-14; Fri, 30 Oct 2020 20:45:08 +0000
Received: by outflank-mailman (input) for mailman id 16251;
 Fri, 30 Oct 2020 20:45:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbGk-0004Nw-Fi
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 20a62e54-dcbb-4b5e-bf6f-7909f21afeeb;
 Fri, 30 Oct 2020 20:45:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGj-0002LM-L1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGj-0003UU-Jz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbGk-0004Nw-Fi
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:06 +0000
X-Inumbo-ID: 20a62e54-dcbb-4b5e-bf6f-7909f21afeeb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 20a62e54-dcbb-4b5e-bf6f-7909f21afeeb;
	Fri, 30 Oct 2020 20:45:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=brz9tSu3jcRw4gwpG7rDQSMcKJJPIGnqN4M1oMter6g=; b=XZ3F5ZfaLBQFgVkgLMPAzSx1Vs
	+owjQ0uAaD6uf5f6wGU6SLblK7Z5NdqtKbsUsPO0R9shHfy5zFser+gDev1gwnV6StuJGqseo+Lw/
	AEkV96JvZjyWU8NmGGx9pym6XBJs1yuo4TJqmo+H79+VkEHLyF/2CwV3Y9iMo2rNSjk8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGj-0002LM-L1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGj-0003UU-Jz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tracetool: work around ust <sys/sdt.h> include conflict
Message-Id: <E1kYbGj-0003UU-Jz@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:45:05 +0000

commit 27e08bab94f7c6ebe0b75938c98c394c969e3fd8
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Thu Jun 25 15:07:57 2020 +0100
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Tue Jul 7 16:07:14 2020 +0100

    tracetool: work around ust <sys/sdt.h> include conflict
    
    Both the dtrace and ust backends may include <sys/sdt.h> but LTTng
    Userspace Tracer 2.11 and later requires SDT_USE_VARIADIC to be defined
    before including the header file.
    
    This is a classic problem with C header files included from different
    parts of a program. If the same header is included twice within the same
    compilation unit then the first inclusion determines the macro
    environment.
    
    Work around this by defining SDT_USE_VARIADIC in the dtrace backend too.
    It doesn't hurt and fixes a missing STAP_PROBEV() compiler error when
    the ust backend is enabled together with the dtrace backend.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 20200625140757.237012-1-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool/backend/dtrace.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 5711892ba0..b7fe4c1b50 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -40,6 +40,12 @@ def generate_h_begin(events, group):
     else:
         header = "trace-dtrace.h"
 
+    # Workaround for ust backend, which also includes <sys/sdt.h> and may
+    # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h>
+    # first without defining SDT_USE_VARIADIC then ust breaks because the
+    # STAP_PROBEV() macro is not defined.
+    out('#define SDT_USE_VARIADIC 1')
+
     out('#include "%s"' % header,
         '')
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:45:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:45:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16252.39718 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGw-0004Pn-60; Fri, 30 Oct 2020 20:45:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16252.39718; Fri, 30 Oct 2020 20:45:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbGw-0004Pd-2h; Fri, 30 Oct 2020 20:45:18 +0000
Received: by outflank-mailman (input) for mailman id 16252;
 Fri, 30 Oct 2020 20:45:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbGu-0004PM-LQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cee6b2b6-2a6c-4ba2-958b-9362c433b378;
 Fri, 30 Oct 2020 20:45:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGt-0002LU-Q8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbGt-0003Vb-O2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbGu-0004PM-LQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:16 +0000
X-Inumbo-ID: cee6b2b6-2a6c-4ba2-958b-9362c433b378
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cee6b2b6-2a6c-4ba2-958b-9362c433b378;
	Fri, 30 Oct 2020 20:45:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4U9XP4Ds9m1l4ASe/h7XJsBuJ/1vhEvpN7hM/pIwR6s=; b=y+VFlEPUCap2eIH3Ylght6iHjk
	C2BWWC+zz0+Uh3wwztX4EYie3MeQFnWZf6QKPoGcMEZkUFemWvsvTKVKoaDtjD5mQHPcE0bv1xxNO
	f0Utkg3ya8yJVmtrZeILqQ4vhUBC1ZwTCbXy3jEV71Ro0nfAzpfrzufWfjy9efAzwPs0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGt-0002LU-Q8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbGt-0003Vb-O2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Message-Id: <E1kYbGt-0003Vb-O2@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:45:15 +0000

commit b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf
Merge: aecdfcc3f8499b34a90e5b21159b4d245bc833c2 27e08bab94f7c6ebe0b75938c98c394c969e3fd8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 09:01:28 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 09:01:28 2020 +0100

    Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
    
    Pull request
    
    Fix for a LTTng Userspace Tracer header problem.
    
    # gpg: Signature made Tue 07 Jul 2020 16:10:04 BST
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
    
    * remotes/stefanha/tags/tracing-pull-request:
      tracetool: work around ust <sys/sdt.h> include conflict
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/tracetool/backend/dtrace.py | 6 ++++++
 1 file changed, 6 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:45:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16253.39722 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbHC-0004R4-8L; Fri, 30 Oct 2020 20:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16253.39722; Fri, 30 Oct 2020 20:45:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbHC-0004Qx-4c; Fri, 30 Oct 2020 20:45:34 +0000
Received: by outflank-mailman (input) for mailman id 16253;
 Fri, 30 Oct 2020 20:45:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbHA-0004Qr-DW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e2e27c59-2315-46aa-8c0e-1cbe9c211437;
 Fri, 30 Oct 2020 20:45:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbH4-0002Ln-QR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbH4-0003YQ-Nh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbHA-0004Qr-DW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:32 +0000
X-Inumbo-ID: e2e27c59-2315-46aa-8c0e-1cbe9c211437
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e2e27c59-2315-46aa-8c0e-1cbe9c211437;
	Fri, 30 Oct 2020 20:45:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gk7qfmo9P/MWu+j90IbSnjIoTaEKYaI64j7wL7WsmdU=; b=3KYGd+4G9C7lVBMolEcq1Z04Gn
	R6gJEj5mZYQHe4HBFGKfgzLmhaZsgrKlWUQPzB62yO9t83KzHt0JvcQxLd3ej6GTQ8RIhpyQXEpX0
	HiHqUp6Zn0ib4UzIGrP70Cu8MZ0qHpcSUJ93qeDNpknoyRj5rzJVspVFiejhgK/s+92c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbH4-0002Ln-QR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbH4-0003YQ-Nh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:45:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' into staging
Message-Id: <E1kYbH4-0003YQ-Nh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:45:26 +0000

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

commit f2a1cf9180f63e88bb38ff21c169da97c3f2bad5
Merge: b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf 1de7096d8378a57e2d75d9cacc9a119e7e41640d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 14:41:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 14:41:23 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-07-v2' into staging
    
    Error reporting patches patches for 2020-07-07
    
    # gpg: Signature made Fri 10 Jul 2020 14:24:42 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-error-2020-07-07-v2: (53 commits)
      xen: Use ERRP_GUARD()
      nbd: Use ERRP_GUARD()
      virtio-9p: Use ERRP_GUARD()
      fw_cfg: Use ERRP_GUARD()
      pflash: Use ERRP_GUARD()
      sd: Use ERRP_GUARD()
      scripts: Coccinelle script to use ERRP_GUARD()
      error: New macro ERRP_GUARD()
      hmp: Ignore Error objects where the return value suffices
      qdev: Ignore Error objects where the return value suffices
      qemu-img: Ignore Error objects where the return value suffices
      error: Avoid error_propagate() after migrate_add_blocker()
      qapi: Purge error_propagate() from QAPI core
      qapi: Smooth visitor error checking in generated code
      qapi: Smooth another visitor error checking pattern
      block/parallels: Simplify parallels_open() after previous commit
      error: Reduce unnecessary error propagation
      error: Eliminate error_propagate() manually
      error: Eliminate error_propagate() with Coccinelle, part 2
      error: Eliminate error_propagate() with Coccinelle, part 1
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                              |   1 +
 accel/kvm/kvm-all.c                      |  55 +++--
 accel/tcg/tcg-all.c                      |   5 +-
 audio/audio_legacy.c                     |  15 +-
 backends/cryptodev-vhost-user.c          |   3 +-
 backends/cryptodev.c                     |  16 +-
 backends/hostmem-file.c                  |  22 +-
 backends/hostmem-memfd.c                 |  18 +-
 backends/hostmem.c                       |  33 ++-
 backends/rng.c                           |   2 +-
 backends/tpm/tpm_util.c                  |   5 +-
 block.c                                  |  21 +-
 block/blkdebug.c                         |   9 +-
 block/blklogwrites.c                     |   4 +-
 block/blkverify.c                        |   4 +-
 block/crypto.c                           |   5 +-
 block/curl.c                             |   5 +-
 block/file-posix.c                       |  16 +-
 block/file-win32.c                       |   8 +-
 block/gluster.c                          |  17 +-
 block/iscsi.c                            |   4 +-
 block/nbd.c                              |  17 +-
 block/nfs.c                              |   7 +-
 block/parallels.c                        |  29 +--
 block/qcow.c                             |  16 +-
 block/qcow2.c                            |  21 +-
 block/qed.c                              |  10 +-
 block/quorum.c                           |  19 +-
 block/raw-format.c                       |   5 +-
 block/rbd.c                              |   7 +-
 block/replication.c                      |  19 +-
 block/sheepdog.c                         |  16 +-
 block/ssh.c                              |  11 +-
 block/throttle-groups.c                  |  31 +--
 block/throttle.c                         |   5 +-
 block/vdi.c                              |  13 +-
 block/vhdx.c                             |  15 +-
 block/vmdk.c                             |  13 +-
 block/vpc.c                              |  19 +-
 block/vvfat.c                            |  10 +-
 block/vxhs.c                             |  15 +-
 blockdev.c                               |  40 ++--
 bootdevice.c                             |  13 +-
 chardev/char.c                           |   6 +-
 contrib/ivshmem-server/main.c            |   4 +-
 crypto/secret.c                          |   2 +-
 crypto/secret_keyring.c                  |   2 +-
 crypto/tlscredsanon.c                    |   2 +-
 crypto/tlscredspsk.c                     |   2 +-
 crypto/tlscredsx509.c                    |   2 +-
 docs/devel/qapi-code-gen.txt             | 103 ++++------
 dump/dump.c                              |   7 +-
 hw/9pfs/9p-local.c                       |  12 +-
 hw/9pfs/9p.c                             |   1 +
 hw/acpi/core.c                           |  19 +-
 hw/acpi/cpu_hotplug.c                    |   4 +-
 hw/acpi/ich9.c                           |   2 +-
 hw/acpi/piix4.c                          |   2 +-
 hw/arm/allwinner-a10.c                   |  27 +--
 hw/arm/armsse.c                          | 208 ++++++-------------
 hw/arm/armv7m.c                          |  47 ++---
 hw/arm/aspeed.c                          |  24 +--
 hw/arm/aspeed_ast2600.c                  | 124 ++++--------
 hw/arm/aspeed_soc.c                      |  85 +++-----
 hw/arm/bcm2835_peripherals.c             |  81 ++------
 hw/arm/bcm2836.c                         |  35 +---
 hw/arm/cubieboard.c                      |  14 +-
 hw/arm/digic.c                           |  18 +-
 hw/arm/digic_boards.c                    |   3 +-
 hw/arm/exynos4210.c                      |  13 +-
 hw/arm/fsl-imx25.c                       |  58 ++----
 hw/arm/fsl-imx31.c                       |  34 +---
 hw/arm/fsl-imx6.c                        |  85 +++-----
 hw/arm/fsl-imx6ul.c                      |  29 ++-
 hw/arm/fsl-imx7.c                        |  31 ++-
 hw/arm/highbank.c                        |  12 +-
 hw/arm/integratorcp.c                    |   2 +-
 hw/arm/mcimx6ul-evk.c                    |   4 +-
 hw/arm/microbit.c                        |   4 +-
 hw/arm/mps2-tz.c                         |  31 ++-
 hw/arm/mps2.c                            |  12 +-
 hw/arm/msf2-soc.c                        |  29 +--
 hw/arm/musca.c                           |  18 +-
 hw/arm/musicpal.c                        |   4 +-
 hw/arm/nrf51_soc.c                       |  36 +---
 hw/arm/orangepi.c                        |  13 +-
 hw/arm/raspi.c                           |   2 +-
 hw/arm/realview.c                        |   6 +-
 hw/arm/sbsa-ref.c                        |  16 +-
 hw/arm/stellaris.c                       |   4 +-
 hw/arm/stm32f205_soc.c                   |  37 +---
 hw/arm/stm32f405_soc.c                   |  48 ++---
 hw/arm/versatilepb.c                     |   4 +-
 hw/arm/vexpress.c                        |   8 +-
 hw/arm/virt.c                            |  44 ++--
 hw/arm/xilinx_zynq.c                     |   6 +-
 hw/arm/xlnx-versal-virt.c                |   8 +-
 hw/arm/xlnx-versal.c                     |  30 ++-
 hw/arm/xlnx-zcu102.c                     |   8 +-
 hw/arm/xlnx-zynqmp.c                     | 117 ++++-------
 hw/block/dataplane/xen-block.c           |  17 +-
 hw/block/fdc.c                           |  12 +-
 hw/block/pflash_cfi01.c                  |   7 +-
 hw/block/pflash_cfi02.c                  |   7 +-
 hw/block/xen-block.c                     | 124 +++++-------
 hw/char/serial-pci-multi.c               |   5 +-
 hw/char/serial-pci.c                     |   5 +-
 hw/char/serial.c                         |  10 +-
 hw/core/bus.c                            |  12 +-
 hw/core/cpu.c                            |   3 +-
 hw/core/machine.c                        |   5 +-
 hw/core/numa.c                           |  55 ++---
 hw/core/platform-bus.c                   |   6 +-
 hw/core/qdev-properties-system.c         |  32 +--
 hw/core/qdev-properties.c                |  95 +++------
 hw/core/qdev.c                           |  16 +-
 hw/cpu/a15mpcore.c                       |   5 +-
 hw/cpu/a9mpcore.c                        |  21 +-
 hw/cpu/arm11mpcore.c                     |  17 +-
 hw/cpu/core.c                            |  10 +-
 hw/cpu/realview_mpcore.c                 |   9 +-
 hw/display/bcm2835_fb.c                  |   8 +-
 hw/display/virtio-gpu-base.c             |   5 +-
 hw/display/virtio-gpu-pci.c              |  11 +-
 hw/display/virtio-vga.c                  |  10 +-
 hw/dma/bcm2835_dma.c                     |   9 +-
 hw/dma/sparc32_dma.c                     |   6 +-
 hw/dma/xilinx_axidma.c                   |   4 +-
 hw/gpio/aspeed_gpio.c                    |   5 +-
 hw/gpio/bcm2835_gpio.c                   |  15 +-
 hw/hyperv/vmbus.c                        |   5 +-
 hw/i386/pc.c                             |  48 ++---
 hw/i386/pc_piix.c                        |   4 +-
 hw/i386/pc_q35.c                         |  28 +--
 hw/i386/x86.c                            |   7 +-
 hw/ide/qdev.c                            |   7 +-
 hw/intc/apic_common.c                    |   5 +-
 hw/intc/arm_gic_kvm.c                    |   4 +-
 hw/intc/arm_gicv3_its_kvm.c              |   5 +-
 hw/intc/arm_gicv3_kvm.c                  |   4 +-
 hw/intc/armv7m_nvic.c                    |   9 +-
 hw/intc/nios2_iic.c                      |  10 +-
 hw/intc/pnv_xive.c                       |  17 +-
 hw/intc/realview_gic.c                   |   5 +-
 hw/intc/spapr_xive.c                     |  17 +-
 hw/intc/xics.c                           |   9 +-
 hw/intc/xics_kvm.c                       |   4 +-
 hw/intc/xive.c                           |  17 +-
 hw/isa/piix4.c                           |   5 +-
 hw/m68k/q800.c                           |   4 +-
 hw/mem/nvdimm.c                          |  30 +--
 hw/mem/pc-dimm.c                         |  18 +-
 hw/microblaze/petalogix_ml605_mmu.c      |  24 +--
 hw/microblaze/petalogix_s3adsp1800_mmu.c |   2 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |  39 ++--
 hw/mips/boston.c                         |   4 +-
 hw/mips/cps.c                            |  41 ++--
 hw/mips/jazz.c                           |   4 +-
 hw/mips/malta.c                          |   4 +-
 hw/misc/aspeed_sdmc.c                    |   8 +-
 hw/misc/bcm2835_mbox.c                   |   9 +-
 hw/misc/bcm2835_property.c               |  17 +-
 hw/misc/iotkit-sysctl.c                  |   2 +-
 hw/misc/ivshmem.c                        |   4 +-
 hw/misc/macio/cuda.c                     |   5 +-
 hw/misc/macio/macio.c                    |  35 ++--
 hw/misc/macio/pmu.c                      |   5 +-
 hw/misc/pca9552.c                        |   5 +-
 hw/misc/tmp105.c                         |   5 +-
 hw/misc/tmp421.c                         |   5 +-
 hw/net/ne2000-isa.c                      |   7 +-
 hw/net/virtio-net.c                      |   7 +-
 hw/net/xilinx_axienet.c                  |   4 +-
 hw/nvram/fw_cfg.c                        |  21 +-
 hw/pci-host/pnv_phb3.c                   |  33 ++-
 hw/pci-host/pnv_phb4.c                   |   9 +-
 hw/pci-host/pnv_phb4_pec.c               |   9 +-
 hw/pci-host/prep.c                       |   4 +-
 hw/pci-host/xen_igd_pt.c                 |   7 +-
 hw/ppc/e500.c                            |   5 +-
 hw/ppc/mac_newworld.c                    |  10 +-
 hw/ppc/mac_oldworld.c                    |   4 +-
 hw/ppc/pnv.c                             | 171 +++++++---------
 hw/ppc/pnv_core.c                        |   4 +-
 hw/ppc/pnv_psi.c                         |  22 +-
 hw/ppc/rs6000_mc.c                       |   9 +-
 hw/ppc/spapr.c                           |  77 +++----
 hw/ppc/spapr_caps.c                      |  15 +-
 hw/ppc/spapr_cpu_core.c                  |  15 +-
 hw/ppc/spapr_drc.c                       |  16 +-
 hw/ppc/spapr_hcall.c                     |   3 +-
 hw/ppc/spapr_irq.c                       |  11 +-
 hw/ppc/spapr_pci.c                       |  16 +-
 hw/ppc/spapr_pci_nvlink2.c               |   3 +-
 hw/riscv/opentitan.c                     |  13 +-
 hw/riscv/sifive_e.c                      |  10 +-
 hw/riscv/sifive_u.c                      |  11 +-
 hw/riscv/spike.c                         |   4 +-
 hw/riscv/virt.c                          |   4 +-
 hw/rx/rx-gdbsim.c                        |  12 +-
 hw/s390x/css.c                           |   5 +-
 hw/s390x/event-facility.c                |  13 +-
 hw/s390x/ipl.c                           |  27 ++-
 hw/s390x/s390-pci-bus.c                  |  14 +-
 hw/s390x/s390-skeys.c                    |   2 +-
 hw/s390x/s390-stattrib.c                 |   2 +-
 hw/s390x/s390-virtio-ccw.c               |  20 +-
 hw/s390x/sclp.c                          |  13 +-
 hw/s390x/virtio-ccw-crypto.c             |  10 +-
 hw/s390x/virtio-ccw-rng.c                |   8 +-
 hw/scsi/scsi-bus.c                       |  15 +-
 hw/scsi/vhost-scsi.c                     |   4 +-
 hw/sd/aspeed_sdhci.c                     |  15 +-
 hw/sd/sd.c                               |   3 +-
 hw/sd/sdhci-pci.c                        |   7 +-
 hw/sd/sdhci.c                            |  21 +-
 hw/sd/ssi-sd.c                           |  15 +-
 hw/smbios/smbios.c                       |  33 +--
 hw/sparc/sun4m.c                         |   2 +-
 hw/sparc64/sun4u.c                       |   2 +-
 hw/usb/bus.c                             |   7 +-
 hw/usb/dev-storage.c                     |   9 +-
 hw/usb/hcd-dwc2.c                        |   9 +-
 hw/vfio/pci-quirks.c                     |   5 +-
 hw/vfio/pci.c                            |  10 +-
 hw/virtio/virtio-balloon.c               |  17 +-
 hw/virtio/virtio-crypto-pci.c            |   9 +-
 hw/virtio/virtio-iommu-pci.c             |   4 +-
 hw/virtio/virtio-mem-pci.c               |   4 +-
 hw/virtio/virtio-pmem-pci.c              |   2 +-
 hw/virtio/virtio-rng-pci.c               |   8 +-
 hw/virtio/virtio-rng.c                   |  11 +-
 hw/xen/xen-backend.c                     |   7 +-
 hw/xen/xen-bus.c                         |  92 ++++-----
 hw/xen/xen-host-pci-device.c             |  27 ++-
 hw/xen/xen_pt.c                          |  25 +--
 hw/xen/xen_pt_config_init.c              |  20 +-
 include/block/nbd.h                      |   1 +
 include/hw/audio/pcspk.h                 |   2 +-
 include/hw/qdev-properties.h             |   4 +-
 include/qapi/clone-visitor.h             |   8 +-
 include/qapi/error.h                     | 261 +++++++++++++++++++++---
 include/qapi/visitor-impl.h              |  26 +--
 include/qapi/visitor.h                   | 102 ++++++----
 include/qemu/option.h                    |  16 +-
 include/qom/object.h                     | 104 +++++-----
 include/qom/object_interfaces.h          |  12 +-
 include/qom/qom-qobject.h                |   9 +-
 iothread.c                               |  18 +-
 linux-user/syscall.c                     |   2 +-
 monitor/hmp-cmds.c                       |  11 +-
 monitor/monitor.c                        |  19 +-
 nbd/client.c                             |   5 +
 nbd/server.c                             |   5 +
 net/colo-compare.c                       |  26 +--
 net/dump.c                               |  13 +-
 net/filter-buffer.c                      |  13 +-
 net/filter.c                             |   2 +-
 net/net.c                                |  10 +-
 net/tap.c                                |   6 +-
 qapi/opts-visitor.c                      |  66 +++---
 qapi/qapi-clone-visitor.c                |  45 +++--
 qapi/qapi-dealloc-visitor.c              |  27 ++-
 qapi/qapi-visit-core.c                   | 197 +++++++++---------
 qapi/qobject-input-visitor.c             | 109 ++++++----
 qapi/qobject-output-visitor.c            |  27 ++-
 qapi/string-input-visitor.c              |  67 +++---
 qapi/string-output-visitor.c             |  32 +--
 qdev-monitor.c                           |  39 ++--
 qemu-img.c                               |  31 +--
 qga/commands-posix.c                     |   4 +-
 qga/commands-win32.c                     |  22 +-
 qom/object.c                             | 244 +++++++++++-----------
 qom/object_interfaces.c                  |  30 +--
 qom/qom-hmp-cmds.c                       |   2 +-
 qom/qom-qmp-cmds.c                       |   2 +-
 qom/qom-qobject.c                        |  14 +-
 scripts/coccinelle/errp-guard.cocci      | 336 +++++++++++++++++++++++++++++++
 scripts/qapi/commands.py                 |  22 +-
 scripts/qapi/visit.py                    | 107 ++++------
 softmmu/vl.c                             |  17 +-
 target/arm/cpu64.c                       |  15 +-
 target/arm/monitor.c                     |   7 +-
 target/i386/cpu.c                        |  98 ++++-----
 target/ppc/compat.c                      |   5 +-
 target/ppc/translate_init.inc.c          |   2 +-
 target/s390x/cpu_models.c                |  17 +-
 target/sparc/cpu.c                       |   5 +-
 tpm.c                                    |   5 +-
 ui/console.c                             |   4 +-
 ui/vnc.c                                 |   2 +-
 util/main-loop.c                         |   4 +-
 util/qemu-config.c                       |  25 +--
 util/qemu-option.c                       | 255 ++++++++++++-----------
 294 files changed, 3052 insertions(+), 3774 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f01284ebce..6aa54f7f8f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2176,6 +2176,7 @@ F: scripts/coccinelle/error-use-after-free.cocci
 F: scripts/coccinelle/error_propagate_null.cocci
 F: scripts/coccinelle/remove_local_err.cocci
 F: scripts/coccinelle/use-error_fatal.cocci
+F: scripts/coccinelle/errp-guard.cocci
 
 GDB stub
 M: Alex Bennée <alex.bennee@linaro.org>
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index ab36fbfa0c..63ef6af9a1 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -3113,12 +3113,9 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v,
                                    Error **errp)
 {
     KVMState *s = KVM_STATE(obj);
-    Error *error = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!visit_type_int(v, name, &value, errp)) {
         return;
     }
 
@@ -3129,37 +3126,33 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
                                    const char *name, void *opaque,
                                    Error **errp)
 {
-    Error *err = NULL;
     KVMState *s = KVM_STATE(obj);
     OnOffSplit mode;
 
-    visit_type_OnOffSplit(v, name, &mode, &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
         return;
-    } else {
-        switch (mode) {
-        case ON_OFF_SPLIT_ON:
-            s->kernel_irqchip_allowed = true;
-            s->kernel_irqchip_required = true;
-            s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
-            break;
-        case ON_OFF_SPLIT_OFF:
-            s->kernel_irqchip_allowed = false;
-            s->kernel_irqchip_required = false;
-            s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
-            break;
-        case ON_OFF_SPLIT_SPLIT:
-            s->kernel_irqchip_allowed = true;
-            s->kernel_irqchip_required = true;
-            s->kernel_irqchip_split = ON_OFF_AUTO_ON;
-            break;
-        default:
-            /* The value was checked in visit_type_OnOffSplit() above. If
-             * we get here, then something is wrong in QEMU.
-             */
-            abort();
-        }
+    }
+    switch (mode) {
+    case ON_OFF_SPLIT_ON:
+        s->kernel_irqchip_allowed = true;
+        s->kernel_irqchip_required = true;
+        s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
+        break;
+    case ON_OFF_SPLIT_OFF:
+        s->kernel_irqchip_allowed = false;
+        s->kernel_irqchip_required = false;
+        s->kernel_irqchip_split = ON_OFF_AUTO_OFF;
+        break;
+    case ON_OFF_SPLIT_SPLIT:
+        s->kernel_irqchip_allowed = true;
+        s->kernel_irqchip_required = true;
+        s->kernel_irqchip_split = ON_OFF_AUTO_ON;
+        break;
+    default:
+        /* The value was checked in visit_type_OnOffSplit() above. If
+         * we get here, then something is wrong in QEMU.
+         */
+        abort();
     }
 }
 
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 3b4fda5640..eace2c113b 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -182,12 +182,9 @@ static void tcg_set_tb_size(Object *obj, Visitor *v,
                             Error **errp)
 {
     TCGState *s = TCG_STATE(obj);
-    Error *error = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!visit_type_uint32(v, name, &value, errp)) {
         return;
     }
 
diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c
index ebd7d9fa0d..ffdbd0bcce 100644
--- a/audio/audio_legacy.c
+++ b/audio/audio_legacy.c
@@ -421,11 +421,12 @@ typedef struct {
     GList *path;
 } LegacyPrintVisitor;
 
-static void lv_start_struct(Visitor *v, const char *name, void **obj,
+static bool lv_start_struct(Visitor *v, const char *name, void **obj,
                             size_t size, Error **errp)
 {
     LegacyPrintVisitor *lv = (LegacyPrintVisitor *) v;
     lv->path = g_list_append(lv->path, g_strdup(name));
+    return true;
 }
 
 static void lv_end_struct(Visitor *v, void **obj)
@@ -453,27 +454,30 @@ static void lv_print_key(Visitor *v, const char *name)
     printf("%s=", name);
 }
 
-static void lv_type_int64(Visitor *v, const char *name, int64_t *obj,
+static bool lv_type_int64(Visitor *v, const char *name, int64_t *obj,
                           Error **errp)
 {
     lv_print_key(v, name);
     printf("%" PRIi64, *obj);
+    return true;
 }
 
-static void lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
+static bool lv_type_uint64(Visitor *v, const char *name, uint64_t *obj,
                            Error **errp)
 {
     lv_print_key(v, name);
     printf("%" PRIu64, *obj);
+    return true;
 }
 
-static void lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
+static bool lv_type_bool(Visitor *v, const char *name, bool *obj, Error **errp)
 {
     lv_print_key(v, name);
     printf("%s", *obj ? "on" : "off");
+    return true;
 }
 
-static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
+static bool lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
 {
     const char *str = *obj;
     lv_print_key(v, name);
@@ -484,6 +488,7 @@ static void lv_type_str(Visitor *v, const char *name, char **obj, Error **errp)
         }
         putchar(*str++);
     }
+    return true;
 }
 
 static void lv_complete(Visitor *v, void *opaque)
diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c
index 8b8cbc4223..dbe5a8aae6 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -209,8 +209,7 @@ static void cryptodev_vhost_user_init(
         backend->conf.peers.ccs[i] = cc;
 
         if (i == 0) {
-            if (!qemu_chr_fe_init(&s->chr, chr, &local_err)) {
-                error_propagate(errp, local_err);
+            if (!qemu_chr_fe_init(&s->chr, chr, errp)) {
                 return;
             }
         }
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index a3841c4e41..ada4ebe78b 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -154,21 +154,17 @@ cryptodev_backend_set_queues(Object *obj, Visitor *v, const char *name,
                              void *opaque, Error **errp)
 {
     CryptoDevBackend *backend = CRYPTODEV_BACKEND(obj);
-    Error *local_err = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_uint32(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
-                   PRIu32 "'", object_get_typename(obj), name, value);
-        goto out;
+        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu32 "'",
+                   object_get_typename(obj), name, value);
+        return;
     }
     backend->conf.peers.queues = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
@@ -215,7 +211,7 @@ static void cryptodev_backend_instance_init(Object *obj)
                           cryptodev_backend_set_queues,
                           NULL, NULL);
     /* Initialize devices' queues property to 1 */
-    object_property_set_int(obj, 1, "queues", NULL);
+    object_property_set_int(obj, "queues", 1, NULL);
 }
 
 static void cryptodev_backend_finalize(Object *obj)
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index cdabb412e6..5b819020b4 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -110,23 +110,18 @@ static void file_memory_backend_set_align(Object *o, Visitor *v,
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(o);
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
-    Error *local_err = NULL;
     uint64_t val;
 
     if (host_memory_backend_mr_inited(backend)) {
-        error_setg(&local_err, "cannot change property '%s' of %s",
-                   name, object_get_typename(o));
-        goto out;
+        error_setg(errp, "cannot change property '%s' of %s", name,
+                   object_get_typename(o));
+        return;
     }
 
-    visit_type_size(v, name, &val, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &val, errp)) {
+        return;
     }
     fb->align = val;
-
- out:
-    error_propagate(errp, local_err);
 }
 
 static bool file_memory_backend_get_pmem(Object *o, Error **errp)
@@ -140,7 +135,6 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
     HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
 
     if (host_memory_backend_mr_inited(backend)) {
-
         error_setg(errp, "cannot change property 'pmem' of %s.",
                    object_get_typename(o));
         return;
@@ -148,13 +142,9 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp)
 
 #ifndef CONFIG_LIBPMEM
     if (value) {
-        Error *local_err = NULL;
-
-        error_setg(&local_err,
-                   "Lack of libpmem support while setting the 'pmem=on'"
+        error_setg(errp, "Lack of libpmem support while setting the 'pmem=on'"
                    " of %s. We can't ensure data persistence.",
                    object_get_typename(o));
-        error_propagate(errp, local_err);
         return;
     }
 #endif
diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index 1b5e4bfe0d..4c040a7541 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -77,26 +77,22 @@ memfd_backend_set_hugetlbsize(Object *obj, Visitor *v, const char *name,
                               void *opaque, Error **errp)
 {
     HostMemoryBackendMemfd *m = MEMORY_BACKEND_MEMFD(obj);
-    Error *local_err = NULL;
     uint64_t value;
 
     if (host_memory_backend_mr_inited(MEMORY_BACKEND(obj))) {
-        error_setg(&local_err, "cannot change property value");
-        goto out;
+        error_setg(errp, "cannot change property value");
+        return;
     }
 
-    visit_type_size(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err, "Property '%s.%s' doesn't take value '%"
-                   PRIu64 "'", object_get_typename(obj), name, value);
-        goto out;
+        error_setg(errp, "Property '%s.%s' doesn't take value '%" PRIu64 "'",
+                   object_get_typename(obj), name, value);
+        return;
     }
     m->hugetlbsize = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 61e3255f5c..c614f1bdc1 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -54,28 +54,24 @@ host_memory_backend_set_size(Object *obj, Visitor *v, const char *name,
                              void *opaque, Error **errp)
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-    Error *local_err = NULL;
     uint64_t value;
 
     if (host_memory_backend_mr_inited(backend)) {
-        error_setg(&local_err, "cannot change property %s of %s ",
-                   name, object_get_typename(obj));
-        goto out;
+        error_setg(errp, "cannot change property %s of %s ", name,
+                   object_get_typename(obj));
+        return;
     }
 
-    visit_type_size(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_size(v, name, &value, errp)) {
+        return;
     }
     if (!value) {
-        error_setg(&local_err,
+        error_setg(errp,
                    "property '%s' of %s doesn't take value '%" PRIu64 "'",
                    name, object_get_typename(obj), value);
-        goto out;
+        return;
     }
     backend->size = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void
@@ -254,22 +250,17 @@ static void host_memory_backend_set_prealloc_threads(Object *obj, Visitor *v,
     const char *name, void *opaque, Error **errp)
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-    Error *local_err = NULL;
     uint32_t value;
 
-    visit_type_uint32(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_uint32(v, name, &value, errp)) {
+        return;
     }
     if (value <= 0) {
-        error_setg(&local_err,
-                   "property '%s' of %s doesn't take value '%d'",
-                   name, object_get_typename(obj), value);
-        goto out;
+        error_setg(errp, "property '%s' of %s doesn't take value '%d'", name,
+                   object_get_typename(obj), value);
+        return;
     }
     backend->prealloc_threads = value;
-out:
-    error_propagate(errp, local_err);
 }
 
 static void host_memory_backend_init(Object *obj)
diff --git a/backends/rng.c b/backends/rng.c
index 597f0ec268..484f04e891 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -48,7 +48,7 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
 
 static void rng_backend_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "opened", errp);
+    object_property_set_bool(OBJECT(uc), "opened", true, errp);
 }
 
 static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
index cfc7572a61..b58d298c1a 100644
--- a/backends/tpm/tpm_util.c
+++ b/backends/tpm/tpm_util.c
@@ -48,7 +48,6 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
                     Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     Property *prop = opaque;
     TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
     char *str;
@@ -58,9 +57,7 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_str(v, name, &str, errp)) {
         return;
     }
 
diff --git a/block.c b/block.c
index 62e40db2f1..3031413deb 100644
--- a/block.c
+++ b/block.c
@@ -1629,9 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
     assert(options != NULL && bs->options != options);
 
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail_opts;
     }
@@ -4091,9 +4089,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
 
     /* Process generic block layer options */
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
         ret = -EINVAL;
         goto error;
     }
@@ -5665,10 +5661,9 @@ static void coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs,
     if (bs->open_flags & BDRV_O_INACTIVE) {
         bs->open_flags &= ~BDRV_O_INACTIVE;
         bdrv_get_cumulative_perm(bs, &perm, &shared_perm);
-        ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, &local_err);
+        ret = bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, errp);
         if (ret < 0) {
             bs->open_flags |= BDRV_O_INACTIVE;
-            error_propagate(errp, local_err);
             return;
         }
         bdrv_set_perm(bs, perm, shared_perm);
@@ -6063,8 +6058,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
 
     /* Parse -o options */
     if (options) {
-        qemu_opts_do_parse(opts, options, NULL, &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, options, NULL, errp)) {
             goto out;
         }
     }
@@ -6077,8 +6071,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_filename) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
+                          NULL)) {
             error_setg(errp, "Backing file not supported for file format '%s'",
                        fmt);
             goto out;
@@ -6086,8 +6080,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_fmt) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, NULL)) {
             error_setg(errp, "Backing file format not supported for file "
                              "format '%s'", fmt);
             goto out;
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 7194bc7f06..9c08d8a005 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -359,7 +359,6 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
     QObject *crumpled_subqdict = NULL;
     Visitor *v = NULL;
     BlockPermissionList *perm_list = NULL, *element;
-    Error *local_err = NULL;
 
     *dest = 0;
 
@@ -375,9 +374,7 @@ static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options,
     }
 
     v = qobject_input_visitor_new(crumpled_subqdict);
-    visit_type_BlockPermissionList(v, NULL, &perm_list, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_BlockPermissionList(v, NULL, &perm_list, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -472,9 +469,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t align;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index 6753bd9a3e..57315f56b4 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -149,10 +149,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
     bool log_append;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
diff --git a/block/blkverify.c b/block/blkverify.c
index 2f261de24b..4aed53ab59 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -116,9 +116,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
     int ret;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/crypto.c b/block/crypto.c
index 2636e959ae..8725c1bc02 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -260,7 +260,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
 {
     BlockCrypto *crypto = bs->opaque;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     int ret = -EINVAL;
     QCryptoBlockOpenOptions *open_opts = NULL;
     unsigned int cflags = 0;
@@ -276,9 +275,7 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
         bs->file->bs->supported_write_flags;
 
     opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto cleanup;
     }
 
diff --git a/block/curl.c b/block/curl.c
index 6e325901dc..4f907c47be 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -669,7 +669,6 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
     BDRVCURLState *s = bs->opaque;
     CURLState *state = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *file;
     const char *cookie;
     const char *cookie_secret;
@@ -695,9 +694,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
 
     qemu_mutex_init(&s->mutex);
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto out_noclean;
     }
 
diff --git a/block/file-posix.c b/block/file-posix.c
index d86ea57769..1989eae85f 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -490,9 +490,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     OnOffAuto locking;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1000,9 +998,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
     /* Handle options changes */
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, state->options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, state->options, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -3333,7 +3329,6 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
 #if defined(__APPLE__) && defined(__MACH__)
@@ -3398,9 +3393,8 @@ hdev_open_Mac_error:
 
     s->type = FTYPE_FILE;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
 #if defined(__APPLE__) && defined(__MACH__)
         if (*bsd_path) {
             filename = bsd_path;
@@ -3676,14 +3670,12 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
                       Error **errp)
 {
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
     s->type = FTYPE_CD;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret) {
-        error_propagate(errp, local_err);
         return ret;
     }
 
diff --git a/block/file-win32.c b/block/file-win32.c
index 221aaf713e..ab69bd811a 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -338,9 +338,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
     s->type = FTYPE_FILE;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -739,9 +737,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
 
     QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0,
                                       &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto done;
     }
diff --git a/block/gluster.c b/block/gluster.c
index 31233cac69..4f1448e2bc 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -523,8 +523,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
     /* create opts info from runtime_json_opts list */
     opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto out;
     }
 
@@ -555,8 +554,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
         /* create opts info from runtime_type_opts list */
         opts = qemu_opts_create(&runtime_type_opts, NULL, 0, &error_abort);
-        qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-        if (local_err) {
+        if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
             goto out;
         }
 
@@ -586,8 +584,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         if (gsconf->type == SOCKET_ADDRESS_TYPE_INET) {
             /* create opts info from runtime_inet_opts list */
             opts = qemu_opts_create(&runtime_inet_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
                 goto out;
             }
 
@@ -635,8 +632,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         } else {
             /* create opts info from runtime_unix_opts list */
             opts = qemu_opts_create(&runtime_unix_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, errp)) {
                 goto out;
             }
 
@@ -815,13 +811,10 @@ static int qemu_gluster_open(BlockDriverState *bs,  QDict *options,
     int ret = 0;
     BlockdevOptionsGluster *gconf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *filename, *logfile;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/iscsi.c b/block/iscsi.c
index 767e3e75fd..6c2e353e1a 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1792,9 +1792,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     int i, ret = 0, timeout = 0, lun;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
diff --git a/block/nbd.c b/block/nbd.c
index eed160c5cd..c297336ffc 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1408,16 +1408,15 @@ static void nbd_client_close(BlockDriverState *bs)
 static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
                                                   Error **errp)
 {
+    ERRP_GUARD();
     QIOChannelSocket *sioc;
-    Error *local_err = NULL;
 
     sioc = qio_channel_socket_new();
     qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");
 
-    qio_channel_socket_connect_sync(sioc, saddr, &local_err);
-    if (local_err) {
+    qio_channel_socket_connect_sync(sioc, saddr, errp);
+    if (*errp) {
         object_unref(OBJECT(sioc));
-        error_propagate(errp, local_err);
         return NULL;
     }
 
@@ -1726,7 +1725,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
     SocketAddress *saddr = NULL;
     QDict *addr = NULL;
     Visitor *iv = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &addr, "server.");
     if (!qdict_size(addr)) {
@@ -1739,9 +1737,7 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,
         goto done;
     }
 
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
         goto done;
     }
 
@@ -1836,13 +1832,10 @@ static int nbd_process_options(BlockDriverState *bs, QDict *options,
 {
     BDRVNBDState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret = -EINVAL;
 
     opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto error;
     }
 
diff --git a/block/nfs.c b/block/nfs.c
index b1718d125a..61a249a9fc 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -563,18 +563,15 @@ static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
     BlockdevOptionsNfs *opts = NULL;
     Visitor *v;
     const QDictEntry *e;
-    Error *local_err = NULL;
 
     v = qobject_input_visitor_new_flat_confused(options, errp);
     if (!v) {
         return NULL;
     }
 
-    visit_type_BlockdevOptionsNfs(v, NULL, &opts, &local_err);
+    visit_type_BlockdevOptionsNfs(v, NULL, &opts, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!opts) {
         return NULL;
     }
 
diff --git a/block/parallels.c b/block/parallels.c
index 63a1cde8af..3c22dfdc9d 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -625,7 +625,6 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
                                                  Error **errp)
 {
     BlockdevCreateOptions *create_options = NULL;
-    Error *local_err = NULL;
     BlockDriverState *bs = NULL;
     QDict *qdict;
     Visitor *v;
@@ -646,9 +645,8 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto done;
     }
 
@@ -669,11 +667,9 @@ static int coroutine_fn parallels_co_create_opts(BlockDriver *drv,
         goto done;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto done;
     }
@@ -824,13 +820,12 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
         }
     }
 
-    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, &local_err);
-    if (local_err != NULL) {
+    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, errp);
+    if (!opts) {
         goto fail_options;
     }
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail_options;
     }
 
@@ -844,6 +839,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
                                        &local_err);
     g_free(buf);
     if (local_err != NULL) {
+        error_propagate(errp, local_err);
         goto fail_options;
     }
 
@@ -863,9 +859,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The Parallels format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -874,15 +869,11 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
 
 fail_format:
     error_setg(errp, "Image not in Parallels format");
+fail_options:
     ret = -EINVAL;
 fail:
     qemu_vfree(s->header);
     return ret;
-
-fail_options:
-    error_propagate(errp, local_err);
-    ret = -EINVAL;
-    goto fail;
 }
 
 
diff --git a/block/qcow.c b/block/qcow.c
index ee5d35fe20..1e134f3445 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -121,7 +121,6 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     unsigned int len, i, shift;
     int ret;
     QCowHeader header;
-    Error *local_err = NULL;
     QCryptoBlockOpenOptions *crypto_opts = NULL;
     unsigned int cflags = 0;
     QDict *encryptopts = NULL;
@@ -314,9 +313,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The qcow format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -943,7 +941,6 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     const char *val;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -973,9 +970,8 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -996,11 +992,9 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/qcow2.c b/block/qcow2.c
index 38198b4e75..ea33673c55 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -990,9 +990,7 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
     encryptfmt = qdict_get_try_str(encryptopts, "format");
 
     opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1596,8 +1594,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
 
     /* read qcow2 extensions */
     if (qcow2_read_extensions(bs, header.header_length, ext_end, NULL,
-                              flags, &update_header, &local_err)) {
-        error_propagate(errp, local_err);
+                              flags, &update_header, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -3358,7 +3355,6 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     int version;
     int refcount_order;
     uint64_t* refcount_table;
-    Error *local_err = NULL;
     int ret;
     uint8_t compression_type = QCOW2_COMPRESSION_TYPE_ZLIB;
 
@@ -3584,9 +3580,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     }
     blk = blk_new_open(NULL, NULL, options,
                        BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_NO_FLUSH,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto out;
     }
@@ -3666,9 +3661,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
     }
     blk = blk_new_open(NULL, NULL, options,
                        BDRV_O_RDWR | BDRV_O_NO_BACKING | BDRV_O_NO_IO,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto out;
     }
@@ -3691,7 +3685,6 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
     Visitor *v;
     BlockDriverState *bs = NULL;
     BlockDriverState *data_bs = NULL;
-    Error *local_err = NULL;
     const char *val;
     int ret;
 
@@ -3787,11 +3780,9 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
         goto finish;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto finish;
     }
diff --git a/block/qed.c b/block/qed.c
index ece8b9bb60..b27e7546ca 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -729,7 +729,6 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -749,9 +748,8 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -772,11 +770,9 @@ static int coroutine_fn bdrv_qed_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/quorum.c b/block/quorum.c
index 7cf7ab1546..6df9449fc2 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -910,27 +910,25 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     /* count how many different children are present */
     s->num_children = qdict_array_entries(options, "children.");
     if (s->num_children < 0) {
-        error_setg(&local_err, "Option children is not a valid array");
+        error_setg(errp, "Option children is not a valid array");
         ret = -EINVAL;
         goto exit;
     }
     if (s->num_children < 1) {
-        error_setg(&local_err,
-                   "Number of provided children must be 1 or more");
+        error_setg(errp, "Number of provided children must be 1 or more");
         ret = -EINVAL;
         goto exit;
     }
 
     opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto exit;
     }
 
     s->threshold = qemu_opt_get_number(opts, QUORUM_OPT_VOTE_THRESHOLD, 0);
     /* and validate it against s->num_children */
-    ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
+    ret = quorum_valid_threshold(s->threshold, s->num_children, errp);
     if (ret < 0) {
         goto exit;
     }
@@ -943,7 +941,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                               -EINVAL, NULL);
     }
     if (ret < 0) {
-        error_setg(&local_err, "Please set read-pattern as fifo or quorum");
+        error_setg(errp, "Please set read-pattern as fifo or quorum");
         goto exit;
     }
     s->read_pattern = ret;
@@ -951,7 +949,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
         s->is_blkverify = qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false);
         if (s->is_blkverify && (s->num_children != 2 || s->threshold != 2)) {
-            error_setg(&local_err, "blkverify=on can only be set if there are "
+            error_setg(errp, "blkverify=on can only be set if there are "
                        "exactly two files and vote-threshold is 2");
             ret = -EINVAL;
             goto exit;
@@ -960,7 +958,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
         s->rewrite_corrupted = qemu_opt_get_bool(opts, QUORUM_OPT_REWRITE,
                                                  false);
         if (s->rewrite_corrupted && s->is_blkverify) {
-            error_setg(&local_err,
+            error_setg(errp,
                        "rewrite-corrupted=on cannot be used with blkverify=on");
             ret = -EINVAL;
             goto exit;
@@ -980,6 +978,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                                          &child_of_bds, BDRV_CHILD_DATA, false,
                                          &local_err);
         if (local_err) {
+            error_propagate(errp, local_err);
             ret = -EINVAL;
             goto close_exit;
         }
@@ -1005,8 +1004,6 @@ close_exit:
     g_free(opened);
 exit:
     qemu_opts_del(opts);
-    /* propagate error */
-    error_propagate(errp, local_err);
     return ret;
 }
 
diff --git a/block/raw-format.c b/block/raw-format.c
index 233d019ca3..42ec50802b 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -74,14 +74,11 @@ static QemuOptsList raw_create_opts = {
 static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size,
                             uint64_t *size, Error **errp)
 {
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     int ret;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto end;
     }
diff --git a/block/rbd.c b/block/rbd.c
index 617553b022..688074c64b 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -681,7 +681,6 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
                                     Error **errp)
 {
     Visitor *v;
-    Error *local_err = NULL;
 
     /* Convert the remaining options into a QAPI object */
     v = qobject_input_visitor_new_flat_confused(options, errp);
@@ -689,11 +688,9 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
         return -EINVAL;
     }
 
-    visit_type_BlockdevOptionsRbd(v, NULL, opts, &local_err);
+    visit_type_BlockdevOptionsRbd(v, NULL, opts, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!opts) {
         return -EINVAL;
     }
 
diff --git a/block/replication.c b/block/replication.c
index ccf7b78160..0c70215784 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -85,7 +85,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 {
     int ret;
     BDRVReplicationState *s = bs->opaque;
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     const char *mode;
     const char *top_id;
@@ -99,14 +98,13 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
     ret = -EINVAL;
     opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail;
     }
 
     mode = qemu_opt_get(opts, REPLICATION_MODE);
     if (!mode) {
-        error_setg(&local_err, "Missing the option mode");
+        error_setg(errp, "Missing the option mode");
         goto fail;
     }
 
@@ -114,7 +112,8 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         s->mode = REPLICATION_MODE_PRIMARY;
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         if (top_id) {
-            error_setg(&local_err, "The primary side does not support option top-id");
+            error_setg(errp,
+                       "The primary side does not support option top-id");
             goto fail;
         }
     } else if (!strcmp(mode, "secondary")) {
@@ -122,11 +121,11 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         s->top_id = g_strdup(top_id);
         if (!s->top_id) {
-            error_setg(&local_err, "Missing the option top-id");
+            error_setg(errp, "Missing the option top-id");
             goto fail;
         }
     } else {
-        error_setg(&local_err,
+        error_setg(errp,
                    "The option mode's value should be primary or secondary");
         goto fail;
     }
@@ -137,8 +136,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
 fail:
     qemu_opts_del(opts);
-    error_propagate(errp, local_err);
-
     return ret;
 }
 
@@ -369,7 +366,6 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
 {
     BDRVReplicationState *s = bs->opaque;
     BlockReopenQueue *reopen_queue = NULL;
-    Error *local_err = NULL;
 
     if (writable) {
         s->orig_hidden_read_only = bdrv_is_read_only(s->hidden_disk->bs);
@@ -394,8 +390,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
     }
 
     if (reopen_queue) {
-        bdrv_reopen_multiple(reopen_queue, &local_err);
-        error_propagate(errp, local_err);
+        bdrv_reopen_multiple(reopen_queue, errp);
     }
 
     bdrv_subtree_drained_end(s->hidden_disk->bs);
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 27a30d17f4..6c487c8322 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -532,7 +532,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
     QDict *server = NULL;
     Visitor *iv = NULL;
     SocketAddress *saddr = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &server, "server.");
 
@@ -541,9 +540,7 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
         goto done;
     }
 
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!visit_type_SocketAddress(iv, NULL, &saddr, errp)) {
         goto done;
     }
 
@@ -1550,15 +1547,12 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t snap_id;
     char *buf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
 
     s->bs = bs;
     s->aio_context = bdrv_get_aio_context(bs);
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto err_no_fd;
     }
@@ -2199,11 +2193,9 @@ static int coroutine_fn sd_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/ssh.c b/block/ssh.c
index 098dbe03c1..ebe3d8b631 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -616,15 +616,12 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
 {
     BlockdevOptionsSsh *result = NULL;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     const QDictEntry *e;
     Visitor *v;
 
     /* Translate legacy options */
     opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         goto fail;
     }
 
@@ -638,11 +635,9 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
         goto fail;
     }
 
-    visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
+    visit_type_BlockdevOptionsSsh(v, NULL, &result, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!result) {
         goto fail;
     }
 
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 784fa4a16c..03a53c89ea 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -811,7 +811,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
     ThrottleGroup *tg = THROTTLE_GROUP(obj);
     ThrottleConfig *cfg;
     ThrottleParamInfo *info = opaque;
-    Error *local_err = NULL;
     int64_t value;
 
     /* If we have finished initialization, don't accept individual property
@@ -819,17 +818,16 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
      * transaction, as certain combinations are invalid.
      */
     if (tg->is_initialized) {
-        error_setg(&local_err, "Property cannot be set after initialization");
-        goto ret;
+        error_setg(errp, "Property cannot be set after initialization");
+        return;
     }
 
-    visit_type_int64(v, name, &value, &local_err);
-    if (local_err) {
-        goto ret;
+    if (!visit_type_int64(v, name, &value, errp)) {
+        return;
     }
     if (value < 0) {
-        error_setg(&local_err, "Property values cannot be negative");
-        goto ret;
+        error_setg(errp, "Property values cannot be negative");
+        return;
     }
 
     cfg = &tg->ts.cfg;
@@ -842,9 +840,9 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
         break;
     case BURST_LENGTH:
         if (value > UINT_MAX) {
-            error_setg(&local_err, "%s value must be in the"
-                       "range [0, %u]", info->name, UINT_MAX);
-            goto ret;
+            error_setg(errp, "%s value must be in the" "range [0, %u]",
+                       info->name, UINT_MAX);
+            return;
         }
         cfg->buckets[info->type].burst_length = value;
         break;
@@ -852,11 +850,6 @@ static void throttle_group_set(Object *obj, Visitor *v, const char * name,
         cfg->op_size = value;
         break;
     }
-
-ret:
-    error_propagate(errp, local_err);
-    return;
-
 }
 
 static void throttle_group_get(Object *obj, Visitor *v, const char *name,
@@ -896,9 +889,8 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
     ThrottleLimits *argp;
     Error *local_err = NULL;
 
-    visit_type_ThrottleLimits(v, name, &argp, &local_err);
-    if (local_err) {
-        goto ret;
+    if (!visit_type_ThrottleLimits(v, name, &argp, errp)) {
+        return;
     }
     qemu_mutex_lock(&tg->lock);
     throttle_get_config(&tg->ts, &cfg);
@@ -910,7 +902,6 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
 
 unlock:
     qemu_mutex_unlock(&tg->lock);
-ret:
     qapi_free_ThrottleLimits(argp);
     error_propagate(errp, local_err);
     return;
diff --git a/block/throttle.c b/block/throttle.c
index 0ebbad0743..1c1ac57bee 100644
--- a/block/throttle.c
+++ b/block/throttle.c
@@ -46,12 +46,9 @@ static int throttle_parse_options(QDict *options, char **group, Error **errp)
 {
     int ret;
     const char *group_name;
-    Error *local_err = NULL;
     QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fin;
     }
diff --git a/block/vdi.c b/block/vdi.c
index c4527a9d8c..5627e7d764 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -374,7 +374,6 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
     VdiHeader header;
     size_t bmap_size;
     int ret;
-    Error *local_err = NULL;
     QemuUUID uuid_link, uuid_parent;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
@@ -495,9 +494,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vdi format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail_free_bmap;
     }
@@ -906,7 +904,6 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
     uint64_t block_size = DEFAULT_CLUSTER_SIZE;
     bool is_static = false;
     Visitor *v;
-    Error *local_err = NULL;
     int ret;
 
     /* Parse options and convert legacy syntax.
@@ -957,11 +954,9 @@ static int coroutine_fn vdi_co_create_opts(BlockDriver *drv,
         ret = -EINVAL;
         goto done;
     }
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto done;
     }
diff --git a/block/vhdx.c b/block/vhdx.c
index 645dc4b4f4..791eb90263 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1089,9 +1089,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -2064,7 +2063,6 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -2083,9 +2081,8 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -2106,11 +2103,9 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/vmdk.c b/block/vmdk.c
index 62da465126..28cec50f38 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1263,7 +1263,6 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
     int ret;
     BDRVVmdkState *s = bs->opaque;
     uint32_t magic;
-    Error *local_err = NULL;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
                                BDRV_CHILD_IMAGE, false, errp);
@@ -1317,9 +1316,8 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -2250,19 +2248,16 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
 {
     int ret;
     BlockBackend *blk = NULL;
-    Error *local_err = NULL;
 
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto exit;
     }
 
     blk = blk_new_open(filename, NULL, NULL,
                        BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto exit;
     }
diff --git a/block/vpc.c b/block/vpc.c
index 01fcd37e3c..890554277e 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -235,9 +235,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     opts = qemu_opts_create(&vpc_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -448,9 +446,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vpc format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (ret < 0) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -1097,7 +1094,6 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -1114,9 +1110,8 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -1137,11 +1132,9 @@ static int coroutine_fn vpc_co_create_opts(BlockDriver *drv,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
-
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!create_options) {
         ret = -EINVAL;
         goto fail;
     }
diff --git a/block/vvfat.c b/block/vvfat.c
index 2eb8cbb19f..36b53c8757 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1141,7 +1141,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
     bool floppy;
     const char *dirname, *label;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
 
 #ifdef DEBUG
@@ -1149,9 +1148,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
 #endif
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1269,9 +1266,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
                    "The vvfat (rw) format used by node '%s' "
                    "does not support live migration",
                    bdrv_get_device_or_node_name(bs));
-        ret = migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        ret = migrate_add_blocker(s->migration_blocker, errp);
+        if (ret < 0) {
             error_free(s->migration_blocker);
             goto fail;
         }
diff --git a/block/vxhs.c b/block/vxhs.c
index d79fc97df6..dc0e254730 100644
--- a/block/vxhs.c
+++ b/block/vxhs.c
@@ -318,8 +318,7 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
     tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
         ret = -EINVAL;
         goto out;
     }
@@ -327,14 +326,14 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     /* vdisk-id is the disk UUID */
     vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID);
     if (!vdisk_id_opt) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
+        error_setg(errp, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
         ret = -EINVAL;
         goto out;
     }
 
     /* vdisk-id may contain a leading '/' */
     if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) {
-        error_setg(&local_err, "vdisk-id cannot be more than %d characters",
+        error_setg(errp, "vdisk-id cannot be more than %d characters",
                    UUID_FMT_LEN);
         ret = -EINVAL;
         goto out;
@@ -346,22 +345,21 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     /* get the 'server.' arguments */
     qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
 
-    qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) {
         ret = -EINVAL;
         goto out;
     }
 
     server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST);
     if (!server_host_opt) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER,
+        error_setg(errp, QERR_MISSING_PARAMETER,
                    VXHS_OPT_SERVER"."VXHS_OPT_HOST);
         ret = -EINVAL;
         goto out;
     }
 
     if (strlen(server_host_opt) > MAXHOSTNAMELEN) {
-        error_setg(&local_err, "server.host cannot be more than %d characters",
+        error_setg(errp, "server.host cannot be more than %d characters",
                    MAXHOSTNAMELEN);
         ret = -EINVAL;
         goto out;
@@ -414,7 +412,6 @@ out:
 
     if (ret < 0) {
         vxhs_unref();
-        error_propagate(errp, local_err);
         g_free(s->vdisk_hostinfo.host);
         g_free(s->vdisk_guid);
         g_free(s->tlscredsid);
diff --git a/blockdev.c b/blockdev.c
index 31d5eaf6bf..59b0b8ffaf 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -504,15 +504,12 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
     /* Check common options by copying from bs_opts to opts, all other options
      * stay in bs_opts for processing by bdrv_open(). */
     id = qdict_get_try_str(bs_opts, "id");
-    opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, &error);
-    if (error) {
-        error_propagate(errp, error);
+    opts = qemu_opts_create(&qemu_common_drive_opts, id, 1, errp);
+    if (!opts) {
         goto err_no_opts;
     }
 
-    qemu_opts_absorb_qdict(opts, bs_opts, &error);
-    if (error) {
-        error_propagate(errp, error);
+    if (!qemu_opts_absorb_qdict(opts, bs_opts, errp)) {
         goto early_err;
     }
 
@@ -706,7 +703,7 @@ BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
               : QTAILQ_FIRST(&monitor_bdrv_states);
 }
 
-static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
+static bool qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
                             Error **errp)
 {
     const char *value;
@@ -716,7 +713,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
         if (qemu_opt_find(opts, to)) {
             error_setg(errp, "'%s' and its alias '%s' can't be used at the "
                        "same time", to, from);
-            return;
+            return false;
         }
     }
 
@@ -725,6 +722,7 @@ static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
         qemu_opt_set(opts, to, value, &error_abort);
         qemu_opt_unset(opts, from);
     }
+    return true;
 }
 
 QemuOptsList qemu_legacy_drive_opts = {
@@ -795,7 +793,6 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     bool read_only = false;
     bool copy_on_read;
     const char *filename;
-    Error *local_err = NULL;
     int i;
 
     /* Change legacy command line options into QMP ones */
@@ -827,10 +824,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     };
 
     for (i = 0; i < ARRAY_SIZE(opt_renames); i++) {
-        qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
-                        &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (!qemu_opt_rename(all_opts, opt_renames[i].from,
+                             opt_renames[i].to, errp)) {
             return NULL;
         }
     }
@@ -867,9 +862,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
 
     legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 0,
                                    &error_abort);
-    qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!qemu_opts_absorb_qdict(legacy_opts, bs_opts, errp)) {
         goto fail;
     }
 
@@ -1009,13 +1002,10 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     }
 
     /* Actual block device init: Functionality shared with blockdev-add */
-    blk = blockdev_init(filename, bs_opts, &local_err);
+    blk = blockdev_init(filename, bs_opts, errp);
     bs_opts = NULL;
     if (!blk) {
-        error_propagate(errp, local_err);
         goto fail;
-    } else {
-        assert(!local_err);
     }
 
     /* Create legacy DriveInfo */
@@ -3147,9 +3137,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
                            arg->has_copy_mode, arg->copy_mode,
                            arg->has_auto_finalize, arg->auto_finalize,
                            arg->has_auto_dismiss, arg->auto_dismiss,
-                           &local_err);
+                           errp);
     bdrv_unref(target_bs);
-    error_propagate(errp, local_err);
 out:
     aio_context_release(aio_context);
 }
@@ -3177,7 +3166,6 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
     AioContext *aio_context;
     AioContext *old_context;
     BlockMirrorBackingMode backing_mode = MIRROR_LEAVE_BACKING_CHAIN;
-    Error *local_err = NULL;
     bool zero_target;
     int ret;
 
@@ -3219,8 +3207,7 @@ void qmp_blockdev_mirror(bool has_job_id, const char *job_id,
                            has_copy_mode, copy_mode,
                            has_auto_finalize, auto_finalize,
                            has_auto_dismiss, auto_dismiss,
-                           &local_err);
-    error_propagate(errp, local_err);
+                           errp);
 out:
     aio_context_release(aio_context);
 }
@@ -3439,8 +3426,7 @@ void qmp_change_backing_file(const char *device,
     }
 
     if (ro) {
-        bdrv_reopen_set_read_only(image_bs, true, &local_err);
-        error_propagate(errp, local_err);
+        bdrv_reopen_set_read_only(image_bs, true, errp);
     }
 
 out:
diff --git a/bootdevice.c b/bootdevice.c
index 0ff55e2b79..add4e3d2d1 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -297,22 +297,19 @@ static void device_set_bootindex(Object *obj, Visitor *v, const char *name,
     int32_t boot_index;
     Error *local_err = NULL;
 
-    visit_type_int32(v, name, &boot_index, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_int32(v, name, &boot_index, errp)) {
+        return;
     }
     /* check whether bootindex is present in fw_boot_order list  */
     check_boot_index(boot_index, &local_err);
     if (local_err) {
-        goto out;
+        error_propagate(errp, local_err);
+        return;
     }
     /* change bootindex to a new one */
     *prop->bootindex = boot_index;
 
     add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);
-
-out:
-    error_propagate(errp, local_err);
 }
 
 static void property_release_bootindex(Object *obj, const char *name,
@@ -342,7 +339,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         prop);
 
     /* initialize devices' bootindex property to -1 */
-    object_property_set_int(obj, -1, name, NULL);
+    object_property_set_int(obj, name, -1, NULL);
 }
 
 typedef struct FWLCHSEntry FWLCHSEntry;
diff --git a/chardev/char.c b/chardev/char.c
index df697f3ce9..e5b43cb4b8 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -444,8 +444,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
         qemu_opt_set(opts, "host", host, &error_abort);
         qemu_opt_set(opts, "port", port, &error_abort);
         if (p[pos] == ',') {
-            qemu_opts_do_parse(opts, p+pos+1, NULL, &local_err);
-            if (local_err) {
+            if (!qemu_opts_do_parse(opts, p + pos + 1, NULL, &local_err)) {
                 error_report_err(local_err);
                 goto fail;
             }
@@ -484,8 +483,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
     }
     if (strstart(filename, "unix:", &p)) {
         qemu_opt_set(opts, "backend", "socket", &error_abort);
-        qemu_opts_do_parse(opts, p, "path", &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, p, "path", &local_err)) {
             error_report_err(local_err);
             goto fail;
         }
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index e4cd35f74c..ee08c4ced0 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -103,8 +103,8 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
             break;
 
         case 'l': /* shm size */
-            parse_option_size("shm_size", optarg, &args->shm_size, &err);
-            if (err) {
+            if (!parse_option_size("shm_size", optarg, &args->shm_size,
+                                   &err)) {
                 error_report_err(err);
                 ivshmem_server_help(argv[0]);
                 exit(1);
diff --git a/crypto/secret.c b/crypto/secret.c
index 3447e2f64b..281cb81f0f 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -110,7 +110,7 @@ qcrypto_secret_prop_get_file(Object *obj,
 static void
 qcrypto_secret_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/secret_keyring.c b/crypto/secret_keyring.c
index 4f132d6370..8bfc58ebf4 100644
--- a/crypto/secret_keyring.c
+++ b/crypto/secret_keyring.c
@@ -105,7 +105,7 @@ qcrypto_secret_prop_get_key(Object *obj, Visitor *v,
 static void
 qcrypto_secret_keyring_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index fc078d5b97..30275b6847 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -165,7 +165,7 @@ qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredspsk.c b/crypto/tlscredspsk.c
index f01b64d8bc..e26807b899 100644
--- a/crypto/tlscredspsk.c
+++ b/crypto/tlscredspsk.c
@@ -234,7 +234,7 @@ qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index e337d68c4f..dd7267ccdb 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -774,7 +774,7 @@ qcrypto_tls_creds_x509_prop_get_sanity(Object *obj,
 static void
 qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index a7794ef658..69eede6c28 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -1408,105 +1408,87 @@ Example:
     #include "example-qapi-types.h"
 
 
-    void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
-    void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
-    void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
+    bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
+    bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
+    bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
 
-    void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
+    bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
 
     #endif /* EXAMPLE_QAPI_VISIT_H */
     $ cat qapi-generated/example-qapi-visit.c
 [Uninteresting stuff omitted...]
 
-    void visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
+    bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp)
     {
-        Error *err = NULL;
-
-        visit_type_int(v, "integer", &obj->integer, &err);
-        if (err) {
-            goto out;
+        if (!visit_type_int(v, "integer", &obj->integer, errp)) {
+            return false;
         }
         if (visit_optional(v, "string", &obj->has_string)) {
-            visit_type_str(v, "string", &obj->string, &err);
-            if (err) {
-                goto out;
+            if (!visit_type_str(v, "string", &obj->string, errp)) {
+                return false;
             }
         }
-
-    out:
-        error_propagate(errp, err);
+        return true;
     }
 
-    void visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
+    bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
     {
-        Error *err = NULL;
+        bool ok = false;
 
-        visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), &err);
-        if (err) {
-            goto out;
+        if (!visit_start_struct(v, name, (void **)obj, sizeof(UserDefOne), errp)) {
+            return false;
         }
         if (!*obj) {
             /* incomplete */
             assert(visit_is_dealloc(v));
             goto out_obj;
         }
-        visit_type_UserDefOne_members(v, *obj, &err);
-        if (err) {
+        if (!visit_type_UserDefOne_members(v, *obj, errp)) {
             goto out_obj;
         }
-        visit_check_struct(v, &err);
+        ok = visit_check_struct(v, errp);
     out_obj:
         visit_end_struct(v, (void **)obj);
-        if (err && visit_is_input(v)) {
+        if (!ok && visit_is_input(v)) {
             qapi_free_UserDefOne(*obj);
             *obj = NULL;
         }
-    out:
-        error_propagate(errp, err);
+        return ok;
     }
 
-    void visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
+    bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
     {
-        Error *err = NULL;
+        bool ok = false;
         UserDefOneList *tail;
         size_t size = sizeof(**obj);
 
-        visit_start_list(v, name, (GenericList **)obj, size, &err);
-        if (err) {
-            goto out;
+        if (!visit_start_list(v, name, (GenericList **)obj, size, errp)) {
+            return false;
         }
 
         for (tail = *obj; tail;
              tail = (UserDefOneList *)visit_next_list(v, (GenericList *)tail, size)) {
-            visit_type_UserDefOne(v, NULL, &tail->value, &err);
-            if (err) {
-                break;
+            if (!visit_type_UserDefOne(v, NULL, &tail->value, errp)) {
+                goto out_obj;
             }
         }
 
-        if (!err) {
-            visit_check_list(v, &err);
-        }
+        ok = visit_check_list(v, errp);
+    out_obj:
         visit_end_list(v, (void **)obj);
-        if (err && visit_is_input(v)) {
+        if (!ok && visit_is_input(v)) {
             qapi_free_UserDefOneList(*obj);
             *obj = NULL;
         }
-    out:
-        error_propagate(errp, err);
+        return ok;
     }
 
-    void visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
+    bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp)
     {
-        Error *err = NULL;
-
-        visit_type_UserDefOneList(v, "arg1", &obj->arg1, &err);
-        if (err) {
-            goto out;
+        if (!visit_type_UserDefOneList(v, "arg1", &obj->arg1, errp)) {
+            return false;
         }
-
-    out:
-        error_propagate(errp, err);
+        return true;
     }
 
 [Uninteresting stuff omitted...]
@@ -1561,15 +1543,12 @@ Example:
 
     static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject **ret_out, Error **errp)
     {
-        Error *err = NULL;
         Visitor *v;
 
         v = qobject_output_visitor_new(ret_out);
-        visit_type_UserDefOne(v, "unused", &ret_in, &err);
-        if (!err) {
+        if (visit_type_UserDefOne(v, "unused", &ret_in, errp)) {
             visit_complete(v, ret_out);
         }
-        error_propagate(errp, err);
         visit_free(v);
         v = qapi_dealloc_visitor_new();
         visit_type_UserDefOne(v, "unused", &ret_in, NULL);
@@ -1579,33 +1558,32 @@ Example:
     void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp)
     {
         Error *err = NULL;
+        bool ok = false;
         Visitor *v;
         UserDefOne *retval;
         q_obj_my_command_arg arg = {0};
 
         v = qobject_input_visitor_new(QOBJECT(args));
-        visit_start_struct(v, NULL, NULL, 0, &err);
-        if (err) {
+        if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
             goto out;
         }
-        visit_type_q_obj_my_command_arg_members(v, &arg, &err);
-        if (!err) {
-            visit_check_struct(v, &err);
+        if (visit_type_q_obj_my_command_arg_members(v, &arg, errp)) {
+            ok = visit_check_struct(v, errp);
         }
         visit_end_struct(v, NULL);
-        if (err) {
+        if (!ok) {
             goto out;
         }
 
         retval = qmp_my_command(arg.arg1, &err);
+        error_propagate(errp, err);
         if (err) {
             goto out;
         }
 
-        qmp_marshal_output_UserDefOne(retval, ret, &err);
+        qmp_marshal_output_UserDefOne(retval, ret, errp);
 
     out:
-        error_propagate(errp, err);
         visit_free(v);
         v = qapi_dealloc_visitor_new();
         visit_start_struct(v, NULL, NULL, 0, NULL);
@@ -1613,6 +1591,7 @@ Example:
         visit_end_struct(v, NULL);
         visit_free(v);
     }
+
 [Uninteresting stuff omitted...]
     $ cat qapi-generated/example-qapi-init-commands.h
 [Uninteresting stuff omitted...]
diff --git a/dump/dump.c b/dump/dump.c
index 248ea06370..383bc7876b 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1031,14 +1031,11 @@ out:
 
 static void write_dump_header(DumpState *s, Error **errp)
 {
-     Error *local_err = NULL;
-
     if (s->dump_info.d_class == ELFCLASS32) {
-        create_header32(s, &local_err);
+        create_header32(s, errp);
     } else {
-        create_header64(s, &local_err);
+        create_header64(s, errp);
     }
-    error_propagate(errp, local_err);
 }
 
 static size_t dump_bitmap_get_bufsize(DumpState *s)
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index 54e012e5b4..3107637209 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -1479,10 +1479,10 @@ static void error_append_security_model_hint(Error *const *errp)
 
 static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
 {
+    ERRP_GUARD();
     const char *sec_model = qemu_opt_get(opts, "security_model");
     const char *path = qemu_opt_get(opts, "path");
     const char *multidevs = qemu_opt_get(opts, "multidevs");
-    Error *local_err = NULL;
 
     if (!sec_model) {
         error_setg(errp, "security_model property not set");
@@ -1516,11 +1516,10 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
             fse->export_flags &= ~V9FS_FORBID_MULTIDEVS;
             fse->export_flags &= ~V9FS_REMAP_INODES;
         } else {
-            error_setg(&local_err, "invalid multidevs property '%s'",
+            error_setg(errp, "invalid multidevs property '%s'",
                        multidevs);
-            error_append_hint(&local_err, "Valid options are: multidevs="
+            error_append_hint(errp, "Valid options are: multidevs="
                               "[remap|forbid|warn]\n");
-            error_propagate(errp, local_err);
             return -1;
         }
     }
@@ -1530,9 +1529,8 @@ static int local_parse_opts(QemuOpts *opts, FsDriverEntry *fse, Error **errp)
         return -1;
     }
 
-    if (fsdev_throttle_parse_opts(opts, &fse->fst, &local_err)) {
-        error_propagate_prepend(errp, local_err,
-                                "invalid throttle configuration: ");
+    if (fsdev_throttle_parse_opts(opts, &fse->fst, errp)) {
+        error_prepend(errp, "invalid throttle configuration: ");
         return -1;
     }
 
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 9755fba9a9..2ffd96ade9 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -4011,6 +4011,7 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr)
 int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
                                Error **errp)
 {
+    ERRP_GUARD();
     int i, len;
     struct stat stat;
     FsDriverEntry *fse;
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 45cbed49ab..f6d9ec4f13 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -239,7 +239,6 @@ static void acpi_table_install(const char unsigned *blob, size_t bloblen,
 void acpi_table_add(const QemuOpts *opts, Error **errp)
 {
     AcpiTableOptions *hdrs = NULL;
-    Error *err = NULL;
     char **pathnames = NULL;
     char **cur;
     size_t bloblen = 0;
@@ -249,21 +248,21 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         Visitor *v;
 
         v = opts_visitor_new(opts);
-        visit_type_AcpiTableOptions(v, NULL, &hdrs, &err);
+        visit_type_AcpiTableOptions(v, NULL, &hdrs, errp);
         visit_free(v);
     }
 
-    if (err) {
+    if (!hdrs) {
         goto out;
     }
     if (hdrs->has_file == hdrs->has_data) {
-        error_setg(&err, "'-acpitable' requires one of 'data' or 'file'");
+        error_setg(errp, "'-acpitable' requires one of 'data' or 'file'");
         goto out;
     }
 
     pathnames = g_strsplit(hdrs->has_file ? hdrs->file : hdrs->data, ":", 0);
     if (pathnames == NULL || pathnames[0] == NULL) {
-        error_setg(&err, "'-acpitable' requires at least one pathname");
+        error_setg(errp, "'-acpitable' requires at least one pathname");
         goto out;
     }
 
@@ -272,7 +271,7 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         int fd = open(*cur, O_RDONLY | O_BINARY);
 
         if (fd < 0) {
-            error_setg(&err, "can't open file %s: %s", *cur, strerror(errno));
+            error_setg(errp, "can't open file %s: %s", *cur, strerror(errno));
             goto out;
         }
 
@@ -288,8 +287,8 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
                 memcpy(blob + bloblen, data, r);
                 bloblen += r;
             } else if (errno != EINTR) {
-                error_setg(&err, "can't read file %s: %s",
-                           *cur, strerror(errno));
+                error_setg(errp, "can't read file %s: %s", *cur,
+                           strerror(errno));
                 close(fd);
                 goto out;
             }
@@ -298,14 +297,12 @@ void acpi_table_add(const QemuOpts *opts, Error **errp)
         close(fd);
     }
 
-    acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, &err);
+    acpi_table_install(blob, bloblen, hdrs->has_file, hdrs, errp);
 
 out:
     g_free(blob);
     g_strfreev(pathnames);
     qapi_free_AcpiTableOptions(hdrs);
-
-    error_propagate(errp, err);
 }
 
 unsigned acpi_table_len(void *current)
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 3e687d227a..53654f8638 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -41,7 +41,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
      */
     if (addr == 0 && data == 0) {
         AcpiCpuHotplug *cpus = opaque;
-        object_property_set_bool(cpus->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
     }
 }
@@ -63,7 +63,7 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu)
 
     cpu_id = k->get_arch_id(cpu);
     if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) {
-        object_property_set_bool(g->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(g->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
         return;
     }
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 2d204babc6..6a19070cec 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -201,7 +201,7 @@ static int vmstate_cpuhp_pre_load(void *opaque)
 {
     ICH9LPCPMRegs *s = opaque;
     Object *obj = OBJECT(s->gpe_cpu.device);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 283422e0d3..26bac4f16c 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -244,7 +244,7 @@ static bool vmstate_test_use_cpuhp(void *opaque)
 static int vmstate_cpuhp_pre_load(void *opaque)
 {
     Object *obj = OBJECT(opaque);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index 52e0d83760..e258463747 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -72,17 +72,12 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
 {
     AwA10State *s = AW_A10(dev);
     SysBusDevice *sysbusdev;
-    Error *err = NULL;
 
-    qdev_realize(DEVICE(&s->cpu), NULL, &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
         return;
     }
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->intc);
@@ -93,9 +88,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
                        qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
     qdev_pass_gpios(DEVICE(&s->intc), dev, NULL);
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->timer), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->timer), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->timer);
@@ -117,18 +110,14 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
         qemu_check_nic_model(&nd_table[0], TYPE_AW_EMAC);
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
     }
-    sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err);
-    if (err != NULL) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), errp)) {
         return;
     }
     sysbusdev = SYS_BUS_DEVICE(&s->emac);
     sysbus_mmio_map(sysbusdev, 0, AW_A10_EMAC_BASE);
     sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(dev, 55));
 
-    sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), errp)) {
         return;
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->sata), 0, AW_A10_SATA_BASE);
@@ -147,15 +136,15 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
 
             sprintf(bus, "usb-bus.%d", i);
 
-            object_property_set_bool(OBJECT(&s->ehci[i]), true,
-                                     "companion-enable", &error_fatal);
+            object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable",
+                                     true, &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                             AW_A10_EHCI_BASE + i * 0x8000);
             sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                                qdev_get_gpio_in(dev, 39 + i));
 
-            object_property_set_str(OBJECT(&s->ohci[i]), bus, "masterbus",
+            object_property_set_str(OBJECT(&s->ohci[i]), "masterbus", bus,
                                     &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ohci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ohci[i]), 0,
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 2fbd970b4f..64fcab895f 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -534,23 +534,18 @@ static void armsse_realize(DeviceState *dev, Error **errp)
          * later if necessary.
          */
         if (extract32(info->cpuwait_rst, i, 1)) {
-            object_property_set_bool(cpuobj, true, "start-powered-off", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "start-powered-off", true,
+                                          errp)) {
                 return;
             }
         }
         if (!s->cpu_fpu[i]) {
-            object_property_set_bool(cpuobj, false, "vfp", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "vfp", false, errp)) {
                 return;
             }
         }
         if (!s->cpu_dsp[i]) {
-            object_property_set_bool(cpuobj, false, "dsp", &err);
-            if (err) {
-                error_propagate(errp, err);
+            if (!object_property_set_bool(cpuobj, "dsp", false, errp)) {
                 return;
             }
         }
@@ -562,12 +557,10 @@ static void armsse_realize(DeviceState *dev, Error **errp)
             memory_region_add_subregion_overlap(&s->cpu_container[i], 0,
                                                 &s->container, -1);
         }
-        object_property_set_link(cpuobj, OBJECT(&s->cpu_container[i]),
-                                 "memory", &error_abort);
-        object_property_set_link(cpuobj, OBJECT(s), "idau", &error_abort);
-        sysbus_realize(SYS_BUS_DEVICE(cpuobj), &err);
-        if (err) {
-            error_propagate(errp, err);
+        object_property_set_link(cpuobj, "memory",
+                                 OBJECT(&s->cpu_container[i]), &error_abort);
+        object_property_set_link(cpuobj, "idau", OBJECT(s), &error_abort);
+        if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), errp)) {
             return;
         }
         /*
@@ -576,9 +569,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
          * CPU must exist and have been parented into the cluster before
          * the cluster is realized.
          */
-        qdev_realize(DEVICE(&s->cluster[i]), NULL, &err);
-        if (err) {
-            error_propagate(errp, err);
+        if (!qdev_realize(DEVICE(&s->cluster[i]), NULL, errp)) {
             return;
         }
 
@@ -606,15 +597,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
                 DeviceState *devs = DEVICE(splitter);
                 int cpunum;
 
-                object_property_set_int(splitter, info->num_cpus,
-                                        "num-lines", &err);
-                if (err) {
-                    error_propagate(errp, err);
+                if (!object_property_set_int(splitter, "num-lines",
+                                             info->num_cpus, errp)) {
                     return;
                 }
-                qdev_realize(DEVICE(splitter), NULL, &err);
-                if (err) {
-                    error_propagate(errp, err);
+                if (!qdev_realize(DEVICE(splitter), NULL, errp)) {
                     return;
                 }
                 for (cpunum = 0; cpunum < info->num_cpus; cpunum++) {
@@ -645,9 +632,7 @@ static void armsse_realize(DeviceState *dev, Error **errp)
     }
 
     /* Security controller */
-    sysbus_realize(SYS_BUS_DEVICE(&s->secctl), &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->secctl), errp)) {
         return;
     }
     sbd_secctl = SYS_BUS_DEVICE(&s->secctl);
@@ -662,15 +647,11 @@ static void armsse_realize(DeviceState *dev, Error **errp)
      * multiple lines, one for each of the PPCs within the ARMSSE and one


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16254.39725 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQR-0005Hx-1b; Fri, 30 Oct 2020 20:55:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16254.39725; Fri, 30 Oct 2020 20:55:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQQ-0005Hp-Un; Fri, 30 Oct 2020 20:55:06 +0000
Received: by outflank-mailman (input) for mailman id 16254;
 Fri, 30 Oct 2020 20:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbQP-0005Hk-KL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 299ec27d-94d0-4851-a8ea-fcefa9fde1da;
 Fri, 30 Oct 2020 20:55:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQO-0002Xv-36
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQO-0004QL-1x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbQP-0005Hk-KL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:05 +0000
X-Inumbo-ID: 299ec27d-94d0-4851-a8ea-fcefa9fde1da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 299ec27d-94d0-4851-a8ea-fcefa9fde1da;
	Fri, 30 Oct 2020 20:55:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mR4obly3Ebka7KiNqdVoKMRs7MX//E4Qqvmco08ec+g=; b=jbGSIWoJ6Ysg9JFBmyZgzodRdD
	1WtlGFZluvfPRFYubpiTQuv2cM9AjdFPC9sAVbIAnr46qHBe57i6mwNJBiMCDtTPJbBXVEb9AGGxb
	/qgCDTO6Dt4uXsu9nLRlA5X98ngszJAEEtnyrXgh/yPthyIw/+tqCF1+QHTSiKt9gCyg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQO-0002Xv-36
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQO-0004QL-1x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update OpenBIOS images to 75fbb41d built from submodule.
Message-Id: <E1kYbQO-0004QL-1x@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:04 +0000

commit 1e04092feecfc8caaf314df2670bf9c645a0b122
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Tue Jul 7 18:32:50 2020 +0100
Commit:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CommitDate: Tue Jul 7 21:54:37 2020 +0100

    Update OpenBIOS images to 75fbb41d built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index 5da9363bff..a07757a987 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index d68b5e5d30..2faaab83ba 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index 26d631ea64..dd7eeeeab4 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 4704d9eba6..75fbb41d28 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 4704d9eba6d8017dc694c077ca4205ffd8becad8
+Subproject commit 75fbb41d2857d93208c74a8e0228b29fd7bf04c0
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16255.39730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQb-0005J1-3D; Fri, 30 Oct 2020 20:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16255.39730; Fri, 30 Oct 2020 20:55:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQb-0005It-09; Fri, 30 Oct 2020 20:55:17 +0000
Received: by outflank-mailman (input) for mailman id 16255;
 Fri, 30 Oct 2020 20:55:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbQZ-0005Ih-Ed
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6b2703e1-00f9-4d42-add9-ae669396410f;
 Fri, 30 Oct 2020 20:55:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQY-0002Xy-9F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQY-0004RJ-6N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbQZ-0005Ih-Ed
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:15 +0000
X-Inumbo-ID: 6b2703e1-00f9-4d42-add9-ae669396410f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6b2703e1-00f9-4d42-add9-ae669396410f;
	Fri, 30 Oct 2020 20:55:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tNkJ3jBXfpynlI/lgQ/ffdubt+e0avZv9M+WWeotiEQ=; b=G8OYlFIJ1GBKaNAdSvsuGBLsjE
	fsvVasRLSExMcCeWzWo+19U/jH1gBscR840AJEQv/t3jMIN7LVpFLgYWDfF1SpxJrA3JZOQSntH3R
	lhHhaTyG/zbF/twxeWX1X81snZKc+gKvArhtJbTGVi71QUf8DgqhBopSr3nzGThUq6Lg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQY-0002Xy-9F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQY-0004RJ-6N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200707' into staging
Message-Id: <E1kYbQY-0004RJ-6N@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:14 +0000

commit 45db94cc90c286a9965a285ba19450f448760a09
Merge: f2a1cf9180f63e88bb38ff21c169da97c3f2bad5 1e04092feecfc8caaf314df2670bf9c645a0b122
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 16:43:40 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 16:43:40 2020 +0100

    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200707' into staging
    
    qemu-openbios queue
    
    # gpg: Signature made Tue 07 Jul 2020 21:57:37 BST
    # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
    # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
    # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
    # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
    
    * remotes/mcayland/tags/qemu-openbios-20200707:
      Update OpenBIOS images to 75fbb41d built from submodule.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16256.39734 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQl-0005KV-54; Fri, 30 Oct 2020 20:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16256.39734; Fri, 30 Oct 2020 20:55:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQl-0005KN-1n; Fri, 30 Oct 2020 20:55:27 +0000
Received: by outflank-mailman (input) for mailman id 16256;
 Fri, 30 Oct 2020 20:55:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbQj-0005KA-FC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f32f5a17-81b6-4ade-8c42-e9e538b905bc;
 Fri, 30 Oct 2020 20:55:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQi-0002YF-Lv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQi-0004S4-J6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbQj-0005KA-FC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:25 +0000
X-Inumbo-ID: f32f5a17-81b6-4ade-8c42-e9e538b905bc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f32f5a17-81b6-4ade-8c42-e9e538b905bc;
	Fri, 30 Oct 2020 20:55:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=su9MWM5oI+Rc0imqE0HUp5KkpoDoRGv4LzkLF1a0Gnw=; b=C2GPLVArIIkNasyoTVynuVOvrb
	VD0weYNt5ZAkkIDDL1eDp8kgsnzTde0o4pfDV41PmFtP1vHQa6DQamyYjyhZt1PO000cbYx3O0DVj
	luxGZ5rB5X73msujPxoWI5M9QomVap0M5DF0HVRa5GrgLajAC7BO9WsuL3lLPQlJpWcg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQi-0002YF-Lv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQi-0004S4-J6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] vhost-vdpa: fix the compile issue without kvm
Message-Id: <E1kYbQi-0004S4-J6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:24 +0000

commit 4dc5acc07e88b2776513db75944f2e240116ebda
Author:     Cindy Lu <lulu@redhat.com>
AuthorDate: Wed Jul 8 16:49:22 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 8 06:16:48 2020 -0400

    vhost-vdpa: fix the compile issue without kvm
    
    Fix the compile issue in the system without the kvm support
    
    Signed-off-by: Cindy Lu <lulu@redhat.com>
    Message-Id: <20200708084922.21904-1-lulu@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index a3d17fe0f9..65d5aaf08a 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -19,8 +19,7 @@
 #include "hw/virtio/virtio-net.h"
 #include "hw/virtio/vhost-vdpa.h"
 #include "qemu/main-loop.h"
-#include <linux/kvm.h>
-#include "sysemu/kvm.h"
+#include "cpu.h"
 
 static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
 {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16257.39738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQv-0005M1-6R; Fri, 30 Oct 2020 20:55:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16257.39738; Fri, 30 Oct 2020 20:55:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbQv-0005Lt-3O; Fri, 30 Oct 2020 20:55:37 +0000
Received: by outflank-mailman (input) for mailman id 16257;
 Fri, 30 Oct 2020 20:55:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbQu-0005Lf-2N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ddb6d900-fd5e-4ef5-b6b8-31e2b30070dc;
 Fri, 30 Oct 2020 20:55:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQs-0002YV-RU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbQs-0004Sg-On
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbQu-0005Lf-2N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:36 +0000
X-Inumbo-ID: ddb6d900-fd5e-4ef5-b6b8-31e2b30070dc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ddb6d900-fd5e-4ef5-b6b8-31e2b30070dc;
	Fri, 30 Oct 2020 20:55:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ABDuUYjftXaA8QzgQ2ekXmeKbdfxOUn4Sn4p20FbrIs=; b=LZWvc+esSf5WftaJISt17ZR4JG
	TpeYVE3v+vbZ9tupREXitJrAVyNNenrkXsWHNwJtXdmDqqC0nWl3V5CeaU2IGcSYDh4Cc52ygwblz
	qfJbrZYKDC/gw6LWFLW7nbWWRFSkx//maTY67M/5WH0OkSRrH14lh/wO1vO9+5aez93M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQs-0002YV-RU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbQs-0004Sg-On
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYbQs-0004Sg-On@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:34 +0000

commit 0fb7ea45157d63507675a4011bc4b24588217f6e
Merge: 45db94cc90c286a9965a285ba19450f448760a09 4dc5acc07e88b2776513db75944f2e240116ebda
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 10 19:29:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 10 19:29:07 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio: bugfix
    
    fixes vdpa on non-kvm platforms
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Wed 08 Jul 2020 11:17:48 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      vhost-vdpa: fix the compile issue without kvm
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/virtio/vhost-vdpa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16258.39741 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbR5-0005Ng-8E; Fri, 30 Oct 2020 20:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16258.39741; Fri, 30 Oct 2020 20:55:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbR5-0005NY-4z; Fri, 30 Oct 2020 20:55:47 +0000
Received: by outflank-mailman (input) for mailman id 16258;
 Fri, 30 Oct 2020 20:55:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbR4-0005NR-72
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7a0e36e9-3fda-4f64-9d50-def7029e3644;
 Fri, 30 Oct 2020 20:55:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbR3-0002ZH-7e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbR3-0004Tv-6o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbR4-0005NR-72
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:46 +0000
X-Inumbo-ID: 7a0e36e9-3fda-4f64-9d50-def7029e3644
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7a0e36e9-3fda-4f64-9d50-def7029e3644;
	Fri, 30 Oct 2020 20:55:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5a3Flb1JNhipwp9maa3uVZ9rg4eQ2CoeS+QsbDS/PgU=; b=vGupkRA/nyGHUtwkzWphwboRG3
	tvvZGrlxA5R56v/pzZFw0HIWsmgIZi7M4YxTMqfH3l0C1lLxdKDLF+TupMftm7nLIn4SVGpJv5VlV
	hJ6AJT7gTv4xY0rr1K5beqKVitzJyeh3SSpPJKOpezzkS8RAC/vpA+QonmLXnKs/mInQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbR3-0002ZH-7e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbR3-0004Tv-6o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen: Fix xen-legacy-backend qdev types
Message-Id: <E1kYbR3-0004Tv-6o@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:45 +0000

commit 104a7f4e1355493175b0ad6f49c524ee449c16f7
Author:     Jason Andryuk <jandryuk@gmail.com>
AuthorDate: Wed Jun 24 08:19:39 2020 -0400
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Jul 10 13:49:16 2020 +0100

    xen: Fix xen-legacy-backend qdev types
    
    xen-sysdev is a TYPE_SYS_BUS_DEVICE.  bus_type should not be changed so
    that it can plug into the System bus.  Otherwise this assert triggers:
    qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion
    `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)'
    failed.
    
    TYPE_XENBACKEND attaches to TYPE_XENSYSBUS, so its class_init needs to
    be set accordingly to attach the qdev.  Otherwise the following assert
    triggers:
    qemu-system-i386: hw/core/qdev.c:102: qdev_set_parent_bus: Assertion
    `dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)'
    failed.
    
    TYPE_XENBACKEND is not a subclass of XEN_XENSYSDEV, so it's parent
    is just TYPE_DEVICE.  Change that.
    
    Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
    Acked-by: Paul Durrant <pdurrant@amazon.com>
    Fixes: 81cb05732efb ("qdev: Assert devices are plugged into a bus that can take them")
    Message-Id: <20200624121939.10282-1-jandryuk@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/xen/xen-legacy-backend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 7d4b13351e..083d8dc1b2 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -789,11 +789,12 @@ static void xendev_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     /* xen-backend devices can be plugged/unplugged dynamically */
     dc->user_creatable = true;
+    dc->bus_type = TYPE_XENSYSBUS;
 }
 
 static const TypeInfo xendev_type_info = {
     .name          = TYPE_XENBACKEND,
-    .parent        = TYPE_XENSYSDEV,
+    .parent        = TYPE_DEVICE,
     .class_init    = xendev_class_init,
     .instance_size = sizeof(struct XenLegacyDevice),
 };
@@ -824,7 +825,6 @@ static void xen_sysdev_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     device_class_set_props(dc, xen_sysdev_properties);
-    dc->bus_type = TYPE_XENSYSBUS;
 }
 
 static const TypeInfo xensysdev_info = {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:55:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:55:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16259.39746 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRF-0005Ox-9b; Fri, 30 Oct 2020 20:55:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16259.39746; Fri, 30 Oct 2020 20:55:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRF-0005Oq-6Z; Fri, 30 Oct 2020 20:55:57 +0000
Received: by outflank-mailman (input) for mailman id 16259;
 Fri, 30 Oct 2020 20:55:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbRE-0005Oj-7W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 31059c0d-5b54-4bd5-9252-baffe674cfdf;
 Fri, 30 Oct 2020 20:55:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRD-0002ZN-BV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRD-0004UX-AY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbRE-0005Oj-7W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:56 +0000
X-Inumbo-ID: 31059c0d-5b54-4bd5-9252-baffe674cfdf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 31059c0d-5b54-4bd5-9252-baffe674cfdf;
	Fri, 30 Oct 2020 20:55:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hfENU6IkKnKv08nTgq2vY4HNrplLVzo9pczJvfFyyME=; b=3ZYa9Zq5i+HfOMwVCP9XNUqvF3
	BAdQ2H7xnqkMYwnQ1RINoJQET4OUuZMacrGnUmv99xQFRQBPjXQdtwk453fz5wJqPZDLkEOV06IsZ
	HzN7bPqw6rVsGZR4LXr8p1E/l3dhavLRCWsm98Od+nHEwtXW3GHlmGmh0VvX5bD8hJsc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRD-0002ZN-BV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRD-0004UX-AY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:55:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xen: cleanup unrealized flash devices
Message-Id: <E1kYbRD-0004UX-AY@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:55:55 +0000

commit dd29b5c30cd2a13f8c12376a8de84cb090c338bf
Author:     Paul Durrant <pdurrant@amazon.com>
AuthorDate: Wed Jun 24 13:18:41 2020 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Fri Jul 10 13:49:16 2020 +0100

    xen: cleanup unrealized flash devices
    
    The generic pc_machine_initfn() calls pc_system_flash_create() which creates
    'system.flash0' and 'system.flash1' devices. These devices are then realized
    by pc_system_flash_map() which is called from pc_system_firmware_init() which
    itself is called via pc_memory_init(). The latter however is not called when
    xen_enable() is true and hence the following assertion fails:
    
    qemu-system-i386: hw/core/qdev.c:439: qdev_assert_realized_properly:
    Assertion `dev->realized' failed
    
    These flash devices are unneeded when using Xen so this patch avoids the
    assertion by simply removing them using pc_system_flash_cleanup_unused().
    
    Reported-by: Jason Andryuk <jandryuk@gmail.com>
    Fixes: ebc29e1beab0 ("pc: Support firmware configuration with -blockdev")
    Signed-off-by: Paul Durrant <pdurrant@amazon.com>
    Tested-by: Jason Andryuk <jandryuk@gmail.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200624121841.17971-3-paul@xen.org>
    Fixes: dfe8c79c4468 ("qdev: Assert onboard devices all get realized properly")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/i386/pc_piix.c    | 9 ++++++---
 hw/i386/pc_sysfw.c   | 2 +-
 include/hw/i386/pc.h | 1 +
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2bb42a8141..3469b1fd10 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -186,9 +186,12 @@ static void pc_init1(MachineState *machine,
     if (!xen_enabled()) {
         pc_memory_init(pcms, system_memory,
                        rom_memory, &ram_memory);
-    } else if (machine->kernel_filename != NULL) {
-        /* For xen HVM direct kernel boot, load linux here */
-        xen_load_linux(pcms);
+    } else {
+        pc_system_flash_cleanup_unused(pcms);
+        if (machine->kernel_filename != NULL) {
+            /* For xen HVM direct kernel boot, load linux here */
+            xen_load_linux(pcms);
+        }
     }
 
     gsi_state = pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled);
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index ec2a3b3e7e..0ff47a4b59 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -108,7 +108,7 @@ void pc_system_flash_create(PCMachineState *pcms)
     }
 }
 
-static void pc_system_flash_cleanup_unused(PCMachineState *pcms)
+void pc_system_flash_cleanup_unused(PCMachineState *pcms)
 {
     char *prop_name;
     int i;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index a802e69974..3d7ed3a55e 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -186,6 +186,7 @@ ISADevice *pc_find_fdc0(void);
 
 /* pc_sysfw.c */
 void pc_system_flash_create(PCMachineState *pcms);
+void pc_system_flash_cleanup_unused(PCMachineState *pcms);
 void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory);
 
 /* acpi-build.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:56:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:56:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16260.39750 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRP-0005QE-BU; Fri, 30 Oct 2020 20:56:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16260.39750; Fri, 30 Oct 2020 20:56:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRP-0005Q6-8W; Fri, 30 Oct 2020 20:56:07 +0000
Received: by outflank-mailman (input) for mailman id 16260;
 Fri, 30 Oct 2020 20:56:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbRO-0005Pz-DS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b06d651c-2cfc-435c-adb8-d004095871d3;
 Fri, 30 Oct 2020 20:56:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRN-0002Zk-Fh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRN-0004Vb-Ea
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbRO-0005Pz-DS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:06 +0000
X-Inumbo-ID: b06d651c-2cfc-435c-adb8-d004095871d3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b06d651c-2cfc-435c-adb8-d004095871d3;
	Fri, 30 Oct 2020 20:56:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IS0Sn4/u98rdfPmPalhzYNe1Hp4GDVOlpWyJkoG0y24=; b=5apkCAhELhba3F6nzAMXdP4bbV
	0DujlwAwARKkcD5Fy127l54hrNQZsrv73C2VaQvaMixnpva/PwSyKO5GBBNN/RarNHkK6osv6wNxH
	tvxnygdrIKj/UHDL+yQYsPikHgjeDqZzw5FNut26YIKpglkY6zydvoFBJYc7MVCx2QEI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRN-0002Zk-Fh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRN-0004Vb-Ea
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200710' into staging
Message-Id: <E1kYbRN-0004Vb-Ea@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:56:05 +0000

commit 827937158b72ce2265841ff528bba3c44a1bfbc8
Merge: 0fb7ea45157d63507675a4011bc4b24588217f6e dd29b5c30cd2a13f8c12376a8de84cb090c338bf
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 13:56:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 13:56:03 2020 +0100

    Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200710' into staging
    
    xen patches
    
    Fixes following harden checks in qdev.
    
    # gpg: Signature made Fri 10 Jul 2020 14:05:46 BST
    # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
    # gpg:                issuer "anthony.perard@citrix.com"
    # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
    # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
    #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
    
    * remotes/aperard/tags/pull-xen-20200710:
      xen: cleanup unrealized flash devices
      xen: Fix xen-legacy-backend qdev types
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/i386/pc_piix.c           | 9 ++++++---
 hw/i386/pc_sysfw.c          | 2 +-
 hw/xen/xen-legacy-backend.c | 4 ++--
 include/hw/i386/pc.h        | 1 +
 4 files changed, 10 insertions(+), 6 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:56:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:56:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16261.39753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRZ-0005Rb-D1; Fri, 30 Oct 2020 20:56:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16261.39753; Fri, 30 Oct 2020 20:56:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRZ-0005RU-A6; Fri, 30 Oct 2020 20:56:17 +0000
Received: by outflank-mailman (input) for mailman id 16261;
 Fri, 30 Oct 2020 20:56:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbRY-0005RM-UQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0160fe91-05bc-4e4b-806b-d9516a3182a1;
 Fri, 30 Oct 2020 20:56:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRX-0002Zr-Sq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRX-0004Wi-RG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbRY-0005RM-UQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:16 +0000
X-Inumbo-ID: 0160fe91-05bc-4e4b-806b-d9516a3182a1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0160fe91-05bc-4e4b-806b-d9516a3182a1;
	Fri, 30 Oct 2020 20:56:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dVE4aTHHKaI10vtU4ZNt5Y9eaxnxv+SR/TUtDUenQqI=; b=G5GqDYTzMmvrgUpuab/F7/Y+Eb
	G/0/FS8FvLseI6dLBxzJPOjTdlWDKMyzYTYHv/uOxgCsE4MTLVnn7DRCrKjQHzmJSHtjy6FdBqj/A
	Kk4lnXMVZZAqfrUwEKFhzP/iHAdjB9peM4ddrn4OUBfWo/gcnCVubPMG8HPLEsbx3hiU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRX-0002Zr-Sq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRX-0004Wi-RG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] 9p: null terminate fs driver options list
Message-Id: <E1kYbRX-0004Wi-RG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:56:15 +0000

commit 353b5a91ccf2789b85967d19a8795816b8865562
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Thu Jul 9 23:28:48 2020 +0530
Commit:     Greg Kurz <groug@kaod.org>
CommitDate: Fri Jul 10 12:48:06 2020 +0200

    9p: null terminate fs driver options list
    
    NULL terminate fs driver options' list, validate_opt() looks for
    a null entry to terminate the loop.
    
    Fixes: aee7f3ecd8b7 ("fsdev: Error out when unsupported option is passed")
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Message-Id: <20200709175848.650400-1-ppandit@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
---
 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index a9e069c0c7..3da64e9f72 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -78,6 +78,7 @@ static FsDriverTable FsDrivers[] = {
             "throttling.iops-read-max-length",
             "throttling.iops-write-max-length",
             "throttling.iops-size",
+            NULL
         },
     },
     {
@@ -85,6 +86,7 @@ static FsDriverTable FsDrivers[] = {
         .ops = &synth_ops,
         .opts = (const char * []) {
             COMMON_FS_DRIVER_OPTIONS,
+            NULL
         },
     },
     {
@@ -95,6 +97,7 @@ static FsDriverTable FsDrivers[] = {
             "socket",
             "sock_fd",
             "writeout",
+            NULL
         },
     },
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:56:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:56:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16263.39758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRj-0005TB-GH; Fri, 30 Oct 2020 20:56:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16263.39758; Fri, 30 Oct 2020 20:56:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRj-0005T3-DK; Fri, 30 Oct 2020 20:56:27 +0000
Received: by outflank-mailman (input) for mailman id 16263;
 Fri, 30 Oct 2020 20:56:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbRi-0005Sw-Ps
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c2013fd9-f7ab-486a-9205-3af72c46b189;
 Fri, 30 Oct 2020 20:56:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRi-0002a4-1U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRh-0004XL-W1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbRi-0005Sw-Ps
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:26 +0000
X-Inumbo-ID: c2013fd9-f7ab-486a-9205-3af72c46b189
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c2013fd9-f7ab-486a-9205-3af72c46b189;
	Fri, 30 Oct 2020 20:56:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S2GsvHl+DV72p72lYp+mnP6LuKtP+dc2umUveIDfkLk=; b=A5BwAafzpDYjTjqOD/DKPP2EzF
	79sMKQI23ud6VNsR3xytDDO2lo975wSAEhIS+qWrA02VN8oWNR77CnXWgjViYStK1k+br5rJ1chXL
	xW+pv51H7leCQKprM6WXZxYFJ8u0zAf18DiMJ1S9yViiliNMANAxdLepOhRgXeRGOUEw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRi-0002a4-1U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRh-0004XL-W1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/gkurz/tags/9p-fix-2020-07-10' into staging
Message-Id: <E1kYbRh-0004XL-W1@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:56:25 +0000

commit d4a6bab1ecf23d86e20e2f08a144e4e48643a6e4
Merge: 827937158b72ce2265841ff528bba3c44a1bfbc8 353b5a91ccf2789b85967d19a8795816b8865562
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:11:30 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 15:11:30 2020 +0100

    Merge remote-tracking branch 'remotes/gkurz/tags/9p-fix-2020-07-10' into staging
    
    Add missing NULL terminating element in fsdev option lists. Never
    crashed QEMU by pure luck.
    
    # gpg: Signature made Fri 10 Jul 2020 17:26:01 BST
    # gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
    # gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
    # gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
    # gpg:                 aka "[jpeg image of size 3330]" [full]
    # Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6
    
    * remotes/gkurz/tags/9p-fix-2020-07-10:
      9p: null terminate fs driver options list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 fsdev/qemu-fsdev.c | 3 +++
 1 file changed, 3 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 20:56:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 20:56:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16264.39762 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRy-0005VO-IV; Fri, 30 Oct 2020 20:56:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16264.39762; Fri, 30 Oct 2020 20:56:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbRy-0005VH-FG; Fri, 30 Oct 2020 20:56:42 +0000
Received: by outflank-mailman (input) for mailman id 16264;
 Fri, 30 Oct 2020 20:56:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbRx-0005VC-T0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2f4f9bba-8a3a-4f42-9f9a-5351e4f236cf;
 Fri, 30 Oct 2020 20:56:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRs-0002ac-PL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbRs-0004a8-OR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbRx-0005VC-T0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:41 +0000
X-Inumbo-ID: 2f4f9bba-8a3a-4f42-9f9a-5351e4f236cf
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2f4f9bba-8a3a-4f42-9f9a-5351e4f236cf;
	Fri, 30 Oct 2020 20:56:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e0uhjgoWnt25VFjxzxat7C3lf0n8NkygpACaMBfAtGs=; b=BiJL9F1zhfA6LFzZnCa3T+kNTl
	JRHjdpg/kJQ2gROu4h97JiGKtDM8P/FFFgLg5PtSLYnHS8cN3Sk+scut5dXpoVawCiRh9zwuxVVaf
	KKKFJfModZHpAHaLOBSpUfXgXRQSTiy0NiNrfhP8kN6CmQpUngAEqnNqSsPgf4XbFNrM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRs-0002ac-PL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbRs-0004a8-OR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 20:56:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Message-Id: <E1kYbRs-0004a8-OR@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 20:56:36 +0000

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

commit 2033cc6efa98b831d7839e367aa7d5aa74d0750f
Merge: d4a6bab1ecf23d86e20e2f08a144e4e48643a6e4 56908dc5041aa424fd1495b6c6beb78c539d93e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 16:52:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 16:52:24 2020 +0100

    Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
    
    * Make checkpatch say 'qemu' instead of 'kernel' (Aleksandar)
    * Fix PSE guests with emulated NPT (Alexander B. #1)
    * Fix leak (Alexander B. #2)
    * HVF fixes (Roman, Cameron)
    * New Sapphire Rapids CPUID bits (Cathy)
    * cpus.c and softmmu/ cleanups (Claudio)
    * TAP driver tweaks (Daniel, Havard)
    * object-add bugfix and testcases (Eric A.)
    * Fix Coverity MIN_CONST and MAX_CONST (Eric B.)
    * "info lapic" improvement (Jan)
    * SSE fixes (Joseph)
    * "-msg guest-name" option (Mario)
    * support for AMD nested live migration (myself)
    * Small i386 TCG fixes (myself)
    * improved error reporting for Xen (myself)
    * fix "-cpu host -overcommit cpu-pm=on" (myself)
    * Add accel/Kconfig (Philippe)
    * iscsi sense handling fixes (Yongji)
    * Misc bugfixes
    
    # gpg: Signature made Sat 11 Jul 2020 00:33:41 BST
    # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
    # gpg:                issuer "pbonzini@redhat.com"
    # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
    # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
    # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
    #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
    
    * remotes/bonzini/tags/for-upstream: (47 commits)
      linux-headers: update again to 5.8
      apic: Report current_count via 'info lapic'
      scripts: improve message when TAP based tests fail
      target/i386: Enable TSX Suspend Load Address Tracking feature
      target/i386: Add SERIALIZE cpu feature
      softmmu/vl: Remove the check for colons in -accel parameters
      cpu-throttle: new module, extracted from cpus.c
      softmmu: move softmmu only files from root
      pc: fix leak in pc_system_flash_cleanup_unused
      cpus: Move CPU code from exec.c to cpus-common.c
      target/i386: Correct the warning message of Intel PT
      checkpatch: Change occurences of 'kernel' to 'qemu' in user messages
      iscsi: return -EIO when sense fields are meaningless
      iscsi: handle check condition status in retry loop
      target/i386: sev: fail query-sev-capabilities if QEMU cannot use SEV
      target/i386: sev: provide proper error reporting for query-sev-capabilities
      KVM: x86: believe what KVM says about WAITPKG
      target/i386: implement undocumented "smsw r32" behavior
      target/i386: remove gen_io_end
      Makefile: simplify MINIKCONF rules
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Kconfig                                   |    4 +
 Kconfig.host                              |    7 -
 MAINTAINERS                               |   29 +-
 Makefile                                  |   12 +-
 Makefile.target                           |    7 +-
 accel/Kconfig                             |    9 +
 accel/stubs/tcg-stub.c                    |    7 +
 arch_init.c                               |  113 -
 balloon.c                                 |  106 -
 block/iscsi.c                             |   22 +-
 cpus-common.c                             |   18 +
 cpus.c                                    | 2329 ---------------------
 exec.c                                    |   22 -
 hw/core/null-machine.c                    |    5 +
 hw/i386/pc_sysfw.c                        |    5 +
 hw/intc/apic.c                            |   18 -
 hw/intc/apic_common.c                     |   19 +
 include/hw/core/cpu.h                     |   37 -
 include/hw/i386/apic_internal.h           |    1 +
 include/qemu/error-report.h               |    2 +
 include/qemu/main-loop.h                  |    5 +
 include/qemu/osdep.h                      |   21 +-
 include/qom/object.h                      |   26 +-
 include/sysemu/cpu-throttle.h             |   68 +
 include/sysemu/hvf.h                      |    2 +-
 include/sysemu/hw_accel.h                 |   13 +
 ioport.c                                  |  299 ---
 linux-headers/asm-arm/unistd-common.h     |    1 +
 linux-headers/asm-x86/kvm.h               |    5 +-
 memory.c                                  | 3250 -----------------------------
 memory_mapping.c                          |  357 ----
 migration/migration.c                     |    1 +
 migration/ram.c                           |    1 +
 qemu-options.hx                           |   12 +-
 qom/object.c                              |   21 +-
 qom/object_interfaces.c                   |    7 +-
 qtest.c                                   |  820 --------
 scripts/checkpatch.pl                     |    6 +-
 scripts/tap-driver.pl                     |    2 +-
 softmmu/Makefile.objs                     |   11 +
 softmmu/arch_init.c                       |  113 +
 softmmu/balloon.c                         |  106 +
 softmmu/cpu-throttle.c                    |  122 ++
 softmmu/cpus.c                            | 2238 ++++++++++++++++++++
 softmmu/ioport.c                          |  299 +++
 softmmu/memory.c                          | 3250 +++++++++++++++++++++++++++++
 softmmu/memory_mapping.c                  |  357 ++++
 softmmu/qtest.c                           |  820 ++++++++
 softmmu/vl.c                              |   14 +-
 target/i386/Makefile.objs                 |    1 +
 target/i386/cpu.c                         |   13 +-
 target/i386/cpu.h                         |   10 +
 target/i386/excp_helper.c                 |    4 +-
 target/i386/fpu_helper.c                  |   37 +-
 target/i386/gdbstub.c                     |    1 +
 target/i386/helper.c                      |    6 +-
 target/i386/helper.h                      |    1 +
 target/i386/hvf/hvf.c                     |  137 +-
 target/i386/hvf/vmx.h                     |   17 +-
 target/i386/kvm.c                         |   53 +-
 target/i386/kvm_i386.h                    |    1 +
 target/i386/machine.c                     |   31 +-
 target/i386/monitor.c                     |   10 +-
 target/i386/ops_sse.h                     |   28 +-
 target/i386/sev-stub.c                    |    3 +-
 target/i386/sev.c                         |   27 +-
 target/i386/sev_i386.h                    |    2 +-
 target/i386/svm.h                         |    1 +
 target/i386/svm_helper.c                  |    7 +-
 target/i386/tcg-stub.c                    |   25 +
 target/i386/translate.c                   |   36 +-
 tests/Makefile.include                    |    2 +-
 tests/qtest/qmp-cmd-test.c                |  109 +-
 tests/tcg/i386/Makefile.target            |    4 +
 tests/tcg/i386/test-i386-sse-exceptions.c |  813 ++++++++
 ui/cocoa.m                                |    1 +
 util/qemu-error.c                         |    7 +
 77 files changed, 8790 insertions(+), 7616 deletions(-)

diff --git a/Kconfig b/Kconfig
new file mode 100644
index 0000000000..bf694c42af
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,4 @@
+source Kconfig.host
+source backends/Kconfig
+source accel/Kconfig
+source hw/Kconfig
diff --git a/Kconfig.host b/Kconfig.host
index 55136e037d..a6d871c399 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -2,9 +2,6 @@
 # down to Kconfig.  See also MINIKCONF_ARGS in the Makefile:
 # these two need to be kept in sync.
 
-config KVM
-    bool
-
 config LINUX
     bool
 
@@ -31,10 +28,6 @@ config VHOST_KERNEL
     bool
     select VHOST
 
-config XEN
-    bool
-    select FSDEV_9P if VIRTFS
-
 config VIRTFS
     bool
 
diff --git a/MAINTAINERS b/MAINTAINERS
index 6aa54f7f8f..361ae5c662 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -115,7 +115,7 @@ Overall TCG CPUs
 M: Richard Henderson <rth@twiddle.net>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: cpus.c
+F: softmmu/cpus.c
 F: cpus-common.c
 F: exec.c
 F: accel/tcg/
@@ -362,7 +362,7 @@ Overall KVM CPUs
 M: Paolo Bonzini <pbonzini@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
-F: */kvm.*
+F: */*/kvm*
 F: accel/kvm/
 F: accel/stubs/kvm-stub.c
 F: include/hw/kvm/
@@ -416,8 +416,21 @@ S: Supported
 F: target/i386/kvm.c
 F: scripts/kvm/vmxcap
 
+Guest CPU Cores (other accelerators)
+------------------------------------
+Overall
+M: Richard Henderson <rth@twiddle.net>
+R: Paolo Bonzini <pbonzini@redhat.com>
+S: Maintained
+F: include/sysemu/accel.h
+F: accel/accel.c
+F: accel/Makefile.objs
+F: accel/stubs/Makefile.objs
+
 X86 HVF CPUs
+M: Cameron Esfahani <dirty@apple.com>
 M: Roman Bolshakov <r.bolshakov@yadro.com>
+W: https://wiki.qemu.org/Features/HVF
 S: Maintained
 F: accel/stubs/hvf-stub.c
 F: target/i386/hvf/
@@ -465,6 +478,7 @@ M: Colin Xu <colin.xu@intel.com>
 L: haxm-team@intel.com
 W: https://github.com/intel/haxm/issues
 S: Maintained
+F: accel/stubs/hax-stub.c
 F: include/sysemu/hax.h
 F: target/i386/hax-*
 
@@ -1710,7 +1724,7 @@ M: David Hildenbrand <david@redhat.com>
 S: Maintained
 F: hw/virtio/virtio-balloon*.c
 F: include/hw/virtio/virtio-balloon.h
-F: balloon.c
+F: softmmu/balloon.c
 F: include/sysemu/balloon.h
 
 virtio-9p
@@ -2189,12 +2203,12 @@ Memory API
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Supported
 F: include/exec/ioport.h
-F: ioport.c
 F: include/exec/memop.h
 F: include/exec/memory.h
 F: include/exec/ram_addr.h
 F: include/exec/ramblock.h
-F: memory.c
+F: softmmu/ioport.c
+F: softmmu/memory.c
 F: include/exec/memory-internal.h
 F: exec.c
 F: scripts/coccinelle/memory-region-housekeeping.cocci
@@ -2226,13 +2240,14 @@ F: ui/cocoa.m
 Main loop
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: cpus.c
 F: include/qemu/main-loop.h
 F: include/sysemu/runstate.h
 F: util/main-loop.c
 F: util/qemu-timer.c
 F: softmmu/vl.c
 F: softmmu/main.c
+F: softmmu/cpus.c
+F: softmmu/cpu-throttle.c
 F: qapi/run-state.json
 
 Human Monitor (HMP)
@@ -2387,7 +2402,7 @@ M: Thomas Huth <thuth@redhat.com>
 M: Laurent Vivier <lvivier@redhat.com>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
-F: qtest.c
+F: softmmu/qtest.c
 F: accel/qtest.c
 F: tests/qtest/
 X: tests/qtest/bios-tables-test-allowed-diff.h
diff --git a/Makefile b/Makefile
index b1b8a5a6d0..32345c610e 100644
--- a/Makefile
+++ b/Makefile
@@ -404,7 +404,8 @@ endif
 # This has to be kept in sync with Kconfig.host.
 MINIKCONF_ARGS = \
     $(CONFIG_MINIKCONF_MODE) \
-    $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \
+    $@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
+    CONFIG_TCG=$(CONFIG_TCG) \
     CONFIG_KVM=$(CONFIG_KVM) \
     CONFIG_SPICE=$(CONFIG_SPICE) \
     CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
@@ -418,12 +419,11 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
-MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
-MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
+MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py
 
-$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
-	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > $@.tmp, "GEN", "$@.tmp")
+$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
+	$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
+		> $@.tmp, "GEN", "$@.tmp")
 	$(call quiet-command, if test -f $@; then \
 	  if cmp -s $@.old $@; then \
 	    mv $@.tmp $@; \
diff --git a/Makefile.target b/Makefile.target
index 02bd9d7117..ffa2657269 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -152,16 +152,13 @@ endif #CONFIG_BSD_USER
 #########################################################
 # System emulator target
 ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
-obj-y += qtest.o
+obj-y += softmmu/
+obj-y += gdbstub.o
 obj-y += dump/
 obj-y += hw/
 obj-y += monitor/
 obj-y += qapi/
-obj-y += memory.o
-obj-y += memory_mapping.o
 obj-y += migration/ram.o
-obj-y += softmmu/
 LIBS := $(libs_softmmu) $(LIBS)
 
 # Hardware support
diff --git a/accel/Kconfig b/accel/Kconfig
new file mode 100644
index 0000000000..2ad94a3839
--- /dev/null
+++ b/accel/Kconfig
@@ -0,0 +1,9 @@
+config TCG
+    bool
+
+config KVM
+    bool
+
+config XEN
+    bool
+    select FSDEV_9P if VIRTFS
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 677191a69c..e4bbf997aa 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -22,3 +22,10 @@ void tb_flush(CPUState *cpu)
 void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 }
+
+void *probe_access(CPUArchState *env, target_ulong addr, int size,
+                   MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
+{
+     /* Handled by hardware accelerator. */
+     g_assert_not_reached();
+}
diff --git a/arch_init.c b/arch_init.c
deleted file mode 100644
index 8afea4748b..0000000000
--- a/arch_init.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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.
- */
-#include "qemu/osdep.h"
-#include "cpu.h"
-#include "sysemu/sysemu.h"
-#include "sysemu/arch_init.h"
-#include "hw/pci/pci.h"
-#include "hw/audio/soundhw.h"
-#include "qapi/error.h"
-#include "qemu/config-file.h"
-#include "qemu/error-report.h"
-#include "hw/acpi/acpi.h"
-#include "qemu/help_option.h"
-
-#ifdef TARGET_SPARC
-int graphic_width = 1024;
-int graphic_height = 768;
-int graphic_depth = 8;
-#elif defined(TARGET_M68K)
-int graphic_width = 800;
-int graphic_height = 600;
-int graphic_depth = 8;
-#else
-int graphic_width = 800;
-int graphic_height = 600;
-int graphic_depth = 32;
-#endif
-
-
-#if defined(TARGET_ALPHA)
-#define QEMU_ARCH QEMU_ARCH_ALPHA
-#elif defined(TARGET_ARM)
-#define QEMU_ARCH QEMU_ARCH_ARM
-#elif defined(TARGET_CRIS)
-#define QEMU_ARCH QEMU_ARCH_CRIS
-#elif defined(TARGET_HPPA)
-#define QEMU_ARCH QEMU_ARCH_HPPA
-#elif defined(TARGET_I386)
-#define QEMU_ARCH QEMU_ARCH_I386
-#elif defined(TARGET_LM32)
-#define QEMU_ARCH QEMU_ARCH_LM32
-#elif defined(TARGET_M68K)
-#define QEMU_ARCH QEMU_ARCH_M68K
-#elif defined(TARGET_MICROBLAZE)
-#define QEMU_ARCH QEMU_ARCH_MICROBLAZE
-#elif defined(TARGET_MIPS)
-#define QEMU_ARCH QEMU_ARCH_MIPS
-#elif defined(TARGET_MOXIE)
-#define QEMU_ARCH QEMU_ARCH_MOXIE
-#elif defined(TARGET_NIOS2)
-#define QEMU_ARCH QEMU_ARCH_NIOS2
-#elif defined(TARGET_OPENRISC)
-#define QEMU_ARCH QEMU_ARCH_OPENRISC
-#elif defined(TARGET_PPC)
-#define QEMU_ARCH QEMU_ARCH_PPC
-#elif defined(TARGET_RISCV)
-#define QEMU_ARCH QEMU_ARCH_RISCV
-#elif defined(TARGET_RX)
-#define QEMU_ARCH QEMU_ARCH_RX
-#elif defined(TARGET_S390X)
-#define QEMU_ARCH QEMU_ARCH_S390X
-#elif defined(TARGET_SH4)
-#define QEMU_ARCH QEMU_ARCH_SH4
-#elif defined(TARGET_SPARC)
-#define QEMU_ARCH QEMU_ARCH_SPARC
-#elif defined(TARGET_TRICORE)
-#define QEMU_ARCH QEMU_ARCH_TRICORE
-#elif defined(TARGET_UNICORE32)
-#define QEMU_ARCH QEMU_ARCH_UNICORE32
-#elif defined(TARGET_XTENSA)
-#define QEMU_ARCH QEMU_ARCH_XTENSA
-#endif
-
-const uint32_t arch_type = QEMU_ARCH;
-
-int kvm_available(void)
-{
-#ifdef CONFIG_KVM
-    return 1;
-#else
-    return 0;
-#endif
-}
-
-int xen_available(void)
-{
-#ifdef CONFIG_XEN
-    return 1;
-#else
-    return 0;
-#endif
-}
diff --git a/balloon.c b/balloon.c
deleted file mode 100644
index 354408c6ea..0000000000
--- a/balloon.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Generic Balloon handlers and management
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (C) 2011 Red Hat, Inc.
- * Copyright (C) 2011 Amit Shah <amit.shah@redhat.com>
- *
- * 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.
- */
-
-#include "qemu/osdep.h"
-#include "qemu/atomic.h"
-#include "sysemu/kvm.h"
-#include "sysemu/balloon.h"
-#include "trace-root.h"
-#include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qmp/qerror.h"
-
-static QEMUBalloonEvent *balloon_event_fn;
-static QEMUBalloonStatus *balloon_stat_fn;
-static void *balloon_opaque;
-
-static bool have_balloon(Error **errp)
-{
-    if (kvm_enabled() && !kvm_has_sync_mmu()) {
-        error_set(errp, ERROR_CLASS_KVM_MISSING_CAP,
-                  "Using KVM without synchronous MMU, balloon unavailable");
-        return false;
-    }
-    if (!balloon_event_fn) {
-        error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
-                  "No balloon device has been activated");
-        return false;
-    }
-    return true;
-}
-
-int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
-                             QEMUBalloonStatus *stat_func, void *opaque)
-{
-    if (balloon_event_fn || balloon_stat_fn || balloon_opaque) {
-        /* We're already registered one balloon handler.  How many can
-         * a guest really have?
-         */
-        return -1;
-    }
-    balloon_event_fn = event_func;
-    balloon_stat_fn = stat_func;
-    balloon_opaque = opaque;
-    return 0;
-}
-
-void qemu_remove_balloon_handler(void *opaque)
-{
-    if (balloon_opaque != opaque) {
-        return;
-    }
-    balloon_event_fn = NULL;
-    balloon_stat_fn = NULL;
-    balloon_opaque = NULL;
-}
-
-BalloonInfo *qmp_query_balloon(Error **errp)
-{
-    BalloonInfo *info;
-
-    if (!have_balloon(errp)) {
-        return NULL;
-    }
-
-    info = g_malloc0(sizeof(*info));
-    balloon_stat_fn(balloon_opaque, info);
-    return info;
-}
-
-void qmp_balloon(int64_t target, Error **errp)
-{
-    if (!have_balloon(errp)) {
-        return;
-    }
-
-    if (target <= 0) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
-        return;
-    }
-
-    trace_balloon_event(balloon_opaque, target);
-    balloon_event_fn(balloon_opaque, target);
-}
diff --git a/block/iscsi.c b/block/iscsi.c
index 6c2e353e1a..bd2122a3a4 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -241,9 +241,11 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
 
     iTask->status = status;
     iTask->do_retry = 0;
+    iTask->err_code = 0;
     iTask->task = task;
 
     if (status != SCSI_STATUS_GOOD) {
+        iTask->err_code = -EIO;
         if (iTask->retries++ < ISCSI_CMD_RETRIES) {
             if (status == SCSI_STATUS_BUSY ||
                 status == SCSI_STATUS_TIMEOUT ||
@@ -266,16 +268,16 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
                 timer_mod(&iTask->retry_timer,
                           qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
                 iTask->do_retry = 1;
-            }
-        } else if (status == SCSI_STATUS_CHECK_CONDITION) {
-            int error = iscsi_translate_sense(&task->sense);
-            if (error == EAGAIN) {
-                error_report("iSCSI CheckCondition: %s",
-                             iscsi_get_error(iscsi));
-                iTask->do_retry = 1;
-            } else {
-                iTask->err_code = -error;
-                iTask->err_str = g_strdup(iscsi_get_error(iscsi));
+            } else if (status == SCSI_STATUS_CHECK_CONDITION) {
+                int error = iscsi_translate_sense(&task->sense);
+                if (error == EAGAIN) {
+                    error_report("iSCSI CheckCondition: %s",
+                                 iscsi_get_error(iscsi));
+                    iTask->do_retry = 1;
+                } else {
+                    iTask->err_code = -error;
+                    iTask->err_str = g_strdup(iscsi_get_error(iscsi));
+                }
             }
         }
     }
diff --git a/cpus-common.c b/cpus-common.c
index 8f5512b3d7..34044f4e4c 100644
--- a/cpus-common.c
+++ b/cpus-common.c
@@ -72,6 +72,8 @@ static int cpu_get_free_index(void)
     return max_cpu_index;
 }
 
+CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
+
 void cpu_list_add(CPUState *cpu)
 {
     QEMU_LOCK_GUARD(&qemu_cpu_list_lock);
@@ -96,6 +98,22 @@ void cpu_list_remove(CPUState *cpu)
     cpu->cpu_index = UNASSIGNED_CPU_INDEX;
 }
 
+CPUState *qemu_get_cpu(int index)
+{
+    CPUState *cpu;
+
+    CPU_FOREACH(cpu) {
+        if (cpu->cpu_index == index) {
+            return cpu;
+        }
+    }
+
+    return NULL;
+}
+
+/* current CPU in the current thread. It is only valid inside cpu_exec() */
+__thread CPUState *current_cpu;
+
 struct qemu_work_item {
     QSIMPLEQ_ENTRY(qemu_work_item) node;
     run_on_cpu_func func;
diff --git a/cpus.c b/cpus.c
deleted file mode 100644
index 41d1c5099f..0000000000
--- a/cpus.c
+++ /dev/null
@@ -1,2329 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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.
- */
-
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-#include "qemu/config-file.h"
-#include "qemu/cutils.h"
-#include "migration/vmstate.h"
-#include "monitor/monitor.h"
-#include "qapi/error.h"
-#include "qapi/qapi-commands-misc.h"
-#include "qapi/qapi-events-run-state.h"
-#include "qapi/qmp/qerror.h"
-#include "qemu/error-report.h"
-#include "qemu/qemu-print.h"
-#include "sysemu/tcg.h"
-#include "sysemu/block-backend.h"
-#include "exec/gdbstub.h"
-#include "sysemu/dma.h"
-#include "sysemu/hw_accel.h"
-#include "sysemu/kvm.h"
-#include "sysemu/hax.h"
-#include "sysemu/hvf.h"
-#include "sysemu/whpx.h"
-#include "exec/exec-all.h"
-
-#include "qemu/thread.h"
-#include "qemu/plugin.h"
-#include "sysemu/cpus.h"
-#include "sysemu/qtest.h"
-#include "qemu/main-loop.h"
-#include "qemu/option.h"
-#include "qemu/bitmap.h"
-#include "qemu/seqlock.h"
-#include "qemu/guest-random.h"
-#include "tcg/tcg.h"
-#include "hw/nmi.h"
-#include "sysemu/replay.h"
-#include "sysemu/runstate.h"
-#include "hw/boards.h"
-#include "hw/hw.h"
-
-#ifdef CONFIG_LINUX
-
-#include <sys/prctl.h>
-
-#ifndef PR_MCE_KILL
-#define PR_MCE_KILL 33
-#endif
-
-#ifndef PR_MCE_KILL_SET
-#define PR_MCE_KILL_SET 1
-#endif
-
-#ifndef PR_MCE_KILL_EARLY
-#define PR_MCE_KILL_EARLY 1
-#endif
-
-#endif /* CONFIG_LINUX */
-
-static QemuMutex qemu_global_mutex;
-
-int64_t max_delay;
-int64_t max_advance;
-
-/* vcpu throttling controls */
-static QEMUTimer *throttle_timer;
-static unsigned int throttle_percentage;
-
-#define CPU_THROTTLE_PCT_MIN 1
-#define CPU_THROTTLE_PCT_MAX 99
-#define CPU_THROTTLE_TIMESLICE_NS 10000000
-
-bool cpu_is_stopped(CPUState *cpu)
-{
-    return cpu->stopped || !runstate_is_running();
-}
-
-static inline bool cpu_work_list_empty(CPUState *cpu)
-{
-    bool ret;
-
-    qemu_mutex_lock(&cpu->work_mutex);
-    ret = QSIMPLEQ_EMPTY(&cpu->work_list);
-    qemu_mutex_unlock(&cpu->work_mutex);
-    return ret;
-}
-
-static bool cpu_thread_is_idle(CPUState *cpu)
-{
-    if (cpu->stop || !cpu_work_list_empty(cpu)) {
-        return false;
-    }
-    if (cpu_is_stopped(cpu)) {
-        return true;
-    }
-    if (!cpu->halted || cpu_has_work(cpu) ||
-        kvm_halt_in_kernel()) {
-        return false;
-    }
-    return true;
-}
-
-static bool all_cpu_threads_idle(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (!cpu_thread_is_idle(cpu)) {
-            return false;
-        }
-    }
-    return true;
-}
-
-/***********************************************************/
-/* guest cycle counter */
-
-/* Protected by TimersState seqlock */
-
-static bool icount_sleep = true;
-/* Arbitrarily pick 1MIPS as the minimum allowable speed.  */
-#define MAX_ICOUNT_SHIFT 10
-
-typedef struct TimersState {
-    /* Protected by BQL.  */
-    int64_t cpu_ticks_prev;
-    int64_t cpu_ticks_offset;
-
-    /* Protect fields that can be respectively read outside the
-     * BQL, and written from multiple threads.
-     */
-    QemuSeqLock vm_clock_seqlock;
-    QemuSpin vm_clock_lock;
-
-    int16_t cpu_ticks_enabled;
-
-    /* Conversion factor from emulated instructions to virtual clock ticks.  */
-    int16_t icount_time_shift;
-
-    /* Compensate for varying guest execution speed.  */
-    int64_t qemu_icount_bias;
-
-    int64_t vm_clock_warp_start;
-    int64_t cpu_clock_offset;
-
-    /* Only written by TCG thread */
-    int64_t qemu_icount;
-
-    /* for adjusting icount */
-    QEMUTimer *icount_rt_timer;
-    QEMUTimer *icount_vm_timer;
-    QEMUTimer *icount_warp_timer;
-} TimersState;
-
-static TimersState timers_state;
-bool mttcg_enabled;
-
-
-/* The current number of executed instructions is based on what we
- * originally budgeted minus the current state of the decrementing
- * icount counters in extra/u16.low.
- */
-static int64_t cpu_get_icount_executed(CPUState *cpu)
-{
-    return (cpu->icount_budget -
-            (cpu_neg(cpu)->icount_decr.u16.low + cpu->icount_extra));
-}
-
-/*
- * Update the global shared timer_state.qemu_icount to take into
- * account executed instructions. This is done by the TCG vCPU
- * thread so the main-loop can see time has moved forward.
- */
-static void cpu_update_icount_locked(CPUState *cpu)
-{
-    int64_t executed = cpu_get_icount_executed(cpu);
-    cpu->icount_budget -= executed;
-
-    atomic_set_i64(&timers_state.qemu_icount,
-                   timers_state.qemu_icount + executed);
-}
-
-/*
- * Update the global shared timer_state.qemu_icount to take into
- * account executed instructions. This is done by the TCG vCPU
- * thread so the main-loop can see time has moved forward.
- */
-void cpu_update_icount(CPUState *cpu)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    cpu_update_icount_locked(cpu);
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-static int64_t cpu_get_icount_raw_locked(void)
-{
-    CPUState *cpu = current_cpu;
-
-    if (cpu && cpu->running) {
-        if (!cpu->can_do_io) {
-            error_report("Bad icount read");
-            exit(1);
-        }
-        /* Take into account what has run */
-        cpu_update_icount_locked(cpu);
-    }
-    /* The read is protected by the seqlock, but needs atomic64 to avoid UB */
-    return atomic_read_i64(&timers_state.qemu_icount);
-}
-
-static int64_t cpu_get_icount_locked(void)
-{
-    int64_t icount = cpu_get_icount_raw_locked();
-    return atomic_read_i64(&timers_state.qemu_icount_bias) +
-        cpu_icount_to_ns(icount);
-}
-
-int64_t cpu_get_icount_raw(void)
-{
-    int64_t icount;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        icount = cpu_get_icount_raw_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return icount;
-}
-
-/* Return the virtual CPU time, based on the instruction counter.  */
-int64_t cpu_get_icount(void)
-{
-    int64_t icount;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        icount = cpu_get_icount_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return icount;
-}
-
-int64_t cpu_icount_to_ns(int64_t icount)
-{
-    return icount << atomic_read(&timers_state.icount_time_shift);
-}
-
-static int64_t cpu_get_ticks_locked(void)
-{
-    int64_t ticks = timers_state.cpu_ticks_offset;
-    if (timers_state.cpu_ticks_enabled) {
-        ticks += cpu_get_host_ticks();
-    }
-
-    if (timers_state.cpu_ticks_prev > ticks) {
-        /* Non increasing ticks may happen if the host uses software suspend.  */
-        timers_state.cpu_ticks_offset += timers_state.cpu_ticks_prev - ticks;
-        ticks = timers_state.cpu_ticks_prev;
-    }
-
-    timers_state.cpu_ticks_prev = ticks;
-    return ticks;
-}
-
-/* return the time elapsed in VM between vm_start and vm_stop.  Unless
- * icount is active, cpu_get_ticks() uses units of the host CPU cycle
- * counter.
- */
-int64_t cpu_get_ticks(void)
-{
-    int64_t ticks;
-
-    if (use_icount) {
-        return cpu_get_icount();
-    }
-
-    qemu_spin_lock(&timers_state.vm_clock_lock);
-    ticks = cpu_get_ticks_locked();
-    qemu_spin_unlock(&timers_state.vm_clock_lock);
-    return ticks;
-}
-
-static int64_t cpu_get_clock_locked(void)
-{
-    int64_t time;
-
-    time = timers_state.cpu_clock_offset;
-    if (timers_state.cpu_ticks_enabled) {
-        time += get_clock();
-    }
-
-    return time;
-}
-
-/* Return the monotonic time elapsed in VM, i.e.,
- * the time between vm_start and vm_stop
- */
-int64_t cpu_get_clock(void)
-{
-    int64_t ti;
-    unsigned start;
-
-    do {
-        start = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        ti = cpu_get_clock_locked();
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start));
-
-    return ti;
-}
-
-/* enable cpu_get_ticks()
- * Caller must hold BQL which serves as mutex for vm_clock_seqlock.
- */
-void cpu_enable_ticks(void)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (!timers_state.cpu_ticks_enabled) {
-        timers_state.cpu_ticks_offset -= cpu_get_host_ticks();
-        timers_state.cpu_clock_offset -= get_clock();
-        timers_state.cpu_ticks_enabled = 1;
-    }
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-}
-
-/* disable cpu_get_ticks() : the clock is stopped. You must not call
- * cpu_get_ticks() after that.
- * Caller must hold BQL which serves as mutex for vm_clock_seqlock.
- */
-void cpu_disable_ticks(void)
-{
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (timers_state.cpu_ticks_enabled) {
-        timers_state.cpu_ticks_offset += cpu_get_host_ticks();
-        timers_state.cpu_clock_offset = cpu_get_clock_locked();
-        timers_state.cpu_ticks_enabled = 0;
-    }
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-/* Correlation between real and virtual time is always going to be
-   fairly approximate, so ignore small variation.
-   When the guest is idle real and virtual time will be aligned in
-   the IO wait loop.  */
-#define ICOUNT_WOBBLE (NANOSECONDS_PER_SECOND / 10)
-
-static void icount_adjust(void)
-{
-    int64_t cur_time;
-    int64_t cur_icount;
-    int64_t delta;
-
-    /* Protected by TimersState mutex.  */
-    static int64_t last_delta;
-
-    /* If the VM is not running, then do nothing.  */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    cur_time = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
-                                   cpu_get_clock_locked());
-    cur_icount = cpu_get_icount_locked();
-
-    delta = cur_icount - cur_time;
-    /* FIXME: This is a very crude algorithm, somewhat prone to oscillation.  */
-    if (delta > 0
-        && last_delta + ICOUNT_WOBBLE < delta * 2
-        && timers_state.icount_time_shift > 0) {
-        /* The guest is getting too far ahead.  Slow time down.  */
-        atomic_set(&timers_state.icount_time_shift,
-                   timers_state.icount_time_shift - 1);
-    }
-    if (delta < 0
-        && last_delta - ICOUNT_WOBBLE > delta * 2
-        && timers_state.icount_time_shift < MAX_ICOUNT_SHIFT) {
-        /* The guest is getting too far behind.  Speed time up.  */
-        atomic_set(&timers_state.icount_time_shift,
-                   timers_state.icount_time_shift + 1);
-    }
-    last_delta = delta;
-    atomic_set_i64(&timers_state.qemu_icount_bias,
-                   cur_icount - (timers_state.qemu_icount
-                                 << timers_state.icount_time_shift));
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                         &timers_state.vm_clock_lock);
-}
-
-static void icount_adjust_rt(void *opaque)
-{
-    timer_mod(timers_state.icount_rt_timer,
-              qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
-    icount_adjust();
-}
-
-static void icount_adjust_vm(void *opaque)
-{
-    timer_mod(timers_state.icount_vm_timer,
-                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
-                   NANOSECONDS_PER_SECOND / 10);
-    icount_adjust();
-}
-
-static int64_t qemu_icount_round(int64_t count)
-{
-    int shift = atomic_read(&timers_state.icount_time_shift);
-    return (count + (1 << shift) - 1) >> shift;
-}
-
-static void icount_warp_rt(void)
-{
-    unsigned seq;
-    int64_t warp_start;
-
-    /* The icount_warp_timer is rescheduled soon after vm_clock_warp_start
-     * changes from -1 to another value, so the race here is okay.
-     */
-    do {
-        seq = seqlock_read_begin(&timers_state.vm_clock_seqlock);
-        warp_start = timers_state.vm_clock_warp_start;
-    } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, seq));
-
-    if (warp_start == -1) {
-        return;
-    }
-
-    seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-    if (runstate_is_running()) {
-        int64_t clock = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
-                                            cpu_get_clock_locked());
-        int64_t warp_delta;
-
-        warp_delta = clock - timers_state.vm_clock_warp_start;
-        if (use_icount == 2) {
-            /*
-             * In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too
-             * far ahead of real time.
-             */
-            int64_t cur_icount = cpu_get_icount_locked();
-            int64_t delta = clock - cur_icount;
-            warp_delta = MIN(warp_delta, delta);
-        }
-        atomic_set_i64(&timers_state.qemu_icount_bias,
-                       timers_state.qemu_icount_bias + warp_delta);
-    }
-    timers_state.vm_clock_warp_start = -1;
-    seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                       &timers_state.vm_clock_lock);
-
-    if (qemu_clock_expired(QEMU_CLOCK_VIRTUAL)) {
-        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    }
-}
-
-static void icount_timer_cb(void *opaque)
-{
-    /* No need for a checkpoint because the timer already synchronizes
-     * with CHECKPOINT_CLOCK_VIRTUAL_RT.
-     */
-    icount_warp_rt();
-}
-
-void qtest_clock_warp(int64_t dest)
-{
-    int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    AioContext *aio_context;
-    assert(qtest_enabled());
-    aio_context = qemu_get_aio_context();
-    while (clock < dest) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                                      QEMU_TIMER_ATTR_ALL);
-        int64_t warp = qemu_soonest_timeout(dest - clock, deadline);
-
-        seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                           &timers_state.vm_clock_lock);
-        atomic_set_i64(&timers_state.qemu_icount_bias,
-                       timers_state.qemu_icount_bias + warp);
-        seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                             &timers_state.vm_clock_lock);
-
-        qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
-        timerlist_run_timers(aio_context->tlg.tl[QEMU_CLOCK_VIRTUAL]);
-        clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    }
-    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-}
-
-void qemu_start_warp_timer(void)
-{
-    int64_t clock;
-    int64_t deadline;
-
-    if (!use_icount) {
-        return;
-    }
-
-    /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
-     * do not fire, so computing the deadline does not make sense.
-     */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    if (replay_mode != REPLAY_MODE_PLAY) {
-        if (!all_cpu_threads_idle()) {
-            return;
-        }
-
-        if (qtest_enabled()) {
-            /* When testing, qtest commands advance icount.  */
-            return;
-        }
-
-        replay_checkpoint(CHECKPOINT_CLOCK_WARP_START);
-    } else {
-        /* warp clock deterministically in record/replay mode */
-        if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_START)) {
-            /* vCPU is sleeping and warp can't be started.
-               It is probably a race condition: notification sent
-               to vCPU was processed in advance and vCPU went to sleep.
-               Therefore we have to wake it up for doing someting. */
-            if (replay_has_checkpoint()) {
-                qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-            }
-            return;
-        }
-    }
-
-    /* We want to use the earliest deadline from ALL vm_clocks */
-    clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
-    deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                          ~QEMU_TIMER_ATTR_EXTERNAL);
-    if (deadline < 0) {
-        static bool notified;
-        if (!icount_sleep && !notified) {
-            warn_report("icount sleep disabled and no active timers");
-            notified = true;
-        }
-        return;
-    }
-
-    if (deadline > 0) {
-        /*
-         * Ensure QEMU_CLOCK_VIRTUAL proceeds even when the virtual CPU goes to
-         * sleep.  Otherwise, the CPU might be waiting for a future timer
-         * interrupt to wake it up, but the interrupt never comes because
-         * the vCPU isn't running any insns and thus doesn't advance the
-         * QEMU_CLOCK_VIRTUAL.
-         */
-        if (!icount_sleep) {
-            /*
-             * We never let VCPUs sleep in no sleep icount mode.
-             * If there is a pending QEMU_CLOCK_VIRTUAL timer we just advance
-             * to the next QEMU_CLOCK_VIRTUAL event and notify it.
-             * It is useful when we want a deterministic execution time,
-             * isolated from host latencies.
-             */
-            seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                               &timers_state.vm_clock_lock);
-            atomic_set_i64(&timers_state.qemu_icount_bias,
-                           timers_state.qemu_icount_bias + deadline);
-            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                                 &timers_state.vm_clock_lock);
-            qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-        } else {
-            /*
-             * We do stop VCPUs and only advance QEMU_CLOCK_VIRTUAL after some
-             * "real" time, (related to the time left until the next event) has
-             * passed. The QEMU_CLOCK_VIRTUAL_RT clock will do this.
-             * This avoids that the warps are visible externally; for example,
-             * you will not be sending network packets continuously instead of
-             * every 100ms.
-             */
-            seqlock_write_lock(&timers_state.vm_clock_seqlock,
-                               &timers_state.vm_clock_lock);
-            if (timers_state.vm_clock_warp_start == -1
-                || timers_state.vm_clock_warp_start > clock) {
-                timers_state.vm_clock_warp_start = clock;
-            }
-            seqlock_write_unlock(&timers_state.vm_clock_seqlock,
-                                 &timers_state.vm_clock_lock);
-            timer_mod_anticipate(timers_state.icount_warp_timer,
-                                 clock + deadline);
-        }
-    } else if (deadline == 0) {
-        qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    }
-}
-
-static void qemu_account_warp_timer(void)
-{
-    if (!use_icount || !icount_sleep) {
-        return;
-    }
-
-    /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
-     * do not fire, so computing the deadline does not make sense.
-     */
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    /* warp clock deterministically in record/replay mode */
-    if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_ACCOUNT)) {
-        return;
-    }
-
-    timer_del(timers_state.icount_warp_timer);
-    icount_warp_rt();
-}
-
-static bool icount_state_needed(void *opaque)
-{
-    return use_icount;
-}
-
-static bool warp_timer_state_needed(void *opaque)
-{
-    TimersState *s = opaque;
-    return s->icount_warp_timer != NULL;
-}
-
-static bool adjust_timers_state_needed(void *opaque)
-{
-    TimersState *s = opaque;
-    return s->icount_rt_timer != NULL;
-}
-
-static bool shift_state_needed(void *opaque)
-{
-    return use_icount == 2;
-}
-
-/*
- * Subsection for warp timer migration is optional, because may not be created
- */
-static const VMStateDescription icount_vmstate_warp_timer = {
-    .name = "timer/icount/warp_timer",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = warp_timer_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(vm_clock_warp_start, TimersState),
-        VMSTATE_TIMER_PTR(icount_warp_timer, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-static const VMStateDescription icount_vmstate_adjust_timers = {
-    .name = "timer/icount/timers",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = adjust_timers_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_TIMER_PTR(icount_rt_timer, TimersState),
-        VMSTATE_TIMER_PTR(icount_vm_timer, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-static const VMStateDescription icount_vmstate_shift = {
-    .name = "timer/icount/shift",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = shift_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT16(icount_time_shift, TimersState),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
-/*
- * This is a subsection for icount migration.
- */
-static const VMStateDescription icount_vmstate_timers = {
-    .name = "timer/icount",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .needed = icount_state_needed,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(qemu_icount_bias, TimersState),
-        VMSTATE_INT64(qemu_icount, TimersState),
-        VMSTATE_END_OF_LIST()
-    },
-    .subsections = (const VMStateDescription*[]) {
-        &icount_vmstate_warp_timer,
-        &icount_vmstate_adjust_timers,
-        &icount_vmstate_shift,
-        NULL
-    }
-};
-
-static const VMStateDescription vmstate_timers = {
-    .name = "timer",
-    .version_id = 2,
-    .minimum_version_id = 1,
-    .fields = (VMStateField[]) {
-        VMSTATE_INT64(cpu_ticks_offset, TimersState),
-        VMSTATE_UNUSED(8),
-        VMSTATE_INT64_V(cpu_clock_offset, TimersState, 2),
-        VMSTATE_END_OF_LIST()
-    },
-    .subsections = (const VMStateDescription*[]) {
-        &icount_vmstate_timers,
-        NULL
-    }
-};
-
-static void cpu_throttle_thread(CPUState *cpu, run_on_cpu_data opaque)
-{
-    double pct;
-    double throttle_ratio;
-    int64_t sleeptime_ns, endtime_ns;
-
-    if (!cpu_throttle_get_percentage()) {
-        return;
-    }
-
-    pct = (double)cpu_throttle_get_percentage()/100;
-    throttle_ratio = pct / (1 - pct);
-    /* Add 1ns to fix double's rounding error (like 0.9999999...) */
-    sleeptime_ns = (int64_t)(throttle_ratio * CPU_THROTTLE_TIMESLICE_NS + 1);
-    endtime_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + sleeptime_ns;
-    while (sleeptime_ns > 0 && !cpu->stop) {
-        if (sleeptime_ns > SCALE_MS) {
-            qemu_cond_timedwait(cpu->halt_cond, &qemu_global_mutex,
-                                sleeptime_ns / SCALE_MS);
-        } else {
-            qemu_mutex_unlock_iothread();
-            g_usleep(sleeptime_ns / SCALE_US);
-            qemu_mutex_lock_iothread();
-        }
-        sleeptime_ns = endtime_ns - qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
-    }
-    atomic_set(&cpu->throttle_thread_scheduled, 0);
-}
-
-static void cpu_throttle_timer_tick(void *opaque)
-{
-    CPUState *cpu;
-    double pct;
-
-    /* Stop the timer if needed */
-    if (!cpu_throttle_get_percentage()) {
-        return;
-    }
-    CPU_FOREACH(cpu) {
-        if (!atomic_xchg(&cpu->throttle_thread_scheduled, 1)) {
-            async_run_on_cpu(cpu, cpu_throttle_thread,
-                             RUN_ON_CPU_NULL);
-        }
-    }
-
-    pct = (double)cpu_throttle_get_percentage()/100;
-    timer_mod(throttle_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT) +
-                                   CPU_THROTTLE_TIMESLICE_NS / (1-pct));
-}
-
-void cpu_throttle_set(int new_throttle_pct)
-{
-    /* Ensure throttle percentage is within valid range */
-    new_throttle_pct = MIN(new_throttle_pct, CPU_THROTTLE_PCT_MAX);
-    new_throttle_pct = MAX(new_throttle_pct, CPU_THROTTLE_PCT_MIN);
-
-    atomic_set(&throttle_percentage, new_throttle_pct);
-
-    timer_mod(throttle_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT) +
-                                       CPU_THROTTLE_TIMESLICE_NS);
-}
-
-void cpu_throttle_stop(void)
-{
-    atomic_set(&throttle_percentage, 0);
-}
-
-bool cpu_throttle_active(void)
-{
-    return (cpu_throttle_get_percentage() != 0);
-}
-
-int cpu_throttle_get_percentage(void)
-{
-    return atomic_read(&throttle_percentage);
-}
-
-void cpu_ticks_init(void)
-{
-    seqlock_init(&timers_state.vm_clock_seqlock);
-    qemu_spin_init(&timers_state.vm_clock_lock);
-    vmstate_register(NULL, 0, &vmstate_timers, &timers_state);
-    throttle_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                           cpu_throttle_timer_tick, NULL);
-}
-
-void configure_icount(QemuOpts *opts, Error **errp)
-{
-    const char *option = qemu_opt_get(opts, "shift");
-    bool sleep = qemu_opt_get_bool(opts, "sleep", true);
-    bool align = qemu_opt_get_bool(opts, "align", false);
-    long time_shift = -1;
-
-    if (!option) {
-        if (qemu_opt_get(opts, "align") != NULL) {
-            error_setg(errp, "Please specify shift option when using align");
-        }
-        return;
-    }
-
-    if (align && !sleep) {
-        error_setg(errp, "align=on and sleep=off are incompatible");
-        return;
-    }
-
-    if (strcmp(option, "auto") != 0) {
-        if (qemu_strtol(option, NULL, 0, &time_shift) < 0
-            || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
-            error_setg(errp, "icount: Invalid shift value");
-            return;
-        }
-    } else if (icount_align_option) {
-        error_setg(errp, "shift=auto and align=on are incompatible");
-        return;
-    } else if (!icount_sleep) {
-        error_setg(errp, "shift=auto and sleep=off are incompatible");
-        return;
-    }
-
-    icount_sleep = sleep;
-    if (icount_sleep) {
-        timers_state.icount_warp_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL_RT,
-                                         icount_timer_cb, NULL);
-    }
-
-    icount_align_option = align;
-
-    if (time_shift >= 0) {
-        timers_state.icount_time_shift = time_shift;
-        use_icount = 1;
-        return;
-    }
-
-    use_icount = 2;
-
-    /* 125MIPS seems a reasonable initial guess at the guest speed.
-       It will be corrected fairly quickly anyway.  */
-    timers_state.icount_time_shift = 3;
-
-    /* Have both realtime and virtual time triggers for speed adjustment.
-       The realtime trigger catches emulated time passing too slowly,
-       the virtual time trigger catches emulated time passing too fast.
-       Realtime triggers occur even when idle, so use them less frequently
-       than VM triggers.  */
-    timers_state.vm_clock_warp_start = -1;
-    timers_state.icount_rt_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL_RT,
-                                   icount_adjust_rt, NULL);
-    timer_mod(timers_state.icount_rt_timer,
-                   qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000);
-    timers_state.icount_vm_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
-                                        icount_adjust_vm, NULL);
-    timer_mod(timers_state.icount_vm_timer,
-                   qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
-                   NANOSECONDS_PER_SECOND / 10);
-}
-
-/***********************************************************/
-/* TCG vCPU kick timer
- *
- * The kick timer is responsible for moving single threaded vCPU
- * emulation on to the next vCPU. If more than one vCPU is running a
- * timer event with force a cpu->exit so the next vCPU can get
- * scheduled.
- *
- * The timer is removed if all vCPUs are idle and restarted again once
- * idleness is complete.
- */
-
-static QEMUTimer *tcg_kick_vcpu_timer;
-static CPUState *tcg_current_rr_cpu;
-
-#define TCG_KICK_PERIOD (NANOSECONDS_PER_SECOND / 10)
-
-static inline int64_t qemu_tcg_next_kick(void)
-{
-    return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + TCG_KICK_PERIOD;
-}
-
-/* Kick the currently round-robin scheduled vCPU to next */
-static void qemu_cpu_kick_rr_next_cpu(void)
-{
-    CPUState *cpu;
-    do {
-        cpu = atomic_mb_read(&tcg_current_rr_cpu);
-        if (cpu) {
-            cpu_exit(cpu);
-        }
-    } while (cpu != atomic_mb_read(&tcg_current_rr_cpu));
-}
-
-/* Kick all RR vCPUs */
-static void qemu_cpu_kick_rr_cpus(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_exit(cpu);
-    };
-}
-
-static void do_nothing(CPUState *cpu, run_on_cpu_data unused)
-{
-}
-
-void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
-{
-    if (!use_icount || type != QEMU_CLOCK_VIRTUAL) {
-        qemu_notify_event();
-        return;
-    }
-
-    if (qemu_in_vcpu_thread()) {
-        /* A CPU is currently running; kick it back out to the
-         * tcg_cpu_exec() loop so it will recalculate its
-         * icount deadline immediately.
-         */
-        qemu_cpu_kick(current_cpu);
-    } else if (first_cpu) {
-        /* qemu_cpu_kick is not enough to kick a halted CPU out of
-         * qemu_tcg_wait_io_event.  async_run_on_cpu, instead,
-         * causes cpu_thread_is_idle to return false.  This way,
-         * handle_icount_deadline can run.
-         * If we have no CPUs at all for some reason, we don't
-         * need to do anything.
-         */
-        async_run_on_cpu(first_cpu, do_nothing, RUN_ON_CPU_NULL);
-    }
-}
-
-static void kick_tcg_thread(void *opaque)
-{
-    timer_mod(tcg_kick_vcpu_timer, qemu_tcg_next_kick());
-    qemu_cpu_kick_rr_next_cpu();
-}
-
-static void start_tcg_kick_timer(void)
-{
-    assert(!mttcg_enabled);
-    if (!tcg_kick_vcpu_timer && CPU_NEXT(first_cpu)) {
-        tcg_kick_vcpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
-                                           kick_tcg_thread, NULL);
-    }
-    if (tcg_kick_vcpu_timer && !timer_pending(tcg_kick_vcpu_timer)) {
-        timer_mod(tcg_kick_vcpu_timer, qemu_tcg_next_kick());
-    }
-}
-
-static void stop_tcg_kick_timer(void)
-{
-    assert(!mttcg_enabled);
-    if (tcg_kick_vcpu_timer && timer_pending(tcg_kick_vcpu_timer)) {
-        timer_del(tcg_kick_vcpu_timer);
-    }
-}
-
-/***********************************************************/
-void hw_error(const char *fmt, ...)
-{
-    va_list ap;
-    CPUState *cpu;
-
-    va_start(ap, fmt);
-    fprintf(stderr, "qemu: hardware error: ");
-    vfprintf(stderr, fmt, ap);
-    fprintf(stderr, "\n");
-    CPU_FOREACH(cpu) {
-        fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
-        cpu_dump_state(cpu, stderr, CPU_DUMP_FPU);
-    }
-    va_end(ap);
-    abort();
-}
-
-void cpu_synchronize_all_states(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_state(cpu);
-        /* TODO: move to cpu_synchronize_state() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_state(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_post_reset(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_post_reset(cpu);
-        /* TODO: move to cpu_synchronize_post_reset() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_post_reset(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_post_init(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_post_init(cpu);
-        /* TODO: move to cpu_synchronize_post_init() */
-        if (hvf_enabled()) {
-            hvf_cpu_synchronize_post_init(cpu);
-        }
-    }
-}
-
-void cpu_synchronize_all_pre_loadvm(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        cpu_synchronize_pre_loadvm(cpu);
-    }
-}
-
-static int do_vm_stop(RunState state, bool send_stop)
-{
-    int ret = 0;
-
-    if (runstate_is_running()) {
-        runstate_set(state);
-        cpu_disable_ticks();
-        pause_all_vcpus();
-        vm_state_notify(0, state);
-        if (send_stop) {
-            qapi_event_send_stop();
-        }
-    }
-
-    bdrv_drain_all();
-    ret = bdrv_flush_all();
-
-    return ret;
-}
-
-/* Special vm_stop() variant for terminating the process.  Historically clients
- * did not expect a QMP STOP event and so we need to retain compatibility.
- */
-int vm_shutdown(void)
-{
-    return do_vm_stop(RUN_STATE_SHUTDOWN, false);
-}
-
-static bool cpu_can_run(CPUState *cpu)
-{
-    if (cpu->stop) {
-        return false;
-    }
-    if (cpu_is_stopped(cpu)) {
-        return false;
-    }
-    return true;
-}
-
-static void cpu_handle_guest_debug(CPUState *cpu)
-{
-    gdb_set_stop_cpu(cpu);
-    qemu_system_debug_request();
-    cpu->stopped = true;
-}
-
-#ifdef CONFIG_LINUX
-static void sigbus_reraise(void)
-{
-    sigset_t set;
-    struct sigaction action;
-
-    memset(&action, 0, sizeof(action));
-    action.sa_handler = SIG_DFL;
-    if (!sigaction(SIGBUS, &action, NULL)) {
-        raise(SIGBUS);
-        sigemptyset(&set);
-        sigaddset(&set, SIGBUS);
-        pthread_sigmask(SIG_UNBLOCK, &set, NULL);
-    }
-    perror("Failed to re-raise SIGBUS!\n");
-    abort();
-}
-
-static void sigbus_handler(int n, siginfo_t *siginfo, void *ctx)
-{
-    if (siginfo->si_code != BUS_MCEERR_AO && siginfo->si_code != BUS_MCEERR_AR) {
-        sigbus_reraise();
-    }
-
-    if (current_cpu) {
-        /* Called asynchronously in VCPU thread.  */
-        if (kvm_on_sigbus_vcpu(current_cpu, siginfo->si_code, siginfo->si_addr)) {
-            sigbus_reraise();
-        }
-    } else {
-        /* Called synchronously (via signalfd) in main thread.  */
-        if (kvm_on_sigbus(siginfo->si_code, siginfo->si_addr)) {
-            sigbus_reraise();
-        }
-    }
-}
-
-static void qemu_init_sigbus(void)
-{
-    struct sigaction action;
-
-    memset(&action, 0, sizeof(action));
-    action.sa_flags = SA_SIGINFO;
-    action.sa_sigaction = sigbus_handler;
-    sigaction(SIGBUS, &action, NULL);
-
-    prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0);
-}
-#else /* !CONFIG_LINUX */
-static void qemu_init_sigbus(void)
-{
-}
-#endif /* !CONFIG_LINUX */
-
-static QemuThread io_thread;
-
-/* cpu creation */
-static QemuCond qemu_cpu_cond;
-/* system init */
-static QemuCond qemu_pause_cond;
-
-void qemu_init_cpu_loop(void)
-{
-    qemu_init_sigbus();
-    qemu_cond_init(&qemu_cpu_cond);
-    qemu_cond_init(&qemu_pause_cond);
-    qemu_mutex_init(&qemu_global_mutex);
-
-    qemu_thread_get_self(&io_thread);
-}
-
-void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data)
-{
-    do_run_on_cpu(cpu, func, data, &qemu_global_mutex);
-}
-
-static void qemu_kvm_destroy_vcpu(CPUState *cpu)
-{
-    if (kvm_destroy_vcpu(cpu) < 0) {
-        error_report("kvm_destroy_vcpu failed");
-        exit(EXIT_FAILURE);
-    }
-}
-
-static void qemu_tcg_destroy_vcpu(CPUState *cpu)
-{
-}
-
-static void qemu_cpu_stop(CPUState *cpu, bool exit)
-{
-    g_assert(qemu_cpu_is_self(cpu));
-    cpu->stop = false;
-    cpu->stopped = true;
-    if (exit) {
-        cpu_exit(cpu);
-    }
-    qemu_cond_broadcast(&qemu_pause_cond);
-}
-
-static void qemu_wait_io_event_common(CPUState *cpu)
-{
-    atomic_mb_set(&cpu->thread_kicked, false);
-    if (cpu->stop) {
-        qemu_cpu_stop(cpu, false);
-    }
-    process_queued_cpu_work(cpu);
-}
-
-static void qemu_tcg_rr_wait_io_event(void)
-{
-    CPUState *cpu;
-
-    while (all_cpu_threads_idle()) {
-        stop_tcg_kick_timer();
-        qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex);
-    }
-
-    start_tcg_kick_timer();
-
-    CPU_FOREACH(cpu) {
-        qemu_wait_io_event_common(cpu);
-    }
-}
-
-static void qemu_wait_io_event(CPUState *cpu)
-{
-    bool slept = false;
-
-    while (cpu_thread_is_idle(cpu)) {
-        if (!slept) {
-            slept = true;
-            qemu_plugin_vcpu_idle_cb(cpu);
-        }
-        qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
-    }
-    if (slept) {
-        qemu_plugin_vcpu_resume_cb(cpu);
-    }
-
-#ifdef _WIN32
-    /* Eat dummy APC queued by qemu_cpu_kick_thread.  */
-    if (!tcg_enabled()) {
-        SleepEx(0, TRUE);
-    }
-#endif
-    qemu_wait_io_event_common(cpu);
-}
-
-static void *qemu_kvm_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    r = kvm_init_vcpu(cpu);
-    if (r < 0) {
-        error_report("kvm_init_vcpu failed: %s", strerror(-r));
-        exit(1);
-    }
-
-    kvm_init_cpu_signals(cpu);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = kvm_cpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    qemu_kvm_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_dummy_cpu_thread_fn(void *arg)
-{
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
-    CPUState *cpu = arg;
-    sigset_t waitset;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    sigemptyset(&waitset);
-    sigaddset(&waitset, SIG_IPI);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        qemu_mutex_unlock_iothread();
-        do {
-            int sig;
-            r = sigwait(&waitset, &sig);
-        } while (r == -1 && (errno == EAGAIN || errno == EINTR));
-        if (r == -1) {
-            perror("sigwait");
-            exit(1);
-        }
-        qemu_mutex_lock_iothread();
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug);
-
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-#endif
-}
-
-static int64_t tcg_get_icount_limit(void)
-{
-    int64_t deadline;
-
-    if (replay_mode != REPLAY_MODE_PLAY) {
-        /*
-         * Include all the timers, because they may need an attention.
-         * Too long CPU execution may create unnecessary delay in UI.
-         */
-        deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                              QEMU_TIMER_ATTR_ALL);
-        /* Check realtime timers, because they help with input processing */
-        deadline = qemu_soonest_timeout(deadline,
-                qemu_clock_deadline_ns_all(QEMU_CLOCK_REALTIME,
-                                           QEMU_TIMER_ATTR_ALL));
-
-        /* Maintain prior (possibly buggy) behaviour where if no deadline
-         * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than
-         * INT32_MAX nanoseconds ahead, we still use INT32_MAX
-         * nanoseconds.
-         */
-        if ((deadline < 0) || (deadline > INT32_MAX)) {
-            deadline = INT32_MAX;
-        }
-
-        return qemu_icount_round(deadline);
-    } else {
-        return replay_get_instructions();
-    }
-}
-
-static void notify_aio_contexts(void)
-{
-    /* Wake up other AioContexts.  */
-    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
-    qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
-}
-
-static void handle_icount_deadline(void)
-{
-    assert(qemu_in_vcpu_thread());
-    if (use_icount) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
-                                                      QEMU_TIMER_ATTR_ALL);
-
-        if (deadline == 0) {
-            notify_aio_contexts();
-        }
-    }
-}
-
-static void prepare_icount_for_run(CPUState *cpu)
-{
-    if (use_icount) {
-        int insns_left;
-
-        /* These should always be cleared by process_icount_data after
-         * each vCPU execution. However u16.high can be raised
-         * asynchronously by cpu_exit/cpu_interrupt/tcg_handle_interrupt
-         */
-        g_assert(cpu_neg(cpu)->icount_decr.u16.low == 0);
-        g_assert(cpu->icount_extra == 0);
-
-        cpu->icount_budget = tcg_get_icount_limit();
-        insns_left = MIN(0xffff, cpu->icount_budget);
-        cpu_neg(cpu)->icount_decr.u16.low = insns_left;
-        cpu->icount_extra = cpu->icount_budget - insns_left;
-
-        replay_mutex_lock();
-
-        if (cpu->icount_budget == 0 && replay_has_checkpoint()) {
-            notify_aio_contexts();
-        }
-    }
-}
-
-static void process_icount_data(CPUState *cpu)
-{
-    if (use_icount) {
-        /* Account for executed instructions */
-        cpu_update_icount(cpu);
-
-        /* Reset the counters */
-        cpu_neg(cpu)->icount_decr.u16.low = 0;
-        cpu->icount_extra = 0;
-        cpu->icount_budget = 0;
-
-        replay_account_executed_instructions();
-
-        replay_mutex_unlock();
-    }
-}
-
-
-static int tcg_cpu_exec(CPUState *cpu)
-{
-    int ret;
-#ifdef CONFIG_PROFILER
-    int64_t ti;
-#endif
-
-    assert(tcg_enabled());
-#ifdef CONFIG_PROFILER
-    ti = profile_getclock();
-#endif
-    cpu_exec_start(cpu);
-    ret = cpu_exec(cpu);
-    cpu_exec_end(cpu);
-#ifdef CONFIG_PROFILER
-    atomic_set(&tcg_ctx->prof.cpu_exec_time,
-               tcg_ctx->prof.cpu_exec_time + profile_getclock() - ti);
-#endif
-    return ret;
-}
-
-/* Destroy any remaining vCPUs which have been unplugged and have
- * finished running
- */
-static void deal_with_unplugged_cpus(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (cpu->unplug && !cpu_can_run(cpu)) {
-            qemu_tcg_destroy_vcpu(cpu);
-            cpu->created = false;
-            qemu_cond_signal(&qemu_cpu_cond);
-            break;
-        }
-    }
-}
-
-/* Single-threaded TCG
- *
- * In the single-threaded case each vCPU is simulated in turn. If
- * there is more than a single vCPU we create a simple timer to kick
- * the vCPU and ensure we don't get stuck in a tight loop in one vCPU.
- * This is done explicitly rather than relying on side-effects
- * elsewhere.
- */
-
-static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    assert(tcg_enabled());
-    rcu_register_thread();
-    tcg_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    cpu->can_do_io = 1;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    /* wait for initial kick-off after machine start */
-    while (first_cpu->stopped) {
-        qemu_cond_wait(first_cpu->halt_cond, &qemu_global_mutex);
-
-        /* process any pending work */
-        CPU_FOREACH(cpu) {
-            current_cpu = cpu;
-            qemu_wait_io_event_common(cpu);
-        }
-    }
-
-    start_tcg_kick_timer();
-
-    cpu = first_cpu;
-
-    /* process any pending work */
-    cpu->exit_request = 1;
-
-    while (1) {
-        qemu_mutex_unlock_iothread();
-        replay_mutex_lock();
-        qemu_mutex_lock_iothread();
-        /* Account partial waits to QEMU_CLOCK_VIRTUAL.  */
-        qemu_account_warp_timer();
-
-        /* Run the timers here.  This is much more efficient than
-         * waking up the I/O thread and waiting for completion.
-         */
-        handle_icount_deadline();
-
-        replay_mutex_unlock();
-
-        if (!cpu) {
-            cpu = first_cpu;
-        }
-
-        while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) {
-
-            atomic_mb_set(&tcg_current_rr_cpu, cpu);
-            current_cpu = cpu;
-
-            qemu_clock_enable(QEMU_CLOCK_VIRTUAL,
-                              (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
-
-            if (cpu_can_run(cpu)) {
-                int r;
-
-                qemu_mutex_unlock_iothread();
-                prepare_icount_for_run(cpu);
-
-                r = tcg_cpu_exec(cpu);
-
-                process_icount_data(cpu);
-                qemu_mutex_lock_iothread();
-
-                if (r == EXCP_DEBUG) {
-                    cpu_handle_guest_debug(cpu);
-                    break;
-                } else if (r == EXCP_ATOMIC) {
-                    qemu_mutex_unlock_iothread();
-                    cpu_exec_step_atomic(cpu);
-                    qemu_mutex_lock_iothread();
-                    break;
-                }
-            } else if (cpu->stop) {
-                if (cpu->unplug) {
-                    cpu = CPU_NEXT(cpu);
-                }
-                break;
-            }
-
-            cpu = CPU_NEXT(cpu);
-        } /* while (cpu && !cpu->exit_request).. */
-
-        /* Does not need atomic_mb_set because a spurious wakeup is okay.  */
-        atomic_set(&tcg_current_rr_cpu, NULL);
-
-        if (cpu && cpu->exit_request) {
-            atomic_mb_set(&cpu->exit_request, 0);
-        }
-
-        if (use_icount && all_cpu_threads_idle()) {
-            /*
-             * When all cpus are sleeping (e.g in WFI), to avoid a deadlock
-             * in the main_loop, wake it up in order to start the warp timer.
-             */
-            qemu_notify_event();
-        }
-
-        qemu_tcg_rr_wait_io_event();
-        deal_with_unplugged_cpus();
-    }
-
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_hax_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    current_cpu = cpu;
-
-    hax_init_vcpu(cpu);
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = hax_smp_cpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-    rcu_unregister_thread();
-    return NULL;
-}
-
-/* The HVF-specific vCPU thread function. This one should only run when the host
- * CPU supports the VMX "unrestricted guest" feature. */
-static void *qemu_hvf_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    int r;
-
-    assert(hvf_enabled());
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-
-    hvf_init_vcpu(cpu);
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = hvf_vcpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    hvf_vcpu_destroy(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void *qemu_whpx_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-    int r;
-
-    rcu_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-    cpu->thread_id = qemu_get_thread_id();
-    current_cpu = cpu;
-
-    r = whpx_init_vcpu(cpu);
-    if (r < 0) {
-        fprintf(stderr, "whpx_init_vcpu failed: %s\n", strerror(-r));
-        exit(1);
-    }
-
-    /* signal CPU creation */
-    cpu->created = true;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    do {
-        if (cpu_can_run(cpu)) {
-            r = whpx_vcpu_exec(cpu);
-            if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(cpu);
-            }
-        }
-        while (cpu_thread_is_idle(cpu)) {
-            qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
-        }
-        qemu_wait_io_event_common(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    whpx_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-#ifdef _WIN32
-static void CALLBACK dummy_apc_func(ULONG_PTR unused)
-{
-}
-#endif
-
-/* Multi-threaded TCG
- *
- * In the multi-threaded case each vCPU has its own thread. The TLS
- * variable current_cpu can be used deep in the code to find the
- * current CPUState for a given thread.
- */
-
-static void *qemu_tcg_cpu_thread_fn(void *arg)
-{
-    CPUState *cpu = arg;
-
-    assert(tcg_enabled());
-    g_assert(!use_icount);
-
-    rcu_register_thread();
-    tcg_register_thread();
-
-    qemu_mutex_lock_iothread();
-    qemu_thread_get_self(cpu->thread);
-
-    cpu->thread_id = qemu_get_thread_id();
-    cpu->created = true;
-    cpu->can_do_io = 1;
-    current_cpu = cpu;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_guest_random_seed_thread_part2(cpu->random_seed);
-
-    /* process any pending work */
-    cpu->exit_request = 1;
-
-    do {
-        if (cpu_can_run(cpu)) {
-            int r;
-            qemu_mutex_unlock_iothread();
-            r = tcg_cpu_exec(cpu);
-            qemu_mutex_lock_iothread();
-            switch (r) {
-            case EXCP_DEBUG:
-                cpu_handle_guest_debug(cpu);
-                break;
-            case EXCP_HALTED:
-                /* during start-up the vCPU is reset and the thread is
-                 * kicked several times. If we don't ensure we go back
-                 * to sleep in the halted state we won't cleanly
-                 * start-up when the vCPU is enabled.
-                 *
-                 * cpu->halted should ensure we sleep in wait_io_event
-                 */
-                g_assert(cpu->halted);
-                break;
-            case EXCP_ATOMIC:
-                qemu_mutex_unlock_iothread();
-                cpu_exec_step_atomic(cpu);
-                qemu_mutex_lock_iothread();
-            default:
-                /* Ignore everything else? */
-                break;
-            }
-        }
-
-        atomic_mb_set(&cpu->exit_request, 0);
-        qemu_wait_io_event(cpu);
-    } while (!cpu->unplug || cpu_can_run(cpu));
-
-    qemu_tcg_destroy_vcpu(cpu);
-    cpu->created = false;
-    qemu_cond_signal(&qemu_cpu_cond);
-    qemu_mutex_unlock_iothread();
-    rcu_unregister_thread();
-    return NULL;
-}
-
-static void qemu_cpu_kick_thread(CPUState *cpu)
-{
-#ifndef _WIN32
-    int err;
-
-    if (cpu->thread_kicked) {
-        return;
-    }
-    cpu->thread_kicked = true;
-    err = pthread_kill(cpu->thread->thread, SIG_IPI);
-    if (err && err != ESRCH) {
-        fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
-        exit(1);
-    }
-#else /* _WIN32 */
-    if (!qemu_cpu_is_self(cpu)) {
-        if (whpx_enabled()) {
-            whpx_vcpu_kick(cpu);
-        } else if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) {
-            fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n",
-                    __func__, GetLastError());
-            exit(1);
-        }
-    }
-#endif
-}
-
-void qemu_cpu_kick(CPUState *cpu)
-{
-    qemu_cond_broadcast(cpu->halt_cond);
-    if (tcg_enabled()) {
-        if (qemu_tcg_mttcg_enabled()) {
-            cpu_exit(cpu);
-        } else {
-            qemu_cpu_kick_rr_cpus();
-        }
-    } else {
-        if (hax_enabled()) {
-            /*
-             * FIXME: race condition with the exit_request check in
-             * hax_vcpu_hax_exec
-             */
-            cpu->exit_request = 1;
-        }
-        qemu_cpu_kick_thread(cpu);
-    }
-}
-
-void qemu_cpu_kick_self(void)
-{
-    assert(current_cpu);
-    qemu_cpu_kick_thread(current_cpu);
-}
-
-bool qemu_cpu_is_self(CPUState *cpu)
-{
-    return qemu_thread_is_self(cpu->thread);
-}
-
-bool qemu_in_vcpu_thread(void)
-{
-    return current_cpu && qemu_cpu_is_self(current_cpu);
-}
-
-static __thread bool iothread_locked = false;
-
-bool qemu_mutex_iothread_locked(void)
-{
-    return iothread_locked;
-}
-
-/*
- * The BQL is taken from so many places that it is worth profiling the
- * callers directly, instead of funneling them all through a single function.
- */
-void qemu_mutex_lock_iothread_impl(const char *file, int line)
-{
-    QemuMutexLockFunc bql_lock = atomic_read(&qemu_bql_mutex_lock_func);
-
-    g_assert(!qemu_mutex_iothread_locked());
-    bql_lock(&qemu_global_mutex, file, line);
-    iothread_locked = true;
-}
-
-void qemu_mutex_unlock_iothread(void)
-{
-    g_assert(qemu_mutex_iothread_locked());
-    iothread_locked = false;
-    qemu_mutex_unlock(&qemu_global_mutex);
-}
-
-void qemu_cond_wait_iothread(QemuCond *cond)
-{
-    qemu_cond_wait(cond, &qemu_global_mutex);
-}
-
-static bool all_vcpus_paused(void)
-{
-    CPUState *cpu;
-
-    CPU_FOREACH(cpu) {
-        if (!cpu->stopped) {
-            return false;
-        }
-    }
-
-    return true;
-}
-
-void pause_all_vcpus(void)
-{
-    CPUState *cpu;
-
-    qemu_clock_enable(QEMU_CLOCK_VIRTUAL, false);
-    CPU_FOREACH(cpu) {
-        if (qemu_cpu_is_self(cpu)) {
-            qemu_cpu_stop(cpu, true);
-        } else {
-            cpu->stop = true;
-            qemu_cpu_kick(cpu);
-        }
-    }
-
-    /* We need to drop the replay_lock so any vCPU threads woken up
-     * can finish their replay tasks
-     */
-    replay_mutex_unlock();
-
-    while (!all_vcpus_paused()) {
-        qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex);
-        CPU_FOREACH(cpu) {
-            qemu_cpu_kick(cpu);
-        }
-    }
-
-    qemu_mutex_unlock_iothread();
-    replay_mutex_lock();
-    qemu_mutex_lock_iothread();
-}
-
-void cpu_resume(CPUState *cpu)
-{
-    cpu->stop = false;
-    cpu->stopped = false;
-    qemu_cpu_kick(cpu);
-}
-
-void resume_all_vcpus(void)
-{
-    CPUState *cpu;
-
-    if (!runstate_is_running()) {
-        return;
-    }
-
-    qemu_clock_enable(QEMU_CLOCK_VIRTUAL, true);
-    CPU_FOREACH(cpu) {
-        cpu_resume(cpu);
-    }
-}
-
-void cpu_remove_sync(CPUState *cpu)
-{
-    cpu->stop = true;
-    cpu->unplug = true;
-    qemu_cpu_kick(cpu);
-    qemu_mutex_unlock_iothread();
-    qemu_thread_join(cpu->thread);
-    qemu_mutex_lock_iothread();
-}
-
-/* For temporary buffers for forming a name */
-#define VCPU_THREAD_NAME_SIZE 16
-
-static void qemu_tcg_init_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-    static QemuCond *single_tcg_halt_cond;
-    static QemuThread *single_tcg_cpu_thread;
-    static int tcg_region_inited;
-
-    assert(tcg_enabled());
-    /*
-     * Initialize TCG regions--once. Now is a good time, because:
-     * (1) TCG's init context, prologue and target globals have been set up.
-     * (2) qemu_tcg_mttcg_enabled() works now (TCG init code runs before the
-     *     -accel flag is processed, so the check doesn't work then).
-     */
-    if (!tcg_region_inited) {
-        tcg_region_inited = 1;
-        tcg_region_init();
-    }
-
-    if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) {
-        cpu->thread = g_malloc0(sizeof(QemuThread));
-        cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-        qemu_cond_init(cpu->halt_cond);
-
-        if (qemu_tcg_mttcg_enabled()) {
-            /* create a thread per vCPU with TCG (MTTCG) */
-            parallel_cpus = true;
-            snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",
-                 cpu->cpu_index);
-
-            qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn,
-                               cpu, QEMU_THREAD_JOINABLE);
-
-        } else {
-            /* share a single thread for all cpus with TCG */
-            snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "ALL CPUs/TCG");
-            qemu_thread_create(cpu->thread, thread_name,
-                               qemu_tcg_rr_cpu_thread_fn,
-                               cpu, QEMU_THREAD_JOINABLE);
-
-            single_tcg_halt_cond = cpu->halt_cond;
-            single_tcg_cpu_thread = cpu->thread;
-        }
-#ifdef _WIN32
-        cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-    } else {
-        /* For non-MTTCG cases we share the thread */
-        cpu->thread = single_tcg_cpu_thread;
-        cpu->halt_cond = single_tcg_halt_cond;
-        cpu->thread_id = first_cpu->thread_id;
-        cpu->can_do_io = 1;
-        cpu->created = true;
-    }
-}
-
-static void qemu_hax_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HAX",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_hax_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-#ifdef _WIN32
-    cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-}
-
-static void qemu_kvm_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_kvm_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-}
-
-static void qemu_hvf_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    /* HVF currently does not support TCG, and only runs in
-     * unrestricted-guest mode. */
-    assert(hvf_enabled());
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HVF",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_hvf_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-}
-
-static void qemu_whpx_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/WHPX",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_whpx_cpu_thread_fn,
-                       cpu, QEMU_THREAD_JOINABLE);
-#ifdef _WIN32
-    cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
-}
-
-static void qemu_dummy_start_vcpu(CPUState *cpu)
-{
-    char thread_name[VCPU_THREAD_NAME_SIZE];
-
-    cpu->thread = g_malloc0(sizeof(QemuThread));
-    cpu->halt_cond = g_malloc0(sizeof(QemuCond));
-    qemu_cond_init(cpu->halt_cond);
-    snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY",
-             cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qemu_dummy_cpu_thread_fn, cpu,
-                       QEMU_THREAD_JOINABLE);
-}
-
-void qemu_init_vcpu(CPUState *cpu)
-{
-    MachineState *ms = MACHINE(qdev_get_machine());
-
-    cpu->nr_cores = ms->smp.cores;
-    cpu->nr_threads =  ms->smp.threads;
-    cpu->stopped = true;
-    cpu->random_seed = qemu_guest_random_seed_thread_part1();
-
-    if (!cpu->as) {
-        /* If the target cpu hasn't set up any address spaces itself,
-         * give it the default one.
-         */
-        cpu->num_ases = 1;
-        cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory);
-    }
-
-    if (kvm_enabled()) {
-        qemu_kvm_start_vcpu(cpu);
-    } else if (hax_enabled()) {
-        qemu_hax_start_vcpu(cpu);
-    } else if (hvf_enabled()) {
-        qemu_hvf_start_vcpu(cpu);
-    } else if (tcg_enabled()) {
-        qemu_tcg_init_vcpu(cpu);
-    } else if (whpx_enabled()) {
-        qemu_whpx_start_vcpu(cpu);
-    } else {
-        qemu_dummy_start_vcpu(cpu);
-    }
-
-    while (!cpu->created) {
-        qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
-    }
-}
-
-void cpu_stop_current(void)
-{
-    if (current_cpu) {
-        current_cpu->stop = true;
-        cpu_exit(current_cpu);
-    }
-}
-
-int vm_stop(RunState state)
-{
-    if (qemu_in_vcpu_thread()) {
-        qemu_system_vmstop_request_prepare();
-        qemu_system_vmstop_request(state);
-        /*
-         * FIXME: should not return to device code in case
-         * vm_stop() has been requested.
-         */
-        cpu_stop_current();
-        return 0;
-    }
-
-    return do_vm_stop(state, true);
-}
-
-/**
- * Prepare for (re)starting the VM.
- * Returns -1 if the vCPUs are not to be restarted (e.g. if they are already
- * running or in case of an error condition), 0 otherwise.
- */
-int vm_prepare_start(void)
-{
-    RunState requested;
-
-    qemu_vmstop_requested(&requested);
-    if (runstate_is_running() && requested == RUN_STATE__MAX) {
-        return -1;
-    }
-
-    /* Ensure that a STOP/RESUME pair of events is emitted if a
-     * vmstop request was pending.  The BLOCK_IO_ERROR event, for
-     * example, according to documentation is always followed by
-     * the STOP event.
-     */
-    if (runstate_is_running()) {
-        qapi_event_send_stop();
-        qapi_event_send_resume();
-        return -1;
-    }
-
-    /* We are sending this now, but the CPUs will be resumed shortly later */
-    qapi_event_send_resume();
-
-    cpu_enable_ticks();
-    runstate_set(RUN_STATE_RUNNING);
-    vm_state_notify(1, RUN_STATE_RUNNING);
-    return 0;
-}
-
-void vm_start(void)
-{
-    if (!vm_prepare_start()) {
-        resume_all_vcpus();
-    }
-}
-
-/* does a state transition even if the VM is already stopped,
-   current state is forgotten forever */
-int vm_stop_force_state(RunState state)
-{
-    if (runstate_is_running()) {
-        return vm_stop(state);
-    } else {
-        runstate_set(state);
-
-        bdrv_drain_all();
-        /* Make sure to return an error if the flush in a previous vm_stop()
-         * failed. */
-        return bdrv_flush_all();
-    }
-}
-
-void list_cpus(const char *optarg)
-{
-    /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list)
-    cpu_list();
-#endif
-}
-
-void qmp_memsave(int64_t addr, int64_t size, const char *filename,
-                 bool has_cpu, int64_t cpu_index, Error **errp)
-{
-    FILE *f;
-    uint32_t l;
-    CPUState *cpu;
-    uint8_t buf[1024];
-    int64_t orig_addr = addr, orig_size = size;
-
-    if (!has_cpu) {
-        cpu_index = 0;
-    }
-
-    cpu = qemu_get_cpu(cpu_index);
-    if (cpu == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index",
-                   "a CPU number");
-        return;
-    }
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        error_setg_file_open(errp, errno, filename);
-        return;
-    }
-
-    while (size != 0) {
-        l = sizeof(buf);
-        if (l > size)
-            l = size;
-        if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) {
-            error_setg(errp, "Invalid addr 0x%016" PRIx64 "/size %" PRId64
-                             " specified", orig_addr, orig_size);
-            goto exit;
-        }
-        if (fwrite(buf, 1, l, f) != l) {
-            error_setg(errp, QERR_IO_ERROR);
-            goto exit;
-        }
-        addr += l;
-        size -= l;
-    }
-
-exit:
-    fclose(f);
-}
-
-void qmp_pmemsave(int64_t addr, int64_t size, const char *filename,
-                  Error **errp)
-{
-    FILE *f;
-    uint32_t l;
-    uint8_t buf[1024];
-
-    f = fopen(filename, "wb");
-    if (!f) {
-        error_setg_file_open(errp, errno, filename);
-        return;
-    }
-
-    while (size != 0) {
-        l = sizeof(buf);
-        if (l > size)
-            l = size;
-        cpu_physical_memory_read(addr, buf, l);
-        if (fwrite(buf, 1, l, f) != l) {
-            error_setg(errp, QERR_IO_ERROR);
-            goto exit;
-        }
-        addr += l;
-        size -= l;
-    }
-
-exit:
-    fclose(f);
-}
-
-void qmp_inject_nmi(Error **errp)
-{
-    nmi_monitor_handle(monitor_get_cpu_index(), errp);
-}
-
-void dump_drift_info(void)
-{
-    if (!use_icount) {
-        return;
-    }


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:00:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16265.39766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbVK-0006HE-UQ; Fri, 30 Oct 2020 21:00:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16265.39766; Fri, 30 Oct 2020 21:00:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbVK-0006H7-R3; Fri, 30 Oct 2020 21:00:10 +0000
Received: by outflank-mailman (input) for mailman id 16265;
 Fri, 30 Oct 2020 21:00:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbVK-0006H1-5X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cda846aa-868a-4923-936f-eded5ae092c6;
 Fri, 30 Oct 2020 21:00:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbVE-0002hJ-Os
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbVE-00055B-Mx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbVK-0006H1-5X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:10 +0000
X-Inumbo-ID: cda846aa-868a-4923-936f-eded5ae092c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cda846aa-868a-4923-936f-eded5ae092c6;
	Fri, 30 Oct 2020 21:00:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GIreLQ7pNoBhhr/+MPyG89ee/DXfkudbip2rUKqPCD0=; b=SEUUSJ4Fr7gytONHul4QqWN6qE
	Yb94X9s0LdfjRsW1hybAa9W/Y7QTuMQgvxFCt8nZg11/lBWe6FNWfvCL/Miun3DJcdHNP3HPetqyf
	79xXhM99dsPiNWRibjgtOZXZfFE0L32xDlrz1FSSpZPS+yb9KJKDqH33XBGWf/D3aeFw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbVE-0002hJ-Os
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbVE-00055B-Mx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:00:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-port-20200711' into staging
Message-Id: <E1kYbVE-00055B-Mx@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:00:04 +0000

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

commit d34498309cff7560ac90c422c56e3137e6a64b19
Merge: 2033cc6efa98b831d7839e367aa7d5aa74d0750f 19b293472f1514b5424ef4d9b092e02bd9b106c2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 19:27:59 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 11 19:27:59 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-port-20200711' into staging
    
    8bit AVR port from Michael Rolnik.
    
    Michael started to work on the AVR port few years ago [*] and kept
    improving the code over various series.
    
    List of people who help him (in chronological order):
    - Richard Henderson
    - Sarah Harris and Edward Robbins
    - Philippe Mathieu-Daudé and Aleksandar Markovic
    - Pavel Dovgalyuk
    - Thomas Huth
    
    [*] The oldest contribution I could find on the list is from 2016:
    https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg02985.html
    
    Tests included:
    
    $ avocado --show=app run -t arch:avr tests/acceptance/
    Fetching asset from tests/acceptance/machine_avr6.py:AVR6Machine.test_freertos
     (1/1) tests/acceptance/machine_avr6.py:AVR6Machine.test_freertos: PASS (2.13 s)
    RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
    JOB TIME   : 2.35 s
    
    $ make check-qtest-avr
      TEST    check-qtest-avr: tests/qtest/boot-serial-test
      TEST    check-qtest-avr: tests/qtest/cdrom-test
      TEST    check-qtest-avr: tests/qtest/device-introspect-test
      TEST    check-qtest-avr: tests/qtest/machine-none-test
      TEST    check-qtest-avr: tests/qtest/qmp-test
      TEST    check-qtest-avr: tests/qtest/qmp-cmd-test
      TEST    check-qtest-avr: tests/qtest/qom-test
      TEST    check-qtest-avr: tests/qtest/test-hmp
      TEST    check-qtest-avr: tests/qtest/qos-test
    
    CI results:
    . https://cirrus-ci.com/build/5697049146425344
    . https://gitlab.com/philmd/qemu/-/pipelines/165328058
    . https://travis-ci.org/github/philmd/qemu/builds/705817933
    . https://app.shippable.com/github/philmd/qemu/runs/822/summary/console
    
    # gpg: Signature made Sat 11 Jul 2020 10:03:11 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/avr-port-20200711: (32 commits)
      target/avr/disas: Fix store instructions display order
      target/avr/cpu: Fix $PC displayed address
      target/avr/cpu: Drop tlb_flush() in avr_cpu_reset()
      target/avr: Add section into QEMU documentation
      tests/acceptance: Test the Arduino MEGA2560 board
      tests/boot-serial: Test some Arduino boards (AVR based)
      hw/avr: Add limited support for some Arduino boards
      hw/avr: Add some ATmega microcontrollers
      hw/avr: Add support for loading ELF/raw binaries
      hw/misc: avr: Add limited support for power reduction device
      hw/timer: avr: Add limited support for 16-bit timer peripheral
      hw/char: avr: Add limited support for USART peripheral
      tests/machine-none: Add AVR support
      target/avr: Register AVR support with the rest of QEMU
      target/avr: Add support for disassembling via option '-d in_asm'
      target/avr: Initialize TCG register variables
      target/avr: Add instruction translation - CPU main translation function
      target/avr: Add instruction translation - MCU Control Instructions
      target/avr: Add instruction translation - Bit and Bit-test Instructions
      target/avr: Add instruction translation - Data Transfer Instructions
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 MAINTAINERS                      |   30 +
 configure                        |    7 +
 default-configs/avr-softmmu.mak  |    5 +
 docs/system/target-avr.rst       |   37 +
 docs/system/targets.rst          |    1 +
 gdb-xml/avr-cpu.xml              |   49 +
 hw/Kconfig                       |    1 +
 hw/avr/Kconfig                   |    9 +
 hw/avr/Makefile.objs             |    3 +
 hw/avr/arduino.c                 |  149 ++
 hw/avr/atmega.c                  |  458 ++++++
 hw/avr/atmega.h                  |   48 +
 hw/avr/boot.c                    |  115 ++
 hw/avr/boot.h                    |   33 +
 hw/char/Kconfig                  |    3 +
 hw/char/Makefile.objs            |    1 +
 hw/char/avr_usart.c              |  320 ++++
 hw/misc/Kconfig                  |    3 +
 hw/misc/Makefile.objs            |    2 +
 hw/misc/avr_power.c              |  113 ++
 hw/misc/trace-events             |    4 +
 hw/timer/Kconfig                 |    3 +
 hw/timer/Makefile.objs           |    2 +
 hw/timer/avr_timer16.c           |  621 ++++++++
 hw/timer/trace-events            |   12 +
 include/disas/dis-asm.h          |   19 +
 include/elf.h                    |    4 +
 include/hw/char/avr_usart.h      |   93 ++
 include/hw/misc/avr_power.h      |   46 +
 include/hw/timer/avr_timer16.h   |   94 ++
 include/sysemu/arch_init.h       |    1 +
 qapi/machine.json                |    3 +-
 softmmu/arch_init.c              |    2 +
 target/avr/Makefile.objs         |   34 +
 target/avr/cpu-param.h           |   36 +
 target/avr/cpu-qom.h             |   53 +
 target/avr/cpu.c                 |  366 +++++
 target/avr/cpu.h                 |  256 ++++
 target/avr/disas.c               |  245 +++
 target/avr/gdbstub.c             |   84 ++
 target/avr/helper.c              |  348 +++++
 target/avr/helper.h              |   29 +
 target/avr/insn.decode           |  187 +++
 target/avr/machine.c             |  119 ++
 target/avr/translate.c           | 3061 ++++++++++++++++++++++++++++++++++++++
 tests/acceptance/machine_avr6.py |   50 +
 tests/qtest/Makefile.include     |    2 +
 tests/qtest/boot-serial-test.c   |   11 +
 tests/qtest/machine-none-test.c  |    1 +
 49 files changed, 7172 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 361ae5c662..fe8139f367 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -167,6 +167,14 @@ S: Maintained
 F: hw/arm/smmu*
 F: include/hw/arm/smmu*
 
+AVR TCG CPUs
+M: Michael Rolnik <mrolnik@gmail.com>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: gdb-xml/avr-cpu.xml
+F: target/avr/
+F: tests/acceptance/machine_avr6.py
+
 CRIS TCG CPUs
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
 S: Maintained
@@ -982,6 +990,28 @@ F: include/hw/*/nrf51*.h
 F: include/hw/*/microbit*.h
 F: tests/qtest/microbit-test.c
 
+AVR Machines
+-------------
+
+AVR MCUs
+M: Michael Rolnik <mrolnik@gmail.com>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: default-configs/avr-softmmu.mak
+F: hw/avr/
+F: include/hw/char/avr_usart.h
+F: hw/char/avr_usart.c
+F: include/hw/timer/avr_timer16.h
+F: hw/timer/avr_timer16.c
+F: include/hw/misc/avr_power.h
+F: hw/misc/avr_power.c
+
+Arduino
+M: Philippe Mathieu-Daudé <f4bug@amsat.org>
+R: Sarah Harris <S.E.Harris@kent.ac.uk>
+S: Maintained
+F: hw/avr/arduino.c
+
 CRIS Machines
 -------------
 Axis Dev88
diff --git a/configure b/configure
index ee6c3c6792..31e2ddbf28 100755
--- a/configure
+++ b/configure
@@ -8143,6 +8143,10 @@ case "$target_name" in
     mttcg="yes"
     gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml"
   ;;
+  avr)
+    gdb_xml_files="avr-cpu.xml"
+    target_compiler=$cross_cc_avr
+  ;;
   cris)
   ;;
   hppa)
@@ -8387,6 +8391,9 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
       disas_config "ARM_A64"
     fi
   ;;
+  avr)
+    disas_config "AVR"
+  ;;
   cris)
     disas_config "CRIS"
   ;;
diff --git a/default-configs/avr-softmmu.mak b/default-configs/avr-softmmu.mak
new file mode 100644
index 0000000000..80218add98
--- /dev/null
+++ b/default-configs/avr-softmmu.mak
@@ -0,0 +1,5 @@
+# Default configuration for avr-softmmu
+
+# Boards:
+#
+CONFIG_ARDUINO=y
diff --git a/docs/system/target-avr.rst b/docs/system/target-avr.rst
new file mode 100644
index 0000000000..dc99afc895
--- /dev/null
+++ b/docs/system/target-avr.rst
@@ -0,0 +1,37 @@
+.. _AVR-System-emulator:
+
+AVR System emulator
+-------------------
+
+Use the executable ``qemu-system-avr`` to emulate a AVR 8 bit based machine.
+These can have one of the following cores: avr1, avr2, avr25, avr3, avr31,
+avr35, avr4, avr5, avr51, avr6, avrtiny, xmega2, xmega3, xmega4, xmega5,
+xmega6 and xmega7.
+
+As for now it supports few Arduino boards for educational and testing purposes.
+These boards use a ATmega controller, which model is limited to USART & 16-bit
+timer devices, enought to run FreeRTOS based applications (like
+https://github.com/seharris/qemu-avr-tests/blob/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
+).
+
+Following are examples of possible usages, assuming demo.elf is compiled for
+AVR cpu
+
+ - Continuous non interrupted execution:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf``
+
+ - Continuous non interrupted execution with serial output into telnet window:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -serial
+   tcp::5678,server,nowait -nographic``
+   and then in another shell
+   ``telnet localhost 5678``
+
+ - Debugging wit GDB debugger:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -s -S``
+   and then in another shell
+   ``avr-gdb demo.elf``
+   and then within GDB shell
+   ``target remote :1234``
+
+ - Print out executed instructions:
+   ``qemu-system-avr -machine mega2560 -bios demo.elf -d in_asm``
diff --git a/docs/system/targets.rst b/docs/system/targets.rst
index 99435a3eba..560783644d 100644
--- a/docs/system/targets.rst
+++ b/docs/system/targets.rst
@@ -19,3 +19,4 @@ Contents:
    target-xtensa
    target-s390x
    target-rx
+   target-avr
diff --git a/gdb-xml/avr-cpu.xml b/gdb-xml/avr-cpu.xml
new file mode 100644
index 0000000000..c4747f5b40
--- /dev/null
+++ b/gdb-xml/avr-cpu.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!-- Register numbers are hard-coded in order to maintain backward
+     compatibility with older versions of tools that didn't use xml
+     register descriptions.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.riscv.cpu">
+  <reg name="r0" bitsize="8" type="int" regnum="0"/>
+  <reg name="r1" bitsize="8" type="int"/>
+  <reg name="r2" bitsize="8" type="int"/>
+  <reg name="r3" bitsize="8" type="int"/>
+  <reg name="r4" bitsize="8" type="int"/>
+  <reg name="r5" bitsize="8" type="int"/>
+  <reg name="r6" bitsize="8" type="int"/>
+  <reg name="r7" bitsize="8" type="int"/>
+  <reg name="r8" bitsize="8" type="int"/>
+  <reg name="r9" bitsize="8" type="int"/>
+  <reg name="r10" bitsize="8" type="int"/>
+  <reg name="r11" bitsize="8" type="int"/>
+  <reg name="r12" bitsize="8" type="int"/>
+  <reg name="r13" bitsize="8" type="int"/>
+  <reg name="r14" bitsize="8" type="int"/>
+  <reg name="r15" bitsize="8" type="int"/>
+  <reg name="r16" bitsize="8" type="int"/>
+  <reg name="r17" bitsize="8" type="int"/>
+  <reg name="r18" bitsize="8" type="int"/>
+  <reg name="r19" bitsize="8" type="int"/>
+  <reg name="r20" bitsize="8" type="int"/>
+  <reg name="r21" bitsize="8" type="int"/>
+  <reg name="r22" bitsize="8" type="int"/>
+  <reg name="r23" bitsize="8" type="int"/>
+  <reg name="r24" bitsize="8" type="int"/>
+  <reg name="r25" bitsize="8" type="int"/>
+  <reg name="r26" bitsize="8" type="int"/>
+  <reg name="r27" bitsize="8" type="int"/>
+  <reg name="r28" bitsize="8" type="int"/>
+  <reg name="r29" bitsize="8" type="int"/>
+  <reg name="r30" bitsize="8" type="int"/>
+  <reg name="r31" bitsize="8" type="int"/>
+  <reg name="sreg" bitsize="8" type="int"/>
+  <reg name="sp" bitsize="8" type="int"/>
+  <reg name="pc" bitsize="8" type="int"/>
+</feature>
diff --git a/hw/Kconfig b/hw/Kconfig
index 62f9ebdc22..4de1797ffd 100644
--- a/hw/Kconfig
+++ b/hw/Kconfig
@@ -43,6 +43,7 @@ source watchdog/Kconfig
 # arch Kconfig
 source arm/Kconfig
 source alpha/Kconfig
+source avr/Kconfig
 source cris/Kconfig
 source hppa/Kconfig
 source i386/Kconfig
diff --git a/hw/avr/Kconfig b/hw/avr/Kconfig
new file mode 100644
index 0000000000..d31298c3cc
--- /dev/null
+++ b/hw/avr/Kconfig
@@ -0,0 +1,9 @@
+config AVR_ATMEGA_MCU
+    bool
+    select AVR_TIMER16
+    select AVR_USART
+    select AVR_POWER
+
+config ARDUINO
+    select AVR_ATMEGA_MCU
+    select UNIMP
diff --git a/hw/avr/Makefile.objs b/hw/avr/Makefile.objs
new file mode 100644
index 0000000000..4dca064bfc
--- /dev/null
+++ b/hw/avr/Makefile.objs
@@ -0,0 +1,3 @@
+obj-y += boot.o
+obj-$(CONFIG_AVR_ATMEGA_MCU) += atmega.o
+obj-$(CONFIG_ARDUINO) += arduino.o
diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c
new file mode 100644
index 0000000000..65093ab6fd
--- /dev/null
+++ b/hw/avr/arduino.c
@@ -0,0 +1,149 @@
+/*
+ * QEMU Arduino boards
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+/* TODO: Implement the use of EXTRAM */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "hw/boards.h"
+#include "atmega.h"
+#include "boot.h"
+
+typedef struct ArduinoMachineState {
+    /*< private >*/
+    MachineState parent_obj;
+    /*< public >*/
+    AtmegaMcuState mcu;
+} ArduinoMachineState;
+
+typedef struct ArduinoMachineClass {
+    /*< private >*/
+    MachineClass parent_class;
+    /*< public >*/
+    const char *mcu_type;
+    uint64_t xtal_hz;
+} ArduinoMachineClass;
+
+#define TYPE_ARDUINO_MACHINE \
+        MACHINE_TYPE_NAME("arduino")
+#define ARDUINO_MACHINE(obj) \
+        OBJECT_CHECK(ArduinoMachineState, (obj), TYPE_ARDUINO_MACHINE)
+#define ARDUINO_MACHINE_CLASS(klass) \
+        OBJECT_CLASS_CHECK(ArduinoMachineClass, (klass), TYPE_ARDUINO_MACHINE)
+#define ARDUINO_MACHINE_GET_CLASS(obj) \
+        OBJECT_GET_CLASS(ArduinoMachineClass, (obj), TYPE_ARDUINO_MACHINE)
+
+static void arduino_machine_init(MachineState *machine)
+{
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_GET_CLASS(machine);
+    ArduinoMachineState *ams = ARDUINO_MACHINE(machine);
+
+    object_initialize_child(OBJECT(machine), "mcu", &ams->mcu, amc->mcu_type);
+    object_property_set_uint(OBJECT(&ams->mcu), "xtal-frequency-hz",
+                             amc->xtal_hz, &error_abort);
+    sysbus_realize(SYS_BUS_DEVICE(&ams->mcu), &error_abort);
+
+    if (machine->firmware) {
+        if (!avr_load_firmware(&ams->mcu.cpu, machine,
+                               &ams->mcu.flash, machine->firmware)) {
+            exit(1);
+        }
+    }
+}
+
+static void arduino_machine_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->init = arduino_machine_init;
+    mc->default_cpus = 1;
+    mc->min_cpus = mc->default_cpus;
+    mc->max_cpus = mc->default_cpus;
+    mc->no_floppy = 1;
+    mc->no_cdrom = 1;
+    mc->no_parallel = 1;
+}
+
+static void arduino_duemilanove_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove */
+    mc->desc        = "Arduino Duemilanove (ATmega168)",
+    mc->alias       = "2009";
+    amc->mcu_type   = TYPE_ATMEGA168_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_uno_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://store.arduino.cc/arduino-uno-rev3 */
+    mc->desc        = "Arduino UNO (ATmega328P)";
+    mc->alias       = "uno";
+    amc->mcu_type   = TYPE_ATMEGA328_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_mega_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://www.arduino.cc/en/Main/ArduinoBoardMega */
+    mc->desc        = "Arduino Mega (ATmega1280)";
+    mc->alias       = "mega";
+    amc->mcu_type   = TYPE_ATMEGA1280_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000;
+};
+
+static void arduino_mega2560_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+    ArduinoMachineClass *amc = ARDUINO_MACHINE_CLASS(oc);
+
+    /* https://store.arduino.cc/arduino-mega-2560-rev3 */
+    mc->desc        = "Arduino Mega 2560 (ATmega2560)";
+    mc->alias       = "mega2560";
+    amc->mcu_type   = TYPE_ATMEGA2560_MCU;
+    amc->xtal_hz    = 16 * 1000 * 1000; /* CSTCE16M0V53-R0 */
+};
+
+static const TypeInfo arduino_machine_types[] = {
+    {
+        .name          = MACHINE_TYPE_NAME("arduino-duemilanove"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_duemilanove_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-uno"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_uno_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-mega"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_mega_class_init,
+    }, {
+        .name          = MACHINE_TYPE_NAME("arduino-mega-2560-v3"),
+        .parent        = TYPE_ARDUINO_MACHINE,
+        .class_init    = arduino_mega2560_class_init,
+    }, {
+        .name           = TYPE_ARDUINO_MACHINE,
+        .parent         = TYPE_MACHINE,
+        .instance_size  = sizeof(ArduinoMachineState),
+        .class_size     = sizeof(ArduinoMachineClass),
+        .class_init     = arduino_machine_class_init,
+        .abstract       = true,
+    }
+};
+
+DEFINE_TYPES(arduino_machine_types)
diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c
new file mode 100644
index 0000000000..7131224431
--- /dev/null
+++ b/hw/avr/atmega.c
@@ -0,0 +1,458 @@
+/*
+ * QEMU ATmega MCU
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/module.h"
+#include "qemu/units.h"
+#include "qapi/error.h"
+#include "exec/memory.h"
+#include "exec/address-spaces.h"
+#include "sysemu/sysemu.h"
+#include "hw/qdev-properties.h"
+#include "hw/sysbus.h"
+#include "hw/boards.h" /* FIXME memory_region_allocate_system_memory for sram */
+#include "hw/misc/unimp.h"
+#include "atmega.h"
+
+enum AtmegaPeripheral {
+    POWER0, POWER1,
+    GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF,
+    GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK, GPIOL,
+    USART0, USART1, USART2, USART3,
+    TIMER0, TIMER1, TIMER2, TIMER3, TIMER4, TIMER5,
+    PERIFMAX
+};
+
+#define GPIO(n)     (n + GPIOA)
+#define USART(n)    (n + USART0)
+#define TIMER(n)    (n + TIMER0)
+#define POWER(n)    (n + POWER0)
+
+typedef struct {
+    uint16_t addr;
+    enum AtmegaPeripheral power_index;
+    uint8_t power_bit;
+    /* timer specific */
+    uint16_t intmask_addr;
+    uint16_t intflag_addr;
+    bool is_timer16;
+} peripheral_cfg;
+
+typedef struct AtmegaMcuClass {
+    /*< private >*/
+    SysBusDeviceClass parent_class;
+    /*< public >*/
+    const char *uc_name;
+    const char *cpu_type;
+    size_t flash_size;
+    size_t eeprom_size;
+    size_t sram_size;
+    size_t io_size;
+    size_t gpio_count;
+    size_t adc_count;
+    const uint8_t *irq;
+    const peripheral_cfg *dev;
+} AtmegaMcuClass;
+
+#define ATMEGA_MCU_CLASS(klass) \
+    OBJECT_CLASS_CHECK(AtmegaMcuClass, (klass), TYPE_ATMEGA_MCU)
+#define ATMEGA_MCU_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(AtmegaMcuClass, (obj), TYPE_ATMEGA_MCU)
+
+static const peripheral_cfg dev168_328[PERIFMAX] = {
+    [USART0]        = {  0xc0, POWER0, 1 },
+    [TIMER2]        = {  0xb0, POWER0, 6, 0x70, 0x37, false },
+    [TIMER1]        = {  0x80, POWER0, 3, 0x6f, 0x36, true },
+    [POWER0]        = {  0x64 },
+    [TIMER0]        = {  0x44, POWER0, 5, 0x6e, 0x35, false },
+    [GPIOD]         = {  0x29 },
+    [GPIOC]         = {  0x26 },
+    [GPIOB]         = {  0x23 },
+}, dev1280_2560[PERIFMAX] = {
+    [USART3]        = { 0x130, POWER1, 2 },
+    [TIMER5]        = { 0x120, POWER1, 5, 0x73, 0x3a, true },
+    [GPIOL]         = { 0x109 },
+    [GPIOK]         = { 0x106 },
+    [GPIOJ]         = { 0x103 },
+    [GPIOH]         = { 0x100 },
+    [USART2]        = {  0xd0, POWER1, 1 },
+    [USART1]        = {  0xc8, POWER1, 0 },
+    [USART0]        = {  0xc0, POWER0, 1 },
+    [TIMER2]        = {  0xb0, POWER0, 6, 0x70, 0x37, false }, /* TODO async */
+    [TIMER4]        = {  0xa0, POWER1, 4, 0x72, 0x39, true },
+    [TIMER3]        = {  0x90, POWER1, 3, 0x71, 0x38, true },
+    [TIMER1]        = {  0x80, POWER0, 3, 0x6f, 0x36, true },
+    [POWER1]        = {  0x65 },
+    [POWER0]        = {  0x64 },
+    [TIMER0]        = {  0x44, POWER0, 5, 0x6e, 0x35, false },
+    [GPIOG]         = {  0x32 },
+    [GPIOF]         = {  0x2f },
+    [GPIOE]         = {  0x2c },
+    [GPIOD]         = {  0x29 },
+    [GPIOC]         = {  0x26 },
+    [GPIOB]         = {  0x23 },
+    [GPIOA]         = {  0x20 },
+};
+
+enum AtmegaIrq {
+    USART0_RXC_IRQ, USART0_DRE_IRQ, USART0_TXC_IRQ,
+    USART1_RXC_IRQ, USART1_DRE_IRQ, USART1_TXC_IRQ,
+    USART2_RXC_IRQ, USART2_DRE_IRQ, USART2_TXC_IRQ,
+    USART3_RXC_IRQ, USART3_DRE_IRQ, USART3_TXC_IRQ,
+    TIMER0_CAPT_IRQ, TIMER0_COMPA_IRQ, TIMER0_COMPB_IRQ,
+        TIMER0_COMPC_IRQ, TIMER0_OVF_IRQ,
+    TIMER1_CAPT_IRQ, TIMER1_COMPA_IRQ, TIMER1_COMPB_IRQ,
+        TIMER1_COMPC_IRQ, TIMER1_OVF_IRQ,
+    TIMER2_CAPT_IRQ, TIMER2_COMPA_IRQ, TIMER2_COMPB_IRQ,
+        TIMER2_COMPC_IRQ, TIMER2_OVF_IRQ,
+    TIMER3_CAPT_IRQ, TIMER3_COMPA_IRQ, TIMER3_COMPB_IRQ,
+        TIMER3_COMPC_IRQ, TIMER3_OVF_IRQ,
+    TIMER4_CAPT_IRQ, TIMER4_COMPA_IRQ, TIMER4_COMPB_IRQ,
+        TIMER4_COMPC_IRQ, TIMER4_OVF_IRQ,
+    TIMER5_CAPT_IRQ, TIMER5_COMPA_IRQ, TIMER5_COMPB_IRQ,
+        TIMER5_COMPC_IRQ, TIMER5_OVF_IRQ,
+    IRQ_COUNT
+};
+
+#define USART_IRQ_COUNT     3
+#define USART_RXC_IRQ(n)    (n * USART_IRQ_COUNT + USART0_RXC_IRQ)
+#define USART_DRE_IRQ(n)    (n * USART_IRQ_COUNT + USART0_DRE_IRQ)
+#define USART_TXC_IRQ(n)    (n * USART_IRQ_COUNT + USART0_TXC_IRQ)
+#define TIMER_IRQ_COUNT     5
+#define TIMER_CAPT_IRQ(n)   (n * TIMER_IRQ_COUNT + TIMER0_CAPT_IRQ)
+#define TIMER_COMPA_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPA_IRQ)
+#define TIMER_COMPB_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPB_IRQ)
+#define TIMER_COMPC_IRQ(n)  (n * TIMER_IRQ_COUNT + TIMER0_COMPC_IRQ)
+#define TIMER_OVF_IRQ(n)    (n * TIMER_IRQ_COUNT + TIMER0_OVF_IRQ)
+
+static const uint8_t irq168_328[IRQ_COUNT] = {
+    [TIMER2_COMPA_IRQ]      = 8,
+    [TIMER2_COMPB_IRQ]      = 9,
+    [TIMER2_OVF_IRQ]        = 10,
+    [TIMER1_CAPT_IRQ]       = 11,
+    [TIMER1_COMPA_IRQ]      = 12,
+    [TIMER1_COMPB_IRQ]      = 13,
+    [TIMER1_OVF_IRQ]        = 14,
+    [TIMER0_COMPA_IRQ]      = 15,
+    [TIMER0_COMPB_IRQ]      = 16,
+    [TIMER0_OVF_IRQ]        = 17,
+    [USART0_RXC_IRQ]        = 19,
+    [USART0_DRE_IRQ]        = 20,
+    [USART0_TXC_IRQ]        = 21,
+}, irq1280_2560[IRQ_COUNT] = {
+    [TIMER2_COMPA_IRQ]      = 14,
+    [TIMER2_COMPB_IRQ]      = 15,
+    [TIMER2_OVF_IRQ]        = 16,
+    [TIMER1_CAPT_IRQ]       = 17,
+    [TIMER1_COMPA_IRQ]      = 18,
+    [TIMER1_COMPB_IRQ]      = 19,
+    [TIMER1_COMPC_IRQ]      = 20,
+    [TIMER1_OVF_IRQ]        = 21,
+    [TIMER0_COMPA_IRQ]      = 22,
+    [TIMER0_COMPB_IRQ]      = 23,
+    [TIMER0_OVF_IRQ]        = 24,
+    [USART0_RXC_IRQ]        = 26,
+    [USART0_DRE_IRQ]        = 27,
+    [USART0_TXC_IRQ]        = 28,
+    [TIMER3_CAPT_IRQ]       = 32,
+    [TIMER3_COMPA_IRQ]      = 33,
+    [TIMER3_COMPB_IRQ]      = 34,
+    [TIMER3_COMPC_IRQ]      = 35,
+    [TIMER3_OVF_IRQ]        = 36,
+    [USART1_RXC_IRQ]        = 37,
+    [USART1_DRE_IRQ]        = 38,
+    [USART1_TXC_IRQ]        = 39,
+    [TIMER4_CAPT_IRQ]       = 42,
+    [TIMER4_COMPA_IRQ]      = 43,
+    [TIMER4_COMPB_IRQ]      = 44,
+    [TIMER4_COMPC_IRQ]      = 45,
+    [TIMER4_OVF_IRQ]        = 46,
+    [TIMER5_CAPT_IRQ]       = 47,
+    [TIMER5_COMPA_IRQ]      = 48,
+    [TIMER5_COMPB_IRQ]      = 49,
+    [TIMER5_COMPC_IRQ]      = 50,
+    [TIMER5_OVF_IRQ]        = 51,
+    [USART2_RXC_IRQ]        = 52,
+    [USART2_DRE_IRQ]        = 53,
+    [USART2_TXC_IRQ]        = 54,
+    [USART3_RXC_IRQ]        = 55,
+    [USART3_DRE_IRQ]        = 56,
+    [USART3_TXC_IRQ]        = 57,
+};
+
+static void connect_peripheral_irq(const AtmegaMcuClass *k,
+                                   SysBusDevice *dev, int dev_irqn,
+                                   DeviceState *cpu,
+                                   unsigned peripheral_index)
+{
+    int cpu_irq = k->irq[peripheral_index];
+
+    if (!cpu_irq) {
+        return;
+    }
+    /* FIXME move that to avr_cpu_set_int() once 'sample' board is removed */
+    assert(cpu_irq >= 2);
+    cpu_irq -= 2;
+
+    sysbus_connect_irq(dev, dev_irqn, qdev_get_gpio_in(cpu, cpu_irq));
+}
+
+static void connect_power_reduction_gpio(AtmegaMcuState *s,
+                                         const AtmegaMcuClass *k,
+                                         DeviceState *cpu,
+                                         unsigned peripheral_index)
+{
+    unsigned power_index = k->dev[peripheral_index].power_index;
+    assert(k->dev[power_index].addr);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->pwr[power_index - POWER0]),
+                       k->dev[peripheral_index].power_bit,
+                       qdev_get_gpio_in(cpu, 0));
+}
+
+static void atmega_realize(DeviceState *dev, Error **errp)
+{
+    AtmegaMcuState *s = ATMEGA_MCU(dev);
+    const AtmegaMcuClass *mc = ATMEGA_MCU_GET_CLASS(dev);
+    DeviceState *cpudev;
+    SysBusDevice *sbd;
+    char *devname;
+    size_t i;
+
+    assert(mc->io_size <= 0x200);
+
+    if (!s->xtal_freq_hz) {
+        error_setg(errp, "\"xtal-frequency-hz\" property must be provided.");
+        return;
+    }
+
+    /* CPU */
+    object_initialize_child(OBJECT(dev), "cpu", &s->cpu, mc->cpu_type);
+    object_property_set_bool(OBJECT(&s->cpu), "realized", true, &error_abort);
+    cpudev = DEVICE(&s->cpu);
+
+    /* SRAM */
+    memory_region_init_ram(&s->sram, OBJECT(dev), "sram", mc->sram_size,
+                           &error_abort);
+    memory_region_add_subregion(get_system_memory(),
+                                OFFSET_DATA + mc->io_size, &s->sram);
+
+    /* Flash */
+    memory_region_init_rom(&s->flash, OBJECT(dev),
+                           "flash", mc->flash_size, &error_fatal);
+    memory_region_add_subregion(get_system_memory(), OFFSET_CODE, &s->flash);
+
+    /*
+     * I/O
+     *
+     * 0x00 - 0x1f: Registers
+     * 0x20 - 0x5f: I/O memory
+     * 0x60 - 0xff: Extended I/O
+     */
+    s->io = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
+    qdev_prop_set_string(s->io, "name", "I/O");
+    qdev_prop_set_uint64(s->io, "size", mc->io_size);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(s->io), &error_fatal);
+    sysbus_mmio_map_overlap(SYS_BUS_DEVICE(s->io), 0, OFFSET_DATA, -1234);
+
+    /* Power Reduction */
+    for (i = 0; i < POWER_MAX; i++) {
+        int idx = POWER(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("power%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->pwr[i],
+                                TYPE_AVR_MASK);
+        sysbus_realize(SYS_BUS_DEVICE(&s->pwr[i]), &error_abort);
+        sysbus_mmio_map(SYS_BUS_DEVICE(&s->pwr[i]), 0,
+                        OFFSET_DATA + mc->dev[idx].addr);
+        g_free(devname);
+    }
+
+    /* GPIO */
+    for (i = 0; i < GPIO_MAX; i++) {
+        int idx = GPIO(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("atmega-gpio-%c", 'a' + (char)i);
+        create_unimplemented_device(devname,
+                                    OFFSET_DATA + mc->dev[idx].addr, 3);
+        g_free(devname);
+    }
+
+    /* USART */
+    for (i = 0; i < USART_MAX; i++) {
+        int idx = USART(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        devname = g_strdup_printf("usart%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->usart[i],
+                                TYPE_AVR_USART);
+        qdev_prop_set_chr(DEVICE(&s->usart[i]), "chardev", serial_hd(i));
+        sbd = SYS_BUS_DEVICE(&s->usart[i]);
+        sysbus_realize(sbd, &error_abort);
+        sysbus_mmio_map(sbd, 0, OFFSET_DATA + mc->dev[USART(i)].addr);
+        connect_peripheral_irq(mc, sbd, 0, cpudev, USART_RXC_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 1, cpudev, USART_DRE_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 2, cpudev, USART_TXC_IRQ(i));
+        connect_power_reduction_gpio(s, mc, DEVICE(&s->usart[i]), idx);
+        g_free(devname);
+    }
+
+    /* Timer */
+    for (i = 0; i < TIMER_MAX; i++) {
+        int idx = TIMER(i);
+        if (!mc->dev[idx].addr) {
+            continue;
+        }
+        if (!mc->dev[idx].is_timer16) {
+            create_unimplemented_device("avr-timer8",
+                                        OFFSET_DATA + mc->dev[idx].addr, 5);
+            create_unimplemented_device("avr-timer8-intmask",
+                                        OFFSET_DATA
+                                        + mc->dev[idx].intmask_addr, 1);
+            create_unimplemented_device("avr-timer8-intflag",
+                                        OFFSET_DATA
+                                        + mc->dev[idx].intflag_addr, 1);
+            continue;
+        }
+        devname = g_strdup_printf("timer%zu", i);
+        object_initialize_child(OBJECT(dev), devname, &s->timer[i],
+                                TYPE_AVR_TIMER16);
+        object_property_set_uint(OBJECT(&s->timer[i]), "cpu-frequency-hz",
+                                 s->xtal_freq_hz, &error_abort);
+        sbd = SYS_BUS_DEVICE(&s->timer[i]);
+        sysbus_realize(sbd, &error_abort);
+        sysbus_mmio_map(sbd, 0, OFFSET_DATA + mc->dev[idx].addr);
+        sysbus_mmio_map(sbd, 1, OFFSET_DATA + mc->dev[idx].intmask_addr);
+        sysbus_mmio_map(sbd, 2, OFFSET_DATA + mc->dev[idx].intflag_addr);
+        connect_peripheral_irq(mc, sbd, 0, cpudev, TIMER_CAPT_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 1, cpudev, TIMER_COMPA_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 2, cpudev, TIMER_COMPB_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 3, cpudev, TIMER_COMPC_IRQ(i));
+        connect_peripheral_irq(mc, sbd, 4, cpudev, TIMER_OVF_IRQ(i));
+        connect_power_reduction_gpio(s, mc, DEVICE(&s->timer[i]), idx);
+        g_free(devname);
+    }
+
+    create_unimplemented_device("avr-twi",          OFFSET_DATA + 0x0b8, 6);
+    create_unimplemented_device("avr-adc",          OFFSET_DATA + 0x078, 8);
+    create_unimplemented_device("avr-ext-mem-ctrl", OFFSET_DATA + 0x074, 2);
+    create_unimplemented_device("avr-watchdog",     OFFSET_DATA + 0x060, 1);
+    create_unimplemented_device("avr-spi",          OFFSET_DATA + 0x04c, 3);
+    create_unimplemented_device("avr-eeprom",       OFFSET_DATA + 0x03f, 3);
+}
+
+static Property atmega_props[] = {
+    DEFINE_PROP_UINT64("xtal-frequency-hz", AtmegaMcuState,
+                       xtal_freq_hz, 0),
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void atmega_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->realize = atmega_realize;
+    device_class_set_props(dc, atmega_props);
+    /* Reason: Mapped at fixed location on the system bus */
+    dc->user_creatable = false;
+}
+
+static void atmega168_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr5");
+    amc->flash_size = 16 * KiB;
+    amc->eeprom_size = 512;
+    amc->sram_size = 1 * KiB;
+    amc->io_size = 256;
+    amc->gpio_count = 23;
+    amc->adc_count = 6;
+    amc->irq = irq168_328;
+    amc->dev = dev168_328;
+};
+
+static void atmega328_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr5");
+    amc->flash_size = 32 * KiB;
+    amc->eeprom_size = 1 * KiB;
+    amc->sram_size = 2 * KiB;
+    amc->io_size = 256;
+    amc->gpio_count = 23;
+    amc->adc_count = 6;
+    amc->irq = irq168_328;
+    amc->dev = dev168_328;
+};
+
+static void atmega1280_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr6");
+    amc->flash_size = 128 * KiB;
+    amc->eeprom_size = 4 * KiB;
+    amc->sram_size = 8 * KiB;
+    amc->io_size = 512;
+    amc->gpio_count = 86;
+    amc->adc_count = 16;
+    amc->irq = irq1280_2560;
+    amc->dev = dev1280_2560;
+};
+
+static void atmega2560_class_init(ObjectClass *oc, void *data)
+{
+    AtmegaMcuClass *amc = ATMEGA_MCU_CLASS(oc);
+
+    amc->cpu_type = AVR_CPU_TYPE_NAME("avr6");
+    amc->flash_size = 256 * KiB;
+    amc->eeprom_size = 4 * KiB;
+    amc->sram_size = 8 * KiB;
+    amc->io_size = 512;
+    amc->gpio_count = 54;
+    amc->adc_count = 16;
+    amc->irq = irq1280_2560;
+    amc->dev = dev1280_2560;
+};
+
+static const TypeInfo atmega_mcu_types[] = {
+    {
+        .name           = TYPE_ATMEGA168_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega168_class_init,
+    }, {
+        .name           = TYPE_ATMEGA328_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega328_class_init,
+    }, {
+        .name           = TYPE_ATMEGA1280_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega1280_class_init,
+    }, {
+        .name           = TYPE_ATMEGA2560_MCU,
+        .parent         = TYPE_ATMEGA_MCU,
+        .class_init     = atmega2560_class_init,
+    }, {
+        .name           = TYPE_ATMEGA_MCU,
+        .parent         = TYPE_SYS_BUS_DEVICE,
+        .instance_size  = sizeof(AtmegaMcuState),
+        .class_size     = sizeof(AtmegaMcuClass),
+        .class_init     = atmega_class_init,
+        .abstract       = true,
+    }
+};
+
+DEFINE_TYPES(atmega_mcu_types)
diff --git a/hw/avr/atmega.h b/hw/avr/atmega.h
new file mode 100644
index 0000000000..0928cb0ce6
--- /dev/null
+++ b/hw/avr/atmega.h
@@ -0,0 +1,48 @@
+/*
+ * QEMU ATmega MCU
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_AVR_ATMEGA_H
+#define HW_AVR_ATMEGA_H
+
+#include "hw/char/avr_usart.h"
+#include "hw/timer/avr_timer16.h"
+#include "hw/misc/avr_power.h"
+#include "target/avr/cpu.h"
+
+#define TYPE_ATMEGA_MCU     "ATmega"
+#define TYPE_ATMEGA168_MCU  "ATmega168"
+#define TYPE_ATMEGA328_MCU  "ATmega328"
+#define TYPE_ATMEGA1280_MCU "ATmega1280"
+#define TYPE_ATMEGA2560_MCU "ATmega2560"
+
+#define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MCU)
+
+#define POWER_MAX 2
+#define USART_MAX 4
+#define TIMER_MAX 6
+#define GPIO_MAX 12
+
+typedef struct AtmegaMcuState {
+    /*< private >*/
+    SysBusDevice parent_obj;
+    /*< public >*/
+
+    AVRCPU cpu;
+    MemoryRegion flash;
+    MemoryRegion eeprom;
+    MemoryRegion sram;
+    DeviceState *io;
+    AVRMaskState pwr[POWER_MAX];
+    AVRUsartState usart[USART_MAX];
+    AVRTimer16State timer[TIMER_MAX];
+    uint64_t xtal_freq_hz;
+} AtmegaMcuState;
+
+#endif /* HW_AVR_ATMEGA_H */
diff --git a/hw/avr/boot.c b/hw/avr/boot.c
new file mode 100644
index 0000000000..6fbcde4061
--- /dev/null
+++ b/hw/avr/boot.c
@@ -0,0 +1,115 @@
+/*
+ * AVR loader helpers
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "hw/loader.h"
+#include "elf.h"
+#include "boot.h"
+#include "qemu/error-report.h"
+
+static const char *avr_elf_e_flags_to_cpu_type(uint32_t flags)
+{
+    switch (flags & EF_AVR_MACH) {
+    case bfd_mach_avr1:
+        return AVR_CPU_TYPE_NAME("avr1");
+    case bfd_mach_avr2:
+        return AVR_CPU_TYPE_NAME("avr2");
+    case bfd_mach_avr25:
+        return AVR_CPU_TYPE_NAME("avr25");
+    case bfd_mach_avr3:
+        return AVR_CPU_TYPE_NAME("avr3");
+    case bfd_mach_avr31:
+        return AVR_CPU_TYPE_NAME("avr31");
+    case bfd_mach_avr35:
+        return AVR_CPU_TYPE_NAME("avr35");
+    case bfd_mach_avr4:
+        return AVR_CPU_TYPE_NAME("avr4");
+    case bfd_mach_avr5:
+        return AVR_CPU_TYPE_NAME("avr5");
+    case bfd_mach_avr51:
+        return AVR_CPU_TYPE_NAME("avr51");
+    case bfd_mach_avr6:
+        return AVR_CPU_TYPE_NAME("avr6");
+    case bfd_mach_avrtiny:
+        return AVR_CPU_TYPE_NAME("avrtiny");
+    case bfd_mach_avrxmega2:
+        return AVR_CPU_TYPE_NAME("xmega2");
+    case bfd_mach_avrxmega3:
+        return AVR_CPU_TYPE_NAME("xmega3");
+    case bfd_mach_avrxmega4:
+        return AVR_CPU_TYPE_NAME("xmega4");
+    case bfd_mach_avrxmega5:
+        return AVR_CPU_TYPE_NAME("xmega5");
+    case bfd_mach_avrxmega6:
+        return AVR_CPU_TYPE_NAME("xmega6");
+    case bfd_mach_avrxmega7:
+        return AVR_CPU_TYPE_NAME("xmega7");
+    default:
+        return NULL;
+    }
+}
+
+bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
+                       MemoryRegion *program_mr, const char *firmware)
+{
+    const char *filename;
+    int bytes_loaded;
+    uint64_t entry;
+    uint32_t e_flags;
+
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware);
+    if (filename == NULL) {
+        error_report("Unable to find %s", firmware);
+        return false;
+    }
+
+    bytes_loaded = load_elf_ram_sym(filename,
+                                    NULL, NULL, NULL,
+                                    &entry, NULL, NULL,
+                                    &e_flags, 0, EM_AVR, 0, 0,
+                                    NULL, true, NULL);
+    if (bytes_loaded >= 0) {
+        /* If ELF file is provided, determine CPU type reading ELF e_flags. */
+        const char *elf_cpu = avr_elf_e_flags_to_cpu_type(e_flags);
+        const char *mcu_cpu_type = object_get_typename(OBJECT(cpu));
+        int cpu_len = strlen(mcu_cpu_type) - strlen(AVR_CPU_TYPE_SUFFIX);
+
+        if (entry) {
+            error_report("BIOS entry_point must be 0x0000 "
+                         "(ELF image '%s' has entry_point 0x%04" PRIx64 ")",
+                         firmware, entry);
+            return false;
+        }
+        if (!elf_cpu) {
+            warn_report("Could not determine CPU type for ELF image '%s', "
+                        "assuming '%.*s' CPU",
+                         firmware, cpu_len, mcu_cpu_type);
+            return true;
+        }
+        if (strcmp(elf_cpu, mcu_cpu_type)) {
+            error_report("Current machine: %s with '%.*s' CPU",
+                         MACHINE_GET_CLASS(ms)->desc, cpu_len, mcu_cpu_type);
+            error_report("ELF image '%s' is for '%.*s' CPU",
+                         firmware,
+                         (int)(strlen(elf_cpu) - strlen(AVR_CPU_TYPE_SUFFIX)),
+                         elf_cpu);
+            return false;
+        }
+    } else {
+        bytes_loaded = load_image_mr(filename, program_mr);
+    }
+    if (bytes_loaded < 0) {
+        error_report("Unable to load firmware image %s as ELF or raw binary",
+                     firmware);
+        return false;
+    }
+    return true;
+}
diff --git a/hw/avr/boot.h b/hw/avr/boot.h
new file mode 100644
index 0000000000..684d553322
--- /dev/null
+++ b/hw/avr/boot.h
@@ -0,0 +1,33 @@
+/*
+ * AVR loader helpers
+ *
+ * Copyright (c) 2019-2020 Philippe Mathieu-Daudé
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_AVR_BOOT_H
+#define HW_AVR_BOOT_H
+
+#include "hw/boards.h"
+#include "cpu.h"
+
+/**
+ * avr_load_firmware:   load an image into a memory region
+ *
+ * @cpu:        Handle a AVR CPU object
+ * @ms:         A MachineState
+ * @mr:         Memory Region to load into
+ * @firmware:   Path to the firmware file (raw binary or ELF format)
+ *
+ * Load a firmware supplied by the machine or by the user  with the
+ * '-bios' command line option, and put it in target memory.
+ *
+ * Returns: true on success, false on error.
+ */
+bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
+                       MemoryRegion *mr, const char *firmware);
+
+#endif
diff --git a/hw/char/Kconfig b/hw/char/Kconfig
index 874627520c..b7e0e4d5fa 100644
--- a/hw/char/Kconfig
+++ b/hw/char/Kconfig
@@ -49,3 +49,6 @@ config TERMINAL3270
 
 config RENESAS_SCI
     bool
+
+config AVR_USART
+    bool
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index 8306c4a789..bf177ac41d 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -22,6 +22,7 @@ common-obj-$(CONFIG_DIGIC) += digic-uart.o
 common-obj-$(CONFIG_STM32F2XX_USART) += stm32f2xx_usart.o
 common-obj-$(CONFIG_RASPI) += bcm2835_aux.o
 common-obj-$(CONFIG_RENESAS_SCI) += renesas_sci.o
+common-obj-$(CONFIG_AVR_USART) += avr_usart.o
 
 common-obj-$(CONFIG_CMSDK_APB_UART) += cmsdk-apb-uart.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o
diff --git a/hw/char/avr_usart.c b/hw/char/avr_usart.c
new file mode 100644
index 0000000000..fbe2a112b7
--- /dev/null
+++ b/hw/char/avr_usart.c
@@ -0,0 +1,320 @@
+/*
+ * AVR USART
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Sarah Harris
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#include "qemu/osdep.h"
+#include "hw/char/avr_usart.h"
+#include "qemu/log.h"
+#include "hw/irq.h"
+#include "hw/qdev-properties.h"
+
+static int avr_usart_can_receive(void *opaque)
+{
+    AVRUsartState *usart = opaque;
+
+    if (usart->data_valid || !(usart->csrb & USART_CSRB_RXEN)) {
+        return 0;
+    }
+    return 1;
+}
+
+static void avr_usart_receive(void *opaque, const uint8_t *buffer, int size)
+{
+    AVRUsartState *usart = opaque;
+    assert(size == 1);
+    assert(!usart->data_valid);
+    usart->data = buffer[0];
+    usart->data_valid = true;
+    usart->csra |= USART_CSRA_RXC;
+    if (usart->csrb & USART_CSRB_RXCIE) {
+        qemu_set_irq(usart->rxc_irq, 1);
+    }
+}
+
+static void update_char_mask(AVRUsartState *usart)
+{
+    uint8_t mode = ((usart->csrc & USART_CSRC_CSZ0) ? 1 : 0) |
+        ((usart->csrc & USART_CSRC_CSZ1) ? 2 : 0) |
+        ((usart->csrb & USART_CSRB_CSZ2) ? 4 : 0);
+    switch (mode) {
+    case 0:
+        usart->char_mask = 0b11111;
+        break;
+    case 1:
+        usart->char_mask = 0b111111;
+        break;
+    case 2:
+        usart->char_mask = 0b1111111;
+        break;
+    case 3:
+        usart->char_mask = 0b11111111;
+        break;
+    case 4:
+        /* Fallthrough. */
+    case 5:
+        /* Fallthrough. */
+    case 6:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Reserved character size 0x%x\n",
+            __func__,
+            mode);
+        break;
+    case 7:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Nine bit character size not supported (forcing eight)\n",
+            __func__);
+        usart->char_mask = 0b11111111;
+        break;
+    default:
+        assert(0);
+    }
+}
+
+static void avr_usart_reset(DeviceState *dev)
+{
+    AVRUsartState *usart = AVR_USART(dev);
+    usart->data_valid = false;
+    usart->csra = 0b00100000;
+    usart->csrb = 0b00000000;
+    usart->csrc = 0b00000110;
+    usart->brrl = 0;
+    usart->brrh = 0;
+    update_char_mask(usart);
+    qemu_set_irq(usart->rxc_irq, 0);
+    qemu_set_irq(usart->txc_irq, 0);
+    qemu_set_irq(usart->dre_irq, 0);
+}
+
+static uint64_t avr_usart_read(void *opaque, hwaddr addr, unsigned int size)
+{
+    AVRUsartState *usart = opaque;
+    uint8_t data;
+    assert(size == 1);
+
+    if (!usart->enabled) {
+        return 0;
+    }
+
+    switch (addr) {
+    case USART_DR:
+        if (!(usart->csrb & USART_CSRB_RXEN)) {
+            /* Receiver disabled, ignore. */
+            return 0;
+        }
+        if (usart->data_valid) {
+            data = usart->data & usart->char_mask;
+            usart->data_valid = false;
+        } else {
+            data = 0;
+        }
+        usart->csra &= 0xff ^ USART_CSRA_RXC;
+        qemu_set_irq(usart->rxc_irq, 0);
+        qemu_chr_fe_accept_input(&usart->chr);
+        return data;
+    case USART_CSRA:
+        return usart->csra;
+    case USART_CSRB:
+        return usart->csrb;
+    case USART_CSRC:
+        return usart->csrc;
+    case USART_BRRL:
+        return usart->brrl;
+    case USART_BRRH:
+        return usart->brrh;
+    default:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Bad offset 0x%"HWADDR_PRIx"\n",
+            __func__,
+            addr);
+    }
+    return 0;
+}
+
+static void avr_usart_write(void *opaque, hwaddr addr, uint64_t value,
+                                unsigned int size)
+{
+    AVRUsartState *usart = opaque;
+    uint8_t mask;
+    uint8_t data;
+    assert((value & 0xff) == value);
+    assert(size == 1);
+
+    if (!usart->enabled) {
+        return;
+    }
+
+    switch (addr) {
+    case USART_DR:
+        if (!(usart->csrb & USART_CSRB_TXEN)) {
+            /* Transmitter disabled, ignore. */
+            return;
+        }
+        usart->csra |= USART_CSRA_TXC;
+        usart->csra |= USART_CSRA_DRE;
+        if (usart->csrb & USART_CSRB_TXCIE) {
+            qemu_set_irq(usart->txc_irq, 1);
+            usart->csra &= 0xff ^ USART_CSRA_TXC;
+        }
+        if (usart->csrb & USART_CSRB_DREIE) {
+            qemu_set_irq(usart->dre_irq, 1);
+        }
+        data = value;
+        qemu_chr_fe_write_all(&usart->chr, &data, 1);
+        break;
+    case USART_CSRA:
+        mask = 0b01000011;
+        /* Mask read-only bits. */
+        value = (value & mask) | (usart->csra & (0xff ^ mask));
+        usart->csra = value;
+        if (value & USART_CSRA_TXC) {
+            usart->csra ^= USART_CSRA_TXC;
+            qemu_set_irq(usart->txc_irq, 0);
+        }
+        if (value & USART_CSRA_MPCM) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: MPCM not supported by USART\n",
+                __func__);
+        }
+        break;
+    case USART_CSRB:
+        mask = 0b11111101;
+        /* Mask read-only bits. */
+        value = (value & mask) | (usart->csrb & (0xff ^ mask));
+        usart->csrb = value;
+        if (!(value & USART_CSRB_RXEN)) {
+            /* Receiver disabled, flush input buffer. */
+            usart->data_valid = false;
+        }
+        qemu_set_irq(usart->rxc_irq,
+            ((value & USART_CSRB_RXCIE) &&
+            (usart->csra & USART_CSRA_RXC)) ? 1 : 0);
+        qemu_set_irq(usart->txc_irq,
+            ((value & USART_CSRB_TXCIE) &&
+            (usart->csra & USART_CSRA_TXC)) ? 1 : 0);
+        qemu_set_irq(usart->dre_irq,
+            ((value & USART_CSRB_DREIE) &&
+            (usart->csra & USART_CSRA_DRE)) ? 1 : 0);
+        update_char_mask(usart);
+        break;
+    case USART_CSRC:
+        usart->csrc = value;
+        if ((value & USART_CSRC_MSEL1) && (value & USART_CSRC_MSEL0)) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: SPI mode not supported by USART\n",
+                __func__);
+        }
+        if ((value & USART_CSRC_MSEL1) && !(value & USART_CSRC_MSEL0)) {
+            qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad USART mode\n", __func__);
+        }
+        if (!(value & USART_CSRC_PM1) && (value & USART_CSRC_PM0)) {
+            qemu_log_mask(
+                LOG_GUEST_ERROR,
+                "%s: Bad USART parity mode\n",
+                __func__);
+        }
+        update_char_mask(usart);
+        break;
+    case USART_BRRL:
+        usart->brrl = value;
+        break;
+    case USART_BRRH:
+        usart->brrh = value & 0b00001111;
+        break;
+    default:
+        qemu_log_mask(
+            LOG_GUEST_ERROR,
+            "%s: Bad offset 0x%"HWADDR_PRIx"\n",
+            __func__,
+            addr);
+    }
+}
+
+static const MemoryRegionOps avr_usart_ops = {
+    .read = avr_usart_read,
+    .write = avr_usart_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.min_access_size = 1, .max_access_size = 1}
+};
+
+static Property avr_usart_properties[] = {
+    DEFINE_PROP_CHR("chardev", AVRUsartState, chr),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void avr_usart_pr(void *opaque, int irq, int level)
+{
+    AVRUsartState *s = AVR_USART(opaque);
+
+    s->enabled = !level;
+
+    if (!s->enabled) {
+        avr_usart_reset(DEVICE(s));
+    }
+}
+
+static void avr_usart_init(Object *obj)
+{
+    AVRUsartState *s = AVR_USART(obj);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->rxc_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->dre_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->txc_irq);
+    memory_region_init_io(&s->mmio, obj, &avr_usart_ops, s, TYPE_AVR_USART, 7);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
+    qdev_init_gpio_in(DEVICE(s), avr_usart_pr, 1);
+    s->enabled = true;
+}
+
+static void avr_usart_realize(DeviceState *dev, Error **errp)
+{
+    AVRUsartState *s = AVR_USART(dev);
+    qemu_chr_fe_set_handlers(&s->chr, avr_usart_can_receive,
+                             avr_usart_receive, NULL, NULL,
+                             s, NULL, true);
+    avr_usart_reset(dev);
+}
+
+static void avr_usart_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_usart_reset;
+    device_class_set_props(dc, avr_usart_properties);
+    dc->realize = avr_usart_realize;
+}
+
+static const TypeInfo avr_usart_info = {
+    .name          = TYPE_AVR_USART,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRUsartState),
+    .instance_init = avr_usart_init,
+    .class_init    = avr_usart_class_init,
+};
+
+static void avr_usart_register_types(void)
+{
+    type_register_static(&avr_usart_info);
+}
+
+type_init(avr_usart_register_types)
diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig
index bdd77d8020..92c397ca07 100644
--- a/hw/misc/Kconfig
+++ b/hw/misc/Kconfig
@@ -131,4 +131,7 @@ config MAC_VIA
     select MOS6522
     select ADB
 
+config AVR_POWER
+    bool
+
 source macio/Kconfig
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 5aaca8a039..6be3d255ab 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -91,3 +91,5 @@ common-obj-$(CONFIG_NRF51_SOC) += nrf51_rng.o
 obj-$(CONFIG_MAC_VIA) += mac_via.o
 
 common-obj-$(CONFIG_GRLIB) += grlib_ahb_apb_pnp.o
+
+obj-$(CONFIG_AVR_POWER) += avr_power.o
diff --git a/hw/misc/avr_power.c b/hw/misc/avr_power.c
new file mode 100644
index 0000000000..a5412f2cfe
--- /dev/null
+++ b/hw/misc/avr_power.c
@@ -0,0 +1,113 @@
+/*
+ * AVR Power Reduction Management
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/misc/avr_power.h"
+#include "qemu/log.h"
+#include "hw/qdev-properties.h"
+#include "hw/irq.h"
+#include "trace.h"
+
+static void avr_mask_reset(DeviceState *dev)
+{
+    AVRMaskState *s = AVR_MASK(dev);
+
+    s->val = 0x00;
+
+    for (int i = 0; i < 8; i++) {
+        qemu_set_irq(s->irq[i], 0);
+    }
+}
+
+static uint64_t avr_mask_read(void *opaque, hwaddr offset, unsigned size)
+{
+    assert(size == 1);
+    assert(offset == 0);
+    AVRMaskState *s = opaque;
+
+    trace_avr_power_read(s->val);
+
+    return (uint64_t)s->val;
+}
+
+static void avr_mask_write(void *opaque, hwaddr offset,
+                           uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    assert(offset == 0);
+    AVRMaskState *s = opaque;
+    uint8_t val8 = val64;
+
+    trace_avr_power_write(val8);
+    s->val = val8;
+    for (int i = 0; i < 8; i++) {
+        qemu_set_irq(s->irq[i], (val8 & (1 << i)) != 0);
+    }
+}
+
+static const MemoryRegionOps avr_mask_ops = {
+    .read = avr_mask_read,
+    .write = avr_mask_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {
+        .max_access_size = 1,
+    },
+};
+
+static void avr_mask_init(Object *dev)
+{
+    AVRMaskState *s = AVR_MASK(dev);
+    SysBusDevice *busdev = SYS_BUS_DEVICE(dev);
+
+    memory_region_init_io(&s->iomem, dev, &avr_mask_ops, s, TYPE_AVR_MASK,
+                          0x01);
+    sysbus_init_mmio(busdev, &s->iomem);
+
+    for (int i = 0; i < 8; i++) {
+        sysbus_init_irq(busdev, &s->irq[i]);
+    }
+    s->val = 0x00;
+}
+
+static void avr_mask_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_mask_reset;
+}
+
+static const TypeInfo avr_mask_info = {
+    .name          = TYPE_AVR_MASK,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRMaskState),
+    .class_init    = avr_mask_class_init,
+    .instance_init = avr_mask_init,
+};
+
+static void avr_mask_register_types(void)
+{
+    type_register_static(&avr_mask_info);
+}
+
+type_init(avr_mask_register_types)
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index ebea53735c..066752aa90 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -19,6 +19,10 @@ allwinner_h3_dramphy_write(uint64_t offset, uint64_t data, unsigned size) "write
 allwinner_sid_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
 allwinner_sid_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
 
+# avr_power.c
+avr_power_read(uint8_t value) "power_reduc read value:%u"
+avr_power_write(uint8_t value) "power_reduc write value:%u"
+
 # eccmemctl.c
 ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x"
 ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x"
diff --git a/hw/timer/Kconfig b/hw/timer/Kconfig
index 59a667c503..8749edfb6a 100644
--- a/hw/timer/Kconfig
+++ b/hw/timer/Kconfig
@@ -41,3 +41,6 @@ config RENESAS_TMR
 
 config RENESAS_CMT
     bool
+
+config AVR_TIMER16
+    bool
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index a39f6ec0c2..1303b13e0d 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -37,3 +37,5 @@ common-obj-$(CONFIG_CMSDK_APB_TIMER) += cmsdk-apb-timer.o
 common-obj-$(CONFIG_CMSDK_APB_DUALTIMER) += cmsdk-apb-dualtimer.o
 common-obj-$(CONFIG_MSF2) += mss-timer.o
 common-obj-$(CONFIG_RASPI) += bcm2835_systmr.o
+
+obj-$(CONFIG_AVR_TIMER16) += avr_timer16.o
diff --git a/hw/timer/avr_timer16.c b/hw/timer/avr_timer16.c
new file mode 100644
index 0000000000..c48555da52
--- /dev/null
+++ b/hw/timer/avr_timer16.c
@@ -0,0 +1,621 @@
+/*
+ * AVR 16-bit timer
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Ed Robbins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+/*
+ * Driver for 16 bit timers on 8 bit AVR devices.
+ * Note:
+ * ATmega640/V-1280/V-1281/V-2560/V-2561/V timers 1, 3, 4 and 5 are 16 bit
+ */
+
+/*
+ * XXX TODO: Power Reduction Register support
+ *           prescaler pause support
+ *           PWM modes, GPIO, output capture pins, input compare pin
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qemu/log.h"
+#include "hw/irq.h"
+#include "hw/qdev-properties.h"
+#include "hw/timer/avr_timer16.h"
+#include "trace.h"
+
+/* Register offsets */
+#define T16_CRA     0x0
+#define T16_CRB     0x1
+#define T16_CRC     0x2
+#define T16_CNTL    0x4
+#define T16_CNTH    0x5
+#define T16_ICRL    0x6
+#define T16_ICRH    0x7
+#define T16_OCRAL   0x8
+#define T16_OCRAH   0x9
+#define T16_OCRBL   0xa
+#define T16_OCRBH   0xb
+#define T16_OCRCL   0xc
+#define T16_OCRCH   0xd
+
+/* Field masks */
+#define T16_CRA_WGM01   0x3
+#define T16_CRA_COMC    0xc
+#define T16_CRA_COMB    0x30
+#define T16_CRA_COMA    0xc0
+#define T16_CRA_OC_CONF \
+    (T16_CRA_COMA | T16_CRA_COMB | T16_CRA_COMC)
+
+#define T16_CRB_CS      0x7
+#define T16_CRB_WGM23   0x18
+#define T16_CRB_ICES    0x40
+#define T16_CRB_ICNC    0x80
+
+#define T16_CRC_FOCC    0x20
+#define T16_CRC_FOCB    0x40
+#define T16_CRC_FOCA    0x80
+
+/* Fields masks both TIMSK and TIFR (interrupt mask/flag registers) */
+#define T16_INT_TOV    0x1 /* Timer overflow */
+#define T16_INT_OCA    0x2 /* Output compare A */
+#define T16_INT_OCB    0x4 /* Output compare B */
+#define T16_INT_OCC    0x8 /* Output compare C */
+#define T16_INT_IC     0x20 /* Input capture */
+
+/* Clock source values */
+#define T16_CLKSRC_STOPPED     0
+#define T16_CLKSRC_DIV1        1
+#define T16_CLKSRC_DIV8        2
+#define T16_CLKSRC_DIV64       3
+#define T16_CLKSRC_DIV256      4
+#define T16_CLKSRC_DIV1024     5
+#define T16_CLKSRC_EXT_FALLING 6
+#define T16_CLKSRC_EXT_RISING  7
+
+/* Timer mode values (not including PWM modes) */
+#define T16_MODE_NORMAL     0
+#define T16_MODE_CTC_OCRA   4
+#define T16_MODE_CTC_ICR    12
+
+/* Accessors */
+#define CLKSRC(t16) (t16->crb & T16_CRB_CS)
+#define MODE(t16)   (((t16->crb & T16_CRB_WGM23) >> 1) | \
+                     (t16->cra & T16_CRA_WGM01))
+#define CNT(t16)    VAL16(t16->cntl, t16->cnth)
+#define OCRA(t16)   VAL16(t16->ocral, t16->ocrah)
+#define OCRB(t16)   VAL16(t16->ocrbl, t16->ocrbh)
+#define OCRC(t16)   VAL16(t16->ocrcl, t16->ocrch)
+#define ICR(t16)    VAL16(t16->icrl, t16->icrh)
+
+/* Helper macros */
+#define VAL16(l, h) ((h << 8) | l)
+#define DB_PRINT(fmt, args...) /* Nothing */
+
+static inline int64_t avr_timer16_ns_to_ticks(AVRTimer16State *t16, int64_t t)
+{
+    if (t16->period_ns == 0) {
+        return 0;
+    }
+    return t / t16->period_ns;
+}
+
+static void avr_timer16_update_cnt(AVRTimer16State *t16)
+{
+    uint16_t cnt;
+    cnt = avr_timer16_ns_to_ticks(t16, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) -
+                                       t16->reset_time_ns);
+    t16->cntl = (uint8_t)(cnt & 0xff);
+    t16->cnth = (uint8_t)((cnt & 0xff00) >> 8);
+}
+
+static inline void avr_timer16_recalc_reset_time(AVRTimer16State *t16)
+{
+    t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) -
+                         CNT(t16) * t16->period_ns;
+}
+
+static void avr_timer16_clock_reset(AVRTimer16State *t16)
+{
+    t16->cntl = 0;
+    t16->cnth = 0;
+    t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+}
+
+static void avr_timer16_clksrc_update(AVRTimer16State *t16)
+{
+    uint16_t divider = 0;
+    switch (CLKSRC(t16)) {
+    case T16_CLKSRC_EXT_FALLING:
+    case T16_CLKSRC_EXT_RISING:
+        qemu_log_mask(LOG_UNIMP, "%s: external clock source unsupported\n",
+                      __func__);
+        break;
+    case T16_CLKSRC_STOPPED:
+        break;
+    case T16_CLKSRC_DIV1:
+        divider = 1;
+        break;
+    case T16_CLKSRC_DIV8:
+        divider = 8;
+        break;
+    case T16_CLKSRC_DIV64:
+        divider = 64;
+        break;
+    case T16_CLKSRC_DIV256:
+        divider = 256;
+        break;
+    case T16_CLKSRC_DIV1024:
+        divider = 1024;
+        break;
+    default:
+        break;
+    }
+    if (divider) {
+        t16->freq_hz = t16->cpu_freq_hz / divider;
+        t16->period_ns = NANOSECONDS_PER_SECOND / t16->freq_hz;
+        trace_avr_timer16_clksrc_update(t16->freq_hz, t16->period_ns,
+                                        (uint64_t)(1e6 / t16->freq_hz));
+    }
+}
+
+static void avr_timer16_set_alarm(AVRTimer16State *t16)
+{
+    if (CLKSRC(t16) == T16_CLKSRC_EXT_FALLING ||
+        CLKSRC(t16) == T16_CLKSRC_EXT_RISING ||
+        CLKSRC(t16) == T16_CLKSRC_STOPPED) {
+        /* Timer is disabled or set to external clock source (unsupported) */
+        return;
+    }
+
+    uint64_t alarm_offset = 0xffff;
+    enum NextInterrupt next_interrupt = OVERFLOW;
+
+    switch (MODE(t16)) {
+    case T16_MODE_NORMAL:
+        /* Normal mode */
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16) &&
+            (t16->imsk & T16_INT_OCA)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+        break;
+    case T16_MODE_CTC_OCRA:
+        /* CTC mode, top = ocra */
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+       break;
+    case T16_MODE_CTC_ICR:
+        /* CTC mode, top = icr */
+        if (ICR(t16) < alarm_offset && ICR(t16) > CNT(t16)) {
+            alarm_offset = ICR(t16);
+            next_interrupt = CAPT;
+        }
+        if (OCRA(t16) < alarm_offset && OCRA(t16) > CNT(t16) &&
+            (t16->imsk & T16_INT_OCA)) {
+            alarm_offset = OCRA(t16);
+            next_interrupt = COMPA;
+        }
+        break;
+    default:
+        qemu_log_mask(LOG_UNIMP, "%s: pwm modes are unsupported\n",
+                      __func__);
+        return;
+    }
+    if (OCRB(t16) < alarm_offset && OCRB(t16) > CNT(t16) &&
+        (t16->imsk & T16_INT_OCB)) {
+        alarm_offset = OCRB(t16);
+        next_interrupt = COMPB;
+    }
+    if (OCRC(t16) < alarm_offset && OCRB(t16) > CNT(t16) &&
+        (t16->imsk & T16_INT_OCC)) {
+        alarm_offset = OCRB(t16);
+        next_interrupt = COMPC;
+    }
+    alarm_offset -= CNT(t16);
+
+    t16->next_interrupt = next_interrupt;
+    uint64_t alarm_ns =
+        t16->reset_time_ns + ((CNT(t16) + alarm_offset) * t16->period_ns);
+    timer_mod(t16->timer, alarm_ns);
+
+    trace_avr_timer16_next_alarm(alarm_offset * t16->period_ns);
+}
+
+static void avr_timer16_interrupt(void *opaque)
+{
+    AVRTimer16State *t16 = opaque;
+    uint8_t mode = MODE(t16);
+
+    avr_timer16_update_cnt(t16);
+
+    if (CLKSRC(t16) == T16_CLKSRC_EXT_FALLING ||
+        CLKSRC(t16) == T16_CLKSRC_EXT_RISING ||
+        CLKSRC(t16) == T16_CLKSRC_STOPPED) {
+        /* Timer is disabled or set to external clock source (unsupported) */
+        return;
+    }
+
+    trace_avr_timer16_interrupt_count(CNT(t16));
+
+    /* Counter overflow */
+    if (t16->next_interrupt == OVERFLOW) {
+        trace_avr_timer16_interrupt_overflow("counter 0xffff");
+        avr_timer16_clock_reset(t16);
+        if (t16->imsk & T16_INT_TOV) {
+            t16->ifr |= T16_INT_TOV;
+            qemu_set_irq(t16->ovf_irq, 1);
+        }
+    }
+    /* Check for ocra overflow in CTC mode */
+    if (mode == T16_MODE_CTC_OCRA && t16->next_interrupt == COMPA) {
+        trace_avr_timer16_interrupt_overflow("CTC OCRA");
+        avr_timer16_clock_reset(t16);
+    }
+    /* Check for icr overflow in CTC mode */
+    if (mode == T16_MODE_CTC_ICR && t16->next_interrupt == CAPT) {
+        trace_avr_timer16_interrupt_overflow("CTC ICR");
+        avr_timer16_clock_reset(t16);
+        if (t16->imsk & T16_INT_IC) {
+            t16->ifr |= T16_INT_IC;
+            qemu_set_irq(t16->capt_irq, 1);
+        }
+    }
+    /* Check for output compare interrupts */
+    if (t16->imsk & T16_INT_OCA && t16->next_interrupt == COMPA) {
+        t16->ifr |= T16_INT_OCA;
+        qemu_set_irq(t16->compa_irq, 1);
+    }
+    if (t16->imsk & T16_INT_OCB && t16->next_interrupt == COMPB) {
+        t16->ifr |= T16_INT_OCB;
+        qemu_set_irq(t16->compb_irq, 1);
+    }
+    if (t16->imsk & T16_INT_OCC && t16->next_interrupt == COMPC) {
+        t16->ifr |= T16_INT_OCC;
+        qemu_set_irq(t16->compc_irq, 1);
+    }
+    avr_timer16_set_alarm(t16);
+}
+
+static void avr_timer16_reset(DeviceState *dev)
+{
+    AVRTimer16State *t16 = AVR_TIMER16(dev);
+
+    avr_timer16_clock_reset(t16);
+    avr_timer16_clksrc_update(t16);
+    avr_timer16_set_alarm(t16);
+
+    qemu_set_irq(t16->capt_irq, 0);
+    qemu_set_irq(t16->compa_irq, 0);
+    qemu_set_irq(t16->compb_irq, 0);
+    qemu_set_irq(t16->compc_irq, 0);
+    qemu_set_irq(t16->ovf_irq, 0);
+}
+
+static uint64_t avr_timer16_read(void *opaque, hwaddr offset, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    uint8_t retval = 0;
+
+    switch (offset) {
+    case T16_CRA:
+        retval = t16->cra;
+        break;
+    case T16_CRB:
+        retval = t16->crb;
+        break;
+    case T16_CRC:
+        retval = t16->crc;
+        break;
+    case T16_CNTL:
+        avr_timer16_update_cnt(t16);
+        t16->rtmp = t16->cnth;
+        retval = t16->cntl;
+        break;
+    case T16_CNTH:
+        retval = t16->rtmp;
+        break;
+    case T16_ICRL:
+        /*
+         * The timer copies cnt to icr when the input capture pin changes
+         * state or when the analog comparator has a match. We don't
+         * emulate this behaviour. We do support it's use for defining a
+         * TOP value in T16_MODE_CTC_ICR
+         */
+        t16->rtmp = t16->icrh;
+        retval = t16->icrl;
+        break;
+    case T16_ICRH:
+        retval = t16->rtmp;
+        break;
+    case T16_OCRAL:
+        retval = t16->ocral;
+        break;
+    case T16_OCRAH:
+        retval = t16->ocrah;
+        break;
+    case T16_OCRBL:
+        retval = t16->ocrbl;
+        break;
+    case T16_OCRBH:
+        retval = t16->ocrbh;
+        break;
+    case T16_OCRCL:
+        retval = t16->ocrcl;
+        break;
+    case T16_OCRCH:
+        retval = t16->ocrch;
+        break;
+    default:
+        break;
+    }
+    trace_avr_timer16_read(offset, retval);
+
+    return (uint64_t)retval;
+}
+
+static void avr_timer16_write(void *opaque, hwaddr offset,
+                              uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    uint8_t val8 = (uint8_t)val64;
+    uint8_t prev_clk_src = CLKSRC(t16);
+
+    trace_avr_timer16_write(offset, val8);
+
+    switch (offset) {
+    case T16_CRA:
+        t16->cra = val8;
+        if (t16->cra & T16_CRA_OC_CONF) {
+            qemu_log_mask(LOG_UNIMP, "%s: output compare pins unsupported\n",
+                          __func__);
+        }
+        break;
+    case T16_CRB:
+        t16->crb = val8;
+        if (t16->crb & T16_CRB_ICNC) {
+            qemu_log_mask(LOG_UNIMP,
+                          "%s: input capture noise canceller unsupported\n",
+                          __func__);
+        }
+        if (t16->crb & T16_CRB_ICES) {
+            qemu_log_mask(LOG_UNIMP, "%s: input capture unsupported\n",
+                          __func__);
+        }
+        if (CLKSRC(t16) != prev_clk_src) {
+            avr_timer16_clksrc_update(t16);
+            if (prev_clk_src == T16_CLKSRC_STOPPED) {
+                t16->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+            }
+        }
+        break;
+    case T16_CRC:
+        t16->crc = val8;
+        qemu_log_mask(LOG_UNIMP, "%s: output compare pins unsupported\n",
+                      __func__);
+        break;
+    case T16_CNTL:
+        /*
+         * CNT is the 16-bit counter value, it must be read/written via
+         * a temporary register (rtmp) to make the read/write atomic.
+         */
+        /* ICR also has this behaviour, and shares rtmp */
+        /*
+         * Writing CNT blocks compare matches for one clock cycle.
+         * Writing CNT to TOP or to an OCR value (if in use) will
+         * skip the relevant interrupt
+         */
+        t16->cntl = val8;
+        t16->cnth = t16->rtmp;
+        avr_timer16_recalc_reset_time(t16);
+        break;
+    case T16_CNTH:
+        t16->rtmp = val8;
+        break;
+    case T16_ICRL:
+        /* ICR can only be written in mode T16_MODE_CTC_ICR */
+        if (MODE(t16) == T16_MODE_CTC_ICR) {
+            t16->icrl = val8;
+            t16->icrh = t16->rtmp;
+        }
+        break;
+    case T16_ICRH:
+        if (MODE(t16) == T16_MODE_CTC_ICR) {
+            t16->rtmp = val8;
+        }
+        break;
+    case T16_OCRAL:
+        /*
+         * OCRn cause the relevant output compare flag to be raised, and
+         * trigger an interrupt, when CNT is equal to the value here
+         */
+        t16->ocral = val8;
+        break;
+    case T16_OCRAH:
+        t16->ocrah = val8;
+        break;
+    case T16_OCRBL:
+        t16->ocrbl = val8;
+        break;
+    case T16_OCRBH:
+        t16->ocrbh = val8;
+        break;
+    case T16_OCRCL:
+        t16->ocrcl = val8;
+        break;
+    case T16_OCRCH:
+        t16->ocrch = val8;
+        break;
+    default:
+        break;
+    }
+    avr_timer16_set_alarm(t16);
+}
+
+static uint64_t avr_timer16_imsk_read(void *opaque,
+                                      hwaddr offset,
+                                      unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_read_imsk(offset ? 0 : t16->imsk);
+    if (offset != 0) {
+        return 0;
+    }
+    return t16->imsk;
+}
+
+static void avr_timer16_imsk_write(void *opaque, hwaddr offset,
+                                   uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_write_imsk(val64);
+    if (offset != 0) {
+        return;
+    }
+    t16->imsk = (uint8_t)val64;
+}
+
+static uint64_t avr_timer16_ifr_read(void *opaque,
+                                     hwaddr offset,
+                                     unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_read_ifr(offset ? 0 : t16->ifr);
+    if (offset != 0) {
+        return 0;
+    }
+    return t16->ifr;
+}
+
+static void avr_timer16_ifr_write(void *opaque, hwaddr offset,
+                                  uint64_t val64, unsigned size)
+{
+    assert(size == 1);
+    AVRTimer16State *t16 = opaque;
+    trace_avr_timer16_write_imsk(val64);
+    if (offset != 0) {
+        return;
+    }
+    t16->ifr = (uint8_t)val64;
+}
+
+static const MemoryRegionOps avr_timer16_ops = {
+    .read = avr_timer16_read,
+    .write = avr_timer16_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static const MemoryRegionOps avr_timer16_imsk_ops = {
+    .read = avr_timer16_imsk_read,
+    .write = avr_timer16_imsk_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static const MemoryRegionOps avr_timer16_ifr_ops = {
+    .read = avr_timer16_ifr_read,
+    .write = avr_timer16_ifr_write,
+    .endianness = DEVICE_NATIVE_ENDIAN,
+    .impl = {.max_access_size = 1}
+};
+
+static Property avr_timer16_properties[] = {
+    DEFINE_PROP_UINT8("id", struct AVRTimer16State, id, 0),
+    DEFINE_PROP_UINT64("cpu-frequency-hz", struct AVRTimer16State,
+                       cpu_freq_hz, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void avr_timer16_pr(void *opaque, int irq, int level)
+{
+    AVRTimer16State *s = AVR_TIMER16(opaque);
+
+    s->enabled = !level;
+
+    if (!s->enabled) {
+        avr_timer16_reset(DEVICE(s));
+    }
+}
+
+static void avr_timer16_init(Object *obj)
+{
+    AVRTimer16State *s = AVR_TIMER16(obj);
+
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->capt_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compa_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compb_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->compc_irq);
+    sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->ovf_irq);
+
+    memory_region_init_io(&s->iomem, obj, &avr_timer16_ops,
+                          s, "avr-timer16", 0xe);
+    memory_region_init_io(&s->imsk_iomem, obj, &avr_timer16_imsk_ops,
+                          s, "avr-timer16-intmask", 0x1);
+    memory_region_init_io(&s->ifr_iomem, obj, &avr_timer16_ifr_ops,
+                          s, "avr-timer16-intflag", 0x1);
+
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->imsk_iomem);
+    sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->ifr_iomem);
+    qdev_init_gpio_in(DEVICE(s), avr_timer16_pr, 1);
+}
+
+static void avr_timer16_realize(DeviceState *dev, Error **errp)
+{
+    AVRTimer16State *s = AVR_TIMER16(dev);
+
+    if (s->cpu_freq_hz == 0) {
+        error_setg(errp, "AVR timer16: cpu-frequency-hz property must be set");
+        return;
+    }
+
+    s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, avr_timer16_interrupt, s);
+    s->enabled = true;
+}
+
+static void avr_timer16_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->reset = avr_timer16_reset;
+    dc->realize = avr_timer16_realize;
+    device_class_set_props(dc, avr_timer16_properties);
+}
+
+static const TypeInfo avr_timer16_info = {
+    .name          = TYPE_AVR_TIMER16,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(AVRTimer16State),
+    .instance_init = avr_timer16_init,
+    .class_init    = avr_timer16_class_init,
+};
+
+static void avr_timer16_register_types(void)
+{
+    type_register_static(&avr_timer16_info);
+}
+
+type_init(avr_timer16_register_types)
diff --git a/hw/timer/trace-events b/hw/timer/trace-events
index 866c9f546a..447b7c405b 100644
--- a/hw/timer/trace-events
+++ b/hw/timer/trace-events
@@ -75,3 +75,15 @@ nrf51_timer_set_count(uint8_t timer_id, uint8_t counter_id, uint32_t value) "tim
 bcm2835_systmr_irq(bool enable) "timer irq state %u"
 bcm2835_systmr_read(uint64_t offset, uint64_t data) "timer read: offset 0x%" PRIx64 " data 0x%" PRIx64
 bcm2835_systmr_write(uint64_t offset, uint64_t data) "timer write: offset 0x%" PRIx64 " data 0x%" PRIx64
+
+# avr_timer16.c
+avr_timer16_read(uint8_t addr, uint8_t value) "timer16 read addr:%u value:%u"
+avr_timer16_read_ifr(uint8_t value) "timer16 read addr:ifr value:%u"
+avr_timer16_read_imsk(uint8_t value) "timer16 read addr:imsk value:%u"
+avr_timer16_write(uint8_t addr, uint8_t value) "timer16 write addr:%u value:%u"
+avr_timer16_write_ifr(uint8_t value) "timer16 write addr:ifr value:%u"
+avr_timer16_write_imsk(uint8_t value) "timer16 write addr:imsk value:%u"
+avr_timer16_interrupt_count(uint8_t cnt) "count: %u"
+avr_timer16_interrupt_overflow(const char *reason) "overflow: %s"
+avr_timer16_next_alarm(uint64_t delay_ns) "next alarm: %" PRIu64 " ns from now"
+avr_timer16_clksrc_update(uint64_t freq_hz, uint64_t period_ns, uint64_t delay_s) "timer frequency: %" PRIu64 " Hz, period: %" PRIu64 " ns (%" PRId64 " us)"
diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index c5f9fa08ab..9856bf7921 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -211,6 +211,25 @@ enum bfd_architecture
 #define bfd_mach_m32r          0  /* backwards compatibility */
   bfd_arch_mn10200,    /* Matsushita MN10200 */
   bfd_arch_mn10300,    /* Matsushita MN10300 */
+  bfd_arch_avr,        /* AVR microcontrollers */
+#define bfd_mach_avr1       1
+#define bfd_mach_avr2       2
+#define bfd_mach_avr25      25
+#define bfd_mach_avr3       3
+#define bfd_mach_avr31      31
+#define bfd_mach_avr35      35
+#define bfd_mach_avr4       4
+#define bfd_mach_avr5       5
+#define bfd_mach_avr51      51
+#define bfd_mach_avr6       6
+#define bfd_mach_avrtiny    100
+#define bfd_mach_avrxmega1  101
+#define bfd_mach_avrxmega2  102
+#define bfd_mach_avrxmega3  103
+#define bfd_mach_avrxmega4  104
+#define bfd_mach_avrxmega5  105
+#define bfd_mach_avrxmega6  106
+#define bfd_mach_avrxmega7  107
   bfd_arch_cris,       /* Axis CRIS */
 #define bfd_mach_cris_v0_v10   255
 #define bfd_mach_cris_v32      32
diff --git a/include/elf.h b/include/elf.h
index 8fbfe60e09..5b06b55f28 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -160,6 +160,8 @@ typedef struct mips_elf_abiflags_v0 {
 
 #define EM_CRIS         76      /* Axis Communications 32-bit embedded processor */
 
+#define EM_AVR          83      /* AVR 8-bit microcontroller */
+
 #define EM_V850		87	/* NEC v850 */
 
 #define EM_H8_300H      47      /* Hitachi H8/300H */
@@ -202,6 +204,8 @@ typedef struct mips_elf_abiflags_v0 {
 #define EM_MOXIE           223     /* Moxie processor family */
 #define EM_MOXIE_OLD       0xFEED
 
+#define EF_AVR_MACH     0x7F       /* Mask for AVR e_flags to get core type */
+
 /* This is the info that is needed to parse the dynamic section of the file */
 #define DT_NULL		0
 #define DT_NEEDED	1
diff --git a/include/hw/char/avr_usart.h b/include/hw/char/avr_usart.h
new file mode 100644
index 0000000000..5739aaf26f
--- /dev/null
+++ b/include/hw/char/avr_usart.h
@@ -0,0 +1,93 @@
+/*
+ * AVR USART
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Sarah Harris
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef HW_CHAR_AVR_USART_H
+#define HW_CHAR_AVR_USART_H
+
+#include "hw/sysbus.h"
+#include "chardev/char-fe.h"
+#include "hw/hw.h"
+
+/* Offsets of registers. */
+#define USART_DR   0x06
+#define USART_CSRA  0x00
+#define USART_CSRB  0x01
+#define USART_CSRC  0x02
+#define USART_BRRH 0x05
+#define USART_BRRL 0x04
+
+/* Relevant bits in regiters. */
+#define USART_CSRA_RXC    (1 << 7)
+#define USART_CSRA_TXC    (1 << 6)
+#define USART_CSRA_DRE    (1 << 5)
+#define USART_CSRA_MPCM   (1 << 0)
+
+#define USART_CSRB_RXCIE  (1 << 7)
+#define USART_CSRB_TXCIE  (1 << 6)
+#define USART_CSRB_DREIE  (1 << 5)
+#define USART_CSRB_RXEN   (1 << 4)
+#define USART_CSRB_TXEN   (1 << 3)
+#define USART_CSRB_CSZ2   (1 << 2)
+#define USART_CSRB_RXB8   (1 << 1)
+#define USART_CSRB_TXB8   (1 << 0)
+
+#define USART_CSRC_MSEL1  (1 << 7)
+#define USART_CSRC_MSEL0  (1 << 6)
+#define USART_CSRC_PM1    (1 << 5)
+#define USART_CSRC_PM0    (1 << 4)
+#define USART_CSRC_CSZ1   (1 << 2)
+#define USART_CSRC_CSZ0   (1 << 1)
+
+#define TYPE_AVR_USART "avr-usart"
+#define AVR_USART(obj) \
+    OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion mmio;
+
+    CharBackend chr;
+
+    bool enabled;
+
+    uint8_t data;
+    bool data_valid;
+    uint8_t char_mask;
+    /* Control and Status Registers */
+    uint8_t csra;
+    uint8_t csrb;
+    uint8_t csrc;
+    /* Baud Rate Registers (low/high byte) */
+    uint8_t brrh;
+    uint8_t brrl;
+
+    /* Receive Complete */
+    qemu_irq rxc_irq;
+    /* Transmit Complete */
+    qemu_irq txc_irq;
+    /* Data Register Empty */
+    qemu_irq dre_irq;
+} AVRUsartState;
+
+#endif /* HW_CHAR_AVR_USART_H */
diff --git a/include/hw/misc/avr_power.h b/include/hw/misc/avr_power.h
new file mode 100644
index 0000000000..e08e44f629
--- /dev/null
+++ b/include/hw/misc/avr_power.h
@@ -0,0 +1,46 @@
+/*
+ * AVR Power Reduction Management
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * 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 HW_MISC_AVR_POWER_H
+#define HW_MISC_AVR_POWER_H
+
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+
+
+#define TYPE_AVR_MASK "avr-power"
+#define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+
+    uint8_t val;
+    qemu_irq irq[8];
+} AVRMaskState;
+
+#endif /* HW_MISC_AVR_POWER_H */
diff --git a/include/hw/timer/avr_timer16.h b/include/hw/timer/avr_timer16.h
new file mode 100644
index 0000000000..982019d242
--- /dev/null
+++ b/include/hw/timer/avr_timer16.h
@@ -0,0 +1,94 @@
+/*
+ * AVR 16-bit timer
+ *
+ * Copyright (c) 2018 University of Kent
+ * Author: Ed Robbins
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+/*
+ * Driver for 16 bit timers on 8 bit AVR devices.
+ * Note:
+ * On ATmega640/V-1280/V-1281/V-2560/V-2561/V timers 1, 3, 4 and 5 are 16 bit
+ */
+
+#ifndef HW_TIMER_AVR_TIMER16_H
+#define HW_TIMER_AVR_TIMER16_H
+
+#include "hw/sysbus.h"
+#include "qemu/timer.h"
+#include "hw/hw.h"
+
+enum NextInterrupt {
+    OVERFLOW,
+    COMPA,
+    COMPB,
+    COMPC,
+    CAPT
+};
+
+#define TYPE_AVR_TIMER16 "avr-timer16"
+#define AVR_TIMER16(obj) \
+    OBJECT_CHECK(AVRTimer16State, (obj), TYPE_AVR_TIMER16)
+
+typedef struct AVRTimer16State {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+    MemoryRegion imsk_iomem;
+    MemoryRegion ifr_iomem;
+    QEMUTimer *timer;
+    qemu_irq capt_irq;
+    qemu_irq compa_irq;
+    qemu_irq compb_irq;
+    qemu_irq compc_irq;
+    qemu_irq ovf_irq;
+
+    bool enabled;
+
+    /* registers */
+    uint8_t cra;
+    uint8_t crb;
+    uint8_t crc;
+    uint8_t cntl;
+    uint8_t cnth;
+    uint8_t icrl;
+    uint8_t icrh;
+    uint8_t ocral;
+    uint8_t ocrah;
+    uint8_t ocrbl;
+    uint8_t ocrbh;
+    uint8_t ocrcl;
+    uint8_t ocrch;
+    /*
+     * Reads and writes to CNT and ICR utilise a bizarre temporary
+     * register, which we emulate
+     */
+    uint8_t rtmp;
+    uint8_t imsk;
+    uint8_t ifr;
+
+    uint8_t id;
+    uint64_t cpu_freq_hz;
+    uint64_t freq_hz;
+    uint64_t period_ns;
+    uint64_t reset_time_ns;
+    enum NextInterrupt next_interrupt;
+} AVRTimer16State;
+
+#endif /* HW_TIMER_AVR_TIMER16_H */
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index 71a7a285ee..54f069d491 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -25,6 +25,7 @@ enum {
     QEMU_ARCH_HPPA = (1 << 18),
     QEMU_ARCH_RISCV = (1 << 19),
     QEMU_ARCH_RX = (1 << 20),
+    QEMU_ARCH_AVR = (1 << 21),
 
     QEMU_ARCH_NONE = (1 << 31),
 };
diff --git a/qapi/machine.json b/qapi/machine.json
index ff7b5032e3..f59144023c 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -17,6 +17,7 @@
 # being.
 #
 # @rx: since 5.0
+# @avr: since 5.1
 #
 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
 #        prefix to produce the corresponding QEMU executable name. This
@@ -25,7 +26,7 @@
 # Since: 3.0
 ##
 { 'enum' : 'SysEmuTarget',
-  'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
+  'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386', 'lm32',
              'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
              'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
              'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c
index 8afea4748b..7fd5c09b2b 100644
--- a/softmmu/arch_init.c
+++ b/softmmu/arch_init.c
@@ -90,6 +90,8 @@ int graphic_depth = 32;
 #define QEMU_ARCH QEMU_ARCH_UNICORE32
 #elif defined(TARGET_XTENSA)
 #define QEMU_ARCH QEMU_ARCH_XTENSA
+#elif defined(TARGET_AVR)
+#define QEMU_ARCH QEMU_ARCH_AVR
 #endif
 
 const uint32_t arch_type = QEMU_ARCH;
diff --git a/target/avr/Makefile.objs b/target/avr/Makefile.objs
new file mode 100644
index 0000000000..6e35ba2c5c
--- /dev/null
+++ b/target/avr/Makefile.objs
@@ -0,0 +1,34 @@
+#
+#  QEMU AVR
+#
+#  Copyright (c) 2016-2020 Michael Rolnik
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License, or (at your option) any later version.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, see
+#  <http://www.gnu.org/licenses/lgpl-2.1.html>
+#
+
+DECODETREE = $(SRC_PATH)/scripts/decodetree.py
+decode-y = $(SRC_PATH)/target/avr/insn.decode
+
+target/avr/decode_insn.inc.c: $(decode-y) $(DECODETREE)
+	$(call quiet-command, \
+	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn --insnwidth 16 $<, \
+	  "GEN", $(TARGET_DIR)$@)
+
+target/avr/translate.o: target/avr/decode_insn.inc.c
+
+obj-y += translate.o cpu.o helper.o
+obj-y += gdbstub.o
+obj-y += disas.o
+obj-$(CONFIG_SOFTMMU) += machine.o
diff --git a/target/avr/cpu-param.h b/target/avr/cpu-param.h
new file mode 100644
index 0000000000..7ef4e7c679
--- /dev/null
+++ b/target/avr/cpu-param.h
@@ -0,0 +1,36 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef AVR_CPU_PARAM_H
+#define AVR_CPU_PARAM_H
+
+#define TARGET_LONG_BITS 32
+/*
+ * TARGET_PAGE_BITS cannot be more than 8 bits because
+ * 1.  all IO registers occupy [0x0000 .. 0x00ff] address range, and they
+ *     should be implemented as a device and not memory
+ * 2.  SRAM starts at the address 0x0100
+ */
+#define TARGET_PAGE_BITS 8
+#define TARGET_PHYS_ADDR_SPACE_BITS 24
+#define TARGET_VIRT_ADDR_SPACE_BITS 24
+#define NB_MMU_MODES 2
+
+#endif
diff --git a/target/avr/cpu-qom.h b/target/avr/cpu-qom.h
new file mode 100644
index 0000000000..d23ad43a99
--- /dev/null
+++ b/target/avr/cpu-qom.h
@@ -0,0 +1,53 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2016-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#ifndef QEMU_AVR_QOM_H
+#define QEMU_AVR_QOM_H
+
+#include "hw/core/cpu.h"
+
+#define TYPE_AVR_CPU "avr-cpu"
+
+#define AVR_CPU_CLASS(klass) \
+    OBJECT_CLASS_CHECK(AVRCPUClass, (klass), TYPE_AVR_CPU)
+#define AVR_CPU(obj) \
+    OBJECT_CHECK(AVRCPU, (obj), TYPE_AVR_CPU)
+#define AVR_CPU_GET_CLASS(obj) \
+    OBJECT_GET_CLASS(AVRCPUClass, (obj), TYPE_AVR_CPU)
+
+/**
+ *  AVRCPUClass:
+ *  @parent_realize: The parent class' realize handler.
+ *  @parent_reset: The parent class' reset handler.
+ *  @vr: Version Register value.
+ *
+ *  A AVR CPU model.
+ */
+typedef struct AVRCPUClass {
+    /*< private >*/
+    CPUClass parent_class;
+    /*< public >*/
+    DeviceRealize parent_realize;
+    DeviceReset parent_reset;
+} AVRCPUClass;
+
+typedef struct AVRCPU AVRCPU;
+
+#endif /* !defined (QEMU_AVR_CPU_QOM_H) */
diff --git a/target/avr/cpu.c b/target/avr/cpu.c
new file mode 100644
index 0000000000..5d9c4ad5bf
--- /dev/null
+++ b/target/avr/cpu.c
@@ -0,0 +1,366 @@
+/*
+ * QEMU AVR CPU
+ *
+ * Copyright (c) 2019-2020 Michael Rolnik
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/lgpl-2.1.html>
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qemu/qemu-print.h"
+#include "exec/exec-all.h"
+#include "cpu.h"
+#include "disas/dis-asm.h"
+
+static void avr_cpu_set_pc(CPUState *cs, vaddr value)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+
+    cpu->env.pc_w = value / 2; /* internally PC points to words */
+}
+
+static bool avr_cpu_has_work(CPUState *cs)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+    CPUAVRState *env = &cpu->env;
+
+    return (cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_RESET))
+            && cpu_interrupts_enabled(env);
+}
+
+static void avr_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb)
+{
+    AVRCPU *cpu = AVR_CPU(cs);
+    CPUAVRState *env = &cpu->env;
+
+    env->pc_w = tb->pc / 2; /* internally PC points to words */
+}
+
+static void avr_cpu_reset(DeviceState *ds)
+{
+    CPUState *cs = CPU(ds);
+    AVRCPU *cpu = AVR_CPU(cs);
+    AVRCPUClass *mcc = AVR_CPU_GET_CLASS(cpu);
+    CPUAVRState *env = &cpu->env;
+
+    mcc->parent_reset(ds);
+
+    env->pc_w = 0;
+    env->sregI = 1;
+    env->sregC = 0;
+    env->sregZ = 0;
+    env->sregN = 0;
+    env->sregV = 0;
+    env->sregS = 0;
+    env->sregH = 0;
+    env->sregT = 0;
+
+    env->rampD = 0;
+    env->rampX = 0;
+    env->rampY = 0;
+    env->rampZ = 0;
+    env->eind = 0;
+    env->sp = 0;
+
+    env->skip = 0;
+
+    memset(env->r, 0, sizeof(env->r));
+}
+
+static void avr_cpu_disas_set_info(CPUState *cpu, disassemble_info *info)
+{
+    info->mach = bfd_arch_avr;
+    info->print_insn = avr_print_insn;
+}
+
+static void avr_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+    CPUState *cs = CPU(dev);
+    AVRCPUClass *mcc = AVR_CPU_GET_CLASS(dev);
+    Error *local_err = NULL;
+
+    cpu_exec_realizefn(cs, &local_err);
+    if (local_err != NULL) {
+        error_propagate(errp, local_err);
+        return;
+    }
+    qemu_init_vcpu(cs);
+    cpu_reset(cs);
+
+    mcc->parent_realize(dev, errp);
+}
+
+static void avr_cpu_set_int(void *opaque, int irq, int level)
+{
+    AVRCPU *cpu = opaque;
+    CPUAVRState *env = &cpu->env;
+    CPUState *cs = CPU(cpu);
+    uint64_t mask = (1ull << irq);
+
+    if (level) {
+        env->intsrc |= mask;
+        cpu_interrupt(cs, CPU_INTERRUPT_HARD);
+    } else {
+        env->intsrc &= ~mask;
+        if (env->intsrc == 0) {
+            cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
+        }
+    }
+}
+
+static void avr_cpu_initfn(Object *obj)
+{
+    AVRCPU *cpu = AVR_CPU(obj);
+
+    cpu_set_cpustate_pointers(cpu);
+
+    /* Set the number of interrupts supported by the CPU. */
+    qdev_init_gpio_in(DEVICE(cpu), avr_cpu_set_int,
+                      sizeof(cpu->env.intsrc) * 8);
+}
+


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:11:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:11:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16266.39770 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbg0-00079e-Qx; Fri, 30 Oct 2020 21:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16266.39770; Fri, 30 Oct 2020 21:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbg0-00079X-Na; Fri, 30 Oct 2020 21:11:12 +0000
Received: by outflank-mailman (input) for mailman id 16266;
 Fri, 30 Oct 2020 21:11:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbfz-00079S-AN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id db2cc749-5126-4425-b8a6-94d1b949fb53;
 Fri, 30 Oct 2020 21:11:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbfs-0002u3-Hm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbfs-00060V-Fi
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbfz-00079S-AN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:11 +0000
X-Inumbo-ID: db2cc749-5126-4425-b8a6-94d1b949fb53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id db2cc749-5126-4425-b8a6-94d1b949fb53;
	Fri, 30 Oct 2020 21:11:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oe9Kclqj9tyKLdIgiRg840J2n0GBuLSDcjYdpwSxPU4=; b=5yE+oPyDKpLIVJhq5f2TfGOn/3
	u5mSc529onIySsBLCMQ22ltgqYgMcxJPi0cTCi7VvT2wWJrmE4SuDT7p0i4pc5kjbhx/IYcrT6oii
	3TMbfzVVHI/SMPPMFbfgu/w6I8ACJDumJkL0jBKL8igb+RkBG7adpyXNBr72YPOzLHaA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbfs-0002u3-Hm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbfs-00060V-Fi
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:11:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-110720-2' into staging
Message-Id: <E1kYbfs-00060V-Fi@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:11:04 +0000

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

commit 9f526fce49c6ac48114ed04914b5a76e4db75785
Merge: d34498309cff7560ac90c422c56e3137e6a64b19 4a40f561d5ebb5050a8c6dcbdcee85621056590a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 12 15:32:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 12 15:32:05 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-110720-2' into staging
    
    Testing and misc build updates:
    
      - tests/vm support for aarch64 VMs
      - tests/tcg better cross-compiler detection
      - update docker tooling to support registries
      - update docker support for xtensa
      - gitlab build docker images and store in registry
      - gitlab use docker images for builds
      - a number of skipIf updates to support move
      - linux-user MAP_FIXED_NOREPLACE fix
      - qht-bench compiler tweaks
      - configure fix for secret keyring
      - tsan fiber annotation clean-up
      - doc updates for mttcg/icount/gdbstub
      - fix cirrus to use brew bash for iotests
      - revert virtio-gpu breakage
      - fix LC_ALL to avoid sorting changes in iotests
    
    # gpg: Signature made Sat 11 Jul 2020 15:56:42 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-testing-and-misc-110720-2: (50 commits)
      iotests: Set LC_ALL=C for sort
      Revert "vga: build virtio-gpu as module"
      tests: fix "make check-qtest" for modular builds
      .cirrus.yml: add bash to the brew packages
      tests/docker: update toolchain set in debian-xtensa-cross
      tests/docker: fall back more gracefully when pull fails
      docs: Add to gdbstub documentation the PhyMemMode
      docs/devel: add some notes on tcg-icount for developers
      docs/devel: convert and update MTTCG design document
      tests/qht-bench: Adjust threshold computation
      tests/qht-bench: Adjust testing rate by -1
      travis.yml: Test also the other targets on s390x
      shippable: pull images from registry instead of building
      testing: add check-build target
      containers.yml: build with docker.py tooling
      gitlab: limit re-builds of the containers
      tests: improve performance of device-introspect-test
      gitlab: add avocado asset caching
      gitlab: enable check-tcg for linux-user tests
      linux-user/elfload: use MAP_FIXED_NOREPLACE in pgb_reserved_va
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 .cirrus.yml                                        |   4 +-
 .gitignore                                         |   1 +
 .gitlab-ci.d/containers.yml                        | 263 +++++++++++++++
 .gitlab-ci.d/edk2.yml                              |   5 +-
 .gitlab-ci.d/opensbi.yml                           |   5 +-
 .gitlab-ci.yml                                     | 265 +++++++++------
 .shippable.yml                                     |   8 +-
 .travis.yml                                        |  62 ++--
 configure                                          |  31 +-
 docs/devel/index.rst                               |   2 +
 docs/devel/multi-thread-tcg.rst                    | 372 +++++++++++++++++++++
 docs/devel/multi-thread-tcg.txt                    | 358 --------------------
 docs/devel/tcg-icount.rst                          |  97 ++++++
 docs/system/gdb.rst                                |  20 ++
 hw/display/Makefile.objs                           |  23 +-
 linux-user/elfload.c                               |  10 +-
 python/qemu/console_socket.py                      | 110 ++++++
 python/qemu/machine.py                             |  23 +-
 tests/Makefile.include                             |  19 +-
 tests/acceptance/boot_linux.py                     |   2 +
 tests/acceptance/linux_initrd.py                   |   3 +
 tests/acceptance/machine_mips_malta.py             |   3 +
 tests/acceptance/machine_rx_gdbsim.py              |   2 +-
 tests/acceptance/replay_kernel.py                  |   2 +-
 tests/docker/Makefile.include                      |  17 +-
 tests/docker/common.rc                             |   2 +-
 tests/docker/docker.py                             |  47 ++-
 .../dockerfiles/debian-all-test-cross.docker       |  53 +++
 tests/docker/dockerfiles/debian-alpha-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-amd64-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-amd64.docker       |   2 +-
 tests/docker/dockerfiles/debian-arm64-cross.docker |   2 +-
 .../dockerfiles/debian-arm64-test-cross.docker     |   2 +-
 tests/docker/dockerfiles/debian-armel-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-armhf-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-hppa-cross.docker  |   2 +-
 tests/docker/dockerfiles/debian-m68k-cross.docker  |   2 +-
 tests/docker/dockerfiles/debian-mips-cross.docker  |   2 +-
 .../docker/dockerfiles/debian-mips64-cross.docker  |   2 +-
 .../dockerfiles/debian-mips64el-cross.docker       |   2 +-
 .../docker/dockerfiles/debian-mipsel-cross.docker  |   2 +-
 .../docker/dockerfiles/debian-powerpc-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-ppc64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-ppc64el-cross.docker |   2 +-
 .../docker/dockerfiles/debian-riscv64-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-s390x-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-sh4-cross.docker   |   2 +-
 .../docker/dockerfiles/debian-sparc64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-tricore-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-win32-cross.docker |   2 +-
 tests/docker/dockerfiles/debian-win64-cross.docker |   2 +-
 .../docker/dockerfiles/debian-xtensa-cross.docker  |   6 +-
 tests/docker/dockerfiles/debian9-mxe.docker        |   2 +-
 tests/docker/dockerfiles/fedora.docker             |   7 +
 tests/docker/dockerfiles/ubuntu2004.docker         |  10 +-
 tests/qemu-iotests/common.filter                   |   2 +-
 tests/qht-bench.c                                  |  40 ++-
 tests/qtest/Makefile.include                       |   1 +
 tests/qtest/device-introspect-test.c               |  60 ++--
 tests/tcg/Makefile.qemu                            |   4 +-
 tests/tcg/configure.sh                             |  21 +-
 tests/vm/Makefile.include                          |  22 ++
 tests/vm/aarch64vm.py                              | 106 ++++++
 tests/vm/basevm.py                                 | 344 ++++++++++++++-----
 tests/vm/centos-8-aarch64.ks                       |  51 +++
 tests/vm/centos.aarch64                            | 227 +++++++++++++
 tests/vm/conf_example_aarch64.yml                  |  51 +++
 tests/vm/conf_example_x86.yml                      |  50 +++
 tests/vm/fedora                                    |  17 +-
 tests/vm/freebsd                                   |  16 +-
 tests/vm/netbsd                                    |  19 +-
 tests/vm/openbsd                                   |  17 +-
 tests/vm/ubuntu.aarch64                            |  68 ++++
 tests/vm/ubuntu.i386                               |  46 +--
 tests/vm/ubuntuvm.py                               |  60 ++++
 util/coroutine-ucontext.c                          |  52 ++-
 util/module.c                                      |   6 -
 77 files changed, 2373 insertions(+), 787 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 69342ae031..f287d23c5b 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -20,7 +20,7 @@ macos_task:
   osx_instance:
     image: mojave-base
   install_script:
-    - brew install pkg-config python gnu-sed glib pixman make sdl2
+    - brew install pkg-config python gnu-sed glib pixman make sdl2 bash
   script:
     - mkdir build
     - cd build
@@ -33,7 +33,7 @@ macos_xcode_task:
     # this is an alias for the latest Xcode
     image: mojave-xcode
   install_script:
-    - brew install pkg-config gnu-sed glib pixman make sdl2
+    - brew install pkg-config gnu-sed glib pixman make sdl2 bash
   script:
     - mkdir build
     - cd build
diff --git a/.gitignore b/.gitignore
index 90acb4347d..2992d15931 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,6 +93,7 @@
 *.tp
 *.vr
 *.d
+!/.gitlab-ci.d
 !/scripts/qemu-guest-agent/fsfreeze-hook.d
 *.o
 .sdk
diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
new file mode 100644
index 0000000000..f3c0ca4d61
--- /dev/null
+++ b/.gitlab-ci.d/containers.yml
@@ -0,0 +1,263 @@
+.container_job_template: &container_job_definition
+  image: docker:stable
+  stage: containers
+  services:
+    - docker:dind
+  before_script:
+    - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
+    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/$NAME:latest"
+    - apk add python3
+    - docker info
+    - docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
+  script:
+    - echo "TAG:$TAG"
+    - echo "COMMON_TAG:$COMMON_TAG"
+    - docker pull "$TAG" || docker pull "$COMMON_TAG" || true
+    - ./tests/docker/docker.py --engine docker build
+          -t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
+          -r $CI_REGISTRY_IMAGE
+    - docker tag "qemu/$NAME" "$TAG"
+    - docker push "$TAG"
+  after_script:
+    - docker logout
+  rules:
+    - changes:
+      - .gitlab-ci.d/containers.yml
+      - tests/docker/*
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+    - if: '$CI_COMMIT_REF_NAME == "testing/next"'
+
+amd64-centos7-container:
+  <<: *container_job_definition
+  variables:
+    NAME: centos7
+
+amd64-centos8-container:
+  <<: *container_job_definition
+  variables:
+    NAME: centos8
+
+amd64-debian10-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian10
+
+amd64-debian11-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian11
+
+amd64-debian9-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian9
+
+amd64-debian9-mxe-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian9-container']
+  variables:
+    NAME: debian9-mxe
+
+alpha-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-alpha-cross
+
+amd64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-amd64-cross
+
+amd64-debian-user-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-all-test-cross
+
+amd64-debian-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-amd64
+
+arm64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-arm64-cross
+
+arm64-test-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian11-container']
+  variables:
+    NAME: debian-arm64-test-cross
+
+armel-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-armel-cross
+
+armhf-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-armhf-cross
+
+hppa-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-hppa-cross
+
+m68k-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-m68k-cross
+
+mips64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips64-cross
+
+mips64el-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips64el-cross
+
+mips-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mips-cross
+
+mipsel-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-mipsel-cross
+
+powerpc-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-powerpc-cross
+
+ppc64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-ppc64-cross
+
+ppc64el-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-ppc64el-cross
+
+riscv64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-riscv64-cross
+
+s390x-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-s390x-cross
+
+sh4-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-sh4-cross
+
+sparc64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
+  variables:
+    NAME: debian-sparc64-cross
+
+tricore-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer2
+  needs: ['amd64-debian9-container']
+  variables:
+    NAME: debian-tricore-cross
+
+win32-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer3
+  needs: ['amd64-debian9-mxe-container']
+  variables:
+    NAME: debian-win32-cross
+
+win64-debian-cross-container:
+  <<: *container_job_definition
+  stage: containers-layer3
+  needs: ['amd64-debian9-mxe-container']
+  variables:
+    NAME: debian-win64-cross
+
+xtensa-debian-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: debian-xtensa-cross
+
+cris-fedora-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora-cris-cross
+
+amd64-fedora-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora
+
+i386-fedora-cross-container:
+  <<: *container_job_definition
+  variables:
+    NAME: fedora-i386-cross
+
+amd64-ubuntu1804-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu1804
+
+amd64-ubuntu2004-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu2004
+
+amd64-ubuntu-container:
+  <<: *container_job_definition
+  variables:
+    NAME: ubuntu
diff --git a/.gitlab-ci.d/edk2.yml b/.gitlab-ci.d/edk2.yml
index 088ba4b43a..e1e0452416 100644
--- a/.gitlab-ci.d/edk2.yml
+++ b/.gitlab-ci.d/edk2.yml
@@ -1,8 +1,8 @@
 docker-edk2:
- stage: build
+ stage: containers
  rules: # Only run this job when the Dockerfile is modified
  - changes:
-   - .gitlab-ci-edk2.yml
+   - .gitlab-ci.d/edk2.yml
    - .gitlab-ci.d/edk2/Dockerfile
    when: always
  image: docker:19.03.1
@@ -24,6 +24,7 @@ docker-edk2:
  - docker push $IMAGE_TAG
 
 build-edk2:
+ stage: build
  rules: # Only run this job when ...
  - changes: # ... roms/edk2/ is modified (submodule updated)
    - roms/edk2/*
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
index dd051c0124..62088ec5ec 100644
--- a/.gitlab-ci.d/opensbi.yml
+++ b/.gitlab-ci.d/opensbi.yml
@@ -1,8 +1,8 @@
 docker-opensbi:
- stage: build
+ stage: containers
  rules: # Only run this job when the Dockerfile is modified
  - changes:
-   - .gitlab-ci-opensbi.yml
+   - .gitlab-ci.d/opensbi.yml
    - .gitlab-ci.d/opensbi/Dockerfile
    when: always
  image: docker:19.03.1
@@ -24,6 +24,7 @@ docker-opensbi:
  - docker push $IMAGE_TAG
 
 build-opensbi:
+ stage: build
  rules: # Only run this job when ...
  - changes: # ... roms/opensbi/ is modified (submodule updated)
    - roms/opensbi/*
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 349c77aa58..5eeba2791b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,127 +1,186 @@
+# Currently we have two build stages after our containers are built:
+#  - build (for traditional build and test or first stage build)
+#  - test (for test stages, using build artefacts from a build stage)
+stages:
+  - containers
+  - containers-layer2
+  - containers-layer3
+  - build
+  - test
+
+# We assume GitLab has it's own caching set up for RPM/APT repositories so we
+# just take care of avocado assets here.
+cache:
+  paths:
+    - $HOME/avocado/data/cache
+
 include:
   - local: '/.gitlab-ci.d/edk2.yml'
   - local: '/.gitlab-ci.d/opensbi.yml'
+  - local: '/.gitlab-ci.d/containers.yml'
+
+.native_build_job_template: &native_build_job_definition
+  stage: build
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  before_script:
+    - JOBS=$(expr $(nproc) + 1)
+  script:
+    - mkdir build
+    - cd build
+    - if test -n "$TARGETS";
+      then
+        ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
+      else
+        ../configure --enable-werror $CONFIGURE_ARGS ;
+      fi
+    - make -j"$JOBS"
+    - if test -n "$MAKE_CHECK_ARGS";
+      then
+        make -j"$JOBS" $MAKE_CHECK_ARGS ;
+      fi
+
+.native_test_job_template: &native_test_job_definition
+  stage: test
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  script:
+    - cd build
+    - find . -type f -exec touch {} +
+    - make $MAKE_CHECK_ARGS
+
+.post_acceptance_template: &post_acceptance
+  after_script:
+    - cd build
+    - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
+    - du -chs $HOME/avocado/data/cache
+
+build-system-ubuntu-main:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: ubuntu2004
+    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu
+      moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu
+      riscv64-softmmu sparc-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-ubuntu-main:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-ubuntu-main
+      artifacts: true
+  variables:
+    IMAGE: ubuntu2004
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-ubuntu-main:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-ubuntu-main
+      artifacts: true
+  variables:
+    IMAGE: ubuntu2004
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
+build-system-fedora-alt:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
+      riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu
+      xtensa-softmmu nios2-softmmu or1k-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-fedora-alt:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-fedora-alt
+      artifacts: true
+  variables:
+    IMAGE: fedora
+    MAKE_CHECK_ARGS: check
 
-.update_apt_template: &before_script_apt
- before_script:
-  - apt-get update -qq
-  - apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make
-        genisoimage
-  - JOBS=$(expr $(nproc) + 1)
-
-.update_dnf_template: &before_script_dnf
- before_script:
-  - dnf update -y
-  - dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel
-        make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel
-  - JOBS=$(expr $(nproc) + 1)
-
-build-system1:
- image: ubuntu:19.10
- <<: *before_script_apt
- script:
- - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev
-      libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev
- - mkdir build
- - cd build
- - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu
-      cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu
-      mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu"
- - make -j"$JOBS"
- - make -j"$JOBS" check
-
-build-system2:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel
-       libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel
-       libzstd-devel
- - mkdir build
- - cd build
- - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu
-      microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu
-      sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu"
- - make -j"$JOBS"
- - make -j"$JOBS" check
+acceptance-system-fedora-alt:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-fedora-alt
+      artifacts: true
+  variables:
+    IMAGE: fedora
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
 
 build-disabled:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - mkdir build
- - cd build
- - ../configure --enable-werror --disable-rdma --disable-slirp --disable-curl
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --disable-rdma --disable-slirp --disable-curl
       --disable-capstone --disable-live-block-migration --disable-glusterfs
       --disable-replication --disable-coroutine-pool --disable-smartcard
       --disable-guest-agent --disable-curses --disable-libxml2 --disable-tpm
       --disable-qom-cast-debug --disable-spice --disable-vhost-vsock
       --disable-vhost-net --disable-vhost-crypto --disable-vhost-user
-      --target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user"
- - make -j"$JOBS"
- - make -j"$JOBS" check-qtest SPEED=slow
+    TARGETS: i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user
+    MAKE_CHECK_ARGS: check-qtest SPEED=slow
 
 build-tcg-disabled:
- image: centos:8
- <<: *before_script_dnf
- script:
- - dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel
- - mkdir build
- - cd build
- - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
- - make -j"$JOBS"
- - make check-unit
- - make check-qapi-schema
- - cd tests/qemu-iotests/
- - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos8
+  script:
+    - mkdir build
+    - cd build
+    - ../configure --disable-tcg --audio-drv-list=""
+    - make -j"$JOBS"
+    - make check-unit
+    - make check-qapi-schema
+    - cd tests/qemu-iotests/
+    - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
             052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
             170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
- - ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
+    - ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
             124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
             208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
             260 261 262 263 264 270 272 273 277 279
 
 build-user:
- <<: *before_script_apt
- script:
- - mkdir build
- - cd build
- - ../configure --enable-werror --disable-system --disable-guest-agent
-               --disable-capstone --disable-slirp --disable-fdt
- - make -j"$JOBS"
- - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: debian-all-test-cross
+    CONFIGURE_ARGS: --disable-tools --disable-system
+    MAKE_CHECK_ARGS: check-tcg
 
 build-clang:
- image: fedora:latest
- <<: *before_script_dnf
- script:
- - yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel
-       libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel
- - mkdir build
- - cd build
- - ../configure --cc=clang --cxx=clang++ --enable-werror
-      --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
-                     ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
- - make -j"$JOBS"
- - make -j"$JOBS" check
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+    CONFIGURE_ARGS: --cc=clang --cxx=clang++
+    TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
+      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user
+    MAKE_CHECK_ARGS: check
 
 build-tci:
- image: centos:8
- <<: *before_script_dnf
- script:
- - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
- - mkdir build
- - cd build
- - ../configure --enable-tcg-interpreter
-      --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
- - make -j"$JOBS"
- - make run-tcg-tests-x86_64-softmmu
- - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
- - for tg in $TARGETS ; do
-     export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
-     ./tests/qtest/boot-serial-test || exit 1 ;
-     ./tests/qtest/cdrom-test || exit 1 ;
-   done
- - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
- - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x"
-   ./tests/qtest/pxe-test -m slow
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+  script:
+    - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
+    - mkdir build
+    - cd build
+    - ../configure --enable-tcg-interpreter
+        --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
+    - make -j"$JOBS"
+    - make run-tcg-tests-x86_64-softmmu
+    - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
+    - for tg in $TARGETS ; do
+        export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
+        ./tests/qtest/boot-serial-test || exit 1 ;
+        ./tests/qtest/cdrom-test || exit 1 ;
+      done
+    - QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
+    - QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x" ./tests/qtest/pxe-test -m slow
diff --git a/.shippable.yml b/.shippable.yml
index 2cce7b5689..f6b742432e 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -26,12 +26,10 @@ env:
     - IMAGE=debian-ppc64el-cross
       TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
 build:
-  pre_ci:
-    - make docker-image-${IMAGE} V=1
   pre_ci_boot:
-    image_name: qemu
-    image_tag: ${IMAGE}
-    pull: false
+    image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE}
+    image_tag: latest
+    pull: true
     options: "-e HOME=/root"
   ci:
     - unset CC
diff --git a/.travis.yml b/.travis.yml
index 74158f741b..ab429500fc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -289,29 +289,6 @@ jobs:
       python: 3.6
 
 
-    # Acceptance (Functional) tests
-    - name: "GCC check-acceptance"
-      dist: bionic
-      env:
-        - CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
-        - TEST_CMD="make check-acceptance"
-        - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance"
-      after_script:
-        - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
-        - du -chs $HOME/avocado/data/cache
-      addons:
-        apt:
-          packages:
-            - python3-pil
-            - python3-pip
-            - python3-numpy
-            - python3-opencv
-            - python3-venv
-            - rpm2cpio
-            - tesseract-ocr
-            - tesseract-ocr-eng
-
-
     # Using newer GCC with sanitizers
     - name: "GCC9 with sanitizers (softmmu)"
       addons:
@@ -505,6 +482,45 @@ jobs:
               $(exit $BUILD_RC);
           fi
 
+    - name: "[s390x] GCC (other-softmmu)"
+      arch: s390x
+      dist: bionic
+      addons:
+        apt_packages:
+          - libaio-dev
+          - libattr1-dev
+          - libcap-ng-dev
+          - libgnutls28-dev
+          - libiscsi-dev
+          - liblttng-ust-dev
+          - liblzo2-dev
+          - libncurses-dev
+          - libnfs-dev
+          - libnss3-dev
+          - libpixman-1-dev
+          - libsdl2-dev
+          - libsdl2-image-dev
+          - libseccomp-dev
+          - libsnappy-dev
+          - libzstd-dev
+          - nettle-dev
+          - xfslibs-dev
+          # Tests dependencies
+          - genisoimage
+      env:
+        - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
+                  --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
+
+    - name: "[s390x] GCC (user)"
+      arch: s390x
+      dist: bionic
+      addons:
+        apt_packages:
+          - libgcrypt20-dev
+          - libgnutls28-dev
+      env:
+        - CONFIG="--disable-containers --disable-system"
+
     - name: "[s390x] Clang (disable-tcg)"
       arch: s390x
       dist: bionic
diff --git a/configure b/configure
index 31e2ddbf28..814ed81279 100755
--- a/configure
+++ b/configure
@@ -418,6 +418,7 @@ prefix="/usr/local"
 mandir="\${prefix}/share/man"
 datadir="\${prefix}/share"
 firmwarepath="\${prefix}/share/qemu-firmware"
+efi_aarch64=""
 qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
@@ -960,6 +961,13 @@ do
     fi
 done
 
+# Check for existence of python3 yaml, needed to
+# import yaml config files into vm-build.
+python_yaml="no"
+if $(python3 -c "import yaml" 2> /dev/null); then
+    python_yaml="yes"
+fi
+
 : ${smbd=${SMBD-/usr/sbin/smbd}}
 
 # Default objcc to clang if available, otherwise use CC
@@ -1102,6 +1110,8 @@ for opt do
   ;;
   --firmwarepath=*) firmwarepath="$optarg"
   ;;
+  --efi-aarch64=*) efi_aarch64="$optarg"
+  ;;
   --host=*|--build=*|\
   --disable-dependency-tracking|\
   --sbindir=*|--sharedstatedir=*|\
@@ -1784,6 +1794,7 @@ Advanced options (experts only):
   --sysconfdir=PATH        install config in PATH$confsuffix
   --localstatedir=PATH     install local state in PATH (set at runtime on win32)
   --firmwarepath=PATH      search PATH for firmware files
+  --efi-aarch64=PATH       PATH of efi file to use for aarch64 VMs.
   --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
   --with-pkgversion=VERS   use specified string as sub-version of the package
   --enable-debug           enable common debug build options
@@ -3620,6 +3631,20 @@ EOF
   fi
 fi
 
+############################################
+# efi-aarch64 probe
+# Check for efi files needed by aarch64 VMs.
+# By default we will use the efi included with QEMU.
+# Allow user to override the path for efi also.
+if ! test -f "$efi_aarch64"; then
+  if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then
+    # valid after build
+    efi_aarch64=$PWD/pc-bios/edk2-aarch64-code.fd
+  else
+    efi_aarch64=""
+  fi
+fi
+
 ##########################################
 # libcap-ng library probe
 if test "$cap_ng" != "no" ; then
@@ -6486,7 +6511,7 @@ EOF
 fi
 if test "$secret_keyring" != "no"
 then
-    if test "$have_keyring" == "yes"
+    if test "$have_keyring" = "yes"
     then
 	secret_keyring=yes
     else
@@ -6868,6 +6893,8 @@ if test "$docs" != "no"; then
     echo "sphinx-build      $sphinx_build"
 fi
 echo "genisoimage       $genisoimage"
+echo "efi_aarch64       $efi_aarch64"
+echo "python_yaml       $python_yaml"
 echo "slirp support     $slirp $(echo_version $slirp $slirp_version)"
 if test "$slirp" != "no" ; then
     echo "smbd              $smbd"
@@ -7966,6 +7993,8 @@ echo "PYTHON=$python" >> $config_host_mak
 echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
 echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
+echo "EFI_AARCH64=$efi_aarch64" >> $config_host_mak
+echo "PYTHON_YAML=$python_yaml" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "IASL=$iasl" >> $config_host_mak
diff --git a/docs/devel/index.rst b/docs/devel/index.rst
index bb8238c5d6..ae6eac7c9c 100644
--- a/docs/devel/index.rst
+++ b/docs/devel/index.rst
@@ -23,6 +23,8 @@ Contents:
    decodetree
    secure-coding-practices
    tcg
+   tcg-icount
+   multi-thread-tcg
    tcg-plugins
    bitops
    reset
diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst
new file mode 100644
index 0000000000..42158b77c7
--- /dev/null
+++ b/docs/devel/multi-thread-tcg.rst
@@ -0,0 +1,372 @@
+..
+  Copyright (c) 2015-2020 Linaro Ltd.
+
+  This work is licensed under the terms of the GNU GPL, version 2 or
+  later. See the COPYING file in the top-level directory.
+
+Introduction
+============
+
+This document outlines the design for multi-threaded TCG (a.k.a MTTCG)
+system-mode emulation. user-mode emulation has always mirrored the
+thread structure of the translated executable although some of the
+changes done for MTTCG system emulation have improved the stability of
+linux-user emulation.
+
+The original system-mode TCG implementation was single threaded and
+dealt with multiple CPUs with simple round-robin scheduling. This
+simplified a lot of things but became increasingly limited as systems
+being emulated gained additional cores and per-core performance gains
+for host systems started to level off.
+
+vCPU Scheduling
+===============
+
+We introduce a new running mode where each vCPU will run on its own
+user-space thread. This is enabled by default for all FE/BE
+combinations where the host memory model is able to accommodate the
+guest (TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO is zero) and the
+guest has had the required work done to support this safely
+(TARGET_SUPPORTS_MTTCG).
+
+System emulation will fall back to the original round robin approach
+if:
+
+* forced by --accel tcg,thread=single
+* enabling --icount mode
+* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST)
+
+In the general case of running translated code there should be no
+inter-vCPU dependencies and all vCPUs should be able to run at full
+speed. Synchronisation will only be required while accessing internal
+shared data structures or when the emulated architecture requires a
+coherent representation of the emulated machine state.
+
+Shared Data Structures
+======================
+
+Main Run Loop
+-------------
+
+Even when there is no code being generated there are a number of
+structures associated with the hot-path through the main run-loop.
+These are associated with looking up the next translation block to
+execute. These include:
+
+    tb_jmp_cache (per-vCPU, cache of recent jumps)
+    tb_ctx.htable (global hash table, phys address->tb lookup)
+
+As TB linking only occurs when blocks are in the same page this code
+is critical to performance as looking up the next TB to execute is the
+most common reason to exit the generated code.
+
+DESIGN REQUIREMENT: Make access to lookup structures safe with
+multiple reader/writer threads. Minimise any lock contention to do it.
+
+The hot-path avoids using locks where possible. The tb_jmp_cache is
+updated with atomic accesses to ensure consistent results. The fall
+back QHT based hash table is also designed for lockless lookups. Locks
+are only taken when code generation is required or TranslationBlocks
+have their block-to-block jumps patched.
+
+Global TCG State
+----------------
+
+User-mode emulation
+~~~~~~~~~~~~~~~~~~~
+
+We need to protect the entire code generation cycle including any post
+generation patching of the translated code. This also implies a shared
+translation buffer which contains code running on all cores. Any
+execution path that comes to the main run loop will need to hold a
+mutex for code generation. This also includes times when we need flush
+code or entries from any shared lookups/caches. Structures held on a
+per-vCPU basis won't need locking unless other vCPUs will need to
+modify them.
+
+DESIGN REQUIREMENT: Add locking around all code generation and TB
+patching.
+
+(Current solution)
+
+Code generation is serialised with mmap_lock().
+
+!User-mode emulation
+~~~~~~~~~~~~~~~~~~~~
+
+Each vCPU has its own TCG context and associated TCG region, thereby
+requiring no locking during translation.
+
+Translation Blocks
+------------------
+
+Currently the whole system shares a single code generation buffer
+which when full will force a flush of all translations and start from
+scratch again. Some operations also force a full flush of translations
+including:
+
+  - debugging operations (breakpoint insertion/removal)
+  - some CPU helper functions
+  - linux-user spawning it's first thread
+
+This is done with the async_safe_run_on_cpu() mechanism to ensure all
+vCPUs are quiescent when changes are being made to shared global
+structures.
+
+More granular translation invalidation events are typically due
+to a change of the state of a physical page:
+
+  - code modification (self modify code, patching code)
+  - page changes (new page mapping in linux-user mode)
+
+While setting the invalid flag in a TranslationBlock will stop it
+being used when looked up in the hot-path there are a number of other
+book-keeping structures that need to be safely cleared.
+
+Any TranslationBlocks which have been patched to jump directly to the
+now invalid blocks need the jump patches reversing so they will return
+to the C code.
+
+There are a number of look-up caches that need to be properly updated
+including the:
+
+  - jump lookup cache
+  - the physical-to-tb lookup hash table
+  - the global page table
+
+The global page table (l1_map) which provides a multi-level look-up
+for PageDesc structures which contain pointers to the start of a
+linked list of all Translation Blocks in that page (see page_next).
+
+Both the jump patching and the page cache involve linked lists that
+the invalidated TranslationBlock needs to be removed from.
+
+DESIGN REQUIREMENT: Safely handle invalidation of TBs
+                      - safely patch/revert direct jumps
+                      - remove central PageDesc lookup entries
+                      - ensure lookup caches/hashes are safely updated
+
+(Current solution)
+
+The direct jump themselves are updated atomically by the TCG
+tb_set_jmp_target() code. Modification to the linked lists that allow
+searching for linked pages are done under the protection of tb->jmp_lock,
+where tb is the destination block of a jump. Each origin block keeps a
+pointer to its destinations so that the appropriate lock can be acquired before
+iterating over a jump list.
+
+The global page table is a lockless radix tree; cmpxchg is used
+to atomically insert new elements.
+
+The lookup caches are updated atomically and the lookup hash uses QHT
+which is designed for concurrent safe lookup.
+
+Parallel code generation is supported. QHT is used at insertion time
+as the synchronization point across threads, thereby ensuring that we only
+keep track of a single TranslationBlock for each guest code block.
+
+Memory maps and TLBs
+--------------------
+
+The memory handling code is fairly critical to the speed of memory
+access in the emulated system. The SoftMMU code is designed so the
+hot-path can be handled entirely within translated code. This is
+handled with a per-vCPU TLB structure which once populated will allow
+a series of accesses to the page to occur without exiting the
+translated code. It is possible to set flags in the TLB address which
+will ensure the slow-path is taken for each access. This can be done
+to support:
+
+  - Memory regions (dividing up access to PIO, MMIO and RAM)
+  - Dirty page tracking (for code gen, SMC detection, migration and display)
+  - Virtual TLB (for translating guest address->real address)
+
+When the TLB tables are updated by a vCPU thread other than their own
+we need to ensure it is done in a safe way so no inconsistent state is
+seen by the vCPU thread.
+
+Some operations require updating a number of vCPUs TLBs at the same
+time in a synchronised manner.
+
+DESIGN REQUIREMENTS:
+
+  - TLB Flush All/Page
+    - can be across-vCPUs
+    - cross vCPU TLB flush may need other vCPU brought to halt
+    - change may need to be visible to the calling vCPU immediately
+  - TLB Flag Update
+    - usually cross-vCPU
+    - want change to be visible as soon as possible
+  - TLB Update (update a CPUTLBEntry, via tlb_set_page_with_attrs)
+    - This is a per-vCPU table - by definition can't race
+    - updated by its own thread when the slow-path is forced
+
+(Current solution)
+
+We have updated cputlb.c to defer operations when a cross-vCPU
+operation with async_run_on_cpu() which ensures each vCPU sees a
+coherent state when it next runs its work (in a few instructions
+time).
+
+A new set up operations (tlb_flush_*_all_cpus) take an additional flag
+which when set will force synchronisation by setting the source vCPUs
+work as "safe work" and exiting the cpu run loop. This ensure by the
+time execution restarts all flush operations have completed.
+
+TLB flag updates are all done atomically and are also protected by the
+corresponding page lock.
+
+(Known limitation)
+
+Not really a limitation but the wait mechanism is overly strict for
+some architectures which only need flushes completed by a barrier
+instruction. This could be a future optimisation.
+
+Emulated hardware state
+-----------------------
+
+Currently thanks to KVM work any access to IO memory is automatically
+protected by the global iothread mutex, also known as the BQL (Big
+Qemu Lock). Any IO region that doesn't use global mutex is expected to
+do its own locking.
+
+However IO memory isn't the only way emulated hardware state can be
+modified. Some architectures have model specific registers that
+trigger hardware emulation features. Generally any translation helper
+that needs to update more than a single vCPUs of state should take the
+BQL.
+
+As the BQL, or global iothread mutex is shared across the system we
+push the use of the lock as far down into the TCG code as possible to
+minimise contention.
+
+(Current solution)
+
+MMIO access automatically serialises hardware emulation by way of the
+BQL. Currently Arm targets serialise all ARM_CP_IO register accesses
+and also defer the reset/startup of vCPUs to the vCPU context by way
+of async_run_on_cpu().
+
+Updates to interrupt state are also protected by the BQL as they can
+often be cross vCPU.
+
+Memory Consistency
+==================
+
+Between emulated guests and host systems there are a range of memory
+consistency models. Even emulating weakly ordered systems on strongly
+ordered hosts needs to ensure things like store-after-load re-ordering
+can be prevented when the guest wants to.
+
+Memory Barriers
+---------------
+
+Barriers (sometimes known as fences) provide a mechanism for software
+to enforce a particular ordering of memory operations from the point
+of view of external observers (e.g. another processor core). They can
+apply to any memory operations as well as just loads or stores.
+
+The Linux kernel has an excellent `write-up
+<https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt>`
+on the various forms of memory barrier and the guarantees they can
+provide.
+
+Barriers are often wrapped around synchronisation primitives to
+provide explicit memory ordering semantics. However they can be used
+by themselves to provide safe lockless access by ensuring for example
+a change to a signal flag will only be visible once the changes to
+payload are.
+
+DESIGN REQUIREMENT: Add a new tcg_memory_barrier op
+
+This would enforce a strong load/store ordering so all loads/stores
+complete at the memory barrier. On single-core non-SMP strongly
+ordered backends this could become a NOP.
+
+Aside from explicit standalone memory barrier instructions there are
+also implicit memory ordering semantics which comes with each guest
+memory access instruction. For example all x86 load/stores come with
+fairly strong guarantees of sequential consistency whereas Arm has
+special variants of load/store instructions that imply acquire/release
+semantics.
+
+In the case of a strongly ordered guest architecture being emulated on
+a weakly ordered host the scope for a heavy performance impact is
+quite high.
+
+DESIGN REQUIREMENTS: Be efficient with use of memory barriers
+       - host systems with stronger implied guarantees can skip some barriers
+       - merge consecutive barriers to the strongest one
+
+(Current solution)
+
+The system currently has a tcg_gen_mb() which will add memory barrier
+operations if code generation is being done in a parallel context. The
+tcg_optimize() function attempts to merge barriers up to their
+strongest form before any load/store operations. The solution was
+originally developed and tested for linux-user based systems. All
+backends have been converted to emit fences when required. So far the
+following front-ends have been updated to emit fences when required:
+
+    - target-i386
+    - target-arm
+    - target-aarch64
+    - target-alpha
+    - target-mips
+
+Memory Control and Maintenance
+------------------------------
+
+This includes a class of instructions for controlling system cache
+behaviour. While QEMU doesn't model cache behaviour these instructions
+are often seen when code modification has taken place to ensure the
+changes take effect.
+
+Synchronisation Primitives
+--------------------------
+
+There are two broad types of synchronisation primitives found in
+modern ISAs: atomic instructions and exclusive regions.
+
+The first type offer a simple atomic instruction which will guarantee
+some sort of test and conditional store will be truly atomic w.r.t.
+other cores sharing access to the memory. The classic example is the
+x86 cmpxchg instruction.
+
+The second type offer a pair of load/store instructions which offer a
+guarantee that a region of memory has not been touched between the
+load and store instructions. An example of this is Arm's ldrex/strex
+pair where the strex instruction will return a flag indicating a
+successful store only if no other CPU has accessed the memory region
+since the ldrex.
+
+Traditionally TCG has generated a series of operations that work
+because they are within the context of a single translation block so
+will have completed before another CPU is scheduled. However with
+the ability to have multiple threads running to emulate multiple CPUs
+we will need to explicitly expose these semantics.
+
+DESIGN REQUIREMENTS:
+  - Support classic atomic instructions
+  - Support load/store exclusive (or load link/store conditional) pairs
+  - Generic enough infrastructure to support all guest architectures
+CURRENT OPEN QUESTIONS:
+  - How problematic is the ABA problem in general?
+
+(Current solution)
+
+The TCG provides a number of atomic helpers (tcg_gen_atomic_*) which
+can be used directly or combined to emulate other instructions like
+Arm's ldrex/strex instructions. While they are susceptible to the ABA
+problem so far common guests have not implemented patterns where
+this may be a problem - typically presenting a locking ABI which
+assumes cmpxchg like semantics.
+
+The code also includes a fall-back for cases where multi-threaded TCG
+ops can't work (e.g. guest atomic width > host atomic width). In this
+case an EXCP_ATOMIC exit occurs and the instruction is emulated with
+an exclusive lock which ensures all emulation is serialised.
+
+While the atomic helpers look good enough for now there may be a need
+to look at solutions that can more closely model the guest
+architectures semantics.
diff --git a/docs/devel/multi-thread-tcg.txt b/docs/devel/multi-thread-tcg.txt
deleted file mode 100644
index 3c85ac0eab..0000000000
--- a/docs/devel/multi-thread-tcg.txt
+++ /dev/null
@@ -1,358 +0,0 @@
-Copyright (c) 2015-2016 Linaro Ltd.
-
-This work is licensed under the terms of the GNU GPL, version 2 or
-later. See the COPYING file in the top-level directory.
-
-Introduction
-============
-
-This document outlines the design for multi-threaded TCG system-mode
-emulation. The current user-mode emulation mirrors the thread
-structure of the translated executable. Some of the work will be
-applicable to both system and linux-user emulation.
-
-The original system-mode TCG implementation was single threaded and
-dealt with multiple CPUs with simple round-robin scheduling. This
-simplified a lot of things but became increasingly limited as systems
-being emulated gained additional cores and per-core performance gains
-for host systems started to level off.
-
-vCPU Scheduling
-===============
-
-We introduce a new running mode where each vCPU will run on its own
-user-space thread. This will be enabled by default for all FE/BE
-combinations that have had the required work done to support this
-safely.
-
-In the general case of running translated code there should be no
-inter-vCPU dependencies and all vCPUs should be able to run at full
-speed. Synchronisation will only be required while accessing internal
-shared data structures or when the emulated architecture requires a
-coherent representation of the emulated machine state.
-
-Shared Data Structures
-======================
-
-Main Run Loop
--------------
-
-Even when there is no code being generated there are a number of
-structures associated with the hot-path through the main run-loop.
-These are associated with looking up the next translation block to
-execute. These include:
-
-    tb_jmp_cache (per-vCPU, cache of recent jumps)
-    tb_ctx.htable (global hash table, phys address->tb lookup)
-
-As TB linking only occurs when blocks are in the same page this code
-is critical to performance as looking up the next TB to execute is the
-most common reason to exit the generated code.
-
-DESIGN REQUIREMENT: Make access to lookup structures safe with
-multiple reader/writer threads. Minimise any lock contention to do it.
-
-The hot-path avoids using locks where possible. The tb_jmp_cache is
-updated with atomic accesses to ensure consistent results. The fall
-back QHT based hash table is also designed for lockless lookups. Locks
-are only taken when code generation is required or TranslationBlocks
-have their block-to-block jumps patched.
-
-Global TCG State
-----------------
-
-### User-mode emulation
-We need to protect the entire code generation cycle including any post
-generation patching of the translated code. This also implies a shared
-translation buffer which contains code running on all cores. Any
-execution path that comes to the main run loop will need to hold a
-mutex for code generation. This also includes times when we need flush
-code or entries from any shared lookups/caches. Structures held on a
-per-vCPU basis won't need locking unless other vCPUs will need to
-modify them.
-
-DESIGN REQUIREMENT: Add locking around all code generation and TB
-patching.
-
-(Current solution)
-
-Code generation is serialised with mmap_lock().
-
-### !User-mode emulation
-Each vCPU has its own TCG context and associated TCG region, thereby
-requiring no locking.
-
-Translation Blocks
-------------------
-
-Currently the whole system shares a single code generation buffer
-which when full will force a flush of all translations and start from
-scratch again. Some operations also force a full flush of translations
-including:
-
-  - debugging operations (breakpoint insertion/removal)
-  - some CPU helper functions
-
-This is done with the async_safe_run_on_cpu() mechanism to ensure all
-vCPUs are quiescent when changes are being made to shared global
-structures.
-
-More granular translation invalidation events are typically due
-to a change of the state of a physical page:
-
-  - code modification (self modify code, patching code)
-  - page changes (new page mapping in linux-user mode)
-
-While setting the invalid flag in a TranslationBlock will stop it
-being used when looked up in the hot-path there are a number of other
-book-keeping structures that need to be safely cleared.
-
-Any TranslationBlocks which have been patched to jump directly to the
-now invalid blocks need the jump patches reversing so they will return
-to the C code.
-
-There are a number of look-up caches that need to be properly updated
-including the:
-
-  - jump lookup cache
-  - the physical-to-tb lookup hash table
-  - the global page table
-
-The global page table (l1_map) which provides a multi-level look-up
-for PageDesc structures which contain pointers to the start of a
-linked list of all Translation Blocks in that page (see page_next).
-
-Both the jump patching and the page cache involve linked lists that
-the invalidated TranslationBlock needs to be removed from.
-
-DESIGN REQUIREMENT: Safely handle invalidation of TBs
-                      - safely patch/revert direct jumps
-                      - remove central PageDesc lookup entries
-                      - ensure lookup caches/hashes are safely updated
-
-(Current solution)
-
-The direct jump themselves are updated atomically by the TCG
-tb_set_jmp_target() code. Modification to the linked lists that allow
-searching for linked pages are done under the protection of tb->jmp_lock,
-where tb is the destination block of a jump. Each origin block keeps a
-pointer to its destinations so that the appropriate lock can be acquired before
-iterating over a jump list.
-
-The global page table is a lockless radix tree; cmpxchg is used
-to atomically insert new elements.
-
-The lookup caches are updated atomically and the lookup hash uses QHT
-which is designed for concurrent safe lookup.
-
-Parallel code generation is supported. QHT is used at insertion time
-as the synchronization point across threads, thereby ensuring that we only
-keep track of a single TranslationBlock for each guest code block.
-
-Memory maps and TLBs
---------------------
-
-The memory handling code is fairly critical to the speed of memory
-access in the emulated system. The SoftMMU code is designed so the
-hot-path can be handled entirely within translated code. This is
-handled with a per-vCPU TLB structure which once populated will allow
-a series of accesses to the page to occur without exiting the
-translated code. It is possible to set flags in the TLB address which
-will ensure the slow-path is taken for each access. This can be done
-to support:
-
-  - Memory regions (dividing up access to PIO, MMIO and RAM)
-  - Dirty page tracking (for code gen, SMC detection, migration and display)
-  - Virtual TLB (for translating guest address->real address)
-
-When the TLB tables are updated by a vCPU thread other than their own
-we need to ensure it is done in a safe way so no inconsistent state is
-seen by the vCPU thread.
-
-Some operations require updating a number of vCPUs TLBs at the same
-time in a synchronised manner.
-
-DESIGN REQUIREMENTS:
-
-  - TLB Flush All/Page
-    - can be across-vCPUs
-    - cross vCPU TLB flush may need other vCPU brought to halt
-    - change may need to be visible to the calling vCPU immediately
-  - TLB Flag Update
-    - usually cross-vCPU
-    - want change to be visible as soon as possible
-  - TLB Update (update a CPUTLBEntry, via tlb_set_page_with_attrs)
-    - This is a per-vCPU table - by definition can't race
-    - updated by its own thread when the slow-path is forced
-
-(Current solution)
-
-We have updated cputlb.c to defer operations when a cross-vCPU
-operation with async_run_on_cpu() which ensures each vCPU sees a
-coherent state when it next runs its work (in a few instructions
-time).
-
-A new set up operations (tlb_flush_*_all_cpus) take an additional flag
-which when set will force synchronisation by setting the source vCPUs
-work as "safe work" and exiting the cpu run loop. This ensure by the
-time execution restarts all flush operations have completed.
-
-TLB flag updates are all done atomically and are also protected by the
-corresponding page lock.
-
-(Known limitation)
-
-Not really a limitation but the wait mechanism is overly strict for
-some architectures which only need flushes completed by a barrier
-instruction. This could be a future optimisation.
-
-Emulated hardware state
------------------------
-
-Currently thanks to KVM work any access to IO memory is automatically
-protected by the global iothread mutex, also known as the BQL (Big
-Qemu Lock). Any IO region that doesn't use global mutex is expected to
-do its own locking.
-
-However IO memory isn't the only way emulated hardware state can be
-modified. Some architectures have model specific registers that
-trigger hardware emulation features. Generally any translation helper
-that needs to update more than a single vCPUs of state should take the
-BQL.
-
-As the BQL, or global iothread mutex is shared across the system we
-push the use of the lock as far down into the TCG code as possible to
-minimise contention.
-
-(Current solution)
-
-MMIO access automatically serialises hardware emulation by way of the
-BQL. Currently Arm targets serialise all ARM_CP_IO register accesses
-and also defer the reset/startup of vCPUs to the vCPU context by way
-of async_run_on_cpu().
-
-Updates to interrupt state are also protected by the BQL as they can
-often be cross vCPU.
-
-Memory Consistency
-==================
-
-Between emulated guests and host systems there are a range of memory
-consistency models. Even emulating weakly ordered systems on strongly
-ordered hosts needs to ensure things like store-after-load re-ordering
-can be prevented when the guest wants to.
-
-Memory Barriers
----------------
-
-Barriers (sometimes known as fences) provide a mechanism for software
-to enforce a particular ordering of memory operations from the point
-of view of external observers (e.g. another processor core). They can
-apply to any memory operations as well as just loads or stores.
-
-The Linux kernel has an excellent write-up on the various forms of
-memory barrier and the guarantees they can provide [1].
-
-Barriers are often wrapped around synchronisation primitives to
-provide explicit memory ordering semantics. However they can be used
-by themselves to provide safe lockless access by ensuring for example
-a change to a signal flag will only be visible once the changes to
-payload are.
-
-DESIGN REQUIREMENT: Add a new tcg_memory_barrier op
-
-This would enforce a strong load/store ordering so all loads/stores
-complete at the memory barrier. On single-core non-SMP strongly
-ordered backends this could become a NOP.
-
-Aside from explicit standalone memory barrier instructions there are
-also implicit memory ordering semantics which comes with each guest
-memory access instruction. For example all x86 load/stores come with
-fairly strong guarantees of sequential consistency whereas Arm has
-special variants of load/store instructions that imply acquire/release
-semantics.
-
-In the case of a strongly ordered guest architecture being emulated on
-a weakly ordered host the scope for a heavy performance impact is
-quite high.
-
-DESIGN REQUIREMENTS: Be efficient with use of memory barriers
-       - host systems with stronger implied guarantees can skip some barriers
-       - merge consecutive barriers to the strongest one
-
-(Current solution)
-
-The system currently has a tcg_gen_mb() which will add memory barrier
-operations if code generation is being done in a parallel context. The
-tcg_optimize() function attempts to merge barriers up to their
-strongest form before any load/store operations. The solution was
-originally developed and tested for linux-user based systems. All
-backends have been converted to emit fences when required. So far the
-following front-ends have been updated to emit fences when required:
-
-    - target-i386
-    - target-arm
-    - target-aarch64
-    - target-alpha
-    - target-mips
-
-Memory Control and Maintenance
-------------------------------
-
-This includes a class of instructions for controlling system cache
-behaviour. While QEMU doesn't model cache behaviour these instructions
-are often seen when code modification has taken place to ensure the
-changes take effect.
-
-Synchronisation Primitives
---------------------------
-
-There are two broad types of synchronisation primitives found in
-modern ISAs: atomic instructions and exclusive regions.
-
-The first type offer a simple atomic instruction which will guarantee
-some sort of test and conditional store will be truly atomic w.r.t.
-other cores sharing access to the memory. The classic example is the
-x86 cmpxchg instruction.
-
-The second type offer a pair of load/store instructions which offer a
-guarantee that a region of memory has not been touched between the
-load and store instructions. An example of this is Arm's ldrex/strex
-pair where the strex instruction will return a flag indicating a
-successful store only if no other CPU has accessed the memory region
-since the ldrex.
-
-Traditionally TCG has generated a series of operations that work
-because they are within the context of a single translation block so
-will have completed before another CPU is scheduled. However with
-the ability to have multiple threads running to emulate multiple CPUs
-we will need to explicitly expose these semantics.
-
-DESIGN REQUIREMENTS:
-  - Support classic atomic instructions
-  - Support load/store exclusive (or load link/store conditional) pairs
-  - Generic enough infrastructure to support all guest architectures
-CURRENT OPEN QUESTIONS:
-  - How problematic is the ABA problem in general?
-
-(Current solution)
-
-The TCG provides a number of atomic helpers (tcg_gen_atomic_*) which
-can be used directly or combined to emulate other instructions like
-Arm's ldrex/strex instructions. While they are susceptible to the ABA
-problem so far common guests have not implemented patterns where
-this may be a problem - typically presenting a locking ABI which
-assumes cmpxchg like semantics.
-
-The code also includes a fall-back for cases where multi-threaded TCG
-ops can't work (e.g. guest atomic width > host atomic width). In this
-case an EXCP_ATOMIC exit occurs and the instruction is emulated with
-an exclusive lock which ensures all emulation is serialised.
-
-While the atomic helpers look good enough for now there may be a need
-to look at solutions that can more closely model the guest
-architectures semantics.
-
-==========
-
-[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt
diff --git a/docs/devel/tcg-icount.rst b/docs/devel/tcg-icount.rst
new file mode 100644
index 0000000000..8d67b6c076
--- /dev/null
+++ b/docs/devel/tcg-icount.rst
@@ -0,0 +1,97 @@
+..
+   Copyright (c) 2020, Linaro Limited
+   Written by Alex Bennée
+
+
+========================
+TCG Instruction Counting
+========================
+
+TCG has long supported a feature known as icount which allows for
+instruction counting during execution. This should not be confused
+with cycle accurate emulation - QEMU does not attempt to emulate how
+long an instruction would take on real hardware. That is a job for
+other more detailed (and slower) tools that simulate the rest of a
+micro-architecture.
+
+This feature is only available for system emulation and is
+incompatible with multi-threaded TCG. It can be used to better align
+execution time with wall-clock time so a "slow" device doesn't run too
+fast on modern hardware. It can also provides for a degree of
+deterministic execution and is an essential part of the record/replay
+support in QEMU.
+
+Core Concepts
+=============
+
+At its heart icount is simply a count of executed instructions which
+is stored in the TimersState of QEMU's timer sub-system. The number of
+executed instructions can then be used to calculate QEMU_CLOCK_VIRTUAL
+which represents the amount of elapsed time in the system since
+execution started. Depending on the icount mode this may either be a
+fixed number of ns per instruction or adjusted as execution continues
+to keep wall clock time and virtual time in sync.
+
+To be able to calculate the number of executed instructions the
+translator starts by allocating a budget of instructions to be
+executed. The budget of instructions is limited by how long it will be
+until the next timer will expire. We store this budget as part of a
+vCPU icount_decr field which shared with the machinery for handling
+cpu_exit(). The whole field is checked at the start of every
+translated block and will cause a return to the outer loop to deal
+with whatever caused the exit.
+
+In the case of icount, before the flag is checked we subtract the
+number of instructions the translation block would execute. If this
+would cause the instruction budget to go negative we exit the main
+loop and regenerate a new translation block with exactly the right
+number of instructions to take the budget to 0 meaning whatever timer
+was due to expire will expire exactly when we exit the main run loop.
+
+Dealing with MMIO
+-----------------
+
+While we can adjust the instruction budget for known events like timer
+expiry we cannot do the same for MMIO. Every load/store we execute
+might potentially trigger an I/O event, at which point we will need an
+up to date and accurate reading of the icount number.
+
+To deal with this case, when an I/O access is made we:
+
+  - restore un-executed instructions to the icount budget
+  - re-compile a single [1]_ instruction block for the current PC
+  - exit the cpu loop and execute the re-compiled block
+
+The new block is created with the CF_LAST_IO compile flag which
+ensures the final instruction translation starts with a call to
+gen_io_start() so we don't enter a perpetual loop constantly
+recompiling a single instruction block. For translators using the
+common translator_loop this is done automatically.
+  
+.. [1] sometimes two instructions if dealing with delay slots  
+
+Other I/O operations
+--------------------
+
+MMIO isn't the only type of operation for which we might need a
+correct and accurate clock. IO port instructions and accesses to
+system registers are the common examples here. These instructions have
+to be handled by the individual translators which have the knowledge
+of which operations are I/O operations.
+
+When the translator is handling an instruction of this kind:
+
+* it must call gen_io_start() if icount is enabled, at some
+   point before the generation of the code which actually does
+   the I/O, using a code fragment similar to:
+
+.. code:: c
+
+    if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) {
+        gen_io_start();
+    }
+
+* it must end the TB immediately after this instruction
+
+Note that some older front-ends call a "gen_io_end()" function:
+this is obsolete and should not be used.
diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
index a40145fcf8..abda961e2b 100644
--- a/docs/system/gdb.rst
+++ b/docs/system/gdb.rst
@@ -87,3 +87,23 @@ three commands you can query and set the single step behavior:
       (gdb) maintenance packet Qqemu.sstep=0x5
       sending: "qemu.sstep=0x5"
       received: "OK"
+
+
+Another feature that QEMU gdbstub provides is to toggle the memory GDB
+works with, by default GDB will show the current process memory respecting
+the virtual address translation.
+
+If you want to examine/change the physical memory you can set the gdbstub
+to work with the physical memory rather with the virtual one.
+
+The memory mode can be checked by sending the following command:
+
+``maintenance packet qqemu.PhyMemMode``
+    This will return either 0 or 1, 1 indicates you are currently in the
+    physical memory mode.
+
+``maintenance packet Qqemu.PhyMemMode:1``
+    This will change the memory mode to physical memory.
+
+``maintenance packet Qqemu.PhyMemMode:0``
+    This will change it back to normal memory mode.
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index e907f3182b..d619594ad4 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -49,19 +49,16 @@ common-obj-m += qxl.mo
 qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o
 endif
 
-ifeq ($(CONFIG_VIRTIO_GPU),y)
-common-obj-m += virtio-gpu.mo
-virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
-virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
-virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
-virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
-virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
-virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
-virtio-gpu.mo-objs := $(virtio-gpu-obj-y)
-virtio-gpu.mo-cflags := $(VIRGL_CFLAGS)
-virtio-gpu.mo-libs := $(VIRGL_LIBS)
-endif
-
+common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
+common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
+common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
+common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
+common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
+common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
+virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
+virtio-gpu.o-libs += $(VIRGL_LIBS)
+virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
+virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
 common-obj-$(CONFIG_DPCD) += dpcd.o
 common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
 
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index b5cb21384a..7e7f642332 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2294,7 +2294,7 @@ static void pgb_dynamic(const char *image_name, long align)
 static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
                             abi_ulong guest_hiaddr, long align)
 {
-    const int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
+    int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
     void *addr, *test;
 
     if (guest_hiaddr > reserved_va) {
@@ -2307,15 +2307,19 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
     /* Widen the "image" to the entire reserved address space. */
     pgb_static(image_name, 0, reserved_va, align);
 
+#ifdef MAP_FIXED_NOREPLACE
+    flags |= MAP_FIXED_NOREPLACE;
+#endif
+
     /* Reserve the memory on the host. */
     assert(guest_base != 0);
     test = g2h(0);
     addr = mmap(test, reserved_va, PROT_NONE, flags, -1, 0);
     if (addr == MAP_FAILED) {
         error_report("Unable to reserve 0x%lx bytes of virtual address "
-                     "space for use as guest address space (check your "
+                     "space (%s) for use as guest address space (check your "
                      "virtual memory ulimit setting or reserve less "
-                     "using -R option)", reserved_va);
+                     "using -R option)", reserved_va, strerror(errno));
         exit(EXIT_FAILURE);
     }
     assert(addr == test);
diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
new file mode 100644
index 0000000000..830cb7c628
--- /dev/null
+++ b/python/qemu/console_socket.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python3
+#
+# This python module implements a ConsoleSocket object which is
+# designed always drain the socket itself, and place
+# the bytes into a in memory buffer for later processing.
+#
+# Optionally a file path can be passed in and we will also
+# dump the characters to this file for debug.
+#
+# Copyright 2020 Linaro
+#
+# Authors:
+#  Robert Foley <robert.foley@linaro.org>
+#
+# This code is licensed under the GPL version 2 or later.  See
+# the COPYING file in the top-level directory.
+#
+import asyncore
+import socket
+import threading
+import io
+import os
+import sys
+from collections import deque
+import time
+import traceback
+
+class ConsoleSocket(asyncore.dispatcher):
+
+    def __init__(self, address, file=None):
+        self._recv_timeout_sec = 300
+        self._buffer = deque()
+        self._asyncore_thread = None
+        self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+        self._sock.connect(address)
+        self._logfile = None
+        if file:
+            self._logfile = open(file, "w")
+        asyncore.dispatcher.__init__(self, sock=self._sock)
+        self._open = True
+        self._thread_start()
+
+    def _thread_start(self):
+        """Kick off a thread to wait on the asyncore.loop"""
+        if self._asyncore_thread is not None:
+            return
+        self._asyncore_thread = threading.Thread(target=asyncore.loop,
+                                                 kwargs={'timeout':1})
+        self._asyncore_thread.daemon = True
+        self._asyncore_thread.start()
+
+    def handle_close(self):
+        """redirect close to base class"""
+        # Call the base class close, but not self.close() since
+        # handle_close() occurs in the context of the thread which
+        # self.close() attempts to join.
+        asyncore.dispatcher.close(self)
+
+    def close(self):
+        """Close the base object and wait for the thread to terminate"""
+        if self._open:
+            self._open = False
+            asyncore.dispatcher.close(self)
+            if self._asyncore_thread is not None:
+                thread, self._asyncore_thread = self._asyncore_thread, None
+                thread.join()
+            if self._logfile:
+                self._logfile.close()
+                self._logfile = None
+
+    def handle_read(self):
+        """process arriving characters into in memory _buffer"""
+        try:
+            data = asyncore.dispatcher.recv(self, 1)
+            # latin1 is needed since there are some chars
+            # we are receiving that cannot be encoded to utf-8
+            # such as 0xe2, 0x80, 0xA6.
+            string = data.decode("latin1")
+        except:
+            print("Exception seen.")
+            traceback.print_exc()
+            return
+        if self._logfile:
+            self._logfile.write("{}".format(string))
+            self._logfile.flush()
+        for c in string:
+            self._buffer.extend(c)
+
+    def recv(self, n=1, sleep_delay_s=0.1):
+        """Return chars from in memory buffer"""
+        start_time = time.time()
+        while len(self._buffer) < n:
+            time.sleep(sleep_delay_s)
+            elapsed_sec = time.time() - start_time
+            if elapsed_sec > self._recv_timeout_sec:
+                raise socket.timeout
+        chars = ''.join([self._buffer.popleft() for i in range(n)])
+        # We choose to use latin1 to remain consistent with
+        # handle_read() and give back the same data as the user would
+        # receive if they were reading directly from the
+        # socket w/o our intervention.
+        return chars.encode("latin1")
+
+    def set_blocking(self):
+        """Maintain compatibility with socket API"""
+        pass
+
+    def settimeout(self, seconds):
+        """Set current timeout on recv"""
+        self._recv_timeout_sec = seconds
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 041c615052..c25f0b42cf 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -26,6 +26,7 @@ import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
+from qemu.console_socket import ConsoleSocket
 
 from . import qmp
 
@@ -75,7 +76,8 @@ class QEMUMachine:
 
     def __init__(self, binary, args=None, wrapper=None, name=None,
                  test_dir="/var/tmp", monitor_address=None,
-                 socket_scm_helper=None, sock_dir=None):
+                 socket_scm_helper=None, sock_dir=None,
+                 drain_console=False, console_log=None):
         '''
         Initialize a QEMUMachine
 
@@ -86,6 +88,9 @@ class QEMUMachine:
         @param test_dir: where to create socket and log file
         @param monitor_address: address for QMP monitor
         @param socket_scm_helper: helper program, required for send_fd_scm()
+        @param sock_dir: where to create socket (overrides test_dir for sock)
+        @param console_log: (optional) path to console log file
+        @param drain_console: (optional) True to drain console socket to buffer
         @note: Qemu process is not started until launch() is used.
         '''
         if args is None:
@@ -122,6 +127,12 @@ class QEMUMachine:
         self._console_address = None
         self._console_socket = None
         self._remove_files = []
+        self._console_log_path = console_log
+        if self._console_log_path:
+            # In order to log the console, buffering needs to be enabled.
+            self._drain_console = True
+        else:
+            self._drain_console = drain_console
 
     def __enter__(self):
         return self
@@ -580,7 +591,11 @@ class QEMUMachine:
         Returns a socket connected to the console
         """
         if self._console_socket is None:
-            self._console_socket = socket.socket(socket.AF_UNIX,
-                                                 socket.SOCK_STREAM)
-            self._console_socket.connect(self._console_address)
+            if self._drain_console:
+                self._console_socket = ConsoleSocket(self._console_address,
+                                                    file=self._console_log_path)
+            else:
+                self._console_socket = socket.socket(socket.AF_UNIX,
+                                                     socket.SOCK_STREAM)
+                self._console_socket.connect(self._console_address)
         return self._console_socket
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 09df2d3f86..c7e4646ded 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -22,6 +22,8 @@ endif
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
 	@echo " $(MAKE) check-clean          Clean the tests and related data"
 	@echo
+	@echo "The following are useful for CI builds"
+	@echo " $(MAKE) check-build          Build most test binaris"
 	@echo " $(MAKE) get-vm-images        Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
 	@echo
 	@echo
@@ -649,6 +651,10 @@ $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(c
 	  QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
 	  QTEST_QEMU_IMG=qemu-img$(EXESUF))
 
+build-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y)
+
+build-unit: $(check-unit-y)
+
 check-unit: $(check-unit-y)
 	$(call do_test_human, $^)
 
@@ -680,7 +686,6 @@ check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check
 FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
 
 # the build dir is created by configure
-.PHONY: $(FP_TEST_BIN)
 $(FP_TEST_BIN): config-host.h $(test-util-obj-y)
 	$(call quiet-command, \
 	 	$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
@@ -814,9 +819,10 @@ check-softfloat-ops: $(SF_MATH_RULES)
 
 .PHONY: check-softfloat
 ifeq ($(CONFIG_TCG),y)
-check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
+build-softfloat: $(FP_TEST_BIN)
+check-softfloat: build-softfloat check-softfloat-conv check-softfloat-compare check-softfloat-ops
 else
-check-softfloat:
+build-softfloat check-softfloat:
 	$(call quiet-command, /bin/true, "FLOAT TEST", \
 		"SKIPPED for non-TCG builds")
 endif
@@ -944,7 +950,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
             --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
             --filter-by-tags-include-empty --filter-by-tags-include-empty-key \
             $(AVOCADO_TAGS) \
-            --failfast=on tests/acceptance, \
+            $(if $(GITLAB_CI),,--failfast=on) tests/acceptance, \
             "AVOCADO", "tests/acceptance")
 
 # Consolidated targets
@@ -955,7 +961,8 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 ifeq ($(CONFIG_TOOLS),y)
 check-block: $(patsubst %,check-%, $(check-block-y))
 endif
-check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
+check-build: build-unit build-softfloat build-qtest
+
 check-clean:
 	rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
 	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
@@ -963,6 +970,8 @@ check-clean:
 	rm -f tests/qtest/dbus-vmstate1-gen-timestamp
 	rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
 
+check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
+
 clean: check-clean
 
 # Build the help program automatically
diff --git a/tests/acceptance/boot_linux.py b/tests/acceptance/boot_linux.py
index 3aa57e88b0..0055dc7cee 100644
--- a/tests/acceptance/boot_linux.py
+++ b/tests/acceptance/boot_linux.py
@@ -20,6 +20,7 @@ from avocado.utils import network
 from avocado.utils import vmimage
 from avocado.utils import datadrainer
 from avocado.utils.path import find_command
+from avocado import skipIf
 
 ACCEL_NOT_AVAILABLE_FMT = "%s accelerator does not seem to be available"
 KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
@@ -220,6 +221,7 @@ class BootLinuxS390X(BootLinux):
 
     chksum = '4caaab5a434fd4d1079149a072fdc7891e354f834d355069ca982fdcaf5a122d'
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_s390_ccw_virtio_tcg(self):
         """
         :avocado: tags=machine:s390-ccw-virtio
diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
index a3e54d3fc9..a249e2f14a 100644
--- a/tests/acceptance/linux_initrd.py
+++ b/tests/acceptance/linux_initrd.py
@@ -8,10 +8,12 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
+import os
 import logging
 import tempfile
 
 from avocado_qemu import Test
+from avocado import skipIf
 
 
 class LinuxInitrd(Test):
@@ -51,6 +53,7 @@ class LinuxInitrd(Test):
                 max_size + 1)
             self.assertRegex(self.vm.get_log(), expected_msg)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_with_2gib_file_should_work_with_linux_v4_16(self):
         """
         QEMU has supported up to 4 GiB initrd for recent kernel
diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py
index 92b4f28a11..7c9a4ee4d2 100644
--- a/tests/acceptance/machine_mips_malta.py
+++ b/tests/acceptance/machine_mips_malta.py
@@ -15,6 +15,7 @@ from avocado import skipUnless
 from avocado_qemu import Test
 from avocado_qemu import wait_for_console_pattern
 from avocado.utils import archive
+from avocado import skipIf
 
 
 NUMPY_AVAILABLE = True
@@ -99,6 +100,7 @@ class MaltaMachineFramebuffer(Test):
         """
         self.do_test_i6400_framebuffer_logo(1)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         :avocado: tags=arch:mips64el
@@ -108,6 +110,7 @@ class MaltaMachineFramebuffer(Test):
         """
         self.do_test_i6400_framebuffer_logo(7)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         """
         :avocado: tags=arch:mips64el
diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machine_rx_gdbsim.py
index a44f2c87da..bff63e421d 100644
--- a/tests/acceptance/machine_rx_gdbsim.py
+++ b/tests/acceptance/machine_rx_gdbsim.py
@@ -50,7 +50,7 @@ class RxGdbSimMachine(Test):
         :avocado: tags=machine:gdbsim-r5f562n7
         :avocado: tags=endian:little
         """
-        dtb_url = ('https://acc.dl.osdn.jp/users/23/23887/rx-qemu.dtb')
+        dtb_url = ('https://acc.dl.osdn.jp/users/23/23887/rx-virt.dtb')
         dtb_hash = '7b4e4e2c71905da44e86ce47adee2210b026ac18'
         dtb_path = self.fetch_asset(dtb_url, asset_hash=dtb_hash)
         kernel_url = ('http://acc.dl.osdn.jp/users/23/23845/zImage')
diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py
index 60621417dd..62d2db8c64 100644
--- a/tests/acceptance/replay_kernel.py
+++ b/tests/acceptance/replay_kernel.py
@@ -73,7 +73,7 @@ class ReplayKernel(LinuxKernelTest):
         logger = logging.getLogger('replay')
         logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1))
 
-    @skipIf(os.getenv('CONTINUOUS_INTEGRATION'), 'Running on Travis-CI')
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_x86_64_pc(self):
         """
         :avocado: tags=arch:x86_64
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 3e3617816e..a104e9df28 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -13,6 +13,7 @@ DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.doc
 DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
 # Use a global constant ccache directory to speed up repetitive builds
 DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache
+DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),registry.gitlab.com/qemu-project/qemu)
 
 DOCKER_TESTS := $(notdir $(shell \
 	find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
@@ -50,13 +51,15 @@ docker-image: ${DOCKER_TARGETS}
 ifdef SKIP_DOCKER_BUILD
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 	$(call quiet-command, \
-		$(DOCKER_SCRIPT) check --quiet qemu:$* $<, \
+		$(DOCKER_SCRIPT) check --quiet qemu/$* $<, \
 		"CHECK", "$*")
 else
 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
 	$(call quiet-command,\
-		$(DOCKER_SCRIPT) build -t qemu:$* -f $< \
-		$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
+		$(DOCKER_SCRIPT) build -t qemu/$* -f $< \
+		$(if $V,,--quiet) \
+		$(if $(NOCACHE),--no-cache, \
+			$(if $(DOCKER_REGISTRY),--registry $(DOCKER_REGISTRY))) \
 		$(if $(NOUSER),,--add-current-user) \
 		$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\
 		$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)),\
@@ -75,14 +78,14 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
 			DEB_ARCH=$(DEB_ARCH)					\
 			DEB_TYPE=$(DEB_TYPE) 					\
 			$(if $(DEB_URL),DEB_URL=$(DEB_URL),)			\
-			$(DOCKER_SCRIPT) build qemu:debian-$* $< 		\
+			$(DOCKER_SCRIPT) build qemu/debian-$* $< 		\
 			$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) 		\
 			$(if $(NOUSER),,--add-current-user) 			\
 			$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))	\
 			$(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \
 			"BUILD","binfmt debian-$* (debootstrapped)"),		\
 		$(call quiet-command,						\
-			$(DOCKER_SCRIPT) check --quiet qemu:debian-$* $< || 	\
+			$(DOCKER_SCRIPT) check --quiet qemu/debian-$* $< || 	\
 			{ echo "You will need to build $(EXECUTABLE)"; exit 1;},\
 			"CHECK", "debian-$* exists"))
 
@@ -131,6 +134,7 @@ docker-image-travis: NOUSER=1
 
 # Specialist build images, sometimes very limited tools
 docker-image-debian-tricore-cross: docker-image-debian9
+docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
 
 # These images may be good enough for building tests but not for test builds
@@ -213,6 +217,7 @@ endif
 	@echo '                         Include extra files in image.'
 	@echo '    ENGINE=auto/docker/podman'
 	@echo '                         Specify which container engine to run.'
+	@echo '    REGISTRY=url         Cache builds from registry (default:$(DOCKER_REGISTRY))'
 
 # This rule if for directly running against an arbitrary docker target.
 # It is called by the expanded docker targets (e.g. make
@@ -258,7 +263,7 @@ docker-run: docker-qemu-src
 docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
 docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
 docker-run-%:
-	@$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE)
+	@$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu/$(IMAGE)
 
 docker-clean:
 	$(call quiet-command, $(DOCKER_SCRIPT) clean)
diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index 02cd67a8c5..ebc5b97ecf 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -47,7 +47,7 @@ build_qemu()
 check_qemu()
 {
     # default to make check unless the caller specifies
-    if test -z "$@"; then
+    if [ $# = 0 ]; then
         INVOCATION="check"
     else
         INVOCATION="$@"
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index e630aae108..2d67bbd15a 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -204,7 +204,7 @@ def _dockerfile_preprocess(df):
     for l in df.splitlines():
         if len(l.strip()) == 0 or l.startswith("#"):
             continue
-        from_pref = "FROM qemu:"
+        from_pref = "FROM qemu/"
         if l.startswith(from_pref):
             # TODO: Alternatively we could replace this line with "FROM $ID"
             # where $ID is the image's hex id obtained with
@@ -221,6 +221,13 @@ class Docker(object):
     """ Running Docker commands """
     def __init__(self):
         self._command = _guess_engine_command()
+
+        if "docker" in self._command and "TRAVIS" not in os.environ:
+            os.environ["DOCKER_BUILDKIT"] = "1"
+            self._buildkit = True
+        else:
+            self._buildkit = False
+
         self._instance = None
         atexit.register(self._kill_instances)
         signal.signal(signal.SIGTERM, self._kill_instances)
@@ -289,10 +296,25 @@ class Docker(object):
         return labels.get("com.qemu.dockerfile-checksum", "")
 
     def build_image(self, tag, docker_dir, dockerfile,
-                    quiet=True, user=False, argv=None, extra_files_cksum=[]):
+                    quiet=True, user=False, argv=None, registry=None,
+                    extra_files_cksum=[]):
         if argv is None:
             argv = []
 
+        # pre-calculate the docker checksum before any
+        # substitutions we make for caching
+        checksum = _text_checksum(_dockerfile_preprocess(dockerfile))
+
+        if registry is not None:
+            # see if we can fetch a cache copy, may fail...
+            pull_args = ["pull", "%s/%s" % (registry, tag)]
+            if self._do(pull_args, quiet=quiet) == 0:
+                dockerfile = dockerfile.replace("FROM qemu/",
+                                                "FROM %s/qemu/" %
+                                                (registry))
+            else:
+                registry = None
+
         tmp_df = tempfile.NamedTemporaryFile(mode="w+t",
                                              encoding='utf-8',
                                              dir=docker_dir, suffix=".docker")
@@ -306,15 +328,23 @@ class Docker(object):
                          (uname, uid, uname))
 
         tmp_df.write("\n")
-        tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" %
-                     _text_checksum(_dockerfile_preprocess(dockerfile)))
+        tmp_df.write("LABEL com.qemu.dockerfile-checksum=%s" % (checksum))
         for f, c in extra_files_cksum:
             tmp_df.write("LABEL com.qemu.%s-checksum=%s" % (f, c))
 
         tmp_df.flush()
 
-        self._do_check(["build", "-t", tag, "-f", tmp_df.name] + argv +
-                       [docker_dir],
+        build_args = ["build", "-t", tag, "-f", tmp_df.name]
+        if self._buildkit:
+            build_args += ["--build-arg", "BUILDKIT_INLINE_CACHE=1"]
+
+        if registry is not None:
+            cache = "%s/%s" % (registry, tag)
+            build_args += ["--cache-from", cache]
+        build_args += argv
+        build_args += [docker_dir]
+
+        self._do_check(build_args,
                        quiet=quiet)
 
     def update_image(self, tag, tarball, quiet=True):
@@ -403,6 +433,8 @@ class BuildCommand(SubCommand):
         parser.add_argument("--add-current-user", "-u", dest="user",
                             action="store_true",
                             help="Add the current user to image's passwd")
+        parser.add_argument("--registry", "-r",
+                            help="cache from docker registry")
         parser.add_argument("-t", dest="tag",
                             help="Image Tag")
         parser.add_argument("-f", dest="dockerfile",
@@ -458,7 +490,8 @@ class BuildCommand(SubCommand):
                      for k, v in os.environ.items()
                      if k.lower() in FILTERED_ENV_NAMES]
             dkr.build_image(tag, docker_dir, dockerfile,
-                            quiet=args.quiet, user=args.user, argv=argv,
+                            quiet=args.quiet, user=args.user,
+                            argv=argv, registry=args.registry,
                             extra_files_cksum=cksum)
 
             rmtree(docker_dir)
diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
new file mode 100644
index 0000000000..dedcea58b4
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
@@ -0,0 +1,53 @@
+#
+# Docker all cross-compiler target (tests only)
+#
+# While the normal cross builds take care to setup proper multiarch
+# build environments which can cross build QEMU this just installs the
+# basic compilers for as many targets as possible. We shall use this
+# to build and run linux-user tests on GitLab
+#
+FROM qemu/debian10
+
+# What we need to build QEMU itself
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt build-dep -yy qemu
+
+# Add the foreign architecture we want and install dependencies
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+        apt install -y --no-install-recommends \
+        gcc-aarch64-linux-gnu \
+        libc6-dev-arm64-cross \
+        gcc-alpha-linux-gnu \
+        libc6.1-dev-alpha-cross \
+        gcc-arm-linux-gnueabihf \
+        libc6-dev-armhf-cross \
+        gcc-hppa-linux-gnu \
+        libc6-dev-hppa-cross \
+        gcc-m68k-linux-gnu \
+        libc6-dev-m68k-cross \
+        gcc-mips-linux-gnu \
+        libc6-dev-mips-cross \
+        gcc-mips64-linux-gnuabi64 \
+        libc6-dev-mips64-cross \
+        gcc-mips64el-linux-gnuabi64 \
+        libc6-dev-mips64el-cross \
+        gcc-mipsel-linux-gnu \
+        libc6-dev-mipsel-cross \
+        gcc-powerpc-linux-gnu \
+        libc6-dev-powerpc-cross \
+        gcc-powerpc64-linux-gnu \
+        libc6-dev-ppc64-cross \
+        gcc-powerpc64le-linux-gnu \
+        libc6-dev-ppc64el-cross \
+        gcc-riscv64-linux-gnu \
+        libc6-dev-riscv64-cross \
+        gcc-s390x-linux-gnu \
+        libc6-dev-s390x-cross \
+        gcc-sh4-linux-gnu \
+        libc6-dev-sh4-cross \
+        gcc-sparc64-linux-gnu \
+        libc6-dev-sparc64-cross
+
+ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
+ENV DEF_TARGET_LIST aarch64-linux-user,alpha-linux-user,arm-linux-user,hppa-linux-user,i386-linux-user,m68k-linux-user,mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,ppc-linux-user,ppc64-linux-user,ppc64le-linux-user,riscv64-linux-user,s390x-linux-user,sh4-linux-user,sparc64-linux-user
diff --git a/tests/docker/dockerfiles/debian-alpha-cross.docker b/tests/docker/dockerfiles/debian-alpha-cross.docker
index 74bcabfdb1..10fe30df0d 100644
--- a/tests/docker/dockerfiles/debian-alpha-cross.docker
+++ b/tests/docker/dockerfiles/debian-alpha-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker
index 5d89041925..870109ef6a 100644
--- a/tests/docker/dockerfiles/debian-amd64-cross.docker
+++ b/tests/docker/dockerfiles/debian-amd64-cross.docker
@@ -4,7 +4,7 @@
 # This docker target is used on non-x86_64 machines which need the
 # x86_64 cross compilers installed.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Alex Bennée <alex.bennee@linaro.org>
 
 # Add the foreign architecture we want and install dependencies
diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index 957f0bc2e7..8fdfd6a6b0 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -4,7 +4,7 @@
 # This docker target builds on the debian Stretch base image. Further
 # libraries which are not widely available are installed by hand.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
 RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker
index 09ca0a1ba7..166e24df13 100644
--- a/tests/docker/dockerfiles/debian-arm64-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture arm64
diff --git a/tests/docker/dockerfiles/debian-arm64-test-cross.docker b/tests/docker/dockerfiles/debian-arm64-test-cross.docker
index a44e76d942..53a9012beb 100644
--- a/tests/docker/dockerfiles/debian-arm64-test-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-test-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Bullseye base image.
 #
-FROM qemu:debian11
+FROM qemu/debian11
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture arm64
diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker
index e3794a61c9..b7b1a3585f 100644
--- a/tests/docker/dockerfiles/debian-armel-cross.docker
+++ b/tests/docker/dockerfiles/debian-armel-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
 # Add the foreign architecture we want and install dependencies
diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker
index e163b8b956..25d7618833 100644
--- a/tests/docker/dockerfiles/debian-armhf-cross.docker
+++ b/tests/docker/dockerfiles/debian-armhf-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture armhf
diff --git a/tests/docker/dockerfiles/debian-hppa-cross.docker b/tests/docker/dockerfiles/debian-hppa-cross.docker
index 5c68b2d330..3d6c65a3ef 100644
--- a/tests/docker/dockerfiles/debian-hppa-cross.docker
+++ b/tests/docker/dockerfiles/debian-hppa-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-m68k-cross.docker b/tests/docker/dockerfiles/debian-m68k-cross.docker
index 25edc80e9a..fcb10e3534 100644
--- a/tests/docker/dockerfiles/debian-m68k-cross.docker
+++ b/tests/docker/dockerfiles/debian-m68k-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips-cross.docker b/tests/docker/dockerfiles/debian-mips-cross.docker
index 08a8e1c29c..26c154014d 100644
--- a/tests/docker/dockerfiles/debian-mips-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-mips64-cross.docker b/tests/docker/dockerfiles/debian-mips64-cross.docker
index 1a79505d69..09c2ba584e 100644
--- a/tests/docker/dockerfiles/debian-mips64-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker
index 453b53ef72..c990b683b7 100644
--- a/tests/docker/dockerfiles/debian-mips64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker
@@ -4,7 +4,7 @@
 # This docker target builds on the debian Stretch base image.
 #
 
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker
index 3b6e975c68..0e5dd42d3c 100644
--- a/tests/docker/dockerfiles/debian-mipsel-cross.docker
+++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-powerpc-cross.docker b/tests/docker/dockerfiles/debian-powerpc-cross.docker
index 89dd4fbf87..07e1789650 100644
--- a/tests/docker/dockerfiles/debian-powerpc-cross.docker
+++ b/tests/docker/dockerfiles/debian-powerpc-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-ppc64-cross.docker b/tests/docker/dockerfiles/debian-ppc64-cross.docker
index 4bf88ab02d..8efe68874e 100644
--- a/tests/docker/dockerfiles/debian-ppc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64-cross.docker
@@ -2,7 +2,7 @@
 # Docker ppc64 cross-compiler target
 #
 # This docker target builds on the debian Buster base image.
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
index cd386f01d9..1146a06be6 100644
--- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the foreign architecture we want and install dependencies
 RUN dpkg --add-architecture ppc64el && \
diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker
index 5e2d6ddb60..2bbff19772 100644
--- a/tests/docker/dockerfiles/debian-riscv64-cross.docker
+++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker
index 43fe59836f..9f2ab51eb0 100644
--- a/tests/docker/dockerfiles/debian-s390x-cross.docker
+++ b/tests/docker/dockerfiles/debian-s390x-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 # Add the s390x architecture
 RUN dpkg --add-architecture s390x
diff --git a/tests/docker/dockerfiles/debian-sh4-cross.docker b/tests/docker/dockerfiles/debian-sh4-cross.docker
index 9d7663764e..fd3af89575 100644
--- a/tests/docker/dockerfiles/debian-sh4-cross.docker
+++ b/tests/docker/dockerfiles/debian-sh4-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-sparc64-cross.docker b/tests/docker/dockerfiles/debian-sparc64-cross.docker
index 31fd34f120..f4bb9b561c 100644
--- a/tests/docker/dockerfiles/debian-sparc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-sparc64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Buster base image.
 #
-FROM qemu:debian10
+FROM qemu/debian10
 
 RUN apt update && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-tricore-cross.docker b/tests/docker/dockerfiles/debian-tricore-cross.docker
index 4a0f7706a3..769d95c77b 100644
--- a/tests/docker/dockerfiles/debian-tricore-cross.docker
+++ b/tests/docker/dockerfiles/debian-tricore-cross.docker
@@ -7,7 +7,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 #
-FROM qemu:debian9
+FROM qemu/debian9
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-win32-cross.docker b/tests/docker/dockerfiles/debian-win32-cross.docker
index d16d6431bc..b045e821b9 100644
--- a/tests/docker/dockerfiles/debian-win32-cross.docker
+++ b/tests/docker/dockerfiles/debian-win32-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch MXE base image.
 #
-FROM qemu:debian9-mxe
+FROM qemu/debian9-mxe
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-win64-cross.docker b/tests/docker/dockerfiles/debian-win64-cross.docker
index b0bc960445..2fc9cfcbc6 100644
--- a/tests/docker/dockerfiles/debian-win64-cross.docker
+++ b/tests/docker/dockerfiles/debian-win64-cross.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch MXE base image.
 #
-FROM qemu:debian9-mxe
+FROM qemu/debian9-mxe
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/debian-xtensa-cross.docker b/tests/docker/dockerfiles/debian-xtensa-cross.docker
index beb73f46ba..ba4148299c 100644
--- a/tests/docker/dockerfiles/debian-xtensa-cross.docker
+++ b/tests/docker/dockerfiles/debian-xtensa-cross.docker
@@ -18,12 +18,12 @@ RUN apt-get update && \
         git \
         python3-minimal
 
-ENV CPU_LIST csp dc232b dc233c
-ENV TOOLCHAIN_RELEASE 2018.02
+ENV CPU_LIST dc232b dc233c de233_fpu dsp3400
+ENV TOOLCHAIN_RELEASE 2020.07
 
 RUN for cpu in $CPU_LIST; do \
         curl -#SL http://github.com/foss-xtensa/toolchain/releases/download/$TOOLCHAIN_RELEASE/x86_64-$TOOLCHAIN_RELEASE-xtensa-$cpu-elf.tar.gz \
         | tar -xzC /opt; \
     done
 
-ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-csp-elf/bin
+ENV PATH $PATH:/opt/$TOOLCHAIN_RELEASE/xtensa-dc232b-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dc233c-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-de233_fpu-elf/bin:/opt/$TOOLCHAIN_RELEASE/xtensa-dsp3400-elf/bin
diff --git a/tests/docker/dockerfiles/debian9-mxe.docker b/tests/docker/dockerfiles/debian9-mxe.docker
index 62ff1cecf2..ae2c222a6f 100644
--- a/tests/docker/dockerfiles/debian9-mxe.docker
+++ b/tests/docker/dockerfiles/debian9-mxe.docker
@@ -3,7 +3,7 @@
 #
 # This docker target builds on the debian Stretch base image.
 #
-FROM qemu:debian9
+FROM qemu/debian9
 
 MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
 
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 798ddd2c3e..70b6186bd3 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -80,7 +80,12 @@ ENV PACKAGES \
     pixman-devel \
     python3 \
     python3-PyYAML \
+    python3-numpy \
+    python3-opencv \
+    python3-pillow \
+    python3-pip \
     python3-sphinx \
+    python3-virtualenv \
     rdma-core-devel \
     SDL2-devel \
     snappy-devel \
@@ -89,6 +94,8 @@ ENV PACKAGES \
     systemd-devel \
     systemtap-sdt-devel \
     tar \
+    tesseract \
+    tesseract-langpack-eng \
     texinfo \
     usbredir-devel \
     virglrenderer-devel \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 6050ce7e8a..f7aac840bf 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -46,9 +46,17 @@ ENV PACKAGES flex bison \
     libxen-dev \
     libzstd-dev \
     make \
-    python3-yaml \
+    python3-numpy \
+    python3-opencv \
+    python3-pil \
+    python3-pip \
     python3-sphinx \
+    python3-venv \
+    python3-yaml \
+    rpm2cpio \
     sparse \
+    tesseract-ocr \
+    tesseract-ocr-eng \
     texinfo \
     xfslibs-dev\
     vim
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index d967adc59a..c9f978abce 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -186,7 +186,7 @@ _filter_img_create()
             -e 's/^\(data_file\)/3-\1/' \
             -e 's/^\(encryption\)/4-\1/' \
             -e 's/^\(preallocation\)/8-\1/' \
-        | sort \
+        | LC_ALL=C sort \
         | $SED -e 's/^[0-9]-//' \
         | tr '\n\0' ' \n' \
         | $SED -e 's/^ *$//' -e 's/ *$//'
diff --git a/tests/qht-bench.c b/tests/qht-bench.c
index eb88a90137..362f03cb03 100644
--- a/tests/qht-bench.c
+++ b/tests/qht-bench.c
@@ -25,7 +25,13 @@ struct thread_stats {
 struct thread_info {
     void (*func)(struct thread_info *);
     struct thread_stats stats;
-    uint64_t r;
+    /*
+     * Seed is in the range [1..UINT64_MAX], because the RNG requires
+     * a non-zero seed.  To use, subtract 1 and compare against the
+     * threshold with </>=.  This lets threshold = 0 never match (0% hit),
+     * and threshold = UINT64_MAX always match (100% hit).
+     */
+    uint64_t seed;
     bool write_op; /* writes alternate between insertions and removals */
     bool resize_down;
 } QEMU_ALIGNED(64); /* avoid false sharing among threads */
@@ -131,8 +137,9 @@ static uint64_t xorshift64star(uint64_t x)
 static void do_rz(struct thread_info *info)
 {
     struct thread_stats *stats = &info->stats;
+    uint64_t r = info->seed - 1;
 
-    if (info->r < resize_threshold) {
+    if (r < resize_threshold) {
         size_t size = info->resize_down ? resize_min : resize_max;
         bool resized;
 
@@ -151,13 +158,14 @@ static void do_rz(struct thread_info *info)
 static void do_rw(struct thread_info *info)
 {
     struct thread_stats *stats = &info->stats;
+    uint64_t r = info->seed - 1;
     uint32_t hash;
     long *p;
 
-    if (info->r >= update_threshold) {
+    if (r >= update_threshold) {
         bool read;
 
-        p = &keys[info->r & (lookup_range - 1)];
+        p = &keys[r & (lookup_range - 1)];
         hash = hfunc(*p);
         read = qht_lookup(&ht, p, hash);
         if (read) {
@@ -166,7 +174,7 @@ static void do_rw(struct thread_info *info)
             stats->not_rd++;
         }
     } else {
-        p = &keys[info->r & (update_range - 1)];
+        p = &keys[r & (update_range - 1)];
         hash = hfunc(*p);
         if (info->write_op) {
             bool written = false;
@@ -208,7 +216,7 @@ static void *thread_func(void *p)
 
     rcu_read_lock();
     while (!atomic_read(&test_stop)) {
-        info->r = xorshift64star(info->r);
+        info->seed = xorshift64star(info->seed);
         info->func(info);
     }
     rcu_read_unlock();
@@ -221,7 +229,7 @@ static void *thread_func(void *p)
 static void prepare_thread_info(struct thread_info *info, int i)
 {
     /* seed for the RNG; each thread should have a different one */
-    info->r = (i + 1) ^ time(NULL);
+    info->seed = (i + 1) ^ time(NULL);
     /* the first update will be a write */
     info->write_op = true;
     /* the first resize will be down */
@@ -281,11 +289,25 @@ static void pr_params(void)
 
 static void do_threshold(double rate, uint64_t *threshold)
 {
+    /*
+     * For 0 <= rate <= 1, scale to fit in a uint64_t.


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16268.39774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqZ-00080k-OK; Fri, 30 Oct 2020 21:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16268.39774; Fri, 30 Oct 2020 21:22:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqZ-00080c-LJ; Fri, 30 Oct 2020 21:22:07 +0000
Received: by outflank-mailman (input) for mailman id 16268;
 Fri, 30 Oct 2020 21:22:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbqY-00080X-P6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3c64b65e-2e0a-4301-9af5-bd51d2ded105;
 Fri, 30 Oct 2020 21:22:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqW-00038W-2y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqW-0006u1-0v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbqY-00080X-P6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:06 +0000
X-Inumbo-ID: 3c64b65e-2e0a-4301-9af5-bd51d2ded105
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3c64b65e-2e0a-4301-9af5-bd51d2ded105;
	Fri, 30 Oct 2020 21:22:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1WiUUW/9xzsZWBgU2AthdJR4tJSARuNLCRc4+9txBKs=; b=uTKgTxatAXMPBv7lkLbnJWNJBD
	lBPVfUftgh5cPb7k/UJI/V38GwqgbhHj70tmXHKYAqH5MAJAxDN9822isyqZAth9qdN//jkY03Vyh
	TuM8wO5wmRe7VNXdaWQTG+TrtF/JMUFHKdeSQFntIj01Q4JWoeXrkpZA0G3bLKZBAbZ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqW-00038W-2y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqW-0006u1-0v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] char-socket: initialize reconnect timer only when the timer doesn't start
Message-Id: <E1kYbqW-0006u1-0v@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:04 +0000

commit 2b61bb716cd45ffe10fc92512b6134084c0ffcde
Author:     Li Feng <fengli@smartx.com>
AuthorDate: Fri May 22 10:55:54 2020 +0800
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    char-socket: initialize reconnect timer only when the timer doesn't start
    
    When the disconnect event is triggered in the connecting stage,
    the tcp_chr_disconnect_locked may be called twice.
    
    The first call:
        #0  qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:120
        #1  0x000055555558e38c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
        #2  0x000055555558e3cd in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
        #3  0x000055555558ea32 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
        #4  0x000055555558eeb8 in qemu_chr_socket_connected (task=0x55555582f300, opaque=<optimized out>) at chardev/char-socket.c:1090
        #5  0x0000555555574352 in qio_task_complete (task=task@entry=0x55555582f300) at io/task.c:196
        #6  0x00005555555745f4 in qio_task_thread_result (opaque=0x55555582f300) at io/task.c:111
        #7  qio_task_wait_thread (task=0x55555582f300) at io/task.c:190
        #8  0x000055555558f17e in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1013
        #9  0x0000555555567cbd in char_socket_client_reconnect_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1152
    The second call:
        #0  0x00007ffff5ac3277 in raise () from /lib64/libc.so.6
        #1  0x00007ffff5ac4968 in abort () from /lib64/libc.so.6
        #2  0x00007ffff5abc096 in __assert_fail_base () from /lib64/libc.so.6
        #3  0x00007ffff5abc142 in __assert_fail () from /lib64/libc.so.6
        #4  0x000055555558d10a in qemu_chr_socket_restart_timer (chr=0x55555582ee90) at chardev/char-socket.c:125
        #5  0x000055555558df0c in tcp_chr_disconnect_locked (chr=<optimized out>) at chardev/char-socket.c:490
        #6  0x000055555558df4d in tcp_chr_disconnect (chr=0x55555582ee90) at chardev/char-socket.c:497
        #7  0x000055555558e5b2 in tcp_chr_new_client (chr=chr@entry=0x55555582ee90, sioc=sioc@entry=0x55555582f0b0) at chardev/char-socket.c:892
        #8  0x000055555558e93a in tcp_chr_connect_client_sync (chr=chr@entry=0x55555582ee90, errp=errp@entry=0x7fffffffd178) at chardev/char-socket.c:944
        #9  0x000055555558ec78 in tcp_chr_wait_connected (chr=0x55555582ee90, errp=0x555555802a08 <error_abort>) at chardev/char-socket.c:1035
        #10 0x000055555556804b in char_socket_client_test (opaque=0x5555557fe020 <client8unix>) at tests/test-char.c:1023
    
    Run test/test-char to reproduce this issue.
    
    test-char: chardev/char-socket.c:125: qemu_chr_socket_restart_timer: Assertion `!s->reconnect_timer' failed.
    
    Signed-off-by: Li Feng <fengli@smartx.com>
    Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20200522025554.41063-1-fengli@smartx.com>
---
 chardev/char-socket.c |  2 +-
 tests/test-char.c     | 73 +++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 57 insertions(+), 18 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 5758d9900f..320aa7c642 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -490,7 +490,7 @@ static void tcp_chr_disconnect_locked(Chardev *chr)
     if (emit_close) {
         qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
     }
-    if (s->reconnect_time) {
+    if (s->reconnect_time && !s->reconnect_timer) {
         qemu_chr_socket_restart_timer(chr);
     }
 }
diff --git a/tests/test-char.c b/tests/test-char.c
index 3afc9b1b8d..73ba1cf601 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -625,12 +625,14 @@ static void char_udp_test(void)
 typedef struct {
     int event;
     bool got_pong;
+    CharBackend *be;
 } CharSocketTestData;
 
 
 #define SOCKET_PING "Hello"
 #define SOCKET_PONG "World"
 
+typedef void (*char_socket_cb)(void *opaque, QEMUChrEvent event);
 
 static void
 char_socket_event(void *opaque, QEMUChrEvent event)
@@ -639,6 +641,27 @@ char_socket_event(void *opaque, QEMUChrEvent event)
     data->event = event;
 }
 
+static void
+char_socket_event_with_error(void *opaque, QEMUChrEvent event)
+{
+    static bool first_error;
+    CharSocketTestData *data = opaque;
+    CharBackend *be = data->be;
+    data->event = event;
+    switch (event) {
+    case CHR_EVENT_OPENED:
+        if (!first_error) {
+            first_error = true;
+            qemu_chr_fe_disconnect(be);
+        }
+        return;
+    case CHR_EVENT_CLOSED:
+        return;
+    default:
+        return;
+    }
+}
+
 
 static void
 char_socket_read(void *opaque, const uint8_t *buf, int size)
@@ -699,19 +722,24 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool fd_pass,
 }
 
 
-static void
-char_socket_ping_pong(QIOChannel *ioc)
+static int
+char_socket_ping_pong(QIOChannel *ioc, Error **errp)
 {
     char greeting[sizeof(SOCKET_PING)];
     const char *response = SOCKET_PONG;
 
-    qio_channel_read_all(ioc, greeting, sizeof(greeting), &error_abort);
+    int ret;
+    ret = qio_channel_read_all(ioc, greeting, sizeof(greeting), errp);
+    if (ret != 0) {
+        object_unref(OBJECT(ioc));
+        return -1;
+    }
 
     g_assert(memcmp(greeting, SOCKET_PING, sizeof(greeting)) == 0);
 
-    qio_channel_write_all(ioc, response, sizeof(SOCKET_PONG), &error_abort);
-
+    qio_channel_write_all(ioc, response, sizeof(SOCKET_PONG), errp);
     object_unref(OBJECT(ioc));
+    return 0;
 }
 
 
@@ -723,7 +751,7 @@ char_socket_server_client_thread(gpointer data)
 
     qio_channel_socket_connect_sync(ioc, addr, &error_abort);
 
-    char_socket_ping_pong(QIO_CHANNEL(ioc));
+    char_socket_ping_pong(QIO_CHANNEL(ioc), &error_abort);
 
     return NULL;
 }
@@ -783,6 +811,7 @@ static void char_socket_server_test(gconstpointer opaque)
 
  reconnect:
     data.event = -1;
+    data.be = &be;
     qemu_chr_fe_set_handlers(&be, NULL, NULL,
                              char_socket_event, NULL,
                              &data, NULL, true);
@@ -855,10 +884,13 @@ char_socket_client_server_thread(gpointer data)
     QIOChannelSocket *ioc = data;
     QIOChannelSocket *cioc;
 
+retry:
     cioc = qio_channel_socket_accept(ioc, &error_abort);
     g_assert_nonnull(cioc);
 
-    char_socket_ping_pong(QIO_CHANNEL(cioc));
+    if (char_socket_ping_pong(QIO_CHANNEL(cioc), NULL) != 0) {
+        goto retry;
+    }
 
     return NULL;
 }
@@ -869,12 +901,13 @@ typedef struct {
     const char *reconnect;
     bool wait_connected;
     bool fd_pass;
+    char_socket_cb event_cb;
 } CharSocketClientTestConfig;
 
-
 static void char_socket_client_test(gconstpointer opaque)
 {
     const CharSocketClientTestConfig *config = opaque;
+    const char_socket_cb event_cb = config->event_cb;
     QIOChannelSocket *ioc;
     char *optstr;
     Chardev *chr;
@@ -938,8 +971,9 @@ static void char_socket_client_test(gconstpointer opaque)
 
  reconnect:
     data.event = -1;
+    data.be = &be;
     qemu_chr_fe_set_handlers(&be, NULL, NULL,
-                             char_socket_event, NULL,
+                             event_cb, NULL,
                              &data, NULL, true);
     if (config->reconnect) {
         g_assert(data.event == -1);
@@ -977,7 +1011,7 @@ static void char_socket_client_test(gconstpointer opaque)
     /* Setup a callback to receive the reply to our greeting */
     qemu_chr_fe_set_handlers(&be, char_socket_can_read,
                              char_socket_read,
-                             char_socket_event, NULL,
+                             event_cb, NULL,
                              &data, NULL, true);
     g_assert(data.event == CHR_EVENT_OPENED);
     data.event = -1;
@@ -1422,17 +1456,20 @@ int main(int argc, char **argv)
 
 #define SOCKET_CLIENT_TEST(name, addr)                                  \
     static CharSocketClientTestConfig client1 ## name =                 \
-        { addr, NULL, false, false };                                   \
+        { addr, NULL, false, false, char_socket_event};                 \
     static CharSocketClientTestConfig client2 ## name =                 \
-        { addr, NULL, true, false };                                    \
+        { addr, NULL, true, false, char_socket_event };                 \
     static CharSocketClientTestConfig client3 ## name =                 \
-        { addr, ",reconnect=1", false };                                \
+        { addr, ",reconnect=1", false, false, char_socket_event };      \
     static CharSocketClientTestConfig client4 ## name =                 \
-        { addr, ",reconnect=1", true };                                 \
+        { addr, ",reconnect=1", true, false, char_socket_event };       \
     static CharSocketClientTestConfig client5 ## name =                 \
-        { addr, NULL, false, true };                                    \
+        { addr, NULL, false, true, char_socket_event };                 \
     static CharSocketClientTestConfig client6 ## name =                 \
-        { addr, NULL, true, true };                                     \
+        { addr, NULL, true, true, char_socket_event };                  \
+    static CharSocketClientTestConfig client7 ## name =                 \
+        { addr, ",reconnect=1", true, false,                            \
+            char_socket_event_with_error };                             \
     g_test_add_data_func("/char/socket/client/mainloop/" # name,        \
                          &client1 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn/" # name,       \
@@ -1444,7 +1481,9 @@ int main(int argc, char **argv)
     g_test_add_data_func("/char/socket/client/mainloop-fdpass/" # name, \
                          &client5 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn-fdpass/" # name, \
-                         &client6 ##name, char_socket_client_test)
+                         &client6 ##name, char_socket_client_test);     \
+    g_test_add_data_func("/char/socket/client/reconnect-error/" # name, \
+                         &client7 ##name, char_socket_client_test)
 
     if (has_ipv4) {
         SOCKET_SERVER_TEST(tcp, &tcpaddr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16269.39778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqi-00081f-Pr; Fri, 30 Oct 2020 21:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16269.39778; Fri, 30 Oct 2020 21:22:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqi-00081X-Mo; Fri, 30 Oct 2020 21:22:16 +0000
Received: by outflank-mailman (input) for mailman id 16269;
 Fri, 30 Oct 2020 21:22:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbqh-00081L-DY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 84cacd4f-a0c0-45ee-aed8-ed7c263e29de;
 Fri, 30 Oct 2020 21:22:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqg-00038Z-9i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqg-0006uW-5d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbqh-00081L-DY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:15 +0000
X-Inumbo-ID: 84cacd4f-a0c0-45ee-aed8-ed7c263e29de
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 84cacd4f-a0c0-45ee-aed8-ed7c263e29de;
	Fri, 30 Oct 2020 21:22:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=J1rERdL8AJIfQ9zaAN8VAjlXUbBLvjTS1+mbLqGq4U0=; b=rmR4DJVcYId7qMN4bsZgp4hD+E
	EQwaiKO7rL35Nyv6b1VQfB3+fzUi4OTOvAZXxpBrB/PVlV0oVzmzeCsB3kqNApihtBAoJdcKS8lp0
	2M4Inzj3rCX4RFTxjqMj0Jg3UUw6jp85L8BkjEtKv4u/RFNrSPD4QQqGI2Cqi3sb4P20=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqg-00038Z-9i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqg-0006uW-5d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] chardev: don't abort on attempt to add duplicated chardev
Message-Id: <E1kYbqg-0006uW-5d@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:14 +0000

commit 14a7a203063694ff932f3371ed93e97987dcafc0
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Mon Jul 6 22:10:34 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: don't abort on attempt to add duplicated chardev
    
    This is a regression from commit d2623129a7d ("qom: Drop parameter @errp
    of object_property_add() & friends").
    
    (qemu) chardev-add id=null,backend=null
    (qemu) chardev-add id=null,backend=null
    Unexpected error in object_property_try_add() at /home/elmarco/src/qemu/qom/object.c:1166:
    attempt to add duplicate property 'null' to object (type 'container')
    
    That case is currently not covered in the test suite, but will be with
    the queued patch "char: fix use-after-free with dup chardev &
    reconnect".
    
    Fixes: d2623129a7dec1d3041ad1221dda1ca49c667532
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 chardev/char.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/chardev/char.c b/chardev/char.c
index e5b43cb4b8..a0626d04d5 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -996,7 +996,11 @@ static Chardev *chardev_new(const char *id, const char *typename,
     }
 
     if (id) {
-        object_property_add_child(get_chardevs_root(), id, obj);
+        object_property_try_add_child(get_chardevs_root(), id, obj,
+                                      &local_err);
+        if (local_err) {
+            goto end;
+        }
         object_unref(obj);
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16270.39782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqt-00082y-RP; Fri, 30 Oct 2020 21:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16270.39782; Fri, 30 Oct 2020 21:22:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbqt-00082q-OZ; Fri, 30 Oct 2020 21:22:27 +0000
Received: by outflank-mailman (input) for mailman id 16270;
 Fri, 30 Oct 2020 21:22:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbqs-00082d-LO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c9ab2689-6004-49e0-9efd-ddacafdbf2a9;
 Fri, 30 Oct 2020 21:22:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqq-00038s-Ex
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbqq-0006v8-Cc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbqs-00082d-LO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:26 +0000
X-Inumbo-ID: c9ab2689-6004-49e0-9efd-ddacafdbf2a9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c9ab2689-6004-49e0-9efd-ddacafdbf2a9;
	Fri, 30 Oct 2020 21:22:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pij1TzphyLCHJIV6cS3vpLJeeKR4mstx3JeKKl0TYOQ=; b=4Q+tkB5ORuM6pmYexlCJ4ZvbaY
	pFAJbVO+qu6zolVrwNboPG3AFzu1zCoqA1wHrBsa5qX+wOKwONgZczniI/RXdDQRPzCO60lZ0ZOoW
	nzfloG7zfDtzAxFCJB7P4rVhXOGZ2OxRyzLBf8dmHU8fU3wugYchK455VagZFLq2lTIs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqq-00038s-Ex
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbqq-0006v8-Cc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] char: fix use-after-free with dup chardev & reconnect
Message-Id: <E1kYbqq-0006v8-Cc@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:24 +0000

commit 6806601969a0d6c095e3836423fef1dedec55289
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Mon Apr 20 13:20:12 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    char: fix use-after-free with dup chardev & reconnect
    
    With a reconnect socket, qemu_char_open() will start a background
    thread. It should keep a reference on the chardev.
    
    Fixes invalid read:
    READ of size 8 at 0x6040000ac858 thread T7
        #0 0x5555598d37b8 in unix_connect_saddr /home/elmarco/src/qq/util/qemu-sockets.c:954
        #1 0x5555598d4751 in socket_connect /home/elmarco/src/qq/util/qemu-sockets.c:1109
        #2 0x555559707c34 in qio_channel_socket_connect_sync /home/elmarco/src/qq/io/channel-socket.c:145
        #3 0x5555596adebb in tcp_chr_connect_client_task /home/elmarco/src/qq/chardev/char-socket.c:1104
        #4 0x555559723d55 in qio_task_thread_worker /home/elmarco/src/qq/io/task.c:123
        #5 0x5555598a6731 in qemu_thread_start /home/elmarco/src/qq/util/qemu-thread-posix.c:519
        #6 0x7ffff40d4431 in start_thread (/lib64/libpthread.so.0+0x9431)
        #7 0x7ffff40029d2 in __clone (/lib64/libc.so.6+0x1019d2)
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200420112012.567284-1-marcandre.lureau@redhat.com>
---
 chardev/char-socket.c |  3 ++-
 tests/test-char.c     | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 320aa7c642..ef62dbf3d7 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -1129,7 +1129,8 @@ static void tcp_chr_connect_client_async(Chardev *chr)
      */
     s->connect_task = qio_task_new(OBJECT(sioc),
                                    qemu_chr_socket_connected,
-                                   chr, NULL);
+                                   object_ref(OBJECT(chr)),
+                                   (GDestroyNotify)object_unref);
     qio_task_run_in_thread(s->connect_task,
                            tcp_chr_connect_client_task,
                            s->addr,
diff --git a/tests/test-char.c b/tests/test-char.c
index 73ba1cf601..9d8746414d 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -904,6 +904,52 @@ typedef struct {
     char_socket_cb event_cb;
 } CharSocketClientTestConfig;
 
+static void char_socket_client_dupid_test(gconstpointer opaque)
+{
+    const CharSocketClientTestConfig *config = opaque;
+    QIOChannelSocket *ioc;
+    char *optstr;
+    Chardev *chr1, *chr2;
+    SocketAddress *addr;
+    QemuOpts *opts;
+    Error *local_err = NULL;
+
+    /*
+     * Setup a listener socket and determine get its address
+     * so we know the TCP port for the client later
+     */
+    ioc = qio_channel_socket_new();
+    g_assert_nonnull(ioc);
+    qio_channel_socket_listen_sync(ioc, config->addr, 1, &error_abort);
+    addr = qio_channel_socket_get_local_address(ioc, &error_abort);
+    g_assert_nonnull(addr);
+
+    /*
+     * Populate the chardev address based on what the server
+     * is actually listening on
+     */
+    optstr = char_socket_addr_to_opt_str(addr,
+                                         config->fd_pass,
+                                         config->reconnect,
+                                         false);
+
+    opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"),
+                                   optstr, true);
+    g_assert_nonnull(opts);
+    chr1 = qemu_chr_new_from_opts(opts, NULL, &error_abort);
+    g_assert_nonnull(chr1);
+
+    chr2 = qemu_chr_new_from_opts(opts, NULL, &local_err);
+    g_assert_null(chr2);
+    error_free_or_abort(&local_err);
+
+    object_unref(OBJECT(ioc));
+    qemu_opts_del(opts);
+    object_unparent(OBJECT(chr1));
+    qapi_free_SocketAddress(addr);
+    g_free(optstr);
+}
+
 static void char_socket_client_test(gconstpointer opaque)
 {
     const CharSocketClientTestConfig *config = opaque;
@@ -1456,7 +1502,7 @@ int main(int argc, char **argv)
 
 #define SOCKET_CLIENT_TEST(name, addr)                                  \
     static CharSocketClientTestConfig client1 ## name =                 \
-        { addr, NULL, false, false, char_socket_event};                 \
+        { addr, NULL, false, false, char_socket_event };                \
     static CharSocketClientTestConfig client2 ## name =                 \
         { addr, NULL, true, false, char_socket_event };                 \
     static CharSocketClientTestConfig client3 ## name =                 \
@@ -1470,6 +1516,8 @@ int main(int argc, char **argv)
     static CharSocketClientTestConfig client7 ## name =                 \
         { addr, ",reconnect=1", true, false,                            \
             char_socket_event_with_error };                             \
+    static CharSocketClientTestConfig client8 ## name =                 \
+        { addr, ",reconnect=1", false, false, char_socket_event };      \
     g_test_add_data_func("/char/socket/client/mainloop/" # name,        \
                          &client1 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/wait-conn/" # name,       \
@@ -1483,7 +1531,9 @@ int main(int argc, char **argv)
     g_test_add_data_func("/char/socket/client/wait-conn-fdpass/" # name, \
                          &client6 ##name, char_socket_client_test);     \
     g_test_add_data_func("/char/socket/client/reconnect-error/" # name, \
-                         &client7 ##name, char_socket_client_test)
+                         &client7 ##name, char_socket_client_test);     \
+    g_test_add_data_func("/char/socket/client/dupid-reconnect/" # name, \
+                         &client8 ##name, char_socket_client_dupid_test)
 
     if (has_ipv4) {
         SOCKET_SERVER_TEST(tcp, &tcpaddr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16271.39786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbr2-00084M-T8; Fri, 30 Oct 2020 21:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16271.39786; Fri, 30 Oct 2020 21:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbr2-00084C-Q8; Fri, 30 Oct 2020 21:22:36 +0000
Received: by outflank-mailman (input) for mailman id 16271;
 Fri, 30 Oct 2020 21:22:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbr1-000845-G7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 249e7c2c-37e2-48b2-96fb-414b19227140;
 Fri, 30 Oct 2020 21:22:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbr0-00039l-Ik
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbr0-0006wX-HZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbr1-000845-G7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:35 +0000
X-Inumbo-ID: 249e7c2c-37e2-48b2-96fb-414b19227140
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 249e7c2c-37e2-48b2-96fb-414b19227140;
	Fri, 30 Oct 2020 21:22:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=odr+KiBUJy2hVToA28RsGaxofkKE+i0WJ6BnpHj6izM=; b=tJpwS54wvDPlqPo9wqVln3u770
	4uNpwy4Qva8TNnInmNdhxhjLZHyzvqwIZ3LLpnfsCspSvt9ZhSMnmr1doWzs540PQh4KaIJgxdnI9
	rzdJh5BUrT7lzQUau7i6aKbd3a/ChD666Ma+fKAwTpOZUZKeJ5CPWmk5Fki0Mu1152Fw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbr0-00039l-Ik
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbr0-0006wX-HZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] monitor/misc: Remove unused "chardev/char-mux.h" include
Message-Id: <E1kYbr0-0006wX-HZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:34 +0000

commit 833ef7ec5677ac3f6627f44fbd599cfb16581220
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:06 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    monitor/misc: Remove unused "chardev/char-mux.h" include
    
    monitor/misc.c never required "chardev/char-mux.h", remove it.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-2-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 monitor/misc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/monitor/misc.c b/monitor/misc.c
index 89bb970b00..e847b58a8c 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -33,7 +33,6 @@
 #include "exec/gdbstub.h"
 #include "net/net.h"
 #include "net/slirp.h"
-#include "chardev/char-mux.h"
 #include "ui/qemu-spice.h"
 #include "qemu/config-file.h"
 #include "qemu/ctype.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16272.39790 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrC-00086U-Uk; Fri, 30 Oct 2020 21:22:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16272.39790; Fri, 30 Oct 2020 21:22:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrC-00086M-Rm; Fri, 30 Oct 2020 21:22:46 +0000
Received: by outflank-mailman (input) for mailman id 16272;
 Fri, 30 Oct 2020 21:22:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbrB-00086B-IW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6ffd3746-b05b-4d63-9511-690f75fa76a7;
 Fri, 30 Oct 2020 21:22:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrA-0003B4-MW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrA-0006xu-LR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbrB-00086B-IW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:45 +0000
X-Inumbo-ID: 6ffd3746-b05b-4d63-9511-690f75fa76a7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6ffd3746-b05b-4d63-9511-690f75fa76a7;
	Fri, 30 Oct 2020 21:22:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jNc6LirkvPShCnjadGvJrHXdeLEpUx64pOpp22wPVZA=; b=XOQynf0gdX7rIR9VNmRjgHKDHI
	clVxJAvvN5cAdLvUQpaceu94f2nBCOs+IViLgsVM4JKZ2oL5+jPno7gwWgYGtc8H8TwsNzr5Lu6LS
	9ztVQhJ58W7wMzYPobvWZTKb69loCCgC/C2Uxn/wvo0IHMVvzz4PkIngZ8gtItZjn/2M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrA-0003B4-MW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrA-0006xu-LR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/test-char: Remove unused "chardev/char-mux.h" include
Message-Id: <E1kYbrA-0006xu-LR@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:44 +0000

commit 35b49e93fda0498fe1a8663a6ad3db11756d7e93
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:07 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    tests/test-char: Remove unused "chardev/char-mux.h" include
    
    This test never required "chardev/char-mux.h", remove it.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-3-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-char.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index 9d8746414d..614bdac2df 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -6,7 +6,6 @@
 #include "qemu/option.h"
 #include "qemu/sockets.h"
 #include "chardev/char-fe.h"
-#include "chardev/char-mux.h"
 #include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-char.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:22:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:22:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16273.39796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrN-00088p-3T; Fri, 30 Oct 2020 21:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16273.39796; Fri, 30 Oct 2020 21:22:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrM-00088h-Ui; Fri, 30 Oct 2020 21:22:56 +0000
Received: by outflank-mailman (input) for mailman id 16273;
 Fri, 30 Oct 2020 21:22:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbrL-00087l-KY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0bf7e63-ec08-4e53-b5b4-794a430cdb7e;
 Fri, 30 Oct 2020 21:22:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrK-0003BB-Q4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrK-0006yf-PA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbrL-00087l-KY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:55 +0000
X-Inumbo-ID: f0bf7e63-ec08-4e53-b5b4-794a430cdb7e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0bf7e63-ec08-4e53-b5b4-794a430cdb7e;
	Fri, 30 Oct 2020 21:22:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8RNsloYHd5MqY+XEJ143rxVNsdPO12Mp78I3lLtmiUM=; b=SCBMoNlHKOPUH0wBnodZy72Ly+
	9qwWQXtHU4+bPAczinGCvr6vnPyz1P3Px9TQSgeBcVrDPkZXZA54EpKPeZ4rmyY3kd7C5F6asH1KY
	zL8xEG2hN7JCQAk+84iCmw5WsOwO7onmScBPcdEIwertSlwYKEqFH8frjFmz4g9DH84M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrK-0003BB-Q4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrK-0006yf-PA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:22:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] chardev: Restrict msmouse / wctablet / testdev to system emulation
Message-Id: <E1kYbrK-0006yf-PA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:22:54 +0000

commit c383efd50a12991a23921e37541c6e5f1bfec1e4
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:08 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Restrict msmouse / wctablet / testdev to system emulation
    
    The msmouse / wctablet / testdev character devices are only
    used by system emulation. Remove them from user mode and tools.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-4-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index 3a58c9d329..62ec0a3323 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -17,7 +17,7 @@ chardev-obj-y += char-udp.o
 chardev-obj-$(CONFIG_WIN32) += char-win.o
 chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o
 
-common-obj-y += msmouse.o wctablet.o testdev.o
+common-obj-$(CONFIG_SOFTMMU) += msmouse.o wctablet.o testdev.o
 
 ifeq ($(CONFIG_BRLAPI),y)
 common-obj-m += baum.o
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16274.39799 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrY-0008At-3U; Fri, 30 Oct 2020 21:23:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16274.39799; Fri, 30 Oct 2020 21:23:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrY-0008Aj-07; Fri, 30 Oct 2020 21:23:08 +0000
Received: by outflank-mailman (input) for mailman id 16274;
 Fri, 30 Oct 2020 21:23:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbrW-0008AV-1c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9f4ed50f-7939-4ce5-aca2-66703336f114;
 Fri, 30 Oct 2020 21:23:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrU-0003BZ-UA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrU-0006zV-T7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbrW-0008AV-1c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:06 +0000
X-Inumbo-ID: 9f4ed50f-7939-4ce5-aca2-66703336f114
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9f4ed50f-7939-4ce5-aca2-66703336f114;
	Fri, 30 Oct 2020 21:23:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jn5DJR8BpzaTwz3V/J4q6KFv9L53mhj/LZQgc3vD4+c=; b=SIwaVYQ7Cfp2fJ/tq2/MnSPpZa
	PEiX99A4tG8vrYdKiLYqSRVxALlS4jApAkf57kktKbJnzu0xErl+H6LEV6DfoqA+uvAyZLqBKM2ay
	ZNAdVTEDlgP4UW2LUaJB8u544IbEjEP3v+BbTQwAlULjyhaswEHgpAsP6VrI5bvA/qz4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrU-0003BZ-UA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrU-0006zV-T7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
Message-Id: <E1kYbrU-0006zV-T7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:04 +0000

commit ffa0f7eb57f3fbb4947e5bf12040108481ea46c3
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:09 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
    
    No file out of chardev/ requires access to this header,
    restrict its scope.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-5-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/char-fe.c          |  2 +-
 chardev/char-mux.c         |  2 +-
 chardev/char.c             |  2 +-
 chardev/chardev-internal.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 include/chardev/char-mux.h | 61 ---------------------------------------------
 5 files changed, 65 insertions(+), 64 deletions(-)

diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index f3530a90e6..474715c5a9 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -29,7 +29,7 @@
 
 #include "chardev/char-fe.h"
 #include "chardev/char-io.h"
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 int qemu_chr_fe_write(CharBackend *be, const uint8_t *buf, int len)
 {
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index 46c44af67c..6f980bb836 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -29,7 +29,7 @@
 #include "chardev/char.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/sysemu.h"
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 /* MUX driver for serial I/O splitting */
 
diff --git a/chardev/char.c b/chardev/char.c
index a0626d04d5..807be52300 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -40,7 +40,7 @@
 #include "qemu/id.h"
 #include "qemu/coroutine.h"
 
-#include "chardev/char-mux.h"
+#include "chardev-internal.h"
 
 /***********************************************************/
 /* character device */
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
new file mode 100644
index 0000000000..e0264ac349
--- /dev/null
+++ b/chardev/chardev-internal.h
@@ -0,0 +1,62 @@
+/*
+ * QEMU Character device internals
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * 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 CHARDEV_INTERNAL_H
+#define CHARDEV_INTERNAL_H
+
+#include "chardev/char.h"
+#include "chardev/char-fe.h"
+
+#define MAX_MUX 4
+#define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
+#define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1)
+
+typedef struct MuxChardev {
+    Chardev parent;
+    CharBackend *backends[MAX_MUX];
+    CharBackend chr;
+    int focus;
+    int mux_cnt;
+    int term_got_escape;
+    int max_size;
+    /* Intermediate input buffer catches escape sequences even if the
+       currently active device is not accepting any input - but only until it
+       is full as well. */
+    unsigned char buffer[MAX_MUX][MUX_BUFFER_SIZE];
+    int prod[MAX_MUX];
+    int cons[MAX_MUX];
+    int timestamps;
+
+    /* Protected by the Chardev chr_write_lock.  */
+    int linestart;
+    int64_t timestamps_start;
+} MuxChardev;
+
+#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
+#define CHARDEV_IS_MUX(chr)                             \
+    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
+
+void mux_set_focus(Chardev *chr, int focus);
+void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
+
+#endif /* CHAR_MUX_H */
diff --git a/include/chardev/char-mux.h b/include/chardev/char-mux.h
deleted file mode 100644
index 417fe32eed..0000000000
--- a/include/chardev/char-mux.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * 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 CHAR_MUX_H
-#define CHAR_MUX_H
-
-#include "chardev/char.h"
-#include "chardev/char-fe.h"
-
-#define MAX_MUX 4
-#define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
-#define MUX_BUFFER_MASK (MUX_BUFFER_SIZE - 1)
-typedef struct MuxChardev {
-    Chardev parent;
-    CharBackend *backends[MAX_MUX];
-    CharBackend chr;
-    int focus;
-    int mux_cnt;
-    int term_got_escape;
-    int max_size;
-    /* Intermediate input buffer catches escape sequences even if the
-       currently active device is not accepting any input - but only until it
-       is full as well. */
-    unsigned char buffer[MAX_MUX][MUX_BUFFER_SIZE];
-    int prod[MAX_MUX];
-    int cons[MAX_MUX];
-    int timestamps;
-
-    /* Protected by the Chardev chr_write_lock.  */
-    int linestart;
-    int64_t timestamps_start;
-} MuxChardev;
-
-#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
-#define CHARDEV_IS_MUX(chr)                             \
-    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
-
-void mux_set_focus(Chardev *chr, int focus);
-void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
-
-#endif /* CHAR_MUX_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16275.39802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbri-0008CP-4o; Fri, 30 Oct 2020 21:23:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16275.39802; Fri, 30 Oct 2020 21:23:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbri-0008CH-1e; Fri, 30 Oct 2020 21:23:18 +0000
Received: by outflank-mailman (input) for mailman id 16275;
 Fri, 30 Oct 2020 21:23:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbrg-0008C6-8r
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a6c0345b-9ba1-4b2b-b08d-43f92ebabb9f;
 Fri, 30 Oct 2020 21:23:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrf-0003Bh-1h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrf-000707-0f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbrg-0008C6-8r
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:16 +0000
X-Inumbo-ID: a6c0345b-9ba1-4b2b-b08d-43f92ebabb9f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a6c0345b-9ba1-4b2b-b08d-43f92ebabb9f;
	Fri, 30 Oct 2020 21:23:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1uylB6lnJz8Q6IYQ/AJWy3kotUC31hMQC1hTl4XJpm0=; b=C/Eutbgo/ConR8kOTHq0bSyPXp
	LdSJslFty0EdKwZgOCxn4s4MWjtW9rLp/1g569nr9FXH58RIp4Zu19DTi5ygewSx7wDr9ed/NMGCX
	NlkS3fvKgm6z+8pOC5kRs8zou+nR6iA4dwVhffv7S09jkBGkM3jC9Dj3igNlDA+7kScA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrf-0003Bh-1h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrf-000707-0f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] chardev: Extract system emulation specific code
Message-Id: <E1kYbrf-000707-0f@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:15 +0000

commit 30827bad3852fd85d86995e7ccab429679442889
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Apr 23 22:21:10 2020 +0200
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Mon Jul 13 11:59:47 2020 +0400

    chardev: Extract system emulation specific code
    
    Split out code only used during system emulation,
    to reduce code pulled in user emulation and tools.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200423202112.644-6-philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 chardev/Makefile.objs      |  1 +
 chardev/char.c             | 35 +----------------------
 chardev/chardev-internal.h |  3 ++
 chardev/chardev-sysemu.c   | 69 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 74 insertions(+), 34 deletions(-)

diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs
index 62ec0a3323..3783dadc4c 100644
--- a/chardev/Makefile.objs
+++ b/chardev/Makefile.objs
@@ -1,4 +1,5 @@
 chardev-obj-y += char.o
+chardev-obj-$(CONFIG_SOFTMMU) += chardev-sysemu.o
 chardev-obj-$(CONFIG_WIN32) += char-console.o
 chardev-obj-$(CONFIG_POSIX) += char-fd.o
 chardev-obj-y += char-fe.o
diff --git a/chardev/char.c b/chardev/char.c
index 807be52300..77e7ec814f 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -45,7 +45,7 @@
 /***********************************************************/
 /* character device */
 
-static Object *get_chardevs_root(void)
+Object *get_chardevs_root(void)
 {
     return container_get(object_get_root(), "/chardevs");
 }
@@ -305,33 +305,6 @@ static const TypeInfo char_type_info = {
     .class_init = char_class_init,
 };
 
-static int chardev_machine_done_notify_one(Object *child, void *opaque)
-{
-    Chardev *chr = (Chardev *)child;
-    ChardevClass *class = CHARDEV_GET_CLASS(chr);
-
-    if (class->chr_machine_done) {
-        return class->chr_machine_done(chr);
-    }
-
-    return 0;
-}
-
-static void chardev_machine_done_hook(Notifier *notifier, void *unused)
-{
-    int ret = object_child_foreach(get_chardevs_root(),
-                                   chardev_machine_done_notify_one, NULL);
-
-    if (ret) {
-        error_report("Failed to call chardev machine_done hooks");
-        exit(1);
-    }
-}
-
-static Notifier chardev_machine_done_notify = {
-    .notify = chardev_machine_done_hook,
-};
-
 static bool qemu_chr_is_busy(Chardev *s)
 {
     if (CHARDEV_IS_MUX(s)) {
@@ -1198,12 +1171,6 @@ void qemu_chr_cleanup(void)
 static void register_types(void)
 {
     type_register_static(&char_type_info);
-
-    /* this must be done after machine init, since we register FEs with muxes
-     * as part of realize functions like serial_isa_realizefn when -nographic
-     * is specified
-     */
-    qemu_add_machine_init_done_notifier(&chardev_machine_done_notify);
 }
 
 type_init(register_types);
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
index e0264ac349..f4d0429763 100644
--- a/chardev/chardev-internal.h
+++ b/chardev/chardev-internal.h
@@ -26,6 +26,7 @@
 
 #include "chardev/char.h"
 #include "chardev/char-fe.h"
+#include "qom/object.h"
 
 #define MAX_MUX 4
 #define MUX_BUFFER_SIZE 32 /* Must be a power of 2.  */
@@ -59,4 +60,6 @@ typedef struct MuxChardev {
 void mux_set_focus(Chardev *chr, int focus);
 void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
 
+Object *get_chardevs_root(void);
+
 #endif /* CHAR_MUX_H */
diff --git a/chardev/chardev-sysemu.c b/chardev/chardev-sysemu.c
new file mode 100644
index 0000000000..eecdc615ee
--- /dev/null
+++ b/chardev/chardev-sysemu.c
@@ -0,0 +1,69 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * 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.
+ */
+
+#include "qemu/osdep.h"
+#include "sysemu/sysemu.h"
+#include "chardev/char.h"
+#include "qemu/error-report.h"
+#include "chardev-internal.h"
+
+static int chardev_machine_done_notify_one(Object *child, void *opaque)
+{
+    Chardev *chr = (Chardev *)child;
+    ChardevClass *class = CHARDEV_GET_CLASS(chr);
+
+    if (class->chr_machine_done) {
+        return class->chr_machine_done(chr);
+    }
+
+    return 0;
+}
+
+static void chardev_machine_done_hook(Notifier *notifier, void *unused)
+{
+    int ret = object_child_foreach(get_chardevs_root(),
+                                   chardev_machine_done_notify_one, NULL);
+
+    if (ret) {
+        error_report("Failed to call chardev machine_done hooks");
+        exit(1);
+    }
+}
+
+
+static Notifier chardev_machine_done_notify = {
+    .notify = chardev_machine_done_hook,
+};
+
+static void register_types(void)
+{
+    /*
+     * This must be done after machine init, since we register FEs with muxes
+     * as part of realize functions like serial_isa_realizefn when -nographic
+     * is specified.
+     */
+    qemu_add_machine_init_done_notifier(&chardev_machine_done_notify);
+}
+
+type_init(register_types);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16276.39807 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrr-0008DZ-6h; Fri, 30 Oct 2020 21:23:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16276.39807; Fri, 30 Oct 2020 21:23:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbrr-0008DQ-38; Fri, 30 Oct 2020 21:23:27 +0000
Received: by outflank-mailman (input) for mailman id 16276;
 Fri, 30 Oct 2020 21:23:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbrq-0008DI-01
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5979e1be-585d-4ddf-acf6-093b99d0821c;
 Fri, 30 Oct 2020 21:23:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrp-0003Bp-6L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrp-00070m-4Z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbrq-0008DI-01
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:26 +0000
X-Inumbo-ID: 5979e1be-585d-4ddf-acf6-093b99d0821c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5979e1be-585d-4ddf-acf6-093b99d0821c;
	Fri, 30 Oct 2020 21:23:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yxMVhQD4IOXXZmeI5YvS+HAnUJgu2AybqWy0T9Ea9R8=; b=toK9eM8E5tl1R6oJsWgS0i1Fzz
	VRj+WsO0yZu46k9klv9xkbX8fo/sNq1K/mfRKAhqtSN9z4goF/lTdUNBVuU6fgsAOQGswuQdWlZMo
	P1+guM0PkEFBKLGx9kr7kGX2A0YvQ+o+Apbt8tQQDI3VA7o1G4Mh02Dx+cV236+jZkw8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrp-0003Bp-6L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrp-00070m-4Z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/elmarco/tags/chardev-pull-request' into staging
Message-Id: <E1kYbrp-00070m-4Z@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:25 +0000

commit 6c87d9f311dba0641bdc2df556056938a8bf2a12
Merge: 9f526fce49c6ac48114ed04914b5a76e4db75785 30827bad3852fd85d86995e7ccab429679442889
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 09:34:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 09:34:24 2020 +0100

    Merge remote-tracking branch 'remotes/elmarco/tags/chardev-pull-request' into staging
    
    # gpg: Signature made Mon 13 Jul 2020 09:23:19 BST
    # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
    # gpg:                issuer "marcandre.lureau@redhat.com"
    # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
    # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
    # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
    
    * remotes/elmarco/tags/chardev-pull-request:
      chardev: Extract system emulation specific code
      chardev: Reduce "char-mux.h" scope, rename it "chardev-internal.h"
      chardev: Restrict msmouse / wctablet / testdev to system emulation
      tests/test-char: Remove unused "chardev/char-mux.h" include
      monitor/misc: Remove unused "chardev/char-mux.h" include
      char: fix use-after-free with dup chardev & reconnect
      chardev: don't abort on attempt to add duplicated chardev
      char-socket: initialize reconnect timer only when the timer doesn't start
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 chardev/Makefile.objs      |   3 +-
 chardev/char-fe.c          |   2 +-
 chardev/char-mux.c         |   2 +-
 chardev/char-socket.c      |   5 +-
 chardev/char.c             |  43 +++-------------
 chardev/chardev-internal.h |  65 ++++++++++++++++++++++++
 chardev/chardev-sysemu.c   |  69 +++++++++++++++++++++++++
 include/chardev/char-mux.h |  61 -----------------------
 monitor/misc.c             |   1 -
 tests/test-char.c          | 122 ++++++++++++++++++++++++++++++++++++++-------
 10 files changed, 253 insertions(+), 120 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16277.39810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbs2-0008Ez-7Z; Fri, 30 Oct 2020 21:23:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16277.39810; Fri, 30 Oct 2020 21:23:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbs2-0008Er-4d; Fri, 30 Oct 2020 21:23:38 +0000
Received: by outflank-mailman (input) for mailman id 16277;
 Fri, 30 Oct 2020 21:23:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbs0-0008Eg-Cx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 75023907-f4ae-46ee-8584-10dd5f602614;
 Fri, 30 Oct 2020 21:23:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrz-0003Bx-LZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbrz-00072d-Kc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbs0-0008Eg-Cx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:36 +0000
X-Inumbo-ID: 75023907-f4ae-46ee-8584-10dd5f602614
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 75023907-f4ae-46ee-8584-10dd5f602614;
	Fri, 30 Oct 2020 21:23:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=83Gjmyp9lAwYamR3ptZs8YMJTdXXEPlUhnDQYtL792o=; b=3wcAwDb4URHWzHApzMZLSrXgBm
	pRNEZDnRcs4g5LLY7lFMbp3G+Gm0nGj5UrlRViW0mlGN0q1+YOopHozM6Egbuxul5gdrf/kyfHrnB
	asSiCo4OUVD9aFpFuhHChu3HimHpS98GOGFEB8pj7CYMnj+ifTiXxc44sp+OIvSP8fxo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrz-0003Bx-LZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbrz-00072d-Kc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] configure: fix malloc check
Message-Id: <E1kYbrz-00072d-Kc@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:35 +0000

commit d1abf3fc6abc01fd5f8985af92726f87b5efd80a
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Jul 7 19:13:25 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    configure: fix malloc check
    
    Avoid random return value.
    
    Fixes commit f2dfe54c74f768a5bf78c9e5918918727f9d9459
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Message-Id: <20200707171326.16422-1-olaf@aepfle.de>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 814ed81279..f59418f6de 100755
--- a/configure
+++ b/configure
@@ -6343,6 +6343,7 @@ int main(void) {
     if (tmp != NULL) {
         return *(int *)(tmp + 2);
     }
+    return 1;
 }
 EOF
   if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16278.39814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsC-0008Gf-9r; Fri, 30 Oct 2020 21:23:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16278.39814; Fri, 30 Oct 2020 21:23:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsC-0008GX-6D; Fri, 30 Oct 2020 21:23:48 +0000
Received: by outflank-mailman (input) for mailman id 16278;
 Fri, 30 Oct 2020 21:23:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsA-0008GI-Iz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 74b79ffb-296e-4391-a491-1a0b3f123294;
 Fri, 30 Oct 2020 21:23:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbs9-0003Ck-QA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbs9-00073d-P9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsA-0008GI-Iz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:46 +0000
X-Inumbo-ID: 74b79ffb-296e-4391-a491-1a0b3f123294
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 74b79ffb-296e-4391-a491-1a0b3f123294;
	Fri, 30 Oct 2020 21:23:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rWTiQDIO5Hllj2rLof+eA2XLl3fHg2ZIPh9DcnQXxW4=; b=M4+fir+T7X76ztLnpjsnpv2yvn
	bitgrmlVsEridcM1EuMiLA3luW48Oz6d+tBCqye4/vTWU7XrdnSJSJJ0DTYPcdZ6MkqnAf8MrqLFA
	JLHuJ/faMvlyH1pANq79HrInIGbzBfDmPrMfWbjw3Ag1pDFfXrlBeEYPjM+2F/0axxxM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbs9-0003Ck-QA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbs9-00073d-P9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] configure: do not clobber CFLAGS with --enable-fuzzing
Message-Id: <E1kYbs9-00073d-P9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:45 +0000

commit 0ab6c2384ccae8968517f6883897509cd5f51a40
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Wed Jul 8 16:01:03 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    configure: do not clobber CFLAGS with --enable-fuzzing
    
    When configuring with --enable-fuzzing, we overwrote the CFLAGS
    added by all the preceding checks. Instead of overwriting CFLAGS, append
    the ones we need.
    
    Fixes: adc28027ff ("fuzz: add configure flag --enable-fuzzing")
    Reported-by: Li Qiang <liq3ea@163.com>
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200708200104.21978-2-alxndr@bu.edu>
    Tested-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f59418f6de..69a89113f7 100755
--- a/configure
+++ b/configure
@@ -7926,7 +7926,7 @@ if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
     FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
-    CFLAGS=" -fsanitize=address,fuzzer-no-link"
+    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
   else
     error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
     exit 1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:23:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:23:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16279.39818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsL-0008Hy-De; Fri, 30 Oct 2020 21:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16279.39818; Fri, 30 Oct 2020 21:23:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsL-0008Hq-AN; Fri, 30 Oct 2020 21:23:57 +0000
Received: by outflank-mailman (input) for mailman id 16279;
 Fri, 30 Oct 2020 21:23:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsK-0008Hl-O5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6ba7a26e-5384-4bea-bb88-e3ab06804860;
 Fri, 30 Oct 2020 21:23:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsJ-0003D8-UE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsJ-00074M-TK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsK-0008Hl-O5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:56 +0000
X-Inumbo-ID: 6ba7a26e-5384-4bea-bb88-e3ab06804860
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6ba7a26e-5384-4bea-bb88-e3ab06804860;
	Fri, 30 Oct 2020 21:23:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GHtLYJ8Y3mzJDG9uLqU1ZfVoX9VONtCo/6M9nYRfWBs=; b=Oz8o6aaVugiXGbyDjBYTn+ySQs
	VXmiZkBWOrq5X6qKhcR9PBaouQUvZSFUrbjwcxGtdCgjyYnPgYdVTMXfmaOOFSaa4+IAUBxgplwC/
	xLsh+oCEQS5yOGkRaAjRMgaR/RZNXS3K1b6kU5qCzaKkNx/afMc7We/cKV3t8G1JLlkY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsJ-0003D8-UE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsJ-00074M-TK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:23:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fuzz: add missing header for rcu_enable_atfork
Message-Id: <E1kYbsJ-00074M-TK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:23:55 +0000

commit 230225eaaa47f23acffef2f21f9bfb1e99b27b31
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Wed Jul 8 16:01:04 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    fuzz: add missing header for rcu_enable_atfork
    
    In 45222b9a90, I fixed a broken check for rcu_enable_atfork introduced
    in d6919e4cb6. I added a call to rcu_enable_atfork after the
    call to qemu_init in fuzz.c, but forgot to include the corresponding
    header, breaking --enable-fuzzing --enable-werror builds.
    
    Fixes: 45222b9a90 ("fuzz: fix broken qtest check at rcu_disable_atfork")
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200708200104.21978-3-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index a36d9038e0..0b66e43409 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -19,6 +19,7 @@
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
+#include "qemu/rcu.h"
 #include "tests/qtest/libqtest.h"
 #include "tests/qtest/libqos/qgraph.h"
 #include "fuzz.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16280.39822 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsV-0008JO-Ev; Fri, 30 Oct 2020 21:24:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16280.39822; Fri, 30 Oct 2020 21:24:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsV-0008JG-Bq; Fri, 30 Oct 2020 21:24:07 +0000
Received: by outflank-mailman (input) for mailman id 16280;
 Fri, 30 Oct 2020 21:24:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsU-0008J9-Q1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eaae1333-b1fc-4c59-a8b2-bade8a2ab2fe;
 Fri, 30 Oct 2020 21:24:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsU-0003DT-1Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsU-00075D-0i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsU-0008J9-Q1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
X-Inumbo-ID: eaae1333-b1fc-4c59-a8b2-bade8a2ab2fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eaae1333-b1fc-4c59-a8b2-bade8a2ab2fe;
	Fri, 30 Oct 2020 21:24:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/JMJ6Op58Vr4P+KIM4escn4w1BMlmEMl/6TLDSsWUL8=; b=avI2GMQOGSMySINyEPCPikWgjW
	yDW5U8LCidrNgC2dLAdwe1H/JaFo8G21y6420yVUMphxoNijcoLsf55wr6JUgiXibnha0ghVrBoiF
	Lhnoj1tfAGNcOOYnDNwEHdsVyJrvnewYnnYCe8YuNPucJlbEfG9aPz0RfY2QeamIvCCY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsU-0003DT-1Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsU-00075D-0i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/qtest/fuzz: Add missing spaces in description
Message-Id: <E1kYbsU-00075D-0i@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:06 +0000

commit 2c65fefa054fb8aa60b138efc48aa24e7d8e00bc
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 10:37:19 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    tests/qtest/fuzz: Add missing spaces in description
    
    There should be a space between "forking" and "for".
    
    Message-Id: <20200709083719.22221-1-thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/virtio_scsi_fuzz.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c
index 51dce491ab..3a9ea13736 100644
--- a/tests/qtest/fuzz/virtio_scsi_fuzz.c
+++ b/tests/qtest/fuzz/virtio_scsi_fuzz.c
@@ -191,7 +191,7 @@ static void register_virtio_scsi_fuzz_targets(void)
 {
     fuzz_add_qos_target(&(FuzzTarget){
                 .name = "virtio-scsi-fuzz",
-                .description = "Fuzz the virtio-scsi virtual queues, forking"
+                .description = "Fuzz the virtio-scsi virtual queues, forking "
                                 "for each fuzz run",
                 .pre_vm_init = &counter_shm_init,
                 .pre_fuzz = &virtio_scsi_pre_fuzz,
@@ -202,7 +202,7 @@ static void register_virtio_scsi_fuzz_targets(void)
 
     fuzz_add_qos_target(&(FuzzTarget){
                 .name = "virtio-scsi-flags-fuzz",
-                .description = "Fuzz the virtio-scsi virtual queues, forking"
+                .description = "Fuzz the virtio-scsi virtual queues, forking "
                 "for each fuzz run (also fuzzes the virtio flags)",
                 .pre_vm_init = &counter_shm_init,
                 .pre_fuzz = &virtio_scsi_pre_fuzz,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16282.39826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsf-0008Ko-Gc; Fri, 30 Oct 2020 21:24:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16282.39826; Fri, 30 Oct 2020 21:24:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsf-0008Kg-DS; Fri, 30 Oct 2020 21:24:17 +0000
Received: by outflank-mailman (input) for mailman id 16282;
 Fri, 30 Oct 2020 21:24:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsf-0008Ka-3j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4def5cf4-65df-4ec7-b32e-37ff44489304;
 Fri, 30 Oct 2020 21:24:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbse-0003Dg-6J
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbse-00075x-4U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsf-0008Ka-3j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:17 +0000
X-Inumbo-ID: 4def5cf4-65df-4ec7-b32e-37ff44489304
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4def5cf4-65df-4ec7-b32e-37ff44489304;
	Fri, 30 Oct 2020 21:24:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8TmcY44ddON23jPa/4lOmX4O5lrQScZzcIc2Xvizhx8=; b=SBxiVq/A6iU1YPTd2a8jRf0/jc
	DBDJqfMkjFpLwDAicgpQBZU0yMqP0DtlzjKQpuxxRjwgkBq4BzOdBEwntSrKNixHGqFJSTiPyNWpk
	cRxs21EqLC1d57SZ6uzoE8voNTQfbmOinZPlyZySmsw3yInBZbCcKek7ZQRjsC7RW7fk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbse-0003Dg-6J
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbse-00075x-4U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/devel/fuzzing: Fix bugs in documentation
Message-Id: <E1kYbse-00075x-4U@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:16 +0000

commit 590246ead7e5628e9e365c88aeb1ff3eab24de0d
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 10:40:59 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    docs/devel/fuzzing: Fix bugs in documentation
    
    Fix typo - the option is called "--fuzz-target" and not "--fuzz_taget".
    Also use a different fuzzer in the example, since "virtio-net-fork-fuzz"
    does not seem to be a valid fuzzer target (anymore?).
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200709084059.22539-1-thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 324d2cd92b..db5641de74 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -33,11 +33,11 @@ Fuzz targets are built similarly to system/softmmu:
 
 This builds ./i386-softmmu/qemu-fuzz-i386
 
-The first option to this command is: --fuzz_taget=FUZZ_NAME
+The first option to this command is: --fuzz-target=FUZZ_NAME
 To list all of the available fuzzers run qemu-fuzz-i386 with no arguments.
 
-eg:
-    ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=virtio-net-fork-fuzz
+For example:
+    ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=virtio-scsi-fuzz
 
 Internally, libfuzzer parses all arguments that do not begin with "--".
 Information about these is available by passing -help=1
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16283.39830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsq-0008M5-I7; Fri, 30 Oct 2020 21:24:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16283.39830; Fri, 30 Oct 2020 21:24:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbsq-0008Lx-FE; Fri, 30 Oct 2020 21:24:28 +0000
Received: by outflank-mailman (input) for mailman id 16283;
 Fri, 30 Oct 2020 21:24:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsp-0008Lr-B8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1b4ca268-b3ec-4765-a403-412fdd67387e;
 Fri, 30 Oct 2020 21:24:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbso-0003Dp-AU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbso-00076c-9T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsp-0008Lr-B8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:27 +0000
X-Inumbo-ID: 1b4ca268-b3ec-4765-a403-412fdd67387e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1b4ca268-b3ec-4765-a403-412fdd67387e;
	Fri, 30 Oct 2020 21:24:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n71IvX5PFZyv7JKs9LTq20ceNqJpwPquXMHSVWffi58=; b=Tam+dEPMTWMZZcIxixjfMU7cMU
	+QAtzQl0x4HplWJm6rdva1qA+yVZ/hjUM97OGRXeFa2unqan9O7wUsVSPnjmEt0lEYZFOz+8K0V/T
	wzL1tvofMAIwYzZe3QZpbDnyY3TJiPA/8D/ZLBYc2aNHQwLjO/iMxcx8Pr+YlNl9nrAo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbso-0003Dp-AU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbso-00076c-9T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
Message-Id: <E1kYbso-00076c-9T@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:26 +0000

commit 7aa12aa215e12ab2d41c60ba57e82d3e2af9f38e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 8 20:19:44 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
    
    GCC supports "#pragma GCC diagnostic" since version 4.6, and
    Clang seems to support it, too, since its early versions 3.x.
    That means that our minimum required compiler versions all support
    this pragma already and we can remove the test from configure and
    all the related #ifdefs in the code.
    
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200710045515.25986-1-thuth@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure                 | 29 -----------------------------
 include/ui/gtk.h          |  4 ----
 include/ui/qemu-pixman.h  |  4 ----
 scripts/decodetree.py     | 12 ++++--------
 ui/gtk.c                  |  4 ----
 util/coroutine-ucontext.c |  4 ++--
 6 files changed, 6 insertions(+), 51 deletions(-)

diff --git a/configure b/configure
index 69a89113f7..9b6ab9d3ca 100755
--- a/configure
+++ b/configure
@@ -5728,31 +5728,6 @@ if compile_prog "" "" ; then
     linux_magic_h=yes
 fi
 
-########################################
-# check whether we can disable warning option with a pragma (this is needed
-# to silence warnings in the headers of some versions of external libraries).
-# This test has to be compiled with -Werror as otherwise an unknown pragma is
-# only a warning.
-#
-# If we can't selectively disable warning in the code, disable -Werror so that
-# the build doesn't fail anyway.
-
-pragma_disable_unused_but_set=no
-cat > $TMPC << EOF
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#pragma GCC diagnostic pop
-
-int main(void) {
-    return 0;
-}
-EOF
-if compile_prog "-Werror" "" ; then
-    pragma_diagnostic_available=yes
-else
-    werror=no
-fi
-
 ########################################
 # check if we have valgrind/valgrind.h
 
@@ -7689,10 +7664,6 @@ if test "$linux_magic_h" = "yes" ; then
   echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
 fi
 
-if test "$pragma_diagnostic_available" = "yes" ; then
-  echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak
-fi
-
 if test "$valgrind_h" = "yes" ; then
   echo "CONFIG_VALGRIND_H=y" >> $config_host_mak
 fi
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index d1b230848a..eaeb450f91 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -1,15 +1,11 @@
 #ifndef UI_GTK_H
 #define UI_GTK_H
 
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 /* Work around an -Wstrict-prototypes warning in GTK headers */
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#endif
 #include <gtk/gtk.h>
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
 
 #include <gdk/gdkkeysyms.h>
 
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index 3b7cf70157..87737a6f16 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -7,14 +7,10 @@
 #define QEMU_PIXMAN_H
 
 /* pixman-0.16.0 headers have a redundant declaration */
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wredundant-decls"
-#endif
 #include <pixman.h>
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
 
 /*
  * pixman image formats are defined to be native endian,
diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 530d41ca62..694757b6c2 100755
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -1327,12 +1327,10 @@ def main():
     # but we can't tell which ones.  Prevent issues from the compiler by
     # suppressing redundant declaration warnings.
     if anyextern:
-        output("#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE\n",
-               "# pragma GCC diagnostic push\n",
-               "# pragma GCC diagnostic ignored \"-Wredundant-decls\"\n",
-               "# ifdef __clang__\n"
+        output("#pragma GCC diagnostic push\n",
+               "#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n",
+               "#ifdef __clang__\n"
                "#  pragma GCC diagnostic ignored \"-Wtypedef-redefinition\"\n",
-               "# endif\n",
                "#endif\n\n")
 
     out_pats = {}
@@ -1347,9 +1345,7 @@ def main():
     output('\n')
 
     if anyextern:
-        output("#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE\n",
-               "# pragma GCC diagnostic pop\n",
-               "#endif\n\n")
+        output("#pragma GCC diagnostic pop\n\n")
 
     for n in sorted(formats.keys()):
         f = formats[n]
diff --git a/ui/gtk.c b/ui/gtk.c
index d4b49bd7da..b0cc08ad6d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1996,14 +1996,10 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
              * proper replacement (native opengl support) is only
              * available in 3.16+.  Silence the warning if possible.
              */
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
             gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE);
-#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
 #pragma GCC diagnostic pop
-#endif
             vc->gfx.dcl.ops = &dcl_egl_ops;
         }
     } else
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index fff20aad80..904b375192 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -251,8 +251,8 @@ Coroutine *qemu_coroutine_new(void)
 }
 
 #ifdef CONFIG_VALGRIND_H
-#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && !defined(__clang__)
 /* Work around an unused variable in the valgrind.h macro... */
+#if !defined(__clang__)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #endif
@@ -260,7 +260,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co)
 {
     VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id);
 }
-#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && !defined(__clang__)
+#if !defined(__clang__)
 #pragma GCC diagnostic pop
 #endif
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16284.39833 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbt0-0008NO-Jn; Fri, 30 Oct 2020 21:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16284.39833; Fri, 30 Oct 2020 21:24:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbt0-0008N8-Gi; Fri, 30 Oct 2020 21:24:38 +0000
Received: by outflank-mailman (input) for mailman id 16284;
 Fri, 30 Oct 2020 21:24:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbsz-0008My-6n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b41ba200-2dc6-434b-b782-83f7dcec5779;
 Fri, 30 Oct 2020 21:24:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsy-0003Dy-EV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbsy-00077H-De
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbsz-0008My-6n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:37 +0000
X-Inumbo-ID: b41ba200-2dc6-434b-b782-83f7dcec5779
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b41ba200-2dc6-434b-b782-83f7dcec5779;
	Fri, 30 Oct 2020 21:24:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qIPV5KWXkqY8vKBFCrSXEMoz54MISemTm89gZvkG3AQ=; b=C6sYSizskWucxdyLSihe3JjsSr
	uDyViyJGSbNrjQ6EtX3rnGVcQw/rdDFOTvS4yiQN1fZaXaPoO8kmt9qs58ODFcIUhWHGtm3olmhrm
	mbQS4oO6S34cpxVWNpMmv7h4PUiSWIUvrbyUa6DLopOysHvLBLHamesK4sIT5rBSANwA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsy-0003Dy-EV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbsy-00077H-De
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] disas/sh4: Add missing fallthrough annotations
Message-Id: <E1kYbsy-00077H-De@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:36 +0000

commit ccb237090fdafedce56cb8b62f451a09ad5031c9
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jun 30 07:03:44 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    disas/sh4: Add missing fallthrough annotations
    
    Add fallthrough annotations to be able to compile the code without
    warnings with -Wimplicit-fallthrough. Looking at the code, it seems
    like the fallthrough is indeed intended here, so the comments should
    be appropriate.
    
    Message-Id: <20200630055953.9309-1-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 disas/sh4.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/disas/sh4.c b/disas/sh4.c
index 55ef865a36..dcdbdf26d8 100644
--- a/disas/sh4.c
+++ b/disas/sh4.c
@@ -1963,6 +1963,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rn & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_N:
 	      fprintf_fn (stream, "dr%d", rn);
 	      break;
@@ -1972,6 +1973,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rm & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_M:
 	      fprintf_fn (stream, "dr%d", rm);
 	      break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16285.39838 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtA-0008PG-LQ; Fri, 30 Oct 2020 21:24:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16285.39838; Fri, 30 Oct 2020 21:24:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtA-0008P8-IO; Fri, 30 Oct 2020 21:24:48 +0000
Received: by outflank-mailman (input) for mailman id 16285;
 Fri, 30 Oct 2020 21:24:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbt9-0008Oy-Lc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3087d1b6-35d5-4d4f-9d15-724a175c563f;
 Fri, 30 Oct 2020 21:24:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbt8-0003EX-Jc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbt8-000781-HH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbt9-0008Oy-Lc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:47 +0000
X-Inumbo-ID: 3087d1b6-35d5-4d4f-9d15-724a175c563f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3087d1b6-35d5-4d4f-9d15-724a175c563f;
	Fri, 30 Oct 2020 21:24:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AvmwnI9SjDHcEKLH+lK5EOreke2K7/en/lV5hE6foAY=; b=D6a5CNny3L5cZj4uIXDUDbyXKf
	28zm3qbky7MrgCzqeH9XUfG0OS5ZupkLLKYnpAp6M7qDSjsI72w3AU6BTwhLQDxGuAQ2EBIY5EVAh
	JwKouejMrC9WRD7UXl7nSUy+rKV+IM22S9FLgmZD0NsuMULKB18/kRbS6gLcok7wvpK8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbt8-0003EX-Jc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbt8-000781-HH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] GitLab Gating CI: introduce pipeline-status contrib script
Message-Id: <E1kYbt8-000781-HH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:46 +0000

commit c02b2eac55ef72dd17b2ea8408c312d83f9e0482
Author:     Cleber Rosa <crosa@redhat.com>
AuthorDate: Wed Jul 8 22:46:56 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    GitLab Gating CI: introduce pipeline-status contrib script
    
    This script is intended to be used right after a push to a branch.
    
    By default, it will look for the pipeline associated with the commit
    that is the HEAD of the *local* staging branch.  It can be used as a
    one time check, or with the `--wait` option to wait until the pipeline
    completes.
    
    If the pipeline is successful, then a merge of the staging branch into
    the master branch should be the next step.
    
    Signed-off-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200709024657.2500558-2-crosa@redhat.com>
    [thuth: Added the changes suggested by Erik Skultety]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/ci/gitlab-pipeline-status | 157 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)

diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline-status
new file mode 100755
index 0000000000..348a49b6a4
--- /dev/null
+++ b/scripts/ci/gitlab-pipeline-status
@@ -0,0 +1,157 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2019-2020 Red Hat, Inc.
+#
+# Author:
+#  Cleber Rosa <crosa@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later.  See the COPYING file in the top-level directory.
+
+"""
+Checks the GitLab pipeline status for a given commit ID
+"""
+
+# pylint: disable=C0103
+
+import argparse
+import http.client
+import json
+import os
+import subprocess
+import time
+import sys
+
+
+def get_local_staging_branch_commit():
+    """
+    Returns the commit sha1 for the *local* branch named "staging"
+    """
+    result = subprocess.run(['git', 'rev-parse', 'staging'],
+                            stdin=subprocess.DEVNULL,
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.DEVNULL,
+                            cwd=os.path.dirname(__file__),
+                            universal_newlines=True).stdout.strip()
+    if result == 'staging':
+        raise ValueError("There's no local branch named 'staging'")
+    if len(result) != 40:
+        raise ValueError("Branch staging HEAD doesn't look like a sha1")
+    return result
+
+
+def get_pipeline_status(project_id, commit_sha1):
+    """
+    Returns the JSON content of the pipeline status API response
+    """
+    url = '/api/v4/projects/{}/pipelines?sha={}'.format(project_id,
+                                                        commit_sha1)
+    connection = http.client.HTTPSConnection('gitlab.com')
+    connection.request('GET', url=url)
+    response = connection.getresponse()
+    if response.code != http.HTTPStatus.OK:
+        raise ValueError("Failed to receive a successful response")
+    json_response = json.loads(response.read())
+
+    # As far as I can tell, there should be only one pipeline for the same
+    # project + commit. If this assumption is false, we can add further
+    # filters to the url, such as username, and order_by.
+    if not json_response:
+        raise ValueError("No pipeline found")
+    return json_response[0]
+
+
+def wait_on_pipeline_success(timeout, interval,
+                             project_id, commit_sha):
+    """
+    Waits for the pipeline to finish within the given timeout
+    """
+    start = time.time()
+    while True:
+        if time.time() >= (start + timeout):
+            print("Waiting on the pipeline timed out")
+            return False
+
+        status = get_pipeline_status(project_id, commit_sha)
+        if status['status'] == 'running':
+            time.sleep(interval)
+            print('running...')
+            continue
+
+        if status['status'] == 'success':
+            return True
+
+        msg = "Pipeline failed, check: %s" % status['web_url']
+        print(msg)
+        return False
+
+
+def main():
+    """
+    Script entry point
+    """
+    parser = argparse.ArgumentParser(
+        prog='pipeline-status',
+        description='check or wait on a pipeline status')
+
+    parser.add_argument('-t', '--timeout', type=int, default=7200,
+                        help=('Amount of time (in seconds) to wait for the '
+                              'pipeline to complete.  Defaults to '
+                              '%(default)s'))
+    parser.add_argument('-i', '--interval', type=int, default=60,
+                        help=('Amount of time (in seconds) to wait between '
+                              'checks of the pipeline status.  Defaults '
+                              'to %(default)s'))
+    parser.add_argument('-w', '--wait', action='store_true', default=False,
+                        help=('Wether to wait, instead of checking only once '
+                              'the status of a pipeline'))
+    parser.add_argument('-p', '--project-id', type=int, default=11167699,
+                        help=('The GitLab project ID. Defaults to the project '
+                              'for https://gitlab.com/qemu-project/qemu, that '
+                              'is, "%(default)s"'))
+    try:
+        default_commit = get_local_staging_branch_commit()
+        commit_required = False
+    except ValueError:
+        default_commit = ''
+        commit_required = True
+    parser.add_argument('-c', '--commit', required=commit_required,
+                        default=default_commit,
+                        help=('Look for a pipeline associated with the given '
+                              'commit.  If one is not explicitly given, the '
+                              'commit associated with the local branch named '
+                              '"staging" is used.  Default: %(default)s'))
+    parser.add_argument('--verbose', action='store_true', default=False,
+                        help=('A minimal verbosity level that prints the '
+                              'overall result of the check/wait'))
+
+    args = parser.parse_args()
+
+    try:
+        if args.wait:
+            success = wait_on_pipeline_success(
+                args.timeout,
+                args.interval,
+                args.project_id,
+                args.commit)
+        else:
+            status = get_pipeline_status(args.project_id,
+                                         args.commit)
+            success = status['status'] == 'success'
+    except Exception as error:      # pylint: disable=W0703
+        success = False
+        if args.verbose:
+            print("ERROR: %s" % error.args[0])
+
+    if success:
+        if args.verbose:
+            print('success')
+        sys.exit(0)
+    else:
+        if args.verbose:
+            print('failure')
+        sys.exit(1)
+
+
+if __name__ == '__main__':
+    main()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:24:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:24:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16286.39842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtK-0008Qb-OL; Fri, 30 Oct 2020 21:24:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16286.39842; Fri, 30 Oct 2020 21:24:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtK-0008QT-LI; Fri, 30 Oct 2020 21:24:58 +0000
Received: by outflank-mailman (input) for mailman id 16286;
 Fri, 30 Oct 2020 21:24:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbtJ-0008QN-S4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ed424a6c-e60d-4b07-bfcf-226bccd6d18e;
 Fri, 30 Oct 2020 21:24:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtI-0003Ef-N5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtI-00078l-MJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbtJ-0008QN-S4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:57 +0000
X-Inumbo-ID: ed424a6c-e60d-4b07-bfcf-226bccd6d18e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ed424a6c-e60d-4b07-bfcf-226bccd6d18e;
	Fri, 30 Oct 2020 21:24:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GwwbjEXqI6G6PuEfqNEkK2w2h6DEd32yYxmMGQsXkws=; b=130wInGPh6Fan2ZU51F/Mwiy41
	BL6ykSqXfyOQN3SHjPelEH/Xb+FLE8LURB5zjcRLn31CXC443xjtD8nRIJWfvn8d3q+EaYiGUIeL/
	fj7AfVoFG/BWrLfHTpcbZzKksrFnbUnzOkuB8al+Ep5YSF+0zNqV8EVX8kI1GnPN3e7E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtI-0003Ef-N5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtI-00078l-MJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:24:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system/s390x: Improve the 3270 documentation
Message-Id: <E1kYbtI-00078l-MJ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:24:56 +0000

commit 2a84f48c2b387877422ee85f6425d2c1b25bace0
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 9 18:00:39 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Mon Jul 13 11:40:52 2020 +0200

    docs/system/s390x: Improve the 3270 documentation
    
    There is some additional information about the 3270 support in our Wiki
    at https://wiki.qemu.org/Features/3270 - so let's include this information
    into the main documentation now to have one single source of information
    (the Wiki page could later be removed).
    
    While at it, I also shortened the lines of the first example a little bit.
    Otherwise they showed up with a horizontal scrollbar in my Firefox browser.
    
    Message-Id: <20200713075112.442-1-thuth@redhat.com>
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/system/s390x/3270.rst | 43 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 37 insertions(+), 6 deletions(-)

diff --git a/docs/system/s390x/3270.rst b/docs/system/s390x/3270.rst
index 1774cdcadf..0554a70a9f 100644
--- a/docs/system/s390x/3270.rst
+++ b/docs/system/s390x/3270.rst
@@ -1,9 +1,15 @@
 3270 devices
 ============
 
-QEMU supports connecting an external 3270 terminal emulator (such as
-``x3270``) to make a single 3270 device available to a guest. Note that this
-supports basic features only.
+The 3270 is the classic 'green-screen' console of the mainframes (see the
+`IBM 3270 Wikipedia article <https://en.wikipedia.org/wiki/IBM_3270>`__).
+
+The 3270 data stream is not implemented within QEMU; the device only provides
+TN3270 (a telnet extension; see `RFC 854 <https://tools.ietf.org/html/rfc854>`__
+and `RFC 1576 <https://tools.ietf.org/html/rfc1576>`__) and leaves the heavy
+lifting to an external 3270 terminal emulator (such as ``x3270``) to make a
+single 3270 device available to a guest. Note that this supports basic
+features only.
 
 To provide a 3270 device to a guest, create a ``x-terminal3270`` linked to
 a ``tn3270`` chardev. The guest will see a 3270 channel device. In order
@@ -12,10 +18,14 @@ to actually be able to use it, attach the ``x3270`` emulator to the chardev.
 Example configuration
 ---------------------
 
+* Make sure that 3270 support is enabled in the guest's Linux kernel. You need
+  ``CONFIG_TN3270`` and at least one of ``CONFIG_TN3270_TTY`` (for additional
+  ttys) or ``CONFIG_TN3270_CONSOLE`` (for a 3270 console).
+
 * Add a ``tn3270`` chardev and a ``x-terminal3270`` to the QEMU command line::
 
-    -chardev socket,id=char_0,host=0.0.0.0,port=2300,nowait,server,tn3270
-    -device x-terminal3270,chardev=char_0,devno=fe.0.000a,id=terminal_0
+   -chardev socket,id=ch0,host=0.0.0.0,port=2300,nowait,server,tn3270
+   -device x-terminal3270,chardev=ch0,devno=fe.0.000a,id=terminal0
 
 * Start the guest. In the guest, use ``chccwdev -e 0.0.000a`` to enable
   the device.
@@ -29,4 +39,25 @@ Example configuration
 
     systemctl start serial-getty@3270-tty1.service
 
-This should get you an addtional tty for logging into the guest.
+  This should get you an additional tty for logging into the guest.
+
+* If you want to use the 3270 device as the Linux kernel console instead of
+  an additional tty, you can also append ``conmode=3270 condev=000a`` to
+  the guest's kernel command line. The kernel then should use the 3270 as
+  console after the next boot.
+
+Restrictions
+------------
+
+3270 support is very basic. In particular:
+
+* Only one 3270 device is supported.
+
+* It has only been tested with Linux guests and the x3270 emulator.
+
+* TLS/SSL is not supported.
+
+* Resizing on reattach is not supported.
+
+* Multiple commands in one inbound buffer (for example, when the reset key
+  is pressed while the network is slow) are not supported.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:25:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:25:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16287.39846 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtU-0008Rs-Ps; Fri, 30 Oct 2020 21:25:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16287.39846; Fri, 30 Oct 2020 21:25:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtU-0008Rk-Mw; Fri, 30 Oct 2020 21:25:08 +0000
Received: by outflank-mailman (input) for mailman id 16287;
 Fri, 30 Oct 2020 21:25:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbtT-0008Rb-Mk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id da7e2bf9-6e69-4cf9-a13f-137c4bbebd79;
 Fri, 30 Oct 2020 21:25:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtS-0003F2-RD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtS-00079e-QN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbtT-0008Rb-Mk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:07 +0000
X-Inumbo-ID: da7e2bf9-6e69-4cf9-a13f-137c4bbebd79
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id da7e2bf9-6e69-4cf9-a13f-137c4bbebd79;
	Fri, 30 Oct 2020 21:25:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7SKmkRPcFvFrKfeLBoGJ+mq4cddUBrPs7vFBwECPafg=; b=Vit8/3RWDuipwvqsOQH4+MJyy+
	49EhNTumTEufInpNJKb6IIxVqgWfvE/vsubl7oJWpoVStrssS4g4XgQeAEw5c5vpYdcBfQyDHi+IJ
	rs5Xhr/k6i5diknfxc6zTmCtLBPH4sHf/qgNdoN/Hy5UBqTGV3l/0BXDMa0sSlHMs2aE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtS-0003F2-RD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtS-00079e-QN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging
Message-Id: <E1kYbtS-00079e-QN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:25:06 +0000

commit 00ce6c36b35e0eb8cc5d68a28f288a6335848813
Merge: 6c87d9f311dba0641bdc2df556056938a8bf2a12 2a84f48c2b387877422ee85f6425d2c1b25bace0
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 13:01:30 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 13:01:30 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-13' into staging
    
    * Some fuzzer related fixes
    * Fixes / improvements for the "configure" script
    * Doc updates
    * Gitlab pipeline-status script
    
    # gpg: Signature made Mon 13 Jul 2020 11:48:32 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-13:
      docs/system/s390x: Improve the 3270 documentation
      GitLab Gating CI: introduce pipeline-status contrib script
      disas/sh4: Add missing fallthrough annotations
      Remove the CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE switch
      docs/devel/fuzzing: Fix bugs in documentation
      tests/qtest/fuzz: Add missing spaces in description
      fuzz: add missing header for rcu_enable_atfork
      configure: do not clobber CFLAGS with --enable-fuzzing
      configure: fix malloc check
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 configure                           |  32 +-------
 disas/sh4.c                         |   2 +
 docs/devel/fuzzing.txt              |   6 +-
 docs/system/s390x/3270.rst          |  43 ++++++++--
 include/ui/gtk.h                    |   4 -
 include/ui/qemu-pixman.h            |   4 -
 scripts/ci/gitlab-pipeline-status   | 157 ++++++++++++++++++++++++++++++++++++
 scripts/decodetree.py               |  12 +--
 tests/qtest/fuzz/fuzz.c             |   1 +
 tests/qtest/fuzz/virtio_scsi_fuzz.c |   4 +-
 ui/gtk.c                            |   4 -
 util/coroutine-ucontext.c           |   4 +-
 12 files changed, 210 insertions(+), 63 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:25:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:25:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16288.39850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtg-0008TI-RU; Fri, 30 Oct 2020 21:25:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16288.39850; Fri, 30 Oct 2020 21:25:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYbtg-0008TB-Oc; Fri, 30 Oct 2020 21:25:20 +0000
Received: by outflank-mailman (input) for mailman id 16288;
 Fri, 30 Oct 2020 21:25:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYbtg-0008T4-35
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 940497fb-e7d2-4bd9-aa97-dc2f5176a6d2;
 Fri, 30 Oct 2020 21:25:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtd-0003FA-J6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYbtd-0007D4-IB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYbtg-0008T4-35
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:20 +0000
X-Inumbo-ID: 940497fb-e7d2-4bd9-aa97-dc2f5176a6d2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 940497fb-e7d2-4bd9-aa97-dc2f5176a6d2;
	Fri, 30 Oct 2020 21:25:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5w0cTLYiPntLNBNcg1u0Mc3pGSuYNAR5XHbE0Y7gP34=; b=3N49O8jDWxayDm5JNMBwM4VKRm
	Fr8z17fS1W59FsT8ofiKGjtz+b0uc22YQvxK5CQTQoOIEmVNu3JnZ9CxdWUceLoe6pm8nIeLp7X4E
	vnu2eeL2SsGZDnqERTExcMdRNgEyuXrkc6YIDjv5yI8R5WaqqxnN1bsH0Tu2oSoP4vXU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtd-0003FA-J6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYbtd-0007D4-IB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:25:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200713' into staging
Message-Id: <E1kYbtd-0007D4-IB@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:25:17 +0000

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

commit 5c65b1f135ff09d24827fa3a17e56a4f8a032cd5
Merge: 00ce6c36b35e0eb8cc5d68a28f288a6335848813 756f739b1682bf131994ec96dad7fbdf8b54493a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 15:14:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 15:14:48 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200713' into staging
    
    target-arm queue:
     * hw/arm/bcm2836: Remove unused 'cpu_type' field
     * target/arm: Fix mtedesc for do_mem_zpz
     * Add the ability to change the FEC PHY MDIO device number on i.MX25/i.MX6/i.MX7
     * target/arm: Don't do raw writes for PMINTENCLR
     * virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
     * build: Fix various issues with building on Haiku
     * target/nios2: fix wrctl behaviour when using icount
     * hw/arm/tosa: Encapsulate misc GPIO handling in a device
     * hw/arm/palm.c: Encapsulate misc GPIO handling in a device
     * hw/arm/aspeed: Do not create and attach empty SD cards by default
    
    # gpg: Signature made Mon 13 Jul 2020 15:08:16 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200713: (25 commits)
      hw/arm/aspeed: Do not create and attach empty SD cards by default
      hw/arm/palm.c: Encapsulate misc GPIO handling in a device
      hw/arm/palm.c: Detabify
      hw/arm/tosa: Encapsulate misc GPIO handling in a device
      hw/arm/tosa.c: Detabify
      hw/nios2: exit to main CPU loop only when unmasking interrupts
      target/nios2: Use gen_io_start around wrctl instruction
      target/nios2: in line the semantics of DISAS_UPDATE with other targets
      target/nios2: add DISAS_NORETURN case for nothing more to generate
      util/drm: make portable by avoiding struct dirent d_type
      util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku
      util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD
      bswap.h: Include <endian.h> on Haiku for bswap operations
      osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL
      osdep.h: Always include <sys/signal.h> if it exists
      build: Check that mlockall() exists
      util/qemu-openpty.c: Don't assume pty.h is glibc-only
      build: Enable BSD symbols for Haiku
      virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
      target/arm: Don't do raw writes for PMINTENCLR
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 configure                   |  38 +++++++++++-
 hw/arm/aspeed.c             |   9 +--
 hw/arm/fsl-imx25.c          |   7 +++
 hw/arm/fsl-imx6.c           |   7 +++
 hw/arm/fsl-imx7.c           |   9 +++
 hw/arm/palm.c               | 111 ++++++++++++++++++++++++-----------
 hw/arm/tosa.c               | 140 ++++++++++++++++++++++++++++----------------
 hw/nios2/cpu_pic.c          |   3 +-
 hw/virtio/virtio-iommu.c    |   1 +
 hw/xen/xen-legacy-backend.c |   1 -
 include/hw/arm/bcm2836.h    |   1 -
 include/hw/arm/fsl-imx25.h  |   1 +
 include/hw/arm/fsl-imx6.h   |   1 +
 include/hw/arm/fsl-imx7.h   |   1 +
 include/qemu/bswap.h        |   2 +
 include/qemu/osdep.h        |   6 +-
 os-posix.c                  |   4 ++
 target/arm/helper.c         |   4 +-
 target/arm/translate-sve.c  |   2 +-
 target/nios2/translate.c    |  12 +++-
 util/compatfd.c             |   2 +
 util/drm.c                  |  19 ++++--
 util/oslib-posix.c          |  20 ++++++-
 util/qemu-openpty.c         |   2 +-
 24 files changed, 296 insertions(+), 107 deletions(-)

diff --git a/configure b/configure
index 9b6ab9d3ca..bc3b9ad931 100755
--- a/configure
+++ b/configure
@@ -904,8 +904,8 @@ SunOS)
 ;;
 Haiku)
   haiku="yes"
-  QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
-  LIBS="-lposix_error_mapper -lnetwork $LIBS"
+  QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS"
+  LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS"
 ;;
 Linux)
   audio_drv_list="try-pa oss"
@@ -2402,6 +2402,24 @@ else
   l2tpv3=no
 fi
 
+if check_include "pty.h" ; then
+  pty_h=yes
+else
+  pty_h=no
+fi
+
+cat > $TMPC <<EOF
+#include <sys/mman.h>
+int main(int argc, char *argv[]) {
+    return mlockall(MCL_FUTURE);
+}
+EOF
+if compile_prog "" "" ; then
+  have_mlockall=yes
+else
+  have_mlockall=no
+fi
+
 #########################################
 # vhost interdependencies and host support
 
@@ -3226,6 +3244,13 @@ if check_include "libdrm/drm.h" ; then
     have_drm_h=yes
 fi
 
+#########################################
+# sys/signal.h check
+have_sys_signal_h=no
+if check_include "sys/signal.h" ; then
+  have_sys_signal_h=yes
+fi
+
 ##########################################
 # VTE probe
 
@@ -7415,6 +7440,9 @@ fi
 if test "$have_openpty" = "yes" ; then
     echo "HAVE_OPENPTY=y" >> $config_host_mak
 fi
+if test "$have_sys_signal_h" = "yes" ; then
+    echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
@@ -7893,6 +7921,12 @@ fi
 if test "$sheepdog" = "yes" ; then
   echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
 fi
+if test "$pty_h" = "yes" ; then
+  echo "HAVE_PTY_H=y" >> $config_host_mak
+fi
+if test "$have_mlockall" = "yes" ; then
+  echo "HAVE_MLOCKALL=y" >> $config_host_mak
+fi
 if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
     FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 660dcb5414..6a3a345a6f 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -246,11 +246,12 @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo)
 {
         DeviceState *card;
 
-        card = qdev_new(TYPE_SD_CARD);
-        if (dinfo) {
-            qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
-                                    &error_fatal);
+        if (!dinfo) {
+            return;
         }
+        card = qdev_new(TYPE_SD_CARD);
+        qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
+                                &error_fatal);
         qdev_realize_and_unref(card,
                                qdev_get_child_bus(DEVICE(sdhci), "sd-bus"),
                                &error_fatal);
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index b4ddceae45..08a98f828f 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -171,6 +171,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
                                             epit_table[i].irq));
     }
 
+    object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err);
     qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) {
@@ -315,10 +316,16 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
                                 &s->iram_alias);
 }
 
+static Property fsl_imx25_properties[] = {
+    DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx25_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx25_properties);
     dc->realize = fsl_imx25_realize;
     dc->desc = "i.MX25 SOC";
     /*
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 0bc9f0b60d..00dafe3f62 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -377,6 +377,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                             spi_table[i].irq));
     }
 
+    object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err);
     qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) {
         return;
@@ -449,10 +450,16 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
                                 &s->ocram_alias);
 }
 
+static Property fsl_imx6_properties[] = {
+    DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx6_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx6_properties);
     dc->realize = fsl_imx6_realize;
     dc->desc = "i.MX6 SOC";
     /* Reason: Uses serial_hd() in the realize() function */
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index fad637d328..2ff2cab924 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -363,6 +363,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
             FSL_IMX7_ENET2_ADDR,
         };
 
+        object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
+                                 s->phy_num[i], &error_abort);
         object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
                                  FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
         qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
@@ -550,10 +552,17 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
                                 FSL_IMX7_PCIE_PHY_SIZE);
 }
 
+static Property fsl_imx7_properties[] = {
+    DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0),
+    DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void fsl_imx7_class_init(ObjectClass *oc, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(oc);
 
+    device_class_set_props(dc, fsl_imx7_properties);
     dc->realize = fsl_imx7_realize;
 
     /* Reason: Uses serial_hds and nd_table in realize() directly */
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index 97ca105d29..e7bc9ea4c6 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -61,21 +61,21 @@ static const MemoryRegionOps static_ops = {
 /* Palm Tunsgten|E support */
 
 /* Shared GPIOs */
-#define PALMTE_USBDETECT_GPIO	0
-#define PALMTE_USB_OR_DC_GPIO	1
-#define PALMTE_TSC_GPIO		4
-#define PALMTE_PINTDAV_GPIO	6
-#define PALMTE_MMC_WP_GPIO	8
-#define PALMTE_MMC_POWER_GPIO	9
-#define PALMTE_HDQ_GPIO		11
-#define PALMTE_HEADPHONES_GPIO	14
-#define PALMTE_SPEAKER_GPIO	15
+#define PALMTE_USBDETECT_GPIO   0
+#define PALMTE_USB_OR_DC_GPIO   1
+#define PALMTE_TSC_GPIO                 4
+#define PALMTE_PINTDAV_GPIO     6
+#define PALMTE_MMC_WP_GPIO      8
+#define PALMTE_MMC_POWER_GPIO   9
+#define PALMTE_HDQ_GPIO                 11
+#define PALMTE_HEADPHONES_GPIO  14
+#define PALMTE_SPEAKER_GPIO     15
 /* MPU private GPIOs */
-#define PALMTE_DC_GPIO		2
-#define PALMTE_MMC_SWITCH_GPIO	4
-#define PALMTE_MMC1_GPIO	6
-#define PALMTE_MMC2_GPIO	7
-#define PALMTE_MMC3_GPIO	11
+#define PALMTE_DC_GPIO          2
+#define PALMTE_MMC_SWITCH_GPIO  4
+#define PALMTE_MMC1_GPIO        6
+#define PALMTE_MMC2_GPIO        7
+#define PALMTE_MMC3_GPIO        11
 
 static MouseTransformInfo palmte_pointercal = {
     .x = 320,
@@ -100,17 +100,17 @@ static struct {
     int column;
 } palmte_keymap[0x80] = {
     [0 ... 0x7f] = { -1, -1 },
-    [0x3b] = { 0, 0 },	/* F1	-> Calendar */
-    [0x3c] = { 1, 0 },	/* F2	-> Contacts */
-    [0x3d] = { 2, 0 },	/* F3	-> Tasks List */
-    [0x3e] = { 3, 0 },	/* F4	-> Note Pad */
-    [0x01] = { 4, 0 },	/* Esc	-> Power */
-    [0x4b] = { 0, 1 },	/* 	   Left */
-    [0x50] = { 1, 1 },	/* 	   Down */
-    [0x48] = { 2, 1 },	/*	   Up */
-    [0x4d] = { 3, 1 },	/*	   Right */
-    [0x4c] = { 4, 1 },	/* 	   Centre */
-    [0x39] = { 4, 1 },	/* Spc	-> Centre */
+    [0x3b] = { 0, 0 },  /* F1   -> Calendar */
+    [0x3c] = { 1, 0 },  /* F2   -> Contacts */
+    [0x3d] = { 2, 0 },  /* F3   -> Tasks List */
+    [0x3e] = { 3, 0 },  /* F4   -> Note Pad */
+    [0x01] = { 4, 0 },  /* Esc  -> Power */
+    [0x4b] = { 0, 1 },  /*         Left */
+    [0x50] = { 1, 1 },  /*         Down */
+    [0x48] = { 2, 1 },  /*         Up */
+    [0x4d] = { 3, 1 },  /*         Right */
+    [0x4c] = { 4, 1 },  /*         Centre */
+    [0x39] = { 4, 1 },  /* Spc  -> Centre */
 };
 
 static void palmte_button_event(void *opaque, int keycode)
@@ -124,6 +124,21 @@ static void palmte_button_event(void *opaque, int keycode)
                         !(keycode & 0x80));
 }
 
+/*
+ * Encapsulation of some GPIO line behaviour for the Palm board
+ *
+ * QEMU interface:
+ *  + unnamed GPIO inputs 0..6: for the various miscellaneous input lines
+ */
+
+#define TYPE_PALM_MISC_GPIO "palm-misc-gpio"
+#define PALM_MISC_GPIO(obj) \
+    OBJECT_CHECK(PalmMiscGPIOState, (obj), TYPE_PALM_MISC_GPIO)
+
+typedef struct PalmMiscGPIOState {
+    SysBusDevice parent_obj;
+} PalmMiscGPIOState;
+
 static void palmte_onoff_gpios(void *opaque, int line, int level)
 {
     switch (line) {
@@ -151,23 +166,44 @@ static void palmte_onoff_gpios(void *opaque, int line, int level)
     }
 }
 
+static void palm_misc_gpio_init(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    qdev_init_gpio_in(dev, palmte_onoff_gpios, 7);
+}
+
+static const TypeInfo palm_misc_gpio_info = {
+    .name = TYPE_PALM_MISC_GPIO,
+    .parent = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(PalmMiscGPIOState),
+    .instance_init = palm_misc_gpio_init,
+    /*
+     * No class init required: device has no internal state so does not
+     * need to set up reset or vmstate, and has no realize method.
+     */
+};
+
 static void palmte_gpio_setup(struct omap_mpu_state_s *cpu)
 {
-    qemu_irq *misc_gpio;
+    DeviceState *misc_gpio;
+
+    misc_gpio = sysbus_create_simple(TYPE_PALM_MISC_GPIO, -1, NULL);
 
     omap_mmc_handlers(cpu->mmc,
                     qdev_get_gpio_in(cpu->gpio, PALMTE_MMC_WP_GPIO),
                     qemu_irq_invert(omap_mpuio_in_get(cpu->mpuio)
                             [PALMTE_MMC_SWITCH_GPIO]));
 
-    misc_gpio = qemu_allocate_irqs(palmte_onoff_gpios, cpu, 7);
-    qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,	misc_gpio[0]);
-    qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,	misc_gpio[1]);
-    qdev_connect_gpio_out(cpu->gpio, 11,			misc_gpio[2]);
-    qdev_connect_gpio_out(cpu->gpio, 12,			misc_gpio[3]);
-    qdev_connect_gpio_out(cpu->gpio, 13,			misc_gpio[4]);
-    omap_mpuio_out_set(cpu->mpuio, 1,				misc_gpio[5]);
-    omap_mpuio_out_set(cpu->mpuio, 3,				misc_gpio[6]);
+    qdev_connect_gpio_out(cpu->gpio, PALMTE_MMC_POWER_GPIO,
+                          qdev_get_gpio_in(misc_gpio, 0));
+    qdev_connect_gpio_out(cpu->gpio, PALMTE_SPEAKER_GPIO,
+                          qdev_get_gpio_in(misc_gpio, 1));
+    qdev_connect_gpio_out(cpu->gpio, 11, qdev_get_gpio_in(misc_gpio, 2));
+    qdev_connect_gpio_out(cpu->gpio, 12, qdev_get_gpio_in(misc_gpio, 3));
+    qdev_connect_gpio_out(cpu->gpio, 13, qdev_get_gpio_in(misc_gpio, 4));
+    omap_mpuio_out_set(cpu->mpuio, 1, qdev_get_gpio_in(misc_gpio, 5));
+    omap_mpuio_out_set(cpu->mpuio, 3, qdev_get_gpio_in(misc_gpio, 6));
 
     /* Reset some inputs to initial state.  */
     qemu_irq_lower(qdev_get_gpio_in(cpu->gpio, PALMTE_USBDETECT_GPIO));
@@ -276,3 +312,10 @@ static void palmte_machine_init(MachineClass *mc)
 }
 
 DEFINE_MACHINE("cheetah", palmte_machine_init)
+
+static void palm_register_types(void)
+{
+    type_register_static(&palm_misc_gpio_info);
+}
+
+type_init(palm_register_types)
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 5dee2d76c6..383b3b22e2 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -26,32 +26,32 @@
 #include "hw/sysbus.h"
 #include "exec/address-spaces.h"
 
-#define TOSA_RAM    0x04000000
-#define TOSA_ROM	0x00800000
-
-#define TOSA_GPIO_USB_IN		(5)
-#define TOSA_GPIO_nSD_DETECT	(9)
-#define TOSA_GPIO_ON_RESET		(19)
-#define TOSA_GPIO_CF_IRQ		(21)	/* CF slot0 Ready */
-#define TOSA_GPIO_CF_CD			(13)
-#define TOSA_GPIO_TC6393XB_INT  (15)
-#define TOSA_GPIO_JC_CF_IRQ		(36)	/* CF slot1 Ready */
-
-#define TOSA_SCOOP_GPIO_BASE	1
-#define TOSA_GPIO_IR_POWERDWN	(TOSA_SCOOP_GPIO_BASE + 2)
-#define TOSA_GPIO_SD_WP			(TOSA_SCOOP_GPIO_BASE + 3)
-#define TOSA_GPIO_PWR_ON		(TOSA_SCOOP_GPIO_BASE + 4)
-
-#define TOSA_SCOOP_JC_GPIO_BASE		1
-#define TOSA_GPIO_BT_LED		(TOSA_SCOOP_JC_GPIO_BASE + 0)
-#define TOSA_GPIO_NOTE_LED		(TOSA_SCOOP_JC_GPIO_BASE + 1)
-#define TOSA_GPIO_CHRG_ERR_LED		(TOSA_SCOOP_JC_GPIO_BASE + 2)
-#define TOSA_GPIO_TC6393XB_L3V_ON	(TOSA_SCOOP_JC_GPIO_BASE + 5)
-#define TOSA_GPIO_WLAN_LED		(TOSA_SCOOP_JC_GPIO_BASE + 7)
-
-#define	DAC_BASE	0x4e
-#define DAC_CH1		0
-#define DAC_CH2		1
+#define TOSA_RAM 0x04000000
+#define TOSA_ROM 0x00800000
+
+#define TOSA_GPIO_USB_IN                (5)
+#define TOSA_GPIO_nSD_DETECT            (9)
+#define TOSA_GPIO_ON_RESET              (19)
+#define TOSA_GPIO_CF_IRQ                (21)    /* CF slot0 Ready */
+#define TOSA_GPIO_CF_CD                 (13)
+#define TOSA_GPIO_TC6393XB_INT          (15)
+#define TOSA_GPIO_JC_CF_IRQ             (36)    /* CF slot1 Ready */
+
+#define TOSA_SCOOP_GPIO_BASE            1
+#define TOSA_GPIO_IR_POWERDWN           (TOSA_SCOOP_GPIO_BASE + 2)
+#define TOSA_GPIO_SD_WP                 (TOSA_SCOOP_GPIO_BASE + 3)
+#define TOSA_GPIO_PWR_ON                (TOSA_SCOOP_GPIO_BASE + 4)
+
+#define TOSA_SCOOP_JC_GPIO_BASE         1
+#define TOSA_GPIO_BT_LED                (TOSA_SCOOP_JC_GPIO_BASE + 0)
+#define TOSA_GPIO_NOTE_LED              (TOSA_SCOOP_JC_GPIO_BASE + 1)
+#define TOSA_GPIO_CHRG_ERR_LED          (TOSA_SCOOP_JC_GPIO_BASE + 2)
+#define TOSA_GPIO_TC6393XB_L3V_ON       (TOSA_SCOOP_JC_GPIO_BASE + 5)
+#define TOSA_GPIO_WLAN_LED              (TOSA_SCOOP_JC_GPIO_BASE + 7)
+
+#define DAC_BASE 0x4e
+#define DAC_CH1 0
+#define DAC_CH2 1
 
 static void tosa_microdrive_attach(PXA2xxState *cpu)
 {
@@ -65,24 +65,39 @@ static void tosa_microdrive_attach(PXA2xxState *cpu)
     pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
 }
 
-static void tosa_out_switch(void *opaque, int line, int level)
+/*
+ * Encapsulation of some GPIO line behaviour for the Tosa board
+ *
+ * QEMU interface:
+ *  + named GPIO inputs "leds[0..3]": assert to light LEDs
+ *  + named GPIO input "reset": when asserted, resets the system
+ */
+
+#define TYPE_TOSA_MISC_GPIO "tosa-misc-gpio"
+#define TOSA_MISC_GPIO(obj) \
+    OBJECT_CHECK(TosaMiscGPIOState, (obj), TYPE_TOSA_MISC_GPIO)
+
+typedef struct TosaMiscGPIOState {
+    SysBusDevice parent_obj;
+} TosaMiscGPIOState;
+
+static void tosa_gpio_leds(void *opaque, int line, int level)
 {
     switch (line) {
-        case 0:
-            fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
-            break;
-        case 1:
-            fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
-            break;
-        case 2:
-            fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
-            break;
-        case 3:
-            fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
-            break;
-        default:
-            fprintf(stderr, "Uhandled out event: %d = %d\n", line, level);
-            break;
+    case 0:
+        fprintf(stderr, "blue LED %s.\n", level ? "on" : "off");
+        break;
+    case 1:
+        fprintf(stderr, "green LED %s.\n", level ? "on" : "off");
+        break;
+    case 2:
+        fprintf(stderr, "amber LED %s.\n", level ? "on" : "off");
+        break;
+    case 3:
+        fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off");
+        break;
+    default:
+        g_assert_not_reached();
     }
 }
 
@@ -93,13 +108,22 @@ static void tosa_reset(void *opaque, int line, int level)
     }
 }
 
+static void tosa_misc_gpio_init(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    qdev_init_gpio_in_named(dev, tosa_gpio_leds, "leds", 4);
+    qdev_init_gpio_in_named(dev, tosa_reset, "reset", 1);
+}
+
 static void tosa_gpio_setup(PXA2xxState *cpu,
                 DeviceState *scp0,
                 DeviceState *scp1,
                 TC6393xbState *tmio)
 {
-    qemu_irq *outsignals = qemu_allocate_irqs(tosa_out_switch, cpu, 4);
-    qemu_irq reset;
+    DeviceState *misc_gpio;
+
+    misc_gpio = sysbus_create_simple(TYPE_TOSA_MISC_GPIO, -1, NULL);
 
     /* MMC/SD host */
     pxa2xx_mmci_handlers(cpu->mmc,
@@ -107,8 +131,8 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
                     qemu_irq_invert(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_nSD_DETECT)));
 
     /* Handle reset */
-    reset = qemu_allocate_irq(tosa_reset, cpu, 0);
-    qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET, reset);
+    qdev_connect_gpio_out(cpu->gpio, TOSA_GPIO_ON_RESET,
+                          qdev_get_gpio_in_named(misc_gpio, "reset", 0));
 
     /* PCMCIA signals: card's IRQ and Card-Detect */
     pxa2xx_pcmcia_set_irq_cb(cpu->pcmcia[0],
@@ -119,10 +143,14 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
                         qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_JC_CF_IRQ),
                         NULL);
 
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED, outsignals[0]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED, outsignals[1]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED, outsignals[2]);
-    qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]);
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_BT_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 0));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_NOTE_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 1));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_CHRG_ERR_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 2));
+    qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED,
+                          qdev_get_gpio_in_named(misc_gpio, "leds", 3));
 
     qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));
 
@@ -287,10 +315,22 @@ static const TypeInfo tosa_ssp_info = {
     .class_init    = tosa_ssp_class_init,
 };
 
+static const TypeInfo tosa_misc_gpio_info = {
+    .name          = "tosa-misc-gpio",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(TosaMiscGPIOState),
+    .instance_init = tosa_misc_gpio_init,
+    /*
+     * No class init required: device has no internal state so does not
+     * need to set up reset or vmstate, and has no realize method.
+     */
+};
+
 static void tosa_register_types(void)
 {
     type_register_static(&tosa_dac_info);
     type_register_static(&tosa_ssp_info);
+    type_register_static(&tosa_misc_gpio_info);
 }
 
 type_init(tosa_register_types)
diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
index 1c1989d56a..5ea7e52ab8 100644
--- a/hw/nios2/cpu_pic.c
+++ b/hw/nios2/cpu_pic.c
@@ -54,7 +54,8 @@ static void nios2_pic_cpu_handler(void *opaque, int irq, int level)
 
 void nios2_check_interrupts(CPUNios2State *env)
 {
-    if (env->irq_pending) {
+    if (env->irq_pending &&
+        (env->regs[CR_STATUS] & CR_STATUS_PIE)) {
         env->irq_pending = 0;
         cpu_interrupt(env_cpu(env), CPU_INTERRUPT_HARD);
     }
diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index b39e836181..5d56865e56 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -534,6 +534,7 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq)
             ptail = (struct virtio_iommu_req_tail *)
                         (buf + s->config.probe_size);
             ptail->status = virtio_iommu_handle_probe(s, iov, iov_cnt, buf);
+            break;
         }
         default:
             tail.status = VIRTIO_IOMMU_S_UNSUPP;
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 083d8dc1b2..b61a4855b7 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <sys/signal.h>
 
 #include "hw/sysbus.h"
 #include "hw/boards.h"
diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
index 024af8aae4..79dfff9d73 100644
--- a/include/hw/arm/bcm2836.h
+++ b/include/hw/arm/bcm2836.h
@@ -33,7 +33,6 @@ typedef struct BCM283XState {
     DeviceState parent_obj;
     /*< public >*/
 
-    char *cpu_type;
     uint32_t enabled_cpus;
 
     struct {
diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h
index 9e228dacea..54ee1bfd78 100644
--- a/include/hw/arm/fsl-imx25.h
+++ b/include/hw/arm/fsl-imx25.h
@@ -65,6 +65,7 @@ typedef struct FslIMX25State {
     MemoryRegion   rom[2];
     MemoryRegion   iram;
     MemoryRegion   iram_alias;
+    uint32_t       phy_num;
 } FslIMX25State;
 
 /**
diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
index 1ebd751324..162fe99375 100644
--- a/include/hw/arm/fsl-imx6.h
+++ b/include/hw/arm/fsl-imx6.h
@@ -73,6 +73,7 @@ typedef struct FslIMX6State {
     MemoryRegion   caam;
     MemoryRegion   ocram;
     MemoryRegion   ocram_alias;
+    uint32_t       phy_num;
 } FslIMX6State;
 
 
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
index da977f9ffb..ad88923707 100644
--- a/include/hw/arm/fsl-imx7.h
+++ b/include/hw/arm/fsl-imx7.h
@@ -81,6 +81,7 @@ typedef struct FslIMX7State {
     IMX7GPRState       gpr;
     ChipideaState      usb[FSL_IMX7_NUM_USBS];
     DesignwarePCIEHost pcie;
+    uint32_t           phy_num[FSL_IMX7_NUM_ETHS];
 } FslIMX7State;
 
 enum FslIMX7MemoryMap {
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 2a9f3fe783..1d3e4c24e4 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -8,6 +8,8 @@
 # include <machine/bswap.h>
 #elif defined(__FreeBSD__)
 # include <sys/endian.h>
+#elif defined(__HAIKU__)
+# include <endian.h>
 #elif defined(CONFIG_BYTESWAP_H)
 # include <byteswap.h>
 
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 0fc206ae61..979a403984 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -104,7 +104,7 @@ extern int daemon(int, int);
 #include <setjmp.h>
 #include <signal.h>
 
-#ifdef __OpenBSD__
+#ifdef HAVE_SYS_SIGNAL_H
 #include <sys/signal.h>
 #endif
 
@@ -432,6 +432,10 @@ void qemu_anon_ram_free(void *ptr, size_t size);
 #define HAVE_CHARDEV_PARPORT 1
 #endif
 
+#if defined(__HAIKU__)
+#define SIGIO SIGPOLL
+#endif
+
 #if defined(CONFIG_LINUX)
 #ifndef BUS_MCEERR_AR
 #define BUS_MCEERR_AR 4
diff --git a/os-posix.c b/os-posix.c
index 3cd52e1e70..b674b20b1b 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -337,6 +337,7 @@ bool is_daemonized(void)
 
 int os_mlock(void)
 {
+#ifdef HAVE_MLOCKALL
     int ret = 0;
 
     ret = mlockall(MCL_CURRENT | MCL_FUTURE);
@@ -345,4 +346,7 @@ int os_mlock(void)
     }
 
     return ret;
+#else
+    return -ENOSYS;
+#endif
 }
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc9c29f998..c69a2baf1d 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2269,13 +2269,13 @@ static const ARMCPRegInfo v7_cp_reginfo[] = {
       .resetvalue = 0x0 },
     { .name = "PMINTENCLR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 2,
       .access = PL1_RW, .accessfn = access_tpm,
-      .type = ARM_CP_ALIAS | ARM_CP_IO,
+      .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
       .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
       .writefn = pmintenclr_write, },
     { .name = "PMINTENCLR_EL1", .state = ARM_CP_STATE_AA64,
       .opc0 = 3, .opc1 = 0, .crn = 9, .crm = 14, .opc2 = 2,
       .access = PL1_RW, .accessfn = access_tpm,
-      .type = ARM_CP_ALIAS | ARM_CP_IO,
+      .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_NO_RAW,
       .fieldoffset = offsetof(CPUARMState, cp15.c9_pminten),
       .writefn = pmintenclr_write },
     { .name = "CCSIDR", .state = ARM_CP_STATE_BOTH,
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 08f0fd15b2..88a2fb271d 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -5275,7 +5275,7 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
         desc = FIELD_DP32(desc, MTEDESC, ESIZE, 1 << msz);
         desc <<= SVE_MTEDESC_SHIFT;
     }
-    desc = simd_desc(vsz, vsz, scale);
+    desc = simd_desc(vsz, vsz, desc | scale);
     t_desc = tcg_const_i32(desc);
 
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 6c34cd3193..9824544eb3 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -32,6 +32,7 @@
 #include "exec/cpu_ldst.h"
 #include "exec/translator.h"
 #include "qemu/qemu-print.h"
+#include "exec/gen-icount.h"
 
 /* is_jmp field values */
 #define DISAS_JUMP    DISAS_TARGET_0 /* only pc was modified dynamically */
@@ -149,7 +150,7 @@ static void t_gen_helper_raise_exception(DisasContext *dc,
     tcg_gen_movi_tl(dc->cpu_R[R_PC], dc->pc);
     gen_helper_raise_exception(dc->cpu_env, tmp);
     tcg_temp_free_i32(tmp);
-    dc->is_jmp = DISAS_UPDATE;
+    dc->is_jmp = DISAS_NORETURN;
 }
 
 static bool use_goto_tb(DisasContext *dc, uint32_t dest)
@@ -518,7 +519,11 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags)
     /* If interrupts were enabled using WRCTL, trigger them. */
 #if !defined(CONFIG_USER_ONLY)
     if ((instr.imm5 + CR_BASE) == CR_STATUS) {
+        if (tb_cflags(dc->tb) & CF_USE_ICOUNT) {
+            gen_io_start();
+        }
         gen_helper_check_interrupts(dc->cpu_env);
+        dc->is_jmp = DISAS_UPDATE;
     }
 #endif
 }
@@ -802,7 +807,7 @@ static void gen_exception(DisasContext *dc, uint32_t excp)
     tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
     gen_helper_raise_exception(cpu_env, tmp);
     tcg_temp_free_i32(tmp);
-    dc->is_jmp = DISAS_UPDATE;
+    dc->is_jmp = DISAS_NORETURN;
 }
 
 /* generate intermediate code for basic block 'tb'.  */
@@ -865,6 +870,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
     /* Indicate where the next block should start */
     switch (dc->is_jmp) {
     case DISAS_NEXT:
+    case DISAS_UPDATE:
         /* Save the current PC back into the CPU register */
         tcg_gen_movi_tl(cpu_R[R_PC], dc->pc);
         tcg_gen_exit_tb(NULL, 0);
@@ -872,11 +878,11 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns)
 
     default:
     case DISAS_JUMP:
-    case DISAS_UPDATE:
         /* The jump will already have updated the PC register */
         tcg_gen_exit_tb(NULL, 0);
         break;
 
+    case DISAS_NORETURN:
     case DISAS_TB_JUMP:
         /* nothing more to generate */
         break;
diff --git a/util/compatfd.c b/util/compatfd.c
index c296f55d14..ee47dd8089 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -16,7 +16,9 @@
 #include "qemu/osdep.h"
 #include "qemu/thread.h"
 
+#if defined(CONFIG_SIGNALFD)
 #include <sys/syscall.h>
+#endif
 
 struct sigfd_compat_info
 {
diff --git a/util/drm.c b/util/drm.c
index a23ff24538..dae8ffebc8 100644
--- a/util/drm.c
+++ b/util/drm.c
@@ -24,7 +24,8 @@ int qemu_drm_rendernode_open(const char *rendernode)
 {
     DIR *dir;
     struct dirent *e;
-    int r, fd;
+    struct stat st;
+    int r, fd, ret;
     char *p;
 
     if (rendernode) {
@@ -38,10 +39,6 @@ int qemu_drm_rendernode_open(const char *rendernode)
 
     fd = -1;
     while ((e = readdir(dir))) {
-        if (e->d_type != DT_CHR) {
-            continue;
-        }
-
         if (strncmp(e->d_name, "renderD", 7)) {
             continue;
         }
@@ -53,6 +50,18 @@ int qemu_drm_rendernode_open(const char *rendernode)
             g_free(p);
             continue;
         }
+
+        /*
+         * prefer fstat() over checking e->d_type == DT_CHR for
+         * portability reasons
+         */
+        ret = fstat(r, &st);
+        if (ret < 0 || (st.st_mode & S_IFMT) != S_IFCHR) {
+            close(r);
+            g_free(p);
+            continue;
+        }
+
         fd = r;
         g_free(p);
         break;
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 39ddc77c85..72907d4d7f 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -38,7 +38,6 @@
 #include "qemu/sockets.h"
 #include "qemu/thread.h"
 #include <libgen.h>
-#include <sys/signal.h>
 #include "qemu/cutils.h"
 
 #ifdef CONFIG_LINUX
@@ -61,6 +60,10 @@
 #include <mach-o/dyld.h>
 #endif
 
+#ifdef __HAIKU__
+#include <kernel/image.h>
+#endif
+
 #include "qemu/mmap-alloc.h"
 
 #ifdef CONFIG_DEBUG_STACK_USAGE
@@ -390,6 +393,21 @@ void qemu_init_exec_dir(const char *argv0)
             }
         }
     }
+#elif defined(__HAIKU__)
+    {
+        image_info ii;
+        int32_t c = 0;
+
+        *buf = '\0';
+        while (get_next_image_info(0, &c, &ii) == B_OK) {
+            if (ii.type == B_APP_IMAGE) {
+                strncpy(buf, ii.name, sizeof(buf));
+                buf[sizeof(buf) - 1] = 0;
+                p = buf;
+                break;
+            }
+        }
+    }
 #endif
     /* If we don't have any way of figuring out the actual executable
        location then try argv[0].  */
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
index 4b8df96f38..eb17f5b0bc 100644
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -35,7 +35,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#if defined(__GLIBC__)
+#if defined HAVE_PTY_H
 # include <pty.h>
 #elif defined CONFIG_BSD
 # include <termios.h>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16290.39854 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1D-0000rs-H4; Fri, 30 Oct 2020 21:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16290.39854; Fri, 30 Oct 2020 21:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1D-0000rj-Dm; Fri, 30 Oct 2020 21:33:07 +0000
Received: by outflank-mailman (input) for mailman id 16290;
 Fri, 30 Oct 2020 21:33:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1C-0000re-3v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6e578078-df7d-46e6-8d81-18f878b93456;
 Fri, 30 Oct 2020 21:33:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1A-0003Pn-5K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1A-0007md-3N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1C-0000re-3v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:06 +0000
X-Inumbo-ID: 6e578078-df7d-46e6-8d81-18f878b93456
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6e578078-df7d-46e6-8d81-18f878b93456;
	Fri, 30 Oct 2020 21:33:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XgE2w6/2QkP/AukbGjnT7DHRB8v7jAC0hlYlwzLkE0w=; b=zCXOdRHah0k1zoKAg3uHxqvnSZ
	pxtLVPNFmHxEcmDkKZLzXsZwjOyogIHEjIjhHOrJ0YqJ32YPlEsxzCLQcNm21xEsJKDwti8igxuwB
	e3RF0MhINIs5EqU28mYrVfRe9o0qVWHWoaAzkA1LQ9wLlUXrvA6itzqzJJA2/jtvlW4M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1A-0003Pn-5K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1A-0007md-3N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ossaudio: fix out of bounds write
Message-Id: <E1kYc1A-0007md-3N@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:04 +0000

commit 4f50d4a48e0caa1aad591f3ca437502e33b8699d
Author:     Volker Rümelin <vr_qemu@t-online.de>
AuthorDate: Tue Jul 7 20:08:36 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:38:40 2020 +0200

    ossaudio: fix out of bounds write
    
    In function oss_read() a read error currently does not exit the
    read loop. With no data to read the variable pos will quickly
    underflow and a subsequent successful read overwrites memory
    outside the buffer. This patch adds the missing break statement
    to the error path of the function.
    
    To reproduce start qemu with -audiodev oss,id=audio0 and in the
    guest start audio recording. After some time this will trigger
    an exception.
    
    Fixes: 3ba4066d08 "ossaudio: port to the new audio backend api"
    
    Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
    Message-id: 20200707180836.5435-1-vr_qemu@t-online.de
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/ossaudio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index f88d076ec2..a7dcaa31ad 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -691,6 +691,7 @@ static size_t oss_read(HWVoiceIn *hw, void *buf, size_t len)
                            len, dst);
                 break;
             }
+            break;
         }
 
         pos += nread;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16291.39858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1N-0000so-IK; Fri, 30 Oct 2020 21:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16291.39858; Fri, 30 Oct 2020 21:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1N-0000sg-FK; Fri, 30 Oct 2020 21:33:17 +0000
Received: by outflank-mailman (input) for mailman id 16291;
 Fri, 30 Oct 2020 21:33:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1M-0000sX-1C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b1c29e23-87ad-41cd-93de-cf54e0a1ccf9;
 Fri, 30 Oct 2020 21:33:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1K-0003Ps-9d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1K-0007nU-7t
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1M-0000sX-1C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:16 +0000
X-Inumbo-ID: b1c29e23-87ad-41cd-93de-cf54e0a1ccf9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b1c29e23-87ad-41cd-93de-cf54e0a1ccf9;
	Fri, 30 Oct 2020 21:33:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/oWsdvyh1AP0PRMyck3LJjARzXX523kVh3hm+nGhp4c=; b=04M/Srsrx4dpeUlkA6CVGBHdu8
	Qyr+tLBEYMaX7ICi7TBjMxNvD/5T9xxMi86lybylxe30M/7z1asmGkAJ/Vo3OhhMKi8zjGmRdedbC
	hRiswIH8qfw2yLXouFn/+OCuslqvAsoUfENC/fvx15KlQjDIVXXrboaLDUelF2mzTq2Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1K-0003Ps-9d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1K-0007nU-7t
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/qdev-device-use: Clean up the sentences related to -usbdevice
Message-Id: <E1kYc1K-0007nU-7t@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:14 +0000

commit 480324ec8d76582fa1c367cc9a0fdb653d4ea96e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Fri Jul 10 08:55:20 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:40:47 2020 +0200

    docs/qdev-device-use: Clean up the sentences related to -usbdevice
    
    Most of the -usbdevice paramaters have been removed already. Update
    the doc accordingly.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-id: 20200710065520.24784-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 docs/qdev-device-use.txt | 28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
index 4bbbcf561f..f8d0d2fe29 100644
--- a/docs/qdev-device-use.txt
+++ b/docs/qdev-device-use.txt
@@ -125,12 +125,7 @@ The -device argument differs in detail for each type of drive:
 
 * if=pflash, if=mtd, if=sd, if=xen are not yet available with -device
 
-For USB devices, the old way is actually different:
-
-    -usbdevice disk:format=FMT:FILENAME
-
-Provides much less control than -drive's OPTS...  The new way fixes
-that:
+For USB storage devices, you can use something like:
 
     -device usb-storage,drive=DRIVE-ID,removable=RMB
 
@@ -177,8 +172,6 @@ The appropriate DEVNAME depends on the machine type.  For type "pc":
 
   This lets you control I/O ports and IRQs.
 
-* -usbdevice serial::chardev becomes -device usb-serial,chardev=dev.
-
 * -usbdevice braille doesn't support LEGACY-CHARDEV syntax.  It always
   uses "braille".  With -device, this useful default is gone, so you
   have to use something like
@@ -238,10 +231,6 @@ The old way to define the guest part looks like this:
 
     -net nic,netdev=NET-ID,macaddr=MACADDR,model=MODEL,name=ID,addr=STR,vectors=V
 
-Except for USB it looks like this:
-
-    -usbdevice net:netdev=NET-ID,macaddr=MACADDR,name=ID
-
 The new way is -device:
 
     -device DEVNAME,netdev=NET-ID,mac=MACADDR,DEV-OPTS...
@@ -336,12 +325,7 @@ The new way is -device DEVNAME,DEV-OPTS...  Details depend on DRIVER:
 * mouse           -device usb-mouse
 * tablet          -device usb-tablet
 * wacom-tablet    -device usb-wacom-tablet
-* host:...        See "Host Device Assignment"
-* disk:...        See "Block Devices"
-* serial:...      See "Character Devices"
 * braille         See "Character Devices"
-* net:...         See "Network Devices"
-* bt:...          not yet available with -device
 
 === Watchdog Devices ===
 
@@ -358,17 +342,11 @@ and host USB devices.  PCI devices can only be assigned with -device:
 
     -device vfio-pci,host=ADDR,id=ID
 
-The old way to assign a host USB device is
-
-    -usbdevice host:auto:BUS.ADDR:VID:PRID
-
-where any of BUS, ADDR, VID, PRID can be the wildcard *.
-
-The new way is
+To assign a host USB device use:
 
     -device usb-host,hostbus=BUS,hostaddr=ADDR,vendorid=VID,productid=PRID
 
-Omitted options match anything, just like the old way's wildcard.
+Omitted options match anything.
 
 === Default Devices ===
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16292.39862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1W-0000u6-K5; Fri, 30 Oct 2020 21:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16292.39862; Fri, 30 Oct 2020 21:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1W-0000ty-H3; Fri, 30 Oct 2020 21:33:26 +0000
Received: by outflank-mailman (input) for mailman id 16292;
 Fri, 30 Oct 2020 21:33:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1V-0000tq-AC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5b0b784e-6929-46b9-871b-edd1a8b77f33;
 Fri, 30 Oct 2020 21:33:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1U-0003Q0-Dn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1U-0007oC-CH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1V-0000tq-AC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:25 +0000
X-Inumbo-ID: 5b0b784e-6929-46b9-871b-edd1a8b77f33
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5b0b784e-6929-46b9-871b-edd1a8b77f33;
	Fri, 30 Oct 2020 21:33:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZWdc64/QgOc222igdD3jvmBRxwEmhi5vxB9U6W2ZY/s=; b=nUapPBx6lDFb0ZAtL5M3K6iC+u
	emR1GLXRqHQLuhEmLHkm5lUhLA9E5Md6WrT9ZfCsbdq1Q/7xcGXYGOPzwVSuNSDRMSHNiCA9kvmME
	R7r1gsBlagfXaoJJZRsYxEN04zuiM50jwSSCYYPY7/5XdIP81WQRCmF88/rbeSlXK2ZQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1U-0003Q0-Dn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1U-0007oC-CH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ui: fix vc_chr_write call in text_console_do_init
Message-Id: <E1kYc1U-0007oC-CH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:24 +0000

commit 185951817dede3dfe4eb1c4c6d262607bee605ef
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Wed Jul 1 20:18:01 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:46:35 2020 +0200

    ui: fix vc_chr_write call in text_console_do_init
    
    In case the string doesn't fit into the buffer snprintf returns the size
    it would need, so len can be larger than the buffer.  Fix this by simply
    using g_strdup_printf() instead of a static buffer.
    
    Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-id: 20200701181801.27935-1-kraxel@redhat.com
---
 ui/console.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index 08f75c9bf6..0579be792f 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2184,12 +2184,12 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)
     text_console_resize(s);
 
     if (chr->label) {
-        char msg[128];
-        int len;
+        char *msg;
 
         s->t_attrib.bgcol = QEMU_COLOR_BLUE;
-        len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label);
-        vc_chr_write(chr, (uint8_t *)msg, len);
+        msg = g_strdup_printf("%s console\r\n", chr->label);
+        vc_chr_write(chr, (uint8_t *)msg, strlen(msg));
+        g_free(msg);
         s->t_attrib = s->t_attrib_default;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16293.39866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1g-0000ve-Lw; Fri, 30 Oct 2020 21:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16293.39866; Fri, 30 Oct 2020 21:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1g-0000vU-Ia; Fri, 30 Oct 2020 21:33:36 +0000
Received: by outflank-mailman (input) for mailman id 16293;
 Fri, 30 Oct 2020 21:33:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1f-0000vH-NN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5c657f5e-0f73-4953-a022-ea621ddd5674;
 Fri, 30 Oct 2020 21:33:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1e-0003QA-HD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1e-0007os-GV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1f-0000vH-NN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:35 +0000
X-Inumbo-ID: 5c657f5e-0f73-4953-a022-ea621ddd5674
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5c657f5e-0f73-4953-a022-ea621ddd5674;
	Fri, 30 Oct 2020 21:33:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E+dkatTxjrJBEBDVVKZhDu1JQSZm77ZqahVBU4LEsDk=; b=bqsxOntGQiin9C2VfwdCqUSgPf
	pv6EbBHlQBv9x5BN99H+geQrYBOTCbspgKlLGt+lEd3nHq3hhwrJ+LW70doAE8KKjNOMYXG+gFLQ0
	lYUJS0GpRlMzl2wU8QwTeSEese71zfDPoLcKfZUi8jR7w+/exSR/rf2f1mmOiHZwfjms=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1e-0003QA-HD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1e-0007os-GV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] usb: fix usb-host build on windows.
Message-Id: <E1kYc1e-0007os-GV@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:34 +0000

commit 631009e775a91018a62e2670b4473e99916f858f
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Wed Jun 24 15:45:10 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Jul 13 11:46:51 2020 +0200

    usb: fix usb-host build on windows.
    
    Seems the new API is not available on windows.
    Update #ifdefs accordingly.
    
    Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
    Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
    Message-id: 20200624134510.9381-1-kraxel@redhat.com
---
 hw/usb/host-libusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index ad7ed8fb0c..c474551d84 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
             goto fail;
         }
     } else {
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
         trace_usb_host_open_hostfd(hostfd);
 
         rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     QTAILQ_INIT(&s->isorings);
     s->hostfd = -1;
 
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
     if (s->hostdevice) {
         int fd;
         s->needs_autoscan = false;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16294.39870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1r-0000xK-NA; Fri, 30 Oct 2020 21:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16294.39870; Fri, 30 Oct 2020 21:33:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc1r-0000xB-KD; Fri, 30 Oct 2020 21:33:47 +0000
Received: by outflank-mailman (input) for mailman id 16294;
 Fri, 30 Oct 2020 21:33:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1q-0000x1-3X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6f20d008-6cc1-4a57-8f12-9e5b2d55b87c;
 Fri, 30 Oct 2020 21:33:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1o-0003Qu-L7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1o-0007pe-K1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1q-0000x1-3X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:46 +0000
X-Inumbo-ID: 6f20d008-6cc1-4a57-8f12-9e5b2d55b87c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6f20d008-6cc1-4a57-8f12-9e5b2d55b87c;
	Fri, 30 Oct 2020 21:33:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Yg8gcYTxGnFgc5egMgTIAgzQebuY3K/rKBGhcTZSc0w=; b=SFqxkw0CTFtet8Dx83qAA+BHxd
	06duYTNNV3nFmfQOvQ1ujyM0wK2CI0UIU6anXIG8iVgJcQGBX+DLVGDNHccQLcC7lhV7b0EwJ6ZOh
	lB5x5QQ3SETHXtYSvQaPgwNz1TJqW7vp4FBNN4o9vPHj2KBixOj2WgRJIXk3shdQMf04=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1o-0003Qu-L7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1o-0007pe-K1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200713-pull-request' into staging
Message-Id: <E1kYc1o-0007pe-K1@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:44 +0000

commit 20c1df5476e1e9b5d3f5b94f9f3ce01d21f14c46
Merge: 5c65b1f135ff09d24827fa3a17e56a4f8a032cd5 631009e775a91018a62e2670b4473e99916f858f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 16:58:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 13 16:58:44 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200713-pull-request' into staging
    
    bugfixes for audio, usb, ui and docs.
    
    # gpg: Signature made Mon 13 Jul 2020 15:10:35 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200713-pull-request:
      usb: fix usb-host build on windows.
      ui: fix vc_chr_write call in text_console_do_init
      docs/qdev-device-use: Clean up the sentences related to -usbdevice
      ossaudio: fix out of bounds write
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 audio/ossaudio.c         |  1 +
 docs/qdev-device-use.txt | 28 +++-------------------------
 hw/usb/host-libusb.c     |  4 ++--
 ui/console.c             |  8 ++++----
 4 files changed, 10 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:33:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:33:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16295.39874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc21-0000yQ-P5; Fri, 30 Oct 2020 21:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16295.39874; Fri, 30 Oct 2020 21:33:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc21-0000yI-Lp; Fri, 30 Oct 2020 21:33:57 +0000
Received: by outflank-mailman (input) for mailman id 16295;
 Fri, 30 Oct 2020 21:33:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc1z-0000yB-Vn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5fad2e1a-0242-4ab8-8849-c78859bb6cd9;
 Fri, 30 Oct 2020 21:33:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1z-0003R6-1X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc1z-0007qw-0b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc1z-0000yB-Vn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:56 +0000
X-Inumbo-ID: 5fad2e1a-0242-4ab8-8849-c78859bb6cd9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5fad2e1a-0242-4ab8-8849-c78859bb6cd9;
	Fri, 30 Oct 2020 21:33:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SLJb+3tED/sdFPnbFmFkN6SX1ubjluwqrgAlXjmwUis=; b=GUQi9Ovmq5QJByvo6Li3nSm07u
	WNaRTn4TEe3gUAG34VF+avuWZMo/K6Tm4oa83XMbgWAXbTxNY7nrxD9fyezwzft4f6y7hbdWKvd3D
	a2y4+3irmhZQsKcD/68t1SA1g018RaXscNtTlhZJQBwN+vP0kNSYGwuAsMEGhO5KUwi8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1z-0003R6-1X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc1z-0007qw-0b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:33:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] nbd: Avoid off-by-one in long export name truncation
Message-Id: <E1kYc1z-0007qw-0b@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:33:55 +0000

commit 00d69986da83a74f6f5731c80f8dd09fde95d19a
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jun 22 16:03:55 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    nbd: Avoid off-by-one in long export name truncation
    
    When snprintf returns the same value as the buffer size, the final
    byte was truncated to ensure a NUL terminator.  Fortunately, such long
    export names are unusual enough, with no real impact other than what
    is displayed to the user.
    
    Fixes: 5c86bdf12089
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200622210355.414941-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index c297336ffc..65a4f56924 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -2002,7 +2002,7 @@ static void nbd_refresh_filename(BlockDriverState *bs)
         len = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
                        "nbd://%s:%s", host, port);
     }
-    if (len > sizeof(bs->exact_filename)) {
+    if (len >= sizeof(bs->exact_filename)) {
         /* Name is too long to represent exactly, so leave it empty. */
         bs->exact_filename[0] = '\0';
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:34:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16296.39878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2C-00010Q-QW; Fri, 30 Oct 2020 21:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16296.39878; Fri, 30 Oct 2020 21:34:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2C-00010I-Nf; Fri, 30 Oct 2020 21:34:08 +0000
Received: by outflank-mailman (input) for mailman id 16296;
 Fri, 30 Oct 2020 21:34:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc2B-00010B-PO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a0bc223a-5223-4ea2-89a9-3637fd971c50;
 Fri, 30 Oct 2020 21:34:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc29-0003RR-5N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc29-0007rt-4M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc2B-00010B-PO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:07 +0000
X-Inumbo-ID: a0bc223a-5223-4ea2-89a9-3637fd971c50
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a0bc223a-5223-4ea2-89a9-3637fd971c50;
	Fri, 30 Oct 2020 21:34:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1wJ2mM8wmUGuoMdVSgAGXRFxPQirl2cPFnwaYGK3iEw=; b=fuSF7+ZWmeom3VPm0dWd31MVsF
	gJjjl9aMAHseBvfWhrS7DVJdqYESdAyQ4Pbui/FSbnmCXxFPE0BEDZE7nrTAa3GypUsNuS4iOLYlm
	i8USZlCFj/H2pzoeF0j78ON70fBHUv2X0D2rN3B+rphjqTKgQgtQxnZyusosB57elNq8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc29-0003RR-5N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc29-0007rt-4M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hax: Fix setting of FD_CLOEXEC
Message-Id: <E1kYc29-0007rt-4M@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:05 +0000

commit 8cf58a49f883f089e7d4b6e19acc987085d024fd
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Apr 20 12:53:07 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    hax: Fix setting of FD_CLOEXEC
    
    Blindly setting FD_CLOEXEC without a read-modify-write will
    inadvertently clear any other intentionally-set bits, such as a
    proposed new bit for designating a fd that must behave in 32-bit mode.
    Use our wrapper function instead of an incorrect hand-rolled version.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200420175309.75894-2-eblake@redhat.com>
    Reviewed-by: Colin Xu <colin.xu@intel.com>
---
 target/i386/hax-posix.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/i386/hax-posix.c b/target/i386/hax-posix.c
index 3bad89f133..5f9d1b803d 100644
--- a/target/i386/hax-posix.c
+++ b/target/i386/hax-posix.c
@@ -23,7 +23,7 @@ hax_fd hax_mod_open(void)
         fprintf(stderr, "Failed to open the hax module\n");
     }
 
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
 
     return fd;
 }
@@ -147,7 +147,7 @@ hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id)
     fd = open(vm_name, O_RDWR);
     g_free(vm_name);
 
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
 
     return fd;
 }
@@ -200,7 +200,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid)
     if (fd < 0) {
         fprintf(stderr, "Failed to open the vcpu devfs\n");
     }
-    fcntl(fd, F_SETFD, FD_CLOEXEC);
+    qemu_set_cloexec(fd);
     return fd;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:34:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:34:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16297.39882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2L-00011a-Su; Fri, 30 Oct 2020 21:34:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16297.39882; Fri, 30 Oct 2020 21:34:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2L-00011S-PL; Fri, 30 Oct 2020 21:34:17 +0000
Received: by outflank-mailman (input) for mailman id 16297;
 Fri, 30 Oct 2020 21:34:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc2K-00011K-3j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id da52b267-51d8-4bde-a1a7-e621a2283673;
 Fri, 30 Oct 2020 21:34:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2J-0003Re-8u
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2J-0008B8-88
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc2K-00011K-3j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:16 +0000
X-Inumbo-ID: da52b267-51d8-4bde-a1a7-e621a2283673
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id da52b267-51d8-4bde-a1a7-e621a2283673;
	Fri, 30 Oct 2020 21:34:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tMAHeK45izd/WADlfC+WhBjfsqeecVrXS/DBvsMaav8=; b=KxMJYCTMITjP2JmRY5s7NLm+lQ
	sB92es1Fw+fCCKjf19AfMdWuVvaJh0X39XYeAQ+8Dp9IIkMoSibQ88CsR88HQxDazlClWiCgDzuSU
	vS78wq2lW0OQr7MLvlaJcyYznM36Imfx1XEfl/jalS83a0AA6C4ONt7Q6jRgeyTUrVc8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2J-0003Re-8u
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2J-0008B8-88
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: QemuIoInteractive: use qemu_io_args_no_fmt
Message-Id: <E1kYc2J-0008B8-88@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:15 +0000

commit a1a7f56cdd1ddc99fcd1078c9285849aaaaaeca9
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:27 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests: QemuIoInteractive: use qemu_io_args_no_fmt
    
    The only user (iotest 205) of QemuIoInteractive provides -f argument,
    so it's a bit inefficient to use qemu_io_args, which contains -f too.
    And we are going to add one more test, which wants to specify -f by
    hand. Let's use qemu_io_args_no_fmt.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200701105331.121670-2-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f1e0733dda..109fb3884a 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -212,7 +212,7 @@ def get_virtio_scsi_device():
 
 class QemuIoInteractive:
     def __init__(self, *args):
-        self.args = qemu_io_args + list(args)
+        self.args = qemu_io_args_no_fmt + list(args)
         self._p = subprocess.Popen(self.args, stdin=subprocess.PIPE,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:34:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16298.39886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2V-00013E-Vz; Fri, 30 Oct 2020 21:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16298.39886; Fri, 30 Oct 2020 21:34:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2V-000132-Sf; Fri, 30 Oct 2020 21:34:27 +0000
Received: by outflank-mailman (input) for mailman id 16298;
 Fri, 30 Oct 2020 21:34:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc2U-00012p-4a
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27058c34-6673-46b2-aba2-17f1c7a5445b;
 Fri, 30 Oct 2020 21:34:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2T-0003Rp-CQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2T-0008CM-BU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc2U-00012p-4a
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:26 +0000
X-Inumbo-ID: 27058c34-6673-46b2-aba2-17f1c7a5445b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27058c34-6673-46b2-aba2-17f1c7a5445b;
	Fri, 30 Oct 2020 21:34:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TVJrO7igpXQcKexEATzbhG4n88YyPBO9hVw2GIavdHM=; b=DUxxIazWzGtYd4imy/tREAL0gS
	mc94GXGLeKYRru7a6odg8myD/v/9U3Skhy0Q6RkQ5TkanZRG63dbtYIqu3Gfjfdrkyv40uCWpASDR
	pwHRPx61IqrYpV1HqBg6RvvG6karvUeCiOxV67VzqOQ0s6/xZgqegOdv2iVae+GjtXvc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2T-0003Rp-CQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2T-0008CM-BU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests.py: QemuIoInteractive: print output on failure
Message-Id: <E1kYc2T-0008CM-BU@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:25 +0000

commit 1f4b774a6444575b86f27b17d3d01e4f41df6581
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:28 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests.py: QemuIoInteractive: print output on failure
    
    Make it simpler to debug when qemu-io fails due to wrong arguments or
    environment.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200701105331.121670-3-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 109fb3884a..2a08fea3c9 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -217,7 +217,13 @@ class QemuIoInteractive:
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT,
                                    universal_newlines=True)
-        assert self._p.stdout.read(9) == 'qemu-io> '
+        out = self._p.stdout.read(9)
+        if out != 'qemu-io> ':
+            # Most probably qemu-io just failed to start.
+            # Let's collect the whole output and exit.
+            out += self._p.stdout.read()
+            self._p.wait(timeout=1)
+            raise ValueError(out)
 
     def close(self):
         self._p.communicate('q\n')
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:34:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16299.39889 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2g-00014N-1G; Fri, 30 Oct 2020 21:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16299.39889; Fri, 30 Oct 2020 21:34:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2f-00014E-UI; Fri, 30 Oct 2020 21:34:37 +0000
Received: by outflank-mailman (input) for mailman id 16299;
 Fri, 30 Oct 2020 21:34:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc2e-000145-Ap
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6c28ecc9-6036-40a7-ae45-782cc9e45d6f;
 Fri, 30 Oct 2020 21:34:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2d-0003S1-Fp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2d-0008DQ-F5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc2e-000145-Ap
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:36 +0000
X-Inumbo-ID: 6c28ecc9-6036-40a7-ae45-782cc9e45d6f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6c28ecc9-6036-40a7-ae45-782cc9e45d6f;
	Fri, 30 Oct 2020 21:34:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XyWCVewB565iN9qXKDzN1hlU4C1rR69P6OYnVZ4Zw7g=; b=6/BzTft5faSnoj0JJNkbTJV2hw
	znR51NFgrKKnE/wHQ0XRiF7Jc5x/6xHbbFtKp/AD1G779nuaaDJA1OZfbY5+tyn1fZ5Xx10YO4y7E
	lAcmiGRqCCm7NjQ0P4kNGmYJvfjlMb0eTcrbqif7m9JnvcSR9BIYY2R7U4f/+JjTICkQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2d-0003S1-Fp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2d-0008DQ-F5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests.py: filter_testfiles(): filter SOCK_DIR too
Message-Id: <E1kYc2d-0008DQ-F5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:35 +0000

commit df0e032b6196934b2b12180a6a05aa8b7e6553fc
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Wed Jul 1 13:53:30 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 13 09:01:01 2020 -0500

    iotests.py: filter_testfiles(): filter SOCK_DIR too
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200701105331.121670-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 2a08fea3c9..8b760405ee 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -345,8 +345,9 @@ def filter_qmp(qmsg, filter_fn):
     return qmsg
 
 def filter_testfiles(msg):
-    prefix = os.path.join(test_dir, "%s-" % (os.getpid()))
-    return msg.replace(prefix, 'TEST_DIR/PID-')
+    pref1 = os.path.join(test_dir, "%s-" % (os.getpid()))
+    pref2 = os.path.join(sock_dir, "%s-" % (os.getpid()))
+    return msg.replace(pref1, 'TEST_DIR/PID-').replace(pref2, 'SOCK_DIR/PID-')
 
 def filter_qmp_testfiles(qmsg):
     def _filter(_key, value):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:34:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16300.39894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2q-00016O-2q; Fri, 30 Oct 2020 21:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16300.39894; Fri, 30 Oct 2020 21:34:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc2p-00016G-W5; Fri, 30 Oct 2020 21:34:47 +0000
Received: by outflank-mailman (input) for mailman id 16300;
 Fri, 30 Oct 2020 21:34:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc2o-000164-CY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f964abcf-b01f-4236-959d-919b8861ebe0;
 Fri, 30 Oct 2020 21:34:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2n-0003Sa-JQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2n-0008Ed-IX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc2o-000164-CY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:46 +0000
X-Inumbo-ID: f964abcf-b01f-4236-959d-919b8861ebe0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f964abcf-b01f-4236-959d-919b8861ebe0;
	Fri, 30 Oct 2020 21:34:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WFt240rBJgI6bE02+y4X5R2r7MlWKFzZF2PO0UJSkWU=; b=Fi7VB9TZQL0iSC8XLfMWPstzKD
	Tl9Jj0HuaphI7KFbsu3JDVwT5wJNKl6uVFwg58FQ1U+9lsfyNO4DoRrmXcHzFfh5sWTdAi56YimG7
	3Blut3CLBFc5Qu0zX2ExArSA+m8D12CBv28ykpX3xP3z6JT53H62ToRMxVWFfa32kqdo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2n-0003Sa-JQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2n-0008Ed-IX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-13' into staging
Message-Id: <E1kYc2n-0008Ed-IX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:45 +0000

commit 1a53dfee92284d3016a579ef31d53367e84d9dd8
Merge: 20c1df5476e1e9b5d3f5b94f9f3ce01d21f14c46 df0e032b6196934b2b12180a6a05aa8b7e6553fc
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 13:52:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 13:52:10 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-13' into staging
    
    NBD patches for 2020-07-13
    
    - fix off-by-one truncation in corner-case name display
    - use fcntl correctly
    - iotest cleanups that enable testing an upcoming fix for NBD close
    
    # gpg: Signature made Mon 13 Jul 2020 15:11:35 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-nbd-2020-07-13:
      iotests.py: filter_testfiles(): filter SOCK_DIR too
      iotests.py: QemuIoInteractive: print output on failure
      iotests: QemuIoInteractive: use qemu_io_args_no_fmt
      hax: Fix setting of FD_CLOEXEC
      nbd: Avoid off-by-one in long export name truncation
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/nbd.c                   |  2 +-
 target/i386/hax-posix.c       |  6 +++---
 tests/qemu-iotests/iotests.py | 15 +++++++++++----
 3 files changed, 15 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16302.39898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc33-00017o-4g; Fri, 30 Oct 2020 21:35:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16302.39898; Fri, 30 Oct 2020 21:35:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc33-00017h-1U; Fri, 30 Oct 2020 21:35:01 +0000
Received: by outflank-mailman (input) for mailman id 16302;
 Fri, 30 Oct 2020 21:34:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc31-00017Y-8w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id af1f2213-536c-4298-827d-13071c629dbd;
 Fri, 30 Oct 2020 21:34:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2x-0003Si-Vt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc2x-0008G4-U9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc31-00017Y-8w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:59 +0000
X-Inumbo-ID: af1f2213-536c-4298-827d-13071c629dbd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id af1f2213-536c-4298-827d-13071c629dbd;
	Fri, 30 Oct 2020 21:34:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dzrcG9bTUgzWtzIeVDJAFM9O4zEvBlUTIqkKaO7eHzI=; b=6MlIVFrwHtvXUTKy/xhz3mettr
	kaT7yvtvzQxV9L2UJt4aalLVIsSMy8bsaP8ao2gs1NM/GmtCljQNbw6BNics7VPT65aaZFVL371NH
	b6J34zJ60uDKHymVy+2YesaVga+WYm0OpZ0UwBf6zddrjuvG7Db/eY9Tdv0UzMP/BAHo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2x-0003Si-Vt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc2x-0008G4-U9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:34:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration: fix memory leak in qmp_migrate_set_parameters
Message-Id: <E1kYc2x-0008G4-U9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:34:55 +0000

commit 9728ebfb77f0159f4c358103ac4b49a72109d972
Author:     Zheng Chuan <zhengchuan@huawei.com>
AuthorDate: Thu Jul 9 16:28:25 2020 +0800
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:13:49 2020 +0200

    migration: fix memory leak in qmp_migrate_set_parameters
    
    "tmp.tls_hostname" and "tmp.tls_creds" allocated by migrate_params_test_apply()
    is forgot to free at the end of qmp_migrate_set_parameters(). Fix that.
    
    The leak stack:
    Direct leak of 2 byte(s) in 2 object(s) allocated from:
       #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
       #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
       #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
       #3 0xaaaac52447fb in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1377)
       #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
       #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c:165)
       #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
       #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
       #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
       #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
       #10 0xaaaac55cae0f in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
       #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
       #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
       #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
       #14 0xaaaac47f45ef(/usr/bin/qemu-kvm-4.1.0+0x8455ef)
       #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
       #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)
    
    Direct leak of 2 byte(s) in 2 object(s) allocated from:
       #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
       #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
       #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
       #3 0xaaaac5244893 in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1382)
       #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
       #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c)
       #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
       #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
       #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
       #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
       #10 0xaaaac55cae0f in in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
       #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
       #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
       #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
       #14 0xaaaac47f45ef (/usr/bin/qemu-kvm-4.1.0+0x8455ef)
       #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
       #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)
    
    Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
    Reviewed-by: KeQian Zhu <zhukeqian1@huawei.com>
    Reviewed-by: HaiLiang <zhang.zhanghailiang@huawei.com>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 4e658c397e..08519de56f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1343,12 +1343,12 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
 
     if (params->has_tls_creds) {
         assert(params->tls_creds->type == QTYPE_QSTRING);
-        dest->tls_creds = g_strdup(params->tls_creds->u.s);
+        dest->tls_creds = params->tls_creds->u.s;
     }
 
     if (params->has_tls_hostname) {
         assert(params->tls_hostname->type == QTYPE_QSTRING);
-        dest->tls_hostname = g_strdup(params->tls_hostname->u.s);
+        dest->tls_hostname = params->tls_hostname->u.s;
     }
 
     if (params->has_max_bandwidth) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16303.39904 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3B-00018t-6f; Fri, 30 Oct 2020 21:35:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16303.39904; Fri, 30 Oct 2020 21:35:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3B-00018l-3D; Fri, 30 Oct 2020 21:35:09 +0000
Received: by outflank-mailman (input) for mailman id 16303;
 Fri, 30 Oct 2020 21:35:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc39-00018b-71
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4e4dd4b5-c1b7-4662-9742-a5649a6ce519;
 Fri, 30 Oct 2020 21:35:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc38-0003T3-3P
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc38-0008HN-2Z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc39-00018b-71
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:07 +0000
X-Inumbo-ID: 4e4dd4b5-c1b7-4662-9742-a5649a6ce519
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4e4dd4b5-c1b7-4662-9742-a5649a6ce519;
	Fri, 30 Oct 2020 21:35:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SHKdazAla0+AbgqHKSiEjme2/zW3w6Ruec4KVn5UgsE=; b=nHmupYPtuVPnL3uAqsN6xfbAVk
	2RdvOjipiEmomo9f4STgYxK++MuOzeNBTPABMsHSvjGo6nBnRYslBzcOq/F4NVWruvf20FtHx5iN1
	MNiYfg3zLVBj48J5VmvQK9LGxLpA53chnj8hpHl9mhWrmXf8Kyms9KzR7/7/djrbFTn4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc38-0003T3-3P
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc38-0008HN-2Z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/savevm: respect qemu_fclose() error code in save_snapshot()
Message-Id: <E1kYc38-0008HN-2Z@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:06 +0000

commit 66270a475cb81f24b53c8cc9ccaf152baf6bb10f
Author:     Denis V. Lunev <den@openvz.org>
AuthorDate: Fri Jul 3 19:11:24 2020 +0300
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:15:35 2020 +0200

    migration/savevm: respect qemu_fclose() error code in save_snapshot()
    
    qemu_fclose() could return error, f.e. if bdrv_co_flush() will return
    the error.
    
    This validation will become more important once we will start waiting of
    asynchronous IO operations, started from bdrv_write_vmstate(), which are
    coming soon.
    
    Signed-off-by: Denis V. Lunev <den@openvz.org>
    Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    CC: Kevin Wolf <kwolf@redhat.com>
    CC: Max Reitz <mreitz@redhat.com>
    CC: Stefan Hajnoczi <stefanha@redhat.com>
    CC: Fam Zheng <fam@euphon.net>
    CC: Juan Quintela <quintela@redhat.com>
    CC: Denis Plotnikov <dplotnikov@virtuozzo.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/savevm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 6e01724605..45c9dd9d8a 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2635,7 +2635,7 @@ int save_snapshot(const char *name, Error **errp)
 {
     BlockDriverState *bs, *bs1;
     QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
-    int ret = -1;
+    int ret = -1, ret2;
     QEMUFile *f;
     int saved_vm_running;
     uint64_t vm_state_size;
@@ -2719,10 +2719,14 @@ int save_snapshot(const char *name, Error **errp)
     }
     ret = qemu_savevm_state(f, errp);
     vm_state_size = qemu_ftell(f);
-    qemu_fclose(f);
+    ret2 = qemu_fclose(f);
     if (ret < 0) {
         goto the_end;
     }
+    if (ret2 < 0) {
+        ret = ret2;
+        goto the_end;
+    }
 
     /* The bdrv_all_create_snapshot() call that follows acquires the AioContext
      * for itself.  BDRV_POLL_WHILE() does not support nested locking because
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16304.39906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3L-0001AO-7Z; Fri, 30 Oct 2020 21:35:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16304.39906; Fri, 30 Oct 2020 21:35:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3L-0001AG-4j; Fri, 30 Oct 2020 21:35:19 +0000
Received: by outflank-mailman (input) for mailman id 16304;
 Fri, 30 Oct 2020 21:35:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc3J-0001A6-Ul
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8ddd39a0-6227-4d00-8216-f03a5e1ce162;
 Fri, 30 Oct 2020 21:35:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3I-0003TB-7A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3I-0008IJ-6M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc3J-0001A6-Ul
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:17 +0000
X-Inumbo-ID: 8ddd39a0-6227-4d00-8216-f03a5e1ce162
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8ddd39a0-6227-4d00-8216-f03a5e1ce162;
	Fri, 30 Oct 2020 21:35:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=khocyOTIgBmaRPV3FDT4KsOIljKut/qcwOHzUS73UB4=; b=cDhBthIE9V2jkMzYqk3nVQvJ4r
	OERBysUy1bt6Kf6mFG/PY8YeDSfqQ5WTfDp6CKOYd4dHHe6+lzR4sypM1di584FW19PzqoyLxcKmi
	9r5j8ynSEwWiy9W+UNI0YUY5I35hYPYB25AUOKgzdoaLspfa/zlzz8XXM9ZWIDONJPCY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3I-0003TB-7A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3I-0008IJ-6M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/migration.c: Remove superfluous breaks
Message-Id: <E1kYc3I-0008IJ-6M@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:16 +0000

commit eb9bd46ff658e05e2c0c71fc308f3b811afa87e1
Author:     Liao Pingfang <liao.pingfang@zte.com.cn>
AuthorDate: Mon Jul 13 17:04:38 2020 +0800
Commit:     Juan Quintela <quintela@redhat.com>
CommitDate: Mon Jul 13 18:15:36 2020 +0200

    migration/migration.c: Remove superfluous breaks
    
    Remove superfluous breaks, as there is a "return" before them.
    
    Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
    Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 08519de56f..2ed9923227 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -986,7 +986,6 @@ static void fill_source_migration_info(MigrationInfo *info)
         /* no migration has happened ever */
         /* do not overwrite destination migration status */
         return;
-        break;
     case MIGRATION_STATUS_SETUP:
         info->has_status = true;
         info->has_total_time = false;
@@ -1105,7 +1104,6 @@ static void fill_destination_migration_info(MigrationInfo *info)
     switch (mis->state) {
     case MIGRATION_STATUS_NONE:
         return;
-        break;
     case MIGRATION_STATUS_SETUP:
     case MIGRATION_STATUS_CANCELLING:
     case MIGRATION_STATUS_CANCELLED:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16305.39910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3V-0001Bc-9z; Fri, 30 Oct 2020 21:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16305.39910; Fri, 30 Oct 2020 21:35:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3V-0001BU-6D; Fri, 30 Oct 2020 21:35:29 +0000
Received: by outflank-mailman (input) for mailman id 16305;
 Fri, 30 Oct 2020 21:35:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc3T-0001BH-As
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ce3518bc-66c9-4235-96bc-73d837997d99;
 Fri, 30 Oct 2020 21:35:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3S-0003TU-Ay
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3S-0008J3-A7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc3T-0001BH-As
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:27 +0000
X-Inumbo-ID: ce3518bc-66c9-4235-96bc-73d837997d99
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ce3518bc-66c9-4235-96bc-73d837997d99;
	Fri, 30 Oct 2020 21:35:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+VomF56DeNHV9vJR80Jep/cIHshGJnyBcmHP9S3cYGU=; b=xZcFWHyfBahZnF3HL8Wk5vGAe0
	lDdUtZdD2cl394ueZZgDREIri9z3Z7DVpSTFr8JnHsiJ553pgWjf7unU9ai1y9GGK5W1vkVMLF/Sh
	/5HQwLao2KflkBXbvT9Ed/6PLPjLbKySdxg7jRnby+3FzR6EUtCK4oym9Y2Rzghi7gqk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3S-0003TU-Ay
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3S-0008J3-A7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/juanquintela/tags/migration-pull-request' into staging
Message-Id: <E1kYc3S-0008J3-A7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:26 +0000

commit beff47a2f6a8295161f98a9dac94e18e5376e749
Merge: 1a53dfee92284d3016a579ef31d53367e84d9dd8 eb9bd46ff658e05e2c0c71fc308f3b811afa87e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 16:33:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 16:33:23 2020 +0100

    Merge remote-tracking branch 'remotes/juanquintela/tags/migration-pull-request' into staging
    
    Migration Pull request
    
    It includes several fixes:
    
    - fix qemu_fclose(denis)
    - remove superfluous breaks (liao)
    - fix memory leak (zheng)
    
    Please apply
    
    [v1 & v2]
    
    There was one error on the huawei address of the 1st patch and mail
    was bouncing.  Fixed.
    
    # gpg: Signature made Mon 13 Jul 2020 18:51:34 BST
    # gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
    # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
    # gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
    # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723
    
    * remotes/juanquintela/tags/migration-pull-request:
      migration/migration.c: Remove superfluous breaks
      migration/savevm: respect qemu_fclose() error code in save_snapshot()
      migration: fix memory leak in qmp_migrate_set_parameters
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 migration/migration.c | 6 ++----
 migration/savevm.c    | 8 ++++++--
 2 files changed, 8 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16306.39913 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3f-0001DW-CZ; Fri, 30 Oct 2020 21:35:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16306.39913; Fri, 30 Oct 2020 21:35:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3f-0001DN-9R; Fri, 30 Oct 2020 21:35:39 +0000
Received: by outflank-mailman (input) for mailman id 16306;
 Fri, 30 Oct 2020 21:35:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc3d-0001Cn-SN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 099903b5-48f5-4df9-b275-5381616b7242;
 Fri, 30 Oct 2020 21:35:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3c-0003Tb-T0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3c-0008Ll-S9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc3d-0001Cn-SN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:37 +0000
X-Inumbo-ID: 099903b5-48f5-4df9-b275-5381616b7242
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 099903b5-48f5-4df9-b275-5381616b7242;
	Fri, 30 Oct 2020 21:35:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=r2ramvcDgCA/2PYWm9jjWQrp58z9lF/u4gGID2xz3gc=; b=bkRvIk/EL1HbBhsVRx5ZvbTp0K
	3HueZIi50+2aSJBwiie2+BVORCVQy08Wt0VO/RnpFfXCnOzZzeqiycPwvlu6BYjJs+BAjkke/6fPI
	p6vv6UhVmI6fO6YcruKYvxXZOTAcVnuHNIStv2KjdPghiBZkjZ5jvrH/zgK9XtTv0qyQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3c-0003Tb-T0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3c-0008Ll-S9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Add an entry for OpenSBI firmware
Message-Id: <E1kYc3c-0008Ll-S9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:36 +0000

commit e92fb01639cadbeb9c6fc5d5189e35ef3e45836f
Author:     Bin Meng <bmeng.cn@gmail.com>
AuthorDate: Fri Jun 26 06:13:40 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    MAINTAINERS: Add an entry for OpenSBI firmware
    
    List me as the maintainer for OpenSBI firmware related files.
    
    Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <1593177220-28143-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..80fa8837e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2681,6 +2681,13 @@ F: hw/i386/intel_iommu.c
 F: hw/i386/intel_iommu_internal.h
 F: include/hw/i386/intel_iommu.h
 
+OpenSBI Firmware
+M: Bin Meng <bmeng.cn@gmail.com>
+S: Supported
+F: pc-bios/opensbi-*
+F: .gitlab-ci.d/opensbi.yml
+F: .gitlab-ci.d/opensbi/
+
 Usermode Emulation
 ------------------
 Overall usermode emulation
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:35:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:35:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16307.39918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3s-0001Eq-Dy; Fri, 30 Oct 2020 21:35:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16307.39918; Fri, 30 Oct 2020 21:35:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc3s-0001Ek-Az; Fri, 30 Oct 2020 21:35:52 +0000
Received: by outflank-mailman (input) for mailman id 16307;
 Fri, 30 Oct 2020 21:35:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc3q-0001Ed-FJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ff082983-21ca-4c28-b460-ab23f1ff86d9;
 Fri, 30 Oct 2020 21:35:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3n-0003UM-13
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3m-0008Mh-Vg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc3q-0001Ed-FJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:50 +0000
X-Inumbo-ID: ff082983-21ca-4c28-b460-ab23f1ff86d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ff082983-21ca-4c28-b460-ab23f1ff86d9;
	Fri, 30 Oct 2020 21:35:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JA0ry6lgxSSA9eIjFcOAbZ+BTCQsz8ibGIzSvRUrxE0=; b=3+2b6D5cOjBovNQAFkVTp/S6fG
	4o7aeEGT9kJl/QH4Fl1ZruLoKOmHr6BiIJN39IYRb+nbwcwcLNhjwhYKhtHVABbk79B70HDqQMOST
	5NGOVpbykirYZVDGW08tzJPim85fyg2/ffFZwaHB+tyBXEKIdV6vv9HTg9ikzwizXa5U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3n-0003UM-13
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3m-0008Mh-Vg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/riscv: virt: Sort the SoC memmap table entries
Message-Id: <E1kYc3m-0008Mh-Vg@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:46 +0000

commit 2c44bbf32cda5fbf85b697e3a12127f59d2c2e80
Author:     Bin Meng <bin.meng@windriver.com>
AuthorDate: Thu Jul 2 20:21:51 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/riscv: virt: Sort the SoC memmap table entries
    
    Adjust the PCIe memory maps to follow the order.
    
    Signed-off-by: Bin Meng <bin.meng@windriver.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1593746511-19517-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/virt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index f7630c8a89..18283e262e 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -60,14 +60,14 @@ static const struct MemmapEntry {
     [VIRT_TEST] =        {   0x100000,        0x1000 },
     [VIRT_RTC] =         {   0x101000,        0x1000 },
     [VIRT_CLINT] =       {  0x2000000,       0x10000 },
+    [VIRT_PCIE_PIO] =    {  0x3000000,       0x10000 },
     [VIRT_PLIC] =        {  0xc000000,     0x4000000 },
     [VIRT_UART0] =       { 0x10000000,         0x100 },
     [VIRT_VIRTIO] =      { 0x10001000,        0x1000 },
     [VIRT_FLASH] =       { 0x20000000,     0x4000000 },
-    [VIRT_DRAM] =        { 0x80000000,           0x0 },
-    [VIRT_PCIE_MMIO] =   { 0x40000000,    0x40000000 },
-    [VIRT_PCIE_PIO] =    { 0x03000000,    0x00010000 },
     [VIRT_PCIE_ECAM] =   { 0x30000000,    0x10000000 },
+    [VIRT_PCIE_MMIO] =   { 0x40000000,    0x40000000 },
+    [VIRT_DRAM] =        { 0x80000000,           0x0 },
 };
 
 #define VIRT_FLASH_SECTOR_SIZE (256 * KiB)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16308.39924 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc40-0001G3-GE; Fri, 30 Oct 2020 21:36:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16308.39924; Fri, 30 Oct 2020 21:36:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc40-0001Fq-CP; Fri, 30 Oct 2020 21:36:00 +0000
Received: by outflank-mailman (input) for mailman id 16308;
 Fri, 30 Oct 2020 21:35:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc3y-0001Fd-Hr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f53ccc98-b08a-4833-a1a1-f98507c05803;
 Fri, 30 Oct 2020 21:35:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3x-0003UU-4j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc3x-0008NP-3q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc3y-0001Fd-Hr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:58 +0000
X-Inumbo-ID: f53ccc98-b08a-4833-a1a1-f98507c05803
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f53ccc98-b08a-4833-a1a1-f98507c05803;
	Fri, 30 Oct 2020 21:35:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bpQWOvAaoi0mNvvYzFPe5ynbisvDowgid9EHrm7cgbA=; b=GNf0RRe9TmKOMx1kH6peC9i8Nu
	D1i23vjMJpr3yN+sfyJ5VibhC96h/QAt89+eL7Sro/DIUer2diETdQbdUoOaZ6dtXhzb9oRP8WU8N
	E5iwenDskLTQknIXLepLpmqCmaANcpaxdcV+1Kky+77dLFw6N2uWrHqkUtSC2X0usaEY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3x-0003UU-4j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc3x-0008NP-3q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:35:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] riscv: Unify Qemu's reset vector code path
Message-Id: <E1kYc3x-0008NP-3q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:35:57 +0000

commit 43cf723adca9a5e188c664c3b606a585192a599c
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:46 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    riscv: Unify Qemu's reset vector code path
    
    Currently, all riscv machines except sifive_u have identical reset vector
    code implementations with memory addresses being different for all machines.
    They can be easily combined into a single function in common code.
    
    Move it to common function and let all the machines use the common function.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-2-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c         | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/riscv/sifive_u.c     |  1 -
 hw/riscv/spike.c        | 41 +++--------------------------------------
 hw/riscv/virt.c         | 40 +++-------------------------------------
 include/hw/riscv/boot.h |  2 ++
 5 files changed, 54 insertions(+), 76 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index adb421b91b..3df802380a 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -26,8 +26,11 @@
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
 #include "elf.h"
+#include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 
+#include <libfdt.h>
+
 #if defined(TARGET_RISCV32)
 # define KERNEL_BOOT_ADDRESS 0x80400000
 #else
@@ -155,3 +158,46 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
 
     return *start + size;
 }
+
+void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
+                               hwaddr rom_size, void *fdt)
+{
+    int i;
+
+    /* reset vector */
+    uint32_t reset_vec[8] = {
+        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
+        0xf1402573,                  /*     csrr   a0, mhartid  */
+#if defined(TARGET_RISCV32)
+        0x0182a283,                  /*     lw     t0, 24(t0) */
+#elif defined(TARGET_RISCV64)
+        0x0182b283,                  /*     ld     t0, 24(t0) */
+#endif
+        0x00028067,                  /*     jr     t0 */
+        0x00000000,
+        start_addr,                  /* start: .dword */
+        0x00000000,
+                                     /* dtb: */
+    };
+
+    /* copy in the reset vector in little_endian byte order */
+    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+        reset_vec[i] = cpu_to_le32(reset_vec[i]);
+    }
+    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
+                          rom_base, &address_space_memory);
+
+    /* copy in the device tree */
+    if (fdt_pack(fdt) || fdt_totalsize(fdt) >
+        rom_size - sizeof(reset_vec)) {
+        error_report("not enough space to store device-tree");
+        exit(1);
+    }
+    qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
+    rom_add_blob_fixed_as("mrom.fdt", fdt, fdt_totalsize(fdt),
+                           rom_base + sizeof(reset_vec),
+                           &address_space_memory);
+
+    return;
+}
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 7851326988..0695c93d2c 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -56,7 +56,6 @@
 #include "sysemu/device_tree.h"
 #include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
 
 #include <libfdt.h>
 
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index c107bf3ba1..a8a0588824 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -41,9 +41,6 @@
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
-
-#include <libfdt.h>
 
 #if defined(TARGET_RISCV32)
 # define BIOS_FILENAME "opensbi-riscv32-spike-fw_jump.elf"
@@ -165,7 +162,6 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
-    int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
     /* Initialize SOC */
@@ -212,40 +208,9 @@ static void spike_board_init(MachineState *machine)
         }
     }
 
-    /* reset vector */
-    uint32_t reset_vec[8] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
-        0xf1402573,                  /*     csrr   a0, mhartid  */
-#if defined(TARGET_RISCV32)
-        0x0182a283,                  /*     lw     t0, 24(t0) */
-#elif defined(TARGET_RISCV64)
-        0x0182b283,                  /*     ld     t0, 24(t0) */
-#endif
-        0x00028067,                  /*     jr     t0 */
-        0x00000000,
-        memmap[SPIKE_DRAM].base,     /* start: .dword DRAM_BASE */
-        0x00000000,
-                                     /* dtb: */
-    };
-
-    /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
-        reset_vec[i] = cpu_to_le32(reset_vec[i]);
-    }
-    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[SPIKE_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[SPIKE_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[SPIKE_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
+    /* load the reset vector */
+    riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
+                              memmap[SPIKE_MROM].size, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
     htif_mm_init(system_memory, mask_rom, &s->soc.harts[0].env, serial_hd(0));
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 18283e262e..3463cf54aa 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -39,12 +39,9 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
-#include "exec/address-spaces.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/gpex.h"
 
-#include <libfdt.h>
-
 #if defined(TARGET_RISCV32)
 # define BIOS_FILENAME "opensbi-riscv32-virt-fw_jump.bin"
 #else
@@ -535,40 +532,9 @@ static void virt_machine_init(MachineState *machine)
         start_addr = virt_memmap[VIRT_FLASH].base;
     }
 
-    /* reset vector */
-    uint32_t reset_vec[8] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
-        0xf1402573,                  /*     csrr   a0, mhartid  */
-#if defined(TARGET_RISCV32)
-        0x0182a283,                  /*     lw     t0, 24(t0) */
-#elif defined(TARGET_RISCV64)
-        0x0182b283,                  /*     ld     t0, 24(t0) */
-#endif
-        0x00028067,                  /*     jr     t0 */
-        0x00000000,
-        start_addr,                  /* start: .dword */
-        0x00000000,
-                                     /* dtb: */
-    };
-
-    /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
-        reset_vec[i] = cpu_to_le32(reset_vec[i]);
-    }
-    rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
-                          memmap[VIRT_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[VIRT_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[VIRT_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
+    /* load the reset vector */
+    riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
+                              virt_memmap[VIRT_MROM].size, s->fdt);
 
     /* create PLIC hart topology configuration string */
     plic_hart_config_len = (strlen(VIRT_PLIC_HART_CONFIG) + 1) * smp_cpus;
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 9daa98da08..3e9759c89a 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -35,5 +35,7 @@ target_ulong riscv_load_kernel(const char *kernel_filename,
                                symbol_fn_t sym_cb);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
+void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
+                               hwaddr rom_size, void *fdt);
 
 #endif /* RISCV_BOOT_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16309.39926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4A-0001HJ-Hg; Fri, 30 Oct 2020 21:36:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16309.39926; Fri, 30 Oct 2020 21:36:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4A-0001HB-E3; Fri, 30 Oct 2020 21:36:10 +0000
Received: by outflank-mailman (input) for mailman id 16309;
 Fri, 30 Oct 2020 21:36:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc48-0001H0-Rh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f340b021-5408-4fe8-9a2f-d7dd46f8cc08;
 Fri, 30 Oct 2020 21:36:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc47-0003Us-9f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc47-0008OY-7l
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc48-0001H0-Rh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:08 +0000
X-Inumbo-ID: f340b021-5408-4fe8-9a2f-d7dd46f8cc08
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f340b021-5408-4fe8-9a2f-d7dd46f8cc08;
	Fri, 30 Oct 2020 21:36:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pDri6Gs0rXK6AvzTK52IL9wUvPu2SbGpOEmHNYPhcFQ=; b=byJAcJJmAiujS8G6xJuAtthTUY
	Pmj9Ua5bIbLTmt0TgSB9R/raNpkbb9bkq1ct5i6Du98IwvJ5WiHI0iuioVI/AUguogdT4UaD12qFC
	bFQ1Zy+qDneG2Sz+3qhmBlG5mcNKJBc8Hm+A+3AKngj4kNe3ZYUenItZQ4+jZOr6YTds=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc47-0003Us-9f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc47-0008OY-7l
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] RISC-V: Copy the fdt in dram instead of ROM
Message-Id: <E1kYc47-0008OY-7l@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:07 +0000

commit 66b1205bc5ab8bb3f5e12fa4155bbeb56e6724e9
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:47 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    RISC-V: Copy the fdt in dram instead of ROM
    
    Currently, the fdt is copied to the ROM after the reset vector. The firmware
    has to copy it to DRAM. Instead of this, directly copy the device tree to a
    pre-computed dram address. The device tree load address should be as far as
    possible from kernel and initrd images. That's why it is kept at the end of
    the DRAM or 4GB whichever is lesser.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-3-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c         | 53 +++++++++++++++++++++++++++++++++++--------------
 hw/riscv/sifive_u.c     | 28 ++++++++++++--------------
 hw/riscv/spike.c        |  7 ++++++-
 hw/riscv/virt.c         |  7 ++++++-
 include/hw/riscv/boot.h |  4 +++-
 5 files changed, 66 insertions(+), 33 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 3df802380a..c62f545f15 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -159,45 +159,68 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
     return *start + size;
 }
 
+uint32_t riscv_load_fdt(hwaddr dram_base, uint64_t mem_size, void *fdt)
+{
+    uint32_t temp, fdt_addr;
+    hwaddr dram_end = dram_base + mem_size;
+    int fdtsize = fdt_totalsize(fdt);
+
+    if (fdtsize <= 0) {
+        error_report("invalid device-tree");
+        exit(1);
+    }
+
+    /*
+     * We should put fdt as far as possible to avoid kernel/initrd overwriting
+     * its content. But it should be addressable by 32 bit system as well.
+     * Thus, put it at an aligned address that less than fdt size from end of
+     * dram or 4GB whichever is lesser.
+     */
+    temp = MIN(dram_end, 4096 * MiB);
+    fdt_addr = QEMU_ALIGN_DOWN(temp - fdtsize, 2 * MiB);
+
+    fdt_pack(fdt);
+    /* copy in the device tree */
+    qemu_fdt_dumpdtb(fdt, fdtsize);
+
+    rom_add_blob_fixed_as("fdt", fdt, fdtsize, fdt_addr,
+                          &address_space_memory);
+
+    return fdt_addr;
+}
+
 void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
-                               hwaddr rom_size, void *fdt)
+                               hwaddr rom_size,
+                               uint32_t fdt_load_addr, void *fdt)
 {
     int i;
 
     /* reset vector */
-    uint32_t reset_vec[8] = {
+    uint32_t reset_vec[10] = {
         0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x02028593,                  /*     addi   a1, t0, %pcrel_lo(1b) */
         0xf1402573,                  /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
+        0x0202a583,                  /*     lw     a1, 32(t0) */
         0x0182a283,                  /*     lw     t0, 24(t0) */
 #elif defined(TARGET_RISCV64)
+        0x0202b583,                  /*     ld     a1, 32(t0) */
         0x0182b283,                  /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                  /*     jr     t0 */
         0x00000000,
         start_addr,                  /* start: .dword */
+        0x00000000,
+        fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
                                      /* dtb: */
     };
 
     /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+    for (i = 0; i < ARRAY_SIZE(reset_vec); i++) {
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           rom_base, &address_space_memory);
 
-    /* copy in the device tree */
-    if (fdt_pack(fdt) || fdt_totalsize(fdt) >
-        rom_size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(fdt, fdt_totalsize(fdt));
-    rom_add_blob_fixed_as("mrom.fdt", fdt, fdt_totalsize(fdt),
-                           rom_base + sizeof(reset_vec),
-                           &address_space_memory);
-
     return;
 }
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 0695c93d2c..39923209f4 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -379,6 +379,7 @@ static void sifive_u_machine_init(MachineState *machine)
     MemoryRegion *flash0 = g_new(MemoryRegion, 1);
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
     int i;
+    uint32_t fdt_load_addr;
 
     /* Initialize SoC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC);
@@ -450,40 +451,37 @@ static void sifive_u_machine_init(MachineState *machine)
         }
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DRAM].base,
+                                   machine->ram_size, s->fdt);
+
     /* reset vector */
-    uint32_t reset_vec[8] = {
+    uint32_t reset_vec[11] = {
         s->msel,                       /* MSEL pin state */
         0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(dtb) */
-        0x01c28593,                    /*     addi   a1, t0, %pcrel_lo(1b) */
         0xf1402573,                    /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
+        0x0202a583,                    /*     lw     a1, 32(t0) */
         0x0182a283,                    /*     lw     t0, 24(t0) */
 #elif defined(TARGET_RISCV64)
-        0x0182e283,                    /*     lwu    t0, 24(t0) */
+        0x0202b583,                    /*     ld     a1, 32(t0) */
+        0x0182b283,                    /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                    /*     jr     t0 */
         0x00000000,
         start_addr,                    /* start: .dword */
+        0x00000000,
+        fdt_load_addr,                 /* fdt_laddr: .dword */
+        0x00000000,
                                        /* dtb: */
     };
 
     /* copy in the reset vector in little_endian byte order */
-    for (i = 0; i < sizeof(reset_vec) >> 2; i++) {
+    for (i = 0; i < ARRAY_SIZE(reset_vec); i++) {
         reset_vec[i] = cpu_to_le32(reset_vec[i]);
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           memmap[SIFIVE_U_MROM].base, &address_space_memory);
-
-    /* copy in the device tree */
-    if (fdt_pack(s->fdt) || fdt_totalsize(s->fdt) >
-            memmap[SIFIVE_U_MROM].size - sizeof(reset_vec)) {
-        error_report("not enough space to store device-tree");
-        exit(1);
-    }
-    qemu_fdt_dumpdtb(s->fdt, fdt_totalsize(s->fdt));
-    rom_add_blob_fixed_as("mrom.fdt", s->fdt, fdt_totalsize(s->fdt),
-                          memmap[SIFIVE_U_MROM].base + sizeof(reset_vec),
-                          &address_space_memory);
 }
 
 static bool sifive_u_machine_get_start_in_flash(Object *obj, Error **errp)
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index a8a0588824..13fa0455e3 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -163,6 +163,7 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     unsigned int smp_cpus = machine->smp.cpus;
+    uint32_t fdt_load_addr;
 
     /* Initialize SOC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc,
@@ -208,9 +209,13 @@ static void spike_board_init(MachineState *machine)
         }
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[SPIKE_DRAM].base,
+                                   machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
-                              memmap[SPIKE_MROM].size, s->fdt);
+                              memmap[SPIKE_MROM].size,
+                              fdt_load_addr, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
     htif_mm_init(system_memory, mask_rom, &s->soc.harts[0].env, serial_hd(0));
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3463cf54aa..9d87319f70 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -478,6 +478,7 @@ static void virt_machine_init(MachineState *machine)
     char *plic_hart_config;
     size_t plic_hart_config_len;
     target_ulong start_addr = memmap[VIRT_DRAM].base;
+    uint32_t fdt_load_addr;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
@@ -532,9 +533,13 @@ static void virt_machine_init(MachineState *machine)
         start_addr = virt_memmap[VIRT_FLASH].base;
     }
 
+    /* Compute the fdt load address in dram */
+    fdt_load_addr = riscv_load_fdt(memmap[VIRT_DRAM].base,
+                                   machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
-                              virt_memmap[VIRT_MROM].size, s->fdt);
+                              virt_memmap[VIRT_MROM].size,
+                              fdt_load_addr, s->fdt);
 
     /* create PLIC hart topology configuration string */
     plic_hart_config_len = (strlen(VIRT_PLIC_HART_CONFIG) + 1) * smp_cpus;
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 3e9759c89a..35b6ddf710 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -35,7 +35,9 @@ target_ulong riscv_load_kernel(const char *kernel_filename,
                                symbol_fn_t sym_cb);
 hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
+uint32_t riscv_load_fdt(hwaddr dram_start, uint64_t dram_size, void *fdt);
 void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
-                               hwaddr rom_size, void *fdt);
+                               hwaddr rom_size,
+                               uint32_t fdt_load_addr, void *fdt);
 
 #endif /* RISCV_BOOT_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16311.39930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4J-0001Il-K8; Fri, 30 Oct 2020 21:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16311.39930; Fri, 30 Oct 2020 21:36:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4J-0001Ie-HE; Fri, 30 Oct 2020 21:36:19 +0000
Received: by outflank-mailman (input) for mailman id 16311;
 Fri, 30 Oct 2020 21:36:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc4I-0001IX-Rr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e8e4a2e6-040f-4209-9687-8cc91121382e;
 Fri, 30 Oct 2020 21:36:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4H-0003Uz-Db
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4H-0008PV-Cg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc4I-0001IX-Rr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:18 +0000
X-Inumbo-ID: e8e4a2e6-040f-4209-9687-8cc91121382e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e8e4a2e6-040f-4209-9687-8cc91121382e;
	Fri, 30 Oct 2020 21:36:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fpr3X1+aO50vPLOU+waoKOpI0K8GP/nx/CAcC6xgkRU=; b=HZPEyMuuaHUL4WDx7/MWbPAdU2
	EmdYooDrzrkJUNoJTAQd7vBCjXQt5DW6GVZwHL+eEMP7V736ckD8DvsWSzkee/ZzwHPyTXZo+hWqz
	l/QYqKSfKbyw01iDx0OF+/eH/A8LvYlS+63XmlBS+rXvlvipPB1NKTqAlkj+JuZHKMgc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4H-0003Uz-Db
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4H-0008PV-Cg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] riscv: Add opensbi firmware dynamic support
Message-Id: <E1kYc4H-0008PV-Cg@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:17 +0000

commit dc144fe13d336caac2f03b57f1df738e84f984ec
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:48 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    riscv: Add opensbi firmware dynamic support
    
    OpenSBI is the default firmware in Qemu and has various firmware loading
    options. Currently, qemu loader uses fw_jump which has a compile time
    pre-defined address where fdt & kernel image must reside. This puts a
    constraint on image size of the Linux kernel depending on the fdt location
    and available memory. However, fw_dynamic allows the loader to specify
    the next stage location (i.e. Linux kernel/U-Boot) in memory and other
    configurable boot options available in OpenSBI.
    
    Add support for OpenSBI dynamic firmware loading support. This doesn't
    break existing setup and fw_jump will continue to work as it is. Any
    other firmware will continue to work without any issues as long as it
    doesn't expect anything specific from loader in "a2" register.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-4-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c                 | 42 ++++++++++++++++++++++++++---
 hw/riscv/sifive_u.c             | 20 ++++++++++----
 hw/riscv/spike.c                | 13 ++++++---
 hw/riscv/virt.c                 | 12 ++++++---
 include/hw/riscv/boot.h         |  5 +++-
 include/hw/riscv/boot_opensbi.h | 58 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 134 insertions(+), 16 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index c62f545f15..feff6e3f4e 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -25,6 +25,7 @@
 #include "hw/boards.h"
 #include "hw/loader.h"
 #include "hw/riscv/boot.h"
+#include "hw/riscv/boot_opensbi.h"
 #include "elf.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
@@ -33,8 +34,10 @@
 
 #if defined(TARGET_RISCV32)
 # define KERNEL_BOOT_ADDRESS 0x80400000
+#define fw_dynamic_info_data(__val)     cpu_to_le32(__val)
 #else
 # define KERNEL_BOOT_ADDRESS 0x80200000
+#define fw_dynamic_info_data(__val)     cpu_to_le64(__val)
 #endif
 
 void riscv_find_and_load_firmware(MachineState *machine,
@@ -189,15 +192,45 @@ uint32_t riscv_load_fdt(hwaddr dram_base, uint64_t mem_size, void *fdt)
     return fdt_addr;
 }
 
+void riscv_rom_copy_firmware_info(hwaddr rom_base, hwaddr rom_size,
+                              uint32_t reset_vec_size, uint64_t kernel_entry)
+{
+    struct fw_dynamic_info dinfo;
+    size_t dinfo_len;
+
+    dinfo.magic = fw_dynamic_info_data(FW_DYNAMIC_INFO_MAGIC_VALUE);
+    dinfo.version = fw_dynamic_info_data(FW_DYNAMIC_INFO_VERSION);
+    dinfo.next_mode = fw_dynamic_info_data(FW_DYNAMIC_INFO_NEXT_MODE_S);
+    dinfo.next_addr = fw_dynamic_info_data(kernel_entry);
+    dinfo.options = 0;
+    dinfo.boot_hart = 0;
+    dinfo_len = sizeof(dinfo);
+
+    /**
+     * copy the dynamic firmware info. This information is specific to
+     * OpenSBI but doesn't break any other firmware as long as they don't
+     * expect any certain value in "a2" register.
+     */
+    if (dinfo_len > (rom_size - reset_vec_size)) {
+        error_report("not enough space to store dynamic firmware info");
+        exit(1);
+    }
+
+    rom_add_blob_fixed_as("mrom.finfo", &dinfo, dinfo_len,
+                           rom_base + reset_vec_size,
+                           &address_space_memory);
+}
+
 void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
-                               hwaddr rom_size,
+                               hwaddr rom_size, uint64_t kernel_entry,
                                uint32_t fdt_load_addr, void *fdt)
 {
     int i;
 
     /* reset vector */
     uint32_t reset_vec[10] = {
-        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
+        0x02828613,                  /*     addi   a2, t0, %pcrel_lo(1b) */
         0xf1402573,                  /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
         0x0202a583,                  /*     lw     a1, 32(t0) */
@@ -207,12 +240,11 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
         0x0182b283,                  /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                  /*     jr     t0 */
-        0x00000000,
         start_addr,                  /* start: .dword */
         0x00000000,
         fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
-                                     /* dtb: */
+                                     /* fw_dyn: */
     };
 
     /* copy in the reset vector in little_endian byte order */
@@ -221,6 +253,8 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           rom_base, &address_space_memory);
+    riscv_rom_copy_firmware_info(rom_base, rom_size, sizeof(reset_vec),
+                                 kernel_entry);
 
     return;
 }
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 39923209f4..46e6ed90ca 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -380,6 +380,7 @@ static void sifive_u_machine_init(MachineState *machine)
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
     int i;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
 
     /* Initialize SoC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC);
@@ -436,8 +437,7 @@ static void sifive_u_machine_init(MachineState *machine)
     riscv_find_and_load_firmware(machine, BIOS_FILENAME, start_addr, NULL);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  NULL);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename, NULL);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -449,6 +449,12 @@ static void sifive_u_machine_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     /* Compute the fdt load address in dram */
@@ -458,7 +464,8 @@ static void sifive_u_machine_init(MachineState *machine)
     /* reset vector */
     uint32_t reset_vec[11] = {
         s->msel,                       /* MSEL pin state */
-        0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(dtb) */
+        0x00000297,                    /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
+        0x02828613,                    /*     addi   a2, t0, %pcrel_lo(1b) */
         0xf1402573,                    /*     csrr   a0, mhartid  */
 #if defined(TARGET_RISCV32)
         0x0202a583,                    /*     lw     a1, 32(t0) */
@@ -468,12 +475,11 @@ static void sifive_u_machine_init(MachineState *machine)
         0x0182b283,                    /*     ld     t0, 24(t0) */
 #endif
         0x00028067,                    /*     jr     t0 */
-        0x00000000,
         start_addr,                    /* start: .dword */
         0x00000000,
         fdt_load_addr,                 /* fdt_laddr: .dword */
         0x00000000,
-                                       /* dtb: */
+                                       /* fw_dyn: */
     };
 
     /* copy in the reset vector in little_endian byte order */
@@ -482,6 +488,10 @@ static void sifive_u_machine_init(MachineState *machine)
     }
     rom_add_blob_fixed_as("mrom.reset", reset_vec, sizeof(reset_vec),
                           memmap[SIFIVE_U_MROM].base, &address_space_memory);
+
+    riscv_rom_copy_firmware_info(memmap[SIFIVE_U_MROM].base,
+                                 memmap[SIFIVE_U_MROM].size,
+                                 sizeof(reset_vec), kernel_entry);
 }
 
 static bool sifive_u_machine_get_start_in_flash(Object *obj, Error **errp)
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 13fa0455e3..b17d96aec7 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -164,6 +164,7 @@ static void spike_board_init(MachineState *machine)
     MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
     unsigned int smp_cpus = machine->smp.cpus;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
 
     /* Initialize SOC */
     object_initialize_child(OBJECT(machine), "soc", &s->soc,
@@ -194,8 +195,8 @@ static void spike_board_init(MachineState *machine)
                                  htif_symbol_callback);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  htif_symbol_callback);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename,
+                                         htif_symbol_callback);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -207,6 +208,12 @@ static void spike_board_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     /* Compute the fdt load address in dram */
@@ -214,7 +221,7 @@ static void spike_board_init(MachineState *machine)
                                    machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(memmap[SPIKE_DRAM].base, memmap[SPIKE_MROM].base,
-                              memmap[SPIKE_MROM].size,
+                              memmap[SPIKE_MROM].size, kernel_entry,
                               fdt_load_addr, s->fdt);
 
     /* initialize HTIF using symbols found in load_kernel */
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 9d87319f70..bc25ec69f7 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -479,6 +479,7 @@ static void virt_machine_init(MachineState *machine)
     size_t plic_hart_config_len;
     target_ulong start_addr = memmap[VIRT_DRAM].base;
     uint32_t fdt_load_addr;
+    uint64_t kernel_entry;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
 
@@ -510,8 +511,7 @@ static void virt_machine_init(MachineState *machine)
                                  memmap[VIRT_DRAM].base, NULL);
 
     if (machine->kernel_filename) {
-        uint64_t kernel_entry = riscv_load_kernel(machine->kernel_filename,
-                                                  NULL);
+        kernel_entry = riscv_load_kernel(machine->kernel_filename, NULL);
 
         if (machine->initrd_filename) {
             hwaddr start;
@@ -523,6 +523,12 @@ static void virt_machine_init(MachineState *machine)
             qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end",
                                   end);
         }
+    } else {
+       /*
+        * If dynamic firmware is used, it doesn't know where is the next mode
+        * if kernel argument is not set.
+        */
+        kernel_entry = 0;
     }
 
     if (drive_get(IF_PFLASH, 0, 0)) {
@@ -538,7 +544,7 @@ static void virt_machine_init(MachineState *machine)
                                    machine->ram_size, s->fdt);
     /* load the reset vector */
     riscv_setup_rom_reset_vec(start_addr, virt_memmap[VIRT_MROM].base,
-                              virt_memmap[VIRT_MROM].size,
+                              virt_memmap[VIRT_MROM].size, kernel_entry,
                               fdt_load_addr, s->fdt);
 
     /* create PLIC hart topology configuration string */
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 35b6ddf710..451338780a 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -37,7 +37,10 @@ hwaddr riscv_load_initrd(const char *filename, uint64_t mem_size,
                          uint64_t kernel_entry, hwaddr *start);
 uint32_t riscv_load_fdt(hwaddr dram_start, uint64_t dram_size, void *fdt);
 void riscv_setup_rom_reset_vec(hwaddr saddr, hwaddr rom_base,
-                               hwaddr rom_size,
+                               hwaddr rom_size, uint64_t kernel_entry,
                                uint32_t fdt_load_addr, void *fdt);
+void riscv_rom_copy_firmware_info(hwaddr rom_base, hwaddr rom_size,
+                                  uint32_t reset_vec_size,
+                                  uint64_t kernel_entry);
 
 #endif /* RISCV_BOOT_H */
diff --git a/include/hw/riscv/boot_opensbi.h b/include/hw/riscv/boot_opensbi.h
new file mode 100644
index 0000000000..0d5ddd6c3d
--- /dev/null
+++ b/include/hw/riscv/boot_opensbi.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+/*
+ * Copyright (c) 2019 Western Digital Corporation or its affiliates.
+ *
+ * Based on include/sbi/{fw_dynamic.h,sbi_scratch.h} from the OpenSBI project.
+ */
+#ifndef OPENSBI_H
+#define OPENSBI_H
+
+/** Expected value of info magic ('OSBI' ascii string in hex) */
+#define FW_DYNAMIC_INFO_MAGIC_VALUE     0x4942534f
+
+/** Maximum supported info version */
+#define FW_DYNAMIC_INFO_VERSION         0x2
+
+/** Possible next mode values */
+#define FW_DYNAMIC_INFO_NEXT_MODE_U     0x0
+#define FW_DYNAMIC_INFO_NEXT_MODE_S     0x1
+#define FW_DYNAMIC_INFO_NEXT_MODE_M     0x3
+
+enum sbi_scratch_options {
+    /** Disable prints during boot */
+    SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
+    /** Enable runtime debug prints */
+    SBI_SCRATCH_DEBUG_PRINTS = (1 << 1),
+};
+
+/** Representation dynamic info passed by previous booting stage */
+struct fw_dynamic_info {
+    /** Info magic */
+    target_long magic;
+    /** Info version */
+    target_long version;
+    /** Next booting stage address */
+    target_long next_addr;
+    /** Next booting stage mode */
+    target_long next_mode;
+    /** Options for OpenSBI library */
+    target_long options;
+    /**
+     * Preferred boot HART id
+     *
+     * It is possible that the previous booting stage uses same link
+     * address as the FW_DYNAMIC firmware. In this case, the relocation
+     * lottery mechanism can potentially overwrite the previous booting
+     * stage while other HARTs are still running in the previous booting
+     * stage leading to boot-time crash. To avoid this boot-time crash,
+     * the previous booting stage can specify last HART that will jump
+     * to the FW_DYNAMIC firmware as the preferred boot HART.
+     *
+     * To avoid specifying a preferred boot HART, the previous booting
+     * stage can set it to -1UL which will force the FW_DYNAMIC firmware
+     * to use the relocation lottery mechanism.
+     */
+    target_long boot_hart;
+};
+
+#endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16312.39934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4T-0001K7-Lw; Fri, 30 Oct 2020 21:36:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16312.39934; Fri, 30 Oct 2020 21:36:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4T-0001Jz-J3; Fri, 30 Oct 2020 21:36:29 +0000
Received: by outflank-mailman (input) for mailman id 16312;
 Fri, 30 Oct 2020 21:36:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc4S-0001Jq-JY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0258972a-ef1e-4be9-9ad3-d8e156ab14fc;
 Fri, 30 Oct 2020 21:36:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4R-0003VB-HU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4R-0008QX-GZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc4S-0001Jq-JY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:28 +0000
X-Inumbo-ID: 0258972a-ef1e-4be9-9ad3-d8e156ab14fc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0258972a-ef1e-4be9-9ad3-d8e156ab14fc;
	Fri, 30 Oct 2020 21:36:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kuFE4XVxCLKyK2P2DftukEu+9QD6rHcyS5GeXATDw/k=; b=ra5kYp0er3sZoyFLFPWtem8R7A
	tk68Kb9Swo9LO5Dxe1AzoOs18a0o+ydJFDly6In68AS5FD+lp0fdoUG19PYGAcU1iBlaBk7jsNK4M
	bwHlKSnQfRKc4dt8WvWMQcI+tusYpmL2QlU25zB+fL3sp4SGgX2twqqGMLd/D6CgaLTc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4R-0003VB-HU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4R-0008QX-GZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] RISC-V: Support 64 bit start address
Message-Id: <E1kYc4R-0008QX-GZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:27 +0000

commit 8590f53661ec678fd3aa97b4da212b0c00056c2e
Author:     Atish Patra <atish.patra@wdc.com>
AuthorDate: Wed Jul 1 11:39:49 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    RISC-V: Support 64 bit start address
    
    Even though the start address in ROM code is declared as a 64 bit address
    for RV64, it can't be used as upper bits are set to zero in ROM code.
    
    Update the ROM code correctly to reflect the 64bit value.
    
    Signed-off-by: Atish Patra <atish.patra@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20200701183949.398134-5-atish.patra@wdc.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/boot.c     | 6 +++++-
 hw/riscv/sifive_u.c | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index feff6e3f4e..4c6c101ff1 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -226,7 +226,11 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
                                uint32_t fdt_load_addr, void *fdt)
 {
     int i;
+    uint32_t start_addr_hi32 = 0x00000000;
 
+    #if defined(TARGET_RISCV64)
+    start_addr_hi32 = start_addr >> 32;
+    #endif
     /* reset vector */
     uint32_t reset_vec[10] = {
         0x00000297,                  /* 1:  auipc  t0, %pcrel_hi(fw_dyn) */
@@ -241,7 +245,7 @@ void riscv_setup_rom_reset_vec(hwaddr start_addr, hwaddr rom_base,
 #endif
         0x00028067,                  /*     jr     t0 */
         start_addr,                  /* start: .dword */
-        0x00000000,
+        start_addr_hi32,
         fdt_load_addr,               /* fdt_laddr: .dword */
         0x00000000,
                                      /* fw_dyn: */
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 46e6ed90ca..6595ab3f87 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -378,6 +378,7 @@ static void sifive_u_machine_init(MachineState *machine)
     MemoryRegion *main_mem = g_new(MemoryRegion, 1);
     MemoryRegion *flash0 = g_new(MemoryRegion, 1);
     target_ulong start_addr = memmap[SIFIVE_U_DRAM].base;
+    uint32_t start_addr_hi32 = 0x00000000;
     int i;
     uint32_t fdt_load_addr;
     uint64_t kernel_entry;
@@ -460,6 +461,9 @@ static void sifive_u_machine_init(MachineState *machine)
     /* Compute the fdt load address in dram */
     fdt_load_addr = riscv_load_fdt(memmap[SIFIVE_U_DRAM].base,
                                    machine->ram_size, s->fdt);
+    #if defined(TARGET_RISCV64)
+    start_addr_hi32 = start_addr >> 32;
+    #endif
 
     /* reset vector */
     uint32_t reset_vec[11] = {
@@ -476,7 +480,7 @@ static void sifive_u_machine_init(MachineState *machine)
 #endif
         0x00028067,                    /*     jr     t0 */
         start_addr,                    /* start: .dword */
-        0x00000000,
+        start_addr_hi32,
         fdt_load_addr,                 /* fdt_laddr: .dword */
         0x00000000,
                                        /* fw_dyn: */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16313.39938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4d-0001M9-Na; Fri, 30 Oct 2020 21:36:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16313.39938; Fri, 30 Oct 2020 21:36:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4d-0001M1-Kc; Fri, 30 Oct 2020 21:36:39 +0000
Received: by outflank-mailman (input) for mailman id 16313;
 Fri, 30 Oct 2020 21:36:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc4c-0001LD-Ez
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7f35426a-7b17-457c-8e12-d1a0225a5002;
 Fri, 30 Oct 2020 21:36:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4b-0003Vm-LE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4b-0008RP-KS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc4c-0001LD-Ez
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:38 +0000
X-Inumbo-ID: 7f35426a-7b17-457c-8e12-d1a0225a5002
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7f35426a-7b17-457c-8e12-d1a0225a5002;
	Fri, 30 Oct 2020 21:36:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pQbg2SnK9zd8TNNtemGKMNA5ze+6Ct+5pNVRwa3wEbo=; b=33lbrR83EAsO7YMIZJBi77s6Qd
	f1lIyXqj9xYnZ9xuD2ALLX9WdseDeooWhcL1wgLf+TycSNdBG/gXns4+H6ktDNBDT1yi65OkQOoJD
	qd5LbZr4mroDsfg+vIMRN+H070juL1QHFWPQEZ/alngpqF2VwGus7VlAOef5XhLEMRu8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4b-0003Vm-LE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4b-0008RP-KS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/riscv: Modify MROM size to end at 0x10000
Message-Id: <E1kYc4b-0008RP-KS@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:37 +0000

commit 9eb8b14a70e57bc1449afc08aa4bf3131ee680d8
Author:     Bin Meng <bin.meng@windriver.com>
AuthorDate: Thu Jul 9 03:05:43 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/riscv: Modify MROM size to end at 0x10000
    
    At present the size of Mask ROM for sifive_u / spike / virt machines
    is set to 0x11000, which ends at an unusual address. This changes the
    size to 0xf000 so that it ends at 0x10000.
    
    Signed-off-by: Bin Meng <bin.meng@windriver.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <1594289144-24723-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_u.c | 2 +-
 hw/riscv/spike.c    | 2 +-
 hw/riscv/virt.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 6595ab3f87..19a976c9a6 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -70,7 +70,7 @@ static const struct MemmapEntry {
     hwaddr size;
 } sifive_u_memmap[] = {
     [SIFIVE_U_DEBUG] =    {        0x0,      0x100 },
-    [SIFIVE_U_MROM] =     {     0x1000,    0x11000 },
+    [SIFIVE_U_MROM] =     {     0x1000,     0xf000 },
     [SIFIVE_U_CLINT] =    {  0x2000000,    0x10000 },
     [SIFIVE_U_L2LIM] =    {  0x8000000,  0x2000000 },
     [SIFIVE_U_PLIC] =     {  0xc000000,  0x4000000 },
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index b17d96aec7..7b23a297fc 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -52,7 +52,7 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } spike_memmap[] = {
-    [SPIKE_MROM] =     {     0x1000,    0x11000 },
+    [SPIKE_MROM] =     {     0x1000,     0xf000 },
     [SPIKE_CLINT] =    {  0x2000000,    0x10000 },
     [SPIKE_DRAM] =     { 0x80000000,        0x0 },
 };
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index bc25ec69f7..55a907bb35 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -53,7 +53,7 @@ static const struct MemmapEntry {
     hwaddr size;
 } virt_memmap[] = {
     [VIRT_DEBUG] =       {        0x0,         0x100 },
-    [VIRT_MROM] =        {     0x1000,       0x11000 },
+    [VIRT_MROM] =        {     0x1000,        0xf000 },
     [VIRT_TEST] =        {   0x100000,        0x1000 },
     [VIRT_RTC] =         {   0x101000,        0x1000 },
     [VIRT_CLINT] =       {  0x2000000,       0x10000 },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16314.39942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4n-0001NM-PM; Fri, 30 Oct 2020 21:36:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16314.39942; Fri, 30 Oct 2020 21:36:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4n-0001NE-MM; Fri, 30 Oct 2020 21:36:49 +0000
Received: by outflank-mailman (input) for mailman id 16314;
 Fri, 30 Oct 2020 21:36:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc4m-0001N5-Os
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9eebecfb-f10a-47b6-a5ac-1d1f51381ece;
 Fri, 30 Oct 2020 21:36:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4l-0003Vu-P1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4l-0008SR-OG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc4m-0001N5-Os
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:48 +0000
X-Inumbo-ID: 9eebecfb-f10a-47b6-a5ac-1d1f51381ece
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9eebecfb-f10a-47b6-a5ac-1d1f51381ece;
	Fri, 30 Oct 2020 21:36:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nj7JDZwkX+c2/XozBNm2Xnvqeh6vASGsYrkFWF+rrdI=; b=U0ylQkRVKwAD9Gz9eP1csRu1Ei
	z97BH5J5PhKaZI5SuMBdeqhrtt+Q2x/fTedK5JJoyv6KyhpL2CmXoWAKfdfOUHPYMbhFTHn59pNt5
	a/k7eA/VJMIroLb66JizEkDOyfyQqy6iJ8BJt5GgeXqv5PyQ0ULMzWFwJyv+sLiK7kjw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4l-0003Vu-P1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4l-0008SR-OG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
Message-Id: <E1kYc4l-0008SR-OG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:47 +0000

commit 7acafcfa844fd93f5ff073077007627338bd6739
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:15 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
    
    gvec should provide vecop_list to avoid:
    "tcg_tcg_assert_listed_vecop: code should not be reached bug" assertion.
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-2-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index dc333e6a91..433cdacbe1 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -958,22 +958,27 @@ static void gen_rsub_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b)
 static void tcg_gen_gvec_rsubs(unsigned vece, uint32_t dofs, uint32_t aofs,
                                TCGv_i64 c, uint32_t oprsz, uint32_t maxsz)
 {
+    static const TCGOpcode vecop_list[] = { INDEX_op_sub_vec, 0 };
     static const GVecGen2s rsub_op[4] = {
         { .fni8 = gen_vec_rsub8_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs8,
+          .opt_opc = vecop_list,
           .vece = MO_8 },
         { .fni8 = gen_vec_rsub16_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs16,
+          .opt_opc = vecop_list,
           .vece = MO_16 },
         { .fni4 = gen_rsub_i32,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs32,
+          .opt_opc = vecop_list,
           .vece = MO_32 },
         { .fni8 = gen_rsub_i64,
           .fniv = gen_rsub_vec,
           .fno = gen_helper_vec_rsubs64,
+          .opt_opc = vecop_list,
           .prefer_i64 = TCG_TARGET_REG_BITS == 64,
           .vece = MO_64 },
     };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:36:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:36:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16315.39945 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4x-0001Op-SF; Fri, 30 Oct 2020 21:36:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16315.39945; Fri, 30 Oct 2020 21:36:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc4x-0001Oh-PH; Fri, 30 Oct 2020 21:36:59 +0000
Received: by outflank-mailman (input) for mailman id 16315;
 Fri, 30 Oct 2020 21:36:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc4w-0001OU-OL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1f5ae3eb-dd5f-45bf-8453-d6032f6075b8;
 Fri, 30 Oct 2020 21:36:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4v-0003W1-Sx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc4v-0008TO-S4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc4w-0001OU-OL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:58 +0000
X-Inumbo-ID: 1f5ae3eb-dd5f-45bf-8453-d6032f6075b8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1f5ae3eb-dd5f-45bf-8453-d6032f6075b8;
	Fri, 30 Oct 2020 21:36:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HQuJvwDsFFxycNcETnkadNwYjm47p/WVAtnGHKAGtc4=; b=fY3h5SpvSo93Ka75Mdd2padmU5
	JmNxgNvCQ7RuCowDbxADjpDpD3RCPAZTMX7WVjfVaZDtJSAD5ZnNvF5ILwPal8FlwB+P9FveRFlhb
	rz9nuzyHe/7G+toidJAK378nvTlxVWXQ+YkCg6RnSXnJsA9XqsPLpNyNDbGjIthDpKas=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4v-0003W1-Sx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc4v-0008TO-S4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:36:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
Message-Id: <E1kYc4v-0008TO-S4@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:36:57 +0000

commit 1989205c4e973bc7f9fac0ce0700993f30582538
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:16 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-3-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 433cdacbe1..7cd08f0868 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -937,7 +937,7 @@ static void gen_vec_rsub8_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b)
 
 static void gen_vec_rsub16_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b)
 {
-    tcg_gen_vec_sub8_i64(d, b, a);
+    tcg_gen_vec_sub16_i64(d, b, a);
 }
 
 static void gen_rsub_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:37:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:37:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16316.39951 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc57-0001Q9-UV; Fri, 30 Oct 2020 21:37:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16316.39951; Fri, 30 Oct 2020 21:37:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc57-0001Q1-Qo; Fri, 30 Oct 2020 21:37:09 +0000
Received: by outflank-mailman (input) for mailman id 16316;
 Fri, 30 Oct 2020 21:37:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc56-0001Pr-Q7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 41a55757-9a19-4948-aefb-044f085c1d04;
 Fri, 30 Oct 2020 21:37:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc56-0003WN-18
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc55-0008UM-W3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc56-0001Pr-Q7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:08 +0000
X-Inumbo-ID: 41a55757-9a19-4948-aefb-044f085c1d04
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 41a55757-9a19-4948-aefb-044f085c1d04;
	Fri, 30 Oct 2020 21:37:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IKjZAegXANC5vx00k/8naYJua2f6dxsoF7bT6uBgCKU=; b=HMb4662b5BvqMP1V599/RPbu4D
	vkQhg5opIuouJR6RD5hu2qpGm1WHCL40ZEdB5nvKB1iUW+SRn8X1VMUh8N+ZyGF51Jk0rsap/2ZlD
	45IgfI2fP+zGIp7c6lJPkn28P8QQnWwHXhHTugNss4yGgEn3Mv9aMi4muUukpSlqCxrI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc56-0003WN-18
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc55-0008UM-W3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: fix return value of do_opivx_widen()
Message-Id: <E1kYc55-0008UM-W3@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:07 +0000

commit a69f97c1110205bc173657c77ce2d16877cad683
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:17 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix return value of do_opivx_widen()
    
    do_opivx_widen() should return false if check function returns false.
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-4-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 7cd08f0868..c0b7375927 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -1151,7 +1151,7 @@ static bool do_opivx_widen(DisasContext *s, arg_rmrr *a,
     if (opivx_widen_check(s, a)) {
         return opivx_trans(a->rd, a->rs1, a->rs2, a->vm, fn, s);
     }
-    return true;
+    return false;
 }
 
 #define GEN_OPIVX_WIDEN_TRANS(NAME) \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:37:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:37:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16317.39954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5H-0001RR-VD; Fri, 30 Oct 2020 21:37:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16317.39954; Fri, 30 Oct 2020 21:37:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5H-0001RJ-SH; Fri, 30 Oct 2020 21:37:19 +0000
Received: by outflank-mailman (input) for mailman id 16317;
 Fri, 30 Oct 2020 21:37:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc5G-0001R8-Rz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6eac2680-35f3-4a23-94f4-802b93419d10;
 Fri, 30 Oct 2020 21:37:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5G-0003WY-4w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5G-0008VI-49
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc5G-0001R8-Rz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
X-Inumbo-ID: 6eac2680-35f3-4a23-94f4-802b93419d10
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6eac2680-35f3-4a23-94f4-802b93419d10;
	Fri, 30 Oct 2020 21:37:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s5+OKAsnrCVKfRWzRxhQiFdGfNci6bMnEZd6vnHLv7s=; b=oOzC+gLpPtaLJ8SDkthqwy/+9q
	G4eImMCt7QEOmxCN/MUfn/t05XnAVeSQWRzQj0xNgHdMuZnQe5AzUG6vsPEl+Bp4np65eCxZx79u7
	FkPUfVCd+NSEQhuJcBX/WxTjWLQ3KDaL5f8tc5RzB69ycZcJ2D/NdeVewn3O8bI8Fm0Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5G-0003WY-4w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5G-0008VI-49
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: fix vill bit index in vtype register
Message-Id: <E1kYc5G-0008VI-49@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:18 +0000

commit fbcbafa2c1c33ae6630e7717f7f4141befb5b31a
Author:     Frank Chang <frank.chang@sifive.com>
AuthorDate: Fri Jul 10 18:48:18 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: fix vill bit index in vtype register
    
    vill bit is at vtype[XLEN-1].
    
    Signed-off-by: Frank Chang <frank.chang@sifive.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200710104920.13550-5-frank.chang@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index eef20ca6e5..a804a5d0ba 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -98,7 +98,7 @@ FIELD(VTYPE, VLMUL, 0, 2)
 FIELD(VTYPE, VSEW, 2, 3)
 FIELD(VTYPE, VEDIV, 5, 2)
 FIELD(VTYPE, RESERVED, 7, sizeof(target_ulong) * 8 - 9)
-FIELD(VTYPE, VILL, sizeof(target_ulong) * 8 - 2, 1)
+FIELD(VTYPE, VILL, sizeof(target_ulong) * 8 - 1, 1)
 
 struct CPURISCVState {
     target_ulong gpr[32];
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:37:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:37:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16318.39958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5S-0001Sg-0V; Fri, 30 Oct 2020 21:37:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16318.39958; Fri, 30 Oct 2020 21:37:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5R-0001SY-Tp; Fri, 30 Oct 2020 21:37:29 +0000
Received: by outflank-mailman (input) for mailman id 16318;
 Fri, 30 Oct 2020 21:37:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc5R-0001ST-Cp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 376aa0f4-1d7b-4e78-9003-079ec03063d8;
 Fri, 30 Oct 2020 21:37:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5Q-0003Wj-9b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5Q-0008WE-7v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc5R-0001ST-Cp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:29 +0000
X-Inumbo-ID: 376aa0f4-1d7b-4e78-9003-079ec03063d8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 376aa0f4-1d7b-4e78-9003-079ec03063d8;
	Fri, 30 Oct 2020 21:37:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kysFfShMd8W0mPmFU0pYiQr8kbbbuOQcCU2ZVf3rmWs=; b=JJNnSKXMksJS9jJ3zHRtRVhbZW
	9VZ3NbDUepXroXtK2MUG2b5QbELAtz6rVOj8mOW9A0Ox0zdegPxvue/hw/kCZKbW3ETD+Avvq+4GK
	rNIHfQGYL7n7qfNhms2n0NPa/e8SO0ML6eSaZHYNxEg4kMoa74/E4JxFUKS9wPeDzgM4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5Q-0003Wj-9b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5Q-0008WE-7v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/char: Convert the Ibex UART to use the qdev Clock model
Message-Id: <E1kYc5Q-0008WE-7v@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:28 +0000

commit 940aabb9f47712da87182fee7163f1d3f7def36d
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Thu Jul 9 15:04:48 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/char: Convert the Ibex UART to use the qdev Clock model
    
    Conver the Ibex UART to use the recently added qdev-clock functions.
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com
    Message-Id: <b0136fad870a29049959ec161c1217b967d7e19d.1594332223.git.alistair.francis@wdc.com>
---
 hw/char/ibex_uart.c         | 30 +++++++++++++++++++++++++++---
 include/hw/char/ibex_uart.h |  3 +++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c
index 45cd724998..ab6247de89 100644
--- a/hw/char/ibex_uart.c
+++ b/hw/char/ibex_uart.c
@@ -28,6 +28,7 @@
 #include "qemu/osdep.h"
 #include "hw/char/ibex_uart.h"
 #include "hw/irq.h"
+#include "hw/qdev-clock.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
@@ -203,6 +204,17 @@ static void ibex_uart_reset(DeviceState *dev)
     ibex_uart_update_irqs(s);
 }
 
+static uint64_t ibex_uart_get_baud(IbexUartState *s)
+{
+    uint64_t baud;
+
+    baud = ((s->uart_ctrl & UART_CTRL_NCO) >> 16);
+    baud *= clock_get_hz(s->f_clk);
+    baud >>= 20;
+
+    return baud;
+}
+
 static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
                                        unsigned int size)
 {
@@ -329,9 +341,7 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
                           "%s: UART_CTRL_RXBLVL is not supported\n", __func__);
         }
         if (value & UART_CTRL_NCO) {
-            uint64_t baud = ((value & UART_CTRL_NCO) >> 16);
-            baud *= 1000;
-            baud >>= 20;
+            uint64_t baud = ibex_uart_get_baud(s);
 
             s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
         }
@@ -385,6 +395,16 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
     }
 }
 
+static void ibex_uart_clk_update(void *opaque)
+{
+    IbexUartState *s = opaque;
+
+    /* recompute uart's speed on clock change */
+    uint64_t baud = ibex_uart_get_baud(s);
+
+    s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
+}
+
 static void fifo_trigger_update(void *opaque)
 {
     IbexUartState *s = opaque;
@@ -444,6 +464,10 @@ static void ibex_uart_init(Object *obj)
 {
     IbexUartState *s = IBEX_UART(obj);
 
+    s->f_clk = qdev_init_clock_in(DEVICE(obj), "f_clock",
+                                  ibex_uart_clk_update, s);
+    clock_set_hz(s->f_clk, IBEX_UART_CLOCK);
+
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_watermark);
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->rx_watermark);
     sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->tx_empty);
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index 2bec772615..6d81051161 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -72,6 +72,7 @@
 #define IBEX_UART_TIMEOUT_CTRL 0x2c
 
 #define IBEX_UART_TX_FIFO_SIZE 16
+#define IBEX_UART_CLOCK 50000000 /* 50MHz clock */
 
 #define TYPE_IBEX_UART "ibex-uart"
 #define IBEX_UART(obj) \
@@ -101,6 +102,8 @@ typedef struct {
     uint32_t uart_val;
     uint32_t uart_timeout_ctrl;
 
+    Clock *f_clk;
+
     CharBackend chr;
     qemu_irq tx_watermark;
     qemu_irq rx_watermark;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:37:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:37:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16319.39961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5d-0001UW-2F; Fri, 30 Oct 2020 21:37:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16319.39961; Fri, 30 Oct 2020 21:37:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5c-0001UO-VP; Fri, 30 Oct 2020 21:37:40 +0000
Received: by outflank-mailman (input) for mailman id 16319;
 Fri, 30 Oct 2020 21:37:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc5b-0001UF-TT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7f0ef089-52fe-4284-912b-03926ca1ef09;
 Fri, 30 Oct 2020 21:37:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5a-0003Z0-Dd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5a-000073-Cp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc5b-0001UF-TT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:39 +0000
X-Inumbo-ID: 7f0ef089-52fe-4284-912b-03926ca1ef09
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7f0ef089-52fe-4284-912b-03926ca1ef09;
	Fri, 30 Oct 2020 21:37:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=q7P3F2QreUENkBW41oDRyPFhR1fpezAfZWytUnqHEJA=; b=At8YQ0ur1mQKQj/1Ff437YYdjD
	xskWwFDg6+/HXWNwX7Vmm5MAZ5l96EYu70R3A4zOt+lMtCpzbOzM3F5YX1DZ9vu3hfZAXNv9G3vN3
	HGSZCG8mPi81gLlEsKLkzBrigKGmDS2e370GdPvnlKvuH9x0VigMv/gNHga8PrxFCWD0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5a-0003Z0-Dd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5a-000073-Cp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/char: Convert the Ibex UART to use the registerfields API
Message-Id: <E1kYc5a-000073-Cp@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:38 +0000

commit 59093cc407cb044c72aa786006a07bd404eb36b9
Author:     Alistair Francis <alistair.francis@wdc.com>
AuthorDate: Thu Jul 9 15:04:51 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    hw/char: Convert the Ibex UART to use the registerfields API
    
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com
    Message-Id: <06372c9cdeec715077899e71c858d9f0a2a3395b.1594332223.git.alistair.francis@wdc.com>
---
 hw/char/ibex_uart.c         | 130 ++++++++++++++++++++++----------------------
 include/hw/char/ibex_uart.h |  76 ++++++++++++--------------
 2 files changed, 100 insertions(+), 106 deletions(-)

diff --git a/hw/char/ibex_uart.c b/hw/char/ibex_uart.c
index ab6247de89..cc49a35013 100644
--- a/hw/char/ibex_uart.c
+++ b/hw/char/ibex_uart.c
@@ -36,25 +36,25 @@
 
 static void ibex_uart_update_irqs(IbexUartState *s)
 {
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_TX_WATERMARK) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_TX_WATERMARK_MASK) {
         qemu_set_irq(s->tx_watermark, 1);
     } else {
         qemu_set_irq(s->tx_watermark, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_RX_WATERMARK) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_RX_WATERMARK_MASK) {
         qemu_set_irq(s->rx_watermark, 1);
     } else {
         qemu_set_irq(s->rx_watermark, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_TX_EMPTY) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_TX_EMPTY_MASK) {
         qemu_set_irq(s->tx_empty, 1);
     } else {
         qemu_set_irq(s->tx_empty, 0);
     }
 
-    if (s->uart_intr_state & s->uart_intr_enable & INTR_STATE_RX_OVERFLOW) {
+    if (s->uart_intr_state & s->uart_intr_enable & R_INTR_STATE_RX_OVERFLOW_MASK) {
         qemu_set_irq(s->rx_overflow, 1);
     } else {
         qemu_set_irq(s->rx_overflow, 0);
@@ -65,7 +65,7 @@ static int ibex_uart_can_receive(void *opaque)
 {
     IbexUartState *s = opaque;
 
-    if (s->uart_ctrl & UART_CTRL_RX_ENABLE) {
+    if (s->uart_ctrl & R_CTRL_RX_ENABLE_MASK) {
         return 1;
     }
 
@@ -75,16 +75,16 @@ static int ibex_uart_can_receive(void *opaque)
 static void ibex_uart_receive(void *opaque, const uint8_t *buf, int size)
 {
     IbexUartState *s = opaque;
-    uint8_t rx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_RXILVL)
-                            >> FIFO_CTRL_RXILVL_SHIFT;
+    uint8_t rx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_RXILVL_MASK)
+                            >> R_FIFO_CTRL_RXILVL_SHIFT;
 
     s->uart_rdata = *buf;
 
-    s->uart_status &= ~UART_STATUS_RXIDLE;
-    s->uart_status &= ~UART_STATUS_RXEMPTY;
+    s->uart_status &= ~R_STATUS_RXIDLE_MASK;
+    s->uart_status &= ~R_STATUS_RXEMPTY_MASK;
 
     if (size > rx_fifo_level) {
-        s->uart_intr_state |= INTR_STATE_RX_WATERMARK;
+        s->uart_intr_state |= R_INTR_STATE_RX_WATERMARK_MASK;
     }
 
     ibex_uart_update_irqs(s);
@@ -94,8 +94,8 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
                                void *opaque)
 {
     IbexUartState *s = opaque;
-    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_TXILVL)
-                            >> FIFO_CTRL_TXILVL_SHIFT;
+    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_TXILVL_MASK)
+                            >> R_FIFO_CTRL_TXILVL_SHIFT;
     int ret;
 
     /* instant drain the fifo when there's no back-end */
@@ -105,10 +105,10 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
     }
 
     if (!s->tx_level) {
-        s->uart_status &= ~UART_STATUS_TXFULL;
-        s->uart_status |= UART_STATUS_TXEMPTY;
-        s->uart_intr_state |= INTR_STATE_TX_EMPTY;
-        s->uart_intr_state &= ~INTR_STATE_TX_WATERMARK;
+        s->uart_status &= ~R_STATUS_TXFULL_MASK;
+        s->uart_status |= R_STATUS_TXEMPTY_MASK;
+        s->uart_intr_state |= R_INTR_STATE_TX_EMPTY_MASK;
+        s->uart_intr_state &= ~R_INTR_STATE_TX_WATERMARK_MASK;
         ibex_uart_update_irqs(s);
         return FALSE;
     }
@@ -131,18 +131,18 @@ static gboolean ibex_uart_xmit(GIOChannel *chan, GIOCondition cond,
 
     /* Clear the TX Full bit */
     if (s->tx_level != IBEX_UART_TX_FIFO_SIZE) {
-        s->uart_status &= ~UART_STATUS_TXFULL;
+        s->uart_status &= ~R_STATUS_TXFULL_MASK;
     }
 
     /* Disable the TX_WATERMARK IRQ */
     if (s->tx_level < tx_fifo_level) {
-        s->uart_intr_state &= ~INTR_STATE_TX_WATERMARK;
+        s->uart_intr_state &= ~R_INTR_STATE_TX_WATERMARK_MASK;
     }
 
     /* Set TX empty */
     if (s->tx_level == 0) {
-        s->uart_status |= UART_STATUS_TXEMPTY;
-        s->uart_intr_state |= INTR_STATE_TX_EMPTY;
+        s->uart_status |= R_STATUS_TXEMPTY_MASK;
+        s->uart_intr_state |= R_INTR_STATE_TX_EMPTY_MASK;
     }
 
     ibex_uart_update_irqs(s);
@@ -153,8 +153,8 @@ static void uart_write_tx_fifo(IbexUartState *s, const uint8_t *buf,
                                int size)
 {
     uint64_t current_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
-    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & FIFO_CTRL_TXILVL)
-                            >> FIFO_CTRL_TXILVL_SHIFT;
+    uint8_t tx_fifo_level = (s->uart_fifo_ctrl & R_FIFO_CTRL_TXILVL_MASK)
+                            >> R_FIFO_CTRL_TXILVL_SHIFT;
 
     if (size > IBEX_UART_TX_FIFO_SIZE - s->tx_level) {
         size = IBEX_UART_TX_FIFO_SIZE - s->tx_level;
@@ -165,16 +165,16 @@ static void uart_write_tx_fifo(IbexUartState *s, const uint8_t *buf,
     s->tx_level += size;
 
     if (s->tx_level > 0) {
-        s->uart_status &= ~UART_STATUS_TXEMPTY;
+        s->uart_status &= ~R_STATUS_TXEMPTY_MASK;
     }
 
     if (s->tx_level >= tx_fifo_level) {
-        s->uart_intr_state |= INTR_STATE_TX_WATERMARK;
+        s->uart_intr_state |= R_INTR_STATE_TX_WATERMARK_MASK;
         ibex_uart_update_irqs(s);
     }
 
     if (s->tx_level == IBEX_UART_TX_FIFO_SIZE) {
-        s->uart_status |= UART_STATUS_TXFULL;
+        s->uart_status |= R_STATUS_TXFULL_MASK;
     }
 
     timer_mod(s->fifo_trigger_handle, current_time +
@@ -208,7 +208,7 @@ static uint64_t ibex_uart_get_baud(IbexUartState *s)
 {
     uint64_t baud;
 
-    baud = ((s->uart_ctrl & UART_CTRL_NCO) >> 16);
+    baud = ((s->uart_ctrl & R_CTRL_NCO_MASK) >> 16);
     baud *= clock_get_hz(s->f_clk);
     baud >>= 20;
 
@@ -221,43 +221,43 @@ static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
     IbexUartState *s = opaque;
     uint64_t retvalue = 0;
 
-    switch (addr) {
-    case IBEX_UART_INTR_STATE:
+    switch (addr >> 2) {
+    case R_INTR_STATE:
         retvalue = s->uart_intr_state;
         break;
-    case IBEX_UART_INTR_ENABLE:
+    case R_INTR_ENABLE:
         retvalue = s->uart_intr_enable;
         break;
-    case IBEX_UART_INTR_TEST:
+    case R_INTR_TEST:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: wdata is write only\n", __func__);
         break;
 
-    case IBEX_UART_CTRL:
+    case R_CTRL:
         retvalue = s->uart_ctrl;
         break;
-    case IBEX_UART_STATUS:
+    case R_STATUS:
         retvalue = s->uart_status;
         break;
 
-    case IBEX_UART_RDATA:
+    case R_RDATA:
         retvalue = s->uart_rdata;
-        if (s->uart_ctrl & UART_CTRL_RX_ENABLE) {
+        if (s->uart_ctrl & R_CTRL_RX_ENABLE_MASK) {
             qemu_chr_fe_accept_input(&s->chr);
 
-            s->uart_status |= UART_STATUS_RXIDLE;
-            s->uart_status |= UART_STATUS_RXEMPTY;
+            s->uart_status |= R_STATUS_RXIDLE_MASK;
+            s->uart_status |= R_STATUS_RXEMPTY_MASK;
         }
         break;
-    case IBEX_UART_WDATA:
+    case R_WDATA:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: wdata is write only\n", __func__);
         break;
 
-    case IBEX_UART_FIFO_CTRL:
+    case R_FIFO_CTRL:
         retvalue = s->uart_fifo_ctrl;
         break;
-    case IBEX_UART_FIFO_STATUS:
+    case R_FIFO_STATUS:
         retvalue = s->uart_fifo_status;
 
         retvalue |= s->tx_level & 0x1F;
@@ -266,17 +266,17 @@ static uint64_t ibex_uart_read(void *opaque, hwaddr addr,
                       "%s: RX fifos are not supported\n", __func__);
         break;
 
-    case IBEX_UART_OVRD:
+    case R_OVRD:
         retvalue = s->uart_ovrd;
         qemu_log_mask(LOG_UNIMP,
                       "%s: ovrd is not supported\n", __func__);
         break;
-    case IBEX_UART_VAL:
+    case R_VAL:
         retvalue = s->uart_val;
         qemu_log_mask(LOG_UNIMP,
                       "%s: val is not supported\n", __func__);
         break;
-    case IBEX_UART_TIMEOUT_CTRL:
+    case R_TIMEOUT_CTRL:
         retvalue = s->uart_timeout_ctrl;
         qemu_log_mask(LOG_UNIMP,
                       "%s: timeout_ctrl is not supported\n", __func__);
@@ -296,95 +296,95 @@ static void ibex_uart_write(void *opaque, hwaddr addr,
     IbexUartState *s = opaque;
     uint32_t value = val64;
 
-    switch (addr) {
-    case IBEX_UART_INTR_STATE:
+    switch (addr >> 2) {
+    case R_INTR_STATE:
         /* Write 1 clear */
         s->uart_intr_state &= ~value;
         ibex_uart_update_irqs(s);
         break;
-    case IBEX_UART_INTR_ENABLE:
+    case R_INTR_ENABLE:
         s->uart_intr_enable = value;
         ibex_uart_update_irqs(s);
         break;
-    case IBEX_UART_INTR_TEST:
+    case R_INTR_TEST:
         s->uart_intr_state |= value;
         ibex_uart_update_irqs(s);
         break;
 
-    case IBEX_UART_CTRL:
+    case R_CTRL:
         s->uart_ctrl = value;
 
-        if (value & UART_CTRL_NF) {
+        if (value & R_CTRL_NF_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_NF is not supported\n", __func__);
         }
-        if (value & UART_CTRL_SLPBK) {
+        if (value & R_CTRL_SLPBK_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_SLPBK is not supported\n", __func__);
         }
-        if (value & UART_CTRL_LLPBK) {
+        if (value & R_CTRL_LLPBK_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_LLPBK is not supported\n", __func__);
         }
-        if (value & UART_CTRL_PARITY_EN) {
+        if (value & R_CTRL_PARITY_EN_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_PARITY_EN is not supported\n",
                           __func__);
         }
-        if (value & UART_CTRL_PARITY_ODD) {
+        if (value & R_CTRL_PARITY_ODD_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_PARITY_ODD is not supported\n",
                           __func__);
         }
-        if (value & UART_CTRL_RXBLVL) {
+        if (value & R_CTRL_RXBLVL_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: UART_CTRL_RXBLVL is not supported\n", __func__);
         }
-        if (value & UART_CTRL_NCO) {
+        if (value & R_CTRL_NCO_MASK) {
             uint64_t baud = ibex_uart_get_baud(s);
 
             s->char_tx_time = (NANOSECONDS_PER_SECOND / baud) * 10;
         }
         break;
-    case IBEX_UART_STATUS:
+    case R_STATUS:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: status is read only\n", __func__);
         break;
 
-    case IBEX_UART_RDATA:
+    case R_RDATA:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: rdata is read only\n", __func__);
         break;
-    case IBEX_UART_WDATA:
+    case R_WDATA:
         uart_write_tx_fifo(s, (uint8_t *) &value, 1);
         break;
 
-    case IBEX_UART_FIFO_CTRL:
+    case R_FIFO_CTRL:
         s->uart_fifo_ctrl = value;
 
-        if (value & FIFO_CTRL_RXRST) {
+        if (value & R_FIFO_CTRL_RXRST_MASK) {
             qemu_log_mask(LOG_UNIMP,
                           "%s: RX fifos are not supported\n", __func__);
         }
-        if (value & FIFO_CTRL_TXRST) {
+        if (value & R_FIFO_CTRL_TXRST_MASK) {
             s->tx_level = 0;
         }
         break;
-    case IBEX_UART_FIFO_STATUS:
+    case R_FIFO_STATUS:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: fifo_status is read only\n", __func__);
         break;
 
-    case IBEX_UART_OVRD:
+    case R_OVRD:
         s->uart_ovrd = value;
         qemu_log_mask(LOG_UNIMP,
                       "%s: ovrd is not supported\n", __func__);
         break;
-    case IBEX_UART_VAL:
+    case R_VAL:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: val is read only\n", __func__);
         break;
-    case IBEX_UART_TIMEOUT_CTRL:
+    case R_TIMEOUT_CTRL:
         s->uart_timeout_ctrl = value;
         qemu_log_mask(LOG_UNIMP,
                       "%s: timeout_ctrl is not supported\n", __func__);
@@ -409,7 +409,7 @@ static void fifo_trigger_update(void *opaque)
 {
     IbexUartState *s = opaque;
 
-    if (s->uart_ctrl & UART_CTRL_TX_ENABLE) {
+    if (s->uart_ctrl & R_CTRL_TX_ENABLE_MASK) {
         ibex_uart_xmit(NULL, G_IO_OUT, s);
     }
 }
diff --git a/include/hw/char/ibex_uart.h b/include/hw/char/ibex_uart.h
index 6d81051161..b6bd5a6700 100644
--- a/include/hw/char/ibex_uart.h
+++ b/include/hw/char/ibex_uart.h
@@ -26,50 +26,44 @@
 #define HW_IBEX_UART_H
 
 #include "hw/sysbus.h"
+#include "hw/registerfields.h"
 #include "chardev/char-fe.h"
 #include "qemu/timer.h"
 
-#define IBEX_UART_INTR_STATE   0x00
-    #define INTR_STATE_TX_WATERMARK (1 << 0)
-    #define INTR_STATE_RX_WATERMARK (1 << 1)
-    #define INTR_STATE_TX_EMPTY     (1 << 2)
-    #define INTR_STATE_RX_OVERFLOW  (1 << 3)
-#define IBEX_UART_INTR_ENABLE  0x04
-#define IBEX_UART_INTR_TEST    0x08
-
-#define IBEX_UART_CTRL         0x0c
-    #define UART_CTRL_TX_ENABLE     (1 << 0)
-    #define UART_CTRL_RX_ENABLE     (1 << 1)
-    #define UART_CTRL_NF            (1 << 2)
-    #define UART_CTRL_SLPBK         (1 << 4)
-    #define UART_CTRL_LLPBK         (1 << 5)
-    #define UART_CTRL_PARITY_EN     (1 << 6)
-    #define UART_CTRL_PARITY_ODD    (1 << 7)
-    #define UART_CTRL_RXBLVL        (3 << 8)
-    #define UART_CTRL_NCO           (0xFFFF << 16)
-
-#define IBEX_UART_STATUS       0x10
-    #define UART_STATUS_TXFULL  (1 << 0)
-    #define UART_STATUS_RXFULL  (1 << 1)
-    #define UART_STATUS_TXEMPTY (1 << 2)
-    #define UART_STATUS_RXIDLE  (1 << 4)
-    #define UART_STATUS_RXEMPTY (1 << 5)
-
-#define IBEX_UART_RDATA        0x14
-#define IBEX_UART_WDATA        0x18
-
-#define IBEX_UART_FIFO_CTRL    0x1c
-    #define FIFO_CTRL_RXRST          (1 << 0)
-    #define FIFO_CTRL_TXRST          (1 << 1)
-    #define FIFO_CTRL_RXILVL         (7 << 2)
-    #define FIFO_CTRL_RXILVL_SHIFT   (2)
-    #define FIFO_CTRL_TXILVL         (3 << 5)
-    #define FIFO_CTRL_TXILVL_SHIFT   (5)
-
-#define IBEX_UART_FIFO_STATUS  0x20
-#define IBEX_UART_OVRD         0x24
-#define IBEX_UART_VAL          0x28
-#define IBEX_UART_TIMEOUT_CTRL 0x2c
+REG32(INTR_STATE, 0x00)
+    FIELD(INTR_STATE, TX_WATERMARK, 0, 1)
+    FIELD(INTR_STATE, RX_WATERMARK, 1, 1)
+    FIELD(INTR_STATE, TX_EMPTY, 2, 1)
+    FIELD(INTR_STATE, RX_OVERFLOW, 3, 1)
+REG32(INTR_ENABLE, 0x04)
+REG32(INTR_TEST, 0x08)
+REG32(CTRL, 0x0C)
+    FIELD(CTRL, TX_ENABLE, 0, 1)
+    FIELD(CTRL, RX_ENABLE, 1, 1)
+    FIELD(CTRL, NF, 2, 1)
+    FIELD(CTRL, SLPBK, 4, 1)
+    FIELD(CTRL, LLPBK, 5, 1)
+    FIELD(CTRL, PARITY_EN, 6, 1)
+    FIELD(CTRL, PARITY_ODD, 7, 1)
+    FIELD(CTRL, RXBLVL, 8, 2)
+    FIELD(CTRL, NCO, 16, 16)
+REG32(STATUS, 0x10)
+    FIELD(STATUS, TXFULL, 0, 1)
+    FIELD(STATUS, RXFULL, 1, 1)
+    FIELD(STATUS, TXEMPTY, 2, 1)
+    FIELD(STATUS, RXIDLE, 4, 1)
+    FIELD(STATUS, RXEMPTY, 5, 1)
+REG32(RDATA, 0x14)
+REG32(WDATA, 0x18)
+REG32(FIFO_CTRL, 0x1c)
+    FIELD(FIFO_CTRL, RXRST, 0, 1)
+    FIELD(FIFO_CTRL, TXRST, 1, 1)
+    FIELD(FIFO_CTRL, RXILVL, 2, 3)
+    FIELD(FIFO_CTRL, TXILVL, 5, 2)
+REG32(FIFO_STATUS, 0x20)
+REG32(OVRD, 0x24)
+REG32(VAL, 0x28)
+REG32(TIMEOUT_CTRL, 0x2c)
 
 #define IBEX_UART_TX_FIFO_SIZE 16
 #define IBEX_UART_CLOCK 50000000 /* 50MHz clock */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:37:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:37:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16320.39966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5n-0001Vv-5H; Fri, 30 Oct 2020 21:37:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16320.39966; Fri, 30 Oct 2020 21:37:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5n-0001Vn-25; Fri, 30 Oct 2020 21:37:51 +0000
Received: by outflank-mailman (input) for mailman id 16320;
 Fri, 30 Oct 2020 21:37:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc5l-0001VZ-Rr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7c3e772f-42ed-4f34-845a-c3ba78db5002;
 Fri, 30 Oct 2020 21:37:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5k-0003Z8-HS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5k-00008N-Gd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc5l-0001VZ-Rr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:49 +0000
X-Inumbo-ID: 7c3e772f-42ed-4f34-845a-c3ba78db5002
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7c3e772f-42ed-4f34-845a-c3ba78db5002;
	Fri, 30 Oct 2020 21:37:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rXxxsy2Bmq97rvjDo3E085yhfuMVYLD8QeMJ9m8TYVU=; b=fKYZV9jlpE96bEtn3vEhJRqu2K
	wzv1Nnm3SkRsfIk3QMo9uQGFor6ysRtMueBB285lIDeDvo8gGQ16D4KihIstn7EF9VOHfBO2SEwo5
	HwrblEQca5wyHjfh9TmVPFGp33MR5i+dsBtJtSJkUl+7vZPsOPm4Ur1RmVbse2pxDuDw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5k-0003Z8-HS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5k-00008N-Gd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tcg/riscv: Remove superfluous breaks
Message-Id: <E1kYc5k-00008N-Gd@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:48 +0000

commit 895bfa84fec27899bf8e8c17f46358d31df2ab4f
Author:     Liao Pingfang <liao.pingfang@zte.com.cn>
AuthorDate: Mon Jul 13 08:33:41 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    tcg/riscv: Remove superfluous breaks
    
    Remove superfluous breaks, as there is a "return" before them.
    
    Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
    Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1594600421-22942-1-git-send-email-wang.yi59@zte.com.cn>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 tcg/riscv/tcg-target.inc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c
index 2bc0ba71f2..3c11ab8b7a 100644
--- a/tcg/riscv/tcg-target.inc.c
+++ b/tcg/riscv/tcg-target.inc.c
@@ -502,10 +502,8 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type,
         break;
     case R_RISCV_JAL:
         return reloc_jimm20(code_ptr, (tcg_insn_unit *)value);
-        break;
     case R_RISCV_CALL:
         return reloc_call(code_ptr, (tcg_insn_unit *)value);
-        break;
     default:
         tcg_abort();
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16321.39970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5x-0001Yt-6V; Fri, 30 Oct 2020 21:38:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16321.39970; Fri, 30 Oct 2020 21:38:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc5x-0001Yl-3a; Fri, 30 Oct 2020 21:38:01 +0000
Received: by outflank-mailman (input) for mailman id 16321;
 Fri, 30 Oct 2020 21:37:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc5v-0001YV-HD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 318e20c3-c030-4b6b-9d2c-95526e6f0c7d;
 Fri, 30 Oct 2020 21:37:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5u-0003ZG-L8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc5u-00009O-KM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc5v-0001YV-HD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:59 +0000
X-Inumbo-ID: 318e20c3-c030-4b6b-9d2c-95526e6f0c7d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 318e20c3-c030-4b6b-9d2c-95526e6f0c7d;
	Fri, 30 Oct 2020 21:37:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VYZ/pUf10VHQX4GIUErXwtvsYgiHjUNp/qzYvnkGoPE=; b=wkvc+9D1qkiG2iewcC63T1NZco
	mrdAva+Y88giivxbozihcX+ZZfGI2ujaODcd6uxoMET03DlxnFIJ05MG0bpeJ9MQrXZbZcjo7PCuf
	dLbuPOsY0RVzzj4nIxzBrplqmLJjt+NB8aUGlskHDbpjXV429PHP0m/E0QK2Vu7vwFH8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5u-0003ZG-L8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc5u-00009O-KM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:37:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: Fix pmp NA4 implementation
Message-Id: <E1kYc5u-00009O-KM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:37:58 +0000

commit cfad709bceb629a4ebeb5d8a3acd1871b9a6436b
Author:     Alexandre Mergnat <amergnat@baylibre.com>
AuthorDate: Mon Jul 6 10:45:50 2020 +0200
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Mon Jul 13 17:25:37 2020 -0700

    target/riscv: Fix pmp NA4 implementation
    
    The end address calculation for NA4 mode is wrong because the address
    used isn't shifted.
    
    It doesn't watch 4 bytes but a huge range because the end address
    calculation is wrong.
    
    The solution is to use the shifted address calculated for start address
    variable.
    
    Modifications are tested on Zephyr OS userspace test suite which works
    for other RISC-V boards (E31 and E34 core).
    
    Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200706084550.24117-1-amergnat@baylibre.com
    Message-Id: <20200706084550.24117-1-amergnat@baylibre.com>
    [ Changes by AF:
     - Improve the commit title and message
    ]
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/pmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c
index 9418660f1b..2a2b9f5363 100644
--- a/target/riscv/pmp.c
+++ b/target/riscv/pmp.c
@@ -171,7 +171,7 @@ static void pmp_update_rule(CPURISCVState *env, uint32_t pmp_index)
 
     case PMP_AMATCH_NA4:
         sa = this_addr << 2; /* shift up from [xx:0] to [xx+2:2] */
-        ea = (this_addr + 4u) - 1u;
+        ea = (sa + 4u) - 1u;
         break;
 
     case PMP_AMATCH_NAPOT:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16322.39974 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc67-0001a4-8J; Fri, 30 Oct 2020 21:38:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16322.39974; Fri, 30 Oct 2020 21:38:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc67-0001Zw-5C; Fri, 30 Oct 2020 21:38:11 +0000
Received: by outflank-mailman (input) for mailman id 16322;
 Fri, 30 Oct 2020 21:38:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc66-0001Zn-8C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4050e08a-650c-4b02-ad67-5d86f3e3a90e;
 Fri, 30 Oct 2020 21:38:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc64-0003Za-PK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc64-0000AV-OS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc66-0001Zn-8C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:10 +0000
X-Inumbo-ID: 4050e08a-650c-4b02-ad67-5d86f3e3a90e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4050e08a-650c-4b02-ad67-5d86f3e3a90e;
	Fri, 30 Oct 2020 21:38:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PeRS3ycQt59pJH0GcUk6/6uEw7QDnxJO1/XrB1nkX+U=; b=BuUqhIcCFGXuqhw94v9SScwte/
	W0p92UYDKMZkKqWllUlmqL0WlIMOZp8/iiJ4hn1yPZdHVCv2kTF6kTGnSxlGIGVXAcmKOdYH5E2GH
	SCU5EX7HE+iJfEj+Fv2Nn/NEhyb/gR/+Tr6UQNgMg3mai/zgw6EFEJIPE6HcarfffeuM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc64-0003Za-PK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc64-0000AV-OS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200713' into staging
Message-Id: <E1kYc64-0000AV-OS@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:08 +0000

commit aeb07b5f6e69ce93afea71027325e3e7a22d2149
Merge: beff47a2f6a8295161f98a9dac94e18e5376e749 cfad709bceb629a4ebeb5d8a3acd1871b9a6436b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 17:58:00 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 17:58:00 2020 +0100

    Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200713' into staging
    
    This is a colection of bug fixes and small imrprovements for RISC-V.
    
    This includes some vector extensions fixes, a PMP bug fix, OpenTitan
    UART bug fix and support for OpenSBI dynamic firmware.
    
    # gpg: Signature made Tue 14 Jul 2020 01:29:44 BST
    # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
    # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
    # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
    
    * remotes/alistair/tags/pull-riscv-to-apply-20200713:
      target/riscv: Fix pmp NA4 implementation
      tcg/riscv: Remove superfluous breaks
      hw/char: Convert the Ibex UART to use the registerfields API
      hw/char: Convert the Ibex UART to use the qdev Clock model
      target/riscv: fix vill bit index in vtype register
      target/riscv: fix return value of do_opivx_widen()
      target/riscv: correct the gvec IR called in gen_vec_rsub16_i64()
      target/riscv: fix rsub gvec tcg_assert_listed_vecop assertion
      hw/riscv: Modify MROM size to end at 0x10000
      RISC-V: Support 64 bit start address
      riscv: Add opensbi firmware dynamic support
      RISC-V: Copy the fdt in dram instead of ROM
      riscv: Unify Qemu's reset vector code path
      hw/riscv: virt: Sort the SoC memmap table entries
      MAINTAINERS: Add an entry for OpenSBI firmware
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                             |   7 ++
 hw/char/ibex_uart.c                     | 158 ++++++++++++++++++--------------
 hw/riscv/boot.c                         | 107 +++++++++++++++++++++
 hw/riscv/sifive_u.c                     |  53 ++++++-----
 hw/riscv/spike.c                        |  59 ++++--------
 hw/riscv/virt.c                         |  63 ++++---------
 include/hw/char/ibex_uart.h             |  79 ++++++++--------
 include/hw/riscv/boot.h                 |   7 ++
 include/hw/riscv/boot_opensbi.h         |  58 ++++++++++++
 target/riscv/cpu.h                      |   2 +-
 target/riscv/insn_trans/trans_rvv.inc.c |   9 +-
 target/riscv/pmp.c                      |   2 +-
 tcg/riscv/tcg-target.inc.c              |   2 -
 13 files changed, 387 insertions(+), 219 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16323.39978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6H-0001bH-A8; Fri, 30 Oct 2020 21:38:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16323.39978; Fri, 30 Oct 2020 21:38:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6H-0001b6-6o; Fri, 30 Oct 2020 21:38:21 +0000
Received: by outflank-mailman (input) for mailman id 16323;
 Fri, 30 Oct 2020 21:38:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc6G-0001b1-Gi
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8669525f-dd73-45fe-bba4-eed9b0f1f226;
 Fri, 30 Oct 2020 21:38:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6F-0003Zi-C5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6F-0000Cp-Aj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc6G-0001b1-Gi
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:20 +0000
X-Inumbo-ID: 8669525f-dd73-45fe-bba4-eed9b0f1f226
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8669525f-dd73-45fe-bba4-eed9b0f1f226;
	Fri, 30 Oct 2020 21:38:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tY8+94DDIOyQiBxnC+beE1Ru8NCmo1V1X1HfuEwcCiM=; b=Pls3kpfKfp3K9bxiZMMP0SGEDI
	g5prqb3BRjIDylLetzm21LxsIoZxQtNkkOWBAJ8EySiD9/oKigyhYjsAjRH1Fw2yYmdppQcCuztls
	dVTZ+OqwXlZU/tvNPATm4FJPNhPmd+HVwbBzexigiu3JwdTt+oGv0B9MRI2OnHQmDRZE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6F-0003Zi-C5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6F-0000Cp-Aj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Simplify _filter_img_create() a bit
Message-Id: <E1kYc6F-0000Cp-Aj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:19 +0000

commit 4b196cd16dcfb17de19a4121f12aa4ef4bf7925f
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 9 13:02:05 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests: Simplify _filter_img_create() a bit
    
    Not only is it a bit stupid to try to filter multi-line "Formatting"
    output (because we only need it for a single test, which can easily be
    amended to no longer need it), it is also problematic when there can be
    output after a "Formatting" line that we do not want to filter as if it
    were part of it.
    
    So rename _filter_img_create to _do_filter_img_create, let it filter
    only a single line, and let _filter_img_create loop over all input
    lines, calling _do_filter_img_create only on those that match
    /^Formatting/ (basically, what _filter_img_create_in_qmp did already).
    (And fix 020 to work with that.)
    
    Reported-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200709110205.310942-1-mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/020           | 29 +++++++++++--------
 tests/qemu-iotests/020.out       | 13 +--------
 tests/qemu-iotests/141           |  2 +-
 tests/qemu-iotests/common.filter | 62 +++++++++++++++++-----------------------
 4 files changed, 45 insertions(+), 61 deletions(-)

diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index 20f8f185d0..b488000cb9 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -115,18 +115,23 @@ TEST_IMG="$TEST_IMG.base" _make_test_img 1M
 # Create an image with a null backing file to which committing will fail (with
 # ENOSPC so we can distinguish the result from some generic EIO which may be
 # generated anywhere in the block layer)
-_make_test_img -b "json:{'driver': '$IMGFMT',
-                         'file': {
-                             'driver': 'blkdebug',
-                             'inject-error': [{
-                                 'event': 'write_aio',
-                                 'errno': 28,
-                                 'once': true
-                             }],
-                             'image': {
-                                 'driver': 'file',
-                                 'filename': '$TEST_IMG.base'
-                             }}}"
+backing="json:{'driver': '$IMGFMT',
+               'file': {
+                   'driver': 'blkdebug',
+                   'inject-error': [{
+                       'event': 'write_aio',
+                       'errno': 28,
+                       'once': true
+                   }],
+                   'image': {
+                       'driver': 'file',
+                       'filename': '$TEST_IMG.base'
+                   }}}"
+
+# Filter out newlines and collapse spaces
+backing=$(echo "$backing" | tr -d '\n' | tr -s ' ')
+
+_make_test_img -b "$backing"
 
 # Just write anything so committing will not be a no-op
 $QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out
index 4b722b2dd0..4668ac59df 100644
--- a/tests/qemu-iotests/020.out
+++ b/tests/qemu-iotests/020.out
@@ -1079,18 +1079,7 @@ No errors were found on the image.
 Testing failing commit
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',,
-                         'file': {
-                             'driver': 'blkdebug',,
-                             'inject-error': [{
-                                 'event': 'write_aio',,
-                                 'errno': 28,,
-                                 'once': true
-                             }],,
-                             'image': {
-                                 'driver': 'file',,
-                                 'filename': 'TEST_DIR/t.IMGFMT.base'
-                             }}}
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}}
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Block job failed: No space left on device
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 6d1b7b0d4c..5192d256e3 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -68,7 +68,7 @@ test_blockjob()
     _send_qemu_cmd $QEMU_HANDLE \
         "$1" \
         "$2" \
-        | _filter_img_create_in_qmp | _filter_qmp_empty_return
+        | _filter_img_create | _filter_qmp_empty_return
 
     # We want this to return an error because the block job is still running
     _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index c9f978abce..9b772245cd 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -119,8 +119,21 @@ _filter_actual_image_size()
     $SED -s 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
 }
 
+# Filename filters for qemu-img create
+_filter_img_create_filenames()
+{
+    $SED \
+        -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
+        -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
+        -e "s#$TEST_DIR#TEST_DIR#g" \
+        -e "s#$SOCK_DIR#SOCK_DIR#g" \
+        -e "s#$IMGFMT#IMGFMT#g" \
+        -e 's#nbd:127.0.0.1:[0-9]\\+#TEST_DIR/t.IMGFMT#g' \
+        -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g'
+}
+
 # replace driver-specific options in the "Formatting..." line
-_filter_img_create()
+_do_filter_img_create()
 {
     # Split the line into the pre-options part ($filename_part, which
     # precedes ", fmt=") and the options part ($options, which starts
@@ -128,23 +141,10 @@ _filter_img_create()
     # (And just echo everything before the first "^Formatting")
     readarray formatting_line < <($SED -e 's/, fmt=/\n/')
 
-    filename_part=''
-    options=''
-    lines=${#formatting_line[@]}
-    for ((i = 0; i < $lines; i++)); do
-        line=${formatting_line[i]}
-        unset formatting_line[i]
-
-        filename_part="$filename_part$line"
+    filename_part=${formatting_line[0]}
+    unset formatting_line[0]
 
-        if echo "$line" | grep -q '^Formatting'; then
-            next_i=$((i + 1))
-            if [ -n "${formatting_line[next_i]}" ]; then
-                options="fmt=${formatting_line[@]}"
-            fi
-            break
-        fi
-    done
+    options="fmt=${formatting_line[@]}"
 
     # Set grep_data_file to '\|data_file' to keep it; make it empty
     # to drop it.
@@ -156,17 +156,7 @@ _filter_img_create()
         grep_data_file=()
     fi
 
-    filename_filters=(
-        -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \
-        -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
-        -e "s#$TEST_DIR#TEST_DIR#g" \
-        -e "s#$SOCK_DIR#SOCK_DIR#g" \
-        -e "s#$IMGFMT#IMGFMT#g" \
-        -e 's#nbd:127.0.0.1:[0-9]\\+#TEST_DIR/t.IMGFMT#g' \
-        -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g'
-    )
-
-    filename_part=$(echo "$filename_part" | $SED "${filename_filters[@]}")
+    filename_part=$(echo "$filename_part" | _filter_img_create_filenames)
 
     # Break the option line before each option (preserving pre-existing
     # line breaks by replacing them by \0 and restoring them at the end),
@@ -179,7 +169,8 @@ _filter_img_create()
         | $SED -e 's/ \([a-z0-9_.-]*\)=/\n\1=/g' \
         | grep -a -e '^fmt' -e '^size' -e '^backing' -e '^preallocation' \
                   -e '^encryption' "${grep_data_file[@]}" \
-        | $SED "${filename_filters[@]}" \
+        | _filter_img_create_filenames \
+        | $SED \
             -e 's/^\(fmt\)/0-\1/' \
             -e 's/^\(size\)/1-\1/' \
             -e 's/^\(backing\)/2-\1/' \
@@ -199,17 +190,16 @@ _filter_img_create()
     fi
 }
 
-# Filter the "Formatting..." line in QMP output (leaving the QMP output
-# untouched)
-# (In contrast to _filter_img_create(), this function does not support
-# multi-line Formatting output)
-_filter_img_create_in_qmp()
+# Filter qemu-img create output:
+# Pipe all ^Formatting lines through _do_filter_img_create, and all
+# other lines through _filter_img_create_filenames
+_filter_img_create()
 {
     while read -r line; do
         if echo "$line" | grep -q '^Formatting'; then
-            echo "$line" | _filter_img_create
+            echo "$line" | _do_filter_img_create
         else
-            echo "$line"
+            echo "$line" | _filter_img_create_filenames
         fi
     done
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16324.39982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6S-0001cf-Bb; Fri, 30 Oct 2020 21:38:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16324.39982; Fri, 30 Oct 2020 21:38:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6S-0001cX-8V; Fri, 30 Oct 2020 21:38:32 +0000
Received: by outflank-mailman (input) for mailman id 16324;
 Fri, 30 Oct 2020 21:38:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc6Q-0001cM-JU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f64a243b-d2ad-42e4-a473-49ebf6e2328c;
 Fri, 30 Oct 2020 21:38:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6P-0003Zq-HT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6P-0000DJ-FO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc6Q-0001cM-JU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:30 +0000
X-Inumbo-ID: f64a243b-d2ad-42e4-a473-49ebf6e2328c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f64a243b-d2ad-42e4-a473-49ebf6e2328c;
	Fri, 30 Oct 2020 21:38:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FhDGsi7IpRtRl1RwZoDWjNHxFbnkZrVuWLpIzL9pICI=; b=Yr3xxj8WbYdQVjMDdSMcvd6zvC
	m9zJlugaz3w0ZBwVQcEnZqfRmw5fK5hSrQM0NjcHlihg9svemRTQNV8JpvrMr8KpjK+fLbB2sO3Rd
	D1xv5w47KzXDlesiF7IU+MAOh4mC356emDRBnewf9PGeYCJ9LRYERrGUcqpqlqsGi71M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6P-0003Zq-HT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6P-0000DJ-FO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-img map: Don't limit block status request size
Message-Id: <E1kYc6P-0000DJ-FO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:29 +0000

commit d0ceea88dea053e0c1c038d42ca98782c2e3872d
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 7 16:46:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qemu-img map: Don't limit block status request size
    
    Limiting each loop iteration of qemu-img map to 1 GB was arbitrary from
    the beginning, though it only cut the maximum in half then because the
    interface was a signed 32 bit byte count. These days, bdrv_block_status
    supports a 64 bit byte count, so the arbitrary limit is even worse.
    
    On file-posix, bdrv_block_status() eventually maps to SEEK_HOLE and
    SEEK_DATA, which don't support a limit, but always do all of the work
    necessary to find the start of the next hole/data. Much of this work may
    be repeated if we don't use this information fully, but query with an
    only slightly larger offset in the next loop iteration. Therefore, if
    bdrv_block_status() is called in a loop, it should always pass the
    full number of bytes that the whole loop is interested in.
    
    This removes the arbitrary limit and speeds up 'qemu-img map'
    significantly on heavily fragmented images.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200707144629.51235-1-kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu-img.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 498fbf42fe..4548dbff82 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3210,12 +3210,9 @@ static int img_map(int argc, char **argv)
     curr.start = start_offset;
     while (curr.start + curr.length < length) {
         int64_t offset = curr.start + curr.length;
-        int64_t n;
+        int64_t n = length - offset;
 
-        /* Probe up to 1 GiB at a time.  */
-        n = MIN(1 * GiB, length - offset);
         ret = get_block_status(bs, offset, n, &next);
-
         if (ret < 0) {
             error_report("Could not read file metadata: %s", strerror(-ret));
             goto out;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16325.39985 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6f-0001eb-Dt; Fri, 30 Oct 2020 21:38:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16325.39985; Fri, 30 Oct 2020 21:38:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6f-0001eU-AJ; Fri, 30 Oct 2020 21:38:45 +0000
Received: by outflank-mailman (input) for mailman id 16325;
 Fri, 30 Oct 2020 21:38:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc6d-0001eO-QI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fcd84fce-468d-4881-9df5-b7afb64ce3fa;
 Fri, 30 Oct 2020 21:38:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6Z-0003aR-LF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6Z-0000Du-KQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc6d-0001eO-QI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:43 +0000
X-Inumbo-ID: fcd84fce-468d-4881-9df5-b7afb64ce3fa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fcd84fce-468d-4881-9df5-b7afb64ce3fa;
	Fri, 30 Oct 2020 21:38:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QQbGv6eZBNx3WifOMBGwv6EjITd2rjSRYVzXcObNtCo=; b=DsqgFofVOMZqKJCCHDgi6cd8Xp
	cl0SKKOOdYO9lfcaOGvlFJi1VR8MeySNxwoZeSvikJKTXZUxvw92MiX/mkHMsrRAQ6pmFEDbxmS/k
	zzyRXAneASNItp86PiSf+GTwasYktA8dv8YMq2elf0L5fiV3g6kwhpALZKCk29dtSQgY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6Z-0003aR-LF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6Z-0000Du-KQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/059: Filter out disk size with more standard filter
Message-Id: <E1kYc6Z-0000Du-KQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:39 +0000

commit 046e07ca556b3eb44ac5c64911b5bda204403113
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Mon Jul 13 15:45:37 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests/059: Filter out disk size with more standard filter
    
    The actual disk space used by an image can vary between filesystems and
    depending on other settings like an extent size hint. Replace the one
    call of "$QEMU_IMG info" and the associated one-off sed filter with the
    more standard "_img_info" and the standard filter from common.filter.
    
    Apart from turning "vmdk" into "IMGFMT" and changing the placeholder for
    cid fields, this only removes the "disk size" line.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/059     |    2 +-
 tests/qemu-iotests/059.out | 1009 ++++++++++++++++++++++----------------------
 2 files changed, 505 insertions(+), 506 deletions(-)

diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 4c90fc0363..dcc442be9f 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -82,7 +82,7 @@ _cleanup_test_img
 echo
 echo "=== Testing big twoGbMaxExtentFlat ==="
 _make_test_img -o "subformat=twoGbMaxExtentFlat" 1000G
-$QEMU_IMG info $TEST_IMG | _filter_testdir | sed -e 's/cid: [0-9]*/cid: XXXXXXXX/'
+_img_info --format-specific | _filter_img_info --format-specific
 _cleanup_test_img
 
 echo
diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out
index 39bf7e211d..6d127e28d8 100644
--- a/tests/qemu-iotests/059.out
+++ b/tests/qemu-iotests/059.out
@@ -24,2014 +24,2013 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
 
 === Testing big twoGbMaxExtentFlat ===
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824000
-image: TEST_DIR/t.vmdk
-file format: vmdk
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
 virtual size: 0.977 TiB (1073741824000 bytes)
-disk size: 1.97 MiB
 Format specific information:
-    cid: XXXXXXXX
-    parent cid: XXXXXXXX
+    cid: XXXXXXXXXX
+    parent cid: XXXXXXXXXX
     create type: twoGbMaxExtentFlat
     extents:
         [0]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f001.vmdk
+            filename: TEST_DIR/t-f001.IMGFMT
             format: FLAT
         [1]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f002.vmdk
+            filename: TEST_DIR/t-f002.IMGFMT
             format: FLAT
         [2]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f003.vmdk
+            filename: TEST_DIR/t-f003.IMGFMT
             format: FLAT
         [3]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f004.vmdk
+            filename: TEST_DIR/t-f004.IMGFMT
             format: FLAT
         [4]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f005.vmdk
+            filename: TEST_DIR/t-f005.IMGFMT
             format: FLAT
         [5]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f006.vmdk
+            filename: TEST_DIR/t-f006.IMGFMT
             format: FLAT
         [6]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f007.vmdk
+            filename: TEST_DIR/t-f007.IMGFMT
             format: FLAT
         [7]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f008.vmdk
+            filename: TEST_DIR/t-f008.IMGFMT
             format: FLAT
         [8]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f009.vmdk
+            filename: TEST_DIR/t-f009.IMGFMT
             format: FLAT
         [9]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f010.vmdk
+            filename: TEST_DIR/t-f010.IMGFMT
             format: FLAT
         [10]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f011.vmdk
+            filename: TEST_DIR/t-f011.IMGFMT
             format: FLAT
         [11]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f012.vmdk
+            filename: TEST_DIR/t-f012.IMGFMT
             format: FLAT
         [12]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f013.vmdk
+            filename: TEST_DIR/t-f013.IMGFMT
             format: FLAT
         [13]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f014.vmdk
+            filename: TEST_DIR/t-f014.IMGFMT
             format: FLAT
         [14]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f015.vmdk
+            filename: TEST_DIR/t-f015.IMGFMT
             format: FLAT
         [15]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f016.vmdk
+            filename: TEST_DIR/t-f016.IMGFMT
             format: FLAT
         [16]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f017.vmdk
+            filename: TEST_DIR/t-f017.IMGFMT
             format: FLAT
         [17]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f018.vmdk
+            filename: TEST_DIR/t-f018.IMGFMT
             format: FLAT
         [18]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f019.vmdk
+            filename: TEST_DIR/t-f019.IMGFMT
             format: FLAT
         [19]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f020.vmdk
+            filename: TEST_DIR/t-f020.IMGFMT
             format: FLAT
         [20]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f021.vmdk
+            filename: TEST_DIR/t-f021.IMGFMT
             format: FLAT
         [21]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f022.vmdk
+            filename: TEST_DIR/t-f022.IMGFMT
             format: FLAT
         [22]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f023.vmdk
+            filename: TEST_DIR/t-f023.IMGFMT
             format: FLAT
         [23]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f024.vmdk
+            filename: TEST_DIR/t-f024.IMGFMT
             format: FLAT
         [24]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f025.vmdk
+            filename: TEST_DIR/t-f025.IMGFMT
             format: FLAT
         [25]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f026.vmdk
+            filename: TEST_DIR/t-f026.IMGFMT
             format: FLAT
         [26]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f027.vmdk
+            filename: TEST_DIR/t-f027.IMGFMT
             format: FLAT
         [27]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f028.vmdk
+            filename: TEST_DIR/t-f028.IMGFMT
             format: FLAT
         [28]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f029.vmdk
+            filename: TEST_DIR/t-f029.IMGFMT
             format: FLAT
         [29]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f030.vmdk
+            filename: TEST_DIR/t-f030.IMGFMT
             format: FLAT
         [30]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f031.vmdk
+            filename: TEST_DIR/t-f031.IMGFMT
             format: FLAT
         [31]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f032.vmdk
+            filename: TEST_DIR/t-f032.IMGFMT
             format: FLAT
         [32]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f033.vmdk
+            filename: TEST_DIR/t-f033.IMGFMT
             format: FLAT
         [33]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f034.vmdk
+            filename: TEST_DIR/t-f034.IMGFMT
             format: FLAT
         [34]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f035.vmdk
+            filename: TEST_DIR/t-f035.IMGFMT
             format: FLAT
         [35]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f036.vmdk
+            filename: TEST_DIR/t-f036.IMGFMT
             format: FLAT
         [36]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f037.vmdk
+            filename: TEST_DIR/t-f037.IMGFMT
             format: FLAT
         [37]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f038.vmdk
+            filename: TEST_DIR/t-f038.IMGFMT
             format: FLAT
         [38]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f039.vmdk
+            filename: TEST_DIR/t-f039.IMGFMT
             format: FLAT
         [39]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f040.vmdk
+            filename: TEST_DIR/t-f040.IMGFMT
             format: FLAT
         [40]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f041.vmdk
+            filename: TEST_DIR/t-f041.IMGFMT
             format: FLAT
         [41]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f042.vmdk
+            filename: TEST_DIR/t-f042.IMGFMT
             format: FLAT
         [42]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f043.vmdk
+            filename: TEST_DIR/t-f043.IMGFMT
             format: FLAT
         [43]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f044.vmdk
+            filename: TEST_DIR/t-f044.IMGFMT
             format: FLAT
         [44]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f045.vmdk
+            filename: TEST_DIR/t-f045.IMGFMT
             format: FLAT
         [45]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f046.vmdk
+            filename: TEST_DIR/t-f046.IMGFMT
             format: FLAT
         [46]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f047.vmdk
+            filename: TEST_DIR/t-f047.IMGFMT
             format: FLAT
         [47]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f048.vmdk
+            filename: TEST_DIR/t-f048.IMGFMT
             format: FLAT
         [48]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f049.vmdk
+            filename: TEST_DIR/t-f049.IMGFMT
             format: FLAT
         [49]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f050.vmdk
+            filename: TEST_DIR/t-f050.IMGFMT
             format: FLAT
         [50]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f051.vmdk
+            filename: TEST_DIR/t-f051.IMGFMT
             format: FLAT
         [51]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f052.vmdk
+            filename: TEST_DIR/t-f052.IMGFMT
             format: FLAT
         [52]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f053.vmdk
+            filename: TEST_DIR/t-f053.IMGFMT
             format: FLAT
         [53]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f054.vmdk
+            filename: TEST_DIR/t-f054.IMGFMT
             format: FLAT
         [54]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f055.vmdk
+            filename: TEST_DIR/t-f055.IMGFMT
             format: FLAT
         [55]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f056.vmdk
+            filename: TEST_DIR/t-f056.IMGFMT
             format: FLAT
         [56]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f057.vmdk
+            filename: TEST_DIR/t-f057.IMGFMT
             format: FLAT
         [57]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f058.vmdk
+            filename: TEST_DIR/t-f058.IMGFMT
             format: FLAT
         [58]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f059.vmdk
+            filename: TEST_DIR/t-f059.IMGFMT
             format: FLAT
         [59]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f060.vmdk
+            filename: TEST_DIR/t-f060.IMGFMT
             format: FLAT
         [60]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f061.vmdk
+            filename: TEST_DIR/t-f061.IMGFMT
             format: FLAT
         [61]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f062.vmdk
+            filename: TEST_DIR/t-f062.IMGFMT
             format: FLAT
         [62]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f063.vmdk
+            filename: TEST_DIR/t-f063.IMGFMT
             format: FLAT
         [63]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f064.vmdk
+            filename: TEST_DIR/t-f064.IMGFMT
             format: FLAT
         [64]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f065.vmdk
+            filename: TEST_DIR/t-f065.IMGFMT
             format: FLAT
         [65]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f066.vmdk
+            filename: TEST_DIR/t-f066.IMGFMT
             format: FLAT
         [66]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f067.vmdk
+            filename: TEST_DIR/t-f067.IMGFMT
             format: FLAT
         [67]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f068.vmdk
+            filename: TEST_DIR/t-f068.IMGFMT
             format: FLAT
         [68]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f069.vmdk
+            filename: TEST_DIR/t-f069.IMGFMT
             format: FLAT
         [69]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f070.vmdk
+            filename: TEST_DIR/t-f070.IMGFMT
             format: FLAT
         [70]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f071.vmdk
+            filename: TEST_DIR/t-f071.IMGFMT
             format: FLAT
         [71]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f072.vmdk
+            filename: TEST_DIR/t-f072.IMGFMT
             format: FLAT
         [72]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f073.vmdk
+            filename: TEST_DIR/t-f073.IMGFMT
             format: FLAT
         [73]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f074.vmdk
+            filename: TEST_DIR/t-f074.IMGFMT
             format: FLAT
         [74]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f075.vmdk
+            filename: TEST_DIR/t-f075.IMGFMT
             format: FLAT
         [75]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f076.vmdk
+            filename: TEST_DIR/t-f076.IMGFMT
             format: FLAT
         [76]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f077.vmdk
+            filename: TEST_DIR/t-f077.IMGFMT
             format: FLAT
         [77]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f078.vmdk
+            filename: TEST_DIR/t-f078.IMGFMT
             format: FLAT
         [78]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f079.vmdk
+            filename: TEST_DIR/t-f079.IMGFMT
             format: FLAT
         [79]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f080.vmdk
+            filename: TEST_DIR/t-f080.IMGFMT
             format: FLAT
         [80]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f081.vmdk
+            filename: TEST_DIR/t-f081.IMGFMT
             format: FLAT
         [81]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f082.vmdk
+            filename: TEST_DIR/t-f082.IMGFMT
             format: FLAT
         [82]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f083.vmdk
+            filename: TEST_DIR/t-f083.IMGFMT
             format: FLAT
         [83]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f084.vmdk
+            filename: TEST_DIR/t-f084.IMGFMT
             format: FLAT
         [84]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f085.vmdk
+            filename: TEST_DIR/t-f085.IMGFMT
             format: FLAT
         [85]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f086.vmdk
+            filename: TEST_DIR/t-f086.IMGFMT
             format: FLAT
         [86]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f087.vmdk
+            filename: TEST_DIR/t-f087.IMGFMT
             format: FLAT
         [87]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f088.vmdk
+            filename: TEST_DIR/t-f088.IMGFMT
             format: FLAT
         [88]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f089.vmdk
+            filename: TEST_DIR/t-f089.IMGFMT
             format: FLAT
         [89]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f090.vmdk
+            filename: TEST_DIR/t-f090.IMGFMT
             format: FLAT
         [90]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f091.vmdk
+            filename: TEST_DIR/t-f091.IMGFMT
             format: FLAT
         [91]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f092.vmdk
+            filename: TEST_DIR/t-f092.IMGFMT
             format: FLAT
         [92]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f093.vmdk
+            filename: TEST_DIR/t-f093.IMGFMT
             format: FLAT
         [93]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f094.vmdk
+            filename: TEST_DIR/t-f094.IMGFMT
             format: FLAT
         [94]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f095.vmdk
+            filename: TEST_DIR/t-f095.IMGFMT
             format: FLAT
         [95]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f096.vmdk
+            filename: TEST_DIR/t-f096.IMGFMT
             format: FLAT
         [96]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f097.vmdk
+            filename: TEST_DIR/t-f097.IMGFMT
             format: FLAT
         [97]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f098.vmdk
+            filename: TEST_DIR/t-f098.IMGFMT
             format: FLAT
         [98]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f099.vmdk
+            filename: TEST_DIR/t-f099.IMGFMT
             format: FLAT
         [99]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f100.vmdk
+            filename: TEST_DIR/t-f100.IMGFMT
             format: FLAT
         [100]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f101.vmdk
+            filename: TEST_DIR/t-f101.IMGFMT
             format: FLAT
         [101]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f102.vmdk
+            filename: TEST_DIR/t-f102.IMGFMT
             format: FLAT
         [102]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f103.vmdk
+            filename: TEST_DIR/t-f103.IMGFMT
             format: FLAT
         [103]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f104.vmdk
+            filename: TEST_DIR/t-f104.IMGFMT
             format: FLAT
         [104]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f105.vmdk
+            filename: TEST_DIR/t-f105.IMGFMT
             format: FLAT
         [105]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f106.vmdk
+            filename: TEST_DIR/t-f106.IMGFMT
             format: FLAT
         [106]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f107.vmdk
+            filename: TEST_DIR/t-f107.IMGFMT
             format: FLAT
         [107]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f108.vmdk
+            filename: TEST_DIR/t-f108.IMGFMT
             format: FLAT
         [108]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f109.vmdk
+            filename: TEST_DIR/t-f109.IMGFMT
             format: FLAT
         [109]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f110.vmdk
+            filename: TEST_DIR/t-f110.IMGFMT
             format: FLAT
         [110]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f111.vmdk
+            filename: TEST_DIR/t-f111.IMGFMT
             format: FLAT
         [111]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f112.vmdk
+            filename: TEST_DIR/t-f112.IMGFMT
             format: FLAT
         [112]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f113.vmdk
+            filename: TEST_DIR/t-f113.IMGFMT
             format: FLAT
         [113]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f114.vmdk
+            filename: TEST_DIR/t-f114.IMGFMT
             format: FLAT
         [114]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f115.vmdk
+            filename: TEST_DIR/t-f115.IMGFMT
             format: FLAT
         [115]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f116.vmdk
+            filename: TEST_DIR/t-f116.IMGFMT
             format: FLAT
         [116]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f117.vmdk
+            filename: TEST_DIR/t-f117.IMGFMT
             format: FLAT
         [117]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f118.vmdk
+            filename: TEST_DIR/t-f118.IMGFMT
             format: FLAT
         [118]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f119.vmdk
+            filename: TEST_DIR/t-f119.IMGFMT
             format: FLAT
         [119]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f120.vmdk
+            filename: TEST_DIR/t-f120.IMGFMT
             format: FLAT
         [120]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f121.vmdk
+            filename: TEST_DIR/t-f121.IMGFMT
             format: FLAT
         [121]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f122.vmdk
+            filename: TEST_DIR/t-f122.IMGFMT
             format: FLAT
         [122]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f123.vmdk
+            filename: TEST_DIR/t-f123.IMGFMT
             format: FLAT
         [123]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f124.vmdk
+            filename: TEST_DIR/t-f124.IMGFMT
             format: FLAT
         [124]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f125.vmdk
+            filename: TEST_DIR/t-f125.IMGFMT
             format: FLAT
         [125]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f126.vmdk
+            filename: TEST_DIR/t-f126.IMGFMT
             format: FLAT
         [126]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f127.vmdk
+            filename: TEST_DIR/t-f127.IMGFMT
             format: FLAT
         [127]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f128.vmdk
+            filename: TEST_DIR/t-f128.IMGFMT
             format: FLAT
         [128]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f129.vmdk
+            filename: TEST_DIR/t-f129.IMGFMT
             format: FLAT
         [129]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f130.vmdk
+            filename: TEST_DIR/t-f130.IMGFMT
             format: FLAT
         [130]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f131.vmdk
+            filename: TEST_DIR/t-f131.IMGFMT
             format: FLAT
         [131]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f132.vmdk
+            filename: TEST_DIR/t-f132.IMGFMT
             format: FLAT
         [132]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f133.vmdk
+            filename: TEST_DIR/t-f133.IMGFMT
             format: FLAT
         [133]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f134.vmdk
+            filename: TEST_DIR/t-f134.IMGFMT
             format: FLAT
         [134]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f135.vmdk
+            filename: TEST_DIR/t-f135.IMGFMT
             format: FLAT
         [135]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f136.vmdk
+            filename: TEST_DIR/t-f136.IMGFMT
             format: FLAT
         [136]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f137.vmdk
+            filename: TEST_DIR/t-f137.IMGFMT
             format: FLAT
         [137]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f138.vmdk
+            filename: TEST_DIR/t-f138.IMGFMT
             format: FLAT
         [138]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f139.vmdk
+            filename: TEST_DIR/t-f139.IMGFMT
             format: FLAT
         [139]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f140.vmdk
+            filename: TEST_DIR/t-f140.IMGFMT
             format: FLAT
         [140]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f141.vmdk
+            filename: TEST_DIR/t-f141.IMGFMT
             format: FLAT
         [141]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f142.vmdk
+            filename: TEST_DIR/t-f142.IMGFMT
             format: FLAT
         [142]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f143.vmdk
+            filename: TEST_DIR/t-f143.IMGFMT
             format: FLAT
         [143]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f144.vmdk
+            filename: TEST_DIR/t-f144.IMGFMT
             format: FLAT
         [144]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f145.vmdk
+            filename: TEST_DIR/t-f145.IMGFMT
             format: FLAT
         [145]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f146.vmdk
+            filename: TEST_DIR/t-f146.IMGFMT
             format: FLAT
         [146]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f147.vmdk
+            filename: TEST_DIR/t-f147.IMGFMT
             format: FLAT
         [147]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f148.vmdk
+            filename: TEST_DIR/t-f148.IMGFMT
             format: FLAT
         [148]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f149.vmdk
+            filename: TEST_DIR/t-f149.IMGFMT
             format: FLAT
         [149]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f150.vmdk
+            filename: TEST_DIR/t-f150.IMGFMT
             format: FLAT
         [150]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f151.vmdk
+            filename: TEST_DIR/t-f151.IMGFMT
             format: FLAT
         [151]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f152.vmdk
+            filename: TEST_DIR/t-f152.IMGFMT
             format: FLAT
         [152]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f153.vmdk
+            filename: TEST_DIR/t-f153.IMGFMT
             format: FLAT
         [153]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f154.vmdk
+            filename: TEST_DIR/t-f154.IMGFMT
             format: FLAT
         [154]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f155.vmdk
+            filename: TEST_DIR/t-f155.IMGFMT
             format: FLAT
         [155]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f156.vmdk
+            filename: TEST_DIR/t-f156.IMGFMT
             format: FLAT
         [156]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f157.vmdk
+            filename: TEST_DIR/t-f157.IMGFMT
             format: FLAT
         [157]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f158.vmdk
+            filename: TEST_DIR/t-f158.IMGFMT
             format: FLAT
         [158]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f159.vmdk
+            filename: TEST_DIR/t-f159.IMGFMT
             format: FLAT
         [159]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f160.vmdk
+            filename: TEST_DIR/t-f160.IMGFMT
             format: FLAT
         [160]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f161.vmdk
+            filename: TEST_DIR/t-f161.IMGFMT
             format: FLAT
         [161]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f162.vmdk
+            filename: TEST_DIR/t-f162.IMGFMT
             format: FLAT
         [162]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f163.vmdk
+            filename: TEST_DIR/t-f163.IMGFMT
             format: FLAT
         [163]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f164.vmdk
+            filename: TEST_DIR/t-f164.IMGFMT
             format: FLAT
         [164]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f165.vmdk
+            filename: TEST_DIR/t-f165.IMGFMT
             format: FLAT
         [165]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f166.vmdk
+            filename: TEST_DIR/t-f166.IMGFMT
             format: FLAT
         [166]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f167.vmdk
+            filename: TEST_DIR/t-f167.IMGFMT
             format: FLAT
         [167]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f168.vmdk
+            filename: TEST_DIR/t-f168.IMGFMT
             format: FLAT
         [168]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f169.vmdk
+            filename: TEST_DIR/t-f169.IMGFMT
             format: FLAT
         [169]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f170.vmdk
+            filename: TEST_DIR/t-f170.IMGFMT
             format: FLAT
         [170]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f171.vmdk
+            filename: TEST_DIR/t-f171.IMGFMT
             format: FLAT
         [171]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f172.vmdk
+            filename: TEST_DIR/t-f172.IMGFMT
             format: FLAT
         [172]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f173.vmdk
+            filename: TEST_DIR/t-f173.IMGFMT
             format: FLAT
         [173]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f174.vmdk
+            filename: TEST_DIR/t-f174.IMGFMT
             format: FLAT
         [174]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f175.vmdk
+            filename: TEST_DIR/t-f175.IMGFMT
             format: FLAT
         [175]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f176.vmdk
+            filename: TEST_DIR/t-f176.IMGFMT
             format: FLAT
         [176]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f177.vmdk
+            filename: TEST_DIR/t-f177.IMGFMT
             format: FLAT
         [177]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f178.vmdk
+            filename: TEST_DIR/t-f178.IMGFMT
             format: FLAT
         [178]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f179.vmdk
+            filename: TEST_DIR/t-f179.IMGFMT
             format: FLAT
         [179]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f180.vmdk
+            filename: TEST_DIR/t-f180.IMGFMT
             format: FLAT
         [180]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f181.vmdk
+            filename: TEST_DIR/t-f181.IMGFMT
             format: FLAT
         [181]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f182.vmdk
+            filename: TEST_DIR/t-f182.IMGFMT
             format: FLAT
         [182]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f183.vmdk
+            filename: TEST_DIR/t-f183.IMGFMT
             format: FLAT
         [183]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f184.vmdk
+            filename: TEST_DIR/t-f184.IMGFMT
             format: FLAT
         [184]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f185.vmdk
+            filename: TEST_DIR/t-f185.IMGFMT
             format: FLAT
         [185]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f186.vmdk
+            filename: TEST_DIR/t-f186.IMGFMT
             format: FLAT
         [186]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f187.vmdk
+            filename: TEST_DIR/t-f187.IMGFMT
             format: FLAT
         [187]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f188.vmdk
+            filename: TEST_DIR/t-f188.IMGFMT
             format: FLAT
         [188]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f189.vmdk
+            filename: TEST_DIR/t-f189.IMGFMT
             format: FLAT
         [189]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f190.vmdk
+            filename: TEST_DIR/t-f190.IMGFMT
             format: FLAT
         [190]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f191.vmdk
+            filename: TEST_DIR/t-f191.IMGFMT
             format: FLAT
         [191]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f192.vmdk
+            filename: TEST_DIR/t-f192.IMGFMT
             format: FLAT
         [192]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f193.vmdk
+            filename: TEST_DIR/t-f193.IMGFMT
             format: FLAT
         [193]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f194.vmdk
+            filename: TEST_DIR/t-f194.IMGFMT
             format: FLAT
         [194]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f195.vmdk
+            filename: TEST_DIR/t-f195.IMGFMT
             format: FLAT
         [195]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f196.vmdk
+            filename: TEST_DIR/t-f196.IMGFMT
             format: FLAT
         [196]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f197.vmdk
+            filename: TEST_DIR/t-f197.IMGFMT
             format: FLAT
         [197]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f198.vmdk
+            filename: TEST_DIR/t-f198.IMGFMT
             format: FLAT
         [198]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f199.vmdk
+            filename: TEST_DIR/t-f199.IMGFMT
             format: FLAT
         [199]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f200.vmdk
+            filename: TEST_DIR/t-f200.IMGFMT
             format: FLAT
         [200]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f201.vmdk
+            filename: TEST_DIR/t-f201.IMGFMT
             format: FLAT
         [201]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f202.vmdk
+            filename: TEST_DIR/t-f202.IMGFMT
             format: FLAT
         [202]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f203.vmdk
+            filename: TEST_DIR/t-f203.IMGFMT
             format: FLAT
         [203]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f204.vmdk
+            filename: TEST_DIR/t-f204.IMGFMT
             format: FLAT
         [204]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f205.vmdk
+            filename: TEST_DIR/t-f205.IMGFMT
             format: FLAT
         [205]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f206.vmdk
+            filename: TEST_DIR/t-f206.IMGFMT
             format: FLAT
         [206]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f207.vmdk
+            filename: TEST_DIR/t-f207.IMGFMT
             format: FLAT
         [207]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f208.vmdk
+            filename: TEST_DIR/t-f208.IMGFMT
             format: FLAT
         [208]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f209.vmdk
+            filename: TEST_DIR/t-f209.IMGFMT
             format: FLAT
         [209]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f210.vmdk
+            filename: TEST_DIR/t-f210.IMGFMT
             format: FLAT
         [210]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f211.vmdk
+            filename: TEST_DIR/t-f211.IMGFMT
             format: FLAT
         [211]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f212.vmdk
+            filename: TEST_DIR/t-f212.IMGFMT
             format: FLAT
         [212]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f213.vmdk
+            filename: TEST_DIR/t-f213.IMGFMT
             format: FLAT
         [213]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f214.vmdk
+            filename: TEST_DIR/t-f214.IMGFMT
             format: FLAT
         [214]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f215.vmdk
+            filename: TEST_DIR/t-f215.IMGFMT
             format: FLAT
         [215]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f216.vmdk
+            filename: TEST_DIR/t-f216.IMGFMT
             format: FLAT
         [216]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f217.vmdk
+            filename: TEST_DIR/t-f217.IMGFMT
             format: FLAT
         [217]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f218.vmdk
+            filename: TEST_DIR/t-f218.IMGFMT
             format: FLAT
         [218]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f219.vmdk
+            filename: TEST_DIR/t-f219.IMGFMT
             format: FLAT
         [219]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f220.vmdk
+            filename: TEST_DIR/t-f220.IMGFMT
             format: FLAT
         [220]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f221.vmdk
+            filename: TEST_DIR/t-f221.IMGFMT
             format: FLAT
         [221]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f222.vmdk
+            filename: TEST_DIR/t-f222.IMGFMT
             format: FLAT
         [222]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f223.vmdk
+            filename: TEST_DIR/t-f223.IMGFMT
             format: FLAT
         [223]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f224.vmdk
+            filename: TEST_DIR/t-f224.IMGFMT
             format: FLAT
         [224]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f225.vmdk
+            filename: TEST_DIR/t-f225.IMGFMT
             format: FLAT
         [225]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f226.vmdk
+            filename: TEST_DIR/t-f226.IMGFMT
             format: FLAT
         [226]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f227.vmdk
+            filename: TEST_DIR/t-f227.IMGFMT
             format: FLAT
         [227]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f228.vmdk
+            filename: TEST_DIR/t-f228.IMGFMT
             format: FLAT
         [228]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f229.vmdk
+            filename: TEST_DIR/t-f229.IMGFMT
             format: FLAT
         [229]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f230.vmdk
+            filename: TEST_DIR/t-f230.IMGFMT
             format: FLAT
         [230]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f231.vmdk
+            filename: TEST_DIR/t-f231.IMGFMT
             format: FLAT
         [231]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f232.vmdk
+            filename: TEST_DIR/t-f232.IMGFMT
             format: FLAT
         [232]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f233.vmdk
+            filename: TEST_DIR/t-f233.IMGFMT
             format: FLAT
         [233]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f234.vmdk
+            filename: TEST_DIR/t-f234.IMGFMT
             format: FLAT
         [234]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f235.vmdk
+            filename: TEST_DIR/t-f235.IMGFMT
             format: FLAT
         [235]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f236.vmdk
+            filename: TEST_DIR/t-f236.IMGFMT
             format: FLAT
         [236]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f237.vmdk
+            filename: TEST_DIR/t-f237.IMGFMT
             format: FLAT
         [237]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f238.vmdk
+            filename: TEST_DIR/t-f238.IMGFMT
             format: FLAT
         [238]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f239.vmdk
+            filename: TEST_DIR/t-f239.IMGFMT
             format: FLAT
         [239]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f240.vmdk
+            filename: TEST_DIR/t-f240.IMGFMT
             format: FLAT
         [240]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f241.vmdk
+            filename: TEST_DIR/t-f241.IMGFMT
             format: FLAT
         [241]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f242.vmdk
+            filename: TEST_DIR/t-f242.IMGFMT
             format: FLAT
         [242]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f243.vmdk
+            filename: TEST_DIR/t-f243.IMGFMT
             format: FLAT
         [243]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f244.vmdk
+            filename: TEST_DIR/t-f244.IMGFMT
             format: FLAT
         [244]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f245.vmdk
+            filename: TEST_DIR/t-f245.IMGFMT
             format: FLAT
         [245]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f246.vmdk
+            filename: TEST_DIR/t-f246.IMGFMT
             format: FLAT
         [246]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f247.vmdk
+            filename: TEST_DIR/t-f247.IMGFMT
             format: FLAT
         [247]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f248.vmdk
+            filename: TEST_DIR/t-f248.IMGFMT
             format: FLAT
         [248]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f249.vmdk
+            filename: TEST_DIR/t-f249.IMGFMT
             format: FLAT
         [249]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f250.vmdk
+            filename: TEST_DIR/t-f250.IMGFMT
             format: FLAT
         [250]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f251.vmdk
+            filename: TEST_DIR/t-f251.IMGFMT
             format: FLAT
         [251]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f252.vmdk
+            filename: TEST_DIR/t-f252.IMGFMT
             format: FLAT
         [252]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f253.vmdk
+            filename: TEST_DIR/t-f253.IMGFMT
             format: FLAT
         [253]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f254.vmdk
+            filename: TEST_DIR/t-f254.IMGFMT
             format: FLAT
         [254]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f255.vmdk
+            filename: TEST_DIR/t-f255.IMGFMT
             format: FLAT
         [255]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f256.vmdk
+            filename: TEST_DIR/t-f256.IMGFMT
             format: FLAT
         [256]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f257.vmdk
+            filename: TEST_DIR/t-f257.IMGFMT
             format: FLAT
         [257]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f258.vmdk
+            filename: TEST_DIR/t-f258.IMGFMT
             format: FLAT
         [258]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f259.vmdk
+            filename: TEST_DIR/t-f259.IMGFMT
             format: FLAT
         [259]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f260.vmdk
+            filename: TEST_DIR/t-f260.IMGFMT
             format: FLAT
         [260]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f261.vmdk
+            filename: TEST_DIR/t-f261.IMGFMT
             format: FLAT
         [261]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f262.vmdk
+            filename: TEST_DIR/t-f262.IMGFMT
             format: FLAT
         [262]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f263.vmdk
+            filename: TEST_DIR/t-f263.IMGFMT
             format: FLAT
         [263]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f264.vmdk
+            filename: TEST_DIR/t-f264.IMGFMT
             format: FLAT
         [264]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f265.vmdk
+            filename: TEST_DIR/t-f265.IMGFMT
             format: FLAT
         [265]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f266.vmdk
+            filename: TEST_DIR/t-f266.IMGFMT
             format: FLAT
         [266]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f267.vmdk
+            filename: TEST_DIR/t-f267.IMGFMT
             format: FLAT
         [267]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f268.vmdk
+            filename: TEST_DIR/t-f268.IMGFMT
             format: FLAT
         [268]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f269.vmdk
+            filename: TEST_DIR/t-f269.IMGFMT
             format: FLAT
         [269]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f270.vmdk
+            filename: TEST_DIR/t-f270.IMGFMT
             format: FLAT
         [270]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f271.vmdk
+            filename: TEST_DIR/t-f271.IMGFMT
             format: FLAT
         [271]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f272.vmdk
+            filename: TEST_DIR/t-f272.IMGFMT
             format: FLAT
         [272]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f273.vmdk
+            filename: TEST_DIR/t-f273.IMGFMT
             format: FLAT
         [273]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f274.vmdk
+            filename: TEST_DIR/t-f274.IMGFMT
             format: FLAT
         [274]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f275.vmdk
+            filename: TEST_DIR/t-f275.IMGFMT
             format: FLAT
         [275]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f276.vmdk
+            filename: TEST_DIR/t-f276.IMGFMT
             format: FLAT
         [276]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f277.vmdk
+            filename: TEST_DIR/t-f277.IMGFMT
             format: FLAT
         [277]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f278.vmdk
+            filename: TEST_DIR/t-f278.IMGFMT
             format: FLAT
         [278]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f279.vmdk
+            filename: TEST_DIR/t-f279.IMGFMT
             format: FLAT
         [279]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f280.vmdk
+            filename: TEST_DIR/t-f280.IMGFMT
             format: FLAT
         [280]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f281.vmdk
+            filename: TEST_DIR/t-f281.IMGFMT
             format: FLAT
         [281]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f282.vmdk
+            filename: TEST_DIR/t-f282.IMGFMT
             format: FLAT
         [282]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f283.vmdk
+            filename: TEST_DIR/t-f283.IMGFMT
             format: FLAT
         [283]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f284.vmdk
+            filename: TEST_DIR/t-f284.IMGFMT
             format: FLAT
         [284]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f285.vmdk
+            filename: TEST_DIR/t-f285.IMGFMT
             format: FLAT
         [285]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f286.vmdk
+            filename: TEST_DIR/t-f286.IMGFMT
             format: FLAT
         [286]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f287.vmdk
+            filename: TEST_DIR/t-f287.IMGFMT
             format: FLAT
         [287]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f288.vmdk
+            filename: TEST_DIR/t-f288.IMGFMT
             format: FLAT
         [288]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f289.vmdk
+            filename: TEST_DIR/t-f289.IMGFMT
             format: FLAT
         [289]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f290.vmdk
+            filename: TEST_DIR/t-f290.IMGFMT
             format: FLAT
         [290]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f291.vmdk
+            filename: TEST_DIR/t-f291.IMGFMT
             format: FLAT
         [291]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f292.vmdk
+            filename: TEST_DIR/t-f292.IMGFMT
             format: FLAT
         [292]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f293.vmdk
+            filename: TEST_DIR/t-f293.IMGFMT
             format: FLAT
         [293]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f294.vmdk
+            filename: TEST_DIR/t-f294.IMGFMT
             format: FLAT
         [294]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f295.vmdk
+            filename: TEST_DIR/t-f295.IMGFMT
             format: FLAT
         [295]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f296.vmdk
+            filename: TEST_DIR/t-f296.IMGFMT
             format: FLAT
         [296]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f297.vmdk
+            filename: TEST_DIR/t-f297.IMGFMT
             format: FLAT
         [297]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f298.vmdk
+            filename: TEST_DIR/t-f298.IMGFMT
             format: FLAT
         [298]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f299.vmdk
+            filename: TEST_DIR/t-f299.IMGFMT
             format: FLAT
         [299]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f300.vmdk
+            filename: TEST_DIR/t-f300.IMGFMT
             format: FLAT
         [300]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f301.vmdk
+            filename: TEST_DIR/t-f301.IMGFMT
             format: FLAT
         [301]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f302.vmdk
+            filename: TEST_DIR/t-f302.IMGFMT
             format: FLAT
         [302]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f303.vmdk
+            filename: TEST_DIR/t-f303.IMGFMT
             format: FLAT
         [303]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f304.vmdk
+            filename: TEST_DIR/t-f304.IMGFMT
             format: FLAT
         [304]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f305.vmdk
+            filename: TEST_DIR/t-f305.IMGFMT
             format: FLAT
         [305]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f306.vmdk
+            filename: TEST_DIR/t-f306.IMGFMT
             format: FLAT
         [306]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f307.vmdk
+            filename: TEST_DIR/t-f307.IMGFMT
             format: FLAT
         [307]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f308.vmdk
+            filename: TEST_DIR/t-f308.IMGFMT
             format: FLAT
         [308]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f309.vmdk
+            filename: TEST_DIR/t-f309.IMGFMT
             format: FLAT
         [309]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f310.vmdk
+            filename: TEST_DIR/t-f310.IMGFMT
             format: FLAT
         [310]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f311.vmdk
+            filename: TEST_DIR/t-f311.IMGFMT
             format: FLAT
         [311]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f312.vmdk
+            filename: TEST_DIR/t-f312.IMGFMT
             format: FLAT
         [312]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f313.vmdk
+            filename: TEST_DIR/t-f313.IMGFMT
             format: FLAT
         [313]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f314.vmdk
+            filename: TEST_DIR/t-f314.IMGFMT
             format: FLAT
         [314]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f315.vmdk
+            filename: TEST_DIR/t-f315.IMGFMT
             format: FLAT
         [315]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f316.vmdk
+            filename: TEST_DIR/t-f316.IMGFMT
             format: FLAT
         [316]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f317.vmdk
+            filename: TEST_DIR/t-f317.IMGFMT
             format: FLAT
         [317]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f318.vmdk
+            filename: TEST_DIR/t-f318.IMGFMT
             format: FLAT
         [318]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f319.vmdk
+            filename: TEST_DIR/t-f319.IMGFMT
             format: FLAT
         [319]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f320.vmdk
+            filename: TEST_DIR/t-f320.IMGFMT
             format: FLAT
         [320]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f321.vmdk
+            filename: TEST_DIR/t-f321.IMGFMT
             format: FLAT
         [321]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f322.vmdk
+            filename: TEST_DIR/t-f322.IMGFMT
             format: FLAT
         [322]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f323.vmdk
+            filename: TEST_DIR/t-f323.IMGFMT
             format: FLAT
         [323]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f324.vmdk
+            filename: TEST_DIR/t-f324.IMGFMT
             format: FLAT
         [324]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f325.vmdk
+            filename: TEST_DIR/t-f325.IMGFMT
             format: FLAT
         [325]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f326.vmdk
+            filename: TEST_DIR/t-f326.IMGFMT
             format: FLAT
         [326]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f327.vmdk
+            filename: TEST_DIR/t-f327.IMGFMT
             format: FLAT
         [327]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f328.vmdk
+            filename: TEST_DIR/t-f328.IMGFMT
             format: FLAT
         [328]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f329.vmdk
+            filename: TEST_DIR/t-f329.IMGFMT
             format: FLAT
         [329]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f330.vmdk
+            filename: TEST_DIR/t-f330.IMGFMT
             format: FLAT
         [330]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f331.vmdk
+            filename: TEST_DIR/t-f331.IMGFMT
             format: FLAT
         [331]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f332.vmdk
+            filename: TEST_DIR/t-f332.IMGFMT
             format: FLAT
         [332]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f333.vmdk
+            filename: TEST_DIR/t-f333.IMGFMT
             format: FLAT
         [333]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f334.vmdk
+            filename: TEST_DIR/t-f334.IMGFMT
             format: FLAT
         [334]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f335.vmdk
+            filename: TEST_DIR/t-f335.IMGFMT
             format: FLAT
         [335]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f336.vmdk
+            filename: TEST_DIR/t-f336.IMGFMT
             format: FLAT
         [336]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f337.vmdk
+            filename: TEST_DIR/t-f337.IMGFMT
             format: FLAT
         [337]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f338.vmdk
+            filename: TEST_DIR/t-f338.IMGFMT
             format: FLAT
         [338]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f339.vmdk
+            filename: TEST_DIR/t-f339.IMGFMT
             format: FLAT
         [339]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f340.vmdk
+            filename: TEST_DIR/t-f340.IMGFMT
             format: FLAT
         [340]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f341.vmdk
+            filename: TEST_DIR/t-f341.IMGFMT
             format: FLAT
         [341]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f342.vmdk
+            filename: TEST_DIR/t-f342.IMGFMT
             format: FLAT
         [342]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f343.vmdk
+            filename: TEST_DIR/t-f343.IMGFMT
             format: FLAT
         [343]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f344.vmdk
+            filename: TEST_DIR/t-f344.IMGFMT
             format: FLAT
         [344]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f345.vmdk
+            filename: TEST_DIR/t-f345.IMGFMT
             format: FLAT
         [345]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f346.vmdk
+            filename: TEST_DIR/t-f346.IMGFMT
             format: FLAT
         [346]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f347.vmdk
+            filename: TEST_DIR/t-f347.IMGFMT
             format: FLAT
         [347]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f348.vmdk
+            filename: TEST_DIR/t-f348.IMGFMT
             format: FLAT
         [348]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f349.vmdk
+            filename: TEST_DIR/t-f349.IMGFMT
             format: FLAT
         [349]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f350.vmdk
+            filename: TEST_DIR/t-f350.IMGFMT
             format: FLAT
         [350]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f351.vmdk
+            filename: TEST_DIR/t-f351.IMGFMT
             format: FLAT
         [351]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f352.vmdk
+            filename: TEST_DIR/t-f352.IMGFMT
             format: FLAT
         [352]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f353.vmdk
+            filename: TEST_DIR/t-f353.IMGFMT
             format: FLAT
         [353]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f354.vmdk
+            filename: TEST_DIR/t-f354.IMGFMT
             format: FLAT
         [354]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f355.vmdk
+            filename: TEST_DIR/t-f355.IMGFMT
             format: FLAT
         [355]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f356.vmdk
+            filename: TEST_DIR/t-f356.IMGFMT
             format: FLAT
         [356]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f357.vmdk
+            filename: TEST_DIR/t-f357.IMGFMT
             format: FLAT
         [357]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f358.vmdk
+            filename: TEST_DIR/t-f358.IMGFMT
             format: FLAT
         [358]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f359.vmdk
+            filename: TEST_DIR/t-f359.IMGFMT
             format: FLAT
         [359]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f360.vmdk
+            filename: TEST_DIR/t-f360.IMGFMT
             format: FLAT
         [360]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f361.vmdk
+            filename: TEST_DIR/t-f361.IMGFMT
             format: FLAT
         [361]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f362.vmdk
+            filename: TEST_DIR/t-f362.IMGFMT
             format: FLAT
         [362]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f363.vmdk
+            filename: TEST_DIR/t-f363.IMGFMT
             format: FLAT
         [363]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f364.vmdk
+            filename: TEST_DIR/t-f364.IMGFMT
             format: FLAT
         [364]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f365.vmdk
+            filename: TEST_DIR/t-f365.IMGFMT
             format: FLAT
         [365]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f366.vmdk
+            filename: TEST_DIR/t-f366.IMGFMT
             format: FLAT
         [366]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f367.vmdk
+            filename: TEST_DIR/t-f367.IMGFMT
             format: FLAT
         [367]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f368.vmdk
+            filename: TEST_DIR/t-f368.IMGFMT
             format: FLAT
         [368]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f369.vmdk
+            filename: TEST_DIR/t-f369.IMGFMT
             format: FLAT
         [369]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f370.vmdk
+            filename: TEST_DIR/t-f370.IMGFMT
             format: FLAT
         [370]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f371.vmdk
+            filename: TEST_DIR/t-f371.IMGFMT
             format: FLAT
         [371]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f372.vmdk
+            filename: TEST_DIR/t-f372.IMGFMT
             format: FLAT
         [372]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f373.vmdk
+            filename: TEST_DIR/t-f373.IMGFMT
             format: FLAT
         [373]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f374.vmdk
+            filename: TEST_DIR/t-f374.IMGFMT
             format: FLAT
         [374]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f375.vmdk
+            filename: TEST_DIR/t-f375.IMGFMT
             format: FLAT
         [375]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f376.vmdk
+            filename: TEST_DIR/t-f376.IMGFMT
             format: FLAT
         [376]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f377.vmdk
+            filename: TEST_DIR/t-f377.IMGFMT
             format: FLAT
         [377]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f378.vmdk
+            filename: TEST_DIR/t-f378.IMGFMT
             format: FLAT
         [378]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f379.vmdk
+            filename: TEST_DIR/t-f379.IMGFMT
             format: FLAT
         [379]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f380.vmdk
+            filename: TEST_DIR/t-f380.IMGFMT
             format: FLAT
         [380]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f381.vmdk
+            filename: TEST_DIR/t-f381.IMGFMT
             format: FLAT
         [381]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f382.vmdk
+            filename: TEST_DIR/t-f382.IMGFMT
             format: FLAT
         [382]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f383.vmdk
+            filename: TEST_DIR/t-f383.IMGFMT
             format: FLAT
         [383]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f384.vmdk
+            filename: TEST_DIR/t-f384.IMGFMT
             format: FLAT
         [384]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f385.vmdk
+            filename: TEST_DIR/t-f385.IMGFMT
             format: FLAT
         [385]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f386.vmdk
+            filename: TEST_DIR/t-f386.IMGFMT
             format: FLAT
         [386]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f387.vmdk
+            filename: TEST_DIR/t-f387.IMGFMT
             format: FLAT
         [387]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f388.vmdk
+            filename: TEST_DIR/t-f388.IMGFMT
             format: FLAT
         [388]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f389.vmdk
+            filename: TEST_DIR/t-f389.IMGFMT
             format: FLAT
         [389]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f390.vmdk
+            filename: TEST_DIR/t-f390.IMGFMT
             format: FLAT
         [390]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f391.vmdk
+            filename: TEST_DIR/t-f391.IMGFMT
             format: FLAT
         [391]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f392.vmdk
+            filename: TEST_DIR/t-f392.IMGFMT
             format: FLAT
         [392]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f393.vmdk
+            filename: TEST_DIR/t-f393.IMGFMT
             format: FLAT
         [393]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f394.vmdk
+            filename: TEST_DIR/t-f394.IMGFMT
             format: FLAT
         [394]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f395.vmdk
+            filename: TEST_DIR/t-f395.IMGFMT
             format: FLAT
         [395]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f396.vmdk
+            filename: TEST_DIR/t-f396.IMGFMT
             format: FLAT
         [396]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f397.vmdk
+            filename: TEST_DIR/t-f397.IMGFMT
             format: FLAT
         [397]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f398.vmdk
+            filename: TEST_DIR/t-f398.IMGFMT
             format: FLAT
         [398]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f399.vmdk
+            filename: TEST_DIR/t-f399.IMGFMT
             format: FLAT
         [399]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f400.vmdk
+            filename: TEST_DIR/t-f400.IMGFMT
             format: FLAT
         [400]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f401.vmdk
+            filename: TEST_DIR/t-f401.IMGFMT
             format: FLAT
         [401]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f402.vmdk
+            filename: TEST_DIR/t-f402.IMGFMT
             format: FLAT
         [402]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f403.vmdk
+            filename: TEST_DIR/t-f403.IMGFMT
             format: FLAT
         [403]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f404.vmdk
+            filename: TEST_DIR/t-f404.IMGFMT
             format: FLAT
         [404]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f405.vmdk
+            filename: TEST_DIR/t-f405.IMGFMT
             format: FLAT
         [405]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f406.vmdk
+            filename: TEST_DIR/t-f406.IMGFMT
             format: FLAT
         [406]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f407.vmdk
+            filename: TEST_DIR/t-f407.IMGFMT
             format: FLAT
         [407]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f408.vmdk
+            filename: TEST_DIR/t-f408.IMGFMT
             format: FLAT
         [408]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f409.vmdk
+            filename: TEST_DIR/t-f409.IMGFMT
             format: FLAT
         [409]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f410.vmdk
+            filename: TEST_DIR/t-f410.IMGFMT
             format: FLAT
         [410]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f411.vmdk
+            filename: TEST_DIR/t-f411.IMGFMT
             format: FLAT
         [411]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f412.vmdk
+            filename: TEST_DIR/t-f412.IMGFMT
             format: FLAT
         [412]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f413.vmdk
+            filename: TEST_DIR/t-f413.IMGFMT
             format: FLAT
         [413]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f414.vmdk
+            filename: TEST_DIR/t-f414.IMGFMT
             format: FLAT
         [414]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f415.vmdk
+            filename: TEST_DIR/t-f415.IMGFMT
             format: FLAT
         [415]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f416.vmdk
+            filename: TEST_DIR/t-f416.IMGFMT
             format: FLAT
         [416]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f417.vmdk
+            filename: TEST_DIR/t-f417.IMGFMT
             format: FLAT
         [417]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f418.vmdk
+            filename: TEST_DIR/t-f418.IMGFMT
             format: FLAT
         [418]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f419.vmdk
+            filename: TEST_DIR/t-f419.IMGFMT
             format: FLAT
         [419]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f420.vmdk
+            filename: TEST_DIR/t-f420.IMGFMT
             format: FLAT
         [420]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f421.vmdk
+            filename: TEST_DIR/t-f421.IMGFMT
             format: FLAT
         [421]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f422.vmdk
+            filename: TEST_DIR/t-f422.IMGFMT
             format: FLAT
         [422]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f423.vmdk
+            filename: TEST_DIR/t-f423.IMGFMT
             format: FLAT
         [423]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f424.vmdk
+            filename: TEST_DIR/t-f424.IMGFMT
             format: FLAT
         [424]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f425.vmdk
+            filename: TEST_DIR/t-f425.IMGFMT
             format: FLAT
         [425]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f426.vmdk
+            filename: TEST_DIR/t-f426.IMGFMT
             format: FLAT
         [426]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f427.vmdk
+            filename: TEST_DIR/t-f427.IMGFMT
             format: FLAT
         [427]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f428.vmdk
+            filename: TEST_DIR/t-f428.IMGFMT
             format: FLAT
         [428]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f429.vmdk
+            filename: TEST_DIR/t-f429.IMGFMT
             format: FLAT
         [429]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f430.vmdk
+            filename: TEST_DIR/t-f430.IMGFMT
             format: FLAT
         [430]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f431.vmdk
+            filename: TEST_DIR/t-f431.IMGFMT
             format: FLAT
         [431]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f432.vmdk
+            filename: TEST_DIR/t-f432.IMGFMT
             format: FLAT
         [432]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f433.vmdk
+            filename: TEST_DIR/t-f433.IMGFMT
             format: FLAT
         [433]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f434.vmdk
+            filename: TEST_DIR/t-f434.IMGFMT
             format: FLAT
         [434]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f435.vmdk
+            filename: TEST_DIR/t-f435.IMGFMT
             format: FLAT
         [435]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f436.vmdk
+            filename: TEST_DIR/t-f436.IMGFMT
             format: FLAT
         [436]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f437.vmdk
+            filename: TEST_DIR/t-f437.IMGFMT
             format: FLAT
         [437]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f438.vmdk
+            filename: TEST_DIR/t-f438.IMGFMT
             format: FLAT
         [438]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f439.vmdk
+            filename: TEST_DIR/t-f439.IMGFMT
             format: FLAT
         [439]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f440.vmdk
+            filename: TEST_DIR/t-f440.IMGFMT
             format: FLAT
         [440]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f441.vmdk
+            filename: TEST_DIR/t-f441.IMGFMT
             format: FLAT
         [441]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f442.vmdk
+            filename: TEST_DIR/t-f442.IMGFMT
             format: FLAT
         [442]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f443.vmdk
+            filename: TEST_DIR/t-f443.IMGFMT
             format: FLAT
         [443]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f444.vmdk
+            filename: TEST_DIR/t-f444.IMGFMT
             format: FLAT
         [444]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f445.vmdk
+            filename: TEST_DIR/t-f445.IMGFMT
             format: FLAT
         [445]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f446.vmdk
+            filename: TEST_DIR/t-f446.IMGFMT
             format: FLAT
         [446]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f447.vmdk
+            filename: TEST_DIR/t-f447.IMGFMT
             format: FLAT
         [447]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f448.vmdk
+            filename: TEST_DIR/t-f448.IMGFMT
             format: FLAT
         [448]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f449.vmdk
+            filename: TEST_DIR/t-f449.IMGFMT
             format: FLAT
         [449]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f450.vmdk
+            filename: TEST_DIR/t-f450.IMGFMT
             format: FLAT
         [450]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f451.vmdk
+            filename: TEST_DIR/t-f451.IMGFMT
             format: FLAT
         [451]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f452.vmdk
+            filename: TEST_DIR/t-f452.IMGFMT
             format: FLAT
         [452]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f453.vmdk
+            filename: TEST_DIR/t-f453.IMGFMT
             format: FLAT
         [453]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f454.vmdk
+            filename: TEST_DIR/t-f454.IMGFMT
             format: FLAT
         [454]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f455.vmdk
+            filename: TEST_DIR/t-f455.IMGFMT
             format: FLAT
         [455]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f456.vmdk
+            filename: TEST_DIR/t-f456.IMGFMT
             format: FLAT
         [456]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f457.vmdk
+            filename: TEST_DIR/t-f457.IMGFMT
             format: FLAT
         [457]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f458.vmdk
+            filename: TEST_DIR/t-f458.IMGFMT
             format: FLAT
         [458]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f459.vmdk
+            filename: TEST_DIR/t-f459.IMGFMT
             format: FLAT
         [459]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f460.vmdk
+            filename: TEST_DIR/t-f460.IMGFMT
             format: FLAT
         [460]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f461.vmdk
+            filename: TEST_DIR/t-f461.IMGFMT
             format: FLAT
         [461]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f462.vmdk
+            filename: TEST_DIR/t-f462.IMGFMT
             format: FLAT
         [462]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f463.vmdk
+            filename: TEST_DIR/t-f463.IMGFMT
             format: FLAT
         [463]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f464.vmdk
+            filename: TEST_DIR/t-f464.IMGFMT
             format: FLAT
         [464]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f465.vmdk
+            filename: TEST_DIR/t-f465.IMGFMT
             format: FLAT
         [465]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f466.vmdk
+            filename: TEST_DIR/t-f466.IMGFMT
             format: FLAT
         [466]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f467.vmdk
+            filename: TEST_DIR/t-f467.IMGFMT
             format: FLAT
         [467]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f468.vmdk
+            filename: TEST_DIR/t-f468.IMGFMT
             format: FLAT
         [468]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f469.vmdk
+            filename: TEST_DIR/t-f469.IMGFMT
             format: FLAT
         [469]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f470.vmdk
+            filename: TEST_DIR/t-f470.IMGFMT
             format: FLAT
         [470]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f471.vmdk
+            filename: TEST_DIR/t-f471.IMGFMT
             format: FLAT
         [471]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f472.vmdk
+            filename: TEST_DIR/t-f472.IMGFMT
             format: FLAT
         [472]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f473.vmdk
+            filename: TEST_DIR/t-f473.IMGFMT
             format: FLAT
         [473]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f474.vmdk
+            filename: TEST_DIR/t-f474.IMGFMT
             format: FLAT
         [474]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f475.vmdk
+            filename: TEST_DIR/t-f475.IMGFMT
             format: FLAT
         [475]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f476.vmdk
+            filename: TEST_DIR/t-f476.IMGFMT
             format: FLAT
         [476]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f477.vmdk
+            filename: TEST_DIR/t-f477.IMGFMT
             format: FLAT
         [477]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f478.vmdk
+            filename: TEST_DIR/t-f478.IMGFMT
             format: FLAT
         [478]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f479.vmdk
+            filename: TEST_DIR/t-f479.IMGFMT
             format: FLAT
         [479]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f480.vmdk
+            filename: TEST_DIR/t-f480.IMGFMT
             format: FLAT
         [480]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f481.vmdk
+            filename: TEST_DIR/t-f481.IMGFMT
             format: FLAT
         [481]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f482.vmdk
+            filename: TEST_DIR/t-f482.IMGFMT
             format: FLAT
         [482]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f483.vmdk
+            filename: TEST_DIR/t-f483.IMGFMT
             format: FLAT
         [483]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f484.vmdk
+            filename: TEST_DIR/t-f484.IMGFMT
             format: FLAT
         [484]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f485.vmdk
+            filename: TEST_DIR/t-f485.IMGFMT
             format: FLAT
         [485]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f486.vmdk
+            filename: TEST_DIR/t-f486.IMGFMT
             format: FLAT
         [486]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f487.vmdk
+            filename: TEST_DIR/t-f487.IMGFMT
             format: FLAT
         [487]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f488.vmdk
+            filename: TEST_DIR/t-f488.IMGFMT
             format: FLAT
         [488]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f489.vmdk
+            filename: TEST_DIR/t-f489.IMGFMT
             format: FLAT
         [489]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f490.vmdk
+            filename: TEST_DIR/t-f490.IMGFMT
             format: FLAT
         [490]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f491.vmdk
+            filename: TEST_DIR/t-f491.IMGFMT
             format: FLAT
         [491]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f492.vmdk
+            filename: TEST_DIR/t-f492.IMGFMT
             format: FLAT
         [492]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f493.vmdk
+            filename: TEST_DIR/t-f493.IMGFMT
             format: FLAT
         [493]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f494.vmdk
+            filename: TEST_DIR/t-f494.IMGFMT
             format: FLAT
         [494]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f495.vmdk
+            filename: TEST_DIR/t-f495.IMGFMT
             format: FLAT
         [495]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f496.vmdk
+            filename: TEST_DIR/t-f496.IMGFMT
             format: FLAT
         [496]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f497.vmdk
+            filename: TEST_DIR/t-f497.IMGFMT
             format: FLAT
         [497]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f498.vmdk
+            filename: TEST_DIR/t-f498.IMGFMT
             format: FLAT
         [498]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f499.vmdk
+            filename: TEST_DIR/t-f499.IMGFMT
             format: FLAT
         [499]:
             virtual size: 2147483648
-            filename: TEST_DIR/t-f500.vmdk
+            filename: TEST_DIR/t-f500.IMGFMT
             format: FLAT
 
 === Testing malformed VMFS extent description line ===
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:38:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:38:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16326.39990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6n-0001fo-IQ; Fri, 30 Oct 2020 21:38:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16326.39990; Fri, 30 Oct 2020 21:38:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6n-0001fg-FH; Fri, 30 Oct 2020 21:38:53 +0000
Received: by outflank-mailman (input) for mailman id 16326;
 Fri, 30 Oct 2020 21:38:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc6l-0001fX-QY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f7a27cb8-4729-4a7c-af10-eb48a1274961;
 Fri, 30 Oct 2020 21:38:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6j-0003aZ-Qg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6j-0000Eb-Oh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc6l-0001fX-QY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:51 +0000
X-Inumbo-ID: f7a27cb8-4729-4a7c-af10-eb48a1274961
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f7a27cb8-4729-4a7c-af10-eb48a1274961;
	Fri, 30 Oct 2020 21:38:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/qcU6r3Kq39UTATmqHOhWOaTIdAs7T43JeTRVjiOAgk=; b=bNBZJNOgcKUAr51MmxARBb8H0C
	/zmq7QAtd/ukBiegPvOyoXql31g3x1qsqGy/KjYBr+9uKgImWPWibvySlEIHBa1oorLN8NLDXNHhw
	sDK637/r36xAvZRpfTCoLc4MokkTrv5vPg2Z1FdcbYvUY5ta0F1SVkPoc0pXlThQtv7Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6j-0003aZ-Qg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6j-0000Eb-Oh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Mitigate file fragmentation with extent size hints
Message-Id: <E1kYc6j-0000Eb-Oh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:49 +0000

commit ffa244c84a1a30dff69ecc80b0137a2b6d428ecb
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 7 16:23:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    file-posix: Mitigate file fragmentation with extent size hints
    
    Especially when O_DIRECT is used with image files so that the page cache
    indirection can't cause a merge of allocating requests, the file will
    fragment on the file system layer, with a potentially very small
    fragment size (this depends on the requests the guest sent).
    
    On Linux, fragmentation can be reduced by setting an extent size hint
    when creating the file (at least on XFS, it can't be set any more after
    the first extent has been allocated), basically giving raw files a
    "cluster size" for allocation.
    
    This adds a create option to set the extent size hint, and changes the
    default from not setting a hint to setting it to 1 MB. The main reason
    why qcow2 defaults to smaller cluster sizes is that COW becomes more
    expensive, which is not an issue with raw files, so we can choose a
    larger size. The tradeoff here is only potentially wasted disk space.
    
    For qcow2 (or other image formats) over file-posix, the advantage should
    even be greater because they grow sequentially without leaving holes, so
    there won't be wasted space. Setting even larger extent size hints for
    such images may make sense. This can be done with the new option, but
    let's keep the default conservative for now.
    
    The effect is very visible with a test that intentionally creates a
    badly fragmented file with qemu-img bench (the time difference while
    creating the file is already remarkable) and then looks at the number of
    extents and the time a simple "qemu-img map" takes.
    
    Without an extent size hint:
    
        $ ./qemu-img create -f raw -o extent_size_hint=0 ~/tmp/test.raw 10G
        Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=0
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
        Run completed in 25.848 seconds.
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
        Run completed in 19.616 seconds.
        $ filefrag ~/tmp/test.raw
        /home/kwolf/tmp/test.raw: 2000000 extents found
        $ time ./qemu-img map ~/tmp/test.raw
        Offset          Length          Mapped to       File
        0               0x1e8480000     0               /home/kwolf/tmp/test.raw
    
        real    0m1,279s
        user    0m0,043s
        sys     0m1,226s
    
    With the new default extent size hint of 1 MB:
    
        $ ./qemu-img create -f raw -o extent_size_hint=1M ~/tmp/test.raw 10G
        Formatting '/home/kwolf/tmp/test.raw', fmt=raw size=10737418240 extent_size_hint=1048576
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 0
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 0, step size 8192)
        Run completed in 11.833 seconds.
        $ ./qemu-img bench -f raw -t none -n -w ~/tmp/test.raw -c 1000000 -S 8192 -o 4096
        Sending 1000000 write requests, 4096 bytes each, 64 in parallel (starting at offset 4096, step size 8192)
        Run completed in 10.155 seconds.
        $ filefrag ~/tmp/test.raw
        /home/kwolf/tmp/test.raw: 178 extents found
        $ time ./qemu-img map ~/tmp/test.raw
        Offset          Length          Mapped to       File
        0               0x1e8480000     0               /home/kwolf/tmp/test.raw
    
        real    0m0,061s
        user    0m0,040s
        sys     0m0,014s
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200707142329.48303-1-kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c         | 44 ++++++++++++++++++++++++++++++++++++++++++++
 include/block/block_int.h  |  1 +
 qapi/block-core.json       | 11 +++++++----
 tests/qemu-iotests/082.out | 16 ++++++++++++++++
 tests/qemu-iotests/106     |  7 +++++--
 tests/qemu-iotests/175     |  6 +++---
 tests/qemu-iotests/243     |  7 ++++---
 7 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 1989eae85f..8067e238cb 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -30,6 +30,7 @@
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/option.h"
+#include "qemu/units.h"
 #include "trace.h"
 #include "block/thread-pool.h"
 #include "qemu/iov.h"
@@ -2318,6 +2319,14 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
     if (!file_opts->has_preallocation) {
         file_opts->preallocation = PREALLOC_MODE_OFF;
     }
+    if (!file_opts->has_extent_size_hint) {
+        file_opts->extent_size_hint = 1 * MiB;
+    }
+    if (file_opts->extent_size_hint > UINT32_MAX) {
+        result = -EINVAL;
+        error_setg(errp, "Extent size hint is too large");
+        goto out;
+    }
 
     /* Create file */
     fd = qemu_open(file_opts->filename, O_RDWR | O_CREAT | O_BINARY, 0644);
@@ -2375,6 +2384,27 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
         }
 #endif
     }
+#ifdef FS_IOC_FSSETXATTR
+    /*
+     * Try to set the extent size hint. Failure is not fatal, and a warning is
+     * only printed if the option was explicitly specified.
+     */
+    {
+        struct fsxattr attr;
+        result = ioctl(fd, FS_IOC_FSGETXATTR, &attr);
+        if (result == 0) {
+            attr.fsx_xflags |= FS_XFLAG_EXTSIZE;
+            attr.fsx_extsize = file_opts->extent_size_hint;
+            result = ioctl(fd, FS_IOC_FSSETXATTR, &attr);
+        }
+        if (result < 0 && file_opts->has_extent_size_hint &&
+            file_opts->extent_size_hint)
+        {
+            warn_report("Failed to set extent size hint: %s",
+                        strerror(errno));
+        }
+    }
+#endif
 
     /* Resize and potentially preallocate the file to the desired
      * final size */
@@ -2410,6 +2440,8 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
 {
     BlockdevCreateOptions options;
     int64_t total_size = 0;
+    int64_t extent_size_hint = 0;
+    bool has_extent_size_hint = false;
     bool nocow = false;
     PreallocMode prealloc;
     char *buf = NULL;
@@ -2421,6 +2453,11 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
     /* Read out options */
     total_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0),
                           BDRV_SECTOR_SIZE);
+    if (qemu_opt_get(opts, BLOCK_OPT_EXTENT_SIZE_HINT)) {
+        has_extent_size_hint = true;
+        extent_size_hint =
+            qemu_opt_get_size_del(opts, BLOCK_OPT_EXTENT_SIZE_HINT, -1);
+    }
     nocow = qemu_opt_get_bool(opts, BLOCK_OPT_NOCOW, false);
     buf = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
     prealloc = qapi_enum_parse(&PreallocMode_lookup, buf,
@@ -2440,6 +2477,8 @@ static int coroutine_fn raw_co_create_opts(BlockDriver *drv,
             .preallocation      = prealloc,
             .has_nocow          = true,
             .nocow              = nocow,
+            .has_extent_size_hint = has_extent_size_hint,
+            .extent_size_hint   = extent_size_hint,
         },
     };
     return raw_co_create(&options, errp);
@@ -2930,6 +2969,11 @@ static QemuOptsList raw_create_opts = {
 #endif
                     ", full)"
         },
+        {
+            .name = BLOCK_OPT_EXTENT_SIZE_HINT,
+            .type = QEMU_OPT_SIZE,
+            .help = "Extent size hint for the image file, 0 to disable"
+        },
         { /* end of list */ }
     }
 };
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 3d6cf88592..38dec0275b 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -53,6 +53,7 @@
 #define BLOCK_OPT_ADAPTER_TYPE      "adapter_type"
 #define BLOCK_OPT_REDUNDANCY        "redundancy"
 #define BLOCK_OPT_NOCOW             "nocow"
+#define BLOCK_OPT_EXTENT_SIZE_HINT  "extent_size_hint"
 #define BLOCK_OPT_OBJECT_SIZE       "object_size"
 #define BLOCK_OPT_REFCOUNT_BITS     "refcount_bits"
 #define BLOCK_OPT_DATA_FILE         "data_file"
diff --git a/qapi/block-core.json b/qapi/block-core.json
index b20332e592..463ffd83da 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4185,14 +4185,17 @@
 #                 falloc (if defined CONFIG_POSIX_FALLOCATE),
 #                 full (if defined CONFIG_POSIX))
 # @nocow: Turn off copy-on-write (valid only on btrfs; default: off)
+# @extent-size-hint: Extent size hint to add to the image file; 0 for not
+#                    adding an extent size hint (default: 1 MB, since 5.1)
 #
 # Since: 2.12
 ##
 { 'struct': 'BlockdevCreateOptionsFile',
-  'data': { 'filename':         'str',
-            'size':             'size',
-            '*preallocation':   'PreallocMode',
-            '*nocow':           'bool' } }
+  'data': { 'filename':             'str',
+            'size':                 'size',
+            '*preallocation':       'PreallocMode',
+            '*nocow':               'bool',
+            '*extent-size-hint':    'size'} }
 
 ##
 # @BlockdevCreateOptionsGluster:
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index a4a2b69030..f7b3d54b28 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -62,6 +62,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -86,6 +87,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -110,6 +112,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -134,6 +137,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -158,6 +162,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -182,6 +187,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -206,6 +212,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -230,6 +237,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -353,6 +361,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -377,6 +386,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -401,6 +411,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -425,6 +436,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -449,6 +461,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -473,6 +486,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -497,6 +511,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
@@ -521,6 +536,7 @@ Supported options:
   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
+  extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
   lazy_refcounts=<bool (on/off)> - Postpone refcount updates
   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)
   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)
diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106
index b5d1ec4078..a20659d443 100755
--- a/tests/qemu-iotests/106
+++ b/tests/qemu-iotests/106
@@ -51,7 +51,10 @@ for create_mode in off falloc full; do
         echo
         echo "--- create_mode=$create_mode growth_mode=$growth_mode ---"
 
-        _make_test_img -o "preallocation=$create_mode" ${CREATION_SIZE}K
+        # Our calculation below assumes kilobytes as unit for the actual size.
+        # Disable the extent size hint because it would give us a result in
+        # megabytes.
+        _make_test_img -o "preallocation=$create_mode,extent_size_hint=0" ${CREATION_SIZE}K
         $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
 
         expected_size=0
@@ -98,7 +101,7 @@ for growth_mode in falloc full; do
     # plain int.  We should use the correct type for the result, and
     # this tests we do.
 
-    _make_test_img 2G
+    _make_test_img -o "extent_size_hint=0" 2G
     $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
 
     actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175
index 020ed8e61f..00a626aa63 100755
--- a/tests/qemu-iotests/175
+++ b/tests/qemu-iotests/175
@@ -89,20 +89,20 @@ min_blocks=$(stat -c '%b' "$TEST_DIR/empty")
 
 echo
 echo "== creating image with default preallocation =="
-_make_test_img $size | _filter_imgfmt
+_make_test_img -o extent_size_hint=0 $size | _filter_imgfmt
 stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $size
 
 for mode in off full falloc; do
     echo
     echo "== creating image with preallocation $mode =="
-    _make_test_img -o preallocation=$mode $size | _filter_imgfmt
+    _make_test_img -o preallocation=$mode,extent_size_hint=0 $size | _filter_imgfmt
     stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $size
 done
 
 for new_size in 4096 1048576; do
     echo
     echo "== resize empty image with block_resize =="
-    _make_test_img 0 | _filter_imgfmt
+    _make_test_img -o extent_size_hint=0 0 | _filter_imgfmt
     _block_resize $TEST_IMG $new_size >/dev/null
     stat -c "size=%s, blocks=%b" $TEST_IMG | _filter_blocks $extra_blocks $min_blocks $new_size
 done
diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243
index a61852f6d9..17388a4644 100755
--- a/tests/qemu-iotests/243
+++ b/tests/qemu-iotests/243
@@ -51,7 +51,7 @@ for mode in off metadata falloc full; do
     echo "=== preallocation=$mode ==="
     echo
 
-    _make_test_img -o "preallocation=$mode" 64M
+    _make_test_img -o "preallocation=$mode,extent_size_hint=0" 64M
 
     printf "File size: "
     du -b $TEST_IMG | cut -f1
@@ -68,7 +68,8 @@ for mode in off metadata falloc full; do
     echo "=== External data file: preallocation=$mode ==="
     echo
 
-    _make_test_img -o "data_file=$TEST_IMG.data,preallocation=$mode" 64M
+    _make_test_img \
+        -o "data_file=$TEST_IMG.data,preallocation=$mode,extent_size_hint=0" 64M
 
     echo -n "qcow2 file size: "
     du -b $TEST_IMG | cut -f1
@@ -79,7 +80,7 @@ for mode in off metadata falloc full; do
     echo -n "qcow2 disk usage: "
     [ $(du -B1 $TEST_IMG | cut -f1) -lt 1048576 ] && echo "low" || echo "high"
     echo -n "data disk usage:  "
-    [ $(du -B1 $TEST_IMG.data | cut -f1) -lt 1048576 ] && echo "low" || echo "high"
+    [ $(du -B1 $TEST_IMG.data | cut -f1) -lt 2097152 ] && echo "low" || echo "high"
 
 done
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16327.39994 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6w-0001gy-Kf; Fri, 30 Oct 2020 21:39:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16327.39994; Fri, 30 Oct 2020 21:39:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc6w-0001gq-Gy; Fri, 30 Oct 2020 21:39:02 +0000
Received: by outflank-mailman (input) for mailman id 16327;
 Fri, 30 Oct 2020 21:39:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc6v-0001gj-96
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c1b73c66-f142-4bbb-a0f1-8ebea66e1ca9;
 Fri, 30 Oct 2020 21:39:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6t-0003ai-W7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc6t-0000Fn-UA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc6v-0001gj-96
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:01 +0000
X-Inumbo-ID: c1b73c66-f142-4bbb-a0f1-8ebea66e1ca9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c1b73c66-f142-4bbb-a0f1-8ebea66e1ca9;
	Fri, 30 Oct 2020 21:39:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LLD/HBbRXO72ZRX8z3Wcl79Yx+FH+22ytOKKG9eI++s=; b=IQUQavgWdUAuE2e2ZaT7eU8AYi
	+Mby6AIQe/rXZxsE10nlZ5O+c+de+HSbNTHZOlpCdPfdT7oL4svoftzPzRzcb9tnh+mx8r4I1mAhP
	QNmTGwok5XGZIOs59J3LsrF3n3257MuUpAvNAIogy30SkH+JYvVIb53N9pYYdsjPvbnc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6t-0003ai-W7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc6t-0000Fn-UA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:38:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-img: Flush stdout before before potential stderr messages
Message-Id: <E1kYc6t-0000Fn-UA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:38:59 +0000

commit 4e2f4418784da09cb106264340241856cd2846df
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:45 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qemu-img: Flush stdout before before potential stderr messages
    
    During 'qemu-img create ... 2>&1', if --quiet is not in force, we can
    end up with buffered I/O in stdout that was produced before failure,
    but which appears in output after failure.  This is confusing; the fix
    is to flush stdout prior to attempting anything that might produce an
    error message.  Several iotests demonstrate the resulting ordering
    change now that the merged outputs now reflect chronology.  (An even
    better fix would be to avoid printf from within block.c altogether,
    but that's much more invasive...)
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-2-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 1 +
 tests/qemu-iotests/049.out | 8 ++++----
 tests/qemu-iotests/054.out | 2 +-
 tests/qemu-iotests/079.out | 2 +-
 tests/qemu-iotests/112.out | 4 ++--
 tests/qemu-iotests/259.out | 2 +-
 tests/qemu-iotests/282.out | 6 +++---
 7 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/block.c b/block.c
index 3031413deb..98cad57cda 100644
--- a/block.c
+++ b/block.c
@@ -6164,6 +6164,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
         printf("Formatting '%s', fmt=%s ", filename, fmt);
         qemu_opts_print(opts, " ");
         puts("");
+        fflush(stdout);
     }
 
     ret = bdrv_create(drv, filename, opts, &local_err);
diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out
index e77966446b..4c21dc70a5 100644
--- a/tests/qemu-iotests/049.out
+++ b/tests/qemu-iotests/049.out
@@ -167,12 +167,12 @@ qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.42 lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
 
 qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=foobar lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
 
 == Check preallocation option ==
 
@@ -183,8 +183,8 @@ qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=metadata compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=1234 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
 
 == Check encryption option ==
 
@@ -206,7 +206,7 @@ qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
 
 qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M
-qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=on refcount_bits=16
+qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
 
 *** done
diff --git a/tests/qemu-iotests/054.out b/tests/qemu-iotests/054.out
index e6ec430edd..71f18bb987 100644
--- a/tests/qemu-iotests/054.out
+++ b/tests/qemu-iotests/054.out
@@ -1,8 +1,8 @@
 QA output created by 054
 
 creating too large image (1 EB)
-qemu-img: TEST_DIR/t.IMGFMT: The image size is too large for file format 'IMGFMT' (try using a larger cluster size)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1152921504606846976
+qemu-img: TEST_DIR/t.IMGFMT: The image size is too large for file format 'IMGFMT' (try using a larger cluster size)
 
 creating too large image (1 EB) using qcow2.py
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296
diff --git a/tests/qemu-iotests/079.out b/tests/qemu-iotests/079.out
index aab922fb36..f65a9ca84f 100644
--- a/tests/qemu-iotests/079.out
+++ b/tests/qemu-iotests/079.out
@@ -9,6 +9,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadat
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
-qemu-img: TEST_DIR/t.IMGFMT: Cluster size must be a power of two between 512 and 2048k
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 preallocation=metadata
+qemu-img: TEST_DIR/t.IMGFMT: Cluster size must be a power of two between 512 and 2048k
 *** done
diff --git a/tests/qemu-iotests/112.out b/tests/qemu-iotests/112.out
index 182655dbf6..dd3cc4383c 100644
--- a/tests/qemu-iotests/112.out
+++ b/tests/qemu-iotests/112.out
@@ -2,7 +2,6 @@ QA output created by 112
 
 === refcount_bits limits ===
 
-qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
@@ -10,6 +9,7 @@ qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not e
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+qemu-img: TEST_DIR/t.IMGFMT: Refcount width must be a power of two and may not exceed 64 bits
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 refcount bits: 1
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
@@ -21,10 +21,10 @@ refcount bits: 16
 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 refcount bits: 16
-qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
 qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+qemu-img: TEST_DIR/t.IMGFMT: Different refcount widths than 16 bits require compatibility level 1.1 or above (use version=v3 or greater)
 
 === Snapshot limit on refcount_bits=1 ===
 
diff --git a/tests/qemu-iotests/259.out b/tests/qemu-iotests/259.out
index ffed19c2a0..e27b9ff38d 100644
--- a/tests/qemu-iotests/259.out
+++ b/tests/qemu-iotests/259.out
@@ -9,6 +9,6 @@ virtual size: 64 MiB (67108864 bytes)
 disk size: unavailable
 
 --- Testing creation for which the node would need to grow ---
-qemu-img: TEST_DIR/t.IMGFMT: Could not resize image: Image format driver does not support resize
 Formatting 'TEST_DIR/t.IMGFMT', fmt=qcow2 size=67108864 preallocation=metadata
+qemu-img: TEST_DIR/t.IMGFMT: Could not resize image: Image format driver does not support resize
 *** done
diff --git a/tests/qemu-iotests/282.out b/tests/qemu-iotests/282.out
index 5d079dabce..67db7ab15a 100644
--- a/tests/qemu-iotests/282.out
+++ b/tests/qemu-iotests/282.out
@@ -1,11 +1,11 @@
 QA output created by 282
 == Create non-UTF8 secret ==
 == Throws an error because of invalid UTF-8 secret ==
-qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 Formatting 'vol.img', fmt=luks size=4194304 key-secret=sec0
+qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 == Image file should not exist after the error ==
 == Create a stub image file and run qemu-img again ==
-qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 Formatting 'vol.img', fmt=luks size=4194304 key-secret=sec0
+qemu-img: vol.img: Data from secret sec0 is not valid UTF-8
 == Pre-existing image file should also be deleted after the error ==
- *** done
+*** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16328.39998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc76-0001iZ-No; Fri, 30 Oct 2020 21:39:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16328.39998; Fri, 30 Oct 2020 21:39:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc76-0001iR-Kw; Fri, 30 Oct 2020 21:39:12 +0000
Received: by outflank-mailman (input) for mailman id 16328;
 Fri, 30 Oct 2020 21:39:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc75-0001iG-2j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7a94426a-b4da-493a-b14d-00fae53f72d4;
 Fri, 30 Oct 2020 21:39:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc74-0003bA-4i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc74-0000Gu-31
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc75-0001iG-2j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:11 +0000
X-Inumbo-ID: 7a94426a-b4da-493a-b14d-00fae53f72d4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7a94426a-b4da-493a-b14d-00fae53f72d4;
	Fri, 30 Oct 2020 21:39:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5O4ulvRST6P+O86NuRMR33R9SpjTjYbwj5ASXw4XdSw=; b=iq1Oxk8DiIPNrQkM7UGHpn/B9n
	UY08mB9IaYX9y7Nqi1OIEgO9vPGGXM14fbwqrZ/Fb7F/pXiCZ6gvc8ZjMuOqSgll00xsO96C5TKqQ
	3roVvJQr7kmA7Hgs/pkQhjDgpbbmo8ApXvcTgq442E11mvJ9PIM+n3raKudS/rwyyrJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc74-0003bA-4i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc74-0000Gu-31
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Finish deprecation of 'qemu-img convert -n -o'
Message-Id: <E1kYc74-0000Gu-31@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:39:10 +0000

commit 25956af3fe5dd0385ad8017bc768a6afe41e2a74
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:46 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Finish deprecation of 'qemu-img convert -n -o'
    
    It's been two releases since we started warning; time to make the
    combination an error as promised.  There was no iotest coverage, so
    add some.
    
    While touching the documentation, tweak another section heading for
    consistent style.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-3-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 docs/system/deprecated.rst | 18 ++++++++----------
 qemu-img.c                 |  4 ++--
 tests/qemu-iotests/122     |  7 +++++++
 tests/qemu-iotests/122.out |  4 ++++
 4 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 58a9aeb851..aa9fdc8c53 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -427,14 +427,6 @@ kernel in 2018, and has also been dropped from glibc.
 Related binaries
 ----------------
 
-``qemu-img convert -n -o`` (since 4.2.0)
-''''''''''''''''''''''''''''''''''''''''
-
-All options specified in ``-o`` are image creation options, so
-they have no effect when used with ``-n`` to skip image creation.
-Silently ignored options can be confusing, so this combination of
-options will be made an error in future versions.
-
 Backwards compatibility
 -----------------------
 
@@ -540,8 +532,8 @@ spec you can use the ``-cpu rv64gcsu,priv_spec=v1.10.0`` command line argument.
 Related binaries
 ----------------
 
-``qemu-nbd --partition`` (removed in 5.0.0)
-'''''''''''''''''''''''''''''''''''''''''''
+``qemu-nbd --partition`` (removed in 5.0)
+'''''''''''''''''''''''''''''''''''''''''
 
 The ``qemu-nbd --partition $digit`` code (also spelled ``-P``)
 could only handle MBR partitions, and never correctly handled logical
@@ -557,6 +549,12 @@ can be rewritten as::
 
   qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2
 
+``qemu-img convert -n -o`` (removed in 5.1)
+'''''''''''''''''''''''''''''''''''''''''''
+
+All options specified in ``-o`` are image creation options, so
+they are now rejected when used with ``-n`` to skip image creation.
+
 Command line options
 --------------------
 
diff --git a/qemu-img.c b/qemu-img.c
index 4548dbff82..46d2796fb2 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2364,8 +2364,8 @@ static int img_convert(int argc, char **argv)
     }
 
     if (skip_create && options) {
-        warn_report("-o has no effect when skipping image creation");
-        warn_report("This will become an error in future QEMU versions.");
+        error_report("-o has no effect when skipping image creation");
+        goto fail_getopt;
     }
 
     if (s.has_zero_init && !skip_create) {
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index f7a3ae684a..2dc16b2ca4 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -290,6 +290,13 @@ TEST_IMG="$TEST_IMG".orig _make_test_img 64M
 # backing file"
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -n "$TEST_IMG" "$TEST_IMG".orig
 
+echo
+echo '=== -n incompatible with -o ==='
+echo
+
+$QEMU_IMG convert -O $IMGFMT -o preallocation=metadata -n \
+	  "$TEST_IMG" "$TEST_IMG".orig && echo "unexpected success"
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index 1a35951a80..c2e154a1e5 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -233,4 +233,8 @@ Images are identical.
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+
+=== -n incompatible with -o ===
+
+qemu-img: -o has no effect when skipping image creation
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16329.40002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7G-0001jn-PN; Fri, 30 Oct 2020 21:39:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16329.40002; Fri, 30 Oct 2020 21:39:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7G-0001jf-MR; Fri, 30 Oct 2020 21:39:22 +0000
Received: by outflank-mailman (input) for mailman id 16329;
 Fri, 30 Oct 2020 21:39:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc7F-0001jW-32
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c68a3a6f-d246-43b5-908c-adf405e8706d;
 Fri, 30 Oct 2020 21:39:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7E-0003bM-8Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7E-0000Hg-7b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc7F-0001jW-32
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:21 +0000
X-Inumbo-ID: c68a3a6f-d246-43b5-908c-adf405e8706d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c68a3a6f-d246-43b5-908c-adf405e8706d;
	Fri, 30 Oct 2020 21:39:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FoJbrXBlb04eiCE5+gwCSCsZeYsDHF5TsNxJs+XxZ3U=; b=GZJ7nTz3ZSbINQ+HqJSE80TNPh
	wcRInt4RvFg9NeNzOYrHRx41YdSE9Bq0h4bymxuDYOHWf9I+sTOZqlzJWKqPEEdkhzuy5yHJiBeFD
	oWd1aBhvpEHNCcr2J7A+3IiBsrgEXbckT8NnjYXPPrLcFmltUoK3SROldK/5FutUxwL0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7E-0003bM-8Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7E-0000Hg-7b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] sheepdog: Add trivial backing_fmt support
Message-Id: <E1kYc7E-0000Hg-7b@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:39:20 +0000

commit 80fa43e7df5d68d60a2662036b7d3d95ca8b68f3
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:47 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    sheepdog: Add trivial backing_fmt support
    
    Sheepdog already requires that if backing_file is present, that it be
    another sheepdog image (see sd_co_create).  Meanwhile, we want to move
    towards always being explicit about the backing format for other
    drivers where it matters.  So for convenience, make qemu-img create -F
    sheepdog work, while rejecting all other explicit formats (note that
    this is only for QemuOpts usage; there is no change to the QAPI to
    allow a format through -blockdev).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-4-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/sheepdog.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 6c487c8322..cbbebc1aaf 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2151,13 +2151,21 @@ static int coroutine_fn sd_co_create_opts(BlockDriver *drv,
                                           Error **errp)
 {
     BlockdevCreateOptions *create_options = NULL;
-    QDict *qdict, *location_qdict;
+    QDict *qdict = NULL, *location_qdict;
     Visitor *v;
-    char *redundancy;
+    char *redundancy = NULL;
     Error *local_err = NULL;
     int ret;
+    char *backing_fmt = NULL;
 
     redundancy = qemu_opt_get_del(opts, BLOCK_OPT_REDUNDANCY);
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+
+    if (backing_fmt && strcmp(backing_fmt, "sheepdog") != 0) {
+        error_setg(errp, "backing_file must be a sheepdog image");
+        ret = -EINVAL;
+        goto fail;
+    }
 
     qdict = qemu_opts_to_qdict(opts, NULL);
     qdict_put_str(qdict, "driver", "sheepdog");
@@ -2220,6 +2228,7 @@ fail:
     qapi_free_BlockdevCreateOptions(create_options);
     qobject_unref(qdict);
     g_free(redundancy);
+    g_free(backing_fmt);
     return ret;
 }
 
@@ -3177,6 +3186,11 @@ static QemuOptsList sd_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Must be 'sheepdog' if present",
+        },
         {
             .name = BLOCK_OPT_PREALLOC,
             .type = QEMU_OPT_STRING,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16330.40006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7Q-0001l2-RB; Fri, 30 Oct 2020 21:39:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16330.40006; Fri, 30 Oct 2020 21:39:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7Q-0001ku-Ny; Fri, 30 Oct 2020 21:39:32 +0000
Received: by outflank-mailman (input) for mailman id 16330;
 Fri, 30 Oct 2020 21:39:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc7P-0001kk-Ap
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96cf3e1f-9344-48e5-bebc-e22235e07da6;
 Fri, 30 Oct 2020 21:39:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7O-0003bV-E8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7O-0000IW-BY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc7P-0001kk-Ap
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:31 +0000
X-Inumbo-ID: 96cf3e1f-9344-48e5-bebc-e22235e07da6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96cf3e1f-9344-48e5-bebc-e22235e07da6;
	Fri, 30 Oct 2020 21:39:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6ScR+5rNwE4bWwFTzCj2vCfirp04IJPKRp13N3H3SvA=; b=eqsDmeKgcjPoKhoiLWhvjL0Rzy
	8NHAU7ks+szbDSd7TsBo4gXd/32wD1fomVO2G9nWcsbXlPH3QyIY83GyBRrRBUTCrOMFNFxWbIjls
	jTi8XB/CRlXtausUhEem6x2lJebzLQXkIjJ3Ah66OciwbUBnb8Aq0a4feZRgij95Kv94=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7O-0003bV-E8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7O-0000IW-BY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] vmdk: Add trivial backing_fmt support
Message-Id: <E1kYc7O-0000IW-BY@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:39:30 +0000

commit d51a814cf41033d2d29b050e04d85155ac941221
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:48 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    vmdk: Add trivial backing_fmt support
    
    vmdk already requires that if backing_file is present, that it be
    another vmdk image (see vmdk_co_do_create).  Meanwhile, we want to
    move towards always being explicit about the backing format for other
    drivers where it matters.  So for convenience, make qemu-img create -F
    vmdk work, while rejecting all other explicit formats (note that this
    is only for QemuOpts usage; there is no change to the QAPI to allow a
    format through -blockdev).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-5-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vmdk.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/block/vmdk.c b/block/vmdk.c
index 28cec50f38..bf9df5ce92 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2633,6 +2633,14 @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
     bool zeroed_grain;
     bool compat6;
     VMDKCreateOptsData data;
+    char *backing_fmt = NULL;
+
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+    if (backing_fmt && strcmp(backing_fmt, "vmdk") != 0) {
+        error_setg(errp, "backing_file must be a vmdk image");
+        ret = -EINVAL;
+        goto exit;
+    }
 
     if (filename_decompose(filename, path, prefix, postfix, PATH_MAX, errp)) {
         ret = -EINVAL;
@@ -2691,6 +2699,7 @@ static int coroutine_fn vmdk_co_create_opts(BlockDriver *drv,
                             vmdk_co_create_opts_cb, &data, errp);
 
 exit:
+    g_free(backing_fmt);
     g_free(adapter_type);
     g_free(backing_file);
     g_free(hw_version);
@@ -3026,6 +3035,11 @@ static QemuOptsList vmdk_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Must be 'vmdk' if present",
+        },
         {
             .name = BLOCK_OPT_COMPAT6,
             .type = QEMU_OPT_BOOL,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16331.40009 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7b-0001mn-SW; Fri, 30 Oct 2020 21:39:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16331.40009; Fri, 30 Oct 2020 21:39:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7b-0001me-Pc; Fri, 30 Oct 2020 21:39:43 +0000
Received: by outflank-mailman (input) for mailman id 16331;
 Fri, 30 Oct 2020 21:39:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc7Z-0001mO-Pd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e80114d4-168e-452b-8186-92f68d81698c;
 Fri, 30 Oct 2020 21:39:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7Y-0003cI-I2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7Y-0000JC-H7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc7Z-0001mO-Pd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:41 +0000
X-Inumbo-ID: e80114d4-168e-452b-8186-92f68d81698c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e80114d4-168e-452b-8186-92f68d81698c;
	Fri, 30 Oct 2020 21:39:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zAJcrEBwAERYBA7iZSIPon/VxpIeRnUaHzfa7NEgLuU=; b=q9jaxf64gbOVH4WabBzoc3iTq4
	23Y/otkBmqE5xN/QH6uUNOF1Wd9p7RXmeJepI7p5osR+5ywCsPuQhhIsTSEJr81fyhmkBwLxdzF6q
	1R8orEjhDFnKdMDZPwS9qi2rtSrVpfM4DT5DVJWfI+M9DlKOt6phE/gSV8muEwS6YhBU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7Y-0003cI-I2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7Y-0000JC-H7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow: Tolerate backing_fmt=
Message-Id: <E1kYc7Y-0000JC-H7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:39:40 +0000

commit 344acbd62ffdbeb7f803644ad46a8129059f6823
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:49 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qcow: Tolerate backing_fmt=
    
    qcow has no space in the metadata to store a backing format, and there
    are existing qcow images backed both by raw or by other formats
    (usually qcow) images, reliant on probing to tell the difference.  On
    the bright side, because we probe every time, raw files are marked as
    probed and we thus forbid a commit action into the backing file where
    guest-controlled contents could change the result of the probe next
    time around (the iotest added here proves that).
    
    Still, allowing the user to specify the backing format during
    creation, even if we can't record it, is a good thing.  This patch
    blindly allows any value that resolves to a known driver, even if the
    user's request is a mismatch from what probing finds; then the next
    patch will further enhance things to verify that the user's request
    matches what we actually probe.  With this and the next patch in
    place, we will finally be ready to deprecate the creation of images
    where a backing format was not explicitly specified by the user.
    
    Note that this is only for QemuOpts usage; there is no change to the
    QAPI to allow a format through -blockdev.
    
    Add a new iotest 301 just for qcow, to demonstrate the latest
    behavior, and to make it easier to show the improvements made in the
    next patch.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-6-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow.c               | 20 ++++++++++-
 tests/qemu-iotests/301     | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/301.out | 60 +++++++++++++++++++++++++++++++
 tests/qemu-iotests/group   |  1 +
 4 files changed, 168 insertions(+), 1 deletion(-)

diff --git a/block/qcow.c b/block/qcow.c
index 1e134f3445..e514a86fe5 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -938,10 +938,11 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
 {
     BlockdevCreateOptions *create_options = NULL;
     BlockDriverState *bs = NULL;
-    QDict *qdict;
+    QDict *qdict = NULL;
     Visitor *v;
     const char *val;
     int ret;
+    char *backing_fmt;
 
     static const QDictRenames opt_renames[] = {
         { BLOCK_OPT_BACKING_FILE,       "backing-file" },
@@ -949,6 +950,17 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
         { NULL, NULL },
     };
 
+    /*
+     * We can't actually store a backing format, but can check that
+     * the user's request made sense.
+     */
+    backing_fmt = qemu_opt_get_del(opts, BLOCK_OPT_BACKING_FMT);
+    if (backing_fmt && !bdrv_find_format(backing_fmt)) {
+        error_setg(errp, "unrecognized backing format '%s'", backing_fmt);
+        ret = -EINVAL;
+        goto fail;
+    }
+
     /* Parse options and convert legacy syntax */
     qdict = qemu_opts_to_qdict_filtered(opts, NULL, &qcow_create_opts, true);
 
@@ -1012,6 +1024,7 @@ static int coroutine_fn qcow_co_create_opts(BlockDriver *drv,
 
     ret = 0;
 fail:
+    g_free(backing_fmt);
     qobject_unref(qdict);
     bdrv_unref(bs);
     qapi_free_BlockdevCreateOptions(create_options);
@@ -1146,6 +1159,11 @@ static QemuOptsList qcow_create_opts = {
             .type = QEMU_OPT_STRING,
             .help = "File name of a base image"
         },
+        {
+            .name = BLOCK_OPT_BACKING_FMT,
+            .type = QEMU_OPT_STRING,
+            .help = "Format of the backing image",
+        },
         {
             .name = BLOCK_OPT_ENCRYPT,
             .type = QEMU_OPT_BOOL,
diff --git a/tests/qemu-iotests/301 b/tests/qemu-iotests/301
new file mode 100755
index 0000000000..3823e95617
--- /dev/null
+++ b/tests/qemu-iotests/301
@@ -0,0 +1,88 @@
+#!/usr/bin/env bash
+#
+# Test qcow backing file warnings
+#
+# Copyright (C) 2020 Red Hat, 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+_cleanup()
+{
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.qcow2"
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt qcow
+_supported_proto file
+_supported_os Linux
+
+size=32M
+
+echo
+echo "== qcow backed by qcow =="
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $size
+_make_test_img -b "$TEST_IMG.base" $size
+_img_info
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
+_img_info
+
+echo
+echo "== mismatched command line detection =="
+
+_make_test_img -b "$TEST_IMG.base" -F vmdk
+_make_test_img -b "$TEST_IMG.base" -F vmdk $size
+echo
+# Use of -u bypasses the backing format sanity check
+_make_test_img -u -b "$TEST_IMG.base" -F vmdk
+_make_test_img -u -b "$TEST_IMG.base" -F vmdk $size
+echo
+# But the format must still be recognized
+_make_test_img -b "$TEST_IMG.base" -F garbage $size
+_make_test_img -u -b "$TEST_IMG.base" -F garbage $size
+_img_info
+
+echo
+echo "== qcow backed by raw =="
+
+rm "$TEST_IMG.base"
+truncate --size=$size "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" $size
+_img_info
+_make_test_img -b "$TEST_IMG.base" -F raw $size
+_img_info
+
+echo
+echo "== commit cannot change type of raw backing file =="
+TEST_IMG="$TEST_IMG.qcow2" IMGFMT=qcow2 _make_test_img $size
+truncate --size=$size "$TEST_IMG.qcow2"
+$QEMU_IMG convert -n -f raw -O $IMGFMT "$TEST_IMG.qcow2" "$TEST_IMG"
+$QEMU_IMG commit -f $IMGFMT "$TEST_IMG" && echo "unexpected success"
+TEST_IMG="$TEST_IMG.base" _img_info
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
new file mode 100644
index 0000000000..adaf11d42d
--- /dev/null
+++ b/tests/qemu-iotests/301.out
@@ -0,0 +1,60 @@
+QA output created by 301
+
+== qcow backed by qcow ==
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== mismatched command line detection ==
+qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
+Could not open backing image to determine size.
+qemu-img: warning: Could not verify backing image. This may become an error in future versions.
+invalid VMDK image descriptor
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+
+qemu-img: TEST_DIR/t.IMGFMT: Image creation needs a size parameter
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+
+qemu-img: warning: Could not verify backing image. This may become an error in future versions.
+Unknown driver 'garbage'
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
+qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
+qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== qcow backed by raw ==
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 32 MiB (33554432 bytes)
+cluster_size: 512
+backing file: TEST_DIR/t.IMGFMT.base
+
+== commit cannot change type of raw backing file ==
+Formatting 'TEST_DIR/t.qcow.IMGFMT', fmt=IMGFMT size=33554432
+qemu-img: Block job failed: Operation not permitted
+image: TEST_DIR/t.IMGFMT.base
+file format: raw
+virtual size: 32 MiB (33554432 bytes)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 9b07a7ed03..a4f9e11e7a 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -306,3 +306,4 @@
 295 rw
 296 rw
 297 meta
+301 backing quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:39:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:39:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16333.40014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7l-0001oE-UQ; Fri, 30 Oct 2020 21:39:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16333.40014; Fri, 30 Oct 2020 21:39:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7l-0001o6-RE; Fri, 30 Oct 2020 21:39:53 +0000
Received: by outflank-mailman (input) for mailman id 16333;
 Fri, 30 Oct 2020 21:39:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc7j-0001nt-VE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id beea140e-2084-4954-8bd5-40599a3f82dd;
 Fri, 30 Oct 2020 21:39:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7i-0003cO-MD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7i-0000Jt-LK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc7j-0001nt-VE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:51 +0000
X-Inumbo-ID: beea140e-2084-4954-8bd5-40599a3f82dd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id beea140e-2084-4954-8bd5-40599a3f82dd;
	Fri, 30 Oct 2020 21:39:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CKSmkXofPBmyDrhb9y+nNaOd3Md/bhwRPlaGpZ40RYM=; b=A/C/sLHGVbfonFoL84qEHOsLH2
	dj4QtP1yOXhGgp661LKRDcXttOXhVkV0OuCpXcNgR342DWPKmzhgQkjN+86xiPp+7HkC/5rSq9VEp
	Um2vpG2owXEYXo16anmlN7bM7P1UkLcHfHAesYbPtNHiF7iIvOGeKdR4e+Se7baxJjkg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7i-0003cO-MD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7i-0000Jt-LK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:39:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Error if backing file fails during creation without -u
Message-Id: <E1kYc7i-0000Jt-LK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:39:50 +0000

commit add8200dd14041d059cc376eff91461fadd93ec5
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:50 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Error if backing file fails during creation without -u
    
    Back in commit 6e6e55f5 (Jul 2017, v2.10), we tweaked the code to warn
    if the backing file could not be opened but the user gave a size,
    unless the user also passes the -u option to bypass the open of the
    backing file.  As one common reason for failure to open the backing
    file is when there is mismatch in the requested backing format in
    relation to what the backing file actually contains, we actually want
    to open the backing file and ensure that it has the right format in as
    many cases as possible.  iotest 301 for qcow demonstrates how
    detecting explicit format mismatch is useful to prevent the creation
    of an image that would probe differently than the user requested.  Now
    is the time to finally turn the warning an error, as promised.
    
    Note that the original warning was added prior to our documentation of
    an official deprecation policy (eb22aeca, also Jul 2017), and because
    the warning didn't mention the word "deprecated", we never actually
    remembered to document it as such.  But the warning has been around
    long enough that I don't see prolonging it another two releases.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-7-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 12 ++----------
 docs/system/deprecated.rst | 12 ++++++++++++
 tests/qemu-iotests/111.out |  2 +-
 tests/qemu-iotests/301.out | 13 +++++--------
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/block.c b/block.c
index 98cad57cda..6925e57d7c 100644
--- a/block.c
+++ b/block.c
@@ -6128,16 +6128,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
         bs = bdrv_open(full_backing, NULL, backing_options, back_flags,
                        &local_err);
         g_free(full_backing);
-        if (!bs && size != -1) {
-            /* Couldn't open BS, but we have a size, so it's nonfatal */
-            warn_reportf_err(local_err,
-                            "Could not verify backing image. "
-                            "This may become an error in future versions.\n");
-            local_err = NULL;
-        } else if (!bs) {
-            /* Couldn't open bs, do not have size */
-            error_append_hint(&local_err,
-                              "Could not open backing image to determine size.\n");
+        if (!bs) {
+            error_append_hint(&local_err, "Could not open backing image.\n");
             goto out;
         } else {
             if (size == -1) {
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index aa9fdc8c53..c014e049c3 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -555,6 +555,18 @@ can be rewritten as::
 All options specified in ``-o`` are image creation options, so
 they are now rejected when used with ``-n`` to skip image creation.
 
+
+``qemu-img create -b bad file $size`` (removed in 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+When creating an image with a backing file that could not be opened,
+``qemu-img create`` used to issue a warning about the failure but
+proceed with the image creation if an explicit size was provided.
+However, as the ``-u`` option exists for this purpose, it is safer to
+enforce that any failure to open the backing image (including if the
+backing file is missing or an incorrect format was specified) is an
+error when ``-u`` is not used.
+
 Command line options
 --------------------
 
diff --git a/tests/qemu-iotests/111.out b/tests/qemu-iotests/111.out
index 5279c462fc..ba034e5c58 100644
--- a/tests/qemu-iotests/111.out
+++ b/tests/qemu-iotests/111.out
@@ -1,4 +1,4 @@
 QA output created by 111
 qemu-img: TEST_DIR/t.IMGFMT: Could not open 'TEST_DIR/t.IMGFMT.inexistent': No such file or directory
-Could not open backing image to determine size.
+Could not open backing image.
 *** done
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
index adaf11d42d..281a16d87a 100644
--- a/tests/qemu-iotests/301.out
+++ b/tests/qemu-iotests/301.out
@@ -17,18 +17,15 @@ backing file: TEST_DIR/t.IMGFMT.base
 
 == mismatched command line detection ==
 qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
-Could not open backing image to determine size.
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-invalid VMDK image descriptor
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
+Could not open backing image.
+qemu-img: TEST_DIR/t.IMGFMT: invalid VMDK image descriptor
+Could not open backing image.
 
 qemu-img: TEST_DIR/t.IMGFMT: Image creation needs a size parameter
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=vmdk
 
-qemu-img: warning: Could not verify backing image. This may become an error in future versions.
-Unknown driver 'garbage'
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
-qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
+qemu-img: TEST_DIR/t.IMGFMT: Unknown driver 'garbage'
+Could not open backing image.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=garbage
 qemu-img: TEST_DIR/t.IMGFMT: unrecognized backing format 'garbage'
 image: TEST_DIR/t.IMGFMT
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16334.40018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7w-00023Y-30; Fri, 30 Oct 2020 21:40:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16334.40018; Fri, 30 Oct 2020 21:40:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc7v-00023M-Us; Fri, 30 Oct 2020 21:40:03 +0000
Received: by outflank-mailman (input) for mailman id 16334;
 Fri, 30 Oct 2020 21:40:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc7t-0001tl-Ua
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1dd8dd97-eb4f-4e39-b7ee-c444d2904043;
 Fri, 30 Oct 2020 21:40:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7s-0003cY-Qj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc7s-0000KN-PT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc7t-0001tl-Ua
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:01 +0000
X-Inumbo-ID: 1dd8dd97-eb4f-4e39-b7ee-c444d2904043
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1dd8dd97-eb4f-4e39-b7ee-c444d2904043;
	Fri, 30 Oct 2020 21:40:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jPe0E/XwJzV33j56BEflly9ziFTaCdE1wrw1NnluHh4=; b=XVpoDrK7PSrIvyTNibKGon8uvo
	2OXMKUwDznnC4FZITJY6jdzQZNYnc5kYNrOgeNLb0OcDUiQSHoaI5Xlx7tF3YglbRk3xMQ1Elo8XU
	+SIzwysqIQs+rd65cNLRiBqYk8+UJSC8hsGfQnrr9wjuTR2hLOUYpDZBQZaTTCEPG3eY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7s-0003cY-Qj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc7s-0000KN-PT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow2: Deprecate use of qemu-img amend to change backing file
Message-Id: <E1kYc7s-0000KN-PT@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:00 +0000

commit bc5ee6da7122f6fe93ed07241a44315a331487e9
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:51 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    qcow2: Deprecate use of qemu-img amend to change backing file
    
    The use of 'qemu-img amend' to change qcow2 backing files is not
    tested very well.  In particular, our implementation has a bug where
    if a new backing file is provided without a format, then the prior
    format is blindly reused, even if this results in data corruption, but
    this is not caught by iotests.
    
    There are also situations where amending other options needs access to
    the original backing file (for example, on a downgrade to a v2 image,
    knowing whether a v3 zero cluster must be allocated or may be left
    unallocated depends on knowing whether the backing file already reads
    as zero), but the command line does not have a nice way to tell us
    both the backing file to use for opening the image as well as the
    backing file to install after the operation is complete.
    
    Even if we do allow changing the backing file, it is redundant with
    the existing ability to change backing files via 'qemu-img rebase -u'.
    It is time to deprecate this support (leaving the existing behavior
    intact, even if it is buggy), and at a point in the future, require
    the use of only 'qemu-img rebase' for adjusting backing chain
    relations, saving 'qemu-img amend' for changes unrelated to the
    backing chain.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-8-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c              |  5 +++++
 docs/system/deprecated.rst | 12 ++++++++++++
 docs/tools/qemu-img.rst    |  4 ++++
 tests/qemu-iotests/061.out |  1 +
 tests/qemu-iotests/082.out |  2 ++
 5 files changed, 24 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index ea33673c55..f3fc2707cd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -5511,6 +5511,11 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
     }
 
     if (backing_file || backing_format) {
+        if (g_strcmp0(backing_file, s->image_backing_file) ||
+            g_strcmp0(backing_format, s->image_backing_format)) {
+            warn_report("Deprecated use of amend to alter the backing file; "
+                        "use qemu-img rebase instead");
+        }
         ret = qcow2_change_backing_file(bs,
                     backing_file ?: s->image_backing_file,
                     backing_format ?: s->image_backing_format);
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index c014e049c3..c1f019b9d2 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -427,6 +427,18 @@ kernel in 2018, and has also been dropped from glibc.
 Related binaries
 ----------------
 
+qemu-img amend to adjust backing file (since 5.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''
+
+The use of ``qemu-img amend`` to modify the name or format of a qcow2
+backing image is deprecated; this functionality was never fully
+documented or tested, and interferes with other amend operations that
+need access to the original backing image (such as deciding whether a
+v3 zero cluster may be left unallocated when converting to a v2
+image).  Rather, any changes to the backing chain should be performed
+with ``qemu-img rebase -u`` either before or after the remaining
+changes being performed by amend, as appropriate.
+
 Backwards compatibility
 -----------------------
 
diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
index e33f5575e3..c35bd64822 100644
--- a/docs/tools/qemu-img.rst
+++ b/docs/tools/qemu-img.rst
@@ -258,6 +258,10 @@ Command description:
   Amends the image format specific *OPTIONS* for the image file
   *FILENAME*. Not all file formats support this operation.
 
+  The set of options that can be amended are dependent on the image
+  format, but note that amending the backing chain relationship should
+  instead be performed with ``qemu-img rebase``.
+
   --force allows some unsafe operations. Currently for -f luks, it allows to
   erase the last encryption key, and to overwrite an active encryption key.
 
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index b0f8befe30..44e3c624f9 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -370,6 +370,7 @@ wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index f7b3d54b28..a38a26fc57 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -783,10 +783,12 @@ Amend options for 'qcow2':
   size=<size>            - Virtual disk size
 
 Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 
 Testing: rebase -u -b  -f qcow2 TEST_DIR/t.qcow2
 
 Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2
+qemu-img: warning: Deprecated use of amend to alter the backing file; use qemu-img rebase instead
 
 Testing: rebase -u -b  -f qcow2 TEST_DIR/t.qcow2
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16335.40022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8E-0002WH-5z; Fri, 30 Oct 2020 21:40:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16335.40022; Fri, 30 Oct 2020 21:40:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8E-0002WA-0o; Fri, 30 Oct 2020 21:40:22 +0000
Received: by outflank-mailman (input) for mailman id 16335;
 Fri, 30 Oct 2020 21:40:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8C-0002W5-BL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9c1dbefb-fcde-4d66-b74f-dc37c8764d2d;
 Fri, 30 Oct 2020 21:40:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc83-0003cs-2K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc83-0000Lo-1G
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8C-0002W5-BL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:20 +0000
X-Inumbo-ID: 9c1dbefb-fcde-4d66-b74f-dc37c8764d2d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9c1dbefb-fcde-4d66-b74f-dc37c8764d2d;
	Fri, 30 Oct 2020 21:40:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=epMPXHYTDTeZ6N5tp1gA8F9oIuGLTadIL5GWCe+sJwM=; b=iadWF6/ZoEWBQuTAlCXwfkAY2s
	4SwgWmmij8mKFWyhsnfZ9CfYkl49fD86gob32Ve/i2pG0bL9U/GSaroNMOzjJ0V36VMD8cBc1UXBG
	YBdbOJ+MVHOLYTKoQiyWz1ELwra+iy/xlcJAiSZgxP8yxVJ0x1yVhbU0HEfZQh3k2FcE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc83-0003cs-2K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc83-0000Lo-1G
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Specify explicit backing format where sensible
Message-Id: <E1kYc83-0000Lo-1G@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:11 +0000

commit b66ff2c29817f5efa18f5120fd6f089fbf59a933
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:52 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    iotests: Specify explicit backing format where sensible
    
    There are many existing qcow2 images that specify a backing file but
    no format.  This has been the source of CVEs in the past, but has
    become more prominent of a problem now that libvirt has switched to
    -blockdev.  With older -drive, at least the probing was always done by
    qemu (so the only risk of a changed format between successive boots of
    a guest was if qemu was upgraded and probed differently).  But with
    newer -blockdev, libvirt must specify a format; if libvirt guesses raw
    where the image was formatted, this results in data corruption visible
    to the guest; conversely, if libvirt guesses qcow2 where qemu was
    using raw, this can result in potential security holes, so modern
    libvirt instead refuses to use images without explicit backing format.
    
    The change in libvirt to reject images without explicit backing format
    has pointed out that a number of tools have been far too reliant on
    probing in the past.  It's time to set a better example in our own
    iotests of properly setting this parameter.
    
    iotest calls to create, rebase, and convert are all impacted to some
    degree.  It's a bit annoying that we are inconsistent on command line
    - while all of those accept -o backing_file=...,backing_fmt=..., the
    shortcuts are different: create and rebase have -b and -F, while
    convert has -B but no -F.  (amend has no shortcuts, but the previous
    patch just deprecated the use of amend to change backing chains).
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-9-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/017        |  2 +-
 tests/qemu-iotests/017.out    |  2 +-
 tests/qemu-iotests/018        |  2 +-
 tests/qemu-iotests/018.out    |  2 +-
 tests/qemu-iotests/019        |  5 +++--
 tests/qemu-iotests/019.out    |  2 +-
 tests/qemu-iotests/020        |  4 ++--
 tests/qemu-iotests/020.out    |  4 ++--
 tests/qemu-iotests/024        | 10 ++++-----
 tests/qemu-iotests/024.out    |  4 ++--
 tests/qemu-iotests/028        |  4 ++--
 tests/qemu-iotests/028.out    |  2 +-
 tests/qemu-iotests/030        | 26 +++++++++++++++++-------
 tests/qemu-iotests/034        |  2 +-
 tests/qemu-iotests/034.out    |  2 +-
 tests/qemu-iotests/037        |  2 +-
 tests/qemu-iotests/037.out    |  2 +-
 tests/qemu-iotests/038        |  2 +-
 tests/qemu-iotests/038.out    |  2 +-
 tests/qemu-iotests/039        |  3 ++-
 tests/qemu-iotests/039.out    |  2 +-
 tests/qemu-iotests/040        | 47 +++++++++++++++++++++++++++++++------------
 tests/qemu-iotests/041        | 37 +++++++++++++++++++++++-----------
 tests/qemu-iotests/042        |  4 ++--
 tests/qemu-iotests/043        | 23 +++++++++++----------
 tests/qemu-iotests/043.out    | 12 +++++------
 tests/qemu-iotests/046        |  2 +-
 tests/qemu-iotests/046.out    |  2 +-
 tests/qemu-iotests/050        |  4 ++--
 tests/qemu-iotests/050.out    |  2 +-
 tests/qemu-iotests/051        |  2 +-
 tests/qemu-iotests/051.out    |  2 +-
 tests/qemu-iotests/051.pc.out |  2 +-
 tests/qemu-iotests/056        |  3 ++-
 tests/qemu-iotests/060        |  2 +-
 tests/qemu-iotests/060.out    |  2 +-
 tests/qemu-iotests/061        | 10 ++++-----
 tests/qemu-iotests/061.out    | 10 ++++-----
 tests/qemu-iotests/069        |  2 +-
 tests/qemu-iotests/069.out    |  2 +-
 tests/qemu-iotests/073        |  2 +-
 tests/qemu-iotests/073.out    |  2 +-
 tests/qemu-iotests/082        | 10 +++++----
 tests/qemu-iotests/082.out    | 12 +++++------
 tests/qemu-iotests/085        |  4 ++--
 tests/qemu-iotests/085.out    |  6 +++---
 tests/qemu-iotests/089        |  2 +-
 tests/qemu-iotests/089.out    |  2 +-
 tests/qemu-iotests/095        |  4 ++--
 tests/qemu-iotests/095.out    |  4 ++--
 tests/qemu-iotests/097        |  4 ++--
 tests/qemu-iotests/097.out    | 16 +++++++--------
 tests/qemu-iotests/098        |  2 +-
 tests/qemu-iotests/098.out    |  8 ++++----
 tests/qemu-iotests/110        |  4 ++--
 tests/qemu-iotests/110.out    |  4 ++--
 tests/qemu-iotests/122        | 27 +++++++++++++++----------
 tests/qemu-iotests/122.out    |  8 ++++----
 tests/qemu-iotests/126        |  4 ++--
 tests/qemu-iotests/126.out    |  4 ++--
 tests/qemu-iotests/127        |  4 ++--
 tests/qemu-iotests/127.out    |  4 ++--
 tests/qemu-iotests/129        |  3 ++-
 tests/qemu-iotests/133        |  2 +-
 tests/qemu-iotests/133.out    |  2 +-
 tests/qemu-iotests/139        |  2 +-
 tests/qemu-iotests/141        |  4 ++--
 tests/qemu-iotests/141.out    |  4 ++--
 tests/qemu-iotests/142        |  2 +-
 tests/qemu-iotests/142.out    |  2 +-
 tests/qemu-iotests/153        | 14 ++++++-------
 tests/qemu-iotests/153.out    | 35 +++++++++++++++++---------------
 tests/qemu-iotests/154        | 42 +++++++++++++++++++-------------------
 tests/qemu-iotests/154.out    | 42 +++++++++++++++++++-------------------
 tests/qemu-iotests/155        | 12 +++++++----
 tests/qemu-iotests/156        |  9 +++++----
 tests/qemu-iotests/156.out    |  6 +++---
 tests/qemu-iotests/158        |  2 +-
 tests/qemu-iotests/158.out    |  2 +-
 tests/qemu-iotests/161        |  8 ++++----
 tests/qemu-iotests/161.out    |  8 ++++----
 tests/qemu-iotests/176        |  4 ++--
 tests/qemu-iotests/176.out    | 32 ++++++++++++++---------------
 tests/qemu-iotests/177        |  2 +-
 tests/qemu-iotests/177.out    |  2 +-
 tests/qemu-iotests/179        |  2 +-
 tests/qemu-iotests/179.out    |  2 +-
 tests/qemu-iotests/189        |  2 +-
 tests/qemu-iotests/189.out    |  2 +-
 tests/qemu-iotests/191        | 12 +++++------
 tests/qemu-iotests/191.out    | 12 +++++------
 tests/qemu-iotests/195        |  6 +++---
 tests/qemu-iotests/195.out    |  6 +++---
 tests/qemu-iotests/198        |  2 +-
 tests/qemu-iotests/198.out    |  3 ++-
 tests/qemu-iotests/204        |  2 +-
 tests/qemu-iotests/204.out    |  2 +-
 tests/qemu-iotests/216        |  2 +-
 tests/qemu-iotests/224        |  4 ++--
 tests/qemu-iotests/225        |  2 +-
 tests/qemu-iotests/225.out    |  2 +-
 tests/qemu-iotests/228        |  5 +++--
 tests/qemu-iotests/245        |  3 ++-
 tests/qemu-iotests/249        |  4 ++--
 tests/qemu-iotests/249.out    |  4 ++--
 tests/qemu-iotests/252        |  2 +-
 tests/qemu-iotests/257        |  3 ++-
 tests/qemu-iotests/267        |  4 ++--
 tests/qemu-iotests/267.out    |  6 +++---
 tests/qemu-iotests/270        |  2 +-
 tests/qemu-iotests/270.out    |  2 +-
 tests/qemu-iotests/273        |  4 ++--
 tests/qemu-iotests/273.out    |  4 ++--
 tests/qemu-iotests/274        | 12 +++++------
 tests/qemu-iotests/274.out    | 29 ++++++++++++++------------
 tests/qemu-iotests/279        |  4 ++--
 tests/qemu-iotests/279.out    |  4 ++--
 tests/qemu-iotests/290        |  2 +-
 tests/qemu-iotests/290.out    |  4 ++--
 119 files changed, 434 insertions(+), 361 deletions(-)

diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 0a4b854e65..585512bb29 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG=$TEST_IMG_SAVE
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
diff --git a/tests/qemu-iotests/017.out b/tests/qemu-iotests/017.out
index 8fc9241942..f439d3ece3 100644
--- a/tests/qemu-iotests/017.out
+++ b/tests/qemu-iotests/017.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
index c69ce09209..191b461a4d 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE.orig"
-_make_test_img -b "$TEST_IMG_SAVE.base" 6G
+_make_test_img -b "$TEST_IMG_SAVE.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
diff --git a/tests/qemu-iotests/018.out b/tests/qemu-iotests/018.out
index 5df966727f..0ab664ca4b 100644
--- a/tests/qemu-iotests/018.out
+++ b/tests/qemu-iotests/018.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index 813a84acac..d3c11256dc 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -74,7 +74,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE.orig"
-_make_test_img -b "$TEST_IMG_SAVE.base" 6G
+_make_test_img -b "$TEST_IMG_SAVE.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
@@ -98,7 +98,8 @@ for backing_option in "-B " "-o backing_file="; do
     echo
     echo Testing conversion with $backing_option"$TEST_IMG.base" | _filter_testdir | _filter_imgfmt
     echo
-    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG"
+    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT $backing_option"$TEST_IMG.base" \
+        -o backing_fmt=$IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
 
     echo "Checking if backing clusters are allocated when they shouldn't"
     echo
diff --git a/tests/qemu-iotests/019.out b/tests/qemu-iotests/019.out
index 17a7c036b9..0fa73bd69a 100644
--- a/tests/qemu-iotests/019.out
+++ b/tests/qemu-iotests/019.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4296015872
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 43
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index b488000cb9..a0782937b0 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -70,7 +70,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE"
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo "Filling test image"
 echo
@@ -131,7 +131,7 @@ backing="json:{'driver': '$IMGFMT',
 # Filter out newlines and collapse spaces
 backing=$(echo "$backing" | tr -d '\n' | tr -s ' ')
 
-_make_test_img -b "$backing"
+_make_test_img -b "$backing" -F $IMGFMT
 
 # Just write anything so committing will not be a no-op
 $QEMU_IO -c 'writev 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/020.out b/tests/qemu-iotests/020.out
index 4668ac59df..5936bc1cae 100644
--- a/tests/qemu-iotests/020.out
+++ b/tests/qemu-iotests/020.out
@@ -269,7 +269,7 @@ wrote 65536/65536 bytes at offset 4295032832
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 1
@@ -1079,7 +1079,7 @@ No errors were found on the image.
 Testing failing commit
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}}
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=json:{'driver': 'IMGFMT',, 'file': { 'driver': 'blkdebug',, 'inject-error': [{ 'event': 'write_aio',, 'errno': 28,, 'once': true }],, 'image': { 'driver': 'file',, 'filename': 'TEST_DIR/t.IMGFMT.base' }}} backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Block job failed: No space left on device
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
index e2e766241e..12aceb2d41 100755
--- a/tests/qemu-iotests/024
+++ b/tests/qemu-iotests/024
@@ -83,7 +83,7 @@ TEST_IMG="$TEST_IMG_SAVE"
 echo "Creating COW image"
 echo
 
-_make_test_img -b "$TEST_IMG.base_old" 1G
+_make_test_img -b "$TEST_IMG.base_old" -F $IMGFMT 1G
 io_pattern writev 0 $((4 * CLUSTER_SIZE)) 0 1 0x33
 io_pattern writev $((8 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 0 1 0x33
 
@@ -109,7 +109,7 @@ io_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00
 echo
 echo Rebase and test again
 echo
-$QEMU_IMG rebase -b "$TEST_IMG.base_new" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.base_new" -F $IMGFMT "$TEST_IMG"
 io_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
 io_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
 io_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
@@ -159,7 +159,7 @@ OVERLAY="$TEST_DIR/$OVERLAY_WREL"
 
 TEST_IMG=$BASE_OLD _make_test_img 1M
 TEST_IMG=$BASE_NEW _make_test_img 1M
-TEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD_OREL" 1M
+TEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD_OREL" -F $IMGFMT 1M
 
 echo
 
@@ -176,11 +176,11 @@ $QEMU_IO "$BASE_NEW" \
 echo
 
 pushd "$TEST_DIR" >/dev/null
-$QEMU_IMG rebase -f "$IMGFMT" -b "$BASE_NEW_OREL" "$OVERLAY_WREL"
+$QEMU_IMG rebase -f "$IMGFMT" -b "$BASE_NEW_OREL" -F $IMGFMT "$OVERLAY_WREL"
 popd >/dev/null
 
 # Verify the backing path is correct
-TEST_IMG=$OVERLAY _img_info | grep '^backing file'
+TEST_IMG=$OVERLAY _img_info | grep '^backing file:'
 
 echo
 
diff --git a/tests/qemu-iotests/024.out b/tests/qemu-iotests/024.out
index 024dc786b3..973a5a3711 100644
--- a/tests/qemu-iotests/024.out
+++ b/tests/qemu-iotests/024.out
@@ -33,7 +33,7 @@ wrote 131072/131072 bytes at offset 786432
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Creating COW image
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base_old
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base_old backing_fmt=IMGFMT
 === IO: pattern 0x33
 wrote 262144/262144 bytes at offset 0
 256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -146,7 +146,7 @@ read 65536/65536 bytes at offset 983040
 
 Formatting 'TEST_DIR/subdir/t.IMGFMT.base_old', fmt=IMGFMT size=1048576
 Formatting 'TEST_DIR/subdir/t.IMGFMT.base_new', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/subdir/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=t.IMGFMT.base_old
+Formatting 'TEST_DIR/subdir/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=t.IMGFMT.base_old backing_fmt=IMGFMT
 
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 797dae5350..5d043cef92 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -76,7 +76,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG="$TEST_IMG_SAVE"
-_make_test_img -b "$TEST_IMG.base" $image_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
 
 echo "Filling test image"
 echo
@@ -101,7 +101,7 @@ io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 _check_test_img
 
 # Rebase it on top of its base image
-$QEMU_IMG rebase -b "$TEST_IMG.base" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.base" -F $IMGFMT "$TEST_IMG"
 
 echo
 echo block-backup
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 37aed84436..12f82c6a6c 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -70,7 +70,7 @@ wrote 512/512 bytes at offset 3221225984
 No errors were found on the image.
 Creating test image with backing file
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Filling test image
 
 === IO: pattern 196
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 1cdd7e2999..256b2bfbc6 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -32,8 +32,12 @@ class TestSingleDrive(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestSingleDrive.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img)
         self.vm = iotests.VM().add_drive("blkdebug::" + test_img,
@@ -199,7 +203,8 @@ class TestParallelOps(iotests.QMPTestCase):
         iotests.create_image(self.imgs[0], self.image_len)
         for i in range(1, self.num_imgs):
             qemu_img('create', '-f', iotests.imgfmt,
-                     '-o', 'backing_file=%s' % self.imgs[i-1], self.imgs[i])
+                     '-o', 'backing_file=%s' % self.imgs[i-1],
+                     '-F', 'raw' if i == 1 else iotests.imgfmt, self.imgs[i])
 
         # Put data into the images we are copying data from
         odd_img_indexes = [x for x in reversed(range(self.num_imgs)) if x % 2 == 1]
@@ -544,7 +549,8 @@ class TestQuorum(iotests.QMPTestCase):
             qemu_io('-f', iotests.imgfmt,
                     '-c', 'write -P 0x55 0 1024', backing_img)
             qemu_img('create', '-f', iotests.imgfmt,
-                     '-o', 'backing_file=%s' % backing_img, child_img)
+                     '-o', 'backing_file=%s' % backing_img,
+                     '-F', iotests.imgfmt, child_img)
             opts.append("children.%d.file.filename=%s" % (i, child_img))
             opts.append("children.%d.node-name=node%d" % (i, i))
 
@@ -585,7 +591,9 @@ class TestSmallerBackingFile(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.backing_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img, str(self.image_len))
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img, str(self.image_len))
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
@@ -848,7 +856,9 @@ class TestStreamStop(iotests.QMPTestCase):
     def setUp(self):
         qemu_img('create', backing_img, str(TestStreamStop.image_len))
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive("blkdebug::" + test_img)
         self.vm.launch()
@@ -879,7 +889,9 @@ class TestSetSpeed(iotests.QMPTestCase):
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img)
         self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
         self.vm.launch()
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
index da4cea1571..ac2d687c71 100755
--- a/tests/qemu-iotests/034
+++ b/tests/qemu-iotests/034
@@ -58,7 +58,7 @@ $QEMU_IO -c "write -P 0x55 0 1M" "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== zero write with backing file =="
diff --git a/tests/qemu-iotests/034.out b/tests/qemu-iotests/034.out
index 0764ead8b9..478205ad25 100644
--- a/tests/qemu-iotests/034.out
+++ b/tests/qemu-iotests/034.out
@@ -4,7 +4,7 @@ QA output created by 034
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == zero write with backing file ==
 wrote 196608/196608 bytes at offset 65536
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
index e6517acbd4..e1187ac24a 100755
--- a/tests/qemu-iotests/037
+++ b/tests/qemu-iotests/037
@@ -74,7 +74,7 @@ backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== COW in a single cluster =="
diff --git a/tests/qemu-iotests/037.out b/tests/qemu-iotests/037.out
index cd6710c901..30ef989b64 100644
--- a/tests/qemu-iotests/037.out
+++ b/tests/qemu-iotests/037.out
@@ -514,7 +514,7 @@ wrote 512/512 bytes at offset 130048
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 130560
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == COW in a single cluster ==
 wrote 2048/2048 bytes at offset 0
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
index 707e2d72e9..a253231f5b 100755
--- a/tests/qemu-iotests/038
+++ b/tests/qemu-iotests/038
@@ -71,7 +71,7 @@ backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== Some concurrent requests touching the same cluster =="
diff --git a/tests/qemu-iotests/038.out b/tests/qemu-iotests/038.out
index 0bdfb19faa..fe2108593a 100644
--- a/tests/qemu-iotests/038.out
+++ b/tests/qemu-iotests/038.out
@@ -514,7 +514,7 @@ wrote 65536/65536 bytes at offset 16646144
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 16711680
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Some concurrent requests touching the same cluster ==
 wrote 65536/65536 bytes at offset XXX
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index ddce48ab47..42f6503138 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -133,7 +133,8 @@ echo "== Committing to a backing file with lazy_refcounts=on =="
 
 TEST_IMG="$TEST_IMG".base _make_test_img -o "compat=1.1,lazy_refcounts=on" $size
 
-_make_test_img -o "compat=1.1,lazy_refcounts=on,backing_file=$TEST_IMG.base" $size
+_make_test_img -o "compat=1.1,lazy_refcounts=on,backing_file=$TEST_IMG.base" \
+    -F $IMGFMT $size
 
 $QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG commit "$TEST_IMG"
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index bdafa3ace3..e52484d4be 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -66,7 +66,7 @@ No errors were found on the image.
 
 == Committing to a backing file with lazy_refcounts=on ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Image committed.
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 32c82b4ec6..f58f50d023 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -80,8 +80,11 @@ class TestSingleDrive(ImageCommitTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
         self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=mid,backing.backing.node-name=base", interface="none")
@@ -305,10 +308,16 @@ class TestRelativePaths(ImageCommitTestCase):
             if exception.errno != errno.EEXIST:
                 raise
         iotests.create_image(self.backing_img_abs, TestRelativePaths.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.backing_img_abs, self.mid_img_abs)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.mid_img_abs, self.test_img)
-        qemu_img('rebase', '-u', '-b', self.backing_img, self.mid_img_abs)
-        qemu_img('rebase', '-u', '-b', self.mid_img, self.test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.backing_img_abs,
+                 '-F', 'raw', self.mid_img_abs)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.mid_img_abs,
+                 '-F', iotests.imgfmt, self.test_img)
+        qemu_img('rebase', '-u', '-b', self.backing_img,
+                 '-F', 'raw', self.mid_img_abs)
+        qemu_img('rebase', '-u', '-b', self.mid_img,
+                 '-F', iotests.imgfmt, self.test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', self.backing_img_abs)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', self.mid_img_abs)
         self.vm = iotests.VM().add_drive(self.test_img)
@@ -371,8 +380,11 @@ class TestSetSpeed(ImageCommitTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 0 512', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img)
         self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
@@ -410,9 +422,14 @@ class TestReopenOverlay(ImageCommitTestCase):
 
     def setUp(self):
         iotests.create_image(self.img0, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img0, self.img1)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img1, self.img2)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % self.img2, self.img3)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img0, '-F', 'raw', self.img1)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img1,
+                 '-F', iotests.imgfmt, self.img2)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % self.img2,
+                 '-F', iotests.imgfmt, self.img3)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xab 0 128K', self.img1)
         self.vm = iotests.VM().add_drive(self.img3)
         self.vm.launch()
@@ -435,8 +452,12 @@ class TestErrorHandling(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, mid_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img,
+                 '-F', 'raw', mid_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % mid_img,
+                 '-F', iotests.imgfmt, test_img)
 
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x11 0 512k', mid_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x22 0 512k', test_img)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index b843f88a66..f0a7bf6650 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -44,7 +44,8 @@ class TestSingleDrive(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, self.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img, "node-name=top,backing.node-name=base")
         if iotests.qemu_default_machine == 'pc':
             self.vm.add_drive(None, 'media=cdrom', 'ide')
@@ -157,7 +158,8 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'cluster_size=%d,backing_file=%s'
-                        % (self.image_len, backing_img), target_img)
+                        % (self.image_len, backing_img),
+                 '-F', 'raw', target_img)
         result = self.vm.qmp(self.qmp_cmd, device='drive0', sync='full',
                              mode='existing', target=self.qmp_target)
         self.assert_qmp(result, 'return', {})
@@ -227,7 +229,8 @@ class TestSingleBlockdev(TestSingleDrive):
 
     def setUp(self):
         TestSingleDrive.setUp(self)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         args = {'driver': iotests.imgfmt,
                 'node-name': self.qmp_target,
                 'file': { 'filename': target_img, 'driver': 'file' } }
@@ -312,7 +315,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestMirrorNoBacking.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
@@ -329,7 +333,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
     def test_complete(self):
         self.assert_no_active_block_jobs()
 
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
         self.assert_qmp(result, 'return', {})
@@ -344,7 +349,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
     def test_cancel(self):
         self.assert_no_active_block_jobs()
 
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
         self.assert_qmp(result, 'return', {})
@@ -363,7 +369,8 @@ class TestMirrorNoBacking(iotests.QMPTestCase):
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'size=%d'
                         %(TestMirrorNoBacking.image_len), target_backing_img)
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'cluster_size=%d,backing_file=%s'
-                        % (TestMirrorNoBacking.image_len, target_backing_img), target_img)
+                        % (TestMirrorNoBacking.image_len, target_backing_img),
+                 '-F', iotests.imgfmt, target_img)
 
         result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
                              mode='existing', target=target_img)
@@ -382,7 +389,8 @@ class TestMirrorResized(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.create_image(backing_img, TestMirrorResized.backing_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         qemu_img('resize', test_img, '2M')
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
@@ -528,7 +536,9 @@ new_state = "1"
         # Test COW into the target image.  The first half of the
         # cluster at MIRROR_GRANULARITY has to be copied from
         # backing_img, even though sync='top'.
-        qemu_img('create', '-f', iotests.imgfmt, '-ocluster_size=131072,backing_file=%s' %(backing_img), target_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-ocluster_size=131072,backing_file=%s' %(backing_img),
+                 '-F', 'raw', target_img)
         result = self.vm.qmp('drive-mirror', device='drive0', sync='top',
                              on_source_error='ignore',
                              mode='existing', target=target_img)
@@ -548,7 +558,8 @@ new_state = "1"
         self.vm.shutdown()
 
         # Detach blkdebug to compare images successfully
-        qemu_img('rebase', '-f', iotests.imgfmt, '-u', '-b', backing_img, test_img)
+        qemu_img('rebase', '-f', iotests.imgfmt, '-u', '-b', backing_img,
+                 '-F', 'raw', test_img)
         self.assertTrue(iotests.compare_images(test_img, target_img),
                         'target image does not match source after mirroring')
 
@@ -620,7 +631,8 @@ new_state = "1"
         self.blkdebug_file = target_img + ".blkdebug"
         iotests.create_image(backing_img, TestWriteErrors.image_len)
         self.create_blkdebug_file(self.blkdebug_file, "write_aio", 5)
-        qemu_img('create', '-f', iotests.imgfmt, '-obacking_file=%s' %(backing_img), test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-obacking_file=%s' %(backing_img), '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.target_img = 'blkdebug:%s:%s' % (self.blkdebug_file, target_img)
         qemu_img('create', '-f', iotests.imgfmt, '-osize=%d' %(TestWriteErrors.image_len), target_img)
@@ -715,7 +727,8 @@ class TestSetSpeed(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', backing_img, str(TestSetSpeed.image_len))
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         self.vm = iotests.VM().add_drive(test_img)
         self.vm.launch()
 
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
index 0e85b356b7..e8f23a174c 100755
--- a/tests/qemu-iotests/042
+++ b/tests/qemu-iotests/042
@@ -64,8 +64,8 @@ _check_test_img
 echo
 echo "== Rebasing the image =="
 
-$QEMU_IMG rebase -u -b "$TEST_IMG.orig" "$TEST_IMG"
-$QEMU_IMG rebase -b "$TEST_IMG.orig" "$TEST_IMG"
+$QEMU_IMG rebase -u -b "$TEST_IMG.orig" -F $IMGFMT "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.orig" -F $IMGFMT "$TEST_IMG"
 _check_test_img
 
 # success, all done
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index b102e49208..3271737f69 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -46,7 +46,7 @@ _supported_proto file
 
 size=128M
 _make_test_img $size
-$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG"
+$QEMU_IMG rebase -u -b "$TEST_IMG" -F $IMGFMT "$TEST_IMG"
 
 echo
 echo "== backing file references self =="
@@ -54,8 +54,8 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.base" $size
-$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
+$QEMU_IMG rebase -u -b "$TEST_IMG" -F $IMGFMT "$TEST_IMG.base"
 
 echo
 echo "== parent references self =="
@@ -63,12 +63,12 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
+_make_test_img -b "$TEST_IMG.1.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.2.base"
-_make_test_img -b "$TEST_IMG.2.base" $size
+_make_test_img -b "$TEST_IMG.2.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.3.base"
-_make_test_img -b "$TEST_IMG.3.base" $size
-$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" "$TEST_IMG.1.base"
+_make_test_img -b "$TEST_IMG.3.base" -F $IMGFMT $size
+$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" -F $IMGFMT "$TEST_IMG.1.base"
 
 echo
 echo "== ancestor references another ancestor =="
@@ -76,17 +76,18 @@ _img_info --backing-chain
 
 _make_test_img $size
 mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
+_make_test_img -b "$TEST_IMG.1.base" -F $IMGFMT $size
 mv "$TEST_IMG" "$TEST_IMG.2.base"
-_make_test_img -b "$TEST_IMG.2.base" $size
+_make_test_img -b "$TEST_IMG.2.base" -F $IMGFMT $size
 
 echo
 echo "== finite chain of length 3 (human) =="
-_img_info --backing-chain
+# Exclude backing format, since qed differs from qcow2 on what gets stored
+_img_info --backing-chain | grep -v '^backing file format:'
 
 echo
 echo "== finite chain of length 3 (json) =="
-_img_info --backing-chain --output=json
+_img_info --backing-chain --output=json | grep -v 'backing-filename-format'
 
 # success, all done
 echo "*** done"
diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
index 0280f999ce..63ecb21816 100644
--- a/tests/qemu-iotests/043.out
+++ b/tests/qemu-iotests/043.out
@@ -4,20 +4,20 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 == backing file references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == parent references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.3.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.3.base backing_fmt=IMGFMT
 
 == ancestor references another ancestor ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT.2.base' creates an infinite loop.
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.1.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.2.base backing_fmt=IMGFMT
 
 == finite chain of length 3 (human) ==
 image: TEST_DIR/t.IMGFMT
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
index ecbe5fc0f4..88b3363c19 100755
--- a/tests/qemu-iotests/046
+++ b/tests/qemu-iotests/046
@@ -69,7 +69,7 @@ backing_io 0 32 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 
 mv "$TEST_IMG" "$TEST_IMG.base"
 
-_make_test_img -b "$TEST_IMG.base" 6G
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 6G
 
 echo
 echo "== Some concurrent requests touching the same cluster =="
diff --git a/tests/qemu-iotests/046.out b/tests/qemu-iotests/046.out
index 70783041e2..b022bcddd5 100644
--- a/tests/qemu-iotests/046.out
+++ b/tests/qemu-iotests/046.out
@@ -66,7 +66,7 @@ wrote 65536/65536 bytes at offset 1966080
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 2031616
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=6442450944 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Some concurrent requests touching the same cluster ==
 blkdebug: Suspended request 'A'
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
index cdc5356541..4b0a390c43 100755
--- a/tests/qemu-iotests/050
+++ b/tests/qemu-iotests/050
@@ -58,13 +58,13 @@ $QEMU_IO -c "write -P 0x5a 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 TEST_IMG="$TEST_IMG_SAVE"
 
-_make_test_img -b "$TEST_IMG.old" $size
+_make_test_img -b "$TEST_IMG.old" -F $IMGFMT $size
 $QEMU_IO -c "write -z 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 echo
 echo "== Rebasing the image =="
 
-$QEMU_IMG rebase -b "$TEST_IMG.new" "$TEST_IMG"
+$QEMU_IMG rebase -b "$TEST_IMG.new" -F $IMGFMT "$TEST_IMG"
 $QEMU_IO -c "read -P 0x00 0 1048576" "$TEST_IMG" | _filter_qemu_io
 
 # success, all done
diff --git a/tests/qemu-iotests/050.out b/tests/qemu-iotests/050.out
index 3602d580dc..ab3daeddca 100644
--- a/tests/qemu-iotests/050.out
+++ b/tests/qemu-iotests/050.out
@@ -7,7 +7,7 @@ wrote 1048576/1048576 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.new', fmt=IMGFMT size=10485760
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 backing_file=TEST_DIR/t.IMGFMT.old
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=10485760 backing_file=TEST_DIR/t.IMGFMT.old backing_fmt=IMGFMT
 wrote 1048576/1048576 bytes at offset 0
 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 034d3a3250..bee26075b2 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -70,7 +70,7 @@ device_id="drive0"
 _make_test_img $size
 cp "$TEST_IMG" "$TEST_IMG.orig"
 mv "$TEST_IMG" "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.base" $size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
 
 echo
 echo === Unknown option ===
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 554c5ca90a..de4771bcb3 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -1,6 +1,6 @@
 QA output created by 051
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Unknown option ===
 
diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index da8ad87187..f707471fb0 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -1,6 +1,6 @@
 QA output created by 051
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Unknown option ===
 
diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056
index f73fc74457..052456aa00 100755
--- a/tests/qemu-iotests/056
+++ b/tests/qemu-iotests/056
@@ -54,7 +54,8 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
 
     def setUp(self):
         create_image(backing_img, TestSyncModesNoneAndTop.image_len)
-        qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img)
+        qemu_img('create', '-f', iotests.imgfmt,
+                 '-o', 'backing_file=%s' % backing_img, '-F', 'raw', test_img)
         qemu_io('-c', 'write -P0x41 0 512', test_img)
         qemu_io('-c', 'write -P0xd5 1M 32k', test_img)
         qemu_io('-c', 'write -P0xdc 32M 124k', test_img)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 32c0ecce9e..94c0d5accc 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -160,7 +160,7 @@ TEST_IMG=$BACKING_IMG _make_test_img 1G
 
 $QEMU_IO -c 'write 0k 64k' "$BACKING_IMG" | _filter_qemu_io
 
-_make_test_img -b "$BACKING_IMG" 1G
+_make_test_img -b "$BACKING_IMG" -F $IMGFMT 1G
 # Write two clusters, the second one enforces creation of an L2 table after
 # the first data cluster.
 $QEMU_IO -c 'write 0k 64k' -c 'write 512M 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index be5f8707a3..e574c38797 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -101,7 +101,7 @@ read 512/512 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1073741824
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 536870912
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index 10eb243164..08ddbdd10c 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -224,7 +224,7 @@ echo "=== Testing zero expansion on backed image ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "read -P 0x2a 0 128k" -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
 _check_test_img
@@ -235,7 +235,7 @@ echo "=== Testing zero expansion on backed inactive clusters ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IO -c "write -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io
@@ -251,7 +251,7 @@ echo "=== Testing zero expansion on backed image with shared L2 table ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 64M
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 64M
 $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
@@ -274,7 +274,7 @@ echo
 echo "=== Testing progress report without snapshot ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 4G
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 4G
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 4G
 $QEMU_IO -c "write -z 0  64k" \
          -c "write -z 1G 64k" \
          -c "write -z 2G 64k" \
@@ -286,7 +286,7 @@ echo
 echo "=== Testing progress report with snapshot ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img -o "compat=1.1" 4G
-_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" 4G
+_make_test_img -o "compat=1.1" -b "$TEST_IMG.base" -F $IMGFMT 4G
 $QEMU_IO -c "write -z 0  64k" \
          -c "write -z 1G 64k" \
          -c "write -z 2G 64k" \
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index 44e3c624f9..b2d2dfed04 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -428,7 +428,7 @@ read 131072/131072 bytes at offset 0
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 read 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 0
@@ -444,7 +444,7 @@ read 65536/65536 bytes at offset 65536
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 0
@@ -463,7 +463,7 @@ read 65536/65536 bytes at offset 65536
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 131072/131072 bytes at offset 0
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
@@ -487,7 +487,7 @@ read 67108864/67108864 bytes at offset 0
 === Testing progress report without snapshot ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=4294967296
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 1073741824
@@ -502,7 +502,7 @@ No errors were found on the image.
 === Testing progress report with snapshot ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=4294967296
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 65536/65536 bytes at offset 1073741824
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index b997b127f0..a4da83b2d9 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -46,7 +46,7 @@ echo
 echo "=== Creating an image with a backing file and deleting that file ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE
-_make_test_img -b "$TEST_IMG.base" $IMG_SIZE
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $IMG_SIZE
 _rm_test_img "$TEST_IMG.base"
 # Just open the image and close it right again (this should print an error message)
 $QEMU_IO -c quit "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
diff --git a/tests/qemu-iotests/069.out b/tests/qemu-iotests/069.out
index c78e8c2b72..126b4d2d51 100644
--- a/tests/qemu-iotests/069.out
+++ b/tests/qemu-iotests/069.out
@@ -3,6 +3,6 @@ QA output created by 069
 === Creating an image with a backing file and deleting that file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=131072
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 qemu-io: can't open device TEST_DIR/t.IMGFMT: Could not open backing file: Could not open 'TEST_DIR/t.IMGFMT.base': No such file or directory
 *** done
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 23a1bdf890..1dce478709 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -52,7 +52,7 @@ echo "== creating backing file =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 0xa5 0 $size" "$TEST_IMG.base" | _filter_qemu_io
 
 echo
diff --git a/tests/qemu-iotests/073.out b/tests/qemu-iotests/073.out
index de5452492c..7a718b525e 100644
--- a/tests/qemu-iotests/073.out
+++ b/tests/qemu-iotests/073.out
@@ -2,7 +2,7 @@ QA output created by 073
 
 == creating backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
index 1998965ed4..2135581867 100755
--- a/tests/qemu-iotests/082
+++ b/tests/qemu-iotests/082
@@ -84,8 +84,10 @@ run_qemu_img create -f $IMGFMT -o cluster_size=4k -o help "$TEST_IMG" $size
 run_qemu_img create -f $IMGFMT -o cluster_size=4k -o \? "$TEST_IMG" $size
 
 # Looks like a help option, but is part of the backing file name
-run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,help "$TEST_IMG" $size
-run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,\? "$TEST_IMG" $size
+run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,help \
+    -F $IMGFMT "$TEST_IMG" $size
+run_qemu_img create -f $IMGFMT -u -o backing_file="$TEST_IMG",,\? \
+    -F $IMGFMT "$TEST_IMG" $size
 
 # Try to trick qemu-img into creating escaped commas
 run_qemu_img create -f $IMGFMT -o backing_file="$TEST_IMG", -o help "$TEST_IMG" $size
@@ -141,8 +143,8 @@ run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o help "$TEST_IMG" "$TEST_IM
 run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o \? "$TEST_IMG" "$TEST_IMG".base
 
 # Looks like a help option, but is part of the backing file name
-run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG",,help "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG",,\? "$TEST_IMG" "$TEST_IMG".base
+run_qemu_img convert -O $IMGFMT -o backing_fmt=$IMGFMT,backing_file="$TEST_IMG",,help "$TEST_IMG" "$TEST_IMG".base
+run_qemu_img convert -O $IMGFMT -o backing_fmt=$IMGFMT,backing_file="$TEST_IMG",,\? "$TEST_IMG" "$TEST_IMG".base
 
 # Try to trick qemu-img into creating escaped commas
 run_qemu_img convert -O $IMGFMT -o backing_file="$TEST_IMG", -o help "$TEST_IMG" "$TEST_IMG".base
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index a38a26fc57..1728aff1e0 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -244,11 +244,11 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
-Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help lazy_refcounts=off refcount_bits=16
+Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help -F qcow2 TEST_DIR/t.qcow2 128M
+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
 
-Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 128M
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? lazy_refcounts=off refcount_bits=16
+Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? -F qcow2 TEST_DIR/t.qcow2 128M
+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
 
 Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 128M
 qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2,
@@ -543,10 +543,10 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
-Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
+Testing: convert -O qcow2 -o backing_fmt=qcow2,backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
 qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,help': No such file or directory
 
-Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
+Testing: convert -O qcow2 -o backing_fmt=qcow2,backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
 qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,?': No such file or directory
 
 Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085
index dd3c993a2d..e99eb44581 100755
--- a/tests/qemu-iotests/085
+++ b/tests/qemu-iotests/085
@@ -106,7 +106,7 @@ add_snapshot_image()
 {
     base_image="${TEST_DIR}/$((${1}-1))-${snapshot_virt0}"
     snapshot_file="${TEST_DIR}/${1}-${snapshot_virt0}"
-    TEST_IMG=$snapshot_file _make_test_img -u -b "${base_image}" "$size"
+    TEST_IMG=$snapshot_file _make_test_img -u -b "${base_image}" -F $IMGFMT "$size"
     do_blockdev_add "$1" "'backing': null, " "${snapshot_file}"
 }
 
@@ -225,7 +225,7 @@ echo
 SNAPSHOTS=$((${SNAPSHOTS}+1))
 
 TEST_IMG="$TEST_IMG.base" _make_test_img "$size"
-_make_test_img -b "${TEST_IMG}.base" "$size"
+_make_test_img -b "${TEST_IMG}.base" -F $IMGFMT "$size"
 do_blockdev_add ${SNAPSHOTS} "" "${TEST_IMG}"
 blockdev_snapshot ${SNAPSHOTS} error
 
diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out
index d68c06efdf..700658d5a3 100644
--- a/tests/qemu-iotests/085.out
+++ b/tests/qemu-iotests/085.out
@@ -68,12 +68,12 @@ Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compres
 
 === Create a couple of snapshots using blockdev-snapshot ===
 
-Formatting 'TEST_DIR/11-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/10-snapshot-v0.IMGFMT
+Formatting 'TEST_DIR/11-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/10-snapshot-v0.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_11', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TEST_DIR/11-snapshot-v0.IMGFMT', 'node-name': 'file_11' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_11' } }
 {"return": {}}
-Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/11-snapshot-v0.IMGFMT
+Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/11-snapshot-v0.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_12', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TEST_DIR/12-snapshot-v0.IMGFMT', 'node-name': 'file_12' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_12' } }
@@ -101,7 +101,7 @@ Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=IMGFMT size=134217728 backing_f
 === Invalid command - snapshot node has a backing image ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name': 'snap_13', 'file': { 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'node-name': 'file_13' } } }
 {"return": {}}
 { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_13' } }
diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089
index 059ad75e28..66c5415abe 100755
--- a/tests/qemu-iotests/089
+++ b/tests/qemu-iotests/089
@@ -84,7 +84,7 @@ echo
 echo "=== Testing correct handling of 'backing':null ==="
 echo
 
-_make_test_img -b "$TEST_IMG.base" $IMG_SIZE
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $IMG_SIZE
 
 # This should read 42
 $QEMU_IO -c 'read -P 42 0 512' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out
index 20c8ce8f0e..15682c2886 100644
--- a/tests/qemu-iotests/089.out
+++ b/tests/qemu-iotests/089.out
@@ -21,7 +21,7 @@ read 512/512 bytes at offset 0
 
 === Testing correct handling of 'backing':null ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 read 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 512/512 bytes at offset 0
diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095
index 155ae86aa7..77a5f0f3f5 100755
--- a/tests/qemu-iotests/095
+++ b/tests/qemu-iotests/095
@@ -51,9 +51,9 @@ size_larger=100M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size_smaller
 
-TEST_IMG="$TEST_IMG.snp1" _make_test_img -b "$TEST_IMG.base" $size_larger
+TEST_IMG="$TEST_IMG.snp1" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size_larger
 
-_make_test_img -b "${TEST_IMG}.snp1" $size_larger
+_make_test_img -b "${TEST_IMG}.snp1" -F $IMGFMT $size_larger
 
 echo
 echo "=== Base image info before commit and resize ==="
diff --git a/tests/qemu-iotests/095.out b/tests/qemu-iotests/095.out
index 614e5ccbbb..e66ced58f8 100644
--- a/tests/qemu-iotests/095.out
+++ b/tests/qemu-iotests/095.out
@@ -1,7 +1,7 @@
 QA output created by 095
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=5242880
-Formatting 'TEST_DIR/t.IMGFMT.snp1', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.snp1
+Formatting 'TEST_DIR/t.IMGFMT.snp1', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/t.IMGFMT.snp1 backing_fmt=IMGFMT
 
 === Base image info before commit and resize ===
 image: TEST_DIR/t.IMGFMT.base
diff --git a/tests/qemu-iotests/097 b/tests/qemu-iotests/097
index 690f3d3ce1..d910a8b107 100755
--- a/tests/qemu-iotests/097
+++ b/tests/qemu-iotests/097
@@ -67,8 +67,8 @@ echo
 
 len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
 TEST_IMG="$TEST_IMG.base" _make_test_img $len
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
-_make_test_img -b "$TEST_IMG.itmd" $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $len
+_make_test_img -b "$TEST_IMG.itmd" -F $IMGFMT $len
 
 $QEMU_IO -c "write -P 1 0x7ffd0000 192k" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -P 2 0x7ffe0000 128k" "$TEST_IMG.itmd" | _filter_qemu_io
diff --git a/tests/qemu-iotests/097.out b/tests/qemu-iotests/097.out
index f6705a1cc7..3038ddab31 100644
--- a/tests/qemu-iotests/097.out
+++ b/tests/qemu-iotests/097.out
@@ -3,8 +3,8 @@ QA output created by 097
 === Test pass 0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -40,8 +40,8 @@ Offset          Length          File
 === Test pass 1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -78,8 +78,8 @@ Offset          Length          File
 === Test pass 2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -116,8 +116,8 @@ Offset          Length          File
 === Test pass 3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
diff --git a/tests/qemu-iotests/098 b/tests/qemu-iotests/098
index 1e29d96b3d..f2ccdd7909 100755
--- a/tests/qemu-iotests/098
+++ b/tests/qemu-iotests/098
@@ -52,7 +52,7 @@ echo "=== $event ==="
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base" 64M
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT 64M
 
 # Some data that can be leaked when emptying the top image
 $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/098.out b/tests/qemu-iotests/098.out
index 23cf371f53..6c73dd0977 100644
--- a/tests/qemu-iotests/098.out
+++ b/tests/qemu-iotests/098.out
@@ -3,7 +3,7 @@ QA output created by 098
 === l1_update ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -12,7 +12,7 @@ No errors were found on the image.
 === empty_image_prepare ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -25,7 +25,7 @@ No errors were found on the image.
 === reftable_update ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
@@ -39,7 +39,7 @@ No errors were found on the image.
 === refblock_alloc ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
index 139c02c2cf..f1813d0dfb 100755
--- a/tests/qemu-iotests/110
+++ b/tests/qemu-iotests/110
@@ -50,7 +50,7 @@ echo '=== Reconstructable filename ==='
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG_REL.base" 64M
+_make_test_img -b "$TEST_IMG_REL.base" -F $IMGFMT 64M
 # qemu should be able to reconstruct the filename, so relative backing names
 # should work
 # (We have to filter the backing file format because vmdk always
@@ -91,7 +91,7 @@ echo '=== Backing name is always relative to the backed image ==='
 echo
 
 # omit the image size; it should work anyway
-_make_test_img -b "$TEST_IMG_REL.base"
+_make_test_img -b "$TEST_IMG_REL.base" -F $IMGFMT
 
 echo
 echo '=== Nodes without a common directory ==='
diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out
index f835553a99..cf8f6c025d 100644
--- a/tests/qemu-iotests/110.out
+++ b/tests/qemu-iotests/110.out
@@ -3,7 +3,7 @@ QA output created by 110
 === Reconstructable filename ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base backing_fmt=IMGFMT
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
@@ -18,7 +18,7 @@ backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base)
 
 === Backing name is always relative to the backed image ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base backing_fmt=IMGFMT
 
 === Nodes without a common directory ===
 
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index 2dc16b2ca4..dfd1cd05d6 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -52,9 +52,10 @@ echo
 echo "=== Check allocation status regression with -B ==="
 echo
 
-_make_test_img -b "$TEST_IMG".base
+_make_test_img -b "$TEST_IMG".base -F $IMGFMT
 $QEMU_IO -c "write -P 0x22 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base \
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 
 
@@ -62,18 +63,22 @@ echo
 echo "=== Check that zero clusters are kept in overlay ==="
 echo
 
-_make_test_img -b "$TEST_IMG".base
+_make_test_img -b "$TEST_IMG".base -F $IMGFMT
 
 $QEMU_IO -c "write -P 0 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
 
 $QEMU_IO -c "write -z 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
-$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base "$TEST_IMG" "$TEST_IMG".orig
+$QEMU_IMG convert -O $IMGFMT -c -B "$TEST_IMG".base -o backing_fmt=$IMGFMT \
+    "$TEST_IMG" "$TEST_IMG".orig
 $QEMU_IO -c "read -P 0 0 3M" "$TEST_IMG".orig 2>&1 | _filter_qemu_io | _filter_testdir
 
 
@@ -94,11 +99,11 @@ TEST_IMG="$TEST_IMG".base _make_test_img 256M
 # We do not want such a zero write, however, because we are past the
 # end of the backing file on the target as well, so we do not need to
 # write anything there.
-_make_test_img -b "$TEST_IMG".base 768M
+_make_test_img -b "$TEST_IMG".base 768M -F $IMGFMT
 
 # Use compat=0.10 as the output so there is no zero cluster support
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o compat=0.10 \
-    "$TEST_IMG" "$TEST_IMG".orig
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 # See that nothing has been allocated past 64M
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 
@@ -110,7 +115,7 @@ $QEMU_IO -c 'write -P 0x11 255M 1M' "$TEST_IMG".base 2>&1 | _filter_qemu_io
 $QEMU_IO -c 'write -P 0x22 600M 1M' "$TEST_IMG" 2>&1 | _filter_qemu_io
 
 $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -o compat=0.10 \
-    "$TEST_IMG" "$TEST_IMG".orig
+    -o backing_fmt=$IMGFMT "$TEST_IMG" "$TEST_IMG".orig
 
 $QEMU_IMG map "$TEST_IMG".orig | _filter_qemu_img_map
 $QEMU_IO -c 'read -P 0x11 255M 1M' \
@@ -199,7 +204,7 @@ $QEMU_IMG map --output=json "$TEST_IMG".orig | _filter_qemu_img_map
 TEST_IMG="$TEST_IMG".base _make_test_img 64M
 $QEMU_IO -c "write -P 0x11 0 32M" "$TEST_IMG".base 2>&1 | _filter_qemu_io | _filter_testdir
 
-_make_test_img -b "$TEST_IMG".base 64M
+_make_test_img -b "$TEST_IMG".base 64M -F $IMGFMT
 $QEMU_IO -c "write -P 0x22 0 3M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
 
 echo
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index c2e154a1e5..f1f195ed77 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -5,7 +5,7 @@ wrote 67108864/67108864 bytes at offset 0
 
 === Check allocation status regression with -B ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Offset          Length          File
@@ -14,7 +14,7 @@ Offset          Length          File
 
 === Check that zero clusters are kept in overlay ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 3145728/3145728 bytes at offset 0
@@ -31,7 +31,7 @@ read 3145728/3145728 bytes at offset 0
 === Converting to an overlay larger than its backing file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=268435456
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=805306368 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=805306368 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Offset          Length          File
 
 wrote 1048576/1048576 bytes at offset 267386880
@@ -141,7 +141,7 @@ read 63963136/63963136 bytes at offset 3145728
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 wrote 33554432/33554432 bytes at offset 0
 32 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 3145728/3145728 bytes at offset 0
 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/126 b/tests/qemu-iotests/126
index b7fce1e59d..dd5a211227 100755
--- a/tests/qemu-iotests/126
+++ b/tests/qemu-iotests/126
@@ -61,7 +61,7 @@ BASE_IMG="$TEST_DIR/image:base.$IMGFMT"
 TOP_IMG="$TEST_DIR/image:top.$IMGFMT"
 
 TEST_IMG=$BASE_IMG _make_test_img 64M
-TEST_IMG=$TOP_IMG _make_test_img -b ./image:base.$IMGFMT
+TEST_IMG=$TOP_IMG _make_test_img -b ./image:base.$IMGFMT -F $IMGFMT
 
 # (1) The default cluster size depends on the image format
 # (2) vmdk only supports vmdk backing files, so it always reports the
@@ -82,7 +82,7 @@ BASE_IMG="base.$IMGFMT"
 TOP_IMG="file:image:top.$IMGFMT"
 
 TEST_IMG=$BASE_IMG _make_test_img 64M
-TEST_IMG=$TOP_IMG _make_test_img -b "$BASE_IMG"
+TEST_IMG=$TOP_IMG _make_test_img -b "$BASE_IMG" -F $IMGFMT
 
 TEST_IMG=$TOP_IMG _img_info | grep -ve 'cluster_size' -e 'backing file format'
 
diff --git a/tests/qemu-iotests/126.out b/tests/qemu-iotests/126.out
index e3c4d61916..7d6634685e 100644
--- a/tests/qemu-iotests/126.out
+++ b/tests/qemu-iotests/126.out
@@ -8,14 +8,14 @@ Formatting 'file:TEST_DIR/a:b.IMGFMT', fmt=IMGFMT size=67108864
 === Testing relative backing filename resolution ===
 
 Formatting 'TEST_DIR/image:base.IMGFMT', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=./image:base.IMGFMT
+Formatting 'TEST_DIR/image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=./image:base.IMGFMT backing_fmt=IMGFMT
 image: TEST_DIR/image:top.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
 backing file: ./image:base.IMGFMT (actual path: TEST_DIR/./image:base.IMGFMT)
 
 Formatting 'base.IMGFMT', fmt=IMGFMT size=67108864
-Formatting 'file:image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=base.IMGFMT
+Formatting 'file:image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=base.IMGFMT backing_fmt=IMGFMT
 image: ./image:top.IMGFMT
 file format: IMGFMT
 virtual size: 64 MiB (67108864 bytes)
diff --git a/tests/qemu-iotests/127 b/tests/qemu-iotests/127
index a4fc866038..e2ac2f5536 100755
--- a/tests/qemu-iotests/127
+++ b/tests/qemu-iotests/127
@@ -48,8 +48,8 @@ _require_devices virtio-scsi scsi-hd
 IMG_SIZE=64K
 
 _make_test_img $IMG_SIZE
-TEST_IMG="$TEST_IMG.overlay0" _make_test_img -b "$TEST_IMG" $IMG_SIZE
-TEST_IMG="$TEST_IMG.overlay1" _make_test_img -b "$TEST_IMG" $IMG_SIZE
+TEST_IMG="$TEST_IMG.overlay0" _make_test_img -b "$TEST_IMG" -F $IMGFMT $IMG_SIZE
+TEST_IMG="$TEST_IMG.overlay1" _make_test_img -b "$TEST_IMG" -F $IMGFMT $IMG_SIZE
 
 # So that we actually have something to mirror and the job does not return
 # immediately (which may be bad because then we cannot know whether the
diff --git a/tests/qemu-iotests/127.out b/tests/qemu-iotests/127.out
index 623d52bbd1..efd6cb327f 100644
--- a/tests/qemu-iotests/127.out
+++ b/tests/qemu-iotests/127.out
@@ -1,7 +1,7 @@
 QA output created by 127
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536
-Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
 wrote 42/42 bytes at offset 0
 42 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129
index b0da4a5541..0e13244d85 100755
--- a/tests/qemu-iotests/129
+++ b/tests/qemu-iotests/129
@@ -29,7 +29,8 @@ class TestStopWithBlockJob(iotests.QMPTestCase):
 
     def setUp(self):
         iotests.qemu_img('create', '-f', iotests.imgfmt, self.base_img, "1G")
-        iotests.qemu_img('create', '-f', iotests.imgfmt, self.test_img, "-b", self.base_img)
+        iotests.qemu_img('create', '-f', iotests.imgfmt, self.test_img,
+                         "-b", self.base_img, '-F', iotests.imgfmt)
         iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write -P0x5d 1M 128M', self.test_img)
         self.vm = iotests.VM().add_drive(self.test_img)
         self.vm.launch()
diff --git a/tests/qemu-iotests/133 b/tests/qemu-iotests/133
index 6f7cacc091..4070fd9457 100755
--- a/tests/qemu-iotests/133
+++ b/tests/qemu-iotests/133
@@ -40,7 +40,7 @@ _supported_fmt qcow2
 _supported_proto file
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 echo
 echo "=== Check that node-name can't be changed ==="
diff --git a/tests/qemu-iotests/133.out b/tests/qemu-iotests/133.out
index 1491ef45a9..d70c2e8041 100644
--- a/tests/qemu-iotests/133.out
+++ b/tests/qemu-iotests/133.out
@@ -1,6 +1,6 @@
 QA output created by 133
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Check that node-name can't be changed ===
 
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 7120d3142b..1452fd24b3 100755
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -71,7 +71,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
     def addBlockDriverStateOverlay(self, node):
         self.checkBlockDriverState(node, False)
         iotests.qemu_img('create', '-u', '-f', iotests.imgfmt,
-                         '-b', base_img, new_img, '1M')
+                         '-b', base_img, '-F', iotests.imgfmt, new_img, '1M')
         opts = {'driver': iotests.imgfmt,
                 'node-name': node,
                 'backing': None,
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 5192d256e3..21aa0b42d8 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -89,8 +89,8 @@ test_blockjob()
 
 
 TEST_IMG="$TEST_DIR/b.$IMGFMT" _make_test_img 1M
-TEST_IMG="$TEST_DIR/m.$IMGFMT" _make_test_img -b "$TEST_DIR/b.$IMGFMT" 1M
-_make_test_img -b "$TEST_DIR/m.$IMGFMT" 1M
+TEST_IMG="$TEST_DIR/m.$IMGFMT" _make_test_img -b "$TEST_DIR/b.$IMGFMT" -F $IMGFMT 1M
+_make_test_img -b "$TEST_DIR/m.$IMGFMT" 1M -F $IMGFMT
 
 _launch_qemu -nodefaults
 
diff --git a/tests/qemu-iotests/141.out b/tests/qemu-iotests/141.out
index 263b680bdf..08e0aecd65 100644
--- a/tests/qemu-iotests/141.out
+++ b/tests/qemu-iotests/141.out
@@ -1,7 +1,7 @@
 QA output created by 141
 Formatting 'TEST_DIR/b.IMGFMT', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/m.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/b.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/m.IMGFMT
+Formatting 'TEST_DIR/m.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/b.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/m.IMGFMT backing_fmt=IMGFMT
 {'execute': 'qmp_capabilities'}
 {"return": {}}
 
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
index daefcbaa58..69fd10ef51 100755
--- a/tests/qemu-iotests/142
+++ b/tests/qemu-iotests/142
@@ -67,7 +67,7 @@ size=128M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 TEST_IMG="$TEST_IMG.snap" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base" $size
+_make_test_img -b "$TEST_IMG.base" $size -F $IMGFMT
 
 echo
 echo === Simple test for all cache modes ===
diff --git a/tests/qemu-iotests/142.out b/tests/qemu-iotests/142.out
index 3667e38def..a92b948edd 100644
--- a/tests/qemu-iotests/142.out
+++ b/tests/qemu-iotests/142.out
@@ -1,7 +1,7 @@
 QA output created by 142
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 Formatting 'TEST_DIR/t.IMGFMT.snap', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Simple test for all cache modes ===
 
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index 11e3d28841..34045ea3cf 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -94,7 +94,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
 
     echo
     echo "== Creating test image =="
-    _make_test_img -b "${TEST_IMG}.base"
+    _make_test_img -b "${TEST_IMG}.base" -F $IMGFMT
 
     echo
     echo "== Launching QEMU, opts: '$opts1' =="
@@ -125,7 +125,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
         _run_cmd $QEMU_IMG amend -o "size=$size" $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG commit      $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG resize      $L "${TEST_IMG}" $size
-        _run_cmd $QEMU_IMG rebase      $L "${TEST_IMG}" -b "${TEST_IMG}.base"
+        _run_cmd $QEMU_IMG rebase      $L "${TEST_IMG}" -b "${TEST_IMG}.base" -F $IMGFMT
         _run_cmd $QEMU_IMG snapshot -l $L "${TEST_IMG}"
         _run_cmd $QEMU_IMG convert     $L "${TEST_IMG}" "${TEST_IMG}.convert"
         _run_cmd $QEMU_IMG dd          $L if="${TEST_IMG}" of="${TEST_IMG}.convert" bs=512 count=1
@@ -135,7 +135,7 @@ for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
         # qemu-img create does not support -U
         if [ -z "$L" ]; then
             _run_cmd $QEMU_IMG create -f $IMGFMT "${TEST_IMG}" \
-                                      -b ${TEST_IMG}.base
+                                      -b ${TEST_IMG}.base -F $IMGFMT
             # Read the file format.  It used to be the case that
             # file-posix simply truncated the file, but the qcow2
             # driver then failed to format it because it was unable
@@ -167,9 +167,9 @@ done
 
 echo
 echo "== Creating ${TEST_IMG}.[abc] ==" | _filter_testdir
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}" | _filter_img_create
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.b" -b "${TEST_IMG}" | _filter_img_create
-$QEMU_IMG create -f qcow2 "${TEST_IMG}.c" -b "${TEST_IMG}.b" \
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.b" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
+$QEMU_IMG create -f qcow2 "${TEST_IMG}.c" -b "${TEST_IMG}.b" -F $IMGFMT \
     | _filter_img_create
 
 echo
@@ -218,7 +218,7 @@ _send_qemu_cmd $QEMU_HANDLE \
 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
 
 echo "Creating overlay with qemu-img when the guest is running should be allowed"
-_run_cmd $QEMU_IMG create -f $IMGFMT -b "${TEST_IMG}" "${TEST_IMG}.overlay"
+_run_cmd $QEMU_IMG create -f $IMGFMT -b "${TEST_IMG}" -F $IMGFMT "${TEST_IMG}.overlay"
 
 echo "== Closing an image should unlock it =="
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index b2a90caa6b..8a79e1ee87 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -6,7 +6,7 @@ QEMU_PROG: -drive if=none,file=null-co://,readonly=off,force-share=on: force-sha
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: '' ==
 
@@ -68,7 +68,7 @@ _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -92,10 +92,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -130,7 +131,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -152,7 +153,7 @@ Round done
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: 'read-only=on' ==
 
@@ -199,7 +200,7 @@ _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -215,10 +216,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -253,7 +255,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 
@@ -275,7 +277,7 @@ Round done
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
 
 == Creating test image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == Launching QEMU, opts: 'read-only=on,force-share=on' ==
 
@@ -309,7 +311,7 @@ _qemu_img_wrapper commit TEST_DIR/t.qcow2
 
 _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M
 
-_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 
 _qemu_img_wrapper snapshot -l TEST_DIR/t.qcow2
 
@@ -321,8 +323,9 @@ _qemu_img_wrapper bench -c 1 TEST_DIR/t.qcow2
 
 _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2
 
-_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 file format: IMGFMT
+backing file format: IMGFMT
 
 == Running utility commands -U ==
 
@@ -357,7 +360,7 @@ _qemu_img_wrapper resize -U TEST_DIR/t.qcow2 32M
 qemu-img: unrecognized option '-U'
 Try 'qemu-img --help' for more information
 
-_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base
+_qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2
 
 _qemu_img_wrapper snapshot -l -U TEST_DIR/t.qcow2
 
@@ -398,9 +401,9 @@ Is another process using the image [TEST_DIR/t.qcow2]?
 == Two devices with the same image (read-only=on,force-share=on - read-only=on,force-share=on) ==
 
 == Creating TEST_DIR/t.qcow2.[abc] ==
-Formatting 'TEST_DIR/t.IMGFMT.a', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.b', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT.c', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.b
+Formatting 'TEST_DIR/t.IMGFMT.a', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.b', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.c', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.b backing_fmt=IMGFMT
 
 == Two devices sharing the same file in backing chain ==
 
@@ -430,7 +433,7 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
 Is another process using the image [TEST_DIR/t.qcow2]?
 Creating overlay with qemu-img when the guest is running should be allowed
 
-_qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.overlay
+_qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 -F qcow2 TEST_DIR/t.qcow2.overlay
 == Closing an image should unlock it ==
 { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'drive_del d0' } }
 {"return": ""}
diff --git a/tests/qemu-iotests/154 b/tests/qemu-iotests/154
index d68f66b9e0..7f1c0d9bd9 100755
--- a/tests/qemu-iotests/154
+++ b/tests/qemu-iotests/154
@@ -50,7 +50,7 @@ echo
 echo == backing file contains zeros ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Make sure that the whole cluster is allocated even for partial write_zeroes
 # when the backing file contains zeros
@@ -74,7 +74,7 @@ echo
 echo == backing file contains non-zero data before write_zeroes ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Single cluster; non-zero data at the cluster start
 # ... | XX -- 00 -- | ...
@@ -97,7 +97,7 @@ echo
 echo == backing file contains non-zero data after write_zeroes ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Single cluster; non-zero data directly after request
 # ... | -- 00 XX -- | ...
@@ -120,7 +120,7 @@ echo
 echo == write_zeroes covers non-zero data ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # non-zero data at front of request
 # Backing file: -- XX -- --
@@ -160,7 +160,7 @@ echo
 echo == spanning two clusters, non-zero before request ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Two clusters; non-zero data before request:
 # 1. At cluster start:          32k: XX -- -- 00 | 00 -- -- --
@@ -190,7 +190,7 @@ echo
 echo == spanning two clusters, non-zero after request ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Two clusters; non-zero data after request:
 # 1. Directly after request:    32k: -- -- -- 00 | 00 XX -- --
@@ -220,7 +220,7 @@ echo
 echo == spanning two clusters, partially overwriting backing file ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: -- -- XX XX | XX XX -- --
 # Active layer: -- -- XX 00 | 00 XX -- --
@@ -239,7 +239,7 @@ echo
 echo == spanning multiple clusters, non-zero in first cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: XX XX -- -- | -- -- -- -- | -- -- -- --
 # Active layer: 64k: XX XX 00 00 | 00 00 00 00 | 00 -- -- --
@@ -255,7 +255,7 @@ echo
 echo == spanning multiple clusters, non-zero in intermediate cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- -- -- -- | -- XX XX -- | -- -- -- --
 # Active layer: 64k: -- -- 00 00 | 00 00 00 00 | 00 -- -- --
@@ -270,7 +270,7 @@ echo
 echo == spanning multiple clusters, non-zero in final cluster ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- -- -- -- | -- -- -- -- | -- -- XX XX
 # Active layer: 64k: -- -- 00 00 | 00 00 00 00 | 00 -- XX XX
@@ -286,7 +286,7 @@ echo
 echo == spanning multiple clusters, partially overwriting backing file ==
 
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Backing file: 64k: -- XX XX XX | XX XX XX XX | XX XX XX --
 # Active layer: 64k: -- XX 00 00 | 00 00 00 00 | 00 XX XX --
@@ -338,7 +338,7 @@ CLUSTER_SIZE=2048 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
 # Write at the front: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | 00 -- -- --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -346,7 +346,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at the back: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | -- -- -- 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 1536)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -354,7 +354,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at middle: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | -- 00 00 --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 512)) 1024" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -362,7 +362,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write entire cluster: sector-wise, the request is:
 # backing: 128m... | -- --
 # active:  128m... | 00 00 00 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -373,7 +373,7 @@ $QEMU_IO -c "write -z $size 512" "$TEST_IMG.base" | _filter_qemu_io
 # Write at the front: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | 00 -- -- --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -381,7 +381,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at the back: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | -- -- -- 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 1536)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -389,7 +389,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write at middle: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | -- 00 00 --
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $((size + 512)) 1024" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -397,7 +397,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Write entire cluster: sector-wise, the request is:
 # backing: 128m... | 00 00
 # active:  128m... | 00 00 00 00
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -z $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "alloc $size 2048" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
@@ -427,7 +427,7 @@ echo == unaligned image tail cluster, allocation required ==
 # Backing file: 128m... | XX --
 # Active layer: 128m... | -- -- 00 --
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -P 1 $((size)) 512" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -z $((size + 1024)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "read -P 1 $((size)) 512" "$TEST_IMG" | _filter_qemu_io
@@ -438,7 +438,7 @@ $QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
 # Backing file: 128m: ... | -- XX
 # Active layer: 128m: ... | 00 -- -- 00
 CLUSTER_SIZE=512 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024))
-_make_test_img -b "$TEST_IMG.base" $((size + 2048))
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $((size + 2048))
 $QEMU_IO -c "write -P 1 $((size + 512)) 512" "$TEST_IMG.base" | _filter_qemu_io
 $QEMU_IO -c "write -z $((size)) 512" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -c "read -P 0 $((size)) 512" "$TEST_IMG" | _filter_qemu_io
diff --git a/tests/qemu-iotests/154.out b/tests/qemu-iotests/154.out
index fa3673317f..4863e24838 100644
--- a/tests/qemu-iotests/154.out
+++ b/tests/qemu-iotests/154.out
@@ -2,7 +2,7 @@ QA output created by 154
 
 == backing file contains zeros ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 0
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 10240
@@ -22,7 +22,7 @@ wrote 2048/2048 bytes at offset 27648
 
 == backing file contains non-zero data before write_zeroes ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 32768
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1024/1024 bytes at offset 34816
@@ -49,7 +49,7 @@ read 2048/2048 bytes at offset 67584
 
 == backing file contains non-zero data after write_zeroes ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 34816
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 1024/1024 bytes at offset 33792
@@ -76,7 +76,7 @@ read 3072/3072 bytes at offset 40960
 
 == write_zeroes covers non-zero data ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 5120
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 5120
@@ -113,7 +113,7 @@ read 4096/4096 bytes at offset 28672
 
 == spanning two clusters, non-zero before request ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 32768
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 35840
@@ -155,7 +155,7 @@ read 5120/5120 bytes at offset 68608
 
 == spanning two clusters, non-zero after request ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 37888
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 35840
@@ -197,7 +197,7 @@ read 1024/1024 bytes at offset 72704
 
 == spanning two clusters, partially overwriting backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 4096/4096 bytes at offset 2048
 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 3072
@@ -217,7 +217,7 @@ read 2048/2048 bytes at offset 6144
 
 == spanning multiple clusters, non-zero in first cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 65536
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -233,7 +233,7 @@ read 10240/10240 bytes at offset 67584
 
 == spanning multiple clusters, non-zero in intermediate cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 70656
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -246,7 +246,7 @@ read 12288/12288 bytes at offset 65536
 
 == spanning multiple clusters, non-zero in final cluster ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 75776
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -262,7 +262,7 @@ read 2048/2048 bytes at offset 75776
 
 == spanning multiple clusters, partially overwriting backing file ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 10240/10240 bytes at offset 66560
 10 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 7168/7168 bytes at offset 67584
@@ -305,25 +305,25 @@ wrote 2048/2048 bytes at offset 134217728
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134219776, "depth": 0, "zero": true, "data": false}]
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134219264
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 134218240
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 134217728
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
@@ -331,25 +331,25 @@ wrote 2048/2048 bytes at offset 134217728
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134219264
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 1024/1024 bytes at offset 134218240
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": true, "data": false}]
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2048/2048 bytes at offset 134217728
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 2048/2048 bytes allocated at offset 128 MiB
@@ -377,7 +377,7 @@ read 1024/1024 bytes at offset 134217728
 
 == unaligned image tail cluster, allocation required ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134217728
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 134218752
@@ -389,7 +389,7 @@ read 1536/1536 bytes at offset 134218240
 [{ "start": 0, "length": 134217728, "depth": 1, "zero": true, "data": false},
 { "start": 134217728, "length": 2048, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134218752
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134219776 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 512/512 bytes at offset 134218240
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 512/512 bytes at offset 134217728
diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155
index cb371d4649..988f986144 100755
--- a/tests/qemu-iotests/155
+++ b/tests/qemu-iotests/155
@@ -60,9 +60,12 @@ class BaseClass(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', '-f', iotests.imgfmt, back0_img, '1440K')
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back0_img, back1_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back1_img, back2_img)
-        qemu_img('create', '-f', iotests.imgfmt, '-b', back2_img, source_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back0_img,
+                 '-F', iotests.imgfmt, back1_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back1_img,
+                 '-F', iotests.imgfmt, back2_img)
+        qemu_img('create', '-f', iotests.imgfmt, '-b', back2_img,
+                 '-F', iotests.imgfmt, source_img)
 
         self.vm = iotests.VM()
         # Add the BDS via blockdev-add so it stays around after the mirror block
@@ -89,7 +92,8 @@ class BaseClass(iotests.QMPTestCase):
         if self.existing:
             if self.target_backing:
                 qemu_img('create', '-f', iotests.imgfmt,
-                         '-b', self.target_backing, target_img, '1440K')
+                         '-b', self.target_backing, '-F', 'raw',
+                         target_img, '1440K')
             else:
                 qemu_img('create', '-f', iotests.imgfmt, target_img, '1440K')
 
diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156
index 5559df63a5..7c69a6c3fa 100755
--- a/tests/qemu-iotests/156
+++ b/tests/qemu-iotests/156
@@ -56,7 +56,7 @@ _unsupported_imgopts data_file
 
 # Create source disk
 TEST_IMG="$TEST_IMG.backing" _make_test_img 1M
-_make_test_img -b "$TEST_IMG.backing" 1M
+_make_test_img -b "$TEST_IMG.backing" -F $IMGFMT 1M
 
 $QEMU_IO -c 'write -P 1 0 256k' "$TEST_IMG.backing" | _filter_qemu_io
 $QEMU_IO -c 'write -P 2 64k 192k' "$TEST_IMG" | _filter_qemu_io
@@ -68,7 +68,7 @@ _send_qemu_cmd $QEMU_HANDLE \
     'return'
 
 # Create snapshot
-TEST_IMG="$TEST_IMG.overlay" _make_test_img -u -b "$TEST_IMG" 1M
+TEST_IMG="$TEST_IMG.overlay" _make_test_img -u -b "$TEST_IMG" -F $IMGFMT 1M
 _send_qemu_cmd $QEMU_HANDLE \
     "{ 'execute': 'blockdev-snapshot-sync',
        'arguments': { 'device': 'source',
@@ -85,7 +85,8 @@ _send_qemu_cmd $QEMU_HANDLE \
     'return'
 
 # Create target image
-TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" 1M
+TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" \
+    -F $IMGFMT 1M
 
 # Mirror snapshot
 _send_qemu_cmd $QEMU_HANDLE \
@@ -111,7 +112,7 @@ _send_qemu_cmd $QEMU_HANDLE \
 # Copy source backing chain to the target before completing the job
 cp "$TEST_IMG.backing" "$TEST_IMG.target.backing"
 cp "$TEST_IMG" "$TEST_IMG.target"
-$QEMU_IMG rebase -u -b "$TEST_IMG.target.backing" "$TEST_IMG.target"
+$QEMU_IMG rebase -u -b "$TEST_IMG.target.backing" -F $IMGFMT "$TEST_IMG.target"
 
 # Complete block job
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/156.out b/tests/qemu-iotests/156.out
index 084be5ad71..cce167b63f 100644
--- a/tests/qemu-iotests/156.out
+++ b/tests/qemu-iotests/156.out
@@ -1,20 +1,20 @@
 QA output created by 156
 Formatting 'TEST_DIR/t.IMGFMT.backing', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.backing
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.backing backing_fmt=IMGFMT
 wrote 262144/262144 bytes at offset 0
 256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 196608/196608 bytes at offset 65536
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
 {"return": {}}
-Formatting 'TEST_DIR/t.IMGFMT.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
 { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'source', 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'format': 'IMGFMT', 'mode': 'existing' } }
 {"return": {}}
 { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io source "write -P 3 128k 128k"' } }
 wrote 131072/131072 bytes at offset 131072
 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 {"return": ""}
-Formatting 'TEST_DIR/t.IMGFMT.target.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.target
+Formatting 'TEST_DIR/t.IMGFMT.target.overlay', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.target backing_fmt=IMGFMT
 { 'execute': 'drive-mirror', 'arguments': { 'device': 'source', 'target': 'TEST_DIR/t.IMGFMT.target.overlay', 'mode': 'existing', 'sync': 'top' } }
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "source"}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "source"}}
diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158
index ba4db6116a..3175968e2b 100755
--- a/tests/qemu-iotests/158
+++ b/tests/qemu-iotests/158
@@ -64,7 +64,7 @@ echo "== verify pattern =="
 $QEMU_IO --object $SECRET -c "read -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img -u --object $SECRET -o "encryption=on,encrypt.key-secret=sec0" -b "$TEST_IMG_BASE" $size
+_make_test_img -u --object $SECRET -o "encryption=on,encrypt.key-secret=sec0" -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing part of a cluster =="
diff --git a/tests/qemu-iotests/158.out b/tests/qemu-iotests/158.out
index f28a17626b..83f19699bb 100644
--- a/tests/qemu-iotests/158.out
+++ b/tests/qemu-iotests/158.out
@@ -10,7 +10,7 @@ wrote 134217728/134217728 bytes at offset 0
 read 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base encryption=on
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT encryption=on
 
 == writing part of a cluster ==
 wrote 1024/1024 bytes at offset 0
diff --git a/tests/qemu-iotests/161 b/tests/qemu-iotests/161
index f572a19af2..e270976d87 100755
--- a/tests/qemu-iotests/161
+++ b/tests/qemu-iotests/161
@@ -49,8 +49,8 @@ IMG_SIZE=1M
 
 # Create the images
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE | _filter_imgfmt
-TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" | _filter_imgfmt
-_make_test_img -b "$TEST_IMG.int" | _filter_imgfmt
+TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT | _filter_imgfmt
+_make_test_img -b "$TEST_IMG.int" -F $IMGFMT -F $IMGFMT | _filter_imgfmt
 
 # First test: reopen $TEST.IMG changing the detect-zeroes option on
 # its backing file ($TEST_IMG.int).
@@ -106,8 +106,8 @@ echo "*** Commit and then change an option on the backing file"
 echo
 # Create the images again
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE | _filter_imgfmt
-TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" | _filter_imgfmt
-_make_test_img -b "$TEST_IMG.int" | _filter_imgfmt
+TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT| _filter_imgfmt
+_make_test_img -b "$TEST_IMG.int" -F $IMGFMT | _filter_imgfmt
 
 _launch_qemu -drive if=none,file="${TEST_IMG}"
 _send_qemu_cmd $QEMU_HANDLE \
diff --git a/tests/qemu-iotests/161.out b/tests/qemu-iotests/161.out
index aef9741ed3..3d8d89a9da 100644
--- a/tests/qemu-iotests/161.out
+++ b/tests/qemu-iotests/161.out
@@ -1,7 +1,7 @@
 QA output created by 161
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int
+Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int backing_fmt=IMGFMT
 
 *** Change an option on the backing file
 
@@ -29,8 +29,8 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.
 *** Commit and then change an option on the backing file
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int
+Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int backing_fmt=IMGFMT
 { 'execute': 'qmp_capabilities' }
 {"return": {}}
 { 'execute': 'block-commit', 'arguments': { 'device': 'none0', 'top': 'TEST_DIR/t.IMGFMT.int' } }
diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176
index 117c8b6954..2565ff12ee 100755
--- a/tests/qemu-iotests/176
+++ b/tests/qemu-iotests/176
@@ -84,8 +84,8 @@ echo
 
 len=$((2100 * 1024 * 1024 + 512)) # larger than 2G, and not cluster aligned
 TEST_IMG="$TEST_IMG.base" _make_test_img $len
-TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" $len
-_make_test_img -b "$TEST_IMG.itmd" $len
+TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $len
+_make_test_img -b "$TEST_IMG.itmd" -F $IMGFMT $len
 # Update the top image to use a feature that is incompatible with fast path
 case $reason in
     snapshot) $QEMU_IMG snapshot -c snap "$TEST_IMG" ;;
diff --git a/tests/qemu-iotests/176.out b/tests/qemu-iotests/176.out
index cc33def96b..9d09b60452 100644
--- a/tests/qemu-iotests/176.out
+++ b/tests/qemu-iotests/176.out
@@ -3,8 +3,8 @@ QA output created by 176
 === Test pass snapshot.0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -43,8 +43,8 @@ ID        TAG
 === Test pass snapshot.1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -84,8 +84,8 @@ ID        TAG
 === Test pass snapshot.2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -125,8 +125,8 @@ ID        TAG
 === Test pass snapshot.3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 wrote 196608/196608 bytes at offset 2147287040
 192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 131072/131072 bytes at offset 2147352576
@@ -163,8 +163,8 @@ ID        TAG
 === Test pass bitmap.0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -212,8 +212,8 @@ QMP_VERSION
 === Test pass bitmap.1 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -262,8 +262,8 @@ QMP_VERSION
 === Test pass bitmap.2 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
@@ -312,8 +312,8 @@ QMP_VERSION
 === Test pass bitmap.3 ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=2202010112
-Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd
+Formatting 'TEST_DIR/t.IMGFMT.itmd', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2202010112 backing_file=TEST_DIR/t.IMGFMT.itmd backing_fmt=IMGFMT
 QMP_VERSION
 {"return": {}}
 {"return": {}}
diff --git a/tests/qemu-iotests/177 b/tests/qemu-iotests/177
index eadc2c7ef6..5d4a77a6ab 100755
--- a/tests/qemu-iotests/177
+++ b/tests/qemu-iotests/177
@@ -51,7 +51,7 @@ echo "== setting up files =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 $QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 22 0 $size" "$TEST_IMG" | _filter_qemu_io
 
 # Limited to 64k max-transfer
diff --git a/tests/qemu-iotests/177.out b/tests/qemu-iotests/177.out
index e887542678..ba1e1e212e 100644
--- a/tests/qemu-iotests/177.out
+++ b/tests/qemu-iotests/177.out
@@ -4,7 +4,7 @@ QA output created by 177
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/179 b/tests/qemu-iotests/179
index 9372dc30ef..11a20cb1bf 100755
--- a/tests/qemu-iotests/179
+++ b/tests/qemu-iotests/179
@@ -49,7 +49,7 @@ echo '=== Testing write zeroes with unmap ==='
 echo
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 # Offsets chosen at or near 2M boundaries so test works at all cluster sizes
 # 8k and larger (smaller clusters fail due to non-contiguous allocations)
diff --git a/tests/qemu-iotests/179.out b/tests/qemu-iotests/179.out
index 80722b2289..1f7680002c 100644
--- a/tests/qemu-iotests/179.out
+++ b/tests/qemu-iotests/179.out
@@ -3,7 +3,7 @@ QA output created by 179
 === Testing write zeroes with unmap ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 2097152/2097152 bytes at offset 2097152
 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2097152/2097152 bytes at offset 6291456
diff --git a/tests/qemu-iotests/189 b/tests/qemu-iotests/189
index e6a84b8a3b..3e5ded14c6 100755
--- a/tests/qemu-iotests/189
+++ b/tests/qemu-iotests/189
@@ -66,7 +66,7 @@ echo "== verify pattern =="
 $QEMU_IO --object $SECRET0 -c "read -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" $size
+_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing part of a cluster =="
diff --git a/tests/qemu-iotests/189.out b/tests/qemu-iotests/189.out
index bc213cbe14..30af0a8608 100644
--- a/tests/qemu-iotests/189.out
+++ b/tests/qemu-iotests/189.out
@@ -10,7 +10,7 @@ wrote 16777216/16777216 bytes at offset 0
 read 16777216/16777216 bytes at offset 0
 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == writing part of a cluster ==
 wrote 1024/1024 bytes at offset 0
diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
index b05db68141..d17462e1e4 100755
--- a/tests/qemu-iotests/191
+++ b/tests/qemu-iotests/191
@@ -54,8 +54,8 @@ echo
 
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
 TEST_IMG="${TEST_IMG}.mid" _make_test_img -o "backing_fmt=$IMGFMT" -b "${TEST_IMG}.base"
-_make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
+_make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
 
 $QEMU_IO -c 'write -P 0x55 1M 64k' "${TEST_IMG}.mid" | _filter_qemu_io
 
@@ -102,10 +102,10 @@ echo === Preparing and starting VM with -drive ===
 echo
 
 TEST_IMG="${TEST_IMG}.base" _make_test_img $size
-TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base"
-_make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid"
-TEST_IMG="${TEST_IMG}.ovl3" _make_test_img -b "${TEST_IMG}.ovl2"
+TEST_IMG="${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" -F $IMGFMT
+_make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" -F $IMGFMT
+TEST_IMG="${TEST_IMG}.ovl3" _make_test_img -b "${TEST_IMG}.ovl2" -F $IMGFMT
 
 $QEMU_IO -c 'write -P 0x55 1M 64k' "${TEST_IMG}.mid" | _filter_qemu_io
 
diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out
index 34cec7b9ec..11aaf3b691 100644
--- a/tests/qemu-iotests/191.out
+++ b/tests/qemu-iotests/191.out
@@ -4,8 +4,8 @@ QA output created by 191
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
 Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 1048576
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
@@ -413,10 +413,10 @@ backing file format: IMGFMT
 === Preparing and starting VM with -drive ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
-Formatting 'TEST_DIR/t.IMGFMT.ovl3', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.ovl2
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl2', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT.ovl3', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.ovl2 backing_fmt=IMGFMT
 wrote 65536/65536 bytes at offset 1048576
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 { 'execute': 'qmp_capabilities' }
diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195
index 48984b7ac1..2351d55fe1 100755
--- a/tests/qemu-iotests/195
+++ b/tests/qemu-iotests/195
@@ -56,8 +56,8 @@ run_qemu()
 
 size=64M
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
-TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
-_make_test_img -b "$TEST_IMG.mid"
+TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
+_make_test_img -b "$TEST_IMG.mid" -F $IMGFMT
 
 echo
 echo "Change backing file of mid (opened read-only)"
@@ -75,7 +75,7 @@ echo
 echo "Change backing file of top (opened writable)"
 echo
 
-TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
+TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 run_qemu -drive if=none,file="$TEST_IMG",node-name=top <<EOF
 {"execute":"qmp_capabilities"}
diff --git a/tests/qemu-iotests/195.out b/tests/qemu-iotests/195.out
index e6df0d6781..ec84df5012 100644
--- a/tests/qemu-iotests/195.out
+++ b/tests/qemu-iotests/195.out
@@ -1,7 +1,7 @@
 QA output created by 195
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
 
 Change backing file of mid (opened read-only)
 
@@ -42,7 +42,7 @@ backing file format: IMGFMT
 
 Change backing file of top (opened writable)
 
-Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,node-name=top
 {
     QMP_VERSION
diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198
index aeb059d5ea..1b9bfb827b 100755
--- a/tests/qemu-iotests/198
+++ b/tests/qemu-iotests/198
@@ -63,7 +63,7 @@ echo "== writing whole image base =="
 $QEMU_IO --object $SECRET0 -c "write -P 0xa 0 $size" --image-opts $IMGSPECBASE | _filter_qemu_io | _filter_testdir
 
 echo "== create overlay =="
-_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" $size
+_make_test_img --object $SECRET1 -o "encrypt.format=luks,encrypt.key-secret=sec1,encrypt.iter-time=10" -u -b "$TEST_IMG_BASE" -F $IMGFMT $size
 
 echo
 echo "== writing whole image layer =="
diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out
index 4b800e70db..3952708444 100644
--- a/tests/qemu-iotests/198.out
+++ b/tests/qemu-iotests/198.out
@@ -6,7 +6,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=16777216
 wrote 16777216/16777216 bytes at offset 0
 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 == create overlay ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=16777216 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 == writing whole image layer ==
 wrote 16777216/16777216 bytes at offset 0
@@ -79,6 +79,7 @@ image: json:{ /* filtered */ }
 file format: IMGFMT
 virtual size: 16 MiB (16777216 bytes)
 backing file: TEST_DIR/t.IMGFMT.base
+backing file format: IMGFMT
 Format specific information:
     compression type: zlib
     encrypt:
diff --git a/tests/qemu-iotests/204 b/tests/qemu-iotests/204
index abb73dc381..6770fa9b96 100755
--- a/tests/qemu-iotests/204
+++ b/tests/qemu-iotests/204
@@ -52,7 +52,7 @@ echo "== setting up files =="
 
 TEST_IMG="$TEST_IMG.base" _make_test_img $size
 $QEMU_IO -c "write -P 11 0 $size" "$TEST_IMG.base" | _filter_qemu_io
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 $QEMU_IO -c "write -P 22 0 110M" "$TEST_IMG" | _filter_qemu_io
 
 # Limited to 64k max-transfer
diff --git a/tests/qemu-iotests/204.out b/tests/qemu-iotests/204.out
index f3a10fbe90..457f72df8f 100644
--- a/tests/qemu-iotests/204.out
+++ b/tests/qemu-iotests/204.out
@@ -4,7 +4,7 @@ QA output created by 204
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728
 wrote 134217728/134217728 bytes at offset 0
 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 wrote 115343360/115343360 bytes at offset 0
 110 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
diff --git a/tests/qemu-iotests/216 b/tests/qemu-iotests/216
index de11d85b5d..f93c61aad6 100755
--- a/tests/qemu-iotests/216
+++ b/tests/qemu-iotests/216
@@ -53,7 +53,7 @@ with iotests.FilePath('base.img') as base_img_path, \
     assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
     assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') == 0
     assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                    top_img_path) == 0
+                    '-F', iotests.imgfmt, top_img_path) == 0
     assert qemu_io_silent(top_img_path,  '-c', 'write -P 2 1M 1M') == 0
 
     log('Done')
diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224
index 81ca1e4898..017b0685ba 100755
--- a/tests/qemu-iotests/224
+++ b/tests/qemu-iotests/224
@@ -49,9 +49,9 @@ for filter_node_name in False, True:
         assert qemu_img('create', '-f', iotests.imgfmt,
                         base_img_path, '64M') == 0
         assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                        mid_img_path) == 0
+                        '-F', iotests.imgfmt, mid_img_path) == 0
         assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
-                        top_img_path) == 0
+                        '-F', iotests.imgfmt, top_img_path) == 0
 
         # Something to commit
         assert qemu_io_silent(mid_img_path, '-c', 'write -P 1 0 1M') == 0
diff --git a/tests/qemu-iotests/225 b/tests/qemu-iotests/225
index c9a334c7e9..0186ec8156 100755
--- a/tests/qemu-iotests/225
+++ b/tests/qemu-iotests/225
@@ -48,7 +48,7 @@ _unsupported_imgopts "subformat=monolithicFlat" \
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 1M
 TEST_IMG="$TEST_IMG.not_base" _make_test_img 1M
-_make_test_img -b "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT
 
 make_opts()
 {
diff --git a/tests/qemu-iotests/225.out b/tests/qemu-iotests/225.out
index 4dc8ee282f..0998ae094c 100644
--- a/tests/qemu-iotests/225.out
+++ b/tests/qemu-iotests/225.out
@@ -1,7 +1,7 @@
 QA output created by 225
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
 Formatting 'TEST_DIR/t.IMGFMT.not_base', fmt=IMGFMT size=1048576
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 
 === Testing fitting VMDK backing image ===
 
diff --git a/tests/qemu-iotests/228 b/tests/qemu-iotests/228
index da0900fb82..60db986d84 100755
--- a/tests/qemu-iotests/228
+++ b/tests/qemu-iotests/228
@@ -56,7 +56,8 @@ with iotests.FilePath('base.img') as base_img_path, \
     assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
     # Choose a funny way to describe the backing filename
     assert qemu_img('create', '-f', iotests.imgfmt, '-b',
-                    'file:' + base_img_path, top_img_path) == 0
+                    'file:' + base_img_path, '-F', iotests.imgfmt,
+                    top_img_path) == 0
 
     vm.launch()
 
@@ -171,7 +172,7 @@ with iotests.FilePath('base.img') as base_img_path, \
     # filename unless the backing file is opened implicitly with the
     # overlay)
     assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
-                    top_img_path) == 0
+                    '-F', iotests.imgfmt, top_img_path) == 0
 
     # You can only reliably override backing options by using a node
     # reference (or by specifying file.filename, but, well...)
diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245
index 4f5f0bb901..ad91a6f5b4 100755
--- a/tests/qemu-iotests/245
+++ b/tests/qemu-iotests/245
@@ -44,7 +44,8 @@ class TestBlockdevReopen(iotests.QMPTestCase):
 
     def setUp(self):
         qemu_img('create', '-f', iotests.imgfmt, hd_path[0], '3M')
-        qemu_img('create', '-f', iotests.imgfmt, '-b', hd_path[0], hd_path[1])
+        qemu_img('create', '-f', iotests.imgfmt, '-b', hd_path[0],
+                 '-F', iotests.imgfmt, hd_path[1])
         qemu_img('create', '-f', iotests.imgfmt, hd_path[2], '3M')
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xa0  0 1M', hd_path[0])
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xa1 1M 1M', hd_path[1])
diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249
index 2b99c9789e..68f13ed328 100755
--- a/tests/qemu-iotests/249
+++ b/tests/qemu-iotests/249
@@ -49,8 +49,8 @@ IMG_SIZE=1M
 
 # Create the images: base <- int <- active


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16336.40026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8I-0002XE-9J; Fri, 30 Oct 2020 21:40:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16336.40026; Fri, 30 Oct 2020 21:40:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8I-0002X6-6V; Fri, 30 Oct 2020 21:40:26 +0000
Received: by outflank-mailman (input) for mailman id 16336;
 Fri, 30 Oct 2020 21:40:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8H-0002W5-9y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d5e1fae5-d6c5-4b8a-95ea-a31107924f0d;
 Fri, 30 Oct 2020 21:40:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8D-0003d3-7A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8D-0000MR-6F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8H-0002W5-9y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:25 +0000
X-Inumbo-ID: d5e1fae5-d6c5-4b8a-95ea-a31107924f0d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d5e1fae5-d6c5-4b8a-95ea-a31107924f0d;
	Fri, 30 Oct 2020 21:40:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ib+tdJ2U+KKFHY7KDmrPXcM4SVgv1ljCC8m83qq8odU=; b=Z1WIIKHeculGkHQwWe3OTGuDdw
	7kuqacAXZEq959GqkUIe2soj645iiA8hM+zKyEJTeK0YiZO3gc7sjDnaaPJA9R1g/CnkrEVdQh+rW
	yvnRqWgDTte6XZbawViEsAeUQr2zY3D/Ytk2nI/0s7iLKifhfeIedsTCdFoAHf13QvPc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8D-0003d3-7A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8D-0000MR-6F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Add support to warn on backing file change without format
Message-Id: <E1kYc8D-0000MR-6F@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:21 +0000

commit e54ee1b385a9d084b4052b6db7391ea2fd799fa8
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:53 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:18:59 2020 +0200

    block: Add support to warn on backing file change without format
    
    For now, this is a mechanical addition; all callers pass false. But
    the next patch will use it to improve 'qemu-img rebase -u' when
    selecting a backing file with no format.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Peter Krempa <pkrempa@redhat.com>
    Reviewed-by: Ján Tomko <jtomko@redhat.com>
    Message-Id: <20200706203954.341758-10-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c               | 13 ++++++++++---
 block/qcow2.c         |  2 +-
 block/stream.c        |  2 +-
 blockdev.c            |  3 ++-
 include/block/block.h |  4 ++--
 qemu-img.c            |  4 ++--
 6 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/block.c b/block.c
index 6925e57d7c..4acfebf0e8 100644
--- a/block.c
+++ b/block.c
@@ -1206,7 +1206,8 @@ static int bdrv_backing_update_filename(BdrvChild *c, BlockDriverState *base,
     }
 
     ret = bdrv_change_backing_file(parent, filename,
-                                   base->drv ? base->drv->format_name : "");
+                                   base->drv ? base->drv->format_name : "",
+                                   false);
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not update backing file link");
     }
@@ -4680,8 +4681,8 @@ int bdrv_check(BlockDriverState *bs,
  *            image file header
  * -ENOTSUP - format driver doesn't support changing the backing file
  */
-int bdrv_change_backing_file(BlockDriverState *bs,
-    const char *backing_file, const char *backing_fmt)
+int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file,
+                             const char *backing_fmt, bool warn)
 {
     BlockDriver *drv = bs->drv;
     int ret;
@@ -4695,6 +4696,12 @@ int bdrv_change_backing_file(BlockDriverState *bs,
         return -EINVAL;
     }
 
+    if (warn && backing_file && !backing_fmt) {
+        warn_report("Deprecated use of backing file without explicit "
+                    "backing format, use of this image requires "
+                    "potentially unsafe format probing");
+    }
+
     if (drv->bdrv_change_backing_file != NULL) {
         ret = drv->bdrv_change_backing_file(bs, backing_file, backing_fmt);
     } else {
diff --git a/block/qcow2.c b/block/qcow2.c
index f3fc2707cd..fadf3422f8 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3627,7 +3627,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
         }
 
         ret = bdrv_change_backing_file(blk_bs(blk), qcow2_opts->backing_file,
-                                       backing_format);
+                                       backing_format, false);
         if (ret < 0) {
             error_setg_errno(errp, -ret, "Could not assign backing file '%s' "
                              "with format '%s'", qcow2_opts->backing_file,
diff --git a/block/stream.c b/block/stream.c
index aa2e7af98e..310ccbaa4c 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -78,7 +78,7 @@ static int stream_prepare(Job *job)
             }
         }
         bdrv_set_backing_hd(bs, base, &local_err);
-        ret = bdrv_change_backing_file(bs, base_id, base_fmt);
+        ret = bdrv_change_backing_file(bs, base_id, base_fmt, false);
         if (local_err) {
             error_report_err(local_err);
             return -EPERM;
diff --git a/blockdev.c b/blockdev.c
index 59b0b8ffaf..3848a9c8ab 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3416,7 +3416,8 @@ void qmp_change_backing_file(const char *device,
     }
 
     ret = bdrv_change_backing_file(image_bs, backing_file,
-                               image_bs->drv ? image_bs->drv->format_name : "");
+                                   image_bs->drv ? image_bs->drv->format_name : "",
+                                   false);
 
     if (ret < 0) {
         error_setg_errno(errp, -ret, "Could not change backing file to '%s'",
diff --git a/include/block/block.h b/include/block/block.h
index bca3bb831c..6e36154061 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -405,8 +405,8 @@ void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
 void bdrv_refresh_limits(BlockDriverState *bs, Error **errp);
 int bdrv_commit(BlockDriverState *bs);
 int bdrv_make_empty(BdrvChild *c, Error **errp);
-int bdrv_change_backing_file(BlockDriverState *bs,
-    const char *backing_file, const char *backing_fmt);
+int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file,
+                             const char *backing_fmt, bool warn);
 void bdrv_register(BlockDriver *bdrv);
 int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base,
                            const char *backing_file_str);
diff --git a/qemu-img.c b/qemu-img.c
index 46d2796fb2..a6df64a949 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3797,9 +3797,9 @@ static int img_rebase(int argc, char **argv)
      * doesn't change when we switch the backing file.
      */
     if (out_baseimg && *out_baseimg) {
-        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt);
+        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, false);
     } else {
-        ret = bdrv_change_backing_file(bs, NULL, NULL);
+        ret = bdrv_change_backing_file(bs, NULL, NULL, false);
     }
 
     if (ret == -ENOSPC) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16337.40030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8P-0002YD-BG; Fri, 30 Oct 2020 21:40:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16337.40030; Fri, 30 Oct 2020 21:40:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8P-0002Y6-7y; Fri, 30 Oct 2020 21:40:33 +0000
Received: by outflank-mailman (input) for mailman id 16337;
 Fri, 30 Oct 2020 21:40:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8O-0002Y0-PR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e5259acb-007f-4fbe-9e62-db5ed84a8fcc;
 Fri, 30 Oct 2020 21:40:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8N-0003dC-CV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8N-0000N1-Ae
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8O-0002Y0-PR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:32 +0000
X-Inumbo-ID: e5259acb-007f-4fbe-9e62-db5ed84a8fcc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e5259acb-007f-4fbe-9e62-db5ed84a8fcc;
	Fri, 30 Oct 2020 21:40:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Pxlss+mh96FqbLPsk8C9xf//RZ6tCMynnvPWQq3kZ/I=; b=VhI0YkqJd/LU53PF6fzhzMuLCS
	4/m9ZMzOOmDmyzLLYzgXR4KdNxbuhv9M3r+cp57gHsk5lyUtzRV/l8Rs+x9iEjrb1txXZ4OhWOE7O
	OaHUZmD9T4QOgejN0tJQL6QDGVAk45IXmti/si8WKQ5EFAHi1obXua8CrkXRToQQ676Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8N-0003dC-CV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8N-0000N1-Ae
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-img: Deprecate use of -b without -F
Message-Id: <E1kYc8N-0000N1-Ae@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:31 +0000

commit d9f059aa6cfccefaffa3532556e966df4a99ece2
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 6 15:39:54 2020 -0500
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:24:05 2020 +0200

    qemu-img: Deprecate use of -b without -F
    
    Creating an image that requires format probing of the backing image is
    potentially unsafe (we've had several CVEs over the years based on
    probes leaking information to the guest on a subsequent boot, although
    these days tools like libvirt are aware of the issue enough to prevent
    the worst effects).  For example, if our probing algorithm ever
    changes, or if other tools like libvirt determine a different probe
    result than we do, then subsequent use of that backing file under a
    different format will present corrupted data to the guest.
    Fortunately, the worst effects occur only when the backing image is
    originally raw, and we at least prevent commit into a probed raw
    backing file that would change its probed type.
    
    Still, it is worth starting a deprecation clock so that future
    qemu-img can refuse to create backing chains that would rely on
    probing, to encourage clients to avoid unsafe practices.  Most
    warnings are intentionally emitted from bdrv_img_create() in the block
    layer, but qemu-img convert uses bdrv_create() which cannot emit its
    own warning without causing spurious warnings on other code paths.  In
    the end, all command-line image creation or backing file rewriting now
    performs a check.
    
    Furthermore, if we probe a backing file as non-raw, then it is safe to
    explicitly record that result (rather than relying on future probes);
    only where we probe a raw image do we care about further warnings to
    the user when using such an image (for example, commits into a
    probed-raw backing file are prevented), to help them improve their
    tooling.  But whether or not we make the probe results explicit, we
    still warn the user to remind them to upgrade their workflow to supply
    -F always.
    
    iotest 114 specifically wants to create an unsafe image for later
    amendment rather than defaulting to our new default of recording a
    probed format, so it needs an update.  While touching it, expand it to
    cover all of the various warnings enabled by this patch.  iotest 301
    also shows a change to qcow messages.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200706203954.341758-11-eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 27 ++++++++++++++++++++++++++-
 docs/system/deprecated.rst | 20 ++++++++++++++++++++
 qemu-img.c                 |  9 ++++++++-
 tests/qemu-iotests/114     | 14 ++++++++++++++
 tests/qemu-iotests/114.out |  9 +++++++++
 tests/qemu-iotests/301.out |  4 +++-
 6 files changed, 80 insertions(+), 3 deletions(-)

diff --git a/block.c b/block.c
index 4acfebf0e8..35a372df57 100644
--- a/block.c
+++ b/block.c
@@ -6139,6 +6139,26 @@ void bdrv_img_create(const char *filename, const char *fmt,
             error_append_hint(&local_err, "Could not open backing image.\n");
             goto out;
         } else {
+            if (!backing_fmt) {
+                warn_report("Deprecated use of backing file without explicit "
+                            "backing format (detected format of %s)",
+                            bs->drv->format_name);
+                if (bs->drv != &bdrv_raw) {
+                    /*
+                     * A probe of raw deserves the most attention:
+                     * leaving the backing format out of the image
+                     * will ensure bs->probed is set (ensuring we
+                     * don't accidentally commit into the backing
+                     * file), and allow more spots to warn the users
+                     * to fix their toolchain when opening this image
+                     * later.  For other images, we can safely record
+                     * the format that we probed.
+                     */
+                    backing_fmt = bs->drv->format_name;
+                    qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, backing_fmt,
+                                 NULL);
+                }
+            }
             if (size == -1) {
                 /* Opened BS, have no size */
                 size = bdrv_getlength(bs);
@@ -6152,7 +6172,12 @@ void bdrv_img_create(const char *filename, const char *fmt,
             }
             bdrv_unref(bs);
         }
-    } /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */
+        /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */
+    } else if (backing_file && !backing_fmt) {
+        warn_report("Deprecated use of unopened backing file without "
+                    "explicit backing format, use of this image requires "
+                    "potentially unsafe format probing");
+    }
 
     if (size == -1) {
         error_setg(errp, "Image creation needs a size parameter");
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index c1f019b9d2..971b65be75 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -439,6 +439,26 @@ image).  Rather, any changes to the backing chain should be performed
 with ``qemu-img rebase -u`` either before or after the remaining
 changes being performed by amend, as appropriate.
 
+qemu-img backing file without format (since 5.1)
+''''''''''''''''''''''''''''''''''''''''''''''''
+
+The use of ``qemu-img create``, ``qemu-img rebase``, or ``qemu-img
+convert`` to create or modify an image that depends on a backing file
+now recommends that an explicit backing format be provided.  This is
+for safety: if QEMU probes a different format than what you thought,
+the data presented to the guest will be corrupt; similarly, presenting
+a raw image to a guest allows a potential security exploit if a future
+probe sees a non-raw image based on guest writes.
+
+To avoid the warning message, or even future refusal to create an
+unsafe image, you must pass ``-o backing_fmt=`` (or the shorthand
+``-F`` during create) to specify the intended backing format.  You may
+use ``qemu-img rebase -u`` to retroactively add a backing format to an
+existing image.  However, be aware that there are already potential
+security risks to blindly using ``qemu-img info`` to probe the format
+of an untrusted backing image, when deciding what format to add into
+an existing image.
+
 Backwards compatibility
 -----------------------
 
diff --git a/qemu-img.c b/qemu-img.c
index a6df64a949..efb6ca139e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2517,6 +2517,13 @@ static int img_convert(int argc, char **argv)
         goto out;
     }
 
+    if (out_baseimg_param) {
+        if (!qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT)) {
+            warn_report("Deprecated use of backing file without explicit "
+                        "backing format");
+        }
+    }
+
     /* Check if compression is supported */
     if (s.compressed) {
         bool encryption =
@@ -3797,7 +3804,7 @@ static int img_rebase(int argc, char **argv)
      * doesn't change when we switch the backing file.
      */
     if (out_baseimg && *out_baseimg) {
-        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, false);
+        ret = bdrv_change_backing_file(bs, out_baseimg, out_basefmt, true);
     } else {
         ret = bdrv_change_backing_file(bs, NULL, NULL, false);
     }
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
index 26104fff6c..5a7b0a4998 100755
--- a/tests/qemu-iotests/114
+++ b/tests/qemu-iotests/114
@@ -39,12 +39,21 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _unsupported_proto vxhs
+# At least OpenBSD doesn't seem to have truncate
+_supported_os Linux
 # qcow2.py does not work too well with external data files
 _unsupported_imgopts data_file
 
+# Intentionally specify backing file without backing format; demonstrate
+# the difference in warning messages when backing file could be probed.
+# Note that only a non-raw probe result will affect the resulting image.
+truncate -s $((64 * 1024 * 1024)) "$TEST_IMG.orig"
+_make_test_img -b "$TEST_IMG.orig" 64M
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+$QEMU_IMG convert -O qcow2 -B "$TEST_IMG.orig" "$TEST_IMG.orig" "$TEST_IMG"
 _make_test_img -b "$TEST_IMG.base" 64M
+_make_test_img -u -b "$TEST_IMG.base" 64M
 
 # Set an invalid backing file format
 $PYTHON qcow2.py "$TEST_IMG" add-header-ext 0xE2792ACA "foo"
@@ -55,6 +64,11 @@ _img_info
 $QEMU_IO -c "open $TEST_IMG" -c "read 0 4k" 2>&1 | _filter_qemu_io | _filter_testdir
 $QEMU_IO -c "open -o backing.driver=$IMGFMT $TEST_IMG" -c "read 0 4k" | _filter_qemu_io
 
+# Rebase the image, to show that omitting backing format triggers a warning,
+# but probing now lets us use the backing file.
+$QEMU_IMG rebase -u -b "$TEST_IMG.base" "$TEST_IMG"
+$QEMU_IO -c "open $TEST_IMG" -c "read 0 4k" 2>&1 | _filter_qemu_io | _filter_testdir
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/114.out b/tests/qemu-iotests/114.out
index 67adef37a4..0a37d20c82 100644
--- a/tests/qemu-iotests/114.out
+++ b/tests/qemu-iotests/114.out
@@ -1,5 +1,11 @@
 QA output created by 114
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of raw)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+qemu-img: warning: Deprecated use of backing file without explicit backing format
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of IMGFMT)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+qemu-img: warning: Deprecated use of unopened backing file without explicit backing format, use of this image requires potentially unsafe format probing
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
@@ -11,4 +17,7 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknow
 no file open, try 'help open'
 read 4096/4096 bytes at offset 0
 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: warning: Deprecated use of backing file without explicit backing format, use of this image requires potentially unsafe format probing
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
diff --git a/tests/qemu-iotests/301.out b/tests/qemu-iotests/301.out
index 281a16d87a..9004dad639 100644
--- a/tests/qemu-iotests/301.out
+++ b/tests/qemu-iotests/301.out
@@ -2,7 +2,8 @@ QA output created by 301
 
 == qcow backed by qcow ==
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=33554432
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of IMGFMT)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
 virtual size: 32 MiB (33554432 bytes)
@@ -35,6 +36,7 @@ cluster_size: 512
 backing file: TEST_DIR/t.IMGFMT.base
 
 == qcow backed by raw ==
+qemu-img: warning: Deprecated use of backing file without explicit backing format (detected format of raw)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=33554432 backing_file=TEST_DIR/t.IMGFMT.base
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16338.40035 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8Z-0002aF-DA; Fri, 30 Oct 2020 21:40:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16338.40035; Fri, 30 Oct 2020 21:40:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8Z-0002a7-9g; Fri, 30 Oct 2020 21:40:43 +0000
Received: by outflank-mailman (input) for mailman id 16338;
 Fri, 30 Oct 2020 21:40:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8Y-0002a0-KE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id efaba1b6-7caf-4eb9-831a-4cbc36e48da5;
 Fri, 30 Oct 2020 21:40:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8X-0003dl-Gy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8X-0000Nn-FX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8Y-0002a0-KE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:42 +0000
X-Inumbo-ID: efaba1b6-7caf-4eb9-831a-4cbc36e48da5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id efaba1b6-7caf-4eb9-831a-4cbc36e48da5;
	Fri, 30 Oct 2020 21:40:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UnA0XDvQYIfs8/oE44EGPs21Ha/mGY4A24ZG3a+dK5I=; b=VxWckOT+lsiRj8DvGJ7vZE6xzn
	6cSd1OPRUAghCcPKFwWAK99VpOcI4MfqxF19A+3fxCqEikxdaiI+sbj+IoNJo+OngIV/+ew7bzgqk
	6sVnAHSKf+P7xmgwYHg66LQ6Zi9ov/2GLvEnsY/pzfxfKKKnmVXM6LzitZDRON8l6tF8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8X-0003dl-Gy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8X-0000Nn-FX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Avoid stale pointer dereference in blk_get_aio_context()
Message-Id: <E1kYc8X-0000Nn-FX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:41 +0000

commit e6cada9231af022ffc2e351c70dfaea8530496e1
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Thu Jul 9 15:50:45 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 14 15:24:15 2020 +0200

    block: Avoid stale pointer dereference in blk_get_aio_context()
    
    It is possible for blk_remove_bs() to race with blk_drain_all(), causing
    the latter to dereference a stale blk->root pointer:
    
      blk_remove_bs(blk)
       bdrv_root_unref_child(blk->root)
        child_bs = blk->root->bs
        bdrv_detach_child(blk->root)
         ...
         g_free(blk->root) <============== blk->root becomes stale
        bdrv_unref(child_bs) <============ yield at some point
    
    A blk_drain_all() can be triggered by some guest action in the
    meantime, eg. on POWER, SLOF might disable bus mastering on
    a virtio-scsi-pci device:
    
      virtio_write_config()
       virtio_pci_stop_ioeventfd()
        virtio_bus_stop_ioeventfd()
         virtio_scsi_dataplane_stop()
          blk_drain_all()
           blk_get_aio_context()
           bs = blk->root ? blk->root->bs : NULL
                ^^^^^^^^^
                  stale
    
    Then, depending on one's luck, QEMU either crashes with SEGV or
    hits the assertion in blk_get_aio_context().
    
    blk->root is set by blk_insert_bs() which calls bdrv_root_attach_child()
    first. The blk_remove_bs() function should rollback the changes made
    by blk_insert_bs() in the opposite order (or it should be documented
    somewhere why this isn't the case). Clear blk->root before calling
    bdrv_root_unref_child() in blk_remove_bs().
    
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159430264541.389456.11925072456012783045.stgit@bahia.lan>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/block-backend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index 6936b25c83..0bf0188133 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -808,6 +808,7 @@ void blk_remove_bs(BlockBackend *blk)
 {
     ThrottleGroupMember *tgm = &blk->public.throttle_group_member;
     BlockDriverState *bs;
+    BdrvChild *root;
 
     notifier_list_notify(&blk->remove_bs_notifiers, blk);
     if (tgm->throttle_state) {
@@ -825,8 +826,9 @@ void blk_remove_bs(BlockBackend *blk)
      * to avoid that and a potential QEMU crash.
      */
     blk_drain(blk);
-    bdrv_root_unref_child(blk->root);
+    root = blk->root;
     blk->root = NULL;
+    bdrv_root_unref_child(root);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:40:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:40:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16339.40038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8k-0002bX-Et; Fri, 30 Oct 2020 21:40:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16339.40038; Fri, 30 Oct 2020 21:40:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8k-0002bP-BG; Fri, 30 Oct 2020 21:40:54 +0000
Received: by outflank-mailman (input) for mailman id 16339;
 Fri, 30 Oct 2020 21:40:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8j-0002bF-12
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e79ed89d-f933-48da-927b-a33451b52821;
 Fri, 30 Oct 2020 21:40:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8h-0003dx-Mf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8h-0000OR-LV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8j-0002bF-12
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:53 +0000
X-Inumbo-ID: e79ed89d-f933-48da-927b-a33451b52821
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e79ed89d-f933-48da-927b-a33451b52821;
	Fri, 30 Oct 2020 21:40:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6I1Ou6BBmSll6PKk6PKnUBMOgszk8QQVQkrzp8KdBTM=; b=NOeYfB4q39dk6aeG/9w9bfrUqn
	1MJlX+yAgbwPKUvtr2rzZrnpyIplqiGMnKYe1DT9TtouAx5KtrB9aXHpKEKoe8hx5XbnxJAFiT8UI
	edNtbR8HDYGd/39OtWBxXKCOsr+hvP5G3nX2yaBnGmNlw03qD89Uzlw+CuBXYT9qL/rI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8h-0003dx-Mf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8h-0000OR-LV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:40:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYc8h-0000OR-LV@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:40:51 +0000

commit d2628b1eb761a5fbf08f367da405eb3314a1f068
Merge: aeb07b5f6e69ce93afea71027325e3e7a22d2149 e6cada9231af022ffc2e351c70dfaea8530496e1
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 19:39:51 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 19:39:52 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Mitigate file fragmentation with extent size hints
    - Tighten qemu-img rules on missing backing format
    - qemu-img map: Don't limit block status request size
    - Fix crash with virtio-scsi and iothreads
    
    # gpg: Signature made Tue 14 Jul 2020 14:24:19 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      block: Avoid stale pointer dereference in blk_get_aio_context()
      qemu-img: Deprecate use of -b without -F
      block: Add support to warn on backing file change without format
      iotests: Specify explicit backing format where sensible
      qcow2: Deprecate use of qemu-img amend to change backing file
      block: Error if backing file fails during creation without -u
      qcow: Tolerate backing_fmt=
      vmdk: Add trivial backing_fmt support
      sheepdog: Add trivial backing_fmt support
      block: Finish deprecation of 'qemu-img convert -n -o'
      qemu-img: Flush stdout before before potential stderr messages
      file-posix: Mitigate file fragmentation with extent size hints
      iotests/059: Filter out disk size with more standard filter
      qemu-img map: Don't limit block status request size
      iotests: Simplify _filter_img_create() a bit
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block.c                          |   53 +-
 block/block-backend.c            |    4 +-
 block/file-posix.c               |   44 ++
 block/qcow.c                     |   20 +-
 block/qcow2.c                    |    7 +-
 block/sheepdog.c                 |   18 +-
 block/stream.c                   |    2 +-
 block/vmdk.c                     |   14 +
 blockdev.c                       |    3 +-
 docs/system/deprecated.rst       |   58 ++-
 docs/tools/qemu-img.rst          |    4 +
 include/block/block.h            |    4 +-
 include/block/block_int.h        |    1 +
 qapi/block-core.json             |   11 +-
 qemu-img.c                       |   20 +-
 tests/qemu-iotests/017           |    2 +-
 tests/qemu-iotests/017.out       |    2 +-
 tests/qemu-iotests/018           |    2 +-
 tests/qemu-iotests/018.out       |    2 +-
 tests/qemu-iotests/019           |    5 +-
 tests/qemu-iotests/019.out       |    2 +-
 tests/qemu-iotests/020           |   31 +-
 tests/qemu-iotests/020.out       |   15 +-
 tests/qemu-iotests/024           |   10 +-
 tests/qemu-iotests/024.out       |    4 +-
 tests/qemu-iotests/028           |    4 +-
 tests/qemu-iotests/028.out       |    2 +-
 tests/qemu-iotests/030           |   26 +-
 tests/qemu-iotests/034           |    2 +-
 tests/qemu-iotests/034.out       |    2 +-
 tests/qemu-iotests/037           |    2 +-
 tests/qemu-iotests/037.out       |    2 +-
 tests/qemu-iotests/038           |    2 +-
 tests/qemu-iotests/038.out       |    2 +-
 tests/qemu-iotests/039           |    3 +-
 tests/qemu-iotests/039.out       |    2 +-
 tests/qemu-iotests/040           |   47 +-
 tests/qemu-iotests/041           |   37 +-
 tests/qemu-iotests/042           |    4 +-
 tests/qemu-iotests/043           |   23 +-
 tests/qemu-iotests/043.out       |   12 +-
 tests/qemu-iotests/046           |    2 +-
 tests/qemu-iotests/046.out       |    2 +-
 tests/qemu-iotests/049.out       |    8 +-
 tests/qemu-iotests/050           |    4 +-
 tests/qemu-iotests/050.out       |    2 +-
 tests/qemu-iotests/051           |    2 +-
 tests/qemu-iotests/051.out       |    2 +-
 tests/qemu-iotests/051.pc.out    |    2 +-
 tests/qemu-iotests/054.out       |    2 +-
 tests/qemu-iotests/056           |    3 +-
 tests/qemu-iotests/059           |    2 +-
 tests/qemu-iotests/059.out       | 1009 +++++++++++++++++++-------------------
 tests/qemu-iotests/060           |    2 +-
 tests/qemu-iotests/060.out       |    2 +-
 tests/qemu-iotests/061           |   10 +-
 tests/qemu-iotests/061.out       |   11 +-
 tests/qemu-iotests/069           |    2 +-
 tests/qemu-iotests/069.out       |    2 +-
 tests/qemu-iotests/073           |    2 +-
 tests/qemu-iotests/073.out       |    2 +-
 tests/qemu-iotests/079.out       |    2 +-
 tests/qemu-iotests/082           |   10 +-
 tests/qemu-iotests/082.out       |   30 +-
 tests/qemu-iotests/085           |    4 +-
 tests/qemu-iotests/085.out       |    6 +-
 tests/qemu-iotests/089           |    2 +-
 tests/qemu-iotests/089.out       |    2 +-
 tests/qemu-iotests/095           |    4 +-
 tests/qemu-iotests/095.out       |    4 +-
 tests/qemu-iotests/097           |    4 +-
 tests/qemu-iotests/097.out       |   16 +-
 tests/qemu-iotests/098           |    2 +-
 tests/qemu-iotests/098.out       |    8 +-
 tests/qemu-iotests/106           |    7 +-
 tests/qemu-iotests/110           |    4 +-
 tests/qemu-iotests/110.out       |    4 +-
 tests/qemu-iotests/111.out       |    2 +-
 tests/qemu-iotests/112.out       |    4 +-
 tests/qemu-iotests/114           |   14 +
 tests/qemu-iotests/114.out       |    9 +
 tests/qemu-iotests/122           |   34 +-
 tests/qemu-iotests/122.out       |   12 +-
 tests/qemu-iotests/126           |    4 +-
 tests/qemu-iotests/126.out       |    4 +-
 tests/qemu-iotests/127           |    4 +-
 tests/qemu-iotests/127.out       |    4 +-
 tests/qemu-iotests/129           |    3 +-
 tests/qemu-iotests/133           |    2 +-
 tests/qemu-iotests/133.out       |    2 +-
 tests/qemu-iotests/139           |    2 +-
 tests/qemu-iotests/141           |    6 +-
 tests/qemu-iotests/141.out       |    4 +-
 tests/qemu-iotests/142           |    2 +-
 tests/qemu-iotests/142.out       |    2 +-
 tests/qemu-iotests/153           |   14 +-
 tests/qemu-iotests/153.out       |   35 +-
 tests/qemu-iotests/154           |   42 +-
 tests/qemu-iotests/154.out       |   42 +-
 tests/qemu-iotests/155           |   12 +-
 tests/qemu-iotests/156           |    9 +-
 tests/qemu-iotests/156.out       |    6 +-
 tests/qemu-iotests/158           |    2 +-
 tests/qemu-iotests/158.out       |    2 +-
 tests/qemu-iotests/161           |    8 +-
 tests/qemu-iotests/161.out       |    8 +-
 tests/qemu-iotests/175           |    6 +-
 tests/qemu-iotests/176           |    4 +-
 tests/qemu-iotests/176.out       |   32 +-
 tests/qemu-iotests/177           |    2 +-
 tests/qemu-iotests/177.out       |    2 +-
 tests/qemu-iotests/179           |    2 +-
 tests/qemu-iotests/179.out       |    2 +-
 tests/qemu-iotests/189           |    2 +-
 tests/qemu-iotests/189.out       |    2 +-
 tests/qemu-iotests/191           |   12 +-
 tests/qemu-iotests/191.out       |   12 +-
 tests/qemu-iotests/195           |    6 +-
 tests/qemu-iotests/195.out       |    6 +-
 tests/qemu-iotests/198           |    2 +-
 tests/qemu-iotests/198.out       |    3 +-
 tests/qemu-iotests/204           |    2 +-
 tests/qemu-iotests/204.out       |    2 +-
 tests/qemu-iotests/216           |    2 +-
 tests/qemu-iotests/224           |    4 +-
 tests/qemu-iotests/225           |    2 +-
 tests/qemu-iotests/225.out       |    2 +-
 tests/qemu-iotests/228           |    5 +-
 tests/qemu-iotests/243           |    7 +-
 tests/qemu-iotests/245           |    3 +-
 tests/qemu-iotests/249           |    4 +-
 tests/qemu-iotests/249.out       |    4 +-
 tests/qemu-iotests/252           |    2 +-
 tests/qemu-iotests/257           |    3 +-
 tests/qemu-iotests/259.out       |    2 +-
 tests/qemu-iotests/267           |    4 +-
 tests/qemu-iotests/267.out       |    6 +-
 tests/qemu-iotests/270           |    2 +-
 tests/qemu-iotests/270.out       |    2 +-
 tests/qemu-iotests/273           |    4 +-
 tests/qemu-iotests/273.out       |    4 +-
 tests/qemu-iotests/274           |   12 +-
 tests/qemu-iotests/274.out       |   29 +-
 tests/qemu-iotests/279           |    4 +-
 tests/qemu-iotests/279.out       |    4 +-
 tests/qemu-iotests/282.out       |    6 +-
 tests/qemu-iotests/290           |    2 +-
 tests/qemu-iotests/290.out       |    4 +-
 tests/qemu-iotests/301           |   88 ++++
 tests/qemu-iotests/301.out       |   59 +++
 tests/qemu-iotests/common.filter |   62 +--
 tests/qemu-iotests/group         |    1 +
 152 files changed, 1428 insertions(+), 990 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16340.40042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8u-0002dI-Hi; Fri, 30 Oct 2020 21:41:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16340.40042; Fri, 30 Oct 2020 21:41:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc8u-0002dA-EU; Fri, 30 Oct 2020 21:41:04 +0000
Received: by outflank-mailman (input) for mailman id 16340;
 Fri, 30 Oct 2020 21:41:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc8t-0002cz-3k
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 631b5f74-bd1f-41e1-87e1-222e95b76464;
 Fri, 30 Oct 2020 21:41:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8s-0003eK-8l
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc8s-0000QG-72
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc8t-0002cz-3k
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:03 +0000
X-Inumbo-ID: 631b5f74-bd1f-41e1-87e1-222e95b76464
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 631b5f74-bd1f-41e1-87e1-222e95b76464;
	Fri, 30 Oct 2020 21:41:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YWyE9QLalgMYCmr3t8aabpSWCOEFsJHaBH48KyCtg9c=; b=sX1+aKj5KcBH6evfS/cDBu0xo9
	cv8CqvfSeh9vQivAcV7bdPXRr26XazCEmZh0udvFUs9D3J2yoqmZu1xadtOvn/GgoQMPmU1wkzEOw
	p3ac4sXk0O0svC3m9BqbXFDKI+7cjsZFbqLg4Q1RTFwmzil1lyulFA/4gFv7gIdOITr8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8s-0003eK-8l
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc8s-0000QG-72
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
Message-Id: <E1kYc8s-0000QG-72@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:02 +0000

commit 71e2443e4ca1540db63c0bbf58ae78944c97e993
Author:     Josh Kunz <jkz@google.com>
AuthorDate: Mon Jul 6 17:10:36 2020 -0700
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 20:47:57 2020 +0200

    linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
    
    Linux uses the EPROTONOSUPPORT error code[1] if the users requests a
    netlink socket with an unsupported netlink protocol. This change
    switches linux-user to use the same code as Linux, instead of
    EPFNOSUPPORT (which AFAIK is just an anachronistic version of
    EAFNOSUPPORT).
    
    Tested by compiling all linux-user targets on x86.
    
    [1]:
    https://github.com/torvalds/linux/blob/bfe91da29bfad9941d5d703d45e29f0812a20724/net/netlink/af_netlink.c#L683
    
    Signed-off-by: Josh Kunz <jkz@google.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200707001036.1671982-1-jkz@google.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 98ea86ca81..e9f53340cd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2990,7 +2990,7 @@ static abi_long do_socket(int domain, int type, int protocol)
 #endif
          protocol == NETLINK_KOBJECT_UEVENT ||
          protocol == NETLINK_AUDIT)) {
-        return -TARGET_EPFNOSUPPORT;
+        return -TARGET_EPROTONOSUPPORT;
     }
 
     if (domain == AF_PACKET ||
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16341.40046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc94-0002eU-Jg; Fri, 30 Oct 2020 21:41:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16341.40046; Fri, 30 Oct 2020 21:41:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc94-0002eO-G2; Fri, 30 Oct 2020 21:41:14 +0000
Received: by outflank-mailman (input) for mailman id 16341;
 Fri, 30 Oct 2020 21:41:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc93-0002eD-G8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 63a97acf-9812-43fe-ad9d-0cadc9a4b349;
 Fri, 30 Oct 2020 21:41:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc92-0003eX-Co
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc92-0000R8-C2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc93-0002eD-G8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:13 +0000
X-Inumbo-ID: 63a97acf-9812-43fe-ad9d-0cadc9a4b349
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 63a97acf-9812-43fe-ad9d-0cadc9a4b349;
	Fri, 30 Oct 2020 21:41:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zAxpNEtJ/Z8WdGii4IFsJ8+wrUeUKXzEEiL7WgquhHc=; b=uEABrkDqoRo4raerQG4leao3gz
	0RwDeWz9b2kHoBc6WWfuOYctAeakJ9sncw2A/83QQUPiIszlNWhRC3jhf7YGuT8EzMryEmoQTVLUt
	bM9OqAZ1K8R5Xsvog1s6sTY3NTzY6qt+6Dy+UWAJZhit3JHsbps6g2yKzTIciFCK4O+I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc92-0003eX-Co
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc92-0000R8-C2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: refactor ipc syscall and support of semtimedop syscall
Message-Id: <E1kYc92-0000R8-C2@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:12 +0000

commit d8c08b1e6c7b1a5be1ec70e339437823a41b1946
Author:     Matus Kysel <mkysel@tachyum.com>
AuthorDate: Fri Jun 26 14:46:11 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:21:02 2020 +0200

    linux-user: refactor ipc syscall and support of semtimedop syscall
    
    Refactoring ipc syscall for s390x and SPARC, so it matches glibc implementation
    
    We should add support of semtimedop syscall as new version of glibc
    2.31 uses semop based on semtimedop
    (commit: https://gitlab.com/freedesktop-sdk/mirrors/sourceware/glibc/-/commit/765cdd0bffd77960ae852104fc4ea5edcdb8aed3 ).
    
    Signed-off-by: Matus Kysel <mkysel@tachyum.com>
    Message-Id: <20200626124612.58593-2-mkysel@tachyum.com>
    Message-Id: <20200626124612.58593-3-mkysel@tachyum.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    [lv: merged PATCH 1 & 2 to avoid build break on PATCH 1]
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 77 insertions(+), 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e9f53340cd..1211e759c2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -817,9 +817,14 @@ safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
               const struct timespec *, req, struct timespec *, rem)
 #endif
 #ifdef __NR_ipc
+#ifdef __s390x__
+safe_syscall5(int, ipc, int, call, long, first, long, second, long, third,
+              void *, ptr)
+#else
 safe_syscall6(int, ipc, int, call, long, first, long, second, long, third,
               void *, ptr, long, fifth)
 #endif
+#endif
 #ifdef __NR_msgsnd
 safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz,
               int, flags)
@@ -1230,7 +1235,8 @@ static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr,
     defined(TARGET_NR_pselect6) || defined(TARGET_NR_pselect6) || \
     defined(TARGET_NR_nanosleep) || defined(TARGET_NR_clock_settime) || \
     defined(TARGET_NR_utimensat) || defined(TARGET_NR_mq_timedsend) || \
-    defined(TARGET_NR_mq_timedreceive)
+    defined(TARGET_NR_mq_timedreceive) || defined(TARGET_NR_ipc) || \
+    defined(TARGET_NR_semop) || defined(TARGET_NR_semtimedop)
 static inline abi_long target_to_host_timespec(struct timespec *host_ts,
                                                abi_ulong target_addr)
 {
@@ -3878,25 +3884,53 @@ static inline abi_long target_to_host_sembuf(struct sembuf *host_sembuf,
     return 0;
 }
 
-static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops)
+#if defined(TARGET_NR_ipc) || defined(TARGET_NR_semop) || \
+    defined(TARGET_NR_semtimedop)
+
+/*
+ * This macro is required to handle the s390 variants, which passes the
+ * arguments in a different order than default.
+ */
+#ifdef __s390x__
+#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
+  (__nsops), (__timeout), (__sops)
+#else
+#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
+  (__nsops), 0, (__sops), (__timeout)
+#endif
+
+static inline abi_long do_semtimedop(int semid,
+                                     abi_long ptr,
+                                     unsigned nsops,
+                                     abi_long timeout)
 {
     struct sembuf sops[nsops];
+    struct timespec ts, *pts = NULL;
     abi_long ret;
 
+    if (timeout) {
+        pts = &ts;
+        if (target_to_host_timespec(pts, timeout)) {
+            return -TARGET_EFAULT;
+        }
+    }
+
     if (target_to_host_sembuf(sops, ptr, nsops))
         return -TARGET_EFAULT;
 
     ret = -TARGET_ENOSYS;
 #ifdef __NR_semtimedop
-    ret = get_errno(safe_semtimedop(semid, sops, nsops, NULL));
+    ret = get_errno(safe_semtimedop(semid, sops, nsops, pts));
 #endif
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
-        ret = get_errno(safe_ipc(IPCOP_semtimedop, semid, nsops, 0, sops, 0));
+        ret = get_errno(safe_ipc(IPCOP_semtimedop, semid,
+                                 SEMTIMEDOP_IPC_ARGS(nsops, sops, (long)pts)));
     }
 #endif
     return ret;
 }
+#endif
 
 struct target_msqid_ds
 {
@@ -4056,8 +4090,13 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
 #endif
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
+#ifdef __s390x__
+        ret = get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg,
+                                 host_mb));
+#else
         ret = get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg,
                                  host_mb, 0));
+#endif
     }
 #endif
     g_free(host_mb);
@@ -4066,6 +4105,20 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
     return ret;
 }
 
+#ifdef __NR_ipc
+#if defined(__sparc__)
+/* SPARC for msgrcv it does not use the kludge on final 2 arguments.  */
+#define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp
+#elif defined(__s390x__)
+/* The s390 sys_ipc variant has only five parameters.  */
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+    ((long int[]){(long int)__msgp, __msgtyp})
+#else
+#define MSGRCV_ARGS(__msgp, __msgtyp) \
+    ((long int[]){(long int)__msgp, __msgtyp}), 0
+#endif
+#endif
+
 static inline abi_long do_msgrcv(int msqid, abi_long msgp,
                                  ssize_t msgsz, abi_long msgtyp,
                                  int msgflg)
@@ -4094,7 +4147,7 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
 #ifdef __NR_ipc
     if (ret == -TARGET_ENOSYS) {
         ret = get_errno(safe_ipc(IPCOP_CALL(1, IPCOP_msgrcv), msqid, msgsz,
-                        msgflg, host_mb, msgtyp));
+                        msgflg, MSGRCV_ARGS(host_mb, msgtyp)));
     }
 #endif
 
@@ -4372,7 +4425,20 @@ static abi_long do_ipc(CPUArchState *cpu_env,
 
     switch (call) {
     case IPCOP_semop:
-        ret = do_semop(first, ptr, second);
+        ret = do_semtimedop(first, ptr, second, 0);
+        break;
+    case IPCOP_semtimedop:
+    /*
+     * The s390 sys_ipc variant has only five parameters instead of six
+     * (as for default variant) and the only difference is the handling of
+     * SEMTIMEDOP where on s390 the third parameter is used as a pointer
+     * to a struct timespec where the generic variant uses fifth parameter.
+     */
+#if defined(TARGET_S390X)
+        ret = do_semtimedop(first, ptr, second, third);
+#else
+        ret = do_semtimedop(first, ptr, second, fifth);
+#endif
         break;
 
     case IPCOP_semget:
@@ -9684,7 +9750,11 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
 #endif
 #ifdef TARGET_NR_semop
     case TARGET_NR_semop:
-        return do_semop(arg1, arg2, arg3);
+        return do_semtimedop(arg1, arg2, arg3, 0);
+#endif
+#ifdef TARGET_NR_semtimedop
+    case TARGET_NR_semtimedop:
+        return do_semtimedop(arg1, arg2, arg3, arg4);
 #endif
 #ifdef TARGET_NR_semctl
     case TARGET_NR_semctl:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16343.40050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9E-0002fm-Kq; Fri, 30 Oct 2020 21:41:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16343.40050; Fri, 30 Oct 2020 21:41:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9E-0002fe-Hk; Fri, 30 Oct 2020 21:41:24 +0000
Received: by outflank-mailman (input) for mailman id 16343;
 Fri, 30 Oct 2020 21:41:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc9D-0002fM-EF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id dcfb4d82-4c47-4035-a2ff-7cade675472a;
 Fri, 30 Oct 2020 21:41:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9C-0003ei-GW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9C-0000Rd-Fb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc9D-0002fM-EF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:23 +0000
X-Inumbo-ID: dcfb4d82-4c47-4035-a2ff-7cade675472a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id dcfb4d82-4c47-4035-a2ff-7cade675472a;
	Fri, 30 Oct 2020 21:41:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DbhWzRAT51lPZKSbkfp1c8CxyJgR/q8PkrM88tC+vwQ=; b=u5BJFmgB+4Q4to15oTo2nOt2hQ
	TEMP28IvrKlIeQUl1djmDYGCM9SUFGrq6Hd2RsobOnrhWgcYxeLMsZ9mBJeHEbxsLVyCp5sltS5Bv
	AnbWFavlikwAvCcvUGaVTS6w+UA+OQT9AYPTz6cKZnPJI90BYUCHnH97HtcBO+g2QMw4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9C-0003ei-GW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9C-0000Rd-Fb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: Fix Coverity CID 1430271 / CID 1430272
Message-Id: <E1kYc9C-0000Rd-Fb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:22 +0000

commit 4c1850c130a31e6f3cc896a5ba5fb7a602540bc9
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 21:22:17 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:22:08 2020 +0200

    linux-user: Fix Coverity CID 1430271 / CID 1430272
    
    In new functions print_ioctl() and print_syscall_ret_ioctl(), we don't
    check if lock_user() returns NULL and this would cause a segfault in
    thunk_print().
    
    If lock_user() returns NULL don't call thunk_print() but prints only the
    value of the (invalid) pointer.
    
    Tested with:
    
        # cat ioctl.c
        #include <unistd.h>
        #include <sys/ioctl.h>
    
        int main(void)
        {
            int ret;
    
            ret = ioctl(STDOUT_FILENO, TCGETS, 0xdeadbeef);
            ret = ioctl(STDOUT_FILENO, TCSETSF, 0xdeadbeef);
            return 0;
        }
        # QEMU_STRACE= ./ioctl
        ...
        578 ioctl(1,TCGETS,0xdeadbeef) = -1 errno=2 (Bad address)
        578 ioctl(1,TCSETSF,0xdeadbeef) = -1 errno=2 (Bad address)
        ...
        # QEMU_STRACE= passwd
        ...
        623 ioctl(0,TCGETS,0x3fffed04) = 0 ({})
        623 ioctl(0,TCSETSF,{}) = 0
        ...
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Fixes: 79482e5987c8 ("linux-user: Add strace support for printing arguments of ioctl()")
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/strace.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5235b2260c..39554d9039 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -889,8 +889,12 @@ print_syscall_ret_ioctl(const struct syscallname *name, abi_long ret,
             arg_type++;
             target_size = thunk_type_size(arg_type, 0);
             argptr = lock_user(VERIFY_READ, arg2, target_size, 1);
-            thunk_print(argptr, arg_type);
-            unlock_user(argptr, arg2, target_size);
+            if (argptr) {
+                thunk_print(argptr, arg_type);
+                unlock_user(argptr, arg2, target_size);
+            } else {
+                print_pointer(arg2, 1);
+            }
             qemu_log(")");
         }
     }
@@ -3119,8 +3123,12 @@ print_ioctl(const struct syscallname *name,
                     arg_type++;
                     target_size = thunk_type_size(arg_type, 0);
                     argptr = lock_user(VERIFY_READ, arg2, target_size, 1);
-                    thunk_print(argptr, arg_type);
-                    unlock_user(argptr, arg2, target_size);
+                    if (argptr) {
+                        thunk_print(argptr, arg_type);
+                        unlock_user(argptr, arg2, target_size);
+                    } else {
+                        print_pointer(arg2, 1);
+                    }
                     break;
                 }
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16344.40054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9O-0002hM-Me; Fri, 30 Oct 2020 21:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16344.40054; Fri, 30 Oct 2020 21:41:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9O-0002hD-JV; Fri, 30 Oct 2020 21:41:34 +0000
Received: by outflank-mailman (input) for mailman id 16344;
 Fri, 30 Oct 2020 21:41:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc9N-0002h3-GH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 286d9f68-d6b3-4031-88c9-937a00adc027;
 Fri, 30 Oct 2020 21:41:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9M-0003es-KG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9M-0000SN-JK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc9N-0002h3-GH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:33 +0000
X-Inumbo-ID: 286d9f68-d6b3-4031-88c9-937a00adc027
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 286d9f68-d6b3-4031-88c9-937a00adc027;
	Fri, 30 Oct 2020 21:41:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XoXtbsA8mgMSqQINBe37n/feE/sopbwWBogF/lXCG6k=; b=6sPEZUG3H0AnCYjoLJr00FmoZK
	yP63wGi2CiRPqBJIzGB8cR2Mpi2uCa0yIy1tuog1liD583ww0I8dVfsPlM4xEEaooN0ahHu/Flwde
	8UVuQf9SX/gBcZcxlhv6PduruqaagNVYbwnmHbFLxaF4YH82gUzRnlKc5oHGdapP/aA0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9M-0003es-KG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9M-0000SN-JK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: add new netlink types
Message-Id: <E1kYc9M-0000SN-JK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:32 +0000

commit d9679ee592dd181854a39ed05db4038c0a6bbf80
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 09:23:31 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:25:33 2020 +0200

    linux-user: add new netlink types
    
    Only implement IFLA_PERM_ADDRESS to fix the following error:
    
      Unknown host QEMU_IFLA type: 54
    
    The couple of other ones, IFLA_PROP_LIST and IFLA_ALT_IFNAME, have
    been introduced to be used with RTM_NEWLINKPROP, RTM_DELLINKPROP and
    RTM_GETLINKPROP that are not implemented by QEMU.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200709072332.890440-1-laurent@vivier.eu>
---
 linux-user/fd-trans.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index c0687c52e6..5d49a53552 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -133,6 +133,9 @@ enum {
     QEMU_IFLA_NEW_IFINDEX,
     QEMU_IFLA_MIN_MTU,
     QEMU_IFLA_MAX_MTU,
+    QEMU_IFLA_PROP_LIST,
+    QEMU_IFLA_ALT_IFNAME,
+    QEMU_IFLA_PERM_ADDRESS,
     QEMU___IFLA_MAX
 };
 
@@ -807,6 +810,7 @@ static abi_long host_to_target_data_link_rtattr(struct rtattr *rtattr)
     /* binary stream */
     case QEMU_IFLA_ADDRESS:
     case QEMU_IFLA_BROADCAST:
+    case QEMU_IFLA_PERM_ADDRESS:
     /* string */
     case QEMU_IFLA_IFNAME:
     case QEMU_IFLA_QDISC:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16346.40058 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9a-0002jK-OE; Fri, 30 Oct 2020 21:41:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16346.40058; Fri, 30 Oct 2020 21:41:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9a-0002jC-LA; Fri, 30 Oct 2020 21:41:46 +0000
Received: by outflank-mailman (input) for mailman id 16346;
 Fri, 30 Oct 2020 21:41:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc9Z-0002ik-7x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e8505585-8888-4783-b879-64e8a7579d5e;
 Fri, 30 Oct 2020 21:41:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9W-0003fh-Nw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9W-0000Su-NC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc9Z-0002ik-7x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:45 +0000
X-Inumbo-ID: e8505585-8888-4783-b879-64e8a7579d5e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e8505585-8888-4783-b879-64e8a7579d5e;
	Fri, 30 Oct 2020 21:41:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9OG0NkqZiM6M7S/5xupuTelUAeGOuoWVyLeNLoiHSeI=; b=pM56PuiVxTIxVZHts73H5Gv4zY
	E5VI/ibq4OG5T9YWx28yGxjV8aWIrR2AXdVwbrjEI3M0JueJWQo55/YdvJN+ITZIgcJuQp4/W3kUz
	ce0nA4QoeD9DA2uP3F4ub7KNM/yTGYtkIxfdWUbQea/3hrAjdvWcp+I8IuV0GvhRbNPo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9W-0003fh-Nw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9W-0000Su-NC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: add netlink RTM_SETLINK command
Message-Id: <E1kYc9W-0000Su-NC@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:42 +0000

commit 65b261a63a48fbb3b11193361d4ea0c38a3c3dfd
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Thu Jul 9 09:23:32 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 13 21:26:33 2020 +0200

    linux-user: add netlink RTM_SETLINK command
    
    This command is needed to be able to boot systemd in a container.
    
      $ sudo systemd-nspawn -D /chroot/armhf/sid/ -b
      Spawning container sid on /chroot/armhf/sid.
      Press ^] three times within 1s to kill container.
      systemd 245.6-2 running in system mode.
      Detected virtualization systemd-nspawn.
      Detected architecture arm.
    
      Welcome to Debian GNU/Linux bullseye/sid!
    
      Set hostname to <virt-arm>.
      Failed to enqueue loopback interface start request: Operation not supported
      Caught <SEGV>, dumped core as pid 3.
      Exiting PID 1...
      Container sid failed with error code 255.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200709072332.890440-2-laurent@vivier.eu>
---
 linux-user/fd-trans.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c
index 5d49a53552..1486c81aaa 100644
--- a/linux-user/fd-trans.c
+++ b/linux-user/fd-trans.c
@@ -1204,6 +1204,7 @@ static abi_long target_to_host_data_route(struct nlmsghdr *nlh)
         break;
     case RTM_NEWLINK:
     case RTM_DELLINK:
+    case RTM_SETLINK:
         if (nlh->nlmsg_len >= NLMSG_LENGTH(sizeof(*ifi))) {
             ifi = NLMSG_DATA(nlh);
             ifi->ifi_type = tswap16(ifi->ifi_type);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:41:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:41:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16347.40061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9j-0002kR-Pz; Fri, 30 Oct 2020 21:41:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16347.40061; Fri, 30 Oct 2020 21:41:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9j-0002kJ-Mf; Fri, 30 Oct 2020 21:41:55 +0000
Received: by outflank-mailman (input) for mailman id 16347;
 Fri, 30 Oct 2020 21:41:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc9i-0002k9-8v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 11f31778-8404-4b2b-b468-74b3db439462;
 Fri, 30 Oct 2020 21:41:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9g-0003fn-RZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9g-0000Ta-Qm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc9i-0002k9-8v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:54 +0000
X-Inumbo-ID: 11f31778-8404-4b2b-b468-74b3db439462
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 11f31778-8404-4b2b-b468-74b3db439462;
	Fri, 30 Oct 2020 21:41:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7ufLbA9VXPV1SgCHAZFEuM1D4mX45fefU5GyMsmDlQg=; b=y43VAcvz4fpXMYAKmpeFhyAacn
	Bv90AH8oUQAisV37o3sTvTvenMvY+JQkjKBqRWQF3LtCOhCJFHK6cxXYW3XGm3F3Z8nTUQtj1jges
	x3TBNew6X28wjSUhuQfZDb1lIQ6aK8lNy+Yh+k3Yw9RZS351eD9ZifnFFLNMg8xaW6ZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9g-0003fn-RZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9g-0000Ta-Qm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:41:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: fix the errno value in print_syscall_err()
Message-Id: <E1kYc9g-0000Ta-Qm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:41:52 +0000

commit 6733d57035d1c4a67070b8d737334c28e5c63bc6
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Wed Jul 8 17:24:34 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 14 09:29:14 2020 +0200

    linux-user: fix the errno value in print_syscall_err()
    
    errno of the target is returned as a negative value by the syscall,
    not in the host errno variable.
    
    The emulation of the target syscall can return an error while the
    host doesn't set an errno value. Target errnos and host errnos can
    also differ in some cases.
    
    Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument printing after syscall execution")
    Cc: Filip.Bozuta@syrmia.com
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
    Message-Id: <20200708152435.706070-2-laurent@vivier.eu>
---
 linux-user/strace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 39554d9039..7769f53bd5 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -731,7 +731,7 @@ print_syscall_err(abi_long ret)
 
     qemu_log(" = ");
     if (ret < 0) {
-        qemu_log("-1 errno=%d", errno);
+        qemu_log("-1 errno=%d", (int)-ret);
         errstr = target_strerror(-ret);
         if (errstr) {
             qemu_log(" (%s)", errstr);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16348.40066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9s-0002lw-TY; Fri, 30 Oct 2020 21:42:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16348.40066; Fri, 30 Oct 2020 21:42:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYc9s-0002lo-QM; Fri, 30 Oct 2020 21:42:04 +0000
Received: by outflank-mailman (input) for mailman id 16348;
 Fri, 30 Oct 2020 21:42:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYc9r-0002lh-SS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 27ad96e8-fcf6-40c0-b472-c34bc152d49a;
 Fri, 30 Oct 2020 21:42:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9q-0003gA-VM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYc9q-0000UG-UP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYc9r-0002lh-SS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:03 +0000
X-Inumbo-ID: 27ad96e8-fcf6-40c0-b472-c34bc152d49a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 27ad96e8-fcf6-40c0-b472-c34bc152d49a;
	Fri, 30 Oct 2020 21:42:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x+lkOLnVXRgPnVqIjDktGVof/4yoKtiMyitDwp92yWM=; b=FOFQX1mqiAACXLhbDRKYfpcpWm
	FtrblgRNY3DSCambIwMjMw04fmf/CRz6+sRKZ6JLu1OD19/ggvgMujaNfvQCZZFMWCrokovU1zZvU
	zOfxbkj9gMh7U2wlthZDtM6FseosWzLzDTa+DS8E2kGLtQlvrzOuio9D5Emh2HQIshq0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9q-0003gA-VM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYc9q-0000UG-UP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: fix print_syscall_err() when syscall returned value is negative
Message-Id: <E1kYc9q-0000UG-UP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:02 +0000

commit 42b16184d016d48d167229a1ddb89b3671c77440
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Wed Jul 8 17:24:35 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Tue Jul 14 09:29:14 2020 +0200

    linux-user: fix print_syscall_err() when syscall returned value is negative
    
    print_syscall_err() relies on the sign of the returned value to know
    if it is an errno value or not.
    
    But in some cases the returned value can have the most signicant bit
    set without being an errno.
    
    This patch restores previous behaviour that was also checking if
    we can decode the errno to validate it.
    
    This patch fixes this kind of problem (qemu-m68k):
    
      root@sid:/# QEMU_STRACE= ls
      3 brk(NULL) = -1 errno=21473607683 uname(0x407fff8a) = 0
    
    to become:
    
      root@sid:/# QEMU_STRACE= ls
      3 brk(NULL) = 0x8001e000
      3 uname(0xffffdf8a) = 0
    
    Fixes: c84be71f6854 ("linux-user: Extend strace support to enable argument printing after syscall execution")
    Cc: Filip.Bozuta@syrmia.com
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200708152435.706070-3-laurent@vivier.eu>
---
 linux-user/strace.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 7769f53bd5..13981341b3 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -724,19 +724,20 @@ print_ipc(const struct syscallname *name,
  * Variants for the return value output function
  */
 
-static void
+static bool
 print_syscall_err(abi_long ret)
 {
-    const char *errstr = NULL;
+    const char *errstr;
 
     qemu_log(" = ");
     if (ret < 0) {
-        qemu_log("-1 errno=%d", (int)-ret);
         errstr = target_strerror(-ret);
         if (errstr) {
-            qemu_log(" (%s)", errstr);
+            qemu_log("-1 errno=%d (%s)", (int)-ret, errstr);
+            return true;
         }
     }
+    return false;
 }
 
 static void
@@ -744,11 +745,10 @@ print_syscall_ret_addr(const struct syscallname *name, abi_long ret,
                        abi_long arg0, abi_long arg1, abi_long arg2,
                        abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
-        qemu_log("0x" TARGET_ABI_FMT_lx "\n", ret);
+    if (!print_syscall_err(ret)) {
+        qemu_log("0x" TARGET_ABI_FMT_lx, ret);
     }
+    qemu_log("\n");
 }
 
 #if 0 /* currently unused */
@@ -765,9 +765,7 @@ print_syscall_ret_newselect(const struct syscallname *name, abi_long ret,
                             abi_long arg0, abi_long arg1, abi_long arg2,
                             abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(" = 0x" TARGET_ABI_FMT_lx " (", ret);
         print_fdset(arg0, arg1);
         qemu_log(",");
@@ -796,9 +794,7 @@ print_syscall_ret_adjtimex(const struct syscallname *name, abi_long ret,
                            abi_long arg0, abi_long arg1, abi_long arg2,
                            abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
         switch (ret) {
         case TARGET_TIME_OK:
@@ -833,9 +829,7 @@ print_syscall_ret_listxattr(const struct syscallname *name, abi_long ret,
                             abi_long arg0, abi_long arg1, abi_long arg2,
                             abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
         qemu_log(" (list = ");
         if (arg1 != 0) {
@@ -866,9 +860,7 @@ print_syscall_ret_ioctl(const struct syscallname *name, abi_long ret,
                         abi_long arg0, abi_long arg1, abi_long arg2,
                         abi_long arg3, abi_long arg4, abi_long arg5)
 {
-    print_syscall_err(ret);
-
-    if (ret >= 0) {
+    if (!print_syscall_err(ret)) {
         qemu_log(TARGET_ABI_FMT_ld, ret);
 
         const IOCTLEntry *ie;
@@ -3197,9 +3189,7 @@ print_syscall_ret(int num, abi_long ret,
                                   arg1, arg2, arg3,
                                   arg4, arg5, arg6);
             } else {
-                print_syscall_err(ret);
-
-                if (ret >= 0) {
+                if (!print_syscall_err(ret)) {
                     qemu_log(TARGET_ABI_FMT_ld, ret);
                 }
                 qemu_log("\n");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16349.40070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcA2-0002nE-Ug; Fri, 30 Oct 2020 21:42:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16349.40070; Fri, 30 Oct 2020 21:42:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcA2-0002n6-Rk; Fri, 30 Oct 2020 21:42:14 +0000
Received: by outflank-mailman (input) for mailman id 16349;
 Fri, 30 Oct 2020 21:42:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcA2-0002mx-2q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 39e26190-6acb-46fd-8c93-b5d1a78176f6;
 Fri, 30 Oct 2020 21:42:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcA1-0003gK-3C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcA1-0000Un-2O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcA2-0002mx-2q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:14 +0000
X-Inumbo-ID: 39e26190-6acb-46fd-8c93-b5d1a78176f6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 39e26190-6acb-46fd-8c93-b5d1a78176f6;
	Fri, 30 Oct 2020 21:42:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z8McZWFkwAHz0AZ9adpABt0fVT4zrFciZOfrKBGak6U=; b=PyxP97gO4SshpjlclvE/4qhxoa
	F5wK3/WJPRW7NoR3Cz+xjUXz+9oDVgf1p4xRAPgahvpZnlIQ6JE78ejAEDWUX5Z1s2LlaI19V7lyR
	WnYte2RKuxBV50rLKIdOwVyy7cDkuoM3nmhNSeZsThI57s23NKBKl4ovUzWLBt8CQRVc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcA1-0003gK-3C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcA1-0000Un-2O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
Message-Id: <E1kYcA1-0000Un-2O@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:13 +0000

commit 8bfa25a46ff1082f75e7052875b5d435119dcf49
Merge: d2628b1eb761a5fbf08f367da405eb3314a1f068 42b16184d016d48d167229a1ddb89b3671c77440
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 20:24:00 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 20:24:00 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
    
    linux-user branch 20200714
    
    Fix strace errno management
    Fix Coverity erros in ioctl straces
    Fix some netlinks errors
    Fix semtimedop
    
    # gpg: Signature made Tue 14 Jul 2020 08:31:56 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/linux-user-for-5.1-pull-request:
      linux-user: fix print_syscall_err() when syscall returned value is negative
      linux-user: fix the errno value in print_syscall_err()
      linux-user: add netlink RTM_SETLINK command
      linux-user: add new netlink types
      linux-user: Fix Coverity CID 1430271 / CID 1430272
      linux-user: refactor ipc syscall and support of semtimedop syscall
      linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 linux-user/fd-trans.c |  5 +++
 linux-user/strace.c   | 52 +++++++++++++++----------------
 linux-user/syscall.c  | 86 ++++++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 108 insertions(+), 35 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16350.40073 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAE-0002oZ-07; Fri, 30 Oct 2020 21:42:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16350.40073; Fri, 30 Oct 2020 21:42:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAD-0002oS-TZ; Fri, 30 Oct 2020 21:42:25 +0000
Received: by outflank-mailman (input) for mailman id 16350;
 Fri, 30 Oct 2020 21:42:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcAC-0002oG-9K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 141062d9-7b64-4705-94e2-e29ef63f6c50;
 Fri, 30 Oct 2020 21:42:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAB-0003gW-FE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAB-0000Vs-Dw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcAC-0002oG-9K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:24 +0000
X-Inumbo-ID: 141062d9-7b64-4705-94e2-e29ef63f6c50
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 141062d9-7b64-4705-94e2-e29ef63f6c50;
	Fri, 30 Oct 2020 21:42:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6pCd0wma1ZvZ6cj95vlBb0Fkd+wNnhBX6EGJsMmXY/o=; b=MhP34zBY77sgD5vA+ClcePn5GJ
	hNs3MyGsvRA+g0MgeiG8NprRZKXvHCg7fAFhP3K/HZDmzAsB80WLwEUBzRjkJpphjxWTJr8IkOQz+
	aibxEzC8KOju83zMjjWBNbkpRLTvfBOrgNGKNhCT8sKMhbYBPZDA61Wk5l4wzLPn6Mo4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAB-0003gW-FE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAB-0000Vs-Dw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qga-win: Fix QGA VSS Provider service stop failure
Message-Id: <E1kYcAB-0000Vs-Dw@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:23 +0000

commit 917ebcb170273913bca33d44263bc5fd14f72fd7
Author:     Basil Salman <bsalman@redhat.com>
AuthorDate: Mon Jul 6 18:50:39 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:13:14 2020 -0500

    qga-win: Fix QGA VSS Provider service stop failure
    
    On one hand "guest-fsfreeze-freeze" command, "COM+ System Application service" is
    stopped, on the other hand "guest-fsfreeze-thaw" stops QGA VSS Provider service from
    "COM+ Application Admin Catalog".
    Invoking a series of freeze and thaw commands may result in QGA failing to stop
    VSS Provider service as "COM+ System Application service" is stopped, which can
    cause some delay in qga response.
    In this commit StopService function was changed and VSS Provider service is now
    stopped using Winsvc library API.
    
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1549425
    
    Signed-off-by: Basil Salman <bsalman@redhat.com>
    Signed-off-by: Basil Salman <basil@daynix.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/vss-win32/install.cpp | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index a456841360..40de133774 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -19,6 +19,7 @@
 #include <comdef.h>
 #include <comutil.h>
 #include <sddl.h>
+#include <winsvc.h>
 
 #define BUFFER_SIZE 1024
 
@@ -509,26 +510,32 @@ namespace _com_util
     }
 }
 
-/* Stop QGA VSS provider service from COM+ Application Admin Catalog */
-
+/* Stop QGA VSS provider service using Winsvc API  */
 STDAPI StopService(void)
 {
     HRESULT hr;
-    COMInitializer initializer;
-    COMPointer<IUnknown> pUnknown;
-    COMPointer<ICOMAdminCatalog2> pCatalog;
+    SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
+    SC_HANDLE service = NULL;
 
-    int count = 0;
+    if (!manager) {
+        errmsg(E_FAIL, "Failed to open service manager");
+        hr = E_FAIL;
+        goto out;
+    }
+    service = OpenService(manager, QGA_PROVIDER_NAME, SC_MANAGER_ALL_ACCESS);
 
-    chk(QGAProviderFind(QGAProviderCount, (void *)&count));
-    if (count) {
-        chk(CoCreateInstance(CLSID_COMAdminCatalog, NULL, CLSCTX_INPROC_SERVER,
-            IID_IUnknown, (void **)pUnknown.replace()));
-        chk(pUnknown->QueryInterface(IID_ICOMAdminCatalog2,
-            (void **)pCatalog.replace()));
-        chk(pCatalog->ShutdownApplication(_bstr_t(QGA_PROVIDER_LNAME)));
+    if (!service) {
+        errmsg(E_FAIL, "Failed to open service");
+        hr =  E_FAIL;
+        goto out;
+    }
+    if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) {
+        errmsg(E_FAIL, "Failed to stop service");
+        hr = E_FAIL;
     }
 
 out:
+    CloseServiceHandle(service);
+    CloseServiceHandle(manager);
     return hr;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16351.40078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAO-0002po-2T; Fri, 30 Oct 2020 21:42:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16351.40078; Fri, 30 Oct 2020 21:42:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAN-0002pg-VM; Fri, 30 Oct 2020 21:42:35 +0000
Received: by outflank-mailman (input) for mailman id 16351;
 Fri, 30 Oct 2020 21:42:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcAM-0002pT-Aj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f7aaa4e4-bab5-41b9-bece-4fb166494226;
 Fri, 30 Oct 2020 21:42:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAL-0003ge-JH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAL-0000WM-Hy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcAM-0002pT-Aj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:34 +0000
X-Inumbo-ID: f7aaa4e4-bab5-41b9-bece-4fb166494226
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f7aaa4e4-bab5-41b9-bece-4fb166494226;
	Fri, 30 Oct 2020 21:42:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C2skmqkmfGIeIITeqRUQcoLFAaI/0gT+jOj8jd9yDUM=; b=BRC2zuI4hJby6+bp2FDq72VXlT
	TsyEB1o87NIY+/qxXUj+/vTKRlYI3xMclKGGWJyiN3QfyzD73qn/iYrJQQv7a/aWlI+v5P1l/13rw
	TDscrPW76toA2gq75Mc03HjamR5aprmVRmQCAxnWmM7jHUz2gqDerswpiy1wUWAGrNRw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAL-0003ge-JH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAL-0000WM-Hy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qga: fix assert regression on guest-shutdown
Message-Id: <E1kYcAL-0000WM-Hy@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:33 +0000

commit 844bd70b5652f30bbace89499f513e3fbbb6457a
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Thu Jun 4 11:44:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:17:08 2020 -0500

    qga: fix assert regression on guest-shutdown
    
    Since commit 781f2b3d1e ("qga: process_event() simplification"),
    send_response() is called unconditionally, but will assert when "rsp" is
    NULL. This may happen with QCO_NO_SUCCESS_RESP commands, such as
    "guest-shutdown".
    
    Fixes: 781f2b3d1e5ef389b44016a897fd55e7a780bf35
    Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qga/main.c b/qga/main.c
index f0e454f28d..3febf3b0fd 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -531,7 +531,11 @@ static int send_response(GAState *s, const QDict *rsp)
     QString *payload_qstr, *response_qstr;
     GIOStatus status;
 
-    g_assert(rsp && s->channel);
+    g_assert(s->channel);
+
+    if (!rsp) {
+        return 0;
+    }
 
     payload_qstr = qobject_to_json(QOBJECT(rsp));
     if (!payload_qstr) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16352.40082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAY-0002rq-3r; Fri, 30 Oct 2020 21:42:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16352.40082; Fri, 30 Oct 2020 21:42:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAY-0002rh-0c; Fri, 30 Oct 2020 21:42:46 +0000
Received: by outflank-mailman (input) for mailman id 16352;
 Fri, 30 Oct 2020 21:42:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcAW-0002rV-L0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c315f9f4-be17-4f7c-b6f6-17ad6dd922c1;
 Fri, 30 Oct 2020 21:42:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAV-0003ij-Mq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAV-0000YL-M0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcAW-0002rV-L0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:44 +0000
X-Inumbo-ID: c315f9f4-be17-4f7c-b6f6-17ad6dd922c1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c315f9f4-be17-4f7c-b6f6-17ad6dd922c1;
	Fri, 30 Oct 2020 21:42:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pPBkdjVA9m7PqxF/ip7e90dgJ/2NPZqFlmRAGC8KdB4=; b=uhDm1Z7vq2nPYHTUVNiHsJ6jfT
	WXYTqepIuTCJmsvUIQGGPohx76yL/CwkKZjf63XD8BaBo/P7PxPmmyJ3RjA6rnj4K86/5t1XZ9dFC
	XiUoQltUadY5G6Kq1f6GpRMiPcuTt73Sxymxto2CGIerDgl0LRVHUsGrxD18mskidmeg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAV-0003ij-Mq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAV-0000YL-M0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] util: Introduce qemu_get_host_name()
Message-Id: <E1kYcAV-0000YL-M0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:43 +0000

commit e47f4765afcab2b78dfa5b0115abf64d1d49a5d3
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:35 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:44:58 2020 -0500

    util: Introduce qemu_get_host_name()
    
    This function offers operating system agnostic way to fetch host
    name. It is implemented for both POSIX-like and Windows systems.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 include/qemu/osdep.h | 10 ++++++++++
 util/oslib-posix.c   | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c   | 13 +++++++++++++
 3 files changed, 58 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 979a403984..4841b5c6b5 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -655,4 +655,14 @@ static inline void qemu_reset_optind(void)
 #endif
 }
 
+/**
+ * qemu_get_host_name:
+ * @errp: Error object
+ *
+ * Operating system agnostic way of querying host name.
+ *
+ * Returns allocated hostname (caller should free), NULL on failure.
+ */
+char *qemu_get_host_name(Error **errp);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 72907d4d7f..e60aea85b6 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -794,3 +794,38 @@ void sigaction_invoke(struct sigaction *action,
     }
     action->sa_sigaction(info->ssi_signo, &si, NULL);
 }
+
+#ifndef HOST_NAME_MAX
+# ifdef _POSIX_HOST_NAME_MAX
+#  define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+# else
+#  define HOST_NAME_MAX 255
+# endif
+#endif
+
+char *qemu_get_host_name(Error **errp)
+{
+    long len = -1;
+    g_autofree char *hostname = NULL;
+
+#ifdef _SC_HOST_NAME_MAX
+    len = sysconf(_SC_HOST_NAME_MAX);
+#endif /* _SC_HOST_NAME_MAX */
+
+    if (len < 0) {
+        len = HOST_NAME_MAX;
+    }
+
+    /* Unfortunately, gethostname() below does not guarantee a
+     * NULL terminated string. Therefore, allocate one byte more
+     * to be sure. */
+    hostname = g_new0(char, len + 1);
+
+    if (gethostname(hostname, len) < 0) {
+        error_setg_errno(errp, errno,
+                         "cannot get hostname");
+        return NULL;
+    }
+
+    return g_steal_pointer(&hostname);
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index e9b14ab178..3b49d27297 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -808,3 +808,16 @@ bool qemu_write_pidfile(const char *filename, Error **errp)
     }
     return true;
 }
+
+char *qemu_get_host_name(Error **errp)
+{
+    wchar_t tmp[MAX_COMPUTERNAME_LENGTH + 1];
+    DWORD size = G_N_ELEMENTS(tmp);
+
+    if (GetComputerNameW(tmp, &size) == 0) {
+        error_setg_win32(errp, GetLastError(), "failed close handle");
+        return NULL;
+    }
+
+    return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:42:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:42:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16353.40085 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAi-0002tD-5T; Fri, 30 Oct 2020 21:42:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16353.40085; Fri, 30 Oct 2020 21:42:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAi-0002t5-28; Fri, 30 Oct 2020 21:42:56 +0000
Received: by outflank-mailman (input) for mailman id 16353;
 Fri, 30 Oct 2020 21:42:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcAg-0002sx-Ix
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8c85ce91-8446-44a7-9256-af608b2525df;
 Fri, 30 Oct 2020 21:42:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAf-0003ir-QX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAf-0000Yw-Pb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcAg-0002sx-Ix
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:54 +0000
X-Inumbo-ID: 8c85ce91-8446-44a7-9256-af608b2525df
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8c85ce91-8446-44a7-9256-af608b2525df;
	Fri, 30 Oct 2020 21:42:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EJ7G0UeFCZbptSioe/u1meMgt1iFtq87OM4jJ/89y5s=; b=f9BckJELpbAjLRZjq1RudzJSjK
	rf/FNNQESdiBAdkzhmJyo2REnSth5gxN3TFHt++DLzE/QnyCM8m0NTQcHCSvKZPpnPPU6GTJVYUyf
	q/VQZWnfMsjWdSTk8HMEukoGxCnMzwlGC1GmKfZaWQl7zU7SG+g2J6dr+lnnaVBKv5yQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAf-0003ir-QX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAf-0000Yw-Pb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:42:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qga: Use qemu_get_host_name() instead of g_get_host_name()
Message-Id: <E1kYcAf-0000Yw-Pb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:42:53 +0000

commit 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Mon Jun 22 20:19:36 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 13 17:44:58 2020 -0500

    qga: Use qemu_get_host_name() instead of g_get_host_name()
    
    Problem with g_get_host_name() is that on the first call it saves
    the hostname into a global variable and from then on, every
    subsequent call returns the saved hostname. Even if the hostname
    changes. This doesn't play nicely with guest agent, because if
    the hostname is acquired before the guest is set up (e.g. on the
    first boot, or before DHCP) we will report old, invalid hostname.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1845127
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/qga/commands.c b/qga/commands.c
index efc8b90281..d3fec807c1 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -515,11 +515,20 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
 GuestHostName *qmp_guest_get_host_name(Error **errp)
 {
     GuestHostName *result = NULL;
-    gchar const *hostname = g_get_host_name();
-    if (hostname != NULL) {
-        result = g_new0(GuestHostName, 1);
-        result->host_name = g_strdup(hostname);
+    g_autofree char *hostname = qemu_get_host_name(errp);
+
+    /*
+     * We want to avoid using g_get_host_name() because that
+     * caches the result and we wouldn't reflect changes in the
+     * host name.
+     */
+
+    if (!hostname) {
+        hostname = g_strdup("localhost");
     }
+
+    result = g_new0(GuestHostName, 1);
+    result->host_name = g_steal_pointer(&hostname);
     return result;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16354.40091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAs-0002wE-8n; Fri, 30 Oct 2020 21:43:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16354.40091; Fri, 30 Oct 2020 21:43:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcAs-0002w4-5Q; Fri, 30 Oct 2020 21:43:06 +0000
Received: by outflank-mailman (input) for mailman id 16354;
 Fri, 30 Oct 2020 21:43:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcAq-0002vu-NG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4a176ce4-8254-4b3a-87ed-93c81c95c3f1;
 Fri, 30 Oct 2020 21:43:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAp-0003jC-Uu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcAp-0000Zd-TV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcAq-0002vu-NG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:04 +0000
X-Inumbo-ID: 4a176ce4-8254-4b3a-87ed-93c81c95c3f1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4a176ce4-8254-4b3a-87ed-93c81c95c3f1;
	Fri, 30 Oct 2020 21:43:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cg0AsvbvGJ3q/6AKI2qqBYCQxi7jNh+L7A0uVVpTayk=; b=rNH6/RSoCkF/mpoIVlXySOz7hb
	XPYcQji1sK9t+im5GIoPyvvNRAz7A22TX4TDhWVhCBhITMHiWtbmlMx9fKf12bASgYAxdnaJXdrTx
	lryOYmI8NqeEal+qEpgYDWCXbpHVa62X9uFBptRjNlfbzmW/vvzKyyixWkFARw0jttQ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAp-0003jC-Uu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcAp-0000Zd-TV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-13-tag' into staging
Message-Id: <E1kYcAp-0000Zd-TV@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:03 +0000

commit c920fdba39480989cb5f1af3cc63acccef021b54
Merge: 8bfa25a46ff1082f75e7052875b5d435119dcf49 0d3a8f32b1e0eca279da1b0cc793efc7250c3daf
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 14 21:21:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 14 21:21:58 2020 +0100

    Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-13-tag' into staging
    
    qemu-ga patch queue for hard-freeze
    
    * fix erroneously reporting stale hostname in guest-get-host-name
    * fix regression where guest-shutdown asserts when called
    * fix race condition with guest-fs-freeze/thaw on w32
    
    # gpg: Signature made Tue 14 Jul 2020 05:47:11 BST
    # gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
    # gpg:                issuer "mdroth@linux.vnet.ibm.com"
    # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
    # gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
    # gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
    # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584
    
    * remotes/mdroth/tags/qga-pull-2020-07-13-tag:
      qga: Use qemu_get_host_name() instead of g_get_host_name()
      util: Introduce qemu_get_host_name()
      qga: fix assert regression on guest-shutdown
      qga-win: Fix QGA VSS Provider service stop failure
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 include/qemu/osdep.h      | 10 ++++++++++
 qga/commands.c            | 17 +++++++++++++----
 qga/main.c                |  6 +++++-
 qga/vss-win32/install.cpp | 33 ++++++++++++++++++++-------------
 util/oslib-posix.c        | 35 +++++++++++++++++++++++++++++++++++
 util/oslib-win32.c        | 13 +++++++++++++
 6 files changed, 96 insertions(+), 18 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16355.40094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcB3-0002xY-AF; Fri, 30 Oct 2020 21:43:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16355.40094; Fri, 30 Oct 2020 21:43:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcB3-0002xQ-7B; Fri, 30 Oct 2020 21:43:17 +0000
Received: by outflank-mailman (input) for mailman id 16355;
 Fri, 30 Oct 2020 21:43:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcB1-0002x9-5M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 84afb98a-6cfc-4459-9388-59aa1b65dcfa;
 Fri, 30 Oct 2020 21:43:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcB0-0003jL-Dk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcB0-0000ba-Ct
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcB1-0002x9-5M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:15 +0000
X-Inumbo-ID: 84afb98a-6cfc-4459-9388-59aa1b65dcfa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 84afb98a-6cfc-4459-9388-59aa1b65dcfa;
	Fri, 30 Oct 2020 21:43:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hJbsUY8oy4JrcFZcYxcKzbFEcW18GULCM1d4JviYA3o=; b=CHPw3OafjpwnRvUAs+mY19Uvbo
	VSeSqjyv6LRbEqqwc+R6rfakXpc17smGGcIM05pr5Hxfz/z+UQwZof0fCCfN/CJewqSbAgYj+yig4
	aHyE0Vo3t0SqS7iXoYClfdp/1HaGZCpEdTTzLs5AiOgRC3uPAkxXY2aDMXNSoihJA6e0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcB0-0003jL-Dk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcB0-0000ba-Ct
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Cc qemu-block mailing list
Message-Id: <E1kYcB0-0000ba-Ct@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:14 +0000

commit ba412478d16ca6abb4f240d92e6528eac7d3c337
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Fri Jun 5 06:56:38 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    MAINTAINERS: Cc qemu-block mailing list
    
    We forgot to include the qemu-block mailing list while adding
    this section in commit 076a0fc32a7. Fix this.
    
    Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200630133912.9428-2-f4bug@amsat.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..d9c71d0bb3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1674,6 +1674,7 @@ F: hw/ssi/xilinx_*
 
 SD (Secure Card)
 M: Philippe Mathieu-Daudé <f4bug@amsat.org>
+L: qemu-block@nongnu.org
 S: Odd Fixes
 F: include/hw/sd/sd*
 F: hw/sd/core.c
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16356.40098 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBD-0002yh-Bn; Fri, 30 Oct 2020 21:43:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16356.40098; Fri, 30 Oct 2020 21:43:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBD-0002yZ-8m; Fri, 30 Oct 2020 21:43:27 +0000
Received: by outflank-mailman (input) for mailman id 16356;
 Fri, 30 Oct 2020 21:43:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcBB-0002yP-TW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 52212636-21da-4f54-b4e8-041915f66637;
 Fri, 30 Oct 2020 21:43:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBA-0003jT-HB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBA-0000c4-GR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcBB-0002yP-TW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:25 +0000
X-Inumbo-ID: 52212636-21da-4f54-b4e8-041915f66637
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 52212636-21da-4f54-b4e8-041915f66637;
	Fri, 30 Oct 2020 21:43:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Rj73J9hnAYhYmrq/9IJ+gbJW5j5hKn8DgdyHTDAk9vo=; b=He61rCwWcqzXvtIvl3VQkZElbZ
	8UV1Le4KJVZtMuPgSvNVUqcjWL2/V9AhHY1Fszh5TPEDNZmuSz4tX6WTWgL0nHnBEt65ShTAuKz1G
	LicB6P4cOLhDZFiLAyKPPr1R2O37SgB6xi8RaClo7m+b28pU8NJ34yCN7/jHDIT2Eb6M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBA-0003jT-HB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBA-0000c4-GR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/orangepi: Add instructions for resizing SD image to power of two
Message-Id: <E1kYcBA-0000c4-GR@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:24 +0000

commit 1c2329b5d644bad16e888d095e2021ad682201d9
Author:     Niek Linnenbank <nieklinnenbank@gmail.com>
AuthorDate: Sun Jul 12 20:37:08 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    docs/orangepi: Add instructions for resizing SD image to power of two
    
    SD cards need to have a size of a power of two.
    Update the Orange Pi machine documentation to include
    instructions for resizing downloaded images using the
    qemu-img command.
    
    Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200712183708.15450-1-nieklinnenbank@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 docs/system/arm/orangepi.rst | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/docs/system/arm/orangepi.rst b/docs/system/arm/orangepi.rst
index c41adad488..6f23907fb6 100644
--- a/docs/system/arm/orangepi.rst
+++ b/docs/system/arm/orangepi.rst
@@ -127,6 +127,16 @@ can be downloaded from:
 Alternatively, you can also choose to build you own image with buildroot
 using the orangepi_pc_defconfig. Also see https://buildroot.org for more information.
 
+When using an image as an SD card, it must be resized to a power of two. This can be
+done with the qemu-img command. It is recommended to only increase the image size
+instead of shrinking it to a power of two, to avoid loss of data. For example,
+to prepare a downloaded Armbian image, first extract it and then increase
+its size to one gigabyte as follows:
+
+.. code-block:: bash
+
+  $ qemu-img resize Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img 1G
+
 You can choose to attach the selected image either as an SD card or as USB mass storage.
 For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd
 argument and provide the proper root= kernel parameter:
@@ -213,12 +223,12 @@ Next, unzip the NetBSD image and write the U-Boot binary including SPL using:
   $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc
 
 Finally, before starting the machine the SD image must be extended such
-that the NetBSD kernel will not conclude the NetBSD partition is larger than
-the emulated SD card:
+that the size of the SD image is a power of two and that the NetBSD kernel
+will not conclude the NetBSD partition is larger than the emulated SD card:
 
 .. code-block:: bash
 
-  $ dd if=/dev/zero bs=1M count=64 >> armv7.img
+  $ qemu-img resize armv7.img 2G
 
 Start the machine using the following command:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16357.40102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBN-0002zz-DZ; Fri, 30 Oct 2020 21:43:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16357.40102; Fri, 30 Oct 2020 21:43:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBN-0002zr-AW; Fri, 30 Oct 2020 21:43:37 +0000
Received: by outflank-mailman (input) for mailman id 16357;
 Fri, 30 Oct 2020 21:43:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcBL-0002zh-Hj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c0ed99bc-e7e9-4321-bddd-de47192a7a2e;
 Fri, 30 Oct 2020 21:43:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBK-0003jb-Kj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBK-0000cq-Ju
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcBL-0002zh-Hj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:35 +0000
X-Inumbo-ID: c0ed99bc-e7e9-4321-bddd-de47192a7a2e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c0ed99bc-e7e9-4321-bddd-de47192a7a2e;
	Fri, 30 Oct 2020 21:43:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=06w1kCtjB5WQwKfdiXFIqidT2jMr620oak4DeUJ3fWE=; b=Qf9sylwuqYhs3Cgpv39W6RRdBd
	y4tOEkvmW+KjJNPy0ci8bsLywvcbLStVHO4xN1Olt1eYYZMc4nUJFHbRgRkVrJeSvEm8yTUBmLL/z
	X2ZVchPmJSsmhKsEVpUiIn+2xILWRqRG3Piotzd0/CT+F7CPM84StD+CnRLK4tmi8Hw8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBK-0003jb-Kj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBK-0000cq-Ju
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
Message-Id: <E1kYcBK-0000cq-Ju@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:34 +0000

commit b7dcbf1395da960ec3c313300dc0030674de8cd1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:45:33 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
    
    Avocado tags are handy to automatically select tests matching
    the tags. Since these tests use a SD card, tag them.
    
    We can run all the tests using a SD card at once with:
    
      $ avocado --show=app run -t u-boot tests/acceptance/
      $ AVOCADO_ALLOW_LARGE_STORAGE=ok \
        avocado --show=app \
          run -t device:sd tests/acceptance/
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic
      Fetching asset from tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
       (1/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd: PASS (19.56 s)
       (2/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic: PASS (49.97 s)
       (3/3) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9: PASS (20.06 s)
      RESULTS    : PASS 3 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
      JOB TIME   : 90.02 s
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-4-f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3d02519660..b7e8858c2d 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -620,6 +620,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
                    'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
@@ -669,6 +670,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
 
         # This test download a 196MB compressed image and expand it to 932MB...
@@ -710,6 +712,7 @@ class BootLinuxConsole(LinuxKernelTest):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
         """
         # This test download a 304MB compressed image and expand it to 1.3GB...
         deb_url = ('http://snapshot.debian.org/archive/debian/'
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16358.40106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBX-00031r-F9; Fri, 30 Oct 2020 21:43:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16358.40106; Fri, 30 Oct 2020 21:43:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBX-00031j-C2; Fri, 30 Oct 2020 21:43:47 +0000
Received: by outflank-mailman (input) for mailman id 16358;
 Fri, 30 Oct 2020 21:43:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcBV-00031T-UY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6e9137f0-93ba-4d97-b859-afcb7e9b193f;
 Fri, 30 Oct 2020 21:43:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBU-0003kM-ON
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBU-0000de-NT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcBV-00031T-UY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:45 +0000
X-Inumbo-ID: 6e9137f0-93ba-4d97-b859-afcb7e9b193f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6e9137f0-93ba-4d97-b859-afcb7e9b193f;
	Fri, 30 Oct 2020 21:43:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JXAWe71uV1bcLIq1v4flLtfIjS087WME4M4iSnpZX9o=; b=IE2bJGE+Wy9h+vBrhCF9Jw/Ybd
	wzKfeJW5fzdOmWQ0C6DOU/7T/IY1lg5EHYGVIGLRwIucStIYVRxoHnrfmGbM9NxacXSUGaqpQYCWP
	3PlPlKZ8PF18VER69Qa8TrjXJ9790PHepasWvuFSq1/XmIEjTt3LALCiYe7lnD6BOylM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBU-0003kM-ON
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBU-0000de-NT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/acceptance/boot_linux: Expand SD card image to power of 2
Message-Id: <E1kYcBU-0000de-NT@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:44 +0000

commit 6a289a5ba3383e17fb47029720425bef42e424d7
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 15:05:27 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:38:22 2020 +0200

    tests/acceptance/boot_linux: Expand SD card image to power of 2
    
    In few commits we won't allow SD card images with invalid size
    (not aligned to a power of 2). Prepare the tests: add the
    pow2ceil() and image_pow2ceil_expand() methods and resize the
    images (expanding) of the tests using SD cards.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200713183209.26308-5-f4bug@amsat.org>
---
 tests/acceptance/boot_linux_console.py | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index b7e8858c2d..67c3b2f3d1 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,6 +28,22 @@ try:
 except CmdNotFoundError:
     P7ZIP_AVAILABLE = False
 
+"""
+Round up to next power of 2
+"""
+def pow2ceil(x):
+    return 1 if x == 0 else 2**(x - 1).bit_length()
+
+"""
+Expand file size to next power of 2
+"""
+def image_pow2ceil_expand(path):
+        size = os.path.getsize(path)
+        size_aligned = pow2ceil(size)
+        if size != size_aligned:
+            with open(path, 'ab+') as fd:
+                fd.truncate(size_aligned)
+
 class LinuxKernelTest(Test):
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
@@ -636,6 +652,7 @@ class BootLinuxConsole(LinuxKernelTest):
         rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
         rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
         archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
+        image_pow2ceil_expand(rootfs_path)
 
         self.vm.set_console()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
@@ -673,7 +690,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=device:sd
         """
 
-        # This test download a 196MB compressed image and expand it to 932MB...
+        # This test download a 196MB compressed image and expand it to 1GB
         image_url = ('https://dl.armbian.com/orangepipc/archive/'
                      'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
         image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
@@ -681,6 +698,7 @@ class BootLinuxConsole(LinuxKernelTest):
         image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
         image_path = os.path.join(self.workdir, image_name)
         process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
+        image_pow2ceil_expand(image_path)
 
         self.vm.set_console()
         self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
@@ -714,7 +732,7 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=machine:orangepi-pc
         :avocado: tags=device:sd
         """
-        # This test download a 304MB compressed image and expand it to 1.3GB...
+        # This test download a 304MB compressed image and expand it to 2GB
         deb_url = ('http://snapshot.debian.org/archive/debian/'
                    '20200108T145233Z/pool/main/u/u-boot/'
                    'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
@@ -731,8 +749,9 @@ class BootLinuxConsole(LinuxKernelTest):
         image_hash = '2babb29d36d8360adcb39c09e31060945259917a'
         image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
         image_path = os.path.join(self.workdir, 'armv7.img')
-        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
         archive.gzip_uncompress(image_path_gz, image_path)
+        image_pow2ceil_expand(image_path)
+        image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
 
         # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
         with open(uboot_path, 'rb') as f_in:
@@ -740,12 +759,6 @@ class BootLinuxConsole(LinuxKernelTest):
                 f_out.seek(8 * 1024)
                 shutil.copyfileobj(f_in, f_out)
 
-                # Extend image, to avoid that NetBSD thinks the partition
-                # inside the image is larger than device size itself
-                f_out.seek(0, 2)
-                f_out.seek(64 * 1024 * 1024, 1)
-                f_out.write(bytearray([0x00]))
-
         self.vm.set_console()
         self.vm.add_args('-nic', 'user',
                          '-drive', image_drive_args,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:43:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:43:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16359.40110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBh-000335-GQ; Fri, 30 Oct 2020 21:43:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16359.40110; Fri, 30 Oct 2020 21:43:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBh-00032w-DW; Fri, 30 Oct 2020 21:43:57 +0000
Received: by outflank-mailman (input) for mailman id 16359;
 Fri, 30 Oct 2020 21:43:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcBf-00032m-KX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 61cea08e-ab6c-4d63-829b-eec1f6b9f6ff;
 Fri, 30 Oct 2020 21:43:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBe-0003kY-SQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBe-0000eO-RE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcBf-00032m-KX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:55 +0000
X-Inumbo-ID: 61cea08e-ab6c-4d63-829b-eec1f6b9f6ff
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 61cea08e-ab6c-4d63-829b-eec1f6b9f6ff;
	Fri, 30 Oct 2020 21:43:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kGpORpa+2P28ui3LEsR7U/4qzSr2OAOw+0R0D6nVmNM=; b=x5uHwH2vSEoEd3h9X0o3X505vW
	Itsz2Ay8wqf0mgL9mPwLz9EnC7HC9eF26Px0OboGCvOR0anEjXurDYKgQEkykXbSZ6q5KOnVzEJsA
	QasLqFVmQDmQO6RzQmNOFA6+fzQpfceEU7tvetEFRMl7MfXlCO8g6wqxULrJlX2zE5Fc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBe-0003kY-SQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBe-0000eO-RE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:43:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
Message-Id: <E1kYcBe-0000eO-RE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:43:54 +0000

commit 9157dd597d293ab7f599f4d96c3fe8a6e07c633d
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Wed Jun 3 19:59:16 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:45:58 2020 +0200

    hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
    
    Only SCSD cards support Class 6 (Block Oriented Write Protection)
    commands.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.14 Command Functional Difference in Card Capacity Types
    
      * Write Protected Group
    
      SDHC and SDXC do not support write-protected groups. Issuing
      CMD28, CMD29 and CMD30 generates the ILLEGAL_COMMAND error.
    
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-7-f4bug@amsat.org>
---
 hw/sd/sd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 5137168d66..1cc16bfd31 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -920,6 +920,11 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
         sd->multi_blk_cnt = 0;
     }
 
+    if (sd_cmd_class[req.cmd] == 6 && FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) {
+        /* Only Standard Capacity cards support class 6 commands */
+        return sd_illegal;
+    }
+
     switch (req.cmd) {
     /* Basic commands (Class 0 and Class 1) */
     case 0:	/* CMD0:   GO_IDLE_STATE */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16360.40114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBr-00035z-I4; Fri, 30 Oct 2020 21:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16360.40114; Fri, 30 Oct 2020 21:44:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcBr-00035r-Ey; Fri, 30 Oct 2020 21:44:07 +0000
Received: by outflank-mailman (input) for mailman id 16360;
 Fri, 30 Oct 2020 21:44:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcBq-00035e-0T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0ec292ec-0770-415e-8ba9-e7e13fb0c099;
 Fri, 30 Oct 2020 21:44:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBo-0003ky-WC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBo-0000fp-VJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcBq-00035e-0T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:06 +0000
X-Inumbo-ID: 0ec292ec-0770-415e-8ba9-e7e13fb0c099
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0ec292ec-0770-415e-8ba9-e7e13fb0c099;
	Fri, 30 Oct 2020 21:44:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EkPNiftBiddoYovpvYf9zDmPHsQCV/7/TjXdJIVxit0=; b=mm6HdEiAszHMgrxrv7rVAGEKRb
	Gbmjrgd0Vjaj464DA9C29uRn/Cze7X7+5ooBCM0xsB7wKKCcuNB6ARUWSCxvI15vZuNjIHUBUm9bS
	9GCIoUyASZJzwVMg4C6BUvVAupfQrVDWeCX1i82wdtPUxsBPVZgSbm7Egt/1UkjTIxVA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBo-0003ky-WC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBo-0000fp-VJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/sd/sdcard: Simplify realize() a bit
Message-Id: <E1kYcBo-0000fp-VJ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:04 +0000

commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jun 5 22:28:51 2018 -0300
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:07 2020 +0200

    hw/sd/sdcard: Simplify realize() a bit
    
    We don't need to check if sd->blk is set twice.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-18-f4bug@amsat.org>
---
 hw/sd/sd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 1cc16bfd31..edd60a09c0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2105,12 +2105,12 @@ static void sd_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    if (sd->blk && blk_is_read_only(sd->blk)) {
-        error_setg(errp, "Cannot use read-only drive as SD card");
-        return;
-    }
-
     if (sd->blk) {
+        if (blk_is_read_only(sd->blk)) {
+            error_setg(errp, "Cannot use read-only drive as SD card");
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16361.40119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcC1-00037N-L7; Fri, 30 Oct 2020 21:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16361.40119; Fri, 30 Oct 2020 21:44:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcC1-00037F-Hi; Fri, 30 Oct 2020 21:44:17 +0000
Received: by outflank-mailman (input) for mailman id 16361;
 Fri, 30 Oct 2020 21:44:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcC0-000375-56
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2b3cce29-afda-4d02-b067-ce2bee92adc1;
 Fri, 30 Oct 2020 21:44:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBz-0003l9-4P
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcBz-0000h3-2j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcC0-000375-56
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:16 +0000
X-Inumbo-ID: 2b3cce29-afda-4d02-b067-ce2bee92adc1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2b3cce29-afda-4d02-b067-ce2bee92adc1;
	Fri, 30 Oct 2020 21:44:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZLclCPBhzvaAWFCWLdQmk4/+qnrWvCgYMGrrDzQwtWw=; b=wN4HbcbDFKnvSEa5K5Jp3SyyW4
	QH9amPrsgeGY0uOTFJwgDyhQkP5/sJF3z7tiLfmy7PXQ0xBGFAQbjkHylxMVf93T8o4M+Bpy9RSSV
	reG2N3qgpiZuLY7dAcoClAjKGjsIza/B0sh7QqNGN+w6fr+gMyAZdIHg+q4lFlOsk2f4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBz-0003l9-4P
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcBz-0000h3-2j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/sd/sdcard: Do not allow invalid SD card sizes
Message-Id: <E1kYcBz-0000h3-2j@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:15 +0000

commit a9bcedd15a5834ca9ae6c3a97933e85ac7edbd36
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 7 13:02:34 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:07 2020 +0200

    hw/sd/sdcard: Do not allow invalid SD card sizes
    
    QEMU allows to create SD card with unrealistic sizes. This could
    work, but some guests (at least Linux) consider sizes that are not
    a power of 2 as a firmware bug and fix the card size to the next
    power of 2.
    
    While the possibility to use small SD card images has been seen as
    a feature, it became a bug with CVE-2020-13253, where the guest is
    able to do OOB read/write accesses past the image size end.
    
    In a pair of commits we will fix CVE-2020-13253 as:
    
        Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
        occurred and no data transfer is performed.
    
        WP_VIOLATION errors are not modified: the error bit is set, we
        stay in receive-data state, wait for a stop command. All further
        data transfer is ignored. See the check on sd->card_status at the
        beginning of sd_read_data() and sd_write_data().
    
    While this is the correct behavior, in case QEMU create smaller SD
    cards, guests still try to access past the image size end, and QEMU
    considers this is an invalid address, thus "all further data transfer
    is ignored". This is wrong and make the guest looping until
    eventually timeouts.
    
    Fix by not allowing invalid SD card sizes (suggesting the expected
    size as a hint):
    
      $ qemu-system-arm -M orangepi-pc -drive file=rootfs.ext2,if=sd,format=raw
      qemu-system-arm: Invalid SD card size: 60 MiB
      SD card size has to be a power of 2, e.g. 64 MiB.
      You can resize disk images with 'qemu-img resize <imagefile> <new-size>'
      (note that this will lose data if you make the image smaller than it currently is).
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200713183209.26308-8-f4bug@amsat.org>
---
 hw/sd/sd.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index edd60a09c0..76d68359a4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -32,6 +32,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "qemu/cutils.h"
 #include "hw/irq.h"
 #include "hw/registerfields.h"
 #include "sysemu/block-backend.h"
@@ -2106,11 +2107,35 @@ static void sd_realize(DeviceState *dev, Error **errp)
     }
 
     if (sd->blk) {
+        int64_t blk_size;
+
         if (blk_is_read_only(sd->blk)) {
             error_setg(errp, "Cannot use read-only drive as SD card");
             return;
         }
 
+        blk_size = blk_getlength(sd->blk);
+        if (blk_size > 0 && !is_power_of_2(blk_size)) {
+            int64_t blk_size_aligned = pow2ceil(blk_size);
+            char *blk_size_str;
+
+            blk_size_str = size_to_str(blk_size);
+            error_setg(errp, "Invalid SD card size: %s", blk_size_str);
+            g_free(blk_size_str);
+
+            blk_size_str = size_to_str(blk_size_aligned);
+            error_append_hint(errp,
+                              "SD card size has to be a power of 2, e.g. %s.\n"
+                              "You can resize disk images with"
+                              " 'qemu-img resize <imagefile> <new-size>'\n"
+                              "(note that this will lose data if you make the"
+                              " image smaller than it currently is).\n",
+                              blk_size_str);
+            g_free(blk_size_str);
+
+            return;
+        }
+
         ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE,
                            BLK_PERM_ALL, errp);
         if (ret < 0) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16362.40122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCB-00038k-MO; Fri, 30 Oct 2020 21:44:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16362.40122; Fri, 30 Oct 2020 21:44:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCB-00038d-JO; Fri, 30 Oct 2020 21:44:27 +0000
Received: by outflank-mailman (input) for mailman id 16362;
 Fri, 30 Oct 2020 21:44:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCA-00038R-3e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 246d9330-8e1d-4b3b-9581-7696490f7918;
 Fri, 30 Oct 2020 21:44:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcC9-0003lK-7x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcC9-0000i4-7D
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCA-00038R-3e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:26 +0000
X-Inumbo-ID: 246d9330-8e1d-4b3b-9581-7696490f7918
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 246d9330-8e1d-4b3b-9581-7696490f7918;
	Fri, 30 Oct 2020 21:44:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iF/ObNQlCYgSgy5Yg9saTVWx7wv42EIL4mZAstazxT4=; b=W4Be9hIOMB22jBJ7d8nkJBeivs
	KVs4XRIxWNCg4vlP6Y/7kuGk7W5wH5IK8yeXO6IOwYSAwVLxglvV8q0M6yXZDUSD6JkN/gZ4L1dKN
	hVVqvz+PfG5Lu9EL69Z3+WTFquXWRnEd0EQaSeHb0wU5Sc2Axnn4YifJOU/URpiMzMIk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcC9-0003lK-7x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcC9-0000i4-7D
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/sd/sdcard: Update coding style to make checkpatch.pl happy
Message-Id: <E1kYcC9-0000i4-7D@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:25 +0000

commit 794d68de2f021a6d3874df41d6bbe8590ec05207
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 13 09:27:35 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:14 2020 +0200

    hw/sd/sdcard: Update coding style to make checkpatch.pl happy
    
    To make the next commit easier to review, clean this code first.
    
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200630133912.9428-3-f4bug@amsat.org>
---
 hw/sd/sd.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 76d68359a4..f4f76f8fd2 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1175,8 +1175,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1191,8 +1192,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_start = addr;
             sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+            }
             return sd_r1;
 
         default:
@@ -1237,12 +1239,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
@@ -1261,12 +1266,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size)
+            if (sd->data_start + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
-            if (sd_wp_addr(sd, sd->data_start))
+            }
+            if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
-            if (sd->csd[14] & 0x30)
+            }
+            if (sd->csd[14] & 0x30) {
                 sd->card_status |= WP_VIOLATION;
+            }
             return sd_r1;
 
         default:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16363.40126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCK-00039u-OE; Fri, 30 Oct 2020 21:44:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16363.40126; Fri, 30 Oct 2020 21:44:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCK-00039n-L2; Fri, 30 Oct 2020 21:44:36 +0000
Received: by outflank-mailman (input) for mailman id 16363;
 Fri, 30 Oct 2020 21:44:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCK-00039i-85
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aeee7558-8d42-41f4-aac3-10774d2620c6;
 Fri, 30 Oct 2020 21:44:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCJ-0003lT-BX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCJ-0000jF-Ah
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCK-00039i-85
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:36 +0000
X-Inumbo-ID: aeee7558-8d42-41f4-aac3-10774d2620c6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aeee7558-8d42-41f4-aac3-10774d2620c6;
	Fri, 30 Oct 2020 21:44:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9Bb+Of7RWLsK23cugTpBwVJve/6ZyYmf4NSar4DV43s=; b=PpTamNi69xn/XgQPyzZ2OBeEyJ
	QtU7XE5Tl5jcEzpAxkIbBOk+tErXtZE78TxIasYycv4FaolHzGdWl39RnG9j5/KqSFKk2UAL0tVl3
	SBh240C5d1MxDW8ziNhnDUL/qdcf3oWqB3k3UCotP6SoZLoBxAciY4GX+ZQJfMPqUUiw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCJ-0003lT-BX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCJ-0000jF-Ah
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
Message-Id: <E1kYcCJ-0000jF-Ah@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:35 +0000

commit 790762e5487114341cccc5bffcec4cb3c022c3cd
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Thu Jun 4 19:22:29 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 15:46:14 2020 +0200

    hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
    
    Only move the state machine to ReceivingData if there is no
    pending error. This avoids later OOB access while processing
    commands queued.
    
      "SD Specifications Part 1 Physical Layer Simplified Spec. v3.01"
    
      4.3.3 Data Read
    
      Read command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
      4.3.4 Data Write
    
      Write command is rejected if BLOCK_LEN_ERROR or ADDRESS_ERROR
      occurred and no data transfer is performed.
    
    WP_VIOLATION errors are not modified: the error bit is set, we
    stay in receive-data state, wait for a stop command. All further
    data transfer is ignored. See the check on sd->card_status at the
    beginning of sd_read_data() and sd_write_data().
    
    Fixes: CVE-2020-13253
    Cc: qemu-stable@nongnu.org
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880822
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200630133912.9428-6-f4bug@amsat.org>
---
 hw/sd/sd.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index f4f76f8fd2..fad9cf1ee7 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1171,13 +1171,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 17:	/* CMD17:  READ_SINGLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1188,13 +1190,15 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
     case 18:	/* CMD18:  READ_MULTIPLE_BLOCK */
         switch (sd->state) {
         case sd_transfer_state:
-            sd->state = sd_sendingdata_state;
-            sd->data_start = addr;
-            sd->data_offset = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
+            if (addr + sd->blk_len > sd->size) {
                 sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
             }
+
+            sd->state = sd_sendingdata_state;
+            sd->data_start = addr;
+            sd->data_offset = 0;
             return sd_r1;
 
         default:
@@ -1234,14 +1238,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
@@ -1261,14 +1268,17 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
             /* Writing in SPI mode not implemented.  */
             if (sd->spi)
                 break;
+
+            if (addr + sd->blk_len > sd->size) {
+                sd->card_status |= ADDRESS_ERROR;
+                return sd_r1;
+            }
+
             sd->state = sd_receivingdata_state;
             sd->data_start = addr;
             sd->data_offset = 0;
             sd->blk_written = 0;
 
-            if (sd->data_start + sd->blk_len > sd->size) {
-                sd->card_status |= ADDRESS_ERROR;
-            }
             if (sd_wp_addr(sd, sd->data_start)) {
                 sd->card_status |= WP_VIOLATION;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16364.40130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCV-0003Bv-Q1; Fri, 30 Oct 2020 21:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16364.40130; Fri, 30 Oct 2020 21:44:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCV-0003Bo-Mp; Fri, 30 Oct 2020 21:44:47 +0000
Received: by outflank-mailman (input) for mailman id 16364;
 Fri, 30 Oct 2020 21:44:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCU-0003Bg-H6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ddd2928c-7dac-46c4-8dd8-96ee58ce870c;
 Fri, 30 Oct 2020 21:44:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCT-0003m2-FE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCT-0000kX-EU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCU-0003Bg-H6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:46 +0000
X-Inumbo-ID: ddd2928c-7dac-46c4-8dd8-96ee58ce870c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ddd2928c-7dac-46c4-8dd8-96ee58ce870c;
	Fri, 30 Oct 2020 21:44:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9HzzOX4jtAIalmEG39vq+gE1CGpFnUJlBjZFZRzVbx0=; b=Sdi867xzT6Zmg7QmCM13h0ghvM
	G4/CRmzCvm3EJJV/Zjhf6le687PH/n0IyuKpJ4fgiXdHgkPFk7doxqCcnDZ166PGLT95xCTG+ua5s
	WGYQwdMQxtrPn/rU4MKk+GeU9UzQDl0y+P6TtlKv3KUC2H8KwsAkkOmpig68v8RBgYNI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCT-0003m2-FE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCT-0000kX-EU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request' into staging
Message-Id: <E1kYcCT-0000kX-EU@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:45 +0000

commit 3a9163af4e3dd61795a35d47b702e302f98f81d6
Merge: c920fdba39480989cb5f1af3cc63acccef021b54 790762e5487114341cccc5bffcec4cb3c022c3cd
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 09:06:55 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 09:06:55 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request' into staging
    
    Fix CVE-2020-13253
    
    By using invalidated address, guest can do out-of-bounds accesses.
    These patches fix the issue by only allowing SD card image sizes
    power of 2, and not switching to SEND_DATA state when the address
    is invalid (out of range).
    
    This issue was found using QEMU fuzzing mode (using --enable-fuzzing,
    see docs/devel/fuzzing.txt) and reported by Alexander Bulekov.
    
    Reproducer:
      https://bugs.launchpad.net/qemu/+bug/1880822/comments/1
    
    CI jobs results:
    . https://cirrus-ci.com/build/5157142548185088
    . https://gitlab.com/philmd/qemu/-/pipelines/166381731
    . https://travis-ci.org/github/philmd/qemu/builds/707956535
    
    # gpg: Signature made Tue 14 Jul 2020 14:54:44 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/sdcard-CVE-2020-13253-pull-request:
      hw/sd/sdcard: Do not switch to ReceivingData if address is invalid
      hw/sd/sdcard: Update coding style to make checkpatch.pl happy
      hw/sd/sdcard: Do not allow invalid SD card sizes
      hw/sd/sdcard: Simplify realize() a bit
      hw/sd/sdcard: Restrict Class 6 commands to SCSD cards
      tests/acceptance/boot_linux: Expand SD card image to power of 2
      tests/acceptance/boot_linux: Tag tests using a SD card with 'device:sd'
      docs/orangepi: Add instructions for resizing SD image to power of two
      MAINTAINERS: Cc qemu-block mailing list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                            |  1 +
 docs/system/arm/orangepi.rst           | 16 +++++--
 hw/sd/sd.c                             | 86 ++++++++++++++++++++++++++--------
 tests/acceptance/boot_linux_console.py | 34 ++++++++++----
 4 files changed, 106 insertions(+), 31 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:44:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:44:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16365.40134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCf-0003D9-RT; Fri, 30 Oct 2020 21:44:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16365.40134; Fri, 30 Oct 2020 21:44:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCf-0003D1-OV; Fri, 30 Oct 2020 21:44:57 +0000
Received: by outflank-mailman (input) for mailman id 16365;
 Fri, 30 Oct 2020 21:44:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCf-0003Cs-98
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d8923806-2c44-4a22-b616-f53dc2ffa94c;
 Fri, 30 Oct 2020 21:44:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCe-0003mA-2c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCe-0000nf-1M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCf-0003Cs-98
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:57 +0000
X-Inumbo-ID: d8923806-2c44-4a22-b616-f53dc2ffa94c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d8923806-2c44-4a22-b616-f53dc2ffa94c;
	Fri, 30 Oct 2020 21:44:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fpn1ziTUpHPzX0Xh2AEL0U71PX9U1j4TNMNays9QOG8=; b=gd6K4fGGT8kQmwnETCSTgjXsIl
	q/oAPgEatfhXyzGsTlYyy4L+9yvRN164j0Lq6Cx939q91Sx7cP9DBj7u+pN4cTOLHTwfo/IKBP4ba
	0qlyufC0sRhehzxZM1KksdXvmjvj2bAImtpG+1JjwRMjp1uAdtpNb9oiUgASC/Mv8G/4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCe-0003mA-2c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCe-0000nf-1M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:44:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] scripts/performance: Add dissect.py script
Message-Id: <E1kYcCe-0000nf-1M@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:44:56 +0000

commit 01afa757b6f1b8c7858cc29b8332e9fb6aa1e16f
Author:     Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
AuthorDate: Thu Jul 9 07:20:55 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    scripts/performance: Add dissect.py script
    
    Python script that dissects QEMU execution into three main phases:
    code generation, JIT execution and helpers execution.
    
    Syntax:
    dissect.py [-h] -- <qemu executable> [<qemu executable options>] \
                     <target executable> [<target executable options>]
    
    [-h] - Print the script arguments help message.
    
    Example of usage:
    dissect.py -- qemu-arm coulomb_double-arm
    
    Example output:
    Total Instructions:        4,702,865,362
    
    Code Generation:             115,819,309         2.463%
    JIT Execution:             1,081,980,528        23.007%
    Helpers:                   3,505,065,525        74.530%
    
    Signed-off-by: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
    Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200709052055.2650-2-ahmedkhaledkaraman@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 scripts/performance/dissect.py | 166 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 166 insertions(+)

diff --git a/scripts/performance/dissect.py b/scripts/performance/dissect.py
new file mode 100755
index 0000000000..bf24f50922
--- /dev/null
+++ b/scripts/performance/dissect.py
@@ -0,0 +1,166 @@
+#!/usr/bin/env python3
+
+#  Print the percentage of instructions spent in each phase of QEMU
+#  execution.
+#
+#  Syntax:
+#  dissect.py [-h] -- <qemu executable> [<qemu executable options>] \
+#                   <target executable> [<target executable options>]
+#
+#  [-h] - Print the script arguments help message.
+#
+#  Example of usage:
+#  dissect.py -- qemu-arm coulomb_double-arm
+#
+#  This file is a part of the project "TCG Continuous Benchmarking".
+#
+#  Copyright (C) 2020  Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
+#  Copyright (C) 2020  Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
+#
+#  This program is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+import argparse
+import os
+import subprocess
+import sys
+import tempfile
+
+
+def get_JIT_line(callgrind_data):
+    """
+    Search for the first instance of the JIT call in
+    the callgrind_annotate output when ran using --tree=caller
+    This is equivalent to the self number of instructions of JIT.
+
+    Parameters:
+    callgrind_data (list): callgrind_annotate output
+
+    Returns:
+    (int): Line number
+    """
+    line = -1
+    for i in range(len(callgrind_data)):
+        if callgrind_data[i].strip('\n') and \
+                callgrind_data[i].split()[-1] == "[???]":
+            line = i
+            break
+    if line == -1:
+        sys.exit("Couldn't locate the JIT call ... Exiting.")
+    return line
+
+
+def main():
+    # Parse the command line arguments
+    parser = argparse.ArgumentParser(
+        usage='dissect.py [-h] -- '
+        '<qemu executable> [<qemu executable options>] '
+        '<target executable> [<target executable options>]')
+
+    parser.add_argument('command', type=str, nargs='+', help=argparse.SUPPRESS)
+
+    args = parser.parse_args()
+
+    # Extract the needed variables from the args
+    command = args.command
+
+    # Insure that valgrind is installed
+    check_valgrind = subprocess.run(
+        ["which", "valgrind"], stdout=subprocess.DEVNULL)
+    if check_valgrind.returncode:
+        sys.exit("Please install valgrind before running the script.")
+
+    # Save all intermediate files in a temporary directory
+    with tempfile.TemporaryDirectory() as tmpdirname:
+        # callgrind output file path
+        data_path = os.path.join(tmpdirname, "callgrind.data")
+        # callgrind_annotate output file path
+        annotate_out_path = os.path.join(tmpdirname, "callgrind_annotate.out")
+
+        # Run callgrind
+        callgrind = subprocess.run((["valgrind",
+                                     "--tool=callgrind",
+                                     "--callgrind-out-file=" + data_path]
+                                    + command),
+                                   stdout=subprocess.DEVNULL,
+                                   stderr=subprocess.PIPE)
+        if callgrind.returncode:
+            sys.exit(callgrind.stderr.decode("utf-8"))
+
+        # Save callgrind_annotate output
+        with open(annotate_out_path, "w") as output:
+            callgrind_annotate = subprocess.run(
+                ["callgrind_annotate", data_path, "--tree=caller"],
+                stdout=output,
+                stderr=subprocess.PIPE)
+            if callgrind_annotate.returncode:
+                sys.exit(callgrind_annotate.stderr.decode("utf-8"))
+
+        # Read the callgrind_annotate output to callgrind_data[]
+        callgrind_data = []
+        with open(annotate_out_path, 'r') as data:
+            callgrind_data = data.readlines()
+
+        # Line number with the total number of instructions
+        total_instructions_line_number = 20
+        # Get the total number of instructions
+        total_instructions_line_data = \
+            callgrind_data[total_instructions_line_number]
+        total_instructions = total_instructions_line_data.split()[0]
+        total_instructions = int(total_instructions.replace(',', ''))
+
+        # Line number with the JIT self number of instructions
+        JIT_self_instructions_line_number = get_JIT_line(callgrind_data)
+        # Get the JIT self number of instructions
+        JIT_self_instructions_line_data = \
+            callgrind_data[JIT_self_instructions_line_number]
+        JIT_self_instructions = JIT_self_instructions_line_data.split()[0]
+        JIT_self_instructions = int(JIT_self_instructions.replace(',', ''))
+
+        # Line number with the JIT self + inclusive number of instructions
+        # It's the line above the first JIT call when running with --tree=caller
+        JIT_total_instructions_line_number = JIT_self_instructions_line_number-1
+        # Get the JIT self + inclusive number of instructions
+        JIT_total_instructions_line_data = \
+            callgrind_data[JIT_total_instructions_line_number]
+        JIT_total_instructions = JIT_total_instructions_line_data.split()[0]
+        JIT_total_instructions = int(JIT_total_instructions.replace(',', ''))
+
+        # Calculate number of instructions in helpers and code generation
+        helpers_instructions = JIT_total_instructions-JIT_self_instructions
+        code_generation_instructions = total_instructions-JIT_total_instructions
+
+        # Print results (Insert commas in large numbers)
+        # Print total number of instructions
+        print('{:<20}{:>20}\n'.
+              format("Total Instructions:",
+                     format(total_instructions, ',')))
+        # Print code generation instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("Code Generation:",
+                     format(code_generation_instructions, ","),
+                     (code_generation_instructions / total_instructions) * 100))
+        # Print JIT instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("JIT Execution:",
+                     format(JIT_self_instructions, ","),
+                     (JIT_self_instructions / total_instructions) * 100))
+        # Print helpers instructions and percentage
+        print('{:<20}{:>20}\t{:>6.3f}%'.
+              format("Helpers:",
+                     format(helpers_instructions, ","),
+                     (helpers_instructions/total_instructions)*100))
+
+
+if __name__ == "__main__":
+    main()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16366.40139 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCp-0003Eh-Ur; Fri, 30 Oct 2020 21:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16366.40139; Fri, 30 Oct 2020 21:45:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCp-0003EY-RP; Fri, 30 Oct 2020 21:45:07 +0000
Received: by outflank-mailman (input) for mailman id 16366;
 Fri, 30 Oct 2020 21:45:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCp-0003EP-6d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5a15371c-712d-4940-8e82-cf27bd0304cc;
 Fri, 30 Oct 2020 21:45:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCo-0003mi-7S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCo-0000oq-5a
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCp-0003EP-6d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:07 +0000
X-Inumbo-ID: 5a15371c-712d-4940-8e82-cf27bd0304cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5a15371c-712d-4940-8e82-cf27bd0304cc;
	Fri, 30 Oct 2020 21:45:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MmNMG2tL7hzIkq6SJvn9TpiNWOCzbfff/0zNr5OHxOY=; b=mE7aJKAXI+LU+QtzejdHRa9L3x
	huSwsyDV4rKFPbFaMWPyJRUS4fL+L2F3sqqvEyGCgCCwWBrxoMfjsTc+JW0cWzUjBwc6H7owJLNFQ
	gUu6wc0/t/P/cZOpgHtMAF4LnJ5J5oTBeyYW747qZ+0ESTeKWZyV7QYO8ob/LMUfC7Lk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCo-0003mi-7S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCo-0000oq-5a
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: consolidate _post_shutdown()
Message-Id: <E1kYcCo-0000oq-5a@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:06 +0000

commit 14661d93d787846833b0e62d5995195c8851f741
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:38 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: consolidate _post_shutdown()
    
    Move more cleanup actions into _post_shutdown. As a change, if QEMU
    should so happen to be terminated during a call to wait(), that event
    will now be logged.
    
    This is not likely to occur during normative use.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200710050649.32434-2-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index c25f0b42cf..ca1f2114e6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,8 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        self._load_io_log()
+
         if self._qemu_log_file is not None:
             self._qemu_log_file.close()
             self._qemu_log_file = None
@@ -307,6 +309,17 @@ class QEMUMachine:
         while len(self._remove_files) > 0:
             self._remove_if_exists(self._remove_files.pop())
 
+        exitcode = self.exitcode()
+        if exitcode is not None and exitcode < 0:
+            msg = 'qemu received signal %i; command: "%s"'
+            if self._qemu_full_args:
+                command = ' '.join(self._qemu_full_args)
+            else:
+                command = ''
+            LOG.warning(msg, -int(exitcode), command)
+
+        self._launched = False
+
     def launch(self):
         """
         Launch the VM and make sure we cleanup and expose the
@@ -355,7 +368,6 @@ class QEMUMachine:
         self._popen.wait()
         if self._qmp:
             self._qmp.close()
-        self._load_io_log()
         self._post_shutdown()
 
     def shutdown(self, has_quit=False, hard=False):
@@ -382,21 +394,8 @@ class QEMUMachine:
                     self._popen.kill()
             self._popen.wait()
 
-        self._load_io_log()
         self._post_shutdown()
 
-        exitcode = self.exitcode()
-        if exitcode is not None and exitcode < 0 and \
-                not (exitcode == -9 and hard):
-            msg = 'qemu received signal %i: %s'
-            if self._qemu_full_args:
-                command = ' '.join(self._qemu_full_args)
-            else:
-                command = ''
-            LOG.warning(msg, -int(exitcode), command)
-
-        self._launched = False
-
     def kill(self):
         self.shutdown(hard=True)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16367.40141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCz-0003G1-Vq; Fri, 30 Oct 2020 21:45:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16367.40141; Fri, 30 Oct 2020 21:45:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcCz-0003Ft-Sz; Fri, 30 Oct 2020 21:45:17 +0000
Received: by outflank-mailman (input) for mailman id 16367;
 Fri, 30 Oct 2020 21:45:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcCz-0003Fk-3n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1a6234ae-9942-42a9-93cc-e3ccf70655fd;
 Fri, 30 Oct 2020 21:45:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCy-0003mp-B1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcCy-0000pu-AB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcCz-0003Fk-3n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:17 +0000
X-Inumbo-ID: 1a6234ae-9942-42a9-93cc-e3ccf70655fd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1a6234ae-9942-42a9-93cc-e3ccf70655fd;
	Fri, 30 Oct 2020 21:45:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=teDTA6LaDBjFOZzDsQyPqyAVlXQIAIzBUC6omLpvoIE=; b=igAHkZJ4O7Pt7zVzQcdA+z29Br
	YVLQG19oim24ixggJEw8tDD7irmww5mOImvb8Fgr3By/6P81nNRXDlPKDDSCApsxC9i4SbJw+YOWE
	R6fOZg5KJ+U+OCuczoQJgpn+J+AmiYn0gQcc7r9YaLt3TIK4/qdykWrEVKFJ/YZNzCEQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCy-0003mp-B1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcCy-0000pu-AB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Close QMP socket in cleanup
Message-Id: <E1kYcCy-0000pu-AB@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:16 +0000

commit 671940e633b83ac489e0b4bb407749723ff8a879
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:39 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Close QMP socket in cleanup
    
    It's not important to do this before waiting for the process to exit, so
    it can be done during generic post-shutdown cleanup.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-3-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index ca1f2114e6..d3faa9a84c 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,10 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        if self._qmp:
+            self._qmp.close()
+            self._qmp = None
+
         self._load_io_log()
 
         if self._qemu_log_file is not None:
@@ -366,8 +370,6 @@ class QEMUMachine:
         Wait for the VM to power off
         """
         self._popen.wait()
-        if self._qmp:
-            self._qmp.close()
         self._post_shutdown()
 
     def shutdown(self, has_quit=False, hard=False):
@@ -388,7 +390,6 @@ class QEMUMachine:
                 try:
                     if not has_quit:
                         self._qmp.cmd('quit')
-                    self._qmp.close()
                     self._popen.wait(timeout=3)
                 except:
                     self._popen.kill()
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16368.40147 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDA-0003HM-2B; Fri, 30 Oct 2020 21:45:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16368.40147; Fri, 30 Oct 2020 21:45:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcD9-0003HE-V7; Fri, 30 Oct 2020 21:45:27 +0000
Received: by outflank-mailman (input) for mailman id 16368;
 Fri, 30 Oct 2020 21:45:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcD9-0003H6-88
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5a1c1679-3dd7-4f1b-b0f6-42864a04ae74;
 Fri, 30 Oct 2020 21:45:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcD8-0003n6-ET
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcD8-0000qt-De
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcD9-0003H6-88
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:27 +0000
X-Inumbo-ID: 5a1c1679-3dd7-4f1b-b0f6-42864a04ae74
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5a1c1679-3dd7-4f1b-b0f6-42864a04ae74;
	Fri, 30 Oct 2020 21:45:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YutTJaMZkbWwO79yszbfepWIy+k5HsZExHj7hJrwBiY=; b=LK7/0sE6+HEUkipvNhqEjQoxyv
	8I5F2WJmy85EIjcDHCmxEzyEmHgSRxkKMQ0C+zVF2NKdy0mLetxdrPT1PW/neE3Psb/Ua3Txd7B68
	WE11Y1Gvq4o3Hs+wsmT++isc2YEH235i/ys3NQ8QdizH65WWZ3sAIVtuDVnI0PbS062w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcD8-0003n6-ET
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcD8-0000qt-De
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Add _early_cleanup hook
Message-Id: <E1kYcD8-0000qt-De@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:26 +0000

commit e2c97f161294c702ee4a2dd08532d5df67f6bff4
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:40 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Add _early_cleanup hook
    
    Some parts of cleanup need to occur prior to shutdown, otherwise
    shutdown might break. Move this into a suitably named method/callback.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-4-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index d3faa9a84c..127926b276 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -365,6 +365,17 @@ class QEMUMachine:
                                        close_fds=False)
         self._post_launch()
 
+    def _early_cleanup(self) -> None:
+        """
+        Perform any cleanup that needs to happen before the VM exits.
+        """
+        # If we keep the console socket open, we may deadlock waiting
+        # for QEMU to exit, while QEMU is waiting for the socket to
+        # become writeable.
+        if self._console_socket is not None:
+            self._console_socket.close()
+            self._console_socket = None
+
     def wait(self):
         """
         Wait for the VM to power off
@@ -376,12 +387,7 @@ class QEMUMachine:
         """
         Terminate the VM and clean up
         """
-        # If we keep the console socket open, we may deadlock waiting
-        # for QEMU to exit, while QEMU is waiting for the socket to
-        # become writeable.
-        if self._console_socket is not None:
-            self._console_socket.close()
-            self._console_socket = None
+        self._early_cleanup()
 
         if self.is_running():
             if hard:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16369.40149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDL-0003If-3T; Fri, 30 Oct 2020 21:45:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16369.40149; Fri, 30 Oct 2020 21:45:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDL-0003IX-0R; Fri, 30 Oct 2020 21:45:39 +0000
Received: by outflank-mailman (input) for mailman id 16369;
 Fri, 30 Oct 2020 21:45:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcDJ-0003IQ-R5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b0781d61-2484-4e13-ba1f-a0401dc40895;
 Fri, 30 Oct 2020 21:45:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDI-0003nE-IF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDI-0000s3-HI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcDJ-0003IQ-R5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:37 +0000
X-Inumbo-ID: b0781d61-2484-4e13-ba1f-a0401dc40895
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b0781d61-2484-4e13-ba1f-a0401dc40895;
	Fri, 30 Oct 2020 21:45:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D5wVSgB3GoFEGW0NBYX0KYt6Jm93+SfgPVX0SXwFBQw=; b=3h1YIxFEvkAHS08QBo7UbsL2Rv
	5xJ7HzlWWz5D6XhzL4/GMRxO2vUCQd3eSnKduxL42784hNpW4tMs+ttvPhlFC80qFUKtqaWvTzipo
	0XE2Y7whPiCWxQE9VIww0h8qCQCZrhPNHSnWeaClABqUFysVm6SmlRz7U6s9JDRLBPL0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDI-0003nE-IF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDI-0000s3-HI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Perform early cleanup for wait() calls, too
Message-Id: <E1kYcDI-0000s3-HI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:36 +0000

commit 3a7d64b6fc8ddce3987005e0ee6eadbe2cbba5c8
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:41 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Perform early cleanup for wait() calls, too
    
    This is primarily for consistency, and is a step towards wait() and
    shutdown() sharing the same implementation so that the two cleanup paths
    cannot diverge.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-5-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 127926b276..63e40879e2 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -380,6 +380,7 @@ class QEMUMachine:
         """
         Wait for the VM to power off
         """
+        self._early_cleanup()
         self._popen.wait()
         self._post_shutdown()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16370.40154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDV-0003KQ-5M; Fri, 30 Oct 2020 21:45:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16370.40154; Fri, 30 Oct 2020 21:45:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDV-0003KE-24; Fri, 30 Oct 2020 21:45:49 +0000
Received: by outflank-mailman (input) for mailman id 16370;
 Fri, 30 Oct 2020 21:45:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcDT-0003K3-NV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5d258e6e-6f8e-4e2a-a314-b889e1e4a8ad;
 Fri, 30 Oct 2020 21:45:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDS-0003o0-O0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDS-0000t5-LQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcDT-0003K3-NV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:47 +0000
X-Inumbo-ID: 5d258e6e-6f8e-4e2a-a314-b889e1e4a8ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5d258e6e-6f8e-4e2a-a314-b889e1e4a8ad;
	Fri, 30 Oct 2020 21:45:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ALRMkfdVtUBuOEGNiDksoDLvyAOlmvRh3/xukNvJXJk=; b=wbZaFRLx/SFfzzmVOIMPXxi0Ib
	FwbF9qIWvxfdJzU4dXOr/aXE1dN5oFO5uiW3NchopNyIj5sgJ5k+cWyFcdM701rEJFbgpe3NjDHYR
	WZ1+yi0hKv1PJOWxa5wqVpBtBD3x3SyO9W7EjP/POMr9O5Y941wAkqjY6Qbwz5iqudt0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDS-0003o0-O0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDS-0000t5-LQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Prohibit multiple shutdown() calls
Message-Id: <E1kYcDS-0000t5-LQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:46 +0000

commit a3842cb078a195db0715b00edd7812adcb8b077f
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:42 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Prohibit multiple shutdown() calls
    
    If the VM is not launched, don't try to shut it down. As a change,
    _post_shutdown now unconditionally also calls _early_cleanup in order to
    offer comprehensive object cleanup in failure cases.
    
    As a courtesy, treat it as a NOP instead of rejecting it as an
    error. This is slightly nicer for acceptance tests where vm.shutdown()
    is issued unconditionally in tearDown callbacks.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200710050649.32434-6-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 63e40879e2..c28957ee82 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -294,6 +294,13 @@ class QEMUMachine:
             self._qmp.accept()
 
     def _post_shutdown(self):
+        """
+        Called to cleanup the VM instance after the process has exited.
+        May also be called after a failed launch.
+        """
+        # Comprehensive reset for the failed launch case:
+        self._early_cleanup()
+
         if self._qmp:
             self._qmp.close()
             self._qmp = None
@@ -339,7 +346,7 @@ class QEMUMachine:
             self._launch()
             self._launched = True
         except:
-            self.shutdown()
+            self._post_shutdown()
 
             LOG.debug('Error launching VM')
             if self._qemu_full_args:
@@ -368,6 +375,8 @@ class QEMUMachine:
     def _early_cleanup(self) -> None:
         """
         Perform any cleanup that needs to happen before the VM exits.
+
+        Called additionally by _post_shutdown for comprehensive cleanup.
         """
         # If we keep the console socket open, we may deadlock waiting
         # for QEMU to exit, while QEMU is waiting for the socket to
@@ -388,6 +397,9 @@ class QEMUMachine:
         """
         Terminate the VM and clean up
         """
+        if not self._launched:
+            return
+
         self._early_cleanup()
 
         if self.is_running():
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:45:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:45:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16371.40159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDf-0003LU-6o; Fri, 30 Oct 2020 21:45:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16371.40159; Fri, 30 Oct 2020 21:45:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDf-0003LM-3a; Fri, 30 Oct 2020 21:45:59 +0000
Received: by outflank-mailman (input) for mailman id 16371;
 Fri, 30 Oct 2020 21:45:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcDd-0003LD-O3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96d9a151-1983-4d5f-9767-a6475c4afec4;
 Fri, 30 Oct 2020 21:45:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDc-0003o8-RZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDc-0000tw-Qj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcDd-0003LD-O3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:57 +0000
X-Inumbo-ID: 96d9a151-1983-4d5f-9767-a6475c4afec4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96d9a151-1983-4d5f-9767-a6475c4afec4;
	Fri, 30 Oct 2020 21:45:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1J+IWoLFBcAiP+pfdJ5/7vc77465jJy9nXgYuIFq7qY=; b=xS2BYa6beaaYUct2pnMJ1GA5CO
	hUHTC6zGMFaBUZaJCk/ut59W1Hn0XTDScKdsHB6DVgou01qvv5rl3Im8NcMDXysOM0X2mnp5Flu+R
	ZgJ4bluh75CJM8s0KbgUbDA+F3ORvKI13E+2JGYpe7YhrAdAm2Ru4uZlvgKUYbpj1GbI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDc-0003o8-RZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDc-0000tw-Qj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:45:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Add a configurable timeout to shutdown()
Message-Id: <E1kYcDc-0000tw-Qj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:45:56 +0000

commit c9b3045bc2f52aca8825b6a04e9367b87d64d1cf
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:43 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Add a configurable timeout to shutdown()
    
    Three seconds is hardcoded. Use it as a default parameter instead, and use that
    value for both waits that may occur in the function.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-7-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index c28957ee82..e825f0bdc6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -393,7 +393,9 @@ class QEMUMachine:
         self._popen.wait()
         self._post_shutdown()
 
-    def shutdown(self, has_quit=False, hard=False):
+    def shutdown(self, has_quit: bool = False,
+                 hard: bool = False,
+                 timeout: Optional[int] = 3) -> None:
         """
         Terminate the VM and clean up
         """
@@ -409,10 +411,10 @@ class QEMUMachine:
                 try:
                     if not has_quit:
                         self._qmp.cmd('quit')
-                    self._popen.wait(timeout=3)
+                    self._popen.wait(timeout=timeout)
                 except:
                     self._popen.kill()
-            self._popen.wait()
+            self._popen.wait(timeout=timeout)
 
         self._post_shutdown()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16372.40162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDp-0003Mm-8a; Fri, 30 Oct 2020 21:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16372.40162; Fri, 30 Oct 2020 21:46:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDp-0003Md-5B; Fri, 30 Oct 2020 21:46:09 +0000
Received: by outflank-mailman (input) for mailman id 16372;
 Fri, 30 Oct 2020 21:46:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcDn-0003MS-Sv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a6c58913-13f0-45b8-b619-3ba149563d57;
 Fri, 30 Oct 2020 21:46:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDm-0003oS-V8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDm-0000ur-UH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcDn-0003MS-Sv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:07 +0000
X-Inumbo-ID: a6c58913-13f0-45b8-b619-3ba149563d57
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a6c58913-13f0-45b8-b619-3ba149563d57;
	Fri, 30 Oct 2020 21:46:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PDRzATsCedN1lw6XAPktrFP+YbqzpyuhI1cb0dYYczc=; b=tHkFh+cg8OlVbKwpJftjTSO5Ai
	chy5atHJ0Wnpl32+29QLN7SoQB91TN8XZ2+Lc16U5Am6maeZNA0anzfWaqpTtoQrw4mO9UJfuf5bx
	CCf60CT2dCY+r0UswRA4+7vg+kYkNCTybgOg/LyyNYkWiccRF1RIveEbeEkq8P/gW6f4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDm-0003oS-V8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDm-0000ur-UH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: Make wait() call shutdown()
Message-Id: <E1kYcDm-0000ur-UH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:06 +0000

commit 895280593139a1c34e59526835ba8fda903f8aaa
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:44 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: Make wait() call shutdown()
    
    At this point, shutdown(has_quit=True) and wait() do essentially the
    same thing; they perform cleanup without actually instructing QEMU to
    quit.
    
    Define one in terms of the other.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-8-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index e825f0bdc6..3f0b873f58 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -385,14 +385,6 @@ class QEMUMachine:
             self._console_socket.close()
             self._console_socket = None
 
-    def wait(self):
-        """
-        Wait for the VM to power off
-        """
-        self._early_cleanup()
-        self._popen.wait()
-        self._post_shutdown()
-
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
                  timeout: Optional[int] = 3) -> None:
@@ -421,6 +413,15 @@ class QEMUMachine:
     def kill(self):
         self.shutdown(hard=True)
 
+    def wait(self, timeout: Optional[int] = None) -> None:
+        """
+        Wait for the VM to power off and perform post-shutdown cleanup.
+
+        :param timeout: Optional timeout in seconds.
+                        Default None, an infinite wait.
+        """
+        self.shutdown(has_quit=True, timeout=timeout)
+
     def set_qmp_monitor(self, enabled=True):
         """
         Set the QMP monitor.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16373.40166 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDz-0003OC-Aq; Fri, 30 Oct 2020 21:46:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16373.40166; Fri, 30 Oct 2020 21:46:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcDz-0003O4-7v; Fri, 30 Oct 2020 21:46:19 +0000
Received: by outflank-mailman (input) for mailman id 16373;
 Fri, 30 Oct 2020 21:46:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcDy-0003Nu-1F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7cdd0fad-a833-4dbc-8cec-76116dbe6bd6;
 Fri, 30 Oct 2020 21:46:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDx-0003od-3R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcDx-0000vO-1e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcDy-0003Nu-1F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:18 +0000
X-Inumbo-ID: 7cdd0fad-a833-4dbc-8cec-76116dbe6bd6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7cdd0fad-a833-4dbc-8cec-76116dbe6bd6;
	Fri, 30 Oct 2020 21:46:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=x/Mp772MDexXuWAlVcyQ908m+6COm/rj7tOrL23uuBo=; b=xaYr3aVj/gYV2c3nxhNrADk38q
	iE0pJ/Zbv2EY/WjmGLKhZx/AsjbCQwP2NYb3S7SJAgTqF5zt3+b86zUYSvc8Rq7w92J70xnJsRmLI
	Yb38fKu2NlB1BntzELDusUAFquIi/Vqd8Yv6CjjYxv3fHhMS8bumya2vOP9V3109BamI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDx-0003od-3R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcDx-0000vO-1e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/acceptance: wait() instead of shutdown() where appropriate
Message-Id: <E1kYcDx-0000vO-1e@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:17 +0000

commit a0690c39006b897d6453daf591909948ac553650
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:45 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    tests/acceptance: wait() instead of shutdown() where appropriate
    
    When issuing 'reboot' to a VM with the no-reboot option, that VM will
    exit. When then issuing a shutdown command, the cleanup may race.
    
    Add calls to vm.wait() which will gracefully mark the VM as having
    exited. Subsequent vm.shutdown() calls in generic tearDown code will not
    race when called after completion of the call.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-9-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_linux_console.py   | 10 ++++++++++
 tests/acceptance/linux_ssh_mips_malta.py |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 3d02519660..5867ef760c 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -191,6 +191,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Debian')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
     def test_mips64el_malta_5KEc_cpio(self):
@@ -231,6 +233,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 '3.19.3.mtoman.20150408')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
         kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -506,6 +510,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'system-control@1c00000')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
 
     def test_arm_cubieboard_sata(self):
         """
@@ -550,6 +555,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'sda')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
 
     def test_arm_orangepi(self):
         """
@@ -615,6 +621,8 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'system-control@1c00000')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def test_arm_orangepi_sd(self):
         """
@@ -662,6 +670,8 @@ class BootLinuxConsole(LinuxKernelTest):
             '3 packets transmitted, 3 packets received, 0% packet loss')
         exec_command_and_wait_for_pattern(self, 'reboot',
                                                 'reboot: Restarting system')
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
     @skipUnless(P7ZIP_AVAILABLE, '7z not installed')
diff --git a/tests/acceptance/linux_ssh_mips_malta.py b/tests/acceptance/linux_ssh_mips_malta.py
index 90d7f2f167..25c5c5f741 100644
--- a/tests/acceptance/linux_ssh_mips_malta.py
+++ b/tests/acceptance/linux_ssh_mips_malta.py
@@ -212,6 +212,8 @@ class LinuxSSH(Test):
 
         self.run_common_commands(wordsize)
         self.shutdown_via_ssh()
+        # Wait for VM to shut down gracefully
+        self.vm.wait()
 
     def test_mips_malta32eb_kernel3_2_0(self):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16374.40170 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcE9-0003PZ-Cj; Fri, 30 Oct 2020 21:46:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16374.40170; Fri, 30 Oct 2020 21:46:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcE9-0003PR-9T; Fri, 30 Oct 2020 21:46:29 +0000
Received: by outflank-mailman (input) for mailman id 16374;
 Fri, 30 Oct 2020 21:46:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcE8-0003PH-BX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 14386598-a913-46f3-8c76-933a82b58284;
 Fri, 30 Oct 2020 21:46:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcE7-0003os-7E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcE7-0000vu-6L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcE8-0003PH-BX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:28 +0000
X-Inumbo-ID: 14386598-a913-46f3-8c76-933a82b58284
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 14386598-a913-46f3-8c76-933a82b58284;
	Fri, 30 Oct 2020 21:46:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=18mjAxNW4ojPxag0gsJ7HbYdH5UTmCpT4DXAhNUCYMI=; b=kNcKVsH/I1vKlfQHTYM2Sxczdi
	NNeiQyP/nqCJhjyjMpHz+nZEaKM8UR8PwZCNOyRpHRHsbeOW83EPZagG1Dl119NjXi8pRiPkFpCAS
	6PnyfKT9st8e0ujLgdrD6DLctU/CqeE7St3P0zRzAZno6WAYEAhxFRwPiEa9mVJWL+uw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcE7-0003os-7E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcE7-0000vu-6L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/acceptance: Don't test reboot on cubieboard
Message-Id: <E1kYcE7-0000vu-6L@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:27 +0000

commit fdb87f0dc2ed8e4f712a88fb5f9382ceea620223
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:46 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    tests/acceptance: Don't test reboot on cubieboard
    
    cubieboard does not have a functioning reboot, it halts and QEMU does
    not exit.
    
    vm.shutdown() is modified in a forthcoming patch that makes it less tolerant
    of race conditions on shutdown; tests should consciously decide to WAIT
    or to SHUTDOWN qemu.
    
    So long as this test is attempting to reboot, the correct choice would
    be to WAIT for the VM to exit. However, since that's broken, we should
    SHUTDOWN instead.
    
    SHUTDOWN is indeed what already happens when the test performs teardown,
    however, if anyone fixes cubieboard reboot in the future, this test will
    develop a new race condition that might be hard to debug.
    
    Therefore: remove the reboot test and make it obvious that the VM is
    still running when the test concludes, where the test teardown will do
    the right thing.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-10-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/boot_linux_console.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 5867ef760c..8b8b828bc5 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -508,9 +508,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Allwinner sun4i/sun5i')
         exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
                                                 'system-control@1c00000')
-        exec_command_and_wait_for_pattern(self, 'reboot',
-                                                'reboot: Restarting system')
-        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
+        # cubieboard's reboot is not functioning; omit reboot test.
 
     def test_arm_cubieboard_sata(self):
         """
@@ -553,9 +551,7 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'Allwinner sun4i/sun5i')
         exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
                                                 'sda')
-        exec_command_and_wait_for_pattern(self, 'reboot',
-                                                'reboot: Restarting system')
-        # NB: Do not issue vm.wait() here, cubieboard's reboot does not exit!
+        # cubieboard's reboot is not functioning; omit reboot test.
 
     def test_arm_orangepi(self):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16375.40174 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEJ-0003RY-EK; Fri, 30 Oct 2020 21:46:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16375.40174; Fri, 30 Oct 2020 21:46:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEJ-0003RQ-BB; Fri, 30 Oct 2020 21:46:39 +0000
Received: by outflank-mailman (input) for mailman id 16375;
 Fri, 30 Oct 2020 21:46:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcEI-0003Qc-Dg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c74034da-8377-4761-8309-cf9d1ee18909;
 Fri, 30 Oct 2020 21:46:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEH-0003p3-BS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEH-0000wQ-AL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcEI-0003Qc-Dg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:38 +0000
X-Inumbo-ID: c74034da-8377-4761-8309-cf9d1ee18909
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c74034da-8377-4761-8309-cf9d1ee18909;
	Fri, 30 Oct 2020 21:46:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NJQ0xqCk9fW3ONMCj5anRU3MaPGacUsUF4ikL/qJK/8=; b=n1I0r71rL77324z8eYJwR55sSj
	EK3WQuDRPBoKOPTVecDnkJpTCsS1a+AdtpuTpgrDUk5MawZ/HEX8k+lDdaiRnpP+4olwx3lq+cNam
	ETj4Fhx+XuXi/lBp0BM+LygLMKVbezCXgnMCmDQxtQUciv7ZIDSc6S9sLjd3tO7IvFTQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEH-0003p3-BS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEH-0000wQ-AL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: split shutdown into hard and soft flavors
Message-Id: <E1kYcEH-0000wQ-AL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:37 +0000

commit 193bf1c061ce0bb078ebc153facb9f31fe139d72
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:47 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: split shutdown into hard and soft flavors
    
    This is done primarily to avoid the 'bare except' pattern, which
    suppresses all exceptions during shutdown and can obscure errors.
    
    Replace this with a pattern that isolates the different kind of shutdown
    paradigms (_hard_shutdown and _soft_shutdown), and a new fallback shutdown
    handler (_do_shutdown) that gracefully attempts one before the other.
    
    This split now also ensures that no matter what happens,
    _post_shutdown() is always invoked.
    
    shutdown() changes in behavior such that if it attempts to do a graceful
    shutdown and is unable to, it will now always raise an exception to
    indicate this. This can be avoided by the test writer in three ways:
    
    1. If the VM is expected to have already exited or is in the process of
    exiting, wait() can be used instead of shutdown() to clean up resources
    instead. This helps avoid race conditions in shutdown.
    
    2. If a test writer is expecting graceful shutdown to fail, shutdown
    should be called in a try...except block.
    
    3. If the test writer has no interest in performing a graceful shutdown
    at all, kill() can be used instead.
    
    Handling shutdown in this way makes it much more explicit which type of
    shutdown we want and allows the library to report problems with this
    process.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-11-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 98 ++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 83 insertions(+), 15 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 3f0b873f58..a955e3f221 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -49,6 +49,12 @@ class QEMUMachineAddDeviceError(QEMUMachineError):
     """
 
 
+class AbnormalShutdown(QEMUMachineError):
+    """
+    Exception raised when a graceful shutdown was requested, but not performed.
+    """
+
+
 class MonitorResponseError(qmp.QMPError):
     """
     Represents erroneous QMP monitor reply
@@ -376,6 +382,7 @@ class QEMUMachine:
         """
         Perform any cleanup that needs to happen before the VM exits.
 
+        May be invoked by both soft and hard shutdown in failover scenarios.
         Called additionally by _post_shutdown for comprehensive cleanup.
         """
         # If we keep the console socket open, we may deadlock waiting
@@ -385,32 +392,93 @@ class QEMUMachine:
             self._console_socket.close()
             self._console_socket = None
 
+    def _hard_shutdown(self) -> None:
+        """
+        Perform early cleanup, kill the VM, and wait for it to terminate.
+
+        :raise subprocess.Timeout: When timeout is exceeds 60 seconds
+            waiting for the QEMU process to terminate.
+        """
+        self._early_cleanup()
+        self._popen.kill()
+        self._popen.wait(timeout=60)
+
+    def _soft_shutdown(self, has_quit: bool = False,
+                       timeout: Optional[int] = 3) -> None:
+        """
+        Perform early cleanup, attempt to gracefully shut down the VM, and wait
+        for it to terminate.
+
+        :param has_quit: When True, don't attempt to issue 'quit' QMP command
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
+
+        :raise ConnectionReset: On QMP communication errors
+        :raise subprocess.TimeoutExpired: When timeout is exceeded waiting for
+            the QEMU process to terminate.
+        """
+        self._early_cleanup()
+
+        if self._qmp is not None:
+            if not has_quit:
+                # Might raise ConnectionReset
+                self._qmp.cmd('quit')
+
+        # May raise subprocess.TimeoutExpired
+        self._popen.wait(timeout=timeout)
+
+    def _do_shutdown(self, has_quit: bool = False,
+                     timeout: Optional[int] = 3) -> None:
+        """
+        Attempt to shutdown the VM gracefully; fallback to a hard shutdown.
+
+        :param has_quit: When True, don't attempt to issue 'quit' QMP command
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
+
+        :raise AbnormalShutdown: When the VM could not be shut down gracefully.
+            The inner exception will likely be ConnectionReset or
+            subprocess.TimeoutExpired. In rare cases, non-graceful termination
+            may result in its own exceptions, likely subprocess.TimeoutExpired.
+        """
+        try:
+            self._soft_shutdown(has_quit, timeout)
+        except Exception as exc:
+            self._hard_shutdown()
+            raise AbnormalShutdown("Could not perform graceful shutdown") \
+                from exc
+
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
                  timeout: Optional[int] = 3) -> None:
         """
-        Terminate the VM and clean up
+        Terminate the VM (gracefully if possible) and perform cleanup.
+        Cleanup will always be performed.
+
+        If the VM has not yet been launched, or shutdown(), wait(), or kill()
+        have already been called, this method does nothing.
+
+        :param has_quit: When true, do not attempt to issue 'quit' QMP command.
+        :param hard: When true, do not attempt graceful shutdown, and
+                     suppress the SIGKILL warning log message.
+        :param timeout: Optional timeout in seconds for graceful shutdown.
+                        Default 3 seconds, A value of None is an infinite wait.
         """
         if not self._launched:
             return
 
-        self._early_cleanup()
-
-        if self.is_running():
+        try:
             if hard:
-                self._popen.kill()
-            elif self._qmp:
-                try:
-                    if not has_quit:
-                        self._qmp.cmd('quit')
-                    self._popen.wait(timeout=timeout)
-                except:
-                    self._popen.kill()
-            self._popen.wait(timeout=timeout)
-
-        self._post_shutdown()
+                self._hard_shutdown()
+            else:
+                self._do_shutdown(has_quit, timeout=timeout)
+        finally:
+            self._post_shutdown()
 
     def kill(self):
+        """
+        Terminate the VM forcefully, wait for it to exit, and perform cleanup.
+        """
         self.shutdown(hard=True)
 
     def wait(self, timeout: Optional[int] = None) -> None:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16376.40179 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcET-0003Sp-GH; Fri, 30 Oct 2020 21:46:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16376.40179; Fri, 30 Oct 2020 21:46:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcET-0003Sf-Cv; Fri, 30 Oct 2020 21:46:49 +0000
Received: by outflank-mailman (input) for mailman id 16376;
 Fri, 30 Oct 2020 21:46:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcES-0003SV-EQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id dff3c63b-9bac-4209-bb45-fb8176abd235;
 Fri, 30 Oct 2020 21:46:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcER-0003pc-FI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcER-0000ww-EO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcES-0003SV-EQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:48 +0000
X-Inumbo-ID: dff3c63b-9bac-4209-bb45-fb8176abd235
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id dff3c63b-9bac-4209-bb45-fb8176abd235;
	Fri, 30 Oct 2020 21:46:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G9vhEi4SRBgFGFfSY2xINJTr4cfxh+xeVP7tmuBp6ZU=; b=DDXEt6sm6B5PeNCeOLNGQWVeUM
	aN+QYgb2bMq9yyBuN8Tf4NBbeCWy94UZd1Sq8XDqDk6fpOGiunE1yyjybDMKQdZZD3X0XZ+yhv2u7
	uEqmIDmjFjzPfhlqicUd9gCntMEnBDwCTc1qiCaKeHLSLjlrHXjMxuOU8g26jPvOIt6g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcER-0003pc-FI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcER-0000ww-EO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: re-add sigkill warning suppression
Message-Id: <E1kYcER-0000ww-EO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:47 +0000

commit de6e08b5b987afbaf22e37e7f9e34421fb76ef3f
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:48 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: re-add sigkill warning suppression
    
    If the user kills QEMU on purpose, we don't need to warn
    them about that having happened: they know already.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-12-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index a955e3f221..736a3c906f 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -22,6 +22,7 @@ import logging
 import os
 import subprocess
 import shutil
+import signal
 import socket
 import tempfile
 from typing import Optional, Type
@@ -133,6 +134,7 @@ class QEMUMachine:
         self._console_address = None
         self._console_socket = None
         self._remove_files = []
+        self._user_killed = False
         self._console_log_path = console_log
         if self._console_log_path:
             # In order to log the console, buffering needs to be enabled.
@@ -327,7 +329,8 @@ class QEMUMachine:
             self._remove_if_exists(self._remove_files.pop())
 
         exitcode = self.exitcode()
-        if exitcode is not None and exitcode < 0:
+        if (exitcode is not None and exitcode < 0
+                and not (self._user_killed and exitcode == -signal.SIGKILL)):
             msg = 'qemu received signal %i; command: "%s"'
             if self._qemu_full_args:
                 command = ' '.join(self._qemu_full_args)
@@ -335,6 +338,7 @@ class QEMUMachine:
                 command = ''
             LOG.warning(msg, -int(exitcode), command)
 
+        self._user_killed = False
         self._launched = False
 
     def launch(self):
@@ -469,6 +473,7 @@ class QEMUMachine:
 
         try:
             if hard:
+                self._user_killed = True
                 self._hard_shutdown()
             else:
                 self._do_shutdown(has_quit, timeout=timeout)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:46:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:46:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16377.40182 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEd-0003U5-Hm; Fri, 30 Oct 2020 21:46:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16377.40182; Fri, 30 Oct 2020 21:46:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEd-0003Tx-ES; Fri, 30 Oct 2020 21:46:59 +0000
Received: by outflank-mailman (input) for mailman id 16377;
 Fri, 30 Oct 2020 21:46:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcEc-0003To-Di
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id df0bc0fd-384f-4a72-a695-9947698c76c0;
 Fri, 30 Oct 2020 21:46:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEb-0003pk-Iv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEb-0000xZ-I4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcEc-0003To-Di
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:58 +0000
X-Inumbo-ID: df0bc0fd-384f-4a72-a695-9947698c76c0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id df0bc0fd-384f-4a72-a695-9947698c76c0;
	Fri, 30 Oct 2020 21:46:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7pRrVwbF4fcpeviScxM1n6ikHoPpR15GX3b3NQL1z2U=; b=6PZqOOfzhdJKR9pSCVdnNiDpU2
	H5QgQg+HE3GxpsUDxDs41JlpxB+yzLtRm06Usb+dQbqGuwB+840rbYMc7fTgL467MK/5wdAcXkgSJ
	gBKzGA1+GcROtzywV6wM2YSLnPuIas660mhkBwpIFI8abViwTAD1kV7nNyXM8EHm5UdA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEb-0003pk-Iv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEb-0000xZ-I4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:46:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine.py: change default wait timeout to 3 seconds
Message-Id: <E1kYcEb-0000xZ-I4@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:46:57 +0000

commit 04f0e36eba7b1a06e413a0690d4b1a24994d99fe
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:06:49 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/machine.py: change default wait timeout to 3 seconds
    
    Machine.wait() does not appear to be used except in the acceptance tests,
    and an infinite timeout by default in a test suite is not the most helpful.
    
    Change it to 3 seconds, like the default shutdown timeout.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Tested-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200710050649.32434-13-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 736a3c906f..69055189bd 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -486,12 +486,12 @@ class QEMUMachine:
         """
         self.shutdown(hard=True)
 
-    def wait(self, timeout: Optional[int] = None) -> None:
+    def wait(self, timeout: Optional[int] = 3) -> None:
         """
         Wait for the VM to power off and perform post-shutdown cleanup.
 
         :param timeout: Optional timeout in seconds.
-                        Default None, an infinite wait.
+                        Default 3 seconds, A value of None is an infinite wait.
         """
         self.shutdown(has_quit=True, timeout=timeout)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:47:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:47:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16378.40186 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEn-0003Vb-KE; Fri, 30 Oct 2020 21:47:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16378.40186; Fri, 30 Oct 2020 21:47:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEn-0003VT-HE; Fri, 30 Oct 2020 21:47:09 +0000
Received: by outflank-mailman (input) for mailman id 16378;
 Fri, 30 Oct 2020 21:47:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcEm-0003VG-EW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 48c20d3b-799e-4ab5-8a61-4fc7ca34fe99;
 Fri, 30 Oct 2020 21:47:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEl-0003q7-Mj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEl-0000yH-Lo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcEm-0003VG-EW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:08 +0000
X-Inumbo-ID: 48c20d3b-799e-4ab5-8a61-4fc7ca34fe99
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 48c20d3b-799e-4ab5-8a61-4fc7ca34fe99;
	Fri, 30 Oct 2020 21:47:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jP6ZKb4NxHp2DMJvBzZceZwyLLomdsSwfLDXr9jNEpI=; b=ZDzx1k3RTQpVU//NAsHD/EINiZ
	uOqvM2wow0YBRgjwygoujm0yECfS7Juyb0zb7X8IeBwbp4Vwdd2DXe1s2Pv2XeB3E9J3TjTTJoc2q
	tjFWldF4hKicQmJB6MVo+92bYguN21iNZGiphExnk+9j7FdigzN/Pr6Oel7gvJZHhQ70=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEl-0003q7-Mj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEl-0000yH-Lo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qmp.py: Define common types
Message-Id: <E1kYcEl-0000yH-Lo@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:07 +0000

commit a5d76376d65d8777f28bb064412a8d72fa2c7953
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:05 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: Define common types
    
    Define some common types that we'll need to annotate a lot of other
    functions going forward.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-2-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index e64b6b5faa..8388c7b603 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -12,13 +12,31 @@ import errno
 import socket
 import logging
 from typing import (
+    Any,
+    Dict,
     Optional,
     TextIO,
     Type,
+    Tuple,
+    Union,
 )
 from types import TracebackType
 
 
+# QMPMessage is a QMP Message of any kind.
+# e.g. {'yee': 'haw'}
+#
+# QMPReturnValue is the inner value of return values only.
+# {'return': {}} is the QMPMessage,
+# {} is the QMPReturnValue.
+QMPMessage = Dict[str, Any]
+QMPReturnValue = Dict[str, Any]
+
+InternetAddrT = Tuple[str, str]
+UnixAddrT = str
+SocketAddrT = Union[InternetAddrT, UnixAddrT]
+
+
 class QMPError(Exception):
     """
     QMP base exception
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:47:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:47:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16379.40190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEx-0003Wq-Li; Fri, 30 Oct 2020 21:47:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16379.40190; Fri, 30 Oct 2020 21:47:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcEx-0003Wj-Il; Fri, 30 Oct 2020 21:47:19 +0000
Received: by outflank-mailman (input) for mailman id 16379;
 Fri, 30 Oct 2020 21:47:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcEw-0003WY-Lk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4c0c3ebb-a3c4-49a2-8cef-f93682c24017;
 Fri, 30 Oct 2020 21:47:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEv-0003qJ-QO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcEv-0000yt-Pb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcEw-0003WY-Lk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:18 +0000
X-Inumbo-ID: 4c0c3ebb-a3c4-49a2-8cef-f93682c24017
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4c0c3ebb-a3c4-49a2-8cef-f93682c24017;
	Fri, 30 Oct 2020 21:47:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d4OdOZXRO8ZQat1Fq2l3Bgzn5wQmP62j0Ls95mo/1hw=; b=bh7iO9MmgORAyRPRuIg4wayFN/
	NIiRQthHuLBVXEp792FuQKAgWw8qowGk9Rtcg033ILJo28Sfdd5URYwwRa+k3NjIR7XeIjReaqwho
	69vsHJ35+YKH/vXM13J8CGRSNPEObANLWzx2oltOASkXaQS5s79Zz2acEWLQVG3eVlwM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEv-0003qJ-QO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcEv-0000yt-Pb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests.py: use qemu.qmp type aliases
Message-Id: <E1kYcEv-0000yt-Pb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:17 +0000

commit 2012453ddde0506d044d4739257227c6868028b6
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:06 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    iotests.py: use qemu.qmp type aliases
    
    iotests.py should use the type definitions from qmp.py instead of its
    own.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-3-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/qemu-iotests/iotests.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8b760405ee..3590ed78a0 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -35,13 +35,10 @@ import unittest
 # pylint: disable=import-error, wrong-import-position
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu import qtest
+from qemu.qmp import QMPMessage
 
 assert sys.version_info >= (3, 6)
 
-# Type Aliases
-QMPResponse = Dict[str, Any]
-
-
 # Use this logger for logging messages directly from the iotests module
 logger = logging.getLogger('qemu.iotests')
 logger.addHandler(logging.NullHandler())
@@ -561,7 +558,7 @@ class VM(qtest.QEMUQtestMachine):
         self._args.append(addr)
         return self
 
-    def hmp(self, command_line: str, use_log: bool = False) -> QMPResponse:
+    def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage:
         cmd = 'human-monitor-command'
         kwargs = {'command-line': command_line}
         if use_log:
@@ -582,7 +579,7 @@ class VM(qtest.QEMUQtestMachine):
         self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"')
 
     def hmp_qemu_io(self, drive: str, cmd: str,
-                    use_log: bool = False) -> QMPResponse:
+                    use_log: bool = False) -> QMPMessage:
         """Write to a given drive using an HMP command"""
         return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=use_log)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:47:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:47:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16380.40194 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcF8-0003YC-NI; Fri, 30 Oct 2020 21:47:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16380.40194; Fri, 30 Oct 2020 21:47:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcF8-0003Y4-KN; Fri, 30 Oct 2020 21:47:30 +0000
Received: by outflank-mailman (input) for mailman id 16380;
 Fri, 30 Oct 2020 21:47:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcF6-0003Xp-T7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cf8e4fcc-a568-4980-ab99-c5bdfcdb96e5;
 Fri, 30 Oct 2020 21:47:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcF5-0003qU-Ty
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcF5-0000zV-TG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcF6-0003Xp-T7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:28 +0000
X-Inumbo-ID: cf8e4fcc-a568-4980-ab99-c5bdfcdb96e5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cf8e4fcc-a568-4980-ab99-c5bdfcdb96e5;
	Fri, 30 Oct 2020 21:47:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jbZ05zFAabnL0afOdouBUma8gPBeTNb1+/j0Nnd4ra4=; b=xLLCgaUbDYjzHpVNwwuffNLn9O
	KcNp5s0BvFv+jX3vSSTuYAXfzoroCj9i5q/c2rZvr5p/qac+Z1CpTVsn+a+ifx/YoJ4Xt89HXzSXY
	Jnb9cYuG7BM0l7d86DgDk4h+X2n1ZdPLjApzReZvlLSd0f0W2TwJtD88gR+mCCH756Rc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcF5-0003qU-Ty
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcF5-0000zV-TG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qmp.py: re-absorb MonitorResponseError
Message-Id: <E1kYcF5-0000zV-TG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:27 +0000

commit e3a23b4803a3939c7e24e8946880f5ef369ef781
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:07 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: re-absorb MonitorResponseError
    
    When I initially split this out, I considered this more of a machine
    error than a QMP protocol error, but I think that's misguided.
    
    Move this back to qmp.py and name it QMPResponseError. Convert
    qmp.command() to use this exception type.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-4-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/machine.py        | 15 +--------------
 python/qemu/qmp.py            | 17 +++++++++++++++--
 scripts/render_block_graph.py |  7 +++++--
 3 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 69055189bd..80c4d4a8b6 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -56,19 +56,6 @@ class AbnormalShutdown(QEMUMachineError):
     """
 
 
-class MonitorResponseError(qmp.QMPError):
-    """
-    Represents erroneous QMP monitor reply
-    """
-    def __init__(self, reply):
-        try:
-            desc = reply["error"]["desc"]
-        except KeyError:
-            desc = reply
-        super().__init__(desc)
-        self.reply = reply
-
-
 class QEMUMachine:
     """
     A QEMU VM
@@ -533,7 +520,7 @@ class QEMUMachine:
         if reply is None:
             raise qmp.QMPError("Monitor is closed")
         if "error" in reply:
-            raise MonitorResponseError(reply)
+            raise qmp.QMPResponseError(reply)
         return reply["return"]
 
     def get_qmp_event(self, wait=False):
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index 8388c7b603..aa8a666b8a 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -61,6 +61,19 @@ class QMPTimeoutError(QMPError):
     """
 
 
+class QMPResponseError(QMPError):
+    """
+    Represents erroneous QMP monitor reply
+    """
+    def __init__(self, reply: QMPMessage):
+        try:
+            desc = reply['error']['desc']
+        except KeyError:
+            desc = reply
+        super().__init__(desc)
+        self.reply = reply
+
+
 class QEMUMonitorProtocol:
     """
     Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) and then
@@ -251,8 +264,8 @@ class QEMUMonitorProtocol:
         Build and send a QMP command to the monitor, report errors if any
         """
         ret = self.cmd(cmd, kwds)
-        if "error" in ret:
-            raise Exception(ret['error']['desc'])
+        if 'error' in ret:
+            raise QMPResponseError(ret)
         return ret['return']
 
     def pull_event(self, wait=False):
diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py
index 409b4321f2..da6acf050d 100755
--- a/scripts/render_block_graph.py
+++ b/scripts/render_block_graph.py
@@ -25,7 +25,10 @@ import json
 from graphviz import Digraph
 
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
-from qemu.machine import MonitorResponseError
+from qemu.qmp import (
+    QEMUMonitorProtocol,
+    QMPResponseError,
+)
 
 
 def perm(arr):
@@ -102,7 +105,7 @@ class LibvirtGuest():
         reply = json.loads(subprocess.check_output(ar))
 
         if 'error' in reply:
-            raise MonitorResponseError(reply)
+            raise QMPResponseError(reply)
 
         return reply['return']
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:47:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:47:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16381.40198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFI-0003Zt-Oz; Fri, 30 Oct 2020 21:47:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16381.40198; Fri, 30 Oct 2020 21:47:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFI-0003Zl-Lp; Fri, 30 Oct 2020 21:47:40 +0000
Received: by outflank-mailman (input) for mailman id 16381;
 Fri, 30 Oct 2020 21:47:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcFH-0003Za-LY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 887427bd-fc01-433c-9258-e5accc4247cc;
 Fri, 30 Oct 2020 21:47:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFG-0003sl-1A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFG-00011S-0G
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcFH-0003Za-LY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:39 +0000
X-Inumbo-ID: 887427bd-fc01-433c-9258-e5accc4247cc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 887427bd-fc01-433c-9258-e5accc4247cc;
	Fri, 30 Oct 2020 21:47:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6hkvgwv/J9sHfeyIGam7p6zd+haQiWgskgypEqu4uUs=; b=ufVMnX3BpyXpWgjiZx1FtQjN9Z
	+LnCVKeoycKotZaB4MpFHFcEXmVsLSLjnz28L8tQXcy/5qqecBo4Galvv9te+UJWrThpykz+YDewq
	8uYC9WDGX6md24pIDb5pc/VkVMNh7aA1TRCIMsQ3yUw9ZPg2GuvbIt4eZxzmCqHV7HzM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFG-0003sl-1A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFG-00011S-0G
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qmp.py: Do not return None from cmd_obj
Message-Id: <E1kYcFG-00011S-0G@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:38 +0000

commit ef5d474472426eda6abf8128cdb1d026af94862b
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:08 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: Do not return None from cmd_obj
    
    This makes typing the qmp library difficult, as it necessitates wrapping
    Optional[] around the type for every return type up the stack. At some
    point, it becomes difficult to discern or remember why it's None instead
    of the expected object.
    
    Use the python exception system to tell us exactly why we didn't get an
    object. Remove this special-cased return.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-5-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index aa8a666b8a..ef3c919b76 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -225,22 +225,18 @@ class QEMUMonitorProtocol:
         self.__sockfile = self.__sock.makefile(mode='r')
         return self.__negotiate_capabilities()
 
-    def cmd_obj(self, qmp_cmd):
+    def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage:
         """
         Send a QMP command to the QMP Monitor.
 
         @param qmp_cmd: QMP command to be sent as a Python dict
-        @return QMP response as a Python dict or None if the connection has
-                been closed
+        @return QMP response as a Python dict
         """
         self.logger.debug(">>> %s", qmp_cmd)
-        try:
-            self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8'))
-        except OSError as err:
-            if err.errno == errno.EPIPE:
-                return None
-            raise err
+        self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8'))
         resp = self.__json_read()
+        if resp is None:
+            raise QMPConnectError("Unexpected empty reply from server")
         self.logger.debug("<<< %s", resp)
         return resp
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:47:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:47:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16382.40201 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFS-0003bE-QE; Fri, 30 Oct 2020 21:47:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16382.40201; Fri, 30 Oct 2020 21:47:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFS-0003b6-NH; Fri, 30 Oct 2020 21:47:50 +0000
Received: by outflank-mailman (input) for mailman id 16382;
 Fri, 30 Oct 2020 21:47:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcFQ-0003aq-Uq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 37105f92-44b3-414b-991e-01286b7d7a45;
 Fri, 30 Oct 2020 21:47:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFQ-0003su-5R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFQ-000120-46
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcFQ-0003aq-Uq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
X-Inumbo-ID: 37105f92-44b3-414b-991e-01286b7d7a45
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 37105f92-44b3-414b-991e-01286b7d7a45;
	Fri, 30 Oct 2020 21:47:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AlAEbOO8RTNbiBWER6eLJc2d5QqJk1rEdaFPrUcsusQ=; b=AaNbVrJuYyAxQfGQ7P98Sc+D4p
	8pKkEc9rQ+n4tVG7bL4ImEt8Z0FCvnNS1J28xnV9lQu2IS6jrWnhEAJ5jnmStHYCHPnBUKJy0SO4j
	8nyASYNEgACWqWH46dOH2mbMwlbqdpZkmYOU6sRDzlAYFoI6Mix1/bX9hZh6poNUq3I0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFQ-0003su-5R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFQ-000120-46
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qmp.py: add casts to JSON deserialization
Message-Id: <E1kYcFQ-000120-46@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:48 +0000

commit 2e2d93051753067fc5b888fdc18831127a4a900e
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:09 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: add casts to JSON deserialization
    
    mypy and python type hints are not powerful enough to properly describe
    JSON messages in Python 3.6. The best we can do, generally, is describe
    them as Dict[str, Any].
    
    Add casts to coerce this type for static analysis; but do NOT enforce
    this type at runtime in any way.
    
    Note: Python 3.8 adds a TypedDict construct which allows for the
    description of more arbitrary Dictionary shapes. There is a third-party
    module, "Pydantic", which is compatible with 3.6 that can be used
    instead of the JSON library that parses JSON messages to fully-typed
    Python objects, and may be preferable in some cases.
    
    (That is well beyond the scope of this commit or series.)
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-6-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index ef3c919b76..1ae36050a4 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -13,6 +13,7 @@ import socket
 import logging
 from typing import (
     Any,
+    cast,
     Dict,
     Optional,
     TextIO,
@@ -130,7 +131,10 @@ class QEMUMonitorProtocol:
             data = self.__sockfile.readline()
             if not data:
                 return None
-            resp = json.loads(data)
+            # By definition, any JSON received from QMP is a QMPMessage,
+            # and we are asserting only at static analysis time that it
+            # has a particular shape.
+            resp: QMPMessage = json.loads(data)
             if 'event' in resp:
                 self.logger.debug("<<< %s", resp)
                 self.__events.append(resp)
@@ -262,7 +266,7 @@ class QEMUMonitorProtocol:
         ret = self.cmd(cmd, kwds)
         if 'error' in ret:
             raise QMPResponseError(ret)
-        return ret['return']
+        return cast(QMPReturnValue, ret['return'])
 
     def pull_event(self, wait=False):
         """
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16383.40206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFc-0003e5-Re; Fri, 30 Oct 2020 21:48:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16383.40206; Fri, 30 Oct 2020 21:48:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFc-0003dx-Oi; Fri, 30 Oct 2020 21:48:00 +0000
Received: by outflank-mailman (input) for mailman id 16383;
 Fri, 30 Oct 2020 21:47:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcFb-0003dk-Ht
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 89282886-7cc1-4960-8ec2-fdeaedc303cd;
 Fri, 30 Oct 2020 21:47:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFa-0003t2-Ar
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFa-00012g-88
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcFb-0003dk-Ht
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:59 +0000
X-Inumbo-ID: 89282886-7cc1-4960-8ec2-fdeaedc303cd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 89282886-7cc1-4960-8ec2-fdeaedc303cd;
	Fri, 30 Oct 2020 21:47:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Lpr0tPP6UGvNT1qypODvSb1nS5iFvxgNcMY2Sn0/f9c=; b=aViP3r3ZTTxyTS93cP651swRuY
	ODXoO0lJ8f1fh0vGYliu4W0+onJ6i3JBCUC5AQTBucfeHwcj9g6cjrTYngfc1q7WAAYnUQc03Wk0A
	Vg+TUy3kTQ5ra2vjvvOHraOHd6qsojtZeTRVzJT5c4TlSH+pYFygrtPHDzHU49f457bw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFa-0003t2-Ar
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFa-00012g-88
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:47:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qmp.py: add QMPProtocolError
Message-Id: <E1kYcFa-00012g-88@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:47:58 +0000

commit 84dcdf0887cdaaba7300442482c99e5064865a2d
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Fri Jul 10 01:22:10 2020 -0400
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 14 22:22:22 2020 +0200

    python/qmp.py: add QMPProtocolError
    
    In the case that we receive a reply but are unable to understand it,
    use this exception name to indicate that case.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710052220.3306-7-jsnow@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 python/qemu/qmp.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index 1ae36050a4..7935dababb 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -62,6 +62,12 @@ class QMPTimeoutError(QMPError):
     """
 
 
+class QMPProtocolError(QMPError):
+    """
+    QMP protocol error; unexpected response
+    """
+
+
 class QMPResponseError(QMPError):
     """
     Represents erroneous QMP monitor reply
@@ -266,6 +272,10 @@ class QEMUMonitorProtocol:
         ret = self.cmd(cmd, kwds)
         if 'error' in ret:
             raise QMPResponseError(ret)
+        if 'return' not in ret:
+            raise QMPProtocolError(
+                "'return' key not found in QMP response '{}'".format(str(ret))
+            )
         return cast(QMPReturnValue, ret['return'])
 
     def pull_event(self, wait=False):
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16384.40211 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFm-0003fR-Tf; Fri, 30 Oct 2020 21:48:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16384.40211; Fri, 30 Oct 2020 21:48:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFm-0003fH-QB; Fri, 30 Oct 2020 21:48:10 +0000
Received: by outflank-mailman (input) for mailman id 16384;
 Fri, 30 Oct 2020 21:48:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcFl-0003f6-I7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 659856cb-84be-4ff4-a42b-75a1ac19d664;
 Fri, 30 Oct 2020 21:48:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFk-0003tN-Ei
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFk-00013T-Ds
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcFl-0003f6-I7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:09 +0000
X-Inumbo-ID: 659856cb-84be-4ff4-a42b-75a1ac19d664
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 659856cb-84be-4ff4-a42b-75a1ac19d664;
	Fri, 30 Oct 2020 21:48:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ohp8YG7z4wfh/sbduu+XbY1UmVD1MPRvcFQ7ohMiMvE=; b=yUdCTMEAs/30czJySoy4+hMWQb
	5Mm4eoNXG4zLYAdw6LtUYIYW/Y/j94VNkZssrmk+JhkgB3g6c6yMwp3cSHUPXaAzkB8tHS4VPkTvv
	ZLy2X1/1eaqGHg5eZJG5c60ebmkHO3NARPWZBLIfVW8BGZhu3JCcJ9M0N3dIX2k8ocg8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFk-0003tN-Ei
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFk-00013T-Ds
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/python-next-20200714' into staging
Message-Id: <E1kYcFk-00013T-Ds@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:08 +0000

commit 673205379fb499d2b72f2985b47ec7114282f5fe
Merge: 3a9163af4e3dd61795a35d47b702e302f98f81d6 84dcdf0887cdaaba7300442482c99e5064865a2d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 13:04:27 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 13:04:27 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/python-next-20200714' into staging
    
    Python patches for 5.1
    
    - Reduce race conditions on QEMUMachine::shutdown()
    
     1. Remove the "bare except" pattern in the existing shutdown code,
        which can mask problems and make debugging difficult.
     2. Ensure that post-shutdown cleanup is always performed, even when
        graceful termination fails.
     3. Unify cleanup paths such that no matter how the VM is terminated,
        the same functions and steps are always taken to reset the object
        state.
     4. Rewrite shutdown() such that any error encountered when attempting
        a graceful shutdown will be raised as an AbnormalShutdown exception.
        The pythonic idiom is to allow the caller to decide if this is a
        problem or not.
    
    - Modify part of the python/qemu library to comply with:
    
      . mypy --strict
      . pylint
      . flake8
    
    - Script for the TCG Continuous Benchmarking project that uses
      callgrind to dissect QEMU execution into three main phases:
    
      . code generation
      . JIT execution
      . helpers execution
    
    CI jobs results:
    . https://cirrus-ci.com/build/5421349961203712
    . https://gitlab.com/philmd/qemu/-/pipelines/166556001
    . https://travis-ci.org/github/philmd/qemu/builds/708102347
    
    # gpg: Signature made Tue 14 Jul 2020 21:40:05 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/python-next-20200714:
      python/qmp.py: add QMPProtocolError
      python/qmp.py: add casts to JSON deserialization
      python/qmp.py: Do not return None from cmd_obj
      python/qmp.py: re-absorb MonitorResponseError
      iotests.py: use qemu.qmp type aliases
      python/qmp.py: Define common types
      python/machine.py: change default wait timeout to 3 seconds
      python/machine.py: re-add sigkill warning suppression
      python/machine.py: split shutdown into hard and soft flavors
      tests/acceptance: Don't test reboot on cubieboard
      tests/acceptance: wait() instead of shutdown() where appropriate
      python/machine.py: Make wait() call shutdown()
      python/machine.py: Add a configurable timeout to shutdown()
      python/machine.py: Prohibit multiple shutdown() calls
      python/machine.py: Perform early cleanup for wait() calls, too
      python/machine.py: Add _early_cleanup hook
      python/machine.py: Close QMP socket in cleanup
      python/machine.py: consolidate _post_shutdown()
      scripts/performance: Add dissect.py script
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 python/qemu/machine.py                   | 174 +++++++++++++++++++++++--------
 python/qemu/qmp.py                       |  67 +++++++++---
 scripts/performance/dissect.py           | 166 +++++++++++++++++++++++++++++
 scripts/render_block_graph.py            |   7 +-
 tests/acceptance/boot_linux_console.py   |  14 ++-
 tests/acceptance/linux_ssh_mips_malta.py |   2 +
 tests/qemu-iotests/iotests.py            |   9 +-
 7 files changed, 368 insertions(+), 71 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16385.40215 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFy-0003gr-07; Fri, 30 Oct 2020 21:48:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16385.40215; Fri, 30 Oct 2020 21:48:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcFx-0003gh-Sw; Fri, 30 Oct 2020 21:48:21 +0000
Received: by outflank-mailman (input) for mailman id 16385;
 Fri, 30 Oct 2020 21:48:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcFw-0003gV-8V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d81a650a-6435-4dce-a330-b67dad04bac9;
 Fri, 30 Oct 2020 21:48:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFu-0003tT-QH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcFu-00014T-PU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcFw-0003gV-8V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:20 +0000
X-Inumbo-ID: d81a650a-6435-4dce-a330-b67dad04bac9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d81a650a-6435-4dce-a330-b67dad04bac9;
	Fri, 30 Oct 2020 21:48:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LE0NLbZlCW3Vlzs7QA0skA7BoD61t6/6lrQdvHqT2nE=; b=y6E0O1345R48QXXlLqvNruGJRc
	p65riCxxmG8RK/z/YO3z3qyQF2/uBqzjXXJlV/0wO4dEzwAy5NvDMTw63LWumpzs4pva3oDTg3KS3
	lpvvmRgkOsQRC2JNaSheD4SXcKXVWaGa/OwmhX8Or/PEuL3+U071BV06VO4A7ZnZwNLA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFu-0003tT-QH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcFu-00014T-PU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/mips: Remove identical if/else branches
Message-Id: <E1kYcFu-00014T-PU@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:18 +0000

commit 9788e8c9b64e4cebb01c96bab2b0e4c2d4454041
Author:     Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
AuthorDate: Wed Jul 1 20:25:57 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    target/mips: Remove identical if/else branches
    
    Remove the segment:
    
          if (other_tc == other->current_tc) {
              tccause = other->CP0_Cause;
          } else {
              tccause = other->CP0_Cause;
          }
    
    Original contributor can't remember what was his intention.
    
    Fixes: 5a25ce9487 ("mips: Hook in more reg accesses via mttr/mftr")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1885718
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Message-Id: <20200701182559.28841-2-aleksandar.qemu.devel@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/cp0_helper.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c
index bbf12e4a97..de64add038 100644
--- a/target/mips/cp0_helper.c
+++ b/target/mips/cp0_helper.c
@@ -375,16 +375,9 @@ target_ulong helper_mftc0_entryhi(CPUMIPSState *env)
 target_ulong helper_mftc0_cause(CPUMIPSState *env)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
-    int32_t tccause;
     CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);
 
-    if (other_tc == other->current_tc) {
-        tccause = other->CP0_Cause;
-    } else {
-        tccause = other->CP0_Cause;
-    }
-
-    return tccause;
+    return other->CP0_Cause;
 }
 
 target_ulong helper_mftc0_status(CPUMIPSState *env)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16386.40218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcG7-0003ht-1c; Fri, 30 Oct 2020 21:48:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16386.40218; Fri, 30 Oct 2020 21:48:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcG6-0003hk-UR; Fri, 30 Oct 2020 21:48:30 +0000
Received: by outflank-mailman (input) for mailman id 16386;
 Fri, 30 Oct 2020 21:48:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcG5-0003hb-NK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9ca31740-d808-4b69-8e37-7b5d0efd76fe;
 Fri, 30 Oct 2020 21:48:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcG4-0003tb-U9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcG4-00014y-TK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcG5-0003hb-NK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:29 +0000
X-Inumbo-ID: 9ca31740-d808-4b69-8e37-7b5d0efd76fe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9ca31740-d808-4b69-8e37-7b5d0efd76fe;
	Fri, 30 Oct 2020 21:48:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F1ZIDE2kA529RT0nu1v+cPwKoizCqjZ4a0S+F9KBWco=; b=XBQ6eBI+pcMFAaWvTi/if4Ie1G
	Ka7+fe49Zpz21YljnDo4mysRESyQpVqGUGtQHNGatUCXB+lTbpjoNns5dMtBv18F030ENU0ILRe0t
	6zr8n0OL4GyClTQ7QqpZi6upptdqlcO7WILWGgL58AQlLWtzIbuQKCYhVASILuvl7Uzs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcG4-0003tb-U9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcG4-00014y-TK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/mips: Fix ADD.S FPU instruction
Message-Id: <E1kYcG4-00014y-TK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:28 +0000

commit dda97e385b2f0fa84267a497596fe79898d48123
Author:     Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
AuthorDate: Fri Jul 3 17:15:15 2020 +0100
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    target/mips: Fix ADD.S FPU instruction
    
    After merging latest QEMU upstream into our CHERI fork,
    I noticed that some of the FPU tests in our MIPS baremetal
    testsuite [*] started failing.
    It turns out commit 1ace099f2a accidentally changed add.s
    into a subtract.
    
    [*] https://github.com/CTSRD-CHERI/cheritest
    
    Fixes: 1ace099f2a ("target/mips: fpu: Demacro ADD.<D|S|PS>")
    Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200703161515.25966-1-Alexander.Richardson@cl.cam.ac.uk>
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c
index 7a3a61cab3..56beda49d8 100644
--- a/target/mips/fpu_helper.c
+++ b/target/mips/fpu_helper.c
@@ -1221,7 +1221,7 @@ uint32_t helper_float_add_s(CPUMIPSState *env,
 {
     uint32_t wt2;
 
-    wt2 = float32_sub(fst0, fst1, &env->active_fpu.fp_status);
+    wt2 = float32_add(fst0, fst1, &env->active_fpu.fp_status);
     update_fcr31(env, GETPC());
     return wt2;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16387.40222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGI-0003k0-2O; Fri, 30 Oct 2020 21:48:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16387.40222; Fri, 30 Oct 2020 21:48:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGH-0003js-Vh; Fri, 30 Oct 2020 21:48:41 +0000
Received: by outflank-mailman (input) for mailman id 16387;
 Fri, 30 Oct 2020 21:48:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcGG-0003jh-Bs
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f4543a88-9189-49be-ad05-2e0a2e9c2d6b;
 Fri, 30 Oct 2020 21:48:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGF-0003uC-1v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGF-00015c-0z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcGG-0003jh-Bs
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:40 +0000
X-Inumbo-ID: f4543a88-9189-49be-ad05-2e0a2e9c2d6b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f4543a88-9189-49be-ad05-2e0a2e9c2d6b;
	Fri, 30 Oct 2020 21:48:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VnXKA71k66b+n573fpqwunq5W7KwPeXortns5s2l7Ao=; b=bxK9W5AdZkhkuBJKbCyC5SyGq5
	uaJCDKCG6KtfM0N9U7OxSV8JipiTyyqKt2DnracAmLD9ycw6YDdbD82cq+qVQiR0E0xgk4DO3fkUo
	2ld2QF5ODOEtvh6hZ6rKKGXjYw6dyU5vosnQ/E2Y+7GZLbBdiFZKCLJmwGFnurKGx+aI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGF-0003uC-1v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGF-00015c-0z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
Message-Id: <E1kYcGF-00015c-0z@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:39 +0000

commit 15d983dee95edff1dc4c0bed71ce02fff877e766
Author:     Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
AuthorDate: Wed Jul 1 20:25:58 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 14 21:49:33 2020 +0200

    MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
    
    Huacai Chen and Jiaxun Yang step in as new energy [1].
    
    Aurelien Jarno comment [2]:
    
      It happens that I known Huacai Chen from the time he was
      upstreaming the Loongson 3 support to the kernel, I have been
      testing and reviewing his patches. I also know Jiaxun Yang from
      the #debian-mips IRC channel. I know that they are both very
      competent and have a good knowledge of the open source world.
      I therefore agree that they are good additions to maintain and/or
      review the MIPS part of QEMU.
    
    [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg718434.html
    [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg718738.html
    
    Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
    Message-Id: <20200701182559.28841-3-aleksandar.qemu.devel@gmail.com>
    PMD: [Split patch, added Aurelien's comment]
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
    Acked-by: Huacai Chen <chenhc@lemote.com>
---
 MAINTAINERS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8139f367..cdb5c6f171 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -222,6 +222,7 @@ F: disas/microblaze.c
 MIPS TCG CPUs
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: target/mips/
@@ -384,6 +385,7 @@ S: Maintained
 F: target/arm/kvm.c
 
 MIPS KVM CPUs
+M: Huacai Chen <chenhc@lemote.com>
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 S: Odd Fixes
 F: target/mips/kvm.c
@@ -2743,6 +2745,8 @@ F: disas/i386.c
 MIPS TCG target
 M: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
 R: Aurelien Jarno <aurelien@aurel32.net>
+R: Huacai Chen <chenhc@lemote.com>
+R: Jiaxun Yang <jiaxun.yang@flygoat.com>
 R: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
 S: Maintained
 F: tcg/mips/
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:48:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:48:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16388.40227 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGS-0003lD-4O; Fri, 30 Oct 2020 21:48:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16388.40227; Fri, 30 Oct 2020 21:48:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGS-0003l5-0r; Fri, 30 Oct 2020 21:48:52 +0000
Received: by outflank-mailman (input) for mailman id 16388;
 Fri, 30 Oct 2020 21:48:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcGQ-0003ks-2v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a8c1e2cf-9363-4904-988e-947468207390;
 Fri, 30 Oct 2020 21:48:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGP-0003uP-60
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGP-00016F-5A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcGQ-0003ks-2v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:50 +0000
X-Inumbo-ID: a8c1e2cf-9363-4904-988e-947468207390
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a8c1e2cf-9363-4904-988e-947468207390;
	Fri, 30 Oct 2020 21:48:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xIVNUfk0tpJAlh+JfDrblAQE/z2PrPFrgHYJ7ZzO078=; b=cvIi2/lhFX1UeDiMaYEnL+HhsM
	DfsyrQly2m87+ArCxuXf/jIlYa6xYroKxAoLdKZOR9Al8JBrkfWfke7zt08nnmcTISsY/Hus7n/92
	gK7xgvzScQOuso6+o4vrvO67do91vwQThOBToloO/eGoKUbHaaCIh0JSgq8aO7ZeS2/g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGP-0003uP-60
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGP-00016F-5A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-next-20200714' into staging
Message-Id: <E1kYcGP-00016F-5A@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:49 +0000

commit f1d5948669041d01d245ce42894fcec2eebbaab1
Merge: 673205379fb499d2b72f2985b47ec7114282f5fe 15d983dee95edff1dc4c0bed71ce02fff877e766
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 13:54:09 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 13:54:09 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/mips-next-20200714' into staging
    
    MIPS patches for 5.1
    
    - A pair of fixes,
    - Add Huacai Chen as MIPS KVM maintainer,
    - Add Jiaxun Yang as designated MIPS TCG reviewer.
    
    CI jobs results:
    . https://travis-ci.org/github/philmd/qemu/builds/708079271
    . https://gitlab.com/philmd/qemu/-/pipelines/166528104
    . https://cirrus-ci.com/build/6483996878045184
    
    # gpg: Signature made Tue 14 Jul 2020 20:59:58 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/mips-next-20200714:
      MAINTAINERS: Adjust MIPS maintainership (add Huacai Chen & Jiaxun Yang)
      target/mips: Fix ADD.S FPU instruction
      target/mips: Remove identical if/else branches
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS              | 4 ++++
 target/mips/cp0_helper.c | 9 +--------
 target/mips/fpu_helper.c | 2 +-
 3 files changed, 6 insertions(+), 9 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16389.40230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGc-0003ma-5Q; Fri, 30 Oct 2020 21:49:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16389.40230; Fri, 30 Oct 2020 21:49:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGc-0003mS-2J; Fri, 30 Oct 2020 21:49:02 +0000
Received: by outflank-mailman (input) for mailman id 16389;
 Fri, 30 Oct 2020 21:49:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcGa-0003mD-HV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 55550fdc-8d33-40e7-b9f9-a7cfeaacd65e;
 Fri, 30 Oct 2020 21:48:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGZ-0003uX-LG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGZ-00017r-KR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcGa-0003mD-HV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:00 +0000
X-Inumbo-ID: 55550fdc-8d33-40e7-b9f9-a7cfeaacd65e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 55550fdc-8d33-40e7-b9f9-a7cfeaacd65e;
	Fri, 30 Oct 2020 21:48:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7aAM7vYHuuO9/QA//3ekeDDui+8hkLL94B+ipuemPIQ=; b=3zusasKuNlzwhNWenfW3CNhTA1
	zjqhVbKQPhFKeUHPFABQi2hXVy2ZvXdREmobobRsiTAS0+23jGfQWvGKnWnl8EV85zGWfmOMsJo78
	niL/GOxXsXGEemhFMfUmzeSOAtxiUwYrn5zHyDB9/gqHkOsCtiMPcNxQ6f0kckQZbikY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGZ-0003uX-LG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGZ-00017r-KR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:48:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/devel: fix grammar in multi-thread-tcg
Message-Id: <E1kYcGZ-00017r-KR@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:48:59 +0000

commit 93154e767f1b886e6d258178821d400333042a22
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:12 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:39 2020 +0100

    docs/devel: fix grammar in multi-thread-tcg
    
    Review comment came just too late ;-)
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713200415.26214-9-alex.bennee@linaro.org>
---
 docs/devel/multi-thread-tcg.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst
index 42158b77c7..21483870db 100644
--- a/docs/devel/multi-thread-tcg.rst
+++ b/docs/devel/multi-thread-tcg.rst
@@ -107,7 +107,7 @@ including:
 
   - debugging operations (breakpoint insertion/removal)
   - some CPU helper functions
-  - linux-user spawning it's first thread
+  - linux-user spawning its first thread
 
 This is done with the async_safe_run_on_cpu() mechanism to ensure all
 vCPUs are quiescent when changes are being made to shared global
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16390.40235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGm-0003nn-8W; Fri, 30 Oct 2020 21:49:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16390.40235; Fri, 30 Oct 2020 21:49:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGm-0003ne-40; Fri, 30 Oct 2020 21:49:12 +0000
Received: by outflank-mailman (input) for mailman id 16390;
 Fri, 30 Oct 2020 21:49:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcGk-0003nV-Jb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9447e4d9-f2dd-49d0-8e56-97bd11e8a335;
 Fri, 30 Oct 2020 21:49:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGj-0003ux-Pk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGj-00018Y-O3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcGk-0003nV-Jb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:10 +0000
X-Inumbo-ID: 9447e4d9-f2dd-49d0-8e56-97bd11e8a335
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9447e4d9-f2dd-49d0-8e56-97bd11e8a335;
	Fri, 30 Oct 2020 21:49:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WJggPMegUZw/axyN9p3TtWySGxNqa7Kaaucc1yTiic0=; b=IAfe3AqQHtNEiA6212NmadxQ/p
	tj5R5zvLPRj2F26IhaBNoO+r5nlYGl4N29h6RPtJoQuFNZXcZMGDW2vlx8kU5fIMZA4DXhOXBtpNc
	dQitBkTpJnTZqVMHxCV6IveauKw/mcPhbitD+Wz0fVxaaI7b2Eg6pW3tQcqNrGiywMcQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGj-0003ux-Pk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGj-00018Y-O3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
Message-Id: <E1kYcGj-00018Y-O3@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:49:09 +0000

commit a77312e77c7d19702aa4e2ddefd20cae060a7fb9
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Jul 13 21:04:06 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
    
    The libssh problem only exists in Ubuntu 18.04 - we can enable it
    in 20.04 again.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713185237.9419-1-thuth@redhat.com>
    Message-Id: <20200713200415.26214-3-alex.bennee@linaro.org>
---
 tests/docker/dockerfiles/ubuntu2004.docker | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index f7aac840bf..8d10934a2a 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -65,9 +65,6 @@ RUN apt-get update && \
 RUN dpkg -l $PACKAGES | sort > /packages.txt
 ENV FEATURES clang tsan pyyaml sdl2
 
-# https://bugs.launchpad.net/qemu/+bug/1838763
-ENV QEMU_CONFIGURE_OPTS --disable-libssh
-
 # Apply patch https://reviews.llvm.org/D75820
 # This is required for TSan in clang-10 to compile with QEMU.
 RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16391.40238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGw-0003pX-8b; Fri, 30 Oct 2020 21:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16391.40238; Fri, 30 Oct 2020 21:49:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcGw-0003oy-5S; Fri, 30 Oct 2020 21:49:22 +0000
Received: by outflank-mailman (input) for mailman id 16391;
 Fri, 30 Oct 2020 21:49:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcGu-0003om-Uf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 71074729-b5af-425e-aaf7-d64b2ec1d0ee;
 Fri, 30 Oct 2020 21:49:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGt-0003v5-V6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcGt-000193-Se
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcGu-0003om-Uf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:20 +0000
X-Inumbo-ID: 71074729-b5af-425e-aaf7-d64b2ec1d0ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 71074729-b5af-425e-aaf7-d64b2ec1d0ee;
	Fri, 30 Oct 2020 21:49:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O8dVej5JyKAV9S7mVoxzse22M7oe4etVoyHlWg61H6I=; b=OxfOBW2cgECRnmEhLRwlQH58iu
	zRIGNtJKpT5qjKd3nWga5u86myINjWyd7Pxqk0HS8SUG+BtQFFDrLI3sE/PstvS+K3DZQ2nlkE9BS
	vnEfmpV6y54ro1stJjAHNCmyTDRsRBTs/BqihZoxodcXzMGJY9bEZoh+PkmXUWCAL+7k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGt-0003v5-V6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcGt-000193-Se
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docker.py: fix fetching of FROM layers
Message-Id: <E1kYcGt-000193-Se@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:49:19 +0000

commit f73e485285bc2da944a08e1dd20a30df93e23f25
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:07 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    docker.py: fix fetching of FROM layers
    
    This worked on a system that was already bootstrapped because the
    stage 2 images already existed even if they wouldn't be used. What we
    should have pulled down was the FROM line containers first because
    building on gitlab doesn't have the advantage of using our build
    system to build the pre-requisite bits.
    
    We still pull the image we want to build just in case we can use the
    cached data.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200713200415.26214-4-alex.bennee@linaro.org>
---
 tests/docker/docker.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 2d67bbd15a..c9f20d8d09 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -306,14 +306,18 @@ class Docker(object):
         checksum = _text_checksum(_dockerfile_preprocess(dockerfile))
 
         if registry is not None:
-            # see if we can fetch a cache copy, may fail...
-            pull_args = ["pull", "%s/%s" % (registry, tag)]
-            if self._do(pull_args, quiet=quiet) == 0:
+            sources = re.findall("FROM qemu\/(.*)", dockerfile)
+            # Fetch any cache layers we can, may fail
+            for s in sources:
+                pull_args = ["pull", "%s/qemu/%s" % (registry, s)]
+                if self._do(pull_args, quiet=quiet) != 0:
+                    registry = None
+                    break
+            # Make substitutions
+            if registry is not None:
                 dockerfile = dockerfile.replace("FROM qemu/",
                                                 "FROM %s/qemu/" %
                                                 (registry))
-            else:
-                registry = None
 
         tmp_df = tempfile.NamedTemporaryFile(mode="w+t",
                                              encoding='utf-8',
@@ -339,6 +343,8 @@ class Docker(object):
             build_args += ["--build-arg", "BUILDKIT_INLINE_CACHE=1"]
 
         if registry is not None:
+            pull_args = ["pull", "%s/%s" % (registry, tag)]
+            self._do(pull_args, quiet=quiet)
             cache = "%s/%s" % (registry, tag)
             build_args += ["--cache-from", cache]
         build_args += argv
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16392.40242 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcH7-0003qs-AX; Fri, 30 Oct 2020 21:49:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16392.40242; Fri, 30 Oct 2020 21:49:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcH7-0003qi-76; Fri, 30 Oct 2020 21:49:33 +0000
Received: by outflank-mailman (input) for mailman id 16392;
 Fri, 30 Oct 2020 21:49:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcH5-0003qX-Cd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 78e3d103-de7f-4150-9379-ca5adf55990e;
 Fri, 30 Oct 2020 21:49:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcH4-0003vH-2j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcH4-00019x-1v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcH5-0003qX-Cd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:31 +0000
X-Inumbo-ID: 78e3d103-de7f-4150-9379-ca5adf55990e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 78e3d103-de7f-4150-9379-ca5adf55990e;
	Fri, 30 Oct 2020 21:49:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PSxiR8AboFUWyHdPR/SvBrkwCUGt7cYCsZM9JNV0MVA=; b=4b7Tnkl/lH6AwipRS7JAJkyIs+
	Wbor9Uc9uDcMjoD6BGSju+ICEyrVue4AeKGkAiPULJt5nI4u8hCJRIcguLirjCeILY+CO6lps7SQj
	0oQvpF1Aw02Q+ANwpYjKQV/t7LEfasYIMHZnVRoUfU+ykbIxghHkeJa7dp2Rq617AOmc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcH4-0003vH-2j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcH4-00019x-1v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] gitlab-ci/containers: Add missing wildcard where we should look for changes
Message-Id: <E1kYcH4-00019x-1v@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:49:30 +0000

commit 6f60a240f60122fe2df402402311bf425f34e553
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Jul 13 20:22:35 2020 +0200
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    gitlab-ci/containers: Add missing wildcard where we should look for changes
    
    The tests/docker/* wildcard seems to only match the files that are directly
    in the tests/docker folder - but changes to the files in the directory
    tests/docker/dockerfiles are currently ignored. Seems like we need a
    separate entry to match the files in that folder. With this wildcard added,
    the stages now get re-run successfully when something in the dockerfiles
    has been changed.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200713182235.30379-1-thuth@redhat.com>
---
 .gitlab-ci.d/containers.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml
index f3c0ca4d61..8c89efeb6d 100644
--- a/.gitlab-ci.d/containers.yml
+++ b/.gitlab-ci.d/containers.yml
@@ -24,6 +24,7 @@
     - changes:
       - .gitlab-ci.d/containers.yml
       - tests/docker/*
+      - tests/docker/dockerfiles/*
     - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
     - if: '$CI_COMMIT_REF_NAME == "testing/next"'
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16393.40246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHH-0003si-DH; Fri, 30 Oct 2020 21:49:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16393.40246; Fri, 30 Oct 2020 21:49:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHH-0003sa-AG; Fri, 30 Oct 2020 21:49:43 +0000
Received: by outflank-mailman (input) for mailman id 16393;
 Fri, 30 Oct 2020 21:49:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcHF-0003sO-GM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e9b8e313-474c-4a01-ba77-b26500f773bc;
 Fri, 30 Oct 2020 21:49:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHE-0003w2-6f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHE-0001Ac-5d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcHF-0003sO-GM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:41 +0000
X-Inumbo-ID: e9b8e313-474c-4a01-ba77-b26500f773bc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e9b8e313-474c-4a01-ba77-b26500f773bc;
	Fri, 30 Oct 2020 21:49:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M9u5IIVP2Wd4K0VEpberN28oINXUKKuwt2h+RDVBH+U=; b=1A1ObGnNB8Hr3vaWig1n9S0GU/
	UFTV3eryIqLAxvDOTX4Fmag2ubVAdQnPmlCpkbO9Cbg0i/OdIwvy9A6gW+ySrWdbmKZRRQE+i/cD0
	BDn6EZJNbLlVkT9m1YAs6NxwFYlUuISkz42WFeRqFp87wiZEfGP3pnqP+W4SNlLmkzco=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHE-0003w2-6f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHE-0001Ac-5d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fpu/softfloat: fix up float16 nan recognition
Message-Id: <E1kYcHE-0001Ac-5d@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:49:40 +0000

commit 8cdf91243f7515f424b78d5469d64c34ee534783
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Mon Jul 13 21:04:08 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    fpu/softfloat: fix up float16 nan recognition
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200712234521.3972-2-zhiwei_liu@c-sky.com>
    Message-Id: <20200713200415.26214-5-alex.bennee@linaro.org>
---
 fpu/softfloat-specialize.inc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fpu/softfloat-specialize.inc.c b/fpu/softfloat-specialize.inc.c
index 44f5b661f8..034d18199c 100644
--- a/fpu/softfloat-specialize.inc.c
+++ b/fpu/softfloat-specialize.inc.c
@@ -254,7 +254,7 @@ bool float16_is_quiet_nan(float16 a_, float_status *status)
     if (snan_bit_is_one(status)) {
         return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
     } else {
-        return ((a & ~0x8000) >= 0x7C80);
+        return ((a >> 9) & 0x3F) == 0x3F;
     }
 #endif
 }
@@ -271,7 +271,7 @@ bool float16_is_signaling_nan(float16 a_, float_status *status)
 #else
     uint16_t a = float16_val(a_);
     if (snan_bit_is_one(status)) {
-        return ((a & ~0x8000) >= 0x7C80);
+        return ((a >> 9) & 0x3F) == 0x3F;
     } else {
         return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:49:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:49:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16394.40250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHQ-0003tp-Ey; Fri, 30 Oct 2020 21:49:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16394.40250; Fri, 30 Oct 2020 21:49:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHQ-0003th-Bq; Fri, 30 Oct 2020 21:49:52 +0000
Received: by outflank-mailman (input) for mailman id 16394;
 Fri, 30 Oct 2020 21:49:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcHP-0003tY-5E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e5b70e9c-cf04-4d7e-b44a-76bee0f1bdba;
 Fri, 30 Oct 2020 21:49:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHO-0003wA-AX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHO-0001BT-9o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcHP-0003tY-5E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:51 +0000
X-Inumbo-ID: e5b70e9c-cf04-4d7e-b44a-76bee0f1bdba
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e5b70e9c-cf04-4d7e-b44a-76bee0f1bdba;
	Fri, 30 Oct 2020 21:49:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CuUXDcHaVDXaPE9pUTkqZBLHDbvj7JITYvlVgTHHOVM=; b=Bn1vzhnWZ6cZWTIK1qpHPVfc4Z
	hPsZ79n089dYAk+MzCnk8xwKm4r3AUCab7yq0xFXF/EgnhZABxDgUbY3DOfexIoxScNyArwyIjaxm
	1fCr7U7At6GFHDlQMuVIlHetCRGgvuyFecykmDeFbjB0EfyO5RKY5FctzK7q21Un4UUU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHO-0003wA-AX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHO-0001BT-9o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:49:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/plugins: don't unconditionally add -Wpsabi
Message-Id: <E1kYcHO-0001BT-9o@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:49:50 +0000

commit 777dddc501fa31bc9afff6de5e55dbf799e1703b
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:09 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    tests/plugins: don't unconditionally add -Wpsabi
    
    Not all compilers support the -Wpsabi (clang-9 in my case). To handle
    this gracefully we pare back the shared build machinery so the
    Makefile is relatively "standalone". We still take advantage of
    config-host.mak as configure has done a bunch of probing for us but
    that is it.
    
    Fixes: bac8d222a
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200713200415.26214-6-alex.bennee@linaro.org>
---
 configure             |  3 +++
 tests/plugin/Makefile | 22 ++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index bc3b9ad931..b751c853f5 100755
--- a/configure
+++ b/configure
@@ -7115,6 +7115,9 @@ echo "GIT_UPDATE=$git_update" >> $config_host_mak
 
 echo "ARCH=$ARCH" >> $config_host_mak
 
+echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
+echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak
+
 if test "$default_devices" = "yes" ; then
   echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak
 else
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
index 3a50451428..e9348fde4a 100644
--- a/tests/plugin/Makefile
+++ b/tests/plugin/Makefile
@@ -1,9 +1,16 @@
+# -*- Mode: makefile -*-
+#
+# This Makefile example is fairly independent from the main makefile
+# so users can take and adapt it for their build. We only really
+# include config-host.mak so we don't have to repeat probing for
+# cflags that the main configure has already done for us.
+#
+
 BUILD_DIR := $(CURDIR)/../..
 
 include $(BUILD_DIR)/config-host.mak
-include $(SRC_PATH)/rules.mak
 
-$(call set-vpath, $(SRC_PATH)/tests/plugin)
+VPATH += $(SRC_PATH)/tests/plugin
 
 NAMES :=
 NAMES += bb
@@ -17,11 +24,18 @@ NAMES += lockstep
 
 SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
-QEMU_CFLAGS += -fPIC -Wpsabi
-QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu
+# The main QEMU uses Glib extensively so it's perfectly fine to use it
+# in plugins (which many example do).
+CFLAGS = $(GLIB_CFLAGS)
+CFLAGS += -fPIC
+CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
+CFLAGS += -I$(SRC_PATH)/include/qemu
 
 all: $(SONAMES)
 
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
 lib%.so: %.o
 	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16395.40255 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHb-000493-HB; Fri, 30 Oct 2020 21:50:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16395.40255; Fri, 30 Oct 2020 21:50:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHb-00048v-DW; Fri, 30 Oct 2020 21:50:03 +0000
Received: by outflank-mailman (input) for mailman id 16395;
 Fri, 30 Oct 2020 21:50:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcHa-00042v-DL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8231a3dd-79d3-440b-803c-ea16596cf404;
 Fri, 30 Oct 2020 21:50:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHY-0003wJ-EX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHY-0001C1-Dk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcHa-00042v-DL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:02 +0000
X-Inumbo-ID: 8231a3dd-79d3-440b-803c-ea16596cf404
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8231a3dd-79d3-440b-803c-ea16596cf404;
	Fri, 30 Oct 2020 21:50:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vqJyl/L47eCgO4cH2wSjJtu5w5Tnp70HnjpVFusTVqg=; b=pyWLaN0fqoRCwP7n8/ARYqDKl1
	hn8ArRhI9jrNlCmSul0nGSe4Ro0Uf4XyXbPiwzaLxBFEFWLkkAR4KuAERrGfr+pYwMRaAJXiZdk2c
	oyiQ6s8lKh/KlJNQNcdmUiR05eO9nnayf0QuUTKV11/LBCpqnrq5wxYcNGBovwzJP0wM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHY-0003wJ-EX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHY-0001C1-Dk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] cputlb: ensure we save the IOTLB data in case of reset
Message-Id: <E1kYcHY-0001C1-Dk@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:00 +0000

commit 2f3a57ee47df970d19fa5b324d44aab857d43517
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:10 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    cputlb: ensure we save the IOTLB data in case of reset
    
    Any write to a device might cause a re-arrangement of memory
    triggering a TLB flush and potential re-size of the TLB invalidating
    previous entries. This would cause users of qemu_plugin_get_hwaddr()
    to see the warning:
    
      invalid use of qemu_plugin_get_hwaddr
    
    because of the failed tlb_lookup which should always succeed. To
    prevent this we save the IOTLB data in case it is later needed by a
    plugin doing a lookup.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200713200415.26214-7-alex.bennee@linaro.org>
---
 accel/tcg/cputlb.c      | 38 +++++++++++++++++++++++++++++++++++---
 include/hw/core/cpu.h   | 16 ++++++++++++++++
 include/qemu/typedefs.h |  1 +
 3 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 1e815357c7..d370aedb47 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1073,6 +1073,24 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
     return val;
 }
 
+/*
+ * Save a potentially trashed IOTLB entry for later lookup by plugin.
+ *
+ * We also need to track the thread storage address because the RCU
+ * cleanup that runs when we leave the critical region (the current
+ * execution) is actually in a different thread.
+ */
+static void save_iotlb_data(CPUState *cs, hwaddr addr,
+                            MemoryRegionSection *section, hwaddr mr_offset)
+{
+#ifdef CONFIG_PLUGIN
+    SavedIOTLB *saved = &cs->saved_iotlb;
+    saved->addr = addr;
+    saved->section = section;
+    saved->mr_offset = mr_offset;
+#endif
+}
+
 static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
                       int mmu_idx, uint64_t val, target_ulong addr,
                       uintptr_t retaddr, MemOp op)
@@ -1092,6 +1110,12 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
     }
     cpu->mem_io_pc = retaddr;
 
+    /*
+     * The memory_region_dispatch may trigger a flush/resize
+     * so for plugins we save the iotlb_data just in case.
+     */
+    save_iotlb_data(cpu, iotlbentry->addr, section, mr_offset);
+
     if (mr->global_locking && !qemu_mutex_iothread_locked()) {
         qemu_mutex_lock_iothread();
         locked = true;
@@ -1381,8 +1405,11 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
  * in the softmmu lookup code (or helper). We don't handle re-fills or
  * checking the victim table. This is purely informational.
  *
- * This should never fail as the memory access being instrumented
- * should have just filled the TLB.
+ * This almost never fails as the memory access being instrumented
+ * should have just filled the TLB. The one corner case is io_writex
+ * which can cause TLB flushes and potential resizing of the TLBs
+ * loosing the information we need. In those cases we need to recover
+ * data from a copy of the io_tlb entry.
  */
 
 bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
@@ -1406,8 +1433,13 @@ bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
             data->v.ram.hostaddr = addr + tlbe->addend;
         }
         return true;
+    } else {
+        SavedIOTLB *saved = &cpu->saved_iotlb;
+        data->is_io = true;
+        data->v.io.section = saved->section;
+        data->v.io.offset = saved->mr_offset;
+        return true;
     }
-    return false;
 }
 
 #endif
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5542577d2b..8f145733ce 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -259,6 +259,18 @@ struct CPUWatchpoint {
     QTAILQ_ENTRY(CPUWatchpoint) entry;
 };
 
+#ifdef CONFIG_PLUGIN
+/*
+ * For plugins we sometime need to save the resolved iotlb data before
+ * the memory regions get moved around  by io_writex.
+ */
+typedef struct SavedIOTLB {
+    hwaddr addr;
+    MemoryRegionSection *section;
+    hwaddr mr_offset;
+} SavedIOTLB;
+#endif
+
 struct KVMState;
 struct kvm_run;
 
@@ -417,7 +429,11 @@ struct CPUState {
 
     DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX);
 
+#ifdef CONFIG_PLUGIN
     GArray *plugin_mem_cbs;
+    /* saved iotlb data from io_writex */
+    SavedIOTLB saved_iotlb;
+#endif
 
     /* TODO Move common fields from CPUArchState here. */
     int cpu_index;
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 15f5047bf1..427027a970 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -116,6 +116,7 @@ typedef struct QObject QObject;
 typedef struct QString QString;
 typedef struct RAMBlock RAMBlock;
 typedef struct Range Range;
+typedef struct SavedIOTLB SavedIOTLB;
 typedef struct SHPCDevice SHPCDevice;
 typedef struct SSIBus SSIBus;
 typedef struct VirtIODevice VirtIODevice;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16396.40258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHk-0004bS-I0; Fri, 30 Oct 2020 21:50:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16396.40258; Fri, 30 Oct 2020 21:50:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHk-0004bK-Ez; Fri, 30 Oct 2020 21:50:12 +0000
Received: by outflank-mailman (input) for mailman id 16396;
 Fri, 30 Oct 2020 21:50:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcHj-0004bE-NG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b9a5f657-5c76-44bb-9fe6-90512ed369f8;
 Fri, 30 Oct 2020 21:50:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHi-0003wh-JL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHi-0001Cn-Ha
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcHj-0004bE-NG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:11 +0000
X-Inumbo-ID: b9a5f657-5c76-44bb-9fe6-90512ed369f8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b9a5f657-5c76-44bb-9fe6-90512ed369f8;
	Fri, 30 Oct 2020 21:50:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T6DIPCKKByz8KSBCnLsyv4NjoY54fuo8ZvXiwkd6NYo=; b=p4yBvMSsd8r1r9oxszF9jz62S6
	4spAeHK0hr/xLkTozDMLvxpw3GldoDM+vCmh3mTg4Vr642XGLhv0O5PZo4hneT8R3Z6RWAeW6GMkf
	KMMvCcisTmvMu2CahWZRazpiNqapZRmGas9vt+SljCQgNXklTrTD7GMnBpZsIdah/wEE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHi-0003wh-JL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHi-0001Cn-Ha
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] plugins: expand the bb plugin to be thread safe and track per-cpu
Message-Id: <E1kYcHi-0001Cn-Ha@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:10 +0000

commit 406b53c9ca669b8551d4cde27f2cde03135d0d1d
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 13 21:04:11 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:52:43 2020 +0100

    plugins: expand the bb plugin to be thread safe and track per-cpu
    
    While there isn't any easy way to make the inline counts thread safe
    we can ensure the callback based ones are. While we are at it we can
    reduce introduce a new option ("idle") to dump a report of the current
    bb and insn count each time a vCPU enters the idle state.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Robert Foley <robert.foley@linaro.org>
    Cc: Dave Bort <dbort@dbort.com>
    
    Message-Id: <20200713200415.26214-8-alex.bennee@linaro.org>
---
 tests/plugin/bb.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 84 insertions(+), 13 deletions(-)

diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c
index df19fd359d..e4cc7fdd6e 100644
--- a/tests/plugin/bb.c
+++ b/tests/plugin/bb.c
@@ -16,24 +16,67 @@
 
 QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
 
-static uint64_t bb_count;
-static uint64_t insn_count;
+typedef struct {
+    GMutex lock;
+    int index;
+    uint64_t bb_count;
+    uint64_t insn_count;
+} CPUCount;
+
+/* Used by the inline & linux-user counts */
 static bool do_inline;
+static CPUCount inline_count;
+
+/* Dump running CPU total on idle? */
+static bool idle_report;
+static GPtrArray *counts;
+static int max_cpus;
+
+static void gen_one_cpu_report(CPUCount *count, GString *report)
+{
+    if (count->bb_count) {
+        g_string_append_printf(report, "CPU%d: "
+                               "bb's: %" PRIu64", insns: %" PRIu64 "\n",
+                               count->index,
+                               count->bb_count, count->insn_count);
+    }
+}
 
 static void plugin_exit(qemu_plugin_id_t id, void *p)
 {
-    g_autofree gchar *out = g_strdup_printf(
-        "bb's: %" PRIu64", insns: %" PRIu64 "\n",
-        bb_count, insn_count);
-    qemu_plugin_outs(out);
+    g_autoptr(GString) report = g_string_new("");
+
+    if (do_inline || !max_cpus) {
+        g_string_printf(report, "bb's: %" PRIu64", insns: %" PRIu64 "\n",
+                        inline_count.bb_count, inline_count.insn_count);
+    } else {
+        g_ptr_array_foreach(counts, (GFunc) gen_one_cpu_report, report);
+    }
+    qemu_plugin_outs(report->str);
+}
+
+static void vcpu_idle(qemu_plugin_id_t id, unsigned int cpu_index)
+{
+    CPUCount *count = g_ptr_array_index(counts, cpu_index);
+    g_autoptr(GString) report = g_string_new("");
+    gen_one_cpu_report(count, report);
+
+    if (report->len > 0) {
+        g_string_prepend(report, "Idling ");
+        qemu_plugin_outs(report->str);
+    }
 }
 
 static void vcpu_tb_exec(unsigned int cpu_index, void *udata)
 {
-    unsigned long n_insns = (unsigned long)udata;
+    CPUCount *count = max_cpus ?
+        g_ptr_array_index(counts, cpu_index) : &inline_count;
 
-    insn_count += n_insns;
-    bb_count++;
+    unsigned long n_insns = (unsigned long)udata;
+    g_mutex_lock(&count->lock);
+    count->insn_count += n_insns;
+    count->bb_count++;
+    g_mutex_unlock(&count->lock);
 }
 
 static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
@@ -42,9 +85,10 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
 
     if (do_inline) {
         qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64,
-                                                 &bb_count, 1);
+                                                 &inline_count.bb_count, 1);
         qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64,
-                                                 &insn_count, n_insns);
+                                                 &inline_count.insn_count,
+                                                 n_insns);
     } else {
         qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec,
                                              QEMU_PLUGIN_CB_NO_REGS,
@@ -56,8 +100,35 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
                                            const qemu_info_t *info,
                                            int argc, char **argv)
 {
-    if (argc && strcmp(argv[0], "inline") == 0) {
-        do_inline = true;
+    int i;
+
+    for (i = 0; i < argc; i++) {
+        char *opt = argv[i];
+        if (g_strcmp0(opt, "inline") == 0) {
+            do_inline = true;
+        } else if (g_strcmp0(opt, "idle") == 0) {
+            idle_report = true;
+        } else {
+            fprintf(stderr, "option parsing failed: %s\n", opt);
+            return -1;
+        }
+    }
+
+    if (info->system_emulation && !do_inline) {
+        max_cpus = info->system.max_vcpus;
+        counts = g_ptr_array_new();
+        for (i = 0; i < max_cpus; i++) {
+            CPUCount *count = g_new0(CPUCount, 1);
+            g_mutex_init(&count->lock);
+            count->index = i;
+            g_ptr_array_add(counts, count);
+        }
+    } else if (!do_inline) {
+        g_mutex_init(&inline_count.lock);
+    }
+
+    if (idle_report) {
+        qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle);
     }
 
     qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16397.40262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHu-0004cu-JQ; Fri, 30 Oct 2020 21:50:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16397.40262; Fri, 30 Oct 2020 21:50:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcHu-0004cm-GU; Fri, 30 Oct 2020 21:50:22 +0000
Received: by outflank-mailman (input) for mailman id 16397;
 Fri, 30 Oct 2020 21:50:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcHt-0004cc-JW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5e4a1835-4e86-45b5-a9cf-2f3b6b47fd4f;
 Fri, 30 Oct 2020 21:50:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHs-0003wo-Mw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcHs-0001DF-MA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcHt-0004cc-JW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:21 +0000
X-Inumbo-ID: 5e4a1835-4e86-45b5-a9cf-2f3b6b47fd4f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5e4a1835-4e86-45b5-a9cf-2f3b6b47fd4f;
	Fri, 30 Oct 2020 21:50:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0RSMWB0O3aTJj0SYuY01njB+zYRLDWg1ncHzaFjNLfM=; b=XaCQmiVn8q1GyUDgh+SeB90SEy
	gvRmofyIZs5OLJuc+JPKJ0PWt8kNEBGpEC/B0tDLbqs38wnKriopRzRmQV6iTaL8AIQlVB5GCPax9
	8/kNdoEcIwU7tHwJR6EQXrCOdZPn8pEako2iW7Syg+61bI3AU/rgqk2FrNrnfkn+KMOE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHs-0003wo-Mw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcHs-0001DF-MA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] .travis.yml: skip ppc64abi32-linux-user with plugins
Message-Id: <E1kYcHs-0001DF-MA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:20 +0000

commit 0571d280d057b851e3bb3ea7c350b86c950aea6e
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Tue Jul 14 18:55:16 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Wed Jul 15 11:57:17 2020 +0100

    .travis.yml: skip ppc64abi32-linux-user with plugins
    
    We actually see failures on threadcount running without plugins:
    
      retry.py -n 1000 -c -- \
        ./ppc64abi32-linux-user/qemu-ppc64abi32 \
        ./tests/tcg/ppc64abi32-linux-user/threadcount
    
    which reports:
    
      0: 978 times (97.80%), avg time 0.270 (0.01 varience/0.08 deviation)
      -6: 21 times (2.10%), avg time 0.336 (0.01 varience/0.12 deviation)
      -11: 1 times (0.10%), avg time 0.502 (0.00 varience/0.00 deviation)
      Ran command 1000 times, 978 passes
    
    But when running with plugins we hit the failure a lot more often:
    
      0: 91 times (91.00%), avg time 0.302 (0.04 varience/0.19 deviation)
      -11: 9 times (9.00%), avg time 0.558 (0.01 varience/0.11 deviation)
      Ran command 100 times, 91 passes
    
    The crash occurs in guest code which is the same in both pass and fail
    cases. However we see various messages reported on the console about
    corrupted memory lists which seems to imply the guest memory allocation
    is corrupted. This lines up with the seg fault being in the guest
    __libc_free function. So we think this is a guest bug which is
    exacerbated by various modes of translation. If anyone has access to
    real hardware to soak test the test case we could prove this properly.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Acked-by: David Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200714175516.5475-1-alex.bennee@linaro.org>
---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index ab429500fc..6695c0620f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -350,9 +350,10 @@ jobs:
     # Run check-tcg against linux-user (with plugins)
     # we skip sparc64-linux-user until it has been fixed somewhat
     # we skip cris-linux-user as it doesn't use the common run loop
+    # we skip ppc64abi32-linux-user as it seems to have a broken libc
     - name: "GCC plugins check-tcg (user)"
       env:
-        - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user"
+        - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user,ppc64abi32-linux-user"
         - TEST_BUILD_CMD="make build-tcg"
         - TEST_CMD="make check-tcg"
         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16398.40266 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcI4-0004eA-L1; Fri, 30 Oct 2020 21:50:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16398.40266; Fri, 30 Oct 2020 21:50:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcI4-0004e2-I0; Fri, 30 Oct 2020 21:50:32 +0000
Received: by outflank-mailman (input) for mailman id 16398;
 Fri, 30 Oct 2020 21:50:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcI3-0004dv-Tw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7e46eb17-00c7-4ca6-82f2-71ed4dbefd46;
 Fri, 30 Oct 2020 21:50:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcI2-0003x4-Qt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcI2-0001Dv-Q9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcI3-0004dv-Tw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:31 +0000
X-Inumbo-ID: 7e46eb17-00c7-4ca6-82f2-71ed4dbefd46
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7e46eb17-00c7-4ca6-82f2-71ed4dbefd46;
	Fri, 30 Oct 2020 21:50:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fpFv6G8RoHwbiQJ+NmyC1NOrHL5Yoqz90ZAKPnNO9K4=; b=yqmhBtXcdCOKZuGwRcSX9CkPZK
	kViu91axQRXxVPV+VokPHa2zoaD+4v+yGKMxrPf+C6pUSaL7yoNBkAi0kQxKQlUPW6tPCZFivMcQV
	hU7l5g2huBlKjF1h+ryrUSa2r+nUgTrHZXL4pkvD7DiNRBQsXXnl+jRBGDtTrtWiM8Yo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcI2-0003x4-Qt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcI2-0001Dv-Q9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stsquad/tags/pull-misc-for-rc0-150720-3' into staging
Message-Id: <E1kYcI2-0001Dv-Q9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:30 +0000

commit dfcade7cefb433f8cf46788b771a085a625286d8
Merge: f1d5948669041d01d245ce42894fcec2eebbaab1 0571d280d057b851e3bb3ea7c350b86c950aea6e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 17:16:39 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 17:16:39 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-misc-for-rc0-150720-3' into staging
    
    Final fixes for 5.1-rc0
    
      - minor documentation nit
      - docker.py bootstrap fixes
      - tweak containers.yml wildcards
      - fix float16 nan detection
      - conditional use of -Wpsabi
      - fix missing iotlb data for plugins
      - proper locking for helper based bb count
      - drop ppc64abi32 from the plugin check-tcg test
    
    # gpg: Signature made Wed 15 Jul 2020 11:59:08 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-misc-for-rc0-150720-3:
      .travis.yml: skip ppc64abi32-linux-user with plugins
      plugins: expand the bb plugin to be thread safe and track per-cpu
      cputlb: ensure we save the IOTLB data in case of reset
      tests/plugins: don't unconditionally add -Wpsabi
      fpu/softfloat: fix up float16 nan recognition
      gitlab-ci/containers: Add missing wildcard where we should look for changes
      docker.py: fix fetching of FROM layers
      tests/docker: Remove the libssh workaround from the ubuntu 20.04 image
      docs/devel: fix grammar in multi-thread-tcg
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.d/containers.yml                |  1 +
 .travis.yml                                |  3 +-
 accel/tcg/cputlb.c                         | 38 +++++++++++-
 configure                                  |  3 +
 docs/devel/multi-thread-tcg.rst            |  2 +-
 fpu/softfloat-specialize.inc.c             |  4 +-
 include/hw/core/cpu.h                      | 16 +++++
 include/qemu/typedefs.h                    |  1 +
 tests/docker/docker.py                     | 16 +++--
 tests/docker/dockerfiles/ubuntu2004.docker |  3 -
 tests/plugin/Makefile                      | 22 +++++--
 tests/plugin/bb.c                          | 97 ++++++++++++++++++++++++++----
 12 files changed, 174 insertions(+), 32 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16399.40270 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIE-0004gJ-Nt; Fri, 30 Oct 2020 21:50:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16399.40270; Fri, 30 Oct 2020 21:50:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIE-0004gB-Kv; Fri, 30 Oct 2020 21:50:42 +0000
Received: by outflank-mailman (input) for mailman id 16399;
 Fri, 30 Oct 2020 21:50:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcID-0004g2-MO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c02909d6-e97e-435a-ba99-ea034fc90654;
 Fri, 30 Oct 2020 21:50:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIC-0003xf-VX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIC-0001Ev-Te
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcID-0004g2-MO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:41 +0000
X-Inumbo-ID: c02909d6-e97e-435a-ba99-ea034fc90654
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c02909d6-e97e-435a-ba99-ea034fc90654;
	Fri, 30 Oct 2020 21:50:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yzUqcR2Fg9Rb2zuttp2IMUgt6LSeBMupjGvvI6STMLQ=; b=EXrRymejRuWPD0YdEeWhGqkjbp
	2aquEUQIv9CfXHwTwCceatvQEU+3wz+loUZR0/xrcBZEPHjThBtJNSPGWBya2Uc8X8r62zSuapNQy
	9s5ly8TXqdR3BKibH903bAptDBtGRFxkdxu+UQ8BDAMbwhiIu4E6WpQYp/crrb0XPztM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIC-0003xf-VX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIC-0001Ev-Te
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update version for v5.1.0-rc0 release
Message-Id: <E1kYcIC-0001Ev-Te@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:40 +0000

commit 8746309137ba470d1b2e8f5ce86ac228625db940
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 15 19:08:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 15 19:08:07 2020 +0100

    Update version for v5.1.0-rc0 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index a480698ce5..e427b98203 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.50
+5.0.90
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:50:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:50:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16400.40274 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIO-0004hb-PZ; Fri, 30 Oct 2020 21:50:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16400.40274; Fri, 30 Oct 2020 21:50:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIO-0004hS-MT; Fri, 30 Oct 2020 21:50:52 +0000
Received: by outflank-mailman (input) for mailman id 16400;
 Fri, 30 Oct 2020 21:50:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcIO-0004hJ-3U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 299112d3-632f-43d1-84a7-a38fd9978b7a;
 Fri, 30 Oct 2020 21:50:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIN-0003xo-CY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIN-0001GJ-Bp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcIO-0004hJ-3U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:52 +0000
X-Inumbo-ID: 299112d3-632f-43d1-84a7-a38fd9978b7a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 299112d3-632f-43d1-84a7-a38fd9978b7a;
	Fri, 30 Oct 2020 21:50:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GM07CT98pdTOoVwPfsIkiCzbjnYaNlLo2iMpPM3KkPY=; b=hSRiDWTV1x9W7HD0NSZTh5u1zz
	GHA7ra/yghGHc4JN8osgsxxZjVf7P6VePgQGiV23cOYNfZXv2zjbwF4k4M0BBlQv8tMv1i+DOt6fA
	SAO1pUA3o4pbYYvCLOk7zVWovrRZhcntATg4OCjxChb73xvXFlD2vrq2nKDeJeFvA0aI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIN-0003xo-CY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIN-0001GJ-Bp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:50:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-net: fix removal of failover device
Message-Id: <E1kYcIN-0001GJ-Bp@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:50:51 +0000

commit 650181007a027034620995eb3d5044cea1ec9b49
Author:     Juan Quintela <quintela@redhat.com>
AuthorDate: Fri Jul 3 13:48:13 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    virtio-net: fix removal of failover device
    
    If you have a networking device and its virtio failover device, and
    you remove them in this order:
    - virtio device
    - the real device
    
    You get qemu crash.
    See bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1820120
    
    Bug exist on qemu 4.2 and 5.0.
    But in 5.0 don't shows because commit
    77b06bba62034a87cc61a9c8de1309ae3e527d97
    
    somehow papers over it.
    
    CC: Jason Wang <jasowang@redhat.com>
    CC: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Laurent Vivier <lvivier@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 10cc958396..4895af1cbe 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3416,6 +3416,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
     g_free(n->vlans);
 
     if (n->failover) {
+        device_listener_unregister(&n->primary_listener);
         g_free(n->primary_device_id);
         g_free(n->standby_id);
         qobject_unref(n->primary_device_dict);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16401.40278 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIZ-0004ip-Qu; Fri, 30 Oct 2020 21:51:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16401.40278; Fri, 30 Oct 2020 21:51:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIZ-0004ih-O1; Fri, 30 Oct 2020 21:51:03 +0000
Received: by outflank-mailman (input) for mailman id 16401;
 Fri, 30 Oct 2020 21:51:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcIY-0004ia-NF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c57321b4-0bbc-4d48-935d-6f1398a0e0d8;
 Fri, 30 Oct 2020 21:51:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIX-0003yC-GE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIX-0001Gl-FK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcIY-0004ia-NF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:02 +0000
X-Inumbo-ID: c57321b4-0bbc-4d48-935d-6f1398a0e0d8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c57321b4-0bbc-4d48-935d-6f1398a0e0d8;
	Fri, 30 Oct 2020 21:51:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u0qgchfyoiqWgG3NEPtVZX6cNoroxDHaJa2qeo0Bkbs=; b=qX3THqEdX9v3kA3V0G5kZ6DbPu
	YFJfnczjarG2c1OmNBwg/x4fmOgQiY9LD+Cng26wgmuVJE/T6S7sEHNKSU3Kmdy1iqPys0DhKcDwn
	9V52S8qevwrqoCZCsAr7ea3GgWKvhWvSD52Hdus2BAgA4uC8H8OVtdkmED6a2TDtBcSM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIX-0003yC-GE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIX-0001Gl-FK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/net: Added CSO for IPv6
Message-Id: <E1kYcIX-0001Gl-FK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:01 +0000

commit 9a8d949245a0a3f90842d1611f56df6ae705560d
Author:     Andrew <andrew@daynix.com>
AuthorDate: Mon Jun 29 04:17:59 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    hw/net: Added CSO for IPv6
    
    Added fix for checksum offload for IPv6 if a backend doesn't
    have a virtual header.
    This patch is a part of IPv6 fragmentation.
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 162f802dd7..331c73cfc0 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -468,8 +468,8 @@ static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
     /* num of iovec without vhdr */
     uint32_t iov_len = pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1;
     uint16_t csl;
-    struct ip_header *iphdr;
     size_t csum_offset = pkt->virt_hdr.csum_start + pkt->virt_hdr.csum_offset;
+    uint16_t l3_proto = eth_get_l3_proto(iov, 1, iov->iov_len);
 
     /* Put zero to checksum field */
     iov_from_buf(iov, iov_len, csum_offset, &csum, sizeof csum);
@@ -477,9 +477,18 @@ static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
     /* Calculate L4 TCP/UDP checksum */
     csl = pkt->payload_len;
 
+    csum_cntr = 0;
+    cso = 0;
     /* add pseudo header to csum */
-    iphdr = pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base;
-    csum_cntr = eth_calc_ip4_pseudo_hdr_csum(iphdr, csl, &cso);
+    if (l3_proto == ETH_P_IP) {
+        csum_cntr = eth_calc_ip4_pseudo_hdr_csum(
+                pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
+                csl, &cso);
+    } else if (l3_proto == ETH_P_IPV6) {
+        csum_cntr = eth_calc_ip6_pseudo_hdr_csum(
+                pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
+                csl, pkt->l4proto, &cso);
+    }
 
     /* data checksum */
     csum_cntr +=
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16402.40281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIj-0004kA-SI; Fri, 30 Oct 2020 21:51:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16402.40281; Fri, 30 Oct 2020 21:51:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIj-0004k0-PU; Fri, 30 Oct 2020 21:51:13 +0000
Received: by outflank-mailman (input) for mailman id 16402;
 Fri, 30 Oct 2020 21:51:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcIi-0004jr-JF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fe2e4816-6701-407a-accf-7317c91e8ab9;
 Fri, 30 Oct 2020 21:51:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIh-0003yI-K2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIh-0001Hi-JI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcIi-0004jr-JF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:12 +0000
X-Inumbo-ID: fe2e4816-6701-407a-accf-7317c91e8ab9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fe2e4816-6701-407a-accf-7317c91e8ab9;
	Fri, 30 Oct 2020 21:51:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=oLgmz8s64Yp3vl5l5DEzvuqpPAsZ9YdR46zXztyoSx0=; b=GFI8daGoC4JlMyqH5pFNs+IOwl
	zRxQFn66nqQAR7Z8/tNkDh7rAhihEgYkm6aAiS4vKnJQRH8Zn7NHmReWbLvPw7BeqTrGV7qKpOIpf
	a+o5nteAYJGd15B8U+jNg0Zrv+a86yXoG4pibOH4RsKuUWKqzUj1geSt6uK3AncJOZLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIh-0003yI-K2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIh-0001Hi-JI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] net/colo-compare.c: Expose compare "max_queue_size" to users
Message-Id: <E1kYcIh-0001Hi-JI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:11 +0000

commit a2e5cb7a87206b916506697d22dc31aa0a43d8fe
Author:     Zhang Chen <chen.zhang@intel.com>
AuthorDate: Wed Jun 24 09:20:41 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net/colo-compare.c: Expose compare "max_queue_size" to users
    
    This patch allow users to set the "max_queue_size" according
    to their environment.
    
    Signed-off-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/colo-compare.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
 qemu-options.hx    |  5 +++--
 2 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 398b7546ff..cc15f23dea 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -59,6 +59,7 @@ static bool colo_compare_active;
 static QemuMutex event_mtx;
 static QemuCond event_complete_cond;
 static int event_unhandled_count;
+static uint32_t max_queue_size;
 
 /*
  *  + CompareState ++
@@ -222,7 +223,7 @@ static void fill_pkt_tcp_info(void *data, uint32_t *max_ack)
  */
 static int colo_insert_packet(GQueue *queue, Packet *pkt, uint32_t *max_ack)
 {
-    if (g_queue_get_length(queue) <= MAX_QUEUE_SIZE) {
+    if (g_queue_get_length(queue) <= max_queue_size) {
         if (pkt->ip->ip_p == IPPROTO_TCP) {
             fill_pkt_tcp_info(pkt, max_ack);
             g_queue_insert_sorted(queue,
@@ -1134,6 +1135,37 @@ static void compare_set_expired_scan_cycle(Object *obj, Visitor *v,
     s->expired_scan_cycle = value;
 }
 
+static void get_max_queue_size(Object *obj, Visitor *v,
+                               const char *name, void *opaque,
+                               Error **errp)
+{
+    uint32_t value = max_queue_size;
+
+    visit_type_uint32(v, name, &value, errp);
+}
+
+static void set_max_queue_size(Object *obj, Visitor *v,
+                               const char *name, void *opaque,
+                               Error **errp)
+{
+    Error *local_err = NULL;
+    uint32_t value;
+
+    visit_type_uint32(v, name, &value, &local_err);
+    if (local_err) {
+        goto out;
+    }
+    if (!value) {
+        error_setg(&local_err, "Property '%s.%s' requires a positive value",
+                   object_get_typename(obj), name);
+        goto out;
+    }
+    max_queue_size = value;
+
+out:
+    error_propagate(errp, local_err);
+}
+
 static void compare_pri_rs_finalize(SocketReadState *pri_rs)
 {
     CompareState *s = container_of(pri_rs, CompareState, pri_rs);
@@ -1251,6 +1283,11 @@ static void colo_compare_complete(UserCreatable *uc, Error **errp)
         s->expired_scan_cycle = REGULAR_PACKET_CHECK_MS;
     }
 
+    if (!max_queue_size) {
+        /* Set default queue size to 1024 */
+        max_queue_size = MAX_QUEUE_SIZE;
+    }
+
     if (find_and_check_chardev(&chr, s->pri_indev, errp) ||
         !qemu_chr_fe_init(&s->chr_pri_in, chr, errp)) {
         return;
@@ -1370,6 +1407,10 @@ static void colo_compare_init(Object *obj)
                         compare_get_expired_scan_cycle,
                         compare_set_expired_scan_cycle, NULL, NULL);
 
+    object_property_add(obj, "max_queue_size", "uint32",
+                        get_max_queue_size,
+                        set_max_queue_size, NULL, NULL);
+
     s->vnet_hdr = false;
     object_property_add_bool(obj, "vnet_hdr_support", compare_get_vnet_hdr,
                              compare_set_vnet_hdr);
diff --git a/qemu-options.hx b/qemu-options.hx
index d2c1e95bcf..310885c60e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4695,7 +4695,7 @@ SRST
         stored. The file format is libpcap, so it can be analyzed with
         tools such as tcpdump or Wireshark.
 
-    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}``
+    ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
         Colo-compare gets packet from primary\_inchardevid and
         secondary\_inchardevid, than compare primary packet with
         secondary packet. If the packets are same, we will output
@@ -4707,7 +4707,8 @@ SRST
         vnet\_hdr\_len. Then compare\_timeout=@var{ms} determines the
         maximum delay colo-compare wait for the packet.
         The expired\_scan\_cycle=@var{ms} to set the period of scanning
-        expired primary node network packets.
+        expired primary node network packets. The max\_queue\_size=@var{size}
+        is to set the max compare queue size depend on user environment.
         If you want to use Xen COLO, will need the notify\_dev to
         notify Xen colo-frame to do checkpoint.
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16403.40286 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIt-0004lK-U9; Fri, 30 Oct 2020 21:51:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16403.40286; Fri, 30 Oct 2020 21:51:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcIt-0004lC-R4; Fri, 30 Oct 2020 21:51:23 +0000
Received: by outflank-mailman (input) for mailman id 16403;
 Fri, 30 Oct 2020 21:51:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcIt-0004l5-1K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e12dfa61-593f-42db-8722-0c490d91f342;
 Fri, 30 Oct 2020 21:51:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIr-0003yY-O9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcIr-0001IJ-Mw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcIt-0004l5-1K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:23 +0000
X-Inumbo-ID: e12dfa61-593f-42db-8722-0c490d91f342
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e12dfa61-593f-42db-8722-0c490d91f342;
	Fri, 30 Oct 2020 21:51:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4OQKPxGAvu+g6naE3lh9G9iS5gWbJA7li346sXHiDj8=; b=1b3AA5kuqZ7CdDn31QDH6AFDeh
	sPZrLSFZLOvoF265R9DycUAbktadx3XkPnnoIZXQ8bfTrpjKcLylcTWw5pnMPY0ajMb1mk/1G1Czo
	yC5Y3FQAFNXCSxkvWir8JyLQnycAOcKAWPGaiPB6HTWjuv10LtGSCiLKrVycsZLL1aNE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIr-0003yY-O9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcIr-0001IJ-Mw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-options.hx: Clean up and fix typo for colo-compare
Message-Id: <E1kYcIr-0001IJ-Mw@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:21 +0000

commit 2b28a7ef90d79ed757f6b1cc512840389dc25748
Author:     Zhang Chen <chen.zhang@intel.com>
AuthorDate: Wed Jun 24 09:20:42 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    qemu-options.hx: Clean up and fix typo for colo-compare
    
    Fix some typo and optimized some descriptions.
    
    Signed-off-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 310885c60e..65147ad971 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4696,24 +4696,24 @@ SRST
         tools such as tcpdump or Wireshark.
 
     ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}][,max_queue_size=@var{size}]``
-        Colo-compare gets packet from primary\_inchardevid and
-        secondary\_inchardevid, than compare primary packet with
-        secondary packet. If the packets are same, we will output
-        primary packet to outdevchardevid, else we will notify
-        colo-frame do checkpoint and send primary packet to
-        outdevchardevid. In order to improve efficiency, we need to put
-        the task of comparison in another thread. If it has the
-        vnet\_hdr\_support flag, colo compare will send/recv packet with
-        vnet\_hdr\_len. Then compare\_timeout=@var{ms} determines the
-        maximum delay colo-compare wait for the packet.
-        The expired\_scan\_cycle=@var{ms} to set the period of scanning
-        expired primary node network packets. The max\_queue\_size=@var{size}
-        is to set the max compare queue size depend on user environment.
-        If you want to use Xen COLO, will need the notify\_dev to
+        Colo-compare gets packet from primary\_in chardevid and
+        secondary\_in, then compare whether the payload of primary packet
+        and secondary packet are the same. If same, it will output
+        primary packet to out\_dev, else it will notify COLO-framework to do
+        checkpoint and send primary packet to out\_dev. In order to
+        improve efficiency, we need to put the task of comparison in
+        another iothread. If it has the vnet\_hdr\_support flag,
+        colo compare will send/recv packet with vnet\_hdr\_len.
+        The compare\_timeout=@var{ms} determines the maximum time of the
+        colo-compare hold the packet. The expired\_scan\_cycle=@var{ms}
+        is to set the period of scanning expired primary node network packets.
+        The max\_queue\_size=@var{size} is to set the max compare queue
+        size depend on user environment.
+        If user want to use Xen COLO, need to add the notify\_dev to
         notify Xen colo-frame to do checkpoint.
 
-        we must use it with the help of filter-mirror and
-        filter-redirector.
+        COLO-compare must be used with the help of filter-mirror,
+        filter-redirector and filter-rewriter.
 
         ::
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16404.40290 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJ3-0004mj-Vl; Fri, 30 Oct 2020 21:51:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16404.40290; Fri, 30 Oct 2020 21:51:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJ3-0004mb-Sd; Fri, 30 Oct 2020 21:51:33 +0000
Received: by outflank-mailman (input) for mailman id 16404;
 Fri, 30 Oct 2020 21:51:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJ3-0004mR-1h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3c035c04-f48b-4226-8e94-c75eb36a1310;
 Fri, 30 Oct 2020 21:51:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJ1-0003yf-S2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJ1-0001Is-RG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJ3-0004mR-1h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:33 +0000
X-Inumbo-ID: 3c035c04-f48b-4226-8e94-c75eb36a1310
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3c035c04-f48b-4226-8e94-c75eb36a1310;
	Fri, 30 Oct 2020 21:51:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pLRYMF/CXvPOp5OxBQuBCsLc+nKh5DEmJ3b7LslFM80=; b=sUAfMRTvwZYXrCUR80nBM1HVIh
	Bq0YhCmptyMncLq8CK5Kfaz9pbYPP2zv+gaBm6J9npFrvn/XJzhebURJtjLcrMSROSoyT5SQgO9rv
	Q6VIQJm48fheha7eumaSR9lUBgu6FYmg2dpvaf8TW+sFFz9L6wB7kGW7PINxnQwHPCN8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJ1-0003yf-S2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJ1-0001Is-RG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] net: check if the file descriptor is valid before using it
Message-Id: <E1kYcJ1-0001Is-RG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:31 +0000

commit 894022e616016fe81745753f14adfbd680a1c7ee
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 7 20:45:14 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net: check if the file descriptor is valid before using it
    
    qemu_set_nonblock() checks that the file descriptor can be used and, if
    not, crashes QEMU. An assert() is used for that. The use of assert() is
    used to detect programming error and the coredump will allow to debug
    the problem.
    
    But in the case of the tap device, this assert() can be triggered by
    a misconfiguration by the user. At startup, it's not a real problem, but it
    can also happen during the hot-plug of a new device, and here it's a
    problem because we can crash a perfectly healthy system.
    
    For instance:
     # ip link add link virbr0 name macvtap0 type macvtap mode bridge
     # ip link set macvtap0 up
     # TAP=/dev/tap$(ip -o link show macvtap0 | cut -d: -f1)
     # qemu-system-x86_64 -machine q35 -device pcie-root-port,id=pcie-root-port-0 -monitor stdio 9<> $TAP
     (qemu) netdev_add type=tap,id=hostnet0,vhost=on,fd=9
     (qemu) device_add driver=virtio-net-pci,netdev=hostnet0,id=net0,bus=pcie-root-port-0
     (qemu) device_del net0
     (qemu) netdev_del hostnet0
     (qemu) netdev_add type=tap,id=hostnet1,vhost=on,fd=9
     qemu-system-x86_64: .../util/oslib-posix.c:247: qemu_set_nonblock: Assertion `f != -1' failed.
     Aborted (core dumped)
    
    To avoid that, add a function, qemu_try_set_nonblock(), that allows to report the
    problem without crashing.
    
    In the same way, we also update the function for vhostfd in net_init_tap_one() and
    for fd in net_init_socket() (both descriptors are provided by the user and can
    be wrong).
    
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/qemu/sockets.h |  1 +
 net/socket.c           |  9 ++++++--
 net/tap.c              | 25 ++++++++++++++++++----
 util/oslib-posix.c     | 26 ++++++++++++++++-------
 util/oslib-win32.c     | 57 ++++++++++++++++++++++++++++----------------------
 5 files changed, 79 insertions(+), 39 deletions(-)

diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 57cd049d6e..7d1f813576 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -18,6 +18,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 int socket_set_cork(int fd, int v);
 int socket_set_nodelay(int fd);
 void qemu_set_block(int fd);
+int qemu_try_set_nonblock(int fd);
 void qemu_set_nonblock(int fd);
 int socket_set_fast_reuse(int fd);
 
diff --git a/net/socket.c b/net/socket.c
index c92354049b..2d21fddd9c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -725,13 +725,18 @@ int net_init_socket(const Netdev *netdev, const char *name,
     }
 
     if (sock->has_fd) {
-        int fd;
+        int fd, ret;
 
         fd = monitor_fd_param(cur_mon, sock->fd, errp);
         if (fd == -1) {
             return -1;
         }
-        qemu_set_nonblock(fd);
+        ret = qemu_try_set_nonblock(fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                             name, fd);
+            return -1;
+        }
         if (!net_socket_fd_init(peer, "socket", name, fd, 1, sock->mcast,
                                 errp)) {
             return -1;
diff --git a/net/tap.c b/net/tap.c
index f9dcc2ef51..32e4813dbc 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -690,6 +690,8 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
         }
 
         if (vhostfdname) {
+            int ret;
+
             vhostfd = monitor_fd_param(cur_mon, vhostfdname, &err);
             if (vhostfd == -1) {
                 if (tap->has_vhostforce && tap->vhostforce) {
@@ -699,7 +701,12 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
                 }
                 return;
             }
-            qemu_set_nonblock(vhostfd);
+            ret = qemu_try_set_nonblock(vhostfd);
+            if (ret < 0) {
+                error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                                 name, fd);
+                return;
+            }
         } else {
             vhostfd = open("/dev/vhost-net", O_RDWR);
             if (vhostfd < 0) {
@@ -767,6 +774,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
     Error *err = NULL;
     const char *vhostfdname;
     char ifname[128];
+    int ret = 0;
 
     assert(netdev->type == NET_CLIENT_DRIVER_TAP);
     tap = &netdev->u.tap;
@@ -795,7 +803,12 @@ int net_init_tap(const Netdev *netdev, const char *name,
             return -1;
         }
 
-        qemu_set_nonblock(fd);
+        ret = qemu_try_set_nonblock(fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                             name, fd);
+            return -1;
+        }
 
         vnet_hdr = tap_probe_vnet_hdr(fd);
 
@@ -810,7 +823,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
         char **fds;
         char **vhost_fds;
         int nfds = 0, nvhosts = 0;
-        int ret = 0;
 
         if (tap->has_ifname || tap->has_script || tap->has_downscript ||
             tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||
@@ -842,7 +854,12 @@ int net_init_tap(const Netdev *netdev, const char *name,
                 goto free_fail;
             }
 
-            qemu_set_nonblock(fd);
+            ret = qemu_try_set_nonblock(fd);
+            if (ret < 0) {
+                error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
+                                 name, fd);
+                goto free_fail;
+            }
 
             if (i == 0) {
                 vnet_hdr = tap_probe_vnet_hdr(fd);
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index e60aea85b6..36bf8593f8 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -260,25 +260,35 @@ void qemu_set_block(int fd)
     assert(f != -1);
 }
 
-void qemu_set_nonblock(int fd)
+int qemu_try_set_nonblock(int fd)
 {
     int f;
     f = fcntl(fd, F_GETFL);
-    assert(f != -1);
-    f = fcntl(fd, F_SETFL, f | O_NONBLOCK);
-#ifdef __OpenBSD__
     if (f == -1) {
+        return -errno;
+    }
+    if (fcntl(fd, F_SETFL, f | O_NONBLOCK) == -1) {
+#ifdef __OpenBSD__
         /*
          * Previous to OpenBSD 6.3, fcntl(F_SETFL) is not permitted on
          * memory devices and sets errno to ENODEV.
          * It's OK if we fail to set O_NONBLOCK on devices like /dev/null,
          * because they will never block anyway.
          */
-        assert(errno == ENODEV);
-    }
-#else
-    assert(f != -1);
+        if (errno == ENODEV) {
+            return 0;
+        }
 #endif
+        return -errno;
+    }
+    return 0;
+}
+
+void qemu_set_nonblock(int fd)
+{
+    int f;
+    f = qemu_try_set_nonblock(fd);
+    assert(f == 0);
 }
 
 int socket_set_fast_reuse(int fd)
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 3b49d27297..7eedbe5859 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -132,31 +132,6 @@ struct tm *localtime_r(const time_t *timep, struct tm *result)
 }
 #endif /* CONFIG_LOCALTIME_R */
 
-void qemu_set_block(int fd)
-{
-    unsigned long opt = 0;
-    WSAEventSelect(fd, NULL, 0);
-    ioctlsocket(fd, FIONBIO, &opt);
-}
-
-void qemu_set_nonblock(int fd)
-{
-    unsigned long opt = 1;
-    ioctlsocket(fd, FIONBIO, &opt);
-    qemu_fd_register(fd);
-}
-
-int socket_set_fast_reuse(int fd)
-{
-    /* Enabling the reuse of an endpoint that was used by a socket still in
-     * TIME_WAIT state is usually performed by setting SO_REUSEADDR. On Windows
-     * fast reuse is the default and SO_REUSEADDR does strange things. So we
-     * don't have to do anything here. More info can be found at:
-     * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */
-    return 0;
-}
-
-
 static int socket_error(void)
 {
     switch (WSAGetLastError()) {
@@ -233,6 +208,38 @@ static int socket_error(void)
     }
 }
 
+void qemu_set_block(int fd)
+{
+    unsigned long opt = 0;
+    WSAEventSelect(fd, NULL, 0);
+    ioctlsocket(fd, FIONBIO, &opt);
+}
+
+int qemu_try_set_nonblock(int fd)
+{
+    unsigned long opt = 1;
+    if (ioctlsocket(fd, FIONBIO, &opt) != NO_ERROR) {
+        return -socket_error();
+    }
+    qemu_fd_register(fd);
+    return 0;
+}
+
+void qemu_set_nonblock(int fd)
+{
+    (void)qemu_try_set_nonblock(fd);
+}
+
+int socket_set_fast_reuse(int fd)
+{
+    /* Enabling the reuse of an endpoint that was used by a socket still in
+     * TIME_WAIT state is usually performed by setting SO_REUSEADDR. On Windows
+     * fast reuse is the default and SO_REUSEADDR does strange things. So we
+     * don't have to do anything here. More info can be found at:
+     * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */
+    return 0;
+}
+
 int inet_aton(const char *cp, struct in_addr *ia)
 {
     uint32_t addr = inet_addr(cp);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16405.40294 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJF-0004oe-2R; Fri, 30 Oct 2020 21:51:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16405.40294; Fri, 30 Oct 2020 21:51:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJE-0004oW-Vh; Fri, 30 Oct 2020 21:51:44 +0000
Received: by outflank-mailman (input) for mailman id 16405;
 Fri, 30 Oct 2020 21:51:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJD-0004oK-HN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9fa3a81b-835a-4186-aa21-9ffbb5739308;
 Fri, 30 Oct 2020 21:51:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJC-0003zV-0T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJB-0001Jb-V0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJD-0004oK-HN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:43 +0000
X-Inumbo-ID: 9fa3a81b-835a-4186-aa21-9ffbb5739308
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9fa3a81b-835a-4186-aa21-9ffbb5739308;
	Fri, 30 Oct 2020 21:51:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dM+Uisjsb8Q4uJmJ+cuP5KsfC8EXpXPmDupDFOW2D0o=; b=cPfpScDYTL0j+eRT54bvbPIVPx
	wIuJWI1VFTYZjSvo83gZdqj4tDesa3qlA4vGJ7FUXSOYwHFnZXHBe3Wkgy7qul4k+0ubVBtWDso8w
	ClHV12UQDeIqAynLM+yYNF/qTWlCoTsFwCXKNQGvuuCDIvDDwZZClBlRykT9Zh1hgfQ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJC-0003zV-0T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJB-0001Jb-V0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] net: detect errors from probing vnet hdr flag for TAP devices
Message-Id: <E1kYcJB-0001Jb-V0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:41 +0000

commit e7b347d0bf640adb1c998d317eaf44d2d7cbd973
Author:     Daniel P. Berrange <berrange@redhat.com>
AuthorDate: Tue Jul 7 20:45:15 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    net: detect errors from probing vnet hdr flag for TAP devices
    
    When QEMU sets up a tap based network device backend, it mostly ignores errors
    reported from various ioctl() calls it makes, assuming the TAP file descriptor
    is valid. This assumption can easily be violated when the user is passing in a
    pre-opened file descriptor. At best, the ioctls may fail with a -EBADF, but if
    the user passes in a bogus FD number that happens to clash with a FD number that
    QEMU has opened internally for another reason, a wide variety of errnos may
    result, as the TUNGETIFF ioctl number may map to a completely different command
    on a different type of file.
    
    By ignoring all these errors, QEMU sets up a zombie network backend that will
    never pass any data. Even worse, when QEMU shuts down, or that network backend
    is hot-removed, it will close this bogus file descriptor, which could belong to
    another QEMU device backend.
    
    There's no obvious guaranteed reliable way to detect that a FD genuinely is a
    TAP device, as opposed to a UNIX socket, or pipe, or something else. Checking
    the errno from probing vnet hdr flag though, does catch the big common cases.
    ie calling TUNGETIFF will return EBADF for an invalid FD, and ENOTTY when FD is
    a UNIX socket, or pipe which catches accidental collisions with FDs used for
    stdio, or monitor socket.
    
    Previously the example below where bogus fd 9 collides with the FD used for the
    chardev saw:
    
    $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
      -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
      -monitor stdio -vnc :0
    qemu-system-x86_64: -netdev tap,id=hostnet0,fd=9: TUNGETIFF ioctl() failed: Inappropriate ioctl for device
    TUNSETOFFLOAD ioctl() failed: Bad address
    QEMU 2.9.1 monitor - type 'help' for more information
    (qemu) Warning: netdev hostnet0 has no peer
    
    which gives a running QEMU with a zombie network backend.
    
    With this change applied we get an error message and QEMU immediately exits
    before carrying on and making a bigger disaster:
    
    $ ./x86_64-softmmu/qemu-system-x86_64 -netdev tap,id=hostnet0,fd=9 \
      -chardev socket,id=charchannel0,path=/tmp/qga,server,nowait \
      -monitor stdio -vnc :0
    qemu-system-x86_64: -netdev tap,id=hostnet0,vhost=on,fd=9: Unable to query TUNGETIFF on FD 9: Inappropriate ioctl for device
    
    Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-id: 20171027085548.3472-1-berrange@redhat.com
    [lv: to simplify, don't check on EINVAL with TUNGETIFF as it exists since v2.6.27]
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/tap-bsd.c     |  2 +-
 net/tap-linux.c   |  8 +++++---
 net/tap-solaris.c |  2 +-
 net/tap-stub.c    |  2 +-
 net/tap.c         | 25 ++++++++++++++++++++-----
 net/tap_int.h     |  2 +-
 6 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index a5c3707f80..77aaf674b1 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -211,7 +211,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap-linux.c b/net/tap-linux.c
index e0dd442ee3..b0635e9e32 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -147,13 +147,15 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
     }
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     struct ifreq ifr;
 
     if (ioctl(fd, TUNGETIFF, &ifr) != 0) {
-        error_report("TUNGETIFF ioctl() failed: %s", strerror(errno));
-        return 0;
+        /* TUNGETIFF is available since kernel v2.6.27 */
+        error_setg_errno(errp, errno,
+                         "Unable to query TUNGETIFF on FD %d", fd);
+        return -1;
     }
 
     return ifr.ifr_flags & IFF_VNET_HDR;
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index d03165c57c..0475a58207 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -207,7 +207,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap-stub.c b/net/tap-stub.c
index a9ab8f8293..de525a2e69 100644
--- a/net/tap-stub.c
+++ b/net/tap-stub.c
@@ -37,7 +37,7 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp)
 {
 }
 
-int tap_probe_vnet_hdr(int fd)
+int tap_probe_vnet_hdr(int fd, Error **errp)
 {
     return 0;
 }
diff --git a/net/tap.c b/net/tap.c
index 32e4813dbc..14dc904fca 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -598,7 +598,11 @@ int net_init_bridge(const Netdev *netdev, const char *name,
     }
 
     qemu_set_nonblock(fd);
-    vnet_hdr = tap_probe_vnet_hdr(fd);
+    vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+    if (vnet_hdr < 0) {
+        close(fd);
+        return -1;
+    }
     s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);
 
     snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,
@@ -810,7 +814,11 @@ int net_init_tap(const Netdev *netdev, const char *name,
             return -1;
         }
 
-        vnet_hdr = tap_probe_vnet_hdr(fd);
+        vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+        if (vnet_hdr < 0) {
+            close(fd);
+            return -1;
+        }
 
         net_init_tap_one(tap, peer, "tap", name, NULL,
                          script, downscript,
@@ -862,8 +870,11 @@ int net_init_tap(const Netdev *netdev, const char *name,
             }
 
             if (i == 0) {
-                vnet_hdr = tap_probe_vnet_hdr(fd);
-            } else if (vnet_hdr != tap_probe_vnet_hdr(fd)) {
+                vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+                if (vnet_hdr < 0) {
+                    goto free_fail;
+                }
+            } else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {
                 error_setg(errp,
                            "vnet_hdr not consistent across given tap fds");
                 ret = -1;
@@ -908,7 +919,11 @@ free_fail:
         }
 
         qemu_set_nonblock(fd);
-        vnet_hdr = tap_probe_vnet_hdr(fd);
+        vnet_hdr = tap_probe_vnet_hdr(fd, errp);
+        if (vnet_hdr < 0) {
+            close(fd);
+            return -1;
+        }
 
         net_init_tap_one(tap, peer, "bridge", name, ifname,
                          script, downscript, vhostfdname,
diff --git a/net/tap_int.h b/net/tap_int.h
index e3194b23f4..225a49ea48 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -34,7 +34,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
 ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
 
 void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
-int tap_probe_vnet_hdr(int fd);
+int tap_probe_vnet_hdr(int fd, Error **errp);
 int tap_probe_vnet_hdr_len(int fd, int len);
 int tap_probe_has_ufo(int fd);
 void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:51:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:51:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16406.40299 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJO-0004pj-4S; Fri, 30 Oct 2020 21:51:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16406.40299; Fri, 30 Oct 2020 21:51:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJO-0004pb-0u; Fri, 30 Oct 2020 21:51:54 +0000
Received: by outflank-mailman (input) for mailman id 16406;
 Fri, 30 Oct 2020 21:51:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJM-0004pS-VR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a71001b0-1e50-4367-8547-7d2b7fb4c9a8;
 Fri, 30 Oct 2020 21:51:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJM-0003zf-4S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJM-0001KD-3W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJM-0004pS-VR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
X-Inumbo-ID: a71001b0-1e50-4367-8547-7d2b7fb4c9a8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a71001b0-1e50-4367-8547-7d2b7fb4c9a8;
	Fri, 30 Oct 2020 21:51:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GKRYbwGEKeZc5KZsGzRULu3W8lnklB4AVdg8LbvwAXw=; b=syEUBNU1iyo/6c0o0zR1ctRBG3
	2QG2p7gzNKE2GLZIP3wn0qL55ma2VuhVUygzic7z6shaHhR260R5dAVVXlGwKaMJ6cNG6c3MEaPCf
	gykVi6gAIy/HT3UiOkgYryP04sAq/tKZyrSXVmlK7VrISvMbb0oAFvgh7R+MRK3iwFDo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJM-0003zf-4S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJM-0001KD-3W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:51:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ftgmac100: fix dblac write test
Message-Id: <E1kYcJM-0001KD-3W@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:51:52 +0000

commit a134321ef676723768973537bb9b49365ae2062e
Author:     erik-smit <erik.lucas.smit@gmail.com>
AuthorDate: Sun Jun 28 16:26:59 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Wed Jul 15 21:00:13 2020 +0800

    ftgmac100: fix dblac write test
    
    The test of the write of the dblac register was testing the old value
    instead of the new value. This would accept the write of an invalid value
    but subsequently refuse any following valid writes.
    
    Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/ftgmac100.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index 043ba61b86..5f4b26fc5f 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -810,16 +810,18 @@ static void ftgmac100_write(void *opaque, hwaddr addr,
         s->phydata = value & 0xffff;
         break;
     case FTGMAC100_DBLAC: /* DMA Burst Length and Arbitration Control */
-        if (FTGMAC100_DBLAC_TXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+        if (FTGMAC100_DBLAC_TXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
             qemu_log_mask(LOG_GUEST_ERROR,
-                          "%s: transmit descriptor too small : %d bytes\n",
-                          __func__, FTGMAC100_DBLAC_TXDES_SIZE(s->dblac));
+                          "%s: transmit descriptor too small: %" PRIx64
+                          " bytes\n", __func__,
+                          FTGMAC100_DBLAC_TXDES_SIZE(value));
             break;
         }
-        if (FTGMAC100_DBLAC_RXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+        if (FTGMAC100_DBLAC_RXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
             qemu_log_mask(LOG_GUEST_ERROR,
-                          "%s: receive descriptor too small : %d bytes\n",
-                          __func__, FTGMAC100_DBLAC_RXDES_SIZE(s->dblac));
+                          "%s: receive descriptor too small : %" PRIx64
+                          " bytes\n", __func__,
+                          FTGMAC100_DBLAC_RXDES_SIZE(value));
             break;
         }
         s->dblac = value;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16407.40302 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJY-0004r9-5Q; Fri, 30 Oct 2020 21:52:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16407.40302; Fri, 30 Oct 2020 21:52:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJY-0004r1-2T; Fri, 30 Oct 2020 21:52:04 +0000
Received: by outflank-mailman (input) for mailman id 16407;
 Fri, 30 Oct 2020 21:52:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJX-0004qt-Dc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 86e57810-14e1-47e6-8c55-53978dbb1f01;
 Fri, 30 Oct 2020 21:52:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJW-000402-8Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJW-0001Kt-7e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJX-0004qt-Dc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:03 +0000
X-Inumbo-ID: 86e57810-14e1-47e6-8c55-53978dbb1f01
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 86e57810-14e1-47e6-8c55-53978dbb1f01;
	Fri, 30 Oct 2020 21:52:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EyhDZCERrmgX4EHPHptbPr4GESwzW5x2KPRGhpwlabw=; b=iHgICTnsbOV/cwTXqDaxfAshFd
	Zt5nI7bUKyCAamp75nZmzR+brLPy3XjpcDDIZ+rafwWQ/roklDRiM2cQZLLdhiK459tg1eko4/LWb
	y6u2iVwp4iuLb1rJEhK+uI8HDbO6/gAenFhtcMPYfZJuHR1oZnjJ2pQeu3nYvmLX5ZW4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJW-000402-8Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJW-0001Kt-7e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYcJW-0001Kt-7e@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:02 +0000

commit ee5128bb00f90dd301991d80d1db5224ce924c84
Merge: 8746309137ba470d1b2e8f5ce86ac228625db940 a134321ef676723768973537bb9b49365ae2062e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 13:12:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 13:12:05 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Wed 15 Jul 2020 14:49:07 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      ftgmac100: fix dblac write test
      net: detect errors from probing vnet hdr flag for TAP devices
      net: check if the file descriptor is valid before using it
      qemu-options.hx: Clean up and fix typo for colo-compare
      net/colo-compare.c: Expose compare "max_queue_size" to users
      hw/net: Added CSO for IPv6
      virtio-net: fix removal of failover device
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/ftgmac100.c     | 14 +++++++------
 hw/net/net_tx_pkt.c    | 15 ++++++++++---
 hw/net/virtio-net.c    |  1 +
 include/qemu/sockets.h |  1 +
 net/colo-compare.c     | 43 ++++++++++++++++++++++++++++++++++++-
 net/socket.c           |  9 ++++++--
 net/tap-bsd.c          |  2 +-
 net/tap-linux.c        |  8 ++++---
 net/tap-solaris.c      |  2 +-
 net/tap-stub.c         |  2 +-
 net/tap.c              | 50 +++++++++++++++++++++++++++++++++++--------
 net/tap_int.h          |  2 +-
 qemu-options.hx        | 33 +++++++++++++++--------------
 util/oslib-posix.c     | 26 ++++++++++++++++-------
 util/oslib-win32.c     | 57 ++++++++++++++++++++++++++++----------------------
 15 files changed, 188 insertions(+), 77 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16408.40305 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJi-0004sQ-6k; Fri, 30 Oct 2020 21:52:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16408.40305; Fri, 30 Oct 2020 21:52:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJi-0004sJ-3y; Fri, 30 Oct 2020 21:52:14 +0000
Received: by outflank-mailman (input) for mailman id 16408;
 Fri, 30 Oct 2020 21:52:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJh-0004s9-EE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d42f9293-a4c9-4651-a777-29ea9649d6cd;
 Fri, 30 Oct 2020 21:52:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJg-00040A-KL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJg-0001Ll-Is
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJh-0004s9-EE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:13 +0000
X-Inumbo-ID: d42f9293-a4c9-4651-a777-29ea9649d6cd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d42f9293-a4c9-4651-a777-29ea9649d6cd;
	Fri, 30 Oct 2020 21:52:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w2K1voBxKkE3NduPEw5j6F0klThpcyeiEXWWFQr1go0=; b=0YsnaTGyReqbw/lbpbbMjgVV+z
	RsBpT1fbDYlgo7vFLdNmuz7xNjbyidJYrbd7/n7l+Uaq2lxtiNZ4Uk69Lrj1EnLKX79lD8PIVwAgQ
	kr57e//BWFVo7MoJ4QP4tMnT1HdXTl5F9PK1GVvt67sWHgDEL8j3QvEiyAi2jEPMrwH0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJg-00040A-KL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJg-0001Ll-Is
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tpm: tpm_spapr: Exit on TPM backend failures
Message-Id: <E1kYcJg-0001Ll-Is@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:12 +0000

commit f8b332a1ff107dc014a52eaf9bf547995205f18a
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:24 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Wed Jul 15 14:57:33 2020 -0400

    tpm: tpm_spapr: Exit on TPM backend failures
    
    Exit on TPM backend failures in the same way as the TPM CRB and TIS device
    models do. With this change we now get an error report when the backend
    did not start up properly:
    
    error: internal error: qemu unexpectedly closed the monitor:
    2020-07-07T12:49:28.333928Z qemu-system-ppc64: tpm-emulator: \
      TPM result for CMD_INIT: 0x101 operation failed
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-2-stefanb@linux.vnet.ibm.com
---
 hw/tpm/tpm_spapr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index cb4dfd1e6a..8288ab0a15 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -306,7 +306,10 @@ static void tpm_spapr_reset(SpaprVioDevice *dev)
                             TPM_SPAPR_BUFFER_MAX);
 
     tpm_backend_reset(s->be_driver);
-    tpm_spapr_do_startup_tpm(s, s->be_buffer_size);
+
+    if (tpm_spapr_do_startup_tpm(s, s->be_buffer_size) < 0) {
+        exit(1);
+    }
 }
 
 static enum TPMVersion tpm_spapr_get_version(TPMIf *ti)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16409.40310 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJt-0004tk-8V; Fri, 30 Oct 2020 21:52:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16409.40310; Fri, 30 Oct 2020 21:52:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcJt-0004tc-5c; Fri, 30 Oct 2020 21:52:25 +0000
Received: by outflank-mailman (input) for mailman id 16409;
 Fri, 30 Oct 2020 21:52:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcJs-0004tV-BN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c3c0668f-4f87-4008-98ed-eba8a9c6463a;
 Fri, 30 Oct 2020 21:52:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJq-00040M-O1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcJq-0001MH-NA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcJs-0004tV-BN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:24 +0000
X-Inumbo-ID: c3c0668f-4f87-4008-98ed-eba8a9c6463a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c3c0668f-4f87-4008-98ed-eba8a9c6463a;
	Fri, 30 Oct 2020 21:52:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zcEgJ7TitMKF5v9srgfQcuKAGuQsafaMNSHdmJliGGk=; b=xdnC+ZZR/4DaoPGqAVQzNxazZ6
	Kb8fHid94+v7iK2PADp/U7KmT8XWQZZKhUtFPI3MUP6OD9eKrve/QnCWZdMCVsDqS9YpnPnS5FJ96
	G6faOj50IKrfdFjC79S/Bg6l3BRxt+w7gTRXRxfLSChXbKNwMFaQrDLIdA0k55HWTZsA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJq-00040M-O1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcJq-0001MH-NA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests: tpm: Skip over pcrUpdateCounter byte in result comparison
Message-Id: <E1kYcJq-0001MH-NA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:22 +0000

commit df8a7568932e4c3c930fdfeb228dd72b4bb71a1f
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Tue Jul 7 16:16:25 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Wed Jul 15 14:57:33 2020 -0400

    tests: tpm: Skip over pcrUpdateCounter byte in result comparison
    
    The TPM 2 code in libtpms was fixed to handle the PCR 'TCB group' according
    to the PCClient profile. The change of the PCRs belonging to the 'TCB group'
    now affects the pcrUpdateCounter in the TPM2_PCRRead() responses where its
    value is now different (typically lower by '1') than what it was before. To
    not fail the tests, we skip the comparison of the 14th byte, which
    represents the pcrUpdateCounter.
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-id: 20200707201625.4177419-3-stefanb@linux.vnet.ibm.com
---
 tests/qtest/tpm-util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/tpm-util.c b/tests/qtest/tpm-util.c
index 34efae8f18..58a9593745 100644
--- a/tests/qtest/tpm-util.c
+++ b/tests/qtest/tpm-util.c
@@ -139,7 +139,11 @@ void tpm_util_pcrread(QTestState *s, tx_func *tx,
 
     tx(s, tpm_pcrread, sizeof(tpm_pcrread), buffer, sizeof(buffer));
 
-    g_assert_cmpmem(buffer, exp_resp_size, exp_resp, exp_resp_size);
+    /* skip pcrUpdateCounter (14th byte) in comparison */
+    g_assert(exp_resp_size >= 15);
+    g_assert_cmpmem(buffer, 13, exp_resp, 13);
+    g_assert_cmpmem(&buffer[14], exp_resp_size - 14,
+                    &exp_resp[14], exp_resp_size - 14);
 }
 
 bool tpm_util_swtpm_has_tpm2(void)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16410.40314 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcK3-0004uy-AI; Fri, 30 Oct 2020 21:52:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16410.40314; Fri, 30 Oct 2020 21:52:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcK3-0004uq-77; Fri, 30 Oct 2020 21:52:35 +0000
Received: by outflank-mailman (input) for mailman id 16410;
 Fri, 30 Oct 2020 21:52:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcK1-0004uh-Ri
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fe788ed3-46a4-4cc9-8fad-29eff74107b0;
 Fri, 30 Oct 2020 21:52:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcK0-00040W-Rl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcK0-0001Mn-Qt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcK1-0004uh-Ri
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:33 +0000
X-Inumbo-ID: fe788ed3-46a4-4cc9-8fad-29eff74107b0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fe788ed3-46a4-4cc9-8fad-29eff74107b0;
	Fri, 30 Oct 2020 21:52:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q8R977pE/PWxfTGpgwtz+E2hmhFwZzOx4WTNjx+KpMs=; b=XzODHZm24nmkVn2bAjxsde+azd
	tcS1QhXxCS6R7A7goyUsS3VXNgzleRJAh0F8+gssVf+RHqBo7qLr+zOveRbycF9kagwxtcrBjhkq7
	DS10anACU/f1DbxpF6RmkWx6XSPx5dY+x/h8f3pcsl9+Oe7rxFWx9DL56UAAS6vFTX58=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcK0-00040W-Rl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcK0-0001Mn-Qt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging
Message-Id: <E1kYcK0-0001Mn-Qt@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:32 +0000

commit 175788d4eb91a840e9505d84ff2c6bedf4380143
Merge: ee5128bb00f90dd301991d80d1db5224ce924c84 df8a7568932e4c3c930fdfeb228dd72b4bb71a1f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 14:46:47 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 14:46:47 2020 +0100

    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-15-1' into staging
    
    Merge tpm 2020/07/15 v1
    
    # gpg: Signature made Wed 15 Jul 2020 20:16:21 BST
    # gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
    # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
    
    * remotes/stefanberger/tags/pull-tpm-2020-07-15-1:
      tests: tpm: Skip over pcrUpdateCounter byte in result comparison
      tpm: tpm_spapr: Exit on TPM backend failures
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/tpm/tpm_spapr.c     | 5 ++++-
 tests/qtest/tpm-util.c | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16411.40317 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKD-0004xC-Cc; Fri, 30 Oct 2020 21:52:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16411.40317; Fri, 30 Oct 2020 21:52:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKD-0004x4-9o; Fri, 30 Oct 2020 21:52:45 +0000
Received: by outflank-mailman (input) for mailman id 16411;
 Fri, 30 Oct 2020 21:52:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcKC-0004ws-1U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fd0d2327-85fc-4386-aae8-5fae687bd798;
 Fri, 30 Oct 2020 21:52:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKB-00042a-8D
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKB-0001P7-6T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcKC-0004ws-1U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:44 +0000
X-Inumbo-ID: fd0d2327-85fc-4386-aae8-5fae687bd798
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fd0d2327-85fc-4386-aae8-5fae687bd798;
	Fri, 30 Oct 2020 21:52:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uu6GhMC82YkfbnpOj1BFTclDQ2BYruJN6apomJu880k=; b=eeJGIOZcfmbGzXLmmIdA+3cOrO
	s1CuQ2iLb9A1NLXYG+iBq1zPBJLjNdKfS2+s2HxPxxqMywuccLIgEJIdWpWyG6HeSdWG38OnRFoC+
	SWsjucOAiLsB84GrmP2Ddu+MwCr1qWWHrGfijMfLepbCwdkLruDgEK8bfR/c6phNYpgo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKB-00042a-8D
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKB-0001P7-6T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] vfio: fix use-after-free in display
Message-Id: <E1kYcKB-0001P7-6T@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:43 +0000

commit 8ec1415935ff4214ef9b47448ff7ac52cfa8b77e
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 13 14:45:20 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Thu Jul 16 10:20:12 2020 +0200

    vfio: fix use-after-free in display
    
    Calling ramfb_display_update() might replace the DisplaySurface with the
    boot display, which in turn will free the currently active
    DisplaySurface.
    
    So clear our DisplaySurface pinter (dpy->region.surface pointer) to (a)
    avoid use-after-free and (b) force replacing the boot display with the
    real display when switching back.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
    Acked-by: Alex Williamson <alex.williamson@redhat.com>
    Message-id: 20200713124520.23266-1-kraxel@redhat.com
---
 hw/vfio/display.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/vfio/display.c b/hw/vfio/display.c
index a57a22674d..342054193b 100644
--- a/hw/vfio/display.c
+++ b/hw/vfio/display.c
@@ -405,6 +405,7 @@ static void vfio_display_region_update(void *opaque)
     if (!plane.drm_format || !plane.size) {
         if (dpy->ramfb) {
             ramfb_display_update(dpy->con, dpy->ramfb);
+            dpy->region.surface = NULL;
         }
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:52:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:52:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16412.40323 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKN-0004yd-Ek; Fri, 30 Oct 2020 21:52:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16412.40323; Fri, 30 Oct 2020 21:52:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKN-0004yT-BG; Fri, 30 Oct 2020 21:52:55 +0000
Received: by outflank-mailman (input) for mailman id 16412;
 Fri, 30 Oct 2020 21:52:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcKM-0004yJ-7U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6c97f7dc-0b5d-4e93-928d-8e07f2ca3864;
 Fri, 30 Oct 2020 21:52:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKL-00042i-Df
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKL-0001Pu-B6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcKM-0004yJ-7U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:54 +0000
X-Inumbo-ID: 6c97f7dc-0b5d-4e93-928d-8e07f2ca3864
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6c97f7dc-0b5d-4e93-928d-8e07f2ca3864;
	Fri, 30 Oct 2020 21:52:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lu+RK7QoZRVYPOg1g9YFdMl5NhTYvyZzK5hng3i8L1I=; b=RbW0fo0B7RAaRXcPoyTbGZmu2T
	o2KzJjkSHaojhMzCwjHaONJ4MyO2rULBm7DTvw/LD5RztEaZ9T8C1LMDwPiC+NTBaiD/S5Vr+wySG
	6Kk7NxgI+XE3SP21wDwKTZvsogFW8X6k2nc96rYbwZ1ik9e6Ml2Tg6cZPLmDCLt6g+18=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKL-00042i-Df
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKL-0001Pu-B6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:52:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] usb: fix storage regression
Message-Id: <E1kYcKL-0001Pu-B6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:52:53 +0000

commit 4084e35068772cf4f81bbae5174019f277c61084
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 13 08:27:12 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Thu Jul 16 10:20:27 2020 +0200

    usb: fix storage regression
    
    Fix the contition to figure whenever we need to wait for more data or
    not.  Simply check the mode, if we are not in DATAIN state any more we
    are done already and don't need to go ASYNC.
    
    Fixes: 7ad3d51ebb8a ("usb: add short-packet handling to usb-storage driver")
    Reported-by: Sai Pavan Boddu <saipava@xilinx.com>
    Tested-by: Paul Zimmerman <pauldzim@gmail.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-id: 20200713062712.1476-1-kraxel@redhat.com
---
 hw/usb/dev-storage.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 2ed6a8df24..405a4ccfe7 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -546,8 +546,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
                     }
                 }
             }
-            if (p->actual_length < p->iov.size && (p->short_not_ok ||
-                    s->scsi_len >= p->ep->max_packet_size)) {
+            if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
                 DPRINTF("Deferring packet %p [wait data-in]\n", p);
                 s->packet = p;
                 p->status = USB_RET_ASYNC;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16413.40326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKY-00051N-Fs; Fri, 30 Oct 2020 21:53:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16413.40326; Fri, 30 Oct 2020 21:53:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKY-00051F-Ck; Fri, 30 Oct 2020 21:53:06 +0000
Received: by outflank-mailman (input) for mailman id 16413;
 Fri, 30 Oct 2020 21:53:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcKW-000512-Lv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2632b8ca-70a3-47e2-9b4f-cdc9704c18e6;
 Fri, 30 Oct 2020 21:53:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKV-000432-IS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKV-0001R0-Ge
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcKW-000512-Lv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:04 +0000
X-Inumbo-ID: 2632b8ca-70a3-47e2-9b4f-cdc9704c18e6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2632b8ca-70a3-47e2-9b4f-cdc9704c18e6;
	Fri, 30 Oct 2020 21:53:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hZvK2TX5I3Xzot5TNlDw7FsF9hhXV1WJmHrfhHtrE5c=; b=ta7D0NpMHhZivMnDBjT/o7l930
	fScujhKOEg7eCTKdpazaVCMZbP3kqPzoke25+NCNf4iMBIg6WZ+jdeycjwZYG6zqjE9K0FwmNwvlP
	9hKfVjgLqwr3EP6FSxWbcGzDJy2ssCPQ+fdIo24fOVZtrC7ksuN8DnkikPxhflHKJKg8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKV-000432-IS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKV-0001R0-Ge
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200716-pull-request' into staging
Message-Id: <E1kYcKV-0001R0-Ge@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:03 +0000

commit 95d1fbabae0cd44156ac4b96d512d143ca7dfd5e
Merge: 175788d4eb91a840e9505d84ff2c6bedf4380143 4084e35068772cf4f81bbae5174019f277c61084
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 18:50:51 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 18:50:51 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200716-pull-request' into staging
    
    fixes: usb storage regression, vfio display ramfb bug
    
    # gpg: Signature made Thu 16 Jul 2020 10:30:58 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200716-pull-request:
      usb: fix storage regression
      vfio: fix use-after-free in display
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/usb/dev-storage.c | 3 +--
 hw/vfio/display.c    | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16414.40330 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKi-00053V-HN; Fri, 30 Oct 2020 21:53:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16414.40330; Fri, 30 Oct 2020 21:53:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKi-00053K-EF; Fri, 30 Oct 2020 21:53:16 +0000
Received: by outflank-mailman (input) for mailman id 16414;
 Fri, 30 Oct 2020 21:53:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcKg-00052K-Pa
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0d966a55-d998-47ba-8b77-60f26440e9d9;
 Fri, 30 Oct 2020 21:53:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKf-00043A-Vz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKf-0001Sr-Un
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcKg-00052K-Pa
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:14 +0000
X-Inumbo-ID: 0d966a55-d998-47ba-8b77-60f26440e9d9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0d966a55-d998-47ba-8b77-60f26440e9d9;
	Fri, 30 Oct 2020 21:53:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CJVAN9RTKZUgy28XsJkxccRqbei5jEDIWnBpwty65M8=; b=oN5Cg7x5ce7l/wgtumwSaw0nc3
	PsYKgcVndjxQaKnnxm4TsU30vSUwEJxPKTIyx+ydtvzDMCltUZtDwHQTsTHak7+FlfacyycU7ibLM
	Z4S4CF1qXA64VKbAZMyiWfsVu22OTVe+DnvtIAjJVdEqHHeiPAzuz6Y2lMr99vcNNv8U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKf-00043A-Vz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKf-0001Sr-Un
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] i368/cpu: Clear env->user_features after loading versioned CPU model
Message-Id: <E1kYcKf-0001Sr-Un@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:13 +0000

commit 1f43671a0d55d863f9111535ca4241e9fa238506
Author:     Xiaoyao Li <xiaoyao.li@intel.com>
AuthorDate: Tue Jul 14 01:44:35 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:04:42 2020 -0400

    i368/cpu: Clear env->user_features after loading versioned CPU model
    
    Features defined in versioned CPU model are recorded in env->user_features
    since they are updated as property. It's unwated because they are not
    user specified.
    
    Simply clear env->user_features as a fix. It won't clear user specified
    features because user specified features are filled to
    env->user_features later in x86_cpu_expand_features().
    
    Cc: Chenyi Qiang <chenyi.qiang@intel.com>
    Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
    Message-Id: <20200713174436.41070-2-xiaoyao.li@intel.com>
    [ehabkost: fix coding style]
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1e5123251d..caf0334f3a 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5159,6 +5159,13 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model)
     object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort);
 
     x86_cpu_apply_version_props(cpu, model);
+
+    /*
+     * Properties in versioned CPU model are not user specified features.
+     * We can simply clear env->user_features here since it will be filled later
+     * in x86_cpu_expand_features() based on plus_features and minus_features.
+     */
+    memset(&env->user_features, 0, sizeof(env->user_features));
 }
 
 #ifndef CONFIG_USER_ONLY
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16415.40333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKs-00054h-Ic; Fri, 30 Oct 2020 21:53:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16415.40333; Fri, 30 Oct 2020 21:53:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcKs-00054b-Fh; Fri, 30 Oct 2020 21:53:26 +0000
Received: by outflank-mailman (input) for mailman id 16415;
 Fri, 30 Oct 2020 21:53:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcKq-00054N-Sp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d76ade5d-a9d5-4572-8d9c-f5c30c046cd0;
 Fri, 30 Oct 2020 21:53:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKq-00043I-3i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcKq-0001TX-2t
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcKq-00054N-Sp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
X-Inumbo-ID: d76ade5d-a9d5-4572-8d9c-f5c30c046cd0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d76ade5d-a9d5-4572-8d9c-f5c30c046cd0;
	Fri, 30 Oct 2020 21:53:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=knawWshNsJcHVmwo3AnYnDxbuq2/8kl9ekoV4TZOV6E=; b=H6O/bjV6ImVfnP0jWPN8gDYzUz
	bGQQ+oALepe2/usePSKAqb4dtbB8XIbCukTnUSEsvWjbYYDfyoikfGbhOzRRLitkWAhHVnrY2z1yt
	3RNHsfSTsVhPKy6IxCfx+P8fk6/LBxvgWI7ACu2rxqv/R15mFeCr4VkA/Go+sF63dmdk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKq-00043I-3i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcKq-0001TX-2t
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] i386/cpu: Don't add unavailable_features to env->user_features
Message-Id: <E1kYcKq-0001TX-2t@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:24 +0000

commit f9f08e7cae8a6c292cacaf6531ede88786fcb3d3
Author:     Xiaoyao Li <xiaoyao.li@intel.com>
AuthorDate: Tue Jul 14 01:44:36 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:04:42 2020 -0400

    i386/cpu: Don't add unavailable_features to env->user_features
    
    Features unavailable due to absent of their dependent features should
    not be added to env->user_features. env->user_features only contains the
    feature explicity specified with -feature/+feature by user.
    
    Fixes: 99e24dbdaa68 ("target/i386: introduce generic feature dependency mechanism")
    Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
    Message-Id: <20200713174436.41070-3-xiaoyao.li@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index caf0334f3a..93b62b2eca 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6371,7 +6371,6 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
                                       unavailable_features & env->user_features[d->to.index],
                                       "This feature depends on other features that were not requested");
 
-            env->user_features[d->to.index] |= unavailable_features;
             env->features[d->to.index] &= ~unavailable_features;
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16416.40337 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcL2-00055q-KA; Fri, 30 Oct 2020 21:53:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16416.40337; Fri, 30 Oct 2020 21:53:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcL2-00055i-HJ; Fri, 30 Oct 2020 21:53:36 +0000
Received: by outflank-mailman (input) for mailman id 16416;
 Fri, 30 Oct 2020 21:53:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcL1-00055Z-7w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9547cf6e-6275-48dc-a561-88856f662018;
 Fri, 30 Oct 2020 21:53:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcL0-00043Q-7s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcL0-0001UD-72
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcL1-00055Z-7w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:35 +0000
X-Inumbo-ID: 9547cf6e-6275-48dc-a561-88856f662018
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9547cf6e-6275-48dc-a561-88856f662018;
	Fri, 30 Oct 2020 21:53:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yanZkcnhA5pgEXnNvqKw/vOaRERB/TIR/kmb8bkWpjQ=; b=mxZt8sjQb4xixRsX4GFsHAgK1Z
	h25zTPmnmjsQGxQRrDPCeCA1N9cx1+/p+3sM+MLvYJ4lziet32aGIofyRLjdHUaX/DTuiux0p0GUP
	ViqtlltvVswbDPXJ+KT0+ekZ7U6/pjAuFLC2JtPkaV66BMLUw1HEVAiejv4VzJkHicgI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcL0-00043Q-7s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcL0-0001UD-72
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/i386: add fast short REP MOV support
Message-Id: <E1kYcL0-0001UD-72@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:34 +0000

commit 5cb287d2bd578dfe4897458793b4fce35bc4f744
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:46 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: add fast short REP MOV support
    
    For CPUs support fast short REP MOV[CPUID.(EAX=7,ECX=0):EDX(bit4)], e.g
    Icelake and Tigerlake, expose it to the guest VM.
    
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-2-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 2 +-
 target/i386/cpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 93b62b2eca..3885826bc4 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -984,7 +984,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
         .type = CPUID_FEATURE_WORD,
         .feat_names = {
             NULL, NULL, "avx512-4vnniw", "avx512-4fmaps",
-            NULL, NULL, NULL, NULL,
+            "fsrm", NULL, NULL, NULL,
             "avx512-vp2intersect", NULL, "md-clear", NULL,
             NULL, NULL, "serialize", NULL,
             "tsx-ldtrk", NULL, NULL /* pconfig */, NULL,
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 37fffa5cac..e1a5c174dc 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -775,6 +775,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
 #define CPUID_7_0_EDX_AVX512_4VNNIW     (1U << 2)
 /* AVX512 Multiply Accumulation Single Precision */
 #define CPUID_7_0_EDX_AVX512_4FMAPS     (1U << 3)
+/* Fast Short Rep Mov */
+#define CPUID_7_0_EDX_FSRM              (1U << 4)
 /* AVX512 Vector Pair Intersection to a Pair of Mask Registers */
 #define CPUID_7_0_EDX_AVX512_VP2INTERSECT (1U << 8)
 /* SERIALIZE instruction */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16417.40341 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLC-00057b-M6; Fri, 30 Oct 2020 21:53:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16417.40341; Fri, 30 Oct 2020 21:53:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLC-00057T-Iq; Fri, 30 Oct 2020 21:53:46 +0000
Received: by outflank-mailman (input) for mailman id 16417;
 Fri, 30 Oct 2020 21:53:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcLB-00057I-8L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f362a07a-33c3-42a4-8552-372727791a77;
 Fri, 30 Oct 2020 21:53:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLA-00044D-Bs
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLA-0001Un-Au
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcLB-00057I-8L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:45 +0000
X-Inumbo-ID: f362a07a-33c3-42a4-8552-372727791a77
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f362a07a-33c3-42a4-8552-372727791a77;
	Fri, 30 Oct 2020 21:53:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e6n/xK2B3/ArzlQJojHlOaI/j4BZO9DBiuYnlAU0Drc=; b=5coUrf3Yf10HJ6OE1cfJwAX9vq
	izk3YNl9DQMY4Rp8Re7a/eRV4xZl2CT/QeIseam6lYOV4Myfr+uFAdRPsB4B0K8xOrJ8zAm3R3RU7
	yRkswrh8/8qRwAoH/xQtov+vkk7PfyFxuQpnCjkKV9X9sZ1xDoZ6ITH6L1+DBRyCM0LI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLA-00044D-Bs
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLA-0001Un-Au
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/i386: fix model number and add missing features for Icelake-Server CPU model
Message-Id: <E1kYcLA-0001Un-Au@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:44 +0000

commit e0013791b9326945ccd09b5b602437beb322cab8
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:47 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: fix model number and add missing features for Icelake-Server CPU model
    
    Add the missing features(sha_ni, avx512ifma, rdpid, fsrm,
    vmx-rdseed-exit, vmx-pml, vmx-eptp-switching) and change the model
    number to 106 in the Icelake-Server-v4 CPU model.
    
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-3-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3885826bc4..132ef90421 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3512,6 +3512,20 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 },
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "sha-ni", "on" },
+                    { "avx512ifma", "on" },
+                    { "rdpid", "on" },
+                    { "fsrm", "on" },
+                    { "vmx-rdseed-exit", "on" },
+                    { "vmx-pml", "on" },
+                    { "vmx-eptp-switching", "on" },
+                    { "model", "106" },
+                    { /* end of list */ }
+                },
+            },
             { /* end of list */ }
         }
     },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:53:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:53:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16418.40346 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLM-00058q-OS; Fri, 30 Oct 2020 21:53:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16418.40346; Fri, 30 Oct 2020 21:53:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLM-00058i-KU; Fri, 30 Oct 2020 21:53:56 +0000
Received: by outflank-mailman (input) for mailman id 16418;
 Fri, 30 Oct 2020 21:53:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcLL-00058W-9I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0d768c39-a6ce-46df-bf53-fb81c0ceef8b;
 Fri, 30 Oct 2020 21:53:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLK-00044X-Gk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLK-0001VX-F7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcLL-00058W-9I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:55 +0000
X-Inumbo-ID: 0d768c39-a6ce-46df-bf53-fb81c0ceef8b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0d768c39-a6ce-46df-bf53-fb81c0ceef8b;
	Fri, 30 Oct 2020 21:53:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=k9wZ+AtevKZHiRkxH0X+jy4EFVcCHvp1F6VLSH4MGpA=; b=HwNKU7PSpsiLbicGaQ0tyhmG1N
	X4qr2OS6CgKJ/wJVdu86KwBdZrohpVa3/sPGrXfOSOcf7ZVfCXMQU1CUfUfoQ5GW+uTM8dXqRNIqe
	/+NKZcPzVjKQgKFB7lrzVyAvJNmCe1cx+tk7UHsLrmMXGDXVJhulG3QIrqOHgsEAyUbk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLK-00044X-Gk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLK-0001VX-F7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:53:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
Message-Id: <E1kYcLK-0001VX-F7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:53:54 +0000

commit 644e3c5d812d1d672388124eeb43d0e26b3ff58c
Author:     Chenyi Qiang <chenyi.qiang@intel.com>
AuthorDate: Tue Jul 14 16:41:48 2020 +0800
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 11:05:03 2020 -0400

    target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
    
    Add the missing vmx features in Skylake-Server and Cascadelake-Server
    CPU models based on the output of Paolo's script.
    
    Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
    Message-Id: <20200714084148.26690-4-chenyi.qiang@intel.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/cpu.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 132ef90421..588f32e136 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3034,6 +3034,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                     { /* end of list */ }
                 }
             },
+            {
+                .version = 4,
+                .props = (PropValue[]) {
+                    { "vmx-eptp-switching", "on" },
+                    { /* end of list */ }
+                }
+            },
             { /* end of list */ }
         }
     },
@@ -3158,6 +3165,13 @@ static X86CPUDefinition builtin_x86_defs[] = {
                   { /* end of list */ }
               },
             },
+            { .version = 4,
+              .note = "ARCH_CAPABILITIES, no TSX",
+              .props = (PropValue[]) {
+                  { "vmx-eptp-switching", "on" },
+                  { /* end of list */ }
+              },
+            },
             { /* end of list */ }
         }
     },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16419.40350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLW-0005D9-Ql; Fri, 30 Oct 2020 21:54:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16419.40350; Fri, 30 Oct 2020 21:54:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLW-0005D1-Ns; Fri, 30 Oct 2020 21:54:06 +0000
Received: by outflank-mailman (input) for mailman id 16419;
 Fri, 30 Oct 2020 21:54:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcLV-0005Cs-JV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5e641e04-6664-4bad-b40d-0ab07a5cfa43;
 Fri, 30 Oct 2020 21:54:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLU-00044s-LK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLU-0001WC-JZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcLV-0005Cs-JV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:05 +0000
X-Inumbo-ID: 5e641e04-6664-4bad-b40d-0ab07a5cfa43
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5e641e04-6664-4bad-b40d-0ab07a5cfa43;
	Fri, 30 Oct 2020 21:54:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6vGhuhVV4YmrwvV46qoRdH5jEc8ttdbf3rRm7EIuqEo=; b=iufuwr9xgLDablJVFhnxQxTQGl
	7oU+JnmfX82UTJy1uANUnDBAxaS86USHYweHWdHc7hbMTfgaW1Owz66G6axzwTM1HQ/fuBxQf8uMU
	n2cCaf9HzS2vxdP98eN2tgjEbJWNmCw3I5C68pZNmXFunoiyhAUkYhJaLhHiDNU0Sfxk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLU-00044s-LK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLU-0001WC-JZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] i386: hvf: Explicitly set CR4 guest/host mask
Message-Id: <E1kYcLU-0001WC-JZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:04 +0000

commit 818b9f111d64b40661d08f5e23236ac1ca5df505
Author:     Roman Bolshakov <r.bolshakov@yadro.com>
AuthorDate: Tue Jul 14 12:07:27 2020 +0300
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 16 14:15:13 2020 -0400

    i386: hvf: Explicitly set CR4 guest/host mask
    
    Removal of register reset omitted initialization of CR4 guest/host mask.
    x86_64 guests aren't booting without it.
    
    Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
    Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
    Message-Id: <20200714090726.41082-1-r.bolshakov@yadro.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/hvf/vmx.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h
index 75ba1e2a5f..587b1b8375 100644
--- a/target/i386/hvf/vmx.h
+++ b/target/i386/hvf/vmx.h
@@ -166,6 +166,7 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
 
     wvmcs(vcpu, VMCS_GUEST_CR4, guest_cr4);
     wvmcs(vcpu, VMCS_CR4_SHADOW, cr4);
+    wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE);
 
     hv_vcpu_invalidate_tlb(vcpu);
     hv_vcpu_flush(vcpu);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16420.40355 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLg-0005EM-TN; Fri, 30 Oct 2020 21:54:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16420.40355; Fri, 30 Oct 2020 21:54:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLg-0005EE-PP; Fri, 30 Oct 2020 21:54:16 +0000
Received: by outflank-mailman (input) for mailman id 16420;
 Fri, 30 Oct 2020 21:54:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcLf-0005E4-IT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4c8aea7e-85ad-416e-8aa8-3c6acb134a3c;
 Fri, 30 Oct 2020 21:54:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLe-000453-PI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLe-0001Wk-ON
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcLf-0005E4-IT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:15 +0000
X-Inumbo-ID: 4c8aea7e-85ad-416e-8aa8-3c6acb134a3c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4c8aea7e-85ad-416e-8aa8-3c6acb134a3c;
	Fri, 30 Oct 2020 21:54:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KCWGYsMgwBLlqSnfGQWiwLjXKtgghwxujUFbJS9j0Ho=; b=zYQgbgSyDqdtNgasXscnB9nw7n
	pYjrhLdOWV5IPMrcyZ8tmzZ5Va5g54db7PBpJap/5x1qxNBrunVnjecQVvIvvGlwKFHBPZMBMKily
	GexnUGmFK9cPWe/6V3UTPZNhTGc10GoJM34VakBXt1acAAS4L1boMVFDIufqHGKzObuo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLe-000453-PI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLe-0001Wk-ON
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Message-Id: <E1kYcLe-0001Wk-ON@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:14 +0000

commit 151f76c689b1ff4c2c59e6d8469a0d4fe5346f55
Merge: 95d1fbabae0cd44156ac4b96d512d143ca7dfd5e 818b9f111d64b40661d08f5e23236ac1ca5df505
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 16 21:46:18 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 16 21:46:18 2020 +0100

    Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
    
    x86 fixes for -rc1
    
    Fixes for x86 that missed hard freeze:
    * Don't trigger warnings for features set by
      CPU model versions (Xiaoyao Li)
    * Missing features in Icelake-Server, Skylake-Server,
      Cascadelake-Server CPU models (Chenyi Qiang)
    * Fix hvf x86_64 guest boot crash (Roman Bolshakov)
    
    # gpg: Signature made Thu 16 Jul 2020 19:17:18 BST
    # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
    # gpg:                issuer "ehabkost@redhat.com"
    # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
    # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
    
    * remotes/ehabkost/tags/x86-next-pull-request:
      i386: hvf: Explicitly set CR4 guest/host mask
      target/i386: add the missing vmx features for Skylake-Server and Cascadelake-Server CPU models
      target/i386: fix model number and add missing features for Icelake-Server CPU model
      target/i386: add fast short REP MOV support
      i386/cpu: Don't add unavailable_features to env->user_features
      i368/cpu: Clear env->user_features after loading versioned CPU model
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 target/i386/cpu.c     | 38 ++++++++++++++++++++++++++++++++++++--
 target/i386/cpu.h     |  2 ++
 target/i386/hvf/vmx.h |  1 +
 3 files changed, 39 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16421.40358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLr-0005Ff-Tp; Fri, 30 Oct 2020 21:54:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16421.40358; Fri, 30 Oct 2020 21:54:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcLr-0005FX-Qq; Fri, 30 Oct 2020 21:54:27 +0000
Received: by outflank-mailman (input) for mailman id 16421;
 Fri, 30 Oct 2020 21:54:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcLp-0005FM-Tm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e8642886-72ee-4be8-aa50-b03948a6a990;
 Fri, 30 Oct 2020 21:54:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLp-00045C-65
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLp-0001Y0-5A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcLp-0005FM-Tm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
X-Inumbo-ID: e8642886-72ee-4be8-aa50-b03948a6a990
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e8642886-72ee-4be8-aa50-b03948a6a990;
	Fri, 30 Oct 2020 21:54:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BkjWtKB6saLrDSqqvCsGEzYQNr66B8W5B9jUIc9M5eQ=; b=jEfFxzawRkDHEO0rVM1S6E81Q+
	ir2GE99WEbGiYSXSQc76uRk6E9IdKtpOGZkKrOm4GYHVXW2d/9UZUc6i8Af0VtGYI7SBLW21ggaqM
	aX6JRMbFk5qdM9EKOE6+bPNFkrK9CAgDPjI6JXMSsfYJ8IZsYmSUmoOQi/zC9e3TsjIc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLp-00045C-65
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLp-0001Y0-5A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qtest: bios-tables-test: fix a memory leak
Message-Id: <E1kYcLp-0001Y0-5A@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:25 +0000

commit 82e258db15dc563e1d015c19b3af2d585695a7b1
Author:     Li Qiang <liq3ea@163.com>
AuthorDate: Tue Jul 14 08:35:36 2020 -0700
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    qtest: bios-tables-test: fix a memory leak
    
    Fixes: 5da7c35e25a("bios-tables-test: Add Q35/TPM-TIS test")
    Signed-off-by: Li Qiang <liq3ea@163.com>
    Message-Id: <20200714153536.66060-1-liq3ea@163.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Reviewed-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/bios-tables-test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index c315156858..d49b3988ec 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -924,6 +924,7 @@ static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
     g_free(variant);
     g_free(tmp_path);
     g_free(tmp_dir_name);
+    g_free(args);
     free_test_data(&data);
 #else
     g_test_skip("TPM disabled");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16422.40362 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcM1-0005Gy-Vn; Fri, 30 Oct 2020 21:54:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16422.40362; Fri, 30 Oct 2020 21:54:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcM1-0005Gp-SQ; Fri, 30 Oct 2020 21:54:37 +0000
Received: by outflank-mailman (input) for mailman id 16422;
 Fri, 30 Oct 2020 21:54:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcM0-0005Ge-7V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e1f91b4e-503c-448c-9416-c42d8b07e3a7;
 Fri, 30 Oct 2020 21:54:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLz-00045L-9m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcLz-0001YU-8u
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcM0-0005Ge-7V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:36 +0000
X-Inumbo-ID: e1f91b4e-503c-448c-9416-c42d8b07e3a7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e1f91b4e-503c-448c-9416-c42d8b07e3a7;
	Fri, 30 Oct 2020 21:54:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RQ/zTXwbVoWM4IZVQX2vbqUcw3VN7bcZCuCNpXQ50KE=; b=C+oIK+Pd05rt7/Eue4Cxytlfyq
	vrytlwA4+3KSE2hPBSRzTXgVw411Urc3JAVGscOD050Qhf0yx0bt0zvvzh785SEfRERXEBOsqoxAB
	coH1Fz41pFJUFmD2z4atUFNjEcMHOQYCqMkMjpQfAQaAMeAvzuxSKme8YAdJPqzTKGaw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLz-00045L-9m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcLz-0001YU-8u
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests: qmp-cmd-test: fix memory leak
Message-Id: <E1kYcLz-0001YU-8u@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:35 +0000

commit 15c51f724ec61ab6a6910c41113d6d07164b6ca4
Author:     Li Qiang <liq3ea@163.com>
AuthorDate: Wed Jul 15 08:41:17 2020 -0700
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    tests: qmp-cmd-test: fix memory leak
    
    Properly free each test response to avoid memory leak and separate
    qtest_qmp() calls with spare lines, in a consistent manner.
    
    Fixes: 5b88849e7b9("tests/qmp-cmd-test: Add qmp/object-add-failure-modes")
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Signed-off-by: Li Qiang <liq3ea@163.com>
    Message-Id: <20200715154117.15456-1-liq3ea@163.com>
    Fixes: 9fc719b869 ("tests/qmp-cmd-test: Add qmp/object-add-duplicate-id")
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/qmp-cmd-test.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
index c68f99f659..f7b1aa7fdc 100644
--- a/tests/qtest/qmp-cmd-test.c
+++ b/tests/qtest/qmp-cmd-test.c
@@ -230,6 +230,8 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
+
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
@@ -241,6 +243,7 @@ static void test_object_add_failure_modes(void)
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to create an object with a property of a wrong type */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -249,17 +252,20 @@ static void test_object_add_failure_modes(void)
     g_assert_nonnull(resp);
     /* now do it right */
     qmp_assert_error_class(resp, "GenericError");
+
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to create an object without the id */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -267,18 +273,21 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     qmp_assert_error_class(resp, "GenericError");
+
     /* now do it right */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* attempt to set a non existing property */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
@@ -286,23 +295,27 @@ static void test_object_add_failure_modes(void)
                      " 'props': {'sized': 1048576 } } }");
     g_assert_nonnull(resp);
     qmp_assert_error_class(resp, "GenericError");
+
     /* now do it right */
     resp = qtest_qmp(qts, "{'execute': 'object-add', 'arguments':"
                      " {'qom-type': 'memory-backend-ram', 'id': 'ram1',"
                      " 'props': {'size': 1048576 } } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object without id */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'ida': 'ram1' } }");
     g_assert_nonnull(resp);
+    qobject_unref(resp);
 
     /* delete ram1 object */
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
                      " {'id': 'ram1' } }");
     g_assert_nonnull(resp);
     g_assert(qdict_haskey(resp, "return"));
+    qobject_unref(resp);
 
     /* delete ram1 object that does not exist anymore*/
     resp = qtest_qmp(qts, "{'execute': 'object-del', 'arguments':"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16423.40366 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMC-0005Ix-14; Fri, 30 Oct 2020 21:54:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16423.40366; Fri, 30 Oct 2020 21:54:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMB-0005Ip-Tx; Fri, 30 Oct 2020 21:54:47 +0000
Received: by outflank-mailman (input) for mailman id 16423;
 Fri, 30 Oct 2020 21:54:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMA-0005Ie-Da
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 036bbda6-652b-40e9-85e4-a1b124969463;
 Fri, 30 Oct 2020 21:54:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcM9-00045u-DW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcM9-0001ZB-Cd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMA-0005Ie-Da
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:46 +0000
X-Inumbo-ID: 036bbda6-652b-40e9-85e4-a1b124969463
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 036bbda6-652b-40e9-85e4-a1b124969463;
	Fri, 30 Oct 2020 21:54:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Od1z4wsgNfZBkme9gElsL1NLD2C+gZaga92tAtAeq3g=; b=cayiwYKqENwn/nSfDsqZGdT47D
	ViE9y0m5cJWWL4PqJAh6osz2snCgcrT9ksW4Zp8aBGAKQr1LBXZnVGhxQz7FHsQtq4tkhyFBvcuHK
	aHqN/wusG91ZZ644wo6flmYyINbFkDLIBISP0Goeh5sy9klOyKYwKGJXkH8EuNLiZO+g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcM9-00045u-DW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcM9-0001ZB-Cd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fuzz: Expect the cmdline in a freeable GString
Message-Id: <E1kYcM9-0001ZB-Cd@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:45 +0000

commit f5ec79f5e0a3a307fc2a11b3ba8066a2d0a90233
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Tue Jul 14 13:46:16 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    fuzz: Expect the cmdline in a freeable GString
    
    In the initial FuzzTarget, get_init_cmdline returned a char *. With this
    API, we had no guarantee about where the string came from. For example,
    i440fx-qtest-reboot-fuzz simply returned a pointer to a string literal,
    while the QOS-based targets build the arguments out in a GString an
    return the gchar *str pointer. Since we did not try to free the cmdline,
    we have a leak for any targets that do not simply return string
    literals. Clean up this mess by forcing fuzz-targets to return
    a GString, that we can free.
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200714174616.20709-1-alxndr@bu.edu>
    Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c        | 13 ++++++-------
 tests/qtest/fuzz/fuzz.h        |  6 +++---
 tests/qtest/fuzz/i440fx_fuzz.c |  4 ++--
 tests/qtest/fuzz/qos_fuzz.c    |  6 +++---
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 0b66e43409..6bc17ef313 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -199,16 +199,15 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
     }
 
     /* Run QEMU's softmmu main with the fuzz-target dependent arguments */
-    const char *init_cmdline = fuzz_target->get_init_cmdline(fuzz_target);
-    init_cmdline = g_strdup_printf("%s -qtest /dev/null -qtest-log %s",
-                                   init_cmdline,
-                                   getenv("QTEST_LOG") ? "/dev/fd/2"
-                                                       : "/dev/null");
-
+    GString *cmd_line = fuzz_target->get_init_cmdline(fuzz_target);
+    g_string_append_printf(cmd_line,
+                           " -qtest /dev/null -qtest-log %s",
+                           getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null");
 
     /* Split the runcmd into an argv and argc */
     wordexp_t result;
-    wordexp(init_cmdline, &result, 0);
+    wordexp(cmd_line->str, &result, 0);
+    g_string_free(cmd_line, true);
 
     qemu_init(result.we_wordc, result.we_wordv, NULL);
 
diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index 72d5710f6c..9ca3d107c5 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -50,10 +50,10 @@ typedef struct FuzzTarget {
 
 
     /*
-     * returns the arg-list that is passed to qemu/softmmu init()
-     * Cannot be NULL
+     * Returns the arguments that are passed to qemu/softmmu init(). Freed by
+     * the caller.
      */
-    const char* (*get_init_cmdline)(struct FuzzTarget *);
+    GString *(*get_init_cmdline)(struct FuzzTarget *);
 
     /*
      * will run once, prior to running qemu/softmmu init.
diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c
index e2f31e56f9..bf966d478b 100644
--- a/tests/qtest/fuzz/i440fx_fuzz.c
+++ b/tests/qtest/fuzz/i440fx_fuzz.c
@@ -158,9 +158,9 @@ static void i440fx_fuzz_qos_fork(QTestState *s,
 
 static const char *i440fx_qtest_argv = TARGET_NAME " -machine accel=qtest"
                                        " -m 0 -display none";
-static const char *i440fx_argv(FuzzTarget *t)
+static GString *i440fx_argv(FuzzTarget *t)
 {
-    return i440fx_qtest_argv;
+    return g_string_new(i440fx_qtest_argv);
 }
 
 static void fork_init(void)
diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c
index 0c68f5361f..d52f3ebd83 100644
--- a/tests/qtest/fuzz/qos_fuzz.c
+++ b/tests/qtest/fuzz/qos_fuzz.c
@@ -66,7 +66,7 @@ void *qos_allocate_objects(QTestState *qts, QGuestAllocator **p_alloc)
     return allocate_objects(qts, current_path + 1, p_alloc);
 }
 
-static const char *qos_build_main_args(void)
+static GString *qos_build_main_args(void)
 {
     char **path = fuzz_path_vec;
     QOSGraphNode *test_node;
@@ -88,7 +88,7 @@ static const char *qos_build_main_args(void)
     /* Prepend the arguments that we need */
     g_string_prepend(cmd_line,
             TARGET_NAME " -display none -machine accel=qtest -m 64 ");
-    return cmd_line->str;
+    return cmd_line;
 }
 
 /*
@@ -189,7 +189,7 @@ static void walk_path(QOSGraphNode *orig_path, int len)
     g_free(path_str);
 }
 
-static const char *qos_get_cmdline(FuzzTarget *t)
+static GString *qos_get_cmdline(FuzzTarget *t)
 {
     /*
      * Set a global variable that we use to identify the qos_path for our
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:54:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:54:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16424.40372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMM-0005KA-3C; Fri, 30 Oct 2020 21:54:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16424.40372; Fri, 30 Oct 2020 21:54:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcML-0005K2-VU; Fri, 30 Oct 2020 21:54:57 +0000
Received: by outflank-mailman (input) for mailman id 16424;
 Fri, 30 Oct 2020 21:54:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMK-0005Jr-FX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 43d00051-82d8-4ddc-b825-7a3c4bb3ebec;
 Fri, 30 Oct 2020 21:54:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMJ-000462-HS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMJ-0001Zn-Gg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMK-0005Jr-FX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:56 +0000
X-Inumbo-ID: 43d00051-82d8-4ddc-b825-7a3c4bb3ebec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 43d00051-82d8-4ddc-b825-7a3c4bb3ebec;
	Fri, 30 Oct 2020 21:54:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UsxuHsJ+LZ3KrniNl+rixO1CKc+MhQpE9NB4NOvQsIQ=; b=TANpTka9xGnP0hZ5RIBQ6JKPSc
	4imeGgiQP3ucu2xSF7dZKuCbnZK2ltQ80i4piumt81jvgMI7Dxs1i5CcwJybGVN9Z6Y55ok1wMwuv
	cX0om9KHJDqwgkFFVq69uaKAr53Bb6R/h+0rygd1JOgw+5xtcDcRc4PZkBtnQ0WvK7oA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMJ-000462-HS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMJ-0001Zn-Gg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:54:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] configure: Fix for running with --enable-werror on macOS
Message-Id: <E1kYcMJ-0001Zn-Gg@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:54:55 +0000

commit 12a9b8d8240aaddf14774b9fb03af5e2e0b9f60a
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 16 07:12:22 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    configure: Fix for running with --enable-werror on macOS
    
    The configure script currently refuses to succeed when run on macOS
    with --enable-werror:
    
     ERROR: configure test passed without -Werror but failed with -Werror.
    
    The information in config.log indicates:
    
     config-temp/qemu-conf.c:3:55: error: control reaches end of non-void
     function [-Werror,-Wreturn-type]
     static void *f(void *p) { pthread_setname_np("QEMU"); }
                                                          ^
    And indeed, the return statement is missing here.
    
    Fixes: 479a57475e ("util: Implement debug-threads for macOS")
    Message-Id: <20200716055655.24507-1-thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b751c853f5..e93836aaae 100755
--- a/configure
+++ b/configure
@@ -4198,7 +4198,7 @@ pthread_setname_np_wo_tid=no
 cat > $TMPC << EOF
 #include <pthread.h>
 
-static void *f(void *p) { pthread_setname_np("QEMU"); }
+static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; }
 int main(void)
 {
     pthread_t thread;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16425.40374 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMW-0005LR-4T; Fri, 30 Oct 2020 21:55:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16425.40374; Fri, 30 Oct 2020 21:55:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMW-0005LJ-0k; Fri, 30 Oct 2020 21:55:08 +0000
Received: by outflank-mailman (input) for mailman id 16425;
 Fri, 30 Oct 2020 21:55:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMU-0005L7-Qr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f79937a2-40cf-47a8-ace1-54695c38be0d;
 Fri, 30 Oct 2020 21:55:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMT-00046P-M0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMT-0001al-KF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:05 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMU-0005L7-Qr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:06 +0000
X-Inumbo-ID: f79937a2-40cf-47a8-ace1-54695c38be0d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f79937a2-40cf-47a8-ace1-54695c38be0d;
	Fri, 30 Oct 2020 21:55:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2OM8hQXC1POo//7LLUCggDuHtZinh/u04XTv8k+TQg=; b=i3SRzP3G3YieWMDEp+aZjMx7Pn
	12Bhisu0AV3UGxam5yYF0Cfdh+jhKpkxohIk/iBunWnHa5A8EKTYgGoztueba0zUh3jV4BLa4x2zS
	AMXEInU8/t0MIFN6j15Vi7HGT7B8xgl233Vzz9ky1vZKVEQ+RAjs1F/8syn3ly0ofA8Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMT-00046P-M0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMT-0001al-KF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qom: Plug memory leak in "info qom-tree"
Message-Id: <E1kYcMT-0001al-KF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:05 +0000

commit ab2d185d6b1d3aa1ab2416a896347d235e32ac3d
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:59 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    qom: Plug memory leak in "info qom-tree"
    
    Commit e8c9e65816 "qom: Make "info qom-tree" show children sorted"
    created a memory leak, because I didn't realize
    object_get_canonical_path_component()'s value needs to be freed.
    
    Reproducer:
    
        $ qemu-system-x86_64 -nodefaults -display none -S -monitor stdio
        QEMU 5.0.50 monitor - type 'help' for more information
        (qemu) info qom-tree
    
    This leaks some 4500 path components, 12-13 characters on average,
    i.e. roughly 100kBytes depending on the allocator.  A couple of
    hundred "info qom-tree" here, a couple of hundred there, and soon
    enough we're talking about real memory.
    
    Plug the leak.
    
    Fixes: e8c9e65816f5dbfe18ad3b2be938d0d8192d459a
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reported-by: Reviewed-by: Li Qiang <liq3ea@gmail.com> [sent same patch]
    Message-Id: <20200714160202.3121879-3-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qom/qom-hmp-cmds.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index 9ed8bb1c9f..aaacadacca 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -96,8 +96,10 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
 static int qom_composition_compare(const void *a, const void *b, void *ignore)
 {
-    return g_strcmp0(a ? object_get_canonical_path_component(a) : NULL,
-                     b ? object_get_canonical_path_component(b) : NULL);
+    g_autofree char *ac = object_get_canonical_path_component(a);
+    g_autofree char *bc = object_get_canonical_path_component(b);
+
+    return g_strcmp0(ac, bc);
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16426.40379 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMf-0005N2-7W; Fri, 30 Oct 2020 21:55:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16426.40379; Fri, 30 Oct 2020 21:55:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMf-0005Ms-3w; Fri, 30 Oct 2020 21:55:17 +0000
Received: by outflank-mailman (input) for mailman id 16426;
 Fri, 30 Oct 2020 21:55:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMe-0005Mk-L1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c8e2deb-64c1-4d6f-b974-d24ecf13b70e;
 Fri, 30 Oct 2020 21:55:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMd-00046W-Q6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMd-0001bR-Ok
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMe-0005Mk-L1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:16 +0000
X-Inumbo-ID: 2c8e2deb-64c1-4d6f-b974-d24ecf13b70e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c8e2deb-64c1-4d6f-b974-d24ecf13b70e;
	Fri, 30 Oct 2020 21:55:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h/KUcO4TGSwg0Hvc0uY1oZWnsoAKV2MiF5zEfDQBFIk=; b=kf/0xshB6jmPihRWPiXUxW1zaq
	wu7fVYYnJLifGtgXWQFupEsMwicPEZkOO68cu121QBSU0pqcamBmn2UiSD9XAuY6THu24nolO+nDz
	hIMsK9B9f91W+H/I4lWnCkzNF/RTF0/pa9No0rpduB/i7Evf/y8ZI43dguDjxS2a25Hc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMd-00046W-Q6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMd-0001bR-Ok
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] gitlab-ci.yml: Add fuzzer tests
Message-Id: <E1kYcMd-0001bR-Ok@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:15 +0000

commit b610eba335d5c8ac7484dbb1c886b125e2dea058
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 15 06:32:48 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Fri Jul 17 10:44:23 2020 +0200

    gitlab-ci.yml: Add fuzzer tests
    
    So far we neither compile-tested nor run any of the new fuzzers in our CI,
    which led to some build failures of the fuzzer code in the past weeks.
    To avoid this problem, add a job to compile the fuzzer code and run some
    loops (which likely don't find any new bugs via fuzzing, but at least we
    know that the code can still be run).
    
    A nice side-effect of this test is that the leak tests are enabled here,
    so we should now notice some of the memory leaks in our code base earlier.
    
    Message-Id: <20200716100950.27396-1-thuth@redhat.com>
    Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5eeba2791b..41597c3603 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -161,9 +161,27 @@ build-clang:
     IMAGE: fedora
     CONFIGURE_ARGS: --cc=clang --cxx=clang++
     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
-      ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user
+      ppc-softmmu s390x-softmmu arm-linux-user
     MAKE_CHECK_ARGS: check
 
+build-fuzzer:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: fedora
+  script:
+    - mkdir build
+    - cd build
+    - ../configure --cc=clang --cxx=clang++ --enable-fuzzing
+                   --enable-sanitizers --target-list=x86_64-softmmu
+    - make -j"$JOBS" all check-build x86_64-softmmu/fuzz
+    - make check
+    - for fuzzer in i440fx-qos-fork-fuzz i440fx-qos-noreset-fuzz
+        i440fx-qtest-reboot-fuzz virtio-scsi-flags-fuzz virtio-scsi-fuzz ; do
+          echo Testing ${fuzzer} ... ;
+          x86_64-softmmu/qemu-fuzz-x86_64 --fuzz-target=${fuzzer} -runs=1000
+            || exit 1 ;
+      done
+
 build-tci:
   <<: *native_build_job_definition
   variables:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16428.40382 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMp-0005OO-8v; Fri, 30 Oct 2020 21:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16428.40382; Fri, 30 Oct 2020 21:55:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcMp-0005OD-5a; Fri, 30 Oct 2020 21:55:27 +0000
Received: by outflank-mailman (input) for mailman id 16428;
 Fri, 30 Oct 2020 21:55:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMo-0005O6-NI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c7aaed22-8d18-435f-b8f2-3222b4673404;
 Fri, 30 Oct 2020 21:55:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMn-00046p-Tz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMn-0001bt-T8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMo-0005O6-NI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:26 +0000
X-Inumbo-ID: c7aaed22-8d18-435f-b8f2-3222b4673404
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c7aaed22-8d18-435f-b8f2-3222b4673404;
	Fri, 30 Oct 2020 21:55:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aOmiZKSeuBU9MLEZey/IU9gSkCs4pqk/OEj97XIK2Qw=; b=3XkjHStru5NqyPmgbA6t5ptb2I
	CnJwoesEoXO7omn3ztLteKG9RuXS6GXG5TjS6C1nT1biXEOYYkIjlmHd0U8sY1n3vXbNl9/kVkQqk
	D+cm+9obz9GqHTRMjZZm1gY/7a/hhvcx3Yeg/8+BcFRs7TKlFM64nCPZCDpToBChn8aQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMn-00046p-Tz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMn-0001bt-T8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-17' into staging
Message-Id: <E1kYcMn-0001bt-T8@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:25 +0000

commit b7bda69c4ef46c57480f6e378923f5215b122778
Merge: 151f76c689b1ff4c2c59e6d8469a0d4fe5346f55 b610eba335d5c8ac7484dbb1c886b125e2dea058
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 12:06:02 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 17 12:06:02 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-17' into staging
    
    * Leak fixes
    * One fix for running with --enable-werror on macOS
    * Add fuzzer test to the Gitlab-CI
    
    # gpg: Signature made Fri 17 Jul 2020 10:53:07 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-17:
      gitlab-ci.yml: Add fuzzer tests
      qom: Plug memory leak in "info qom-tree"
      configure: Fix for running with --enable-werror on macOS
      fuzz: Expect the cmdline in a freeable GString
      tests: qmp-cmd-test: fix memory leak
      qtest: bios-tables-test: fix a memory leak
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml                 | 20 +++++++++++++++++++-
 configure                      |  2 +-
 qom/qom-hmp-cmds.c             |  6 ++++--
 tests/qtest/bios-tables-test.c |  1 +
 tests/qtest/fuzz/fuzz.c        | 13 ++++++-------
 tests/qtest/fuzz/fuzz.h        |  6 +++---
 tests/qtest/fuzz/i440fx_fuzz.c |  4 ++--
 tests/qtest/fuzz/qos_fuzz.c    |  6 +++---
 tests/qtest/qmp-cmd-test.c     | 13 +++++++++++++
 9 files changed, 52 insertions(+), 19 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16429.40386 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcN0-0005Pf-AC; Fri, 30 Oct 2020 21:55:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16429.40386; Fri, 30 Oct 2020 21:55:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcN0-0005PX-7D; Fri, 30 Oct 2020 21:55:38 +0000
Received: by outflank-mailman (input) for mailman id 16429;
 Fri, 30 Oct 2020 21:55:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcMz-0005PQ-4q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 735f720e-f8b1-4c88-8d27-9fcc7239ca27;
 Fri, 30 Oct 2020 21:55:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMy-00046w-DF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcMy-0001ds-CQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcMz-0005PQ-4q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:37 +0000
X-Inumbo-ID: 735f720e-f8b1-4c88-8d27-9fcc7239ca27
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 735f720e-f8b1-4c88-8d27-9fcc7239ca27;
	Fri, 30 Oct 2020 21:55:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aBBAA4P2FU6Nje7a1YXtulQTtd7mVh+TXNPaZxek46s=; b=Lc+kJp/WmMaYZQu+7DxqxNIJXn
	52TnlYJmh5/IWYXSbSYBorzkW7RQatZhn0FmQmBk1Wn6kGOq/fhAP6SRnWxHId4c7KR6pn58xgERQ
	Sz4e6a2WeE6pnolCF9OhaBKdK22l21Tprbq5KsuWYH9GGoqiuCzgxZubRLEkgnTuq6Yw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMy-00046w-DF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcMy-0001ds-CQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] vvfat: set status to odd fixes
Message-Id: <E1kYcMy-0001ds-CQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:36 +0000

commit 4b7c5bc447070bd1573bc8ae7294f3a64525c20b
Author:     Prasad J Pandit <pjp@fedoraproject.org>
AuthorDate: Sat Jul 11 00:34:51 2020 +0530
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    vvfat: set status to odd fixes
    
    Virtual VFAT driver is quite old and rarely used. Set its status
    to Odd Fixes.
    
    Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
    Message-Id: <20200710190451.761286-1-ppandit@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 030faf0249..5d9c56e441 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2987,7 +2987,7 @@ F: block/vpc.c
 vvfat
 M: Kevin Wolf <kwolf@redhat.com>
 L: qemu-block@nongnu.org
-S: Supported
+S: Odd Fixes
 F: block/vvfat.c
 
 Image format fuzzer
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16430.40390 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNB-0005RN-Bl; Fri, 30 Oct 2020 21:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16430.40390; Fri, 30 Oct 2020 21:55:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNB-0005RG-8m; Fri, 30 Oct 2020 21:55:49 +0000
Received: by outflank-mailman (input) for mailman id 16430;
 Fri, 30 Oct 2020 21:55:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNA-0005RB-S6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f16ce75e-39ad-40b3-8f9d-24c41bc80998;
 Fri, 30 Oct 2020 21:55:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcN8-00047i-Hk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcN8-0001eW-Gl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNA-0005RB-S6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:48 +0000
X-Inumbo-ID: f16ce75e-39ad-40b3-8f9d-24c41bc80998
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f16ce75e-39ad-40b3-8f9d-24c41bc80998;
	Fri, 30 Oct 2020 21:55:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I9Wr72Mz0qZ0kgE6a4IdZIIDNEccGL7O444xOdKeCzM=; b=YqmxsLeiok0sN8UucvqEP1cQbC
	n7t0o7gRBajFE+4qQb8eZKmFLyCi1E8EkSqwJZT3yEgFRjj8SQYF8Z1fJ5SGa4kVKcIfJAgwHAc38
	n4EHNBxjz7K0AmEU7mDMmyokeHzhL1juL5NTOIzcyaHR8Wpx27Dmuj37fs+pa8oLe7vQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcN8-00047i-Hk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcN8-0001eW-Gl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Remove VXHS block device
Message-Id: <E1kYcN8-0001eW-Gl@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:46 +0000

commit a08464521ccb302a24c7785f50ce32473904136c
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sat Jul 11 10:59:26 2020 +0400
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    Remove VXHS block device
    
    The vxhs code doesn't compile since v2.12.0. There's no point in fixing
    and then adding CI for a config that our users have demonstrated that
    they do not use; better to just remove it.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200711065926.2204721-1-marcandre.lureau@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/Makefile.objs              |   2 -
 block/trace-events               |  17 --
 block/vxhs.c                     | 587 ---------------------------------------
 configure                        |  39 ---
 docs/system/deprecated.rst       |   8 +
 qapi/block-core.json             |  22 +-
 tests/qemu-iotests/017           |   1 -
 tests/qemu-iotests/029           |   1 -
 tests/qemu-iotests/073           |   1 -
 tests/qemu-iotests/114           |   1 -
 tests/qemu-iotests/130           |   1 -
 tests/qemu-iotests/134           |   1 -
 tests/qemu-iotests/156           |   1 -
 tests/qemu-iotests/158           |   1 -
 tests/qemu-iotests/282           |   1 -
 tests/qemu-iotests/check         |  10 -
 tests/qemu-iotests/common.filter |   1 -
 tests/qemu-iotests/common.rc     |  33 ---
 18 files changed, 10 insertions(+), 718 deletions(-)

diff --git a/block/Makefile.objs b/block/Makefile.objs
index 577e578bc2..19c6f371c9 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -31,7 +31,6 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
 block-obj-$(CONFIG_CURL) += curl.o
 block-obj-$(CONFIG_RBD) += rbd.o
 block-obj-$(CONFIG_GLUSTERFS) += gluster.o
-block-obj-$(CONFIG_VXHS) += vxhs.o
 block-obj-$(CONFIG_LIBSSH) += ssh.o
 block-obj-y += accounting.o dirty-bitmap.o
 block-obj-y += write-threshold.o
@@ -61,7 +60,6 @@ rbd.o-cflags       := $(RBD_CFLAGS)
 rbd.o-libs         := $(RBD_LIBS)
 gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
 gluster.o-libs     := $(GLUSTERFS_LIBS)
-vxhs.o-libs        := $(VXHS_LIBS)
 ssh.o-cflags       := $(LIBSSH_CFLAGS)
 ssh.o-libs         := $(LIBSSH_LIBS)
 block-obj-dmg-bz2-$(CONFIG_BZIP2) += dmg-bz2.o
diff --git a/block/trace-events b/block/trace-events
index dbe76a7613..d3533ca896 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -136,23 +136,6 @@ qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t o
 qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64
 qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
 
-# vxhs.c
-vxhs_iio_callback(int error) "ctx is NULL: error %d"
-vxhs_iio_callback_chnfail(int err, int error) "QNIO channel failed, no i/o %d, %d"
-vxhs_iio_callback_unknwn(int opcode, int err) "unexpected opcode %d, errno %d"
-vxhs_aio_rw_invalid(int req) "Invalid I/O request iodir %d"
-vxhs_aio_rw_ioerr(char *guid, int iodir, uint64_t size, uint64_t off, void *acb, int ret, int err) "IO ERROR (vDisk %s) FOR : Read/Write = %d size = %"PRIu64" offset = %"PRIu64" ACB = %p. Error = %d, errno = %d"
-vxhs_get_vdisk_stat_err(char *guid, int ret, int err) "vDisk (%s) stat ioctl failed, ret = %d, errno = %d"
-vxhs_get_vdisk_stat(char *vdisk_guid, uint64_t vdisk_size) "vDisk %s stat ioctl returned size %"PRIu64
-vxhs_complete_aio(void *acb, uint64_t ret) "aio failed acb %p ret %"PRIu64
-vxhs_parse_uri_filename(const char *filename) "URI passed via bdrv_parse_filename %s"
-vxhs_open_vdiskid(const char *vdisk_id) "Opening vdisk-id %s"
-vxhs_open_hostinfo(char *of_vsa_addr, int port) "Adding host %s:%d to BDRVVXHSState"
-vxhs_open_iio_open(const char *host) "Failed to connect to storage agent on host %s"
-vxhs_parse_uri_hostinfo(char *host, int port) "Host: IP %s, Port %d"
-vxhs_close(char *vdisk_guid) "Closing vdisk %s"
-vxhs_get_creds(const char *cacert, const char *client_key, const char *client_cert) "cacert %s, client_key %s, client_cert %s"
-
 # nvme.c
 nvme_kick(void *s, int queue) "s %p queue %d"
 nvme_dma_flush_queue_wait(void *s) "s %p"
diff --git a/block/vxhs.c b/block/vxhs.c
deleted file mode 100644
index dc0e254730..0000000000
--- a/block/vxhs.c
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- * QEMU Block driver for Veritas HyperScale (VxHS)
- *
- * Copyright (c) 2017 Veritas Technologies LLC.
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include <qnio/qnio_api.h>
-#include <sys/param.h>
-#include "block/block_int.h"
-#include "block/qdict.h"
-#include "qapi/qmp/qerror.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qstring.h"
-#include "trace.h"
-#include "qemu/module.h"
-#include "qemu/uri.h"
-#include "qapi/error.h"
-#include "qemu/uuid.h"
-#include "crypto/tlscredsx509.h"
-#include "sysemu/replay.h"
-
-#define VXHS_OPT_FILENAME           "filename"
-#define VXHS_OPT_VDISK_ID           "vdisk-id"
-#define VXHS_OPT_SERVER             "server"
-#define VXHS_OPT_HOST               "host"
-#define VXHS_OPT_PORT               "port"
-
-/* Only accessed under QEMU global mutex */
-static uint32_t vxhs_ref;
-
-typedef enum {
-    VDISK_AIO_READ,
-    VDISK_AIO_WRITE,
-} VDISKAIOCmd;
-
-/*
- * HyperScale AIO callbacks structure
- */
-typedef struct VXHSAIOCB {
-    BlockAIOCB common;
-    int err;
-} VXHSAIOCB;
-
-typedef struct VXHSvDiskHostsInfo {
-    void *dev_handle; /* Device handle */
-    char *host; /* Host name or IP */
-    int port; /* Host's port number */
-} VXHSvDiskHostsInfo;
-
-/*
- * Structure per vDisk maintained for state
- */
-typedef struct BDRVVXHSState {
-    VXHSvDiskHostsInfo vdisk_hostinfo; /* Per host info */
-    char *vdisk_guid;
-    char *tlscredsid; /* tlscredsid */
-} BDRVVXHSState;
-
-static void vxhs_complete_aio_bh(void *opaque)
-{
-    VXHSAIOCB *acb = opaque;
-    BlockCompletionFunc *cb = acb->common.cb;
-    void *cb_opaque = acb->common.opaque;
-    int ret = 0;
-
-    if (acb->err != 0) {
-        trace_vxhs_complete_aio(acb, acb->err);
-        ret = (-EIO);
-    }
-
-    qemu_aio_unref(acb);
-    cb(cb_opaque, ret);
-}
-
-/*
- * Called from a libqnio thread
- */
-static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error)
-{
-    VXHSAIOCB *acb = NULL;
-
-    switch (opcode) {
-    case IRP_READ_REQUEST:
-    case IRP_WRITE_REQUEST:
-
-        /*
-         * ctx is VXHSAIOCB*
-         * ctx is NULL if error is QNIOERROR_CHANNEL_HUP
-         */
-        if (ctx) {
-            acb = ctx;
-        } else {
-            trace_vxhs_iio_callback(error);
-            goto out;
-        }
-
-        if (error) {
-            if (!acb->err) {
-                acb->err = error;
-            }
-            trace_vxhs_iio_callback(error);
-        }
-
-        replay_bh_schedule_oneshot_event(bdrv_get_aio_context(acb->common.bs),
-                                         vxhs_complete_aio_bh, acb);
-        break;
-
-    default:
-        if (error == QNIOERROR_HUP) {
-            /*
-             * Channel failed, spontaneous notification,
-             * not in response to I/O
-             */
-            trace_vxhs_iio_callback_chnfail(error, errno);
-        } else {
-            trace_vxhs_iio_callback_unknwn(opcode, error);
-        }
-        break;
-    }
-out:
-    return;
-}
-
-static QemuOptsList runtime_opts = {
-    .name = "vxhs",
-    .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
-    .desc = {
-        {
-            .name = VXHS_OPT_FILENAME,
-            .type = QEMU_OPT_STRING,
-            .help = "URI to the Veritas HyperScale image",
-        },
-        {
-            .name = VXHS_OPT_VDISK_ID,
-            .type = QEMU_OPT_STRING,
-            .help = "UUID of the VxHS vdisk",
-        },
-        {
-            .name = "tls-creds",
-            .type = QEMU_OPT_STRING,
-            .help = "ID of the TLS/SSL credentials to use",
-        },
-        { /* end of list */ }
-    },
-};
-
-static QemuOptsList runtime_tcp_opts = {
-    .name = "vxhs_tcp",
-    .head = QTAILQ_HEAD_INITIALIZER(runtime_tcp_opts.head),
-    .desc = {
-        {
-            .name = VXHS_OPT_HOST,
-            .type = QEMU_OPT_STRING,
-            .help = "host address (ipv4 addresses)",
-        },
-        {
-            .name = VXHS_OPT_PORT,
-            .type = QEMU_OPT_NUMBER,
-            .help = "port number on which VxHSD is listening (default 9999)",
-            .def_value_str = "9999"
-        },
-        { /* end of list */ }
-    },
-};
-
-/*
- * Parse incoming URI and populate *options with the host
- * and device information
- */
-static int vxhs_parse_uri(const char *filename, QDict *options)
-{
-    URI *uri = NULL;
-    char *port;
-    int ret = 0;
-
-    trace_vxhs_parse_uri_filename(filename);
-    uri = uri_parse(filename);
-    if (!uri || !uri->server || !uri->path) {
-        uri_free(uri);
-        return -EINVAL;
-    }
-
-    qdict_put_str(options, VXHS_OPT_SERVER ".host", uri->server);
-
-    if (uri->port) {
-        port = g_strdup_printf("%d", uri->port);
-        qdict_put_str(options, VXHS_OPT_SERVER ".port", port);
-        g_free(port);
-    }
-
-    qdict_put_str(options, "vdisk-id", uri->path);
-
-    trace_vxhs_parse_uri_hostinfo(uri->server, uri->port);
-    uri_free(uri);
-
-    return ret;
-}
-
-static void vxhs_parse_filename(const char *filename, QDict *options,
-                                Error **errp)
-{
-    if (qdict_haskey(options, "vdisk-id") || qdict_haskey(options, "server")) {
-        error_setg(errp, "vdisk-id/server and a file name may not be specified "
-                         "at the same time");
-        return;
-    }
-
-    if (strstr(filename, "://")) {
-        int ret = vxhs_parse_uri(filename, options);
-        if (ret < 0) {
-            error_setg(errp, "Invalid URI. URI should be of the form "
-                       "  vxhs://<host_ip>:<port>/<vdisk-id>");
-        }
-    }
-}
-
-static void vxhs_refresh_limits(BlockDriverState *bs, Error **errp)
-{
-    /* XXX Does VXHS support AIO on less than 512-byte alignment? */
-    bs->bl.request_alignment = 512;
-}
-
-static int vxhs_init_and_ref(void)
-{
-    if (vxhs_ref++ == 0) {
-        if (iio_init(QNIO_VERSION, vxhs_iio_callback)) {
-            return -ENODEV;
-        }
-    }
-    return 0;
-}
-
-static void vxhs_unref(void)
-{
-    if (--vxhs_ref == 0) {
-        iio_fini();
-    }
-}
-
-static void vxhs_get_tls_creds(const char *id, char **cacert,
-                               char **key, char **cert, Error **errp)
-{
-    Object *obj;
-    QCryptoTLSCreds *creds;
-    QCryptoTLSCredsX509 *creds_x509;
-
-    obj = object_resolve_path_component(
-        object_get_objects_root(), id);
-
-    if (!obj) {
-        error_setg(errp, "No TLS credentials with id '%s'",
-                   id);
-        return;
-    }
-
-    creds_x509 = (QCryptoTLSCredsX509 *)
-        object_dynamic_cast(obj, TYPE_QCRYPTO_TLS_CREDS_X509);
-
-    if (!creds_x509) {
-        error_setg(errp, "Object with id '%s' is not TLS credentials",
-                   id);
-        return;
-    }
-
-    creds = &creds_x509->parent_obj;
-
-    if (creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) {
-        error_setg(errp,
-                   "Expecting TLS credentials with a client endpoint");
-        return;
-    }
-
-    /*
-     * Get the cacert, client_cert and client_key file names.
-     */
-    if (!creds->dir) {
-        error_setg(errp, "TLS object missing 'dir' property value");
-        return;
-    }
-
-    *cacert = g_strdup_printf("%s/%s", creds->dir,
-                              QCRYPTO_TLS_CREDS_X509_CA_CERT);
-    *cert = g_strdup_printf("%s/%s", creds->dir,
-                            QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);
-    *key = g_strdup_printf("%s/%s", creds->dir,
-                           QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);
-}
-
-static int vxhs_open(BlockDriverState *bs, QDict *options,
-                     int bdrv_flags, Error **errp)
-{
-    BDRVVXHSState *s = bs->opaque;
-    void *dev_handlep;
-    QDict *backing_options = NULL;
-    QemuOpts *opts = NULL;
-    QemuOpts *tcp_opts = NULL;
-    char *of_vsa_addr = NULL;
-    Error *local_err = NULL;
-    const char *vdisk_id_opt;
-    const char *server_host_opt;
-    int ret = 0;
-    char *cacert = NULL;
-    char *client_key = NULL;
-    char *client_cert = NULL;
-
-    ret = vxhs_init_and_ref();
-    if (ret < 0) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* Create opts info from runtime_opts and runtime_tcp_opts list */
-    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
-
-    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* vdisk-id is the disk UUID */
-    vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID);
-    if (!vdisk_id_opt) {
-        error_setg(errp, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* vdisk-id may contain a leading '/' */
-    if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) {
-        error_setg(errp, "vdisk-id cannot be more than %d characters",
-                   UUID_FMT_LEN);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    s->vdisk_guid = g_strdup(vdisk_id_opt);
-    trace_vxhs_open_vdiskid(vdisk_id_opt);
-
-    /* get the 'server.' arguments */
-    qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
-
-    if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, errp)) {
-        ret = -EINVAL;
-        goto out;
-    }
-
-    server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST);
-    if (!server_host_opt) {
-        error_setg(errp, QERR_MISSING_PARAMETER,
-                   VXHS_OPT_SERVER"."VXHS_OPT_HOST);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    if (strlen(server_host_opt) > MAXHOSTNAMELEN) {
-        error_setg(errp, "server.host cannot be more than %d characters",
-                   MAXHOSTNAMELEN);
-        ret = -EINVAL;
-        goto out;
-    }
-
-    /* check if we got tls-creds via the --object argument */
-    s->tlscredsid = g_strdup(qemu_opt_get(opts, "tls-creds"));
-    if (s->tlscredsid) {
-        vxhs_get_tls_creds(s->tlscredsid, &cacert, &client_key,
-                           &client_cert, &local_err);
-        if (local_err != NULL) {
-            ret = -EINVAL;
-            goto out;
-        }
-        trace_vxhs_get_creds(cacert, client_key, client_cert);
-    }
-
-    s->vdisk_hostinfo.host = g_strdup(server_host_opt);
-    s->vdisk_hostinfo.port = g_ascii_strtoll(qemu_opt_get(tcp_opts,
-                                                          VXHS_OPT_PORT),
-                                                          NULL, 0);
-
-    trace_vxhs_open_hostinfo(s->vdisk_hostinfo.host,
-                             s->vdisk_hostinfo.port);
-
-    of_vsa_addr = g_strdup_printf("of://%s:%d",
-                                  s->vdisk_hostinfo.host,
-                                  s->vdisk_hostinfo.port);
-
-    /*
-     * Open qnio channel to storage agent if not opened before
-     */
-    dev_handlep = iio_open(of_vsa_addr, s->vdisk_guid, 0,
-                           cacert, client_key, client_cert);
-    if (dev_handlep == NULL) {
-        trace_vxhs_open_iio_open(of_vsa_addr);
-        ret = -ENODEV;
-        goto out;
-    }
-    s->vdisk_hostinfo.dev_handle = dev_handlep;
-
-out:
-    g_free(of_vsa_addr);
-    qobject_unref(backing_options);
-    qemu_opts_del(tcp_opts);
-    qemu_opts_del(opts);
-    g_free(cacert);
-    g_free(client_key);
-    g_free(client_cert);
-
-    if (ret < 0) {
-        vxhs_unref();
-        g_free(s->vdisk_hostinfo.host);
-        g_free(s->vdisk_guid);
-        g_free(s->tlscredsid);
-        s->vdisk_guid = NULL;
-    }
-
-    return ret;
-}
-
-static const AIOCBInfo vxhs_aiocb_info = {
-    .aiocb_size = sizeof(VXHSAIOCB)
-};
-
-/*
- * This allocates QEMU-VXHS callback for each IO
- * and is passed to QNIO. When QNIO completes the work,
- * it will be passed back through the callback.
- */
-static BlockAIOCB *vxhs_aio_rw(BlockDriverState *bs, uint64_t offset,
-                               QEMUIOVector *qiov, uint64_t size,
-                               BlockCompletionFunc *cb, void *opaque,
-                               VDISKAIOCmd iodir)
-{
-    VXHSAIOCB *acb = NULL;
-    BDRVVXHSState *s = bs->opaque;
-    int iio_flags = 0;
-    int ret = 0;
-    void *dev_handle = s->vdisk_hostinfo.dev_handle;
-
-    acb = qemu_aio_get(&vxhs_aiocb_info, bs, cb, opaque);
-
-    /*
-     * Initialize VXHSAIOCB.
-     */
-    acb->err = 0;
-
-    iio_flags = IIO_FLAG_ASYNC;
-
-    switch (iodir) {
-    case VDISK_AIO_WRITE:
-            ret = iio_writev(dev_handle, acb, qiov->iov, qiov->niov,
-                             offset, size, iio_flags);
-            break;
-    case VDISK_AIO_READ:
-            ret = iio_readv(dev_handle, acb, qiov->iov, qiov->niov,
-                            offset, size, iio_flags);
-            break;
-    default:
-            trace_vxhs_aio_rw_invalid(iodir);
-            goto errout;
-    }
-
-    if (ret != 0) {
-        trace_vxhs_aio_rw_ioerr(s->vdisk_guid, iodir, size, offset,
-                                acb, ret, errno);
-        goto errout;
-    }
-    return &acb->common;
-
-errout:
-    qemu_aio_unref(acb);
-    return NULL;
-}
-
-static BlockAIOCB *vxhs_aio_preadv(BlockDriverState *bs,
-                                   uint64_t offset, uint64_t bytes,
-                                   QEMUIOVector *qiov, int flags,
-                                   BlockCompletionFunc *cb, void *opaque)
-{
-    return vxhs_aio_rw(bs, offset, qiov, bytes, cb, opaque, VDISK_AIO_READ);
-}
-
-static BlockAIOCB *vxhs_aio_pwritev(BlockDriverState *bs,
-                                    uint64_t offset, uint64_t bytes,
-                                    QEMUIOVector *qiov, int flags,
-                                    BlockCompletionFunc *cb, void *opaque)
-{
-    return vxhs_aio_rw(bs, offset, qiov, bytes, cb, opaque, VDISK_AIO_WRITE);
-}
-
-static void vxhs_close(BlockDriverState *bs)
-{
-    BDRVVXHSState *s = bs->opaque;
-
-    trace_vxhs_close(s->vdisk_guid);
-
-    g_free(s->vdisk_guid);
-    s->vdisk_guid = NULL;
-
-    /*
-     * Close vDisk device
-     */
-    if (s->vdisk_hostinfo.dev_handle) {
-        iio_close(s->vdisk_hostinfo.dev_handle);
-        s->vdisk_hostinfo.dev_handle = NULL;
-    }
-
-    vxhs_unref();
-
-    /*
-     * Free the dynamically allocated host string etc
-     */
-    g_free(s->vdisk_hostinfo.host);
-    g_free(s->tlscredsid);
-    s->tlscredsid = NULL;
-    s->vdisk_hostinfo.host = NULL;
-    s->vdisk_hostinfo.port = 0;
-}
-
-static int64_t vxhs_get_vdisk_stat(BDRVVXHSState *s)
-{
-    int64_t vdisk_size = -1;
-    int ret = 0;
-    void *dev_handle = s->vdisk_hostinfo.dev_handle;
-
-    ret = iio_ioctl(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0);
-    if (ret < 0) {
-        trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno);
-        return -EIO;
-    }
-
-    trace_vxhs_get_vdisk_stat(s->vdisk_guid, vdisk_size);
-    return vdisk_size;
-}
-
-/*
- * Returns the size of vDisk in bytes. This is required
- * by QEMU block upper block layer so that it is visible
- * to guest.
- */
-static int64_t vxhs_getlength(BlockDriverState *bs)
-{
-    BDRVVXHSState *s = bs->opaque;
-    int64_t vdisk_size;
-
-    vdisk_size = vxhs_get_vdisk_stat(s);
-    if (vdisk_size < 0) {
-        return -EIO;
-    }
-
-    return vdisk_size;
-}
-
-static const char *const vxhs_strong_runtime_opts[] = {
-    VXHS_OPT_VDISK_ID,
-    "tls-creds",
-    VXHS_OPT_HOST,
-    VXHS_OPT_PORT,
-    VXHS_OPT_SERVER".",
-
-    NULL
-};
-
-static BlockDriver bdrv_vxhs = {
-    .format_name                  = "vxhs",
-    .protocol_name                = "vxhs",
-    .instance_size                = sizeof(BDRVVXHSState),
-    .bdrv_file_open               = vxhs_open,
-    .bdrv_parse_filename          = vxhs_parse_filename,
-    .bdrv_refresh_limits          = vxhs_refresh_limits,
-    .bdrv_close                   = vxhs_close,
-    .bdrv_getlength               = vxhs_getlength,
-    .bdrv_aio_preadv              = vxhs_aio_preadv,
-    .bdrv_aio_pwritev             = vxhs_aio_pwritev,
-    .strong_runtime_opts          = vxhs_strong_runtime_opts,
-};
-
-static void bdrv_vxhs_init(void)
-{
-    bdrv_register(&bdrv_vxhs);
-}
-
-block_init(bdrv_vxhs_init);
diff --git a/configure b/configure
index b751c853f5..8227962b45 100755
--- a/configure
+++ b/configure
@@ -501,7 +501,6 @@ numa=""
 tcmalloc="no"
 jemalloc="no"
 replication="yes"
-vxhs=""
 bochs="yes"
 cloop="yes"
 dmg="yes"
@@ -1541,10 +1540,6 @@ for opt do
   ;;
   --enable-replication) replication="yes"
   ;;
-  --disable-vxhs) vxhs="no"
-  ;;
-  --enable-vxhs) vxhs="yes"
-  ;;
   --disable-bochs) bochs="no"
   ;;
   --enable-bochs) bochs="yes"
@@ -1932,7 +1927,6 @@ disabled with --disable-FEATURE, default is enabled if available:
   xfsctl          xfsctl support
   qom-cast-debug  cast debugging support
   tools           build qemu-io, qemu-nbd and qemu-img tools
-  vxhs            Veritas HyperScale vDisk backend support
   bochs           bochs image format support
   cloop           cloop image format support
   dmg             dmg image format support
@@ -6249,33 +6243,6 @@ if compile_prog "" "" ; then
     have_sysmacros=yes
 fi
 
-##########################################
-# Veritas HyperScale block driver VxHS
-# Check if libvxhs is installed
-
-if test "$vxhs" != "no" ; then
-  cat > $TMPC <<EOF
-#include <stdint.h>
-#include <qnio/qnio_api.h>
-
-void *vxhs_callback;
-
-int main(void) {
-    iio_init(QNIO_VERSION, vxhs_callback);
-    return 0;
-}
-EOF
-  vxhs_libs="-lvxhs -lssl"
-  if compile_prog "" "$vxhs_libs" ; then
-    vxhs=yes
-  else
-    if test "$vxhs" = "yes" ; then
-      feature_not_found "vxhs block device" "Install libvxhs See github"
-    fi
-    vxhs=no
-  fi
-fi
-
 ##########################################
 # check for _Static_assert()
 
@@ -7033,7 +7000,6 @@ echo "jemalloc support  $jemalloc"
 echo "avx2 optimization $avx2_opt"
 echo "avx512f optimization $avx512f_opt"
 echo "replication support $replication"
-echo "VxHS block device $vxhs"
 echo "bochs support     $bochs"
 echo "cloop support     $cloop"
 echo "dmg support       $dmg"
@@ -7884,11 +7850,6 @@ elif test "$pthread_setname_np_wo_tid" = "yes" ; then
   echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak
 fi
 
-if test "$vxhs" = "yes" ; then
-  echo "CONFIG_VXHS=y" >> $config_host_mak
-  echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak
-fi
-
 if test "$libpmem" = "yes" ; then
   echo "CONFIG_LIBPMEM=y" >> $config_host_mak
 fi
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 971b65be75..851dbdeb8a 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -618,3 +618,11 @@ to achieve the same fake NUMA effect or a properly configured
 New machine versions (since 5.1) will not accept the option but it will still
 work with old machine types. User can check the QAPI schema to see if the legacy
 option is supported by looking at MachineInfo::numa-mem-supported property.
+
+Block devices
+-------------
+
+VXHS backend (removed in 5.1)
+'''''''''''''''''''''''''''''
+
+The VXHS code does not compile since v2.12.0. It was removed in 5.1.
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 463ffd83da..ab7bf3c612 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2790,7 +2790,6 @@
 #
 # Drivers that are supported in block device operations.
 #
-# @vxhs: Since 2.10
 # @throttle: Since 2.11
 # @nvme: Since 2.12
 # @copy-on-read: Since 3.0
@@ -2808,7 +2807,7 @@
             'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
             { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
             'sheepdog',
-            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] }
+            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
 
 ##
 # @BlockdevOptionsFile:
@@ -3895,22 +3894,6 @@
   'base': 'BlockdevOptionsGenericFormat',
   'data': { '*offset': 'int', '*size': 'int' } }
 
-##
-# @BlockdevOptionsVxHS:
-#
-# Driver specific block device options for VxHS
-#
-# @vdisk-id: UUID of VxHS volume
-# @server: vxhs server IP, port
-# @tls-creds: TLS credentials ID
-#
-# Since: 2.10
-##
-{ 'struct': 'BlockdevOptionsVxHS',
-  'data': { 'vdisk-id': 'str',
-            'server': 'InetSocketAddressBase',
-            '*tls-creds': 'str' } }
-
 ##
 # @BlockdevOptionsThrottle:
 #
@@ -4010,8 +3993,7 @@
       'vhdx':       'BlockdevOptionsGenericFormat',
       'vmdk':       'BlockdevOptionsGenericCOWFormat',
       'vpc':        'BlockdevOptionsGenericFormat',
-      'vvfat':      'BlockdevOptionsVVFAT',
-      'vxhs':       'BlockdevOptionsVxHS'
+      'vvfat':      'BlockdevOptionsVVFAT'
   } }
 
 ##
diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 585512bb29..3413e34f27 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -40,7 +40,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # Any format supporting backing files
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto generic
-_unsupported_proto vxhs
 _unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" \
                      "subformat=streamOptimized"
 
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index 2161a4b87a..61d78c00a4 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -41,7 +41,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 # Any format supporting intenal snapshots
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # Internal snapshots are (currently) impossible with refcount_bits=1,
 # and generally impossible with external data files
 _unsupported_imgopts 'refcount_bits=1[^0-9]' data_file
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 1dce478709..68517821e8 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # External data files do not support compressed clusters
 # (TODO: Consider writing a version for external data files that does
 #        not test compressed clusters)
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
index 5a7b0a4998..80e5e5e591 100755
--- a/tests/qemu-iotests/114
+++ b/tests/qemu-iotests/114
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 # At least OpenBSD doesn't seem to have truncate
 _supported_os Linux
 # qcow2.py does not work too well with external data files
diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130
index 77ad2aa13a..a7b365701c 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -42,7 +42,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 _supported_os Linux
 # We are going to use lazy-refcounts
 _unsupported_imgopts 'compat=0.10'
diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134
index 5162d21662..17fe1d6ed4 100755
--- a/tests/qemu-iotests/134
+++ b/tests/qemu-iotests/134
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 
 
 size=128M
diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156
index 7c69a6c3fa..9c7878dd2d 100755
--- a/tests/qemu-iotests/156
+++ b/tests/qemu-iotests/156
@@ -50,7 +50,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow2 qed
 _supported_proto generic
-_unsupported_proto vxhs
 # Copying files around with cp does not work with external data files
 _unsupported_imgopts data_file
 
diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158
index 3175968e2b..cf23742c59 100755
--- a/tests/qemu-iotests/158
+++ b/tests/qemu-iotests/158
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt qcow qcow2
 _supported_proto generic
-_unsupported_proto vxhs
 
 
 size=128M
diff --git a/tests/qemu-iotests/282 b/tests/qemu-iotests/282
index 081eb12080..27da2a0023 100755
--- a/tests/qemu-iotests/282
+++ b/tests/qemu-iotests/282
@@ -38,7 +38,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _supported_fmt luks
 _supported_proto generic
-_unsupported_proto vxhs
 
 echo "== Create non-UTF8 secret =="
 echo -n -e '\x3a\x3c\x3b\xff' > non_utf8_secret
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 9c461cf76d..e0d8049012 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -272,7 +272,6 @@ image protocol options
     -nbd                test nbd
     -ssh                test ssh
     -nfs                test nfs
-    -vxhs               test vxhs
 
 other options
     -xdiff              graphical mode diff
@@ -383,11 +382,6 @@ testlist options
             xpand=false
             ;;
 
-        -vxhs)
-            IMGPROTO=vxhs
-            xpand=false
-            ;;
-
         -ssh)
             IMGPROTO=ssh
             xpand=false
@@ -646,10 +640,6 @@ if [ -z $QEMU_NBD_PROG ]; then
 fi
 export QEMU_NBD_PROG="$(type -p "$QEMU_NBD_PROG")"
 
-if [ -z "$QEMU_VXHS_PROG" ]; then
-    export QEMU_VXHS_PROG="$(set_prog_path qnio_server)"
-fi
-
 if [ -x "$build_iotests/socket_scm_helper" ]
 then
     export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 9b772245cd..c6912be009 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -227,7 +227,6 @@ _filter_img_info()
         -e "s#$IMGFMT#IMGFMT#g" \
         -e 's#nbd://127.0.0.1:[0-9]\\+$#TEST_DIR/t.IMGFMT#g' \
         -e 's#nbd+unix:///\??socket=SOCK_DIR/nbd#TEST_DIR/t.IMGFMT#g' \
-        -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \
         -e "/encrypted: yes/d" \
         -e "/cluster_size: [0-9]\\+/d" \
         -e "/table_size: [0-9]\\+/d" \
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 7ac46edc1f..494490a272 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -124,7 +124,6 @@ fi
 : ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
 : ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
 : ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
-: ${VALGRIND_QEMU_VXHS=$VALGRIND_QEMU}
 
 # The Valgrind own parameters may be set with
 # its environment variable VALGRIND_OPTS, e.g.
@@ -212,19 +211,6 @@ _qemu_nbd_wrapper()
     return $RETVAL
 }
 
-_qemu_vxhs_wrapper()
-{
-    local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
-    (
-        echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
-        VALGRIND_QEMU="${VALGRIND_QEMU_VXHS}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
-            "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
-    )
-    RETVAL=$?
-    _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
-    return $RETVAL
-}
-
 # Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
 # Until valgrind 3.16+ is ubiquitous, we must work around a hang in
 # valgrind when issuing sigkill. Disable valgrind for this invocation.
@@ -237,7 +223,6 @@ export QEMU=_qemu_wrapper
 export QEMU_IMG=_qemu_img_wrapper
 export QEMU_IO=_qemu_io_wrapper
 export QEMU_NBD=_qemu_nbd_wrapper
-export QEMU_VXHS=_qemu_vxhs_wrapper
 
 if [ "$IMGOPTSSYNTAX" = "true" ]; then
     DRIVER="driver=$IMGFMT"
@@ -279,9 +264,6 @@ else
         TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
         REMOTE_TEST_DIR="nfs://127.0.0.1$TEST_DIR"
         TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE"
-    elif [ "$IMGPROTO" = "vxhs" ]; then
-        TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
-        TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT"
     else
         TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
     fi
@@ -436,12 +418,6 @@ _make_test_img()
         eval "$QEMU_NBD -v -t -k '$SOCK_DIR/nbd' -f $IMGFMT -e 42 -x '' $TEST_IMG_FILE >/dev/null &"
         sleep 1 # FIXME: qemu-nbd needs to be listening before we continue
     fi
-
-    # Start QNIO server on image directory for vxhs protocol
-    if [ $IMGPROTO = "vxhs" ]; then
-        eval "$QEMU_VXHS -d  $TEST_DIR > /dev/null &"
-        sleep 1 # Wait for server to come up.
-    fi
 }
 
 _rm_test_img()
@@ -468,15 +444,6 @@ _cleanup_test_img()
             _stop_nbd_server
             rm -f "$TEST_IMG_FILE"
             ;;
-        vxhs)
-            if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then
-                local QEMU_VXHS_PID
-                read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid"
-                kill ${QEMU_VXHS_PID} >/dev/null 2>&1
-                rm -f "${TEST_DIR}/qemu-vxhs.pid"
-            fi
-            rm -f "$TEST_IMG_FILE"
-            ;;
 
         file)
             _rm_test_img "$TEST_DIR/t.$IMGFMT"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:55:58 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:55:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16431.40394 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNK-0005Sf-Ez; Fri, 30 Oct 2020 21:55:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16431.40394; Fri, 30 Oct 2020 21:55:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNK-0005SX-Bw; Fri, 30 Oct 2020 21:55:58 +0000
Received: by outflank-mailman (input) for mailman id 16431;
 Fri, 30 Oct 2020 21:55:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNJ-0005SP-F2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4c12f815-536f-42e8-94d3-7b132a9a12d5;
 Fri, 30 Oct 2020 21:55:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNI-00047q-MK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNI-0001f8-Kj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNJ-0005SP-F2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:57 +0000
X-Inumbo-ID: 4c12f815-536f-42e8-94d3-7b132a9a12d5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4c12f815-536f-42e8-94d3-7b132a9a12d5;
	Fri, 30 Oct 2020 21:55:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/D+gdyOGQj+sv1cRjuRb+BVP4M6tBGBtMUtkGY3PcP8=; b=hkZQD6o9GhvEAIyvKLdeEUBYE1
	Ln8BjIRmZvhz+XvloMZsdwUsdiMn0MykLnwBb/zxpE2phz/4utNYB0JNBFYCsGBD1+DYrhS3QdrUm
	VVgkw7J355uwA7eUH23/sTtMFfs9Joj9QVMfbntM8LfgrHcXZ49nt0WYVN07ZPmCai2Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNI-00047q-MK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNI-0001f8-Kj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:55:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-img resize: Require --shrink for shrinking all image formats
Message-Id: <E1kYcNI-0001f8-Kj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:55:56 +0000

commit 1c404d756fd59ecee09dec924b88c492d24b3fc8
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 10 14:17:17 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    qemu-img resize: Require --shrink for shrinking all image formats
    
    QEMU 2.11 introduced the --shrink option for qemu-img resize to avoid
    accidentally shrinking images (commit 4ffca8904a3). However, for
    compatibility reasons, it was not enforced for raw images yet, but only
    a deprecation warning was printed. This warning has existed for long
    enough that we can now finally require --shrink for raw images, too, and
    error out if it's not given.
    
    Documentation already describes the state as it is after this patch.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200710121717.28339-1-kwolf@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu-img.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index efb6ca139e..5308773811 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4004,20 +4004,12 @@ static int img_resize(int argc, char **argv)
     }
 
     if (total_size < current_size && !shrink) {
+        error_report("Use the --shrink option to perform a shrink operation.");
         warn_report("Shrinking an image will delete all data beyond the "
                     "shrunken image's end. Before performing such an "
                     "operation, make sure there is no important data there.");
-
-        if (g_strcmp0(bdrv_get_format_name(blk_bs(blk)), "raw") != 0) {
-            error_report(
-              "Use the --shrink option to perform a shrink operation.");
-            ret = -1;
-            goto out;
-        } else {
-            warn_report("Using the --shrink option will suppress this message. "
-                        "Note that future versions of qemu-img may refuse to "
-                        "shrink images without this option.");
-        }
+        ret = -1;
+        goto out;
     }
 
     /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16432.40398 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNV-0005U9-Gd; Fri, 30 Oct 2020 21:56:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16432.40398; Fri, 30 Oct 2020 21:56:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNV-0005U1-DT; Fri, 30 Oct 2020 21:56:09 +0000
Received: by outflank-mailman (input) for mailman id 16432;
 Fri, 30 Oct 2020 21:56:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNU-0005Tt-6f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 68bdced7-f940-479d-8a01-1c7ed5b55d0b;
 Fri, 30 Oct 2020 21:56:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNS-00048A-Ql
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNS-0001g5-PK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNU-0005Tt-6f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:08 +0000
X-Inumbo-ID: 68bdced7-f940-479d-8a01-1c7ed5b55d0b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 68bdced7-f940-479d-8a01-1c7ed5b55d0b;
	Fri, 30 Oct 2020 21:56:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gGBZjJghipLkdsKTd3HBHhMuRWMbZInWzqm/ElQnfzw=; b=0Lm8V8mYua3E+l3ea3Ckk7cJs5
	W3mceo/8CQ+ZrJ1WAq/dfmn16F8cNuHSCus2WwzfzZTFT/s7/0Q380O+BhXAT4L6cKpHQK2gtGX6e
	zJntniX6EkwQTcKe19O/VfYNQdJMt73UG/MetOOsAIVZZfYN/rNLCnEngNMKshI3h6UQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNS-00048A-Ql
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNS-0001g5-PK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] crypto: use a stronger private key for tests
Message-Id: <E1kYcNS-0001g5-PK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:06 +0000

commit 3e018afbfe005a3448949bfe3954888b9d8460c4
Author:     Daniel P. Berrangé <berrange@redhat.com>
AuthorDate: Wed Jul 15 16:47:01 2020 +0100
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    crypto: use a stronger private key for tests
    
    The unit tests using the x509 crypto functionality have started
    failing in Fedora 33 rawhide with a message like
    
          The certificate uses an insecure algorithm
    
    This is result of Fedora changes to support strong crypto [1]. RSA
    with 1024 bit key is viewed as legacy and thus insecure. Generate
    a new private key which is 3072 bits long and reasonable future
    proof.
    
    [1] https://fedoraproject.org/wiki/Changes/StrongCryptoSettings2
    
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200715154701.1041325-1-berrange@redhat.com>
    Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/crypto-tls-x509-helpers.c | 59 ++++++++++++++++++++++++++++-------------
 tests/qemu-iotests/common.tls   | 57 ++++++++++++++++++++++++++-------------
 2 files changed, 79 insertions(+), 37 deletions(-)

diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c
index 9b669c2a4b..01b3daf358 100644
--- a/tests/crypto-tls-x509-helpers.c
+++ b/tests/crypto-tls-x509-helpers.c
@@ -37,25 +37,46 @@ ASN1_TYPE pkix_asn1;
  * here's one we prepared earlier :-)
  */
 gnutls_x509_privkey_t privkey;
-# define PRIVATE_KEY                                              \
-    "-----BEGIN PRIVATE KEY-----\n"                               \
-    "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVcr\n"     \
-    "BL40Tm6yq88FBhJNw1aaoCjmtg0l4dWQZ/e9Fimx4ARxFpT+ji4FE\n"     \
-    "Cgl9s/SGqC+1nvlkm9ViSo0j7MKDbnDB+VRHDvMAzQhA2X7e8M0n9\n"     \
-    "rPolUY2lIVC83q0BBaOBkCj2RSmT2xTEbbC2xLukSrg2WP/ihVOxc\n"     \
-    "kXRuyFtzAgMBAAECgYB7slBexDwXrtItAMIH6m/U+LUpNe0Xx48OL\n"     \
-    "IOn4a4whNgO/o84uIwygUK27ZGFZT0kAGAk8CdF9hA6ArcbQ62s1H\n"     \
-    "myxrUbF9/mrLsQw1NEqpuUk9Ay2Tx5U/wPx35S3W/X2AvR/ZpTnCn\n"     \
-    "2q/7ym9fyiSoj86drD7BTvmKXlOnOwQJBAPOFMp4mMa9NGpGuEssO\n"     \
-    "m3Uwbp6lhcP0cA9MK+iOmeANpoKWfBdk5O34VbmeXnGYWEkrnX+9J\n"     \
-    "bM4wVhnnBWtgBMCQQC+qAEmvwcfhauERKYznMVUVksyeuhxhCe7EK\n"     \
-    "mPh+U2+g0WwdKvGDgO0PPt1gq0ILEjspMDeMHVdTwkaVBo/uMhAkA\n"     \
-    "Z5SsZyCP2aTOPFDypXRdI4eqRcjaEPOUBq27r3uYb/jeboVb2weLa\n"     \
-    "L1MmVuHiIHoa5clswPdWVI2y0em2IGoDAkBPSp/v9VKJEZabk9Frd\n"     \
-    "a+7u4fanrM9QrEjY3KhduslSilXZZSxrWjjAJPyPiqFb3M8XXA26W\n"     \
-    "nz1KYGnqYKhLcBAkB7dt57n9xfrhDpuyVEv+Uv1D3VVAhZlsaZ5Pp\n"     \
-    "dcrhrkJn2sa/+O8OKvdrPSeeu/N5WwYhJf61+CPoenMp7IFci\n"         \
-    "-----END PRIVATE KEY-----\n"
+# define PRIVATE_KEY \
+    "-----BEGIN RSA PRIVATE KEY-----\n" \
+    "MIIG5AIBAAKCAYEAyjWyLSNm5PZvYUKUcDWGqbLX10b2ood+YaFjWSnJrqx/q3qh\n" \
+    "rVGBJglD25AJENJsmZF3zPP1oMhfIxsXu63Hdkb6Rdlc2RUoUP34x9VC1izH25mR\n" \
+    "6c8DPDp1d6IraZ/llDMI1HsBFz0qGWtvOHgm815XG4PAr/N8rDsuqfv/cJ01KlnO\n" \
+    "0OdO5QRXCJf9g/dYd41MPu7wOXk9FqjQlmRoP59HgtJ+zUpE4z+Keruw9cMT9VJj\n" \
+    "0oT+pQ9ysenqeZ3gbT224T1khrEhT5kifhtFLNyDssRchUUWH0hiqoOO1vgb+850\n" \
+    "W6/1VdxvuPam48py4diSPi1Vip8NITCOBaX9FIpVp4Ruw4rTPVMNMjq9Cpx/DwMP\n" \
+    "9MbfXfnaVaZaMrmq67/zPhl0eVbUrecH2hQ3ZB9oIF4GkNskzlWF5+yPy6zqk304\n" \
+    "AKaiFR6jRyh3YfHo2XFqV8x/hxdsIEXOtEUGhSIcpynsW+ckUCartzu7xbhXjd4b\n" \
+    "kxJT89+riPFYij09AgMBAAECggGBAKyFkaZXXROeejrmHlV6JZGlp+fhgM38gkRz\n" \
+    "+Jp7P7rLLAY3E7gXIPQ91WqAAmwazFNdvHPd9USfkCQYmnAi/VoZhrCPmlsQZRxt\n" \
+    "A5QjjOnEvSPMa6SrXZxGWDCg6R8uMCb4P+FhrPWR1thnRDZOtRTQ+crc50p3mHgt\n" \
+    "6ktXWIJRbqnag8zSfQqCYGtRmhe8sfsWT+Yl4El4+jjaAVU/B364u7+PLmaiphGp\n" \
+    "BdJfTsTwEpgtGkPj+osDmhzXcZkfq3V+fz5JLkemsCiQKmn4VJRpg8c3ZmE8NPNt\n" \
+    "gRtGWZ4W3WKDvhotT65WpQx4+6R8Duux/blNPBmH1Upmwd7kj7GYFBArbCjgd9PT\n" \
+    "xgfCSUZpgOZHHkcgSB+022a8XncXna7WYYij28SLtwImFyu0nNtqECFQHH5u+k6C\n" \
+    "LRYBSN+3t3At8dQuk01NVrJBndmjmXRfxpqUtTdeaNgVpdUYRY98s30G68NYGSra\n" \
+    "aEvhhRSghkcLNetkobpY9pUgeqW/tQKBwQDZHHK9nDMt/zk1TxtILeUSitPXcv1/\n" \
+    "8ufXqO0miHdH23XuXhIEA6Ef26RRVGDGgpjkveDJK/1w5feJ4H/ni4Vclil/cm38\n" \
+    "OwRqjjd7ElHJX6JQbsxEx/gNTk5/QW1iAL9TXUalgepsSXYT6AJ0/CJv0jmJSJ36\n" \
+    "YoKMOM8uqzb2KhN6i+RlJRi5iY53kUhWTJq5ArWvNhUzQNSYODI4bNxlsKSBL2Ik\n" \
+    "LZ5QKHuaEjQet0IlPlfIb4PzMm8CHa/urOcCgcEA7m3zW/lL5bIFoKPjWig5Lbn1\n" \
+    "aHfrG2ngqzWtgWtfZqMH8OkZc1Mdhhmvd46titjiLjeI+UP/uHXR0068PnrNngzl\n" \
+    "tTgwlakzu+bWzqhBm1F+3/341st/FEk07r0P/3/PhezVjwfO8c8Exj7pLxH4wrH0\n" \
+    "ROHgDbClmlJRu6OO78wk1+Vapf5DWa8YfA+q+fdvr7KvgGyytheKMT/b/dsqOq7y\n" \
+    "qZPjmaJKWAvV3RWG8lWHFSdHx2IAHMHfGr17Y/w7AoHBALzwZeYebeekiVucGSjq\n" \
+    "T8SgLhT7zCIx+JMUPjVfYzaUhP/Iu7Lkma6IzWm9nW6Drpy5pUpMzwUWDCLfzU9q\n" \
+    "eseFIl337kEn9wLn+t5OpgAyCqYmlftxbqvdrrBN9uvnrJjWvqk/8wsDrw9JxAGc\n" \
+    "fjeD4nBXUqvYWLXApoR9mZoGKedmoH9pFig4zlO9ig8YITnKYuQ0k6SD0b8agJHc\n" \
+    "Ir0YSUDnRGgpjvFBGbeOCe+FGbohk/EpItJc3IAh5740lwKBwAdXd2DjokSmYKn7\n" \
+    "oeqKxofz6+yVlLW5YuOiuX78sWlVp87xPolgi84vSEnkKM/Xsc8+goc6YstpRVa+\n" \
+    "W+mImoA9YW1dF5HkLeWhTAf9AlgoAEIhbeIfTgBv6KNZSv7RDrDPBBxtXx/vAfSg\n" \
+    "x0ldwk0scZsVYXLKd67yzfV7KdGUdaX4N/xYgfZm/9gCG3+q8NN2KxVHQ5F71BOE\n" \
+    "JeABOaGo9WvnU+DNMIDZjHJMUWVw4MHz/a/UArDf/2CxaPVBNQKBwASg6j4ohSTk\n" \
+    "J7aE6RQ3OBmmDDpixcoCJt9u9SjHVYMlbs5CEJGVSczk0SG3y8P1lOWNDSRnMksZ\n" \
+    "xWnHdP/ogcuYMuvK7UACNAF0zNddtzOhzcpNmejFj+WCHYY/UmPr2/Kf6t7Cxk2K\n" \
+    "3cZ4tqWsiTmBT8Bknmah7L5DrhS+ZBJliDeFAA8fZHdMH0Xjr4UBp9kF90EMTdW1\n" \
+    "Xr5uz7ZrMsYpYQI7mmyqV9SSjUg4iBXwVSoag1iDJ1K8Qg/L7Semgg==\n" \
+    "-----END RSA PRIVATE KEY-----\n"
 
 /*
  * This loads the private key we defined earlier
diff --git a/tests/qemu-iotests/common.tls b/tests/qemu-iotests/common.tls
index 54c331d7a5..6ba28a78d3 100644
--- a/tests/qemu-iotests/common.tls
+++ b/tests/qemu-iotests/common.tls
@@ -50,24 +50,45 @@ tls_x509_init()
     # use a fixed key so we don't waste system entropy on
     # each test run
     cat > "${tls_dir}/key.pem" <<EOF
------BEGIN PRIVATE KEY-----
-MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALVcr
-BL40Tm6yq88FBhJNw1aaoCjmtg0l4dWQZ/e9Fimx4ARxFpT+ji4FE
-Cgl9s/SGqC+1nvlkm9ViSo0j7MKDbnDB+VRHDvMAzQhA2X7e8M0n9
-rPolUY2lIVC83q0BBaOBkCj2RSmT2xTEbbC2xLukSrg2WP/ihVOxc
-kXRuyFtzAgMBAAECgYB7slBexDwXrtItAMIH6m/U+LUpNe0Xx48OL
-IOn4a4whNgO/o84uIwygUK27ZGFZT0kAGAk8CdF9hA6ArcbQ62s1H
-myxrUbF9/mrLsQw1NEqpuUk9Ay2Tx5U/wPx35S3W/X2AvR/ZpTnCn
-2q/7ym9fyiSoj86drD7BTvmKXlOnOwQJBAPOFMp4mMa9NGpGuEssO
-m3Uwbp6lhcP0cA9MK+iOmeANpoKWfBdk5O34VbmeXnGYWEkrnX+9J
-bM4wVhnnBWtgBMCQQC+qAEmvwcfhauERKYznMVUVksyeuhxhCe7EK
-mPh+U2+g0WwdKvGDgO0PPt1gq0ILEjspMDeMHVdTwkaVBo/uMhAkA
-Z5SsZyCP2aTOPFDypXRdI4eqRcjaEPOUBq27r3uYb/jeboVb2weLa
-L1MmVuHiIHoa5clswPdWVI2y0em2IGoDAkBPSp/v9VKJEZabk9Frd
-a+7u4fanrM9QrEjY3KhduslSilXZZSxrWjjAJPyPiqFb3M8XXA26W
-nz1KYGnqYKhLcBAkB7dt57n9xfrhDpuyVEv+Uv1D3VVAhZlsaZ5Pp
-dcrhrkJn2sa/+O8OKvdrPSeeu/N5WwYhJf61+CPoenMp7IFci
------END PRIVATE KEY-----
+-----BEGIN RSA PRIVATE KEY-----
+MIIG5AIBAAKCAYEAyjWyLSNm5PZvYUKUcDWGqbLX10b2ood+YaFjWSnJrqx/q3qh
+rVGBJglD25AJENJsmZF3zPP1oMhfIxsXu63Hdkb6Rdlc2RUoUP34x9VC1izH25mR
+6c8DPDp1d6IraZ/llDMI1HsBFz0qGWtvOHgm815XG4PAr/N8rDsuqfv/cJ01KlnO
+0OdO5QRXCJf9g/dYd41MPu7wOXk9FqjQlmRoP59HgtJ+zUpE4z+Keruw9cMT9VJj
+0oT+pQ9ysenqeZ3gbT224T1khrEhT5kifhtFLNyDssRchUUWH0hiqoOO1vgb+850
+W6/1VdxvuPam48py4diSPi1Vip8NITCOBaX9FIpVp4Ruw4rTPVMNMjq9Cpx/DwMP
+9MbfXfnaVaZaMrmq67/zPhl0eVbUrecH2hQ3ZB9oIF4GkNskzlWF5+yPy6zqk304
+AKaiFR6jRyh3YfHo2XFqV8x/hxdsIEXOtEUGhSIcpynsW+ckUCartzu7xbhXjd4b
+kxJT89+riPFYij09AgMBAAECggGBAKyFkaZXXROeejrmHlV6JZGlp+fhgM38gkRz
++Jp7P7rLLAY3E7gXIPQ91WqAAmwazFNdvHPd9USfkCQYmnAi/VoZhrCPmlsQZRxt
+A5QjjOnEvSPMa6SrXZxGWDCg6R8uMCb4P+FhrPWR1thnRDZOtRTQ+crc50p3mHgt
+6ktXWIJRbqnag8zSfQqCYGtRmhe8sfsWT+Yl4El4+jjaAVU/B364u7+PLmaiphGp
+BdJfTsTwEpgtGkPj+osDmhzXcZkfq3V+fz5JLkemsCiQKmn4VJRpg8c3ZmE8NPNt
+gRtGWZ4W3WKDvhotT65WpQx4+6R8Duux/blNPBmH1Upmwd7kj7GYFBArbCjgd9PT
+xgfCSUZpgOZHHkcgSB+022a8XncXna7WYYij28SLtwImFyu0nNtqECFQHH5u+k6C
+LRYBSN+3t3At8dQuk01NVrJBndmjmXRfxpqUtTdeaNgVpdUYRY98s30G68NYGSra
+aEvhhRSghkcLNetkobpY9pUgeqW/tQKBwQDZHHK9nDMt/zk1TxtILeUSitPXcv1/
+8ufXqO0miHdH23XuXhIEA6Ef26RRVGDGgpjkveDJK/1w5feJ4H/ni4Vclil/cm38
+OwRqjjd7ElHJX6JQbsxEx/gNTk5/QW1iAL9TXUalgepsSXYT6AJ0/CJv0jmJSJ36
+YoKMOM8uqzb2KhN6i+RlJRi5iY53kUhWTJq5ArWvNhUzQNSYODI4bNxlsKSBL2Ik
+LZ5QKHuaEjQet0IlPlfIb4PzMm8CHa/urOcCgcEA7m3zW/lL5bIFoKPjWig5Lbn1
+aHfrG2ngqzWtgWtfZqMH8OkZc1Mdhhmvd46titjiLjeI+UP/uHXR0068PnrNngzl
+tTgwlakzu+bWzqhBm1F+3/341st/FEk07r0P/3/PhezVjwfO8c8Exj7pLxH4wrH0
+ROHgDbClmlJRu6OO78wk1+Vapf5DWa8YfA+q+fdvr7KvgGyytheKMT/b/dsqOq7y
+qZPjmaJKWAvV3RWG8lWHFSdHx2IAHMHfGr17Y/w7AoHBALzwZeYebeekiVucGSjq
+T8SgLhT7zCIx+JMUPjVfYzaUhP/Iu7Lkma6IzWm9nW6Drpy5pUpMzwUWDCLfzU9q
+eseFIl337kEn9wLn+t5OpgAyCqYmlftxbqvdrrBN9uvnrJjWvqk/8wsDrw9JxAGc
+fjeD4nBXUqvYWLXApoR9mZoGKedmoH9pFig4zlO9ig8YITnKYuQ0k6SD0b8agJHc
+Ir0YSUDnRGgpjvFBGbeOCe+FGbohk/EpItJc3IAh5740lwKBwAdXd2DjokSmYKn7
+oeqKxofz6+yVlLW5YuOiuX78sWlVp87xPolgi84vSEnkKM/Xsc8+goc6YstpRVa+
+W+mImoA9YW1dF5HkLeWhTAf9AlgoAEIhbeIfTgBv6KNZSv7RDrDPBBxtXx/vAfSg
+x0ldwk0scZsVYXLKd67yzfV7KdGUdaX4N/xYgfZm/9gCG3+q8NN2KxVHQ5F71BOE
+JeABOaGo9WvnU+DNMIDZjHJMUWVw4MHz/a/UArDf/2CxaPVBNQKBwASg6j4ohSTk
+J7aE6RQ3OBmmDDpixcoCJt9u9SjHVYMlbs5CEJGVSczk0SG3y8P1lOWNDSRnMksZ
+xWnHdP/ogcuYMuvK7UACNAF0zNddtzOhzcpNmejFj+WCHYY/UmPr2/Kf6t7Cxk2K
+3cZ4tqWsiTmBT8Bknmah7L5DrhS+ZBJliDeFAA8fZHdMH0Xjr4UBp9kF90EMTdW1
+Xr5uz7ZrMsYpYQI7mmyqV9SSjUg4iBXwVSoag1iDJ1K8Qg/L7Semgg==
+-----END RSA PRIVATE KEY-----
 EOF
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16433.40402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNi-0005VP-IP; Fri, 30 Oct 2020 21:56:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16433.40402; Fri, 30 Oct 2020 21:56:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNi-0005VH-F9; Fri, 30 Oct 2020 21:56:22 +0000
Received: by outflank-mailman (input) for mailman id 16433;
 Fri, 30 Oct 2020 21:56:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNh-0005VB-Ex
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b65b5e8c-88b4-42e2-90c7-7a3786015f33;
 Fri, 30 Oct 2020 21:56:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNc-00048G-UX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNc-0001ge-Th
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNh-0005VB-Ex
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:21 +0000
X-Inumbo-ID: b65b5e8c-88b4-42e2-90c7-7a3786015f33
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b65b5e8c-88b4-42e2-90c7-7a3786015f33;
	Fri, 30 Oct 2020 21:56:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5j/VIEmJpH1gmXAN9lU8s8KHA2EsFTOr/x5wDAMtYpc=; b=PzRdnZme/5i5wh6zO//ocljrmM
	XbjIsWfXDeuXTRlCw3GKEMw+Fii/TQXGOUMTrkDrc0VdmIclM9Oq4XqSZp121vGPD5dW2jgQ6xK59
	LBDKp+oF4Uke1hxNrT5V4L1tL6bEgwSno6LbjXtzxbmZOiCZtQ9m7zXweYtExTSnohro=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNc-00048G-UX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNc-0001ge-Th
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/030: Reduce job speed to make race less likely
Message-Id: <E1kYcNc-0001ge-Th@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:16 +0000

commit f21f12936f9db6de4eddfcf9a086b6efd5b093cc
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 15:28:29 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    iotests/030: Reduce job speed to make race less likely
    
    It can happen that the throttling of the stream job doesn't make it slow
    enough that we can be sure that it still exists when it is referenced
    again. Just use a much smaller speed to make this very unlikely to
    happen again.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200716132829.20127-1-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/030 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 256b2bfbc6..31c028306b 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -243,7 +243,7 @@ class TestParallelOps(iotests.QMPTestCase):
             node_name = 'node%d' % i
             job_id = 'stream-%s' % node_name
             pending_jobs.append(job_id)
-            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=512*1024)
+            result = self.vm.qmp('block-stream', device=node_name, job_id=job_id, base=self.imgs[i-2], speed=1024)
             self.assert_qmp(result, 'return', {})
 
         for job in pending_jobs:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16434.40406 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNp-0005WT-JZ; Fri, 30 Oct 2020 21:56:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16434.40406; Fri, 30 Oct 2020 21:56:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNp-0005WL-Gd; Fri, 30 Oct 2020 21:56:29 +0000
Received: by outflank-mailman (input) for mailman id 16434;
 Fri, 30 Oct 2020 21:56:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNo-0005WC-Af
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a50c8817-334b-4c7b-b440-799073c87cbd;
 Fri, 30 Oct 2020 21:56:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNn-00048W-1s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNn-0001hG-15
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNo-0005WC-Af
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:28 +0000
X-Inumbo-ID: a50c8817-334b-4c7b-b440-799073c87cbd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a50c8817-334b-4c7b-b440-799073c87cbd;
	Fri, 30 Oct 2020 21:56:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w7PEtO/FjFveMgt5fijmbf1LgPTQaMtDc8qaFUzzbNw=; b=y7VJ1bEDDSge3e/uQ3JcKvYKDo
	8MyMcA6CpOSbkQ+5QXF2tQZarMYhG6XNaeHUWf4xU/XJSK7G02FKbTStWodkKDSTXB9KMXj3AO6Q3
	j6hu5e7meCSf2DixqrNnp9N0exW7lfKEaGBEPl9CccabhBN38rqmU/LPHnldNrcu3nqc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNn-00048W-1s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNn-0001hG-15
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] nbd: make nbd_export_close_all() synchronous
Message-Id: <E1kYcNn-0001hG-15@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:27 +0000

commit 453cc6be0a954ecdb4e0cdbf5b5b87f07b3e1075
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Tue Jul 14 19:22:33 2020 +0300
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    nbd: make nbd_export_close_all() synchronous
    
    Consider nbd_export_close_all(). The call-stack looks like this:
     nbd_export_close_all() -> nbd_export_close -> call client_close() for
    each client.
    
    client_close() doesn't guarantee that client is closed: nbd_trip()
    keeps reference to it. So, nbd_export_close_all() just reduce
    reference counter on export and removes it from the list, but doesn't
    guarantee that nbd_trip() finished neither export actually removed.
    
    Let's wait for all exports actually removed.
    
    Without this fix, the following crash is possible:
    
    - export bitmap through internal Qemu NBD server
    - connect a client
    - shutdown Qemu
    
    On shutdown nbd_export_close_all is called, but it actually don't wait
    for nbd_trip() to finish and to release its references. So, export is
    not release, and exported bitmap remains busy, and on try to remove the
    bitmap (which is part of bdrv_close()) the assertion fails:
    
    bdrv_release_dirty_bitmap_locked: Assertion `!bdrv_dirty_bitmap_busy(bitmap)' failed
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200714162234.13113-2-vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 nbd/server.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nbd/server.c b/nbd/server.c
index 5357f588f0..4752a6c8bc 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -102,6 +102,8 @@ struct NBDExport {
 };
 
 static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports);
+static QTAILQ_HEAD(, NBDExport) closed_exports =
+        QTAILQ_HEAD_INITIALIZER(closed_exports);
 
 /* NBDExportMetaContexts represents a list of contexts to be exported,
  * as selected by NBD_OPT_SET_META_CONTEXT. Also used for
@@ -1659,6 +1661,7 @@ void nbd_export_close(NBDExport *exp)
         g_free(exp->name);
         exp->name = NULL;
         QTAILQ_REMOVE(&exports, exp, next);
+        QTAILQ_INSERT_TAIL(&closed_exports, exp, next);
     }
     g_free(exp->description);
     exp->description = NULL;
@@ -1722,7 +1725,9 @@ void nbd_export_put(NBDExport *exp)
             g_free(exp->export_bitmap_context);
         }
 
+        QTAILQ_REMOVE(&closed_exports, exp, next);
         g_free(exp);
+        aio_wait_kick();
     }
 }
 
@@ -1742,6 +1747,9 @@ void nbd_export_close_all(void)
         nbd_export_close(exp);
         aio_context_release(aio_context);
     }
+
+    AIO_WAIT_WHILE(NULL, !(QTAILQ_EMPTY(&exports) &&
+                           QTAILQ_EMPTY(&closed_exports)));
 }
 
 static int coroutine_fn nbd_co_send_iov(NBDClient *client, struct iovec *iov,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16435.40410 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNz-0005Yc-LA; Fri, 30 Oct 2020 21:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16435.40410; Fri, 30 Oct 2020 21:56:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcNz-0005YU-IH; Fri, 30 Oct 2020 21:56:39 +0000
Received: by outflank-mailman (input) for mailman id 16435;
 Fri, 30 Oct 2020 21:56:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcNy-0005Xe-5Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ade2e174-b386-4e58-b44a-94c361abb594;
 Fri, 30 Oct 2020 21:56:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNx-00048d-5Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcNx-0001hu-4h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcNy-0005Xe-5Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:38 +0000
X-Inumbo-ID: ade2e174-b386-4e58-b44a-94c361abb594
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ade2e174-b386-4e58-b44a-94c361abb594;
	Fri, 30 Oct 2020 21:56:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jYBvhSdQs5zxUBAlolvDpkWdiulamwCwM8OlFFBll20=; b=Au79nYaXxe+a+Wg5cEQbetBIvR
	fW3DCAaR187AB54qb4Dnss1vTsQuH9o7IRuCjSbWXbGFuW9sjo6OsXd7l8LPS9pCRUjOx0Zqk5aJn
	1XGUcu3y6QawMAlQzncMyNk8yZgtMRMLN1A2TSUqJgbz6rmUFEvkFP4rCEmU+lxRwXts=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNx-00048d-5Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcNx-0001hu-4h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: test shutdown when bitmap is exported through NBD
Message-Id: <E1kYcNx-0001hu-4h@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:37 +0000

commit d047cfa78dc76fb8c7768620106bf1acb7c79797
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Tue Jul 14 19:22:34 2020 +0300
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    iotests: test shutdown when bitmap is exported through NBD
    
    Test shutdown when bitmap is exported through NBD and active client
    exists. The previous patch fixes a crash, provoked by this scenario.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200714162234.13113-3-vsementsov@virtuozzo.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/299     | 65 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/299.out | 10 +++++++
 tests/qemu-iotests/group   |  1 +
 3 files changed, 76 insertions(+)

diff --git a/tests/qemu-iotests/299 b/tests/qemu-iotests/299
new file mode 100644
index 0000000000..e129c7f7cb
--- /dev/null
+++ b/tests/qemu-iotests/299
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+#
+# Test shutdown when bitmap is exported through NBD server
+#
+# Copyright (c) 2020 Virtuozzo International GmbH.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+import iotests
+
+# The test is unrelated to formats, restrict it to qcow2 to avoid extra runs
+iotests.script_initialize(
+    supported_fmts=['qcow2'],
+)
+
+nbd_sock = iotests.file_path('nbd.sock', base_dir=iotests.sock_dir)
+nbd_uri = 'nbd+unix:///disk?socket=' + nbd_sock
+size = 1024 * 1024
+
+vm = iotests.VM()
+vm.launch()
+
+vm.qmp_log('blockdev-add', **{
+    'node-name': 'disk',
+    'driver': 'null-co',
+    'size': 1024 * 1024,
+})
+
+vm.qmp_log('block-dirty-bitmap-add', **{
+    'node': 'disk',
+    'name': 'bitmap0'
+})
+
+vm.qmp_log('nbd-server-start', **{
+    'addr': {
+        'type': 'unix',
+        'data': {'path': nbd_sock}
+    }
+}, filters=[iotests.filter_qmp_testfiles])
+
+vm.qmp_log('nbd-server-add', **{
+    'device': 'disk',
+    'writable': True,
+    'bitmap': 'bitmap0'
+})
+
+p = iotests.QemuIoInteractive('-f', 'raw', nbd_uri)
+# wait for connection and check it:
+iotests.log(p.cmd('read 0 512').rstrip(), filters=[iotests.filter_qemu_io])
+
+vm.shutdown()
+
+p.close()
diff --git a/tests/qemu-iotests/299.out b/tests/qemu-iotests/299.out
new file mode 100644
index 0000000000..bba4252923
--- /dev/null
+++ b/tests/qemu-iotests/299.out
@@ -0,0 +1,10 @@
+{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "disk", "size": 1048576}}
+{"return": {}}
+{"execute": "block-dirty-bitmap-add", "arguments": {"name": "bitmap0", "node": "disk"}}
+{"return": {}}
+{"execute": "nbd-server-start", "arguments": {"addr": {"data": {"path": "SOCK_DIR/PID-nbd.sock"}, "type": "unix"}}}
+{"return": {}}
+{"execute": "nbd-server-add", "arguments": {"bitmap": "bitmap0", "device": "disk", "writable": true}}
+{"return": {}}
+read 512/512 bytes at offset 0
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a4f9e11e7a..1d0252e1f0 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -306,4 +306,5 @@
 295 rw
 296 rw
 297 meta
+299 auto quick
 301 backing quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16436.40414 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcO9-0005a7-Or; Fri, 30 Oct 2020 21:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16436.40414; Fri, 30 Oct 2020 21:56:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcO9-0005Zv-LY; Fri, 30 Oct 2020 21:56:49 +0000
Received: by outflank-mailman (input) for mailman id 16436;
 Fri, 30 Oct 2020 21:56:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcO8-0005Zj-5Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0878c6ef-9865-4d98-a632-5c30e6bd282c;
 Fri, 30 Oct 2020 21:56:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcO7-00049F-AE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcO7-0001iO-8R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcO8-0005Zj-5Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:48 +0000
X-Inumbo-ID: 0878c6ef-9865-4d98-a632-5c30e6bd282c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0878c6ef-9865-4d98-a632-5c30e6bd282c;
	Fri, 30 Oct 2020 21:56:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZLZQNPgQfdwrG1dkcveX+fSJycBJxlfIzHd+y6nMiI4=; b=I4D9OZSgAae5GjPWvCPgzhInve
	BQu2Jn/igWy5pOs7diGkMJ8e6iVCph+90EeRF0k1VkUYUU7Ytfzp53pI85gHAKKjE8ml/BOmPXTZH
	fBqwhtGv8Bb04wDvw5dZ2zRFSrRQPVlrjyI6xZMcLr6qZCwxMI1DkR36CtnCmDQoXr1M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcO7-00049F-AE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcO7-0001iO-8R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Require aligned image size to avoid assertion failure
Message-Id: <E1kYcO7-0001iO-8R@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:47 +0000

commit 9c60a5d1978e6dcf85c0e01b50e6f7f54ca09104
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 16:26:00 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    block: Require aligned image size to avoid assertion failure
    
    Unaligned requests will automatically be aligned to bl.request_alignment
    and we can't extend write requests to access space beyond the end of the
    image without resizing the image, so if we have the WRITE permission,
    but not the RESIZE one, it's required that the image size is aligned.
    
    Failing to meet this requirement could cause assertion failures like
    this if RESIZE permissions weren't requested:
    
    qemu-img: block/io.c:1910: bdrv_co_write_req_prepare: Assertion `end_sector <= bs->total_sectors || child->perm & BLK_PERM_RESIZE' failed.
    
    This was e.g. triggered by qemu-img converting to a target image with 4k
    request alignment when the image was only aligned to 512 bytes, but not
    to 4k.
    
    Turn this into a graceful error in bdrv_check_perm() so that WRITE
    without RESIZE can only be taken if the image size is aligned. If a user
    holds both permissions and drops only RESIZE, the function will return
    an error, but bdrv_child_try_set_perm() will ignore the failure silently
    if permissions are only requested to be relaxed and just keep both
    permissions while returning success.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200716142601.111237-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/block.c b/block.c
index 35a372df57..d9ac0e07eb 100644
--- a/block.c
+++ b/block.c
@@ -2025,6 +2025,22 @@ static int bdrv_check_perm(BlockDriverState *bs, BlockReopenQueue *q,
         return -EPERM;
     }
 
+    /*
+     * Unaligned requests will automatically be aligned to bl.request_alignment
+     * and without RESIZE we can't extend requests to write to space beyond the
+     * end of the image, so it's required that the image size is aligned.
+     */
+    if ((cumulative_perms & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED)) &&
+        !(cumulative_perms & BLK_PERM_RESIZE))
+    {
+        if ((bs->total_sectors * BDRV_SECTOR_SIZE) % bs->bl.request_alignment) {
+            error_setg(errp, "Cannot get 'write' permission without 'resize': "
+                             "Image size is not a multiple of request "
+                             "alignment");
+            return -EPERM;
+        }
+    }
+
     /* Check this node */
     if (!drv) {
         return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:56:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:56:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16437.40418 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOJ-0005bM-QD; Fri, 30 Oct 2020 21:56:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16437.40418; Fri, 30 Oct 2020 21:56:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOJ-0005bC-N9; Fri, 30 Oct 2020 21:56:59 +0000
Received: by outflank-mailman (input) for mailman id 16437;
 Fri, 30 Oct 2020 21:56:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcOI-0005b1-B3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 84b89b6f-9ab5-484a-be42-9fffcab015e3;
 Fri, 30 Oct 2020 21:56:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOH-00049P-EQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOH-0001j2-D9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcOI-0005b1-B3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:58 +0000
X-Inumbo-ID: 84b89b6f-9ab5-484a-be42-9fffcab015e3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 84b89b6f-9ab5-484a-be42-9fffcab015e3;
	Fri, 30 Oct 2020 21:56:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yzmwE6BQ0CbPvKa/62yN74g/320vEfZ/jXDbmN8DltA=; b=jjz57+9MrevmW1cZ3hP6RHHvl+
	OkWEnV2jWT8WoIeSLopk4y8d1RfogxbXj0Pnc6g9zEC2/XKe3ArenMbzK65JxfLGPvFMvruhLH7we
	W8urDLSshGjhIfLUZiB/TAH14rG+p05VwRCIDtjJPkvfzQt9efwIzTAZ/4cWkcfxFXFQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOH-00049P-EQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOH-0001j2-D9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:56:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Allow byte-aligned O_DIRECT with NFS
Message-Id: <E1kYcOH-0001j2-D9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:56:57 +0000

commit 5edc85571e7b7269dce408735eba7507f18ac666
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Thu Jul 16 16:26:01 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Allow byte-aligned O_DIRECT with NFS
    
    Since commit a6b257a08e3 ('file-posix: Handle undetectable alignment'),
    we assume that if we open a file with O_DIRECT and alignment probing
    returns 1, we just couldn't find out the real alignment requirement
    because some filesystems make the requirement only for allocated blocks.
    In this case, a safe default of 4k is used.
    
    This is too strict for NFS, which does actually allow byte-aligned
    requests even with O_DIRECT. Because we can't distinguish both cases
    with generic code, let's just look at the file system magic and disable
    s->needs_alignment for NFS. This way, O_DIRECT can still be used on NFS
    for images that are not aligned to 4k.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200716142601.111237-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 8067e238cb..ae8190edab 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -62,10 +62,12 @@
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <sys/syscall.h>
+#include <sys/vfs.h>
 #include <linux/cdrom.h>
 #include <linux/fd.h>
 #include <linux/fs.h>
 #include <linux/hdreg.h>
+#include <linux/magic.h>
 #include <scsi/sg.h>
 #ifdef __s390__
 #include <asm/dasd.h>
@@ -300,6 +302,28 @@ static int probe_physical_blocksize(int fd, unsigned int *blk_size)
 #endif
 }
 
+/*
+ * Returns true if no alignment restrictions are necessary even for files
+ * opened with O_DIRECT.
+ *
+ * raw_probe_alignment() probes the required alignment and assume that 1 means
+ * the probing failed, so it falls back to a safe default of 4k. This can be
+ * avoided if we know that byte alignment is okay for the file.
+ */
+static bool dio_byte_aligned(int fd)
+{
+#ifdef __linux__
+    struct statfs buf;
+    int ret;
+
+    ret = fstatfs(fd, &buf);
+    if (ret == 0 && buf.f_type == NFS_SUPER_MAGIC) {
+        return true;
+    }
+#endif
+    return false;
+}
+
 /* Check if read is allowed with given memory buffer and length.
  *
  * This function is used to check O_DIRECT memory buffer and request alignment.
@@ -629,7 +653,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     s->has_discard = true;
     s->has_write_zeroes = true;
-    if ((bs->open_flags & BDRV_O_NOCACHE) != 0) {
+    if ((bs->open_flags & BDRV_O_NOCACHE) != 0 && !dio_byte_aligned(s->fd)) {
         s->needs_alignment = true;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:57:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:57:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16438.40422 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOT-0005cd-Rh; Fri, 30 Oct 2020 21:57:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16438.40422; Fri, 30 Oct 2020 21:57:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOT-0005cU-Og; Fri, 30 Oct 2020 21:57:09 +0000
Received: by outflank-mailman (input) for mailman id 16438;
 Fri, 30 Oct 2020 21:57:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcOS-0005cI-Fg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7dd7f83e-f3fa-4023-911e-66663695193f;
 Fri, 30 Oct 2020 21:57:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOR-00049m-KU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOR-0001jo-Hb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcOS-0005cI-Fg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:08 +0000
X-Inumbo-ID: 7dd7f83e-f3fa-4023-911e-66663695193f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7dd7f83e-f3fa-4023-911e-66663695193f;
	Fri, 30 Oct 2020 21:57:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8uFFAIE7qlm/VTWD5cc3+46ixFrEacoCnTnG4Aigv9g=; b=SwicYgQf4pJnOjGHIOh9+evFpV
	6a0AHkTDezAyE93ar8a9gmqut0KtLehwIVxiZ1aZfuhTJdAF4Q1Y+X8ZaCgLeJG443MJkVf9iEOLq
	dPTgVGxU9+Ydym0F3V1pF8v0SKPUycclSC7Ra1x+xn2sNJIh+J4bMgBs1Ey7Wgw3qShY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOR-00049m-KU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOR-0001jo-Hb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Move check_hdev_writable() up
Message-Id: <E1kYcOR-0001jo-Hb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:07 +0000

commit 20eaf1bf6ef1df916cb7ea2d06d1e868f238835f
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:24 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Move check_hdev_writable() up
    
    We'll need to call it in raw_open_common(), so move the function to
    avoid a forward declaration.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 66 +++++++++++++++++++++++++++---------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index ae8190edab..dd7dab07d6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -425,6 +425,39 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
     }
 }
 
+static int check_hdev_writable(BDRVRawState *s)
+{
+#if defined(BLKROGET)
+    /* Linux block devices can be configured "read-only" using blockdev(8).
+     * This is independent of device node permissions and therefore open(2)
+     * with O_RDWR succeeds.  Actual writes fail with EPERM.
+     *
+     * bdrv_open() is supposed to fail if the disk is read-only.  Explicitly
+     * check for read-only block devices so that Linux block devices behave
+     * properly.
+     */
+    struct stat st;
+    int readonly = 0;
+
+    if (fstat(s->fd, &st)) {
+        return -errno;
+    }
+
+    if (!S_ISBLK(st.st_mode)) {
+        return 0;
+    }
+
+    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
+        return -errno;
+    }
+
+    if (readonly) {
+        return -EACCES;
+    }
+#endif /* defined(BLKROGET) */
+    return 0;
+}
+
 static void raw_parse_flags(int bdrv_flags, int *open_flags, bool has_writers)
 {
     bool read_write = false;
@@ -3323,39 +3356,6 @@ static int hdev_probe_device(const char *filename)
     return 0;
 }
 
-static int check_hdev_writable(BDRVRawState *s)
-{
-#if defined(BLKROGET)
-    /* Linux block devices can be configured "read-only" using blockdev(8).
-     * This is independent of device node permissions and therefore open(2)
-     * with O_RDWR succeeds.  Actual writes fail with EPERM.
-     *
-     * bdrv_open() is supposed to fail if the disk is read-only.  Explicitly
-     * check for read-only block devices so that Linux block devices behave
-     * properly.
-     */
-    struct stat st;
-    int readonly = 0;
-
-    if (fstat(s->fd, &st)) {
-        return -errno;
-    }
-
-    if (!S_ISBLK(st.st_mode)) {
-        return 0;
-    }
-
-    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
-        return -errno;
-    }
-
-    if (readonly) {
-        return -EACCES;
-    }
-#endif /* defined(BLKROGET) */
-    return 0;
-}
-
 static void hdev_parse_filename(const char *filename, QDict *options,
                                 Error **errp)
 {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:57:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:57:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16439.40426 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOd-0005dv-TV; Fri, 30 Oct 2020 21:57:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16439.40426; Fri, 30 Oct 2020 21:57:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOd-0005dn-QF; Fri, 30 Oct 2020 21:57:19 +0000
Received: by outflank-mailman (input) for mailman id 16439;
 Fri, 30 Oct 2020 21:57:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcOc-0005dd-N2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b2a8332d-fba3-41a9-9cad-e530d02e504d;
 Fri, 30 Oct 2020 21:57:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOb-00049w-PB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOb-0001kK-NP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcOc-0005dd-N2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:18 +0000
X-Inumbo-ID: b2a8332d-fba3-41a9-9cad-e530d02e504d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b2a8332d-fba3-41a9-9cad-e530d02e504d;
	Fri, 30 Oct 2020 21:57:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fJEmC7xeKKQ6o619CF5z5Nmeft7kG7HdjKB6OYSy22A=; b=IT1+ut1CEKepxgHgLtnXMJo0xS
	wErAHKjMJOujcoNB68l23NxUPPqgXP7VuXkOha07y9a9NzJbOIyPGX0EOd37UwRW7ogsovfyt6Pqo
	PLBeqhvB7WS7kfBCmCfmC37DIZq/h/QpHcRj+c6K7z+AMTBveHTQWtyk5hIkHUyRNLLg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOb-00049w-PB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOb-0001kK-NP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Fix check_hdev_writable() with auto-read-only
Message-Id: <E1kYcOb-0001kK-NP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:17 +0000

commit bca5283bd4a086bcbfaddc024491a400cc9b2fa9
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:25 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Fix check_hdev_writable() with auto-read-only
    
    For Linux block devices, being able to open the device read-write
    doesn't necessarily mean that the device is actually writable (one
    example is a read-only LV, as you get with lvchange -pr <device>). We
    have check_hdev_writable() to check this condition and fail opening the
    image read-write if it's not actually writable.
    
    However, this check doesn't take auto-read-only into account, but
    results in a hard failure instead of downgrading to read-only where
    possible.
    
    Fix this and do the writable check not based on BDRV_O_RDWR, but only
    when this actually results in opening the file read-write. A second
    check is inserted in raw_reconfigure_getfd() to have the same check when
    dynamic auto-read-only upgrades an image file from read-only to
    read-write.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index dd7dab07d6..996e45ab95 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -425,7 +425,7 @@ static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
     }
 }
 
-static int check_hdev_writable(BDRVRawState *s)
+static int check_hdev_writable(int fd)
 {
 #if defined(BLKROGET)
     /* Linux block devices can be configured "read-only" using blockdev(8).
@@ -439,7 +439,7 @@ static int check_hdev_writable(BDRVRawState *s)
     struct stat st;
     int readonly = 0;
 
-    if (fstat(s->fd, &st)) {
+    if (fstat(fd, &st)) {
         return -errno;
     }
 
@@ -447,7 +447,7 @@ static int check_hdev_writable(BDRVRawState *s)
         return 0;
     }
 
-    if (ioctl(s->fd, BLKROGET, &readonly) < 0) {
+    if (ioctl(fd, BLKROGET, &readonly) < 0) {
         return -errno;
     }
 
@@ -642,6 +642,15 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     }
     s->fd = fd;
 
+    /* Check s->open_flags rather than bdrv_flags due to auto-read-only */
+    if (s->open_flags & O_RDWR) {
+        ret = check_hdev_writable(s->fd);
+        if (ret < 0) {
+            error_setg_errno(errp, -ret, "The device is not writable");
+            goto fail;
+        }
+    }
+
     s->perm = 0;
     s->shared_perm = BLK_PERM_ALL;
 
@@ -1034,6 +1043,15 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
         }
     }
 
+    if (fd != -1 && (*open_flags & O_RDWR)) {
+        ret = check_hdev_writable(fd);
+        if (ret < 0) {
+            qemu_close(fd);
+            error_setg_errno(errp, -ret, "The device is not writable");
+            return -1;
+        }
+    }
+
     return fd;
 }
 
@@ -3478,15 +3496,6 @@ hdev_open_Mac_error:
     /* Since this does ioctl the device must be already opened */
     bs->sg = hdev_is_sg(bs);
 
-    if (flags & BDRV_O_RDWR) {
-        ret = check_hdev_writable(s);
-        if (ret < 0) {
-            raw_close(bs);
-            error_setg_errno(errp, -ret, "The device is not writable");
-            return ret;
-        }
-    }
-
     return ret;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:57:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:57:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16440.40429 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOn-0005f8-Up; Fri, 30 Oct 2020 21:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16440.40429; Fri, 30 Oct 2020 21:57:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOn-0005f1-Rh; Fri, 30 Oct 2020 21:57:29 +0000
Received: by outflank-mailman (input) for mailman id 16440;
 Fri, 30 Oct 2020 21:57:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcOm-0005eq-PJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ead7d44b-5db9-498e-8d46-c5f47a19ad78;
 Fri, 30 Oct 2020 21:57:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOl-0004A6-St
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOl-0001kt-S5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcOm-0005eq-PJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:28 +0000
X-Inumbo-ID: ead7d44b-5db9-498e-8d46-c5f47a19ad78
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ead7d44b-5db9-498e-8d46-c5f47a19ad78;
	Fri, 30 Oct 2020 21:57:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YSesEwVx0GNpQEMYQsT7a+Ce3+d3BW3YR7X64W9pXeE=; b=hnGeTl/bxhPmY5MKSXLnFoFrOi
	c1e2hUrRDxc/91G2ILC0rxS4JjPMswEaL467Z6RjVDprPK7nu75pSKf8LPSJArZv3rDn4Y2oyGvNv
	1uJNjkVbPsWDMTXReKM01SWrX7lDE9AAWpt0tdFyiu0pO0nW/0th0O2yzOgZArgLuRh8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOl-0004A6-St
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOl-0001kt-S5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Fix leaked fd in raw_open_common() error path
Message-Id: <E1kYcOl-0001kt-S5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:27 +0000

commit a8c5cf27c945d392edd85b0b0c64cd5c52cae658
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Fri Jul 17 12:54:26 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Fri Jul 17 14:20:57 2020 +0200

    file-posix: Fix leaked fd in raw_open_common() error path
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200717105426.51134-4-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index 996e45ab95..8cc39a1ef6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -773,6 +773,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     }
     ret = 0;
 fail:
+    if (ret < 0 && s->fd != -1) {
+        qemu_close(s->fd);
+    }
     if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) {
         unlink(filename);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:57:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:57:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16441.40434 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOz-0005h2-0o; Fri, 30 Oct 2020 21:57:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16441.40434; Fri, 30 Oct 2020 21:57:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcOy-0005gu-TT; Fri, 30 Oct 2020 21:57:40 +0000
Received: by outflank-mailman (input) for mailman id 16441;
 Fri, 30 Oct 2020 21:57:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcOx-0005gI-7U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 092a08b0-f3fe-4d7b-b45f-b5596d7e65a2;
 Fri, 30 Oct 2020 21:57:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOw-0004Bl-1S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcOw-0001ms-0Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcOx-0005gI-7U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:39 +0000
X-Inumbo-ID: 092a08b0-f3fe-4d7b-b45f-b5596d7e65a2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 092a08b0-f3fe-4d7b-b45f-b5596d7e65a2;
	Fri, 30 Oct 2020 21:57:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=U3R438kwHoKMt2NbEtskJxP2V1pOFAeqi0K86Jt/fVk=; b=Iz14MtKUb5PDR98xpoNzCCkyKX
	hziGFr5vYIgO8Jkq+268s4553XJLk0IEIg7AqE+5E04BQamsffgskEIvyMCqTYd00jREPFHsq+n/c
	3cfzJKIgAFoyBQFomDQo2ddR26aPaUtAgUEE+OF1CJMz11BffRJqz9TAwclGtHe++ufA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOw-0004Bl-1S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcOw-0001ms-0Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYcOw-0001ms-0Y@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:38 +0000

commit 920d213cb22a4b8d1a7c941da1955b45c5fd9a09
Merge: b7bda69c4ef46c57480f6e378923f5215b122778 a8c5cf27c945d392edd85b0b0c64cd5c52cae658
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 14:58:13 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 17 14:58:13 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Fix read-only Linux block devices with auto-read-only
    - Require aligned image size with O_DIRECT to avoid assertion failure
    - Allow byte-aligned direct I/O on NFS instead of guessing 4k alignment
    - Fix nbd_export_close_all() crash
    - Fix race in iotests case 030
    - qemu-img resize: Require --shrink for shrinking all image formats
    - crypto: use a stronger private key for tests
    - Remove VXHS block device
    - MAINTAINERS: vvfat: set status to odd fixes
    
    # gpg: Signature made Fri 17 Jul 2020 13:31:18 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      file-posix: Fix leaked fd in raw_open_common() error path
      file-posix: Fix check_hdev_writable() with auto-read-only
      file-posix: Move check_hdev_writable() up
      file-posix: Allow byte-aligned O_DIRECT with NFS
      block: Require aligned image size to avoid assertion failure
      iotests: test shutdown when bitmap is exported through NBD
      nbd: make nbd_export_close_all() synchronous
      iotests/030: Reduce job speed to make race less likely
      crypto: use a stronger private key for tests
      qemu-img resize: Require --shrink for shrinking all image formats
      Remove VXHS block device
      vvfat: set status to odd fixes
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                      |   2 +-
 block.c                          |  16 ++
 block/Makefile.objs              |   2 -
 block/file-posix.c               | 122 +++++---
 block/trace-events               |  17 --
 block/vxhs.c                     | 587 ---------------------------------------
 configure                        |  39 ---
 docs/system/deprecated.rst       |   8 +
 nbd/server.c                     |   8 +
 qapi/block-core.json             |  22 +-
 qemu-img.c                       |  14 +-
 tests/crypto-tls-x509-helpers.c  |  59 ++--
 tests/qemu-iotests/017           |   1 -
 tests/qemu-iotests/029           |   1 -
 tests/qemu-iotests/030           |   2 +-
 tests/qemu-iotests/073           |   1 -
 tests/qemu-iotests/114           |   1 -
 tests/qemu-iotests/130           |   1 -
 tests/qemu-iotests/134           |   1 -
 tests/qemu-iotests/156           |   1 -
 tests/qemu-iotests/158           |   1 -
 tests/qemu-iotests/282           |   1 -
 tests/qemu-iotests/299           |  65 +++++
 tests/qemu-iotests/299.out       |  10 +
 tests/qemu-iotests/check         |  10 -
 tests/qemu-iotests/common.filter |   1 -
 tests/qemu-iotests/common.rc     |  33 ---
 tests/qemu-iotests/common.tls    |  57 ++--
 tests/qemu-iotests/group         |   1 +
 29 files changed, 273 insertions(+), 811 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:57:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16442.40438 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcP8-0005iS-3R; Fri, 30 Oct 2020 21:57:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16442.40438; Fri, 30 Oct 2020 21:57:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcP8-0005iK-0a; Fri, 30 Oct 2020 21:57:50 +0000
Received: by outflank-mailman (input) for mailman id 16442;
 Fri, 30 Oct 2020 21:57:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcP7-0005i7-3c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4214d0e6-487b-4082-89a1-b08fd7dafd8c;
 Fri, 30 Oct 2020 21:57:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcP6-0004CX-Bl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcP6-0001na-B1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcP7-0005i7-3c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:49 +0000
X-Inumbo-ID: 4214d0e6-487b-4082-89a1-b08fd7dafd8c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4214d0e6-487b-4082-89a1-b08fd7dafd8c;
	Fri, 30 Oct 2020 21:57:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2TEt4rLM0kRKttVWBlwvknc3j0HEk1qg8CiAsEXVwdA=; b=NeZ+2Hagcf7YVZYOGlt+vkJW5x
	ggQx5zwqCo/FWljjD4sMeD39WWgDtA2tODMHGnw2XEuaq6PDoyyV6NSgViKQ2SLVvw9AJccIeHT/V
	dkXM4Fz8pqtzKx76a+ZDazunRImGpNr8r9GelRKmS7DvH4WGQgVi7lh+eUKcqVAfN+jQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcP6-0004CX-Bl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcP6-0001na-B1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/s390x: fix vfio-ccw type
Message-Id: <E1kYcP6-0001na-B1@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:48 +0000

commit 9ece07d7a3941eeb845a6f000a191bba19557231
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Thu Jul 16 16:50:31 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 17 12:56:22 2020 +0200

    docs/s390x: fix vfio-ccw type
    
    Fix the type name in the mdevctl example.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Eric Farman <farman@linux.ibm.com>
    Message-Id: <20200716145031.771476-1-cohuck@redhat.com>
---
 docs/system/s390x/vfio-ccw.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/system/s390x/vfio-ccw.rst b/docs/system/s390x/vfio-ccw.rst
index 8f65442c0f..41e0bad5b4 100644
--- a/docs/system/s390x/vfio-ccw.rst
+++ b/docs/system/s390x/vfio-ccw.rst
@@ -29,7 +29,7 @@ automatically, use
 
    [root@host ~]# driverctl -b css set-override 0.0.0313 vfio_ccw
    [root@host ~]# mdevctl define -u 7e270a25-e163-4922-af60-757fc8ed48c6 \
-                  -p 0.0.0313 -t vfio-ccw_io -a
+                  -p 0.0.0313 -t vfio_ccw-io -a
 
 If using ``mdevctl`` is not possible or wanted, follow the manual procedure
 below.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16444.40442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPJ-0005lV-51; Fri, 30 Oct 2020 21:58:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16444.40442; Fri, 30 Oct 2020 21:58:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPJ-0005lN-22; Fri, 30 Oct 2020 21:58:01 +0000
Received: by outflank-mailman (input) for mailman id 16444;
 Fri, 30 Oct 2020 21:57:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcPH-0005lB-J9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 96b6aeb3-7ed6-48ce-88cf-ab5def0f2ea1;
 Fri, 30 Oct 2020 21:57:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPG-0004Cf-FA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPG-0001oI-EN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcPH-0005lB-J9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:59 +0000
X-Inumbo-ID: 96b6aeb3-7ed6-48ce-88cf-ab5def0f2ea1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 96b6aeb3-7ed6-48ce-88cf-ab5def0f2ea1;
	Fri, 30 Oct 2020 21:57:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LvDasHF6xm28yOSycuPeRzHHUuakDzYe07W81IUPrg8=; b=lhNwHoDU2M/JpIuAVkIkhYu60N
	YmEq2/EUtHUKjUNsmloean2IqMwYefFRQkuBq/rJll4VrlVOqgLAOIYcpC4JS6BbK99c6G56EgoZw
	eDVJbGsAohbgGSkBP0RhydnDFWsjpeKjd7btKyl2pPypYfUpthdA00U9qVpu0sAQv9JA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPG-0004Cf-FA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPG-0001oI-EN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:57:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200717' into staging
Message-Id: <E1kYcPG-0001oI-EN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:57:58 +0000

commit 97f750becac33e3d3e446d3ff4ae9af2577b7877
Merge: 920d213cb22a4b8d1a7c941da1955b45c5fd9a09 9ece07d7a3941eeb845a6f000a191bba19557231
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 17:27:34 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 17:27:34 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200717' into staging
    
    Fix typo in newly added documentation.
    
    # gpg: Signature made Fri 17 Jul 2020 14:54:20 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200717:
      docs/s390x: fix vfio-ccw type
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/system/s390x/vfio-ccw.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16445.40447 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPT-0005mf-6s; Fri, 30 Oct 2020 21:58:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16445.40447; Fri, 30 Oct 2020 21:58:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPT-0005mX-3X; Fri, 30 Oct 2020 21:58:11 +0000
Received: by outflank-mailman (input) for mailman id 16445;
 Fri, 30 Oct 2020 21:58:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcPR-0005mM-Oo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id fcb69ef1-b63d-45a7-9d35-71a2fe9229f3;
 Fri, 30 Oct 2020 21:58:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPQ-0004D0-RF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPQ-0001pH-QB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcPR-0005mM-Oo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:09 +0000
X-Inumbo-ID: fcb69ef1-b63d-45a7-9d35-71a2fe9229f3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id fcb69ef1-b63d-45a7-9d35-71a2fe9229f3;
	Fri, 30 Oct 2020 21:58:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=81ToBlEUp0OWlQx8NlQbyLz/Sfy4FdA6VBrZwWplUcI=; b=dQxcRiK1tBYdLZtDcZv5OA0WUc
	MXcdfNgnTY9Wr3Xbe41Cy/q4yAGpVM5f+/F1qc5p4h1KGv+oZOdvGuZ2tyURXKdUU3wwhShso7hTA
	k9pCEhmvsezAYb8LXHapr7c3etPKSwEIFn+0sD9497bR16BWZruAFKbP4ZU0WSYeYRJg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPQ-0004D0-RF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPQ-0001pH-QB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: fix add_bitmaps_to_list
Message-Id: <E1kYcPQ-0001pH-QB@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:08 +0000

commit 7cb015197b383a62f5729d2c92b1050db0185c1c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Fri Jun 26 16:06:58 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Fri Jul 17 08:18:51 2020 -0500

    migration/block-dirty-bitmap: fix add_bitmaps_to_list
    
    We shouldn't fail when finding an unnamed bitmap in a unnamed node or
    node with auto-generated node name, as bitmap migration ignores such
    bitmaps in the first place.
    
    Fixes: 82640edb88faa
    Fixes: 4ff5cc121b089
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200626130658.76498-1-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: commit message grammar tweaks]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 47bc0f650c..b0dbf9eeed 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -274,7 +274,11 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
     DirtyBitmapMigBitmapState *dbms;
     Error *local_err = NULL;
 
-    bitmap = bdrv_dirty_bitmap_first(bs);
+    FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
+        if (bdrv_dirty_bitmap_name(bitmap)) {
+            break;
+        }
+    }
     if (!bitmap) {
         return 0;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16446.40450 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPd-0005o0-8H; Fri, 30 Oct 2020 21:58:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16446.40450; Fri, 30 Oct 2020 21:58:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPd-0005ns-57; Fri, 30 Oct 2020 21:58:21 +0000
Received: by outflank-mailman (input) for mailman id 16446;
 Fri, 30 Oct 2020 21:58:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcPb-0005nh-MA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c71dcfb2-8b1b-4ee0-a225-141f5be8a78c;
 Fri, 30 Oct 2020 21:58:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPa-0004D8-VG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPa-0001px-U3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcPb-0005nh-MA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:19 +0000
X-Inumbo-ID: c71dcfb2-8b1b-4ee0-a225-141f5be8a78c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c71dcfb2-8b1b-4ee0-a225-141f5be8a78c;
	Fri, 30 Oct 2020 21:58:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YO/FWRgOW+8/myek0bZF97vrWRRupBmnPcEccuRCHZo=; b=m5HmvJn5RS2DIFeDvnPLBBt04E
	/Ugvc6GG8hEraHHIZF56TVTKL9aXEaUVBRrzwwh/8P8bj58e8Uz9hIoaWx8kG7ZuYUc5Te1qJlwVe
	Gt2YTg+QZvOvHuA+0Mwb1loJCRjTCurIW7ZX0AKAc+sJO+PKiUU3XV6t6w9hC60yqjE0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPa-0004D8-VG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPa-0001px-U3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-17' into staging
Message-Id: <E1kYcPa-0001px-U3@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:18 +0000

commit 939ab64b400b9bec4b59795a87817784093e1acd
Merge: 97f750becac33e3d3e446d3ff4ae9af2577b7877 7cb015197b383a62f5729d2c92b1050db0185c1c
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 22:24:34 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 22:24:34 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-17' into staging
    
    bitmaps patches for 2020-07-17
    
    - improve corner-case of bitmap migration
    
    # gpg: Signature made Fri 17 Jul 2020 16:10:07 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-07-17:
      migration/block-dirty-bitmap: fix add_bitmaps_to_list
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 migration/block-dirty-bitmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16447.40453 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPn-0005pE-9X; Fri, 30 Oct 2020 21:58:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16447.40453; Fri, 30 Oct 2020 21:58:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPn-0005p6-6d; Fri, 30 Oct 2020 21:58:31 +0000
Received: by outflank-mailman (input) for mailman id 16447;
 Fri, 30 Oct 2020 21:58:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcPm-0005ox-58
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1a607ee9-4ce3-4708-b11e-0252cfee83f1;
 Fri, 30 Oct 2020 21:58:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPl-0004DH-At
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPl-0001r0-A6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcPm-0005ox-58
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:30 +0000
X-Inumbo-ID: 1a607ee9-4ce3-4708-b11e-0252cfee83f1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1a607ee9-4ce3-4708-b11e-0252cfee83f1;
	Fri, 30 Oct 2020 21:58:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=45XnVqKlVIhxh4u/Pg9OUbMO/tTPKsYQ4K95um5Jx9I=; b=Zc+h58KPfhi6EUVj02g5Ccb4ng
	RZwe2hlLDMXiyeaaUZnHCYGDZuX5bC7+c4kISzqCszpPKXWHcUcCqNiyhOoKMXe5H3HiWxXLWZ3ZE
	rYTaLj2due3/Z+8+jeYp2kABJYp6WnlyopJmiX7xRE9yHSXaZZcPNrN8SJUVCVZbkxgA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPl-0004DH-At
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPl-0001r0-A6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ipmi: Add man page pieces for the IPMI PCI devices
Message-Id: <E1kYcPl-0001r0-A6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:29 +0000

commit 323679da77b2fd4dc9be3731ecac96613beea4f1
Author:     Corey Minyard <cminyard@mvista.com>
AuthorDate: Mon Sep 23 13:50:33 2019 -0500
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: Add man page pieces for the IPMI PCI devices
    
    This was forgotten when the devices were added.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 qemu-options.hx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 65147ad971..fb31fe3df6 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -876,6 +876,15 @@ SRST
 ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
     Like the KCS interface, but defines a BT interface. The default port
     is 0xe4 and the default interrupt is 5.
+
+``-device pci-ipmi-kcs,bmc=id``
+    Add a KCS IPMI interafce on the PCI bus.
+
+    ``bmc=id``
+        The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
+
+``-device pci-ipmi-bt,bmc=id``
+    Like the KCS interface, but defines a BT interface on the PCI bus.
 ERST
 
 DEF("name", HAS_ARG, QEMU_OPTION_name,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16448.40458 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPx-0005r3-Av; Fri, 30 Oct 2020 21:58:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16448.40458; Fri, 30 Oct 2020 21:58:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcPx-0005qv-85; Fri, 30 Oct 2020 21:58:41 +0000
Received: by outflank-mailman (input) for mailman id 16448;
 Fri, 30 Oct 2020 21:58:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcPw-0005qm-70
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c9114e3a-4b45-4deb-ac07-37e79f5b66e1;
 Fri, 30 Oct 2020 21:58:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPv-0004Dq-Fj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcPv-0001rf-Dw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcPw-0005qm-70
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:40 +0000
X-Inumbo-ID: c9114e3a-4b45-4deb-ac07-37e79f5b66e1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c9114e3a-4b45-4deb-ac07-37e79f5b66e1;
	Fri, 30 Oct 2020 21:58:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dSdYl7iyTf5KE5e8ZV3w67itiv0dfmYdEmitPQu0F4Y=; b=AtZVStYbE1ybnbeIyPYS5yFA4O
	riuoCw6bd81KzsUBXIEm8jLD5SFEv6Dfzu8LDIcLonK7U6cajq7NJBMZC4fmDGHva12A/407nsiXv
	baXhoGg/ZnjG3MHdcJ3cnt8zjA5jqi7+xdA+LpoiMBge84LY6R6vPwBNrnydDv8DJVbI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPv-0004Dq-Fj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcPv-0001rf-Dw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ipmi: Fix a man page entry
Message-Id: <E1kYcPv-0001rf-Dw@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:39 +0000

commit 789101b73d93ab11f37a44c24fff44336f041345
Author:     Corey Minyard <cminyard@mvista.com>
AuthorDate: Fri Jul 17 11:37:02 2020 -0500
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: Fix a man page entry
    
    The line was too long, and some of the entries were wrong (fur instead
    of fru).  Just use the prop=val thing tha other entries use.
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index fb31fe3df6..708583b4ce 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -806,7 +806,7 @@ SRST
 
     Some drivers are:
 
-``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]``
+``-device ipmi-bmc-sim,id=id[,prop[=value][,...]]``
     Add an IPMI BMC. This is a simulation of a hardware management
     interface processor that normally sits on a system. It provides a
     watchdog and the ability to reset and power control the system. You
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:58:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:58:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16449.40463 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQ8-0005sR-Db; Fri, 30 Oct 2020 21:58:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16449.40463; Fri, 30 Oct 2020 21:58:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQ8-0005sJ-9Z; Fri, 30 Oct 2020 21:58:52 +0000
Received: by outflank-mailman (input) for mailman id 16449;
 Fri, 30 Oct 2020 21:58:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQ7-0005sA-0i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 64af64eb-d498-4d2f-9bbf-754d8f5c0d09;
 Fri, 30 Oct 2020 21:58:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQ5-0004E3-JY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQ5-0001sD-Ic
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQ7-0005sA-0i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:51 +0000
X-Inumbo-ID: 64af64eb-d498-4d2f-9bbf-754d8f5c0d09
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 64af64eb-d498-4d2f-9bbf-754d8f5c0d09;
	Fri, 30 Oct 2020 21:58:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nOPwodQnq0axcz3nMQxVr09rX5Iq47B0p2hpwsFbv8c=; b=oVRLnZsIhlFg32isivNSzp2Kn5
	+EMgqkuPPioxAyi+e6dnsukmKckiWmES5hTm7/CmjefHfBZrOppoHLO4ie+BBEfmppZ7TTkMEsaN9
	P198KAJWErRhVmIb8+LYaX2HcZpcqd51qDowOtJ+2+LoOnjxKy3h72644MinYIppU5q4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQ5-0004E3-JY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQ5-0001sD-Ic
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ipmi: add SET_SENSOR_READING command
Message-Id: <E1kYcQ5-0001sD-Ic@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:49 +0000

commit e3f7320caa1cc08a9b752e555b79abd6218c7c7a
Author:     Cédric Le Goater <clg@kaod.org>
AuthorDate: Mon Nov 18 10:24:29 2019 +0100
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Fri Jul 17 11:39:46 2020 -0500

    ipmi: add SET_SENSOR_READING command
    
    SET_SENSOR_READING is a complex IPMI command (see IPMI spec 35.17)
    which enables the host software to set the reading value and the event
    status of sensors supporting it.
    
    Below is a proposal for all the operations (reading, assert, deassert,
    event data) with the following limitations :
    
     - No event are generated for threshold-based sensors.
     - The case in which the BMC needs to generate its own events is not
       supported.
    
    Signed-off-by: Cédric Le Goater <clg@kaod.org>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Message-Id: <20191118092429.16149-1-clg@kaod.org>
    [Moved the break statement for case SENSOR_GEN_EVENT_DATA above the
     closing brace to keep the indention consistent.]
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/ipmi/ipmi_bmc_sim.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 223 insertions(+)

diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index 0b97e04774..f78e92d3d5 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -49,6 +49,7 @@
 #define IPMI_CMD_GET_SENSOR_READING       0x2d
 #define IPMI_CMD_SET_SENSOR_TYPE          0x2e
 #define IPMI_CMD_GET_SENSOR_TYPE          0x2f
+#define IPMI_CMD_SET_SENSOR_READING       0x30
 
 /* #define IPMI_NETFN_APP             0x06 In ipmi.h */
 
@@ -1747,6 +1748,227 @@ static void get_sensor_type(IPMIBmcSim *ibs,
     rsp_buffer_push(rsp, sens->evt_reading_type_code);
 }
 
+/*
+ * bytes   parameter
+ *    1    sensor number
+ *    2    operation (see below for bits meaning)
+ *    3    sensor reading
+ *  4:5    assertion states (optional)
+ *  6:7    deassertion states (optional)
+ *  8:10   event data 1,2,3 (optional)
+ */
+static void set_sensor_reading(IPMIBmcSim *ibs,
+                               uint8_t *cmd, unsigned int cmd_len,
+                               RspBuffer *rsp)
+{
+    IPMISensor *sens;
+    uint8_t evd1 = 0;
+    uint8_t evd2 = 0;
+    uint8_t evd3 = 0;
+    uint8_t new_reading = 0;
+    uint16_t new_assert_states = 0;
+    uint16_t new_deassert_states = 0;
+    bool change_reading = false;
+    bool change_assert = false;
+    bool change_deassert = false;
+    enum {
+        SENSOR_GEN_EVENT_NONE,
+        SENSOR_GEN_EVENT_DATA,
+        SENSOR_GEN_EVENT_BMC,
+    } do_gen_event = SENSOR_GEN_EVENT_NONE;
+
+    if ((cmd[2] >= MAX_SENSORS) ||
+            !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {
+        rsp_buffer_set_error(rsp, IPMI_CC_REQ_ENTRY_NOT_PRESENT);
+        return;
+    }
+
+    sens = ibs->sensors + cmd[2];
+
+    /* [1:0] Sensor Reading operation */
+    switch ((cmd[3]) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value to sensor reading byte */
+        new_reading = cmd[4];
+        if (sens->reading != new_reading) {
+            change_reading = true;
+        }
+        break;
+    case 2:
+    case 3:
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /* [3:2] Deassertion bits operation */
+    switch ((cmd[3] >> 2) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value */
+        if (cmd_len > 7) {
+            new_deassert_states = cmd[7];
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (cmd[8] << 8);
+        }
+        break;
+
+    case 2: /* mask on */
+        if (cmd_len > 7) {
+            new_deassert_states = (sens->deassert_states | cmd[7]);
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (sens->deassert_states | (cmd[8] << 8));
+        }
+        break;
+
+    case 3: /* mask off */
+        if (cmd_len > 7) {
+            new_deassert_states = (sens->deassert_states & cmd[7]);
+            change_deassert = true;
+        }
+        if (cmd_len > 8) {
+            new_deassert_states |= (sens->deassert_states & (cmd[8] << 8));
+        }
+        break;
+    }
+
+    if (change_deassert && (new_deassert_states == sens->deassert_states)) {
+        change_deassert = false;
+    }
+
+    /* [5:4] Assertion bits operation */
+    switch ((cmd[3] >> 4) & 0x3) {
+    case 0: /* Do not change */
+        break;
+    case 1: /* write given value */
+        if (cmd_len > 5) {
+            new_assert_states = cmd[5];
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (cmd[6] << 8);
+        }
+        break;
+
+    case 2: /* mask on */
+        if (cmd_len > 5) {
+            new_assert_states = (sens->assert_states | cmd[5]);
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (sens->assert_states | (cmd[6] << 8));
+        }
+        break;
+
+    case 3: /* mask off */
+        if (cmd_len > 5) {
+            new_assert_states = (sens->assert_states & cmd[5]);
+            change_assert = true;
+        }
+        if (cmd_len > 6) {
+            new_assert_states |= (sens->assert_states & (cmd[6] << 8));
+        }
+        break;
+    }
+
+    if (change_assert && (new_assert_states == sens->assert_states)) {
+        change_assert = false;
+    }
+
+    if (cmd_len > 9) {
+        evd1 = cmd[9];
+    }
+    if (cmd_len > 10) {
+        evd2 = cmd[10];
+    }
+    if (cmd_len > 11) {
+        evd3 = cmd[11];
+    }
+
+    /* [7:6] Event Data Bytes operation */
+    switch ((cmd[3] >> 6) & 0x3) {
+    case 0: /*
+             * Don’t use Event Data bytes from this command. BMC will
+             * generate it's own Event Data bytes based on its sensor
+             * implementation.
+             */
+        evd1 = evd2 = evd3 = 0x0;
+        do_gen_event = SENSOR_GEN_EVENT_BMC;
+        break;
+    case 1: /*
+             * Write given values to event data bytes including bits
+             * [3:0] Event Data 1.
+             */
+        do_gen_event = SENSOR_GEN_EVENT_DATA;
+        break;
+    case 2: /*
+             * Write given values to event data bytes excluding bits
+             * [3:0] Event Data 1.
+             */
+        evd1 &= 0xf0;
+        do_gen_event = SENSOR_GEN_EVENT_DATA;
+        break;
+    case 3:
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /*
+     * Event Data Bytes operation and parameter are inconsistent. The
+     * Specs are not clear on that topic but generating an error seems
+     * correct.
+     */
+    if (do_gen_event == SENSOR_GEN_EVENT_DATA && cmd_len < 10) {
+        rsp_buffer_set_error(rsp, IPMI_CC_INVALID_DATA_FIELD);
+        return;
+    }
+
+    /* commit values */
+    if (change_reading) {
+        sens->reading = new_reading;
+    }
+
+    if (change_assert) {
+        sens->assert_states = new_assert_states;
+    }
+
+    if (change_deassert) {
+        sens->deassert_states = new_deassert_states;
+    }
+
+    /* TODO: handle threshold sensor */
+    if (!IPMI_SENSOR_IS_DISCRETE(sens)) {
+        return;
+    }
+
+    switch (do_gen_event) {
+    case SENSOR_GEN_EVENT_DATA: {
+        unsigned int bit = evd1 & 0xf;
+        uint16_t mask = (1 << bit);
+
+        if (sens->assert_states & mask & sens->assert_enable) {
+            gen_event(ibs, cmd[2], 0, evd1, evd2, evd3);
+        }
+
+        if (sens->deassert_states & mask & sens->deassert_enable) {
+            gen_event(ibs, cmd[2], 1, evd1, evd2, evd3);
+        }
+        break;
+    }
+    case SENSOR_GEN_EVENT_BMC:
+        /*
+         * TODO: generate event and event data bytes depending on the
+         * sensor
+         */
+        break;
+    case SENSOR_GEN_EVENT_NONE:
+        break;
+    }
+}
 
 static const IPMICmdHandler chassis_cmds[] = {
     [IPMI_CMD_GET_CHASSIS_CAPABILITIES] = { chassis_capabilities },
@@ -1768,6 +1990,7 @@ static const IPMICmdHandler sensor_event_cmds[] = {
     [IPMI_CMD_GET_SENSOR_READING] = { get_sensor_reading, 3 },
     [IPMI_CMD_SET_SENSOR_TYPE] = { set_sensor_type, 5 },
     [IPMI_CMD_GET_SENSOR_TYPE] = { get_sensor_type, 3 },
+    [IPMI_CMD_SET_SENSOR_READING] = { set_sensor_reading, 5 },
 };
 static const IPMINetfn sensor_event_netfn = {
     .cmd_nums = ARRAY_SIZE(sensor_event_cmds),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16450.40465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQI-0005tr-Fq; Fri, 30 Oct 2020 21:59:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16450.40465; Fri, 30 Oct 2020 21:59:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQI-0005ti-Ct; Fri, 30 Oct 2020 21:59:02 +0000
Received: by outflank-mailman (input) for mailman id 16450;
 Fri, 30 Oct 2020 21:59:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQG-0005tV-Gg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8e91a11a-f911-4932-83f3-fe31554e9d2d;
 Fri, 30 Oct 2020 21:58:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQF-0004E9-NX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQF-0001sn-Mj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQG-0005tV-Gg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:00 +0000
X-Inumbo-ID: 8e91a11a-f911-4932-83f3-fe31554e9d2d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8e91a11a-f911-4932-83f3-fe31554e9d2d;
	Fri, 30 Oct 2020 21:58:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SvbksyJ66v/uPrTUASxFjf8ZfaJjCtWvwiKOBf1W2Hw=; b=ijvSexQC8VmV5fWySLMvarGu68
	S0Huj1XqBX5htlHtbHH1vAE5YttZH5R15XgBJL2+kUcsCrGSvsXhlK21HsOxf8UWDKBTn6pvUuLmg
	sX8bZNdDyUXBxrQOnh6AoQ2jZ/UPLB51iB432EPlb8YYmuoCoKIZSPRXG19g2MwNiQHU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQF-0004E9-NX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQF-0001sn-Mj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:58:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-ipmi-5' into staging
Message-Id: <E1kYcQF-0001sn-Mj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:58:59 +0000

commit b4421193299c09dfe690ec93c9b4713ed710aa3e
Merge: 939ab64b400b9bec4b59795a87817784093e1acd e3f7320caa1cc08a9b752e555b79abd6218c7c7a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 18 23:59:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 18 23:59:03 2020 +0100

    Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-ipmi-5' into staging
    
    Man page update and new set sensor command
    
    Some minor man page updates for fairly obvious things.
    
    The set sensor command addition has been in the Power group's tree for a
    long time and I have neglected to submit it.
    
    -corey
    
    # gpg: Signature made Fri 17 Jul 2020 17:45:32 BST
    # gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
    # gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
    # gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81
    
    * remotes/cminyard/tags/for-qemu-ipmi-5:
      ipmi: add SET_SENSOR_READING command
      ipmi: Fix a man page entry
      ipmi: Add man page pieces for the IPMI PCI devices
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ipmi/ipmi_bmc_sim.c | 223 +++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-options.hx        |  11 ++-
 2 files changed, 233 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16451.40470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQS-0005v7-HM; Fri, 30 Oct 2020 21:59:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16451.40470; Fri, 30 Oct 2020 21:59:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQS-0005uz-EV; Fri, 30 Oct 2020 21:59:12 +0000
Received: by outflank-mailman (input) for mailman id 16451;
 Fri, 30 Oct 2020 21:59:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQQ-0005up-T7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f948c6d8-87d3-4e4d-a317-b9dddb7771b1;
 Fri, 30 Oct 2020 21:59:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQQ-0004EX-3g
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQQ-0001tu-2P
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQQ-0005up-T7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
X-Inumbo-ID: f948c6d8-87d3-4e4d-a317-b9dddb7771b1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f948c6d8-87d3-4e4d-a317-b9dddb7771b1;
	Fri, 30 Oct 2020 21:59:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1Y+ujesLL6N44JXnFPHDgL5e/F1a34UxBPXgG+cJvo4=; b=RkDdSjBTP5jawoTXCqbnSEbbvh
	88duIeUE+VgLCPAbhFzuWfd0cIFtfg3tV6nwdBY5/1inw6bVZrx++43oxfQoFMJTRvHWAvokAQbqf
	qHN1yJT3kj/efqjI4pATo0bCFJRF3Jt+VaWwN3Fk5E625vUyfA/keNT/QjK35mv/fkYQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQQ-0004EX-3g
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQQ-0001tu-2P
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tcg: Save/restore vecop_list around minmax fallback
Message-Id: <E1kYcQQ-0001tu-2P@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:59:10 +0000

commit 69c918d2ef319ac63cd759c527debc2a2bdf3a0c
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Tue Jun 9 16:32:09 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Thu Jul 16 13:09:22 2020 -0700

    tcg: Save/restore vecop_list around minmax fallback
    
    Forgetting this asserts when tcg_gen_cmp_vec is called from
    within tcg_gen_cmpsel_vec.
    
    Fixes: 72b4c792c7a
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg-op-vec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c
index f784517d84..ed6fb55fe1 100644
--- a/tcg/tcg-op-vec.c
+++ b/tcg/tcg-op-vec.c
@@ -657,7 +657,9 @@ static void do_minmax(unsigned vece, TCGv_vec r, TCGv_vec a,
                       TCGv_vec b, TCGOpcode opc, TCGCond cond)
 {
     if (!do_op3(vece, r, a, b, opc)) {
+        const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL);
         tcg_gen_cmpsel_vec(cond, vece, r, a, b, a, b);
+        tcg_swap_vecop_list(hold_list);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16452.40474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQc-0005wR-J5; Fri, 30 Oct 2020 21:59:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16452.40474; Fri, 30 Oct 2020 21:59:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQc-0005wJ-G2; Fri, 30 Oct 2020 21:59:22 +0000
Received: by outflank-mailman (input) for mailman id 16452;
 Fri, 30 Oct 2020 21:59:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQb-0005w7-7n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cba680c8-798f-4357-b3a3-d7ae55061996;
 Fri, 30 Oct 2020 21:59:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQa-0004Eh-83
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQa-0001uM-6O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQb-0005w7-7n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:21 +0000
X-Inumbo-ID: cba680c8-798f-4357-b3a3-d7ae55061996
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cba680c8-798f-4357-b3a3-d7ae55061996;
	Fri, 30 Oct 2020 21:59:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ApdCLX4yrgGVj0sbVSIath1jEMieIXx8MdJrmxHP7bw=; b=X6NjivNnQ/I4ii6WvIEm1waCuk
	55DjX0HcM/XZvSt8r1cKT9u2JlkSVTNq5EMW6oTCiJD2LbdddoEan2sZztMy42seR85dHTmW2Y73k
	94A65+Way6l9qdNmo31I/r483Vh2c7ovqo/G/CeJ7syNy2rk6/pERxsjl7qBiW7qMqr0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQa-0004Eh-83
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQa-0001uM-6O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tcg/cpu-exec: precise single-stepping after an exception
Message-Id: <E1kYcQa-0001uM-6O@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:59:20 +0000

commit a7ba744f4082abbd3e36a9265dd1682ad0980477
Author:     Luc Michel <luc.michel@greensocs.com>
AuthorDate: Thu Jul 16 21:39:47 2020 +0200
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Thu Jul 16 14:08:29 2020 -0700

    tcg/cpu-exec: precise single-stepping after an exception
    
    When single-stepping with a debugger attached to QEMU, and when an
    exception is raised, the debugger misses the first instruction after the
    exception:
    
    $ qemu-system-aarch64 -M virt -display none -cpu cortex-a53 -s -S
    
    $ aarch64-linux-gnu-gdb
    GNU gdb (GDB) 9.2
    [...]
    (gdb) tar rem :1234
    Remote debugging using :1234
    warning: No executable has been specified and target does not support
    determining executable automatically.  Try using the "file" command.
    0x0000000000000000 in ?? ()
    (gdb) # writing nop insns to 0x200 and 0x204
    (gdb) set *0x200 = 0xd503201f
    (gdb) set *0x204 = 0xd503201f
    (gdb) # 0x0 address contains 0 which is an invalid opcode.
    (gdb) # The CPU should raise an exception and jump to 0x200
    (gdb) si
    0x0000000000000204 in ?? ()
    
    With this commit, the same run steps correctly on the first instruction
    of the exception vector:
    
    (gdb) si
    0x0000000000000200 in ?? ()
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/757702
    Signed-off-by: Luc Michel <luc.michel@greensocs.com>
    Message-Id: <20200716193947.3058389-1-luc.michel@greensocs.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index d95c4848a4..6a3d3a3cfc 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -504,6 +504,17 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
             cc->do_interrupt(cpu);
             qemu_mutex_unlock_iothread();
             cpu->exception_index = -1;
+
+            if (unlikely(cpu->singlestep_enabled)) {
+                /*
+                 * After processing the exception, ensure an EXCP_DEBUG is
+                 * raised when single-stepping so that GDB doesn't miss the
+                 * next instruction.
+                 */
+                *ret = EXCP_DEBUG;
+                cpu_handle_debug_exception(cpu);
+                return true;
+            }
         } else if (!replay_has_interrupt()) {
             /* give a chance to iothread in replay mode */
             *ret = EXCP_INTERRUPT;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16453.40478 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQm-0005xg-Ke; Fri, 30 Oct 2020 21:59:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16453.40478; Fri, 30 Oct 2020 21:59:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQm-0005xY-Hb; Fri, 30 Oct 2020 21:59:32 +0000
Received: by outflank-mailman (input) for mailman id 16453;
 Fri, 30 Oct 2020 21:59:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQl-0005xL-9Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8a43ee59-7697-4a54-9638-55d378fa8f8f;
 Fri, 30 Oct 2020 21:59:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQk-0004Eq-C5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQk-0001us-Al
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQl-0005xL-9Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:31 +0000
X-Inumbo-ID: 8a43ee59-7697-4a54-9638-55d378fa8f8f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8a43ee59-7697-4a54-9638-55d378fa8f8f;
	Fri, 30 Oct 2020 21:59:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=szaJJ4XSx+t/vNR3J/pkn1iWZC5FkZJVdzC6lBY1cTg=; b=puC/wVoy7vtYUN+ERpOZyA1Q6Z
	8vpQd9RU5wIkHg/2x3qSMsuGy28euA+T4BjhEYoUaldZYH5a5S4xP+ioHf0zo2RoO7yVely3hH0V5
	ejW82dSp5ePN6jBBOk9gN1CI6NPpGcE9ewx+u1a3TT+SmFjax5K6z5ye7ywrmBeYyDiQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQk-0004Eq-C5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQk-0001us-Al
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tcg/cpu-exec: precise single-stepping after an interrupt
Message-Id: <E1kYcQk-0001us-Al@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:59:30 +0000

commit ba3c35d9c4026361fd380b269dc6def9510b7166
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Fri Jul 17 09:26:59 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 17 11:09:34 2020 -0700

    tcg/cpu-exec: precise single-stepping after an interrupt
    
    When single-stepping with a debugger attached to QEMU, and when an
    interrupt is raised, the debugger misses the first instruction after
    the interrupt.
    
    Tested-by: Luc Michel <luc.michel@greensocs.com>
    Reviewed-by: Luc Michel <luc.michel@greensocs.com>
    Buglink: https://bugs.launchpad.net/qemu/+bug/757702
    Message-Id: <20200717163029.2737546-1-richard.henderson@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 6a3d3a3cfc..66d38f9d85 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -588,7 +588,13 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
         else {
             if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
                 replay_interrupt();
-                cpu->exception_index = -1;
+                /*
+                 * After processing the interrupt, ensure an EXCP_DEBUG is
+                 * raised when single-stepping so that GDB doesn't miss the
+                 * next instruction.
+                 */
+                cpu->exception_index =
+                    (cpu->singlestep_enabled ? EXCP_DEBUG : -1);
                 *last_tb = NULL;
             }
             /* The target hook may have updated the 'cpu->interrupt_request';
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16454.40482 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQw-0005zN-ME; Fri, 30 Oct 2020 21:59:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16454.40482; Fri, 30 Oct 2020 21:59:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcQw-0005zF-JD; Fri, 30 Oct 2020 21:59:42 +0000
Received: by outflank-mailman (input) for mailman id 16454;
 Fri, 30 Oct 2020 21:59:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcQv-0005z3-El
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c9ea6490-baab-45b1-8557-c1958a52ea57;
 Fri, 30 Oct 2020 21:59:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQu-0004Fd-GJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcQu-0001vT-Ex
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcQv-0005z3-El
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:41 +0000
X-Inumbo-ID: c9ea6490-baab-45b1-8557-c1958a52ea57
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c9ea6490-baab-45b1-8557-c1958a52ea57;
	Fri, 30 Oct 2020 21:59:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LSWWmBSx+8gymKgXz4IWrFDrE+WUMch1YJjaGotc0Cg=; b=QG7Ivt9ieLsW7tqBBzaQIdQPXD
	iiy1OqJevPVdNkQo13DuKToKPKkNdsHWBNKoqBSUCtYXYsn6TuhVTmaE/uPkzkd0uMFvIyi+5dmNl
	0lyLelqxmCV+6LPPvgV3X71/VM2M1q4WZ6iACVN12BtUtzzPB7e4dXZCKGfZC54gM1Mc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQu-0004Fd-GJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcQu-0001vT-Ex
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200717' into staging
Message-Id: <E1kYcQu-0001vT-Ex@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:59:40 +0000

commit 9fc87111005e8903785db40819af66b8f85b8b96
Merge: b4421193299c09dfe690ec93c9b4713ed710aa3e ba3c35d9c4026361fd380b269dc6def9510b7166
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 19 10:29:05 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 19 10:29:05 2020 +0100

    Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200717' into staging
    
    Fix vector min/max fallback expansion
    Fix singlestep from exception and interrupt
    
    # gpg: Signature made Fri 17 Jul 2020 19:13:32 BST
    # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
    # gpg:                issuer "richard.henderson@linaro.org"
    # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
    # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
    
    * remotes/rth/tags/pull-tcg-20200717:
      tcg/cpu-exec: precise single-stepping after an interrupt
      tcg/cpu-exec: precise single-stepping after an exception
      tcg: Save/restore vecop_list around minmax fallback
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/tcg/cpu-exec.c | 19 ++++++++++++++++++-
 tcg/tcg-op-vec.c     |  2 ++
 2 files changed, 20 insertions(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 21:59:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 21:59:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16455.40486 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcR6-00060a-Nh; Fri, 30 Oct 2020 21:59:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16455.40486; Fri, 30 Oct 2020 21:59:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcR6-00060S-Ki; Fri, 30 Oct 2020 21:59:52 +0000
Received: by outflank-mailman (input) for mailman id 16455;
 Fri, 30 Oct 2020 21:59:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcR5-00060J-Ds
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 20274c71-0498-40c5-8fa6-bdad6517ac88;
 Fri, 30 Oct 2020 21:59:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcR4-0004Fl-Jy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcR4-0001wA-J5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcR5-00060J-Ds
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:51 +0000
X-Inumbo-ID: 20274c71-0498-40c5-8fa6-bdad6517ac88
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 20274c71-0498-40c5-8fa6-bdad6517ac88;
	Fri, 30 Oct 2020 21:59:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Lod8PgBRhxyw+fvnuKaHTF4ee78qdcoiQIZGpFJSMGA=; b=uqTArgkbXXQV8EahgHLhZeJ5Qu
	+6AjVdXPglaDB20DvmOOf0NRXjwByjxRF7qxS0RQAC8C2c9dfj4X3RiW5rWR5apV6n2sgvWo5z1JP
	qDbjpKB1O0iGB72+d3XmsahUzRwd2eQ0ZyRLNeFTUmWJCt8+SLbfv6WGvXZwTT6P4Elg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcR4-0004Fl-Jy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcR4-0001wA-J5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 21:59:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Makefile: Remove config-devices.mak on "make clean"
Message-Id: <E1kYcR4-0001wA-J5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 21:59:50 +0000

commit d69cda7ed722e445d03e1ace6563bab3a76e023e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 17 16:25:08 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:02:46 2020 +0100

    Makefile: Remove config-devices.mak on "make clean"
    
    The config-devices.mak files are generated by "make", and so they
    should be deleted by "make clean".
    
    (This is different from config-host.mak and config-all-disas.mak,
    which are created by "configure" and so only deleted by
    "make distclean".)
    
    If we don't delete these files on "make clean", then the build
    tree is left in a state where it has the config-devices.mak
    file but not the config-devices.mak.d file, and make will not
    realize that it needs to rebuild config-devices.mak if, for
    instance, hw/sd/Kconfig changes.
    
    NB: config-all-devices.mak is also generated by "make", but we
    already remove it on "make clean".
    
    Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20200717152508.10272-1-peter.maydell@linaro.org
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 32345c610e..c2120d8d48 100644
--- a/Makefile
+++ b/Makefile
@@ -775,6 +775,7 @@ clean: recurse-clean
 	rm -f storage-daemon/qapi/qapi-gen-timestamp
 	rm -rf qga/qapi-generated
 	rm -f config-all-devices.mak
+	rm -f $(SUBDIR_DEVICES_MAK)
 
 VERSION ?= $(shell cat VERSION)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16456.40491 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRH-0006HT-QY; Fri, 30 Oct 2020 22:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16456.40491; Fri, 30 Oct 2020 22:00:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRH-0006HK-MF; Fri, 30 Oct 2020 22:00:03 +0000
Received: by outflank-mailman (input) for mailman id 16456;
 Fri, 30 Oct 2020 22:00:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcRF-000675-VE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 926bbfe8-e972-4fa1-b723-5dc17a29aab8;
 Fri, 30 Oct 2020 22:00:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRF-0004Ft-0U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRE-0001xT-W4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcRF-000675-VE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:01 +0000
X-Inumbo-ID: 926bbfe8-e972-4fa1-b723-5dc17a29aab8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 926bbfe8-e972-4fa1-b723-5dc17a29aab8;
	Fri, 30 Oct 2020 22:00:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1cj16tjdHBBLsnLvdt2R7f90M8IayHhwpxoHwfumFm4=; b=4wfNjhU9vHwn61vecOdhDJingT
	gmsadXzmIKEvrwlSVv6SLZy3zAvRZzIpLT0dqpn2BHW2gd2Ze45eMWqGcVxeMfYY/Bj6T0ecmCstq
	/HSV32MIJj0bjXXTXTpnwf41GHiI6g20wQRsmw6zzfmcUcYObMRQiqxNQHC9hTJx/CdE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRF-0004Ft-0U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRE-0001xT-W4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c/Kconfig: Add an entry for the SMBus
Message-Id: <E1kYcRE-0001xT-W4@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:00 +0000

commit ae163b8d9588f02de6a4b6dba310307ba485d4a9
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Dec 31 19:32:07 2019 +0100
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c/Kconfig: Add an entry for the SMBus
    
    The System Management Bus is more or less a derivative of the I2C
    bus, thus the Kconfig entry depends of I2C.
    Not all boards providing an I2C bus support SMBus.
    Use two different Kconfig entries to be able to select I2C without
    selecting SMBus.
    
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20191231183216.6781-6-philmd@redhat.com>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/i2c/Kconfig       | 8 ++++++--
 hw/i2c/Makefile.objs | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/i2c/Kconfig b/hw/i2c/Kconfig
index 2bbd395813..09642a6dcb 100644
--- a/hw/i2c/Kconfig
+++ b/hw/i2c/Kconfig
@@ -1,9 +1,13 @@
 config I2C
     bool
 
+config SMBUS
+    bool
+    select I2C
+
 config SMBUS_EEPROM
     bool
-    depends on I2C
+    select SMBUS
 
 config VERSATILE_I2C
     bool
@@ -11,7 +15,7 @@ config VERSATILE_I2C
 
 config ACPI_SMBUS
     bool
-    select I2C
+    select SMBUS
 
 config BITBANG_I2C
     bool
diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs
index 6ba976b257..f2c61eaa8b 100644
--- a/hw/i2c/Makefile.objs
+++ b/hw/i2c/Makefile.objs
@@ -1,4 +1,5 @@
-common-obj-$(CONFIG_I2C) += core.o smbus_slave.o smbus_master.o
+common-obj-$(CONFIG_I2C) += core.o
+common-obj-$(CONFIG_SMBUS) += smbus_slave.o smbus_master.o
 common-obj-$(CONFIG_SMBUS_EEPROM) += smbus_eeprom.o
 common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
 common-obj-$(CONFIG_ACPI_X86_ICH) += smbus_ich9.o
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16457.40493 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRR-0006kt-R2; Fri, 30 Oct 2020 22:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16457.40493; Fri, 30 Oct 2020 22:00:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRR-0006kl-No; Fri, 30 Oct 2020 22:00:13 +0000
Received: by outflank-mailman (input) for mailman id 16457;
 Fri, 30 Oct 2020 22:00:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcRQ-0006k6-Ei
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 81c115a9-1da3-42ec-a5d8-d3e81143bc49;
 Fri, 30 Oct 2020 22:00:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRP-0004II-4C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRP-0001zA-3I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcRQ-0006k6-Ei
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:12 +0000
X-Inumbo-ID: 81c115a9-1da3-42ec-a5d8-d3e81143bc49
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 81c115a9-1da3-42ec-a5d8-d3e81143bc49;
	Fri, 30 Oct 2020 22:00:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UCb3gyPjrX9weUXCx9WoCkiTapchqKLALCT2GFGfW6c=; b=jbplLNNEVdNkiWt4QYzvxgEDd0
	odggu742Ya9+HvKVdEVOstCe3A/HFuBIghPicl9hgiWuZFhyV2Ecys1ppzpoTRpWuX+V5YQCoD4CM
	ROR8vynZ0fS+iGYgPQj+dSaILnOxDXZvR7sAUiCSa8hV89+ToOWKsHlG4C8QXw2FepEs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRP-0004II-4C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRP-0001zA-3I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
Message-Id: <E1kYcRP-0001zA-3I@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:11 +0000

commit 7a204cbdc280fd9ab6c8d34a01f112ea5e809f70
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:50 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
    
    All the callers of aspeed_i2c_get_bus() have a AspeedI2CState and
    cast it to a DeviceState with DEVICE(), then aspeed_i2c_get_bus()
    cast the DeviceState to an AspeedI2CState with ASPEED_I2C()...
    
    Simplify aspeed_i2c_get_bus() callers by using AspeedI2CState
    argument.
    
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-2-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c             | 70 ++++++++++++++++++++++-----------------------
 hw/i2c/aspeed_i2c.c         |  3 +-
 include/hw/i2c/aspeed_i2c.h |  2 +-
 3 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 660dcb5414..dc3f44393f 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -385,13 +385,13 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The palmetto platform expects a ds3231 RTC but a ds1338 is
      * enough to provide basic RTC features. Alarms will be missing */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), "ds1338", 0x68);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), 0x50,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50,
                           eeprom_buf);
 
     /* add a TMP423 temperature sensor */
-    dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2),
+    dev = i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2),
                            "tmp423", 0x4c);
     object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
@@ -404,16 +404,16 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
     uint8_t *eeprom_buf = g_malloc0(8 * 1024);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), 0x50,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 3), 0x50,
                           eeprom_buf);
 
     /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7),
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7),
                      TYPE_TMP105, 0x4d);
 
     /* The AST2500 EVB does not have an RTC. Let's pretend that one is
      * plugged on the I2C bus header */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
@@ -428,36 +428,36 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void swift_bmc_i2c_init(AspeedMachineState *bmc)
 {
     AspeedSoCState *soc = &bmc->soc;
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
     /* The swift board expects a pca9551 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
 
     /* The swift board expects an Epson RX8900 RTC but a ds1338 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "ds1338", 0x32);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "pca9552", 0x74);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "pca9552",
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
                      0x74);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", 0x4a);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
 }
 
 static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
@@ -465,32 +465,32 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
 
     /* bus 2 : */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0x49);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
     /* bus 2 : pca9546 @ 0x73 */
 
     /* bus 3 : pca9548 @ 0x70 */
 
     /* bus 4 : */
     uint8_t *eeprom4_54 = g_malloc0(8 * 1024);
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), 0x54,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 4), 0x54,
                           eeprom4_54);
     /* PCA9539 @ 0x76, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", 0x76);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
     /* PCA9539 @ 0x77, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", 0x77);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
 
     /* bus 6 : */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0x49);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
     /* bus 6 : pca9546 @ 0x73 */
 
     /* bus 8 : */
     uint8_t *eeprom8_56 = g_malloc0(8 * 1024);
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), 0x56,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 0x56,
                           eeprom8_56);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x60);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", 0x61);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
     /* bus 8 : adc128d818 @ 0x1d */
     /* bus 8 : adc128d818 @ 0x1f */
 
@@ -515,25 +515,25 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO dps310@76 */
     dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
     qdev_prop_set_string(dev, "description", "pca1");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3),
+    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
                           &error_fatal);
 
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "tmp423", 0x4c);
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
 
     /* The Witherspoon expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), TYPE_TMP105,
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
                      0x4a);
 
     /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", 0x32);
+    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 
-    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), 0x51,
+    smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
     dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
     qdev_prop_set_string(dev, "description", "pca0");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11),
+    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
                           &error_fatal);
     /* Bus 11: TODO ucd90160@64 */
 }
diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index fb973a983d..518a3f5c6f 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -959,9 +959,8 @@ static void aspeed_i2c_register_types(void)
 type_init(aspeed_i2c_register_types)
 
 
-I2CBus *aspeed_i2c_get_bus(DeviceState *dev, int busnr)
+I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr)
 {
-    AspeedI2CState *s = ASPEED_I2C(dev);
     AspeedI2CClass *aic = ASPEED_I2C_GET_CLASS(s);
     I2CBus *bus = NULL;
 
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
index f1b9e5bf91..243789ae5d 100644
--- a/include/hw/i2c/aspeed_i2c.h
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -93,6 +93,6 @@ typedef struct AspeedI2CClass {
 
 } AspeedI2CClass;
 
-I2CBus *aspeed_i2c_get_bus(DeviceState *dev, int busnr);
+I2CBus *aspeed_i2c_get_bus(AspeedI2CState *s, int busnr);
 
 #endif /* ASPEED_I2C_H */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16458.40498 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRa-0006mA-UD; Fri, 30 Oct 2020 22:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16458.40498; Fri, 30 Oct 2020 22:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRa-0006m2-R7; Fri, 30 Oct 2020 22:00:22 +0000
Received: by outflank-mailman (input) for mailman id 16458;
 Fri, 30 Oct 2020 22:00:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcRa-0006lw-BE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ab61a866-4f99-4a40-8423-4defa0c2c7aa;
 Fri, 30 Oct 2020 22:00:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRZ-0004IY-8b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRZ-0001zo-71
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcRa-0006lw-BE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:22 +0000
X-Inumbo-ID: ab61a866-4f99-4a40-8423-4defa0c2c7aa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ab61a866-4f99-4a40-8423-4defa0c2c7aa;
	Fri, 30 Oct 2020 22:00:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Q/EPWCxXa1h6COgaKqeEULfJcix+qMczOd+xMQ95REU=; b=rJb4nsHfDgJXN5UE+wROWK8p+r
	BDc5nPlR6JTkQH5/rePf8UJHGFmIl8sOOR0PgKDjzwX9Z6o1zFB0Ry6WWUsq4JoIhDZqP0w6+KPGK
	GIDWMImaJgaDx3UaiUHAc4SOtkpAUQ7USmPDJTHw+jAIbjoePvoDdU1ip2HIw1Lxv8O8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRZ-0004IY-8b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRZ-0001zo-71
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
Message-Id: <E1kYcRZ-0001zo-71@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:21 +0000

commit db437ca6dfc8db3d91ee75babc4b1fee8c95e9ab
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:51 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
    
    We use "new" names for functions that allocate and initialize
    device objects: pci_new(), isa_new(), usb_new().
    Let's call this one i2c_slave_new(). Since we have to update
    all the callers, also let it return a I2CSlave object.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-3-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      |  4 ++--
 hw/i2c/core.c        | 11 +++++------
 include/hw/i2c/i2c.h |  2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index dc3f44393f..51687fd3b3 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -513,7 +513,7 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO bmp280@77 */
     /* Bus 3: TODO max31785@52 */
     /* Bus 3: TODO dps310@76 */
-    dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
+    dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca1");
     i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
                           &error_fatal);
@@ -531,7 +531,7 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
-    dev = i2c_try_create_slave(TYPE_PCA9552, 0x60);
+    dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca0");
     i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
                           &error_fatal);
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index acf34a12d6..144786f17a 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -267,13 +267,13 @@ const VMStateDescription vmstate_i2c_slave = {
     }
 };
 
-DeviceState *i2c_try_create_slave(const char *name, uint8_t addr)
+I2CSlave *i2c_slave_new(const char *name, uint8_t addr)
 {
     DeviceState *dev;
 
     dev = qdev_new(name);
     qdev_prop_set_uint8(dev, "address", addr);
-    return dev;
+    return I2C_SLAVE(dev);
 }
 
 bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
@@ -283,12 +283,11 @@ bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
 
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
 {
-    DeviceState *dev;
+    I2CSlave *dev = i2c_slave_new(name, addr);
 
-    dev = i2c_try_create_slave(name, addr);
-    i2c_realize_and_unref(dev, bus, &error_fatal);
+    i2c_realize_and_unref(DEVICE(dev), bus, &error_fatal);
 
-    return dev;
+    return DEVICE(dev);
 }
 
 static void i2c_slave_class_init(ObjectClass *klass, void *data)
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index d6e3d85faf..18efc668f1 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -79,8 +79,8 @@ int i2c_send_recv(I2CBus *bus, uint8_t *data, bool send);
 int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
+I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
-DeviceState *i2c_try_create_slave(const char *name, uint8_t addr);
 bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16459.40501 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRk-0006nX-Vf; Fri, 30 Oct 2020 22:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16459.40501; Fri, 30 Oct 2020 22:00:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRk-0006nQ-Sk; Fri, 30 Oct 2020 22:00:32 +0000
Received: by outflank-mailman (input) for mailman id 16459;
 Fri, 30 Oct 2020 22:00:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcRk-0006nJ-Hq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b59d575f-6d0a-4616-b0fd-15cdc51754c7;
 Fri, 30 Oct 2020 22:00:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRj-0004Ij-CI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRj-00020M-BM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcRk-0006nJ-Hq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:32 +0000
X-Inumbo-ID: b59d575f-6d0a-4616-b0fd-15cdc51754c7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b59d575f-6d0a-4616-b0fd-15cdc51754c7;
	Fri, 30 Oct 2020 22:00:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zf1rbUgJGFWkPl37EgU/NVuB8cT8QGlRW0OqVleETaw=; b=gIH6m1JHelz46qTMyvEsFKmoRq
	d/Nhu1cl5VE68Sh2R8YKcf/EViu9/QNYXuWofRNdb65z/QzPmOZBHnL+ENuGejUyuQcjnSt6SUKBp
	u8ECDK50gpMBaftg9WtC+YJCulaM5CO2FPqOuLEvfLbJ42w3wLN0m+oCwVt9NLnTccoU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRj-0004Ij-CI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRj-00020M-BM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
Message-Id: <E1kYcRj-00020M-BM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:31 +0000

commit 2616f57231c8e065df77de894a8f018cd1842c95
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:52 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
    
    The other i2c functions are called i2c_slave_FOO(). Rename as
    i2c_slave_realize_and_unref() to be consistent.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-4-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      | 10 ++++++----
 hw/i2c/core.c        |  6 +++---
 include/hw/i2c/i2c.h |  2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 51687fd3b3..78432e267b 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -515,8 +515,9 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
     /* Bus 3: TODO dps310@76 */
     dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca1");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 3),
-                          &error_fatal);
+    i2c_slave_realize_and_unref(I2C_SLAVE(dev),
+                                aspeed_i2c_get_bus(&soc->i2c, 3),
+                                &error_fatal);
 
     i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
     i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
@@ -533,8 +534,9 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
                           eeprom_buf);
     dev = DEVICE(i2c_slave_new(TYPE_PCA9552, 0x60));
     qdev_prop_set_string(dev, "description", "pca0");
-    i2c_realize_and_unref(dev, aspeed_i2c_get_bus(&soc->i2c, 11),
-                          &error_fatal);
+    i2c_slave_realize_and_unref(I2C_SLAVE(dev),
+                                aspeed_i2c_get_bus(&soc->i2c, 11),
+                                &error_fatal);
     /* Bus 11: TODO ucd90160@64 */
 }
 
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 144786f17a..f81601a5b9 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -276,16 +276,16 @@ I2CSlave *i2c_slave_new(const char *name, uint8_t addr)
     return I2C_SLAVE(dev);
 }
 
-bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp)
+bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp)
 {
-    return qdev_realize_and_unref(dev, &bus->qbus, errp);
+    return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
 }
 
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
 {
     I2CSlave *dev = i2c_slave_new(name, addr);
 
-    i2c_realize_and_unref(DEVICE(dev), bus, &error_fatal);
+    i2c_slave_realize_and_unref(dev, bus, &error_fatal);
 
     return DEVICE(dev);
 }
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 18efc668f1..cb7211f027 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -81,7 +81,7 @@ uint8_t i2c_recv(I2CBus *bus);
 
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
-bool i2c_realize_and_unref(DeviceState *dev, I2CBus *bus, Error **errp);
+bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
 void lm832x_key_event(DeviceState *dev, int key, int state);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16460.40506 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRw-0006pb-1X; Fri, 30 Oct 2020 22:00:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16460.40506; Fri, 30 Oct 2020 22:00:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcRv-0006pT-UT; Fri, 30 Oct 2020 22:00:43 +0000
Received: by outflank-mailman (input) for mailman id 16460;
 Fri, 30 Oct 2020 22:00:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcRv-0006pM-AC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1d67444e-1b92-49fe-8228-061cb503f25c;
 Fri, 30 Oct 2020 22:00:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRt-0004JI-Hb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcRt-000216-Fu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcRv-0006pM-AC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:43 +0000
X-Inumbo-ID: 1d67444e-1b92-49fe-8228-061cb503f25c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1d67444e-1b92-49fe-8228-061cb503f25c;
	Fri, 30 Oct 2020 22:00:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=739WvW4p+2wbr4DQerm5K6qR2fcYLakiHLea7ZV367Q=; b=lKdnOQdilb2yskKSEafOhoqFTU
	unY8ylAFviHjRGIxJDl/C8+8yzW+fu/OJsLrA8Jb3LOwFVAg8nnH0P0IFZ/Mn/Uw2IeieRmOE//MP
	cWIkzjlm+O1aTeEKlQBo50rQM0OJoMfz4sW828vzw+b4NoYedgi3NIoQe1VHrkmZkBTY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRt-0004JI-Hb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcRt-000216-Fu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
Message-Id: <E1kYcRt-000216-Fu@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:41 +0000

commit 1373b15bb55e46b067f84f70c60d3d03af62fd62
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:53 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
    
    We use "create_simple" names for functions that allocate, initialize,
    configure and realize device objects: pci_create_simple(),
    isa_create_simple(), usb_create_simple(). For consistency, rename
    i2c_create_slave() as i2c_slave_create_simple(). Since we have
    to update all the callers, also let it return a I2CSlave object.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-5-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 hw/arm/aspeed.c      | 58 ++++++++++++++++++++++++++--------------------------
 hw/arm/musicpal.c    |  4 ++--
 hw/arm/nseries.c     |  8 ++++----
 hw/arm/pxa2xx.c      |  5 +++--
 hw/arm/realview.c    |  2 +-
 hw/arm/spitz.c       |  4 ++--
 hw/arm/stellaris.c   |  2 +-
 hw/arm/tosa.c        |  2 +-
 hw/arm/versatilepb.c |  2 +-
 hw/arm/vexpress.c    |  2 +-
 hw/arm/z2.c          |  4 ++--
 hw/display/sii9022.c |  2 +-
 hw/i2c/core.c        |  6 +++---
 hw/ppc/e500.c        |  2 +-
 hw/ppc/sam460ex.c    |  2 +-
 include/hw/i2c/i2c.h |  2 +-
 16 files changed, 54 insertions(+), 53 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 78432e267b..c4288b5fb1 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -385,14 +385,14 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The palmetto platform expects a ds3231 RTC but a ds1338 is
      * enough to provide basic RTC features. Alarms will be missing */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 0), "ds1338", 0x68);
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 0), 0x50,
                           eeprom_buf);
 
     /* add a TMP423 temperature sensor */
-    dev = i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2),
-                           "tmp423", 0x4c);
+    dev = DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2),
+                                         "tmp423", 0x4c));
     object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
     object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
@@ -408,12 +408,12 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
                           eeprom_buf);
 
     /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7),
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7),
                      TYPE_TMP105, 0x4d);
 
     /* The AST2500 EVB does not have an RTC. Let's pretend that one is
      * plugged on the I2C bus header */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void ast2600_evb_i2c_init(AspeedMachineState *bmc)
@@ -428,36 +428,36 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
 
     /* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 }
 
 static void swift_bmc_i2c_init(AspeedMachineState *bmc)
 {
     AspeedSoCState *soc = &bmc->soc;
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3), "pca9552", 0x60);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "tmp105", 0x48);
     /* The swift board expects a pca9551 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9552", 0x60);
 
     /* The swift board expects an Epson RX8900 RTC but a ds1338 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), "pca9552", 0x74);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 10), "tmp423", 0x4c);
     /* The swift board expects a pca9539 but a pca9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 10), "pca9552",
                      0x74);
 
     /* The swift board expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 12), "tmp105", 0x4a);
 }
 
 static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
@@ -465,8 +465,8 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     AspeedSoCState *soc = &bmc->soc;
 
     /* bus 2 : */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "tmp105", 0x49);
     /* bus 2 : pca9546 @ 0x73 */
 
     /* bus 3 : pca9548 @ 0x70 */
@@ -476,21 +476,21 @@ static void sonorapass_bmc_i2c_init(AspeedMachineState *bmc)
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 4), 0x54,
                           eeprom4_54);
     /* PCA9539 @ 0x76, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x76);
     /* PCA9539 @ 0x77, but PCA9552 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "pca9552", 0x77);
 
     /* bus 6 : */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x48);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 6), "tmp105", 0x49);
     /* bus 6 : pca9546 @ 0x73 */
 
     /* bus 8 : */
     uint8_t *eeprom8_56 = g_malloc0(8 * 1024);
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 8), 0x56,
                           eeprom8_56);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x60);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 8), "pca9552", 0x61);
     /* bus 8 : adc128d818 @ 0x1d */
     /* bus 8 : adc128d818 @ 0x1f */
 
@@ -519,16 +519,16 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
                                 aspeed_i2c_get_bus(&soc->i2c, 3),
                                 &error_fatal);
 
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 4), "tmp423", 0x4c);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 5), "tmp423", 0x4c);
 
     /* The Witherspoon expects a TMP275 but a TMP105 is compatible */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 9), TYPE_TMP105,
                      0x4a);
 
     /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is
      * good enough */
-    i2c_create_slave(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
+    i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 11), "ds1338", 0x32);
 
     smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 11), 0x51,
                           eeprom_buf);
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index ff9a7c8cc6..c3b9780f35 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -1584,7 +1584,7 @@ static void musicpal_init(MachineState *machine)
     DeviceState *i2c_dev;
     DeviceState *lcd_dev;
     DeviceState *key_dev;
-    DeviceState *wm8750_dev;
+    I2CSlave *wm8750_dev;
     SysBusDevice *s;
     I2CBus *i2c;
     int i;
@@ -1687,7 +1687,7 @@ static void musicpal_init(MachineState *machine)
         qdev_connect_gpio_out(key_dev, i, qdev_get_gpio_in(dev, i + 15));
     }
 
-    wm8750_dev = i2c_create_slave(i2c, TYPE_WM8750, MP_WM_ADDR);
+    wm8750_dev = i2c_slave_create_simple(i2c, TYPE_WM8750, MP_WM_ADDR);
     dev = qdev_new(TYPE_MV88W8618_AUDIO);
     s = SYS_BUS_DEVICE(dev);
     object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev),
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 428a2a2c5a..e48092ca04 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -215,7 +215,7 @@ static void n8x0_i2c_setup(struct n800_s *s)
     I2CBus *i2c = omap_i2c_bus(s->mpu->i2c[0]);
 
     /* Attach a menelaus PM chip */
-    dev = i2c_create_slave(i2c, "twl92230", N8X0_MENELAUS_ADDR);
+    dev = DEVICE(i2c_slave_create_simple(i2c, "twl92230", N8X0_MENELAUS_ADDR));
     qdev_connect_gpio_out(dev, 3,
                           qdev_get_gpio_in(s->mpu->ih[0],
                                            OMAP_INT_24XX_SYS_NIRQ));
@@ -224,7 +224,7 @@ static void n8x0_i2c_setup(struct n800_s *s)
     qemu_register_powerdown_notifier(&n8x0_system_powerdown_notifier);
 
     /* Attach a TMP105 PM chip (A0 wired to ground) */
-    dev = i2c_create_slave(i2c, TYPE_TMP105, N8X0_TMP105_ADDR);
+    dev = DEVICE(i2c_slave_create_simple(i2c, TYPE_TMP105, N8X0_TMP105_ADDR));
     qdev_connect_gpio_out(dev, 0, tmp_irq);
 }
 
@@ -416,8 +416,8 @@ static void n810_kbd_setup(struct n800_s *s)
 
     /* Attach the LM8322 keyboard to the I2C bus,
      * should happen in n8x0_i2c_setup and s->kbd be initialised here.  */
-    s->kbd = i2c_create_slave(omap_i2c_bus(s->mpu->i2c[0]),
-                           "lm8323", N810_LM8323_ADDR);
+    s->kbd = DEVICE(i2c_slave_create_simple(omap_i2c_bus(s->mpu->i2c[0]),
+                                            "lm8323", N810_LM8323_ADDR));
     qdev_connect_gpio_out(s->kbd, 0, kbd_irq);
 }
 
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index f104a33463..6203c4cfe0 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -1522,8 +1522,9 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base,
     s = PXA2XX_I2C(i2c_dev);
     /* FIXME: Should the slave device really be on a separate bus?  */
     i2cbus = i2c_init_bus(dev, "dummy");
-    dev = i2c_create_slave(i2cbus, TYPE_PXA2XX_I2C_SLAVE, 0);
-    s->slave = PXA2XX_I2C_SLAVE(dev);
+    s->slave = PXA2XX_I2C_SLAVE(i2c_slave_create_simple(i2cbus,
+                                                        TYPE_PXA2XX_I2C_SLAVE,
+                                                        0));
     s->slave->host = s;
 
     return s;
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 22e132058e..c1ff172b13 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -285,7 +285,7 @@ static void realview_init(MachineState *machine,
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", 0x68);
+    i2c_slave_create_simple(i2c, "ds1338", 0x68);
 
     /* Memory map for RealView Emulation Baseboard:  */
     /* 0x10000000 System registers.  */
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index f020aff974..7ac8254aa6 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -787,7 +787,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
     DeviceState *wm;
 
     /* Attach a WM8750 to the bus */
-    wm = i2c_create_slave(bus, TYPE_WM8750, 0);
+    wm = DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0));
 
     spitz_wm8750_addr(wm, 0, 0);
     qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM,
@@ -802,7 +802,7 @@ static void spitz_i2c_setup(PXA2xxState *cpu)
 static void spitz_akita_i2c_setup(PXA2xxState *cpu)
 {
     /* Attach a Max7310 to Akita I2C bus.  */
-    i2c_create_slave(pxa2xx_i2c_bus(cpu->i2c[0]), "max7310",
+    i2c_slave_create_simple(pxa2xx_i2c_bus(cpu->i2c[0]), "max7310",
                      AKITA_MAX_ADDR);
 }
 
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 7156fb3ece..28eb15c76c 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1380,7 +1380,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
                                    qdev_get_gpio_in(nvic, 8));
         i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
         if (board->peripherals & BP_OLED_I2C) {
-            i2c_create_slave(i2c, "ssd0303", 0x3d);
+            i2c_slave_create_simple(i2c, "ssd0303", 0x3d);
         }
     }
 
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index 5dee2d76c6..8c1ee0cdd1 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -206,7 +206,7 @@ static uint8_t tosa_dac_recv(I2CSlave *s)
 static void tosa_tg_init(PXA2xxState *cpu)
 {
     I2CBus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
-    i2c_create_slave(bus, TYPE_TOSA_DAC, DAC_BASE);
+    i2c_slave_create_simple(bus, TYPE_TOSA_DAC, DAC_BASE);
     ssi_create_slave(cpu->ssp[1], "tosa-ssp");
 }
 
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d09ea24ae2..9dc93182b6 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -317,7 +317,7 @@ static void versatile_init(MachineState *machine, int board_id)
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", 0x68);
+    i2c_slave_create_simple(i2c, "ds1338", 0x68);
 
     /* Add PL041 AACI Interface to the LM4549 codec */
     pl041 = qdev_new("pl041");
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 762b068e90..1dc971c34f 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -642,7 +642,7 @@ static void vexpress_common_init(MachineState *machine)
 
     dev = sysbus_create_simple(TYPE_VERSATILE_I2C, map[VE_SERIALDVI], NULL);
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "sii9022", 0x39);
+    i2c_slave_create_simple(i2c, "sii9022", 0x39);
 
     sysbus_create_simple("pl031", map[VE_RTC], pic[4]); /* RTC */
 
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index e1f22f5868..9a9bbc653b 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -330,8 +330,8 @@ static void z2_init(MachineState *machine)
     type_register_static(&aer915_info);
     z2_lcd = ssi_create_slave(mpu->ssp[1], TYPE_ZIPIT_LCD);
     bus = pxa2xx_i2c_bus(mpu->i2c[0]);
-    i2c_create_slave(bus, TYPE_AER915, 0x55);
-    wm = i2c_create_slave(bus, TYPE_WM8750, 0x1b);
+    i2c_slave_create_simple(bus, TYPE_AER915, 0x55);
+    wm = DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0x1b));
     mpu->i2s->opaque = wm;
     mpu->i2s->codec_out = wm8750_dac_dat;
     mpu->i2s->codec_in = wm8750_adc_dat;
diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c
index 0710ce9de5..3b82a8567f 100644
--- a/hw/display/sii9022.c
+++ b/hw/display/sii9022.c
@@ -161,7 +161,7 @@ static void sii9022_realize(DeviceState *dev, Error **errp)
     I2CBus *bus;
 
     bus = I2C_BUS(qdev_get_parent_bus(dev));
-    i2c_create_slave(bus, TYPE_I2CDDC, 0x50);
+    i2c_slave_create_simple(bus, TYPE_I2CDDC, 0x50);
 }
 
 static void sii9022_class_init(ObjectClass *klass, void *data)
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index f81601a5b9..21ec52ac5a 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -281,13 +281,13 @@ bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp)
     return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
 }
 
-DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr)
+I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr)
 {
     I2CSlave *dev = i2c_slave_new(name, addr);
 
-    i2c_slave_realize_and_unref(dev, bus, &error_fatal);
+    i2c_slave_realize_and_unref(dev, bus, &error_abort);
 
-    return DEVICE(dev);
+    return dev;
 }
 
 static void i2c_slave_class_init(ObjectClass *klass, void *data)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 5448d101d9..ab9884e315 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -941,7 +941,7 @@ void ppce500_init(MachineState *machine)
     memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET,
                                 sysbus_mmio_get_region(s, 0));
     i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
-    i2c_create_slave(i2c, "ds1338", RTC_REGS_OFFSET);
+    i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET);
 
 
     /* General Utility device */
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 1a106a68de..1702344c46 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -339,7 +339,7 @@ static void sam460ex_init(MachineState *machine)
     spd_data[20] = 4; /* SO-DIMM module */
     smbus_eeprom_init_one(i2c, 0x50, spd_data);
     /* RTC */
-    i2c_create_slave(i2c, "m41t80", 0x68);
+    i2c_slave_create_simple(i2c, "m41t80", 0x68);
 
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600800, uic[0][3]);
 
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index cb7211f027..c533058998 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -80,7 +80,7 @@ int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
-DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
+I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr);
 bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:00:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:00:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16461.40510 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcS6-0006qv-4b; Fri, 30 Oct 2020 22:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16461.40510; Fri, 30 Oct 2020 22:00:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcS6-0006qn-1a; Fri, 30 Oct 2020 22:00:54 +0000
Received: by outflank-mailman (input) for mailman id 16461;
 Fri, 30 Oct 2020 22:00:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcS5-0006qg-7O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4f68a84c-2318-4c1a-82d1-3d89b133f074;
 Fri, 30 Oct 2020 22:00:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcS3-0004JO-LI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcS3-00021e-KW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcS5-0006qg-7O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:53 +0000
X-Inumbo-ID: 4f68a84c-2318-4c1a-82d1-3d89b133f074
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4f68a84c-2318-4c1a-82d1-3d89b133f074;
	Fri, 30 Oct 2020 22:00:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ex3Q56CCgumY+doys6oF+3IDhztM1yPkddYkau/Wu3s=; b=TmQzu7aFrjd3Qz0cb0cNvVJnKx
	ZQ9NGfpcxErwiUcQ7tNlCSqQEjeCV9xgnAUn5XjVSE7p+OAj+mVv4d+z3o8muvTPDHZyReZHSZd0i
	y6zMonLDvTySmYE/v4grpVcl13dujVXtA3DoLWybAXiDFxK+VYtp4mup5iNTSUPQj3I0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcS3-0004JO-LI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcS3-00021e-KW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:00:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/i2c: Document the I2C qdev helpers
Message-Id: <E1kYcS3-00021e-KW@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:00:51 +0000

commit 73d5f22ecbb76dfc785876779d47787084ff0f42
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 6 00:41:54 2020 +0200
Commit:     Corey Minyard <cminyard@mvista.com>
CommitDate: Thu Jul 16 12:30:54 2020 -0500

    hw/i2c: Document the I2C qdev helpers
    
    In commit d88c42ff2c we added new prototype but neglected to
    add their documentation. Fix that.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Corey Minyard <cminyard@mvista.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200705224154.16917-6-f4bug@amsat.org>
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 include/hw/i2c/i2c.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index c533058998..a9c030a512 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -79,8 +79,56 @@ int i2c_send_recv(I2CBus *bus, uint8_t *data, bool send);
 int i2c_send(I2CBus *bus, uint8_t data);
 uint8_t i2c_recv(I2CBus *bus);
 
+/**
+ * Create an I2C slave device on the heap.
+ * @name: a device type name
+ * @addr: I2C address of the slave when put on a bus
+ *
+ * This only initializes the device state structure and allows
+ * properties to be set. Type @name must exist. The device still
+ * needs to be realized. See qdev-core.h.
+ */
 I2CSlave *i2c_slave_new(const char *name, uint8_t addr);
+
+/**
+ * Create and realize an I2C slave device on the heap.
+ * @bus: I2C bus to put it on
+ * @name: I2C slave device type name
+ * @addr: I2C address of the slave when put on a bus
+ *
+ * Create the device state structure, initialize it, put it on the
+ * specified @bus, and drop the reference to it (the device is realized).
+ */
 I2CSlave *i2c_slave_create_simple(I2CBus *bus, const char *name, uint8_t addr);
+
+/**
+ * Realize and and drop a reference an I2C slave device
+ * @dev: I2C slave device to realize
+ * @bus: I2C bus to put it on
+ * @addr: I2C address of the slave on the bus
+ * @errp: pointer to NULL initialized error object
+ *
+ * Returns: %true on success, %false on failure.
+ *
+ * Call 'realize' on @dev, put it on the specified @bus, and drop the
+ * reference to it.
+ *
+ * This function is useful if you have created @dev via qdev_new(),
+ * i2c_slave_new() or i2c_slave_try_new() (which take a reference to
+ * the device it returns to you), so that you can set properties on it
+ * before realizing it. If you don't need to set properties then
+ * i2c_slave_create_simple() is probably better (as it does the create,
+ * init and realize in one step).
+ *
+ * If you are embedding the I2C slave into another QOM device and
+ * initialized it via some variant on object_initialize_child() then
+ * do not use this function, because that family of functions arrange
+ * for the only reference to the child device to be held by the parent
+ * via the child<> property, and so the reference-count-drop done here
+ * would be incorrect.  (Instead you would want i2c_slave_realize(),
+ * which doesn't currently exist but would be trivial to create if we
+ * had any code that wanted it.)
+ */
 bool i2c_slave_realize_and_unref(I2CSlave *dev, I2CBus *bus, Error **errp);
 
 /* lm832x.c */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16462.40514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSG-0006sD-6H; Fri, 30 Oct 2020 22:01:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16462.40514; Fri, 30 Oct 2020 22:01:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSG-0006s5-31; Fri, 30 Oct 2020 22:01:04 +0000
Received: by outflank-mailman (input) for mailman id 16462;
 Fri, 30 Oct 2020 22:01:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcSE-0006rx-OK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 53a98a64-ee3f-4969-99f3-82eb579d1f1f;
 Fri, 30 Oct 2020 22:01:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSD-0004Jj-QK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSD-00022S-PI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcSE-0006rx-OK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:02 +0000
X-Inumbo-ID: 53a98a64-ee3f-4969-99f3-82eb579d1f1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 53a98a64-ee3f-4969-99f3-82eb579d1f1f;
	Fri, 30 Oct 2020 22:01:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VZhU4/crdDSfnqtmoX4vjEtouldaCeecIEKXyM8x4aY=; b=NB/NNvUUb0WIH5hOPIUIr5Cume
	hYIoH+t0s+x7T6rx3Fqhc+ENe6gDyVPI4ud2LSIvkEq26kATyfaMuDcYSZZyuFwbHnc8LJBUL5vT6
	qPMnCMVaTuAz0ssTiUQ0RzDH7WfkZyXvHONycqiyY0uu40hlNk8q2V48Zk9jpQw077dU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSD-0004Jj-QK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSD-00022S-PI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-i2c-5' into staging
Message-Id: <E1kYcSD-00022S-PI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:01 +0000

commit 873ec69aeb12e24eec7fb317fd0cd8494e8489dd
Merge: d69cda7ed722e445d03e1ace6563bab3a76e023e 73d5f22ecbb76dfc785876779d47787084ff0f42
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 11:03:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:03:09 2020 +0100

    Merge remote-tracking branch 'remotes/cminyard/tags/for-qemu-i2c-5' into staging
    
    Minor changes to:
    
    Add an SMBus config entry
    
    Cleanup/simplify/document some I2C interfaces
    
    # gpg: Signature made Thu 16 Jul 2020 18:46:55 BST
    # gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
    # gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
    # gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
    # gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81
    
    * remotes/cminyard/tags/for-qemu-i2c-5:
      hw/i2c: Document the I2C qdev helpers
      hw/i2c: Rename i2c_create_slave() as i2c_slave_create_simple()
      hw/i2c: Rename i2c_realize_and_unref() as i2c_slave_realize_and_unref()
      hw/i2c: Rename i2c_try_create_slave() as i2c_slave_new()
      hw/i2c/aspeed_i2c: Simplify aspeed_i2c_get_bus()
      hw/i2c/Kconfig: Add an entry for the SMBus
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/arm/aspeed.c             | 82 +++++++++++++++++++++++----------------------
 hw/arm/musicpal.c           |  4 +--
 hw/arm/nseries.c            |  8 ++---
 hw/arm/pxa2xx.c             |  5 +--
 hw/arm/realview.c           |  2 +-
 hw/arm/spitz.c              |  4 +--
 hw/arm/stellaris.c          |  2 +-
 hw/arm/tosa.c               |  2 +-
 hw/arm/versatilepb.c        |  2 +-
 hw/arm/vexpress.c           |  2 +-
 hw/arm/z2.c                 |  4 +--
 hw/display/sii9022.c        |  2 +-
 hw/i2c/Kconfig              |  8 +++--
 hw/i2c/Makefile.objs        |  3 +-
 hw/i2c/aspeed_i2c.c         |  3 +-
 hw/i2c/core.c               | 15 ++++-----
 hw/ppc/e500.c               |  2 +-
 hw/ppc/sam460ex.c           |  2 +-
 include/hw/i2c/aspeed_i2c.h |  2 +-
 include/hw/i2c/i2c.h        | 54 +++++++++++++++++++++++++++--
 20 files changed, 131 insertions(+), 77 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16463.40518 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSS-0006tW-7b; Fri, 30 Oct 2020 22:01:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16463.40518; Fri, 30 Oct 2020 22:01:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSS-0006tO-4b; Fri, 30 Oct 2020 22:01:16 +0000
Received: by outflank-mailman (input) for mailman id 16463;
 Fri, 30 Oct 2020 22:01:15 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcSR-0006tI-JI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ba541592-2714-440f-b2e2-e4b709593de0;
 Fri, 30 Oct 2020 22:01:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSO-0004Jt-6A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSO-00023f-5L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcSR-0006tI-JI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:15 +0000
X-Inumbo-ID: ba541592-2714-440f-b2e2-e4b709593de0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ba541592-2714-440f-b2e2-e4b709593de0;
	Fri, 30 Oct 2020 22:01:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qloOa3A8d8YF0YBCYEXHQSHLUFhspAZkpLI0LywCV0U=; b=rsfwkbYB/4C4sO4Q1maF1GOiHG
	DZaeoDxWmVL5RSF8pLQ4bP3SNXRAtDeiCV3cWEZ1z4ZeZzv2OgGf8DtCvI94Ht8yaRaNzHsFVmIyM
	JVjrkC69IJBxc1ot5bHK/m6m4PirBrPlRToBsk6ZYFUrZDIRkDaz6ccZ6To0m3KUjf3A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSO-0004Jt-6A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSO-00023f-5L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ppc/pnv: Make PSI device types not user creatable
Message-Id: <E1kYcSO-00023f-5L@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:12 +0000

commit 14de3d4ac58c0f63e9f5560c7e01e62e39467edd
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Tue Jul 7 18:35:57 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    ppc/pnv: Make PSI device types not user creatable
    
    QEMU aborts with -device pnv-psi-POWER8:
    
    $ qemu-system-ppc64 -device pnv-psi-POWER8
    qemu-system-ppc64: hw/intc/xics.c:605: ics_realize: Assertion
    `ics->xics' failed.
    Aborted (core dumped)
    
    The Processor Service Interface Controller is an internal device.
    It should only be instantiated by the chip, which takes care of
    configuring the link required by the ICS object in the case of
    POWER8. It doesn't make sense for a user to specify it on the
    command line.
    
    Note that the PSI model for POWER8 was added 3 yrs ago but the
    devices weren't available on the command line because of a bug
    that was fixed by recent commit 2f35254aa0 ("pnv/psi: Correct
    the pnv-psi* devices not to be sysbus devices").
    
    Fixes: 54f59d786c ("ppc/pnv: Add cut down PSI bridge model and hookup external interrupt")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159413975752.169116.5808968580649255382.stgit@bahia.lan>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/pnv_psi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 5bdeec700e..6a479cac53 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -929,6 +929,7 @@ static void pnv_psi_class_init(ObjectClass *klass, void *data)
     dc->desc = "PowerNV PSI Controller";
     device_class_set_props(dc, pnv_psi_properties);
     dc->reset = pnv_psi_reset;
+    dc->user_creatable = false;
 }
 
 static const TypeInfo pnv_psi_info = {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16464.40522 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSa-0006ua-9A; Fri, 30 Oct 2020 22:01:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16464.40522; Fri, 30 Oct 2020 22:01:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSa-0006uR-63; Fri, 30 Oct 2020 22:01:24 +0000
Received: by outflank-mailman (input) for mailman id 16464;
 Fri, 30 Oct 2020 22:01:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcSZ-0006uL-Af
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 164b6835-4157-451a-80cc-9da3e178c073;
 Fri, 30 Oct 2020 22:01:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSY-0004K9-Ab
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSY-00024K-8x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcSZ-0006uL-Af
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:23 +0000
X-Inumbo-ID: 164b6835-4157-451a-80cc-9da3e178c073
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 164b6835-4157-451a-80cc-9da3e178c073;
	Fri, 30 Oct 2020 22:01:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hpRajNG5GElpzqrdQKUTwTWW2TtsjGo+x1TaxnSyxng=; b=dTRZyQ7habydouafO4/HMUlKWi
	DwX/5gYshcxd2OvQwRDVGfbOXfOh27yUkbr+c9lnhYtQL9V1jERRxJVji26QQh/gvWIGFE/N3laAo
	aQp0INs8xUtF0IO95VWE0t5Wz0X2F/ahgu768m/58IzTiifNjAxCH0sTPLsBVxJpCBk4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSY-0004K9-Ab
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSY-00024K-8x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] spapr_pci: Robustify support of PCI bridges
Message-Id: <E1kYcSY-00024K-8x@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:22 +0000

commit a4beb5f5d4672400a76cc0551c4f0878e42d921c
Author:     Greg Kurz <groug@kaod.org>
AuthorDate: Thu Jul 9 19:12:47 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    spapr_pci: Robustify support of PCI bridges
    
    Some recent error handling cleanups unveiled issues with our support of
    PCI bridges:
    
    1) QEMU aborts when using non-standard PCI bridge types,
       unveiled by commit 7ef1553dac "spapr_pci: Drop some dead error handling"
    
    $ qemu-system-ppc64 -M pseries -device pcie-pci-bridge
    Unexpected error in object_property_find() at qom/object.c:1240:
    qemu-system-ppc64: -device pcie-pci-bridge: Property '.chassis_nr' not found
    Aborted (core dumped)
    
    This happens because we assume all PCI bridge types to have a "chassis_nr"
    property. This property only exists with the standard PCI bridge type
    "pci-bridge" actually. We could possibly revert 7ef1553dac but it seems
    much simpler to check the presence of "chassis_nr" earlier.
    
    2) QEMU abort if same "chassis_nr" value is used several times,
       unveiled by commit d2623129a7de "qom: Drop parameter @errp of
       object_property_add() & friends"
    
    $ qemu-system-ppc64 -M pseries -device pci-bridge,chassis_nr=1 \
                            -device pci-bridge,chassis_nr=1
    Unexpected error in object_property_try_add() at qom/object.c:1167:
    qemu-system-ppc64: -device pci-bridge,chassis_nr=1: attempt to add duplicate property '40000100' to object (type 'container')
    Aborted (core dumped)
    
    This happens because we assume that "chassis_nr" values are unique, but
    nobody enforces that and we end up generating duplicate DRC ids. The PCI
    code doesn't really care for duplicate "chassis_nr" properties since it
    is only used to initialize the "Chassis Number Register" of the bridge,
    with no functional impact on QEMU. So, even if passing the same value
    several times might look weird, it never broke anything before, so
    I guess we don't necessarily want to enforce strict checking in the PCI
    code now.
    
    Workaround both issues in the PAPR code: check that the bridge has a
    unique and non null "chassis_nr" when plugging it into its parent bus.
    
    Fixes: 05929a6c5dfe ("spapr: Don't use bus number for building DRC ids")
    Fixes: 7ef1553dac ("spapr_pci: Drop some dead error handling")
    Fixes: d2623129a7de ("qom: Drop parameter @errp of object_property_add() & friends")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <159431476748.407044.16711294833569014964.stgit@bahia.lan>
    [dwg: Move check slightly to a better place]
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_pci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 2a6a48744a..21681215d4 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1480,6 +1480,57 @@ static void spapr_pci_bridge_plug(SpaprPhbState *phb,
     add_drcs(phb, bus);
 }
 
+/* Returns non-zero if the value of "chassis_nr" is already in use */
+static int check_chassis_nr(Object *obj, void *opaque)
+{
+    int new_chassis_nr =
+        object_property_get_uint(opaque, "chassis_nr", &error_abort);
+    int chassis_nr =
+        object_property_get_uint(obj, "chassis_nr", NULL);
+
+    if (!object_dynamic_cast(obj, TYPE_PCI_BRIDGE)) {
+        return 0;
+    }
+
+    /* Skip unsupported bridge types */
+    if (!chassis_nr) {
+        return 0;
+    }
+
+    /* Skip self */
+    if (obj == opaque) {
+        return 0;
+    }
+
+    return chassis_nr == new_chassis_nr;
+}
+
+static bool bridge_has_valid_chassis_nr(Object *bridge, Error **errp)
+{
+    int chassis_nr =
+        object_property_get_uint(bridge, "chassis_nr", NULL);
+
+    /*
+     * slotid_cap_init() already ensures that "chassis_nr" isn't null for
+     * standard PCI bridges, so this really tells if "chassis_nr" is present
+     * or not.
+     */
+    if (!chassis_nr) {
+        error_setg(errp, "PCI Bridge lacks a \"chassis_nr\" property");
+        error_append_hint(errp, "Try -device pci-bridge instead.\n");
+        return false;
+    }
+
+    /* We want unique values for "chassis_nr" */
+    if (object_child_foreach_recursive(object_get_root(), check_chassis_nr,
+                                       bridge)) {
+        error_setg(errp, "Bridge chassis %d already in use", chassis_nr);
+        return false;
+    }
+
+    return true;
+}
+
 static void spapr_pci_plug(HotplugHandler *plug_handler,
                            DeviceState *plugged_dev, Error **errp)
 {
@@ -1508,6 +1559,9 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,
     g_assert(drc);
 
     if (pc->is_bridge) {
+        if (!bridge_has_valid_chassis_nr(OBJECT(plugged_dev), errp)) {
+            return;
+        }
         spapr_pci_bridge_plug(phb, PCI_BRIDGE(plugged_dev));
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16465.40526 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSk-0006wB-B6; Fri, 30 Oct 2020 22:01:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16465.40526; Fri, 30 Oct 2020 22:01:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSk-0006w4-7h; Fri, 30 Oct 2020 22:01:34 +0000
Received: by outflank-mailman (input) for mailman id 16465;
 Fri, 30 Oct 2020 22:01:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcSj-0006vv-HO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 96ef6ac7-a329-4e8c-93e7-596f5307ef24;
 Fri, 30 Oct 2020 22:01:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSi-0004KK-ES
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSi-00024s-De
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcSj-0006vv-HO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:33 +0000
X-Inumbo-ID: 96ef6ac7-a329-4e8c-93e7-596f5307ef24
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 96ef6ac7-a329-4e8c-93e7-596f5307ef24;
	Fri, 30 Oct 2020 22:01:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=brrxn83H9C4/8hoMLgrcWGoFnPbSMwvv2+ZYu6ZJE4I=; b=BDLBt//xJVvZ0P0B2rZEmyYVu/
	dtI5x6Q+/sPhcm+E9j6iWnzzRYucdNVvPyO9mCnhSugq4TMAn1Gy/XcxVM8u4g51kNKB6Pi1SzYPq
	Eo8qeNApE7/ewQXAksg0qSq+DY/hUfOm+QH0+RvXIr9hx59AO3mKaHfYYEMVZ3oOYpYk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSi-0004KK-ES
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSi-00024s-De
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] spapr: Add a new level of NUMA for GPUs
Message-Id: <E1kYcSi-00024s-De@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:32 +0000

commit a6030d7e0b35a23c82e4a765b53dc3847bcdb4d1
Author:     Reza Arbab <arbab@linux.ibm.com>
AuthorDate: Thu Jul 16 17:56:55 2020 -0500
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    spapr: Add a new level of NUMA for GPUs
    
    NUMA nodes corresponding to GPU memory currently have the same
    affinity/distance as normal memory nodes. Add a third NUMA associativity
    reference point enabling us to give GPU nodes more distance.
    
    This is guest visible information, which shouldn't change under a
    running guest across migration between different qemu versions, so make
    the change effective only in new (pseries > 5.0) machine types.
    
    Before, `numactl -H` output in a guest with 4 GPUs (nodes 2-5):
    
    node distances:
    node   0   1   2   3   4   5
      0:  10  40  40  40  40  40
      1:  40  10  40  40  40  40
      2:  40  40  10  40  40  40
      3:  40  40  40  10  40  40
      4:  40  40  40  40  10  40
      5:  40  40  40  40  40  10
    
    After:
    
    node distances:
    node   0   1   2   3   4   5
      0:  10  40  80  80  80  80
      1:  40  10  80  80  80  80
      2:  80  80  10  80  80  80
      3:  80  80  80  10  80  80
      4:  80  80  80  80  10  80
      5:  80  80  80  80  80  10
    
    These are the same distances as on the host, mirroring the change made
    to host firmware in skiboot commit f845a648b8cb ("numa/associativity:
    Add a new level of NUMA for GPU's").
    
    Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
    Message-Id: <20200716225655.24289-1-arbab@linux.ibm.com>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c              | 21 +++++++++++++++++++--
 hw/ppc/spapr_pci.c          |  2 ++
 hw/ppc/spapr_pci_nvlink2.c  | 13 ++++++++++---
 include/hw/pci-host/spapr.h |  1 +
 include/hw/ppc/spapr.h      |  1 +
 5 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 299908cc73..0ae293ec94 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -890,10 +890,16 @@ static int spapr_dt_rng(void *fdt)
 static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
 {
     MachineState *ms = MACHINE(spapr);
+    SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(ms);
     int rtas;
     GString *hypertas = g_string_sized_new(256);
     GString *qemu_hypertas = g_string_sized_new(256);
-    uint32_t refpoints[] = { cpu_to_be32(0x4), cpu_to_be32(0x4) };
+    uint32_t refpoints[] = {
+        cpu_to_be32(0x4),
+        cpu_to_be32(0x4),
+        cpu_to_be32(0x2),
+    };
+    uint32_t nr_refpoints = ARRAY_SIZE(refpoints);
     uint64_t max_device_addr = MACHINE(spapr)->device_memory->base +
         memory_region_size(&MACHINE(spapr)->device_memory->mr);
     uint32_t lrdr_capacity[] = {
@@ -945,8 +951,12 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt)
                      qemu_hypertas->str, qemu_hypertas->len));
     g_string_free(qemu_hypertas, TRUE);
 
+    if (smc->pre_5_1_assoc_refpoints) {
+        nr_refpoints = 2;
+    }
+
     _FDT(fdt_setprop(fdt, rtas, "ibm,associativity-reference-points",
-                     refpoints, sizeof(refpoints)));
+                     refpoints, nr_refpoints * sizeof(refpoints[0])));
 
     _FDT(fdt_setprop(fdt, rtas, "ibm,max-associativity-domains",
                      maxdomains, sizeof(maxdomains)));
@@ -4584,9 +4594,16 @@ DEFINE_SPAPR_MACHINE(5_1, "5.1", true);
  */
 static void spapr_machine_5_0_class_options(MachineClass *mc)
 {
+    SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
+    static GlobalProperty compat[] = {
+        { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-5.1-associativity", "on" },
+    };
+
     spapr_machine_5_1_class_options(mc);
     compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len);
+    compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
     mc->numa_mem_supported = true;
+    smc->pre_5_1_assoc_refpoints = true;
 }
 
 DEFINE_SPAPR_MACHINE(5_0, "5.0", false);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 21681215d4..363cdb3f7b 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2089,6 +2089,8 @@ static Property spapr_phb_properties[] = {
                      pcie_ecs, true),
     DEFINE_PROP_UINT64("gpa", SpaprPhbState, nv2_gpa_win_addr, 0),
     DEFINE_PROP_UINT64("atsd", SpaprPhbState, nv2_atsd_win_addr, 0),
+    DEFINE_PROP_BOOL("pre-5.1-associativity", SpaprPhbState,
+                     pre_5_1_assoc, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/ppc/spapr_pci_nvlink2.c b/hw/ppc/spapr_pci_nvlink2.c
index dd8cd6db96..76ae77ebc8 100644
--- a/hw/ppc/spapr_pci_nvlink2.c
+++ b/hw/ppc/spapr_pci_nvlink2.c
@@ -362,9 +362,9 @@ void spapr_phb_nvgpu_ram_populate_dt(SpaprPhbState *sphb, void *fdt)
                                                     &error_abort);
         uint32_t associativity[] = {
             cpu_to_be32(0x4),
-            SPAPR_GPU_NUMA_ID,
-            SPAPR_GPU_NUMA_ID,
-            SPAPR_GPU_NUMA_ID,
+            cpu_to_be32(nvslot->numa_id),
+            cpu_to_be32(nvslot->numa_id),
+            cpu_to_be32(nvslot->numa_id),
             cpu_to_be32(nvslot->numa_id)
         };
         uint64_t size = object_property_get_uint(nv_mrobj, "size", NULL);
@@ -375,6 +375,13 @@ void spapr_phb_nvgpu_ram_populate_dt(SpaprPhbState *sphb, void *fdt)
         _FDT(off);
         _FDT((fdt_setprop_string(fdt, off, "device_type", "memory")));
         _FDT((fdt_setprop(fdt, off, "reg", mem_reg, sizeof(mem_reg))));
+
+        if (sphb->pre_5_1_assoc) {
+            associativity[1] = SPAPR_GPU_NUMA_ID;
+            associativity[2] = SPAPR_GPU_NUMA_ID;
+            associativity[3] = SPAPR_GPU_NUMA_ID;
+        }
+
         _FDT((fdt_setprop(fdt, off, "ibm,associativity", associativity,
                           sizeof(associativity))));
 
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 8877ff51fb..600eb55c34 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -94,6 +94,7 @@ struct SpaprPhbState {
     hwaddr nv2_gpa_win_addr;
     hwaddr nv2_atsd_win_addr;
     SpaprPhbPciNvGpuConfig *nvgpus;
+    bool pre_5_1_assoc;
 };
 
 #define SPAPR_PCI_MEM_WIN_BUS_OFFSET 0x80000000ULL
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index c421410e3f..3134d339e8 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -129,6 +129,7 @@ struct SpaprMachineClass {
     bool linux_pci_probe;
     bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
     hwaddr rma_limit;          /* clamp the RMA to this size */
+    bool pre_5_1_assoc_refpoints;
 
     void (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
                           uint64_t *buid, hwaddr *pio, 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16466.40530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSu-0006y3-DR; Fri, 30 Oct 2020 22:01:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16466.40530; Fri, 30 Oct 2020 22:01:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcSu-0006xv-AZ; Fri, 30 Oct 2020 22:01:44 +0000
Received: by outflank-mailman (input) for mailman id 16466;
 Fri, 30 Oct 2020 22:01:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcSt-0006xp-C9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7c486370-fcf1-4941-ada8-205ae1544a2c;
 Fri, 30 Oct 2020 22:01:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSs-0004L9-IT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcSs-00025P-HX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcSt-0006xp-C9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:43 +0000
X-Inumbo-ID: 7c486370-fcf1-4941-ada8-205ae1544a2c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7c486370-fcf1-4941-ada8-205ae1544a2c;
	Fri, 30 Oct 2020 22:01:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3ve5dB52VjmvvQuseAsifbGNd6HPiK8KuJcz6eDwi1w=; b=TzHwP/TEND8mbRC/eR3QfMT7Hs
	3a6gHx5pR3Hkh6AYLBBXXE9p9yHz8Y1XJO9piu3yNx8iq0Uxr7PfFcA4j7l/HftQNx77M1IH5R+1n
	1T+FcWa1zwRjvmabLKugC1E0107XDnZDcgcOqZmkah0TIGVfexZQ71xPN8nnysiorUi0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSs-0004L9-IT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcSs-00025P-HX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] pseries: Update SLOF firmware image
Message-Id: <E1kYcSs-00025P-HX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:42 +0000

commit b25fbd6a1302c0eac5b326be3e1f828e905c0c9a
Author:     Alexey Kardashevskiy <aik@ozlabs.ru>
AuthorDate: Fri Jul 17 11:15:31 2020 +1000
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 20 09:21:39 2020 +1000

    pseries: Update SLOF firmware image
    
    This adds tcgbios (this was posted earlier [1] but got lost)
    and fixes FDT update at ibm,client-architecture-support
    for huge guests.
    
    The full list of changes:
    
    Alexey Kardashevskiy (4):
          make: Define default rule for .c when V=1 or V=2
          version: update to 20200513
          fdt: Avoid recursion when traversing tree
          version: update to 20200717
    
    Gustavo Romero (1):
          board-qemu: Fix comment about SLOF start address
    
    Stefan Berger (6):
          tcgbios: Only write logs for PCRs that are allocated
          tcgbios: Fix the vendorInfoSize to be of type uint8_t
          tcgbios: Add support for SHA3 type of algorithms
          elf: Implement elf_get_file_size to determine size of an ELF image
          tcgbios: Implement tpm_hash_log_extend_event_buffer
          tcgbios: Measure the bootloader file read from disk
    
    [1] https://patchwork.ozlabs.org/project/qemu-devel/patch/20200513024355.121476-1-aik@ozlabs.ru/
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 pc-bios/README   |   2 +-
 pc-bios/slof.bin | Bin 965112 -> 968368 bytes
 roms/SLOF        |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pc-bios/README b/pc-bios/README
index a5a770f066..fa8b58b797 100644
--- a/pc-bios/README
+++ b/pc-bios/README
@@ -14,7 +14,7 @@
 - SLOF (Slimline Open Firmware) is a free IEEE 1275 Open Firmware
   implementation for certain IBM POWER hardware.  The sources are at
   https://github.com/aik/SLOF, and the image currently in qemu is
-  built from git tag qemu-slof-20200327.
+  built from git tag qemu-slof-20200717.
 
 - sgabios (the Serial Graphics Adapter option ROM) provides a means for
   legacy x86 software to communicate with an attached serial console as
diff --git a/pc-bios/slof.bin b/pc-bios/slof.bin
index 80bbf91a18..448dcada36 100644
Binary files a/pc-bios/slof.bin and b/pc-bios/slof.bin differ
diff --git a/roms/SLOF b/roms/SLOF
index 8e012d6fdd..e18ddad851 160000
--- a/roms/SLOF
+++ b/roms/SLOF
@@ -1 +1 @@
-Subproject commit 8e012d6fddb62be833d746cef3f03e6c8beecde0
+Subproject commit e18ddad8516ff2cfe36ec130200318f7251aa78c
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:01:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16467.40535 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcT4-0006zM-FT; Fri, 30 Oct 2020 22:01:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16467.40535; Fri, 30 Oct 2020 22:01:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcT4-0006zC-C2; Fri, 30 Oct 2020 22:01:54 +0000
Received: by outflank-mailman (input) for mailman id 16467;
 Fri, 30 Oct 2020 22:01:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcT3-0006z4-JD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5722f2de-a1e1-4cc1-a1d3-7150b084e857;
 Fri, 30 Oct 2020 22:01:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcT2-0004LH-NC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcT2-000262-Ld
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcT3-0006z4-JD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:53 +0000
X-Inumbo-ID: 5722f2de-a1e1-4cc1-a1d3-7150b084e857
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5722f2de-a1e1-4cc1-a1d3-7150b084e857;
	Fri, 30 Oct 2020 22:01:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6C5STnIz7Q0Hvw1AJ/JZTtSNTJH7ijt5hnvOGMGpQDY=; b=5ulZTzSZGuNMJ9tVwuC5lDx52y
	bwdCy/V71FffisSRsFJWZdqdJHNK8ogcxAeUyNY3OYLneJyCr2sjF/TcJDhndJ5J2fRwqixnTv2ah
	w8Ti5UdW7Xg88JByhrkfFqWGiPKwpOlFFoXn2lbBQ1ve7vcSS6nLvqFMJ2xUbz9ggUXw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcT2-0004LH-NC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcT2-000262-Ld
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:01:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200720' into staging
Message-Id: <E1kYcT2-000262-Ld@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:01:52 +0000

commit 1e6c50ad8559c18b21041ef69d8fff781a8db0bb
Merge: 873ec69aeb12e24eec7fb317fd0cd8494e8489dd b25fbd6a1302c0eac5b326be3e1f828e905c0c9a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 11:34:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:34:10 2020 +0100

    Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200720' into staging
    
    ppc patch queue 20200720
    
    Here are some assorted fixes for qemu-5.1:
     * SLOF update with improved TPM handling, and fix for possible stack
       overflows on many-vcpu machines
     * Fix for NUMA distances on NVLink2 attached GPU memory nodes
     * Fixes to fail more gracefully on attempting to plug unsupported PCI bridge types
     * Don't allow pnv-psi device to be user created
    
    # gpg: Signature made Mon 20 Jul 2020 06:29:21 BST
    # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
    # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
    # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
    # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
    # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
    # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
    
    * remotes/dgibson/tags/ppc-for-5.1-20200720:
      pseries: Update SLOF firmware image
      spapr: Add a new level of NUMA for GPUs
      spapr_pci: Robustify support of PCI bridges
      ppc/pnv: Make PSI device types not user creatable
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ppc/pnv_psi.c            |   1 +
 hw/ppc/spapr.c              |  21 +++++++++++++++--
 hw/ppc/spapr_pci.c          |  56 ++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/spapr_pci_nvlink2.c  |  13 +++++++---
 include/hw/pci-host/spapr.h |   1 +
 include/hw/ppc/spapr.h      |   1 +
 pc-bios/README              |   2 +-
 pc-bios/slof.bin            | Bin 965112 -> 968368 bytes
 roms/SLOF                   |   2 +-
 9 files changed, 90 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16468.40538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTF-00070j-GS; Fri, 30 Oct 2020 22:02:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16468.40538; Fri, 30 Oct 2020 22:02:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTF-00070b-DY; Fri, 30 Oct 2020 22:02:05 +0000
Received: by outflank-mailman (input) for mailman id 16468;
 Fri, 30 Oct 2020 22:02:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcTE-00070V-Kq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3674292f-3643-45d6-961f-88890bcb0f7a;
 Fri, 30 Oct 2020 22:02:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTD-0004Ld-9p
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTD-00028K-8Z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcTE-00070V-Kq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:04 +0000
X-Inumbo-ID: 3674292f-3643-45d6-961f-88890bcb0f7a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3674292f-3643-45d6-961f-88890bcb0f7a;
	Fri, 30 Oct 2020 22:02:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jw7Yys0xDX07/47TWCJz3wBoNTV0KcZ89NzpaeMBFv0=; b=fJQpLycWgHudj7+ejvfd4eJBZT
	oKK8xK2vRZL5xB0tKL4XWnJFnumjPqlMgL561RyfLm4NZknZuxCDylD5HX55dlzpJ6l0jh3X3tK4S
	I+ZyR0brCRE6EPn7rtF9lfOqnSohm+5PHfAXy0UPkz82Uy+cKVunBNAngLcxx0hbchaw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTD-0004Ld-9p
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTD-00028K-8Z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/virt: Enable MTE via a machine property
Message-Id: <E1kYcTD-00028K-8Z@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:03 +0000

commit 6f4e1405b91da0d0a1084ae3aff2bd308432778f
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:15 2020 +0100

    hw/arm/virt: Enable MTE via a machine property
    
    Control this cpu feature via a machine property, much as we do
    with secure=on, since both require specialized support in the
    machine setup to be functional.
    
    Default MTE to off, since this feature implies extra overhead.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-2-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c         | 39 ++++++++++++++++++++++++++++++++++-----
 include/hw/arm/virt.h |  1 +
 target/arm/cpu.c      | 19 +++++++++++--------
 target/arm/cpu64.c    |  5 +++--
 4 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9005dae356..5866c4ce20 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1837,12 +1837,19 @@ static void machvirt_init(MachineState *machine)
                                      OBJECT(secure_sysmem), &error_abort);
         }
 
-        /*
-         * The cpu adds the property if and only if MemTag is supported.
-         * If it is, we must allocate the ram to back that up.
-         */
-        if (object_property_find(cpuobj, "tag-memory", NULL)) {
+        if (vms->mte) {
+            /* Create the memory region only once, but link to all cpus. */
             if (!tag_sysmem) {
+                /*
+                 * The property exists only if MemTag is supported.
+                 * If it is, we must allocate the ram to back that up.
+                 */
+                if (!object_property_find(cpuobj, "tag-memory", NULL)) {
+                    error_report("MTE requested, but not supported "
+                                 "by the guest CPU");
+                    exit(1);
+                }
+
                 tag_sysmem = g_new(MemoryRegion, 1);
                 memory_region_init(tag_sysmem, OBJECT(machine),
                                    "tag-memory", UINT64_MAX / 32);
@@ -2061,6 +2068,20 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
     vms->ras = value;
 }
 
+static bool virt_get_mte(Object *obj, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    return vms->mte;
+}
+
+static void virt_set_mte(Object *obj, bool value, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    vms->mte = value;
+}
+
 static char *virt_get_gic_version(Object *obj, Error **errp)
 {
     VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2481,6 +2502,14 @@ static void virt_instance_init(Object *obj)
                                     "Set on/off to enable/disable reporting host memory errors "
                                     "to a KVM guest using ACPI and guest external abort exceptions");
 
+    /* MTE is disabled by default.  */
+    vms->mte = false;
+    object_property_add_bool(obj, "mte", virt_get_mte, virt_set_mte);
+    object_property_set_description(obj, "mte",
+                                    "Set on/off to enable/disable emulating a "
+                                    "guest CPU which implements the ARM "
+                                    "Memory Tagging Extension");
+
     vms->irqmap = a15irqmap;
 
     virt_flash_create(vms);
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 54bcf17afd..dff67e1bef 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -140,6 +140,7 @@ typedef struct {
     bool its;
     bool virt;
     bool ras;
+    bool mte;
     OnOffAuto acpi;
     VirtGICType gic_version;
     VirtIOMMUType iommu;
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 5050e1843a..111579554f 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1698,6 +1698,17 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
         cpu->id_pfr1 &= ~0xf000;
     }
 
+#ifndef CONFIG_USER_ONLY
+    if (cpu->tag_memory == NULL && cpu_isar_feature(aa64_mte, cpu)) {
+        /*
+         * Disable the MTE feature bits if we do not have tag-memory
+         * provided by the machine.
+         */
+        cpu->isar.id_aa64pfr1 =
+            FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
+    }
+#endif
+
     /* MPU can be configured out of a PMSA CPU either by setting has-mpu
      * to false or by setting pmsav7-dregion to 0.
      */
@@ -1787,14 +1798,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
             cpu_address_space_init(cs, ARMASIdx_TagS, "cpu-tag-memory",
                                    cpu->secure_tag_memory);
         }
-    } else if (cpu_isar_feature(aa64_mte, cpu)) {
-        /*
-         * Since there is no tag memory, we can't meaningfully support MTE
-         * to its fullest.  To avoid problems later, when we would come to
-         * use the tag memory, downgrade support to insns only.
-         */
-        cpu->isar.id_aa64pfr1 =
-            FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1);
     }
 
     cpu_address_space_init(cs, ARMASIdx_NS, "cpu-memory", cs->memory);
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 15494002d2..dd696183df 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -646,8 +646,9 @@ static void aarch64_max_initfn(Object *obj)
         t = cpu->isar.id_aa64pfr1;
         t = FIELD_DP64(t, ID_AA64PFR1, BT, 1);
         /*
-         * Begin with full support for MTE; will be downgraded to MTE=1
-         * during realize if the board provides no tag memory.
+         * Begin with full support for MTE. This will be downgraded to MTE=0
+         * during realize if the board provides no tag memory, much like
+         * we do for EL2 with the virtualization=on property.
          */
         t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2);
         cpu->isar.id_aa64pfr1 = t;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16469.40542 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTP-00071o-IC; Fri, 30 Oct 2020 22:02:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16469.40542; Fri, 30 Oct 2020 22:02:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTP-00071g-F3; Fri, 30 Oct 2020 22:02:15 +0000
Received: by outflank-mailman (input) for mailman id 16469;
 Fri, 30 Oct 2020 22:02:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcTO-00071Y-6A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9cc8a157-8ad3-4f09-9122-bd015860f130;
 Fri, 30 Oct 2020 22:02:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTN-0004Lo-DO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTN-000291-Cg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcTO-00071Y-6A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:14 +0000
X-Inumbo-ID: 9cc8a157-8ad3-4f09-9122-bd015860f130
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9cc8a157-8ad3-4f09-9122-bd015860f130;
	Fri, 30 Oct 2020 22:02:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=34Iw4rfHFghswp3H5bNPDDglR5W5AxfUKhLfz9sKobA=; b=u5fdQFdtLbXH/plax6FojVQnoL
	g9tmdQzL0mBOYIWvsW0ZGxxRvkRPR4yPXk6/ilkiOfCOCUcAJcRr0itnh6Pqn5L6svoOJ65EUkwcl
	xiHLFYE/GYc7UXpsaj5KWxDd/DRCdUFzjzes9bBO6Mx/SctcBcOZB55FUyacQeNB4+lQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTN-0004Lo-DO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTN-000291-Cg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/virt: Error for MTE enabled with KVM
Message-Id: <E1kYcTN-000291-Cg@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:13 +0000

commit 7f6185ed9ca977a9836f35b994e4f85cecae8437
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/virt: Error for MTE enabled with KVM
    
    While we expect KVM to support MTE at some future point,
    it certainly won't be ready in time for qemu 5.1.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-3-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 5866c4ce20..a7f3d442db 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1773,6 +1773,12 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
+    if (vms->mte && kvm_enabled()) {
+        error_report("mach-virt: KVM does not support providing "
+                     "MTE to the guest CPU");
+        exit(1);
+    }
+
     create_fdt(vms);
 
     possible_cpus = mc->possible_cpu_arch_ids(machine);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16470.40546 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTZ-00073A-Jf; Fri, 30 Oct 2020 22:02:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16470.40546; Fri, 30 Oct 2020 22:02:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTZ-000732-Gh; Fri, 30 Oct 2020 22:02:25 +0000
Received: by outflank-mailman (input) for mailman id 16470;
 Fri, 30 Oct 2020 22:02:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcTY-00072q-Cs
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 472e32a1-daa3-46ae-874d-bfdb248b7c78;
 Fri, 30 Oct 2020 22:02:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTX-0004M0-ID
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTX-00029Z-G9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcTY-00072q-Cs
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:24 +0000
X-Inumbo-ID: 472e32a1-daa3-46ae-874d-bfdb248b7c78
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 472e32a1-daa3-46ae-874d-bfdb248b7c78;
	Fri, 30 Oct 2020 22:02:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rneiG1GNr8WKDLcxI5hD/XJ3K3RDecipW2NG3vqn804=; b=terUwT0FXBGbw8imcxPbpNfI+3
	Nq+dh9bn/JwWuiBspDYbarEW8PjHdYAI4LBLWN+pX0rp4NCWQM4cFzaZSiOO10XAf9Py1pJpubPoQ
	4WgTNOmfwpxng80EWX4LdDgZ+SxshQVxIDfU5FBiBEubJMgXdL9R5FdRiZntuRCkvPoo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTX-0004M0-ID
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTX-00029Z-G9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/virt: Disable memory hotplug when MTE is enabled
Message-Id: <E1kYcTX-00029Z-G9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:23 +0000

commit 19bd6aafbd184be963d2b7c24874e3252a7088b7
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/virt: Disable memory hotplug when MTE is enabled
    
    When MTE is enabled, tag memory must exist for all RAM.
    
    It might be possible to simultaneously hot plug tag memory
    alongside the corresponding normal memory, but for now just
    disable hotplug.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200713213341.590275-4-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a7f3d442db..ecfee362a1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2194,6 +2194,11 @@ static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
         return;
     }
 
+    if (vms->mte) {
+        error_setg(errp, "memory hotplug is not enabled: MTE is enabled");
+        return;
+    }
+
     if (is_nvdimm && !ms->nvdimms_state->is_enabled) {
         error_setg(errp, "nvdimm is not enabled: add 'nvdimm=on' to '-M'");
         return;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16471.40550 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTj-00074W-LI; Fri, 30 Oct 2020 22:02:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16471.40550; Fri, 30 Oct 2020 22:02:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTj-00074P-IH; Fri, 30 Oct 2020 22:02:35 +0000
Received: by outflank-mailman (input) for mailman id 16471;
 Fri, 30 Oct 2020 22:02:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcTi-00074C-H5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 9916a78f-4666-46b8-846e-100faa72c999;
 Fri, 30 Oct 2020 22:02:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTh-0004M8-ND
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTh-0002A7-Kv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcTi-00074C-H5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:34 +0000
X-Inumbo-ID: 9916a78f-4666-46b8-846e-100faa72c999
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 9916a78f-4666-46b8-846e-100faa72c999;
	Fri, 30 Oct 2020 22:02:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j34Yr8KyKRszwrLXtkO4TJkkIEnK/x+LT/NB6fzIdvk=; b=UYVVNXrFA1hGUsgP72V0FFCDYE
	EDxx0o6W1v0cBR+IALRvNWcuzyM/3c7QhdKPoLIha6Wt3QWbxZT1PMD1FmmRkY2JRpoE5Ll0eXnGZ
	5kk08QDPnoV53sVAgFX9lOfpcm1bl/j9pZN4YYBZW/yUsPerVzuqTscylJSIzkN26osg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTh-0004M8-ND
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTh-0002A7-Kv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] util: Implement qemu_get_thread_id() for OpenBSD
Message-Id: <E1kYcTh-0002A7-Kv@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:33 +0000

commit 8edbca515c20bdbb3d2dca3c60dcc5b8ca4fc718
Author:     David CARLIER <devnexen@gmail.com>
AuthorDate: Mon Jul 20 10:25:36 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    util: Implement qemu_get_thread_id() for OpenBSD
    
    Implement qemu_get_thread_id() for OpenBSD hosts, using
    getthrid().
    
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Reviewed-by: Brad Smith <brad@comstyle.com>
    Message-id: CA+XhMqxD6gQDBaj8tX0CMEj3si7qYKsM8u1km47e_-U7MC37Pg@mail.gmail.com
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: tidied up commit message]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 util/oslib-posix.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 36bf8593f8..d923674624 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -100,6 +100,8 @@ int qemu_get_thread_id(void)
     return (int)tid;
 #elif defined(__NetBSD__)
     return _lwp_self();
+#elif defined(__OpenBSD__)
+    return getthrid();
 #else
     return getpid();
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16472.40554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTu-00076W-NB; Fri, 30 Oct 2020 22:02:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16472.40554; Fri, 30 Oct 2020 22:02:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcTu-00076O-Jl; Fri, 30 Oct 2020 22:02:46 +0000
Received: by outflank-mailman (input) for mailman id 16472;
 Fri, 30 Oct 2020 22:02:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcTt-00076G-JI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d4ed166e-ad86-46e6-8e08-b3059875ea1f;
 Fri, 30 Oct 2020 22:02:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTr-0004OC-Qq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcTr-0002CB-Q5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcTt-00076G-JI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:45 +0000
X-Inumbo-ID: d4ed166e-ad86-46e6-8e08-b3059875ea1f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d4ed166e-ad86-46e6-8e08-b3059875ea1f;
	Fri, 30 Oct 2020 22:02:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hme6On9Cmky9jZsZbXFdVJXcm/m1cwyg8+jNhOTk4f8=; b=EMRKx/zmA7lVXeogWgNs3rPyex
	+zcM2ESAOMBco6wK5V6kTs0yEBgMrq1Z6oymNX+jCbJQH7WiQQE+Nnd0Obv1NXHgwP0Sdh2UzXWN5
	nAduJq+yP98PhsU5JyXyqJO3gMT/GDEhgvodCyGlBA+55ZYZ5FEPb6AN/tfYVrJwuLgo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTr-0004OC-Qq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcTr-0002CB-Q5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qdev: Move doc comments from qdev.c to qdev-core.h
Message-Id: <E1kYcTr-0002CB-Q5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:43 +0000

commit b51238e251cefb496b60d3db992af175fb354a68
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:23 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Move doc comments from qdev.c to qdev-core.h
    
    The doc-comments which document the qdev API are split between the
    header file and the C source files, because as a project we haven't
    been consistent about where we put them.
    
    Move all the doc-comments in qdev.c to the header files, so that
    users of the APIs don't have to look at the implementation files for
    this information.
    
    In the process, unify them into our doc-comment format and expand on
    them in some cases to clarify expected use cases.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-2-peter.maydell@linaro.org
---
 hw/core/qdev.c               | 33 -------------------------
 include/hw/qdev-core.h       | 57 ++++++++++++++++++++++++++++++++++++++++++++
 include/hw/qdev-properties.h | 13 ++++++++++
 3 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 01796823b4..96772a15bd 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -128,13 +128,6 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
     }
 }
 
-/*
- * Create a device on the heap.
- * A type @name must exist.
- * This only initializes the device state structure and allows
- * properties to be set.  The device still needs to be realized.  See
- * qdev-core.h.
- */
 DeviceState *qdev_new(const char *name)
 {
     if (!object_class_by_name(name)) {
@@ -143,11 +136,6 @@ DeviceState *qdev_new(const char *name)
     return DEVICE(object_new(name));
 }
 
-/*
- * Try to create a device on the heap.
- * This is like qdev_new(), except it returns %NULL when type @name
- * does not exist.
- */
 DeviceState *qdev_try_new(const char *name)
 {
     if (!module_object_class_by_name(name)) {
@@ -378,14 +366,6 @@ void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
     qdev_unrealize(dev);
 }
 
-/*
- * Realize @dev.
- * @dev must not be plugged into a bus.
- * If @bus, plug @dev into @bus.  This takes a reference to @dev.
- * If @dev has no QOM parent, make one up, taking another reference.
- * On success, return true.
- * On failure, store an error through @errp and return false.
- */
 bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp)
 {
     assert(!dev->realized && !dev->parent_bus);
@@ -399,16 +379,6 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp)
     return object_property_set_bool(OBJECT(dev), "realized", true, errp);
 }
 
-/*
- * Realize @dev and drop a reference.
- * This is like qdev_realize(), except the caller must hold a
- * (private) reference, which is dropped on return regardless of
- * success or failure.  Intended use:
- *     dev = qdev_new();
- *     [...]
- *     qdev_realize_and_unref(dev, bus, errp);
- * Now @dev can go away without further ado.
- */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp)
 {
     bool ret;
@@ -814,9 +784,6 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
                                           prop->info->description);
 }
 
-/* @qdev_alias_all_properties - Add alias properties to the source object for
- * all qdev properties on the target DeviceState.
- */
 void qdev_alias_all_properties(DeviceState *target, Object *source)
 {
     ObjectClass *class;
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index fe78073c70..2d441d1fb2 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -320,9 +320,66 @@ compat_props_add(GPtrArray *arr,
 
 /*** Board API.  This should go away once we have a machine config file.  ***/
 
+/**
+ * qdev_new: Create a device on the heap
+ * @name: device type to create (we assert() that this type exists)
+ *
+ * This only allocates the memory and initializes the device state
+ * structure, ready for the caller to set properties if they wish.
+ * The device still needs to be realized.
+ * The returned object has a reference count of 1.
+ */
 DeviceState *qdev_new(const char *name);
+/**
+ * qdev_try_new: Try to create a device on the heap
+ * @name: device type to create
+ *
+ * This is like qdev_new(), except it returns %NULL when type @name
+ * does not exist, rather than asserting.
+ */
 DeviceState *qdev_try_new(const char *name);
+/**
+ * qdev_realize: Realize @dev.
+ * @dev: device to realize
+ * @bus: bus to plug it into (may be NULL)
+ * @errp: pointer to error object
+ *
+ * "Realize" the device, i.e. perform the second phase of device
+ * initialization.
+ * @dev must not be plugged into a bus already.
+ * If @bus, plug @dev into @bus.  This takes a reference to @dev.
+ * If @dev has no QOM parent, make one up, taking another reference.
+ * On success, return true.
+ * On failure, store an error through @errp and return false.
+ *
+ * If you created @dev using qdev_new(), you probably want to use
+ * qdev_realize_and_unref() instead.
+ */
 bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp);
+/**
+ * qdev_realize_and_unref: Realize @dev and drop a reference
+ * @dev: device to realize
+ * @bus: bus to plug it into (may be NULL)
+ * @errp: pointer to error object
+ *
+ * Realize @dev and drop a reference.
+ * This is like qdev_realize(), except the caller must hold a
+ * (private) reference, which is dropped on return regardless of
+ * success or failure.  Intended use::
+ *
+ *     dev = qdev_new();
+ *     [...]
+ *     qdev_realize_and_unref(dev, bus, errp);
+ *
+ * Now @dev can go away without further ado.
+ *
+ * If you are embedding the device into some other QOM device and
+ * initialized it via some variant on object_initialize_child() then
+ * do not use this function, because that family of functions arrange
+ * for the only reference to the child device to be held by the parent
+ * via the child<> property, and so the reference-count-drop done here
+ * would be incorrect. For that use case you want qdev_realize().
+ */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);
 void qdev_unrealize(DeviceState *dev);
 void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 587e5b7d31..8f3a98cba6 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -282,6 +282,19 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
  */
 void qdev_property_add_static(DeviceState *dev, Property *prop);
 
+/**
+ * qdev_alias_all_properties: Create aliases on source for all target properties
+ * @target: Device which has properties to be aliased
+ * @source: Object to add alias properties to
+ *
+ * Add alias properties to the @source object for all qdev properties on
+ * the @target DeviceState.
+ *
+ * This is useful when @target is an internal implementation object
+ * owned by @source, and you want to expose all the properties of that
+ * implementation object as properties on the @source object so that users
+ * of @source can set them.
+ */
 void qdev_alias_all_properties(DeviceState *target, Object *source);
 
 /**
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:02:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:02:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16473.40558 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcU3-000781-QZ; Fri, 30 Oct 2020 22:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16473.40558; Fri, 30 Oct 2020 22:02:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcU3-00077t-NW; Fri, 30 Oct 2020 22:02:55 +0000
Received: by outflank-mailman (input) for mailman id 16473;
 Fri, 30 Oct 2020 22:02:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcU2-00077m-PJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id cdf34e11-b103-4afb-9e4f-a3f67eb415f4;
 Fri, 30 Oct 2020 22:02:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcU1-0004OK-V1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcU1-0002Cl-Tn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcU2-00077m-PJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:54 +0000
X-Inumbo-ID: cdf34e11-b103-4afb-9e4f-a3f67eb415f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id cdf34e11-b103-4afb-9e4f-a3f67eb415f4;
	Fri, 30 Oct 2020 22:02:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6PV2SlXl+8XtFXkvhZr/sNgNxNy93B+zVCNZHEtdvks=; b=ZRsf1U3CK1lhK7VvX+F/zBBPGw
	WvLmN5IQlb9EIm35biwy4F/NwPRQyynlC8ITxjbTZyRRrdgdZsX9NKEVTov9iu62BcMR/GjEz0obz
	6o2ghsOb45JQb6GyCltyNuI4v2e7oKP6Q/RYAva1UwxlAVnhtiwO5qZRc/gjxOI8L//w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcU1-0004OK-V1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcU1-0002Cl-Tn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:02:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qdev: Document qdev_unrealize()
Message-Id: <E1kYcU1-0002Cl-Tn@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:02:53 +0000

commit 46ea1be1ee72b778043e60c8a59cbcb53fb8be34
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:24 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Document qdev_unrealize()
    
    Add a doc comment for qdev_unrealize(), to go with the new
    documentation for the realize part of the qdev lifecycle.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-3-peter.maydell@linaro.org
---
 include/hw/qdev-core.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 2d441d1fb2..1d2bf5f37d 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -381,6 +381,25 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp);
  * would be incorrect. For that use case you want qdev_realize().
  */
 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);
+/**
+ * qdev_unrealize: Unrealize a device
+ * @dev: device to unrealize
+ *
+ * This function will "unrealize" a device, which is the first phase
+ * of correctly destroying a device that has been realized. It will:
+ *
+ *  - unrealize any child buses by calling qbus_unrealize()
+ *    (this will recursively unrealize any devices on those buses)
+ *  - call the the unrealize method of @dev
+ *
+ * The device can then be freed by causing its reference count to go
+ * to zero.
+ *
+ * Warning: most devices in QEMU do not expect to be unrealized.  Only
+ * devices which are hot-unpluggable should be unrealized (as part of
+ * the unplugging process); all other devices are expected to last for
+ * the life of the simulation and should not be unrealized and freed.
+ */
 void qdev_unrealize(DeviceState *dev);
 void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
                                  int required_for_version);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16474.40562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUF-0007Ar-S6; Fri, 30 Oct 2020 22:03:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16474.40562; Fri, 30 Oct 2020 22:03:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUF-0007Ai-P9; Fri, 30 Oct 2020 22:03:07 +0000
Received: by outflank-mailman (input) for mailman id 16474;
 Fri, 30 Oct 2020 22:03:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcUE-0007Ab-2C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a672e026-a9eb-4150-834c-ef46ab9a5310;
 Fri, 30 Oct 2020 22:03:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUC-0004Of-2O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUC-0002DU-1V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcUE-0007Ab-2C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:06 +0000
X-Inumbo-ID: a672e026-a9eb-4150-834c-ef46ab9a5310
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a672e026-a9eb-4150-834c-ef46ab9a5310;
	Fri, 30 Oct 2020 22:03:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FlBqWWUgsVb/iN5dkvC2QU0Svr3A32Vm937ELWO5Lec=; b=iEtJdV6XoQ1ief5AS6CQMV8k3q
	MdEeDppbVseMhLEjDe9gvG+VJCN04btfqnWDnr8ew+HY+SMSvzVVIcHPk5J0g17LrDlvHXWtRKG29
	12KDIylNhkwVcTPSfRvT9jxC02xZRoF6zM6zJeHAt7/+kUeDRA4jjVsT5oJWwu/qg0YI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUC-0004Of-2O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUC-0002DU-1V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qdev: Document GPIO related functions
Message-Id: <E1kYcUC-0002DU-1V@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:04 +0000

commit cd07d7f9f5117954edd9a9bbd97b0442eecf5c49
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 11 15:24:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    qdev: Document GPIO related functions
    
    Add documentation comments for the various qdev functions
    related to creating and connecting GPIO lines.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200711142425.16283-4-peter.maydell@linaro.org
---
 include/hw/qdev-core.h | 191 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 189 insertions(+), 2 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 1d2bf5f37d..ea3f73a282 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -424,13 +424,132 @@ void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
 void qdev_machine_creation_done(void);
 bool qdev_machine_modified(void);
 
+/**
+ * qdev_get_gpio_in: Get one of a device's anonymous input GPIO lines
+ * @dev: Device whose GPIO we want
+ * @n: Number of the anonymous GPIO line (which must be in range)
+ *
+ * Returns the qemu_irq corresponding to an anonymous input GPIO line
+ * (which the device has set up with qdev_init_gpio_in()). The index
+ * @n of the GPIO line must be valid (i.e. be at least 0 and less than
+ * the total number of anonymous input GPIOs the device has); this
+ * function will assert() if passed an invalid index.
+ *
+ * This function is intended to be used by board code or SoC "container"
+ * device models to wire up the GPIO lines; usually the return value
+ * will be passed to qdev_connect_gpio_out() or a similar function to
+ * connect another device's output GPIO line to this input.
+ *
+ * For named input GPIO lines, use qdev_get_gpio_in_named().
+ */
 qemu_irq qdev_get_gpio_in(DeviceState *dev, int n);
+/**
+ * qdev_get_gpio_in_named: Get one of a device's named input GPIO lines
+ * @dev: Device whose GPIO we want
+ * @name: Name of the input GPIO array
+ * @n: Number of the GPIO line in that array (which must be in range)
+ *
+ * Returns the qemu_irq corresponding to a named input GPIO line
+ * (which the device has set up with qdev_init_gpio_in_named()).
+ * The @name string must correspond to an input GPIO array which exists on
+ * the device, and the index @n of the GPIO line must be valid (i.e.
+ * be at least 0 and less than the total number of input GPIOs in that
+ * array); this function will assert() if passed an invalid name or index.
+ *
+ * For anonymous input GPIO lines, use qdev_get_gpio_in().
+ */
 qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n);
 
+/**
+ * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines
+ * @dev: Device whose GPIO to connect
+ * @n: Number of the anonymous output GPIO line (which must be in range)
+ * @pin: qemu_irq to connect the output line to
+ *
+ * This function connects an anonymous output GPIO line on a device
+ * up to an arbitrary qemu_irq, so that when the device asserts that
+ * output GPIO line, the qemu_irq's callback is invoked.
+ * The index @n of the GPIO line must be valid (i.e. be at least 0 and
+ * less than the total number of anonymous output GPIOs the device has
+ * created with qdev_init_gpio_out()); otherwise this function will assert().
+ *
+ * Outbound GPIO lines can be connected to any qemu_irq, but the common
+ * case is connecting them to another device's inbound GPIO line, using
+ * the qemu_irq returned by qdev_get_gpio_in() or qdev_get_gpio_in_named().
+ *
+ * It is not valid to try to connect one outbound GPIO to multiple
+ * qemu_irqs at once, or to connect multiple outbound GPIOs to the
+ * same qemu_irq. (Warning: there is no assertion or other guard to
+ * catch this error: the model will just not do the right thing.)
+ * Instead, for fan-out you can use the TYPE_IRQ_SPLIT device: connect
+ * a device's outbound GPIO to the splitter's input, and connect each
+ * of the splitter's outputs to a different device.  For fan-in you
+ * can use the TYPE_OR_IRQ device, which is a model of a logical OR
+ * gate with multiple inputs and one output.
+ *
+ * For named output GPIO lines, use qdev_connect_gpio_out_named().
+ */
 void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
+/**
+ * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines
+ * @dev: Device whose GPIO to connect
+ * @name: Name of the output GPIO array
+ * @n: Number of the anonymous output GPIO line (which must be in range)
+ * @pin: qemu_irq to connect the output line to
+ *
+ * This function connects an anonymous output GPIO line on a device
+ * up to an arbitrary qemu_irq, so that when the device asserts that
+ * output GPIO line, the qemu_irq's callback is invoked.
+ * The @name string must correspond to an output GPIO array which exists on
+ * the device, and the index @n of the GPIO line must be valid (i.e.
+ * be at least 0 and less than the total number of input GPIOs in that
+ * array); this function will assert() if passed an invalid name or index.
+ *
+ * Outbound GPIO lines can be connected to any qemu_irq, but the common
+ * case is connecting them to another device's inbound GPIO line, using
+ * the qemu_irq returned by qdev_get_gpio_in() or qdev_get_gpio_in_named().
+ *
+ * It is not valid to try to connect one outbound GPIO to multiple
+ * qemu_irqs at once, or to connect multiple outbound GPIOs to the
+ * same qemu_irq; see qdev_connect_gpio_out() for details.
+ *
+ * For named output GPIO lines, use qdev_connect_gpio_out_named().
+ */
 void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
                                  qemu_irq pin);
+/**
+ * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GPIO
+ * @dev: Device whose output GPIO we are interested in
+ * @name: Name of the output GPIO array
+ * @n: Number of the output GPIO line within that array
+ *
+ * Returns whatever qemu_irq is currently connected to the specified
+ * output GPIO line of @dev. This will be NULL if the output GPIO line
+ * has never been wired up to the anything.  Note that the qemu_irq
+ * returned does not belong to @dev -- it will be the input GPIO or
+ * IRQ of whichever device the board code has connected up to @dev's
+ * output GPIO.
+ *
+ * You probably don't need to use this function -- it is used only
+ * by the platform-bus subsystem.
+ */
 qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n);
+/**
+ * qdev_intercept_gpio_out: Intercept an existing GPIO connection
+ * @dev: Device to intercept the outbound GPIO line from
+ * @icpt: New qemu_irq to connect instead
+ * @name: Name of the output GPIO array
+ * @n: Number of the GPIO line in the array
+ *
+ * This function is provided only for use by the qtest testing framework
+ * and is not suitable for use in non-testing parts of QEMU.
+ *
+ * This function breaks an existing connection of an outbound GPIO
+ * line from @dev, and replaces it with the new qemu_irq @icpt, as if
+ * ``qdev_connect_gpio_out_named(dev, icpt, name, n)`` had been called.
+ * The previously connected qemu_irq is returned, so it can be restored
+ * by a second call to qdev_intercept_gpio_out() if desired.
+ */
 qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt,
                                  const char *name, int n);
 
@@ -438,10 +557,59 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name);
 
 /*** Device API.  ***/
 
-/* Register device properties.  */
-/* GPIO inputs also double as IRQ sinks.  */
+/**
+ * qdev_init_gpio_in: create an array of anonymous input GPIO lines
+ * @dev: Device to create input GPIOs for
+ * @handler: Function to call when GPIO line value is set
+ * @n: Number of GPIO lines to create
+ *
+ * Devices should use functions in the qdev_init_gpio_in* family in
+ * their instance_init or realize methods to create any input GPIO
+ * lines they need. There is no functional difference between
+ * anonymous and named GPIO lines. Stylistically, named GPIOs are
+ * preferable (easier to understand at callsites) unless a device
+ * has exactly one uniform kind of GPIO input whose purpose is obvious.
+ * Note that input GPIO lines can serve as 'sinks' for IRQ lines.
+ *
+ * See qdev_get_gpio_in() for how code that uses such a device can get
+ * hold of an input GPIO line to manipulate it.
+ */
 void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
+/**
+ * qdev_init_gpio_out: create an array of anonymous output GPIO lines
+ * @dev: Device to create output GPIOs for
+ * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines
+ * @n: Number of GPIO lines to create
+ *
+ * Devices should use functions in the qdev_init_gpio_out* family
+ * in their instance_init or realize methods to create any output
+ * GPIO lines they need. There is no functional difference between
+ * anonymous and named GPIO lines. Stylistically, named GPIOs are
+ * preferable (easier to understand at callsites) unless a device
+ * has exactly one uniform kind of GPIO output whose purpose is obvious.
+ *
+ * The @pins argument should be a pointer to either a "qemu_irq"
+ * (if @n == 1) or a "qemu_irq []" array (if @n > 1) in the device's
+ * state structure. The device implementation can then raise and
+ * lower the GPIO line by calling qemu_set_irq(). (If anything is
+ * connected to the other end of the GPIO this will cause the handler
+ * function for that input GPIO to be called.)
+ *
+ * See qdev_connect_gpio_out() for how code that uses such a device
+ * can connect to one of its output GPIO lines.
+ */
 void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
+/**
+ * qdev_init_gpio_out: create an array of named output GPIO lines
+ * @dev: Device to create output GPIOs for
+ * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines
+ * @name: Name to give this array of GPIO lines
+ * @n: Number of GPIO lines to create
+ *
+ * Like qdev_init_gpio_out(), but creates an array of GPIO output lines
+ * with a name. Code using the device can then connect these GPIO lines
+ * using qdev_connect_gpio_out_named().
+ */
 void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins,
                               const char *name, int n);
 /**
@@ -473,6 +641,25 @@ static inline void qdev_init_gpio_in_named(DeviceState *dev,
     qdev_init_gpio_in_named_with_opaque(dev, handler, dev, name, n);
 }
 
+/**
+ * qdev_pass_gpios: create GPIO lines on container which pass through to device
+ * @dev: Device which has GPIO lines
+ * @container: Container device which needs to expose them
+ * @name: Name of GPIO array to pass through (NULL for the anonymous GPIO array)
+ *
+ * In QEMU, complicated devices like SoCs are often modelled with a
+ * "container" QOM device which itself contains other QOM devices and
+ * which wires them up appropriately. This function allows the container
+ * to create GPIO arrays on itself which simply pass through to a GPIO
+ * array of one of its internal devices.
+ *
+ * If @dev has both input and output GPIOs named @name then both will
+ * be passed through. It is not possible to pass a subset of the array
+ * with this function.
+ *
+ * To users of the container device, the GPIO array created on @container
+ * behaves exactly like any other.
+ */
 void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
                      const char *name);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16475.40566 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUO-0007Hb-Tk; Fri, 30 Oct 2020 22:03:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16475.40566; Fri, 30 Oct 2020 22:03:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUO-0007HT-Qk; Fri, 30 Oct 2020 22:03:16 +0000
Received: by outflank-mailman (input) for mailman id 16475;
 Fri, 30 Oct 2020 22:03:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcUM-0007Bj-W9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e427d13f-005b-46c8-bdc3-aeca3111ad04;
 Fri, 30 Oct 2020 22:03:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUM-0004On-6H
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUM-0002E6-58
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcUM-0007Bj-W9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:15 +0000
X-Inumbo-ID: e427d13f-005b-46c8-bdc3-aeca3111ad04
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e427d13f-005b-46c8-bdc3-aeca3111ad04;
	Fri, 30 Oct 2020 22:03:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=42PSTAgixND4e6gMe7UG9h10B0czMsxNkG5JIlUmJNE=; b=M899fCD+evjakKir8RvyyLs44T
	EvzF8X2HGf3L0Oe3OBfxAl3M6iVvPcWbGc9POvVjMnDyKYN6XaGbORb+6ywZORrG/s0mcYzTuKkRF
	xYW2hUrzUAfWQKRywouvfn749ZhHh8Xmk6WZW6FFtIMJ9Lyvt/m9pC+tjeDZ65ZyOcj0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUM-0004On-6H
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUM-0002E6-58
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
Message-Id: <E1kYcUM-0002E6-58@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:14 +0000

commit 3f410039b79c0468e18142c6ddfede6f6f7b0427
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 15:37:16 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
    
    In armsse_realize() we have a loop over [0, info->num_cpus), which
    indexes into various fixed-size arrays in the ARMSSE struct.  This
    confuses Coverity, which warns that we might overrun those arrays
    (CID 1430326, 1430337, 1430371, 1430414, 1430430).  This can't
    actually happen, because the info struct is always one of the entries
    in the armsse_variants[] array and num_cpus is either 1 or 2; we also
    already assert in armsse_init() that num_cpus is not too large.
    However, adding an assert to armsse_realize() like the one in
    armsse_init() should help Coverity figure out that these code paths
    aren't possible.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200713143716.9881-1-peter.maydell@linaro.org
---
 hw/arm/armsse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
index 64fcab895f..dcbff9bd8f 100644
--- a/hw/arm/armsse.c
+++ b/hw/arm/armsse.c
@@ -452,6 +452,8 @@ static void armsse_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    assert(info->num_cpus <= SSE_MAX_CPUS);
+
     /* max SRAM_ADDR_WIDTH: 24 - log2(SRAM_NUM_BANK) */
     assert(is_power_of_2(info->sram_banks));
     addr_width_max = 24 - ctz32(info->sram_banks);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16476.40570 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUY-0007Iy-Vo; Fri, 30 Oct 2020 22:03:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16476.40570; Fri, 30 Oct 2020 22:03:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUY-0007Iq-SH; Fri, 30 Oct 2020 22:03:26 +0000
Received: by outflank-mailman (input) for mailman id 16476;
 Fri, 30 Oct 2020 22:03:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcUX-0007Id-4u
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 86ebd7f7-44e9-463a-8b3a-c3a69846c085;
 Fri, 30 Oct 2020 22:03:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUW-0004Ou-AC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUW-0002Ee-9E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcUX-0007Id-4u
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:25 +0000
X-Inumbo-ID: 86ebd7f7-44e9-463a-8b3a-c3a69846c085
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 86ebd7f7-44e9-463a-8b3a-c3a69846c085;
	Fri, 30 Oct 2020 22:03:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AyZiSjh1gC4Fq1vaEH4q91g3v/yLXgNYRn77EmU8RZo=; b=oWlNQ8qcu6E3GqAKMpYLq3Fb62
	dfBMO/SKMqt64/F/vmm6OCtSNOzNW00zaHenwiQhlTtJTzIeLP9TgTAzNPhd19C17HOefNWJPf72i
	egHCxdkOXbaLLA4DNlRdAFT+vA3Oz8G3GvBg0lHpDNU08jcDrtWzj+8daJ8nsf/1gpQE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUW-0004Ou-AC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUW-0002Ee-9E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system: Briefly document canon-a1100 board
Message-Id: <E1kYcUW-0002Ee-9E@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:24 +0000

commit 2d21dd17c560a574e19ba94d07173924bf74571b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:43 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document canon-a1100 board
    
    Add skeletal documentation of the canon-a1100 board.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-2-peter.maydell@linaro.org
---
 MAINTAINERS                |  1 +
 docs/system/arm/digic.rst  | 11 +++++++++++
 docs/system/target-arm.rst |  1 +
 3 files changed, 13 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5d9c56e441..9ed36dcf73 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -636,6 +636,7 @@ F: include/hw/arm/digic.h
 F: hw/*/digic*
 F: include/hw/*/digic*
 F: tests/acceptance/machine_arm_canona1100.py
+F: docs/system/arm/digic.rst
 
 Goldfish RTC
 M: Anup Patel <anup.patel@wdc.com>
diff --git a/docs/system/arm/digic.rst b/docs/system/arm/digic.rst
new file mode 100644
index 0000000000..2b3520ff5e
--- /dev/null
+++ b/docs/system/arm/digic.rst
@@ -0,0 +1,11 @@
+Canon A1100 (``canon-a1100``)
+=============================
+
+This machine is a model of the Canon PowerShot A1100 camera, which
+uses the DIGIC SoC. This model is based on reverse engineering efforts
+by the contributors to the `CHDK <http://chdk.wikia.com/>`_ and
+`Magic Lantern <http://www.magiclantern.fm/>`_ projects.
+
+The emulation is incomplete. In particular it can't be used
+to run the original camera firmware, but it can successfully run
+an experimental version of the `barebox bootloader <http://www.barebox.org/>`_.
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 1bd477a293..8fa51a2281 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -82,6 +82,7 @@ undocumented; you can get a complete list by running
    arm/versatile
    arm/vexpress
    arm/aspeed
+   arm/digic
    arm/musicpal
    arm/nseries
    arm/orangepi
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16477.40574 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUk-0007KD-1K; Fri, 30 Oct 2020 22:03:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16477.40574; Fri, 30 Oct 2020 22:03:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUj-0007K5-U6; Fri, 30 Oct 2020 22:03:37 +0000
Received: by outflank-mailman (input) for mailman id 16477;
 Fri, 30 Oct 2020 22:03:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcUi-0007Jw-BP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b0adc8d1-80e6-41de-9157-39bdc675ccd9;
 Fri, 30 Oct 2020 22:03:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUg-0004P1-EE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUg-0002FI-DN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcUi-0007Jw-BP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:36 +0000
X-Inumbo-ID: b0adc8d1-80e6-41de-9157-39bdc675ccd9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b0adc8d1-80e6-41de-9157-39bdc675ccd9;
	Fri, 30 Oct 2020 22:03:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zBOaX0BNfgDMMrpFkBt/rFy8aZFOBApnEiMvEgainnY=; b=bZ5aCXboAruauZ0yZXnnMUpiN2
	rDgIJRylbxYgdoC7nezxp7rW/OCamX1IomfcVkYDCO6KV+wCsf+t4axLlHUD/vVae5CtRq9tBO/kQ
	NP21+kg8vVi9olSTNpyIAgcq1Me6NiQIwM28C/2ht/mPnWDTVLJdqo0pSPWpsAknhR8g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUg-0004P1-EE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUg-0002FI-DN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system: Briefly document collie board
Message-Id: <E1kYcUg-0002FI-DN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:34 +0000

commit b76b60f59bb95f9184bb70ea62f3db7b65730478
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document collie board
    
    Add skeletal documentation of the collie board.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-3-peter.maydell@linaro.org
---
 MAINTAINERS                |  1 +
 docs/system/arm/collie.rst | 16 ++++++++++++++++
 docs/system/target-arm.rst |  1 +
 3 files changed, 18 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9ed36dcf73..6973b68975 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -847,6 +847,7 @@ L: qemu-arm@nongnu.org
 S: Odd Fixes
 F: hw/arm/collie.c
 F: hw/arm/strongarm*
+F: docs/system/arm/collie.rst
 
 Stellaris
 M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/docs/system/arm/collie.rst b/docs/system/arm/collie.rst
new file mode 100644
index 0000000000..5cc67b6d1b
--- /dev/null
+++ b/docs/system/arm/collie.rst
@@ -0,0 +1,16 @@
+Sharp Zaurus SL-5500 (``collie``)
+=================================
+
+This machine is a model of the Sharp Zaurus SL-5500, which was
+a 1990s PDA based on the StrongARM SA1110.
+
+Implemented devices:
+
+ * NOR flash
+ * Interrupt controller
+ * Timer
+ * RTC
+ * GPIO
+ * Peripheral Pin Controller (PPC)
+ * UARTs
+ * Synchronous Serial Ports (SSP)
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 8fa51a2281..376c18f0b1 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -88,6 +88,7 @@ undocumented; you can get a complete list by running
    arm/orangepi
    arm/palm
    arm/xscale
+   arm/collie
    arm/sx1
    arm/stellaris
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16478.40578 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUt-0007Lv-42; Fri, 30 Oct 2020 22:03:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16478.40578; Fri, 30 Oct 2020 22:03:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcUt-0007Ln-12; Fri, 30 Oct 2020 22:03:47 +0000
Received: by outflank-mailman (input) for mailman id 16478;
 Fri, 30 Oct 2020 22:03:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcUr-0007Ld-FQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4b281b49-632b-4763-b64b-590e326b146c;
 Fri, 30 Oct 2020 22:03:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUq-0004Pn-Iw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcUq-0002G2-HH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcUr-0007Ld-FQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:45 +0000
X-Inumbo-ID: 4b281b49-632b-4763-b64b-590e326b146c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4b281b49-632b-4763-b64b-590e326b146c;
	Fri, 30 Oct 2020 22:03:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=j/2HCO+mvZTUKwV5DPAXdmeh6FXRHP85WpbqUm2L63c=; b=KDG3YOk59pU4lDnPfk/ypNa1RD
	OaztLRXvrGYK6qaBRufjJ8PXAONjNSFpCFbPDQ/5kiEcDqVhrrlQIVTqlRbmadOWnBUuRTgoh27vD
	dzZ3J0nhzXwyoVvOSbq0W+Ku6/bgINfaPubtonmgY/rQOp2GnhDXr9dsRODSV2QoRx34=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUq-0004Pn-Iw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcUq-0002G2-HH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system: Briefly document gumstix boards
Message-Id: <E1kYcUq-0002G2-HH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:44 +0000

commit bb309000c818b4ff4763ebc38b1c4bfae56ddf37
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:45 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Briefly document gumstix boards
    
    Add skeletal documentation of the gumstix boards
    ('connex' and 'verdex').
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-4-peter.maydell@linaro.org
---
 MAINTAINERS                 |  1 +
 docs/system/arm/gumstix.rst | 21 +++++++++++++++++++++
 docs/system/target-arm.rst  |  1 +
 3 files changed, 23 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6973b68975..935ccb3ab3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -652,6 +652,7 @@ R: Philippe Mathieu-Daudé <f4bug@amsat.org>
 L: qemu-arm@nongnu.org
 S: Odd Fixes
 F: hw/arm/gumstix.c
+F: docs/system/arm/gumstix.rst
 
 i.MX25 PDK
 M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/docs/system/arm/gumstix.rst b/docs/system/arm/gumstix.rst
new file mode 100644
index 0000000000..cb373139dc
--- /dev/null
+++ b/docs/system/arm/gumstix.rst
@@ -0,0 +1,21 @@
+Gumstix Connex and Verdex (``connex``, ``verdex``)
+==================================================
+
+These machines model the Gumstix Connex and Verdex boards.
+The Connex has a PXA255 CPU and the Verdex has a PXA270.
+
+Implemented devices:
+
+ * NOR flash
+ * SMC91C111 ethernet
+ * Interrupt controller
+ * DMA
+ * Timer
+ * GPIO
+ * MMC/SD card
+ * Fast infra-red communications port (FIR)
+ * LCD controller
+ * Synchronous serial ports (SPI)
+ * PCMCIA interface
+ * I2C
+ * I2S
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 376c18f0b1..163ab91559 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -84,6 +84,7 @@ undocumented; you can get a complete list by running
    arm/aspeed
    arm/digic
    arm/musicpal
+   arm/gumstix
    arm/nseries
    arm/orangepi
    arm/palm
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:03:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16479.40582 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcV3-0007NR-60; Fri, 30 Oct 2020 22:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16479.40582; Fri, 30 Oct 2020 22:03:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcV3-0007NJ-2W; Fri, 30 Oct 2020 22:03:57 +0000
Received: by outflank-mailman (input) for mailman id 16479;
 Fri, 30 Oct 2020 22:03:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcV1-0007N6-UL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2042373a-6d60-40a9-aae3-c059cae27ef3;
 Fri, 30 Oct 2020 22:03:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcV0-0004Q4-Mu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcV0-0002Gi-M0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcV1-0007N6-UL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:55 +0000
X-Inumbo-ID: 2042373a-6d60-40a9-aae3-c059cae27ef3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2042373a-6d60-40a9-aae3-c059cae27ef3;
	Fri, 30 Oct 2020 22:03:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eY4fZTRbfs3o9yLVHl0nXUDSbsFFyJaQzVGctOPEisA=; b=aj+kAuNMcJnlBziaYchz3UlsJn
	Q3GqJZpJdOHUpsm25BJGvs/eeisTsywbz/LzIOHf4ZIp3Jb4p7ZPHsWa8nATmkqw3TecxM7Q8u1sj
	gK8mz2W7AcS42yBTH3dqMmTH0r9OKi9w7cVPggyV+gKqSzT3xooyPmD6WmRFv33qEUiw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcV0-0004Q4-Mu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcV0-0002Gi-M0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:03:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system: Document the arm virt board
Message-Id: <E1kYcV0-0002Gi-M0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:03:54 +0000

commit 6a0b7505f1fd6769c3f1558fda76464d51e4118a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 13 18:57:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 11:35:17 2020 +0100

    docs/system: Document the arm virt board
    
    Document the arm 'virt' board, which has been undocumented
    for far too long given that it is the main recommended board
    type for arm guests.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Message-id: 20200713175746.5936-5-peter.maydell@linaro.org
---
 MAINTAINERS                |   1 +
 docs/system/arm/virt.rst   | 161 +++++++++++++++++++++++++++++++++++++++++++++
 docs/system/target-arm.rst |   1 +
 3 files changed, 163 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 935ccb3ab3..5e8616821a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -880,6 +880,7 @@ L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/virt*
 F: include/hw/arm/virt.h
+F: docs/system/arm/virt.rst
 
 Xilinx Zynq
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
new file mode 100644
index 0000000000..6621ab7205
--- /dev/null
+++ b/docs/system/arm/virt.rst
@@ -0,0 +1,161 @@
+'virt' generic virtual platform (``virt``)
+==========================================
+
+The `virt` board is a platform which does not correspond to any
+real hardware; it is designed for use in virtual machines.
+It is the recommended board type if you simply want to run
+a guest such as Linux and do not care about reproducing the
+idiosyncrasies and limitations of a particular bit of real-world
+hardware.
+
+This is a "versioned" board model, so as well as the ``virt`` machine
+type itself (which may have improvements, bugfixes and other minor
+changes between QEMU versions) a version is provided that guarantees
+to have the same behaviour as that of previous QEMU releases, so
+that VM migration will work between QEMU versions. For instance the
+``virt-5.0`` machine type will behave like the ``virt`` machine from
+the QEMU 5.0 release, and migration should work between ``virt-5.0``
+of the 5.0 release and ``virt-5.0`` of the 5.1 release. Migration
+is not guaranteed to work between different QEMU releases for
+the non-versioned ``virt`` machine type.
+
+Supported devices
+"""""""""""""""""
+
+The virt board supports:
+
+- PCI/PCIe devices
+- Flash memory
+- One PL011 UART
+- An RTC
+- The fw_cfg device that allows a guest to obtain data from QEMU
+- A PL061 GPIO controller
+- An optional SMMUv3 IOMMU
+- hotpluggable DIMMs
+- hotpluggable NVDIMMs
+- An MSI controller (GICv2M or ITS). GICv2M is selected by default along
+  with GICv2. ITS is selected by default with GICv3 (>= virt-2.7). Note
+  that ITS is not modeled in TCG mode.
+- 32 virtio-mmio transport devices
+- running guests using the KVM accelerator on aarch64 hardware
+- large amounts of RAM (at least 255GB, and more if using highmem)
+- many CPUs (up to 512 if using a GICv3 and highmem)
+- Secure-World-only devices if the CPU has TrustZone:
+
+  - A second PL011 UART
+  - A secure flash memory
+  - 16MB of secure RAM
+
+Supported guest CPU types:
+
+- ``cortex-a7`` (32-bit)
+- ``cortex-a15`` (32-bit; the default)
+- ``cortex-a53`` (64-bit)
+- ``cortex-a57`` (64-bit)
+- ``cortex-a72`` (64-bit)
+- ``host`` (with KVM only)
+- ``max`` (same as ``host`` for KVM; best possible emulation with TCG)
+
+Note that the default is ``cortex-a15``, so for an AArch64 guest you must
+specify a CPU type.
+
+Graphics output is available, but unlike the x86 PC machine types
+there is no default display device enabled: you should select one from
+the Display devices section of "-device help". The recommended option
+is ``virtio-gpu-pci``; this is the only one which will work correctly
+with KVM. You may also need to ensure your guest kernel is configured
+with support for this; see below.
+
+Machine-specific options
+""""""""""""""""""""""""
+
+The following machine-specific options are supported:
+
+secure
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Security Extensions (TrustZone). The default is ``off``.
+
+virtualization
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Virtualization Extensions. The default is ``off``.
+
+highmem
+  Set ``on``/``off`` to enable/disable placing devices and RAM in physical
+  address space above 32 bits. The default is ``on`` for machine types
+  later than ``virt-2.12``.
+
+gic-version
+  Specify the version of the Generic Interrupt Controller (GIC) to provide.
+  Valid values are:
+
+  ``2``
+    GICv2
+  ``3``
+    GICv3
+  ``host``
+    Use the same GIC version the host provides, when using KVM
+  ``max``
+    Use the best GIC version possible (same as host when using KVM;
+    currently same as ``3``` for TCG, but this may change in future)
+
+its
+  Set ``on``/``off`` to enable/disable ITS instantiation. The default is ``on``
+  for machine types later than ``virt-2.7``.
+
+iommu
+  Set the IOMMU type to create for the guest. Valid values are:
+
+  ``none``
+    Don't create an IOMMU (the default)
+  ``smmuv3``
+    Create an SMMUv3
+
+ras
+  Set ``on``/``off`` to enable/disable reporting host memory errors to a guest
+  using ACPI and guest external abort exceptions. The default is off.
+
+Linux guest kernel configuration
+""""""""""""""""""""""""""""""""
+
+The 'defconfig' for Linux arm and arm64 kernels should include the
+right device drivers for virtio and the PCI controller; however some older
+kernel versions, especially for 32-bit Arm, did not have everything
+enabled by default. If you're not seeing PCI devices that you expect,
+then check that your guest config has::
+
+  CONFIG_PCI=y
+  CONFIG_VIRTIO_PCI=y
+  CONFIG_PCI_HOST_GENERIC=y
+
+If you want to use the ``virtio-gpu-pci`` graphics device you will also
+need::
+
+  CONFIG_DRM=y
+  CONFIG_DRM_VIRTIO_GPU=y
+
+Hardware configuration information for bare-metal programming
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The ``virt`` board automatically generates a device tree blob ("dtb")
+which it passes to the guest. This provides information about the
+addresses, interrupt lines and other configuration of the various devices
+in the system. Guest code can rely on and hard-code the following
+addresses:
+
+- Flash memory starts at address 0x0000_0000
+
+- RAM starts at 0x4000_0000
+
+All other information about device locations may change between
+QEMU versions, so guest code must look in the DTB.
+
+QEMU supports two types of guest image boot for ``virt``, and
+the way for the guest code to locate the dtb binary differs:
+
+- For guests using the Linux kernel boot protocol (this means any
+  non-ELF file passed to the QEMU ``-kernel`` option) the address
+  of the DTB is passed in a register (``r2`` for 32-bit guests,
+  or ``x0`` for 64-bit guests)
+
+- For guests booting as "bare-metal" (any other kind of boot),
+  the DTB is at the start of RAM (0x4000_0000)
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 163ab91559..4c5b0e4aab 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -92,6 +92,7 @@ undocumented; you can get a complete list by running
    arm/collie
    arm/sx1
    arm/stellaris
+   arm/virt
 
 Arm CPU features
 ================
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16480.40586 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVE-0007Og-7Y; Fri, 30 Oct 2020 22:04:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16480.40586; Fri, 30 Oct 2020 22:04:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVE-0007OY-4R; Fri, 30 Oct 2020 22:04:08 +0000
Received: by outflank-mailman (input) for mailman id 16480;
 Fri, 30 Oct 2020 22:04:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcVC-0007ON-4x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5da99416-1628-432a-9e2b-ffb4dc1e9e15;
 Fri, 30 Oct 2020 22:04:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVA-0004QP-Qv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVA-0002HR-Q7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcVC-0007ON-4x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:06 +0000
X-Inumbo-ID: 5da99416-1628-432a-9e2b-ffb4dc1e9e15
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5da99416-1628-432a-9e2b-ffb4dc1e9e15;
	Fri, 30 Oct 2020 22:04:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QyZyJdTJ1llpJKq+ZfUiAmSvZ1SZhEBDXijk8E5yNI8=; b=kqw7xbbzfov/AVuAxFJDKBg6e9
	1dTwTAVkjCqfn3xZQVd/d7WPUUtwF2D6sXw1nEP/WMZ0houQv88t9bzuj0Rv3pntAEKvrWhTlYash
	3kGsVKC3vTWS/GFC9M8YEoT+5dFgjH+NQFbdeva6sv9HsvEbJlYLKFkq1VeR67oir60Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVA-0004QP-Qv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVA-0002HR-Q7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200720' into staging
Message-Id: <E1kYcVA-0002HR-Q7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:04 +0000

commit af3d69058e09bede9900f266a618ed11f76f49f3
Merge: 1e6c50ad8559c18b21041ef69d8fff781a8db0bb 6a0b7505f1fd6769c3f1558fda76464d51e4118a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 20 15:58:07 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 20 15:58:07 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200720' into staging
    
    target-arm queue:
     * virt: Don't enable MTE emulation by default
     * virt: Diagnose attempts to use MTE with memory-hotplug or KVM
       (rather than silently not working correctly)
     * util: Implement qemu_get_thread_id() for OpenBSD
     * qdev: Add doc comments for qdev_unrealize and GPIO functions,
       and standardize on doc-comments-in-header-file
     * hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
     * docs/system: Document canon-a1100, collie, gumstix, virt boards
    
    # gpg: Signature made Mon 20 Jul 2020 13:55:36 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200720:
      docs/system: Document the arm virt board
      docs/system: Briefly document gumstix boards
      docs/system: Briefly document collie board
      docs/system: Briefly document canon-a1100 board
      hw/arm/armsse: Assert info->num_cpus is in-bounds in armsse_realize()
      qdev: Document GPIO related functions
      qdev: Document qdev_unrealize()
      qdev: Move doc comments from qdev.c to qdev-core.h
      util: Implement qemu_get_thread_id() for OpenBSD
      hw/arm/virt: Disable memory hotplug when MTE is enabled
      hw/arm/virt: Error for MTE enabled with KVM
      hw/arm/virt: Enable MTE via a machine property
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                  |   4 +
 docs/system/arm/collie.rst   |  16 +++
 docs/system/arm/digic.rst    |  11 ++
 docs/system/arm/gumstix.rst  |  21 ++++
 docs/system/arm/virt.rst     | 161 ++++++++++++++++++++++++++
 docs/system/target-arm.rst   |   4 +
 hw/arm/armsse.c              |   2 +
 hw/arm/virt.c                |  50 +++++++-
 hw/core/qdev.c               |  33 ------
 include/hw/arm/virt.h        |   1 +
 include/hw/qdev-core.h       | 267 ++++++++++++++++++++++++++++++++++++++++++-
 include/hw/qdev-properties.h |  13 +++
 target/arm/cpu.c             |  19 +--
 target/arm/cpu64.c           |   5 +-
 util/oslib-posix.c           |   2 +
 15 files changed, 559 insertions(+), 50 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16481.40590 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVO-0007Pq-9D; Fri, 30 Oct 2020 22:04:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16481.40590; Fri, 30 Oct 2020 22:04:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVO-0007Pi-68; Fri, 30 Oct 2020 22:04:18 +0000
Received: by outflank-mailman (input) for mailman id 16481;
 Fri, 30 Oct 2020 22:04:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcVM-0007PW-3E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id dc8ec53e-1837-4646-93f8-216c4281c9d4;
 Fri, 30 Oct 2020 22:04:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVL-0004QY-Ah
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVL-0002JZ-98
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcVM-0007PW-3E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:16 +0000
X-Inumbo-ID: dc8ec53e-1837-4646-93f8-216c4281c9d4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id dc8ec53e-1837-4646-93f8-216c4281c9d4;
	Fri, 30 Oct 2020 22:04:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+G1Am7oR3kMe4vU+aNuRDEgcd5uRW159H+pumdqkBO4=; b=QCHUyrglPgLkLuNeM6L7E0vH5p
	fwtjFG37TvUdCIZbNpiV9fzPw8aEDKBe5l8lgpkyIrlDwGM0OmhtyiMzso/9tJzP3Jq7evle/rJno
	H8QtEzvJRCxGphcpbo+9WzM02osI9MD+NK5rIz7M4X7zLltK92ieWhk8gPXavt1szZeI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVL-0004QY-Ah
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVL-0002JZ-98
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] scripts/oss-fuzz: Limit target list to i386-softmmu
Message-Id: <E1kYcVL-0002JZ-98@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:15 +0000

commit 7cee363bc2eff06068db0dc3e59cbc5f1906067e
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Fri Jul 17 08:57:42 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    scripts/oss-fuzz: Limit target list to i386-softmmu
    
    The build.sh script only copies qemu-fuzz-i386 to the destination folder,
    so we can speed up the compilation step quite a bit by not compiling the
    other targets here.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/oss-fuzz/build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index f5cee3d67e..a07b3022e8 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -68,7 +68,7 @@ mkdir -p "$DEST_DIR/lib/"  # Copy the shared libraries here
 
 # Build once to get the list of dynamic lib paths, and copy them over
 ../configure --disable-werror --cc="$CC" --cxx="$CXX" \
-    --extra-cflags="$EXTRA_CFLAGS"
+    --extra-cflags="$EXTRA_CFLAGS" --target-list="i386-softmmu"
 
 if ! make CONFIG_FUZZ=y CFLAGS="$LIB_FUZZING_ENGINE" "-j$(nproc)" \
     i386-softmmu/fuzz; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16482.40594 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVY-0007R4-Ai; Fri, 30 Oct 2020 22:04:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16482.40594; Fri, 30 Oct 2020 22:04:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVY-0007Qv-7e; Fri, 30 Oct 2020 22:04:28 +0000
Received: by outflank-mailman (input) for mailman id 16482;
 Fri, 30 Oct 2020 22:04:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcVW-0007Qi-C8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f4f64e6c-8199-49e6-b854-3e46c873d993;
 Fri, 30 Oct 2020 22:04:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVV-0004Qh-EL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVV-0002KR-DT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcVW-0007Qi-C8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:26 +0000
X-Inumbo-ID: f4f64e6c-8199-49e6-b854-3e46c873d993
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f4f64e6c-8199-49e6-b854-3e46c873d993;
	Fri, 30 Oct 2020 22:04:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LuPZDZaE+wV6Iw12Px10xml+AZiI7vA3lriWkyq3Akk=; b=UlPHNLgTEFYrd9q5SeuH4v6d5C
	xL6kDj9dHs2Pyle/nksfqzz5QgeM+Pjh3pqtxEMGFsSVu6+lX4zwkWkK+bBjoLn+J0nYP3RG61rtZ
	5dClh/RjZLq9tvEVmRuJHK2Nr4Mq+x7Pg3Pd/Onf/i42W6lQEEeVybINiImmGyRMPEFU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVV-0004Qh-EL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVV-0002KR-DT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fuzz: Fix leak when assembling datadir path string
Message-Id: <E1kYcVV-0002KR-DT@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:25 +0000

commit bcbad8b05c7f9072cadd3d3ebef2992196b73801
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Fri Jul 17 12:35:23 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    fuzz: Fix leak when assembling datadir path string
    
    We freed the string containing the final datadir path, but did not free
    the path to the executable's directory that we get from
    g_path_get_dirname(). Fix that.
    
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200717163523.1591-1-alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fuzz.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 6bc17ef313..031594a686 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -143,7 +143,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 {
 
     char *target_name;
-    char *dir;
+    char *bindir, *datadir;
     bool serialize = false;
 
     /* Initialize qgraph and modules */
@@ -164,11 +164,13 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
          * location of the executable. Using this we add exec_dir/pc-bios to
          * the datadirs.
          */
-        dir = g_build_filename(g_path_get_dirname(**argv), "pc-bios", NULL);
-        if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
-            qemu_add_data_dir(dir);
+        bindir = g_path_get_dirname(**argv);
+        datadir = g_build_filename(bindir, "pc-bios", NULL);
+        g_free(bindir);
+        if (g_file_test(datadir, G_FILE_TEST_IS_DIR)) {
+            qemu_add_data_dir(datadir);
         }
-        g_free(dir);
+        g_free(datadir);
     } else if (*argc > 1) {  /* The target is specified as an argument */
         target_name = (*argv)[1];
         if (!strstr(target_name, "--fuzz-target=")) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16483.40598 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVi-0007SV-CH; Fri, 30 Oct 2020 22:04:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16483.40598; Fri, 30 Oct 2020 22:04:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVi-0007SN-9A; Fri, 30 Oct 2020 22:04:38 +0000
Received: by outflank-mailman (input) for mailman id 16483;
 Fri, 30 Oct 2020 22:04:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcVh-0007SD-0y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9e35ba76-a77b-46e6-abaa-6207b0d33b83;
 Fri, 30 Oct 2020 22:04:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVf-0004Qv-IJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVf-0002LH-H3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcVh-0007SD-0y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:37 +0000
X-Inumbo-ID: 9e35ba76-a77b-46e6-abaa-6207b0d33b83
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9e35ba76-a77b-46e6-abaa-6207b0d33b83;
	Fri, 30 Oct 2020 22:04:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HLTBs2jySfAUs9317rSfQhfOOkraoi82nT+cDJu3XEI=; b=TvdP/vw/mKw3W51CW1H5McHeBX
	poyE+jBfEj1ac7my5WAJBcFPNipUMJrkTJHT0l3vBzjE7uGKS6oh5Ka6HOSrK4H+oO4wYxAiI5ecI
	blDInytiptB/yrahJ2gov9pm9g0wVwj8giWyYGR9Ea1nKLtogoRuO2xgGTkN87pnCiIk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVf-0004Qv-IJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVf-0002LH-H3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] gitlab-ci.yml: Add oss-fuzz build tests
Message-Id: <E1kYcVf-0002LH-H3@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:35 +0000

commit 48eac1019769ebc4647ba380a828c25d8014be37
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Thu Jul 16 12:33:30 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:21:54 2020 +0200

    gitlab-ci.yml: Add oss-fuzz build tests
    
    This tries to build and run the fuzzers with the same build-script used
    by oss-fuzz. This doesn't guarantee that the builds on oss-fuzz will
    also succeed, since oss-fuzz provides its own compiler and fuzzer vars,
    but it can catch changes that are not compatible with the the
    ./scripts/oss-fuzz/build.sh script.
    The strange way of finding fuzzer binaries stems from the method used by
    oss-fuzz:
    https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-runner/targets_list
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200720073223.22945-1-thuth@redhat.com>
    [thuth: Tweak the "script" to make it work, exclude slirp test, etc.]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 41597c3603..362e5ee755 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -164,22 +164,20 @@ build-clang:
       ppc-softmmu s390x-softmmu arm-linux-user
     MAKE_CHECK_ARGS: check
 
-build-fuzzer:
+build-oss-fuzz:
   <<: *native_build_job_definition
   variables:
     IMAGE: fedora
   script:
-    - mkdir build
-    - cd build
-    - ../configure --cc=clang --cxx=clang++ --enable-fuzzing
-                   --enable-sanitizers --target-list=x86_64-softmmu
-    - make -j"$JOBS" all check-build x86_64-softmmu/fuzz
-    - make check
-    - for fuzzer in i440fx-qos-fork-fuzz i440fx-qos-noreset-fuzz
-        i440fx-qtest-reboot-fuzz virtio-scsi-flags-fuzz virtio-scsi-fuzz ; do
-          echo Testing ${fuzzer} ... ;
-          x86_64-softmmu/qemu-fuzz-x86_64 --fuzz-target=${fuzzer} -runs=1000
-            || exit 1 ;
+    - mkdir build-oss-fuzz
+    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
+      ./scripts/oss-fuzz/build.sh
+    - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
+                      | grep -v slirp); do
+        grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
+        echo Testing ${fuzzer} ... ;
+        ASAN_OPTIONS="fast_unwind_on_malloc=0"
+         "${fuzzer}" -runs=1000 -seed=1 || exit 1 ;
       done
 
 build-tci:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16484.40603 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVr-0007UZ-FS; Fri, 30 Oct 2020 22:04:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16484.40603; Fri, 30 Oct 2020 22:04:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcVr-0007UR-C8; Fri, 30 Oct 2020 22:04:47 +0000
Received: by outflank-mailman (input) for mailman id 16484;
 Fri, 30 Oct 2020 22:04:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcVq-0007UJ-H6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2aa7509e-4232-47c9-9c0b-88b679f38964;
 Fri, 30 Oct 2020 22:04:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVp-0004RU-MK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVp-0002MK-LL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcVq-0007UJ-H6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:46 +0000
X-Inumbo-ID: 2aa7509e-4232-47c9-9c0b-88b679f38964
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2aa7509e-4232-47c9-9c0b-88b679f38964;
	Fri, 30 Oct 2020 22:04:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fUE5RzwiuHNaB4Suw9/qdnX1AoTUmPKEDJgava42iPM=; b=L6VfUkYbWYLCzREj3blbd3Q+k3
	HfUZx4lQu4iORBuJPU+nzUyTPLjtMqPgwJj4tJqufKY1tB5NH0FvQtygTkb4qqmKWfA6SB7hiu2eR
	jYnl0XxaksCxHTFh9nty0gO3TwhiAhk1Ran9xj+NJblCMSxFf3QqHqK9I0qJJ6f3jCvo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVp-0004RU-MK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVp-0002MK-LL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] fuzz: build without AddressSanitizer, by default
Message-Id: <E1kYcVp-0002MK-LL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:45 +0000

commit dd0162653c11de58331506beb8b3d85c8923149c
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:31 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:06 2020 +0200

    fuzz: build without AddressSanitizer, by default
    
    We already have a nice --enable-sanitizers option to enable
    AddressSanitizer. There is no reason to duplicate and force this
    functionality in --enable-fuzzing. In the future, if more sanitizers are
    added to --enable-sanitizers, it might be impossible to build with both
    --enable-sanitizers and --enable-fuzzing, since not all sanitizers are
    compatible with libFuzzer. In that case, we could enable ASAN with
    --extra-cflags="-fsanitize=address"
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-2-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    [thuth: Added missing $CFLAGS]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 33cee41f9c..4bd80ed507 100755
--- a/configure
+++ b/configure
@@ -6337,7 +6337,7 @@ fi
 # checks for fuzzer
 if test "$fuzzing" = "yes" ; then
   write_c_fuzzer_skeleton
-  if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address,fuzzer" ""; then
+  if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then
       have_fuzzer=yes
   fi
 fi
@@ -7893,11 +7893,11 @@ if test "$have_mlockall" = "yes" ; then
 fi
 if test "$fuzzing" = "yes" ; then
   if test "$have_fuzzer" = "yes"; then
-    FUZZ_LDFLAGS=" -fsanitize=address,fuzzer"
-    FUZZ_CFLAGS=" -fsanitize=address,fuzzer"
-    CFLAGS="$CFLAGS -fsanitize=address,fuzzer-no-link"
+    FUZZ_LDFLAGS=" -fsanitize=fuzzer"
+    FUZZ_CFLAGS=" -fsanitize=fuzzer"
+    CFLAGS="$CFLAGS -fsanitize=fuzzer-no-link"
   else
-    error_exit "Your compiler doesn't support -fsanitize=address,fuzzer"
+    error_exit "Your compiler doesn't support -fsanitize=fuzzer"
     exit 1
   fi
 fi
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:04:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:04:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16485.40606 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcW1-0007Vt-GX; Fri, 30 Oct 2020 22:04:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16485.40606; Fri, 30 Oct 2020 22:04:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcW1-0007Vl-Dc; Fri, 30 Oct 2020 22:04:57 +0000
Received: by outflank-mailman (input) for mailman id 16485;
 Fri, 30 Oct 2020 22:04:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcW0-0007Ve-Hv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c9958686-b06a-4d28-bb31-646c4fe82c37;
 Fri, 30 Oct 2020 22:04:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVz-0004Re-Pw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcVz-0002NI-P6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcW0-0007Ve-Hv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:56 +0000
X-Inumbo-ID: c9958686-b06a-4d28-bb31-646c4fe82c37
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c9958686-b06a-4d28-bb31-646c4fe82c37;
	Fri, 30 Oct 2020 22:04:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yNaaaDaTiOrj0ql6HWH93QVA3iAHIYBrNmVKkXgr/p4=; b=4ecWqVJW2rF2hxL1klor1r5n4p
	b7hTGT49G50fkOZsuZdfwtfZ+oPO1/uvpoHCfqMyL3+WV8MQuvrOso6MAN7Pb3DuGhPszKob7A3Q6
	eajC613766JFmYMO3W5fvjrRHaB7zeyd72SboGNdvi7ArO5aIWF83yCtJP6qaRjJmFbU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVz-0004Re-Pw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcVz-0002NI-P6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:04:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/fuzz: describe building fuzzers with enable-sanitizers
Message-Id: <E1kYcVz-0002NI-P6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:04:55 +0000

commit ee16da12d7035bffb1c990c794de8fb1a96815d7
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:32 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:28 2020 +0200

    docs/fuzz: describe building fuzzers with enable-sanitizers
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-3-alxndr@bu.edu>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index db5641de74..12bf6aa0ca 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -23,9 +23,12 @@ AddressSanitizer mmaps ~20TB of memory, as part of its detection. This results
 in a large page-map, and a much slower fork().
 
 To build the fuzzers, install a recent version of clang:
-Configure with (substitute the clang binaries with the version you installed):
+Configure with (substitute the clang binaries with the version you installed).
+Here, enable-sanitizers, is optional but it allows us to reliably detect bugs
+such as out-of-bounds accesses, use-after-frees, double-frees etc.
 
-    CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing
+    CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing \
+                                                --enable-sanitizers
 
 Fuzz targets are built similarly to system/softmmu:
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16486.40610 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWC-0007XD-I2; Fri, 30 Oct 2020 22:05:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16486.40610; Fri, 30 Oct 2020 22:05:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWC-0007X5-F8; Fri, 30 Oct 2020 22:05:08 +0000
Received: by outflank-mailman (input) for mailman id 16486;
 Fri, 30 Oct 2020 22:05:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcWB-0007Wx-Gt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 25b7b0d9-0bb9-4fd3-bab8-bc3d4fc84bab;
 Fri, 30 Oct 2020 22:05:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcW9-0004Rz-Th
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcW9-0002OV-So
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcWB-0007Wx-Gt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:07 +0000
X-Inumbo-ID: 25b7b0d9-0bb9-4fd3-bab8-bc3d4fc84bab
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 25b7b0d9-0bb9-4fd3-bab8-bc3d4fc84bab;
	Fri, 30 Oct 2020 22:05:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t9EMwk+drnyh+wg/5JhwnFtHECGpRHXZM8z3lwy0Dx8=; b=LBSs0OTefpkVTvPltCo5CpEimz
	7b4SAd1t45cklE1yCYcFzUR064s9UpdkW79RgKw0vfeigZ6wCAZJ58Y5pzAH08owq27uEICvdp0hI
	SEwuqp3S9rBzC5p9e3VYHnseg0pABWaRMInBFrSL3dQItrfi/hKSofp4Z55cF6wrCIQI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcW9-0004Rz-Th
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcW9-0002OV-So
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/fuzz: add information about useful libFuzzer flags
Message-Id: <E1kYcW9-0002OV-So@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:05 +0000

commit 19a91e4af86c578420e9fdfe2efdc3b3b3826222
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:33 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:27:28 2020 +0200

    docs/fuzz: add information about useful libFuzzer flags
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-4-alxndr@bu.edu>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 12bf6aa0ca..6d18115239 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -48,6 +48,43 @@ Information about these is available by passing -help=1
 Now the only thing left to do is wait for the fuzzer to trigger potential
 crashes.
 
+== Useful libFuzzer flags ==
+
+As mentioned above, libFuzzer accepts some arguments. Passing -help=1 will list
+the available arguments. In particular, these arguments might be helpful:
+
+$CORPUS_DIR/ : Specify a directory as the last argument to libFuzzer. libFuzzer
+stores each "interesting" input in this corpus directory. The next time you run
+libFuzzer, it will read all of the inputs from the corpus, and continue fuzzing
+from there. You can also specify multiple directories. libFuzzer loads existing
+inputs from all specified directories, but will only write new ones to the
+first one specified.
+
+-max_len=4096 : specify the maximum byte-length of the inputs libFuzzer will
+generate.
+
+-close_fd_mask={1,2,3} : close, stderr, or both. Useful for targets that
+trigger many debug/error messages, or create output on the serial console.
+
+-jobs=4 -workers=4 : These arguments configure libFuzzer to run 4 fuzzers in
+parallel (4 fuzzing jobs in 4 worker processes). Alternatively, with only
+-jobs=N, libFuzzer automatically spawns a number of workers less than or equal
+to half the available CPU cores. Replace 4 with a number appropriate for your
+machine. Make sure to specify a $CORPUS_DIR, which will allow the parallel
+fuzzers to share information about the interesting inputs they find.
+
+-use_value_profile=1 : For each comparison operation, libFuzzer computes 
+(caller_pc&4095) | (popcnt(Arg1 ^ Arg2) << 12) and places this in the coverage
+table. Useful for targets with "magic" constants. If Arg1 came from the fuzzer's
+input and Arg2 is a magic constant, then each time the Hamming distance
+between Arg1 and Arg2 decreases, libFuzzer adds the input to the corpus.
+
+-shrink=1 : Tries to make elements of the corpus "smaller". Might lead to
+better coverage performance, depending on the target.
+
+Note that libFuzzer's exact behavior will depend on the version of
+clang and libFuzzer used to build the device fuzzers.
+
 == Adding a new fuzzer ==
 Coverage over virtual devices can be improved by adding additional fuzzers.
 Fuzzers are kept in tests/qtest/fuzz/ and should be added to
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16487.40613 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWL-0007YY-Jc; Fri, 30 Oct 2020 22:05:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16487.40613; Fri, 30 Oct 2020 22:05:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWL-0007YQ-Gb; Fri, 30 Oct 2020 22:05:17 +0000
Received: by outflank-mailman (input) for mailman id 16487;
 Fri, 30 Oct 2020 22:05:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcWK-0007YJ-Sm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id edad4c26-7020-4311-9420-f0504efbcf40;
 Fri, 30 Oct 2020 22:05:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWK-0004S5-1B
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWK-0002PR-0I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcWK-0007YJ-Sm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
X-Inumbo-ID: edad4c26-7020-4311-9420-f0504efbcf40
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id edad4c26-7020-4311-9420-f0504efbcf40;
	Fri, 30 Oct 2020 22:05:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QEKOT6EFMb1hFP3XMvOCyDI+oAG0CMTkHjLvJVZnW/U=; b=dGWV1Qmu3gXZ6uvKBrp9I5+lzW
	UEjj1bDbIXbTxpsF9naaSBVcR1k/EDYYb9GVjQP0DtL/TIRk15F9HbXpms6odpmNpI89zazb5oBmF
	PAjoHZTaMcNPdgC9CZ1fkS8r/rhIFLxDexNO5lUr+LQ+WKf1QQhcuqmTdF5arYTLoamQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWK-0004S5-1B
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWK-0002PR-0I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/fuzz: add instructions for generating a coverage report
Message-Id: <E1kYcWK-0002PR-0I@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:16 +0000

commit 09a14f586c315b01411dc1ef1bfe99b034b302de
Author:     Alexander Bulekov <alxndr@bu.edu>
AuthorDate: Mon Jul 6 15:55:34 2020 -0400
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 07:29:18 2020 +0200

    docs/fuzz: add instructions for generating a coverage report
    
    Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
    Message-Id: <20200706195534.14962-5-alxndr@bu.edu>
    [thuth: Replaced --enable-sanitizers with --enable-fuzzing]
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/fuzzing.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt
index 6d18115239..96d71c94d7 100644
--- a/docs/devel/fuzzing.txt
+++ b/docs/devel/fuzzing.txt
@@ -85,6 +85,25 @@ better coverage performance, depending on the target.
 Note that libFuzzer's exact behavior will depend on the version of
 clang and libFuzzer used to build the device fuzzers.
 
+== Generating Coverage Reports ==
+Code coverage is a crucial metric for evaluating a fuzzer's performance.
+libFuzzer's output provides a "cov: " column that provides a total number of
+unique blocks/edges covered. To examine coverage on a line-by-line basis we
+can use Clang coverage:
+
+ 1. Configure libFuzzer to store a corpus of all interesting inputs (see
+    CORPUS_DIR above)
+ 2. ./configure the QEMU build with:
+    --enable-fuzzing \
+    --extra-cflags="-fprofile-instr-generate -fcoverage-mapping"
+ 3. Re-run the fuzzer. Specify $CORPUS_DIR/* as an argument, telling libfuzzer
+    to execute all of the inputs in $CORPUS_DIR and exit. Once the process
+    exits, you should find a file, "default.profraw" in the working directory.
+ 4. Execute these commands to generate a detailed HTML coverage-report:
+ llvm-profdata merge -output=default.profdata default.profraw
+ llvm-cov show ./path/to/qemu-fuzz-i386 -instr-profile=default.profdata \
+ --format html -output-dir=/path/to/output/report
+
 == Adding a new fuzzer ==
 Coverage over virtual devices can be improved by adding additional fuzzers.
 Fuzzers are kept in tests/qtest/fuzz/ and should be added to
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16488.40618 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWV-0007Zp-L2; Fri, 30 Oct 2020 22:05:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16488.40618; Fri, 30 Oct 2020 22:05:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWV-0007Zh-I8; Fri, 30 Oct 2020 22:05:27 +0000
Received: by outflank-mailman (input) for mailman id 16488;
 Fri, 30 Oct 2020 22:05:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcWV-0007Za-1O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:27 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 47b6902d-8b4b-47fc-932f-faa644307e3c;
 Fri, 30 Oct 2020 22:05:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWU-0004SL-4v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWU-0002Q7-47
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcWV-0007Za-1O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:27 +0000
X-Inumbo-ID: 47b6902d-8b4b-47fc-932f-faa644307e3c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 47b6902d-8b4b-47fc-932f-faa644307e3c;
	Fri, 30 Oct 2020 22:05:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SdKIh3r+Hf1haY17O3vbFFmg6pjT3BfcrNHN7+bmLMg=; b=sVFNLdE3OcSyZ3CPlP3uGNAItS
	idtswOlz/xdAv0sFY3Ij0ppTSCK2rJEtYuW1UIbklxl7VvF+5KLfUBXCnkOH03RG+rfsSC95w4fz8
	jTMBCi0a5khPil1XuWtlK6TPnJ2WgRfsEB0codmFl1QFBRpx5uwdwQXUSu3ue/PX6Tiw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWU-0004SL-4v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWU-0002Q7-47
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Extend the device fuzzing section
Message-Id: <E1kYcWU-0002Q7-47@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:26 +0000

commit 6184e5fb4221ec5dd6f0c27d05a8e575b81eb89b
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jul 21 07:36:09 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:40:42 2020 +0200

    MAINTAINERS: Extend the device fuzzing section
    
    The file docs/devel/fuzzing.txt should be in this section, too, and add
    myself as a reviewer (since I often take the fuzzer patches through the
    qtest-next tree, I should be notified on patches, too).
    
    Message-Id: <20200721053926.17197-1-thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5e8616821a..3395abd4e1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2449,9 +2449,11 @@ M: Alexander Bulekov <alxndr@bu.edu>
 R: Paolo Bonzini <pbonzini@redhat.com>
 R: Bandan Das <bsd@redhat.com>
 R: Stefan Hajnoczi <stefanha@redhat.com>
+R: Thomas Huth <thuth@redhat.com>
 S: Maintained
 F: tests/qtest/fuzz/
 F: scripts/oss-fuzz/
+F: docs/devel/fuzzing.txt
 
 Register API
 M: Alistair Francis <alistair@alistair23.me>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16489.40623 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWf-0007b9-N5; Fri, 30 Oct 2020 22:05:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16489.40623; Fri, 30 Oct 2020 22:05:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWf-0007b1-Ji; Fri, 30 Oct 2020 22:05:37 +0000
Received: by outflank-mailman (input) for mailman id 16489;
 Fri, 30 Oct 2020 22:05:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcWf-0007at-4M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e8ea8bc7-07e0-4ddd-ae8b-d9c97e483920;
 Fri, 30 Oct 2020 22:05:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWe-0004SV-AK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWe-0002Qp-7l
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcWf-0007at-4M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:37 +0000
X-Inumbo-ID: e8ea8bc7-07e0-4ddd-ae8b-d9c97e483920
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e8ea8bc7-07e0-4ddd-ae8b-d9c97e483920;
	Fri, 30 Oct 2020 22:05:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G+Abzzdad1XYrhx20Ekij7WJPAcfpQ/W06MseaIm6hY=; b=nJhLTpmrOEAy/VRke1ZplWkt3d
	Hd29i7GnMN+ifp0/ADkt5fgL8zMRVOk5Mk4CDFv3Hz1/0+EEs6k9NsBfNoOZBlCa+yPLzHlYGV5il
	dljThiUXrgEN1C96PPbqbKvmJn6eV6waY7w5HJkGIovHenhh4XejG0/CmVyytle6FUUY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWe-0004SV-AK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWe-0002Qp-7l
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] msf2: Unbreak device-list-properties for "msf-soc"
Message-Id: <E1kYcWe-0002Qp-7l@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:36 +0000

commit 2b0650205b71c2aa8bf6f877a8333ef25bf288b2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 15 16:04:39 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:40:54 2020 +0200

    msf2: Unbreak device-list-properties for "msf-soc"
    
    Watch this:
    
        $ qemu-system-aarch64 -M ast2600-evb -S -display none -qmp stdio
        {"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 5}, "package": "v5.0.0-2464-g3a9163af4e"}, "capabilities": ["oob"]}}
        {"execute": "qmp_capabilities"}
        {"return": {}}
        {"execute": "device-list-properties", "arguments": {"typename": "msf2-soc"}}
        Unsupported NIC model: ftgmac100
        armbru@dusky:~/work/images$ echo $?
        1
    
    This is what breaks "make check SPEED=slow".
    
    Root cause is m2sxxx_soc_initfn()'s messing with nd_table[] via
    qemu_check_nic_model().  That's wrong.
    
    We fixed the exact same bug for device "allwinner-a10" in commit
    8aabc5437b "hw/arm/allwinner-a10: Do not use nd_table in instance_init
    function".  Fix this instance the same way: move the offending code to
    m2sxxx_soc_realize(), where it's less wrong, and add a FIXME comment.
    
    Fixes: 05b7374a58 ("msf2: Add EMAC block to SmartFusion2 SoC")
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200715140440.3540942-2-armbru@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/msf2-soc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 16bb7c9916..33ea7df342 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -82,10 +82,6 @@ static void m2sxxx_soc_initfn(Object *obj)
     }
 
     object_initialize_child(obj, "emac", &s->emac, TYPE_MSS_EMAC);
-    if (nd_table[0].used) {
-        qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
-        qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
-    }
 }
 
 static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
@@ -187,6 +183,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
         g_free(bus_name);
     }
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
+    if (nd_table[0].used) {
+        qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
+        qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
+    }
     dev = DEVICE(&s->emac);
     object_property_set_link(OBJECT(&s->emac), "ahb-bus",
                              OBJECT(get_system_memory()), &error_abort);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16490.40626 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWq-0007cs-OR; Fri, 30 Oct 2020 22:05:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16490.40626; Fri, 30 Oct 2020 22:05:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcWq-0007ck-LM; Fri, 30 Oct 2020 22:05:48 +0000
Received: by outflank-mailman (input) for mailman id 16490;
 Fri, 30 Oct 2020 22:05:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcWp-0007cb-EZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 16760368-85bb-4d3c-9aef-20e93f279a36;
 Fri, 30 Oct 2020 22:05:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWo-0004TH-Dw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWo-0002Rd-DB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcWp-0007cb-EZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:47 +0000
X-Inumbo-ID: 16760368-85bb-4d3c-9aef-20e93f279a36
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 16760368-85bb-4d3c-9aef-20e93f279a36;
	Fri, 30 Oct 2020 22:05:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5ffR4Eu0n+Ih32Hh0/G1LNLcoO0HFPqtFx3wOzJYlQ4=; b=fyV6xT7NXepUHSZq8CN0eLoM2T
	L0KBM0oRtaRleMPsJUhXHT2YIVdF+QqCd4FTfaBnbri9avI7oAmuYDo4OEPnFkdX9U2maBGMkWzM5
	pTuRKhH+VmuKace8RKGJo7RMtZiIe8DMJPUANsLOHjVCaTNDy5BQr4iBoHZ+36N0HtVg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWo-0004TH-Dw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWo-0002Rd-DB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw: Mark nd_table[] misuse in realize methods FIXME
Message-Id: <E1kYcWo-0002Rd-DB@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:46 +0000

commit 7ad36e2e241bd924f774a1f9fb208c102da58e50
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 15 16:04:40 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Tue Jul 21 08:41:15 2020 +0200

    hw: Mark nd_table[] misuse in realize methods FIXME
    
    nd_table[] contains NIC configuration for boards to pick up.  Device
    code has no business looking there.  Several devices do it anyway.
    Two of them already have a suitable FIXME comment: "allwinner-a10" and
    "msf2-soc".  Copy it to the others: "allwinner-h3", "xlnx-versal",
    "xlnx,zynqmp", "sparc32-ledma", "riscv.sifive.u.soc".
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200715140440.3540942-3-armbru@redhat.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/allwinner-h3.c | 1 +
 hw/arm/xlnx-versal.c  | 1 +
 hw/arm/xlnx-zynqmp.c  | 1 +
 hw/dma/sparc32_dma.c  | 1 +
 hw/riscv/sifive_u.c   | 1 +
 5 files changed, 5 insertions(+)

diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 8e09468e86..ff92ded82c 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -358,6 +358,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
                               "sd-bus");
 
     /* EMAC */
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     if (nd_table[0].used) {
         qemu_check_nic_model(&nd_table[0], TYPE_AW_SUN8I_EMAC);
         qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index ead038b971..e3aa4bd1e5 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -160,6 +160,7 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
         object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
                                 TYPE_CADENCE_GEM);
         dev = DEVICE(&s->lpd.iou.gem[i]);
+        /* FIXME use qdev NIC properties instead of nd_table[] */
         if (nd->used) {
             qemu_check_nic_model(nd, "cadence_gem");
             qdev_set_nic_properties(dev, nd);
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 772cfa3771..5855e5d5bf 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -455,6 +455,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
         NICInfo *nd = &nd_table[i];
 
+        /* FIXME use qdev NIC properties instead of nd_table[] */
         if (nd->used) {
             qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
             qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 9459178866..bcd1626fbd 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -341,6 +341,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
     DeviceState *d;
     NICInfo *nd = &nd_table[0];
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     qemu_check_nic_model(nd, TYPE_LANCE);
 
     d = qdev_new(TYPE_LANCE);
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 19a976c9a6..e5682c38a9 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -714,6 +714,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp)
     }
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->otp), 0, memmap[SIFIVE_U_OTP].base);
 
+    /* FIXME use qdev NIC properties instead of nd_table[] */
     if (nd->used) {
         qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
         qdev_set_nic_properties(DEVICE(&s->gem), nd);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:05:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:05:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16491.40630 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcX1-0007eJ-Rm; Fri, 30 Oct 2020 22:05:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16491.40630; Fri, 30 Oct 2020 22:05:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcX1-0007eC-Oe; Fri, 30 Oct 2020 22:05:59 +0000
Received: by outflank-mailman (input) for mailman id 16491;
 Fri, 30 Oct 2020 22:05:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcX1-0007e5-0B
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 4648c90d-af1b-4acc-a66c-0142c181622e;
 Fri, 30 Oct 2020 22:05:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWy-0004TP-IQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcWy-0002SK-HA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcX1-0007e5-0B
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:59 +0000
X-Inumbo-ID: 4648c90d-af1b-4acc-a66c-0142c181622e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 4648c90d-af1b-4acc-a66c-0142c181622e;
	Fri, 30 Oct 2020 22:05:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RjcLagx1Ey9GzOCg7O0MDFI1kjIl/hiukEjao5V4x3g=; b=gwPa201pSfJuBiKgkagOhk8w/M
	9j06UajwRmbvtYmqvCSxCExkbV9I3xVjq0dCDIVpYD3D1pm0gFFeEIGJSh4NNMAL7T4MRVDrvocHe
	A0lCEqiNqvdgzAasAKOxqXhTw6IgWEKO1a6b+NkLPSvVEZGEWgmkyj9jN5vWww3LYwac=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWy-0004TP-IQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcWy-0002SK-HA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:05:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-21' into staging
Message-Id: <E1kYcWy-0002SK-HA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:05:56 +0000

commit 90218a9a393c7925f330e7dcc08658e2a01d3bd4
Merge: af3d69058e09bede9900f266a618ed11f76f49f3 7ad36e2e241bd924f774a1f9fb208c102da58e50
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 10:24:38 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 10:24:38 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-07-21' into staging
    
    * Fix memory leak in fuzzer
    * Fuzzer documentation updates
    * Some other minor fuzzer updates
    * Fix "make check-qtest SPEED=slow" (bug in msf2 instance_init)
    
    # gpg: Signature made Tue 21 Jul 2020 07:48:10 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-07-21:
      hw: Mark nd_table[] misuse in realize methods FIXME
      msf2: Unbreak device-list-properties for "msf-soc"
      MAINTAINERS: Extend the device fuzzing section
      docs/fuzz: add instructions for generating a coverage report
      docs/fuzz: add information about useful libFuzzer flags
      docs/fuzz: describe building fuzzers with enable-sanitizers
      fuzz: build without AddressSanitizer, by default
      gitlab-ci.yml: Add oss-fuzz build tests
      fuzz: Fix leak when assembling datadir path string
      scripts/oss-fuzz: Limit target list to i386-softmmu
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml            | 22 ++++++++---------
 MAINTAINERS               |  2 ++
 configure                 | 10 ++++----
 docs/devel/fuzzing.txt    | 63 +++++++++++++++++++++++++++++++++++++++++++++--
 hw/arm/allwinner-h3.c     |  1 +
 hw/arm/msf2-soc.c         |  9 ++++---
 hw/arm/xlnx-versal.c      |  1 +
 hw/arm/xlnx-zynqmp.c      |  1 +
 hw/dma/sparc32_dma.c      |  1 +
 hw/riscv/sifive_u.c       |  1 +
 scripts/oss-fuzz/build.sh |  2 +-
 tests/qtest/fuzz/fuzz.c   | 12 +++++----
 12 files changed, 96 insertions(+), 29 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:06:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:06:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16492.40634 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXA-0007fV-TI; Fri, 30 Oct 2020 22:06:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16492.40634; Fri, 30 Oct 2020 22:06:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXA-0007fN-QK; Fri, 30 Oct 2020 22:06:08 +0000
Received: by outflank-mailman (input) for mailman id 16492;
 Fri, 30 Oct 2020 22:06:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcX9-0007fG-PJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3a5967e8-9b65-4edf-a7a2-0fe1893bbdd3;
 Fri, 30 Oct 2020 22:06:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcX8-0004Tk-Uh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcX8-0002Tp-Tn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcX9-0007fG-PJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:07 +0000
X-Inumbo-ID: 3a5967e8-9b65-4edf-a7a2-0fe1893bbdd3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3a5967e8-9b65-4edf-a7a2-0fe1893bbdd3;
	Fri, 30 Oct 2020 22:06:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DqrnrI/061cYImsCki8nLS0hf7/ihR1gZ5SRrvRu2J4=; b=GQsKQEbnDCGgyhhoABB0SfWefD
	be5tB2kd6pfpeWRF4CqnNwgH/c2LrK1rCnOVWL2JUU33USPhxF7uHEMjSHVxCPRHDFcTDipbzJ2/+
	TL6ycY8SDRVXl5EfXBiySDlpS2FT5gJa44ikNsT/bocGrmIidvaJuLwsbuEHIhuf8ce0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcX8-0004Tk-Uh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcX8-0002Tp-Tn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/crypto: disallow write sharing by default
Message-Id: <E1kYcX8-0002Tp-Tn@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:06 +0000

commit 662d0c5392a272aa0357aa7205e77fa3ca89c316
Author:     Maxim Levitsky <mlevitsk@redhat.com>
AuthorDate: Sun Jul 19 15:20:58 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 10:49:02 2020 +0200

    block/crypto: disallow write sharing by default
    
    My commit 'block/crypto: implement the encryption key management'
    accidently allowed raw luks images to be shared between different
    qemu processes without share-rw=on explicit override.
    Fix that.
    
    Fixes: bbfdae91fb ("block/crypto: implement the encryption key management")
    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1857490
    
    Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20200719122059.59843-2-mlevitsk@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/crypto.c b/block/crypto.c
index 8725c1bc02..0807557763 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -881,7 +881,7 @@ block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c,
      * For backward compatibility, manually share the write
      * and resize permission
      */
-    *nshared |= (BLK_PERM_WRITE | BLK_PERM_RESIZE);
+    *nshared |= shared & (BLK_PERM_WRITE | BLK_PERM_RESIZE);
     /*
      * Since we are not fully a format driver, don't always request
      * the read/resize permission but only when explicitly
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:06:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:06:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16493.40638 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXK-0007gt-Uw; Fri, 30 Oct 2020 22:06:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16493.40638; Fri, 30 Oct 2020 22:06:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXK-0007gl-Rt; Fri, 30 Oct 2020 22:06:18 +0000
Received: by outflank-mailman (input) for mailman id 16493;
 Fri, 30 Oct 2020 22:06:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcXK-0007gc-0m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4753126f-fd27-4011-90ae-24a5d74d7a3b;
 Fri, 30 Oct 2020 22:06:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXJ-0004Ts-2L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXJ-0002Uo-1W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcXK-0007gc-0m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:18 +0000
X-Inumbo-ID: 4753126f-fd27-4011-90ae-24a5d74d7a3b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4753126f-fd27-4011-90ae-24a5d74d7a3b;
	Fri, 30 Oct 2020 22:06:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9v4JDva6TPijQF3bTGbVNCKsablcKXPNZuXslBaFR8o=; b=fiUPZrn1uoxhCi7MCDd4K2rMrQ
	SKOFGiBr/AOvyXCOhzoM6ycIaXTV2nzuaYRZtcFj4BwmysiDQ6+hpcY8wUhMaGU4fuPL/D257nEsU
	omYrzBi+A4k9K9T4kskPeg3aGHykMam94BkHuc5kuhGzLsljgFhc6Kpxz9HSeWX9vh64=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXJ-0004Ts-2L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXJ-0002Uo-1W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests: add testcase for bz #1857490
Message-Id: <E1kYcXJ-0002Uo-1W@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:17 +0000

commit 0fca43de1b617a95f2472691ca1e740932ab2fea
Author:     Maxim Levitsky <mlevitsk@redhat.com>
AuthorDate: Sun Jul 19 15:20:59 2020 +0300
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 10:49:02 2020 +0200

    qemu-iotests: add testcase for bz #1857490
    
    Test that we can't write-share raw luks images by default,
    but we still can with share-rw=on
    
    Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
    Message-Id: <20200719122059.59843-3-mlevitsk@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/296     | 44 +++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/296.out | 12 ++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index ec69ec8974..fb7dec88aa 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -133,6 +133,21 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         )
         self.assert_qmp(result, 'return', {})
 
+
+    ###########################################################################
+    # add virtio-blk consumer for a block device
+    def addImageUser(self, vm, id, disk_id, share_rw=False):
+        result = vm.qmp('device_add', **
+            {
+                'driver': 'virtio-blk',
+                'id': id,
+                'drive': disk_id,
+                'share-rw' : share_rw
+            }
+        )
+
+        iotests.log(result)
+
     # close the encrypted block device
     def closeImageQmp(self, vm, id):
         result = vm.qmp('blockdev-del', **{ 'node-name': id })
@@ -159,7 +174,7 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         vm.run_job('job0')
 
     # test that when the image opened by two qemu processes,
-    # neither of them can update the image
+    # neither of them can update the encryption keys
     def test1(self):
         self.createImg(test_img, self.secrets[0]);
 
@@ -193,6 +208,9 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         os.remove(test_img)
 
 
+    # test that when the image opened by two qemu processes,
+    # even if first VM opens it read-only, the second can't update encryption
+    # keys
     def test2(self):
         self.createImg(test_img, self.secrets[0]);
 
@@ -226,6 +244,30 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
         self.closeImageQmp(self.vm1, "testdev")
         os.remove(test_img)
 
+    # test that two VMs can't open the same luks image by default
+    # and attach it to a guest device
+    def test3(self):
+        self.createImg(test_img, self.secrets[0]);
+
+        self.openImageQmp(self.vm1, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm1, "testctrl", "testdev")
+
+        self.openImageQmp(self.vm2, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm2, "testctrl", "testdev")
+
+
+    # test that two VMs can attach the same luks image to a guest device,
+    # if both use share-rw=on
+    def test4(self):
+        self.createImg(test_img, self.secrets[0]);
+
+        self.openImageQmp(self.vm1, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm1, "testctrl", "testdev", share_rw=True)
+
+        self.openImageQmp(self.vm2, "testdev", test_img, self.secrets[0])
+        self.addImageUser(self.vm2, "testctrl", "testdev", share_rw=True)
+
+
 
 if __name__ == '__main__':
     # support only raw luks since luks encrypted qcow2 is a proper
diff --git a/tests/qemu-iotests/296.out b/tests/qemu-iotests/296.out
index afb6d2d09d..cb2859a15c 100644
--- a/tests/qemu-iotests/296.out
+++ b/tests/qemu-iotests/296.out
@@ -26,8 +26,16 @@ Job failed: Failed to get shared "consistent read" lock
 {"return": {}}
 {"execute": "job-dismiss", "arguments": {"id": "job0"}}
 {"return": {}}
-..
+Formatting 'TEST_DIR/test.img', fmt=luks size=1048576 key-secret=keysec0 iter-time=10
+
+{"return": {}}
+{"error": {"class": "GenericError", "desc": "Failed to get \"write\" lock"}}
+Formatting 'TEST_DIR/test.img', fmt=luks size=1048576 key-secret=keysec0 iter-time=10
+
+{"return": {}}
+{"return": {}}
+....
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 4 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:06:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:06:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16494.40642 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXV-0007i9-07; Fri, 30 Oct 2020 22:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16494.40642; Fri, 30 Oct 2020 22:06:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXU-0007i1-TP; Fri, 30 Oct 2020 22:06:28 +0000
Received: by outflank-mailman (input) for mailman id 16494;
 Fri, 30 Oct 2020 22:06:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcXU-0007hv-7g
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 67b12446-20d4-463b-a51b-86e939ffbfc7;
 Fri, 30 Oct 2020 22:06:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXT-0004U5-5z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXT-0002Vc-5F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcXU-0007hv-7g
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:28 +0000
X-Inumbo-ID: 67b12446-20d4-463b-a51b-86e939ffbfc7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 67b12446-20d4-463b-a51b-86e939ffbfc7;
	Fri, 30 Oct 2020 22:06:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NdWku6s3r88mKpO0WmizdxD7Bk3Ex2p9cjkWJKTY3vQ=; b=wrFpDdTi01ZKiAu7qxxNHbt/S7
	o43utQXAIXyBu+R4Dmpp5OEPz0z+pAudcnL6PW4sheXEQMDBxehdesc87rRJwqvYutNpYj4kwSEaB
	jKAmwNTA7BPFWyMe2pk9J4UL2NAzWsKlk4b7Bv+sKCiKsaHBuE8VIqemQVceVfS46kOY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXT-0004U5-5z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXT-0002Vc-5F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: fix bdrv_aio_cancel() for ENOMEDIUM requests
Message-Id: <E1kYcXT-0002Vc-5F@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:27 +0000

commit 1d719ddc35e9827b6e5df771555874df34301a0d
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Mon Jul 20 11:01:41 2020 +0100
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 21 12:00:38 2020 +0200

    block: fix bdrv_aio_cancel() for ENOMEDIUM requests
    
    bdrv_aio_cancel() calls aio_poll() on the AioContext for the given I/O
    request until it has completed. ENOMEDIUM requests are special because
    there is no BlockDriverState when the drive has no medium!
    
    Define a .get_aio_context() function for BlkAioEmAIOCB requests so that
    bdrv_aio_cancel() can find the AioContext where the completion BH is
    pending. Without this function bdrv_aio_cancel() aborts on ENOMEDIUM
    requests!
    
    libFuzzer triggered the following assertion:
    
      cat << EOF | qemu-system-i386 -M pc-q35-5.0 \
        -nographic -monitor none -serial none \
        -qtest stdio -trace ide\*
      outl 0xcf8 0x8000fa24
      outl 0xcfc 0xe106c000
      outl 0xcf8 0x8000fa04
      outw 0xcfc 0x7
      outl 0xcf8 0x8000fb20
      write 0x0 0x3 0x2780e7
      write 0xe106c22c 0xd 0x1130c218021130c218021130c2
      write 0xe106c218 0x15 0x110010110010110010110010110010110010110010
      EOF
      ide_exec_cmd IDE exec cmd: bus 0x56170a77a2b8; state 0x56170a77a340; cmd 0xe7
      ide_reset IDEstate 0x56170a77a340
      Aborted (core dumped)
    
      (gdb) bt
      #1  0x00007ffff4f93895 in abort () at /lib64/libc.so.6
      #2  0x0000555555dc6c00 in bdrv_aio_cancel (acb=0x555556765550) at block/io.c:2745
      #3  0x0000555555dac202 in blk_aio_cancel (acb=0x555556765550) at block/block-backend.c:1546
      #4  0x0000555555b1bd74 in ide_reset (s=0x555557213340) at hw/ide/core.c:1318
      #5  0x0000555555b1e3a1 in ide_bus_reset (bus=0x5555572132b8) at hw/ide/core.c:2422
      #6  0x0000555555b2aa27 in ahci_reset_port (s=0x55555720eb50, port=2) at hw/ide/ahci.c:650
      #7  0x0000555555b29fd7 in ahci_port_write (s=0x55555720eb50, port=2, offset=44, val=16) at hw/ide/ahci.c:360
      #8  0x0000555555b2a564 in ahci_mem_write (opaque=0x55555720eb50, addr=556, val=16, size=1) at hw/ide/ahci.c:513
      #9  0x000055555598415b in memory_region_write_accessor (mr=0x55555720eb80, addr=556, value=0x7fffffffb838, size=1, shift=0, mask=255, attrs=...) at softmmu/memory.c:483
    
    Looking at bdrv_aio_cancel:
    
    2728 /* async I/Os */
    2729
    2730 void bdrv_aio_cancel(BlockAIOCB *acb)
    2731 {
    2732     qemu_aio_ref(acb);
    2733     bdrv_aio_cancel_async(acb);
    2734     while (acb->refcnt > 1) {
    2735         if (acb->aiocb_info->get_aio_context) {
    2736             aio_poll(acb->aiocb_info->get_aio_context(acb), true);
    2737         } else if (acb->bs) {
    2738             /* qemu_aio_ref and qemu_aio_unref are not thread-safe, so
    2739              * assert that we're not using an I/O thread.  Thread-safe
    2740              * code should use bdrv_aio_cancel_async exclusively.
    2741              */
    2742             assert(bdrv_get_aio_context(acb->bs) == qemu_get_aio_context());
    2743             aio_poll(bdrv_get_aio_context(acb->bs), true);
    2744         } else {
    2745             abort();     <===============
    2746         }
    2747     }
    2748     qemu_aio_unref(acb);
    2749 }
    
    Fixes: 02c50efe08736116048d5fc355043080f4d5859c ("block: Add bdrv_aio_cancel_async")
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Buglink: https://bugs.launchpad.net/qemu/+bug/1878255
    Originally-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20200720100141.129739-1-stefanha@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/block-backend.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/block-backend.c b/block/block-backend.c
index 0bf0188133..3a13cb5f0b 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1394,8 +1394,16 @@ typedef struct BlkAioEmAIOCB {
     bool has_returned;
 } BlkAioEmAIOCB;
 
+static AioContext *blk_aio_em_aiocb_get_aio_context(BlockAIOCB *acb_)
+{
+    BlkAioEmAIOCB *acb = container_of(acb_, BlkAioEmAIOCB, common);
+
+    return blk_get_aio_context(acb->rwco.blk);
+}
+
 static const AIOCBInfo blk_aio_em_aiocb_info = {
     .aiocb_size         = sizeof(BlkAioEmAIOCB),
+    .get_aio_context    = blk_aio_em_aiocb_get_aio_context,
 };
 
 static void blk_aio_complete(BlkAioEmAIOCB *acb)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:06:39 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:06:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16495.40646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXf-0007jR-1c; Fri, 30 Oct 2020 22:06:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16495.40646; Fri, 30 Oct 2020 22:06:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXe-0007jJ-Uv; Fri, 30 Oct 2020 22:06:38 +0000
Received: by outflank-mailman (input) for mailman id 16495;
 Fri, 30 Oct 2020 22:06:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcXe-0007jD-7C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 09c2fed6-8a8f-4045-ae84-b8af3b87aa75;
 Fri, 30 Oct 2020 22:06:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXd-0004UN-A4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXd-0002WU-8n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcXe-0007jD-7C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:38 +0000
X-Inumbo-ID: 09c2fed6-8a8f-4045-ae84-b8af3b87aa75
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 09c2fed6-8a8f-4045-ae84-b8af3b87aa75;
	Fri, 30 Oct 2020 22:06:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VRAju0mJxKZlbplQtkFqKBQBxO43zWY6x51ZtDrMA88=; b=DLVafAkVV5ek6Gk82GBsfipfXy
	iqsmSso1b6pXTdkh0WuEUIIfX6Ol9y+ji9K3gLhM+HskI4l/EobJRSbMTTq41Xdx0L6PQhVKRH2X7
	fCirbksai5cyjw7azAthe37/L3krZ7WbLNlZZ/77hFWnKcbhAATnKbmDjQ4OHRBQ5dt4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXd-0004UN-A4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXd-0002WU-8n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-21' into staging
Message-Id: <E1kYcXd-0002WU-8n@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:37 +0000

commit 98d897eb4b6fb8c637b2b046e1c543bc5a9f2c4e
Merge: 90218a9a393c7925f330e7dcc08658e2a01d3bd4 1d719ddc35e9827b6e5df771555874df34301a0d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 14:03:45 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 14:03:45 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-21' into staging
    
    Block patches for 5.1:
    - Let LUKS images only be shared between VMs if the guest device was
      configured to allow that
    - Fix abort() from bdrv_aio_cancel() for guest devices without a BDS
    
    # gpg: Signature made Tue 21 Jul 2020 12:47:17 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-21:
      block: fix bdrv_aio_cancel() for ENOMEDIUM requests
      qemu-iotests: add testcase for bz #1857490
      block/crypto: disallow write sharing by default
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/block-backend.c      |  8 ++++++++
 block/crypto.c             |  2 +-
 tests/qemu-iotests/296     | 44 +++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/296.out | 12 ++++++++++--
 4 files changed, 62 insertions(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:06:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:06:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16496.40650 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXq-0007lS-3V; Fri, 30 Oct 2020 22:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16496.40650; Fri, 30 Oct 2020 22:06:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcXq-0007lK-0L; Fri, 30 Oct 2020 22:06:50 +0000
Received: by outflank-mailman (input) for mailman id 16496;
 Fri, 30 Oct 2020 22:06:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcXo-0007lB-JG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6c776635-2ee9-48ca-99e7-a717755705bb;
 Fri, 30 Oct 2020 22:06:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXn-0004Uy-L6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXn-0002Xe-KC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcXo-0007lB-JG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:48 +0000
X-Inumbo-ID: 6c776635-2ee9-48ca-99e7-a717755705bb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6c776635-2ee9-48ca-99e7-a717755705bb;
	Fri, 30 Oct 2020 22:06:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jmPKArz2KQrvW6iME4bwrf/KAZZtKWeoStiCxMrLVgQ=; b=dlUHLkHFtX9X74r2f3MGXv65Wi
	JSVVo04Yc4bvHKoHUsexE/yoiBfPSGf0NTdxjDUMjqWaGhvLk6Fz8bOsmvjtrvN09yhBzlr+77sjE
	jgtyNdXb91GL8feJEhztuW0XJtpa9jSrAFkHG/+l3bVl/5xVPY5JbfnE5oF97C4Wqi5I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXn-0004Uy-L6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXn-0002Xe-KC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qapi: Fix visit_type_STRUCT() not to fail for null object
Message-Id: <E1kYcXn-0002Xe-KC@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:47 +0000

commit cbf97d5b799f4bc47b9e825100d1a98d3cf77c80
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 16 17:06:17 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 14:38:23 2020 +0200

    qapi: Fix visit_type_STRUCT() not to fail for null object
    
    To make deallocating partially constructed objects work, the
    visit_type_STRUCT() need to succeed without doing anything when passed
    a null object.
    
    Commit cdd2b228b9 "qapi: Smooth visitor error checking in generated
    code" broke that.  To reproduce, run tests/test-qobject-input-visitor
    with AddressSanitizer:
    
        ==4353==ERROR: LeakSanitizer: detected memory leaks
    
        Direct leak of 16 byte(s) in 1 object(s) allocated from:
            #0 0x7f192d0c5d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
            #1 0x7f192cd21b10 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
            #2 0x556725f6bbee in visit_next_list qapi/qapi-visit-core.c:86
            #3 0x556725f49e15 in visit_type_UserDefOneList tests/test-qapi-visit.c:474
            #4 0x556725f4489b in test_visitor_in_fail_struct_in_list tests/test-qobject-input-visitor.c:1086
            #5 0x7f192cd42f29  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f29)
    
        SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
    
    Test case /visitor/input/fail/struct-in-list feeds a list with a bad
    element to the QObject input visitor.  Visiting that element duly
    fails, and aborts the visit with the list only partially constructed:
    the faulty object is null.  Cleaning up the partially constructed list
    visits that null object, fails, and aborts the visit before the list
    node gets freed.
    
    Fix the the generated visit_type_STRUCT() to succeed for null objects.
    
    Fixes: cdd2b228b973d2a29edf7696ef6e8b08ec329019
    Reported-by: Li Qiang <liq3ea@163.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200716150617.4027356-1-armbru@redhat.com>
    Tested-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
---
 scripts/qapi/visit.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 3fb2f30510..cdabc5fa28 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -249,6 +249,7 @@ bool visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
     if (!*obj) {
         /* incomplete */
         assert(visit_is_dealloc(v));
+        ok = true;
         goto out_obj;
     }
     if (!visit_type_%(c_name)s_members(v, *obj, errp)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16497.40654 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcY0-0007mv-6O; Fri, 30 Oct 2020 22:07:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16497.40654; Fri, 30 Oct 2020 22:07:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcY0-0007mn-3G; Fri, 30 Oct 2020 22:07:00 +0000
Received: by outflank-mailman (input) for mailman id 16497;
 Fri, 30 Oct 2020 22:06:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcXy-0007mc-HJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 219f9cdb-3c95-4c14-a874-0e727c6be2a3;
 Fri, 30 Oct 2020 22:06:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXx-0004V6-Ob
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcXx-0002Yj-Nn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcXy-0007mc-HJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:58 +0000
X-Inumbo-ID: 219f9cdb-3c95-4c14-a874-0e727c6be2a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 219f9cdb-3c95-4c14-a874-0e727c6be2a3;
	Fri, 30 Oct 2020 22:06:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y6iRkUj3Gd9XVank23Dmb2HL2hm5wuJ8XSygAtLsVhU=; b=IY0OugWcStGbq+V6Cqj1MKqTNn
	i6MRtJQwR9Boftd66nMFix1btkoV3sDInWu6u92lq951zLiM10eGeoG1rU1sL2L5Yjcx6OUmaZS+T
	Qc/u5ICaZ7knpyQtb9CAWmE2CWMpuRK5vzxa+sx4PPM99B/q89I/hJzDZ9YnfL7grUpc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXx-0004V6-Ob
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcXx-0002Yj-Nn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:06:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-07-21' into staging
Message-Id: <E1kYcXx-0002Yj-Nn@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:06:57 +0000

commit 8856755eb8075ca6f3dab51c2791c210ebfe6550
Merge: 98d897eb4b6fb8c637b2b046e1c543bc5a9f2c4e cbf97d5b799f4bc47b9e825100d1a98d3cf77c80
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 16:10:38 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 16:10:38 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-07-21' into staging
    
    QAPI patches patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 14:05:05 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qapi-2020-07-21:
      qapi: Fix visit_type_STRUCT() not to fail for null object
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/qapi/visit.py | 1 +
 1 file changed, 1 insertion(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16498.40658 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYA-0007oC-7s; Fri, 30 Oct 2020 22:07:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16498.40658; Fri, 30 Oct 2020 22:07:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYA-0007o4-4l; Fri, 30 Oct 2020 22:07:10 +0000
Received: by outflank-mailman (input) for mailman id 16498;
 Fri, 30 Oct 2020 22:07:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcY9-0007nw-3U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 07220e93-38f9-4b80-a43b-4b2823f03c70;
 Fri, 30 Oct 2020 22:07:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcY8-0004VR-6l
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcY8-0002a9-4f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcY9-0007nw-3U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:09 +0000
X-Inumbo-ID: 07220e93-38f9-4b80-a43b-4b2823f03c70
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 07220e93-38f9-4b80-a43b-4b2823f03c70;
	Fri, 30 Oct 2020 22:07:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WSGzbeVVTdOHUYajnd0MfsJis2JZMmacE6KlELwZ7lY=; b=FyLoJSQ6p0ILLkv1nWU4EjjNeG
	X39wAN3IddyizpEddDUABTfq+sFGJYfA6B0GyPdLj9yr/ol7xYJfTQWeq+H6pcXWQutfi5jXSzUEx
	XNsh0X6XDKmxiL6X1JMAdL874PHoZL/V4z/3kl++9238LXf85NUDxWR0ct9px78qMaVI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcY8-0004VR-6l
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcY8-0002a9-4f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/net: Added plen fix for IPv6
Message-Id: <E1kYcY8-0002a9-4f@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:08 +0000

commit e219d30910d8584868dd5c11df10ba2a1336034c
Author:     Andrew <andrew@daynix.com>
AuthorDate: Thu Jul 16 06:53:24 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 21 21:30:39 2020 +0800

    hw/net: Added plen fix for IPv6
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1708065
    With network backend with 'virtual header' - there was an issue
    in 'plen' field. Overall, during TSO, 'plen' would be changed,
    but with 'vheader' this field should be set to the size of the
    payload itself instead of '0'.
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 23 +++++++++++++++++++++++
 hw/net/net_tx_pkt.h | 14 ++++++++++++++
 include/net/eth.h   |  1 +
 3 files changed, 38 insertions(+)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 331c73cfc0..9560e4a49e 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -626,6 +626,7 @@ bool net_tx_pkt_send(struct NetTxPkt *pkt, NetClientState *nc)
 
     if (pkt->has_virt_hdr ||
         pkt->virt_hdr.gso_type == VIRTIO_NET_HDR_GSO_NONE) {
+        net_tx_pkt_fix_ip6_payload_len(pkt);
         net_tx_pkt_sendv(pkt, nc, pkt->vec,
             pkt->payload_frags + NET_TX_PKT_PL_START_FRAG);
         return true;
@@ -644,3 +645,25 @@ bool net_tx_pkt_send_loopback(struct NetTxPkt *pkt, NetClientState *nc)
 
     return res;
 }
+
+void net_tx_pkt_fix_ip6_payload_len(struct NetTxPkt *pkt)
+{
+    struct iovec *l2 = &pkt->vec[NET_TX_PKT_L2HDR_FRAG];
+    if (eth_get_l3_proto(l2, 1, l2->iov_len) == ETH_P_IPV6) {
+        struct ip6_header *ip6 = (struct ip6_header *) pkt->l3_hdr;
+        /*
+         * TODO: if qemu would support >64K packets - add jumbo option check
+         * something like that:
+         * 'if (ip6->ip6_plen == 0 && !has_jumbo_option(ip6)) {'
+         */
+        if (ip6->ip6_plen == 0) {
+            if (pkt->payload_len <= ETH_MAX_IP_DGRAM_LEN) {
+                ip6->ip6_plen = htons(pkt->payload_len);
+            }
+            /*
+             * TODO: if qemu would support >64K packets
+             * add jumbo option for packets greater then 65,535 bytes
+             */
+        }
+    }
+}
diff --git a/hw/net/net_tx_pkt.h b/hw/net/net_tx_pkt.h
index 212ecc62fc..4ec8bbe9bd 100644
--- a/hw/net/net_tx_pkt.h
+++ b/hw/net/net_tx_pkt.h
@@ -187,4 +187,18 @@ bool net_tx_pkt_parse(struct NetTxPkt *pkt);
 */
 bool net_tx_pkt_has_fragments(struct NetTxPkt *pkt);
 
+/**
+ * Fix IPv6 'plen' field.
+ * If ipv6 payload length field is 0 - then there should be Hop-by-Hop
+ * option for packets greater than 65,535.
+ * For packets with a payload less than 65,535: fix 'plen' field.
+ * For backends with vheader, we need just one packet with proper
+ * payload size. For now, qemu drops every packet with size greater 64K
+ * (see net_tx_pkt_send()) so, there is no reason to add jumbo option to ip6
+ * hop-by-hop extension if it's missed
+ *
+ * @pkt            packet
+ */
+void net_tx_pkt_fix_ip6_payload_len(struct NetTxPkt *pkt);
+
 #endif
diff --git a/include/net/eth.h b/include/net/eth.h
index 7f45c678e7..0671be6916 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -186,6 +186,7 @@ struct tcp_hdr {
 
 #define ip6_nxt      ip6_ctlun.ip6_un1.ip6_un1_nxt
 #define ip6_ecn_acc  ip6_ctlun.ip6_un3.ip6_un3_ecn
+#define ip6_plen     ip6_ctlun.ip6_un1.ip6_un1_plen
 
 #define PKT_GET_ETH_HDR(p)        \
     ((struct eth_header *)(p))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16499.40662 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYK-0007pV-9Y; Fri, 30 Oct 2020 22:07:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16499.40662; Fri, 30 Oct 2020 22:07:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYK-0007pN-6S; Fri, 30 Oct 2020 22:07:20 +0000
Received: by outflank-mailman (input) for mailman id 16499;
 Fri, 30 Oct 2020 22:07:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcYJ-0007pD-7g
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 656ad87a-8148-4b22-9d90-c0c46da438b4;
 Fri, 30 Oct 2020 22:07:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYI-0004Vc-BX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYI-0002b7-9h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcYJ-0007pD-7g
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:19 +0000
X-Inumbo-ID: 656ad87a-8148-4b22-9d90-c0c46da438b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 656ad87a-8148-4b22-9d90-c0c46da438b4;
	Fri, 30 Oct 2020 22:07:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yDU+zrkOm9v4P1/XvccuuUG54qwFfXCZj+nHX2nyqvg=; b=NX9RcDLz4SkU0SPGEqFyiuVGd3
	DM5aTWDEkBB6YOktdQmTzlGll7L69NaoMpAi2brd7x0hcHM+VRSk6AHUbUCoq3A/3WDIJU1dEcxkj
	ytjU+OloHit+HEA23DKjUvNqTVZ8GePA79/75iIoJOVhjwVEOP6n9sU6x8P9hwfJlwo4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYI-0004Vc-BX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYI-0002b7-9h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
Message-Id: <E1kYcYI-0002b7-9h@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:18 +0000

commit 5519724a13664b43e225ca05351c60b4468e4555
Author:     Mauro Matteo Cascella <mcascell@redhat.com>
AuthorDate: Fri Jul 10 11:19:41 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 21 21:30:39 2020 +0800

    hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
    
    A buffer overflow issue was reported by Mr. Ziming Zhang, CC'd here. It
    occurs while sending an Ethernet frame due to missing break statements
    and improper checking of the buffer size.
    
    Reported-by: Ziming Zhang <ezrakiez@gmail.com>
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/xgmac.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index 574dd47b41..5bf1b61012 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -220,21 +220,31 @@ static void xgmac_enet_send(XgmacState *s)
         }
         len = (bd.buffer1_size & 0xfff) + (bd.buffer2_size & 0xfff);
 
+        /*
+         * FIXME: these cases of malformed tx descriptors (bad sizes)
+         * should probably be reported back to the guest somehow
+         * rather than simply silently stopping processing, but we
+         * don't know what the hardware does in this situation.
+         * This will only happen for buggy guests anyway.
+         */
         if ((bd.buffer1_size & 0xfff) > 2048) {
             DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
                         "xgmac buffer 1 len on send > 2048 (0x%x)\n",
                          __func__, bd.buffer1_size & 0xfff);
+            break;
         }
         if ((bd.buffer2_size & 0xfff) != 0) {
             DEBUGF_BRK("qemu:%s:ERROR...ERROR...ERROR... -- "
                         "xgmac buffer 2 len on send != 0 (0x%x)\n",
                         __func__, bd.buffer2_size & 0xfff);
+            break;
         }
-        if (len >= sizeof(frame)) {
+        if (frame_size + len >= sizeof(frame)) {
             DEBUGF_BRK("qemu:%s: buffer overflow %d read into %zu "
-                        "buffer\n" , __func__, len, sizeof(frame));
+                        "buffer\n" , __func__, frame_size + len, sizeof(frame));
             DEBUGF_BRK("qemu:%s: buffer1.size=%d; buffer2.size=%d\n",
                         __func__, bd.buffer1_size, bd.buffer2_size);
+            break;
         }
 
         cpu_physical_memory_read(bd.buffer1_addr, ptr, len);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16500.40666 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYU-0007qp-BF; Fri, 30 Oct 2020 22:07:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16500.40666; Fri, 30 Oct 2020 22:07:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYU-0007qg-7z; Fri, 30 Oct 2020 22:07:30 +0000
Received: by outflank-mailman (input) for mailman id 16500;
 Fri, 30 Oct 2020 22:07:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcYT-0007qY-A1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ea6d435d-ac68-4f58-8c39-d52c4b7cac36;
 Fri, 30 Oct 2020 22:07:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYS-0004Vl-F8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYS-0002bz-EM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcYT-0007qY-A1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:29 +0000
X-Inumbo-ID: ea6d435d-ac68-4f58-8c39-d52c4b7cac36
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ea6d435d-ac68-4f58-8c39-d52c4b7cac36;
	Fri, 30 Oct 2020 22:07:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fb0Cf15PE5xxDSwpH/AicDD7nZqgMeAQRQ0sHuykoog=; b=4YRVlvo/BtBqfBGZUQzthYqO2i
	LjcccvpnvkoVePbWfmCQhQhk7ooCUpXOhcL1oSt0Sc+1xAFysoIkV5WGHpUWZKp+9gJq865OWj7BS
	FaJDTA9++V6xkMB7eRl2ffYDDyWY1xBlYNjEQPF0+64hJqVctq7DWfb1ZUPqWgNn8aDs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYS-0004Vl-F8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYS-0002bz-EM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYcYS-0002bz-EM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:28 +0000

commit 5252220dbf006969fab377d7ab42c6704d833e8a
Merge: 8856755eb8075ca6f3dab51c2791c210ebfe6550 5519724a13664b43e225ca05351c60b4468e4555
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 16:50:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 16:50:42 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Tue 21 Jul 2020 14:31:13 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()
      hw/net: Added plen fix for IPv6
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/net_tx_pkt.c | 23 +++++++++++++++++++++++
 hw/net/net_tx_pkt.h | 14 ++++++++++++++
 hw/net/xgmac.c      | 14 ++++++++++++--
 include/net/eth.h   |  1 +
 4 files changed, 50 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16501.40670 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYf-0007sg-CR; Fri, 30 Oct 2020 22:07:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16501.40670; Fri, 30 Oct 2020 22:07:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYf-0007sY-9V; Fri, 30 Oct 2020 22:07:41 +0000
Received: by outflank-mailman (input) for mailman id 16501;
 Fri, 30 Oct 2020 22:07:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcYd-0007sN-S8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 29b25927-8c82-4175-be65-d3559e019c10;
 Fri, 30 Oct 2020 22:07:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYc-0004Y4-RI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYc-0002eo-QS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcYd-0007sN-S8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:39 +0000
X-Inumbo-ID: 29b25927-8c82-4175-be65-d3559e019c10
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 29b25927-8c82-4175-be65-d3559e019c10;
	Fri, 30 Oct 2020 22:07:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YOLAPS970cxgNxvzRdRlaD6Kn36f9eXd4sOoRhqzJ7o=; b=5PbPM7vtJLyIbTwtVz2LRKBSx9
	WJtCgDYwnFlwXtl7KI/+K/T/P5m5U8wyInw4pBVoknBsnyZUQEMitQHdig1kPvc2qW+buAdYLdq+9
	SuiWkI7/JSMk5zvRrBRVvwHhODYntSW0W6pYmwxsG5lF23OB5TqJEsZDDsaF4KKZYs98=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYc-0004Y4-RI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYc-0002eo-QS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] xhci: fix valid.max_access_size to access address registers
Message-Id: <E1kYcYc-0002eo-QS@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:38 +0000

commit 8e67fda2dd6202ccec093fda561107ba14830a17
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Tue Jul 21 10:33:22 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:38 2020 +0200

    xhci: fix valid.max_access_size to access address registers
    
    QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
    64-bit mode access in "runtime" and "operational" MemoryRegionOps.
    
    Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.
    
    XHCI specs:
    "If the xHC supports 64-bit addressing (AC64 = ‘1’), then software
    should write 64-bit registers using only Qword accesses.  If a
    system is incapable of issuing Qword accesses, then writes to the
    64-bit address fields shall be performed using 2 Dword accesses;
    low Dword-first, high-Dword second.  If the xHC supports 32-bit
    addressing (AC64 = ‘0’), then the high Dword of registers containing
    64-bit address fields are unused and software should write addresses
    using only Dword accesses"
    
    The problem has been detected with SLOF, as linux kernel always accesses
    registers using 32-bit access even if AC64 is set and revealed by
    5d971f9e6725 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")
    
    Suggested-by: Alexey Kardashevskiy <aik@au1.ibm.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-id: 20200721083322.90651-1-lvivier@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-xhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index b330e36fe6..67a18fe2b6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3184,7 +3184,7 @@ static const MemoryRegionOps xhci_oper_ops = {
     .read = xhci_oper_read,
     .write = xhci_oper_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
@@ -3200,7 +3200,7 @@ static const MemoryRegionOps xhci_runtime_ops = {
     .read = xhci_runtime_read,
     .write = xhci_runtime_write,
     .valid.min_access_size = 4,
-    .valid.max_access_size = 4,
+    .valid.max_access_size = sizeof(dma_addr_t),
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:07:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:07:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16502.40674 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYp-0007tx-EN; Fri, 30 Oct 2020 22:07:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16502.40674; Fri, 30 Oct 2020 22:07:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYp-0007tp-Az; Fri, 30 Oct 2020 22:07:51 +0000
Received: by outflank-mailman (input) for mailman id 16502;
 Fri, 30 Oct 2020 22:07:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcYo-0007tb-59
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3e4c2222-9de6-491f-b5df-698b121896de;
 Fri, 30 Oct 2020 22:07:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYm-0004YC-W0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYm-0002fj-UX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcYo-0007tb-59
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:50 +0000
X-Inumbo-ID: 3e4c2222-9de6-491f-b5df-698b121896de
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3e4c2222-9de6-491f-b5df-698b121896de;
	Fri, 30 Oct 2020 22:07:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lCiQKtsFmIo+Neh4PQYLHCPiaqGDbb0qhBn1sranM1Y=; b=V7kAaaUNHkTNZC14TzYwAs20ye
	QYlidKphfOgBD4QYE8CkejeLt/YKNs/N4Mdf9ByJTds9GEj8X6UK3zbvePnhM6Gne3PlKG7si57Bw
	+8RW6EzxDLCutra/t7ru9HAzgGX0HavYvUXFigQ/QGfeRDeI4O5ox/pgIGV9LfGPlu60=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYm-0004YC-W0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYm-0002fj-UX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qxl: fix modular builds with dtrace
Message-Id: <E1kYcYm-0002fj-UX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:48 +0000

commit d97df4b84bc42613cf9a03619de453ebd0be30b7
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 20 12:03:50 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:47 2020 +0200

    qxl: fix modular builds with dtrace
    
    Checking the enable/disable state of tracepoints via
    trace_event_get_state_backends() does not work for modules.
    
    qxl checks the state for a small optimization (avoid g_strndup
    call in case log_buf will not be used anyway), so we can just
    drop that check for modular builds.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-Id: <20200720100352.2477-2-kraxel@redhat.com>
---
 hw/display/qxl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index d5627119ec..11871340e7 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1762,7 +1762,16 @@ async_common:
         qxl_set_mode(d, val, 0);
         break;
     case QXL_IO_LOG:
+#ifdef CONFIG_MODULES
+        /*
+         * FIXME
+         * trace_event_get_state_backends() does not work for modules,
+         * it leads to "undefined symbol: qemu_qxl_io_log_semaphore"
+         */
+        if (true) {
+#else
         if (trace_event_get_state_backends(TRACE_QXL_IO_LOG) || d->guestdebug) {
+#endif
             /* We cannot trust the guest to NUL terminate d->ram->log_buf */
             char *log_buf = g_strndup((const char *)d->ram->log_buf,
                                       sizeof(d->ram->log_buf));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16503.40678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYz-0007wr-FW; Fri, 30 Oct 2020 22:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16503.40678; Fri, 30 Oct 2020 22:08:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcYz-0007wk-Cd; Fri, 30 Oct 2020 22:08:01 +0000
Received: by outflank-mailman (input) for mailman id 16503;
 Fri, 30 Oct 2020 22:07:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcYx-0007wV-Re
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2d307621-987b-46a7-9d95-6c3d22e5d80b;
 Fri, 30 Oct 2020 22:07:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYx-0004YL-3U
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcYx-0002ga-2f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcYx-0007wV-Re
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
X-Inumbo-ID: 2d307621-987b-46a7-9d95-6c3d22e5d80b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2d307621-987b-46a7-9d95-6c3d22e5d80b;
	Fri, 30 Oct 2020 22:07:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iUJ/l8HmDy7N2O3xPilNHqS9EBZ7PdtfugBMVAkkMH8=; b=W838RZg8jwDDiFLSvBquvxFRls
	NJBr4R6U6ShzfeAff7pJZVkbEtNth9+oy8wZabe8P+dxXP+QA5fNSqy9RuMwNDhVOYFWWY1opa/Nb
	B0qV4M/UFtCLsZYOGlitDf5jOmNgtjVuSLp3fc1H9WtfYx5+MiD0A3xTBY1T4FlzSLXc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYx-0004YL-3U
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcYx-0002ga-2f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:07:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] module: ignore NULL type
Message-Id: <E1kYcYx-0002ga-2f@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:07:59 +0000

commit d87350b065128e8156e7aca93e89a1ab9e5fa63d
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jul 20 12:03:51 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Tue Jul 21 10:56:51 2020 +0200

    module: ignore NULL type
    
    Just return in case module_load_qom_one(NULL) is called.
    vga_interface_available() can do that.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Message-Id: <20200720100352.2477-3-kraxel@redhat.com>
---
 util/module.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/util/module.c b/util/module.c
index 90e9bd42c6..0ab00851f0 100644
--- a/util/module.c
+++ b/util/module.c
@@ -275,6 +275,9 @@ void module_load_qom_one(const char *type)
 {
     int i;
 
+    if (!type) {
+        return;
+    }
     if (module_loaded_qom_all) {
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16504.40681 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZ9-0007yM-IF; Fri, 30 Oct 2020 22:08:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16504.40681; Fri, 30 Oct 2020 22:08:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZ9-0007yE-FJ; Fri, 30 Oct 2020 22:08:11 +0000
Received: by outflank-mailman (input) for mailman id 16504;
 Fri, 30 Oct 2020 22:08:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZ8-0007y2-0Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 14b83483-2f64-47be-a22e-fdae13d7a882;
 Fri, 30 Oct 2020 22:08:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZ7-0004Yg-8E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZ7-0002hj-6a
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZ8-0007y2-0Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:10 +0000
X-Inumbo-ID: 14b83483-2f64-47be-a22e-fdae13d7a882
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 14b83483-2f64-47be-a22e-fdae13d7a882;
	Fri, 30 Oct 2020 22:08:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/jbNLabwHpwtTVRzMlHL1/heyT4lELFQNymQDYa47Kk=; b=MYCUWojbElgOVs4ppaYpKCnaem
	0Rb7Nbmz/kC8vZ3JjkrfpcJmQ7TNRDIFED09LFO5Uq50c8xoxONryNzKyVUBy1i48hCqVz6Oo4uGs
	3L29s/31/OxTqoD77SFiiv2IxqHvUbiCtJyzldI2KudhbLbnupDQ2j1EgOOf5uc9gluc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZ7-0004Yg-8E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZ7-0002hj-6a
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200721-pull-request' into staging
Message-Id: <E1kYcZ7-0002hj-6a@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:08:09 +0000

commit a418695e1b177da055d477c4e15ce900c01a94fd
Merge: 5252220dbf006969fab377d7ab42c6704d833e8a d87350b065128e8156e7aca93e89a1ab9e5fa63d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 17:36:14 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 17:36:14 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200721-pull-request' into staging
    
    fixes for xhci and modular builds.
    
    # gpg: Signature made Tue 21 Jul 2020 15:02:33 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200721-pull-request:
      module: ignore NULL type
      qxl: fix modular builds with dtrace
      xhci: fix valid.max_access_size to access address registers
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/display/qxl.c  | 9 +++++++++
 hw/usb/hcd-xhci.c | 4 ++--
 util/module.c     | 3 +++
 3 files changed, 14 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16505.40686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZK-0007zc-Jj; Fri, 30 Oct 2020 22:08:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16505.40686; Fri, 30 Oct 2020 22:08:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZK-0007zU-Gn; Fri, 30 Oct 2020 22:08:22 +0000
Received: by outflank-mailman (input) for mailman id 16505;
 Fri, 30 Oct 2020 22:08:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZJ-0007zN-HF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 91242042-ff72-40f5-bc85-4688826ced80;
 Fri, 30 Oct 2020 22:08:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZH-0004Yq-Kz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZH-0002in-K7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZJ-0007zN-HF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:21 +0000
X-Inumbo-ID: 91242042-ff72-40f5-bc85-4688826ced80
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 91242042-ff72-40f5-bc85-4688826ced80;
	Fri, 30 Oct 2020 22:08:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Dy52a/s0EUixZMDRyajW+hmUl//BC/K69J5ACtJ7jz0=; b=dHEbhZ3q7N1JFb73/jHC+6W2bT
	C/VqdR5Fxvj+FUiTSytuIaJFUI20CI7WQ1t8P7kSMZsklrI4ZmeaumyKk57gaYeQVirNt6XxaZsXh
	M/hVfwXoxKxSX0t8SZa7LfsIKJdJHznTwUDQ1pALvERQYwBh90LTuIErzxMQ7eSB/SBw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZH-0004Yq-Kz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZH-0002in-K7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qom: Change object_get_canonical_path_component() not to malloc
Message-Id: <E1kYcZH-0002in-K7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:08:19 +0000

commit 7a309cc95b862be74711e7a35997daa3f885651a
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:00 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 16:23:43 2020 +0200

    qom: Change object_get_canonical_path_component() not to malloc
    
    object_get_canonical_path_component() returns a malloced copy of a
    property name on success, null on failure.
    
    19 of its 25 callers immediately free the returned copy.
    
    Change object_get_canonical_path_component() to return the property
    name directly.  Since modifying the name would be wrong, adjust the
    return type to const char *.
    
    Drop the free from the 19 callers become simpler, add the g_strdup()
    to the other six.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-4-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
---
 backends/hostmem.c         |  2 +-
 block/throttle-groups.c    |  2 +-
 gdbstub.c                  |  2 +-
 hw/arm/xlnx-zynqmp.c       |  6 ++----
 hw/block/nvme.c            |  5 ++---
 hw/core/machine-qmp-cmds.c |  2 +-
 hw/core/machine.c          |  5 ++---
 hw/mem/nvdimm.c            |  5 ++---
 hw/mem/pc-dimm.c           |  5 ++---
 hw/misc/ivshmem.c          |  5 ++---
 hw/ppc/spapr_drc.c         |  3 +--
 hw/ppc/trace-events        |  2 +-
 hw/virtio/virtio-crypto.c  |  5 ++---
 hw/virtio/virtio-mem.c     |  6 ++----
 hw/virtio/virtio-pmem.c    |  5 ++---
 include/qom/object.h       |  2 +-
 iothread.c                 |  9 ++++-----
 net/net.c                  |  6 ++----
 qom/object.c               |  7 +++----
 qom/qom-hmp-cmds.c         | 11 ++++-------
 scsi/pr-manager-helper.c   |  3 +--
 scsi/pr-manager.c          |  2 +-
 softmmu/memory.c           |  2 +-
 23 files changed, 41 insertions(+), 61 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index c614f1bdc1..4bde00e8e7 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -33,7 +33,7 @@ char *
 host_memory_backend_get_name(HostMemoryBackend *backend)
 {
     if (!backend->use_canonical_path) {
-        return object_get_canonical_path_component(OBJECT(backend));
+        return g_strdup(object_get_canonical_path_component(OBJECT(backend)));
     }
 
     return object_get_canonical_path(OBJECT(backend));
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 03a53c89ea..98fea7fd47 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -771,7 +771,7 @@ static void throttle_group_obj_complete(UserCreatable *obj, Error **errp)
 
     /* set group name to object id if it exists */
     if (!tg->name && tg->parent_obj.parent) {
-        tg->name = object_get_canonical_path_component(OBJECT(obj));
+        tg->name = g_strdup(object_get_canonical_path_component(OBJECT(obj)));
     }
     /* We must have a group name at this point */
     assert(tg->name);
diff --git a/gdbstub.c b/gdbstub.c
index 6950fd243f..f3a318cd7f 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2059,7 +2059,7 @@ static void handle_query_thread_extra(GdbCmdContext *gdb_ctx, void *user_ctx)
         /* Print the CPU model and name in multiprocess mode */
         ObjectClass *oc = object_get_class(OBJECT(cpu));
         const char *cpu_model = object_class_get_name(oc);
-        g_autofree char *cpu_name =
+        const char *cpu_name =
             object_get_canonical_path_component(OBJECT(cpu));
         g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
                         cpu->halted ? "halted " : "running");
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 772cfa3771..e14323c991 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -190,7 +190,7 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
     qdev_prop_set_uint32(DEVICE(&s->rpu_cluster), "cluster-id", 1);
 
     for (i = 0; i < num_rpus; i++) {
-        char *name;
+        const char *name;
 
         object_initialize_child(OBJECT(&s->rpu_cluster), "rpu-cpu[*]",
                                 &s->rpu_cpu[i],
@@ -204,7 +204,6 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
         } else {
             s->boot_cpu_ptr = &s->rpu_cpu[i];
         }
-        g_free(name);
 
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), "reset-hivecs", true,
                                  &error_abort);
@@ -341,7 +340,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
 
     /* Realize APUs before realizing the GIC. KVM requires this.  */
     for (i = 0; i < num_apus; i++) {
-        char *name;
+        const char *name;
 
         object_property_set_int(OBJECT(&s->apu_cpu[i]), "psci-conduit",
                                 QEMU_PSCI_CONDUIT_SMC, &error_abort);
@@ -354,7 +353,6 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
         } else {
             s->boot_cpu_ptr = &s->apu_cpu[i];
         }
-        g_free(name);
 
         object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el3", s->secure,
                                  NULL);
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 1aee042d4c..3426e17e65 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1397,9 +1397,8 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
 
     if (!n->params.cmb_size_mb && n->pmrdev) {
         if (host_memory_backend_is_mapped(n->pmrdev)) {
-            char *path = object_get_canonical_path_component(OBJECT(n->pmrdev));
-            error_setg(errp, "can't use already busy memdev: %s", path);
-            g_free(path);
+            error_setg(errp, "can't use already busy memdev: %s",
+                       object_get_canonical_path_component(OBJECT(n->pmrdev)));
             return;
         }
 
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 2c5da8413d..963088b798 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -315,7 +315,7 @@ static int query_memdev(Object *obj, void *opaque)
 
         m->value = g_malloc0(sizeof(*m->value));
 
-        m->value->id = object_get_canonical_path_component(obj);
+        m->value->id = g_strdup(object_get_canonical_path_component(obj));
         m->value->has_id = !!m->value->id;
 
         m->value->size = object_property_get_uint(obj, "size",
diff --git a/hw/core/machine.c b/hw/core/machine.c
index eb267b828d..2f881d6d75 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1073,9 +1073,8 @@ MemoryRegion *machine_consume_memdev(MachineState *machine,
     MemoryRegion *ret = host_memory_backend_get_memory(backend);
 
     if (memory_region_is_mapped(ret)) {
-        char *path = object_get_canonical_path_component(OBJECT(backend));
-        error_report("memory backend %s can't be used multiple times.", path);
-        g_free(path);
+        error_report("memory backend %s can't be used multiple times.",
+                     object_get_canonical_path_component(OBJECT(backend)));
         exit(EXIT_FAILURE);
     }
     host_memory_backend_set_mapped(backend, true);
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index d0d6e553cf..e1574bc07c 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -137,13 +137,12 @@ static void nvdimm_prepare_memory_region(NVDIMMDevice *nvdimm, Error **errp)
 
     if (size <= nvdimm->label_size || !pmem_size) {
         HostMemoryBackend *hostmem = dimm->hostmem;
-        char *path = object_get_canonical_path_component(OBJECT(hostmem));
 
         error_setg(errp, "the size of memdev %s (0x%" PRIx64 ") is too "
                    "small to contain nvdimm label (0x%" PRIx64 ") and "
                    "aligned PMEM (0x%" PRIx64 ")",
-                   path, memory_region_size(mr), nvdimm->label_size, align);
-        g_free(path);
+                   object_get_canonical_path_component(OBJECT(hostmem)),
+                   memory_region_size(mr), nvdimm->label_size, align);
         return;
     }
 
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 9d3f0b9691..c30351070b 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -179,9 +179,8 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     } else if (host_memory_backend_is_mapped(dimm->hostmem)) {
-        char *path = object_get_canonical_path_component(OBJECT(dimm->hostmem));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(dimm->hostmem)));
         return;
     }
     if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index fc128b25e2..2b6882face 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -1037,9 +1037,8 @@ static void ivshmem_plain_realize(PCIDevice *dev, Error **errp)
         error_setg(errp, "You must specify a 'memdev'");
         return;
     } else if (host_memory_backend_is_mapped(s->hostmem)) {
-        char *path = object_get_canonical_path_component(OBJECT(s->hostmem));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(s->hostmem)));
         return;
     }
 
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 43d12bc33a..fe998d8108 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -513,7 +513,7 @@ static void realize(DeviceState *d, Error **errp)
     SpaprDrc *drc = SPAPR_DR_CONNECTOR(d);
     Object *root_container;
     gchar *link_name;
-    char *child_name;
+    const char *child_name;
 
     trace_spapr_drc_realize(spapr_drc_index(drc));
     /* NOTE: we do this as part of realize/unrealize due to the fact
@@ -529,7 +529,6 @@ static void realize(DeviceState *d, Error **errp)
     trace_spapr_drc_realize_child(spapr_drc_index(drc), child_name);
     object_property_add_alias(root_container, link_name,
                               drc->owner, child_name);
-    g_free(child_name);
     g_free(link_name);
     vmstate_register(VMSTATE_IF(drc), spapr_drc_index(drc), &vmstate_spapr_drc,
                      drc);
diff --git a/hw/ppc/trace-events b/hw/ppc/trace-events
index 9ea620f23c..7c0be4102e 100644
--- a/hw/ppc/trace-events
+++ b/hw/ppc/trace-events
@@ -57,7 +57,7 @@ spapr_drc_detach(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_awaiting_quiesce(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_reset(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_realize(uint32_t index) "drc: 0x%"PRIx32
-spapr_drc_realize_child(uint32_t index, char *childname) "drc: 0x%"PRIx32", child name: %s"
+spapr_drc_realize_child(uint32_t index, const char *childname) "drc: 0x%"PRIx32", child name: %s"
 spapr_drc_realize_complete(uint32_t index) "drc: 0x%"PRIx32
 spapr_drc_unrealize(uint32_t index) "drc: 0x%"PRIx32
 
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index bd9165c565..6da12e315f 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -786,9 +786,8 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'cryptodev' parameter expects a valid object");
         return;
     } else if (cryptodev_backend_is_used(vcrypto->cryptodev)) {
-        char *path = object_get_canonical_path_component(OBJECT(vcrypto->conf.cryptodev));
-        error_setg(errp, "can't use already used cryptodev backend: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already used cryptodev backend: %s",
+                   object_get_canonical_path_component(OBJECT(vcrypto->conf.cryptodev)));
         return;
     }
 
diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 65850530e7..c12e9f79b0 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -409,11 +409,9 @@ static void virtio_mem_device_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'%s' property is not set", VIRTIO_MEM_MEMDEV_PROP);
         return;
     } else if (host_memory_backend_is_mapped(vmem->memdev)) {
-        char *path = object_get_canonical_path_component(OBJECT(vmem->memdev));
-
         error_setg(errp, "'%s' property specifies a busy memdev: %s",
-                   VIRTIO_MEM_MEMDEV_PROP, path);
-        g_free(path);
+                   VIRTIO_MEM_MEMDEV_PROP,
+                   object_get_canonical_path_component(OBJECT(vmem->memdev)));
         return;
     } else if (!memory_region_is_ram(&vmem->memdev->mr) ||
         memory_region_is_rom(&vmem->memdev->mr) ||
diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
index c3374b2f3f..1e0c137497 100644
--- a/hw/virtio/virtio-pmem.c
+++ b/hw/virtio/virtio-pmem.c
@@ -112,9 +112,8 @@ static void virtio_pmem_realize(DeviceState *dev, Error **errp)
     }
 
     if (host_memory_backend_is_mapped(pmem->memdev)) {
-        char *path = object_get_canonical_path_component(OBJECT(pmem->memdev));
-        error_setg(errp, "can't use already busy memdev: %s", path);
-        g_free(path);
+        error_setg(errp, "can't use already busy memdev: %s",
+                   object_get_canonical_path_component(OBJECT(pmem->memdev)));
         return;
     }
 
diff --git a/include/qom/object.h b/include/qom/object.h
index 79c8f838b6..55d925d2c8 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1462,7 +1462,7 @@ Object *object_get_internal_root(void);
  * path is the path within the composition tree starting from the root.
  * %NULL if the object doesn't have a parent (and thus a canonical path).
  */
-char *object_get_canonical_path_component(const Object *obj);
+const char *object_get_canonical_path_component(const Object *obj);
 
 /**
  * object_get_canonical_path:
diff --git a/iothread.c b/iothread.c
index 0598a6d20d..263ec6e5bc 100644
--- a/iothread.c
+++ b/iothread.c
@@ -165,7 +165,7 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
 {
     Error *local_error = NULL;
     IOThread *iothread = IOTHREAD(obj);
-    char *name, *thread_name;
+    char *thread_name;
 
     iothread->stopping = false;
     iothread->running = true;
@@ -195,12 +195,11 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
     /* This assumes we are called from a thread with useful CPU affinity for us
      * to inherit.
      */
-    name = object_get_canonical_path_component(OBJECT(obj));
-    thread_name = g_strdup_printf("IO %s", name);
+    thread_name = g_strdup_printf("IO %s",
+                        object_get_canonical_path_component(OBJECT(obj)));
     qemu_thread_create(&iothread->thread, thread_name, iothread_run,
                        iothread, QEMU_THREAD_JOINABLE);
     g_free(thread_name);
-    g_free(name);
 
     /* Wait for initialization to complete */
     while (iothread->thread_id == -1) {
@@ -303,7 +302,7 @@ type_init(iothread_register_types)
 
 char *iothread_get_id(IOThread *iothread)
 {
-    return object_get_canonical_path_component(OBJECT(iothread));
+    return g_strdup(object_get_canonical_path_component(OBJECT(iothread)));
 }
 
 AioContext *iothread_get_aio_context(IOThread *iothread)
diff --git a/net/net.c b/net/net.c
index 7fddcebaa2..bbaedb3c7a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1185,12 +1185,10 @@ void print_net_client(Monitor *mon, NetClientState *nc)
         monitor_printf(mon, "filters:\n");
     }
     QTAILQ_FOREACH(nf, &nc->filters, next) {
-        char *path = object_get_canonical_path_component(OBJECT(nf));
-
-        monitor_printf(mon, "  - %s: type=%s", path,
+        monitor_printf(mon, "  - %s: type=%s",
+                       object_get_canonical_path_component(OBJECT(nf)),
                        object_get_typename(OBJECT(nf)));
         netfilter_print_info(mon, nf);
-        g_free(path);
     }
 }
 
diff --git a/qom/object.c b/qom/object.c
index 76f5f75239..00fdf89b3b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1931,7 +1931,7 @@ object_property_add_const_link(Object *obj, const char *name,
                                 NULL, OBJ_PROP_LINK_DIRECT);
 }
 
-char *object_get_canonical_path_component(const Object *obj)
+const char *object_get_canonical_path_component(const Object *obj)
 {
     ObjectProperty *prop = NULL;
     GHashTableIter iter;
@@ -1947,7 +1947,7 @@ char *object_get_canonical_path_component(const Object *obj)
         }
 
         if (prop->opaque == obj) {
-            return g_strdup(prop->name);
+            return prop->name;
         }
     }
 
@@ -1966,7 +1966,7 @@ char *object_get_canonical_path(const Object *obj)
     }
 
     do {
-        char *component = object_get_canonical_path_component(obj);
+        const char *component = object_get_canonical_path_component(obj);
 
         if (!component) {
             /* A canonical path must be complete, so discard what was
@@ -1978,7 +1978,6 @@ char *object_get_canonical_path(const Object *obj)
 
         newpath = g_strdup_printf("/%s%s", component, path ? path : "");
         g_free(path);
-        g_free(component);
         path = newpath;
         obj = obj->parent;
     } while (obj != root);
diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index aaacadacca..4032c96089 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -96,10 +96,8 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
 static int qom_composition_compare(const void *a, const void *b, void *ignore)
 {
-    g_autofree char *ac = object_get_canonical_path_component(a);
-    g_autofree char *bc = object_get_canonical_path_component(b);
-
-    return g_strcmp0(ac, bc);
+    return g_strcmp0(object_get_canonical_path_component(a),
+                     object_get_canonical_path_component(b));
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
@@ -112,18 +110,17 @@ static int insert_qom_composition_child(Object *obj, void *opaque)
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent)
 {
-    char *name;
+    const char *name;
     GQueue children;
     Object *child;
 
     if (obj == object_get_root()) {
-        name = g_strdup("");
+        name = "";
     } else {
         name = object_get_canonical_path_component(obj);
     }
     monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
                    object_get_typename(obj));
-    g_free(name);
 
     g_queue_init(&children);
     object_child_foreach(obj, insert_qom_composition_child, &children);
diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c
index bf62cbec11..5acccfb4e3 100644
--- a/scsi/pr-manager-helper.c
+++ b/scsi/pr-manager-helper.c
@@ -42,11 +42,10 @@ typedef struct PRManagerHelper {
 
 static void pr_manager_send_status_changed_event(PRManagerHelper *pr_mgr)
 {
-    char *id = object_get_canonical_path_component(OBJECT(pr_mgr));
+    const char *id = object_get_canonical_path_component(OBJECT(pr_mgr));
 
     if (id) {
         qapi_event_send_pr_manager_status_changed(id, !!pr_mgr->ioc);
-        g_free(id);
     }
 }
 
diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c
index 0c866e8698..32b9287e68 100644
--- a/scsi/pr-manager.c
+++ b/scsi/pr-manager.c
@@ -128,7 +128,7 @@ static int query_one_pr_manager(Object *object, void *opaque)
 
     elem = g_new0(PRManagerInfoList, 1);
     info = g_new0(PRManagerInfo, 1);
-    info->id = object_get_canonical_path_component(object);
+    info->id = g_strdup(object_get_canonical_path_component(object));
     info->connected = pr_manager_is_connected(pr_mgr);
     elem->value = info;
     elem->next = NULL;
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 9200b20130..af25987518 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1764,7 +1764,7 @@ const char *memory_region_name(const MemoryRegion *mr)
 {
     if (!mr->name) {
         ((MemoryRegion *)mr)->name =
-            object_get_canonical_path_component(OBJECT(mr));
+            g_strdup(object_get_canonical_path_component(OBJECT(mr)));
     }
     return mr->name;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16506.40690 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZT-00080j-LJ; Fri, 30 Oct 2020 22:08:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16506.40690; Fri, 30 Oct 2020 22:08:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZT-00080b-IJ; Fri, 30 Oct 2020 22:08:31 +0000
Received: by outflank-mailman (input) for mailman id 16506;
 Fri, 30 Oct 2020 22:08:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZS-00080S-H5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id af25a959-c89d-48ba-aca1-76436e966394;
 Fri, 30 Oct 2020 22:08:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZR-0004Yy-Om
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZR-0002jP-Nt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZS-00080S-H5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:30 +0000
X-Inumbo-ID: af25a959-c89d-48ba-aca1-76436e966394
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id af25a959-c89d-48ba-aca1-76436e966394;
	Fri, 30 Oct 2020 22:08:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TPAHZaQ/heFZdWQ4jAZY314r3YYFQW0Fdb9/w8SDl5Q=; b=LqcJSP937shgdX+70vkjrbKiDN
	WRbqhJ69k2esro/w6KhjZVeuQNm+88o5uz2PnMGnSDocznsqMwptEe6aiFI9FUQuqy2jgB8Bnr/5u
	UpTpPBcaF+CVixj5yuOjPgcPqIX9Artz0NBxuHO1qthGu5z75KML9ABQuyvOLlFfprfM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZR-0004Yy-Om
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZR-0002jP-Nt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qom: Document object_get_canonical_path() returns malloced string
Message-Id: <E1kYcZR-0002jP-Nt@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:08:29 +0000

commit 5bd929d2fff068f829688f27b54f2f159ff06eb6
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:01 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 16:23:43 2020 +0200

    qom: Document object_get_canonical_path() returns malloced string
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-5-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/qom/object.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 55d925d2c8..0f3a60617c 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1467,8 +1467,9 @@ const char *object_get_canonical_path_component(const Object *obj);
 /**
  * object_get_canonical_path:
  *
- * Returns: The canonical path for a object.  This is the path within the
- * composition tree starting from the root.
+ * Returns: The canonical path for a object, newly allocated.  This is
+ * the path within the composition tree starting from the root.  Use
+ * g_free() to free it.
  */
 char *object_get_canonical_path(const Object *obj);
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16507.40694 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZe-00082o-NE; Fri, 30 Oct 2020 22:08:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16507.40694; Fri, 30 Oct 2020 22:08:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZe-00082g-Jk; Fri, 30 Oct 2020 22:08:42 +0000
Received: by outflank-mailman (input) for mailman id 16507;
 Fri, 30 Oct 2020 22:08:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZc-00082V-Oq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 436ee8c3-5398-445e-871e-2b5750cef26b;
 Fri, 30 Oct 2020 22:08:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZb-0004ZW-SR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZb-0002k0-Rf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZc-00082V-Oq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:40 +0000
X-Inumbo-ID: 436ee8c3-5398-445e-871e-2b5750cef26b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 436ee8c3-5398-445e-871e-2b5750cef26b;
	Fri, 30 Oct 2020 22:08:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3c85qaPf+wDiLqlXSMTC6IeqOKN1JVEvOILlzzbE81Y=; b=uPttK46XcKdCS4AIAlx49tli1r
	1IMiLUzezN2+2hyoPzCrCVFD+jqUcMXnsDhdIteK5e9t40wJrupWkBUlLl6gAAM3CXkRb5rldllJs
	mWh5cKZycYEBtUPkimyasslfXZoejqsGy14D1aqGQbp40lcJaFRWSI/084sIl/8Ye0HU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZb-0004ZW-SR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZb-0002k0-Rf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qom: Make info qom-tree sort children more efficiently
Message-Id: <E1kYcZb-0002k0-Rf@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:08:39 +0000

commit 0dde9fd12fd39762ff68fca80d2f0a735d66e7bd
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:02:02 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 17:39:37 2020 +0200

    qom: Make info qom-tree sort children more efficiently
    
    Commit e8c9e65816 "qom: Make "info qom-tree" show children sorted"
    sorts children the simple, stupid, quadratic way.  I thought the
    number of children would be small enough for this not to matter.  I
    was wrong: there are outliers with several hundred children, e.g ARM
    machines nuri and smdkc210 each have a node with 513 children.
    
    While n^2 sorting isn't noticeable in normal, human usage even for
    n=513, it can be quite noticeable in certain automated tests.  In
    particular, the sort made device-introspect-test even slower.  Commit
    3e7b80f84d "tests: improve performance of device-introspect-test" just
    fixed that by cutting back its excessive use of "info qom-tree".
    Sorting more efficiently makes sense regardless, so do it.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-6-armbru@redhat.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 qom/qom-hmp-cmds.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c
index 4032c96089..8861a109d5 100644
--- a/qom/qom-hmp-cmds.c
+++ b/qom/qom-hmp-cmds.c
@@ -94,25 +94,23 @@ typedef struct QOMCompositionState {
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent);
 
-static int qom_composition_compare(const void *a, const void *b, void *ignore)
+static int qom_composition_compare(const void *a, const void *b)
 {
-    return g_strcmp0(object_get_canonical_path_component(a),
-                     object_get_canonical_path_component(b));
+    return g_strcmp0(object_get_canonical_path_component(*(Object **)a),
+                     object_get_canonical_path_component(*(Object **)b));
 }
 
 static int insert_qom_composition_child(Object *obj, void *opaque)
 {
-    GQueue *children = opaque;
-
-    g_queue_insert_sorted(children, obj, qom_composition_compare, NULL);
+    g_array_append_val(opaque, obj);
     return 0;
 }
 
 static void print_qom_composition(Monitor *mon, Object *obj, int indent)
 {
+    GArray *children = g_array_new(false, false, sizeof(Object *));
     const char *name;
-    GQueue children;
-    Object *child;
+    int i;
 
     if (obj == object_get_root()) {
         name = "";
@@ -122,11 +120,14 @@ static void print_qom_composition(Monitor *mon, Object *obj, int indent)
     monitor_printf(mon, "%*s/%s (%s)\n", indent, "", name,
                    object_get_typename(obj));
 
-    g_queue_init(&children);
-    object_child_foreach(obj, insert_qom_composition_child, &children);
-    while ((child = g_queue_pop_head(&children))) {
-        print_qom_composition(mon, child, indent + 2);
+    object_child_foreach(obj, insert_qom_composition_child, children);
+    g_array_sort(children, qom_composition_compare);
+
+    for (i = 0; i < children->len; i++) {
+        print_qom_composition(mon, g_array_index(children, Object *, i),
+                              indent + 2);
     }
+    g_array_free(children, TRUE);
 }
 
 void hmp_info_qom_tree(Monitor *mon, const QDict *dict)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:08:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:08:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16508.40699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZo-00084D-R4; Fri, 30 Oct 2020 22:08:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16508.40699; Fri, 30 Oct 2020 22:08:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZo-000841-NY; Fri, 30 Oct 2020 22:08:52 +0000
Received: by outflank-mailman (input) for mailman id 16508;
 Fri, 30 Oct 2020 22:08:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZm-00083q-Tg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 86cb82d9-56bb-4d16-8e22-b4e7a15bc9bd;
 Fri, 30 Oct 2020 22:08:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZm-0004Zh-0J
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZl-0002ka-Vo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZm-00083q-Tg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:50 +0000
X-Inumbo-ID: 86cb82d9-56bb-4d16-8e22-b4e7a15bc9bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 86cb82d9-56bb-4d16-8e22-b4e7a15bc9bd;
	Fri, 30 Oct 2020 22:08:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=l5qa7oJVGhoWMJpy79VR9W5/Af16RfaUd0FtH3oIY9A=; b=wbdLAoRWjhXYyKBqQr9ZipuQDh
	3dor/hPI7KmpvEJaFM4d4aXPwbhopps0MmQva5xX27C6SCjQn6quUHFwsKqrArr/EjgrckyjxErz6
	rCbpO8OE7JV7LkO8ODJ7Xomj8DLvy6GVJzAisnnVjfPBFdDnKuK061qYHymbVuHtk1L4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZm-0004Zh-0J
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZl-0002ka-Vo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:08:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-07-21' into staging
Message-Id: <E1kYcZl-0002ka-Vo@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:08:49 +0000

commit b50dab9ecac442acc1b316e4749dae36a2fe7d61
Merge: a418695e1b177da055d477c4e15ce900c01a94fd 0dde9fd12fd39762ff68fca80d2f0a735d66e7bd
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 18:31:52 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 18:31:52 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-07-21' into staging
    
    QOM patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 16:40:27 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qom-2020-07-21:
      qom: Make info qom-tree sort children more efficiently
      qom: Document object_get_canonical_path() returns malloced string
      qom: Change object_get_canonical_path_component() not to malloc
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 backends/hostmem.c         |  2 +-
 block/throttle-groups.c    |  2 +-
 gdbstub.c                  |  2 +-
 hw/arm/xlnx-zynqmp.c       |  6 ++----
 hw/block/nvme.c            |  5 ++---
 hw/core/machine-qmp-cmds.c |  2 +-
 hw/core/machine.c          |  5 ++---
 hw/mem/nvdimm.c            |  5 ++---
 hw/mem/pc-dimm.c           |  5 ++---
 hw/misc/ivshmem.c          |  5 ++---
 hw/ppc/spapr_drc.c         |  3 +--
 hw/ppc/trace-events        |  2 +-
 hw/virtio/virtio-crypto.c  |  5 ++---
 hw/virtio/virtio-mem.c     |  6 ++----
 hw/virtio/virtio-pmem.c    |  5 ++---
 include/qom/object.h       |  7 ++++---
 iothread.c                 |  9 ++++-----
 net/net.c                  |  6 ++----
 qom/object.c               |  7 +++----
 qom/qom-hmp-cmds.c         | 32 +++++++++++++++-----------------
 scsi/pr-manager-helper.c   |  3 +--
 scsi/pr-manager.c          |  2 +-
 softmmu/memory.c           |  2 +-
 23 files changed, 55 insertions(+), 73 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16509.40701 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZy-00085Y-S4; Fri, 30 Oct 2020 22:09:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16509.40701; Fri, 30 Oct 2020 22:09:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcZy-00085R-PD; Fri, 30 Oct 2020 22:09:02 +0000
Received: by outflank-mailman (input) for mailman id 16509;
 Fri, 30 Oct 2020 22:09:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcZx-00085F-Cl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1a30c5fa-1e36-4241-871b-f8ee687d7581;
 Fri, 30 Oct 2020 22:09:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZw-0004Zr-CN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcZw-0002lk-BY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcZx-00085F-Cl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:01 +0000
X-Inumbo-ID: 1a30c5fa-1e36-4241-871b-f8ee687d7581
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1a30c5fa-1e36-4241-871b-f8ee687d7581;
	Fri, 30 Oct 2020 22:09:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jJbidgTsp0bHeaJIfv8NFfRy8pSAG+t24ZFxlTgoeiA=; b=4siIMi59etnMIgskJ/ZHMIs8FZ
	hZeIWsmL5kXIU4iPRLJ+RH34COTpq/aOQUMGbYw7piwvBo9OU0/beS1PLWjzz2Nx2t3n/BdIcGCBd
	zDM7XIfKmiZ23Kp1uYeVPPffUrbZ/qLw/MLJPRLeTP3nBDjnVlOQbHVpRNxUOO4qmBNM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZw-0004Zr-CN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcZw-0002lk-BY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] file-posix: Handle `EINVAL` fallocate return value
Message-Id: <E1kYcZw-0002lk-BY@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:00 +0000

commit bae127d4dcf6158c5042e2eee9582430839a9967
Author:     Antoine Damhet <antoine.damhet@blade-group.com>
AuthorDate: Fri Jul 17 15:56:04 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 16:28:57 2020 +0200

    file-posix: Handle `EINVAL` fallocate return value
    
    The `detect-zeroes=unmap` option may issue unaligned
    `FALLOC_FL_PUNCH_HOLE` requests, raw block devices can (and will) return
    `EINVAL`, qemu should then write the zeroes to the blockdev instead of
    issuing an `IO_ERROR`.
    
    The problem can be reprodced like this:
    
    $ qemu-io -c 'write -P 0 42 1234' --image-opts driver=host_device,filename=/dev/loop0,detect-zeroes=unmap
    write failed: Invalid argument
    
    Signed-off-by: Antoine Damhet <antoine.damhet@blade-group.com>
    Message-Id: <20200717135603.51180-1-antoine.damhet@blade-group.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index 8cc39a1ef6..9a00d4190a 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1698,7 +1698,11 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
 #ifdef CONFIG_FALLOCATE_PUNCH_HOLE
     int ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
                            aiocb->aio_offset, aiocb->aio_nbytes);
-    if (ret != -ENOTSUP) {
+    switch (ret) {
+    case -ENOTSUP:
+    case -EINVAL:
+        break;
+    default:
         return ret;
     }
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16510.40707 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYca8-00086n-UB; Fri, 30 Oct 2020 22:09:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16510.40707; Fri, 30 Oct 2020 22:09:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYca8-00086f-Qk; Fri, 30 Oct 2020 22:09:12 +0000
Received: by outflank-mailman (input) for mailman id 16510;
 Fri, 30 Oct 2020 22:09:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYca7-00086T-LB
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0690c9e5-5955-4c7d-b556-78e5e14a4788;
 Fri, 30 Oct 2020 22:09:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYca6-0004aF-GT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYca6-0002mn-Fb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYca7-00086T-LB
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:11 +0000
X-Inumbo-ID: 0690c9e5-5955-4c7d-b556-78e5e14a4788
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0690c9e5-5955-4c7d-b556-78e5e14a4788;
	Fri, 30 Oct 2020 22:09:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wOqhOtGb+8bBG/NICzYT8LqK0JCrAJL5Y3yzf7EzlsE=; b=6/e6jP0dclIM8XuDJtx3uz7bIw
	y7dgCLIyX532nfr0NTGtAWuRkgv+D/DQ3HNPWgv4vrq7kZWJ6YZ6bnThhIHsTwPfOZdG/1DLNUS4u
	oy9dRMeJP/b29PW9MsxDAKxg74Caan1zwlESMBzBCfa8Cd10a82MBlYmEMfysnQdcKrg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYca6-0004aF-GT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYca6-0002mn-Fb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow2: Implement v2 zero writes with discard if possible
Message-Id: <E1kYca6-0002mn-Fb@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:10 +0000

commit 61b3043965fe3552ee2684a97e7cc809ca7a71b3
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 21 15:55:19 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 16:28:57 2020 +0200

    qcow2: Implement v2 zero writes with discard if possible
    
    qcow2 version 2 images don't support the zero flag for clusters, so for
    write_zeroes requests, we return -ENOTSUP and get explicit zero buffer
    writes. If the image doesn't have a backing file, we can do better: Just
    discard the respective clusters.
    
    This is relevant for 'qemu-img convert -O qcow2 -n', where qemu-img has
    to assume that the existing target image may contain any data, so it has
    to write zeroes. Without this patch, this results in a fully allocated
    target image, even if the source image was empty.
    
    Reported-by: Nir Soffer <nsoffer@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200721135520.72355-2-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2-cluster.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4b5fc8c4a7..a677ba9f5c 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1797,8 +1797,15 @@ int qcow2_cluster_zeroize(BlockDriverState *bs, uint64_t offset,
     assert(QEMU_IS_ALIGNED(end_offset, s->cluster_size) ||
            end_offset >= bs->total_sectors << BDRV_SECTOR_BITS);
 
-    /* The zero flag is only supported by version 3 and newer */
+    /*
+     * The zero flag is only supported by version 3 and newer. However, if we
+     * have no backing file, we can resort to discard in version 2.
+     */
     if (s->qcow_version < 3) {
+        if (!bs->backing) {
+            return qcow2_cluster_discard(bs, offset, bytes,
+                                         QCOW2_DISCARD_REQUEST, false);
+        }
         return -ENOTSUP;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16511.40709 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcaI-000886-V3; Fri, 30 Oct 2020 22:09:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16511.40709; Fri, 30 Oct 2020 22:09:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcaI-00087y-SE; Fri, 30 Oct 2020 22:09:22 +0000
Received: by outflank-mailman (input) for mailman id 16511;
 Fri, 30 Oct 2020 22:09:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcaH-00087l-HF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ab81b007-4735-4915-b942-1a39e259c011;
 Fri, 30 Oct 2020 22:09:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaG-0004aM-KC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaG-0002nT-JM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcaH-00087l-HF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:21 +0000
X-Inumbo-ID: ab81b007-4735-4915-b942-1a39e259c011
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ab81b007-4735-4915-b942-1a39e259c011;
	Fri, 30 Oct 2020 22:09:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nGNJar/F8S62HMEicvyC4JH68skKkMEVgcsPXxFWtUI=; b=bfmvPSRJ/LW55UtqOdGfeYRRHe
	stuYSXfaL+haj695fgzNy8xdP2kfHMfp8uphReDBAghVTZEDU4i5yPAYTylwpJ1phacpsEjnZT4kN
	5CLka6IKa61QYUMBblO2WE+9t/Q3qeWUH0KSy8sHMKQe3Dl9OaRGVa2xmdX5hKtVxGa0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaG-0004aM-KC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaG-0002nT-JM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Test sparseness for qemu-img convert -n
Message-Id: <E1kYcaG-0002nT-JM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:20 +0000

commit 4a01e27ddcb5921efd68820d05d85ba71293fea6
Author:     Kevin Wolf <kwolf@redhat.com>
AuthorDate: Tue Jul 21 15:55:20 2020 +0200
Commit:     Kevin Wolf <kwolf@redhat.com>
CommitDate: Tue Jul 21 17:44:35 2020 +0200

    iotests: Test sparseness for qemu-img convert -n
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Message-Id: <20200721135520.72355-3-kwolf@redhat.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/122     | 30 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/122.out | 17 +++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index dfd1cd05d6..0f3d4ca851 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -281,6 +281,36 @@ $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG".orig
 
 $QEMU_IMG compare "$TEST_IMG" "$TEST_IMG".orig
 
+echo
+echo '=== -n to an empty image ==='
+echo
+
+TEST_IMG="$TEST_IMG".orig _make_test_img 64M
+
+# Convert with -n, which should not result in a fully allocated image, not even
+# with compat=0.10 (because the target doesn't have a backing file)
+for compat in "1.1" "0.10"; do
+    IMGOPTS="compat=$compat" _make_test_img 64M
+    $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG".orig "$TEST_IMG"
+    $QEMU_IMG map --output=json "$TEST_IMG"
+done
+
+echo
+echo '=== -n to an empty image with a backing file ==='
+echo
+
+TEST_IMG="$TEST_IMG".orig _make_test_img 64M
+TEST_IMG="$TEST_IMG".base _make_test_img 64M
+
+# Convert with -n, which should still not result in a fully allocated image for
+# compat=1.1 (because it can use zero clusters), but it should be fully
+# allocated with compat=0.10
+for compat in "1.1" "0.10"; do
+    IMGOPTS="compat=$compat" _make_test_img -b "$TEST_IMG".base -F $IMGFMT 64M
+    $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG".orig "$TEST_IMG"
+    $QEMU_IMG map --output=json "$TEST_IMG"
+done
+
 echo
 echo '=== -n -B to an image without a backing file ==='
 echo
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index f1f195ed77..3a3e121d57 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -229,6 +229,23 @@ wrote 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 Images are identical.
 
+=== -n to an empty image ===
+
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+
+=== -n to an empty image with a backing file ===
+
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}]
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+[{ "start": 0, "length": 67108864, "depth": 0, "zero": false, "data": true, "offset": 327680}]
+
 === -n -B to an image without a backing file ===
 
 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16512.40714 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcaT-00089M-0X; Fri, 30 Oct 2020 22:09:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16512.40714; Fri, 30 Oct 2020 22:09:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcaS-00089E-Tj; Fri, 30 Oct 2020 22:09:32 +0000
Received: by outflank-mailman (input) for mailman id 16512;
 Fri, 30 Oct 2020 22:09:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcaR-000891-KN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f1613f8e-a2ce-4766-ab6c-4171c929d1b5;
 Fri, 30 Oct 2020 22:09:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaQ-0004aV-O1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaQ-0002oJ-NF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcaR-000891-KN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:31 +0000
X-Inumbo-ID: f1613f8e-a2ce-4766-ab6c-4171c929d1b5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f1613f8e-a2ce-4766-ab6c-4171c929d1b5;
	Fri, 30 Oct 2020 22:09:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S5YzR/F1MhNLxWLG3IilJKqcjofI7OgxykC227bGhKY=; b=W+CxNi3QSwXa1YR2hcWGnHhW0a
	c8JfWNy9rwdgIUvztHll+GZbdcbclIR5NXxHeOhkIQrH9SizyNlFzTCAvvzwsuGD8trTIFy7GINUs
	2JxoG9nExCY7fDBW1qirYsUe0shQ6YK4cIGHoUlfbX2WGqBSLDZxS1vDjUQR6Q+WT0l4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaQ-0004aV-O1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaQ-0002oJ-NF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Message-Id: <E1kYcaQ-0002oJ-NF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:30 +0000

commit 0c1fd2f41f2f63cf3305d6d29d1acd0d960dbd36
Merge: b50dab9ecac442acc1b316e4749dae36a2fe7d61 4a01e27ddcb5921efd68820d05d85ba71293fea6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 19:25:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 19:25:48 2020 +0100

    Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
    
    Block layer patches:
    
    - file-posix: Handle `EINVAL` fallocate return value
    - qemu-img convert -n: Keep qcow2 v2 target sparse
    
    # gpg: Signature made Tue 21 Jul 2020 16:45:28 BST
    # gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
    # gpg:                issuer "kwolf@redhat.com"
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      iotests: Test sparseness for qemu-img convert -n
      qcow2: Implement v2 zero writes with discard if possible
      file-posix: Handle `EINVAL` fallocate return value
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/file-posix.c         |  6 +++++-
 block/qcow2-cluster.c      |  9 ++++++++-
 tests/qemu-iotests/122     | 30 ++++++++++++++++++++++++++++++
 tests/qemu-iotests/122.out | 17 +++++++++++++++++
 4 files changed, 60 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16513.40717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcae-0008B6-1r; Fri, 30 Oct 2020 22:09:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16513.40717; Fri, 30 Oct 2020 22:09:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcad-0008Ay-VG; Fri, 30 Oct 2020 22:09:43 +0000
Received: by outflank-mailman (input) for mailman id 16513;
 Fri, 30 Oct 2020 22:09:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcab-0008Al-Ur
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 915bd762-dece-4418-b973-5629ff28d6c7;
 Fri, 30 Oct 2020 22:09:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaa-0004bI-Rc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcaa-0002p1-Qn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcab-0008Al-Ur
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:41 +0000
X-Inumbo-ID: 915bd762-dece-4418-b973-5629ff28d6c7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 915bd762-dece-4418-b973-5629ff28d6c7;
	Fri, 30 Oct 2020 22:09:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rc8uiLC8ybdTEqG2b0utom4DMr94akOYAa05UyPy1DA=; b=TsFwAvUcbj2whn3Lth+s8xDQju
	B5fMtNDD5m/kcq2v1hvMAjK59e7709pWjt5MgmC6+b13CUY3A/HzRjVvhx08tOh0/vkWS1rNVlRR2
	txCnReO3RdizavX+GfyUGbR08cZJaBGvsq5UM3FXhPRnvJJnRndnO7KP6cixyqxRU6lw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaa-0004bI-Rc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcaa-0002p1-Qn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update version for v5.1.0-rc1 release
Message-Id: <E1kYcaa-0002p1-Qn@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:40 +0000

commit c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 21 20:28:59 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 21 20:28:59 2020 +0100

    Update version for v5.1.0-rc1 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index e427b98203..023d5c9cfb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.90
+5.0.91
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:09:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:09:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16514.40721 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcao-0008CK-3K; Fri, 30 Oct 2020 22:09:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16514.40721; Fri, 30 Oct 2020 22:09:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcao-0008CE-0U; Fri, 30 Oct 2020 22:09:54 +0000
Received: by outflank-mailman (input) for mailman id 16514;
 Fri, 30 Oct 2020 22:09:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcal-0008Bz-UQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 618b2cd2-1b6c-4b1a-b5f9-67b4c1cf2c52;
 Fri, 30 Oct 2020 22:09:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcal-0004bP-6I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcal-0002pu-5V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcal-0008Bz-UQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
X-Inumbo-ID: 618b2cd2-1b6c-4b1a-b5f9-67b4c1cf2c52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 618b2cd2-1b6c-4b1a-b5f9-67b4c1cf2c52;
	Fri, 30 Oct 2020 22:09:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=h+aU5ptG6ChogQVKEayRx8fBo207tnJGHluxULHgsl8=; b=tAuiy6jj0mSIHvmlcDLfrpX2Bm
	qB4Jq1+v7WE2aGXpnpTbLnh08RznKoOCkT1OWkJ+8KmY6wG1Sm4/6FuqT101pqI9vp5TTNc023Dn9
	mlL/35NWPWW4I0aALpIoqEsLrmaB/RvAmBfZ5xUayCjnMjh3L/HzPBq/QKE+iyKACePk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcal-0004bP-6I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcal-0002pu-5V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:09:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qdev: Fix device_add DRIVER,help to print to monitor
Message-Id: <E1kYcal-0002pu-5V@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:09:51 +0000

commit 029afc4e76041e1a320530d97f99122a1b3d5da2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 14 18:01:58 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Tue Jul 21 17:22:44 2020 +0200

    qdev: Fix device_add DRIVER,help to print to monitor
    
    Help on device properties gets printed to stdout instead of the
    monitor.  If you have the monitor anywhere else, no help for you.
    Broken when commit e1043d674d "qdev: use object_property_help()"
    accidentally switched from qemu_printf() to printf().  Switch right
    back.
    
    Fixes: e1043d674d792ff64aebae1a3eafc08b38a8a085
    Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200714160202.3121879-2-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 71ebce19df..e9b7228480 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -300,7 +300,7 @@ int qdev_device_help(QemuOpts *opts)
     }
     g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0);
     for (i = 0; i < array->len; i++) {
-        printf("%s\n", (char *)array->pdata[i]);
+        qemu_printf("%s\n", (char *)array->pdata[i]);
     }
     g_ptr_array_set_free_func(array, g_free);
     g_ptr_array_free(array, true);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16515.40726 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcay-0008TD-5R; Fri, 30 Oct 2020 22:10:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16515.40726; Fri, 30 Oct 2020 22:10:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcay-0008Sp-26; Fri, 30 Oct 2020 22:10:04 +0000
Received: by outflank-mailman (input) for mailman id 16515;
 Fri, 30 Oct 2020 22:10:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcaw-0008PP-V6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 04b9e500-b4fb-45b6-a7c8-29f06cc04d70;
 Fri, 30 Oct 2020 22:10:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcav-0004bW-A2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcav-0002qQ-9G
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcaw-0008PP-V6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:02 +0000
X-Inumbo-ID: 04b9e500-b4fb-45b6-a7c8-29f06cc04d70
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 04b9e500-b4fb-45b6-a7c8-29f06cc04d70;
	Fri, 30 Oct 2020 22:10:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=f/kR5NvkG75erwKVXPbNvmXj+8pkY5dNjMsB6mfpzhE=; b=XbIbIrPyLgbPdGEzwAnTmfBwW0
	QAmmtgLASSd1hHx47PzKiwQRGqLxnXmOqdGFFHtKB4ph7Dywjda7rdj8CZ/qGwL7FnSwpI71aALdU
	Kaxn7iZrI7Ush0QDUzo/RQWnBbRygqgWDjGQtHM5AoVOoVWL+2wszIo++D+gfGO4P2pA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcav-0004bW-A2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcav-0002qQ-9G
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-07-21' into staging
Message-Id: <E1kYcav-0002qQ-9G@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:01 +0000

commit 3cbc8970f55c87cb58699b6dc8fe42998bc79dc0
Merge: c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00 029afc4e76041e1a320530d97f99122a1b3d5da2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 22 09:13:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 22 09:13:46 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2020-07-21' into staging
    
    Monitor patches for 2020-07-21
    
    # gpg: Signature made Tue 21 Jul 2020 16:23:27 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-monitor-2020-07-21:
      qdev: Fix device_add DRIVER,help to print to monitor
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 qdev-monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16516.40730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcb7-0000TS-7w; Fri, 30 Oct 2020 22:10:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16516.40730; Fri, 30 Oct 2020 22:10:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcb7-0000TL-4r; Fri, 30 Oct 2020 22:10:13 +0000
Received: by outflank-mailman (input) for mailman id 16516;
 Fri, 30 Oct 2020 22:10:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcb6-0000TC-HC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 87c148c8-8990-4ef8-911e-35fd83153865;
 Fri, 30 Oct 2020 22:10:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcb5-0004bq-Ob
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcb5-0002rX-ME
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcb6-0000TC-HC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:12 +0000
X-Inumbo-ID: 87c148c8-8990-4ef8-911e-35fd83153865
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 87c148c8-8990-4ef8-911e-35fd83153865;
	Fri, 30 Oct 2020 22:10:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dbD5AFa0u5p7dxhH8bO00uxOWBD6PYQkb6bUE6twBBc=; b=4xA3fbJp/H7wgjz1ULLoPmxUeC
	CbevYHu0haWlNrS2xpb8dndit0glRoTCebfxXCjtnmU8xHL1G/FoPwbQp1SwUvguSqJubj41i1DsK
	zOaK6A+owd9aEWmt8LF8dQSYIU62N799ahuJZh5lO0zaJurjYeoa0F0ovAker/jyeR/w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcb5-0004bq-Ob
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcb5-0002rX-ME
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
Message-Id: <E1kYcb5-0002rX-ME@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:11 +0000

commit a3ad58342a9d88d1baafc0aee39302f79faad480
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Jul 21 15:05:51 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 21 16:47:31 2020 +0200

    hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
    
    Document FWCfgDataGeneratorClass::get_data() return NULL
    on error, and non-NULL on success. This allow us to simplify
    fw_cfg_add_from_generator(). Since we don't need a local
    variable to propagate the error, we can remove the ERRP_GUARD()
    macro.
    
    Suggested-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200721131911.27380-2-philmd@redhat.com>
---
 hw/nvram/fw_cfg.c         | 3 +--
 include/hw/nvram/fw_cfg.h | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 3b1811d3bf..dfa1f2012a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1035,7 +1035,6 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
 void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp)
 {
-    ERRP_GUARD();
     FWCfgDataGeneratorClass *klass;
     GByteArray *array;
     Object *obj;
@@ -1053,7 +1052,7 @@ void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
     }
     klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
     array = klass->get_data(obj, errp);
-    if (*errp) {
+    if (!array) {
         return;
     }
     size = array->len;
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 11feae3177..bbcf405649 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -32,7 +32,9 @@ typedef struct FWCfgDataGeneratorClass {
      * @obj: the object implementing this interface
      * @errp: pointer to a NULL-initialized error object
      *
-     * Returns: reference to a byte array containing the data.
+     * Returns: reference to a byte array containing the data on success,
+     *          or NULL on error.
+     *
      * The caller should release the reference when no longer
      * required.
      */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16517.40735 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbI-0000Uz-AN; Fri, 30 Oct 2020 22:10:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16517.40735; Fri, 30 Oct 2020 22:10:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbI-0000Un-6h; Fri, 30 Oct 2020 22:10:24 +0000
Received: by outflank-mailman (input) for mailman id 16517;
 Fri, 30 Oct 2020 22:10:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcbH-0000Ug-2s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5409eee0-eb4e-4f85-bfbc-ac2e240c3d9e;
 Fri, 30 Oct 2020 22:10:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbF-0004c3-SX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbF-0002s3-Rm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcbH-0000Ug-2s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:23 +0000
X-Inumbo-ID: 5409eee0-eb4e-4f85-bfbc-ac2e240c3d9e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5409eee0-eb4e-4f85-bfbc-ac2e240c3d9e;
	Fri, 30 Oct 2020 22:10:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=meziWoC1XHAhPrVAThTVir0yY9W4J8Ar26YfUqxm/RE=; b=iT0GJ/T96q8Fyb4eXtDfEQ93Le
	1GJYoijZ1Fojk341KUHn8GJZjO/9PIL/c0Km1kAa7E4qVwqjfghYC0OJ22jvsl9PCy7oiOqhVfr49
	vTZgOZyMVT+zaYne+m3AFay9icEiZdvLMrexKIbjAQKo070H5b51yRh5/rKzEISNmtQI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbF-0004c3-SX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbF-0002s3-Rm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
Message-Id: <E1kYcbF-0002s3-Rm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:21 +0000

commit 077195187b47d83418e5fb521c89d7881fab3049
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Mon Jul 20 14:20:15 2020 +0200
Commit:     Philippe Mathieu-Daudé <philmd@redhat.com>
CommitDate: Tue Jul 21 16:47:54 2020 +0200

    hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
    
    Commits b6d7e9b66f..a43770df5d simplified the error propagation.
    Similarly to commit 6fd5bef10b "qom: Make functions taking Error**
    return bool, not void", let fw_cfg_add_from_generator() return a
    boolean value, not void.
    This allow to simplify parse_fw_cfg() and fixes the error handling
    issue reported by Coverity (CID 1430396):
    
      In parse_fw_cfg():
    
        Variable assigned once to a constant guards dead code.
    
        Local variable local_err is assigned only once, to a constant
        value, making it effectively constant throughout its scope.
        If this is not the intent, examine the logic to see if there
        is a missing assignment that would make local_err not remain
        constant.
    
    It's the call of fw_cfg_add_from_generator():
    
            Error *local_err = NULL;
    
            fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
            if (local_err) {
                error_propagate(errp, local_err);
                return -1;
            }
            return 0;
    
    If it fails, parse_fw_cfg() sets an error and returns 0, which is
    wrong. Harmless, because the only caller passes &error_fatal.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Fixes: Coverity CID 1430396: 'Constant' variable guards dead code (DEADCODE)
    Fixes: 6552d87c48 ("softmmu/vl: Let -fw_cfg option take a 'gen_id' argument")
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200721131911.27380-3-philmd@redhat.com>
---
 hw/nvram/fw_cfg.c         | 10 ++++++----
 include/hw/nvram/fw_cfg.h |  4 +++-
 softmmu/vl.c              |  6 +-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index dfa1f2012a..f3a4728288 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -1032,7 +1032,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
     return NULL;
 }
 
-void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp)
 {
     FWCfgDataGeneratorClass *klass;
@@ -1043,20 +1043,22 @@ void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
     obj = object_resolve_path_component(object_get_objects_root(), gen_id);
     if (!obj) {
         error_setg(errp, "Cannot find object ID '%s'", gen_id);
-        return;
+        return false;
     }
     if (!object_dynamic_cast(obj, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE)) {
         error_setg(errp, "Object ID '%s' is not a '%s' subclass",
                    gen_id, TYPE_FW_CFG_DATA_GENERATOR_INTERFACE);
-        return;
+        return false;
     }
     klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
     array = klass->get_data(obj, errp);
     if (!array) {
-        return;
+        return false;
     }
     size = array->len;
     fw_cfg_add_file(s, filename, g_byte_array_free(array, TRUE), size);
+
+    return true;
 }
 
 static void fw_cfg_machine_reset(void *opaque)
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index bbcf405649..f190c428e8 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -304,8 +304,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data,
  * will be used; also, a new entry will be added to the file directory
  * structure residing at key value FW_CFG_FILE_DIR, containing the item name,
  * data size, and assigned selector key value.
+ *
+ * Returns: %true on success, %false on error.
  */
-void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp);
 
 FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
diff --git a/softmmu/vl.c b/softmmu/vl.c
index f476ef89ed..3416241557 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2070,11 +2070,7 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
         size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
         buf = g_memdup(str, size);
     } else if (nonempty_str(gen_id)) {
-        Error *local_err = NULL;
-
-        fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) {
             return -1;
         }
         return 0;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16518.40738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbS-0000W7-C2; Fri, 30 Oct 2020 22:10:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16518.40738; Fri, 30 Oct 2020 22:10:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbS-0000W0-8V; Fri, 30 Oct 2020 22:10:34 +0000
Received: by outflank-mailman (input) for mailman id 16518;
 Fri, 30 Oct 2020 22:10:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcbQ-0000Vq-Tv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 29b7e6f9-510c-481c-8d68-f5d489bb26ec;
 Fri, 30 Oct 2020 22:10:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbQ-0004cC-0I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbP-0002sX-Vh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcbQ-0000Vq-Tv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:32 +0000
X-Inumbo-ID: 29b7e6f9-510c-481c-8d68-f5d489bb26ec
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 29b7e6f9-510c-481c-8d68-f5d489bb26ec;
	Fri, 30 Oct 2020 22:10:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7c34VoVsCIruB7ZLQYV5aKZRJcL/0ok6rmg+d1duxus=; b=XIbADmK1WJIK6uWbvYZdoZkbK8
	B44wK6Q/L96ePoctWfG7k5xyzSeMBkp18ZO9lHft7UYmbdbyl/3+/UBx+gIIgw9ZA/VnPN60Aad3l
	NdqESYqIbEWoXEWOKNTzj/q/O7hOtIBomArvzm10p0XZJldW4s3xA/cl0Nii7cVE8RhM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbQ-0004cC-0I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbP-0002sX-Vh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200721' into staging
Message-Id: <E1kYcbP-0002sX-Vh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:31 +0000

commit d0cc248164961a7ba9d43806feffd76f9f6d7f41
Merge: 3cbc8970f55c87cb58699b6dc8fe42998bc79dc0 077195187b47d83418e5fb521c89d7881fab3049
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 22 12:42:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Jul 22 12:42:25 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/fw_cfg-20200721' into staging
    
    fw_cfg patches
    
    Fixes the DEADCODE issue reported by Coverity (CID 1430396).
    
    CI jobs result:
    . https://gitlab.com/philmd/qemu/-/pipelines/169086301
    
    # gpg: Signature made Tue 21 Jul 2020 18:52:46 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/fw_cfg-20200721:
      hw/nvram/fw_cfg: Let fw_cfg_add_from_generator() return boolean value
      hw/nvram/fw_cfg: Simplify fw_cfg_add_from_generator() error propagation
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/nvram/fw_cfg.c         | 13 +++++++------
 include/hw/nvram/fw_cfg.h |  8 ++++++--
 softmmu/vl.c              |  6 +-----
 3 files changed, 14 insertions(+), 13 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16519.40742 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbc-0000Y2-DM; Fri, 30 Oct 2020 22:10:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16519.40742; Fri, 30 Oct 2020 22:10:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbc-0000Xu-AI; Fri, 30 Oct 2020 22:10:44 +0000
Received: by outflank-mailman (input) for mailman id 16519;
 Fri, 30 Oct 2020 22:10:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcbb-0000Xj-6v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eb546a41-2d56-4bed-8bba-9f9cdec9c864;
 Fri, 30 Oct 2020 22:10:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcba-0004cp-DN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcba-0002tf-CN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcbb-0000Xj-6v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:43 +0000
X-Inumbo-ID: eb546a41-2d56-4bed-8bba-9f9cdec9c864
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eb546a41-2d56-4bed-8bba-9f9cdec9c864;
	Fri, 30 Oct 2020 22:10:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cDgutqTgFtz/z3WAO3tkJPdz5fXgX/7dJGWjq/aFXMc=; b=NBojEkJQjF3N8A7RWcjNLKVSWb
	tSPe/XFE19OpCcCxAKUnR+vI8QCxXx68Im+4EevF6Kz7YtssRClW3Y1B6O5A+tmOvD0x6hiPnqH4H
	gKG6B9GpbM9bp9ywbTfmK2bXqBiPyBrRCfDjLcc2eD4ljybSW8vNh+MZVPwHT4XZFkfc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcba-0004cp-DN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcba-0002tf-CN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu/osdep: Document os_find_datadir() return value
Message-Id: <E1kYcba-0002tf-CN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:42 +0000

commit 7da1d7dcc0c08519b92d8af579fec2e2ea9e60b1
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:10:44 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu/osdep: Document os_find_datadir() return value
    
    Document os_find_datadir() returned data must be freed.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-2-f4bug@amsat.org>
---
 os-posix.c | 3 +++
 os-win32.c | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/os-posix.c b/os-posix.c
index b674b20b1b..3572db3f44 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -84,6 +84,9 @@ void os_setup_signal_handling(void)
  * Find a likely location for support files using the location of the binary.
  * When running from the build tree this will be "$bindir/../pc-bios".
  * Otherwise, this is CONFIG_QEMU_DATADIR.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
  */
 char *os_find_datadir(void)
 {
diff --git a/os-win32.c b/os-win32.c
index 6b86e022f0..c9c3afe648 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -57,7 +57,12 @@ void os_setup_early_signal_handling(void)
     atexit(os_undo_timer_resolution);
 }
 
-/* Look for support files in the same directory as the executable.  */
+/*
+ * Look for support files in the same directory as the executable.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
+ */
 char *os_find_datadir(void)
 {
     return qemu_get_exec_dir();
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:10:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:10:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16520.40746 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbm-0000ZJ-Eq; Fri, 30 Oct 2020 22:10:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16520.40746; Fri, 30 Oct 2020 22:10:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbm-0000ZB-Bq; Fri, 30 Oct 2020 22:10:54 +0000
Received: by outflank-mailman (input) for mailman id 16520;
 Fri, 30 Oct 2020 22:10:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcbl-0000Z3-DG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0ca5a97b-ebc5-43b7-acaa-020372f60679;
 Fri, 30 Oct 2020 22:10:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbk-0004cz-HR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbk-0002uJ-GS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcbl-0000Z3-DG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:53 +0000
X-Inumbo-ID: 0ca5a97b-ebc5-43b7-acaa-020372f60679
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0ca5a97b-ebc5-43b7-acaa-020372f60679;
	Fri, 30 Oct 2020 22:10:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JxBXnolyMYB+CT5b7lsRh/GKJg+4gq584cUIm6Jl5Dw=; b=M+VN9/fB9lAwC3NsOPcV3nhc3G
	9RFGZEGS0dua1HfPnQPI4gJIoXom0Oho0+loMvqZ+O+piZTBL+n+NeqbtP9tSXWDTMBU9ELYIGnv3
	QhMhpXzAJoab4BsOubhQYh9E2WFuYdpmdEcuAG8sy7IQjl1QNjtmAK+UpJwaVNY0D00Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbk-0004cz-HR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbk-0002uJ-GS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:10:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu/osdep: Reword qemu_get_exec_dir() documentation
Message-Id: <E1kYcbk-0002uJ-GS@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:10:52 +0000

commit d450cccc9a4f4409434f4bd0a80270836f6bc3c3
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:14:33 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu/osdep: Reword qemu_get_exec_dir() documentation
    
    This comment is confuse, reword it a bit.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-3-f4bug@amsat.org>
---
 include/qemu/osdep.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 4841b5c6b5..45c217aa28 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -588,7 +588,10 @@ char *qemu_get_local_state_pathname(const char *relative_pathname);
 void qemu_init_exec_dir(const char *argv0);
 
 /* Get the saved exec dir.
- * Caller needs to release the returned string by g_free() */
+ *
+ * The caller is responsible for releasing the value returned with g_free()
+ * after use.
+ */
 char *qemu_get_exec_dir(void);
 
 /**
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16521.40750 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbw-0000aa-Gh; Fri, 30 Oct 2020 22:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16521.40750; Fri, 30 Oct 2020 22:11:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcbw-0000aR-DO; Fri, 30 Oct 2020 22:11:04 +0000
Received: by outflank-mailman (input) for mailman id 16521;
 Fri, 30 Oct 2020 22:11:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcbv-0000aI-DX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 35e9c619-a66f-457f-9b69-9c048f844c25;
 Fri, 30 Oct 2020 22:11:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbu-0004dN-LU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcbu-0002vL-KW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcbv-0000aI-DX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:03 +0000
X-Inumbo-ID: 35e9c619-a66f-457f-9b69-9c048f844c25
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 35e9c619-a66f-457f-9b69-9c048f844c25;
	Fri, 30 Oct 2020 22:11:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ThckVgvl6AwVK0I89TRxkseX42RwOfQ6vmIWZ2kKyk8=; b=HuGxuGrG2XO7VMps+9KEoo6Ahi
	lpA7dI1sVmud8QavpBYGlGlYtO1ABzytORSPX7teU/FdHyCGpHRU0wK+oXCnpxDcEmC9xjhLutwbp
	MhpVIQXBCgrP45CDTl//rsTg0/d4wymxPh4JP6b9HMoaRSojpsyD37RWBMPd2jnyOvVQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbu-0004dN-LU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcbu-0002vL-KW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-common: Document qemu_find_file()
Message-Id: <E1kYcbu-0002vL-KW@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:02 +0000

commit b6c61f69349ca3706c7e757ec1f2df916b70de7a
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:10:10 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    qemu-common: Document qemu_find_file()
    
    Document qemu_find_file(), in particular the returned
    value which must be freed.
    
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-4-f4bug@amsat.org>
---
 include/qemu-common.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index d0142f29ac..bb9496bd80 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -110,6 +110,23 @@ const char *qemu_get_vm_name(void);
 
 #define QEMU_FILE_TYPE_BIOS   0
 #define QEMU_FILE_TYPE_KEYMAP 1
+/**
+ * qemu_find_file:
+ * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
+ *        or QEMU_FILE_TYPE_KEYMAP (for keymaps).
+ * @name: Relative or absolute file name
+ *
+ * If @name exists on disk as an absolute path, or a path relative
+ * to the current directory, then returns @name unchanged.
+ * Otherwise searches for @name file in the data directories, either
+ * configured at build time (DATADIR) or registered with the -L command
+ * line option.
+ *
+ * The caller must use g_free() to free the returned data when it is
+ * no longer required.
+ *
+ * Returns: a path that can access @name, or NULL if no matching file exists.
+ */
 char *qemu_find_file(int type, const char *name);
 
 /* OS specific functions */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16522.40753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcc6-0000br-Hw; Fri, 30 Oct 2020 22:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16522.40753; Fri, 30 Oct 2020 22:11:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcc6-0000bl-Ex; Fri, 30 Oct 2020 22:11:14 +0000
Received: by outflank-mailman (input) for mailman id 16522;
 Fri, 30 Oct 2020 22:11:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcc5-0000bZ-Gz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ee5db96f-9f4a-41c5-accb-6e178327b6c0;
 Fri, 30 Oct 2020 22:11:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcc4-0004dV-P4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcc4-0002vx-OL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcc5-0000bZ-Gz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:13 +0000
X-Inumbo-ID: ee5db96f-9f4a-41c5-accb-6e178327b6c0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ee5db96f-9f4a-41c5-accb-6e178327b6c0;
	Fri, 30 Oct 2020 22:11:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wQZoNvoQr2xeih0r+zCQ26cbhrglg6PBVZ7ooEyazv8=; b=P5HurntD//WJ1eFGPi73pqhePK
	kuiioZncy1vDGbn6nrHFAq4v/b7eW2qvwjMjuITXaBAMiaiZrsVcBEAuwrlmQ80qnVFYGQoy/qoqL
	M5ZD4YOQBUXAYCnRbgApVyBdJeGRK+CW+tVAvmOKa3CV3iu2P1KW9f1H88RPvt66j3xI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcc4-0004dV-P4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcc4-0002vx-OL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/avr/boot: Fix memory leak in avr_load_firmware()
Message-Id: <E1kYcc4-0002vx-OL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:12 +0000

commit 5e29521a82e540552880c3572cb8274bcaa1002c
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Tue Jul 14 18:15:05 2020 +0200
Commit:     Philippe Mathieu-Daudé <f4bug@amsat.org>
CommitDate: Tue Jul 21 16:13:04 2020 +0200

    hw/avr/boot: Fix memory leak in avr_load_firmware()
    
    The value returned by qemu_find_file() must be freed.
    
    This fixes Coverity issue CID 1430449, which points out
    that the memory returned by qemu_find_file() is leaked.
    
    Fixes: Coverity CID 1430449 (RESOURCE_LEAK)
    Fixes: 7dd8f6fde4 ('hw/avr: Add support for loading ELF/raw binaries')
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
    Tested-by: Michael Rolnik <mrolnik@gmail.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20200714164257.23330-5-f4bug@amsat.org>
---
 hw/avr/boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/avr/boot.c b/hw/avr/boot.c
index 6fbcde4061..d16bb3dbe1 100644
--- a/hw/avr/boot.c
+++ b/hw/avr/boot.c
@@ -60,7 +60,7 @@ static const char *avr_elf_e_flags_to_cpu_type(uint32_t flags)
 bool avr_load_firmware(AVRCPU *cpu, MachineState *ms,
                        MemoryRegion *program_mr, const char *firmware)
 {
-    const char *filename;
+    g_autofree char *filename = NULL;
     int bytes_loaded;
     uint64_t entry;
     uint32_t e_flags;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16523.40759 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccG-0000dS-Lo; Fri, 30 Oct 2020 22:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16523.40759; Fri, 30 Oct 2020 22:11:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccG-0000dG-Hx; Fri, 30 Oct 2020 22:11:24 +0000
Received: by outflank-mailman (input) for mailman id 16523;
 Fri, 30 Oct 2020 22:11:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYccF-0000d5-Ju
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2e71f8bd-82ec-4833-9080-593ea0c7aaa9;
 Fri, 30 Oct 2020 22:11:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccE-0004dj-So
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccE-0002wY-S0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYccF-0000d5-Ju
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:23 +0000
X-Inumbo-ID: 2e71f8bd-82ec-4833-9080-593ea0c7aaa9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2e71f8bd-82ec-4833-9080-593ea0c7aaa9;
	Fri, 30 Oct 2020 22:11:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kXNj++ub1z0Tbv3jz5THPQOeSK2IzvDSi/Msx/yQ4qM=; b=Npdwx6394OvpHQVI1GmqDh6ZZF
	2AoXnQGuNInk6PcTJpVUdbMeBXhiujqyoUa1vjmI4pdlmCrkODQrJIfGmlPSBL4+1zHqvey3dIHUI
	Z4pjrFN310pjqxbLWKqCGE/Iwh7y0howoH95y1RowoTvmVCfCXoFm1dKilGc7LF3tlBU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccE-0004dj-So
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccE-0002wY-S0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-20200721' into staging
Message-Id: <E1kYccE-0002wY-S0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:22 +0000

commit 53ce7b47b5bf47db067b81c18c786ed7b792d031
Merge: d0cc248164961a7ba9d43806feffd76f9f6d7f41 5e29521a82e540552880c3572cb8274bcaa1002c
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 11:43:25 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 11:43:25 2020 +0100

    Merge remote-tracking branch 'remotes/philmd-gitlab/tags/avr-20200721' into staging
    
    AVR patches
    
    Fixes a memory leak reported by Coverity (CID 1430449).
    
    CI jobs result:
    . https://gitlab.com/philmd/qemu/-/pipelines/168722631
    
    # gpg: Signature made Tue 21 Jul 2020 19:00:03 BST
    # gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
    # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
    # Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE
    
    * remotes/philmd-gitlab/tags/avr-20200721:
      hw/avr/boot: Fix memory leak in avr_load_firmware()
      qemu-common: Document qemu_find_file()
      qemu/osdep: Reword qemu_get_exec_dir() documentation
      qemu/osdep: Document os_find_datadir() return value
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/avr/boot.c         |  2 +-
 include/qemu-common.h | 17 +++++++++++++++++
 include/qemu/osdep.h  |  5 ++++-
 os-posix.c            |  3 +++
 os-win32.c            |  7 ++++++-
 5 files changed, 31 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16524.40761 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccR-0000el-MW; Fri, 30 Oct 2020 22:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16524.40761; Fri, 30 Oct 2020 22:11:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccR-0000ed-JZ; Fri, 30 Oct 2020 22:11:35 +0000
Received: by outflank-mailman (input) for mailman id 16524;
 Fri, 30 Oct 2020 22:11:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYccQ-0000eT-Ra
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 10f45657-57e9-4d7a-b330-85f4f7ace2bd;
 Fri, 30 Oct 2020 22:11:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccP-0004dr-Cv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccP-0002y6-C8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYccQ-0000eT-Ra
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:34 +0000
X-Inumbo-ID: 10f45657-57e9-4d7a-b330-85f4f7ace2bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 10f45657-57e9-4d7a-b330-85f4f7ace2bd;
	Fri, 30 Oct 2020 22:11:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wiVP6yyw13AdAxV8qELwdSQm1y5DAwsJ+HOe4Qp+kYk=; b=v+KW2TJ2dIofdZN0EsCD6GKlqo
	8vHhbfscaxK6SWN2pjkxAOWbzRVhgvfvXgwA8Dn0vx8zldkKGJ8h32jHstcRJuPnGKvkwqT8oiB4Z
	FRps41L0Ji/Zt5PRuv8KGngCZkyF7lC+/9MqkMKj5FlUHxqBtuHVYnl8Gzm+K3ocA2ZI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccP-0004dr-Cv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccP-0002y6-C8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] acpi: accept byte and word access to core ACPI registers
Message-Id: <E1kYccP-0002y6-C8@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:33 +0000

commit dba04c3488c4699f5afe96f66e448b1d447cf3fb
Author:     Michael Tokarev <mjt@tls.msk.ru>
AuthorDate: Mon Jul 20 19:06:27 2020 +0300
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    acpi: accept byte and word access to core ACPI registers
    
    All ISA registers should be accessible as bytes, words or dwords
    (if wide enough).  Fix the access constraints for acpi-pm-evt,
    acpi-pm-tmr & acpi-cnt registers.
    
    Fixes: 5d971f9e67 (memory: Revert "memory: accept mismatching sizes in memory_region_access_valid")
    Fixes: afafe4bbe0 (apci: switch cnt to memory api)
    Fixes: 77d58b1e47 (apci: switch timer to memory api)
    Fixes: b5a7c024d2 (apci: switch evt to memory api)
    Buglink: https://lore.kernel.org/xen-devel/20200630170913.123646-1-anthony.perard@citrix.com/T/
    Buglink: https://bugs.debian.org/964793
    BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964247
    BugLink: https://bugs.launchpad.net/bugs/1886318
    Reported-By: Simon John <git@the-jedi.co.uk>
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    Message-Id: <20200720160627.15491-1-mjt@msgid.tls.msk.ru>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/acpi/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index f6d9ec4f13..ac06db3450 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -458,7 +458,8 @@ static void acpi_pm_evt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_evt_ops = {
     .read = acpi_pm_evt_read,
     .write = acpi_pm_evt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -527,7 +528,8 @@ static void acpi_pm_tmr_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_tmr_ops = {
     .read = acpi_pm_tmr_read,
     .write = acpi_pm_tmr_write,
-    .valid.min_access_size = 4,
+    .impl.min_access_size = 4,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 4,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
@@ -599,7 +601,8 @@ static void acpi_pm_cnt_write(void *opaque, hwaddr addr, uint64_t val,
 static const MemoryRegionOps acpi_pm_cnt_ops = {
     .read = acpi_pm_cnt_read,
     .write = acpi_pm_cnt_write,
-    .valid.min_access_size = 2,
+    .impl.min_access_size = 2,
+    .valid.min_access_size = 1,
     .valid.max_access_size = 2,
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16525.40766 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccb-0000gF-OX; Fri, 30 Oct 2020 22:11:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16525.40766; Fri, 30 Oct 2020 22:11:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccb-0000g7-LN; Fri, 30 Oct 2020 22:11:45 +0000
Received: by outflank-mailman (input) for mailman id 16525;
 Fri, 30 Oct 2020 22:11:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcca-0000fz-Dr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3b79d553-5210-4205-b174-ce8e2ecb6413;
 Fri, 30 Oct 2020 22:11:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccZ-0004eh-HV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccZ-0002yg-Fx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcca-0000fz-Dr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:44 +0000
X-Inumbo-ID: 3b79d553-5210-4205-b174-ce8e2ecb6413
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3b79d553-5210-4205-b174-ce8e2ecb6413;
	Fri, 30 Oct 2020 22:11:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lH38IxXCHQ7WNtGE4nceipwG0vplO9XxFQBDbYY5ik8=; b=e08e1TWhRbiVfHzP7xTxjJY06d
	ZLU/xZtkNempp1ixp+wapSvBKR5ooYtuMc9BvE8rAyjiM0TkJQwXhB+ZC+75NRgAS7GxGKTv/vxgx
	c4MUqXISq3iqEzD6nFWOt6rEDMBqoTb/neWjCaI3Bfv3CKRrVYGv2B6mFW1l+oXNM2A4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccZ-0004eh-HV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccZ-0002yg-Fx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio: Drop broken and superfluous object_property_set_link()
Message-Id: <E1kYccZ-0002yg-Fx@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:43 +0000

commit cf4e3d000e438d04077a56c401b41f3336a2a09d
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Tue Jul 21 14:11:53 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: Drop broken and superfluous object_property_set_link()
    
    virtio_crypto_pci_realize() and copies the value of vcrypto->vdev's
    property "cryptodev" to vcrypto's property:
    
        object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
                                 NULL);
    
    Since it does so only after realize, this always fails, but the error
    is ignored.
    
    It's actually superfluous: vcrypto's property is an alias of
    vcrypto->vdev's property, created by virtio_instance_init_common().
    
    Drop the call.
    
    Same for virtio_ccw_crypto_realize(), virtio_rng_pci_realize(),
    virtio_ccw_rng_realize().
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200721121153.1128844-1-armbru@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw-crypto.c  | 3 ---
 hw/s390x/virtio-ccw-rng.c     | 3 ---
 hw/virtio/virtio-crypto-pci.c | 2 --
 hw/virtio/virtio-rng-pci.c    | 3 ---
 4 files changed, 11 deletions(-)

diff --git a/hw/s390x/virtio-ccw-crypto.c b/hw/s390x/virtio-ccw-crypto.c
index 570c0333fc..358c74fb4b 100644
--- a/hw/s390x/virtio-ccw-crypto.c
+++ b/hw/s390x/virtio-ccw-crypto.c
@@ -23,9 +23,6 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vdev), "cryptodev",
-                             OBJECT(dev->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_ccw_crypto_instance_init(Object *obj)
diff --git a/hw/s390x/virtio-ccw-rng.c b/hw/s390x/virtio-ccw-rng.c
index 4bb8c16d79..2e3a9da5e8 100644
--- a/hw/s390x/virtio-ccw-rng.c
+++ b/hw/s390x/virtio-ccw-rng.c
@@ -24,9 +24,6 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&ccw_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(dev), "rng", OBJECT(dev->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_ccw_rng_instance_init(Object *obj)
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index f1cc979d33..198f86e08c 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -57,8 +57,6 @@ static void virtio_crypto_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-    object_property_set_link(OBJECT(vcrypto), "cryptodev",
-                             OBJECT(vcrypto->vdev.conf.cryptodev), NULL);
 }
 
 static void virtio_crypto_pci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c
index 2f0b529b62..8afbb4c209 100644
--- a/hw/virtio/virtio-rng-pci.c
+++ b/hw/virtio/virtio-rng-pci.c
@@ -38,9 +38,6 @@ static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
         return;
     }
-
-    object_property_set_link(OBJECT(vrng), "rng", OBJECT(vrng->vdev.conf.rng),
-                             NULL);
 }
 
 static void virtio_rng_pci_class_init(ObjectClass *klass, void *data)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:11:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16526.40770 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccl-0000hX-Q4; Fri, 30 Oct 2020 22:11:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16526.40770; Fri, 30 Oct 2020 22:11:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccl-0000hO-Mr; Fri, 30 Oct 2020 22:11:55 +0000
Received: by outflank-mailman (input) for mailman id 16526;
 Fri, 30 Oct 2020 22:11:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcck-0000hC-Fp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 10f3a15b-1c92-4377-97d5-dcb196830175;
 Fri, 30 Oct 2020 22:11:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccj-0004eo-Lf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYccj-0002zE-KP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcck-0000hC-Fp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:54 +0000
X-Inumbo-ID: 10f3a15b-1c92-4377-97d5-dcb196830175
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 10f3a15b-1c92-4377-97d5-dcb196830175;
	Fri, 30 Oct 2020 22:11:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DYQNYI3irvXb5tQZzNjN1hx5MeXIdzsozJ1yjACQLcU=; b=2o6C+uq5DWMV7xWqmDsbirF+8/
	lObTTWqwun1q29pi+H+b0Dr29Bf2EWcqF9Cczo/bOE9l+0mpqYN9ZGWwl6/KUcDvNnEqZs3QHkt/w
	MtPXXhw951E1pQ0J6zCbHs2/SLNyOxyqtiM+VmObuLW4rMzHbxscz2KnTB9LJsCuASOY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccj-0004eo-Lf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYccj-0002zE-KP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:11:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-balloon: Prevent guest from starting a report when we didn't request one
Message-Id: <E1kYccj-0002zE-KP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:11:53 +0000

commit 20a4da0f23078deeff5ea6d1e12f47d968d7c3c9
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:15 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Prevent guest from starting a report when we didn't request one
    
    Based on code review it appears possible for the driver to force the device
    out of a stopped state when hinting by repeating the last ID it was
    provided.
    
    Prevent this by only allowing a transition to the start state when we are
    in the requested state. This way the driver is only allowed to send one
    descriptor that will transition the device into the start state. All others
    will leave it in the stop state once it has finished.
    
    Fixes: c13c4153f76d ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175115.21935.99563.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index e670f1e595..ce70adcc69 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -526,7 +526,8 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (id == dev->free_page_report_cmd_id) {
+        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
+            id == dev->free_page_report_cmd_id) {
             dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
         } else {
             /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16527.40774 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccv-0000ir-Rh; Fri, 30 Oct 2020 22:12:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16527.40774; Fri, 30 Oct 2020 22:12:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYccv-0000ij-OO; Fri, 30 Oct 2020 22:12:05 +0000
Received: by outflank-mailman (input) for mailman id 16527;
 Fri, 30 Oct 2020 22:12:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYccu-0000ia-Jm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 35e3d9cc-da86-4cc9-bcba-7418f58acee3;
 Fri, 30 Oct 2020 22:12:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcct-0004fB-QH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcct-0002zy-Of
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYccu-0000ia-Jm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:04 +0000
X-Inumbo-ID: 35e3d9cc-da86-4cc9-bcba-7418f58acee3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 35e3d9cc-da86-4cc9-bcba-7418f58acee3;
	Fri, 30 Oct 2020 22:12:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ldu1XwA2Wd+d5BKQcXDgKnp5tOR6fzMFdw63t2sXO28=; b=K7dcOTwVpbLJt/YBfqbixh+h0A
	SrE0EZLiKJ2/tRJlRMPg+dsvHk2gpyXTTm+ZdnFU0MAv9+DmKn7okjogdN14Ure9gfvCOBplxH2ku
	bSm0VPoE6M2wbJVeMFPQzweHPuMsIjhDiu0DJjsv8RHRaKZUIneQ0WqImMyCM4gAi3JY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcct-0004fB-QH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcct-0002zy-Of
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-balloon: Add locking to prevent possible race when starting hinting
Message-Id: <E1kYcct-0002zy-Of@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:03 +0000

commit 1a83e0b9c492a0eaeacd6fbb858fc81d04ab9c3e
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:22 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Add locking to prevent possible race when starting hinting
    
    There is already locking in place when we are stopping free page hinting
    but there is not similar protections in place when we start. I can only
    assume this was overlooked as in most cases the page hinting should not be
    occurring when we are starting the hinting, however there is still a chance
    we could be processing hints by the time we get back around to restarting
    the hinting so we are better off making sure to protect the state with the
    mutex lock rather than just updating the value with no protections.
    
    Based on feedback from Peter Maydell this issue had also been spotted by
    Coverity: CID 1430269
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175122.21935.78013.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index ce70adcc69..6e2d129340 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -592,6 +592,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
         return;
     }
 
+    qemu_mutex_lock(&s->free_page_lock);
+
     if (s->free_page_report_cmd_id == UINT_MAX) {
         s->free_page_report_cmd_id =
                        VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
@@ -600,6 +602,8 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
     }
 
     s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    qemu_mutex_unlock(&s->free_page_lock);
+
     virtio_notify_config(vdev);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16528.40778 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcd6-0000kE-TI; Fri, 30 Oct 2020 22:12:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16528.40778; Fri, 30 Oct 2020 22:12:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcd6-0000k7-Q8; Fri, 30 Oct 2020 22:12:16 +0000
Received: by outflank-mailman (input) for mailman id 16528;
 Fri, 30 Oct 2020 22:12:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcd5-0000ju-9Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d3d8ebba-cd82-4b18-85a9-69252a92db22;
 Fri, 30 Oct 2020 22:12:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcd3-0004fJ-UG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcd3-00030T-TL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcd5-0000ju-9Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:15 +0000
X-Inumbo-ID: d3d8ebba-cd82-4b18-85a9-69252a92db22
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d3d8ebba-cd82-4b18-85a9-69252a92db22;
	Fri, 30 Oct 2020 22:12:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HVvObpfPmQjYXnmIilIbEHAnChhmx7D9DHw3iV94+Bw=; b=wMx3tHkGaaKLvUca4+dLJ2+H9P
	5mrnwWOKzKoOUxU/DgzBnSSgxB8rkUF1caOs6eAxCorzpCfMXp1PkFUFfnLlfjtw6wXpQAFS1Ov89
	Dne/CBf3+LmXPNqS1D/+bskRYjbWBXPPu6sdMqSjmdww7dTZYTfmvKamNmcNebDZoWtE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcd3-0004fJ-UG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcd3-00030T-TL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-balloon: Replace free page hinting references to 'report' with 'hint'
Message-Id: <E1kYcd3-00030T-TL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:13 +0000

commit 3219b42f025d4d7a9c463235e9f937ab38067de3
Author:     Alexander Duyck <alexander.h.duyck@linux.intel.com>
AuthorDate: Mon Jul 20 10:51:28 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio-balloon: Replace free page hinting references to 'report' with 'hint'
    
    Recently a feature named Free Page Reporting was added to the virtio
    balloon. In order to avoid any confusion we should drop the use of the word
    'report' when referring to Free Page Hinting. So what this patch does is go
    through and replace all instances of 'report' with 'hint" when we are
    referring to free page hinting.
    
    Acked-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
    Message-Id: <20200720175128.21935.93927.stgit@localhost.localdomain>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c         | 76 +++++++++++++++++++-------------------
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 6e2d129340..22cb5df717 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -526,22 +526,22 @@ static bool get_free_page_hints(VirtIOBalloon *dev)
             ret = false;
             goto out;
         }
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED &&
-            id == dev->free_page_report_cmd_id) {
-            dev->free_page_report_status = FREE_PAGE_REPORT_S_START;
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED &&
+            id == dev->free_page_hint_cmd_id) {
+            dev->free_page_hint_status = FREE_PAGE_HINT_S_START;
         } else {
             /*
              * Stop the optimization only when it has started. This
              * avoids a stale stop sign for the previous command.
              */
-            if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
-                dev->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+            if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
+                dev->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
             }
         }
     }
 
     if (elem->in_num) {
-        if (dev->free_page_report_status == FREE_PAGE_REPORT_S_START) {
+        if (dev->free_page_hint_status == FREE_PAGE_HINT_S_START) {
             qemu_guest_free_page_hint(elem->in_sg[0].iov_base,
                                       elem->in_sg[0].iov_len);
         }
@@ -567,11 +567,11 @@ static void virtio_ballloon_get_free_page_hints(void *opaque)
         qemu_mutex_unlock(&dev->free_page_lock);
         virtio_notify(vdev, vq);
       /*
-       * Start to poll the vq once the reporting started. Otherwise, continue
+       * Start to poll the vq once the hinting started. Otherwise, continue
        * only when there are entries on the vq, which need to be given back.
        */
     } while (continue_to_get_hints ||
-             dev->free_page_report_status == FREE_PAGE_REPORT_S_START);
+             dev->free_page_hint_status == FREE_PAGE_HINT_S_START);
     virtio_queue_set_notification(vq, 1);
 }
 
@@ -594,14 +594,14 @@ static void virtio_balloon_free_page_start(VirtIOBalloon *s)
 
     qemu_mutex_lock(&s->free_page_lock);
 
-    if (s->free_page_report_cmd_id == UINT_MAX) {
-        s->free_page_report_cmd_id =
-                       VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
+    if (s->free_page_hint_cmd_id == UINT_MAX) {
+        s->free_page_hint_cmd_id =
+                       VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
     } else {
-        s->free_page_report_cmd_id++;
+        s->free_page_hint_cmd_id++;
     }
 
-    s->free_page_report_status = FREE_PAGE_REPORT_S_REQUESTED;
+    s->free_page_hint_status = FREE_PAGE_HINT_S_REQUESTED;
     qemu_mutex_unlock(&s->free_page_lock);
 
     virtio_notify_config(vdev);
@@ -611,18 +611,18 @@ static void virtio_balloon_free_page_stop(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_STOP) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_STOP) {
         /*
          * The lock also guarantees us that the
          * virtio_ballloon_get_free_page_hints exits after the
-         * free_page_report_status is set to S_STOP.
+         * free_page_hint_status is set to S_STOP.
          */
         qemu_mutex_lock(&s->free_page_lock);
         /*
-         * The guest hasn't done the reporting, so host sends a notification
-         * to the guest to actively stop the reporting.
+         * The guest isn't done hinting, so send a notification
+         * to the guest to actively stop the hinting.
          */
-        s->free_page_report_status = FREE_PAGE_REPORT_S_STOP;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_STOP;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
@@ -632,20 +632,20 @@ static void virtio_balloon_free_page_done(VirtIOBalloon *s)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(s);
 
-    if (s->free_page_report_status != FREE_PAGE_REPORT_S_DONE) {
+    if (s->free_page_hint_status != FREE_PAGE_HINT_S_DONE) {
         /* See virtio_balloon_free_page_stop() */
         qemu_mutex_lock(&s->free_page_lock);
-        s->free_page_report_status = FREE_PAGE_REPORT_S_DONE;
+        s->free_page_hint_status = FREE_PAGE_HINT_S_DONE;
         qemu_mutex_unlock(&s->free_page_lock);
         virtio_notify_config(vdev);
     }
 }
 
 static int
-virtio_balloon_free_page_report_notify(NotifierWithReturn *n, void *data)
+virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data)
 {
     VirtIOBalloon *dev = container_of(n, VirtIOBalloon,
-                                      free_page_report_notify);
+                                      free_page_hint_notify);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     PrecopyNotifyData *pnd = data;
 
@@ -703,7 +703,7 @@ static size_t virtio_balloon_config_size(VirtIOBalloon *s)
     if (virtio_has_feature(features, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         return offsetof(struct virtio_balloon_config, poison_val);
     }
-    return offsetof(struct virtio_balloon_config, free_page_report_cmd_id);
+    return offsetof(struct virtio_balloon_config, free_page_hint_cmd_id);
 }
 
 static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
@@ -715,14 +715,14 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
     config.actual = cpu_to_le32(dev->actual);
     config.poison_val = cpu_to_le32(dev->poison_val);
 
-    if (dev->free_page_report_status == FREE_PAGE_REPORT_S_REQUESTED) {
-        config.free_page_report_cmd_id =
-                       cpu_to_le32(dev->free_page_report_cmd_id);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_STOP) {
-        config.free_page_report_cmd_id =
+    if (dev->free_page_hint_status == FREE_PAGE_HINT_S_REQUESTED) {
+        config.free_page_hint_cmd_id =
+                       cpu_to_le32(dev->free_page_hint_cmd_id);
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_STOP) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_STOP);
-    } else if (dev->free_page_report_status == FREE_PAGE_REPORT_S_DONE) {
-        config.free_page_report_cmd_id =
+    } else if (dev->free_page_hint_status == FREE_PAGE_HINT_S_DONE) {
+        config.free_page_hint_cmd_id =
                        cpu_to_le32(VIRTIO_BALLOON_CMD_ID_DONE);
     }
 
@@ -835,14 +835,14 @@ static int virtio_balloon_post_load_device(void *opaque, int version_id)
     return 0;
 }
 
-static const VMStateDescription vmstate_virtio_balloon_free_page_report = {
+static const VMStateDescription vmstate_virtio_balloon_free_page_hint = {
     .name = "virtio-balloon-device/free-page-report",
     .version_id = 1,
     .minimum_version_id = 1,
     .needed = virtio_balloon_free_page_support,
     .fields = (VMStateField[]) {
-        VMSTATE_UINT32(free_page_report_cmd_id, VirtIOBalloon),
-        VMSTATE_UINT32(free_page_report_status, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_cmd_id, VirtIOBalloon),
+        VMSTATE_UINT32(free_page_hint_status, VirtIOBalloon),
         VMSTATE_END_OF_LIST()
     }
 };
@@ -869,7 +869,7 @@ static const VMStateDescription vmstate_virtio_balloon_device = {
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * []) {
-        &vmstate_virtio_balloon_free_page_report,
+        &vmstate_virtio_balloon_free_page_hint,
         &vmstate_virtio_balloon_page_poison,
         NULL
     }
@@ -908,7 +908,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
                            VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
         s->free_page_vq = virtio_add_queue(vdev, VIRTQUEUE_MAX_SIZE,
                                            virtio_balloon_handle_free_page_vq);
-        precopy_add_notifier(&s->free_page_report_notify);
+        precopy_add_notifier(&s->free_page_hint_notify);
 
         object_ref(OBJECT(s->iothread));
         s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread),
@@ -932,7 +932,7 @@ static void virtio_balloon_device_unrealize(DeviceState *dev)
         qemu_bh_delete(s->free_page_bh);
         object_unref(OBJECT(s->iothread));
         virtio_balloon_free_page_stop(s);
-        precopy_remove_notifier(&s->free_page_report_notify);
+        precopy_remove_notifier(&s->free_page_hint_notify);
     }
     balloon_stats_destroy_timer(s);
     qemu_remove_balloon_handler(s);
@@ -1004,8 +1004,8 @@ static void virtio_balloon_instance_init(Object *obj)
 
     qemu_mutex_init(&s->free_page_lock);
     qemu_cond_init(&s->free_page_cond);
-    s->free_page_report_cmd_id = VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN;
-    s->free_page_report_notify.notify = virtio_balloon_free_page_report_notify;
+    s->free_page_hint_cmd_id = VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN;
+    s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify;
 
     object_property_add(obj, "guest-stats", "guest statistics",
                         balloon_stats_get_all, NULL, NULL, s);
diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h
index d49fef00ce..28fd2b3960 100644
--- a/include/hw/virtio/virtio-balloon.h
+++ b/include/hw/virtio/virtio-balloon.h
@@ -23,7 +23,7 @@
 #define VIRTIO_BALLOON(obj) \
         OBJECT_CHECK(VirtIOBalloon, (obj), TYPE_VIRTIO_BALLOON)
 
-#define VIRTIO_BALLOON_FREE_PAGE_REPORT_CMD_ID_MIN 0x80000000
+#define VIRTIO_BALLOON_FREE_PAGE_HINT_CMD_ID_MIN 0x80000000
 
 typedef struct virtio_balloon_stat VirtIOBalloonStat;
 
@@ -33,20 +33,20 @@ typedef struct virtio_balloon_stat_modern {
        uint64_t val;
 } VirtIOBalloonStatModern;
 
-enum virtio_balloon_free_page_report_status {
-    FREE_PAGE_REPORT_S_STOP = 0,
-    FREE_PAGE_REPORT_S_REQUESTED = 1,
-    FREE_PAGE_REPORT_S_START = 2,
-    FREE_PAGE_REPORT_S_DONE = 3,
+enum virtio_balloon_free_page_hint_status {
+    FREE_PAGE_HINT_S_STOP = 0,
+    FREE_PAGE_HINT_S_REQUESTED = 1,
+    FREE_PAGE_HINT_S_START = 2,
+    FREE_PAGE_HINT_S_DONE = 3,
 };
 
 typedef struct VirtIOBalloon {
     VirtIODevice parent_obj;
     VirtQueue *ivq, *dvq, *svq, *free_page_vq, *reporting_vq;
-    uint32_t free_page_report_status;
+    uint32_t free_page_hint_status;
     uint32_t num_pages;
     uint32_t actual;
-    uint32_t free_page_report_cmd_id;
+    uint32_t free_page_hint_cmd_id;
     uint64_t stats[VIRTIO_BALLOON_S_NR];
     VirtQueueElement *stats_vq_elem;
     size_t stats_vq_offset;
@@ -55,7 +55,7 @@ typedef struct VirtIOBalloon {
     QEMUBH *free_page_bh;
     /*
      * Lock to synchronize threads to access the free page reporting related
-     * fields (e.g. free_page_report_status).
+     * fields (e.g. free_page_hint_status).
      */
     QemuMutex free_page_lock;
     QemuCond  free_page_cond;
@@ -64,7 +64,7 @@ typedef struct VirtIOBalloon {
      * stopped.
      */
     bool block_iothread;
-    NotifierWithReturn free_page_report_notify;
+    NotifierWithReturn free_page_hint_notify;
     int64_t stats_last_update;
     int64_t stats_poll_interval;
     uint32_t host_features;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16529.40782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdF-0000lZ-Vy; Fri, 30 Oct 2020 22:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16529.40782; Fri, 30 Oct 2020 22:12:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdF-0000lR-T8; Fri, 30 Oct 2020 22:12:25 +0000
Received: by outflank-mailman (input) for mailman id 16529;
 Fri, 30 Oct 2020 22:12:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcdE-0000lJ-Ub
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b458d125-cad3-42d2-887c-def30140f29e;
 Fri, 30 Oct 2020 22:12:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdE-0004fT-22
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdE-000315-1C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcdE-0000lJ-Ub
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
X-Inumbo-ID: b458d125-cad3-42d2-887c-def30140f29e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b458d125-cad3-42d2-887c-def30140f29e;
	Fri, 30 Oct 2020 22:12:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9wcuuBhAhC3u7O4ZvGelkZ+aie9SsuKICFoxTnlWCVQ=; b=HHb/VLQE3jOi8a2RVbk07YRpmD
	w7d3PH3VzfKW6xxMbNE7n66f1yvJ/LjOlx4a9H+h/TYNYqfac7f4hcvXrweCoIQ30AST54SHdKKbn
	+7yRuGWNlxvLVTOThm74Y8sr543bo3CrSV8+vKyPkzjr1XEhyQegwuHG6ZRk+GmE+oNc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdE-0004fT-22
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdE-000315-1C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio: list legacy-capable devices
Message-Id: <E1kYcdE-000315-1C@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:24 +0000

commit 7c78bdd7a3d0086179331f10d1f6f8cdac34731a
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Tue Jul 7 12:54:45 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: list legacy-capable devices
    
    Several types of virtio devices had already been around before the
    virtio standard was specified. These devices support virtio in legacy
    (and transitional) mode.
    
    Devices that have been added in the virtio standard are considered
    non-transitional (i.e. with no support for legacy virtio).
    
    Provide a helper function so virtio transports can figure that out
    easily.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200707105446.677966-2-cohuck@redhat.com>
    Cc: qemu-stable@nongnu.org
    Acked-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio.c         | 25 +++++++++++++++++++++++++
 include/hw/virtio/virtio.h |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5bd2a2f621..546a198e79 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -27,6 +27,7 @@
 #include "hw/virtio/virtio-access.h"
 #include "sysemu/dma.h"
 #include "sysemu/runstate.h"
+#include "standard-headers/linux/virtio_ids.h"
 
 /*
  * The alignment to use between consumer and producer parts of vring.
@@ -3279,6 +3280,30 @@ void virtio_init(VirtIODevice *vdev, const char *name,
     vdev->use_guest_notifier_mask = true;
 }
 
+/*
+ * Only devices that have already been around prior to defining the virtio
+ * standard support legacy mode; this includes devices not specified in the
+ * standard. All newer devices conform to the virtio standard only.
+ */
+bool virtio_legacy_allowed(VirtIODevice *vdev)
+{
+    switch (vdev->device_id) {
+    case VIRTIO_ID_NET:
+    case VIRTIO_ID_BLOCK:
+    case VIRTIO_ID_CONSOLE:
+    case VIRTIO_ID_RNG:
+    case VIRTIO_ID_BALLOON:
+    case VIRTIO_ID_RPMSG:
+    case VIRTIO_ID_SCSI:
+    case VIRTIO_ID_9P:
+    case VIRTIO_ID_RPROC_SERIAL:
+    case VIRTIO_ID_CAIF:
+        return true;
+    default:
+        return false;
+    }
+}
+
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n)
 {
     return vdev->vq[n].vring.desc;
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index b69d517496..198ffc7626 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -396,4 +396,6 @@ static inline bool virtio_device_disabled(VirtIODevice *vdev)
     return unlikely(vdev->disabled || vdev->broken);
 }
 
+bool virtio_legacy_allowed(VirtIODevice *vdev);
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16530.40786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdQ-0000n1-1k; Fri, 30 Oct 2020 22:12:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16530.40786; Fri, 30 Oct 2020 22:12:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdP-0000ms-UZ; Fri, 30 Oct 2020 22:12:35 +0000
Received: by outflank-mailman (input) for mailman id 16530;
 Fri, 30 Oct 2020 22:12:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcdP-0000mj-0h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b305a198-66eb-447f-a48d-33d64e8dd0da;
 Fri, 30 Oct 2020 22:12:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdO-0004fd-5t
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdO-00031X-58
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcdP-0000mj-0h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:35 +0000
X-Inumbo-ID: b305a198-66eb-447f-a48d-33d64e8dd0da
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b305a198-66eb-447f-a48d-33d64e8dd0da;
	Fri, 30 Oct 2020 22:12:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MIPc4B3OTb3F0DHKi6Br08+9lgR44US0ZJJYnqyCEVM=; b=ve2qV4qzmXRRPjGLJIlrq6qFdm
	xykD7v+t8rzMzW2lggkdNnw6E7WicoWQzledsewRBL5PGS3bxyzlDMIIHDDGJPzxahQM1/QAt09wV
	YJX8rIs07Ux78wGak9k9XuhQqy4bHrPYyTuq+YnT6p+0C9pqhAsnG+55nOwpCzhPp2Vs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdO-0004fd-5t
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdO-00031X-58
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio: verify that legacy support is not accidentally on
Message-Id: <E1kYcdO-00031X-58@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:34 +0000

commit 9b3a35ec8236933ab958a4c3ad883163f1ca66e7
Author:     Cornelia Huck <cohuck@redhat.com>
AuthorDate: Tue Jul 7 12:54:46 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    virtio: verify that legacy support is not accidentally on
    
    If a virtio device does not have legacy support, make sure that
    it is actually off, and bail out if not.
    
    For virtio-pci, this means that any device without legacy support
    that has been specified to modern-only (or that has been forced
    to it) will work.
    
    For virtio-ccw, this duplicates the check that is currently done
    prior to realization for any device that explicitly specified no
    support for legacy.
    
    This catches devices that have not been fenced properly.
    
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
    Message-Id: <20200707105446.677966-3-cohuck@redhat.com>
    Cc: qemu-stable@nongnu.org
    Acked-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw.c  | 6 ++++++
 hw/virtio/virtio-pci.c | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 3c988a000b..0e60270297 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1121,6 +1121,12 @@ static void virtio_ccw_device_plugged(DeviceState *d, Error **errp)
         dev->max_rev = 0;
     }
 
+    if (!virtio_ccw_rev_max(dev) && !virtio_legacy_allowed(vdev)) {
+        error_setg(errp, "Invalid value of property max_rev "
+                   "(is %d expected >= 1)", virtio_ccw_rev_max(dev));
+        return;
+    }
+
     if (virtio_get_num_queues(vdev) > VIRTIO_QUEUE_MAX) {
         error_setg(errp, "The number of virtqueues %d "
                    "exceeds virtio limit %d", n,
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 8554cf2a03..db8b711b35 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1581,6 +1581,10 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
     }
 
     if (legacy) {
+        if (!virtio_legacy_allowed(vdev)) {
+            error_setg(errp, "device is modern-only, use disable-legacy=on");
+            return;
+        }
         if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
             error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was supported by"
                        " neither legacy nor transitional device");
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16531.40792 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdb-0000p2-3j; Fri, 30 Oct 2020 22:12:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16531.40792; Fri, 30 Oct 2020 22:12:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdb-0000oq-04; Fri, 30 Oct 2020 22:12:47 +0000
Received: by outflank-mailman (input) for mailman id 16531;
 Fri, 30 Oct 2020 22:12:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcdZ-0000of-BM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 58159c03-ca40-444b-b9fa-cf0145d1fb18;
 Fri, 30 Oct 2020 22:12:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdY-0004hh-AD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdY-00033a-91
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcdZ-0000of-BM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:45 +0000
X-Inumbo-ID: 58159c03-ca40-444b-b9fa-cf0145d1fb18
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 58159c03-ca40-444b-b9fa-cf0145d1fb18;
	Fri, 30 Oct 2020 22:12:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z2djZcLDsFtHxTGi88bhxZTpaZbsVZFWU7fgCp6hDF4=; b=q2PCk1v1XAXsYN/GZfWaOau+7V
	r9LsTEmq1V/BYNbnimpqCWhIpePgXvLGIrT52BIVm6YLS45/SCVh9WgHMKfp9uGlmtqDmKr/HfslR
	sXWEmyDzz57jAe+pBSynp05smxSTQ0DMwJ6vDWwQGx/N+bRkwWg0ZdssMvh2UOp0xeMY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdY-0004hh-AD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdY-00033a-91
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] intel_iommu: Use correct shift for 256 bits qi descriptor
Message-Id: <E1kYcdY-00033a-91@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:44 +0000

commit a4544c45e109ceee87ee8c19baff28be3890d788
Author:     Liu Yi L <yi.l.liu@intel.com>
AuthorDate: Sat Jul 4 01:07:15 2020 -0700
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 07:57:07 2020 -0400

    intel_iommu: Use correct shift for 256 bits qi descriptor
    
    In chapter 10.4.23 of VT-d spec 3.0, Descriptor Width bit was introduced
    in VTD_IQA_REG. Software could set this bit to tell VT-d the QI descriptor
    from software would be 256 bits. Accordingly, the VTD_IQH_QH_SHIFT should
    be 5 when descriptor size is 256 bits.
    
    This patch adds the DW bit check when deciding the shift used to update
    VTD_IQH_REG.
    
    Signed-off-by: Liu Yi L <yi.l.liu@intel.com>
    Message-Id: <1593850035-35483-1-git-send-email-yi.l.liu@intel.com>
    Reviewed-by: Peter Xu <peterx@redhat.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/intel_iommu.c          | 7 ++++++-
 hw/i386/intel_iommu_internal.h | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c56398e991..0c286635cf 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2549,6 +2549,11 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)
 /* Try to fetch and process more Invalidation Descriptors */
 static void vtd_fetch_inv_desc(IntelIOMMUState *s)
 {
+    int qi_shift;
+
+    /* Refer to 10.4.23 of VT-d spec 3.0 */
+    qi_shift = s->iq_dw ? VTD_IQH_QH_SHIFT_5 : VTD_IQH_QH_SHIFT_4;
+
     trace_vtd_inv_qi_fetch();
 
     if (s->iq_tail >= s->iq_size) {
@@ -2567,7 +2572,7 @@ static void vtd_fetch_inv_desc(IntelIOMMUState *s)
         }
         /* Must update the IQH_REG in time */
         vtd_set_quad_raw(s, DMAR_IQH_REG,
-                         (((uint64_t)(s->iq_head)) << VTD_IQH_QH_SHIFT) &
+                         (((uint64_t)(s->iq_head)) << qi_shift) &
                          VTD_IQH_QH_MASK);
     }
 }
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 862033ebe6..3d5487fe2c 100644
--- a/hw/i386/intel_iommu_internal.h
+++ b/hw/i386/intel_iommu_internal.h
@@ -230,7 +230,8 @@
 #define VTD_IQA_DW_MASK             0x800
 
 /* IQH_REG */
-#define VTD_IQH_QH_SHIFT            4
+#define VTD_IQH_QH_SHIFT_4          4
+#define VTD_IQH_QH_SHIFT_5          5
 #define VTD_IQH_QH_MASK             0x7fff0ULL
 
 /* ICS_REG */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:12:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:12:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16532.40795 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdl-0000r8-62; Fri, 30 Oct 2020 22:12:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16532.40795; Fri, 30 Oct 2020 22:12:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdl-0000r0-1c; Fri, 30 Oct 2020 22:12:57 +0000
Received: by outflank-mailman (input) for mailman id 16532;
 Fri, 30 Oct 2020 22:12:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcdj-0000q1-C8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9a8cf2e8-e898-4838-8944-96f5f9d2368b;
 Fri, 30 Oct 2020 22:12:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdi-0004hp-Dy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcdi-00034D-DE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcdj-0000q1-C8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:55 +0000
X-Inumbo-ID: 9a8cf2e8-e898-4838-8944-96f5f9d2368b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9a8cf2e8-e898-4838-8944-96f5f9d2368b;
	Fri, 30 Oct 2020 22:12:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WES1VPk8Wi5HqpQvw4Qc5I99ilkLSKcdQ7f/FyQpL0k=; b=vQhwgRF++2L+ZbOaiwC8Rrh8rA
	ZLOYGDXW/xgbBsbn4VCv7pJ/LRqPOGO/hd30Ti/8Qqhm0Mwsyi1G76MUPq8p56n0jM/XbJsZBumei
	DIyRdYyzbg34AJ0S0uWK2I4jjBvSfdJvkMzjWuaJrNEX5USWl7UDYi+Ga3IGR+MyFHXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdi-0004hp-Dy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcdi-00034D-DE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:12:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
Message-Id: <E1kYcdi-00034D-DE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:12:54 +0000

commit ccec7e9603f446fe75c6c563ba335c00cfda6a06
Author:     Andrew Melnychenko <andrew@daynix.com>
AuthorDate: Mon Jul 6 14:21:23 2020 +0300
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Wed Jul 22 08:05:37 2020 -0400

    virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
    
    There is an issue when callback may be called with invalid vdev.
    It happens on unplug when vdev already deleted and VirtIOPciProxy is not.
    So now, callbacks accept proxy device, and vdev retrieved from it.
    Technically memio callbacks should be removed during the flatview update,
    but memoryregions remain til PCI device(and it's address space) completely deleted.
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1716352
    
    Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
    Message-Id: <20200706112123.971087-1-andrew@daynix.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-pci.c | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index db8b711b35..ada1101d07 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1333,11 +1333,12 @@ static uint64_t virtio_pci_notify_read(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
-    VirtIOPCIProxy *proxy = VIRTIO_PCI(DEVICE(vdev)->parent_bus->parent);
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = addr / virtio_pci_queue_mem_mult(proxy);
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1345,10 +1346,12 @@ static void virtio_pci_notify_write(void *opaque, hwaddr addr,
 static void virtio_pci_notify_write_pio(void *opaque, hwaddr addr,
                                         uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
     unsigned queue = val;
 
-    if (queue < VIRTIO_QUEUE_MAX) {
+    if (vdev != NULL && queue < VIRTIO_QUEUE_MAX) {
         virtio_queue_notify(vdev, queue);
     }
 }
@@ -1372,9 +1375,14 @@ static void virtio_pci_isr_write(void *opaque, hwaddr addr,
 static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
                                        unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
     uint64_t val = 0;
 
+    if (vdev == NULL) {
+        return val;
+    }
+
     switch (size) {
     case 1:
         val = virtio_config_modern_readb(vdev, addr);
@@ -1392,7 +1400,13 @@ static uint64_t virtio_pci_device_read(void *opaque, hwaddr addr,
 static void virtio_pci_device_write(void *opaque, hwaddr addr,
                                     uint64_t val, unsigned size)
 {
-    VirtIODevice *vdev = opaque;
+    VirtIOPCIProxy *proxy = opaque;
+    VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
+
+    if (vdev == NULL) {
+        return;
+    }
+
     switch (size) {
     case 1:
         virtio_config_modern_writeb(vdev, addr, val);
@@ -1469,19 +1483,19 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
 
     memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
                           &device_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-device",
                           proxy->device.size);
 
     memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
                           &notify_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify",
                           proxy->notify.size);
 
     memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy),
                           &notify_pio_ops,
-                          virtio_bus_get_device(&proxy->bus),
+                          proxy,
                           "virtio-pci-notify-pio",
                           proxy->notify_pio.size);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16533.40798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdv-0000st-6E; Fri, 30 Oct 2020 22:13:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16533.40798; Fri, 30 Oct 2020 22:13:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcdv-0000sl-3C; Fri, 30 Oct 2020 22:13:07 +0000
Received: by outflank-mailman (input) for mailman id 16533;
 Fri, 30 Oct 2020 22:13:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcdt-0000sf-UI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 9332e189-1196-4089-b86f-f50df3f0f7b8;
 Fri, 30 Oct 2020 22:13:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcds-0004i8-I4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcds-000355-HF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcdt-0000sf-UI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:05 +0000
X-Inumbo-ID: 9332e189-1196-4089-b86f-f50df3f0f7b8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 9332e189-1196-4089-b86f-f50df3f0f7b8;
	Fri, 30 Oct 2020 22:13:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BdcI7pcbVnGPtqTiHMalHxOaGLZUgQc2BGw+dNIGGN4=; b=dglkYPXkZc/Owr/evOS4nmWpGV
	BdQ5zS+W2uhCgnHDhS25EepX2s3Oyw7p9AlwKCTY5NEayz7mh1pxKqFx5MEgI/wZpjIe/K9edpvNR
	8UCCouquDthStTlXNrw0dPgDQgp5UrrJVpVit74diN1kcImzBA3iS1M11kcn/Cynpm5Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcds-0004i8-I4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcds-000355-HF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYcds-000355-HF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:04 +0000

commit 8ffa52c20d5693d454f65f2024a1494edfea65d4
Merge: 53ce7b47b5bf47db067b81c18c786ed7b792d031 ccec7e9603f446fe75c6c563ba335c00cfda6a06
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 13:38:21 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 13:38:21 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    acpi,virtio,pc: bugfixes
    
    Fix bug in ACPI which were tripping up guests.
    Fix a use-after-free with hotplug of virtio devices.
    Block ability to create legacy devices which shouldn't have been
    there in the first place.
    Fix migration error handling with balloon.
    Drop some dead code in virtio.
    vtd emulation fixup.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Wed 22 Jul 2020 13:07:26 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks.
      intel_iommu: Use correct shift for 256 bits qi descriptor
      virtio: verify that legacy support is not accidentally on
      virtio: list legacy-capable devices
      virtio-balloon: Replace free page hinting references to 'report' with 'hint'
      virtio-balloon: Add locking to prevent possible race when starting hinting
      virtio-balloon: Prevent guest from starting a report when we didn't request one
      virtio: Drop broken and superfluous object_property_set_link()
      acpi: accept byte and word access to core ACPI registers
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/acpi/core.c                     |  9 +++--
 hw/i386/intel_iommu.c              |  7 +++-
 hw/i386/intel_iommu_internal.h     |  3 +-
 hw/s390x/virtio-ccw-crypto.c       |  3 --
 hw/s390x/virtio-ccw-rng.c          |  3 --
 hw/s390x/virtio-ccw.c              |  6 +++
 hw/virtio/virtio-balloon.c         | 79 ++++++++++++++++++++------------------
 hw/virtio/virtio-crypto-pci.c      |  2 -
 hw/virtio/virtio-pci.c             | 38 +++++++++++++-----
 hw/virtio/virtio-rng-pci.c         |  3 --
 hw/virtio/virtio.c                 | 25 ++++++++++++
 include/hw/virtio/virtio-balloon.h | 20 +++++-----
 include/hw/virtio/virtio.h         |  2 +
 13 files changed, 127 insertions(+), 73 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16534.40801 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYce5-0000yi-87; Fri, 30 Oct 2020 22:13:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16534.40801; Fri, 30 Oct 2020 22:13:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYce5-0000ya-4c; Fri, 30 Oct 2020 22:13:17 +0000
Received: by outflank-mailman (input) for mailman id 16534;
 Fri, 30 Oct 2020 22:13:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYce3-0000wn-SI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e6f6dd2c-8969-4552-bf68-f704b403536d;
 Fri, 30 Oct 2020 22:13:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYce2-0004iG-VD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYce2-00036J-U0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYce3-0000wn-SI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:15 +0000
X-Inumbo-ID: e6f6dd2c-8969-4552-bf68-f704b403536d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e6f6dd2c-8969-4552-bf68-f704b403536d;
	Fri, 30 Oct 2020 22:13:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jAKm9jUjwWbn8dPZmJOxeFVpKfA2+HrpOxClaL6XcA8=; b=3DRLflvACdse71W7sHbPq/Ck4a
	wuOrUuzxt/zYBGVXOTGEcLlz+V9tdeSWii41mD+MoDxqkjynFVHiklFUsIaxO4F5HMHxt/wKLH02o
	4okMO78rYAOta/HH7ZFAYu++ie43yiTgSZ6KyIBN23tmCAEWBDpaqBPT5j08vpngCl6k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYce2-0004iG-VD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYce2-00036J-U0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
Message-Id: <E1kYce2-00036J-U0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:14 +0000

commit 8380b3a453c38f040e7ca2105418802344cc23d0
Author:     Jessica Clarke <jrtc27@jrtc27.com>
AuthorDate: Sat Jul 18 01:49:34 2020 +0100
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
    
    The specification says:
    
       0x00  TIME_LOW   R: Get current time, then return low-order 32-bits.
       0x04  TIME_HIGH  R: Return high 32-bits from previous TIME_LOW read.
    
       ...
    
       To read the value, the kernel must perform an IO_READ(TIME_LOW),
       which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
       which returns a signed 32-bit value, corresponding to the higher half
       of the full value.
    
    However, we were just returning the current time for both. If the guest
    is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
    overflow of the lower half, it will see time be in the future, before
    jumping backwards on the next read, and Linux currently relies on the
    atomicity guaranteed by the spec so is affected by this. Fix this
    violation of the spec by caching the correct value for TIME_HIGH
    whenever TIME_LOW is read, and returning that value for any TIME_HIGH
    read.
    
    Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200718004934.83174-1-jrtc27@jrtc27.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/rtc/goldfish_rtc.c         | 17 ++++++++++++++---
 include/hw/rtc/goldfish_rtc.h |  1 +
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
index 01e9d2b083..6ddd45cce0 100644
--- a/hw/rtc/goldfish_rtc.c
+++ b/hw/rtc/goldfish_rtc.c
@@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
     GoldfishRTCState *s = opaque;
     uint64_t r = 0;
 
+    /*
+     * From the documentation linked at the top of the file:
+     *
+     *   To read the value, the kernel must perform an IO_READ(TIME_LOW), which
+     *   returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
+     *   returns a signed 32-bit value, corresponding to the higher half of the
+     *   full value.
+     */
     switch (offset) {
     case RTC_TIME_LOW:
-        r = goldfish_rtc_get_count(s) & 0xffffffff;
+        r = goldfish_rtc_get_count(s);
+        s->time_high = r >> 32;
+        r &= 0xffffffff;
         break;
     case RTC_TIME_HIGH:
-        r = goldfish_rtc_get_count(s) >> 32;
+        r = s->time_high;
         break;
     case RTC_ALARM_LOW:
         r = s->alarm_next & 0xffffffff;
@@ -216,7 +226,7 @@ static const MemoryRegionOps goldfish_rtc_ops = {
 
 static const VMStateDescription goldfish_rtc_vmstate = {
     .name = TYPE_GOLDFISH_RTC,
-    .version_id = 1,
+    .version_id = 2,
     .pre_save = goldfish_rtc_pre_save,
     .post_load = goldfish_rtc_post_load,
     .fields = (VMStateField[]) {
@@ -225,6 +235,7 @@ static const VMStateDescription goldfish_rtc_vmstate = {
         VMSTATE_UINT32(alarm_running, GoldfishRTCState),
         VMSTATE_UINT32(irq_pending, GoldfishRTCState),
         VMSTATE_UINT32(irq_enabled, GoldfishRTCState),
+        VMSTATE_UINT32(time_high, GoldfishRTCState),
         VMSTATE_END_OF_LIST()
     }
 };
diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
index 16f9f9e29d..9bd8924f5f 100644
--- a/include/hw/rtc/goldfish_rtc.h
+++ b/include/hw/rtc/goldfish_rtc.h
@@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
     uint32_t alarm_running;
     uint32_t irq_pending;
     uint32_t irq_enabled;
+    uint32_t time_high;
 } GoldfishRTCState;
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16535.40806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceF-00010E-AO; Fri, 30 Oct 2020 22:13:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16535.40806; Fri, 30 Oct 2020 22:13:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceF-000106-7J; Fri, 30 Oct 2020 22:13:27 +0000
Received: by outflank-mailman (input) for mailman id 16535;
 Fri, 30 Oct 2020 22:13:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYceD-0000zs-Ps
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2b415e52-4b76-4523-b2db-b28567de93f8;
 Fri, 30 Oct 2020 22:13:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceD-0004iQ-2L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceD-00036t-1f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYceD-0000zs-Ps
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
X-Inumbo-ID: 2b415e52-4b76-4523-b2db-b28567de93f8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2b415e52-4b76-4523-b2db-b28567de93f8;
	Fri, 30 Oct 2020 22:13:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xKwryFjp4Xv/S4vWy7n5dMhPP8SSUxhqHn/CewLhEEs=; b=THgL7ISIBB88P62EaeIX74DPFH
	qaB7pjhJjeb3k9FpCBvuLM+xPp6MZ9olj3wk014fXMesqZ2mS4NrA98VQE10nkJUuMppkl9R9Ody7
	Opm7zcFHBxN7T0UIHRLi5iRREk3Yh54oOGpyf0dxbCJCLHQ07z9eOLh+GV3yGIR9CB/s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceD-0004iQ-2L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceD-00036t-1f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: Quiet Coverity complains about vamo*
Message-Id: <E1kYceD-00036t-1f@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:25 +0000

commit eabfeb0cb9e054108b3e29a3a85363b3d80d9c38
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Tue Jul 21 21:37:41 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    target/riscv: Quiet Coverity complains about vamo*
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200721133742.2298-1-zhiwei_liu@c-sky.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index c0b7375927..7b4752b911 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -733,6 +733,7 @@ static bool amo_op(DisasContext *s, arg_rwdvm *a, uint8_t seq)
             g_assert_not_reached();
 #endif
         } else {
+            assert(seq < ARRAY_SIZE(fnsw));
             fn = fnsw[seq];
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16536.40810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceP-00011W-Ba; Fri, 30 Oct 2020 22:13:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16536.40810; Fri, 30 Oct 2020 22:13:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceP-00011O-8l; Fri, 30 Oct 2020 22:13:37 +0000
Received: by outflank-mailman (input) for mailman id 16536;
 Fri, 30 Oct 2020 22:13:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYceO-00011D-AL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 41b738bd-e7a8-4451-8274-a91163126e15;
 Fri, 30 Oct 2020 22:13:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceN-0004iX-60
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceN-00037V-5B
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYceO-00011D-AL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:36 +0000
X-Inumbo-ID: 41b738bd-e7a8-4451-8274-a91163126e15
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 41b738bd-e7a8-4451-8274-a91163126e15;
	Fri, 30 Oct 2020 22:13:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FMmb69KF9swrZfF93Ii3sMC91wYV3XcZs3tQqArYw7c=; b=cY299fUxOPeunyeSO63edSPg48
	rgVcMSEvtvk799vADyM7sopG0TJtrNEXNoUVYn4JiThBGkIzHZSWAfuRx/K48+9HknMZe5uBpXdaa
	nLUWaJgNI5KTboyx6qvVHSvukR5bg7fH6tYeRPs25FNfRXJ/xrlNN0JFlIDoq6LPIwXA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceN-0004iX-60
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceN-00037V-5B
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: fix vector index load/store constraints
Message-Id: <E1kYceN-00037V-5B@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:35 +0000

commit 3e09396e36dff4234afd6f6fd51861949be383e1
Author:     LIU Zhiwei <zhiwei_liu@c-sky.com>
AuthorDate: Tue Jul 21 21:37:42 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    target/riscv: fix vector index load/store constraints
    
    Although not explicitly specified that the the destination
    vector register groups cannot overlap the source vector register group,
    it is still necessary.
    
    And this constraint has been added to the v0.8 spec.
    
    Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20200721133742.2298-2-zhiwei_liu@c-sky.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/insn_trans/trans_rvv.inc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c
index 7b4752b911..887c6b8883 100644
--- a/target/riscv/insn_trans/trans_rvv.inc.c
+++ b/target/riscv/insn_trans/trans_rvv.inc.c
@@ -513,13 +513,21 @@ static bool ld_index_op(DisasContext *s, arg_rnfvm *a, uint8_t seq)
     return ldst_index_trans(a->rd, a->rs1, a->rs2, data, fn, s);
 }
 
+/*
+ * For vector indexed segment loads, the destination vector register
+ * groups cannot overlap the source vector register group (specified by
+ * `vs2`), else an illegal instruction exception is raised.
+ */
 static bool ld_index_check(DisasContext *s, arg_rnfvm* a)
 {
     return (vext_check_isa_ill(s) &&
             vext_check_overlap_mask(s, a->rd, a->vm, false) &&
             vext_check_reg(s, a->rd, false) &&
             vext_check_reg(s, a->rs2, false) &&
-            vext_check_nf(s, a->nf));
+            vext_check_nf(s, a->nf) &&
+            ((a->nf == 1) ||
+             vext_check_overlap_group(a->rd, a->nf << s->lmul,
+                                      a->rs2, 1 << s->lmul)));
 }
 
 GEN_VEXT_TRANS(vlxb_v, 0, rnfvm, ld_index_op, ld_index_check)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16537.40814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceZ-00013A-DZ; Fri, 30 Oct 2020 22:13:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16537.40814; Fri, 30 Oct 2020 22:13:47 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceZ-000132-AQ; Fri, 30 Oct 2020 22:13:47 +0000
Received: by outflank-mailman (input) for mailman id 16537;
 Fri, 30 Oct 2020 22:13:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYceY-00012s-2F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:46 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fd35062c-b7b2-4f35-a600-329e5caba752;
 Fri, 30 Oct 2020 22:13:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceX-0004jJ-9z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceX-00038H-8m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYceY-00012s-2F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:46 +0000
X-Inumbo-ID: fd35062c-b7b2-4f35-a600-329e5caba752
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fd35062c-b7b2-4f35-a600-329e5caba752;
	Fri, 30 Oct 2020 22:13:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fulPYVhnhpro7y3KhIUY19ylaHxz6jQ6X+9HXz/kc+g=; b=rzGtuRCBQJBeXwMUuMKOeAHU6z
	MIbOI71/KGBUzFNeenSBFUR47+ENDgEwYrfaPB3DnVJYmPhQW1Dgy4iTzjm6P/8G0ldMjsrBTnG2t
	b+etDDh99HkSaDvEA6kNMmGz1avL9M4Qepf18mynKvuT/Q4MX4b6MoH4tEX+rDIByLhE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceX-0004jJ-9z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceX-00038H-8m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/riscv: sifive_e: Correct debug block size
Message-Id: <E1kYceX-00038H-8m@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:45 +0000

commit e79d27cb322b60b460b709d2c74ff7d77cde0565
Author:     Bin Meng <bmeng.cn@gmail.com>
AuthorDate: Thu Jul 16 02:30:56 2020 -0700
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:39:46 2020 -0700

    hw/riscv: sifive_e: Correct debug block size
    
    Currently the debug region size is set to 0x100, but according to
    FE310-G000 and FE310-G002 manuals:
    
      FE310-G000: 0x100 - 0xFFF
      FE310-G002: 0x0   - 0xFFF
    
    Change the size to 0x1000 that applies to both.
    
    Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <1594891856-15474-1-git-send-email-bmeng.cn@gmail.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 hw/riscv/sifive_e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 7bb97b463d..c8b060486a 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -54,7 +54,7 @@ static const struct MemmapEntry {
     hwaddr base;
     hwaddr size;
 } sifive_e_memmap[] = {
-    [SIFIVE_E_DEBUG] =    {        0x0,      0x100 },
+    [SIFIVE_E_DEBUG] =    {        0x0,     0x1000 },
     [SIFIVE_E_MROM] =     {     0x1000,     0x2000 },
     [SIFIVE_E_OTP] =      {    0x20000,     0x2000 },
     [SIFIVE_E_CLINT] =    {  0x2000000,    0x10000 },
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:13:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:13:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16539.40818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcej-00014P-Ev; Fri, 30 Oct 2020 22:13:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16539.40818; Fri, 30 Oct 2020 22:13:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcej-00014H-By; Fri, 30 Oct 2020 22:13:57 +0000
Received: by outflank-mailman (input) for mailman id 16539;
 Fri, 30 Oct 2020 22:13:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcei-00012s-31
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 68743a37-7f68-44fc-8a72-ae9df2f1668a;
 Fri, 30 Oct 2020 22:13:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceh-0004jV-Di
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYceh-00038z-Cp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcei-00012s-31
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:56 +0000
X-Inumbo-ID: 68743a37-7f68-44fc-8a72-ae9df2f1668a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 68743a37-7f68-44fc-8a72-ae9df2f1668a;
	Fri, 30 Oct 2020 22:13:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tPIruA/L7v+wKGAeeMxJs4PllKyxm/Fg8b9xyPjt9Y8=; b=Q6SMxG3YB2aXE7rR3SyH5sbwBr
	qjUxF9EFnd6TDza2vhsiPAw1PM1v3Nsqbshwpd8bahsq1ZpnfwfFbyF99DPz7MfNNKfCLXDpDRIzo
	h2j0D+JceWefdEsUaezNawg4aUcKpeUZCC6hIExUAIWntybJqvyckYSRWYXj3cSFFo7I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceh-0004jV-Di
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYceh-00038z-Cp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:13:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv: Fix the range of pmpcfg of CSR funcion table
Message-Id: <E1kYceh-00038z-Cp@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:13:55 +0000

commit 8ba26b0b2b00dd5849a6c0981e358dc7a7cc315d
Author:     Zong Li <zong.li@sifive.com>
AuthorDate: Tue Jul 21 20:40:50 2020 +0800
Commit:     Alistair Francis <alistair.francis@wdc.com>
CommitDate: Wed Jul 22 09:41:36 2020 -0700

    target/riscv: Fix the range of pmpcfg of CSR funcion table
    
    The range of Physical Memory Protection should be from CSR_PMPCFG0
    to CSR_PMPCFG3, not to CSR_PMPADDR9.
    
    Signed-off-by: Zong Li <zong.li@sifive.com>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Reviewed-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <eae49e9252c9596e4f3bdb471772f79235141a87.1595335112.git.zong.li@sifive.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/csr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index ac01c835e1..6a96a01b1c 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -1353,7 +1353,7 @@ static riscv_csr_operations csr_ops[CSR_TABLE_SIZE] = {
     [CSR_MTINST] =              { hmode,   read_mtinst,      write_mtinst     },
 
     /* Physical Memory Protection */
-    [CSR_PMPCFG0  ... CSR_PMPADDR9] =  { pmp,   read_pmpcfg,  write_pmpcfg   },
+    [CSR_PMPCFG0  ... CSR_PMPCFG3]   = { pmp,   read_pmpcfg,  write_pmpcfg   },
     [CSR_PMPADDR0 ... CSR_PMPADDR15] = { pmp,   read_pmpaddr, write_pmpaddr  },
 
     /* Performance Counters */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16540.40822 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceu-00017w-GQ; Fri, 30 Oct 2020 22:14:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16540.40822; Fri, 30 Oct 2020 22:14:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYceu-00017o-DW; Fri, 30 Oct 2020 22:14:08 +0000
Received: by outflank-mailman (input) for mailman id 16540;
 Fri, 30 Oct 2020 22:14:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYces-00017c-Hz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 489ab1b8-ac66-44f8-9cc8-64561be39b5d;
 Fri, 30 Oct 2020 22:14:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcer-0004js-HK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcer-00039i-Gd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYces-00017c-Hz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:06 +0000
X-Inumbo-ID: 489ab1b8-ac66-44f8-9cc8-64561be39b5d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 489ab1b8-ac66-44f8-9cc8-64561be39b5d;
	Fri, 30 Oct 2020 22:14:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nkugg9IxygRbTHYxbb38l5T5zQBNOf1EIINKhDqRprk=; b=HFERfBF9XPf0Oix/kTjkoY0y8O
	HbJlON7SQvaJh/FfnLGBrMuTEyg5c+x04XSsCTcRbekiFcvaoIh83thv63BM5ug4Na278HMJnncUa
	vPHPhGEPPQpVxLgxRWD1o6TdEFbI/eZupJZC1X9CGTg3USGOOi1Ml4H2yyDkM/1LK5zA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcer-0004js-HK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcer-00039i-Gd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200722-1' into staging
Message-Id: <E1kYcer-00039i-Gd@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:05 +0000

commit 09e0cd773723219d21655587954da2769f64ba01
Merge: 8ffa52c20d5693d454f65f2024a1494edfea65d4 8ba26b0b2b00dd5849a6c0981e358dc7a7cc315d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 19:00:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 23 19:00:42 2020 +0100

    Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20200722-1' into staging
    
    This PR contains a few RISC-V fixes.
    
    The main fix is the correction of the goldfish RTC time. On top of that
    some small fixes to the recently added vector extensions have been added
    (including an assert that fixed a coverity report). There is a change in
    the SiFive E debug memory size to match hardware. Finally there is a fix
    for PMP accesses.
    
    # gpg: Signature made Wed 22 Jul 2020 17:43:59 BST
    # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
    # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
    # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
    
    * remotes/alistair/tags/pull-riscv-to-apply-20200722-1:
      target/riscv: Fix the range of pmpcfg of CSR funcion table
      hw/riscv: sifive_e: Correct debug block size
      target/riscv: fix vector index load/store constraints
      target/riscv: Quiet Coverity complains about vamo*
      goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/riscv/sifive_e.c                     |  2 +-
 hw/rtc/goldfish_rtc.c                   | 17 ++++++++++++++---
 include/hw/rtc/goldfish_rtc.h           |  1 +
 target/riscv/csr.c                      |  2 +-
 target/riscv/insn_trans/trans_rvv.inc.c | 11 ++++++++++-
 5 files changed, 27 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16541.40825 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcf4-000199-IB; Fri, 30 Oct 2020 22:14:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16541.40825; Fri, 30 Oct 2020 22:14:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcf4-000191-F3; Fri, 30 Oct 2020 22:14:18 +0000
Received: by outflank-mailman (input) for mailman id 16541;
 Fri, 30 Oct 2020 22:14:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcf2-00018m-Lv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ca8f270a-46f3-4ebd-8a43-c4038686ca43;
 Fri, 30 Oct 2020 22:14:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcf1-0004k3-SP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcf1-0003BG-R4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcf2-00018m-Lv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:16 +0000
X-Inumbo-ID: ca8f270a-46f3-4ebd-8a43-c4038686ca43
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ca8f270a-46f3-4ebd-8a43-c4038686ca43;
	Fri, 30 Oct 2020 22:14:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LHvPxUYf/BYZT5GPKHWNFe0MBq5qtcYsoWTzhCwOESU=; b=Cy56ybKB+wGGFKr2MGyx/9ngRq
	OTA//wTSA+XLN6SD2AoeMBli1jjh9bWB4dPL8X3bdt+4KjOpu5VoGDF4F7ab4tJ9wwswoF49AjDTz
	CAoA64GbkjnvANmpu5c7Mr8QvFRj4hIEP+uyrf8ZaCT1VDUoymCH8Pt9Fy3FIjY2CW2M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcf1-0004k3-SP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcf1-0003BG-R4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] KVM: fix CPU reset wrt HF2_GIF_MASK
Message-Id: <E1kYcf1-0003BG-R4@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:15 +0000

commit 0baa4b445e28f37243e5dc72e7efe32f0c9d7801
Author:     Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Thu Jul 23 16:27:01 2020 +0200
Commit:     Eduardo Habkost <ehabkost@redhat.com>
CommitDate: Thu Jul 23 15:03:54 2020 -0400

    KVM: fix CPU reset wrt HF2_GIF_MASK
    
    HF2_GIF_MASK is set in env->hflags2 unconditionally on CPU reset
    (see x86_cpu_reset()) but when calling KVM_SET_NESTED_STATE,
    KVM_STATE_NESTED_GIF_SET is only valid for nSVM as e.g. nVMX code
    looks like
    
    if (kvm_state->hdr.vmx.vmxon_pa == -1ull) {
        if (kvm_state->flags & ~KVM_STATE_NESTED_EVMCS)
            return -EINVAL;
    }
    
    Also, when adjusting the environment after KVM_GET_NESTED_STATE we
    need not reset HF2_GIF_MASK on VMX as e.g. x86_cpu_pending_interrupt()
    expects it to be set.
    
    Alternatively, we could've made env->hflags2 SVM-only.
    
    Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
    Fixes: b16c0e20c742 ("KVM: add support for AMD nested live migration")
    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Message-Id: <20200723142701.2521161-1-vkuznets@redhat.com>
    Tested-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target/i386/kvm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index b8455c89ed..6f18d940a5 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -3877,7 +3877,9 @@ static int kvm_put_nested_state(X86CPU *cpu)
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GUEST_MODE;
     }
-    if (env->hflags2 & HF2_GIF_MASK) {
+
+    /* Don't set KVM_STATE_NESTED_GIF_SET on VMX as it is illegal */
+    if (cpu_has_svm(env) && (env->hflags2 & HF2_GIF_MASK)) {
         env->nested_state->flags |= KVM_STATE_NESTED_GIF_SET;
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GIF_SET;
@@ -3919,10 +3921,14 @@ static int kvm_get_nested_state(X86CPU *cpu)
     } else {
         env->hflags &= ~HF_GUEST_MASK;
     }
-    if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
-        env->hflags2 |= HF2_GIF_MASK;
-    } else {
-        env->hflags2 &= ~HF2_GIF_MASK;
+
+    /* Keep HF2_GIF_MASK set on !SVM as x86_cpu_pending_interrupt() needs it */
+    if (cpu_has_svm(env)) {
+        if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
+            env->hflags2 |= HF2_GIF_MASK;
+        } else {
+            env->hflags2 &= ~HF2_GIF_MASK;
+        }
     }
 
     return ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16542.40831 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfE-0001AP-Jq; Fri, 30 Oct 2020 22:14:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16542.40831; Fri, 30 Oct 2020 22:14:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfE-0001AH-GV; Fri, 30 Oct 2020 22:14:28 +0000
Received: by outflank-mailman (input) for mailman id 16542;
 Fri, 30 Oct 2020 22:14:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcfC-0001A2-Sv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1fac129e-fc78-49b3-aa54-0d4eaabbf304;
 Fri, 30 Oct 2020 22:14:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfC-0004kC-0F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfB-0003CP-V6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcfC-0001A2-Sv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:26 +0000
X-Inumbo-ID: 1fac129e-fc78-49b3-aa54-0d4eaabbf304
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1fac129e-fc78-49b3-aa54-0d4eaabbf304;
	Fri, 30 Oct 2020 22:14:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RHzdNHfyzSHOiRz5/B1d7MtZfxnZFJKZ9kbLlY8qd/w=; b=PaOqUZJsdsWoINW8GnCCO4Rb7a
	WwKZh+yyh6dgMnzRO/AWJFBwS1TP71wkXRDWg3NzfI1JO6zBjHusYt20ka6IDK46X6tDNe5CovvXC
	1HDJ7soJrb3T0ddlsdDG2PNvmb6CHFzfbd7Oar51roSq/3JWZzpBZ+M4dc4usBuhg4EY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfC-0004kC-0F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfB-0003CP-V6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging
Message-Id: <E1kYcfB-0003CP-V6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:25 +0000

commit 7adfbea8fd1efce36019a0c2f198ca73be9d3f18
Merge: 09e0cd773723219d21655587954da2769f64ba01 0baa4b445e28f37243e5dc72e7efe32f0c9d7801
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 24 10:52:20 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 24 10:52:20 2020 +0100

    Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging
    
    x86 bug fix for -rc2
    
    A fix from Vitaly Kuznetsov for a CPU reset bug
    reported by Jan Kiszka.
    
    # gpg: Signature made Thu 23 Jul 2020 20:10:40 BST
    # gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
    # gpg:                issuer "ehabkost@redhat.com"
    # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
    # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
    
    * remotes/ehabkost/tags/x86-next-for-5.1-pull-request:
      KVM: fix CPU reset wrt HF2_GIF_MASK
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 target/i386/kvm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16543.40834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfO-0001Bc-LS; Fri, 30 Oct 2020 22:14:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16543.40834; Fri, 30 Oct 2020 22:14:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfO-0001BU-I0; Fri, 30 Oct 2020 22:14:38 +0000
Received: by outflank-mailman (input) for mailman id 16543;
 Fri, 30 Oct 2020 22:14:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcfN-0001BH-5s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id aa50a135-86f4-4085-9655-2c167d920c5a;
 Fri, 30 Oct 2020 22:14:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfM-0004kL-Bo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfM-0003E3-Aw
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcfN-0001BH-5s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:37 +0000
X-Inumbo-ID: aa50a135-86f4-4085-9655-2c167d920c5a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id aa50a135-86f4-4085-9655-2c167d920c5a;
	Fri, 30 Oct 2020 22:14:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v8IR1ZbQVyRF3IPoQpPj+tFNH3JKKX4QudFaPjkxIUs=; b=UwWohdTu1sk9HRKTf3qsOdzRYZ
	k4cCAOYMN6JkxiI+5lCYB3jXmdmggMfSANsmfQFdVLtsbpu7O3iBaNs23aKssungvy8vTjNHTOvGF
	R0rm5dbuuPoev28jUoTBppUdNBjKNYSA+23gvbztjlgRFIAr4MSoNM/InrwBlCCCs8ek=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfM-0004kL-Bo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfM-0003E3-Aw
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] coccinelle/err-bad-newline: Fix for Python 3, and add patterns
Message-Id: <E1kYcfM-0003E3-Aw@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:36 +0000

commit cb3fa1e4c05a4ad2563b39cdb1146e617f3b5424
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 22 10:40:45 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 12:56:44 2020 +0200

    coccinelle/err-bad-newline: Fix for Python 3, and add patterns
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200722084048.1726105-2-armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 scripts/coccinelle/err-bad-newline.cocci | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/scripts/coccinelle/err-bad-newline.cocci b/scripts/coccinelle/err-bad-newline.cocci
index 1316cc86a6..5394421873 100644
--- a/scripts/coccinelle/err-bad-newline.cocci
+++ b/scripts/coccinelle/err-bad-newline.cocci
@@ -1,22 +1,42 @@
 // Error messages should not contain newlines.  This script finds
 // messages that do.  Fixing them is manual.
 @r@
-expression errp, eno, cls, fmt;
+expression errp, err, eno, cls, fmt, ap;
 position p;
 @@
 (
+error_vreport(fmt, ap)@p
+|
+warn_vreport(fmt, ap)@p
+|
+info_vreport(fmt, ap)@p
+|
 error_report(fmt, ...)@p
 |
+warn_report(fmt, ...)@p
+|
+info_report(fmt, ...)@p
+|
+error_report_once(fmt, ...)@p
+|
+warn_report_once(fmt, ...)@p
+|
 error_setg(errp, fmt, ...)@p
 |
 error_setg_errno(errp, eno, fmt, ...)@p
 |
 error_setg_win32(errp, eno, cls, fmt, ...)@p
 |
+error_propagate_prepend(errp, err, fmt, ...)@p
+|
+error_vprepend(errp, fmt, ap)@p
+|
 error_prepend(errp, fmt, ...)@p
 |
 error_setg_file_open(errp, eno, cls, fmt, ...)@p
 |
+warn_reportf_err(errp, fmt, ...)@p
+|
 error_reportf_err(errp, fmt, ...)@p
 |
 error_set(errp, cls, fmt, ...)@p
@@ -26,4 +46,4 @@ fmt << r.fmt;
 p << r.p;
 @@
 if "\\n" in str(fmt):
-    print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)
+    print("%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16544.40838 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfY-0001Do-Oh; Fri, 30 Oct 2020 22:14:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16544.40838; Fri, 30 Oct 2020 22:14:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfY-0001Dg-Le; Fri, 30 Oct 2020 22:14:48 +0000
Received: by outflank-mailman (input) for mailman id 16544;
 Fri, 30 Oct 2020 22:14:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcfX-0001DT-AE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f26f3c88-db52-494d-ac1a-3c1d09adf20c;
 Fri, 30 Oct 2020 22:14:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfW-0004kt-Fj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfW-0003FI-Eq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcfX-0001DT-AE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:47 +0000
X-Inumbo-ID: f26f3c88-db52-494d-ac1a-3c1d09adf20c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f26f3c88-db52-494d-ac1a-3c1d09adf20c;
	Fri, 30 Oct 2020 22:14:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NKh+oukiF8IN0xfpMIhttM4n8KmoEi+u0Vaqj95Bif0=; b=MzC5vXiCnIJ06pdZqG/Kvu13Zy
	F+n5KIv1mkxMM9JlU+7zEfdybAJXSBCSUEKHcTyYlDdh5uGHD/v9c4Rv6BwszvNML8KBY32MsXPkk
	toloSMa/Uft3ETg0TMkN7qHZTqGzQqI0z0hMh62+pebqL2Z9a+ZfPky14xx58SFn7XzE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfW-0004kt-Fj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfW-0003FI-Eq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] error: Strip trailing '\n' from error string arguments (again)
Message-Id: <E1kYcfW-0003FI-Eq@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:46 +0000

commit ff5b5d5b6df5655946142820912b28f1a67efc94
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Wed Jul 22 10:40:46 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 12:56:44 2020 +0200

    error: Strip trailing '\n' from error string arguments (again)
    
    Tracked down with scripts/coccinelle/err-bad-newline.cocci.
    
    Cc: Peter Xu <peterx@redhat.com>
    Cc: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200722084048.1726105-3-armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Acked-by: David Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: Peter Xu <peterx@redhat.com>
---
 hw/i386/intel_iommu.c   | 6 +++---
 target/ppc/mmu-hash64.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 0c286635cf..5284bb68b6 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2356,7 +2356,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
     if ((inv_desc->lo & VTD_INV_DESC_IOTLB_RSVD_LO) ||
         (inv_desc->hi & VTD_INV_DESC_IOTLB_RSVD_HI)) {
         error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                          ", lo=0x%"PRIx64" (reserved bits unzero)\n",
+                          ", lo=0x%"PRIx64" (reserved bits unzero)",
                           __func__, inv_desc->hi, inv_desc->lo);
         return false;
     }
@@ -2377,7 +2377,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
         am = VTD_INV_DESC_IOTLB_AM(inv_desc->hi);
         if (am > VTD_MAMV) {
             error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                              ", lo=0x%"PRIx64" (am=%u > VTD_MAMV=%u)\n",
+                              ", lo=0x%"PRIx64" (am=%u > VTD_MAMV=%u)",
                               __func__, inv_desc->hi, inv_desc->lo,
                               am, (unsigned)VTD_MAMV);
             return false;
@@ -2387,7 +2387,7 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)
 
     default:
         error_report_once("%s: invalid iotlb inv desc: hi=0x%"PRIx64
-                          ", lo=0x%"PRIx64" (type mismatch: 0x%llx)\n",
+                          ", lo=0x%"PRIx64" (type mismatch: 0x%llx)",
                           __func__, inv_desc->hi, inv_desc->lo,
                           inv_desc->lo & VTD_INV_DESC_IOTLB_G);
         return false;
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index e5baabf0e1..c31d21e6a9 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -859,7 +859,7 @@ static int build_vrma_slbe(PowerPCCPU *cpu, ppc_slb_t *slb)
     }
 
     error_report("Bad page size encoding in LPCR[VRMASD]; LPCR=0x"
-                 TARGET_FMT_lx"\n", lpcr);
+                 TARGET_FMT_lx, lpcr);
 
     return -1;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:14:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:14:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16545.40842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfj-0001F5-QK; Fri, 30 Oct 2020 22:14:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16545.40842; Fri, 30 Oct 2020 22:14:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfj-0001Ey-NF; Fri, 30 Oct 2020 22:14:59 +0000
Received: by outflank-mailman (input) for mailman id 16545;
 Fri, 30 Oct 2020 22:14:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcfh-0001El-J2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ae8e031c-3407-49db-a538-366e24e384ee;
 Fri, 30 Oct 2020 22:14:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfg-0004l3-KS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfg-0003GH-IX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:56 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcfh-0001El-J2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:57 +0000
X-Inumbo-ID: ae8e031c-3407-49db-a538-366e24e384ee
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ae8e031c-3407-49db-a538-366e24e384ee;
	Fri, 30 Oct 2020 22:14:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5zC74ezqUYAXoeYhi5qAwkNti6y4qecigVG6mhEaiK4=; b=xqyipFZcuX+g0jaG/1brJ8vd2V
	y9mUYJoyfbpvzgfhRTxF4gW7NP304Bxgnxk3xhKdlQ4mNlfMl2jmpLlyG5R82Gn0J0RkV6caeRMRn
	/hrd82fLdUgM2JI/jQgLchkLoIr75UXegcG3pqFGmgDZDkrY71meHAGXtqCVGbbpF6P4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfg-0004l3-KS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfg-0003GH-IX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:14:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] sd/milkymist-memcard: Fix format string
Message-Id: <E1kYcfg-0003GH-IX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:14:56 +0000

commit 838886378eac879771708100a08a1099173d6935
Author:     Stefan Weil <sw@weilnetz.de>
AuthorDate: Wed Jul 22 22:40:54 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 15:03:09 2020 +0200

    sd/milkymist-memcard: Fix format string
    
    Fixes: b98e8d1230ff7023bb34ddeb7194424dfcbaf789
    Signed-off-by: Stefan Weil <sw@weilnetz.de>
    Message-Id: <20200722204054.1400555-1-sw@weilnetz.de>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    [Commit message tweaked]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/sd/milkymist-memcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index afdb8aa0c0..11f61294fc 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -281,7 +281,7 @@ static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
     carddev = qdev_new(TYPE_SD_CARD);
     qdev_prop_set_drive(carddev, "drive", blk);
     if (!qdev_realize_and_unref(carddev, BUS(&s->sdbus), &err)) {
-        error_propagate_prepend(errp, err, "failed to init SD card: %s");
+        error_propagate_prepend(errp, err, "failed to init SD card");
         return;
     }
     s->enabled = blk && blk_is_inserted(blk);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16546.40846 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfs-0001GE-Rv; Fri, 30 Oct 2020 22:15:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16546.40846; Fri, 30 Oct 2020 22:15:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcfs-0001G6-Oj; Fri, 30 Oct 2020 22:15:08 +0000
Received: by outflank-mailman (input) for mailman id 16546;
 Fri, 30 Oct 2020 22:15:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcfr-0001Fy-Ip
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ff2e50a1-795a-4676-ada0-6e66915ac995;
 Fri, 30 Oct 2020 22:15:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfq-0004lZ-P7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcfq-0003Hf-NO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcfr-0001Fy-Ip
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:07 +0000
X-Inumbo-ID: ff2e50a1-795a-4676-ada0-6e66915ac995
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ff2e50a1-795a-4676-ada0-6e66915ac995;
	Fri, 30 Oct 2020 22:15:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4PdPzgP9zwTcR2PKILhplTHazi2+FMTym8C3yLci/Wk=; b=6k2Bi8FPxJbljUgYCczUiCmPqy
	NWQTRyzc1amAhnxi20kluEP2Bmmo7uQ0tTbnUPTGzEN/LbCBVSou/CGufZTbf61ur4FHEVf1f25hv
	IHRgQK4z4/6nGNQ2HMN8AiyzcsA8opww8hX+J0co2ccQgg/2RCK7RNrcSHbkD7bgoZPw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfq-0004lZ-P7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcfq-0003Hf-NO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qapi/error: Check format string argument in error_*prepend()
Message-Id: <E1kYcfq-0003Hf-NO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:06 +0000

commit 192cf54ac5408d21c20c17b3794a632970bbb880
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:12:05 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Fri Jul 24 15:03:09 2020 +0200

    qapi/error: Check format string argument in error_*prepend()
    
    error_propagate_prepend() "behaves like error_prepend()", and
    error_prepend() uses "formatting @fmt, ... like printf()".
    error_prepend() checks its format string argument, but
    error_propagate_prepend() does not. Fix by addint the format
    attribute to error_propagate_prepend() and error_vprepend().
    
    This would have caught the bug fixed in the previous commit.
    
    Missed in commit 4b5766488f "error: Fix use of error_prepend() with
    &error_fatal, &error_abort".
    
    Inspired-by: Stefan Weil <sw@weilnetz.de>
    Suggested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171205.14949-1-philmd@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Commit message tweaked]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qapi/error.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 7932594dce..eaa05c4837 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -382,13 +382,15 @@ void error_propagate(Error **dst_errp, Error *local_err);
  * Please use ERRP_GUARD() and error_prepend() instead when possible.
  */
 void error_propagate_prepend(Error **dst_errp, Error *local_err,
-                             const char *fmt, ...);
+                             const char *fmt, ...)
+    GCC_FMT_ATTR(3, 4);
 
 /*
  * Prepend some text to @errp's human-readable error message.
  * The text is made by formatting @fmt, @ap like vprintf().
  */
-void error_vprepend(Error *const *errp, const char *fmt, va_list ap);
+void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
+    GCC_FMT_ATTR(2, 0);
 
 /*
  * Prepend some text to @errp's human-readable error message.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16547.40850 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcg2-0001Hj-TA; Fri, 30 Oct 2020 22:15:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16547.40850; Fri, 30 Oct 2020 22:15:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcg2-0001Hb-QI; Fri, 30 Oct 2020 22:15:18 +0000
Received: by outflank-mailman (input) for mailman id 16547;
 Fri, 30 Oct 2020 22:15:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcg1-0001HQ-Tv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f6e343ce-e94a-4919-b198-38aa038307a3;
 Fri, 30 Oct 2020 22:15:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcg0-0004lj-T2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcg0-0003JH-SE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcg1-0001HQ-Tv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:17 +0000
X-Inumbo-ID: f6e343ce-e94a-4919-b198-38aa038307a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f6e343ce-e94a-4919-b198-38aa038307a3;
	Fri, 30 Oct 2020 22:15:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GLPbNjFQiYb9uAjeUFqBNqNej7gY6YoMvB/JveHsewk=; b=Fsy4g/HPIFBtjSr/ED92RX/Xeh
	J9gt1B7nzGExXVMh4Z5wPyCXpVR6AUqm5gwZlvnJg++Qfqn+CjFyZ9ghu5kvuFJnc4+cp8MoaiBD+
	Ner63eC1hm0k8ZJfxQCMSZx0zxD3fWxUPsDPc074v9sIESsSkLim9Jw1/0ja28G2iGLQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcg0-0004lj-T2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcg0-0003JH-SE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-24' into staging
Message-Id: <E1kYcg0-0003JH-SE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:16 +0000

commit e68808a797d0c585b0e82e4a788d1ba8899b01eb
Merge: 7adfbea8fd1efce36019a0c2f198ca73be9d3f18 192cf54ac5408d21c20c17b3794a632970bbb880
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 24 16:24:42 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 24 16:24:42 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2020-07-24' into staging
    
    Error reporting patches patches for 2020-07-24
    
    # gpg: Signature made Fri 24 Jul 2020 14:03:44 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-error-2020-07-24:
      qapi/error: Check format string argument in error_*prepend()
      sd/milkymist-memcard: Fix format string
      error: Strip trailing '\n' from error string arguments (again)
      coccinelle/err-bad-newline: Fix for Python 3, and add patterns
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/i386/intel_iommu.c                    |  6 +++---
 hw/sd/milkymist-memcard.c                |  2 +-
 include/qapi/error.h                     |  6 ++++--
 scripts/coccinelle/err-bad-newline.cocci | 24 ++++++++++++++++++++++--
 target/ppc/mmu-hash64.c                  |  2 +-
 5 files changed, 31 insertions(+), 9 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16548.40854 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgC-0001Iz-Uv; Fri, 30 Oct 2020 22:15:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16548.40854; Fri, 30 Oct 2020 22:15:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgC-0001Ir-Rz; Fri, 30 Oct 2020 22:15:28 +0000
Received: by outflank-mailman (input) for mailman id 16548;
 Fri, 30 Oct 2020 22:15:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcgC-0001Ii-E1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3f3802ef-6006-44cc-9b9a-30c8c5a885f4;
 Fri, 30 Oct 2020 22:15:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgB-0004m0-0N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgA-0003KN-Vp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcgC-0001Ii-E1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:28 +0000
X-Inumbo-ID: 3f3802ef-6006-44cc-9b9a-30c8c5a885f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3f3802ef-6006-44cc-9b9a-30c8c5a885f4;
	Fri, 30 Oct 2020 22:15:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1kUzDz2/AXZf5qbt+SVOT0LJte5PzeZvBtqOU2J30DM=; b=VWXb3KKpGtUFMq0W8R1Lpt/14U
	x4xMusGI+wzQhk/IQC1TCa+YC+Cz6oz/cltng1cKf1cx9vHu8MLTTNAPtADiWpAltpAG7Ae2LqL5G
	BkXITY/irzF3tH68rJGiOm66rXFnVYv3TIRZNce/lFbfkIsNUOjQ1LOXbx9Txc720CS0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgB-0004m0-0N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgA-0003KN-Vp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/machine: Change default timeout to 30 seconds
Message-Id: <E1kYcgA-0003KN-Vp@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:26 +0000

commit 8226a4b88b35aab2d7c95f9dbe2fcd662276685a
Author:     John Snow <jsnow@redhat.com>
AuthorDate: Mon Jul 20 12:02:52 2020 -0400
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 17:27:10 2020 +0100

    python/machine: Change default timeout to 30 seconds
    
    3 seconds is too short for some tests running inside busy VMs. Build it out to
    a rather generous 30 seconds to find out conclusively if there are more severe
    problems in the merge/CI tests.
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Message-id: 20200720160252.104139-2-jsnow@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 python/qemu/machine.py | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 80c4d4a8b6..51aa255ef9 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -394,15 +394,15 @@ class QEMUMachine:
         self._popen.kill()
         self._popen.wait(timeout=60)
 
-    def _soft_shutdown(self, has_quit: bool = False,
-                       timeout: Optional[int] = 3) -> None:
+    def _soft_shutdown(self, timeout: Optional[int],
+                       has_quit: bool = False) -> None:
         """
         Perform early cleanup, attempt to gracefully shut down the VM, and wait
         for it to terminate.
 
+        :param timeout: Timeout in seconds for graceful shutdown.
+                        A value of None is an infinite wait.
         :param has_quit: When True, don't attempt to issue 'quit' QMP command
-        :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
 
         :raise ConnectionReset: On QMP communication errors
         :raise subprocess.TimeoutExpired: When timeout is exceeded waiting for
@@ -418,14 +418,14 @@ class QEMUMachine:
         # May raise subprocess.TimeoutExpired
         self._popen.wait(timeout=timeout)
 
-    def _do_shutdown(self, has_quit: bool = False,
-                     timeout: Optional[int] = 3) -> None:
+    def _do_shutdown(self, timeout: Optional[int],
+                     has_quit: bool = False) -> None:
         """
         Attempt to shutdown the VM gracefully; fallback to a hard shutdown.
 
+        :param timeout: Timeout in seconds for graceful shutdown.
+                        A value of None is an infinite wait.
         :param has_quit: When True, don't attempt to issue 'quit' QMP command
-        :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
 
         :raise AbnormalShutdown: When the VM could not be shut down gracefully.
             The inner exception will likely be ConnectionReset or
@@ -433,7 +433,7 @@ class QEMUMachine:
             may result in its own exceptions, likely subprocess.TimeoutExpired.
         """
         try:
-            self._soft_shutdown(has_quit, timeout)
+            self._soft_shutdown(timeout, has_quit)
         except Exception as exc:
             self._hard_shutdown()
             raise AbnormalShutdown("Could not perform graceful shutdown") \
@@ -441,7 +441,7 @@ class QEMUMachine:
 
     def shutdown(self, has_quit: bool = False,
                  hard: bool = False,
-                 timeout: Optional[int] = 3) -> None:
+                 timeout: Optional[int] = 30) -> None:
         """
         Terminate the VM (gracefully if possible) and perform cleanup.
         Cleanup will always be performed.
@@ -453,7 +453,7 @@ class QEMUMachine:
         :param hard: When true, do not attempt graceful shutdown, and
                      suppress the SIGKILL warning log message.
         :param timeout: Optional timeout in seconds for graceful shutdown.
-                        Default 3 seconds, A value of None is an infinite wait.
+                        Default 30 seconds, A `None` value is an infinite wait.
         """
         if not self._launched:
             return
@@ -463,7 +463,7 @@ class QEMUMachine:
                 self._user_killed = True
                 self._hard_shutdown()
             else:
-                self._do_shutdown(has_quit, timeout=timeout)
+                self._do_shutdown(timeout, has_quit)
         finally:
             self._post_shutdown()
 
@@ -473,12 +473,12 @@ class QEMUMachine:
         """
         self.shutdown(hard=True)
 
-    def wait(self, timeout: Optional[int] = 3) -> None:
+    def wait(self, timeout: Optional[int] = 30) -> None:
         """
         Wait for the VM to power off and perform post-shutdown cleanup.
 
-        :param timeout: Optional timeout in seconds.
-                        Default 3 seconds, A value of None is an infinite wait.
+        :param timeout: Optional timeout in seconds. Default 30 seconds.
+                        A value of `None` is an infinite wait.
         """
         self.shutdown(has_quit=True, timeout=timeout)
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16549.40858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgO-0001Kg-09; Fri, 30 Oct 2020 22:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16549.40858; Fri, 30 Oct 2020 22:15:39 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgN-0001KY-TU; Fri, 30 Oct 2020 22:15:39 +0000
Received: by outflank-mailman (input) for mailman id 16549;
 Fri, 30 Oct 2020 22:15:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcgN-0001Jv-4H
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 47f9c9b9-6fe7-46db-af04-ec8dacfbdec9;
 Fri, 30 Oct 2020 22:15:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgL-0004m8-CO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgL-0003Ll-Bh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcgN-0001Jv-4H
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:39 +0000
X-Inumbo-ID: 47f9c9b9-6fe7-46db-af04-ec8dacfbdec9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 47f9c9b9-6fe7-46db-af04-ec8dacfbdec9;
	Fri, 30 Oct 2020 22:15:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HSBTbDfPyMAdezLGvNFYhnswL0lWhiyso9W6RxluU6Y=; b=s/+iSfacTU6OrAclUiAuv6Ckxz
	4Z1zo0/dZGPe/sexfgEx52M2Gi6sgxhjYfuPUqZroLNaPzZl++83RXaKn/0+Xbw6kR5lO2fsh60iB
	0awaZCpQIqfb5Uhn2rsVhxtis1zXU4TgKctizHBCDFr8R3H6YeG7EU1FtquWZ0WSpTtI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgL-0004m8-CO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgL-0003Ll-Bh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw: Only compile the usb-dwc2 controller if it is really needed
Message-Id: <E1kYcgL-0003Ll-Bh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:37 +0000

commit 8d942986be27bb40e6faca2032af763d7db57082
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 17:47:19 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 16:15:28 2020 +0200

    hw: Only compile the usb-dwc2 controller if it is really needed
    
    The USB_DWC2 switch is currently "default y", so it is included in all
    qemu-system-* builds, even if it is not needed. Even worse, it does a
    "select USB", so USB devices are now showing up as available on targets
    that do not support USB at all. This sysbus device should only be
    included by the boards that need it, i.e. by the Raspi machines.
    
    Fixes: 153ef1662c ("dwc-hsotg (dwc2) USB host controller emulation")
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Paul Zimmerman <pauldzim@gmail.com>
    Message-id: 20200722154719.10130-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/arm/Kconfig | 1 +
 hw/usb/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 4a224a6351..bc3a423940 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -315,6 +315,7 @@ config RASPI
     select FRAMEBUFFER
     select PL011 # UART
     select SDHCI
+    select USB_DWC2
 
 config STM32F205_SOC
     bool
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index d4d8c37c28..5e63dc75f8 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -48,7 +48,6 @@ config USB_MUSB
 
 config USB_DWC2
     bool
-    default y
     select USB
 
 config TUSB6010
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16550.40862 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgX-0001Lq-1i; Fri, 30 Oct 2020 22:15:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16550.40862; Fri, 30 Oct 2020 22:15:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgW-0001Li-Ux; Fri, 30 Oct 2020 22:15:48 +0000
Received: by outflank-mailman (input) for mailman id 16550;
 Fri, 30 Oct 2020 22:15:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcgW-0001Lb-8I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 450d00fa-1f03-4e57-9130-04170f7d906b;
 Fri, 30 Oct 2020 22:15:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgV-0004mu-Gk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgV-0003Mj-FD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcgW-0001Lb-8I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:48 +0000
X-Inumbo-ID: 450d00fa-1f03-4e57-9130-04170f7d906b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 450d00fa-1f03-4e57-9130-04170f7d906b;
	Fri, 30 Oct 2020 22:15:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ONmDI9D0VQPqJ2vV9523XwTgmjpnf1N8EY6MQmUBr6g=; b=O0Ljcl23TYfC0yUWFI5CoT6+PQ
	kEeNGlAIeXSAE5OzxUuGazizewTIiDZziyxlwXqHbp0RRco4qoiLIt78GbCBNjjwGc7wt6nFdK40X
	UNqYtR/h9ZsJ/lBQnmkw/lRSuwbo2H0xMQxdXuCP2x3YtXtQTnHVmn56FlOVcc+6mPtE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgV-0004mu-Gk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgV-0003Mj-FD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
Message-Id: <E1kYcgV-0003Mj-FD@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:47 +0000

commit 2c9728c0db8c02bf2f4f067548433af9f4102948
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 23 20:24:57 2020 +0100
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 16:15:28 2020 +0200

    hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
    
    virtio-input-hid.c undefines CONFIG_CURSES before including
    ui/console.h. However since commits e2f82e924d057935 and b0766612d16da18
    that header does not have behaviour dependent on CONFIG_CURSES.
    Remove the now-unneeded undef.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Message-id: 20200723192457.28136-1-peter.maydell@linaro.org
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/input/virtio-input-hid.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index 09cf260985..a7a244a95d 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -12,7 +12,6 @@
 #include "hw/qdev-properties.h"
 #include "hw/virtio/virtio-input.h"
 
-#undef CONFIG_CURSES
 #include "ui/console.h"
 
 #include "standard-headers/linux/input.h"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:15:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:15:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16551.40866 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgh-0001NP-4K; Fri, 30 Oct 2020 22:15:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16551.40866; Fri, 30 Oct 2020 22:15:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgh-0001NH-1Q; Fri, 30 Oct 2020 22:15:59 +0000
Received: by outflank-mailman (input) for mailman id 16551;
 Fri, 30 Oct 2020 22:15:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcgg-0001N6-DY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6b5eec68-d43a-45b0-95f0-1ce3be40546a;
 Fri, 30 Oct 2020 22:15:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgf-0004n2-KT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgf-0003NE-Jm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcgg-0001N6-DY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:58 +0000
X-Inumbo-ID: 6b5eec68-d43a-45b0-95f0-1ce3be40546a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6b5eec68-d43a-45b0-95f0-1ce3be40546a;
	Fri, 30 Oct 2020 22:15:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GoggIZ4ubVqPNGLXHzoFZpWFKrIUvOgihHTx1CJzmvE=; b=JdV/9i6dfNkQVXlN6xnvcBrnz2
	Imjdd/t12TOs13PIUTkOzgYa/GKSBK6WbyE5Iabk1jRKkxjnSDjVrdEb8b7X1Ayo2YNeAyGVDIH90
	02wqUTS9E7sVsWmfxihc83hXAENpLDQ+txzqEeVW4nnHQiRMvHDDPAiuJa4uXz+tOPdM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgf-0004n2-KT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgf-0003NE-Jm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:15:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] configure: Allow to build tools without pixman
Message-Id: <E1kYcgf-0003NE-Jm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:15:57 +0000

commit 9b52b17ba5e96cec182537715e87308108b47117
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 23 16:11:23 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Fri Jul 24 17:36:03 2020 +0200

    configure: Allow to build tools without pixman
    
    If pixman is not installed, it is currently not possible to run:
    
     .../configure  --disable-system --enable-tools
    
    Seems like there was a dependency from one of the required source
    files to pixman in the past, but since commit 1ac0206b2ae1ffaeec56
    ("qemu-timer.c: Trim list of included headers"), this dependency
    should be gone. Thus allow to compile the tools without pixman now.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-id: 20200723141123.14765-1-thuth@redhat.com
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 4bd80ed507..2acc4d1465 100755
--- a/configure
+++ b/configure
@@ -4065,7 +4065,7 @@ fi
 ##########################################
 # pixman support probe
 
-if test "$want_tools" = "no" && test "$softmmu" = "no"; then
+if test "$softmmu" = "no"; then
   pixman_cflags=
   pixman_libs=
 elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:16:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:16:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16552.40870 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgs-0001Oh-65; Fri, 30 Oct 2020 22:16:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16552.40870; Fri, 30 Oct 2020 22:16:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcgs-0001OZ-2z; Fri, 30 Oct 2020 22:16:10 +0000
Received: by outflank-mailman (input) for mailman id 16552;
 Fri, 30 Oct 2020 22:16:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcgq-0001OR-RV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 00381073-c842-4120-9f5a-faa6681fb361;
 Fri, 30 Oct 2020 22:16:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgp-0004nP-P3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcgp-0003OD-Nf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcgq-0001OR-RV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:08 +0000
X-Inumbo-ID: 00381073-c842-4120-9f5a-faa6681fb361
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 00381073-c842-4120-9f5a-faa6681fb361;
	Fri, 30 Oct 2020 22:16:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=piamagruhAVeDiuIvkCanNSYTkmJha44UZEfEgPOSpk=; b=Bo0sjwbGc+33pl87Sr8g6QS1Cj
	uxhIG3rFP7eIfvf3ScLpuNjDiN5l7OXYr3oW6oyogDos2xT9eNg8fC4l2faOaI0KkEj50soV3aZba
	WCjTs3x3XXTPkSqtMQ/7sWSVYpsBE+98/WL/eWPRzxHPfroeAcs5/TFtyluhS/PGydes=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgp-0004nP-P3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcgp-0003OD-Nf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200724-pull-request' into staging
Message-Id: <E1kYcgp-0003OD-Nf@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:07 +0000

commit b0ce3f021e0157e9a5ab836cb162c48caac132e1
Merge: 8226a4b88b35aab2d7c95f9dbe2fcd662276685a 9b52b17ba5e96cec182537715e87308108b47117
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 25 18:46:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 18:46:48 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20200724-pull-request' into staging
    
    bugfixes: virtio-input, usb-dwc2, pixman.
    
    # gpg: Signature made Fri 24 Jul 2020 17:42:43 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/fixes-20200724-pull-request:
      configure: Allow to build tools without pixman
      hw/input/virtio-input-hid.c: Don't undef CONFIG_CURSES
      hw: Only compile the usb-dwc2 controller if it is really needed
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 configure                   | 2 +-
 hw/arm/Kconfig              | 1 +
 hw/input/virtio-input-hid.c | 1 -
 hw/usb/Kconfig              | 1 -
 4 files changed, 2 insertions(+), 3 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:16:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:16:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16553.40874 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYch2-0001Pv-7f; Fri, 30 Oct 2020 22:16:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16553.40874; Fri, 30 Oct 2020 22:16:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYch2-0001Pl-4Y; Fri, 30 Oct 2020 22:16:20 +0000
Received: by outflank-mailman (input) for mailman id 16553;
 Fri, 30 Oct 2020 22:16:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYch1-0001Pa-4b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d3cfaf0c-d395-4561-b957-fd4cd04334c7;
 Fri, 30 Oct 2020 22:16:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYch0-0004nc-5K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYch0-0003PM-43
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:18 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYch1-0001Pa-4b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:19 +0000
X-Inumbo-ID: d3cfaf0c-d395-4561-b957-fd4cd04334c7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d3cfaf0c-d395-4561-b957-fd4cd04334c7;
	Fri, 30 Oct 2020 22:16:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OgZ7PetkWV6LnCufCqbWlCAipqOJpUj4iepRJmGM6K8=; b=ntvRfghMTYrlwemLBA8Mvi2X1U
	qLwFokqqlqvog7+61HgU/ZrZxewtPRXe8CzMMepbFwp5K+1LBA+EARTEYlwM/BwrW4MRPySgVVJeA
	N6W6YbIrC3R7+MyRpO0cbt8mi5vqr1yoHZCZTsRwZrFF8F7qvx53SL37mvAYBeeqx0bg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYch0-0004nc-5K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYch0-0003PM-43
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
Message-Id: <E1kYch0-0003PM-43@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:18 +0000

commit d64072c0ac6f73413026695bb33a4aa232e69617
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 23 13:58:44 2020 +0200
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
    
    This reverts commit d10e05f15d5c3dd5e5cc59c5dfff460d89d48580.
    
    We report some -tpmdev failures, but then continue as if all was fine.
    Reproducer:
    
        $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -chardev null,id=tpm0 -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
        qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: tpm chardev 'chrtpm' not found.
        qemu-system-x86_64: -tpmdev emulator,id=tpm0,chardev=chrtpm: tpm-emulator: Could not cleanly shutdown the TPM: No such file or directory
        QEMU 5.0.90 monitor - type 'help' for more information
        (qemu) qemu-system-x86_64: -device tpm-tis,tpmdev=tpm0: Property 'tpm-tis.tpmdev' can't find value 'tpm0'
        $ echo $?
        1
    
    This is a regression caused by commit d10e05f15d "tpm: Clean up error
    reporting in tpm_init_tpmdev()".  It's incomplete: be->create(opts)
    continues to use error_report(), and we don't set an error when it
    fails.
    
    I figure converting the create() methods to Error would make some
    sense, but I'm not sure it's worth the effort right now.  Revert the
    broken commit instead, and add a comment to tpm_init_tpmdev().
    
    Straightforward conflict in tpm.c resolved.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 include/sysemu/tpm.h |  2 +-
 softmmu/vl.c         |  4 +++-
 stubs/tpm.c          |  3 ++-
 tpm.c                | 30 +++++++++++++++++++++---------
 4 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
index 03fb25941c..730c61ac97 100644
--- a/include/sysemu/tpm.h
+++ b/include/sysemu/tpm.h
@@ -16,7 +16,7 @@
 #include "qom/object.h"
 
 int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
-void tpm_init(void);
+int tpm_init(void);
 void tpm_cleanup(void);
 
 typedef enum TPMVersion {
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3416241557..660537a709 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4258,7 +4258,9 @@ void qemu_init(int argc, char **argv, char **envp)
                       user_creatable_add_opts_foreach,
                       object_create_delayed, &error_fatal);
 
-    tpm_init();
+    if (tpm_init() < 0) {
+        exit(1);
+    }
 
     blk_mig_init();
     ram_mig_init();
diff --git a/stubs/tpm.c b/stubs/tpm.c
index 66c99d667d..9bded191d9 100644
--- a/stubs/tpm.c
+++ b/stubs/tpm.c
@@ -10,8 +10,9 @@
 #include "sysemu/tpm.h"
 #include "hw/acpi/tpm.h"
 
-void tpm_init(void)
+int tpm_init(void)
 {
+    return 0;
 }
 
 void tpm_cleanup(void)
diff --git a/tpm.c b/tpm.c
index fe03b24858..f6045bb6da 100644
--- a/tpm.c
+++ b/tpm.c
@@ -81,26 +81,33 @@ TPMBackend *qemu_find_tpm_be(const char *id)
 
 static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
 {
+    /*
+     * Use of error_report() in a function with an Error ** parameter
+     * is suspicious.  It is okay here.  The parameter only exists to
+     * make the function usable with qemu_opts_foreach().  It is not
+     * actually used.
+     */
     const char *value;
     const char *id;
     const TPMBackendClass *be;
     TPMBackend *drv;
+    Error *local_err = NULL;
     int i;
 
     if (!QLIST_EMPTY(&tpm_backends)) {
-        error_setg(errp, "Only one TPM is allowed.");
+        error_report("Only one TPM is allowed.");
         return 1;
     }
 
     id = qemu_opts_id(opts);
     if (id == NULL) {
-        error_setg(errp, QERR_MISSING_PARAMETER, "id");
+        error_report(QERR_MISSING_PARAMETER, "id");
         return 1;
     }
 
     value = qemu_opt_get(opts, "type");
     if (!value) {
-        error_setg(errp, QERR_MISSING_PARAMETER, "type");
+        error_report(QERR_MISSING_PARAMETER, "type");
         tpm_display_backend_drivers();
         return 1;
     }
@@ -108,14 +115,15 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
     i = qapi_enum_parse(&TpmType_lookup, value, -1, NULL);
     be = i >= 0 ? tpm_be_find_by_type(i) : NULL;
     if (be == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type",
-                   "a TPM backend type");
+        error_report(QERR_INVALID_PARAMETER_VALUE,
+                     "type", "a TPM backend type");
         tpm_display_backend_drivers();
         return 1;
     }
 
     /* validate backend specific opts */
-    if (!qemu_opts_validate(opts, be->opts, errp)) {
+    if (!qemu_opts_validate(opts, be->opts, &local_err)) {
+        error_report_err(local_err);
         return 1;
     }
 
@@ -148,10 +156,14 @@ void tpm_cleanup(void)
  * Initialize the TPM. Process the tpmdev command line options describing the
  * TPM backend.
  */
-void tpm_init(void)
+int tpm_init(void)
 {
-    qemu_opts_foreach(qemu_find_opts("tpmdev"),
-                      tpm_init_tpmdev, NULL, &error_fatal);
+    if (qemu_opts_foreach(qemu_find_opts("tpmdev"),
+                          tpm_init_tpmdev, NULL, NULL)) {
+        return -1;
+    }
+
+    return 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:16:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:16:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16554.40878 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchC-0001RA-97; Fri, 30 Oct 2020 22:16:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16554.40878; Fri, 30 Oct 2020 22:16:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchC-0001R0-64; Fri, 30 Oct 2020 22:16:30 +0000
Received: by outflank-mailman (input) for mailman id 16554;
 Fri, 30 Oct 2020 22:16:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYchB-0001Qr-29
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1ab2f262-1788-4027-ae54-75f41f653f8e;
 Fri, 30 Oct 2020 22:16:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchA-0004nk-8s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchA-0003Pw-8B
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYchB-0001Qr-29
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:29 +0000
X-Inumbo-ID: 1ab2f262-1788-4027-ae54-75f41f653f8e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1ab2f262-1788-4027-ae54-75f41f653f8e;
	Fri, 30 Oct 2020 22:16:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H6sKECGgGin+jIU77DC3Nelu288fWQ0VfdFjPcZItyY=; b=xoHTVJhd9Ef5FmzDX0MmoyqgIK
	phU++vuHUfMvmGRMd8Ag4XlN0RJHZsrPgL5YpCMq78agBwio25Sf7g5lHB1Y1HOc1kpr08iUbmwsN
	2nQt8LXWlaDWeWsIG2WWZVTLfTbwx5K8MgdL3BKS4pbFr0COvDNq6EQIQhwl/OU7oJP8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchA-0004nk-8s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchA-0003Pw-8B
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tpm: Improve help on TPM types when none are available
Message-Id: <E1kYchA-0003Pw-8B@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:28 +0000

commit 5a6791c3d4a7719e8d0797afe0e2822a54bda6a2
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 23 13:58:45 2020 +0200
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    tpm: Improve help on TPM types when none are available
    
    Help is a bit awkward when no TPM types are built into QEMU:
    
        $ qemu-system-x86_64 -tpmdev nonexistent,id=tpm0
        qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
        Supported TPM types (choose only one):
    
    Improve to
    
        qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
        No TPM backend types are available
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 tpm.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/tpm.c b/tpm.c
index f6045bb6da..cab206355a 100644
--- a/tpm.c
+++ b/tpm.c
@@ -47,18 +47,23 @@ tpm_be_find_by_type(enum TpmType type)
  */
 static void tpm_display_backend_drivers(void)
 {
+    bool got_one = false;
     int i;
 
-    fprintf(stderr, "Supported TPM types (choose only one):\n");
-
     for (i = 0; i < TPM_TYPE__MAX; i++) {
         const TPMBackendClass *bc = tpm_be_find_by_type(i);
         if (!bc) {
             continue;
         }
-        fprintf(stderr, "%12s   %s\n", TpmType_str(i), bc->desc);
+        if (!got_one) {
+            error_printf("Supported TPM types (choose only one):\n");
+            got_one = true;
+        }
+        error_printf("%12s   %s\n", TpmType_str(i), bc->desc);
+    }
+    if (!got_one) {
+        error_printf("No TPM backend types are available\n");
     }
-    fprintf(stderr, "\n");
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:16:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:16:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16555.40882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchM-0001TB-Al; Fri, 30 Oct 2020 22:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16555.40882; Fri, 30 Oct 2020 22:16:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchM-0001T3-7f; Fri, 30 Oct 2020 22:16:40 +0000
Received: by outflank-mailman (input) for mailman id 16555;
 Fri, 30 Oct 2020 22:16:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYchL-0001SD-7f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e8faac8-5721-4dd0-a312-df843516c5d1;
 Fri, 30 Oct 2020 22:16:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchK-0004nu-Ca
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchK-0003QW-Bo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYchL-0001SD-7f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:39 +0000
X-Inumbo-ID: 6e8faac8-5721-4dd0-a312-df843516c5d1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e8faac8-5721-4dd0-a312-df843516c5d1;
	Fri, 30 Oct 2020 22:16:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IV3LXpz9IW6ETqcrqFZgN1TJyRBgz7IWCj/qiNu/Uyw=; b=1varYuZFMEGVdzY8r6OCBw0vp4
	RYekXgObyVnPaxpnPgTF2COO76V2tHTTte3GGDIix/9rK8UJ72/Wk55UF/RDSDO4J2etDIQIMmg/v
	wdRna1gVP+FQV/+WfhdBZzc/Kep+3qDO4vbQrBbFH0lhxnOuCb2A2Gq0+2M9A5gDw01I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchK-0004nu-Ca
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchK-0003QW-Bo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tpm_emulator: Report an error if chardev is missing
Message-Id: <E1kYchK-0003QW-Bo@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:38 +0000

commit 88f830745721ba8c9e9d2831c01045a6f130c1a6
Author:     Stefan Berger <stefanb@linux.vnet.ibm.com>
AuthorDate: Fri Jul 24 08:57:26 2020 -0400
Commit:     Stefan Berger <stefanb@linux.vnet.ibm.com>
CommitDate: Fri Jul 24 12:44:13 2020 -0400

    tpm_emulator: Report an error if chardev is missing
    
    This patch fixes the odd error reporting when trying to send a file
    descriptor to the TPM emulator if one has not passed a valid chardev.
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev emulator,id=tpm0
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: Failed to send CMD_SET_DATAFD: Success
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: Could not cleanly shutdown the TPM: Success
    
    This is the new error report:
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev emulator,id=tpm0
    qemu-system-x86_64: -tpmdev emulator,id=tpm0: tpm-emulator: parameter 'chardev' is missing
    
    This change does not hide the display of supported TPM types if a non-existent type is passed:
    
    $ x86_64-softmmu/qemu-system-x86_64 -tpmdev nonexistent,id=tpm0
    qemu-system-x86_64: -tpmdev nonexistent,id=tpm0: Parameter 'type' expects a TPM backend type
    Supported TPM types (choose only one):
     passthrough   Passthrough TPM backend driver
        emulator   TPM emulator backend driver
    
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 backends/tpm/tpm_emulator.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
index 9605339f93..a9b0f55e67 100644
--- a/backends/tpm/tpm_emulator.c
+++ b/backends/tpm/tpm_emulator.c
@@ -549,27 +549,30 @@ err_exit:
 static int tpm_emulator_handle_device_opts(TPMEmulator *tpm_emu, QemuOpts *opts)
 {
     const char *value;
+    Error *err = NULL;
+    Chardev *dev;
 
     value = qemu_opt_get(opts, "chardev");
-    if (value) {
-        Error *err = NULL;
-        Chardev *dev = qemu_chr_find(value);
-
-        if (!dev) {
-            error_report("tpm-emulator: tpm chardev '%s' not found.", value);
-            goto err;
-        }
+    if (!value) {
+        error_report("tpm-emulator: parameter 'chardev' is missing");
+        goto err;
+    }
 
-        if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
-            error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
-                          value);
-            error_report_err(err);
-            goto err;
-        }
+    dev = qemu_chr_find(value);
+    if (!dev) {
+        error_report("tpm-emulator: tpm chardev '%s' not found", value);
+        goto err;
+    }
 
-        tpm_emu->options->chardev = g_strdup(value);
+    if (!qemu_chr_fe_init(&tpm_emu->ctrl_chr, dev, &err)) {
+        error_prepend(&err, "tpm-emulator: No valid chardev found at '%s':",
+                      value);
+        error_report_err(err);
+        goto err;
     }
 
+    tpm_emu->options->chardev = g_strdup(value);
+
     if (tpm_emulator_prepare_data_fd(tpm_emu) < 0) {
         goto err;
     }
@@ -925,6 +928,11 @@ static void tpm_emulator_shutdown(TPMEmulator *tpm_emu)
 {
     ptm_res res;
 
+    if (!tpm_emu->options->chardev) {
+        /* was never properly initialized */
+        return;
+    }
+
     if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SHUTDOWN, &res, 0, sizeof(res)) < 0) {
         error_report("tpm-emulator: Could not cleanly shutdown the TPM: %s",
                      strerror(errno));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:16:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:16:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16556.40886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchW-0001UO-CR; Fri, 30 Oct 2020 22:16:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16556.40886; Fri, 30 Oct 2020 22:16:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchW-0001UG-9I; Fri, 30 Oct 2020 22:16:50 +0000
Received: by outflank-mailman (input) for mailman id 16556;
 Fri, 30 Oct 2020 22:16:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYchV-0001U6-GQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 266bf5a5-8f14-472c-a81d-8613d21fb20d;
 Fri, 30 Oct 2020 22:16:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchU-0004oW-HD
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchU-0003R4-FV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:48 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYchV-0001U6-GQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:49 +0000
X-Inumbo-ID: 266bf5a5-8f14-472c-a81d-8613d21fb20d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 266bf5a5-8f14-472c-a81d-8613d21fb20d;
	Fri, 30 Oct 2020 22:16:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wKCQ8IFedE5OvZddFhBSA4lqL3h7zScFiWiqIS4crzs=; b=2mlp6pgS5g9Ceku+BNF5GqxHWU
	N+heA+78OzdMhmPTN0AxyqriGt38f/KM8I6N1cjKH/2NC8emPpZpOW8zoobT97CQfW/b735CMAVBB
	st/4ny8ZrVGMv+SSTG/bKoiQx9PynzDeeNbnTwXja8l89qjq8y7lsHPQQ/Z5Mb2MF/K8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchU-0004oW-HD
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchU-0003R4-FV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-24-1' into staging
Message-Id: <E1kYchU-0003R4-FV@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:48 +0000

commit 57cdde4a74dd0d68df9e32657773484a5484a027
Merge: b0ce3f021e0157e9a5ab836cb162c48caac132e1 88f830745721ba8c9e9d2831c01045a6f130c1a6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sat Jul 25 20:30:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sat Jul 25 20:30:58 2020 +0100

    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-07-24-1' into staging
    
    Merge tpm 2020/07/24 v1
    
    # gpg: Signature made Sat 25 Jul 2020 01:13:22 BST
    # gpg:                using RSA key B818B9CADF9089C2D5CEC66B75AD65802A0B4211
    # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
    
    * remotes/stefanberger/tags/pull-tpm-2020-07-24-1:
      tpm_emulator: Report an error if chardev is missing
      tpm: Improve help on TPM types when none are available
      Revert "tpm: Clean up error reporting in tpm_init_tpmdev()"
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 backends/tpm/tpm_emulator.c | 38 +++++++++++++++++++++++---------------
 include/sysemu/tpm.h        |  2 +-
 softmmu/vl.c                |  4 +++-
 stubs/tpm.c                 |  3 ++-
 tpm.c                       | 43 ++++++++++++++++++++++++++++++-------------
 5 files changed, 59 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16557.40891 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchh-0001Vg-F3; Fri, 30 Oct 2020 22:17:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16557.40891; Fri, 30 Oct 2020 22:17:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchh-0001VY-At; Fri, 30 Oct 2020 22:17:01 +0000
Received: by outflank-mailman (input) for mailman id 16557;
 Fri, 30 Oct 2020 22:16:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYchf-0001VO-Pp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5c2bdc57-bd17-4814-8a08-bfce707f0b53;
 Fri, 30 Oct 2020 22:16:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYche-0004od-TA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYche-0003S7-SN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYchf-0001VO-Pp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:59 +0000
X-Inumbo-ID: 5c2bdc57-bd17-4814-8a08-bfce707f0b53
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5c2bdc57-bd17-4814-8a08-bfce707f0b53;
	Fri, 30 Oct 2020 22:16:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xVZ7zCJiV8bIodMBD2LdGElVayNW/heyqbkECRmTPH8=; b=GWYExHi8z+wJnrJW9hViJXT/WJ
	RTw/Y2nDKTpJJEbJm59RH1Nn/bQqJHygs3UCD9DpT+wqo4CmZcHdMykKfijOtFi1EsDJKEy7RsGpF
	H1FAkddO0kIrl029uIsLMTEqeBlH+vUfW+1KWDKlSgKbsKKtyAiV5CW1p5VtQlkirOsk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYche-0004od-TA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYche-0003S7-SN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:16:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tcg: update comments for save_iotlb_data in cputlb
Message-Id: <E1kYche-0003S7-SN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:16:58 +0000

commit 570ef3093b5ed327249397ad0295cf01c67d9db4
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Mon Jul 20 13:23:58 2020 +0100
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:25:11 2020 -0700

    tcg: update comments for save_iotlb_data in cputlb
    
    I missed Emilio's review comments:
    
      Message-ID: <20200718205107.GA994221@sff>
    
    and the patch got merged. Correcting the comments now.
    
    Reviewed-by: Emilio G. Cota <cota@braap.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200720122358.26881-1-alex.bennee@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cputlb.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index d370aedb47..5698292749 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1075,10 +1075,8 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
 
 /*
  * Save a potentially trashed IOTLB entry for later lookup by plugin.
- *
- * We also need to track the thread storage address because the RCU
- * cleanup that runs when we leave the critical region (the current
- * execution) is actually in a different thread.
+ * This is read by tlb_plugin_lookup if the iotlb entry doesn't match
+ * because of the side effect of io_writex changing memory layout.
  */
 static void save_iotlb_data(CPUState *cs, hwaddr addr,
                             MemoryRegionSection *section, hwaddr mr_offset)
@@ -1408,8 +1406,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
  * This almost never fails as the memory access being instrumented
  * should have just filled the TLB. The one corner case is io_writex
  * which can cause TLB flushes and potential resizing of the TLBs
- * loosing the information we need. In those cases we need to recover
- * data from a copy of the io_tlb entry.
+ * losing the information we need. In those cases we need to recover
+ * data from a copy of the iotlbentry. As long as this always occurs
+ * from the same thread (which a mem callback will be) this is safe.
  */
 
 bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16558.40894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchq-0001X1-Gn; Fri, 30 Oct 2020 22:17:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16558.40894; Fri, 30 Oct 2020 22:17:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYchq-0001Wt-Du; Fri, 30 Oct 2020 22:17:10 +0000
Received: by outflank-mailman (input) for mailman id 16558;
 Fri, 30 Oct 2020 22:17:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYchp-0001Wl-QE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e4d6a943-35b6-484a-9749-124a20fc5d6a;
 Fri, 30 Oct 2020 22:17:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchp-0004p0-2O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchp-0003Sp-0B
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYchp-0001Wl-QE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
X-Inumbo-ID: e4d6a943-35b6-484a-9749-124a20fc5d6a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e4d6a943-35b6-484a-9749-124a20fc5d6a;
	Fri, 30 Oct 2020 22:17:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5b9Ku04Hx+M4/GUtptmpujWizE7MJKPjoBY+Iii8s9o=; b=QxZcDaALzXaseGrLyU4UNPigt0
	LDF58ClE48Bm2A0zpyJc4LLtjtxvXEhsYm+ap6Yx6lLr8BoyYi5A0aLyiVrz+ncWWaHAJilPw1E++
	DPanQZaTpfVtR0C9h88Jo8KPZrEryXJ4SCZ2dJPY7Xev1gTeAvNLSYdPXWakMk6Dvv9A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchp-0004p0-2O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchp-0003Sp-0B
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/hppa: Free some temps in do_sub
Message-Id: <E1kYchp-0003Sp-0B@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:17:09 +0000

commit 79826f99feb7222b7804058f0b4ace9ee0546361
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 10:35:00 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:28:33 2020 -0700

    target/hppa: Free some temps in do_sub
    
    Two temps allocated but not freed.  Do enough subtractions
    within a single TB and one can run out of temps entirely.
    
    Fixes: b2167459ae ("target-hppa: Implement basic arithmetic")
    Buglink: https://bugs.launchpad.net/qemu/+bug/1880287
    Tested-by: Sven Schnelle <svens@stackframe.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720174039.517902-1-richard.henderson@linaro.org>
---
 target/hppa/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 52d7bea1ea..4bd22d4820 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1294,6 +1294,8 @@ static void do_sub(DisasContext *ctx, unsigned rt, TCGv_reg in1,
     save_or_nullify(ctx, cpu_psw_cb_msb, cb_msb);
     save_gpr(ctx, rt, dest);
     tcg_temp_free(dest);
+    tcg_temp_free(cb);
+    tcg_temp_free(cb_msb);
 
     /* Install the new nullification.  */
     cond_free(&ctx->null_cond);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16559.40898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYci1-0001YR-IU; Fri, 30 Oct 2020 22:17:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16559.40898; Fri, 30 Oct 2020 22:17:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYci1-0001YJ-FR; Fri, 30 Oct 2020 22:17:21 +0000
Received: by outflank-mailman (input) for mailman id 16559;
 Fri, 30 Oct 2020 22:17:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYci0-0001Y9-42
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 20a18e8f-7c73-4423-a6b2-b001856008d6;
 Fri, 30 Oct 2020 22:17:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchz-0004pA-6X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYchz-0003TV-5h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYci0-0001Y9-42
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:20 +0000
X-Inumbo-ID: 20a18e8f-7c73-4423-a6b2-b001856008d6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 20a18e8f-7c73-4423-a6b2-b001856008d6;
	Fri, 30 Oct 2020 22:17:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9ILhcnrVqQA+RSYeHhHlzo29ua88KhZvMJswVBMPTj0=; b=c6vvywmEiHzBLqYxQR1HtvIyqd
	HPyLaNBTlc5KB2DIkVPNedzM0B2o+CscJVkLvSACKot3DGDQYiNcevGXFP/FMUY3UXy4JhJkosXuz
	uBu4I7M+lDKvheT0GA403PLm6Sgm34VKdVfGG+ImwuPLimEd5sbS64VsLttD0PHsZ9ic=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchz-0004pA-6X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYchz-0003TV-5h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/i386: Save cc_op before loop insns
Message-Id: <E1kYchz-0003TV-5h@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:17:19 +0000

commit 3cb3a7720b01830abd5fbb81819dbb9271bf7821
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 20 08:30:40 2020 -0700
Commit:     Richard Henderson <richard.henderson@linaro.org>
CommitDate: Fri Jul 24 14:29:35 2020 -0700

    target/i386: Save cc_op before loop insns
    
    We forgot to update cc_op before these branch insns,
    which lead to losing track of the current eflags.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1888165
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200720154028.477457-1-richard.henderson@linaro.org>
---
 target/i386/translate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/translate.c b/target/i386/translate.c
index a1d31f09c1..caea6f5fb1 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
             l1 = gen_new_label();
             l2 = gen_new_label();
             l3 = gen_new_label();
+            gen_update_cc_op(s);
             b &= 3;
             switch(b) {
             case 0: /* loopnz */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16560.40902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciB-0001Zh-K5; Fri, 30 Oct 2020 22:17:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16560.40902; Fri, 30 Oct 2020 22:17:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciB-0001ZZ-H1; Fri, 30 Oct 2020 22:17:31 +0000
Received: by outflank-mailman (input) for mailman id 16560;
 Fri, 30 Oct 2020 22:17:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYciA-0001ZN-Aa
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d2717163-577e-4a37-a61a-7f2f0fc96029;
 Fri, 30 Oct 2020 22:17:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYci9-0004pK-AR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYci9-0003U5-9g
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYciA-0001ZN-Aa
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:30 +0000
X-Inumbo-ID: d2717163-577e-4a37-a61a-7f2f0fc96029
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d2717163-577e-4a37-a61a-7f2f0fc96029;
	Fri, 30 Oct 2020 22:17:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DsZCaBHok100Hj8WPba+T87NpHKz2bUQD9+Ht+v0MY8=; b=LGLJfY01i8yNYXQtYNrnj09PdG
	Hwpq9xm6Pu2UdFyld5vAieWf1MTSaF3u0v9SkYt62SCXgKwd+paAwrJHREHvX96LbsKuWq68XX/y0
	kIdlZ/ryuHlhtMuX2OM9GzvT4ad0/dUN0A/vuXVnuSu/elMVEDg/U3NF4B/1UpSlbo/8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYci9-0004pK-AR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYci9-0003U5-9g
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200725' into staging
Message-Id: <E1kYci9-0003U5-9g@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:17:29 +0000

commit 194f8ca825854abef3aceca1ed7eb5a53b08751f
Merge: 57cdde4a74dd0d68df9e32657773484a5484a027 3cb3a7720b01830abd5fbb81819dbb9271bf7821
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Sun Jul 26 17:17:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Sun Jul 26 17:17:58 2020 +0100

    Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200725' into staging
    
    Fix some cputlb commentary
    Fix an hppa temporary leak
    Fix an i386 translation issue with loop insns
    
    # gpg: Signature made Sat 25 Jul 2020 17:03:59 BST
    # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
    # gpg:                issuer "richard.henderson@linaro.org"
    # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
    # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
    
    * remotes/rth/tags/pull-tcg-20200725:
      target/i386: Save cc_op before loop insns
      target/hppa: Free some temps in do_sub
      tcg: update comments for save_iotlb_data in cputlb
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/tcg/cputlb.c      | 11 +++++------
 target/hppa/translate.c |  2 ++
 target/i386/translate.c |  1 +
 3 files changed, 8 insertions(+), 6 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16561.40906 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciL-0001bV-Lz; Fri, 30 Oct 2020 22:17:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16561.40906; Fri, 30 Oct 2020 22:17:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciL-0001bN-Ia; Fri, 30 Oct 2020 22:17:41 +0000
Received: by outflank-mailman (input) for mailman id 16561;
 Fri, 30 Oct 2020 22:17:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYciK-0001bB-JQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7a9f3097-a4e5-4479-b7fd-30a879a5a7a5;
 Fri, 30 Oct 2020 22:17:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciJ-0004rc-Lm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciJ-0003WN-Kz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYciK-0001bB-JQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:40 +0000
X-Inumbo-ID: 7a9f3097-a4e5-4479-b7fd-30a879a5a7a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7a9f3097-a4e5-4479-b7fd-30a879a5a7a5;
	Fri, 30 Oct 2020 22:17:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dhF9XIPNkO2P63MOBRW++bF5Dfgpsd7xalDocagwj0g=; b=KB5LbyHOO8T/cbX0ff/M+MFssa
	B7RwVdjBb6dFWTwf8nkIWWwW+I/OMV+1zFBCT82x/lt/t9cAsgFAhUmohzEVUcn0do5npJ/jXwmT+
	OR9F/eqZDxsq1B2d97bA0rq46GiGmZN1IQuPP5AchQqQGAOV6kGXeeLNus/TuJw/6qlA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciJ-0004rc-Lm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciJ-0003WN-Kz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] pseries: fix kvmppc_set_fwnmi()
Message-Id: <E1kYciJ-0003WN-Kz@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:17:39 +0000

commit aef92d87c59d257c0ff24ba1dc82506a03f1f522
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Fri Jul 24 10:35:33 2020 +0200
Commit:     David Gibson <david@gibson.dropbear.id.au>
CommitDate: Mon Jul 27 11:09:25 2020 +1000

    pseries: fix kvmppc_set_fwnmi()
    
    QEMU issues the ioctl(KVM_CAP_PPC_FWNMI) on the first vCPU.
    
    If the first vCPU is currently running, the vCPU mutex is held
    and the ioctl() cannot be done and waits until the mutex is released.
    This never happens and the VM is stuck.
    
    To avoid this deadlock, issue the ioctl on the same vCPU doing the
    RTAS call.
    
    The problem can be reproduced by booting a guest with several vCPUs
    (the probability to have the problem is (n - 1) / n,  n = # of CPUs),
    and then by triggering a kernel crash with "echo c >/proc/sysrq-trigger".
    
    On the reboot, the kernel hangs after:
    
    ...
    [    0.000000] -----------------------------------------------------
    [    0.000000] ppc64_pft_size    = 0x0
    [    0.000000] phys_mem_size     = 0x48000000
    [    0.000000] dcache_bsize      = 0x80
    [    0.000000] icache_bsize      = 0x80
    [    0.000000] cpu_features      = 0x0001c06f8f4f91a7
    [    0.000000]   possible        = 0x0003fbffcf5fb1a7
    [    0.000000]   always          = 0x00000003800081a1
    [    0.000000] cpu_user_features = 0xdc0065c2 0xaee00000
    [    0.000000] mmu_features      = 0x3c006041
    [    0.000000] firmware_features = 0x00000085455a445f
    [    0.000000] physical_start    = 0x8000000
    [    0.000000] -----------------------------------------------------
    [    0.000000] numa:   NODE_DATA [mem 0x47f33c80-0x47f3ffff]
    
    Fixes: ec010c00665b ("ppc/spapr: KVM FWNMI should not be enabled until guest requests it")
    Cc: npiggin@gmail.com
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-Id: <20200724083533.281700-1-lvivier@redhat.com>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_rtas.c  | 2 +-
 target/ppc/kvm.c     | 3 +--
 target/ppc/kvm_ppc.h | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index bcac0d00e7..513c7a8435 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -438,7 +438,7 @@ static void rtas_ibm_nmi_register(PowerPCCPU *cpu,
     }
 
     if (kvm_enabled()) {
-        if (kvmppc_set_fwnmi() < 0) {
+        if (kvmppc_set_fwnmi(cpu) < 0) {
             rtas_st(rets, 0, RTAS_OUT_NOT_SUPPORTED);
             return;
         }
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 2692f76130..d85ba8ffe0 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2071,9 +2071,8 @@ bool kvmppc_get_fwnmi(void)
     return cap_fwnmi;
 }
 
-int kvmppc_set_fwnmi(void)
+int kvmppc_set_fwnmi(PowerPCCPU *cpu)
 {
-    PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
     CPUState *cs = CPU(cpu);
 
     return kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_FWNMI, 0);
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index 701c0c262b..72e05f1cd2 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -28,7 +28,7 @@ void kvmppc_set_papr(PowerPCCPU *cpu);
 int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr);
 void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy);
 bool kvmppc_get_fwnmi(void);
-int kvmppc_set_fwnmi(void);
+int kvmppc_set_fwnmi(PowerPCCPU *cpu);
 int kvmppc_smt_threads(void);
 void kvmppc_error_append_smt_possible_hint(Error *const *errp);
 int kvmppc_set_smt_threads(int smt);
@@ -169,7 +169,7 @@ static inline bool kvmppc_get_fwnmi(void)
     return false;
 }
 
-static inline int kvmppc_set_fwnmi(void)
+static inline int kvmppc_set_fwnmi(PowerPCCPU *cpu)
 {
     return -1;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:17:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:17:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16562.40910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciV-0001co-N5; Fri, 30 Oct 2020 22:17:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16562.40910; Fri, 30 Oct 2020 22:17:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciV-0001cf-K5; Fri, 30 Oct 2020 22:17:51 +0000
Received: by outflank-mailman (input) for mailman id 16562;
 Fri, 30 Oct 2020 22:17:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYciU-0001cR-HP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 89c7db86-84a9-4f03-b5e2-f3232536c343;
 Fri, 30 Oct 2020 22:17:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciT-0004rk-QE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciT-0003X7-Oq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYciU-0001cR-HP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:50 +0000
X-Inumbo-ID: 89c7db86-84a9-4f03-b5e2-f3232536c343
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 89c7db86-84a9-4f03-b5e2-f3232536c343;
	Fri, 30 Oct 2020 22:17:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Wa9df4MoYg5o3mc5X/84bbj8DuxKa9o9j+3LdUBZ/3w=; b=25XYazss4KmfVgbe0ZAPUUfBQb
	4Hkbka0QytsUr6sF0euaykw+O3VeY7ssOLmxaMR0EVm+FHbbz7+Rl5SD+HZeIvZk8caBrNNsYP+d+
	z+u0tqRJdu615u+VIZdXcT5zfSx+MREXvenP4stS/rzCyn2iM9uy+mdtjhrn9eBmjWJ4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciT-0004rk-QE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciT-0003X7-Oq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:17:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging
Message-Id: <E1kYciT-0003X7-Oq@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:17:49 +0000

commit 4215d3413272ad6d1c6c9d0234450b602e46a74c
Merge: 194f8ca825854abef3aceca1ed7eb5a53b08751f aef92d87c59d257c0ff24ba1dc82506a03f1f522
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 09:33:04 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 09:33:04 2020 +0100

    Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200727' into staging
    
    ppc patch queue 2020-07-27
    
    Only one patch in this batch, but it fixes a fairly important
    regression, so we want it in qemu-5.1
    
    # gpg: Signature made Mon 27 Jul 2020 06:51:57 BST
    # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
    # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
    # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
    # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
    # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
    # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
    
    * remotes/dgibson/tags/ppc-for-5.1-20200727:
      pseries: fix kvmppc_set_fwnmi()
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/ppc/spapr_rtas.c  | 2 +-
 target/ppc/kvm.c     | 3 +--
 target/ppc/kvm_ppc.h | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16563.40914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcih-0001fj-On; Fri, 30 Oct 2020 22:18:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16563.40914; Fri, 30 Oct 2020 22:18:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcih-0001fb-Lm; Fri, 30 Oct 2020 22:18:03 +0000
Received: by outflank-mailman (input) for mailman id 16563;
 Fri, 30 Oct 2020 22:18:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcig-0001fU-94
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:02 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 3bea8767-4845-41a2-9510-e91a322d1168;
 Fri, 30 Oct 2020 22:18:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcie-0004rs-DR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcie-0003a3-CY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcig-0001fU-94
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:02 +0000
X-Inumbo-ID: 3bea8767-4845-41a2-9510-e91a322d1168
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 3bea8767-4845-41a2-9510-e91a322d1168;
	Fri, 30 Oct 2020 22:18:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Z7PemNNyBVlVe1HEQHO1L9rwdxg6xeB+yhQ/lI8kudk=; b=2cXMrXCVkJ50VgGS4quGOxBWg2
	AfVUeVle/npVm8Q30Nw7hM6J4L7XEno8ZxC514NyubrSuPWEGgqzSOiMq609HkrkgrrgjuGhJWHah
	hKQLl1Ucykqz8dXpgYYGl33Tr9pCERUi8ZnLtR2B0+M+Yh06WhAO7rAw7fJLU4xD9ee0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcie-0004rs-DR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcie-0003a3-CY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] shippable: add one more qemu to registry url
Message-Id: <E1kYcie-0003a3-CY@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:00 +0000

commit 3b6b4997b378c4e7685ab7f04491f3077284df4c
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:54 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:39:57 2020 +0100

    shippable: add one more qemu to registry url
    
    The registry url is <project>/<repo>/qemu/<image>
    
    Perhaps we should rationalise that some day but for now.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200724064509.331-2-alex.bennee@linaro.org>
---
 .shippable.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.shippable.yml b/.shippable.yml
index f6b742432e..89d8be4291 100644
--- a/.shippable.yml
+++ b/.shippable.yml
@@ -27,7 +27,7 @@ env:
       TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
 build:
   pre_ci_boot:
-    image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE}
+    image_name: registry.gitlab.com/qemu-project/qemu/qemu/${IMAGE}
     image_tag: latest
     pull: true
     options: "-e HOME=/root"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16564.40917 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciq-0001gs-QB; Fri, 30 Oct 2020 22:18:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16564.40917; Fri, 30 Oct 2020 22:18:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYciq-0001gk-NL; Fri, 30 Oct 2020 22:18:12 +0000
Received: by outflank-mailman (input) for mailman id 16564;
 Fri, 30 Oct 2020 22:18:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcip-0001gc-Ju
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 09b2eb9d-eacd-47be-b0db-6bd92d3648b2;
 Fri, 30 Oct 2020 22:18:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcio-0004sD-HK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcio-0003ay-Ga
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcip-0001gc-Ju
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:11 +0000
X-Inumbo-ID: 09b2eb9d-eacd-47be-b0db-6bd92d3648b2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 09b2eb9d-eacd-47be-b0db-6bd92d3648b2;
	Fri, 30 Oct 2020 22:18:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G8XorDr4BLkvt47oULDKYQUpnIrlMtgeeEbcPigxGN0=; b=vuQ//T9SOEKpbKhfuVbBlHwo8h
	PKtabTNxudm1I6gk9mxZjvK8LZgHhV+DvzZi/XCEsVNAEcitZQ3QCW1b5o5Uhs1HzqnkVSq9dGH5+
	xoUL5Ajg4aLL4XAbMuUPX2RF11ETOPuE4j3HYy3RWMnxufR5D8HMOt7qIfcFlh7LY7Pg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcio-0004sD-HK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcio-0003ay-Ga
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] semihosting: defer connect_chardevs a little more to use serialx
Message-Id: <E1kYcio-0003ay-Ga@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:10 +0000

commit 619985e937c2f6a61ae7d52ae4e9973c83387dce
Author:     KONRAD Frederic <frederic.konrad@adacore.com>
AuthorDate: Fri Jul 24 07:44:55 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:03 2020 +0100

    semihosting: defer connect_chardevs a little more to use serialx
    
    With that we can just use -semihosting-config chardev=serial0.
    
    [AJB: tweak commit message]
    
    Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <1592215252-26742-1-git-send-email-frederic.konrad@adacore.com>
    Message-Id: <20200724064509.331-3-alex.bennee@linaro.org>
---
 softmmu/vl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 660537a709..4eb9d1f7fd 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4127,8 +4127,6 @@ void qemu_init(int argc, char **argv, char **envp)
 
     qemu_opts_foreach(qemu_find_opts("chardev"),
                       chardev_init_func, NULL, &error_fatal);
-    /* now chardevs have been created we may have semihosting to connect */
-    qemu_semihosting_connect_chardevs();
 
 #ifdef CONFIG_VIRTFS
     qemu_opts_foreach(qemu_find_opts("fsdev"),
@@ -4279,6 +4277,9 @@ void qemu_init(int argc, char **argv, char **envp)
     if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
         exit(1);
 
+    /* now chardevs have been created we may have semihosting to connect */
+    qemu_semihosting_connect_chardevs();
+
     /* If no default VGA is requested, the default is "none".  */
     if (default_vga) {
         vga_model = get_default_vga_model(machine_class);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16565.40922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcj0-0001iA-SU; Fri, 30 Oct 2020 22:18:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16565.40922; Fri, 30 Oct 2020 22:18:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcj0-0001i2-P1; Fri, 30 Oct 2020 22:18:22 +0000
Received: by outflank-mailman (input) for mailman id 16565;
 Fri, 30 Oct 2020 22:18:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYciz-0001ho-E9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 683e2170-2856-47a2-9bc5-b70feb3f2dfb;
 Fri, 30 Oct 2020 22:18:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciy-0004sL-LL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYciy-0003bj-KN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYciz-0001ho-E9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:21 +0000
X-Inumbo-ID: 683e2170-2856-47a2-9bc5-b70feb3f2dfb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 683e2170-2856-47a2-9bc5-b70feb3f2dfb;
	Fri, 30 Oct 2020 22:18:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wYWRqmb+B1dMefOB+0UW+oregQhx5uhZ/0WOrgkOkpI=; b=BjUFJeAZX2Gwo9GTNQ74CWAWHt
	k2w+pueopM1EIimTaaqtXCAxoxHwnisLyE/gVLxGo5vosuxx+xQ3lJSlY4VPTUeVUEaU+WV0L70/d
	0Au4cIeyll83jPZ5RYgXQYJWBG8Z1Nd/MoLzGpGPHfnWxcwODHJ49rACAxAVLXP4hHfs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciy-0004sL-LL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYciy-0003bj-KN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] semihosting: don't send the trailing '\0'
Message-Id: <E1kYciy-0003bj-KN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:20 +0000

commit 7d2d6522bbadfa8d9877e38bfa7413444fa64fbb
Author:     KONRAD Frederic <frederic.konrad@adacore.com>
AuthorDate: Fri Jul 24 07:44:56 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:08 2020 +0100

    semihosting: don't send the trailing '\0'
    
    Don't send the trailing 0 from the string.
    
    Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <1592215252-26742-2-git-send-email-frederic.konrad@adacore.com>
    Message-Id: <20200724064509.331-4-alex.bennee@linaro.org>
---
 hw/semihosting/console.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c
index 22e7827824..9b4fee9260 100644
--- a/hw/semihosting/console.c
+++ b/hw/semihosting/console.c
@@ -52,7 +52,9 @@ static GString *copy_user_string(CPUArchState *env, target_ulong addr)
 
     do {
         if (cpu_memory_rw_debug(cpu, addr++, &c, 1, 0) == 0) {
-            s = g_string_append_c(s, c);
+            if (c) {
+                s = g_string_append_c(s, c);
+            }
         } else {
             qemu_log_mask(LOG_GUEST_ERROR,
                           "%s: passed inaccessible address " TARGET_FMT_lx,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16566.40927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjA-0001jZ-W3; Fri, 30 Oct 2020 22:18:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16566.40927; Fri, 30 Oct 2020 22:18:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjA-0001jR-SK; Fri, 30 Oct 2020 22:18:32 +0000
Received: by outflank-mailman (input) for mailman id 16566;
 Fri, 30 Oct 2020 22:18:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcj9-0001jH-KQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id edfe298b-33a4-4e4a-9645-d779855fdccc;
 Fri, 30 Oct 2020 22:18:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcj8-0004sT-P2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcj8-0003cc-OI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcj9-0001jH-KQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:31 +0000
X-Inumbo-ID: edfe298b-33a4-4e4a-9645-d779855fdccc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id edfe298b-33a4-4e4a-9645-d779855fdccc;
	Fri, 30 Oct 2020 22:18:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L9DTB3CNchTjkvT3Ylob+O2agEM/AiGhfWC0D8kWwTs=; b=CgCYDdy9o305drdZw6YL0VPJ1u
	dBlEAaZRcAKohmQPWhYxoYmD8+PwJm8qaYxZ4ssxpg438kaLZ428/k6SEwAacR9GhmSwQXAa/Pxi6
	LJ3XtaFZ2a/tRTd0m39iXGpz5wybU7wiTt4D6juEE6IPWvL1LqlR2HUSXYqx6izgh4xM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcj8-0004sT-P2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcj8-0003cc-OI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] util: add qemu_get_host_physmem utility function
Message-Id: <E1kYcj8-0003cc-OI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:30 +0000

commit ad06ef0efbf7cafba5074a183fef1ad586f38caa
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:57 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:12 2020 +0100

    util: add qemu_get_host_physmem utility function
    
    This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES
    isn't standardised but at least appears in the man pages for
    Open/FreeBSD. The result is advisory so any users of it shouldn't just
    fail if we can't work it out.
    
    The win32 stub currently returns 0 until someone with a Windows system
    can develop and test a patch.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Cc: BALATON Zoltan <balaton@eik.bme.hu>
    Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Message-Id: <20200724064509.331-5-alex.bennee@linaro.org>
---
 include/qemu/osdep.h | 12 ++++++++++++
 util/oslib-posix.c   | 15 +++++++++++++++
 util/oslib-win32.c   |  6 ++++++
 3 files changed, 33 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 45c217aa28..0b1298b3c9 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -668,4 +668,16 @@ static inline void qemu_reset_optind(void)
  */
 char *qemu_get_host_name(Error **errp);
 
+/**
+ * qemu_get_host_physmem:
+ *
+ * Operating system agnostic way of querying host memory.
+ *
+ * Returns amount of physical memory on the system. This is purely
+ * advisery and may return 0 if we can't work it out. At the other
+ * end we saturate to SIZE_MAX if you are lucky enough to have that
+ * much memory.
+ */
+size_t qemu_get_host_physmem(void);
+
 #endif
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index d923674624..ad8001a4ad 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -841,3 +841,18 @@ char *qemu_get_host_name(Error **errp)
 
     return g_steal_pointer(&hostname);
 }
+
+size_t qemu_get_host_physmem(void)
+{
+#ifdef _SC_PHYS_PAGES
+    long pages = sysconf(_SC_PHYS_PAGES);
+    if (pages > 0) {
+        if (pages > SIZE_MAX / qemu_real_host_page_size) {
+            return SIZE_MAX;
+        } else {
+            return pages * qemu_real_host_page_size;
+        }
+    }
+#endif
+    return 0;
+}
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 7eedbe5859..31030463cc 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -828,3 +828,9 @@ char *qemu_get_host_name(Error **errp)
 
     return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
 }
+
+size_t qemu_get_host_physmem(void)
+{
+    /* currently unimplemented */
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16567.40930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjM-0001lY-0V; Fri, 30 Oct 2020 22:18:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16567.40930; Fri, 30 Oct 2020 22:18:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjL-0001lQ-Tq; Fri, 30 Oct 2020 22:18:43 +0000
Received: by outflank-mailman (input) for mailman id 16567;
 Fri, 30 Oct 2020 22:18:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcjK-0001lF-89
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 44aa2f0d-ee18-420e-9d66-0f59cf3ebcf0;
 Fri, 30 Oct 2020 22:18:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjI-0004t0-Sd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjI-0003dT-Rm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcjK-0001lF-89
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:42 +0000
X-Inumbo-ID: 44aa2f0d-ee18-420e-9d66-0f59cf3ebcf0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 44aa2f0d-ee18-420e-9d66-0f59cf3ebcf0;
	Fri, 30 Oct 2020 22:18:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=r4jYBkytS+vv+hwWoo8qcYPwg7nswYSmQ5A3MlRjwIA=; b=wBWRnLNZOD7UQZiYAgShkiEAVO
	Htd2BUazAttgUQerZ/I/co1jzcZOb8iS+sXdQSgCWdxovXRvabjD/ov6Y/zozTSshbiGp8JQbA32u
	R4WRE86MRk3LVG7dvZAB+tmbxiaJCV460fTT8ytjdTPkQD8IMJsuFxppatPIUWL96cq0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjI-0004t0-Sd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjI-0003dT-Rm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] util/oslib-win32: add qemu_get_host_physmem implementation
Message-Id: <E1kYcjI-0003dT-Rm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:40 +0000

commit 986babaab30279a4962648d03730bf1291d89f93
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:58 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    util/oslib-win32: add qemu_get_host_physmem implementation
    
    Compile tested only.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Message-Id: <20200724064509.331-6-alex.bennee@linaro.org>
---
 util/oslib-win32.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 31030463cc..c654dafd93 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -831,6 +831,11 @@ char *qemu_get_host_name(Error **errp)
 
 size_t qemu_get_host_physmem(void)
 {
-    /* currently unimplemented */
+    MEMORYSTATUSEX statex;
+    statex.dwLength = sizeof(statex);
+
+    if (GlobalMemoryStatusEx(&statex)) {
+        return statex.ullTotalPhys;
+    }
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:18:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16568.40934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjW-0001mn-1y; Fri, 30 Oct 2020 22:18:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16568.40934; Fri, 30 Oct 2020 22:18:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjV-0001mg-VI; Fri, 30 Oct 2020 22:18:53 +0000
Received: by outflank-mailman (input) for mailman id 16568;
 Fri, 30 Oct 2020 22:18:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcjU-0001mW-La
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 641eab5b-021e-49f6-b823-849afb8df66c;
 Fri, 30 Oct 2020 22:18:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjT-0004tD-18
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjS-0003eJ-VX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcjU-0001mW-La
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:52 +0000
X-Inumbo-ID: 641eab5b-021e-49f6-b823-849afb8df66c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 641eab5b-021e-49f6-b823-849afb8df66c;
	Fri, 30 Oct 2020 22:18:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sv3b3hY77CzEDwUH/StffXcq0pU51VvQuE55IwGjJy8=; b=VuThQtJLthzLXcNiBYCqGHCler
	RGfgdG95BsRpWV0Kq1p/dLoYC4vcYfEiA3YE/yqzPKcN09ROiKjBuuW2aiZfNJzCpleEshIScmK0i
	tx7HQgVqIV16v+vSoOFBjBkdqyBEXhzKx5TUAbZKcFiGaDW0wMba5iHIvBhCQU7Jmr7U=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjT-0004tD-18
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjS-0003eJ-VX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:18:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] accel/tcg: better handle memory constrained systems
Message-Id: <E1kYcjS-0003eJ-VX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:18:50 +0000

commit c83d628b7fba050e59ccf7bda050bc27af241b61
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:44:59 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    accel/tcg: better handle memory constrained systems
    
    It turns out there are some 64 bit systems that have relatively low
    amounts of physical memory available to them (typically CI system).
    Even with swapping available a 1GB translation buffer that fills up
    can put the machine under increased memory pressure. Detect these low
    memory situations and reduce tb_size appropriately.
    
    Fixes: 600e17b2615 ("accel/tcg: increase default code gen buffer size for 64 bit")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Robert Foley <robert.foley@linaro.org>
    Cc: BALATON Zoltan <balaton@eik.bme.hu>
    Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
    Message-Id: <20200724064509.331-7-alex.bennee@linaro.org>
---
 accel/tcg/translate-all.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 2afa46bd2b..2d83013633 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -976,7 +976,12 @@ static inline size_t size_code_gen_buffer(size_t tb_size)
 {
     /* Size the buffer.  */
     if (tb_size == 0) {
-        tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
+        size_t phys_mem = qemu_get_host_physmem();
+        if (phys_mem == 0) {
+            tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE;
+        } else {
+            tb_size = MIN(DEFAULT_CODE_GEN_BUFFER_SIZE, phys_mem / 8);
+        }
     }
     if (tb_size < MIN_CODE_GEN_BUFFER_SIZE) {
         tb_size = MIN_CODE_GEN_BUFFER_SIZE;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16569.40938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjh-0001o4-4o; Fri, 30 Oct 2020 22:19:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16569.40938; Fri, 30 Oct 2020 22:19:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjh-0001nw-0h; Fri, 30 Oct 2020 22:19:05 +0000
Received: by outflank-mailman (input) for mailman id 16569;
 Fri, 30 Oct 2020 22:19:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcjf-0001nm-AX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id ec3d1643-217a-4c59-b6e5-3b36b7cf55b4;
 Fri, 30 Oct 2020 22:19:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjd-0004tY-5i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjd-0003ez-41
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcjf-0001nm-AX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:03 +0000
X-Inumbo-ID: ec3d1643-217a-4c59-b6e5-3b36b7cf55b4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id ec3d1643-217a-4c59-b6e5-3b36b7cf55b4;
	Fri, 30 Oct 2020 22:19:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6hakGmFXGb0FsfVrBZhjbmRtWIpkTdUX2/Jjm583njg=; b=rtY8glgxhJU7T9W6QGu2vFuVQA
	DAg5M/Xjgqu4nJrtm45Scn+lA/aKN2nV6tcAbn5iPkLo7suzk1mp16kmjCAUuD0BBIeXc9nQEs35M
	R4w7d3HgQzK8SGr6kGc1JqeGv64zIVhpVZKSz06cP393I5U95Uq5LMwDWgpaYN7ZOHeg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjd-0004tY-5i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjd-0003ez-41
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/i386: floatx80: avoid compound literals in static initializers
Message-Id: <E1kYcjd-0003ez-41@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:01 +0000

commit 163b3d1af2552845a60967979aca8d78a6b1b088
Author:     Laszlo Ersek <lersek@redhat.com>
AuthorDate: Fri Jul 24 07:45:00 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:40:16 2020 +0100

    target/i386: floatx80: avoid compound literals in static initializers
    
    Quoting ISO C99 6.7.8p4, "All the expressions in an initializer for an
    object that has static storage duration shall be constant expressions or
    string literals".
    
    The compound literal produced by the make_floatx80() macro is not such a
    constant expression, per 6.6p7-9. (An implementation may accept it,
    according to 6.6p10, but is not required to.)
    
    Therefore using "floatx80_zero" and make_floatx80() for initializing
    "f2xm1_table" and "fpatan_table" is not portable. And gcc-4.8 in RHEL-7.6
    actually chokes on them:
    
    > target/i386/fpu_helper.c:871:5: error: initializer element is not constant
    >      { make_floatx80(0xbfff, 0x8000000000000000ULL),
    >      ^
    
    We've had the make_floatx80_init() macro for this purpose since commit
    3bf7e40ab914 ("softfloat: fix for C99", 2012-03-17), so let's use that
    macro again.
    
    Fixes: eca30647fc0 ("target/i386: reimplement f2xm1 using floatx80 operations")
    Fixes: ff57bb7b632 ("target/i386: reimplement fpatan using floatx80 operations")
    Signed-off-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Cc: Aurelien Jarno <aurelien@aurel32.net>
    Cc: Eduardo Habkost <ehabkost@redhat.com>
    Cc: Joseph Myers <joseph@codesourcery.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Link: https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg06566.html
    Link: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg04714.html
    Message-Id: <20200716144251.23004-1-lersek@redhat.com>
    Message-Id: <20200724064509.331-8-alex.bennee@linaro.org>
---
 include/fpu/softfloat.h  |   1 +
 target/i386/fpu_helper.c | 426 +++++++++++++++++++++++------------------------
 2 files changed, 214 insertions(+), 213 deletions(-)

diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index f1a19df066..659218b5c7 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -822,6 +822,7 @@ static inline bool floatx80_invalid_encoding(floatx80 a)
 }
 
 #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL)
+#define floatx80_zero_init make_floatx80_init(0x0000, 0x0000000000000000LL)
 #define floatx80_one make_floatx80(0x3fff, 0x8000000000000000LL)
 #define floatx80_ln2 make_floatx80(0x3ffe, 0xb17217f7d1cf79acLL)
 #define floatx80_pi make_floatx80(0x4000, 0xc90fdaa22168c235LL)
diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c
index f5e6c4b88d..4ea73874d8 100644
--- a/target/i386/fpu_helper.c
+++ b/target/i386/fpu_helper.c
@@ -868,201 +868,201 @@ struct f2xm1_data {
 };
 
 static const struct f2xm1_data f2xm1_table[65] = {
-    { make_floatx80(0xbfff, 0x8000000000000000ULL),
-      make_floatx80(0x3ffe, 0x8000000000000000ULL),
-      make_floatx80(0xbffe, 0x8000000000000000ULL) },
-    { make_floatx80(0xbffe, 0xf800000000002e7eULL),
-      make_floatx80(0x3ffe, 0x82cd8698ac2b9160ULL),
-      make_floatx80(0xbffd, 0xfa64f2cea7a8dd40ULL) },
-    { make_floatx80(0xbffe, 0xefffffffffffe960ULL),
-      make_floatx80(0x3ffe, 0x85aac367cc488345ULL),
-      make_floatx80(0xbffd, 0xf4aa7930676ef976ULL) },
-    { make_floatx80(0xbffe, 0xe800000000006f10ULL),
-      make_floatx80(0x3ffe, 0x88980e8092da5c14ULL),
-      make_floatx80(0xbffd, 0xeecfe2feda4b47d8ULL) },
-    { make_floatx80(0xbffe, 0xe000000000008a45ULL),
-      make_floatx80(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
-      make_floatx80(0xbffd, 0xe8d47c382ae8bab6ULL) },
-    { make_floatx80(0xbffe, 0xd7ffffffffff8a9eULL),
-      make_floatx80(0x3ffe, 0x8ea4398b45cd8116ULL),
-      make_floatx80(0xbffd, 0xe2b78ce97464fdd4ULL) },
-    { make_floatx80(0xbffe, 0xd0000000000019a0ULL),
-      make_floatx80(0x3ffe, 0x91c3d373ab11b919ULL),
-      make_floatx80(0xbffd, 0xdc785918a9dc8dceULL) },
-    { make_floatx80(0xbffe, 0xc7ffffffffff14dfULL),
-      make_floatx80(0x3ffe, 0x94f4efa8fef76836ULL),
-      make_floatx80(0xbffd, 0xd61620ae02112f94ULL) },
-    { make_floatx80(0xbffe, 0xc000000000006530ULL),
-      make_floatx80(0x3ffe, 0x9837f0518db87fbbULL),
-      make_floatx80(0xbffd, 0xcf901f5ce48f008aULL) },
-    { make_floatx80(0xbffe, 0xb7ffffffffff1723ULL),
-      make_floatx80(0x3ffe, 0x9b8d39b9d54eb74cULL),
-      make_floatx80(0xbffd, 0xc8e58c8c55629168ULL) },
-    { make_floatx80(0xbffe, 0xb00000000000b5e1ULL),
-      make_floatx80(0x3ffe, 0x9ef5326091a0c366ULL),
-      make_floatx80(0xbffd, 0xc2159b3edcbe7934ULL) },
-    { make_floatx80(0xbffe, 0xa800000000006f8aULL),
-      make_floatx80(0x3ffe, 0xa27043030c49370aULL),
-      make_floatx80(0xbffd, 0xbb1f79f9e76d91ecULL) },
-    { make_floatx80(0xbffe, 0x9fffffffffff816aULL),
-      make_floatx80(0x3ffe, 0xa5fed6a9b15171cfULL),
-      make_floatx80(0xbffd, 0xb40252ac9d5d1c62ULL) },
-    { make_floatx80(0xbffe, 0x97ffffffffffb621ULL),
-      make_floatx80(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
-      make_floatx80(0xbffd, 0xacbd4a962b079e34ULL) },
-    { make_floatx80(0xbffe, 0x8fffffffffff162bULL),
-      make_floatx80(0x3ffe, 0xad583eea42a1b886ULL),
-      make_floatx80(0xbffd, 0xa54f822b7abc8ef4ULL) },
-    { make_floatx80(0xbffe, 0x87ffffffffff4d34ULL),
-      make_floatx80(0x3ffe, 0xb123f581d2ac7b51ULL),
-      make_floatx80(0xbffd, 0x9db814fc5aa7095eULL) },
-    { make_floatx80(0xbffe, 0x800000000000227dULL),
-      make_floatx80(0x3ffe, 0xb504f333f9de539dULL),
-      make_floatx80(0xbffd, 0x95f619980c4358c6ULL) },
-    { make_floatx80(0xbffd, 0xefffffffffff3978ULL),
-      make_floatx80(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
-      make_floatx80(0xbffd, 0x8e08a1713a085ebeULL) },
-    { make_floatx80(0xbffd, 0xe00000000000df81ULL),
-      make_floatx80(0x3ffe, 0xbd08a39f580bfd8cULL),
-      make_floatx80(0xbffd, 0x85eeb8c14fe804e8ULL) },
-    { make_floatx80(0xbffd, 0xd00000000000bccfULL),
-      make_floatx80(0x3ffe, 0xc12c4cca667062f6ULL),
-      make_floatx80(0xbffc, 0xfb4eccd6663e7428ULL) },
-    { make_floatx80(0xbffd, 0xc00000000000eff0ULL),
-      make_floatx80(0x3ffe, 0xc5672a1155069abeULL),
-      make_floatx80(0xbffc, 0xea6357baabe59508ULL) },
-    { make_floatx80(0xbffd, 0xb000000000000fe6ULL),
-      make_floatx80(0x3ffe, 0xc9b9bd866e2f234bULL),
-      make_floatx80(0xbffc, 0xd91909e6474372d4ULL) },
-    { make_floatx80(0xbffd, 0x9fffffffffff2172ULL),
-      make_floatx80(0x3ffe, 0xce248c151f84bf00ULL),
-      make_floatx80(0xbffc, 0xc76dcfab81ed0400ULL) },
-    { make_floatx80(0xbffd, 0x8fffffffffffafffULL),
-      make_floatx80(0x3ffe, 0xd2a81d91f12afb2bULL),
-      make_floatx80(0xbffc, 0xb55f89b83b541354ULL) },
-    { make_floatx80(0xbffc, 0xffffffffffff81a3ULL),
-      make_floatx80(0x3ffe, 0xd744fccad69d7d5eULL),
-      make_floatx80(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
-    { make_floatx80(0xbffc, 0xdfffffffffff1568ULL),
-      make_floatx80(0x3ffe, 0xdbfbb797daf25a44ULL),
-      make_floatx80(0xbffc, 0x901121a0943696f0ULL) },
-    { make_floatx80(0xbffc, 0xbfffffffffff68daULL),
-      make_floatx80(0x3ffe, 0xe0ccdeec2a94f811ULL),
-      make_floatx80(0xbffb, 0xf999089eab583f78ULL) },
-    { make_floatx80(0xbffc, 0x9fffffffffff4690ULL),
-      make_floatx80(0x3ffe, 0xe5b906e77c83657eULL),
-      make_floatx80(0xbffb, 0xd237c8c41be4d410ULL) },
-    { make_floatx80(0xbffb, 0xffffffffffff8aeeULL),
-      make_floatx80(0x3ffe, 0xeac0c6e7dd24427cULL),
-      make_floatx80(0xbffb, 0xa9f9c8c116ddec20ULL) },
-    { make_floatx80(0xbffb, 0xbfffffffffff2d18ULL),
-      make_floatx80(0x3ffe, 0xefe4b99bdcdb06ebULL),
-      make_floatx80(0xbffb, 0x80da33211927c8a8ULL) },
-    { make_floatx80(0xbffa, 0xffffffffffff8ccbULL),
-      make_floatx80(0x3ffe, 0xf5257d152486d0f4ULL),
-      make_floatx80(0xbffa, 0xada82eadb792f0c0ULL) },
-    { make_floatx80(0xbff9, 0xffffffffffff11feULL),
-      make_floatx80(0x3ffe, 0xfa83b2db722a0846ULL),
-      make_floatx80(0xbff9, 0xaf89a491babef740ULL) },
-    { floatx80_zero,
-      make_floatx80(0x3fff, 0x8000000000000000ULL),
-      floatx80_zero },
-    { make_floatx80(0x3ff9, 0xffffffffffff2680ULL),
-      make_floatx80(0x3fff, 0x82cd8698ac2b9f6fULL),
-      make_floatx80(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
-    { make_floatx80(0x3ffb, 0x800000000000b500ULL),
-      make_floatx80(0x3fff, 0x85aac367cc488345ULL),
-      make_floatx80(0x3ffa, 0xb5586cf9891068a0ULL) },
-    { make_floatx80(0x3ffb, 0xbfffffffffff4b67ULL),
-      make_floatx80(0x3fff, 0x88980e8092da7cceULL),
-      make_floatx80(0x3ffb, 0x8980e8092da7cce0ULL) },
-    { make_floatx80(0x3ffb, 0xffffffffffffff57ULL),
-      make_floatx80(0x3fff, 0x8b95c1e3ea8bd6dfULL),
-      make_floatx80(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
-    { make_floatx80(0x3ffc, 0x9fffffffffff811fULL),
-      make_floatx80(0x3fff, 0x8ea4398b45cd4780ULL),
-      make_floatx80(0x3ffb, 0xea4398b45cd47800ULL) },
-    { make_floatx80(0x3ffc, 0xbfffffffffff9980ULL),
-      make_floatx80(0x3fff, 0x91c3d373ab11b919ULL),
-      make_floatx80(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
-    { make_floatx80(0x3ffc, 0xdffffffffffff631ULL),
-      make_floatx80(0x3fff, 0x94f4efa8fef70864ULL),
-      make_floatx80(0x3ffc, 0xa7a77d47f7b84320ULL) },
-    { make_floatx80(0x3ffc, 0xffffffffffff2499ULL),
-      make_floatx80(0x3fff, 0x9837f0518db892d4ULL),
-      make_floatx80(0x3ffc, 0xc1bf828c6dc496a0ULL) },
-    { make_floatx80(0x3ffd, 0x8fffffffffff80fbULL),
-      make_floatx80(0x3fff, 0x9b8d39b9d54e3a79ULL),
-      make_floatx80(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
-    { make_floatx80(0x3ffd, 0x9fffffffffffbc23ULL),
-      make_floatx80(0x3fff, 0x9ef5326091a10313ULL),
-      make_floatx80(0x3ffc, 0xf7a993048d081898ULL) },
-    { make_floatx80(0x3ffd, 0xafffffffffff20ecULL),
-      make_floatx80(0x3fff, 0xa27043030c49370aULL),
-      make_floatx80(0x3ffd, 0x89c10c0c3124dc28ULL) },
-    { make_floatx80(0x3ffd, 0xc00000000000fd2cULL),
-      make_floatx80(0x3fff, 0xa5fed6a9b15171cfULL),
-      make_floatx80(0x3ffd, 0x97fb5aa6c545c73cULL) },
-    { make_floatx80(0x3ffd, 0xd0000000000093beULL),
-      make_floatx80(0x3fff, 0xa9a15ab4ea7c30e6ULL),
-      make_floatx80(0x3ffd, 0xa6856ad3a9f0c398ULL) },
-    { make_floatx80(0x3ffd, 0xe00000000000c2aeULL),
-      make_floatx80(0x3fff, 0xad583eea42a17876ULL),
-      make_floatx80(0x3ffd, 0xb560fba90a85e1d8ULL) },
-    { make_floatx80(0x3ffd, 0xefffffffffff1e3fULL),
-      make_floatx80(0x3fff, 0xb123f581d2abef6cULL),
-      make_floatx80(0x3ffd, 0xc48fd6074aafbdb0ULL) },
-    { make_floatx80(0x3ffd, 0xffffffffffff1c23ULL),
-      make_floatx80(0x3fff, 0xb504f333f9de2cadULL),
-      make_floatx80(0x3ffd, 0xd413cccfe778b2b4ULL) },
-    { make_floatx80(0x3ffe, 0x8800000000006344ULL),
-      make_floatx80(0x3fff, 0xb8fbaf4762fbd0a1ULL),
-      make_floatx80(0x3ffd, 0xe3eebd1d8bef4284ULL) },
-    { make_floatx80(0x3ffe, 0x9000000000005d67ULL),
-      make_floatx80(0x3fff, 0xbd08a39f580c668dULL),
-      make_floatx80(0x3ffd, 0xf4228e7d60319a34ULL) },
-    { make_floatx80(0x3ffe, 0x9800000000009127ULL),
-      make_floatx80(0x3fff, 0xc12c4cca6670e042ULL),
-      make_floatx80(0x3ffe, 0x82589994cce1c084ULL) },
-    { make_floatx80(0x3ffe, 0x9fffffffffff06f9ULL),
-      make_floatx80(0x3fff, 0xc5672a11550655c3ULL),
-      make_floatx80(0x3ffe, 0x8ace5422aa0cab86ULL) },
-    { make_floatx80(0x3ffe, 0xa7fffffffffff80dULL),
-      make_floatx80(0x3fff, 0xc9b9bd866e2f234bULL),
-      make_floatx80(0x3ffe, 0x93737b0cdc5e4696ULL) },
-    { make_floatx80(0x3ffe, 0xafffffffffff1470ULL),
-      make_floatx80(0x3fff, 0xce248c151f83fd69ULL),
-      make_floatx80(0x3ffe, 0x9c49182a3f07fad2ULL) },
-    { make_floatx80(0x3ffe, 0xb800000000000e0aULL),
-      make_floatx80(0x3fff, 0xd2a81d91f12aec5cULL),
-      make_floatx80(0x3ffe, 0xa5503b23e255d8b8ULL) },
-    { make_floatx80(0x3ffe, 0xc00000000000b7faULL),
-      make_floatx80(0x3fff, 0xd744fccad69dd630ULL),
-      make_floatx80(0x3ffe, 0xae89f995ad3bac60ULL) },
-    { make_floatx80(0x3ffe, 0xc800000000003aa6ULL),
-      make_floatx80(0x3fff, 0xdbfbb797daf25a44ULL),
-      make_floatx80(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
-    { make_floatx80(0x3ffe, 0xd00000000000a6aeULL),
-      make_floatx80(0x3fff, 0xe0ccdeec2a954685ULL),
-      make_floatx80(0x3ffe, 0xc199bdd8552a8d0aULL) },
-    { make_floatx80(0x3ffe, 0xd800000000004165ULL),
-      make_floatx80(0x3fff, 0xe5b906e77c837155ULL),
-      make_floatx80(0x3ffe, 0xcb720dcef906e2aaULL) },
-    { make_floatx80(0x3ffe, 0xe00000000000582cULL),
-      make_floatx80(0x3fff, 0xeac0c6e7dd24713aULL),
-      make_floatx80(0x3ffe, 0xd5818dcfba48e274ULL) },
-    { make_floatx80(0x3ffe, 0xe800000000001a5dULL),
-      make_floatx80(0x3fff, 0xefe4b99bdcdb06ebULL),
-      make_floatx80(0x3ffe, 0xdfc97337b9b60dd6ULL) },
-    { make_floatx80(0x3ffe, 0xefffffffffffc1efULL),
-      make_floatx80(0x3fff, 0xf5257d152486a2faULL),
-      make_floatx80(0x3ffe, 0xea4afa2a490d45f4ULL) },
-    { make_floatx80(0x3ffe, 0xf800000000001069ULL),
-      make_floatx80(0x3fff, 0xfa83b2db722a0e5cULL),
-      make_floatx80(0x3ffe, 0xf50765b6e4541cb8ULL) },
-    { make_floatx80(0x3fff, 0x8000000000000000ULL),
-      make_floatx80(0x4000, 0x8000000000000000ULL),
-      make_floatx80(0x3fff, 0x8000000000000000ULL) },
+    { make_floatx80_init(0xbfff, 0x8000000000000000ULL),
+      make_floatx80_init(0x3ffe, 0x8000000000000000ULL),
+      make_floatx80_init(0xbffe, 0x8000000000000000ULL) },
+    { make_floatx80_init(0xbffe, 0xf800000000002e7eULL),
+      make_floatx80_init(0x3ffe, 0x82cd8698ac2b9160ULL),
+      make_floatx80_init(0xbffd, 0xfa64f2cea7a8dd40ULL) },
+    { make_floatx80_init(0xbffe, 0xefffffffffffe960ULL),
+      make_floatx80_init(0x3ffe, 0x85aac367cc488345ULL),
+      make_floatx80_init(0xbffd, 0xf4aa7930676ef976ULL) },
+    { make_floatx80_init(0xbffe, 0xe800000000006f10ULL),
+      make_floatx80_init(0x3ffe, 0x88980e8092da5c14ULL),
+      make_floatx80_init(0xbffd, 0xeecfe2feda4b47d8ULL) },
+    { make_floatx80_init(0xbffe, 0xe000000000008a45ULL),
+      make_floatx80_init(0x3ffe, 0x8b95c1e3ea8ba2a5ULL),
+      make_floatx80_init(0xbffd, 0xe8d47c382ae8bab6ULL) },
+    { make_floatx80_init(0xbffe, 0xd7ffffffffff8a9eULL),
+      make_floatx80_init(0x3ffe, 0x8ea4398b45cd8116ULL),
+      make_floatx80_init(0xbffd, 0xe2b78ce97464fdd4ULL) },
+    { make_floatx80_init(0xbffe, 0xd0000000000019a0ULL),
+      make_floatx80_init(0x3ffe, 0x91c3d373ab11b919ULL),
+      make_floatx80_init(0xbffd, 0xdc785918a9dc8dceULL) },
+    { make_floatx80_init(0xbffe, 0xc7ffffffffff14dfULL),
+      make_floatx80_init(0x3ffe, 0x94f4efa8fef76836ULL),
+      make_floatx80_init(0xbffd, 0xd61620ae02112f94ULL) },
+    { make_floatx80_init(0xbffe, 0xc000000000006530ULL),
+      make_floatx80_init(0x3ffe, 0x9837f0518db87fbbULL),
+      make_floatx80_init(0xbffd, 0xcf901f5ce48f008aULL) },
+    { make_floatx80_init(0xbffe, 0xb7ffffffffff1723ULL),
+      make_floatx80_init(0x3ffe, 0x9b8d39b9d54eb74cULL),
+      make_floatx80_init(0xbffd, 0xc8e58c8c55629168ULL) },
+    { make_floatx80_init(0xbffe, 0xb00000000000b5e1ULL),
+      make_floatx80_init(0x3ffe, 0x9ef5326091a0c366ULL),
+      make_floatx80_init(0xbffd, 0xc2159b3edcbe7934ULL) },
+    { make_floatx80_init(0xbffe, 0xa800000000006f8aULL),
+      make_floatx80_init(0x3ffe, 0xa27043030c49370aULL),
+      make_floatx80_init(0xbffd, 0xbb1f79f9e76d91ecULL) },
+    { make_floatx80_init(0xbffe, 0x9fffffffffff816aULL),
+      make_floatx80_init(0x3ffe, 0xa5fed6a9b15171cfULL),
+      make_floatx80_init(0xbffd, 0xb40252ac9d5d1c62ULL) },
+    { make_floatx80_init(0xbffe, 0x97ffffffffffb621ULL),
+      make_floatx80_init(0x3ffe, 0xa9a15ab4ea7c30e6ULL),
+      make_floatx80_init(0xbffd, 0xacbd4a962b079e34ULL) },
+    { make_floatx80_init(0xbffe, 0x8fffffffffff162bULL),
+      make_floatx80_init(0x3ffe, 0xad583eea42a1b886ULL),
+      make_floatx80_init(0xbffd, 0xa54f822b7abc8ef4ULL) },
+    { make_floatx80_init(0xbffe, 0x87ffffffffff4d34ULL),
+      make_floatx80_init(0x3ffe, 0xb123f581d2ac7b51ULL),
+      make_floatx80_init(0xbffd, 0x9db814fc5aa7095eULL) },
+    { make_floatx80_init(0xbffe, 0x800000000000227dULL),
+      make_floatx80_init(0x3ffe, 0xb504f333f9de539dULL),
+      make_floatx80_init(0xbffd, 0x95f619980c4358c6ULL) },
+    { make_floatx80_init(0xbffd, 0xefffffffffff3978ULL),
+      make_floatx80_init(0x3ffe, 0xb8fbaf4762fbd0a1ULL),
+      make_floatx80_init(0xbffd, 0x8e08a1713a085ebeULL) },
+    { make_floatx80_init(0xbffd, 0xe00000000000df81ULL),
+      make_floatx80_init(0x3ffe, 0xbd08a39f580bfd8cULL),
+      make_floatx80_init(0xbffd, 0x85eeb8c14fe804e8ULL) },
+    { make_floatx80_init(0xbffd, 0xd00000000000bccfULL),
+      make_floatx80_init(0x3ffe, 0xc12c4cca667062f6ULL),
+      make_floatx80_init(0xbffc, 0xfb4eccd6663e7428ULL) },
+    { make_floatx80_init(0xbffd, 0xc00000000000eff0ULL),
+      make_floatx80_init(0x3ffe, 0xc5672a1155069abeULL),
+      make_floatx80_init(0xbffc, 0xea6357baabe59508ULL) },
+    { make_floatx80_init(0xbffd, 0xb000000000000fe6ULL),
+      make_floatx80_init(0x3ffe, 0xc9b9bd866e2f234bULL),
+      make_floatx80_init(0xbffc, 0xd91909e6474372d4ULL) },
+    { make_floatx80_init(0xbffd, 0x9fffffffffff2172ULL),
+      make_floatx80_init(0x3ffe, 0xce248c151f84bf00ULL),
+      make_floatx80_init(0xbffc, 0xc76dcfab81ed0400ULL) },
+    { make_floatx80_init(0xbffd, 0x8fffffffffffafffULL),
+      make_floatx80_init(0x3ffe, 0xd2a81d91f12afb2bULL),
+      make_floatx80_init(0xbffc, 0xb55f89b83b541354ULL) },
+    { make_floatx80_init(0xbffc, 0xffffffffffff81a3ULL),
+      make_floatx80_init(0x3ffe, 0xd744fccad69d7d5eULL),
+      make_floatx80_init(0xbffc, 0xa2ec0cd4a58a0a88ULL) },
+    { make_floatx80_init(0xbffc, 0xdfffffffffff1568ULL),
+      make_floatx80_init(0x3ffe, 0xdbfbb797daf25a44ULL),
+      make_floatx80_init(0xbffc, 0x901121a0943696f0ULL) },
+    { make_floatx80_init(0xbffc, 0xbfffffffffff68daULL),
+      make_floatx80_init(0x3ffe, 0xe0ccdeec2a94f811ULL),
+      make_floatx80_init(0xbffb, 0xf999089eab583f78ULL) },
+    { make_floatx80_init(0xbffc, 0x9fffffffffff4690ULL),
+      make_floatx80_init(0x3ffe, 0xe5b906e77c83657eULL),
+      make_floatx80_init(0xbffb, 0xd237c8c41be4d410ULL) },
+    { make_floatx80_init(0xbffb, 0xffffffffffff8aeeULL),
+      make_floatx80_init(0x3ffe, 0xeac0c6e7dd24427cULL),
+      make_floatx80_init(0xbffb, 0xa9f9c8c116ddec20ULL) },
+    { make_floatx80_init(0xbffb, 0xbfffffffffff2d18ULL),
+      make_floatx80_init(0x3ffe, 0xefe4b99bdcdb06ebULL),
+      make_floatx80_init(0xbffb, 0x80da33211927c8a8ULL) },
+    { make_floatx80_init(0xbffa, 0xffffffffffff8ccbULL),
+      make_floatx80_init(0x3ffe, 0xf5257d152486d0f4ULL),
+      make_floatx80_init(0xbffa, 0xada82eadb792f0c0ULL) },
+    { make_floatx80_init(0xbff9, 0xffffffffffff11feULL),
+      make_floatx80_init(0x3ffe, 0xfa83b2db722a0846ULL),
+      make_floatx80_init(0xbff9, 0xaf89a491babef740ULL) },
+    { floatx80_zero_init,
+      make_floatx80_init(0x3fff, 0x8000000000000000ULL),
+      floatx80_zero_init },
+    { make_floatx80_init(0x3ff9, 0xffffffffffff2680ULL),
+      make_floatx80_init(0x3fff, 0x82cd8698ac2b9f6fULL),
+      make_floatx80_init(0x3ff9, 0xb361a62b0ae7dbc0ULL) },
+    { make_floatx80_init(0x3ffb, 0x800000000000b500ULL),
+      make_floatx80_init(0x3fff, 0x85aac367cc488345ULL),
+      make_floatx80_init(0x3ffa, 0xb5586cf9891068a0ULL) },
+    { make_floatx80_init(0x3ffb, 0xbfffffffffff4b67ULL),
+      make_floatx80_init(0x3fff, 0x88980e8092da7cceULL),
+      make_floatx80_init(0x3ffb, 0x8980e8092da7cce0ULL) },
+    { make_floatx80_init(0x3ffb, 0xffffffffffffff57ULL),
+      make_floatx80_init(0x3fff, 0x8b95c1e3ea8bd6dfULL),
+      make_floatx80_init(0x3ffb, 0xb95c1e3ea8bd6df0ULL) },
+    { make_floatx80_init(0x3ffc, 0x9fffffffffff811fULL),
+      make_floatx80_init(0x3fff, 0x8ea4398b45cd4780ULL),
+      make_floatx80_init(0x3ffb, 0xea4398b45cd47800ULL) },
+    { make_floatx80_init(0x3ffc, 0xbfffffffffff9980ULL),
+      make_floatx80_init(0x3fff, 0x91c3d373ab11b919ULL),
+      make_floatx80_init(0x3ffc, 0x8e1e9b9d588dc8c8ULL) },
+    { make_floatx80_init(0x3ffc, 0xdffffffffffff631ULL),
+      make_floatx80_init(0x3fff, 0x94f4efa8fef70864ULL),
+      make_floatx80_init(0x3ffc, 0xa7a77d47f7b84320ULL) },
+    { make_floatx80_init(0x3ffc, 0xffffffffffff2499ULL),
+      make_floatx80_init(0x3fff, 0x9837f0518db892d4ULL),
+      make_floatx80_init(0x3ffc, 0xc1bf828c6dc496a0ULL) },
+    { make_floatx80_init(0x3ffd, 0x8fffffffffff80fbULL),
+      make_floatx80_init(0x3fff, 0x9b8d39b9d54e3a79ULL),
+      make_floatx80_init(0x3ffc, 0xdc69cdceaa71d3c8ULL) },
+    { make_floatx80_init(0x3ffd, 0x9fffffffffffbc23ULL),
+      make_floatx80_init(0x3fff, 0x9ef5326091a10313ULL),
+      make_floatx80_init(0x3ffc, 0xf7a993048d081898ULL) },
+    { make_floatx80_init(0x3ffd, 0xafffffffffff20ecULL),
+      make_floatx80_init(0x3fff, 0xa27043030c49370aULL),
+      make_floatx80_init(0x3ffd, 0x89c10c0c3124dc28ULL) },
+    { make_floatx80_init(0x3ffd, 0xc00000000000fd2cULL),
+      make_floatx80_init(0x3fff, 0xa5fed6a9b15171cfULL),
+      make_floatx80_init(0x3ffd, 0x97fb5aa6c545c73cULL) },
+    { make_floatx80_init(0x3ffd, 0xd0000000000093beULL),
+      make_floatx80_init(0x3fff, 0xa9a15ab4ea7c30e6ULL),
+      make_floatx80_init(0x3ffd, 0xa6856ad3a9f0c398ULL) },
+    { make_floatx80_init(0x3ffd, 0xe00000000000c2aeULL),
+      make_floatx80_init(0x3fff, 0xad583eea42a17876ULL),
+      make_floatx80_init(0x3ffd, 0xb560fba90a85e1d8ULL) },
+    { make_floatx80_init(0x3ffd, 0xefffffffffff1e3fULL),
+      make_floatx80_init(0x3fff, 0xb123f581d2abef6cULL),
+      make_floatx80_init(0x3ffd, 0xc48fd6074aafbdb0ULL) },
+    { make_floatx80_init(0x3ffd, 0xffffffffffff1c23ULL),
+      make_floatx80_init(0x3fff, 0xb504f333f9de2cadULL),
+      make_floatx80_init(0x3ffd, 0xd413cccfe778b2b4ULL) },
+    { make_floatx80_init(0x3ffe, 0x8800000000006344ULL),
+      make_floatx80_init(0x3fff, 0xb8fbaf4762fbd0a1ULL),
+      make_floatx80_init(0x3ffd, 0xe3eebd1d8bef4284ULL) },
+    { make_floatx80_init(0x3ffe, 0x9000000000005d67ULL),
+      make_floatx80_init(0x3fff, 0xbd08a39f580c668dULL),
+      make_floatx80_init(0x3ffd, 0xf4228e7d60319a34ULL) },
+    { make_floatx80_init(0x3ffe, 0x9800000000009127ULL),
+      make_floatx80_init(0x3fff, 0xc12c4cca6670e042ULL),
+      make_floatx80_init(0x3ffe, 0x82589994cce1c084ULL) },
+    { make_floatx80_init(0x3ffe, 0x9fffffffffff06f9ULL),
+      make_floatx80_init(0x3fff, 0xc5672a11550655c3ULL),
+      make_floatx80_init(0x3ffe, 0x8ace5422aa0cab86ULL) },
+    { make_floatx80_init(0x3ffe, 0xa7fffffffffff80dULL),
+      make_floatx80_init(0x3fff, 0xc9b9bd866e2f234bULL),
+      make_floatx80_init(0x3ffe, 0x93737b0cdc5e4696ULL) },
+    { make_floatx80_init(0x3ffe, 0xafffffffffff1470ULL),
+      make_floatx80_init(0x3fff, 0xce248c151f83fd69ULL),
+      make_floatx80_init(0x3ffe, 0x9c49182a3f07fad2ULL) },
+    { make_floatx80_init(0x3ffe, 0xb800000000000e0aULL),
+      make_floatx80_init(0x3fff, 0xd2a81d91f12aec5cULL),
+      make_floatx80_init(0x3ffe, 0xa5503b23e255d8b8ULL) },
+    { make_floatx80_init(0x3ffe, 0xc00000000000b7faULL),
+      make_floatx80_init(0x3fff, 0xd744fccad69dd630ULL),
+      make_floatx80_init(0x3ffe, 0xae89f995ad3bac60ULL) },
+    { make_floatx80_init(0x3ffe, 0xc800000000003aa6ULL),
+      make_floatx80_init(0x3fff, 0xdbfbb797daf25a44ULL),
+      make_floatx80_init(0x3ffe, 0xb7f76f2fb5e4b488ULL) },
+    { make_floatx80_init(0x3ffe, 0xd00000000000a6aeULL),
+      make_floatx80_init(0x3fff, 0xe0ccdeec2a954685ULL),
+      make_floatx80_init(0x3ffe, 0xc199bdd8552a8d0aULL) },
+    { make_floatx80_init(0x3ffe, 0xd800000000004165ULL),
+      make_floatx80_init(0x3fff, 0xe5b906e77c837155ULL),
+      make_floatx80_init(0x3ffe, 0xcb720dcef906e2aaULL) },
+    { make_floatx80_init(0x3ffe, 0xe00000000000582cULL),
+      make_floatx80_init(0x3fff, 0xeac0c6e7dd24713aULL),
+      make_floatx80_init(0x3ffe, 0xd5818dcfba48e274ULL) },
+    { make_floatx80_init(0x3ffe, 0xe800000000001a5dULL),
+      make_floatx80_init(0x3fff, 0xefe4b99bdcdb06ebULL),
+      make_floatx80_init(0x3ffe, 0xdfc97337b9b60dd6ULL) },
+    { make_floatx80_init(0x3ffe, 0xefffffffffffc1efULL),
+      make_floatx80_init(0x3fff, 0xf5257d152486a2faULL),
+      make_floatx80_init(0x3ffe, 0xea4afa2a490d45f4ULL) },
+    { make_floatx80_init(0x3ffe, 0xf800000000001069ULL),
+      make_floatx80_init(0x3fff, 0xfa83b2db722a0e5cULL),
+      make_floatx80_init(0x3ffe, 0xf50765b6e4541cb8ULL) },
+    { make_floatx80_init(0x3fff, 0x8000000000000000ULL),
+      make_floatx80_init(0x4000, 0x8000000000000000ULL),
+      make_floatx80_init(0x3fff, 0x8000000000000000ULL) },
 };
 
 void helper_f2xm1(CPUX86State *env)
@@ -1275,24 +1275,24 @@ struct fpatan_data {
 };
 
 static const struct fpatan_data fpatan_table[9] = {
-    { floatx80_zero,
-      floatx80_zero },
-    { make_floatx80(0x3ffb, 0xfeadd4d5617b6e33ULL),
-      make_floatx80(0xbfb9, 0xdda19d8305ddc420ULL) },
-    { make_floatx80(0x3ffc, 0xfadbafc96406eb15ULL),
-      make_floatx80(0x3fbb, 0xdb8f3debef442fccULL) },
-    { make_floatx80(0x3ffd, 0xb7b0ca0f26f78474ULL),
-      make_floatx80(0xbfbc, 0xeab9bdba460376faULL) },
-    { make_floatx80(0x3ffd, 0xed63382b0dda7b45ULL),
-      make_floatx80(0x3fbc, 0xdfc88bd978751a06ULL) },
-    { make_floatx80(0x3ffe, 0x8f005d5ef7f59f9bULL),
-      make_floatx80(0x3fbd, 0xb906bc2ccb886e90ULL) },
-    { make_floatx80(0x3ffe, 0xa4bc7d1934f70924ULL),
-      make_floatx80(0x3fbb, 0xcd43f9522bed64f8ULL) },
-    { make_floatx80(0x3ffe, 0xb8053e2bc2319e74ULL),
-      make_floatx80(0xbfbc, 0xd3496ab7bd6eef0cULL) },
-    { make_floatx80(0x3ffe, 0xc90fdaa22168c235ULL),
-      make_floatx80(0xbfbc, 0xece675d1fc8f8cbcULL) },
+    { floatx80_zero_init,
+      floatx80_zero_init },
+    { make_floatx80_init(0x3ffb, 0xfeadd4d5617b6e33ULL),
+      make_floatx80_init(0xbfb9, 0xdda19d8305ddc420ULL) },
+    { make_floatx80_init(0x3ffc, 0xfadbafc96406eb15ULL),
+      make_floatx80_init(0x3fbb, 0xdb8f3debef442fccULL) },
+    { make_floatx80_init(0x3ffd, 0xb7b0ca0f26f78474ULL),
+      make_floatx80_init(0xbfbc, 0xeab9bdba460376faULL) },
+    { make_floatx80_init(0x3ffd, 0xed63382b0dda7b45ULL),
+      make_floatx80_init(0x3fbc, 0xdfc88bd978751a06ULL) },
+    { make_floatx80_init(0x3ffe, 0x8f005d5ef7f59f9bULL),
+      make_floatx80_init(0x3fbd, 0xb906bc2ccb886e90ULL) },
+    { make_floatx80_init(0x3ffe, 0xa4bc7d1934f70924ULL),
+      make_floatx80_init(0x3fbb, 0xcd43f9522bed64f8ULL) },
+    { make_floatx80_init(0x3ffe, 0xb8053e2bc2319e74ULL),
+      make_floatx80_init(0xbfbc, 0xd3496ab7bd6eef0cULL) },
+    { make_floatx80_init(0x3ffe, 0xc90fdaa22168c235ULL),
+      make_floatx80_init(0xbfbc, 0xece675d1fc8f8cbcULL) },
 };
 
 void helper_fpatan(CPUX86State *env)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16570.40941 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjq-0001pR-7d; Fri, 30 Oct 2020 22:19:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16570.40941; Fri, 30 Oct 2020 22:19:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcjq-0001pI-4b; Fri, 30 Oct 2020 22:19:14 +0000
Received: by outflank-mailman (input) for mailman id 16570;
 Fri, 30 Oct 2020 22:19:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcjo-0001pC-PV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 91697b65-6ca2-40d1-96a7-2fd7c1081f61;
 Fri, 30 Oct 2020 22:19:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjn-0004tl-AS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjn-0003fq-8k
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:11 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcjo-0001pC-PV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:12 +0000
X-Inumbo-ID: 91697b65-6ca2-40d1-96a7-2fd7c1081f61
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 91697b65-6ca2-40d1-96a7-2fd7c1081f61;
	Fri, 30 Oct 2020 22:19:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8NtEaQ2jzH7a9myOTilcZfDhKgsfcWk18sJK4oktQEs=; b=vBtRGU0ODBZwRU0ZMgxdWi2Wtj
	2NrgRjP4UPMjNULqSvYAIqgo3iW3asLNP0/fsZBXhIUxePtouBe8uoYuDjUruGGQcMSP6Fny5E84r
	PEGb5jaR7yZ+rxn9IqmllwCkLCWgSZONnD9O5UBDspODtZ1eT9MLHJBlV8wc5CI8LKnw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjn-0004tl-AS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjn-0003fq-8k
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
Message-Id: <E1kYcjn-0003fq-8k@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:11 +0000

commit 2667e069e7b5807c69f32109d930967bc1b222cb
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:01 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:18 2020 +0100

    linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
    
    Plain MAP_FIXED has the undesirable behaviour of splatting exiting
    maps so we don't actually achieve what we want when looking for gaps.
    We should be using MAP_FIXED_NOREPLACE. As this isn't always available
    we need to potentially check the returned address to see if the kernel
    gave us what we asked for.
    
    Fixes: ad592e37dfc ("linux-user: provide fallback pgd_find_hole for bare chroots")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200724064509.331-9-alex.bennee@linaro.org>
---
 include/qemu/osdep.h |  3 +++
 linux-user/elfload.c | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 0b1298b3c9..20872e793e 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -173,6 +173,9 @@ extern int daemon(int, int);
 #ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
 #endif
+#ifndef MAP_FIXED_NOREPLACE
+#define MAP_FIXED_NOREPLACE 0
+#endif
 #ifndef ENOMEDIUM
 #define ENOMEDIUM ENODEV
 #endif
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 7e7f642332..fe9dfe795d 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2134,12 +2134,15 @@ static uintptr_t pgd_find_hole_fallback(uintptr_t guest_size, uintptr_t brk,
             /* we have run out of space */
             return -1;
         } else {
-            int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE | MAP_FIXED;
+            int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE |
+                MAP_FIXED_NOREPLACE;
             void * mmap_start = mmap((void *) align_start, guest_size,
                                      PROT_NONE, flags, -1, 0);
             if (mmap_start != MAP_FAILED) {
                 munmap((void *) align_start, guest_size);
-                return (uintptr_t) mmap_start + offset;
+                if (MAP_FIXED_NOREPLACE || mmap_start == (void *) align_start) {
+                    return (uintptr_t) mmap_start + offset;
+                }
             }
             base += qemu_host_page_size;
         }
@@ -2307,9 +2310,8 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
     /* Widen the "image" to the entire reserved address space. */
     pgb_static(image_name, 0, reserved_va, align);
 
-#ifdef MAP_FIXED_NOREPLACE
+    /* osdep.h defines this as 0 if it's missing */
     flags |= MAP_FIXED_NOREPLACE;
-#endif
 
     /* Reserve the memory on the host. */
     assert(guest_base != 0);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16571.40946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYck1-0001qt-9B; Fri, 30 Oct 2020 22:19:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16571.40946; Fri, 30 Oct 2020 22:19:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYck1-0001ql-67; Fri, 30 Oct 2020 22:19:25 +0000
Received: by outflank-mailman (input) for mailman id 16571;
 Fri, 30 Oct 2020 22:19:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYck0-0001qa-2V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 878ac583-6e96-42ff-91cd-6ce4162aab98;
 Fri, 30 Oct 2020 22:19:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjx-0004ts-E2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcjx-0003gc-DI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYck0-0001qa-2V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:24 +0000
X-Inumbo-ID: 878ac583-6e96-42ff-91cd-6ce4162aab98
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 878ac583-6e96-42ff-91cd-6ce4162aab98;
	Fri, 30 Oct 2020 22:19:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aRdcWf/2IOu5pJjiFhcp/oSDvVLQoGVAETgnxuxlSRs=; b=Arab1JrbrYBKV6CgbMWgVaOf6e
	YWlmy3B3TOHI3JE9yD+Xx/HWKQU+n5el3fjx+ySHahTOxNrVNOgBt7dUgOwPyzDTr4W0o2TtQ1eeZ
	U26iZbiwArc7/sHWaGvawh6Ga0bcek6XN+jYu0addXacup+JjQlWE3WENm8BAWOg5XQI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjx-0004ts-E2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcjx-0003gc-DI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/docker: fix update command due to python3 str/bytes distinction
Message-Id: <E1kYcjx-0003gc-DI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:21 +0000

commit e336cec3a59df5c4e79f6f9625780dccd8a607db
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:02 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:18 2020 +0100

    tests/docker: fix update command due to python3 str/bytes distinction
    
    Does this seem convoluted to you? It feels a little complicated to me.
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200724064509.331-10-alex.bennee@linaro.org>
---
 tests/docker/docker.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index c9f20d8d09..356d7618f1 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -24,7 +24,7 @@ import tempfile
 import re
 import signal
 from tarfile import TarFile, TarInfo
-from io import StringIO
+from io import StringIO, BytesIO
 from shutil import copy, rmtree
 from pwd import getpwuid
 from datetime import datetime, timedelta
@@ -541,13 +541,14 @@ class UpdateCommand(SubCommand):
 
         # Create a Docker buildfile
         df = StringIO()
-        df.write("FROM %s\n" % args.tag)
-        df.write("ADD . /\n")
-        df.seek(0)
+        df.write(u"FROM %s\n" % args.tag)
+        df.write(u"ADD . /\n")
+
+        df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8"))
 
         df_tar = TarInfo(name="Dockerfile")
-        df_tar.size = len(df.buf)
-        tmp_tar.addfile(df_tar, fileobj=df)
+        df_tar.size = df_bytes.getbuffer().nbytes
+        tmp_tar.addfile(df_tar, fileobj=df_bytes)
 
         tmp_tar.close()
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16572.40950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckA-0001s3-AX; Fri, 30 Oct 2020 22:19:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16572.40950; Fri, 30 Oct 2020 22:19:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckA-0001rv-7X; Fri, 30 Oct 2020 22:19:34 +0000
Received: by outflank-mailman (input) for mailman id 16572;
 Fri, 30 Oct 2020 22:19:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYck8-0001rj-9F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:32 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0449186c-85c0-4f2a-9215-89d41adf5625;
 Fri, 30 Oct 2020 22:19:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYck7-0004u1-Hh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYck7-0003hN-Gf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYck8-0001rj-9F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:32 +0000
X-Inumbo-ID: 0449186c-85c0-4f2a-9215-89d41adf5625
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0449186c-85c0-4f2a-9215-89d41adf5625;
	Fri, 30 Oct 2020 22:19:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=otDkOSeebV2BblZ4I6mHdgH19FX+hIHpt1tITqOZ97s=; b=c0U/lGDR06fE2NYySxKXqAx8oF
	sRBjl7QTYlCDmJzriE9JSiZem7h3LaOMMlAiJ8Pg93h1dQi7zzJLWr0oEQfSI2wfbEWC3wQuULYRi
	iHqWmw9JMag+yleyI009Qcwt9nqlu5gMR4Abj0G2mWFpfWafaDYcR1LYYXK7Qxz9cvc4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYck7-0004u1-Hh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYck7-0003hN-Gf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/docker: fix binfmt_misc image building
Message-Id: <E1kYck7-0003hN-Gf@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:31 +0000

commit 182ec0607600f23e7768a1c3c490f61e36b15bc4
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:03 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:22 2020 +0100

    tests/docker: fix binfmt_misc image building
    
    When we updated the arguments for docker.py we missed a bit.
    
    Fixes: dfae628459 ("docker.py/build: support -t and -f arguments")
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200724064509.331-11-alex.bennee@linaro.org>
---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index a104e9df28..9119dff97d 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -78,7 +78,7 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
 			DEB_ARCH=$(DEB_ARCH)					\
 			DEB_TYPE=$(DEB_TYPE) 					\
 			$(if $(DEB_URL),DEB_URL=$(DEB_URL),)			\
-			$(DOCKER_SCRIPT) build qemu/debian-$* $< 		\
+			$(DOCKER_SCRIPT) build -t qemu/debian-$* -f $< 		\
 			$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) 		\
 			$(if $(NOUSER),,--add-current-user) 			\
 			$(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))	\
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16573.40954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckK-0001tt-Bz; Fri, 30 Oct 2020 22:19:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16573.40954; Fri, 30 Oct 2020 22:19:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckK-0001tl-8z; Fri, 30 Oct 2020 22:19:44 +0000
Received: by outflank-mailman (input) for mailman id 16573;
 Fri, 30 Oct 2020 22:19:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYckI-0001tV-E9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0ac75036-52f6-4189-b8df-ff4208c073b9;
 Fri, 30 Oct 2020 22:19:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckH-0004uq-L1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckH-0003hz-KJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYckI-0001tV-E9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:42 +0000
X-Inumbo-ID: 0ac75036-52f6-4189-b8df-ff4208c073b9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0ac75036-52f6-4189-b8df-ff4208c073b9;
	Fri, 30 Oct 2020 22:19:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3aBkZO9SvJfK4hrHdgA8bivbQFTndZAsEgcZhw/oywE=; b=h5TA9c0LSKvI7ZNUFXxb0hYalv
	oBjpdNnnaBevFx3HB1k+ZOY9+VPu5hRzUadL1Mym3rudCtx97W2+EW/nOD6bVvCWbhrDzupNmrRds
	f+Ez1lCsYfhJYfNfTkdZe73+KtLM4r3QVbP5Ai2HWtFPWMadHf0pbcN1Kk6h538EDNcc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckH-0004uq-L1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckH-0003hz-KJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/docker: add support for DEB_KEYRING
Message-Id: <E1kYckH-0003hz-KJ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:41 +0000

commit 4c5aeb12387f05348d3ea25c138c450005086ecd
Author:     Alex Bennée <alex.bennee@linaro.org>
AuthorDate: Fri Jul 24 07:45:04 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:35 2020 +0100

    tests/docker: add support for DEB_KEYRING
    
    For installing stuff from sid or ports you may need to manually
    specify the location of the keyring. You can even import keys into
    your personal keyring and point it there, e.g.:
    
      gpg --keyserver keyring.debian.org --recv-keys 84C573CD4E1AFD6C
      make docker-binfmt-image-debian-sid-hppa DEB_TYPE=sid DEB_ARCH=hppa \
          DEB_URL=http://ftp.ports.debian.org/debian-ports/ \
          EXECUTABLE=./hppa-linux-user/qemu-hppa V=1 \
          DEB_KEYRING=${HOME}/.gnupg/pubring.kbx
    
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200724064509.331-12-alex.bennee@linaro.org>
---
 tests/docker/dockerfiles/debian-bootstrap.pre | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/docker/dockerfiles/debian-bootstrap.pre b/tests/docker/dockerfiles/debian-bootstrap.pre
index c164778c30..35c85f7db8 100755
--- a/tests/docker/dockerfiles/debian-bootstrap.pre
+++ b/tests/docker/dockerfiles/debian-bootstrap.pre
@@ -79,6 +79,13 @@ else
     fi
 fi
 
+#
+# Add optional args
+#
+if [ -n "${DEB_KEYRING}" ]; then
+    DEBOOTSTRAP="${DEBOOTSTRAP} --keyring=${DEB_KEYRING}"
+fi
+
 #
 # Finally check to see if any qemu's are installed
 #
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:19:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:19:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16574.40958 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckV-0001vA-DX; Fri, 30 Oct 2020 22:19:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16574.40958; Fri, 30 Oct 2020 22:19:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckV-0001v2-Af; Fri, 30 Oct 2020 22:19:55 +0000
Received: by outflank-mailman (input) for mailman id 16574;
 Fri, 30 Oct 2020 22:19:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYckT-0001uu-TZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 92571f6f-b662-4f03-a540-66bdc872c133;
 Fri, 30 Oct 2020 22:19:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckR-0004uy-PS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckR-0003im-O8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYckT-0001uu-TZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:53 +0000
X-Inumbo-ID: 92571f6f-b662-4f03-a540-66bdc872c133
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 92571f6f-b662-4f03-a540-66bdc872c133;
	Fri, 30 Oct 2020 22:19:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5Jlx6yk54TtGIRrEUmzRV+ZENdej5JuFUORG2MVACM8=; b=BWbz3w2um4Ccg6f+KZd8CdcamQ
	W4zUeMs5nFHVAYNKSnjQOylhlS5uWY1KizAudCDc0iHQJG+sqV1AB6l/OnwacePHLwEW5mIxOcN2p
	i8APCwXQZyUhReW7QTovASn6ctanf3HZl+mY1H/DTmVnm+PFWABUgDzrWeVqCTtqWUtc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckR-0004uy-PS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckR-0003im-O8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:19:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: fix clock_nanosleep()
Message-Id: <E1kYckR-0003im-O8@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:19:51 +0000

commit 8ec68a0a873d24d3f81e0f34892ec4b8b1215ccf
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jul 24 07:45:05 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:41 2020 +0100

    linux-user: fix clock_nanosleep()
    
    If the call is interrupted by a signal handler, it fails with error EINTR
    and if "remain" is not NULL and "flags" is not TIMER_ABSTIME, it returns
    the remaining unslept time in "remain".
    
    Update linux-user to not overwrite the "remain" structure if there is no
    error.
    
    Found with "make check-tcg", linux-test fails on nanosleep test:
    
      TEST    linux-test on x86_64
    .../tests/tcg/multiarch/linux-test.c:242: nanosleep
    
    Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200722174612.2917566-2-laurent@vivier.eu>
    Message-Id: <20200724064509.331-13-alex.bennee@linaro.org>
---
 linux-user/syscall.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1211e759c2..43a6e28396 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11831,8 +11831,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
         target_to_host_timespec(&ts, arg3);
         ret = get_errno(safe_clock_nanosleep(arg1, arg2,
                                              &ts, arg4 ? &ts : NULL));
-        if (arg4)
+        /*
+         * if the call is interrupted by a signal handler, it fails
+         * with error -TARGET_EINTR and if arg4 is not NULL and arg2 is not
+         * TIMER_ABSTIME, it returns the remaining unslept time in arg4.
+         */
+        if (ret == -TARGET_EINTR && arg4 && arg2 != TIMER_ABSTIME) {
             host_to_target_timespec(arg4, &ts);
+        }
 
 #if defined(TARGET_PPC)
         /* clock_nanosleep is odd in that it returns positive errno values.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16575.40962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckg-0002U8-Fe; Fri, 30 Oct 2020 22:20:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16575.40962; Fri, 30 Oct 2020 22:20:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYckg-0002Ty-CB; Fri, 30 Oct 2020 22:20:06 +0000
Received: by outflank-mailman (input) for mailman id 16575;
 Fri, 30 Oct 2020 22:20:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcke-0002CU-9b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7d0b417d-7516-4289-a2ec-4c1e0458ab6d;
 Fri, 30 Oct 2020 22:20:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckb-0004vJ-U3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckb-0003jh-T8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcke-0002CU-9b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:04 +0000
X-Inumbo-ID: 7d0b417d-7516-4289-a2ec-4c1e0458ab6d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7d0b417d-7516-4289-a2ec-4c1e0458ab6d;
	Fri, 30 Oct 2020 22:20:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lOl3qqw81JeYCYUJbkBnQtbg0ODaCw8BGgkcyXoyHgM=; b=HBOSdZhT5PRBSq32jiBu0b0S8i
	hnVLH0PclgJRyi4XMulmQ0TtgWHkciduTBDp3K5UGb8+dPB4nIsoU0vpA5dlwyb5nHlYWmIdQXs/d
	e7lV+/87pWfzxnydecXlPUavmnvzrpLCUfN2+IOEN22A31ZdnxDiPihDzVOesYi9zo7I=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckb-0004vJ-U3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckb-0003jh-T8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
Message-Id: <E1kYckb-0003jh-T8@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:01 +0000

commit 445883885a3507e3a0898df0084a59ba65ee9979
Author:     Laurent Vivier <laurent@vivier.eu>
AuthorDate: Fri Jul 24 07:45:06 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:47 2020 +0100

    linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
    
    Our safe_clock_nanosleep() returns -1 and updates errno.
    
    We don't need to update the CRF bit in syscall.c because it will
    be updated in ppc/cpu_loop.c as the return value is negative.
    
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20200722174612.2917566-3-laurent@vivier.eu>
    Message-Id: <20200724064509.331-14-alex.bennee@linaro.org>
---
 linux-user/syscall.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 43a6e28396..f5c4f6b95d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11840,13 +11840,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             host_to_target_timespec(arg4, &ts);
         }
 
-#if defined(TARGET_PPC)
-        /* clock_nanosleep is odd in that it returns positive errno values.
-         * On PPC, CR0 bit 3 should be set in such a situation. */
-        if (ret && ret != -TARGET_ERESTARTSYS) {
-            ((CPUPPCState *)cpu_env)->crf[0] |= 1;
-        }
-#endif
         return ret;
     }
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16576.40965 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcko-0002ce-HP; Fri, 30 Oct 2020 22:20:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16576.40965; Fri, 30 Oct 2020 22:20:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcko-0002cT-Da; Fri, 30 Oct 2020 22:20:14 +0000
Received: by outflank-mailman (input) for mailman id 16576;
 Fri, 30 Oct 2020 22:20:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYckn-0002cF-5e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6909225d-909d-4070-b7c6-c6811848b415;
 Fri, 30 Oct 2020 22:20:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckm-0004vP-1S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckm-0003lB-0i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYckn-0002cF-5e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:13 +0000
X-Inumbo-ID: 6909225d-909d-4070-b7c6-c6811848b415
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6909225d-909d-4070-b7c6-c6811848b415;
	Fri, 30 Oct 2020 22:20:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3LCmMSn1yUNbnAcCzeIwb0FkiCQcIx+VEEic89Gb+YU=; b=bu/7s+NcTAA6dHAdTPJPWDD6rF
	RHL68WzscUBt/QElsUTt1dthvVQwFuKtR8UgKzADj0npbMKlV9KF+Rm7EUzpoj9ZlFVWAMcEe55Mk
	sGOEFjC7MyVpMOy8apY/3g4sn4RP48S3/0kpz6ln9v+eTLuFfakWMyKqcgBR2KMMhYmA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckm-0004vP-1S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckm-0003lB-0i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qemu: Cleanup changes to ConsoleSocket
Message-Id: <E1kYckm-0003lB-0i@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:12 +0000

commit 4b84d87449f7f7cae5a032f40200915332b32a70
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:07 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:52 2020 +0100

    python/qemu: Cleanup changes to ConsoleSocket
    
    The changes to console_socket.py and machine.py are to
    cleanup for pylint and flake8.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-Id: <20200717203041.9867-2-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-15-alex.bennee@linaro.org>
---
 python/qemu/console_socket.py | 57 ++++++++++++++++++++++---------------------
 python/qemu/machine.py        |  7 +++---
 python/qemu/pylintrc          |  2 +-
 3 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
index 830cb7c628..09986bc215 100644
--- a/python/qemu/console_socket.py
+++ b/python/qemu/console_socket.py
@@ -1,12 +1,9 @@
-#!/usr/bin/env python3
-#
-# This python module implements a ConsoleSocket object which is
-# designed always drain the socket itself, and place
-# the bytes into a in memory buffer for later processing.
-#
-# Optionally a file path can be passed in and we will also
-# dump the characters to this file for debug.
-#
+"""
+QEMU Console Socket Module:
+
+This python module implements a ConsoleSocket object,
+which can drain a socket and optionally dump the bytes to file.
+"""
 # Copyright 2020 Linaro
 #
 # Authors:
@@ -15,20 +12,27 @@
 # This code is licensed under the GPL version 2 or later.  See
 # the COPYING file in the top-level directory.
 #
+
 import asyncore
 import socket
 import threading
-import io
-import os
-import sys
 from collections import deque
 import time
-import traceback
+
 
 class ConsoleSocket(asyncore.dispatcher):
+    """
+    ConsoleSocket represents a socket attached to a char device.
 
+    Drains the socket and places the bytes into an in memory buffer
+    for later processing.
+
+    Optionally a file path can be passed in and we will also
+    dump the characters to this file for debugging purposes.
+    """
     def __init__(self, address, file=None):
         self._recv_timeout_sec = 300
+        self._sleep_time = 0.5
         self._buffer = deque()
         self._asyncore_thread = None
         self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
@@ -70,31 +74,28 @@ class ConsoleSocket(asyncore.dispatcher):
 
     def handle_read(self):
         """process arriving characters into in memory _buffer"""
-        try:
-            data = asyncore.dispatcher.recv(self, 1)
-            # latin1 is needed since there are some chars
-            # we are receiving that cannot be encoded to utf-8
-            # such as 0xe2, 0x80, 0xA6.
-            string = data.decode("latin1")
-        except:
-            print("Exception seen.")
-            traceback.print_exc()
-            return
+        data = asyncore.dispatcher.recv(self, 1)
+        # latin1 is needed since there are some chars
+        # we are receiving that cannot be encoded to utf-8
+        # such as 0xe2, 0x80, 0xA6.
+        string = data.decode("latin1")
         if self._logfile:
             self._logfile.write("{}".format(string))
             self._logfile.flush()
         for c in string:
             self._buffer.extend(c)
 
-    def recv(self, n=1, sleep_delay_s=0.1):
-        """Return chars from in memory buffer"""
+    def recv(self, buffer_size=1):
+        """Return chars from in memory buffer.
+           Maintains the same API as socket.socket.recv.
+        """
         start_time = time.time()
-        while len(self._buffer) < n:
-            time.sleep(sleep_delay_s)
+        while len(self._buffer) < buffer_size:
+            time.sleep(self._sleep_time)
             elapsed_sec = time.time() - start_time
             if elapsed_sec > self._recv_timeout_sec:
                 raise socket.timeout
-        chars = ''.join([self._buffer.popleft() for i in range(n)])
+        chars = ''.join([self._buffer.popleft() for i in range(buffer_size)])
         # We choose to use latin1 to remain consistent with
         # handle_read() and give back the same data as the user would
         # receive if they were reading directly from the
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 51aa255ef9..a09768e9f9 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -27,7 +27,7 @@ import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
-from qemu.console_socket import ConsoleSocket
+from . import console_socket
 
 from . import qmp
 
@@ -674,8 +674,9 @@ class QEMUMachine:
         """
         if self._console_socket is None:
             if self._drain_console:
-                self._console_socket = ConsoleSocket(self._console_address,
-                                                    file=self._console_log_path)
+                self._console_socket = console_socket.ConsoleSocket(
+                    self._console_address,
+                    file=self._console_log_path)
             else:
                 self._console_socket = socket.socket(socket.AF_UNIX,
                                                      socket.SOCK_STREAM)
diff --git a/python/qemu/pylintrc b/python/qemu/pylintrc
index 5d6ae7367d..3f69205000 100644
--- a/python/qemu/pylintrc
+++ b/python/qemu/pylintrc
@@ -33,7 +33,7 @@ good-names=i,
            Run,
            _,
            fd,
-
+           c,
 [VARIABLES]
 
 [STRING]
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16577.40970 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcky-0002eC-JR; Fri, 30 Oct 2020 22:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16577.40970; Fri, 30 Oct 2020 22:20:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcky-0002e4-GR; Fri, 30 Oct 2020 22:20:24 +0000
Received: by outflank-mailman (input) for mailman id 16577;
 Fri, 30 Oct 2020 22:20:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYckx-0002ds-9w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8f690c55-f70f-4e53-9213-b647d331f64b;
 Fri, 30 Oct 2020 22:20:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckw-0004vc-52
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYckw-0003ln-4K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYckx-0002ds-9w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:23 +0000
X-Inumbo-ID: 8f690c55-f70f-4e53-9213-b647d331f64b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8f690c55-f70f-4e53-9213-b647d331f64b;
	Fri, 30 Oct 2020 22:20:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9LPGui+bWAZCNTK7hXTxUigy7Cxgh8q7A01F3yYDi+4=; b=gbkF6PDzVV9PtIvB3JasmFPrl8
	D1SmeU7rYPRwMuA4Frrjic2odhzw/3e2h7c0+q6ZAMiDXPqQ88euaRbMLU7ASA0iyBCmv/WEvhTEc
	/vXlSDUmUD0kX5hI6Eq3SX3sW2wzaiR4b2RXx9PYfLRrI/SoqKemL4Jne0Hw/1RY6G8Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckw-0004vc-52
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYckw-0003ln-4K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] python/qemu: Change ConsoleSocket to optionally drain socket.
Message-Id: <E1kYckw-0003ln-4K@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:22 +0000

commit 80ded8e99d9fc44c206f6b2fae6638df7dcf9305
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:08 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:56 2020 +0100

    python/qemu: Change ConsoleSocket to optionally drain socket.
    
    The primary purpose of this change is to clean up
    machine.py's console_socket property to return a single type,
    a ConsoleSocket.
    
    ConsoleSocket now derives from a socket, which means that
    in the default case (of not draining), machine.py
    will see the same behavior as it did prior to ConsoleSocket.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200717203041.9867-3-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-16-alex.bennee@linaro.org>
---
 python/qemu/console_socket.py | 92 ++++++++++++++++++++++++++-----------------
 python/qemu/machine.py        | 13 ++----
 2 files changed, 59 insertions(+), 46 deletions(-)

diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
index 09986bc215..70869fbbdc 100644
--- a/python/qemu/console_socket.py
+++ b/python/qemu/console_socket.py
@@ -13,68 +13,75 @@ which can drain a socket and optionally dump the bytes to file.
 # the COPYING file in the top-level directory.
 #
 
-import asyncore
 import socket
 import threading
 from collections import deque
 import time
 
 
-class ConsoleSocket(asyncore.dispatcher):
+class ConsoleSocket(socket.socket):
     """
     ConsoleSocket represents a socket attached to a char device.
 
-    Drains the socket and places the bytes into an in memory buffer
-    for later processing.
+    Optionally (if drain==True), drains the socket and places the bytes
+    into an in memory buffer for later processing.
 
     Optionally a file path can be passed in and we will also
     dump the characters to this file for debugging purposes.
     """
-    def __init__(self, address, file=None):
+    def __init__(self, address, file=None, drain=False):
         self._recv_timeout_sec = 300
         self._sleep_time = 0.5
         self._buffer = deque()
-        self._asyncore_thread = None
-        self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-        self._sock.connect(address)
+        socket.socket.__init__(self, socket.AF_UNIX, socket.SOCK_STREAM)
+        self.connect(address)
         self._logfile = None
         if file:
             self._logfile = open(file, "w")
-        asyncore.dispatcher.__init__(self, sock=self._sock)
         self._open = True
-        self._thread_start()
+        if drain:
+            self._drain_thread = self._thread_start()
+        else:
+            self._drain_thread = None
 
-    def _thread_start(self):
-        """Kick off a thread to wait on the asyncore.loop"""
-        if self._asyncore_thread is not None:
-            return
-        self._asyncore_thread = threading.Thread(target=asyncore.loop,
-                                                 kwargs={'timeout':1})
-        self._asyncore_thread.daemon = True
-        self._asyncore_thread.start()
+    def _drain_fn(self):
+        """Drains the socket and runs while the socket is open."""
+        while self._open:
+            try:
+                self._drain_socket()
+            except socket.timeout:
+                # The socket is expected to timeout since we set a
+                # short timeout to allow the thread to exit when
+                # self._open is set to False.
+                time.sleep(self._sleep_time)
 
-    def handle_close(self):
-        """redirect close to base class"""
-        # Call the base class close, but not self.close() since
-        # handle_close() occurs in the context of the thread which
-        # self.close() attempts to join.
-        asyncore.dispatcher.close(self)
+    def _thread_start(self):
+        """Kick off a thread to drain the socket."""
+        # Configure socket to not block and timeout.
+        # This allows our drain thread to not block
+        # on recieve and exit smoothly.
+        socket.socket.setblocking(self, False)
+        socket.socket.settimeout(self, 1)
+        drain_thread = threading.Thread(target=self._drain_fn)
+        drain_thread.daemon = True
+        drain_thread.start()
+        return drain_thread
 
     def close(self):
         """Close the base object and wait for the thread to terminate"""
         if self._open:
             self._open = False
-            asyncore.dispatcher.close(self)
-            if self._asyncore_thread is not None:
-                thread, self._asyncore_thread = self._asyncore_thread, None
+            if self._drain_thread is not None:
+                thread, self._drain_thread = self._drain_thread, None
                 thread.join()
+            socket.socket.close(self)
             if self._logfile:
                 self._logfile.close()
                 self._logfile = None
 
-    def handle_read(self):
+    def _drain_socket(self):
         """process arriving characters into in memory _buffer"""
-        data = asyncore.dispatcher.recv(self, 1)
+        data = socket.socket.recv(self, 1)
         # latin1 is needed since there are some chars
         # we are receiving that cannot be encoded to utf-8
         # such as 0xe2, 0x80, 0xA6.
@@ -85,27 +92,38 @@ class ConsoleSocket(asyncore.dispatcher):
         for c in string:
             self._buffer.extend(c)
 
-    def recv(self, buffer_size=1):
+    def recv(self, bufsize=1):
         """Return chars from in memory buffer.
            Maintains the same API as socket.socket.recv.
         """
+        if self._drain_thread is None:
+            # Not buffering the socket, pass thru to socket.
+            return socket.socket.recv(self, bufsize)
         start_time = time.time()
-        while len(self._buffer) < buffer_size:
+        while len(self._buffer) < bufsize:
             time.sleep(self._sleep_time)
             elapsed_sec = time.time() - start_time
             if elapsed_sec > self._recv_timeout_sec:
                 raise socket.timeout
-        chars = ''.join([self._buffer.popleft() for i in range(buffer_size)])
+        chars = ''.join([self._buffer.popleft() for i in range(bufsize)])
         # We choose to use latin1 to remain consistent with
         # handle_read() and give back the same data as the user would
         # receive if they were reading directly from the
         # socket w/o our intervention.
         return chars.encode("latin1")
 
-    def set_blocking(self):
-        """Maintain compatibility with socket API"""
-        pass
+    def setblocking(self, value):
+        """When not draining we pass thru to the socket,
+           since when draining we control socket blocking.
+        """
+        if self._drain_thread is None:
+            socket.socket.setblocking(self, value)
 
     def settimeout(self, seconds):
-        """Set current timeout on recv"""
-        self._recv_timeout_sec = seconds
+        """When not draining we pass thru to the socket,
+           since when draining we control the timeout.
+        """
+        if seconds is not None:
+            self._recv_timeout_sec = seconds
+        if self._drain_thread is None:
+            socket.socket.settimeout(self, seconds)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index a09768e9f9..82f3731fc3 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -23,7 +23,6 @@ import os
 import subprocess
 import shutil
 import signal
-import socket
 import tempfile
 from typing import Optional, Type
 from types import TracebackType
@@ -673,12 +672,8 @@ class QEMUMachine:
         Returns a socket connected to the console
         """
         if self._console_socket is None:
-            if self._drain_console:
-                self._console_socket = console_socket.ConsoleSocket(
-                    self._console_address,
-                    file=self._console_log_path)
-            else:
-                self._console_socket = socket.socket(socket.AF_UNIX,
-                                                     socket.SOCK_STREAM)
-                self._console_socket.connect(self._console_address)
+            self._console_socket = console_socket.ConsoleSocket(
+                self._console_address,
+                file=self._console_log_path,
+                drain=self._drain_console)
         return self._console_socket
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16578.40975 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcl7-0002fO-LS; Fri, 30 Oct 2020 22:20:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16578.40975; Fri, 30 Oct 2020 22:20:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcl7-0002fE-I0; Fri, 30 Oct 2020 22:20:33 +0000
Received: by outflank-mailman (input) for mailman id 16578;
 Fri, 30 Oct 2020 22:20:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcl7-0002f8-5W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c72ab0fb-c55b-40c0-9573-ef55fe55d1b5;
 Fri, 30 Oct 2020 22:20:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcl6-0004vm-8g
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcl6-0003mJ-7q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcl7-0002f8-5W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:33 +0000
X-Inumbo-ID: c72ab0fb-c55b-40c0-9573-ef55fe55d1b5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c72ab0fb-c55b-40c0-9573-ef55fe55d1b5;
	Fri, 30 Oct 2020 22:20:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tACwem739UlzV+nHM/MJ/HLIi90MyKqEAFlQxnD+ehc=; b=VN1WlYYk2w9zpWEnq0Kwt6DXCo
	kSDLzju25otpzszSiWfcGpnbv0E9J+A4QzjVhgbp5zzNl6GrNW/piFSorTwyttoXGkmpZxJc0hDeX
	kO1gIV1YuQYrQuYhknOSKFcF2krtupiTpHkshJPrtaNinhcNR6fMv5yiTjHmVRm1qw3k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcl6-0004vm-8g
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcl6-0003mJ-7q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/vm: add shutdown timeout in basevm.py
Message-Id: <E1kYcl6-0003mJ-7q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:32 +0000

commit 4a70232b1d26b0d73e1bce60b2c3bdb7e4279d16
Author:     Robert Foley <robert.foley@linaro.org>
AuthorDate: Fri Jul 24 07:45:09 2020 +0100
Commit:     Alex Bennée <alex.bennee@linaro.org>
CommitDate: Mon Jul 27 09:41:58 2020 +0100

    tests/vm: add shutdown timeout in basevm.py
    
    We are adding the shutdown timeout to solve an issue
    we now see where the aarch64 VMs timeout on shutdown
    under TCG.
    
    There is a new 3 second timeout in machine.py,
    which we override in basevm.py when shutting down.
    
    Signed-off-by: Robert Foley <robert.foley@linaro.org>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
    Message-Id: <20200717203041.9867-4-robert.foley@linaro.org>
    Message-Id: <20200724064509.331-17-alex.bennee@linaro.org>
---
 tests/vm/basevm.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 7acb48b876..3fac20e929 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -80,6 +80,8 @@ class BaseVM(object):
     arch = "#arch"
     # command to halt the guest, can be overridden by subclasses
     poweroff = "poweroff"
+    # Time to wait for shutdown to finish.
+    shutdown_timeout_default = 30
     # enable IPv6 networking
     ipv6 = True
     # This is the timeout on the wait for console bytes.
@@ -87,7 +89,7 @@ class BaseVM(object):
     # Scale up some timeouts under TCG.
     # 4 is arbitrary, but greater than 2,
     # since we found we need to wait more than twice as long.
-    tcg_ssh_timeout_multiplier = 4
+    tcg_timeout_multiplier = 4
     def __init__(self, args, config=None):
         self._guest = None
         self._genisoimage = args.genisoimage
@@ -141,9 +143,12 @@ class BaseVM(object):
         if args.jobs and args.jobs > 1:
             self._args += ["-smp", "%d" % args.jobs]
         if kvm_available(self.arch):
+            self._shutdown_timeout = self.shutdown_timeout_default
             self._args += ["-enable-kvm"]
         else:
             logging.info("KVM not available, not using -enable-kvm")
+            self._shutdown_timeout = \
+                self.shutdown_timeout_default * self.tcg_timeout_multiplier
         self._data_args = []
 
         if self._config['qemu_args'] != None:
@@ -423,7 +428,7 @@ class BaseVM(object):
     def wait_ssh(self, wait_root=False, seconds=300, cmd="exit 0"):
         # Allow more time for VM to boot under TCG.
         if not kvm_available(self.arch):
-            seconds *= self.tcg_ssh_timeout_multiplier
+            seconds *= self.tcg_timeout_multiplier
         starttime = datetime.datetime.now()
         endtime = starttime + datetime.timedelta(seconds=seconds)
         cmd_success = False
@@ -441,14 +446,14 @@ class BaseVM(object):
             raise Exception("Timeout while waiting for guest ssh")
 
     def shutdown(self):
-        self._guest.shutdown()
+        self._guest.shutdown(timeout=self._shutdown_timeout)
 
     def wait(self):
-        self._guest.wait()
+        self._guest.wait(timeout=self._shutdown_timeout)
 
     def graceful_shutdown(self):
         self.ssh_root(self.poweroff)
-        self._guest.wait()
+        self._guest.wait(timeout=self._shutdown_timeout)
 
     def qmp(self, *args, **kwargs):
         return self._guest.qmp(*args, **kwargs)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16579.40978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclI-0002hN-MT; Fri, 30 Oct 2020 22:20:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16579.40978; Fri, 30 Oct 2020 22:20:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclI-0002hF-JX; Fri, 30 Oct 2020 22:20:44 +0000
Received: by outflank-mailman (input) for mailman id 16579;
 Fri, 30 Oct 2020 22:20:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYclH-0002h7-E5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f30fbe1e-3e33-4419-bca2-f240f4f9c8c8;
 Fri, 30 Oct 2020 22:20:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclG-0004wK-Dl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclG-0003n9-C9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYclH-0002h7-E5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:43 +0000
X-Inumbo-ID: f30fbe1e-3e33-4419-bca2-f240f4f9c8c8
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f30fbe1e-3e33-4419-bca2-f240f4f9c8c8;
	Fri, 30 Oct 2020 22:20:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LEpA+1YaXzr2flPNIyqxdInNTYwab9h0PoQezVeIboc=; b=a18P2xjLdiuzxvUt9u85fTQl1c
	jDL8dJ3KfkaGjT0fge/2WOUR+xwuOdAaR7PQUaK6CvjKoFd3jC1HCLLfCMGCTMet8mHyJMDmpV9Cj
	F8dnP3hQMIvMmFcpka5/p5ONnrp7w2tHBInwIhUKonTFzHR4/GLiudpee5uOyFNRjU/Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclG-0004wK-Dl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclG-0003n9-C9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stsquad/tags/pull-fixes-for-rc2-270720-1' into staging
Message-Id: <E1kYclG-0003n9-C9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:42 +0000

commit cb320a07e6cb6e251f9aeb4bf57f99cc320eb8ea
Merge: 4215d3413272ad6d1c6c9d0234450b602e46a74c 4a70232b1d26b0d73e1bce60b2c3bdb7e4279d16
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 15:55:56 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 15:55:56 2020 +0100

    Merge remote-tracking branch 'remotes/stsquad/tags/pull-fixes-for-rc2-270720-1' into staging
    
    Various fixes for rc2:
    
      - get shippable working again
      - semihosting bug fixes
      - tweak tb-size handling for low memory machines
      - i386 compound literal float fix
      - linux-user MAP_FIXED->MAP_NOREPLACE on fallback
      - docker binfmt_misc fixes
      - linux-user nanosleep fix
      - tests/vm drain console fixes
    
    # gpg: Signature made Mon 27 Jul 2020 09:45:31 BST
    # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
    # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
    # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
    
    * remotes/stsquad/tags/pull-fixes-for-rc2-270720-1:
      tests/vm: add shutdown timeout in basevm.py
      python/qemu: Change ConsoleSocket to optionally drain socket.
      python/qemu: Cleanup changes to ConsoleSocket
      linux-user, ppc: fix clock_nanosleep() for linux-user-ppc
      linux-user: fix clock_nanosleep()
      tests/docker: add support for DEB_KEYRING
      tests/docker: fix binfmt_misc image building
      tests/docker: fix update command due to python3 str/bytes distinction
      linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
      target/i386: floatx80: avoid compound literals in static initializers
      accel/tcg: better handle memory constrained systems
      util/oslib-win32: add qemu_get_host_physmem implementation
      util: add qemu_get_host_physmem utility function
      semihosting: don't send the trailing '\0'
      semihosting: defer connect_chardevs a little more to use serialx
      shippable: add one more qemu to registry url
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .shippable.yml                                |   2 +-
 accel/tcg/translate-all.c                     |   7 +-
 hw/semihosting/console.c                      |   4 +-
 include/fpu/softfloat.h                       |   1 +
 include/qemu/osdep.h                          |  15 +
 linux-user/elfload.c                          |  10 +-
 linux-user/syscall.c                          |  15 +-
 python/qemu/console_socket.py                 | 137 +++++----
 python/qemu/machine.py                        |  14 +-
 python/qemu/pylintrc                          |   2 +-
 softmmu/vl.c                                  |   5 +-
 target/i386/fpu_helper.c                      | 426 +++++++++++++-------------
 tests/docker/Makefile.include                 |   2 +-
 tests/docker/docker.py                        |  13 +-
 tests/docker/dockerfiles/debian-bootstrap.pre |   7 +
 tests/vm/basevm.py                            |  15 +-
 util/oslib-posix.c                            |  15 +
 util/oslib-win32.c                            |  11 +
 18 files changed, 390 insertions(+), 311 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:20:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:20:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16580.40982 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclT-0002if-OI; Fri, 30 Oct 2020 22:20:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16580.40982; Fri, 30 Oct 2020 22:20:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclT-0002iX-L5; Fri, 30 Oct 2020 22:20:55 +0000
Received: by outflank-mailman (input) for mailman id 16580;
 Fri, 30 Oct 2020 22:20:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYclS-0002iP-Gc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bd2cb032-4496-4c21-aa25-8403580a9523;
 Fri, 30 Oct 2020 22:20:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclQ-0004wU-Or
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclQ-0003oC-O7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYclS-0002iP-Gc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:54 +0000
X-Inumbo-ID: bd2cb032-4496-4c21-aa25-8403580a9523
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bd2cb032-4496-4c21-aa25-8403580a9523;
	Fri, 30 Oct 2020 22:20:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pWe7uJdHrRrUoK1tAGdQTIDhty78U/sjvHG5kMGd1eo=; b=KXYHjzaTNIUCehPLNMkokUDhf3
	4mOTNkJ+iKAoMEk6xPUjahFJ80c+ta1hzgam+VMXHPy7gtJg7iP2NJCJfPrNQZ5Xw9V/nVxhTOvSJ
	oZckx3+xFnjvX4zrpiLUFu7RDR0kKt0lyMvLkeuG/7dl3yRp4nquqsw252yTuR4MRkx4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclQ-0004wU-Or
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclQ-0003oC-O7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:20:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] s390x/protvirt: allow to IPL secure guests with -no-reboot
Message-Id: <E1kYclQ-0003oC-O7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:20:52 +0000

commit d1bb69db4ceb6897ef6a17bf263146b53a123632
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Tue Jul 21 06:32:02 2020 -0400
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 24 08:35:22 2020 +0200

    s390x/protvirt: allow to IPL secure guests with -no-reboot
    
    Right now, -no-reboot prevents secure guests from running. This is
    correct from an implementation point of view, as we have modeled the
    transition from non-secure to secure as a program directed IPL. From
    a user perspective, this is not the behavior of least surprise.
    
    We should implement the IPL into protected mode similar to the
    functions that we use for kdump/kexec. In other words, we do not stop
    here when -no-reboot is specified on the command line. Like function 0
    or function 1, function 10 is not a classic reboot. For example, it
    can only be called once. Before calling it a second time, a real
    reboot/reset must happen in-between. So function code 10 is more or
    less a state transition reset, but not a "standard" reset or reboot.
    
    Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility")
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Acked-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
    Message-Id: <20200721103202.30610-1-borntraeger@de.ibm.com>
    [CH: tweaked description]
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/ipl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index d46b1f094f..3d2652d75a 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -630,7 +630,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
         }
     }
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
-        reset_type == S390_RESET_LOAD_NORMAL) {
+        reset_type == S390_RESET_LOAD_NORMAL ||
+        reset_type == S390_RESET_PV) {
         /* ignore -no-reboot, send no event  */
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
     } else {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16581.40987 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclc-0002jq-Qp; Fri, 30 Oct 2020 22:21:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16581.40987; Fri, 30 Oct 2020 22:21:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclc-0002ji-Mc; Fri, 30 Oct 2020 22:21:04 +0000
Received: by outflank-mailman (input) for mailman id 16581;
 Fri, 30 Oct 2020 22:21:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYclc-0002jZ-0z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a1c9ed98-85b5-4b36-954a-a275de67793b;
 Fri, 30 Oct 2020 22:21:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcla-0004wp-SH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcla-0003pB-Ra
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYclc-0002jZ-0z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:04 +0000
X-Inumbo-ID: a1c9ed98-85b5-4b36-954a-a275de67793b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a1c9ed98-85b5-4b36-954a-a275de67793b;
	Fri, 30 Oct 2020 22:21:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HICdFaqExmGArEj4KK9loNP5AybdhJDdlI6q4XIfWj8=; b=D8+CFUF0vKC30KicgLoo14TG03
	PiFhTwOt4lcvnJP6iH8NgABnpBE4EJpVqr/UVUQ6GfwvVPyb3ug1lRp/qrsvF3Kmjv81awyZqcsfr
	pSmicXPCh1fVpM9iou0nHHsX49dP04FgXSGRr9DNCWjF99JJct4gPwYKxgSyQaJy61Z8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcla-0004wp-SH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcla-0003pB-Ra
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] s390x/s390-virtio-ccw: fix loadparm property getter
Message-Id: <E1kYcla-0003pB-Ra@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:02 +0000

commit d6645483285feaa0aa26fe2b0c3bac6989250d2f
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Thu Jul 23 18:27:17 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Fri Jul 24 08:49:53 2020 +0200

    s390x/s390-virtio-ccw: fix loadparm property getter
    
    The function machine_get_loadparm() is supposed to produce a C-string,
    that is a NUL-terminated one, but it does not. ElectricFence can detect
    this problem if the loadparm machine property is used.
    
    Let us make the returned string a NUL-terminated one.
    
    Fixes: 7104bae9de ("hw/s390x: provide loadparm property for the machine")
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200723162717.88485-1-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 8cc2f25d8a..403d30e13b 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -701,8 +701,12 @@ bool hpage_1m_allowed(void)
 static char *machine_get_loadparm(Object *obj, Error **errp)
 {
     S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
+    char *loadparm_str;
 
-    return g_memdup(ms->loadparm, sizeof(ms->loadparm));
+    /* make a NUL-terminated string */
+    loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
+    loadparm_str[sizeof(ms->loadparm)] = 0;
+    return loadparm_str;
 }
 
 static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16582.40990 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclm-0002lM-Sf; Fri, 30 Oct 2020 22:21:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16582.40990; Fri, 30 Oct 2020 22:21:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclm-0002lE-Pl; Fri, 30 Oct 2020 22:21:14 +0000
Received: by outflank-mailman (input) for mailman id 16582;
 Fri, 30 Oct 2020 22:21:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcll-0002l4-Sq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b0f4af78-ed5f-45f3-8f0c-bef938a4bc36;
 Fri, 30 Oct 2020 22:21:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcll-0004wx-0K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclk-0003qT-Uv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcll-0002l4-Sq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:13 +0000
X-Inumbo-ID: b0f4af78-ed5f-45f3-8f0c-bef938a4bc36
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b0f4af78-ed5f-45f3-8f0c-bef938a4bc36;
	Fri, 30 Oct 2020 22:21:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IWZiQj1FN7ea6I2MViXvywH9AP+sW4nKRO2AvyZ5LVY=; b=3uvhGkiXnUjPm4UB+hWZl5eTqh
	y2pe51fn0QecRZo9ME4Hz9w8JqCyL65up91QaFIjJunZNGtlWejjvg3wXpa2Oo7iKbCncTsX3uUGf
	AeKe8S81G883CrZf6veCECeZVd1SompCI+AYysDAlDbzOOI8j5a8LlougdtCbXObWAec=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcll-0004wx-0K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclk-0003qT-Uv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging
Message-Id: <E1kYclk-0003qT-Uv@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:12 +0000

commit 9303ecb658a0194560d1eecde165a1511223c2d8
Merge: cb320a07e6cb6e251f9aeb4bf57f99cc320eb8ea d6645483285feaa0aa26fe2b0c3bac6989250d2f
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 17:25:06 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 17:25:06 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200727' into staging
    
    fixes for protected virtualization and loadparm handling
    
    # gpg: Signature made Mon 27 Jul 2020 15:01:32 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200727:
      s390x/s390-virtio-ccw: fix loadparm property getter
      s390x/protvirt: allow to IPL secure guests with -no-reboot
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/s390x/ipl.c             | 3 ++-
 hw/s390x/s390-virtio-ccw.c | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16583.40994 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclw-0002me-UK; Fri, 30 Oct 2020 22:21:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16583.40994; Fri, 30 Oct 2020 22:21:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYclw-0002mW-RF; Fri, 30 Oct 2020 22:21:24 +0000
Received: by outflank-mailman (input) for mailman id 16583;
 Fri, 30 Oct 2020 22:21:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYclw-0002mM-6D
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c4b5688e-0a76-4d65-a6c0-eb830714637d;
 Fri, 30 Oct 2020 22:21:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclv-0004xA-Cz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYclv-0003s2-CA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYclw-0002mM-6D
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:24 +0000
X-Inumbo-ID: c4b5688e-0a76-4d65-a6c0-eb830714637d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c4b5688e-0a76-4d65-a6c0-eb830714637d;
	Fri, 30 Oct 2020 22:21:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rlAqZpa9DRNzJEXWbeUuDIpPV6zDcK4lmoE6XdbNT6s=; b=rquvjBnT3EX8Zq1XY8mfU9rQpk
	luSSOT9Utooz+s36pih+bl5l6LxyXiXr24JO5pTvcCwL0vXG6WsogwS5ct6dKU94510xkwh8Ioo+v
	6947xDVR8jD91UZOzJnxCxdcUCf39tO7hDYpRaQlkuIM6JOi4qb5BoBUprD0Ir7UjWFY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclv-0004xA-Cz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYclv-0003s2-CA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-mem-pci: force virtio version 1
Message-Id: <E1kYclv-0003s2-CA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:23 +0000

commit c22aba196341995f2e45c37eed36cc7be09e4bc3
Author:     David Hildenbrand <david@redhat.com>
AuthorDate: Mon Jul 27 13:59:05 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 09:38:33 2020 -0400

    virtio-mem-pci: force virtio version 1
    
    Trying to run simple virtio-mem-pci examples currently fails with
        qemu-system-x86_64: -device virtio-mem-pci,id=vm0,memdev=mem0,node=0,
        requested-size=300M: device is modern-only, use disable-legacy=on
    due to the added safety checks in 9b3a35ec8236 ("virtio: verify that legacy
    support is not accidentally on").
    
    As noted by Conny, we have to force virtio version 1. While at it, use
    qdev_realize() to set the parent bus and realize - like most other
    virtio-*-pci implementations.
    
    Fixes: 0b9a2443a48b ("virtio-pci: Proxy for virtio-mem")
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Cc: Cornelia Huck <cohuck@redhat.com>
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Message-Id: <20200727115905.129397-1-david@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-mem-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c
index d375280ee1..590cec041b 100644
--- a/hw/virtio/virtio-mem-pci.c
+++ b/hw/virtio/virtio-mem-pci.c
@@ -21,8 +21,8 @@ static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOMEMPCI *mem_pci = VIRTIO_MEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&mem_pci->vdev);
 
-    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
-    object_property_set_bool(OBJECT(vdev), "realized", true, errp);
+    virtio_pci_force_virtio_1(vpci_dev);
+    qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
 static void virtio_mem_pci_set_addr(MemoryDeviceState *md, uint64_t addr,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16584.40998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcm7-0002o0-W6; Fri, 30 Oct 2020 22:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16584.40998; Fri, 30 Oct 2020 22:21:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcm7-0002ns-Sn; Fri, 30 Oct 2020 22:21:35 +0000
Received: by outflank-mailman (input) for mailman id 16584;
 Fri, 30 Oct 2020 22:21:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcm6-0002nk-Ib
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6617de6a-0903-490e-b8ac-d57a2b1a725e;
 Fri, 30 Oct 2020 22:21:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcm5-0004xI-Ge
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcm5-0003sg-Fm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcm6-0002nk-Ib
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:34 +0000
X-Inumbo-ID: 6617de6a-0903-490e-b8ac-d57a2b1a725e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6617de6a-0903-490e-b8ac-d57a2b1a725e;
	Fri, 30 Oct 2020 22:21:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IP8TdBTNTtVXcXX6PJFf8MLZlLrDp0LTUlwjjmjVVlM=; b=50yFhrbEoUXBwMTUFGCKZ+Y9NE
	eveSRF5aqv8Zm2/PH8nX4wDxm8yo3bPRPo5QgbwdLfdPJAGZ5jTkJmn9QxqdsLCDUYf2C0ccNTIrl
	/cPPuggnBxFfJchefTnq/OAIGl2os5Tf7aNuAKiKwER9hB3BZdsKR9cR3uNHIzLcGHyk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcm5-0004xI-Ge
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcm5-0003sg-Fm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/pci-host: save/restore pci host config register
Message-Id: <E1kYcm5-0003sg-Fm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:33 +0000

commit 2ebc21216f58f6fcbf16f7ec0bebe7f72ab3d8ca
Author:     Hogan Wang <king.wang@huawei.com>
AuthorDate: Mon Jul 27 16:46:20 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:24:39 2020 -0400

    hw/pci-host: save/restore pci host config register
    
    The pci host config register is used to save PCI address for
    read/write config data. If guest writes a value to config register,
    and then QEMU pauses the vcpu to migrate, after the migration, the guest
    will continue to write pci config data, and the write data will be ignored
    because of new qemu process losing the config register state.
    
    To trigger the bug:
    1. guest is booting in seabios.
    2. guest enables the SMRAM in seabios:piix4_apmc_smm_setup, and then
       expects to disable the SMRAM by pci_config_writeb.
    3. after guest writes the pci host config register, QEMU pauses vcpu
       to finish migration.
    4. guest write of config data(0x0A) fails to disable the SMRAM because
       the config register state is lost.
    5. guest continues to boot and crashes in ipxe option ROM due to SMRAM
       in enabled state.
    
    Example Reproducer:
    
    step 1. Make modifications to seabios and qemu for increase reproduction
    efficiency, write 0xf0 to 0x402 port notify qemu to stop vcpu after
    0x0cf8 port wrote i440 configure register. qemu stop vcpu when catch
    0x402 port wrote 0xf0.
    
    seabios:/src/hw/pci.c
    @@ -52,6 +52,11 @@ void pci_config_writeb(u16 bdf, u32 addr, u8 val)
             writeb(mmconfig_addr(bdf, addr), val);
         } else {
             outl(ioconfig_cmd(bdf, addr), PORT_PCI_CMD);
    +       if (bdf == 0 && addr == 0x72 && val == 0xa) {
    +            dprintf(1, "stop vcpu\n");
    +            outb(0xf0, 0x402); // notify qemu to stop vcpu
    +            dprintf(1, "resume vcpu\n");
    +        }
             outb(val, PORT_PCI_DATA + (addr & 3));
         }
     }
    
    qemu:hw/char/debugcon.c
    @@ -60,6 +61,9 @@ static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
         printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02" PRIx64 "]\n", addr, val);
     #endif
    
    +    if (ch == 0xf0) {
    +        vm_stop(RUN_STATE_PAUSED);
    +    }
         /* XXX this blocks entire thread. Rewrite to use
          * qemu_chr_fe_write and background I/O callbacks */
         qemu_chr_fe_write_all(&s->chr, &ch, 1);
    
    step 2. start vm1 by the following command line, and then vm stopped.
    $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
     -netdev tap,ifname=tap-test,id=hostnet0,vhost=on,downscript=no,script=no\
     -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
     -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
     -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
     -device isa-debugcon,iobase=0x402,chardev=seabios\
     -monitor stdio
    
    step 3. start vm2 to accept vm1 state.
    $ qemu-system-x86_64 -machine pc-i440fx-5.0,accel=kvm\
     -netdev tap,ifname=tap-test1,id=hostnet0,vhost=on,downscript=no,script=no\
     -device virtio-net-pci,netdev=hostnet0,id=net0,bus=pci.0,addr=0x13,bootindex=3\
     -device cirrus-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2\
     -chardev file,id=seabios,path=/var/log/test.seabios,append=on\
     -device isa-debugcon,iobase=0x402,chardev=seabios\
     -monitor stdio \
     -incoming tcp:127.0.0.1:8000
    
    step 4. execute the following qmp command in vm1 to migrate.
    (qemu) migrate tcp:127.0.0.1:8000
    
    step 5. execute the following qmp command in vm2 to resume vcpu.
    (qemu) cont
    Before this patch, we get KVM "emulation failure" error on vm2.
    This patch fixes it.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Hogan Wang <hogan.wang@huawei.com>
    Message-Id: <20200727084621.3279-1-hogan.wang@huawei.com>
    Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/core/machine.c         |  1 +
 hw/i386/pc.c              |  3 ++-
 hw/pci/pci_host.c         | 33 +++++++++++++++++++++++++++++++++
 include/hw/pci/pci_host.h |  1 +
 4 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 2f881d6d75..8d1a90c6cf 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -29,6 +29,7 @@
 #include "migration/vmstate.h"
 
 GlobalProperty hw_compat_5_0[] = {
+    { "pci-host-bridge", "x-config-reg-migration-enabled", "off" },
     { "virtio-balloon-device", "page-poison", "false" },
     { "vmport", "x-read-set-eax", "off" },
     { "vmport", "x-signal-unsupported-cmd", "off" },
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3d419d5991..47c5ca3e34 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -97,7 +97,8 @@
 #include "fw_cfg.h"
 #include "trace.h"
 
-GlobalProperty pc_compat_5_0[] = {};
+GlobalProperty pc_compat_5_0[] = {
+};
 const size_t pc_compat_5_0_len = G_N_ELEMENTS(pc_compat_5_0);
 
 GlobalProperty pc_compat_4_2[] = {
diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c
index ce7bcdb1d5..8ca5fadcbd 100644
--- a/hw/pci/pci_host.c
+++ b/hw/pci/pci_host.c
@@ -22,8 +22,10 @@
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_host.h"
+#include "hw/qdev-properties.h"
 #include "qemu/module.h"
 #include "hw/pci/pci_bus.h"
+#include "migration/vmstate.h"
 #include "trace.h"
 
 /* debug PCI */
@@ -200,12 +202,43 @@ const MemoryRegionOps pci_host_data_be_ops = {
     .endianness = DEVICE_BIG_ENDIAN,
 };
 
+static bool pci_host_needed(void *opaque)
+{
+    PCIHostState *s = opaque;
+    return s->mig_enabled;
+}
+
+const VMStateDescription vmstate_pcihost = {
+    .name = "PCIHost",
+    .needed = pci_host_needed,
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(config_reg, PCIHostState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static Property pci_host_properties_common[] = {
+    DEFINE_PROP_BOOL("x-config-reg-migration-enabled", PCIHostState,
+                     mig_enabled, true),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void pci_host_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    device_class_set_props(dc, pci_host_properties_common);
+    dc->vmsd = &vmstate_pcihost;
+}
+
 static const TypeInfo pci_host_type_info = {
     .name = TYPE_PCI_HOST_BRIDGE,
     .parent = TYPE_SYS_BUS_DEVICE,
     .abstract = true,
     .class_size = sizeof(PCIHostBridgeClass),
     .instance_size = sizeof(PCIHostState),
+    .class_init = pci_host_class_init,
 };
 
 static void pci_host_register_types(void)
diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h
index 9ce088bd13..6210a7e14d 100644
--- a/include/hw/pci/pci_host.h
+++ b/include/hw/pci/pci_host.h
@@ -45,6 +45,7 @@ struct PCIHostState {
     MemoryRegion data_mem;
     MemoryRegion mmcfg;
     uint32_t config_reg;
+    bool mig_enabled;
     PCIBus *bus;
 
     QLIST_ENTRY(PCIHostState) next;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16585.41002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmH-0002pX-12; Fri, 30 Oct 2020 22:21:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16585.41002; Fri, 30 Oct 2020 22:21:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmG-0002pO-UJ; Fri, 30 Oct 2020 22:21:44 +0000
Received: by outflank-mailman (input) for mailman id 16585;
 Fri, 30 Oct 2020 22:21:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcmG-0002pI-EM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3673ab69-2e52-4a4f-908a-d33846e129fa;
 Fri, 30 Oct 2020 22:21:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmF-0004y7-K7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmF-0003tO-JL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcmG-0002pI-EM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:44 +0000
X-Inumbo-ID: 3673ab69-2e52-4a4f-908a-d33846e129fa
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3673ab69-2e52-4a4f-908a-d33846e129fa;
	Fri, 30 Oct 2020 22:21:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hxr6DK16mEH8GSE/9KwFkSwNIeIYJA8UDKs0aABvcCE=; b=EB4XH/16VU6xMof4HsS5Lvcr9l
	ZaCteJvItXO9GihRoGLsvjry8pREVr1xTEqGp6JIddiu4+U2RJyah7xAEZAtFWgoExVQzXTIH/OT6
	2KMa4MCLagMJYe1GP8Shoyh1BG94fOrAjRNHXgg3YDBJjuu5HnhG9SFb7qlTddTBJoXA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmF-0004y7-K7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmF-0003tO-JL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Fix vhost-user buffer over-read on ram hot-unplug
Message-Id: <E1kYcmF-0003tO-JL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:43 +0000

commit 4fdecf0543b49b8e171510104f3117538b9d1fe9
Author:     Raphael Norwitz <raphael.norwitz@nutanix.com>
AuthorDate: Fri Jul 17 04:21:30 2020 +0000
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    Fix vhost-user buffer over-read on ram hot-unplug
    
    The VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS vhost-user protocol
    feature introduced a shadow-table, used by the backend to dynamically
    determine how a vdev's memory regions have changed since the last
    vhost_user_set_mem_table() call. On hot-remove, a memmove() operation
    is used to overwrite the removed shadow region descriptor(s). The size
    parameter of this memmove was off by 1 such that if a VM with a backend
    supporting the VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS filled it's
    shadow-table (by performing the maximum number of supported hot-add
    operatons) and attempted to remove the last region, Qemu would read an
    out of bounds value and potentially crash.
    
    This change fixes the memmove() bounds such that this erroneous read can
    never happen.
    
    Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com>
    Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Message-Id: <1594799958-31356-1-git-send-email-raphael.norwitz@nutanix.com>
    Fixes: f1aeb14b0809 ("Transmit vhost-user memory regions individually")
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 31231218dc..d7e2423762 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -672,7 +672,7 @@ static int send_remove_regions(struct vhost_dev *dev,
         memmove(&u->shadow_regions[shadow_reg_idx],
                 &u->shadow_regions[shadow_reg_idx + 1],
                 sizeof(struct vhost_memory_region) *
-                (u->num_shadow_regions - shadow_reg_idx));
+                (u->num_shadow_regions - shadow_reg_idx - 1));
         u->num_shadow_regions--;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:21:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:21:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16586.41006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmS-0002qw-2U; Fri, 30 Oct 2020 22:21:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16586.41006; Fri, 30 Oct 2020 22:21:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmR-0002qo-Vr; Fri, 30 Oct 2020 22:21:55 +0000
Received: by outflank-mailman (input) for mailman id 16586;
 Fri, 30 Oct 2020 22:21:54 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcmQ-0002qf-G3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 97f9f3e1-654b-4c43-8c5f-04a1ef41a877;
 Fri, 30 Oct 2020 22:21:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmP-0004yH-Np
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmP-0003u4-Mx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:53 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcmQ-0002qf-G3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:54 +0000
X-Inumbo-ID: 97f9f3e1-654b-4c43-8c5f-04a1ef41a877
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 97f9f3e1-654b-4c43-8c5f-04a1ef41a877;
	Fri, 30 Oct 2020 22:21:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nYOaQAe2o0QMmeR7Gjb4OtJM6IoJQ79HYUJfMo13TK8=; b=qzl4pZfnoG2dqXFtbHLJWDrw9m
	XjMZ6yEirXzt13Leg9esrL0qCPW8ZjHaf13h/MPHrCPG3jQvIutBrDzOziis6l+LoAPbpYNoENTAP
	3tsVChcRgT2JGnQS/d0LqQEdyYR1oXqeJ2yMGPld3ppXKyKYrgJHGr9lQ9lBos1QF7fM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmP-0004yH-Np
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmP-0003u4-Mx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:21:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] libvhost-user: Report descriptor index on panic
Message-Id: <E1kYcmP-0003u4-Mx@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:21:53 +0000

commit 8fe9805c73c277dc2feeaa83de73d6a58bf23f39
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Thu Jul 23 19:19:35 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    libvhost-user: Report descriptor index on panic
    
    We want to report the index of the descriptor,
    not its pointer.
    
    Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200723171935.18535-1-philmd@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index d315db1396..53f16bdf08 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -2074,7 +2074,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
 
     /* If their number is silly, that's a fatal mistake. */
     if (*head >= vq->vring.num) {
-        vu_panic(dev, "Guest says index %u is available", head);
+        vu_panic(dev, "Guest says index %u is available", *head);
         return false;
     }
 
@@ -2133,7 +2133,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
     smp_wmb();
 
     if (*next >= max) {
-        vu_panic(dev, "Desc next is %u", next);
+        vu_panic(dev, "Desc next is %u", *next);
         return VIRTQUEUE_READ_DESC_ERROR;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16587.41010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmc-0002sE-4J; Fri, 30 Oct 2020 22:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16587.41010; Fri, 30 Oct 2020 22:22:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmc-0002s5-16; Fri, 30 Oct 2020 22:22:06 +0000
Received: by outflank-mailman (input) for mailman id 16587;
 Fri, 30 Oct 2020 22:22:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcma-0002rs-Jo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id e9cfccad-9010-4887-9695-e97a09431d84;
 Fri, 30 Oct 2020 22:22:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmZ-0004yh-RP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmZ-0003uz-QX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcma-0002rs-Jo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:04 +0000
X-Inumbo-ID: e9cfccad-9010-4887-9695-e97a09431d84
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id e9cfccad-9010-4887-9695-e97a09431d84;
	Fri, 30 Oct 2020 22:22:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ierFIAC669V3TxrTjx9kSsqr5s0KtGoURc5hm/0GFP4=; b=SncsQGuSdi1KKdA4rSPGYZq0Ar
	nNfIIWGFj5e7m5+IeFd0EagGQNnunU+IxkAmkmMl/ETntKy99cuRKm/L2hmYwn3uLTvYxf+yS3Vdk
	XuSr0HR6+yoZj/LRrxMnQMh0+iBhwbnhYu77ryo7PpddObkvwkIxqe2DWcU2AORm7uh4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmZ-0004yh-RP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmZ-0003uz-QX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
Message-Id: <E1kYcmZ-0003uz-QX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:03 +0000

commit 386494f29e2b902bc501176573bb4c69eab666c4
Author:     Cindy Lu <lulu@redhat.com>
AuthorDate: Fri Jul 10 14:46:42 2020 +0800
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
    
    In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
    
    Signed-off-by: Cindy Lu <lulu@redhat.com>
    Message-Id: <20200710064642.24505-1-lulu@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 65d5aaf08a..4580f3efd8 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -37,7 +37,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
 static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
                               void *vaddr, bool readonly)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
@@ -60,7 +60,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
 static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
                                 hwaddr size)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16588.41014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmm-0002tg-77; Fri, 30 Oct 2020 22:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16588.41014; Fri, 30 Oct 2020 22:22:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmm-0002tY-40; Fri, 30 Oct 2020 22:22:16 +0000
Received: by outflank-mailman (input) for mailman id 16588;
 Fri, 30 Oct 2020 22:22:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcmk-0002tM-Sf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6cd4fc8c-69c5-43fa-a302-2f005a8452ca;
 Fri, 30 Oct 2020 22:22:14 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmj-0004yp-Vl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmj-0003vc-UC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcmk-0002tM-Sf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:14 +0000
X-Inumbo-ID: 6cd4fc8c-69c5-43fa-a302-2f005a8452ca
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6cd4fc8c-69c5-43fa-a302-2f005a8452ca;
	Fri, 30 Oct 2020 22:22:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I8qRHk6jGtqBUgJgo9iHje+zoNBn68JS+X2ReWIqvCE=; b=kuaz32yQewu4yCYfqS9WJOHc4X
	JCJsrdWymbizYhbKrCf7yvEdubIj0+4sgzW5koXA5nCSWiQEPqknB1iLwKt8HyNbkgg3ciGtje36t
	dvOeJWfsIh0Ql320lv6Q5N6JNbfrXPfVC6C14wXr6Y98HVPuTrWOiiP50MdE+25RAc1s=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmj-0004yp-Vl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmj-0003vc-UC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] MAINTAINERS: Cover the firmware JSON schema
Message-Id: <E1kYcmj-0003vc-UC@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:13 +0000

commit d0d89526f70ded5ac41a4c6bb071c0d919b772db
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Fri Jul 3 20:34:50 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 10:28:28 2020 -0400

    MAINTAINERS: Cover the firmware JSON schema
    
    Add an entry to cover firmware.json (see commit 3a0adfc9bf:
    schema that describes the different uses and properties of
    virtual machine firmware).
    
    Cc: Laszlo Ersek <lersek@redhat.com>
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Cc: Kashyap Chamarthy <kchamart@redhat.com>
    Cc: Daniel P. Berrange <berrange@redhat.com>
    Suggested-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200703183450.32398-1-philmd@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3395abd4e1..0886eb3d2b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2667,6 +2667,14 @@ F: include/hw/i2c/smbus_master.h
 F: include/hw/i2c/smbus_slave.h
 F: include/hw/i2c/smbus_eeprom.h
 
+Firmware schema specifications
+M: Laszlo Ersek <lersek@redhat.com>
+M: Philippe Mathieu-Daudé <philmd@redhat.com>
+R: Daniel P. Berrange <berrange@redhat.com>
+R: Kashyap Chamarthy <kchamart@redhat.com>
+S: Maintained
+F: docs/interop/firmware.json
+
 EDK2 Firmware
 M: Laszlo Ersek <lersek@redhat.com>
 M: Philippe Mathieu-Daudé <philmd@redhat.com>
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16589.41018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmw-0002uy-8U; Fri, 30 Oct 2020 22:22:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16589.41018; Fri, 30 Oct 2020 22:22:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcmw-0002uq-5W; Fri, 30 Oct 2020 22:22:26 +0000
Received: by outflank-mailman (input) for mailman id 16589;
 Fri, 30 Oct 2020 22:22:25 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcmv-0002ud-3S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 25f7d046-17df-4117-a05b-d4bf94ca671a;
 Fri, 30 Oct 2020 22:22:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmu-0004z1-3C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcmu-0003wG-2Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:24 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcmv-0002ud-3S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:25 +0000
X-Inumbo-ID: 25f7d046-17df-4117-a05b-d4bf94ca671a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 25f7d046-17df-4117-a05b-d4bf94ca671a;
	Fri, 30 Oct 2020 22:22:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=P9jlXv+6e/EroSZxZyLJg8itggX2/digVPqaolMAQhY=; b=huQM/JtEqb23q1zr+jIuLO+wlJ
	Vl1a1qWiyIavEO8WyqFlJCHKxwBH0a7oK7YN23SA043GuqhoVrVSD8jSyFFnsh35bL5JHAtRdCQNQ
	eTzAH1ECtP33ycrGjwniVnWIWg9D7SonhL+Go4UmApTrepWOWKKJG8/5QaN1lJX4Y3Tw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmu-0004z1-3C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcmu-0003wG-2Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-pci: fix virtio_pci_queue_enabled()
Message-Id: <E1kYcmu-0003wG-2Q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:24 +0000

commit 0c9753ebda274b0e618d7b4032bb2d83d27483ed
Author:     Laurent Vivier <lvivier@redhat.com>
AuthorDate: Mon Jul 27 17:33:19 2020 +0200
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Mon Jul 27 11:34:50 2020 -0400

    virtio-pci: fix virtio_pci_queue_enabled()
    
    In legacy mode, virtio_pci_queue_enabled() falls back to
    virtio_queue_enabled() to know if the queue is enabled.
    
    But virtio_queue_enabled() calls again virtio_pci_queue_enabled()
    if k->queue_enabled is set. This ends in a crash after a stack
    overflow.
    
    The problem can be reproduced with
    "-device virtio-net-pci,disable-legacy=off,disable-modern=true
     -net tap,vhost=on"
    
    And a look to the backtrace is very explicit:
    
        ...
        #4  0x000000010029a438 in virtio_queue_enabled ()
        #5  0x0000000100497a9c in virtio_pci_queue_enabled ()
        ...
        #130902 0x000000010029a460 in virtio_queue_enabled ()
        #130903 0x0000000100497a9c in virtio_pci_queue_enabled ()
        #130904 0x000000010029a460 in virtio_queue_enabled ()
        #130905 0x0000000100454a20 in vhost_net_start ()
        ...
    
    This patch fixes the problem by introducing a new function
    for the legacy case and calls it from virtio_pci_queue_enabled().
    It also calls it from virtio_queue_enabled() to avoid code duplication.
    
    Fixes: f19bcdfedd53 ("virtio-pci: implement queue_enabled method")
    Cc: Jason Wang <jasowang@redhat.com>
    Cc: Cindy Lu <lulu@redhat.com>
    CC: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Laurent Vivier <lvivier@redhat.com>
    Message-Id: <20200727153319.43716-1-lvivier@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-pci.c     | 2 +-
 hw/virtio/virtio.c         | 7 ++++++-
 include/hw/virtio/virtio.h | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index ada1101d07..4ad3ad81a2 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1116,7 +1116,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
         return proxy->vqs[vdev->queue_sel].enabled;
     }
 
-    return virtio_queue_enabled(vdev, n);
+    return virtio_queue_enabled_legacy(vdev, n);
 }
 
 static int virtio_pci_add_mem_cap(VirtIOPCIProxy *proxy,
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 546a198e79..e983025217 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3309,6 +3309,11 @@ hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n)
     return vdev->vq[n].vring.desc;
 }
 
+bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n)
+{
+    return virtio_queue_get_desc_addr(vdev, n) != 0;
+}
+
 bool virtio_queue_enabled(VirtIODevice *vdev, int n)
 {
     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
@@ -3317,7 +3322,7 @@ bool virtio_queue_enabled(VirtIODevice *vdev, int n)
     if (k->queue_enabled) {
         return k->queue_enabled(qbus->parent, n);
     }
-    return virtio_queue_get_desc_addr(vdev, n) != 0;
+    return virtio_queue_enabled_legacy(vdev, n);
 }
 
 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 198ffc7626..e424df12cf 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -295,6 +295,7 @@ typedef struct VirtIORNGConf VirtIORNGConf;
                       VIRTIO_F_RING_PACKED, false)
 
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
+bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n);
 bool virtio_queue_enabled(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16590.41022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcn6-0002wA-A5; Fri, 30 Oct 2020 22:22:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16590.41022; Fri, 30 Oct 2020 22:22:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcn6-0002w2-72; Fri, 30 Oct 2020 22:22:36 +0000
Received: by outflank-mailman (input) for mailman id 16590;
 Fri, 30 Oct 2020 22:22:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcn5-0002vs-3C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 66019791-2222-4797-bc76-7e7a0a1b9977;
 Fri, 30 Oct 2020 22:22:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcn4-0004z9-7u
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcn4-0003ww-6H
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcn5-0002vs-3C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:35 +0000
X-Inumbo-ID: 66019791-2222-4797-bc76-7e7a0a1b9977
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 66019791-2222-4797-bc76-7e7a0a1b9977;
	Fri, 30 Oct 2020 22:22:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=15cEdZvspq2JAYq7+1ghCj7w4cOzRNYXN/dKW27/BOo=; b=z+mZEgsReqmmK8cVpWFS6mLL7F
	v0waS+KJt6LGIguWz1g42r1Qngxy6ffuKtqFsk17z0mtWflBgCls8j/lwSUDSC3OsKwtidXM+REBy
	7WXX1phG2j2ecM5wpEdk+mzRLaYcPw4U36r5iK2+umFD0XxOqckp7/obCUfCR9soBQgM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcn4-0004z9-7u
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcn4-0003ww-6H
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYcn4-0003ww-6H@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:34 +0000

commit 93ea484375ab473379dd9c836261ef484bd71ab1
Merge: 9303ecb658a0194560d1eecde165a1511223c2d8 0c9753ebda274b0e618d7b4032bb2d83d27483ed
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 21:00:01 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 21:00:01 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio,pci: bugfixes
    
    Minor bugfixes all over the places, including one CVE.
    
    Additionally, a fix for an ancient bug in migration -
    one has to wonder how come no one noticed.
    
    The fix is also non-trivial since we dare not break all
    existing machine types with pci - we have a work around
    in the works, for now we just skip the work-around for
    old machine types.
    
    Great job by Hogan Wang noticing, debugging and fixing it,
    and thanks to Dr. David Alan Gilbert for reviewing the patches.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Mon 27 Jul 2020 16:34:58 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-pci: fix virtio_pci_queue_enabled()
      MAINTAINERS: Cover the firmware JSON schema
      vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
      libvhost-user: Report descriptor index on panic
      Fix vhost-user buffer over-read on ram hot-unplug
      hw/pci-host: save/restore pci host config register
      virtio-mem-pci: force virtio version 1
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 MAINTAINERS                           |  8 ++++++++
 contrib/libvhost-user/libvhost-user.c |  4 ++--
 hw/core/machine.c                     |  1 +
 hw/i386/pc.c                          |  3 ++-
 hw/pci/pci_host.c                     | 33 +++++++++++++++++++++++++++++++++
 hw/virtio/vhost-user.c                |  2 +-
 hw/virtio/vhost-vdpa.c                |  4 ++--
 hw/virtio/virtio-mem-pci.c            |  4 ++--
 hw/virtio/virtio-pci.c                |  2 +-
 hw/virtio/virtio.c                    |  7 ++++++-
 include/hw/pci/pci_host.h             |  1 +
 include/hw/virtio/virtio.h            |  1 +
 12 files changed, 60 insertions(+), 10 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16591.41025 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnG-0002y9-Bb; Fri, 30 Oct 2020 22:22:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16591.41025; Fri, 30 Oct 2020 22:22:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnG-0002y1-8a; Fri, 30 Oct 2020 22:22:46 +0000
Received: by outflank-mailman (input) for mailman id 16591;
 Fri, 30 Oct 2020 22:22:45 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcnF-0002xw-Du
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5e002407-abcb-4b53-a8e2-27d433a22537;
 Fri, 30 Oct 2020 22:22:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnE-00051B-Jf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnE-0003zf-Im
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcnF-0002xw-Du
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:45 +0000
X-Inumbo-ID: 5e002407-abcb-4b53-a8e2-27d433a22537
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5e002407-abcb-4b53-a8e2-27d433a22537;
	Fri, 30 Oct 2020 22:22:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fKlVj/S20e6bGjvptSwfdUU67vsduP/Us1d/jk3YVA4=; b=yIJ7ZMP9cHCDW9t6hR/gqEvEqh
	sYhzBwebNtoGKHGqB+iMDAn7jWnA8AbS/PfMlCeguRN5e6OaaDUkODhSSWO88RI3Ere7spivygSXC
	XRVHl37HONrWlhV8cZ3I5tZDa/pIW5pNlkeb6cmdTDT5w4o34pbXQ85COujtqK8GO26w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnE-00051B-Jf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnE-0003zf-Im
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/amend: Check whether the node exists
Message-Id: <E1kYcnE-0003zf-Im@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:44 +0000

commit 984c36781404592a6fbaa31ec6d25d6b8f933489
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Fri Jul 10 11:50:37 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 12:37:25 2020 +0200

    block/amend: Check whether the node exists
    
    We should check whether the user-specified node-name actually refers to
    a node.  The simplest way to do that is to use bdrv_lookup_bs() instead
    of bdrv_find_node() (the former wraps the latter, and produces an error
    message if necessary).
    
    Reported-by: Coverity (CID 1430268)
    Fixes: ced914d0ab9fb2c900f873f6349a0b8eecd1fdbe
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200710095037.10885-1-mreitz@redhat.com>
    Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 block/amend.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/amend.c b/block/amend.c
index f4612dcf08..392df9ef83 100644
--- a/block/amend.c
+++ b/block/amend.c
@@ -69,8 +69,12 @@ void qmp_x_blockdev_amend(const char *job_id,
     BlockdevAmendJob *s;
     const char *fmt = BlockdevDriver_str(options->driver);
     BlockDriver *drv = bdrv_find_format(fmt);
-    BlockDriverState *bs = bdrv_find_node(node_name);
+    BlockDriverState *bs;
 
+    bs = bdrv_lookup_bs(NULL, node_name, errp);
+    if (!bs) {
+        return;
+    }
 
     if (!drv) {
         error_setg(errp, "Block driver '%s' not found or not supported", fmt);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:22:57 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:22:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16592.41030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnR-00030P-Dw; Fri, 30 Oct 2020 22:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16592.41030; Fri, 30 Oct 2020 22:22:57 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnR-00030H-A4; Fri, 30 Oct 2020 22:22:57 +0000
Received: by outflank-mailman (input) for mailman id 16592;
 Fri, 30 Oct 2020 22:22:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcnP-0002zL-M8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a63b571b-d53b-4bd4-811f-174b0696d45b;
 Fri, 30 Oct 2020 22:22:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnO-00051I-ND
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnO-00040M-MP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcnP-0002zL-M8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:55 +0000
X-Inumbo-ID: a63b571b-d53b-4bd4-811f-174b0696d45b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a63b571b-d53b-4bd4-811f-174b0696d45b;
	Fri, 30 Oct 2020 22:22:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8w5o4foSPfq6EArccvEnf8sqc+8om06JoMnLlD+7uRk=; b=D6rav0b3WyHEaD3dDlJ8KExRkT
	MRUW563X7dxiqpmBDffVNy65WW4wzmXyG7hK6gjyg6o3hMwus79fisLSKTQ5Joi4agAEL2aemrqG5
	3DBMnrizJQ7LP7AW7OkE5hz5ovBhSpQebQDNk8ls5tiZ6BVypJvGdrpJLSsHJpjRLAGE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnO-00051I-ND
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnO-00040M-MP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:22:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Select a default machine for the rx and avr targets
Message-Id: <E1kYcnO-00040M-MP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:22:54 +0000

commit 733dafe4914ef2e6d6a9d546b7fdbb429f3590e7
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 18:19:08 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 12:37:25 2020 +0200

    iotests: Select a default machine for the rx and avr targets
    
    If you are building only with either the new rx-softmmu or avr-softmmu
    target, "make check-block" fails a couple of tests since there is no
    default machine defined in these new targets. We have to select a machine
    in the "check" script for these, just like we already do for the arm- and
    tricore-softmmu targets.
    
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20200722161908.25383-1-thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/check | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e0d8049012..0657f7286c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -595,15 +595,19 @@ then
 fi
 export QEMU_PROG="$(type -p "$QEMU_PROG")"
 
+export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
 case "$QEMU_PROG" in
     *qemu-system-arm|*qemu-system-aarch64)
-        export QEMU_OPTIONS="-nodefaults -display none -machine virt -accel qtest"
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine virt"
         ;;
-    *qemu-system-tricore)
-        export QEMU_OPTIONS="-nodefaults -display none -machine tricore_testboard -accel qtest"
+    *qemu-system-avr)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine mega2560"
+        ;;
+    *qemu-system-rx)
+        export QEMU_OPTIONS="$QEMU_OPTIONS -machine gdbsim-r5f562n8"
         ;;
-    *)
-        export QEMU_OPTIONS="-nodefaults -display none -accel qtest"
+    *qemu-system-tricore)
+        export QEMU_OPTIONS="-$QEMU_OPTIONS -machine tricore_testboard"
         ;;
 esac
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:23:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:23:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16593.41034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnb-00032R-Ef; Fri, 30 Oct 2020 22:23:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16593.41034; Fri, 30 Oct 2020 22:23:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnb-00032J-Bf; Fri, 30 Oct 2020 22:23:07 +0000
Received: by outflank-mailman (input) for mailman id 16593;
 Fri, 30 Oct 2020 22:23:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcnZ-000328-SQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 555999d5-6f46-4848-962f-929487fb9543;
 Fri, 30 Oct 2020 22:23:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnY-00051g-Qs
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnY-00041T-Py
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcnZ-000328-SQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:05 +0000
X-Inumbo-ID: 555999d5-6f46-4848-962f-929487fb9543
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 555999d5-6f46-4848-962f-929487fb9543;
	Fri, 30 Oct 2020 22:23:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HSXvr4QoDyWG0ot3dHNLa0R+xsL0wNlV/KeanYdn7b0=; b=u9DWP4pd/uw9hCVLIB9mdii/5a
	Nh1IffhBLs7q/IgTBr8a/BndG8wQG3ut175+HF0EtW8+H/E5Al6KFjtJwyNfAVNECEKasB2v2s96O
	SQL701RFgBpxcfdyyucxsKdFK6IkbaC4QK2xTdvocaqecPShVY6M/1X404Wwzq8X2t2k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnY-00051g-Qs
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnY-00041T-Py
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/197: Fix for compat=0.10
Message-Id: <E1kYcnY-00041T-Py@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:04 +0000

commit 1855536256eb0a5708b04b85f744de69559ea323
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Mon Jul 27 15:52:37 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Mon Jul 27 16:35:17 2020 +0200

    iotests/197: Fix for compat=0.10
    
    Writing zeroes to a qcow2 v2 images without a backing file results in an
    unallocated cluster as of 61b3043965.  197 has a test for COR-ing a
    cluster on an image without a backing file, which means that the data
    will be zero, so now on a v2 image that cluster will just stay
    unallocated, and so the test fails.  Just force compat=1.1 for that
    particular case to enforce the cluster to get allocated.
    
    Fixes: 61b3043965fe3552ee2684a97e7cc809ca7a71b3
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200727135237.1096841-1-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/197 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index 95f05b0e34..121959a09c 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -112,7 +112,9 @@ echo
 echo '=== Partial final cluster ==='
 echo
 
-_make_test_img 1024
+# Force compat=1.1, because writing zeroes on a v2 image without a
+# backing file would just result in an unallocated cluster
+_make_test_img -o compat=1.1 1024
 $QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
 $QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
 _check_test_img
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:23:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:23:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16594.41038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnl-00039c-GE; Fri, 30 Oct 2020 22:23:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16594.41038; Fri, 30 Oct 2020 22:23:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnl-00039V-DD; Fri, 30 Oct 2020 22:23:17 +0000
Received: by outflank-mailman (input) for mailman id 16594;
 Fri, 30 Oct 2020 22:23:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcnj-00034g-LV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 55123b24-fd47-46e1-969d-bdeb1dd9ba69;
 Fri, 30 Oct 2020 22:23:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcni-00051q-UO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcni-00042E-TZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcnj-00034g-LV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:15 +0000
X-Inumbo-ID: 55123b24-fd47-46e1-969d-bdeb1dd9ba69
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 55123b24-fd47-46e1-969d-bdeb1dd9ba69;
	Fri, 30 Oct 2020 22:23:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y+RO4nt6mYNmH8mXWh2s7Zgvyjkz5uJ5Lr5vHqeFLzw=; b=21t+eF+huniDhF3dwIzXsR7iOi
	0+WkQ+gL/PUAXPH7QV5knYdFrSdX+0iKumW3Y8euLeED0keXwuK82gf6dxYpP2ySAJhlGoqki8Rsf
	bhnRHH7rPj70cxUn81dI8TXysAjxLy70wLjGKmoaPWW5G3T4f1KZcqboOYVgGWkA0MSs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcni-00051q-UO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcni-00042E-TZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-27' into staging
Message-Id: <E1kYcni-00042E-TZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:14 +0000

commit 23ae28783f4674e98f7539d1c05d793166c2fc12
Merge: 93ea484375ab473379dd9c836261ef484bd71ab1 1855536256eb0a5708b04b85f744de69559ea323
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 09:15:44 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 09:15:44 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-27' into staging
    
    Block patches for 5.1:
    - Coverity fix
    - iotests fix for rx and avr
    - iotests fix for qcow2 -o compat=0.10
    
    # gpg: Signature made Mon 27 Jul 2020 15:36:23 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-27:
      iotests/197: Fix for compat=0.10
      iotests: Select a default machine for the rx and avr targets
      block/amend: Check whether the node exists
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/amend.c            |  6 +++++-
 tests/qemu-iotests/197   |  4 +++-
 tests/qemu-iotests/check | 14 +++++++++-----
 3 files changed, 17 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:23:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16595.41042 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnv-0003DW-J5; Fri, 30 Oct 2020 22:23:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16595.41042; Fri, 30 Oct 2020 22:23:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcnv-0003DO-G0; Fri, 30 Oct 2020 22:23:27 +0000
Received: by outflank-mailman (input) for mailman id 16595;
 Fri, 30 Oct 2020 22:23:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcnu-0003DC-EA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2fa9789d-bb90-4581-9d0d-3166d24a8e22;
 Fri, 30 Oct 2020 22:23:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnt-00051y-8x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcnt-00043E-8A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcnu-0003DC-EA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:26 +0000
X-Inumbo-ID: 2fa9789d-bb90-4581-9d0d-3166d24a8e22
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2fa9789d-bb90-4581-9d0d-3166d24a8e22;
	Fri, 30 Oct 2020 22:23:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2toTv1jOsjQUjr/RjZMj6J2AGOVsdseLztPBIgSoRxA=; b=MbUdccApfHhqJHbCk2cG9+L4OZ
	N0RaZq7kG1MulwSlgSHLmIJPC4OnarA1TegXXOHBquCdiBjyzs3JqiFGpr/vsTB51+CuTueSX4RTZ
	SYYPCxiMybb0lwa2svYbWTsaPNuSqswWK1DeT0eAwn7IcIk4SstIDzt3IoM11HuVBIC0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnt-00051y-8x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcnt-00043E-8A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update OpenBIOS images to 7f28286f built from submodule.
Message-Id: <E1kYcnt-00043E-8A@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:25 +0000

commit 54414d0fb11314ede939ec80238787c5b2079f4e
Author:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
AuthorDate: Mon Jul 27 09:15:42 2020 +0100
Commit:     Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CommitDate: Mon Jul 27 16:08:24 2020 +0100

    Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Cc: qemu-stable@nongnu.org
---
 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc
index a07757a987..def6d4cf63 100644
Binary files a/pc-bios/openbios-ppc and b/pc-bios/openbios-ppc differ
diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32
index 2faaab83ba..67b8b83d98 100644
Binary files a/pc-bios/openbios-sparc32 and b/pc-bios/openbios-sparc32 differ
diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64
index dd7eeeeab4..dfa1f10bbc 100644
Binary files a/pc-bios/openbios-sparc64 and b/pc-bios/openbios-sparc64 differ
diff --git a/roms/openbios b/roms/openbios
index 75fbb41d28..7f28286f5c 160000
--- a/roms/openbios
+++ b/roms/openbios
@@ -1 +1 @@
-Subproject commit 75fbb41d2857d93208c74a8e0228b29fd7bf04c0
+Subproject commit 7f28286f5cb1ca682e3ba0a8706d8884f12bc49e
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:23:37 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:23:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16596.41046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYco5-0003Ei-Kn; Fri, 30 Oct 2020 22:23:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16596.41046; Fri, 30 Oct 2020 22:23:37 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYco5-0003Eb-Hd; Fri, 30 Oct 2020 22:23:37 +0000
Received: by outflank-mailman (input) for mailman id 16596;
 Fri, 30 Oct 2020 22:23:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYco4-0003ES-7K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id feb53b45-c443-490a-94a7-83336c4ddaef;
 Fri, 30 Oct 2020 22:23:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYco3-000524-D0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYco3-00043y-CE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYco4-0003ES-7K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:36 +0000
X-Inumbo-ID: feb53b45-c443-490a-94a7-83336c4ddaef
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id feb53b45-c443-490a-94a7-83336c4ddaef;
	Fri, 30 Oct 2020 22:23:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MQRzTVqS3v+WBg35cG7FvPUNsMQLq6ANxnygh04cC6o=; b=P8SCnPhVWIuiTYSXFUXd7/wLqk
	JMHwr7MG4AFVOSMecEmMOVlMS4ZGYnQDFalGCjiU3LgZiMhFDsY+crCF+9kn2PDSJRKbph/fn9hh+
	W7VnYSwoik6EoRUMZldyZIiSHhDzvuzCqFoqic+qGBs9sB8TPE2IgyQLlE4p73Ii1NHc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYco3-000524-D0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYco3-00043y-CE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200727' into staging
Message-Id: <E1kYco3-00043y-CE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:35 +0000

commit 1b242c3b1ec7c6011901b4f3b4b0876e31746afb
Merge: 23ae28783f4674e98f7539d1c05d793166c2fc12 54414d0fb11314ede939ec80238787c5b2079f4e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 13:46:31 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 13:46:31 2020 +0100

    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20200727' into staging
    
    qemu-openbios queue
    
    # gpg: Signature made Mon 27 Jul 2020 16:09:34 BST
    # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
    # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
    # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
    # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
    
    * remotes/mcayland/tags/qemu-openbios-20200727:
      Update OpenBIOS images to 7f28286f built from submodule.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/openbios-ppc     | Bin 696912 -> 696912 bytes
 pc-bios/openbios-sparc32 | Bin 382048 -> 382048 bytes
 pc-bios/openbios-sparc64 | Bin 1593408 -> 1593408 bytes
 roms/openbios            |   2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:23:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:23:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16597.41050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoG-0003GW-MF; Fri, 30 Oct 2020 22:23:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16597.41050; Fri, 30 Oct 2020 22:23:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoG-0003GO-JN; Fri, 30 Oct 2020 22:23:48 +0000
Received: by outflank-mailman (input) for mailman id 16597;
 Fri, 30 Oct 2020 22:23:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcoF-0003GE-9n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b9fadc9d-1277-4c49-98b6-f3de67814831;
 Fri, 30 Oct 2020 22:23:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoE-00052v-3D
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoE-00047d-2K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcoF-0003GE-9n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:47 +0000
X-Inumbo-ID: b9fadc9d-1277-4c49-98b6-f3de67814831
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b9fadc9d-1277-4c49-98b6-f3de67814831;
	Fri, 30 Oct 2020 22:23:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mV325yLu8Tv7X/R/PNYZuIYhNedDiQNyIRZErJtKC7g=; b=yiJx62dKFpmg1XeW7jwkDSGJE3
	ewJuMZThXWIrqgGO00AWpjB4vezAtMM/B129ZC8JH+8j+8mH2q5RAkWMdVyh/0JHZzmr9e0zjy3Py
	1PE7sXTNLrw3Xcwn4B3tpFwTlUJv+nkkIf/qDJ+fXQpX2PyoUlzHQOqX3jTEd0wFHy+4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoE-00052v-3D
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoE-00047d-2K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow2: Fix capitalization of header extension constant.
Message-Id: <E1kYcoE-00047d-2K@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:46 +0000

commit 8098969cf2f0acb794b69bd63ee90c9173b6122c
Author:     Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
AuthorDate: Fri Jul 17 11:14:49 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qcow2: Fix capitalization of header extension constant.
    
    Make the capitalization of the hexadecimal numbers consistent for the
    QCOW2 header extension constants in docs/interop/qcow2.txt.
    
    Suggested-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <1594973699-781898-2-git-send-email-andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2.c          | 2 +-
 docs/interop/qcow2.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index fadf3422f8..6ad6bdc166 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -66,7 +66,7 @@ typedef struct {
 } QEMU_PACKED QCowExtension;
 
 #define  QCOW2_EXT_MAGIC_END 0
-#define  QCOW2_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA
+#define  QCOW2_EXT_MAGIC_BACKING_FORMAT 0xe2792aca
 #define  QCOW2_EXT_MAGIC_FEATURE_TABLE 0x6803f857
 #define  QCOW2_EXT_MAGIC_CRYPTO_HEADER 0x0537be77
 #define  QCOW2_EXT_MAGIC_BITMAPS 0x23852875
diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
index cb723463f2..f072e27900 100644
--- a/docs/interop/qcow2.txt
+++ b/docs/interop/qcow2.txt
@@ -231,7 +231,7 @@ be stored. Each extension has a structure like the following:
 
     Byte  0 -  3:   Header extension type:
                         0x00000000 - End of the header extension area
-                        0xE2792ACA - Backing file format name string
+                        0xe2792aca - Backing file format name string
                         0x6803f857 - Feature name table
                         0x23852875 - Bitmaps extension
                         0x0537be77 - Full disk encryption header pointer
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16598.41054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoQ-0003Hi-OB; Fri, 30 Oct 2020 22:23:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16598.41054; Fri, 30 Oct 2020 22:23:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoQ-0003HY-Kt; Fri, 30 Oct 2020 22:23:58 +0000
Received: by outflank-mailman (input) for mailman id 16598;
 Fri, 30 Oct 2020 22:23:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcoP-0003HQ-1Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c74e45c3-4de1-467c-8f39-4e5bd39f1f87;
 Fri, 30 Oct 2020 22:23:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoO-00053G-6j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoO-00048C-5y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcoP-0003HQ-1Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:57 +0000
X-Inumbo-ID: c74e45c3-4de1-467c-8f39-4e5bd39f1f87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c74e45c3-4de1-467c-8f39-4e5bd39f1f87;
	Fri, 30 Oct 2020 22:23:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QNbP1Qmx34zAZjHGv02oDwhvfmxEwFsyjpPNtx3pD8k=; b=QxPp/9+WZYLQjaZvkLP7Vn1jm5
	xrwTDX/ubt+LJxMXdMyLRLfuBXxxkppjW1Ko/PtQvcU42kF8UBpiMoV8Ol/cguvhfb8tTae/n0zrh
	9jcdsw/cDyzaiU4djA9SKPfkJpBZhPtIzTceNgpsR3TpMcvPPOZLEXxsNFNPcxWmRoSc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoO-00053G-6j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoO-00048C-5y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:23:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: fix style
Message-Id: <E1kYcoO-00048C-5y@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:23:56 +0000

commit 8243219fa565d7285b520cba0f1579744ae0b3e9
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:16 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: fix style
    
    Mostly, satisfy pep8 complaints.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-2-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 40774eed74..de9ba8d94c 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -28,8 +28,8 @@ disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
-class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
+class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
         self.vm_a.shutdown()
         self.vm_b.shutdown()
@@ -54,7 +54,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                name='bitmap', granularity=granularity)
-        self.assert_qmp(result, 'return', {});
+        self.assert_qmp(result, 'return', {})
 
         s = 0
         while s < write_size:
@@ -71,7 +71,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
-        self.assert_qmp(result, 'return', {});
+        self.assert_qmp(result, 'return', {})
         s = 0
         while s < write_size:
             self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
@@ -104,15 +104,16 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
-        result = self.vm_b.qmp('query-block');
+        result = self.vm_b.qmp('query-block')
         while len(result['return'][0]['dirty-bitmaps']) > 1:
             time.sleep(2)
-            result = self.vm_b.qmp('query-block');
+            result = self.vm_b.qmp('query-block')
 
         result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
 
-        self.assert_qmp(result, 'return/sha256', sha256);
+        self.assert_qmp(result, 'return/sha256', sha256)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:08 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16599.41057 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoa-0003Iw-PL; Fri, 30 Oct 2020 22:24:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16599.41057; Fri, 30 Oct 2020 22:24:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcoa-0003Io-MX; Fri, 30 Oct 2020 22:24:08 +0000
Received: by outflank-mailman (input) for mailman id 16599;
 Fri, 30 Oct 2020 22:24:07 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcoZ-0003Ig-7h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 07ee5352-14f8-4ae5-90fe-ea37df282657;
 Fri, 30 Oct 2020 22:24:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoY-00053e-AR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoY-000498-9Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcoZ-0003Ig-7h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:07 +0000
X-Inumbo-ID: 07ee5352-14f8-4ae5-90fe-ea37df282657
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 07ee5352-14f8-4ae5-90fe-ea37df282657;
	Fri, 30 Oct 2020 22:24:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BqzBn/aGWOdGagmFfCMjl9e3arx9htAlgC5jw/Q0QPI=; b=ksdBdMHnpguIuSNunMTC0ukyH7
	P3ODWpXxs8HdxGq0U/Vko9guysRiNcPDS0Pw8zSq6O3FpXpFUl8+HYv3dyj+Q/4Jw2w9NVB91qFub
	jlCJKMOWxZfgz3+ivTSBmlpUa0FQeV8wd42y7Q2duUmzEcKMcgqPnYn59NC4VWWIy7zo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoY-00053e-AR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoY-000498-9Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: drop extra constraints
Message-Id: <E1kYcoY-000498-9Q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:06 +0000

commit f3f483ac6310f26bd17ce5518cba14730a4d0546
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:17 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: drop extra constraints
    
    We don't need any specific format constraints here. Still keep qcow2
    for two reasons:
    1. No extra calls of format-unrelated test
    2. Add some check around persistent bitmap in future (require qcow2)
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-3-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index de9ba8d94c..dda918450a 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -116,5 +116,4 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
 
 if __name__ == '__main__':
-    iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
-                 supported_protocols=['file'])
+    iotests.main(supported_fmts=['qcow2'])
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16600.41061 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcok-0003KD-R1; Fri, 30 Oct 2020 22:24:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16600.41061; Fri, 30 Oct 2020 22:24:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcok-0003K5-O1; Fri, 30 Oct 2020 22:24:18 +0000
Received: by outflank-mailman (input) for mailman id 16600;
 Fri, 30 Oct 2020 22:24:17 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcoj-0003Js-F9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:17 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7022edd2-830a-4d2d-a361-4330d65f7d93;
 Fri, 30 Oct 2020 22:24:16 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoi-00053m-E6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcoi-00049m-DK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcoj-0003Js-F9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:17 +0000
X-Inumbo-ID: 7022edd2-830a-4d2d-a361-4330d65f7d93
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7022edd2-830a-4d2d-a361-4330d65f7d93;
	Fri, 30 Oct 2020 22:24:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6+0OTCpjZpGJrg21lPC/Z+04Be4YBm6Oooxj+YlyNrM=; b=AYMYKSdUbkgTTnesm4a7PHcnvB
	FTDLC+EPUUeBodV0zbmm8uWFjaTJrKqfTMYhYnV98CPcuYZ4jhQg203Q9U/4NnWwi2E5XAHgrUtt2
	rpgi9j8YHUYdI8oVZIsH4azLoYV/6xpeKd5YfbTx2izW2ssekHCFjyPOL/SVI+7p44xs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoi-00053m-E6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcoi-00049m-DK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: better catch postcopy time
Message-Id: <E1kYcoi-00049m-DK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:16 +0000

commit 09feea6cf528b3158640d6530174cf21cb579bc0
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:18 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:58 2020 -0500

    qemu-iotests/199: better catch postcopy time
    
    The test aims to test _postcopy_ migration, and wants to do some write
    operations during postcopy time.
    
    Test considers migrate status=complete event on source as start of
    postcopy. This is completely wrong, completion is completion of the
    whole migration process. Let's instead consider destination start as
    start of postcopy, and use RESUME event for it.
    
    Next, as migration finish, let's use migration status=complete event on
    target, as such method is closer to what libvirt or another user will
    do, than tracking number of dirty-bitmaps.
    
    Finally, add a possibility to dump events for debug. And if
    set debug to True, we see, that actual postcopy period is very small
    relatively to the whole test duration time (~0.2 seconds to >40 seconds
    for me). This means, that test is very inefficient in what it supposed
    to do. Let's improve it in following commits.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-4-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 72 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 57 insertions(+), 15 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index dda918450a..dd6044768c 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -20,17 +20,43 @@
 
 import os
 import iotests
-import time
 from iotests import qemu_img
 
+debug = False
+
 disk_a = os.path.join(iotests.test_dir, 'disk_a')
 disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
 
+def event_seconds(event):
+    return event['timestamp']['seconds'] + \
+        event['timestamp']['microseconds'] / 1000000.0
+
+
+def event_dist(e1, e2):
+    return event_seconds(e2) - event_seconds(e1)
+
+
 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
+        if debug:
+            self.vm_a_events += self.vm_a.get_qmp_events()
+            self.vm_b_events += self.vm_b.get_qmp_events()
+            for e in self.vm_a_events:
+                e['vm'] = 'SRC'
+            for e in self.vm_b_events:
+                e['vm'] = 'DST'
+            events = (self.vm_a_events + self.vm_b_events)
+            events = [(e['timestamp']['seconds'],
+                       e['timestamp']['microseconds'],
+                       e['vm'],
+                       e['event'],
+                       e.get('data', '')) for e in events]
+            for e in sorted(events):
+                print('{}.{:06} {} {} {}'.format(*e))
+
         self.vm_a.shutdown()
         self.vm_b.shutdown()
         os.remove(disk_a)
@@ -47,6 +73,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         self.vm_b.launch()
 
+        # collect received events for debug
+        self.vm_a_events = []
+        self.vm_b_events = []
+
     def test_postcopy(self):
         write_size = 0x40000000
         granularity = 512
@@ -77,15 +107,13 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
-        bitmaps_cap = {'capability': 'dirty-bitmaps', 'state': True}
-        events_cap = {'capability': 'events', 'state': True}
+        caps = [{'capability': 'dirty-bitmaps', 'state': True},
+                {'capability': 'events', 'state': True}]
 
-        result = self.vm_a.qmp('migrate-set-capabilities',
-                               capabilities=[bitmaps_cap, events_cap])
+        result = self.vm_a.qmp('migrate-set-capabilities', capabilities=caps)
         self.assert_qmp(result, 'return', {})
 
-        result = self.vm_b.qmp('migrate-set-capabilities',
-                               capabilities=[bitmaps_cap])
+        result = self.vm_b.qmp('migrate-set-capabilities', capabilities=caps)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('migrate', uri='exec:cat>' + fifo)
@@ -94,24 +122,38 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         result = self.vm_a.qmp('migrate-start-postcopy')
         self.assert_qmp(result, 'return', {})
 
-        while True:
-            event = self.vm_a.event_wait('MIGRATION')
-            if event['data']['status'] == 'completed':
-                break
+        event_resume = self.vm_b.event_wait('RESUME')
+        self.vm_b_events.append(event_resume)
 
         s = 0x8000
         while s < write_size:
             self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
             s += 0x10000
 
+        match = {'data': {'status': 'completed'}}
+        event_complete = self.vm_b.event_wait('MIGRATION', match=match)
+        self.vm_b_events.append(event_complete)
+
+        # take queued event, should already been happened
+        event_stop = self.vm_a.event_wait('STOP')
+        self.vm_a_events.append(event_stop)
+
+        downtime = event_dist(event_stop, event_resume)
+        postcopy_time = event_dist(event_resume, event_complete)
+
+        # TODO: assert downtime * 10 < postcopy_time
+        if debug:
+            print('downtime:', downtime)
+            print('postcopy_time:', postcopy_time)
+
+        # Assert that bitmap migration is finished (check that successor bitmap
+        # is removed)
         result = self.vm_b.qmp('query-block')
-        while len(result['return'][0]['dirty-bitmaps']) > 1:
-            time.sleep(2)
-            result = self.vm_b.qmp('query-block')
+        assert len(result['return'][0]['dirty-bitmaps']) == 1
 
+        # Check content of migrated (and updated by new writes) bitmap
         result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
-
         self.assert_qmp(result, 'return/sha256', sha256)
 
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16601.41065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcov-0003LZ-SV; Fri, 30 Oct 2020 22:24:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16601.41065; Fri, 30 Oct 2020 22:24:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcov-0003LR-PW; Fri, 30 Oct 2020 22:24:29 +0000
Received: by outflank-mailman (input) for mailman id 16601;
 Fri, 30 Oct 2020 22:24:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcou-0003LD-1v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f3b9eff8-38aa-4a1b-bd57-3674d6ecf17d;
 Fri, 30 Oct 2020 22:24:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcos-00053v-I2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcos-0004AO-Gq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:26 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcou-0003LD-1v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:28 +0000
X-Inumbo-ID: f3b9eff8-38aa-4a1b-bd57-3674d6ecf17d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f3b9eff8-38aa-4a1b-bd57-3674d6ecf17d;
	Fri, 30 Oct 2020 22:24:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LP4FlTf9ODacdZEHs+0QFf6y9Uv/TngIzMZn+fAjsR4=; b=IeB35R35buOkPgro5qMCkR52qB
	79vHtOsaACZCYxX8mff0UESdhche+K+KLgQYsc9L/OpKaur8143hMITBJLp2/JL7XoUQ0pjF/7a+0
	wSf2lfugQnStNKPFBcW+q2NQlE45l3OazWfpSVJpwMh/Y2nXQ2gv3eUT0185EtnOjPxc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcos-00053v-I2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:26 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcos-0004AO-Gq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:26 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: improve performance: set bitmap by discard
Message-Id: <E1kYcos-0004AO-Gq@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:26 +0000

commit edb90bbdf33f6e96788b454fae9abfed18274692
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:19 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: improve performance: set bitmap by discard
    
    Discard dirties dirty-bitmap as well as write, but works faster. Let's
    use it instead.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index dd6044768c..190e820b84 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -67,8 +67,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         os.mkfifo(fifo)
         qemu_img('create', '-f', iotests.imgfmt, disk_a, size)
         qemu_img('create', '-f', iotests.imgfmt, disk_b, size)
-        self.vm_a = iotests.VM(path_suffix='a').add_drive(disk_a)
-        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_a = iotests.VM(path_suffix='a').add_drive(disk_a,
+                                                          'discard=unmap')
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b,
+                                                          'discard=unmap')
         self.vm_b.add_incoming("exec: cat '" + fifo + "'")
         self.vm_a.launch()
         self.vm_b.launch()
@@ -78,7 +80,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events = []
 
     def test_postcopy(self):
-        write_size = 0x40000000
+        discard_size = 0x40000000
         granularity = 512
         chunk = 4096
 
@@ -86,25 +88,32 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
                                name='bitmap', granularity=granularity)
         self.assert_qmp(result, 'return', {})
 
+        result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
+                               node='drive0', name='bitmap')
+        empty_sha256 = result['return']['sha256']
+
         s = 0
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
         s = 0x8000
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
         sha256 = result['return']['sha256']
 
+        # Check, that updating the bitmap by discards works
+        assert sha256 != empty_sha256
+
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
         self.assert_qmp(result, 'return', {})
         s = 0
-        while s < write_size:
-            self.vm_a.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
@@ -126,8 +135,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events.append(event_resume)
 
         s = 0x8000
-        while s < write_size:
-            self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk))
+        while s < discard_size:
+            self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
             s += 0x10000
 
         match = {'data': {'status': 'completed'}}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16602.41070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcp4-0003Mw-Uz; Fri, 30 Oct 2020 22:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16602.41070; Fri, 30 Oct 2020 22:24:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcp4-0003Mo-SA; Fri, 30 Oct 2020 22:24:38 +0000
Received: by outflank-mailman (input) for mailman id 16602;
 Fri, 30 Oct 2020 22:24:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcp3-0003Mg-Kc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:37 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d35edd6f-4e6b-4aab-86f0-af3d6806aabe;
 Fri, 30 Oct 2020 22:24:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcp2-000542-M9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcp2-0004B2-Kk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:36 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcp3-0003Mg-Kc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:37 +0000
X-Inumbo-ID: d35edd6f-4e6b-4aab-86f0-af3d6806aabe
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d35edd6f-4e6b-4aab-86f0-af3d6806aabe;
	Fri, 30 Oct 2020 22:24:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ymVCyYrrrI0YJjQdARKSrH5J8tyKKGWZKubLVewODtw=; b=WGa+GvzzcwTNvXgfcphTamzRID
	HR8J/+Glvr7tUKAQAD3A37wHvBqJ1J2RFdLgjGg9xwtc7vamRNs2RNVky0s1zRRtkLcUXpCcQed2k
	MYxV35E3kqcC2fnpdgak7gFdIQnFn24SmfUdv1oWlO3zWfrIxHqu1ordCpu50DugczXE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcp2-000542-M9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:36 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcp2-0004B2-Kk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:36 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: change discard patterns
Message-Id: <E1kYcp2-0004B2-Kk@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:36 +0000

commit 31e382791352ed1f6fa2894f84286d0d4ee28e4f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:20 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: change discard patterns
    
    iotest 199 works too long because of many discard operations. At the
    same time, postcopy period is very short, in spite of all these
    efforts.
    
    So, let's use less discards (and with more interesting patterns) to
    reduce test timing. In the next commit we'll increase postcopy period.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-6-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 44 ++++++++++++++++++++++++++------------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 190e820b84..da4dae01fb 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -30,6 +30,28 @@ size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
 
+GiB = 1024 * 1024 * 1024
+
+discards1 = (
+    (0, GiB),
+    (2 * GiB + 512 * 5, 512),
+    (3 * GiB + 512 * 5, 512),
+    (100 * GiB, GiB)
+)
+
+discards2 = (
+    (3 * GiB + 512 * 8, 512),
+    (4 * GiB + 512 * 8, 512),
+    (50 * GiB, GiB),
+    (100 * GiB + GiB // 2, GiB)
+)
+
+
+def apply_discards(vm, discards):
+    for d in discards:
+        vm.hmp_qemu_io('drive0', 'discard {} {}'.format(*d))
+
+
 def event_seconds(event):
     return event['timestamp']['seconds'] + \
         event['timestamp']['microseconds'] / 1000000.0
@@ -80,9 +102,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_b_events = []
 
     def test_postcopy(self):
-        discard_size = 0x40000000
         granularity = 512
-        chunk = 4096
 
         result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                name='bitmap', granularity=granularity)
@@ -92,14 +112,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
                                node='drive0', name='bitmap')
         empty_sha256 = result['return']['sha256']
 
-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
-        s = 0x8000
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_a, discards1 + discards2)
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap')
@@ -111,10 +124,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
                                name='bitmap')
         self.assert_qmp(result, 'return', {})
-        s = 0
-        while s < discard_size:
-            self.vm_a.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+
+        apply_discards(self.vm_a, discards1)
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
                 {'capability': 'events', 'state': True}]
@@ -134,10 +145,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
 
-        s = 0x8000
-        while s < discard_size:
-            self.vm_b.hmp_qemu_io('drive0', 'discard %d %d' % (s, chunk))
-            s += 0x10000
+        apply_discards(self.vm_b, discards2)
 
         match = {'data': {'status': 'completed'}}
         event_complete = self.vm_b.event_wait('MIGRATION', match=match)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16603.41074 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpF-0003Os-0W; Fri, 30 Oct 2020 22:24:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16603.41074; Fri, 30 Oct 2020 22:24:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpE-0003Ok-Tf; Fri, 30 Oct 2020 22:24:48 +0000
Received: by outflank-mailman (input) for mailman id 16603;
 Fri, 30 Oct 2020 22:24:47 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcpD-0003Oa-OG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d87cce9e-3db0-4b9b-b5ae-9dc5f89efcf0;
 Fri, 30 Oct 2020 22:24:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpC-00054d-Ps
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpC-0004Bn-P1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:46 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcpD-0003Oa-OG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:47 +0000
X-Inumbo-ID: d87cce9e-3db0-4b9b-b5ae-9dc5f89efcf0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d87cce9e-3db0-4b9b-b5ae-9dc5f89efcf0;
	Fri, 30 Oct 2020 22:24:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xWctCDYoiWz4CjXH7H7K51WXoOxxYwTyh06RMLp9TVI=; b=1VUZBm+rwWRw3zuxzd8hPKHfnF
	hymfuOHpsnWPYW0AnJUlR0qV4blHcTDZ+YU6lKmlpZM/Itbuv5xdw3vkudeD1tVSHi8NL2p2HcExH
	/8vNnL1VjJrr20Znf6wk54QgRs8kcdwAXHB5JSQ3DxjvM528v541I4qR7Ht5DyBfzQhA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpC-00054d-Ps
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpC-0004Bn-P1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: increase postcopy period
Message-Id: <E1kYcpC-0004Bn-P1@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:46 +0000

commit e80a4150a54d69a56e31de2c96e7655109e4c60a
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:21 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    qemu-iotests/199: increase postcopy period
    
    The test wants to force a bitmap postcopy. Still, the resulting
    postcopy period is very small. Let's increase it by adding more
    bitmaps to migrate. Also, test disabled bitmaps migration.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-7-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 58 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 19 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index da4dae01fb..d8532e49da 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -103,29 +103,45 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
     def test_postcopy(self):
         granularity = 512
+        nb_bitmaps = 15
 
-        result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
-                               name='bitmap', granularity=granularity)
-        self.assert_qmp(result, 'return', {})
+        for i in range(nb_bitmaps):
+            result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
+                                   name='bitmap{}'.format(i),
+                                   granularity=granularity)
+            self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
+                               node='drive0', name='bitmap0')
         empty_sha256 = result['return']['sha256']
 
-        apply_discards(self.vm_a, discards1 + discards2)
+        apply_discards(self.vm_a, discards1)
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
-        sha256 = result['return']['sha256']
+                               node='drive0', name='bitmap0')
+        discards1_sha256 = result['return']['sha256']
 
         # Check, that updating the bitmap by discards works
-        assert sha256 != empty_sha256
+        assert discards1_sha256 != empty_sha256
 
-        result = self.vm_a.qmp('block-dirty-bitmap-clear', node='drive0',
-                               name='bitmap')
-        self.assert_qmp(result, 'return', {})
+        # We want to calculate resulting sha256. Do it in bitmap0, so, disable
+        # other bitmaps
+        for i in range(1, nb_bitmaps):
+            result = self.vm_a.qmp('block-dirty-bitmap-disable', node='drive0',
+                                   name='bitmap{}'.format(i))
+            self.assert_qmp(result, 'return', {})
 
-        apply_discards(self.vm_a, discards1)
+        apply_discards(self.vm_a, discards2)
+
+        result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
+                               node='drive0', name='bitmap0')
+        all_discards_sha256 = result['return']['sha256']
+
+        # Now, enable some bitmaps, to be updated during migration
+        for i in range(2, nb_bitmaps, 2):
+            result = self.vm_a.qmp('block-dirty-bitmap-enable', node='drive0',
+                                   name='bitmap{}'.format(i))
+            self.assert_qmp(result, 'return', {})
 
         caps = [{'capability': 'dirty-bitmaps', 'state': True},
                 {'capability': 'events', 'state': True}]
@@ -145,6 +161,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
 
+        # enabled bitmaps should be updated
         apply_discards(self.vm_b, discards2)
 
         match = {'data': {'status': 'completed'}}
@@ -158,7 +175,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         downtime = event_dist(event_stop, event_resume)
         postcopy_time = event_dist(event_resume, event_complete)
 
-        # TODO: assert downtime * 10 < postcopy_time
+        assert downtime * 10 < postcopy_time
         if debug:
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
@@ -166,12 +183,15 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         # Assert that bitmap migration is finished (check that successor bitmap
         # is removed)
         result = self.vm_b.qmp('query-block')
-        assert len(result['return'][0]['dirty-bitmaps']) == 1
-
-        # Check content of migrated (and updated by new writes) bitmap
-        result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
-                               node='drive0', name='bitmap')
-        self.assert_qmp(result, 'return/sha256', sha256)
+        assert len(result['return'][0]['dirty-bitmaps']) == nb_bitmaps
+
+        # Check content of migrated bitmaps. Still, don't waste time checking
+        # every bitmap
+        for i in range(0, nb_bitmaps, 5):
+            result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
+                                   node='drive0', name='bitmap{}'.format(i))
+            sha256 = discards1_sha256 if i % 2 else all_discards_sha256
+            self.assert_qmp(result, 'return/sha256', sha256)
 
 
 if __name__ == '__main__':
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:24:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:24:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16604.41079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpP-0003QD-2L; Fri, 30 Oct 2020 22:24:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16604.41079; Fri, 30 Oct 2020 22:24:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpO-0003Pz-VB; Fri, 30 Oct 2020 22:24:58 +0000
Received: by outflank-mailman (input) for mailman id 16604;
 Fri, 30 Oct 2020 22:24:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcpN-0003Pp-ME
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 3d0951e7-ef7a-4abc-8619-6759caa7d556;
 Fri, 30 Oct 2020 22:24:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpM-00054l-Th
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpM-0004CR-Si
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcpN-0003Pp-ME
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:57 +0000
X-Inumbo-ID: 3d0951e7-ef7a-4abc-8619-6759caa7d556
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 3d0951e7-ef7a-4abc-8619-6759caa7d556;
	Fri, 30 Oct 2020 22:24:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o80AwS5Hpg/0+FPyqiABA3QrIOoc+JWkCruo3P5Fyr0=; b=grPR2XLA8p8TMBSEeJsShb8btb
	z9RaLg01BQ68eCZUpJahdxennNuUhCmkqToUiouNNyi+z79fW2uKm4gG7o0ZIKSf1RgfwP7MFQn3Q
	83w0BxFs7oKsb1hSnqITL1ojAJ9tk388Y2q4S+7F1urY9W13QT7hlEyLoA8NqH3nfjcE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpM-00054l-Th
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpM-0004CR-Si
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:24:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
Message-Id: <E1kYcpM-0004CR-Si@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:24:56 +0000

commit e6ce5e92248be5547daaee3eb6cd226e9820cf7b
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:22 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
    
    Using the _locked version of bdrv_enable_dirty_bitmap to bypass locking
    is wrong as we do not already own the mutex.  Moreover, the adjacent
    call to bdrv_dirty_bitmap_enable_successor grabs the mutex.
    
    Fixes: 58f72b965e9e1q
    Cc: qemu-stable@nongnu.org # v3.0
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-8-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index b0dbf9eeed..0739f1259e 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -566,7 +566,7 @@ void dirty_bitmap_mig_before_vm_start(void)
         DirtyBitmapLoadBitmapState *b = item->data;
 
         if (b->migrated) {
-            bdrv_enable_dirty_bitmap_locked(b->bitmap);
+            bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16605.41081 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpa-0003RW-4G; Fri, 30 Oct 2020 22:25:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16605.41081; Fri, 30 Oct 2020 22:25:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpa-0003RO-0d; Fri, 30 Oct 2020 22:25:10 +0000
Received: by outflank-mailman (input) for mailman id 16605;
 Fri, 30 Oct 2020 22:25:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcpY-0003RD-Ai
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c5498090-fa6a-4e47-92d3-277636e2ec3d;
 Fri, 30 Oct 2020 22:25:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpX-000555-1z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpX-0004DM-0I
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcpY-0003RD-Ai
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:08 +0000
X-Inumbo-ID: c5498090-fa6a-4e47-92d3-277636e2ec3d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c5498090-fa6a-4e47-92d3-277636e2ec3d;
	Fri, 30 Oct 2020 22:25:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=T1hdINKhrkUHlCNRh2F6pbzWzwuULqCAehnufOhtjn4=; b=rQ/twu5gTQnuVN7TKxP1pAVibg
	fv5grMw0ihnBWYRPHYMAx68rn8NYHwbJGHB1bMLIecrOpJA54n65Glj0VNaXOk8Evn9T5zCSfMo/5
	Xw9nSCJPZi4EWt1rkQaclPgChP8z7HS7SXn/NeYPnoWM426zp1XbElmpwxEbs/YxKPm0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpX-000555-1z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpX-0004DM-0I
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: rename state structure types
Message-Id: <E1kYcpX-0004DM-0I@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:07 +0000

commit fbbc6b14705ea8c2f6326d4fab455d6432d83d08
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:23 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename state structure types
    
    Rename types to be symmetrical for load/save part and shorter.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-9-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 70 ++++++++++++++++++++++--------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 0739f1259e..1d57bff4f6 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -100,23 +100,25 @@
 /* 0x04 was "AUTOLOAD" flags on elder versions, no it is ignored */
 #define DIRTY_BITMAP_MIG_START_FLAG_RESERVED_MASK    0xf8
 
-typedef struct DirtyBitmapMigBitmapState {
+/* State of one bitmap during save process */
+typedef struct SaveBitmapState {
     /* Written during setup phase. */
     BlockDriverState *bs;
     const char *node_name;
     BdrvDirtyBitmap *bitmap;
     uint64_t total_sectors;
     uint64_t sectors_per_chunk;
-    QSIMPLEQ_ENTRY(DirtyBitmapMigBitmapState) entry;
+    QSIMPLEQ_ENTRY(SaveBitmapState) entry;
     uint8_t flags;
 
     /* For bulk phase. */
     bool bulk_completed;
     uint64_t cur_sector;
-} DirtyBitmapMigBitmapState;
+} SaveBitmapState;
 
-typedef struct DirtyBitmapMigState {
-    QSIMPLEQ_HEAD(, DirtyBitmapMigBitmapState) dbms_list;
+/* State of the dirty bitmap migration (DBM) during save process */
+typedef struct DBMSaveState {
+    QSIMPLEQ_HEAD(, SaveBitmapState) dbms_list;
 
     bool bulk_completed;
     bool no_bitmaps;
@@ -124,23 +126,25 @@ typedef struct DirtyBitmapMigState {
     /* for send_bitmap_bits() */
     BlockDriverState *prev_bs;
     BdrvDirtyBitmap *prev_bitmap;
-} DirtyBitmapMigState;
+} DBMSaveState;
 
-typedef struct DirtyBitmapLoadState {
+/* State of the dirty bitmap migration (DBM) during load process */
+typedef struct DBMLoadState {
     uint32_t flags;
     char node_name[256];
     char bitmap_name[256];
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
-} DirtyBitmapLoadState;
+} DBMLoadState;
 
-static DirtyBitmapMigState dirty_bitmap_mig_state;
+static DBMSaveState dirty_bitmap_mig_state;
 
-typedef struct DirtyBitmapLoadBitmapState {
+/* State of one bitmap during load process */
+typedef struct LoadBitmapState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
     bool migrated;
-} DirtyBitmapLoadBitmapState;
+} LoadBitmapState;
 static GSList *enabled_bitmaps;
 QemuMutex finish_lock;
 
@@ -170,7 +174,7 @@ static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
     qemu_put_byte(f, flags);
 }
 
-static void send_bitmap_header(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
+static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
                                uint32_t additional_flags)
 {
     BlockDriverState *bs = dbms->bs;
@@ -199,19 +203,19 @@ static void send_bitmap_header(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
     }
 }
 
-static void send_bitmap_start(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void send_bitmap_start(QEMUFile *f, SaveBitmapState *dbms)
 {
     send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_START);
     qemu_put_be32(f, bdrv_dirty_bitmap_granularity(dbms->bitmap));
     qemu_put_byte(f, dbms->flags);
 }
 
-static void send_bitmap_complete(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void send_bitmap_complete(QEMUFile *f, SaveBitmapState *dbms)
 {
     send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
 }
 
-static void send_bitmap_bits(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
+static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
                              uint64_t start_sector, uint32_t nr_sectors)
 {
     /* align for buffer_is_zero() */
@@ -257,7 +261,7 @@ static void send_bitmap_bits(QEMUFile *f, DirtyBitmapMigBitmapState *dbms,
 /* Called with iothread lock taken.  */
 static void dirty_bitmap_mig_cleanup(void)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
 
     while ((dbms = QSIMPLEQ_FIRST(&dirty_bitmap_mig_state.dbms_list)) != NULL) {
         QSIMPLEQ_REMOVE_HEAD(&dirty_bitmap_mig_state.dbms_list, entry);
@@ -271,7 +275,7 @@ static void dirty_bitmap_mig_cleanup(void)
 static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
 {
     BdrvDirtyBitmap *bitmap;
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     Error *local_err = NULL;
 
     FOR_EACH_DIRTY_BITMAP(bs, bitmap) {
@@ -309,7 +313,7 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
         bdrv_ref(bs);
         bdrv_dirty_bitmap_set_busy(bitmap, true);
 
-        dbms = g_new0(DirtyBitmapMigBitmapState, 1);
+        dbms = g_new0(SaveBitmapState, 1);
         dbms->bs = bs;
         dbms->node_name = bs_name;
         dbms->bitmap = bitmap;
@@ -334,7 +338,7 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
 static int init_dirty_bitmap_migration(void)
 {
     BlockDriverState *bs;
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
     BlockBackend *blk;
 
@@ -408,7 +412,7 @@ fail:
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase_send_chunk(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
+static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
 {
     uint32_t nr_sectors = MIN(dbms->total_sectors - dbms->cur_sector,
                              dbms->sectors_per_chunk);
@@ -424,7 +428,7 @@ static void bulk_phase_send_chunk(QEMUFile *f, DirtyBitmapMigBitmapState *dbms)
 /* Called with no lock taken.  */
 static void bulk_phase(QEMUFile *f, bool limit)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
 
     QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
         while (!dbms->bulk_completed) {
@@ -461,7 +465,7 @@ static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
 
 static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     trace_dirty_bitmap_save_complete_enter();
 
     if (!dirty_bitmap_mig_state.bulk_completed) {
@@ -486,7 +490,7 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
                                       uint64_t *res_compatible,
                                       uint64_t *res_postcopy_only)
 {
-    DirtyBitmapMigBitmapState *dbms;
+    SaveBitmapState *dbms;
     uint64_t pending = 0;
 
     qemu_mutex_lock_iothread();
@@ -507,7 +511,7 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
 }
 
 /* First occurrence of this bitmap. It should be created if doesn't exist */
-static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 {
     Error *local_err = NULL;
     uint32_t granularity = qemu_get_be32(f);
@@ -538,7 +542,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
 
     bdrv_disable_dirty_bitmap(s->bitmap);
     if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
-        DirtyBitmapLoadBitmapState *b;
+        LoadBitmapState *b;
 
         bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
         if (local_err) {
@@ -546,7 +550,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DirtyBitmapLoadState *s)
             return -EINVAL;
         }
 
-        b = g_new(DirtyBitmapLoadBitmapState, 1);
+        b = g_new(LoadBitmapState, 1);
         b->bs = s->bs;
         b->bitmap = s->bitmap;
         b->migrated = false;
@@ -563,7 +567,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_lock(&finish_lock);
 
     for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
-        DirtyBitmapLoadBitmapState *b = item->data;
+        LoadBitmapState *b = item->data;
 
         if (b->migrated) {
             bdrv_enable_dirty_bitmap(b->bitmap);
@@ -580,7 +584,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_unlock(&finish_lock);
 }
 
-static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
+static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
     trace_dirty_bitmap_load_complete();
@@ -589,7 +593,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
     qemu_mutex_lock(&finish_lock);
 
     for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
-        DirtyBitmapLoadBitmapState *b = item->data;
+        LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
             b->migrated = true;
@@ -621,7 +625,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DirtyBitmapLoadState *s)
     qemu_mutex_unlock(&finish_lock);
 }
 
-static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
 {
     uint64_t first_byte = qemu_get_be64(f) << BDRV_SECTOR_BITS;
     uint64_t nr_bytes = (uint64_t)qemu_get_be32(f) << BDRV_SECTOR_BITS;
@@ -666,7 +670,7 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DirtyBitmapLoadState *s)
     return 0;
 }
 
-static int dirty_bitmap_load_header(QEMUFile *f, DirtyBitmapLoadState *s)
+static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
 {
     Error *local_err = NULL;
     bool nothing;
@@ -715,7 +719,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DirtyBitmapLoadState *s)
 
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
-    static DirtyBitmapLoadState s;
+    static DBMLoadState s;
     int ret = 0;
 
     trace_dirty_bitmap_load_enter();
@@ -753,7 +757,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 
 static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 {
-    DirtyBitmapMigBitmapState *dbms = NULL;
+    SaveBitmapState *dbms = NULL;
     if (init_dirty_bitmap_migration() < 0) {
         return -1;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16606.41086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpj-0003Ss-7g; Fri, 30 Oct 2020 22:25:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16606.41086; Fri, 30 Oct 2020 22:25:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpj-0003Sk-4e; Fri, 30 Oct 2020 22:25:19 +0000
Received: by outflank-mailman (input) for mailman id 16606;
 Fri, 30 Oct 2020 22:25:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcpi-0003Sd-3O
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 25606175-7045-426b-a8fc-f242c89f6853;
 Fri, 30 Oct 2020 22:25:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcph-00055D-5m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcph-0004Dw-4x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcpi-0003Sd-3O
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:18 +0000
X-Inumbo-ID: 25606175-7045-426b-a8fc-f242c89f6853
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 25606175-7045-426b-a8fc-f242c89f6853;
	Fri, 30 Oct 2020 22:25:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FziVmQz7cXOFi7XeU/GEzWtPoOFY8JeZjJH+3WMSFTQ=; b=o3i9tlY3gNnbtvF3+86KtY8g4g
	FlvKC30DPmrKyOGgEFNARrmqalt6Sb1whDK1rnLXuD9Sxm/O415w9d8SgSdYfTslozWni2BusQWi/
	To0VB/Xr1cl906CYXYUIdbFe5zEUKtzAEimVwi0HL1u2HmAKLiuMrwVonkcjBQTEpqZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcph-00055D-5m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcph-0004Dw-4x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
Message-Id: <E1kYcph-0004Dw-4x@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:17 +0000

commit b25d364102686f9fb3854f44c75625bd79f5aee2
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:24 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
    
    Rename dirty_bitmap_mig_cleanup to dirty_bitmap_do_save_cleanup, to
    stress that it is on save part.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-10-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 1d57bff4f6..01a536d7d3 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -259,7 +259,7 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 }
 
 /* Called with iothread lock taken.  */
-static void dirty_bitmap_mig_cleanup(void)
+static void dirty_bitmap_do_save_cleanup(void)
 {
     SaveBitmapState *dbms;
 
@@ -406,7 +406,7 @@ static int init_dirty_bitmap_migration(void)
 
 fail:
     g_hash_table_destroy(handled_by_blk);
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
 
     return -1;
 }
@@ -445,7 +445,7 @@ static void bulk_phase(QEMUFile *f, bool limit)
 /* for SaveVMHandlers */
 static void dirty_bitmap_save_cleanup(void *opaque)
 {
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
 }
 
 static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
@@ -480,7 +480,7 @@ static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 
     trace_dirty_bitmap_save_complete_finish();
 
-    dirty_bitmap_mig_cleanup();
+    dirty_bitmap_do_save_cleanup();
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16607.41090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpt-0003UE-93; Fri, 30 Oct 2020 22:25:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16607.41090; Fri, 30 Oct 2020 22:25:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcpt-0003U4-68; Fri, 30 Oct 2020 22:25:29 +0000
Received: by outflank-mailman (input) for mailman id 16607;
 Fri, 30 Oct 2020 22:25:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcps-0003Tw-6q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0ee5504-22b2-456c-ab05-ce76fcf8db3a;
 Fri, 30 Oct 2020 22:25:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpr-00055U-9d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcpr-0004Ea-8k
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:27 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcps-0003Tw-6q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:28 +0000
X-Inumbo-ID: f0ee5504-22b2-456c-ab05-ce76fcf8db3a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0ee5504-22b2-456c-ab05-ce76fcf8db3a;
	Fri, 30 Oct 2020 22:25:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mRWqAnLNZOcy6OeGWj8iP9EDHz88Ek1+Ke7VUKnoTN8=; b=eIEpU+iYBMy3KTAq+8lTtZ1aGe
	btZwyIidRnQLkiUPth8kwBjwUYyd0BWc1yB3TH+B3FHfzDbwP1QBI8ngZ/9W9YVVraW+GV4zG58hP
	yWkz+uhSau/e0vlepzS5XadlrMd3fE50HovIvmDN7slgqpMkT2n0BCpOz8cHQdvTX90c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpr-00055U-9d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcpr-0004Ea-8k
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
Message-Id: <E1kYcpr-0004Ea-8k@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:27 +0000

commit d0cccbd1183eccc731deafa1b4c5a2c9dcedca08
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:25 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
    
    No reasons to keep two public init functions.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20200727194236.19551-11-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 6 +-----
 migration/migration.c          | 2 --
 migration/migration.h          | 1 -
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 01a536d7d3..4b67e4f4fb 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -148,11 +148,6 @@ typedef struct LoadBitmapState {
 static GSList *enabled_bitmaps;
 QemuMutex finish_lock;
 
-void init_dirty_bitmap_incoming_migration(void)
-{
-    qemu_mutex_init(&finish_lock);
-}
-
 static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 {
     uint8_t flags = qemu_get_byte(f);
@@ -801,6 +796,7 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 void dirty_bitmap_mig_init(void)
 {
     QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
+    qemu_mutex_init(&finish_lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
diff --git a/migration/migration.c b/migration/migration.c
index 2ed9923227..1c61428988 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -165,8 +165,6 @@ void migration_object_init(void)
     qemu_sem_init(&current_incoming->postcopy_pause_sem_dst, 0);
     qemu_sem_init(&current_incoming->postcopy_pause_sem_fault, 0);
 
-    init_dirty_bitmap_incoming_migration();
-
     if (!migration_object_check(current_migration, &err)) {
         error_report_err(err);
         exit(1);
diff --git a/migration/migration.h b/migration/migration.h
index f617960522..ab20c756f5 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -335,7 +335,6 @@ void migrate_send_rp_recv_bitmap(MigrationIncomingState *mis,
 void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
 
 void dirty_bitmap_mig_before_vm_start(void);
-void init_dirty_bitmap_incoming_migration(void);
 void migrate_add_address(SocketAddress *address);
 
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16608.41093 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcq4-0003Vz-Ab; Fri, 30 Oct 2020 22:25:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16608.41093; Fri, 30 Oct 2020 22:25:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcq4-0003Vt-7f; Fri, 30 Oct 2020 22:25:40 +0000
Received: by outflank-mailman (input) for mailman id 16608;
 Fri, 30 Oct 2020 22:25:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcq3-0003VJ-0d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fd50ccec-f16c-4f39-9a2c-4a18111e719e;
 Fri, 30 Oct 2020 22:25:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcq1-00055b-D8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcq1-0004FA-CQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:37 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcq3-0003VJ-0d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:39 +0000
X-Inumbo-ID: fd50ccec-f16c-4f39-9a2c-4a18111e719e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fd50ccec-f16c-4f39-9a2c-4a18111e719e;
	Fri, 30 Oct 2020 22:25:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9/SeGctNUP7Fr5SRR8NooojAASv/F/sJsTB5H1bnnOY=; b=6NGb8VnTjwzGivWjhOW0Cf/Nw2
	tFv57hmA3wG3T4Ei+x1pPzdQ8tBvLGyxRE8T196m9XS/RYPnFSP/rXQi02FpNhsnqYx0cFznEpTZ0
	x7AS7zt/yoATXzyEy2yzWHh2lbz3ytURnwegStb2nEoKX/01niQ1bZbtSSUcANZsSzvk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcq1-00055b-D8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcq1-0004FA-CQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: refactor state global variables
Message-Id: <E1kYcq1-0004FA-CQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:37 +0000

commit 3b52726ec0e2f5c5732fe5f9d76af700463b73d3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:26 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: refactor state global variables
    
    Move all state variables into one global struct. Reduce global
    variable usage, utilizing opaque pointer where possible.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-12-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 179 +++++++++++++++++++++++------------------
 1 file changed, 99 insertions(+), 80 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 4b67e4f4fb..9b39e7aa2b 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -128,6 +128,12 @@ typedef struct DBMSaveState {
     BdrvDirtyBitmap *prev_bitmap;
 } DBMSaveState;
 
+typedef struct LoadBitmapState {
+    BlockDriverState *bs;
+    BdrvDirtyBitmap *bitmap;
+    bool migrated;
+} LoadBitmapState;
+
 /* State of the dirty bitmap migration (DBM) during load process */
 typedef struct DBMLoadState {
     uint32_t flags;
@@ -135,18 +141,17 @@ typedef struct DBMLoadState {
     char bitmap_name[256];
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
+
+    GSList *enabled_bitmaps;
+    QemuMutex finish_lock;
 } DBMLoadState;
 
-static DBMSaveState dirty_bitmap_mig_state;
+typedef struct DBMState {
+    DBMSaveState save;
+    DBMLoadState load;
+} DBMState;
 
-/* State of one bitmap during load process */
-typedef struct LoadBitmapState {
-    BlockDriverState *bs;
-    BdrvDirtyBitmap *bitmap;
-    bool migrated;
-} LoadBitmapState;
-static GSList *enabled_bitmaps;
-QemuMutex finish_lock;
+static DBMState dbm_state;
 
 static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 {
@@ -169,21 +174,21 @@ static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
     qemu_put_byte(f, flags);
 }
 
-static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
-                               uint32_t additional_flags)
+static void send_bitmap_header(QEMUFile *f, DBMSaveState *s,
+                               SaveBitmapState *dbms, uint32_t additional_flags)
 {
     BlockDriverState *bs = dbms->bs;
     BdrvDirtyBitmap *bitmap = dbms->bitmap;
     uint32_t flags = additional_flags;
     trace_send_bitmap_header_enter();
 
-    if (bs != dirty_bitmap_mig_state.prev_bs) {
-        dirty_bitmap_mig_state.prev_bs = bs;
+    if (bs != s->prev_bs) {
+        s->prev_bs = bs;
         flags |= DIRTY_BITMAP_MIG_FLAG_DEVICE_NAME;
     }
 
-    if (bitmap != dirty_bitmap_mig_state.prev_bitmap) {
-        dirty_bitmap_mig_state.prev_bitmap = bitmap;
+    if (bitmap != s->prev_bitmap) {
+        s->prev_bitmap = bitmap;
         flags |= DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME;
     }
 
@@ -198,19 +203,22 @@ static void send_bitmap_header(QEMUFile *f, SaveBitmapState *dbms,
     }
 }
 
-static void send_bitmap_start(QEMUFile *f, SaveBitmapState *dbms)
+static void send_bitmap_start(QEMUFile *f, DBMSaveState *s,
+                              SaveBitmapState *dbms)
 {
-    send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_START);
+    send_bitmap_header(f, s, dbms, DIRTY_BITMAP_MIG_FLAG_START);
     qemu_put_be32(f, bdrv_dirty_bitmap_granularity(dbms->bitmap));
     qemu_put_byte(f, dbms->flags);
 }
 
-static void send_bitmap_complete(QEMUFile *f, SaveBitmapState *dbms)
+static void send_bitmap_complete(QEMUFile *f, DBMSaveState *s,
+                                 SaveBitmapState *dbms)
 {
-    send_bitmap_header(f, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
+    send_bitmap_header(f, s, dbms, DIRTY_BITMAP_MIG_FLAG_COMPLETE);
 }
 
-static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
+static void send_bitmap_bits(QEMUFile *f, DBMSaveState *s,
+                             SaveBitmapState *dbms,
                              uint64_t start_sector, uint32_t nr_sectors)
 {
     /* align for buffer_is_zero() */
@@ -235,7 +243,7 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 
     trace_send_bitmap_bits(flags, start_sector, nr_sectors, buf_size);
 
-    send_bitmap_header(f, dbms, flags);
+    send_bitmap_header(f, s, dbms, flags);
 
     qemu_put_be64(f, start_sector);
     qemu_put_be32(f, nr_sectors);
@@ -254,12 +262,12 @@ static void send_bitmap_bits(QEMUFile *f, SaveBitmapState *dbms,
 }
 
 /* Called with iothread lock taken.  */
-static void dirty_bitmap_do_save_cleanup(void)
+static void dirty_bitmap_do_save_cleanup(DBMSaveState *s)
 {
     SaveBitmapState *dbms;
 
-    while ((dbms = QSIMPLEQ_FIRST(&dirty_bitmap_mig_state.dbms_list)) != NULL) {
-        QSIMPLEQ_REMOVE_HEAD(&dirty_bitmap_mig_state.dbms_list, entry);
+    while ((dbms = QSIMPLEQ_FIRST(&s->dbms_list)) != NULL) {
+        QSIMPLEQ_REMOVE_HEAD(&s->dbms_list, entry);
         bdrv_dirty_bitmap_set_busy(dbms->bitmap, false);
         bdrv_unref(dbms->bs);
         g_free(dbms);
@@ -267,7 +275,8 @@ static void dirty_bitmap_do_save_cleanup(void)
 }
 
 /* Called with iothread lock taken. */
-static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
+static int add_bitmaps_to_list(DBMSaveState *s, BlockDriverState *bs,
+                               const char *bs_name)
 {
     BdrvDirtyBitmap *bitmap;
     SaveBitmapState *dbms;
@@ -322,25 +331,24 @@ static int add_bitmaps_to_list(BlockDriverState *bs, const char *bs_name)
             dbms->flags |= DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT;
         }
 
-        QSIMPLEQ_INSERT_TAIL(&dirty_bitmap_mig_state.dbms_list,
-                             dbms, entry);
+        QSIMPLEQ_INSERT_TAIL(&s->dbms_list, dbms, entry);
     }
 
     return 0;
 }
 
 /* Called with iothread lock taken. */
-static int init_dirty_bitmap_migration(void)
+static int init_dirty_bitmap_migration(DBMSaveState *s)
 {
     BlockDriverState *bs;
     SaveBitmapState *dbms;
     GHashTable *handled_by_blk = g_hash_table_new(NULL, NULL);
     BlockBackend *blk;
 
-    dirty_bitmap_mig_state.bulk_completed = false;
-    dirty_bitmap_mig_state.prev_bs = NULL;
-    dirty_bitmap_mig_state.prev_bitmap = NULL;
-    dirty_bitmap_mig_state.no_bitmaps = false;
+    s->bulk_completed = false;
+    s->prev_bs = NULL;
+    s->prev_bitmap = NULL;
+    s->no_bitmaps = false;
 
     /*
      * Use blockdevice name for direct (or filtered) children of named block
@@ -369,7 +377,7 @@ static int init_dirty_bitmap_migration(void)
         }
 
         if (bs && bs->drv && !bs->drv->is_filter) {
-            if (add_bitmaps_to_list(bs, name)) {
+            if (add_bitmaps_to_list(s, bs, name)) {
                 goto fail;
             }
             g_hash_table_add(handled_by_blk, bs);
@@ -381,18 +389,18 @@ static int init_dirty_bitmap_migration(void)
             continue;
         }
 
-        if (add_bitmaps_to_list(bs, bdrv_get_node_name(bs))) {
+        if (add_bitmaps_to_list(s, bs, bdrv_get_node_name(bs))) {
             goto fail;
         }
     }
 
     /* unset migration flags here, to not roll back it */
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         bdrv_dirty_bitmap_skip_store(dbms->bitmap, true);
     }
 
-    if (QSIMPLEQ_EMPTY(&dirty_bitmap_mig_state.dbms_list)) {
-        dirty_bitmap_mig_state.no_bitmaps = true;
+    if (QSIMPLEQ_EMPTY(&s->dbms_list)) {
+        s->no_bitmaps = true;
     }
 
     g_hash_table_destroy(handled_by_blk);
@@ -401,18 +409,19 @@ static int init_dirty_bitmap_migration(void)
 
 fail:
     g_hash_table_destroy(handled_by_blk);
-    dirty_bitmap_do_save_cleanup();
+    dirty_bitmap_do_save_cleanup(s);
 
     return -1;
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
+static void bulk_phase_send_chunk(QEMUFile *f, DBMSaveState *s,
+                                  SaveBitmapState *dbms)
 {
     uint32_t nr_sectors = MIN(dbms->total_sectors - dbms->cur_sector,
                              dbms->sectors_per_chunk);
 
-    send_bitmap_bits(f, dbms, dbms->cur_sector, nr_sectors);
+    send_bitmap_bits(f, s, dbms, dbms->cur_sector, nr_sectors);
 
     dbms->cur_sector += nr_sectors;
     if (dbms->cur_sector >= dbms->total_sectors) {
@@ -421,61 +430,66 @@ static void bulk_phase_send_chunk(QEMUFile *f, SaveBitmapState *dbms)
 }
 
 /* Called with no lock taken.  */
-static void bulk_phase(QEMUFile *f, bool limit)
+static void bulk_phase(QEMUFile *f, DBMSaveState *s, bool limit)
 {
     SaveBitmapState *dbms;
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         while (!dbms->bulk_completed) {
-            bulk_phase_send_chunk(f, dbms);
+            bulk_phase_send_chunk(f, s, dbms);
             if (limit && qemu_file_rate_limit(f)) {
                 return;
             }
         }
     }
 
-    dirty_bitmap_mig_state.bulk_completed = true;
+    s->bulk_completed = true;
 }
 
 /* for SaveVMHandlers */
 static void dirty_bitmap_save_cleanup(void *opaque)
 {
-    dirty_bitmap_do_save_cleanup();
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
+    dirty_bitmap_do_save_cleanup(s);
 }
 
 static int dirty_bitmap_save_iterate(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
     trace_dirty_bitmap_save_iterate(migration_in_postcopy());
 
-    if (migration_in_postcopy() && !dirty_bitmap_mig_state.bulk_completed) {
-        bulk_phase(f, true);
+    if (migration_in_postcopy() && !s->bulk_completed) {
+        bulk_phase(f, s, true);
     }
 
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
-    return dirty_bitmap_mig_state.bulk_completed;
+    return s->bulk_completed;
 }
 
 /* Called with iothread lock taken.  */
 
 static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms;
     trace_dirty_bitmap_save_complete_enter();
 
-    if (!dirty_bitmap_mig_state.bulk_completed) {
-        bulk_phase(f, false);
+    if (!s->bulk_completed) {
+        bulk_phase(f, s, false);
     }
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
-        send_bitmap_complete(f, dbms);
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
+        send_bitmap_complete(f, s, dbms);
     }
 
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
     trace_dirty_bitmap_save_complete_finish();
 
-    dirty_bitmap_do_save_cleanup();
+    dirty_bitmap_save_cleanup(opaque);
     return 0;
 }
 
@@ -485,12 +499,13 @@ static void dirty_bitmap_save_pending(QEMUFile *f, void *opaque,
                                       uint64_t *res_compatible,
                                       uint64_t *res_postcopy_only)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms;
     uint64_t pending = 0;
 
     qemu_mutex_lock_iothread();
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
         uint64_t gran = bdrv_dirty_bitmap_granularity(dbms->bitmap);
         uint64_t sectors = dbms->bulk_completed ? 0 :
                            dbms->total_sectors - dbms->cur_sector;
@@ -549,7 +564,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
         b->bs = s->bs;
         b->bitmap = s->bitmap;
         b->migrated = false;
-        enabled_bitmaps = g_slist_prepend(enabled_bitmaps, b);
+        s->enabled_bitmaps = g_slist_prepend(s->enabled_bitmaps, b);
     }
 
     return 0;
@@ -557,11 +572,12 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 
 void dirty_bitmap_mig_before_vm_start(void)
 {
+    DBMLoadState *s = &dbm_state.load;
     GSList *item;
 
-    qemu_mutex_lock(&finish_lock);
+    qemu_mutex_lock(&s->finish_lock);
 
-    for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->migrated) {
@@ -573,10 +589,10 @@ void dirty_bitmap_mig_before_vm_start(void)
         g_free(b);
     }
 
-    g_slist_free(enabled_bitmaps);
-    enabled_bitmaps = NULL;
+    g_slist_free(s->enabled_bitmaps);
+    s->enabled_bitmaps = NULL;
 
-    qemu_mutex_unlock(&finish_lock);
+    qemu_mutex_unlock(&s->finish_lock);
 }
 
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
@@ -585,9 +601,9 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
     trace_dirty_bitmap_load_complete();
     bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&finish_lock);
+    qemu_mutex_lock(&s->finish_lock);
 
-    for (item = enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
@@ -598,7 +614,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 
     if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
         bdrv_dirty_bitmap_lock(s->bitmap);
-        if (enabled_bitmaps == NULL) {
+        if (s->enabled_bitmaps == NULL) {
             /* in postcopy */
             bdrv_reclaim_dirty_bitmap_locked(s->bitmap, &error_abort);
             bdrv_enable_dirty_bitmap_locked(s->bitmap);
@@ -617,7 +633,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_dirty_bitmap_unlock(s->bitmap);
     }
 
-    qemu_mutex_unlock(&finish_lock);
+    qemu_mutex_unlock(&s->finish_lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -714,7 +730,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
 
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
-    static DBMLoadState s;
+    DBMLoadState *s = &((DBMState *)opaque)->load;
     int ret = 0;
 
     trace_dirty_bitmap_load_enter();
@@ -724,17 +740,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
     }
 
     do {
-        ret = dirty_bitmap_load_header(f, &s);
+        ret = dirty_bitmap_load_header(f, s);
         if (ret < 0) {
             return ret;
         }
 
-        if (s.flags & DIRTY_BITMAP_MIG_FLAG_START) {
-            ret = dirty_bitmap_load_start(f, &s);
-        } else if (s.flags & DIRTY_BITMAP_MIG_FLAG_COMPLETE) {
-            dirty_bitmap_load_complete(f, &s);
-        } else if (s.flags & DIRTY_BITMAP_MIG_FLAG_BITS) {
-            ret = dirty_bitmap_load_bits(f, &s);
+        if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) {
+            ret = dirty_bitmap_load_start(f, s);
+        } else if (s->flags & DIRTY_BITMAP_MIG_FLAG_COMPLETE) {
+            dirty_bitmap_load_complete(f, s);
+        } else if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITS) {
+            ret = dirty_bitmap_load_bits(f, s);
         }
 
         if (!ret) {
@@ -744,7 +760,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
         if (ret) {
             return ret;
         }
-    } while (!(s.flags & DIRTY_BITMAP_MIG_FLAG_EOS));
+    } while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS));
 
     trace_dirty_bitmap_load_success();
     return 0;
@@ -752,13 +768,14 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 
 static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 {
+    DBMSaveState *s = &((DBMState *)opaque)->save;
     SaveBitmapState *dbms = NULL;
-    if (init_dirty_bitmap_migration() < 0) {
+    if (init_dirty_bitmap_migration(s) < 0) {
         return -1;
     }
 
-    QSIMPLEQ_FOREACH(dbms, &dirty_bitmap_mig_state.dbms_list, entry) {
-        send_bitmap_start(f, dbms);
+    QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) {
+        send_bitmap_start(f, s, dbms);
     }
     qemu_put_bitmap_flags(f, DIRTY_BITMAP_MIG_FLAG_EOS);
 
@@ -767,7 +784,9 @@ static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque)
 
 static bool dirty_bitmap_is_active(void *opaque)
 {
-    return migrate_dirty_bitmaps() && !dirty_bitmap_mig_state.no_bitmaps;
+    DBMSaveState *s = &((DBMState *)opaque)->save;
+
+    return migrate_dirty_bitmaps() && !s->no_bitmaps;
 }
 
 static bool dirty_bitmap_is_active_iterate(void *opaque)
@@ -795,10 +814,10 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 
 void dirty_bitmap_mig_init(void)
 {
-    QSIMPLEQ_INIT(&dirty_bitmap_mig_state.dbms_list);
-    qemu_mutex_init(&finish_lock);
+    QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
+    qemu_mutex_init(&dbm_state.load.finish_lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
-                         &dirty_bitmap_mig_state);
+                         &dbm_state);
 }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16609.41098 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqD-0003X7-CR; Fri, 30 Oct 2020 22:25:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16609.41098; Fri, 30 Oct 2020 22:25:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqD-0003Wy-9E; Fri, 30 Oct 2020 22:25:49 +0000
Received: by outflank-mailman (input) for mailman id 16609;
 Fri, 30 Oct 2020 22:25:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcqC-0003Wo-AU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:48 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f4bef1c9-ca18-4c02-a75b-8b713ec921bd;
 Fri, 30 Oct 2020 22:25:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqB-00056O-GY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqB-0004Fs-Fo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcqC-0003Wo-AU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:48 +0000
X-Inumbo-ID: f4bef1c9-ca18-4c02-a75b-8b713ec921bd
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f4bef1c9-ca18-4c02-a75b-8b713ec921bd;
	Fri, 30 Oct 2020 22:25:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EgdR5UXgozZVlJnqebxdLp2UwG4dme7MLt4ISlDOL/Y=; b=5YQA6zakKLWDMtLZ1u5mbZN5vK
	19JfOCgMoWDkspNrjEGfLcKi8A72Eh2hSOp8F7hAstLg68BTBkwqV+a1VtpS8RrkPxHwdwKzZm3Dh
	nToUNgBL3ENcx65TJ8Ay3mJVFmzcUeTTvq6rsCg0s3bMw8SccBucmWZIqm3wPasirnG0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqB-00056O-GY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqB-0004Fs-Fo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: rename finish_lock to just lock
Message-Id: <E1kYcqB-0004Fs-Fo@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:47 +0000

commit 8949121644b756b58d6546d86c9a49f18a0e5153
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:27 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: rename finish_lock to just lock
    
    finish_lock is bad name, as lock used not only on process end.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-13-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9b39e7aa2b..9194807b54 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -143,7 +143,7 @@ typedef struct DBMLoadState {
     BdrvDirtyBitmap *bitmap;
 
     GSList *enabled_bitmaps;
-    QemuMutex finish_lock;
+    QemuMutex lock; /* protect enabled_bitmaps */
 } DBMLoadState;
 
 typedef struct DBMState {
@@ -575,7 +575,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     DBMLoadState *s = &dbm_state.load;
     GSList *item;
 
-    qemu_mutex_lock(&s->finish_lock);
+    qemu_mutex_lock(&s->lock);
 
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
@@ -592,7 +592,7 @@ void dirty_bitmap_mig_before_vm_start(void)
     g_slist_free(s->enabled_bitmaps);
     s->enabled_bitmaps = NULL;
 
-    qemu_mutex_unlock(&s->finish_lock);
+    qemu_mutex_unlock(&s->lock);
 }
 
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
@@ -601,7 +601,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
     trace_dirty_bitmap_load_complete();
     bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&s->finish_lock);
+    qemu_mutex_lock(&s->lock);
 
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
@@ -633,7 +633,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_dirty_bitmap_unlock(s->bitmap);
     }
 
-    qemu_mutex_unlock(&s->finish_lock);
+    qemu_mutex_unlock(&s->lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -815,7 +815,7 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
 void dirty_bitmap_mig_init(void)
 {
     QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
-    qemu_mutex_init(&dbm_state.load.finish_lock);
+    qemu_mutex_init(&dbm_state.load.lock);
 
     register_savevm_live("dirty-bitmap", 0, 1,
                          &savevm_dirty_bitmap_handlers,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:25:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:25:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16610.41102 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqN-0003Yi-FE; Fri, 30 Oct 2020 22:25:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16610.41102; Fri, 30 Oct 2020 22:25:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqN-0003Ya-C3; Fri, 30 Oct 2020 22:25:59 +0000
Received: by outflank-mailman (input) for mailman id 16610;
 Fri, 30 Oct 2020 22:25:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcqM-0003YQ-Jy
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2bb83db8-2c05-4733-b669-a833afc6175f;
 Fri, 30 Oct 2020 22:25:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqL-00056W-LP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqL-0004GS-JI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:57 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcqM-0003YQ-Jy
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:58 +0000
X-Inumbo-ID: 2bb83db8-2c05-4733-b669-a833afc6175f
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2bb83db8-2c05-4733-b669-a833afc6175f;
	Fri, 30 Oct 2020 22:25:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4UQSQjXt+MRpdvTa+s48BBc0e3NFC1qMYyjlWlFv//M=; b=msKtBG3sTZ/lm3Fyha3DR9tWLn
	bIDLyQcCji5PETKJQ6pGPFF3p3PLNIfN515PjXFSmISmz1hMzrZG+yJXk++EmpZFjI85ZzuRC33QD
	H5EqO+IifXenAG5p4Hxo7k7Ym9XER/jNHmaxV4ftVw8LelQknISgZ1PoJIFtHzzZCQ/A=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqL-00056W-LP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqL-0004GS-JI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:25:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
Message-Id: <E1kYcqL-0004GS-JI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:25:57 +0000

commit f3045b9a828e99221083a4ad9905b9d7cdd4df2f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:28 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
    
    bdrv_enable_dirty_bitmap_locked() call does nothing, as if we are in
    postcopy, bitmap successor must be enabled, and reclaim operation will
    enable the bitmap.
    
    So, actually we need just call _reclaim_ in both if branches, and
    making differences only to add an assertion seems not really good. The
    logic becomes simple: on load complete we do reclaim and that's all.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-14-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 9194807b54..405a259296 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -603,6 +603,10 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 
     qemu_mutex_lock(&s->lock);
 
+    if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
+        bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
+    }
+
     for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
@@ -612,27 +616,6 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         }
     }
 
-    if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
-        bdrv_dirty_bitmap_lock(s->bitmap);
-        if (s->enabled_bitmaps == NULL) {
-            /* in postcopy */
-            bdrv_reclaim_dirty_bitmap_locked(s->bitmap, &error_abort);
-            bdrv_enable_dirty_bitmap_locked(s->bitmap);
-        } else {
-            /* target not started, successor must be empty */
-            int64_t count = bdrv_get_dirty_count(s->bitmap);
-            BdrvDirtyBitmap *ret = bdrv_reclaim_dirty_bitmap_locked(s->bitmap,
-                                                                    NULL);
-            /* bdrv_reclaim_dirty_bitmap can fail only on no successor (it
-             * must be) or on merge fail, but merge can't fail when second
-             * bitmap is empty
-             */
-            assert(ret == s->bitmap &&
-                   count == bdrv_get_dirty_count(s->bitmap));
-        }
-        bdrv_dirty_bitmap_unlock(s->bitmap);
-    }
-
     qemu_mutex_unlock(&s->lock);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:26:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:26:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16611.41105 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqX-0003a0-GX; Fri, 30 Oct 2020 22:26:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16611.41105; Fri, 30 Oct 2020 22:26:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqX-0003Zs-Dc; Fri, 30 Oct 2020 22:26:09 +0000
Received: by outflank-mailman (input) for mailman id 16611;
 Fri, 30 Oct 2020 22:26:08 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcqW-0003Zi-PC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:08 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c937704-9209-42a7-b436-3e4e92d8fa6c;
 Fri, 30 Oct 2020 22:26:07 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqV-00056r-QF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqV-0004HV-OW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcqW-0003Zi-PC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:08 +0000
X-Inumbo-ID: 2c937704-9209-42a7-b436-3e4e92d8fa6c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c937704-9209-42a7-b436-3e4e92d8fa6c;
	Fri, 30 Oct 2020 22:26:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=z7DIdkVRz+o0F587cVY0n72L0FxbpJqczXuICdnkMuA=; b=a3RQ66+3vB86cM3QD5HJvNkUWU
	pxfUu5dWFVo2fYsprd5qNzEnsibeFwFH0NK+Gcg1WRUwNjjaurKlnrqIpSlnyag2hx2mzrwbzUdOh
	zs9fyiA71wdJ4KsZIdP1vgXtsoofn3CL4cvk1Pvw5gsXDVdl18AY4bFTtsCE35r3S/J4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqV-00056r-QF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqV-0004HV-OW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:07 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: keep bitmap state for all bitmaps
Message-Id: <E1kYcqV-0004HV-OW@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:07 +0000

commit 0a47190a009614598dc5ae3d9d25138575184520
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:29 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:39:59 2020 -0500

    migration/block-dirty-bitmap: keep bitmap state for all bitmaps
    
    Keep bitmap state for disabled bitmaps too. Keep the state until the
    end of the process. It's needed for the following commit to implement
    bitmap postcopy canceling.
    
    To clean-up the new list the following logic is used:
    We need two events to consider bitmap migration finished:
    1. chunk with DIRTY_BITMAP_MIG_FLAG_COMPLETE flag should be received
    2. dirty_bitmap_mig_before_vm_start should be called
    These two events may come in any order, so we understand which one is
    last, and on the last of them we remove bitmap migration state from the
    list.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-15-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 64 ++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 21 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 405a259296..eb4ffeac4d 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -132,6 +132,7 @@ typedef struct LoadBitmapState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
     bool migrated;
+    bool enabled;
 } LoadBitmapState;
 
 /* State of the dirty bitmap migration (DBM) during load process */
@@ -142,8 +143,10 @@ typedef struct DBMLoadState {
     BlockDriverState *bs;
     BdrvDirtyBitmap *bitmap;
 
-    GSList *enabled_bitmaps;
-    QemuMutex lock; /* protect enabled_bitmaps */
+    bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
+
+    GSList *bitmaps;
+    QemuMutex lock; /* protect bitmaps */
 } DBMLoadState;
 
 typedef struct DBMState {
@@ -526,6 +529,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
     Error *local_err = NULL;
     uint32_t granularity = qemu_get_be32(f);
     uint8_t flags = qemu_get_byte(f);
+    LoadBitmapState *b;
 
     if (s->bitmap) {
         error_report("Bitmap with the same name ('%s') already exists on "
@@ -552,45 +556,59 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
 
     bdrv_disable_dirty_bitmap(s->bitmap);
     if (flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED) {
-        LoadBitmapState *b;
-
         bdrv_dirty_bitmap_create_successor(s->bitmap, &local_err);
         if (local_err) {
             error_report_err(local_err);
             return -EINVAL;
         }
-
-        b = g_new(LoadBitmapState, 1);
-        b->bs = s->bs;
-        b->bitmap = s->bitmap;
-        b->migrated = false;
-        s->enabled_bitmaps = g_slist_prepend(s->enabled_bitmaps, b);
     }
 
+    b = g_new(LoadBitmapState, 1);
+    b->bs = s->bs;
+    b->bitmap = s->bitmap;
+    b->migrated = false;
+    b->enabled = flags & DIRTY_BITMAP_MIG_START_FLAG_ENABLED;
+
+    s->bitmaps = g_slist_prepend(s->bitmaps, b);
+
     return 0;
 }
 
-void dirty_bitmap_mig_before_vm_start(void)
+/*
+ * before_vm_start_handle_item
+ *
+ * g_slist_foreach helper
+ *
+ * item is LoadBitmapState*
+ * opaque is DBMLoadState*
+ */
+static void before_vm_start_handle_item(void *item, void *opaque)
 {
-    DBMLoadState *s = &dbm_state.load;
-    GSList *item;
-
-    qemu_mutex_lock(&s->lock);
-
-    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
-        LoadBitmapState *b = item->data;
+    DBMLoadState *s = opaque;
+    LoadBitmapState *b = item;
 
+    if (b->enabled) {
         if (b->migrated) {
             bdrv_enable_dirty_bitmap(b->bitmap);
         } else {
             bdrv_dirty_bitmap_enable_successor(b->bitmap);
         }
+    }
 
+    if (b->migrated) {
+        s->bitmaps = g_slist_remove(s->bitmaps, b);
         g_free(b);
     }
+}
 
-    g_slist_free(s->enabled_bitmaps);
-    s->enabled_bitmaps = NULL;
+void dirty_bitmap_mig_before_vm_start(void)
+{
+    DBMLoadState *s = &dbm_state.load;
+    qemu_mutex_lock(&s->lock);
+
+    assert(!s->before_vm_start_handled);
+    g_slist_foreach(s->bitmaps, before_vm_start_handle_item, s);
+    s->before_vm_start_handled = true;
 
     qemu_mutex_unlock(&s->lock);
 }
@@ -607,11 +625,15 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
         bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
     }
 
-    for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
+    for (item = s->bitmaps; item; item = g_slist_next(item)) {
         LoadBitmapState *b = item->data;
 
         if (b->bitmap == s->bitmap) {
             b->migrated = true;
+            if (s->before_vm_start_handled) {
+                s->bitmaps = g_slist_remove(s->bitmaps, b);
+                g_free(b);
+            }
             break;
         }
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:26:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:26:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16612.41110 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqi-0003bF-IP; Fri, 30 Oct 2020 22:26:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16612.41110; Fri, 30 Oct 2020 22:26:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqi-0003b7-FC; Fri, 30 Oct 2020 22:26:20 +0000
Received: by outflank-mailman (input) for mailman id 16612;
 Fri, 30 Oct 2020 22:26:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcqh-0003aw-3K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5e62b199-7001-4100-a5b6-4acd6a00ac26;
 Fri, 30 Oct 2020 22:26:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqf-000571-U4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqf-0004IE-T9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:17 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcqh-0003aw-3K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:19 +0000
X-Inumbo-ID: 5e62b199-7001-4100-a5b6-4acd6a00ac26
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5e62b199-7001-4100-a5b6-4acd6a00ac26;
	Fri, 30 Oct 2020 22:26:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JJibHG4ZHHibr14rWM/K+vM0hkcQ2EWGbmNzcZHhAlQ=; b=qnDhXaMRwUnoWInygjChH2+sq9
	u4tmQ0xeq8vG5p0BUVvtwx/kBZRs8ONLE3L2yJ6xx/QsyPoUHO9FOTpDE9hMMeT/BkWIxa+Yf1bh2
	OgiqHOnWktKkeX87r2HBKDKh+ztIl70Bgl3uFFNmFql6BRott+sDfCgZdlWwY0Idls20=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqf-000571-U4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqf-0004IE-T9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:17 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: relax error handling in incoming part
Message-Id: <E1kYcqf-0004IE-T9@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:17 +0000

commit b91f33b81df7439ac504f4737c3e529ec2bf0525
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:30 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:40:14 2020 -0500

    migration/block-dirty-bitmap: relax error handling in incoming part
    
    Bitmaps data is not critical, and we should not fail the migration (or
    use postcopy recovering) because of dirty-bitmaps migration failure.
    Instead we should just lose unfinished bitmaps.
    
    Still we have to report io stream violation errors, as they affect the
    whole migration stream.
    
    While touching this, tighten code that was previously blindly calling
    malloc on a size read from the migration stream, as a corrupted stream
    (perhaps from a malicious user) should not be able to convince us to
    allocate an inordinate amount of memory.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727194236.19551-16-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [eblake: typo fixes, enhance commit message]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 164 +++++++++++++++++++++++++++++++----------
 1 file changed, 127 insertions(+), 37 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index eb4ffeac4d..f91015a4f8 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -145,6 +145,15 @@ typedef struct DBMLoadState {
 
     bool before_vm_start_handled; /* set in dirty_bitmap_mig_before_vm_start */
 
+    /*
+     * cancelled
+     * Incoming migration is cancelled for some reason. That means that we
+     * still should read our chunks from migration stream, to not affect other
+     * migration objects (like RAM), but just ignore them and do not touch any
+     * bitmaps or nodes.
+     */
+    bool cancelled;
+
     GSList *bitmaps;
     QemuMutex lock; /* protect bitmaps */
 } DBMLoadState;
@@ -531,6 +540,10 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoadState *s)
     uint8_t flags = qemu_get_byte(f);
     LoadBitmapState *b;
 
+    if (s->cancelled) {
+        return 0;
+    }
+
     if (s->bitmap) {
         error_report("Bitmap with the same name ('%s') already exists on "
                      "destination", bdrv_dirty_bitmap_name(s->bitmap));
@@ -613,13 +626,47 @@ void dirty_bitmap_mig_before_vm_start(void)
     qemu_mutex_unlock(&s->lock);
 }
 
+static void cancel_incoming_locked(DBMLoadState *s)
+{
+    GSList *item;
+
+    if (s->cancelled) {
+        return;
+    }
+
+    s->cancelled = true;
+    s->bs = NULL;
+    s->bitmap = NULL;
+
+    /* Drop all unfinished bitmaps */
+    for (item = s->bitmaps; item; item = g_slist_next(item)) {
+        LoadBitmapState *b = item->data;
+
+        /*
+         * Bitmap must be unfinished, as finished bitmaps should already be
+         * removed from the list.
+         */
+        assert(!s->before_vm_start_handled || !b->migrated);
+        if (bdrv_dirty_bitmap_has_successor(b->bitmap)) {
+            bdrv_reclaim_dirty_bitmap(b->bitmap, &error_abort);
+        }
+        bdrv_release_dirty_bitmap(b->bitmap);
+    }
+
+    g_slist_free_full(s->bitmaps, g_free);
+    s->bitmaps = NULL;
+}
+
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
     trace_dirty_bitmap_load_complete();
-    bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
-    qemu_mutex_lock(&s->lock);
+    if (s->cancelled) {
+        return;
+    }
+
+    bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
 
     if (bdrv_dirty_bitmap_has_successor(s->bitmap)) {
         bdrv_reclaim_dirty_bitmap(s->bitmap, &error_abort);
@@ -637,8 +684,6 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
             break;
         }
     }
-
-    qemu_mutex_unlock(&s->lock);
 }
 
 static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
@@ -650,15 +695,46 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
 
     if (s->flags & DIRTY_BITMAP_MIG_FLAG_ZEROES) {
         trace_dirty_bitmap_load_bits_zeroes();
-        bdrv_dirty_bitmap_deserialize_zeroes(s->bitmap, first_byte, nr_bytes,
-                                             false);
+        if (!s->cancelled) {
+            bdrv_dirty_bitmap_deserialize_zeroes(s->bitmap, first_byte,
+                                                 nr_bytes, false);
+        }
     } else {
         size_t ret;
-        uint8_t *buf;
+        g_autofree uint8_t *buf = NULL;
         uint64_t buf_size = qemu_get_be64(f);
-        uint64_t needed_size =
-            bdrv_dirty_bitmap_serialization_size(s->bitmap,
-                                                 first_byte, nr_bytes);
+        uint64_t needed_size;
+
+        /*
+         * The actual check for buf_size is done a bit later. We can't do it in
+         * cancelled mode as we don't have the bitmap to check the constraints
+         * (so, we allocate a buffer and read prior to the check). On the other
+         * hand, we shouldn't blindly g_malloc the number from the stream.
+         * Actually one chunk should not be larger than CHUNK_SIZE. Let's allow
+         * a bit larger (which means that bitmap migration will fail anyway and
+         * the whole migration will most probably fail soon due to broken
+         * stream).
+         */
+        if (buf_size > 10 * CHUNK_SIZE) {
+            error_report("Bitmap migration stream buffer allocation request "
+                         "is too large");
+            return -EIO;
+        }
+
+        buf = g_malloc(buf_size);
+        ret = qemu_get_buffer(f, buf, buf_size);
+        if (ret != buf_size) {
+            error_report("Failed to read bitmap bits");
+            return -EIO;
+        }
+
+        if (s->cancelled) {
+            return 0;
+        }
+
+        needed_size = bdrv_dirty_bitmap_serialization_size(s->bitmap,
+                                                           first_byte,
+                                                           nr_bytes);
 
         if (needed_size > buf_size ||
             buf_size > QEMU_ALIGN_UP(needed_size, 4 * sizeof(long))
@@ -667,20 +743,12 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
             error_report("Migrated bitmap granularity doesn't "
                          "match the destination bitmap '%s' granularity",
                          bdrv_dirty_bitmap_name(s->bitmap));
-            return -EINVAL;
-        }
-
-        buf = g_malloc(buf_size);
-        ret = qemu_get_buffer(f, buf, buf_size);
-        if (ret != buf_size) {
-            error_report("Failed to read bitmap bits");
-            g_free(buf);
-            return -EIO;
+            cancel_incoming_locked(s);
+            return 0;
         }
 
         bdrv_dirty_bitmap_deserialize_part(s->bitmap, buf, first_byte, nr_bytes,
                                            false);
-        g_free(buf);
     }
 
     return 0;
@@ -700,14 +768,16 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
             error_report("Unable to read node name string");
             return -EINVAL;
         }
-        s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err);
-        if (!s->bs) {
-            error_report_err(local_err);
-            return -EINVAL;
+        if (!s->cancelled) {
+            s->bs = bdrv_lookup_bs(s->node_name, s->node_name, &local_err);
+            if (!s->bs) {
+                error_report_err(local_err);
+                cancel_incoming_locked(s);
+            }
         }
-    } else if (!s->bs && !nothing) {
+    } else if (!s->bs && !nothing && !s->cancelled) {
         error_report("Error: block device name is not set");
-        return -EINVAL;
+        cancel_incoming_locked(s);
     }
 
     if (s->flags & DIRTY_BITMAP_MIG_FLAG_BITMAP_NAME) {
@@ -715,24 +785,38 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s)
             error_report("Unable to read bitmap name string");
             return -EINVAL;
         }
-        s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
-
-        /* bitmap may be NULL here, it wouldn't be an error if it is the
-         * first occurrence of the bitmap */
-        if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) {
-            error_report("Error: unknown dirty bitmap "
-                         "'%s' for block device '%s'",
-                         s->bitmap_name, s->node_name);
-            return -EINVAL;
+        if (!s->cancelled) {
+            s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
+
+            /*
+             * bitmap may be NULL here, it wouldn't be an error if it is the
+             * first occurrence of the bitmap
+             */
+            if (!s->bitmap && !(s->flags & DIRTY_BITMAP_MIG_FLAG_START)) {
+                error_report("Error: unknown dirty bitmap "
+                             "'%s' for block device '%s'",
+                             s->bitmap_name, s->node_name);
+                cancel_incoming_locked(s);
+            }
         }
-    } else if (!s->bitmap && !nothing) {
+    } else if (!s->bitmap && !nothing && !s->cancelled) {
         error_report("Error: block device name is not set");
-        return -EINVAL;
+        cancel_incoming_locked(s);
     }
 
     return 0;
 }
 
+/*
+ * dirty_bitmap_load
+ *
+ * Load sequence of dirty bitmap chunks. Return error only on fatal io stream
+ * violations. On other errors just cancel bitmaps incoming migration and return
+ * 0.
+ *
+ * Note, than when incoming bitmap migration is canceled, we still must read all
+ * our chunks (and just ignore them), to not affect other migration objects.
+ */
 static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
 {
     DBMLoadState *s = &((DBMState *)opaque)->load;
@@ -741,12 +825,17 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
     trace_dirty_bitmap_load_enter();
 
     if (version_id != 1) {
+        QEMU_LOCK_GUARD(&s->lock);
+        cancel_incoming_locked(s);
         return -EINVAL;
     }
 
     do {
+        QEMU_LOCK_GUARD(&s->lock);
+
         ret = dirty_bitmap_load_header(f, s);
         if (ret < 0) {
+            cancel_incoming_locked(s);
             return ret;
         }
 
@@ -763,6 +852,7 @@ static int dirty_bitmap_load(QEMUFile *f, void *opaque, int version_id)
         }
 
         if (ret) {
+            cancel_incoming_locked(s);
             return ret;
         }
     } while (!(s->flags & DIRTY_BITMAP_MIG_FLAG_EOS));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:26:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:26:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16613.41114 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqr-0003cR-KJ; Fri, 30 Oct 2020 22:26:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16613.41114; Fri, 30 Oct 2020 22:26:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcqr-0003cK-Gy; Fri, 30 Oct 2020 22:26:29 +0000
Received: by outflank-mailman (input) for mailman id 16613;
 Fri, 30 Oct 2020 22:26:29 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcqr-0003cC-0T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cc1bf4ae-86fb-4fc0-81cb-7b245bbc05a3;
 Fri, 30 Oct 2020 22:26:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqq-00057E-2d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcqq-0004J2-0e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcqr-0003cC-0T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:29 +0000
X-Inumbo-ID: cc1bf4ae-86fb-4fc0-81cb-7b245bbc05a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cc1bf4ae-86fb-4fc0-81cb-7b245bbc05a3;
	Fri, 30 Oct 2020 22:26:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UnHPE79jfDQF4Nn1n0+hH6FoC4OVO/keg34OmCwZZlY=; b=JDp3kWdqIL+tDd9ezEGNq1pHHt
	fk4HVjEI6qtt5JE3R6iZDVf40BzhtHeJ821qh2H3jR2JCbBLiL7xc7FGnM8dq4AD+AxqUYnMwnyll
	h4cZb0UYJPcKNQRGOQbpb+RzCTo/av7yzf70fk4mk9XEg90+PKD9GwIPeWLt369cd1NM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqq-00057E-2d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcqq-0004J2-0e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/block-dirty-bitmap: cancel migration on shutdown
Message-Id: <E1kYcqq-0004J2-0e@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:28 +0000

commit 1499ab096950364d634418e7aefb562694d6c953
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:31 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    migration/block-dirty-bitmap: cancel migration on shutdown
    
    If target is turned off prior to postcopy finished, target crashes
    because busy bitmaps are found at shutdown.
    Canceling incoming migration helps, as it removes all unfinished (and
    therefore busy) bitmaps.
    
    Similarly on source we crash in bdrv_close_all which asserts that all
    bdrv states are removed, because bdrv states involved into dirty bitmap
    migration are referenced by it. So, we need to cancel outgoing
    migration as well.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-17-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 16 ++++++++++++++++
 migration/migration.c          | 13 +++++++++++++
 migration/migration.h          |  2 ++
 3 files changed, 31 insertions(+)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index f91015a4f8..1f675b792f 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -657,6 +657,22 @@ static void cancel_incoming_locked(DBMLoadState *s)
     s->bitmaps = NULL;
 }
 
+void dirty_bitmap_mig_cancel_outgoing(void)
+{
+    dirty_bitmap_do_save_cleanup(&dbm_state.save);
+}
+
+void dirty_bitmap_mig_cancel_incoming(void)
+{
+    DBMLoadState *s = &dbm_state.load;
+
+    qemu_mutex_lock(&s->lock);
+
+    cancel_incoming_locked(s);
+
+    qemu_mutex_unlock(&s->lock);
+}
+
 static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
 {
     GSList *item;
diff --git a/migration/migration.c b/migration/migration.c
index 1c61428988..8fe36339db 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -188,6 +188,19 @@ void migration_shutdown(void)
      */
     migrate_fd_cancel(current_migration);
     object_unref(OBJECT(current_migration));
+
+    /*
+     * Cancel outgoing migration of dirty bitmaps. It should
+     * at least unref used block nodes.
+     */
+    dirty_bitmap_mig_cancel_outgoing();
+
+    /*
+     * Cancel incoming migration of dirty bitmaps. Dirty bitmaps
+     * are non-critical data, and their loss never considered as
+     * something serious.
+     */
+    dirty_bitmap_mig_cancel_incoming();
 }
 
 /* For outgoing */
diff --git a/migration/migration.h b/migration/migration.h
index ab20c756f5..6c6a931d0d 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -335,6 +335,8 @@ void migrate_send_rp_recv_bitmap(MigrationIncomingState *mis,
 void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
 
 void dirty_bitmap_mig_before_vm_start(void);
+void dirty_bitmap_mig_cancel_outgoing(void);
+void dirty_bitmap_mig_cancel_incoming(void);
 void migrate_add_address(SocketAddress *address);
 
 int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:26:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:26:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16614.41119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcr2-0003ec-NI; Fri, 30 Oct 2020 22:26:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16614.41119; Fri, 30 Oct 2020 22:26:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcr2-0003eU-Jw; Fri, 30 Oct 2020 22:26:40 +0000
Received: by outflank-mailman (input) for mailman id 16614;
 Fri, 30 Oct 2020 22:26:39 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcr1-0003di-8x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f33c9833-856d-4680-b667-4f68749dd764;
 Fri, 30 Oct 2020 22:26:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcr0-00057P-64
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcr0-0004Jc-5K
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcr1-0003di-8x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:39 +0000
X-Inumbo-ID: f33c9833-856d-4680-b667-4f68749dd764
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f33c9833-856d-4680-b667-4f68749dd764;
	Fri, 30 Oct 2020 22:26:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1QtaHLOJrUz+mJW37fi9Mb3P9iNU8Nzo9ih1hvVagV8=; b=M8pA5264rc/8IZu+Z98asTqScm
	3y8l8LGGpvFFGSPCrEkXRVe8HQnWNoNAA23Ou0kc1zgZH8OpBZ6NiBoq8iXvaU0TJoBWO1QqRoMjq
	2v44wM4ga8haAlBracdCpeGGOJWI386huHU1gyTg2zgxFo1kKmlJ85I1a+7H4r72k8WM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcr0-00057P-64
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcr0-0004Jc-5K
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration/savevm: don't worry if bitmap migration postcopy failed
Message-Id: <E1kYcr0-0004Jc-5K@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:38 +0000

commit ee64722514fabcad2430982ade86180208f5be4f
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:32 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    migration/savevm: don't worry if bitmap migration postcopy failed
    
    First, if only bitmaps postcopy is enabled (and not ram postcopy)
    postcopy_pause_incoming crashes on an assertion
    assert(mis->to_src_file).
    
    And anyway, bitmaps postcopy is not prepared to be somehow recovered.
    The original idea instead is that if bitmaps postcopy failed, we just
    lose some bitmaps, which is not critical. So, on failure we just need
    to remove unfinished bitmaps and guest should continue execution on
    destination.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-18-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 migration/savevm.c | 37 ++++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 45c9dd9d8a..a843d202b5 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1813,6 +1813,9 @@ static void *postcopy_ram_listen_thread(void *opaque)
     MigrationIncomingState *mis = migration_incoming_get_current();
     QEMUFile *f = mis->from_src_file;
     int load_res;
+    MigrationState *migr = migrate_get_current();
+
+    object_ref(OBJECT(migr));
 
     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,
                                    MIGRATION_STATUS_POSTCOPY_ACTIVE);
@@ -1839,11 +1842,24 @@ static void *postcopy_ram_listen_thread(void *opaque)
 
     trace_postcopy_ram_listen_thread_exit();
     if (load_res < 0) {
-        error_report("%s: loadvm failed: %d", __func__, load_res);
         qemu_file_set_error(f, load_res);
-        migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
-                                       MIGRATION_STATUS_FAILED);
-    } else {
+        dirty_bitmap_mig_cancel_incoming();
+        if (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING &&
+            !migrate_postcopy_ram() && migrate_dirty_bitmaps())
+        {
+            error_report("%s: loadvm failed during postcopy: %d. All states "
+                         "are migrated except dirty bitmaps. Some dirty "
+                         "bitmaps may be lost, and present migrated dirty "
+                         "bitmaps are correctly migrated and valid.",
+                         __func__, load_res);
+            load_res = 0; /* prevent further exit() */
+        } else {
+            error_report("%s: loadvm failed: %d", __func__, load_res);
+            migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE,
+                                           MIGRATION_STATUS_FAILED);
+        }
+    }
+    if (load_res >= 0) {
         /*
          * This looks good, but it's possible that the device loading in the
          * main thread hasn't finished yet, and so we might not be in 'RUN'
@@ -1879,6 +1895,8 @@ static void *postcopy_ram_listen_thread(void *opaque)
     mis->have_listen_thread = false;
     postcopy_state_set(POSTCOPY_INCOMING_END);
 
+    object_unref(OBJECT(migr));
+
     return NULL;
 }
 
@@ -2437,6 +2455,8 @@ static bool postcopy_pause_incoming(MigrationIncomingState *mis)
 {
     trace_postcopy_pause_incoming();
 
+    assert(migrate_postcopy_ram());
+
     /* Clear the triggered bit to allow one recovery */
     mis->postcopy_recover_triggered = false;
 
@@ -2521,15 +2541,22 @@ out:
     if (ret < 0) {
         qemu_file_set_error(f, ret);
 
+        /* Cancel bitmaps incoming regardless of recovery */
+        dirty_bitmap_mig_cancel_incoming();
+
         /*
          * If we are during an active postcopy, then we pause instead
          * of bail out to at least keep the VM's dirty data.  Note
          * that POSTCOPY_INCOMING_LISTENING stage is still not enough,
          * during which we're still receiving device states and we
          * still haven't yet started the VM on destination.
+         *
+         * Only RAM postcopy supports recovery. Still, if RAM postcopy is
+         * enabled, canceled bitmaps postcopy will not affect RAM postcopy
+         * recovering.
          */
         if (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING &&
-            postcopy_pause_incoming(mis)) {
+            migrate_postcopy_ram() && postcopy_pause_incoming(mis)) {
             /* Reset f to point to the newly created channel */
             f = mis->from_src_file;
             goto retry;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:26:50 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:26:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16615.41122 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrC-0003fw-Oh; Fri, 30 Oct 2020 22:26:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16615.41122; Fri, 30 Oct 2020 22:26:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrC-0003fo-LS; Fri, 30 Oct 2020 22:26:50 +0000
Received: by outflank-mailman (input) for mailman id 16615;
 Fri, 30 Oct 2020 22:26:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrB-0003fd-CK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1cdfacbe-688d-47aa-a206-2904ed224b87;
 Fri, 30 Oct 2020 22:26:48 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrA-000581-AR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrA-0004KI-8q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrB-0003fd-CK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:49 +0000
X-Inumbo-ID: 1cdfacbe-688d-47aa-a206-2904ed224b87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1cdfacbe-688d-47aa-a206-2904ed224b87;
	Fri, 30 Oct 2020 22:26:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7br+hAXg09j3boY6pYXrFfMudQEG59OXzh91Hpc9Zt8=; b=s0/RaIVKCztGrRJdMkTR9h/H+F
	X3QXIzRE0qAkJw1o1nRFFnp674YhPU6yufsd7wW2prF1tP5aAhKF+4JNIQ1omXP/Zl5NWJ4KMvx5+
	El7nKNjQwOh3UKh97y9StprO2tuhdK52ltt1ObW7EFDpGCS2nR1ohYwH8jZ/rermCPkE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrA-000581-AR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrA-0004KI-8q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: prepare for new test-cases addition
Message-Id: <E1kYcrA-0004KI-8q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:48 +0000

commit 48f43820cd39f566536f0a5acc328c181f03f0d0
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:33 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: prepare for new test-cases addition
    
    Move future common part to start_postcopy() method. Move checking
    number of bitmaps to check_bitmap().
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-19-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index d8532e49da..355c0b2885 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -29,6 +29,8 @@ disk_b = os.path.join(iotests.test_dir, 'disk_b')
 size = '256G'
 fifo = os.path.join(iotests.test_dir, 'mig_fifo')
 
+granularity = 512
+nb_bitmaps = 15
 
 GiB = 1024 * 1024 * 1024
 
@@ -61,6 +63,15 @@ def event_dist(e1, e2):
     return event_seconds(e2) - event_seconds(e1)
 
 
+def check_bitmaps(vm, count):
+    result = vm.qmp('query-block')
+
+    if count == 0:
+        assert 'dirty-bitmaps' not in result['return'][0]
+    else:
+        assert len(result['return'][0]['dirty-bitmaps']) == count
+
+
 class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
     def tearDown(self):
         if debug:
@@ -101,10 +112,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a_events = []
         self.vm_b_events = []
 
-    def test_postcopy(self):
-        granularity = 512
-        nb_bitmaps = 15
-
+    def start_postcopy(self):
+        """ Run migration until RESUME event on target. Return this event. """
         for i in range(nb_bitmaps):
             result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                    name='bitmap{}'.format(i),
@@ -119,10 +128,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap0')
-        discards1_sha256 = result['return']['sha256']
+        self.discards1_sha256 = result['return']['sha256']
 
         # Check, that updating the bitmap by discards works
-        assert discards1_sha256 != empty_sha256
+        assert self.discards1_sha256 != empty_sha256
 
         # We want to calculate resulting sha256. Do it in bitmap0, so, disable
         # other bitmaps
@@ -135,7 +144,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
                                node='drive0', name='bitmap0')
-        all_discards_sha256 = result['return']['sha256']
+        self.all_discards_sha256 = result['return']['sha256']
 
         # Now, enable some bitmaps, to be updated during migration
         for i in range(2, nb_bitmaps, 2):
@@ -160,6 +169,10 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
 
         event_resume = self.vm_b.event_wait('RESUME')
         self.vm_b_events.append(event_resume)
+        return event_resume
+
+    def test_postcopy_success(self):
+        event_resume = self.start_postcopy()
 
         # enabled bitmaps should be updated
         apply_discards(self.vm_b, discards2)
@@ -180,18 +193,15 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
 
-        # Assert that bitmap migration is finished (check that successor bitmap
-        # is removed)
-        result = self.vm_b.qmp('query-block')
-        assert len(result['return'][0]['dirty-bitmaps']) == nb_bitmaps
+        check_bitmaps(self.vm_b, nb_bitmaps)
 
         # Check content of migrated bitmaps. Still, don't waste time checking
         # every bitmap
         for i in range(0, nb_bitmaps, 5):
             result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256',
                                    node='drive0', name='bitmap{}'.format(i))
-            sha256 = discards1_sha256 if i % 2 else all_discards_sha256
-            self.assert_qmp(result, 'return/sha256', sha256)
+            sha = self.discards1_sha256 if i % 2 else self.all_discards_sha256
+            self.assert_qmp(result, 'return/sha256', sha)
 
 
 if __name__ == '__main__':
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:00 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16616.41126 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrM-0003hD-QD; Fri, 30 Oct 2020 22:27:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16616.41126; Fri, 30 Oct 2020 22:27:00 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrM-0003h5-N9; Fri, 30 Oct 2020 22:27:00 +0000
Received: by outflank-mailman (input) for mailman id 16616;
 Fri, 30 Oct 2020 22:26:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrL-0003gw-GU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:59 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7046573e-c80d-4bad-98b1-bf2fb7edb777;
 Fri, 30 Oct 2020 22:26:58 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrK-000587-E1
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrK-0004Kz-D7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrL-0003gw-GU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:59 +0000
X-Inumbo-ID: 7046573e-c80d-4bad-98b1-bf2fb7edb777
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7046573e-c80d-4bad-98b1-bf2fb7edb777;
	Fri, 30 Oct 2020 22:26:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=550ZOKpVEevNVCGJfcdnD8crn79KcWurvxCAijcljpU=; b=BEv9jpewmVvSqqBTmS/MQ6/5Hq
	kvBGLFV53IyQR/5ZgGEoD1m1vePQqhz0XawYt6MJ0VNnlgfGzd26w+PnCDCFD4WYqNTuR3Gjlop1F
	FAreaTFg+vR/rar6zcFvzj2mbuEOiDgQKr/TYqFTrWPgpIEwpT+41O7nUJJWEiRKQ7lU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrK-000587-E1
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrK-0004Kz-D7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:26:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: check persistent bitmaps
Message-Id: <E1kYcrK-0004Kz-D7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:26:58 +0000

commit d4c6fcc01b59016e49adf3b12e23e65df212eba2
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:34 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: check persistent bitmaps
    
    Check that persistent bitmaps are not stored on source and that bitmaps
    are persistent on destination.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Message-Id: <20200727194236.19551-20-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199 | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 355c0b2885..5fd34f0fcd 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -117,7 +117,8 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         for i in range(nb_bitmaps):
             result = self.vm_a.qmp('block-dirty-bitmap-add', node='drive0',
                                    name='bitmap{}'.format(i),
-                                   granularity=granularity)
+                                   granularity=granularity,
+                                   persistent=True)
             self.assert_qmp(result, 'return', {})
 
         result = self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256',
@@ -193,6 +194,19 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             print('downtime:', downtime)
             print('postcopy_time:', postcopy_time)
 
+        # check that there are no bitmaps stored on source
+        self.vm_a_events += self.vm_a.get_qmp_events()
+        self.vm_a.shutdown()
+        self.vm_a.launch()
+        check_bitmaps(self.vm_a, 0)
+
+        # check that bitmaps are migrated and persistence works
+        check_bitmaps(self.vm_b, nb_bitmaps)
+        self.vm_b.shutdown()
+        # recreate vm_b, so there is no incoming option, which prevents
+        # loading bitmaps from disk
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_b.launch()
         check_bitmaps(self.vm_b, nb_bitmaps)
 
         # Check content of migrated bitmaps. Still, don't waste time checking
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16617.41130 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrW-0003iR-SB; Fri, 30 Oct 2020 22:27:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16617.41130; Fri, 30 Oct 2020 22:27:10 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrW-0003iJ-Ok; Fri, 30 Oct 2020 22:27:10 +0000
Received: by outflank-mailman (input) for mailman id 16617;
 Fri, 30 Oct 2020 22:27:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrV-0003iA-DP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d20ca52d-6d98-4d0a-8fc0-de5816b96fb6;
 Fri, 30 Oct 2020 22:27:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrU-00058U-IO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcrU-0004Lj-H5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrV-0003iA-DP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:09 +0000
X-Inumbo-ID: d20ca52d-6d98-4d0a-8fc0-de5816b96fb6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d20ca52d-6d98-4d0a-8fc0-de5816b96fb6;
	Fri, 30 Oct 2020 22:27:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IRuznj18zpeFYzX4VCZmZ1Ttt4CI/N2rgxkLhBPi85I=; b=CzyHRQrafAwPUOo2Zmw4oL9FxE
	oz4t/23PEMgsUkZDQaVlYbt01C88WwbIwhUQheEcGyyd+2BgxvF/tAunz3ilS5WIexvf2XAgt3R+d
	3cx/7eUFHl1bbIzWUTpm4jYqNEO0s5RZEOlJTl16fLdgj9iN1vqMFUN+4sY4LOzOIK58=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrU-00058U-IO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcrU-0004Lj-H5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: add early shutdown case to bitmaps postcopy
Message-Id: <E1kYcrU-0004Lj-H5@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:08 +0000

commit 845b2204c969c90949d5b90765d754a7ca25dc56
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:35 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: add early shutdown case to bitmaps postcopy
    
    Previous patches fixed two crashes which may occur on shutdown prior to
    bitmaps postcopy finished. Check that it works now.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-21-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199     | 24 ++++++++++++++++++++++++
 tests/qemu-iotests/199.out |  4 ++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 5fd34f0fcd..140930b2b1 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -217,6 +217,30 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
             sha = self.discards1_sha256 if i % 2 else self.all_discards_sha256
             self.assert_qmp(result, 'return/sha256', sha)
 
+    def test_early_shutdown_destination(self):
+        self.start_postcopy()
+
+        self.vm_b_events += self.vm_b.get_qmp_events()
+        self.vm_b.shutdown()
+        # recreate vm_b, so there is no incoming option, which prevents
+        # loading bitmaps from disk
+        self.vm_b = iotests.VM(path_suffix='b').add_drive(disk_b)
+        self.vm_b.launch()
+        check_bitmaps(self.vm_b, 0)
+
+        # Bitmaps will be lost if we just shutdown the vm, as they are marked
+        # to skip storing to disk when prepared for migration. And that's
+        # correct, as actual data may be modified in target vm, so we play
+        # safe.
+        # Still, this mark would be taken away if we do 'cont', and bitmaps
+        # become persistent again. (see iotest 169 for such behavior case)
+        result = self.vm_a.qmp('query-status')
+        assert not result['return']['running']
+        self.vm_a_events += self.vm_a.get_qmp_events()
+        self.vm_a.shutdown()
+        self.vm_a.launch()
+        check_bitmaps(self.vm_a, 0)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index ae1213e6f8..fbc63e62f8 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-.
+..
 ----------------------------------------------------------------------
-Ran 1 tests
+Ran 2 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16618.41134 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrg-0003jj-Tf; Fri, 30 Oct 2020 22:27:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16618.41134; Fri, 30 Oct 2020 22:27:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrg-0003jb-QQ; Fri, 30 Oct 2020 22:27:20 +0000
Received: by outflank-mailman (input) for mailman id 16618;
 Fri, 30 Oct 2020 22:27:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrf-0003jS-Sx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8946be37-19a6-4022-a68b-14eafe0f371d;
 Fri, 30 Oct 2020 22:27:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcre-00058f-MH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcre-0004ML-LI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrf-0003jS-Sx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:19 +0000
X-Inumbo-ID: 8946be37-19a6-4022-a68b-14eafe0f371d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8946be37-19a6-4022-a68b-14eafe0f371d;
	Fri, 30 Oct 2020 22:27:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SswnTj3/E4T/ZXzSqsbtjv2VnAZnivjlMm1MJlo60/I=; b=mCCbr/3rZIs4jik5oGCtEz7P6P
	2XNEideNORBDkmF+9judFOU9QBP4DOJ1R+0pVcJpR1+7x41XnKa+uGLsHSPuTNE1twIOrjOVgITNU
	xcV6dEd4EqwcXmwhqTWg1VZascp5PUXl/0bCWHej4ClQipNpB6IDyIMUI6E1+hvqVnEA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcre-00058f-MH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcre-0004ML-LI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qemu-iotests/199: add source-killed case to bitmaps postcopy
Message-Id: <E1kYcre-0004ML-LI@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:18 +0000

commit 058a08a658ebe152526ea41093679cdb0004abb3
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 22:42:36 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:41:34 2020 -0500

    qemu-iotests/199: add source-killed case to bitmaps postcopy
    
    Previous patches fixes behavior of bitmaps migration, so that errors
    are handled by just removing unfinished bitmaps, and not fail or try to
    recover postcopy migration. Add corresponding test.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727194236.19551-22-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/199     | 15 +++++++++++++++
 tests/qemu-iotests/199.out |  4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 140930b2b1..58fad872a1 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -241,6 +241,21 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         check_bitmaps(self.vm_a, 0)
 
+    def test_early_kill_source(self):
+        self.start_postcopy()
+
+        self.vm_a_events = self.vm_a.get_qmp_events()
+        self.vm_a.kill()
+
+        self.vm_a.launch()
+
+        match = {'data': {'status': 'completed'}}
+        e_complete = self.vm_b.event_wait('MIGRATION', match=match)
+        self.vm_b_events.append(e_complete)
+
+        check_bitmaps(self.vm_a, 0)
+        check_bitmaps(self.vm_b, 0)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index fbc63e62f8..8d7e996700 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-..
+...
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16619.41138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrq-0003l7-Uu; Fri, 30 Oct 2020 22:27:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16619.41138; Fri, 30 Oct 2020 22:27:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcrq-0003ky-Rw; Fri, 30 Oct 2020 22:27:30 +0000
Received: by outflank-mailman (input) for mailman id 16619;
 Fri, 30 Oct 2020 22:27:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrp-0003kl-JL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 55e101fa-acc9-4d64-b2d1-342b275a7164;
 Fri, 30 Oct 2020 22:27:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcro-00058o-QI
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcro-0004My-P3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrp-0003kl-JL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:29 +0000
X-Inumbo-ID: 55e101fa-acc9-4d64-b2d1-342b275a7164
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 55e101fa-acc9-4d64-b2d1-342b275a7164;
	Fri, 30 Oct 2020 22:27:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hxIMpOu6l+xv6CH/e/MqXR92WaFluKYyWYGa8Fj5AJE=; b=xvTkJ+/kAWhUNwjg2OESEhv5ha
	8XZdSF3B71eNEbCzTjhF2HU57yo8ma6/fdGN/Rf0T/h8RYYlS3FeH2DsKi+1IiZIVqEBH7WwxsIJQ
	k2QGwH4VCoaumxefhRCHwbUAPwQrzEE6AbbE3teZTy2xyD0CRvTAKg3LHWFsvQbCmDVw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcro-00058o-QI
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcro-0004My-P3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Adjust which migration tests are quick
Message-Id: <E1kYcro-0004My-P3@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:28 +0000

commit fbd1c1b6426019ab4410f9d01eaa1a8c6394491f
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 27 14:51:17 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:42:13 2020 -0500

    iotests: Adjust which migration tests are quick
    
    A quick run of './check -qcow2 -g migration' shows that test 169 is
    NOT quick, but meanwhile several other tests ARE quick.  Let's adjust
    the test designations accordingly.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727195117.132151-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/group | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 1d0252e1f0..806044642c 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -112,7 +112,7 @@
 088 rw quick
 089 rw auto quick
 090 rw auto quick
-091 rw migration
+091 rw migration quick
 092 rw quick
 093 throttle
 094 rw quick
@@ -186,7 +186,7 @@
 162 quick
 163 rw
 165 rw quick
-169 rw quick migration
+169 rw migration
 170 rw auto quick
 171 rw quick
 172 auto
@@ -197,9 +197,9 @@
 177 rw auto quick
 178 img
 179 rw auto quick
-181 rw auto migration
+181 rw auto migration quick
 182 rw quick
-183 rw migration
+183 rw migration quick
 184 rw auto quick
 185 rw
 186 rw auto
@@ -216,9 +216,9 @@
 198 rw
 199 rw migration
 200 rw
-201 rw migration
+201 rw migration quick
 202 rw quick
-203 rw auto migration
+203 rw auto migration quick
 204 rw quick
 205 rw quick
 206 rw
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16620.41142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcs1-0003n4-1m; Fri, 30 Oct 2020 22:27:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16620.41142; Fri, 30 Oct 2020 22:27:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcs0-0003mv-Uu; Fri, 30 Oct 2020 22:27:40 +0000
Received: by outflank-mailman (input) for mailman id 16620;
 Fri, 30 Oct 2020 22:27:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcrz-0003mI-Mm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 494a3d18-67f8-45f9-baae-8f8951411e52;
 Fri, 30 Oct 2020 22:27:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcry-0005AQ-UM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcry-0004PE-TP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcrz-0003mI-Mm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:39 +0000
X-Inumbo-ID: 494a3d18-67f8-45f9-baae-8f8951411e52
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 494a3d18-67f8-45f9-baae-8f8951411e52;
	Fri, 30 Oct 2020 22:27:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZuS6R9Cc6ywCb0w2fdpLmwi/M0Pyxwn9Ha7Hw4O9ISI=; b=37MpDp0//PehT5hRT456ayHbF8
	JB66Cqw67w5RZqzekO4ubzpClALs/3W3Msp6Xlm58MgU2yC6RmFYl5ACVpk3PIS6aScweDiGVqVmA
	23aCAG0NvS6R9rMYhXNPmAQRFA8tYZiGnVyD3pmZcXQyyYeldXc5SP80TUceG2RWMgLg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcry-0005AQ-UM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcry-0004PE-TP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] migration: Fix typos in bitmap migration comments
Message-Id: <E1kYcry-0004PE-TP@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:38 +0000

commit 37931e006f05cb768b78dcc47453b13f76ea43c5
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Mon Jul 27 15:32:06 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Jul 27 15:42:21 2020 -0500

    migration: Fix typos in bitmap migration comments
    
    Noticed while reviewing the file for newer patches.
    
    Fixes: b35ebdf076
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727203206.134996-1-eblake@redhat.com>
---
 migration/block-dirty-bitmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 1f675b792f..784330ebe1 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -97,7 +97,7 @@
 
 #define DIRTY_BITMAP_MIG_START_FLAG_ENABLED          0x01
 #define DIRTY_BITMAP_MIG_START_FLAG_PERSISTENT       0x02
-/* 0x04 was "AUTOLOAD" flags on elder versions, no it is ignored */
+/* 0x04 was "AUTOLOAD" flags on older versions, now it is ignored */
 #define DIRTY_BITMAP_MIG_START_FLAG_RESERVED_MASK    0xf8
 
 /* State of one bitmap during save process */
@@ -180,7 +180,7 @@ static uint32_t qemu_get_bitmap_flags(QEMUFile *f)
 
 static void qemu_put_bitmap_flags(QEMUFile *f, uint32_t flags)
 {
-    /* The code currently do not send flags more than one byte */
+    /* The code currently does not send flags as more than one byte */
     assert(!(flags & (0xffffff00 | DIRTY_BITMAP_MIG_EXTRA_FLAGS)));
 
     qemu_put_byte(f, flags);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:27:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:27:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16621.41146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsB-0003oM-38; Fri, 30 Oct 2020 22:27:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16621.41146; Fri, 30 Oct 2020 22:27:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsB-0003oD-09; Fri, 30 Oct 2020 22:27:51 +0000
Received: by outflank-mailman (input) for mailman id 16621;
 Fri, 30 Oct 2020 22:27:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcsA-0003o2-3n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 30c5e0a5-3b3a-4f24-b4fd-a3ff14afda50;
 Fri, 30 Oct 2020 22:27:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcs9-0005BC-2p
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcs9-0004Pw-1G
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:49 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcsA-0003o2-3n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:50 +0000
X-Inumbo-ID: 30c5e0a5-3b3a-4f24-b4fd-a3ff14afda50
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 30c5e0a5-3b3a-4f24-b4fd-a3ff14afda50;
	Fri, 30 Oct 2020 22:27:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uomEPbKA7AlJOpysdHs+YJUFslR6zOR0oB+xqj0/lQg=; b=gzyLlWxBbWeGREZySHkv2EZtT4
	x3kcnGPEEYbhcEZcYnXj9p4uMI3bMe7e4c5ZUSfffaieWW253357M15y2j2qoiTdQszJYATPlyDhZ
	ir28f3W3fX+ZmU1oRNg1wgQxezS20b+cWgikpFVOUVWC/FRPDcNEwqriAom0uriB1egA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcs9-0005BC-2p
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcs9-0004Pw-1G
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-27' into staging
Message-Id: <E1kYcs9-0004Pw-1G@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:49 +0000

commit 264991512193ee50e27d43e66f832d5041cf3b28
Merge: 1b242c3b1ec7c6011901b4f3b4b0876e31746afb 37931e006f05cb768b78dcc47453b13f76ea43c5
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 14:38:17 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 14:38:17 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-07-27' into staging
    
    bitmaps patches for 2020-07-27
    
    - Improve handling of various post-copy bitmap migration scenarios. A lost
    bitmap should merely mean that the next backup must be full rather than
    incremental, rather than abruptly breaking the entire guest migration.
    - Associated iotest improvements
    
    # gpg: Signature made Mon 27 Jul 2020 21:46:17 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-07-27: (24 commits)
      migration: Fix typos in bitmap migration comments
      iotests: Adjust which migration tests are quick
      qemu-iotests/199: add source-killed case to bitmaps postcopy
      qemu-iotests/199: add early shutdown case to bitmaps postcopy
      qemu-iotests/199: check persistent bitmaps
      qemu-iotests/199: prepare for new test-cases addition
      migration/savevm: don't worry if bitmap migration postcopy failed
      migration/block-dirty-bitmap: cancel migration on shutdown
      migration/block-dirty-bitmap: relax error handling in incoming part
      migration/block-dirty-bitmap: keep bitmap state for all bitmaps
      migration/block-dirty-bitmap: simplify dirty_bitmap_load_complete
      migration/block-dirty-bitmap: rename finish_lock to just lock
      migration/block-dirty-bitmap: refactor state global variables
      migration/block-dirty-bitmap: move mutex init to dirty_bitmap_mig_init
      migration/block-dirty-bitmap: rename dirty_bitmap_mig_cleanup
      migration/block-dirty-bitmap: rename state structure types
      migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start
      qemu-iotests/199: increase postcopy period
      qemu-iotests/199: change discard patterns
      qemu-iotests/199: improve performance: set bitmap by discard
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/qcow2.c                  |   2 +-
 docs/interop/qcow2.txt         |   2 +-
 migration/block-dirty-bitmap.c | 474 ++++++++++++++++++++++++++---------------
 migration/migration.c          |  15 +-
 migration/migration.h          |   3 +-
 migration/savevm.c             |  37 +++-
 tests/qemu-iotests/199         | 250 +++++++++++++++++-----
 tests/qemu-iotests/199.out     |   4 +-
 tests/qemu-iotests/group       |  12 +-
 9 files changed, 555 insertions(+), 244 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16622.41150 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsM-0003rg-4O; Fri, 30 Oct 2020 22:28:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16622.41150; Fri, 30 Oct 2020 22:28:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsM-0003rY-1Z; Fri, 30 Oct 2020 22:28:02 +0000
Received: by outflank-mailman (input) for mailman id 16622;
 Fri, 30 Oct 2020 22:28:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcsK-0003rN-FS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 0b16de4d-3947-432d-880a-cc0586330934;
 Fri, 30 Oct 2020 22:27:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsJ-0005BI-De
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsJ-0004Qv-Cu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcsK-0003rN-FS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:00 +0000
X-Inumbo-ID: 0b16de4d-3947-432d-880a-cc0586330934
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 0b16de4d-3947-432d-880a-cc0586330934;
	Fri, 30 Oct 2020 22:27:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=R8rnS8U0NEojf5X2VSMMxnly9nCRN9mkjdlMZSLRNwo=; b=tDDVRdxvTvOq5Uvxb3SvL1vLgk
	iDixSagzpBIRb9OcYah0bQE3bdEWjzDcOQBkLPiq9PvzIZxyaEzbXJMQUt97ag7glSDh3nLdiSlkI
	bU/QncOeu4SEvu09gQ4N4ANflEc5uSKPWln7LhNQ3P5dQzwWV/iWuiB73NwQ9Vy/y98M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsJ-0005BI-De
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsJ-0004Qv-Cu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:27:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qga-win: fix "guest-get-fsinfo" wrong filesystem type
Message-Id: <E1kYcsJ-0004Qv-Cu@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:27:59 +0000

commit 3aaebc0cce4a4963f331f45643e17266646411e6
Author:     Basil Salman <bsalman@redhat.com>
AuthorDate: Thu Apr 30 15:11:40 2020 +0300
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 27 18:03:55 2020 -0500

    qga-win: fix "guest-get-fsinfo" wrong filesystem type
    
    This patch handles the case where unmounted volumes exist,
    where in that case GetVolumePathNamesForVolumeName returns
    empty path, GetVolumeInformation will use the current working
    directory instead.
    This patch fixes the issue by opening a handle to the volumes,
    and using GetVolumeInformationByHandleW instead.
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1746667
    
    Signed-off-by: Basil Salman <bsalman@redhat.com>
    Signed-off-by: Basil Salman <basil@daynix.com>
    *fix crash when guest_build_fsinfo() sets errp multiple times
    *make new error message more distinct from existing ones
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-win32.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index aaa71f147b..15c9d7944b 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -958,11 +958,13 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
 {
     DWORD info_size;
     char mnt, *mnt_point;
+    wchar_t wfs_name[32];
     char fs_name[32];
-    char vol_info[MAX_PATH+1];
+    wchar_t vol_info[MAX_PATH + 1];
     size_t len;
     uint64_t i64FreeBytesToCaller, i64TotalBytes, i64FreeBytes;
     GuestFilesystemInfo *fs = NULL;
+    HANDLE hLocalDiskHandle = NULL;
 
     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0, &info_size);
     if (GetLastError() != ERROR_MORE_DATA) {
@@ -977,18 +979,27 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
         goto free;
     }
 
+    hLocalDiskHandle = CreateFile(guid, 0 , 0, NULL, OPEN_EXISTING,
+                                  FILE_ATTRIBUTE_NORMAL |
+                                  FILE_FLAG_BACKUP_SEMANTICS, NULL);
+    if (INVALID_HANDLE_VALUE == hLocalDiskHandle) {
+        error_setg_win32(errp, GetLastError(), "failed to get handle for volume");
+        goto free;
+    }
+
     len = strlen(mnt_point);
     mnt_point[len] = '\\';
     mnt_point[len+1] = 0;
-    if (!GetVolumeInformation(mnt_point, vol_info, sizeof(vol_info), NULL, NULL,
-                              NULL, (LPSTR)&fs_name, sizeof(fs_name))) {
+
+    if (!GetVolumeInformationByHandleW(hLocalDiskHandle, vol_info,
+                                       sizeof(vol_info), NULL, NULL, NULL,
+                                       (LPWSTR) & wfs_name, sizeof(wfs_name))) {
         if (GetLastError() != ERROR_NOT_READY) {
             error_setg_win32(errp, GetLastError(), "failed to get volume info");
         }
         goto free;
     }
 
-    fs_name[sizeof(fs_name) - 1] = 0;
     fs = g_malloc(sizeof(*fs));
     fs->name = g_strdup(guid);
     fs->has_total_bytes = false;
@@ -1007,9 +1018,11 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
             fs->has_used_bytes = true;
         }
     }
+    wcstombs(fs_name, wfs_name, sizeof(wfs_name));
     fs->type = g_strdup(fs_name);
     fs->disk = build_guest_disk_info(guid, errp);
 free:
+    CloseHandle(hLocalDiskHandle);
     g_free(mnt_point);
     return fs;
 }
@@ -1027,8 +1040,12 @@ GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp)
     }
 
     do {
-        GuestFilesystemInfo *info = build_guest_fsinfo(guid, errp);
-        if (info == NULL) {
+        Error *local_err = NULL;
+        GuestFilesystemInfo *info = build_guest_fsinfo(guid, &local_err);
+        if (local_err) {
+            g_debug("failed to get filesystem info, ignoring error: %s",
+                    error_get_pretty(local_err));
+            error_free(local_err);
             continue;
         }
         new = g_malloc(sizeof(*ret));
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16623.41154 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsV-0003sp-5x; Fri, 30 Oct 2020 22:28:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16623.41154; Fri, 30 Oct 2020 22:28:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsV-0003sh-2z; Fri, 30 Oct 2020 22:28:11 +0000
Received: by outflank-mailman (input) for mailman id 16623;
 Fri, 30 Oct 2020 22:28:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcsU-0003sY-9Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 02dae8b7-d165-4c2e-a6e6-bb3c065da4f9;
 Fri, 30 Oct 2020 22:28:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsT-0005Bd-HO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsT-0004Rk-GQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:09 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcsU-0003sY-9Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:10 +0000
X-Inumbo-ID: 02dae8b7-d165-4c2e-a6e6-bb3c065da4f9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 02dae8b7-d165-4c2e-a6e6-bb3c065da4f9;
	Fri, 30 Oct 2020 22:28:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZbynX0Yf79n5dDjgnAZQi1wVgvLJlIU8xdIxMWKgv4E=; b=Nm9pX60CthIDVe/psVH6BwxxPI
	lbA0lcgCaqh3QFT8oM0i159FJUICedX3YiN8FntgMU/BkTZ+j5iRrFeLsihcj9zXb2aLLwc7ue7Zm
	z1x2OcWW2frc62SyiZqvEEl+2R8YKkuvU2eXEuw4TL7E3vm0Fl5owAveZ1DxRGHVynZQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsT-0005Bd-HO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsT-0004Rk-GQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qga/qapi-schema: Document -1 for invalid PCI address fields
Message-Id: <E1kYcsT-0004Rk-GQ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:28:09 +0000

commit ba620541d0db7e3433babbd97c0413a371e6fb4a
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 22 06:40:25 2020 +0200
Commit:     Michael Roth <mdroth@linux.vnet.ibm.com>
CommitDate: Mon Jul 27 18:03:55 2020 -0500

    qga/qapi-schema: Document -1 for invalid PCI address fields
    
    The "guest-get-fsinfo" could also be used for non-PCI devices in the
    future. And the code in GuestPCIAddress() in qga/commands-win32.c seems
    to be using "-1" for fields that it can not determine already. Thus
    let's properly document "-1" as value for invalid PCI address fields.
    
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/qapi-schema.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 4be9aad48e..408a662ea5 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -846,7 +846,7 @@
 ##
 # @GuestDiskAddress:
 #
-# @pci-controller: controller's PCI address
+# @pci-controller: controller's PCI address (fields are set to -1 if invalid)
 # @bus-type: bus type
 # @bus: bus id
 # @target: target id
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16624.41158 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsg-0003uD-7s; Fri, 30 Oct 2020 22:28:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16624.41158; Fri, 30 Oct 2020 22:28:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsg-0003u4-4c; Fri, 30 Oct 2020 22:28:22 +0000
Received: by outflank-mailman (input) for mailman id 16624;
 Fri, 30 Oct 2020 22:28:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcse-0003tu-K7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5034f705-d6ab-42c9-bb4f-2ec89b698ca0;
 Fri, 30 Oct 2020 22:28:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsd-0005Bk-Lb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsd-0004SO-K7
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcse-0003tu-K7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:20 +0000
X-Inumbo-ID: 5034f705-d6ab-42c9-bb4f-2ec89b698ca0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5034f705-d6ab-42c9-bb4f-2ec89b698ca0;
	Fri, 30 Oct 2020 22:28:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wGFeZ5GzlwJYZWyKUv9E2gUH/fT0g392PWX+1lhfzDQ=; b=5DUWA4mwdQmiqPwGpiU2FAKMIb
	Se4cSQclyAxajdK3vU8pi7ed/JY1ojvdDe0wB0fg4VykcgcPApvwtwoof+rLKlvHB6J39zYjhn/PK
	HbMd0Iv468tojcV81pDHz7xuiHvS6vUcMdYvJJzv8Pm3b0HxtFiyp2HL6VNPk5HVXt+Q=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsd-0005Bk-Lb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsd-0004SO-K7
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-27-tag' into staging
Message-Id: <E1kYcsd-0004SO-K7@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:28:19 +0000

commit 1e0e0917e5df765575a72afd35a7183e65f505ac
Merge: 264991512193ee50e27d43e66f832d5041cf3b28 ba620541d0db7e3433babbd97c0413a371e6fb4a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 15:24:31 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 15:24:31 2020 +0100

    Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-07-27-tag' into staging
    
    qemu-ga patch queue for hard-freeze
    
    * document use of -1 when pci_controller field can't be retrieved for
      guest-get-fsinfo
    * fix incorrect filesystem type reporting on w32 for guest-get-fsinfo
      when a volume is not mounted
    
    # gpg: Signature made Tue 28 Jul 2020 00:16:50 BST
    # gpg:                using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584
    # gpg:                issuer "mdroth@linux.vnet.ibm.com"
    # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full]
    # gpg:                 aka "Michael Roth <mdroth@utexas.edu>" [full]
    # gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full]
    # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584
    
    * remotes/mdroth/tags/qga-pull-2020-07-27-tag:
      qga/qapi-schema: Document -1 for invalid PCI address fields
      qga-win: fix "guest-get-fsinfo" wrong filesystem type
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 qga/commands-win32.c | 29 +++++++++++++++++++++++------
 qga/qapi-schema.json |  2 +-
 2 files changed, 24 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16625.41162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsq-0003vS-97; Fri, 30 Oct 2020 22:28:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16625.41162; Fri, 30 Oct 2020 22:28:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcsq-0003vK-65; Fri, 30 Oct 2020 22:28:32 +0000
Received: by outflank-mailman (input) for mailman id 16625;
 Fri, 30 Oct 2020 22:28:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcso-0003v7-S0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 50b02616-6b0a-4e2b-bf0c-e8bc61b83fd6;
 Fri, 30 Oct 2020 22:28:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcso-0005Bt-0q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcso-0004TZ-02
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcso-0003v7-S0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
X-Inumbo-ID: 50b02616-6b0a-4e2b-bf0c-e8bc61b83fd6
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 50b02616-6b0a-4e2b-bf0c-e8bc61b83fd6;
	Fri, 30 Oct 2020 22:28:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QNSY8vjX7bRNphZu/aIhvpk31qvn0+S/Xy9HBpPoPbY=; b=6hbNnLwxdiR2DYoSoAx7KgDFB5
	ZXZdYavTSv7VxwETH3BXk9DiANaRZGm/+ssoX8fGooPMrOUtvqOeShH2Viw/e5cPlVzNata/H/Voc
	zaHLnCFUbuuEZcjuz24EruxWjrHlLqSme0NlFm56/phsg79LzctFxgN4XQVgyVR39nAk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcso-0005Bt-0q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcso-0004TZ-02
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-pci: fix wrong index in virtio_pci_queue_enabled
Message-Id: <E1kYcso-0004TZ-02@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:28:30 +0000

commit a48aaf882b100b30111b5c7c75e1d9e83fe76cfd
Author:     Yuri Benditovich <yuri.benditovich@daynix.com>
AuthorDate: Mon Jul 27 17:38:07 2020 +0300
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:54:46 2020 +0800

    virtio-pci: fix wrong index in virtio_pci_queue_enabled
    
    We should use the index passed by the caller instead of the queue_sel
    when checking the enablement of a specific virtqueue.
    
    This is reported in https://bugzilla.redhat.com/show_bug.cgi?id=1702608
    
    Fixes: f19bcdfedd53 ("virtio-pci: implement queue_enabled method")
    Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/virtio/virtio-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4ad3ad81a2..ccdf54e81c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1113,7 +1113,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
 
     if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
-        return proxy->vqs[vdev->queue_sel].enabled;
+        return proxy->vqs[n].enabled;
     }
 
     return virtio_queue_enabled_legacy(vdev, n);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16626.41165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYct0-0003xI-Ao; Fri, 30 Oct 2020 22:28:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16626.41165; Fri, 30 Oct 2020 22:28:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYct0-0003xD-7W; Fri, 30 Oct 2020 22:28:42 +0000
Received: by outflank-mailman (input) for mailman id 16626;
 Fri, 30 Oct 2020 22:28:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcsz-0003wz-08
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8f4166ee-8a41-4e35-aae1-faf8f9ef00c1;
 Fri, 30 Oct 2020 22:28:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsy-0005CR-4N
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcsy-0004UK-3e
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcsz-0003wz-08
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:41 +0000
X-Inumbo-ID: 8f4166ee-8a41-4e35-aae1-faf8f9ef00c1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8f4166ee-8a41-4e35-aae1-faf8f9ef00c1;
	Fri, 30 Oct 2020 22:28:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xS+GBYlPPze0cYvhixxqEiKw5TMBFhH05LRNLnGQZdQ=; b=SnoR9glgezazfMenYu+939cp4D
	0x8+/yRfYf/YLo5+EPQFmt6vRg14aGd+ftDS7GNxBXemFtHqn7sQ+ON5gBP2HJd/8VX/jMIZFyKQ+
	Zw3hkxW4DJ872zN2EdslavXhf0HOrloSu6CFdy2NIg111g73Ma5KLKhjt+mR206kPdz0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsy-0005CR-4N
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcsy-0004UK-3e
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-net: check the existence of peer before accessing vDPA config
Message-Id: <E1kYcsy-0004UK-3e@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:28:40 +0000

commit c546ecf27da1114d0274abe600cc6bde6584e659
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Sat Jul 25 08:13:17 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:57:58 2020 +0800

    virtio-net: check the existence of peer before accessing vDPA config
    
    We try to check whether a peer is VDPA in order to get config from
    there - with no peer, this leads to a NULL
    pointer dereference. Add a check before trying to access the peer
    type. No peer means not VDPA.
    
    Fixes: 108a64818e69b ("vhost-vdpa: introduce vhost-vdpa backend")
    Cc: Cindy Lu <lulu@redhat.com>
    Tested-by: Cornelia Huck <cohuck@redhat.com>
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 4895af1cbe..a1fe9e9285 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -125,6 +125,7 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
 {
     VirtIONet *n = VIRTIO_NET(vdev);
     struct virtio_net_config netcfg;
+    NetClientState *nc = qemu_get_queue(n->nic);
 
     int ret = 0;
     memset(&netcfg, 0 , sizeof(struct virtio_net_config));
@@ -142,13 +143,16 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
                  VIRTIO_NET_RSS_SUPPORTED_HASHES);
     memcpy(config, &netcfg, n->config_size);
 
-    NetClientState *nc = qemu_get_queue(n->nic);
-    if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
+    /*
+     * Is this VDPA? No peer means not VDPA: there's no way to
+     * disconnect/reconnect a VDPA peer.
+     */
+    if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
         ret = vhost_net_get_config(get_vhost_net(nc->peer), (uint8_t *)&netcfg,
-                             n->config_size);
-    if (ret != -1) {
-        memcpy(config, &netcfg, n->config_size);
-    }
+                                   n->config_size);
+        if (ret != -1) {
+            memcpy(config, &netcfg, n->config_size);
+        }
     }
 }
 
@@ -156,6 +160,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
 {
     VirtIONet *n = VIRTIO_NET(vdev);
     struct virtio_net_config netcfg = {};
+    NetClientState *nc = qemu_get_queue(n->nic);
 
     memcpy(&netcfg, config, n->config_size);
 
@@ -166,11 +171,14 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
         qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
     }
 
-    NetClientState *nc = qemu_get_queue(n->nic);
-    if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
-        vhost_net_set_config(get_vhost_net(nc->peer), (uint8_t *)&netcfg,
-                               0, n->config_size,
-                        VHOST_SET_CONFIG_TYPE_MASTER);
+    /*
+     * Is this VDPA? No peer means not VDPA: there's no way to
+     * disconnect/reconnect a VDPA peer.
+     */
+    if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_VDPA) {
+        vhost_net_set_config(get_vhost_net(nc->peer),
+                             (uint8_t *)&netcfg, 0, n->config_size,
+                             VHOST_SET_CONFIG_TYPE_MASTER);
       }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:28:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:28:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16627.41170 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctA-0003yo-EM; Fri, 30 Oct 2020 22:28:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16627.41170; Fri, 30 Oct 2020 22:28:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctA-0003yg-BI; Fri, 30 Oct 2020 22:28:52 +0000
Received: by outflank-mailman (input) for mailman id 16627;
 Fri, 30 Oct 2020 22:28:51 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYct9-0003yU-5q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 8ce83fc4-8fc9-495c-b46d-5ba939395798;
 Fri, 30 Oct 2020 22:28:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYct8-0005Ce-7n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYct8-0004V0-71
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:50 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYct9-0003yU-5q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:51 +0000
X-Inumbo-ID: 8ce83fc4-8fc9-495c-b46d-5ba939395798
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 8ce83fc4-8fc9-495c-b46d-5ba939395798;
	Fri, 30 Oct 2020 22:28:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LtuuQP2nNAKOdA02c/pPunhMdvmWBazTh+/wHwMOXlo=; b=dZRWKuiQX8oBbOJKG0IUnhnObz
	PjpbGTncA6p4/NyOWHRK92HSNbrULahiPBmZR/z3FHP+hH1/xyhgXM746sGxZH1g/glnerZ7YPgek
	6bdBzIaVs2CAq420Wa4Q+gH45Md6SD8SsXfBNSr+SzIbY1of0sVSK+iPgP5MObZI8y/0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYct8-0005Ce-7n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYct8-0004V0-71
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:28:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] net: forbid the reentrant RX
Message-Id: <E1kYct8-0004V0-71@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:28:50 +0000

commit 22dc8663d9fc7baa22100544c600b6285a63c7a3
Author:     Jason Wang <jasowang@redhat.com>
AuthorDate: Wed Jul 22 16:57:46 2020 +0800
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Jul 28 16:57:58 2020 +0800

    net: forbid the reentrant RX
    
    The memory API allows DMA into NIC's MMIO area. This means the NIC's
    RX routine must be reentrant. Instead of auditing all the NIC, we can
    simply detect the reentrancy and return early. The queue->delivering
    is set and cleared by qemu_net_queue_deliver() for other queue helpers
    to know whether the delivering in on going (NIC's receive is being
    called). We can check it and return early in qemu_net_queue_flush() to
    forbid reentrant RX.
    
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/queue.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/queue.c b/net/queue.c
index 0164727e39..19e32c80fd 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -250,6 +250,9 @@ void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)
 
 bool qemu_net_queue_flush(NetQueue *queue)
 {
+    if (queue->delivering)
+        return false;
+
     while (!QTAILQ_EMPTY(&queue->packets)) {
         NetPacket *packet;
         int ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16628.41174 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctK-000409-Fl; Fri, 30 Oct 2020 22:29:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16628.41174; Fri, 30 Oct 2020 22:29:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctK-000400-Cm; Fri, 30 Oct 2020 22:29:02 +0000
Received: by outflank-mailman (input) for mailman id 16628;
 Fri, 30 Oct 2020 22:29:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYctJ-0003zp-34
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b8c53b75-6059-4d1e-ad8d-fb816e2275a5;
 Fri, 30 Oct 2020 22:29:00 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctI-0005Ck-BE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctI-0004Va-AZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:00 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYctJ-0003zp-34
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:01 +0000
X-Inumbo-ID: b8c53b75-6059-4d1e-ad8d-fb816e2275a5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b8c53b75-6059-4d1e-ad8d-fb816e2275a5;
	Fri, 30 Oct 2020 22:29:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=NdD1XybyhjUub8nT9fvNa6rRHD6eIirDX30M15xgpZU=; b=xT9DSKKK6A4+VtZGQ/SAzyPQQX
	E/Ei+y5ptJat/jUs7HLrV9vDC+hLT8z3a0DR9WJqHaN7hWu2i6TmrblTClsK95BzIqrIJXqu2sBsJ
	1rNO9YORkKCw1Fya8LbqtSDg/H/va5JB5DeztNalRqOkTkF0wi0ErzeIiJZCz2GhPSTg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctI-0005Ck-BE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:00 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctI-0004Va-AZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:00 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYctI-0004Va-AZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:00 +0000

commit a466dd084f51cdc9da2e99361f674f98d7218559
Merge: 1e0e0917e5df765575a72afd35a7183e65f505ac 22dc8663d9fc7baa22100544c600b6285a63c7a3
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 16:28:22 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 16:28:22 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    Want to send earlier but most patches just come.
    
    - fix vhost-vdpa issues when no peer
    - fix virtio-pci queue enabling index value
    - forbid reentrant RX
    
    Changes from V1:
    
    - drop the patch that has been merged
    
    # gpg: Signature made Tue 28 Jul 2020 09:59:41 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      net: forbid the reentrant RX
      virtio-net: check the existence of peer before accessing vDPA config
      virtio-pci: fix wrong index in virtio_pci_queue_enabled
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/virtio-net.c    | 30 +++++++++++++++++++-----------
 hw/virtio/virtio-pci.c |  2 +-
 net/queue.c            |  3 +++
 3 files changed, 23 insertions(+), 12 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16629.41178 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctV-00041E-HT; Fri, 30 Oct 2020 22:29:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16629.41178; Fri, 30 Oct 2020 22:29:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctV-000416-EI; Fri, 30 Oct 2020 22:29:13 +0000
Received: by outflank-mailman (input) for mailman id 16629;
 Fri, 30 Oct 2020 22:29:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYctT-00040w-Gh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:11 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 28191101-33d5-4a73-b1e0-2c650b79969c;
 Fri, 30 Oct 2020 22:29:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctS-0005DA-Mc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctS-0004Wl-Lm
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYctT-00040w-Gh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:11 +0000
X-Inumbo-ID: 28191101-33d5-4a73-b1e0-2c650b79969c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 28191101-33d5-4a73-b1e0-2c650b79969c;
	Fri, 30 Oct 2020 22:29:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0abRQI7sICpMA+qGB4Po8n/Pt3rJS9D2lMvgWEBBTrY=; b=v8iftzvUQ1UMzlrTv0moIYjJAS
	n/a0PWEmk6Zq3A2l1M5t/ugWoC0zeg8OtLAmxBcpNe5X1lWgR8quWYSrojqXNj4PCBNwn9GVIkCZD
	Hhir/4Ew1eYiiR/otUU3bWZ0dwkGjIX9NlzypXlXedqwhaQnmNAxDW+4k2nhTIVeTHqo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctS-0005DA-Mc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctS-0004Wl-Lm
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: Ensure mmap_min_addr is non-zero
Message-Id: <E1kYctS-0004Wl-Lm@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:10 +0000

commit c9f8066697e0d3e77b97f6df423e9d6540b693be
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Fri Jul 24 14:23:14 2020 -0700
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:02:40 2020 +0200

    linux-user: Ensure mmap_min_addr is non-zero
    
    When the chroot does not have /proc mounted, we can read neither
    /proc/sys/vm/mmap_min_addr nor /proc/sys/maps.
    
    The enforcement of mmap_min_addr in the host kernel is done by
    the security module, and so does not apply to processes owned
    by root.  Which leads pgd_find_hole_fallback to succeed in probing
    a reservation at address 0.  Which confuses pgb_reserved_va to
    believe that guest_base has not actually been initialized.
    
    We don't actually want NULL addresses to become accessible, so
    make sure that mmap_min_addr is initialized with a non-zero value.
    
    Buglink: https://bugs.launchpad.net/qemu/+bug/1888728
    Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Acked-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200724212314.545877-1-richard.henderson@linaro.org>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 3597e99bb1..75c9785157 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -758,14 +758,26 @@ int main(int argc, char **argv, char **envp)
 
         if ((fp = fopen("/proc/sys/vm/mmap_min_addr", "r")) != NULL) {
             unsigned long tmp;
-            if (fscanf(fp, "%lu", &tmp) == 1) {
+            if (fscanf(fp, "%lu", &tmp) == 1 && tmp != 0) {
                 mmap_min_addr = tmp;
-                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n", mmap_min_addr);
+                qemu_log_mask(CPU_LOG_PAGE, "host mmap_min_addr=0x%lx\n",
+                              mmap_min_addr);
             }
             fclose(fp);
         }
     }
 
+    /*
+     * We prefer to not make NULL pointers accessible to QEMU.
+     * If we're in a chroot with no /proc, fall back to 1 page.
+     */
+    if (mmap_min_addr == 0) {
+        mmap_min_addr = qemu_host_page_size;
+        qemu_log_mask(CPU_LOG_PAGE,
+                      "host mmap_min_addr=0x%lx (fallback)\n",
+                      mmap_min_addr);
+    }
+
     /*
      * Prepare copy of argv vector for target.
      */
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16630.41181 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctf-00042b-Il; Fri, 30 Oct 2020 22:29:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16630.41181; Fri, 30 Oct 2020 22:29:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctf-00042T-Fq; Fri, 30 Oct 2020 22:29:23 +0000
Received: by outflank-mailman (input) for mailman id 16630;
 Fri, 30 Oct 2020 22:29:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYctd-00042D-S4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id a27a8dcc-2d90-4599-82dc-e79e35dc5c32;
 Fri, 30 Oct 2020 22:29:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctc-0005DG-Qb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctc-0004XS-Pu
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYctd-00042D-S4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:21 +0000
X-Inumbo-ID: a27a8dcc-2d90-4599-82dc-e79e35dc5c32
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id a27a8dcc-2d90-4599-82dc-e79e35dc5c32;
	Fri, 30 Oct 2020 22:29:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xosxBKFIApcr0iRckVcSubp2tCHGrdVGzF5PaqEoL1U=; b=3kPaA2QjtE46ngYzO+DFZzbVHk
	YFdn7h9vw8pp/A62tJBHvvM4tuTlWXM5WbvWChkpc1ooIUHRRkdGyS40MQ2iWV9owTDPkIRn/KaV2
	riesP7TsDh8VOQzcmi9/7+vsLLwF7Y+Jizp6BJATMspfRjRK9nmqNnJwjjYDuTrguaIE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctc-0005DG-Qb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctc-0004XS-Pu
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: Fix syscall rt_sigtimedwait() implementation
Message-Id: <E1kYctc-0004XS-Pu@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:20 +0000

commit 4d213001b356c4a24c05afbc72f4860088900627
Author:     Filip Bozuta <Filip.Bozuta@syrmia.com>
AuthorDate: Fri Jul 24 20:16:51 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:04:07 2020 +0200

    linux-user: Fix syscall rt_sigtimedwait() implementation
    
    Implementation of 'rt_sigtimedwait()' in 'syscall.c' uses the
    function 'target_to_host_timespec()' to transfer the value of
    'struct timespec' from target to host. However, the implementation
    doesn't check whether this conversion succeeds and thus can cause
    an unaproppriate error instead of the 'EFAULT (Bad address)' which
    is supposed to be set if the conversion from target to host fails.
    
    This was confirmed with the LTP test for rt_sigtimedwait:
    "/testcases/kernel/syscalls/rt_sigtimedwait/rt_sigtimedwait01.c"
    which causes an unapropriate error in test case "test_bad_adress3"
    which is run with a bad adress for the 'struct timespec' argument:
    
    FAIL: test_bad_address3 (349): Unexpected failure: EAGAIN/EWOULDBLOCK (11)
    
    The test fails with an unexptected errno 'EAGAIN/EWOULDBLOCK' instead
    of the expected EFAULT.
    
    After the changes from this patch, the test case is executed successfully
    along with the other LTP test cases for 'rt_sigtimedwait()':
    
    PASS: test_bad_address3 (349): Test passed
    
    Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <20200724181651.167819-1-Filip.Bozuta@syrmia.com>
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f5c4f6b95d..c1ebf7b8f3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8868,7 +8868,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             unlock_user(p, arg1, 0);
             if (arg3) {
                 puts = &uts;
-                target_to_host_timespec(puts, arg3);
+                if (target_to_host_timespec(puts, arg3)) {
+                    return -TARGET_EFAULT;
+                }
             } else {
                 puts = NULL;
             }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:33 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16631.41187 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctp-00043v-Kg; Fri, 30 Oct 2020 22:29:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16631.41187; Fri, 30 Oct 2020 22:29:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctp-00043m-HQ; Fri, 30 Oct 2020 22:29:33 +0000
Received: by outflank-mailman (input) for mailman id 16631;
 Fri, 30 Oct 2020 22:29:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYctn-00043a-Mn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f353f31d-f4ff-4ce7-ad53-5ad704aad6df;
 Fri, 30 Oct 2020 22:29:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctm-0005DP-UU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctm-0004Y9-Tn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYctn-00043a-Mn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:31 +0000
X-Inumbo-ID: f353f31d-f4ff-4ce7-ad53-5ad704aad6df
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f353f31d-f4ff-4ce7-ad53-5ad704aad6df;
	Fri, 30 Oct 2020 22:29:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PLP+S0Rxf537wwc8evl0V0jP2DqXjMCVCZcu0rmdwjo=; b=Cg4OPJ+96erT0NN7LsXmD5w/K4
	llcLMVsmss7kfQQFHlSIueln9s8abOVTxQr2NYtXv6ON6c8n8oum25rTSRqhmzv1mL+hs5qaQz9r3
	HTdS4XPm80Gtyar3gu0Vw0stzm8/0kJuaf7MBVv6TWYoJMI0T1ZD/39ByKVSz98dWXpI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctm-0005DP-UU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctm-0004Y9-Tn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] linux-user: Use getcwd syscall directly
Message-Id: <E1kYctm-0004Y9-Tn@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:30 +0000

commit 0f6bb1958f3aae0171996941df7fb7ea7536bb12
Author:     Andreas Schwab <schwab@suse.de>
AuthorDate: Thu Jul 23 12:27:13 2020 +0200
Commit:     Laurent Vivier <laurent@vivier.eu>
CommitDate: Mon Jul 27 22:05:34 2020 +0200

    linux-user: Use getcwd syscall directly
    
    The glibc getcwd function returns different errors than the getcwd
    syscall, which triggers an assertion failure in the glibc getcwd function
    when running under the emulation.
    
    When the syscall returns ENAMETOOLONG, the glibc wrapper uses a fallback
    implementation that potentially handles an unlimited path length, and
    returns with ERANGE if the provided buffer is too small.  The qemu
    emulation cannot distinguish the two cases, and thus always returns ERANGE.
    This is unexpected by the glibc wrapper.
    
    Signed-off-by: Andreas Schwab <schwab@suse.de>
    Reviewed-by: Laurent Vivier <laurent@vivier.eu>
    Message-Id: <mvmmu3qplvi.fsf@suse.de>
    [lv: updated description]
    Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/syscall.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c1ebf7b8f3..945fc25279 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -388,14 +388,7 @@ static bitmask_transtbl fcntl_flags_tbl[] = {
   { 0, 0, 0, 0 }
 };
 
-static int sys_getcwd1(char *buf, size_t size)
-{
-  if (getcwd(buf, size) == NULL) {
-      /* getcwd() sets errno */
-      return (-1);
-  }
-  return strlen(buf)+1;
-}
+_syscall2(int, sys_getcwd1, char *, buf, size_t, size)
 
 #ifdef TARGET_NR_utimensat
 #if defined(__NR_utimensat)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16632.41190 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctz-00045d-Lo; Fri, 30 Oct 2020 22:29:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16632.41190; Fri, 30 Oct 2020 22:29:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYctz-00045W-Ir; Fri, 30 Oct 2020 22:29:43 +0000
Received: by outflank-mailman (input) for mailman id 16632;
 Fri, 30 Oct 2020 22:29:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYctx-00045H-SZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 39411eb0-9525-4f83-adad-d8ac64c71783;
 Fri, 30 Oct 2020 22:29:41 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctx-0005EB-1w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYctx-0004Yr-1F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYctx-00045H-SZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
X-Inumbo-ID: 39411eb0-9525-4f83-adad-d8ac64c71783
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 39411eb0-9525-4f83-adad-d8ac64c71783;
	Fri, 30 Oct 2020 22:29:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ampsdDjYy1S6kUZcJse4mLJzfsDlRZhD7Rwsqpexy1Y=; b=OE8Gga9nGpBVzTqxx759ZfdoJZ
	lJApY82Wp7VNHungeYB7hsE0OXGqDY+bdJQHr7i8XUM9W4Z0Wt/GdDyKRQ9rTIQBfOU/SeBxMHveN
	V2vF87MaNQxuz2opRJa3YuQWz/alX9a+G0RIaizj/dBCw2YQ6FmqXad+1m6D2smEBOzo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctx-0005EB-1w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYctx-0004Yr-1F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
Message-Id: <E1kYctx-0004Yr-1F@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:41 +0000

commit 0a58e39fe90c50b313a5148c095f8dbb6111a6d6
Merge: a466dd084f51cdc9da2e99361f674f98d7218559 0f6bb1958f3aae0171996941df7fb7ea7536bb12
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 17:15:09 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 17:15:09 2020 +0100

    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging
    
    linux-user 20200728
    
    Fix "pgb_reserved_va: Assertion `guest_base != 0' failed." error
    Fix rt_sigtimedwait() errno
    Fix getcwd() errno
    
    # gpg: Signature made Tue 28 Jul 2020 13:34:11 BST
    # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
    # gpg:                issuer "laurent@vivier.eu"
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/linux-user-for-5.1-pull-request:
      linux-user: Use getcwd syscall directly
      linux-user: Fix syscall rt_sigtimedwait() implementation
      linux-user: Ensure mmap_min_addr is non-zero
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 linux-user/main.c    | 16 ++++++++++++++--
 linux-user/syscall.c | 13 ++++---------
 2 files changed, 18 insertions(+), 11 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:29:53 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:29:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16633.41195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcu9-00046v-OW; Fri, 30 Oct 2020 22:29:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16633.41195; Fri, 30 Oct 2020 22:29:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcu9-00046m-KR; Fri, 30 Oct 2020 22:29:53 +0000
Received: by outflank-mailman (input) for mailman id 16633;
 Fri, 30 Oct 2020 22:29:52 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcu8-00046Z-8S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:52 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2397fdc3-c2bd-43d5-af05-faf80e395043;
 Fri, 30 Oct 2020 22:29:51 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcu7-0005EL-DR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcu7-0004aC-Ca
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcu8-00046Z-8S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:52 +0000
X-Inumbo-ID: 2397fdc3-c2bd-43d5-af05-faf80e395043
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2397fdc3-c2bd-43d5-af05-faf80e395043;
	Fri, 30 Oct 2020 22:29:51 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CYGq7+6mGzUpyA33V5iAjIkV2CGomNA9zD1RpMIyJ+A=; b=ubr5dsWAm+WqPnnXIpCp1z7Yg8
	f/YAQX8kClSjnLKURLq8ZC5b/VzjV68mjQJ1rYNzz+VKrLAzBT0UlzhmGlr8NXXzhIECc/73kYZeW
	EsF3/0FcvXQ3rlGj+OLSoBd08k7RmFAzfhHjyZYlCi6mk0UnS9r/zGQKj1brK8SdQQDc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcu7-0005EL-DR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:51 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcu7-0004aC-Ca
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:29:51 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: Fix bdrv_aligned_p*v() for qiov_offset != 0
Message-Id: <E1kYcu7-0004aC-Ca@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:29:51 +0000

commit 134b7dec6ec2d90616d7986afb3b3b7ca7a4c383
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:04 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:47 2020 +0200

    block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Since these functions take a @qiov_offset, they must always take it into
    account when working with @qiov.  There are a couple of places where
    they do not, but they should.
    
    Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c
           ("block/io: bdrv_aligned_preadv: use and support qiov_offset")
    Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d
           ("block/io: bdrv_aligned_pwritev: use and support qiov_offset")
    Reported-by: Claudio Fontana <cfontana@suse.de>
    Reported-by: Bruce Rogers <brogers@suse.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-2-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
    Tested-by: Bruce Rogers <brogers@suse.com>
---
 block/io.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/block/io.c b/block/io.c
index b6564e34c5..ad3a51ed53 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1524,12 +1524,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
             assert(num);
 
             ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
-                                     num, qiov, bytes - bytes_remaining, 0);
+                                     num, qiov,
+                                     qiov_offset + bytes - bytes_remaining, 0);
             max_bytes -= num;
         } else {
             num = bytes_remaining;
-            ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
-                                    bytes_remaining);
+            ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining,
+                                    0, bytes_remaining);
         }
         if (ret < 0) {
             goto out;
@@ -2032,7 +2033,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
             }
 
             ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
-                                      num, qiov, bytes - bytes_remaining,
+                                      num, qiov,
+                                      qiov_offset + bytes - bytes_remaining,
                                       local_flags);
             if (ret < 0) {
                 break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:04 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16634.41198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuK-0004U3-RR; Fri, 30 Oct 2020 22:30:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16634.41198; Fri, 30 Oct 2020 22:30:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuK-0004Tb-Ne; Fri, 30 Oct 2020 22:30:04 +0000
Received: by outflank-mailman (input) for mailman id 16634;
 Fri, 30 Oct 2020 22:30:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcuJ-0004Lv-DR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id ae971784-1320-43d8-9d82-5bfd8f993a72;
 Fri, 30 Oct 2020 22:30:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuH-0005Es-HS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuH-0004b2-GU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:01 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcuJ-0004Lv-DR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:03 +0000
X-Inumbo-ID: ae971784-1320-43d8-9d82-5bfd8f993a72
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id ae971784-1320-43d8-9d82-5bfd8f993a72;
	Fri, 30 Oct 2020 22:30:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=M80aNzYOBYTTb67ZVQrAk9xLf62w6J1ciZh/i0LK+ts=; b=1ZUpkqgQ1RBakWtxrFPUZWL8Dr
	Si/Tdp+WMbbwcDI/WBXOO2nDN2ya+zZPS0rLkqnpjQ5pe5GHj0p3IDXzOtBuwX0RfA+TGkKPJjMEu
	ThnJlDa1WyQdmCFHxx/bZALf6TEXb3KqaJZRpesg1/gePKIGbFzhC8aHWBz/uuUv5vw0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuH-0005Es-HS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuH-0004b2-GU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/028: Add test for cross-base-EOF reads
Message-Id: <E1kYcuH-0004b2-GU@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:01 +0000

commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 14:08:05 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:56 2020 +0200

    iotests/028: Add test for cross-base-EOF reads
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728120806.265916-3-mreitz@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Tested-by: Claudio Fontana <cfontana@suse.de>
---
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 2 files changed, 30 insertions(+)

diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 5d043cef92..6dd3ae09a3 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
 
 _check_test_img
 
+echo
+echo '=== Reading across backing EOF in one operation ==='
+echo
+
+# Use a cluster boundary as the base end here
+base_size=$((3 * 1024 * 1024 * 1024))
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $base_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
+
+# Write 16 times 42 at the end of the base image
+$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \
+    | _filter_qemu_io
+
+# Read 32 bytes across the base EOF from the top;
+# should be 16 times 0x2a, then 16 times 0x00
+$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \
+    | _filter_qemu_io
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 12f82c6a6c..5a68de5c46 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728
 read 512/512 bytes at offset 3221258752
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 No errors were found on the image.
+
+=== Reading across backing EOF in one operation ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+wrote 16/16 bytes at offset 3221225456
+16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+bffffff0:  2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a  ................
+c0000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+read 32/32 bytes at offset 3221225456
+32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:13 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16635.41202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuT-0004oh-SH; Fri, 30 Oct 2020 22:30:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16635.41202; Fri, 30 Oct 2020 22:30:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuT-0004oY-P9; Fri, 30 Oct 2020 22:30:13 +0000
Received: by outflank-mailman (input) for mailman id 16635;
 Fri, 30 Oct 2020 22:30:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcuS-0004oQ-H4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id fa3df7d0-9b9b-41d3-a125-c51c03ad7611;
 Fri, 30 Oct 2020 22:30:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuR-0005Ey-LJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuR-0004bs-KK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcuS-0004oQ-H4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:12 +0000
X-Inumbo-ID: fa3df7d0-9b9b-41d3-a125-c51c03ad7611
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id fa3df7d0-9b9b-41d3-a125-c51c03ad7611;
	Fri, 30 Oct 2020 22:30:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=USjOvJliXV9BCUIpmPUmItALAfi58msMPP+PRlGhlHc=; b=0rPmFamJh6ZzEBgmLHk/Gif2xl
	3xPXpY6nPW018u9YUYKC8FwqCfn9xjYNd+P+WOiRwz23YIRfrRwl7cI+sZpEPvxpcWixLGY8BOxfA
	n3OJLQS9Y0SA0DG8OT0nHR9YRY6/XUJeng6wxYMoRbY53gugY0IRBuEOcGo2aDy36uf4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuR-0005Ey-LJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuR-0004bs-KK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/197: Fix for non-qcow2 formats
Message-Id: <E1kYcuR-0004bs-KK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:11 +0000

commit afac471b71da92d91cc56fb64c0719b8a4a2d96b
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Tue Jul 28 15:11:34 2020 +0200
Commit:     Max Reitz <mreitz@redhat.com>
CommitDate: Tue Jul 28 15:28:56 2020 +0200

    iotests/197: Fix for non-qcow2 formats
    
    While 197 is very much a qcow2 test, and it looks like the partial
    cluster case at the end (introduced in b0ddcbbb36a66a6) is specifically
    a qcow2 case, the whole test scripts actually marks itself to work with
    generic formats (and generic protocols, even).
    
    Said partial cluster case happened to work with non-qcow2 formats as
    well (mostly by accident), but 1855536256 broke that, because it sets
    the compat option, which does not work for non-qcow2 formats.
    
    So go the whole way and force IMGFMT=qcow2 and IMGPROTO=file, as done in
    other places in this test.
    
    Fixes: 1855536256eb0a5708b04b85f744de69559ea323
           ("iotests/197: Fix for compat=0.10")
    Reported-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200728131134.902519-1-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/197     | 8 +++++---
 tests/qemu-iotests/197.out | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index 121959a09c..a161c89816 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -114,9 +114,11 @@ echo
 
 # Force compat=1.1, because writing zeroes on a v2 image without a
 # backing file would just result in an unallocated cluster
-_make_test_img -o compat=1.1 1024
-$QEMU_IO -f $IMGFMT -C -c 'read 0 1024' "$TEST_IMG" | _filter_qemu_io
-$QEMU_IO -f $IMGFMT -c map "$TEST_IMG"
+# (Also, note that this is really a pure qcow2 test.)
+IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
+    _make_test_img --no-opts -o compat=1.1 1024
+$QEMU_IO -f qcow2 -C -c 'read 0 1024' "$TEST_WRAP" | _filter_qemu_io
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
 _check_test_img
 
 # success, all done
diff --git a/tests/qemu-iotests/197.out b/tests/qemu-iotests/197.out
index 7ca46be6e4..ad414c3b0e 100644
--- a/tests/qemu-iotests/197.out
+++ b/tests/qemu-iotests/197.out
@@ -26,7 +26,7 @@ Images are identical.
 
 === Partial final cluster ===
 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024
+Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=1024
 read 1024/1024 bytes at offset 0
 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 1 KiB (0x400) bytes     allocated at offset 0 bytes (0x0)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16636.41205 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuc-0004q5-Tf; Fri, 30 Oct 2020 22:30:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16636.41205; Fri, 30 Oct 2020 22:30:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuc-0004px-Qm; Fri, 30 Oct 2020 22:30:22 +0000
Received: by outflank-mailman (input) for mailman id 16636;
 Fri, 30 Oct 2020 22:30:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcuc-0004pr-GZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0d7bd86f-8db5-4fba-afc4-f1f8ba845436;
 Fri, 30 Oct 2020 22:30:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcub-0005FB-P8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcub-0004cS-OE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcuc-0004pr-GZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:22 +0000
X-Inumbo-ID: 0d7bd86f-8db5-4fba-afc4-f1f8ba845436
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0d7bd86f-8db5-4fba-afc4-f1f8ba845436;
	Fri, 30 Oct 2020 22:30:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2Abf65el3Kl6tav4zG3ZtxcPei6Wj9mXWJvv/i7xGyc=; b=EXHfAmS1nKSGXpcK39X2w8x5XD
	5ddZDtpYR6LWEoNkK534LixV01kHDWSegBWJ18vtUmcU+tv/Em5dn0i6X5M2TGQnjvquh6nro5WX2
	zfY7z4kkprw33l8Y44XYJB3Vkp8th0ptMHdbqBfjPKoZHmgudv6qLrU/V4EWb9RF6Uyc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcub-0005FB-P8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcub-0004cS-OE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-28' into staging
Message-Id: <E1kYcub-0004cS-OE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:21 +0000

commit 0c4fa5bc1aa47d30a8def2dc8345284400d123f1
Merge: 0a58e39fe90c50b313a5148c095f8dbb6111a6d6 afac471b71da92d91cc56fb64c0719b8a4a2d96b
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 18:00:21 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 18:00:21 2020 +0100

    Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-07-28' into staging
    
    Block patches for 5.1.0:
    - Fix block I/O for split transfers
    - Fix iotest 197 for non-qcow2 formats
    
    # gpg: Signature made Tue 28 Jul 2020 14:45:28 BST
    # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
    # gpg:                issuer "mreitz@redhat.com"
    # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
    # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
    
    * remotes/maxreitz/tags/pull-block-2020-07-28:
      iotests/197: Fix for non-qcow2 formats
      iotests/028: Add test for cross-base-EOF reads
      block: Fix bdrv_aligned_p*v() for qiov_offset != 0
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/io.c                 | 10 ++++++----
 tests/qemu-iotests/028     | 19 +++++++++++++++++++
 tests/qemu-iotests/028.out | 11 +++++++++++
 tests/qemu-iotests/197     |  8 +++++---
 tests/qemu-iotests/197.out |  2 +-
 5 files changed, 42 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16637.41210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcun-0004rU-Vg; Fri, 30 Oct 2020 22:30:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16637.41210; Fri, 30 Oct 2020 22:30:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcun-0004rL-SK; Fri, 30 Oct 2020 22:30:33 +0000
Received: by outflank-mailman (input) for mailman id 16637;
 Fri, 30 Oct 2020 22:30:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcun-0004rD-Bj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 77884f1f-992b-400f-bcec-14e1e5924b18;
 Fri, 30 Oct 2020 22:30:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcum-0005FL-69
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcum-0004e0-5M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcun-0004rD-Bj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:33 +0000
X-Inumbo-ID: 77884f1f-992b-400f-bcec-14e1e5924b18
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 77884f1f-992b-400f-bcec-14e1e5924b18;
	Fri, 30 Oct 2020 22:30:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tsVKCzXL7iWj8fdG359diJYIHLy3v2DD5ShdqIefJ2I=; b=Goc2yOLbzBMVX4X6o5RYti4e5t
	+3SiJ3PCa2sNlFKEK089hh72/apVs1bR44QSINzKSwtoR0CE6wL2bvkpy9km+03Hk1ftI8W1EfrJ3
	+LMX0ccIlhJ3heXtiBMkVmztkOEHd+9TJP8Yw6rd9f0PmUt/PpcY3zX4ltsnDYIvGtkQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcum-0005FL-69
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcum-0004e0-5M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] ACPI: Assert that we don't run out of the preallocated memory
Message-Id: <E1kYcum-0004e0-5M@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:32 +0000

commit 4bf7c0cb09a59314aca261291e3a20a24c7dd3b3
Author:     Dongjiu Geng <gengdongjiu@huawei.com>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    ACPI: Assert that we don't run out of the preallocated memory
    
    data_length is a constant value, so we use assert instead of
    condition check.
    
    Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
    Message-id: 20200622113146.33421-1-gengdongjiu@huawei.com
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/acpi/ghes.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
index b363bc331d..f0ee9f51ca 100644
--- a/hw/acpi/ghes.c
+++ b/hw/acpi/ghes.c
@@ -204,16 +204,12 @@ static int acpi_ghes_record_mem_error(uint64_t error_block_address,
 
     /* This is the length if adding a new generic error data entry*/
     data_length = ACPI_GHES_DATA_LENGTH + ACPI_GHES_MEM_CPER_LENGTH;
-
     /*
-     * Check whether it will run out of the preallocated memory if adding a new
-     * generic error data entry
+     * It should not run out of the preallocated memory if adding a new generic
+     * error data entry
      */
-    if ((data_length + ACPI_GHES_GESB_SIZE) > ACPI_GHES_MAX_RAW_DATA_LENGTH) {
-        error_report("Not enough memory to record new CPER!!!");
-        g_array_free(block, true);
-        return -1;
-    }
+    assert((data_length + ACPI_GHES_GESB_SIZE) <=
+            ACPI_GHES_MAX_RAW_DATA_LENGTH);
 
     /* Build the new generic error status block header */
     acpi_ghes_generic_error_status(block, ACPI_GEBS_UNCORRECTABLE,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:44 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16638.41214 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcuy-0004tG-0j; Fri, 30 Oct 2020 22:30:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16638.41214; Fri, 30 Oct 2020 22:30:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcux-0004tA-Tz; Fri, 30 Oct 2020 22:30:43 +0000
Received: by outflank-mailman (input) for mailman id 16638;
 Fri, 30 Oct 2020 22:30:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcux-0004sy-69
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:43 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id f0f6a0ca-935b-4135-8b31-13d822ee5ff3;
 Fri, 30 Oct 2020 22:30:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuw-0005Fy-9h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcuw-0004ec-8y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcux-0004sy-69
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:43 +0000
X-Inumbo-ID: f0f6a0ca-935b-4135-8b31-13d822ee5ff3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id f0f6a0ca-935b-4135-8b31-13d822ee5ff3;
	Fri, 30 Oct 2020 22:30:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RQKmVv3PvaeCph/I/fBXpg9I69bWDAcQzbDxlyUoL38=; b=Cx0/661bwBp7yd0eHao1VZsw6p
	6sH5A7ZXOVFrtAlom+OPosF4Q7uq7w6TLcIx28uQXIKUhxXu69Uqil4YBRotWM7gwbaIKQWYH+3K/
	52amhwCPlaDQXPnR5bZfeKotimBykdblgq2eN7qxOyX1CXe3zpwKcwZmMujEWQDXIrAM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuw-0005Fy-9h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcuw-0004ec-8y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/misc/aspeed_sdmc: Fix incorrect memory size
Message-Id: <E1kYcuw-0004ec-8y@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:42 +0000

commit ca05a240d4fa2ce880c630058b635482d3d472f8
Author:     Philippe Mathieu-Daudé <f4bug@amsat.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/misc/aspeed_sdmc: Fix incorrect memory size
    
    The SDRAM Memory Controller has a 32-bit address bus, thus
    supports up to 4 GiB of DRAM. There is a signed to unsigned
    conversion error with the AST2600 maximum memory size:
    
      (uint64_t)(2048 << 20) = (uint64_t)(-2147483648)
                             = 0xffffffff40000000
                             = 16 EiB - 2 GiB
    
    Fix by using the IEC suffixes which are usually safer, and add
    an assertion check to verify the memory is valid. This would have
    caught this bug:
    
      $ qemu-system-arm -M ast2600-evb
      qemu-system-arm: hw/misc/aspeed_sdmc.c:258: aspeed_sdmc_realize: Assertion `asc->max_ram_size < 4 * GiB' failed.
      Aborted (core dumped)
    
    Fixes: 1550d72679 ("aspeed/sdmc: Add AST2600 support")
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/misc/aspeed_sdmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c
index 0737d8de81..855848b7d2 100644
--- a/hw/misc/aspeed_sdmc.c
+++ b/hw/misc/aspeed_sdmc.c
@@ -255,6 +255,7 @@ static void aspeed_sdmc_realize(DeviceState *dev, Error **errp)
     AspeedSDMCState *s = ASPEED_SDMC(dev);
     AspeedSDMCClass *asc = ASPEED_SDMC_GET_CLASS(s);
 
+    assert(asc->max_ram_size < 4 * GiB); /* 32-bit address bus */
     s->max_ram_size = asc->max_ram_size;
 
     memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_sdmc_ops, s,
@@ -341,7 +342,7 @@ static void aspeed_2400_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2400 SDRAM Memory Controller";
-    asc->max_ram_size = 512 << 20;
+    asc->max_ram_size = 512 * MiB;
     asc->compute_conf = aspeed_2400_sdmc_compute_conf;
     asc->write = aspeed_2400_sdmc_write;
     asc->valid_ram_sizes = aspeed_2400_ram_sizes;
@@ -408,7 +409,7 @@ static void aspeed_2500_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2500 SDRAM Memory Controller";
-    asc->max_ram_size = 1024 << 20;
+    asc->max_ram_size = 1 * GiB;
     asc->compute_conf = aspeed_2500_sdmc_compute_conf;
     asc->write = aspeed_2500_sdmc_write;
     asc->valid_ram_sizes = aspeed_2500_ram_sizes;
@@ -485,7 +486,7 @@ static void aspeed_2600_sdmc_class_init(ObjectClass *klass, void *data)
     AspeedSDMCClass *asc = ASPEED_SDMC_CLASS(klass);
 
     dc->desc = "ASPEED 2600 SDRAM Memory Controller";
-    asc->max_ram_size = 2048 << 20;
+    asc->max_ram_size = 2 * GiB;
     asc->compute_conf = aspeed_2600_sdmc_compute_conf;
     asc->write = aspeed_2600_sdmc_write;
     asc->valid_ram_sizes = aspeed_2600_ram_sizes;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:30:54 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:30:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16639.41218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcv8-0004uU-2N; Fri, 30 Oct 2020 22:30:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16639.41218; Fri, 30 Oct 2020 22:30:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcv7-0004uM-VW; Fri, 30 Oct 2020 22:30:53 +0000
Received: by outflank-mailman (input) for mailman id 16639;
 Fri, 30 Oct 2020 22:30:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcv7-0004uE-HG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7346577c-9f49-49bf-b515-aa94a0d35fff;
 Fri, 30 Oct 2020 22:30:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcv6-0005G6-Dg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcv6-0004fK-Cx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcv7-0004uE-HG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:53 +0000
X-Inumbo-ID: 7346577c-9f49-49bf-b515-aa94a0d35fff
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7346577c-9f49-49bf-b515-aa94a0d35fff;
	Fri, 30 Oct 2020 22:30:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ylgbxsIujqPJMkKyxj04XJxmUuagHm9ziCw+Kbjv0hE=; b=Mx7oCe9jT0kq6oBMxaOhfRdY5d
	RKyNykEBfJ13mg/as1DV+8Vifo07J03pPcRHhayDDnL5jHWubebbhMsJHwIsmHPut340BwF4I01l1
	R1UuYcwQUDfVzJlb5Yb+b5RMKn/Uv5PYWQG+SrqQOXzxBbr+KV+FXrj1gkRJqV6SxmU4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcv6-0005G6-Dg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcv6-0004fK-Cx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:30:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Always pass cacheattr in S1_ptw_translate
Message-Id: <E1kYcv6-0004fK-Cx@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:30:52 +0000

commit a6d6f37aed4b171d121cd4a9363fbb41e90dcb53
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    target/arm: Always pass cacheattr in S1_ptw_translate
    
    When we changed the interface of get_phys_addr_lpae to require
    the cacheattr parameter, this spot was missed.  The compiler is
    unable to detect the use of NULL vs the nonnull attribute here.
    
    Fixes: 7e98e21c098
    Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Tested-by: Jan Kiszka <jan.kiskza@siemens.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/helper.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index c69a2baf1d..8ef0fb478f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10204,21 +10204,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx,
         int s2prot;
         int ret;
         ARMCacheAttrs cacheattrs = {};
-        ARMCacheAttrs *pcacheattrs = NULL;
-
-        if (env->cp15.hcr_el2 & HCR_PTW) {
-            /*
-             * PTW means we must fault if this S1 walk touches S2 Device
-             * memory; otherwise we don't care about the attributes and can
-             * save the S2 translation the effort of computing them.
-             */
-            pcacheattrs = &cacheattrs;
-        }
 
         ret = get_phys_addr_lpae(env, addr, MMU_DATA_LOAD, ARMMMUIdx_Stage2,
                                  false,
                                  &s2pa, &txattrs, &s2prot, &s2size, fi,
-                                 pcacheattrs);
+                                 &cacheattrs);
         if (ret) {
             assert(fi->type != ARMFault_None);
             fi->s2addr = addr;
@@ -10226,8 +10216,11 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx,
             fi->s1ptw = true;
             return ~0;
         }
-        if (pcacheattrs && (pcacheattrs->attrs & 0xf0) == 0) {
-            /* Access was to Device memory: generate Permission fault */
+        if ((env->cp15.hcr_el2 & HCR_PTW) && (cacheattrs.attrs & 0xf0) == 0) {
+            /*
+             * PTW set and S1 walk touched S2 Device memory:
+             * generate Permission fault.
+             */
             fi->type = ARMFault_Permission;
             fi->s2addr = addr;
             fi->stage2 = true;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16640.41221 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvJ-0004vs-3f; Fri, 30 Oct 2020 22:31:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16640.41221; Fri, 30 Oct 2020 22:31:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvJ-0004vl-0o; Fri, 30 Oct 2020 22:31:05 +0000
Received: by outflank-mailman (input) for mailman id 16640;
 Fri, 30 Oct 2020 22:31:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcvI-0004vc-CV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 418d0250-3f53-40be-ab58-e80c954f226d;
 Fri, 30 Oct 2020 22:31:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvG-0005GR-IX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvG-0004gF-Gh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:02 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcvI-0004vc-CV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:04 +0000
X-Inumbo-ID: 418d0250-3f53-40be-ab58-e80c954f226d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 418d0250-3f53-40be-ab58-e80c954f226d;
	Fri, 30 Oct 2020 22:31:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MCujwI74EJbsRt14/NjQtEcyZw5Ze8JKVTFIQ4bOJM8=; b=Z6LY4GOQPKxvDg0ogvXEuGnyfs
	3HU6KurlWcBPyPNNK8BVYkJqLC+ayTpv/brhv6G5a/A/7zuJs22ogq7PeDWtYnIS/zkr4win5sAZH
	+JdeMu0lkC2xspuvQB1etMlaOImkrOcYjlubLCZGtNmof+qBQGuzxu0rPgct/k5teyPI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvG-0005GR-IX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvG-0004gF-Gh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/system/arm/virt: Document 'mte' machine option
Message-Id: <E1kYcvG-0004gF-Gh@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:02 +0000

commit 222f45b75970452b864f80cc4c0d3eb8f4862f64
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    docs/system/arm/virt: Document 'mte' machine option
    
    Commit 6a0b7505f1fd6769c which added documentation of the virt board
    crossed in the post with commit 6f4e1405b91da0d0 which added a new
    'mte' machine option. Update the docs to include the new option.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 docs/system/arm/virt.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
index 6621ab7205..32dc5eb22e 100644
--- a/docs/system/arm/virt.rst
+++ b/docs/system/arm/virt.rst
@@ -79,6 +79,10 @@ virtualization
   Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
   Arm Virtualization Extensions. The default is ``off``.
 
+mte
+  Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the
+  Arm Memory Tagging Extensions. The default is ``off``.
+
 highmem
   Set ``on``/``off`` to enable/disable placing devices and RAM in physical
   address space above 32 bits. The default is ``on`` for machine types
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:14 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16641.41226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvS-0004xD-6X; Fri, 30 Oct 2020 22:31:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16641.41226; Fri, 30 Oct 2020 22:31:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvS-0004x6-3V; Fri, 30 Oct 2020 22:31:14 +0000
Received: by outflank-mailman (input) for mailman id 16641;
 Fri, 30 Oct 2020 22:31:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcvR-0004wz-HC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 63b1c9f1-3f56-45d1-bec8-422d47dd021a;
 Fri, 30 Oct 2020 22:31:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvQ-0005GX-OR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvQ-0004gz-LO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcvR-0004wz-HC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:13 +0000
X-Inumbo-ID: 63b1c9f1-3f56-45d1-bec8-422d47dd021a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 63b1c9f1-3f56-45d1-bec8-422d47dd021a;
	Fri, 30 Oct 2020 22:31:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aNBJPKq8pubVBkkI4RF/lvb9+iNHK2ilrvvNNvKohC0=; b=w83ahp6z76laKxxx4Q+EOEUi5i
	amqn6tdWyGZBYlNrBqOGICgoN1HlGNdoiwaNi/OhIWnRxBrz3NvAgRgrOganDmzt+aK1s7MwIuyok
	pQtmvUfsjWY9nSS1qZnW8CfYgq+VaCKL23BvR7nM0ToiOyAQbAOzFctOJEUoH27w3kuM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvQ-0005GX-OR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvQ-0004gz-LO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
Message-Id: <E1kYcvQ-0004gz-LO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:12 +0000

commit 24ac0d309ab379cd0347f198c2db5b2b48b02887
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
    
    When booting an EL3 cpu with -kernel, we set up EL3 and then
    drop down to EL2.  We need to enable access to v8.3-PAuth
    keys and instructions at EL3 before doing so.
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-2-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index fef4072db1..c44fd3382d 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -736,6 +736,9 @@ static void do_cpu_reset(void *opaque)
                     } else {
                         env->pstate = PSTATE_MODE_EL1h;
                     }
+                    if (cpu_isar_feature(aa64_pauth, cpu)) {
+                        env->cp15.scr_el3 |= SCR_API | SCR_APK;
+                    }
                     /* AArch64 kernels never boot in secure mode */
                     assert(!info->secure_boot);
                     /* This hook is only supported for AArch32 currently:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16642.41230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvd-0004yd-8d; Fri, 30 Oct 2020 22:31:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16642.41230; Fri, 30 Oct 2020 22:31:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvd-0004yV-5Q; Fri, 30 Oct 2020 22:31:25 +0000
Received: by outflank-mailman (input) for mailman id 16642;
 Fri, 30 Oct 2020 22:31:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcvb-0004yL-Oh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c10d34e8-b05a-46d5-99df-bd424c27692d;
 Fri, 30 Oct 2020 22:31:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcva-0005Gm-Sk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcva-0004hc-RE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcvb-0004yL-Oh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:23 +0000
X-Inumbo-ID: c10d34e8-b05a-46d5-99df-bd424c27692d
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c10d34e8-b05a-46d5-99df-bd424c27692d;
	Fri, 30 Oct 2020 22:31:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jmfGWBfbILjmio/H98lRoiQFwnwdOZDzKmpL4e+qiI4=; b=TGkS0iCxJO8uT3zewMr/RBqfao
	0zpoKpJ0Dg2WdwsQ744NEFDtyRNXeEcspwWJSgr+ykeBJGdwcD+itXFe26/rFk0s6pJihCa96Ou6a
	JD4LOQwY7SKVXxantoyx8aYeqzwGkFDuoTdHkc6hi/WsDdOTiv2oPxS/RiMZ4dWReZu4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcva-0005Gm-Sk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcva-0004hc-RE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/boot: Fix MTE for EL3 direct kernel boot
Message-Id: <E1kYcva-0004hc-RE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:22 +0000

commit 7ad01d78a9f2e80d1be41226d98f34059f7fff90
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:10 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:10 2020 +0100

    hw/arm/boot: Fix MTE for EL3 direct kernel boot
    
    When booting an EL3 cpu with -kernel, we set up EL3 and then
    drop down to EL2.  We need to enable access to v8.5-MemTag
    tag allocation at EL3 before doing so.
    
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-3-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index c44fd3382d..3e9816af80 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -739,6 +739,9 @@ static void do_cpu_reset(void *opaque)
                     if (cpu_isar_feature(aa64_pauth, cpu)) {
                         env->cp15.scr_el3 |= SCR_API | SCR_APK;
                     }
+                    if (cpu_isar_feature(aa64_mte, cpu)) {
+                        env->cp15.scr_el3 |= SCR_ATA;
+                    }
                     /* AArch64 kernels never boot in secure mode */
                     assert(!info->secure_boot);
                     /* This hook is only supported for AArch32 currently:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16643.41234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvn-0004zn-A7; Fri, 30 Oct 2020 22:31:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16643.41234; Fri, 30 Oct 2020 22:31:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvn-0004zf-6w; Fri, 30 Oct 2020 22:31:35 +0000
Received: by outflank-mailman (input) for mailman id 16643;
 Fri, 30 Oct 2020 22:31:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcvl-0004zR-Rn
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b8bb84c5-8426-40e6-bed8-991d50e2be4e;
 Fri, 30 Oct 2020 22:31:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvl-0005Gu-0E
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvk-0004iI-VO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:32 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcvl-0004zR-Rn
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:33 +0000
X-Inumbo-ID: b8bb84c5-8426-40e6-bed8-991d50e2be4e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b8bb84c5-8426-40e6-bed8-991d50e2be4e;
	Fri, 30 Oct 2020 22:31:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ERj6OBGMeQeY9/tBg/XnNWdEilHUx/FmwRtOUCayygQ=; b=awfoS1GWLKnThuMx343X1BE1fO
	2GcbeHQxOmkCGRLSwV3/0FJd7IrwsnWWlk/OX46UXBhY+VJ5Ns+hx6NjP+XTcBXaFe36C0OdkIf8c
	UcNo3IcA2hm9R85tOek2WTtA7FDCP4I+nwgafvczzYr3RwMHyjZLuwPSWLK1B3foCMDc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvl-0005Gu-0E
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvk-0004iI-VO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Improve IMPDEF algorithm for IRG
Message-Id: <E1kYcvk-0004iI-VO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:32 +0000

commit d4f6dda182e19afa75706936805e18397cb95f07
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Jul 27 16:12:11 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Jul 27 16:12:11 2020 +0100

    target/arm: Improve IMPDEF algorithm for IRG
    
    When GCR_EL1.RRND==1, the choosing of the random value is IMPDEF,
    and the kernel is not expected to have set RGSR_EL1.  Force a
    non-zero value into SEED, so that we do not continually return
    the same tag.
    
    Reported-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200724163853.504655-4-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/mte_helper.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c
index 5ea57d487a..104752041f 100644
--- a/target/arm/mte_helper.c
+++ b/target/arm/mte_helper.c
@@ -24,6 +24,8 @@
 #include "exec/ram_addr.h"
 #include "exec/cpu_ldst.h"
 #include "exec/helper-proto.h"
+#include "qapi/error.h"
+#include "qemu/guest-random.h"
 
 
 static int choose_nonexcluded_tag(int tag, int offset, uint16_t exclude)
@@ -211,16 +213,37 @@ static uint8_t *allocation_tag_mem(CPUARMState *env, int ptr_mmu_idx,
 
 uint64_t HELPER(irg)(CPUARMState *env, uint64_t rn, uint64_t rm)
 {
-    int rtag;
-
-    /*
-     * Our IMPDEF choice for GCR_EL1.RRND==1 is to behave as if
-     * GCR_EL1.RRND==0, always producing deterministic results.
-     */
     uint16_t exclude = extract32(rm | env->cp15.gcr_el1, 0, 16);
+    int rrnd = extract32(env->cp15.gcr_el1, 16, 1);
     int start = extract32(env->cp15.rgsr_el1, 0, 4);
     int seed = extract32(env->cp15.rgsr_el1, 8, 16);
-    int offset, i;
+    int offset, i, rtag;
+
+    /*
+     * Our IMPDEF choice for GCR_EL1.RRND==1 is to continue to use the
+     * deterministic algorithm.  Except that with RRND==1 the kernel is
+     * not required to have set RGSR_EL1.SEED != 0, which is required for
+     * the deterministic algorithm to function.  So we force a non-zero
+     * SEED for that case.
+     */
+    if (unlikely(seed == 0) && rrnd) {
+        do {
+            Error *err = NULL;
+            uint16_t two;
+
+            if (qemu_guest_getrandom(&two, sizeof(two), &err) < 0) {
+                /*
+                 * Failed, for unknown reasons in the crypto subsystem.
+                 * Best we can do is log the reason and use a constant seed.
+                 */
+                qemu_log_mask(LOG_UNIMP, "IRG: Crypto failure: %s\n",
+                              error_get_pretty(err));
+                error_free(err);
+                two = 1;
+            }
+            seed = two;
+        } while (seed == 0);
+    }
 
     /* RandomTag */
     for (i = offset = 0; i < 4; ++i) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16644.41238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvx-00051a-Bg; Fri, 30 Oct 2020 22:31:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16644.41238; Fri, 30 Oct 2020 22:31:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcvx-00051R-8b; Fri, 30 Oct 2020 22:31:45 +0000
Received: by outflank-mailman (input) for mailman id 16644;
 Fri, 30 Oct 2020 22:31:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcvw-00051G-1F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id b04ab93b-2435-4bf4-9a63-8b4d49e24357;
 Fri, 30 Oct 2020 22:31:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvv-0005Hj-4C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcvv-0004iq-3R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:43 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcvw-00051G-1F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:44 +0000
X-Inumbo-ID: b04ab93b-2435-4bf4-9a63-8b4d49e24357
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id b04ab93b-2435-4bf4-9a63-8b4d49e24357;
	Fri, 30 Oct 2020 22:31:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DkbdeSGBYOlbDi1zYmLpusYLNszAWssiAk7haddjQ5o=; b=E3nIDTvgfYLYxiJ6plpBPQOI79
	sgoTofeO2jqfA6IeZpBvyXxJocp8UcF7FRFVRHzTl0yeseJsMkMBUSAeRI2D1WseVLNSRG8VRfnCX
	HEWWQtCMV3IpGolzsmfK+KlxJSrTP9YfepLQHlp0PtN5YR4FgM9OgHOVyQ3kGmCzbwWU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvv-0005Hj-4C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcvv-0004iq-3R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200727' into staging
Message-Id: <E1kYcvv-0004iq-3R@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:43 +0000

commit 3461487523b897d324e8d91f3fd20ed55f849544
Merge: 0c4fa5bc1aa47d30a8def2dc8345284400d123f1 d4f6dda182e19afa75706936805e18397cb95f07
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 18:43:48 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 18:43:48 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200727' into staging
    
    target-arm queue:
     * ACPI: Assert that we don't run out of the preallocated memory
     * hw/misc/aspeed_sdmc: Fix incorrect memory size
     * target/arm: Always pass cacheattr in S1_ptw_translate
     * docs/system/arm/virt: Document 'mte' machine option
     * hw/arm/boot: Fix PAUTH, MTE for EL3 direct kernel boot
     * target/arm: Improve IMPDEF algorithm for IRG
    
    # gpg: Signature made Mon 27 Jul 2020 16:18:38 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200727:
      target/arm: Improve IMPDEF algorithm for IRG
      hw/arm/boot: Fix MTE for EL3 direct kernel boot
      hw/arm/boot: Fix PAUTH for EL3 direct kernel boot
      docs/system/arm/virt: Document 'mte' machine option
      target/arm: Always pass cacheattr in S1_ptw_translate
      hw/misc/aspeed_sdmc: Fix incorrect memory size
      ACPI: Assert that we don't run out of the preallocated memory
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/system/arm/virt.rst |  4 ++++
 hw/acpi/ghes.c           | 12 ++++--------
 hw/arm/boot.c            |  6 ++++++
 hw/misc/aspeed_sdmc.c    |  7 ++++---
 target/arm/helper.c      | 19 ++++++-------------
 target/arm/mte_helper.c  | 37 ++++++++++++++++++++++++++++++-------
 6 files changed, 54 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:31:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16645.41242 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcw7-00052q-DL; Fri, 30 Oct 2020 22:31:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16645.41242; Fri, 30 Oct 2020 22:31:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcw7-00052h-A7; Fri, 30 Oct 2020 22:31:55 +0000
Received: by outflank-mailman (input) for mailman id 16645;
 Fri, 30 Oct 2020 22:31:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcw6-00052X-9Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 54f9ada5-87a8-41ac-b8d3-abcd332894e3;
 Fri, 30 Oct 2020 22:31:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcw5-0005Hu-Et
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcw5-0004jj-EA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcw6-00052X-9Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:54 +0000
X-Inumbo-ID: 54f9ada5-87a8-41ac-b8d3-abcd332894e3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 54f9ada5-87a8-41ac-b8d3-abcd332894e3;
	Fri, 30 Oct 2020 22:31:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GlYpQh1K9J2+myyl9vqC0b97n3xFDJOjETovR+akKFU=; b=iH88IVGzLexOF1d2dozVi/fsH/
	LM4jxWHjtCWjomrnYVIqr2O79JbTt+/V3hIoBAXeVH8AyA2KryvkczcPyoyg1Q1+mEyAA8cUoi9Zx
	vLhJ4uSxAChDazzYl874mFxS1WkEA/NfNvsnn/te8qAhNc6olScNyr6cV8nvz29vuy0E=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcw5-0005Hu-Et
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcw5-0004jj-EA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:31:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] test-char: abort on serial test error
Message-Id: <E1kYcw5-0004jj-EA@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:31:53 +0000

commit 297641d43ccf18274e18da841f69bdb256a60ce1
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sun Jul 26 19:30:23 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Tue Jul 28 18:27:59 2020 +0400

    test-char: abort on serial test error
    
    We are having issues debugging and bisecting this issue that happen
    mostly on patchew. Let's make it abort where it failed to gather some
    new informations.
    
    Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index 614bdac2df..d35cc839bc 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -1200,7 +1200,7 @@ static void char_serial_test(void)
 
     /* test tty alias */
     qemu_opt_set(opts, "backend", "tty", &error_abort);
-    chr = qemu_chr_new_from_opts(opts, NULL, NULL);
+    chr = qemu_chr_new_from_opts(opts, NULL, &error_abort);
     g_assert_nonnull(chr);
     object_unparent(OBJECT(chr));
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16646.41246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwH-00054F-Et; Fri, 30 Oct 2020 22:32:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16646.41246; Fri, 30 Oct 2020 22:32:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwH-000545-Bf; Fri, 30 Oct 2020 22:32:05 +0000
Received: by outflank-mailman (input) for mailman id 16646;
 Fri, 30 Oct 2020 22:32:04 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcwG-00053v-E8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:04 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id adde3466-a551-4bae-a872-2ea4ef567586;
 Fri, 30 Oct 2020 22:32:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwF-0005IH-JA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwF-0004kV-HW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcwG-00053v-E8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:04 +0000
X-Inumbo-ID: adde3466-a551-4bae-a872-2ea4ef567586
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id adde3466-a551-4bae-a872-2ea4ef567586;
	Fri, 30 Oct 2020 22:32:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EqT4CtI5kaOKMe8Qaiic0RALAw5D0UjkoKcTAw9gLeg=; b=6okf/zJKcai6JtxRs/A3kEInDe
	7B0oGCj5UUJYdjoxBNVDu6ct2C8vtTL4YKIFm5aWRF/M5j5p0Vja9jeoFxwixTlsgYuUipozwGuFW
	3zpm5fU95VDe1r2bRktjpOgevHH2NUY7yhCXT1JX3d2smCm4FMR/hSmgYOJZ0T2TH/is=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwF-0005IH-JA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwF-0004kV-HW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] slirp: update to latest stable-4.2 branch
Message-Id: <E1kYcwF-0004kV-HW@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:03 +0000

commit 9c15f57891af7c2cb3baf2d66a1b1f3f87a665ba
Author:     Marc-André Lureau <marcandre.lureau@redhat.com>
AuthorDate: Sun Jul 26 19:41:00 2020 +0400
Commit:     Marc-André Lureau <marcandre.lureau@redhat.com>
CommitDate: Tue Jul 28 18:27:59 2020 +0400

    slirp: update to latest stable-4.2 branch
    
    Dr. David Alan Gilbert (1):
          ip_stripoptions use memmove
    
    Jindrich Novy (4):
          Fix possible infinite loops and use-after-free
          Use secure string copy to avoid overflow
          Be sure to initialize sockaddr structure
          Check lseek() for failure
    
    Marc-André Lureau (2):
          util: do not silently truncate
          Merge branch 'stable-4.2' into 'stable-4.2'
    
    Philippe Mathieu-Daudé (3):
          Fix win32 builds by using the SLIRP_PACKED definition
          Fix constness warnings
          Remove unnecessary break
    
    Ralf Haferkamp (2):
          Drop bogus IPv6 messages
          Fix MTU check
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 slirp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slirp b/slirp
index 2faae0f778..ce94eba204 160000
--- a/slirp
+++ b/slirp
@@ -1 +1 @@
-Subproject commit 2faae0f778f818fadc873308f983289df697eb93
+Subproject commit ce94eba2042d52a0ba3d9e252ebce86715e94275
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16647.41250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwS-00055W-GH; Fri, 30 Oct 2020 22:32:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16647.41250; Fri, 30 Oct 2020 22:32:16 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwS-00055O-DF; Fri, 30 Oct 2020 22:32:16 +0000
Received: by outflank-mailman (input) for mailman id 16647;
 Fri, 30 Oct 2020 22:32:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcwR-00055F-5W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:15 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1e34ffe9-2ead-4a70-a3cf-a770f1a6abf4;
 Fri, 30 Oct 2020 22:32:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwP-0005IP-Mb
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwP-0004lA-Lq
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcwR-00055F-5W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:15 +0000
X-Inumbo-ID: 1e34ffe9-2ead-4a70-a3cf-a770f1a6abf4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1e34ffe9-2ead-4a70-a3cf-a770f1a6abf4;
	Fri, 30 Oct 2020 22:32:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3jEsxtmmFDJr/2ab28uLvyiQgEiZIAL7EzNU2qtxzz8=; b=FNGvW3VaOXpDeggPdMJbdg5PYw
	MQNHqDjA+eV93p3QW8JZRlIdcyxrqOv6SFqIBqkGcOI5r0dqGQLDlMi+3ScCOKsR+YpQkrIabSCKV
	dfNoC39B70Gb1j1wntxcjgeaanFXwK8yoy32iuSaEFIKucf5ad+WD58c9HtYNBZziu9c=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwP-0005IP-Mb
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwP-0004lA-Lq
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging
Message-Id: <E1kYcwP-0004lA-Lq@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:13 +0000

commit b1753831b0e58587db4fdf8219237331269c00c3
Merge: 3461487523b897d324e8d91f3fd20ed55f849544 9c15f57891af7c2cb3baf2d66a1b1f3f87a665ba
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 19:44:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 19:44:03 2020 +0100

    Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging
    
    slirp: update to latest stable-4.2 branch
    
    # gpg: Signature made Tue 28 Jul 2020 15:30:09 BST
    # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
    # gpg:                issuer "marcandre.lureau@redhat.com"
    # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
    # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
    # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
    
    * remotes/elmarco/tags/slirp-pull-request:
      slirp: update to latest stable-4.2 branch
      test-char: abort on serial test error
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 slirp             | 2 +-
 tests/test-char.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:26 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16648.41254 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwc-00056h-Hs; Fri, 30 Oct 2020 22:32:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16648.41254; Fri, 30 Oct 2020 22:32:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwc-00056Z-Em; Fri, 30 Oct 2020 22:32:26 +0000
Received: by outflank-mailman (input) for mailman id 16648;
 Fri, 30 Oct 2020 22:32:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcwb-00056P-48
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:25 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id eeee5924-0344-4047-943f-33df78fc3320;
 Fri, 30 Oct 2020 22:32:24 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwa-0005Ib-65
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwa-0004my-47
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcwb-00056P-48
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:25 +0000
X-Inumbo-ID: eeee5924-0344-4047-943f-33df78fc3320
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id eeee5924-0344-4047-943f-33df78fc3320;
	Fri, 30 Oct 2020 22:32:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UhCb4WnBMzXOoraGPaRlvKH3vbe/ASxi1ymSfNiP01I=; b=1Tu8pLiIr3kC+bE7DAcB+1tRiW
	dJ7Ii0NIH9LURIKDqEZDqAtyxMOZrDapdc1vFKSsi9+el8wU0i1EhCSmMgfwt3bMmmaYoOttX3mvw
	a795BMWanjlgxcbAboSlQXCEor+P9zRFX3n57kRc2kkHyEKvZdttTTJy/uBi92zO+Yhc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwa-0005Ib-65
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwa-0004my-47
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] nbd: Fix large trim/zero requests
Message-Id: <E1kYcwa-0004my-47@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:24 +0000

commit 890cbccb089db9e646cc1baea3be9dc060e3917b
Author:     Eric Blake <eblake@redhat.com>
AuthorDate: Wed Jul 22 16:22:31 2020 -0500
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 08:49:29 2020 -0500

    nbd: Fix large trim/zero requests
    
    Although qemu as NBD client limits requests to <2G, the NBD protocol
    allows clients to send requests almost all the way up to 4G.  But
    because our block layer is not yet 64-bit clean, we accidentally wrap
    such requests into a negative size, and fail with EIO instead of
    performing the intended operation.
    
    The bug is visible in modern systems with something as simple as:
    
    $ qemu-img create -f qcow2 /tmp/image.img 5G
    $ sudo qemu-nbd --connect=/dev/nbd0 /tmp/image.img
    $ sudo blkdiscard /dev/nbd0
    
    or with user-space only:
    
    $ truncate --size=3G file
    $ qemu-nbd -f raw file
    $ nbdsh -u nbd://localhost:10809 -c 'h.trim(3*1024*1024*1024,0)'
    
    Although both blk_co_pdiscard and blk_pwrite_zeroes currently return 0
    on success, this is also a good time to fix our code to a more robust
    paradigm that treats all non-negative values as success.
    
    Alas, our iotests do not currently make it easy to add external
    dependencies on blkdiscard or nbdsh, so we have to rely on manual
    testing for now.
    
    This patch can be reverted when we later improve the overall block
    layer to be 64-bit clean, but for now, a minimal fix was deemed less
    risky prior to release.
    
    CC: qemu-stable@nongnu.org
    Fixes: 1f4d6d18ed
    Fixes: 1c6c4bb7f0
    Fixes: https://github.com/systemd/systemd/issues/16242
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200722212231.535072-1-eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: rework success tests to use >=0]
---
 nbd/server.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 4752a6c8bc..c5d71cff10 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2378,8 +2378,17 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
         if (request->flags & NBD_CMD_FLAG_FAST_ZERO) {
             flags |= BDRV_REQ_NO_FALLBACK;
         }
-        ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
-                                request->len, flags);
+        ret = 0;
+        /* FIXME simplify this when blk_pwrite_zeroes switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_pwrite_zeroes(exp->blk, request->from + exp->dev_offset,
+                                    len, flags);
+            request->len -= len;
+            request->from += len;
+        }
         return nbd_send_generic_reply(client, request->handle, ret,
                                       "writing to file failed", errp);
 
@@ -2393,9 +2402,18 @@ static coroutine_fn int nbd_handle_request(NBDClient *client,
                                       "flush failed", errp);
 
     case NBD_CMD_TRIM:
-        ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
-                              request->len);
-        if (ret == 0 && request->flags & NBD_CMD_FLAG_FUA) {
+        ret = 0;
+        /* FIXME simplify this when blk_co_pdiscard switches to 64-bit */
+        while (ret >= 0 && request->len) {
+            int align = client->check_align ?: 1;
+            int len = MIN(request->len, QEMU_ALIGN_DOWN(BDRV_REQUEST_MAX_BYTES,
+                                                        align));
+            ret = blk_co_pdiscard(exp->blk, request->from + exp->dev_offset,
+                                  len);
+            request->len -= len;
+            request->from += len;
+        }
+        if (ret >= 0 && request->flags & NBD_CMD_FLAG_FUA) {
             ret = blk_co_flush(exp->blk);
         }
         return nbd_send_generic_reply(client, request->handle, ret,
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16649.41258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwm-00058F-Kc; Fri, 30 Oct 2020 22:32:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16649.41258; Fri, 30 Oct 2020 22:32:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcwm-000587-HV; Fri, 30 Oct 2020 22:32:36 +0000
Received: by outflank-mailman (input) for mailman id 16649;
 Fri, 30 Oct 2020 22:32:35 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcwl-00057v-8d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id accf10a1-bda9-426d-a6e3-6fe59259e024;
 Fri, 30 Oct 2020 22:32:34 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwk-0005Ii-9o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwk-0004o3-90
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:34 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcwl-00057v-8d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:35 +0000
X-Inumbo-ID: accf10a1-bda9-426d-a6e3-6fe59259e024
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id accf10a1-bda9-426d-a6e3-6fe59259e024;
	Fri, 30 Oct 2020 22:32:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t0Js2InmmmB3wfo2o20ZKaZ81pFBGuICBIJK7diEiEU=; b=W0XU0VcVwhf+tDMeL7vz3yVYJ5
	P+bqj7vd079E/J69sUxm2b8m7lz8dMjtGgd6vXaEHNScsneg2c9DPAOfCrY044bAc4xeDw2Uifd9g
	lVgtFK+G3kuV91BKkh6aq3MJD/x6XuWCulc98Urp/A8fwYeF8i/m7owqoYdnTBH4PTi4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwk-0005Ii-9o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwk-0004o3-90
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:34 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block: nbd: Fix convert qcow2 compressed to nbd
Message-Id: <E1kYcwk-0004o3-90@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:34 +0000

commit a2b333c01880f56056d50c238834d62e32001e54
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:43 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:19 2020 -0500

    block: nbd: Fix convert qcow2 compressed to nbd
    
    When converting to qcow2 compressed format, the last step is a special
    zero length compressed write, ending in a call to bdrv_co_truncate(). This
    call always fails for the nbd driver since it does not implement
    bdrv_co_truncate().
    
    For block devices, which have the same limits, the call succeeds since
    the file driver implements bdrv_co_truncate(). If the caller asked to
    truncate to the same or smaller size with exact=false, the truncate
    succeeds. Implement the same logic for nbd.
    
    Example failing without this change:
    
    In one shell start qemu-nbd:
    
    $ truncate -s 1g test.tar
    $ qemu-nbd --socket=/tmp/nbd.sock --persistent --format=raw --offset 1536 test.tar
    
    In another shell convert an image to qcow2 compressed via NBD:
    
    $ echo "disk data" > disk.raw
    $ truncate -s 1g disk.raw
    $ qemu-img convert -f raw -O qcow2 -c disk1.raw nbd+unix:///?socket=/tmp/nbd.sock; echo $?
    1
    
    qemu-img failed, but the conversion was successful:
    
    $ qemu-img info nbd+unix:///?socket=/tmp/nbd.sock
    image: nbd+unix://?socket=/tmp/nbd.sock
    file format: qcow2
    virtual size: 1 GiB (1073741824 bytes)
    ...
    
    $ qemu-img check nbd+unix:///?socket=/tmp/nbd.sock
    No errors were found on the image.
    1/16384 = 0.01% allocated, 100.00% fragmented, 100.00% compressed clusters
    Image end offset: 393216
    
    $ qemu-img compare disk.raw nbd+unix:///?socket=/tmp/nbd.sock
    Images are identical.
    
    Fixes: https://bugzilla.redhat.com/1860627
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-2-nsoffer@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    [eblake: typo fixes]
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c    | 30 ++++++++++++++++++++++++++++++
 qemu-io-cmds.c |  2 +-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/block/nbd.c b/block/nbd.c
index 65a4f56924..8934bcb479 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1966,6 +1966,33 @@ static void nbd_close(BlockDriverState *bs)
     nbd_clear_bdrvstate(s);
 }
 
+/*
+ * NBD cannot truncate, but if the caller asks to truncate to the same size, or
+ * to a smaller size with exact=false, there is no reason to fail the
+ * operation.
+ *
+ * Preallocation mode is ignored since it does not seems useful to fail when
+ * we never change anything.
+ */
+static int coroutine_fn nbd_co_truncate(BlockDriverState *bs, int64_t offset,
+                                        bool exact, PreallocMode prealloc,
+                                        BdrvRequestFlags flags, Error **errp)
+{
+    BDRVNBDState *s = bs->opaque;
+
+    if (offset != s->info.size && exact) {
+        error_setg(errp, "Cannot resize NBD nodes");
+        return -ENOTSUP;
+    }
+
+    if (offset > s->info.size) {
+        error_setg(errp, "Cannot grow NBD nodes");
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
 static int64_t nbd_getlength(BlockDriverState *bs)
 {
     BDRVNBDState *s = bs->opaque;
@@ -2045,6 +2072,7 @@ static BlockDriver bdrv_nbd = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
@@ -2072,6 +2100,7 @@ static BlockDriver bdrv_nbd_tcp = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
@@ -2099,6 +2128,7 @@ static BlockDriver bdrv_nbd_unix = {
     .bdrv_co_flush_to_os        = nbd_co_flush,
     .bdrv_co_pdiscard           = nbd_client_co_pdiscard,
     .bdrv_refresh_limits        = nbd_refresh_limits,
+    .bdrv_co_truncate           = nbd_co_truncate,
     .bdrv_getlength             = nbd_getlength,
     .bdrv_detach_aio_context    = nbd_client_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_client_attach_aio_context,
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 851f07e8f8..baeae86d8c 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1715,7 +1715,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
      * exact=true.  It is better to err on the "emit more errors" side
      * than to be overly permissive.
      */
-    ret = blk_truncate(blk, offset, true, PREALLOC_MODE_OFF, 0, &local_err);
+    ret = blk_truncate(blk, offset, false, PREALLOC_MODE_OFF, 0, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
         return ret;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16650.41262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcww-0005A3-M5; Fri, 30 Oct 2020 22:32:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16650.41262; Fri, 30 Oct 2020 22:32:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcww-00059u-J8; Fri, 30 Oct 2020 22:32:46 +0000
Received: by outflank-mailman (input) for mailman id 16650;
 Fri, 30 Oct 2020 22:32:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcwv-00059l-Hs
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d3c2d5bb-9725-4f4d-86fc-78298c2c0f46;
 Fri, 30 Oct 2020 22:32:44 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwu-0005Kn-EO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcwu-0004q6-Ca
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcwv-00059l-Hs
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:45 +0000
X-Inumbo-ID: d3c2d5bb-9725-4f4d-86fc-78298c2c0f46
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d3c2d5bb-9725-4f4d-86fc-78298c2c0f46;
	Fri, 30 Oct 2020 22:32:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BZ0XBmlZyFwwrl0X0cQE9O6EbWXSKMfKjjtwYvEAROI=; b=2A8ASiWsqGbe5YYS68K2I9qp4l
	FKYvc7fPymwu0lYfhGWXKN9tnpvvJzWcF4h1/eUltkLpHmz89LdYfYDhDXdmBH2cpiDoa68HOrSCP
	hEDZPAM9+fo/QLeCHawucw08wvZ9sRzng9y9VxlUqoZAdD/Ga5yNqNSB/JeDbsBibkMg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwu-0005Kn-EO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcwu-0004q6-Ca
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:44 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Make qemu_nbd_popen() a contextmanager
Message-Id: <E1kYcwu-0004q6-Ca@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:44 +0000

commit b7719bcad2e92bab5aae3166fa9011f127e6ee49
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:44 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Make qemu_nbd_popen() a contextmanager
    
    Instead of duplicating the code to wait until the server is ready and
    remember to terminate the server and wait for it, make it possible to
    use like this:
    
        with qemu_nbd_popen('-k', sock, image):
            # Access image via qemu-nbd socket...
    
    Only test 264 used this helper, but I had to modify the output since it
    did not consistently when starting and stopping qemu-nbd.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-3-nsoffer@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/264        | 76 ++++++++++++++++---------------------------
 tests/qemu-iotests/264.out    |  2 ++
 tests/qemu-iotests/iotests.py | 28 ++++++++++++++--
 3 files changed, 56 insertions(+), 50 deletions(-)

diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264
index 304a7443d7..666f164ed8 100755
--- a/tests/qemu-iotests/264
+++ b/tests/qemu-iotests/264
@@ -36,48 +36,32 @@ wait_step = 0.2
 
 qemu_img_create('-f', iotests.imgfmt, disk_a, str(size))
 qemu_img_create('-f', iotests.imgfmt, disk_b, str(size))
-srv = qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b)
 
-# Wait for NBD server availability
-t = 0
-ok = False
-while t < wait_limit:
-    ok = qemu_io_silent_check('-f', 'raw', '-c', 'read 0 512', nbd_uri)
-    if ok:
-        break
-    time.sleep(wait_step)
-    t += wait_step
+with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b):
+    vm = iotests.VM().add_drive(disk_a)
+    vm.launch()
+    vm.hmp_qemu_io('drive0', 'write 0 {}'.format(size))
+
+    vm.qmp_log('blockdev-add', filters=[iotests.filter_qmp_testfiles],
+               **{'node_name': 'backup0',
+                  'driver': 'raw',
+                  'file': {'driver': 'nbd',
+                           'server': {'type': 'unix', 'path': nbd_sock},
+                           'reconnect-delay': 10}})
+    vm.qmp_log('blockdev-backup', device='drive0', sync='full', target='backup0',
+               speed=(1 * 1024 * 1024))
+
+    # Wait for some progress
+    t = 0
+    while t < wait_limit:
+        jobs = vm.qmp('query-block-jobs')['return']
+        if jobs and jobs[0]['offset'] > 0:
+            break
+        time.sleep(wait_step)
+        t += wait_step
 
-assert ok
-
-vm = iotests.VM().add_drive(disk_a)
-vm.launch()
-vm.hmp_qemu_io('drive0', 'write 0 {}'.format(size))
-
-vm.qmp_log('blockdev-add', filters=[iotests.filter_qmp_testfiles],
-           **{'node_name': 'backup0',
-              'driver': 'raw',
-              'file': {'driver': 'nbd',
-                       'server': {'type': 'unix', 'path': nbd_sock},
-                       'reconnect-delay': 10}})
-vm.qmp_log('blockdev-backup', device='drive0', sync='full', target='backup0',
-           speed=(1 * 1024 * 1024))
-
-# Wait for some progress
-t = 0
-while t < wait_limit:
-    jobs = vm.qmp('query-block-jobs')['return']
     if jobs and jobs[0]['offset'] > 0:
-        break
-    time.sleep(wait_step)
-    t += wait_step
-
-if jobs and jobs[0]['offset'] > 0:
-    log('Backup job is started')
-
-log('Kill NBD server')
-srv.kill()
-srv.wait()
+        log('Backup job is started')
 
 jobs = vm.qmp('query-block-jobs')['return']
 if jobs and jobs[0]['offset'] < jobs[0]['len']:
@@ -88,12 +72,8 @@ vm.qmp_log('block-job-set-speed', device='drive0', speed=0)
 # Emulate server down time for 1 second
 time.sleep(1)
 
-log('Start NBD server')
-srv = qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b)
-
-e = vm.event_wait('BLOCK_JOB_COMPLETED')
-log('Backup completed: {}'.format(e['data']['offset']))
-
-vm.qmp_log('blockdev-del', node_name='backup0')
-srv.kill()
-vm.shutdown()
+with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk_b):
+    e = vm.event_wait('BLOCK_JOB_COMPLETED')
+    log('Backup completed: {}'.format(e['data']['offset']))
+    vm.qmp_log('blockdev-del', node_name='backup0')
+    vm.shutdown()
diff --git a/tests/qemu-iotests/264.out b/tests/qemu-iotests/264.out
index 3000944b09..c45b1e81ef 100644
--- a/tests/qemu-iotests/264.out
+++ b/tests/qemu-iotests/264.out
@@ -1,3 +1,4 @@
+Start NBD server
 {"execute": "blockdev-add", "arguments": {"driver": "raw", "file": {"driver": "nbd", "reconnect-delay": 10, "server": {"path": "TEST_DIR/PID-nbd-sock", "type": "unix"}}, "node-name": "backup0"}}
 {"return": {}}
 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "speed": 1048576, "sync": "full", "target": "backup0"}}
@@ -11,3 +12,4 @@ Start NBD server
 Backup completed: 5242880
 {"execute": "blockdev-del", "arguments": {"node-name": "backup0"}}
 {"return": {}}
+Kill NBD server
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 3590ed78a0..8f79668435 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -28,10 +28,13 @@ import signal
 import struct
 import subprocess
 import sys
+import time
 from typing import (Any, Callable, Dict, Iterable,
                     List, Optional, Sequence, Tuple, TypeVar)
 import unittest
 
+from contextlib import contextmanager
+
 # pylint: disable=import-error, wrong-import-position
 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu import qtest
@@ -270,9 +273,30 @@ def qemu_nbd_early_pipe(*args):
 
     return subp.returncode, output if subp.returncode else ''
 
+@contextmanager
 def qemu_nbd_popen(*args):
-    '''Run qemu-nbd in daemon mode and return the parent's exit code'''
-    return subprocess.Popen(qemu_nbd_args + ['--persistent'] + list(args))
+    '''Context manager running qemu-nbd within the context'''
+    pid_file = file_path("pid")
+
+    cmd = list(qemu_nbd_args)
+    cmd.extend(('--persistent', '--pid-file', pid_file))
+    cmd.extend(args)
+
+    log('Start NBD server')
+    p = subprocess.Popen(cmd)
+    try:
+        while not os.path.exists(pid_file):
+            if p.poll() is not None:
+                raise RuntimeError(
+                    "qemu-nbd terminated with exit code {}: {}"
+                    .format(p.returncode, ' '.join(cmd)))
+
+            time.sleep(0.01)
+        yield
+    finally:
+        log('Kill NBD server')
+        p.kill()
+        p.wait()
 
 def compare_images(img1, img2, fmt1=imgfmt, fmt2=imgfmt):
     '''Return True if two image files are identical'''
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:32:56 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:32:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16651.41268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcx6-0005Bg-Oc; Fri, 30 Oct 2020 22:32:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16651.41268; Fri, 30 Oct 2020 22:32:56 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcx6-0005BU-Kg; Fri, 30 Oct 2020 22:32:56 +0000
Received: by outflank-mailman (input) for mailman id 16651;
 Fri, 30 Oct 2020 22:32:55 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcx5-0005BJ-Fa
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:55 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 6b6bc49b-c110-4d85-ab47-62f8a54bca5b;
 Fri, 30 Oct 2020 22:32:54 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcx4-0005Kt-Hx
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcx4-0004qj-HF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcx5-0005BJ-Fa
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:55 +0000
X-Inumbo-ID: 6b6bc49b-c110-4d85-ab47-62f8a54bca5b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 6b6bc49b-c110-4d85-ab47-62f8a54bca5b;
	Fri, 30 Oct 2020 22:32:54 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MqAKQGouh7JoywIvQDr60PJHAWhPbcZCI5a46qyprSw=; b=dJMIIaf2Gup/Z6iUj/rNDoh/RO
	BTairmcCb41lBxNcOFWR1ESKMEAQDbw21MuO5RMmUAmJFQkYAj57A135ifP+SMiN1unOv0B/t87hn
	HNhxBDzZ0r4/c84ugD1aRuvrxsmxKzjZPI++XF7x394i7sadCVp06htdIF6ibGO3wpb8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcx4-0005Kt-Hx
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcx4-0004qj-HF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:32:54 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Add more qemu_img helpers
Message-Id: <E1kYcx4-0004qj-HF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:32:54 +0000

commit 4b914b01cdb95fe5722cb70826db7f0a262e8d2a
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:45 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Add more qemu_img helpers
    
    Add 2 helpers for measuring and checking images:
    - qemu_img_measure()
    - qemu_img_check()
    
    Both use --output-json and parse the returned json to make easy to use
    in other tests. I'm going to use them in a new test, and I hope they
    will be useful in may other tests.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-4-nsoffer@redhat.com>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/iotests.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8f79668435..717b5b652c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -141,6 +141,12 @@ def qemu_img_create(*args):
 
     return qemu_img(*args)
 
+def qemu_img_measure(*args):
+    return json.loads(qemu_img_pipe("measure", "--output", "json", *args))
+
+def qemu_img_check(*args):
+    return json.loads(qemu_img_pipe("check", "--output", "json", *args))
+
 def qemu_img_verbose(*args):
     '''Run qemu-img without suppressing its output and return the exit code'''
     exitcode = subprocess.call(qemu_img_args + list(args))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:07 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16652.41272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxH-0005EZ-Q9; Fri, 30 Oct 2020 22:33:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16652.41272; Fri, 30 Oct 2020 22:33:07 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxH-0005EK-MD; Fri, 30 Oct 2020 22:33:07 +0000
Received: by outflank-mailman (input) for mailman id 16652;
 Fri, 30 Oct 2020 22:33:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcxG-0005EA-9s
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5dc4f0b7-b719-4d96-a1e2-f97ac90f1c10;
 Fri, 30 Oct 2020 22:33:04 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxE-0005LG-Mt
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxE-0004rm-Kk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:04 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcxG-0005EA-9s
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:06 +0000
X-Inumbo-ID: 5dc4f0b7-b719-4d96-a1e2-f97ac90f1c10
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5dc4f0b7-b719-4d96-a1e2-f97ac90f1c10;
	Fri, 30 Oct 2020 22:33:04 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4m/34utZ5t7uF2q+2cMO5HJae0ncDqFPGdTqOX68TVQ=; b=Vaul/h577r3zdYE8lDdc+3jwXX
	D+VnsReaKPo+7gyVPD+JESe1srRiPrIeeIo6TRzaj40MTgAujvqT863lC5suI3ZjabiRVHgo2q1mw
	vmceQJ/2NMTA1t8WUEF4sD/yRAirQAruCK2QohzijRXbBtWaib+6X5tw4XT1nG/22nDU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxE-0005LG-Mt
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxE-0004rm-Kk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:04 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests: Test convert to qcow2 compressed to NBD
Message-Id: <E1kYcxE-0004rm-Kk@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:04 +0000

commit 03a970bb6ffe17a3ae77d54d4127330cf9a73587
Author:     Nir Soffer <nirsof@gmail.com>
AuthorDate: Tue Jul 28 00:58:46 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Test convert to qcow2 compressed to NBD
    
    Add test for "qemu-img convert -O qcow2 -c" to NBD target. The tests    
    create a OVA file and write compressed qcow2 disk content directly into
    the OVA file via qemu-nbd.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    Message-Id: <20200727215846.395443-5-nsoffer@redhat.com>
    Tested-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/302     | 127 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/302.out |  31 +++++++++++
 tests/qemu-iotests/group   |   1 +
 3 files changed, 159 insertions(+)

diff --git a/tests/qemu-iotests/302 b/tests/qemu-iotests/302
new file mode 100755
index 0000000000..a8506bda15
--- /dev/null
+++ b/tests/qemu-iotests/302
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+#
+# Tests converting qcow2 compressed to NBD
+#
+# Copyright (c) 2020 Nir Soffer <nirsof@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# owner=nirsof@gmail.com
+
+import io
+import tarfile
+
+import iotests
+
+from iotests import (
+    file_path,
+    qemu_img,
+    qemu_img_check,
+    qemu_img_create,
+    qemu_img_log,
+    qemu_img_measure,
+    qemu_io,
+    qemu_nbd_popen,
+)
+
+iotests.script_initialize(supported_fmts=["qcow2"])
+
+# Create source disk. Using qcow2 to enable strict comparing later, and
+# avoid issues with random filesystem on CI environment.
+src_disk = file_path("disk.qcow2")
+qemu_img_create("-f", iotests.imgfmt, src_disk, "1g")
+qemu_io("-f", iotests.imgfmt, "-c", "write 1m 64k", src_disk)
+
+# The use case is writing qcow2 image directly into an ova file, which
+# is a tar file with specific layout. This is tricky since we don't know the
+# size of the image before compressing, so we have to do:
+# 1. Add an ovf file.
+# 2. Find the offset of the next member data.
+# 3. Make room for image data, allocating for the worst case.
+# 4. Write compressed image data into the tar.
+# 5. Add a tar entry with the actual image size.
+# 6. Shrink the tar to the actual size, aligned to 512 bytes.
+
+tar_file = file_path("test.ova")
+
+with tarfile.open(tar_file, "w") as tar:
+
+    # 1. Add an ovf file.
+
+    ovf_data = b"<xml/>"
+    ovf = tarfile.TarInfo("vm.ovf")
+    ovf.size = len(ovf_data)
+    tar.addfile(ovf, io.BytesIO(ovf_data))
+
+    # 2. Find the offset of the next member data.
+
+    offset = tar.fileobj.tell() + 512
+
+    # 3. Make room for image data, allocating for the worst case.
+
+    measure = qemu_img_measure("-O", "qcow2", src_disk)
+    tar.fileobj.truncate(offset + measure["required"])
+
+    # 4. Write compressed image data into the tar.
+
+    nbd_sock = file_path("nbd-sock", base_dir=iotests.sock_dir)
+    nbd_uri = "nbd+unix:///exp?socket=" + nbd_sock
+
+    # Use raw format to allow creating qcow2 directly into tar file.
+    with qemu_nbd_popen(
+            "--socket", nbd_sock,
+            "--export-name", "exp",
+            "--format", "raw",
+            "--offset", str(offset),
+            tar_file):
+
+        iotests.log("=== Target image info ===")
+        qemu_img_log("info", nbd_uri)
+
+        qemu_img(
+            "convert",
+            "-f", iotests.imgfmt,
+            "-O", "qcow2",
+            "-c",
+            src_disk,
+            nbd_uri)
+
+        iotests.log("=== Converted image info ===")
+        qemu_img_log("info", nbd_uri)
+
+        iotests.log("=== Converted image check ===")
+        qemu_img_log("check", nbd_uri)
+
+        iotests.log("=== Comparing to source disk ===")
+        qemu_img_log("compare", src_disk, nbd_uri)
+
+        actual_size = qemu_img_check(nbd_uri)["image-end-offset"]
+
+    # 5. Add a tar entry with the actual image size.
+
+    disk = tarfile.TarInfo("disk")
+    disk.size = actual_size
+    tar.addfile(disk)
+
+    # 6. Shrink the tar to the actual size, aligned to 512 bytes.
+
+    tar_size = offset + (disk.size + 511) & ~511
+    tar.fileobj.seek(tar_size)
+    tar.fileobj.truncate(tar_size)
+
+with tarfile.open(tar_file) as tar:
+    members = [{"name": m.name, "size": m.size, "offset": m.offset_data}
+               for m in tar]
+    iotests.log("=== OVA file contents ===")
+    iotests.log(members)
diff --git a/tests/qemu-iotests/302.out b/tests/qemu-iotests/302.out
new file mode 100644
index 0000000000..e37d3a1030
--- /dev/null
+++ b/tests/qemu-iotests/302.out
@@ -0,0 +1,31 @@
+Start NBD server
+=== Target image info ===
+image: nbd+unix:///exp?socket=SOCK_DIR/PID-nbd-sock
+file format: raw
+virtual size: 448 KiB (458752 bytes)
+disk size: unavailable
+
+=== Converted image info ===
+image: nbd+unix:///exp?socket=SOCK_DIR/PID-nbd-sock
+file format: qcow2
+virtual size: 1 GiB (1073741824 bytes)
+disk size: unavailable
+cluster_size: 65536
+Format specific information:
+    compat: 1.1
+    compression type: zlib
+    lazy refcounts: false
+    refcount bits: 16
+    corrupt: false
+
+=== Converted image check ===
+No errors were found on the image.
+1/16384 = 0.01% allocated, 100.00% fragmented, 100.00% compressed clusters
+Image end offset: 393216
+
+=== Comparing to source disk ===
+Images are identical.
+
+Kill NBD server
+=== OVA file contents ===
+[{"name": "vm.ovf", "offset": 512, "size": 6}, {"name": "disk", "offset": 1536, "size": 393216}]
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 1d0252e1f0..1e1cb27bc8 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -308,3 +308,4 @@
 297 meta
 299 auto quick
 301 backing quick
+302 quick
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:17 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16653.41274 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxR-0005Pi-RR; Fri, 30 Oct 2020 22:33:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16653.41274; Fri, 30 Oct 2020 22:33:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxR-0005Pa-Nk; Fri, 30 Oct 2020 22:33:17 +0000
Received: by outflank-mailman (input) for mailman id 16653;
 Fri, 30 Oct 2020 22:33:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcxQ-0005L6-AH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e2ce7118-69a6-4715-83d8-a707722c766a;
 Fri, 30 Oct 2020 22:33:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxO-0005LQ-QZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxO-0004sW-Pp
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:14 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcxQ-0005L6-AH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:16 +0000
X-Inumbo-ID: e2ce7118-69a6-4715-83d8-a707722c766a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e2ce7118-69a6-4715-83d8-a707722c766a;
	Fri, 30 Oct 2020 22:33:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8JqKmW5/XkHr8sBsmeP0ER4uALk90aDDESaysJ1s0MY=; b=SoK5xPqYArQJ0P07pg849UpqYq
	NVL6xGyaD9NckGpIUxat3KZokg+OEE/RgQBQEXvAIyWhNVLBsMaUrk0knuMU0a1VLR/WzwCmM6eqe
	nJFTQV+UgR9OevZebHkNFzkeW8Fz5wGfj7Aii1wB8AFmARjwvT7gRnduFz9MxU4bNXKw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxO-0005LQ-QZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxO-0004sW-Pp
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:14 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/nbd: split nbd_establish_connection out of nbd_client_connect
Message-Id: <E1kYcxO-0004sW-Pp@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:14 +0000

commit fa35591b9cb9a7fd0af2d8c2d8848abba30d3c69
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:47 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: split nbd_establish_connection out of nbd_client_connect
    
    We are going to implement non-blocking version of
    nbd_establish_connection, which for a while will be used only for
    nbd_reconnect_attempt, not for nbd_open, so we need to call it
    separately.
    
    Refactor nbd_reconnect_attempt in a way which makes next commit
    simpler.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727184751.15704-2-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c        | 60 ++++++++++++++++++++++++++++++++----------------------
 block/trace-events |  4 ++--
 2 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index 8934bcb479..3558c173e3 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -93,7 +93,10 @@ typedef struct BDRVNBDState {
     char *x_dirty_bitmap;
 } BDRVNBDState;
 
-static int nbd_client_connect(BlockDriverState *bs, Error **errp);
+static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
+                                                  Error **errp);
+static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
+                                Error **errp);
 
 static void nbd_clear_bdrvstate(BDRVNBDState *s)
 {
@@ -241,7 +244,9 @@ static bool nbd_client_connecting_wait(BDRVNBDState *s)
 
 static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
 {
+    int ret;
     Error *local_err = NULL;
+    QIOChannelSocket *sioc;
 
     if (!nbd_client_connecting(s)) {
         return;
@@ -280,19 +285,25 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
         s->ioc = NULL;
     }
 
-    s->connect_status = nbd_client_connect(s->bs, &local_err);
+    sioc = nbd_establish_connection(s->saddr, &local_err);
+    if (!sioc) {
+        ret = -ECONNREFUSED;
+        goto out;
+    }
+
+    ret = nbd_client_handshake(s->bs, sioc, &local_err);
+
+out:
+    s->connect_status = ret;
     error_free(s->connect_err);
     s->connect_err = NULL;
     error_propagate(&s->connect_err, local_err);
 
-    if (s->connect_status < 0) {
-        /* failed attempt */
-        return;
+    if (ret >= 0) {
+        /* successfully connected */
+        s->state = NBD_CLIENT_CONNECTED;
+        qemu_co_queue_restart_all(&s->free_sema);
     }
-
-    /* successfully connected */
-    s->state = NBD_CLIENT_CONNECTED;
-    qemu_co_queue_restart_all(&s->free_sema);
 }
 
 static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
@@ -1425,24 +1436,15 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
     return sioc;
 }
 
-static int nbd_client_connect(BlockDriverState *bs, Error **errp)
+/* nbd_client_handshake takes ownership on sioc. On failure it is unref'ed. */
+static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
+                                Error **errp)
 {
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
     AioContext *aio_context = bdrv_get_aio_context(bs);
     int ret;
 
-    /*
-     * establish TCP connection, return error if it fails
-     * TODO: Configurable retry-until-timeout behaviour.
-     */
-    QIOChannelSocket *sioc = nbd_establish_connection(s->saddr, errp);
-
-    if (!sioc) {
-        return -ECONNREFUSED;
-    }
-
-    /* NBD handshake */
-    trace_nbd_client_connect(s->export);
+    trace_nbd_client_handshake(s->export);
     qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
     qio_channel_attach_aio_context(QIO_CHANNEL(sioc), aio_context);
 
@@ -1489,7 +1491,7 @@ static int nbd_client_connect(BlockDriverState *bs, Error **errp)
         object_ref(OBJECT(s->ioc));
     }
 
-    trace_nbd_client_connect_success(s->export);
+    trace_nbd_client_handshake_success(s->export);
 
     return 0;
 
@@ -1894,6 +1896,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
 {
     int ret;
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
+    QIOChannelSocket *sioc;
 
     ret = nbd_process_options(bs, options, errp);
     if (ret < 0) {
@@ -1904,7 +1907,16 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
     qemu_co_mutex_init(&s->send_mutex);
     qemu_co_queue_init(&s->free_sema);
 
-    ret = nbd_client_connect(bs, errp);
+    /*
+     * establish TCP connection, return error if it fails
+     * TODO: Configurable retry-until-timeout behaviour.
+     */
+    sioc = nbd_establish_connection(s->saddr, errp);
+    if (!sioc) {
+        return -ECONNREFUSED;
+    }
+
+    ret = nbd_client_handshake(bs, sioc, errp);
     if (ret < 0) {
         nbd_clear_bdrvstate(s);
         return ret;
diff --git a/block/trace-events b/block/trace-events
index d3533ca896..9158335061 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -168,8 +168,8 @@ nbd_parse_blockstatus_compliance(const char *err) "ignoring extra data from non-
 nbd_structured_read_compliance(const char *type) "server sent non-compliant unaligned read %s chunk"
 nbd_read_reply_entry_fail(int ret, const char *err) "ret = %d, err: %s"
 nbd_co_request_fail(uint64_t from, uint32_t len, uint64_t handle, uint16_t flags, uint16_t type, const char *name, int ret, const char *err) "Request failed { .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 ", .flags = 0x%" PRIx16 ", .type = %" PRIu16 " (%s) } ret = %d, err: %s"
-nbd_client_connect(const char *export_name) "export '%s'"
-nbd_client_connect_success(const char *export_name) "export '%s'"
+nbd_client_handshake(const char *export_name) "export '%s'"
+nbd_client_handshake_success(const char *export_name) "export '%s'"
 
 # ssh.c
 ssh_restart_coroutine(void *co) "co=%p"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:27 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16654.41278 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxa-0005R4-U2; Fri, 30 Oct 2020 22:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16654.41278; Fri, 30 Oct 2020 22:33:26 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxa-0005Qw-Qi; Fri, 30 Oct 2020 22:33:26 +0000
Received: by outflank-mailman (input) for mailman id 16654;
 Fri, 30 Oct 2020 22:33:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcxZ-0005Qp-Vj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 838747ed-bd24-4a23-b43e-9f8344674d87;
 Fri, 30 Oct 2020 22:33:25 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxY-0005LY-Ty
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxY-0004t6-TC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcxZ-0005Qp-Vj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:26 +0000
X-Inumbo-ID: 838747ed-bd24-4a23-b43e-9f8344674d87
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 838747ed-bd24-4a23-b43e-9f8344674d87;
	Fri, 30 Oct 2020 22:33:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nAvXNHM3ODIpU6qpoY9cg4QGbBWYzK07dsqRtPizn7g=; b=vk2KNUiQrNwv2t4euPzcYbJF1a
	Rvr/wuVCTKw9dUQs/grsVROr0I5hWGJA7lcsGOQr+zjP3uhWkU5XsVyqRSfYk7JedIF9Y7QpyLDFM
	vXjLgVWgfen31crZvplj1toLinNRPzuM2HRL4ri672R4mDZFoDXKXGMxtXSORHQqCofQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxY-0005LY-Ty
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxY-0004t6-TC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:24 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/nbd: allow drain during reconnect attempt
Message-Id: <E1kYcxY-0004t6-TC@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:24 +0000

commit dd1ec1a4afe190e030edfa052d95c9e6e065438c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:48 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: allow drain during reconnect attempt
    
    It should be safe to reenter qio_channel_yield() on io/channel read/write
    path, so it's safe to reduce in_flight and allow attaching new aio
    context. And no problem to allow drain itself: connection attempt is
    not a guest request. Moreover, if remote server is down, we can hang
    in negotiation, blocking drain section and provoking a dead lock.
    
    How to reproduce the dead lock:
    
    1. Create nbd-fault-injector.conf with the following contents:
    
    [inject-error "mega1"]
    event=data
    io=readwrite
    when=before
    
    2. In one terminal run nbd-fault-injector in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./nbd-fault-injector.py 127.0.0.1:10000 nbd-fault-injector.conf;
    done
    
    3. In another terminal run qemu-io in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./qemu-io -c 'read 0 512' nbd://127.0.0.1:10000;
    done
    
    After some time, qemu-io will hang trying to drain, for example, like
    this:
    
     #3 aio_poll (ctx=0x55f006bdd890, blocking=true) at
        util/aio-posix.c:600
     #4 bdrv_do_drained_begin (bs=0x55f006bea710, recursive=false,
        parent=0x0, ignore_bds_parents=false, poll=true) at block/io.c:427
     #5 bdrv_drained_begin (bs=0x55f006bea710) at block/io.c:433
     #6 blk_drain (blk=0x55f006befc80) at block/block-backend.c:1710
     #7 blk_unref (blk=0x55f006befc80) at block/block-backend.c:498
     #8 bdrv_open_inherit (filename=0x7fffba1563bc
        "nbd+tcp://127.0.0.1:10000", reference=0x0, options=0x55f006be86d0,
        flags=24578, parent=0x0, child_class=0x0, child_role=0,
        errp=0x7fffba154620) at block.c:3491
     #9 bdrv_open (filename=0x7fffba1563bc "nbd+tcp://127.0.0.1:10000",
        reference=0x0, options=0x0, flags=16386, errp=0x7fffba154620) at
        block.c:3513
     #10 blk_new_open (filename=0x7fffba1563bc "nbd+tcp://127.0.0.1:10000",
        reference=0x0, options=0x0, flags=16386, errp=0x7fffba154620) at
        block/block-backend.c:421
    
    And connection_co stack like this:
    
     #0 qemu_coroutine_switch (from_=0x55f006bf2650, to_=0x7fe96e07d918,
        action=COROUTINE_YIELD) at util/coroutine-ucontext.c:302
     #1 qemu_coroutine_yield () at util/qemu-coroutine.c:193
     #2 qio_channel_yield (ioc=0x55f006bb3c20, condition=G_IO_IN) at
        io/channel.c:472
     #3 qio_channel_readv_all_eof (ioc=0x55f006bb3c20, iov=0x7fe96d729bf0,
        niov=1, errp=0x7fe96d729eb0) at io/channel.c:110
     #4 qio_channel_readv_all (ioc=0x55f006bb3c20, iov=0x7fe96d729bf0,
        niov=1, errp=0x7fe96d729eb0) at io/channel.c:143
     #5 qio_channel_read_all (ioc=0x55f006bb3c20, buf=0x7fe96d729d28
        "\300.\366\004\360U", buflen=8, errp=0x7fe96d729eb0) at
        io/channel.c:247
     #6 nbd_read (ioc=0x55f006bb3c20, buffer=0x7fe96d729d28, size=8,
        desc=0x55f004f69644 "initial magic", errp=0x7fe96d729eb0) at
        /work/src/qemu/master/include/block/nbd.h:365
     #7 nbd_read64 (ioc=0x55f006bb3c20, val=0x7fe96d729d28,
        desc=0x55f004f69644 "initial magic", errp=0x7fe96d729eb0) at
        /work/src/qemu/master/include/block/nbd.h:391
     #8 nbd_start_negotiate (aio_context=0x55f006bdd890,
        ioc=0x55f006bb3c20, tlscreds=0x0, hostname=0x0,
        outioc=0x55f006bf19f8, structured_reply=true,
        zeroes=0x7fe96d729dca, errp=0x7fe96d729eb0) at nbd/client.c:904
     #9 nbd_receive_negotiate (aio_context=0x55f006bdd890,
        ioc=0x55f006bb3c20, tlscreds=0x0, hostname=0x0,
        outioc=0x55f006bf19f8, info=0x55f006bf1a00, errp=0x7fe96d729eb0) at
        nbd/client.c:1032
     #10 nbd_client_connect (bs=0x55f006bea710, errp=0x7fe96d729eb0) at
        block/nbd.c:1460
     #11 nbd_reconnect_attempt (s=0x55f006bf19f0) at block/nbd.c:287
     #12 nbd_co_reconnect_loop (s=0x55f006bf19f0) at block/nbd.c:309
     #13 nbd_connection_entry (opaque=0x55f006bf19f0) at block/nbd.c:360
     #14 coroutine_trampoline (i0=113190480, i1=22000) at
        util/coroutine-ucontext.c:173
    
    Note, that the hang may be
    triggered by another bug, so the whole case is fixed only together with
    commit "block/nbd: on shutdown terminate connection attempt".
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20200727184751.15704-3-vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/block/nbd.c b/block/nbd.c
index 3558c173e3..ee9ab7512b 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -291,8 +291,22 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState *s)
         goto out;
     }
 
+    bdrv_dec_in_flight(s->bs);
+
     ret = nbd_client_handshake(s->bs, sioc, &local_err);
 
+    if (s->drained) {
+        s->wait_drained_end = true;
+        while (s->drained) {
+            /*
+             * We may be entered once from nbd_client_attach_aio_context_bh
+             * and then from nbd_client_co_drain_end. So here is a loop.
+             */
+            qemu_coroutine_yield();
+        }
+    }
+    bdrv_inc_in_flight(s->bs);
+
 out:
     s->connect_status = ret;
     error_free(s->connect_err);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:36 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16655.41282 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxk-0005SN-VC; Fri, 30 Oct 2020 22:33:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16655.41282; Fri, 30 Oct 2020 22:33:36 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxk-0005SG-SC; Fri, 30 Oct 2020 22:33:36 +0000
Received: by outflank-mailman (input) for mailman id 16655;
 Fri, 30 Oct 2020 22:33:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcxj-0005S8-US
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c01cd4a8-6ec2-4a74-99c1-d8497dda7751;
 Fri, 30 Oct 2020 22:33:35 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxj-0005Lg-1H
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxj-0004to-0S
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcxj-0005S8-US
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
X-Inumbo-ID: c01cd4a8-6ec2-4a74-99c1-d8497dda7751
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c01cd4a8-6ec2-4a74-99c1-d8497dda7751;
	Fri, 30 Oct 2020 22:33:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d9udp3yhLxWu4GHCpPgnQ61tjWXTGwYYMfIVNvk1EVc=; b=iFKDfN0bPfU0Gv+a04JTD9LBJT
	MlycYxj+bYAxvvPJbnv4uLgkFabmBOtoQEPoqZLKRXmAJ+2erwOTNJjtCEpDykzFEqIcc+CglpBoM
	r6ftQRtiHCelqZRuy1yt9sOQ2jshGf2RxlKZmMllWk4L/nnCs8BNlYsLmJP1S1FZkyC0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxj-0005Lg-1H
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxj-0004to-0S
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/nbd: on shutdown terminate connection attempt
Message-Id: <E1kYcxj-0004to-0S@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:35 +0000

commit fbeb3e63b34a1af4a968031de1c82e5edf20bf6c
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:49 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: on shutdown terminate connection attempt
    
    On shutdown nbd driver may be in a connecting state. We should shutdown
    it as well, otherwise we may hang in
    nbd_teardown_connection, waiting for conneciton_co to finish in
    BDRV_POLL_WHILE(bs, s->connection_co) loop if remote server is down.
    
    How to reproduce the dead lock:
    
    1. Create nbd-fault-injector.conf with the following contents:
    
    [inject-error "mega1"]
    event=data
    io=readwrite
    when=before
    
    2. In one terminal run nbd-fault-injector in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./nbd-fault-injector.py 127.0.0.1:10000 nbd-fault-injector.conf;
    done
    
    3. In another terminal run qemu-io in a loop, like this:
    
    n=1; while true; do
        echo $n; ((n++));
        ./qemu-io -c 'read 0 512' nbd://127.0.0.1:10000;
    done
    
    After some time, qemu-io will hang. Note, that this hang may be
    triggered by another bug, so the whole case is fixed only together with
    commit "block/nbd: allow drain during reconnect attempt".
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727184751.15704-4-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index ee9ab7512b..620c97be6b 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -209,11 +209,15 @@ static void nbd_teardown_connection(BlockDriverState *bs)
 {
     BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
 
-    if (s->state == NBD_CLIENT_CONNECTED) {
+    if (s->ioc) {
         /* finish any pending coroutines */
-        assert(s->ioc);
         qio_channel_shutdown(s->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
+    } else if (s->sioc) {
+        /* abort negotiation */
+        qio_channel_shutdown(QIO_CHANNEL(s->sioc), QIO_CHANNEL_SHUTDOWN_BOTH,
+                             NULL);
     }
+
     s->state = NBD_CLIENT_QUIT;
     if (s->connection_co) {
         if (s->connection_co_sleep_ns_state) {
@@ -1459,6 +1463,9 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
     int ret;
 
     trace_nbd_client_handshake(s->export);
+
+    s->sioc = sioc;
+
     qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
     qio_channel_attach_aio_context(QIO_CHANNEL(sioc), aio_context);
 
@@ -1473,6 +1480,7 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
     g_free(s->info.name);
     if (ret < 0) {
         object_unref(OBJECT(sioc));
+        s->sioc = NULL;
         return ret;
     }
     if (s->x_dirty_bitmap && !s->info.base_allocation) {
@@ -1498,8 +1506,6 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
         }
     }
 
-    s->sioc = sioc;
-
     if (!s->ioc) {
         s->ioc = QIO_CHANNEL(sioc);
         object_ref(OBJECT(s->ioc));
@@ -1520,6 +1526,7 @@ static int nbd_client_handshake(BlockDriverState *bs, QIOChannelSocket *sioc,
         nbd_send_request(s->ioc ?: QIO_CHANNEL(sioc), &request);
 
         object_unref(OBJECT(sioc));
+        s->sioc = NULL;
 
         return ret;
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:47 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16656.41286 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxv-0005UC-12; Fri, 30 Oct 2020 22:33:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16656.41286; Fri, 30 Oct 2020 22:33:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcxu-0005U4-UC; Fri, 30 Oct 2020 22:33:46 +0000
Received: by outflank-mailman (input) for mailman id 16656;
 Fri, 30 Oct 2020 22:33:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcxt-0005Tu-UJ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 95067acb-230c-4f5e-b52f-43dfbf62f8ad;
 Fri, 30 Oct 2020 22:33:45 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxt-0005MR-50
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcxt-0004ua-46
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcxt-0005Tu-UJ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
X-Inumbo-ID: 95067acb-230c-4f5e-b52f-43dfbf62f8ad
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 95067acb-230c-4f5e-b52f-43dfbf62f8ad;
	Fri, 30 Oct 2020 22:33:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4KNUFOyQfHR6vIUd3UOI5AVjUR1OEKjcbqPJb6peKIY=; b=H5x+HUD5JPtB1RhNzzunLMnF5n
	tI08I9z615BzTaRQBY0Ks4lB3aEqjK0s+ifhBEJYFlzTT/n1EuFtAu2xhHk0e5mNloNBalnlQAUH6
	BcZVpPRykqGNWzfpj5DGrkf3qbX50mIezDvbW36kwL26CPsaLhBHy3wFOLaFce6ufSzE=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxt-0005MR-50
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcxt-0004ua-46
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:45 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
Message-Id: <E1kYcxt-0004ua-46@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:45 +0000

commit 12c75e20a269ac917f4a76936d7142264e522233
Author:     Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
AuthorDate: Mon Jul 27 21:47:50 2020 +0300
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
    
    We try to go to wakeable sleep, so that, if drain begins it will break
    the sleep. But what if nbd_client_co_drain_begin() already called and
    s->drained is already true? We'll go to sleep, and drain will have to
    wait for the whole timeout. Let's improve it.
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20200727184751.15704-5-vsementsov@virtuozzo.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/nbd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/block/nbd.c b/block/nbd.c
index 620c97be6b..7bb881fef4 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -341,8 +341,6 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
             qemu_co_queue_restart_all(&s->free_sema);
         }
 
-        qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
-                                  &s->connection_co_sleep_ns_state);
         if (s->drained) {
             bdrv_dec_in_flight(s->bs);
             s->wait_drained_end = true;
@@ -354,9 +352,12 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState *s)
                 qemu_coroutine_yield();
             }
             bdrv_inc_in_flight(s->bs);
-        }
-        if (timeout < max_timeout) {
-            timeout *= 2;
+        } else {
+            qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
+                                      &s->connection_co_sleep_ns_state);
+            if (timeout < max_timeout) {
+                timeout *= 2;
+            }
         }
 
         nbd_reconnect_attempt(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:33:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:33:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16657.41290 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcy6-0005VV-2h; Fri, 30 Oct 2020 22:33:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16657.41290; Fri, 30 Oct 2020 22:33:58 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcy5-0005VN-Vs; Fri, 30 Oct 2020 22:33:57 +0000
Received: by outflank-mailman (input) for mailman id 16657;
 Fri, 30 Oct 2020 22:33:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcy4-0005V9-5o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:56 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 8ef9a1c3-8e43-4839-81c6-9284a267010b;
 Fri, 30 Oct 2020 22:33:55 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcy3-0005Mf-8v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcy3-0004vO-7z
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:55 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcy4-0005V9-5o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:56 +0000
X-Inumbo-ID: 8ef9a1c3-8e43-4839-81c6-9284a267010b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 8ef9a1c3-8e43-4839-81c6-9284a267010b;
	Fri, 30 Oct 2020 22:33:55 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a6d+PZFwQ+t0xvyDP7qJEF9ihWzQi/Jvhk6BtWCcd9c=; b=NBSYtZW1VTrLN/WjwofBb/3gsp
	23KxlQ5Bkkz4x3Yio1TrG9Hnu9f7qD2Sp7EERVGA4rjljCPF7EXv2DGtvP5LlhVRzQmGnrrQZ6wxx
	umHz+y/0rvu3I5TYk3N0XBeOOSpwYi6uOI8w2wCnlhqTYZu23GATstE9jcT+UILEoIJg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcy3-0005Mf-8v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcy3-0004vO-7z
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:33:55 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-28' into staging
Message-Id: <E1kYcy3-0004vO-7z@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:33:55 +0000

commit 5045be872db97be2aecc694bf43762e75e7e5395
Merge: b1753831b0e58587db4fdf8219237331269c00c3 12c75e20a269ac917f4a76936d7142264e522233
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 20:43:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 20:43:03 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-07-28' into staging
    
    nbd patches for 2020-07-28
    
    - fix NBD handling of trim/zero requests larger than 2G
    - allow no-op resizes on NBD (in turn fixing qemu-img convert -c into NBD)
    - several deadlock fixes when using NBD reconnect
    
    # gpg: Signature made Tue 28 Jul 2020 15:59:42 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-nbd-2020-07-28:
      block/nbd: nbd_co_reconnect_loop(): don't sleep if drained
      block/nbd: on shutdown terminate connection attempt
      block/nbd: allow drain during reconnect attempt
      block/nbd: split nbd_establish_connection out of nbd_client_connect
      iotests: Test convert to qcow2 compressed to NBD
      iotests: Add more qemu_img helpers
      iotests: Make qemu_nbd_popen() a contextmanager
      block: nbd: Fix convert qcow2 compressed to nbd
      nbd: Fix large trim/zero requests
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/nbd.c                   | 126 ++++++++++++++++++++++++++++++-----------
 block/trace-events            |   4 +-
 nbd/server.c                  |  28 ++++++++--
 qemu-io-cmds.c                |   2 +-
 tests/qemu-iotests/264        |  76 ++++++++++---------------
 tests/qemu-iotests/264.out    |   2 +
 tests/qemu-iotests/302        | 127 ++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/302.out    |  31 +++++++++++
 tests/qemu-iotests/group      |   1 +
 tests/qemu-iotests/iotests.py |  34 ++++++++++-
 10 files changed, 342 insertions(+), 89 deletions(-)

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:10 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16658.41294 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyG-0005Wj-4M; Fri, 30 Oct 2020 22:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16658.41294; Fri, 30 Oct 2020 22:34:08 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyG-0005Wa-17; Fri, 30 Oct 2020 22:34:08 +0000
Received: by outflank-mailman (input) for mailman id 16658;
 Fri, 30 Oct 2020 22:34:06 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcyE-0005WU-Lk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:06 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 97b4cae3-0ae7-4497-a5b2-4a58a3e78d34;
 Fri, 30 Oct 2020 22:34:05 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyD-0005N0-CW
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyD-0004wG-Bf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcyE-0005WU-Lk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:06 +0000
X-Inumbo-ID: 97b4cae3-0ae7-4497-a5b2-4a58a3e78d34
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 97b4cae3-0ae7-4497-a5b2-4a58a3e78d34;
	Fri, 30 Oct 2020 22:34:05 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ig3UIMcXP0ThMYgw+IffeSn9qItdChaUuj+NHmOCsjk=; b=QhBPGIETyx8wx3rGUHYDmhlkKQ
	qkdPQZl2mwycejE+iBVbI3WpkDZs/Ub66ENhWMABAiOrshgymi+BcSEjBPMq05MT1r5gz88nuOT1E
	NylSXA07UltBQsC/JTFk80UKn7cJP/5XGnT0jggvIrspj/ehYlZp7F/cDn1jFwKRIQ1Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyD-0005N0-CW
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyD-0004wG-Bf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:05 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update version for v5.1.0-rc2 release
Message-Id: <E1kYcyD-0004wG-Bf@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:05 +0000

commit 5772f2b1fc5d00e7e04e01fa28e9081d6550440a
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Jul 28 21:51:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Jul 28 21:51:03 2020 +0100

    Update version for v5.1.0-rc2 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 023d5c9cfb..388c02aef2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.91
+5.0.92
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:18 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16659.41297 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyQ-0005Xv-5h; Fri, 30 Oct 2020 22:34:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16659.41297; Fri, 30 Oct 2020 22:34:18 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyQ-0005Xn-2l; Fri, 30 Oct 2020 22:34:18 +0000
Received: by outflank-mailman (input) for mailman id 16659;
 Fri, 30 Oct 2020 22:34:16 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcyO-0005Xc-I6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:16 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id d41b5d91-2370-4289-b2f0-225c31ca9da3;
 Fri, 30 Oct 2020 22:34:15 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyN-0005N9-NQ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyN-0004xb-Mf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:15 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcyO-0005Xc-I6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:16 +0000
X-Inumbo-ID: d41b5d91-2370-4289-b2f0-225c31ca9da3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id d41b5d91-2370-4289-b2f0-225c31ca9da3;
	Fri, 30 Oct 2020 22:34:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5eXvAEEoebCSQr/MF6EErxpibOzPKVnGlBAemtERimA=; b=fYROyguOQSvt1zSCZ4Cc6lAEj0
	mtRtEIu3IVrscC4OMALjDXQm3eQ0/j0Fb+BiJD+4dCOpSLm1KEtFoJHbZwE2sX7pqPoAutyNj2N5V
	P34zSRrieuO75Ei0/YMuBLyjY/44esc3bJGFfd5dbeQ44tNv4acckD5oz4FD5/uGF0ds=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyN-0005N9-NQ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyN-0004xb-Mf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:15 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] trace/simple: Allow enabling simple traces from command line
Message-Id: <E1kYcyN-0004xb-Mf@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:15 +0000

commit 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4
Author:     Josh DuBois <duboisj@gmail.com>
AuthorDate: Thu Jul 23 00:33:59 2020 -0500
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Wed Jul 29 16:39:56 2020 +0100

    trace/simple: Allow enabling simple traces from command line
    
    The simple trace backend is enabled / disabled with a call
    to st_set_trace_file_enabled().  When initializing tracing
    from the command-line, this must be enabled on startup.
    (Prior to db25d56c014aa1a9, command-line initialization of
    simple trace worked because every call to st_set_trace_file
    enabled tracing.)
    
    Fixes: db25d56c014aa1a96319c663e0a60346a223b31e
    Signed-off-by: Josh DuBois <josh@joshdubois.com>
    Message-id: 20200723053359.256928-1-josh@joshdubois.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 trace/control.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/trace/control.c b/trace/control.c
index 2ffe000818..6558b5c906 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -225,6 +225,7 @@ void trace_init_file(const char *file)
 {
 #ifdef CONFIG_TRACE_SIMPLE
     st_set_trace_file(file);
+    st_set_trace_file_enabled(true);
 #elif defined CONFIG_TRACE_LOG
     /*
      * If both the simple and the log backends are enabled, "--trace file"
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:28 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16660.41303 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcya-0005ZH-89; Fri, 30 Oct 2020 22:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16660.41303; Fri, 30 Oct 2020 22:34:28 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcya-0005Z9-4P; Fri, 30 Oct 2020 22:34:28 +0000
Received: by outflank-mailman (input) for mailman id 16660;
 Fri, 30 Oct 2020 22:34:26 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcyY-0005Yu-Kh
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:26 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 7fd98325-5411-4136-8aff-ccee14effac9;
 Fri, 30 Oct 2020 22:34:26 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyX-0005NH-Rd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyX-0004ye-QE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:25 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcyY-0005Yu-Kh
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:26 +0000
X-Inumbo-ID: 7fd98325-5411-4136-8aff-ccee14effac9
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 7fd98325-5411-4136-8aff-ccee14effac9;
	Fri, 30 Oct 2020 22:34:26 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jT5bmce1ZgIHoVqnSME4jdAz4Dh89qzXeYKIfUWgYKg=; b=i0D42JUrSfSZ7rLGJ8bf2/vE+v
	4QocbKtBFlFpEUrBIGaV2UGbUNe60kS5x4AAPzZzntXB4xXHVgz1lP4HHdj05cKFm0LU3OfKJYCfy
	kQmoo3EepglAUG6HGfDSvb0pdd6zWdMVxKzSbpEmjdbd4STzdecrs7e9xn9bxefLI4Bs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyX-0005NH-Rd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyX-0004ye-QE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:25 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tracetool: carefully define SDT_USE_VARIADIC
Message-Id: <E1kYcyX-0004ye-QE@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:25 +0000

commit 000822441e34916991f7c03217dc24f38be49e50
Author:     Stefan Hajnoczi <stefanha@redhat.com>
AuthorDate: Wed Jul 29 16:39:26 2020 +0100
Commit:     Stefan Hajnoczi <stefanha@redhat.com>
CommitDate: Thu Jul 30 16:02:38 2020 +0100

    tracetool: carefully define SDT_USE_VARIADIC
    
    The dtrace backend defines SDT_USE_VARIADIC as a workaround for a
    conflict with a LTTng UST header file, which requires SDT_USE_VARIADIC
    to be defined.
    
    LTTng UST <lttng/tracepoint.h> breaks if included after generated dtrace
    headers because SDT_USE_VARIADIC will already be defined:
    
      #ifdef LTTNG_UST_HAVE_SDT_INTEGRATION
      #define SDT_USE_VARIADIC <-- error, it's already defined
      #include <sys/sdt.h>
    
    Be more careful when defining SDT_USE_VARIADIC. This fixes the build
    when both the dtrace and ust tracers are enabled at the same time.
    
    Fixes: 27e08bab94f7c6ebe0b75938c98c394c969e3fd8 ("tracetool: work around ust <sys/sdt.h> include conflict")
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 20200729153926.127083-1-stefanha@redhat.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 scripts/tracetool/backend/dtrace.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index b7fe4c1b50..fc0c8fc52f 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -44,11 +44,15 @@ def generate_h_begin(events, group):
     # require SDT_USE_VARIADIC to be defined. If dtrace includes <sys/sdt.h>
     # first without defining SDT_USE_VARIADIC then ust breaks because the
     # STAP_PROBEV() macro is not defined.
+    out('#ifndef SDT_USE_VARIADIC')
     out('#define SDT_USE_VARIADIC 1')
+    out('#endif')
 
     out('#include "%s"' % header,
         '')
 
+    out('#undef SDT_USE_VARIADIC')
+
     # SystemTap defines <provider>_<name>_ENABLED() but other DTrace
     # implementations might not.
     for e in events:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:38 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16661.41306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyk-0005al-Ao; Fri, 30 Oct 2020 22:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16661.41306; Fri, 30 Oct 2020 22:34:38 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyk-0005ad-7j; Fri, 30 Oct 2020 22:34:38 +0000
Received: by outflank-mailman (input) for mailman id 16661;
 Fri, 30 Oct 2020 22:34:36 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcyi-0005aS-N0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:36 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 4487fcf7-b98e-466d-b603-e866232b4344;
 Fri, 30 Oct 2020 22:34:36 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyh-0005NP-V4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcyh-0004zY-UK
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:35 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcyi-0005aS-N0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:36 +0000
X-Inumbo-ID: 4487fcf7-b98e-466d-b603-e866232b4344
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 4487fcf7-b98e-466d-b603-e866232b4344;
	Fri, 30 Oct 2020 22:34:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Vdc9/1P8IIfHZiDZ6nazPgwqejO7piSgmK7rg/fPJJc=; b=Q+Czbrh37AaLFjXl/y7q9UXZHO
	qPZwsDuKgrtCvETrQNrUpOsinuyuoCkDwSzBLJD8neJYHsM55cmsL89ptV18XnAzKt5NLsj2VTLuc
	NqxFhdbRqIK+7VwEdXnt0yxLK55i5B/O7sFsBPBNYdwuHd3K0zZY5Rrc7h107EUAWFJM=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyh-0005NP-V4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:35 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcyh-0004zY-UK
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:35 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Message-Id: <E1kYcyh-0004zY-UK@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:35 +0000

commit 1448629751871c4924c234c2faaa968fc26890e1
Merge: 5772f2b1fc5d00e7e04e01fa28e9081d6550440a 000822441e34916991f7c03217dc24f38be49e50
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Thu Jul 30 20:02:26 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Thu Jul 30 20:02:26 2020 +0100

    Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
    
    Pull request
    
    A build fix and a 'simple' trace backend regression fix.
    
    # gpg: Signature made Thu 30 Jul 2020 19:13:10 BST
    # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
    # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
    # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
    # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
    
    * remotes/stefanha/tags/tracing-pull-request:
      tracetool: carefully define SDT_USE_VARIADIC
      trace/simple: Allow enabling simple traces from command line
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 scripts/tracetool/backend/dtrace.py | 4 ++++
 trace/control.c                     | 1 +
 2 files changed, 5 insertions(+)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:48 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16662.41310 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyu-0005cb-CL; Fri, 30 Oct 2020 22:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16662.41310; Fri, 30 Oct 2020 22:34:48 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcyu-0005cV-9A; Fri, 30 Oct 2020 22:34:48 +0000
Received: by outflank-mailman (input) for mailman id 16662;
 Fri, 30 Oct 2020 22:34:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcyt-0005cI-1a
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:47 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c92c02ed-9b95-4434-81a9-23a52642f355;
 Fri, 30 Oct 2020 22:34:46 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcys-0005Nx-9R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcys-00050m-8d
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:46 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcyt-0005cI-1a
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:47 +0000
X-Inumbo-ID: c92c02ed-9b95-4434-81a9-23a52642f355
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c92c02ed-9b95-4434-81a9-23a52642f355;
	Fri, 30 Oct 2020 22:34:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AsHCRzshVA0r+EW1QusDxqnOeegy9R/Tk20f/rPZqv0=; b=LaFzIvFBxcECdJ1ijUOO4bXrrs
	ARNM3lkX2fVYmPLPjTDyiE25Ma/EYH57fzOrXHewkbVxqzZB5OLID9CxlUxte/+RmxbgnL/yf2jY0
	axTEOy9XviYCXXRY7cwldMSJCAh+G49faWVByzTjnp2kqZekCJBXRwmcPdhtA4gcQKFg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcys-0005Nx-9R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:46 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcys-00050m-8d
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:46 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
Message-Id: <E1kYcys-00050m-8d@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:46 +0000

commit 148d25e0f6ad1dc3bd6aace092d65262d4217ec6
Author:     Halil Pasic <pasic@linux.ibm.com>
AuthorDate: Thu Jul 30 15:01:56 2020 +0200
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Thu Jul 30 16:53:34 2020 +0200

    s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
    
    As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1)
    reads one past of the end of ms->loadparm, so g_memdup() can not be used
    here.
    
    Let's use g_strndup instead!
    
    Fixes: d6645483285f ("s390x/s390-virtio-ccw: fix loadparm property getter")
    Fixes: Coverity CID 1431058
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200730130156.35063-1-pasic@linux.ibm.com>
    Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 403d30e13b..e72c61d2ea 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -701,12 +701,9 @@ bool hpage_1m_allowed(void)
 static char *machine_get_loadparm(Object *obj, Error **errp)
 {
     S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
-    char *loadparm_str;
 
     /* make a NUL-terminated string */
-    loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
-    loadparm_str[sizeof(ms->loadparm)] = 0;
-    return loadparm_str;
+    return g_strndup((char *) ms->loadparm, sizeof(ms->loadparm));
 }
 
 static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:34:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:34:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16663.41314 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcz5-0005dx-Dm; Fri, 30 Oct 2020 22:34:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16663.41314; Fri, 30 Oct 2020 22:34:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcz5-0005do-Aj; Fri, 30 Oct 2020 22:34:59 +0000
Received: by outflank-mailman (input) for mailman id 16663;
 Fri, 30 Oct 2020 22:34:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYcz3-0005dc-9F
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:57 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 113f251f-2cfd-411c-a8e7-3efbcdcae0a0;
 Fri, 30 Oct 2020 22:34:56 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcz2-0005O5-E5
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYcz2-00051r-CN
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:56 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYcz3-0005dc-9F
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:57 +0000
X-Inumbo-ID: 113f251f-2cfd-411c-a8e7-3efbcdcae0a0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 113f251f-2cfd-411c-a8e7-3efbcdcae0a0;
	Fri, 30 Oct 2020 22:34:56 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VN/3MOerY9HL0EWiI85exkNGnYPR8iWZj6X4TFKvRIg=; b=C4CUugGI0MeW4ZQ2woyYfPHWqS
	4nB/MQ7ZURB1z85M4Kh2/NZ/QX92kUm5dsq3oG0n9W/P507iCo4O31LKl9/enHTBPt3YxfB0XWSJw
	/6/017hpUr/HPHLoMxp/EqPWdVW4ZqdvluBYan5gR7vVDln7oeebrI9Id6Cswi0Y5ksc=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcz2-0005O5-E5
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:56 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYcz2-00051r-CN
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:34:56 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200731' into staging
Message-Id: <E1kYcz2-00051r-CN@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:34:56 +0000

commit d74824cf7c8b352f9045e949dc636c7207a41eee
Merge: 1448629751871c4924c234c2faaa968fc26890e1 148d25e0f6ad1dc3bd6aace092d65262d4217ec6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Fri Jul 31 10:28:12 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Fri Jul 31 10:28:13 2020 +0100

    Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200731' into staging
    
    Fix a problem introduced in a recent fix.
    
    # gpg: Signature made Fri 31 Jul 2020 09:50:28 BST
    # gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
    # gpg:                issuer "cohuck@redhat.com"
    # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [marginal]
    # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
    # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [marginal]
    # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [marginal]
    # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
    
    * remotes/cohuck/tags/s390x-20200731:
      s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/s390x/s390-virtio-ccw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16664.41318 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczF-0005f6-FB; Fri, 30 Oct 2020 22:35:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16664.41318; Fri, 30 Oct 2020 22:35:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczF-0005ey-CD; Fri, 30 Oct 2020 22:35:09 +0000
Received: by outflank-mailman (input) for mailman id 16664;
 Fri, 30 Oct 2020 22:35:07 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYczD-0005ek-N3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:07 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 59df2a30-aa4f-48f4-a81b-f5b3eb187ecc;
 Fri, 30 Oct 2020 22:35:06 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczC-0005OS-Pl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczC-00053D-Oo
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:06 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYczD-0005ek-N3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:07 +0000
X-Inumbo-ID: 59df2a30-aa4f-48f4-a81b-f5b3eb187ecc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 59df2a30-aa4f-48f4-a81b-f5b3eb187ecc;
	Fri, 30 Oct 2020 22:35:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v+WSNGnlZkHyl0dMtDPMoQRcQ75kj4LxVtN0WKRvxj8=; b=VrpCBYVNOdo9z9Z4CBqhYveIAv
	Y847SIh4ez34U7r9u4ltl4upCPpC8VemgHI1xPfZJCz/tnJxyE+Q+faXybcOTMTSs2xjy2i7NRLKc
	h1QO1ZoitXhAOdyCdXXoAo5drxs8MsdVJuSR6mw6tiwkYocpoXBiPR19f/GrWMh7KENs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczC-0005OS-Pl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:06 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczC-00053D-Oo
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:06 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] seabios: update to master snapshot
Message-Id: <E1kYczC-00053D-Oo@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:06 +0000

commit 1f42e246995a99890f6af4e42329f184ee14b0e7
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Aug 3 07:00:58 2020 +0200
Commit:     Gerd Hoffmann <kraxel@redhat.com>
CommitDate: Mon Aug 3 07:01:02 2020 +0200

    seabios: update to master snapshot
    
    seabios master branch got a few bugfixes, so update
    to a newer snapshot to pick them up for 5.1-rc3.
    
    shortlog
    ========
    
    Kevin O'Connor (2):
          vgabios: Fix preserve memory flag in handle_1000
          ldnoexec: Add script to remove ET_EXEC flag from intermediate build objects
    
    Paul Menzel (1):
          nvme: Increase `nvme_cmd_readwrite()` message log level from 3 to 5
    
    Stefan Reiter (1):
          virtio-scsi: fix boot prio detection by using correct lun
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/bios-256k.bin             | Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                  | Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin        | Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin         | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin               | Bin 38912 -> 38912 bytes
 roms/seabios                      |   2 +-
 12 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 25b69cafba..8fd42903cd 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index 1167633985..528b8ab412 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-ati.bin b/pc-bios/vgabios-ati.bin
index d034f6d254..3dbfe53e5c 100644
Binary files a/pc-bios/vgabios-ati.bin and b/pc-bios/vgabios-ati.bin differ
diff --git a/pc-bios/vgabios-bochs-display.bin b/pc-bios/vgabios-bochs-display.bin
index 1ced8400f4..ca4c3db2db 100644
Binary files a/pc-bios/vgabios-bochs-display.bin and b/pc-bios/vgabios-bochs-display.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index b3af3771bd..b8ee1fe0ff 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index 3fac6dc137..9829cd1dec 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-ramfb.bin b/pc-bios/vgabios-ramfb.bin
index 1ca4f68a6e..12dcb8e823 100644
Binary files a/pc-bios/vgabios-ramfb.bin and b/pc-bios/vgabios-ramfb.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index a146eead00..68fe2fe820 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-virtio.bin b/pc-bios/vgabios-virtio.bin
index 49981a4334..60ce81d37c 100644
Binary files a/pc-bios/vgabios-virtio.bin and b/pc-bios/vgabios-virtio.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index 2f8935bf1f..b75a3517d1 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index d371983ab9..410436fbdf 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/seabios b/roms/seabios
index 88ab0c1552..d9c812dda5 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 88ab0c15525ced2eefe39220742efe4769089ad8
+Subproject commit d9c812dda519a1a73e8370e1b81ddf46eb22ed16
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:20 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16665.41322 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczQ-0005gT-Gf; Fri, 30 Oct 2020 22:35:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16665.41322; Fri, 30 Oct 2020 22:35:20 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczQ-0005gL-Dg; Fri, 30 Oct 2020 22:35:20 +0000
Received: by outflank-mailman (input) for mailman id 16665;
 Fri, 30 Oct 2020 22:35:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYczO-0005g5-AH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:18 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id bba37ddb-eb2d-4492-a55e-2029aed2d0e7;
 Fri, 30 Oct 2020 22:35:17 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczM-0005OY-Tl
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczM-00054C-St
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:16 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYczO-0005g5-AH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:18 +0000
X-Inumbo-ID: bba37ddb-eb2d-4492-a55e-2029aed2d0e7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id bba37ddb-eb2d-4492-a55e-2029aed2d0e7;
	Fri, 30 Oct 2020 22:35:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=CBSpW8PuiztrLqXTtBWGUxUYnwTz5caJghFGri3qM+8=; b=euROsEVHiVNO1tq3ElRhrvSTQR
	AK5SYpP4VPLyJSOm0nOMPFd2EDDekVZO7my2wXNbRaOEzvWZmqD0aLHUyf8ASl1l4gJLdICI+UO/3
	E/8hT50Ppg0JsnTJQWTvcY2uy7fBzqIDfVJZh+iYfqjTHLC525KlsQZf1H7OJbO8jSBk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczM-0005OY-Tl
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:16 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczM-00054C-St
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:16 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/kraxel/tags/seabios-20200803-pull-request' into staging
Message-Id: <E1kYczM-00054C-St@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:16 +0000

commit 92a95ab44655602e8665d5a0de13e0781a4fe824
Merge: d74824cf7c8b352f9045e949dc636c7207a41eee 1f42e246995a99890f6af4e42329f184ee14b0e7
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 09:54:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 09:54:58 2020 +0100

    Merge remote-tracking branch 'remotes/kraxel/tags/seabios-20200803-pull-request' into staging
    
    seabios: update to master snapshot
    
    seabios master branch got a few bugfixes, so update
    to a newer snapshot to pick them up for 5.1-rc3.
    
    # gpg: Signature made Mon 03 Aug 2020 06:24:17 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/seabios-20200803-pull-request:
      seabios: update to master snapshot
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 pc-bios/bios-256k.bin             | Bin 262144 -> 262144 bytes
 pc-bios/bios.bin                  | Bin 131072 -> 131072 bytes
 pc-bios/vgabios-ati.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-bochs-display.bin | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-cirrus.bin        | Bin 38912 -> 38912 bytes
 pc-bios/vgabios-qxl.bin           | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-ramfb.bin         | Bin 28672 -> 28672 bytes
 pc-bios/vgabios-stdvga.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-virtio.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios-vmware.bin        | Bin 39424 -> 39424 bytes
 pc-bios/vgabios.bin               | Bin 38912 -> 38912 bytes
 roms/seabios                      |   2 +-
 12 files changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:30 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16666.41326 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcza-0005hv-IN; Fri, 30 Oct 2020 22:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16666.41326; Fri, 30 Oct 2020 22:35:30 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYcza-0005hl-FB; Fri, 30 Oct 2020 22:35:30 +0000
Received: by outflank-mailman (input) for mailman id 16666;
 Fri, 30 Oct 2020 22:35:28 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYczY-0005hV-C9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:28 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 38b5b55e-d658-4d59-a080-2fcad4efdcb0;
 Fri, 30 Oct 2020 22:35:27 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczX-0005Or-AG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczX-00055N-9Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:27 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYczY-0005hV-C9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:28 +0000
X-Inumbo-ID: 38b5b55e-d658-4d59-a080-2fcad4efdcb0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 38b5b55e-d658-4d59-a080-2fcad4efdcb0;
	Fri, 30 Oct 2020 22:35:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VvpXry2E77e9mXH1Mqc7wuT4//3FwmZ6cnaVDyK9VAc=; b=YbWWg6CghnXsyu7wCl4exABXOW
	AAhNY6H3Ci3KmTZMf/WWDUnPzZ6BCf4gyaJrq8LXUqJXC4965/4s/YcEAL26u8eMjze/3/l3VT0dC
	lD/yg/peZLY23RQyUiPW1FGRZspenow1+6OXMYLLOrDaMkGVUVsNnqTWMQtWFIpSeVq0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczX-0005Or-AG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:27 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczX-00055N-9Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:27 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qapi/machine.json: Fix missing newline in doc comment
Message-Id: <E1kYczX-00055N-9Q@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:27 +0000

commit 6ac3f1e79974091aa292a0ab8637d5be8e5e4b1e
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Jul 29 20:10:19 2020 +0100
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    qapi/machine.json: Fix missing newline in doc comment
    
    In commit 176d2cda0dee9f4 we added the @die-id field
    to the CpuInstanceProperties struct, but in the process
    accidentally removed the newline between the doc-comment
    lines for @core-id and @thread-id.
    
    Put the newline back in; this fixes a misformatting in the
    generated HTML QMP reference manual.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20200729191019.19168-1-peter.maydell@linaro.org>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/machine.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qapi/machine.json b/qapi/machine.json
index f59144023c..daede5ab14 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -825,7 +825,8 @@
 # @node-id: NUMA node ID the CPU belongs to
 # @socket-id: socket number within node/board the CPU belongs to
 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
-# @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
+# @core-id: core number within die the CPU belongs to
+# @thread-id: thread number within core the CPU belongs to
 #
 # Note: currently there are 5 properties that could be present
 #       but management should be prepared to pass through other
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:40 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16667.41330 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczk-0005jZ-Jv; Fri, 30 Oct 2020 22:35:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16667.41330; Fri, 30 Oct 2020 22:35:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczk-0005jR-Gb; Fri, 30 Oct 2020 22:35:40 +0000
Received: by outflank-mailman (input) for mailman id 16667;
 Fri, 30 Oct 2020 22:35:38 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYczi-0005im-C8
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:38 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1d25914f-c840-4d5c-8326-08c84e100ac1;
 Fri, 30 Oct 2020 22:35:37 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczh-0005Oz-Er
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczh-00056H-DG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:37 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYczi-0005im-C8
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:38 +0000
X-Inumbo-ID: 1d25914f-c840-4d5c-8326-08c84e100ac1
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1d25914f-c840-4d5c-8326-08c84e100ac1;
	Fri, 30 Oct 2020 22:35:37 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1JX85MAoG62ldO+rcxGcykaHARLC5UXjzri2/l0enBk=; b=kcbweJg7RS+TpW8Dn6DtVWiHhC
	4hMAaN1Ipp7HaEtmw7QI0T5auL2W/9WPJMZklBlNLncTQi4Z2ojNdJ94YwzKIEFUo4u5gEIxI5jK0
	kz262bKrEWV+bqFSBGpwdXMpmjAVqaG1sAqL+f5luzRLEmkwdBBSHYbOEK9wc7uzK+ZY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczh-0005Oz-Er
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:37 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczh-00056H-DG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:37 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qapi: Delete unwanted indentation of top-level expressions
Message-Id: <E1kYczh-00056H-DG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:37 +0000

commit fbeed197611bda439968e68a42d8efadb2e60f81
Author:     Markus Armbruster <armbru@redhat.com>
AuthorDate: Thu Jul 30 11:16:56 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    qapi: Delete unwanted indentation of top-level expressions
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20200730091656.2633334-1-armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    [One more line de-indented]
---
 qapi/block-core.json | 26 +++++++++++++-------------
 qapi/ui.json         |  4 ++--
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index ab7bf3c612..49edb4fdae 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1847,9 +1847,9 @@
 #
 # Since: 4.0
 ##
-  { 'enum': 'BlockPermission',
-    'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
-              'graph-mod' ] }
+{ 'enum': 'BlockPermission',
+  'data': [ 'consistent-read', 'write', 'write-unchanged', 'resize',
+            'graph-mod' ] }
 ##
 # @XDbgBlockGraphEdge:
 #
@@ -2155,8 +2155,8 @@
 # <- { "return": {} }
 #
 ##
-  { 'command': 'block-dirty-bitmap-enable',
-    'data': 'BlockDirtyBitmap' }
+{ 'command': 'block-dirty-bitmap-enable',
+  'data': 'BlockDirtyBitmap' }
 
 ##
 # @block-dirty-bitmap-disable:
@@ -2176,8 +2176,8 @@
 # <- { "return": {} }
 #
 ##
-    { 'command': 'block-dirty-bitmap-disable',
-      'data': 'BlockDirtyBitmap' }
+{ 'command': 'block-dirty-bitmap-disable',
+  'data': 'BlockDirtyBitmap' }
 
 ##
 # @block-dirty-bitmap-merge:
@@ -2208,8 +2208,8 @@
 # <- { "return": {} }
 #
 ##
-      { 'command': 'block-dirty-bitmap-merge',
-        'data': 'BlockDirtyBitmapMerge' }
+{ 'command': 'block-dirty-bitmap-merge',
+  'data': 'BlockDirtyBitmapMerge' }
 
 ##
 # @BlockDirtyBitmapSha256:
@@ -2220,8 +2220,8 @@
 #
 # Since: 2.10
 ##
-  { 'struct': 'BlockDirtyBitmapSha256',
-    'data': {'sha256': 'str'} }
+{ 'struct': 'BlockDirtyBitmapSha256',
+  'data': {'sha256': 'str'} }
 
 ##
 # @x-debug-block-dirty-bitmap-sha256:
@@ -2235,8 +2235,8 @@
 #
 # Since: 2.10
 ##
-  { 'command': 'x-debug-block-dirty-bitmap-sha256',
-    'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
+{ 'command': 'x-debug-block-dirty-bitmap-sha256',
+  'data': 'BlockDirtyBitmap', 'returns': 'BlockDirtyBitmapSha256' }
 
 ##
 # @blockdev-mirror:
diff --git a/qapi/ui.json b/qapi/ui.json
index e16e98a060..1568cfeaad 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1081,8 +1081,8 @@
  # Since: 3.0
  #
  ##
- { 'enum'    : 'DisplayGLMode',
-   'data'    : [ 'off', 'on', 'core', 'es' ] }
+{ 'enum'    : 'DisplayGLMode',
+  'data'    : [ 'off', 'on', 'core', 'es' ] }
 
 ##
 # @DisplayCurses:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:49 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16668.41334 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczt-0005kv-MU; Fri, 30 Oct 2020 22:35:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16668.41334; Fri, 30 Oct 2020 22:35:49 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYczt-0005kn-JV; Fri, 30 Oct 2020 22:35:49 +0000
Received: by outflank-mailman (input) for mailman id 16668;
 Fri, 30 Oct 2020 22:35:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYczt-0005kg-0o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id c1fa05fb-6c01-4b31-918b-d6cf8cf1ea00;
 Fri, 30 Oct 2020 22:35:47 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczr-0005Pl-Jd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYczr-00057N-In
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:47 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYczt-0005kg-0o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:49 +0000
X-Inumbo-ID: c1fa05fb-6c01-4b31-918b-d6cf8cf1ea00
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id c1fa05fb-6c01-4b31-918b-d6cf8cf1ea00;
	Fri, 30 Oct 2020 22:35:47 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0BqH2NaAxAv0DutYTI/ke7sdvS6byxDBu6F7VR1uxs0=; b=sHbCujUtRWx3brxRsvG/uO+IFU
	MRn2WZcCGFgAboeltqTS/6iUWv4VFyjQieWh5fFhT7JTfzQDPR/DFxD9HZVkjx0jtC6wJ3Zo/x1oT
	qdbdIccU0As2lgGGOxMorRY9lQgs88GEADs49Tnn2ZmH3wOKX1GfaSSb9dbz+6yenaiI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczr-0005Pl-Jd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:47 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYczr-00057N-In
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:47 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] schemas: Add vim modeline
Message-Id: <E1kYczr-00057N-In@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:47 +0000

commit f7160f32186b4ae1e1327e3bd05060fffec8f9ae
Author:     Andrea Bolognani <abologna@redhat.com>
AuthorDate: Wed Jul 29 20:50:24 2020 +0200
Commit:     Markus Armbruster <armbru@redhat.com>
CommitDate: Mon Aug 3 08:28:08 2020 +0200

    schemas: Add vim modeline
    
    The various schemas included in QEMU use a JSON-based format which
    is, however, strictly speaking not valid JSON.
    
    As a consequence, when vim tries to apply syntax highlight rules
    for JSON (as guessed from the file name), the result is an unreadable
    mess which mostly consist of red markers pointing out supposed errors
    in, well, pretty much everything.
    
    Using Python syntax highlighting produces much better results, and
    in fact these files already start with specially-formatted comments
    that instruct Emacs to process them as if they were Python files.
    
    This commit adds the equivalent special comments for vim.
    
    Signed-off-by: Andrea Bolognani <abologna@redhat.com>
    Message-Id: <20200729185024.121766-1-abologna@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: John Snow <jsnow@redhat.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/interop/firmware.json                | 1 +
 docs/interop/vhost-user.json              | 1 +
 qapi/authz.json                           | 1 +
 qapi/block-core.json                      | 1 +
 qapi/block.json                           | 1 +
 qapi/char.json                            | 1 +
 qapi/common.json                          | 1 +
 qapi/control.json                         | 1 +
 qapi/crypto.json                          | 1 +
 qapi/dump.json                            | 1 +
 qapi/error.json                           | 1 +
 qapi/introspect.json                      | 1 +
 qapi/job.json                             | 1 +
 qapi/machine-target.json                  | 1 +
 qapi/machine.json                         | 1 +
 qapi/migration.json                       | 1 +
 qapi/misc-target.json                     | 1 +
 qapi/misc.json                            | 1 +
 qapi/net.json                             | 1 +
 qapi/qapi-schema.json                     | 1 +
 qapi/qdev.json                            | 1 +
 qapi/qom.json                             | 1 +
 qapi/rdma.json                            | 1 +
 qapi/rocker.json                          | 1 +
 qapi/run-state.json                       | 1 +
 qapi/sockets.json                         | 1 +
 qapi/tpm.json                             | 1 +
 qapi/transaction.json                     | 1 +
 qapi/ui.json                              | 1 +
 qga/qapi-schema.json                      | 1 +
 storage-daemon/qapi/qapi-schema.json      | 1 +
 tests/qapi-schema/doc-good.json           | 2 ++
 tests/qapi-schema/include/sub-module.json | 1 +
 tests/qapi-schema/qapi-schema-test.json   | 1 +
 tests/qapi-schema/sub-sub-module.json     | 1 +
 35 files changed, 36 insertions(+)

diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 240f565397..989f10b626 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2018 Red Hat, Inc.
 #
diff --git a/docs/interop/vhost-user.json b/docs/interop/vhost-user.json
index ef8ac5941f..feb5fe58ca 100644
--- a/docs/interop/vhost-user.json
+++ b/docs/interop/vhost-user.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2018 Red Hat, Inc.
 #
diff --git a/qapi/authz.json b/qapi/authz.json
index 1c836a3abd..f3e9745426 100644
--- a/qapi/authz.json
+++ b/qapi/authz.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # QAPI authz definitions
 
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 49edb4fdae..197bdc1c36 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # == Block core (VM unrelated)
diff --git a/qapi/block.json b/qapi/block.json
index 2ddbfa8306..c54a393cf3 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Block devices
diff --git a/qapi/char.json b/qapi/char.json
index daceb20f84..8aeedf96b2 100644
--- a/qapi/char.json
+++ b/qapi/char.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/common.json b/qapi/common.json
index 7b9cbcd97b..716712d4b3 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Common data types
diff --git a/qapi/control.json b/qapi/control.json
index 6b816bb61f..de51e9916c 100644
--- a/qapi/control.json
+++ b/qapi/control.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/crypto.json b/qapi/crypto.json
index 5a68e0db25..bb7930d332 100644
--- a/qapi/crypto.json
+++ b/qapi/crypto.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/dump.json b/qapi/dump.json
index a1eed7b15c..f7c4267e3f 100644
--- a/qapi/dump.json
+++ b/qapi/dump.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/error.json b/qapi/error.json
index 3fad08f506..94a6502de9 100644
--- a/qapi/error.json
+++ b/qapi/error.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = QMP errors
diff --git a/qapi/introspect.json b/qapi/introspect.json
index b1aabd4cfd..944bb87a20 100644
--- a/qapi/introspect.json
+++ b/qapi/introspect.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # Copyright (C) 2015 Red Hat, Inc.
 #
diff --git a/qapi/job.json b/qapi/job.json
index c48a0c3e34..280c2f76f1 100644
--- a/qapi/job.json
+++ b/qapi/job.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # == Background jobs
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index f2c82949d8..698850cc78 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/machine.json b/qapi/machine.json
index daede5ab14..481b1f07ec 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/migration.json b/qapi/migration.json
index d5000558c6..ea53b23dca 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index dee3b45930..1e561fa97b 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/misc.json b/qapi/misc.json
index 149c925246..9d32820dc1 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/net.json b/qapi/net.json
index 558d520a2f..ddb113e5e5 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 43b0ba0dea..f03ff91ceb 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 ##
 # = Introduction
 #
diff --git a/qapi/qdev.json b/qapi/qdev.json
index f4ed9735c4..13254529bf 100644
--- a/qapi/qdev.json
+++ b/qapi/qdev.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/qom.json b/qapi/qom.json
index 8abe998962..0b0b92944b 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
diff --git a/qapi/rdma.json b/qapi/rdma.json
index b58105b1b6..a1d2175a8b 100644
--- a/qapi/rdma.json
+++ b/qapi/rdma.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/rocker.json b/qapi/rocker.json
index 52597db491..b48e49a89b 100644
--- a/qapi/rocker.json
+++ b/qapi/rocker.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Rocker switch device
diff --git a/qapi/run-state.json b/qapi/run-state.json
index 2e22907740..7cc9f96a5b 100644
--- a/qapi/run-state.json
+++ b/qapi/run-state.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/sockets.json b/qapi/sockets.json
index cbd6ef35d0..c0c640a5b0 100644
--- a/qapi/sockets.json
+++ b/qapi/sockets.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 ##
 # = Socket data types
diff --git a/qapi/tpm.json b/qapi/tpm.json
index dc1f081739..6a10c9ed8d 100644
--- a/qapi/tpm.json
+++ b/qapi/tpm.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/transaction.json b/qapi/transaction.json
index b6c11158f0..15ddebdbc3 100644
--- a/qapi/transaction.json
+++ b/qapi/transaction.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qapi/ui.json b/qapi/ui.json
index 1568cfeaad..9d6721037f 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 #
 
 ##
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 408a662ea5..b1e9ed836d 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 ##
 #
diff --git a/storage-daemon/qapi/qapi-schema.json b/storage-daemon/qapi/qapi-schema.json
index 14f4f8fe61..6100d1f0c9 100644
--- a/storage-daemon/qapi/qapi-schema.json
+++ b/storage-daemon/qapi/qapi-schema.json
@@ -1,4 +1,5 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
 
 # Note that modules are shared with the QEMU main schema under the assumption
 # that the storage daemon schema is a subset of the main schema. For the shared
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index ddd89d1233..9da72a1f55 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -1,4 +1,6 @@
 # -*- Mode: Python -*-
+# vim: filetype=python
+#
 # Positive QAPI doc comment tests
 
 { 'pragma': { 'doc-required': true } }
diff --git a/tests/qapi-schema/include/sub-module.json b/tests/qapi-schema/include/sub-module.json
index afdb267228..b9f7b9bb56 100644
--- a/tests/qapi-schema/include/sub-module.json
+++ b/tests/qapi-schema/include/sub-module.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # Sub-module of ../qapi-schema-test.json
 
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 6b1f05afa7..3a9f2cbb33 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # This file is a stress test of supported qapi constructs that must
 # parse and compile correctly.
diff --git a/tests/qapi-schema/sub-sub-module.json b/tests/qapi-schema/sub-sub-module.json
index 524ef9b83f..94f36ec0b1 100644
--- a/tests/qapi-schema/sub-sub-module.json
+++ b/tests/qapi-schema/sub-sub-module.json
@@ -1,4 +1,5 @@
 # *-*- Mode: Python -*-*
+# vim: filetype=python
 
 # Sub-module of sub-module include/sub-module.json of qapi-schema-test.json
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:35:59 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:35:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16669.41339 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd03-0005mC-OM; Fri, 30 Oct 2020 22:35:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16669.41339; Fri, 30 Oct 2020 22:35:59 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd03-0005m3-L2; Fri, 30 Oct 2020 22:35:59 +0000
Received: by outflank-mailman (input) for mailman id 16669;
 Fri, 30 Oct 2020 22:35:58 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd02-0005lv-Hv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:58 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 1764a608-a273-404c-b76c-fd266de068c2;
 Fri, 30 Oct 2020 22:35:57 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd01-0005Pt-Nf
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd01-000587-Mr
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:57 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd02-0005lv-Hv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:58 +0000
X-Inumbo-ID: 1764a608-a273-404c-b76c-fd266de068c2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 1764a608-a273-404c-b76c-fd266de068c2;
	Fri, 30 Oct 2020 22:35:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Rg424fi2yDXCV1IpGHnh+KTcdNz3rbxU7sO6H+cgZeM=; b=AIOCS3TzLjsTD+LPzCFnZldNyo
	5BT770QyeahoUGPj96eswasphkLgDcrjHRXJpakH1M+RRDTyqBhR8nkYfr+VdlCYvuxjmu/vaLeZH
	RCQ2j0OHhajEIscZ90VQY/NchvaWhY+1wINfUe6q/1UO7ovuLuUmlSZWwdIGLH6gf6u8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd01-0005Pt-Nf
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:57 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd01-000587-Mr
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:35:57 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-08-03' into staging
Message-Id: <E1kYd01-000587-Mr@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:35:57 +0000

commit 6c5dfc9ccb643a0d50fdec9f10806b14960571d1
Merge: 92a95ab44655602e8665d5a0de13e0781a4fe824 f7160f32186b4ae1e1327e3bd05060fffec8f9ae
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 12:21:57 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 12:21:57 2020 +0100

    Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-08-03' into staging
    
    QAPI patches patches for 2020-08-03
    
    # gpg: Signature made Mon 03 Aug 2020 10:08:30 BST
    # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
    # gpg:                issuer "armbru@redhat.com"
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qapi-2020-08-03:
      schemas: Add vim modeline
      qapi: Delete unwanted indentation of top-level expressions
      qapi/machine.json: Fix missing newline in doc comment
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/interop/firmware.json                |  1 +
 docs/interop/vhost-user.json              |  1 +
 qapi/authz.json                           |  1 +
 qapi/block-core.json                      | 27 ++++++++++++++-------------
 qapi/block.json                           |  1 +
 qapi/char.json                            |  1 +
 qapi/common.json                          |  1 +
 qapi/control.json                         |  1 +
 qapi/crypto.json                          |  1 +
 qapi/dump.json                            |  1 +
 qapi/error.json                           |  1 +
 qapi/introspect.json                      |  1 +
 qapi/job.json                             |  1 +
 qapi/machine-target.json                  |  1 +
 qapi/machine.json                         |  4 +++-
 qapi/migration.json                       |  1 +
 qapi/misc-target.json                     |  1 +
 qapi/misc.json                            |  1 +
 qapi/net.json                             |  1 +
 qapi/qapi-schema.json                     |  1 +
 qapi/qdev.json                            |  1 +
 qapi/qom.json                             |  1 +
 qapi/rdma.json                            |  1 +
 qapi/rocker.json                          |  1 +
 qapi/run-state.json                       |  1 +
 qapi/sockets.json                         |  1 +
 qapi/tpm.json                             |  1 +
 qapi/transaction.json                     |  1 +
 qapi/ui.json                              |  5 +++--
 qga/qapi-schema.json                      |  1 +
 storage-daemon/qapi/qapi-schema.json      |  1 +
 tests/qapi-schema/doc-good.json           |  2 ++
 tests/qapi-schema/include/sub-module.json |  1 +
 tests/qapi-schema/qapi-schema-test.json   |  1 +
 tests/qapi-schema/sub-sub-module.json     |  1 +
 35 files changed, 53 insertions(+), 16 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:36:09 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:36:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16670.41342 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0D-0005nX-Pa; Fri, 30 Oct 2020 22:36:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16670.41342; Fri, 30 Oct 2020 22:36:09 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0D-0005nP-MX; Fri, 30 Oct 2020 22:36:09 +0000
Received: by outflank-mailman (input) for mailman id 16670;
 Fri, 30 Oct 2020 22:36:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd0D-0005nH-9W
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:09 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 2a35d98c-ba94-4f4d-8946-f2132d53177a;
 Fri, 30 Oct 2020 22:36:08 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0C-0005QG-3c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0C-00059c-2h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:08 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd0D-0005nH-9W
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:09 +0000
X-Inumbo-ID: 2a35d98c-ba94-4f4d-8946-f2132d53177a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 2a35d98c-ba94-4f4d-8946-f2132d53177a;
	Fri, 30 Oct 2020 22:36:08 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fCP6+IegpJR3gdHSylddQ0bp3hDI1e2b8rpn4OxjRW4=; b=zg8IIWT1DcMutDPj2olAE88m/d
	K3Xl3hDgOTgqZ9J2rihfWZJX8rT4wfwqLbNa+wKeKKMDclzB4wM6ISB5ipi/serUYK1HnJ9D/sALI
	2bZtvIsJBdP+grgQzHifs33t7GvheL1Di0RnJRrWYY84qul7Xpc9g+/WWl7ytyempZfQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0C-0005QG-3c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:08 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0C-00059c-2h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:08 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow2: Release read-only bitmaps when inactivated
Message-Id: <E1kYd0C-00059c-2h@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:08 +0000

commit fe16c7ddf82b25e54cb76936a4cdf6bf9327ece5
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 30 14:02:33 2020 +0200
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Aug 3 08:59:37 2020 -0500

    qcow2: Release read-only bitmaps when inactivated
    
    During migration, we release all bitmaps after storing them on disk, as
    long as they are (1) stored on disk, (2) not read-only, and (3)
    consistent.
    
    (2) seems arbitrary, though.  The reason we do not release them is
    because we do not write them, as there is no need to; and then we just
    forget about all bitmaps that we have not written to the file.  However,
    read-only persistent bitmaps are still in the file and in sync with
    their in-memory representation, so we may as well release them just like
    any R/W bitmap that we have updated.
    
    It leads to actual problems, too: After migration, letting the source
    continue may result in an error if there were any bitmaps on read-only
    nodes (such as backing images), because those have not been released by
    bdrv_inactive_all(), but bdrv_invalidate_cache_all() attempts to reload
    them (which fails, because they are still present in memory).
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200730120234.49288-2-mreitz@redhat.com>
    Tested-by: Peter Krempa <pkrempa@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2-bitmap.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 1f38806ca6..8c34b2aef7 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1562,11 +1562,22 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         Qcow2Bitmap *bm;
 
         if (!bdrv_dirty_bitmap_get_persistence(bitmap) ||
-            bdrv_dirty_bitmap_readonly(bitmap) ||
             bdrv_dirty_bitmap_inconsistent(bitmap)) {
             continue;
         }
 
+        if (bdrv_dirty_bitmap_readonly(bitmap)) {
+            /*
+             * Store the bitmap in the associated Qcow2Bitmap so it
+             * can be released later
+             */
+            bm = find_bitmap_by_name(bm_list, name);
+            if (bm) {
+                bm->dirty_bitmap = bitmap;
+            }
+            continue;
+        }
+
         need_write = true;
 
         if (check_constraints_on_bitmap(bs, name, granularity, errp) < 0) {
@@ -1618,7 +1629,9 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
 
     /* allocate clusters and store bitmaps */
     QSIMPLEQ_FOREACH(bm, bm_list, entry) {
-        if (bm->dirty_bitmap == NULL) {
+        BdrvDirtyBitmap *bitmap = bm->dirty_bitmap;
+
+        if (bitmap == NULL || bdrv_dirty_bitmap_readonly(bitmap)) {
             continue;
         }
 
@@ -1641,6 +1654,7 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         g_free(tb);
     }
 
+success:
     if (release_stored) {
         QSIMPLEQ_FOREACH(bm, bm_list, entry) {
             if (bm->dirty_bitmap == NULL) {
@@ -1651,13 +1665,14 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
         }
     }
 
-success:
     bitmap_list_free(bm_list);
     return;
 
 fail:
     QSIMPLEQ_FOREACH(bm, bm_list, entry) {
-        if (bm->dirty_bitmap == NULL || bm->table.offset == 0) {
+        if (bm->dirty_bitmap == NULL || bm->table.offset == 0 ||
+            bdrv_dirty_bitmap_readonly(bm->dirty_bitmap))
+        {
             continue;
         }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:36:19 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:36:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16671.41345 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0N-0005oq-Qy; Fri, 30 Oct 2020 22:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16671.41345; Fri, 30 Oct 2020 22:36:19 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0N-0005oi-O3; Fri, 30 Oct 2020 22:36:19 +0000
Received: by outflank-mailman (input) for mailman id 16671;
 Fri, 30 Oct 2020 22:36:19 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd0N-0005oa-8q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:19 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id f41cc910-eb0b-412f-9321-4979eae53044;
 Fri, 30 Oct 2020 22:36:18 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0M-0005QV-7R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0M-0005Ac-6H
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:18 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd0N-0005oa-8q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:19 +0000
X-Inumbo-ID: f41cc910-eb0b-412f-9321-4979eae53044
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id f41cc910-eb0b-412f-9321-4979eae53044;
	Fri, 30 Oct 2020 22:36:18 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wvk+VHiliS9guNfAva+Ueg6X7GR9jXEc2ebIKDzBOVM=; b=ybF9ezbSuqKw1/HKwcjbhnBdBh
	jaVUj4tSeFrixwpD06kxiLden6GLqIGNNiJ7DzXK0ThPkGJl4qKVbkqEETNaghjnNX/dugHT6GG9J
	yN2yIYc0SFY+A7TYLkPiEdsVjwLRMXppBz/BXXTCj4T2qDWRIneJf80aosgy4KZhtnwY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0M-0005QV-7R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:18 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0M-0005Ac-6H
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:18 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] iotests/169: Test source cont with backing bmap
Message-Id: <E1kYd0M-0005Ac-6H@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:18 +0000

commit edadc99a2ee90daeaaf4fba21d623ec8efe7c8e6
Author:     Max Reitz <mreitz@redhat.com>
AuthorDate: Thu Jul 30 14:02:34 2020 +0200
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: Mon Aug 3 08:59:37 2020 -0500

    iotests/169: Test source cont with backing bmap
    
    Test migrating from a VM with a persistent bitmap in the backing chain,
    and then continuing that VM after the migration
    
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Message-Id: <20200730120234.49288-3-mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/qemu-iotests/169     | 64 +++++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/169.out |  4 +--
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 2c5a132aa3..40afb15299 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -24,11 +24,12 @@ import time
 import itertools
 import operator
 import re
-from iotests import qemu_img
+from iotests import qemu_img, qemu_img_create, Timeout
 
 
 disk_a = os.path.join(iotests.test_dir, 'disk_a')
 disk_b = os.path.join(iotests.test_dir, 'disk_b')
+base_a = os.path.join(iotests.test_dir, 'base_a')
 size = '1M'
 mig_file = os.path.join(iotests.test_dir, 'mig_file')
 mig_cmd = 'exec: cat > ' + mig_file
@@ -234,6 +235,67 @@ for cmb in list(itertools.product((True, False), repeat=2)):
     inject_test_case(TestDirtyBitmapMigration, name,
                      'do_test_migration_resume_source', *list(cmb))
 
+
+class TestDirtyBitmapBackingMigration(iotests.QMPTestCase):
+    def setUp(self):
+        qemu_img_create('-f', iotests.imgfmt, base_a, size)
+        qemu_img_create('-f', iotests.imgfmt, '-F', iotests.imgfmt,
+                        '-b', base_a, disk_a, size)
+
+        for f in (disk_a, base_a):
+            qemu_img('bitmap', '--add', f, 'bmap0')
+
+        blockdev = {
+            'node-name': 'node0',
+            'driver': iotests.imgfmt,
+            'file': {
+                'driver': 'file',
+                'filename': disk_a
+            },
+            'backing': {
+                'node-name': 'node0-base',
+                'driver': iotests.imgfmt,
+                'file': {
+                    'driver': 'file',
+                    'filename': base_a
+                }
+            }
+        }
+
+        self.vm = iotests.VM()
+        self.vm.launch()
+
+        result = self.vm.qmp('blockdev-add', **blockdev)
+        self.assert_qmp(result, 'return', {})
+
+        # Check that the bitmaps are there
+        for node in self.vm.qmp('query-named-block-nodes', flat=True)['return']:
+            if 'node0' in node['node-name']:
+                self.assert_qmp(node, 'dirty-bitmaps[0]/name', 'bmap0')
+
+        caps = [{'capability': 'events', 'state': True}]
+        result = self.vm.qmp('migrate-set-capabilities', capabilities=caps)
+        self.assert_qmp(result, 'return', {})
+
+    def tearDown(self):
+        self.vm.shutdown()
+        for f in (disk_a, base_a):
+            os.remove(f)
+
+    def test_cont_on_source(self):
+        """
+        Continue the source after migration.
+        """
+        result = self.vm.qmp('migrate', uri=f'exec: cat > /dev/null')
+        self.assert_qmp(result, 'return', {})
+
+        with Timeout(10, 'Migration timeout'):
+            self.vm.wait_migration('postmigrate')
+
+        result = self.vm.qmp('cont')
+        self.assert_qmp(result, 'return', {})
+
+
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'],
                  supported_protocols=['file'])
diff --git a/tests/qemu-iotests/169.out b/tests/qemu-iotests/169.out
index 5c26d15c0d..cafb8161f7 100644
--- a/tests/qemu-iotests/169.out
+++ b/tests/qemu-iotests/169.out
@@ -1,5 +1,5 @@
-....................................
+.....................................
 ----------------------------------------------------------------------
-Ran 36 tests
+Ran 37 tests
 
 OK
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:36:29 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:36:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16672.41350 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0X-0005qH-Ts; Fri, 30 Oct 2020 22:36:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16672.41350; Fri, 30 Oct 2020 22:36:29 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0X-0005q9-Qz; Fri, 30 Oct 2020 22:36:29 +0000
Received: by outflank-mailman (input) for mailman id 16672;
 Fri, 30 Oct 2020 22:36:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd0X-0005px-3Q
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:29 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 323a4367-6d4b-4b58-a9c6-b8256a77171e;
 Fri, 30 Oct 2020 22:36:28 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0W-0005Qd-B3
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0W-0005BZ-AH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:28 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd0X-0005px-3Q
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:29 +0000
X-Inumbo-ID: 323a4367-6d4b-4b58-a9c6-b8256a77171e
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 323a4367-6d4b-4b58-a9c6-b8256a77171e;
	Fri, 30 Oct 2020 22:36:28 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tGjm9FljX61gymf5pY3d2FKsyuB54Qg2qT0n9KgbE6I=; b=i2WIxoigLkfE5BulPQogRNtSsc
	XNcTl1OW6n2Dr6vuoCzNXjUe0W7dZo0qSDR19tR2SA5bZWgi5Vrcl61CERhKhrUqWwurCG7BFRKBp
	YvTvL7yj8x8FXHrruEC1ja1+JIhRwh9gd7guAGYrNmmcDVPKyM8m4dO2VcYLyAlp8EJo=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0W-0005Qd-B3
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:28 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0W-0005BZ-AH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:28 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-08-03' into staging
Message-Id: <E1kYd0W-0005BZ-AH@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:28 +0000

commit 45a150aa2b3492acf6691c7bdbeb25a8545d8345
Merge: 6c5dfc9ccb643a0d50fdec9f10806b14960571d1 edadc99a2ee90daeaaf4fba21d623ec8efe7c8e6
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 15:13:49 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 15:13:49 2020 +0100

    Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-08-03' into staging
    
    bitmaps patches for 2020-08-03
    
    - fix bitmap migration involving read-only bitmap from backing chain
    
    # gpg: Signature made Mon 03 Aug 2020 15:06:51 BST
    # gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
    # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
    # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
    # gpg:                 aka "[jpeg image of size 6874]" [full]
    # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
    
    * remotes/ericb/tags/pull-bitmaps-2020-08-03:
      iotests/169: Test source cont with backing bmap
      qcow2: Release read-only bitmaps when inactivated
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 block/qcow2-bitmap.c       | 23 ++++++++++++++---
 tests/qemu-iotests/169     | 64 +++++++++++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/169.out |  4 +--
 3 files changed, 84 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:36:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:36:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16673.41354 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0i-0005sJ-VZ; Fri, 30 Oct 2020 22:36:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16673.41354; Fri, 30 Oct 2020 22:36:40 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0i-0005sB-SX; Fri, 30 Oct 2020 22:36:40 +0000
Received: by outflank-mailman (input) for mailman id 16673;
 Fri, 30 Oct 2020 22:36:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd0h-0005rQ-Ma
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:39 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id abdf186d-e589-44ab-b7ba-05515a5c1669;
 Fri, 30 Oct 2020 22:36:38 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0g-0005Qq-OO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0g-0005Db-Nj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:38 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd0h-0005rQ-Ma
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:39 +0000
X-Inumbo-ID: abdf186d-e589-44ab-b7ba-05515a5c1669
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id abdf186d-e589-44ab-b7ba-05515a5c1669;
	Fri, 30 Oct 2020 22:36:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZdEG6FHILhd0Wtlo8v68iqdLDl+rofG6RwkGPyTsbS8=; b=2bT7EMs8i7tMuN40lWdD5G+CZ+
	NedqcU37NElNIy+mpx65iZnBrwKIKkY2ldfIdy53Il0/OG2WlihloffpvUbrj0zQePT650sJcgMQ7
	BHAmMzqD7LJYL7G+PHwcUnZ6UG2JJGuYBt5sn1GwSiT6/htndja4CIyn2jWAiyQ9biHU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0g-0005Qq-OO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:38 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0g-0005Db-Nj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:38 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/netduino2, netduinoplus2: Set system_clock_scale
Message-Id: <E1kYd0g-0005Db-Nj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:38 +0000

commit e7e5a9595ab1136845c444141830fca0d2746a73
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    hw/arm/netduino2, netduinoplus2: Set system_clock_scale
    
    The netduino2 and netduinoplus2 boards forgot to set the system_clock_scale
    global, which meant that if guest code used the systick timer in "use
    the processor clock" mode it would hang because time never advances.
    
    Set the global to match the documented CPU clock speed of these boards.
    Judging by the data sheet this is slightly simplistic because the
    SoC allows configuration of the SYSCLK source and frequency via the
    RCC (reset and clock control) module, but we don't model that.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1876187
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200727162617.26227-1-peter.maydell@linaro.org
---
 hw/arm/netduino2.c     | 10 ++++++++++
 hw/arm/netduinoplus2.c | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c
index 79e19392b5..8f10334144 100644
--- a/hw/arm/netduino2.c
+++ b/hw/arm/netduino2.c
@@ -30,10 +30,20 @@
 #include "hw/arm/stm32f205_soc.h"
 #include "hw/arm/boot.h"
 
+/* Main SYSCLK frequency in Hz (120MHz) */
+#define SYSCLK_FRQ 120000000ULL
+
 static void netduino2_init(MachineState *machine)
 {
     DeviceState *dev;
 
+    /*
+     * TODO: ideally we would model the SoC RCC and let it handle
+     * system_clock_scale, including its ability to define different
+     * possible SYSCLK sources.
+     */
+    system_clock_scale = NANOSECONDS_PER_SECOND / SYSCLK_FRQ;
+
     dev = qdev_new(TYPE_STM32F205_SOC);
     qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m3"));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
diff --git a/hw/arm/netduinoplus2.c b/hw/arm/netduinoplus2.c
index 958d21dd9f..68abd3ec69 100644
--- a/hw/arm/netduinoplus2.c
+++ b/hw/arm/netduinoplus2.c
@@ -30,10 +30,20 @@
 #include "hw/arm/stm32f405_soc.h"
 #include "hw/arm/boot.h"
 
+/* Main SYSCLK frequency in Hz (168MHz) */
+#define SYSCLK_FRQ 168000000ULL
+
 static void netduinoplus2_init(MachineState *machine)
 {
     DeviceState *dev;
 
+    /*
+     * TODO: ideally we would model the SoC RCC and let it handle
+     * system_clock_scale, including its ability to define different
+     * possible SYSCLK sources.
+     */
+    system_clock_scale = NANOSECONDS_PER_SECOND / SYSCLK_FRQ;
+
     dev = qdev_new(TYPE_STM32F405_SOC);
     qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m4"));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:36:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:36:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16674.41358 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0t-0005tT-15; Fri, 30 Oct 2020 22:36:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16674.41358; Fri, 30 Oct 2020 22:36:50 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd0s-0005tL-U7; Fri, 30 Oct 2020 22:36:50 +0000
Received: by outflank-mailman (input) for mailman id 16674;
 Fri, 30 Oct 2020 22:36:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd0r-0005tA-Of
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:49 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 01f9c7de-e530-47dd-a6e3-a71464d378f0;
 Fri, 30 Oct 2020 22:36:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0q-0005RN-Ri
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd0q-0005ET-Qz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:48 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd0r-0005tA-Of
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:49 +0000
X-Inumbo-ID: 01f9c7de-e530-47dd-a6e3-a71464d378f0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 01f9c7de-e530-47dd-a6e3-a71464d378f0;
	Fri, 30 Oct 2020 22:36:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6h915H2PrwuB8ybSTeJqDyjI6UpKrpdBu4tHtQI++Ug=; b=LvcO5/z6zevmGFrkYohl7B8gH9
	N8i9aZtj/F0R6W3k7YSEKrqdHi/boA+IRILqzwx5xJ3gbnZ7aWv2xCratPaTl7Rl8yetS9sAyjUMr
	BhKIiSkIohws4axcgzcFWTrz8uD4I1m7tgYGXl749twXZufxc033Bu2VAPeTZbHHWq3w=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0q-0005RN-Ri
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:48 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd0q-0005ET-Qz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:48 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] include/hw/irq.h: New function qemu_irq_is_connected()
Message-Id: <E1kYd0q-0005ET-Qz@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:48 +0000

commit faf7c6de34fb8eaa566726cc658ba5ad81fb32af
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    include/hw/irq.h: New function qemu_irq_is_connected()
    
    Mostly devices don't need to care whether one of their output
    qemu_irq lines is connected, because functions like qemu_set_irq()
    silently do nothing if there is nothing on the other end.  However
    sometimes a device might want to implement default behaviour for the
    case where the machine hasn't wired the line up to anywhere.
    
    Provide a function qemu_irq_is_connected() that devices can use for
    this purpose.  (The test is trivial but encapsulating it in a
    function makes it easier to see where we're doing it in case we need
    to change the implementation later.)
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-2-peter.maydell@linaro.org
---
 include/hw/irq.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/hw/irq.h b/include/hw/irq.h
index 24ba0ece11..dc7abf199e 100644
--- a/include/hw/irq.h
+++ b/include/hw/irq.h
@@ -55,4 +55,22 @@ qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2);
    on an existing vector of qemu_irq.  */
 void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);
 
+/**
+ * qemu_irq_is_connected: Return true if IRQ line is wired up
+ *
+ * If a qemu_irq has a device on the other (receiving) end of it,
+ * return true; otherwise return false.
+ *
+ * Usually device models don't need to care whether the machine model
+ * has wired up their outbound qemu_irq lines, because functions like
+ * qemu_set_irq() silently do nothing if there is nothing on the other
+ * end of the line. However occasionally a device model will want to
+ * provide default behaviour if its output is left floating, and
+ * it can use this function to identify when that is the case.
+ */
+static inline bool qemu_irq_is_connected(qemu_irq irq)
+{
+    return irq != NULL;
+}
+
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:01 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16675.41362 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd13-0005un-2X; Fri, 30 Oct 2020 22:37:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16675.41362; Fri, 30 Oct 2020 22:37:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd12-0005ud-Vc; Fri, 30 Oct 2020 22:37:00 +0000
Received: by outflank-mailman (input) for mailman id 16675;
 Fri, 30 Oct 2020 22:37:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd12-0005uS-2C
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5ba78378-078f-4ea6-87a5-097922824a72;
 Fri, 30 Oct 2020 22:36:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd10-0005Ra-VA
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd10-0005FW-US
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:58 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd12-0005uS-2C
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:00 +0000
X-Inumbo-ID: 5ba78378-078f-4ea6-87a5-097922824a72
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5ba78378-078f-4ea6-87a5-097922824a72;
	Fri, 30 Oct 2020 22:36:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5RUj2eb6X+GMF1DAEYb/C+mZVGW9ZIcoAEadmWpcekU=; b=tC/b0/J7du1NxiVkdtGRh+W37r
	b4Dxp1Bxeb97krnDW02DOrhFF7gGhdVKKI48Ara1FbYHamg8td1NHSgPkjg+l0xMLtSbL/XDXvb8u
	LNyLijIoB/pB6hrvy6soIFU5SVD42s23cMct/VBZ1QwOQmzZFpwyNczes3RPm2COPQu8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd10-0005Ra-VA
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:58 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd10-0005FW-US
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:36:58 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
Message-Id: <E1kYd10-0005FW-US@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:36:58 +0000

commit 9e60d759d38d1faae1d85de2c53411e635be3cf2
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
    
    The NVIC provides an outbound qemu_irq "SYSRESETREQ" which it signals
    when the guest sets the SYSRESETREQ bit in the AIRCR register.  This
    matches the hardware design (where the CPU has a signal of this name
    and it is up to the SoC to connect that up to an actual reset
    mechanism), but in QEMU it mostly results in duplicated code in SoC
    objects and bugs where SoC model implementors forget to wire up the
    SYSRESETREQ line.
    
    Provide a default behaviour for the case where SYSRESETREQ is not
    actually connected to anything: use qemu_system_reset_request() to
    perform a system reset.  This will allow us to remove the
    implementations of SYSRESETREQ handling from the boards where that's
    exactly what it does, and also fixes the bugs in the board models
    which forgot to wire up the signal:
    
     * microbit
     * mps2-an385
     * mps2-an505
     * mps2-an511
     * mps2-an521
     * musca-a
     * musca-b1
     * netduino
     * netduinoplus2
    
    We still allow the board to wire up the signal if it needs to, in case
    we need to model more complicated reset controller logic or to model
    buggy SoC hardware which forgot to wire up the line itself. But
    defaulting to "reset the system" is more often going to be correct
    than defaulting to "do nothing".
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-3-peter.maydell@linaro.org
---
 hw/intc/armv7m_nvic.c   | 17 ++++++++++++++++-
 include/hw/arm/armv7m.h |  4 +++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 3c4b6e6d70..277a98b87b 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -19,6 +19,7 @@
 #include "hw/intc/armv7m_nvic.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
+#include "sysemu/runstate.h"
 #include "target/arm/cpu.h"
 #include "exec/exec-all.h"
 #include "exec/memop.h"
@@ -64,6 +65,20 @@ static const uint8_t nvic_id[] = {
     0x00, 0xb0, 0x1b, 0x00, 0x0d, 0xe0, 0x05, 0xb1
 };
 
+static void signal_sysresetreq(NVICState *s)
+{
+    if (qemu_irq_is_connected(s->sysresetreq)) {
+        qemu_irq_pulse(s->sysresetreq);
+    } else {
+        /*
+         * Default behaviour if the SoC doesn't need to wire up
+         * SYSRESETREQ (eg to a system reset controller of some kind):
+         * perform a system reset via the usual QEMU API.
+         */
+        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+    }
+}
+
 static int nvic_pending_prio(NVICState *s)
 {
     /* return the group priority of the current pending interrupt,
@@ -1524,7 +1539,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value,
             if (value & R_V7M_AIRCR_SYSRESETREQ_MASK) {
                 if (attrs.secure ||
                     !(cpu->env.v7m.aircr & R_V7M_AIRCR_SYSRESETREQS_MASK)) {
-                    qemu_irq_pulse(s->sysresetreq);
+                    signal_sysresetreq(s);
                 }
             }
             if (value & R_V7M_AIRCR_VECTCLRACTIVE_MASK) {
diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h
index d2c74d3872..a30e3c6471 100644
--- a/include/hw/arm/armv7m.h
+++ b/include/hw/arm/armv7m.h
@@ -35,7 +35,9 @@ typedef struct {
 
 /* ARMv7M container object.
  * + Unnamed GPIO input lines: external IRQ lines for the NVIC
- * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ
+ * + Named GPIO output SYSRESETREQ: signalled for guest AIRCR.SYSRESETREQ.
+ *   If this GPIO is not wired up then the NVIC will default to performing
+ *   a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET).
  * + Property "cpu-type": CPU type to instantiate
  * + Property "num-irq": number of external IRQ lines
  * + Property "memory": MemoryRegion defining the physical address space
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16676.41366 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1E-0005w4-3i; Fri, 30 Oct 2020 22:37:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16676.41366; Fri, 30 Oct 2020 22:37:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1E-0005vw-0p; Fri, 30 Oct 2020 22:37:12 +0000
Received: by outflank-mailman (input) for mailman id 16676;
 Fri, 30 Oct 2020 22:37:10 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd1C-0005vn-Ss
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 5e660369-bd00-4e18-b40c-874ac21c8760;
 Fri, 30 Oct 2020 22:37:09 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1B-0005Rv-2t
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1B-0005Gi-1b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:09 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd1C-0005vn-Ss
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:10 +0000
X-Inumbo-ID: 5e660369-bd00-4e18-b40c-874ac21c8760
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 5e660369-bd00-4e18-b40c-874ac21c8760;
	Fri, 30 Oct 2020 22:37:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GSNo0r6S6eDBtbomifjzXihBeUo6ElayBBwuyUMxbnw=; b=I5ZSM8kGEes6Wr3ywdh75BA1JG
	7rRx6RZuxOdpRRWGkH2+fzanPBXGQ5zKvB27XyTThXgFeq0wwdUTCwfpEiILqkGKdkUHnxwyECqbE
	ZLEjuJuRvL1ivHSD7S8+vj89sSymcu/8ryYWJeACngN4oCUSV5XVLvg23XPCQEdlNC0g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1B-0005Rv-2t
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:09 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1B-0005Gi-1b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:09 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] msf2-soc, stellaris: Don't wire up SYSRESETREQ
Message-Id: <E1kYd1B-0005Gi-1b@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:09 +0000

commit fc6bb6e67e2f2b81de765a1c1ad5956de625ab19
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    msf2-soc, stellaris: Don't wire up SYSRESETREQ
    
    The MSF2 SoC model and the Stellaris board code both wire
    SYSRESETREQ up to a function that just invokes
        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
    This is now the default action that the NVIC does if the line is
    not connected, so we can delete the handling code.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
    Message-id: 20200728103744.6909-4-peter.maydell@linaro.org
---
 hw/arm/msf2-soc.c  | 11 -----------
 hw/arm/stellaris.c | 12 ------------
 2 files changed, 23 deletions(-)

diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 33ea7df342..d2c29e82d1 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -30,7 +30,6 @@
 #include "hw/irq.h"
 #include "hw/arm/msf2-soc.h"
 #include "hw/misc/unimp.h"
-#include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 
 #define MSF2_TIMER_BASE       0x40004000
@@ -59,13 +58,6 @@ static const int spi_irq[MSF2_NUM_SPIS] = { 2, 3 };
 static const int uart_irq[MSF2_NUM_UARTS] = { 10, 11 };
 static const int timer_irq[MSF2_NUM_TIMERS] = { 14, 15 };
 
-static void do_sys_reset(void *opaque, int n, int level)
-{
-    if (level) {
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
-    }
-}
-
 static void m2sxxx_soc_initfn(Object *obj)
 {
     MSF2State *s = MSF2_SOC(obj);
@@ -130,9 +122,6 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
         return;
     }
 
-    qdev_connect_gpio_out_named(DEVICE(&s->armv7m.nvic), "SYSRESETREQ", 0,
-                                qemu_allocate_irq(&do_sys_reset, NULL, 0));
-
     system_clock_scale = NANOSECONDS_PER_SECOND / s->m3clk;
 
     for (i = 0; i < MSF2_NUM_UARTS; i++) {
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 28eb15c76c..5f9d080180 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -18,7 +18,6 @@
 #include "hw/boards.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
-#include "sysemu/runstate.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/armv7m.h"
 #include "hw/char/pl011.h"
@@ -1206,14 +1205,6 @@ static void stellaris_adc_init(Object *obj)
     qdev_init_gpio_in(dev, stellaris_adc_trigger, 1);
 }
 
-static
-void do_sys_reset(void *opaque, int n, int level)
-{
-    if (level) {
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
-    }
-}
-
 /* Board init.  */
 static stellaris_board_info stellaris_boards[] = {
   { "LM3S811EVB",
@@ -1317,9 +1308,6 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
     /* This will exit with an error if the user passed us a bad cpu_type */
     sysbus_realize_and_unref(SYS_BUS_DEVICE(nvic), &error_fatal);
 
-    qdev_connect_gpio_out_named(nvic, "SYSRESETREQ", 0,
-                                qemu_allocate_irq(&do_sys_reset, NULL, 0));
-
     if (board->dc1 & (1 << 16)) {
         dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000,
                                     qdev_get_gpio_in(nvic, 14),
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:21 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16677.41370 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1N-0005xE-5Y; Fri, 30 Oct 2020 22:37:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16677.41370; Fri, 30 Oct 2020 22:37:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1N-0005x6-2G; Fri, 30 Oct 2020 22:37:21 +0000
Received: by outflank-mailman (input) for mailman id 16677;
 Fri, 30 Oct 2020 22:37:20 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd1M-0005wz-7x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:20 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 5a6a5b7f-d34e-470b-9029-2f74848a6d3c;
 Fri, 30 Oct 2020 22:37:19 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1L-0005S5-6L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1L-0005Hc-5b
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:19 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd1M-0005wz-7x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:20 +0000
X-Inumbo-ID: 5a6a5b7f-d34e-470b-9029-2f74848a6d3c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 5a6a5b7f-d34e-470b-9029-2f74848a6d3c;
	Fri, 30 Oct 2020 22:37:19 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/ayoYtlT+/ty5+9cluZipZrf0kEOSV3FAOSgnMBGE0w=; b=u4aWpTt/wnI/+MdJhPHUHBTcER
	qA9+hRT3fFVgYdxZuVURNyVEgiDpoxgaajdtrOd52yvzBGK8IsPdBsID74uZCTkWhwjh5uWvIgOV9
	XkUcKtAaCRFz9ITY3AbTyNr6j3J9cV9eSSDfZG2XLaOXE6RN5nV0rEO8rrTEBSNSLzdY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1L-0005S5-6L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:19 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1L-0005Hc-5b
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:19 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Fix AddPAC error indication
Message-Id: <E1kYd1L-0005Hc-5b@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:19 +0000

commit 8796fe40dd30cd9ffd3c958906471715c923b341
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Aug 3 17:55:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:03 2020 +0100

    target/arm: Fix AddPAC error indication
    
    The definition of top_bit used in this function is one higher
    than that used in the Arm ARM psuedo-code, which put the error
    indication at top_bit - 1 at the wrong place, which meant that
    it wasn't visible to Auth.
    
    Fixing the definition of top_bit requires more changes, because
    its most common use is for the count of bits in top_bit:bot_bit,
    which would then need to be computed as top_bit - bot_bit + 1.
    
    For now, prefer the minimal fix to the error indication alone.
    
    Fixes: 63ff0ca94cb
    Reported-by: Derrick McKee <derrick.mckee@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20200728195706.11087-1-richard.henderson@linaro.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: added comment about the divergence from the pseudocode]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/pauth_helper.c         |  6 +++++-
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/aarch64/pauth-5.c       | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/target/arm/pauth_helper.c b/target/arm/pauth_helper.c
index b909630317..6dbab03768 100644
--- a/target/arm/pauth_helper.c
+++ b/target/arm/pauth_helper.c
@@ -300,7 +300,11 @@ static uint64_t pauth_addpac(CPUARMState *env, uint64_t ptr, uint64_t modifier,
      */
     test = sextract64(ptr, bot_bit, top_bit - bot_bit);
     if (test != 0 && test != -1) {
-        pac ^= MAKE_64BIT_MASK(top_bit - 1, 1);
+        /*
+         * Note that our top_bit is one greater than the pseudocode's
+         * version, hence "- 2" here.
+         */
+        pac ^= MAKE_64BIT_MASK(top_bit - 2, 1);
     }
 
     /*
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index b617f2ac7e..e7249915e7 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -19,7 +19,7 @@ run-fcvt: fcvt
 
 # Pauth Tests
 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),)
-AARCH64_TESTS += pauth-1 pauth-2 pauth-4
+AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
 pauth-%: CFLAGS += -march=armv8.3-a
 run-pauth-%: QEMU_OPTS += -cpu max
 run-plugin-pauth-%: QEMU_OPTS += -cpu max
diff --git a/tests/tcg/aarch64/pauth-5.c b/tests/tcg/aarch64/pauth-5.c
new file mode 100644
index 0000000000..67c257918b
--- /dev/null
+++ b/tests/tcg/aarch64/pauth-5.c
@@ -0,0 +1,33 @@
+#include <assert.h>
+
+static int x;
+
+int main()
+{
+    int *p0 = &x, *p1, *p2, *p3;
+    unsigned long salt = 0;
+
+    /*
+     * With TBI enabled and a 48-bit VA, there are 7 bits of auth, and so
+     * a 1/128 chance of auth = pac(ptr,key,salt) producing zero.
+     * Find a salt that creates auth != 0.
+     */
+    do {
+        salt++;
+        asm("pacda %0, %1" : "=r"(p1) : "r"(salt), "0"(p0));
+    } while (p0 == p1);
+
+    /*
+     * This pac must fail, because the input pointer bears an encryption,
+     * and so is not properly extended within bits [55:47].  This will
+     * toggle bit 54 in the output...
+     */
+    asm("pacda %0, %1" : "=r"(p2) : "r"(salt), "0"(p1));
+
+    /* ... so that the aut must fail, setting bit 53 in the output ... */
+    asm("autda %0, %1" : "=r"(p3) : "r"(salt), "0"(p2));
+
+    /* ... which means this equality must not hold. */
+    assert(p3 != p0);
+    return 0;
+}
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:31 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16678.41374 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1X-0005yk-8I; Fri, 30 Oct 2020 22:37:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16678.41374; Fri, 30 Oct 2020 22:37:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1X-0005yc-5Q; Fri, 30 Oct 2020 22:37:31 +0000
Received: by outflank-mailman (input) for mailman id 16678;
 Fri, 30 Oct 2020 22:37:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd1W-0005yM-3m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:30 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 71f81681-3777-4314-be01-8ed96187428c;
 Fri, 30 Oct 2020 22:37:29 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1V-0005SH-BE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1V-0005Im-9f
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:29 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd1W-0005yM-3m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:30 +0000
X-Inumbo-ID: 71f81681-3777-4314-be01-8ed96187428c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 71f81681-3777-4314-be01-8ed96187428c;
	Fri, 30 Oct 2020 22:37:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G45mO9rBZ2n4dzGiPMO8eNvDqpnk7Vv06urcB4xroZA=; b=6v/d58tJxfA6jeq1ksy/0NfzP1
	dku+VBFRwCKCVW7KcNIsWY4Jqmj0bvkjbBklqsFuHSy0nDJdYjwd1v8HdHwejizNcsvtkwWii/gRy
	0otuQuVDK6w9nzsKMHljTuWo2/YVprsE8Nwg1aeu6urIshsTR9xIOqPJV1lf2+LHthIs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1V-0005SH-BE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:29 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1V-0005Im-9f
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:29 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Avoid maybe-uninitialized warning with gcc 4.9
Message-Id: <E1kYd1V-0005Im-9f@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:29 +0000

commit 88a90e3de6ae99cbcfcc04c862c51f241fdf685f
Author:     Kaige Li <likaige@loongson.cn>
AuthorDate: Mon Aug 3 17:55:04 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:04 2020 +0100

    target/arm: Avoid maybe-uninitialized warning with gcc 4.9
    
    GCC version 4.9.4 isn't clever enough to figure out that all
    execution paths in disas_ldst() that use 'fn' will have initialized
    it first, and so it warns:
    
    /home/LiKaige/qemu/target/arm/translate-a64.c: In function ‘disas_ldst’:
    /home/LiKaige/qemu/target/arm/translate-a64.c:3392:5: error: ‘fn’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         fn(cpu_reg(s, rt), clean_addr, tcg_rs, get_mem_index(s),
         ^
    /home/LiKaige/qemu/target/arm/translate-a64.c:3318:22: note: ‘fn’ was declared here
         AtomicThreeOpFn *fn;
                          ^
    
    Make it happy by initializing the variable to NULL.
    
    Signed-off-by: Kaige Li <likaige@loongson.cn>
    Message-id: 1596110248-7366-2-git-send-email-likaige@loongson.cn
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    [PMM: Clean up commit message and note which gcc version this was]
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/translate-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 8c0764957c..c98dfb17a8 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3315,7 +3315,7 @@ static void disas_ldst_atomic(DisasContext *s, uint32_t insn,
     bool r = extract32(insn, 22, 1);
     bool a = extract32(insn, 23, 1);
     TCGv_i64 tcg_rs, clean_addr;
-    AtomicThreeOpFn *fn;
+    AtomicThreeOpFn *fn = NULL;
 
     if (is_vector || !dc_isar_feature(aa64_atomics, s)) {
         unallocated_encoding(s);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:41 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16679.41377 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1h-00060Q-9s; Fri, 30 Oct 2020 22:37:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16679.41377; Fri, 30 Oct 2020 22:37:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1h-00060I-70; Fri, 30 Oct 2020 22:37:41 +0000
Received: by outflank-mailman (input) for mailman id 16679;
 Fri, 30 Oct 2020 22:37:40 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd1g-0005zg-94
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:40 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 6e014a91-09da-4be4-85e6-b2dc17184eb2;
 Fri, 30 Oct 2020 22:37:39 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1f-0005UY-F4
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1f-0005LD-Du
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:39 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd1g-0005zg-94
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:40 +0000
X-Inumbo-ID: 6e014a91-09da-4be4-85e6-b2dc17184eb2
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 6e014a91-09da-4be4-85e6-b2dc17184eb2;
	Fri, 30 Oct 2020 22:37:39 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pibnE+Wq+YT43TbBD1WjINxThEP1LKxkoccH5C2JB/4=; b=JDT/YUB4TD8jDkJlFoXrtNRkyx
	Kex8+OBDxl9W5aBSlOcFKcIbBkPhxd7pv2lr5x0lcLt+Qk5q5cXXYGDZY1gZ0Bk8v8Qn+90oXnuww
	oY9XSbpeDzJRC0RePuWdGpH9JLqYOf5G0TgQqtJ0Y1N+lILWKY+qhFwD1JXxgYjxpTEU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1f-0005UY-F4
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:39 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1f-0005LD-Du
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:39 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/arm/nrf51_soc: Set system_clock_scale
Message-Id: <E1kYd1f-0005LD-Du@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:39 +0000

commit ce4f70e81ed23c93ff39234672aff33114532640
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 20:34:58 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:55:31 2020 +0100

    hw/arm/nrf51_soc: Set system_clock_scale
    
    The nrf51 SoC model wasn't setting the system_clock_scale
    global.which meant that if guest code used the systick timer in "use
    the processor clock" mode it would hang because time never advances.
    
    Set the global to match the documented CPU clock speed for this SoC.
    
    This SoC in fact doesn't have a SysTick timer (which is the only thing
    currently that cares about the system_clock_scale), because it's
    a configurable option in the Cortex-M0. However our Cortex-M0 and
    thus our nrf51 and our micro:bit board do provide a SysTick, so
    we ought to provide a functional one rather than a broken one.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200727193458.31250-1-peter.maydell@linaro.org
---
 hw/arm/nrf51_soc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c
index 45e6cc97d7..e15981e019 100644
--- a/hw/arm/nrf51_soc.c
+++ b/hw/arm/nrf51_soc.c
@@ -32,6 +32,9 @@
 
 #define BASE_TO_IRQ(base) ((base >> 12) & 0x1F)
 
+/* HCLK (the main CPU clock) on this SoC is always 16MHz */
+#define HCLK_FRQ 16000000
+
 static uint64_t clock_read(void *opaque, hwaddr addr, unsigned int size)
 {
     qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " [%u]\n",
@@ -65,6 +68,8 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
         return;
     }
 
+    system_clock_scale = NANOSECONDS_PER_SECOND / HCLK_FRQ;
+
     object_property_set_link(OBJECT(&s->cpu), "memory", OBJECT(&s->container),
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), errp)) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:37:51 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:37:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16680.41383 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1r-00061u-Bu; Fri, 30 Oct 2020 22:37:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16680.41383; Fri, 30 Oct 2020 22:37:51 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd1r-00061i-8R; Fri, 30 Oct 2020 22:37:51 +0000
Received: by outflank-mailman (input) for mailman id 16680;
 Fri, 30 Oct 2020 22:37:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd1q-00061U-Du
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:50 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 26a5071b-8538-45ac-9ec9-c9eed6f1af43;
 Fri, 30 Oct 2020 22:37:49 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1p-0005Uj-JF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1p-0005MG-Hv
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:49 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd1q-00061U-Du
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:50 +0000
X-Inumbo-ID: 26a5071b-8538-45ac-9ec9-c9eed6f1af43
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 26a5071b-8538-45ac-9ec9-c9eed6f1af43;
	Fri, 30 Oct 2020 22:37:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9CepYLbeI2g+5B9dXG8LgFrzwsN/yo8QDPgpqKJU510=; b=7AnzvWIWI+zHA4D7NB++HJUIhb
	IXPLDhwEw01HOdhA0N4hqgZ9YQ3y61uaGJJzkL1lLloWkW8Z0A23R8aZB/3HqdVuNzqKH1qN66xFv
	rqU9dKVG7QYWV5U1BUnTxDbkTQsx5dBCXsdBxOMyQUEAYxOgwGcITTJMEmMBp2u+7zJQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1p-0005Uj-JF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:49 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1p-0005MG-Hv
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:49 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/timer/imx_epit: Avoid assertion when CR.SWR is written
Message-Id: <E1kYd1p-0005MG-Hv@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:49 +0000

commit 13557fd392890cbd985bceba7f717e01efd674b8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Jul 27 16:45:50 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 17:56:11 2020 +0100

    hw/timer/imx_epit: Avoid assertion when CR.SWR is written
    
    The imx_epit device has a software-controllable reset triggered by
    setting the SWR bit in the CR register. An error in commit cc2722ec83ad9
    means that we will end up assert()ing if the guest does this, because
    the code in imx_epit_write() starts ptimer transactions, and then
    imx_epit_reset() also starts ptimer transactions, triggering
    "ptimer_transaction_begin: Assertion `!s->in_transaction' failed".
    
    The cleanest way to avoid this double-transaction is to move the
    start-transaction for the CR write handling down below the check of
    the SWR bit.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1880424
    Fixes: cc2722ec83ad944505fe
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Message-id: 20200727154550.3409-1-peter.maydell@linaro.org
---
 hw/timer/imx_epit.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index baf6338e1a..ebd58254d1 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -199,15 +199,22 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
 
     switch (offset >> 2) {
     case 0: /* CR */
-        ptimer_transaction_begin(s->timer_cmp);
-        ptimer_transaction_begin(s->timer_reload);
 
         oldcr = s->cr;
         s->cr = value & 0x03ffffff;
         if (s->cr & CR_SWR) {
             /* handle the reset */
             imx_epit_reset(DEVICE(s));
-        } else {
+            /*
+             * TODO: could we 'break' here? following operations appear
+             * to duplicate the work imx_epit_reset() already did.
+             */
+        }
+
+        ptimer_transaction_begin(s->timer_cmp);
+        ptimer_transaction_begin(s->timer_reload);
+
+        if (!(s->cr & CR_SWR)) {
             imx_epit_set_freq(s);
         }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:02 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16681.41387 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd22-00064p-Dt; Fri, 30 Oct 2020 22:38:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16681.41387; Fri, 30 Oct 2020 22:38:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd22-00064g-A4; Fri, 30 Oct 2020 22:38:02 +0000
Received: by outflank-mailman (input) for mailman id 16681;
 Fri, 30 Oct 2020 22:38:00 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd20-00064U-PS
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:00 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id cd6786e7-74ff-4175-9751-006210d3114a;
 Fri, 30 Oct 2020 22:37:59 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1z-0005Ur-Oc
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd1z-0005NB-MT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:59 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd20-00064U-PS
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:00 +0000
X-Inumbo-ID: cd6786e7-74ff-4175-9751-006210d3114a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id cd6786e7-74ff-4175-9751-006210d3114a;
	Fri, 30 Oct 2020 22:37:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IJpe5wXhXim04jNpBzZkPkCx53zCGA9PmDfmpqDNXSs=; b=zFbiH3Ade7ge2giUH4Ezy/lCPM
	mjf/z/QcSUHyfygsX5H9bW/MYLseYL4wn7FrIG9FEVZ6UmQdjNs9raVrSvtpIHfwzi5B4uxyR3moC
	0g/AgaRaYZ94hUVGKAGAh48N5e2wBS+o6RmPTOuoBW/Dd/73QaaN+1nfdG5MUe2vQ1yk=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1z-0005Ur-Oc
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:59 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd1z-0005NB-MT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:37:59 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200803' into staging
Message-Id: <E1kYd1z-0005NB-MT@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:37:59 +0000

commit 5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10
Merge: 45a150aa2b3492acf6691c7bdbeb25a8545d8345 13557fd392890cbd985bceba7f717e01efd674b8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Mon Aug 3 20:34:26 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Mon Aug 3 20:34:26 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200803' into staging
    
    target-arm queue:
     * hw/timer/imx_epit: Avoid assertion when CR.SWR is written
     * netduino2, netduinoplus2, microbit: set system_clock_scale so that
       SysTick running on the CPU clock works
     * target/arm: Avoid maybe-uninitialized warning with gcc 4.9
     * target/arm: Fix AddPAC error indication
     * Make AIRCR.SYSRESETREQ actually reset the system for the
       microbit, mps2-*, musca-*, netduino* boards
    
    # gpg: Signature made Mon 03 Aug 2020 20:29:17 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200803:
      hw/timer/imx_epit: Avoid assertion when CR.SWR is written
      hw/arm/nrf51_soc: Set system_clock_scale
      target/arm: Avoid maybe-uninitialized warning with gcc 4.9
      target/arm: Fix AddPAC error indication
      msf2-soc, stellaris: Don't wire up SYSRESETREQ
      hw/intc/armv7m_nvic: Provide default "reset the system" behaviour for SYSRESETREQ
      include/hw/irq.h: New function qemu_irq_is_connected()
      hw/arm/netduino2, netduinoplus2: Set system_clock_scale
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/arm/msf2-soc.c                 | 11 -----------
 hw/arm/netduino2.c                | 10 ++++++++++
 hw/arm/netduinoplus2.c            | 10 ++++++++++
 hw/arm/nrf51_soc.c                |  5 +++++
 hw/arm/stellaris.c                | 12 ------------
 hw/intc/armv7m_nvic.c             | 17 ++++++++++++++++-
 hw/timer/imx_epit.c               | 13 ++++++++++---
 include/hw/arm/armv7m.h           |  4 +++-
 include/hw/irq.h                  | 18 ++++++++++++++++++
 target/arm/pauth_helper.c         |  6 +++++-
 target/arm/translate-a64.c        |  2 +-
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/aarch64/pauth-5.c       | 33 +++++++++++++++++++++++++++++++++
 13 files changed, 112 insertions(+), 31 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:12 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16682.41390 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2C-00065z-EY; Fri, 30 Oct 2020 22:38:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16682.41390; Fri, 30 Oct 2020 22:38:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2C-00065r-Bf; Fri, 30 Oct 2020 22:38:12 +0000
Received: by outflank-mailman (input) for mailman id 16682;
 Fri, 30 Oct 2020 22:38:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2A-00065d-Ss
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id db176425-2084-4dd1-919a-b722601575a3;
 Fri, 30 Oct 2020 22:38:10 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2A-0005VC-3o
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2A-0005OU-31
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2A-00065d-Ss
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
X-Inumbo-ID: db176425-2084-4dd1-919a-b722601575a3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id db176425-2084-4dd1-919a-b722601575a3;
	Fri, 30 Oct 2020 22:38:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0sVc7xQT4O7/Iy0f0M1X+PoOw/7SHoEnPLVUyA1JDXg=; b=iq3P6+7U/u62qLLiiQmjzZY7lz
	TiViNBRmo4iJFsb753b8biranTCaY2ymvxw+Eidkqo0l1yJDX81x16R6WzqqGQfdon6EZMorAERV8
	MQAyFlxUgvlQfcPw1hzjtIxc9KoO0iBgVROWVlK8qW0X3ZxYinrJW52o4dQERBGgP7rI=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2A-0005VC-3o
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2A-0005OU-31
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:10 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Message-Id: <E1kYd2A-0005OU-31@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:38:10 +0000

commit f81cddfe8abe7d7e2220e611ee69d2cdf34eb789
Author:     Lukas Straub <lukasstraub2@web.de>
AuthorDate: Fri Jul 31 07:06:04 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Aug 4 14:14:48 2020 +0800

    colo-compare: Remove superfluous NULL-pointer checks for s->iothread
    
    s->iothread is checked for NULL on object creation in colo_compare_complete,
    so it's guaranteed not to be NULL.
    This resolves a false alert from Coverity (CID 1429969).
    
    Signed-off-by: Lukas Straub <lukasstraub2@web.de>
    Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@redhat.com>
    Reviewed-by: Li Qiang <liq3ea@gmail.com>
    Reviewed-by: Zhang Chen <chen.zhang@intel.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/colo-compare.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index cc15f23dea..2c20de1537 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -1442,9 +1442,7 @@ static void colo_compare_finalize(Object *obj)
         qemu_chr_fe_deinit(&s->chr_notify_dev, false);
     }
 
-    if (s->iothread) {
-        colo_compare_timer_del(s);
-    }
+    colo_compare_timer_del(s);
 
     qemu_bh_delete(s->event_bh);
 
@@ -1470,9 +1468,7 @@ static void colo_compare_finalize(Object *obj)
         g_hash_table_destroy(s->connection_track_table);
     }
 
-    if (s->iothread) {
-        object_unref(OBJECT(s->iothread));
-    }
+    object_unref(OBJECT(s->iothread));
 
     g_free(s->pri_indev);
     g_free(s->sec_indev);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:22 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16683.41394 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2M-00067H-GD; Fri, 30 Oct 2020 22:38:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16683.41394; Fri, 30 Oct 2020 22:38:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2M-000679-DC; Fri, 30 Oct 2020 22:38:22 +0000
Received: by outflank-mailman (input) for mailman id 16683;
 Fri, 30 Oct 2020 22:38:21 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2L-00066z-5j
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:21 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d02a437e-5861-4372-a875-afd7a0f60b3a;
 Fri, 30 Oct 2020 22:38:20 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2K-0005VK-7a
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2K-0005PA-6T
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:20 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2L-00066z-5j
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:21 +0000
X-Inumbo-ID: d02a437e-5861-4372-a875-afd7a0f60b3a
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d02a437e-5861-4372-a875-afd7a0f60b3a;
	Fri, 30 Oct 2020 22:38:20 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AcT5q4SB+71Ny7Ghfc8CrW5tljVyzvbuEW0IQkBc2qQ=; b=kpeRX2VaTY+kIWCmTpRTwTpAMl
	+Bh/2yRRMGfShuYAZ1yNxVTF9SH7ux4cjl+aVgua21E2i9F88IUj8VwHbGIJkHNGo8lKrnlhrADzu
	oRcKm+5KmWlc+jMQiMdY4n8NEpNWDQtrfAxBy3p/R3l/1AnQAPMltG4blyKSuXuhzCng=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2K-0005VK-7a
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:20 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2K-0005PA-6T
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:20 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
Message-Id: <E1kYd2K-0005PA-6T@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:38:20 +0000

commit 035e69b063835a5fd23cacabd63690a3d84532a8
Author:     Mauro Matteo Cascella <mcascell@redhat.com>
AuthorDate: Sat Aug 1 18:42:38 2020 +0200
Commit:     Jason Wang <jasowang@redhat.com>
CommitDate: Tue Aug 4 14:14:48 2020 +0800

    hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
    
    An assertion failure issue was found in the code that processes network packets
    while adding data fragments into the packet context. It could be abused by a
    malicious guest to abort the QEMU process on the host. This patch replaces the
    affected assert() with a conditional statement, returning false if the current
    data fragment exceeds max_raw_frags.
    
    Reported-by: Alexander Bulekov <alxndr@bu.edu>
    Reported-by: Ziming Zhang <ezrakiez@gmail.com>
    Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com>
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
    Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/net_tx_pkt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 9560e4a49e..da262edc3e 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -379,7 +379,10 @@ bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa,
     hwaddr mapped_len = 0;
     struct iovec *ventry;
     assert(pkt);
-    assert(pkt->max_raw_frags > pkt->raw_frags);
+
+    if (pkt->raw_frags >= pkt->max_raw_frags) {
+        return false;
+    }
 
     if (!len) {
         return true;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:32 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16684.41398 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2W-00068Z-I1; Fri, 30 Oct 2020 22:38:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16684.41398; Fri, 30 Oct 2020 22:38:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2W-00068R-Ep; Fri, 30 Oct 2020 22:38:32 +0000
Received: by outflank-mailman (input) for mailman id 16684;
 Fri, 30 Oct 2020 22:38:31 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2V-00068E-7A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:31 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0ca4b92f-8220-48a5-94e3-af2ac20e2dbc;
 Fri, 30 Oct 2020 22:38:30 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2U-0005VS-B6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2U-0005Pn-AF
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:30 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2V-00068E-7A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:31 +0000
X-Inumbo-ID: 0ca4b92f-8220-48a5-94e3-af2ac20e2dbc
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0ca4b92f-8220-48a5-94e3-af2ac20e2dbc;
	Fri, 30 Oct 2020 22:38:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wVG0jvJyQ5FhF9zSC+HHt2McvP//bXc+jx/hiD0BUwQ=; b=QQZPnCokhUFGdJiF4pb6wMrBwh
	Mtlyr8YdABtK8r5cbCaJyaXGtGtwlJhyUtTqlAsd8GXOCl7H2aBN2csFfE0otJgIwV3qQHq+a3wsx
	K5elWLuU8gm2Wc9VE/R3eQf6crwkNjXW0CVPx3ZO1bFCpzNmT6sz/k/NUHIV/tZVRhwg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2U-0005VS-B6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:30 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2U-0005Pn-AF
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:30 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Message-Id: <E1kYd2U-0005Pn-AF@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:38:30 +0000

commit bcc983234ba0852729107acca3365ab5359dc0e0
Merge: 5c1c3e4f02e458cf280c677c817ae4fd1ed9bf10 035e69b063835a5fd23cacabd63690a3d84532a8
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 10:20:08 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 10:20:08 2020 +0100

    Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
    
    # gpg: Signature made Tue 04 Aug 2020 07:15:08 BST
    # gpg:                using RSA key EF04965B398D6211
    # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
    
    * remotes/jasowang/tags/net-pull-request:
      hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
      colo-compare: Remove superfluous NULL-pointer checks for s->iothread
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/net/net_tx_pkt.c | 5 ++++-
 net/colo-compare.c  | 8 ++------
 2 files changed, 6 insertions(+), 7 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:42 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16685.41402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2g-0006Ae-L1; Fri, 30 Oct 2020 22:38:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16685.41402; Fri, 30 Oct 2020 22:38:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2g-0006AW-Hy; Fri, 30 Oct 2020 22:38:42 +0000
Received: by outflank-mailman (input) for mailman id 16685;
 Fri, 30 Oct 2020 22:38:41 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2f-0006AN-Ld
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:41 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 45a2053e-2f12-4201-aa12-fa2e2d313ce4;
 Fri, 30 Oct 2020 22:38:40 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2e-0005Vz-LY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2e-0005Qk-Kj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:40 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2f-0006AN-Ld
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:41 +0000
X-Inumbo-ID: 45a2053e-2f12-4201-aa12-fa2e2d313ce4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 45a2053e-2f12-4201-aa12-fa2e2d313ce4;
	Fri, 30 Oct 2020 22:38:40 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mfq3vANcBBB1k9CLUak4HIy22dc/P/aUMzd1iXNMd6U=; b=MrIM8KOm38WqbPmlFFViD2BjgK
	oTPQR/hMx3hsk0OvLGH6X4EeQFEkEjvMQ0fT/BJUzvIaLDtAZ2lfRnScbdQFU4DYFlwqjPXNYHJpq
	jBcwUwoeGhtUGzt82lofcUnOCCm3iYgilpHV5FweEtzEKNtRIlGn/koj5Aq1PBpD7O3g=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2e-0005Vz-LY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:40 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2e-0005Qk-Kj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:40 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] accel/xen: Fix xen_enabled() behavior on target-agnostic objects
Message-Id: <E1kYd2e-0005Qk-Kj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:38:40 +0000

commit 8e0ef068942e4152f0d23e76ca1f5e35dc4456f7
Author:     Philippe Mathieu-Daudé <philmd@redhat.com>
AuthorDate: Tue Aug 4 09:49:30 2020 +0200
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Tue Aug 4 10:21:35 2020 +0100

    accel/xen: Fix xen_enabled() behavior on target-agnostic objects
    
    CONFIG_XEN is generated by configure and stored in "config-target.h",
    which is (obviously) only include for target-specific objects.
    This is a problem for target-agnostic objects as CONFIG_XEN is never
    defined and xen_enabled() is always inlined as 'false'.
    
    Fix by following the KVM schema, defining CONFIG_XEN_IS_POSSIBLE
    when we don't know to force the call of the non-inlined function,
    returning the xen_allowed boolean.
    
    Fixes: da278d58a092 ("accel: Move Xen accelerator code under accel/xen/")
    Reported-by: Paul Durrant <pdurrant@amazon.com>
    Suggested-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Message-Id: <20200804074930.13104-2-philmd@redhat.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 accel/stubs/xen-stub.c |  2 ++
 accel/xen/xen-all.c    |  7 +------
 include/sysemu/xen.h   | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/accel/stubs/xen-stub.c b/accel/stubs/xen-stub.c
index dcca4e678a..8ae658acff 100644
--- a/accel/stubs/xen-stub.c
+++ b/accel/stubs/xen-stub.c
@@ -9,6 +9,8 @@
 #include "hw/xen/xen.h"
 #include "qapi/qapi-commands-misc.h"
 
+bool xen_allowed;
+
 void xenstore_store_pv_console_info(int i, Chardev *chr)
 {
 }
diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
index 0c24d4b191..60b971d0a8 100644
--- a/accel/xen/xen-all.c
+++ b/accel/xen/xen-all.c
@@ -32,12 +32,7 @@
     do { } while (0)
 #endif
 
-static bool xen_allowed;
-
-bool xen_enabled(void)
-{
-    return xen_allowed;
-}
+bool xen_allowed;
 
 xc_interface *xen_xc;
 xenforeignmemory_handle *xen_fmem;
diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h
index 1ca292715e..2c2c429ea8 100644
--- a/include/sysemu/xen.h
+++ b/include/sysemu/xen.h
@@ -8,9 +8,19 @@
 #ifndef SYSEMU_XEN_H
 #define SYSEMU_XEN_H
 
-#ifdef CONFIG_XEN
+#ifdef NEED_CPU_H
+# ifdef CONFIG_XEN
+#  define CONFIG_XEN_IS_POSSIBLE
+# endif
+#else
+# define CONFIG_XEN_IS_POSSIBLE
+#endif
+
+#ifdef CONFIG_XEN_IS_POSSIBLE
+
+extern bool xen_allowed;
 
-bool xen_enabled(void);
+#define xen_enabled()           (xen_allowed)
 
 #ifndef CONFIG_USER_ONLY
 void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
@@ -18,7 +28,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
                    struct MemoryRegion *mr, Error **errp);
 #endif
 
-#else /* !CONFIG_XEN */
+#else /* !CONFIG_XEN_IS_POSSIBLE */
 
 #define xen_enabled() 0
 #ifndef CONFIG_USER_ONLY
@@ -33,6 +43,6 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
 }
 #endif
 
-#endif /* CONFIG_XEN */
+#endif /* CONFIG_XEN_IS_POSSIBLE */
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:38:52 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:38:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16686.41406 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2q-0006Bv-MZ; Fri, 30 Oct 2020 22:38:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16686.41406; Fri, 30 Oct 2020 22:38:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd2q-0006Bm-Jb; Fri, 30 Oct 2020 22:38:52 +0000
Received: by outflank-mailman (input) for mailman id 16686;
 Fri, 30 Oct 2020 22:38:51 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2p-0006Bb-HY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:51 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 2c956991-40dd-4c11-93dc-b033d808053c;
 Fri, 30 Oct 2020 22:38:50 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2o-0005WE-Ps
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2o-0005Rg-OC
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:50 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2p-0006Bb-HY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:51 +0000
X-Inumbo-ID: 2c956991-40dd-4c11-93dc-b033d808053c
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 2c956991-40dd-4c11-93dc-b033d808053c;
	Fri, 30 Oct 2020 22:38:50 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=07pakVulUfCAHVYVxZ2LS1ixfnI3XjPIrAxqVUbYv3o=; b=ihvi5+LhCDFHE5f6YyavPOkC4y
	AslfwRlBUsl8jEgdp02ciB5eEhQsPBCnq7xG3NCsjiPI7uGy1MPScB7Lhd535LmIT0NN3XkerDhA/
	DVInSsht5kSxr7T11b6zLzQH+l+1QYNy9JxrT94RsAKJd6ZP9LahHw0cHiK38W1wusRw=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2o-0005WE-Ps
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:50 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2o-0005Rg-OC
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:38:50 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200804' into staging
Message-Id: <E1kYd2o-0005Rg-OC@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:38:50 +0000

commit d15532d91be177e7528310e0110e39f915779a99
Merge: bcc983234ba0852729107acca3365ab5359dc0e0 8e0ef068942e4152f0d23e76ca1f5e35dc4456f7
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 11:53:20 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 11:53:20 2020 +0100

    Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200804' into staging
    
    xen patch
    
    Bug fix.
    
    # gpg: Signature made Tue 04 Aug 2020 10:24:51 BST
    # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
    # gpg:                issuer "anthony.perard@citrix.com"
    # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
    # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
    #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
    
    * remotes/aperard/tags/pull-xen-20200804:
      accel/xen: Fix xen_enabled() behavior on target-agnostic objects
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 accel/stubs/xen-stub.c |  2 ++
 accel/xen/xen-all.c    |  7 +------
 include/sysemu/xen.h   | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 10 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:03 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16687.41410 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd31-0006DE-OH; Fri, 30 Oct 2020 22:39:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16687.41410; Fri, 30 Oct 2020 22:39:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd31-0006D7-L8; Fri, 30 Oct 2020 22:39:03 +0000
Received: by outflank-mailman (input) for mailman id 16687;
 Fri, 30 Oct 2020 22:39:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd2z-0006Cw-VO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a3c20dce-8966-43f4-8cc5-6354bd32644b;
 Fri, 30 Oct 2020 22:39:01 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2z-0005WM-3w
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd2z-0005Sm-3A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd2z-0006Cw-VO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
X-Inumbo-ID: a3c20dce-8966-43f4-8cc5-6354bd32644b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a3c20dce-8966-43f4-8cc5-6354bd32644b;
	Fri, 30 Oct 2020 22:39:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nb5Zm57XpC+H6Eik96S21rL7+3+mluv7++xQl6sCON4=; b=ZbszQpaf4Zv2xAeGoZoiCw5sPC
	cu7HkzWwQeynME4RMrHN762AZxU4U+tMwdFolljKKehuIxnv7dQM9EuIRHbzTW26zUJvzDtNRcHf4
	a+te1AMBRbA1bikoOn9inNyPRLKpNevfzx2vaqGM98bNsIb0e1G9XAqHoeNQV/B0fs3M=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2z-0005WM-3w
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd2z-0005Sm-3A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:01 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] virtio-mem: Correct format specifier mismatch for RISC-V
Message-Id: <E1kYd2z-0005Sm-3A@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:01 +0000

commit facc68516a7ee6d4992dc47b42b47c600b20b21d
Author:     Bruce Rogers <brogers@suse.com>
AuthorDate: Thu Jul 30 07:05:19 2020 -0600
Commit:     Michael S. Tsirkin <mst@redhat.com>
CommitDate: Tue Aug 4 11:48:17 2020 -0400

    virtio-mem: Correct format specifier mismatch for RISC-V
    
    This likely affects other, less popular host architectures as well.
    Less common host architectures under linux get QEMU_VMALLOC_ALIGN (from
    which VIRTIO_MEM_MIN_BLOCK_SIZE is derived) define to a variable of
    type uintptr, which isn't compatible with the format specifier used to
    print a user message. Since this particular usage of the underlying data
    seems unique to this file, the simple fix is to just cast
    QEMU_VMALLOC_ALIGN to uint32_t, which corresponds to the format specifier
    used.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Message-Id: <20200730130519.168475-1-brogers@suse.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
    Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index c12e9f79b0..7740fc613f 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -36,7 +36,7 @@
  * Use QEMU_VMALLOC_ALIGN, so no THP will have to be split when unplugging
  * memory (e.g., 2MB on x86_64).
  */
-#define VIRTIO_MEM_MIN_BLOCK_SIZE QEMU_VMALLOC_ALIGN
+#define VIRTIO_MEM_MIN_BLOCK_SIZE ((uint32_t)QEMU_VMALLOC_ALIGN)
 /*
  * Size the usable region bigger than the requested size if possible. Esp.
  * Linux guests will only add (aligned) memory blocks in case they fully
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:16 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16688.41415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3B-0006ES-QR; Fri, 30 Oct 2020 22:39:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16688.41415; Fri, 30 Oct 2020 22:39:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3B-0006EK-Mm; Fri, 30 Oct 2020 22:39:13 +0000
Received: by outflank-mailman (input) for mailman id 16688;
 Fri, 30 Oct 2020 22:39:12 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd39-0006E8-Vg
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:12 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 0a27718b-675a-4d5a-b8a9-ad44aba7aa21;
 Fri, 30 Oct 2020 22:39:11 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd39-0005Wn-7L
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd39-0005U1-6c
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:11 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd39-0006E8-Vg
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:12 +0000
X-Inumbo-ID: 0a27718b-675a-4d5a-b8a9-ad44aba7aa21
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 0a27718b-675a-4d5a-b8a9-ad44aba7aa21;
	Fri, 30 Oct 2020 22:39:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cbxV0qi1Ao2/XVD+qSSEDxolp4M0g04auU8vVZS2yYQ=; b=1QYgsMJ9OXPE/AA+F2Q/oDOoGc
	L0T86gyO9EsKvzSJbstoC5K3IAE8b6ojkiPw0smCtoFqYXkN9xth/w4BFvML8enFU+zSf8BS24Euc
	MDa5D+L+d4euUzV8n7qhJ71j4goHBVWoSVCBuybKAkbLelWsPQQ/e/qXESbZO1CZJuOg=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd39-0005Wn-7L
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd39-0005U1-6c
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:11 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Message-Id: <E1kYd39-0005U1-6c@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:11 +0000

commit 881419b7117d5350c2a0288bfb79f2a83715df32
Merge: d15532d91be177e7528310e0110e39f915779a99 facc68516a7ee6d4992dc47b42b47c600b20b21d
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 16:51:32 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:51:32 2020 +0100

    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
    
    virtio: bugfix
    
    A last minute bugfix.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    # gpg: Signature made Tue 04 Aug 2020 16:48:37 BST
    # gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
    # gpg:                issuer "mst@redhat.com"
    # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
    # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
    # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
    #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
    
    * remotes/mst/tags/for_upstream:
      virtio-mem: Correct format specifier mismatch for RISC-V
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:23 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16689.41418 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3L-0006Fc-Rj; Fri, 30 Oct 2020 22:39:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16689.41418; Fri, 30 Oct 2020 22:39:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3L-0006FS-OM; Fri, 30 Oct 2020 22:39:23 +0000
Received: by outflank-mailman (input) for mailman id 16689;
 Fri, 30 Oct 2020 22:39:22 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd3K-0006FJ-E0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:22 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id a354ffab-9921-405e-b3ac-d4abe59c1333;
 Fri, 30 Oct 2020 22:39:21 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3J-0005Wv-I9
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3J-0005V8-HT
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:21 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd3K-0006FJ-E0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:22 +0000
X-Inumbo-ID: a354ffab-9921-405e-b3ac-d4abe59c1333
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id a354ffab-9921-405e-b3ac-d4abe59c1333;
	Fri, 30 Oct 2020 22:39:21 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=St/vP8hHMly8uivBaT89W4KuVs/32bVKM5uJKcuD0EI=; b=4fIuF8NmUXH1F7wM52IKRP5bVZ
	3HWCR3VtwmVUIkP0ZjmsxjAOfLPfi09enq0E+Mk5NKIxg2v/ZPpONDH/GDevgJmbHzFEmQCOzTJcG
	7D0i3CjqMNNqHmlAxYK/cb/oFEE3DkKMAjmOCHwBJvyFN4TYxMHtEdCNEi7qdDgpxqQ8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3J-0005Wv-I9
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3J-0005V8-HT
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:21 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] docs/devel: Document decodetree no-overlap groups
Message-Id: <E1kYd3J-0005V8-HT@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:21 +0000

commit ffdfca6fac7e87faf4d0815e5cbc31c4a53f7a3a
Author:     Richard Henderson <richard.henderson@linaro.org>
AuthorDate: Mon Aug 3 13:57:08 2020 -0700
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:33:47 2020 +0100

    docs/devel: Document decodetree no-overlap groups
    
    When support for this feature went in, the update to the
    documentation was forgotten.
    
    Fixes: 067e8b0f45d6
    Reported-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20200803205708.315829-1-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 docs/devel/decodetree.rst | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/docs/devel/decodetree.rst b/docs/devel/decodetree.rst
index ce7f52308f..74f66bf46e 100644
--- a/docs/devel/decodetree.rst
+++ b/docs/devel/decodetree.rst
@@ -173,18 +173,25 @@ Pattern Groups
 
 Syntax::
 
-  group    := '{' ( pat_def | group )+ '}'
-
-A *group* begins with a lone open-brace, with all subsequent lines
-indented two spaces, and ending with a lone close-brace.  Groups
-may be nested, increasing the required indentation of the lines
-within the nested group to two spaces per nesting level.
-
-Unlike ungrouped patterns, grouped patterns are allowed to overlap.
-Conflicts are resolved by selecting the patterns in order.  If all
-of the fixedbits for a pattern match, its translate function will
-be called.  If the translate function returns false, then subsequent
-patterns within the group will be matched.
+  group            := overlap_group | no_overlap_group
+  overlap_group    := '{' ( pat_def | group )+ '}'
+  no_overlap_group := '[' ( pat_def | group )+ ']'
+
+A *group* begins with a lone open-brace or open-bracket, with all
+subsequent lines indented two spaces, and ending with a lone
+close-brace or close-bracket.  Groups may be nested, increasing the
+required indentation of the lines within the nested group to two
+spaces per nesting level.
+
+Patterns within overlap groups are allowed to overlap.  Conflicts are
+resolved by selecting the patterns in order.  If all of the fixedbits
+for a pattern match, its translate function will be called.  If the
+translate function returns false, then subsequent patterns within the
+group will be matched.
+
+Patterns within no-overlap groups are not allowed to overlap, just
+the same as ungrouped patterns.  Thus no-overlap groups are intended
+to be nested inside overlap groups.
 
 The following example from PA-RISC shows specialization of the *or*
 instruction::
@@ -200,7 +207,7 @@ instruction::
 When the *cf* field is zero, the instruction has no side effects,
 and may be specialized.  When the *rt* field is zero, the output
 is discarded and so the instruction has no effect.  When the *rt2*
-field is zero, the operation is ``reg[rt] | 0`` and so encodes
+field is zero, the operation is ``reg[r1] | 0`` and so encodes
 the canonical register copy operation.
 
 The output from the generator might look like::
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16690.41422 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3W-0006H1-Sv; Fri, 30 Oct 2020 22:39:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16690.41422; Fri, 30 Oct 2020 22:39:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3W-0006Gt-Pw; Fri, 30 Oct 2020 22:39:34 +0000
Received: by outflank-mailman (input) for mailman id 16690;
 Fri, 30 Oct 2020 22:39:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd3V-0006Gg-CO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id de1d7e0e-857c-497f-ae58-04e63d5b994b;
 Fri, 30 Oct 2020 22:39:31 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3T-0005X5-MZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3T-0005WB-LL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:31 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd3V-0006Gg-CO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:33 +0000
X-Inumbo-ID: de1d7e0e-857c-497f-ae58-04e63d5b994b
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id de1d7e0e-857c-497f-ae58-04e63d5b994b;
	Fri, 30 Oct 2020 22:39:31 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3aJCdzIhQDvO/FMFAnRIlyqAMfqceecbWytRjSVbtYU=; b=nWrq1SwV+wgtcdYAKBUfoycEpn
	2G4rxIC8WAEYa88kxORWZfWsqRsDNaeL867EYf4/2qm/izow4BerOprpNhIy+1rrohtqpP4YQJ6+D
	ZZT5btFioGcQuuQJ6E+9/LOx/I0LhAqMQj846f3aBygJuap83N0hRVHMKGtWiKcTS2lU=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3T-0005X5-MZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3T-0005WB-LL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:31 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Fix decode of LDRA[AB] instructions
Message-Id: <E1kYd3T-0005WB-LL@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:31 +0000

commit d250bb19ced3b702c7c37731855f6876d0cc7995
Author:     Peter Collingbourne <pcc@google.com>
AuthorDate: Mon Aug 3 17:28:49 2020 -0700
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 16:40:19 2020 +0100

    target/arm: Fix decode of LDRA[AB] instructions
    
    These instructions use zero as the discriminator, not SP.
    
    Signed-off-by: Peter Collingbourne <pcc@google.com>
    Message-id: 20200804002849.30268-1-pcc@google.com
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/translate-a64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index c98dfb17a8..534c3ff5f3 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3429,9 +3429,11 @@ static void disas_ldst_pac(DisasContext *s, uint32_t insn,
 
     if (s->pauth_active) {
         if (use_key_a) {
-            gen_helper_autda(dirty_addr, cpu_env, dirty_addr, cpu_X[31]);
+            gen_helper_autda(dirty_addr, cpu_env, dirty_addr,
+                             new_tmp_a64_zero(s));
         } else {
-            gen_helper_autdb(dirty_addr, cpu_env, dirty_addr, cpu_X[31]);
+            gen_helper_autdb(dirty_addr, cpu_env, dirty_addr,
+                             new_tmp_a64_zero(s));
         }
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:43 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16691.41427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3f-0006Ie-VT; Fri, 30 Oct 2020 22:39:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16691.41427; Fri, 30 Oct 2020 22:39:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3f-0006IW-RR; Fri, 30 Oct 2020 22:39:43 +0000
Received: by outflank-mailman (input) for mailman id 16691;
 Fri, 30 Oct 2020 22:39:42 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd3e-0006IN-JU
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:42 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 538f8502-6b22-4cd5-b24e-d6911cc64d25;
 Fri, 30 Oct 2020 22:39:42 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3d-0005Xr-QE
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3d-0005Ws-PZ
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:41 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd3e-0006IN-JU
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:42 +0000
X-Inumbo-ID: 538f8502-6b22-4cd5-b24e-d6911cc64d25
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 538f8502-6b22-4cd5-b24e-d6911cc64d25;
	Fri, 30 Oct 2020 22:39:42 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QjKODUNjAVd3oErOWTXi7xhaBm2n8dWYcvpgEv4xpgg=; b=C44NVOPbD4u0q0+L2biLmmn8yv
	7TMwqRMuwMGhxOpz7t4f0XH2E1T5FhtetxRPYfOUp3giZ+JTrEkfFPQ1GezL+ApB5xkDIKIN2L4LN
	SRsp1OhqUrR/EJPj6OPcEzI3D4DtwjAysSiJFD+tACh4+wVFVHjAMwOmgHag/nxzzwPA=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3d-0005Xr-QE
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3d-0005Ws-PZ
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:41 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200804' into staging
Message-Id: <E1kYd3d-0005Ws-PZ@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:41 +0000

commit fd3cd581f9dcd11286daacaa5272e721c65aece8
Merge: 881419b7117d5350c2a0288bfb79f2a83715df32 d250bb19ced3b702c7c37731855f6876d0cc7995
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 18:20:32 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 4 18:20:32 2020 +0100

    Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200804' into staging
    
    target-arm queue:
     * Fix decode of LDRA[AB] instructions
     * docs/devel: Document decodetree no-overlap groups
    
    # gpg: Signature made Tue 04 Aug 2020 17:08:11 BST
    # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
    # gpg:                issuer "peter.maydell@linaro.org"
    # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
    # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
    # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
    
    * remotes/pmaydell/tags/pull-target-arm-20200804:
      target/arm: Fix decode of LDRA[AB] instructions
      docs/devel: Document decodetree no-overlap groups
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 docs/devel/decodetree.rst  | 33 ++++++++++++++++++++-------------
 target/arm/translate-a64.c |  6 ++++--
 2 files changed, 24 insertions(+), 15 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:39:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:39:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16692.41430 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3r-0006KD-1V; Fri, 30 Oct 2020 22:39:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16692.41430; Fri, 30 Oct 2020 22:39:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd3q-0006K5-Ul; Fri, 30 Oct 2020 22:39:54 +0000
Received: by outflank-mailman (input) for mailman id 16692;
 Fri, 30 Oct 2020 22:39:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd3p-0006Jr-Ba
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:53 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id d23fcc9b-ae3f-4a17-a678-9263258bb6b5;
 Fri, 30 Oct 2020 22:39:52 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3o-0005Xz-6x
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3o-0005YR-6A
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd3p-0006Jr-Ba
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:53 +0000
X-Inumbo-ID: d23fcc9b-ae3f-4a17-a678-9263258bb6b5
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id d23fcc9b-ae3f-4a17-a678-9263258bb6b5;
	Fri, 30 Oct 2020 22:39:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fbgi5JkEIvmDeVpkfN04bl6WnoX9Zb5xI6GYXttlYmY=; b=Bi+jjl0TmnSwWCzqTZdEJpYEDZ
	JYmdvwhVXVyutf+c+/j3/MOVyo2n7ScWPAxvbBPRGI2EtyUj+bHsw37sb5Zkj0kHxgFLqkT1SYD+h
	u3vZqxfmMwlCfQyEpg4qttsL06O0CCnlTZw4Tyw3WjRkWW4Th3dPsQIMiiQvH6AX4X90=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3o-0005Xz-6x
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3o-0005YR-6A
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:39:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/docker: Add python3-venv and netcat to the debian-amd64 container
Message-Id: <E1kYd3o-0005YR-6A@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:39:52 +0000

commit 1caac1c0e4d5bdcf18c88ee184453b8ccfdaaee3
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Wed Jul 15 06:35:01 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:37:42 2020 +0200

    tests/docker: Add python3-venv and netcat to the debian-amd64 container
    
    Without python3-venv, I get the following message when trying to
    run the acceptance tests within the debian container:
    
     The virtual environment was not created successfully because ensurepip is not
     available.  On Debian/Ubuntu systems, you need to install the python3-venv
     package using the following command.
        apt-get install python3-venv
     You may need to use sudo with that command.  After installing the python3-venv
     package, recreate your virtual environment.
    
    Let's do it as the message suggests.
    
    And while we're at it, also add netcat here since it is required for
    some of the acceptance tests.
    
    Message-Id: <20200730141326.8260-2-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/docker/dockerfiles/debian-amd64.docker | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/docker/dockerfiles/debian-amd64.docker b/tests/docker/dockerfiles/debian-amd64.docker
index 8fdfd6a6b0..d2500dcff1 100644
--- a/tests/docker/dockerfiles/debian-amd64.docker
+++ b/tests/docker/dockerfiles/debian-amd64.docker
@@ -20,7 +20,9 @@ RUN apt update && \
         librdmacm-dev \
         libsasl2-dev \
         libsnappy-dev \
-        libvte-dev
+        libvte-dev \
+        netcat-openbsd \
+        python3-venv
 
 # virgl
 RUN apt update && \
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:05 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16693.41434 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd41-0006iJ-38; Fri, 30 Oct 2020 22:40:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16693.41434; Fri, 30 Oct 2020 22:40:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd41-0006hv-02; Fri, 30 Oct 2020 22:40:05 +0000
Received: by outflank-mailman (input) for mailman id 16693;
 Fri, 30 Oct 2020 22:40:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd3z-0006Wn-AP
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id b0e97c47-e116-4a4b-b68d-a08487d0ed91;
 Fri, 30 Oct 2020 22:40:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3y-0005YK-AY
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd3y-0005ZJ-9m
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd3z-0006Wn-AP
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:03 +0000
X-Inumbo-ID: b0e97c47-e116-4a4b-b68d-a08487d0ed91
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id b0e97c47-e116-4a4b-b68d-a08487d0ed91;
	Fri, 30 Oct 2020 22:40:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ULlJApNx7BSeGYIGhEVMgg6zfS71dg8AlfdQsVYiGaI=; b=dFgwBzwfgWaEUQ0x6vrVbpaZ39
	UcQ27KgH2kOdTzIKwJecIalfmbic4pUX2kzSfEfGgxTawWsY1sxsDMgGgB7/ovCDYUL7SWJ0kFLga
	VBpa2btDLXHbzBS77Sgz5UAyVXX9q9FiaeY2iSmOWgpMD1oOwy5dmfRcEa0pOScVOk68=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3y-0005YK-AY
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd3y-0005ZJ-9m
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
Message-Id: <E1kYd3y-0005ZJ-9m@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:02 +0000

commit 4d6862ffc74622c34324537549b8ea19e7854ed5
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 23 08:36:04 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:38:27 2020 +0200

    tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
    
    These tests always time out on Gitlab, not sure what's happening here.
    Let's disable them until somebody has enough spare time to debug the
    issues.
    
    Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
    Reviewed-by: Cleber Rosa <crosa@redhat.com>
    Message-Id: <20200730141326.8260-3-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/acceptance/machine_rx_gdbsim.py | 4 ++++
 tests/acceptance/replay_kernel.py     | 1 +
 2 files changed, 5 insertions(+)

diff --git a/tests/acceptance/machine_rx_gdbsim.py b/tests/acceptance/machine_rx_gdbsim.py
index bff63e421d..0c72506028 100644
--- a/tests/acceptance/machine_rx_gdbsim.py
+++ b/tests/acceptance/machine_rx_gdbsim.py
@@ -8,6 +8,9 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
+import os
+
+from avocado import skipIf
 from avocado_qemu import Test
 from avocado_qemu import exec_command_and_wait_for_pattern
 from avocado_qemu import wait_for_console_pattern
@@ -42,6 +45,7 @@ class RxGdbSimMachine(Test):
         # FIXME limit baudrate on chardev, else we type too fast
         #exec_command_and_wait_for_pattern(self, 'version', gcc_version)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_linux_sash(self):
         """
         Boots a Linux kernel and checks that the console is operational.
diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py
index 62d2db8c64..b79fc8daf8 100644
--- a/tests/acceptance/replay_kernel.py
+++ b/tests/acceptance/replay_kernel.py
@@ -126,6 +126,7 @@ class ReplayKernel(LinuxKernelTest):
 
         self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
 
+    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
     def test_arm_cubieboard_initrd(self):
         """
         :avocado: tags=arch:arm
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16694.41440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4B-00072k-5H; Fri, 30 Oct 2020 22:40:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16694.41440; Fri, 30 Oct 2020 22:40:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4B-00072b-1X; Fri, 30 Oct 2020 22:40:15 +0000
Received: by outflank-mailman (input) for mailman id 16694;
 Fri, 30 Oct 2020 22:40:13 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd49-00072K-JV
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:13 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id de2386c6-9f4b-449a-b06e-c1f5fd0804eb;
 Fri, 30 Oct 2020 22:40:12 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd48-0005YS-Ee
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd48-0005af-DM
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:12 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd49-00072K-JV
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:13 +0000
X-Inumbo-ID: de2386c6-9f4b-449a-b06e-c1f5fd0804eb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id de2386c6-9f4b-449a-b06e-c1f5fd0804eb;
	Fri, 30 Oct 2020 22:40:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pcrUTCfaWmTQfA1NjdrLjazt8m/ZVDSM+FVU89P1+ug=; b=FekgKMUA/U5so33s6OqszdeEQl
	FFH22m0kb3DMbCzdFuPKjfmD3NG+ak4EuEWnJfoneib4MIkGfKDkWZE8pm+mm6kEmQSRfFxXZZJ1H
	3nUNbgeMF/AqwaZB4JxdBwhkdD7x0Dg7ImNUrrtA/Mckd2/BNfxBKiOh30SL3ngG8NrY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd48-0005YS-Ee
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd48-0005af-DM
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:12 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
Message-Id: <E1kYd48-0005af-DM@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:12 +0000

commit 699616db6465b01580d5ddea18887a562206d928
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Tue Jul 14 17:35:45 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:39:21 2020 +0200

    gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
    
    We were missing the two new targets avr-softmmu and rx-softmmu in the
    gitlab-CI so far, and did not add some of the "other endianess" targets
    like sh4eb-softmmu yet.
    Since the current build-system-* jobs run already for a very long time,
    let's do not add these missing targets there, but introduce two new
    additional build jobs, one running with Debian and one running with
    CentOS, and add the new targets there. Also move some targets from
    the old build-system-* jobs to these new targets, to distribute the
    load and reduce the runtime of the CI.
    
    Message-Id: <20200730141326.8260-4-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 88 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 73 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 362e5ee755..e96bcd50f8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -53,68 +53,126 @@ include:
     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
     - du -chs $HOME/avocado/data/cache
 
-build-system-ubuntu-main:
+build-system-ubuntu:
   <<: *native_build_job_definition
   variables:
     IMAGE: ubuntu2004
-    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu
-      moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu
-      riscv64-softmmu sparc-softmmu
+    TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
+      moxie-softmmu microblazeel-softmmu mips64el-softmmu
     MAKE_CHECK_ARGS: check-build
   artifacts:
     paths:
       - build
 
-check-system-ubuntu-main:
+check-system-ubuntu:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-ubuntu-main
+    - job: build-system-ubuntu
       artifacts: true
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check
 
-acceptance-system-ubuntu-main:
+acceptance-system-ubuntu:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-ubuntu-main
+    - job: build-system-ubuntu
       artifacts: true
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check-acceptance
   <<: *post_acceptance
 
-build-system-fedora-alt:
+build-system-debian:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: debian-amd64
+    TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
+      riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-debian:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-debian
+      artifacts: true
+  variables:
+    IMAGE: debian-amd64
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-debian:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-debian
+      artifacts: true
+  variables:
+    IMAGE: debian-amd64
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
+build-system-fedora:
   <<: *native_build_job_definition
   variables:
     IMAGE: fedora
     TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
-      riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu
-      xtensa-softmmu nios2-softmmu or1k-softmmu
+      xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
     MAKE_CHECK_ARGS: check-build
   artifacts:
     paths:
       - build
 
-check-system-fedora-alt:
+check-system-fedora:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-fedora-alt
+    - job: build-system-fedora
       artifacts: true
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check
 
-acceptance-system-fedora-alt:
+acceptance-system-fedora:
   <<: *native_test_job_definition
   needs:
-    - job: build-system-fedora-alt
+    - job: build-system-fedora
       artifacts: true
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check-acceptance
   <<: *post_acceptance
 
+build-system-centos:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos8
+    TARGETS: ppc64-softmmu lm32-softmmu or1k-softmmu s390x-softmmu
+      x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-system-centos:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-centos
+      artifacts: true
+  variables:
+    IMAGE: centos8
+    MAKE_CHECK_ARGS: check
+
+acceptance-system-centos:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-system-centos
+      artifacts: true
+  variables:
+    IMAGE: centos8
+    MAKE_CHECK_ARGS: check-acceptance
+  <<: *post_acceptance
+
 build-disabled:
   <<: *native_build_job_definition
   variables:
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:25 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16695.41442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4L-00073y-5v; Fri, 30 Oct 2020 22:40:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16695.41442; Fri, 30 Oct 2020 22:40:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4L-00073q-32; Fri, 30 Oct 2020 22:40:25 +0000
Received: by outflank-mailman (input) for mailman id 16695;
 Fri, 30 Oct 2020 22:40:23 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd4J-00073e-Er
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:23 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 1a6e5bad-fb5a-4dbe-903d-af1d00e821f3;
 Fri, 30 Oct 2020 22:40:22 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4I-0005Yg-IG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4I-0005bD-HR
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:22 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd4J-00073e-Er
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:23 +0000
X-Inumbo-ID: 1a6e5bad-fb5a-4dbe-903d-af1d00e821f3
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 1a6e5bad-fb5a-4dbe-903d-af1d00e821f3;
	Fri, 30 Oct 2020 22:40:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=wUnZtpEM07AvsothOcLUwDVFgrKzXJdKBsLjjhpqRFg=; b=NxOeSarWh1uIcfldEG7JxHgqF3
	vi3S3nnTNO5bZyYEWQ0QsucWA1yLGIb2joMdeDFUUNnWQbQJHnJMLuVHkW2fEw8bnIsd9fSODWPOy
	1+XBsA0xZ84RhkNxRLzycHZYTKhWSd8aYhydtlRVXACKSwqWc/F3xlfqqYvpQWtgWxt8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4I-0005Yg-IG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4I-0005bD-HR
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:22 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] gitlab-ci: Fix Avocado cache usage
Message-Id: <E1kYd4I-0005bD-HR@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:22 +0000

commit 5896c5395476ca30caad6ddd48d4b9dca2c63c00
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Thu Jul 30 10:35:48 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:39:55 2020 +0200

    gitlab-ci: Fix Avocado cache usage
    
    In commit 6957fd98dc ("gitlab: add avocado asset caching") we
    tried to save the Avocado cache (as in commit c1073e44b4 with
    Travis-CI) however it doesn't work as expected. For some reason
    Avocado uses /root/avocado_cache/ which we can not select later.
    
    Manually generate a Avocado config to force the use of the
    current job's directory.
    
    This patch is based on an earlier version from Philippe Mathieu-Daudé.
    
    Message-Id: <20200730141326.8260-5-thuth@redhat.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e96bcd50f8..9820066379 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,11 +47,24 @@ include:
     - find . -type f -exec touch {} +
     - make $MAKE_CHECK_ARGS
 
-.post_acceptance_template: &post_acceptance
+.acceptance_template: &acceptance_definition
+  cache:
+    key: "${CI_JOB_NAME}-cache"
+    paths:
+      - ${CI_PROJECT_DIR}/avocado-cache
+    policy: pull-push
+  before_script:
+    - mkdir -p ~/.config/avocado
+    - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
+    - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
+           >> ~/.config/avocado/avocado.conf
+    - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
+        du -chs ${CI_PROJECT_DIR}/avocado-cache ;
+      fi
   after_script:
     - cd build
     - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
-    - du -chs $HOME/avocado/data/cache
+    - du -chs ${CI_PROJECT_DIR}/avocado-cache
 
 build-system-ubuntu:
   <<: *native_build_job_definition
@@ -81,7 +94,7 @@ acceptance-system-ubuntu:
   variables:
     IMAGE: ubuntu2004
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-debian:
   <<: *native_build_job_definition
@@ -111,7 +124,7 @@ acceptance-system-debian:
   variables:
     IMAGE: debian-amd64
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-fedora:
   <<: *native_build_job_definition
@@ -141,7 +154,7 @@ acceptance-system-fedora:
   variables:
     IMAGE: fedora
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-system-centos:
   <<: *native_build_job_definition
@@ -171,7 +184,7 @@ acceptance-system-centos:
   variables:
     IMAGE: centos8
     MAKE_CHECK_ARGS: check-acceptance
-  <<: *post_acceptance
+  <<: *acceptance_definition
 
 build-disabled:
   <<: *native_build_job_definition
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:35 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16696.41446 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4V-00075B-7p; Fri, 30 Oct 2020 22:40:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16696.41446; Fri, 30 Oct 2020 22:40:35 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4V-000753-4X; Fri, 30 Oct 2020 22:40:35 +0000
Received: by outflank-mailman (input) for mailman id 16696;
 Fri, 30 Oct 2020 22:40:33 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd4T-00074t-O6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:33 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 251b7aff-734a-4a5c-9053-82984c4aad92;
 Fri, 30 Oct 2020 22:40:32 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4S-0005Yr-MH
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4S-0005br-L0
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:32 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd4T-00074t-O6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:33 +0000
X-Inumbo-ID: 251b7aff-734a-4a5c-9053-82984c4aad92
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 251b7aff-734a-4a5c-9053-82984c4aad92;
	Fri, 30 Oct 2020 22:40:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LSaLPk+XriMJv+0fLYRDDOgXvGcJfuHM3xt1n1Pc8Uo=; b=z2RdDck8EJaK9d1tQD6bYmQOdv
	h37p+jbhblodAWLVfLB0GlYeSVQXzF+eE5ecrLJLrCk3cMWpa05oiDLLu7AS5+7MgNMRvYapXB4N/
	D/dIdhu0Jqx/v/X7251pptlmA2FZYLk/A9H8J/pcyM4NjgZ3haFxqf2HM3vjmplbg47Y=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4S-0005Yr-MH
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4S-0005br-L0
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:32 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/riscv/vector_helper: Fix build on 32-bit big endian hosts
Message-Id: <E1kYd4S-0005br-L0@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:32 +0000

commit 35c7f5254b608c0694b11fc9f0d2c1a4ffb216b4
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Aug 3 19:54:36 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 10:43:45 2020 +0200

    target/riscv/vector_helper: Fix build on 32-bit big endian hosts
    
    The code currently fails to compile on 32-bit big endian hosts:
    
     target/riscv/vector_helper.c: In function 'vext_clear':
     target/riscv/vector_helper.c:154:16: error: cast to pointer from integer
     of different size [-Werror=int-to-pointer-cast]
             memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
                    ^
     target/riscv/vector_helper.c:155:16: error: cast to pointer from integer
     of different size [-Werror=int-to-pointer-cast]
             memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
                    ^
     cc1: all warnings being treated as errors
    
    We should not use "long long" (i.e. 64-bit) values here to avoid the
    problem. Switch to our QEMU_ALIGN_PTR_DOWN/UP macros instead.
    
    Fixes: 751538d5da ("add vector stride load and store instructions")
    Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200804170055.2851-3-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/riscv/vector_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index 39f44d1029..793af99067 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -151,8 +151,8 @@ static void vext_clear(void *tail, uint32_t cnt, uint32_t tot)
     if (cnt % 8) {
         part1 = 8 - (cnt % 8);
         part2 = tot - cnt - part1;
-        memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
-        memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
+        memset(QEMU_ALIGN_PTR_DOWN(tail, 8), 0, part1);
+        memset(QEMU_ALIGN_PTR_UP(tail, 8), 0, part2);
     } else {
         memset(tail, 0, part2);
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:46 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16697.41451 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4g-00077D-AF; Fri, 30 Oct 2020 22:40:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16697.41451; Fri, 30 Oct 2020 22:40:46 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4g-000775-64; Fri, 30 Oct 2020 22:40:46 +0000
Received: by outflank-mailman (input) for mailman id 16697;
 Fri, 30 Oct 2020 22:40:44 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd4e-00076s-1X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 43927b2c-1c27-4940-bcc7-d36e321f2f81;
 Fri, 30 Oct 2020 22:40:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4c-0005ZS-Qd
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4c-0005cR-PG
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:42 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd4e-00076s-1X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:44 +0000
X-Inumbo-ID: 43927b2c-1c27-4940-bcc7-d36e321f2f81
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 43927b2c-1c27-4940-bcc7-d36e321f2f81;
	Fri, 30 Oct 2020 22:40:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LzzUeJDx/QqUjIO3qB5BOXz6DjNTjKKIHl3UcA0rxb4=; b=LNdx/ccvzVW+eVZi7YDxRel9Eo
	C2vhyVBsNu9WQyCBaIoD3jUgHQ8uaBZuX+H/tB8rKb6yhPGKnjvxkphGmrzJCFQK1hYXaAXgUanPp
	UOsW4PA+GgkKkZfJTvdyfmJ/0ymki24b2mwNwqWRxd2pV2ByjyUz+h+UhsANvgidpAI0=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4c-0005ZS-Qd
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4c-0005cR-PG
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:42 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Get rid of the libqemustub.a remainders
Message-Id: <E1kYd4c-0005cR-PG@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:42 +0000

commit d2a71d7474d4649eabe554994a3fcba75244cce3
Author:     Thomas Huth <thuth@redhat.com>
AuthorDate: Mon Aug 3 21:14:57 2020 +0200
Commit:     Thomas Huth <thuth@redhat.com>
CommitDate: Wed Aug 5 11:45:43 2020 +0200

    Get rid of the libqemustub.a remainders
    
    libqemustub.a has been removed in commit ebedb37c8d ("Makefile: Remove
    libqemustub.a"). Some remainders have been missed. Remove them now.
    
    Message-Id: <20200804170055.2851-8-thuth@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Makefile                                | 2 +-
 scripts/coverity-scan/run-coverity-scan | 3 ---
 tests/test-util-sockets.c               | 3 ++-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index c2120d8d48..13dd708c4a 100644
--- a/Makefile
+++ b/Makefile
@@ -726,7 +726,7 @@ virtiofsd$(EXESUF): $(virtiofsd-obj-y) libvhost-user.a $(COMMON_LDADDS)
 	$(call LINK, $^)
 endif
 
-vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a
+vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a
 	$(call LINK, $^)
 
 ifdef CONFIG_VHOST_USER_INPUT
diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan
index 03a791dec9..6eefb4b558 100755
--- a/scripts/coverity-scan/run-coverity-scan
+++ b/scripts/coverity-scan/run-coverity-scan
@@ -403,9 +403,6 @@ echo "Configuring..."
     --enable-mpath --enable-libxml2 --enable-glusterfs \
     --enable-virtfs --enable-zstd
 
-echo "Making libqemustub.a..."
-make libqemustub.a
-
 echo "Running cov-build..."
 rm -rf cov-int
 mkdir cov-int
diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index 2ca1e99f17..261dc48c03 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -64,7 +64,8 @@ int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp)
     return dup(mon_fd);
 }
 
-/* Syms in libqemustub.a are discarded at .o file granularity.
+/*
+ * Syms of stubs in libqemuutil.a are discarded at .o file granularity.
  * To replace monitor_get_fd() we must ensure everything in
  * stubs/monitor.c is defined, to make sure monitor.o is discarded
  * otherwise we get duplicate syms at link time.
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:40:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:40:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16698.41454 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4p-00078Y-Cg; Fri, 30 Oct 2020 22:40:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16698.41454; Fri, 30 Oct 2020 22:40:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd4p-00078Q-9a; Fri, 30 Oct 2020 22:40:55 +0000
Received: by outflank-mailman (input) for mailman id 16698;
 Fri, 30 Oct 2020 22:40:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd4o-00078G-3n
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id c2225576-d506-449c-a6e0-3a4cca070acb;
 Fri, 30 Oct 2020 22:40:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4m-0005ZY-UL
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4m-0005d5-TX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:52 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd4o-00078G-3n
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:54 +0000
X-Inumbo-ID: c2225576-d506-449c-a6e0-3a4cca070acb
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id c2225576-d506-449c-a6e0-3a4cca070acb;
	Fri, 30 Oct 2020 22:40:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=n1O/2CPeO16O6dnk8p4CBey2nI+ByjgmzFBdKW+raB4=; b=Lo44l46TshGipOU/VLFY4Q+qZ0
	L4SD8cBgtIBOvCtLdh3Xo+bfaj5xFk2YSYS96WMjc10CDP5Eq1B1ppV68cNwofhs8pW5FDGAJzvlj
	NJzsrEhzggwxorRSWynwswIJMaAHZSoZKf9rhEBWK4W1iSFuYFkyB5Vv063bQS814i98=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4m-0005ZY-UL
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4m-0005d5-TX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:40:52 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-08-05' into staging
Message-Id: <E1kYd4m-0005d5-TX@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:40:52 +0000

commit 616dab9afc904923554c151011c817ff3191ecde
Merge: fd3cd581f9dcd11286daacaa5272e721c65aece8 d2a71d7474d4649eabe554994a3fcba75244cce3
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Aug 5 11:02:46 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 11:02:46 2020 +0100

    Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-08-05' into staging
    
    * Test rx-softmmu, avr-softmmu, Centos7 and Debian on gitlab-CI
    * Fix compiler warning on 32-bit big endian systems
    * Remove remainders of libqemustub.a
    
    # gpg: Signature made Wed 05 Aug 2020 10:51:32 BST
    # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
    # gpg:                issuer "thuth@redhat.com"
    # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
    # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
    # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
    # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
    # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
    
    * remotes/huth-gitlab/tags/pull-request-2020-08-05:
      Get rid of the libqemustub.a remainders
      target/riscv/vector_helper: Fix build on 32-bit big endian hosts
      gitlab-ci: Fix Avocado cache usage
      gitlab-ci.yml: Add build-system-debian and build-system-centos jobs
      tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab
      tests/docker: Add python3-venv and netcat to the debian-amd64 container
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

 .gitlab-ci.yml                               | 109 ++++++++++++++++++++++-----
 Makefile                                     |   2 +-
 scripts/coverity-scan/run-coverity-scan      |   3 -
 target/riscv/vector_helper.c                 |   4 +-
 tests/acceptance/machine_rx_gdbsim.py        |   4 +
 tests/acceptance/replay_kernel.py            |   1 +
 tests/docker/dockerfiles/debian-amd64.docker |   4 +-
 tests/test-util-sockets.c                    |   3 +-
 8 files changed, 103 insertions(+), 27 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:06 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16699.41458 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd50-00079q-EQ; Fri, 30 Oct 2020 22:41:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16699.41458; Fri, 30 Oct 2020 22:41:06 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd50-00079i-BE; Fri, 30 Oct 2020 22:41:06 +0000
Received: by outflank-mailman (input) for mailman id 16699;
 Fri, 30 Oct 2020 22:41:05 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd4z-00079c-3X
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:05 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id e2f9df67-c6ee-4e9b-a089-38cea562e5f4;
 Fri, 30 Oct 2020 22:41:03 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4x-0005Zv-1i
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd4x-0005dw-0v
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:03 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd4z-00079c-3X
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:05 +0000
X-Inumbo-ID: e2f9df67-c6ee-4e9b-a089-38cea562e5f4
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id e2f9df67-c6ee-4e9b-a089-38cea562e5f4;
	Fri, 30 Oct 2020 22:41:03 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BYlazWKSeZoj0cZcNvkHoDozNuzPI6TEUYJXXDmgzwo=; b=yEP3AV9Hzx5W3gY8U0pFO+6T5f
	HURX9blgfPB7+pV8viPHPleTubB1xcJjpTZru3YecNW9BgaZbgDCCkFjQZhAskajN0bMckMeEVGyY
	56uv76Jc83C9AlwNcJbNV0A6Xfq/31nQHbkN3J8Gnv15Wna+d8R7GnFkk0zD0G6nTx8k=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4x-0005Zv-1i
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd4x-0005dw-0v
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:03 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
Message-Id: <E1kYd4x-0005dw-0v@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:03 +0000

commit 348fcc4f7ace1718006e646078d88c8cd8c1d97e
Author:     Tuguoyi <tu.guoyi@h3c.com>
AuthorDate: Wed Aug 5 09:22:58 2020 +0000
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 14:56:11 2020 +0100

    qcow2-cluster: Fix integer left shift error in qcow2_alloc_cluster_link_l2()
    
    When calculating the offset, the result of left shift operation will be promoted
    to type int64 automatically because the left operand of + operator is uint64_t.
    but the result after integer promotion may be produce an error value for us and
    trigger the following asserting error.
    
    For example, consider i=0x2000, cluster_bits=18, the result of left shift
    operation will be 0x80000000. Cause argument i is of signed integer type,
    the result is automatically promoted to 0xffffffff80000000 which is not
    we expected
    
    The way to trigger the assertion error:
      qemu-img create -f qcow2 -o preallocation=full,cluster_size=256k tmpdisk 10G
    
    This patch fix it by casting @i to uint64_t before doing left shift operation
    
    Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
    Reviewed-by: Alberto Garcia <berto@igalia.com>
    Message-id: 81ba90fe0c014f269621c283269b42ad@h3c.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 block/qcow2-cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index a677ba9f5c..550850b264 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -980,7 +980,7 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m)
 
     assert(l2_index + m->nb_clusters <= s->l2_slice_size);
     for (i = 0; i < m->nb_clusters; i++) {
-        uint64_t offset = cluster_offset + (i << s->cluster_bits);
+        uint64_t offset = cluster_offset + ((uint64_t)i << s->cluster_bits);
         /* if two concurrent writes happen to the same unallocated cluster
          * each write allocates separate cluster and writes data concurrently.
          * The first one to complete updates l2 table with pointer to its
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:15 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16700.41462 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd59-0007B2-G4; Fri, 30 Oct 2020 22:41:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16700.41462; Fri, 30 Oct 2020 22:41:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd59-0007Au-Cw; Fri, 30 Oct 2020 22:41:15 +0000
Received: by outflank-mailman (input) for mailman id 16700;
 Fri, 30 Oct 2020 22:41:14 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd58-0007Ak-7Y
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:14 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 306ab950-d112-4a2a-b39c-839a8220b344;
 Fri, 30 Oct 2020 22:41:13 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd57-0005a3-5p
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd57-0005ek-50
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:13 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd58-0007Ak-7Y
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:14 +0000
X-Inumbo-ID: 306ab950-d112-4a2a-b39c-839a8220b344
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 306ab950-d112-4a2a-b39c-839a8220b344;
	Fri, 30 Oct 2020 22:41:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ypo+rYcIQ4InA53U4NO30eNVJDEQo6b4IhNs52CSKxo=; b=hWDuyPl+ocD4W09G6lWd5dTtYs
	kxNlq6CrM9izdtd3iS/LngpCTaV4czyStdfNiprGQDMk9oA0hTdaj+EXb00ZB1xgkc3ywBgVY3vXo
	F/DCxSQyJxoVnkr+EGaqfDl+/tgZeg95V5H1H6Nv4ySG9y/QYOY8dNcwBHWUCYq2VCcs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd57-0005a3-5p
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd57-0005ek-50
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:13 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] target/arm: Fix Rt/Rt2 in ESR_ELx for copro traps from AArch32 to 64
Message-Id: <E1kYd57-0005ek-50@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:13 +0000

commit a65dabf71a9f9b949d556b1b57fd72595df92398
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 4 20:39:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 17:31:51 2020 +0100

    target/arm: Fix Rt/Rt2 in ESR_ELx for copro traps from AArch32 to 64
    
    When a coprocessor instruction in an  AArch32 guest traps to AArch32
    Hyp mode, the syndrome register (HSR) includes Rt and Rt2 fields
    which are simply copies of the Rt and Rt2 fields from the trapped
    instruction.  However, if the instruction is trapped from AArch32 to
    an AArch64 higher exception level, the Rt and Rt2 fields in the
    syndrome register (ESR_ELx) must be the AArch64 view of the register.
    This makes a difference if the AArch32 guest was in a mode other than
    User or System and it was using r13 or r14, or if it was in FIQ mode
    and using r8-r14.
    
    We don't know at translate time which AArch32 CPU mode we are in, so
    we leave the values we generate in our prototype syndrome register
    value at translate time as the raw Rt/Rt2 from the instruction, and
    instead correct them to the AArch64 view when we find we need to take
    an exception from AArch32 to AArch64 with one of these syndrome
    values.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1879587
    Reported-by: Julien Freche <julien@bedrocksystems.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Message-id: 20200804193903.31240-1-peter.maydell@linaro.org
---
 target/arm/helper.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 8ef0fb478f..455c92b891 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -9581,6 +9581,66 @@ static void arm_cpu_do_interrupt_aarch32(CPUState *cs)
     take_aarch32_exception(env, new_mode, mask, offset, addr);
 }
 
+static int aarch64_regnum(CPUARMState *env, int aarch32_reg)
+{
+    /*
+     * Return the register number of the AArch64 view of the AArch32
+     * register @aarch32_reg. The CPUARMState CPSR is assumed to still
+     * be that of the AArch32 mode the exception came from.
+     */
+    int mode = env->uncached_cpsr & CPSR_M;
+
+    switch (aarch32_reg) {
+    case 0 ... 7:
+        return aarch32_reg;
+    case 8 ... 12:
+        return mode == ARM_CPU_MODE_FIQ ? aarch32_reg + 16 : aarch32_reg;
+    case 13:
+        switch (mode) {
+        case ARM_CPU_MODE_USR:
+        case ARM_CPU_MODE_SYS:
+            return 13;
+        case ARM_CPU_MODE_HYP:
+            return 15;
+        case ARM_CPU_MODE_IRQ:
+            return 17;
+        case ARM_CPU_MODE_SVC:
+            return 19;
+        case ARM_CPU_MODE_ABT:
+            return 21;
+        case ARM_CPU_MODE_UND:
+            return 23;
+        case ARM_CPU_MODE_FIQ:
+            return 29;
+        default:
+            g_assert_not_reached();
+        }
+    case 14:
+        switch (mode) {
+        case ARM_CPU_MODE_USR:
+        case ARM_CPU_MODE_SYS:
+        case ARM_CPU_MODE_HYP:
+            return 14;
+        case ARM_CPU_MODE_IRQ:
+            return 16;
+        case ARM_CPU_MODE_SVC:
+            return 18;
+        case ARM_CPU_MODE_ABT:
+            return 20;
+        case ARM_CPU_MODE_UND:
+            return 22;
+        case ARM_CPU_MODE_FIQ:
+            return 30;
+        default:
+            g_assert_not_reached();
+        }
+    case 15:
+        return 31;
+    default:
+        g_assert_not_reached();
+    }
+}
+
 /* Handle exception entry to a target EL which is using AArch64 */
 static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
 {
@@ -9591,6 +9651,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
     unsigned int new_mode = aarch64_pstate_mode(new_el, true);
     unsigned int old_mode;
     unsigned int cur_el = arm_current_el(env);
+    int rt;
 
     /*
      * Note that new_el can never be 0.  If cur_el is 0, then
@@ -9645,7 +9706,8 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
     case EXCP_HVC:
     case EXCP_HYP_TRAP:
     case EXCP_SMC:
-        if (syn_get_ec(env->exception.syndrome) == EC_ADVSIMDFPACCESSTRAP) {
+        switch (syn_get_ec(env->exception.syndrome)) {
+        case EC_ADVSIMDFPACCESSTRAP:
             /*
              * QEMU internal FP/SIMD syndromes from AArch32 include the
              * TA and coproc fields which are only exposed if the exception
@@ -9653,6 +9715,34 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
              * AArch64 format syndrome.
              */
             env->exception.syndrome &= ~MAKE_64BIT_MASK(0, 20);
+            break;
+        case EC_CP14RTTRAP:
+        case EC_CP15RTTRAP:
+        case EC_CP14DTTRAP:
+            /*
+             * For a trap on AArch32 MRC/MCR/LDC/STC the Rt field is currently
+             * the raw register field from the insn; when taking this to
+             * AArch64 we must convert it to the AArch64 view of the register
+             * number. Notice that we read a 4-bit AArch32 register number and
+             * write back a 5-bit AArch64 one.
+             */
+            rt = extract32(env->exception.syndrome, 5, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                5, 5, rt);
+            break;
+        case EC_CP15RRTTRAP:
+        case EC_CP14RRTTRAP:
+            /* Similarly for MRRC/MCRR traps for Rt and Rt2 fields */
+            rt = extract32(env->exception.syndrome, 5, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                5, 5, rt);
+            rt = extract32(env->exception.syndrome, 10, 4);
+            rt = aarch64_regnum(env, rt);
+            env->exception.syndrome = deposit32(env->exception.syndrome,
+                                                10, 5, rt);
+            break;
         }
         env->cp15.esr_el[new_el] = env->exception.syndrome;
         break;
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:24 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16701.41465 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5I-0007CG-Hg; Fri, 30 Oct 2020 22:41:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16701.41465; Fri, 30 Oct 2020 22:41:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5I-0007CA-Ed; Fri, 30 Oct 2020 22:41:24 +0000
Received: by outflank-mailman (input) for mailman id 16701;
 Fri, 30 Oct 2020 22:41:24 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd5H-0007C4-Vk
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:24 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 32555a98-3190-4391-a96c-b5d469346768;
 Fri, 30 Oct 2020 22:41:23 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5H-0005aG-9M
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5H-0005fU-8V
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:23 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd5H-0007C4-Vk
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:24 +0000
X-Inumbo-ID: 32555a98-3190-4391-a96c-b5d469346768
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 32555a98-3190-4391-a96c-b5d469346768;
	Fri, 30 Oct 2020 22:41:23 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v3Q46/Qk2Yg8lsW6lzGHSiD8jtY5g+xJdDLCJb1fejk=; b=Q3/1kQISgyW2m9uQw935a8PMZA
	u0XQEzGEfbAnRFA6/QcsDIdSbQ9up8kJ9+/qHeEL9oRbC9zrXw6Na2dWfy0I46xKoRjbzVjwlHVBH
	fyeCSdOAUhjjN+gv3HG3ZaKAwbEX/PpSe+ghaROPN2J3pvPrMbK5bDikOwPKVzI2kqwQ=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5H-0005aG-9M
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5H-0005fU-8V
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:23 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update version for v5.1.0-rc3 release
Message-Id: <E1kYd5H-0005fU-8V@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:23 +0000

commit e1d322c40524d2c544d1fcd37b267d106d16d328
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Wed Aug 5 17:37:17 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Wed Aug 5 17:37:17 2020 +0100

    Update version for v5.1.0-rc3 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index 388c02aef2..c4550df997 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.92
+5.0.93
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:34 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16702.41471 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5S-0007Df-Jp; Fri, 30 Oct 2020 22:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16702.41471; Fri, 30 Oct 2020 22:41:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5S-0007DX-GI; Fri, 30 Oct 2020 22:41:34 +0000
Received: by outflank-mailman (input) for mailman id 16702;
 Fri, 30 Oct 2020 22:41:34 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd5S-0007DP-3h
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:34 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 95c9a956-7115-4596-bc1b-33c2e845f0e7;
 Fri, 30 Oct 2020 22:41:33 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5R-0005aN-D2
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5R-0005g5-C6
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:33 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd5S-0007DP-3h
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:34 +0000
X-Inumbo-ID: 95c9a956-7115-4596-bc1b-33c2e845f0e7
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 95c9a956-7115-4596-bc1b-33c2e845f0e7;
	Fri, 30 Oct 2020 22:41:33 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1NK4/WgGOiTjN4HC+EyPsWyiJ1J/ToC+7NqWBDt8UzA=; b=Px1d5/cVgF54EjBXgjbKOWR5m3
	CW38nFhDs0o+x549PDsVYvE+1m/sNOMalV9JN7EKEf0Sb/cV1RuMrn1DTwFIBX1Dt3Hhs3v+oaVt8
	tLXoTwTnuMj4VYoPoE4S8e5pyPCVX4UQah6soYPdSksA1iXZRsCXHXYDY9xEIgF+/me8=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5R-0005aN-D2
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5R-0005g5-C6
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:33 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Update version for v5.1.0 release
Message-Id: <E1kYd5R-0005g5-C6@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:33 +0000

commit d0ed6a69d399ae193959225cdeaa9382746c91cc
Author:     Peter Maydell <peter.maydell@linaro.org>
AuthorDate: Tue Aug 11 17:07:03 2020 +0100
Commit:     Peter Maydell <peter.maydell@linaro.org>
CommitDate: Tue Aug 11 17:07:03 2020 +0100

    Update version for v5.1.0 release
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 VERSION | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VERSION b/VERSION
index c4550df997..831446cbd2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.0.93
+5.1.0
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:45 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16703.41474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5d-0007FM-Ks; Fri, 30 Oct 2020 22:41:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16703.41474; Fri, 30 Oct 2020 22:41:45 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5d-0007FF-Hx; Fri, 30 Oct 2020 22:41:45 +0000
Received: by outflank-mailman (input) for mailman id 16703;
 Fri, 30 Oct 2020 22:41:44 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd5c-0007F6-9R
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:44 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 03058873-4da0-4af3-bf4f-96e0ba2ce373;
 Fri, 30 Oct 2020 22:41:43 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5b-0005bB-Jz
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5b-0005gh-IO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:43 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd5c-0007F6-9R
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:44 +0000
X-Inumbo-ID: 03058873-4da0-4af3-bf4f-96e0ba2ce373
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 03058873-4da0-4af3-bf4f-96e0ba2ce373;
	Fri, 30 Oct 2020 22:41:43 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ft9zi9Pv5mwbd7Ch38JhzS4gI6Ouk6PpVrrdtFEwXyo=; b=MUDrb1+qONi7vuV02jUfJ3bSxy
	DQn6nt0Opo13ourfc1GzOmkusQLxdiOEQ0PHG9X51hZnHg+dxJyJ8+hn0NxaIwWRti67q0bZ+crl3
	FtDuiAAWxNbErd0KoBKKvcdfNNi9967J5ChyM0zoq9Je4SMYHPrh8nB5b2hfDI0+crx4=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5b-0005bB-Jz
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5b-0005gh-IO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:43 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] Merge tag 'v5.1.0' into 'staging'
Message-Id: <E1kYd5b-0005gh-IO@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:43 +0000

commit 34aeb4f2cc190a99cde89d7ac13b805e009272d8
Merge: d0ed6a69d399ae193959225cdeaa9382746c91cc ea6d3cd1ed79d824e605a70c3626bc437c386260
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Thu Oct 29 16:12:36 2020 +0000
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Oct 29 16:12:36 2020 +0000

    Merge tag 'v5.1.0' into 'staging'

--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Oct 30 22:41:55 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Oct 2020 22:41:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16704.41478 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5n-0007GY-Mb; Fri, 30 Oct 2020 22:41:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16704.41478; Fri, 30 Oct 2020 22:41:55 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYd5n-0007GQ-Jg; Fri, 30 Oct 2020 22:41:55 +0000
Received: by outflank-mailman (input) for mailman id 16704;
 Fri, 30 Oct 2020 22:41:54 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]
 helo=us1-amaz-eas2.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYd5m-0007GG-PO
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:54 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
 id 7ac5f7f5-ac35-4917-96e0-9c3e7cc246c0;
 Fri, 30 Oct 2020 22:41:53 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5l-0005bH-NX
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYd5l-0005hN-Mj
 for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:53 +0000
Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=anTJ=EF=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYd5m-0007GG-PO
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:54 +0000
X-Inumbo-ID: 7ac5f7f5-ac35-4917-96e0-9c3e7cc246c0
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS
	id 7ac5f7f5-ac35-4917-96e0-9c3e7cc246c0;
	Fri, 30 Oct 2020 22:41:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ofptKWYK9za5tiOk+dP1kv9ANMypvI4vwS9Vmcee1rE=; b=atZxD7OnXHookGzG5XDGYR3S7E
	t/d0KFrI3e3D/X5hHn/4vwZGwx40sztLQDgYPxkjpaHpRQBfhEDeeEjqE813TJCJr13CIaSODTZWb
	c6yR44VaODV8jldcGK/xEZGbEpXJmUtee2182bAx5ocJ9AD1LQ+4NelCa2rS3qnxBJmY=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5l-0005bH-NX
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYd5l-0005hN-Mj
	for xen-changelog@lists.xenproject.org; Fri, 30 Oct 2020 22:41:53 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [qemu-xen master] main loop: Big hammer to fix logfile disk DoS in Xen setups
Message-Id: <E1kYd5l-0005hN-Mj@xenbits.xenproject.org>
Date: Fri, 30 Oct 2020 22:41:53 +0000

commit 677cbe1324c29294bb1d1b8454b3f214725e40fd
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu May 26 16:21:56 2016 +0100
Commit:     Anthony PERARD <anthony.perard@citrix.com>
CommitDate: Thu Oct 29 16:13:29 2020 +0000

    main loop: Big hammer to fix logfile disk DoS in Xen setups
    
    Each time round the main loop, we now fstat stderr.  If it is too big,
    we dup2 /dev/null onto it.  This is not a very pretty patch but it is
    very simple, easy to see that it's correct, and has a low risk of
    collateral damage.
    
    There is no limit by default but can be adjusted by setting a new
    environment variable.
    
    This fixes CVE-2014-3672.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Tested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    
    Set the default to 0 so that it won't affect non-xen installation. The
    limit will be set by Xen toolstack.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Anthony PERARD <anthony.perard@citrix.com>
    (cherry picked from commit 44a072f0de0d57c95c2212bbce02888832b7b74f)
    (cherry picked from commit 269381bb635692856aa8789a3f322e543e0c648d)
---
 util/main-loop.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/util/main-loop.c b/util/main-loop.c
index f69f055013..5268b6ec84 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -173,6 +173,50 @@ int qemu_init_main_loop(Error **errp)
     return 0;
 }
 
+static void check_cve_2014_3672_xen(void)
+{
+    static unsigned long limit = ~0UL;
+    const int fd = 2;
+    struct stat stab;
+
+    if (limit == ~0UL) {
+        const char *s = getenv("XEN_QEMU_CONSOLE_LIMIT");
+        /* XEN_QEMU_CONSOLE_LIMIT=0 means no limit */
+        limit = s ? strtoul(s,0,0) : 0;
+    }
+    if (limit == 0)
+        return;
+
+    int r = fstat(fd, &stab);
+    if (r) {
+        perror("fstat stderr (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    if (!S_ISREG(stab.st_mode))
+        return;
+    if (stab.st_size <= limit)
+        return;
+
+    /* oh dear */
+    fprintf(stderr,"\r\n"
+            "Closing stderr due to CVE-2014-3672 limit. "
+            " Set XEN_QEMU_CONSOLE_LIMIT to number of bytes to override,"
+            " or 0 for no limit.\n");
+    fflush(stderr);
+
+    int nfd = open("/dev/null", O_WRONLY);
+    if (nfd < 0) {
+        perror("open /dev/null (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    r = dup2(nfd, fd);
+    if (r != fd) {
+        perror("dup2 /dev/null (for CVE-2014-3672 check)");
+        exit(-1);
+    }
+    close(nfd);
+}
+
 static int max_priority;
 
 #ifndef _WIN32
@@ -227,6 +271,8 @@ static int os_host_main_loop_wait(int64_t timeout)
 
     g_main_context_acquire(context);
 
+    check_cve_2014_3672_xen();
+
     glib_pollfds_fill(&timeout);
 
     qemu_mutex_unlock_iothread();
@@ -399,6 +445,8 @@ static int os_host_main_loop_wait(int64_t timeout)
 
     g_main_context_acquire(context);
 
+    check_cve_2014_3672_xen();
+
     /* XXX: need to suppress polling by better using win32 events */
     ret = 0;
     for (pe = first_polling_entry; pe != NULL; pe = pe->next) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Oct 31 11:33:11 2020
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Oct 2020 11:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.16890.41680 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYp85-0004iB-M5; Sat, 31 Oct 2020 11:33:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 16890.41680; Sat, 31 Oct 2020 11:33:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1kYp85-0004i2-Iy; Sat, 31 Oct 2020 11:33:05 +0000
Received: by outflank-mailman (input) for mailman id 16890;
 Sat, 31 Oct 2020 11:33:03 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aT31=EG=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
 id 1kYp83-0004hx-SL
 for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:03 +0000
Received: from mail.xenproject.org (unknown [104.130.215.37])
 by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
 id 39186298-6a97-4cff-9528-f9269275bf79;
 Sat, 31 Oct 2020 11:33:02 +0000 (UTC)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYp82-0002GP-BV
 for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <ian.jackson@eu.citrix.com>) id 1kYp82-0002xf-9W
 for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:02 +0000
Received: from us1-rack-iad1.inumbo.com ([172.99.69.81])
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <SRS0=aT31=EG=eu.citrix.com=ian.jackson@srs-us1.protection.inumbo.net>)
	id 1kYp83-0004hx-SL
	for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:03 +0000
X-Inumbo-ID: 39186298-6a97-4cff-9528-f9269275bf79
Received: from mail.xenproject.org (unknown [104.130.215.37])
	by us1-rack-iad1.inumbo.com (Halon) with ESMTPS
	id 39186298-6a97-4cff-9528-f9269275bf79;
	Sat, 31 Oct 2020 11:33:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8AdkGD3S1H9tbfOGBuaXNLMyKVa79wmltGq5EdgQaRg=; b=SpRrKvmGl7cJ6bs2sZzPlv03Qa
	eZ1bx9HajeTbSnR5IBpK7RGwqgam5m/c5l+BwlpOYjhpv+BerOCLclVMCo7XKQIMfHWLhuaA8Oz8R
	pXsXkSELkWbJ5/NIfMFZtCEFtxuyTn/xkotutGUUhtipr04S8GkR2rQw96qm2A/sdjRs=;
Received: from xenbits.xenproject.org ([104.239.192.120])
	by mail.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYp82-0002GP-BV
	for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.92)
	(envelope-from <ian.jackson@eu.citrix.com>)
	id 1kYp82-0002xf-9W
	for xen-changelog@lists.xenproject.org; Sat, 31 Oct 2020 11:33:02 +0000
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.13] update Xen version to 4.13.2
Message-Id: <E1kYp82-0002xf-9W@xenbits.xenproject.org>
Date: Sat, 31 Oct 2020 11:33:02 +0000

commit 0060ac29bcbdb76d49d2e248ddfcb7afa2345440
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Oct 30 12:24:39 2020 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Oct 30 12:24:39 2020 +0100

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

diff --git a/Config.mk b/Config.mk
index fb7c0511b1..6f0321a9ee 100644
--- a/Config.mk
+++ b/Config.mk
@@ -276,15 +276,15 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 20d2e5a125e34fc8501026613a71549b2a1a3e54
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.1
-MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.13.2
+MINIOS_UPSTREAM_REVISION ?= xen-RELEASE-4.13.2
 
 SEABIOS_UPSTREAM_REVISION ?= rel-1.12.1
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= xen-4.13.1
+QEMU_TRADITIONAL_REVISION ?= xen-4.13.2
 # Wed Oct 10 18:52:54 2018 +0000
 # xen/pt: allow QEMU to request MSI unmasking at bind time
 
diff --git a/xen/Makefile b/xen/Makefile
index 5db0a25b3e..4a7709bd5c 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    = 13
-export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.13


